Skip to content

Commit 8d82d8f

Browse files
update after review
1 parent a48cf80 commit 8d82d8f

File tree

8 files changed

+248
-102
lines changed

8 files changed

+248
-102
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Overview
22

3-
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.
3+
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.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import app from "../../remote_retrieval.app.mjs";
2+
3+
export default {
4+
key: "remote_retrieval-get-all-orders",
5+
name: "Get All Order",
6+
description: "Retrieve a list of all orders.[See the documentation](https://www.remoteretrieval.com/api-documentation/#pending-orders)",
7+
type: "action",
8+
version: "0.1.0",
9+
props: {
10+
app,
11+
},
12+
methods: {
13+
},
14+
async run({ $: step }) {
15+
const response = await this.app.allOrders({
16+
step,
17+
});
18+
19+
step.export("$summary", `Successfully retrieved ${response.results.length} order(s).`);
20+
21+
return response;
22+
},
23+
};
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
import app from "../../remote_retrieval.app.mjs";
2+
3+
export default {
4+
key: "remote_retrieval-create-device-order",
5+
name: "Create Device Order",
6+
description: "Creates a device return order. [See the documentation](https://www.remoteretrieval.com/api-documentation/#create-order)",
7+
type: "action",
8+
version: "0.1.0",
9+
props: {
10+
app,
11+
12+
employeeInfoEmail: {
13+
type: "string",
14+
label: "Employee Info Email",
15+
description: "Used in email communications with the employee."
16+
},
17+
employeeInfoName: {
18+
type: "string",
19+
label: "Employee Info Name",
20+
description: "Employee full name to print on the shipping label."
21+
},
22+
employeeInfoAdd_1: {
23+
type: "string",
24+
label: "Employee Info Address Line 1",
25+
description: "The first line of the employee address"
26+
},
27+
employeeInfoAdd_2: {
28+
type: "string",
29+
label: "Employee Info Address Line 2",
30+
description: "The second line is optional for employee address",
31+
optional: true ,
32+
},
33+
employeeInfoCity: {
34+
type: "string",
35+
label: "Employee Info City",
36+
description: "City of employee",
37+
},
38+
employeeInfoState: {
39+
type: "string",
40+
label: "Employee Info State",
41+
description: "State of employee",
42+
},
43+
employeeInfoZip: {
44+
type: "string",
45+
label: "Employee Info Zip",
46+
description: "Zip code of employee",
47+
},
48+
employeeInfoPhone: {
49+
type: "string",
50+
label: "Employee Info Phone",
51+
description: "Phone of employee",
52+
},
53+
employeeInfoCountry: {
54+
type: "string",
55+
label: "Employee Info Country",
56+
description: "This service is only for USA",
57+
options: ["US"],
58+
default: "US",
59+
},
60+
61+
companyInfoPerson: {
62+
type: "string",
63+
label: "Company Info Person Name",
64+
description: "Receipient Name"
65+
},
66+
companyInfoCompanyName: {
67+
type: "string",
68+
label: "Company Info Company Name",
69+
description: "Company Name"
70+
},
71+
companyInfoAdd_1: {
72+
type: "string",
73+
label: "Company Info Address Line 1",
74+
description: "The first line of the company address"
75+
},
76+
companyInfoAdd_2: {
77+
type: "string",
78+
label: "Company Info Address Line 2",
79+
description: "The second line is optional for company address",
80+
},
81+
companyInfoCity: {
82+
type: "string",
83+
label: "Company Info City",
84+
description: "Company city",
85+
},
86+
companyInfoState: {
87+
type: "string",
88+
label: "Company Info State",
89+
description: "Company State(Example: TX,AL,NJ)",
90+
},
91+
companyInfoZip: {
92+
type: "string",
93+
label: "Company Info Zip",
94+
description: "Company Zip",
95+
},
96+
companyInfoPhone: {
97+
type: "string",
98+
label: "Company Info Phone",
99+
description: "Company Phone",
100+
},
101+
companyInfoEmail: {
102+
type: "string",
103+
label: "Company Info Email",
104+
description: "Company Email",
105+
},
106+
typeOfEquipment: {
107+
type: "string",
108+
label: "Type of Equipment",
109+
description: "You can choose 'Laptop' or 'Monitor'",
110+
options: ['Laptop','Monitor'],
111+
default: "Laptop"
112+
},
113+
orderType: {
114+
type: "string",
115+
label: "Order Type",
116+
description: "You can choose 'Return to Company' or 'Sell this Equipment'",
117+
options: ['Return to Company','Sell this Equipment'],
118+
default: "Return to Company"
119+
},
120+
},
121+
122+
methods: {
123+
createDeviceReturn(args = {}) {
124+
return this.app.post({
125+
path: "/create-order/",
126+
...args,
127+
});
128+
},
129+
},
130+
131+
132+
async run({ $: step }) {
133+
const {
134+
createDeviceReturn,
135+
employeeInfoEmail,
136+
employeeInfoName,
137+
employeeInfoAdd_1,
138+
employeeInfoAdd_2,
139+
employeeInfoCity,
140+
employeeInfoState,
141+
employeeInfoZip,
142+
employeeInfoPhone,
143+
companyInfoPerson,
144+
companyInfoCompanyName,
145+
companyInfoAdd_1,
146+
companyInfoAdd_2,
147+
companyInfoCity,
148+
companyInfoState,
149+
companyInfoZip,
150+
companyInfoPhone,
151+
companyInfoEmail,
152+
typeOfEquipment,
153+
orderType
154+
155+
} = this;
156+
157+
const response = await createDeviceReturn({
158+
step,
159+
data: {
160+
type_of_equipment: typeOfEquipment,
161+
order_type: orderType,
162+
employee_info: {
163+
email: employeeInfoEmail,
164+
name: employeeInfoName,
165+
address_line_1: employeeInfoAdd_1,
166+
address_line_2: employeeInfoAdd_2,
167+
address_city: employeeInfoCity,
168+
address_state: employeeInfoState,
169+
address_zip: employeeInfoZip,
170+
phone: employeeInfoPhone,
171+
},
172+
company_info: {
173+
return_person_name: companyInfoPerson,
174+
return_company_name: companyInfoCompanyName,
175+
return_address_line_1: companyInfoAdd_1,
176+
return_address_line_2: companyInfoAdd_2,
177+
return_address_city: companyInfoCity,
178+
return_address_state: companyInfoState,
179+
return_address_zip: companyInfoZip,
180+
email: companyInfoEmail,
181+
phone: companyInfoPhone,
182+
},
183+
},
184+
});
185+
186+
step.export("$summary", `Successfully created device return order with ID \`${response.order}\``);
187+
188+
return response;
189+
},
190+
191+
192+
193+
};

components/remote_retrieval/actions/get-pending-orders/get-pending-orders.mjs

Lines changed: 0 additions & 27 deletions
This file was deleted.

components/remote_retrieval/actions/get-specific-order/get-specific-order.mjs

Lines changed: 0 additions & 29 deletions
This file was deleted.

components/remote_retrieval/common/utils.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ async function streamIterator(stream) {
66
return resources;
77
}
88

9+
10+
function getParamFromUrl(url, key = "cursor") {
11+
if (!url) {
12+
return null;
13+
}
14+
const parsedUrl = new URL(url);
15+
return parsedUrl.searchParams.get(key);
16+
}
17+
918
export default {
1019
streamIterator,
20+
getParamFromUrl,
1121
};

components/remote_retrieval/package.json

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

0 commit comments

Comments
 (0)