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