Skip to content

Commit 1b2c229

Browse files
committed
updates
1 parent c4e584e commit 1b2c229

File tree

6 files changed

+42
-30
lines changed

6 files changed

+42
-30
lines changed

components/hubspot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/hubspot",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "Pipedream Hubspot Components",
55
"main": "hubspot.app.mjs",
66
"keywords": [

components/hubspot/sources/common/common.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
return results.flat();
5353
},
5454
async processEvents(resources, after) {
55-
let maxTs = after;
55+
let maxTs = after || 0;
5656
for (const result of resources) {
5757
if (await this.isRelevant(result, after)) {
5858
this.emitEvent(result);

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "hubspot-new-contact-property-change",
88
name: "New Contact Property Change",
99
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.25",
10+
version: "0.0.26",
1111
dedupe: "unique",
1212
type: "source",
1313
props: {
@@ -46,7 +46,7 @@ export default {
4646
return !updatedAfter || this.getTs(contact) > updatedAfter;
4747
},
4848
getParams(after) {
49-
return {
49+
const params = {
5050
object: "contacts",
5151
data: {
5252
limit: DEFAULT_LIMIT,
@@ -66,16 +66,19 @@ export default {
6666
propertyName: this.property,
6767
operator: "HAS_PROPERTY",
6868
},
69-
{
70-
propertyName: "lastmodifieddate",
71-
operator: "GTE",
72-
value: after,
73-
},
7469
],
7570
},
7671
],
7772
},
7873
};
74+
if (after) {
75+
params.data.filterGroups[0].filters.push({
76+
propertyName: "lastmodifieddate",
77+
operator: "GTE",
78+
value: after,
79+
});
80+
}
81+
return params;
7982
},
8083
batchGetContacts(inputs) {
8184
return this.hubspot.batchGetObjects({

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

Lines changed: 10 additions & 7 deletions
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.15",
10+
version: "0.0.16",
1111
dedupe: "unique",
1212
type: "source",
1313
props: {
@@ -52,7 +52,7 @@ export default {
5252
return !updatedAfter || this.getTs(object) > updatedAfter;
5353
},
5454
getParams(after) {
55-
return {
55+
const params = {
5656
object: this.objectSchema,
5757
data: {
5858
limit: DEFAULT_LIMIT,
@@ -72,16 +72,19 @@ export default {
7272
propertyName: this.property,
7373
operator: "HAS_PROPERTY",
7474
},
75-
{
76-
propertyName: "hs_lastmodifieddate",
77-
operator: "GTE",
78-
value: after,
79-
},
8075
],
8176
},
8277
],
8378
},
8479
};
80+
if (after) {
81+
params.data.filterGroups[0].filters.push({
82+
propertyName: "hs_lastmodifieddate",
83+
operator: "GTE",
84+
value: after,
85+
});
86+
}
87+
return params;
8588
},
8689
batchGetCustomObjects(inputs) {
8790
return this.hubspot.batchGetObjects({

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

Lines changed: 10 additions & 7 deletions
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.24",
10+
version: "0.0.25",
1111
dedupe: "unique",
1212
type: "source",
1313
props: {
@@ -44,7 +44,7 @@ export default {
4444
return !updatedAfter || this.getTs(deal) > updatedAfter;
4545
},
4646
getParams(after) {
47-
return {
47+
const params = {
4848
object: "deals",
4949
data: {
5050
limit: DEFAULT_LIMIT,
@@ -64,16 +64,19 @@ export default {
6464
propertyName: this.property,
6565
operator: "HAS_PROPERTY",
6666
},
67-
{
68-
propertyName: "hs_lastmodifieddate",
69-
operator: "GTE",
70-
value: after,
71-
},
7267
],
7368
},
7469
],
7570
},
7671
};
72+
if (after) {
73+
params.data.filterGroups[0].filters.push({
74+
propertyName: "hs_lastmodifieddate",
75+
operator: "GTE",
76+
value: after,
77+
});
78+
}
79+
return params;
7780
},
7881
batchGetDeals(inputs) {
7982
return this.hubspot.batchGetObjects({

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
name: "New Ticket Property Change",
99
description:
1010
"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)",
11-
version: "0.0.24",
11+
version: "0.0.25",
1212
dedupe: "unique",
1313
type: "source",
1414
props: {
@@ -47,7 +47,7 @@ export default {
4747
return !updatedAfter || this.getTs(ticket) > updatedAfter;
4848
},
4949
getParams(after) {
50-
return {
50+
const params = {
5151
object: "tickets",
5252
data: {
5353
limit: DEFAULT_LIMIT,
@@ -67,16 +67,19 @@ export default {
6767
propertyName: this.property,
6868
operator: "HAS_PROPERTY",
6969
},
70-
{
71-
propertyName: "hs_lastmodifieddate",
72-
operator: "GTE",
73-
value: after,
74-
},
7570
],
7671
},
7772
],
7873
},
7974
};
75+
if (after) {
76+
params.data.filterGroups[0].filters.push({
77+
propertyName: "hs_lastmodifieddate",
78+
operator: "GTE",
79+
value: after,
80+
});
81+
}
82+
return params;
8083
},
8184
batchGetTickets(inputs) {
8285
return this.hubspot.batchGetObjects({

0 commit comments

Comments
 (0)