Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 177 additions & 0 deletions components/remote_retrieval/actions/create-order/create-order.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
import app from "../../remote_retrieval.app.mjs";

export default {
key: "remote_retrieval-create-order",
name: "Create Order",
description: "Create order in Remote Retrieval. [See the documentation](https://www.remoteretrieval.com/api-documentation/#create-order)",
version: "0.0.1",
type: "action",
props: {
app,
typeOfEquipment: {
propDefinition: [
app,
"typeOfEquipment",
],
},
orderType: {
propDefinition: [
app,
"orderType",
],
},
email: {
propDefinition: [
app,
"email",
],
},
name: {
propDefinition: [
app,
"name",
],
},
addressLine1: {
propDefinition: [
app,
"addressLine1",
],
},
addressLine2: {
propDefinition: [
app,
"addressLine2",
],
},
addressCity: {
propDefinition: [
app,
"addressCity",
],
},
addressState: {
propDefinition: [
app,
"addressState",
],
},
addressCountry: {
propDefinition: [
app,
"addressCountry",
],
},
addressZip: {
propDefinition: [
app,
"addressZip",
],
},
phone: {
propDefinition: [
app,
"phone",
],
},
returnPersonName: {
propDefinition: [
app,
"returnPersonName",
],
},
returnCompanyName: {
propDefinition: [
app,
"returnCompanyName",
],
},
returnAddressLine1: {
propDefinition: [
app,
"returnAddressLine1",
],
},
returnAddressLine2: {
propDefinition: [
app,
"returnAddressLine2",
],
},
returnAddressCity: {
propDefinition: [
app,
"returnAddressCity",
],
},
returnAddressState: {
propDefinition: [
app,
"returnAddressState",
],
},
returnAddressCountry: {
propDefinition: [
app,
"returnAddressCountry",
],
},
returnAddressZip: {
propDefinition: [
app,
"returnAddressZip",
],
},
companyEmail: {
propDefinition: [
app,
"companyEmail",
],
},
companyPhone: {
propDefinition: [
app,
"companyPhone",
],
},
},

async run({ $ }) {
const response = await this.app.createOrder({
$,
data: {
orders: [
{
type_of_equipment: this.typeOfEquipment,
order_type: this.orderType,
employee_info: {
email: this.email,
name: this.name,
address_line_1: this.addressLine1,
address_line_2: this.addressLine2,
address_city: this.addressCity,
address_state: this.addressState,
address_country: this.addressCountry,
address_zip: this.addressZip,
phone: this.phone,
},
company_info: {
return_person_name: this.returnPersonName,
return_company_name: this.returnCompanyName,
return_address_line_1: this.returnAddressLine1,
return_address_line_2: this.returnAddressLine2,
return_address_city: this.returnAddressCity,
return_address_state: this.returnAddressState,
return_address_country: this.returnAddressCountry,
return_address_zip: this.returnAddressZip,
email: this.companyEmail,
phone: this.companyPhone,
},
},
],
},
});
$.export("$summary", "Successfully created order");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../remote_retrieval.app.mjs";

export default {
key: "remote_retrieval-get-completed-orders",
name: "Get Completed Orders",
description: "Get a list of orders where payment has already been completed. [See the documentation](https://www.remoteretrieval.com/api-documentation/#completed-orders)",
version: "0.0.1",
type: "action",
props: {
app,
page: {
propDefinition: [
app,
"page",
],
},
},
async run({ $ }) {
const response = await this.app.getCompletedOrders({
$,
params: {
page: this.page,
},
});
$.export("$summary", `Successfully sent request. Response: '${response.message}'`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../remote_retrieval.app.mjs";

export default {
key: "remote_retrieval-get-new-orders",
name: "Get New Orders",
description: "Get a list of new orders. [See the documentation](https://www.remoteretrieval.com/api-documentation/#new-orders)",
version: "0.0.1",
type: "action",
props: {
app,
page: {
propDefinition: [
app,
"page",
],
},
},
async run({ $ }) {
const response = await this.app.getNewOrders({
$,
params: {
page: this.page,
},
});
$.export("$summary", `Successfully sent request. Response: '${response.message}'`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
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",
version: "0.0.2",
props: {
app,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
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",
version: "0.0.2",
props: {
app,
oid: {
Expand Down
17 changes: 9 additions & 8 deletions components/remote_retrieval/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const BASE_URL = "https://remoteretrieval.com/RR-enterprise/remoteretrieval/public/index.php";
const VERSION_PATH = "/api/v1";
const DEFAULT_MAX = 600;

export default {
BASE_URL,
VERSION_PATH,
DEFAULT_MAX,
export default {
EQUIPMENT_TYPES: [
"Laptop",
"Monitor",
],
ORDER_TYPES: [
"Return To Company",
"Sell this Equipment",
],
};
4 changes: 2 additions & 2 deletions components/remote_retrieval/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.0"
"@pipedream/platform": "^3.0.1"
}
}
Loading