@deenruv/order-line-attributes-plugin 1.0.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.
Files changed (42) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +36 -0
  3. package/dist/plugin-server/index.d.ts +2 -0
  4. package/dist/plugin-server/index.js +77 -0
  5. package/dist/plugin-server/zeus/const.d.ts +6 -0
  6. package/dist/plugin-server/zeus/const.js +3857 -0
  7. package/dist/plugin-server/zeus/index.d.ts +19816 -0
  8. package/dist/plugin-server/zeus/index.js +1101 -0
  9. package/dist/plugin-server/zeus/typedDocumentNode.d.ts +1 -0
  10. package/dist/plugin-server/zeus/typedDocumentNode.js +31 -0
  11. package/dist/plugin-ui/components/AttributesInput.d.ts +16 -0
  12. package/dist/plugin-ui/components/AttributesInput.js +24 -0
  13. package/dist/plugin-ui/components/FacetValues.d.ts +9 -0
  14. package/dist/plugin-ui/components/FacetValues.js +126 -0
  15. package/dist/plugin-ui/components/GroupValue.d.ts +7 -0
  16. package/dist/plugin-ui/components/GroupValue.js +13 -0
  17. package/dist/plugin-ui/components/index.d.ts +3 -0
  18. package/dist/plugin-ui/components/index.js +3 -0
  19. package/dist/plugin-ui/graphql/index.d.ts +1 -0
  20. package/dist/plugin-ui/graphql/index.js +1 -0
  21. package/dist/plugin-ui/graphql/queries.d.ts +24 -0
  22. package/dist/plugin-ui/graphql/queries.js +7 -0
  23. package/dist/plugin-ui/graphql/selectors.d.ts +54 -0
  24. package/dist/plugin-ui/graphql/selectors.js +25 -0
  25. package/dist/plugin-ui/index.d.ts +1 -0
  26. package/dist/plugin-ui/index.js +11 -0
  27. package/dist/plugin-ui/locales/en/facetValues.json +12 -0
  28. package/dist/plugin-ui/locales/en/index.d.ts +13 -0
  29. package/dist/plugin-ui/locales/en/index.js +2 -0
  30. package/dist/plugin-ui/locales/pl/facetValues.json +12 -0
  31. package/dist/plugin-ui/locales/pl/index.d.ts +13 -0
  32. package/dist/plugin-ui/locales/pl/index.js +2 -0
  33. package/dist/plugin-ui/translation-ns.d.ts +1 -0
  34. package/dist/plugin-ui/translation-ns.js +1 -0
  35. package/dist/plugin-ui/tsconfig.json +18 -0
  36. package/dist/plugin-ui/zeus/const.d.ts +6 -0
  37. package/dist/plugin-ui/zeus/const.js +3854 -0
  38. package/dist/plugin-ui/zeus/index.d.ts +19816 -0
  39. package/dist/plugin-ui/zeus/index.js +1093 -0
  40. package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
  41. package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
  42. package/package.json +50 -0
