n8n-nodes-shopify-custom 2.0.34 → 2.0.36
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/README.md +5 -0
- package/dist/nodes/ShopifyCustom/config/operations/order.js +232 -2
- package/dist/nodes/ShopifyCustom/config/operations/order.js.map +1 -1
- package/dist/nodes/ShopifyCustom/shared/graphql/registry.js +70 -11
- package/dist/nodes/ShopifyCustom/shared/graphql/registry.js.map +1 -1
- package/dist/nodes/ShopifyCustom/shared/graphql/templates/order.d.ts +2 -2
- package/dist/nodes/ShopifyCustom/shared/graphql/templates/order.js +415 -16
- package/dist/nodes/ShopifyCustom/shared/graphql/templates/order.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,7 @@ Most resources support:
|
|
|
103
103
|
- **Orders:**
|
|
104
104
|
- **Get / Get Many:**
|
|
105
105
|
- Allows you to get one order or a list of orders
|
|
106
|
+
- Returns detailed order data, including totals, addresses, customer, line items, shipping lines, discounts, fulfillments, transactions, refunds, returns, and risk assessment
|
|
106
107
|
- Supports optional metafields loading with values
|
|
107
108
|
- **Create / Update:**
|
|
108
109
|
- **Fields supported:**
|
|
@@ -232,6 +233,10 @@ To use the node, create a Shopify **Custom App**:
|
|
|
232
233
|
* read_customers, write_customers
|
|
233
234
|
* read_orders, write_orders
|
|
234
235
|
* read_draft_orders, write_draft_orders
|
|
236
|
+
* read_returns
|
|
237
|
+
* read_assigned_fulfillment_orders, read_merchant_managed_fulfillment_orders, read_third_party_fulfillment_orders
|
|
238
|
+
* read_locations
|
|
239
|
+
* read_inventory
|
|
235
240
|
* read_metaobjects, write_metaobjects
|
|
236
241
|
* read_metaobject_definitions, write_metaobject_definitions
|
|
237
242
|
* read_translations, write_translations
|
|
@@ -64,6 +64,232 @@ function orderBaseFields() {
|
|
|
64
64
|
common_1.TAGS_FIELD,
|
|
65
65
|
];
|
|
66
66
|
}
|
|
67
|
+
function orderReadOptionFields() {
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Order Details',
|
|
71
|
+
name: 'orderReadOptions',
|
|
72
|
+
type: 'collection',
|
|
73
|
+
placeholder: 'Add detail option',
|
|
74
|
+
default: {},
|
|
75
|
+
options: [
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Discount Applications Limit',
|
|
78
|
+
name: 'discountApplicationsLimit',
|
|
79
|
+
type: 'number',
|
|
80
|
+
default: 50,
|
|
81
|
+
typeOptions: {
|
|
82
|
+
minValue: 1,
|
|
83
|
+
maxValue: 250,
|
|
84
|
+
},
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
includeDiscountApplications: [true],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
displayName: 'Fulfillment Line Items Limit',
|
|
93
|
+
name: 'fulfillmentLineItemsLimit',
|
|
94
|
+
type: 'number',
|
|
95
|
+
default: 50,
|
|
96
|
+
typeOptions: {
|
|
97
|
+
minValue: 1,
|
|
98
|
+
maxValue: 250,
|
|
99
|
+
},
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
includeFulfillments: [true],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Fulfillments Limit',
|
|
108
|
+
name: 'fulfillmentsLimit',
|
|
109
|
+
type: 'number',
|
|
110
|
+
default: 25,
|
|
111
|
+
typeOptions: {
|
|
112
|
+
minValue: 1,
|
|
113
|
+
maxValue: 250,
|
|
114
|
+
},
|
|
115
|
+
displayOptions: {
|
|
116
|
+
show: {
|
|
117
|
+
includeFulfillments: [true],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
displayName: 'Include Customer',
|
|
123
|
+
name: 'includeCustomer',
|
|
124
|
+
type: 'boolean',
|
|
125
|
+
default: true,
|
|
126
|
+
description: 'Whether to include the related customer object',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Include Discount Applications',
|
|
130
|
+
name: 'includeDiscountApplications',
|
|
131
|
+
type: 'boolean',
|
|
132
|
+
default: true,
|
|
133
|
+
description: 'Whether to include order-level discount applications',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
displayName: 'Include Fulfillments',
|
|
137
|
+
name: 'includeFulfillments',
|
|
138
|
+
type: 'boolean',
|
|
139
|
+
default: true,
|
|
140
|
+
description: 'Whether to include fulfillments, tracking, fulfillment service, and location details',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
displayName: 'Include Line Items',
|
|
144
|
+
name: 'includeLineItems',
|
|
145
|
+
type: 'boolean',
|
|
146
|
+
default: true,
|
|
147
|
+
description: 'Whether to include order line items with pricing, tax, product, and variant details',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Include Refunds',
|
|
151
|
+
name: 'includeRefunds',
|
|
152
|
+
type: 'boolean',
|
|
153
|
+
default: true,
|
|
154
|
+
description: 'Whether to include refunds and refund line items',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
displayName: 'Include Returns',
|
|
158
|
+
name: 'includeReturns',
|
|
159
|
+
type: 'boolean',
|
|
160
|
+
default: true,
|
|
161
|
+
description: 'Whether to include returns and return line items',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
displayName: 'Include Risk Assessment',
|
|
165
|
+
name: 'includeRisk',
|
|
166
|
+
type: 'boolean',
|
|
167
|
+
default: true,
|
|
168
|
+
description: 'Whether to include Shopify order risk assessment data',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
displayName: 'Include Shipping Lines',
|
|
172
|
+
name: 'includeShippingLines',
|
|
173
|
+
type: 'boolean',
|
|
174
|
+
default: true,
|
|
175
|
+
description: 'Whether to include shipping lines and their taxes',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
displayName: 'Include Transactions',
|
|
179
|
+
name: 'includeTransactions',
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
default: true,
|
|
182
|
+
description: 'Whether to include order transactions',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
displayName: 'Line Items Limit',
|
|
186
|
+
name: 'lineItemsLimit',
|
|
187
|
+
type: 'number',
|
|
188
|
+
default: 100,
|
|
189
|
+
typeOptions: {
|
|
190
|
+
minValue: 1,
|
|
191
|
+
maxValue: 250,
|
|
192
|
+
},
|
|
193
|
+
displayOptions: {
|
|
194
|
+
show: {
|
|
195
|
+
includeLineItems: [true],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'Refund Line Items Limit',
|
|
201
|
+
name: 'refundLineItemsLimit',
|
|
202
|
+
type: 'number',
|
|
203
|
+
default: 50,
|
|
204
|
+
typeOptions: {
|
|
205
|
+
minValue: 1,
|
|
206
|
+
maxValue: 250,
|
|
207
|
+
},
|
|
208
|
+
displayOptions: {
|
|
209
|
+
show: {
|
|
210
|
+
includeRefunds: [true],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
displayName: 'Refunds Limit',
|
|
216
|
+
name: 'refundsLimit',
|
|
217
|
+
type: 'number',
|
|
218
|
+
default: 50,
|
|
219
|
+
typeOptions: {
|
|
220
|
+
minValue: 1,
|
|
221
|
+
maxValue: 250,
|
|
222
|
+
},
|
|
223
|
+
displayOptions: {
|
|
224
|
+
show: {
|
|
225
|
+
includeRefunds: [true],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
displayName: 'Return Line Items Limit',
|
|
231
|
+
name: 'returnLineItemsLimit',
|
|
232
|
+
type: 'number',
|
|
233
|
+
default: 50,
|
|
234
|
+
typeOptions: {
|
|
235
|
+
minValue: 1,
|
|
236
|
+
maxValue: 250,
|
|
237
|
+
},
|
|
238
|
+
displayOptions: {
|
|
239
|
+
show: {
|
|
240
|
+
includeReturns: [true],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
displayName: 'Returns Limit',
|
|
246
|
+
name: 'returnsLimit',
|
|
247
|
+
type: 'number',
|
|
248
|
+
default: 50,
|
|
249
|
+
typeOptions: {
|
|
250
|
+
minValue: 1,
|
|
251
|
+
maxValue: 250,
|
|
252
|
+
},
|
|
253
|
+
displayOptions: {
|
|
254
|
+
show: {
|
|
255
|
+
includeReturns: [true],
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
displayName: 'Shipping Lines Limit',
|
|
261
|
+
name: 'shippingLinesLimit',
|
|
262
|
+
type: 'number',
|
|
263
|
+
default: 50,
|
|
264
|
+
typeOptions: {
|
|
265
|
+
minValue: 1,
|
|
266
|
+
maxValue: 250,
|
|
267
|
+
},
|
|
268
|
+
displayOptions: {
|
|
269
|
+
show: {
|
|
270
|
+
includeShippingLines: [true],
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Transactions Limit',
|
|
276
|
+
name: 'transactionsLimit',
|
|
277
|
+
type: 'number',
|
|
278
|
+
default: 50,
|
|
279
|
+
typeOptions: {
|
|
280
|
+
minValue: 1,
|
|
281
|
+
maxValue: 250,
|
|
282
|
+
},
|
|
283
|
+
displayOptions: {
|
|
284
|
+
show: {
|
|
285
|
+
includeTransactions: [true],
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
];
|
|
292
|
+
}
|
|
67
293
|
exports.ORDER_OPERATION_CONFIGS = [
|
|
68
294
|
{
|
|
69
295
|
resource: 'order',
|
|
@@ -80,7 +306,11 @@ exports.ORDER_OPERATION_CONFIGS = [
|
|
|
80
306
|
name: 'Get',
|
|
81
307
|
description: 'Get an order by ID',
|
|
82
308
|
registryKey: 'order.get',
|
|
83
|
-
fields: [
|
|
309
|
+
fields: [
|
|
310
|
+
(0, common_1.gidField)('orderId', 'Order ID', 'Global order ID in Shopify'),
|
|
311
|
+
...(0, common_1.readMetafieldsFields)(),
|
|
312
|
+
...orderReadOptionFields(),
|
|
313
|
+
],
|
|
84
314
|
},
|
|
85
315
|
{
|
|
86
316
|
resource: 'order',
|
|
@@ -88,7 +318,7 @@ exports.ORDER_OPERATION_CONFIGS = [
|
|
|
88
318
|
name: 'Get Many',
|
|
89
319
|
description: 'Get many orders',
|
|
90
320
|
registryKey: 'order.getMany',
|
|
91
|
-
fields: (0, common_1.paginationFields)(ORDER_SORT_OPTIONS),
|
|
321
|
+
fields: [...(0, common_1.paginationFields)(ORDER_SORT_OPTIONS), ...orderReadOptionFields()],
|
|
92
322
|
},
|
|
93
323
|
{
|
|
94
324
|
resource: 'order',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../../../../nodes/ShopifyCustom/config/operations/order.ts"],"names":[],"mappings":";;;AACA,qCAAwF;AAGxF,MAAM,kBAAkB,GAAG;IAC1B,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC3C,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC3C,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;CAC/C,CAAC;AAEF,MAAM,cAAc,GAAoB;IACvC,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;QACZ,cAAc,EAAE,IAAI;KACpB;IACD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE;QACR;YACC,IAAI,EAAE,OAA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QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,CAAC,GAAG,IAAA,yBAAgB,EAAC,kBAAkB,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;KAC7E;IACD;QACC,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,CAAC,IAAA,iBAAQ,EAAC,SAAS,EAAE,UAAU,EAAE,4BAA4B,CAAC,EAAE,GAAG,eAAe,EAAE,CAAC;QAC7F,kBAAkB,EAAE,IAAI;KACxB;IACD;QACC,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,CAAC,IAAA,iBAAQ,EAAC,SAAS,EAAE,UAAU,EAAE,4BAA4B,CAAC,CAAC;KACvE;CACD,CAAC"}
|
|
@@ -169,6 +169,36 @@ function getMetafieldReadVariables(parameters) {
|
|
|
169
169
|
metafieldReferencesFirst: 50,
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
+
function clampConnectionLimit(value, fallback) {
|
|
173
|
+
var _a;
|
|
174
|
+
const parsed = (_a = asNumber(value)) !== null && _a !== void 0 ? _a : fallback;
|
|
175
|
+
return Math.min(250, Math.max(1, Math.trunc(parsed)));
|
|
176
|
+
}
|
|
177
|
+
function getOrderReadVariables(parameters) {
|
|
178
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
179
|
+
const options = isObject(parameters.orderReadOptions) ? parameters.orderReadOptions : {};
|
|
180
|
+
return {
|
|
181
|
+
includeCustomer: (_a = asBoolean(options.includeCustomer)) !== null && _a !== void 0 ? _a : true,
|
|
182
|
+
includeLineItems: (_b = asBoolean(options.includeLineItems)) !== null && _b !== void 0 ? _b : true,
|
|
183
|
+
lineItemsFirst: clampConnectionLimit(options.lineItemsLimit, 100),
|
|
184
|
+
includeShippingLines: (_c = asBoolean(options.includeShippingLines)) !== null && _c !== void 0 ? _c : true,
|
|
185
|
+
shippingLinesFirst: clampConnectionLimit(options.shippingLinesLimit, 50),
|
|
186
|
+
includeDiscountApplications: (_d = asBoolean(options.includeDiscountApplications)) !== null && _d !== void 0 ? _d : true,
|
|
187
|
+
discountApplicationsFirst: clampConnectionLimit(options.discountApplicationsLimit, 50),
|
|
188
|
+
includeFulfillments: (_e = asBoolean(options.includeFulfillments)) !== null && _e !== void 0 ? _e : true,
|
|
189
|
+
fulfillmentsFirst: clampConnectionLimit(options.fulfillmentsLimit, 25),
|
|
190
|
+
fulfillmentLineItemsFirst: clampConnectionLimit(options.fulfillmentLineItemsLimit, 50),
|
|
191
|
+
includeTransactions: (_f = asBoolean(options.includeTransactions)) !== null && _f !== void 0 ? _f : true,
|
|
192
|
+
transactionsFirst: clampConnectionLimit(options.transactionsLimit, 50),
|
|
193
|
+
includeRefunds: (_g = asBoolean(options.includeRefunds)) !== null && _g !== void 0 ? _g : true,
|
|
194
|
+
refundsFirst: clampConnectionLimit(options.refundsLimit, 50),
|
|
195
|
+
refundLineItemsFirst: clampConnectionLimit(options.refundLineItemsLimit, 50),
|
|
196
|
+
includeReturns: (_h = asBoolean(options.includeReturns)) !== null && _h !== void 0 ? _h : true,
|
|
197
|
+
returnsFirst: clampConnectionLimit(options.returnsLimit, 50),
|
|
198
|
+
returnLineItemsFirst: clampConnectionLimit(options.returnLineItemsLimit, 50),
|
|
199
|
+
includeRisk: (_j = asBoolean(options.includeRisk)) !== null && _j !== void 0 ? _j : true,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
172
202
|
function getPathValue(source, path) {
|
|
173
203
|
let current = source;
|
|
174
204
|
for (const chunk of path) {
|
|
@@ -246,20 +276,47 @@ function normalizeMetafieldArray(value) {
|
|
|
246
276
|
}
|
|
247
277
|
return value.filter(isObject).map(normalizeMetafieldNode);
|
|
248
278
|
}
|
|
279
|
+
function isNodesConnection(value) {
|
|
280
|
+
return isObject(value) && Array.isArray(value.nodes);
|
|
281
|
+
}
|
|
282
|
+
function normalizeNestedValue(value) {
|
|
283
|
+
if (Array.isArray(value)) {
|
|
284
|
+
return value.map((item) => (isObject(item) ? normalizeNode(item) : item));
|
|
285
|
+
}
|
|
286
|
+
if (isNodesConnection(value)) {
|
|
287
|
+
return value.nodes.map((item) => (isObject(item) ? normalizeNode(item) : item));
|
|
288
|
+
}
|
|
289
|
+
if (isObject(value)) {
|
|
290
|
+
return normalizeNode(value);
|
|
291
|
+
}
|
|
292
|
+
return value;
|
|
293
|
+
}
|
|
249
294
|
function normalizeNode(node) {
|
|
250
295
|
const normalized = { ...node };
|
|
251
296
|
let changed = false;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
297
|
+
for (const [key, value] of Object.entries(node)) {
|
|
298
|
+
if (key === 'metafield' && isObject(value)) {
|
|
299
|
+
normalized[key] = normalizeMetafieldNode(value);
|
|
300
|
+
changed = true;
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (key === 'metafields') {
|
|
304
|
+
if (isNodesConnection(value)) {
|
|
305
|
+
normalized[key] = normalizeMetafieldArray(value.nodes);
|
|
306
|
+
changed = true;
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (Array.isArray(value)) {
|
|
310
|
+
normalized[key] = normalizeMetafieldArray(value);
|
|
311
|
+
changed = true;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const nestedValue = normalizeNestedValue(value);
|
|
316
|
+
if (nestedValue !== value) {
|
|
317
|
+
normalized[key] = nestedValue;
|
|
318
|
+
changed = true;
|
|
319
|
+
}
|
|
263
320
|
}
|
|
264
321
|
return changed ? normalized : node;
|
|
265
322
|
}
|
|
@@ -1212,6 +1269,7 @@ const operationRegistry = {
|
|
|
1212
1269
|
buildVariables: (parameters) => ({
|
|
1213
1270
|
id: asString(parameters.orderId),
|
|
1214
1271
|
...getMetafieldReadVariables(parameters),
|
|
1272
|
+
...getOrderReadVariables(parameters),
|
|
1215
1273
|
}),
|
|
1216
1274
|
mapSimplified: (data) => mapSingleNode(data, ['order']),
|
|
1217
1275
|
},
|
|
@@ -1220,6 +1278,7 @@ const operationRegistry = {
|
|
|
1220
1278
|
buildVariables: (parameters) => ({
|
|
1221
1279
|
...getConnectionVariables(parameters),
|
|
1222
1280
|
...getMetafieldReadVariables(parameters),
|
|
1281
|
+
...getOrderReadVariables(parameters),
|
|
1223
1282
|
}),
|
|
1224
1283
|
mapSimplified: (data) => mapNodesFromConnection(data, ['orders']),
|
|
1225
1284
|
pagination: {
|