From c9fdcc0345b7b5946336f35ad70f0fff07b4d51d Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 6 Jan 2025 18:37:30 -0300 Subject: [PATCH 1/7] what_are_those init --- .../find-sneakers-by-sku.mjs | 34 +++++ .../grade-sneakers-condition.mjs | 69 ++++++++++ .../identify-sneakers-from-photo.mjs | 29 ++++ components/what_are_those/package.json | 2 +- .../what_are_those/what_are_those.app.mjs | 125 +++++++++++++++++- 5 files changed, 255 insertions(+), 4 deletions(-) create mode 100644 components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs create mode 100644 components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs create mode 100644 components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs diff --git a/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs b/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs new file mode 100644 index 0000000000000..f31509449f2e7 --- /dev/null +++ b/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs @@ -0,0 +1,34 @@ +import what_are_those from "../../what_are_those.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "what_are_those-find-sneakers-by-sku", + name: "Find Sneakers by SKU", + description: "Identifies sneakers from a size tag photo and returns sneaker name and details. [See the documentation]()", + version: "0.0.{{ts}}", + type: "action", + props: { + what_are_those: { + type: "app", + app: "what_are_those", + }, + sizeTagPhoto: { + propDefinition: [ + "what_are_those", + "sizeTagPhoto", + ], + }, + }, + async run({ $ }) { + const sneakerData = await this.what_are_those.identifySneakersFromSizeTag({ + sizeTagPhoto: this.sizeTagPhoto, + }); + const sneakerName = sneakerData.name; + const sneakerDetails = sneakerData.details; + $.export("$summary", `Identified sneaker: ${sneakerName}`); + return { + name: sneakerName, + details: sneakerDetails, + }; + }, +}; diff --git a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs new file mode 100644 index 0000000000000..6fe2bbe1284aa --- /dev/null +++ b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs @@ -0,0 +1,69 @@ +import what_are_those from "../../what_are_those.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "what_are_those-grade-sneakers-condition", + name: "Grade and Authenticate Sneakers", + description: "Grades and authenticates sneakers using provided images. [See the documentation]()", + version: "0.0.{{ts}}", + type: "action", + props: { + what_are_those, + frontImage: { + propDefinition: [ + what_are_those, + "frontImage", + ], + }, + leftImage: { + propDefinition: [ + what_are_those, + "leftImage", + ], + }, + rightImage: { + propDefinition: [ + what_are_those, + "rightImage", + ], + }, + soleImage: { + propDefinition: [ + what_are_those, + "soleImage", + ], + }, + insoleImage: { + propDefinition: [ + what_are_those, + "insoleImage", + ], + }, + sizeTagImage: { + propDefinition: [ + what_are_those, + "sizeTagImage", + ], + }, + type: { + propDefinition: [ + what_are_those, + "type", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.what_are_those.gradeAuthenticateSneakers({ + frontImage: this.frontImage, + leftImage: this.leftImage, + rightImage: this.rightImage, + soleImage: this.soleImage, + insoleImage: this.insoleImage, + sizeTagImage: this.sizeTagImage, + type: this.type, + }); + $.export("$summary", "Successfully graded and authenticated sneakers."); + return response; + }, +}; diff --git a/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs b/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs new file mode 100644 index 0000000000000..ffeb0afd63b6f --- /dev/null +++ b/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs @@ -0,0 +1,29 @@ +import what_are_those from "../../what_are_those.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "what_are_those-identify-sneakers-from-photo", + name: "Identify Sneakers from Photo", + description: "Identifies sneakers from an uploaded image and returns details such as name, links, images, prices, and confidence scores. [See the documentation]().", + version: "0.0.{{ts}}", + type: "action", + props: { + what_are_those, + image: { + propDefinition: [ + what_are_those, + "image", + ], + }, + }, + async run({ $ }) { + const response = await this.what_are_those.identifySneakers({ + image: this.image, + }); + const sneakerCount = Array.isArray(response) + ? response.length + : 1; + $.export("$summary", `Identified ${sneakerCount} sneakers successfully`); + return response; + }, +}; diff --git a/components/what_are_those/package.json b/components/what_are_those/package.json index 53583a683a064..f7934a0427514 100644 --- a/components/what_are_those/package.json +++ b/components/what_are_those/package.json @@ -12,4 +12,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/components/what_are_those/what_are_those.app.mjs b/components/what_are_those/what_are_those.app.mjs index 2a92abacf67a2..7f5b9ebc85b0f 100644 --- a/components/what_are_those/what_are_those.app.mjs +++ b/components/what_are_those/what_are_those.app.mjs @@ -1,11 +1,130 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "what_are_those", - propDefinitions: {}, + version: "0.0.{{ts}}", + propDefinitions: { + // Props for identifying sneakers from an uploaded image + image: { + type: "string", + label: "Image", + description: "Base64 encoded or multipart form data image.", + }, + // Props for grading and authenticating sneakers + frontImage: { + type: "string", + label: "Front Image", + description: "Base64 encoded or multipart form data image of the front.", + }, + leftImage: { + type: "string", + label: "Left Image", + description: "Base64 encoded or multipart form data image of the left side.", + }, + rightImage: { + type: "string", + label: "Right Image", + description: "Base64 encoded or multipart form data image of the right side.", + }, + soleImage: { + type: "string", + label: "Sole Image", + description: "Base64 encoded or multipart form data image of the sole.", + }, + insoleImage: { + type: "string", + label: "Insole Image", + description: "Base64 encoded or multipart form data image of the insole.", + }, + sizeTagImage: { + type: "string", + label: "Size Tag Image", + description: "Base64 encoded or multipart form data image of the size tag.", + }, + type: { + type: "string", + label: "Type", + description: "Optional parameter for grading-only results.", + optional: true, + }, + // Props for identifying sneakers from a size tag photo + sizeTagPhoto: { + type: "string", + label: "Size Tag Photo", + description: "File or base64 encoded data of the size tag photo.", + }, + }, methods: { - // this.$auth contains connected account data + // Existing method authKeys() { console.log(Object.keys(this.$auth)); }, + // Base URL for the API + _baseUrl() { + return "https://api.whatarethose.com"; + }, + // Method to make API requests + async _makeRequest(opts = {}) { + const { + $ = this, method = "GET", path = "/", headers, ...otherOpts + } = opts; + return axios($, { + method, + url: `${this._baseUrl()}${path}`, + headers: { + ...headers, + Authorization: `Bearer ${this.$auth.api_token}`, + }, + ...otherOpts, + }); + }, + // Method to identify sneakers from an uploaded image + async identifySneakers(opts = {}) { + const { image } = opts; + return this._makeRequest({ + method: "POST", + path: "/identify_sneakers", + data: { + image: image, + }, + }); + }, + // Method to grade and authenticate sneakers from multiple images + async gradeAuthenticateSneakers(opts = {}) { + const { + frontImage, + leftImage, + rightImage, + soleImage, + insoleImage, + sizeTagImage, + type, + } = opts; + return this._makeRequest({ + method: "POST", + path: "/grade_authenticate_sneakers", + data: { + front: frontImage, + left: leftImage, + right: rightImage, + sole: soleImage, + insole: insoleImage, + size_tag: sizeTagImage, + type: type, + }, + }); + }, + // Method to identify sneakers from a size tag photo + async identifySneakersFromSizeTag(opts = {}) { + const { sizeTagPhoto } = opts; + return this._makeRequest({ + method: "POST", + path: "/identify_from_size_tag", + data: { + size_tag_photo: sizeTagPhoto, + }, + }); + }, }, -}; \ No newline at end of file +}; From 33b1b2d343c446892ac21ec3a280b2a4a12c56ca Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 7 Jan 2025 11:04:39 -0300 Subject: [PATCH 2/7] [Components] what_are_those #15195 Actions - Identify Sneakers From Photo - Grade Sneakers Condition - Find Sneakers By SKU --- .../find-sneakers-by-sku.mjs | 41 +++--- .../grade-sneakers-condition.mjs | 88 ++++++------ .../identify-sneakers-from-photo.mjs | 35 ++--- components/what_are_those/common/utils.mjs | 6 + components/what_are_those/package.json | 5 +- .../what_are_those/what_are_those.app.mjs | 127 +++--------------- 6 files changed, 117 insertions(+), 185 deletions(-) create mode 100644 components/what_are_those/common/utils.mjs diff --git a/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs b/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs index f31509449f2e7..61f1296aca567 100644 --- a/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs +++ b/components/what_are_those/actions/find-sneakers-by-sku/find-sneakers-by-sku.mjs @@ -1,34 +1,31 @@ -import what_are_those from "../../what_are_those.app.mjs"; -import { axios } from "@pipedream/platform"; +import fs from "fs"; +import { checkTmp } from "../../common/utils.mjs"; +import app from "../../what_are_those.app.mjs"; export default { key: "what_are_those-find-sneakers-by-sku", name: "Find Sneakers by SKU", - description: "Identifies sneakers from a size tag photo and returns sneaker name and details. [See the documentation]()", - version: "0.0.{{ts}}", + description: "Identifies sneakers from a size tag photo and returns sneaker name and details. [See the documentation](https://documenter.getpostman.com/view/3847098/2sAY4rDQDs#4f6a49f9-3393-42cd-8474-3856a79888af)", + version: "0.0.1", type: "action", props: { - what_are_those: { - type: "app", - app: "what_are_those", - }, - sizeTagPhoto: { - propDefinition: [ - "what_are_those", - "sizeTagPhoto", - ], + app, + sizeTagImage: { + type: "string", + label: "Size Tag Image", + description: "The path to the size tag image 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).", }, }, async run({ $ }) { - const sneakerData = await this.what_are_those.identifySneakersFromSizeTag({ - sizeTagPhoto: this.sizeTagPhoto, + const data = fs.readFileSync(checkTmp(this.sizeTagImage)); + const base64Image = Buffer.from(data, "binary").toString("base64"); + + const response = await this.app.identifySneakersFromSizeTag({ + $, + data: base64Image, }); - const sneakerName = sneakerData.name; - const sneakerDetails = sneakerData.details; - $.export("$summary", `Identified sneaker: ${sneakerName}`); - return { - name: sneakerName, - details: sneakerDetails, - }; + + $.export("$summary", `Identified sneaker: ${response}`); + return response; }, }; diff --git a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs index 6fe2bbe1284aa..ff7f4e7dd1d40 100644 --- a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs +++ b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs @@ -1,67 +1,75 @@ -import what_are_those from "../../what_are_those.app.mjs"; -import { axios } from "@pipedream/platform"; +import FormData from "form-data"; +import fs from "fs"; +import { checkTmp } from "../../common/utils.mjs"; +import app from "../../what_are_those.app.mjs"; export default { key: "what_are_those-grade-sneakers-condition", name: "Grade and Authenticate Sneakers", - description: "Grades and authenticates sneakers using provided images. [See the documentation]()", - version: "0.0.{{ts}}", + description: "Grades and authenticates sneakers using provided images. [See the documentation](https://documenter.getpostman.com/view/3847098/2sAY4rDQDs#13d527e8-5d8f-4511-857c-b40b8dd921b8)", + version: "0.0.1", type: "action", props: { - what_are_those, + app, frontImage: { - propDefinition: [ - what_are_those, - "frontImage", - ], + type: "string", + label: "Front Image", + description: "Base64 encoded or multipart form data image of the front.", }, leftImage: { - propDefinition: [ - what_are_those, - "leftImage", - ], + type: "string", + label: "Left Image", + description: "Base64 encoded or multipart form data image of the left side.", }, rightImage: { - propDefinition: [ - what_are_those, - "rightImage", - ], + type: "string", + label: "Right Image", + description: "Base64 encoded or multipart form data image of the right side.", }, soleImage: { - propDefinition: [ - what_are_those, - "soleImage", - ], + type: "string", + label: "Sole Image", + description: "Base64 encoded or multipart form data image of the sole.", }, insoleImage: { - propDefinition: [ - what_are_those, - "insoleImage", - ], + type: "string", + label: "Insole Image", + description: "Base64 encoded or multipart form data image of the insole.", }, sizeTagImage: { - propDefinition: [ - what_are_those, - "sizeTagImage", - ], + type: "string", + label: "Size Tag Image", + description: "Base64 encoded or multipart form data image of the size tag.", }, type: { - propDefinition: [ - what_are_those, - "type", + type: "string", + label: "Use Type", + description: "the type parameter to see specific types of data.", + options: [ + "grading", + "authentication", ], optional: true, }, }, async run({ $ }) { - const response = await this.what_are_those.gradeAuthenticateSneakers({ - frontImage: this.frontImage, - leftImage: this.leftImage, - rightImage: this.rightImage, - soleImage: this.soleImage, - insoleImage: this.insoleImage, - sizeTagImage: this.sizeTagImage, - type: this.type, + const data = new FormData(); + data.append("image1", fs.createReadStream(checkTmp(this.frontImage))); + data.append("image2", fs.createReadStream(checkTmp(this.leftImage))); + data.append("image3", fs.createReadStream(checkTmp(this.rightImage))); + data.append("image4", fs.createReadStream(checkTmp(this.soleImage))); + data.append("image5", fs.createReadStream(checkTmp(this.insoleImage))); + data.append("image6", fs.createReadStream(checkTmp(this.sizeTagImage))); + + const response = await this.app.gradeAuthenticateSneakers({ + headers: { + ...data.getHeaders(), + }, + data: data, + maxBodyLength: Infinity, + params: { + type: this.type, + }, }); $.export("$summary", "Successfully graded and authenticated sneakers."); return response; diff --git a/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs b/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs index ffeb0afd63b6f..1ff6a6585f5c2 100644 --- a/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs +++ b/components/what_are_those/actions/identify-sneakers-from-photo/identify-sneakers-from-photo.mjs @@ -1,29 +1,34 @@ -import what_are_those from "../../what_are_those.app.mjs"; -import { axios } from "@pipedream/platform"; +import FormData from "form-data"; +import fs from "fs"; +import { checkTmp } from "../../common/utils.mjs"; +import app from "../../what_are_those.app.mjs"; export default { key: "what_are_those-identify-sneakers-from-photo", name: "Identify Sneakers from Photo", - description: "Identifies sneakers from an uploaded image and returns details such as name, links, images, prices, and confidence scores. [See the documentation]().", - version: "0.0.{{ts}}", + description: "Identifies sneakers from an uploaded image and returns details such as name, links, images, prices, and confidence scores. [See the documentation](https://documenter.getpostman.com/view/3847098/2sAY4rDQDs#957c900c-501f-4c8f-9b8b-71655a8cfb5d).", + version: "0.0.1", type: "action", props: { - what_are_those, + app, image: { - propDefinition: [ - what_are_those, - "image", - ], + type: "string", + label: "Image", + description: "The path to the size tag image 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).", }, }, async run({ $ }) { - const response = await this.what_are_those.identifySneakers({ - image: this.image, + const data = new FormData(); + data.append("image1", fs.createReadStream(checkTmp(this.image))); + + const response = await this.app.identifySneakers({ + headers: { + ...data.getHeaders(), + }, + data: data, }); - const sneakerCount = Array.isArray(response) - ? response.length - : 1; - $.export("$summary", `Identified ${sneakerCount} sneakers successfully`); + + $.export("$summary", `Identified ${response.names} sneakers successfully`); return response; }, }; diff --git a/components/what_are_those/common/utils.mjs b/components/what_are_those/common/utils.mjs new file mode 100644 index 0000000000000..74195274b7e26 --- /dev/null +++ b/components/what_are_those/common/utils.mjs @@ -0,0 +1,6 @@ +export const checkTmp = (filename) => { + if (!filename.startsWith("/tmp")) { + return "/tmp/filename"; + } + return filename; +}; diff --git a/components/what_are_those/package.json b/components/what_are_those/package.json index f7934a0427514..16b409180cf3b 100644 --- a/components/what_are_those/package.json +++ b/components/what_are_those/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/what_are_those", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream What Are Those Components", "main": "what_are_those.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } } diff --git a/components/what_are_those/what_are_those.app.mjs b/components/what_are_those/what_are_those.app.mjs index 7f5b9ebc85b0f..b578d247d61eb 100644 --- a/components/what_are_those/what_are_those.app.mjs +++ b/components/what_are_those/what_are_those.app.mjs @@ -3,127 +3,40 @@ import { axios } from "@pipedream/platform"; export default { type: "app", app: "what_are_those", - version: "0.0.{{ts}}", - propDefinitions: { - // Props for identifying sneakers from an uploaded image - image: { - type: "string", - label: "Image", - description: "Base64 encoded or multipart form data image.", - }, - // Props for grading and authenticating sneakers - frontImage: { - type: "string", - label: "Front Image", - description: "Base64 encoded or multipart form data image of the front.", - }, - leftImage: { - type: "string", - label: "Left Image", - description: "Base64 encoded or multipart form data image of the left side.", - }, - rightImage: { - type: "string", - label: "Right Image", - description: "Base64 encoded or multipart form data image of the right side.", - }, - soleImage: { - type: "string", - label: "Sole Image", - description: "Base64 encoded or multipart form data image of the sole.", - }, - insoleImage: { - type: "string", - label: "Insole Image", - description: "Base64 encoded or multipart form data image of the insole.", - }, - sizeTagImage: { - type: "string", - label: "Size Tag Image", - description: "Base64 encoded or multipart form data image of the size tag.", - }, - type: { - type: "string", - label: "Type", - description: "Optional parameter for grading-only results.", - optional: true, - }, - // Props for identifying sneakers from a size tag photo - sizeTagPhoto: { - type: "string", - label: "Size Tag Photo", - description: "File or base64 encoded data of the size tag photo.", - }, - }, methods: { - // Existing method - authKeys() { - console.log(Object.keys(this.$auth)); - }, - // Base URL for the API - _baseUrl() { - return "https://api.whatarethose.com"; - }, - // Method to make API requests - async _makeRequest(opts = {}) { - const { - $ = this, method = "GET", path = "/", headers, ...otherOpts - } = opts; + _headers(headers = {}) { + return { + "x-api-key": this.$auth.api_key, + ...headers, + }; + }, + _makeRequest({ + $ = this, headers, ...opts + }) { return axios($, { - method, - url: `${this._baseUrl()}${path}`, - headers: { - ...headers, - Authorization: `Bearer ${this.$auth.api_token}`, - }, - ...otherOpts, + headers: this._headers(headers), + ...opts, }); }, - // Method to identify sneakers from an uploaded image - async identifySneakers(opts = {}) { - const { image } = opts; + identifySneakers(opts = {}) { return this._makeRequest({ method: "POST", - path: "/identify_sneakers", - data: { - image: image, - }, + url: "https://ayq6s37rv6.execute-api.us-east-1.amazonaws.com/Prod/rec?data_type=multi", + ...opts, }); }, - // Method to grade and authenticate sneakers from multiple images - async gradeAuthenticateSneakers(opts = {}) { - const { - frontImage, - leftImage, - rightImage, - soleImage, - insoleImage, - sizeTagImage, - type, - } = opts; + gradeAuthenticateSneakers(opts = {}) { return this._makeRequest({ method: "POST", - path: "/grade_authenticate_sneakers", - data: { - front: frontImage, - left: leftImage, - right: rightImage, - sole: soleImage, - insole: insoleImage, - size_tag: sizeTagImage, - type: type, - }, + url: "https://6mdt6kw7ig.execute-api.us-east-1.amazonaws.com/Prod/list?data_type=multi", + ...opts, }); }, - // Method to identify sneakers from a size tag photo - async identifySneakersFromSizeTag(opts = {}) { - const { sizeTagPhoto } = opts; + identifySneakersFromSizeTag(opts = {}) { return this._makeRequest({ method: "POST", - path: "/identify_from_size_tag", - data: { - size_tag_photo: sizeTagPhoto, - }, + url: "https://0blrzg7ahc.execute-api.us-east-1.amazonaws.com/Prod/sku", + ...opts, }); }, }, From 2141862bc6d5b0a535e332f2363d08f80073b567 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 7 Jan 2025 11:05:32 -0300 Subject: [PATCH 3/7] pnpm update --- pnpm-lock.yaml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c921d2c19df8d..1fdffd2f38677 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1005,8 +1005,7 @@ importers: specifier: ^9.0.1 version: 9.0.1 - components/azure_storage: - specifiers: {} + components/azure_storage: {} components/backblaze: {} @@ -3104,8 +3103,7 @@ importers: components/easypost: {} - components/easypromos: - specifiers: {} + components/easypromos: {} components/easysendy: dependencies: @@ -3159,8 +3157,7 @@ importers: specifier: ^4.0.0 version: 4.0.1 - components/elevio: - specifiers: {} + components/elevio: {} components/elmah_io: dependencies: @@ -4823,8 +4820,7 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/homerun: - specifiers: {} + components/homerun: {} components/hookdeck: dependencies: @@ -8319,8 +8315,7 @@ importers: specifier: ^1.1.1 version: 1.6.6 - components/ragie: - specifiers: {} + components/ragie: {} components/railsr: {} @@ -8513,8 +8508,7 @@ importers: specifier: ^1.3.0 version: 1.6.6 - components/refiner: - specifiers: {} + components/refiner: {} components/reflect: dependencies: @@ -10545,8 +10539,7 @@ importers: specifier: ^1.1.0 version: 1.6.6 - components/textline: - specifiers: {} + components/textline: {} components/textlocal: dependencies: @@ -11052,8 +11045,7 @@ importers: specifier: ^6.2.13 version: 6.2.13 - components/typefully: - specifiers: {} + components/typefully: {} components/typless: {} @@ -11579,7 +11571,10 @@ importers: components/weworkbook: {} components/what_are_those: - specifiers: {} + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/whatconverts: {} From 8e5f0109ebe0a3260d07d1a9cd847f3a0c01fc88 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 8 Jan 2025 14:48:39 -0300 Subject: [PATCH 4/7] some adjusts --- .../grade-sneakers-condition.mjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs index ff7f4e7dd1d40..86f9df7a05472 100644 --- a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs +++ b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs @@ -14,32 +14,32 @@ export default { frontImage: { type: "string", label: "Front Image", - description: "Base64 encoded or multipart form data image of the front.", + description: "The path to the front image image 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).", }, leftImage: { type: "string", label: "Left Image", - description: "Base64 encoded or multipart form data image of the left side.", + description: "The path to the left image image 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).", }, rightImage: { type: "string", label: "Right Image", - description: "Base64 encoded or multipart form data image of the right side.", + description: "The path to the right image image 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).", }, soleImage: { type: "string", label: "Sole Image", - description: "Base64 encoded or multipart form data image of the sole.", + description: "The path to the sole image image 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).", }, insoleImage: { type: "string", label: "Insole Image", - description: "Base64 encoded or multipart form data image of the insole.", + description: "The path to the insole image image 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).", }, sizeTagImage: { type: "string", label: "Size Tag Image", - description: "Base64 encoded or multipart form data image of the size tag.", + description: "The path to the sizeTag image image 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).", }, type: { type: "string", From 0420e576d6459e1c5bf88e42533dfdb03dcdfda7 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 8 Jan 2025 14:50:13 -0300 Subject: [PATCH 5/7] Update components/what_are_those/common/utils.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- components/what_are_those/common/utils.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/what_are_those/common/utils.mjs b/components/what_are_those/common/utils.mjs index 74195274b7e26..1a5e36f32a603 100644 --- a/components/what_are_those/common/utils.mjs +++ b/components/what_are_those/common/utils.mjs @@ -1,6 +1,6 @@ export const checkTmp = (filename) => { if (!filename.startsWith("/tmp")) { - return "/tmp/filename"; + return `/tmp/${filename}`; } return filename; }; From 981915200e6eb53c7a91f679d2bb3048ac57ddc4 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 8 Jan 2025 14:56:08 -0300 Subject: [PATCH 6/7] pnpm update --- pnpm-lock.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f1be5d9dd7f7..14eb5f2dfd221 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1014,7 +1014,6 @@ importers: version: 9.0.1 components/azure_storage: {} - components/azure_storage: {} components/backblaze: {} @@ -6642,8 +6641,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/motive: - specifiers: {} + components/motive: {} components/moxie: dependencies: @@ -10826,8 +10824,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/traffit: - specifiers: {} + components/traffit: {} components/trainual: {} @@ -24719,22 +24716,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} From 2f14587bce245e5d9c7a090cc35a46d14827305d Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 9 Jan 2025 11:59:17 -0300 Subject: [PATCH 7/7] add timeout config --- .../grade-sneakers-condition/grade-sneakers-condition.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs index 86f9df7a05472..2382e7e4e40dd 100644 --- a/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs +++ b/components/what_are_those/actions/grade-sneakers-condition/grade-sneakers-condition.mjs @@ -70,6 +70,7 @@ export default { params: { type: this.type, }, + timeout: 120000, }); $.export("$summary", "Successfully graded and authenticated sneakers."); return response;