n8n/packages/nodes-base/nodes/Keap/ContactDescription.ts

759 lines
13 KiB
TypeScript
Raw Normal View History

2020-04-01 15:10:41 -07:00
import {
INodeProperties,
2020-04-01 15:55:40 -07:00
} from 'n8n-workflow';
2020-04-01 15:10:41 -07:00
export const contactOperations: INodeProperties[] = [
2020-04-01 15:10:41 -07:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'contact',
],
},
},
options: [
{
name: 'Create/Update',
2020-04-02 16:37:40 -07:00
value: 'upsert',
2020-04-01 15:10:41 -07:00
description: 'Create/update a contact',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete an contact',
},
{
name: 'Get',
value: 'get',
description: 'Retrieve an contact',
},
{
name: 'Get All',
value: 'getAll',
description: 'Retrieve all contacts',
},
],
2020-04-02 16:37:40 -07:00
default: 'upsert',
2020-04-01 15:10:41 -07:00
description: 'The operation to perform.',
},
];
2020-04-01 15:10:41 -07:00
export const contactFields: INodeProperties[] = [
2020-04-01 15:10:41 -07:00
/* -------------------------------------------------------------------------- */
2020-04-02 16:37:40 -07:00
/* contact:upsert */
2020-04-01 15:10:41 -07:00
/* -------------------------------------------------------------------------- */
{
displayName: 'Duplicate Option',
name: 'duplicateOption',
required: true,
type: 'options',
options: [
{
name: 'Email',
value: 'email',
},
{
name: 'Email And Name',
value: 'emailAndName',
},
],
displayOptions: {
show: {
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
resource: [
'contact',
],
},
},
default: 'email',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
description: 'Performs duplicate checking by one of the following options: Email, EmailAndName. If a match is found using the option provided, the existing contact will be updated.',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
resource: [
'contact',
],
},
},
options: [
{
displayName: 'Anniversary',
name: 'anniversary',
type: 'dateTime',
default: '',
},
{
displayName: 'Company ID',
name: 'companyId',
type: 'number',
typeOptions: {
minValue: 0,
},
default: 0,
},
{
displayName: 'Contact Type',
name: 'contactType',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactTypes',
},
default: '',
},
{
displayName: 'Family Name',
name: 'familyName',
type: 'string',
default: '',
},
{
displayName: 'Given Name',
name: 'givenName',
type: 'string',
default: '',
},
{
displayName: 'IP Address',
name: 'ipAddress',
type: 'string',
default: '',
},
{
displayName: 'Job Title',
name: 'jobTitle',
type: 'string',
default: '',
},
{
displayName: 'Lead Source ID',
name: 'leadSourceId',
type: 'number',
default: 0,
},
{
displayName: 'Middle Name',
name: 'middleName',
type: 'string',
default: '',
},
{
displayName: 'Opt In Reason',
name: 'optInReason',
type: 'string',
default: '',
},
{
displayName: 'Owner ID',
name: 'ownerId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
default: '',
},
{
displayName: 'Preferred Locale',
name: 'preferredLocale',
type: 'string',
placeholder: 'en',
default: '',
},
{
displayName: 'Preferred Name',
name: 'preferredName',
type: 'string',
default: '',
},
{
displayName: 'Source Type',
name: 'sourceType',
type: 'options',
options: [
{
name: 'API',
value: 'API',
},
{
name: 'Import',
value: 'IMPORT',
},
{
name: 'Landing Page',
value: 'LANDINGPAGE',
},
{
name: 'Manual',
value: 'MANUAL',
},
{
name: 'Other',
value: 'OTHER',
},
{
name: 'Unknown',
value: 'UNKNOWN',
},
],
default: '',
},
{
displayName: 'Spouse Name',
name: 'spouseName',
type: 'string',
default: '',
},
{
displayName: 'Timezone',
name: 'timezone',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTimezones',
},
default: '',
},
{
displayName: 'Website',
name: 'website',
type: 'string',
default: '',
},
],
},
{
displayName: 'Addresses',
name: 'addressesUi',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
default: {},
2020-04-01 15:10:41 -07:00
placeholder: 'Add Address',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
},
},
options: [
{
name: 'addressesValues',
displayName: 'Address',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
options: [
{
name: 'Billing',
value: 'BILLING',
},
{
name: 'Shipping',
value: 'SHIPPING',
},
{
name: 'Other',
value: 'OTHER',
},
],
default: '',
},
{
displayName: 'Country Code',
name: 'countryCode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCountries',
},
default: '',
},
{
displayName: 'Line 1',
name: 'line1',
type: 'string',
default: '',
},
{
displayName: 'Line 2',
name: 'line2',
type: 'string',
default: '',
},
{
displayName: 'Locality',
name: 'locality',
type: 'string',
default: '',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
},
{
displayName: 'Region',
name: 'region',
type: 'string',
default: '',
},
{
displayName: 'Zip Code',
name: 'zipCode',
type: 'string',
default: '',
},
{
displayName: 'Zip Four',
name: 'zipFour',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Emails',
name: 'emailsUi',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Email',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
},
},
options: [
{
name: 'emailsValues',
displayName: 'Email',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
options: [
{
name: 'Email 1',
value: 'EMAIL1',
},
{
name: 'Email 2',
value: 'EMAIL2',
},
{
name: 'Email 3',
value: 'EMAIL3',
},
],
default: '',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
},
],
2020-10-22 06:46:03 -07:00
},
2020-04-01 15:10:41 -07:00
],
},
{
displayName: 'Faxes',
name: 'faxesUi',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Fax',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
},
},
options: [
{
name: 'faxesValues',
displayName: 'Fax',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
options: [
{
name: 'Fax 1',
value: 'FAX1',
},
{
name: 'Fax 2',
value: 'FAX2',
},
],
default: '',
},
{
displayName: 'Number',
name: 'number',
type: 'string',
default: '',
},
],
2020-10-22 06:46:03 -07:00
},
2020-04-01 15:10:41 -07:00
],
},
{
displayName: 'Phones',
name: 'phonesUi',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Phone',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
},
},
options: [
{
name: 'phonesValues',
displayName: 'Phones',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
options: [
{
name: 'Phone 1',
value: 'PHONE1',
},
{
name: 'Phone 2',
value: 'PHONE2',
},
{
name: 'Phone 3',
value: 'PHONE3',
},
{
name: 'Phone 4',
value: 'PHONE4',
},
{
name: 'Phone 5',
value: 'PHONE5',
},
],
default: '',
},
{
displayName: 'Number',
name: 'number',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Social Accounts',
name: 'socialAccountsUi',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
default: {},
2020-04-01 15:10:41 -07:00
placeholder: 'Add Social Account',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
2020-04-02 16:37:40 -07:00
'upsert',
2020-04-01 15:10:41 -07:00
],
},
},
options: [
{
name: 'socialAccountsValues',
displayName: 'Social Account',
values: [
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Facebook',
value: 'Facebook',
},
{
name: 'Twitter',
value: 'Twitter',
},
{
name: 'LinkedIn',
value: 'LinkedIn',
},
],
default: '',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'delete',
],
resource: [
'contact',
],
},
},
default: '',
},
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'contact',
],
},
},
default: '',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Options',
default: {},
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'contact',
],
},
},
options: [
{
displayName: 'Fields',
name: 'fields',
type: 'string',
default: '',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
description: 'Comma-delimited list of Contact properties to include in the response. (Some fields such as lead_source_id, custom_fields, and job_title aren\'t included, by default.).',
2020-04-01 15:10:41 -07:00
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'contact',
],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'contact',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 200,
},
default: 100,
description: 'Max number of results to return',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'contact',
],
},
},
options: [
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
},
{
displayName: 'Given Name',
name: 'givenName',
type: 'string',
default: '',
},
{
displayName: 'Family Name',
name: 'familyName',
type: 'string',
default: '',
},
{
displayName: 'Order',
name: 'order',
type: 'options',
options: [
{
name: 'Date',
value: 'date',
},
{
name: 'Email',
value: 'email',
},
{
name: 'ID',
value: 'id',
},
{
name: 'Name',
value: 'name',
},
],
default: '',
description: 'Attribute to order items by',
},
{
displayName: 'Order Direction',
name: 'orderDirection',
type: 'options',
options: [
{
name: 'ASC',
value: 'ascending',
},
{
name: 'DES',
value: 'descending',
},
],
default: '',
},
{
displayName: 'Since',
name: 'since',
type: 'dateTime',
default: '',
description: 'Date to start searching from on LastUpdated',
},
{
displayName: 'Until',
name: 'until',
type: 'dateTime',
default: '',
description: 'Date to search to on LastUpdated',
},
],
},
];