n8n-nodes-starter/nodes/FriendGrid/descriptions/ContactDescription.ts
2022-05-31 15:00:22 +03:00

72 lines
1.4 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const contactOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: ['contact'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a contact',
},
],
default: 'create',
description: 'The operation to perform',
},
];
export const contactFields: INodeProperties[] = [
/*-------------------------------------------------------------------------- */
/* contact:create */
/* ------------------------------------------------------------------------- */
{
displayName: 'Email',
name: 'email',
required: true,
type: 'string',
displayOptions: {
show: {
resource: ['contact'],
operation: ['create'],
},
},
default: '',
description: 'Primary email for the contact',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['contact'],
operation: ['create'],
},
},
options: [
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
default: '',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
default: '',
},
],
},
];