diff --git a/apps/sim/blocks/blocks/hubspot.ts b/apps/sim/blocks/blocks/hubspot.ts index 165c0b02bf4..5cbd9210264 100644 --- a/apps/sim/blocks/blocks/hubspot.ts +++ b/apps/sim/blocks/blocks/hubspot.ts @@ -985,11 +985,15 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no }, ...getTrigger('hubspot_contact_created').subBlocks.slice(1), ...getTrigger('hubspot_contact_deleted').subBlocks.slice(1), + ...getTrigger('hubspot_contact_merged').subBlocks.slice(1), ...getTrigger('hubspot_contact_privacy_deleted').subBlocks.slice(1), ...getTrigger('hubspot_contact_property_changed').subBlocks.slice(1), + ...getTrigger('hubspot_contact_restored').subBlocks.slice(1), ...getTrigger('hubspot_company_created').subBlocks.slice(1), ...getTrigger('hubspot_company_deleted').subBlocks.slice(1), + ...getTrigger('hubspot_company_merged').subBlocks.slice(1), ...getTrigger('hubspot_company_property_changed').subBlocks.slice(1), + ...getTrigger('hubspot_company_restored').subBlocks.slice(1), ...getTrigger('hubspot_conversation_creation').subBlocks.slice(1), ...getTrigger('hubspot_conversation_deletion').subBlocks.slice(1), ...getTrigger('hubspot_conversation_new_message').subBlocks.slice(1), @@ -997,10 +1001,15 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no ...getTrigger('hubspot_conversation_property_changed').subBlocks.slice(1), ...getTrigger('hubspot_deal_created').subBlocks.slice(1), ...getTrigger('hubspot_deal_deleted').subBlocks.slice(1), + ...getTrigger('hubspot_deal_merged').subBlocks.slice(1), ...getTrigger('hubspot_deal_property_changed').subBlocks.slice(1), + ...getTrigger('hubspot_deal_restored').subBlocks.slice(1), ...getTrigger('hubspot_ticket_created').subBlocks.slice(1), ...getTrigger('hubspot_ticket_deleted').subBlocks.slice(1), + ...getTrigger('hubspot_ticket_merged').subBlocks.slice(1), ...getTrigger('hubspot_ticket_property_changed').subBlocks.slice(1), + ...getTrigger('hubspot_ticket_restored').subBlocks.slice(1), + ...getTrigger('hubspot_webhook').subBlocks.slice(1), ], tools: { access: [ @@ -1329,11 +1338,15 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no available: [ 'hubspot_contact_created', 'hubspot_contact_deleted', + 'hubspot_contact_merged', 'hubspot_contact_privacy_deleted', 'hubspot_contact_property_changed', + 'hubspot_contact_restored', 'hubspot_company_created', 'hubspot_company_deleted', + 'hubspot_company_merged', 'hubspot_company_property_changed', + 'hubspot_company_restored', 'hubspot_conversation_creation', 'hubspot_conversation_deletion', 'hubspot_conversation_new_message', @@ -1341,10 +1354,15 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no 'hubspot_conversation_property_changed', 'hubspot_deal_created', 'hubspot_deal_deleted', + 'hubspot_deal_merged', 'hubspot_deal_property_changed', + 'hubspot_deal_restored', 'hubspot_ticket_created', 'hubspot_ticket_deleted', + 'hubspot_ticket_merged', 'hubspot_ticket_property_changed', + 'hubspot_ticket_restored', + 'hubspot_webhook', ], }, } diff --git a/apps/sim/triggers/hubspot/company_merged.ts b/apps/sim/triggers/hubspot/company_merged.ts new file mode 100644 index 00000000000..4d64cf7ad3e --- /dev/null +++ b/apps/sim/triggers/hubspot/company_merged.ts @@ -0,0 +1,217 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildCompanyMergedOutputs, + hubspotCompanyTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotCompanyMergedTrigger: TriggerConfig = { + id: 'hubspot_company_merged', + name: 'HubSpot Company Merged', + provider: 'hubspot', + description: 'Trigger workflow when companies are merged in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotCompanyTriggerOptions, + value: () => 'hubspot_company_merged', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_company_merged', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'company.merge', + 'The webhook will trigger whenever two companies are merged in your HubSpot account. The objectId will be the winning (primary) company ID.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "company.merge", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to company merge events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526813, + subscriptionId: 4629974, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'company.merge', + attemptNumber: 0, + objectId: 216126906049, + changeFlag: 'MERGED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + mergedObjectIds: [216126906050], + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_merged', + }, + }, + ], + + outputs: buildCompanyMergedOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/company_restored.ts b/apps/sim/triggers/hubspot/company_restored.ts new file mode 100644 index 00000000000..a30528c6954 --- /dev/null +++ b/apps/sim/triggers/hubspot/company_restored.ts @@ -0,0 +1,216 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildCompanyRestoredOutputs, + hubspotCompanyTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotCompanyRestoredTrigger: TriggerConfig = { + id: 'hubspot_company_restored', + name: 'HubSpot Company Restored', + provider: 'hubspot', + description: 'Trigger workflow when a deleted company is restored in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotCompanyTriggerOptions, + value: () => 'hubspot_company_restored', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_company_restored', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'company.restore', + 'The webhook will trigger whenever a previously deleted company is restored in your HubSpot account.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "company.restore", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to company restore events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526814, + subscriptionId: 4629975, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'company.restore', + attemptNumber: 0, + objectId: 216126906049, + changeFlag: 'RESTORED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_company_restored', + }, + }, + ], + + outputs: buildCompanyRestoredOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/contact_merged.ts b/apps/sim/triggers/hubspot/contact_merged.ts new file mode 100644 index 00000000000..435399e7706 --- /dev/null +++ b/apps/sim/triggers/hubspot/contact_merged.ts @@ -0,0 +1,217 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildContactMergedOutputs, + hubspotContactTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotContactMergedTrigger: TriggerConfig = { + id: 'hubspot_contact_merged', + name: 'HubSpot Contact Merged', + provider: 'hubspot', + description: 'Trigger workflow when contacts are merged in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotContactTriggerOptions, + value: () => 'hubspot_contact_merged', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_contact_merged', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'contact.merge', + 'The webhook will trigger whenever two contacts are merged in your HubSpot account. The objectId will be the winning (primary) contact ID.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "contact.merge", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to contact merge events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526811, + subscriptionId: 4629972, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'contact.merge', + attemptNumber: 0, + objectId: 316126906049, + changeFlag: 'MERGED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + mergedObjectIds: [316126906050], + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_merged', + }, + }, + ], + + outputs: buildContactMergedOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/contact_restored.ts b/apps/sim/triggers/hubspot/contact_restored.ts new file mode 100644 index 00000000000..e3ad2113da6 --- /dev/null +++ b/apps/sim/triggers/hubspot/contact_restored.ts @@ -0,0 +1,216 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildContactRestoredOutputs, + hubspotContactTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotContactRestoredTrigger: TriggerConfig = { + id: 'hubspot_contact_restored', + name: 'HubSpot Contact Restored', + provider: 'hubspot', + description: 'Trigger workflow when a deleted contact is restored in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotContactTriggerOptions, + value: () => 'hubspot_contact_restored', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_contact_restored', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'contact.restore', + 'The webhook will trigger whenever a previously deleted contact is restored in your HubSpot account.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "contact.restore", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to contact restore events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526812, + subscriptionId: 4629973, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'contact.restore', + attemptNumber: 0, + objectId: 316126906049, + changeFlag: 'RESTORED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_contact_restored', + }, + }, + ], + + outputs: buildContactRestoredOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/deal_merged.ts b/apps/sim/triggers/hubspot/deal_merged.ts new file mode 100644 index 00000000000..e6d875af02d --- /dev/null +++ b/apps/sim/triggers/hubspot/deal_merged.ts @@ -0,0 +1,217 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildDealMergedOutputs, + hubspotDealTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotDealMergedTrigger: TriggerConfig = { + id: 'hubspot_deal_merged', + name: 'HubSpot Deal Merged', + provider: 'hubspot', + description: 'Trigger workflow when deals are merged in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotDealTriggerOptions, + value: () => 'hubspot_deal_merged', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_deal_merged', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'deal.merge', + 'The webhook will trigger whenever two deals are merged in your HubSpot account. The objectId will be the winning (primary) deal ID.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "deal.merge", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to deal merge events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526815, + subscriptionId: 4629976, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'deal.merge', + attemptNumber: 0, + objectId: 416126906049, + changeFlag: 'MERGED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + mergedObjectIds: [416126906050], + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_merged', + }, + }, + ], + + outputs: buildDealMergedOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/deal_restored.ts b/apps/sim/triggers/hubspot/deal_restored.ts new file mode 100644 index 00000000000..ba3eb28b8c4 --- /dev/null +++ b/apps/sim/triggers/hubspot/deal_restored.ts @@ -0,0 +1,216 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildDealRestoredOutputs, + hubspotDealTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotDealRestoredTrigger: TriggerConfig = { + id: 'hubspot_deal_restored', + name: 'HubSpot Deal Restored', + provider: 'hubspot', + description: 'Trigger workflow when a deleted deal is restored in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotDealTriggerOptions, + value: () => 'hubspot_deal_restored', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_deal_restored', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'deal.restore', + 'The webhook will trigger whenever a previously deleted deal is restored in your HubSpot account.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "deal.restore", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to deal restore events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526816, + subscriptionId: 4629977, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'deal.restore', + attemptNumber: 0, + objectId: 416126906049, + changeFlag: 'RESTORED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_deal_restored', + }, + }, + ], + + outputs: buildDealRestoredOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/index.ts b/apps/sim/triggers/hubspot/index.ts index 3150c828fec..2c8d6bb88c1 100644 --- a/apps/sim/triggers/hubspot/index.ts +++ b/apps/sim/triggers/hubspot/index.ts @@ -1,10 +1,14 @@ export { hubspotCompanyCreatedTrigger } from './company_created' export { hubspotCompanyDeletedTrigger } from './company_deleted' +export { hubspotCompanyMergedTrigger } from './company_merged' export { hubspotCompanyPropertyChangedTrigger } from './company_property_changed' +export { hubspotCompanyRestoredTrigger } from './company_restored' export { hubspotContactCreatedTrigger } from './contact_created' export { hubspotContactDeletedTrigger } from './contact_deleted' +export { hubspotContactMergedTrigger } from './contact_merged' export { hubspotContactPrivacyDeletedTrigger } from './contact_privacy_deleted' export { hubspotContactPropertyChangedTrigger } from './contact_property_changed' +export { hubspotContactRestoredTrigger } from './contact_restored' export { hubspotConversationCreationTrigger } from './conversation_creation' export { hubspotConversationDeletionTrigger } from './conversation_deletion' export { hubspotConversationNewMessageTrigger } from './conversation_new_message' @@ -12,8 +16,13 @@ export { hubspotConversationPrivacyDeletionTrigger } from './conversation_privac export { hubspotConversationPropertyChangedTrigger } from './conversation_property_changed' export { hubspotDealCreatedTrigger } from './deal_created' export { hubspotDealDeletedTrigger } from './deal_deleted' +export { hubspotDealMergedTrigger } from './deal_merged' export { hubspotDealPropertyChangedTrigger } from './deal_property_changed' +export { hubspotDealRestoredTrigger } from './deal_restored' export { hubspotTicketCreatedTrigger } from './ticket_created' export { hubspotTicketDeletedTrigger } from './ticket_deleted' +export { hubspotTicketMergedTrigger } from './ticket_merged' export { hubspotTicketPropertyChangedTrigger } from './ticket_property_changed' +export { hubspotTicketRestoredTrigger } from './ticket_restored' export { hubspotAllTriggerOptions, isHubSpotContactEventMatch } from './utils' +export { hubspotWebhookTrigger } from './webhook' diff --git a/apps/sim/triggers/hubspot/ticket_merged.ts b/apps/sim/triggers/hubspot/ticket_merged.ts new file mode 100644 index 00000000000..ce860ab1465 --- /dev/null +++ b/apps/sim/triggers/hubspot/ticket_merged.ts @@ -0,0 +1,217 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildTicketMergedOutputs, + hubspotSetupInstructions, + hubspotTicketTriggerOptions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotTicketMergedTrigger: TriggerConfig = { + id: 'hubspot_ticket_merged', + name: 'HubSpot Ticket Merged', + provider: 'hubspot', + description: 'Trigger workflow when tickets are merged in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotTicketTriggerOptions, + value: () => 'hubspot_ticket_merged', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_ticket_merged', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'ticket.merge', + 'The webhook will trigger whenever two tickets are merged in your HubSpot account. The objectId will be the winning (primary) ticket ID.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "ticket.merge", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to ticket merge events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526817, + subscriptionId: 4629978, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'ticket.merge', + attemptNumber: 0, + objectId: 516126906049, + changeFlag: 'MERGED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + mergedObjectIds: [516126906050], + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_merged', + }, + }, + ], + + outputs: buildTicketMergedOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/ticket_restored.ts b/apps/sim/triggers/hubspot/ticket_restored.ts new file mode 100644 index 00000000000..028082658b4 --- /dev/null +++ b/apps/sim/triggers/hubspot/ticket_restored.ts @@ -0,0 +1,216 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildTicketRestoredOutputs, + hubspotSetupInstructions, + hubspotTicketTriggerOptions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotTicketRestoredTrigger: TriggerConfig = { + id: 'hubspot_ticket_restored', + name: 'HubSpot Ticket Restored', + provider: 'hubspot', + description: 'Trigger workflow when a deleted ticket is restored in HubSpot', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotTicketTriggerOptions, + value: () => 'hubspot_ticket_restored', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_ticket_restored', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'ticket.restore', + 'The webhook will trigger whenever a previously deleted ticket is restored in your HubSpot account.' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "ticket.restore", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to subscribe to ticket restore events', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526818, + subscriptionId: 4629979, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'ticket.restore', + attemptNumber: 0, + objectId: 516126906049, + changeFlag: 'RESTORED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_ticket_restored', + }, + }, + ], + + outputs: buildTicketRestoredOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/hubspot/utils.ts b/apps/sim/triggers/hubspot/utils.ts index 3a220e70389..fa601b5980a 100644 --- a/apps/sim/triggers/hubspot/utils.ts +++ b/apps/sim/triggers/hubspot/utils.ts @@ -6,11 +6,15 @@ import type { TriggerOutput } from '@/triggers/types' export const hubspotAllTriggerOptions = [ { label: 'Contact Created', id: 'hubspot_contact_created' }, { label: 'Contact Deleted', id: 'hubspot_contact_deleted' }, + { label: 'Contact Merged', id: 'hubspot_contact_merged' }, { label: 'Contact Privacy Deleted', id: 'hubspot_contact_privacy_deleted' }, { label: 'Contact Property Changed', id: 'hubspot_contact_property_changed' }, + { label: 'Contact Restored', id: 'hubspot_contact_restored' }, { label: 'Company Created', id: 'hubspot_company_created' }, { label: 'Company Deleted', id: 'hubspot_company_deleted' }, + { label: 'Company Merged', id: 'hubspot_company_merged' }, { label: 'Company Property Changed', id: 'hubspot_company_property_changed' }, + { label: 'Company Restored', id: 'hubspot_company_restored' }, { label: 'Conversation Creation', id: 'hubspot_conversation_creation' }, { label: 'Conversation Deletion', id: 'hubspot_conversation_deletion' }, { label: 'Conversation New Message', id: 'hubspot_conversation_new_message' }, @@ -18,10 +22,15 @@ export const hubspotAllTriggerOptions = [ { label: 'Conversation Property Changed', id: 'hubspot_conversation_property_changed' }, { label: 'Deal Created', id: 'hubspot_deal_created' }, { label: 'Deal Deleted', id: 'hubspot_deal_deleted' }, + { label: 'Deal Merged', id: 'hubspot_deal_merged' }, { label: 'Deal Property Changed', id: 'hubspot_deal_property_changed' }, + { label: 'Deal Restored', id: 'hubspot_deal_restored' }, { label: 'Ticket Created', id: 'hubspot_ticket_created' }, { label: 'Ticket Deleted', id: 'hubspot_ticket_deleted' }, + { label: 'Ticket Merged', id: 'hubspot_ticket_merged' }, { label: 'Ticket Property Changed', id: 'hubspot_ticket_property_changed' }, + { label: 'Ticket Restored', id: 'hubspot_ticket_restored' }, + { label: 'Generic Webhook (All Events)', id: 'hubspot_webhook' }, ] /** @@ -30,8 +39,10 @@ export const hubspotAllTriggerOptions = [ export const hubspotContactTriggerOptions = [ { label: 'Contact Created', id: 'hubspot_contact_created' }, { label: 'Contact Deleted', id: 'hubspot_contact_deleted' }, + { label: 'Contact Merged', id: 'hubspot_contact_merged' }, { label: 'Contact Privacy Deleted', id: 'hubspot_contact_privacy_deleted' }, { label: 'Contact Property Changed', id: 'hubspot_contact_property_changed' }, + { label: 'Contact Restored', id: 'hubspot_contact_restored' }, ] /** @@ -40,7 +51,9 @@ export const hubspotContactTriggerOptions = [ export const hubspotCompanyTriggerOptions = [ { label: 'Company Created', id: 'hubspot_company_created' }, { label: 'Company Deleted', id: 'hubspot_company_deleted' }, + { label: 'Company Merged', id: 'hubspot_company_merged' }, { label: 'Company Property Changed', id: 'hubspot_company_property_changed' }, + { label: 'Company Restored', id: 'hubspot_company_restored' }, ] /** @@ -60,7 +73,9 @@ export const hubspotConversationTriggerOptions = [ export const hubspotDealTriggerOptions = [ { label: 'Deal Created', id: 'hubspot_deal_created' }, { label: 'Deal Deleted', id: 'hubspot_deal_deleted' }, + { label: 'Deal Merged', id: 'hubspot_deal_merged' }, { label: 'Deal Property Changed', id: 'hubspot_deal_property_changed' }, + { label: 'Deal Restored', id: 'hubspot_deal_restored' }, ] /** @@ -69,19 +84,34 @@ export const hubspotDealTriggerOptions = [ export const hubspotTicketTriggerOptions = [ { label: 'Ticket Created', id: 'hubspot_ticket_created' }, { label: 'Ticket Deleted', id: 'hubspot_ticket_deleted' }, + { label: 'Ticket Merged', id: 'hubspot_ticket_merged' }, { label: 'Ticket Property Changed', id: 'hubspot_ticket_property_changed' }, + { label: 'Ticket Restored', id: 'hubspot_ticket_restored' }, ] +/** + * Derives the required OAuth scope from a HubSpot event type + */ +function getScopeForEventType(eventType: string): string { + if (eventType.startsWith('company')) return 'crm.objects.companies.read' + if (eventType.startsWith('deal')) return 'crm.objects.deals.read' + if (eventType.startsWith('ticket')) return 'tickets' + if (eventType === 'All Events') + return 'crm.objects.contacts.read, crm.objects.companies.read, crm.objects.deals.read, tickets' + return 'crm.objects.contacts.read' +} + /** * Generate setup instructions for a specific HubSpot event type */ export function hubspotSetupInstructions(eventType: string, additionalNotes?: string): string { + const scope = getScopeForEventType(eventType) const instructions = [ 'Step 1: Create a HubSpot Developer Account
Sign up for a free developer account at developers.hubspot.com if you don\'t have one.', 'Step 2: Create a Public App via CLI
Note: HubSpot has deprecated the web UI for creating apps. You must use the HubSpot CLI to create and manage apps. Install the CLI with npm install -g @hubspot/cli and run hs project create to create a new app. See HubSpot\'s documentation for details.', 'Step 3: Configure OAuth Settings
After creating your app via CLI, configure it to add the OAuth Redirect URL: https://www.sim.ai/api/auth/oauth2/callback/hubspot. Then retrieve your Client ID and Client Secret from your app configuration and enter them in the fields above.', "Step 4: Get App ID and Developer API Key
In your HubSpot developer account, find your App ID (shown below your app name) and your Developer API Key (in app settings). You'll need both for the next steps.", - 'Step 5: Set Required Scopes
Configure your app to include the required OAuth scope: crm.objects.contacts.read', + `Step 5: Set Required Scopes
Configure your app to include the required OAuth scope(s): ${scope}`, 'Step 6: Configure Webhook in HubSpot via API
After saving above, copy the Webhook URL and run the two curl commands below (replace {YOUR_APP_ID}, {YOUR_DEVELOPER_API_KEY}, and {YOUR_WEBHOOK_URL_FROM_ABOVE} with your actual values).', "Step 7: Test Your Webhook
Create or modify a contact in HubSpot to trigger the webhook. Check your workflow execution logs in Sim to verify it's working.", ] @@ -172,6 +202,76 @@ function buildBaseHubSpotOutputs(): Record { } as any } +/** + * Merge-specific webhook outputs that include mergedObjectIds + */ +function buildMergeHubSpotOutputs(): Record { + return { + payload: { + type: 'array', + description: 'Full webhook payload array from HubSpot containing merge event details', + items: { + type: 'object', + properties: { + objectId: { type: 'number', description: 'HubSpot object ID (winning/primary record)' }, + subscriptionType: { type: 'string', description: 'Type of subscription event' }, + portalId: { type: 'number', description: 'HubSpot portal ID' }, + occurredAt: { type: 'number', description: 'Timestamp when event occurred (ms)' }, + attemptNumber: { type: 'number', description: 'Webhook delivery attempt number' }, + eventId: { type: 'number', description: 'Event ID' }, + changeSource: { type: 'string', description: 'Source of the change' }, + mergedObjectIds: { + type: 'array', + description: 'IDs of the objects that were merged into the primary record', + }, + }, + }, + }, + provider: { + type: 'string', + description: 'Provider name (hubspot)', + }, + providerConfig: { + type: 'object', + description: 'Provider configuration', + properties: { + appId: { + type: 'string', + description: 'HubSpot App ID', + }, + clientId: { + type: 'string', + description: 'HubSpot Client ID', + }, + triggerId: { + type: 'string', + description: 'Trigger ID (e.g., hubspot_contact_merged)', + }, + clientSecret: { + type: 'string', + description: 'HubSpot Client Secret', + }, + developerApiKey: { + type: 'string', + description: 'HubSpot Developer API Key', + }, + curlSetWebhookUrl: { + type: 'string', + description: 'curl command to set webhook URL', + }, + curlCreateSubscription: { + type: 'string', + description: 'curl command to create subscription', + }, + webhookUrlDisplay: { + type: 'string', + description: 'Webhook URL display value', + }, + }, + }, + } as any +} + /** * Build output schema for contact creation events */ @@ -200,6 +300,20 @@ export function buildContactPropertyChangedOutputs(): Record { + return buildMergeHubSpotOutputs() +} + +/** + * Build output schema for contact restore events + */ +export function buildContactRestoredOutputs(): Record { + return buildBaseHubSpotOutputs() +} + /** * Build output schema for company creation events */ @@ -221,6 +335,20 @@ export function buildCompanyPropertyChangedOutputs(): Record { + return buildMergeHubSpotOutputs() +} + +/** + * Build output schema for company restore events + */ +export function buildCompanyRestoredOutputs(): Record { + return buildBaseHubSpotOutputs() +} + /** * Build output schema for conversation creation events */ @@ -277,6 +405,20 @@ export function buildDealPropertyChangedOutputs(): Record return buildBaseHubSpotOutputs() } +/** + * Build output schema for deal merge events + */ +export function buildDealMergedOutputs(): Record { + return buildMergeHubSpotOutputs() +} + +/** + * Build output schema for deal restore events + */ +export function buildDealRestoredOutputs(): Record { + return buildBaseHubSpotOutputs() +} + /** * Build output schema for ticket creation events */ @@ -298,6 +440,27 @@ export function buildTicketPropertyChangedOutputs(): Record { + return buildMergeHubSpotOutputs() +} + +/** + * Build output schema for ticket restore events + */ +export function buildTicketRestoredOutputs(): Record { + return buildBaseHubSpotOutputs() +} + +/** + * Build output schema for generic webhook events + */ +export function buildWebhookOutputs(): Record { + return buildBaseHubSpotOutputs() +} + /** * Check if a HubSpot event matches the expected trigger configuration */ @@ -305,11 +468,15 @@ export function isHubSpotContactEventMatch(triggerId: string, eventType: string) const eventMap: Record = { hubspot_contact_created: 'contact.creation', hubspot_contact_deleted: 'contact.deletion', + hubspot_contact_merged: 'contact.merge', hubspot_contact_privacy_deleted: 'contact.privacyDeletion', hubspot_contact_property_changed: 'contact.propertyChange', + hubspot_contact_restored: 'contact.restore', hubspot_company_created: 'company.creation', hubspot_company_deleted: 'company.deletion', + hubspot_company_merged: 'company.merge', hubspot_company_property_changed: 'company.propertyChange', + hubspot_company_restored: 'company.restore', hubspot_conversation_creation: 'conversation.creation', hubspot_conversation_deletion: 'conversation.deletion', hubspot_conversation_new_message: 'conversation.newMessage', @@ -317,10 +484,14 @@ export function isHubSpotContactEventMatch(triggerId: string, eventType: string) hubspot_conversation_property_changed: 'conversation.propertyChange', hubspot_deal_created: 'deal.creation', hubspot_deal_deleted: 'deal.deletion', + hubspot_deal_merged: 'deal.merge', hubspot_deal_property_changed: 'deal.propertyChange', + hubspot_deal_restored: 'deal.restore', hubspot_ticket_created: 'ticket.creation', hubspot_ticket_deleted: 'ticket.deletion', + hubspot_ticket_merged: 'ticket.merge', hubspot_ticket_property_changed: 'ticket.propertyChange', + hubspot_ticket_restored: 'ticket.restore', } const expectedEventType = eventMap[triggerId] diff --git a/apps/sim/triggers/hubspot/webhook.ts b/apps/sim/triggers/hubspot/webhook.ts new file mode 100644 index 00000000000..addcb92b923 --- /dev/null +++ b/apps/sim/triggers/hubspot/webhook.ts @@ -0,0 +1,223 @@ +import { HubspotIcon } from '@/components/icons' +import { + buildWebhookOutputs, + hubspotAllTriggerOptions, + hubspotSetupInstructions, +} from '@/triggers/hubspot/utils' +import type { TriggerConfig } from '@/triggers/types' + +export const hubspotWebhookTrigger: TriggerConfig = { + id: 'hubspot_webhook', + name: 'HubSpot Webhook (All Events)', + provider: 'hubspot', + description: 'Trigger workflow on any HubSpot webhook event', + version: '1.0.0', + icon: HubspotIcon, + + subBlocks: [ + { + id: 'selectedTriggerId', + title: 'Trigger Type', + type: 'dropdown', + mode: 'trigger', + options: hubspotAllTriggerOptions, + value: () => 'hubspot_webhook', + required: true, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client ID', + description: 'Found in your HubSpot app settings under Auth tab', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'clientSecret', + title: 'Client Secret', + type: 'short-input', + placeholder: 'Enter your HubSpot app Client Secret', + description: 'Found in your HubSpot app settings under Auth tab', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'appId', + title: 'App ID', + type: 'short-input', + placeholder: 'Enter your HubSpot App ID', + description: 'Found in your HubSpot app settings. Used to identify your app.', + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'developerApiKey', + title: 'Developer API Key', + type: 'short-input', + placeholder: 'Enter your HubSpot Developer API Key', + description: 'Used for making API calls to HubSpot. Found in your HubSpot app settings.', + password: true, + required: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'webhookUrlDisplay', + title: 'Webhook URL', + type: 'short-input', + readOnly: true, + showCopyButton: true, + useWebhookUrl: true, + placeholder: 'Webhook URL will be generated', + description: 'Copy this URL and paste it into your HubSpot app webhook subscription settings', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'triggerSave', + title: '', + type: 'trigger-save', + mode: 'trigger', + triggerId: 'hubspot_webhook', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'triggerInstructions', + title: 'Setup Instructions', + type: 'text', + defaultValue: hubspotSetupInstructions( + 'All Events', + 'This generic webhook trigger will accept all HubSpot webhook events. Create subscriptions for each event type you want to receive using the curl command below (changing the eventType parameter).' + ), + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'curlSetWebhookUrl', + title: '1. Set Webhook Target URL', + type: 'code', + language: 'javascript', + value: (params: Record) => { + const webhookUrl = params.webhookUrlDisplay || '{YOUR_WEBHOOK_URL_FROM_ABOVE}' + return `curl -X PUT "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/settings?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "targetUrl": "${webhookUrl}", + "throttling": { + "maxConcurrentRequests": 10 + } + }'` + }, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command to set your webhook URL in HubSpot', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'curlCreateSubscription', + title: '2. Create Webhook Subscription', + type: 'code', + language: 'javascript', + defaultValue: `# Create subscriptions for each event type you want to receive. +# Replace {eventType} with: contact.creation, contact.deletion, contact.propertyChange, +# contact.merge, contact.restore, company.creation, company.deletion, company.propertyChange, +# company.merge, company.restore, deal.creation, deal.deletion, deal.propertyChange, +# deal.merge, deal.restore, ticket.creation, ticket.deletion, ticket.propertyChange, +# ticket.merge, ticket.restore, etc. + +curl -X POST "https://api.hubapi.com/webhooks/v3/{YOUR_APP_ID}/subscriptions?hapikey={YOUR_DEVELOPER_API_KEY}" \\ + -H "Content-Type: application/json" \\ + -d '{ + "eventType": "{eventType}", + "active": true + }'`, + readOnly: true, + collapsible: true, + defaultCollapsed: true, + showCopyButton: true, + description: 'Run this command for each event type you want to subscribe to', + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + { + id: 'samplePayload', + title: 'Event Payload Example', + type: 'code', + language: 'json', + defaultValue: JSON.stringify( + [ + { + eventId: 3181526809, + subscriptionId: 4629970, + portalId: 244315265, + appId: 23608917, + occurredAt: 1762659213730, + subscriptionType: 'contact.creation', + attemptNumber: 0, + objectId: 316126906049, + changeFlag: 'CREATED', + changeSource: 'CRM_UI', + sourceId: 'userId:84916424', + }, + ], + null, + 2 + ), + readOnly: true, + collapsible: true, + defaultCollapsed: true, + mode: 'trigger', + condition: { + field: 'selectedTriggerId', + value: 'hubspot_webhook', + }, + }, + ], + + outputs: buildWebhookOutputs(), + + webhook: { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-HubSpot-Signature': 'sha256=...', + 'X-HubSpot-Request-Id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'User-Agent': 'HubSpot Webhooks', + }, + }, +} diff --git a/apps/sim/triggers/registry.ts b/apps/sim/triggers/registry.ts index 4390bfeefff..c81bd43cf9d 100644 --- a/apps/sim/triggers/registry.ts +++ b/apps/sim/triggers/registry.ts @@ -103,11 +103,15 @@ import { import { hubspotCompanyCreatedTrigger, hubspotCompanyDeletedTrigger, + hubspotCompanyMergedTrigger, hubspotCompanyPropertyChangedTrigger, + hubspotCompanyRestoredTrigger, hubspotContactCreatedTrigger, hubspotContactDeletedTrigger, + hubspotContactMergedTrigger, hubspotContactPrivacyDeletedTrigger, hubspotContactPropertyChangedTrigger, + hubspotContactRestoredTrigger, hubspotConversationCreationTrigger, hubspotConversationDeletionTrigger, hubspotConversationNewMessageTrigger, @@ -115,10 +119,15 @@ import { hubspotConversationPropertyChangedTrigger, hubspotDealCreatedTrigger, hubspotDealDeletedTrigger, + hubspotDealMergedTrigger, hubspotDealPropertyChangedTrigger, + hubspotDealRestoredTrigger, hubspotTicketCreatedTrigger, hubspotTicketDeletedTrigger, + hubspotTicketMergedTrigger, hubspotTicketPropertyChangedTrigger, + hubspotTicketRestoredTrigger, + hubspotWebhookTrigger, } from '@/triggers/hubspot' import { imapPollingTrigger } from '@/triggers/imap' import { @@ -311,11 +320,15 @@ export const TRIGGER_REGISTRY: TriggerRegistry = { webflow_form_submission: webflowFormSubmissionTrigger, hubspot_contact_created: hubspotContactCreatedTrigger, hubspot_contact_deleted: hubspotContactDeletedTrigger, + hubspot_contact_merged: hubspotContactMergedTrigger, hubspot_contact_privacy_deleted: hubspotContactPrivacyDeletedTrigger, hubspot_contact_property_changed: hubspotContactPropertyChangedTrigger, + hubspot_contact_restored: hubspotContactRestoredTrigger, hubspot_company_created: hubspotCompanyCreatedTrigger, hubspot_company_deleted: hubspotCompanyDeletedTrigger, + hubspot_company_merged: hubspotCompanyMergedTrigger, hubspot_company_property_changed: hubspotCompanyPropertyChangedTrigger, + hubspot_company_restored: hubspotCompanyRestoredTrigger, hubspot_conversation_creation: hubspotConversationCreationTrigger, hubspot_conversation_deletion: hubspotConversationDeletionTrigger, hubspot_conversation_new_message: hubspotConversationNewMessageTrigger, @@ -323,9 +336,14 @@ export const TRIGGER_REGISTRY: TriggerRegistry = { hubspot_conversation_property_changed: hubspotConversationPropertyChangedTrigger, hubspot_deal_created: hubspotDealCreatedTrigger, hubspot_deal_deleted: hubspotDealDeletedTrigger, + hubspot_deal_merged: hubspotDealMergedTrigger, hubspot_deal_property_changed: hubspotDealPropertyChangedTrigger, + hubspot_deal_restored: hubspotDealRestoredTrigger, hubspot_ticket_created: hubspotTicketCreatedTrigger, hubspot_ticket_deleted: hubspotTicketDeletedTrigger, + hubspot_ticket_merged: hubspotTicketMergedTrigger, hubspot_ticket_property_changed: hubspotTicketPropertyChangedTrigger, + hubspot_ticket_restored: hubspotTicketRestoredTrigger, + hubspot_webhook: hubspotWebhookTrigger, imap_poller: imapPollingTrigger, }