diff --git a/components/apimage/apimage.app.mjs b/components/apimage/apimage.app.mjs index ec4341d473047..5f8302975ae63 100644 --- a/components/apimage/apimage.app.mjs +++ b/components/apimage/apimage.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; 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 b663b4f5dfdd2..dbe619d2e6a79 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 @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-add-contact-to-list", 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.21", + 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.23", type: "action", props: { hubspot, @@ -18,7 +19,8 @@ export default { ], type: "string", label: "List", - description: "The list which the contact will be added to. Only static lists are shown here, as dynamic lists cannot be manually added to.", + description: + "The list which the contact will be added to. Only static lists are shown here, as dynamic lists cannot be manually added to.", }, contactEmail: { propDefinition: [ @@ -30,8 +32,7 @@ export default { }, async run({ $ }) { const { - list, - contactEmail, + list, contactEmail, } = this; const response = await this.hubspot.addContactsToList({ $, 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 b5e123c0437cf..a49540822501a 100644 --- a/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs +++ b/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs @@ -6,15 +6,17 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-batch-create-companies", 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.4", + 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.6", type: "action", props: { hubspot, inputs: { type: "string[]", label: "Inputs (Companies)", - description: "Provide a **list of companies** to be created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fcreate) for more information. Example: `[ { \"properties\": { \"name\": \"CompanyName\"} } ]`", + description: + "Provide a **list of companies** to be created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fcreate) for more information. Example: `[ { \"properties\": { \"name\": \"CompanyName\"} } ]`", }, }, methods: { @@ -35,12 +37,19 @@ export default { inputs: parseObject(this.inputs), }, }); - $.export("$summary", `Created ${response.results.length} compan${response.results.length === 1 - ? "y" - : "ies"}`); + $.export( + "$summary", + `Created ${response.results.length} compan${ + response.results.length === 1 + ? "y" + : "ies" + }`, + ); return response; } catch (error) { - const message = JSON.parse((JSON.parse(error.message).message).split(/:(.+)/)[1])[0].message; + const message = JSON.parse( + JSON.parse(error.message).message.split(/:(.+)/)[1], + )[0].message; throw new ConfigurationError(message.split(/:(.+)/)[0]); } }, 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 dfc27e663cb14..2548bf1781126 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 @@ -3,23 +3,28 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-batch-create-or-update-contact", 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.18", + 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.20", type: "action", props: { hubspot, contacts: { label: "Contacts Array", - description: "Provide a **list of contacts** to be created or updated. If the provided contact has the prop ID or if the provided email already exists, this action will attempt to update it.\n\n**Expected format for create:** `{ \"company\": \"Biglytics\", \"email\": \"bcooper@biglytics.net\", \"firstname\": \"Bryan\", \"lastname\": \"Cooper\", \"phone\": \"(877) 929-0687\", \"website\": \"biglytics.net\" }` \n\n**Expected format for update:** `{ \"id\": \"101\", \"company\": \"Biglytics\", \"email\": \"bcooper@biglytics.net\", \"firstname\": \"Bryan\", \"lastname\": \"Cooper\", \"phone\": \"(877) 929-0687\", \"website\": \"biglytics.net\" }`", + description: + "Provide a **list of contacts** to be created or updated. If the provided contact has the prop ID or if the provided email already exists, this action will attempt to update it.\n\n**Expected format for create:** `{ \"company\": \"Biglytics\", \"email\": \"bcooper@biglytics.net\", \"firstname\": \"Bryan\", \"lastname\": \"Cooper\", \"phone\": \"(877) 929-0687\", \"website\": \"biglytics.net\" }` \n\n**Expected format for update:** `{ \"id\": \"101\", \"company\": \"Biglytics\", \"email\": \"bcooper@biglytics.net\", \"firstname\": \"Bryan\", \"lastname\": \"Cooper\", \"phone\": \"(877) 929-0687\", \"website\": \"biglytics.net\" }`", type: "string[]", }, }, methods: { parseContactArray(contacts) { - if (typeof (contacts) === "string") { + if (typeof contacts === "string") { contacts = JSON.parse(contacts); - } - else if (Array.isArray(contacts) && contacts.length > 0 && typeof (contacts[0]) === "string") { + } else if ( + Array.isArray(contacts) && + contacts.length > 0 && + typeof contacts[0] === "string" + ) { contacts = contacts.map((contact) => JSON.parse(contact)); } return contacts; @@ -40,7 +45,8 @@ export default { }, }); const updateEmails = results?.map(({ properties }) => properties.email); - const insertProperties = contacts.filter(({ email }) => !updateEmails.includes(email)) + const insertProperties = contacts + .filter(({ email }) => !updateEmails.includes(email)) .map((properties) => ({ properties, })); @@ -48,7 +54,9 @@ export default { for (const contact of results) { updateProperties.push({ id: contact.id, - properties: contacts.find(({ email }) => contact.properties.email === email), + properties: contacts.find( + ({ email }) => contact.properties.email === email, + ), }); } return { @@ -62,9 +70,11 @@ export default { const { insertProperties, updateProperties, - } = await this.searchExistingContactProperties(contacts, $); + } = + await this.searchExistingContactProperties(contacts, $); - const updatePropertiesWithId = contacts.filter((contact) => (Object.prototype.hasOwnProperty.call(contact, "id"))) + const updatePropertiesWithId = contacts + .filter((contact) => Object.prototype.hasOwnProperty.call(contact, "id")) .map(({ id, ...properties }) => ({ @@ -90,7 +100,10 @@ export default { }, }); - $.export("$summary", `Successfully created ${insertProperties.length} and updated ${updateProperties.length} contacts`); + $.export( + "$summary", + `Successfully created ${insertProperties.length} and updated ${updateProperties.length} contacts`, + ); return response; }, 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 ffc6d9ad3d0a8..4fa4c37ac95fa 100644 --- a/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs +++ b/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs @@ -6,15 +6,17 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-batch-update-companies", 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.4", + 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.6", type: "action", props: { hubspot, inputs: { type: "string[]", label: "Inputs (Companies)", - description: "Provide a **list of companies** to be updated. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupdate) for more information. Example: `[ { \"id\": \"123\", \"properties\": { \"name\": \"CompanyName\"} } ]`", + description: + "Provide a **list of companies** to be updated. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupdate) for more information. Example: `[ { \"id\": \"123\", \"properties\": { \"name\": \"CompanyName\"} } ]`", }, }, methods: { @@ -35,12 +37,19 @@ export default { inputs: parseObject(this.inputs), }, }); - $.export("$summary", `Updated ${response.results.length} compan${response.results.length === 1 - ? "y" - : "ies"}`); + $.export( + "$summary", + `Updated ${response.results.length} compan${ + response.results.length === 1 + ? "y" + : "ies" + }`, + ); return response; } catch (error) { - const message = JSON.parse((JSON.parse(error.message).message).split(/:(.+)/)[1])[0].message; + const message = JSON.parse( + JSON.parse(error.message).message.split(/:(.+)/)[1], + )[0].message; throw new ConfigurationError(message.split(/:(.+)/)[0]); } }, 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 1acdfec42c08e..4878a9e35c957 100644 --- a/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs +++ b/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs @@ -6,20 +6,23 @@ import hubspot from "../../hubspot.app.mjs"; 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.4", + 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.6", type: "action", props: { hubspot, infoAlert: { type: "alert", alertType: "info", - content: "Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `idProperty` query param refers to a property whose values are unique for the object. To manage properties in Hubspot, navigate to your Settings -> Data Management -> Properties.", + content: + "Create or update companies identified by a unique property value as specified by the `idProperty` query parameter. `idProperty` query param refers to a property whose values are unique for the object. To manage properties in Hubspot, navigate to your Settings -> Data Management -> Properties.", }, inputs: { type: "string[]", label: "Inputs (Companies)", - description: "Provide a **list of companies** to be upserted. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupsert) for more information. Example: `[ { \"idProperty\": \"unique_property\", \"id\": \"123\", \"properties\": { \"name\": \"CompanyName\" } } ]`", + description: + "Provide a **list of companies** to be upserted. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupsert) for more information. Example: `[ { \"idProperty\": \"unique_property\", \"id\": \"123\", \"properties\": { \"name\": \"CompanyName\" } } ]`", }, }, methods: { @@ -43,7 +46,9 @@ export default { $.export("$summary", `Upserted ${response.results.length} companies`); return response; } catch (error) { - const message = JSON.parse((JSON.parse(error.message).message).split(/:(.+)/)[1])[0].message; + const message = JSON.parse( + JSON.parse(error.message).message.split(/:(.+)/)[1], + )[0].message; throw new ConfigurationError(message.split(/:(.+)/)[0]); } }, diff --git a/components/hubspot/actions/clone-email/clone-email.mjs b/components/hubspot/actions/clone-email/clone-email.mjs index 8730acce007a6..b5a79c5c33446 100644 --- a/components/hubspot/actions/clone-email/clone-email.mjs +++ b/components/hubspot/actions/clone-email/clone-email.mjs @@ -4,8 +4,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-clone-email", 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.2", + 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.4", type: "action", props: { hubspot, 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 c1940d7f22ed0..6a6bd4c562d46 100644 --- a/components/hubspot/actions/clone-site-page/clone-site-page.mjs +++ b/components/hubspot/actions/clone-site-page/clone-site-page.mjs @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-clone-site-page", 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.2", + 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.4", type: "action", props: { hubspot, @@ -29,7 +30,10 @@ export default { }, }); - $.export("$summary", `Successfully cloned site page with ID: ${response.id}`); + $.export( + "$summary", + `Successfully cloned site page with ID: ${response.id}`, + ); return response; }, diff --git a/components/hubspot/actions/create-associations/create-associations.mjs b/components/hubspot/actions/create-associations/create-associations.mjs index eca25331dfa41..630985abed061 100644 --- a/components/hubspot/actions/create-associations/create-associations.mjs +++ b/components/hubspot/actions/create-associations/create-associations.mjs @@ -4,8 +4,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-create-associations", 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.7", + 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.9", type: "action", props: { hubspot, @@ -41,7 +42,8 @@ export default { }), ], label: "To Object Type", - description: "Type of the objects the from object is being associated with", + description: + "Type of the objects the from object is being associated with", }, associationType: { propDefinition: [ @@ -62,12 +64,16 @@ export default { }), ], label: "To Objects", - description: "Id's of the objects the from object is being associated with", + description: + "Id's of the objects the from object is being associated with", }, }, methods: { async getAssociationCategory({ - $, fromObjectType, toObjectType, associationType, + $, + fromObjectType, + toObjectType, + associationType, }) { const { results } = await this.hubspot.getAssociationTypes({ $, @@ -75,17 +81,17 @@ export default { toObjectType, associationType, }); - const association = results.find(({ typeId }) => typeId === this.associationType); + const association = results.find( + ({ typeId }) => typeId === this.associationType, + ); return association.category; }, }, async run({ $ }) { const { - fromObjectType, - fromObjectId, - toObjectType, - associationType, - } = this; + fromObjectType, fromObjectId, toObjectType, associationType, + } = + this; let toObjectIds; if (Array.isArray(this.toObjectIds)) { toObjectIds = this.toObjectIds; @@ -125,9 +131,12 @@ export default { }, }); const l = response.results.length; - $.export("$summary", `Successfully created ${l} association${l === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Successfully created ${l} association${l === 1 + ? "" + : "s"}`, + ); return response; }, }; diff --git a/components/hubspot/actions/create-communication/create-communication.mjs b/components/hubspot/actions/create-communication/create-communication.mjs index b3031f8be3d7e..9347933c3853e 100644 --- a/components/hubspot/actions/create-communication/create-communication.mjs +++ b/components/hubspot/actions/create-communication/create-communication.mjs @@ -7,8 +7,9 @@ export default { ...common, key: "hubspot-create-communication", 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.14", + 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.16", type: "action", props: { ...appProp.props, @@ -42,7 +43,8 @@ export default { toObjectType: c.toObjectType, }), ], - description: "A unique identifier to indicate the association type between the communication and the other object", + description: + "A unique identifier to indicate the association type between the communication and the other object", optional: true, }, objectProperties: { @@ -70,7 +72,9 @@ export default { } = this; if ((toObjectId && !associationType) || (!toObjectId && associationType)) { - throw new ConfigurationError("Both `toObjectId` and `associationType` must be entered"); + throw new ConfigurationError( + "Both `toObjectId` and `associationType` must be entered", + ); } const properties = objectProperties @@ -105,7 +109,10 @@ export default { }, }); - $.export("$summary", `Successfully created communication with ID ${response.id}`); + $.export( + "$summary", + `Successfully created communication with ID ${response.id}`, + ); return response; }, }; diff --git a/components/hubspot/actions/create-company/create-company.mjs b/components/hubspot/actions/create-company/create-company.mjs index caef7e034bbf6..2a555e202c7ea 100644 --- a/components/hubspot/actions/create-company/create-company.mjs +++ b/components/hubspot/actions/create-company/create-company.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-create-company", 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.25", + 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.27", type: "action", methods: { ...common.methods, 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 199ba4d91a234..3da4b1bb29f04 100644 --- a/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs +++ b/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs @@ -4,8 +4,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-create-contact-workflow", 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.2", + 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.5", type: "action", props: { hubspot, @@ -73,61 +74,71 @@ export default { enrollmentCriteria: { type: "object", label: "Enrollment Criteria", - description: "An object with the enrollment criteria data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/enrollment-criteria-in-contact-workflows) for more information.", + description: + "An object with the enrollment criteria data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/enrollment-criteria-in-contact-workflows) for more information.", optional: true, }, enrollmentSchedule: { type: "object", label: "Enrollment Schedule", - description: "An object with the enrollment schedule data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/enrollment-schedule-in-contact-workflows) for more information.", + description: + "An object with the enrollment schedule data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/enrollment-schedule-in-contact-workflows) for more information.", optional: true, }, timeWindows: { type: "string[]", label: "Time Windows", - description: "A list of time windows for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/time-windows-in-contact-workflows) for more information.", + description: + "A list of time windows for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/time-windows-in-contact-workflows) for more information.", optional: true, }, blockedDates: { type: "string[]", label: "Blocked Dates", - description: "A list of blocked dates for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/blocked-dates-in-contact-workflows) for more information.", + description: + "A list of blocked dates for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/blocked-dates-in-contact-workflows) for more information.", optional: true, }, customProperties: { type: "object", label: "Custom Properties", - description: "An object with the custom properties data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/custom-properties-in-contact-workflows) for more information.", + description: + "An object with the custom properties data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/custom-properties-in-contact-workflows) for more information.", optional: true, }, dataSources: { type: "string[]", label: "Data Sources", - description: "A list of data sources for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/data-sources-in-contact-workflows) for more information.", + description: + "A list of data sources for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/data-sources-in-contact-workflows) for more information.", optional: true, }, suppressionListIds: { type: "string[]", label: "Suppression List IDs", - description: "A list of suppression list IDs for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/suppression-list-ids-in-contact-workflows) for more information.", + description: + "A list of suppression list IDs for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/suppression-list-ids-in-contact-workflows) for more information.", optional: true, }, goalFilterBranch: { type: "object", label: "Goal Filter Branch", - description: "An object with the goal filter branch data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/goal-filter-branch-in-contact-workflows) for more information.", + description: + "An object with the goal filter branch data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/goal-filter-branch-in-contact-workflows) for more information.", optional: true, }, eventAnchor: { type: "object", label: "Event Anchor", - description: "An object with the event anchor data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/event-anchor-in-contact-workflows) for more information.", + description: + "An object with the event anchor data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/event-anchor-in-contact-workflows) for more information.", optional: true, }, unEnrollmentSetting: { type: "object", label: "Un Enrollment Setting", - description: "An object with the un enrollment setting data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/un-enrollment-setting-in-contact-workflows) for more information.", + description: + "An object with the un enrollment setting data for the contact workflow. [See the documentation](https://developers.hubspot.com/changelog/un-enrollment-setting-in-contact-workflows) for more information.", optional: true, }, }, @@ -157,7 +168,10 @@ export default { }, }); - $.export("$summary", `Successfully created contact workflow with ID: ${response.id}`); + $.export( + "$summary", + `Successfully created contact workflow with ID: ${response.id}`, + ); return response; }, 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 dd856304c043c..8d28bd245a304 100644 --- a/components/hubspot/actions/create-custom-object/create-custom-object.mjs +++ b/components/hubspot/actions/create-custom-object/create-custom-object.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-create-custom-object", 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.7", + 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.9", type: "action", props: { ...appProp.props, diff --git a/components/hubspot/actions/create-deal/create-deal.mjs b/components/hubspot/actions/create-deal/create-deal.mjs index 2475e97bc77fe..c62ccb391d5a4 100644 --- a/components/hubspot/actions/create-deal/create-deal.mjs +++ b/components/hubspot/actions/create-deal/create-deal.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-create-deal", 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.25", + 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.27", type: "action", props: { ...common.props, @@ -40,9 +41,11 @@ export default { return OBJECT_TYPE.DEAL; }, isDefaultProperty(property) { - return property.name === "dealname" - || property.name === "pipeline" - || property.name === "dealstage"; + return ( + property.name === "dealname" || + property.name === "pipeline" || + property.name === "dealstage" + ); }, }, }; diff --git a/components/hubspot/actions/create-email/create-email.mjs b/components/hubspot/actions/create-email/create-email.mjs index 6a8b8839e1772..5e34df4abef15 100644 --- a/components/hubspot/actions/create-email/create-email.mjs +++ b/components/hubspot/actions/create-email/create-email.mjs @@ -8,8 +8,9 @@ import common from "../common/common-get-object.mjs"; export default { key: "hubspot-create-email", 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.2", + 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.4", type: "action", props: { hubspot, @@ -78,7 +79,8 @@ export default { rssData: { type: "object", label: "RSS Data", - description: "An object with the RSS data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", + description: + "An object with the RSS data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", optional: true, }, subject: { @@ -90,7 +92,8 @@ export default { testing: { type: "object", label: "Testing", - description: "An object with the testing data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", + description: + "An object with the testing data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", optional: true, }, language: { @@ -103,19 +106,22 @@ export default { content: { type: "object", label: "Content", - description: "An object with the content data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", + description: + "An object with the content data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", optional: true, }, webversion: { type: "object", label: "Webversion", - description: "An object with the webversion data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", + description: + "An object with the webversion data for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", optional: true, }, subscriptionDetails: { type: "object", label: "Subscription Details", - description: "An object with the subscription details for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", + description: + "An object with the subscription details for the email. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#post-%2Fmarketing%2Fv3%2Femails%2F) for more information.", optional: true, }, sendOnPublish: { diff --git a/components/hubspot/actions/create-engagement/create-engagement.mjs b/components/hubspot/actions/create-engagement/create-engagement.mjs index 39655fa69dc1f..a18502863dc43 100644 --- a/components/hubspot/actions/create-engagement/create-engagement.mjs +++ b/components/hubspot/actions/create-engagement/create-engagement.mjs @@ -1,6 +1,7 @@ import { ConfigurationError } from "@pipedream/platform"; import { - ASSOCIATION_CATEGORY, ENGAGEMENT_TYPE_OPTIONS, + ASSOCIATION_CATEGORY, + ENGAGEMENT_TYPE_OPTIONS, } from "../../common/constants.mjs"; import common from "../common/common-create.mjs"; @@ -8,8 +9,9 @@ export default { ...common, key: "hubspot-create-engagement", 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.24", + description: + "Create a new engagement for a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", + version: "0.0.26", type: "action", props: { ...common.props, @@ -50,7 +52,8 @@ export default { toObjectType: c.toObjectType, }), ], - description: "A unique identifier to indicate the association type between the task and the other object", + description: + "A unique identifier to indicate the association type between the task and the other object", optional: true, }, objectProperties: { @@ -65,7 +68,10 @@ export default { return this.engagementType; }, isRelevantProperty(property) { - return common.methods.isRelevantProperty(property) && !property.name.includes("hs_pipeline"); + return ( + common.methods.isRelevantProperty(property) && + !property.name.includes("hs_pipeline") + ); }, createEngagement(objectType, properties, associations, $) { return this.hubspot.createObject({ @@ -92,7 +98,9 @@ export default { } = this; if ((toObjectId && !associationType) || (!toObjectId && associationType)) { - throw new ConfigurationError("Both `toObjectId` and `associationType` must be entered"); + throw new ConfigurationError( + "Both `toObjectId` and `associationType` must be entered", + ); } const properties = objectProperties @@ -123,7 +131,12 @@ export default { properties.hs_task_reminders = Date.parse(properties.hs_task_reminders); } - const engagement = await this.createEngagement(objectType, properties, associations, $); + const engagement = await this.createEngagement( + objectType, + properties, + associations, + $, + ); const objectName = hubspot.getObjectTypeName(objectType); $.export("$summary", `Successfully created ${objectName} for the contact`); diff --git a/components/hubspot/actions/create-form/create-form.mjs b/components/hubspot/actions/create-form/create-form.mjs index 1ffe8ada1ed6d..01d81499c0b6f 100644 --- a/components/hubspot/actions/create-form/create-form.mjs +++ b/components/hubspot/actions/create-form/create-form.mjs @@ -8,8 +8,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-create-form", 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.2", + 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.4", type: "action", props: { hubspot, @@ -27,13 +28,15 @@ export default { fieldGroups: { type: "string[]", label: "Field Groups", - description: "A list for objects of group type and fields. **Format: `[{ \"groupType\": \"default_group\", \"richTextType\": \"text\", \"fields\": [ { \"objectTypeId\": \"0-1\", \"name\": \"email\", \"label\": \"Email\", \"required\": true, \"hidden\": false, \"fieldType\": \"email\", \"validation\": { \"blockedEmailDomains\": [], \"useDefaultBlockList\": false }}]}]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", + description: + "A list for objects of group type and fields. **Format: `[{ \"groupType\": \"default_group\", \"richTextType\": \"text\", \"fields\": [ { \"objectTypeId\": \"0-1\", \"name\": \"email\", \"label\": \"Email\", \"required\": true, \"hidden\": false, \"fieldType\": \"email\", \"validation\": { \"blockedEmailDomains\": [], \"useDefaultBlockList\": false }}]}]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", optional: true, }, createNewContactForNewEmail: { type: "boolean", label: "Create New Contact for New Email", - description: "Whether to create a new contact when a form is submitted with an email address that doesn't match any in your existing contacts records.", + description: + "Whether to create a new contact when a form is submitted with an email address that doesn't match any in your existing contacts records.", optional: true, }, editable: { @@ -45,20 +48,23 @@ export default { allowLinkToResetKnownValues: { type: "boolean", label: "Allow Link to Reset Known Values", - description: "Whether to add a reset link to the form. This removes any pre-populated content on the form and creates a new contact on submission.", + description: + "Whether to add a reset link to the form. This removes any pre-populated content on the form and creates a new contact on submission.", optional: true, }, lifecycleStages: { type: "string[]", label: "Lifecycle Stages", - description: "A list of objects of lifecycle stages. **Format: `[{ \"objectTypeId\": \"0-1\", \"value\": \"subscriber\" }]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", + description: + "A list of objects of lifecycle stages. **Format: `[{ \"objectTypeId\": \"0-1\", \"value\": \"subscriber\" }]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", optional: true, default: [], }, postSubmitActionType: { type: "string", label: "Post Submit Action Type", - description: "The action to take after submit. The default action is displaying a thank you message.", + description: + "The action to take after submit. The default action is displaying a thank you message.", options: [ "thank_you", "redirect_url", @@ -81,7 +87,8 @@ export default { prePopulateKnownValues: { type: "boolean", label: "Pre-populate Known Values", - description: "Whether contact fields should pre-populate with known information when a contact returns to your site.", + description: + "Whether contact fields should pre-populate with known information when a contact returns to your site.", optional: true, }, cloneable: { @@ -93,7 +100,8 @@ export default { notifyContactOwner: { type: "boolean", label: "Notify Contact Owner", - description: "Whether to send a notification email to the contact owner when a submission is received.", + description: + "Whether to send a notification email to the contact owner when a submission is received.", optional: true, }, recaptchaEnabled: { @@ -119,7 +127,8 @@ export default { renderRawHtml: { type: "boolean", label: "Render Raw HTML", - description: "Whether the form will render as raw HTML as opposed to inside an iFrame.", + description: + "Whether the form will render as raw HTML as opposed to inside an iFrame.", optional: true, }, cssClass: { @@ -131,7 +140,8 @@ export default { theme: { type: "string", label: "Theme", - description: "The theme used for styling the input fields. This will not apply if the form is added to a HubSpot CMS page.", + description: + "The theme used for styling the input fields. This will not apply if the form is added to a HubSpot CMS page.", options: [ "default_style", "canvas", @@ -240,7 +250,8 @@ export default { legalConsentOptionsObject: { type: "object", label: "Legal Consent Options Object", - description: "The object of legal consent options. **Format: `{\"subscriptionTypeIds\": [1,2,3], \"lawfulBasis\": \"lead\", \"privacy\": \"string\"}`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", + description: + "The object of legal consent options. **Format: `{\"subscriptionTypeIds\": [1,2,3], \"lawfulBasis\": \"lead\", \"privacy\": \"string\"}`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", optional: true, }, }, @@ -250,7 +261,9 @@ export default { (this.postSubmitActionType && !this.postSubmitActionValue) || (!this.postSubmitActionType && this.postSubmitActionValue) ) { - throw new ConfigurationError("Post Submit Action Type and Value must be provided together."); + throw new ConfigurationError( + "Post Submit Action Type and Value must be provided together.", + ); } if (this.language) { @@ -281,46 +294,48 @@ export default { configuration.notifyRecipients = parseObject(this.notifyRecipients); } if (this.createNewContactForNewEmail) { - configuration.createNewContactForNewEmail = this.createNewContactForNewEmail; + configuration.createNewContactForNewEmail = + this.createNewContactForNewEmail; } if (this.prePopulateKnownValues) { configuration.prePopulateKnownValues = this.prePopulateKnownValues; } if (this.allowLinkToResetKnownValues) { - configuration.allowLinkToResetKnownValues = this.allowLinkToResetKnownValues; + configuration.allowLinkToResetKnownValues = + this.allowLinkToResetKnownValues; } if (this.lifecycleStages) { configuration.lifecycleStages = parseObject(this.lifecycleStages); } const data = cleanObject({ - "formType": "hubspot", - "name": this.name, - "createdAt": new Date(Date.now()).toISOString(), - "archived": this.archived, - "fieldGroups": parseObject(this.fieldGroups), - "displayOptions": { - "renderRawHtml": this.renderRawHtml, - "cssClass": this.cssClass, - "theme": this.theme, - "submitButtonText": this.submitButtonText, - "style": { - "labelTextSize": this.labelTextSize, - "legalConsentTextColor": this.legalConsentTextColor, - "fontFamily": this.fontFamily, - "legalConsentTextSize": this.legalConsentTextSize, - "backgroundWidth": this.backgroundWidth, - "helpTextSize": this.helpTextSize, - "submitFontColor": this.submitFontColor, - "labelTextColor": this.labelTextColor, - "submitAlignment": this.submitAlignment, - "submitSize": this.submitSize, - "helpTextColor": this.helpTextColor, - "submitColor": this.submitColor, + formType: "hubspot", + name: this.name, + createdAt: new Date(Date.now()).toISOString(), + archived: this.archived, + fieldGroups: parseObject(this.fieldGroups), + displayOptions: { + renderRawHtml: this.renderRawHtml, + cssClass: this.cssClass, + theme: this.theme, + submitButtonText: this.submitButtonText, + style: { + labelTextSize: this.labelTextSize, + legalConsentTextColor: this.legalConsentTextColor, + fontFamily: this.fontFamily, + legalConsentTextSize: this.legalConsentTextSize, + backgroundWidth: this.backgroundWidth, + helpTextSize: this.helpTextSize, + submitFontColor: this.submitFontColor, + labelTextColor: this.labelTextColor, + submitAlignment: this.submitAlignment, + submitSize: this.submitSize, + helpTextColor: this.helpTextColor, + submitColor: this.submitColor, }, }, - "legalConsentOptions": { - "type": this.legalConsentOptionsType, + legalConsentOptions: { + type: this.legalConsentOptionsType, ...(this.legalConsentOptionsObject ? parseObject(this.legalConsentOptionsObject) : {}), 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 1e969becab39a..71013eafe223a 100644 --- a/components/hubspot/actions/create-landing-page/create-landing-page.mjs +++ b/components/hubspot/actions/create-landing-page/create-landing-page.mjs @@ -5,8 +5,9 @@ import commonPageProp from "../common/common-page-prop.mjs"; export default { key: "hubspot-create-landing-page", 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.2", + 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.4", type: "action", props: { hubspot, @@ -46,7 +47,10 @@ export default { }, }); - $.export("$summary", `Successfully created landing page with ID: ${response.id}`); + $.export( + "$summary", + `Successfully created landing page with ID: ${response.id}`, + ); return response; }, diff --git a/components/hubspot/actions/create-lead/create-lead.mjs b/components/hubspot/actions/create-lead/create-lead.mjs index ea1b99e8681de..03ff7e73983e0 100644 --- a/components/hubspot/actions/create-lead/create-lead.mjs +++ b/components/hubspot/actions/create-lead/create-lead.mjs @@ -1,6 +1,5 @@ import { - ASSOCIATION_CATEGORY, - OBJECT_TYPE, + ASSOCIATION_CATEGORY, OBJECT_TYPE, } from "../../common/constants.mjs"; import appProp from "../common/common-app-prop.mjs"; import common from "../common/common-create-object.mjs"; @@ -9,8 +8,9 @@ export default { ...common, key: "hubspot-create-lead", 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.13", + 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.15", type: "action", props: { ...appProp.props, diff --git a/components/hubspot/actions/create-meeting/create-meeting.mjs b/components/hubspot/actions/create-meeting/create-meeting.mjs index 46ba1786f1fa5..2c4bbfd18a111 100644 --- a/components/hubspot/actions/create-meeting/create-meeting.mjs +++ b/components/hubspot/actions/create-meeting/create-meeting.mjs @@ -9,8 +9,9 @@ export default { ...common, key: "hubspot-create-meeting", 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.6", + 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.8", type: "action", props: { ...common.props, @@ -43,13 +44,15 @@ export default { toObjectType: c.toObjectType, }), ], - description: "A unique identifier to indicate the association type between the meeting and the other object", + description: + "A unique identifier to indicate the association type between the meeting and the other object", optional: true, }, objectProperties: { type: "object", label: "Meeting Properties", - description: "Enter the meeting properties as a JSON object. Required properties: hs_meeting_title, hs_meeting_body, hs_meeting_start_time, hs_meeting_end_time. Optional: hs_meeting_status", + description: + "Enter the meeting properties as a JSON object. Required properties: hs_meeting_title, hs_meeting_body, hs_meeting_start_time, hs_meeting_end_time. Optional: hs_meeting_status", }, }, methods: { @@ -81,7 +84,9 @@ export default { } = this; if ((toObjectId && !associationType) || (!toObjectId && associationType)) { - throw new ConfigurationError("Both `toObjectId` and `associationType` must be entered"); + throw new ConfigurationError( + "Both `toObjectId` and `associationType` must be entered", + ); } const properties = objectProperties @@ -108,7 +113,10 @@ export default { const meeting = await this.createMeeting(properties, associations, $); - $.export("$summary", `Successfully created meeting "${properties.hs_meeting_title}"`); + $.export( + "$summary", + `Successfully created meeting "${properties.hs_meeting_title}"`, + ); return meeting; }, diff --git a/components/hubspot/actions/create-note/create-note.mjs b/components/hubspot/actions/create-note/create-note.mjs index 0d22605758a21..1740ee13568c7 100644 --- a/components/hubspot/actions/create-note/create-note.mjs +++ b/components/hubspot/actions/create-note/create-note.mjs @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-create-note", name: "Create Note", - description: "Create a new note. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", - version: "0.0.5", + description: + "Create a new note. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", + version: "0.0.7", type: "action", props: { ...common.props, @@ -41,7 +42,8 @@ export default { toObjectType: c.toObjectType, }), ], - description: "A unique identifier to indicate the association type between the note and the other object", + description: + "A unique identifier to indicate the association type between the note and the other object", optional: true, }, }, @@ -51,7 +53,10 @@ export default { return "notes"; }, isRelevantProperty(property) { - return common.methods.isRelevantProperty(property) && !property.name.includes("hs_pipeline"); + return ( + common.methods.isRelevantProperty(property) && + !property.name.includes("hs_pipeline") + ); }, createEngagement(objectType, properties, associations, $) { return this.hubspot.createObject({ @@ -77,7 +82,9 @@ export default { } = this; if ((toObjectId && !associationType) || (!toObjectId && associationType)) { - throw new ConfigurationError("Both `toObjectId` and `associationType` must be entered"); + throw new ConfigurationError( + "Both `toObjectId` and `associationType` must be entered", + ); } const properties = objectProperties @@ -108,7 +115,12 @@ export default { properties.hs_task_reminders = Date.parse(properties.hs_task_reminders); } - const engagement = await this.createEngagement(objectType, properties, associations, $); + const engagement = await this.createEngagement( + objectType, + properties, + associations, + $, + ); $.export("$summary", "Successfully created note"); 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 253baa623fafd..8ce619b9fca36 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 @@ -5,14 +5,16 @@ export default { ...common, key: "hubspot-create-or-update-contact", 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.23", + 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.25", type: "action", props: { ...common.props, updateIfExists: { label: "Update If Exists", - description: "When selected, if Hubspot returns an error upon creation the resource should be updated.", + description: + "When selected, if Hubspot returns an error upon creation the resource should be updated.", type: "boolean", }, }, diff --git a/components/hubspot/actions/create-page/create-page.mjs b/components/hubspot/actions/create-page/create-page.mjs index 28fdffbe27fd0..525a215cf4052 100644 --- a/components/hubspot/actions/create-page/create-page.mjs +++ b/components/hubspot/actions/create-page/create-page.mjs @@ -5,8 +5,9 @@ import commonPageProp from "../common/common-page-prop.mjs"; export default { key: "hubspot-create-page", 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.2", + 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.4", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/create-task/create-task.mjs b/components/hubspot/actions/create-task/create-task.mjs index 025a92acb820a..8cb724d934cde 100644 --- a/components/hubspot/actions/create-task/create-task.mjs +++ b/components/hubspot/actions/create-task/create-task.mjs @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-create-task", name: "Create Task", - description: "Create a new task. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", - version: "0.0.6", + description: + "Create a new task. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)", + version: "0.0.8", type: "action", props: { ...common.props, @@ -41,7 +42,8 @@ export default { toObjectType: c.toObjectType, }), ], - description: "A unique identifier to indicate the association type between the task and the other object", + description: + "A unique identifier to indicate the association type between the task and the other object", optional: true, }, objectProperties: { @@ -56,7 +58,10 @@ export default { return "tasks"; }, isRelevantProperty(property) { - return common.methods.isRelevantProperty(property) && !property.name.includes("hs_pipeline"); + return ( + common.methods.isRelevantProperty(property) && + !property.name.includes("hs_pipeline") + ); }, createEngagement(objectType, properties, associations, $) { return this.hubspot.createObject({ @@ -82,7 +87,9 @@ export default { } = this; if ((toObjectId && !associationType) || (!toObjectId && associationType)) { - throw new ConfigurationError("Both `toObjectId` and `associationType` must be entered"); + throw new ConfigurationError( + "Both `toObjectId` and `associationType` must be entered", + ); } const properties = objectProperties @@ -113,7 +120,12 @@ export default { properties.hs_task_reminders = Date.parse(properties.hs_task_reminders); } - const engagement = await this.createEngagement(objectType, properties, associations, $); + const engagement = await this.createEngagement( + objectType, + properties, + associations, + $, + ); const objectName = hubspot.getObjectTypeName(objectType); $.export("$summary", `Successfully created ${objectName}`); diff --git a/components/hubspot/actions/create-ticket/create-ticket.mjs b/components/hubspot/actions/create-ticket/create-ticket.mjs index d73ff06e3af49..51becf7d6b393 100644 --- a/components/hubspot/actions/create-ticket/create-ticket.mjs +++ b/components/hubspot/actions/create-ticket/create-ticket.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-create-ticket", name: "Create Ticket", - description: "Create a ticket in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)", - version: "0.0.16", + description: + "Create a ticket in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)", + version: "0.0.18", type: "action", props: { ...common.props, @@ -37,9 +38,11 @@ export default { return OBJECT_TYPE.TICKET; }, isDefaultProperty(property) { - return property.name === "subject" - || property.name === "hs_pipeline" - || property.name === "hs_pipeline_stage"; + return ( + property.name === "subject" || + property.name === "hs_pipeline" || + property.name === "hs_pipeline_stage" + ); }, }, }; 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 c30656d3dcb9e..fae5fbb1d8f5e 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 @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-enroll-contact-into-workflow", 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.21", + 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.23", type: "action", props: { hubspot, @@ -24,8 +25,7 @@ export default { }, async run({ $ }) { const { - workflow, - contactEmail, + workflow, contactEmail, } = this; const response = await this.hubspot.addContactsIntoWorkflow({ workflowId: workflow, 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 c74e487e40ff1..9834686b87a7f 100644 --- a/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs +++ b/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs @@ -4,8 +4,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-get-associated-emails", 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.3", + 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.5", type: "action", props: { hubspot, 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 035dd0d08c86c..bfa3ec6e05d2d 100644 --- a/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs +++ b/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs @@ -5,8 +5,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-get-associated-meetings", 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.6", + 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.8", type: "action", props: { hubspot, @@ -24,7 +25,8 @@ export default { objectId: { type: "string", label: "Object ID", - description: "The ID of the object to get associated meetings for. For contacts, you can search by email.", + description: + "The ID of the object to get associated meetings for. For contacts, you can search by email.", propDefinition: [ hubspot, "objectIds", @@ -61,12 +63,14 @@ export default { startDate: { type: "string", label: "Start Date", - description: "The start date to filter meetings from (ISO 8601 format). Eg. `2025-01-01T00:00:00Z`", + description: + "The start date to filter meetings from (ISO 8601 format). Eg. `2025-01-01T00:00:00Z`", }, endDate: { type: "string", label: "End Date", - description: "The end date to filter meetings to (ISO 8601 format). Eg. `2025-01-31T23:59:59Z`", + description: + "The end date to filter meetings to (ISO 8601 format). Eg. `2025-01-31T23:59:59Z`", }, }; }, @@ -112,7 +116,13 @@ export default { const dayOfWeek = now.getUTCDay(); const startOfWeek = new Date( Date.UTC( - now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() - dayOfWeek, 0, 0, 0, 0, + now.getUTCFullYear(), + now.getUTCMonth(), + now.getUTCDate() - dayOfWeek, + 0, + 0, + 0, + 0, ), ).toISOString(); const endOfWeek = new Date( @@ -142,7 +152,15 @@ export default { Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1, 0, 0, 0, 0), ).toISOString(); const endOfMonth = new Date( - Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 0, 23, 59, 59, 999), + Date.UTC( + now.getUTCFullYear(), + now.getUTCMonth() + 1, + 0, + 23, + 59, + 59, + 999, + ), ).toISOString(); return { hs_meeting_start_time: { @@ -157,15 +175,7 @@ export default { } case "last_month": { const startOfLastMonth = new Date( - Date.UTC( - now.getUTCFullYear(), - now.getUTCMonth() - 1, - 1, - 0, - 0, - 0, - 0, - ), + Date.UTC(now.getUTCFullYear(), now.getUTCMonth() - 1, 1, 0, 0, 0, 0), ).toISOString(); const endOfLastMonth = new Date( Date.UTC( @@ -224,7 +234,11 @@ export default { const meetingIds = associations.map(({ toObjectId }) => toObjectId); - const timeFilter = this.getMeetingTimeFilter(timeframe, startDate, endDate); + const timeFilter = this.getMeetingTimeFilter( + timeframe, + startDate, + endDate, + ); const { results } = await this.hubspot.searchMeetings({ data: { @@ -240,14 +254,15 @@ export default { operator: "IN", values: meetingIds, }, - ...Object.entries(timeFilter) - .map(([ + ...Object.entries(timeFilter).map( + ([ propertyName, filterProps, ]) => ({ propertyName, ...filterProps, - })), + }), + ), ], }, ], @@ -268,7 +283,10 @@ export default { }, async run({ $ }) { let resolvedObjectId = this.objectId; - if (this.objectType === OBJECT_TYPE.CONTACT && this.objectId.includes("@")) { + if ( + this.objectType === OBJECT_TYPE.CONTACT && + this.objectId.includes("@") + ) { const { results } = await this.hubspot.searchCRM({ object: OBJECT_TYPE.CONTACT, data: { diff --git a/components/hubspot/actions/get-company/get-company.mjs b/components/hubspot/actions/get-company/get-company.mjs index 7e5d6b887149c..5625f498e5348 100644 --- a/components/hubspot/actions/get-company/get-company.mjs +++ b/components/hubspot/actions/get-company/get-company.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-get-company", 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.21", + 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.23", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/get-contact/get-contact.mjs b/components/hubspot/actions/get-contact/get-contact.mjs index 2a2db8cc08064..5c2d758b564a1 100644 --- a/components/hubspot/actions/get-contact/get-contact.mjs +++ b/components/hubspot/actions/get-contact/get-contact.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-get-contact", 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.21", + 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.23", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/get-deal/get-deal.mjs b/components/hubspot/actions/get-deal/get-deal.mjs index 8e2ed2778d3b4..cdb8a687cdc87 100644 --- a/components/hubspot/actions/get-deal/get-deal.mjs +++ b/components/hubspot/actions/get-deal/get-deal.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-get-deal", 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.21", + 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.23", type: "action", props: { ...common.props, 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 1d3f1aa047b06..5ce7e09d551e5 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 @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-get-file-public-url", 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.21", + 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.23", type: "action", props: { hubspot, @@ -17,18 +18,18 @@ export default { expirationSeconds: { type: "integer", label: "Public URL Expiration (seconds)", - description: "The number of seconds the returned public URL will be accessible for. Default is 1 hour (3600 seconds). Maximum is 6 hours (21600 seconds).", + description: + "The number of seconds the returned public URL will be accessible for. Default is 1 hour (3600 seconds). Maximum is 6 hours (21600 seconds).", default: 3600, optional: true, }, }, async run({ $ }) { const { - fileUrl, - expirationSeconds, + fileUrl, expirationSeconds, } = this; const { results: files } = await this.hubspot.searchFiles(); - const file = files.find(({ url }) => url === fileUrl ); + const file = files.find(({ url }) => url === fileUrl); const fileId = file.id; if (!fileId) { throw new Error(`File not found at ${fileUrl}`); diff --git a/components/hubspot/actions/get-meeting/get-meeting.mjs b/components/hubspot/actions/get-meeting/get-meeting.mjs index 06e6aa10d1519..b580848363c97 100644 --- a/components/hubspot/actions/get-meeting/get-meeting.mjs +++ b/components/hubspot/actions/get-meeting/get-meeting.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-get-meeting", 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.6", + 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.8", type: "action", props: { ...common.props, 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 cf69c4f899912..10e2bf4229c58 100644 --- a/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs +++ b/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-get-subscription-preferences", 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.3", + 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.5", type: "action", props: { hubspot, @@ -24,7 +25,10 @@ export default { }, }); - $.export("$summary", `Retrieved subscription preferences for ${this.contactEmail}`); + $.export( + "$summary", + `Retrieved subscription preferences for ${this.contactEmail}`, + ); return response; }, }; 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 5b6e62e79bbbe..cfeeaf388d3ea 100644 --- a/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs +++ b/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs @@ -3,45 +3,52 @@ import hubspot from "../../hubspot.app.mjs"; 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.3", + description: + "Retrieves a list of blog posts. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/blogs/blog-posts)", + version: "0.0.5", type: "action", props: { hubspot, createdAt: { type: "string", label: "Created At", - description: "Only return Blog Posts created at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Blog Posts created at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, createdAfter: { type: "string", label: "Created After", - description: "Only return Blog Posts created after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Blog Posts created after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, createdBefore: { type: "string", label: "Created Before", - description: "Only return Blog Posts created before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Blog Posts created before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedAt: { type: "string", label: "Updated At", - description: "Only return Blog Posts updated at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Blog Posts updated at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedAfter: { type: "string", label: "Updated After", - description: "Only return Blog Posts updated after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Blog Posts updated after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedBefore: { type: "string", label: "Updated Before", - description: "Only return Blog Posts updated before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Blog Posts updated before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, archived: { @@ -73,7 +80,8 @@ export default { }, async run({ $ }) { const results = []; - let hasMore, count = 0; + let hasMore, + count = 0; const params = { createdAt: this.createdAt, @@ -107,9 +115,12 @@ export default { params.after = paging?.next.after; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} page${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} page${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; diff --git a/components/hubspot/actions/list-campaigns/list-campaigns.mjs b/components/hubspot/actions/list-campaigns/list-campaigns.mjs index 5b89be1529267..f893ac00e4c81 100644 --- a/components/hubspot/actions/list-campaigns/list-campaigns.mjs +++ b/components/hubspot/actions/list-campaigns/list-campaigns.mjs @@ -3,15 +3,17 @@ import hubspot from "../../hubspot.app.mjs"; 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.3", + 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.5", type: "action", props: { hubspot, sort: { type: "string", label: "Sort", - description: "The field by which to sort the results. An optional '-' before the property name can denote descending order", + description: + "The field by which to sort the results. An optional '-' before the property name can denote descending order", options: [ "hs_name", "-hs_name", @@ -32,7 +34,8 @@ export default { }, async run({ $ }) { const results = []; - let hasMore, count = 0; + let hasMore, + count = 0; const params = { sort: this.sort, @@ -59,9 +62,12 @@ export default { params.after = paging?.next.after; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} campaign${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} campaign${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; diff --git a/components/hubspot/actions/list-forms/list-forms.mjs b/components/hubspot/actions/list-forms/list-forms.mjs index 58df18e8a9453..82390292feeeb 100644 --- a/components/hubspot/actions/list-forms/list-forms.mjs +++ b/components/hubspot/actions/list-forms/list-forms.mjs @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-list-forms", 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.3", + 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.5", type: "action", props: { hubspot, @@ -24,7 +25,8 @@ export default { }, async run({ $ }) { const results = []; - let hasMore, count = 0; + let hasMore, + count = 0; const params = { archived: this.archived, @@ -51,9 +53,12 @@ export default { params.after = paging?.next.after; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} form${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} form${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; 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 4c6cb11ea82a1..5e24f1ca7eb38 100644 --- a/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs +++ b/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs @@ -3,45 +3,52 @@ import hubspot from "../../hubspot.app.mjs"; 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.3", + 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.5", type: "action", props: { hubspot, createdAt: { type: "string", label: "Created At", - description: "Only return Marketing Emails created at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Marketing Emails created at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, createdAfter: { type: "string", label: "Created After", - description: "Only return Marketing Emails created after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Marketing Emails created after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, createdBefore: { type: "string", label: "Created Before", - description: "Only return Marketing Emails created before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Marketing Emails created before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedAt: { type: "string", label: "Updated At", - description: "Only return Marketing Emails updated at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Marketing Emails updated at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedAfter: { type: "string", label: "Updated After", - description: "Only return Marketing Emails updated after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Marketing Emails updated after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedBefore: { type: "string", label: "Updated Before", - description: "Only return Marketing Emails updated before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Marketing Emails updated before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, includeStats: { @@ -79,7 +86,8 @@ export default { }, async run({ $ }) { const results = []; - let hasMore, count = 0; + let hasMore, + count = 0; const params = { createdAt: this.createdAt, @@ -114,9 +122,12 @@ export default { params.after = paging?.next.after; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} email${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} email${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; 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 15db09497ac3f..2cb1eba1d2fa5 100644 --- a/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs +++ b/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; 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.3", + 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.5", type: "action", props: { hubspot, @@ -21,7 +22,8 @@ export default { const params = { limit: 100, }; - let hasMore, count = 0; + let hasMore, + count = 0; do { const { @@ -44,9 +46,12 @@ export default { params.after = paging?.next.after; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} event${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} event${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; diff --git a/components/hubspot/actions/list-pages/list-pages.mjs b/components/hubspot/actions/list-pages/list-pages.mjs index 8280a0f400df4..2ea70ba1ca8c1 100644 --- a/components/hubspot/actions/list-pages/list-pages.mjs +++ b/components/hubspot/actions/list-pages/list-pages.mjs @@ -3,45 +3,52 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-list-pages", 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.3", + description: + "Retrieves a list of site pages. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/pages)", + version: "0.0.5", type: "action", props: { hubspot, createdAt: { type: "string", label: "Created At", - description: "Only return Site Pages created at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Site Pages created at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, createdAfter: { type: "string", label: "Created After", - description: "Only return Site Pages created after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Site Pages created after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, createdBefore: { type: "string", label: "Created Before", - description: "Only return Site Pages created before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Site Pages created before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedAt: { type: "string", label: "Updated At", - description: "Only return Site Pages updated at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Site Pages updated at exactly the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedAfter: { type: "string", label: "Updated After", - description: "Only return Site Pages updated after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Site Pages updated after the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, updatedBefore: { type: "string", label: "Updated Before", - description: "Only return Site Pages updated before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", + description: + "Only return Site Pages updated before the specified time. Format: YYYY-MM-DDTHH:MM:SSZ", optional: true, }, archived: { @@ -73,7 +80,8 @@ export default { }, async run({ $ }) { const results = []; - let hasMore, count = 0; + let hasMore, + count = 0; const params = { createdAt: this.createdAt, @@ -107,9 +115,12 @@ export default { params.after = paging?.next.after; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} page${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} page${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; diff --git a/components/hubspot/actions/list-templates/list-templates.mjs b/components/hubspot/actions/list-templates/list-templates.mjs index f2ae58d868e06..f856231d3d17e 100644 --- a/components/hubspot/actions/list-templates/list-templates.mjs +++ b/components/hubspot/actions/list-templates/list-templates.mjs @@ -3,8 +3,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-list-templates", name: "List Templates", - description: "Retrieves a list of templates. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/templates)", - version: "0.0.3", + description: + "Retrieves a list of templates. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/templates)", + version: "0.0.5", type: "action", props: { hubspot, @@ -22,7 +23,8 @@ export default { limit: 100, offset: 0, }; - let hasMore, count = 0; + let hasMore, + count = 0; do { const { @@ -45,9 +47,12 @@ export default { params.offset += params.limit; } while (hasMore && count < this.maxResults); - $.export("$summary", `Found ${results.length} template${results.length === 1 - ? "" - : "s"}`); + $.export( + "$summary", + `Found ${results.length} template${results.length === 1 + ? "" + : "s"}`, + ); return results; }, }; diff --git a/components/hubspot/actions/search-crm/search-crm.mjs b/components/hubspot/actions/search-crm/search-crm.mjs index 5b3a319313d91..0888c902e45d7 100644 --- a/components/hubspot/actions/search-crm/search-crm.mjs +++ b/components/hubspot/actions/search-crm/search-crm.mjs @@ -16,8 +16,9 @@ import common from "../common/common-create.mjs"; export default { key: "hubspot-search-crm", 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.0.8", + 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.0.10", type: "action", props: { hubspot, @@ -37,14 +38,16 @@ export default { exactMatch: { type: "boolean", label: "Exact Match", - description: "Set to `true` to search for an exact match of the search value. If `false`, partial matches will be returned. Default: `true`", + description: + "Set to `true` to search for an exact match of the search value. If `false`, partial matches will be returned. Default: `true`", default: true, optional: true, }, createIfNotFound: { type: "boolean", label: "Create if not found?", - description: "Set to `true` to create the Hubspot object if it doesn't exist", + description: + "Set to `true` to create the Hubspot object if it doesn't exist", default: false, optional: true, reloadProps: true, @@ -69,7 +72,10 @@ export default { }; } } - if (!this.objectType || (this.objectType === "custom_object" && !this.customObjectType)) { + if ( + !this.objectType || + (this.objectType === "custom_object" && !this.customObjectType) + ) { return props; } @@ -105,7 +111,8 @@ export default { props.searchValue = { type: "string", label: "Search Value", - description: "Search for objects where the specified search field/property contains a match of the search value", + description: + "Search for objects where the specified search field/property contains a match of the search value", }; const defaultProperties = this.getDefaultProperties(); if (defaultProperties?.length) { @@ -130,7 +137,8 @@ export default { objectType: this.customObjectType ?? this.objectType, }); const defaultProperties = this.getDefaultProperties(); - return properties.filter(({ name }) => !defaultProperties.includes(name)) + return properties + .filter(({ name }) => !defaultProperties.includes(name)) .map((property) => ({ label: property.label, value: property.name, @@ -154,20 +162,25 @@ export default { const relevantProperties = properties.filter(this.isRelevantProperty); const propDefinitions = []; for (const property of relevantProperties) { - propDefinitions.push(await this.makePropDefinition(property, schema.requiredProperties)); + propDefinitions.push( + await this.makePropDefinition(property, schema.requiredProperties), + ); } - creationProps = propDefinitions - .reduce((props, { + creationProps = propDefinitions.reduce( + (props, { name, ...definition }) => { props[name] = definition; return props; - }, {}); + }, + {}, + ); } catch { props.creationProps = { type: "object", label: "Object Properties", - description: "A JSON object containing the object to create if not found", + description: + "A JSON object containing the object to create if not found", }; } } @@ -202,12 +215,14 @@ export default { }, async getCustomObjectTypes() { const { results } = await this.hubspot.listSchemas(); - return results?.map(({ - fullyQualifiedName: value, labels, - }) => ({ - value, - label: labels.plural, - })) || []; + return ( + results?.map(({ + fullyQualifiedName: value, labels, + }) => ({ + value, + label: labels.plural, + })) || [] + ); }, async paginate(params) { let results; @@ -252,7 +267,7 @@ export default { if (!schema.searchableProperties.includes(searchProperty)) { throw new ConfigurationError( `Property \`${searchProperty}\` is not a searchable property of object type \`${objectType}\`. ` + - `\n\nAvailable searchable properties are: \`${schema.searchableProperties.join("`, `")}\``, + `\n\nAvailable searchable properties are: \`${schema.searchableProperties.join("`, `")}\``, ); } @@ -287,9 +302,13 @@ export default { }); if (!exactMatch) { - results = results.filter((result) => - result.properties[searchProperty] - && result.properties[searchProperty].toLowerCase().includes(searchValue.toLowerCase())); + results = results.filter( + (result) => + result.properties[searchProperty] && + result.properties[searchProperty] + .toLowerCase() + .includes(searchValue.toLowerCase()), + ); } if (!results?.length && createIfNotFound) { @@ -305,7 +324,10 @@ export default { return response; } - $.export("$summary", `Successfully retrieved ${results?.length} object(s).`); + $.export( + "$summary", + `Successfully retrieved ${results?.length} object(s).`, + ); return results; }, }; diff --git a/components/hubspot/actions/update-company/update-company.mjs b/components/hubspot/actions/update-company/update-company.mjs index 8754f760469e4..e3e68a1f615f4 100644 --- a/components/hubspot/actions/update-company/update-company.mjs +++ b/components/hubspot/actions/update-company/update-company.mjs @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-update-company", name: "Update Company", - description: "Update a company in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)", - version: "0.0.21", + description: + "Update a company in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)", + version: "0.0.23", type: "action", methods: { ...common.methods, diff --git a/components/hubspot/actions/update-contact/update-contact.mjs b/components/hubspot/actions/update-contact/update-contact.mjs index b21fc4a6367f0..b8eb3ebd0d8d4 100644 --- a/components/hubspot/actions/update-contact/update-contact.mjs +++ b/components/hubspot/actions/update-contact/update-contact.mjs @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-update-contact", 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.22", + 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.24", type: "action", methods: { ...common.methods, 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 456c27c4d703d..acb462b4ea264 100644 --- a/components/hubspot/actions/update-custom-object/update-custom-object.mjs +++ b/components/hubspot/actions/update-custom-object/update-custom-object.mjs @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-update-custom-object", 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.7", + 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.9", type: "action", methods: { ...common.methods, diff --git a/components/hubspot/actions/update-deal/update-deal.mjs b/components/hubspot/actions/update-deal/update-deal.mjs index f27761975ed6d..6889cfdb80a47 100644 --- a/components/hubspot/actions/update-deal/update-deal.mjs +++ b/components/hubspot/actions/update-deal/update-deal.mjs @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-update-deal", 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.12", + 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.14", type: "action", methods: { ...common.methods, 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 5c32703468591..534afa62a16b0 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 @@ -8,8 +8,9 @@ import hubspot from "../../hubspot.app.mjs"; export default { key: "hubspot-update-fields-on-the-form", 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.2", + 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.4", type: "action", props: { hubspot, @@ -34,13 +35,15 @@ export default { fieldGroups: { type: "string[]", label: "Field Groups", - description: "A list for objects of group type and fields. **Format: `[{ \"groupType\": \"default_group\", \"richTextType\": \"text\", \"fields\": [ { \"objectTypeId\": \"0-1\", \"name\": \"email\", \"label\": \"Email\", \"required\": true, \"hidden\": false, \"fieldType\": \"email\", \"validation\": { \"blockedEmailDomains\": [], \"useDefaultBlockList\": false }}]}]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", + description: + "A list for objects of group type and fields. **Format: `[{ \"groupType\": \"default_group\", \"richTextType\": \"text\", \"fields\": [ { \"objectTypeId\": \"0-1\", \"name\": \"email\", \"label\": \"Email\", \"required\": true, \"hidden\": false, \"fieldType\": \"email\", \"validation\": { \"blockedEmailDomains\": [], \"useDefaultBlockList\": false }}]}]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", optional: true, }, createNewContactForNewEmail: { type: "boolean", label: "Create New Contact for New Email", - description: "Whether to create a new contact when a form is submitted with an email address that doesn't match any in your existing contacts records.", + description: + "Whether to create a new contact when a form is submitted with an email address that doesn't match any in your existing contacts records.", optional: true, }, editable: { @@ -52,20 +55,23 @@ export default { allowLinkToResetKnownValues: { type: "boolean", label: "Allow Link to Reset Known Values", - description: "Whether to add a reset link to the form. This removes any pre-populated content on the form and creates a new contact on submission.", + description: + "Whether to add a reset link to the form. This removes any pre-populated content on the form and creates a new contact on submission.", optional: true, }, lifecycleStages: { type: "string[]", label: "Lifecycle Stages", - description: "A list of objects of lifecycle stages. **Format: `[{ \"objectTypeId\": \"0-1\", \"value\": \"subscriber\" }]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", + description: + "A list of objects of lifecycle stages. **Format: `[{ \"objectTypeId\": \"0-1\", \"value\": \"subscriber\" }]`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", optional: true, default: [], }, postSubmitActionType: { type: "string", label: "Post Submit Action Type", - description: "The action to take after submit. The default action is displaying a thank you message.", + description: + "The action to take after submit. The default action is displaying a thank you message.", options: [ "thank_you", "redirect_url", @@ -88,7 +94,8 @@ export default { prePopulateKnownValues: { type: "boolean", label: "Pre-populate Known Values", - description: "Whether contact fields should pre-populate with known information when a contact returns to your site.", + description: + "Whether contact fields should pre-populate with known information when a contact returns to your site.", optional: true, }, cloneable: { @@ -100,7 +107,8 @@ export default { notifyContactOwner: { type: "boolean", label: "Notify Contact Owner", - description: "Whether to send a notification email to the contact owner when a submission is received.", + description: + "Whether to send a notification email to the contact owner when a submission is received.", optional: true, }, recaptchaEnabled: { @@ -126,7 +134,8 @@ export default { renderRawHtml: { type: "boolean", label: "Render Raw HTML", - description: "Whether the form will render as raw HTML as opposed to inside an iFrame.", + description: + "Whether the form will render as raw HTML as opposed to inside an iFrame.", optional: true, }, cssClass: { @@ -138,7 +147,8 @@ export default { theme: { type: "string", label: "Theme", - description: "The theme used for styling the input fields. This will not apply if the form is added to a HubSpot CMS page`.", + description: + "The theme used for styling the input fields. This will not apply if the form is added to a HubSpot CMS page`.", options: [ "default_style", "canvas", @@ -247,7 +257,8 @@ export default { legalConsentOptionsObject: { type: "object", label: "Legal Consent Options Object", - description: "The object of legal consent options. **Format: `{\"subscriptionTypeIds\": [1,2,3], \"lawfulBasis\": \"lead\", \"privacy\": \"string\"}`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", + description: + "The object of legal consent options. **Format: `{\"subscriptionTypeIds\": [1,2,3], \"lawfulBasis\": \"lead\", \"privacy\": \"string\"}`** [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/forms#post-%2Fmarketing%2Fv3%2Fforms%2F) for more information.", optional: true, }, }, @@ -257,7 +268,9 @@ export default { (this.postSubmitActionType && !this.postSubmitActionValue) || (!this.postSubmitActionType && this.postSubmitActionValue) ) { - throw new ConfigurationError("Post Submit Action Type and Value must be provided together."); + throw new ConfigurationError( + "Post Submit Action Type and Value must be provided together.", + ); } if (this.language) { @@ -288,45 +301,47 @@ export default { configuration.notifyRecipients = parseObject(this.notifyRecipients); } if (this.createNewContactForNewEmail) { - configuration.createNewContactForNewEmail = this.createNewContactForNewEmail; + configuration.createNewContactForNewEmail = + this.createNewContactForNewEmail; } if (this.prePopulateKnownValues) { configuration.prePopulateKnownValues = this.prePopulateKnownValues; } if (this.allowLinkToResetKnownValues) { - configuration.allowLinkToResetKnownValues = this.allowLinkToResetKnownValues; + configuration.allowLinkToResetKnownValues = + this.allowLinkToResetKnownValues; } if (this.lifecycleStages) { configuration.lifecycleStages = parseObject(this.lifecycleStages); } const data = cleanObject({ - "formType": "hubspot", - "name": this.name, - "archived": this.archived, - "fieldGroups": parseObject(this.fieldGroups), - "displayOptions": { - "renderRawHtml": this.renderRawHtml, - "cssClass": this.cssClass, - "theme": this.theme, - "submitButtonText": this.submitButtonText, - "style": { - "labelTextSize": this.labelTextSize, - "legalConsentTextColor": this.legalConsentTextColor, - "fontFamily": this.fontFamily, - "legalConsentTextSize": this.legalConsentTextSize, - "backgroundWidth": this.backgroundWidth, - "helpTextSize": this.helpTextSize, - "submitFontColor": this.submitFontColor, - "labelTextColor": this.labelTextColor, - "submitAlignment": this.submitAlignment, - "submitSize": this.submitSize, - "helpTextColor": this.helpTextColor, - "submitColor": this.submitColor, + formType: "hubspot", + name: this.name, + archived: this.archived, + fieldGroups: parseObject(this.fieldGroups), + displayOptions: { + renderRawHtml: this.renderRawHtml, + cssClass: this.cssClass, + theme: this.theme, + submitButtonText: this.submitButtonText, + style: { + labelTextSize: this.labelTextSize, + legalConsentTextColor: this.legalConsentTextColor, + fontFamily: this.fontFamily, + legalConsentTextSize: this.legalConsentTextSize, + backgroundWidth: this.backgroundWidth, + helpTextSize: this.helpTextSize, + submitFontColor: this.submitFontColor, + labelTextColor: this.labelTextColor, + submitAlignment: this.submitAlignment, + submitSize: this.submitSize, + helpTextColor: this.helpTextColor, + submitColor: this.submitColor, }, }, - "legalConsentOptions": { - "type": this.legalConsentOptionsType, + legalConsentOptions: { + type: this.legalConsentOptionsType, ...(this.legalConsentOptionsObject ? parseObject(this.legalConsentOptionsObject) : {}), 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 cdc2c2e6d4703..8a49edb8fbd78 100644 --- a/components/hubspot/actions/update-landing-page/update-landing-page.mjs +++ b/components/hubspot/actions/update-landing-page/update-landing-page.mjs @@ -5,8 +5,9 @@ import commonPageProp from "../common/common-page-prop.mjs"; export default { key: "hubspot-update-landing-page", 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.2", + 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.4", type: "action", props: { hubspot, @@ -55,7 +56,10 @@ export default { }, }); - $.export("$summary", `Successfully updated landing page with ID: ${response.id}`); + $.export( + "$summary", + `Successfully updated landing page with ID: ${response.id}`, + ); return response; }, diff --git a/components/hubspot/actions/update-lead/update-lead.mjs b/components/hubspot/actions/update-lead/update-lead.mjs index c5e28edb90914..e8893787cf41f 100644 --- a/components/hubspot/actions/update-lead/update-lead.mjs +++ b/components/hubspot/actions/update-lead/update-lead.mjs @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-update-lead", 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.13", + 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.15", type: "action", methods: { ...common.methods, diff --git a/components/hubspot/actions/update-page/update-page.mjs b/components/hubspot/actions/update-page/update-page.mjs index 138a64aefe82a..494af8a602d1a 100644 --- a/components/hubspot/actions/update-page/update-page.mjs +++ b/components/hubspot/actions/update-page/update-page.mjs @@ -5,8 +5,9 @@ import commonPageProp from "../common/common-page-prop.mjs"; export default { key: "hubspot-update-page", 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.2", + 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.4", type: "action", props: { hubspot, diff --git a/components/hubspot/hubspot.app.mjs b/components/hubspot/hubspot.app.mjs index 1219d4744c230..132aeab57efe2 100644 --- a/components/hubspot/hubspot.app.mjs +++ b/components/hubspot/hubspot.app.mjs @@ -1264,15 +1264,58 @@ export default { ...opts, }); }, - batchGetObjects({ + async getListMembershipsByJoinOrder({ + listId, ...opts + }) { + const MAX_RETRIES = 5; + const BASE_RETRY_DELAY = 500; + let success = false; + let retries = 0; + while (!success) { + try { + const response = await this.makeRequest({ + api: API_PATH.CRMV3, + endpoint: `/lists/${listId}/memberships/join-order`, + ...opts, + }); + return response; + } catch (error) { + if (error.status === 429 && ++retries < MAX_RETRIES) { + const randomDelay = Math.floor(Math.random() * BASE_RETRY_DELAY); + const delay = BASE_RETRY_DELAY * (2 ** retries) + randomDelay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } else { + throw error; + } + } + } + }, + async batchGetObjects({ objectType, ...opts }) { - return this.makeRequest({ - api: API_PATH.CRMV3, - endpoint: `/objects/${objectType}/batch/read`, - method: "POST", - ...opts, - }); + const MAX_RETRIES = 5; + const BASE_RETRY_DELAY = 500; + let success = false; + let retries = 0; + while (!success) { + try { + const response = await this.makeRequest({ + api: API_PATH.CRMV3, + endpoint: `/objects/${objectType}/batch/read`, + method: "POST", + ...opts, + }); + return response; + } catch (error) { + if (error.status === 429 && ++retries < MAX_RETRIES) { + const randomDelay = Math.floor(Math.random() * BASE_RETRY_DELAY); + const delay = BASE_RETRY_DELAY * (2 ** retries) + randomDelay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } else { + throw error; + } + } + } }, listNotes(opts = {}) { return this.makeRequest({ diff --git a/components/hubspot/package.json b/components/hubspot/package.json index 45fdd39ece6a8..cf0e6b86ce2ff 100644 --- a/components/hubspot/package.json +++ b/components/hubspot/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hubspot", - "version": "1.6.4", + "version": "1.7.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 6df5df5054b01..aa5837adc3a93 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.28", + version: "0.0.29", dedupe: "unique", type: "source", methods: { @@ -16,8 +16,7 @@ export default { }, generateMeta(blogpost) { const { - id, - name: summary, + id, name: summary, } = blogpost; const ts = Date.parse(blogpost.created); return { 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 fdd06978c51e2..f88a48845eaeb 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 @@ -6,8 +6,9 @@ export default { ...common, 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.21", + 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.22", dedupe: "unique", type: "source", props: { @@ -33,8 +34,7 @@ export default { }, generateMeta(company) { const { - id, - properties, + id, properties, } = company; const ts = this.getTs(company); return { @@ -97,10 +97,15 @@ export default { const propertyNames = properties.map((property) => property.name); if (!propertyNames.includes(this.property)) { - throw new Error(`Property "${this.property}" not supported for Companies. See Hubspot's default company properties documentation - https://knowledge.hubspot.com/companies/hubspot-crm-default-company-properties`); + throw new Error( + `Property "${this.property}" not supported for Companies. See Hubspot's default company properties documentation - https://knowledge.hubspot.com/companies/hubspot-crm-default-company-properties`, + ); } - const updatedCompanies = await this.getPaginatedItems(this.hubspot.searchCRM, params); + const updatedCompanies = await this.getPaginatedItems( + this.hubspot.searchCRM, + params, + ); if (!updatedCompanies.length) { return; 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 new file mode 100644 index 0000000000000..239797a0c6c5f --- /dev/null +++ b/components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs @@ -0,0 +1,266 @@ +import common from "../common/common.mjs"; +import { + DEFAULT_LIMIT, + DEFAULT_CONTACT_PROPERTIES, + API_PATH, +} from "../../common/constants.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "hubspot-new-contact-added-to-list", + 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.1", + type: "source", + dedupe: "unique", + props: { + ...common.props, + info: { + type: "alert", + alertType: "info", + content: `Properties:\n\`${DEFAULT_CONTACT_PROPERTIES.join(", ")}\``, + }, + listId: { + type: "string", + label: "List ID", + description: "Select the list to watch for new contacts", + withLabel: true, + async options({ page }) { + const { lists } = await this.searchLists({ + data: { + count: DEFAULT_LIMIT, + offset: page * DEFAULT_LIMIT, + }, + }); + return ( + lists?.map(({ + listId, name, + }) => ({ + value: listId, + label: name, + })) || [] + ); + }, + }, + properties: { + propDefinition: [ + common.props.hubspot, + "contactProperties", + () => ({ + excludeDefaultProperties: true, + }), + ], + label: "Additional contact properties to retrieve", + optional: true, + }, + }, + methods: { + ...common.methods, + _getKey(listId) { + return `list_${listId}_last_timestamp`; + }, + _getLastMembershipTimestamp(listId) { + return this.db.get(this._getKey(listId)); + }, + _setLastMembershipTimestamp(listId, timestamp) { + this.db.set(this._getKey(listId), timestamp); + }, + searchLists(opts = {}) { + return this.hubspot.makeRequest({ + api: API_PATH.CRMV3, + method: "POST", + endpoint: "/lists/search", + ...opts, + }); + }, + getTs() { + return Date.now(); + }, + generateMeta(membership, listInfo) { + const { + recordId, membershipTimestamp, + } = membership; + const ts = membershipTimestamp + ? new Date(membershipTimestamp).getTime() + : this.getTs(); + + return { + id: `${listInfo.listId}-${recordId}-${ts}`, + summary: `Contact ${recordId} added to list: ${listInfo.name}`, + ts, + }; + }, + async getContactDetails(contactIds) { + if (!contactIds.length) return {}; + + const { properties = [] } = this; + const allProperties = [ + ...DEFAULT_CONTACT_PROPERTIES, + ...properties, + ]; + + const chunks = []; + const chunkSize = 100; + for (let i = 0; i < contactIds.length; i += chunkSize) { + chunks.push(contactIds.slice(i, i + chunkSize)); + } + + const contactMap = {}; + + try { + for (const chunk of chunks) { + try { + const { results } = await this.hubspot.batchGetObjects({ + objectType: "contacts", + data: { + inputs: chunk.map((id) => ({ + id, + })), + properties: allProperties, + }, + }); + + results.forEach((contact) => { + contactMap[contact.id] = contact; + }); + } catch (error) { + console.warn( + `Error fetching contact details for chunk of ${chunk.length} contacts:`, + error, + ); + } + } + + return contactMap; + } catch (error) { + console.warn("Error processing contact details:", error); + return {}; + } + }, + async processListMemberships(listId, listInfo) { + const lastMembershipTimestamp = this._getLastMembershipTimestamp(listId); + const newMemberships = []; + + let params = { + limit: DEFAULT_LIMIT, + }; + + try { + let hasMore = true; + let latestMembershipTimestamp = lastMembershipTimestamp; + + if (!lastMembershipTimestamp) { + const baselineTimestamp = new Date().toISOString(); + this._setLastMembershipTimestamp(listId, baselineTimestamp); + return newMemberships; + } + + while (hasMore) { + const { + results, paging, + } = + await this.hubspot.getListMembershipsByJoinOrder({ + listId, + params, + }); + + if (!results) { + console.warn( + `No results returned from API for list ${listId} - possible API issue`, + ); + break; + } + + if (results.length === 0) { + break; + } + + for (const membership of results) { + const { membershipTimestamp } = membership; + + if (membershipTimestamp > lastMembershipTimestamp) { + newMemberships.push({ + membership, + listInfo, + }); + + if ( + !latestMembershipTimestamp || + membershipTimestamp > latestMembershipTimestamp + ) { + latestMembershipTimestamp = membershipTimestamp; + } + } + } + + if (paging?.next?.after) { + params.after = paging.next.after; + } else { + hasMore = false; + } + } + + if (latestMembershipTimestamp !== lastMembershipTimestamp) { + this._setLastMembershipTimestamp(listId, latestMembershipTimestamp); + } + } catch (error) { + console.error(`Error processing list ${listId}:`, error); + } + + return newMemberships; + }, + async processResults() { + if (!this.listId) { + console.warn("No list selected to monitor"); + return; + } + + const listId = this.listId?.value || this.listId; + + const listInfo = { + listId, + name: `List ${this.listId?.label || listId}`, + }; + + try { + const newMemberships = await this.processListMemberships( + listId, + listInfo, + ); + + if (newMemberships.length > 0) { + const contactIds = newMemberships.map( + ({ membership }) => membership.recordId, + ); + const contactDetails = await this.getContactDetails(contactIds); + + for (const { + membership, listInfo, + } of newMemberships) { + const contactDetail = contactDetails[membership.recordId] || {}; + + const eventData = { + listId: listInfo.listId, + listName: listInfo.name, + contactId: membership.recordId, + contact: contactDetail, + membership, + addedAt: membership.membershipTimestamp, + }; + + const meta = this.generateMeta(membership, listInfo); + this.$emit(eventData, meta); + } + } + } catch (error) { + console.error(`Error processing list ${listId}:`, error); + } + }, + getParams() { + return {}; + }, + }, + sampleEmit, +}; diff --git a/components/hubspot/sources/new-contact-added-to-list/test-event.mjs b/components/hubspot/sources/new-contact-added-to-list/test-event.mjs new file mode 100644 index 0000000000000..3db37fd1395cf --- /dev/null +++ b/components/hubspot/sources/new-contact-added-to-list/test-event.mjs @@ -0,0 +1,43 @@ +export default { + listId: "123456789", + listName: "List 123456789", + contactId: "31612976545", + contact: { + id: "31612976545", + properties: { + address: null, + annualrevenue: null, + city: "San Francisco", + company: "Acme Corp", + country: "United States", + createdate: "2024-08-26T15:30:45.123Z", + email: "john.doe@example.com", + fax: null, + firstname: "John", + hs_createdate: "2024-08-26T15:30:45.123Z", + hs_email_domain: "example.com", + hs_language: null, + hs_object_id: "31612976545", + hs_persona: null, + industry: "Technology", + jobtitle: "Software Engineer", + lastmodifieddate: "2024-08-26T15:32:15.456Z", + lastname: "Doe", + lifecyclestage: "lead", + mobilephone: null, + numemployees: null, + phone: "+1-555-123-4567", + salutation: null, + state: "California", + website: "https://example.com", + zip: "94102", + }, + createdAt: "2024-08-26T15:30:45.123Z", + updatedAt: "2024-08-26T15:32:15.456Z", + archived: false, + }, + membership: { + recordId: "31612976545", + }, + addedAt: "2024-08-26T15:35:20.789Z", +}; \ No newline at end of file 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 35dfac6b2d71b..7b1fa91ca50db 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 @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-new-contact-property-change", 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.23", + 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.24", dedupe: "unique", type: "source", props: { @@ -33,8 +34,7 @@ export default { }, generateMeta(contact) { const { - id, - properties, + id, properties, } = contact; const ts = this.getTs(contact); return { @@ -96,10 +96,15 @@ export default { const properties = await this.hubspot.getContactProperties(); const propertyNames = properties.map((property) => property.name); if (!propertyNames.includes(this.property)) { - throw new Error(`Property "${this.property}" not supported for Contacts. See Hubspot's default contact properties documentation - https://knowledge.hubspot.com/contacts/hubspots-default-contact-properties`); + throw new Error( + `Property "${this.property}" not supported for Contacts. See Hubspot's default contact properties documentation - https://knowledge.hubspot.com/contacts/hubspots-default-contact-properties`, + ); } - const updatedContacts = await this.getPaginatedItems(this.hubspot.searchCRM, params); + const updatedContacts = await this.getPaginatedItems( + this.hubspot.searchCRM, + params, + ); if (!updatedContacts.length) { return; 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 61d7c5cf8ce6c..49da904ba1049 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 @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-new-custom-object-property-change", 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.13", + description: + "Emit new event when a specified property is provided or updated on a custom object.", + version: "0.0.14", dedupe: "unique", type: "source", props: { @@ -38,8 +39,7 @@ export default { }, generateMeta(object) { const { - id, - properties, + id, properties, } = object; const ts = this.getTs(object); return { @@ -102,10 +102,15 @@ export default { const propertyNames = properties.map((property) => property.name); if (!propertyNames.includes(this.property)) { - throw new Error(`Property "${this.property}" not supported for custom object ${this.objectSchema}.`); + throw new Error( + `Property "${this.property}" not supported for custom object ${this.objectSchema}.`, + ); } - const updatedObjects = await this.getPaginatedItems(this.hubspot.searchCRM, params); + const updatedObjects = await this.getPaginatedItems( + this.hubspot.searchCRM, + params, + ); if (!updatedObjects.length) { return; 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 3fdbb80172419..9ed00e01bed42 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 @@ -11,7 +11,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.0.34", + version: "0.0.35", dedupe: "unique", type: "source", props: { @@ -45,8 +45,7 @@ export default { }, emitEvent(deal, ts) { const { - id, - properties, + id, properties, } = deal; this.$emit(deal, { id: `${id}${properties.dealstage}`, @@ -103,7 +102,9 @@ export default { const ts = await this.getTs(deal); if (this.isRelevant(ts, after)) { if (deal.properties.hubspot_owner_id) { - deal.properties.owner = await this.getOwner(deal.properties.hubspot_owner_id); + deal.properties.owner = await this.getOwner( + deal.properties.hubspot_owner_id, + ); } this.emitEvent(deal, ts); if (ts > maxTs) { 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 0f5ee2b0894e4..57635cf858a74 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 @@ -6,8 +6,9 @@ export default { ...common, 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.22", + 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.23", dedupe: "unique", type: "source", props: { @@ -93,10 +94,15 @@ export default { const properties = await this.hubspot.getDealProperties(); const propertyNames = properties.map((property) => property.name); if (!propertyNames.includes(this.property)) { - throw new Error(`Property "${this.property}" not supported for Deals. See Hubspot's default deal properties documentation - https://knowledge.hubspot.com/crm-deals/hubspots-default-deal-properties`); + throw new Error( + `Property "${this.property}" not supported for Deals. See Hubspot's default deal properties documentation - https://knowledge.hubspot.com/crm-deals/hubspots-default-deal-properties`, + ); } - const updatedDeals = await this.getPaginatedItems(this.hubspot.searchCRM, params); + const updatedDeals = await this.getPaginatedItems( + this.hubspot.searchCRM, + params, + ); if (!updatedDeals.length) { return; 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 6d16adbafe85e..32e7c112e5e68 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.31", + version: "0.0.32", dedupe: "unique", type: "source", props: { @@ -28,9 +28,7 @@ export default { }, generateMeta(emailEvent) { const { - id, - recipient, - type, + id, recipient, type, } = emailEvent; const ts = this.getTs(emailEvent); return { 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 6fab02050f1b1..e14902e6396d7 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 @@ -5,8 +5,9 @@ export default { ...common, 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.28", + description: + "Emit new event when a new email timeline subscription is added for the portal.", + version: "0.0.29", 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 15568c3a2b7a3..ebbc27993edb3 100644 --- a/components/hubspot/sources/new-engagement/new-engagement.mjs +++ b/components/hubspot/sources/new-engagement/new-engagement.mjs @@ -7,8 +7,9 @@ export default { ...common, 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.33", + 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.34", dedupe: "unique", type: "source", props: { @@ -28,8 +29,7 @@ export default { }, generateMeta(engagement) { const { - id, - type, + id, type, } = engagement.engagement; const ts = this.getTs(engagement); return { diff --git a/components/hubspot/sources/new-event/new-event.mjs b/components/hubspot/sources/new-event/new-event.mjs index 3a89f6b53b08e..d3eb366352cfa 100644 --- a/components/hubspot/sources/new-event/new-event.mjs +++ b/components/hubspot/sources/new-event/new-event.mjs @@ -7,8 +7,9 @@ export default { ...common, 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.32", + 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.33", dedupe: "unique", type: "source", props: { @@ -38,9 +39,10 @@ export default { objectId: this.objectIds[0], }, }); - } - catch { - throw new ConfigurationError("Error occurred. Please verify that your Hubspot account is one of: Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise"); + } catch { + throw new ConfigurationError( + "Error occurred. Please verify that your Hubspot account is one of: Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise", + ); } }, }, @@ -51,8 +53,7 @@ export default { }, generateMeta(result) { const { - id, - eventType, + id, eventType, } = result; return { id, 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 b3fe863b02ff1..7be00798effd4 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.33", + version: "0.0.34", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-note/new-note.mjs b/components/hubspot/sources/new-note/new-note.mjs index 9ad0f2f457c47..70beb99f2f757 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.9", + version: "1.0.10", 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 702d599935cbb..136c748b5a45a 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.15", + version: "0.0.16", dedupe: "unique", type: "source", props: { @@ -29,8 +29,7 @@ export default { }, generateMeta(blogpost) { const { - id, - name: summary, + id, name: summary, } = blogpost; const ts = this.getTs(blogpost); return { 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 7e7367aa11283..a0925a0acb961 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.15", + version: "0.0.16", dedupe: "unique", type: "source", props: { @@ -47,8 +47,7 @@ export default { }, generateMeta(company) { const { - id, - properties, + id, properties, } = company; const ts = this.getTs(company); return { 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 56ea8e17311a4..e2a89562cd52c 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.16", + version: "0.0.17", 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 3d4a9c48982fd..c77cc3de920f8 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 @@ -6,8 +6,9 @@ export default { ...common, 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.28", + description: + "Emit new event each time a CRM Object of the specified object type is updated.", + version: "0.0.29", dedupe: "unique", type: "source", props: { @@ -40,9 +41,10 @@ export default { return null; }, getObjectParams(object) { - const propertyName = (object == "contacts") - ? "lastmodifieddate" - : "hs_lastmodifieddate"; + const propertyName = + object == "contacts" + ? "lastmodifieddate" + : "hs_lastmodifieddate"; return { data: { limit: DEFAULT_LIMIT, @@ -57,9 +59,10 @@ export default { }; }, async processResults(after) { - const object = (this.objectType == "company") - ? "companies" - : `${this.objectType}s`; + const object = + this.objectType == "company" + ? "companies" + : `${this.objectType}s`; const params = this.getObjectParams(object); await this.searchCRM(params, after); }, 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 2c5f690460d12..9d951e5eb288c 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 @@ -6,8 +6,9 @@ export default { ...common, 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.17", + description: + "Emit new event each time a Custom Object of the specified schema is updated.", + version: "0.0.18", 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 c0a4848aabbae..1398f76528aa3 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.15", + version: "0.0.16", dedupe: "unique", type: "source", props: { @@ -68,8 +68,7 @@ export default { }, generateMeta(deal) { const { - id, - properties, + id, properties, } = deal; const ts = this.getTs(deal); return { 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 ff0391a095242..0b4b3a76f09ce 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 @@ -1,5 +1,6 @@ import { - DEFAULT_LIMIT, DEFAULT_LINE_ITEM_PROPERTIES, + DEFAULT_LIMIT, + DEFAULT_LINE_ITEM_PROPERTIES, } from "../../common/constants.mjs"; import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; @@ -8,8 +9,9 @@ export default { ...common, 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.15", + description: + "Emit new event for each new line item added or updated in Hubspot.", + version: "0.0.16", 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 1fb6cdec7e791..3ec83022a5a32 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 @@ -1,5 +1,6 @@ import { - DEFAULT_LIMIT, DEFAULT_PRODUCT_PROPERTIES, + DEFAULT_LIMIT, + DEFAULT_PRODUCT_PROPERTIES, } from "../../common/constants.mjs"; import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; @@ -9,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.15", + version: "0.0.16", dedupe: "unique", type: "source", props: { @@ -46,8 +47,7 @@ export default { }, generateMeta(product) { const { - id, - properties, + id, properties, } = product; const ts = this.getTs(product); return { 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 ee46f6c5a3be5..33332bc052699 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 @@ -5,8 +5,9 @@ export default { ...common, key: "hubspot-new-social-media-message", 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.28", + 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.29", type: "source", dedupe: "unique", props: { @@ -25,8 +26,7 @@ export default { }, generateMeta(message) { const { - broadcastGuid: id, - messageText: summary, + broadcastGuid: id, messageText: summary, } = message; const ts = this.getTs(message); return { diff --git a/components/hubspot/sources/new-task/new-task.mjs b/components/hubspot/sources/new-task/new-task.mjs index 5aba5bb8779a6..dabdf8cda7892 100644 --- a/components/hubspot/sources/new-task/new-task.mjs +++ b/components/hubspot/sources/new-task/new-task.mjs @@ -7,8 +7,9 @@ export default { ...common, key: "hubspot-new-task", 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.9", + 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.10", type: "source", dedupe: "unique", methods: { @@ -34,7 +35,9 @@ export default { const objectTypes = OBJECT_TYPES.map(({ value }) => value); const { results: custom } = await this.hubspot.listSchemas(); - const customObjects = custom?.map(({ fullyQualifiedName }) => fullyQualifiedName); + const customObjects = custom?.map( + ({ fullyQualifiedName }) => fullyQualifiedName, + ); const associations = [ ...objectTypes, ...customObjects, @@ -49,7 +52,10 @@ export default { }; }, async processResults(after, params) { - const tasks = await this.getPaginatedItems(this.hubspot.listTasks.bind(this), params); + const tasks = await this.getPaginatedItems( + this.hubspot.listTasks.bind(this), + params, + ); await this.processEvents(tasks, after); }, }, 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 e6c7ac9297d0a..2288b15cb6f29 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 @@ -6,8 +6,9 @@ export default { ...common, key: "hubspot-new-ticket-property-change", 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.22", + 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.23", dedupe: "unique", type: "source", props: { @@ -33,8 +34,7 @@ export default { }, generateMeta(ticket) { const { - id, - properties, + id, properties, } = ticket; const ts = this.getTs(ticket); return { @@ -97,10 +97,15 @@ export default { const propertyNames = properties.map((property) => property.name); if (!propertyNames.includes(this.property)) { - throw new Error(`Property "${this.property}" not supported for Tickets. See Hubspot's default ticket properties documentation - https://knowledge.hubspot.com/tickets/hubspots-default-ticket-properties`); + throw new Error( + `Property "${this.property}" not supported for Tickets. See Hubspot's default ticket properties documentation - https://knowledge.hubspot.com/tickets/hubspots-default-ticket-properties`, + ); } - const updatedTickets = await this.getPaginatedItems(this.hubspot.searchCRM, params); + const updatedTickets = await this.getPaginatedItems( + this.hubspot.searchCRM, + params, + ); if (!updatedTickets.length) { return; diff --git a/components/hubspot/sources/new-ticket/new-ticket.mjs b/components/hubspot/sources/new-ticket/new-ticket.mjs index bd32f8a60d190..2f6b128650f88 100644 --- a/components/hubspot/sources/new-ticket/new-ticket.mjs +++ b/components/hubspot/sources/new-ticket/new-ticket.mjs @@ -1,5 +1,6 @@ import { - DEFAULT_LIMIT, DEFAULT_TICKET_PROPERTIES, + DEFAULT_LIMIT, + DEFAULT_TICKET_PROPERTIES, } from "../../common/constants.mjs"; import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; @@ -9,7 +10,7 @@ export default { key: "hubspot-new-ticket", name: "New Ticket", description: "Emit new event for each new ticket created.", - version: "0.0.28", + version: "0.0.29", dedupe: "unique", type: "source", props: { @@ -37,8 +38,7 @@ export default { }, generateMeta(ticket) { const { - id, - properties, + id, properties, } = ticket; const ts = this.getTs(ticket); return { diff --git a/components/postnl/postnl.app.mjs b/components/postnl/postnl.app.mjs index dcba1ab50ce9a..efc95ec9e218a 100644 --- a/components/postnl/postnl.app.mjs +++ b/components/postnl/postnl.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/questdb/questdb.app.mjs b/components/questdb/questdb.app.mjs index 0f0060461c772..bf82219646cba 100644 --- a/components/questdb/questdb.app.mjs +++ b/components/questdb/questdb.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +};