Skip to content

Commit 5da5fd6

Browse files
committed
Issue 18428
1 parent 7233474 commit 5da5fd6

File tree

25 files changed

+53
-26
lines changed

25 files changed

+53
-26
lines changed

components/hubspot/sources/delete-blog-article/delete-blog-article.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "hubspot-delete-blog-article",
77
name: "Deleted Blog Posts",
88
description: "Emit new event for each deleted blog post.",
9-
version: "0.0.33",
9+
version: "0.0.34",
1010
dedupe: "unique",
1111
type: "source",
1212
methods: {

components/hubspot/sources/new-company-property-change/new-company-property-change.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "hubspot-new-company-property-change",
88
name: "New Company Property Change",
99
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)",
10-
version: "0.0.26",
10+
version: "0.0.27",
1111
dedupe: "unique",
1212
type: "source",
1313
props: {

components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
name: "New Contact Added to List",
1313
description:
1414
"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)",
15-
version: "0.0.5",
15+
version: "0.0.6",
1616
type: "source",
1717
dedupe: "unique",
1818
props: {

components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ export default {
66
...common,
77
key: "hubspot-new-contact-property-change",
88
name: "New Contact Property Change",
9-
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)",
10-
version: "0.0.28",
9+
description:
10+
"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)",
11+
version: "0.0.29",
1112
dedupe: "unique",
1213
type: "source",
1314
props: {
@@ -21,6 +22,20 @@ export default {
2122
return properties.map((property) => property.name);
2223
},
2324
},
25+
skipFirstRun: {
26+
type: "boolean",
27+
label: "Skip existing contacts when first activated",
28+
description:
29+
"When enabled, this trigger will ignore all existing contacts and only watch for property changes that happen after activation. When disabled, it will process all existing contacts on first run.",
30+
default: true,
31+
},
32+
requirePropertyHistory: {
33+
type: "boolean",
34+
label: "Only trigger on actual property changes",
35+
description:
36+
"When enabled, only fires when a contact property is actually modified. When disabled, may also trigger for newly created contacts even if the property wasn't changed.",
37+
default: true,
38+
},
2439
},
2540
methods: {
2641
...common.methods,
@@ -43,6 +58,13 @@ export default {
4358
};
4459
},
4560
isRelevant(contact, updatedAfter) {
61+
if (this.requirePropertyHistory) {
62+
const history = contact.propertiesWithHistory?.[this.property];
63+
if (!history || history.length === 0) {
64+
return false;
65+
}
66+
}
67+
4668
return !updatedAfter || this.getTs(contact) > updatedAfter;
4769
},
4870
getParams(after) {
@@ -95,6 +117,11 @@ export default {
95117
});
96118
},
97119
async processResults(after, params) {
120+
if (this.skipFirstRun && !after) {
121+
this._setAfter(Date.now());
122+
return;
123+
}
124+
98125
const properties = await this.hubspot.getContactProperties();
99126
const propertyNames = properties.map((property) => property.name);
100127
if (!propertyNames.includes(this.property)) {

components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "New Custom Object Property Change",
88
description:
99
"Emit new event when a specified property is provided or updated on a custom object.",
10-
version: "0.0.18",
10+
version: "0.0.19",
1111
dedupe: "unique",
1212
type: "source",
1313
props: {

components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
key: "hubspot-new-deal-in-stage",
1212
name: "New Deal In Stage",
1313
description: "Emit new event for each new deal in a stage.",
14-
version: "0.0.39",
14+
version: "0.0.40",
1515
dedupe: "unique",
1616
type: "source",
1717
props: {

components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "hubspot-new-deal-property-change",
88
name: "New Deal Property Change",
99
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)",
10-
version: "0.0.27",
10+
version: "0.0.28",
1111
dedupe: "unique",
1212
type: "source",
1313
props: {

components/hubspot/sources/new-email-event/new-email-event.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "hubspot-new-email-event",
99
name: "New Email Event",
1010
description: "Emit new event for each new Hubspot email event.",
11-
version: "0.0.36",
11+
version: "0.0.37",
1212
dedupe: "unique",
1313
type: "source",
1414
props: {

components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "hubspot-new-email-subscriptions-timeline",
77
name: "New Email Subscriptions Timeline",
88
description: "Emit new event when a new email timeline subscription is added for the portal.",
9-
version: "0.0.33",
9+
version: "0.0.34",
1010
dedupe: "unique",
1111
type: "source",
1212
methods: {

components/hubspot/sources/new-engagement/new-engagement.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "hubspot-new-engagement",
99
name: "New Engagement",
1010
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",
11-
version: "0.0.38",
11+
version: "0.0.39",
1212
dedupe: "unique",
1313
type: "source",
1414
props: {

0 commit comments

Comments
 (0)