From 8d82d8f710a5cfa26b6ffdd583a37356c4341626 Mon Sep 17 00:00:00 2001 From: remoteretrieval Date: Tue, 17 Sep 2024 20:20:34 +0500 Subject: [PATCH 1/5] update after review --- components/remote_retrieval/README.md | 2 +- .../actions/all-orders/all-orders.mjs | 23 +++ .../create-device-order.mjs | 193 ++++++++++++++++++ .../get-pending-orders/get-pending-orders.mjs | 27 --- .../get-specific-order/get-specific-order.mjs | 29 --- components/remote_retrieval/common/utils.mjs | 10 + components/remote_retrieval/package.json | 2 +- .../remote_retrieval/remote_retrieval.app.mjs | 64 ++---- 8 files changed, 248 insertions(+), 102 deletions(-) create mode 100644 components/remote_retrieval/actions/all-orders/all-orders.mjs create mode 100644 components/remote_retrieval/actions/create-device-order/create-device-order.mjs delete mode 100644 components/remote_retrieval/actions/get-pending-orders/get-pending-orders.mjs delete mode 100644 components/remote_retrieval/actions/get-specific-order/get-specific-order.mjs diff --git a/components/remote_retrieval/README.md b/components/remote_retrieval/README.md index 7a39cbc6b01e6..aef3df86b44ed 100644 --- a/components/remote_retrieval/README.md +++ b/components/remote_retrieval/README.md @@ -1,3 +1,3 @@ # Overview -The Remote-Retriever API is tailored for automating the retrieval of contact information, enhancing your CRM data, or developing lead generation tools. By integrating it with Pipedream, you can efficiently extract valuable data and automate workflows for marketing, sales, or customer support. Pipedream’s serverless platform allows you to connect Retriever with numerous other apps, triggering actions based on new data, or updating systems instantly. +The Remote-Retrieval API is tailored for automating the retrieval of contact information, enhancing your CRM data, or developing lead generation tools. By integrating it with Pipedream, you can efficiently extract valuable data and automate workflows for marketing, sales, or customer support. Pipedream’s serverless platform allows you to connect Retrieval with numerous other apps, triggering actions based on new data, or updating systems instantly. diff --git a/components/remote_retrieval/actions/all-orders/all-orders.mjs b/components/remote_retrieval/actions/all-orders/all-orders.mjs new file mode 100644 index 0000000000000..60550eb0bfc7d --- /dev/null +++ b/components/remote_retrieval/actions/all-orders/all-orders.mjs @@ -0,0 +1,23 @@ +import app from "../../remote_retrieval.app.mjs"; + +export default { + key: "remote_retrieval-get-all-orders", + name: "Get All Order", + description: "Retrieve a list of all orders.[See the documentation](https://www.remoteretrieval.com/api-documentation/#pending-orders)", + type: "action", + version: "0.1.0", + props: { + app, + }, + methods: { + }, + async run({ $: step }) { + const response = await this.app.allOrders({ + step, + }); + + step.export("$summary", `Successfully retrieved ${response.results.length} order(s).`); + + return response; + }, +}; diff --git a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs new file mode 100644 index 0000000000000..6cdbd5520bb99 --- /dev/null +++ b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs @@ -0,0 +1,193 @@ +import app from "../../remote_retrieval.app.mjs"; + +export default { + key: "remote_retrieval-create-device-order", + name: "Create Device Order", + description: "Creates a device return order. [See the documentation](https://www.remoteretrieval.com/api-documentation/#create-order)", + type: "action", + version: "0.1.0", + props: { + app, + + employeeInfoEmail: { + type: "string", + label: "Employee Info Email", + description: "Used in email communications with the employee." + }, + employeeInfoName: { + type: "string", + label: "Employee Info Name", + description: "Employee full name to print on the shipping label." + }, + employeeInfoAdd_1: { + type: "string", + label: "Employee Info Address Line 1", + description: "The first line of the employee address" + }, + employeeInfoAdd_2: { + type: "string", + label: "Employee Info Address Line 2", + description: "The second line is optional for employee address", + optional: true , + }, + employeeInfoCity: { + type: "string", + label: "Employee Info City", + description: "City of employee", + }, + employeeInfoState: { + type: "string", + label: "Employee Info State", + description: "State of employee", + }, + employeeInfoZip: { + type: "string", + label: "Employee Info Zip", + description: "Zip code of employee", + }, + employeeInfoPhone: { + type: "string", + label: "Employee Info Phone", + description: "Phone of employee", + }, + employeeInfoCountry: { + type: "string", + label: "Employee Info Country", + description: "This service is only for USA", + options: ["US"], + default: "US", + }, + + companyInfoPerson: { + type: "string", + label: "Company Info Person Name", + description: "Receipient Name" + }, + companyInfoCompanyName: { + type: "string", + label: "Company Info Company Name", + description: "Company Name" + }, + companyInfoAdd_1: { + type: "string", + label: "Company Info Address Line 1", + description: "The first line of the company address" + }, + companyInfoAdd_2: { + type: "string", + label: "Company Info Address Line 2", + description: "The second line is optional for company address", + }, + companyInfoCity: { + type: "string", + label: "Company Info City", + description: "Company city", + }, + companyInfoState: { + type: "string", + label: "Company Info State", + description: "Company State(Example: TX,AL,NJ)", + }, + companyInfoZip: { + type: "string", + label: "Company Info Zip", + description: "Company Zip", + }, + companyInfoPhone: { + type: "string", + label: "Company Info Phone", + description: "Company Phone", + }, + companyInfoEmail: { + type: "string", + label: "Company Info Email", + description: "Company Email", + }, + typeOfEquipment: { + type: "string", + label: "Type of Equipment", + description: "You can choose 'Laptop' or 'Monitor'", + options: ['Laptop','Monitor'], + default: "Laptop" + }, + orderType: { + type: "string", + label: "Order Type", + description: "You can choose 'Return to Company' or 'Sell this Equipment'", + options: ['Return to Company','Sell this Equipment'], + default: "Return to Company" + }, + }, + + methods: { + createDeviceReturn(args = {}) { + return this.app.post({ + path: "/create-order/", + ...args, + }); + }, + }, + + + async run({ $: step }) { + const { + createDeviceReturn, + employeeInfoEmail, + employeeInfoName, + employeeInfoAdd_1, + employeeInfoAdd_2, + employeeInfoCity, + employeeInfoState, + employeeInfoZip, + employeeInfoPhone, + companyInfoPerson, + companyInfoCompanyName, + companyInfoAdd_1, + companyInfoAdd_2, + companyInfoCity, + companyInfoState, + companyInfoZip, + companyInfoPhone, + companyInfoEmail, + typeOfEquipment, + orderType + + } = this; + + const response = await createDeviceReturn({ + step, + data: { + type_of_equipment: typeOfEquipment, + order_type: orderType, + employee_info: { + email: employeeInfoEmail, + name: employeeInfoName, + address_line_1: employeeInfoAdd_1, + address_line_2: employeeInfoAdd_2, + address_city: employeeInfoCity, + address_state: employeeInfoState, + address_zip: employeeInfoZip, + phone: employeeInfoPhone, + }, + company_info: { + return_person_name: companyInfoPerson, + return_company_name: companyInfoCompanyName, + return_address_line_1: companyInfoAdd_1, + return_address_line_2: companyInfoAdd_2, + return_address_city: companyInfoCity, + return_address_state: companyInfoState, + return_address_zip: companyInfoZip, + email: companyInfoEmail, + phone: companyInfoPhone, + }, + }, + }); + + step.export("$summary", `Successfully created device return order with ID \`${response.order}\``); + + return response; + }, + + + +}; diff --git a/components/remote_retrieval/actions/get-pending-orders/get-pending-orders.mjs b/components/remote_retrieval/actions/get-pending-orders/get-pending-orders.mjs deleted file mode 100644 index 72c99b820af89..0000000000000 --- a/components/remote_retrieval/actions/get-pending-orders/get-pending-orders.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import app from "../../remote_retrieval.app.mjs"; -import utils from "../../common/utils.mjs"; - -export default { - key: "remote_retrieval-get-pending-orders", - name: "Get Pending Orders", - description: "Retrieve a list of the orders for which the payment process has not been completed.[See the documentation](https://www.remoteretrieval.com/api-documentation/#pending-orders)", - type: "action", - version: "0.0.1", - props: { - app, - }, - methods: {}, - async run({ $ }) { - const results = this.app.getResourcesStream({ - resourceFn: this.app.getPendingOrders, - resourceFnArgs: { - $, - }, - }); - const orders = await utils.streamIterator(results); - - $.export("$summary", `Successfully retrieved ${orders.length} pending order(s).`); - - return orders; - }, -}; diff --git a/components/remote_retrieval/actions/get-specific-order/get-specific-order.mjs b/components/remote_retrieval/actions/get-specific-order/get-specific-order.mjs deleted file mode 100644 index fdc1c862a2c06..0000000000000 --- a/components/remote_retrieval/actions/get-specific-order/get-specific-order.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import app from "../../remote_retrieval.app.mjs"; - -export default { - key: "remote_retrieval-get-specific-order", - name: "Get Specific Order", - description: "Fetches a single device return order. [See the documentation](https://www.remoteretrieval.com/api-documentation/#order-detail)", - type: "action", - version: "0.0.1", - props: { - app, - oid: { - propDefinition: [ - app, - "oid", - ], - }, - }, - async run({ $ }) { - const { oid } = this; - const response = await this.app.getOrder({ - $, - oid, - }); - - $.export("$summary", `Successfully retrieved order with ID \`${this.oid}\`.`); - - return response; - }, -}; diff --git a/components/remote_retrieval/common/utils.mjs b/components/remote_retrieval/common/utils.mjs index a7e8a35885f72..09602a28990c4 100644 --- a/components/remote_retrieval/common/utils.mjs +++ b/components/remote_retrieval/common/utils.mjs @@ -6,6 +6,16 @@ async function streamIterator(stream) { return resources; } + +function getParamFromUrl(url, key = "cursor") { + if (!url) { + return null; + } + const parsedUrl = new URL(url); + return parsedUrl.searchParams.get(key); +} + export default { streamIterator, + getParamFromUrl, }; diff --git a/components/remote_retrieval/package.json b/components/remote_retrieval/package.json index e386b5aa7437b..8ad117ae98409 100644 --- a/components/remote_retrieval/package.json +++ b/components/remote_retrieval/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/remote_retrieval", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Remote Retrieval Components", "main": "remote_retrieval.app.mjs", "keywords": [ diff --git a/components/remote_retrieval/remote_retrieval.app.mjs b/components/remote_retrieval/remote_retrieval.app.mjs index f5a22fabde358..32ff74e099663 100644 --- a/components/remote_retrieval/remote_retrieval.app.mjs +++ b/components/remote_retrieval/remote_retrieval.app.mjs @@ -1,32 +1,11 @@ import { axios } from "@pipedream/platform"; +import utils from "./common/utils.mjs"; import constants from "./common/constants.mjs"; export default { type: "app", app: "remote_retrieval", - propDefinitions: { - oid: { - type: "string", - label: "Order ID", - description: "The ID of the order to retrieve.", - async options({ page }) { - const orders = await this.getDeviceReturnOrders({ - params: { - page: page + 1, - }, - }); - if (orders.message === "Data not found!") { - return []; - } - return orders?.map(({ - order_id: value, shipments, - }) => ({ - value, - label: `Order ID: ${value} - ${shipments.device_type}`, - })) || []; - }, - }, - }, + propDefinitions: { }, methods: { getBaseUrl() { return `${constants.BASE_URL}${constants.VERSION_PATH}`; @@ -59,32 +38,20 @@ export default { ...args, }); }, - getOrder({ - oid, ...args - } = {}) { - return this.makeRequest({ - path: `/device_returns?oid=${oid}/`, - ...args, - }); - }, - getDeviceReturnOrders(args = {}) { - return this.makeRequest({ - path: "/device_returns", - ...args, - }); - }, - getPendingOrders(args = {}) { + allOrders(args = {}) { return this.makeRequest({ - path: "/pending-orders/", + path: "/orders/", ...args, }); }, + async *getResourcesStream({ resourceFn, resourceFnArgs, + resourceName, max = constants.DEFAULT_MAX, }) { - let page = 1; + let cursor; let resourcesCount = 0; while (true) { @@ -92,17 +59,19 @@ export default { await resourceFn({ ...resourceFnArgs, params: { - page, + cursor, ...resourceFnArgs?.params, }, }); - if (!response || response.message === "Data not found!") { + const nextResources = resourceName && response[resourceName] || response; + + if (!nextResources?.length) { console.log("No more resources found"); return; } - for (const resource of response) { + for (const resource of nextResources) { yield resource; resourcesCount += 1; @@ -111,8 +80,15 @@ export default { } } - page++; + if (!response.next) { + console.log("No next cursor found"); + return; + } + + cursor = utils.getParamFromUrl(response.next); } }, + + }, }; From cf16ec8bd245aedf0ed01ad4f21094dd94f4acec Mon Sep 17 00:00:00 2001 From: remoteretrieval Date: Wed, 18 Sep 2024 14:25:26 +0500 Subject: [PATCH 2/5] fixed lint base issue --- .../actions/all-orders/all-orders.mjs | 5 +- .../create-device-order.mjs | 275 +++++++++--------- components/remote_retrieval/common/utils.mjs | 1 - .../remote_retrieval/remote_retrieval.app.mjs | 1 - 4 files changed, 137 insertions(+), 145 deletions(-) diff --git a/components/remote_retrieval/actions/all-orders/all-orders.mjs b/components/remote_retrieval/actions/all-orders/all-orders.mjs index 60550eb0bfc7d..9030572724315 100644 --- a/components/remote_retrieval/actions/all-orders/all-orders.mjs +++ b/components/remote_retrieval/actions/all-orders/all-orders.mjs @@ -9,11 +9,10 @@ export default { props: { app, }, - methods: { - }, + methods: {}, async run({ $: step }) { const response = await this.app.allOrders({ - step, + step, }); step.export("$summary", `Successfully retrieved ${response.results.length} order(s).`); diff --git a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs index 6cdbd5520bb99..877a922813917 100644 --- a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs +++ b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs @@ -10,113 +10,112 @@ export default { app, employeeInfoEmail: { - type: "string", - label: "Employee Info Email", - description: "Used in email communications with the employee." - }, - employeeInfoName: { - type: "string", - label: "Employee Info Name", - description: "Employee full name to print on the shipping label." - }, - employeeInfoAdd_1: { - type: "string", - label: "Employee Info Address Line 1", - description: "The first line of the employee address" - }, - employeeInfoAdd_2: { - type: "string", - label: "Employee Info Address Line 2", - description: "The second line is optional for employee address", - optional: true , - }, - employeeInfoCity: { - type: "string", - label: "Employee Info City", - description: "City of employee", - }, - employeeInfoState: { - type: "string", - label: "Employee Info State", - description: "State of employee", - }, - employeeInfoZip: { - type: "string", - label: "Employee Info Zip", - description: "Zip code of employee", - }, - employeeInfoPhone: { - type: "string", - label: "Employee Info Phone", - description: "Phone of employee", - }, - employeeInfoCountry: { - type: "string", - label: "Employee Info Country", - description: "This service is only for USA", - options: ["US"], - default: "US", - }, - - companyInfoPerson: { - type: "string", - label: "Company Info Person Name", - description: "Receipient Name" - }, - companyInfoCompanyName: { - type: "string", - label: "Company Info Company Name", - description: "Company Name" - }, - companyInfoAdd_1: { - type: "string", - label: "Company Info Address Line 1", - description: "The first line of the company address" - }, - companyInfoAdd_2: { - type: "string", - label: "Company Info Address Line 2", - description: "The second line is optional for company address", - }, - companyInfoCity: { - type: "string", - label: "Company Info City", - description: "Company city", - }, - companyInfoState: { - type: "string", - label: "Company Info State", - description: "Company State(Example: TX,AL,NJ)", - }, - companyInfoZip: { - type: "string", - label: "Company Info Zip", - description: "Company Zip", - }, - companyInfoPhone: { - type: "string", - label: "Company Info Phone", - description: "Company Phone", - }, - companyInfoEmail: { - type: "string", - label: "Company Info Email", - description: "Company Email", - }, - typeOfEquipment: { - type: "string", - label: "Type of Equipment", - description: "You can choose 'Laptop' or 'Monitor'", - options: ['Laptop','Monitor'], - default: "Laptop" - }, - orderType: { - type: "string", - label: "Order Type", - description: "You can choose 'Return to Company' or 'Sell this Equipment'", - options: ['Return to Company','Sell this Equipment'], - default: "Return to Company" - }, + type: "string", + label: "Employee Info Email", + description: "Used in email communications with the employee." + }, + employeeInfoName: { + type: "string", + label: "Employee Info Name", + description: "Employee full name to print on the shipping label." + }, + employeeInfoAdd_1: { + type: "string", + label: "Employee Info Address Line 1", + description: "The first line of the employee address" + }, + employeeInfoAdd_2: { + type: "string", + label: "Employee Info Address Line 2", + description: "The second line is optional for employee address", + optional: true , + }, + employeeInfoCity: { + type: "string", + label: "Employee Info City", + description: "City of employee", + }, + employeeInfoState: { + type: "string", + label: "Employee Info State", + description: "State of employee", + }, + employeeInfoZip: { + type: "string", + label: "Employee Info Zip", + description: "Zip code of employee", + }, + employeeInfoPhone: { + type: "string", + label: "Employee Info Phone", + description: "Phone of employee", + }, + employeeInfoCountry: { + type: "string", + label: "Employee Info Country", + description: "This service is only for USA", + options: ["US"], + default: "US", + }, + companyInfoPerson: { + type: "string", + label: "Company Info Person Name", + description: "Receipient Name" + }, + companyInfoCompanyName: { + type: "string", + label: "Company Info Company Name", + description: "Company Name" + }, + companyInfoAdd_1: { + type: "string", + label: "Company Info Address Line 1", + description: "The first line of the company address" + }, + companyInfoAdd_2: { + type: "string", + label: "Company Info Address Line 2", + description: "The second line is optional for company address", + }, + companyInfoCity: { + type: "string", + label: "Company Info City", + description: "Company city", + }, + companyInfoState: { + type: "string", + label: "Company Info State", + description: "Company State(Example: TX,AL,NJ)", + }, + companyInfoZip: { + type: "string", + label: "Company Info Zip", + description: "Company Zip", + }, + companyInfoPhone: { + type: "string", + label: "Company Info Phone", + description: "Company Phone", + }, + companyInfoEmail: { + type: "string", + label: "Company Info Email", + description: "Company Email", + }, + typeOfEquipment: { + type: "string", + label: "Type of Equipment", + description: "You can choose 'Laptop' or 'Monitor'", + options: ['Laptop','Monitor'], + default: "Laptop" + }, + orderType: { + type: "string", + label: "Order Type", + description: "You can choose 'Return to Company' or 'Sell this Equipment'", + options: ['Return to Company','Sell this Equipment'], + default: "Return to Company" + }, }, methods: { @@ -128,30 +127,28 @@ export default { }, }, - async run({ $: step }) { const { - createDeviceReturn, - employeeInfoEmail, - employeeInfoName, - employeeInfoAdd_1, - employeeInfoAdd_2, - employeeInfoCity, - employeeInfoState, - employeeInfoZip, - employeeInfoPhone, - companyInfoPerson, - companyInfoCompanyName, - companyInfoAdd_1, - companyInfoAdd_2, - companyInfoCity, - companyInfoState, - companyInfoZip, - companyInfoPhone, - companyInfoEmail, - typeOfEquipment, - orderType - + createDeviceReturn, + employeeInfoEmail, + employeeInfoName, + employeeInfoAdd_1, + employeeInfoAdd_2, + employeeInfoCity, + employeeInfoState, + employeeInfoZip, + employeeInfoPhone, + companyInfoPerson, + companyInfoCompanyName, + companyInfoAdd_1, + companyInfoAdd_2, + companyInfoCity, + companyInfoState, + companyInfoZip, + companyInfoPhone, + companyInfoEmail, + typeOfEquipment, + orderType } = this; const response = await createDeviceReturn({ @@ -170,15 +167,15 @@ export default { phone: employeeInfoPhone, }, company_info: { - return_person_name: companyInfoPerson, - return_company_name: companyInfoCompanyName, - return_address_line_1: companyInfoAdd_1, - return_address_line_2: companyInfoAdd_2, - return_address_city: companyInfoCity, - return_address_state: companyInfoState, - return_address_zip: companyInfoZip, - email: companyInfoEmail, - phone: companyInfoPhone, + return_person_name: companyInfoPerson, + return_company_name: companyInfoCompanyName, + return_address_line_1: companyInfoAdd_1, + return_address_line_2: companyInfoAdd_2, + return_address_city: companyInfoCity, + return_address_state: companyInfoState, + return_address_zip: companyInfoZip, + email: companyInfoEmail, + phone: companyInfoPhone, }, }, }); @@ -188,6 +185,4 @@ export default { return response; }, - - }; diff --git a/components/remote_retrieval/common/utils.mjs b/components/remote_retrieval/common/utils.mjs index 09602a28990c4..974339bb863b8 100644 --- a/components/remote_retrieval/common/utils.mjs +++ b/components/remote_retrieval/common/utils.mjs @@ -6,7 +6,6 @@ async function streamIterator(stream) { return resources; } - function getParamFromUrl(url, key = "cursor") { if (!url) { return null; diff --git a/components/remote_retrieval/remote_retrieval.app.mjs b/components/remote_retrieval/remote_retrieval.app.mjs index 32ff74e099663..eb9c29f6b9376 100644 --- a/components/remote_retrieval/remote_retrieval.app.mjs +++ b/components/remote_retrieval/remote_retrieval.app.mjs @@ -89,6 +89,5 @@ export default { } }, - }, }; From 2e44e22410e816b84a0cc979b12b44d192180307 Mon Sep 17 00:00:00 2001 From: remoteretrieval Date: Thu, 19 Sep 2024 13:51:46 +0500 Subject: [PATCH 3/5] updates after review --- components/remote_retrieval/actions/all-orders/all-orders.mjs | 2 +- .../actions/create-device-order/create-device-order.mjs | 2 +- components/remote_retrieval/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/remote_retrieval/actions/all-orders/all-orders.mjs b/components/remote_retrieval/actions/all-orders/all-orders.mjs index 9030572724315..a6c8bc00406e4 100644 --- a/components/remote_retrieval/actions/all-orders/all-orders.mjs +++ b/components/remote_retrieval/actions/all-orders/all-orders.mjs @@ -5,7 +5,7 @@ export default { name: "Get All Order", description: "Retrieve a list of all orders.[See the documentation](https://www.remoteretrieval.com/api-documentation/#pending-orders)", type: "action", - version: "0.1.0", + version: "0.0.1", props: { app, }, diff --git a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs index 877a922813917..d6db35ebe5299 100644 --- a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs +++ b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs @@ -5,7 +5,7 @@ export default { name: "Create Device Order", description: "Creates a device return order. [See the documentation](https://www.remoteretrieval.com/api-documentation/#create-order)", type: "action", - version: "0.1.0", + version: "0.0.1", props: { app, diff --git a/components/remote_retrieval/package.json b/components/remote_retrieval/package.json index 8ad117ae98409..750b310adb283 100644 --- a/components/remote_retrieval/package.json +++ b/components/remote_retrieval/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/remote_retrieval", - "version": "0.1.1", + "version": "0.2.0", "description": "Pipedream Remote Retrieval Components", "main": "remote_retrieval.app.mjs", "keywords": [ From fb358747e1037b135726bc2258c6a01e019b94ed Mon Sep 17 00:00:00 2001 From: remoteretrieval Date: Fri, 27 Sep 2024 19:02:54 +0500 Subject: [PATCH 4/5] updates --- .../actions/create-device-order/create-device-order.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs index d6db35ebe5299..4675c85c8a903 100644 --- a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs +++ b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs @@ -151,7 +151,7 @@ export default { orderType } = this; - const response = await createDeviceReturn({ + const response = await this.createDeviceReturn({ step, data: { type_of_equipment: typeOfEquipment, From 1dd4b5a225a8f1ea3bc14588873e15c615cd6dbb Mon Sep 17 00:00:00 2001 From: remoteretrieval Date: Fri, 18 Oct 2024 21:44:09 +0500 Subject: [PATCH 5/5] update --- .../actions/all-orders/all-orders.mjs | 4 +- .../create-device-order.mjs | 54 +++++++++++-------- components/remote_retrieval/package.json | 3 ++ .../remote_retrieval/remote_retrieval.app.mjs | 2 +- package-lock.json | 8 ++- package.json | 2 +- 6 files changed, 44 insertions(+), 29 deletions(-) diff --git a/components/remote_retrieval/actions/all-orders/all-orders.mjs b/components/remote_retrieval/actions/all-orders/all-orders.mjs index a6c8bc00406e4..57f3ecef0f067 100644 --- a/components/remote_retrieval/actions/all-orders/all-orders.mjs +++ b/components/remote_retrieval/actions/all-orders/all-orders.mjs @@ -11,8 +11,8 @@ export default { }, methods: {}, async run({ $: step }) { - const response = await this.app.allOrders({ - step, + const response = await this.app.allOrders({ + step, }); step.export("$summary", `Successfully retrieved ${response.results.length} order(s).`); diff --git a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs index 4675c85c8a903..09d9ed79a99df 100644 --- a/components/remote_retrieval/actions/create-device-order/create-device-order.mjs +++ b/components/remote_retrieval/actions/create-device-order/create-device-order.mjs @@ -12,23 +12,23 @@ export default { employeeInfoEmail: { type: "string", label: "Employee Info Email", - description: "Used in email communications with the employee." + description: "Used in email communications with the employee.", }, employeeInfoName: { type: "string", label: "Employee Info Name", - description: "Employee full name to print on the shipping label." + description: "Employee full name to print on the shipping label.", }, employeeInfoAdd_1: { type: "string", label: "Employee Info Address Line 1", - description: "The first line of the employee address" + description: "The first line of the employee address", }, employeeInfoAdd_2: { type: "string", label: "Employee Info Address Line 2", description: "The second line is optional for employee address", - optional: true , + optional: true, }, employeeInfoCity: { type: "string", @@ -54,23 +54,25 @@ export default { type: "string", label: "Employee Info Country", description: "This service is only for USA", - options: ["US"], - default: "US", - }, + options: [ + "US", + ], + default: "US", + }, companyInfoPerson: { type: "string", label: "Company Info Person Name", - description: "Receipient Name" + description: "Receipient Name", }, companyInfoCompanyName: { type: "string", label: "Company Info Company Name", - description: "Company Name" + description: "Company Name", }, companyInfoAdd_1: { type: "string", label: "Company Info Address Line 1", - description: "The first line of the company address" + description: "The first line of the company address", }, companyInfoAdd_2: { type: "string", @@ -80,41 +82,47 @@ export default { companyInfoCity: { type: "string", label: "Company Info City", - description: "Company city", + description: "Company city", }, companyInfoState: { type: "string", label: "Company Info State", - description: "Company State(Example: TX,AL,NJ)", + description: "Company State(Example: TX,AL,NJ)", }, companyInfoZip: { type: "string", label: "Company Info Zip", - description: "Company Zip", + description: "Company Zip", }, companyInfoPhone: { type: "string", label: "Company Info Phone", - description: "Company Phone", - }, + description: "Company Phone", + }, companyInfoEmail: { type: "string", label: "Company Info Email", - description: "Company Email", + description: "Company Email", }, typeOfEquipment: { type: "string", label: "Type of Equipment", description: "You can choose 'Laptop' or 'Monitor'", - options: ['Laptop','Monitor'], - default: "Laptop" - }, + options: [ + "Laptop", + "Monitor", + ], + default: "Laptop", + }, orderType: { type: "string", label: "Order Type", description: "You can choose 'Return to Company' or 'Sell this Equipment'", - options: ['Return to Company','Sell this Equipment'], - default: "Return to Company" + options: [ + "Return to Company", + "Sell this Equipment", + ], + default: "Return to Company", }, }, @@ -127,7 +135,7 @@ export default { }, }, - async run({ $: step }) { + async run({ $: step }) { const { createDeviceReturn, employeeInfoEmail, @@ -148,7 +156,7 @@ export default { companyInfoPhone, companyInfoEmail, typeOfEquipment, - orderType + orderType, } = this; const response = await this.createDeviceReturn({ diff --git a/components/remote_retrieval/package.json b/components/remote_retrieval/package.json index 750b310adb283..6b00e0bb776e3 100644 --- a/components/remote_retrieval/package.json +++ b/components/remote_retrieval/package.json @@ -14,5 +14,8 @@ }, "dependencies": { "@pipedream/platform": "^3.0.0" + }, + "devDependencies": { + "eslint": "^9.12.0" } } diff --git a/components/remote_retrieval/remote_retrieval.app.mjs b/components/remote_retrieval/remote_retrieval.app.mjs index eb9c29f6b9376..dd93630f0881e 100644 --- a/components/remote_retrieval/remote_retrieval.app.mjs +++ b/components/remote_retrieval/remote_retrieval.app.mjs @@ -44,7 +44,7 @@ export default { ...args, }); }, - + async *getResourcesStream({ resourceFn, resourceFnArgs, diff --git a/package-lock.json b/package-lock.json index 3477aaa6b77c6..44c4c50ce45b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@types/jest": "^27.4.1", "@typescript-eslint/eslint-plugin": "^5.27.1", "@typescript-eslint/parser": "^5.21.0", - "eslint": "8.15.0", + "eslint": "^8.15.0", "eslint-plugin-jest": "^26.5.3", "eslint-plugin-jsonc": "^1.6.0", "eslint-plugin-pipedream": "0.2.4", @@ -4681,8 +4681,10 @@ }, "node_modules/eslint": { "version": "8.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz", + "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, - "license": "MIT", "dependencies": { "@eslint/eslintrc": "^1.2.3", "@humanwhocodes/config-array": "^0.9.2", @@ -14148,6 +14150,8 @@ }, "eslint": { "version": "8.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz", + "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==", "dev": true, "requires": { "@eslint/eslintrc": "^1.2.3", diff --git a/package.json b/package.json index 675a044924005..2c7c0ef710c3f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@types/jest": "^27.4.1", "@typescript-eslint/eslint-plugin": "^5.27.1", "@typescript-eslint/parser": "^5.21.0", - "eslint": "8.15.0", + "eslint": "^8.15.0", "eslint-plugin-jest": "^26.5.3", "eslint-plugin-jsonc": "^1.6.0", "eslint-plugin-pipedream": "0.2.4",