2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2021-07-30 07:12:30 -07:00
2021-12-03 00:44:16 -08:00
export const contactOperations : INodeProperties [ ] = [
2021-07-30 07:12:30 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-07-30 07:12:30 -07:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Create a contact' ,
2021-07-30 07:12:30 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a contact' ,
2021-07-30 07:12:30 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Retrieve a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Get a contact' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2021-07-30 07:12:30 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Retrieve many contacts' ,
2022-09-08 08:10:13 -07:00
action : 'Get many contacts' ,
2021-07-30 07:12:30 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Update a contact' ,
2021-07-30 07:12:30 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-07-30 07:12:30 -07:00
2021-12-03 00:44:16 -08:00
export const contactFields : INodeProperties [ ] = [
2021-07-30 07:12:30 -07:00
// ----------------------------------------
// contact: create
// ----------------------------------------
{
displayName : 'First Name' ,
name : 'firstName' ,
description : 'First name of the contact' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'create' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
{
displayName : 'Last Name' ,
name : 'lastName' ,
description : 'Last name of the contact' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'create' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
{
displayName : 'Email Address' ,
name : 'emails' ,
type : 'string' ,
default : '' ,
description : 'Email addresses of the contact' ,
required : true ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'create' ] ,
2021-07-30 07:12:30 -07: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' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
options : [
{
displayName : 'Address' ,
name : 'address' ,
type : 'string' ,
default : '' ,
description : 'Address of the contact' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'campaign_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getCampaigns' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the campaign that led your contact to your webapp. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'City' ,
name : 'city' ,
type : 'string' ,
default : '' ,
description : 'City that the contact belongs to' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Contact Status Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'contact_status_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getContactStatuses' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the contact status that the contact belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'Country' ,
name : 'country' ,
type : 'string' ,
default : '' ,
description : 'Country that the contact belongs to' ,
} ,
{
displayName : 'External ID' ,
name : 'external_id' ,
type : 'string' ,
default : '' ,
description : 'External ID of the contact' ,
} ,
{
displayName : 'Facebook' ,
name : 'facebook' ,
type : 'string' ,
default : '' ,
description : 'Facebook username of the contact' ,
} ,
{
displayName : 'Job Title' ,
name : 'job_title' ,
type : 'string' ,
default : '' ,
description : 'Designation of the contact in the account they belong to' ,
} ,
{
displayName : 'Keywords' ,
name : 'keyword' ,
type : 'string' ,
default : '' ,
description : 'Keywords that the contact used to reach your website/web app' ,
} ,
{
displayName : 'Lead Source ID' ,
name : 'lead_source_id' ,
type : 'string' , // not obtainable from API
default : '' ,
description : 'ID of the source where contact came from' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lifecycle Stage Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'lifecycle_stage_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getLifecycleStages' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the lifecycle stage that the contact belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'LinkedIn' ,
name : 'linkedin' ,
type : 'string' ,
default : '' ,
description : 'LinkedIn account of the contact' ,
} ,
{
displayName : 'Medium' ,
name : 'medium' ,
type : 'string' ,
default : '' ,
description : 'Medium that led your contact to your website/webapp' ,
} ,
{
displayName : 'Mobile Number' ,
name : 'mobile_number' ,
type : 'string' ,
default : '' ,
description : 'Mobile phone number of the contact' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'owner_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the user to whom the contact is assigned. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Sales Account Names or IDs' ,
2021-07-30 07:12:30 -07:00
name : 'sales_accounts' ,
type : 'multiOptions' ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getAccounts' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'Accounts which contact belongs to. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'State' ,
name : 'state' ,
type : 'string' ,
default : '' ,
description : 'State that the contact belongs to' ,
} ,
{
displayName : 'Subscription Status' ,
name : 'subscription_status' ,
type : 'string' , // not obtainable from API
default : '' ,
description : 'Status of subscription that the contact is in' ,
} ,
{
displayName : 'Subscription Types' ,
name : 'subscription_types' ,
type : 'string' , // not obtainable from API
default : '' ,
description : 'Type of subscription that the contact is in' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Territory Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'territory_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getTerritories' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the territory that the contact belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'Time Zone' ,
name : 'time_zone' ,
type : 'string' ,
default : '' ,
description : 'Timezone that the contact belongs to' ,
} ,
{
displayName : 'Twitter' ,
name : 'twitter' ,
type : 'string' ,
default : '' ,
description : 'Twitter username of the contact' ,
} ,
{
displayName : 'Work Number' ,
name : 'work_number' ,
type : 'string' ,
default : '' ,
description : 'Work phone number of the contact' ,
} ,
{
displayName : 'Zipcode' ,
name : 'zipcode' ,
type : 'string' ,
default : '' ,
description : 'Zipcode of the region that the contact belongs to' ,
} ,
] ,
} ,
// ----------------------------------------
// contact: delete
// ----------------------------------------
{
displayName : 'Contact ID' ,
name : 'contactId' ,
description : 'ID of the contact to delete' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'delete' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// contact: get
// ----------------------------------------
{
displayName : 'Contact ID' ,
name : 'contactId' ,
description : 'ID of the contact to retrieve' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'get' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// contact: getAll
// ----------------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'View Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'view' ,
type : 'options' ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>' ,
2021-07-30 07:12:30 -07:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'getAll' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
typeOptions : {
loadOptionsMethod : 'getContactViews' ,
} ,
default : '' ,
} ,
{
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-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'getAll' ] ,
2021-07-30 07:12:30 -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-07-30 07:12:30 -07:00
typeOptions : {
minValue : 1 ,
} ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// contact: update
// ----------------------------------------
{
displayName : 'Contact ID' ,
name : 'contactId' ,
description : 'ID of the contact to update' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'contact' ] ,
operation : [ 'update' ] ,
2021-07-30 07:12:30 -07: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' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
options : [
{
displayName : 'Address' ,
name : 'address' ,
type : 'string' ,
default : '' ,
description : 'Address of the contact' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'campaign_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getCampaigns' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the campaign that led your contact to your webapp. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'City' ,
name : 'city' ,
type : 'string' ,
default : '' ,
description : 'City that the contact belongs to' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Contact Status Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'contact_status_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getContactStatuses' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the contact status that the contact belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'Country' ,
name : 'country' ,
type : 'string' ,
default : '' ,
description : 'Country that the contact belongs to' ,
} ,
{
displayName : 'External ID' ,
name : 'external_id' ,
type : 'string' ,
default : '' ,
description : 'External ID of the contact' ,
} ,
{
displayName : 'Facebook' ,
name : 'facebook' ,
type : 'string' ,
default : '' ,
description : 'Facebook username of the contact' ,
} ,
{
displayName : 'First Name' ,
name : 'first_name' ,
type : 'string' ,
default : '' ,
description : 'First name of the contact' ,
} ,
{
displayName : 'Job Title' ,
name : 'job_title' ,
type : 'string' ,
default : '' ,
description : 'Designation of the contact in the account they belong to' ,
} ,
{
displayName : 'Keywords' ,
name : 'keyword' ,
type : 'string' ,
default : '' ,
description : 'Keywords that the contact used to reach your website/web app' ,
} ,
{
displayName : 'Last Name' ,
name : 'last_name' ,
type : 'string' ,
default : '' ,
description : 'Last name of the contact' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lead Source Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'lead_source_id' ,
type : 'options' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the source where contact came from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lifecycle Stage Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'lifecycle_stage_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getLifecycleStages' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the lifecycle stage that the contact belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'LinkedIn' ,
name : 'linkedin' ,
type : 'string' ,
default : '' ,
description : 'LinkedIn account of the contact' ,
} ,
{
displayName : 'Medium' ,
name : 'medium' ,
type : 'string' ,
default : '' ,
description : 'Medium that led your contact to your website/webapp' ,
} ,
{
displayName : 'Mobile Number' ,
name : 'mobile_number' ,
type : 'string' ,
default : '' ,
description : 'Mobile phone number of the contact' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'owner_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the user to whom the contact is assigned. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Sales Account Names or IDs' ,
2021-07-30 07:12:30 -07:00
name : 'sales_accounts' ,
type : 'multiOptions' ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getAccounts' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'Accounts which contact belongs to. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'State' ,
name : 'state' ,
type : 'string' ,
default : '' ,
description : 'State that the contact belongs to' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Subscription Status Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'subscription_status' ,
type : 'options' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'Status of subscription that the contact is in. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Subscription Types Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'subscription_types' ,
type : 'options' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'Type of subscription that the contact is in. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Territory Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'territory_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getTerritories' ,
} ,
2022-08-01 13:47:55 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the territory that the contact belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
displayName : 'Time Zone' ,
name : 'time_zone' ,
type : 'string' ,
default : '' ,
description : 'Timezone that the contact belongs to' ,
} ,
{
displayName : 'Twitter' ,
name : 'twitter' ,
type : 'string' ,
default : '' ,
description : 'Twitter username of the contact' ,
} ,
{
displayName : 'Work Number' ,
name : 'work_number' ,
type : 'string' ,
default : '' ,
description : 'Work phone number of the contact' ,
} ,
{
displayName : 'Zipcode' ,
name : 'zipcode' ,
type : 'string' ,
default : '' ,
description : 'Zipcode of the region that the contact belongs to' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;