diff --git a/components/assemblyai/actions/get-transcription/get-transcription.mjs b/components/assemblyai/actions/get-transcription/get-transcription.mjs index 84952566112ce..c334dbfc0fe3b 100644 --- a/components/assemblyai/actions/get-transcription/get-transcription.mjs +++ b/components/assemblyai/actions/get-transcription/get-transcription.mjs @@ -4,7 +4,7 @@ export default { name: "Get Transcription", description: "Fetches a specific transcribed result from the AssemblyAI API. [See the documentation](https://www.assemblyai.com/docs/API%20reference/transcript)", key: "assemblyai-get-transcription", - version: "0.0.2", + version: "0.0.3", type: "action", props: { assemblyai, @@ -52,16 +52,21 @@ export default { callbackWithRerun: { type: "boolean", label: "Callback With Rerun", - 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)", + 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.", optional: true, }, }, async run({ $ }) { let response; - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; if (run.runs === 1) { let webhookUrl = this.webhookUrl; - if (this.callbackWithRerun) { + if (context && this.callbackWithRerun) { ({ resume_url: webhookUrl } = $.flow.rerun(600000, null, 1)); } response = await this.assemblyai.createTranscript({ diff --git a/components/assemblyai/package.json b/components/assemblyai/package.json index c46070bd9486e..f864b10394e7d 100644 --- a/components/assemblyai/package.json +++ b/components/assemblyai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/assemblyai", - "version": "0.2.0", + "version": "0.2.1", "description": "Pipedream AssemblyAI Components", "main": "assemblyai.app.mjs", "keywords": [ diff --git a/components/contactout/actions/verify-email-bulk/verify-email-bulk.mjs b/components/contactout/actions/verify-email-bulk/verify-email-bulk.mjs index c897383871fb3..c4672db4f12b2 100644 --- a/components/contactout/actions/verify-email-bulk/verify-email-bulk.mjs +++ b/components/contactout/actions/verify-email-bulk/verify-email-bulk.mjs @@ -5,7 +5,7 @@ export default { key: "contactout-verify-email-bulk", name: "Verify Email Bulk", description: "Verify the deliverability for a batch of up to 1000 email addresses in bulk. [See the documentation](https://api.contactout.com/#bulk).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { app, @@ -26,7 +26,7 @@ export default { waitForCompletion: { type: "boolean", label: "Wait for Completion", - 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.", + 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.", default: false, optional: true, }, @@ -41,7 +41,12 @@ export default { const MAX_RETRIES = 15; const DELAY = 1000 * 15; // 15 seconds - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; // First run: Create the bulk verification job if (run.runs === 1) { @@ -56,7 +61,7 @@ export default { $.export("$summary", `Successfully queued bulk email verification with job ID \`${response.job_id}\`.`); // If user doesn't want to wait, return immediately - if (!waitForCompletion) { + if (!waitForCompletion || !context) { return response; } diff --git a/components/contactout/package.json b/components/contactout/package.json index 06864c92b8710..29ee88590fa88 100644 --- a/components/contactout/package.json +++ b/components/contactout/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/contactout", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream ContactOut Components", "main": "contactout.app.mjs", "keywords": [ diff --git a/components/ecwid/actions/update-order-status/update-order-status.mjs b/components/ecwid/actions/update-order-status/update-order-status.mjs index 04064136561dc..c51c23da971ee 100644 --- a/components/ecwid/actions/update-order-status/update-order-status.mjs +++ b/components/ecwid/actions/update-order-status/update-order-status.mjs @@ -2,7 +2,7 @@ import { FULFILMENT_STATUS_LIST } from "../../commons/commons.mjs"; import ecwid from "../../ecwid.app.mjs"; export default { name: "Ecwid Update Order Status", - version: "0.0.5", + version: "0.0.6", key: "ecwid-update-order-status", description: "Update the Status of an Ecwid Order. Makes use of the [Update Order API](https://api-docs.ecwid.com/reference/update-order).", props: { @@ -44,7 +44,11 @@ export default { console.error("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus); update = "ERROR"; $.export("$summary", "Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus); - return $.flow.exit("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus); + if ($.flow) { + return $.flow.exit("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus); + } else { + throw new Error("Error Updating Order Status of " + this.orderId + " to " + this.fulfilmentStatus); + } } } else { $.export("$summary", "No updates done to order " + this.orderId); diff --git a/components/ecwid/package.json b/components/ecwid/package.json index 623c69e6cc95f..0f050d6a0a217 100644 --- a/components/ecwid/package.json +++ b/components/ecwid/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/ecwid", - "version": "0.0.11", + "version": "0.0.12", "description": "Pipedream Ecwid Components", "main": "ecwid.app.mjs", "keywords": [ diff --git a/components/enrow/actions/find-single-email/find-single-email.mjs b/components/enrow/actions/find-single-email/find-single-email.mjs index 404624f61d4f6..085e54cc2e606 100644 --- a/components/enrow/actions/find-single-email/find-single-email.mjs +++ b/components/enrow/actions/find-single-email/find-single-email.mjs @@ -4,7 +4,7 @@ export default { key: "enrow-find-single-email", name: "Find Single Email", description: "Executes a single email search using Enrow email finder. [See the documentation](https://enrow.readme.io/reference/find-single-email)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { enrow, @@ -51,16 +51,21 @@ export default { callbackWithRerun: { type: "boolean", label: "Callback With Rerun", - 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)", + 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.", optional: true, }, }, async run({ $ }) { let response; - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; if (run.runs === 1) { let webhook = this.webhookUrl; - if (this.callbackWithRerun) { + if (context && this.callbackWithRerun) { ({ resume_url: webhook } = $.flow.rerun(600000, null, 1)); } response = await this.enrow.executeSearch({ diff --git a/components/enrow/package.json b/components/enrow/package.json index fe45c628287da..4751f9a307202 100644 --- a/components/enrow/package.json +++ b/components/enrow/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/enrow", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Enrow Components", "main": "enrow.app.mjs", "keywords": [ diff --git a/components/fal_ai/actions/add-request-to-queue/add-request-to-queue.mjs b/components/fal_ai/actions/add-request-to-queue/add-request-to-queue.mjs index 4e7370c783b83..a5e4637a96fb1 100644 --- a/components/fal_ai/actions/add-request-to-queue/add-request-to-queue.mjs +++ b/components/fal_ai/actions/add-request-to-queue/add-request-to-queue.mjs @@ -4,7 +4,7 @@ export default { key: "fal_ai-add-request-to-queue", name: "Add Request to Queue", 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).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { app, @@ -38,7 +38,7 @@ export default { reRunTimeoutInSecs: { type: "integer", label: "Rerun Timeout", - 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).", + 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.", optional: true, min: 10, }, @@ -65,14 +65,17 @@ export default { }, }, async run({ $ }) { + const context = $.context; const { - context: { - run: { - runs, - callback_request: callbackRequest, - }, + run: { + runs, callback_request: callbackRequest, + }, + } = context || { + run: { + runs: 1, + callback_request: undefined, }, - } = $; + }; const { app, @@ -100,7 +103,11 @@ export default { if (runs === 1) { const timeout = 1000 * (reRunTimeoutInSecs || 10); - const { resume_url: resumeUrl } = $.flow.rerun(timeout, null, 1); + const { resume_url: resumeUrl } = context + ? $.flow.rerun(timeout, null, 1) + : { + resume_url: undefined, + }; return addToQueue({ $, diff --git a/components/fal_ai/package.json b/components/fal_ai/package.json index d0a3a59b08d02..cf050afc62691 100644 --- a/components/fal_ai/package.json +++ b/components/fal_ai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/fal_ai", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream fal.ai Components", "main": "fal_ai.app.mjs", "keywords": [ diff --git a/components/fireflies/actions/upload-audio/upload-audio.mjs b/components/fireflies/actions/upload-audio/upload-audio.mjs index a95cc6d30bb50..0fd28ae61c690 100644 --- a/components/fireflies/actions/upload-audio/upload-audio.mjs +++ b/components/fireflies/actions/upload-audio/upload-audio.mjs @@ -5,7 +5,7 @@ export default { key: "fireflies-upload-audio", name: "Upload Audio", description: "Creates and stores a new meeting in Fireflies, allowing it to be transcribed and shared. [See the documentation](https://docs.fireflies.ai/graphql-api/mutation/upload-audio)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { fireflies, @@ -28,16 +28,21 @@ export default { callbackWithRerun: { type: "boolean", label: "Callback With Rerun", - 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)", + 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.", optional: true, }, }, async run({ $ }) { let response; - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; if (run.runs === 1) { let webhookUrl = this.webhookUrl; - if (this.callbackWithRerun) { + if (context && this.callbackWithRerun) { ({ resume_url: webhookUrl } = $.flow.rerun(600000, null, 1)); } response = await this.fireflies.query({ diff --git a/components/fireflies/package.json b/components/fireflies/package.json index c34778845bfcd..f1ad5d43f1b1a 100644 --- a/components/fireflies/package.json +++ b/components/fireflies/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/fireflies", - "version": "0.1.1", + "version": "0.1.2", "description": "Pipedream Fireflies Components", "main": "fireflies.app.mjs", "keywords": [ diff --git a/components/helper_functions/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs b/components/helper_functions/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs index 4f37860cb81e1..787199238322d 100644 --- a/components/helper_functions/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs +++ b/components/helper_functions/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs @@ -6,12 +6,13 @@ export default { key: "helper_functions-retrieve-all-rss-stories", name: "Retrieve all RSS Stories", description: "Retrieve all stories from one or more RSS feeds.", - version: "0.1.1", + version: "0.1.2", type: "action", props: { helper_functions, rss_feeds: { - type: "any", + type: "string[]", + label: "RSS Feeds", description: "The URL(s) of the RSS Feeds", }, }, @@ -20,7 +21,7 @@ export default { let stories = []; - for (url of this.rss_feeds) { + for (const url of this.rss_feeds) { let feed = await parser.parseURL(url); console.log(feed.title); @@ -31,7 +32,11 @@ export default { } if (!stories.length) { - $.flow.exit("No new stories"); + if ($.flow) { + $.flow.exit("No new stories"); + } else { + console.log("No new stories"); + } } return stories; diff --git a/components/helper_functions/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs b/components/helper_functions/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs index ed845965e2f00..b5fc76bff9ed9 100644 --- a/components/helper_functions/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs +++ b/components/helper_functions/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs @@ -1,29 +1,31 @@ // legacy_hash_id: a_k6iY38 import Parser from "rss-parser"; -import get from "lodash.get"; import helper_functions from "../../helper_functions.app.mjs"; export default { key: "helper_functions-retrieve-new-rss-stories", name: "Retrieve New RSS Stories", description: "Gets new stories from a specified RSS feed that have not already been processed.", - version: "0.2.1", + version: "0.2.2", type: "action", props: { helper_functions, - db: "$.service.db", + dataStore: { + type: "data_store", + }, rss_feeds: { - type: "any", + type: "string[]", + label: "RSS Feeds", description: "The URL(s) of the RSS Feeds", }, }, async run({ $ }) { let parser = new Parser(); - const previouslyPostedStories = get(this, "$checkpoint", []); + const previouslyPostedStories = await this.dataStore.get("previouslyPostedStories") || []; let newStories = []; - for (url of this.rss_feeds) { + for (const url of this.rss_feeds) { let feed = await parser.parseURL(url); console.log(feed.title); @@ -36,10 +38,14 @@ export default { } if (!newStories.length) { - $.flow.exit("No new stories"); + if ($.flow) { + $.flow.exit("No new stories"); + } else { + console.log("No new stories"); + } } - this.db.set("$checkpoint", previouslyPostedStories.concat(newStories.map((s) => s.link))); + await this.dataStore.set("previouslyPostedStories", previouslyPostedStories.concat(newStories.map((s) => s.link))); return newStories; }, }; diff --git a/components/helper_functions/package.json b/components/helper_functions/package.json index df2cd364cec3a..6321b24c1e608 100644 --- a/components/helper_functions/package.json +++ b/components/helper_functions/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/helper_functions", - "version": "0.5.2", + "version": "0.5.3", "description": "Pipedream Helper_functions Components", "main": "helper_functions.app.mjs", "keywords": [ diff --git a/components/heygen/actions/common/video-polling.mjs b/components/heygen/actions/common/video-polling.mjs index f8ff4e8bd93d2..85089c5b02f56 100644 --- a/components/heygen/actions/common/video-polling.mjs +++ b/components/heygen/actions/common/video-polling.mjs @@ -6,12 +6,19 @@ export default { heygen, }, async run({ $ }) { - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; if (run.runs === 1) { const videoId = await this.processVideo($); - $.flow.rerun(constants.DELAY, { - videoId, - }); + if (context) { + $.flow.rerun(constants.DELAY, { + videoId, + }); + } } else { const videoId = run.context.videoId; diff --git a/components/heygen/actions/create-talking-photo/create-talking-photo.mjs b/components/heygen/actions/create-talking-photo/create-talking-photo.mjs index 1a826f44b94c2..d6c678d408dea 100644 --- a/components/heygen/actions/create-talking-photo/create-talking-photo.mjs +++ b/components/heygen/actions/create-talking-photo/create-talking-photo.mjs @@ -6,7 +6,7 @@ export default { key: "heygen-create-talking-photo", name: "Create Talking Photo", description: "Creates a talking photo from a provided image. [See the documentation](https://docs.heygen.com/reference/create-an-avatar-video-v2)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { ...common.props, diff --git a/components/heygen/actions/create-video-from-template/create-video-from-template.mjs b/components/heygen/actions/create-video-from-template/create-video-from-template.mjs index ea7c96e292dac..9a07dffbf4601 100644 --- a/components/heygen/actions/create-video-from-template/create-video-from-template.mjs +++ b/components/heygen/actions/create-video-from-template/create-video-from-template.mjs @@ -6,7 +6,7 @@ export default { key: "heygen-create-video-from-template", name: "Create Video From Template", description: "Generates a video from a selected template. [See the documentation](https://docs.heygen.com/reference/generate-template)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { ...common.props, diff --git a/components/heygen/package.json b/components/heygen/package.json index 25860431a0b28..ca21460222186 100644 --- a/components/heygen/package.json +++ b/components/heygen/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/heygen", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream HeyGen Components", "main": "heygen.app.mjs", "keywords": [ diff --git a/components/http/actions/validate-webhook-auth/validate-webhook-auth.mjs b/components/http/actions/validate-webhook-auth/validate-webhook-auth.mjs index 8fb576d18bcc7..4610e575c5edf 100644 --- a/components/http/actions/validate-webhook-auth/validate-webhook-auth.mjs +++ b/components/http/actions/validate-webhook-auth/validate-webhook-auth.mjs @@ -2,7 +2,7 @@ import http from "../../http.app.mjs"; export default { name: "Validate Webhook Auth", - version: "0.0.3", + version: "0.0.4", key: "http-validate-webhook-auth", description: "Require authorization for incoming HTTP webhook requests. Make sure to configure the HTTP trigger to \"Return a custom response from your workflow\".", type: "action", @@ -96,7 +96,11 @@ export default { body: "Invalid credentials", }); } - return $.flow.exit("Invalid credentials"); + if ($.flow) { + return $.flow.exit("Invalid credentials"); + } else { + throw new Error("Invalid credentials"); + } } $.export("$summary", "HTTP request successfully authenticated"); }, diff --git a/components/http/actions/verify-hmac-signature/verify-hmac-signature.mjs b/components/http/actions/verify-hmac-signature/verify-hmac-signature.mjs index 0600bfa70b1e0..8141961aa9223 100644 --- a/components/http/actions/verify-hmac-signature/verify-hmac-signature.mjs +++ b/components/http/actions/verify-hmac-signature/verify-hmac-signature.mjs @@ -1,13 +1,14 @@ import crypto from "crypto"; +import http from "../../http.app.mjs"; export default { name: "Verify HMAC Signature", - version: "0.0.1", + version: "0.0.2", key: "http-verify-hmac-signature", description: "Validate HMAC signature for incoming HTTP webhook requests. Make sure to configure the HTTP trigger to \"Return a custom response from your workflow\".", type: "action", props: { - http: "$.interface.http", + http, secret: { type: "string", label: "Secret", @@ -60,7 +61,11 @@ export default { body: "Invalid credentials", }); } - return $.flow.exit("Invalid credentials"); + if ($.flow) { + return $.flow.exit("Invalid credentials"); + } else { + throw new Error("Invalid credentials"); + } } $.export("$summary", "HTTP request successfully authenticated"); diff --git a/components/http/package.json b/components/http/package.json index e38122f17a4f1..213ab3dfe2c72 100644 --- a/components/http/package.json +++ b/components/http/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/http", - "version": "0.5.1", + "version": "0.5.2", "description": "Pipedream Http Components", "main": "http.app.mjs", "keywords": [ diff --git a/components/imgur/actions/upload-image/upload-image.mjs b/components/imgur/actions/upload-image/upload-image.mjs index e167194e65fa7..500aba0237553 100644 --- a/components/imgur/actions/upload-image/upload-image.mjs +++ b/components/imgur/actions/upload-image/upload-image.mjs @@ -1,25 +1,46 @@ import imgur from "../../imgur.app.mjs"; +import { getFileStream } from "@pipedream/platform"; export default { name: "Upload Image", - version: "0.1.0", + version: "1.0.0", key: "imgur-upload-image", description: "Upload an image to Imgur", + type: "action", props: { imgur, image: { type: "string", label: "Image", - description: "A base 64 encoded image", + description: "Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFlie.pdf).", + }, + }, + methods: { + streamToBase64(stream) { + return new Promise((resolve, reject) => { + const chunks = []; + stream.on("data", (chunk) => chunks.push(chunk)); + stream.on("end", () => { + const buffer = Buffer.concat(chunks); + resolve(buffer.toString("base64")); + }); + stream.on("error", reject); + }); }, }, - type: "action", async run({ $ }) { - const res = await this.imgur.uploadImage(this.image); + const stream = await getFileStream(this.image); + const base64 = await this.streamToBase64(stream); + + const res = await this.imgur.uploadImage(base64); - if (!res.status == 200) { + if (res.status !== 200) { $.export("response", res); - return $.flow.exit("Failed to upload."); + if ($.flow) { + return $.flow.exit("Failed to upload."); + } else { + throw new Error("Failed to upload."); + } } return res; diff --git a/components/imgur/imgur.app.mjs b/components/imgur/imgur.app.mjs index c18b4ac77dd08..70c15d7bdbf8e 100644 --- a/components/imgur/imgur.app.mjs +++ b/components/imgur/imgur.app.mjs @@ -6,10 +6,6 @@ export default { app: "imgur", propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); - }, /** * Upload a screenshot to Imgur * diff --git a/components/imgur/package.json b/components/imgur/package.json index 9c4ce9c4fb45a..023aef91e9452 100644 --- a/components/imgur/package.json +++ b/components/imgur/package.json @@ -1,8 +1,8 @@ { "name": "@pipedream/imgur", - "version": "1.0.0", + "version": "2.0.0", "description": "The imgur app file for Pipedream action & trigger integrations.", - "main": "index.js", + "main": "imgur.app.mjs", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -15,5 +15,7 @@ "publishConfig": { "access": "public" }, - "license": "ISC" + "dependencies": { + "@pipedream/platform": "^3.1.0" + } } diff --git a/components/lamini/actions/create-fine-tune-job/create-fine-tune-job.mjs b/components/lamini/actions/create-fine-tune-job/create-fine-tune-job.mjs index 5a84bf18d977e..37a69e549c758 100644 --- a/components/lamini/actions/create-fine-tune-job/create-fine-tune-job.mjs +++ b/components/lamini/actions/create-fine-tune-job/create-fine-tune-job.mjs @@ -6,7 +6,7 @@ export default { key: "lamini-create-fine-tune-job", name: "Create Fine-Tune Job", description: "Create a fine-tuning job with a dataset. [See the documentation](https://docs.lamini.ai/api/).", - version: "0.0.2", + version: "0.0.3", type: "action", props: { app, @@ -52,7 +52,7 @@ export default { waitForCompletion: { type: "boolean", label: "Wait for Completion", - description: "If set to `true`, the action will wait and poll until the fine-tuning job is `COMPLETED`. If is set to `false`, it will return immediately after creating the job.", + description: "If set to `true`, the action will wait and poll until the fine-tuning job is `COMPLETED`. If is set to `false`, it will return immediately after creating the job. Not available in Pipedream Connect.", default: false, optional: true, }, @@ -81,7 +81,12 @@ export default { const MAX_RETRIES = 15; const DELAY = 1000 * 30; // 30 seconds - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; // First run: Create the fine-tune job if (run.runs === 1) { @@ -114,7 +119,7 @@ export default { $.export("$summary", `Successfully created a fine-tune job with ID \`${response.job_id}\`.`); // If user doesn't want to wait, return immediately - if (!waitForCompletion) { + if (!waitForCompletion || !context) { return response; } diff --git a/components/lamini/package.json b/components/lamini/package.json index bdf0a1692df90..fbdfe3099c64a 100644 --- a/components/lamini/package.json +++ b/components/lamini/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/lamini", - "version": "1.0.0", + "version": "1.0.1", "description": "Pipedream Lamini Components", "main": "lamini.app.mjs", "keywords": [ diff --git a/components/pipedream_utils/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs b/components/pipedream_utils/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs index 98bc37adacff6..f4aaa6395c37c 100644 --- a/components/pipedream_utils/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs +++ b/components/pipedream_utils/actions/retrieve-all-rss-stories/retrieve-all-rss-stories.mjs @@ -6,12 +6,13 @@ export default { key: "pipedream_utils-retrieve-all-rss-stories", name: "Helper Functions - Retrieve all RSS Stories", description: "Retrieve all stories from one or more RSS feeds.", - version: "0.0.1", + version: "0.0.2", type: "action", props: { pipedream_utils, rss_feeds: { - type: "any", + type: "string[]", + label: "RSS Feeds", description: "The URL(s) of the RSS Feeds", }, }, @@ -31,7 +32,11 @@ export default { } if (!stories.length) { - $.flow.exit("No new stories"); + if ($.flow) { + $.flow.exit("No new stories"); + } else { + console.log("No new stories"); + } } return stories; diff --git a/components/pipedream_utils/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs b/components/pipedream_utils/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs index 389deb6b0729d..7303198948bd2 100644 --- a/components/pipedream_utils/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs +++ b/components/pipedream_utils/actions/retrieve-new-rss-stories/retrieve-new-rss-stories.mjs @@ -1,26 +1,28 @@ // legacy_hash_id: a_k6iY38 import Parser from "rss-parser"; -import get from "lodash.get"; import pipedream_utils from "../../pipedream_utils.app.mjs"; export default { key: "pipedream_utils-retrieve-new-rss-stories", name: "Helper Functions - Retrieve New RSS Stories", description: "Gets new stories from a specified RSS feed that have not already been processed.", - version: "0.0.1", + version: "0.0.2", type: "action", props: { pipedream_utils, - db: "$.service.db", + dataStore: { + type: "data_store", + }, rss_feeds: { - type: "any", + type: "string[]", + label: "RSS Feeds", description: "The URL(s) of the RSS Feeds", }, }, async run({ $ }) { let parser = new Parser(); - const previouslyPostedStories = get(this, "$checkpoint", []); + const previouslyPostedStories = await this.dataStore.get("previouslyPostedStories") || []; let newStories = []; for (const url of this.rss_feeds) { @@ -36,10 +38,14 @@ export default { } if (!newStories.length) { - $.flow.exit("No new stories"); + if ($.flow) { + $.flow.exit("No new stories"); + } else { + console.log("No new stories"); + } } - this.db.set("$checkpoint", previouslyPostedStories.concat(newStories.map((s) => s.link))); + await this.dataStore.set("previouslyPostedStories", previouslyPostedStories.concat(newStories.map((s) => s.link))); return newStories; }, }; diff --git a/components/pipedream_utils/package.json b/components/pipedream_utils/package.json index 9bb88a47385bc..55eedbb0f1b34 100644 --- a/components/pipedream_utils/package.json +++ b/components/pipedream_utils/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/pipedream_utils", - "version": "0.0.8", + "version": "0.0.9", "description": "Pipedream Utils Components", "main": "pipedream_utils.app.mjs", "keywords": [ diff --git a/components/shopify_partner/actions/verify-webhook/verify-webhook.mjs b/components/shopify_partner/actions/verify-webhook/verify-webhook.mjs index 72fb351742f65..95ab9f3a60b58 100644 --- a/components/shopify_partner/actions/verify-webhook/verify-webhook.mjs +++ b/components/shopify_partner/actions/verify-webhook/verify-webhook.mjs @@ -3,7 +3,7 @@ import crypto from "crypto"; export default { name: "Verify Webhook", - version: "0.0.5", + version: "0.0.6", key: "shopify_partner-verify-webhook", description: "Verify an incoming webhook from Shopify. Exits the workflow if the signature is not valid, otherwise returns `true`", @@ -46,7 +46,11 @@ export default { if (hash !== shopifyHmac) { console.log("Invalid webhook signature, unauthorized"); console.log(shopifyHmac, hash); - return $.flow.exit("Invalid webhook signature."); + if ($.flow) { + return $.flow.exit("Invalid webhook signature."); + } else { + throw new Error("Invalid webhook signature."); + } } return true; diff --git a/components/shopify_partner/package.json b/components/shopify_partner/package.json index e06e28914d0d9..dfa966be23d06 100644 --- a/components/shopify_partner/package.json +++ b/components/shopify_partner/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/shopify_partner", - "version": "0.1.4", + "version": "0.1.5", "description": "Pipedream Shopify Partner Components", "main": "shopify_partner.app.mjs", "keywords": [ diff --git a/components/twin/actions/browse/browse.mjs b/components/twin/actions/browse/browse.mjs index 9f3aab2ad61c3..aa6a1f0912fde 100644 --- a/components/twin/actions/browse/browse.mjs +++ b/components/twin/actions/browse/browse.mjs @@ -4,7 +4,7 @@ export default { key: "twin-browse", name: "Browse", description: "Browse the internet with an AI web navigation agent that can find information for you. [See the documentation](https://docs.twin.so/api-reference/endpoint/browse)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { twin, @@ -33,15 +33,20 @@ export default { callbackWithRerun: { type: "boolean", label: "Callback With Rerun", - description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the search is completed. This will increase execution time and credit usage as a result. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun)", + description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the search is completed. 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.", optional: true, }, }, async run({ $ }) { let response, completionCallbackUrl; - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; if (run.runs === 1) { - if (this.callbackWithRerun) { + if (context && this.callbackWithRerun) { ({ resume_url: completionCallbackUrl } = $.flow.rerun(600000, null, 1)); } response = await this.twin.browse({ diff --git a/components/twin/package.json b/components/twin/package.json index 8529cbe13f51e..010053f9bef99 100644 --- a/components/twin/package.json +++ b/components/twin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/twin", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Twin Components", "main": "twin.app.mjs", "keywords": [ diff --git a/components/verifalia/actions/verify-email/verify-email.mjs b/components/verifalia/actions/verify-email/verify-email.mjs index e9f99f86e0dda..61353d812b33e 100644 --- a/components/verifalia/actions/verify-email/verify-email.mjs +++ b/components/verifalia/actions/verify-email/verify-email.mjs @@ -12,7 +12,7 @@ export default { description: "Verify an email address and check if it is properly formatted, really exists and can accept mails, " + "flagging spam traps, disposable emails and much more. [See the docs](https://verifalia.com/developers#email-validations-creating) for more information", key: "verifalia-verify-email", - version: "1.1.0", + version: "1.1.1", type: "action", props: { verifalia, @@ -42,7 +42,12 @@ export default { }, async run({ $ }) { - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; const verifaliaClient = this.verifalia.buildVerifaliaRestClient(); // This component takes advantage of the new Pipedream's flow suspension: we handle @@ -66,7 +71,7 @@ export default { let waitForResults = false; let cancellationToken = null; - if ($.context.test) { + if (context && $.context.test) { // In test mode, we will wait for the verification results during this execution // and cancel the token after 20s (the actual lowest limit is 30s). // See: https://pipedream.com/docs/limits/#time-per-execution diff --git a/components/verifalia/actions/verify-list-emails/verify-list-emails.mjs b/components/verifalia/actions/verify-list-emails/verify-list-emails.mjs index 57aff765bd589..144b9662c0639 100644 --- a/components/verifalia/actions/verify-list-emails/verify-list-emails.mjs +++ b/components/verifalia/actions/verify-list-emails/verify-list-emails.mjs @@ -12,7 +12,7 @@ export default { description: "Verify a list of email address and check if it is properly formatted, really exists and can accept mails, " + "flagging spam traps, disposable emails and much more. [See the docs](https://verifalia.com/developers#email-validations-creating) for more information", key: "verifalia-verify-list-emails", - version: "0.1.0", + version: "0.1.1", type: "action", props: { verifalia, @@ -42,7 +42,12 @@ export default { }, async run({ $ }) { - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; const verifaliaClient = this.verifalia.buildVerifaliaRestClient(); // This component takes advantage of the new Pipedream's flow suspension: we handle @@ -66,7 +71,7 @@ export default { let waitForResults = false; let cancellationToken = null; - if ($.context.test) { + if (context && $.context.test) { // In test mode, we will wait for the verification results during this execution // and cancel the token after 20s (the actual lowest limit is 30s). // See: https://pipedream.com/docs/limits/#time-per-execution diff --git a/components/verifalia/package.json b/components/verifalia/package.json index fbf677c9b1592..44b8d85cbdb0b 100644 --- a/components/verifalia/package.json +++ b/components/verifalia/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/verifalia", - "version": "1.1.0", + "version": "1.1.1", "description": "Pipedream Verifalia Components", "main": "verifalia.app.mjs", "keywords": [ diff --git a/components/voilanorbert/actions/find-contact/find-contact.mjs b/components/voilanorbert/actions/find-contact/find-contact.mjs index 67264b9d25c7d..7a5bbdd7c723a 100644 --- a/components/voilanorbert/actions/find-contact/find-contact.mjs +++ b/components/voilanorbert/actions/find-contact/find-contact.mjs @@ -5,7 +5,7 @@ export default { key: "voilanorbert-find-contact", name: "Find Contact", description: "This action returns a specific contact. The object email is either null when the email is not found, or contains an object with at least email (the email string) and the score. [See the docs here](https://api.voilanorbert.com/2018-01-08/#contacts-get-1)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { ...common.props, diff --git a/components/voilanorbert/actions/start-contact-search/start-contact-search.mjs b/components/voilanorbert/actions/start-contact-search/start-contact-search.mjs index f06080689741e..8155fd3609cc5 100644 --- a/components/voilanorbert/actions/start-contact-search/start-contact-search.mjs +++ b/components/voilanorbert/actions/start-contact-search/start-contact-search.mjs @@ -1,4 +1,5 @@ import common from "../common/base.mjs"; +import { ConfigurationError } from "@pipedream/platform"; export default { ...common, @@ -8,7 +9,7 @@ export default { When your account does not have sufficient credits an HTTP status code of 402 is returned. Also, take into consideration that we check the domain for its validity. So even if you provide a correct name+domain set, we may return a HTTP status code of 400 for the domain if we can't locate it. [See the docs here](https://api.voilanorbert.com/2018-01-08/#search-endpoint-post)`, - version: "0.0.1", + version: "0.0.2", type: "action", props: { ...common.props, @@ -39,10 +40,32 @@ export default { ], optional: true, }, + webhookUrl: { + type: "string", + label: "Webhook URL", + description: "The URL to send the webhook to. Required for Pipedream Connect. If not specified, the workflow will be suspended until verification results are returned.", + optional: true, + }, }, methods: { async processEvent({ $ }) { - const { resume_url } = $.flow.suspend(); + if (!this.domain && !this.company) { + throw new ConfigurationError("Either domain or company is required."); + } + + const { resume_url } = this.webhookUrl + ? { + resume_url: this.webhookUrl, + } + : $.flow + ? $.flow.suspend() + : { + resume_url: undefined, + }; + if (!resume_url) { + throw new ConfigurationError("Webhook URL is required for Pipedream Connect."); + } + const { name, domain, diff --git a/components/voilanorbert/actions/verifiy-email/verifiy-email.mjs b/components/voilanorbert/actions/verifiy-email/verifiy-email.mjs index 7db8ffd2e37dc..e14ef6bf4d4fa 100644 --- a/components/voilanorbert/actions/verifiy-email/verifiy-email.mjs +++ b/components/voilanorbert/actions/verifiy-email/verifiy-email.mjs @@ -1,4 +1,5 @@ import common from "../common/base.mjs"; +import { ConfigurationError } from "@pipedream/platform"; export default { ...common, @@ -7,7 +8,7 @@ export default { description: `Verifies the given list of emails. In case your account does not have a sufficient Verify API balance the service will try to auto refill the balance by charging using the billing details of the account. If it fails to charge, an HTTP status code of 402 will be returned. [See the docs here](https://api.voilanorbert.com/2018-01-08/#verify-endpoint-post)`, - version: "0.0.1", + version: "0.0.2", type: "action", props: { ...common.props, @@ -17,10 +18,28 @@ export default { "emails", ], }, + webhookUrl: { + type: "string", + label: "Webhook URL", + description: "The URL to send the webhook to. Required for Pipedream Connect. If not specified, the workflow will be suspended until verification results are returned.", + optional: true, + }, }, methods: { async processEvent({ $ }) { - const { resume_url } = $.flow.suspend(); + const { resume_url } = this.webhookUrl + ? { + resume_url: this.webhookUrl, + } + : $.flow + ? $.flow.suspend() + : { + resume_url: undefined, + }; + if (!resume_url) { + throw new ConfigurationError("Webhook URL is required for Pipedream Connect."); + } + return this.voilanorbert.verifyEmails({ emails: this.emails.toString(), webhook: resume_url, diff --git a/components/voilanorbert/utils.mjs b/components/voilanorbert/common/utils.mjs similarity index 79% rename from components/voilanorbert/utils.mjs rename to components/voilanorbert/common/utils.mjs index ca3aa7f41af28..9c672f2b1c248 100644 --- a/components/voilanorbert/utils.mjs +++ b/components/voilanorbert/common/utils.mjs @@ -1,5 +1,6 @@ export const objectToString = (data) => { return Object.keys(data).reduce((prev, key) => { + if (data[key] === undefined) return prev; return `${prev ? `${prev}&` : ""}${key}=${data[key]}`; diff --git a/components/voilanorbert/package.json b/components/voilanorbert/package.json index a509e58af9a62..0cae3753d35dc 100644 --- a/components/voilanorbert/package.json +++ b/components/voilanorbert/package.json @@ -1,21 +1,18 @@ { "name": "@pipedream/voilanorbert", - "version": "0.0.2", + "version": "0.0.3", "description": "Pipedream VoilaNorbert Components", - "main": "dist/app/voilanorbert.app.mjs", + "main": "voilanorbert.app.mjs", "keywords": [ "pipedream", "voilanorbert" ], - "files": [ - "dist" - ], "homepage": "https://pipedream.com/apps/voilanorbert", "author": "Pipedream (https://pipedream.com/)", - "dependencies": { - "@pipedream/platform": "^1.1.1" - }, "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } } diff --git a/components/voilanorbert/voilanorbert.app.mjs b/components/voilanorbert/voilanorbert.app.mjs index 4b4e482ff25eb..a0e3d16261ac4 100644 --- a/components/voilanorbert/voilanorbert.app.mjs +++ b/components/voilanorbert/voilanorbert.app.mjs @@ -1,5 +1,5 @@ import { axios } from "@pipedream/platform"; -import { objectToString } from "./utils.mjs"; +import { objectToString } from "./common/utils.mjs"; export default { type: "app", diff --git a/components/zerobounce/actions/file-validation/file-validation.mjs b/components/zerobounce/actions/file-validation/file-validation.mjs index 6555214dfcb7e..3ec653ab6ab88 100644 --- a/components/zerobounce/actions/file-validation/file-validation.mjs +++ b/components/zerobounce/actions/file-validation/file-validation.mjs @@ -6,7 +6,7 @@ export default { key: "zerobounce-file-validation", name: "Validate Emails in File", description: "Performs email validation on all the addresses contained in a provided file. [See the documentation](https://www.zerobounce.net/docs/email-validation-api-quickstart/)", - version: "0.1.1", + version: "0.1.2", type: "action", props: { zerobounce, @@ -59,7 +59,7 @@ export default { callbackWithRerun: { type: "boolean", label: "Callback With Rerun", - description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the validation is completed. Overrides the `rerunUrl` prop. This will increase execution time and credit usage as a result. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun)", + description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the validation is completed. Overrides the `rerunUrl` 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.", optional: true, }, syncDir: { @@ -71,11 +71,16 @@ export default { }, async run({ $ }) { let response, summary; - const { run } = $.context; + const context = $.context; + const run = context + ? context.run + : { + runs: 1, + }; if (run.runs === 1) { let returnUrl = this.returnUrl; - if (this.callbackWithRerun) { + if (context && this.callbackWithRerun) { ({ resume_url: returnUrl } = $.flow.rerun(600000, null, 1)); } diff --git a/components/zerobounce/package.json b/components/zerobounce/package.json index ae5dd5cc8d2da..303d0f50e8108 100644 --- a/components/zerobounce/package.json +++ b/components/zerobounce/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zerobounce", - "version": "0.2.1", + "version": "0.2.2", "description": "Pipedream ZeroBounce Components", "main": "zerobounce.app.mjs", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a6bab68c5a77..184b3ec54d207 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6588,7 +6588,11 @@ importers: components/imgix: {} - components/imgur: {} + components/imgur: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/implisense_api: {} @@ -14559,8 +14563,8 @@ importers: components/voilanorbert: dependencies: '@pipedream/platform': - specifier: ^1.1.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/vonage: {} @@ -36517,6 +36521,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: