File tree Expand file tree Collapse file tree 2 files changed +29
-8
lines changed
sources/new-or-updated-contact Expand file tree Collapse file tree 2 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @pipedream/hubspot" ,
3- "version" : " 1.6.2 " ,
3+ "version" : " 1.6.3 " ,
44 "description" : " Pipedream Hubspot Components" ,
55 "main" : " hubspot.app.mjs" ,
66 "keywords" : [
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default {
1010 key : "hubspot-new-or-updated-contact" ,
1111 name : "New or Updated Contact" ,
1212 description : "Emit new event for each new or updated contact in Hubspot." ,
13- version : "0.0.14 " ,
13+ version : "0.0.15 " ,
1414 dedupe : "unique" ,
1515 type : "source" ,
1616 props : {
@@ -96,16 +96,21 @@ export default {
9696 }
9797 return true ;
9898 } ,
99- getParams ( ) {
99+ getParams ( after ) {
100100 const { properties = [ ] } = this ;
101- return {
101+ const dateProperty = this . newOnly
102+ ? "createdate"
103+ : "lastmodifieddate" ;
104+ const isFirstRun = ! this . db . get ( "after" ) ;
105+
106+ const params = {
102107 data : {
103- limit : DEFAULT_LIMIT ,
108+ limit : isFirstRun
109+ ? 100
110+ : DEFAULT_LIMIT ,
104111 sorts : [
105112 {
106- propertyName : this . newOnly
107- ? "createdate"
108- : "lastmodifieddate" ,
113+ propertyName : dateProperty ,
109114 direction : "DESCENDING" ,
110115 } ,
111116 ] ,
@@ -116,6 +121,22 @@ export default {
116121 } ,
117122 object : "contacts" ,
118123 } ;
124+
125+ if ( after ) {
126+ params . data . filterGroups = [
127+ {
128+ filters : [
129+ {
130+ propertyName : dateProperty ,
131+ operator : "GT" ,
132+ value : after ,
133+ } ,
134+ ] ,
135+ } ,
136+ ] ;
137+ }
138+
139+ return params ;
119140 } ,
120141 async processResults ( after , params ) {
121142 await this . searchCRM ( params , after ) ;
You can’t perform that action at this time.
0 commit comments