Skip to content

Commit 15a43a4

Browse files
Update components that use $.context and/or $.flow for use with Connect (#17346)
* updates * pnpm-lock.yaml * update * versions * pnpm-lock.yaml * pnpm-lock.yaml * add app prop * updates * pnpm-lock.yaml * remove debug * version * updates * replace $checkpoint with dataStore * versions * pnpm-lock.yaml --------- Co-authored-by: Guilherme Falcão <[email protected]>
1 parent 85660f8 commit 15a43a4

File tree

46 files changed

+288
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+288
-125
lines changed

components/assemblyai/actions/get-transcription/get-transcription.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
name: "Get Transcription",
55
description: "Fetches a specific transcribed result from the AssemblyAI API. [See the documentation](https://www.assemblyai.com/docs/API%20reference/transcript)",
66
key: "assemblyai-get-transcription",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
assemblyai,
@@ -52,16 +52,21 @@ export default {
5252
callbackWithRerun: {
5353
type: "boolean",
5454
label: "Callback With Rerun",
55-
description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the transcription is completed. Overrides the `webhookUrl` prop. This will increase execution time and credit usage as a result. [See the documentation(https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun)",
55+
description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the transcription is completed. Overrides the `webhookUrl` prop. This will increase execution time and credit usage as a result. [See the documentation(https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun). Not available in Pipedream Connect.",
5656
optional: true,
5757
},
5858
},
5959
async run({ $ }) {
6060
let response;
61-
const { run } = $.context;
61+
const context = $.context;
62+
const run = context
63+
? context.run
64+
: {
65+
runs: 1,
66+
};
6267
if (run.runs === 1) {
6368
let webhookUrl = this.webhookUrl;
64-
if (this.callbackWithRerun) {
69+
if (context && this.callbackWithRerun) {
6570
({ resume_url: webhookUrl } = $.flow.rerun(600000, null, 1));
6671
}
6772
response = await this.assemblyai.createTranscript({

components/assemblyai/package.json

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

components/contactout/actions/verify-email-bulk/verify-email-bulk.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "contactout-verify-email-bulk",
66
name: "Verify Email Bulk",
77
description: "Verify the deliverability for a batch of up to 1000 email addresses in bulk. [See the documentation](https://api.contactout.com/#bulk).",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
app,
@@ -26,7 +26,7 @@ export default {
2626
waitForCompletion: {
2727
type: "boolean",
2828
label: "Wait for Completion",
29-
description: "If set to `true`, the action will wait and poll until the bulk verification job is `DONE`. If set to `false`, it will return immediately after creating the job.",
29+
description: "If set to `true`, the action will wait and poll until the bulk verification job is `DONE`. If set to `false`, it will return immediately after creating the job. Not available in Pipedream Connect.",
3030
default: false,
3131
optional: true,
3232
},
@@ -41,7 +41,12 @@ export default {
4141

4242
const MAX_RETRIES = 15;
4343
const DELAY = 1000 * 15; // 15 seconds
44-
const { run } = $.context;
44+
const context = $.context;
45+
const run = context
46+
? context.run
47+
: {
48+
runs: 1,
49+
};
4550

4651
// First run: Create the bulk verification job
4752
if (run.runs === 1) {
@@ -56,7 +61,7 @@ export default {
5661
$.export("$summary", `Successfully queued bulk email verification with job ID \`${response.job_id}\`.`);
5762

5863
// If user doesn't want to wait, return immediately
59-
if (!waitForCompletion) {
64+
if (!waitForCompletion || !context) {
6065
return response;
6166
}
6267

components/contactout/package.json

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

components/ecwid/actions/update-order-status/update-order-status.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FULFILMENT_STATUS_LIST } from "../../commons/commons.mjs";
22
import ecwid from "../../ecwid.app.mjs";
33
export default {
44
name: "Ecwid Update Order Status",
5-
version: "0.0.5",
5+
version: "0.0.6",
66
key: "ecwid-update-order-status",
77
description: "Update the Status of an Ecwid Order. Makes use of the [Update Order API](https://api-docs.ecwid.com/reference/update-order).",
88
props: {
@@ -44,7 +44,11 @@ export default {
4444
console.error("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus);
4545
update = "ERROR";
4646
$.export("$summary", "Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus);
47-
return $.flow.exit("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus);
47+
if ($.flow) {
48+
return $.flow.exit("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus);
49+
} else {
50+
throw new Error("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus);
51+
}
4852
}
4953
} else {
5054
$.export("$summary", "No updates done to order " + this.orderId);

components/ecwid/package.json

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

components/enrow/actions/find-single-email/find-single-email.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "enrow-find-single-email",
55
name: "Find Single Email",
66
description: "Executes a single email search using Enrow email finder. [See the documentation](https://enrow.readme.io/reference/find-single-email)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
enrow,
@@ -51,16 +51,21 @@ export default {
5151
callbackWithRerun: {
5252
type: "boolean",
5353
label: "Callback With Rerun",
54-
description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the search is completed. Overrides the `webhookUrl` prop. This will increase execution time and credit usage as a result. [See the documentation(https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun)",
54+
description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the search is completed. Overrides the `webhookUrl` prop. This will increase execution time and credit usage as a result. [See the documentation(https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun). Not available in Pipedream Connect.",
5555
optional: true,
5656
},
5757
},
5858
async run({ $ }) {
5959
let response;
60-
const { run } = $.context;
60+
const context = $.context;
61+
const run = context
62+
? context.run
63+
: {
64+
runs: 1,
65+
};
6166
if (run.runs === 1) {
6267
let webhook = this.webhookUrl;
63-
if (this.callbackWithRerun) {
68+
if (context && this.callbackWithRerun) {
6469
({ resume_url: webhook } = $.flow.rerun(600000, null, 1));
6570
}
6671
response = await this.enrow.executeSearch({

components/enrow/package.json

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

components/fal_ai/actions/add-request-to-queue/add-request-to-queue.mjs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "fal_ai-add-request-to-queue",
55
name: "Add Request to Queue",
66
description: "Adds a request to the queue for asynchronous processing, including specifying a webhook URL for receiving updates. [See the documentation](https://fal.ai/docs/model-endpoints/queue#queue-endpoints).",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
app,
@@ -38,7 +38,7 @@ export default {
3838
reRunTimeoutInSecs: {
3939
type: "integer",
4040
label: "Rerun Timeout",
41-
description: "The time in seconds to wait before rerunning the step to retrieve the request response. Eg. `30`. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun/#flowrerun).",
41+
description: "The time in seconds to wait before rerunning the step to retrieve the request response. Eg. `30`. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun/#flowrerun). Not for use in Pipedream Connect.",
4242
optional: true,
4343
min: 10,
4444
},
@@ -65,14 +65,17 @@ export default {
6565
},
6666
},
6767
async run({ $ }) {
68+
const context = $.context;
6869
const {
69-
context: {
70-
run: {
71-
runs,
72-
callback_request: callbackRequest,
73-
},
70+
run: {
71+
runs, callback_request: callbackRequest,
72+
},
73+
} = context || {
74+
run: {
75+
runs: 1,
76+
callback_request: undefined,
7477
},
75-
} = $;
78+
};
7679

7780
const {
7881
app,
@@ -100,7 +103,11 @@ export default {
100103

101104
if (runs === 1) {
102105
const timeout = 1000 * (reRunTimeoutInSecs || 10);
103-
const { resume_url: resumeUrl } = $.flow.rerun(timeout, null, 1);
106+
const { resume_url: resumeUrl } = context
107+
? $.flow.rerun(timeout, null, 1)
108+
: {
109+
resume_url: undefined,
110+
};
104111

105112
return addToQueue({
106113
$,

components/fal_ai/package.json

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

0 commit comments

Comments
 (0)