2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-04-17 14:42:41 -07:00
2021-12-03 00:44:16 -08:00
export const contactOperations : INodeProperties [ ] = [
2020-04-17 14:42:41 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-04-17 14:42:41 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'Create or Update' ,
2020-04-17 14:42:41 -07:00
value : 'upsert' ,
2022-08-17 08:50:24 -07:00
description :
'Create a new contact, or update the current one if it already exists (upsert)' ,
2022-07-10 13:50:51 -07:00
action : 'Create or update a contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
2020-07-24 03:56:41 -07:00
description : 'Delete a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a contact' ,
2022-07-10 13:50:51 -07:00
action : 'Get a contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-04-17 14:42:41 -07:00
value : 'getAll' ,
description : 'Get all contacts' ,
2022-09-08 08:10:13 -07:00
action : 'Get many contacts' ,
2020-04-17 14:42:41 -07:00
} ,
{
name : 'Get Recently Created/Updated' ,
value : 'getRecentlyCreatedUpdated' ,
description : 'Get recently created/updated contacts' ,
2022-07-10 13:50:51 -07:00
action : 'Get recently created/updated contacts' ,
2020-04-17 14:42:41 -07:00
} ,
2020-08-21 15:04:12 -07:00
{
name : 'Search' ,
value : 'search' ,
description : 'Search contacts' ,
2022-07-10 13:50:51 -07:00
action : 'Search contacts' ,
2020-08-21 15:04:12 -07:00
} ,
2020-04-17 14:42:41 -07:00
] ,
default : 'upsert' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-04-17 14:42:41 -07:00
2021-12-03 00:44:16 -08:00
export const contactFields : INodeProperties [ ] = [
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* contact:upsert */
/* -------------------------------------------------------------------------- */
2020-04-17 14:42:41 -07:00
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-04-17 14:42:41 -07:00
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'upsert' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
default : '' ,
} ,
{
displayName : 'Resolve Data' ,
name : 'resolveData' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'upsert' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
default : true ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-17 08:50:24 -07:00
description :
'By default the response only includes the ID. If this option gets activated, it will resolve the data automatically.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'upsert' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
options : [
{
displayName : 'Annual Revenue' ,
name : 'annualRevenue' ,
type : 'number' ,
typeOptions : {
minValue : 0 ,
} ,
default : 0 ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Associated Company Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'associatedCompanyId' ,
type : 'options' ,
typeOptions : {
2021-01-31 23:31:40 -08:00
loadOptionsMethod : 'getCompanies' ,
2020-04-17 14:42:41 -07:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Companies associated with the ticket. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'City' ,
name : 'city' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Clicked Facebook Ad' ,
name : 'clickedFacebookAd' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Close Date' ,
name : 'closeDate' ,
type : 'dateTime' ,
default : '' ,
} ,
{
displayName : 'Company Name' ,
name : 'companyName' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Company Size' ,
name : 'companySize' ,
type : 'string' ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Contact Owner Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'contactOwner' ,
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>' ,
2020-04-17 14:42:41 -07:00
typeOptions : {
loadOptionsMethod : 'getOwners' ,
} ,
default : '' ,
} ,
{
displayName : 'Country/Region' ,
name : 'country' ,
type : 'string' ,
default : '' ,
} ,
2020-08-26 23:20:29 -07:00
{
displayName : 'Custom Properties' ,
name : 'customPropertiesUi' ,
placeholder : 'Add Custom Property' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'customPropertiesValues' ,
displayName : 'Custom Property' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Property Name or ID' ,
2020-08-26 23:20:29 -07:00
name : 'property' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactCustomProperties' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Name of the property. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-08-26 23:20:29 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
description : 'Value of the property' ,
} ,
] ,
} ,
] ,
} ,
2020-04-17 14:42:41 -07:00
{
displayName : 'Date of Birth' ,
name : 'dateOfBirth' ,
type : 'dateTime' ,
default : '' ,
} ,
{
displayName : 'Degree' ,
name : 'degree' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Facebook Click ID' ,
name : 'facebookClickId' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Fax Number' ,
name : 'faxNumber' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Field Of Study' ,
name : 'fieldOfStudy' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's field of study. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'First Name' ,
name : 'firstName' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A contact's first name" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Gender' ,
name : 'gender' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Google Ad Click ID' ,
name : 'googleAdClickId' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Graduation Date' ,
name : 'graduationDate' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's graduation date. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Industry' ,
name : 'industry' ,
type : 'string' ,
default : '' ,
description : 'The industry a contact is in' ,
} ,
{
displayName : 'Job Function' ,
name : 'jobFunction' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's job function. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Job Title' ,
name : 'jobTitle' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A contact's job title" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Last Name' ,
name : 'lastName' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A contact's last name" ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lead Status Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'leadStatus' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactLeadStatuses' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The contact\'s sales, prospecting or outreach status. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Legal Basic For Processing Contact Data Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'processingContactData' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactLealBasics' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"Legal basis for processing contact's data; 'Not applicable' will exempt the contact from GDPR protections. Choose from the list, or specify an ID using an <a href=\"https://docs.n8n.io/code-examples/expressions/\">expression</a>." ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lifecycle Stage Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'lifeCycleStage' ,
type : 'options' ,
typeOptions : {
2020-10-22 06:46:03 -07:00
loadOptionsMethod : 'getContactLifeCycleStages' ,
2020-04-17 14:42:41 -07:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The qualification of contacts to sales readiness. It can be set through imports, forms, workflows, and manually on a per contact basis. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Marital Status' ,
name : 'maritalStatus' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's marital status. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Membership Note' ,
name : 'membershipNote' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "The notes relating to the contact's content membership" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Message' ,
name : 'message' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'A default property to be used for any message or comments a contact may want to leave on a form' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Mobile Phone Number' ,
name : 'mobilePhoneNumber' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A contact's mobile phone number" ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
2020-04-17 14:42:41 -07:00
displayName : 'Number Of Employees' ,
name : 'numberOfEmployees' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactNumberOfEmployees' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The number of company employees. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Original Source Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'originalSource' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactOriginalSources' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The first known source through which a contact found your website. Source is automatically set by HubSpot, but may be updated manually. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Phone Number' ,
name : 'phoneNumber' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A contact's primary phone number" ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Property Names or IDs' ,
2020-04-17 14:42:41 -07:00
name : 'properties' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
'/resolveData' : [ true ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'<p>Used to include specific company properties in the results. By default, the results will only include company ID and will not include the values for any properties for your company.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Postal Code' ,
name : 'postalCode' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "The contact's zip code. This might be set via import, form, or integration." ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Preffered Language Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'prefferedLanguage' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactPrefferedLanguages' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Set your contact\'s preferred language for communications. This property can be changed from an import, form, or integration. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Relationship Status' ,
name : 'relationshipStatus' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's relationship status. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Salutation' ,
name : 'salutation' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The title used to address a contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'School' ,
name : 'school' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's school. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Seniority' ,
name : 'seniority' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's seniority. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Start Date' ,
name : 'startDate' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's start date. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'State/Region' ,
name : 'stateRegion' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"The contact's state of residence. This might be set via import, form, or integration." ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Status Name or ID' ,
2020-04-17 14:42:41 -07:00
name : 'status' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactStatuses' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The status of the contact\'s content membership. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Street Address' ,
name : 'streetAddress' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A contact's street address, including apartment or unit #" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Twitter Username' ,
name : 'twitterUsername' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"The contact's Twitter handle. This is set by HubSpot using the contact's email address." ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Website URL' ,
name : 'websiteUrl' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "The contact's company website" ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Work Email' ,
name : 'workEmail' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"A contact's work email. This property is required for the Facebook Ads Integration. This property will be automatically synced via the Lead Ads tool" ,
2020-04-17 14:42:41 -07:00
} ,
] ,
} ,
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
2020-04-17 14:42:41 -07:00
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'get' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
default : '' ,
description : 'Unique identifier for a particular contact' ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'get' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
options : [
{
displayName : 'Form Submission Mode' ,
name : 'formSubmissionMode' ,
type : 'options' ,
options : [
{
name : 'All' ,
value : 'all' ,
} ,
{
name : 'None' ,
value : 'none' ,
} ,
{
name : 'Newest' ,
value : 'newest' ,
} ,
{
name : 'Oldest' ,
value : 'oldest' ,
} ,
] ,
default : 'all' ,
2022-05-06 14:01:25 -07:00
description : 'Specify which form submissions should be fetched' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'List Memberships' ,
name : 'listMerberships' ,
type : 'boolean' ,
default : true ,
2022-05-06 14:01:25 -07:00
description : 'Whether current list memberships should be fetched for the contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Property Names or IDs' ,
2020-04-17 14:42:41 -07:00
name : 'properties' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'<p>Used to include specific company properties in the results. By default, the results will only include company ID and will not include the values for any properties for your company.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Property Mode' ,
name : 'propertyMode' ,
type : 'options' ,
options : [
{
name : 'Value And History' ,
value : 'valueAndHistory' ,
} ,
{
name : 'Value Only' ,
value : 'valueOnly' ,
} ,
] ,
default : 'valueAndHistory' ,
2022-08-17 08:50:24 -07:00
description :
'Specify if the current value for a property should be fetched, or the value and all the historical values for that property' ,
2020-04-17 14:42:41 -07:00
} ,
] ,
} ,
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* contact:getAll */
/* -------------------------------------------------------------------------- */
2020-04-17 14:42:41 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'getAll' ] ,
2020-04-17 14:42:41 -07: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-04-17 14:42:41 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 250 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'getAll' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
options : [
{
displayName : 'Form Submission Mode' ,
name : 'formSubmissionMode' ,
type : 'options' ,
options : [
{
name : 'All' ,
value : 'all' ,
} ,
{
name : 'None' ,
value : 'none' ,
} ,
{
name : 'Newest' ,
value : 'newest' ,
} ,
{
name : 'Oldest' ,
value : 'oldest' ,
} ,
] ,
default : 'all' ,
2022-05-06 14:01:25 -07:00
description : 'Specify which form submissions should be fetched' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'List Memberships' ,
name : 'listMerberships' ,
type : 'boolean' ,
default : true ,
2022-05-06 14:01:25 -07:00
description : 'Whether current list memberships should be fetched for the contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Property Names or IDs' ,
2020-04-17 14:42:41 -07:00
name : 'properties' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'<p>Used to include specific company properties in the results. By default, the results will only include company ID and will not include the values for any properties for your company.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Property Mode' ,
name : 'propertyMode' ,
type : 'options' ,
options : [
{
name : 'Value And History' ,
value : 'valueAndHistory' ,
} ,
{
name : 'Value Only' ,
value : 'valueOnly' ,
} ,
] ,
default : 'valueAndHistory' ,
2022-08-17 08:50:24 -07:00
description :
'Specify if the current value for a property should be fetched, or the value and all the historical values for that property' ,
2020-04-17 14:42:41 -07:00
} ,
] ,
} ,
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* contact:delete */
/* -------------------------------------------------------------------------- */
2020-04-17 14:42:41 -07:00
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'delete' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
default : '' ,
description : 'Unique identifier for a particular contact' ,
} ,
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* contact:getRecentlyCreatedUpdated */
/* -------------------------------------------------------------------------- */
2020-04-17 14:42:41 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'getRecentlyCreatedUpdated' ] ,
2020-04-17 14:42:41 -07: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-04-17 14:42:41 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'getRecentlyCreatedUpdated' ] ,
returnAll : [ false ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 250 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Filters' ,
name : 'filters' ,
type : 'collection' ,
placeholder : 'Add Filter' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'getRecentlyCreatedUpdated' ] ,
2020-04-17 14:42:41 -07:00
} ,
} ,
options : [
{
displayName : 'Form Submission Mode' ,
name : 'formSubmissionMode' ,
type : 'options' ,
options : [
{
name : 'All' ,
value : 'all' ,
} ,
{
name : 'None' ,
value : 'none' ,
} ,
{
name : 'Newest' ,
value : 'newest' ,
} ,
{
name : 'Oldest' ,
value : 'oldest' ,
} ,
] ,
default : 'all' ,
2022-05-06 14:01:25 -07:00
description : 'Specify which form submissions should be fetched' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'List Memberships' ,
name : 'listMerberships' ,
type : 'boolean' ,
default : true ,
2022-05-06 14:01:25 -07:00
description : 'Whether current list memberships should be fetched for the contact' ,
2020-04-17 14:42:41 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Property Names or IDs' ,
2020-04-17 14:42:41 -07:00
name : 'properties' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'<p>Used to include specific company properties in the results. By default, the results will only include company ID and will not include the values for any properties for your company.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-17 14:42:41 -07:00
} ,
{
displayName : 'Property Mode' ,
name : 'propertyMode' ,
type : 'options' ,
options : [
{
name : 'Value And History' ,
value : 'valueAndHistory' ,
} ,
{
name : 'Value Only' ,
value : 'valueOnly' ,
} ,
] ,
default : 'valueAndHistory' ,
2022-08-17 08:50:24 -07:00
description :
'Specify if the current value for a property should be fetched, or the value and all the historical values for that property' ,
2020-04-17 14:42:41 -07:00
} ,
] ,
} ,
2020-08-21 15:04:12 -07:00
2021-01-31 23:31:40 -08:00
//*-------------------------------------------------------------------------- */
/* contact:search */
/* -------------------------------------------------------------------------- */
2020-08-21 15:04:12 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'search' ] ,
2020-08-21 15:04:12 -07: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-08-21 15:04:12 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'search' ] ,
returnAll : [ false ] ,
2020-08-21 15:04:12 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 250 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-08-21 15:04:12 -07:00
} ,
{
displayName : 'Filter Groups' ,
name : 'filterGroupsUi' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-08-21 15:04:12 -07:00
placeholder : 'Add Filter Group' ,
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'search' ] ,
2020-08-21 15:04:12 -07:00
} ,
} ,
options : [
{
name : 'filterGroupsValues' ,
displayName : 'Filter Group' ,
values : [
{
displayName : 'Filters' ,
name : 'filtersUi' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-08-21 15:04:12 -07:00
placeholder : 'Add Filter' ,
typeOptions : {
multipleValues : true ,
} ,
options : [
{
name : 'filterValues' ,
displayName : 'Filter' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Property Name or ID' ,
2020-08-21 15:04:12 -07:00
name : 'propertyName' ,
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>' ,
2020-08-21 15:04:12 -07:00
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
default : '' ,
} ,
{
displayName : 'Operator' ,
name : 'operator' ,
type : 'options' ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'Contains Exactly' ,
value : 'CONTAINS_TOKEN' ,
2020-08-21 15:04:12 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'Equal' ,
value : 'EQ' ,
2020-08-21 15:04:12 -07:00
} ,
{
name : 'Greater Than' ,
value : 'GT' ,
} ,
{
name : 'Greater Than Or Equal' ,
value : 'GTE' ,
} ,
{
name : 'Is Known' ,
value : 'HAS_PROPERTY' ,
} ,
{
name : 'Is Unknown' ,
value : 'NOT_HAS_PROPERTY' ,
} ,
{
2022-06-03 10:23:49 -07:00
name : 'Less Than' ,
value : 'LT' ,
2020-08-21 15:04:12 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'Less Than Or Equal' ,
value : 'LTE' ,
} ,
{
name : 'Not Equal' ,
value : 'NEQ' ,
2020-08-21 15:04:12 -07:00
} ,
] ,
default : 'EQ' ,
} ,
{
displayName : 'Value' ,
name : 'value' ,
displayOptions : {
hide : {
2022-08-17 08:50:24 -07:00
operator : [ 'HAS_PROPERTY' , 'NOT_HAS_PROPERTY' ] ,
2020-08-21 15:04:12 -07:00
} ,
} ,
type : 'string' ,
default : '' ,
} ,
] ,
2020-10-22 06:46:03 -07:00
} ,
2020-08-21 15:04:12 -07:00
] ,
2022-08-17 08:50:24 -07:00
description :
'Use filters to limit the results to only CRM objects with matching property values. More info <a href="https://developers.hubspot.com/docs/api/crm/search">here</a>.' ,
2020-08-21 15:04:12 -07:00
} ,
] ,
2020-10-22 06:46:03 -07:00
} ,
2020-08-21 15:04:12 -07:00
] ,
2022-08-17 08:50:24 -07:00
description :
'When multiple filters are provided within a filterGroup, they will be combined using a logical AND operator. When multiple filterGroups are provided, they will be combined using a logical OR operator. The system supports a maximum of three filterGroups with up to three filters each. More info <a href="https://developers.hubspot.com/docs/api/crm/search">here</a>' ,
2020-08-21 15:04:12 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'contact' ] ,
operation : [ 'search' ] ,
2020-08-21 15:04:12 -07:00
} ,
} ,
options : [
2020-08-25 00:52:00 -07:00
{
displayName : 'Direction' ,
name : 'direction' ,
type : 'options' ,
options : [
{
name : 'ASC' ,
value : 'ASCENDING' ,
} ,
{
name : 'DESC' ,
value : 'DESCENDING' ,
} ,
] ,
default : 'DESCENDING' ,
2022-08-17 08:50:24 -07:00
description :
'Defines the direction in which search results are ordered. Default value is DESC.' ,
2020-08-25 00:52:00 -07:00
} ,
2020-08-21 15:04:12 -07:00
{
2022-06-20 07:54:01 -07:00
displayName : 'Field Names or IDs' ,
2020-08-21 15:04:12 -07:00
name : 'properties' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
2022-08-17 08:50:24 -07:00
default : [ 'firstname' , 'lastname' , 'email' ] ,
description :
'<p>Used to include specific company properties in the results. By default, the results will only include company ID and will not include the values for any properties for your company.</p><p>Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: <code>,</code>.</p>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-08-21 15:04:12 -07:00
} ,
{
displayName : 'Query' ,
name : 'query' ,
type : 'string' ,
default : '' ,
description : 'Perform a text search against all property values for an object type' ,
} ,
2020-08-25 00:52:00 -07:00
{
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
2020-08-25 00:52:00 -07:00
displayName : 'Sort By' ,
name : 'sortBy' ,
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>' ,
2020-08-25 00:52:00 -07:00
typeOptions : {
loadOptionsMethod : 'getContactProperties' ,
} ,
default : 'createdate' ,
} ,
2020-08-21 15:04:12 -07:00
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;