diff --git a/components/apify_oauth/apify_oauth.app.mjs b/components/apify_oauth/apify_oauth.app.mjs index cd51fd16f746b..e829abd708582 100644 --- a/components/apify_oauth/apify_oauth.app.mjs +++ b/components/apify_oauth/apify_oauth.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 24507a0654538..836cb873db1a0 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.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 dd0886d550fce..2645af55b26d3 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 @@ -4,7 +4,7 @@ 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.19", + version: "0.0.20", type: "action", props: { hubspot, 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 d7e56551187ea..99832a49f8a63 100644 --- a/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs +++ b/components/hubspot/actions/batch-create-companies/batch-create-companies.mjs @@ -1,13 +1,13 @@ -import hubspot from "../../hubspot.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; import { API_PATH } from "../../common/constants.mjs"; import { parseObject } from "../../common/utils.mjs"; -import { ConfigurationError } from "@pipedream/platform"; +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.2", + version: "0.0.3", type: "action", props: { hubspot, 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 e00b217f1c1bf..ed1993f0ba397 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 @@ -4,7 +4,7 @@ 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.16", + version: "0.0.17", type: "action", props: { hubspot, 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 4c48deec7bd08..edffce8bf3364 100644 --- a/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs +++ b/components/hubspot/actions/batch-update-companies/batch-update-companies.mjs @@ -1,13 +1,13 @@ -import hubspot from "../../hubspot.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; import { API_PATH } from "../../common/constants.mjs"; import { parseObject } from "../../common/utils.mjs"; -import { ConfigurationError } from "@pipedream/platform"; +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.2", + version: "0.0.3", type: "action", props: { hubspot, 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 8ed00efd8bc77..a43e258e1c4b1 100644 --- a/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs +++ b/components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs @@ -1,13 +1,13 @@ -import hubspot from "../../hubspot.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; import { API_PATH } from "../../common/constants.mjs"; import { parseObject } from "../../common/utils.mjs"; -import { ConfigurationError } from "@pipedream/platform"; +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.2", + version: "0.0.3", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/clone-email/clone-email.mjs b/components/hubspot/actions/clone-email/clone-email.mjs new file mode 100644 index 0000000000000..8181bc9cc3b29 --- /dev/null +++ b/components/hubspot/actions/clone-email/clone-email.mjs @@ -0,0 +1,46 @@ +import { LANGUAGE_OPTIONS } from "../../common/constants.mjs"; +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.1", + type: "action", + props: { + hubspot, + emailId: { + propDefinition: [ + hubspot, + "emailId", + ], + }, + cloneName: { + type: "string", + label: "Clone Name", + description: "The name to assign to the cloned email", + optional: true, + }, + language: { + type: "string", + label: "Language", + description: "The language code for the cloned email", + options: LANGUAGE_OPTIONS, + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.cloneEmail({ + $, + data: { + cloneName: this.cloneName, + language: this.language, + id: this.emailId, + }, + }); + + $.export("$summary", `Successfully cloned email with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/actions/clone-site-page/clone-site-page.mjs b/components/hubspot/actions/clone-site-page/clone-site-page.mjs new file mode 100644 index 0000000000000..a0fff339613d6 --- /dev/null +++ b/components/hubspot/actions/clone-site-page/clone-site-page.mjs @@ -0,0 +1,36 @@ +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.1", + type: "action", + props: { + hubspot, + pageId: { + propDefinition: [ + hubspot, + "pageId", + ], + }, + cloneName: { + type: "string", + label: "Clone Name", + description: "The name of the cloned page.", + }, + }, + async run({ $ }) { + const response = await this.hubspot.cloneSitePage({ + $, + data: { + id: this.pageId, + cloneName: this.cloneName, + }, + }); + + $.export("$summary", `Successfully cloned site page with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/actions/common/common-page-prop.mjs b/components/hubspot/actions/common/common-page-prop.mjs new file mode 100644 index 0000000000000..de1dce9727dfa --- /dev/null +++ b/components/hubspot/actions/common/common-page-prop.mjs @@ -0,0 +1,79 @@ +import { LANGUAGE_OPTIONS } from "../../common/constants.mjs"; +import hubspot from "../../hubspot.app.mjs"; + +export default { + language: { + type: "string", + label: "Language", + description: "The language of the page.", + options: LANGUAGE_OPTIONS, + optional: true, + }, + enableLayoutStylesheets: { + type: "boolean", + label: "Enable Layout Stylesheets", + description: "Whether to enable layout stylesheets.", + optional: true, + }, + metaDescription: { + type: "string", + label: "Meta Description", + description: "The meta description of the page.", + optional: true, + }, + attachedStylesheets: { + type: "string[]", + label: "Attached Stylesheets", + description: "The stylesheets attached to the page.", + optional: true, + }, + password: { + type: "string", + label: "Password", + description: "The password of the page.", + optional: true, + }, + publishImmediately: { + type: "boolean", + label: "Publish Immediately", + description: "Whether to publish the page immediately.", + optional: true, + }, + htmlTitle: { + type: "string", + label: "HTML Title", + description: "The HTML title of the page.", + optional: true, + }, + translations: { + type: "object", + label: "Translations", + description: "The translations of the page.", + optional: true, + }, + layoutSections: { + type: "object", + label: "Layout Sections", + description: "The layout sections of the page.", + optional: true, + }, + footerHtml: { + type: "string", + label: "Footer HTML", + description: "The footer HTML of the page.", + optional: true, + }, + headHtml: { + type: "string", + label: "Head HTML", + description: "The head HTML of the page.", + optional: true, + }, + templatePath: { + propDefinition: [ + hubspot, + "templatePath", + ], + optional: true, + }, +}; diff --git a/components/hubspot/actions/create-associations/create-associations.mjs b/components/hubspot/actions/create-associations/create-associations.mjs index d0e8bb03a5276..037f4bbf89907 100644 --- a/components/hubspot/actions/create-associations/create-associations.mjs +++ b/components/hubspot/actions/create-associations/create-associations.mjs @@ -1,11 +1,11 @@ -import hubspot from "../../hubspot.app.mjs"; import { ConfigurationError } from "@pipedream/platform"; +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.5", + version: "1.0.6", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/create-communication/create-communication.mjs b/components/hubspot/actions/create-communication/create-communication.mjs index 4944a37406b40..3be3e5e295365 100644 --- a/components/hubspot/actions/create-communication/create-communication.mjs +++ b/components/hubspot/actions/create-communication/create-communication.mjs @@ -1,14 +1,14 @@ -import common from "../common/common-create.mjs"; -import appProp from "../common/common-app-prop.mjs"; import { ConfigurationError } from "@pipedream/platform"; import { ASSOCIATION_CATEGORY } from "../../common/constants.mjs"; +import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-create.mjs"; 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.12", + version: "0.0.13", type: "action", props: { ...appProp.props, diff --git a/components/hubspot/actions/create-company/create-company.mjs b/components/hubspot/actions/create-company/create-company.mjs index a37bd9cd80e91..e6bfb73f6547f 100644 --- a/components/hubspot/actions/create-company/create-company.mjs +++ b/components/hubspot/actions/create-company/create-company.mjs @@ -6,7 +6,7 @@ export default { 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.23", + version: "0.0.24", 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 new file mode 100644 index 0000000000000..84d7394417ad6 --- /dev/null +++ b/components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs @@ -0,0 +1,164 @@ +import { parseObject } from "../../common/utils.mjs"; +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.1", + type: "action", + props: { + hubspot, + canEnrollFromSalesforce: { + type: "boolean", + label: "Can Enroll From Salesforce", + description: "Whether the contact workflow can enroll from Salesforce", + optional: true, + }, + isEnabled: { + type: "boolean", + label: "Is Enabled", + description: "Whether the contact workflow is enabled", + optional: true, + }, + flowType: { + type: "string", + label: "Flow Type", + description: "The type of flow", + options: [ + "WORKFLOW", + "ACTION_SET", + "UNKNOWN", + ], + optional: true, + }, + name: { + type: "string", + label: "Name", + description: "The name of the contact workflow", + optional: true, + }, + description: { + type: "string", + label: "Description", + description: "The description of the contact workflow", + optional: true, + }, + uuid: { + type: "string", + label: "UUID", + description: "The UUID of the contact workflow", + optional: true, + }, + startAction: { + type: "string", + label: "Start Action", + description: "The start action of the contact workflow", + optional: true, + }, + actions: { + type: "string[]", + label: "Actions", + description: "The actions of the contact workflow", + options: [ + "STATIC_BRANCH", + "LIST_BRANCH", + "AB_TEST_BRANCH", + "CUSTOM_CODE", + "WEBHOOK", + "SINGLE_CONNECTION", + ], + optional: true, + }, + 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.", + 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.", + 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.", + 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.", + 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.", + 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.", + 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.", + 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.", + 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.", + 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.", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hubspot.createContactWorkflow({ + $, + data: { + type: "CONTACT_FLOW", + canEnrollFromSalesforce: this.canEnrollFromSalesforce, + isEnabled: this.isEnabled, + flowType: this.flowType, + name: this.name, + description: this.description, + uuid: this.uuid, + startAction: this.startAction, + actions: parseObject(this.actions), + enrollmentCriteria: parseObject(this.enrollmentCriteria), + enrollmentSchedule: parseObject(this.enrollmentSchedule), + timeWindows: parseObject(this.timeWindows), + blockedDates: parseObject(this.blockedDates), + customProperties: parseObject(this.customProperties), + dataSources: parseObject(this.dataSources), + suppressionListIds: parseObject(this.suppressionListIds), + goalFilterBranch: parseObject(this.goalFilterBranch), + eventAnchor: parseObject(this.eventAnchor), + unEnrollmentSetting: parseObject(this.unEnrollmentSetting), + }, + }); + + $.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 f6ce819191a65..41ce1ea29c95c 100644 --- a/components/hubspot/actions/create-custom-object/create-custom-object.mjs +++ b/components/hubspot/actions/create-custom-object/create-custom-object.mjs @@ -1,12 +1,12 @@ -import common from "../common/common-create-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-create-object.mjs"; 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.5", + version: "1.0.6", 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 00ededc13773d..95ebf560f67f7 100644 --- a/components/hubspot/actions/create-deal/create-deal.mjs +++ b/components/hubspot/actions/create-deal/create-deal.mjs @@ -6,7 +6,7 @@ export default { 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.23", + version: "0.0.24", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/create-email/create-email.mjs b/components/hubspot/actions/create-email/create-email.mjs new file mode 100644 index 0000000000000..f465a065cc950 --- /dev/null +++ b/components/hubspot/actions/create-email/create-email.mjs @@ -0,0 +1,169 @@ +import { + LANGUAGE_OPTIONS, OBJECT_TYPE, +} from "../../common/constants.mjs"; +import { parseObject } from "../../common/utils.mjs"; +import hubspot from "../../hubspot.app.mjs"; +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.1", + type: "action", + props: { + hubspot, + name: { + type: "string", + label: "Name", + description: "The name of the email", + }, + campaign: { + propDefinition: [ + hubspot, + "campaignId", + ], + optional: true, + }, + customReplyTo: { + type: "string", + label: "Custom Reply To", + description: "The custom reply to address for the email", + optional: true, + }, + fromName: { + type: "string", + label: "From Name", + description: "The name of the sender", + optional: true, + }, + replyTo: { + type: "string", + label: "Reply To", + description: "The reply to address for the email", + optional: true, + }, + limitSendFrequency: { + type: "boolean", + label: "Limit Send Frequency", + description: "Whether to limit the send frequency for the email", + optional: true, + }, + suppressGraymail: { + type: "boolean", + label: "Suppress Graymail", + description: "Whether to suppress graymail for the email", + optional: true, + }, + includeContactLists: { + propDefinition: [ + hubspot, + "lists", + ], + optional: true, + }, + excludeContactLists: { + propDefinition: [ + hubspot, + "lists", + ], + optional: true, + }, + feedbackSurveyId: { + ...common.props.objectId, + label: "Feedback Survey ID", + description: "Hubspot's internal ID for the feedback survey", + optional: true, + }, + 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.", + optional: true, + }, + subject: { + type: "string", + label: "Subject", + description: "The subject of the email", + optional: true, + }, + 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.", + optional: true, + }, + language: { + type: "string", + label: "Language", + description: "The language of the email", + options: LANGUAGE_OPTIONS, + optional: true, + }, + 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.", + 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.", + 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.", + optional: true, + }, + sendOnPublish: { + type: "boolean", + label: "Send On Publish", + description: "Whether to send the email on publish", + optional: true, + }, + }, + methods: { + ...common.methods, + getObjectType() { + return OBJECT_TYPE.FEEDBACK_SUBMISSION; + }, + }, + async run({ $ }) { + const response = await this.hubspot.createEmail({ + $, + data: { + name: this.name, + campaign: this.campaign, + from: { + customReplyTo: this.customReplyTo, + fromName: this.fromName, + replyTo: this.replyTo, + }, + to: { + limitSendFrequency: this.limitSendFrequency, + suppressGraymail: this.suppressGraymail, + contactLists: { + include: parseObject(this.includeContactLists), + exclude: parseObject(this.excludeContactLists), + }, + }, + feedbackSurveyId: this.feedbackSurveyId, + rssData: parseObject(this.rssData), + subject: this.subject, + testing: parseObject(this.testing), + language: this.language, + content: parseObject(this.content), + webversion: parseObject(this.webversion), + subscriptionDetails: parseObject(this.subscriptionDetails), + sendOnPublish: this.sendOnPublish, + }, + }); + + $.export("$summary", `Successfully created email with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/actions/create-engagement/create-engagement.mjs b/components/hubspot/actions/create-engagement/create-engagement.mjs index f146dc1b8f6a4..1c1e5a83a6294 100644 --- a/components/hubspot/actions/create-engagement/create-engagement.mjs +++ b/components/hubspot/actions/create-engagement/create-engagement.mjs @@ -1,15 +1,15 @@ -import common from "../common/common-create.mjs"; import { ConfigurationError } from "@pipedream/platform"; import { ASSOCIATION_CATEGORY, ENGAGEMENT_TYPE_OPTIONS, } from "../../common/constants.mjs"; +import common from "../common/common-create.mjs"; 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.22", + version: "0.0.23", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/create-form/create-form.mjs b/components/hubspot/actions/create-form/create-form.mjs new file mode 100644 index 0000000000000..5dca5860f6fe6 --- /dev/null +++ b/components/hubspot/actions/create-form/create-form.mjs @@ -0,0 +1,341 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { LANGUAGE_OPTIONS } from "../../common/constants.mjs"; +import { + cleanObject, parseObject, +} from "../../common/utils.mjs"; +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.1", + type: "action", + props: { + hubspot, + name: { + type: "string", + label: "Name", + description: "The name of the form.", + }, + archived: { + type: "boolean", + label: "Archived", + description: "Whether the form is archived.", + optional: true, + }, + 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.", + 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.", + optional: true, + }, + editable: { + type: "boolean", + label: "Editable", + description: "Whether the form can be edited.", + optional: true, + }, + 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.", + 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.", + 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.", + options: [ + "thank_you", + "redirect_url", + ], + optional: true, + }, + postSubmitActionValue: { + type: "string", + label: "Post Submit Action Value", + description: "The thank you text or the page to redirect to.", + optional: true, + }, + language: { + type: "string", + label: "Language", + description: "The language of the form.", + options: LANGUAGE_OPTIONS, + optional: true, + }, + 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.", + optional: true, + }, + cloneable: { + type: "boolean", + label: "Cloneable", + description: "Whether the form can be cloned.", + optional: true, + }, + notifyContactOwner: { + type: "boolean", + label: "Notify Contact Owner", + description: "Whether to send a notification email to the contact owner when a submission is received.", + optional: true, + }, + recaptchaEnabled: { + type: "boolean", + label: "Recaptcha Enabled", + description: "Whether CAPTCHA (spam prevention) is enabled.", + optional: true, + }, + archivable: { + type: "boolean", + label: "Archivable", + description: "Whether the form can be archived.", + optional: true, + }, + notifyRecipients: { + propDefinition: [ + hubspot, + "contactEmail", + ], + type: "string[]", + optional: true, + }, + renderRawHtml: { + type: "boolean", + label: "Render Raw HTML", + description: "Whether the form will render as raw HTML as opposed to inside an iFrame.", + optional: true, + }, + cssClass: { + type: "string", + label: "CSS Class", + description: "The CSS class of the form.", + optional: true, + }, + 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.", + options: [ + "default_style", + "canvas", + "linear", + "round", + "sharp", + "legacy", + ], + optional: true, + }, + submitButtonText: { + type: "string", + label: "Submit Button Text", + description: "The text displayed on the form submit button.", + optional: true, + }, + labelTextSize: { + type: "string", + label: "Label Text Size", + description: "The size of the label text.", + optional: true, + }, + legalConsentTextColor: { + type: "string", + label: "Legal Consent Text Color", + description: "The color of the legal consent text.", + optional: true, + }, + fontFamily: { + type: "string", + label: "Font Family", + description: "The font family of the form.", + optional: true, + }, + legalConsentTextSize: { + type: "string", + label: "Legal Consent Text Size", + description: "The size of the legal consent text.", + optional: true, + }, + backgroundWidth: { + type: "string", + label: "Background Width", + description: "The width of the background.", + optional: true, + }, + helpTextSize: { + type: "string", + label: "Help Text Size", + description: "The size of the help text.", + optional: true, + }, + submitFontColor: { + type: "string", + label: "Submit Font Color", + description: "The color of the submit font.", + optional: true, + }, + labelTextColor: { + type: "string", + label: "Label Text Color", + description: "The color of the label text.", + optional: true, + }, + submitAlignment: { + type: "string", + label: "Submit Alignment", + description: "The alignment of the submit button.", + options: [ + "left", + "center", + "right", + ], + optional: true, + }, + submitSize: { + type: "string", + label: "Submit Size", + description: "The size of the submit button.", + optional: true, + }, + helpTextColor: { + type: "string", + label: "Help Text Color", + description: "The color of the help text.", + optional: true, + }, + submitColor: { + type: "string", + label: "Submit Color", + description: "The color of the submit button.", + optional: true, + }, + legalConsentOptionsType: { + type: "string", + label: "Legal Consent Options Type", + description: "The type of legal consent options.", + options: [ + "none", + "legitimate_interest", + "explicit_consent_process", + "implicit_consent_process", + ], + optional: true, + }, + 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.", + optional: true, + }, + }, + async run({ $ }) { + const configuration = {}; + if ( + (this.postSubmitActionType && !this.postSubmitActionValue) || + (!this.postSubmitActionType && this.postSubmitActionValue) + ) { + throw new ConfigurationError("Post Submit Action Type and Value must be provided together."); + } + + if (this.language) { + configuration.language = this.language; + } + if (this.cloneable) { + configuration.cloneable = this.cloneable; + } + if (this.postSubmitActionType) { + configuration.postSubmitAction = { + type: this.postSubmitActionType, + value: this.postSubmitActionValue, + }; + } + if (this.editable) { + configuration.editable = this.editable; + } + if (this.archivable) { + configuration.archivable = this.archivable; + } + if (this.recaptchaEnabled) { + configuration.recaptchaEnabled = this.recaptchaEnabled; + } + if (this.notifyContactOwner) { + configuration.notifyContactOwner = this.notifyContactOwner; + } + if (this.notifyRecipients) { + configuration.notifyRecipients = parseObject(this.notifyRecipients); + } + if (this.createNewContactForNewEmail) { + configuration.createNewContactForNewEmail = this.createNewContactForNewEmail; + } + if (this.prePopulateKnownValues) { + configuration.prePopulateKnownValues = this.prePopulateKnownValues; + } + if (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, + }, + }, + "legalConsentOptions": { + "type": this.legalConsentOptionsType, + ...(this.legalConsentOptionsObject + ? parseObject(this.legalConsentOptionsObject) + : {}), + }, + }); + + data.configuration = cleanObject(configuration); + + const response = await this.hubspot.createForm({ + $, + data, + }); + + $.export("$summary", `Successfully created form with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/actions/create-landing-page/create-landing-page.mjs b/components/hubspot/actions/create-landing-page/create-landing-page.mjs new file mode 100644 index 0000000000000..b606de61da493 --- /dev/null +++ b/components/hubspot/actions/create-landing-page/create-landing-page.mjs @@ -0,0 +1,53 @@ +import { parseObject } from "../../common/utils.mjs"; +import hubspot from "../../hubspot.app.mjs"; +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.1", + type: "action", + props: { + hubspot, + pageName: { + propDefinition: [ + hubspot, + "pageName", + ], + }, + landingFolderId: { + propDefinition: [ + hubspot, + "landingFolderId", + ], + optional: true, + }, + ...commonPageProp, + }, + async run({ $ }) { + const response = await this.hubspot.createLandingPage({ + $, + data: { + language: this.language, + enableLayoutStylesheets: this.enableLayoutStylesheets, + metaDescription: this.metaDescription, + attachedStylesheets: parseObject(this.attachedStylesheets), + password: this.password, + publishImmediately: this.publishImmediately, + htmlTitle: this.htmlTitle, + translations: parseObject(this.translations), + folderId: this.landingFolderId, + name: this.pageName, + layoutSections: parseObject(this.layoutSections), + footerHtml: this.footerHtml, + headHtml: this.headHtml, + templatePath: this.templatePath, + }, + }); + + $.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 152f9f7d75d35..e093d21584cab 100644 --- a/components/hubspot/actions/create-lead/create-lead.mjs +++ b/components/hubspot/actions/create-lead/create-lead.mjs @@ -1,15 +1,16 @@ import { - OBJECT_TYPE, ASSOCIATION_CATEGORY, + ASSOCIATION_CATEGORY, + OBJECT_TYPE, } from "../../common/constants.mjs"; -import common from "../common/common-create-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-create-object.mjs"; 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.11", + version: "0.0.12", 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 8b555b96f3f62..7ceff032efaac 100644 --- a/components/hubspot/actions/create-meeting/create-meeting.mjs +++ b/components/hubspot/actions/create-meeting/create-meeting.mjs @@ -1,16 +1,16 @@ /* eslint-disable no-unused-vars */ -import common from "../common/common-create.mjs"; import { ConfigurationError } from "@pipedream/platform"; import { ASSOCIATION_CATEGORY, OBJECT_TYPE, } from "../../common/constants.mjs"; +import common from "../common/common-create.mjs"; 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.4", + version: "0.0.5", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/create-note/create-note.mjs b/components/hubspot/actions/create-note/create-note.mjs index 26745c941f06e..d4cf78ac25c4b 100644 --- a/components/hubspot/actions/create-note/create-note.mjs +++ b/components/hubspot/actions/create-note/create-note.mjs @@ -1,13 +1,13 @@ -import common from "../common/common-create.mjs"; import { ConfigurationError } from "@pipedream/platform"; import { ASSOCIATION_CATEGORY } from "../../common/constants.mjs"; +import common from "../common/common-create.mjs"; 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.3", + version: "0.0.4", type: "action", props: { ...common.props, 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 57e6a9541b549..cb3e134f8edad 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 @@ -6,7 +6,7 @@ export default { 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.21", + version: "0.0.22", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/create-page/create-page.mjs b/components/hubspot/actions/create-page/create-page.mjs new file mode 100644 index 0000000000000..a9157c90d4837 --- /dev/null +++ b/components/hubspot/actions/create-page/create-page.mjs @@ -0,0 +1,45 @@ +import { parseObject } from "../../common/utils.mjs"; +import hubspot from "../../hubspot.app.mjs"; +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.1", + type: "action", + props: { + hubspot, + pageName: { + propDefinition: [ + hubspot, + "pageName", + ], + }, + ...commonPageProp, + }, + async run({ $ }) { + const response = await this.hubspot.createPage({ + $, + data: { + language: this.language, + enableLayoutStylesheets: this.enableLayoutStylesheets, + metaDescription: this.metaDescription, + attachedStylesheets: parseObject(this.attachedStylesheets), + password: this.password, + publishImmediately: this.publishImmediately, + htmlTitle: this.htmlTitle, + translations: parseObject(this.translations), + name: this.pageName, + layoutSections: parseObject(this.layoutSections), + footerHtml: this.footerHtml, + headHtml: this.headHtml, + templatePath: this.templatePath, + }, + }); + + $.export("$summary", `Successfully created page with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/actions/create-task/create-task.mjs b/components/hubspot/actions/create-task/create-task.mjs index 5ed45c0b23f5d..bd6d7bc2634d7 100644 --- a/components/hubspot/actions/create-task/create-task.mjs +++ b/components/hubspot/actions/create-task/create-task.mjs @@ -1,13 +1,13 @@ -import common from "../common/common-create.mjs"; import { ConfigurationError } from "@pipedream/platform"; import { ASSOCIATION_CATEGORY } from "../../common/constants.mjs"; +import common from "../common/common-create.mjs"; 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.4", + version: "0.0.5", type: "action", props: { ...common.props, diff --git a/components/hubspot/actions/create-ticket/create-ticket.mjs b/components/hubspot/actions/create-ticket/create-ticket.mjs index 2fefc8412ed94..4ca3f2ebd0f89 100644 --- a/components/hubspot/actions/create-ticket/create-ticket.mjs +++ b/components/hubspot/actions/create-ticket/create-ticket.mjs @@ -6,7 +6,7 @@ export default { 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.14", + version: "0.0.15", type: "action", props: { ...common.props, 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 7ea15ab29748c..9b5b923614e08 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 @@ -4,7 +4,7 @@ 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.19", + version: "0.0.20", type: "action", props: { hubspot, 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 59adbab791ff1..33e8d963a6614 100644 --- a/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs +++ b/components/hubspot/actions/get-associated-emails/get-associated-emails.mjs @@ -5,7 +5,7 @@ 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.1", + version: "0.0.2", 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 1f76631fd49cc..6073c0a015ad2 100644 --- a/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs +++ b/components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs @@ -6,7 +6,7 @@ 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.4", + version: "0.0.5", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/get-company/get-company.mjs b/components/hubspot/actions/get-company/get-company.mjs index b3c25d872987b..f0da163eec013 100644 --- a/components/hubspot/actions/get-company/get-company.mjs +++ b/components/hubspot/actions/get-company/get-company.mjs @@ -6,7 +6,7 @@ export default { 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.19", + version: "0.0.20", 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 d8ad93d83d07b..f88bbbf027c89 100644 --- a/components/hubspot/actions/get-contact/get-contact.mjs +++ b/components/hubspot/actions/get-contact/get-contact.mjs @@ -6,7 +6,7 @@ export default { 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.19", + version: "0.0.20", 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 473ce1e6acff2..c75ed51e41c56 100644 --- a/components/hubspot/actions/get-deal/get-deal.mjs +++ b/components/hubspot/actions/get-deal/get-deal.mjs @@ -6,7 +6,7 @@ export default { 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.19", + version: "0.0.20", 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 598924ce6dc46..ce2d9251b6847 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 @@ -4,7 +4,7 @@ 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.19", + version: "0.0.20", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/get-meeting/get-meeting.mjs b/components/hubspot/actions/get-meeting/get-meeting.mjs index 0fbabb3ad0012..80166091479bd 100644 --- a/components/hubspot/actions/get-meeting/get-meeting.mjs +++ b/components/hubspot/actions/get-meeting/get-meeting.mjs @@ -6,7 +6,7 @@ export default { 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.4", + version: "0.0.5", 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 ea559e95c059e..65fbd60321051 100644 --- a/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs +++ b/components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs @@ -4,7 +4,7 @@ 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.1", + version: "0.0.2", type: "action", props: { hubspot, 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 199e11ce3c5bf..d70c63e67a006 100644 --- a/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs +++ b/components/hubspot/actions/list-blog-posts/list-blog-posts.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-blog-posts", name: "List Blog Posts", description: "Retrieves a list of blog posts. [See the documentation](https://developers.hubspot.com/docs/reference/api/cms/blogs/blog-posts)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/list-campaigns/list-campaigns.mjs b/components/hubspot/actions/list-campaigns/list-campaigns.mjs index 9eeaf4a577dfe..c5fc54442b102 100644 --- a/components/hubspot/actions/list-campaigns/list-campaigns.mjs +++ b/components/hubspot/actions/list-campaigns/list-campaigns.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-campaigns", name: "List Campaigns", description: "Retrieves a list of campaigns. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/campaigns#get-%2Fmarketing%2Fv3%2Fcampaigns%2F)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/list-forms/list-forms.mjs b/components/hubspot/actions/list-forms/list-forms.mjs index fe07009437c33..e26fe318a70d8 100644 --- a/components/hubspot/actions/list-forms/list-forms.mjs +++ b/components/hubspot/actions/list-forms/list-forms.mjs @@ -4,7 +4,7 @@ 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.1", + version: "0.0.2", type: "action", props: { hubspot, 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 fe372cc6bd52a..31c0e7e0858c8 100644 --- a/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs +++ b/components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-marketing-emails", name: "List Marketing Emails", description: "Retrieves a list of marketing emails. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/emails/marketing-emails#get-%2Fmarketing%2Fv3%2Femails%2F)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { hubspot, 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 ba01767b3ff0e..446e1df4e1247 100644 --- a/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs +++ b/components/hubspot/actions/list-marketing-events/list-marketing-events.mjs @@ -4,7 +4,7 @@ export default { key: "hubspot-list-marketing-events", name: "List Marketing Events", description: "Retrieves a list of marketing events. [See the documentation](https://developers.hubspot.com/docs/reference/api/marketing/marketing-events#get-%2Fmarketing%2Fv3%2Fmarketing-events%2F)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/list-pages/list-pages.mjs b/components/hubspot/actions/list-pages/list-pages.mjs index d87f40f306f81..bf3e213b43510 100644 --- a/components/hubspot/actions/list-pages/list-pages.mjs +++ b/components/hubspot/actions/list-pages/list-pages.mjs @@ -4,7 +4,7 @@ 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.1", + version: "0.0.2", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/list-templates/list-templates.mjs b/components/hubspot/actions/list-templates/list-templates.mjs index 9410cbef0cf50..8bdf890a43b1b 100644 --- a/components/hubspot/actions/list-templates/list-templates.mjs +++ b/components/hubspot/actions/list-templates/list-templates.mjs @@ -4,7 +4,7 @@ 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.1", + version: "0.0.2", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/search-crm/search-crm.mjs b/components/hubspot/actions/search-crm/search-crm.mjs index 3af72b49b6be0..11cfcd26cba17 100644 --- a/components/hubspot/actions/search-crm/search-crm.mjs +++ b/components/hubspot/actions/search-crm/search-crm.mjs @@ -1,23 +1,23 @@ -import hubspot from "../../hubspot.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; import { - SEARCHABLE_OBJECT_TYPES, - DEFAULT_CONTACT_PROPERTIES, DEFAULT_COMPANY_PROPERTIES, + DEFAULT_CONTACT_PROPERTIES, DEFAULT_DEAL_PROPERTIES, - DEFAULT_TICKET_PROPERTIES, - DEFAULT_PRODUCT_PROPERTIES, - DEFAULT_LINE_ITEM_PROPERTIES, DEFAULT_LEAD_PROPERTIES, DEFAULT_LIMIT, + DEFAULT_LINE_ITEM_PROPERTIES, + DEFAULT_PRODUCT_PROPERTIES, + DEFAULT_TICKET_PROPERTIES, + SEARCHABLE_OBJECT_TYPES, } from "../../common/constants.mjs"; +import hubspot from "../../hubspot.app.mjs"; import common from "../common/common-create.mjs"; -import { ConfigurationError } from "@pipedream/platform"; 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.6", + version: "1.0.7", type: "action", props: { hubspot, diff --git a/components/hubspot/actions/update-company/update-company.mjs b/components/hubspot/actions/update-company/update-company.mjs index f27f64b420e82..dce376fdf5cf0 100644 --- a/components/hubspot/actions/update-company/update-company.mjs +++ b/components/hubspot/actions/update-company/update-company.mjs @@ -1,13 +1,13 @@ import { OBJECT_TYPE } from "../../common/constants.mjs"; -import common from "../common/common-update-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-update-object.mjs"; 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.19", + version: "0.0.20", 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 41f67830b2dd9..52ebede569c09 100644 --- a/components/hubspot/actions/update-contact/update-contact.mjs +++ b/components/hubspot/actions/update-contact/update-contact.mjs @@ -1,13 +1,13 @@ import { OBJECT_TYPE } from "../../common/constants.mjs"; -import common from "../common/common-update-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-update-object.mjs"; 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.20", + version: "0.0.21", 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 39e0abf52b837..8bd4181499206 100644 --- a/components/hubspot/actions/update-custom-object/update-custom-object.mjs +++ b/components/hubspot/actions/update-custom-object/update-custom-object.mjs @@ -1,12 +1,12 @@ -import common from "../common/common-update-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-update-object.mjs"; 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.5", + version: "1.0.6", 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 2801b9a63c60b..3f085f1e23b8e 100644 --- a/components/hubspot/actions/update-deal/update-deal.mjs +++ b/components/hubspot/actions/update-deal/update-deal.mjs @@ -1,13 +1,13 @@ import { OBJECT_TYPE } from "../../common/constants.mjs"; -import common from "../common/common-update-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-update-object.mjs"; 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.10", + version: "0.0.11", 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 new file mode 100644 index 0000000000000..847e1d095fc7d --- /dev/null +++ b/components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs @@ -0,0 +1,348 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { LANGUAGE_OPTIONS } from "../../common/constants.mjs"; +import { + cleanObject, parseObject, +} from "../../common/utils.mjs"; +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.1", + type: "action", + props: { + hubspot, + formId: { + propDefinition: [ + hubspot, + "formId", + ], + }, + name: { + type: "string", + label: "Name", + description: "The name of the form.", + optional: true, + }, + archived: { + type: "boolean", + label: "Archived", + description: "Whether the form is archived.", + optional: true, + }, + 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.", + 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.", + optional: true, + }, + editable: { + type: "boolean", + label: "Editable", + description: "Whether the form can be edited.", + optional: true, + }, + 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.", + 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.", + 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.", + options: [ + "thank_you", + "redirect_url", + ], + optional: true, + }, + postSubmitActionValue: { + type: "string", + label: "Post Submit Action Value", + description: "The thank you text or the page to redirect to.", + optional: true, + }, + language: { + type: "string", + label: "Language", + description: "The language of the form.", + options: LANGUAGE_OPTIONS, + optional: true, + }, + 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.", + optional: true, + }, + cloneable: { + type: "boolean", + label: "Cloneable", + description: "Whether the form can be cloned.", + optional: true, + }, + notifyContactOwner: { + type: "boolean", + label: "Notify Contact Owner", + description: "Whether to send a notification email to the contact owner when a submission is received.", + optional: true, + }, + recaptchaEnabled: { + type: "boolean", + label: "Recaptcha Enabled", + description: "Whether CAPTCHA (spam prevention) is enabled.", + optional: true, + }, + archivable: { + type: "boolean", + label: "Archivable", + description: "Whether the form can be archived.", + optional: true, + }, + notifyRecipients: { + propDefinition: [ + hubspot, + "contactEmail", + ], + type: "string[]", + optional: true, + }, + renderRawHtml: { + type: "boolean", + label: "Render Raw HTML", + description: "Whether the form will render as raw HTML as opposed to inside an iFrame.", + optional: true, + }, + cssClass: { + type: "string", + label: "CSS Class", + description: "The CSS class of the form.", + optional: true, + }, + 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`.", + options: [ + "default_style", + "canvas", + "linear", + "round", + "sharp", + "legacy", + ], + optional: true, + }, + submitButtonText: { + type: "string", + label: "Submit Button Text", + description: "The text displayed on the form submit button.", + optional: true, + }, + labelTextSize: { + type: "string", + label: "Label Text Size", + description: "The size of the label text.", + optional: true, + }, + legalConsentTextColor: { + type: "string", + label: "Legal Consent Text Color", + description: "The color of the legal consent text.", + optional: true, + }, + fontFamily: { + type: "string", + label: "Font Family", + description: "The font family of the form.", + optional: true, + }, + legalConsentTextSize: { + type: "string", + label: "Legal Consent Text Size", + description: "The size of the legal consent text.", + optional: true, + }, + backgroundWidth: { + type: "string", + label: "Background Width", + description: "The width of the background.", + optional: true, + }, + helpTextSize: { + type: "string", + label: "Help Text Size", + description: "The size of the help text.", + optional: true, + }, + submitFontColor: { + type: "string", + label: "Submit Font Color", + description: "The color of the submit font.", + optional: true, + }, + labelTextColor: { + type: "string", + label: "Label Text Color", + description: "The color of the label text.", + optional: true, + }, + submitAlignment: { + type: "string", + label: "Submit Alignment", + description: "The alignment of the submit button.", + options: [ + "left", + "center", + "right", + ], + optional: true, + }, + submitSize: { + type: "string", + label: "Submit Size", + description: "The size of the submit button.", + optional: true, + }, + helpTextColor: { + type: "string", + label: "Help Text Color", + description: "The color of the help text.", + optional: true, + }, + submitColor: { + type: "string", + label: "Submit Color", + description: "The color of the submit button.", + optional: true, + }, + legalConsentOptionsType: { + type: "string", + label: "Legal Consent Options Type", + description: "The type of legal consent options.", + options: [ + "none", + "legitimate_interest", + "explicit_consent_process", + "implicit_consent_process", + ], + optional: true, + }, + 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.", + optional: true, + }, + }, + async run({ $ }) { + const configuration = {}; + if ( + (this.postSubmitActionType && !this.postSubmitActionValue) || + (!this.postSubmitActionType && this.postSubmitActionValue) + ) { + throw new ConfigurationError("Post Submit Action Type and Value must be provided together."); + } + + if (this.language) { + configuration.language = this.language; + } + if (this.cloneable) { + configuration.cloneable = this.cloneable; + } + if (this.postSubmitActionType) { + configuration.postSubmitAction = { + type: this.postSubmitActionType, + value: this.postSubmitActionValue, + }; + } + if (this.editable) { + configuration.editable = this.editable; + } + if (this.archivable) { + configuration.archivable = this.archivable; + } + if (this.recaptchaEnabled) { + configuration.recaptchaEnabled = this.recaptchaEnabled; + } + if (this.notifyContactOwner) { + configuration.notifyContactOwner = this.notifyContactOwner; + } + if (this.notifyRecipients) { + configuration.notifyRecipients = parseObject(this.notifyRecipients); + } + if (this.createNewContactForNewEmail) { + configuration.createNewContactForNewEmail = this.createNewContactForNewEmail; + } + if (this.prePopulateKnownValues) { + configuration.prePopulateKnownValues = this.prePopulateKnownValues; + } + if (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, + }, + }, + "legalConsentOptions": { + "type": this.legalConsentOptionsType, + ...(this.legalConsentOptionsObject + ? parseObject(this.legalConsentOptionsObject) + : {}), + }, + }); + + data.configuration = cleanObject(configuration); + + const response = await this.hubspot.updateForm({ + $, + formId: this.formId, + data, + }); + + $.export("$summary", `Successfully updated form with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/actions/update-landing-page/update-landing-page.mjs b/components/hubspot/actions/update-landing-page/update-landing-page.mjs new file mode 100644 index 0000000000000..97d85fc006d71 --- /dev/null +++ b/components/hubspot/actions/update-landing-page/update-landing-page.mjs @@ -0,0 +1,62 @@ +import { parseObject } from "../../common/utils.mjs"; +import hubspot from "../../hubspot.app.mjs"; +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.1", + type: "action", + props: { + hubspot, + pageId: { + propDefinition: [ + hubspot, + "landingPageId", + ], + description: "The ID of the page to update.", + }, + pageName: { + propDefinition: [ + hubspot, + "pageName", + ], + optional: true, + }, + landingFolderId: { + propDefinition: [ + hubspot, + "landingFolderId", + ], + optional: true, + }, + ...commonPageProp, + }, + async run({ $ }) { + const response = await this.hubspot.updateLandingPage({ + $, + pageId: this.pageId, + data: { + language: this.language, + enableLayoutStylesheets: this.enableLayoutStylesheets, + metaDescription: this.metaDescription, + attachedStylesheets: parseObject(this.attachedStylesheets), + password: this.password, + publishImmediately: this.publishImmediately, + htmlTitle: this.htmlTitle, + translations: parseObject(this.translations), + folderId: this.landingFolderId, + name: this.pageName, + layoutSections: parseObject(this.layoutSections), + footerHtml: this.footerHtml, + headHtml: this.headHtml, + templatePath: this.templatePath, + }, + }); + + $.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 5f8449834e930..8208d1954e4cf 100644 --- a/components/hubspot/actions/update-lead/update-lead.mjs +++ b/components/hubspot/actions/update-lead/update-lead.mjs @@ -1,13 +1,13 @@ import { OBJECT_TYPE } from "../../common/constants.mjs"; -import common from "../common/common-update-object.mjs"; import appProp from "../common/common-app-prop.mjs"; +import common from "../common/common-update-object.mjs"; 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.11", + version: "0.0.12", 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 new file mode 100644 index 0000000000000..61a6670adb95e --- /dev/null +++ b/components/hubspot/actions/update-page/update-page.mjs @@ -0,0 +1,54 @@ +import { parseObject } from "../../common/utils.mjs"; +import hubspot from "../../hubspot.app.mjs"; +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.1", + type: "action", + props: { + hubspot, + pageId: { + propDefinition: [ + hubspot, + "pageId", + ], + description: "The ID of the page to update.", + }, + pageName: { + propDefinition: [ + hubspot, + "pageName", + ], + optional: true, + }, + ...commonPageProp, + }, + async run({ $ }) { + const response = await this.hubspot.updatePage({ + $, + pageId: this.pageId, + data: { + language: this.language, + enableLayoutStylesheets: this.enableLayoutStylesheets, + metaDescription: this.metaDescription, + attachedStylesheets: parseObject(this.attachedStylesheets), + password: this.password, + publishImmediately: this.publishImmediately, + htmlTitle: this.htmlTitle, + translations: parseObject(this.translations), + name: this.pageName, + layoutSections: parseObject(this.layoutSections), + footerHtml: this.footerHtml, + headHtml: this.headHtml, + templatePath: this.templatePath, + }, + }); + + $.export("$summary", `Successfully updated page with ID: ${response.id}`); + + return response; + }, +}; diff --git a/components/hubspot/common/constants.mjs b/components/hubspot/common/constants.mjs index 156359d385d9e..b08b8469d9c83 100644 --- a/components/hubspot/common/constants.mjs +++ b/components/hubspot/common/constants.mjs @@ -20,6 +20,7 @@ const API_PATH = { CRMV4: "/crm/v4", CMS: "/cms/v3", AUTOMATION: "/automation/v2", + AUTOMATIONV4: "/automation/v4", DEAL: "/deals/v1", BUSINESS_UNITS: "/business-units/v3", MARKETINGV3: "/marketing/v3", @@ -219,23 +220,184 @@ const ENGAGEMENT_TYPE_OPTIONS = [ }, ]; +const LANGUAGE_OPTIONS = [ + { + label: "Afrikaans", + value: "af", + }, + { + label: "Arabic (Egypt)", + value: "ar-eg", + }, + { + label: "Bulgarian", + value: "bg", + }, + { + label: "Bengali", + value: "bn", + }, + { + label: "Czech", + value: "cs", + }, + { + label: "Danish", + value: "da", + }, + { + label: "Greek", + value: "el", + }, + { + label: "English", + value: "en", + }, + { + label: "Spanish", + value: "es", + }, + { + label: "Spanish (Mexico)", + value: "es-mx", + }, + { + label: "Finnish", + value: "fi", + }, + { + label: "French", + value: "fr", + }, + { + label: "French (Canada)", + value: "fr-ca", + }, + { + label: "Hebrew (Israel)", + value: "he-il", + }, + { + label: "Croatian", + value: "hr", + }, + { + label: "Hungarian", + value: "hu", + }, + { + label: "Indonesian", + value: "id", + }, + { + label: "Italian", + value: "it", + }, + { + label: "Japanese", + value: "ja", + }, + { + label: "Korean", + value: "ko", + }, + { + label: "Lithuanian", + value: "lt", + }, + { + label: "Malay", + value: "ms", + }, + { + label: "Dutch", + value: "nl", + }, + { + label: "Norwegian (Norway)", + value: "no-no", + }, + { + label: "Polish", + value: "pl", + }, + { + label: "Portuguese", + value: "pt", + }, + { + label: "Portuguese (Brazil)", + value: "pt-br", + }, + { + label: "Romanian", + value: "ro", + }, + { + label: "Russian", + value: "ru", + }, + { + label: "Slovak", + value: "sk", + }, + { + label: "Slovenian", + value: "sl", + }, + { + label: "Swedish", + value: "sv", + }, + { + label: "Thai", + value: "th", + }, + { + label: "Tagalog", + value: "tl", + }, + { + label: "Ukrainian", + value: "uk", + }, + { + label: "Vietnamese", + value: "vi", + }, + { + label: "Chinese (China)", + value: "zh-cn", + }, + { + label: "Chinese (Hong Kong)", + value: "zh-hk", + }, + { + label: "Chinese (Taiwan)", + value: "zh-tw", + }, +]; + export { - OBJECT_TYPE, - OBJECT_TYPES, - SEARCHABLE_OBJECT_TYPES, - HUBSPOT_OWNER, - BASE_URL, API_PATH, ASSOCIATION_CATEGORY, - DEFAULT_LIMIT, - DEFAULT_CONTACT_PROPERTIES, + BASE_URL, DEFAULT_COMPANY_PROPERTIES, + DEFAULT_CONTACT_PROPERTIES, DEFAULT_DEAL_PROPERTIES, - DEFAULT_TICKET_PROPERTIES, - DEFAULT_PRODUCT_PROPERTIES, - DEFAULT_LINE_ITEM_PROPERTIES, - DEFAULT_LEAD_PROPERTIES, - ENGAGEMENT_TYPE_OPTIONS, DEFAULT_EMAIL_PROPERTIES, + DEFAULT_LEAD_PROPERTIES, + DEFAULT_LIMIT, + DEFAULT_LINE_ITEM_PROPERTIES, DEFAULT_MEETING_PROPERTIES, + DEFAULT_PRODUCT_PROPERTIES, + DEFAULT_TICKET_PROPERTIES, + ENGAGEMENT_TYPE_OPTIONS, + HUBSPOT_OWNER, + LANGUAGE_OPTIONS, + OBJECT_TYPE, + OBJECT_TYPES, + SEARCHABLE_OBJECT_TYPES, }; + diff --git a/components/hubspot/common/utils.mjs b/components/hubspot/common/utils.mjs index 9fdc004c18f32..1e6f34787bfde 100644 --- a/components/hubspot/common/utils.mjs +++ b/components/hubspot/common/utils.mjs @@ -23,3 +23,26 @@ export const parseObject = (obj) => { } return obj; }; + +export const cleanObject = (obj) => { + return Object.entries(obj) + .filter(([ + _, + v, + ]) => (v != null && v != "" && _ != undefined && _ != {})) + .reduce((acc, [ + k, + v, + ]) => { + const result = (!Array.isArray(v) && v === Object(v)) + ? cleanObject(v) + : v; + + if (Object.keys(result).length === 0) { + return acc; + } + return { + ...acc, + [k]: result, + };}, {}); +}; diff --git a/components/hubspot/hubspot.app.mjs b/components/hubspot/hubspot.app.mjs index 8d43daf6da70b..d2ae03b5dd115 100644 --- a/components/hubspot/hubspot.app.mjs +++ b/components/hubspot/hubspot.app.mjs @@ -1,19 +1,19 @@ import { axios } from "@pipedream/platform"; +import Bottleneck from "bottleneck"; import { API_PATH, BASE_URL, - HUBSPOT_OWNER, - OBJECT_TYPE, - OBJECT_TYPES, - DEFAULT_LIMIT, - DEFAULT_CONTACT_PROPERTIES, DEFAULT_COMPANY_PROPERTIES, + DEFAULT_CONTACT_PROPERTIES, DEFAULT_DEAL_PROPERTIES, - DEFAULT_TICKET_PROPERTIES, - DEFAULT_PRODUCT_PROPERTIES, + DEFAULT_LIMIT, DEFAULT_LINE_ITEM_PROPERTIES, + DEFAULT_PRODUCT_PROPERTIES, + DEFAULT_TICKET_PROPERTIES, + HUBSPOT_OWNER, + OBJECT_TYPE, + OBJECT_TYPES, } from "./common/constants.mjs"; -import Bottleneck from "bottleneck"; const limiter = new Bottleneck({ minTime: 250, // 4 requests per second maxConcurrent: 1, @@ -498,6 +498,184 @@ export default { return results.map(({ id }) => id); }, }, + formId: { + type: "string", + label: "Form ID", + description: "The ID of the form to update.", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listForms({ + data: { + after: nextAfter, + }, + }); + + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + pageId: { + type: "string", + label: "Page ID", + description: "The ID of the page to clone.", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listSitePages({ + data: { + after: nextAfter, + }, + }); + + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + landingPageId: { + type: "string", + label: "Landing Page ID", + description: "The ID of the landing page to clone.", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listLandingPages({ + data: { + after: nextAfter, + }, + }); + + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + templatePath: { + type: "string", + label: "Template Path", + description: "The template path of the page.", + async options({ page }) { + const { objects } = await this.listTemplates({ + params: { + limit: DEFAULT_LIMIT, + offset: page * DEFAULT_LIMIT, + }, + }); + return objects?.map(({ + path: value, label, + }) => ({ + value, + label, + })) || []; + }, + }, + pageName: { + type: "string", + label: "Page Name", + description: "The name of the page.", + }, + landingFolderId: { + type: "string", + label: "Folder ID", + description: "The ID of the folder to create the landing page in.", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listLandingFolders({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + campaignId: { + type: "string", + label: "Campaign ID", + description: "The ID of the campaign to create the email in.", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listCampaigns({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ id }) => id) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, + emailId: { + type: "string", + label: "Marketing Email ID", + description: "The ID of the marketing email to clone.", + async options({ prevContext }) { + const { nextAfter } = prevContext; + const { + results, paging, + } = await this.listMarketingEmails({ + data: { + after: nextAfter, + }, + }); + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + nextAfter: paging?.next.after, + }, + }; + }, + }, }, methods: { _getHeaders() { @@ -790,13 +968,11 @@ export default { getLists({ listType, ...opts }) { - const basePath = "/lists"; - const path = listType - ? `${basePath}/${listType}` - : basePath; return this.makeRequest({ api: API_PATH.CONTACTS, - endpoint: path, + endpoint: `/lists${listType + ? `/${listType}` + : ""}`, ...opts, }); }, @@ -1193,5 +1369,119 @@ export default { ...opts, }); }, + createForm(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.MARKETINGV3, + endpoint: "/forms", + ...opts, + }); + }, + updateForm({ + formId, ...opts + }) { + return this.makeRequest({ + method: "PATCH", + api: API_PATH.MARKETINGV3, + endpoint: `/forms/${formId}`, + ...opts, + }); + }, + listForms(opts = {}) { + return this.makeRequest({ + api: API_PATH.MARKETINGV3, + endpoint: "/forms", + ...opts, + }); + }, + listSitePages(opts = {}) { + return this.makeRequest({ + api: API_PATH.CMS, + endpoint: "/pages/site-pages", + ...opts, + }); + }, + listLandingPages(opts = {}) { + return this.makeRequest({ + api: API_PATH.CMS, + endpoint: "/pages/landing-pages", + ...opts, + }); + }, + cloneSitePage(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.CMS, + endpoint: "/pages/site-pages/clone", + ...opts, + }); + }, + createPage(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.CMS, + endpoint: "/pages/site-pages", + ...opts, + }); + }, + updatePage({ + pageId, ...opts + }) { + return this.makeRequest({ + method: "PATCH", + api: API_PATH.CMS, + endpoint: `/pages/site-pages/${pageId}`, + ...opts, + }); + }, + createLandingPage(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.CMS, + endpoint: "/pages/landing-pages", + ...opts, + }); + }, + updateLandingPage({ + pageId, ...opts + }) { + return this.makeRequest({ + method: "PATCH", + api: API_PATH.CMS, + endpoint: `/pages/landing-pages/${pageId}`, + ...opts, + }); + }, + listLandingFolders(opts = {}) { + return this.makeRequest({ + api: API_PATH.CMS, + endpoint: "/pages/landing-pages/folders", + ...opts, + }); + }, + createEmail(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.MARKETINGV3, + endpoint: "/emails", + ...opts, + }); + }, + cloneEmail(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.MARKETINGV3, + endpoint: "/emails/clone", + ...opts, + }); + }, + createContactWorkflow(opts = {}) { + return this.makeRequest({ + method: "POST", + api: API_PATH.AUTOMATIONV4, + endpoint: "/flows", + ...opts, + }); + }, }, }; diff --git a/components/hubspot/package.json b/components/hubspot/package.json index 435936d6ba838..90914407f5a9c 100644 --- a/components/hubspot/package.json +++ b/components/hubspot/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hubspot", - "version": "1.6.0", + "version": "1.6.1", "description": "Pipedream Hubspot Components", "main": "hubspot.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/hubspot", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^3.0.0", + "@pipedream/platform": "^3.1.0", "bottleneck": "^2.19.5" }, "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535", 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 758e42e350691..8759c45152016 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.25", + version: "0.0.26", dedupe: "unique", type: "source", methods: { diff --git a/components/hubspot/sources/new-company-property-change/new-company-property-change.mjs b/components/hubspot/sources/new-company-property-change/new-company-property-change.mjs index 7277f11e2a71b..6c885291fadb8 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +7,7 @@ export default { key: "hubspot-new-company-property-change", name: "New Company Property Change", description: "Emit new event when a specified property is provided or updated on a company. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)", - version: "0.0.18", + version: "0.0.19", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs b/components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs index cfe18dc6c92ae..e383493bffdcd 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +7,7 @@ export default { 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.20", + version: "0.0.21", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs b/components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs index 25eac8824f589..7def1d9026faa 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 @@ -1,12 +1,12 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; 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.10", + version: "0.0.11", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs b/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs index 1f3e0f26ed9ab..579a9128cea86 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 @@ -1,7 +1,9 @@ -import common from "../common/common.mjs"; import { - DEFAULT_LIMIT, DEFAULT_DEAL_PROPERTIES, API_PATH, + API_PATH, + DEFAULT_DEAL_PROPERTIES, + DEFAULT_LIMIT, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,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.31", + version: "0.0.32", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs b/components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs index ffbfcc90c8edf..9ba533a91ba7b 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +7,7 @@ export default { key: "hubspot-new-deal-property-change", name: "New Deal Property Change", description: "Emit new event when a specified property is provided or updated on a deal. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals)", - version: "0.0.19", + version: "0.0.20", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-email-event/new-email-event.mjs b/components/hubspot/sources/new-email-event/new-email-event.mjs index 92c88f6daaea3..cee4cff83762f 100644 --- a/components/hubspot/sources/new-email-event/new-email-event.mjs +++ b/components/hubspot/sources/new-email-event/new-email-event.mjs @@ -1,6 +1,6 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; import { EMAIL_EVENT_TYPES } from "../../common/object-types.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -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.28", + version: "0.0.29", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs b/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs index 22f5bdeec3e7c..53f28cd8074a1 100644 --- a/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs +++ b/components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs @@ -6,7 +6,7 @@ export default { key: "hubspot-new-email-subscriptions-timeline", name: "New Email Subscriptions Timeline", description: "Emit new event when a new email timeline subscription is added for the portal.", - version: "0.0.25", + version: "0.0.26", 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 4675033e40895..8ab7bbe9cb7be 100644 --- a/components/hubspot/sources/new-engagement/new-engagement.mjs +++ b/components/hubspot/sources/new-engagement/new-engagement.mjs @@ -1,6 +1,6 @@ -import common from "../common/common.mjs"; -import { ENGAGEMENT_TYPES } from "../../common/object-types.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import { ENGAGEMENT_TYPES } from "../../common/object-types.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -8,7 +8,7 @@ export default { key: "hubspot-new-engagement", name: "New Engagement", description: "Emit new event for each new engagement created. This action returns a maximum of 5000 records at a time, make sure you set a correct time range so you don't miss any events", - version: "0.0.30", + version: "0.0.31", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-event/new-event.mjs b/components/hubspot/sources/new-event/new-event.mjs index 9f96e9ea4df3d..6a6a81a7fe019 100644 --- a/components/hubspot/sources/new-event/new-event.mjs +++ b/components/hubspot/sources/new-event/new-event.mjs @@ -1,6 +1,6 @@ -import common from "../common/common.mjs"; import { ConfigurationError } from "@pipedream/platform"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -8,7 +8,7 @@ export default { key: "hubspot-new-event", name: "New Events", description: "Emit new event for each new Hubspot event. Note: Only available for Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise accounts", - version: "0.0.29", + version: "0.0.30", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-form-submission/new-form-submission.mjs b/components/hubspot/sources/new-form-submission/new-form-submission.mjs index 999cfef83526e..07acef7720f4b 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.30", + version: "0.0.31", 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 34f1ed4cb7e65..464b97aa8125b 100644 --- a/components/hubspot/sources/new-note/new-note.mjs +++ b/components/hubspot/sources/new-note/new-note.mjs @@ -1,14 +1,14 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT, OBJECT_TYPES, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; export default { ...common, 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.6", + version: "1.0.7", 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 be724cfb0463c..ea2fc96b7bb1a 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -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.12", + version: "0.0.13", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs b/components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs index f2c9aa433c81e..f2ea636802628 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 @@ -1,7 +1,8 @@ -import common from "../common/common.mjs"; import { - DEFAULT_LIMIT, DEFAULT_COMPANY_PROPERTIES, + DEFAULT_COMPANY_PROPERTIES, + DEFAULT_LIMIT, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,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.12", + version: "0.0.13", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs b/components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs index 52138efc24506..f959932f08917 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 @@ -1,7 +1,8 @@ -import common from "../common/common.mjs"; import { - DEFAULT_LIMIT, DEFAULT_CONTACT_PROPERTIES, + DEFAULT_CONTACT_PROPERTIES, + DEFAULT_LIMIT, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,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.12", + version: "0.0.13", 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 857bcb93e39ea..e1370058bf07d 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +7,7 @@ export default { key: "hubspot-new-or-updated-crm-object", name: "New or Updated CRM Object", description: "Emit new event each time a CRM Object of the specified object type is updated.", - version: "0.0.25", + version: "0.0.26", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs b/components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs index 89c8a8b92b6c5..2a4cfd268446c 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +7,7 @@ export default { key: "hubspot-new-or-updated-custom-object", name: "New or Updated Custom Object", description: "Emit new event each time a Custom Object of the specified schema is updated.", - version: "0.0.14", + version: "0.0.15", 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 aab0d47134052..911703380b233 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 @@ -1,7 +1,8 @@ -import common from "../common/common.mjs"; import { - DEFAULT_LIMIT, DEFAULT_DEAL_PROPERTIES, + DEFAULT_DEAL_PROPERTIES, + DEFAULT_LIMIT, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,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.12", + version: "0.0.13", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs b/components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs index ffd8a00e42d76..4cf00f16a89c2 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,7 +1,7 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT, DEFAULT_LINE_ITEM_PROPERTIES, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,7 +9,7 @@ export default { key: "hubspot-new-or-updated-line-item", name: "New or Updated Line Item", description: "Emit new event for each new line item added or updated in Hubspot.", - version: "0.0.12", + version: "0.0.13", 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 03a08a5103dc4..740df749a3c45 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,7 +1,7 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT, DEFAULT_PRODUCT_PROPERTIES, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,7 +9,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.12", + version: "0.0.13", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-social-media-message/new-social-media-message.mjs b/components/hubspot/sources/new-social-media-message/new-social-media-message.mjs index d1d76ff9be1ed..ad901433fe406 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 @@ -6,7 +6,7 @@ export default { 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.25", + version: "0.0.26", type: "source", dedupe: "unique", props: { diff --git a/components/hubspot/sources/new-task/new-task.mjs b/components/hubspot/sources/new-task/new-task.mjs index cf9fcfd71212e..dc6271f5162e5 100644 --- a/components/hubspot/sources/new-task/new-task.mjs +++ b/components/hubspot/sources/new-task/new-task.mjs @@ -1,14 +1,14 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT, OBJECT_TYPES, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; 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.6", + version: "1.0.7", type: "source", dedupe: "unique", methods: { 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 15e370e1cebc2..99f612f8ca2a5 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 @@ -1,5 +1,5 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +7,7 @@ export default { 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.19", + version: "0.0.20", dedupe: "unique", type: "source", props: { diff --git a/components/hubspot/sources/new-ticket/new-ticket.mjs b/components/hubspot/sources/new-ticket/new-ticket.mjs index 8feab49c342ce..db9f83bf339b0 100644 --- a/components/hubspot/sources/new-ticket/new-ticket.mjs +++ b/components/hubspot/sources/new-ticket/new-ticket.mjs @@ -1,7 +1,7 @@ -import common from "../common/common.mjs"; import { DEFAULT_LIMIT, DEFAULT_TICKET_PROPERTIES, } from "../../common/constants.mjs"; +import common from "../common/common.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -9,7 +9,7 @@ export default { key: "hubspot-new-ticket", name: "New Ticket", description: "Emit new event for each new ticket created.", - version: "0.0.25", + version: "0.0.26", dedupe: "unique", type: "source", props: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c3b944f6d5eb3..a8eb2a7dea305 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6654,8 +6654,8 @@ importers: components/hubspot: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 bottleneck: specifier: ^2.19.5 version: 2.19.5