Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.10",
version: "0.0.11",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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: "0.0.13",
version: "1.0.0",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
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.6",
version: "0.0.7",
type: "action",
props: {
...appProp.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.17",
version: "0.0.18",
type: "action",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
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: "0.0.5",
version: "1.0.0",
type: "action",
props: {
...appProp.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/create-deal/create-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.17",
version: "0.0.18",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
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.16",
version: "0.0.17",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/create-lead/create-lead.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
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.5",
version: "0.0.6",
type: "action",
props: {
...appProp.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.15",
version: "0.0.16",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/create-ticket/create-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.8",
version: "0.0.9",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
type: "action",
props: {
hubspot,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/get-company/get-company.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/get-contact/get-contact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/get-deal/get-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
type: "action",
props: {
hubspot,
Expand Down
31 changes: 23 additions & 8 deletions components/hubspot/actions/search-crm/search-crm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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: "0.0.13",
version: "1.0.0",
type: "action",
props: {
hubspot,
Expand Down Expand Up @@ -50,7 +50,7 @@ export default {
props.customObjectType = {
type: "string",
label: "Custom Object Type",
options: await this.getCustomObjectTypes(),
options: async () => await this.getCustomObjectTypes(),
reloadProps: true,
};
} catch {
Expand All @@ -71,12 +71,20 @@ export default {
schema = await this.hubspot.getSchema({
objectType,
});
const properties = schema.properties;
const searchableProperties = schema.searchableProperties?.map((prop) => {
const propData = properties.find(({ name }) => name === prop);
return {
label: propData.label,
value: propData.name,
};
});

props.searchProperty = {
type: "string",
label: "Search Property",
description: "The field to search",
options: schema.searchableProperties,
options: searchableProperties,
};
} catch {
props.searchProperty = {
Expand Down Expand Up @@ -186,7 +194,12 @@ export default {
},
async getCustomObjectTypes() {
const { results } = await this.hubspot.listSchemas();
return results?.map(({ name }) => name ) || [];
return results?.map(({
fullyQualifiedName: value, labels,
}) => ({
value,
label: labels.plural,
})) || [];
},
},
async run({ $ }) {
Expand All @@ -204,8 +217,10 @@ export default {
...otherProperties
} = this;

const actualObjectType = customObjectType ?? objectType;

const schema = await this.hubspot.getSchema({
objectType,
objectType: actualObjectType,
});

if (!schema.searchableProperties.includes(searchProperty)) {
Expand Down Expand Up @@ -236,20 +251,20 @@ export default {
],
};
const { results } = await hubspot.searchCRM({
object: customObjectType ?? objectType,
object: actualObjectType,
data,
$,
});

if (!results?.length && createIfNotFound) {
const response = await hubspot.createObject({
$,
objectType: customObjectType ?? objectType,
objectType: actualObjectType,
data: {
properties,
},
});
const objectName = hubspot.getObjectTypeName(customObjectType ?? objectType);
const objectName = hubspot.getObjectTypeName(actualObjectType);
$.export("$summary", `Successfully created ${objectName}`);
return response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
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.13",
version: "0.0.14",
type: "action",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
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.14",
version: "0.0.15",
type: "action",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
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: "0.0.5",
version: "1.0.0",
type: "action",
methods: {
...common.methods,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/update-deal/update-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
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.4",
version: "0.0.5",
type: "action",
methods: {
...common.methods,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/update-lead/update-lead.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
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.5",
version: "0.0.6",
type: "action",
methods: {
...common.methods,
Expand Down
11 changes: 8 additions & 3 deletions components/hubspot/hubspot.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {
if (includeCustom) {
const { results } = await this.listSchemas();
const customObjects = results?.map(({
name: value, labels,
fullyQualifiedName: value, labels,
}) => ({
value,
label: labels.plural,
Expand Down Expand Up @@ -437,10 +437,15 @@ export default {
customObjectType: {
type: "string",
label: "Custom Object Type",
description: "Tye type of custom object to create",
description: "The type of custom object to create",
async options() {
const { results } = await this.listSchemas();
return results?.map(({ name }) => name ) || [];
return results?.map(({
name, fullyQualifiedName,
}) => ({
label: name,
value: fullyQualifiedName,
}) ) || [];
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/hubspot",
"version": "0.13.3",
"version": "1.0.0",
"description": "Pipedream Hubspot Components",
"main": "hubspot.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
export default {
...common,
key: "hubspot-delete-blog-article",
name: "Deleted Blog Posts",

Check warning on line 7 in components/hubspot/sources/delete-blog-article/delete-blog-article.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event for each deleted blog post.",
version: "0.0.18",
version: "0.0.19",
dedupe: "unique",
type: "source",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.11",
version: "0.0.12",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.13",
version: "0.0.14",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
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.3",
version: "0.0.4",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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.22",
version: "0.0.23",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.12",
version: "0.0.13",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.21",
version: "0.0.22",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.18",
version: "0.0.19",
dedupe: "unique",
type: "source",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.23",
version: "0.0.24",
dedupe: "unique",
type: "source",
props: {
Expand Down
Loading
Loading