@pipedream/everstox 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/get-order/get-order.mjs +1 -1
- package/actions/get-return/get-return.mjs +1 -1
- package/actions/list-order-id-options/list-order-id-options.mjs +33 -0
- package/actions/list-order-number-options/list-order-number-options.mjs +33 -0
- package/actions/list-return-id-options/list-return-id-options.mjs +33 -0
- package/actions/list-returns/list-returns.mjs +1 -1
- package/actions/list-warehouse-ids-options/list-warehouse-ids-options.mjs +33 -0
- package/actions/search-orders/search-orders.mjs +145 -0
- package/common/constants.mjs +40 -0
- package/everstox.app.mjs +25 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "everstox-get-order",
|
|
5
5
|
name: "Get Order",
|
|
6
6
|
description: "Get an order from Everstox. [See the documentation](https://api.everstox.com/api/v1/ui/#/Order/district_core.api.shops.orders.orders.Orders.get)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "everstox-get-return",
|
|
5
5
|
name: "Get Return",
|
|
6
6
|
description: "Get a return from Everstox. [See the documentation](https://api.everstox.com/api/v1/ui/#/Returns%20V2/district_core.api.shops.returns_v2.returns_v2.ReturnsV2.get)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import everstox from "../../everstox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "everstox-list-order-id-options",
|
|
5
|
+
name: "List Order ID Options",
|
|
6
|
+
description: "Retrieves available options for the Order ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
everstox,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await everstox.propDefinitions.orderId.options.call(this.everstox, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import everstox from "../../everstox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "everstox-list-order-number-options",
|
|
5
|
+
name: "List Order Number Options",
|
|
6
|
+
description: "Retrieves available options for the Order Number field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
everstox,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await everstox.propDefinitions.orderNumber.options.call(this.everstox, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import everstox from "../../everstox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "everstox-list-return-id-options",
|
|
5
|
+
name: "List Return ID Options",
|
|
6
|
+
description: "Retrieves available options for the Return ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
everstox,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await everstox.propDefinitions.returnId.options.call(this.everstox, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "everstox-list-returns",
|
|
6
6
|
name: "List Returns",
|
|
7
7
|
description: "List returns from Everstox. [See the documentation](https://api.everstox.com/api/v1/ui/#/Returns%20V2/district_core.api.shops.returns_v2.returns_v2.ReturnsV2.index)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.2",
|
|
9
9
|
type: "action",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import everstox from "../../everstox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "everstox-list-warehouse-ids-options",
|
|
5
|
+
name: "List Warehouse IDs Options",
|
|
6
|
+
description: "Retrieves available options for the Warehouse IDs field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
everstox,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await everstox.propDefinitions.warehouseIds.options.call(this.everstox, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import constants from "../../common/constants.mjs";
|
|
2
|
+
import everstox from "../../everstox.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "everstox-search-orders",
|
|
6
|
+
name: "Search Orders by Order Number",
|
|
7
|
+
description: "Search orders from Everstox. [See the documentation](https://api.everstox.com/api/v1/ui/#/Order/district_core.api.shops.orders.orders.Orders.index)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
annotations: {
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
everstox,
|
|
17
|
+
warehouseIds: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
everstox,
|
|
20
|
+
"warehouseIds",
|
|
21
|
+
],
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
fields: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
everstox,
|
|
27
|
+
"fields",
|
|
28
|
+
],
|
|
29
|
+
type: "string[]",
|
|
30
|
+
label: "Fields",
|
|
31
|
+
description: "Fields to filter for",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
orderNumber: {
|
|
35
|
+
propDefinition: [
|
|
36
|
+
everstox,
|
|
37
|
+
"orderNumber",
|
|
38
|
+
],
|
|
39
|
+
description: "Filter for order number",
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
hoursLateLte: {
|
|
43
|
+
type: "integer",
|
|
44
|
+
label: "Hours Late Less Than or Equal to",
|
|
45
|
+
description: "Filter for orders late for the amount of hours less or equal than the provided value",
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
hoursLateGte: {
|
|
49
|
+
type: "integer",
|
|
50
|
+
label: "Hours Late Greater Than or Equal to",
|
|
51
|
+
description: "Filter for orders late for the amount of hours greater or equal than the provided value",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
search: {
|
|
55
|
+
type: "string",
|
|
56
|
+
label: "Search",
|
|
57
|
+
description: "Multi-attribute-search filters either for Customer Email or Billing Address or Order Number. Returns set of orders where at least one of those attributes match the search term",
|
|
58
|
+
optional: true,
|
|
59
|
+
},
|
|
60
|
+
fulfillmentState: {
|
|
61
|
+
type: "string",
|
|
62
|
+
label: "Fulfillment State",
|
|
63
|
+
description: "Fulfillment State to filter for order where the corresponding fulfillment is in the given state",
|
|
64
|
+
options: constants.FULFILLMENT_STATE_OPTIONS,
|
|
65
|
+
optional: true,
|
|
66
|
+
},
|
|
67
|
+
fulfillmentStategroup: {
|
|
68
|
+
type: "string",
|
|
69
|
+
label: "Fulfillment Stategroup",
|
|
70
|
+
description: "Fulfillment Stategroup to filter for order where the corresponding fulfillment is in the given stategroup",
|
|
71
|
+
options: constants.FULFILLMENT_STATEGROUP_OPTIONS,
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
stategroup: {
|
|
75
|
+
type: "string",
|
|
76
|
+
label: "Stategroup",
|
|
77
|
+
description: "Stategroup to filter for, e.g. open includes states like new, in_progress etc",
|
|
78
|
+
options: constants.STATEGROUP_OPTIONS,
|
|
79
|
+
optional: true,
|
|
80
|
+
},
|
|
81
|
+
cancellationState: {
|
|
82
|
+
type: "string",
|
|
83
|
+
label: "Cancellation State",
|
|
84
|
+
description: "Cancellation State to filter for order with min 1 cancellation in that state",
|
|
85
|
+
options: constants.CANCELLATION_STATE_OPTIONS,
|
|
86
|
+
optional: true,
|
|
87
|
+
},
|
|
88
|
+
shipmentDateGte: {
|
|
89
|
+
type: "string",
|
|
90
|
+
label: "Shipment Date Greater Than or Equal",
|
|
91
|
+
description: "Find orders whose shipment date is greater than or equal to the provided value",
|
|
92
|
+
optional: true,
|
|
93
|
+
},
|
|
94
|
+
updatedDateGte: {
|
|
95
|
+
type: "string",
|
|
96
|
+
label: "Updated Date Greater Than or Equal",
|
|
97
|
+
description: "Find orders whose updated date is greater than or equal to the provided value",
|
|
98
|
+
optional: true,
|
|
99
|
+
},
|
|
100
|
+
createdDateGte: {
|
|
101
|
+
type: "string",
|
|
102
|
+
label: "Created Date Greater Than or Equal",
|
|
103
|
+
description: "Find orders whose creation date is greater than or equal to the provided value",
|
|
104
|
+
optional: true,
|
|
105
|
+
},
|
|
106
|
+
createdDateLte: {
|
|
107
|
+
type: "string",
|
|
108
|
+
label: "Created Date Less Than or Equal",
|
|
109
|
+
description: "Find orders whose created date is less than or equal to the provided value",
|
|
110
|
+
optional: true,
|
|
111
|
+
},
|
|
112
|
+
shipmentsForwardedToShop: {
|
|
113
|
+
type: "boolean",
|
|
114
|
+
label: "Shipments Forwarded to Shop",
|
|
115
|
+
description: "Boolean returning orders with shipments forwarded to shop",
|
|
116
|
+
optional: true,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
async run({ $ }) {
|
|
120
|
+
const response = await this.everstox.listOrders({
|
|
121
|
+
$,
|
|
122
|
+
params: {
|
|
123
|
+
warehouse_ids: this.warehouseIds,
|
|
124
|
+
fields: this.fields,
|
|
125
|
+
order_number: this.orderNumber,
|
|
126
|
+
hours_late_lte: this.hoursLateLte,
|
|
127
|
+
hours_late_gte: this.hoursLateGte,
|
|
128
|
+
search: this.search,
|
|
129
|
+
fulfillment_state: this.fulfillmentState,
|
|
130
|
+
fulfillment_stategroup: this.fulfillmentStategroup,
|
|
131
|
+
stategroup: this.stategroup,
|
|
132
|
+
cancellation_state: this.cancellationState,
|
|
133
|
+
shipment_date_gte: this.shipmentDateGte,
|
|
134
|
+
updated_date_gte: this.updatedDateGte,
|
|
135
|
+
created_date_gte: this.createdDateGte,
|
|
136
|
+
created_date_lte: this.createdDateLte,
|
|
137
|
+
shipments_forwarded_to_shop: this.shipmentsForwardedToShop,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
$.export("$summary", `Successfully retrieved ${response.items.length} return${response.items.length === 1
|
|
141
|
+
? ""
|
|
142
|
+
: "s"}`);
|
|
143
|
+
return response;
|
|
144
|
+
},
|
|
145
|
+
};
|
package/common/constants.mjs
CHANGED
|
@@ -6,7 +6,47 @@ const ORDER_BY_OPTIONS = [
|
|
|
6
6
|
"rma_number",
|
|
7
7
|
];
|
|
8
8
|
|
|
9
|
+
const FULFILLMENT_STATE_OPTIONS = [
|
|
10
|
+
"new",
|
|
11
|
+
"created",
|
|
12
|
+
"warehouse_confirmation_pending",
|
|
13
|
+
"accepted_by_connector",
|
|
14
|
+
"accepted_by_warehouse",
|
|
15
|
+
"rejected_by_warehouse",
|
|
16
|
+
"in_fulfillment",
|
|
17
|
+
"partially_shipped",
|
|
18
|
+
"shipped",
|
|
19
|
+
"cancelled",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const FULFILLMENT_STATEGROUP_OPTIONS = [
|
|
23
|
+
"open",
|
|
24
|
+
"canceled",
|
|
25
|
+
"completed",
|
|
26
|
+
"all",
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const STATEGROUP_OPTIONS = [
|
|
30
|
+
"open",
|
|
31
|
+
"closed",
|
|
32
|
+
"requires_attention",
|
|
33
|
+
"all",
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const CANCELLATION_STATE_OPTIONS = [
|
|
37
|
+
"new",
|
|
38
|
+
"rejected",
|
|
39
|
+
"connector_confirmation_pending",
|
|
40
|
+
"accepted_by_connector",
|
|
41
|
+
"warehouse_cancellation_pending",
|
|
42
|
+
"completed",
|
|
43
|
+
];
|
|
44
|
+
|
|
9
45
|
export default {
|
|
10
46
|
LIMIT,
|
|
11
47
|
ORDER_BY_OPTIONS,
|
|
48
|
+
FULFILLMENT_STATE_OPTIONS,
|
|
49
|
+
FULFILLMENT_STATEGROUP_OPTIONS,
|
|
50
|
+
STATEGROUP_OPTIONS,
|
|
51
|
+
CANCELLATION_STATE_OPTIONS,
|
|
12
52
|
};
|
package/everstox.app.mjs
CHANGED
|
@@ -6,6 +6,25 @@ export default {
|
|
|
6
6
|
type: "app",
|
|
7
7
|
app: "everstox",
|
|
8
8
|
propDefinitions: {
|
|
9
|
+
warehouseIds: {
|
|
10
|
+
type: "string[]",
|
|
11
|
+
label: "Warehouse IDs",
|
|
12
|
+
description: "Warehouse IDs",
|
|
13
|
+
async options({ page }) {
|
|
14
|
+
const { items } = await this.listWarehouses({
|
|
15
|
+
params: {
|
|
16
|
+
limit: LIMIT,
|
|
17
|
+
offset: page * LIMIT,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return items?.map(({
|
|
21
|
+
id, name,
|
|
22
|
+
}) => ({
|
|
23
|
+
label: name,
|
|
24
|
+
value: id,
|
|
25
|
+
})) || [];
|
|
26
|
+
},
|
|
27
|
+
},
|
|
9
28
|
orderId: {
|
|
10
29
|
type: "string",
|
|
11
30
|
label: "Order ID",
|
|
@@ -106,5 +125,11 @@ export default {
|
|
|
106
125
|
...opts,
|
|
107
126
|
});
|
|
108
127
|
},
|
|
128
|
+
listWarehouses(opts = {}) {
|
|
129
|
+
return this._makeRequest({
|
|
130
|
+
path: "/warehouses",
|
|
131
|
+
...opts,
|
|
132
|
+
});
|
|
133
|
+
},
|
|
109
134
|
},
|
|
110
135
|
};
|