@pipedream/everstox 0.2.0 → 0.4.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/create-fulfillment-update-request/create-fulfillment-update-request.mjs +90 -0
- 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-products/list-products.mjs +164 -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 +1 -1
- package/common/constants.mjs +13 -0
- package/common/utils.mjs +15 -0
- package/everstox.app.mjs +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import everstox from "../../everstox.app.mjs";
|
|
2
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
3
|
+
import { parseJsonProp } from "../../common/utils.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "everstox-create-fulfillment-update-request",
|
|
7
|
+
name: "Create Fulfillment Update Request",
|
|
8
|
+
description:
|
|
9
|
+
"Creates a new fulfillment update request for a specific fulfillment."
|
|
10
|
+
+ " The fulfillment must be in `in_fulfillment` state."
|
|
11
|
+
+ " Use this to modify items, quantities, prices, addresses, or priority on an active fulfillment."
|
|
12
|
+
+ " `fulfillment_items` must include at least one item with a valid SKU; `price_set` quantities must sum to the item quantity."
|
|
13
|
+
+ " Address fields `first_name`/`last_name` or `company` are conditionally required (at least one set must be present)."
|
|
14
|
+
+ " [See the documentation](https://api.everstox.com/api/v1/ui/#/Fulfillment-updates/district_core.api.shops.fulfillments.fulfillments.Fulfillments.create_fulfillment_update_request)",
|
|
15
|
+
version: "0.0.1",
|
|
16
|
+
type: "action",
|
|
17
|
+
annotations: {
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
openWorldHint: true,
|
|
20
|
+
readOnlyHint: false,
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
everstox,
|
|
24
|
+
fulfillmentId: {
|
|
25
|
+
type: "string",
|
|
26
|
+
label: "Fulfillment ID",
|
|
27
|
+
description: "The UUID of the fulfillment to update, for example 550e8400-e29b-41d4-a716-446655440000. Obtain this from the fulfillment object you want to modify. Must be in in_fulfillment state.",
|
|
28
|
+
},
|
|
29
|
+
fulfillmentItems: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Fulfillment Items",
|
|
32
|
+
description: "JSON array of fulfillment items to update. Must contain at least one item."
|
|
33
|
+
+ " Omit `id` when adding a new item; include it when updating an existing one."
|
|
34
|
+
+ " Each item requires a `product.sku` and a `price_set` with at least one entry."
|
|
35
|
+
+ " Example: `[{\"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"quantity\": 2, \"product\": {\"sku\": \"PROD-001\"}, \"price_set\": [{\"quantity\": 2, \"currency\": \"EUR\", \"price_net_after_discount\": \"19.99\", \"tax_amount\": \"3.80\", \"tax_rate\": \"0.19\"}]}]`",
|
|
36
|
+
optional: true,
|
|
37
|
+
},
|
|
38
|
+
shippingAddress: {
|
|
39
|
+
type: "string",
|
|
40
|
+
label: "Shipping Address",
|
|
41
|
+
description: "JSON object with the complete shipping address."
|
|
42
|
+
+ " Required fields: `country_code` (ISO 2-letter, e.g. `\"DE\"`), `country` (full country name, e.g. `\"Germany\"`), `city`, `zip`, `address_1`,"
|
|
43
|
+
+ " and at least one of `first_name`/`last_name` or `company`."
|
|
44
|
+
+ " Optional: `address_2`, `title`, `phone`, `province_code`, `address_type` (`private` or `business`)."
|
|
45
|
+
+ " Example: `{\"first_name\": \"John\", \"last_name\": \"Doe\", \"country_code\": \"DE\", \"country\": \"Germany\", \"city\": \"Berlin\", \"zip\": \"10115\", \"address_1\": \"Musterstra\\u00dfe 1\", \"address_type\": \"private\"}`",
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
billingAddress: {
|
|
49
|
+
type: "string",
|
|
50
|
+
label: "Billing Address",
|
|
51
|
+
description: "JSON object with the complete billing address."
|
|
52
|
+
+ " Required fields: `country_code` (ISO 2-letter, e.g. `\"DE\"`), `country` (full country name, e.g. `\"Germany\"`), `city`, `zip`, `address_1`,"
|
|
53
|
+
+ " and at least one of `first_name`/`last_name` or `company`."
|
|
54
|
+
+ " Optional: `address_2`, `title`, `phone`, `VAT_number`, `address_type` (`private` or `business`)."
|
|
55
|
+
+ " Example: `{\"first_name\": \"John\", \"last_name\": \"Doe\", \"country_code\": \"DE\", \"country\": \"Germany\", \"city\": \"Berlin\", \"zip\": \"10115\", \"address_1\": \"Musterstra\\u00dfe 1\", \"address_type\": \"private\"}`",
|
|
56
|
+
optional: true,
|
|
57
|
+
},
|
|
58
|
+
fulfillmentPriority: {
|
|
59
|
+
type: "integer",
|
|
60
|
+
label: "Fulfillment Priority",
|
|
61
|
+
description: "Priority level for the fulfillment. Must be between 1 (highest) and 99 (lowest).",
|
|
62
|
+
optional: true,
|
|
63
|
+
min: 1,
|
|
64
|
+
max: 99,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
async run({ $ }) {
|
|
68
|
+
if (!this.fulfillmentItems
|
|
69
|
+
&& !this.shippingAddress
|
|
70
|
+
&& !this.billingAddress
|
|
71
|
+
&& !this.fulfillmentPriority) {
|
|
72
|
+
throw new ConfigurationError("At least one of `fulfillmentItems`, `shippingAddress`, `billingAddress`, or `fulfillmentPriority` must be provided.");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const response = await this.everstox.createFulfillmentUpdateRequest({
|
|
76
|
+
$,
|
|
77
|
+
fulfillmentId: this.fulfillmentId,
|
|
78
|
+
data: {
|
|
79
|
+
fulfillment_items: parseJsonProp(this.fulfillmentItems, "fulfillmentItems"),
|
|
80
|
+
shipping_address: parseJsonProp(this.shippingAddress, "shippingAddress"),
|
|
81
|
+
billing_address: parseJsonProp(this.billingAddress, "billingAddress"),
|
|
82
|
+
fulfillment_priority: this.fulfillmentPriority,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
$.export("$summary", `Successfully created fulfillment update request for fulfillment \`${this.fulfillmentId}\``);
|
|
87
|
+
|
|
88
|
+
return response;
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -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.3",
|
|
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.3",
|
|
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.2",
|
|
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.2",
|
|
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,164 @@
|
|
|
1
|
+
import constants from "../../common/constants.mjs";
|
|
2
|
+
import everstox from "../../everstox.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "everstox-list-products",
|
|
6
|
+
name: "List Products",
|
|
7
|
+
description: "List products in an Everstox shop. Use this to browse or audit the product catalog, check inventory by SKU or name, or filter by warehouse. Results default to 10 per page — use `limit` and `offset` together to paginate through large catalogs. [See the documentation](https://api.everstox.com/api/v1/ui/#/Product/district_core.api.shops.products.products.Products.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
|
+
search: {
|
|
18
|
+
type: "string",
|
|
19
|
+
label: "Search",
|
|
20
|
+
description: "Search for name or SKU",
|
|
21
|
+
optional: true,
|
|
22
|
+
},
|
|
23
|
+
sku: {
|
|
24
|
+
type: "string[]",
|
|
25
|
+
label: "SKUs",
|
|
26
|
+
description: "Filter products by SKU. If the number of SKUs exceeds 10, `exact_search` is enforced",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
name: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Name",
|
|
32
|
+
description: "Filter products by name",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
gtin: {
|
|
36
|
+
type: "string",
|
|
37
|
+
label: "GTIN",
|
|
38
|
+
description: "Filter products by GTIN — returns products with at least one unit whose GTIN contains this value",
|
|
39
|
+
optional: true,
|
|
40
|
+
},
|
|
41
|
+
customAttributeKey: {
|
|
42
|
+
type: "string",
|
|
43
|
+
label: "Custom Attribute Key",
|
|
44
|
+
description: "Filter products by custom attribute key — returns products with at least one custom attribute whose key contains this value",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
customAttributeValue: {
|
|
48
|
+
type: "string",
|
|
49
|
+
label: "Custom Attribute Value",
|
|
50
|
+
description: "Filter products by custom attribute value — returns products with at least one custom attribute whose value contains this value",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
status: {
|
|
54
|
+
type: "string",
|
|
55
|
+
label: "Status",
|
|
56
|
+
description: "Filter products by status (default `all`)",
|
|
57
|
+
options: constants.STATUS_OPTIONS,
|
|
58
|
+
optional: true,
|
|
59
|
+
},
|
|
60
|
+
bundleProduct: {
|
|
61
|
+
type: "boolean",
|
|
62
|
+
label: "Bundle Product",
|
|
63
|
+
description: "Filter for bundle products",
|
|
64
|
+
optional: true,
|
|
65
|
+
},
|
|
66
|
+
exactSearch: {
|
|
67
|
+
type: "boolean",
|
|
68
|
+
label: "Exact Search",
|
|
69
|
+
description: "If true, searches for exact SKU and name matches (default `true`)",
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
stockRunwayLte: {
|
|
73
|
+
type: "integer",
|
|
74
|
+
label: "Stock Runway Less Than or Equal To",
|
|
75
|
+
description: "Filter for stocks with runway lower than or equal to the number of days provided",
|
|
76
|
+
optional: true,
|
|
77
|
+
},
|
|
78
|
+
stockRunwayLt: {
|
|
79
|
+
type: "integer",
|
|
80
|
+
label: "Stock Runway Less Than",
|
|
81
|
+
description: "Filter for stocks with runway lower than the number of days provided",
|
|
82
|
+
optional: true,
|
|
83
|
+
},
|
|
84
|
+
stockRunwayGte: {
|
|
85
|
+
type: "integer",
|
|
86
|
+
label: "Stock Runway Greater Than or Equal To",
|
|
87
|
+
description: "Filter for stocks with runway greater than or equal to the number of days provided",
|
|
88
|
+
optional: true,
|
|
89
|
+
},
|
|
90
|
+
warehouseIds: {
|
|
91
|
+
propDefinition: [
|
|
92
|
+
everstox,
|
|
93
|
+
"warehouseIds",
|
|
94
|
+
],
|
|
95
|
+
optional: true,
|
|
96
|
+
},
|
|
97
|
+
orderBy: {
|
|
98
|
+
type: "string",
|
|
99
|
+
label: "Order By",
|
|
100
|
+
description: "Fields to order the result set by",
|
|
101
|
+
optional: true,
|
|
102
|
+
},
|
|
103
|
+
fields: {
|
|
104
|
+
type: "string",
|
|
105
|
+
label: "Fields",
|
|
106
|
+
description: "Fields to include in the response",
|
|
107
|
+
optional: true,
|
|
108
|
+
},
|
|
109
|
+
fieldSet: {
|
|
110
|
+
type: "string",
|
|
111
|
+
label: "Field Set",
|
|
112
|
+
description: "`full` includes all sub-entities (default); `minimal` returns essential fields optimized for performance",
|
|
113
|
+
options: constants.FIELD_SET_OPTIONS,
|
|
114
|
+
optional: true,
|
|
115
|
+
},
|
|
116
|
+
limit: {
|
|
117
|
+
type: "integer",
|
|
118
|
+
label: "Limit",
|
|
119
|
+
description: "The number of products to return (default 10)",
|
|
120
|
+
min: 1,
|
|
121
|
+
default: 10,
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
offset: {
|
|
125
|
+
type: "integer",
|
|
126
|
+
label: "Offset",
|
|
127
|
+
description: "The number of products to skip before starting to collect the result set",
|
|
128
|
+
min: 0,
|
|
129
|
+
optional: true,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
async run({ $ }) {
|
|
133
|
+
const response = await this.everstox.listProducts({
|
|
134
|
+
$,
|
|
135
|
+
params: {
|
|
136
|
+
search: this.search,
|
|
137
|
+
sku: this.sku,
|
|
138
|
+
name: this.name,
|
|
139
|
+
gtin: this.gtin,
|
|
140
|
+
custom_attribute_key: this.customAttributeKey,
|
|
141
|
+
custom_attribute_value: this.customAttributeValue,
|
|
142
|
+
status: this.status,
|
|
143
|
+
bundle_product: this.bundleProduct,
|
|
144
|
+
exact_search: this.exactSearch,
|
|
145
|
+
stock_runway_lte: this.stockRunwayLte,
|
|
146
|
+
stock_runway_lt: this.stockRunwayLt,
|
|
147
|
+
stock_runway_gte: this.stockRunwayGte,
|
|
148
|
+
warehouse_ids: this.warehouseIds,
|
|
149
|
+
order_by: this.orderBy,
|
|
150
|
+
fields: this.fields,
|
|
151
|
+
field_set: this.fieldSet,
|
|
152
|
+
limit: this.limit,
|
|
153
|
+
offset: this.offset,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const count = response.items?.length ?? 0;
|
|
158
|
+
$.export("$summary", `Successfully retrieved ${count} product${count === 1
|
|
159
|
+
? ""
|
|
160
|
+
: "s"}`);
|
|
161
|
+
|
|
162
|
+
return response;
|
|
163
|
+
},
|
|
164
|
+
};
|
|
@@ -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.2",
|
|
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.3",
|
|
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.2",
|
|
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
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "everstox-search-orders",
|
|
6
6
|
name: "Search Orders by Order Number",
|
|
7
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.
|
|
8
|
+
version: "0.0.2",
|
|
9
9
|
type: "action",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
package/common/constants.mjs
CHANGED
|
@@ -42,6 +42,17 @@ const CANCELLATION_STATE_OPTIONS = [
|
|
|
42
42
|
"completed",
|
|
43
43
|
];
|
|
44
44
|
|
|
45
|
+
const STATUS_OPTIONS = [
|
|
46
|
+
"all",
|
|
47
|
+
"active",
|
|
48
|
+
"inactive",
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const FIELD_SET_OPTIONS = [
|
|
52
|
+
"full",
|
|
53
|
+
"minimal",
|
|
54
|
+
];
|
|
55
|
+
|
|
45
56
|
export default {
|
|
46
57
|
LIMIT,
|
|
47
58
|
ORDER_BY_OPTIONS,
|
|
@@ -49,4 +60,6 @@ export default {
|
|
|
49
60
|
FULFILLMENT_STATEGROUP_OPTIONS,
|
|
50
61
|
STATEGROUP_OPTIONS,
|
|
51
62
|
CANCELLATION_STATE_OPTIONS,
|
|
63
|
+
STATUS_OPTIONS,
|
|
64
|
+
FIELD_SET_OPTIONS,
|
|
52
65
|
};
|
package/common/utils.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
+
|
|
3
|
+
export const parseJsonProp = (json, propName) => {
|
|
4
|
+
if (!json) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
if (typeof json === "string") {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(json);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
throw new ConfigurationError(`Invalid JSON string for property ${propName}: ${json}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return json;
|
|
15
|
+
};
|
package/everstox.app.mjs
CHANGED
|
@@ -94,6 +94,12 @@ export default {
|
|
|
94
94
|
headers: {
|
|
95
95
|
"everstox-shop-api-token": `${this.$auth.api_token}`,
|
|
96
96
|
},
|
|
97
|
+
// Everstox's API rejects `key[]=value` bracket notation (returns HTTP
|
|
98
|
+
// 500 for `sku`, 400 for `fields`). Serialize array-valued params as
|
|
99
|
+
// repeated `key=value` pairs instead of the axios default.
|
|
100
|
+
paramsSerializer: {
|
|
101
|
+
indexes: null,
|
|
102
|
+
},
|
|
97
103
|
...opts,
|
|
98
104
|
});
|
|
99
105
|
},
|
|
@@ -131,5 +137,20 @@ export default {
|
|
|
131
137
|
...opts,
|
|
132
138
|
});
|
|
133
139
|
},
|
|
140
|
+
createFulfillmentUpdateRequest({
|
|
141
|
+
fulfillmentId, ...opts
|
|
142
|
+
}) {
|
|
143
|
+
return this._makeRequest({
|
|
144
|
+
method: "POST",
|
|
145
|
+
path: `/fulfillment/${fulfillmentId}/update-requests`,
|
|
146
|
+
...opts,
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
listProducts(opts = {}) {
|
|
150
|
+
return this._makeRequest({
|
|
151
|
+
path: "/products",
|
|
152
|
+
...opts,
|
|
153
|
+
});
|
|
154
|
+
},
|
|
134
155
|
},
|
|
135
156
|
};
|