2021-04-02 08:56:45 -07:00
|
|
|
|
import {
|
|
|
|
|
INodeProperties,
|
|
|
|
|
} from 'n8n-workflow';
|
2020-01-28 07:50:15 -08:00
|
|
|
|
|
2021-04-02 08:56:45 -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',
|
|
|
|
|
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',
|
2020-02-07 20:38:13 -08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Delete',
|
|
|
|
|
value: 'delete',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: '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',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Get All',
|
|
|
|
|
value: 'getAll',
|
|
|
|
|
description: 'Get data of all contacts',
|
|
|
|
|
},
|
2020-02-03 03:57:39 -08:00
|
|
|
|
{
|
|
|
|
|
name: 'Update',
|
|
|
|
|
value: 'update',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: '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
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
|
},
|
|
|
|
|
|
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-01-28 07:50:15 -08:00
|
|
|
|
|
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,
|
|
|
|
|
operation: [
|
|
|
|
|
'getAll',
|
|
|
|
|
],
|
|
|
|
|
},
|
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,
|
|
|
|
|
operation: [
|
|
|
|
|
'getAll',
|
|
|
|
|
],
|
|
|
|
|
returnAll: [
|
|
|
|
|
false,
|
|
|
|
|
],
|
|
|
|
|
},
|
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,
|
|
|
|
|
operation: [
|
|
|
|
|
'getAll',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Is Active',
|
|
|
|
|
name: 'is_active',
|
|
|
|
|
type: 'boolean',
|
2020-02-07 20:38:13 -08:00
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Pass true 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
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Contact Id',
|
|
|
|
|
name: 'id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: [
|
|
|
|
|
'get',
|
|
|
|
|
],
|
|
|
|
|
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
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Contact Id',
|
|
|
|
|
name: 'id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: [
|
|
|
|
|
'delete',
|
|
|
|
|
],
|
|
|
|
|
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: {
|
|
|
|
|
operation: [
|
|
|
|
|
'create',
|
|
|
|
|
],
|
|
|
|
|
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
|
|
|
|
},
|
|
|
|
|
{
|
2020-02-03 04:55:21 -08: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: {
|
|
|
|
|
operation: [
|
|
|
|
|
'create',
|
|
|
|
|
],
|
|
|
|
|
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: {
|
|
|
|
|
operation: [
|
|
|
|
|
'create',
|
|
|
|
|
],
|
|
|
|
|
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',
|
|
|
|
|
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
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
{
|
2020-02-03 04:55:21 -08:00
|
|
|
|
displayName: 'Contact Id',
|
2020-02-03 04:36:51 -08:00
|
|
|
|
name: 'id',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: [
|
|
|
|
|
'update',
|
|
|
|
|
],
|
|
|
|
|
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: {
|
|
|
|
|
operation: [
|
|
|
|
|
'update',
|
|
|
|
|
],
|
|
|
|
|
resource,
|
|
|
|
|
},
|
2020-01-31 04:47:20 -08:00
|
|
|
|
},
|
2020-02-03 04:36:51 -08:00
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
2020-02-03 04:55:21 -08: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',
|
|
|
|
|
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
|
|
|
|
},
|
2020-01-28 07:50:15 -08:00
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
|
];
|