diff --git a/components/babelfy/babelfy.app.mjs b/components/babelfy/babelfy.app.mjs index 43faca709912b..f3824893e7a7e 100644 --- a/components/babelfy/babelfy.app.mjs +++ b/components/babelfy/babelfy.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/bitrated/bitrated.app.mjs b/components/bitrated/bitrated.app.mjs index 9525102c7678e..ad10ebdfb1e45 100644 --- a/components/bitrated/bitrated.app.mjs +++ b/components/bitrated/bitrated.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/crypto_apis_by_alternative/crypto_apis_by_alternative.app.mjs b/components/crypto_apis_by_alternative/crypto_apis_by_alternative.app.mjs index 126fb9a1ad12b..6e94a03de39da 100644 --- a/components/crypto_apis_by_alternative/crypto_apis_by_alternative.app.mjs +++ b/components/crypto_apis_by_alternative/crypto_apis_by_alternative.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/embedapi/embedapi.app.mjs b/components/embedapi/embedapi.app.mjs index 0d45837d3b8da..a3ed75b60c177 100644 --- a/components/embedapi/embedapi.app.mjs +++ b/components/embedapi/embedapi.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/financial_modeling_prep/financial_modeling_prep.app.mjs b/components/financial_modeling_prep/financial_modeling_prep.app.mjs index bf73c1482d9a5..792a4f36e3137 100644 --- a/components/financial_modeling_prep/financial_modeling_prep.app.mjs +++ b/components/financial_modeling_prep/financial_modeling_prep.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/gong/actions/add-new-call/add-new-call.mjs b/components/gong/actions/add-new-call/add-new-call.mjs index ddcdfec72e587..2dd91333e6ea2 100644 --- a/components/gong/actions/add-new-call/add-new-call.mjs +++ b/components/gong/actions/add-new-call/add-new-call.mjs @@ -8,7 +8,7 @@ export default { name: "Add New Call", description: "Add a new call. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls)", type: "action", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gong/actions/get-extensive-data/get-extensive-data.mjs b/components/gong/actions/get-extensive-data/get-extensive-data.mjs index dbd787ff8efcc..4b38e84b253b7 100644 --- a/components/gong/actions/get-extensive-data/get-extensive-data.mjs +++ b/components/gong/actions/get-extensive-data/get-extensive-data.mjs @@ -7,7 +7,7 @@ export default { key: "gong-get-extensive-data", name: "Get Extensive Data", description: "Lists detailed call data. [See the documentation](https://gong.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gong/actions/list-calls/list-calls.mjs b/components/gong/actions/list-calls/list-calls.mjs index 9198b5aeab600..5e4e9fe68baef 100644 --- a/components/gong/actions/list-calls/list-calls.mjs +++ b/components/gong/actions/list-calls/list-calls.mjs @@ -5,7 +5,7 @@ export default { name: "List calls", description: "List calls. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)", type: "action", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gong/actions/retrieve-transcripts-of-calls/retrieve-transcripts-of-calls.mjs b/components/gong/actions/retrieve-transcripts-of-calls/retrieve-transcripts-of-calls.mjs index 725e1ad50a2ba..3ba77317eec8c 100644 --- a/components/gong/actions/retrieve-transcripts-of-calls/retrieve-transcripts-of-calls.mjs +++ b/components/gong/actions/retrieve-transcripts-of-calls/retrieve-transcripts-of-calls.mjs @@ -5,7 +5,7 @@ export default { name: "Retrieve Transcripts Of Calls", description: "Retrieve transcripts of calls. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls/transcript)", type: "action", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gong/gong.app.mjs b/components/gong/gong.app.mjs index 828b21a82dd6f..cf273431c7a6a 100644 --- a/components/gong/gong.app.mjs +++ b/components/gong/gong.app.mjs @@ -152,9 +152,11 @@ export default { }) { let cursor; let resourcesCount = 0; + let response; while (true) { - const response = + try { + response = await resourceFn({ ...resourceFnArgs, params: { @@ -162,6 +164,13 @@ export default { cursor, }, }); + } catch (error) { + if (error.response.status === 404) { + console.log("No more resources"); + return; + } + throw error; + } const nextResources = resourceName && response[resourceName] || response; diff --git a/components/gong/package.json b/components/gong/package.json index e9454d2beeef0..973a22875783d 100644 --- a/components/gong/package.json +++ b/components/gong/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/gong", - "version": "0.3.1", + "version": "0.3.2", "description": "Pipedream Gong Components", "main": "gong.app.mjs", "keywords": [ @@ -9,10 +9,10 @@ ], "homepage": "https://pipedream.com/apps/gong", "author": "Pipedream (https://pipedream.com/)", - "dependencies": { - "@pipedream/platform": "^3.1.1" - }, "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.1" } } diff --git a/components/gong/sources/common/polling.mjs b/components/gong/sources/common/polling.mjs index 3ca351d63cefe..d6c5b3a2a3e3e 100644 --- a/components/gong/sources/common/polling.mjs +++ b/components/gong/sources/common/polling.mjs @@ -39,8 +39,12 @@ export default { const meta = this.generateMeta(resource); this.$emit(resource, meta); }, - async processResources(resources) { - const descendingResources = Array.from(resources).reverse(); + async processResources(resources, max) { + let descendingResources = Array.from(resources).reverse(); + + if (max) { + descendingResources = descendingResources.slice(0, max); + } const [ lastResource, @@ -53,6 +57,17 @@ export default { descendingResources.forEach(this.processEvent); }, }, + hooks: { + async deploy() { + const resources = await this.app.paginate({ + resourceFn: this.getResourceFn(), + resourceFnArgs: this.getResourceFnArgs(), + resourceName: this.getResourceName(), + }); + + this.processResources(resources, 25); + }, + }, async run() { const resources = await this.app.paginate({ resourceFn: this.getResourceFn(), diff --git a/components/gong/sources/new-call/new-call.mjs b/components/gong/sources/new-call/new-call.mjs index e9bfadd5a6bc7..09c54d0a4ebeb 100644 --- a/components/gong/sources/new-call/new-call.mjs +++ b/components/gong/sources/new-call/new-call.mjs @@ -4,9 +4,9 @@ export default { ...common, key: "gong-new-call", name: "New Call", - description: "Triggers when a new call is added. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)", + description: "Emit new event when a new call is added. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)", type: "source", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, @@ -17,11 +17,11 @@ export default { return this.app.listCalls; }, getResourceFnArgs() { - const threeMonthsAgo = new Date(); - threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3); + const oneDayAgo = new Date(); + oneDayAgo.setDate(oneDayAgo.getDate() - 1); return { params: { - fromDateTime: this.getLastCreatedAt() || threeMonthsAgo.toISOString(), + fromDateTime: this.getLastCreatedAt() || oneDayAgo.toISOString(), }, }; }, diff --git a/components/ideta/ideta.app.mjs b/components/ideta/ideta.app.mjs index e298792baa865..ef0ad0da07cc3 100644 --- a/components/ideta/ideta.app.mjs +++ b/components/ideta/ideta.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/intelitruth/intelitruth.app.mjs b/components/intelitruth/intelitruth.app.mjs index cddb5407ce95d..845217e88ce72 100644 --- a/components/intelitruth/intelitruth.app.mjs +++ b/components/intelitruth/intelitruth.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/jooble/jooble.app.mjs b/components/jooble/jooble.app.mjs index 957d34b9cc85f..5142e39312dbb 100644 --- a/components/jooble/jooble.app.mjs +++ b/components/jooble/jooble.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/live_score_api/live_score_api.app.mjs b/components/live_score_api/live_score_api.app.mjs index 57035642b38da..ede1f3f3fa538 100644 --- a/components/live_score_api/live_score_api.app.mjs +++ b/components/live_score_api/live_score_api.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/loginradius/loginradius.app.mjs b/components/loginradius/loginradius.app.mjs index 568bb1efbf021..71ff7fe638b64 100644 --- a/components/loginradius/loginradius.app.mjs +++ b/components/loginradius/loginradius.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/mallabe/mallabe.app.mjs b/components/mallabe/mallabe.app.mjs index 5ef42359d504e..01fd2efd4e20a 100644 --- a/components/mallabe/mallabe.app.mjs +++ b/components/mallabe/mallabe.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/marcom_robot/marcom_robot.app.mjs b/components/marcom_robot/marcom_robot.app.mjs index 74e6e11e1076c..85c55a25b65b1 100644 --- a/components/marcom_robot/marcom_robot.app.mjs +++ b/components/marcom_robot/marcom_robot.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/meetgeek/meetgeek.app.mjs b/components/meetgeek/meetgeek.app.mjs index 27d216dc58a05..8b925cbc312ea 100644 --- a/components/meetgeek/meetgeek.app.mjs +++ b/components/meetgeek/meetgeek.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/microsoft_azure_monitor/microsoft_azure_monitor.app.mjs b/components/microsoft_azure_monitor/microsoft_azure_monitor.app.mjs index 17e82a31af5c4..5127f45bda86e 100644 --- a/components/microsoft_azure_monitor/microsoft_azure_monitor.app.mjs +++ b/components/microsoft_azure_monitor/microsoft_azure_monitor.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/mymemory/mymemory.app.mjs b/components/mymemory/mymemory.app.mjs index 7d5dc31a4b7f6..bfcaf72b1fc12 100644 --- a/components/mymemory/mymemory.app.mjs +++ b/components/mymemory/mymemory.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/nele_ai/nele_ai.app.mjs b/components/nele_ai/nele_ai.app.mjs index b42004b0862a7..2de15e4012a22 100644 --- a/components/nele_ai/nele_ai.app.mjs +++ b/components/nele_ai/nele_ai.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/octave/octave.app.mjs b/components/octave/octave.app.mjs index c3b7165562982..b975b70d481c7 100644 --- a/components/octave/octave.app.mjs +++ b/components/octave/octave.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/olostep/olostep.app.mjs b/components/olostep/olostep.app.mjs index c0909a866dcd9..28e3236bf609f 100644 --- a/components/olostep/olostep.app.mjs +++ b/components/olostep/olostep.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/opencti/opencti.app.mjs b/components/opencti/opencti.app.mjs index 0d4a9cd757665..82f69a4353bc7 100644 --- a/components/opencti/opencti.app.mjs +++ b/components/opencti/opencti.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/orq_ai/orq_ai.app.mjs b/components/orq_ai/orq_ai.app.mjs index 72e17774008d6..433582d952155 100644 --- a/components/orq_ai/orq_ai.app.mjs +++ b/components/orq_ai/orq_ai.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/progress_agentic_rag/progress_agentic_rag.app.mjs b/components/progress_agentic_rag/progress_agentic_rag.app.mjs index 3108ca5de7ba3..e957baf846b40 100644 --- a/components/progress_agentic_rag/progress_agentic_rag.app.mjs +++ b/components/progress_agentic_rag/progress_agentic_rag.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/stock_news_api/stock_news_api.app.mjs b/components/stock_news_api/stock_news_api.app.mjs index 15c26c340aa58..7a93a1695d7d7 100644 --- a/components/stock_news_api/stock_news_api.app.mjs +++ b/components/stock_news_api/stock_news_api.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/stocknewsapi/stocknewsapi.app.mjs b/components/stocknewsapi/stocknewsapi.app.mjs index d29c7ba200c81..7d3605c616c80 100644 --- a/components/stocknewsapi/stocknewsapi.app.mjs +++ b/components/stocknewsapi/stocknewsapi.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/webspellchecker/webspellchecker.app.mjs b/components/webspellchecker/webspellchecker.app.mjs index da3aeeccfb6d5..2d69f60ec4d54 100644 --- a/components/webspellchecker/webspellchecker.app.mjs +++ b/components/webspellchecker/webspellchecker.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/yext_sandbox/yext_sandbox.app.mjs b/components/yext_sandbox/yext_sandbox.app.mjs index 5a2988be1cdfc..57f197a5d27b6 100644 --- a/components/yext_sandbox/yext_sandbox.app.mjs +++ b/components/yext_sandbox/yext_sandbox.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +};