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
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": "1.7.5",
"version": "1.7.6",
"description": "Pipedream Hubspot Components",
"main": "hubspot.app.mjs",
"keywords": [
Expand Down
7 changes: 5 additions & 2 deletions components/hubspot/sources/common/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,22 @@ export default {
}
}
},
async getPaginatedItems(resourceFn, params) {
async getPaginatedItems(resourceFn, params, after = null) {
const items = [];
const maxPages = 10;
let page = 0;
do {
const {
results, paging,
} = await resourceFn(params);
items.push(...results);
if (paging) {
params.after = paging.next.after;
page++;
} else {
delete params.after;
}
} while (params.after);
} while (params.after && after && page < maxPages);
return items;
},
emitEvent(result) {
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.32",
version: "0.0.33",
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.25",
version: "0.0.26",
dedupe: "unique",
type: "source",
props: {
Expand Down Expand Up @@ -46,7 +46,7 @@ export default {
return !updatedAfter || this.getTs(company) > updatedAfter;
},
getParams(after) {
return {
const params = {
object: "companies",
data: {
limit: DEFAULT_LIMIT,
Expand All @@ -66,16 +66,19 @@ export default {
propertyName: this.property,
operator: "HAS_PROPERTY",
},
{
propertyName: "hs_lastmodifieddate",
operator: "GTE",
value: after,
},
],
},
],
},
};
if (after) {
params.data.filterGroups[0].filters.push({
propertyName: "hs_lastmodifieddate",
operator: "GTE",
value: after,
});
}
return params;
},
batchGetCompanies(inputs) {
return this.hubspot.batchGetObjects({
Expand Down Expand Up @@ -104,6 +107,7 @@ export default {
const updatedCompanies = await this.getPaginatedItems(
this.hubspot.searchCRM,
params,
after,
);

if (!updatedCompanies.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
name: "New Contact Added to List",
description:
"Emit new event when a contact is added to a HubSpot list. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/lists#get-%2Fcrm%2Fv3%2Flists%2F%7Blistid%7D%2Fmemberships%2Fjoin-order)",
version: "0.0.4",
version: "0.0.5",
type: "source",
dedupe: "unique",
props: {
...common.props,
info: {

Check warning on line 20 in components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 20 in components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Properties:\n\`${DEFAULT_CONTACT_PROPERTIES.join(", ")}\``,
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.27",
version: "0.0.28",
dedupe: "unique",
type: "source",
props: {
Expand Down Expand Up @@ -106,6 +106,7 @@ export default {
const updatedContacts = await this.getPaginatedItems(
this.hubspot.searchCRM,
params,
after,
);

if (!updatedContacts.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "New Custom Object Property Change",
description:
"Emit new event when a specified property is provided or updated on a custom object.",
version: "0.0.17",
version: "0.0.18",
dedupe: "unique",
type: "source",
props: {
Expand Down Expand Up @@ -113,6 +113,7 @@ export default {
const updatedObjects = await this.getPaginatedItems(
this.hubspot.searchCRM,
params,
after,
);

if (!updatedObjects.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
key: "hubspot-new-deal-in-stage",
name: "New Deal In Stage",
description: "Emit new event for each new deal in a stage.",
version: "0.0.38",
version: "0.0.39",
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.26",
version: "0.0.27",
dedupe: "unique",
type: "source",
props: {
Expand Down Expand Up @@ -104,6 +104,7 @@ export default {
const updatedDeals = await this.getPaginatedItems(
this.hubspot.searchCRM,
params,
after,
);

if (!updatedDeals.length) {
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.35",
version: "0.0.36",
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.32",
version: "0.0.33",
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.37",
version: "0.0.38",
dedupe: "unique",
type: "source",
props: {
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/sources/new-event/new-event.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.36",
version: "0.0.37",
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-form-submission",
name: "New Form Submission",
description: "Emit new event for each new submission of a form.",
version: "0.0.37",
version: "0.0.38",
dedupe: "unique",
type: "source",
props: {
Expand Down
4 changes: 2 additions & 2 deletions components/hubspot/sources/new-note/new-note.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "hubspot-new-note",
name: "New Note Created",
description: "Emit new event for each new note created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/notes#get-%2Fcrm%2Fv3%2Fobjects%2Fnotes)",
version: "1.0.13",
version: "1.0.14",
type: "source",
dedupe: "unique",
methods: {
Expand Down Expand Up @@ -49,7 +49,7 @@ export default {
};
},
async processResults(after, params) {
const notes = await this.getPaginatedItems(this.hubspot.listNotes.bind(this), params);
const notes = await this.getPaginatedItems(this.hubspot.listNotes.bind(this), params, after);
await this.processEvents(notes, after);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.19",
version: "0.0.20",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
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.19",
version: "0.0.20",
dedupe: "unique",
type: "source",
props: {
...common.props,
info: {

Check warning on line 18 in components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 18 in components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Properties:\n\`${DEFAULT_COMPANY_PROPERTIES.join(", ")}\``,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
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.20",
version: "0.0.21",
dedupe: "unique",
type: "source",
props: {
...common.props,
info: {

Check warning on line 18 in components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 18 in components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Properties:\n\`${DEFAULT_CONTACT_PROPERTIES.join(", ")}\``,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.32",
version: "0.0.33",
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-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.21",
version: "0.0.22",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
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.19",
version: "0.0.20",
dedupe: "unique",
type: "source",
props: {
...common.props,
info: {

Check warning on line 18 in components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 18 in components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Properties:\n\`${DEFAULT_DEAL_PROPERTIES.join(", ")}\``,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
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.19",
version: "0.0.20",
dedupe: "unique",
type: "source",
props: {
...common.props,
info: {

Check warning on line 18 in components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Properties:\n\`${DEFAULT_LINE_ITEM_PROPERTIES.join(", ")}\``,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
key: "hubspot-new-or-updated-product",
name: "New or Updated Product",
description: "Emit new event for each new or updated product in Hubspot.",
version: "0.0.19",
version: "0.0.20",
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 {
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.32",
version: "0.0.33",
type: "source",
dedupe: "unique",
props: {
Expand Down
3 changes: 2 additions & 1 deletion components/hubspot/sources/new-task/new-task.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
name: "New Task Created",
description:
"Emit new event for each new task created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/tasks#get-%2Fcrm%2Fv3%2Fobjects%2Ftasks)",
version: "1.0.13",
version: "1.0.14",
type: "source",
dedupe: "unique",
methods: {
Expand Down Expand Up @@ -55,6 +55,7 @@ export default {
const tasks = await this.getPaginatedItems(
this.hubspot.listTasks.bind(this),
params,
after,
);
await this.processEvents(tasks, after);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
name: "New Ticket Property Change",
description:
"Emit new event when a specified property is provided or updated on a ticket. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)",
version: "0.0.26",
version: "0.0.27",
dedupe: "unique",
type: "source",
props: {
Expand Down Expand Up @@ -108,6 +108,7 @@ export default {
const updatedTickets = await this.getPaginatedItems(
this.hubspot.searchCRM,
params,
after,
);

if (!updatedTickets.length) {
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/sources/new-ticket/new-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
key: "hubspot-new-ticket",
name: "New Ticket",
description: "Emit new event for each new ticket created.",
version: "0.0.32",
version: "0.0.33",
dedupe: "unique",
type: "source",
props: {
Expand Down
Loading