diff --git a/components/arpoone/arpoone.app.mjs b/components/arpoone/arpoone.app.mjs index 03485c698d662..256b3c3bae150 100644 --- a/components/arpoone/arpoone.app.mjs +++ b/components/arpoone/arpoone.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/meistertask/actions/create-attachment/create-attachment.mjs b/components/meistertask/actions/create-attachment/create-attachment.mjs index 6eb5c9fc5658e..fa584fa7c8152 100644 --- a/components/meistertask/actions/create-attachment/create-attachment.mjs +++ b/components/meistertask/actions/create-attachment/create-attachment.mjs @@ -1,13 +1,12 @@ import meistertask from "../../meistertask.app.mjs"; import FormData from "form-data"; -import fs from "fs"; -import { ConfigurationError } from "@pipedream/platform"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; export default { key: "meistertask-create-attachment", name: "Create Attachment", description: "Create a new attachment. [See the docs](https://developers.meistertask.com/reference/post-attachment)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { meistertask, @@ -40,8 +39,8 @@ export default { }, filepath: { type: "string", - label: "File Path", - description: "Path of the file in /tmp folder to add as an attachment. To upload a file to /tmp folder, please follow the [doc here](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, name: { type: "string", @@ -50,14 +49,6 @@ export default { optional: true, }, }, - methods: { - checkTmp(filename) { - if (filename.indexOf("/tmp") === -1) { - return `/tmp/${filename}`; - } - return filename; - }, - }, async run({ $ }) { const { taskId, @@ -66,16 +57,14 @@ export default { } = this; const data = new FormData(); - const path = this.checkTmp(filepath); - if (!fs.existsSync(path)) { - throw new ConfigurationError("File does not exist"); - } - - const file = fs.createReadStream(path); - const stats = fs.statSync(path); - data.append("local", file, { - knownLength: stats.size, + const { + stream, metadata, + } = await getFileStreamAndMetadata(filepath); + data.append("local", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, }); if (name) { data.append("name", name); @@ -85,6 +74,7 @@ export default { }; const response = await this.meistertask.createAttachment({ + $, taskId, data, headers, diff --git a/components/meistertask/package.json b/components/meistertask/package.json index a995cfa7e7e9f..1ac8b9679c7b8 100644 --- a/components/meistertask/package.json +++ b/components/meistertask/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/meistertask", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Meistertask Components", "main": "meistertask.app.mjs", "homepage": "https://pipedream.com/apps/meistertask", @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.4.1" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/offorte/offorte.app.mjs b/components/offorte/offorte.app.mjs index 20108dc5a0b94..6b8486965161e 100644 --- a/components/offorte/offorte.app.mjs +++ b/components/offorte/offorte.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/pdffiller/actions/upload-document/upload-document.mjs b/components/pdffiller/actions/upload-document/upload-document.mjs index c86f0521cc229..7cb60f13e9378 100644 --- a/components/pdffiller/actions/upload-document/upload-document.mjs +++ b/components/pdffiller/actions/upload-document/upload-document.mjs @@ -1,13 +1,12 @@ import FormData from "form-data"; -import fs from "fs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import pdffiller from "../../pdffiller.app.mjs"; export default { key: "pdffiller-upload-document", name: "Upload Document", description: "Uploads a chosen file to PDFfiller. [See the documentation](https://docs.pdffiller.com/docs/pdffiller/992d9d79fec32-creates-a-new-document-template-by-uploading-file-from-multipart)", - version: "0.0.2", + version: "0.1.0", type: "action", props: { pdffiller, @@ -26,9 +25,15 @@ export default { }, }, async run({ $ }) { - const fileStream = fs.createReadStream(checkTmp(this.file)); + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.file); const data = new FormData(); - data.append("file", fileStream); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); if (this.folderId) { data.append("folder_id", this.folderId); diff --git a/components/pdffiller/package.json b/components/pdffiller/package.json index 5c0d1928b31d7..e58cf851ec9d9 100644 --- a/components/pdffiller/package.json +++ b/components/pdffiller/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/pdffiller", - "version": "0.1.1", + "version": "0.2.0", "description": "Pipedream pdfFiller Components", "main": "pdffiller.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.0", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0", "fs": "^0.0.1-security" } diff --git a/components/pdffiller/pdffiller.app.mjs b/components/pdffiller/pdffiller.app.mjs index 45defe2ce0b61..e3f09d40807fa 100644 --- a/components/pdffiller/pdffiller.app.mjs +++ b/components/pdffiller/pdffiller.app.mjs @@ -44,8 +44,8 @@ export default { }, file: { type: "string", - label: "File", - description: "The path to the file saved to the `/tmp` directory (e.g. `/tmp/example.json`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, folderId: { type: "string", diff --git a/components/pembee/pembee.app.mjs b/components/pembee/pembee.app.mjs index ff158c5c93fa4..c08741d426b24 100644 --- a/components/pembee/pembee.app.mjs +++ b/components/pembee/pembee.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/pixelbin/actions/upload-file/upload-file.mjs b/components/pixelbin/actions/upload-file/upload-file.mjs index c0ed332d74b24..6fdd3c532ffd6 100644 --- a/components/pixelbin/actions/upload-file/upload-file.mjs +++ b/components/pixelbin/actions/upload-file/upload-file.mjs @@ -1,6 +1,5 @@ -import fs from "fs"; import FormData from "form-data"; -import { ConfigurationError } from "@pipedream/platform"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import app from "../../pixelbin.app.mjs"; import utils from "../../common/utils.mjs"; @@ -8,14 +7,14 @@ export default { key: "pixelbin-upload-file", name: "Upload File", description: "Upload a file to Pixelbin. [See the documentation](https://www.pixelbin.io/docs/api-docs/)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { app, filePath: { type: "string", - label: "File Path", - description: "Assete file path. The path to the file saved to the `/tmp` directory (e.g. `/tmp/example.pdf`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, path: { propDefinition: [ @@ -64,9 +63,6 @@ export default { uploadFile(args = {}) { return this.app.post({ path: "/upload/direct", - headers: { - "Content-Type": "multipart/form-data", - }, ...args, }); }, @@ -84,12 +80,15 @@ export default { filenameOverride, } = this; - if (!filePath.startsWith("/tmp/")) { - throw new ConfigurationError("File must be located in `/tmp` directory."); - } - + const { + stream, metadata: fileMetadata, + } = await getFileStreamAndMetadata(filePath); const data = new FormData(); - data.append("file", fs.createReadStream(filePath)); + data.append("file", stream, { + contentType: fileMetadata.contentType, + knownLength: fileMetadata.size, + filename: fileMetadata.name, + }); utils.appendPropsToFormData(data, { path, @@ -104,6 +103,7 @@ export default { const response = await uploadFile({ $, data, + headers: data.getHeaders(), }); $.export("$summary", `Successfully uploaded file with ID \`${response._id}\`.`); diff --git a/components/pixelbin/package.json b/components/pixelbin/package.json index c6d65d6eb0032..b48eca6930496 100644 --- a/components/pixelbin/package.json +++ b/components/pixelbin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/pixelbin", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Pixelbin Components", "main": "pixelbin.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "3.0.3", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/platerecognizer/actions/run-recognition/run-recognition.mjs b/components/platerecognizer/actions/run-recognition/run-recognition.mjs index e424d3541f8bf..4b4f8f2a88395 100644 --- a/components/platerecognizer/actions/run-recognition/run-recognition.mjs +++ b/components/platerecognizer/actions/run-recognition/run-recognition.mjs @@ -1,19 +1,18 @@ -import fs from "fs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStream } from "@pipedream/platform"; import platerecognizer from "../../platerecognizer.app.mjs"; export default { key: "platerecognizer-run-recognition", name: "Run Recognition", description: "Triggers a recognition process using the Plate Recognizer SDK.", - version: "0.0.1", + version: "0.1.0", type: "action", props: { platerecognizer, imageFileOrUrl: { type: "string", - label: "Image File or URL", - description: "The image file or URL to be recognized.", + label: "Image Path or URL", + description: "The image to be recognized. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myImage.jpg`)", }, regions: { type: "string[]", @@ -41,19 +40,18 @@ export default { }, }, async run({ $ }) { - const fileObj = {}; - if (this.imageFileOrUrl.startsWith("http")) { - fileObj.upload_url = this.imageFileOrUrl; - } else { - const file = fs.readFileSync(checkTmp(this.imageFileOrUrl)); - fileObj.upload = Buffer(file).toString("base64"); + const stream = await getFileStream(this.imageFileOrUrl); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); } + const buffer = Buffer.concat(chunks); const response = await this.platerecognizer.runRecognition({ $, data: { - ...fileObj, + upload: buffer.toString("base64"), regions: this.regions, camera_id: this.cameraId, mmc: this.mmc, diff --git a/components/platerecognizer/package.json b/components/platerecognizer/package.json index 763385296dc5f..e0f426b01efd3 100644 --- a/components/platerecognizer/package.json +++ b/components/platerecognizer/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/platerecognizer", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Plate Recognizer Components", "main": "platerecognizer.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.5" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/postmaster/postmaster.app.mjs b/components/postmaster/postmaster.app.mjs index 40c14b726ac99..f8d79c8e6651b 100644 --- a/components/postmaster/postmaster.app.mjs +++ b/components/postmaster/postmaster.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/printautopilot/actions/add-pdf-to-queue/add-pdf-to-queue.mjs b/components/printautopilot/actions/add-pdf-to-queue/add-pdf-to-queue.mjs index c1a18b8ed0daa..0539bcdd3809b 100644 --- a/components/printautopilot/actions/add-pdf-to-queue/add-pdf-to-queue.mjs +++ b/components/printautopilot/actions/add-pdf-to-queue/add-pdf-to-queue.mjs @@ -1,18 +1,18 @@ import printAutopilot from "../../printautopilot.app.mjs"; -import fs from "fs"; +import { getFileStream } from "@pipedream/platform"; export default { key: "printautopilot-add-pdf-to-queue", name: "Add PDF to Print Autopilot Queue", description: "Uploads a PDF document to the print-autopilot queue. [See the documentation](https://documenter.getpostman.com/view/1334461/TW6wJonb#53f82327-4f23-416d-b2f0-ce17b8037933)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { printAutopilot, filePath: { type: "string", - label: "File Path", - description: "The path to the file saved to the [`/tmp` directory](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory) (e.g. `/tmp/myFile.pdf`).", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.pdf`)", }, fileName: { type: "string", @@ -27,10 +27,13 @@ export default { }, }, async run({ $ }) { - const filePath = this.filePath.includes("/tmp") - ? this.filePath - : `/tmp/${this.filePath}`; - const fileContent = Buffer.from(fs.readFileSync(filePath)).toString("base64"); + const stream = await getFileStream(this.filePath); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const fileContent = Buffer.concat(chunks).toString("base64"); + const response = await this.printAutopilot.addDocumentToQueue({ token: this.token, data: { diff --git a/components/printautopilot/package.json b/components/printautopilot/package.json index ba1436fea2654..7498a8342f237 100644 --- a/components/printautopilot/package.json +++ b/components/printautopilot/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/printautopilot", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream PrintAutopilot Components", "main": "printautopilot.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/printify/actions/create-product/create-product.mjs b/components/printify/actions/create-product/create-product.mjs index 4ffe90a8d22e4..131cc5547b600 100644 --- a/components/printify/actions/create-product/create-product.mjs +++ b/components/printify/actions/create-product/create-product.mjs @@ -1,14 +1,11 @@ -import fs from "fs"; -import { - checkTmp, isValidHttpUrl, -} from "../../common/utils.mjs"; +import { getFileStream } from "@pipedream/platform"; import printify from "../../printify.app.mjs"; export default { key: "printify-create-product", name: "Create a Product", description: "Creates a new product on Printify. [See the documentation](https://developers.printify.com/#create-a-new-product)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { printify, @@ -119,7 +116,7 @@ export default { props[`imagePath_${i}`] = { type: "string", label: `Image Path or URL ${i}`, - description: `The URL or path to a file in the \`/tmp\` directory of the image ${i}. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp).`, + description: `The file to upload for image ${i}. Provide either a file URL or a path to a file in the \`/tmp\` directory (for example, \`/tmp/myImage.jpg\`).`, }; props[`imageX_${i}`] = { type: "string", @@ -157,18 +154,13 @@ export default { } for (let i = 1; i <= this.imageCount; i++) { const imageString = this[`imagePath_${i}`]; - - let file = ""; - let fieldName = ""; - - if (isValidHttpUrl(imageString)) { - file = imageString; - fieldName = "url"; - } else { - file = fs.readFileSync(checkTmp(imageString)); - file = Buffer.from(file).toString("base64"); - fieldName = "contents"; + const stream = await getFileStream(imageString); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); } + const file = Buffer.concat(chunks).toString("base64"); + const fieldName = "contents"; const responseImage = await this.printify.uploadImage({ data: { diff --git a/components/printify/package.json b/components/printify/package.json index 811d409e3fed2..40a89dde79f80 100644 --- a/components/printify/package.json +++ b/components/printify/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/printify", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Printify Components", "main": "printify.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1", + "@pipedream/platform": "^3.1.0", "crypto": "^1.0.1", "fs": "^0.0.1-security" } diff --git a/components/printnode/actions/send-print-job/send-print-job.mjs b/components/printnode/actions/send-print-job/send-print-job.mjs index a1d7e791927de..1ec9c4bfcabc3 100644 --- a/components/printnode/actions/send-print-job/send-print-job.mjs +++ b/components/printnode/actions/send-print-job/send-print-job.mjs @@ -1,11 +1,11 @@ import printnode from "../../printnode.app.mjs"; -import fs from "fs"; +import { getFileStream } from "@pipedream/platform"; export default { key: "printnode-send-print-job", name: "Send Print Job", description: "Sends a print job to a specified printer. [See the documentation](https://www.printnode.com/en/docs/api/curl#creating-print-jobs)", - version: "0.0.1", + version: "1.0.0", type: "action", props: { printnode, @@ -23,15 +23,8 @@ export default { }, filePath: { type: "string", - label: "File Path", - description: "The path to a document file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#the-tmp-directory).", - optional: true, - }, - fileUrl: { - type: "string", - label: "File URL", - description: "The URL to a document file.", - optional: true, + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, title: { type: "string", @@ -73,15 +66,16 @@ export default { }, async run({ $ }) { const { - printnode, contentType, filePath, fileUrl, ...props + printnode, contentType, filePath, ...props } = this; - const content = contentType.endsWith("base64") - ? fs.readFileSync(filePath.includes("tmp/") - ? filePath - : `/tmp/${filePath}`, { - encoding: "base64", - }) - : fileUrl; + + const stream = await getFileStream(filePath); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const content = Buffer.concat(chunks).toString("base64"); + const response = await printnode.createPrintJob({ $, data: { diff --git a/components/printnode/common/constants.mjs b/components/printnode/common/constants.mjs index 8db2c70e0bb3b..38d762d26b1d5 100644 --- a/components/printnode/common/constants.mjs +++ b/components/printnode/common/constants.mjs @@ -1,16 +1,8 @@ export const PRINT_CONTENT_OPTIONS = [ - { - label: "PDF (URL)", - value: "pdf_uri", - }, { label: "PDF (File)", value: "pdf_base64", }, - { - label: "Raw document (URL)", - value: "raw_uri", - }, { label: "Raw Document (File)", value: "raw_base64", diff --git a/components/printnode/package.json b/components/printnode/package.json index 1d1cd23a777e7..7911e967f2df1 100644 --- a/components/printnode/package.json +++ b/components/printnode/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/printnode", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream PrintNode Components", "main": "printnode.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "1.5.1" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/printnode/printnode.app.mjs b/components/printnode/printnode.app.mjs index be5767c7802ad..2281f58da33c9 100644 --- a/components/printnode/printnode.app.mjs +++ b/components/printnode/printnode.app.mjs @@ -22,7 +22,7 @@ export default { contentType: { type: "string", label: "Content Type", - description: "The type of content you are sending. [See the documentation for more information](https://www.printnode.com/en/docs/api/curl#create-printjob-content). You must also specify a `File Path` or `File URL`.", + description: "The type of content you are sending. [See the documentation for more information](https://www.printnode.com/en/docs/api/curl#create-printjob-content)", options: PRINT_CONTENT_OPTIONS, }, }, diff --git a/components/ragie/actions/create-document/create-document.mjs b/components/ragie/actions/create-document/create-document.mjs index 70fada4cf4a38..e3b2b90370c4b 100644 --- a/components/ragie/actions/create-document/create-document.mjs +++ b/components/ragie/actions/create-document/create-document.mjs @@ -1,13 +1,12 @@ import FormData from "form-data"; -import fs from "fs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import ragie from "../../ragie.app.mjs"; export default { key: "ragie-create-document", name: "Create Document", description: "Creates a new document in Ragie. [See the documentation](https://docs.ragie.ai/reference/createdocument)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { ragie, @@ -52,7 +51,14 @@ export default { }, async run({ $ }) { const data = new FormData(); - data.append("file", fs.createReadStream(checkTmp(this.file))); + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.file); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); if (this.mode) data.append("mode", this.mode); if (this.metadata) data.append("metadata", JSON.stringify(this.metadata)); if (this.externalId) data.append("external_id", this.externalId); diff --git a/components/ragie/actions/update-document-file/update-document-file.mjs b/components/ragie/actions/update-document-file/update-document-file.mjs index e62730e0a6034..90acfb2ec2c39 100644 --- a/components/ragie/actions/update-document-file/update-document-file.mjs +++ b/components/ragie/actions/update-document-file/update-document-file.mjs @@ -1,13 +1,12 @@ import FormData from "form-data"; -import fs from "fs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import ragie from "../../ragie.app.mjs"; export default { key: "ragie-update-document-file", name: "Update Document File", description: "Updates an existing document file in Ragie. [See the documentation](https://docs.ragie.ai/reference/updatedocumentfile).", - version: "0.0.1", + version: "0.1.0", type: "action", props: { ragie, @@ -33,7 +32,14 @@ export default { }, async run({ $ }) { const data = new FormData(); - data.append("file", fs.createReadStream(checkTmp(this.file))); + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.file); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); if (this.mode) data.append("mode", this.mode); const response = await this.ragie.updateDocumentFile({ diff --git a/components/ragie/common/utils.mjs b/components/ragie/common/utils.mjs index 0cd1a12b6a4ba..dcc9cc61f6f41 100644 --- a/components/ragie/common/utils.mjs +++ b/components/ragie/common/utils.mjs @@ -1,10 +1,3 @@ -export const checkTmp = (filename) => { - if (!filename.startsWith("/tmp")) { - return `/tmp/${filename}`; - } - return filename; -}; - export const parseObject = (obj) => { if (!obj) return undefined; diff --git a/components/ragie/package.json b/components/ragie/package.json index b331423650937..0d23fff212e1e 100644 --- a/components/ragie/package.json +++ b/components/ragie/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/ragie", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Ragie Components", "main": "ragie.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.3" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/ragie/ragie.app.mjs b/components/ragie/ragie.app.mjs index ea3c95b014d66..7baaa02977edb 100644 --- a/components/ragie/ragie.app.mjs +++ b/components/ragie/ragie.app.mjs @@ -7,8 +7,8 @@ export default { propDefinitions: { documentFile: { type: "string", - label: "File", - description: "The path to the file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#the-tmp-directory).", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, documentMode: { type: "string", diff --git a/components/raindrop/actions/parse-bookmark-file/parse-bookmark-file.mjs b/components/raindrop/actions/parse-bookmark-file/parse-bookmark-file.mjs index d3ad6cd329141..4f05dea6ae8a1 100644 --- a/components/raindrop/actions/parse-bookmark-file/parse-bookmark-file.mjs +++ b/components/raindrop/actions/parse-bookmark-file/parse-bookmark-file.mjs @@ -1,58 +1,31 @@ import raindrop from "../../raindrop.app.mjs"; -import fs from "fs"; -import got from "got"; -import stream from "stream"; -import { promisify } from "util"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import FormData from "form-data"; export default { key: "raindrop-parse-bookmark-file", name: "Parse HTML Bookmark File", - description: "Convert HTML bookmark file to JSON. Support Nestcape, Pocket and Instapaper file formats. [See the docs here](https://developer.raindrop.io/v1/import#parse-html-import-file)", - version: "0.0.7", + description: "Convert an HTML bookmark file to JSON. Supports Nestcape, Pocket and Instapaper file formats. [See the documentation](https://developer.raindrop.io/v1/import#parse-html-import-file)", + version: "1.0.0", type: "action", props: { raindrop, - fileUrl: { - type: "string", - label: "File URL", - description: "The URL of the HTML bookmark file you want to convert. Must specify either File URL or File Path.", - optional: true, - }, filePath: { type: "string", - label: "File Path", - description: "The path to the file, e.g. /tmp/bookmarks.html . Must specify either File URL or File Path.", - optional: true, + label: "File Path or URL", + description: "The file to parse. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/bookmarks.html`)", }, }, async run({ $ }) { - const { - fileUrl, - filePath, - } = this; - - if (!fileUrl && !filePath) { - throw new Error("Must specify either File URL or File Path"); - } - const form = new FormData(); - if (filePath) { - if (!fs.existsSync(filePath)) { - throw new Error(`${filePath} does not exists`); - } - const readStream = fs.createReadStream(filePath); - form.append("import", readStream); - } else if (fileUrl) { - const tempFilePath = "/tmp/temp_bookmarks.html"; - const pipeline = promisify(stream.pipeline); - await pipeline( - got.stream(fileUrl), - fs.createWriteStream(tempFilePath), - ); - const readStream = fs.createReadStream(tempFilePath); - form.append("import", readStream); - } + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.filePath); + form.append("import", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); const response = await this.raindrop.importFile($, form); $.export("$summary", "Successfully parsed bookmark file"); diff --git a/components/raindrop/package.json b/components/raindrop/package.json index 82ad204ce166e..6c15971ec2573 100644 --- a/components/raindrop/package.json +++ b/components/raindrop/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/raindrop", - "version": "0.3.14", + "version": "0.4.0", "description": "Pipedream Raindrop.io Components", "main": "raindrop.app.mjs", "keywords": [ @@ -17,10 +17,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.2.0", - "form-data": "^4.0.0", - "got": "^13.0.0", - "stream": "^0.0.2", - "util": "^0.12.5" + "@pipedream/platform": "^3.1.0", + "form-data": "^4.0.0" } } diff --git a/components/ramp/actions/upload-receipt/upload-receipt.mjs b/components/ramp/actions/upload-receipt/upload-receipt.mjs index 80c366684a260..da3a2fe7e64d9 100644 --- a/components/ramp/actions/upload-receipt/upload-receipt.mjs +++ b/components/ramp/actions/upload-receipt/upload-receipt.mjs @@ -1,12 +1,12 @@ import ramp from "../../ramp.app.mjs"; import { v4 as uuidv4 } from "uuid"; -import fs from "fs"; +import { getFileStream } from "@pipedream/platform"; export default { key: "ramp-upload-receipt", name: "Upload Receipt", description: "Uploads a receipt for a given transaction and user. [See the documentation](https://docs.ramp.com/developer-api/v1/reference/rest/receipts#post-developer-v1-receipts)", - version: "0.0.2", + version: "0.1.0", type: "action", props: { ramp, @@ -24,8 +24,8 @@ export default { }, filePath: { type: "string", - label: "File Path", - description: "The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, }, async run({ $ }) { @@ -42,9 +42,12 @@ export default { `--${boundary}\r\n` + `Content-Disposition: attachment; name="receipt"; filename="${this.filePath.split("/").pop()}"\r\n\r\n`; - const fileContent = fs.readFileSync(this.filePath.includes("tmp/") - ? this.filePath - : `/tmp/${this.filePath}`); + const stream = await getFileStream(this.filePath); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const fileContent = Buffer.concat(chunks); const formEnd = `\r\n--${boundary}--`; diff --git a/components/ramp/package.json b/components/ramp/package.json index f3d2e10293486..8b49d63a363d6 100644 --- a/components/ramp/package.json +++ b/components/ramp/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/ramp", - "version": "0.1.2", + "version": "0.2.0", "description": "Pipedream Ramp Components", "main": "ramp.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.0", + "@pipedream/platform": "^3.1.0", "uuid": "^10.0.0" } } diff --git a/components/reform/actions/extract-data-from-document/extract-data-from-document.mjs b/components/reform/actions/extract-data-from-document/extract-data-from-document.mjs index 6216cd1ab03e5..c30a7881ac5d8 100644 --- a/components/reform/actions/extract-data-from-document/extract-data-from-document.mjs +++ b/components/reform/actions/extract-data-from-document/extract-data-from-document.mjs @@ -1,13 +1,13 @@ import reform from "../../reform.app.mjs"; import utils from "../common/utils.mjs"; import FormData from "form-data"; -import fs from "fs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; export default { key: "reform-extract-data-from-document", name: "Extract Data From Document", description: "Extract structured data from a document. [See the documentation](https://docs.reformhq.com/synchronous-data-processing/extract)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { reform, @@ -26,12 +26,15 @@ export default { }, async run({ $ }) { const fields = utils.parseFields(this.fields); - const documentPath = this.document.includes("tmp/") - ? this.document - : `/tmp/${this.document}`; - const formData = new FormData(); - formData.append("document", fs.createReadStream(documentPath)); + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.document); + formData.append("document", stream, { + filename: metadata.name, + contentType: metadata.contentType, + knownLength: metadata.size, + }); formData.append("fields_to_extract", JSON.stringify(fields)); const response = await this.reform.extractDataFromDocument({ diff --git a/components/reform/package.json b/components/reform/package.json index 5f76b9b00657d..7a5c33643c66f 100644 --- a/components/reform/package.json +++ b/components/reform/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/reform", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Reform Components", "main": "reform.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.0", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/reform/reform.app.mjs b/components/reform/reform.app.mjs index bd54f305455c0..e9b171733d51f 100644 --- a/components/reform/reform.app.mjs +++ b/components/reform/reform.app.mjs @@ -6,8 +6,8 @@ export default { propDefinitions: { document: { type: "string", - label: "Document", - description: "The path to a document file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#the-tmp-directory).", + label: "File Path or URL", + description: "The file to process. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, fields: { type: "string[]", diff --git a/components/roboflow/actions/classify-image/classify-image.mjs b/components/roboflow/actions/classify-image/classify-image.mjs index 77f93b1d7f322..bd15b331112f1 100644 --- a/components/roboflow/actions/classify-image/classify-image.mjs +++ b/components/roboflow/actions/classify-image/classify-image.mjs @@ -1,12 +1,11 @@ import roboflow from "../../roboflow.app.mjs"; -import { ConfigurationError } from "@pipedream/platform"; -import fs from "fs"; +import utils from "../../common/utils.mjs"; export default { key: "roboflow-classify-image", name: "Classify Image", description: "Run inference on classification models hosted on Roboflow. [See the documentation](https://docs.roboflow.com/deploy/hosted-api/classification).", - version: "0.0.1", + version: "1.0.0", type: "action", props: { roboflow, @@ -31,38 +30,16 @@ export default { "filePath", ], }, - fileUrl: { - propDefinition: [ - roboflow, - "fileUrl", - ], - }, }, async run({ $ }) { - if ((!this.filePath && !this.fileUrl) || (this.filePath && this.fileUrl)) { - throw new ConfigurationError("Exactly one of file Path or File URL must be specified."); - } - - const args = { + const response = await this.roboflow.classifyImage({ datasetId: this.datasetId, $, - }; - - if (this.filePath) { - args.data = fs.readFileSync(this.filePath, { - encoding: "base64", - }); - args.headers = { + data: await utils.getBase64File(this.filePath), + headers: { "Content-Type": "application/x-www-form-urlencoded", - }; - } - if (this.fileUrl) { - args.params = { - image: this.fileUrl, - }; - } - - const response = await this.roboflow.classifyImage(args); + }, + }); if (!response?.error) { $.export("$summary", "Successfully classified image."); diff --git a/components/roboflow/actions/detect-object-from-image/detect-object-from-image.mjs b/components/roboflow/actions/detect-object-from-image/detect-object-from-image.mjs index ff2a0dbf1680b..387a270467471 100644 --- a/components/roboflow/actions/detect-object-from-image/detect-object-from-image.mjs +++ b/components/roboflow/actions/detect-object-from-image/detect-object-from-image.mjs @@ -1,12 +1,11 @@ import roboflow from "../../roboflow.app.mjs"; -import { ConfigurationError } from "@pipedream/platform"; -import fs from "fs"; +import utils from "../../common/utils.mjs"; export default { key: "roboflow-detect-object-from-image", name: "Detect Object From Image", description: "Run inference on your object detection models hosted on Roboflow. [See the documentation](https://docs.roboflow.com/deploy/hosted-api/object-detection).", - version: "0.0.1", + version: "1.0.0", type: "action", props: { roboflow, @@ -31,38 +30,16 @@ export default { "filePath", ], }, - fileUrl: { - propDefinition: [ - roboflow, - "fileUrl", - ], - }, }, async run({ $ }) { - if ((!this.filePath && !this.fileUrl) || (this.filePath && this.fileUrl)) { - throw new ConfigurationError("Exactly one of file Path or File URL must be specified."); - } - - const args = { + const response = await this.roboflow.detectObject({ datasetId: this.datasetId, $, - }; - - if (this.filePath) { - args.data = fs.readFileSync(this.filePath, { - encoding: "base64", - }); - args.headers = { + data: await utils.getBase64File(this.filePath), + headers: { "Content-Type": "application/x-www-form-urlencoded", - }; - } - if (this.fileUrl) { - args.params = { - image: this.fileUrl, - }; - } - - const response = await this.roboflow.detectObject(args); + }, + }); if (!response?.error) { $.export("$summary", "Successfully ran object detection inference model on image."); diff --git a/components/roboflow/actions/upload-image/upload-image.mjs b/components/roboflow/actions/upload-image/upload-image.mjs index c6c974682058f..5c64d6f8716b3 100644 --- a/components/roboflow/actions/upload-image/upload-image.mjs +++ b/components/roboflow/actions/upload-image/upload-image.mjs @@ -1,14 +1,13 @@ import roboflow from "../../roboflow.app.mjs"; -import { ConfigurationError } from "@pipedream/platform"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import utils from "../../common/utils.mjs"; -import fs from "fs"; import FormData from "form-data"; export default { key: "roboflow-upload-image", name: "Upload Image", description: "Upload an image to a project on the Roboflow platform. [See the documentation](https://docs.roboflow.com/datasets/adding-data/upload-api).", - version: "0.0.1", + version: "1.0.0", type: "action", props: { roboflow, @@ -24,12 +23,6 @@ export default { "filePath", ], }, - fileUrl: { - propDefinition: [ - roboflow, - "fileUrl", - ], - }, name: { type: "string", label: "Name", @@ -38,36 +31,26 @@ export default { }, }, async run({ $ }) { - if ((!this.filePath && !this.fileUrl) || (this.filePath && this.fileUrl)) { - throw new ConfigurationError("Exactly one of file Path or File URL must be specified."); - } - - const args = { - projectId: utils.extractSubstringAfterSlash(this.projectId), - $, - }; - - if (this.filePath) { - const formData = new FormData(); - if (this.name) { - formData.append("name", this.name); - } - formData.append("file", fs.createReadStream(this.filePath)); - - args.data = formData; - args.headers = formData.getHeaders(); + const formData = new FormData(); + if (this.name) { + formData.append("name", this.name); } - if (this.fileUrl) { - const params = { - image: this.fileUrl, - name: this.name, - }; + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.filePath); + formData.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); - args.params = params; - } - - const response = await this.roboflow.uploadImage(args); + const response = await this.roboflow.uploadImage({ + $, + projectId: utils.extractSubstringAfterSlash(this.projectId), + data: formData, + headers: formData.getHeaders(), + }); if (!response?.error) { $.export("$summary", "Successfully uploaded image."); diff --git a/components/roboflow/common/utils.mjs b/components/roboflow/common/utils.mjs index 67a51bc551cd1..5b5ef0dce7b21 100644 --- a/components/roboflow/common/utils.mjs +++ b/components/roboflow/common/utils.mjs @@ -1,3 +1,5 @@ +import { getFileStream } from "@pipedream/platform"; + function extractSubstringAfterSlash(str) { const match = str.match(/\/(.*)/); if (match && match[1]) { @@ -7,6 +9,16 @@ function extractSubstringAfterSlash(str) { } } +async function getBase64File(filePath) { + const stream = await getFileStream(filePath); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + return Buffer.concat(chunks).toString("base64"); +} + export default { extractSubstringAfterSlash, + getBase64File, }; diff --git a/components/roboflow/package.json b/components/roboflow/package.json index d91d1f8fb8303..2027afd4d9b8e 100644 --- a/components/roboflow/package.json +++ b/components/roboflow/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/roboflow", - "version": "0.1.0", + "version": "1.0.0", "description": "Pipedream Roboflow Components", "main": "roboflow.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/roboflow/roboflow.app.mjs b/components/roboflow/roboflow.app.mjs index 06165df1fbaf3..7ee486e5508de 100644 --- a/components/roboflow/roboflow.app.mjs +++ b/components/roboflow/roboflow.app.mjs @@ -37,9 +37,8 @@ export default { }, filePath: { type: "string", - label: "File Path", - description: "The path to the image file saved to the `/tmp` directory (e.g. `/tmp/image.png`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", - optional: true, + label: "File Path or URL", + description: "The file to process. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.jpg`)", }, fileUrl: { type: "string", diff --git a/components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs b/components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs index ccfe0edd3eb4b..ec84a7503e473 100644 --- a/components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs +++ b/components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs @@ -1,6 +1,6 @@ import common, { getProps } from "../common/base-create-update.mjs"; import attachment from "../../common/sobjects/attachment.mjs"; -import fs from "fs"; +import { getFileStream } from "@pipedream/platform"; const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_attachment.htm"; @@ -18,7 +18,7 @@ export default { key: "salesforce_rest_api-create-attachment", name: "Create Attachment", description: `Creates an Attachment on a parent object. [See the documentation](${docsLink})`, - version: "0.4.1", + version: "0.5.0", type: "action", props, async run({ $ }) { @@ -34,9 +34,17 @@ export default { } = this; /* eslint-enable no-unused-vars */ - const body = filePathOrContent.includes("tmp/") - ? (await fs.promises.readFile(filePathOrContent)).toString("base64") - : filePathOrContent; + let body; + if (filePathOrContent.startsWith("http") || filePathOrContent.includes("tmp/")) { + const stream = await getFileStream(filePathOrContent); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + body = Buffer.concat(chunks).toString("base64"); + } else { + body = filePathOrContent; + } const response = await salesforce.createRecord("Attachment", { $, diff --git a/components/salesforce_rest_api/common/sobjects/attachment.mjs b/components/salesforce_rest_api/common/sobjects/attachment.mjs index fc01ea14726d8..8d211563ce27d 100644 --- a/components/salesforce_rest_api/common/sobjects/attachment.mjs +++ b/components/salesforce_rest_api/common/sobjects/attachment.mjs @@ -9,8 +9,8 @@ export default { }, filePathOrContent: { type: "string", - label: "File Path or Content", - description: "The path to a file in the `tmp` folder [(see the documentation)](https://pipedream.com/docs/code/nodejs/working-with-files). Alternatively, you can provide the base64-encoded file data.", + label: "File Path, URL or Content", + description: "The file to attach. Provide either a file URL, a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`), or base64-encoded file data.", }, ContentType: { type: "string", diff --git a/components/salesforce_rest_api/package.json b/components/salesforce_rest_api/package.json index f95719a9bf08b..4812ab30824b4 100644 --- a/components/salesforce_rest_api/package.json +++ b/components/salesforce_rest_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/salesforce_rest_api", - "version": "1.5.0", + "version": "1.6.0", "description": "Pipedream Salesforce (REST API) Components", "main": "salesforce_rest_api.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/salesforce_rest_api", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^3.0.0", + "@pipedream/platform": "^3.1.0", "fast-xml-parser": "^4.3.2", "handlebars": "^4.7.7", "lodash": "^4.17.21", diff --git a/components/scoredetect/actions/create-timestamp-file/create-timestamp-file.mjs b/components/scoredetect/actions/create-timestamp-file/create-timestamp-file.mjs index 93540721da60d..4b7f4e654b44b 100644 --- a/components/scoredetect/actions/create-timestamp-file/create-timestamp-file.mjs +++ b/components/scoredetect/actions/create-timestamp-file/create-timestamp-file.mjs @@ -1,12 +1,11 @@ import scoreDetect from "../../scoredetect.app.mjs"; -import fs from "fs"; -import { axios } from "@pipedream/platform"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; export default { key: "scoredetect-create-timestamp-file", name: "Create Certificate from File", description: "Creates a timestamped blockchain certificate using a provided file (local or URL). [See the documentation](https://api.scoredetect.com/docs/routes#create-certificate)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { scoreDetect, @@ -18,19 +17,13 @@ export default { }, }, async run({ $ }) { - const { fileOrUrl } = this; - const file = fileOrUrl.startsWith("http") - ? await axios($, { - url: fileOrUrl, - responseType: "arraybuffer", - }) - : fs.createReadStream(fileOrUrl.includes("tmp/") - ? fileOrUrl - : `/tmp/${fileOrUrl}`); - + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.fileOrUrl); const response = await this.scoreDetect.createCertificate({ $, - file, + file: stream, + metadata, }); $.export("$summary", "Successfully created certificate"); diff --git a/components/scoredetect/package.json b/components/scoredetect/package.json index d0f6f367a6ee3..28bd6313c43ea 100644 --- a/components/scoredetect/package.json +++ b/components/scoredetect/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/scoredetect", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream ScoreDetect Components", "main": "scoredetect.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.0", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/scoredetect/scoredetect.app.mjs b/components/scoredetect/scoredetect.app.mjs index 23e8a9a1b42c5..94b0ecbc479f6 100644 --- a/components/scoredetect/scoredetect.app.mjs +++ b/components/scoredetect/scoredetect.app.mjs @@ -8,7 +8,7 @@ export default { fileOrUrl: { type: "string", label: "File Path or URL", - description: "The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp). Alternatively, you can pass the direct URL to a file.", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, text: { type: "string", @@ -33,10 +33,19 @@ export default { }); }, async createCertificate({ - file, ...args + file, metadata, ...args }) { const data = new FormData(); - data.append("file", file); + if (metadata) { + data.append("file", file, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); + } + else { + data.append("file", file); + } const headers = data.getHeaders(); diff --git a/components/scrapfly/actions/ai-data-extraction/ai-data-extraction.mjs b/components/scrapfly/actions/ai-data-extraction/ai-data-extraction.mjs index 0e2078c4135c7..a9f0b45c82ef8 100644 --- a/components/scrapfly/actions/ai-data-extraction/ai-data-extraction.mjs +++ b/components/scrapfly/actions/ai-data-extraction/ai-data-extraction.mjs @@ -1,13 +1,12 @@ import { ConfigurationError } from "@pipedream/platform"; -import fs from "fs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStream } from "@pipedream/platform"; import scrapfly from "../../scrapfly.app.mjs"; export default { key: "scrapfly-ai-data-extraction", name: "AI Data Extraction", description: "Automate content extraction from any text-based source using AI, LLM, and custom parsing. [See the documentation](https://scrapfly.io/docs/extraction-api/getting-started)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { scrapfly, @@ -65,6 +64,14 @@ export default { if (!this.extractionTemplate && !this.extractionPrompt && !this.extractionModel) { throw new ConfigurationError("You must provide at least **Extraction Template**, **Extraction Prompt** or **Extraction Model**"); } + + const stream = await getFileStream(this.body); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const data = Buffer.concat(chunks).toString(); + const response = await this.scrapfly.automateContentExtraction({ $, headers: { @@ -79,7 +86,7 @@ export default { extraction_model: this.extractionModel, webhook_name: this.webhookName, }, - data: fs.readFileSync(checkTmp(this.body)).toString(), + data, }); $.export("$summary", "Successfully extracted content"); diff --git a/components/scrapfly/package.json b/components/scrapfly/package.json index f2bc0dcc759f4..92586f41228d2 100644 --- a/components/scrapfly/package.json +++ b/components/scrapfly/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/scrapfly", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Scrapfly Components", "main": "scrapfly.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.1" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/scrapfly/scrapfly.app.mjs b/components/scrapfly/scrapfly.app.mjs index 53e4c77fa946b..d998f98cb7891 100644 --- a/components/scrapfly/scrapfly.app.mjs +++ b/components/scrapfly/scrapfly.app.mjs @@ -12,8 +12,8 @@ export default { }, body: { type: "string", - label: "Body", - description: "The request body must contain the content of the page you want to extract data from. The content must be in the format specified by the `content-type` header or via the `content_type` HTTP parameter. Provide a file from `/tmp`. To upload a file to `/tmp` folder, please follow the doc [here](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)", + label: "File Path or URL", + description: "The file containing the content of the page you want to extract data from. The content must be in the format specified by `Content Type`. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, contentType: { type: "string", diff --git a/components/security_reporter/actions/create-finding/create-finding.mjs b/components/security_reporter/actions/create-finding/create-finding.mjs index 8e3bf5c33384b..7fb9b00762f46 100644 --- a/components/security_reporter/actions/create-finding/create-finding.mjs +++ b/components/security_reporter/actions/create-finding/create-finding.mjs @@ -13,7 +13,7 @@ export default { key: "security_reporter-create-finding", name: "Create Security Finding", description: "Creates a new security finding. [See the documentation](https://trial3.securityreporter.app/api-documentation)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { securityReporter, @@ -116,8 +116,8 @@ export default { }, draftDocumentsFile: { type: "string[]", - label: "Draft Documents File ", - description: "The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp).", + label: "Draft Document File Paths or URLs", + description: "One or more files to upload. For each entry, provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", optional: true, }, resolvers: { diff --git a/components/security_reporter/actions/update-finding/update-finding.mjs b/components/security_reporter/actions/update-finding/update-finding.mjs index 71fc31b708a73..42e2ea29811d6 100644 --- a/components/security_reporter/actions/update-finding/update-finding.mjs +++ b/components/security_reporter/actions/update-finding/update-finding.mjs @@ -14,7 +14,7 @@ export default { key: "security_reporter-update-finding", name: "Update Security Finding", description: "Updates an existing security finding. [See the documentation](https://trial3.securityreporter.app/api-documentation)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { securityReporter, @@ -146,8 +146,8 @@ export default { }, draftDocumentsFile: { type: "string[]", - label: "Draft Documents File ", - description: "The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp).", + label: "Draft Document File Paths or URLs", + description: "One or more files to upload. For each entry, provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", optional: true, }, resolvers: { diff --git a/components/security_reporter/package.json b/components/security_reporter/package.json index 9836a4bd0c18f..948cf5d3acdf4 100644 --- a/components/security_reporter/package.json +++ b/components/security_reporter/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/security_reporter", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Security Reporter Components", "main": "security_reporter.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.1", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/security_reporter/security_reporter.app.mjs b/components/security_reporter/security_reporter.app.mjs index 2f36ffb9bbdc9..e103cd6a0e518 100644 --- a/components/security_reporter/security_reporter.app.mjs +++ b/components/security_reporter/security_reporter.app.mjs @@ -1,10 +1,7 @@ import { axios } from "@pipedream/platform"; import FormData from "form-data"; -import fs from "fs"; -import { - checkTmp, - parseObject, -} from "./common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; +import { parseObject } from "./common/utils.mjs"; export default { type: "app", @@ -398,8 +395,14 @@ export default { const files = parseObject(draftDocumentsFile); for (const path of files) { const data = new FormData(); - const file = fs.createReadStream(checkTmp(path)); - data.append("file", file); + const { + stream, metadata, + } = await getFileStreamAndMetadata(path); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); data.append("documentable_type", "Finding"); data.append("section", "description"); const { id } = await this.uploadFile({ diff --git a/components/sendgrid/actions/send-email-multiple-recipients/send-email-multiple-recipients.mjs b/components/sendgrid/actions/send-email-multiple-recipients/send-email-multiple-recipients.mjs index abd77ce522085..1e2be637afa17 100644 --- a/components/sendgrid/actions/send-email-multiple-recipients/send-email-multiple-recipients.mjs +++ b/components/sendgrid/actions/send-email-multiple-recipients/send-email-multiple-recipients.mjs @@ -1,5 +1,6 @@ -import { ConfigurationError } from "@pipedream/platform"; -import fs from "fs"; +import { + ConfigurationError, getFileStream, +} from "@pipedream/platform"; import mime from "mime"; import validate from "validate.js"; import common from "../common/common.mjs"; @@ -9,7 +10,7 @@ export default { key: "sendgrid-send-email-multiple-recipients", name: "Send Email Multiple Recipients", description: "This action sends a personalized e-mail to multiple specified recipients. [See the docs here](https://docs.sendgrid.com/api-reference/mail-send/mail-send)", - version: "0.0.6", + version: "0.1.0", type: "action", props: { ...common.props, @@ -156,8 +157,8 @@ export default { }; props[`attachmentsPath${i}`] = { type: "string", - label: `Attachment File Path ${i}`, - description: "The path to your file in /tmp dir. [See the documentation](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp) for how to work with tmp dir.", + label: `Attachment File Path or URL ${i}`, + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`).", optional: true, }; } @@ -208,10 +209,13 @@ export default { } const attachments = []; for (let i = 1; i <= this.numberOfAttachments; i++) { - const filepath = this.checkTmp(this["attachmentsPath" + i]); - const content = fs.readFileSync(filepath, { - encoding: "base64", - }); + const filepath = this["attachmentsPath" + i]; + const stream = await getFileStream(filepath); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const content = Buffer.concat(chunks).toString("base64"); const type = mime.getType(filepath); attachments.push({ content, diff --git a/components/sendgrid/actions/send-email-single-recipient/send-email-single-recipient.mjs b/components/sendgrid/actions/send-email-single-recipient/send-email-single-recipient.mjs index 5299dfde6627d..5beda728cc7e5 100644 --- a/components/sendgrid/actions/send-email-single-recipient/send-email-single-recipient.mjs +++ b/components/sendgrid/actions/send-email-single-recipient/send-email-single-recipient.mjs @@ -1,4 +1,4 @@ -import fs from "fs"; +import { getFileStream } from "@pipedream/platform"; import mime from "mime"; import validate from "validate.js"; import common from "../common/common.mjs"; @@ -8,7 +8,7 @@ export default { key: "sendgrid-send-email-single-recipient", name: "Send Email Single Recipient", description: "This action sends a personalized e-mail to the specified recipient. [See the docs here](https://docs.sendgrid.com/api-reference/mail-send/mail-send)", - version: "0.0.8", + version: "0.1.0", type: "action", props: { ...common.props, @@ -178,8 +178,8 @@ export default { }; props[`attachmentsPath${i}`] = { type: "string", - label: `Attachment File Path ${i}`, - description: "The path to your file in /tmp dir. [See the documentation](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp) for how to work with tmp dir.", + label: `Attachment File Path or URL ${i}`, + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`).", optional: true, }; } @@ -227,10 +227,13 @@ export default { } const attachments = []; for (let i = 1; i <= this.numberOfAttachments; i++) { - const filepath = this.checkTmp(this["attachmentsPath" + i]); - const content = fs.readFileSync(filepath, { - encoding: "base64", - }); + const filepath = this["attachmentsPath" + i]; + const stream = await getFileStream(filepath); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const content = Buffer.concat(chunks).toString("base64"); const type = mime.getType(filepath); attachments.push({ content, diff --git a/components/sendgrid/package.json b/components/sendgrid/package.json index 67961f05c2572..b898a710f2b2b 100644 --- a/components/sendgrid/package.json +++ b/components/sendgrid/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sendgrid", - "version": "0.4.2", + "version": "0.5.0", "description": "Pipedream Sendgrid Components", "main": "sendgrid.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/sendgrid", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^3.0.3", + "@pipedream/platform": "^3.1.0", "@sendgrid/client": "^7.6.2", "@sendgrid/eventwebhook": "^7.4.5", "async-retry": "^1.3.1", diff --git a/components/sftp/actions/upload-file/upload-file.mjs b/components/sftp/actions/upload-file/upload-file.mjs index 8b49f960c74ee..1ffa706c30316 100644 --- a/components/sftp/actions/upload-file/upload-file.mjs +++ b/components/sftp/actions/upload-file/upload-file.mjs @@ -1,12 +1,13 @@ import app from "../../sftp.app.mjs"; -import fs from "fs"; -import { ConfigurationError } from "@pipedream/platform"; +import { + ConfigurationError, getFileStream, +} from "@pipedream/platform"; export default { key: "sftp-upload-file", name: "Upload File", description: "Uploads a file or string in UTF-8 format to the SFTP server. [See the documentation](https://github.com/theophilusx/ssh2-sftp-client#org99d1b64)", - version: "0.3.0", + version: "0.4.0", type: "action", props: { app, @@ -30,11 +31,11 @@ export default { }, async run({ $ }) { if (!this.data && !this.file) { - throw new ConfigurationError("Either `Data` or `File` must be provided."); + throw new ConfigurationError("Either `Data` or `File Path or URL` must be provided."); } const buffer = this.file ? - fs.readFileSync(this.file) : + (await getFileStream(this.file)) : Buffer.from(this.data); const response = await this.app.put({ diff --git a/components/sftp/package.json b/components/sftp/package.json index bc942c6d6a189..28c329c2edf7d 100644 --- a/components/sftp/package.json +++ b/components/sftp/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sftp", - "version": "0.4.1", + "version": "0.5.0", "description": "Pipedream SFTP Components", "main": "sftp.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/sftp", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^3.0.3", + "@pipedream/platform": "^3.1.0", "ssh2-sftp-client": "^11.0.0" }, "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535", diff --git a/components/sftp/sftp.app.mjs b/components/sftp/sftp.app.mjs index 9382150a8a095..2307d3dbfebcf 100644 --- a/components/sftp/sftp.app.mjs +++ b/components/sftp/sftp.app.mjs @@ -1,5 +1,4 @@ import Client from "ssh2-sftp-client"; -import fs from "fs"; export default { type: "app", @@ -7,16 +6,9 @@ export default { propDefinitions: { file: { type: "string", - label: "File", - description: "Local file on `/tmp` folder to upload to the remote server.", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`).", optional: true, - options() { - return fs.readdirSync("/tmp", { - withFileTypes: true, - }) - .filter((file) => !file.isDirectory()) - .map((file) => file.name); - }, }, }, methods: { diff --git a/components/signaturit/actions/create-certified-email/create-certified-email.mjs b/components/signaturit/actions/create-certified-email/create-certified-email.mjs index 8bedaa6cdf933..ab47de8523784 100644 --- a/components/signaturit/actions/create-certified-email/create-certified-email.mjs +++ b/components/signaturit/actions/create-certified-email/create-certified-email.mjs @@ -1,17 +1,14 @@ import FormData from "form-data"; -import fs from "fs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import { TYPE_OPTIONS } from "../../common/constants.mjs"; -import { - checkTmp, - parseObject, -} from "../../common/utils.mjs"; +import { parseObject } from "../../common/utils.mjs"; import signaturit from "../../signaturit.app.mjs"; export default { key: "signaturit-create-certified-email", name: "Create Certified Email", description: "Initiates the creation of a certified email. [See the documentation](https://docs.signaturit.com/api/latest#emails_create_email)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { signaturit, @@ -102,7 +99,14 @@ export default { if (this.attachments) { let j = 0; for (const file of parseObject(this.attachments)) { - formData.append(`attachments[${j++}]`, fs.createReadStream(checkTmp(file))); + const { + stream, metadata, + } = await getFileStreamAndMetadata(file); + formData.append(`attachments[${j++}]`, stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); } } const response = await this.signaturit.createCertifiedEmail({ diff --git a/components/signaturit/actions/create-signature-request-from-template/create-signature-request-from-template.mjs b/components/signaturit/actions/create-signature-request-from-template/create-signature-request-from-template.mjs index 11198fe5734ea..1018e8bd9abf5 100644 --- a/components/signaturit/actions/create-signature-request-from-template/create-signature-request-from-template.mjs +++ b/components/signaturit/actions/create-signature-request-from-template/create-signature-request-from-template.mjs @@ -1,21 +1,18 @@ import FormData from "form-data"; -import fs from "fs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import { DELIVERY_TYPE_OPTIONS, SIGNATURE_TYPE_OPTIONS, SIGNING_MODE_OPTIONS, } from "../../common/constants.mjs"; -import { - checkTmp, - parseObject, -} from "../../common/utils.mjs"; +import { parseObject } from "../../common/utils.mjs"; import signaturit from "../../signaturit.app.mjs"; export default { key: "signaturit-create-signature-request-from-template", name: "Create Signature Request from Template", description: "Creates a signature request using a pre-existing template. [See the documentation](https://docs.signaturit.com/api/latest#signatures_create_signature)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { signaturit, @@ -213,7 +210,14 @@ export default { if (this.files) { let k = 0; for (const file of parseObject(this.files)) { - formData.append(`files[${k++}]`, fs.createReadStream(checkTmp(file))); + const { + stream, metadata, + } = await getFileStreamAndMetadata(file); + formData.append(`files[${k++}]`, stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); } } const response = await this.signaturit.createSignatureRequest({ diff --git a/components/signaturit/package.json b/components/signaturit/package.json index 81bceb2a914a3..9683f0e325e89 100644 --- a/components/signaturit/package.json +++ b/components/signaturit/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/signaturit", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Signaturit Components", "main": "signaturit.app.mjs", "keywords": [ @@ -13,8 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.3", - "form-data": "^4.0.1", - "fs": "^0.0.1-security" + "@pipedream/platform": "^3.1.0", + "form-data": "^4.0.1" } } diff --git a/components/signaturit/signaturit.app.mjs b/components/signaturit/signaturit.app.mjs index 7078264908002..84d4da647fdeb 100644 --- a/components/signaturit/signaturit.app.mjs +++ b/components/signaturit/signaturit.app.mjs @@ -32,8 +32,8 @@ export default { }, attachments: { type: "string[]", - label: "Attachments", - description: "A list of paths to the files saved to the `/tmp` directory (e.g. `/tmp/example.pdf`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", + label: "Attachment File Paths or URLs", + description: "The file(s) to attach. For each entry, provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, recipients: { type: "string[]", diff --git a/components/signerx/actions/upload-package/upload-package.mjs b/components/signerx/actions/upload-package/upload-package.mjs index fcc41e86a6134..dfe74f0691c8e 100644 --- a/components/signerx/actions/upload-package/upload-package.mjs +++ b/components/signerx/actions/upload-package/upload-package.mjs @@ -1,25 +1,19 @@ import FormData from "form-data"; -import fs from "fs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import signerx from "../../signerx.app.mjs"; export default { key: "signerx-upload-package", name: "Upload Package", description: "Quickly create a draft for a new package/document by uploading a file or providing a file_url to a PDF document. [See the documentation](https://documenter.getpostman.com/view/13877745/2sa3xv9kni)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { signerx, - documentType: { + file: { type: "string", - label: "Document Type", - description: "whether you hava the file or an URL to the file.", - options: [ - "file", - "file_url", - ], - reloadProps: true, + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.pdf`).", }, name: { type: "string", @@ -27,28 +21,17 @@ export default { description: "The name of the package/document", }, }, - async additionalProps() { - const props = {}; - props.file = (this.documentType === "file") - ? { - type: "string", - label: "File", - description: "The path to the pdf file saved to the `/tmp` directory (e.g. `/tmp/example.pdf`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", - } - : { - type: "string", - label: "File URL", - description: "The URL to the file.", - }; - return props; - }, async run({ $ }) { const data = new FormData(); - if (this.documentType === "file") { - data.append("file", fs.createReadStream(checkTmp(this.file))); - } else { - data.append("file_url", this.file); - } + + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.file); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); data.append("name", this.name); const response = await this.signerx.createDraftPackage({ diff --git a/components/signerx/package.json b/components/signerx/package.json index 0447ae74fa60a..3f223cc70e5f7 100644 --- a/components/signerx/package.json +++ b/components/signerx/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/signerx", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream SignerX Components", "main": "signerx.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.0", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/signnow/actions/upload-document-with-tags/upload-document-with-tags.mjs b/components/signnow/actions/upload-document-with-tags/upload-document-with-tags.mjs index 4928b889f93ad..e614589eed029 100644 --- a/components/signnow/actions/upload-document-with-tags/upload-document-with-tags.mjs +++ b/components/signnow/actions/upload-document-with-tags/upload-document-with-tags.mjs @@ -1,19 +1,19 @@ -import fs from "fs"; import FormData from "form-data"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import app from "../../signnow.app.mjs"; export default { key: "signnow-upload-document-with-tags", name: "Upload Document With Tags", description: "Uploads a file that contains SignNow text tags. [See the documentation](https://docs.signnow.com/docs/signnow/document/operations/create-a-document-fieldextract)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { app, file: { type: "string", - label: "File Path", - description: "File path of a file previously downloaded in Pipedream E.g. (`/tmp/my-file.pdf`). [Download a file to the `/tmp` directory](https://pipedream.com/docs/code/nodejs/http-requests/#download-a-file-to-the-tmp-directory)", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`).", }, }, methods: { @@ -37,7 +37,14 @@ export default { } = this; const data = new FormData(); - data.append("file", fs.createReadStream(file)); + const { + stream, metadata, + } = await getFileStreamAndMetadata(file); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); const response = await uploadDocumentWithTags({ $, diff --git a/components/signnow/package.json b/components/signnow/package.json index 2ad5180d4bfbf..42343b3c779ff 100644 --- a/components/signnow/package.json +++ b/components/signnow/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/signnow", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream signNow Components", "main": "signnow.app.mjs", "keywords": [ @@ -13,10 +13,9 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.0", + "@pipedream/platform": "^3.1.0", "crypto": "^1.0.1", "form-data": "^4.0.0", - "fs": "^0.0.1-security", "uuid": "^10.0.0" } } diff --git a/components/smugmug/actions/upload-image/upload-image.mjs b/components/smugmug/actions/upload-image/upload-image.mjs index 2d957eb4fb56f..f9670c2fc2892 100644 --- a/components/smugmug/actions/upload-image/upload-image.mjs +++ b/components/smugmug/actions/upload-image/upload-image.mjs @@ -1,12 +1,12 @@ import smugmug from "../../smugmug.app.mjs"; -import fs from "fs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import FormData from "form-data"; export default { key: "smugmug-upload-image", name: "Upload Image", description: "Uploads an image to a SmugMug album. [See the docs here](https://api.smugmug.com/services/api/?method=upload)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { smugmug, @@ -19,8 +19,8 @@ export default { }, filePath: { type: "string", - label: "File Path", - description: "The path to the image file saved to the [`/tmp`directory](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory)(e.g. `/tmp/image.png`).", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`).", }, }, async run({ $ }) { @@ -32,8 +32,14 @@ export default { const albumUri = album.Response.Uri; const data = new FormData(); - const file = fs.createReadStream(this.filePath); - data.append("file", file); + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.filePath); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); const response = await this.smugmug.uploadImage(filename, albumUri, data, $); if (response.stat === "ok") { diff --git a/components/smugmug/package.json b/components/smugmug/package.json index e193fda227104..9e0b4cea03a2c 100644 --- a/components/smugmug/package.json +++ b/components/smugmug/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/smugmug", - "version": "0.0.3", + "version": "0.1.0", "description": "Pipedream Smugmug Components", "main": "smugmug.app.mjs", "keywords": [ @@ -10,9 +10,8 @@ "homepage": "https://pipedream.com/apps/smugmug", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^1.1.1", - "form-data": "^4.0.0", - "fs": "^0.0.1-security" + "@pipedream/platform": "^3.1.0", + "form-data": "^4.0.0" }, "publishConfig": { "access": "public" diff --git a/components/sonix/actions/upload-media/upload-media.mjs b/components/sonix/actions/upload-media/upload-media.mjs index 8b196d69e2a8d..93eab4b31eb60 100644 --- a/components/sonix/actions/upload-media/upload-media.mjs +++ b/components/sonix/actions/upload-media/upload-media.mjs @@ -1,29 +1,20 @@ -import { ConfigurationError } from "@pipedream/platform"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import FormData from "form-data"; -import fs from "fs"; import { LANGUAGE_OPTIONS } from "../../common/constants.mjs"; -import { checkTmp } from "../../common/utils.mjs"; import sonix from "../../sonix.app.mjs"; export default { key: "sonix-upload-media", name: "Upload Media", description: "Submits new media for processing. [See the documentation](https://sonix.ai/docs/api#new_media)", - version: "0.0.1", + version: "1.0.0", type: "action", props: { sonix, file: { type: "string", - label: "File", - description: "Path of the audio or video file in /tmp folder. The limit is 100MB using this parameter. For larger files, use **File URL**. `NOTE: Only one of **File** or **File URL** is required.` To upload a file to /tmp folder, please follow the [doc here](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)", - optional: true, - }, - fileUrl: { - type: "string", - label: "File URL", - description: "URL pointing to the audio/video file. `NOTE: Only one of **File** or **File URL** is required.`", - optional: true, + label: "File Path or URL", + description: "The audio or video file to upload (max 100MB). Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, language: { type: "string", @@ -70,18 +61,17 @@ export default { }, }, async run({ $ }) { - if (!this.file && !this.fileUrl) { - throw new ConfigurationError("You must provite whether **File** or **File URL**."); - } - const formData = new FormData(); - if (this.file) { - const filePath = checkTmp(this.file); - formData.append("file", fs.createReadStream(filePath)); - } + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.file); + formData.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); - this.fileUrl && formData.append("file_url", this.fileUrl); this.language && formData.append("language", this.language); this.name && formData.append("name", this.name); this.transcriptText && formData.append("transcript_text", `${this.transcriptText}`); diff --git a/components/sonix/package.json b/components/sonix/package.json index 99893c3bdac7a..2bf283cec9fc8 100644 --- a/components/sonix/package.json +++ b/components/sonix/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sonix", - "version": "0.1.0", + "version": "1.0.0", "description": "Pipedream Sonix Components", "main": "sonix.app.mjs", "keywords": [ @@ -13,8 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1", - "form-data": "^4.0.0", - "fs": "^0.0.1-security" + "@pipedream/platform": "^3.1.0", + "form-data": "^4.0.0" } } diff --git a/components/tinypng/actions/compress-image/compress-image.mjs b/components/tinypng/actions/compress-image/compress-image.mjs index 009a6d6013b6d..68bb8605ef667 100644 --- a/components/tinypng/actions/compress-image/compress-image.mjs +++ b/components/tinypng/actions/compress-image/compress-image.mjs @@ -1,23 +1,14 @@ -import { ConfigurationError } from "@pipedream/platform"; -import fs from "fs"; -import { IMAGE_TYPES } from "../../common/constants.mjs"; -import { checkTmp } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import tinypng from "../../tinypng.app.mjs"; export default { key: "tinypng-compress-image", name: "Compress Image", description: "Compress a WebP, JPEG, or PNG image using the TinyPNG API. [See the documentation](https://tinypng.com/developers/reference#compressing-images)", - version: "0.0.1", + version: "1.0.0", type: "action", props: { tinypng, - url: { - propDefinition: [ - tinypng, - "url", - ], - }, file: { propDefinition: [ tinypng, @@ -26,36 +17,19 @@ export default { }, }, async run({ $ }) { - if (!this.url && !this.file) { - throw new Error("You must provide either a URL or a file for compression."); - } - - let data; - let headers = {}; - - if (this.url) { - data = { - source: { - url: this.url, - }, - }; - } - - if (this.file) { - const fileData = this.file.split("."); - const ext = fileData[1]; - - if (!IMAGE_TYPES.includes(ext)) { - throw new ConfigurationError("You can upload either WebP, JPEG or PNG."); - } - const file = fs.readFileSync(checkTmp(this.file)); - data = file; - headers = { - "Content-Type": `image/${ext}`, - "content-disposition": "attachment; filename=" + fileData[0], - }; + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.file); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); } + const data = Buffer.concat(chunks); + const headers = { + "Content-Type": metadata.contentType, + "content-disposition": "attachment; filename=" + metadata.name, + }; const response = await this.tinypng.compressImage({ $, diff --git a/components/tinypng/package.json b/components/tinypng/package.json index c7f412bdb6086..432d80b1b81d6 100644 --- a/components/tinypng/package.json +++ b/components/tinypng/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/tinypng", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream TinyPNG AI Components", "main": "tinypng.app.mjs", "keywords": [ @@ -13,8 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1", - "fs": "^0.0.1-security", + "@pipedream/platform": "^3.1.0", "stream": "^0.0.2", "util": "^0.12.5" } diff --git a/components/tinypng/tinypng.app.mjs b/components/tinypng/tinypng.app.mjs index d1c3d27d8687b..48eae71b7292d 100644 --- a/components/tinypng/tinypng.app.mjs +++ b/components/tinypng/tinypng.app.mjs @@ -5,17 +5,10 @@ export default { type: "app", app: "tinypng", propDefinitions: { - url: { - type: "string", - label: "Image URL", - description: "URL of the image to compress (WebP, JPEG, or PNG).", - optional: true, - }, file: { type: "string", - label: "Image File", - description: "The path to the image file (WebP, JPEG, or PNG) saved to the `/tmp` directory (e.g. `/tmp/example.jpg`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", - optional: true, + label: "Image Path or URL", + description: "The image to upload (WebP, JPEG, or PNG). Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.png`)", }, imageId: { type: "string", diff --git a/components/todoist/actions/export-tasks/export-tasks.mjs b/components/todoist/actions/export-tasks/export-tasks.mjs index 0ffc467640163..53a9be4202750 100644 --- a/components/todoist/actions/export-tasks/export-tasks.mjs +++ b/components/todoist/actions/export-tasks/export-tasks.mjs @@ -7,7 +7,7 @@ export default { key: "todoist-export-tasks", name: "Export Tasks", description: "Export project task names as comma separated file. Returns path to new file. [See Docs](https://developer.todoist.com/rest/v2/#get-active-tasks)", - version: "0.0.3", + version: "0.1.0", type: "action", props: { todoist, @@ -27,7 +27,7 @@ export default { project_id: project, }, }); - const csv = await converter.json2csvAsync(tasks); + const csv = converter.json2csv(tasks); const { path } = await file({ postfix: ".csv", diff --git a/components/todoist/actions/import-tasks/import-tasks.mjs b/components/todoist/actions/import-tasks/import-tasks.mjs index db25884d0fa8c..f226927f58ec3 100644 --- a/components/todoist/actions/import-tasks/import-tasks.mjs +++ b/components/todoist/actions/import-tasks/import-tasks.mjs @@ -1,12 +1,12 @@ import todoist from "../../todoist.app.mjs"; -import fs from "fs"; import converter from "json-2-csv"; +import { getFileStream } from "@pipedream/platform"; export default { key: "todoist-import-tasks", name: "Import Tasks", description: "Import tasks into a selected project. [See Docs](https://developer.todoist.com/sync/v9/#add-an-item)", - version: "0.0.3", + version: "0.1.0", type: "action", props: { todoist, @@ -37,8 +37,13 @@ export default { project, } = this; - const fileContents = (await fs.promises.readFile(path)).toString(); - const tasks = await converter.csv2jsonAsync(fileContents); + const stream = await getFileStream(path); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const fileContents = Buffer.concat(chunks).toString(); + const tasks = converter.csv2json(fileContents); // CREATE TASKS const data = tasks.map((task) => ({ content: task.content, diff --git a/components/todoist/package.json b/components/todoist/package.json index 8c401cc6930f0..e6c12d0e5fb6c 100644 --- a/components/todoist/package.json +++ b/components/todoist/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/todoist", - "version": "0.1.4", + "version": "0.2.0", "description": "Pipedream Todoist Components", "main": "todoist.app.mjs", "keywords": [ @@ -10,8 +10,8 @@ "homepage": "https://pipedream.com/apps/todoist", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^3.0.3", - "json-2-csv": "^3.15.1", + "@pipedream/platform": "^3.1.0", + "json-2-csv": "^5.5.9", "query-string": "^7.1.3", "tmp-promise": "^3.0.3", "uuid": "^8.3.2" diff --git a/components/todoist/todoist.app.mjs b/components/todoist/todoist.app.mjs index f433c5310b338..bfb63221a8b82 100644 --- a/components/todoist/todoist.app.mjs +++ b/components/todoist/todoist.app.mjs @@ -255,8 +255,8 @@ export default { }, path: { type: "string", - label: "File Path", - description: "Path to .csv file containing task data. Enter a static value (e.g., `/tmp/myFile.csv`) or reference prior step exports via the `steps` object (e.g., `{{steps.export_tasks.$return_value}}`).", + label: "File Path or URL", + description: "The .csv file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.csv`)", }, }, methods: { diff --git a/components/xero_accounting_api/actions/upload-file/upload-file.mjs b/components/xero_accounting_api/actions/upload-file/upload-file.mjs index ca30a1cdcc172..e24d36fa305af 100644 --- a/components/xero_accounting_api/actions/upload-file/upload-file.mjs +++ b/components/xero_accounting_api/actions/upload-file/upload-file.mjs @@ -1,28 +1,31 @@ // legacy_hash_id: a_B0i8rE -import fs from "fs"; import FormData from "form-data"; -import { axios } from "@pipedream/platform"; +import { + axios, getFileStreamAndMetadata, +} from "@pipedream/platform"; +import xeroAccountingApi from "../../xero_accounting_api.app.mjs"; export default { key: "xero_accounting_api-upload-file", name: "Upload File", - description: "Uploads a file to the specified document.", - version: "0.2.1", + description: "Uploads a file to the specified document. [See the documentation](https://developer.xero.com/documentation/api/accounting/invoices#upload-attachment)", + version: "1.0.0", type: "action", props: { - xero_accounting_api: { - type: "app", - app: "xero_accounting_api", - }, - tenant_id: { - type: "string", - description: "Id of the organization tenant to use on the Xero Accounting API. See [Get Tenant Connections](https://pipedream.com/@sergio/xero-accounting-api-get-tenant-connections-p_OKCzOgn/edit) for a workflow example on how to pull this data.", + xeroAccountingApi, + tenantId: { + propDefinition: [ + xeroAccountingApi, + "tenantId", + ], }, - attachment_filename: { + filePathOrUrl: { type: "string", - description: "Name of the file to upload as an attachment to the Xero document.", + label: "File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, - document_type: { + documentType: { + label: "Document Type", type: "string", description: "Document type of where the attachment will be sent to. This is used in as part of the Xero Account API endpoint where the request is sent against.", options: [ @@ -37,30 +40,31 @@ export default { "RepeatingInvoices", ], }, - document_id: { + documentId: { + label: "Document ID", type: "string", description: "Xero identifier of the document where the attachment will be sent to.", }, }, async run({ $ }) { - //See the API docs: https://developer.xero.com/documentation/api/invoices#upload-attachment - //See a workflow example of this action: https://pipedream.com/@sergio/xero-accounting-api-upload-file-p_rvCqADQ/edit - - if (!this.tenant_id) { - throw new Error("Must provide tenant_id parameter."); - } - - let data = new FormData(); - const file = fs.createReadStream(`/tmp/${this.attachment_filename}`); - data.append("file", file); + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.filePathOrUrl); + const data = new FormData(); + data.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); //Sends the request against Xero Accounting API return await axios($, { method: "post", - url: `https://api.xero.com/api.xro/2.0/${this.document_type}/${this.document_id}/Attachments/${attachment_filename}`, + url: `https://api.xero.com/api.xro/2.0/${this.documentType}/${this.documentId}/Attachments/${metadata.name}`, headers: { - "Authorization": `Bearer ${this.xero_accounting_api.$auth.oauth_access_token}`, - "xero-tenant-id": this.tenant_id, + "Authorization": `Bearer ${this.xeroAccountingApi.$auth.oauth_access_token}`, + "xero-tenant-id": this.tenantId, + ...data.getHeaders(), }, data, }); diff --git a/components/xero_accounting_api/package.json b/components/xero_accounting_api/package.json index fad16c3f9c7da..14be4737e56d9 100644 --- a/components/xero_accounting_api/package.json +++ b/components/xero_accounting_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/xero_accounting_api", - "version": "0.2.1", + "version": "0.3.0", "description": "Pipedream Xero Components", "main": "xero_accounting_api.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/xero_accounting_api", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^1.4.0" + "@pipedream/platform": "^3.1.0" }, "publishConfig": { "access": "public" diff --git a/components/xero_accounting_api/xero_accounting_api.app.mjs b/components/xero_accounting_api/xero_accounting_api.app.mjs index 698efb7717b3a..075e897b86eba 100644 --- a/components/xero_accounting_api/xero_accounting_api.app.mjs +++ b/components/xero_accounting_api/xero_accounting_api.app.mjs @@ -10,7 +10,7 @@ export default { type: "string", label: "Tenant ID", description: - "Id of the organization tenant to use on the Xero Accounting API. See [Get Tenant Connections](https://pipedream.com/@sergio/xero-accounting-api-get-tenant-connections-p_OKCzOgn/edit) for a workflow example on how to pull this data.", + "Select an organization tenant to use, or provide a tenant ID", async options() { return this.getTenantsOpts(); }, diff --git a/components/zerobounce/actions/file-validation/file-validation.mjs b/components/zerobounce/actions/file-validation/file-validation.mjs index 92384e9928ff1..76038b2de9b2d 100644 --- a/components/zerobounce/actions/file-validation/file-validation.mjs +++ b/components/zerobounce/actions/file-validation/file-validation.mjs @@ -1,20 +1,19 @@ import zerobounce from "../../zerobounce.app.mjs"; -import fs from "fs"; import FormData from "form-data"; -import path from "path"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; 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.0.1", + version: "0.1.0", type: "action", props: { zerobounce, filePath: { type: "string", - label: "File Path", - description: "The path to a csv or txt file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)", + label: "File Path or URL", + description: "The csv or txt file to validate. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.csv`)", }, emailAddressColumn: { type: "integer", @@ -74,14 +73,15 @@ export default { ({ resume_url: returnUrl } = $.flow.rerun(600000, null, 1)); } - const filePath = this.filePath.includes("tmp/") - ? this.filePath - : `/tmp/${this.filePath}`; - const fileName = path.basename(filePath); - const fileContent = fs.readFileSync(filePath); - + const { + stream, metadata, + } = await getFileStreamAndMetadata(this.filePath); const formData = new FormData(); - formData.append("file", fileContent, fileName); + formData.append("file", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); formData.append("email_address_column", this.emailAddressColumn); formData.append("api_key", this.zerobounce.$auth.api_key); if (this.firstNameColumn) { diff --git a/components/zerobounce/package.json b/components/zerobounce/package.json index cbe8e85ba7dc8..a45509e49411e 100644 --- a/components/zerobounce/package.json +++ b/components/zerobounce/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zerobounce", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream ZeroBounce Components", "main": "zerobounce.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.3", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.1", "path": "^0.12.7" } diff --git a/components/zip_archive_api/actions/compress-files/compress-files.mjs b/components/zip_archive_api/actions/compress-files/compress-files.mjs index 0bee12c774fe2..abc3d193c4448 100644 --- a/components/zip_archive_api/actions/compress-files/compress-files.mjs +++ b/components/zip_archive_api/actions/compress-files/compress-files.mjs @@ -1,21 +1,16 @@ import app from "../../zip_archive_api.app.mjs"; -import fs from "fs"; import FormData from "form-data"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; +import fs from "fs"; export default { key: "zip_archive_api-compress-files", name: "Compress Files", description: "Compress files provided through URLs into a zip folder. [See the documentation](https://archiveapi.com/rest-api/file-compression/)", - version: "0.0.1", + version: "1.0.0", type: "action", props: { app, - uploadType: { - propDefinition: [ - app, - "uploadType", - ], - }, archiveName: { propDefinition: [ app, @@ -42,33 +37,27 @@ export default { }, }, async run({ $ }) { - let data = { - files: this.files, - archiveName: this.archiveName, - compressionLevel: this.compressionLevel, - password: this.password, - }; + const data = new FormData(); - if (this.uploadType === "File") { - data = new FormData(); + if (this.password) data.append("Password", this.password); + if (this.compressionLevel) data.append("CompressionLevel", this.compressionLevel); + data.append("ArchiveName", this.archiveName); - if (this.password) data.append("Password", this.password); - if (this.compressionLevel) data.append("CompressionLevel", this.compressionLevel); - data.append("ArchiveName", this.archiveName); - - for (const file of this.files) { - data.append("Files", fs.createReadStream(file)); - } + for (const file of this.files) { + const { + stream, metadata, + } = await getFileStreamAndMetadata(file); + data.append("Files", stream, { + contentType: metadata.contentType, + knownLength: metadata.size, + filename: metadata.name, + }); } - const headers = this.uploadType === "File" - ? data.getHeaders() - : {}; - const response = await this.app.compressFiles({ $, data, - headers, + headers: data.getHeaders(), responseType: "arraybuffer", }); diff --git a/components/zip_archive_api/package.json b/components/zip_archive_api/package.json index c6158a2dd99c4..4a95dc9f7f34c 100644 --- a/components/zip_archive_api/package.json +++ b/components/zip_archive_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zip_archive_api", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Zip Archive API Components", "main": "zip_archive_api.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.5", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/zip_archive_api/zip_archive_api.app.mjs b/components/zip_archive_api/zip_archive_api.app.mjs index b2fbbb503abc0..6117c9367eb60 100644 --- a/components/zip_archive_api/zip_archive_api.app.mjs +++ b/components/zip_archive_api/zip_archive_api.app.mjs @@ -30,13 +30,8 @@ export default { }, files: { type: "string[]", - label: "Files URLs", - description: "The URLs or path of the files to be compressed", - }, - file: { - type: "string", - label: "File URL", - description: "The URL or path of the archive to extract the files from", + label: "File Paths or URLs", + description: "The files to upload. For each entry, provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)", }, }, methods: { diff --git a/components/zoho_bugtracker/actions/create-bug/create-bug.mjs b/components/zoho_bugtracker/actions/create-bug/create-bug.mjs index 624445fc20e30..3851c4abc364a 100644 --- a/components/zoho_bugtracker/actions/create-bug/create-bug.mjs +++ b/components/zoho_bugtracker/actions/create-bug/create-bug.mjs @@ -1,14 +1,12 @@ import FormData from "form-data"; -import fs from "fs"; -import { - clearObj, getUploadContentType, -} from "../../common/utils.mjs"; +import { clearObj } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import zohoBugtracker from "../../zoho_bugtracker.app.mjs"; export default { key: "zoho_bugtracker-create-bug", name: "Create Bug", - version: "0.0.1", + version: "0.1.0", description: "Create a new bug [See the documentation](https://www.zoho.com/projects/help/rest-api/bugtracker-bugs-api.html#alink3)", type: "action", props: { @@ -205,14 +203,14 @@ export default { } if (uploaddoc) { - - const file = fs.createReadStream(uploaddoc); - const filename = uploaddoc.split("/").pop(); - - formData.append("uploaddoc", file, { + const { + stream, metadata, + } = await getFileStreamAndMetadata(uploaddoc); + const filename = metadata.name; + formData.append("uploaddoc", stream, { header: [ `Content-Disposition: form-data; name="uploaddoc"; filename="${filename}"`, - `Content-Type: ${getUploadContentType(filename)}`, + `Content-Type: ${metadata.contentType}`, ], }); } diff --git a/components/zoho_bugtracker/actions/update-bug/update-bug.mjs b/components/zoho_bugtracker/actions/update-bug/update-bug.mjs index 7d0d8dfcb639a..fa1964c453ddb 100644 --- a/components/zoho_bugtracker/actions/update-bug/update-bug.mjs +++ b/components/zoho_bugtracker/actions/update-bug/update-bug.mjs @@ -1,14 +1,12 @@ import FormData from "form-data"; -import fs from "fs"; -import { - clearObj, getUploadContentType, -} from "../../common/utils.mjs"; +import { clearObj } from "../../common/utils.mjs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import zohoBugtracker from "../../zoho_bugtracker.app.mjs"; export default { key: "zoho_bugtracker-update-bug", name: "Update Bug", - version: "0.0.1", + version: "0.1.0", description: "Update a specific bug [See the documentation](https://www.zoho.com/projects/help/rest-api/bugtracker-bugs-api.html#alink4)", type: "action", props: { @@ -226,14 +224,17 @@ export default { } if (uploaddoc) { - - const file = fs.createReadStream(uploaddoc); - const filename = uploaddoc.split("/").pop(); - - formData.append("uploaddoc", file, { + const { + stream, metadata, + } = await getFileStreamAndMetadata(uploaddoc); + const filename = metadata.name; + formData.append("uploaddoc", stream, { + filename, + contentType: metadata.contentType, + knownLength: metadata.size, header: [ `Content-Disposition: form-data; name="uploaddoc"; filename="${filename}"`, - `Content-Type: ${getUploadContentType(filename)}`, + `Content-Type: ${metadata.contentType}`, ], }); } @@ -249,7 +250,7 @@ export default { }, }); - $.export("$summary", `A bug with Id: ${bugId} was successfully updated!`); + $.export("$summary", `Successfully updated bug with Id: ${bugId}!`); return response; }, }; diff --git a/components/zoho_bugtracker/common/utils.mjs b/components/zoho_bugtracker/common/utils.mjs index 8e252680570c5..9e95325308f9c 100644 --- a/components/zoho_bugtracker/common/utils.mjs +++ b/components/zoho_bugtracker/common/utils.mjs @@ -1,4 +1,3 @@ -import { ConfigurationError } from "@pipedream/platform"; /* eslint-disable no-unused-vars */ export const clearObj = (obj) => { return Object.entries(obj) @@ -19,14 +18,3 @@ export const clearObj = (obj) => { {}, ); }; - -export const getUploadContentType = (filename) => { - const fileExt = filename.split(".").pop(); - switch (fileExt.toLowerCase()) { - case "png": return "image/png"; - case "jpg": return "image/jpeg"; - case "jpeg": return "image/jpeg"; - case "gif": return "image/gif"; - default: throw ConfigurationError("Only `.jpg`, `.jpeg`, `.png`, and `.gif` may be used at this time. Other file types are not supported."); - } -}; diff --git a/components/zoho_bugtracker/package.json b/components/zoho_bugtracker/package.json index 04bce00319ed1..a2bbf1c974802 100644 --- a/components/zoho_bugtracker/package.json +++ b/components/zoho_bugtracker/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zoho_bugtracker", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Zoho BugTracker Components", "main": "zoho_bugtracker.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1", + "@pipedream/platform": "^3.1.0", "form-data": "^4.0.0" } } diff --git a/components/zoho_bugtracker/zoho_bugtracker.app.mjs b/components/zoho_bugtracker/zoho_bugtracker.app.mjs index 59d0f2872d3e5..aabbb2de763ec 100644 --- a/components/zoho_bugtracker/zoho_bugtracker.app.mjs +++ b/components/zoho_bugtracker/zoho_bugtracker.app.mjs @@ -166,11 +166,11 @@ export default { portalId: { type: "string", label: "Portal Id", - description: "The Id of the portal.", + description: "Select a portal or provide a portal ID", async options() { const { portals } = await this.listPortals(); - return portals.map(({ + return portals?.map(({ id_string: value, name: label, }) => ({ label, @@ -181,7 +181,7 @@ export default { projectId: { type: "string", label: "Project Id", - description: "project.", + description: "Select a project or provide a project ID", async options({ page, portalId, }) { @@ -275,8 +275,8 @@ export default { }, uploaddoc: { type: "string", - label: "Upload Doc", - description: "Please configure [Zoho Drive integration](https://help.zoho.com/portal/en/kb/projects/integration/zoho-apps/articles/zoho-workdrive-integration) to enable attachment for your Zoho BugTracker. The maximum size to upload a file is 128 MB. The path to the image file saved to the `/tmp` directory (e.g. `/tmp/image.png`). [see docs here](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).", + label: "Upload Doc File Path or URL", + description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`. Please configure [Zoho Drive integration](https://help.zoho.com/portal/en/kb/projects/integration/zoho-apps/articles/zoho-workdrive-integration) to enable attachment for your Zoho BugTracker. The maximum size to upload a file is 128 MB.", }, }, methods: { diff --git a/components/zoho_catalyst/actions/detect-objects-in-image/detect-objects-in-image.ts b/components/zoho_catalyst/actions/detect-objects-in-image/detect-objects-in-image.ts index 2830be7219d9b..ef61f78d75b75 100644 --- a/components/zoho_catalyst/actions/detect-objects-in-image/detect-objects-in-image.ts +++ b/components/zoho_catalyst/actions/detect-objects-in-image/detect-objects-in-image.ts @@ -6,7 +6,7 @@ export default defineAction({ key: "zoho_catalyst-detect-objects-in-image", name: "Detect Objects in Image", description: "Detect or recognize objects in an image. [See the documentation](https://catalyst.zoho.com/help/api/zia/or.html)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { app, @@ -28,14 +28,12 @@ export default defineAction({ imagePath, projectId, } = this; - const data = getImageFormData(imagePath); + const data = await getImageFormData(imagePath); const response = await this.app.detectObjectsInImage({ $, projectId, - headers: { - ...data.getHeaders(), - }, + headers: data.getHeaders(), data, }); diff --git a/components/zoho_catalyst/actions/extract-text-from-image/extract-text-from-image.ts b/components/zoho_catalyst/actions/extract-text-from-image/extract-text-from-image.ts index 8638155c41231..3a9d12bb70009 100644 --- a/components/zoho_catalyst/actions/extract-text-from-image/extract-text-from-image.ts +++ b/components/zoho_catalyst/actions/extract-text-from-image/extract-text-from-image.ts @@ -6,7 +6,7 @@ export default defineAction({ key: "zoho_catalyst-extract-text-from-image", name: "Extract Text from Image", description: "Extract text from an image. [See the documentation](https://catalyst.zoho.com/help/api/zia/ocr.html)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { app, @@ -28,14 +28,12 @@ export default defineAction({ imagePath, projectId, } = this; - const data = getImageFormData(imagePath); + const data = await getImageFormData(imagePath); const response = await this.app.extractTextFromImage({ $, projectId, - headers: { - ...data.getHeaders(), - }, + headers: data.getHeaders(), data, }); diff --git a/components/zoho_catalyst/actions/perform-face-detection-and-analysis/perform-face-detection-and-analysis.ts b/components/zoho_catalyst/actions/perform-face-detection-and-analysis/perform-face-detection-and-analysis.ts index 81062054af221..0b5268b6124d6 100644 --- a/components/zoho_catalyst/actions/perform-face-detection-and-analysis/perform-face-detection-and-analysis.ts +++ b/components/zoho_catalyst/actions/perform-face-detection-and-analysis/perform-face-detection-and-analysis.ts @@ -7,7 +7,7 @@ export default defineAction({ key: "zoho_catalyst-perform-face-detection-and-analysis", name: "Perform Face Detection and Analysis", description: "Perform face detection and analysis on an image. [See the documentation](https://catalyst.zoho.com/help/api/zia/face-analytics.html)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { app, @@ -58,7 +58,7 @@ export default defineAction({ imagePath, projectId, } = this; - const data = getImageFormData(imagePath); + const data = await getImageFormData(imagePath); for (const prop of [ "mode", "emotion", @@ -73,9 +73,7 @@ export default defineAction({ const response = await this.app.performImageFaceDetection({ $, projectId, - headers: { - ...data.getHeaders(), - }, + headers: data.getHeaders(), data, }); diff --git a/components/zoho_catalyst/actions/perform-image-moderation/perform-image-moderation.ts b/components/zoho_catalyst/actions/perform-image-moderation/perform-image-moderation.ts index c2fe6a7e69604..30f3bc0d9b316 100644 --- a/components/zoho_catalyst/actions/perform-image-moderation/perform-image-moderation.ts +++ b/components/zoho_catalyst/actions/perform-image-moderation/perform-image-moderation.ts @@ -7,7 +7,7 @@ export default defineAction({ key: "zoho_catalyst-perform-image-moderation", name: "Perform Image Moderation", description: "Perform image moderation on an image. [See the documentation](https://catalyst.zoho.com/help/api/zia/image-moderation.html)", - version: "0.0.1", + version: "0.1.0", type: "action", props: { app, @@ -37,15 +37,13 @@ export default defineAction({ imagePath, projectId, mode, } = this; - const data = getImageFormData(imagePath); + const data = await getImageFormData(imagePath); if (mode) data.append("mode", mode); const response = await this.app.performImageModeration({ $, projectId, - headers: { - ...data.getHeaders(), - }, + headers: data.getHeaders(), data, }); diff --git a/components/zoho_catalyst/app/zoho_catalyst.app.ts b/components/zoho_catalyst/app/zoho_catalyst.app.ts index 5634f91a11798..ccd5c34523849 100644 --- a/components/zoho_catalyst/app/zoho_catalyst.app.ts +++ b/components/zoho_catalyst/app/zoho_catalyst.app.ts @@ -26,9 +26,8 @@ export default defineApp({ }, imagePath: { type: "string", - label: "Image Path", - description: - "A file path in the `/tmp` directory. [See the documentation on working with files.](https://pipedream.com/docs/code/nodejs/working-with-files/)", + label: "Image Path or URL", + description: "The image to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.png`)", }, mode: { type: "string", diff --git a/components/zoho_catalyst/common/methods.ts b/components/zoho_catalyst/common/methods.ts index 6b0a2b6e65e6d..012986dd52a47 100644 --- a/components/zoho_catalyst/common/methods.ts +++ b/components/zoho_catalyst/common/methods.ts @@ -1,12 +1,16 @@ -import fs from "fs"; +import { getFileStreamAndMetadata } from "@pipedream/platform"; import FormData from "form-data"; -export function getImageFormData(imagePath: string) { - const content = fs.createReadStream(imagePath.startsWith("/tmp") - ? imagePath - : `/tmp/${imagePath}`.replace(/\/\//g, "/")); +export async function getImageFormData(imagePath: string) { + const { + stream, metadata, + } = await getFileStreamAndMetadata(imagePath); const data = new FormData(); - data.append("image", content); + data.append("image", stream, { + filename: metadata.name, + contentType: metadata.contentType, + knownLength: metadata.size, + }); return data; } diff --git a/components/zoho_catalyst/package.json b/components/zoho_catalyst/package.json index eb342293cbaa9..a0fa5725a87c0 100644 --- a/components/zoho_catalyst/package.json +++ b/components/zoho_catalyst/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zoho_catalyst", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Zoho Catalyst Components", "main": "dist/app/zoho_catalyst.app.mjs", "keywords": [ @@ -14,7 +14,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1", + "@pipedream/platform": "^3.1.0", "@pipedream/types": "^0.1.6", "form-data": "^4.0.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6c1739ef51b0..a7a11604f86d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8062,8 +8062,8 @@ importers: components/meistertask: dependencies: '@pipedream/platform': - specifier: ^1.4.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/melissa_data: {} @@ -9756,8 +9756,8 @@ importers: components/pdffiller: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -10113,8 +10113,8 @@ importers: components/pixelbin: dependencies: '@pipedream/platform': - specifier: 3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -10198,8 +10198,8 @@ importers: components/platerecognizer: dependencies: '@pipedream/platform': - specifier: ^1.6.5 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/platform_ly: {} @@ -10395,8 +10395,8 @@ importers: components/printautopilot: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/printavo: dependencies: @@ -10419,8 +10419,8 @@ importers: components/printify: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 crypto: specifier: ^1.0.1 version: 1.0.1 @@ -10431,8 +10431,8 @@ importers: components/printnode: dependencies: '@pipedream/platform': - specifier: 1.5.1 - version: 1.5.1 + specifier: ^3.1.0 + version: 3.1.0 components/prismic: {} @@ -10770,28 +10770,19 @@ importers: components/ragie: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 components/railsr: {} components/raindrop: dependencies: '@pipedream/platform': - specifier: ^1.2.0 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 - got: - specifier: ^13.0.0 - version: 13.0.0 - stream: - specifier: ^0.0.2 - version: 0.0.2 - util: - specifier: ^0.12.5 - version: 0.12.5 components/raisely: dependencies: @@ -10802,8 +10793,8 @@ importers: components/ramp: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 uuid: specifier: ^10.0.0 version: 10.0.0 @@ -11005,8 +10996,8 @@ importers: components/reform: dependencies: '@pipedream/platform': - specifier: ^1.6.0 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -11363,8 +11354,8 @@ importers: components/roboflow: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/rocket_chat: dependencies: @@ -11509,8 +11500,8 @@ importers: components/salesforce_rest_api: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 fast-xml-parser: specifier: ^4.3.2 version: 4.5.0 @@ -11648,8 +11639,8 @@ importers: components/scoredetect: dependencies: '@pipedream/platform': - specifier: ^1.6.0 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -11687,8 +11678,8 @@ importers: components/scrapfly: dependencies: '@pipedream/platform': - specifier: ^3.0.1 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 components/scrapingant: dependencies: @@ -11756,8 +11747,8 @@ importers: components/security_reporter: dependencies: '@pipedream/platform': - specifier: ^3.0.1 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -11857,8 +11848,8 @@ importers: components/sendgrid: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 '@sendgrid/client': specifier: ^7.6.2 version: 7.7.0 @@ -12052,8 +12043,8 @@ importers: components/sftp: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 ssh2-sftp-client: specifier: ^11.0.0 version: 11.0.0 @@ -12280,20 +12271,17 @@ importers: components/signaturit: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.1 version: 4.0.1 - fs: - specifier: ^0.0.1-security - version: 0.0.1-security components/signerx: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -12301,17 +12289,14 @@ importers: components/signnow: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 crypto: specifier: ^1.0.1 version: 1.0.1 form-data: specifier: ^4.0.0 version: 4.0.1 - fs: - specifier: ^0.0.1-security - version: 0.0.1-security uuid: specifier: ^10.0.0 version: 10.0.0 @@ -12574,14 +12559,11 @@ importers: components/smugmug: dependencies: '@pipedream/platform': - specifier: ^1.1.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 - fs: - specifier: ^0.0.1-security - version: 0.0.1-security components/snapchat_marketing: {} @@ -12676,14 +12658,11 @@ importers: components/sonix: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 - fs: - specifier: ^0.0.1-security - version: 0.0.1-security components/sourceforge: dependencies: @@ -13635,11 +13614,8 @@ importers: components/tinypng: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 - fs: - specifier: ^0.0.1-security - version: 0.0.1-security + specifier: ^3.1.0 + version: 3.1.0 stream: specifier: ^0.0.2 version: 0.0.2 @@ -13670,11 +13646,11 @@ importers: components/todoist: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 json-2-csv: - specifier: ^3.15.1 - version: 3.20.0 + specifier: ^5.5.9 + version: 5.5.9 query-string: specifier: ^7.1.3 version: 7.1.3 @@ -14994,8 +14970,8 @@ importers: components/xero_accounting_api: dependencies: '@pipedream/platform': - specifier: ^1.4.0 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/xperiencify: dependencies: @@ -15220,8 +15196,8 @@ importers: components/zerobounce: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.1 version: 4.0.1 @@ -15250,8 +15226,8 @@ importers: components/zip_archive_api: dependencies: '@pipedream/platform': - specifier: ^1.6.5 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -15297,8 +15273,8 @@ importers: components/zoho_bugtracker: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -15314,8 +15290,8 @@ importers: components/zoho_catalyst: dependencies: '@pipedream/platform': - specifier: ^1.5.1 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 '@pipedream/types': specifier: ^0.1.6 version: 0.1.6 @@ -15835,7 +15811,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.30))(jiti@1.21.6)(postcss@8.4.49)(tsx@4.19.4)(typescript@5.7.2)(yaml@2.6.1) @@ -15878,7 +15854,7 @@ importers: version: 3.1.0 jest: specifier: ^29.1.2 - version: 29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0) type-fest: specifier: ^4.15.0 version: 4.27.0 @@ -22811,10 +22787,6 @@ packages: babel-plugin-macros: optional: true - deeks@2.6.1: - resolution: {integrity: sha512-PZrpz5xLo2JPZa3L+kqMMMdZU5pRwMysTM1xd6pLhNtgQw4Iq3wbF2QWaQTVh+HRq9Yg4rcjDIJ+scfGLxmsjQ==} - engines: {node: '>= 12'} - deeks@3.1.0: resolution: {integrity: sha512-e7oWH1LzIdv/prMQ7pmlDlaVoL64glqzvNgkgQNgyec9ORPHrT2jaOqMtRyqJuwWjtfb6v+2rk9pmaHj+F137A==} engines: {node: '>= 16'} @@ -22999,10 +22971,6 @@ packages: do-wrapper@4.5.1: resolution: {integrity: sha512-E2I3xvDS306UwzpuQYL4wz5Fm+RvtV0cxOBPiWsflAEOA06mcBxAEUXvMeox9L6WI7R1PMiEhHLdo/s52JqUAQ==} - doc-path@3.1.0: - resolution: {integrity: sha512-Pv2hLQbUM8du5681lTWIYk0OtVBmNhMAeZNGeFhMMJBIR89Nw4XesBwee1Xtlfk83n71tn0Y6VsJOn4d3qIiTw==} - engines: {node: '>=12'} - doc-path@4.1.1: resolution: {integrity: sha512-h1ErTglQAVv2gCnOpD3sFS6uolDbOKHDU1BZq+Kl3npPqroU3dYL42lUgMfd5UimlwtRgp7C9dLGwqQ5D2HYgQ==} engines: {node: '>=16'} @@ -25541,10 +25509,6 @@ packages: engines: {node: '>=6'} hasBin: true - json-2-csv@3.20.0: - resolution: {integrity: sha512-IbqUB+yaycVNB/q2fiY5kyRjy5kRiEXqvNvGlxM5L0Bfi0RdvklVHc4t9MfeYF1GsZVpZWDBs9LdWmSjsQ8jvg==} - engines: {node: '>= 12'} - json-2-csv@5.5.9: resolution: {integrity: sha512-l4g6GZVHrsN+5SKkpOmGNSvho+saDZwXzj/xmcO0lJAgklzwsiqy70HS5tA9djcRvBEybZ9IF6R1MDFTEsaOGQ==} engines: {node: '>= 16'} @@ -40470,8 +40434,6 @@ snapshots: optionalDependencies: babel-plugin-macros: 3.1.0 - deeks@2.6.1: {} - deeks@3.1.0: {} deep-assign@3.0.0: @@ -40650,8 +40612,6 @@ snapshots: dependencies: got: 11.8.6 - doc-path@3.1.0: {} - doc-path@4.1.1: {} doctrine@2.1.0: @@ -44251,11 +44211,6 @@ snapshots: jsesc@3.0.2: {} - json-2-csv@3.20.0: - dependencies: - deeks: 2.6.1 - doc-path: 3.1.0 - json-2-csv@5.5.9: dependencies: deeks: 3.1.0 @@ -49799,7 +49754,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -49813,10 +49768,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 8.0.0-alpha.13 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) + babel-jest: 29.7.0(@babel/core@7.26.0) ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: