n8n/packages/nodes-base/nodes/Intercom/LeadDescription.ts

516 lines
9.8 KiB
TypeScript
Raw Normal View History

2021-01-13 11:20:30 -08:00
import { INodeProperties } from 'n8n-workflow';
2019-11-16 14:16:11 -08:00
export const leadOpeations: INodeProperties[] = [
2019-11-16 14:16:11 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'lead',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new lead',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a lead',
},
2019-11-20 06:45:58 -08:00
{
name: 'Get',
value: 'get',
description: 'Get data of a lead',
2019-11-20 06:45:58 -08:00
},
2019-11-21 09:39:04 -08:00
{
name: 'Get All',
value: 'getAll',
description: 'Get data of all leads',
2019-11-21 09:39:04 -08:00
},
{
name: 'Update',
value: 'update',
description: 'Update new lead',
2019-11-21 09:39:04 -08:00
},
2019-11-16 14:16:11 -08:00
],
default: 'create',
2019-11-16 14:16:11 -08:00
description: 'The operation to perform.',
},
];
2019-11-16 14:16:11 -08:00
export const leadFields: INodeProperties[] = [
2019-11-21 09:39:04 -08:00
/* -------------------------------------------------------------------------- */
/* lead:delete */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Delete By',
name: 'deleteBy',
type: 'options',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'delete',
],
},
},
options: [
{
name: 'ID',
value: 'id',
description: 'The Intercom defined id representing the Lead',
},
{
name: 'User ID',
value: 'userId',
description: 'Automatically generated identifier for the Lead',
},
],
default: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
2019-11-21 09:39:04 -08:00
required: true,
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'delete',
],
},
},
description: 'Delete by value',
},
/* -------------------------------------------------------------------------- */
/* lead:get */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Select By',
name: 'selectBy',
2019-11-21 09:39:04 -08:00
type: 'options',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'get',
2019-11-21 09:39:04 -08:00
],
},
},
options: [
{
name: 'Email',
value: 'email',
description: 'Email representing the Lead',
},
2019-11-21 09:39:04 -08:00
{
name: 'ID',
value: 'id',
description: 'The Intercom defined id representing the Lead',
},
{
name: 'User ID',
value: 'userId',
description: 'Automatically generated identifier for the Lead',
},
{
name: 'Phone',
value: 'phone',
description: 'Phone representing the Lead',
},
],
default: '',
description: 'The property to select the lead by.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'get',
2019-11-21 09:39:04 -08:00
],
},
},
description: 'View by value',
},
/* -------------------------------------------------------------------------- */
/* lead:getAll */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'getAll',
2019-11-21 09:39:04 -08:00
],
},
},
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: [
'lead',
],
operation: [
'getAll',
],
returnAll: [
false,
],
2019-11-21 09:39:04 -08:00
},
},
typeOptions: {
minValue: 1,
maxValue: 60,
},
default: 50,
description: 'How many results to return.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'getAll',
2019-11-21 09:39:04 -08:00
],
},
},
options: [
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
description: 'The email address of the lead',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
description: 'The phone number of the lead',
},
2020-10-22 06:46:03 -07:00
],
2019-11-21 09:39:04 -08:00
},
/* -------------------------------------------------------------------------- */
/* lead:update */
/* -------------------------------------------------------------------------- */
2019-11-20 06:45:58 -08:00
{
displayName: 'Update By',
name: 'updateBy',
type: 'options',
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'update',
],
},
},
options: [
{
2019-11-21 09:39:04 -08:00
name: 'User ID',
2019-11-20 06:45:58 -08:00
value: 'userId',
description: 'Automatically generated identifier for the Lead',
},
{
2019-11-21 09:39:04 -08:00
name: 'ID',
2019-11-20 06:45:58 -08:00
value: 'id',
description: 'The Intercom defined id representing the Lead',
},
],
default: 'id',
description: 'The property via which to query the lead.',
2019-11-20 06:45:58 -08:00
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'update',
],
},
},
description: 'Value of the property to identify the lead to update',
2019-11-20 06:45:58 -08:00
},
2019-11-21 09:39:04 -08:00
/* -------------------------------------------------------------------------- */
/* lead:create */
/* -------------------------------------------------------------------------- */
2019-11-16 14:16:11 -08:00
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'create',
],
},
},
description: 'The email of the user.',
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
displayOptions: {
show: {
operation: [
'create',
2019-11-20 06:45:58 -08:00
'update',
2019-11-16 14:16:11 -08:00
],
resource: [
'lead',
2019-11-16 14:16:11 -08:00
],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
2019-11-16 14:16:11 -08:00
type: 'collection',
placeholder: 'Add Field',
2019-11-16 14:16:11 -08:00
default: {},
displayOptions: {
show: {
operation: [
'create',
2019-11-20 06:45:58 -08:00
'update',
2019-11-16 14:16:11 -08:00
],
resource: [
'lead',
2019-11-16 14:16:11 -08:00
],
},
},
options: [
{
displayName: 'Avatar',
name: 'avatar',
2019-11-16 14:16:11 -08:00
type: 'string',
default: '',
description: 'An avatar image URL. note: the image url needs to be https.',
2019-11-16 14:16:11 -08:00
},
{
displayName: 'Companies',
name: 'companies',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getCompanies',
},
default: [],
description: 'Identifies the companies this user belongs to.',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
displayOptions: {
show: {
'/resource': [
'lead',
],
'/operation': [
'update',
],
},
},
description: 'The email of the user.',
},
2019-11-16 14:16:11 -08:00
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Name of the user',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
description: 'The phone number of the user',
},
2019-11-16 14:16:11 -08:00
{
displayName: 'Unsubscribed From Emails',
name: 'unsubscribedFromEmails',
type: 'boolean',
default: false,
2019-11-16 14:16:11 -08:00
description: 'Whether the Lead is unsubscribed from emails',
},
{
displayName: 'Update Last Request At',
name: 'updateLastRequestAt',
type: 'boolean',
default: false,
:zap: 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 13:00:13 -07:00
description: 'A boolean value, which if true, instructs Intercom to update the users last_request_at value to the current API service time in UTC. default value if not sent is false.',
2019-11-16 14:16:11 -08:00
},
{
displayName: 'UTM Campaign',
name: 'utmCampaign',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
description: 'Identifies a specific product promotion or strategic campaign',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Content',
name: 'utmContent',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
description: 'Identifies what specifically was clicked to bring the user to the site',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Medium',
name: 'utmMedium',
type: 'string',
default: '',
description: 'Identifies what type of link was used',
},
{
displayName: 'UTM Source',
name: 'utmSource',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
description: 'An avatar image URL. note: the image url needs to be https.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Term',
name: 'utmTerm',
type: 'string',
default: '',
description: 'Identifies search terms',
},
2020-10-22 06:46:03 -07:00
],
2019-11-16 14:16:11 -08:00
},
{
displayName: 'Custom Attributes',
2019-11-16 15:47:28 -08:00
name: 'customAttributesJson',
type: 'json',
required: false,
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'create',
2019-11-20 06:45:58 -08:00
'update',
2019-11-16 15:47:28 -08:00
],
jsonParameters: [
true,
],
},
},
default: '',
description: 'A hash of key/value pairs to represent custom data you want to attribute to a user.',
},
{
displayName: 'Custom Attributes',
name: 'customAttributesUi',
2019-11-16 14:16:11 -08:00
type: 'fixedCollection',
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: {},
2019-11-16 14:16:11 -08:00
placeholder: 'Add Attribute',
typeOptions: {
multipleValues: true,
},
required: false,
displayOptions: {
show: {
resource: [
'lead',
],
operation: [
'create',
2019-11-20 06:45:58 -08:00
'update',
2019-11-16 14:16:11 -08:00
],
jsonParameters: [
false,
],
},
},
options: [
{
name: 'customAttributesValues',
displayName: 'Attributes',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
],
2020-10-22 06:46:03 -07:00
},
2019-11-16 14:16:11 -08:00
],
description: 'A hash of key/value pairs to represent custom data you want to attribute to a user.',
},
];