@deenruv/order-line-attributes-plugin 1.0.17-dev.20 → 1.0.17-dev.23
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/dist/plugin-server/zeus/const.js +760 -742
- package/dist/plugin-server/zeus/index.d.ts +5606 -4290
- package/dist/plugin-server/zeus/index.js +129 -96
- package/dist/plugin-server/zeus/typedDocumentNode.d.ts +3 -1
- package/dist/plugin-server/zeus/typedDocumentNode.js +14 -29
- package/dist/plugin-ui/graphql/queries.d.ts +3 -1
- package/dist/plugin-ui/graphql/selectors.d.ts +6 -5
- package/dist/plugin-ui/zeus/const.js +760 -742
- package/dist/plugin-ui/zeus/index.d.ts +5606 -4290
- package/dist/plugin-ui/zeus/index.js +129 -96
- package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +2 -2
- package/dist/plugin-ui/zeus/typedDocumentNode.js +2 -2
- package/package.json +6 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { AllTypesProps, ReturnTypes, Ops } from
|
|
2
|
+
import { AllTypesProps, ReturnTypes, Ops } from "./const";
|
|
3
3
|
export const HOST = "http://localhost:6100/admin-api";
|
|
4
4
|
export const HEADERS = {};
|
|
5
5
|
export const apiSubscription = (options) => (query) => {
|
|
6
6
|
try {
|
|
7
|
-
const queryString = options[0] +
|
|
8
|
-
const wsString = queryString.replace(
|
|
7
|
+
const queryString = options[0] + "?query=" + encodeURIComponent(query);
|
|
8
|
+
const wsString = queryString.replace("http", "ws");
|
|
9
9
|
const host = (options.length > 1 && options[1]?.websocket?.[0]) || wsString;
|
|
10
10
|
const webSocketOptions = options[1]?.websocket || [host];
|
|
11
11
|
const ws = new WebSocket(...webSocketOptions);
|
|
@@ -32,7 +32,7 @@ export const apiSubscription = (options) => (query) => {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
catch {
|
|
35
|
-
throw new Error(
|
|
35
|
+
throw new Error("No websockets implemented");
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const handleFetchResponse = (response) => {
|
|
@@ -55,7 +55,7 @@ const handleFetchResponse = (response) => {
|
|
|
55
55
|
};
|
|
56
56
|
export const apiFetch = (options) => (query, variables = {}) => {
|
|
57
57
|
const fetchOptions = options[1] || {};
|
|
58
|
-
if (fetchOptions.method && fetchOptions.method ===
|
|
58
|
+
if (fetchOptions.method && fetchOptions.method === "GET") {
|
|
59
59
|
return fetch(`${options[0]}?query=${encodeURIComponent(query)}`, fetchOptions)
|
|
60
60
|
.then(handleFetchResponse)
|
|
61
61
|
.then((response) => {
|
|
@@ -67,9 +67,9 @@ export const apiFetch = (options) => (query, variables = {}) => {
|
|
|
67
67
|
}
|
|
68
68
|
return fetch(`${options[0]}`, {
|
|
69
69
|
body: JSON.stringify({ query, variables }),
|
|
70
|
-
method:
|
|
70
|
+
method: "POST",
|
|
71
71
|
headers: {
|
|
72
|
-
|
|
72
|
+
"Content-Type": "application/json",
|
|
73
73
|
},
|
|
74
74
|
...fetchOptions,
|
|
75
75
|
})
|
|
@@ -82,16 +82,16 @@ export const apiFetch = (options) => (query, variables = {}) => {
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
export const InternalsBuildQuery = ({ ops, props, returns, options, scalars, }) => {
|
|
85
|
-
const ibb = (k, o, p =
|
|
85
|
+
const ibb = (k, o, p = "", root = true, vars = []) => {
|
|
86
86
|
const keyForPath = purifyGraphQLKey(k);
|
|
87
87
|
const newPath = [p, keyForPath].join(SEPARATOR);
|
|
88
88
|
if (!o) {
|
|
89
|
-
return
|
|
89
|
+
return "";
|
|
90
90
|
}
|
|
91
|
-
if (typeof o ===
|
|
91
|
+
if (typeof o === "boolean" || typeof o === "number") {
|
|
92
92
|
return k;
|
|
93
93
|
}
|
|
94
|
-
if (typeof o ===
|
|
94
|
+
if (typeof o === "string") {
|
|
95
95
|
return `${k} ${o}`;
|
|
96
96
|
}
|
|
97
97
|
if (Array.isArray(o)) {
|
|
@@ -104,29 +104,32 @@ export const InternalsBuildQuery = ({ ops, props, returns, options, scalars, })
|
|
|
104
104
|
})(o[0], newPath);
|
|
105
105
|
return `${ibb(args ? `${k}(${args})` : k, o[1], p, false, vars)}`;
|
|
106
106
|
}
|
|
107
|
-
if (k ===
|
|
107
|
+
if (k === "__alias") {
|
|
108
108
|
return Object.entries(o)
|
|
109
109
|
.map(([alias, objectUnderAlias]) => {
|
|
110
|
-
if (typeof objectUnderAlias !==
|
|
111
|
-
|
|
110
|
+
if (typeof objectUnderAlias !== "object" ||
|
|
111
|
+
Array.isArray(objectUnderAlias)) {
|
|
112
|
+
throw new Error("Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}");
|
|
112
113
|
}
|
|
113
114
|
const operationName = Object.keys(objectUnderAlias)[0];
|
|
114
115
|
const operation = objectUnderAlias[operationName];
|
|
115
116
|
return ibb(`${alias}:${operationName}`, operation, p, false, vars);
|
|
116
117
|
})
|
|
117
|
-
.join(
|
|
118
|
+
.join("\n");
|
|
118
119
|
}
|
|
119
|
-
const hasOperationName = root && options?.operationName ?
|
|
120
|
-
const keyForDirectives = o.__directives ??
|
|
120
|
+
const hasOperationName = root && options?.operationName ? " " + options.operationName : "";
|
|
121
|
+
const keyForDirectives = o.__directives ?? "";
|
|
121
122
|
const query = `{${Object.entries(o)
|
|
122
|
-
.filter(([k]) => k !==
|
|
123
|
+
.filter(([k]) => k !== "__directives")
|
|
123
124
|
.map((e) => ibb(...e, [p, `field<>${keyForPath}`].join(SEPARATOR), false, vars))
|
|
124
|
-
.join(
|
|
125
|
+
.join("\n")}}`;
|
|
125
126
|
if (!root) {
|
|
126
127
|
return `${k} ${keyForDirectives}${hasOperationName} ${query}`;
|
|
127
128
|
}
|
|
128
|
-
const varsString = vars
|
|
129
|
-
|
|
129
|
+
const varsString = vars
|
|
130
|
+
.map((v) => `${v.name}: ${v.graphQLType}`)
|
|
131
|
+
.join(", ");
|
|
132
|
+
return `${k} ${keyForDirectives}${hasOperationName}${varsString ? `(${varsString})` : ""} ${query}`;
|
|
130
133
|
};
|
|
131
134
|
return ibb;
|
|
132
135
|
};
|
|
@@ -193,19 +196,33 @@ export const Selector = (key) => key && ZeusSelect();
|
|
|
193
196
|
export const TypeFromSelector = (key) => key && ZeusSelect();
|
|
194
197
|
export const Gql = Chain(HOST, {
|
|
195
198
|
headers: {
|
|
196
|
-
|
|
199
|
+
"Content-Type": "application/json",
|
|
197
200
|
...HEADERS,
|
|
198
201
|
},
|
|
199
202
|
});
|
|
200
203
|
export const ZeusScalars = ZeusSelect();
|
|
201
204
|
export const fields = (k) => {
|
|
202
205
|
const t = ReturnTypes[k];
|
|
206
|
+
const fnType = k in AllTypesProps
|
|
207
|
+
? AllTypesProps[k]
|
|
208
|
+
: undefined;
|
|
209
|
+
const hasFnTypes = typeof fnType === "object" ? fnType : undefined;
|
|
203
210
|
const o = Object.fromEntries(Object.entries(t)
|
|
204
|
-
.filter(([, value]) => {
|
|
211
|
+
.filter(([k, value]) => {
|
|
212
|
+
const isFunctionType = hasFnTypes &&
|
|
213
|
+
k in hasFnTypes &&
|
|
214
|
+
!!hasFnTypes[k];
|
|
215
|
+
if (isFunctionType)
|
|
216
|
+
return false;
|
|
205
217
|
const isReturnType = ReturnTypes[value];
|
|
206
|
-
if (!isReturnType
|
|
218
|
+
if (!isReturnType)
|
|
219
|
+
return true;
|
|
220
|
+
if (typeof isReturnType !== "string")
|
|
221
|
+
return false;
|
|
222
|
+
if (isReturnType.startsWith("scalar.")) {
|
|
207
223
|
return true;
|
|
208
224
|
}
|
|
225
|
+
return false;
|
|
209
226
|
})
|
|
210
227
|
.map(([key]) => [key, true]));
|
|
211
228
|
return o;
|
|
@@ -236,12 +253,15 @@ export const traverseResponse = ({ resolvers, scalarPaths, }) => {
|
|
|
236
253
|
const scalarPathString = p.join(SEPARATOR);
|
|
237
254
|
const currentScalarString = scalarPaths[scalarPathString];
|
|
238
255
|
if (currentScalarString) {
|
|
239
|
-
const currentDecoder = resolvers[currentScalarString.split(
|
|
256
|
+
const currentDecoder = resolvers[currentScalarString.split(".")[1]]?.decode;
|
|
240
257
|
if (currentDecoder) {
|
|
241
258
|
return currentDecoder(o);
|
|
242
259
|
}
|
|
243
260
|
}
|
|
244
|
-
if (typeof o ===
|
|
261
|
+
if (typeof o === "boolean" ||
|
|
262
|
+
typeof o === "number" ||
|
|
263
|
+
typeof o === "string" ||
|
|
264
|
+
!o) {
|
|
245
265
|
return o;
|
|
246
266
|
}
|
|
247
267
|
const entries = Object.entries(o).map(([k, v]) => [k, ibb(k, v, [...p, purifyGraphQLKey(k)])]);
|
|
@@ -253,15 +273,15 @@ export const traverseResponse = ({ resolvers, scalarPaths, }) => {
|
|
|
253
273
|
};
|
|
254
274
|
return ibb;
|
|
255
275
|
};
|
|
256
|
-
export const SEPARATOR =
|
|
276
|
+
export const SEPARATOR = "|";
|
|
257
277
|
export class GraphQLError extends Error {
|
|
258
278
|
constructor(response) {
|
|
259
|
-
super(
|
|
279
|
+
super("");
|
|
260
280
|
this.response = response;
|
|
261
281
|
console.error(response);
|
|
262
282
|
}
|
|
263
283
|
toString() {
|
|
264
|
-
return
|
|
284
|
+
return "GraphQL Response Error";
|
|
265
285
|
}
|
|
266
286
|
}
|
|
267
287
|
const ExtractScalar = (mappedParts, returns) => {
|
|
@@ -270,7 +290,7 @@ const ExtractScalar = (mappedParts, returns) => {
|
|
|
270
290
|
}
|
|
271
291
|
const oKey = mappedParts[0];
|
|
272
292
|
const returnP1 = returns[oKey];
|
|
273
|
-
if (typeof returnP1 ===
|
|
293
|
+
if (typeof returnP1 === "object") {
|
|
274
294
|
const returnP2 = returnP1[mappedParts[1]];
|
|
275
295
|
if (returnP2) {
|
|
276
296
|
return ExtractScalar([returnP2, ...mappedParts.slice(2)], returns);
|
|
@@ -279,15 +299,17 @@ const ExtractScalar = (mappedParts, returns) => {
|
|
|
279
299
|
}
|
|
280
300
|
return returnP1;
|
|
281
301
|
};
|
|
282
|
-
export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
302
|
+
export const PrepareScalarPaths = ({ ops, returns, }) => {
|
|
283
303
|
const ibb = (k, originalKey, o, p = [], pOriginals = [], root = true) => {
|
|
284
304
|
if (!o) {
|
|
285
305
|
return;
|
|
286
306
|
}
|
|
287
|
-
if (typeof o ===
|
|
307
|
+
if (typeof o === "boolean" ||
|
|
308
|
+
typeof o === "number" ||
|
|
309
|
+
typeof o === "string") {
|
|
288
310
|
const extractionArray = [...pOriginals, originalKey];
|
|
289
311
|
const isScalar = ExtractScalar(extractionArray, returns);
|
|
290
|
-
if (isScalar?.startsWith(
|
|
312
|
+
if (isScalar?.startsWith("scalar")) {
|
|
291
313
|
const partOfTree = {
|
|
292
314
|
[[...p, k].join(SEPARATOR)]: isScalar,
|
|
293
315
|
};
|
|
@@ -298,11 +320,12 @@ export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
298
320
|
if (Array.isArray(o)) {
|
|
299
321
|
return ibb(k, k, o[1], p, pOriginals, false);
|
|
300
322
|
}
|
|
301
|
-
if (k ===
|
|
323
|
+
if (k === "__alias") {
|
|
302
324
|
return Object.entries(o)
|
|
303
325
|
.map(([alias, objectUnderAlias]) => {
|
|
304
|
-
if (typeof objectUnderAlias !==
|
|
305
|
-
|
|
326
|
+
if (typeof objectUnderAlias !== "object" ||
|
|
327
|
+
Array.isArray(objectUnderAlias)) {
|
|
328
|
+
throw new Error("Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}");
|
|
306
329
|
}
|
|
307
330
|
const operationName = Object.keys(objectUnderAlias)[0];
|
|
308
331
|
const operation = objectUnderAlias[operationName];
|
|
@@ -315,11 +338,13 @@ export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
315
338
|
}
|
|
316
339
|
const keyName = root ? ops[k] : k;
|
|
317
340
|
return Object.entries(o)
|
|
318
|
-
.filter(([k]) => k !==
|
|
341
|
+
.filter(([k]) => k !== "__directives")
|
|
319
342
|
.map(([k, v]) => {
|
|
320
343
|
// Inline fragments shouldn't be added to the path as they aren't a field
|
|
321
344
|
const isInlineFragment = originalKey.match(/^...\s*on/) != null;
|
|
322
|
-
return ibb(k, k, v, isInlineFragment ? p : [...p, purifyGraphQLKey(keyName || k)], isInlineFragment
|
|
345
|
+
return ibb(k, k, v, isInlineFragment ? p : [...p, purifyGraphQLKey(keyName || k)], isInlineFragment
|
|
346
|
+
? pOriginals
|
|
347
|
+
: [...pOriginals, purifyGraphQLKey(originalKey)], false);
|
|
323
348
|
})
|
|
324
349
|
.reduce((a, b) => ({
|
|
325
350
|
...a,
|
|
@@ -328,47 +353,49 @@ export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
328
353
|
};
|
|
329
354
|
return ibb;
|
|
330
355
|
};
|
|
331
|
-
export const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g,
|
|
356
|
+
export const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g, "").replace(/^[^:]*\:/g, "");
|
|
332
357
|
const mapPart = (p) => {
|
|
333
|
-
const [isArg, isField] = p.split(
|
|
358
|
+
const [isArg, isField] = p.split("<>");
|
|
334
359
|
if (isField) {
|
|
335
360
|
return {
|
|
336
361
|
v: isField,
|
|
337
|
-
__type:
|
|
362
|
+
__type: "field",
|
|
338
363
|
};
|
|
339
364
|
}
|
|
340
365
|
return {
|
|
341
366
|
v: isArg,
|
|
342
|
-
__type:
|
|
367
|
+
__type: "arg",
|
|
343
368
|
};
|
|
344
369
|
};
|
|
345
370
|
export const ResolveFromPath = (props, returns, ops) => {
|
|
346
371
|
const ResolvePropsType = (mappedParts) => {
|
|
347
372
|
const oKey = ops[mappedParts[0].v];
|
|
348
373
|
const propsP1 = oKey ? props[oKey] : props[mappedParts[0].v];
|
|
349
|
-
if (propsP1 ===
|
|
350
|
-
return
|
|
374
|
+
if (propsP1 === "enum" && mappedParts.length === 1) {
|
|
375
|
+
return "enum";
|
|
351
376
|
}
|
|
352
|
-
if (typeof propsP1 ===
|
|
377
|
+
if (typeof propsP1 === "string" &&
|
|
378
|
+
propsP1.startsWith("scalar.") &&
|
|
379
|
+
mappedParts.length === 1) {
|
|
353
380
|
return propsP1;
|
|
354
381
|
}
|
|
355
|
-
if (typeof propsP1 ===
|
|
382
|
+
if (typeof propsP1 === "object") {
|
|
356
383
|
if (mappedParts.length < 2) {
|
|
357
|
-
return
|
|
384
|
+
return "not";
|
|
358
385
|
}
|
|
359
386
|
const propsP2 = propsP1[mappedParts[1].v];
|
|
360
|
-
if (typeof propsP2 ===
|
|
387
|
+
if (typeof propsP2 === "string") {
|
|
361
388
|
return rpp(`${propsP2}${SEPARATOR}${mappedParts
|
|
362
389
|
.slice(2)
|
|
363
390
|
.map((mp) => mp.v)
|
|
364
391
|
.join(SEPARATOR)}`);
|
|
365
392
|
}
|
|
366
|
-
if (typeof propsP2 ===
|
|
393
|
+
if (typeof propsP2 === "object") {
|
|
367
394
|
if (mappedParts.length < 3) {
|
|
368
|
-
return
|
|
395
|
+
return "not";
|
|
369
396
|
}
|
|
370
397
|
const propsP3 = propsP2[mappedParts[2].v];
|
|
371
|
-
if (propsP3 && mappedParts[2].__type ===
|
|
398
|
+
if (propsP3 && mappedParts[2].__type === "arg") {
|
|
372
399
|
return rpp(`${propsP3}${SEPARATOR}${mappedParts
|
|
373
400
|
.slice(3)
|
|
374
401
|
.map((mp) => mp.v)
|
|
@@ -379,13 +406,13 @@ export const ResolveFromPath = (props, returns, ops) => {
|
|
|
379
406
|
};
|
|
380
407
|
const ResolveReturnType = (mappedParts) => {
|
|
381
408
|
if (mappedParts.length === 0) {
|
|
382
|
-
return
|
|
409
|
+
return "not";
|
|
383
410
|
}
|
|
384
411
|
const oKey = ops[mappedParts[0].v];
|
|
385
412
|
const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
|
|
386
|
-
if (typeof returnP1 ===
|
|
413
|
+
if (typeof returnP1 === "object") {
|
|
387
414
|
if (mappedParts.length < 2)
|
|
388
|
-
return
|
|
415
|
+
return "not";
|
|
389
416
|
const returnP2 = returnP1[mappedParts[1].v];
|
|
390
417
|
if (returnP2) {
|
|
391
418
|
return rpp(`${returnP2}${SEPARATOR}${mappedParts
|
|
@@ -406,15 +433,17 @@ export const ResolveFromPath = (props, returns, ops) => {
|
|
|
406
433
|
if (returnP1) {
|
|
407
434
|
return returnP1;
|
|
408
435
|
}
|
|
409
|
-
return
|
|
436
|
+
return "not";
|
|
410
437
|
};
|
|
411
438
|
return rpp;
|
|
412
439
|
};
|
|
413
440
|
export const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
|
|
414
|
-
const arb = (a, p =
|
|
415
|
-
if (typeof a ===
|
|
441
|
+
const arb = (a, p = "", root = true) => {
|
|
442
|
+
if (typeof a === "string") {
|
|
416
443
|
if (a.startsWith(START_VAR_NAME)) {
|
|
417
|
-
const [varName, graphQLType] = a
|
|
444
|
+
const [varName, graphQLType] = a
|
|
445
|
+
.replace(START_VAR_NAME, "$")
|
|
446
|
+
.split(GRAPHQL_TYPE_SEPARATOR);
|
|
418
447
|
const v = vars.find((v) => v.name === varName);
|
|
419
448
|
if (!v) {
|
|
420
449
|
vars.push({
|
|
@@ -431,29 +460,29 @@ export const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
|
|
|
431
460
|
}
|
|
432
461
|
}
|
|
433
462
|
const checkType = ResolveFromPath(props, returns, ops)(p);
|
|
434
|
-
if (checkType.startsWith(
|
|
463
|
+
if (checkType.startsWith("scalar.")) {
|
|
435
464
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
436
|
-
const [_, ...splittedScalar] = checkType.split(
|
|
437
|
-
const scalarKey = splittedScalar.join(
|
|
465
|
+
const [_, ...splittedScalar] = checkType.split(".");
|
|
466
|
+
const scalarKey = splittedScalar.join(".");
|
|
438
467
|
return scalars?.[scalarKey]?.encode?.(a) || JSON.stringify(a);
|
|
439
468
|
}
|
|
440
469
|
if (Array.isArray(a)) {
|
|
441
|
-
return `[${a.map((arr) => arb(arr, p, false)).join(
|
|
470
|
+
return `[${a.map((arr) => arb(arr, p, false)).join(", ")}]`;
|
|
442
471
|
}
|
|
443
|
-
if (typeof a ===
|
|
444
|
-
if (checkType ===
|
|
472
|
+
if (typeof a === "string") {
|
|
473
|
+
if (checkType === "enum") {
|
|
445
474
|
return a;
|
|
446
475
|
}
|
|
447
476
|
return `${JSON.stringify(a)}`;
|
|
448
477
|
}
|
|
449
|
-
if (typeof a ===
|
|
478
|
+
if (typeof a === "object") {
|
|
450
479
|
if (a === null) {
|
|
451
480
|
return `null`;
|
|
452
481
|
}
|
|
453
482
|
const returnedObjectString = Object.entries(a)
|
|
454
|
-
.filter(([, v]) => typeof v !==
|
|
483
|
+
.filter(([, v]) => typeof v !== "undefined")
|
|
455
484
|
.map(([k, v]) => `${k}: ${arb(v, [p, k].join(SEPARATOR), false)}`)
|
|
456
|
-
.join(
|
|
485
|
+
.join(",\n");
|
|
457
486
|
if (!root) {
|
|
458
487
|
return `{${returnedObjectString}}`;
|
|
459
488
|
}
|
|
@@ -467,7 +496,10 @@ export const resolverFor = (type, field, fn) => fn;
|
|
|
467
496
|
export const START_VAR_NAME = `$ZEUS_VAR`;
|
|
468
497
|
export const GRAPHQL_TYPE_SEPARATOR = `__$GRAPHQL__`;
|
|
469
498
|
export const $ = (name, graphqlType) => {
|
|
470
|
-
return (START_VAR_NAME +
|
|
499
|
+
return (START_VAR_NAME +
|
|
500
|
+
name +
|
|
501
|
+
GRAPHQL_TYPE_SEPARATOR +
|
|
502
|
+
graphqlType);
|
|
471
503
|
};
|
|
472
504
|
/** @description
|
|
473
505
|
The state of a Job in the JobQueue
|
|
@@ -692,6 +724,7 @@ export var ErrorCode;
|
|
|
692
724
|
ErrorCode["ORDER_MODIFICATION_ERROR"] = "ORDER_MODIFICATION_ERROR";
|
|
693
725
|
ErrorCode["INELIGIBLE_SHIPPING_METHOD_ERROR"] = "INELIGIBLE_SHIPPING_METHOD_ERROR";
|
|
694
726
|
ErrorCode["NO_ACTIVE_ORDER_ERROR"] = "NO_ACTIVE_ORDER_ERROR";
|
|
727
|
+
ErrorCode["ORDER_MIDDLEWARE_ERROR"] = "ORDER_MIDDLEWARE_ERROR";
|
|
695
728
|
})(ErrorCode || (ErrorCode = {}));
|
|
696
729
|
export var LogicalOperator;
|
|
697
730
|
(function (LogicalOperator) {
|
|
@@ -1063,31 +1096,31 @@ export var OrderType;
|
|
|
1063
1096
|
OrderType["Seller"] = "Seller";
|
|
1064
1097
|
OrderType["Aggregate"] = "Aggregate";
|
|
1065
1098
|
})(OrderType || (OrderType = {}));
|
|
1066
|
-
export var
|
|
1067
|
-
(function (
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
})(
|
|
1087
|
-
export var
|
|
1088
|
-
(function (
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
})(
|
|
1099
|
+
export var MetricRangeType;
|
|
1100
|
+
(function (MetricRangeType) {
|
|
1101
|
+
MetricRangeType["Today"] = "Today";
|
|
1102
|
+
MetricRangeType["Yesterday"] = "Yesterday";
|
|
1103
|
+
MetricRangeType["ThisWeek"] = "ThisWeek";
|
|
1104
|
+
MetricRangeType["LastWeek"] = "LastWeek";
|
|
1105
|
+
MetricRangeType["ThisMonth"] = "ThisMonth";
|
|
1106
|
+
MetricRangeType["LastMonth"] = "LastMonth";
|
|
1107
|
+
MetricRangeType["ThisYear"] = "ThisYear";
|
|
1108
|
+
MetricRangeType["LastYear"] = "LastYear";
|
|
1109
|
+
MetricRangeType["FirstQuarter"] = "FirstQuarter";
|
|
1110
|
+
MetricRangeType["SecondQuarter"] = "SecondQuarter";
|
|
1111
|
+
MetricRangeType["ThirdQuarter"] = "ThirdQuarter";
|
|
1112
|
+
MetricRangeType["FourthQuarter"] = "FourthQuarter";
|
|
1113
|
+
MetricRangeType["Custom"] = "Custom";
|
|
1114
|
+
})(MetricRangeType || (MetricRangeType = {}));
|
|
1115
|
+
export var MetricIntervalType;
|
|
1116
|
+
(function (MetricIntervalType) {
|
|
1117
|
+
MetricIntervalType["Day"] = "Day";
|
|
1118
|
+
MetricIntervalType["Hour"] = "Hour";
|
|
1119
|
+
})(MetricIntervalType || (MetricIntervalType = {}));
|
|
1120
|
+
export var ChartMetricType;
|
|
1121
|
+
(function (ChartMetricType) {
|
|
1122
|
+
ChartMetricType["OrderCount"] = "OrderCount";
|
|
1123
|
+
ChartMetricType["OrderTotal"] = "OrderTotal";
|
|
1124
|
+
ChartMetricType["AverageOrderValue"] = "AverageOrderValue";
|
|
1125
|
+
ChartMetricType["OrderTotalProductsCount"] = "OrderTotalProductsCount";
|
|
1126
|
+
})(ChartMetricType || (ChartMetricType = {}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TypedDocumentNode } from
|
|
2
|
-
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from
|
|
1
|
+
import { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
|
+
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from "./";
|
|
3
3
|
export declare const typedGql: <O extends "query" | "mutation", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions) => TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deenruv/order-line-attributes-plugin",
|
|
3
|
-
"version": "1.0.17-dev.
|
|
3
|
+
"version": "1.0.17-dev.23",
|
|
4
4
|
"homepage": "https://deenruv.com/",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"react-router": "^7.13.0",
|
|
24
24
|
"sonner": "^1.4.41",
|
|
25
25
|
"uuid": "^9.0.1",
|
|
26
|
-
"@deenruv/
|
|
27
|
-
"@deenruv/
|
|
28
|
-
"@deenruv/
|
|
26
|
+
"@deenruv/react-ui-devkit": "^1.0.17-dev.23",
|
|
27
|
+
"@deenruv/common": "^1.0.17-dev.23",
|
|
28
|
+
"@deenruv/admin-types": "^1.0.17-dev.23"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/uuid": "^9.0.8",
|
|
35
35
|
"rimraf": "^5.0.10",
|
|
36
36
|
"typescript": "5.3.3",
|
|
37
|
-
"@deenruv/core": "^1.0.17-dev.
|
|
37
|
+
"@deenruv/core": "^1.0.17-dev.23"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@deenruv/core": "^1.0.0 || ^1.0.17-dev.0",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"watch": "tsc --build --watch",
|
|
46
46
|
"lint": "eslint .",
|
|
47
47
|
"lint:fix": "eslint --fix .",
|
|
48
|
-
"zeus": "zeus http://localhost:6100/admin-api ./src/plugin-server --td && zeus http://localhost:6100/admin-api ./src/plugin-ui --td"
|
|
48
|
+
"zeus": "zeus http://localhost:6100/admin-api ./src/plugin-server --td && zeus http://localhost:6100/admin-api ./src/plugin-ui --td && prettier --write ./src/plugin-server/zeus/*.ts ./src/plugin-ui/zeus/*.ts"
|
|
49
49
|
}
|
|
50
50
|
}
|