2023-01-27 03:22:44 -08:00
|
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-01-28 07:50:15 -08:00
|
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
|
const resource = ['contact'];
|
2020-01-31 05:43:40 -08:00
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
|
export const contactOperations: INodeProperties[] = [
|
2020-01-28 07:50:15 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
|
noDataExpression: true,
|
2020-01-28 07:50:15 -08:00
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2020-01-31 05:43:40 -08:00
|
|
|
|
resource,
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
2020-02-07 20:38:13 -08:00
|
|
|
|
{
|
|
|
|
|
name: 'Create',
|
|
|
|
|
value: 'create',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Create a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Create a contact',
|
2020-02-07 20:38:13 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Delete',
|
|
|
|
|
value: 'delete',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Delete a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Delete a contact',
|
2020-02-07 20:38:13 -08:00
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
{
|
|
|
|
|
name: 'Get',
|
|
|
|
|
value: 'get',
|
|
|
|
|
description: 'Get data of a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Get data of a contact',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
|
name: 'Get Many',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
|
description: 'Get data of many contacts',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Get data of all contacts',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 03:57:39 -08:00
|
|
|
|
{
|
|
|
|
|
name: 'Update',
|
|
|
|
|
value: 'update',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Update a contact',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Update a contact',
|
2020-02-03 03:57:39 -08:00
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
],
|
2020-01-28 23:04:52 -08:00
|
|
|
|
default: 'getAll',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
|
];
|
2020-01-28 07:50:15 -08:00
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
|
export const contactFields: INodeProperties[] = [
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-04-02 08:56:45 -07:00
|
|
|
|
/* contact:getAll */
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-01-28 07:50:15 -08:00
|
|
|
|
|
2020-02-03 04:36:51 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Return All',
|
|
|
|
|
name: 'returnAll',
|
|
|
|
|
type: 'boolean',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource,
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['getAll'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Limit',
|
|
|
|
|
name: 'limit',
|
|
|
|
|
type: 'number',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource,
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['getAll'],
|
|
|
|
|
returnAll: [false],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
typeOptions: {
|
|
|
|
|
minValue: 1,
|
|
|
|
|
maxValue: 100,
|
|
|
|
|
},
|
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Max number of results to return',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Filters',
|
|
|
|
|
name: 'filters',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
placeholder: 'Add Filter',
|
|
|
|
|
default: {},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource,
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['getAll'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Is Active',
|
|
|
|
|
name: 'is_active',
|
|
|
|
|
type: 'boolean',
|
2020-02-07 20:38:13 -08:00
|
|
|
|
default: true,
|
2022-06-20 07:54:01 -07:00
|
|
|
|
description: 'Whether to only return active clients and false to return inactive clients',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Updated Since',
|
|
|
|
|
name: 'updated_since',
|
|
|
|
|
type: 'dateTime',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Only return clients that have been updated since the given date and time',
|
2020-10-22 06:46:03 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-04-02 08:56:45 -07:00
|
|
|
|
/* contact:get */
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
|
displayName: 'Contact ID',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['get'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID of the contact you are retrieving',
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-04-02 08:56:45 -07:00
|
|
|
|
/* contact:delete */
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
|
displayName: 'Contact ID',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['delete'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID of the contact you want to delete',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-04-02 08:56:45 -07:00
|
|
|
|
/* contact:create */
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
2020-02-07 20:38:13 -08:00
|
|
|
|
displayName: 'First Name',
|
|
|
|
|
name: 'firstName',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The first name of the contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
|
displayName: 'Client ID',
|
2020-02-07 20:38:13 -08:00
|
|
|
|
name: 'clientId',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID of the client associated with this contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
|
name: 'additionalFields',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Email',
|
|
|
|
|
name: 'email',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
|
placeholder: 'name@email.com',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s email address',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Fax',
|
|
|
|
|
name: 'fax',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s fax number',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Last Name',
|
|
|
|
|
name: 'last_name',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The last name of the contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Phone Mobile',
|
|
|
|
|
name: 'phone_mobile',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s mobile phone number',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Phone Office',
|
|
|
|
|
name: 'phone_office',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s office phone number',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
2021-04-02 09:10:22 -07:00
|
|
|
|
|
2020-02-03 04:36:51 -08:00
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Title',
|
|
|
|
|
name: 'title',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The title of the contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
],
|
2020-01-28 07:50:15 -08:00
|
|
|
|
},
|
2020-01-31 04:47:20 -08:00
|
|
|
|
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2021-04-02 08:56:45 -07:00
|
|
|
|
/* contact:update */
|
2020-02-03 04:36:51 -08:00
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
|
displayName: 'Contact ID',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['update'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID of the contact want to update',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
|
name: 'updateFields',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['update'],
|
2020-02-03 04:36:51 -08:00
|
|
|
|
resource,
|
|
|
|
|
},
|
2020-01-31 04:47:20 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
|
displayName: 'Client ID',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'client_id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID of the client associated with this contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
2021-04-02 09:10:22 -07:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Email',
|
|
|
|
|
name: 'email',
|
|
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
|
placeholder: 'name@email.com',
|
2021-04-02 09:10:22 -07:00
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s email address',
|
2021-04-02 09:10:22 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Fax',
|
|
|
|
|
name: 'fax',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s fax number',
|
2021-04-02 09:10:22 -07:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
{
|
2020-02-07 20:38:13 -08:00
|
|
|
|
displayName: 'First Name',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'first_name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The first name of the contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2020-02-03 04:55:21 -08:00
|
|
|
|
displayName: 'Last Name',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'last_name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The last name of the contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Phone Mobile',
|
|
|
|
|
name: 'phone_mobile',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s mobile phone number',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2020-02-03 04:55:21 -08:00
|
|
|
|
displayName: 'Phone Office',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'phone_office',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The contact’s office phone number',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
2021-04-02 09:10:22 -07:00
|
|
|
|
displayName: 'Title',
|
|
|
|
|
name: 'title',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The title of the contact',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
},
|
|
|
|
|
],
|
2020-01-31 04:47:20 -08:00
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
|
];
|