Skip to content

Commit 94b65a4

Browse files
2 parents 56d9818 + 28ddba7 commit 94b65a4

File tree

9 files changed

+382
-158
lines changed

9 files changed

+382
-158
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
import app from "../../remote_retrieval.app.mjs";
2+
3+
export default {
4+
key: "remote_retrieval-create-order",
5+
name: "Create Order",
6+
description: "Create order in Remote Retrieval. [See the documentation](https://www.remoteretrieval.com/api-integration/#create-order)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
typeOfEquipment: {
12+
propDefinition: [
13+
app,
14+
"typeOfEquipment",
15+
],
16+
},
17+
orderType: {
18+
propDefinition: [
19+
app,
20+
"orderType",
21+
],
22+
},
23+
email: {
24+
propDefinition: [
25+
app,
26+
"email",
27+
],
28+
},
29+
name: {
30+
propDefinition: [
31+
app,
32+
"name",
33+
],
34+
},
35+
addressLine1: {
36+
propDefinition: [
37+
app,
38+
"addressLine1",
39+
],
40+
},
41+
addressLine2: {
42+
propDefinition: [
43+
app,
44+
"addressLine2",
45+
],
46+
},
47+
addressCity: {
48+
propDefinition: [
49+
app,
50+
"addressCity",
51+
],
52+
},
53+
addressState: {
54+
propDefinition: [
55+
app,
56+
"addressState",
57+
],
58+
},
59+
addressCountry: {
60+
propDefinition: [
61+
app,
62+
"addressCountry",
63+
],
64+
},
65+
addressZip: {
66+
propDefinition: [
67+
app,
68+
"addressZip",
69+
],
70+
},
71+
phone: {
72+
propDefinition: [
73+
app,
74+
"phone",
75+
],
76+
},
77+
returnPersonName: {
78+
propDefinition: [
79+
app,
80+
"returnPersonName",
81+
],
82+
},
83+
returnCompanyName: {
84+
propDefinition: [
85+
app,
86+
"returnCompanyName",
87+
],
88+
},
89+
returnAddressLine1: {
90+
propDefinition: [
91+
app,
92+
"returnAddressLine1",
93+
],
94+
},
95+
returnAddressLine2: {
96+
propDefinition: [
97+
app,
98+
"returnAddressLine2",
99+
],
100+
},
101+
returnAddressCity: {
102+
propDefinition: [
103+
app,
104+
"returnAddressCity",
105+
],
106+
},
107+
returnAddressState: {
108+
propDefinition: [
109+
app,
110+
"returnAddressState",
111+
],
112+
},
113+
returnAddressCountry: {
114+
propDefinition: [
115+
app,
116+
"returnAddressCountry",
117+
],
118+
},
119+
returnAddressZip: {
120+
propDefinition: [
121+
app,
122+
"returnAddressZip",
123+
],
124+
},
125+
companyEmail: {
126+
propDefinition: [
127+
app,
128+
"companyEmail",
129+
],
130+
},
131+
companyPhone: {
132+
propDefinition: [
133+
app,
134+
"companyPhone",
135+
],
136+
},
137+
},
138+
139+
async run({ $ }) {
140+
const response = await this.app.createOrder({
141+
$,
142+
data: {
143+
orders: [
144+
{
145+
type_of_equipment: this.typeOfEquipment,
146+
order_type: this.orderType,
147+
employee_info: {
148+
email: this.email,
149+
name: this.name,
150+
address_line_1: this.addressLine1,
151+
address_line_2: this.addressLine2 || "",
152+
address_city: this.addressCity,
153+
address_state: this.addressState,
154+
address_country: this.addressCountry,
155+
address_zip: this.addressZip,
156+
phone: this.phone,
157+
},
158+
company_info: {
159+
return_person_name: this.returnPersonName,
160+
return_company_name: this.returnCompanyName,
161+
return_address_line_1: this.returnAddressLine1,
162+
return_address_line_2: this.returnAddressLine2 || "",
163+
return_address_city: this.returnAddressCity,
164+
return_address_state: this.returnAddressState,
165+
return_address_country: this.returnAddressCountry,
166+
return_address_zip: this.returnAddressZip,
167+
email: this.companyEmail,
168+
phone: this.companyPhone,
169+
},
170+
},
171+
],
172+
},
173+
});
174+
$.export("$summary", "Successfully created order");
175+
return response;
176+
},
177+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import app from "../../remote_retrieval.app.mjs";
2+
3+
export default {
4+
key: "remote_retrieval-get-order-details",
5+
name: "Get Order Details",
6+
description: "Get the details of the specified order. [See the documentation](https://www.remoteretrieval.com/api-integration/#order-detail)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
orderId: {
12+
propDefinition: [
13+
app,
14+
"orderId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.app.getOrderDetails({
20+
$,
21+
params: {
22+
ORDER_ID: this.orderId,
23+
},
24+
});
25+
$.export("$summary", `Successfully retrieved details of order with ID '${this.orderId}'`);
26+
return response;
27+
},
28+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import app from "../../remote_retrieval.app.mjs";
2+
3+
export default {
4+
key: "remote_retrieval-get-orders",
5+
name: "Get Orders",
6+
description: "Get a list of all orders. [See the documentation](https://www.remoteretrieval.com/api-integration/#all-orders)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const response = await this.app.getOrders({
14+
$,
15+
});
16+
$.export("$summary", `Successfully retrieved ${response.results.length} orders`);
17+
return response;
18+
},
19+
};

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.
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
const BASE_URL = "https://remoteretrieval.com/RR-enterprise/remoteretrieval/public/index.php";
2-
const VERSION_PATH = "/api/v1";
3-
const DEFAULT_MAX = 600;
4-
5-
export default {
6-
BASE_URL,
7-
VERSION_PATH,
8-
DEFAULT_MAX,
1+
export default {
2+
EQUIPMENT_TYPES: [
3+
"Laptop",
4+
"Monitor",
5+
],
6+
ORDER_TYPES: [
7+
"Return To Company",
8+
"Sell this Equipment",
9+
],
910
};

components/remote_retrieval/package.json

Lines changed: 2 additions & 2 deletions
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": [
@@ -13,6 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^3.0.0"
16+
"@pipedream/platform": "^3.0.1"
1717
}
1818
}

0 commit comments

Comments
 (0)