@deenruv/product-badges-plugin 1.0.17-dev.4 → 1.0.17-dev.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin-server/extensions/badge.extension.d.ts +21 -0
- package/dist/plugin-server/resolvers/badge-admin.resolver.d.ts +5 -5
- package/dist/plugin-server/services/badge.service.d.ts +3 -3
- package/dist/plugin-server/zeus/const.js +816 -729
- package/dist/plugin-server/zeus/index.d.ts +5948 -4279
- package/dist/plugin-server/zeus/index.js +131 -97
- package/dist/plugin-server/zeus/typedDocumentNode.d.ts +2 -2
- package/dist/plugin-ui/graphql/mutations.d.ts +2 -2
- package/dist/plugin-ui/zeus/const.js +816 -729
- package/dist/plugin-ui/zeus/index.d.ts +5948 -4279
- package/dist/plugin-ui/zeus/index.js +131 -97
- package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +2 -2
- package/dist/plugin-ui/zeus/typedDocumentNode.js +2 -2
- package/package.json +8 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.ChartMetricType = exports.MetricIntervalType = exports.MetricRangeType = 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
5
|
const const_1 = require("./const");
|
|
6
|
-
exports.HOST = "
|
|
6
|
+
exports.HOST = "Specify host";
|
|
7
7
|
exports.HEADERS = {};
|
|
8
8
|
const apiSubscription = (options) => (query) => {
|
|
9
9
|
var _a, _b, _c;
|
|
10
10
|
try {
|
|
11
|
-
const queryString = options[0] +
|
|
12
|
-
const wsString = queryString.replace(
|
|
11
|
+
const queryString = options[0] + "?query=" + encodeURIComponent(query);
|
|
12
|
+
const wsString = queryString.replace("http", "ws");
|
|
13
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
14
|
const webSocketOptions = ((_c = options[1]) === null || _c === void 0 ? void 0 : _c.websocket) || [host];
|
|
15
15
|
const ws = new WebSocket(...webSocketOptions);
|
|
@@ -36,7 +36,7 @@ const apiSubscription = (options) => (query) => {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
catch (_d) {
|
|
39
|
-
throw new Error(
|
|
39
|
+
throw new Error("No websockets implemented");
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
exports.apiSubscription = apiSubscription;
|
|
@@ -60,7 +60,7 @@ const handleFetchResponse = (response) => {
|
|
|
60
60
|
};
|
|
61
61
|
const apiFetch = (options) => (query, variables = {}) => {
|
|
62
62
|
const fetchOptions = options[1] || {};
|
|
63
|
-
if (fetchOptions.method && fetchOptions.method ===
|
|
63
|
+
if (fetchOptions.method && fetchOptions.method === "GET") {
|
|
64
64
|
return fetch(`${options[0]}?query=${encodeURIComponent(query)}`, fetchOptions)
|
|
65
65
|
.then(handleFetchResponse)
|
|
66
66
|
.then((response) => {
|
|
@@ -70,8 +70,8 @@ const apiFetch = (options) => (query, variables = {}) => {
|
|
|
70
70
|
return response.data;
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
return fetch(`${options[0]}`, Object.assign({ body: JSON.stringify({ query, variables }), method:
|
|
74
|
-
|
|
73
|
+
return fetch(`${options[0]}`, Object.assign({ body: JSON.stringify({ query, variables }), method: "POST", headers: {
|
|
74
|
+
"Content-Type": "application/json",
|
|
75
75
|
} }, fetchOptions))
|
|
76
76
|
.then(handleFetchResponse)
|
|
77
77
|
.then((response) => {
|
|
@@ -83,17 +83,17 @@ const apiFetch = (options) => (query, variables = {}) => {
|
|
|
83
83
|
};
|
|
84
84
|
exports.apiFetch = apiFetch;
|
|
85
85
|
const InternalsBuildQuery = ({ ops, props, returns, options, scalars, }) => {
|
|
86
|
-
const ibb = (k, o, p =
|
|
86
|
+
const ibb = (k, o, p = "", root = true, vars = []) => {
|
|
87
87
|
var _a;
|
|
88
88
|
const keyForPath = (0, exports.purifyGraphQLKey)(k);
|
|
89
89
|
const newPath = [p, keyForPath].join(exports.SEPARATOR);
|
|
90
90
|
if (!o) {
|
|
91
|
-
return
|
|
91
|
+
return "";
|
|
92
92
|
}
|
|
93
|
-
if (typeof o ===
|
|
93
|
+
if (typeof o === "boolean" || typeof o === "number") {
|
|
94
94
|
return k;
|
|
95
95
|
}
|
|
96
|
-
if (typeof o ===
|
|
96
|
+
if (typeof o === "string") {
|
|
97
97
|
return `${k} ${o}`;
|
|
98
98
|
}
|
|
99
99
|
if (Array.isArray(o)) {
|
|
@@ -106,29 +106,32 @@ const InternalsBuildQuery = ({ ops, props, returns, options, scalars, }) => {
|
|
|
106
106
|
})(o[0], newPath);
|
|
107
107
|
return `${ibb(args ? `${k}(${args})` : k, o[1], p, false, vars)}`;
|
|
108
108
|
}
|
|
109
|
-
if (k ===
|
|
109
|
+
if (k === "__alias") {
|
|
110
110
|
return Object.entries(o)
|
|
111
111
|
.map(([alias, objectUnderAlias]) => {
|
|
112
|
-
if (typeof objectUnderAlias !==
|
|
113
|
-
|
|
112
|
+
if (typeof objectUnderAlias !== "object" ||
|
|
113
|
+
Array.isArray(objectUnderAlias)) {
|
|
114
|
+
throw new Error("Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}");
|
|
114
115
|
}
|
|
115
116
|
const operationName = Object.keys(objectUnderAlias)[0];
|
|
116
117
|
const operation = objectUnderAlias[operationName];
|
|
117
118
|
return ibb(`${alias}:${operationName}`, operation, p, false, vars);
|
|
118
119
|
})
|
|
119
|
-
.join(
|
|
120
|
+
.join("\n");
|
|
120
121
|
}
|
|
121
|
-
const hasOperationName = root && (options === null || options === void 0 ? void 0 : options.operationName) ?
|
|
122
|
-
const keyForDirectives = (_a = o.__directives) !== null && _a !== void 0 ? _a :
|
|
122
|
+
const hasOperationName = root && (options === null || options === void 0 ? void 0 : options.operationName) ? " " + options.operationName : "";
|
|
123
|
+
const keyForDirectives = (_a = o.__directives) !== null && _a !== void 0 ? _a : "";
|
|
123
124
|
const query = `{${Object.entries(o)
|
|
124
|
-
.filter(([k]) => k !==
|
|
125
|
+
.filter(([k]) => k !== "__directives")
|
|
125
126
|
.map((e) => ibb(...e, [p, `field<>${keyForPath}`].join(exports.SEPARATOR), false, vars))
|
|
126
|
-
.join(
|
|
127
|
+
.join("\n")}}`;
|
|
127
128
|
if (!root) {
|
|
128
129
|
return `${k} ${keyForDirectives}${hasOperationName} ${query}`;
|
|
129
130
|
}
|
|
130
|
-
const varsString = vars
|
|
131
|
-
|
|
131
|
+
const varsString = vars
|
|
132
|
+
.map((v) => `${v.name}: ${v.graphQLType}`)
|
|
133
|
+
.join(", ");
|
|
134
|
+
return `${k} ${keyForDirectives}${hasOperationName}${varsString ? `(${varsString})` : ""} ${query}`;
|
|
132
135
|
};
|
|
133
136
|
return ibb;
|
|
134
137
|
};
|
|
@@ -197,17 +200,31 @@ exports.Selector = Selector;
|
|
|
197
200
|
const TypeFromSelector = (key) => key && (0, exports.ZeusSelect)();
|
|
198
201
|
exports.TypeFromSelector = TypeFromSelector;
|
|
199
202
|
exports.Gql = (0, exports.Chain)(exports.HOST, {
|
|
200
|
-
headers: Object.assign({
|
|
203
|
+
headers: Object.assign({ "Content-Type": "application/json" }, exports.HEADERS),
|
|
201
204
|
});
|
|
202
205
|
exports.ZeusScalars = (0, exports.ZeusSelect)();
|
|
203
206
|
const fields = (k) => {
|
|
204
207
|
const t = const_1.ReturnTypes[k];
|
|
208
|
+
const fnType = k in const_1.AllTypesProps
|
|
209
|
+
? const_1.AllTypesProps[k]
|
|
210
|
+
: undefined;
|
|
211
|
+
const hasFnTypes = typeof fnType === "object" ? fnType : undefined;
|
|
205
212
|
const o = Object.fromEntries(Object.entries(t)
|
|
206
|
-
.filter(([, value]) => {
|
|
213
|
+
.filter(([k, value]) => {
|
|
214
|
+
const isFunctionType = hasFnTypes &&
|
|
215
|
+
k in hasFnTypes &&
|
|
216
|
+
!!hasFnTypes[k];
|
|
217
|
+
if (isFunctionType)
|
|
218
|
+
return false;
|
|
207
219
|
const isReturnType = const_1.ReturnTypes[value];
|
|
208
|
-
if (!isReturnType
|
|
220
|
+
if (!isReturnType)
|
|
221
|
+
return true;
|
|
222
|
+
if (typeof isReturnType !== "string")
|
|
223
|
+
return false;
|
|
224
|
+
if (isReturnType.startsWith("scalar.")) {
|
|
209
225
|
return true;
|
|
210
226
|
}
|
|
227
|
+
return false;
|
|
211
228
|
})
|
|
212
229
|
.map(([key]) => [key, true]));
|
|
213
230
|
return o;
|
|
@@ -241,12 +258,15 @@ const traverseResponse = ({ resolvers, scalarPaths, }) => {
|
|
|
241
258
|
const scalarPathString = p.join(exports.SEPARATOR);
|
|
242
259
|
const currentScalarString = scalarPaths[scalarPathString];
|
|
243
260
|
if (currentScalarString) {
|
|
244
|
-
const currentDecoder = (_a = resolvers[currentScalarString.split(
|
|
261
|
+
const currentDecoder = (_a = resolvers[currentScalarString.split(".")[1]]) === null || _a === void 0 ? void 0 : _a.decode;
|
|
245
262
|
if (currentDecoder) {
|
|
246
263
|
return currentDecoder(o);
|
|
247
264
|
}
|
|
248
265
|
}
|
|
249
|
-
if (typeof o ===
|
|
266
|
+
if (typeof o === "boolean" ||
|
|
267
|
+
typeof o === "number" ||
|
|
268
|
+
typeof o === "string" ||
|
|
269
|
+
!o) {
|
|
250
270
|
return o;
|
|
251
271
|
}
|
|
252
272
|
const entries = Object.entries(o).map(([k, v]) => [k, ibb(k, v, [...p, (0, exports.purifyGraphQLKey)(k)])]);
|
|
@@ -259,15 +279,15 @@ const traverseResponse = ({ resolvers, scalarPaths, }) => {
|
|
|
259
279
|
return ibb;
|
|
260
280
|
};
|
|
261
281
|
exports.traverseResponse = traverseResponse;
|
|
262
|
-
exports.SEPARATOR =
|
|
282
|
+
exports.SEPARATOR = "|";
|
|
263
283
|
class GraphQLError extends Error {
|
|
264
284
|
constructor(response) {
|
|
265
|
-
super(
|
|
285
|
+
super("");
|
|
266
286
|
this.response = response;
|
|
267
287
|
console.error(response);
|
|
268
288
|
}
|
|
269
289
|
toString() {
|
|
270
|
-
return
|
|
290
|
+
return "GraphQL Response Error";
|
|
271
291
|
}
|
|
272
292
|
}
|
|
273
293
|
exports.GraphQLError = GraphQLError;
|
|
@@ -277,7 +297,7 @@ const ExtractScalar = (mappedParts, returns) => {
|
|
|
277
297
|
}
|
|
278
298
|
const oKey = mappedParts[0];
|
|
279
299
|
const returnP1 = returns[oKey];
|
|
280
|
-
if (typeof returnP1 ===
|
|
300
|
+
if (typeof returnP1 === "object") {
|
|
281
301
|
const returnP2 = returnP1[mappedParts[1]];
|
|
282
302
|
if (returnP2) {
|
|
283
303
|
return ExtractScalar([returnP2, ...mappedParts.slice(2)], returns);
|
|
@@ -286,15 +306,17 @@ const ExtractScalar = (mappedParts, returns) => {
|
|
|
286
306
|
}
|
|
287
307
|
return returnP1;
|
|
288
308
|
};
|
|
289
|
-
const PrepareScalarPaths = ({ ops, returns }) => {
|
|
309
|
+
const PrepareScalarPaths = ({ ops, returns, }) => {
|
|
290
310
|
const ibb = (k, originalKey, o, p = [], pOriginals = [], root = true) => {
|
|
291
311
|
if (!o) {
|
|
292
312
|
return;
|
|
293
313
|
}
|
|
294
|
-
if (typeof o ===
|
|
314
|
+
if (typeof o === "boolean" ||
|
|
315
|
+
typeof o === "number" ||
|
|
316
|
+
typeof o === "string") {
|
|
295
317
|
const extractionArray = [...pOriginals, originalKey];
|
|
296
318
|
const isScalar = ExtractScalar(extractionArray, returns);
|
|
297
|
-
if (isScalar === null || isScalar === void 0 ? void 0 : isScalar.startsWith(
|
|
319
|
+
if (isScalar === null || isScalar === void 0 ? void 0 : isScalar.startsWith("scalar")) {
|
|
298
320
|
const partOfTree = {
|
|
299
321
|
[[...p, k].join(exports.SEPARATOR)]: isScalar,
|
|
300
322
|
};
|
|
@@ -305,11 +327,12 @@ const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
305
327
|
if (Array.isArray(o)) {
|
|
306
328
|
return ibb(k, k, o[1], p, pOriginals, false);
|
|
307
329
|
}
|
|
308
|
-
if (k ===
|
|
330
|
+
if (k === "__alias") {
|
|
309
331
|
return Object.entries(o)
|
|
310
332
|
.map(([alias, objectUnderAlias]) => {
|
|
311
|
-
if (typeof objectUnderAlias !==
|
|
312
|
-
|
|
333
|
+
if (typeof objectUnderAlias !== "object" ||
|
|
334
|
+
Array.isArray(objectUnderAlias)) {
|
|
335
|
+
throw new Error("Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}");
|
|
313
336
|
}
|
|
314
337
|
const operationName = Object.keys(objectUnderAlias)[0];
|
|
315
338
|
const operation = objectUnderAlias[operationName];
|
|
@@ -319,59 +342,63 @@ const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
319
342
|
}
|
|
320
343
|
const keyName = root ? ops[k] : k;
|
|
321
344
|
return Object.entries(o)
|
|
322
|
-
.filter(([k]) => k !==
|
|
345
|
+
.filter(([k]) => k !== "__directives")
|
|
323
346
|
.map(([k, v]) => {
|
|
324
347
|
// Inline fragments shouldn't be added to the path as they aren't a field
|
|
325
348
|
const isInlineFragment = originalKey.match(/^...\s*on/) != null;
|
|
326
|
-
return ibb(k, k, v, isInlineFragment ? p : [...p, (0, exports.purifyGraphQLKey)(keyName || k)], isInlineFragment
|
|
349
|
+
return ibb(k, k, v, isInlineFragment ? p : [...p, (0, exports.purifyGraphQLKey)(keyName || k)], isInlineFragment
|
|
350
|
+
? pOriginals
|
|
351
|
+
: [...pOriginals, (0, exports.purifyGraphQLKey)(originalKey)], false);
|
|
327
352
|
})
|
|
328
353
|
.reduce((a, b) => (Object.assign(Object.assign({}, a), b)));
|
|
329
354
|
};
|
|
330
355
|
return ibb;
|
|
331
356
|
};
|
|
332
357
|
exports.PrepareScalarPaths = PrepareScalarPaths;
|
|
333
|
-
const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g,
|
|
358
|
+
const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g, "").replace(/^[^:]*\:/g, "");
|
|
334
359
|
exports.purifyGraphQLKey = purifyGraphQLKey;
|
|
335
360
|
const mapPart = (p) => {
|
|
336
|
-
const [isArg, isField] = p.split(
|
|
361
|
+
const [isArg, isField] = p.split("<>");
|
|
337
362
|
if (isField) {
|
|
338
363
|
return {
|
|
339
364
|
v: isField,
|
|
340
|
-
__type:
|
|
365
|
+
__type: "field",
|
|
341
366
|
};
|
|
342
367
|
}
|
|
343
368
|
return {
|
|
344
369
|
v: isArg,
|
|
345
|
-
__type:
|
|
370
|
+
__type: "arg",
|
|
346
371
|
};
|
|
347
372
|
};
|
|
348
373
|
const ResolveFromPath = (props, returns, ops) => {
|
|
349
374
|
const ResolvePropsType = (mappedParts) => {
|
|
350
375
|
const oKey = ops[mappedParts[0].v];
|
|
351
376
|
const propsP1 = oKey ? props[oKey] : props[mappedParts[0].v];
|
|
352
|
-
if (propsP1 ===
|
|
353
|
-
return
|
|
377
|
+
if (propsP1 === "enum" && mappedParts.length === 1) {
|
|
378
|
+
return "enum";
|
|
354
379
|
}
|
|
355
|
-
if (typeof propsP1 ===
|
|
380
|
+
if (typeof propsP1 === "string" &&
|
|
381
|
+
propsP1.startsWith("scalar.") &&
|
|
382
|
+
mappedParts.length === 1) {
|
|
356
383
|
return propsP1;
|
|
357
384
|
}
|
|
358
|
-
if (typeof propsP1 ===
|
|
385
|
+
if (typeof propsP1 === "object") {
|
|
359
386
|
if (mappedParts.length < 2) {
|
|
360
|
-
return
|
|
387
|
+
return "not";
|
|
361
388
|
}
|
|
362
389
|
const propsP2 = propsP1[mappedParts[1].v];
|
|
363
|
-
if (typeof propsP2 ===
|
|
390
|
+
if (typeof propsP2 === "string") {
|
|
364
391
|
return rpp(`${propsP2}${exports.SEPARATOR}${mappedParts
|
|
365
392
|
.slice(2)
|
|
366
393
|
.map((mp) => mp.v)
|
|
367
394
|
.join(exports.SEPARATOR)}`);
|
|
368
395
|
}
|
|
369
|
-
if (typeof propsP2 ===
|
|
396
|
+
if (typeof propsP2 === "object") {
|
|
370
397
|
if (mappedParts.length < 3) {
|
|
371
|
-
return
|
|
398
|
+
return "not";
|
|
372
399
|
}
|
|
373
400
|
const propsP3 = propsP2[mappedParts[2].v];
|
|
374
|
-
if (propsP3 && mappedParts[2].__type ===
|
|
401
|
+
if (propsP3 && mappedParts[2].__type === "arg") {
|
|
375
402
|
return rpp(`${propsP3}${exports.SEPARATOR}${mappedParts
|
|
376
403
|
.slice(3)
|
|
377
404
|
.map((mp) => mp.v)
|
|
@@ -382,13 +409,13 @@ const ResolveFromPath = (props, returns, ops) => {
|
|
|
382
409
|
};
|
|
383
410
|
const ResolveReturnType = (mappedParts) => {
|
|
384
411
|
if (mappedParts.length === 0) {
|
|
385
|
-
return
|
|
412
|
+
return "not";
|
|
386
413
|
}
|
|
387
414
|
const oKey = ops[mappedParts[0].v];
|
|
388
415
|
const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
|
|
389
|
-
if (typeof returnP1 ===
|
|
416
|
+
if (typeof returnP1 === "object") {
|
|
390
417
|
if (mappedParts.length < 2)
|
|
391
|
-
return
|
|
418
|
+
return "not";
|
|
392
419
|
const returnP2 = returnP1[mappedParts[1].v];
|
|
393
420
|
if (returnP2) {
|
|
394
421
|
return rpp(`${returnP2}${exports.SEPARATOR}${mappedParts
|
|
@@ -409,17 +436,19 @@ const ResolveFromPath = (props, returns, ops) => {
|
|
|
409
436
|
if (returnP1) {
|
|
410
437
|
return returnP1;
|
|
411
438
|
}
|
|
412
|
-
return
|
|
439
|
+
return "not";
|
|
413
440
|
};
|
|
414
441
|
return rpp;
|
|
415
442
|
};
|
|
416
443
|
exports.ResolveFromPath = ResolveFromPath;
|
|
417
444
|
const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
|
|
418
|
-
const arb = (a, p =
|
|
445
|
+
const arb = (a, p = "", root = true) => {
|
|
419
446
|
var _a, _b;
|
|
420
|
-
if (typeof a ===
|
|
447
|
+
if (typeof a === "string") {
|
|
421
448
|
if (a.startsWith(exports.START_VAR_NAME)) {
|
|
422
|
-
const [varName, graphQLType] = a
|
|
449
|
+
const [varName, graphQLType] = a
|
|
450
|
+
.replace(exports.START_VAR_NAME, "$")
|
|
451
|
+
.split(exports.GRAPHQL_TYPE_SEPARATOR);
|
|
423
452
|
const v = vars.find((v) => v.name === varName);
|
|
424
453
|
if (!v) {
|
|
425
454
|
vars.push({
|
|
@@ -436,28 +465,29 @@ const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
|
|
|
436
465
|
}
|
|
437
466
|
}
|
|
438
467
|
const checkType = (0, exports.ResolveFromPath)(props, returns, ops)(p);
|
|
439
|
-
if (checkType.startsWith(
|
|
440
|
-
|
|
441
|
-
const
|
|
468
|
+
if (checkType.startsWith("scalar.")) {
|
|
469
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
470
|
+
const [_, ...splittedScalar] = checkType.split(".");
|
|
471
|
+
const scalarKey = splittedScalar.join(".");
|
|
442
472
|
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);
|
|
443
473
|
}
|
|
444
474
|
if (Array.isArray(a)) {
|
|
445
|
-
return `[${a.map((arr) => arb(arr, p, false)).join(
|
|
475
|
+
return `[${a.map((arr) => arb(arr, p, false)).join(", ")}]`;
|
|
446
476
|
}
|
|
447
|
-
if (typeof a ===
|
|
448
|
-
if (checkType ===
|
|
477
|
+
if (typeof a === "string") {
|
|
478
|
+
if (checkType === "enum") {
|
|
449
479
|
return a;
|
|
450
480
|
}
|
|
451
481
|
return `${JSON.stringify(a)}`;
|
|
452
482
|
}
|
|
453
|
-
if (typeof a ===
|
|
483
|
+
if (typeof a === "object") {
|
|
454
484
|
if (a === null) {
|
|
455
485
|
return `null`;
|
|
456
486
|
}
|
|
457
487
|
const returnedObjectString = Object.entries(a)
|
|
458
|
-
.filter(([, v]) => typeof v !==
|
|
488
|
+
.filter(([, v]) => typeof v !== "undefined")
|
|
459
489
|
.map(([k, v]) => `${k}: ${arb(v, [p, k].join(exports.SEPARATOR), false)}`)
|
|
460
|
-
.join(
|
|
490
|
+
.join(",\n");
|
|
461
491
|
if (!root) {
|
|
462
492
|
return `{${returnedObjectString}}`;
|
|
463
493
|
}
|
|
@@ -473,7 +503,10 @@ exports.resolverFor = resolverFor;
|
|
|
473
503
|
exports.START_VAR_NAME = `$ZEUS_VAR`;
|
|
474
504
|
exports.GRAPHQL_TYPE_SEPARATOR = `__$GRAPHQL__`;
|
|
475
505
|
const $ = (name, graphqlType) => {
|
|
476
|
-
return (exports.START_VAR_NAME +
|
|
506
|
+
return (exports.START_VAR_NAME +
|
|
507
|
+
name +
|
|
508
|
+
exports.GRAPHQL_TYPE_SEPARATOR +
|
|
509
|
+
graphqlType);
|
|
477
510
|
};
|
|
478
511
|
exports.$ = $;
|
|
479
512
|
/** @description
|
|
@@ -699,6 +732,7 @@ var ErrorCode;
|
|
|
699
732
|
ErrorCode["ORDER_MODIFICATION_ERROR"] = "ORDER_MODIFICATION_ERROR";
|
|
700
733
|
ErrorCode["INELIGIBLE_SHIPPING_METHOD_ERROR"] = "INELIGIBLE_SHIPPING_METHOD_ERROR";
|
|
701
734
|
ErrorCode["NO_ACTIVE_ORDER_ERROR"] = "NO_ACTIVE_ORDER_ERROR";
|
|
735
|
+
ErrorCode["ORDER_MIDDLEWARE_ERROR"] = "ORDER_MIDDLEWARE_ERROR";
|
|
702
736
|
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
703
737
|
var LogicalOperator;
|
|
704
738
|
(function (LogicalOperator) {
|
|
@@ -1070,31 +1104,31 @@ var OrderType;
|
|
|
1070
1104
|
OrderType["Seller"] = "Seller";
|
|
1071
1105
|
OrderType["Aggregate"] = "Aggregate";
|
|
1072
1106
|
})(OrderType || (exports.OrderType = OrderType = {}));
|
|
1073
|
-
var
|
|
1074
|
-
(function (
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
})(
|
|
1094
|
-
var
|
|
1095
|
-
(function (
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
})(
|
|
1107
|
+
var MetricRangeType;
|
|
1108
|
+
(function (MetricRangeType) {
|
|
1109
|
+
MetricRangeType["Today"] = "Today";
|
|
1110
|
+
MetricRangeType["Yesterday"] = "Yesterday";
|
|
1111
|
+
MetricRangeType["ThisWeek"] = "ThisWeek";
|
|
1112
|
+
MetricRangeType["LastWeek"] = "LastWeek";
|
|
1113
|
+
MetricRangeType["ThisMonth"] = "ThisMonth";
|
|
1114
|
+
MetricRangeType["LastMonth"] = "LastMonth";
|
|
1115
|
+
MetricRangeType["ThisYear"] = "ThisYear";
|
|
1116
|
+
MetricRangeType["LastYear"] = "LastYear";
|
|
1117
|
+
MetricRangeType["FirstQuarter"] = "FirstQuarter";
|
|
1118
|
+
MetricRangeType["SecondQuarter"] = "SecondQuarter";
|
|
1119
|
+
MetricRangeType["ThirdQuarter"] = "ThirdQuarter";
|
|
1120
|
+
MetricRangeType["FourthQuarter"] = "FourthQuarter";
|
|
1121
|
+
MetricRangeType["Custom"] = "Custom";
|
|
1122
|
+
})(MetricRangeType || (exports.MetricRangeType = MetricRangeType = {}));
|
|
1123
|
+
var MetricIntervalType;
|
|
1124
|
+
(function (MetricIntervalType) {
|
|
1125
|
+
MetricIntervalType["Day"] = "Day";
|
|
1126
|
+
MetricIntervalType["Hour"] = "Hour";
|
|
1127
|
+
})(MetricIntervalType || (exports.MetricIntervalType = MetricIntervalType = {}));
|
|
1128
|
+
var ChartMetricType;
|
|
1129
|
+
(function (ChartMetricType) {
|
|
1130
|
+
ChartMetricType["OrderCount"] = "OrderCount";
|
|
1131
|
+
ChartMetricType["OrderTotal"] = "OrderTotal";
|
|
1132
|
+
ChartMetricType["AverageOrderValue"] = "AverageOrderValue";
|
|
1133
|
+
ChartMetricType["OrderTotalProductsCount"] = "OrderTotalProductsCount";
|
|
1134
|
+
})(ChartMetricType || (exports.ChartMetricType = ChartMetricType = {}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TypedDocumentNode } from
|
|
2
|
-
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from
|
|
1
|
+
import { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
|
+
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from "./";
|
|
3
3
|
export declare const typedGql: <O extends "query" | "mutation", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions) => TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
|
@@ -9,7 +9,7 @@ export declare const CreateBadgeMutation: import("@graphql-typed-document-node/c
|
|
|
9
9
|
};
|
|
10
10
|
}, {} & {
|
|
11
11
|
input: {
|
|
12
|
-
productId:
|
|
12
|
+
productId: unknown;
|
|
13
13
|
color: string | import("../zeus").Variable<any, string>;
|
|
14
14
|
translations?: import("../zeus").Variable<any, string> | {
|
|
15
15
|
languageCode: import("../zeus").LanguageCode | import("../zeus").Variable<any, string>;
|
|
@@ -23,7 +23,7 @@ export declare const EditBadgeMutation: import("@graphql-typed-document-node/cor
|
|
|
23
23
|
};
|
|
24
24
|
}, {} & {
|
|
25
25
|
input: {
|
|
26
|
-
id:
|
|
26
|
+
id: unknown;
|
|
27
27
|
color?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
28
28
|
translations?: import("../zeus").Variable<any, string> | {
|
|
29
29
|
languageCode: import("../zeus").LanguageCode | import("../zeus").Variable<any, string>;
|