@builtbystack/sq-shopify-theme-sdk 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/sq-shopify-theme-sdk.d.ts +32 -18
- package/dist/sq-shopify-theme-sdk.js +882 -853
- package/dist/sq-shopify-theme-sdk.umd.js +51 -42
- package/package.json +4 -2
|
@@ -3,14 +3,14 @@ var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var Te = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
function ze(e, t) {
|
|
5
5
|
for (var n = 0; n < t.length; n++) {
|
|
6
|
-
const
|
|
7
|
-
if (typeof
|
|
8
|
-
for (const
|
|
9
|
-
if (
|
|
10
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
11
|
-
s && Object.defineProperty(e,
|
|
6
|
+
const i = t[n];
|
|
7
|
+
if (typeof i != "string" && !Array.isArray(i)) {
|
|
8
|
+
for (const r in i)
|
|
9
|
+
if (r !== "default" && !(r in e)) {
|
|
10
|
+
const s = Object.getOwnPropertyDescriptor(i, r);
|
|
11
|
+
s && Object.defineProperty(e, r, s.get ? s : {
|
|
12
12
|
enumerable: !0,
|
|
13
|
-
get: () => r
|
|
13
|
+
get: () => i[r]
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -19,8 +19,8 @@ function ze(e, t) {
|
|
|
19
19
|
}
|
|
20
20
|
var ne = function() {
|
|
21
21
|
return ne = Object.assign || function(t) {
|
|
22
|
-
for (var n,
|
|
23
|
-
n = arguments[
|
|
22
|
+
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
|
23
|
+
n = arguments[i];
|
|
24
24
|
for (var s in n)
|
|
25
25
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
26
26
|
}
|
|
@@ -42,32 +42,32 @@ function Qe(e, t) {
|
|
|
42
42
|
}
|
|
43
43
|
const Xe = /\r\n|[\n\r]/g;
|
|
44
44
|
function he(e, t) {
|
|
45
|
-
let n = 0,
|
|
46
|
-
for (const
|
|
47
|
-
if (typeof
|
|
45
|
+
let n = 0, i = 1;
|
|
46
|
+
for (const r of e.body.matchAll(Xe)) {
|
|
47
|
+
if (typeof r.index == "number" || Qe(!1), r.index >= t)
|
|
48
48
|
break;
|
|
49
|
-
n =
|
|
49
|
+
n = r.index + r[0].length, i += 1;
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
|
-
line:
|
|
52
|
+
line: i,
|
|
53
53
|
column: t + 1 - n
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function We(e) {
|
|
57
|
-
return
|
|
57
|
+
return Pe(
|
|
58
58
|
e.source,
|
|
59
59
|
he(e.source, e.start)
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const n = e.locationOffset.column - 1,
|
|
64
|
-
`, m =
|
|
62
|
+
function Pe(e, t) {
|
|
63
|
+
const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${a}:${p}
|
|
64
|
+
`, m = i.split(/\r\n|[\n\r]/g), y = m[r];
|
|
65
65
|
if (y.length > 120) {
|
|
66
66
|
const C = Math.floor(p / 80), A = p % 80, g = [];
|
|
67
67
|
for (let I = 0; I < y.length; I += 80)
|
|
68
68
|
g.push(y.slice(I, I + 80));
|
|
69
69
|
return h + Ae([
|
|
70
|
-
[`${
|
|
70
|
+
[`${a} |`, g[0]],
|
|
71
71
|
...g.slice(1, C + 1).map((I) => ["|", I]),
|
|
72
72
|
["|", "^".padStart(A)],
|
|
73
73
|
["|", g[C + 1]]
|
|
@@ -75,15 +75,15 @@ function Oe(e, t) {
|
|
|
75
75
|
}
|
|
76
76
|
return h + Ae([
|
|
77
77
|
// Lines specified like this: ["prefix", "string"],
|
|
78
|
-
[`${
|
|
79
|
-
[`${
|
|
78
|
+
[`${a - 1} |`, m[r - 1]],
|
|
79
|
+
[`${a} |`, y],
|
|
80
80
|
["|", "^".padStart(p)],
|
|
81
|
-
[`${
|
|
81
|
+
[`${a + 1} |`, m[r + 1]]
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
84
|
function Ae(e) {
|
|
85
|
-
const t = e.filter(([
|
|
86
|
-
return t.map(([
|
|
85
|
+
const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
86
|
+
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
87
87
|
`);
|
|
88
88
|
}
|
|
89
89
|
function Ke(e) {
|
|
@@ -137,15 +137,15 @@ class Ce extends Error {
|
|
|
137
137
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
138
138
|
*/
|
|
139
139
|
constructor(t, ...n) {
|
|
140
|
-
var
|
|
141
|
-
const { nodes:
|
|
140
|
+
var i, r, s;
|
|
141
|
+
const { nodes: a, source: c, positions: p, path: h, originalError: m, extensions: y } = Ke(n);
|
|
142
142
|
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = m ?? void 0, this.nodes = Ie(
|
|
143
|
-
Array.isArray(
|
|
143
|
+
Array.isArray(a) ? a : a ? [a] : void 0
|
|
144
144
|
);
|
|
145
145
|
const C = Ie(
|
|
146
|
-
(
|
|
146
|
+
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((g) => g.loc).filter((g) => g != null)
|
|
147
147
|
);
|
|
148
|
-
this.source = c ?? (C == null || (
|
|
148
|
+
this.source = c ?? (C == null || (r = C[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = p && c ? p.map((g) => he(c, g)) : C == null ? void 0 : C.map((g) => he(g.source, g.start));
|
|
149
149
|
const A = Je(
|
|
150
150
|
m == null ? void 0 : m.extensions
|
|
151
151
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
@@ -193,7 +193,7 @@ class Ce extends Error {
|
|
|
193
193
|
for (const n of this.locations)
|
|
194
194
|
t += `
|
|
195
195
|
|
|
196
|
-
` +
|
|
196
|
+
` + Pe(this.source, n);
|
|
197
197
|
return t;
|
|
198
198
|
}
|
|
199
199
|
toJSON() {
|
|
@@ -206,7 +206,7 @@ class Ce extends Error {
|
|
|
206
206
|
function Ie(e) {
|
|
207
207
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function R(e, t, n) {
|
|
210
210
|
return new Ce(`Syntax Error: ${n}`, {
|
|
211
211
|
source: e,
|
|
212
212
|
positions: [t]
|
|
@@ -228,8 +228,8 @@ class Ze {
|
|
|
228
228
|
/**
|
|
229
229
|
* The Source document the AST represents.
|
|
230
230
|
*/
|
|
231
|
-
constructor(t, n,
|
|
232
|
-
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source =
|
|
231
|
+
constructor(t, n, i) {
|
|
232
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
|
|
233
233
|
}
|
|
234
234
|
get [Symbol.toStringTag]() {
|
|
235
235
|
return "Location";
|
|
@@ -241,7 +241,7 @@ class Ze {
|
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class be {
|
|
245
245
|
/**
|
|
246
246
|
* The kind of Token.
|
|
247
247
|
*/
|
|
@@ -268,8 +268,8 @@ class De {
|
|
|
268
268
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
269
269
|
* the last.
|
|
270
270
|
*/
|
|
271
|
-
constructor(t, n,
|
|
272
|
-
this.kind = t, this.start = n, this.end =
|
|
271
|
+
constructor(t, n, i, r, s, a) {
|
|
272
|
+
this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
|
|
273
273
|
}
|
|
274
274
|
get [Symbol.toStringTag]() {
|
|
275
275
|
return "Token";
|
|
@@ -283,7 +283,7 @@ class De {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const De = {
|
|
287
287
|
Name: [],
|
|
288
288
|
Document: ["definitions"],
|
|
289
289
|
OperationDefinition: [
|
|
@@ -357,7 +357,7 @@ const Pe = {
|
|
|
357
357
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
358
358
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
359
359
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
360
|
-
}, et = new Set(Object.keys(
|
|
360
|
+
}, et = new Set(Object.keys(De));
|
|
361
361
|
function Se(e) {
|
|
362
362
|
const t = e == null ? void 0 : e.kind;
|
|
363
363
|
return typeof t == "string" && et.has(t);
|
|
@@ -392,28 +392,28 @@ function tt(e) {
|
|
|
392
392
|
}
|
|
393
393
|
function nt(e) {
|
|
394
394
|
var t;
|
|
395
|
-
let n = Number.MAX_SAFE_INTEGER,
|
|
396
|
-
for (let
|
|
395
|
+
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
396
|
+
for (let a = 0; a < e.length; ++a) {
|
|
397
397
|
var s;
|
|
398
|
-
const c = e[
|
|
399
|
-
p !== c.length && (
|
|
398
|
+
const c = e[a], p = rt(c);
|
|
399
|
+
p !== c.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && p < n && (n = p));
|
|
400
400
|
}
|
|
401
|
-
return e.map((
|
|
402
|
-
(t =
|
|
403
|
-
|
|
401
|
+
return e.map((a, c) => c === 0 ? a : a.slice(n)).slice(
|
|
402
|
+
(t = i) !== null && t !== void 0 ? t : 0,
|
|
403
|
+
r + 1
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function rt(e) {
|
|
407
407
|
let t = 0;
|
|
408
408
|
for (; t < e.length && me(e.charCodeAt(t)); )
|
|
409
409
|
++t;
|
|
410
410
|
return t;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
const n = e.replace(/"""/g, '\\"""'),
|
|
414
|
-
(!
|
|
412
|
+
function it(e, t) {
|
|
413
|
+
const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((A) => A.length === 0 || me(A.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, p = e.endsWith("\\"), h = c || p, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
414
|
+
(!r || e.length > 70 || h || s || a);
|
|
415
415
|
let y = "";
|
|
416
|
-
const C =
|
|
416
|
+
const C = r && me(e.charCodeAt(0));
|
|
417
417
|
return (m && !C || s) && (y += `
|
|
418
418
|
`), y += n, (m || h) && (y += `
|
|
419
419
|
`), '"""' + y + '"""';
|
|
@@ -436,7 +436,7 @@ class st {
|
|
|
436
436
|
* The character offset at which the current line begins.
|
|
437
437
|
*/
|
|
438
438
|
constructor(t) {
|
|
439
|
-
const n = new
|
|
439
|
+
const n = new be(u.SOF, 0, 0, 0, 0);
|
|
440
440
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
441
441
|
}
|
|
442
442
|
get [Symbol.toStringTag]() {
|
|
@@ -459,14 +459,14 @@ class st {
|
|
|
459
459
|
if (t.next)
|
|
460
460
|
t = t.next;
|
|
461
461
|
else {
|
|
462
|
-
const n =
|
|
462
|
+
const n = ot(this, t.end);
|
|
463
463
|
t.next = n, n.prev = t, t = n;
|
|
464
464
|
}
|
|
465
465
|
while (t.kind === u.COMMENT);
|
|
466
466
|
return t;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function at(e) {
|
|
470
470
|
return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
|
|
471
471
|
}
|
|
472
472
|
function G(e) {
|
|
@@ -486,91 +486,91 @@ function F(e, t) {
|
|
|
486
486
|
if (n === void 0)
|
|
487
487
|
return u.EOF;
|
|
488
488
|
if (n >= 32 && n <= 126) {
|
|
489
|
-
const
|
|
490
|
-
return
|
|
489
|
+
const i = String.fromCodePoint(n);
|
|
490
|
+
return i === '"' ? `'"'` : `"${i}"`;
|
|
491
491
|
}
|
|
492
492
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
493
493
|
}
|
|
494
|
-
function S(e, t, n,
|
|
495
|
-
const s = e.line,
|
|
496
|
-
return new
|
|
494
|
+
function S(e, t, n, i, r) {
|
|
495
|
+
const s = e.line, a = 1 + n - e.lineStart;
|
|
496
|
+
return new be(t, n, i, s, a, r);
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
const n = e.source.body,
|
|
500
|
-
let
|
|
501
|
-
for (;
|
|
502
|
-
const s = n.charCodeAt(
|
|
498
|
+
function ot(e, t) {
|
|
499
|
+
const n = e.source.body, i = n.length;
|
|
500
|
+
let r = t;
|
|
501
|
+
for (; r < i; ) {
|
|
502
|
+
const s = n.charCodeAt(r);
|
|
503
503
|
switch (s) {
|
|
504
504
|
case 65279:
|
|
505
505
|
case 9:
|
|
506
506
|
case 32:
|
|
507
507
|
case 44:
|
|
508
|
-
++
|
|
508
|
+
++r;
|
|
509
509
|
continue;
|
|
510
510
|
case 10:
|
|
511
|
-
++
|
|
511
|
+
++r, ++e.line, e.lineStart = r;
|
|
512
512
|
continue;
|
|
513
513
|
case 13:
|
|
514
|
-
n.charCodeAt(
|
|
514
|
+
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
515
515
|
continue;
|
|
516
516
|
case 35:
|
|
517
|
-
return ut(e,
|
|
517
|
+
return ut(e, r);
|
|
518
518
|
case 33:
|
|
519
|
-
return S(e, u.BANG,
|
|
519
|
+
return S(e, u.BANG, r, r + 1);
|
|
520
520
|
case 36:
|
|
521
|
-
return S(e, u.DOLLAR,
|
|
521
|
+
return S(e, u.DOLLAR, r, r + 1);
|
|
522
522
|
case 38:
|
|
523
|
-
return S(e, u.AMP,
|
|
523
|
+
return S(e, u.AMP, r, r + 1);
|
|
524
524
|
case 40:
|
|
525
|
-
return S(e, u.PAREN_L,
|
|
525
|
+
return S(e, u.PAREN_L, r, r + 1);
|
|
526
526
|
case 41:
|
|
527
|
-
return S(e, u.PAREN_R,
|
|
527
|
+
return S(e, u.PAREN_R, r, r + 1);
|
|
528
528
|
case 46:
|
|
529
|
-
if (n.charCodeAt(
|
|
530
|
-
return S(e, u.SPREAD,
|
|
529
|
+
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
530
|
+
return S(e, u.SPREAD, r, r + 3);
|
|
531
531
|
break;
|
|
532
532
|
case 58:
|
|
533
|
-
return S(e, u.COLON,
|
|
533
|
+
return S(e, u.COLON, r, r + 1);
|
|
534
534
|
case 61:
|
|
535
|
-
return S(e, u.EQUALS,
|
|
535
|
+
return S(e, u.EQUALS, r, r + 1);
|
|
536
536
|
case 64:
|
|
537
|
-
return S(e, u.AT,
|
|
537
|
+
return S(e, u.AT, r, r + 1);
|
|
538
538
|
case 91:
|
|
539
|
-
return S(e, u.BRACKET_L,
|
|
539
|
+
return S(e, u.BRACKET_L, r, r + 1);
|
|
540
540
|
case 93:
|
|
541
|
-
return S(e, u.BRACKET_R,
|
|
541
|
+
return S(e, u.BRACKET_R, r, r + 1);
|
|
542
542
|
case 123:
|
|
543
|
-
return S(e, u.BRACE_L,
|
|
543
|
+
return S(e, u.BRACE_L, r, r + 1);
|
|
544
544
|
case 124:
|
|
545
|
-
return S(e, u.PIPE,
|
|
545
|
+
return S(e, u.PIPE, r, r + 1);
|
|
546
546
|
case 125:
|
|
547
|
-
return S(e, u.BRACE_R,
|
|
547
|
+
return S(e, u.BRACE_R, r, r + 1);
|
|
548
548
|
case 34:
|
|
549
|
-
return n.charCodeAt(
|
|
549
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? ft(e, r) : dt(e, r);
|
|
550
550
|
}
|
|
551
551
|
if (Y(s) || s === 45)
|
|
552
|
-
return ct(e,
|
|
552
|
+
return ct(e, r, s);
|
|
553
553
|
if (_e(s))
|
|
554
|
-
return mt(e,
|
|
555
|
-
throw
|
|
554
|
+
return mt(e, r);
|
|
555
|
+
throw R(
|
|
556
556
|
e.source,
|
|
557
|
-
|
|
558
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n,
|
|
557
|
+
r,
|
|
558
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n, r) ? `Unexpected character: ${F(e, r)}.` : `Invalid character: ${F(e, r)}.`
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
|
-
return S(e, u.EOF,
|
|
561
|
+
return S(e, u.EOF, i, i);
|
|
562
562
|
}
|
|
563
563
|
function ut(e, t) {
|
|
564
|
-
const n = e.source.body,
|
|
565
|
-
let
|
|
566
|
-
for (;
|
|
567
|
-
const s = n.charCodeAt(
|
|
564
|
+
const n = e.source.body, i = n.length;
|
|
565
|
+
let r = t + 1;
|
|
566
|
+
for (; r < i; ) {
|
|
567
|
+
const s = n.charCodeAt(r);
|
|
568
568
|
if (s === 10 || s === 13)
|
|
569
569
|
break;
|
|
570
570
|
if (G(s))
|
|
571
|
-
++
|
|
572
|
-
else if (se(n,
|
|
573
|
-
|
|
571
|
+
++r;
|
|
572
|
+
else if (se(n, r))
|
|
573
|
+
r += 2;
|
|
574
574
|
else
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
@@ -578,45 +578,45 @@ function ut(e, t) {
|
|
|
578
578
|
e,
|
|
579
579
|
u.COMMENT,
|
|
580
580
|
t,
|
|
581
|
-
|
|
582
|
-
n.slice(t + 1,
|
|
581
|
+
r,
|
|
582
|
+
n.slice(t + 1, r)
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
585
|
function ct(e, t, n) {
|
|
586
|
-
const
|
|
587
|
-
let
|
|
588
|
-
if (s === 45 && (s =
|
|
589
|
-
if (s =
|
|
590
|
-
throw
|
|
586
|
+
const i = e.source.body;
|
|
587
|
+
let r = t, s = n, a = !1;
|
|
588
|
+
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
589
|
+
if (s = i.charCodeAt(++r), Y(s))
|
|
590
|
+
throw R(
|
|
591
591
|
e.source,
|
|
592
|
-
|
|
592
|
+
r,
|
|
593
593
|
`Invalid number, unexpected digit after 0: ${F(
|
|
594
594
|
e,
|
|
595
|
-
|
|
595
|
+
r
|
|
596
596
|
)}.`
|
|
597
597
|
);
|
|
598
598
|
} else
|
|
599
|
-
|
|
600
|
-
if (s === 46 && (
|
|
601
|
-
throw
|
|
599
|
+
r = ce(e, r, s), s = i.charCodeAt(r);
|
|
600
|
+
if (s === 46 && (a = !0, s = i.charCodeAt(++r), r = ce(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = ce(e, r, s), s = i.charCodeAt(r)), s === 46 || _e(s))
|
|
601
|
+
throw R(
|
|
602
602
|
e.source,
|
|
603
|
-
|
|
603
|
+
r,
|
|
604
604
|
`Invalid number, expected digit but got: ${F(
|
|
605
605
|
e,
|
|
606
|
-
|
|
606
|
+
r
|
|
607
607
|
)}.`
|
|
608
608
|
);
|
|
609
609
|
return S(
|
|
610
610
|
e,
|
|
611
|
-
|
|
611
|
+
a ? u.FLOAT : u.INT,
|
|
612
612
|
t,
|
|
613
|
-
|
|
614
|
-
|
|
613
|
+
r,
|
|
614
|
+
i.slice(t, r)
|
|
615
615
|
);
|
|
616
616
|
}
|
|
617
617
|
function ce(e, t, n) {
|
|
618
618
|
if (!Y(n))
|
|
619
|
-
throw
|
|
619
|
+
throw R(
|
|
620
620
|
e.source,
|
|
621
621
|
t,
|
|
622
622
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -624,90 +624,90 @@ function ce(e, t, n) {
|
|
|
624
624
|
t
|
|
625
625
|
)}.`
|
|
626
626
|
);
|
|
627
|
-
const
|
|
628
|
-
let
|
|
629
|
-
for (; Y(
|
|
630
|
-
++
|
|
631
|
-
return
|
|
627
|
+
const i = e.source.body;
|
|
628
|
+
let r = t + 1;
|
|
629
|
+
for (; Y(i.charCodeAt(r)); )
|
|
630
|
+
++r;
|
|
631
|
+
return r;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
const n = e.source.body,
|
|
635
|
-
let
|
|
636
|
-
for (;
|
|
637
|
-
const c = n.charCodeAt(
|
|
633
|
+
function dt(e, t) {
|
|
634
|
+
const n = e.source.body, i = n.length;
|
|
635
|
+
let r = t + 1, s = r, a = "";
|
|
636
|
+
for (; r < i; ) {
|
|
637
|
+
const c = n.charCodeAt(r);
|
|
638
638
|
if (c === 34)
|
|
639
|
-
return
|
|
639
|
+
return a += n.slice(s, r), S(e, u.STRING, t, r + 1, a);
|
|
640
640
|
if (c === 92) {
|
|
641
|
-
|
|
642
|
-
const p = n.charCodeAt(
|
|
643
|
-
|
|
641
|
+
a += n.slice(s, r);
|
|
642
|
+
const p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? lt(e, r) : pt(e, r) : ht(e, r);
|
|
643
|
+
a += p.value, r += p.size, s = r;
|
|
644
644
|
continue;
|
|
645
645
|
}
|
|
646
646
|
if (c === 10 || c === 13)
|
|
647
647
|
break;
|
|
648
648
|
if (G(c))
|
|
649
|
-
++
|
|
650
|
-
else if (se(n,
|
|
651
|
-
|
|
649
|
+
++r;
|
|
650
|
+
else if (se(n, r))
|
|
651
|
+
r += 2;
|
|
652
652
|
else
|
|
653
|
-
throw
|
|
653
|
+
throw R(
|
|
654
654
|
e.source,
|
|
655
|
-
|
|
655
|
+
r,
|
|
656
656
|
`Invalid character within String: ${F(
|
|
657
657
|
e,
|
|
658
|
-
|
|
658
|
+
r
|
|
659
659
|
)}.`
|
|
660
660
|
);
|
|
661
661
|
}
|
|
662
|
-
throw
|
|
662
|
+
throw R(e.source, r, "Unterminated string.");
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function lt(e, t) {
|
|
665
665
|
const n = e.source.body;
|
|
666
|
-
let
|
|
667
|
-
for (;
|
|
668
|
-
const s = n.charCodeAt(t +
|
|
666
|
+
let i = 0, r = 3;
|
|
667
|
+
for (; r < 12; ) {
|
|
668
|
+
const s = n.charCodeAt(t + r++);
|
|
669
669
|
if (s === 125) {
|
|
670
|
-
if (
|
|
670
|
+
if (r < 5 || !G(i))
|
|
671
671
|
break;
|
|
672
672
|
return {
|
|
673
|
-
value: String.fromCodePoint(
|
|
674
|
-
size:
|
|
673
|
+
value: String.fromCodePoint(i),
|
|
674
|
+
size: r
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
if (
|
|
677
|
+
if (i = i << 4 | j(s), i < 0)
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
|
-
throw
|
|
680
|
+
throw R(
|
|
681
681
|
e.source,
|
|
682
682
|
t,
|
|
683
683
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
684
684
|
t,
|
|
685
|
-
t +
|
|
685
|
+
t + r
|
|
686
686
|
)}".`
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
689
|
function pt(e, t) {
|
|
690
|
-
const n = e.source.body,
|
|
691
|
-
if (G(
|
|
690
|
+
const n = e.source.body, i = Re(n, t + 2);
|
|
691
|
+
if (G(i))
|
|
692
692
|
return {
|
|
693
|
-
value: String.fromCodePoint(
|
|
693
|
+
value: String.fromCodePoint(i),
|
|
694
694
|
size: 6
|
|
695
695
|
};
|
|
696
|
-
if (Le(
|
|
697
|
-
const
|
|
698
|
-
if (we(
|
|
696
|
+
if (Le(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
697
|
+
const r = Re(n, t + 8);
|
|
698
|
+
if (we(r))
|
|
699
699
|
return {
|
|
700
|
-
value: String.fromCodePoint(
|
|
700
|
+
value: String.fromCodePoint(i, r),
|
|
701
701
|
size: 12
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
|
-
throw
|
|
704
|
+
throw R(
|
|
705
705
|
e.source,
|
|
706
706
|
t,
|
|
707
707
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
708
708
|
);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Re(e, t) {
|
|
711
711
|
return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
|
|
712
712
|
}
|
|
713
713
|
function j(e) {
|
|
@@ -758,7 +758,7 @@ function ht(e, t) {
|
|
|
758
758
|
size: 2
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
|
-
throw
|
|
761
|
+
throw R(
|
|
762
762
|
e.source,
|
|
763
763
|
t,
|
|
764
764
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -768,13 +768,13 @@ function ht(e, t) {
|
|
|
768
768
|
);
|
|
769
769
|
}
|
|
770
770
|
function ft(e, t) {
|
|
771
|
-
const n = e.source.body,
|
|
772
|
-
let
|
|
771
|
+
const n = e.source.body, i = n.length;
|
|
772
|
+
let r = e.lineStart, s = t + 3, a = s, c = "";
|
|
773
773
|
const p = [];
|
|
774
|
-
for (; s <
|
|
774
|
+
for (; s < i; ) {
|
|
775
775
|
const h = n.charCodeAt(s);
|
|
776
776
|
if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
777
|
-
c += n.slice(
|
|
777
|
+
c += n.slice(a, s), p.push(c);
|
|
778
778
|
const m = S(
|
|
779
779
|
e,
|
|
780
780
|
u.BLOCK_STRING,
|
|
@@ -784,14 +784,14 @@ function ft(e, t) {
|
|
|
784
784
|
nt(p).join(`
|
|
785
785
|
`)
|
|
786
786
|
);
|
|
787
|
-
return e.line += p.length - 1, e.lineStart =
|
|
787
|
+
return e.line += p.length - 1, e.lineStart = r, m;
|
|
788
788
|
}
|
|
789
789
|
if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
790
|
-
c += n.slice(
|
|
790
|
+
c += n.slice(a, s), a = s + 1, s += 4;
|
|
791
791
|
continue;
|
|
792
792
|
}
|
|
793
793
|
if (h === 10 || h === 13) {
|
|
794
|
-
c += n.slice(
|
|
794
|
+
c += n.slice(a, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s, r = s;
|
|
795
795
|
continue;
|
|
796
796
|
}
|
|
797
797
|
if (G(h))
|
|
@@ -799,7 +799,7 @@ function ft(e, t) {
|
|
|
799
799
|
else if (se(n, s))
|
|
800
800
|
s += 2;
|
|
801
801
|
else
|
|
802
|
-
throw
|
|
802
|
+
throw R(
|
|
803
803
|
e.source,
|
|
804
804
|
s,
|
|
805
805
|
`Invalid character within String: ${F(
|
|
@@ -808,15 +808,15 @@ function ft(e, t) {
|
|
|
808
808
|
)}.`
|
|
809
809
|
);
|
|
810
810
|
}
|
|
811
|
-
throw
|
|
811
|
+
throw R(e.source, s, "Unterminated string.");
|
|
812
812
|
}
|
|
813
813
|
function mt(e, t) {
|
|
814
|
-
const n = e.source.body,
|
|
815
|
-
let
|
|
816
|
-
for (;
|
|
817
|
-
const s = n.charCodeAt(
|
|
814
|
+
const n = e.source.body, i = n.length;
|
|
815
|
+
let r = t + 1;
|
|
816
|
+
for (; r < i; ) {
|
|
817
|
+
const s = n.charCodeAt(r);
|
|
818
818
|
if (tt(s))
|
|
819
|
-
++
|
|
819
|
+
++r;
|
|
820
820
|
else
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
@@ -824,15 +824,15 @@ function mt(e, t) {
|
|
|
824
824
|
e,
|
|
825
825
|
u.NAME,
|
|
826
826
|
t,
|
|
827
|
-
|
|
828
|
-
n.slice(t,
|
|
827
|
+
r,
|
|
828
|
+
n.slice(t, r)
|
|
829
829
|
);
|
|
830
830
|
}
|
|
831
831
|
const gt = 10, Fe = 2;
|
|
832
832
|
function Ee(e) {
|
|
833
|
-
return
|
|
833
|
+
return ae(e, []);
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function ae(e, t) {
|
|
836
836
|
switch (typeof e) {
|
|
837
837
|
case "string":
|
|
838
838
|
return JSON.stringify(e);
|
|
@@ -851,9 +851,9 @@ function yt(e, t) {
|
|
|
851
851
|
return "[Circular]";
|
|
852
852
|
const n = [...t, e];
|
|
853
853
|
if (Ct(e)) {
|
|
854
|
-
const
|
|
855
|
-
if (
|
|
856
|
-
return typeof
|
|
854
|
+
const i = e.toJSON();
|
|
855
|
+
if (i !== e)
|
|
856
|
+
return typeof i == "string" ? i : ae(i, n);
|
|
857
857
|
} else if (Array.isArray(e))
|
|
858
858
|
return vt(e, n);
|
|
859
859
|
return Et(e, n);
|
|
@@ -864,7 +864,7 @@ function Ct(e) {
|
|
|
864
864
|
function Et(e, t) {
|
|
865
865
|
const n = Object.entries(e);
|
|
866
866
|
return n.length === 0 ? "{}" : t.length > Fe ? "[" + Tt(e) + "]" : "{ " + n.map(
|
|
867
|
-
([
|
|
867
|
+
([r, s]) => r + ": " + ae(s, t)
|
|
868
868
|
).join(", ") + " }";
|
|
869
869
|
}
|
|
870
870
|
function vt(e, t) {
|
|
@@ -872,10 +872,10 @@ function vt(e, t) {
|
|
|
872
872
|
return "[]";
|
|
873
873
|
if (t.length > Fe)
|
|
874
874
|
return "[Array]";
|
|
875
|
-
const n = Math.min(gt, e.length),
|
|
875
|
+
const n = Math.min(gt, e.length), i = e.length - n, r = [];
|
|
876
876
|
for (let s = 0; s < n; ++s)
|
|
877
|
-
|
|
878
|
-
return
|
|
877
|
+
r.push(ae(e[s], t));
|
|
878
|
+
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
879
879
|
}
|
|
880
880
|
function Tt(e) {
|
|
881
881
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
@@ -895,14 +895,14 @@ const At = (
|
|
|
895
895
|
if (t instanceof n)
|
|
896
896
|
return !0;
|
|
897
897
|
if (typeof t == "object" && t !== null) {
|
|
898
|
-
var
|
|
899
|
-
const
|
|
898
|
+
var i;
|
|
899
|
+
const r = n.prototype[Symbol.toStringTag], s = (
|
|
900
900
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
901
|
-
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (
|
|
901
|
+
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
902
902
|
);
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
throw new Error(`Cannot use ${
|
|
903
|
+
if (r === s) {
|
|
904
|
+
const a = Ee(t);
|
|
905
|
+
throw new Error(`Cannot use ${r} "${a}" from another module or realm.
|
|
906
906
|
|
|
907
907
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
908
908
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -920,11 +920,11 @@ spurious results.`);
|
|
|
920
920
|
}
|
|
921
921
|
);
|
|
922
922
|
class Be {
|
|
923
|
-
constructor(t, n = "GraphQL request",
|
|
923
|
+
constructor(t, n = "GraphQL request", i = {
|
|
924
924
|
line: 1,
|
|
925
925
|
column: 1
|
|
926
926
|
}) {
|
|
927
|
-
typeof t == "string" || K(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset =
|
|
927
|
+
typeof t == "string" || K(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || K(
|
|
928
928
|
!1,
|
|
929
929
|
"line in locationOffset is 1-indexed and must be positive."
|
|
930
930
|
), this.locationOffset.column > 0 || K(
|
|
@@ -944,8 +944,8 @@ function Ue(e, t) {
|
|
|
944
944
|
}
|
|
945
945
|
class St {
|
|
946
946
|
constructor(t, n = {}) {
|
|
947
|
-
const
|
|
948
|
-
this._lexer = new st(
|
|
947
|
+
const i = It(t) ? t : new Be(t);
|
|
948
|
+
this._lexer = new st(i), this._options = n, this._tokenCounter = 0;
|
|
949
949
|
}
|
|
950
950
|
/**
|
|
951
951
|
* Converts a name lex token into a name parse node.
|
|
@@ -1018,7 +1018,7 @@ class St {
|
|
|
1018
1018
|
return this.parseDirectiveDefinition();
|
|
1019
1019
|
}
|
|
1020
1020
|
if (t)
|
|
1021
|
-
throw
|
|
1021
|
+
throw R(
|
|
1022
1022
|
this._lexer.source,
|
|
1023
1023
|
this._lexer.token.start,
|
|
1024
1024
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -1054,11 +1054,11 @@ class St {
|
|
|
1054
1054
|
selectionSet: this.parseSelectionSet()
|
|
1055
1055
|
});
|
|
1056
1056
|
const n = this.parseOperationType();
|
|
1057
|
-
let
|
|
1058
|
-
return this.peek(u.NAME) && (
|
|
1057
|
+
let i;
|
|
1058
|
+
return this.peek(u.NAME) && (i = this.parseName()), this.node(t, {
|
|
1059
1059
|
kind: f.OPERATION_DEFINITION,
|
|
1060
1060
|
operation: n,
|
|
1061
|
-
name:
|
|
1061
|
+
name: i,
|
|
1062
1062
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1063
1063
|
directives: this.parseDirectives(!1),
|
|
1064
1064
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1142,11 +1142,11 @@ class St {
|
|
|
1142
1142
|
*/
|
|
1143
1143
|
parseField() {
|
|
1144
1144
|
const t = this._lexer.token, n = this.parseName();
|
|
1145
|
-
let
|
|
1146
|
-
return this.expectOptionalToken(u.COLON) ? (
|
|
1145
|
+
let i, r;
|
|
1146
|
+
return this.expectOptionalToken(u.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
|
|
1147
1147
|
kind: f.FIELD,
|
|
1148
|
-
alias:
|
|
1149
|
-
name:
|
|
1148
|
+
alias: i,
|
|
1149
|
+
name: r,
|
|
1150
1150
|
arguments: this.parseArguments(!1),
|
|
1151
1151
|
directives: this.parseDirectives(!1),
|
|
1152
1152
|
selectionSet: this.peek(u.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
@@ -1163,10 +1163,10 @@ class St {
|
|
|
1163
1163
|
* Argument[Const] : Name : Value[?Const]
|
|
1164
1164
|
*/
|
|
1165
1165
|
parseArgument(t = !1) {
|
|
1166
|
-
const n = this._lexer.token,
|
|
1166
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1167
1167
|
return this.expectToken(u.COLON), this.node(n, {
|
|
1168
1168
|
kind: f.ARGUMENT,
|
|
1169
|
-
name:
|
|
1169
|
+
name: i,
|
|
1170
1170
|
value: this.parseValueLiteral(t)
|
|
1171
1171
|
});
|
|
1172
1172
|
}
|
|
@@ -1291,11 +1291,11 @@ class St {
|
|
|
1291
1291
|
case u.DOLLAR:
|
|
1292
1292
|
if (t)
|
|
1293
1293
|
if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
|
|
1294
|
-
const
|
|
1295
|
-
throw
|
|
1294
|
+
const i = this._lexer.token.value;
|
|
1295
|
+
throw R(
|
|
1296
1296
|
this._lexer.source,
|
|
1297
1297
|
n.start,
|
|
1298
|
-
`Unexpected variable "$${
|
|
1298
|
+
`Unexpected variable "$${i}" in constant value.`
|
|
1299
1299
|
);
|
|
1300
1300
|
} else
|
|
1301
1301
|
throw this.unexpected(n);
|
|
@@ -1345,10 +1345,10 @@ class St {
|
|
|
1345
1345
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1346
1346
|
*/
|
|
1347
1347
|
parseObjectField(t) {
|
|
1348
|
-
const n = this._lexer.token,
|
|
1348
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1349
1349
|
return this.expectToken(u.COLON), this.node(n, {
|
|
1350
1350
|
kind: f.OBJECT_FIELD,
|
|
1351
|
-
name:
|
|
1351
|
+
name: i,
|
|
1352
1352
|
value: this.parseValueLiteral(t)
|
|
1353
1353
|
});
|
|
1354
1354
|
}
|
|
@@ -1389,10 +1389,10 @@ class St {
|
|
|
1389
1389
|
const t = this._lexer.token;
|
|
1390
1390
|
let n;
|
|
1391
1391
|
if (this.expectOptionalToken(u.BRACKET_L)) {
|
|
1392
|
-
const
|
|
1392
|
+
const i = this.parseTypeReference();
|
|
1393
1393
|
this.expectToken(u.BRACKET_R), n = this.node(t, {
|
|
1394
1394
|
kind: f.LIST_TYPE,
|
|
1395
|
-
type:
|
|
1395
|
+
type: i
|
|
1396
1396
|
});
|
|
1397
1397
|
} else
|
|
1398
1398
|
n = this.parseNamedType();
|
|
@@ -1429,7 +1429,7 @@ class St {
|
|
|
1429
1429
|
parseSchemaDefinition() {
|
|
1430
1430
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1431
1431
|
this.expectKeyword("schema");
|
|
1432
|
-
const
|
|
1432
|
+
const i = this.parseConstDirectives(), r = this.many(
|
|
1433
1433
|
u.BRACE_L,
|
|
1434
1434
|
this.parseOperationTypeDefinition,
|
|
1435
1435
|
u.BRACE_R
|
|
@@ -1437,8 +1437,8 @@ class St {
|
|
|
1437
1437
|
return this.node(t, {
|
|
1438
1438
|
kind: f.SCHEMA_DEFINITION,
|
|
1439
1439
|
description: n,
|
|
1440
|
-
directives:
|
|
1441
|
-
operationTypes:
|
|
1440
|
+
directives: i,
|
|
1441
|
+
operationTypes: r
|
|
1442
1442
|
});
|
|
1443
1443
|
}
|
|
1444
1444
|
/**
|
|
@@ -1447,11 +1447,11 @@ class St {
|
|
|
1447
1447
|
parseOperationTypeDefinition() {
|
|
1448
1448
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
1449
1449
|
this.expectToken(u.COLON);
|
|
1450
|
-
const
|
|
1450
|
+
const i = this.parseNamedType();
|
|
1451
1451
|
return this.node(t, {
|
|
1452
1452
|
kind: f.OPERATION_TYPE_DEFINITION,
|
|
1453
1453
|
operation: n,
|
|
1454
|
-
type:
|
|
1454
|
+
type: i
|
|
1455
1455
|
});
|
|
1456
1456
|
}
|
|
1457
1457
|
/**
|
|
@@ -1460,12 +1460,12 @@ class St {
|
|
|
1460
1460
|
parseScalarTypeDefinition() {
|
|
1461
1461
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1462
1462
|
this.expectKeyword("scalar");
|
|
1463
|
-
const
|
|
1463
|
+
const i = this.parseName(), r = this.parseConstDirectives();
|
|
1464
1464
|
return this.node(t, {
|
|
1465
1465
|
kind: f.SCALAR_TYPE_DEFINITION,
|
|
1466
1466
|
description: n,
|
|
1467
|
-
name:
|
|
1468
|
-
directives:
|
|
1467
|
+
name: i,
|
|
1468
|
+
directives: r
|
|
1469
1469
|
});
|
|
1470
1470
|
}
|
|
1471
1471
|
/**
|
|
@@ -1476,14 +1476,14 @@ class St {
|
|
|
1476
1476
|
parseObjectTypeDefinition() {
|
|
1477
1477
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1478
1478
|
this.expectKeyword("type");
|
|
1479
|
-
const
|
|
1479
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1480
1480
|
return this.node(t, {
|
|
1481
1481
|
kind: f.OBJECT_TYPE_DEFINITION,
|
|
1482
1482
|
description: n,
|
|
1483
|
-
name:
|
|
1484
|
-
interfaces:
|
|
1483
|
+
name: i,
|
|
1484
|
+
interfaces: r,
|
|
1485
1485
|
directives: s,
|
|
1486
|
-
fields:
|
|
1486
|
+
fields: a
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
1489
|
/**
|
|
@@ -1511,16 +1511,16 @@ class St {
|
|
|
1511
1511
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1512
1512
|
*/
|
|
1513
1513
|
parseFieldDefinition() {
|
|
1514
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1514
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
1515
1515
|
this.expectToken(u.COLON);
|
|
1516
|
-
const s = this.parseTypeReference(),
|
|
1516
|
+
const s = this.parseTypeReference(), a = this.parseConstDirectives();
|
|
1517
1517
|
return this.node(t, {
|
|
1518
1518
|
kind: f.FIELD_DEFINITION,
|
|
1519
1519
|
description: n,
|
|
1520
|
-
name:
|
|
1521
|
-
arguments:
|
|
1520
|
+
name: i,
|
|
1521
|
+
arguments: r,
|
|
1522
1522
|
type: s,
|
|
1523
|
-
directives:
|
|
1523
|
+
directives: a
|
|
1524
1524
|
});
|
|
1525
1525
|
}
|
|
1526
1526
|
/**
|
|
@@ -1538,19 +1538,19 @@ class St {
|
|
|
1538
1538
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1539
1539
|
*/
|
|
1540
1540
|
parseInputValueDef() {
|
|
1541
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1541
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
1542
1542
|
this.expectToken(u.COLON);
|
|
1543
|
-
const
|
|
1543
|
+
const r = this.parseTypeReference();
|
|
1544
1544
|
let s;
|
|
1545
1545
|
this.expectOptionalToken(u.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1546
|
-
const
|
|
1546
|
+
const a = this.parseConstDirectives();
|
|
1547
1547
|
return this.node(t, {
|
|
1548
1548
|
kind: f.INPUT_VALUE_DEFINITION,
|
|
1549
1549
|
description: n,
|
|
1550
|
-
name:
|
|
1551
|
-
type:
|
|
1550
|
+
name: i,
|
|
1551
|
+
type: r,
|
|
1552
1552
|
defaultValue: s,
|
|
1553
|
-
directives:
|
|
1553
|
+
directives: a
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
1556
1556
|
/**
|
|
@@ -1560,14 +1560,14 @@ class St {
|
|
|
1560
1560
|
parseInterfaceTypeDefinition() {
|
|
1561
1561
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1562
1562
|
this.expectKeyword("interface");
|
|
1563
|
-
const
|
|
1563
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1564
1564
|
return this.node(t, {
|
|
1565
1565
|
kind: f.INTERFACE_TYPE_DEFINITION,
|
|
1566
1566
|
description: n,
|
|
1567
|
-
name:
|
|
1568
|
-
interfaces:
|
|
1567
|
+
name: i,
|
|
1568
|
+
interfaces: r,
|
|
1569
1569
|
directives: s,
|
|
1570
|
-
fields:
|
|
1570
|
+
fields: a
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
1573
|
/**
|
|
@@ -1577,12 +1577,12 @@ class St {
|
|
|
1577
1577
|
parseUnionTypeDefinition() {
|
|
1578
1578
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1579
1579
|
this.expectKeyword("union");
|
|
1580
|
-
const
|
|
1580
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1581
1581
|
return this.node(t, {
|
|
1582
1582
|
kind: f.UNION_TYPE_DEFINITION,
|
|
1583
1583
|
description: n,
|
|
1584
|
-
name:
|
|
1585
|
-
directives:
|
|
1584
|
+
name: i,
|
|
1585
|
+
directives: r,
|
|
1586
1586
|
types: s
|
|
1587
1587
|
});
|
|
1588
1588
|
}
|
|
@@ -1601,12 +1601,12 @@ class St {
|
|
|
1601
1601
|
parseEnumTypeDefinition() {
|
|
1602
1602
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1603
1603
|
this.expectKeyword("enum");
|
|
1604
|
-
const
|
|
1604
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1605
1605
|
return this.node(t, {
|
|
1606
1606
|
kind: f.ENUM_TYPE_DEFINITION,
|
|
1607
1607
|
description: n,
|
|
1608
|
-
name:
|
|
1609
|
-
directives:
|
|
1608
|
+
name: i,
|
|
1609
|
+
directives: r,
|
|
1610
1610
|
values: s
|
|
1611
1611
|
});
|
|
1612
1612
|
}
|
|
@@ -1626,12 +1626,12 @@ class St {
|
|
|
1626
1626
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1627
1627
|
*/
|
|
1628
1628
|
parseEnumValueDefinition() {
|
|
1629
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1629
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
1630
1630
|
return this.node(t, {
|
|
1631
1631
|
kind: f.ENUM_VALUE_DEFINITION,
|
|
1632
1632
|
description: n,
|
|
1633
|
-
name:
|
|
1634
|
-
directives:
|
|
1633
|
+
name: i,
|
|
1634
|
+
directives: r
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
1637
|
/**
|
|
@@ -1639,7 +1639,7 @@ class St {
|
|
|
1639
1639
|
*/
|
|
1640
1640
|
parseEnumValueName() {
|
|
1641
1641
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
1642
|
-
throw
|
|
1642
|
+
throw R(
|
|
1643
1643
|
this._lexer.source,
|
|
1644
1644
|
this._lexer.token.start,
|
|
1645
1645
|
`${W(
|
|
@@ -1655,12 +1655,12 @@ class St {
|
|
|
1655
1655
|
parseInputObjectTypeDefinition() {
|
|
1656
1656
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1657
1657
|
this.expectKeyword("input");
|
|
1658
|
-
const
|
|
1658
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1659
1659
|
return this.node(t, {
|
|
1660
1660
|
kind: f.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1661
1661
|
description: n,
|
|
1662
|
-
name:
|
|
1663
|
-
directives:
|
|
1662
|
+
name: i,
|
|
1663
|
+
directives: r,
|
|
1664
1664
|
fields: s
|
|
1665
1665
|
});
|
|
1666
1666
|
}
|
|
@@ -1720,17 +1720,17 @@ class St {
|
|
|
1720
1720
|
parseSchemaExtension() {
|
|
1721
1721
|
const t = this._lexer.token;
|
|
1722
1722
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1723
|
-
const n = this.parseConstDirectives(),
|
|
1723
|
+
const n = this.parseConstDirectives(), i = this.optionalMany(
|
|
1724
1724
|
u.BRACE_L,
|
|
1725
1725
|
this.parseOperationTypeDefinition,
|
|
1726
1726
|
u.BRACE_R
|
|
1727
1727
|
);
|
|
1728
|
-
if (n.length === 0 &&
|
|
1728
|
+
if (n.length === 0 && i.length === 0)
|
|
1729
1729
|
throw this.unexpected();
|
|
1730
1730
|
return this.node(t, {
|
|
1731
1731
|
kind: f.SCHEMA_EXTENSION,
|
|
1732
1732
|
directives: n,
|
|
1733
|
-
operationTypes:
|
|
1733
|
+
operationTypes: i
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
/**
|
|
@@ -1740,13 +1740,13 @@ class St {
|
|
|
1740
1740
|
parseScalarTypeExtension() {
|
|
1741
1741
|
const t = this._lexer.token;
|
|
1742
1742
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1743
|
-
const n = this.parseName(),
|
|
1744
|
-
if (
|
|
1743
|
+
const n = this.parseName(), i = this.parseConstDirectives();
|
|
1744
|
+
if (i.length === 0)
|
|
1745
1745
|
throw this.unexpected();
|
|
1746
1746
|
return this.node(t, {
|
|
1747
1747
|
kind: f.SCALAR_TYPE_EXTENSION,
|
|
1748
1748
|
name: n,
|
|
1749
|
-
directives:
|
|
1749
|
+
directives: i
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
1752
|
/**
|
|
@@ -1758,14 +1758,14 @@ class St {
|
|
|
1758
1758
|
parseObjectTypeExtension() {
|
|
1759
1759
|
const t = this._lexer.token;
|
|
1760
1760
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1761
|
-
const n = this.parseName(),
|
|
1762
|
-
if (
|
|
1761
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1762
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1763
1763
|
throw this.unexpected();
|
|
1764
1764
|
return this.node(t, {
|
|
1765
1765
|
kind: f.OBJECT_TYPE_EXTENSION,
|
|
1766
1766
|
name: n,
|
|
1767
|
-
interfaces:
|
|
1768
|
-
directives:
|
|
1767
|
+
interfaces: i,
|
|
1768
|
+
directives: r,
|
|
1769
1769
|
fields: s
|
|
1770
1770
|
});
|
|
1771
1771
|
}
|
|
@@ -1778,14 +1778,14 @@ class St {
|
|
|
1778
1778
|
parseInterfaceTypeExtension() {
|
|
1779
1779
|
const t = this._lexer.token;
|
|
1780
1780
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1781
|
-
const n = this.parseName(),
|
|
1782
|
-
if (
|
|
1781
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1782
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1783
1783
|
throw this.unexpected();
|
|
1784
1784
|
return this.node(t, {
|
|
1785
1785
|
kind: f.INTERFACE_TYPE_EXTENSION,
|
|
1786
1786
|
name: n,
|
|
1787
|
-
interfaces:
|
|
1788
|
-
directives:
|
|
1787
|
+
interfaces: i,
|
|
1788
|
+
directives: r,
|
|
1789
1789
|
fields: s
|
|
1790
1790
|
});
|
|
1791
1791
|
}
|
|
@@ -1797,14 +1797,14 @@ class St {
|
|
|
1797
1797
|
parseUnionTypeExtension() {
|
|
1798
1798
|
const t = this._lexer.token;
|
|
1799
1799
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1800
|
-
const n = this.parseName(),
|
|
1801
|
-
if (
|
|
1800
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
1801
|
+
if (i.length === 0 && r.length === 0)
|
|
1802
1802
|
throw this.unexpected();
|
|
1803
1803
|
return this.node(t, {
|
|
1804
1804
|
kind: f.UNION_TYPE_EXTENSION,
|
|
1805
1805
|
name: n,
|
|
1806
|
-
directives:
|
|
1807
|
-
types:
|
|
1806
|
+
directives: i,
|
|
1807
|
+
types: r
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
1810
1810
|
/**
|
|
@@ -1815,14 +1815,14 @@ class St {
|
|
|
1815
1815
|
parseEnumTypeExtension() {
|
|
1816
1816
|
const t = this._lexer.token;
|
|
1817
1817
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1818
|
-
const n = this.parseName(),
|
|
1819
|
-
if (
|
|
1818
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
1819
|
+
if (i.length === 0 && r.length === 0)
|
|
1820
1820
|
throw this.unexpected();
|
|
1821
1821
|
return this.node(t, {
|
|
1822
1822
|
kind: f.ENUM_TYPE_EXTENSION,
|
|
1823
1823
|
name: n,
|
|
1824
|
-
directives:
|
|
1825
|
-
values:
|
|
1824
|
+
directives: i,
|
|
1825
|
+
values: r
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
1828
|
/**
|
|
@@ -1833,14 +1833,14 @@ class St {
|
|
|
1833
1833
|
parseInputObjectTypeExtension() {
|
|
1834
1834
|
const t = this._lexer.token;
|
|
1835
1835
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1836
|
-
const n = this.parseName(),
|
|
1837
|
-
if (
|
|
1836
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
1837
|
+
if (i.length === 0 && r.length === 0)
|
|
1838
1838
|
throw this.unexpected();
|
|
1839
1839
|
return this.node(t, {
|
|
1840
1840
|
kind: f.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1841
1841
|
name: n,
|
|
1842
|
-
directives:
|
|
1843
|
-
fields:
|
|
1842
|
+
directives: i,
|
|
1843
|
+
fields: r
|
|
1844
1844
|
});
|
|
1845
1845
|
}
|
|
1846
1846
|
/**
|
|
@@ -1852,16 +1852,16 @@ class St {
|
|
|
1852
1852
|
parseDirectiveDefinition() {
|
|
1853
1853
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1854
1854
|
this.expectKeyword("directive"), this.expectToken(u.AT);
|
|
1855
|
-
const
|
|
1855
|
+
const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1856
1856
|
this.expectKeyword("on");
|
|
1857
|
-
const
|
|
1857
|
+
const a = this.parseDirectiveLocations();
|
|
1858
1858
|
return this.node(t, {
|
|
1859
1859
|
kind: f.DIRECTIVE_DEFINITION,
|
|
1860
1860
|
description: n,
|
|
1861
|
-
name:
|
|
1862
|
-
arguments:
|
|
1861
|
+
name: i,
|
|
1862
|
+
arguments: r,
|
|
1863
1863
|
repeatable: s,
|
|
1864
|
-
locations:
|
|
1864
|
+
locations: a
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
1867
|
/**
|
|
@@ -1932,7 +1932,7 @@ class St {
|
|
|
1932
1932
|
const n = this._lexer.token;
|
|
1933
1933
|
if (n.kind === t)
|
|
1934
1934
|
return this.advanceLexer(), n;
|
|
1935
|
-
throw
|
|
1935
|
+
throw R(
|
|
1936
1936
|
this._lexer.source,
|
|
1937
1937
|
n.start,
|
|
1938
1938
|
`Expected ${Me(t)}, found ${W(n)}.`
|
|
@@ -1954,7 +1954,7 @@ class St {
|
|
|
1954
1954
|
if (n.kind === u.NAME && n.value === t)
|
|
1955
1955
|
this.advanceLexer();
|
|
1956
1956
|
else
|
|
1957
|
-
throw
|
|
1957
|
+
throw R(
|
|
1958
1958
|
this._lexer.source,
|
|
1959
1959
|
n.start,
|
|
1960
1960
|
`Expected "${t}", found ${W(n)}.`
|
|
@@ -1973,7 +1973,7 @@ class St {
|
|
|
1973
1973
|
*/
|
|
1974
1974
|
unexpected(t) {
|
|
1975
1975
|
const n = t ?? this._lexer.token;
|
|
1976
|
-
return
|
|
1976
|
+
return R(
|
|
1977
1977
|
this._lexer.source,
|
|
1978
1978
|
n.start,
|
|
1979
1979
|
`Unexpected ${W(n)}.`
|
|
@@ -1984,12 +1984,12 @@ class St {
|
|
|
1984
1984
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
1985
1985
|
* Advances the parser to the next lex token after the closing token.
|
|
1986
1986
|
*/
|
|
1987
|
-
any(t, n,
|
|
1987
|
+
any(t, n, i) {
|
|
1988
1988
|
this.expectToken(t);
|
|
1989
|
-
const
|
|
1990
|
-
for (; !this.expectOptionalToken(
|
|
1991
|
-
|
|
1992
|
-
return
|
|
1989
|
+
const r = [];
|
|
1990
|
+
for (; !this.expectOptionalToken(i); )
|
|
1991
|
+
r.push(n.call(this));
|
|
1992
|
+
return r;
|
|
1993
1993
|
}
|
|
1994
1994
|
/**
|
|
1995
1995
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -1997,13 +1997,13 @@ class St {
|
|
|
1997
1997
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
1998
1998
|
* Advances the parser to the next lex token after the closing token.
|
|
1999
1999
|
*/
|
|
2000
|
-
optionalMany(t, n,
|
|
2000
|
+
optionalMany(t, n, i) {
|
|
2001
2001
|
if (this.expectOptionalToken(t)) {
|
|
2002
|
-
const
|
|
2002
|
+
const r = [];
|
|
2003
2003
|
do
|
|
2004
|
-
|
|
2005
|
-
while (!this.expectOptionalToken(
|
|
2006
|
-
return
|
|
2004
|
+
r.push(n.call(this));
|
|
2005
|
+
while (!this.expectOptionalToken(i));
|
|
2006
|
+
return r;
|
|
2007
2007
|
}
|
|
2008
2008
|
return [];
|
|
2009
2009
|
}
|
|
@@ -2012,13 +2012,13 @@ class St {
|
|
|
2012
2012
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2013
2013
|
* Advances the parser to the next lex token after the closing token.
|
|
2014
2014
|
*/
|
|
2015
|
-
many(t, n,
|
|
2015
|
+
many(t, n, i) {
|
|
2016
2016
|
this.expectToken(t);
|
|
2017
|
-
const
|
|
2017
|
+
const r = [];
|
|
2018
2018
|
do
|
|
2019
|
-
|
|
2020
|
-
while (!this.expectOptionalToken(
|
|
2021
|
-
return
|
|
2019
|
+
r.push(n.call(this));
|
|
2020
|
+
while (!this.expectOptionalToken(i));
|
|
2021
|
+
return r;
|
|
2022
2022
|
}
|
|
2023
2023
|
/**
|
|
2024
2024
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
@@ -2027,16 +2027,16 @@ class St {
|
|
|
2027
2027
|
*/
|
|
2028
2028
|
delimitedMany(t, n) {
|
|
2029
2029
|
this.expectOptionalToken(t);
|
|
2030
|
-
const
|
|
2030
|
+
const i = [];
|
|
2031
2031
|
do
|
|
2032
|
-
|
|
2032
|
+
i.push(n.call(this));
|
|
2033
2033
|
while (this.expectOptionalToken(t));
|
|
2034
|
-
return
|
|
2034
|
+
return i;
|
|
2035
2035
|
}
|
|
2036
2036
|
advanceLexer() {
|
|
2037
2037
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2038
2038
|
if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
2039
|
-
throw
|
|
2039
|
+
throw R(
|
|
2040
2040
|
this._lexer.source,
|
|
2041
2041
|
n.start,
|
|
2042
2042
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -2048,16 +2048,16 @@ function W(e) {
|
|
|
2048
2048
|
return Me(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2049
2049
|
}
|
|
2050
2050
|
function Me(e) {
|
|
2051
|
-
return
|
|
2051
|
+
return at(e) ? `"${e}"` : e;
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2054
|
-
return `"${e.replace(
|
|
2053
|
+
function Rt(e) {
|
|
2054
|
+
return `"${e.replace(Nt, xt)}"`;
|
|
2055
2055
|
}
|
|
2056
|
-
const
|
|
2056
|
+
const Nt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2057
2057
|
function xt(e) {
|
|
2058
|
-
return
|
|
2058
|
+
return Ot[e.charCodeAt(0)];
|
|
2059
2059
|
}
|
|
2060
|
-
const
|
|
2060
|
+
const Ot = [
|
|
2061
2061
|
"\\u0000",
|
|
2062
2062
|
"\\u0001",
|
|
2063
2063
|
"\\u0002",
|
|
@@ -2223,36 +2223,36 @@ const bt = [
|
|
|
2223
2223
|
"\\u009D",
|
|
2224
2224
|
"\\u009E",
|
|
2225
2225
|
"\\u009F"
|
|
2226
|
-
],
|
|
2227
|
-
function
|
|
2228
|
-
const
|
|
2229
|
-
for (const
|
|
2230
|
-
|
|
2231
|
-
let
|
|
2226
|
+
], Pt = Object.freeze({});
|
|
2227
|
+
function bt(e, t, n = De) {
|
|
2228
|
+
const i = /* @__PURE__ */ new Map();
|
|
2229
|
+
for (const b of Object.values(f))
|
|
2230
|
+
i.set(b, Dt(t, b));
|
|
2231
|
+
let r, s = Array.isArray(e), a = [e], c = -1, p = [], h = e, m, y;
|
|
2232
2232
|
const C = [], A = [];
|
|
2233
2233
|
do {
|
|
2234
2234
|
c++;
|
|
2235
|
-
const
|
|
2236
|
-
if (
|
|
2235
|
+
const b = c === a.length, z = b && p.length !== 0;
|
|
2236
|
+
if (b) {
|
|
2237
2237
|
if (m = A.length === 0 ? void 0 : C[C.length - 1], h = y, y = A.pop(), z)
|
|
2238
2238
|
if (s) {
|
|
2239
2239
|
h = h.slice();
|
|
2240
|
-
let
|
|
2240
|
+
let D = 0;
|
|
2241
2241
|
for (const [B, J] of p) {
|
|
2242
|
-
const Q = B -
|
|
2243
|
-
J === null ? (h.splice(Q, 1),
|
|
2242
|
+
const Q = B - D;
|
|
2243
|
+
J === null ? (h.splice(Q, 1), D++) : h[Q] = J;
|
|
2244
2244
|
}
|
|
2245
2245
|
} else {
|
|
2246
2246
|
h = Object.defineProperties(
|
|
2247
2247
|
{},
|
|
2248
2248
|
Object.getOwnPropertyDescriptors(h)
|
|
2249
2249
|
);
|
|
2250
|
-
for (const [
|
|
2251
|
-
h[
|
|
2250
|
+
for (const [D, B] of p)
|
|
2251
|
+
h[D] = B;
|
|
2252
2252
|
}
|
|
2253
|
-
c =
|
|
2253
|
+
c = r.index, a = r.keys, p = r.edits, s = r.inArray, r = r.prev;
|
|
2254
2254
|
} else if (y) {
|
|
2255
|
-
if (m = s ? c :
|
|
2255
|
+
if (m = s ? c : a[c], h = y[m], h == null)
|
|
2256
2256
|
continue;
|
|
2257
2257
|
C.push(m);
|
|
2258
2258
|
}
|
|
@@ -2260,15 +2260,15 @@ function Dt(e, t, n = Pe) {
|
|
|
2260
2260
|
if (!Array.isArray(h)) {
|
|
2261
2261
|
var g, I;
|
|
2262
2262
|
Se(h) || K(!1, `Invalid AST Node: ${Ee(h)}.`);
|
|
2263
|
-
const
|
|
2264
|
-
if (_ =
|
|
2263
|
+
const D = b ? (g = i.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (I = i.get(h.kind)) === null || I === void 0 ? void 0 : I.enter;
|
|
2264
|
+
if (_ = D == null ? void 0 : D.call(t, h, m, y, C, A), _ === Pt)
|
|
2265
2265
|
break;
|
|
2266
2266
|
if (_ === !1) {
|
|
2267
|
-
if (!
|
|
2267
|
+
if (!b) {
|
|
2268
2268
|
C.pop();
|
|
2269
2269
|
continue;
|
|
2270
2270
|
}
|
|
2271
|
-
} else if (_ !== void 0 && (p.push([m, _]), !
|
|
2271
|
+
} else if (_ !== void 0 && (p.push([m, _]), !b))
|
|
2272
2272
|
if (Se(_))
|
|
2273
2273
|
h = _;
|
|
2274
2274
|
else {
|
|
@@ -2276,22 +2276,22 @@ function Dt(e, t, n = Pe) {
|
|
|
2276
2276
|
continue;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
if (_ === void 0 && z && p.push([m, h]),
|
|
2279
|
+
if (_ === void 0 && z && p.push([m, h]), b)
|
|
2280
2280
|
C.pop();
|
|
2281
2281
|
else {
|
|
2282
|
-
var
|
|
2283
|
-
|
|
2282
|
+
var P;
|
|
2283
|
+
r = {
|
|
2284
2284
|
inArray: s,
|
|
2285
2285
|
index: c,
|
|
2286
|
-
keys:
|
|
2286
|
+
keys: a,
|
|
2287
2287
|
edits: p,
|
|
2288
|
-
prev:
|
|
2289
|
-
}, s = Array.isArray(h),
|
|
2288
|
+
prev: r
|
|
2289
|
+
}, s = Array.isArray(h), a = s ? h : (P = n[h.kind]) !== null && P !== void 0 ? P : [], c = -1, p = [], y && A.push(y), y = h;
|
|
2290
2290
|
}
|
|
2291
|
-
} while (
|
|
2291
|
+
} while (r !== void 0);
|
|
2292
2292
|
return p.length !== 0 ? p[p.length - 1][1] : e;
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function Dt(e, t) {
|
|
2295
2295
|
const n = e[t];
|
|
2296
2296
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
2297
2297
|
enter: n,
|
|
@@ -2302,7 +2302,7 @@ function Pt(e, t) {
|
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
function kt(e) {
|
|
2305
|
-
return
|
|
2305
|
+
return bt(e, Lt);
|
|
2306
2306
|
}
|
|
2307
2307
|
const _t = 80, Lt = {
|
|
2308
2308
|
Name: {
|
|
@@ -2313,17 +2313,17 @@ const _t = 80, Lt = {
|
|
|
2313
2313
|
},
|
|
2314
2314
|
// Document
|
|
2315
2315
|
Document: {
|
|
2316
|
-
leave: (e) =>
|
|
2316
|
+
leave: (e) => l(e.definitions, `
|
|
2317
2317
|
|
|
2318
2318
|
`)
|
|
2319
2319
|
},
|
|
2320
2320
|
OperationDefinition: {
|
|
2321
2321
|
leave(e) {
|
|
2322
|
-
const t = v("(",
|
|
2322
|
+
const t = v("(", l(e.variableDefinitions, ", "), ")"), n = l(
|
|
2323
2323
|
[
|
|
2324
2324
|
e.operation,
|
|
2325
|
-
|
|
2326
|
-
|
|
2325
|
+
l([e.name, t]),
|
|
2326
|
+
l(e.directives, " ")
|
|
2327
2327
|
],
|
|
2328
2328
|
" "
|
|
2329
2329
|
);
|
|
@@ -2331,19 +2331,19 @@ const _t = 80, Lt = {
|
|
|
2331
2331
|
}
|
|
2332
2332
|
},
|
|
2333
2333
|
VariableDefinition: {
|
|
2334
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives:
|
|
2334
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + v(" = ", n) + v(" ", l(i, " "))
|
|
2335
2335
|
},
|
|
2336
2336
|
SelectionSet: {
|
|
2337
2337
|
leave: ({ selections: e }) => k(e)
|
|
2338
2338
|
},
|
|
2339
2339
|
Field: {
|
|
2340
|
-
leave({ alias: e, name: t, arguments: n, directives:
|
|
2340
|
+
leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
|
|
2341
2341
|
const s = v("", e, ": ") + t;
|
|
2342
|
-
let
|
|
2343
|
-
return
|
|
2344
|
-
`, Z(
|
|
2342
|
+
let a = s + v("(", l(n, ", "), ")");
|
|
2343
|
+
return a.length > _t && (a = s + v(`(
|
|
2344
|
+
`, Z(l(n, `
|
|
2345
2345
|
`)), `
|
|
2346
|
-
)`)),
|
|
2346
|
+
)`)), l([a, l(i, " "), r], " ");
|
|
2347
2347
|
}
|
|
2348
2348
|
},
|
|
2349
2349
|
Argument: {
|
|
@@ -2351,23 +2351,23 @@ const _t = 80, Lt = {
|
|
|
2351
2351
|
},
|
|
2352
2352
|
// Fragments
|
|
2353
2353
|
FragmentSpread: {
|
|
2354
|
-
leave: ({ name: e, directives: t }) => "..." + e + v(" ",
|
|
2354
|
+
leave: ({ name: e, directives: t }) => "..." + e + v(" ", l(t, " "))
|
|
2355
2355
|
},
|
|
2356
2356
|
InlineFragment: {
|
|
2357
|
-
leave: ({ typeCondition: e, directives: t, selectionSet: n }) =>
|
|
2357
|
+
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => l(
|
|
2358
2358
|
[
|
|
2359
2359
|
"...",
|
|
2360
2360
|
v("on ", e),
|
|
2361
|
-
|
|
2361
|
+
l(t, " "),
|
|
2362
2362
|
n
|
|
2363
2363
|
],
|
|
2364
2364
|
" "
|
|
2365
2365
|
)
|
|
2366
2366
|
},
|
|
2367
2367
|
FragmentDefinition: {
|
|
2368
|
-
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives:
|
|
2368
|
+
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
|
|
2369
2369
|
// or removed in the future.
|
|
2370
|
-
`fragment ${e}${v("(",
|
|
2370
|
+
`fragment ${e}${v("(", l(n, ", "), ")")} on ${t} ${v("", l(i, " "), " ")}` + r
|
|
2371
2371
|
)
|
|
2372
2372
|
},
|
|
2373
2373
|
// Value
|
|
@@ -2378,7 +2378,7 @@ const _t = 80, Lt = {
|
|
|
2378
2378
|
leave: ({ value: e }) => e
|
|
2379
2379
|
},
|
|
2380
2380
|
StringValue: {
|
|
2381
|
-
leave: ({ value: e, block: t }) => t ?
|
|
2381
|
+
leave: ({ value: e, block: t }) => t ? it(e) : Rt(e)
|
|
2382
2382
|
},
|
|
2383
2383
|
BooleanValue: {
|
|
2384
2384
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2390,17 +2390,17 @@ const _t = 80, Lt = {
|
|
|
2390
2390
|
leave: ({ value: e }) => e
|
|
2391
2391
|
},
|
|
2392
2392
|
ListValue: {
|
|
2393
|
-
leave: ({ values: e }) => "[" +
|
|
2393
|
+
leave: ({ values: e }) => "[" + l(e, ", ") + "]"
|
|
2394
2394
|
},
|
|
2395
2395
|
ObjectValue: {
|
|
2396
|
-
leave: ({ fields: e }) => "{" +
|
|
2396
|
+
leave: ({ fields: e }) => "{" + l(e, ", ") + "}"
|
|
2397
2397
|
},
|
|
2398
2398
|
ObjectField: {
|
|
2399
2399
|
leave: ({ name: e, value: t }) => e + ": " + t
|
|
2400
2400
|
},
|
|
2401
2401
|
// Directive
|
|
2402
2402
|
Directive: {
|
|
2403
|
-
leave: ({ name: e, arguments: t }) => "@" + e + v("(",
|
|
2403
|
+
leave: ({ name: e, arguments: t }) => "@" + e + v("(", l(t, ", "), ")")
|
|
2404
2404
|
},
|
|
2405
2405
|
// Type
|
|
2406
2406
|
NamedType: {
|
|
@@ -2415,139 +2415,139 @@ const _t = 80, Lt = {
|
|
|
2415
2415
|
// Type System Definitions
|
|
2416
2416
|
SchemaDefinition: {
|
|
2417
2417
|
leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
|
|
2418
|
-
`) +
|
|
2418
|
+
`) + l(["schema", l(t, " "), k(n)], " ")
|
|
2419
2419
|
},
|
|
2420
2420
|
OperationTypeDefinition: {
|
|
2421
2421
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
2422
2422
|
},
|
|
2423
2423
|
ScalarTypeDefinition: {
|
|
2424
2424
|
leave: ({ description: e, name: t, directives: n }) => v("", e, `
|
|
2425
|
-
`) +
|
|
2425
|
+
`) + l(["scalar", t, l(n, " ")], " ")
|
|
2426
2426
|
},
|
|
2427
2427
|
ObjectTypeDefinition: {
|
|
2428
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2429
|
-
`) +
|
|
2428
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => v("", e, `
|
|
2429
|
+
`) + l(
|
|
2430
2430
|
[
|
|
2431
2431
|
"type",
|
|
2432
2432
|
t,
|
|
2433
|
-
v("implements ",
|
|
2434
|
-
|
|
2435
|
-
k(
|
|
2433
|
+
v("implements ", l(n, " & ")),
|
|
2434
|
+
l(i, " "),
|
|
2435
|
+
k(r)
|
|
2436
2436
|
],
|
|
2437
2437
|
" "
|
|
2438
2438
|
)
|
|
2439
2439
|
},
|
|
2440
2440
|
FieldDefinition: {
|
|
2441
|
-
leave: ({ description: e, name: t, arguments: n, type:
|
|
2442
|
-
`) + t + (
|
|
2443
|
-
`, Z(
|
|
2441
|
+
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => v("", e, `
|
|
2442
|
+
`) + t + (Ne(n) ? v(`(
|
|
2443
|
+
`, Z(l(n, `
|
|
2444
2444
|
`)), `
|
|
2445
|
-
)`) : v("(",
|
|
2445
|
+
)`) : v("(", l(n, ", "), ")")) + ": " + i + v(" ", l(r, " "))
|
|
2446
2446
|
},
|
|
2447
2447
|
InputValueDefinition: {
|
|
2448
|
-
leave: ({ description: e, name: t, type: n, defaultValue:
|
|
2449
|
-
`) +
|
|
2450
|
-
[t + ": " + n, v("= ",
|
|
2448
|
+
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => v("", e, `
|
|
2449
|
+
`) + l(
|
|
2450
|
+
[t + ": " + n, v("= ", i), l(r, " ")],
|
|
2451
2451
|
" "
|
|
2452
2452
|
)
|
|
2453
2453
|
},
|
|
2454
2454
|
InterfaceTypeDefinition: {
|
|
2455
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2456
|
-
`) +
|
|
2455
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => v("", e, `
|
|
2456
|
+
`) + l(
|
|
2457
2457
|
[
|
|
2458
2458
|
"interface",
|
|
2459
2459
|
t,
|
|
2460
|
-
v("implements ",
|
|
2461
|
-
|
|
2462
|
-
k(
|
|
2460
|
+
v("implements ", l(n, " & ")),
|
|
2461
|
+
l(i, " "),
|
|
2462
|
+
k(r)
|
|
2463
2463
|
],
|
|
2464
2464
|
" "
|
|
2465
2465
|
)
|
|
2466
2466
|
},
|
|
2467
2467
|
UnionTypeDefinition: {
|
|
2468
|
-
leave: ({ description: e, name: t, directives: n, types:
|
|
2469
|
-
`) +
|
|
2470
|
-
["union", t,
|
|
2468
|
+
leave: ({ description: e, name: t, directives: n, types: i }) => v("", e, `
|
|
2469
|
+
`) + l(
|
|
2470
|
+
["union", t, l(n, " "), v("= ", l(i, " | "))],
|
|
2471
2471
|
" "
|
|
2472
2472
|
)
|
|
2473
2473
|
},
|
|
2474
2474
|
EnumTypeDefinition: {
|
|
2475
|
-
leave: ({ description: e, name: t, directives: n, values:
|
|
2476
|
-
`) +
|
|
2475
|
+
leave: ({ description: e, name: t, directives: n, values: i }) => v("", e, `
|
|
2476
|
+
`) + l(["enum", t, l(n, " "), k(i)], " ")
|
|
2477
2477
|
},
|
|
2478
2478
|
EnumValueDefinition: {
|
|
2479
2479
|
leave: ({ description: e, name: t, directives: n }) => v("", e, `
|
|
2480
|
-
`) +
|
|
2480
|
+
`) + l([t, l(n, " ")], " ")
|
|
2481
2481
|
},
|
|
2482
2482
|
InputObjectTypeDefinition: {
|
|
2483
|
-
leave: ({ description: e, name: t, directives: n, fields:
|
|
2484
|
-
`) +
|
|
2483
|
+
leave: ({ description: e, name: t, directives: n, fields: i }) => v("", e, `
|
|
2484
|
+
`) + l(["input", t, l(n, " "), k(i)], " ")
|
|
2485
2485
|
},
|
|
2486
2486
|
DirectiveDefinition: {
|
|
2487
|
-
leave: ({ description: e, name: t, arguments: n, repeatable:
|
|
2488
|
-
`) + "directive @" + t + (
|
|
2489
|
-
`, Z(
|
|
2487
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => v("", e, `
|
|
2488
|
+
`) + "directive @" + t + (Ne(n) ? v(`(
|
|
2489
|
+
`, Z(l(n, `
|
|
2490
2490
|
`)), `
|
|
2491
|
-
)`) : v("(",
|
|
2491
|
+
)`) : v("(", l(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + l(r, " | ")
|
|
2492
2492
|
},
|
|
2493
2493
|
SchemaExtension: {
|
|
2494
|
-
leave: ({ directives: e, operationTypes: t }) =>
|
|
2495
|
-
["extend schema",
|
|
2494
|
+
leave: ({ directives: e, operationTypes: t }) => l(
|
|
2495
|
+
["extend schema", l(e, " "), k(t)],
|
|
2496
2496
|
" "
|
|
2497
2497
|
)
|
|
2498
2498
|
},
|
|
2499
2499
|
ScalarTypeExtension: {
|
|
2500
|
-
leave: ({ name: e, directives: t }) =>
|
|
2500
|
+
leave: ({ name: e, directives: t }) => l(["extend scalar", e, l(t, " ")], " ")
|
|
2501
2501
|
},
|
|
2502
2502
|
ObjectTypeExtension: {
|
|
2503
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
2503
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: i }) => l(
|
|
2504
2504
|
[
|
|
2505
2505
|
"extend type",
|
|
2506
2506
|
e,
|
|
2507
|
-
v("implements ",
|
|
2508
|
-
|
|
2509
|
-
k(
|
|
2507
|
+
v("implements ", l(t, " & ")),
|
|
2508
|
+
l(n, " "),
|
|
2509
|
+
k(i)
|
|
2510
2510
|
],
|
|
2511
2511
|
" "
|
|
2512
2512
|
)
|
|
2513
2513
|
},
|
|
2514
2514
|
InterfaceTypeExtension: {
|
|
2515
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
2515
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: i }) => l(
|
|
2516
2516
|
[
|
|
2517
2517
|
"extend interface",
|
|
2518
2518
|
e,
|
|
2519
|
-
v("implements ",
|
|
2520
|
-
|
|
2521
|
-
k(
|
|
2519
|
+
v("implements ", l(t, " & ")),
|
|
2520
|
+
l(n, " "),
|
|
2521
|
+
k(i)
|
|
2522
2522
|
],
|
|
2523
2523
|
" "
|
|
2524
2524
|
)
|
|
2525
2525
|
},
|
|
2526
2526
|
UnionTypeExtension: {
|
|
2527
|
-
leave: ({ name: e, directives: t, types: n }) =>
|
|
2527
|
+
leave: ({ name: e, directives: t, types: n }) => l(
|
|
2528
2528
|
[
|
|
2529
2529
|
"extend union",
|
|
2530
2530
|
e,
|
|
2531
|
-
|
|
2532
|
-
v("= ",
|
|
2531
|
+
l(t, " "),
|
|
2532
|
+
v("= ", l(n, " | "))
|
|
2533
2533
|
],
|
|
2534
2534
|
" "
|
|
2535
2535
|
)
|
|
2536
2536
|
},
|
|
2537
2537
|
EnumTypeExtension: {
|
|
2538
|
-
leave: ({ name: e, directives: t, values: n }) =>
|
|
2538
|
+
leave: ({ name: e, directives: t, values: n }) => l(["extend enum", e, l(t, " "), k(n)], " ")
|
|
2539
2539
|
},
|
|
2540
2540
|
InputObjectTypeExtension: {
|
|
2541
|
-
leave: ({ name: e, directives: t, fields: n }) =>
|
|
2541
|
+
leave: ({ name: e, directives: t, fields: n }) => l(["extend input", e, l(t, " "), k(n)], " ")
|
|
2542
2542
|
}
|
|
2543
2543
|
};
|
|
2544
|
-
function
|
|
2544
|
+
function l(e, t = "") {
|
|
2545
2545
|
var n;
|
|
2546
|
-
return (n = e == null ? void 0 : e.filter((
|
|
2546
|
+
return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
|
|
2547
2547
|
}
|
|
2548
2548
|
function k(e) {
|
|
2549
2549
|
return v(`{
|
|
2550
|
-
`, Z(
|
|
2550
|
+
`, Z(l(e, `
|
|
2551
2551
|
`)), `
|
|
2552
2552
|
}`);
|
|
2553
2553
|
}
|
|
@@ -2558,12 +2558,12 @@ function Z(e) {
|
|
|
2558
2558
|
return v(" ", e.replace(/\n/g, `
|
|
2559
2559
|
`));
|
|
2560
2560
|
}
|
|
2561
|
-
function
|
|
2561
|
+
function Ne(e) {
|
|
2562
2562
|
var t;
|
|
2563
2563
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2564
2564
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2565
2565
|
}
|
|
2566
|
-
var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), qe = !0,
|
|
2566
|
+
var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), qe = !0, re = !1;
|
|
2567
2567
|
function Ge(e) {
|
|
2568
2568
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2569
2569
|
}
|
|
@@ -2572,21 +2572,21 @@ function wt(e) {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
function Ft(e) {
|
|
2574
2574
|
var t = /* @__PURE__ */ new Set(), n = [];
|
|
2575
|
-
return e.definitions.forEach(function(
|
|
2576
|
-
if (
|
|
2577
|
-
var
|
|
2578
|
-
|
|
2575
|
+
return e.definitions.forEach(function(i) {
|
|
2576
|
+
if (i.kind === "FragmentDefinition") {
|
|
2577
|
+
var r = i.name.value, s = wt(i.loc), a = ge.get(r);
|
|
2578
|
+
a && !a.has(s) ? qe && console.warn("Warning: fragment with name " + r + ` already exists.
|
|
2579
2579
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
2580
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) :
|
|
2580
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || ge.set(r, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(i));
|
|
2581
2581
|
} else
|
|
2582
|
-
n.push(
|
|
2582
|
+
n.push(i);
|
|
2583
2583
|
}), ne(ne({}, e), { definitions: n });
|
|
2584
2584
|
}
|
|
2585
2585
|
function Bt(e) {
|
|
2586
2586
|
var t = new Set(e.definitions);
|
|
2587
|
-
t.forEach(function(
|
|
2588
|
-
|
|
2589
|
-
var s = r
|
|
2587
|
+
t.forEach(function(i) {
|
|
2588
|
+
i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
|
|
2589
|
+
var s = i[r];
|
|
2590
2590
|
s && typeof s == "object" && t.add(s);
|
|
2591
2591
|
});
|
|
2592
2592
|
});
|
|
@@ -2597,8 +2597,8 @@ function Ut(e) {
|
|
|
2597
2597
|
var t = Ge(e);
|
|
2598
2598
|
if (!ee.has(t)) {
|
|
2599
2599
|
var n = Ue(e, {
|
|
2600
|
-
experimentalFragmentVariables:
|
|
2601
|
-
allowLegacyFragmentVariables:
|
|
2600
|
+
experimentalFragmentVariables: re,
|
|
2601
|
+
allowLegacyFragmentVariables: re
|
|
2602
2602
|
});
|
|
2603
2603
|
if (!n || n.kind !== "Document")
|
|
2604
2604
|
throw new Error("Not a valid GraphQL document.");
|
|
@@ -2610,10 +2610,10 @@ function q(e) {
|
|
|
2610
2610
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
2611
2611
|
t[n - 1] = arguments[n];
|
|
2612
2612
|
typeof e == "string" && (e = [e]);
|
|
2613
|
-
var
|
|
2614
|
-
return t.forEach(function(
|
|
2615
|
-
|
|
2616
|
-
}), Ut(
|
|
2613
|
+
var i = e[0];
|
|
2614
|
+
return t.forEach(function(r, s) {
|
|
2615
|
+
r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
|
|
2616
|
+
}), Ut(i);
|
|
2617
2617
|
}
|
|
2618
2618
|
function Mt() {
|
|
2619
2619
|
ee.clear(), ge.clear();
|
|
@@ -2622,10 +2622,10 @@ function qt() {
|
|
|
2622
2622
|
qe = !1;
|
|
2623
2623
|
}
|
|
2624
2624
|
function Gt() {
|
|
2625
|
-
|
|
2625
|
+
re = !0;
|
|
2626
2626
|
}
|
|
2627
2627
|
function Vt() {
|
|
2628
|
-
|
|
2628
|
+
re = !1;
|
|
2629
2629
|
}
|
|
2630
2630
|
var $ = {
|
|
2631
2631
|
gql: q,
|
|
@@ -2638,7 +2638,7 @@ var $ = {
|
|
|
2638
2638
|
e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
|
|
2639
2639
|
})(q || (q = {}));
|
|
2640
2640
|
q.default = q;
|
|
2641
|
-
const
|
|
2641
|
+
const N = q, $t = N`
|
|
2642
2642
|
query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2643
2643
|
locationAvailabilities(
|
|
2644
2644
|
sku: $sku
|
|
@@ -2677,7 +2677,7 @@ const x = q, $t = x`
|
|
|
2677
2677
|
}
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
-
`, jt =
|
|
2680
|
+
`, jt = N`
|
|
2681
2681
|
query GetLocationAvailability($sku: String!, $locationID: ID!) {
|
|
2682
2682
|
locationAvailability(sku: $sku, locationID: $locationID) {
|
|
2683
2683
|
location {
|
|
@@ -2703,7 +2703,7 @@ const x = q, $t = x`
|
|
|
2703
2703
|
inventoryQuantity
|
|
2704
2704
|
}
|
|
2705
2705
|
}
|
|
2706
|
-
`, Ht =
|
|
2706
|
+
`, Ht = N`
|
|
2707
2707
|
query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
|
|
2708
2708
|
purchasingCustomerMetafield(namespace: $namespace, key: $key) {
|
|
2709
2709
|
id
|
|
@@ -2712,7 +2712,7 @@ const x = q, $t = x`
|
|
|
2712
2712
|
value
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
`, Yt =
|
|
2715
|
+
`, Yt = N`
|
|
2716
2716
|
query GetPoints {
|
|
2717
2717
|
purchasingCustomer {
|
|
2718
2718
|
pointsApproved
|
|
@@ -2724,7 +2724,7 @@ const x = q, $t = x`
|
|
|
2724
2724
|
}
|
|
2725
2725
|
}
|
|
2726
2726
|
}
|
|
2727
|
-
`, zt =
|
|
2727
|
+
`, zt = N`
|
|
2728
2728
|
query GetLocations($first: Int, $after: String, $filter: LocationFilter, $isReverse: Boolean! = false) {
|
|
2729
2729
|
locations(first: $first, after: $after, filter: $filter, isReverse: $isReverse) {
|
|
2730
2730
|
nodes {
|
|
@@ -2755,7 +2755,7 @@ const x = q, $t = x`
|
|
|
2755
2755
|
}
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
|
-
`, Jt =
|
|
2758
|
+
`, Jt = N`
|
|
2759
2759
|
query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2760
2760
|
purchasingCustomer {
|
|
2761
2761
|
id
|
|
@@ -2784,14 +2784,14 @@ const x = q, $t = x`
|
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
|
-
`, Qt =
|
|
2787
|
+
`, Qt = N`
|
|
2788
2788
|
query GetPurchasingCustomerDiscountCodeCount {
|
|
2789
2789
|
purchasingCustomer {
|
|
2790
2790
|
id
|
|
2791
2791
|
orderPriceAdjustmentRuleCount
|
|
2792
2792
|
}
|
|
2793
2793
|
}
|
|
2794
|
-
`, Xt =
|
|
2794
|
+
`, Xt = N`
|
|
2795
2795
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
2796
2796
|
purchasingCustomer {
|
|
2797
2797
|
id
|
|
@@ -2851,7 +2851,7 @@ const x = q, $t = x`
|
|
|
2851
2851
|
}
|
|
2852
2852
|
}
|
|
2853
2853
|
}
|
|
2854
|
-
`, Wt =
|
|
2854
|
+
`, Wt = N`
|
|
2855
2855
|
query GetPurchasingCustomerRank {
|
|
2856
2856
|
purchasingCustomer {
|
|
2857
2857
|
currentCustomerRank {
|
|
@@ -2868,6 +2868,8 @@ const x = q, $t = x`
|
|
|
2868
2868
|
name
|
|
2869
2869
|
threshold
|
|
2870
2870
|
}
|
|
2871
|
+
earnedPoint
|
|
2872
|
+
purchasePrice
|
|
2871
2873
|
earnedPointToRankUp
|
|
2872
2874
|
purchasePriceToRankUp
|
|
2873
2875
|
calculationCondition {
|
|
@@ -2890,14 +2892,14 @@ const x = q, $t = x`
|
|
|
2890
2892
|
}
|
|
2891
2893
|
}
|
|
2892
2894
|
}
|
|
2893
|
-
`, Kt =
|
|
2895
|
+
`, Kt = N`
|
|
2894
2896
|
query GetSharingPurchasingCustomerCount {
|
|
2895
2897
|
purchasingCustomer {
|
|
2896
2898
|
id
|
|
2897
2899
|
sharingPurchasingCustomerCount
|
|
2898
2900
|
}
|
|
2899
2901
|
}
|
|
2900
|
-
`, Zt =
|
|
2902
|
+
`, Zt = N`
|
|
2901
2903
|
query GetPurchasingCustomerSharing {
|
|
2902
2904
|
purchasingCustomer {
|
|
2903
2905
|
id
|
|
@@ -2914,7 +2916,7 @@ const x = q, $t = x`
|
|
|
2914
2916
|
}
|
|
2915
2917
|
}
|
|
2916
2918
|
}
|
|
2917
|
-
`, en =
|
|
2919
|
+
`, en = N`
|
|
2918
2920
|
query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
|
|
2919
2921
|
productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
|
|
2920
2922
|
id
|
|
@@ -2946,7 +2948,14 @@ const x = q, $t = x`
|
|
|
2946
2948
|
}
|
|
2947
2949
|
}
|
|
2948
2950
|
}
|
|
2949
|
-
`, tn =
|
|
2951
|
+
`, tn = N`
|
|
2952
|
+
query GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID($id: String!) {
|
|
2953
|
+
productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
|
|
2954
|
+
id
|
|
2955
|
+
hasBackOrderProductVariants
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
`, nn = N`
|
|
2950
2959
|
query GetPointCampaignOrderRuleTargetCustomerRank {
|
|
2951
2960
|
pointCampaignOrderRuleTargetCustomerRank {
|
|
2952
2961
|
pointCampaignOrderRule {
|
|
@@ -2959,7 +2968,7 @@ const x = q, $t = x`
|
|
|
2959
2968
|
fixedPoint
|
|
2960
2969
|
}
|
|
2961
2970
|
}
|
|
2962
|
-
`,
|
|
2971
|
+
`, rn = N`
|
|
2963
2972
|
query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
|
|
2964
2973
|
estimatedShopifyCartPoint(input: $input) {
|
|
2965
2974
|
pointsEarning
|
|
@@ -2975,7 +2984,7 @@ const x = q, $t = x`
|
|
|
2975
2984
|
}
|
|
2976
2985
|
}
|
|
2977
2986
|
}
|
|
2978
|
-
`,
|
|
2987
|
+
`, sn = N`
|
|
2979
2988
|
query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
|
|
2980
2989
|
estimatedShopifyCartLineItemPoint(input: $input) {
|
|
2981
2990
|
pointsEarning
|
|
@@ -2991,7 +3000,7 @@ const x = q, $t = x`
|
|
|
2991
3000
|
}
|
|
2992
3001
|
}
|
|
2993
3002
|
}
|
|
2994
|
-
`,
|
|
3003
|
+
`, an = N`
|
|
2995
3004
|
mutation PurchasingCustomerSendCustomerSharingActivationCode {
|
|
2996
3005
|
purchasingCustomerSendCustomerSharingActivationCode {
|
|
2997
3006
|
purchasingCustomer {
|
|
@@ -3007,7 +3016,7 @@ const x = q, $t = x`
|
|
|
3007
3016
|
}
|
|
3008
3017
|
}
|
|
3009
3018
|
}
|
|
3010
|
-
`, on =
|
|
3019
|
+
`, on = N`
|
|
3011
3020
|
mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
|
|
3012
3021
|
purchasingCustomerActivateCustomerSharing(
|
|
3013
3022
|
input: {email: $email, activationCode: $activationCode}
|
|
@@ -3022,92 +3031,95 @@ const x = q, $t = x`
|
|
|
3022
3031
|
}
|
|
3023
3032
|
}
|
|
3024
3033
|
}
|
|
3025
|
-
`,
|
|
3026
|
-
function
|
|
3034
|
+
`, un = (e, t, n, i) => e();
|
|
3035
|
+
function cn(e, t = un) {
|
|
3027
3036
|
return {
|
|
3028
|
-
GetLocationAvailabilities(n,
|
|
3029
|
-
return t((
|
|
3037
|
+
GetLocationAvailabilities(n, i) {
|
|
3038
|
+
return t((r) => e.request($t, n, { ...i, ...r }), "GetLocationAvailabilities", "query", n);
|
|
3039
|
+
},
|
|
3040
|
+
GetLocationAvailability(n, i) {
|
|
3041
|
+
return t((r) => e.request(jt, n, { ...i, ...r }), "GetLocationAvailability", "query", n);
|
|
3030
3042
|
},
|
|
3031
|
-
|
|
3032
|
-
return t((
|
|
3043
|
+
GetPurchasingCustomerMetafield(n, i) {
|
|
3044
|
+
return t((r) => e.request(Ht, n, { ...i, ...r }), "GetPurchasingCustomerMetafield", "query", n);
|
|
3033
3045
|
},
|
|
3034
|
-
|
|
3035
|
-
return t((
|
|
3046
|
+
GetPoints(n, i) {
|
|
3047
|
+
return t((r) => e.request(Yt, n, { ...i, ...r }), "GetPoints", "query", n);
|
|
3036
3048
|
},
|
|
3037
|
-
|
|
3038
|
-
return t((
|
|
3049
|
+
GetLocations(n, i) {
|
|
3050
|
+
return t((r) => e.request(zt, n, { ...i, ...r }), "GetLocations", "query", n);
|
|
3039
3051
|
},
|
|
3040
|
-
|
|
3041
|
-
return t((
|
|
3052
|
+
GetPurchasingCustomerDiscounts(n, i) {
|
|
3053
|
+
return t((r) => e.request(Jt, n, { ...i, ...r }), "GetPurchasingCustomerDiscounts", "query", n);
|
|
3042
3054
|
},
|
|
3043
|
-
|
|
3044
|
-
return t((
|
|
3055
|
+
GetPurchasingCustomerDiscountCodeCount(n, i) {
|
|
3056
|
+
return t((r) => e.request(Qt, n, { ...i, ...r }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
|
|
3045
3057
|
},
|
|
3046
|
-
|
|
3047
|
-
return t((
|
|
3058
|
+
GetPurchasingCustomerPointChangeActivities(n, i) {
|
|
3059
|
+
return t((r) => e.request(Xt, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
|
|
3048
3060
|
},
|
|
3049
|
-
|
|
3050
|
-
return t((
|
|
3061
|
+
GetPurchasingCustomerRank(n, i) {
|
|
3062
|
+
return t((r) => e.request(Wt, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
|
|
3051
3063
|
},
|
|
3052
|
-
|
|
3053
|
-
return t((
|
|
3064
|
+
GetSharingPurchasingCustomerCount(n, i) {
|
|
3065
|
+
return t((r) => e.request(Kt, n, { ...i, ...r }), "GetSharingPurchasingCustomerCount", "query", n);
|
|
3054
3066
|
},
|
|
3055
|
-
|
|
3056
|
-
return t((
|
|
3067
|
+
GetPurchasingCustomerSharing(n, i) {
|
|
3068
|
+
return t((r) => e.request(Zt, n, { ...i, ...r }), "GetPurchasingCustomerSharing", "query", n);
|
|
3057
3069
|
},
|
|
3058
|
-
|
|
3059
|
-
return t((
|
|
3070
|
+
GetProduct(n, i) {
|
|
3071
|
+
return t((r) => e.request(en, n, { ...i, ...r }), "GetProduct", "query", n);
|
|
3060
3072
|
},
|
|
3061
|
-
|
|
3062
|
-
return t((
|
|
3073
|
+
GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n, i) {
|
|
3074
|
+
return t((r) => e.request(tn, n, { ...i, ...r }), "GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID", "query", n);
|
|
3063
3075
|
},
|
|
3064
|
-
GetPointCampaignOrderRuleTargetCustomerRank(n,
|
|
3065
|
-
return t((
|
|
3076
|
+
GetPointCampaignOrderRuleTargetCustomerRank(n, i) {
|
|
3077
|
+
return t((r) => e.request(nn, n, { ...i, ...r }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
|
|
3066
3078
|
},
|
|
3067
|
-
GetEstimatedShopifyCartPoint(n,
|
|
3068
|
-
return t((
|
|
3079
|
+
GetEstimatedShopifyCartPoint(n, i) {
|
|
3080
|
+
return t((r) => e.request(rn, n, { ...i, ...r }), "GetEstimatedShopifyCartPoint", "query", n);
|
|
3069
3081
|
},
|
|
3070
|
-
GetEstimatedShopifyCartLineItemPoint(n,
|
|
3071
|
-
return t((
|
|
3082
|
+
GetEstimatedShopifyCartLineItemPoint(n, i) {
|
|
3083
|
+
return t((r) => e.request(sn, n, { ...i, ...r }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
|
|
3072
3084
|
},
|
|
3073
|
-
PurchasingCustomerSendCustomerSharingActivationCode(n,
|
|
3074
|
-
return t((
|
|
3085
|
+
PurchasingCustomerSendCustomerSharingActivationCode(n, i) {
|
|
3086
|
+
return t((r) => e.request(an, n, { ...i, ...r }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
|
|
3075
3087
|
},
|
|
3076
|
-
PurchasingCustomerActivateCustomerSharing(n,
|
|
3077
|
-
return t((
|
|
3088
|
+
PurchasingCustomerActivateCustomerSharing(n, i) {
|
|
3089
|
+
return t((r) => e.request(on, n, { ...i, ...r }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
|
|
3078
3090
|
}
|
|
3079
3091
|
};
|
|
3080
3092
|
}
|
|
3081
|
-
const ve = JSON,
|
|
3093
|
+
const ve = JSON, dn = (e) => e.toUpperCase(), ln = (e) => {
|
|
3082
3094
|
const t = {};
|
|
3083
|
-
return e.forEach((n,
|
|
3084
|
-
t[
|
|
3095
|
+
return e.forEach((n, i) => {
|
|
3096
|
+
t[i] = n;
|
|
3085
3097
|
}), t;
|
|
3086
|
-
},
|
|
3098
|
+
}, pn = (e, t, n) => e.document ? e : {
|
|
3087
3099
|
document: e,
|
|
3088
3100
|
variables: t,
|
|
3089
3101
|
requestHeaders: n,
|
|
3090
3102
|
signal: void 0
|
|
3091
|
-
},
|
|
3103
|
+
}, hn = (e, t, n) => e.query ? e : {
|
|
3092
3104
|
query: e,
|
|
3093
3105
|
variables: t,
|
|
3094
3106
|
requestHeaders: n,
|
|
3095
3107
|
signal: void 0
|
|
3096
|
-
},
|
|
3108
|
+
}, fn = (e, t) => e.documents ? e : {
|
|
3097
3109
|
documents: e,
|
|
3098
3110
|
requestHeaders: t,
|
|
3099
3111
|
signal: void 0
|
|
3100
3112
|
}, xe = (e) => {
|
|
3101
|
-
var
|
|
3113
|
+
var i, r;
|
|
3102
3114
|
let t;
|
|
3103
3115
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
3104
|
-
return n.length === 1 && (t = (
|
|
3105
|
-
},
|
|
3116
|
+
return n.length === 1 && (t = (r = (i = n[0]) == null ? void 0 : i.name) == null ? void 0 : r.value), t;
|
|
3117
|
+
}, de = (e) => {
|
|
3106
3118
|
if (typeof e == "string") {
|
|
3107
3119
|
let n;
|
|
3108
3120
|
try {
|
|
3109
|
-
const
|
|
3110
|
-
n = xe(
|
|
3121
|
+
const i = Ue(e);
|
|
3122
|
+
n = xe(i);
|
|
3111
3123
|
} catch {
|
|
3112
3124
|
}
|
|
3113
3125
|
return { query: e, operationName: n };
|
|
@@ -3117,31 +3129,31 @@ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
|
|
|
3117
3129
|
};
|
|
3118
3130
|
class H extends Error {
|
|
3119
3131
|
constructor(t, n) {
|
|
3120
|
-
const
|
|
3132
|
+
const i = `${H.extractMessage(t)}: ${JSON.stringify({
|
|
3121
3133
|
response: t,
|
|
3122
3134
|
request: n
|
|
3123
3135
|
})}`;
|
|
3124
|
-
super(
|
|
3136
|
+
super(i), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
|
|
3125
3137
|
}
|
|
3126
3138
|
static extractMessage(t) {
|
|
3127
|
-
var n,
|
|
3128
|
-
return ((
|
|
3139
|
+
var n, i;
|
|
3140
|
+
return ((i = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : i.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
3129
3141
|
}
|
|
3130
3142
|
}
|
|
3131
|
-
var
|
|
3132
|
-
function
|
|
3143
|
+
var mn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3144
|
+
function gn(e) {
|
|
3133
3145
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3134
3146
|
}
|
|
3135
3147
|
var ye = { exports: {} };
|
|
3136
3148
|
(function(e, t) {
|
|
3137
|
-
var n = typeof self < "u" ? self :
|
|
3149
|
+
var n = typeof self < "u" ? self : mn, i = function() {
|
|
3138
3150
|
function s() {
|
|
3139
3151
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
3140
3152
|
}
|
|
3141
3153
|
return s.prototype = n, new s();
|
|
3142
3154
|
}();
|
|
3143
3155
|
(function(s) {
|
|
3144
|
-
(function(
|
|
3156
|
+
(function(a) {
|
|
3145
3157
|
var c = {
|
|
3146
3158
|
searchParams: "URLSearchParams" in s,
|
|
3147
3159
|
iterable: "Symbol" in s && "iterator" in Symbol,
|
|
@@ -3155,8 +3167,8 @@ var ye = { exports: {} };
|
|
|
3155
3167
|
formData: "FormData" in s,
|
|
3156
3168
|
arrayBuffer: "ArrayBuffer" in s
|
|
3157
3169
|
};
|
|
3158
|
-
function p(
|
|
3159
|
-
return
|
|
3170
|
+
function p(o) {
|
|
3171
|
+
return o && DataView.prototype.isPrototypeOf(o);
|
|
3160
3172
|
}
|
|
3161
3173
|
if (c.arrayBuffer)
|
|
3162
3174
|
var h = [
|
|
@@ -3169,108 +3181,108 @@ var ye = { exports: {} };
|
|
|
3169
3181
|
"[object Uint32Array]",
|
|
3170
3182
|
"[object Float32Array]",
|
|
3171
3183
|
"[object Float64Array]"
|
|
3172
|
-
], m = ArrayBuffer.isView || function(
|
|
3173
|
-
return
|
|
3184
|
+
], m = ArrayBuffer.isView || function(o) {
|
|
3185
|
+
return o && h.indexOf(Object.prototype.toString.call(o)) > -1;
|
|
3174
3186
|
};
|
|
3175
|
-
function y(
|
|
3176
|
-
if (typeof
|
|
3187
|
+
function y(o) {
|
|
3188
|
+
if (typeof o != "string" && (o = String(o)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))
|
|
3177
3189
|
throw new TypeError("Invalid character in header field name");
|
|
3178
|
-
return
|
|
3190
|
+
return o.toLowerCase();
|
|
3179
3191
|
}
|
|
3180
|
-
function C(
|
|
3181
|
-
return typeof
|
|
3192
|
+
function C(o) {
|
|
3193
|
+
return typeof o != "string" && (o = String(o)), o;
|
|
3182
3194
|
}
|
|
3183
|
-
function A(
|
|
3184
|
-
var
|
|
3195
|
+
function A(o) {
|
|
3196
|
+
var d = {
|
|
3185
3197
|
next: function() {
|
|
3186
|
-
var E =
|
|
3198
|
+
var E = o.shift();
|
|
3187
3199
|
return { done: E === void 0, value: E };
|
|
3188
3200
|
}
|
|
3189
3201
|
};
|
|
3190
|
-
return c.iterable && (
|
|
3191
|
-
return
|
|
3192
|
-
}),
|
|
3202
|
+
return c.iterable && (d[Symbol.iterator] = function() {
|
|
3203
|
+
return d;
|
|
3204
|
+
}), d;
|
|
3193
3205
|
}
|
|
3194
|
-
function g(
|
|
3195
|
-
this.map = {},
|
|
3196
|
-
this.append(E,
|
|
3197
|
-
}, this) : Array.isArray(
|
|
3198
|
-
this.append(
|
|
3199
|
-
}, this) :
|
|
3200
|
-
this.append(
|
|
3206
|
+
function g(o) {
|
|
3207
|
+
this.map = {}, o instanceof g ? o.forEach(function(d, E) {
|
|
3208
|
+
this.append(E, d);
|
|
3209
|
+
}, this) : Array.isArray(o) ? o.forEach(function(d) {
|
|
3210
|
+
this.append(d[0], d[1]);
|
|
3211
|
+
}, this) : o && Object.getOwnPropertyNames(o).forEach(function(d) {
|
|
3212
|
+
this.append(d, o[d]);
|
|
3201
3213
|
}, this);
|
|
3202
3214
|
}
|
|
3203
|
-
g.prototype.append = function(
|
|
3204
|
-
|
|
3205
|
-
var E = this.map[
|
|
3206
|
-
this.map[
|
|
3207
|
-
}, g.prototype.delete = function(
|
|
3208
|
-
delete this.map[y(
|
|
3209
|
-
}, g.prototype.get = function(
|
|
3210
|
-
return
|
|
3211
|
-
}, g.prototype.has = function(
|
|
3212
|
-
return this.map.hasOwnProperty(y(
|
|
3213
|
-
}, g.prototype.set = function(
|
|
3214
|
-
this.map[y(
|
|
3215
|
-
}, g.prototype.forEach = function(
|
|
3215
|
+
g.prototype.append = function(o, d) {
|
|
3216
|
+
o = y(o), d = C(d);
|
|
3217
|
+
var E = this.map[o];
|
|
3218
|
+
this.map[o] = E ? E + ", " + d : d;
|
|
3219
|
+
}, g.prototype.delete = function(o) {
|
|
3220
|
+
delete this.map[y(o)];
|
|
3221
|
+
}, g.prototype.get = function(o) {
|
|
3222
|
+
return o = y(o), this.has(o) ? this.map[o] : null;
|
|
3223
|
+
}, g.prototype.has = function(o) {
|
|
3224
|
+
return this.map.hasOwnProperty(y(o));
|
|
3225
|
+
}, g.prototype.set = function(o, d) {
|
|
3226
|
+
this.map[y(o)] = C(d);
|
|
3227
|
+
}, g.prototype.forEach = function(o, d) {
|
|
3216
3228
|
for (var E in this.map)
|
|
3217
|
-
this.map.hasOwnProperty(E) &&
|
|
3229
|
+
this.map.hasOwnProperty(E) && o.call(d, this.map[E], E, this);
|
|
3218
3230
|
}, g.prototype.keys = function() {
|
|
3219
|
-
var
|
|
3220
|
-
return this.forEach(function(
|
|
3221
|
-
|
|
3222
|
-
}), A(
|
|
3231
|
+
var o = [];
|
|
3232
|
+
return this.forEach(function(d, E) {
|
|
3233
|
+
o.push(E);
|
|
3234
|
+
}), A(o);
|
|
3223
3235
|
}, g.prototype.values = function() {
|
|
3224
|
-
var
|
|
3225
|
-
return this.forEach(function(
|
|
3226
|
-
|
|
3227
|
-
}), A(
|
|
3236
|
+
var o = [];
|
|
3237
|
+
return this.forEach(function(d) {
|
|
3238
|
+
o.push(d);
|
|
3239
|
+
}), A(o);
|
|
3228
3240
|
}, g.prototype.entries = function() {
|
|
3229
|
-
var
|
|
3230
|
-
return this.forEach(function(
|
|
3231
|
-
|
|
3232
|
-
}), A(
|
|
3241
|
+
var o = [];
|
|
3242
|
+
return this.forEach(function(d, E) {
|
|
3243
|
+
o.push([E, d]);
|
|
3244
|
+
}), A(o);
|
|
3233
3245
|
}, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
|
|
3234
|
-
function I(
|
|
3235
|
-
if (
|
|
3246
|
+
function I(o) {
|
|
3247
|
+
if (o.bodyUsed)
|
|
3236
3248
|
return Promise.reject(new TypeError("Already read"));
|
|
3237
|
-
|
|
3249
|
+
o.bodyUsed = !0;
|
|
3238
3250
|
}
|
|
3239
|
-
function
|
|
3240
|
-
return new Promise(function(
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
},
|
|
3244
|
-
E(
|
|
3251
|
+
function P(o) {
|
|
3252
|
+
return new Promise(function(d, E) {
|
|
3253
|
+
o.onload = function() {
|
|
3254
|
+
d(o.result);
|
|
3255
|
+
}, o.onerror = function() {
|
|
3256
|
+
E(o.error);
|
|
3245
3257
|
};
|
|
3246
3258
|
});
|
|
3247
3259
|
}
|
|
3248
|
-
function
|
|
3249
|
-
var
|
|
3250
|
-
return
|
|
3260
|
+
function b(o) {
|
|
3261
|
+
var d = new FileReader(), E = P(d);
|
|
3262
|
+
return d.readAsArrayBuffer(o), E;
|
|
3251
3263
|
}
|
|
3252
|
-
function z(
|
|
3253
|
-
var
|
|
3254
|
-
return
|
|
3264
|
+
function z(o) {
|
|
3265
|
+
var d = new FileReader(), E = P(d);
|
|
3266
|
+
return d.readAsText(o), E;
|
|
3255
3267
|
}
|
|
3256
|
-
function _(
|
|
3257
|
-
for (var
|
|
3258
|
-
E[
|
|
3268
|
+
function _(o) {
|
|
3269
|
+
for (var d = new Uint8Array(o), E = new Array(d.length), O = 0; O < d.length; O++)
|
|
3270
|
+
E[O] = String.fromCharCode(d[O]);
|
|
3259
3271
|
return E.join("");
|
|
3260
3272
|
}
|
|
3261
|
-
function
|
|
3262
|
-
if (
|
|
3263
|
-
return
|
|
3264
|
-
var
|
|
3265
|
-
return
|
|
3273
|
+
function D(o) {
|
|
3274
|
+
if (o.slice)
|
|
3275
|
+
return o.slice(0);
|
|
3276
|
+
var d = new Uint8Array(o.byteLength);
|
|
3277
|
+
return d.set(new Uint8Array(o)), d.buffer;
|
|
3266
3278
|
}
|
|
3267
3279
|
function B() {
|
|
3268
|
-
return this.bodyUsed = !1, this._initBody = function(
|
|
3269
|
-
this._bodyInit =
|
|
3280
|
+
return this.bodyUsed = !1, this._initBody = function(o) {
|
|
3281
|
+
this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : c.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : c.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : c.arrayBuffer && c.blob && p(o) ? (this._bodyArrayBuffer = D(o.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(o) || m(o)) ? this._bodyArrayBuffer = D(o) : this._bodyText = o = Object.prototype.toString.call(o) : this._bodyText = "", this.headers.get("content-type") || (typeof o == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
3270
3282
|
}, c.blob && (this.blob = function() {
|
|
3271
|
-
var
|
|
3272
|
-
if (
|
|
3273
|
-
return
|
|
3283
|
+
var o = I(this);
|
|
3284
|
+
if (o)
|
|
3285
|
+
return o;
|
|
3274
3286
|
if (this._bodyBlob)
|
|
3275
3287
|
return Promise.resolve(this._bodyBlob);
|
|
3276
3288
|
if (this._bodyArrayBuffer)
|
|
@@ -3279,11 +3291,11 @@ var ye = { exports: {} };
|
|
|
3279
3291
|
throw new Error("could not read FormData body as blob");
|
|
3280
3292
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
3281
3293
|
}, this.arrayBuffer = function() {
|
|
3282
|
-
return this._bodyArrayBuffer ? I(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(
|
|
3294
|
+
return this._bodyArrayBuffer ? I(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(b);
|
|
3283
3295
|
}), this.text = function() {
|
|
3284
|
-
var
|
|
3285
|
-
if (
|
|
3286
|
-
return
|
|
3296
|
+
var o = I(this);
|
|
3297
|
+
if (o)
|
|
3298
|
+
return o;
|
|
3287
3299
|
if (this._bodyBlob)
|
|
3288
3300
|
return z(this._bodyBlob);
|
|
3289
3301
|
if (this._bodyArrayBuffer)
|
|
@@ -3298,48 +3310,48 @@ var ye = { exports: {} };
|
|
|
3298
3310
|
}, this;
|
|
3299
3311
|
}
|
|
3300
3312
|
var J = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
3301
|
-
function Q(
|
|
3302
|
-
var
|
|
3303
|
-
return J.indexOf(
|
|
3313
|
+
function Q(o) {
|
|
3314
|
+
var d = o.toUpperCase();
|
|
3315
|
+
return J.indexOf(d) > -1 ? d : o;
|
|
3304
3316
|
}
|
|
3305
|
-
function w(
|
|
3306
|
-
|
|
3307
|
-
var E =
|
|
3308
|
-
if (
|
|
3309
|
-
if (
|
|
3317
|
+
function w(o, d) {
|
|
3318
|
+
d = d || {};
|
|
3319
|
+
var E = d.body;
|
|
3320
|
+
if (o instanceof w) {
|
|
3321
|
+
if (o.bodyUsed)
|
|
3310
3322
|
throw new TypeError("Already read");
|
|
3311
|
-
this.url =
|
|
3323
|
+
this.url = o.url, this.credentials = o.credentials, d.headers || (this.headers = new g(o.headers)), this.method = o.method, this.mode = o.mode, this.signal = o.signal, !E && o._bodyInit != null && (E = o._bodyInit, o.bodyUsed = !0);
|
|
3312
3324
|
} else
|
|
3313
|
-
this.url = String(
|
|
3314
|
-
if (this.credentials =
|
|
3325
|
+
this.url = String(o);
|
|
3326
|
+
if (this.credentials = d.credentials || this.credentials || "same-origin", (d.headers || !this.headers) && (this.headers = new g(d.headers)), this.method = Q(d.method || this.method || "GET"), this.mode = d.mode || this.mode || null, this.signal = d.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
|
|
3315
3327
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
3316
3328
|
this._initBody(E);
|
|
3317
3329
|
}
|
|
3318
3330
|
w.prototype.clone = function() {
|
|
3319
3331
|
return new w(this, { body: this._bodyInit });
|
|
3320
3332
|
};
|
|
3321
|
-
function Ve(
|
|
3322
|
-
var
|
|
3323
|
-
return
|
|
3333
|
+
function Ve(o) {
|
|
3334
|
+
var d = new FormData();
|
|
3335
|
+
return o.trim().split("&").forEach(function(E) {
|
|
3324
3336
|
if (E) {
|
|
3325
|
-
var
|
|
3326
|
-
|
|
3337
|
+
var O = E.split("="), x = O.shift().replace(/\+/g, " "), T = O.join("=").replace(/\+/g, " ");
|
|
3338
|
+
d.append(decodeURIComponent(x), decodeURIComponent(T));
|
|
3327
3339
|
}
|
|
3328
|
-
}),
|
|
3340
|
+
}), d;
|
|
3329
3341
|
}
|
|
3330
|
-
function $e(
|
|
3331
|
-
var
|
|
3332
|
-
return E.split(/\r?\n/).forEach(function(
|
|
3333
|
-
var
|
|
3342
|
+
function $e(o) {
|
|
3343
|
+
var d = new g(), E = o.replace(/\r?\n[\t ]+/g, " ");
|
|
3344
|
+
return E.split(/\r?\n/).forEach(function(O) {
|
|
3345
|
+
var x = O.split(":"), T = x.shift().trim();
|
|
3334
3346
|
if (T) {
|
|
3335
|
-
var X =
|
|
3336
|
-
|
|
3347
|
+
var X = x.join(":").trim();
|
|
3348
|
+
d.append(T, X);
|
|
3337
3349
|
}
|
|
3338
|
-
}),
|
|
3350
|
+
}), d;
|
|
3339
3351
|
}
|
|
3340
3352
|
B.call(w.prototype);
|
|
3341
|
-
function L(
|
|
3342
|
-
|
|
3353
|
+
function L(o, d) {
|
|
3354
|
+
d || (d = {}), this.type = "default", this.status = d.status === void 0 ? 200 : d.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in d ? d.statusText : "OK", this.headers = new g(d.headers), this.url = d.url || "", this._initBody(o);
|
|
3343
3355
|
}
|
|
3344
3356
|
B.call(L.prototype), L.prototype.clone = function() {
|
|
3345
3357
|
return new L(this._bodyInit, {
|
|
@@ -3349,29 +3361,29 @@ var ye = { exports: {} };
|
|
|
3349
3361
|
url: this.url
|
|
3350
3362
|
});
|
|
3351
3363
|
}, L.error = function() {
|
|
3352
|
-
var
|
|
3353
|
-
return
|
|
3364
|
+
var o = new L(null, { status: 0, statusText: "" });
|
|
3365
|
+
return o.type = "error", o;
|
|
3354
3366
|
};
|
|
3355
3367
|
var je = [301, 302, 303, 307, 308];
|
|
3356
|
-
L.redirect = function(
|
|
3357
|
-
if (je.indexOf(
|
|
3368
|
+
L.redirect = function(o, d) {
|
|
3369
|
+
if (je.indexOf(d) === -1)
|
|
3358
3370
|
throw new RangeError("Invalid status code");
|
|
3359
|
-
return new L(null, { status:
|
|
3360
|
-
},
|
|
3371
|
+
return new L(null, { status: d, headers: { location: o } });
|
|
3372
|
+
}, a.DOMException = s.DOMException;
|
|
3361
3373
|
try {
|
|
3362
|
-
new
|
|
3374
|
+
new a.DOMException();
|
|
3363
3375
|
} catch {
|
|
3364
|
-
|
|
3365
|
-
this.message =
|
|
3366
|
-
var
|
|
3367
|
-
this.stack =
|
|
3368
|
-
},
|
|
3376
|
+
a.DOMException = function(d, E) {
|
|
3377
|
+
this.message = d, this.name = E;
|
|
3378
|
+
var O = Error(d);
|
|
3379
|
+
this.stack = O.stack;
|
|
3380
|
+
}, a.DOMException.prototype = Object.create(Error.prototype), a.DOMException.prototype.constructor = a.DOMException;
|
|
3369
3381
|
}
|
|
3370
|
-
function
|
|
3371
|
-
return new Promise(function(E,
|
|
3372
|
-
var
|
|
3373
|
-
if (
|
|
3374
|
-
return
|
|
3382
|
+
function oe(o, d) {
|
|
3383
|
+
return new Promise(function(E, O) {
|
|
3384
|
+
var x = new w(o, d);
|
|
3385
|
+
if (x.signal && x.signal.aborted)
|
|
3386
|
+
return O(new a.DOMException("Aborted", "AbortError"));
|
|
3375
3387
|
var T = new XMLHttpRequest();
|
|
3376
3388
|
function X() {
|
|
3377
3389
|
T.abort();
|
|
@@ -3386,51 +3398,51 @@ var ye = { exports: {} };
|
|
|
3386
3398
|
var ue = "response" in T ? T.response : T.responseText;
|
|
3387
3399
|
E(new L(ue, V));
|
|
3388
3400
|
}, T.onerror = function() {
|
|
3389
|
-
|
|
3401
|
+
O(new TypeError("Network request failed"));
|
|
3390
3402
|
}, T.ontimeout = function() {
|
|
3391
|
-
|
|
3403
|
+
O(new TypeError("Network request failed"));
|
|
3392
3404
|
}, T.onabort = function() {
|
|
3393
|
-
|
|
3394
|
-
}, T.open(
|
|
3405
|
+
O(new a.DOMException("Aborted", "AbortError"));
|
|
3406
|
+
}, T.open(x.method, x.url, !0), x.credentials === "include" ? T.withCredentials = !0 : x.credentials === "omit" && (T.withCredentials = !1), "responseType" in T && c.blob && (T.responseType = "blob"), x.headers.forEach(function(V, ue) {
|
|
3395
3407
|
T.setRequestHeader(ue, V);
|
|
3396
|
-
}),
|
|
3397
|
-
T.readyState === 4 &&
|
|
3398
|
-
}), T.send(typeof
|
|
3408
|
+
}), x.signal && (x.signal.addEventListener("abort", X), T.onreadystatechange = function() {
|
|
3409
|
+
T.readyState === 4 && x.signal.removeEventListener("abort", X);
|
|
3410
|
+
}), T.send(typeof x._bodyInit > "u" ? null : x._bodyInit);
|
|
3399
3411
|
});
|
|
3400
3412
|
}
|
|
3401
|
-
return
|
|
3413
|
+
return oe.polyfill = !0, s.fetch || (s.fetch = oe, s.Headers = g, s.Request = w, s.Response = L), a.Headers = g, a.Request = w, a.Response = L, a.fetch = oe, Object.defineProperty(a, "__esModule", { value: !0 }), a;
|
|
3402
3414
|
})({});
|
|
3403
|
-
})(
|
|
3404
|
-
var
|
|
3405
|
-
t =
|
|
3415
|
+
})(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
|
|
3416
|
+
var r = i;
|
|
3417
|
+
t = r.fetch, t.default = r.fetch, t.fetch = r.fetch, t.Headers = r.Headers, t.Request = r.Request, t.Response = r.Response, e.exports = t;
|
|
3406
3418
|
})(ye, ye.exports);
|
|
3407
|
-
var
|
|
3408
|
-
const te = /* @__PURE__ */
|
|
3419
|
+
var ie = ye.exports;
|
|
3420
|
+
const te = /* @__PURE__ */ gn(ie), yn = /* @__PURE__ */ ze({
|
|
3409
3421
|
__proto__: null,
|
|
3410
3422
|
default: te
|
|
3411
|
-
}, [
|
|
3423
|
+
}, [ie]), U = (e) => {
|
|
3412
3424
|
let t = {};
|
|
3413
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
3414
|
-
n &&
|
|
3425
|
+
return e && (typeof Headers < "u" && e instanceof Headers || yn && ie.Headers && e instanceof ie.Headers ? t = ln(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
|
|
3426
|
+
n && i !== void 0 && (t[n] = i);
|
|
3415
3427
|
}) : t = e), t;
|
|
3416
|
-
},
|
|
3428
|
+
}, Oe = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Cn = (e) => {
|
|
3417
3429
|
if (!Array.isArray(e.query)) {
|
|
3418
|
-
const
|
|
3419
|
-
return e.variables &&
|
|
3430
|
+
const i = e, r = [`query=${encodeURIComponent(Oe(i.query))}`];
|
|
3431
|
+
return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
|
|
3420
3432
|
}
|
|
3421
3433
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
3422
3434
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
3423
|
-
const t = e, n = e.query.reduce((
|
|
3424
|
-
query:
|
|
3435
|
+
const t = e, n = e.query.reduce((i, r, s) => (i.push({
|
|
3436
|
+
query: Oe(r),
|
|
3425
3437
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
3426
|
-
}),
|
|
3438
|
+
}), i), []);
|
|
3427
3439
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
3428
|
-
},
|
|
3429
|
-
const { url: n, query:
|
|
3440
|
+
}, En = (e) => async (t) => {
|
|
3441
|
+
const { url: n, query: i, variables: r, operationName: s, fetch: a, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
|
|
3430
3442
|
let m = "", y;
|
|
3431
|
-
e === "POST" ? (y =
|
|
3432
|
-
query:
|
|
3433
|
-
variables:
|
|
3443
|
+
e === "POST" ? (y = Tn(i, r, s, c.jsonSerializer), typeof y == "string" && (h["Content-Type"] = "application/json")) : m = Cn({
|
|
3444
|
+
query: i,
|
|
3445
|
+
variables: r,
|
|
3434
3446
|
operationName: s,
|
|
3435
3447
|
jsonSerializer: c.jsonSerializer ?? ve
|
|
3436
3448
|
});
|
|
@@ -3442,18 +3454,18 @@ const te = /* @__PURE__ */ mn(re), gn = /* @__PURE__ */ ze({
|
|
|
3442
3454
|
};
|
|
3443
3455
|
let A = n, g = C;
|
|
3444
3456
|
if (p) {
|
|
3445
|
-
const I = await Promise.resolve(p({ ...C, url: n, operationName: s, variables:
|
|
3446
|
-
A =
|
|
3457
|
+
const I = await Promise.resolve(p({ ...C, url: n, operationName: s, variables: r })), { url: P, ...b } = I;
|
|
3458
|
+
A = P, g = b;
|
|
3447
3459
|
}
|
|
3448
|
-
return m && (A = `${A}?${m}`), await
|
|
3460
|
+
return m && (A = `${A}?${m}`), await a(A, g);
|
|
3449
3461
|
};
|
|
3450
|
-
class
|
|
3462
|
+
class vn {
|
|
3451
3463
|
constructor(t, n = {}) {
|
|
3452
|
-
this.url = t, this.requestConfig = n, this.rawRequest = async (...
|
|
3453
|
-
const [
|
|
3464
|
+
this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
|
|
3465
|
+
const [r, s, a] = i, c = hn(r, s, a), { headers: p, fetch: h = te, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...A } = this.requestConfig, { url: g } = this;
|
|
3454
3466
|
c.signal !== void 0 && (A.signal = c.signal);
|
|
3455
|
-
const { operationName: I } =
|
|
3456
|
-
return
|
|
3467
|
+
const { operationName: I } = de(c.query);
|
|
3468
|
+
return le({
|
|
3457
3469
|
url: g,
|
|
3458
3470
|
query: c.query,
|
|
3459
3471
|
variables: c.variables,
|
|
@@ -3466,21 +3478,21 @@ class En {
|
|
|
3466
3478
|
method: m,
|
|
3467
3479
|
fetchOptions: A,
|
|
3468
3480
|
middleware: y
|
|
3469
|
-
}).then((
|
|
3470
|
-
throw C && C(
|
|
3481
|
+
}).then((P) => (C && C(P), P)).catch((P) => {
|
|
3482
|
+
throw C && C(P), P;
|
|
3471
3483
|
});
|
|
3472
3484
|
};
|
|
3473
3485
|
}
|
|
3474
3486
|
async request(t, ...n) {
|
|
3475
|
-
const [
|
|
3487
|
+
const [i, r] = n, s = pn(t, i, r), { headers: a, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
|
|
3476
3488
|
s.signal !== void 0 && (y.signal = s.signal);
|
|
3477
|
-
const { query: A, operationName: g } =
|
|
3478
|
-
return
|
|
3489
|
+
const { query: A, operationName: g } = de(s.document);
|
|
3490
|
+
return le({
|
|
3479
3491
|
url: C,
|
|
3480
3492
|
query: A,
|
|
3481
3493
|
variables: s.variables,
|
|
3482
3494
|
headers: {
|
|
3483
|
-
...U(pe(
|
|
3495
|
+
...U(pe(a)),
|
|
3484
3496
|
...U(s.requestHeaders)
|
|
3485
3497
|
},
|
|
3486
3498
|
operationName: g,
|
|
@@ -3494,17 +3506,17 @@ class En {
|
|
|
3494
3506
|
}
|
|
3495
3507
|
// prettier-ignore
|
|
3496
3508
|
batchRequests(t, n) {
|
|
3497
|
-
const
|
|
3498
|
-
|
|
3499
|
-
const
|
|
3500
|
-
return
|
|
3509
|
+
const i = fn(t, n), { headers: r, ...s } = this.requestConfig;
|
|
3510
|
+
i.signal !== void 0 && (s.signal = i.signal);
|
|
3511
|
+
const a = i.documents.map(({ document: p }) => de(p).query), c = i.documents.map(({ variables: p }) => p);
|
|
3512
|
+
return le({
|
|
3501
3513
|
url: this.url,
|
|
3502
|
-
query:
|
|
3514
|
+
query: a,
|
|
3503
3515
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
3504
3516
|
variables: c,
|
|
3505
3517
|
headers: {
|
|
3506
|
-
...U(pe(
|
|
3507
|
-
...U(
|
|
3518
|
+
...U(pe(r)),
|
|
3519
|
+
...U(i.requestHeaders)
|
|
3508
3520
|
},
|
|
3509
3521
|
operationName: void 0,
|
|
3510
3522
|
fetch: this.requestConfig.fetch ?? te,
|
|
@@ -3522,8 +3534,8 @@ class En {
|
|
|
3522
3534
|
* Attach a header to the client. All subsequent requests will have this header.
|
|
3523
3535
|
*/
|
|
3524
3536
|
setHeader(t, n) {
|
|
3525
|
-
const { headers:
|
|
3526
|
-
return
|
|
3537
|
+
const { headers: i } = this.requestConfig;
|
|
3538
|
+
return i ? i[t] = n : this.requestConfig.headers = { [t]: n }, this;
|
|
3527
3539
|
}
|
|
3528
3540
|
/**
|
|
3529
3541
|
* Change the client endpoint. All subsequent requests will send to this endpoint.
|
|
@@ -3532,14 +3544,14 @@ class En {
|
|
|
3532
3544
|
return this.url = t, this;
|
|
3533
3545
|
}
|
|
3534
3546
|
}
|
|
3535
|
-
const
|
|
3536
|
-
const { query: t, variables: n, fetchOptions:
|
|
3537
|
-
if (
|
|
3538
|
-
const { errors: m, ...y } = (Array.isArray(c), c), C =
|
|
3547
|
+
const le = async (e) => {
|
|
3548
|
+
const { query: t, variables: n, fetchOptions: i } = e, r = En(dn(e.method ?? "post")), s = Array.isArray(e.query), a = await r(e), c = await An(a, i.jsonSerializer ?? ve), p = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
|
|
3549
|
+
if (a.ok && h && p) {
|
|
3550
|
+
const { errors: m, ...y } = (Array.isArray(c), c), C = i.errorPolicy === "ignore" ? y : c;
|
|
3539
3551
|
return {
|
|
3540
3552
|
...s ? { data: C } : C,
|
|
3541
|
-
headers:
|
|
3542
|
-
status:
|
|
3553
|
+
headers: a.headers,
|
|
3554
|
+
status: a.status
|
|
3543
3555
|
};
|
|
3544
3556
|
} else {
|
|
3545
3557
|
const m = typeof c == "string" ? {
|
|
@@ -3547,30 +3559,30 @@ const de = async (e) => {
|
|
|
3547
3559
|
} : c;
|
|
3548
3560
|
throw new H(
|
|
3549
3561
|
// @ts-expect-error TODO
|
|
3550
|
-
{ ...m, status:
|
|
3562
|
+
{ ...m, status: a.status, headers: a.headers },
|
|
3551
3563
|
{ query: t, variables: n }
|
|
3552
3564
|
);
|
|
3553
3565
|
}
|
|
3554
|
-
},
|
|
3555
|
-
const
|
|
3566
|
+
}, Tn = (e, t, n, i) => {
|
|
3567
|
+
const r = i ?? ve;
|
|
3556
3568
|
if (!Array.isArray(e))
|
|
3557
|
-
return
|
|
3569
|
+
return r.stringify({ query: e, variables: t, operationName: n });
|
|
3558
3570
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3559
3571
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3560
|
-
const s = e.reduce((
|
|
3561
|
-
return
|
|
3562
|
-
},
|
|
3572
|
+
const s = e.reduce((a, c, p) => (a.push({ query: c, variables: t ? t[p] : void 0 }), a), []);
|
|
3573
|
+
return r.stringify(s);
|
|
3574
|
+
}, An = async (e, t) => {
|
|
3563
3575
|
let n;
|
|
3564
|
-
return e.headers.forEach((
|
|
3565
|
-
|
|
3576
|
+
return e.headers.forEach((i, r) => {
|
|
3577
|
+
r.toLowerCase() === "content-type" && (n = i);
|
|
3566
3578
|
}), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
|
|
3567
3579
|
}, pe = (e) => typeof e == "function" ? e() : e;
|
|
3568
|
-
var
|
|
3580
|
+
var In = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(In || {}), Sn = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(Sn || {});
|
|
3569
3581
|
class Nn {
|
|
3570
3582
|
constructor(t) {
|
|
3571
3583
|
Te(this, "api");
|
|
3572
|
-
this.api =
|
|
3573
|
-
new
|
|
3584
|
+
this.api = cn(
|
|
3585
|
+
new vn(`${t}/apps/sq-api`, {
|
|
3574
3586
|
headers: {
|
|
3575
3587
|
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
3576
3588
|
}
|
|
@@ -3585,35 +3597,35 @@ class Nn {
|
|
|
3585
3597
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3586
3598
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3587
3599
|
*/
|
|
3588
|
-
async getLocationAvailabilities(t, n,
|
|
3600
|
+
async getLocationAvailabilities(t, n, i, r) {
|
|
3589
3601
|
const s = await this.api.GetLocationAvailabilities({
|
|
3590
3602
|
sku: t,
|
|
3591
3603
|
first: n,
|
|
3592
|
-
after:
|
|
3593
|
-
isReverse:
|
|
3604
|
+
after: i,
|
|
3605
|
+
isReverse: r
|
|
3594
3606
|
});
|
|
3595
3607
|
return {
|
|
3596
3608
|
nodes: s.locationAvailabilities.nodes.map(
|
|
3597
|
-
(
|
|
3609
|
+
(a) => ({
|
|
3598
3610
|
location: {
|
|
3599
|
-
id:
|
|
3600
|
-
name:
|
|
3601
|
-
phone:
|
|
3602
|
-
mapURL:
|
|
3603
|
-
tags:
|
|
3604
|
-
address:
|
|
3605
|
-
id:
|
|
3606
|
-
countryCode:
|
|
3607
|
-
country:
|
|
3608
|
-
postalCode:
|
|
3609
|
-
provinceCode:
|
|
3610
|
-
province:
|
|
3611
|
-
city:
|
|
3612
|
-
address1:
|
|
3613
|
-
address2:
|
|
3611
|
+
id: a.location.id,
|
|
3612
|
+
name: a.location.name,
|
|
3613
|
+
phone: a.location.phone,
|
|
3614
|
+
mapURL: a.location.mapURL,
|
|
3615
|
+
tags: a.location.tags,
|
|
3616
|
+
address: a.location.address ? {
|
|
3617
|
+
id: a.location.address.id,
|
|
3618
|
+
countryCode: a.location.address.countryCode,
|
|
3619
|
+
country: a.location.address.country,
|
|
3620
|
+
postalCode: a.location.address.postalCode,
|
|
3621
|
+
provinceCode: a.location.address.provinceCode,
|
|
3622
|
+
province: a.location.address.province,
|
|
3623
|
+
city: a.location.address.city,
|
|
3624
|
+
address1: a.location.address.address1,
|
|
3625
|
+
address2: a.location.address.address2
|
|
3614
3626
|
} : void 0
|
|
3615
3627
|
},
|
|
3616
|
-
inventoryQuantity:
|
|
3628
|
+
inventoryQuantity: a.inventoryQuantity
|
|
3617
3629
|
})
|
|
3618
3630
|
) ?? [],
|
|
3619
3631
|
pageInfo: s.locationAvailabilities.pageInfo ?? null
|
|
@@ -3625,27 +3637,27 @@ class Nn {
|
|
|
3625
3637
|
* @param {string} locationID 在庫情報を取得したいLocationのID。
|
|
3626
3638
|
*/
|
|
3627
3639
|
async getLocationAvailability(t, n) {
|
|
3628
|
-
const
|
|
3640
|
+
const i = await this.api.GetLocationAvailability({ sku: t, locationID: n });
|
|
3629
3641
|
return {
|
|
3630
3642
|
location: {
|
|
3631
|
-
id:
|
|
3632
|
-
name:
|
|
3633
|
-
phone:
|
|
3634
|
-
mapURL:
|
|
3635
|
-
tags:
|
|
3636
|
-
address:
|
|
3637
|
-
id:
|
|
3638
|
-
countryCode:
|
|
3639
|
-
country:
|
|
3640
|
-
postalCode:
|
|
3641
|
-
provinceCode:
|
|
3642
|
-
province:
|
|
3643
|
-
city:
|
|
3644
|
-
address1:
|
|
3645
|
-
address2:
|
|
3643
|
+
id: i.locationAvailability.location.id,
|
|
3644
|
+
name: i.locationAvailability.location.name,
|
|
3645
|
+
phone: i.locationAvailability.location.phone,
|
|
3646
|
+
mapURL: i.locationAvailability.location.mapURL,
|
|
3647
|
+
tags: i.locationAvailability.location.tags,
|
|
3648
|
+
address: i.locationAvailability.location.address ? {
|
|
3649
|
+
id: i.locationAvailability.location.address.id,
|
|
3650
|
+
countryCode: i.locationAvailability.location.address.countryCode,
|
|
3651
|
+
country: i.locationAvailability.location.address.country,
|
|
3652
|
+
postalCode: i.locationAvailability.location.address.postalCode,
|
|
3653
|
+
provinceCode: i.locationAvailability.location.address.provinceCode,
|
|
3654
|
+
province: i.locationAvailability.location.address.province,
|
|
3655
|
+
city: i.locationAvailability.location.address.city,
|
|
3656
|
+
address1: i.locationAvailability.location.address.address1,
|
|
3657
|
+
address2: i.locationAvailability.location.address.address2
|
|
3646
3658
|
} : void 0
|
|
3647
3659
|
},
|
|
3648
|
-
inventoryQuantity:
|
|
3660
|
+
inventoryQuantity: i.locationAvailability.inventoryQuantity
|
|
3649
3661
|
};
|
|
3650
3662
|
}
|
|
3651
3663
|
/**
|
|
@@ -3671,8 +3683,12 @@ class Nn {
|
|
|
3671
3683
|
pointsPending: t.purchasingCustomer.pointsPending,
|
|
3672
3684
|
pointsExpiringSoon: t.purchasingCustomer.pointsExpiringSoon ? {
|
|
3673
3685
|
points: t.purchasingCustomer.pointsExpiringSoon.points,
|
|
3674
|
-
expiresDate: new Date(
|
|
3675
|
-
|
|
3686
|
+
expiresDate: new Date(
|
|
3687
|
+
t.purchasingCustomer.pointsExpiringSoon.expiresDate
|
|
3688
|
+
),
|
|
3689
|
+
availableUntil: new Date(
|
|
3690
|
+
t.purchasingCustomer.pointsExpiringSoon.availableUntil
|
|
3691
|
+
)
|
|
3676
3692
|
} : void 0
|
|
3677
3693
|
} : null;
|
|
3678
3694
|
}
|
|
@@ -3684,30 +3700,30 @@ class Nn {
|
|
|
3684
3700
|
* @param {LocationFilter} [locationFilter] ロケーションのロケーションのフィルタリング条件。
|
|
3685
3701
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3686
3702
|
*/
|
|
3687
|
-
async getLocations(t, n,
|
|
3703
|
+
async getLocations(t, n, i, r) {
|
|
3688
3704
|
const s = await this.api.GetLocations({
|
|
3689
3705
|
first: t,
|
|
3690
3706
|
after: n,
|
|
3691
|
-
filter:
|
|
3692
|
-
isReverse:
|
|
3707
|
+
filter: i,
|
|
3708
|
+
isReverse: r
|
|
3693
3709
|
});
|
|
3694
3710
|
return {
|
|
3695
|
-
nodes: s.locations.nodes.map((
|
|
3696
|
-
id:
|
|
3697
|
-
name:
|
|
3698
|
-
phone:
|
|
3699
|
-
mapURL:
|
|
3700
|
-
tags:
|
|
3701
|
-
address:
|
|
3702
|
-
id:
|
|
3703
|
-
countryCode:
|
|
3704
|
-
country:
|
|
3705
|
-
postalCode:
|
|
3706
|
-
provinceCode:
|
|
3707
|
-
province:
|
|
3708
|
-
city:
|
|
3709
|
-
address1:
|
|
3710
|
-
address2:
|
|
3711
|
+
nodes: s.locations.nodes.map((a) => ({
|
|
3712
|
+
id: a.id,
|
|
3713
|
+
name: a.name,
|
|
3714
|
+
phone: a.phone,
|
|
3715
|
+
mapURL: a.mapURL,
|
|
3716
|
+
tags: a.tags,
|
|
3717
|
+
address: a.address ? {
|
|
3718
|
+
id: a.address.id,
|
|
3719
|
+
countryCode: a.address.countryCode,
|
|
3720
|
+
country: a.address.country,
|
|
3721
|
+
postalCode: a.address.postalCode,
|
|
3722
|
+
provinceCode: a.address.provinceCode,
|
|
3723
|
+
province: a.address.province,
|
|
3724
|
+
city: a.address.city,
|
|
3725
|
+
address1: a.address.address1,
|
|
3726
|
+
address2: a.address.address2
|
|
3711
3727
|
} : void 0
|
|
3712
3728
|
})) ?? [],
|
|
3713
3729
|
pageInfo: s.locations.pageInfo ?? null
|
|
@@ -3721,15 +3737,15 @@ class Nn {
|
|
|
3721
3737
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3722
3738
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3723
3739
|
*/
|
|
3724
|
-
async getPurchasingCustomerDiscounts(t, n,
|
|
3725
|
-
const
|
|
3740
|
+
async getPurchasingCustomerDiscounts(t, n, i) {
|
|
3741
|
+
const r = await this.api.GetPurchasingCustomerDiscounts({
|
|
3726
3742
|
first: t,
|
|
3727
3743
|
after: n,
|
|
3728
|
-
isReverse:
|
|
3744
|
+
isReverse: i
|
|
3729
3745
|
});
|
|
3730
|
-
return
|
|
3731
|
-
id:
|
|
3732
|
-
nodes:
|
|
3746
|
+
return r.purchasingCustomer ? {
|
|
3747
|
+
id: r.purchasingCustomer.id,
|
|
3748
|
+
nodes: r.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
|
|
3733
3749
|
(s) => ({
|
|
3734
3750
|
id: s.id,
|
|
3735
3751
|
title: s.title,
|
|
@@ -3746,7 +3762,7 @@ class Nn {
|
|
|
3746
3762
|
updatedAt: new Date(s.updatedAt)
|
|
3747
3763
|
})
|
|
3748
3764
|
) ?? [],
|
|
3749
|
-
pageInfo:
|
|
3765
|
+
pageInfo: r.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
|
|
3750
3766
|
} : null;
|
|
3751
3767
|
}
|
|
3752
3768
|
/**
|
|
@@ -3757,55 +3773,55 @@ class Nn {
|
|
|
3757
3773
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3758
3774
|
* @param {PointChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかPOINT_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
|
|
3759
3775
|
*/
|
|
3760
|
-
async getPointChangeActivities(t, n,
|
|
3776
|
+
async getPointChangeActivities(t, n, i, r) {
|
|
3761
3777
|
const s = await this.api.GetPurchasingCustomerPointChangeActivities({
|
|
3762
3778
|
first: t,
|
|
3763
3779
|
after: n,
|
|
3764
|
-
isReverse:
|
|
3765
|
-
sortKeys:
|
|
3780
|
+
isReverse: i,
|
|
3781
|
+
sortKeys: r
|
|
3766
3782
|
});
|
|
3767
3783
|
return s.purchasingCustomer ? {
|
|
3768
3784
|
nodes: s.purchasingCustomer.pointChangeActivities.nodes.map(
|
|
3769
|
-
(
|
|
3770
|
-
id:
|
|
3771
|
-
title:
|
|
3785
|
+
(a) => ({
|
|
3786
|
+
id: a.id,
|
|
3787
|
+
title: a.title,
|
|
3788
|
+
tenant: {
|
|
3789
|
+
id: a.tenant.id,
|
|
3790
|
+
name: a.tenant.name
|
|
3791
|
+
},
|
|
3772
3792
|
pointChange: {
|
|
3773
|
-
id:
|
|
3774
|
-
delta:
|
|
3775
|
-
availableAt:
|
|
3776
|
-
|
|
3777
|
-
|
|
3793
|
+
id: a.pointChange.id,
|
|
3794
|
+
delta: a.pointChange.delta,
|
|
3795
|
+
availableAt: a.pointChange.availableAt ? new Date(a.pointChange.availableAt) : void 0,
|
|
3796
|
+
expiresDate: a.pointChange.expiresDate ? new Date(a.pointChange.expiresDate) : void 0,
|
|
3797
|
+
availableUntil: a.pointChange.availableUntil ? new Date(a.pointChange.availableUntil) : void 0,
|
|
3778
3798
|
pointChangeCreatedAt: new Date(
|
|
3779
|
-
|
|
3799
|
+
a.pointChange.pointChangeCreatedAt
|
|
3780
3800
|
),
|
|
3781
3801
|
tenant: {
|
|
3782
|
-
id:
|
|
3783
|
-
name:
|
|
3802
|
+
id: a.pointChange.tenant.id,
|
|
3803
|
+
name: a.pointChange.tenant.name
|
|
3784
3804
|
},
|
|
3785
|
-
createdAt: new Date(
|
|
3805
|
+
createdAt: new Date(a.pointChange.createdAt)
|
|
3786
3806
|
},
|
|
3787
|
-
retailLocation:
|
|
3788
|
-
id:
|
|
3789
|
-
name:
|
|
3790
|
-
phone:
|
|
3791
|
-
mapURL:
|
|
3792
|
-
tags:
|
|
3793
|
-
address:
|
|
3794
|
-
id:
|
|
3795
|
-
countryCode:
|
|
3796
|
-
country:
|
|
3797
|
-
postalCode:
|
|
3798
|
-
provinceCode:
|
|
3799
|
-
province:
|
|
3800
|
-
city:
|
|
3801
|
-
address1:
|
|
3802
|
-
address2:
|
|
3807
|
+
retailLocation: a.retailLocation ? {
|
|
3808
|
+
id: a.retailLocation.id,
|
|
3809
|
+
name: a.retailLocation.name,
|
|
3810
|
+
phone: a.retailLocation.phone,
|
|
3811
|
+
mapURL: a.retailLocation.mapURL,
|
|
3812
|
+
tags: a.retailLocation.tags,
|
|
3813
|
+
address: a.retailLocation.address ? {
|
|
3814
|
+
id: a.retailLocation.address.id,
|
|
3815
|
+
countryCode: a.retailLocation.address.countryCode,
|
|
3816
|
+
country: a.retailLocation.address.country,
|
|
3817
|
+
postalCode: a.retailLocation.address.postalCode,
|
|
3818
|
+
provinceCode: a.retailLocation.address.provinceCode,
|
|
3819
|
+
province: a.retailLocation.address.province,
|
|
3820
|
+
city: a.retailLocation.address.city,
|
|
3821
|
+
address1: a.retailLocation.address.address1,
|
|
3822
|
+
address2: a.retailLocation.address.address2
|
|
3803
3823
|
} : void 0
|
|
3804
|
-
} : void 0
|
|
3805
|
-
tenant: {
|
|
3806
|
-
id: o.tenant.id,
|
|
3807
|
-
name: o.tenant.name
|
|
3808
|
-
}
|
|
3824
|
+
} : void 0
|
|
3809
3825
|
})
|
|
3810
3826
|
),
|
|
3811
3827
|
pageInfo: s.purchasingCustomer.pointChangeActivities.pageInfo
|
|
@@ -3820,6 +3836,21 @@ class Nn {
|
|
|
3820
3836
|
return (n = t.purchasingCustomer) != null && n.currentCustomerRank ? {
|
|
3821
3837
|
id: t.purchasingCustomer.currentCustomerRank.id,
|
|
3822
3838
|
name: t.purchasingCustomer.currentCustomerRank.name,
|
|
3839
|
+
threshold: t.purchasingCustomer.currentCustomerRank.threshold,
|
|
3840
|
+
higherRank: t.purchasingCustomer.currentCustomerRank.higherRank ? {
|
|
3841
|
+
id: t.purchasingCustomer.currentCustomerRank.higherRank.id,
|
|
3842
|
+
name: t.purchasingCustomer.currentCustomerRank.higherRank.name,
|
|
3843
|
+
threshold: t.purchasingCustomer.currentCustomerRank.higherRank.threshold
|
|
3844
|
+
} : void 0,
|
|
3845
|
+
lowerRank: t.purchasingCustomer.currentCustomerRank.lowerRank ? {
|
|
3846
|
+
id: t.purchasingCustomer.currentCustomerRank.lowerRank.id,
|
|
3847
|
+
name: t.purchasingCustomer.currentCustomerRank.lowerRank.name,
|
|
3848
|
+
threshold: t.purchasingCustomer.currentCustomerRank.lowerRank.threshold
|
|
3849
|
+
} : void 0,
|
|
3850
|
+
earnedPoint: t.purchasingCustomer.currentCustomerRank.earnedPoint,
|
|
3851
|
+
purchasePrice: t.purchasingCustomer.currentCustomerRank.purchasePrice,
|
|
3852
|
+
earnedPointToRankUp: t.purchasingCustomer.currentCustomerRank.earnedPointToRankUp,
|
|
3853
|
+
purchasePriceToRankUp: t.purchasingCustomer.currentCustomerRank.purchasePriceToRankUp,
|
|
3823
3854
|
calculationCondition: {
|
|
3824
3855
|
customerRankCalculationPeriod: t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod ? {
|
|
3825
3856
|
start: new Date(
|
|
@@ -3832,19 +3863,6 @@ class Nn {
|
|
|
3832
3863
|
earnedPoint: t.purchasingCustomer.currentCustomerRank.calculationCondition.earnedPoint,
|
|
3833
3864
|
purchasePrice: t.purchasingCustomer.currentCustomerRank.calculationCondition.purchasePrice
|
|
3834
3865
|
},
|
|
3835
|
-
earnedPointToRankUp: t.purchasingCustomer.currentCustomerRank.earnedPointToRankUp,
|
|
3836
|
-
higherRank: t.purchasingCustomer.currentCustomerRank.higherRank ? {
|
|
3837
|
-
id: t.purchasingCustomer.currentCustomerRank.higherRank.id,
|
|
3838
|
-
name: t.purchasingCustomer.currentCustomerRank.higherRank.name,
|
|
3839
|
-
threshold: t.purchasingCustomer.currentCustomerRank.higherRank.threshold
|
|
3840
|
-
} : void 0,
|
|
3841
|
-
lowerRank: t.purchasingCustomer.currentCustomerRank.lowerRank ? {
|
|
3842
|
-
id: t.purchasingCustomer.currentCustomerRank.lowerRank.id,
|
|
3843
|
-
name: t.purchasingCustomer.currentCustomerRank.lowerRank.name,
|
|
3844
|
-
threshold: t.purchasingCustomer.currentCustomerRank.lowerRank.threshold
|
|
3845
|
-
} : void 0,
|
|
3846
|
-
purchasePriceToRankUp: t.purchasingCustomer.currentCustomerRank.purchasePriceToRankUp,
|
|
3847
|
-
threshold: t.purchasingCustomer.currentCustomerRank.threshold,
|
|
3848
3866
|
pointMultiplier: t.purchasingCustomer.currentCustomerRank.pointMultiplier ? {
|
|
3849
3867
|
id: t.purchasingCustomer.currentCustomerRank.pointMultiplier.id,
|
|
3850
3868
|
customerRankRule: {
|
|
@@ -3879,102 +3897,113 @@ class Nn {
|
|
|
3879
3897
|
return (n = t.purchasingCustomer) != null && n.customerSharing ? {
|
|
3880
3898
|
id: t.purchasingCustomer.customerSharing.id,
|
|
3881
3899
|
purchasingCustomers: t.purchasingCustomer.customerSharing.purchasingCustomers.map(
|
|
3882
|
-
(
|
|
3883
|
-
id:
|
|
3884
|
-
sharingPurchasingCustomerCount:
|
|
3900
|
+
(i) => ({
|
|
3901
|
+
id: i.id,
|
|
3902
|
+
sharingPurchasingCustomerCount: i.sharingPurchasingCustomerCount,
|
|
3885
3903
|
tenant: {
|
|
3886
|
-
id:
|
|
3887
|
-
name:
|
|
3904
|
+
id: i.tenant.id,
|
|
3905
|
+
name: i.tenant.name
|
|
3888
3906
|
}
|
|
3889
3907
|
})
|
|
3890
3908
|
)
|
|
3891
3909
|
} : null;
|
|
3892
3910
|
}
|
|
3893
|
-
async getProduct(t, n,
|
|
3894
|
-
const
|
|
3911
|
+
async getProduct(t, n, i, r, s) {
|
|
3912
|
+
const a = await this.api.GetProduct({
|
|
3895
3913
|
id: t,
|
|
3896
3914
|
first: n,
|
|
3897
|
-
after:
|
|
3898
|
-
isReverse:
|
|
3915
|
+
after: i,
|
|
3916
|
+
isReverse: r,
|
|
3899
3917
|
sortKeys: s
|
|
3900
3918
|
});
|
|
3901
|
-
return
|
|
3902
|
-
id:
|
|
3903
|
-
title:
|
|
3904
|
-
hasBackOrderProductVariants:
|
|
3905
|
-
isLocalPickupAvailable:
|
|
3919
|
+
return a.productByProductShopifyLegacyResourceID ? {
|
|
3920
|
+
id: a.productByProductShopifyLegacyResourceID.id,
|
|
3921
|
+
title: a.productByProductShopifyLegacyResourceID.title,
|
|
3922
|
+
hasBackOrderProductVariants: a.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants,
|
|
3923
|
+
isLocalPickupAvailable: a.productByProductShopifyLegacyResourceID.isLocalPickupAvailable,
|
|
3906
3924
|
variants: {
|
|
3907
|
-
nodes:
|
|
3925
|
+
nodes: a.productByProductShopifyLegacyResourceID.productVariants.nodes.map(
|
|
3908
3926
|
(c) => ({
|
|
3909
3927
|
id: c.id,
|
|
3910
3928
|
title: c.title,
|
|
3911
|
-
isBackOrderEnable: c.isBackOrderEnable,
|
|
3912
|
-
isLocalPickupAvailable: c.isLocalPickupAvailable,
|
|
3913
3929
|
inventoryItem: {
|
|
3914
3930
|
id: c.inventoryItem.id,
|
|
3915
3931
|
sku: c.inventoryItem.sku
|
|
3916
|
-
}
|
|
3932
|
+
},
|
|
3933
|
+
isBackOrderEnable: c.isBackOrderEnable,
|
|
3934
|
+
isLocalPickupAvailable: c.isLocalPickupAvailable
|
|
3917
3935
|
})
|
|
3918
3936
|
),
|
|
3919
|
-
pageInfo:
|
|
3937
|
+
pageInfo: a.productByProductShopifyLegacyResourceID.productVariants.pageInfo
|
|
3920
3938
|
}
|
|
3921
3939
|
} : null;
|
|
3922
3940
|
}
|
|
3941
|
+
/**
|
|
3942
|
+
* getHasBackOrderProductVariants はIDで指定した商品が持つ商品バリエーションに1つでも予約販売設定がされている場合trueを返します。
|
|
3943
|
+
* 指定したIDの商品が存在しない場合はnullを返します。
|
|
3944
|
+
* @param {string} [productShopifyLegacyResourceID] 商品のShopifyLegacyResourceID(gid://shopify/Product/xxxのxxxの部分)
|
|
3945
|
+
*/
|
|
3946
|
+
async getHasBackOrderProductVariants(t) {
|
|
3947
|
+
const n = await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID({
|
|
3948
|
+
id: t
|
|
3949
|
+
});
|
|
3950
|
+
return n.productByProductShopifyLegacyResourceID ? n.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants : null;
|
|
3951
|
+
}
|
|
3923
3952
|
async getPointCampaignOrderRuleTargetCustomerRank() {
|
|
3924
3953
|
const t = await this.api.GetPointCampaignOrderRuleTargetCustomerRank();
|
|
3925
3954
|
return t.pointCampaignOrderRuleTargetCustomerRank ? {
|
|
3926
3955
|
pointCampaignOrderRule: {
|
|
3927
3956
|
id: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.id,
|
|
3928
3957
|
title: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.title,
|
|
3929
|
-
|
|
3930
|
-
|
|
3958
|
+
pointMethod: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.pointMethod,
|
|
3959
|
+
targetType: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.targetType
|
|
3931
3960
|
},
|
|
3932
3961
|
multiplier: t.pointCampaignOrderRuleTargetCustomerRank.multiplier ? t.pointCampaignOrderRuleTargetCustomerRank.multiplier : void 0,
|
|
3933
3962
|
fixedPoint: t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint ? t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint : void 0
|
|
3934
3963
|
} : null;
|
|
3935
3964
|
}
|
|
3936
|
-
async getEstimatedShopifyCartPoint(t, n,
|
|
3937
|
-
const
|
|
3965
|
+
async getEstimatedShopifyCartPoint(t, n, i) {
|
|
3966
|
+
const r = await this.api.GetEstimatedShopifyCartPoint({
|
|
3938
3967
|
input: {
|
|
3939
3968
|
currencyCode: t,
|
|
3940
3969
|
taxesIncluded: n,
|
|
3941
|
-
lineItems:
|
|
3970
|
+
lineItems: i
|
|
3942
3971
|
}
|
|
3943
3972
|
});
|
|
3944
|
-
return
|
|
3945
|
-
pointsEarning:
|
|
3946
|
-
totalPointsEarning:
|
|
3947
|
-
pointCampaign:
|
|
3948
|
-
pointsEarning:
|
|
3973
|
+
return r.estimatedShopifyCartPoint ? {
|
|
3974
|
+
pointsEarning: r.estimatedShopifyCartPoint.pointsEarning,
|
|
3975
|
+
totalPointsEarning: r.estimatedShopifyCartPoint.totalPointsEarning,
|
|
3976
|
+
pointCampaign: r.estimatedShopifyCartPoint.pointCampaign ? {
|
|
3977
|
+
pointsEarning: r.estimatedShopifyCartPoint.pointCampaign.pointsEarning,
|
|
3949
3978
|
pointCampaignOrderRule: {
|
|
3950
|
-
id:
|
|
3951
|
-
title:
|
|
3952
|
-
pointMethod:
|
|
3953
|
-
targetType:
|
|
3979
|
+
id: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,
|
|
3980
|
+
title: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,
|
|
3981
|
+
pointMethod: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
|
|
3982
|
+
targetType: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType
|
|
3954
3983
|
}
|
|
3955
3984
|
} : void 0
|
|
3956
3985
|
} : null;
|
|
3957
3986
|
}
|
|
3958
|
-
async getEstimatedShopifyCartLineItemPoint(t, n,
|
|
3959
|
-
const
|
|
3987
|
+
async getEstimatedShopifyCartLineItemPoint(t, n, i, r, s) {
|
|
3988
|
+
const a = await this.api.GetEstimatedShopifyCartLineItemPoint({
|
|
3960
3989
|
input: {
|
|
3961
3990
|
currencyCode: t,
|
|
3962
3991
|
taxesIncluded: n,
|
|
3963
|
-
sku:
|
|
3964
|
-
quantity:
|
|
3992
|
+
sku: i,
|
|
3993
|
+
quantity: r,
|
|
3965
3994
|
unitPrice: s
|
|
3966
3995
|
}
|
|
3967
3996
|
});
|
|
3968
|
-
return
|
|
3969
|
-
pointsEarning:
|
|
3970
|
-
totalPointsEarning:
|
|
3971
|
-
pointCampaign:
|
|
3972
|
-
pointsEarning:
|
|
3997
|
+
return a.estimatedShopifyCartLineItemPoint ? {
|
|
3998
|
+
pointsEarning: a.estimatedShopifyCartLineItemPoint.pointsEarning,
|
|
3999
|
+
totalPointsEarning: a.estimatedShopifyCartLineItemPoint.totalPointsEarning,
|
|
4000
|
+
pointCampaign: a.estimatedShopifyCartLineItemPoint.pointCampaign ? {
|
|
4001
|
+
pointsEarning: a.estimatedShopifyCartLineItemPoint.pointCampaign.pointsEarning,
|
|
3973
4002
|
pointCampaignOrderRule: {
|
|
3974
|
-
id:
|
|
3975
|
-
title:
|
|
3976
|
-
pointMethod:
|
|
3977
|
-
targetType:
|
|
4003
|
+
id: a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.id,
|
|
4004
|
+
title: a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.title,
|
|
4005
|
+
pointMethod: a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
|
|
4006
|
+
targetType: a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.targetType
|
|
3978
4007
|
}
|
|
3979
4008
|
} : void 0
|
|
3980
4009
|
} : null;
|
|
@@ -4004,22 +4033,22 @@ class Nn {
|
|
|
4004
4033
|
throw new Error(
|
|
4005
4034
|
`Invalid activation code: ${n} is not 6 characters.`
|
|
4006
4035
|
);
|
|
4007
|
-
const
|
|
4036
|
+
const i = await this.api.PurchasingCustomerActivateCustomerSharing({
|
|
4008
4037
|
email: t,
|
|
4009
4038
|
activationCode: n
|
|
4010
4039
|
});
|
|
4011
|
-
return
|
|
4012
|
-
id:
|
|
4013
|
-
sharingPurchasingCustomerCount:
|
|
4040
|
+
return i.purchasingCustomerActivateCustomerSharing ? {
|
|
4041
|
+
id: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,
|
|
4042
|
+
sharingPurchasingCustomerCount: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,
|
|
4014
4043
|
tenant: {
|
|
4015
|
-
id:
|
|
4016
|
-
name:
|
|
4044
|
+
id: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,
|
|
4045
|
+
name: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name
|
|
4017
4046
|
}
|
|
4018
4047
|
} : null;
|
|
4019
4048
|
}
|
|
4020
4049
|
}
|
|
4021
4050
|
export {
|
|
4022
|
-
|
|
4023
|
-
|
|
4051
|
+
In as CurrencyCode,
|
|
4052
|
+
Sn as LocationType,
|
|
4024
4053
|
Nn as SDK
|
|
4025
4054
|
};
|