2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2020-09-10 12:56:15 -07:00
2021-12-03 00:44:16 -08:00
export const contactOperations : INodeProperties [ ] = [
2020-09-10 12:56:15 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-09-10 12:56:15 -07:00
required : true ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a new contact' ,
2022-07-10 13:50:51 -07:00
action : 'Create a contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Get a contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-09-10 12:56:15 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many contacts' ,
2022-09-08 08:10:13 -07:00
action : 'Get many contacts' ,
2020-09-10 12:56:15 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Update a contact' ,
2020-09-10 12:56:15 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-09-10 12:56:15 -07:00
2021-12-03 00:44:16 -08:00
export const contactFields : INodeProperties [ ] = [
2020-09-10 12:56:15 -07:00
/* -------------------------------------------------------------------------- */
/* contact:create/update */
/* -------------------------------------------------------------------------- */
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
placeholder : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'create' ] ,
resource : [ 'contact' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Name of the contact' ,
2020-09-10 12:56:15 -07:00
required : true ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-09-10 12:56:15 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'create' ] ,
resource : [ 'contact' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
2022-08-01 13:47:55 -07:00
description :
'Primary email address of the contact. If you want to associate additional email(s) with this contact, use the other_emails attribute.' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'update' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'create' , 'update' ] ,
resource : [ 'contact' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Address' ,
name : 'address' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Address of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
// {
// displayName: 'Avatar',
// name: 'avatar',
// type: '',
// default: '',
2021-11-25 09:10:06 -08:00
// description: `Avatar image of the contact The maximum file size is 5MB
2020-09-10 12:56:15 -07:00
// and the supported file types are .jpg, .jpeg, .jpe, and .png.`,
// },
{
displayName : 'Company ID' ,
name : 'company_id' ,
type : 'number' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'ID of the primary company to which this contact belongs' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Custom Fields' ,
name : 'customFields' ,
type : 'fixedCollection' ,
placeholder : 'Add Custom Field' ,
typeOptions : {
multipleValues : true ,
} ,
2022-08-01 13:47:55 -07:00
description :
'Key value pairs containing the name and value of the custom field. Only dates in the format YYYY-MM-DD are accepted as input for custom date fields.' ,
2020-09-10 12:56:31 -07:00
default : [ ] ,
2020-09-10 12:56:15 -07:00
options : [
{
displayName : 'Custom Field' ,
name : 'customField' ,
values : [
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description : "Custom Field's name" ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description : "Custom Field's values" ,
2020-09-10 12:56:15 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-09-10 12:56:15 -07:00
} ,
] ,
} ,
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'A small description of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-09-10 12:56:15 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
'/operation' : [ 'update' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
2022-08-01 13:47:55 -07:00
description :
'Primary email address of the contact. If you want to associate additional email(s) with this contact, use the other_emails attribute.' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Job Title' ,
name : 'job_title' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Job title of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Language' ,
name : 'language' ,
type : 'string' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
'Language of the contact. Default language is "en". This attribute can only be set if the Multiple Language feature is enabled (Garden plan and above).' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Mobile' ,
name : 'mobile' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Mobile number of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
'/operation' : [ 'update' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Name of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Other Companies' ,
name : 'other_companies' ,
type : 'string' ,
2020-09-10 12:56:31 -07:00
default : [ ] ,
2020-09-10 12:56:15 -07:00
typeOptions : {
multipleValues : true ,
} ,
placeholder : 'Add Company' ,
2022-08-01 13:47:55 -07:00
description :
'Additional companies associated with the contact. This attribute can only be set if the Multiple Companies feature is enabled (Estate plan and above).' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Other Emails' ,
name : 'other_emails' ,
type : 'string' ,
2020-09-10 12:56:31 -07:00
default : [ ] ,
2020-09-10 12:56:15 -07:00
typeOptions : {
multipleValues : true ,
} ,
placeholder : 'Add Email' ,
2022-05-06 14:01:25 -07:00
description : 'Additional emails associated with the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Phone' ,
name : 'phone' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Telephone number of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Tags' ,
name : 'tags' ,
type : 'string' ,
2020-09-10 12:56:31 -07:00
default : [ ] ,
2020-09-10 12:56:15 -07:00
typeOptions : {
multipleValues : true ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Tags associated with this contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Time Zone' ,
name : 'time_zone' ,
type : 'string' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
'Time zone of the contact. Default value is the time zone of the domain. This attribute can only be set if the Multiple Time Zone feature is enabled (Garden plan and above).' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Twitter ID' ,
name : 'twitter_id' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Twitter handle of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'Unique External ID' ,
name : 'unique_external_id' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'External ID of the contact' ,
2020-09-10 12:56:15 -07:00
} ,
{
displayName : 'View All Tickets' ,
name : 'view_all_tickets' ,
type : 'boolean' ,
2020-09-10 12:56:31 -07:00
default : false ,
2022-08-01 13:47:55 -07:00
description :
'Whether the contact can see all the tickets that are associated with the company to which they belong' ,
2020-09-10 12:56:15 -07:00
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* contact:delete */
/* -------------------------------------------------------------------------- */
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'delete' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
required : true ,
} ,
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'get' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
required : true ,
} ,
/* -------------------------------------------------------------------------- */
/* contact:getAll */
/* -------------------------------------------------------------------------- */
{
displayName : 'Filters' ,
name : 'filters' ,
type : 'collection' ,
placeholder : 'Add Filter' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'getAll' ] ,
resource : [ 'contact' ] ,
2020-09-10 12:56:15 -07:00
} ,
} ,
options : [
{
displayName : 'Company ID' ,
name : 'company_id' ,
type : 'number' ,
default : '' ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-09-10 12:56:15 -07:00
default : '' ,
} ,
{
displayName : 'Mobile' ,
name : 'mobile' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Phone' ,
name : 'phone' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'State' ,
name : 'state' ,
type : 'options' ,
default : '' ,
options : [
{
name : 'Blocked' ,
value : 'blocked' ,
} ,
{
name : 'Deleted' ,
value : 'deleted' ,
} ,
{
name : 'Unverified' ,
value : 'unverified' ,
} ,
{
name : 'Verified' ,
value : 'verified' ,
} ,
] ,
} ,
{
displayName : 'Updated Since' ,
name : 'updated_since' ,
type : 'dateTime' ,
default : '' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;