n8n/packages/nodes-base/nodes/Mautic/ContactDescription.ts
Mutasem Aldmour ce066a160f
Remove unnessasry <br/> (#2340)
* introduce analytics

* add user survey backend

* add user survey backend

* set answers on survey submit

Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>

* change name to personalization

* lint

Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>

* N8n 2495 add personalization modal (#2280)

* update modals

* add onboarding modal

* implement questions

* introduce analytics

* simplify impl

* implement survey handling

* add personalized cateogry

* update modal behavior

* add thank you view

* handle empty cases

* rename modal

* standarize modal names

* update image, add tags to headings

* remove unused file

* remove unused interfaces

* clean up footer spacing

* introduce analytics

* refactor to fix bug

* update endpoint

* set min height

* update stories

* update naming from questions to survey

* remove spacing after core categories

* fix bug in logic

* sort nodes

* rename types

* merge with be

* rename userSurvey

* clean up rest api

* use constants for keys

* use survey keys

* clean up types

* move personalization to its own file

Co-authored-by: ahsan-virani <ahsan.virani@gmail.com>

* update parameter inputs to be multiline

* update spacing

* Survey new options (#2300)

* split up options

* fix quotes

* remove unused import

* refactor node credentials

* add user created workflow event (#2301)

* update multi params

* simplify env vars

* fix versionCli on FE

* update personalization env

* clean up node detail settings

* fix event User opened Credentials panel

* fix font sizes across modals

* clean up input spacing

* fix select modal spacing

* increase spacing

* fix input copy

* fix webhook, tab spacing, retry button

* fix button sizes

* fix button size

* add mini xlarge sizes

* fix webhook spacing

* fix nodes panel event

* fix workflow id in workflow execute event

* improve telemetry error logging

* fix config and stop process events

* add flush call on n8n stop

* ready for release

* fix input error highlighting

* revert change

* update toggle spacing

* fix delete positioning

* keep tooltip while focused

* set strict size

* increase left spacing

* fix sort icons

* remove unnessasry <br/>

* remove unnessary break

* remove unnessary margin

* clean unused functionality

* remove unnessary css

* remove duplicate tracking

* only show tooltip when hovering over label

* remove extra space

* add br

* remove extra space

* clean up commas

* clean up commas

* remove extra space

* remove extra space

* rewrite desc

* add commas

* add space

* remove extra space

* add space

* add dot

* update credentials section

* use includes

Co-authored-by: ahsan-virani <ahsan.virani@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-10-27 15:00:13 -05:00

1243 lines
22 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const contactOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'contact',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new contact',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a contact',
},
{
name: 'Get',
value: 'get',
description: 'Get data of a contact',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get data of all contacts',
},
{
name: 'Update',
value: 'update',
description: 'Update a contact',
},
],
default: 'create',
description: 'The operation to perform.',
},
] as INodeProperties[];
export const contactFields = [
/* -------------------------------------------------------------------------- */
/* contact:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
description: '',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'contact',
],
},
},
},
{
displayName: 'Email',
name: 'email',
type: 'string',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
jsonParameters: [
false,
],
},
},
default: '',
description: 'Email address of the contact.',
},
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
jsonParameters: [
false,
],
},
},
default: '',
description: 'First Name',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
jsonParameters: [
false,
],
},
},
default: '',
description: 'Last Name',
},
{
displayName: 'Primary Company',
name: 'company',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCompanies',
},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
jsonParameters: [
false,
],
},
},
default: '',
description: 'Primary company',
},
{
displayName: 'Position',
name: 'position',
type: 'string',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
jsonParameters: [
false,
],
},
},
default: '',
description: 'Position',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
jsonParameters: [
false,
],
},
},
default: '',
description: 'Title',
},
{
displayName: 'Body',
name: 'bodyJson',
type: 'json',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'contact',
],
jsonParameters: [
true,
],
},
},
default: '',
description: 'Contact parameters',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
},
},
options: [
{
displayName: 'Address',
name: 'addressUi',
placeholder: 'Address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'addressValues',
displayName: 'Address',
values: [
{
displayName: 'Address Line 1',
name: 'address1',
type: 'string',
default: '',
},
{
displayName: 'Address Line 2',
name: 'address2',
type: 'string',
default: '',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
},
{
displayName: 'Zip Code',
name: 'zipCode',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'B2B or B2C',
name: 'b2bOrb2c',
type: 'options',
options: [
{
name: 'B2B',
value: 'B2B',
},
{
name: 'B2C',
value: 'B2C',
},
],
default: '',
},
{
displayName: 'CRM ID',
name: 'crmId',
type: 'string',
default: '',
},
{
displayName: 'Custom Fields',
name: 'customFieldsUi',
placeholder: 'Add Custom Fields',
description: 'Adds a custom fields to set also values which have not been predefined.',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'customFieldValues',
displayName: 'Field',
values: [
{
displayName: 'Field ID',
name: 'fieldId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactFields',
},
default: '',
description: 'ID of the field to set.',
},
{
displayName: 'Field Value',
name: 'fieldValue',
type: 'string',
default: '',
description: 'Value of the field to set.',
},
],
},
],
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
},
{
displayName: 'Has Purchased',
name: 'hasPurchased',
type: 'boolean',
default: false,
},
{
displayName: 'IP Address',
name: 'ipAddress',
type: 'string',
default: '',
description: 'IP address to associate with the contact',
},
{
displayName: 'Last Active',
name: 'lastActive',
type: 'dateTime',
default: '',
description: 'Date/time in UTC;',
},
{
displayName: 'Mobile',
name: 'mobile',
type: 'string',
default: '',
},
{
displayName: 'Owner ID',
name: 'ownerId',
type: 'string',
default: '',
description: 'ID of a Mautic user to assign this contact to',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
},
{
displayName: 'Prospect or Customer',
name: 'prospectOrCustomer',
type: 'options',
options: [
{
name: 'Prospect',
value: 'Prospect',
},
{
name: 'Customer',
value: 'Customer',
},
],
default: '',
},
{
displayName: 'Sandbox',
name: 'sandbox',
type: 'boolean',
default: false,
},
{
displayName: 'Stage',
name: 'stage',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getStages',
},
default: '',
},
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: '',
},
{
displayName: 'Social Media',
name: 'socialMediaUi',
placeholder: 'Social Media',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'socialMediaValues',
displayName: 'Social Media',
values: [
{
displayName: 'Facebook',
name: 'facebook',
type: 'string',
default: '',
},
{
displayName: 'Foursquare',
name: 'foursquare',
type: 'string',
default: '',
},
{
displayName: 'Instagram',
name: 'instagram',
type: 'string',
default: '',
},
{
displayName: 'LinkedIn',
name: 'linkedIn',
type: 'string',
default: '',
},
{
displayName: 'Skype',
name: 'skype',
type: 'string',
default: '',
},
{
displayName: 'Twitter',
name: 'twitter',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Website',
name: 'website',
type: 'string',
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'contact',
],
},
},
default: '',
description: 'Contact ID',
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
description: '',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'contact',
],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'update',
],
},
},
options: [
{
displayName: 'Body',
name: 'bodyJson',
type: 'json',
displayOptions: {
show: {
'/jsonParameters': [
true,
],
},
},
default: '',
description: 'Contact parameters',
},
{
displayName: 'Address',
name: 'addressUi',
placeholder: 'Address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: {},
options: [
{
name: 'addressValues',
displayName: 'Address',
values: [
{
displayName: 'Address Line 1',
name: 'address1',
type: 'string',
default: '',
},
{
displayName: 'Address Line 2',
name: 'address2',
type: 'string',
default: '',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
},
{
displayName: 'Zip Code',
name: 'zipCode',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'B2B or B2C',
name: 'b2bOrb2c',
type: 'options',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
options: [
{
name: 'B2B',
value: 'B2B',
},
{
name: 'B2C',
value: 'B2C',
},
],
default: '',
},
{
displayName: 'CRM ID',
name: 'crmId',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
},
{
displayName: 'Custom Fields',
name: 'customFieldsUi',
placeholder: 'Add Custom Fields',
description: 'Adds a custom fields to set also values which have not been predefined.',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'customFieldValues',
displayName: 'Field',
values: [
{
displayName: 'Field ID',
name: 'fieldId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactFields',
},
default: '',
description: 'ID of the field to set.',
},
{
displayName: 'Field Value',
name: 'fieldValue',
type: 'string',
default: '',
description: 'Value of the field to set.',
},
],
},
],
},
{
displayName: 'Email',
name: 'email',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'Email address of the contact.',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
},
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'First Name',
},
{
displayName: 'Has Purchased',
name: 'hasPurchased',
type: 'boolean',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: false,
},
{
displayName: 'IP Address',
name: 'ipAddress',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'IP address to associate with the contact',
},
{
displayName: 'Last Active',
name: 'lastActive',
type: 'dateTime',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'Date/time in UTC;',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'LastName',
},
{
displayName: 'Mobile',
name: 'mobile',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
},
{
displayName: 'Owner ID',
name: 'ownerId',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'ID of a Mautic user to assign this contact to',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
},
{
displayName: 'Position',
name: 'position',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'Position',
},
{
displayName: 'Primary Company',
name: 'company',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCompanies',
},
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'Primary company',
},
{
displayName: 'Prospect or Customer',
name: 'prospectOrCustomer',
type: 'options',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
options: [
{
name: 'Prospect',
value: 'Prospect',
},
{
name: 'Customer',
value: 'Customer',
},
],
default: '',
},
{
displayName: 'Sandbox',
name: 'sandbox',
type: 'boolean',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: false,
},
{
displayName: 'Stage',
name: 'stage',
type: 'options',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
typeOptions: {
loadOptionsMethod: 'getStages',
},
default: '',
},
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: '',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'Title',
},
{
displayName: 'Social Media',
name: 'socialMediaUi',
placeholder: 'Social Media',
type: 'fixedCollection',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'socialMediaValues',
displayName: 'Social Media',
values: [
{
displayName: 'Facebook',
name: 'facebook',
type: 'string',
default: '',
},
{
displayName: 'Foursquare',
name: 'foursquare',
type: 'string',
default: '',
},
{
displayName: 'Instagram',
name: 'instagram',
type: 'string',
default: '',
},
{
displayName: 'LinkedIn',
name: 'linkedIn',
type: 'string',
default: '',
},
{
displayName: 'Skype',
name: 'skype',
type: 'string',
default: '',
},
{
displayName: 'Twitter',
name: 'twitter',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Website',
name: 'website',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
},
{
displayName: 'IP Address',
name: 'ipAddress',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
default: '',
description: 'IP address to associate with the contact',
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'contact',
],
},
},
default: '',
description: 'Contact ID',
},
/* -------------------------------------------------------------------------- */
/* contact:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'getAll',
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 30,
},
default: 30,
description: 'How many results to return.',
},
/* -------------------------------------------------------------------------- */
/* contact:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
displayOptions: {
show: {
operation: [
'delete',
],
resource: [
'contact',
],
},
},
default: '',
description: 'Contact ID',
},
/* -------------------------------------------------------------------------- */
/* contact:all */
/* -------------------------------------------------------------------------- */
{
displayName: 'Options',
name: 'options',
type: 'collection',
displayOptions: {
show: {
'resource': [
'contact',
],
},
},
placeholder: 'Add Option',
default: {},
options: [
{
displayName: 'Search',
name: 'search',
type: 'string',
displayOptions: {
show: {
'/resource': [
'contact',
],
'/operation': [
'getAll',
],
},
},
default: '',
description: 'String or search command to filter entities by.',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
displayOptions: {
show: {
'/resource': [
'contact',
],
'/operation': [
'getAll',
],
},
},
default: '',
description: 'Column to sort by. Can use any column listed in the response.',
},
{
displayName: 'Order By Dir',
name: 'orderByDir',
type: 'options',
displayOptions: {
show: {
'/resource': [
'contact',
],
'/operation': [
'getAll',
],
},
},
default: '',
options: [
{
name: 'ASC',
value: 'asc',
},
{
name: 'DESC',
value: 'desc',
},
],
description: 'Sort direction: ASC or DESC.',
},
{
displayName: 'Published Only',
name: 'publishedOnly',
type: 'boolean',
displayOptions: {
show: {
'/resource': [
'contact',
],
'/operation': [
'getAll',
],
},
},
default: false,
description: 'Only return currently published entities.',
},
{
displayName: 'Minimal',
name: 'minimal',
type: 'boolean',
displayOptions: {
show: {
'/resource': [
'contact',
],
'/operation': [
'getAll',
],
},
},
default: false,
description: 'Return only array of entities without additional lists in it.',
},
{
displayName: 'RAW Data',
name: 'rawData',
type: 'boolean',
default: true,
description: `By default only the data of the fields get returned. If this
options gets set the RAW response with all data gets returned.`,
},
],
},
] as INodeProperties[];