2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-08-08 00:51:44 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactFieldOperations: INodeProperties[] = [
|
2021-08-08 00:51:44 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-08-08 00:51:44 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a contact field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a contact field',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a contact field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a contact field',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Retrieve a contact field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a contact field',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
// {
|
|
|
|
// name: 'Get All',
|
|
|
|
// value: 'getAll',
|
|
|
|
// description: 'Retrieve all contact fields',
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a contact field',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a contact field',
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-08-08 00:51:44 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactFieldFields: INodeProperties[] = [
|
2021-08-08 00:51:44 -07:00
|
|
|
// ----------------------------------------
|
|
|
|
// contactField: create
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
description: 'ID of the contact to associate the contact field with',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Contact Field Type Name or ID',
|
2021-08-08 00:51:44 -07:00
|
|
|
name: 'contactFieldTypeId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2021-08-08 00:51:44 -07:00
|
|
|
required: true,
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getContactFieldTypes',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Content',
|
|
|
|
name: 'data',
|
|
|
|
description: 'Content of the contact field - max 255 characters',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['create'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// contactField: delete
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Contact Field ID',
|
|
|
|
name: 'contactFieldId',
|
|
|
|
description: 'ID of the contactField to delete',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['delete'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// contactField: get
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Contact Field ID',
|
|
|
|
name: 'contactFieldId',
|
|
|
|
description: 'ID of the contact field to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['get'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// contactField: getAll
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
description: 'ID of the contact whose fields to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['getAll'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['getAll'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-08-08 00:51:44 -07:00
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// contactField: update
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'contactId',
|
|
|
|
description: 'ID of the contact to associate the contact field with',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['update'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Contact Field ID',
|
|
|
|
name: 'contactFieldId',
|
|
|
|
description: 'ID of the contact field to update',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['update'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Contact Field Type Name or ID',
|
2021-08-08 00:51:44 -07:00
|
|
|
name: 'contactFieldTypeId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2021-08-08 00:51:44 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getContactFieldTypes',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['update'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Content',
|
|
|
|
name: 'data',
|
|
|
|
description: 'Content of the contact field - max 255 characters',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactField'],
|
|
|
|
operation: ['update'],
|
2021-08-08 00:51:44 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|