@@ -0,0 +1,1101 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BetterMetricType = exports.BetterMetricInterval = exports.MetricType = exports.MetricInterval = exports.OrderType = exports.LanguageCode = exports.HistoryEntryType = exports.CurrencyCode = exports.LogicalOperator = exports.ErrorCode = exports.SortOrder = exports.Permission = exports.DeletionResult = exports.AdjustmentType = exports.GlobalFlag = exports.AssetType = exports.StockMovementType = exports.JobState = exports.$ = exports.GRAPHQL_TYPE_SEPARATOR = exports.START_VAR_NAME = exports.resolverFor = exports.InternalArgsBuilt = exports.ResolveFromPath = exports.purifyGraphQLKey = exports.PrepareScalarPaths = exports.GraphQLError = exports.SEPARATOR = exports.traverseResponse = exports.decodeScalarsInResponse = exports.fields = exports.ZeusScalars = exports.Gql = exports.TypeFromSelector = exports.Selector = exports.ZeusSelect = exports.Zeus = exports.Subscription = exports.SubscriptionThunder = exports.Chain = exports.Thunder = exports.InternalsBuildQuery = exports.apiFetch = exports.apiSubscription = exports.HEADERS = exports.HOST = void 0;
5
+ const const_1 = require("./const");
6
+ exports.HOST = "http://localhost:3000/admin-api";
7
+ exports.HEADERS = {};
8
+ const apiSubscription = (options) => (query) => {
9
+ var _a, _b, _c;
10
+ try {
11
+ const queryString = options[0] + '?query=' + encodeURIComponent(query);
12
+ const wsString = queryString.replace('http', 'ws');
13
+ const host = (options.length > 1 && ((_b = (_a = options[1]) === null || _a === void 0 ? void 0 : _a.websocket) === null || _b === void 0 ? void 0 : _b[0])) || wsString;
14
+ const webSocketOptions = ((_c = options[1]) === null || _c === void 0 ? void 0 : _c.websocket) || [host];
15
+ const ws = new WebSocket(...webSocketOptions);
16
+ return {
17
+ ws,
18
+ on: (e) => {
19
+ ws.onmessage = (event) => {
20
+ if (event.data) {
21
+ const parsed = JSON.parse(event.data);
22
+ const data = parsed.data;
23
+ return e(data);
24
+ }
25
+ };
26
+ },
27
+ off: (e) => {
28
+ ws.onclose = e;
29
+ },
30
+ error: (e) => {
31
+ ws.onerror = e;
32
+ },
33
+ open: (e) => {
34
+ ws.onopen = e;
35
+ },
36
+ };
37
+ }
38
+ catch (_d) {
39
+ throw new Error('No websockets implemented');
40
+ }
41
+ };
42
+ exports.apiSubscription = apiSubscription;
43
+ const handleFetchResponse = (response) => {
44
+ if (!response.ok) {
45
+ return new Promise((_, reject) => {
46
+ response
47
+ .text()
48
+ .then((text) => {
49
+ try {
50
+ reject(JSON.parse(text));
51
+ }
52
+ catch (err) {
53
+ reject(text);
54
+ }
55
+ })
56
+ .catch(reject);
57
+ });
58
+ }
59
+ return response.json();
60
+ };
61
+ const apiFetch = (options) => (query, variables = {}) => {
62
+ const fetchOptions = options[1] || {};
63
+ if (fetchOptions.method && fetchOptions.method === 'GET') {
64
+ return fetch(`${options[0]}?query=${encodeURIComponent(query)}`, fetchOptions)
65
+ .then(handleFetchResponse)
66
+ .then((response) => {
67
+ if (response.errors) {
68
+ throw new GraphQLError(response);
69
+ }
70
+ return response.data;
71
+ });
72
+ }
73
+ return fetch(`${options[0]}`, Object.assign({ body: JSON.stringify({ query, variables }), method: 'POST', headers: {
74
+ 'Content-Type': 'application/json',
75
+ } }, fetchOptions))
76
+ .then(handleFetchResponse)
77
+ .then((response) => {
78
+ if (response.errors) {
79
+ throw new GraphQLError(response);
80
+ }
81
+ return response.data;
82
+ });
83
+ };
84
+ exports.apiFetch = apiFetch;
85
+ const InternalsBuildQuery = ({ ops, props, returns, options, scalars, }) => {
86
+ const ibb = (k, o, p = '', root = true, vars = []) => {
87
+ var _a;
88
+ const keyForPath = (0, exports.purifyGraphQLKey)(k);
89
+ const newPath = [p, keyForPath].join(exports.SEPARATOR);
90
+ if (!o) {
91
+ return '';
92
+ }
93
+ if (typeof o === 'boolean' || typeof o === 'number') {
94
+ return k;
95
+ }
96
+ if (typeof o === 'string') {
97
+ return `${k} ${o}`;
98
+ }
99
+ if (Array.isArray(o)) {
100
+ const args = (0, exports.InternalArgsBuilt)({
101
+ props,
102
+ returns,
103
+ ops,
104
+ scalars,
105
+ vars,
106
+ })(o[0], newPath);
107
+ return `${ibb(args ? `${k}(${args})` : k, o[1], p, false, vars)}`;
108
+ }
109
+ if (k === '__alias') {
110
+ return Object.entries(o)
111
+ .map(([alias, objectUnderAlias]) => {
112
+ if (typeof objectUnderAlias !== 'object' || Array.isArray(objectUnderAlias)) {
113
+ throw new Error('Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}');
114
+ }
115
+ const operationName = Object.keys(objectUnderAlias)[0];
116
+ const operation = objectUnderAlias[operationName];
117
+ return ibb(`${alias}:${operationName}`, operation, p, false, vars);
118
+ })
119
+ .join('\n');
120
+ }
121
+ const hasOperationName = root && (options === null || options === void 0 ? void 0 : options.operationName) ? ' ' + options.operationName : '';
122
+ const keyForDirectives = (_a = o.__directives) !== null && _a !== void 0 ? _a : '';
123
+ const query = `{${Object.entries(o)
124
+ .filter(([k]) => k !== '__directives')
125
+ .map((e) => ibb(...e, [p, `field<>${keyForPath}`].join(exports.SEPARATOR), false, vars))
126
+ .join('\n')}}`;
127
+ if (!root) {
128
+ return `${k} ${keyForDirectives}${hasOperationName} ${query}`;
129
+ }
130
+ const varsString = vars.map((v) => `${v.name}: ${v.graphQLType}`).join(', ');
131
+ return `${k} ${keyForDirectives}${hasOperationName}${varsString ? `(${varsString})` : ''} ${query}`;
132
+ };
133
+ return ibb;
134
+ };
135
+ exports.InternalsBuildQuery = InternalsBuildQuery;
136
+ const Thunder = (fn, thunderGraphQLOptions) => (operation, graphqlOptions) => (o, ops) => {
137
+ const options = Object.assign(Object.assign({}, thunderGraphQLOptions), graphqlOptions);
138
+ return fn((0, exports.Zeus)(operation, o, {
139
+ operationOptions: ops,
140
+ scalars: options === null || options === void 0 ? void 0 : options.scalars,
141
+ }), ops === null || ops === void 0 ? void 0 : ops.variables).then((data) => {
142
+ if (options === null || options === void 0 ? void 0 : options.scalars) {
143
+ return (0, exports.decodeScalarsInResponse)({
144
+ response: data,
145
+ initialOp: operation,
146
+ initialZeusQuery: o,
147
+ returns: const_1.ReturnTypes,
148
+ scalars: options.scalars,
149
+ ops: const_1.Ops,
150
+ });
151
+ }
152
+ return data;
153
+ });
154
+ };
155
+ exports.Thunder = Thunder;
156
+ const Chain = (...options) => (0, exports.Thunder)((0, exports.apiFetch)(options));
157
+ exports.Chain = Chain;
158
+ const SubscriptionThunder = (fn, thunderGraphQLOptions) => (operation, graphqlOptions) => (o, ops) => {
159
+ const options = Object.assign(Object.assign({}, thunderGraphQLOptions), graphqlOptions);
160
+ const returnedFunction = fn((0, exports.Zeus)(operation, o, {
161
+ operationOptions: ops,
162
+ scalars: options === null || options === void 0 ? void 0 : options.scalars,
163
+ }));
164
+ if ((returnedFunction === null || returnedFunction === void 0 ? void 0 : returnedFunction.on) && (options === null || options === void 0 ? void 0 : options.scalars)) {
165
+ const wrapped = returnedFunction.on;
166
+ returnedFunction.on = (fnToCall) => wrapped((data) => {
167
+ if (options === null || options === void 0 ? void 0 : options.scalars) {
168
+ return fnToCall((0, exports.decodeScalarsInResponse)({
169
+ response: data,
170
+ initialOp: operation,
171
+ initialZeusQuery: o,
172
+ returns: const_1.ReturnTypes,
173
+ scalars: options.scalars,
174
+ ops: const_1.Ops,
175
+ }));
176
+ }
177
+ return fnToCall(data);
178
+ });
179
+ }
180
+ return returnedFunction;
181
+ };
182
+ exports.SubscriptionThunder = SubscriptionThunder;
183
+ const Subscription = (...options) => (0, exports.SubscriptionThunder)((0, exports.apiSubscription)(options));
184
+ exports.Subscription = Subscription;
185
+ const Zeus = (operation, o, ops) => (0, exports.InternalsBuildQuery)({
186
+ props: const_1.AllTypesProps,
187
+ returns: const_1.ReturnTypes,
188
+ ops: const_1.Ops,
189
+ options: ops === null || ops === void 0 ? void 0 : ops.operationOptions,
190
+ scalars: ops === null || ops === void 0 ? void 0 : ops.scalars,
191
+ })(operation, o);
192
+ exports.Zeus = Zeus;
193
+ const ZeusSelect = () => ((t) => t);
194
+ exports.ZeusSelect = ZeusSelect;
195
+ const Selector = (key) => key && (0, exports.ZeusSelect)();
196
+ exports.Selector = Selector;
197
+ const TypeFromSelector = (key) => key && (0, exports.ZeusSelect)();
198
+ exports.TypeFromSelector = TypeFromSelector;
199
+ exports.Gql = (0, exports.Chain)(exports.HOST, {
200
+ headers: Object.assign({ 'Content-Type': 'application/json' }, exports.HEADERS),
201
+ });
202
+ exports.ZeusScalars = (0, exports.ZeusSelect)();
203
+ const fields = (k) => {
204
+ const t = const_1.ReturnTypes[k];
205
+ const o = Object.fromEntries(Object.entries(t)
206
+ .filter(([, value]) => {
207
+ const isReturnType = const_1.ReturnTypes[value];
208
+ if (!isReturnType || (typeof isReturnType === 'string' && isReturnType.startsWith('scalar.'))) {
209
+ return true;
210
+ }
211
+ })
212
+ .map(([key]) => [key, true]));
213
+ return o;
214
+ };
215
+ exports.fields = fields;
216
+ const decodeScalarsInResponse = ({ response, scalars, returns, ops, initialZeusQuery, initialOp, }) => {
217
+ if (!scalars) {
218
+ return response;
219
+ }
220
+ const builder = (0, exports.PrepareScalarPaths)({
221
+ ops,
222
+ returns,
223
+ });
224
+ const scalarPaths = builder(initialOp, ops[initialOp], initialZeusQuery);
225
+ if (scalarPaths) {
226
+ const r = (0, exports.traverseResponse)({ scalarPaths, resolvers: scalars })(initialOp, response, [ops[initialOp]]);
227
+ return r;
228
+ }
229
+ return response;
230
+ };
231
+ exports.decodeScalarsInResponse = decodeScalarsInResponse;
232
+ const traverseResponse = ({ resolvers, scalarPaths, }) => {
233
+ const ibb = (k, o, p = []) => {
234
+ var _a;
235
+ if (Array.isArray(o)) {
236
+ return o.map((eachO) => ibb(k, eachO, p));
237
+ }
238
+ if (o == null) {
239
+ return o;
240
+ }
241
+ const scalarPathString = p.join(exports.SEPARATOR);
242
+ const currentScalarString = scalarPaths[scalarPathString];
243
+ if (currentScalarString) {
244
+ const currentDecoder = (_a = resolvers[currentScalarString.split('.')[1]]) === null || _a === void 0 ? void 0 : _a.decode;
245
+ if (currentDecoder) {
246
+ return currentDecoder(o);
247
+ }
248
+ }
249
+ if (typeof o === 'boolean' || typeof o === 'number' || typeof o === 'string' || !o) {
250
+ return o;
251
+ }
252
+ const entries = Object.entries(o).map(([k, v]) => [k, ibb(k, v, [...p, (0, exports.purifyGraphQLKey)(k)])]);
253
+ const objectFromEntries = entries.reduce((a, [k, v]) => {
254
+ a[k] = v;
255
+ return a;
256
+ }, {});
257
+ return objectFromEntries;
258
+ };
259
+ return ibb;
260
+ };
261
+ exports.traverseResponse = traverseResponse;
262
+ exports.SEPARATOR = '|';
263
+ class GraphQLError extends Error {
264
+ constructor(response) {
265
+ super('');
266
+ this.response = response;
267
+ console.error(response);
268
+ }
269
+ toString() {
270
+ return 'GraphQL Response Error';
271
+ }
272
+ }
273
+ exports.GraphQLError = GraphQLError;
274
+ const ExtractScalar = (mappedParts, returns) => {
275
+ if (mappedParts.length === 0) {
276
+ return;
277
+ }
278
+ const oKey = mappedParts[0];
279
+ const returnP1 = returns[oKey];
280
+ if (typeof returnP1 === 'object') {
281
+ const returnP2 = returnP1[mappedParts[1]];
282
+ if (returnP2) {
283
+ return ExtractScalar([returnP2, ...mappedParts.slice(2)], returns);
284
+ }
285
+ return undefined;
286
+ }
287
+ return returnP1;
288
+ };
289
+ const PrepareScalarPaths = ({ ops, returns }) => {
290
+ const ibb = (k, originalKey, o, p = [], pOriginals = [], root = true) => {
291
+ if (!o) {
292
+ return;
293
+ }
294
+ if (typeof o === 'boolean' || typeof o === 'number' || typeof o === 'string') {
295
+ const extractionArray = [...pOriginals, originalKey];
296
+ const isScalar = ExtractScalar(extractionArray, returns);
297
+ if (isScalar === null || isScalar === void 0 ? void 0 : isScalar.startsWith('scalar')) {
298
+ const partOfTree = {
299
+ [[...p, k].join(exports.SEPARATOR)]: isScalar,
300
+ };
301
+ return partOfTree;
302
+ }
303
+ return {};
304
+ }
305
+ if (Array.isArray(o)) {
306
+ return ibb(k, k, o[1], p, pOriginals, false);
307
+ }
308
+ if (k === '__alias') {
309
+ return Object.entries(o)
310
+ .map(([alias, objectUnderAlias]) => {
311
+ if (typeof objectUnderAlias !== 'object' || Array.isArray(objectUnderAlias)) {
312
+ throw new Error('Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}');
313
+ }
314
+ const operationName = Object.keys(objectUnderAlias)[0];
315
+ const operation = objectUnderAlias[operationName];
316
+ return ibb(alias, operationName, operation, p, pOriginals, false);
317
+ })
318
+ .reduce((a, b) => (Object.assign(Object.assign({}, a), b)));
319
+ }
320
+ const keyName = root ? ops[k] : k;
321
+ return Object.entries(o)
322
+ .filter(([k]) => k !== '__directives')
323
+ .map(([k, v]) => {
324
+ // Inline fragments shouldn't be added to the path as they aren't a field
325
+ const isInlineFragment = originalKey.match(/^...\s*on/) != null;
326
+ return ibb(k, k, v, isInlineFragment ? p : [...p, (0, exports.purifyGraphQLKey)(keyName || k)], isInlineFragment ? pOriginals : [...pOriginals, (0, exports.purifyGraphQLKey)(originalKey)], false);
327
+ })
328
+ .reduce((a, b) => (Object.assign(Object.assign({}, a), b)));
329
+ };
330
+ return ibb;
331
+ };
332
+ exports.PrepareScalarPaths = PrepareScalarPaths;
333
+ const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g, '').replace(/^[^:]*\:/g, '');
334
+ exports.purifyGraphQLKey = purifyGraphQLKey;
335
+ const mapPart = (p) => {
336
+ const [isArg, isField] = p.split('<>');
337
+ if (isField) {
338
+ return {
339
+ v: isField,
340
+ __type: 'field',
341
+ };
342
+ }
343
+ return {
344
+ v: isArg,
345
+ __type: 'arg',
346
+ };
347
+ };
348
+ const ResolveFromPath = (props, returns, ops) => {
349
+ const ResolvePropsType = (mappedParts) => {
350
+ const oKey = ops[mappedParts[0].v];
351
+ const propsP1 = oKey ? props[oKey] : props[mappedParts[0].v];
352
+ if (propsP1 === 'enum' && mappedParts.length === 1) {
353
+ return 'enum';
354
+ }
355
+ if (typeof propsP1 === 'string' && propsP1.startsWith('scalar.') && mappedParts.length === 1) {
356
+ return propsP1;
357
+ }
358
+ if (typeof propsP1 === 'object') {
359
+ if (mappedParts.length < 2) {
360
+ return 'not';
361
+ }
362
+ const propsP2 = propsP1[mappedParts[1].v];
363
+ if (typeof propsP2 === 'string') {
364
+ return rpp(`${propsP2}${exports.SEPARATOR}${mappedParts
365
+ .slice(2)
366
+ .map((mp) => mp.v)
367
+ .join(exports.SEPARATOR)}`);
368
+ }
369
+ if (typeof propsP2 === 'object') {
370
+ if (mappedParts.length < 3) {
371
+ return 'not';
372
+ }
373
+ const propsP3 = propsP2[mappedParts[2].v];
374
+ if (propsP3 && mappedParts[2].__type === 'arg') {
375
+ return rpp(`${propsP3}${exports.SEPARATOR}${mappedParts
376
+ .slice(3)
377
+ .map((mp) => mp.v)
378
+ .join(exports.SEPARATOR)}`);
379
+ }
380
+ }
381
+ }
382
+ };
383
+ const ResolveReturnType = (mappedParts) => {
384
+ if (mappedParts.length === 0) {
385
+ return 'not';
386
+ }
387
+ const oKey = ops[mappedParts[0].v];
388
+ const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
389
+ if (typeof returnP1 === 'object') {
390
+ if (mappedParts.length < 2)
391
+ return 'not';
392
+ const returnP2 = returnP1[mappedParts[1].v];
393
+ if (returnP2) {
394
+ return rpp(`${returnP2}${exports.SEPARATOR}${mappedParts
395
+ .slice(2)
396
+ .map((mp) => mp.v)
397
+ .join(exports.SEPARATOR)}`);
398
+ }
399
+ }
400
+ };
401
+ const rpp = (path) => {
402
+ const parts = path.split(exports.SEPARATOR).filter((l) => l.length > 0);
403
+ const mappedParts = parts.map(mapPart);
404
+ const propsP1 = ResolvePropsType(mappedParts);
405
+ if (propsP1) {
406
+ return propsP1;
407
+ }
408
+ const returnP1 = ResolveReturnType(mappedParts);
409
+ if (returnP1) {
410
+ return returnP1;
411
+ }
412
+ return 'not';
413
+ };
414
+ return rpp;
415
+ };
416
+ exports.ResolveFromPath = ResolveFromPath;
417
+ const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
418
+ const arb = (a, p = '', root = true) => {
419
+ var _a, _b;
420
+ if (typeof a === 'string') {
421
+ if (a.startsWith(exports.START_VAR_NAME)) {
422
+ const [varName, graphQLType] = a.replace(exports.START_VAR_NAME, '$').split(exports.GRAPHQL_TYPE_SEPARATOR);
423
+ const v = vars.find((v) => v.name === varName);
424
+ if (!v) {
425
+ vars.push({
426
+ name: varName,
427
+ graphQLType,
428
+ });
429
+ }
430
+ else {
431
+ if (v.graphQLType !== graphQLType) {
432
+ throw new Error(`Invalid variable exists with two different GraphQL Types, "${v.graphQLType}" and ${graphQLType}`);
433
+ }
434
+ }
435
+ return varName;
436
+ }
437
+ }
438
+ const checkType = (0, exports.ResolveFromPath)(props, returns, ops)(p);
439
+ if (checkType.startsWith('scalar.')) {
440
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
441
+ const [_, ...splittedScalar] = checkType.split('.');
442
+ const scalarKey = splittedScalar.join('.');
443
+ return ((_b = (_a = scalars === null || scalars === void 0 ? void 0 : scalars[scalarKey]) === null || _a === void 0 ? void 0 : _a.encode) === null || _b === void 0 ? void 0 : _b.call(_a, a)) || JSON.stringify(a);
444
+ }
445
+ if (Array.isArray(a)) {
446
+ return `[${a.map((arr) => arb(arr, p, false)).join(', ')}]`;
447
+ }
448
+ if (typeof a === 'string') {
449
+ if (checkType === 'enum') {
450
+ return a;
451
+ }
452
+ return `${JSON.stringify(a)}`;
453
+ }
454
+ if (typeof a === 'object') {
455
+ if (a === null) {
456
+ return `null`;
457
+ }
458
+ const returnedObjectString = Object.entries(a)
459
+ .filter(([, v]) => typeof v !== 'undefined')
460
+ .map(([k, v]) => `${k}: ${arb(v, [p, k].join(exports.SEPARATOR), false)}`)
461
+ .join(',\n');
462
+ if (!root) {
463
+ return `{${returnedObjectString}}`;
464
+ }
465
+ return returnedObjectString;
466
+ }
467
+ return `${a}`;
468
+ };
469
+ return arb;
470
+ };
471
+ exports.InternalArgsBuilt = InternalArgsBuilt;
472
+ const resolverFor = (type, field, fn) => fn;
473
+ exports.resolverFor = resolverFor;
474
+ exports.START_VAR_NAME = `$ZEUS_VAR`;
475
+ exports.GRAPHQL_TYPE_SEPARATOR = `__$GRAPHQL__`;
476
+ const $ = (name, graphqlType) => {
477
+ return (exports.START_VAR_NAME + name + exports.GRAPHQL_TYPE_SEPARATOR + graphqlType);
478
+ };
479
+ exports.$ = $;
480
+ /** @description
481
+ The state of a Job in the JobQueue
482
+
483
+ @docsCategory common */
484
+ var JobState;
485
+ (function (JobState) {
486
+ JobState["PENDING"] = "PENDING";
487
+ JobState["RUNNING"] = "RUNNING";
488
+ JobState["COMPLETED"] = "COMPLETED";
489
+ JobState["RETRYING"] = "RETRYING";
490
+ JobState["FAILED"] = "FAILED";
491
+ JobState["CANCELLED"] = "CANCELLED";
492
+ })(JobState || (exports.JobState = JobState = {}));
493
+ var StockMovementType;
494
+ (function (StockMovementType) {
495
+ StockMovementType["ADJUSTMENT"] = "ADJUSTMENT";
496
+ StockMovementType["ALLOCATION"] = "ALLOCATION";
497
+ StockMovementType["RELEASE"] = "RELEASE";
498
+ StockMovementType["SALE"] = "SALE";
499
+ StockMovementType["CANCELLATION"] = "CANCELLATION";
500
+ StockMovementType["RETURN"] = "RETURN";
501
+ })(StockMovementType || (exports.StockMovementType = StockMovementType = {}));
502
+ var AssetType;
503
+ (function (AssetType) {
504
+ AssetType["IMAGE"] = "IMAGE";
505
+ AssetType["VIDEO"] = "VIDEO";
506
+ AssetType["BINARY"] = "BINARY";
507
+ })(AssetType || (exports.AssetType = AssetType = {}));
508
+ var GlobalFlag;
509
+ (function (GlobalFlag) {
510
+ GlobalFlag["TRUE"] = "TRUE";
511
+ GlobalFlag["FALSE"] = "FALSE";
512
+ GlobalFlag["INHERIT"] = "INHERIT";
513
+ })(GlobalFlag || (exports.GlobalFlag = GlobalFlag = {}));
514
+ var AdjustmentType;
515
+ (function (AdjustmentType) {
516
+ AdjustmentType["PROMOTION"] = "PROMOTION";
517
+ AdjustmentType["DISTRIBUTED_ORDER_PROMOTION"] = "DISTRIBUTED_ORDER_PROMOTION";
518
+ AdjustmentType["OTHER"] = "OTHER";
519
+ })(AdjustmentType || (exports.AdjustmentType = AdjustmentType = {}));
520
+ var DeletionResult;
521
+ (function (DeletionResult) {
522
+ DeletionResult["DELETED"] = "DELETED";
523
+ DeletionResult["NOT_DELETED"] = "NOT_DELETED";
524
+ })(DeletionResult || (exports.DeletionResult = DeletionResult = {}));
525
+ /** @description
526
+ Permissions for administrators and customers. Used to control access to
527
+ GraphQL resolvers via the {@link Allow} decorator.
528
+
529
+ ## Understanding Permission.Owner
530
+
531
+ `Permission.Owner` is a special permission which is used in some Deenruv resolvers to indicate that that resolver should only
532
+ be accessible to the "owner" of that resource.
533
+
534
+ For example, the Shop API `activeCustomer` query resolver should only return the Customer object for the "owner" of that Customer, i.e.
535
+ based on the activeUserId of the current session. As a result, the resolver code looks like this:
536
+
537
+ @example
538
+ ```TypeScript
539
+ \@Query()
540
+ \@Allow(Permission.Owner)
541
+ async activeCustomer(\@Ctx() ctx: RequestContext): Promise<Customer | undefined> {
542
+ const userId = ctx.activeUserId;
543
+ if (userId) {
544
+ return this.customerService.findOneByUserId(ctx, userId);
545
+ }
546
+ }
547
+ ```
548
+
549
+ Here we can see that the "ownership" must be enforced by custom logic inside the resolver. Since "ownership" cannot be defined generally
550
+ nor statically encoded at build-time, any resolvers using `Permission.Owner` **must** include logic to enforce that only the owner
551
+ of the resource has access. If not, then it is the equivalent of using `Permission.Public`.
552
+
553
+
554
+ @docsCategory common */
555
+ var Permission;
556
+ (function (Permission) {
557
+ Permission["Authenticated"] = "Authenticated";
558
+ Permission["SuperAdmin"] = "SuperAdmin";
559
+ Permission["Owner"] = "Owner";
560
+ Permission["Public"] = "Public";
561
+ Permission["UpdateGlobalSettings"] = "UpdateGlobalSettings";
562
+ Permission["CreateCatalog"] = "CreateCatalog";
563
+ Permission["ReadCatalog"] = "ReadCatalog";
564
+ Permission["UpdateCatalog"] = "UpdateCatalog";
565
+ Permission["DeleteCatalog"] = "DeleteCatalog";
566
+ Permission["CreateSettings"] = "CreateSettings";
567
+ Permission["ReadSettings"] = "ReadSettings";
568
+ Permission["UpdateSettings"] = "UpdateSettings";
569
+ Permission["DeleteSettings"] = "DeleteSettings";
570
+ Permission["CreateAdministrator"] = "CreateAdministrator";
571
+ Permission["ReadAdministrator"] = "ReadAdministrator";
572
+ Permission["UpdateAdministrator"] = "UpdateAdministrator";
573
+ Permission["DeleteAdministrator"] = "DeleteAdministrator";
574
+ Permission["CreateAsset"] = "CreateAsset";
575
+ Permission["ReadAsset"] = "ReadAsset";
576
+ Permission["UpdateAsset"] = "UpdateAsset";
577
+ Permission["DeleteAsset"] = "DeleteAsset";
578
+ Permission["CreateChannel"] = "CreateChannel";
579
+ Permission["ReadChannel"] = "ReadChannel";
580
+ Permission["UpdateChannel"] = "UpdateChannel";
581
+ Permission["DeleteChannel"] = "DeleteChannel";
582
+ Permission["CreateCollection"] = "CreateCollection";
583
+ Permission["ReadCollection"] = "ReadCollection";
584
+ Permission["UpdateCollection"] = "UpdateCollection";
585
+ Permission["DeleteCollection"] = "DeleteCollection";
586
+ Permission["CreateCountry"] = "CreateCountry";
587
+ Permission["ReadCountry"] = "ReadCountry";
588
+ Permission["UpdateCountry"] = "UpdateCountry";
589
+ Permission["DeleteCountry"] = "DeleteCountry";
590
+ Permission["CreateCustomer"] = "CreateCustomer";
591
+ Permission["ReadCustomer"] = "ReadCustomer";
592
+ Permission["UpdateCustomer"] = "UpdateCustomer";
593
+ Permission["DeleteCustomer"] = "DeleteCustomer";
594
+ Permission["CreateCustomerGroup"] = "CreateCustomerGroup";
595
+ Permission["ReadCustomerGroup"] = "ReadCustomerGroup";
596
+ Permission["UpdateCustomerGroup"] = "UpdateCustomerGroup";
597
+ Permission["DeleteCustomerGroup"] = "DeleteCustomerGroup";
598
+ Permission["CreateFacet"] = "CreateFacet";
599
+ Permission["ReadFacet"] = "ReadFacet";
600
+ Permission["UpdateFacet"] = "UpdateFacet";
601
+ Permission["DeleteFacet"] = "DeleteFacet";
602
+ Permission["CreateOrder"] = "CreateOrder";
603
+ Permission["ReadOrder"] = "ReadOrder";
604
+ Permission["UpdateOrder"] = "UpdateOrder";
605
+ Permission["DeleteOrder"] = "DeleteOrder";
606
+ Permission["CreatePaymentMethod"] = "CreatePaymentMethod";
607
+ Permission["ReadPaymentMethod"] = "ReadPaymentMethod";
608
+ Permission["UpdatePaymentMethod"] = "UpdatePaymentMethod";
609
+ Permission["DeletePaymentMethod"] = "DeletePaymentMethod";
610
+ Permission["CreateProduct"] = "CreateProduct";
611
+ Permission["ReadProduct"] = "ReadProduct";
612
+ Permission["UpdateProduct"] = "UpdateProduct";
613
+ Permission["DeleteProduct"] = "DeleteProduct";
614
+ Permission["CreatePromotion"] = "CreatePromotion";
615
+ Permission["ReadPromotion"] = "ReadPromotion";
616
+ Permission["UpdatePromotion"] = "UpdatePromotion";
617
+ Permission["DeletePromotion"] = "DeletePromotion";
618
+ Permission["CreateShippingMethod"] = "CreateShippingMethod";
619
+ Permission["ReadShippingMethod"] = "ReadShippingMethod";
620
+ Permission["UpdateShippingMethod"] = "UpdateShippingMethod";
621
+ Permission["DeleteShippingMethod"] = "DeleteShippingMethod";
622
+ Permission["CreateTag"] = "CreateTag";
623
+ Permission["ReadTag"] = "ReadTag";
624
+ Permission["UpdateTag"] = "UpdateTag";
625
+ Permission["DeleteTag"] = "DeleteTag";
626
+ Permission["CreateTaxCategory"] = "CreateTaxCategory";
627
+ Permission["ReadTaxCategory"] = "ReadTaxCategory";
628
+ Permission["UpdateTaxCategory"] = "UpdateTaxCategory";
629
+ Permission["DeleteTaxCategory"] = "DeleteTaxCategory";
630
+ Permission["CreateTaxRate"] = "CreateTaxRate";
631
+ Permission["ReadTaxRate"] = "ReadTaxRate";
632
+ Permission["UpdateTaxRate"] = "UpdateTaxRate";
633
+ Permission["DeleteTaxRate"] = "DeleteTaxRate";
634
+ Permission["CreateSeller"] = "CreateSeller";
635
+ Permission["ReadSeller"] = "ReadSeller";
636
+ Permission["UpdateSeller"] = "UpdateSeller";
637
+ Permission["DeleteSeller"] = "DeleteSeller";
638
+ Permission["CreateStockLocation"] = "CreateStockLocation";
639
+ Permission["ReadStockLocation"] = "ReadStockLocation";
640
+ Permission["UpdateStockLocation"] = "UpdateStockLocation";
641
+ Permission["DeleteStockLocation"] = "DeleteStockLocation";
642
+ Permission["CreateSystem"] = "CreateSystem";
643
+ Permission["ReadSystem"] = "ReadSystem";
644
+ Permission["UpdateSystem"] = "UpdateSystem";
645
+ Permission["DeleteSystem"] = "DeleteSystem";
646
+ Permission["CreateZone"] = "CreateZone";
647
+ Permission["ReadZone"] = "ReadZone";
648
+ Permission["UpdateZone"] = "UpdateZone";
649
+ Permission["DeleteZone"] = "DeleteZone";
650
+ })(Permission || (exports.Permission = Permission = {}));
651
+ var SortOrder;
652
+ (function (SortOrder) {
653
+ SortOrder["ASC"] = "ASC";
654
+ SortOrder["DESC"] = "DESC";
655
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
656
+ var ErrorCode;
657
+ (function (ErrorCode) {
658
+ ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
659
+ ErrorCode["MIME_TYPE_ERROR"] = "MIME_TYPE_ERROR";
660
+ ErrorCode["LANGUAGE_NOT_AVAILABLE_ERROR"] = "LANGUAGE_NOT_AVAILABLE_ERROR";
661
+ ErrorCode["DUPLICATE_ENTITY_ERROR"] = "DUPLICATE_ENTITY_ERROR";
662
+ ErrorCode["FACET_IN_USE_ERROR"] = "FACET_IN_USE_ERROR";
663
+ ErrorCode["CHANNEL_DEFAULT_LANGUAGE_ERROR"] = "CHANNEL_DEFAULT_LANGUAGE_ERROR";
664
+ ErrorCode["SETTLE_PAYMENT_ERROR"] = "SETTLE_PAYMENT_ERROR";
665
+ ErrorCode["CANCEL_PAYMENT_ERROR"] = "CANCEL_PAYMENT_ERROR";
666
+ ErrorCode["EMPTY_ORDER_LINE_SELECTION_ERROR"] = "EMPTY_ORDER_LINE_SELECTION_ERROR";
667
+ ErrorCode["ITEMS_ALREADY_FULFILLED_ERROR"] = "ITEMS_ALREADY_FULFILLED_ERROR";
668
+ ErrorCode["INVALID_FULFILLMENT_HANDLER_ERROR"] = "INVALID_FULFILLMENT_HANDLER_ERROR";
669
+ ErrorCode["CREATE_FULFILLMENT_ERROR"] = "CREATE_FULFILLMENT_ERROR";
670
+ ErrorCode["INSUFFICIENT_STOCK_ON_HAND_ERROR"] = "INSUFFICIENT_STOCK_ON_HAND_ERROR";
671
+ ErrorCode["MULTIPLE_ORDER_ERROR"] = "MULTIPLE_ORDER_ERROR";
672
+ ErrorCode["CANCEL_ACTIVE_ORDER_ERROR"] = "CANCEL_ACTIVE_ORDER_ERROR";
673
+ ErrorCode["PAYMENT_ORDER_MISMATCH_ERROR"] = "PAYMENT_ORDER_MISMATCH_ERROR";
674
+ ErrorCode["REFUND_ORDER_STATE_ERROR"] = "REFUND_ORDER_STATE_ERROR";
675
+ ErrorCode["NOTHING_TO_REFUND_ERROR"] = "NOTHING_TO_REFUND_ERROR";
676
+ ErrorCode["ALREADY_REFUNDED_ERROR"] = "ALREADY_REFUNDED_ERROR";
677
+ ErrorCode["QUANTITY_TOO_GREAT_ERROR"] = "QUANTITY_TOO_GREAT_ERROR";
678
+ ErrorCode["REFUND_AMOUNT_ERROR"] = "REFUND_AMOUNT_ERROR";
679
+ ErrorCode["REFUND_STATE_TRANSITION_ERROR"] = "REFUND_STATE_TRANSITION_ERROR";
680
+ ErrorCode["PAYMENT_STATE_TRANSITION_ERROR"] = "PAYMENT_STATE_TRANSITION_ERROR";
681
+ ErrorCode["FULFILLMENT_STATE_TRANSITION_ERROR"] = "FULFILLMENT_STATE_TRANSITION_ERROR";
682
+ ErrorCode["ORDER_MODIFICATION_STATE_ERROR"] = "ORDER_MODIFICATION_STATE_ERROR";
683
+ ErrorCode["NO_CHANGES_SPECIFIED_ERROR"] = "NO_CHANGES_SPECIFIED_ERROR";
684
+ ErrorCode["PAYMENT_METHOD_MISSING_ERROR"] = "PAYMENT_METHOD_MISSING_ERROR";
685
+ ErrorCode["REFUND_PAYMENT_ID_MISSING_ERROR"] = "REFUND_PAYMENT_ID_MISSING_ERROR";
686
+ ErrorCode["MANUAL_PAYMENT_STATE_ERROR"] = "MANUAL_PAYMENT_STATE_ERROR";
687
+ ErrorCode["PRODUCT_OPTION_IN_USE_ERROR"] = "PRODUCT_OPTION_IN_USE_ERROR";
688
+ ErrorCode["MISSING_CONDITIONS_ERROR"] = "MISSING_CONDITIONS_ERROR";
689
+ ErrorCode["NATIVE_AUTH_STRATEGY_ERROR"] = "NATIVE_AUTH_STRATEGY_ERROR";
690
+ ErrorCode["INVALID_CREDENTIALS_ERROR"] = "INVALID_CREDENTIALS_ERROR";
691
+ ErrorCode["ORDER_STATE_TRANSITION_ERROR"] = "ORDER_STATE_TRANSITION_ERROR";
692
+ ErrorCode["EMAIL_ADDRESS_CONFLICT_ERROR"] = "EMAIL_ADDRESS_CONFLICT_ERROR";
693
+ ErrorCode["GUEST_CHECKOUT_ERROR"] = "GUEST_CHECKOUT_ERROR";
694
+ ErrorCode["ORDER_LIMIT_ERROR"] = "ORDER_LIMIT_ERROR";
695
+ ErrorCode["NEGATIVE_QUANTITY_ERROR"] = "NEGATIVE_QUANTITY_ERROR";
696
+ ErrorCode["INSUFFICIENT_STOCK_ERROR"] = "INSUFFICIENT_STOCK_ERROR";
697
+ ErrorCode["COUPON_CODE_INVALID_ERROR"] = "COUPON_CODE_INVALID_ERROR";
698
+ ErrorCode["COUPON_CODE_EXPIRED_ERROR"] = "COUPON_CODE_EXPIRED_ERROR";
699
+ ErrorCode["COUPON_CODE_LIMIT_ERROR"] = "COUPON_CODE_LIMIT_ERROR";
700
+ ErrorCode["ORDER_MODIFICATION_ERROR"] = "ORDER_MODIFICATION_ERROR";
701
+ ErrorCode["INELIGIBLE_SHIPPING_METHOD_ERROR"] = "INELIGIBLE_SHIPPING_METHOD_ERROR";
702
+ ErrorCode["NO_ACTIVE_ORDER_ERROR"] = "NO_ACTIVE_ORDER_ERROR";
703
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
704
+ var LogicalOperator;
705
+ (function (LogicalOperator) {
706
+ LogicalOperator["AND"] = "AND";
707
+ LogicalOperator["OR"] = "OR";
708
+ })(LogicalOperator || (exports.LogicalOperator = LogicalOperator = {}));
709
+ /** @description
710
+ ISO 4217 currency code
711
+
712
+ @docsCategory common */
713
+ var CurrencyCode;
714
+ (function (CurrencyCode) {
715
+ CurrencyCode["AED"] = "AED";
716
+ CurrencyCode["AFN"] = "AFN";
717
+ CurrencyCode["ALL"] = "ALL";
718
+ CurrencyCode["AMD"] = "AMD";
719
+ CurrencyCode["ANG"] = "ANG";
720
+ CurrencyCode["AOA"] = "AOA";
721
+ CurrencyCode["ARS"] = "ARS";
722
+ CurrencyCode["AUD"] = "AUD";
723
+ CurrencyCode["AWG"] = "AWG";
724
+ CurrencyCode["AZN"] = "AZN";
725
+ CurrencyCode["BAM"] = "BAM";
726
+ CurrencyCode["BBD"] = "BBD";
727
+ CurrencyCode["BDT"] = "BDT";
728
+ CurrencyCode["BGN"] = "BGN";
729
+ CurrencyCode["BHD"] = "BHD";
730
+ CurrencyCode["BIF"] = "BIF";
731
+ CurrencyCode["BMD"] = "BMD";
732
+ CurrencyCode["BND"] = "BND";
733
+ CurrencyCode["BOB"] = "BOB";
734
+ CurrencyCode["BRL"] = "BRL";
735
+ CurrencyCode["BSD"] = "BSD";
736
+ CurrencyCode["BTN"] = "BTN";
737
+ CurrencyCode["BWP"] = "BWP";
738
+ CurrencyCode["BYN"] = "BYN";
739
+ CurrencyCode["BZD"] = "BZD";
740
+ CurrencyCode["CAD"] = "CAD";
741
+ CurrencyCode["CDF"] = "CDF";
742
+ CurrencyCode["CHF"] = "CHF";
743
+ CurrencyCode["CLP"] = "CLP";
744
+ CurrencyCode["CNY"] = "CNY";
745
+ CurrencyCode["COP"] = "COP";
746
+ CurrencyCode["CRC"] = "CRC";
747
+ CurrencyCode["CUC"] = "CUC";
748
+ CurrencyCode["CUP"] = "CUP";
749
+ CurrencyCode["CVE"] = "CVE";
750
+ CurrencyCode["CZK"] = "CZK";
751
+ CurrencyCode["DJF"] = "DJF";
752
+ CurrencyCode["DKK"] = "DKK";
753
+ CurrencyCode["DOP"] = "DOP";
754
+ CurrencyCode["DZD"] = "DZD";
755
+ CurrencyCode["EGP"] = "EGP";
756
+ CurrencyCode["ERN"] = "ERN";
757
+ CurrencyCode["ETB"] = "ETB";
758
+ CurrencyCode["EUR"] = "EUR";
759
+ CurrencyCode["FJD"] = "FJD";
760
+ CurrencyCode["FKP"] = "FKP";
761
+ CurrencyCode["GBP"] = "GBP";
762
+ CurrencyCode["GEL"] = "GEL";
763
+ CurrencyCode["GHS"] = "GHS";
764
+ CurrencyCode["GIP"] = "GIP";
765
+ CurrencyCode["GMD"] = "GMD";
766
+ CurrencyCode["GNF"] = "GNF";
767
+ CurrencyCode["GTQ"] = "GTQ";
768
+ CurrencyCode["GYD"] = "GYD";
769
+ CurrencyCode["HKD"] = "HKD";
770
+ CurrencyCode["HNL"] = "HNL";
771
+ CurrencyCode["HRK"] = "HRK";
772
+ CurrencyCode["HTG"] = "HTG";
773
+ CurrencyCode["HUF"] = "HUF";
774
+ CurrencyCode["IDR"] = "IDR";
775
+ CurrencyCode["ILS"] = "ILS";
776
+ CurrencyCode["INR"] = "INR";
777
+ CurrencyCode["IQD"] = "IQD";
778
+ CurrencyCode["IRR"] = "IRR";
779
+ CurrencyCode["ISK"] = "ISK";
780
+ CurrencyCode["JMD"] = "JMD";
781
+ CurrencyCode["JOD"] = "JOD";
782
+ CurrencyCode["JPY"] = "JPY";
783
+ CurrencyCode["KES"] = "KES";
784
+ CurrencyCode["KGS"] = "KGS";
785
+ CurrencyCode["KHR"] = "KHR";
786
+ CurrencyCode["KMF"] = "KMF";
787
+ CurrencyCode["KPW"] = "KPW";
788
+ CurrencyCode["KRW"] = "KRW";
789
+ CurrencyCode["KWD"] = "KWD";
790
+ CurrencyCode["KYD"] = "KYD";
791
+ CurrencyCode["KZT"] = "KZT";
792
+ CurrencyCode["LAK"] = "LAK";
793
+ CurrencyCode["LBP"] = "LBP";
794
+ CurrencyCode["LKR"] = "LKR";
795
+ CurrencyCode["LRD"] = "LRD";
796
+ CurrencyCode["LSL"] = "LSL";
797
+ CurrencyCode["LYD"] = "LYD";
798
+ CurrencyCode["MAD"] = "MAD";
799
+ CurrencyCode["MDL"] = "MDL";
800
+ CurrencyCode["MGA"] = "MGA";
801
+ CurrencyCode["MKD"] = "MKD";
802
+ CurrencyCode["MMK"] = "MMK";
803
+ CurrencyCode["MNT"] = "MNT";
804
+ CurrencyCode["MOP"] = "MOP";
805
+ CurrencyCode["MRU"] = "MRU";
806
+ CurrencyCode["MUR"] = "MUR";
807
+ CurrencyCode["MVR"] = "MVR";
808
+ CurrencyCode["MWK"] = "MWK";
809
+ CurrencyCode["MXN"] = "MXN";
810
+ CurrencyCode["MYR"] = "MYR";
811
+ CurrencyCode["MZN"] = "MZN";
812
+ CurrencyCode["NAD"] = "NAD";
813
+ CurrencyCode["NGN"] = "NGN";
814
+ CurrencyCode["NIO"] = "NIO";
815
+ CurrencyCode["NOK"] = "NOK";
816
+ CurrencyCode["NPR"] = "NPR";
817
+ CurrencyCode["NZD"] = "NZD";
818
+ CurrencyCode["OMR"] = "OMR";
819
+ CurrencyCode["PAB"] = "PAB";
820
+ CurrencyCode["PEN"] = "PEN";
821
+ CurrencyCode["PGK"] = "PGK";
822
+ CurrencyCode["PHP"] = "PHP";
823
+ CurrencyCode["PKR"] = "PKR";
824
+ CurrencyCode["PLN"] = "PLN";
825
+ CurrencyCode["PYG"] = "PYG";
826
+ CurrencyCode["QAR"] = "QAR";
827
+ CurrencyCode["RON"] = "RON";
828
+ CurrencyCode["RSD"] = "RSD";
829
+ CurrencyCode["RUB"] = "RUB";
830
+ CurrencyCode["RWF"] = "RWF";
831
+ CurrencyCode["SAR"] = "SAR";
832
+ CurrencyCode["SBD"] = "SBD";
833
+ CurrencyCode["SCR"] = "SCR";
834
+ CurrencyCode["SDG"] = "SDG";
835
+ CurrencyCode["SEK"] = "SEK";
836
+ CurrencyCode["SGD"] = "SGD";
837
+ CurrencyCode["SHP"] = "SHP";
838
+ CurrencyCode["SLL"] = "SLL";
839
+ CurrencyCode["SOS"] = "SOS";
840
+ CurrencyCode["SRD"] = "SRD";
841
+ CurrencyCode["SSP"] = "SSP";
842
+ CurrencyCode["STN"] = "STN";
843
+ CurrencyCode["SVC"] = "SVC";
844
+ CurrencyCode["SYP"] = "SYP";
845
+ CurrencyCode["SZL"] = "SZL";
846
+ CurrencyCode["THB"] = "THB";
847
+ CurrencyCode["TJS"] = "TJS";
848
+ CurrencyCode["TMT"] = "TMT";
849
+ CurrencyCode["TND"] = "TND";
850
+ CurrencyCode["TOP"] = "TOP";
851
+ CurrencyCode["TRY"] = "TRY";
852
+ CurrencyCode["TTD"] = "TTD";
853
+ CurrencyCode["TWD"] = "TWD";
854
+ CurrencyCode["TZS"] = "TZS";
855
+ CurrencyCode["UAH"] = "UAH";
856
+ CurrencyCode["UGX"] = "UGX";
857
+ CurrencyCode["USD"] = "USD";
858
+ CurrencyCode["UYU"] = "UYU";
859
+ CurrencyCode["UZS"] = "UZS";
860
+ CurrencyCode["VES"] = "VES";
861
+ CurrencyCode["VND"] = "VND";
862
+ CurrencyCode["VUV"] = "VUV";
863
+ CurrencyCode["WST"] = "WST";
864
+ CurrencyCode["XAF"] = "XAF";
865
+ CurrencyCode["XCD"] = "XCD";
866
+ CurrencyCode["XOF"] = "XOF";
867
+ CurrencyCode["XPF"] = "XPF";
868
+ CurrencyCode["YER"] = "YER";
869
+ CurrencyCode["ZAR"] = "ZAR";
870
+ CurrencyCode["ZMW"] = "ZMW";
871
+ CurrencyCode["ZWL"] = "ZWL";
872
+ })(CurrencyCode || (exports.CurrencyCode = CurrencyCode = {}));
873
+ var HistoryEntryType;
874
+ (function (HistoryEntryType) {
875
+ HistoryEntryType["CUSTOMER_REGISTERED"] = "CUSTOMER_REGISTERED";
876
+ HistoryEntryType["CUSTOMER_VERIFIED"] = "CUSTOMER_VERIFIED";
877
+ HistoryEntryType["CUSTOMER_DETAIL_UPDATED"] = "CUSTOMER_DETAIL_UPDATED";
878
+ HistoryEntryType["CUSTOMER_ADDED_TO_GROUP"] = "CUSTOMER_ADDED_TO_GROUP";
879
+ HistoryEntryType["CUSTOMER_REMOVED_FROM_GROUP"] = "CUSTOMER_REMOVED_FROM_GROUP";
880
+ HistoryEntryType["CUSTOMER_ADDRESS_CREATED"] = "CUSTOMER_ADDRESS_CREATED";
881
+ HistoryEntryType["CUSTOMER_ADDRESS_UPDATED"] = "CUSTOMER_ADDRESS_UPDATED";
882
+ HistoryEntryType["CUSTOMER_ADDRESS_DELETED"] = "CUSTOMER_ADDRESS_DELETED";
883
+ HistoryEntryType["CUSTOMER_PASSWORD_UPDATED"] = "CUSTOMER_PASSWORD_UPDATED";
884
+ HistoryEntryType["CUSTOMER_PASSWORD_RESET_REQUESTED"] = "CUSTOMER_PASSWORD_RESET_REQUESTED";
885
+ HistoryEntryType["CUSTOMER_PASSWORD_RESET_VERIFIED"] = "CUSTOMER_PASSWORD_RESET_VERIFIED";
886
+ HistoryEntryType["CUSTOMER_EMAIL_UPDATE_REQUESTED"] = "CUSTOMER_EMAIL_UPDATE_REQUESTED";
887
+ HistoryEntryType["CUSTOMER_EMAIL_UPDATE_VERIFIED"] = "CUSTOMER_EMAIL_UPDATE_VERIFIED";
888
+ HistoryEntryType["CUSTOMER_NOTE"] = "CUSTOMER_NOTE";
889
+ HistoryEntryType["ORDER_STATE_TRANSITION"] = "ORDER_STATE_TRANSITION";
890
+ HistoryEntryType["ORDER_PAYMENT_TRANSITION"] = "ORDER_PAYMENT_TRANSITION";
891
+ HistoryEntryType["ORDER_FULFILLMENT"] = "ORDER_FULFILLMENT";
892
+ HistoryEntryType["ORDER_CANCELLATION"] = "ORDER_CANCELLATION";
893
+ HistoryEntryType["ORDER_REFUND_TRANSITION"] = "ORDER_REFUND_TRANSITION";
894
+ HistoryEntryType["ORDER_FULFILLMENT_TRANSITION"] = "ORDER_FULFILLMENT_TRANSITION";
895
+ HistoryEntryType["ORDER_NOTE"] = "ORDER_NOTE";
896
+ HistoryEntryType["ORDER_COUPON_APPLIED"] = "ORDER_COUPON_APPLIED";
897
+ HistoryEntryType["ORDER_COUPON_REMOVED"] = "ORDER_COUPON_REMOVED";
898
+ HistoryEntryType["ORDER_MODIFIED"] = "ORDER_MODIFIED";
899
+ HistoryEntryType["ORDER_CUSTOMER_UPDATED"] = "ORDER_CUSTOMER_UPDATED";
900
+ })(HistoryEntryType || (exports.HistoryEntryType = HistoryEntryType = {}));
901
+ /** @description
902
+ Languages in the form of a ISO 639-1 language code with optional
903
+ region or script modifier (e.g. de_AT). The selection available is based
904
+ on the [Unicode CLDR summary list](https://unicode-org.github.io/cldr-staging/charts/37/summary/root.html)
905
+ and includes the major spoken languages of the world and any widely-used variants.
906
+
907
+ @docsCategory common */
908
+ var LanguageCode;
909
+ (function (LanguageCode) {
910
+ LanguageCode["af"] = "af";
911
+ LanguageCode["ak"] = "ak";
912
+ LanguageCode["sq"] = "sq";
913
+ LanguageCode["am"] = "am";
914
+ LanguageCode["ar"] = "ar";
915
+ LanguageCode["hy"] = "hy";
916
+ LanguageCode["as"] = "as";
917
+ LanguageCode["az"] = "az";
918
+ LanguageCode["bm"] = "bm";
919
+ LanguageCode["bn"] = "bn";
920
+ LanguageCode["eu"] = "eu";
921
+ LanguageCode["be"] = "be";
922
+ LanguageCode["bs"] = "bs";
923
+ LanguageCode["br"] = "br";
924
+ LanguageCode["bg"] = "bg";
925
+ LanguageCode["my"] = "my";
926
+ LanguageCode["ca"] = "ca";
927
+ LanguageCode["ce"] = "ce";
928
+ LanguageCode["zh"] = "zh";
929
+ LanguageCode["zh_Hans"] = "zh_Hans";
930
+ LanguageCode["zh_Hant"] = "zh_Hant";
931
+ LanguageCode["cu"] = "cu";
932
+ LanguageCode["kw"] = "kw";
933
+ LanguageCode["co"] = "co";
934
+ LanguageCode["hr"] = "hr";
935
+ LanguageCode["cs"] = "cs";
936
+ LanguageCode["da"] = "da";
937
+ LanguageCode["nl"] = "nl";
938
+ LanguageCode["nl_BE"] = "nl_BE";
939
+ LanguageCode["dz"] = "dz";
940
+ LanguageCode["en"] = "en";
941
+ LanguageCode["en_AU"] = "en_AU";
942
+ LanguageCode["en_CA"] = "en_CA";
943
+ LanguageCode["en_GB"] = "en_GB";
944
+ LanguageCode["en_US"] = "en_US";
945
+ LanguageCode["eo"] = "eo";
946
+ LanguageCode["et"] = "et";
947
+ LanguageCode["ee"] = "ee";
948
+ LanguageCode["fo"] = "fo";
949
+ LanguageCode["fi"] = "fi";
950
+ LanguageCode["fr"] = "fr";
951
+ LanguageCode["fr_CA"] = "fr_CA";
952
+ LanguageCode["fr_CH"] = "fr_CH";
953
+ LanguageCode["ff"] = "ff";
954
+ LanguageCode["gl"] = "gl";
955
+ LanguageCode["lg"] = "lg";
956
+ LanguageCode["ka"] = "ka";
957
+ LanguageCode["de"] = "de";
958
+ LanguageCode["de_AT"] = "de_AT";
959
+ LanguageCode["de_CH"] = "de_CH";
960
+ LanguageCode["el"] = "el";
961
+ LanguageCode["gu"] = "gu";
962
+ LanguageCode["ht"] = "ht";
963
+ LanguageCode["ha"] = "ha";
964
+ LanguageCode["he"] = "he";
965
+ LanguageCode["hi"] = "hi";
966
+ LanguageCode["hu"] = "hu";
967
+ LanguageCode["is"] = "is";
968
+ LanguageCode["ig"] = "ig";
969
+ LanguageCode["id"] = "id";
970
+ LanguageCode["ia"] = "ia";
971
+ LanguageCode["ga"] = "ga";
972
+ LanguageCode["it"] = "it";
973
+ LanguageCode["ja"] = "ja";
974
+ LanguageCode["jv"] = "jv";
975
+ LanguageCode["kl"] = "kl";
976
+ LanguageCode["kn"] = "kn";
977
+ LanguageCode["ks"] = "ks";
978
+ LanguageCode["kk"] = "kk";
979
+ LanguageCode["km"] = "km";
980
+ LanguageCode["ki"] = "ki";
981
+ LanguageCode["rw"] = "rw";
982
+ LanguageCode["ko"] = "ko";
983
+ LanguageCode["ku"] = "ku";
984
+ LanguageCode["ky"] = "ky";
985
+ LanguageCode["lo"] = "lo";
986
+ LanguageCode["la"] = "la";
987
+ LanguageCode["lv"] = "lv";
988
+ LanguageCode["ln"] = "ln";
989
+ LanguageCode["lt"] = "lt";
990
+ LanguageCode["lu"] = "lu";
991
+ LanguageCode["lb"] = "lb";
992
+ LanguageCode["mk"] = "mk";
993
+ LanguageCode["mg"] = "mg";
994
+ LanguageCode["ms"] = "ms";
995
+ LanguageCode["ml"] = "ml";
996
+ LanguageCode["mt"] = "mt";
997
+ LanguageCode["gv"] = "gv";
998
+ LanguageCode["mi"] = "mi";
999
+ LanguageCode["mr"] = "mr";
1000
+ LanguageCode["mn"] = "mn";
1001
+ LanguageCode["ne"] = "ne";
1002
+ LanguageCode["nd"] = "nd";
1003
+ LanguageCode["se"] = "se";
1004
+ LanguageCode["nb"] = "nb";
1005
+ LanguageCode["nn"] = "nn";
1006
+ LanguageCode["ny"] = "ny";
1007
+ LanguageCode["or"] = "or";
1008
+ LanguageCode["om"] = "om";
1009
+ LanguageCode["os"] = "os";
1010
+ LanguageCode["ps"] = "ps";
1011
+ LanguageCode["fa"] = "fa";
1012
+ LanguageCode["fa_AF"] = "fa_AF";
1013
+ LanguageCode["pl"] = "pl";
1014
+ LanguageCode["pt"] = "pt";
1015
+ LanguageCode["pt_BR"] = "pt_BR";
1016
+ LanguageCode["pt_PT"] = "pt_PT";
1017
+ LanguageCode["pa"] = "pa";
1018
+ LanguageCode["qu"] = "qu";
1019
+ LanguageCode["ro"] = "ro";
1020
+ LanguageCode["ro_MD"] = "ro_MD";
1021
+ LanguageCode["rm"] = "rm";
1022
+ LanguageCode["rn"] = "rn";
1023
+ LanguageCode["ru"] = "ru";
1024
+ LanguageCode["sm"] = "sm";
1025
+ LanguageCode["sg"] = "sg";
1026
+ LanguageCode["sa"] = "sa";
1027
+ LanguageCode["gd"] = "gd";
1028
+ LanguageCode["sr"] = "sr";
1029
+ LanguageCode["sn"] = "sn";
1030
+ LanguageCode["ii"] = "ii";
1031
+ LanguageCode["sd"] = "sd";
1032
+ LanguageCode["si"] = "si";
1033
+ LanguageCode["sk"] = "sk";
1034
+ LanguageCode["sl"] = "sl";
1035
+ LanguageCode["so"] = "so";
1036
+ LanguageCode["st"] = "st";
1037
+ LanguageCode["es"] = "es";
1038
+ LanguageCode["es_ES"] = "es_ES";
1039
+ LanguageCode["es_MX"] = "es_MX";
1040
+ LanguageCode["su"] = "su";
1041
+ LanguageCode["sw"] = "sw";
1042
+ LanguageCode["sw_CD"] = "sw_CD";
1043
+ LanguageCode["sv"] = "sv";
1044
+ LanguageCode["tg"] = "tg";
1045
+ LanguageCode["ta"] = "ta";
1046
+ LanguageCode["tt"] = "tt";
1047
+ LanguageCode["te"] = "te";
1048
+ LanguageCode["th"] = "th";
1049
+ LanguageCode["bo"] = "bo";
1050
+ LanguageCode["ti"] = "ti";
1051
+ LanguageCode["to"] = "to";
1052
+ LanguageCode["tr"] = "tr";
1053
+ LanguageCode["tk"] = "tk";
1054
+ LanguageCode["uk"] = "uk";
1055
+ LanguageCode["ur"] = "ur";
1056
+ LanguageCode["ug"] = "ug";
1057
+ LanguageCode["uz"] = "uz";
1058
+ LanguageCode["vi"] = "vi";
1059
+ LanguageCode["vo"] = "vo";
1060
+ LanguageCode["cy"] = "cy";
1061
+ LanguageCode["fy"] = "fy";
1062
+ LanguageCode["wo"] = "wo";
1063
+ LanguageCode["xh"] = "xh";
1064
+ LanguageCode["yi"] = "yi";
1065
+ LanguageCode["yo"] = "yo";
1066
+ LanguageCode["zu"] = "zu";
1067
+ })(LanguageCode || (exports.LanguageCode = LanguageCode = {}));
1068
+ var OrderType;
1069
+ (function (OrderType) {
1070
+ OrderType["Regular"] = "Regular";
1071
+ OrderType["Seller"] = "Seller";
1072
+ OrderType["Aggregate"] = "Aggregate";
1073
+ })(OrderType || (exports.OrderType = OrderType = {}));
1074
+ var MetricInterval;
1075
+ (function (MetricInterval) {
1076
+ MetricInterval["Daily"] = "Daily";
1077
+ })(MetricInterval || (exports.MetricInterval = MetricInterval = {}));
1078
+ var MetricType;
1079
+ (function (MetricType) {
1080
+ MetricType["OrderCount"] = "OrderCount";
1081
+ MetricType["OrderTotal"] = "OrderTotal";
1082
+ MetricType["AverageOrderValue"] = "AverageOrderValue";
1083
+ })(MetricType || (exports.MetricType = MetricType = {}));
1084
+ var BetterMetricInterval;
1085
+ (function (BetterMetricInterval) {
1086
+ BetterMetricInterval["Weekly"] = "Weekly";
1087
+ BetterMetricInterval["Monthly"] = "Monthly";
1088
+ BetterMetricInterval["Yearly"] = "Yearly";
1089
+ BetterMetricInterval["Custom"] = "Custom";
1090
+ BetterMetricInterval["ThisWeek"] = "ThisWeek";
1091
+ BetterMetricInterval["LastWeek"] = "LastWeek";
1092
+ BetterMetricInterval["ThisMonth"] = "ThisMonth";
1093
+ BetterMetricInterval["LastMonth"] = "LastMonth";
1094
+ })(BetterMetricInterval || (exports.BetterMetricInterval = BetterMetricInterval = {}));
1095
+ var BetterMetricType;
1096
+ (function (BetterMetricType) {
1097
+ BetterMetricType["OrderCount"] = "OrderCount";
1098
+ BetterMetricType["OrderTotal"] = "OrderTotal";
1099
+ BetterMetricType["AverageOrderValue"] = "AverageOrderValue";
1100
+ BetterMetricType["OrderTotalProductsCount"] = "OrderTotalProductsCount";
1101
+ })(BetterMetricType || (exports.BetterMetricType = BetterMetricType = {}));