n8n/packages/nodes-base/nodes/Hubspot/FormDescription.ts
Iván Ovejero 6dcdb30bf4
refactor: Apply more nodelinting rules (#3324)
* ✏️ Alphabetize lint rules

* 🔥 Remove duplicates

*  Update `lintfix` script

* 👕 Apply `node-param-operation-without-no-data-expression` (#3329)

* 👕 Apply `node-param-operation-without-no-data-expression`

* 👕 Add exceptions

* 👕 Apply `node-param-description-weak` (#3328)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-option-value-duplicate` (#3331)

* 👕 Apply `node-param-description-miscased-json` (#3337)

* 👕 Apply `node-param-display-name-excess-inner-whitespace` (#3335)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-type-options-missing-from-limit` (#3336)

* Rule workig as intended

* ✏️ Uncomment rules

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-option-name-duplicate` (#3338)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-description-wrong-for-simplify` (#3334)

*  fix

*  exceptions

*  changed rule ignoring from file to line

* 👕 Apply `node-param-resource-without-no-data-expression` (#3339)

* 👕 Apply `node-param-display-name-untrimmed` (#3341)

* 👕 Apply `node-param-display-name-miscased-id` (#3340)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-resource-with-plural-option` (#3342)

* 👕 Apply `node-param-description-wrong-for-upsert` (#3333)

*  fix

*  replaced record with contact in description

*  fix

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-option-description-identical-to-name` (#3343)

* 👕 Apply `node-param-option-name-containing-star` (#3347)

* 👕 Apply `node-param-display-name-wrong-for-update-fields` (#3348)

* 👕 Apply `node-param-option-name-wrong-for-get-all` (#3345)

*  fix

*  exceptions

* 👕 Apply node-param-display-name-wrong-for-simplify (#3344)

* Rule working as intended

* Uncomented other rules

* 👕 Undo and add exceptions

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

*  Alphabetize lint rules

*  Restore `lintfix` script

Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
2022-05-20 23:47:24 +02:00

327 lines
7.4 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const formOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'form',
],
},
},
options: [
{
name: 'Get Fields',
value: 'getFields',
description: 'Get all fields from a form',
},
{
name: 'Submit',
value: 'submit',
description: 'Submit data to a form',
},
],
default: 'getFields',
},
];
export const formFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* form:submit */
/* -------------------------------------------------------------------------- */
{
displayName: 'Form',
name: 'formId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getForms',
},
required: true,
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'submit',
],
},
},
default: '',
description: 'The ID of the form you\'re sending data to',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'submit',
],
},
},
options: [
{
displayName: 'Skip Validation',
name: 'skipValidation',
type: 'boolean',
default: false,
description: 'Whether or not to skip validation based on the form settings',
},
{
displayName: 'Submitted At',
name: 'submittedAt',
type: 'dateTime',
default: '',
description: 'Time of the form submission',
},
],
},
{
displayName: 'Context',
name: 'contextUi',
placeholder: 'Add Context',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'submit',
],
},
},
default: {},
options: [
{
displayName: 'Context',
name: 'contextValue',
values: [
{
displayName: 'HubSpot usertoken',
name: 'hutk',
type: 'string',
default: '',
description: 'Include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission',
},
{
displayName: 'IP Address',
name: 'ipAddress',
type: 'string',
default: '',
description: 'The IP address of the visitor filling out the form',
},
{
displayName: 'Page URI',
name: 'pageUri',
type: 'string',
default: '',
description: 'The URI of the page the submission happened on',
},
{
displayName: 'Page Name',
name: 'pageName',
type: 'string',
default: '',
description: 'The name or title of the page the submission happened on',
},
{
displayName: 'Page ID',
name: 'pageId',
type: 'string',
default: '',
description: 'The ID of a page created on the HubSpot CMS',
},
{
displayName: 'SFDC campaign ID',
name: 'sfdcCampaignId',
type: 'string',
default: '',
description: 'If the form is for an account using the HubSpot Salesforce Integration, you can include the ID of a Salesforce campaign to add the contact to the specified campaign',
},
{
displayName: 'Go to Webinar Webinar ID',
name: 'goToWebinarWebinarKey',
type: 'string',
default: '',
description: 'If the form is for an account using the HubSpot GoToWebinar Integration, you can include the ID of a webinar to enroll the contact in that webinar when they submit the form',
},
],
},
],
},
{
displayName: 'Legal Consent',
name: 'lengalConsentUi',
placeholder: 'Add Legal Consent',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'submit',
],
},
},
default: {},
options: [
{
displayName: 'Consent',
name: 'lengalConsentValues',
values: [
{
displayName: 'Consent To Process',
name: 'consentToProcess',
type: 'boolean',
default: false,
description: 'Whether or not the visitor checked the Consent to process checkbox',
},
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
description: 'The text displayed to the visitor for the Consent to process checkbox',
},
{
displayName: 'Communications',
name: 'communicationsUi',
placeholder: 'Add Communication',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
displayName: 'Communication',
name: 'communicationValues',
values: [
{
displayName: 'Subcription Type',
name: 'subscriptionTypeId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getSubscriptionTypes',
},
default: '',
description: 'The ID of the specific subscription type',
},
{
displayName: 'Value',
name: 'value',
type: 'boolean',
default: false,
description: 'Whether or not the visitor checked the checkbox for this subscription type',
},
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
description: 'The text displayed to the visitor for this specific subscription checkbox',
},
],
},
],
},
],
},
{
displayName: 'Legitimate Interest',
name: 'legitimateInterestValues',
values: [
{
displayName: 'Subcription Type',
name: 'subscriptionTypeId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getSubscriptionTypes',
},
default: '',
description: 'The ID of the specific subscription type that this forms indicates interest to',
},
{
displayName: 'Value',
name: 'value',
type: 'boolean',
default: false,
description: 'This must be true when using the \'legitimateInterest\' option, as it reflects the consent indicated by the visitor when submitting the form',
},
{
displayName: 'Legal Basis',
name: 'legalBasis',
type: 'options',
options: [
{
name: 'Customer',
value: 'CUSTOMER',
},
{
name: 'Lead',
value: 'LEAD',
},
],
default: '',
description: 'The privacy text displayed to the visitor',
},
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
description: 'The privacy text displayed to the visitor',
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* form:getFields */
/* -------------------------------------------------------------------------- */
{
displayName: 'Form',
name: 'formId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getForms',
},
required: true,
displayOptions: {
show: {
resource: [
'form',
],
operation: [
'getFields',
],
},
},
default: '',
description: 'The ID of the form',
},
];