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

207 lines
4.1 KiB
TypeScript
Raw Normal View History

2020-02-28 16:55:14 -08:00
import { INodeProperties } from 'n8n-workflow';
export const contactOperations: INodeProperties[] = [
2020-02-28 16:55:14 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'contact',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a contact',
},
{
name: 'Custom Attributes',
value: 'getCustomAttributes',
description: 'Get custom attributes',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a contact',
},
{
name: 'Get',
value: 'get',
description: 'Get a contact',
},
{
name: 'Update',
value: 'update',
description: 'Update a contact',
},
],
default: 'create',
description: 'The operation to perform.',
},
];
2020-02-28 16:55:14 -08:00
export const contactFields: INodeProperties[] = [
2020-02-28 16:55:14 -08:00
/* -------------------------------------------------------------------------- */
/* contact:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Email',
name: 'email',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
},
},
2020-02-29 08:40:04 -08:00
description: 'The email of the contact.',
2020-02-28 16:55:14 -08:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'create',
],
},
},
options: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
2020-02-29 08:40:04 -08:00
description: 'The name of the contact.',
2020-02-28 16:55:14 -08:00
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
2020-02-29 08:40:04 -08:00
description: 'The phone number associated with the contact.',
2020-02-28 16:55:14 -08:00
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'update',
2020-10-22 06:46:03 -07:00
],
2020-02-28 16:55:14 -08:00
},
},
description: 'Unique identifier for the contact.',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'update',
],
},
},
options: [
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
2020-02-29 08:40:04 -08:00
description: 'The email of the contact.',
2020-02-28 16:55:14 -08:00
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
2020-02-29 08:40:04 -08:00
description: 'The name of the contact.',
2020-02-28 16:55:14 -08:00
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
2020-02-29 08:40:04 -08:00
description: 'The phone number associated with the contact.',
2020-02-28 16:55:14 -08:00
},
2020-10-22 06:46:03 -07:00
],
2020-02-28 16:55:14 -08:00
},
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'get',
2020-10-22 06:46:03 -07:00
],
2020-02-28 16:55:14 -08:00
},
},
description: 'Unique identifier for the contact.',
},
/* -------------------------------------------------------------------------- */
/* contact:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'delete',
2020-10-22 06:46:03 -07:00
],
2020-02-28 16:55:14 -08:00
},
},
description: 'Unique identifier for the contact.',
},
];