2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-02-28 16:55:14 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactOperations: INodeProperties[] = [
|
2020-02-28 16:55:14 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-02-28 16:55:14 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Custom Attributes',
|
|
|
|
value: 'getCustomAttributes',
|
|
|
|
description: 'Get custom attributes',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get custom attributes for a contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-02-28 16:55:14 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactFields: INodeProperties[] = [
|
2022-08-01 13:47:55 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* contact:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-02-28 16:55:14 -08:00
|
|
|
{
|
|
|
|
displayName: 'Email',
|
|
|
|
name: 'email',
|
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
placeholder: 'name@email.com',
|
2020-02-28 16:55:14 -08:00
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
|
|
|
operation: ['create'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07: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: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
|
|
|
operation: ['create'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The name of the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Phone',
|
|
|
|
name: 'phone',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The phone number associated with the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-08-01 13:47:55 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* contact:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-02-28 16:55:14 -08:00
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
|
|
|
operation: ['update'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Unique identifier for the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
|
|
|
operation: ['update'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Email',
|
|
|
|
name: 'email',
|
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
placeholder: 'name@email.com',
|
2020-02-28 16:55:14 -08:00
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The email of the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The name of the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Phone',
|
|
|
|
name: 'phone',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07: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
|
|
|
},
|
2022-08-01 13:47:55 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* contact:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-02-28 16:55:14 -08:00
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
|
|
|
operation: ['get'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Unique identifier for the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
2022-08-01 13:47:55 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* contact:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-02-28 16:55:14 -08:00
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['contact'],
|
|
|
|
operation: ['delete'],
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Unique identifier for the contact',
|
2020-02-28 16:55:14 -08:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|