diff --git a/packages/cli/BREAKING-CHANGES.md b/packages/cli/BREAKING-CHANGES.md index fd77c75406..44eddb69a4 100644 --- a/packages/cli/BREAKING-CHANGES.md +++ b/packages/cli/BREAKING-CHANGES.md @@ -2,6 +2,18 @@ This list shows all the versions which include breaking changes and how to upgrade. +## 0.105.0 + +### What changed? +In the Hubspot Trigger, now multiple events can be provided and the field `App ID` was so moved to the credentials. + +### When is action necessary? +If you are using the Hubspot Trigger node. + +### How to upgrade: +Open the Hubspot Trigger and set the events again. Also open the credentials `Hubspot Developer API` and set your APP ID. + + ## 0.104.0 ### What changed? diff --git a/packages/nodes-base/credentials/HubspotDeveloperApi.credentials.ts b/packages/nodes-base/credentials/HubspotDeveloperApi.credentials.ts index 5e21f5077b..2fdfbbc970 100644 --- a/packages/nodes-base/credentials/HubspotDeveloperApi.credentials.ts +++ b/packages/nodes-base/credentials/HubspotDeveloperApi.credentials.ts @@ -20,5 +20,13 @@ export class HubspotDeveloperApi implements ICredentialType { type: 'string' as NodePropertyTypes, default: '', }, + { + displayName: 'App ID', + name: 'appId', + type: 'string' as NodePropertyTypes, + required: true, + default: '', + description: 'The App ID', + }, ]; } diff --git a/packages/nodes-base/nodes/Hubspot/CompanyDescription.ts b/packages/nodes-base/nodes/Hubspot/CompanyDescription.ts index e319a0e38c..b2010891d3 100644 --- a/packages/nodes-base/nodes/Hubspot/CompanyDescription.ts +++ b/packages/nodes-base/nodes/Hubspot/CompanyDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const companyOperations = [ { @@ -63,9 +63,9 @@ export const companyOperations = [ export const companyFields = [ -/* -------------------------------------------------------------------------- */ -/* company:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* company:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Name', name: 'name', @@ -370,7 +370,7 @@ export const companyFields = [ description: 'The main website of the company or organization. This property is used to identify unique companies. Powered by HubSpot Insights.', }, { - displayName: 'Year Founded', + displayName: 'Year Founded', name: 'yearFounded', type: 'string', default: '', @@ -378,9 +378,10 @@ export const companyFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* company:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* company:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Company ID', name: 'companyId', @@ -692,7 +693,7 @@ export const companyFields = [ description: 'The main website of the company or organization. This property is used to identify unique companies. Powered by HubSpot Insights.', }, { - displayName: 'Year Founded', + displayName: 'Year Founded', name: 'yearFounded', type: 'string', default: '', @@ -700,9 +701,10 @@ export const companyFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* company:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* company:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Company ID', name: 'companyId', @@ -747,9 +749,10 @@ export const companyFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* company:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* company:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', @@ -838,9 +841,10 @@ export const companyFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* company:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* company:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Company ID', name: 'companyId', @@ -859,9 +863,10 @@ export const companyFields = [ default: '', description: 'Unique identifier for a particular company', }, -/* -------------------------------------------------------------------------- */ -/* company:getRecentlyCreated company:getRecentlyModifie */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* company:getRecentlyCreated company:getRecentlyModifie */ + /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', @@ -939,9 +944,10 @@ export const companyFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* company:searchByDomain */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* company:searchByDomain */ + /* -------------------------------------------------------------------------- */ { displayName: 'Domain', name: 'domain', diff --git a/packages/nodes-base/nodes/Hubspot/CompanyInterface.ts b/packages/nodes-base/nodes/Hubspot/CompanyInterface.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/nodes-base/nodes/Hubspot/ContactDescription.ts b/packages/nodes-base/nodes/Hubspot/ContactDescription.ts index 1191cca13e..dbb2be43ed 100644 --- a/packages/nodes-base/nodes/Hubspot/ContactDescription.ts +++ b/packages/nodes-base/nodes/Hubspot/ContactDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const contactOperations = [ { @@ -53,9 +53,9 @@ export const contactOperations = [ export const contactFields = [ -/* -------------------------------------------------------------------------- */ -/* contact:upsert */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* contact:upsert */ + /* -------------------------------------------------------------------------- */ { displayName: 'Email', name: 'email', @@ -121,7 +121,7 @@ export const contactFields = [ name: 'associatedCompanyId', type: 'options', typeOptions: { - loadOptionsMethod:'getCompanies' , + loadOptionsMethod: 'getCompanies', }, default: '', description: 'Companies associated with the ticket', @@ -501,9 +501,10 @@ export const contactFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* contact:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* contact:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Contact ID', name: 'contactId', @@ -603,9 +604,10 @@ export const contactFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* contact:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* contact:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', @@ -728,9 +730,10 @@ export const contactFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* contact:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* contact:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Contact ID', name: 'contactId', @@ -749,9 +752,10 @@ export const contactFields = [ default: '', description: 'Unique identifier for a particular contact', }, -/* -------------------------------------------------------------------------- */ -/* contact:getRecentlyCreatedUpdated */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* contact:getRecentlyCreatedUpdated */ + /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', @@ -875,9 +879,9 @@ export const contactFields = [ ], }, -//*-------------------------------------------------------------------------- */ -/* contact:search */ -/* -------------------------------------------------------------------------- */ + //*-------------------------------------------------------------------------- */ + /* contact:search */ + /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', diff --git a/packages/nodes-base/nodes/Hubspot/ContactListDescription.ts b/packages/nodes-base/nodes/Hubspot/ContactListDescription.ts index 071a0ff1c5..f0746e94fc 100644 --- a/packages/nodes-base/nodes/Hubspot/ContactListDescription.ts +++ b/packages/nodes-base/nodes/Hubspot/ContactListDescription.ts @@ -120,6 +120,7 @@ export const contactListFields = [ }, default: '', }, + /* -------------------------------------------------------------------------- */ /* contactList:remove */ /* -------------------------------------------------------------------------- */ diff --git a/packages/nodes-base/nodes/Hubspot/DealInterface.ts b/packages/nodes-base/nodes/Hubspot/DealInterface.ts index fe422ff5be..2bd20ddb1b 100644 --- a/packages/nodes-base/nodes/Hubspot/DealInterface.ts +++ b/packages/nodes-base/nodes/Hubspot/DealInterface.ts @@ -1,6 +1,6 @@ import { IDataObject, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export interface IAssociation { associatedCompanyIds?: number[]; diff --git a/packages/nodes-base/nodes/Hubspot/FormDescription.ts b/packages/nodes-base/nodes/Hubspot/FormDescription.ts index 15dd2592af..684dfad4c4 100644 --- a/packages/nodes-base/nodes/Hubspot/FormDescription.ts +++ b/packages/nodes-base/nodes/Hubspot/FormDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const formOperations = [ { @@ -33,9 +33,9 @@ export const formOperations = [ export const formFields = [ -/* -------------------------------------------------------------------------- */ -/* form:submit */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* form:submit */ + /* -------------------------------------------------------------------------- */ { displayName: 'Form', name: 'formId', @@ -301,9 +301,10 @@ export const formFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* form:getFields */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* form:getFields */ + /* -------------------------------------------------------------------------- */ { displayName: 'Form', name: 'formId', diff --git a/packages/nodes-base/nodes/Hubspot/FormInterface.ts b/packages/nodes-base/nodes/Hubspot/FormInterface.ts index 98edbf67ff..f6dd2e9e3d 100644 --- a/packages/nodes-base/nodes/Hubspot/FormInterface.ts +++ b/packages/nodes-base/nodes/Hubspot/FormInterface.ts @@ -1,6 +1,6 @@ import { IDataObject, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export interface IContext { goToWebinarWebinarKey?: string; diff --git a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts index 53953d9856..2a46532bdd 100644 --- a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts @@ -1,6 +1,6 @@ import { OptionsWithUri, - } from 'request'; +} from 'request'; import { IExecuteFunctions, @@ -112,3 +112,1790 @@ export function validateJSON(json: string | undefined): any { // tslint:disable- } return result; } + +export const propertyEvents = [ + 'contact.propertyChange', + 'company.propertyChange', + 'deal.propertyChange', +]; + +export const contactFields = [ + { + 'id': 'company_size', + 'label': 'testingricardo', + }, + { + 'id': 'date', + 'label': 'Date', + }, + { + 'id': 'date_of_birth', + 'label': 'Date of birth', + }, + { + 'id': 'days_to_close', + 'label': 'Days To Close', + }, + { + 'id': 'degree', + 'label': 'Degree', + }, + { + 'id': 'field_of_study', + 'label': 'Field of study', + }, + { + 'id': 'first_conversion_date', + 'label': 'First Conversion Date', + }, + { + 'id': 'first_conversion_event_name', + 'label': 'First Conversion', + }, + { + 'id': 'first_deal_created_date', + 'label': 'First Deal Created Date', + }, + { + 'id': 'gender', + 'label': 'Gender', + }, + { + 'id': 'graduation_date', + 'label': 'Graduation date', + }, + { + 'id': 'hs_additional_emails', + 'label': 'Additional email addresses', + }, + { + 'id': 'hs_all_contact_vids', + 'label': 'All vids for a contact', + }, + { + 'id': 'hs_analytics_first_touch_converting_campaign', + 'label': 'First Touch Converting Campaign', + }, + { + 'id': 'hs_analytics_last_touch_converting_campaign', + 'label': 'Last Touch Converting Campaign', + }, + { + 'id': 'hs_avatar_filemanager_key', + 'label': 'Avatar FileManager key', + }, + { + 'id': 'hs_buying_role', + 'label': 'Buying Role', + }, + { + 'id': 'hs_calculated_form_submissions', + 'label': 'All form submissions for a contact', + }, + { + 'id': 'hs_calculated_merged_vids', + 'label': 'Merged vids with timestamps of a contact', + }, + { + 'id': 'hs_calculated_mobile_number', + 'label': 'Calculated Mobile Number in International Format', + }, + { + 'id': 'hs_calculated_phone_number', + 'label': 'Calculated Phone Number in International Format', + }, + { + 'id': 'hs_calculated_phone_number_area_code', + 'label': 'Calculated Phone Number Area Code', + }, + { + 'id': 'hs_calculated_phone_number_country_code', + 'label': 'Calculated Phone Number Country Code', + }, + { + 'id': 'hs_calculated_phone_number_region_code', + 'label': 'Calculated Phone Number Region', + }, + { + 'id': 'hs_content_membership_email_confirmed', + 'label': 'Email Confirmed', + }, + { + 'id': 'hs_content_membership_notes', + 'label': 'Membership Notes', + }, + { + 'id': 'hs_content_membership_registered_at', + 'label': 'Registered At', + }, + { + 'id': 'hs_content_membership_registration_domain_sent_to', + 'label': 'Domain to which registration email was sent', + }, + { + 'id': 'hs_content_membership_registration_email_sent_at', + 'label': 'Time registration email was sent', + }, + { + 'id': 'hs_content_membership_status', + 'label': 'Status', + }, + { + 'id': 'hs_conversations_visitor_email', + 'label': 'Conversations visitor email', + }, + { + 'id': 'hs_count_is_unworked', + 'label': 'Count of unengaged contacts', + }, + { + 'id': 'hs_count_is_worked', + 'label': 'Count of engaged contacts', + }, + { + 'id': 'hs_created_by_conversations', + 'label': 'Created By Conversations', + }, + { + 'id': 'hs_created_by_user_id', + 'label': 'Created by user ID', + }, + { + 'id': 'hs_createdate', + 'label': 'Object create date/time', + }, + { + 'id': 'hs_document_last_revisited', + 'label': 'Recent Document Revisit Date', + }, + { + 'id': 'hs_email_bad_address', + 'label': 'Invalid email address', + }, + { + 'id': 'hs_email_customer_quarantined_reason', + 'label': 'Email address quarantine reason', + }, + { + 'id': 'hs_email_domain', + 'label': 'Email Domain', + }, + { + 'id': 'hs_email_hard_bounce_reason', + 'label': 'Email hard bounce reason', + }, + { + 'id': 'hs_email_hard_bounce_reason_enum', + 'label': 'Email hard bounce reason', + }, + { + 'id': 'hs_email_quarantined', + 'label': 'Email Address Quarantined', + }, + { + 'id': 'hs_email_quarantined_reason', + 'label': 'Email address internal quarantine reason', + }, + { + 'id': 'hs_email_recipient_fatigue_recovery_time', + 'label': 'Email Address Recipient Fatigue Next Available Sending Time', + }, + { + 'id': 'hs_email_sends_since_last_engagement', + 'label': 'Sends Since Last Engagement', + }, + { + 'id': 'hs_emailconfirmationstatus', + 'label': 'Marketing email confirmation status', + }, + { + 'id': 'hs_facebook_ad_clicked', + 'label': 'Clicked Facebook ad', + }, + { + 'id': 'hs_facebook_click_id', + 'label': 'Facebook click id', + }, + { + 'id': 'hs_facebookid', + 'label': 'Facebook ID', + }, + { + 'id': 'hs_feedback_last_nps_follow_up', + 'label': 'Last NPS survey comment', + }, + { + 'id': 'hs_feedback_last_nps_rating', + 'label': 'Last NPS survey rating', + }, + { + 'id': 'hs_feedback_last_survey_date', + 'label': 'Last NPS survey date', + }, + { + 'id': 'hs_feedback_show_nps_web_survey', + 'label': 'Should be shown an NPS web survey', + }, + { + 'id': 'hs_first_engagement_object_id', + 'label': 'ID of first engagement', + }, + { + 'id': 'hs_google_click_id', + 'label': 'Google ad click id', + }, + { + 'id': 'hs_googleplusid', + 'label': 'googleplus ID', + }, + { + 'id': 'hs_ip_timezone', + 'label': 'IP Timezone', + }, + { + 'id': 'hs_is_contact', + 'label': 'Is a contact', + }, + { + 'id': 'hs_is_unworked', + 'label': 'Contact unworked', + }, + { + 'id': 'hs_last_sales_activity_date', + 'label': 'last sales activity date old', + }, + { + 'id': 'hs_last_sales_activity_timestamp', + 'label': 'Last Engagement Date', + }, + { + 'id': 'hs_lastmodifieddate', + 'label': 'Object last modified date/time', + }, + { + 'id': 'hs_lead_status', + 'label': 'Lead Status', + }, + { + 'id': 'hs_legal_basis', + 'label': 'Legal basis for processing contact\'s data', + }, + { + 'id': 'hs_linkedinid', + 'label': 'Linkedin ID', + }, + { + 'id': 'hs_marketable_reason_id', + 'label': 'Marketing contact status source name', + }, + { + 'id': 'hs_marketable_reason_type', + 'label': 'Marketing contact status source type', + }, + { + 'id': 'hs_marketable_status', + 'label': 'Marketing contact status', + }, + { + 'id': 'hs_marketable_until_renewal', + 'label': 'Marketing contact until next update', + }, + { + 'id': 'hs_merged_object_ids', + 'label': 'Merged object IDs', + }, + { + 'id': 'hs_object_id', + 'label': 'Contact ID', + }, + { + 'id': 'hs_predictivecontactscore_v2', + 'label': 'Likelihood to close', + }, + { + 'id': 'hs_predictivescoringtier', + 'label': 'Contact priority', + }, + { + 'id': 'hs_sa_first_engagement_date', + 'label': 'Date of first engagement', + }, + { + 'id': 'hs_sa_first_engagement_descr', + 'label': 'Description of first engagement', + }, + { + 'id': 'hs_sa_first_engagement_object_type', + 'label': 'Type of first engagement', + }, + { + 'id': 'hs_sales_email_last_clicked', + 'label': 'Recent Sales Email Clicked Date', + }, + { + 'id': 'hs_sales_email_last_opened', + 'label': 'Recent Sales Email Opened Date', + }, + { + 'id': 'hs_searchable_calculated_international_mobile_number', + 'label': 'Calculated Mobile Number with country code', + }, + { + 'id': 'hs_searchable_calculated_international_phone_number', + 'label': 'Calculated Phone Number with country code', + }, + { + 'id': 'hs_searchable_calculated_mobile_number', + 'label': 'Calculated Mobile Number without country code', + }, + { + 'id': 'hs_searchable_calculated_phone_number', + 'label': 'Calculated Phone Number without country code', + }, + { + 'id': 'hs_sequences_is_enrolled', + 'label': 'Currently in Sequence', + }, + { + 'id': 'hs_testpurge', + 'label': 'testpurge', + }, + { + 'id': 'hs_testrollback', + 'label': 'testrollback', + }, + { + 'id': 'hs_time_between_contact_creation_and_deal_close', + 'label': 'Time between contact creation and deal close', + }, + { + 'id': 'hs_time_between_contact_creation_and_deal_creation', + 'label': 'Time between contact creation and deal creation', + }, + { + 'id': 'hs_time_to_first_engagement', + 'label': 'Lead response time', + }, + { + 'id': 'hs_time_to_move_from_lead_to_customer', + 'label': 'Time to move from lead to customer', + }, + { + 'id': 'hs_time_to_move_from_marketingqualifiedlead_to_customer', + 'label': 'Time to move from marketing qualified lead to customer', + }, + { + 'id': 'hs_time_to_move_from_opportunity_to_customer', + 'label': 'Time to move from opportunity to customer', + }, + { + 'id': 'hs_time_to_move_from_salesqualifiedlead_to_customer', + 'label': 'Time to move from sales qualified lead to customer', + }, + { + 'id': 'hs_time_to_move_from_subscriber_to_customer', + 'label': 'Time to move from subscriber to customer', + }, + { + 'id': 'hs_twitterid', + 'label': 'Twitter ID', + }, + { + 'id': 'hs_updated_by_user_id', + 'label': 'Updated by user ID', + }, + { + 'id': 'hs_user_ids_of_all_owners', + 'label': 'User IDs of all owners', + }, + { + 'id': 'hubspot_owner_assigneddate', + 'label': 'Owner Assigned Date', + }, + { + 'id': 'ip_city', + 'label': 'IP City', + }, + { + 'id': 'ip_country', + 'label': 'IP Country', + }, + { + 'id': 'ip_country_code', + 'label': 'IP Country Code', + }, + { + 'id': 'ip_latlon', + 'label': 'IP Latitude & Longitude', + }, + { + 'id': 'ip_state', + 'label': 'IP State/Region', + }, + { + 'id': 'ip_state_code', + 'label': 'IP State Code/Region Code', + }, + { + 'id': 'ip_zipcode', + 'label': 'IP Zipcode', + }, + { + 'id': 'job_function', + 'label': 'Job function', + }, + { + 'id': 'lastmodifieddate', + 'label': 'Last Modified Date', + }, + { + 'id': 'marital_status', + 'label': 'Marital Status', + }, + { + 'id': 'military_status', + 'label': 'Military status', + }, + { + 'id': 'num_associated_deals', + 'label': 'Associated Deals', + }, + { + 'id': 'num_conversion_events', + 'label': 'Number of Form Submissions', + }, + { + 'id': 'num_unique_conversion_events', + 'label': 'Number of Unique Forms Submitted', + }, + { + 'id': 'recent_conversion_date', + 'label': 'Recent Conversion Date', + }, + { + 'id': 'recent_conversion_event_name', + 'label': 'Recent Conversion', + }, + { + 'id': 'recent_deal_amount', + 'label': 'Recent Deal Amount', + }, + { + 'id': 'recent_deal_close_date', + 'label': 'Recent Deal Close Date', + }, + { + 'id': 'relationship_status', + 'label': 'Relationship Status', + }, + { + 'id': 'school', + 'label': 'School', + }, + { + 'id': 'seniority', + 'label': 'Seniority', + }, + { + 'id': 'start_date', + 'label': 'Start date', + }, + { + 'id': 'testing', + 'label': 'testing', + }, + { + 'id': 'total_revenue', + 'label': 'Total Revenue', + }, + { + 'id': 'work_email', + 'label': 'Work email', + }, + { + 'id': 'firstname', + 'label': 'First Name', + }, + { + 'id': 'hs_analytics_first_url', + 'label': 'First Page Seen', + }, + { + 'id': 'hs_email_delivered', + 'label': 'Marketing emails delivered', + }, + { + 'id': 'hs_email_optout_6871816', + 'label': 'Opted out of email: Marketing Information', + }, + { + 'id': 'hs_email_optout_8363428', + 'label': 'Opted out of email: One to One', + }, + { + 'id': 'twitterhandle', + 'label': 'Twitter Username', + }, + { + 'id': 'currentlyinworkflow', + 'label': 'Currently in workflow', + }, + { + 'id': 'followercount', + 'label': 'Follower Count', + }, + { + 'id': 'hs_analytics_last_url', + 'label': 'Last Page Seen', + }, + { + 'id': 'hs_email_open', + 'label': 'Marketing emails opened', + }, + { + 'id': 'lastname', + 'label': 'Last Name', + }, + { + 'id': 'hs_analytics_num_page_views', + 'label': 'Number of Pageviews', + }, + { + 'id': 'hs_email_click', + 'label': 'Marketing emails clicked', + }, + { + 'id': 'salutation', + 'label': 'Salutation', + }, + { + 'id': 'twitterprofilephoto', + 'label': 'Twitter Profile Photo', + }, + { + 'id': 'email', + 'label': 'Email', + }, + { + 'id': 'hs_analytics_num_visits', + 'label': 'Number of Sessions', + }, + { + 'id': 'hs_email_bounce', + 'label': 'Marketing emails bounced', + }, + { + 'id': 'hs_persona', + 'label': 'Persona', + }, + { + 'id': 'hs_social_last_engagement', + 'label': 'Most Recent Social Click', + }, + { + 'id': 'hs_analytics_num_event_completions', + 'label': 'Number of event completions', + }, + { + 'id': 'hs_email_optout', + 'label': 'Unsubscribed from all email', + }, + { + 'id': 'hs_social_twitter_clicks', + 'label': 'Twitter Clicks', + }, + { + 'id': 'mobilephone', + 'label': 'Mobile Phone Number', + }, + { + 'id': 'phone', + 'label': 'Phone Number', + }, + { + 'id': 'fax', + 'label': 'Fax Number', + }, + { + 'id': 'hs_analytics_first_timestamp', + 'label': 'Time First Seen', + }, + { + 'id': 'hs_email_last_email_name', + 'label': 'Last marketing email name', + }, + { + 'id': 'hs_email_last_send_date', + 'label': 'Last marketing email send date', + }, + { + 'id': 'hs_social_facebook_clicks', + 'label': 'Facebook Clicks', + }, + { + 'id': 'address', + 'label': 'Street Address', + }, + { + 'id': 'engagements_last_meeting_booked', + 'label': 'Date of last meeting booked in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_campaign', + 'label': 'Campaign of last booking in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_medium', + 'label': 'Medium of last booking in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_source', + 'label': 'Source of last booking in meetings tool', + }, + { + 'id': 'hs_analytics_first_visit_timestamp', + 'label': 'Time of First Session', + }, + { + 'id': 'hs_email_last_open_date', + 'label': 'Last marketing email open date', + }, + { + 'id': 'hs_latest_meeting_activity', + 'label': 'Latest meeting activity', + }, + { + 'id': 'hs_sales_email_last_replied', + 'label': 'Recent Sales Email Replied Date', + }, + { + 'id': 'hs_social_linkedin_clicks', + 'label': 'LinkedIn Clicks', + }, + { + 'id': 'hubspot_owner_id', + 'label': 'Contact owner', + }, + { + 'id': 'notes_last_contacted', + 'label': 'Last Contacted', + }, + { + 'id': 'notes_last_updated', + 'label': 'Last Activity Date', + }, + { + 'id': 'notes_next_activity_date', + 'label': 'Next Activity Date', + }, + { + 'id': 'num_contacted_notes', + 'label': 'Number of times contacted', + }, + { + 'id': 'num_notes', + 'label': 'Number of Sales Activities', + }, + { + 'id': 'owneremail', + 'label': 'HubSpot Owner Email (legacy)', + }, + { + 'id': 'ownername', + 'label': 'HubSpot Owner Name (legacy)', + }, + { + 'id': 'surveymonkeyeventlastupdated', + 'label': 'SurveyMonkey Event Last Updated', + }, + { + 'id': 'webinareventlastupdated', + 'label': 'Webinar Event Last Updated', + }, + { + 'id': 'city', + 'label': 'City', + }, + { + 'id': 'hs_analytics_last_timestamp', + 'label': 'Time Last Seen', + }, + { + 'id': 'hs_email_last_click_date', + 'label': 'Last marketing email click date', + }, + { + 'id': 'hs_social_google_plus_clicks', + 'label': 'Google Plus Clicks', + }, + { + 'id': 'hubspot_team_id', + 'label': 'HubSpot Team', + }, + { + 'id': 'linkedinbio', + 'label': 'LinkedIn Bio', + }, + { + 'id': 'twitterbio', + 'label': 'Twitter Bio', + }, + { + 'id': 'hs_all_owner_ids', + 'label': 'All owner ids', + }, + { + 'id': 'hs_analytics_last_visit_timestamp', + 'label': 'Time of Last Session', + }, + { + 'id': 'hs_email_first_send_date', + 'label': 'First marketing email send date', + }, + { + 'id': 'hs_social_num_broadcast_clicks', + 'label': 'Broadcast Clicks', + }, + { + 'id': 'state', + 'label': 'State/Region', + }, + { + 'id': 'hs_all_team_ids', + 'label': 'All team ids', + }, + { + 'id': 'hs_analytics_source', + 'label': 'Original Source', + }, + { + 'id': 'hs_email_first_open_date', + 'label': 'First marketing email open date', + }, + { + 'id': 'zip', + 'label': 'Postal Code', + }, + { + 'id': 'country', + 'label': 'Country/Region', + }, + { + 'id': 'hs_all_accessible_team_ids', + 'label': 'All accessible team ids', + }, + { + 'id': 'hs_analytics_source_data_1', + 'label': 'Original Source Drill-Down 1', + }, + { + 'id': 'hs_email_first_click_date', + 'label': 'First marketing email click date', + }, + { + 'id': 'linkedinconnections', + 'label': 'LinkedIn Connections', + }, + { + 'id': 'hs_analytics_source_data_2', + 'label': 'Original Source Drill-Down 2', + }, + { + 'id': 'hs_email_is_ineligible', + 'label': 'Is globally ineligible', + }, + { + 'id': 'hs_language', + 'label': 'Preferred language', + }, + { + 'id': 'kloutscoregeneral', + 'label': 'Klout Score', + }, + { + 'id': 'hs_analytics_first_referrer', + 'label': 'First Referring Site', + }, + { + 'id': 'hs_email_first_reply_date', + 'label': 'First marketing email reply date', + }, + { + 'id': 'jobtitle', + 'label': 'Job Title', + }, + { + 'id': 'photo', + 'label': 'Photo', + }, + { + 'id': 'hs_analytics_last_referrer', + 'label': 'Last Referring Site', + }, + { + 'id': 'hs_email_last_reply_date', + 'label': 'Last marketing email reply date', + }, + { + 'id': 'message', + 'label': 'Message', + }, + { + 'id': 'closedate', + 'label': 'Close Date', + }, + { + 'id': 'hs_analytics_average_page_views', + 'label': 'Average Pageviews', + }, + { + 'id': 'hs_email_replied', + 'label': 'Marketing emails replied', + }, + { + 'id': 'hs_analytics_revenue', + 'label': 'Event Revenue', + }, + { + 'id': 'hs_lifecyclestage_lead_date', + 'label': 'Became a Lead Date', + }, + { + 'id': 'hs_lifecyclestage_marketingqualifiedlead_date', + 'label': 'Became a Marketing Qualified Lead Date', + }, + { + 'id': 'hs_lifecyclestage_opportunity_date', + 'label': 'Became an Opportunity Date', + }, + { + 'id': 'lifecyclestage', + 'label': 'Lifecycle Stage', + }, + { + 'id': 'hs_lifecyclestage_salesqualifiedlead_date', + 'label': 'Became a Sales Qualified Lead Date', + }, + { + 'id': 'createdate', + 'label': 'Create Date', + }, + { + 'id': 'hs_lifecyclestage_evangelist_date', + 'label': 'Became an Evangelist Date', + }, + { + 'id': 'hs_lifecyclestage_customer_date', + 'label': 'Became a Customer Date', + }, + { + 'id': 'hubspotscore', + 'label': 'HubSpot Score', + }, + { + 'id': 'company', + 'label': 'Company Name', + }, + { + 'id': 'hs_lifecyclestage_subscriber_date', + 'label': 'Became a Subscriber Date', + }, + { + 'id': 'hs_lifecyclestage_other_date', + 'label': 'Became an Other Lifecycle Date', + }, + { + 'id': 'website', + 'label': 'Website URL', + }, + { + 'id': 'numemployees', + 'label': 'Number of Employees', + }, + { + 'id': 'annualrevenue', + 'label': 'Annual Revenue', + }, + { + 'id': 'industry', + 'label': 'Industry', + }, + { + 'id': 'associatedcompanyid', + 'label': 'Associated Company ID', + }, + { + 'id': 'associatedcompanylastupdated', + 'label': 'Associated Company Last Updated', + }, + { + 'id': 'hs_predictivecontactscorebucket', + 'label': 'Lead Rating', + }, + { + 'id': 'hs_predictivecontactscore', + 'label': 'Predictive Lead Score', + }, +]; + +export const companyFields = [ + { + 'id': 'about_us', + 'label': 'About Us', + }, + { + 'id': 'closedate_timestamp_earliest_value_a2a17e6e', + 'label': 'closedate_timestamp_earliest_value_a2a17e6e', + }, + { + 'id': 'facebookfans', + 'label': 'Facebook Fans', + }, + { + 'id': 'first_contact_createdate_timestamp_earliest_value_78b50eea', + 'label': 'first_contact_createdate_timestamp_earliest_value_78b50eea', + }, + { + 'id': 'first_conversion_date', + 'label': 'First Conversion Date', + }, + { + 'id': 'first_conversion_date_timestamp_earliest_value_61f58f2c', + 'label': 'first_conversion_date_timestamp_earliest_value_61f58f2c', + }, + { + 'id': 'first_conversion_event_name', + 'label': 'First Conversion', + }, + { + 'id': 'first_conversion_event_name_timestamp_earliest_value_68ddae0a', + 'label': 'first_conversion_event_name_timestamp_earliest_value_68ddae0a', + }, + { + 'id': 'first_deal_created_date', + 'label': 'First Deal Created Date', + }, + { + 'id': 'founded_year', + 'label': 'Year Founded', + }, + { + 'id': 'hs_additional_domains', + 'label': 'Additional Domains', + }, + { + 'id': 'hs_analytics_first_timestamp', + 'label': 'Time First Seen', + }, + { + 'id': 'hs_analytics_first_timestamp_timestamp_earliest_value_11e3a63a', + 'label': 'hs_analytics_first_timestamp_timestamp_earliest_value_11e3a63a', + }, + { + 'id': 'hs_analytics_first_touch_converting_campaign', + 'label': 'First Touch Converting Campaign', + }, + { + 'id': 'hs_analytics_first_touch_converting_campaign_timestamp_earliest_value_4757fe10', + 'label': 'hs_analytics_first_touch_converting_campaign_timestamp_earliest_value_4757fe10', + }, + { + 'id': 'hs_analytics_first_visit_timestamp', + 'label': 'Time of First Session', + }, + { + 'id': 'hs_analytics_first_visit_timestamp_timestamp_earliest_value_accc17ae', + 'label': 'hs_analytics_first_visit_timestamp_timestamp_earliest_value_accc17ae', + }, + { + 'id': 'hs_analytics_last_timestamp', + 'label': 'Time Last Seen', + }, + { + 'id': 'hs_analytics_last_timestamp_timestamp_latest_value_4e16365a', + 'label': 'hs_analytics_last_timestamp_timestamp_latest_value_4e16365a', + }, + { + 'id': 'hs_analytics_last_touch_converting_campaign', + 'label': 'Last Touch Converting Campaign', + }, + { + 'id': 'hs_analytics_last_touch_converting_campaign_timestamp_latest_value_81a64e30', + 'label': 'hs_analytics_last_touch_converting_campaign_timestamp_latest_value_81a64e30', + }, + { + 'id': 'hs_analytics_last_visit_timestamp', + 'label': 'Time of Last Session', + }, + { + 'id': 'hs_analytics_last_visit_timestamp_timestamp_latest_value_999a0fce', + 'label': 'hs_analytics_last_visit_timestamp_timestamp_latest_value_999a0fce', + }, + { + 'id': 'hs_analytics_num_page_views', + 'label': 'Number of Pageviews', + }, + { + 'id': 'hs_analytics_num_page_views_cardinality_sum_e46e85b0', + 'label': 'hs_analytics_num_page_views_cardinality_sum_e46e85b0', + }, + { + 'id': 'hs_analytics_num_visits', + 'label': 'Number of Sessions', + }, + { + 'id': 'hs_analytics_num_visits_cardinality_sum_53d952a6', + 'label': 'hs_analytics_num_visits_cardinality_sum_53d952a6', + }, + { + 'id': 'hs_analytics_source', + 'label': 'Original Source Type', + }, + { + 'id': 'hs_analytics_source_data_1', + 'label': 'Original Source Data 1', + }, + { + 'id': 'hs_analytics_source_data_1_timestamp_earliest_value_9b2f1fa1', + 'label': 'hs_analytics_source_data_1_timestamp_earliest_value_9b2f1fa1', + }, + { + 'id': 'hs_analytics_source_data_2', + 'label': 'Original Source Data 2', + }, + { + 'id': 'hs_analytics_source_data_2_timestamp_earliest_value_9b2f9400', + 'label': 'hs_analytics_source_data_2_timestamp_earliest_value_9b2f9400', + }, + { + 'id': 'hs_analytics_source_timestamp_earliest_value_25a3a52c', + 'label': 'hs_analytics_source_timestamp_earliest_value_25a3a52c', + }, + { + 'id': 'hs_avatar_filemanager_key', + 'label': 'Avatar FileManager key', + }, + { + 'id': 'hs_created_by_user_id', + 'label': 'Created by user ID', + }, + { + 'id': 'hs_createdate', + 'label': 'Object create date/time', + }, + { + 'id': 'hs_ideal_customer_profile', + 'label': 'Ideal Customer Profile Tier', + }, + { + 'id': 'hs_is_target_account', + 'label': 'Target Account', + }, + { + 'id': 'hs_last_booked_meeting_date', + 'label': 'Last Booked Meeting Date', + }, + { + 'id': 'hs_last_logged_call_date', + 'label': 'Last Logged Call Date', + }, + { + 'id': 'hs_last_open_task_date', + 'label': 'Last Open Task Date', + }, + { + 'id': 'hs_last_sales_activity_date', + 'label': 'last sales activity date old', + }, + { + 'id': 'hs_last_sales_activity_timestamp', + 'label': 'Last Engagement Date', + }, + { + 'id': 'hs_lastmodifieddate', + 'label': 'Last Modified Date', + }, + { + 'id': 'hs_merged_object_ids', + 'label': 'Merged object IDs', + }, + { + 'id': 'hs_num_blockers', + 'label': 'Number of blockers', + }, + { + 'id': 'hs_num_contacts_with_buying_roles', + 'label': 'Number of contacts with a buying role', + }, + { + 'id': 'hs_num_decision_makers', + 'label': 'Number of decision makers', + }, + { + 'id': 'hs_num_open_deals', + 'label': 'Number of open deals', + }, + { + 'id': 'hs_object_id', + 'label': 'Company ID', + }, + { + 'id': 'hs_predictivecontactscore_v2', + 'label': 'Likelihood to close', + }, + { + 'id': 'hs_predictivecontactscore_v2_next_max_max_d4e58c1e', + 'label': 'hs_predictivecontactscore_v2_next_max_max_d4e58c1e', + }, + { + 'id': 'hs_target_account', + 'label': 'Target Account', + }, + { + 'id': 'hs_target_account_probability', + 'label': 'Target Account Probability', + }, + { + 'id': 'hs_target_account_recommendation_snooze_time', + 'label': 'Target Account Recommendation Snooze Time', + }, + { + 'id': 'hs_target_account_recommendation_state', + 'label': 'Target Account Recommendation State', + }, + { + 'id': 'hs_total_deal_value', + 'label': 'Total open deal value', + }, + { + 'id': 'hs_updated_by_user_id', + 'label': 'Updated by user ID', + }, + { + 'id': 'hs_user_ids_of_all_owners', + 'label': 'User IDs of all owners', + }, + { + 'id': 'hubspot_owner_assigneddate', + 'label': 'Owner Assigned Date', + }, + { + 'id': 'is_public', + 'label': 'Is Public', + }, + { + 'id': 'num_associated_contacts', + 'label': 'Associated Contacts', + }, + { + 'id': 'num_associated_deals', + 'label': 'Associated Deals', + }, + { + 'id': 'num_conversion_events', + 'label': 'Number of Form Submissions', + }, + { + 'id': 'num_conversion_events_cardinality_sum_d095f14b', + 'label': 'num_conversion_events_cardinality_sum_d095f14b', + }, + { + 'id': 'recent_conversion_date', + 'label': 'Recent Conversion Date', + }, + { + 'id': 'recent_conversion_date_timestamp_latest_value_72856da1', + 'label': 'recent_conversion_date_timestamp_latest_value_72856da1', + }, + { + 'id': 'recent_conversion_event_name', + 'label': 'Recent Conversion', + }, + { + 'id': 'recent_conversion_event_name_timestamp_latest_value_66c820bf', + 'label': 'recent_conversion_event_name_timestamp_latest_value_66c820bf', + }, + { + 'id': 'recent_deal_amount', + 'label': 'Recent Deal Amount', + }, + { + 'id': 'recent_deal_close_date', + 'label': 'Recent Deal Close Date', + }, + { + 'id': 'timezone', + 'label': 'Time Zone', + }, + { + 'id': 'total_money_raised', + 'label': 'Total Money Raised', + }, + { + 'id': 'total_revenue', + 'label': 'Total Revenue', + }, + { + 'id': 'name', + 'label': 'Name', + }, + { + 'id': 'owneremail', + 'label': 'HubSpot Owner Email', + }, + { + 'id': 'twitterhandle', + 'label': 'Twitter Handle', + }, + { + 'id': 'ownername', + 'label': 'HubSpot Owner Name', + }, + { + 'id': 'phone', + 'label': 'Phone Number', + }, + { + 'id': 'twitterbio', + 'label': 'Twitter Bio', + }, + { + 'id': 'twitterfollowers', + 'label': 'Twitter Followers', + }, + { + 'id': 'address', + 'label': 'Street Address', + }, + { + 'id': 'address2', + 'label': 'Street Address 2', + }, + { + 'id': 'facebook_company_page', + 'label': 'Facebook Company Page', + }, + { + 'id': 'city', + 'label': 'City', + }, + { + 'id': 'linkedin_company_page', + 'label': 'LinkedIn Company Page', + }, + { + 'id': 'linkedinbio', + 'label': 'LinkedIn Bio', + }, + { + 'id': 'state', + 'label': 'State/Region', + }, + { + 'id': 'googleplus_page', + 'label': 'Google Plus Page', + }, + { + 'id': 'engagements_last_meeting_booked', + 'label': 'Date of last meeting booked in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_campaign', + 'label': 'Campaign of last booking in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_medium', + 'label': 'Medium of last booking in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_source', + 'label': 'Source of last booking in meetings tool', + }, + { + 'id': 'hs_latest_meeting_activity', + 'label': 'Latest meeting activity', + }, + { + 'id': 'hs_sales_email_last_replied', + 'label': 'Recent Sales Email Replied Date', + }, + { + 'id': 'hubspot_owner_id', + 'label': 'Company owner', + }, + { + 'id': 'notes_last_contacted', + 'label': 'Last Contacted', + }, + { + 'id': 'notes_last_updated', + 'label': 'Last Activity Date', + }, + { + 'id': 'notes_next_activity_date', + 'label': 'Next Activity Date', + }, + { + 'id': 'num_contacted_notes', + 'label': 'Number of times contacted', + }, + { + 'id': 'num_notes', + 'label': 'Number of Sales Activities', + }, + { + 'id': 'zip', + 'label': 'Postal Code', + }, + { + 'id': 'country', + 'label': 'Country/Region', + }, + { + 'id': 'hubspot_team_id', + 'label': 'HubSpot Team', + }, + { + 'id': 'hs_all_owner_ids', + 'label': 'All owner ids', + }, + { + 'id': 'website', + 'label': 'Website URL', + }, + { + 'id': 'domain', + 'label': 'Company Domain Name', + }, + { + 'id': 'hs_all_team_ids', + 'label': 'All team ids', + }, + { + 'id': 'hs_all_accessible_team_ids', + 'label': 'All accessible team ids', + }, + { + 'id': 'numberofemployees', + 'label': 'Number of Employees', + }, + { + 'id': 'industry', + 'label': 'Industry', + }, + { + 'id': 'annualrevenue', + 'label': 'Annual Revenue', + }, + { + 'id': 'lifecyclestage', + 'label': 'Lifecycle Stage', + }, + { + 'id': 'hs_lead_status', + 'label': 'Lead Status', + }, + { + 'id': 'hs_parent_company_id', + 'label': 'Parent Company', + }, + { + 'id': 'type', + 'label': 'Type', + }, + { + 'id': 'description', + 'label': 'Description', + }, + { + 'id': 'hs_num_child_companies', + 'label': 'Number of child companies', + }, + { + 'id': 'hubspotscore', + 'label': 'HubSpot Score', + }, + { + 'id': 'createdate', + 'label': 'Create Date', + }, + { + 'id': 'closedate', + 'label': 'Close Date', + }, + { + 'id': 'first_contact_createdate', + 'label': 'First Contact Create Date', + }, + { + 'id': 'days_to_close', + 'label': 'Days to Close', + }, + { + 'id': 'web_technologies', + 'label': 'Web Technologies', + }, +]; + +export const dealFields = [ + { + 'id': 'amount_in_home_currency', + 'label': 'Amount in company currency', + }, + { + 'id': 'days_to_close', + 'label': 'Days to close', + }, + { + 'id': 'deal_currency_code', + 'label': 'Currency', + }, + { + 'id': 'hs_acv', + 'label': 'Annual contract value', + }, + { + 'id': 'hs_analytics_source', + 'label': 'Original Source Type', + }, + { + 'id': 'hs_analytics_source_data_1', + 'label': 'Original Source Data 1', + }, + { + 'id': 'hs_analytics_source_data_2', + 'label': 'Original Source Data 2', + }, + { + 'id': 'hs_arr', + 'label': 'Annual recurring revenue', + }, + { + 'id': 'hs_campaign', + 'label': 'HubSpot Campaign', + }, + { + 'id': 'hs_closed_amount', + 'label': 'Closed Deal Amount', + }, + { + 'id': 'hs_closed_amount_in_home_currency', + 'label': 'Closed Deal Amount In Home Currency', + }, + { + 'id': 'hs_created_by_user_id', + 'label': 'Created by user ID', + }, + { + 'id': 'hs_date_entered_appointmentscheduled', + 'label': 'Date entered \'Appointment Scheduled (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_entered_closedlost', + 'label': 'Date entered \'Closed Lost (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_entered_closedwon', + 'label': 'Date entered \'Closed Won (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_entered_contractsent', + 'label': 'Date entered \'Contract Sent (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_entered_decisionmakerboughtin', + 'label': 'Date entered \'Decision Maker Bought-In (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_entered_presentationscheduled', + 'label': 'Date entered \'Presentation Scheduled (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_entered_qualifiedtobuy', + 'label': 'Date entered \'Qualified To Buy (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_appointmentscheduled', + 'label': 'Date exited \'Appointment Scheduled (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_closedlost', + 'label': 'Date exited \'Closed Lost (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_closedwon', + 'label': 'Date exited \'Closed Won (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_contractsent', + 'label': 'Date exited \'Contract Sent (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_decisionmakerboughtin', + 'label': 'Date exited \'Decision Maker Bought-In (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_presentationscheduled', + 'label': 'Date exited \'Presentation Scheduled (Sales Pipeline)\'', + }, + { + 'id': 'hs_date_exited_qualifiedtobuy', + 'label': 'Date exited \'Qualified To Buy (Sales Pipeline)\'', + }, + { + 'id': 'hs_deal_amount_calculation_preference', + 'label': 'Deal amount calculation preference', + }, + { + 'id': 'hs_deal_stage_probability', + 'label': 'Deal Stage Probability', + }, + { + 'id': 'hs_forecast_amount', + 'label': 'Forecast Amount', + }, + { + 'id': 'hs_forecast_probability', + 'label': 'Forecast Probability', + }, + { + 'id': 'hs_is_closed', + 'label': 'Is Deal Closed?', + }, + { + 'id': 'hs_lastmodifieddate', + 'label': 'Last Modified Date', + }, + { + 'id': 'hs_likelihood_to_close', + 'label': 'Likelihood to close by the close date', + }, + { + 'id': 'hs_line_item_global_term_hs_discount_percentage', + 'label': 'Global Term Line Item Discount Percentage', + }, + { + 'id': 'hs_line_item_global_term_hs_discount_percentage_enabled', + 'label': 'Global Term Line Item Discount Percentage Enabled', + }, + { + 'id': 'hs_line_item_global_term_hs_recurring_billing_period', + 'label': 'Global Term Line Item Recurring Billing Period', + }, + { + 'id': 'hs_line_item_global_term_hs_recurring_billing_period_enabled', + 'label': 'Global Term Line Item Recurring Billing Period Enabled', + }, + { + 'id': 'hs_line_item_global_term_hs_recurring_billing_start_date', + 'label': 'Global Term Line Item Recurring Billing Start Date', + }, + { + 'id': 'hs_line_item_global_term_hs_recurring_billing_start_date_enabled', + 'label': 'Global Term Line Item Recurring Billing Start Date Enabled', + }, + { + 'id': 'hs_line_item_global_term_recurringbillingfrequency', + 'label': 'Global Term Line Item Recurring Billing Frequency', + }, + { + 'id': 'hs_line_item_global_term_recurringbillingfrequency_enabled', + 'label': 'Global Term Line Item Recurring Billing Frequency Enabled', + }, + { + 'id': 'hs_manual_forecast_category', + 'label': 'Forecast category', + }, + { + 'id': 'hs_merged_object_ids', + 'label': 'Merged object IDs', + }, + { + 'id': 'hs_mrr', + 'label': 'Monthly recurring revenue', + }, + { + 'id': 'hs_next_step', + 'label': 'Next step', + }, + { + 'id': 'hs_object_id', + 'label': 'Deal ID', + }, + { + 'id': 'hs_predicted_amount', + 'label': 'The predicted deal amount', + }, + { + 'id': 'hs_predicted_amount_in_home_currency', + 'label': 'The predicted deal amount in your company\'s currency', + }, + { + 'id': 'hs_projected_amount', + 'label': 'Projected Deal Amount', + }, + { + 'id': 'hs_projected_amount_in_home_currency', + 'label': 'Projected Deal Amount in Home Currency', + }, + { + 'id': 'hs_tcv', + 'label': 'Total contract value', + }, + { + 'id': 'hs_time_in_appointmentscheduled', + 'label': 'Time in \'Appointment Scheduled (Sales Pipeline)\'', + }, + { + 'id': 'hs_time_in_closedlost', + 'label': 'Time in \'Closed Lost (Sales Pipeline)\'', + }, + { + 'id': 'hs_time_in_closedwon', + 'label': 'Time in \'Closed Won (Sales Pipeline)\'', + }, + { + 'id': 'hs_time_in_contractsent', + 'label': 'Time in \'Contract Sent (Sales Pipeline)\'', + }, + { + 'id': 'hs_time_in_decisionmakerboughtin', + 'label': 'Time in \'Decision Maker Bought-In (Sales Pipeline)\'', + }, + { + 'id': 'hs_time_in_presentationscheduled', + 'label': 'Time in \'Presentation Scheduled (Sales Pipeline)\'', + }, + { + 'id': 'hs_time_in_qualifiedtobuy', + 'label': 'Time in \'Qualified To Buy (Sales Pipeline)\'', + }, + { + 'id': 'hs_updated_by_user_id', + 'label': 'Updated by user ID', + }, + { + 'id': 'hs_user_ids_of_all_owners', + 'label': 'User IDs of all owners', + }, + { + 'id': 'hubspot_owner_assigneddate', + 'label': 'Owner Assigned Date', + }, + { + 'id': 'testing', + 'label': 'testing', + }, + { + 'id': 'dealname', + 'label': 'Deal Name', + }, + { + 'id': 'amount', + 'label': 'Amount', + }, + { + 'id': 'dealstage', + 'label': 'Deal Stage', + }, + { + 'id': 'pipeline', + 'label': 'Pipeline', + }, + { + 'id': 'closedate', + 'label': 'Close Date', + }, + { + 'id': 'createdate', + 'label': 'Create Date', + }, + { + 'id': 'engagements_last_meeting_booked', + 'label': 'Date of last meeting booked in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_campaign', + 'label': 'Campaign of last booking in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_medium', + 'label': 'Medium of last booking in meetings tool', + }, + { + 'id': 'engagements_last_meeting_booked_source', + 'label': 'Source of last booking in meetings tool', + }, + { + 'id': 'hs_latest_meeting_activity', + 'label': 'Latest meeting activity', + }, + { + 'id': 'hs_sales_email_last_replied', + 'label': 'Recent Sales Email Replied Date', + }, + { + 'id': 'hubspot_owner_id', + 'label': 'Deal owner', + }, + { + 'id': 'notes_last_contacted', + 'label': 'Last Contacted', + }, + { + 'id': 'notes_last_updated', + 'label': 'Last Activity Date', + }, + { + 'id': 'notes_next_activity_date', + 'label': 'Next Activity Date', + }, + { + 'id': 'num_contacted_notes', + 'label': 'Number of times contacted', + }, + { + 'id': 'num_notes', + 'label': 'Number of Sales Activities', + }, + { + 'id': 'hs_createdate', + 'label': 'HubSpot Create Date', + }, + { + 'id': 'hubspot_team_id', + 'label': 'HubSpot Team', + }, + { + 'id': 'dealtype', + 'label': 'Deal Type', + }, + { + 'id': 'hs_all_owner_ids', + 'label': 'All owner ids', + }, + { + 'id': 'description', + 'label': 'Deal Description', + }, + { + 'id': 'hs_all_team_ids', + 'label': 'All team ids', + }, + { + 'id': 'hs_all_accessible_team_ids', + 'label': 'All accessible team ids', + }, + { + 'id': 'num_associated_contacts', + 'label': 'Number of Contacts', + }, + { + 'id': 'closed_lost_reason', + 'label': 'Closed Lost Reason', + }, + { + 'id': 'closed_won_reason', + 'label': 'Closed Won Reason', + }, +]; diff --git a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts index fd2e720447..18298614c2 100644 --- a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts +++ b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts @@ -63,7 +63,7 @@ export class Hubspot implements INodeType { description: INodeTypeDescription = { displayName: 'HubSpot', name: 'hubspot', - icon: 'file:hubspot.png', + icon: 'file:hubspot.svg', group: ['output'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', diff --git a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts index 1274d929fe..8f29418dac 100644 --- a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts +++ b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts @@ -5,27 +5,36 @@ import { import { IDataObject, + ILoadOptionsFunctions, + INodePropertyOptions, INodeType, INodeTypeDescription, IWebhookResponseData, } from 'n8n-workflow'; import { + companyFields, + contactFields, + dealFields, hubspotApiRequest, + propertyEvents, } from './GenericFunctions'; import { createHash, - } from 'crypto'; +} from 'crypto'; + +import { + capitalCase, +} from 'change-case'; export class HubspotTrigger implements INodeType { description: INodeTypeDescription = { displayName: 'HubSpot Trigger', name: 'hubspotTrigger', - icon: 'file:hubspot.png', + icon: 'file:hubspot.svg', group: ['trigger'], version: 1, - subtitle: '={{($parameter["appId"]) ? $parameter["event"] : ""}}', description: 'Starts the workflow when HubSpot events occur.', defaults: { name: 'Hubspot Trigger', @@ -55,87 +64,132 @@ export class HubspotTrigger implements INodeType { ], properties: [ { - displayName: 'App ID', - name: 'appId', - type: 'string', - default: '', - required: true, - description: 'App ID', - }, - { - displayName: 'Event', - name: 'event', - type: 'options', + displayName: 'Events', + name: 'eventsUi', + type: 'fixedCollection', + typeOptions: { + multipleValues: true, + }, + placeholder: 'Add Event', + default: {}, options: [ { - name: 'contact.creation', - value: 'contact.creation', - description: `To get notified if any contact is created in a customer's account.`, - }, - { - name: 'contact.deletion', - value: 'contact.deletion', - description: `To get notified if any contact is deleted in a customer's account.`, - }, - { - name: 'contact.privacyDeletion', - value: 'contact.privacyDeletion', - description: `To get notified if a contact is deleted for privacy compliance reasons. `, - }, - { - name: 'contact.propertyChange', - value: 'contact.propertyChange', - description: `to get notified if a specified property is changed for any contact in a customer's account. `, - }, - { - name: 'company.creation', - value: 'company.creation', - description: `To get notified if any company is created in a customer's account.`, - }, - { - name: 'company.deletion', - value: 'company.deletion', - description: `To get notified if any company is deleted in a customer's account.`, - }, - { - name: 'company.propertyChange', - value: 'company.propertyChange', - description: `To get notified if a specified property is changed for any company in a customer's account.`, - }, - { - name: 'deal.creation', - value: 'deal.creation', - description: `To get notified if any deal is created in a customer's account.`, - }, - { - name: 'deal.deletion', - value: 'deal.deletion', - description: `To get notified if any deal is deleted in a customer's account.`, - }, - { - name: 'deal.propertyChange', - value: 'deal.propertyChange', - description: `To get notified if a specified property is changed for any deal in a customer's account.`, - }, - ], - default: 'contact.creation', - required: true, - }, - { - displayName: 'Property', - name: 'property', - type: 'string', - displayOptions: { - show: { - event: [ - 'contact.propertyChange', - 'company.propertyChange', - 'deal.propertyChange', + displayName: 'Event', + name: 'eventValues', + values: [ + { + displayName: 'Name', + name: 'name', + type: 'options', + options: [ + { + name: 'Contact Created', + value: 'contact.creation', + description: `To get notified if any contact is created in a customer's account.`, + }, + { + name: 'Contact Deleted', + value: 'contact.deletion', + description: `To get notified if any contact is deleted in a customer's account.`, + }, + { + name: 'Contact Privacy Deleted', + value: 'contact.privacyDeletion', + description: `To get notified if a contact is deleted for privacy compliance reasons. `, + }, + { + name: 'Contact Property Changed', + value: 'contact.propertyChange', + description: `to get notified if a specified property is changed for any contact in a customer's account. `, + }, + { + name: 'Company Created', + value: 'company.creation', + description: `To get notified if any company is created in a customer's account.`, + }, + { + name: 'Company Deleted', + value: 'company.deletion', + description: `To get notified if any company is deleted in a customer's account.`, + }, + { + name: 'Company Property Changed', + value: 'company.propertyChange', + description: `To get notified if a specified property is changed for any company in a customer's account.`, + }, + { + name: 'Deal Created', + value: 'deal.creation', + description: `To get notified if any deal is created in a customer's account.`, + }, + { + name: 'Deal Deleted', + value: 'deal.deletion', + description: `To get notified if any deal is deleted in a customer's account.`, + }, + { + name: 'Deal Property Changed', + value: 'deal.propertyChange', + description: `To get notified if a specified property is changed for any deal in a customer's account.`, + }, + ], + default: 'contact.creation', + required: true, + }, + { + displayName: 'Property', + name: 'property', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getContactProperties', + }, + displayOptions: { + show: { + name: [ + 'contact.propertyChange', + ], + }, + }, + default: '', + required: true, + }, + { + displayName: 'Property', + name: 'property', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getCompanyProperties', + }, + displayOptions: { + show: { + name: [ + 'company.propertyChange', + ], + }, + }, + default: '', + required: true, + }, + { + displayName: 'Property', + name: 'property', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getDealProperties', + }, + displayOptions: { + show: { + name: [ + 'deal.propertyChange', + ], + }, + }, + default: '', + required: true, + }, ], }, - }, - default: '', - required: true, + ], }, { displayName: 'Additional Fields', @@ -156,7 +210,62 @@ export class HubspotTrigger implements INodeType { ], }, ], + }; + methods = { + loadOptions: { + // Get all the available contacts to display them to user so that he can + // select them easily + async getContactProperties(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + for (const field of contactFields) { + returnData.push({ + name: capitalCase(field.label), + value: field.id, + }); + } + returnData.sort((a, b) => { + if (a.name < b.name) { return -1; } + if (a.name > b.name) { return 1; } + return 0; + }); + return returnData; + }, + // Get all the available companies to display them to user so that he can + // select them easily + async getCompanyProperties(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + for (const field of companyFields) { + returnData.push({ + name: capitalCase(field.label), + value: field.id, + }); + } + returnData.sort((a, b) => { + if (a.name < b.name) { return -1; } + if (a.name > b.name) { return 1; } + return 0; + }); + return returnData; + }, + // Get all the available deals to display them to user so that he can + // select them easily + async getDealProperties(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + for (const field of dealFields) { + returnData.push({ + name: capitalCase(field.label), + value: field.id, + }); + } + returnData.sort((a, b) => { + if (a.name < b.name) { return -1; } + if (a.name > b.name) { return 1; } + return 0; + }); + return returnData; + }, + }, }; // @ts-ignore (because of request) @@ -165,80 +274,78 @@ export class HubspotTrigger implements INodeType { async checkExists(this: IHookFunctions): Promise { // Check all the webhooks which exist already if it is identical to the // one that is supposed to get created. - const app = parseInt(this.getNodeParameter('appId') as string, 10); - const event = this.getNodeParameter('event') as string; - const webhookUrlUi = this.getNodeWebhookUrl('default') as string; - let endpoint = `/webhooks/v1/${app}/settings`; - const { webhookUrl , appId } = await hubspotApiRequest.call(this, 'GET', endpoint, {}); - endpoint = `/webhooks/v1/${app}/subscriptions`; - const subscriptions = await hubspotApiRequest.call(this, 'GET', endpoint, {}); - for (const subscription of subscriptions) { - if (webhookUrl === webhookUrlUi - && appId === app - && subscription.subscriptionDetails.subscriptionType === event - && subscription.enabled === true) { - return true; + const currentWebhookUrl = this.getNodeWebhookUrl('default') as string; + const { appId } = this.getCredentials('hubspotDeveloperApi') as IDataObject; + + try { + const { targetUrl } = await hubspotApiRequest.call(this, 'GET', `/webhooks/v3/${appId}/settings`, {}); + if (targetUrl !== currentWebhookUrl) { + throw new Error(`The APP ID ${appId} already has a target url ${targetUrl}. Delete it or use another APP ID before executing the trigger. Due to Hubspot API limitations, you can have just one trigger per APP.`); + } + } catch (error) { + if (error.statusCode === 404) { + return false; } } + // if the app is using the current webhook url. Delete everything and create it again with the current events + + const { results: subscriptions } = await hubspotApiRequest.call(this, 'GET', `/webhooks/v3/${appId}/subscriptions`, {}); + + // delete all subscriptions + for (const subscription of subscriptions) { + await hubspotApiRequest.call(this, 'DELETE', `/webhooks/v3/${appId}/subscriptions/${subscription.id}`, {}); + } + + await hubspotApiRequest.call(this, 'DELETE', `/webhooks/v3/${appId}/settings`, {}); + return false; }, async create(this: IHookFunctions): Promise { const webhookUrl = this.getNodeWebhookUrl('default'); - const app = this.getNodeParameter('appId') as string; - const event = this.getNodeParameter('event') as string; + const { appId } = this.getCredentials('hubspotDeveloperApi') as IDataObject; + const events = (this.getNodeParameter('eventsUi') as IDataObject || {}).eventValues as IDataObject[] || []; const additionalFields = this.getNodeParameter('additionalFields') as IDataObject; - const propertyEvents = [ - 'contact.propertyChange', - 'company.propertyChange', - 'deal.propertyChange', - ]; - let endpoint = `/webhooks/v1/${app}/settings`; + let endpoint = `/webhooks/v3/${appId}/settings`; let body: IDataObject = { - webhookUrl, + targetUrl: webhookUrl, maxConcurrentRequests: additionalFields.maxConcurrentRequests || 5, }; + await hubspotApiRequest.call(this, 'PUT', endpoint, body); - endpoint = `/webhooks/v1/${app}/subscriptions`; - body = { - subscriptionDetails: { - subscriptionType: event, - }, - enabled: true, - }; - if (propertyEvents.includes(event)) { - const property = this.getNodeParameter('property') as string; - //@ts-ignore - body.subscriptionDetails.propertyName = property; + endpoint = `/webhooks/v3/${appId}/subscriptions`; + + if (Array.isArray(events) && events.length === 0) { + throw new Error(`You must define at least one event`); } - const responseData = await hubspotApiRequest.call(this, 'POST', endpoint, body); - - if (responseData.id === undefined) { - // Required data is missing so was not successful - return false; + for (const event of events) { + body = { + eventType: event.name, + active: true, + }; + if (propertyEvents.includes(event.name as string)) { + const property = event.property; + body.propertyName = property; + } + await hubspotApiRequest.call(this, 'POST', endpoint, body); } - const webhookData = this.getWorkflowStaticData('node'); - webhookData.webhookId = responseData.id as string; return true; }, async delete(this: IHookFunctions): Promise { - const webhookData = this.getWorkflowStaticData('node'); - const app = this.getNodeParameter('appId') as string; - if (webhookData.webhookId !== undefined) { - const endpoint = `/webhooks/v1/${app}/subscriptions/${webhookData.webhookId}`; + const { appId } = this.getCredentials('hubspotDeveloperApi') as IDataObject; - const body = {}; + const { results: subscriptions } = await hubspotApiRequest.call(this, 'GET', `/webhooks/v3/${appId}/subscriptions`, {}); - try { - await hubspotApiRequest.call(this, 'DELETE', endpoint, body); - } catch (e) { - return false; - } - // Remove from the static workflow data so that it is clear - // that no webhooks are registred anymore - delete webhookData.webhookId; + for (const subscription of subscriptions) { + await hubspotApiRequest.call(this, 'DELETE', `/webhooks/v3/${appId}/subscriptions/${subscription.id}`, {}); + } + + try { + await hubspotApiRequest.call(this, 'DELETE', `/webhooks/v3/${appId}/settings`, {}); + } catch (e) { + return false; } return true; }, @@ -265,7 +372,7 @@ export class HubspotTrigger implements INodeType { if (credentials.clientSecret !== '') { const hash = `${credentials!.clientSecret}${JSON.stringify(bodyData)}`; - const signature = createHash('sha256').update(hash).digest('hex'); + const signature = createHash('sha256').update(hash).digest('hex'); //@ts-ignore if (signature !== headerData['x-hubspot-signature']) { return {}; diff --git a/packages/nodes-base/nodes/Hubspot/TicketDescription.ts b/packages/nodes-base/nodes/Hubspot/TicketDescription.ts index adf6236b50..0836a6de4b 100644 --- a/packages/nodes-base/nodes/Hubspot/TicketDescription.ts +++ b/packages/nodes-base/nodes/Hubspot/TicketDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const ticketOperations = [ { @@ -48,9 +48,9 @@ export const ticketOperations = [ export const ticketFields = [ -/* -------------------------------------------------------------------------- */ -/* ticket:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* ticket:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Pipeline ID', name: 'pipelineId', @@ -70,7 +70,7 @@ export const ticketFields = [ }, }, default: '', - description: 'The ID of the pipeline the ticket is in. ', + description: 'The ID of the pipeline the ticket is in.', }, { displayName: 'Stage ID', @@ -94,7 +94,7 @@ export const ticketFields = [ }, }, default: '', - description: 'The ID of the pipeline the ticket is in. ', + description: 'The ID of the pipeline the ticket is in.', }, { displayName: 'Ticket Name', @@ -112,7 +112,7 @@ export const ticketFields = [ }, }, default: '', - description: 'The ID of the pipeline the ticket is in. ', + description: 'The ID of the pipeline the ticket is in.', }, { displayName: 'Additional Fields', @@ -136,7 +136,7 @@ export const ticketFields = [ name: 'associatedCompanyIds', type: 'multiOptions', typeOptions: { - loadOptionsMethod:'getCompanies' , + loadOptionsMethod: 'getCompanies', }, default: [], description: 'Companies associated with the ticket', @@ -146,7 +146,7 @@ export const ticketFields = [ name: 'associatedContactIds', type: 'multiOptions', typeOptions: { - loadOptionsMethod:'getContacts' , + loadOptionsMethod: 'getContacts', }, default: [], description: 'Contacts associated with the ticket', @@ -228,9 +228,9 @@ export const ticketFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* ticket:update */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* ticket:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Ticket ID', name: 'ticketId', @@ -247,7 +247,7 @@ export const ticketFields = [ }, }, default: '', - description: 'Unique identifier for a particular ticket', + description: 'Unique identifier for a particular ticket.', }, { displayName: 'Update Fields', @@ -271,20 +271,20 @@ export const ticketFields = [ name: 'associatedCompanyIds', type: 'multiOptions', typeOptions: { - loadOptionsMethod:'getCompanies' , + loadOptionsMethod: 'getCompanies', }, default: [], - description: 'Companies associated with the ticket', + description: 'Companies associated with the ticket.', }, { displayName: 'Contact Ids', name: 'associatedContactIds', type: 'multiOptions', typeOptions: { - loadOptionsMethod:'getContacts' , + loadOptionsMethod: 'getContacts', }, default: [], - description: 'Contact associated with the ticket', + description: 'Contact associated with the ticket.', }, { displayName: 'Category', @@ -294,21 +294,21 @@ export const ticketFields = [ loadOptionsMethod: 'getTicketCategories', }, default: '', - description: 'Main reason customer reached out for help', + description: 'Main reason customer reached out for help.', }, { displayName: 'Close Date', name: 'closeDate', type: 'dateTime', default: '', - description: 'The date the ticket was closed', + description: 'The date the ticket was closed.', }, { displayName: 'Create Date', name: 'createDate', type: 'dateTime', default: '', - description: 'the date the ticket was created', + description: 'The date the ticket was created.', }, { displayName: 'Description', @@ -328,7 +328,7 @@ export const ticketFields = [ loadOptionsMethod: 'getTicketPipelines', }, default: '', - description: 'The ID of the pipeline the ticket is in. ', + description: 'The ID of the pipeline the ticket is in.', }, { displayName: 'Priority', @@ -358,7 +358,7 @@ export const ticketFields = [ loadOptionsMethod: 'getTicketSources', }, default: '', - description: 'Channel where ticket was originally submitted', + description: 'Channel where ticket was originally submitted.', }, { displayName: 'Ticket Name', @@ -380,176 +380,179 @@ export const ticketFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* ticket:get */ -/* -------------------------------------------------------------------------- */ -{ - displayName: 'Ticket ID', - name: 'ticketId', - type: 'string', - required: true, - displayOptions: { - show: { - resource: [ - 'ticket', - ], - operation: [ - 'get', - ], - }, - }, - default: '', - description: 'Unique identifier for a particular ticket', -}, -{ - displayName: 'Additional Fields', - name: 'additionalFields', - type: 'collection', - placeholder: 'Add Field', - default: {}, - displayOptions: { - show: { - resource: [ - 'ticket', - ], - operation: [ - 'get', - ], - }, - }, - options: [ - { - displayName: 'Include Deleted', - name: 'includeDeleted', - type: 'boolean', - default: false, - }, - { - displayName: 'Properties', - name: 'properties', - type: 'multiOptions', - typeOptions: { - loadOptionsMethod: 'getTicketProperties', + + /* -------------------------------------------------------------------------- */ + /* ticket:get */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Ticket ID', + name: 'ticketId', + type: 'string', + required: true, + displayOptions: { + show: { + resource: [ + 'ticket', + ], + operation: [ + 'get', + ], }, - default: [], - description: `Used to include specific ticket properties in the results.
+ }, + default: '', + description: 'Unique identifier for a particular ticket', + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'ticket', + ], + operation: [ + 'get', + ], + }, + }, + options: [ + { + displayName: 'Include Deleted', + name: 'includeDeleted', + type: 'boolean', + default: false, + }, + { + displayName: 'Properties', + name: 'properties', + type: 'multiOptions', + typeOptions: { + loadOptionsMethod: 'getTicketProperties', + }, + default: [], + description: `Used to include specific ticket properties in the results.
By default, the results will only include ticket ID and will not include the values for any properties for your tickets.
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 separed by ,.`, - }, - { - displayName: 'Properties With History', - name: 'propertiesWithHistory', - type: 'string', - default: '', - description: `Works similarly to properties=, but this parameter will include the history for the specified property,
- instead of just including the current value. Use this parameter when you need the full history of changes to a property's value.`, - }, - ], -}, -/* -------------------------------------------------------------------------- */ -/* ticket:getAll */ -/* -------------------------------------------------------------------------- */ -{ - displayName: 'Return All', - name: 'returnAll', - type: 'boolean', - displayOptions: { - show: { - resource: [ - 'ticket', - ], - operation: [ - 'getAll', - ], - }, - }, - default: false, - description: 'If all results should be returned or only up to a given limit.', -}, -{ - displayName: 'Limit', - name: 'limit', - type: 'number', - displayOptions: { - show: { - resource: [ - 'ticket', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], - }, - }, - typeOptions: { - minValue: 1, - maxValue: 250, - }, - default: 100, - description: 'How many results to return.', -}, -{ - displayName: 'Additional Fields', - name: 'additionalFields', - type: 'collection', - placeholder: 'Add Field', - default: {}, - displayOptions: { - show: { - resource: [ - 'ticket', - ], - operation: [ - 'getAll', - ], - }, - }, - options: [ - { - displayName: 'Properties', - name: 'properties', - type: 'multiOptions', - typeOptions: { - loadOptionsMethod: 'getTicketProperties', }, - default: [], - description: `Used to include specific ticket properties in the results.
+ { + displayName: 'Properties With History', + name: 'propertiesWithHistory', + type: 'string', + default: '', + description: `Works similarly to properties=, but this parameter will include the history for the specified property,
+ instead of just including the current value. Use this parameter when you need the full history of changes to a property's value.`, + }, + ], + }, + + /* -------------------------------------------------------------------------- */ + /* ticket:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + resource: [ + 'ticket', + ], + operation: [ + 'getAll', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'ticket', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 250, + }, + default: 100, + description: 'How many results to return.', + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'ticket', + ], + operation: [ + 'getAll', + ], + }, + }, + options: [ + { + displayName: 'Properties', + name: 'properties', + type: 'multiOptions', + typeOptions: { + loadOptionsMethod: 'getTicketProperties', + }, + default: [], + description: `Used to include specific ticket properties in the results.
By default, the results will only include ticket ID and will not include the values for any properties for your tickets.
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 separed by ,.`, - }, - { - displayName: 'Properties With History', - name: 'propertiesWithHistory', - type: 'string', - default: '', - description: `Works similarly to properties=, but this parameter will include the history for the specified property,
+ }, + { + displayName: 'Properties With History', + name: 'propertiesWithHistory', + type: 'string', + default: '', + description: `Works similarly to properties=, but this parameter will include the history for the specified property,
instead of just including the current value. Use this parameter when you need the full history of changes to a property's value.`, - }, - ], -}, -/* -------------------------------------------------------------------------- */ -/* ticket:delete */ -/* -------------------------------------------------------------------------- */ -{ - displayName: 'Ticket ID', - name: 'ticketId', - type: 'string', - required: true, - displayOptions: { - show: { - resource: [ - 'ticket', - ], - operation: [ - 'delete', - ], - }, + }, + ], + }, + + /* -------------------------------------------------------------------------- */ + /* ticket:delete */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Ticket ID', + name: 'ticketId', + type: 'string', + required: true, + displayOptions: { + show: { + resource: [ + 'ticket', + ], + operation: [ + 'delete', + ], + }, + }, + default: '', + description: 'Unique identifier for a particular ticket', }, - default: '', - description: 'Unique identifier for a particular ticket', -}, ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Hubspot/hubspot.png b/packages/nodes-base/nodes/Hubspot/hubspot.png deleted file mode 100644 index 026c1ade08..0000000000 Binary files a/packages/nodes-base/nodes/Hubspot/hubspot.png and /dev/null differ diff --git a/packages/nodes-base/nodes/Hubspot/hubspot.svg b/packages/nodes-base/nodes/Hubspot/hubspot.svg new file mode 100644 index 0000000000..0fd4c993e1 --- /dev/null +++ b/packages/nodes-base/nodes/Hubspot/hubspot.svg @@ -0,0 +1 @@ + \ No newline at end of file