diff --git a/components/hubspot/actions/add-comment/add-comment.mjs b/components/hubspot/actions/add-comment/add-comment.mjs new file mode 100644 index 0000000000000..3fe273b37d74b --- /dev/null +++ b/components/hubspot/actions/add-comment/add-comment.mjs @@ -0,0 +1,55 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-add-comment", + name: "Add Comment", + description: "Adds a comment to a thread. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-message/post-conversations-v3-conversations-threads-threadId-messages)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + threadId: { + propDefinition: [ + hubspot, + "threadId", + ], + }, + text: { + type: "string", + label: "Text", + description: "The text content of the comment", + }, + fileId: { + propDefinition: [ + hubspot, + "fileId", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.createMessage({ + $, + threadId: this.threadId, + data: { + type: "COMMENT", + text: this.text, + attachments: this.fileId + ? [ + { + fileId: this.fileId, + type: "FILE", + }, + ] + : undefined, + }, + }); + $.export("$summary", `Comment successfully added to thread ${this.threadId}`); + return response; + }, +}; diff --git a/components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs b/components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs index 818355c95c7a9..4e04afee8163b 100644 --- a/components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs +++ b/components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs @@ -5,7 +5,7 @@ export default { name: "Add Contact to List", description: "Adds a contact to a specific static list. [See the documentation](https://legacydocs.hubspot.com/docs/methods/lists/add_contact_to_list)", - version: "0.0.27", + version: "0.0.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs b/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs index f18a022c96b3a..5fd46953a5d1f 100644 --- a/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs +++ b/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs @@ -8,7 +8,7 @@ export default { name: "Batch Create Companies", description: "Create a batch of companies in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fcreate)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs b/components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs index fc8383dfc0004..4074afacbacf3 100644 --- a/components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs +++ b/components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs @@ -5,7 +5,7 @@ export default { name: "Batch Create or Update Contact", description: "Create or update a batch of contacts by its ID or email. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts)", - version: "0.0.24", + version: "0.0.25", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs b/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs index 3c6fed51db95b..d7f0e4b262d18 100644 --- a/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs +++ b/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs @@ -8,7 +8,7 @@ export default { name: "Batch Update Companies", description: "Update a batch of companies in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupdate)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs b/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs index 072fa9e54ef17..fa81e16a279ad 100644 --- a/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs +++ b/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs @@ -7,7 +7,7 @@ export default { key: "hubspot-batch-upsert-companies", name: "Batch Upsert Companies", description: "Upsert a batch of companies in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupsert)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/clone-email/clone-email.mjs b/components/hubspot/actions/clone-email/clone-email.mjs index 53d111d05a832..edf9989083b72 100644 --- a/components/hubspot/actions/clone-email/clone-email.mjs +++ b/components/hubspot/actions/clone-email/clone-email.mjs @@ -6,7 +6,7 @@ export default { name: "Clone Marketing Email", description: "Clone a marketing email in HubSpot. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2Fclone)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/clone-site-page/clone-site-page.mjs b/components/hubspot/actions/clone-site-page/clone-site-page.mjs index 3a24f9b0d915d..59782a166c431 100644 --- a/components/hubspot/actions/clone-site-page/clone-site-page.mjs +++ b/components/hubspot/actions/clone-site-page/clone-site-page.mjs @@ -5,7 +5,7 @@ export default { name: "Clone Site Page", description: "Clone a site page in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages#post-%2Fcms%2Fv3%2Fpages%2Fsite-pages%2Fclone)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-associations/create-associations.mjs b/components/hubspot/actions/create-associations/create-associations.mjs index e79f90c7f7f1d..4611981b61757 100644 --- a/components/hubspot/actions/create-associations/create-associations.mjs +++ b/components/hubspot/actions/create-associations/create-associations.mjs @@ -6,7 +6,7 @@ export default { name: "Create Associations", description: "Create associations between objects. [See the documentation](https://developers.hubspot.com/docs/api/crm/associations#endpoint?spec=POST-/crm/v3/associations/{fromObjectType}/{toObjectType}/batch/create)", - version: "1.0.13", + version: "1.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-communication/create-communication.mjs b/components/hubspot/actions/create-communication/create-communication.mjs index 3027f7b32fe4b..0a7ee2852dd71 100644 --- a/components/hubspot/actions/create-communication/create-communication.mjs +++ b/components/hubspot/actions/create-communication/create-communication.mjs @@ -9,7 +9,7 @@ export default { name: "Create Communication", description: "Create a WhatsApp, LinkedIn, or SMS message. [See the documentation](https://developers.hubspot.com/beta-docs/reference/api/crm/engagements/communications/v3#post-%2Fcrm%2Fv3%2Fobjects%2Fcommunications)", - version: "0.0.20", + version: "0.0.21", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-company/create-company.mjs b/components/hubspot/actions/create-company/create-company.mjs index 4bc38c51843f3..f3264a86b018d 100644 --- a/components/hubspot/actions/create-company/create-company.mjs +++ b/components/hubspot/actions/create-company/create-company.mjs @@ -7,7 +7,7 @@ export default { name: "Create Company", description: "Create a company in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies#endpoint?spec=POST-/crm/v3/objects/companies)", - version: "0.0.32", + version: "0.0.33", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs b/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs index 64494d2933b1c..8ccd1a53ea0de 100644 --- a/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs +++ b/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs @@ -6,7 +6,7 @@ export default { name: "Create Contact Workflow", description: "Create a contact workflow in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/automation/create-manage-workflows#post-%2Fautomation%2Fv4%2Fflows)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-custom-object/create-custom-object.mjs b/components/hubspot/actions/create-custom-object/create-custom-object.mjs index 422588a80e334..d9da8a593efda 100644 --- a/components/hubspot/actions/create-custom-object/create-custom-object.mjs +++ b/components/hubspot/actions/create-custom-object/create-custom-object.mjs @@ -10,7 +10,7 @@ export default { name: "Create Custom Object", description: "Create a new custom object in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/custom-objects#create-a-custom-object)", - version: "1.0.14", + version: "1.0.15", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-deal/create-deal.mjs b/components/hubspot/actions/create-deal/create-deal.mjs index f51df41d28b83..c411bd44cc794 100644 --- a/components/hubspot/actions/create-deal/create-deal.mjs +++ b/components/hubspot/actions/create-deal/create-deal.mjs @@ -7,7 +7,7 @@ export default { name: "Create Deal", description: "Create a deal in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals#endpoint?spec=POST-/crm/v3/objects/deals)", - version: "0.0.32", + version: "0.0.33", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-email/create-email.mjs b/components/hubspot/actions/create-email/create-email.mjs index a5595369e691b..fe495629e4ea5 100644 --- a/components/hubspot/actions/create-email/create-email.mjs +++ b/components/hubspot/actions/create-email/create-email.mjs @@ -10,7 +10,7 @@ export default { name: "Create Marketing Email", description: "Create a marketing email in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-engagement/create-engagement.mjs b/components/hubspot/actions/create-engagement/create-engagement.mjs index d3258d789fd7b..bb39b59605575 100644 --- a/components/hubspot/actions/create-engagement/create-engagement.mjs +++ b/components/hubspot/actions/create-engagement/create-engagement.mjs @@ -11,7 +11,7 @@ export default { name: "Create Engagement", description: "Create a new engagement for a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", - version: "0.0.30", + version: "0.0.31", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-form/create-form.mjs b/components/hubspot/actions/create-form/create-form.mjs index c2c359256904d..db1317f647fa0 100644 --- a/components/hubspot/actions/create-form/create-form.mjs +++ b/components/hubspot/actions/create-form/create-form.mjs @@ -10,7 +10,7 @@ export default { name: "Create Form", description: "Create a form in HubSpot. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-landing-page/create-landing-page.mjs b/components/hubspot/actions/create-landing-page/create-landing-page.mjs index a041c18e2a126..aeeeafb2a9ebe 100644 --- a/components/hubspot/actions/create-landing-page/create-landing-page.mjs +++ b/components/hubspot/actions/create-landing-page/create-landing-page.mjs @@ -7,7 +7,7 @@ export default { name: "Create Landing Page", description: "Create a landing page in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages#post-%2Fcms%2Fv3%2Fpages%2Flanding-pages)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-lead/create-lead.mjs b/components/hubspot/actions/create-lead/create-lead.mjs index 90972d2973fcf..292b6f1bb26dc 100644 --- a/components/hubspot/actions/create-lead/create-lead.mjs +++ b/components/hubspot/actions/create-lead/create-lead.mjs @@ -13,7 +13,7 @@ export default { name: "Create Lead", description: "Create a lead in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/leads#create-leads)", - version: "0.0.20", + version: "0.0.21", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-meeting/create-meeting.mjs b/components/hubspot/actions/create-meeting/create-meeting.mjs index 084ca7a246893..4d5a36f3a7cdf 100644 --- a/components/hubspot/actions/create-meeting/create-meeting.mjs +++ b/components/hubspot/actions/create-meeting/create-meeting.mjs @@ -11,7 +11,7 @@ export default { name: "Create Meeting", description: "Creates a new meeting with optional associations to other objects. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/meetings#post-%2Fcrm%2Fv3%2Fobjects%2Fmeetings)", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-note/create-note.mjs b/components/hubspot/actions/create-note/create-note.mjs index c48e3374f708c..5516fc7c0d40e 100644 --- a/components/hubspot/actions/create-note/create-note.mjs +++ b/components/hubspot/actions/create-note/create-note.mjs @@ -8,7 +8,7 @@ export default { name: "Create Note", description: "Create a new note. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", - version: "0.0.11", + version: "0.0.12", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs b/components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs index cb116f05abdaf..70f26f032d1bf 100644 --- a/components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs +++ b/components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs @@ -7,7 +7,7 @@ export default { name: "Create or Update Contact", description: "Create or update a contact in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts#endpoint?spec=POST-/crm/v3/objects/contacts)", - version: "0.0.30", + version: "0.0.31", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/create-page/create-page.mjs b/components/hubspot/actions/create-page/create-page.mjs index 7742e32f32838..57d16a011de72 100644 --- a/components/hubspot/actions/create-page/create-page.mjs +++ b/components/hubspot/actions/create-page/create-page.mjs @@ -7,7 +7,7 @@ export default { name: "Create Page", description: "Create a page in HubSpot. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages#post-%2Fcms%2Fv3%2Fpages%2Fsite-pages)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-task/create-task.mjs b/components/hubspot/actions/create-task/create-task.mjs index 669fbeb3468d9..e2b89d99a9ec4 100644 --- a/components/hubspot/actions/create-task/create-task.mjs +++ b/components/hubspot/actions/create-task/create-task.mjs @@ -8,7 +8,7 @@ export default { name: "Create Task", description: "Create a new task. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-ticket/create-ticket.mjs b/components/hubspot/actions/create-ticket/create-ticket.mjs index 1b0ccfc94854f..75320c5cccecd 100644 --- a/components/hubspot/actions/create-ticket/create-ticket.mjs +++ b/components/hubspot/actions/create-ticket/create-ticket.mjs @@ -7,7 +7,7 @@ export default { name: "Create Ticket", description: "Create a ticket in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)", - version: "0.0.23", + version: "0.0.24", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/create-workflow/create-workflow.mjs b/components/hubspot/actions/create-workflow/create-workflow.mjs index 982e0005ea34e..4fe1a82f8199d 100644 --- a/components/hubspot/actions/create-workflow/create-workflow.mjs +++ b/components/hubspot/actions/create-workflow/create-workflow.mjs @@ -5,7 +5,7 @@ export default { key: "hubspot-create-workflow", name: "Create a New Workflow", description: "Create a new workflow. [See the documentation](https://developers.hubspot.com/docs/api-reference/legacy/create-manage-workflows-v3/post-automation-v3-workflows)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/delete-workflow/delete-workflow.mjs b/components/hubspot/actions/delete-workflow/delete-workflow.mjs index af04d22f3ceea..a30dc39a09aad 100644 --- a/components/hubspot/actions/delete-workflow/delete-workflow.mjs +++ b/components/hubspot/actions/delete-workflow/delete-workflow.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-delete-workflow", name: "Delete a Workflow", description: "Delete a workflow by ID. [See the documentation](https://developers.hubspot.com/docs/api-reference/legacy/create-manage-workflows-v3/delete-automation-v3-workflows-workflowId)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs b/components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs index 54f9cac0aef4d..e7667321b10fd 100644 --- a/components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs +++ b/components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs @@ -5,7 +5,7 @@ export default { name: "Enroll Contact Into Workflow", description: "Add a contact to a workflow. Note: The Workflows API currently only supports contact-based workflows and is only available for Marketing Hub Enterprise accounts. [See the documentation](https://legacydocs.hubspot.com/docs/methods/workflows/add_contact)", - version: "0.0.27", + version: "0.0.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs b/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs index c1722d3525cf3..483e4dd8f8b27 100644 --- a/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs +++ b/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs @@ -6,7 +6,7 @@ export default { name: "Get Associated Emails", description: "Retrieves emails associated with a specific object (contact, company, or deal). [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/search)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs b/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs index 5c59b90153e22..78bed38ff5269 100644 --- a/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs +++ b/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs @@ -7,7 +7,7 @@ export default { name: "Get Associated Meetings", description: "Retrieves meetings associated with a specific object (contact, company, or deal) with optional time filtering. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/associations/association-details#get-%2Fcrm%2Fv4%2Fobjects%2F%7Bobjecttype%7D%2F%7Bobjectid%7D%2Fassociations%2F%7Btoobjecttype%7D)", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-channel/get-channel.mjs b/components/hubspot/actions/get-channel/get-channel.mjs new file mode 100644 index 0000000000000..b77f4e7cf8da1 --- /dev/null +++ b/components/hubspot/actions/get-channel/get-channel.mjs @@ -0,0 +1,31 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-get-channel", + name: "Get Channel", + description: "Retrieves a single channel by its ID. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-channel/get-conversations-v3-conversations-channels-channelId)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + channelId: { + propDefinition: [ + hubspot, + "channelId", + ], + }, + }, + async run({ $ }) { + const response = await this.hubspot.getChannel({ + $, + channelId: this.channelId, + }); + $.export("$summary", `Successfully retrieved channel with ID ${this.channelId}`); + return response; + }, +}; diff --git a/components/hubspot/actions/get-company/get-company.mjs b/components/hubspot/actions/get-company/get-company.mjs index 832927d30aa22..d469d3c8867aa 100644 --- a/components/hubspot/actions/get-company/get-company.mjs +++ b/components/hubspot/actions/get-company/get-company.mjs @@ -7,7 +7,7 @@ export default { name: "Get Company", description: "Gets a company. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies#endpoint?spec=GET-/crm/v3/objects/companies/{companyId})", - version: "0.0.27", + version: "0.0.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-contact/get-contact.mjs b/components/hubspot/actions/get-contact/get-contact.mjs index 73a36d35f8a34..09d3b59f37a97 100644 --- a/components/hubspot/actions/get-contact/get-contact.mjs +++ b/components/hubspot/actions/get-contact/get-contact.mjs @@ -7,7 +7,7 @@ export default { name: "Get Contact", description: "Gets a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts#endpoint?spec=GET-/crm/v3/objects/contacts/{contactId})", - version: "0.0.27", + version: "0.0.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-deal/get-deal.mjs b/components/hubspot/actions/get-deal/get-deal.mjs index 7dc79bc7e1c78..c04e77ff1f8d8 100644 --- a/components/hubspot/actions/get-deal/get-deal.mjs +++ b/components/hubspot/actions/get-deal/get-deal.mjs @@ -7,7 +7,7 @@ export default { name: "Get Deal", description: "Gets a deal. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals#endpoint?spec=GET-/crm/v3/objects/deals/{dealId})", - version: "0.0.27", + version: "0.0.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-file-public-url/get-file-public-url.mjs b/components/hubspot/actions/get-file-public-url/get-file-public-url.mjs index 7e6a0ad9e4917..d715136da300b 100644 --- a/components/hubspot/actions/get-file-public-url/get-file-public-url.mjs +++ b/components/hubspot/actions/get-file-public-url/get-file-public-url.mjs @@ -5,7 +5,7 @@ export default { name: "Get File Public URL", description: "Get a publicly available URL for a file that was uploaded using a Hubspot form. [See the documentation](https://developers.hubspot.com/docs/api/files/files#endpoint?spec=GET-/files/v3/files/{fileId}/signed-url)", - version: "0.0.27", + version: "0.0.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-inbox/get-inbox.mjs b/components/hubspot/actions/get-inbox/get-inbox.mjs new file mode 100644 index 0000000000000..6397ea1717850 --- /dev/null +++ b/components/hubspot/actions/get-inbox/get-inbox.mjs @@ -0,0 +1,31 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-get-inbox", + name: "Get Inbox", + description: "Retrieves a single inbox by its ID. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-inbox/get-conversations-v3-conversations-inboxes-inboxId)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + inboxId: { + propDefinition: [ + hubspot, + "inboxId", + ], + }, + }, + async run({ $ }) { + const response = await this.hubspot.getInbox({ + $, + inboxId: this.inboxId, + }); + $.export("$summary", `Successfully retrieved inbox with ID ${this.inboxId}`); + return response; + }, +}; diff --git a/components/hubspot/actions/get-meeting/get-meeting.mjs b/components/hubspot/actions/get-meeting/get-meeting.mjs index 4a6e52db2ffd0..7905fc6841d02 100644 --- a/components/hubspot/actions/get-meeting/get-meeting.mjs +++ b/components/hubspot/actions/get-meeting/get-meeting.mjs @@ -7,7 +7,7 @@ export default { name: "Get Meeting", description: "Retrieves a specific meeting by its ID. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/meetings#get-%2Fcrm%2Fv3%2Fobjects%2Fmeetings%2F%7Bmeetingid%7D)", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs b/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs index a99da379cff76..2d5c8941b3621 100644 --- a/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs +++ b/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs @@ -5,7 +5,7 @@ export default { name: "Get Subscription Preferences", description: "Retrieves the subscription preferences for a contact. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/subscriptions#get-%2Fcommunication-preferences%2Fv4%2Fstatuses%2F%7Bsubscriberidstring%7D)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs b/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs index 6e3de6ea046da..f3ce2167b61bd 100644 --- a/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs +++ b/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-blog-posts", name: "List Blog Posts", description: "Retrieves a list of blog posts. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/blogs/blog-posts)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-campaigns/list-campaigns.mjs b/components/hubspot/actions/list-campaigns/list-campaigns.mjs index c6b24871a476f..c7d82650f890d 100644 --- a/components/hubspot/actions/list-campaigns/list-campaigns.mjs +++ b/components/hubspot/actions/list-campaigns/list-campaigns.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-campaigns", name: "List Campaigns", description: "Retrieves a list of campaigns. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/campaigns#get-%2Fmarketing%2Fv3%2Fcampaigns%2F)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-channels/list-channels.mjs b/components/hubspot/actions/list-channels/list-channels.mjs new file mode 100644 index 0000000000000..a8200ef3eebc1 --- /dev/null +++ b/components/hubspot/actions/list-channels/list-channels.mjs @@ -0,0 +1,42 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-list-channels", + name: "List Channels", + description: "Retrieves a list of channels. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-channel/get-conversations-v3-conversations-channels)", + version: "0.0.{{ts}}", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + after: { + type: "string", + label: "After", + description: "The paging cursor token of the last successfully read resource will be returned as the paging.next.after JSON property of a paged response containing more results.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "The maximum number of results to display per page", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.listChannels({ + $, + params: { + after: this.after, + limit: this.limit, + }, + }); + $.export("$summary", `Found ${response?.results?.length} channel${response?.results?.length === 1 + ? "" + : "s"}`); + return response; + }, +}; diff --git a/components/hubspot/actions/list-forms/list-forms.mjs b/components/hubspot/actions/list-forms/list-forms.mjs index 15e3299be7027..a3f87a959974e 100644 --- a/components/hubspot/actions/list-forms/list-forms.mjs +++ b/components/hubspot/actions/list-forms/list-forms.mjs @@ -5,7 +5,7 @@ export default { name: "List Forms", description: "Retrieves a list of forms. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#get-%2Fmarketing%2Fv3%2Fforms%2F)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-inboxes/list-inboxes.mjs b/components/hubspot/actions/list-inboxes/list-inboxes.mjs new file mode 100644 index 0000000000000..0fee9b93e4753 --- /dev/null +++ b/components/hubspot/actions/list-inboxes/list-inboxes.mjs @@ -0,0 +1,49 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-list-inboxes", + name: "List Inboxes", + description: "Retrieves a list of inboxes. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-inbox/get-conversations-v3-conversations-inboxes)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + after: { + type: "string", + label: "After", + description: "The paging cursor token of the last successfully read resource will be returned as the paging.next.after JSON property of a paged response containing more results.", + optional: true, + }, + archived: { + type: "boolean", + label: "Archived", + description: "Whether to include archived inboxes in the response", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "The maximum number of results to display per page", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.listInboxes({ + $, + params: { + after: this.after, + archived: this.archived, + limit: this.limit, + }, + }); + $.export("$summary", `Found ${response?.results?.length} inbox${response?.results?.length === 1 + ? "" + : "s"}`); + return response; + }, +}; diff --git a/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs b/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs index eb769f2b90a8b..a97289481c0cb 100644 --- a/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs +++ b/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-marketing-emails", name: "List Marketing Emails", description: "Retrieves a list of marketing emails. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#get-%2Fmarketing%2Fv3%2Femails%2F)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs b/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs index 4794fa5eb597b..37325ae5c15c7 100644 --- a/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs +++ b/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-marketing-events", name: "List Marketing Events", description: "Retrieves a list of marketing events. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/marketing-events#get-%2Fmarketing%2Fv3%2Fmarketing-events%2F)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-messages/list-messages.mjs b/components/hubspot/actions/list-messages/list-messages.mjs new file mode 100644 index 0000000000000..edd1ab6e6b49f --- /dev/null +++ b/components/hubspot/actions/list-messages/list-messages.mjs @@ -0,0 +1,67 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-list-messages", + name: "List Messages", + description: "Retrieves a list of messages in a thread. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-message/get-conversations-v3-conversations-threads-threadId-messages)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + threadId: { + propDefinition: [ + hubspot, + "threadId", + ], + }, + archived: { + type: "boolean", + label: "Archived", + description: "Whether to return only results that have been archived", + optional: true, + }, + after: { + type: "string", + label: "After", + description: "The paging cursor token of the last successfully read resource will be returned as the paging.next.after JSON property of a paged response containing more results.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "The maximum number of results to display per page", + optional: true, + }, + sort: { + type: "string", + label: "Sort", + description: "The sort direction", + options: [ + "createdAt", + "-createdAt", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.listMessages({ + $, + threadId: this.threadId, + params: { + archived: this.archived, + after: this.after, + limit: this.limit, + sort: this.sort, + }, + }); + $.export("$summary", `Found ${response?.results?.length} message${response?.results?.length === 1 + ? "" + : "s"}`); + return response; + }, +}; diff --git a/components/hubspot/actions/list-pages/list-pages.mjs b/components/hubspot/actions/list-pages/list-pages.mjs index e15649ad518ab..116f7cc404089 100644 --- a/components/hubspot/actions/list-pages/list-pages.mjs +++ b/components/hubspot/actions/list-pages/list-pages.mjs @@ -5,7 +5,7 @@ export default { name: "List Pages", description: "Retrieves a list of site pages. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-templates/list-templates.mjs b/components/hubspot/actions/list-templates/list-templates.mjs index d4d0ca3f01325..dd88d0ab8e45f 100644 --- a/components/hubspot/actions/list-templates/list-templates.mjs +++ b/components/hubspot/actions/list-templates/list-templates.mjs @@ -5,7 +5,7 @@ export default { name: "List Templates", description: "Retrieves a list of templates. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/templates)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/list-threads/list-threads.mjs b/components/hubspot/actions/list-threads/list-threads.mjs new file mode 100644 index 0000000000000..7be4d937da54b --- /dev/null +++ b/components/hubspot/actions/list-threads/list-threads.mjs @@ -0,0 +1,89 @@ +import hubspot from "../../hubspot.app.mjs"; +import { OBJECT_TYPE } from "../../common/constants.mjs"; + +export default { + key: "hubspot-list-threads", + name: "List Threads", + description: "Retrieves a list of threads. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-thread/get-conversations-v3-conversations-threads)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + associatedContactId: { + propDefinition: [ + hubspot, + "objectId", + () => ({ + objectType: OBJECT_TYPE.CONTACT, + }), + ], + label: "Associated Contact ID", + description: "The ID of the contact to filter threads by", + optional: true, + }, + association: { + type: "string", + label: "Association", + description: "You can specify an association type here of TICKET. If this is set the response will included a thread associations object and associated ticket id if present. If there are no associations to a ticket with this conversation, then the thread associations object will not be present on the response.", + options: [ + "TICKET", + ], + optional: true, + }, + archived: { + type: "boolean", + label: "Archived", + description: "Whether to return only results that have been archived", + optional: true, + }, + inboxId: { + propDefinition: [ + hubspot, + "inboxId", + ], + description: "The ID of the conversations inbox you can optionally include to retrieve the associated messages for. This parameter cannot be used in conjunction with the associatedContactId property.", + optional: true, + }, + property: { + type: "string", + label: "Property", + description: "A specific property to include in the thread response", + optional: true, + }, + after: { + type: "string", + label: "After", + description: "The paging cursor token of the last successfully read resource will be returned as the paging.next.after JSON property of a paged response containing more results.", + optional: true, + }, + limit: { + type: "integer", + label: "Limit", + description: "The maximum number of results to display per page", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.listThreads({ + $, + params: { + associatedContactId: this.associatedContactId, + association: this.association, + archived: this.archived, + inboxId: this.inboxId, + property: this.property, + after: this.after, + limit: this.limit, + }, + }); + $.export("$summary", `Found ${response?.results?.length} thread${response?.results?.length === 1 + ? "" + : "s"}`); + return response; + }, +}; diff --git a/components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs b/components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs index 814f4f39f2b87..424018f5bd149 100644 --- a/components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs +++ b/components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs @@ -5,7 +5,7 @@ export default { key: "hubspot-retrieve-migrated-workflow-mappings", name: "Retrieve Migrated Workflow Mappings", description: "Retrieve the IDs of v3 workflows that have been migrated to the v4 API. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflow-id-mappings/post-automation-v4-workflow-id-mappings-batch-read)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs b/components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs index 6cd550747f0c5..80cc03aab16d0 100644 --- a/components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs +++ b/components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-retrieve-workflow-details", name: "Retrieve Workflow Details", description: "Retrieve detailed information about a specific workflow. [See the documentation](https://developers.hubspot.com/docs/api-reference/legacy/create-manage-workflows-v3/get-automation-v3-workflows-workflowId)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs b/components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs index 2feb8c012512c..c244d123deca7 100644 --- a/components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs +++ b/components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-retrieve-workflow-emails", name: "Retrieve Workflow Emails", description: "Retrieve emails sent by a workflow by ID. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/email-campaigns/get-automation-v4-flows-email-campaigns)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs b/components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs index 016f69ffabaf9..9752c5b4c4937 100644 --- a/components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs +++ b/components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-retrieve-workflows", name: "Retrieve Workflows", description: "Retrieve a list of all workflows. [See the documentation](https://developers.hubspot.com/docs/api-reference/legacy/create-manage-workflows-v3/get-automation-v3-workflows)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/search-crm/search-crm.mjs b/components/hubspot/actions/search-crm/search-crm.mjs index 8b9fabc065ebc..8a4260723a820 100644 --- a/components/hubspot/actions/search-crm/search-crm.mjs +++ b/components/hubspot/actions/search-crm/search-crm.mjs @@ -18,7 +18,7 @@ export default { name: "Search CRM", description: "Search companies, contacts, deals, feedback submissions, products, tickets, line-items, quotes, leads, or custom objects. [See the documentation](https://developers.hubspot.com/docs/api/crm/search)", - version: "1.1.2", + version: "1.1.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hubspot/actions/send-message/send-message.mjs b/components/hubspot/actions/send-message/send-message.mjs new file mode 100644 index 0000000000000..fcef49607dd64 --- /dev/null +++ b/components/hubspot/actions/send-message/send-message.mjs @@ -0,0 +1,88 @@ +import hubspot from "../../hubspot.app.mjs"; + +export default { + key: "hubspot-send-message", + name: "Send Message", + description: "Sends a message to a thread. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-message/post-conversations-v3-conversations-threads-threadId-messages)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + hubspot, + threadId: { + propDefinition: [ + hubspot, + "threadId", + ], + }, + text: { + type: "string", + label: "Text", + description: "The text content of the message", + }, + recipientEmails: { + type: "string[]", + label: "Recipient Emails", + description: "The email addresses of the recipients", + }, + channelId: { + propDefinition: [ + hubspot, + "channelId", + ], + }, + channelAccountId: { + propDefinition: [ + hubspot, + "channelAccountId", + ], + }, + fileId: { + propDefinition: [ + hubspot, + "fileId", + ], + optional: true, + }, + subject: { + type: "string", + label: "Subject", + description: "The subject of the message", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.createMessage({ + $, + threadId: this.threadId, + data: { + type: "MESSAGE", + text: this.text, + recipients: { + deliveryIdentifiers: this.recipientEmails.map((email) => ({ + type: "HS_EMAIL_ADDRESS", + value: email, + })), + }, + senderActorId: "S-hubspot", + channelId: this.channelId, + channelAccountId: this.channelAccountId, + subject: this.subject, + attachments: this.fileId + ? [ + { + fileId: this.fileId, + type: "FILE", + }, + ] + : undefined, + }, + }); + $.export("$summary", `Message successfully sent to thread ${this.threadId}`); + return response; + }, +}; diff --git a/components/hubspot/actions/update-company/update-company.mjs b/components/hubspot/actions/update-company/update-company.mjs index 100ee4badd1b8..3a67f6f70e760 100644 --- a/components/hubspot/actions/update-company/update-company.mjs +++ b/components/hubspot/actions/update-company/update-company.mjs @@ -8,7 +8,7 @@ export default { name: "Update Company", description: "Update a company in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)", - version: "0.0.28", + version: "0.0.29", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-contact/update-contact.mjs b/components/hubspot/actions/update-contact/update-contact.mjs index e2a3bd8cb5f78..51d5d6f4f7647 100644 --- a/components/hubspot/actions/update-contact/update-contact.mjs +++ b/components/hubspot/actions/update-contact/update-contact.mjs @@ -8,7 +8,7 @@ export default { name: "Update Contact", description: "Update a contact in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts#endpoint?spec=POST-/crm/v3/objects/contacts)", - version: "0.0.29", + version: "0.0.30", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-custom-object/update-custom-object.mjs b/components/hubspot/actions/update-custom-object/update-custom-object.mjs index 8b66d7ccd38ed..89b0eff7be5f0 100644 --- a/components/hubspot/actions/update-custom-object/update-custom-object.mjs +++ b/components/hubspot/actions/update-custom-object/update-custom-object.mjs @@ -7,7 +7,7 @@ export default { name: "Update Custom Object", description: "Update a custom object in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/custom-objects#update-existing-custom-objects)", - version: "1.0.14", + version: "1.0.15", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-deal/update-deal.mjs b/components/hubspot/actions/update-deal/update-deal.mjs index 296137720e51d..0b99b7652f7f2 100644 --- a/components/hubspot/actions/update-deal/update-deal.mjs +++ b/components/hubspot/actions/update-deal/update-deal.mjs @@ -8,7 +8,7 @@ export default { name: "Update Deal", description: "Update a deal in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/deals#update-deals)", - version: "0.0.19", + version: "0.0.20", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs b/components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs index 7a0aed170ddfa..375eb34ee52e0 100644 --- a/components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs +++ b/components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs @@ -10,7 +10,7 @@ export default { name: "Update Fields on the Form", description: "Update some of the form definition components. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#patch-%2Fmarketing%2Fv3%2Fforms%2F%7Bformid%7D)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-landing-page/update-landing-page.mjs b/components/hubspot/actions/update-landing-page/update-landing-page.mjs index 1df16a69d1f54..710d57058074d 100644 --- a/components/hubspot/actions/update-landing-page/update-landing-page.mjs +++ b/components/hubspot/actions/update-landing-page/update-landing-page.mjs @@ -7,7 +7,7 @@ export default { name: "Update Landing Page", description: "Update a landing page in HubSpot. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages#patch-%2Fcms%2Fv3%2Fpages%2Flanding-pages%2F%7Bobjectid%7D)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-lead/update-lead.mjs b/components/hubspot/actions/update-lead/update-lead.mjs index 9c99eb915102d..e6df837bbd622 100644 --- a/components/hubspot/actions/update-lead/update-lead.mjs +++ b/components/hubspot/actions/update-lead/update-lead.mjs @@ -8,7 +8,7 @@ export default { name: "Update Lead", description: "Update a lead in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/leads#update-leads)", - version: "0.0.20", + version: "0.0.21", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/actions/update-page/update-page.mjs b/components/hubspot/actions/update-page/update-page.mjs index c99231bb0c809..bd991c5d5dd9e 100644 --- a/components/hubspot/actions/update-page/update-page.mjs +++ b/components/hubspot/actions/update-page/update-page.mjs @@ -7,7 +7,7 @@ export default { name: "Update Page", description: "Update a page in Hubspot. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages#patch-%2Fcms%2Fv3%2Fpages%2Fsite-pages%2F%7Bobjectid%7D)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/hubspot/common/constants.mjs b/components/hubspot/common/constants.mjs index bd9701078a1e8..f9700e9aac5f5 100644 --- a/components/hubspot/common/constants.mjs +++ b/components/hubspot/common/constants.mjs @@ -27,6 +27,7 @@ const API_PATH = { MARKETINGV3: "/marketing/v3", CONTENT: "/content/api/v2", COMMUNICATION_PREFERENCES: "/communication-preferences/v4", + CONVERSATIONS: "/conversations/v3", }; /** Association categories for association types, as defined by the [Hubspot API diff --git a/components/hubspot/hubspot.app.mjs b/components/hubspot/hubspot.app.mjs index e3c5bd1d90a62..5be0897e7df0d 100644 --- a/components/hubspot/hubspot.app.mjs +++ b/components/hubspot/hubspot.app.mjs @@ -378,6 +378,18 @@ export default { })); }, }, + fileId: { + type: "string", + label: "File ID", + description: "The ID of a file uploaded to HubSpot", + async options() { + const { results: files } = await this.searchFiles(); + return files.map((file) => ({ + label: file.name, + value: file.id, + })); + }, + }, associationType: { type: "integer", label: "Association Type", @@ -695,6 +707,108 @@ export default { }; }, }, + inboxId: { + type: "string", + label: "Inbox ID", + description: "The ID of an inbox", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listInboxes({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + channelId: { + type: "string", + label: "Channel ID", + description: "The ID of a channel", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listChannels({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + threadId: { + type: "string", + label: "Thread ID", + description: "The ID of a thread", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listThreads({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ id }) => ({ + value: id, + label: `Thread ${id}`, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + channelAccountId: { + type: "string", + label: "Channel Account ID", + description: "The ID of a channel account", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listChannelAccounts({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ + id, name, + }) => ({ + value: id, + label: name, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, type: { type: "string", label: "Type", @@ -1671,5 +1785,70 @@ export default { ...opts, }); }, + getInbox({ + inboxId, ...opts + }) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: `/conversations/inboxes/${inboxId}`, + ...opts, + }); + }, + getChannel({ + channelId, ...opts + }) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: `/conversations/channels/${channelId}`, + ...opts, + }); + }, + listInboxes(opts = {}) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: "/conversations/inboxes", + ...opts, + }); + }, + listChannels(opts = {}) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: "/conversations/channels", + ...opts, + }); + }, + listThreads(opts = {}) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: "/conversations/threads", + ...opts, + }); + }, + listMessages({ + threadId, ...opts + }) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: `/conversations/threads/${threadId}/messages`, + ...opts, + }); + }, + listChannelAccounts(opts = {}) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: "/conversations/channel-accounts", + ...opts, + }); + }, + createMessage({ + threadId, ...opts + }) { + return this.makeRequest({ + api: API_PATH.CONVERSATIONS, + endpoint: `/conversations/threads/${threadId}/messages`, + method: "POST", + ...opts, + }); + }, }, }; diff --git a/components/hubspot/package.json b/components/hubspot/package.json index d00f749363bde..66a334c0945db 100644 --- a/components/hubspot/package.json +++ b/components/hubspot/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hubspot", - "version": "1.7.15", + "version": "1.8.0", "description": "Pipedream Hubspot Components", "main": "hubspot.app.mjs", "keywords": [ diff --git a/components/hubspot/sources/delete-blog-article/delete-blog-article.mjs b/components/hubspot/sources/delete-blog-article/delete-blog-article.mjs index 8c575f976f2ab..67da7ce9e9f29 100644 --- a/components/hubspot/sources/delete-blog-article/delete-blog-article.mjs +++ b/components/hubspot/sources/delete-blog-article/delete-blog-article.mjs @@ -6,7 +6,7 @@ export default { key: "hubspot-delete-blog-article", name: "Deleted Blog Posts", description: "Emit new event for each deleted blog post.", - version: "0.0.36", + version: "0.0.37", dedupe: "unique", type: "source", methods: { diff --git a/components/hubspot/sources/new-company-property-change/new-company-property-change.mjs b/components/hubspot/sources/new-company-property-change/new-company-property-change.mjs index 281c8c4bbe73c..312b94bdcdaf7 100644 --- a/components/hubspot/sources/new-company-property-change/new-company-property-change.mjs +++ b/components/hubspot/sources/new-company-property-change/new-company-property-change.mjs @@ -7,7 +7,7 @@ export default { key: "hubspot-new-company-property-change", name: "New Company Property Change", description: "Emit new event when a specified property is provided or updated on a company. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)", - version: "0.0.29", + version: "0.0.30", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs b/components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs index 30c8911aa0465..996fbc6084f6b 100644 --- a/components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs +++ b/components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs @@ -12,7 +12,7 @@ export default { name: "New Contact Added to List", description: "Emit new event when a contact is added to a HubSpot list. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/lists#get-%2Fcrm%2Fv3%2Flists%2F%7Blistid%7D%2Fmemberships%2Fjoin-order)", - version: "0.0.8", + version: "0.0.9", type: "source", dedupe: "unique", props: { diff --git a/components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs b/components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs index ac208c0787a11..8de6230929977 100644 --- a/components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs +++ b/components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs @@ -8,7 +8,7 @@ export default { name: "New Contact Property Change", description: "Emit new event when a specified property is provided or updated on a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts)", - version: "0.0.32", + version: "0.0.33", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs b/components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs index 531d20fc94fee..1e61136457d92 100644 --- a/components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs +++ b/components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs @@ -7,7 +7,7 @@ export default { name: "New Custom Object Property Change", description: "Emit new event when a specified property is provided or updated on a custom object.", - version: "0.0.21", + version: "0.0.22", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs b/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs index b277ba598cfb0..71535055f0a2f 100644 --- a/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs +++ b/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs @@ -13,7 +13,7 @@ export default { key: "hubspot-new-deal-in-stage", name: "New Deal In Stage", description: "Emit new event for each new deal in a stage.", - version: "0.1.2", + version: "0.1.3", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs b/components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs index 39c40c0926b9c..6c64444b8029c 100644 --- a/components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs +++ b/components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs @@ -7,7 +7,7 @@ export default { key: "hubspot-new-deal-property-change", name: "New Deal Property Change", description: "Emit new event when a specified property is provided or updated on a deal. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals)", - version: "0.0.31", + version: "0.0.32", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-email-event/new-email-event.mjs b/components/hubspot/sources/new-email-event/new-email-event.mjs index 855990de57c05..639fd7bc5c2dc 100644 --- a/components/hubspot/sources/new-email-event/new-email-event.mjs +++ b/components/hubspot/sources/new-email-event/new-email-event.mjs @@ -8,7 +8,7 @@ export default { key: "hubspot-new-email-event", name: "New Email Event", description: "Emit new event for each new Hubspot email event.", - version: "0.0.39", + version: "0.0.40", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs b/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs index 9c0e0c4aa8f9c..e700e2c1a1991 100644 --- a/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs +++ b/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs @@ -6,7 +6,7 @@ export default { key: "hubspot-new-email-subscriptions-timeline", name: "New Email Subscriptions Timeline", description: "Emit new event when a new email timeline subscription is added for the portal.", - version: "0.0.36", + version: "0.0.37", dedupe: "unique", type: "source", methods: { diff --git a/components/hubspot/sources/new-engagement/new-engagement.mjs b/components/hubspot/sources/new-engagement/new-engagement.mjs index 001caf253e94b..90ffb98ce7214 100644 --- a/components/hubspot/sources/new-engagement/new-engagement.mjs +++ b/components/hubspot/sources/new-engagement/new-engagement.mjs @@ -8,7 +8,7 @@ export default { key: "hubspot-new-engagement", name: "New Engagement", description: "Emit new event for each new engagement created. This action returns a maximum of 5000 records at a time, make sure you set a correct time range so you don't miss any events", - version: "0.0.41", + version: "0.0.42", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-event/new-event.mjs b/components/hubspot/sources/new-event/new-event.mjs index b0021af97a4a3..dda7e5cae64ac 100644 --- a/components/hubspot/sources/new-event/new-event.mjs +++ b/components/hubspot/sources/new-event/new-event.mjs @@ -8,7 +8,7 @@ export default { key: "hubspot-new-event", name: "New Events", description: "Emit new event for each new Hubspot event. Note: Only available for Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise accounts", - version: "0.0.40", + version: "0.0.41", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-form-submission/new-form-submission.mjs b/components/hubspot/sources/new-form-submission/new-form-submission.mjs index eafad65ef5487..df8f9731f1d3b 100644 --- a/components/hubspot/sources/new-form-submission/new-form-submission.mjs +++ b/components/hubspot/sources/new-form-submission/new-form-submission.mjs @@ -6,7 +6,7 @@ export default { key: "hubspot-new-form-submission", name: "New Form Submission", description: "Emit new event for each new submission of a form.", - version: "0.0.41", + version: "0.0.42", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-message-in-thread/new-message-in-thread.mjs b/components/hubspot/sources/new-message-in-thread/new-message-in-thread.mjs new file mode 100644 index 0000000000000..72bb0fe01ed6a --- /dev/null +++ b/components/hubspot/sources/new-message-in-thread/new-message-in-thread.mjs @@ -0,0 +1,60 @@ +import common from "../common/common.mjs"; + +export default { + ...common, + key: "hubspot-new-message-in-thread", + name: "New Message in Thread", + description: "Emit new event when a new message is added to a thread. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-message/get-conversations-v3-conversations-threads-threadId-messages)", + version: "0.0.1", + type: "source", + dedupe: "unique", + props: { + ...common.props, + threadId: { + propDefinition: [ + common.props.hubspot, + "threadId", + ], + }, + }, + methods: { + ...common.methods, + async processEvent(max) { + const after = this._getAfter(); + let { + paging, results, + } = await this.hubspot.listMessages({ + threadId: this.threadId, + params: { + after, + sort: "-createdAt", + }, + }); + if (!results?.length) { + return; + } + this._setAfter(paging?.next?.after); + if (max && results.length > max) { + results.length = max; + } + for (const message of results) { + this.emitEvent(message); + } + }, + generateMeta(message) { + return { + id: message.id, + summary: `New Message: ${message.id}`, + ts: Date.parse(message.createdAt), + }; + }, + }, + hooks: { + async deploy() { + await this.processEvent(25); + }, + }, + async run() { + await this.processEvent(); + }, +}; diff --git a/components/hubspot/sources/new-note/new-note.mjs b/components/hubspot/sources/new-note/new-note.mjs index a914121355cd0..d8b0e743f4844 100644 --- a/components/hubspot/sources/new-note/new-note.mjs +++ b/components/hubspot/sources/new-note/new-note.mjs @@ -8,7 +8,7 @@ export default { key: "hubspot-new-note", name: "New Note Created", description: "Emit new event for each new note created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/notes#get-%2Fcrm%2Fv3%2Fobjects%2Fnotes)", - version: "1.0.17", + version: "1.0.18", type: "source", dedupe: "unique", methods: { diff --git a/components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs b/components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs index 555ee2788b3c1..8eb626dcb939c 100644 --- a/components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs +++ b/components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs @@ -7,7 +7,7 @@ export default { key: "hubspot-new-or-updated-blog-article", name: "New or Updated Blog Post", description: "Emit new event for each new or updated blog post in Hubspot.", - version: "0.0.23", + version: "0.0.24", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs b/components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs index 2a437cb83434b..0646591853daf 100644 --- a/components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs +++ b/components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs @@ -10,7 +10,7 @@ export default { key: "hubspot-new-or-updated-company", name: "New or Updated Company", description: "Emit new event for each new or updated company in Hubspot.", - version: "0.0.23", + version: "0.0.24", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs b/components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs index 05eb05149e286..e8a8a6ca6d0e4 100644 --- a/components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs +++ b/components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs @@ -10,7 +10,7 @@ export default { key: "hubspot-new-or-updated-contact", name: "New or Updated Contact", description: "Emit new event for each new or updated contact in Hubspot.", - version: "0.0.24", + version: "0.0.25", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs b/components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs index d82d9b3a1abec..f2a82c9525f1f 100644 --- a/components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs +++ b/components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs @@ -7,7 +7,7 @@ export default { key: "hubspot-new-or-updated-crm-object", name: "New or Updated CRM Object", description: "Emit new event each time a CRM Object of the specified object type is updated.", - version: "0.0.36", + version: "0.0.37", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs b/components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs index 91ddf3c6d496f..af20b43d77392 100644 --- a/components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs +++ b/components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs @@ -7,7 +7,7 @@ export default { key: "hubspot-new-or-updated-custom-object", name: "New or Updated Custom Object", description: "Emit new event each time a Custom Object of the specified schema is updated.", - version: "0.0.25", + version: "0.0.26", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs b/components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs index 641e67a36e471..fb18f279b54f2 100644 --- a/components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs +++ b/components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs @@ -10,7 +10,7 @@ export default { key: "hubspot-new-or-updated-deal", name: "New or Updated Deal", description: "Emit new event for each new or updated deal in Hubspot", - version: "0.0.23", + version: "0.0.24", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs b/components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs index 6b6237d792d34..840511e938cd7 100644 --- a/components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs +++ b/components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs @@ -10,7 +10,7 @@ export default { key: "hubspot-new-or-updated-line-item", name: "New or Updated Line Item", description: "Emit new event for each new line item added or updated in Hubspot.", - version: "0.0.23", + version: "0.0.24", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs b/components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs index 5f716279cdf82..73a5bee3e5643 100644 --- a/components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs +++ b/components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs @@ -10,7 +10,7 @@ export default { key: "hubspot-new-or-updated-product", name: "New or Updated Product", description: "Emit new event for each new or updated product in Hubspot.", - version: "0.0.23", + version: "0.0.24", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-social-media-message/new-social-media-message.mjs b/components/hubspot/sources/new-social-media-message/new-social-media-message.mjs index fbd3c316266c0..67bb083c13625 100644 --- a/components/hubspot/sources/new-social-media-message/new-social-media-message.mjs +++ b/components/hubspot/sources/new-social-media-message/new-social-media-message.mjs @@ -7,7 +7,7 @@ export default { name: "New Social Media Message", description: "Emit new event when a message is posted from HubSpot to the specified social media channel. Note: Only available for Marketing Hub Enterprise accounts", - version: "0.0.36", + version: "0.0.37", type: "source", dedupe: "unique", props: { diff --git a/components/hubspot/sources/new-task/new-task.mjs b/components/hubspot/sources/new-task/new-task.mjs index 0dbcf40abac5f..5b74ec23d54d7 100644 --- a/components/hubspot/sources/new-task/new-task.mjs +++ b/components/hubspot/sources/new-task/new-task.mjs @@ -9,7 +9,7 @@ export default { name: "New Task Created", description: "Emit new event for each new task created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/tasks#get-%2Fcrm%2Fv3%2Fobjects%2Ftasks)", - version: "1.0.17", + version: "1.0.18", type: "source", dedupe: "unique", methods: { diff --git a/components/hubspot/sources/new-thread-created/new-thread-created.mjs b/components/hubspot/sources/new-thread-created/new-thread-created.mjs new file mode 100644 index 0000000000000..78e84fc0fbd94 --- /dev/null +++ b/components/hubspot/sources/new-thread-created/new-thread-created.mjs @@ -0,0 +1,50 @@ +import common from "../common/common.mjs"; + +export default { + ...common, + key: "hubspot-new-thread-created", + name: "New Thread Created", + description: "Emit new event when a new thread is created. [See the documentation](https://developers.hubspot.com/docs/api-reference/conversations-conversations-inbox-&-messages-v3/public-thread/get-conversations-v3-conversations-threads)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + async processEvent(max) { + const after = this._getAfter(); + let { + paging, results, + } = await this.hubspot.listThreads({ + params: { + after, + sort: "-id", + }, + }); + if (!results?.length) { + return; + } + this._setAfter(paging?.next?.after); + if (max && results.length > max) { + results.length = max; + } + for (const thread of results) { + this.emitEvent(thread); + } + }, + generateMeta(thread) { + return { + id: thread.id, + summary: `New Thread: ${thread.id}`, + ts: Date.parse(thread.createdAt), + }; + }, + }, + hooks: { + async deploy() { + await this.processEvent(25); + }, + }, + async run() { + await this.processEvent(); + }, +}; diff --git a/components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs b/components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs index 465ec86180885..e4e5c3053a2c3 100644 --- a/components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs +++ b/components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs @@ -8,7 +8,7 @@ export default { name: "New Ticket Property Change", description: "Emit new event when a specified property is provided or updated on a ticket. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)", - version: "0.0.30", + version: "0.0.31", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-ticket/new-ticket.mjs b/components/hubspot/sources/new-ticket/new-ticket.mjs index 215666412403c..e52997d912e50 100644 --- a/components/hubspot/sources/new-ticket/new-ticket.mjs +++ b/components/hubspot/sources/new-ticket/new-ticket.mjs @@ -10,7 +10,7 @@ export default { key: "hubspot-new-ticket", name: "New Ticket", description: "Emit new event for each new ticket created.", - version: "0.0.36", + version: "0.0.37", dedupe: "unique", type: "source", props: {