@builtbystack/sq-shopify-theme-sdk 0.0.7 → 0.0.9
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 +127 -8
- package/dist/sq-shopify-theme-sdk.d.ts +97 -9
- package/dist/sq-shopify-theme-sdk.js +786 -669
- package/dist/sq-shopify-theme-sdk.umd.js +77 -32
- package/package.json +1 -1
|
@@ -3,14 +3,14 @@ var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var Ce = (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
|
const ge = JSON, Qe = (e) => e.toUpperCase(), Je = (e) => {
|
|
21
21
|
const t = {};
|
|
22
|
-
return e.forEach((n,
|
|
23
|
-
t[
|
|
22
|
+
return e.forEach((n, i) => {
|
|
23
|
+
t[i] = n;
|
|
24
24
|
}), t;
|
|
25
25
|
}, Xe = (e, t, n) => e.document ? e : {
|
|
26
26
|
document: e,
|
|
@@ -51,52 +51,52 @@ function et(e, t) {
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
const tt = /\r\n|[\n\r]/g;
|
|
54
|
-
function
|
|
55
|
-
let n = 0,
|
|
56
|
-
for (const
|
|
57
|
-
if (typeof
|
|
54
|
+
function pe(e, t) {
|
|
55
|
+
let n = 0, i = 1;
|
|
56
|
+
for (const r of e.body.matchAll(tt)) {
|
|
57
|
+
if (typeof r.index == "number" || et(!1), r.index >= t)
|
|
58
58
|
break;
|
|
59
|
-
n =
|
|
59
|
+
n = r.index + r[0].length, i += 1;
|
|
60
60
|
}
|
|
61
61
|
return {
|
|
62
|
-
line:
|
|
62
|
+
line: i,
|
|
63
63
|
column: t + 1 - n
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function nt(e) {
|
|
67
67
|
return _e(
|
|
68
68
|
e.source,
|
|
69
|
-
|
|
69
|
+
pe(e.source, e.start)
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
function _e(e, t) {
|
|
73
|
-
const n = e.locationOffset.column - 1,
|
|
74
|
-
`, m =
|
|
73
|
+
const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0, h = t.column + u, p = `${e.name}:${o}:${h}
|
|
74
|
+
`, m = i.split(/\r\n|[\n\r]/g), E = m[r];
|
|
75
75
|
if (E.length > 120) {
|
|
76
|
-
const g = Math.floor(
|
|
76
|
+
const g = Math.floor(h / 80), A = h % 80, y = [];
|
|
77
77
|
for (let N = 0; N < E.length; N += 80)
|
|
78
78
|
y.push(E.slice(N, N + 80));
|
|
79
|
-
return
|
|
80
|
-
[`${
|
|
79
|
+
return p + Ae([
|
|
80
|
+
[`${o} |`, y[0]],
|
|
81
81
|
...y.slice(1, g + 1).map((N) => ["|", N]),
|
|
82
82
|
["|", "^".padStart(A)],
|
|
83
83
|
["|", y[g + 1]]
|
|
84
84
|
]);
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return p + Ae([
|
|
87
87
|
// Lines specified like this: ["prefix", "string"],
|
|
88
|
-
[`${
|
|
89
|
-
[`${
|
|
90
|
-
["|", "^".padStart(
|
|
91
|
-
[`${
|
|
88
|
+
[`${o - 1} |`, m[r - 1]],
|
|
89
|
+
[`${o} |`, E],
|
|
90
|
+
["|", "^".padStart(h)],
|
|
91
|
+
[`${o + 1} |`, m[r + 1]]
|
|
92
92
|
]);
|
|
93
93
|
}
|
|
94
94
|
function Ae(e) {
|
|
95
|
-
const t = e.filter(([
|
|
96
|
-
return t.map(([
|
|
95
|
+
const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
96
|
+
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
97
97
|
`);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function rt(e) {
|
|
100
100
|
const t = e[0];
|
|
101
101
|
return t == null || "kind" in t || "length" in t ? {
|
|
102
102
|
nodes: t,
|
|
@@ -107,7 +107,7 @@ function it(e) {
|
|
|
107
107
|
extensions: e[5]
|
|
108
108
|
} : t;
|
|
109
109
|
}
|
|
110
|
-
class
|
|
110
|
+
class ve extends Error {
|
|
111
111
|
/**
|
|
112
112
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
113
113
|
* which correspond to this error.
|
|
@@ -147,15 +147,15 @@ class Te extends Error {
|
|
|
147
147
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
148
148
|
*/
|
|
149
149
|
constructor(t, ...n) {
|
|
150
|
-
var
|
|
151
|
-
const { nodes:
|
|
152
|
-
super(t), this.name = "GraphQLError", this.path =
|
|
153
|
-
Array.isArray(
|
|
150
|
+
var i, r, s;
|
|
151
|
+
const { nodes: o, source: u, positions: h, path: p, originalError: m, extensions: E } = rt(n);
|
|
152
|
+
super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = m ?? void 0, this.nodes = Ne(
|
|
153
|
+
Array.isArray(o) ? o : o ? [o] : void 0
|
|
154
154
|
);
|
|
155
155
|
const g = Ne(
|
|
156
|
-
(
|
|
156
|
+
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((y) => y.loc).filter((y) => y != null)
|
|
157
157
|
);
|
|
158
|
-
this.source = u ?? (g == null || (
|
|
158
|
+
this.source = u ?? (g == null || (r = g[0]) === null || r === void 0 ? void 0 : r.source), this.positions = h ?? (g == null ? void 0 : g.map((y) => y.start)), this.locations = h && u ? h.map((y) => pe(u, y)) : g == null ? void 0 : g.map((y) => pe(y.source, y.start));
|
|
159
159
|
const A = Ke(
|
|
160
160
|
m == null ? void 0 : m.extensions
|
|
161
161
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
@@ -183,7 +183,7 @@ class Te extends Error {
|
|
|
183
183
|
value: m.stack,
|
|
184
184
|
writable: !0,
|
|
185
185
|
configurable: !0
|
|
186
|
-
}) : Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
186
|
+
}) : Error.captureStackTrace ? Error.captureStackTrace(this, ve) : Object.defineProperty(this, "stack", {
|
|
187
187
|
value: Error().stack,
|
|
188
188
|
writable: !0,
|
|
189
189
|
configurable: !0
|
|
@@ -217,12 +217,12 @@ function Ne(e) {
|
|
|
217
217
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
218
218
|
}
|
|
219
219
|
function b(e, t, n) {
|
|
220
|
-
return new
|
|
220
|
+
return new ve(`Syntax Error: ${n}`, {
|
|
221
221
|
source: e,
|
|
222
222
|
positions: [t]
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
class
|
|
225
|
+
class it {
|
|
226
226
|
/**
|
|
227
227
|
* The character offset at which this Node begins.
|
|
228
228
|
*/
|
|
@@ -238,8 +238,8 @@ class rt {
|
|
|
238
238
|
/**
|
|
239
239
|
* The Source document the AST represents.
|
|
240
240
|
*/
|
|
241
|
-
constructor(t, n,
|
|
242
|
-
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source =
|
|
241
|
+
constructor(t, n, i) {
|
|
242
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
|
|
243
243
|
}
|
|
244
244
|
get [Symbol.toStringTag]() {
|
|
245
245
|
return "Location";
|
|
@@ -278,8 +278,8 @@ class ke {
|
|
|
278
278
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
279
279
|
* the last.
|
|
280
280
|
*/
|
|
281
|
-
constructor(t, n,
|
|
282
|
-
this.kind = t, this.start = n, this.end =
|
|
281
|
+
constructor(t, n, i, r, s, o) {
|
|
282
|
+
this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
|
|
283
283
|
}
|
|
284
284
|
get [Symbol.toStringTag]() {
|
|
285
285
|
return "Token";
|
|
@@ -402,15 +402,15 @@ function ot(e) {
|
|
|
402
402
|
}
|
|
403
403
|
function at(e) {
|
|
404
404
|
var t;
|
|
405
|
-
let n = Number.MAX_SAFE_INTEGER,
|
|
406
|
-
for (let
|
|
405
|
+
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
406
|
+
for (let o = 0; o < e.length; ++o) {
|
|
407
407
|
var s;
|
|
408
|
-
const u = e[
|
|
409
|
-
|
|
408
|
+
const u = e[o], h = ct(u);
|
|
409
|
+
h !== u.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && h < n && (n = h));
|
|
410
410
|
}
|
|
411
|
-
return e.map((
|
|
412
|
-
(t =
|
|
413
|
-
|
|
411
|
+
return e.map((o, u) => u === 0 ? o : o.slice(n)).slice(
|
|
412
|
+
(t = i) !== null && t !== void 0 ? t : 0,
|
|
413
|
+
r + 1
|
|
414
414
|
);
|
|
415
415
|
}
|
|
416
416
|
function ct(e) {
|
|
@@ -420,12 +420,12 @@ function ct(e) {
|
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
422
422
|
function ut(e, t) {
|
|
423
|
-
const n = e.replace(/"""/g, '\\"""'),
|
|
424
|
-
(!
|
|
423
|
+
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))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o, h = e.endsWith("\\"), p = u || h, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
424
|
+
(!r || e.length > 70 || p || s || o);
|
|
425
425
|
let E = "";
|
|
426
|
-
const g =
|
|
426
|
+
const g = r && me(e.charCodeAt(0));
|
|
427
427
|
return (m && !g || s) && (E += `
|
|
428
|
-
`), E += n, (m ||
|
|
428
|
+
`), E += n, (m || p) && (E += `
|
|
429
429
|
`), '"""' + E + '"""';
|
|
430
430
|
}
|
|
431
431
|
var c;
|
|
@@ -469,14 +469,14 @@ class lt {
|
|
|
469
469
|
if (t.next)
|
|
470
470
|
t = t.next;
|
|
471
471
|
else {
|
|
472
|
-
const n =
|
|
472
|
+
const n = ht(this, t.end);
|
|
473
473
|
t.next = n, n.prev = t, t = n;
|
|
474
474
|
}
|
|
475
475
|
while (t.kind === c.COMMENT);
|
|
476
476
|
return t;
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function dt(e) {
|
|
480
480
|
return e === c.BANG || e === c.DOLLAR || e === c.AMP || e === c.PAREN_L || e === c.PAREN_R || e === c.SPREAD || e === c.COLON || e === c.EQUALS || e === c.AT || e === c.BRACKET_L || e === c.BRACKET_R || e === c.BRACE_L || e === c.PIPE || e === c.BRACE_R;
|
|
481
481
|
}
|
|
482
482
|
function V(e) {
|
|
@@ -496,91 +496,91 @@ function F(e, t) {
|
|
|
496
496
|
if (n === void 0)
|
|
497
497
|
return c.EOF;
|
|
498
498
|
if (n >= 32 && n <= 126) {
|
|
499
|
-
const
|
|
500
|
-
return
|
|
499
|
+
const i = String.fromCodePoint(n);
|
|
500
|
+
return i === '"' ? `'"'` : `"${i}"`;
|
|
501
501
|
}
|
|
502
502
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
503
503
|
}
|
|
504
|
-
function x(e, t, n,
|
|
505
|
-
const s = e.line,
|
|
506
|
-
return new ke(t, n,
|
|
504
|
+
function x(e, t, n, i, r) {
|
|
505
|
+
const s = e.line, o = 1 + n - e.lineStart;
|
|
506
|
+
return new ke(t, n, i, s, o, r);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
const n = e.source.body,
|
|
510
|
-
let
|
|
511
|
-
for (;
|
|
512
|
-
const s = n.charCodeAt(
|
|
508
|
+
function ht(e, t) {
|
|
509
|
+
const n = e.source.body, i = n.length;
|
|
510
|
+
let r = t;
|
|
511
|
+
for (; r < i; ) {
|
|
512
|
+
const s = n.charCodeAt(r);
|
|
513
513
|
switch (s) {
|
|
514
514
|
case 65279:
|
|
515
515
|
case 9:
|
|
516
516
|
case 32:
|
|
517
517
|
case 44:
|
|
518
|
-
++
|
|
518
|
+
++r;
|
|
519
519
|
continue;
|
|
520
520
|
case 10:
|
|
521
|
-
++
|
|
521
|
+
++r, ++e.line, e.lineStart = r;
|
|
522
522
|
continue;
|
|
523
523
|
case 13:
|
|
524
|
-
n.charCodeAt(
|
|
524
|
+
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
525
525
|
continue;
|
|
526
526
|
case 35:
|
|
527
|
-
return
|
|
527
|
+
return pt(e, r);
|
|
528
528
|
case 33:
|
|
529
|
-
return x(e, c.BANG,
|
|
529
|
+
return x(e, c.BANG, r, r + 1);
|
|
530
530
|
case 36:
|
|
531
|
-
return x(e, c.DOLLAR,
|
|
531
|
+
return x(e, c.DOLLAR, r, r + 1);
|
|
532
532
|
case 38:
|
|
533
|
-
return x(e, c.AMP,
|
|
533
|
+
return x(e, c.AMP, r, r + 1);
|
|
534
534
|
case 40:
|
|
535
|
-
return x(e, c.PAREN_L,
|
|
535
|
+
return x(e, c.PAREN_L, r, r + 1);
|
|
536
536
|
case 41:
|
|
537
|
-
return x(e, c.PAREN_R,
|
|
537
|
+
return x(e, c.PAREN_R, r, r + 1);
|
|
538
538
|
case 46:
|
|
539
|
-
if (n.charCodeAt(
|
|
540
|
-
return x(e, c.SPREAD,
|
|
539
|
+
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
540
|
+
return x(e, c.SPREAD, r, r + 3);
|
|
541
541
|
break;
|
|
542
542
|
case 58:
|
|
543
|
-
return x(e, c.COLON,
|
|
543
|
+
return x(e, c.COLON, r, r + 1);
|
|
544
544
|
case 61:
|
|
545
|
-
return x(e, c.EQUALS,
|
|
545
|
+
return x(e, c.EQUALS, r, r + 1);
|
|
546
546
|
case 64:
|
|
547
|
-
return x(e, c.AT,
|
|
547
|
+
return x(e, c.AT, r, r + 1);
|
|
548
548
|
case 91:
|
|
549
|
-
return x(e, c.BRACKET_L,
|
|
549
|
+
return x(e, c.BRACKET_L, r, r + 1);
|
|
550
550
|
case 93:
|
|
551
|
-
return x(e, c.BRACKET_R,
|
|
551
|
+
return x(e, c.BRACKET_R, r, r + 1);
|
|
552
552
|
case 123:
|
|
553
|
-
return x(e, c.BRACE_L,
|
|
553
|
+
return x(e, c.BRACE_L, r, r + 1);
|
|
554
554
|
case 124:
|
|
555
|
-
return x(e, c.PIPE,
|
|
555
|
+
return x(e, c.PIPE, r, r + 1);
|
|
556
556
|
case 125:
|
|
557
|
-
return x(e, c.BRACE_R,
|
|
557
|
+
return x(e, c.BRACE_R, r, r + 1);
|
|
558
558
|
case 34:
|
|
559
|
-
return n.charCodeAt(
|
|
559
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? vt(e, r) : mt(e, r);
|
|
560
560
|
}
|
|
561
561
|
if (Y(s) || s === 45)
|
|
562
|
-
return ft(e,
|
|
562
|
+
return ft(e, r, s);
|
|
563
563
|
if (we(s))
|
|
564
|
-
return
|
|
564
|
+
return Tt(e, r);
|
|
565
565
|
throw b(
|
|
566
566
|
e.source,
|
|
567
|
-
|
|
568
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : V(s) || se(n,
|
|
567
|
+
r,
|
|
568
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : V(s) || se(n, r) ? `Unexpected character: ${F(e, r)}.` : `Invalid character: ${F(e, r)}.`
|
|
569
569
|
);
|
|
570
570
|
}
|
|
571
|
-
return x(e, c.EOF,
|
|
571
|
+
return x(e, c.EOF, i, i);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
const n = e.source.body,
|
|
575
|
-
let
|
|
576
|
-
for (;
|
|
577
|
-
const s = n.charCodeAt(
|
|
573
|
+
function pt(e, t) {
|
|
574
|
+
const n = e.source.body, i = n.length;
|
|
575
|
+
let r = t + 1;
|
|
576
|
+
for (; r < i; ) {
|
|
577
|
+
const s = n.charCodeAt(r);
|
|
578
578
|
if (s === 10 || s === 13)
|
|
579
579
|
break;
|
|
580
580
|
if (V(s))
|
|
581
|
-
++
|
|
582
|
-
else if (se(n,
|
|
583
|
-
|
|
581
|
+
++r;
|
|
582
|
+
else if (se(n, r))
|
|
583
|
+
r += 2;
|
|
584
584
|
else
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
@@ -588,40 +588,40 @@ function dt(e, t) {
|
|
|
588
588
|
e,
|
|
589
589
|
c.COMMENT,
|
|
590
590
|
t,
|
|
591
|
-
|
|
592
|
-
n.slice(t + 1,
|
|
591
|
+
r,
|
|
592
|
+
n.slice(t + 1, r)
|
|
593
593
|
);
|
|
594
594
|
}
|
|
595
595
|
function ft(e, t, n) {
|
|
596
|
-
const
|
|
597
|
-
let
|
|
598
|
-
if (s === 45 && (s =
|
|
599
|
-
if (s =
|
|
596
|
+
const i = e.source.body;
|
|
597
|
+
let r = t, s = n, o = !1;
|
|
598
|
+
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
599
|
+
if (s = i.charCodeAt(++r), Y(s))
|
|
600
600
|
throw b(
|
|
601
601
|
e.source,
|
|
602
|
-
|
|
602
|
+
r,
|
|
603
603
|
`Invalid number, unexpected digit after 0: ${F(
|
|
604
604
|
e,
|
|
605
|
-
|
|
605
|
+
r
|
|
606
606
|
)}.`
|
|
607
607
|
);
|
|
608
608
|
} else
|
|
609
|
-
|
|
610
|
-
if (s === 46 && (
|
|
609
|
+
r = ue(e, r, s), s = i.charCodeAt(r);
|
|
610
|
+
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = ue(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = ue(e, r, s), s = i.charCodeAt(r)), s === 46 || we(s))
|
|
611
611
|
throw b(
|
|
612
612
|
e.source,
|
|
613
|
-
|
|
613
|
+
r,
|
|
614
614
|
`Invalid number, expected digit but got: ${F(
|
|
615
615
|
e,
|
|
616
|
-
|
|
616
|
+
r
|
|
617
617
|
)}.`
|
|
618
618
|
);
|
|
619
619
|
return x(
|
|
620
620
|
e,
|
|
621
|
-
|
|
621
|
+
o ? c.FLOAT : c.INT,
|
|
622
622
|
t,
|
|
623
|
-
|
|
624
|
-
|
|
623
|
+
r,
|
|
624
|
+
i.slice(t, r)
|
|
625
625
|
);
|
|
626
626
|
}
|
|
627
627
|
function ue(e, t, n) {
|
|
@@ -634,57 +634,57 @@ function ue(e, t, n) {
|
|
|
634
634
|
t
|
|
635
635
|
)}.`
|
|
636
636
|
);
|
|
637
|
-
const
|
|
638
|
-
let
|
|
639
|
-
for (; Y(
|
|
640
|
-
++
|
|
641
|
-
return
|
|
637
|
+
const i = e.source.body;
|
|
638
|
+
let r = t + 1;
|
|
639
|
+
for (; Y(i.charCodeAt(r)); )
|
|
640
|
+
++r;
|
|
641
|
+
return r;
|
|
642
642
|
}
|
|
643
643
|
function mt(e, t) {
|
|
644
|
-
const n = e.source.body,
|
|
645
|
-
let
|
|
646
|
-
for (;
|
|
647
|
-
const u = n.charCodeAt(
|
|
644
|
+
const n = e.source.body, i = n.length;
|
|
645
|
+
let r = t + 1, s = r, o = "";
|
|
646
|
+
for (; r < i; ) {
|
|
647
|
+
const u = n.charCodeAt(r);
|
|
648
648
|
if (u === 34)
|
|
649
|
-
return
|
|
649
|
+
return o += n.slice(s, r), x(e, c.STRING, t, r + 1, o);
|
|
650
650
|
if (u === 92) {
|
|
651
|
-
|
|
652
|
-
const
|
|
653
|
-
|
|
651
|
+
o += n.slice(s, r);
|
|
652
|
+
const h = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? yt(e, r) : Et(e, r) : gt(e, r);
|
|
653
|
+
o += h.value, r += h.size, s = r;
|
|
654
654
|
continue;
|
|
655
655
|
}
|
|
656
656
|
if (u === 10 || u === 13)
|
|
657
657
|
break;
|
|
658
658
|
if (V(u))
|
|
659
|
-
++
|
|
660
|
-
else if (se(n,
|
|
661
|
-
|
|
659
|
+
++r;
|
|
660
|
+
else if (se(n, r))
|
|
661
|
+
r += 2;
|
|
662
662
|
else
|
|
663
663
|
throw b(
|
|
664
664
|
e.source,
|
|
665
|
-
|
|
665
|
+
r,
|
|
666
666
|
`Invalid character within String: ${F(
|
|
667
667
|
e,
|
|
668
|
-
|
|
668
|
+
r
|
|
669
669
|
)}.`
|
|
670
670
|
);
|
|
671
671
|
}
|
|
672
|
-
throw b(e.source,
|
|
672
|
+
throw b(e.source, r, "Unterminated string.");
|
|
673
673
|
}
|
|
674
674
|
function yt(e, t) {
|
|
675
675
|
const n = e.source.body;
|
|
676
|
-
let
|
|
677
|
-
for (;
|
|
678
|
-
const s = n.charCodeAt(t +
|
|
676
|
+
let i = 0, r = 3;
|
|
677
|
+
for (; r < 12; ) {
|
|
678
|
+
const s = n.charCodeAt(t + r++);
|
|
679
679
|
if (s === 125) {
|
|
680
|
-
if (
|
|
680
|
+
if (r < 5 || !V(i))
|
|
681
681
|
break;
|
|
682
682
|
return {
|
|
683
|
-
value: String.fromCodePoint(
|
|
684
|
-
size:
|
|
683
|
+
value: String.fromCodePoint(i),
|
|
684
|
+
size: r
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
if (
|
|
687
|
+
if (i = i << 4 | G(s), i < 0)
|
|
688
688
|
break;
|
|
689
689
|
}
|
|
690
690
|
throw b(
|
|
@@ -692,22 +692,22 @@ function yt(e, t) {
|
|
|
692
692
|
t,
|
|
693
693
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
694
694
|
t,
|
|
695
|
-
t +
|
|
695
|
+
t + r
|
|
696
696
|
)}".`
|
|
697
697
|
);
|
|
698
698
|
}
|
|
699
699
|
function Et(e, t) {
|
|
700
|
-
const n = e.source.body,
|
|
701
|
-
if (V(
|
|
700
|
+
const n = e.source.body, i = be(n, t + 2);
|
|
701
|
+
if (V(i))
|
|
702
702
|
return {
|
|
703
|
-
value: String.fromCodePoint(
|
|
703
|
+
value: String.fromCodePoint(i),
|
|
704
704
|
size: 6
|
|
705
705
|
};
|
|
706
|
-
if (Pe(
|
|
707
|
-
const
|
|
708
|
-
if (Le(
|
|
706
|
+
if (Pe(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
707
|
+
const r = be(n, t + 8);
|
|
708
|
+
if (Le(r))
|
|
709
709
|
return {
|
|
710
|
-
value: String.fromCodePoint(
|
|
710
|
+
value: String.fromCodePoint(i, r),
|
|
711
711
|
size: 12
|
|
712
712
|
};
|
|
713
713
|
}
|
|
@@ -777,34 +777,34 @@ function gt(e, t) {
|
|
|
777
777
|
)}".`
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
const n = e.source.body,
|
|
782
|
-
let
|
|
783
|
-
const
|
|
784
|
-
for (; s <
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
u += n.slice(
|
|
780
|
+
function vt(e, t) {
|
|
781
|
+
const n = e.source.body, i = n.length;
|
|
782
|
+
let r = e.lineStart, s = t + 3, o = s, u = "";
|
|
783
|
+
const h = [];
|
|
784
|
+
for (; s < i; ) {
|
|
785
|
+
const p = n.charCodeAt(s);
|
|
786
|
+
if (p === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
787
|
+
u += n.slice(o, s), h.push(u);
|
|
788
788
|
const m = x(
|
|
789
789
|
e,
|
|
790
790
|
c.BLOCK_STRING,
|
|
791
791
|
t,
|
|
792
792
|
s + 3,
|
|
793
793
|
// Return a string of the lines joined with U+000A.
|
|
794
|
-
at(
|
|
794
|
+
at(h).join(`
|
|
795
795
|
`)
|
|
796
796
|
);
|
|
797
|
-
return e.line +=
|
|
797
|
+
return e.line += h.length - 1, e.lineStart = r, m;
|
|
798
798
|
}
|
|
799
|
-
if (
|
|
800
|
-
u += n.slice(
|
|
799
|
+
if (p === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
800
|
+
u += n.slice(o, s), o = s + 1, s += 4;
|
|
801
801
|
continue;
|
|
802
802
|
}
|
|
803
|
-
if (
|
|
804
|
-
u += n.slice(
|
|
803
|
+
if (p === 10 || p === 13) {
|
|
804
|
+
u += n.slice(o, s), h.push(u), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, r = s;
|
|
805
805
|
continue;
|
|
806
806
|
}
|
|
807
|
-
if (V(
|
|
807
|
+
if (V(p))
|
|
808
808
|
++s;
|
|
809
809
|
else if (se(n, s))
|
|
810
810
|
s += 2;
|
|
@@ -820,13 +820,13 @@ function Tt(e, t) {
|
|
|
820
820
|
}
|
|
821
821
|
throw b(e.source, s, "Unterminated string.");
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
const n = e.source.body,
|
|
825
|
-
let
|
|
826
|
-
for (;
|
|
827
|
-
const s = n.charCodeAt(
|
|
823
|
+
function Tt(e, t) {
|
|
824
|
+
const n = e.source.body, i = n.length;
|
|
825
|
+
let r = t + 1;
|
|
826
|
+
for (; r < i; ) {
|
|
827
|
+
const s = n.charCodeAt(r);
|
|
828
828
|
if (ot(s))
|
|
829
|
-
++
|
|
829
|
+
++r;
|
|
830
830
|
else
|
|
831
831
|
break;
|
|
832
832
|
}
|
|
@@ -834,12 +834,12 @@ function vt(e, t) {
|
|
|
834
834
|
e,
|
|
835
835
|
c.NAME,
|
|
836
836
|
t,
|
|
837
|
-
|
|
838
|
-
n.slice(t,
|
|
837
|
+
r,
|
|
838
|
+
n.slice(t, r)
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
841
|
const Ct = 10, Fe = 2;
|
|
842
|
-
function
|
|
842
|
+
function Te(e) {
|
|
843
843
|
return oe(e, []);
|
|
844
844
|
}
|
|
845
845
|
function oe(e, t) {
|
|
@@ -861,9 +861,9 @@ function At(e, t) {
|
|
|
861
861
|
return "[Circular]";
|
|
862
862
|
const n = [...t, e];
|
|
863
863
|
if (Nt(e)) {
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
return typeof
|
|
864
|
+
const i = e.toJSON();
|
|
865
|
+
if (i !== e)
|
|
866
|
+
return typeof i == "string" ? i : oe(i, n);
|
|
867
867
|
} else if (Array.isArray(e))
|
|
868
868
|
return bt(e, n);
|
|
869
869
|
return xt(e, n);
|
|
@@ -874,7 +874,7 @@ function Nt(e) {
|
|
|
874
874
|
function xt(e, t) {
|
|
875
875
|
const n = Object.entries(e);
|
|
876
876
|
return n.length === 0 ? "{}" : t.length > Fe ? "[" + It(e) + "]" : "{ " + n.map(
|
|
877
|
-
([
|
|
877
|
+
([r, s]) => r + ": " + oe(s, t)
|
|
878
878
|
).join(", ") + " }";
|
|
879
879
|
}
|
|
880
880
|
function bt(e, t) {
|
|
@@ -882,10 +882,10 @@ function bt(e, t) {
|
|
|
882
882
|
return "[]";
|
|
883
883
|
if (t.length > Fe)
|
|
884
884
|
return "[Array]";
|
|
885
|
-
const n = Math.min(Ct, e.length),
|
|
885
|
+
const n = Math.min(Ct, e.length), i = e.length - n, r = [];
|
|
886
886
|
for (let s = 0; s < n; ++s)
|
|
887
|
-
|
|
888
|
-
return
|
|
887
|
+
r.push(oe(e[s], t));
|
|
888
|
+
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
889
889
|
}
|
|
890
890
|
function It(e) {
|
|
891
891
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
@@ -905,14 +905,14 @@ const Ot = (
|
|
|
905
905
|
if (t instanceof n)
|
|
906
906
|
return !0;
|
|
907
907
|
if (typeof t == "object" && t !== null) {
|
|
908
|
-
var
|
|
909
|
-
const
|
|
908
|
+
var i;
|
|
909
|
+
const r = n.prototype[Symbol.toStringTag], s = (
|
|
910
910
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
911
|
-
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (
|
|
911
|
+
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
912
912
|
);
|
|
913
|
-
if (
|
|
914
|
-
const
|
|
915
|
-
throw new Error(`Cannot use ${
|
|
913
|
+
if (r === s) {
|
|
914
|
+
const o = Te(t);
|
|
915
|
+
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
916
916
|
|
|
917
917
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
918
918
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -930,11 +930,11 @@ spurious results.`);
|
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
932
|
class Be {
|
|
933
|
-
constructor(t, n = "GraphQL request",
|
|
933
|
+
constructor(t, n = "GraphQL request", i = {
|
|
934
934
|
line: 1,
|
|
935
935
|
column: 1
|
|
936
936
|
}) {
|
|
937
|
-
typeof t == "string" || Z(!1, `Body must be a string. Received: ${
|
|
937
|
+
typeof t == "string" || Z(!1, `Body must be a string. Received: ${Te(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
|
|
938
938
|
!1,
|
|
939
939
|
"line in locationOffset is 1-indexed and must be positive."
|
|
940
940
|
), this.locationOffset.column > 0 || Z(
|
|
@@ -954,8 +954,8 @@ function Me(e, t) {
|
|
|
954
954
|
}
|
|
955
955
|
class _t {
|
|
956
956
|
constructor(t, n = {}) {
|
|
957
|
-
const
|
|
958
|
-
this._lexer = new lt(
|
|
957
|
+
const i = Dt(t) ? t : new Be(t);
|
|
958
|
+
this._lexer = new lt(i), this._options = n, this._tokenCounter = 0;
|
|
959
959
|
}
|
|
960
960
|
/**
|
|
961
961
|
* Converts a name lex token into a name parse node.
|
|
@@ -1064,11 +1064,11 @@ class _t {
|
|
|
1064
1064
|
selectionSet: this.parseSelectionSet()
|
|
1065
1065
|
});
|
|
1066
1066
|
const n = this.parseOperationType();
|
|
1067
|
-
let
|
|
1068
|
-
return this.peek(c.NAME) && (
|
|
1067
|
+
let i;
|
|
1068
|
+
return this.peek(c.NAME) && (i = this.parseName()), this.node(t, {
|
|
1069
1069
|
kind: f.OPERATION_DEFINITION,
|
|
1070
1070
|
operation: n,
|
|
1071
|
-
name:
|
|
1071
|
+
name: i,
|
|
1072
1072
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1073
1073
|
directives: this.parseDirectives(!1),
|
|
1074
1074
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1152,11 +1152,11 @@ class _t {
|
|
|
1152
1152
|
*/
|
|
1153
1153
|
parseField() {
|
|
1154
1154
|
const t = this._lexer.token, n = this.parseName();
|
|
1155
|
-
let
|
|
1156
|
-
return this.expectOptionalToken(c.COLON) ? (
|
|
1155
|
+
let i, r;
|
|
1156
|
+
return this.expectOptionalToken(c.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
|
|
1157
1157
|
kind: f.FIELD,
|
|
1158
|
-
alias:
|
|
1159
|
-
name:
|
|
1158
|
+
alias: i,
|
|
1159
|
+
name: r,
|
|
1160
1160
|
arguments: this.parseArguments(!1),
|
|
1161
1161
|
directives: this.parseDirectives(!1),
|
|
1162
1162
|
selectionSet: this.peek(c.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
@@ -1173,10 +1173,10 @@ class _t {
|
|
|
1173
1173
|
* Argument[Const] : Name : Value[?Const]
|
|
1174
1174
|
*/
|
|
1175
1175
|
parseArgument(t = !1) {
|
|
1176
|
-
const n = this._lexer.token,
|
|
1176
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1177
1177
|
return this.expectToken(c.COLON), this.node(n, {
|
|
1178
1178
|
kind: f.ARGUMENT,
|
|
1179
|
-
name:
|
|
1179
|
+
name: i,
|
|
1180
1180
|
value: this.parseValueLiteral(t)
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
@@ -1301,11 +1301,11 @@ class _t {
|
|
|
1301
1301
|
case c.DOLLAR:
|
|
1302
1302
|
if (t)
|
|
1303
1303
|
if (this.expectToken(c.DOLLAR), this._lexer.token.kind === c.NAME) {
|
|
1304
|
-
const
|
|
1304
|
+
const i = this._lexer.token.value;
|
|
1305
1305
|
throw b(
|
|
1306
1306
|
this._lexer.source,
|
|
1307
1307
|
n.start,
|
|
1308
|
-
`Unexpected variable "$${
|
|
1308
|
+
`Unexpected variable "$${i}" in constant value.`
|
|
1309
1309
|
);
|
|
1310
1310
|
} else
|
|
1311
1311
|
throw this.unexpected(n);
|
|
@@ -1355,10 +1355,10 @@ class _t {
|
|
|
1355
1355
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1356
1356
|
*/
|
|
1357
1357
|
parseObjectField(t) {
|
|
1358
|
-
const n = this._lexer.token,
|
|
1358
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1359
1359
|
return this.expectToken(c.COLON), this.node(n, {
|
|
1360
1360
|
kind: f.OBJECT_FIELD,
|
|
1361
|
-
name:
|
|
1361
|
+
name: i,
|
|
1362
1362
|
value: this.parseValueLiteral(t)
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
@@ -1399,10 +1399,10 @@ class _t {
|
|
|
1399
1399
|
const t = this._lexer.token;
|
|
1400
1400
|
let n;
|
|
1401
1401
|
if (this.expectOptionalToken(c.BRACKET_L)) {
|
|
1402
|
-
const
|
|
1402
|
+
const i = this.parseTypeReference();
|
|
1403
1403
|
this.expectToken(c.BRACKET_R), n = this.node(t, {
|
|
1404
1404
|
kind: f.LIST_TYPE,
|
|
1405
|
-
type:
|
|
1405
|
+
type: i
|
|
1406
1406
|
});
|
|
1407
1407
|
} else
|
|
1408
1408
|
n = this.parseNamedType();
|
|
@@ -1439,7 +1439,7 @@ class _t {
|
|
|
1439
1439
|
parseSchemaDefinition() {
|
|
1440
1440
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1441
1441
|
this.expectKeyword("schema");
|
|
1442
|
-
const
|
|
1442
|
+
const i = this.parseConstDirectives(), r = this.many(
|
|
1443
1443
|
c.BRACE_L,
|
|
1444
1444
|
this.parseOperationTypeDefinition,
|
|
1445
1445
|
c.BRACE_R
|
|
@@ -1447,8 +1447,8 @@ class _t {
|
|
|
1447
1447
|
return this.node(t, {
|
|
1448
1448
|
kind: f.SCHEMA_DEFINITION,
|
|
1449
1449
|
description: n,
|
|
1450
|
-
directives:
|
|
1451
|
-
operationTypes:
|
|
1450
|
+
directives: i,
|
|
1451
|
+
operationTypes: r
|
|
1452
1452
|
});
|
|
1453
1453
|
}
|
|
1454
1454
|
/**
|
|
@@ -1457,11 +1457,11 @@ class _t {
|
|
|
1457
1457
|
parseOperationTypeDefinition() {
|
|
1458
1458
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
1459
1459
|
this.expectToken(c.COLON);
|
|
1460
|
-
const
|
|
1460
|
+
const i = this.parseNamedType();
|
|
1461
1461
|
return this.node(t, {
|
|
1462
1462
|
kind: f.OPERATION_TYPE_DEFINITION,
|
|
1463
1463
|
operation: n,
|
|
1464
|
-
type:
|
|
1464
|
+
type: i
|
|
1465
1465
|
});
|
|
1466
1466
|
}
|
|
1467
1467
|
/**
|
|
@@ -1470,12 +1470,12 @@ class _t {
|
|
|
1470
1470
|
parseScalarTypeDefinition() {
|
|
1471
1471
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1472
1472
|
this.expectKeyword("scalar");
|
|
1473
|
-
const
|
|
1473
|
+
const i = this.parseName(), r = this.parseConstDirectives();
|
|
1474
1474
|
return this.node(t, {
|
|
1475
1475
|
kind: f.SCALAR_TYPE_DEFINITION,
|
|
1476
1476
|
description: n,
|
|
1477
|
-
name:
|
|
1478
|
-
directives:
|
|
1477
|
+
name: i,
|
|
1478
|
+
directives: r
|
|
1479
1479
|
});
|
|
1480
1480
|
}
|
|
1481
1481
|
/**
|
|
@@ -1486,14 +1486,14 @@ class _t {
|
|
|
1486
1486
|
parseObjectTypeDefinition() {
|
|
1487
1487
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1488
1488
|
this.expectKeyword("type");
|
|
1489
|
-
const
|
|
1489
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1490
1490
|
return this.node(t, {
|
|
1491
1491
|
kind: f.OBJECT_TYPE_DEFINITION,
|
|
1492
1492
|
description: n,
|
|
1493
|
-
name:
|
|
1494
|
-
interfaces:
|
|
1493
|
+
name: i,
|
|
1494
|
+
interfaces: r,
|
|
1495
1495
|
directives: s,
|
|
1496
|
-
fields:
|
|
1496
|
+
fields: o
|
|
1497
1497
|
});
|
|
1498
1498
|
}
|
|
1499
1499
|
/**
|
|
@@ -1521,16 +1521,16 @@ class _t {
|
|
|
1521
1521
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1522
1522
|
*/
|
|
1523
1523
|
parseFieldDefinition() {
|
|
1524
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1524
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
1525
1525
|
this.expectToken(c.COLON);
|
|
1526
|
-
const s = this.parseTypeReference(),
|
|
1526
|
+
const s = this.parseTypeReference(), o = this.parseConstDirectives();
|
|
1527
1527
|
return this.node(t, {
|
|
1528
1528
|
kind: f.FIELD_DEFINITION,
|
|
1529
1529
|
description: n,
|
|
1530
|
-
name:
|
|
1531
|
-
arguments:
|
|
1530
|
+
name: i,
|
|
1531
|
+
arguments: r,
|
|
1532
1532
|
type: s,
|
|
1533
|
-
directives:
|
|
1533
|
+
directives: o
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
1536
1536
|
/**
|
|
@@ -1548,19 +1548,19 @@ class _t {
|
|
|
1548
1548
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1549
1549
|
*/
|
|
1550
1550
|
parseInputValueDef() {
|
|
1551
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1551
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
1552
1552
|
this.expectToken(c.COLON);
|
|
1553
|
-
const
|
|
1553
|
+
const r = this.parseTypeReference();
|
|
1554
1554
|
let s;
|
|
1555
1555
|
this.expectOptionalToken(c.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1556
|
-
const
|
|
1556
|
+
const o = this.parseConstDirectives();
|
|
1557
1557
|
return this.node(t, {
|
|
1558
1558
|
kind: f.INPUT_VALUE_DEFINITION,
|
|
1559
1559
|
description: n,
|
|
1560
|
-
name:
|
|
1561
|
-
type:
|
|
1560
|
+
name: i,
|
|
1561
|
+
type: r,
|
|
1562
1562
|
defaultValue: s,
|
|
1563
|
-
directives:
|
|
1563
|
+
directives: o
|
|
1564
1564
|
});
|
|
1565
1565
|
}
|
|
1566
1566
|
/**
|
|
@@ -1570,14 +1570,14 @@ class _t {
|
|
|
1570
1570
|
parseInterfaceTypeDefinition() {
|
|
1571
1571
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1572
1572
|
this.expectKeyword("interface");
|
|
1573
|
-
const
|
|
1573
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1574
1574
|
return this.node(t, {
|
|
1575
1575
|
kind: f.INTERFACE_TYPE_DEFINITION,
|
|
1576
1576
|
description: n,
|
|
1577
|
-
name:
|
|
1578
|
-
interfaces:
|
|
1577
|
+
name: i,
|
|
1578
|
+
interfaces: r,
|
|
1579
1579
|
directives: s,
|
|
1580
|
-
fields:
|
|
1580
|
+
fields: o
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
1583
|
/**
|
|
@@ -1587,12 +1587,12 @@ class _t {
|
|
|
1587
1587
|
parseUnionTypeDefinition() {
|
|
1588
1588
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1589
1589
|
this.expectKeyword("union");
|
|
1590
|
-
const
|
|
1590
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1591
1591
|
return this.node(t, {
|
|
1592
1592
|
kind: f.UNION_TYPE_DEFINITION,
|
|
1593
1593
|
description: n,
|
|
1594
|
-
name:
|
|
1595
|
-
directives:
|
|
1594
|
+
name: i,
|
|
1595
|
+
directives: r,
|
|
1596
1596
|
types: s
|
|
1597
1597
|
});
|
|
1598
1598
|
}
|
|
@@ -1611,12 +1611,12 @@ class _t {
|
|
|
1611
1611
|
parseEnumTypeDefinition() {
|
|
1612
1612
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1613
1613
|
this.expectKeyword("enum");
|
|
1614
|
-
const
|
|
1614
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1615
1615
|
return this.node(t, {
|
|
1616
1616
|
kind: f.ENUM_TYPE_DEFINITION,
|
|
1617
1617
|
description: n,
|
|
1618
|
-
name:
|
|
1619
|
-
directives:
|
|
1618
|
+
name: i,
|
|
1619
|
+
directives: r,
|
|
1620
1620
|
values: s
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
@@ -1636,12 +1636,12 @@ class _t {
|
|
|
1636
1636
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1637
1637
|
*/
|
|
1638
1638
|
parseEnumValueDefinition() {
|
|
1639
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1639
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
1640
1640
|
return this.node(t, {
|
|
1641
1641
|
kind: f.ENUM_VALUE_DEFINITION,
|
|
1642
1642
|
description: n,
|
|
1643
|
-
name:
|
|
1644
|
-
directives:
|
|
1643
|
+
name: i,
|
|
1644
|
+
directives: r
|
|
1645
1645
|
});
|
|
1646
1646
|
}
|
|
1647
1647
|
/**
|
|
@@ -1665,12 +1665,12 @@ class _t {
|
|
|
1665
1665
|
parseInputObjectTypeDefinition() {
|
|
1666
1666
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1667
1667
|
this.expectKeyword("input");
|
|
1668
|
-
const
|
|
1668
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1669
1669
|
return this.node(t, {
|
|
1670
1670
|
kind: f.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1671
1671
|
description: n,
|
|
1672
|
-
name:
|
|
1673
|
-
directives:
|
|
1672
|
+
name: i,
|
|
1673
|
+
directives: r,
|
|
1674
1674
|
fields: s
|
|
1675
1675
|
});
|
|
1676
1676
|
}
|
|
@@ -1730,17 +1730,17 @@ class _t {
|
|
|
1730
1730
|
parseSchemaExtension() {
|
|
1731
1731
|
const t = this._lexer.token;
|
|
1732
1732
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1733
|
-
const n = this.parseConstDirectives(),
|
|
1733
|
+
const n = this.parseConstDirectives(), i = this.optionalMany(
|
|
1734
1734
|
c.BRACE_L,
|
|
1735
1735
|
this.parseOperationTypeDefinition,
|
|
1736
1736
|
c.BRACE_R
|
|
1737
1737
|
);
|
|
1738
|
-
if (n.length === 0 &&
|
|
1738
|
+
if (n.length === 0 && i.length === 0)
|
|
1739
1739
|
throw this.unexpected();
|
|
1740
1740
|
return this.node(t, {
|
|
1741
1741
|
kind: f.SCHEMA_EXTENSION,
|
|
1742
1742
|
directives: n,
|
|
1743
|
-
operationTypes:
|
|
1743
|
+
operationTypes: i
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
/**
|
|
@@ -1750,13 +1750,13 @@ class _t {
|
|
|
1750
1750
|
parseScalarTypeExtension() {
|
|
1751
1751
|
const t = this._lexer.token;
|
|
1752
1752
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1753
|
-
const n = this.parseName(),
|
|
1754
|
-
if (
|
|
1753
|
+
const n = this.parseName(), i = this.parseConstDirectives();
|
|
1754
|
+
if (i.length === 0)
|
|
1755
1755
|
throw this.unexpected();
|
|
1756
1756
|
return this.node(t, {
|
|
1757
1757
|
kind: f.SCALAR_TYPE_EXTENSION,
|
|
1758
1758
|
name: n,
|
|
1759
|
-
directives:
|
|
1759
|
+
directives: i
|
|
1760
1760
|
});
|
|
1761
1761
|
}
|
|
1762
1762
|
/**
|
|
@@ -1768,14 +1768,14 @@ class _t {
|
|
|
1768
1768
|
parseObjectTypeExtension() {
|
|
1769
1769
|
const t = this._lexer.token;
|
|
1770
1770
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1771
|
-
const n = this.parseName(),
|
|
1772
|
-
if (
|
|
1771
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1772
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1773
1773
|
throw this.unexpected();
|
|
1774
1774
|
return this.node(t, {
|
|
1775
1775
|
kind: f.OBJECT_TYPE_EXTENSION,
|
|
1776
1776
|
name: n,
|
|
1777
|
-
interfaces:
|
|
1778
|
-
directives:
|
|
1777
|
+
interfaces: i,
|
|
1778
|
+
directives: r,
|
|
1779
1779
|
fields: s
|
|
1780
1780
|
});
|
|
1781
1781
|
}
|
|
@@ -1788,14 +1788,14 @@ class _t {
|
|
|
1788
1788
|
parseInterfaceTypeExtension() {
|
|
1789
1789
|
const t = this._lexer.token;
|
|
1790
1790
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1791
|
-
const n = this.parseName(),
|
|
1792
|
-
if (
|
|
1791
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1792
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1793
1793
|
throw this.unexpected();
|
|
1794
1794
|
return this.node(t, {
|
|
1795
1795
|
kind: f.INTERFACE_TYPE_EXTENSION,
|
|
1796
1796
|
name: n,
|
|
1797
|
-
interfaces:
|
|
1798
|
-
directives:
|
|
1797
|
+
interfaces: i,
|
|
1798
|
+
directives: r,
|
|
1799
1799
|
fields: s
|
|
1800
1800
|
});
|
|
1801
1801
|
}
|
|
@@ -1807,14 +1807,14 @@ class _t {
|
|
|
1807
1807
|
parseUnionTypeExtension() {
|
|
1808
1808
|
const t = this._lexer.token;
|
|
1809
1809
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1810
|
-
const n = this.parseName(),
|
|
1811
|
-
if (
|
|
1810
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
1811
|
+
if (i.length === 0 && r.length === 0)
|
|
1812
1812
|
throw this.unexpected();
|
|
1813
1813
|
return this.node(t, {
|
|
1814
1814
|
kind: f.UNION_TYPE_EXTENSION,
|
|
1815
1815
|
name: n,
|
|
1816
|
-
directives:
|
|
1817
|
-
types:
|
|
1816
|
+
directives: i,
|
|
1817
|
+
types: r
|
|
1818
1818
|
});
|
|
1819
1819
|
}
|
|
1820
1820
|
/**
|
|
@@ -1825,14 +1825,14 @@ class _t {
|
|
|
1825
1825
|
parseEnumTypeExtension() {
|
|
1826
1826
|
const t = this._lexer.token;
|
|
1827
1827
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1828
|
-
const n = this.parseName(),
|
|
1829
|
-
if (
|
|
1828
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
1829
|
+
if (i.length === 0 && r.length === 0)
|
|
1830
1830
|
throw this.unexpected();
|
|
1831
1831
|
return this.node(t, {
|
|
1832
1832
|
kind: f.ENUM_TYPE_EXTENSION,
|
|
1833
1833
|
name: n,
|
|
1834
|
-
directives:
|
|
1835
|
-
values:
|
|
1834
|
+
directives: i,
|
|
1835
|
+
values: r
|
|
1836
1836
|
});
|
|
1837
1837
|
}
|
|
1838
1838
|
/**
|
|
@@ -1843,14 +1843,14 @@ class _t {
|
|
|
1843
1843
|
parseInputObjectTypeExtension() {
|
|
1844
1844
|
const t = this._lexer.token;
|
|
1845
1845
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1846
|
-
const n = this.parseName(),
|
|
1847
|
-
if (
|
|
1846
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
1847
|
+
if (i.length === 0 && r.length === 0)
|
|
1848
1848
|
throw this.unexpected();
|
|
1849
1849
|
return this.node(t, {
|
|
1850
1850
|
kind: f.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1851
1851
|
name: n,
|
|
1852
|
-
directives:
|
|
1853
|
-
fields:
|
|
1852
|
+
directives: i,
|
|
1853
|
+
fields: r
|
|
1854
1854
|
});
|
|
1855
1855
|
}
|
|
1856
1856
|
/**
|
|
@@ -1862,16 +1862,16 @@ class _t {
|
|
|
1862
1862
|
parseDirectiveDefinition() {
|
|
1863
1863
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1864
1864
|
this.expectKeyword("directive"), this.expectToken(c.AT);
|
|
1865
|
-
const
|
|
1865
|
+
const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1866
1866
|
this.expectKeyword("on");
|
|
1867
|
-
const
|
|
1867
|
+
const o = this.parseDirectiveLocations();
|
|
1868
1868
|
return this.node(t, {
|
|
1869
1869
|
kind: f.DIRECTIVE_DEFINITION,
|
|
1870
1870
|
description: n,
|
|
1871
|
-
name:
|
|
1872
|
-
arguments:
|
|
1871
|
+
name: i,
|
|
1872
|
+
arguments: r,
|
|
1873
1873
|
repeatable: s,
|
|
1874
|
-
locations:
|
|
1874
|
+
locations: o
|
|
1875
1875
|
});
|
|
1876
1876
|
}
|
|
1877
1877
|
/**
|
|
@@ -1922,7 +1922,7 @@ class _t {
|
|
|
1922
1922
|
* given parsed object.
|
|
1923
1923
|
*/
|
|
1924
1924
|
node(t, n) {
|
|
1925
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
1925
|
+
return this._options.noLocation !== !0 && (n.loc = new it(
|
|
1926
1926
|
t,
|
|
1927
1927
|
this._lexer.lastToken,
|
|
1928
1928
|
this._lexer.source
|
|
@@ -1994,12 +1994,12 @@ class _t {
|
|
|
1994
1994
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
1995
1995
|
* Advances the parser to the next lex token after the closing token.
|
|
1996
1996
|
*/
|
|
1997
|
-
any(t, n,
|
|
1997
|
+
any(t, n, i) {
|
|
1998
1998
|
this.expectToken(t);
|
|
1999
|
-
const
|
|
2000
|
-
for (; !this.expectOptionalToken(
|
|
2001
|
-
|
|
2002
|
-
return
|
|
1999
|
+
const r = [];
|
|
2000
|
+
for (; !this.expectOptionalToken(i); )
|
|
2001
|
+
r.push(n.call(this));
|
|
2002
|
+
return r;
|
|
2003
2003
|
}
|
|
2004
2004
|
/**
|
|
2005
2005
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -2007,13 +2007,13 @@ class _t {
|
|
|
2007
2007
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2008
2008
|
* Advances the parser to the next lex token after the closing token.
|
|
2009
2009
|
*/
|
|
2010
|
-
optionalMany(t, n,
|
|
2010
|
+
optionalMany(t, n, i) {
|
|
2011
2011
|
if (this.expectOptionalToken(t)) {
|
|
2012
|
-
const
|
|
2012
|
+
const r = [];
|
|
2013
2013
|
do
|
|
2014
|
-
|
|
2015
|
-
while (!this.expectOptionalToken(
|
|
2016
|
-
return
|
|
2014
|
+
r.push(n.call(this));
|
|
2015
|
+
while (!this.expectOptionalToken(i));
|
|
2016
|
+
return r;
|
|
2017
2017
|
}
|
|
2018
2018
|
return [];
|
|
2019
2019
|
}
|
|
@@ -2022,13 +2022,13 @@ class _t {
|
|
|
2022
2022
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2023
2023
|
* Advances the parser to the next lex token after the closing token.
|
|
2024
2024
|
*/
|
|
2025
|
-
many(t, n,
|
|
2025
|
+
many(t, n, i) {
|
|
2026
2026
|
this.expectToken(t);
|
|
2027
|
-
const
|
|
2027
|
+
const r = [];
|
|
2028
2028
|
do
|
|
2029
|
-
|
|
2030
|
-
while (!this.expectOptionalToken(
|
|
2031
|
-
return
|
|
2029
|
+
r.push(n.call(this));
|
|
2030
|
+
while (!this.expectOptionalToken(i));
|
|
2031
|
+
return r;
|
|
2032
2032
|
}
|
|
2033
2033
|
/**
|
|
2034
2034
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
@@ -2037,11 +2037,11 @@ class _t {
|
|
|
2037
2037
|
*/
|
|
2038
2038
|
delimitedMany(t, n) {
|
|
2039
2039
|
this.expectOptionalToken(t);
|
|
2040
|
-
const
|
|
2040
|
+
const i = [];
|
|
2041
2041
|
do
|
|
2042
|
-
|
|
2042
|
+
i.push(n.call(this));
|
|
2043
2043
|
while (this.expectOptionalToken(t));
|
|
2044
|
-
return
|
|
2044
|
+
return i;
|
|
2045
2045
|
}
|
|
2046
2046
|
advanceLexer() {
|
|
2047
2047
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
@@ -2058,7 +2058,7 @@ function W(e) {
|
|
|
2058
2058
|
return Ue(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2059
2059
|
}
|
|
2060
2060
|
function Ue(e) {
|
|
2061
|
-
return
|
|
2061
|
+
return dt(e) ? `"${e}"` : e;
|
|
2062
2062
|
}
|
|
2063
2063
|
function kt(e) {
|
|
2064
2064
|
return `"${e.replace(Rt, St)}"`;
|
|
@@ -2235,71 +2235,71 @@ const wt = [
|
|
|
2235
2235
|
"\\u009F"
|
|
2236
2236
|
], Pt = Object.freeze({});
|
|
2237
2237
|
function Lt(e, t, n = Re) {
|
|
2238
|
-
const
|
|
2238
|
+
const i = /* @__PURE__ */ new Map();
|
|
2239
2239
|
for (const _ of Object.values(f))
|
|
2240
|
-
|
|
2241
|
-
let
|
|
2240
|
+
i.set(_, Ft(t, _));
|
|
2241
|
+
let r, s = Array.isArray(e), o = [e], u = -1, h = [], p = e, m, E;
|
|
2242
2242
|
const g = [], A = [];
|
|
2243
2243
|
do {
|
|
2244
2244
|
u++;
|
|
2245
|
-
const _ = u ===
|
|
2245
|
+
const _ = u === o.length, z = _ && h.length !== 0;
|
|
2246
2246
|
if (_) {
|
|
2247
|
-
if (m = A.length === 0 ? void 0 : g[g.length - 1],
|
|
2247
|
+
if (m = A.length === 0 ? void 0 : g[g.length - 1], p = E, E = A.pop(), z)
|
|
2248
2248
|
if (s) {
|
|
2249
|
-
|
|
2249
|
+
p = p.slice();
|
|
2250
2250
|
let k = 0;
|
|
2251
|
-
for (const [B, Q] of
|
|
2251
|
+
for (const [B, Q] of h) {
|
|
2252
2252
|
const J = B - k;
|
|
2253
|
-
Q === null ? (
|
|
2253
|
+
Q === null ? (p.splice(J, 1), k++) : p[J] = Q;
|
|
2254
2254
|
}
|
|
2255
2255
|
} else {
|
|
2256
|
-
|
|
2256
|
+
p = Object.defineProperties(
|
|
2257
2257
|
{},
|
|
2258
|
-
Object.getOwnPropertyDescriptors(
|
|
2258
|
+
Object.getOwnPropertyDescriptors(p)
|
|
2259
2259
|
);
|
|
2260
|
-
for (const [k, B] of
|
|
2261
|
-
|
|
2260
|
+
for (const [k, B] of h)
|
|
2261
|
+
p[k] = B;
|
|
2262
2262
|
}
|
|
2263
|
-
u =
|
|
2263
|
+
u = r.index, o = r.keys, h = r.edits, s = r.inArray, r = r.prev;
|
|
2264
2264
|
} else if (E) {
|
|
2265
|
-
if (m = s ? u :
|
|
2265
|
+
if (m = s ? u : o[u], p = E[m], p == null)
|
|
2266
2266
|
continue;
|
|
2267
2267
|
g.push(m);
|
|
2268
2268
|
}
|
|
2269
2269
|
let S;
|
|
2270
|
-
if (!Array.isArray(
|
|
2270
|
+
if (!Array.isArray(p)) {
|
|
2271
2271
|
var y, N;
|
|
2272
|
-
xe(
|
|
2273
|
-
const k = _ ? (y =
|
|
2274
|
-
if (S = k == null ? void 0 : k.call(t,
|
|
2272
|
+
xe(p) || Z(!1, `Invalid AST Node: ${Te(p)}.`);
|
|
2273
|
+
const k = _ ? (y = i.get(p.kind)) === null || y === void 0 ? void 0 : y.leave : (N = i.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
|
|
2274
|
+
if (S = k == null ? void 0 : k.call(t, p, m, E, g, A), S === Pt)
|
|
2275
2275
|
break;
|
|
2276
2276
|
if (S === !1) {
|
|
2277
2277
|
if (!_) {
|
|
2278
2278
|
g.pop();
|
|
2279
2279
|
continue;
|
|
2280
2280
|
}
|
|
2281
|
-
} else if (S !== void 0 && (
|
|
2281
|
+
} else if (S !== void 0 && (h.push([m, S]), !_))
|
|
2282
2282
|
if (xe(S))
|
|
2283
|
-
|
|
2283
|
+
p = S;
|
|
2284
2284
|
else {
|
|
2285
2285
|
g.pop();
|
|
2286
2286
|
continue;
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
|
-
if (S === void 0 && z &&
|
|
2289
|
+
if (S === void 0 && z && h.push([m, p]), _)
|
|
2290
2290
|
g.pop();
|
|
2291
2291
|
else {
|
|
2292
2292
|
var D;
|
|
2293
|
-
|
|
2293
|
+
r = {
|
|
2294
2294
|
inArray: s,
|
|
2295
2295
|
index: u,
|
|
2296
|
-
keys:
|
|
2297
|
-
edits:
|
|
2298
|
-
prev:
|
|
2299
|
-
}, s = Array.isArray(
|
|
2296
|
+
keys: o,
|
|
2297
|
+
edits: h,
|
|
2298
|
+
prev: r
|
|
2299
|
+
}, s = Array.isArray(p), o = s ? p : (D = n[p.kind]) !== null && D !== void 0 ? D : [], u = -1, h = [], E && A.push(E), E = p;
|
|
2300
2300
|
}
|
|
2301
|
-
} while (
|
|
2302
|
-
return
|
|
2301
|
+
} while (r !== void 0);
|
|
2302
|
+
return h.length !== 0 ? h[h.length - 1][1] : e;
|
|
2303
2303
|
}
|
|
2304
2304
|
function Ft(e, t) {
|
|
2305
2305
|
const n = e[t];
|
|
@@ -2323,17 +2323,17 @@ const Mt = 80, Ut = {
|
|
|
2323
2323
|
},
|
|
2324
2324
|
// Document
|
|
2325
2325
|
Document: {
|
|
2326
|
-
leave: (e) =>
|
|
2326
|
+
leave: (e) => d(e.definitions, `
|
|
2327
2327
|
|
|
2328
2328
|
`)
|
|
2329
2329
|
},
|
|
2330
2330
|
OperationDefinition: {
|
|
2331
2331
|
leave(e) {
|
|
2332
|
-
const t =
|
|
2332
|
+
const t = T("(", d(e.variableDefinitions, ", "), ")"), n = d(
|
|
2333
2333
|
[
|
|
2334
2334
|
e.operation,
|
|
2335
|
-
|
|
2336
|
-
|
|
2335
|
+
d([e.name, t]),
|
|
2336
|
+
d(e.directives, " ")
|
|
2337
2337
|
],
|
|
2338
2338
|
" "
|
|
2339
2339
|
);
|
|
@@ -2341,19 +2341,19 @@ const Mt = 80, Ut = {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
},
|
|
2343
2343
|
VariableDefinition: {
|
|
2344
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives:
|
|
2344
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + T(" = ", n) + T(" ", d(i, " "))
|
|
2345
2345
|
},
|
|
2346
2346
|
SelectionSet: {
|
|
2347
2347
|
leave: ({ selections: e }) => R(e)
|
|
2348
2348
|
},
|
|
2349
2349
|
Field: {
|
|
2350
|
-
leave({ alias: e, name: t, arguments: n, directives:
|
|
2351
|
-
const s =
|
|
2352
|
-
let
|
|
2353
|
-
return
|
|
2354
|
-
`, K(
|
|
2350
|
+
leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
|
|
2351
|
+
const s = T("", e, ": ") + t;
|
|
2352
|
+
let o = s + T("(", d(n, ", "), ")");
|
|
2353
|
+
return o.length > Mt && (o = s + T(`(
|
|
2354
|
+
`, K(d(n, `
|
|
2355
2355
|
`)), `
|
|
2356
|
-
)`)),
|
|
2356
|
+
)`)), d([o, d(i, " "), r], " ");
|
|
2357
2357
|
}
|
|
2358
2358
|
},
|
|
2359
2359
|
Argument: {
|
|
@@ -2361,23 +2361,23 @@ const Mt = 80, Ut = {
|
|
|
2361
2361
|
},
|
|
2362
2362
|
// Fragments
|
|
2363
2363
|
FragmentSpread: {
|
|
2364
|
-
leave: ({ name: e, directives: t }) => "..." + e +
|
|
2364
|
+
leave: ({ name: e, directives: t }) => "..." + e + T(" ", d(t, " "))
|
|
2365
2365
|
},
|
|
2366
2366
|
InlineFragment: {
|
|
2367
|
-
leave: ({ typeCondition: e, directives: t, selectionSet: n }) =>
|
|
2367
|
+
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
|
|
2368
2368
|
[
|
|
2369
2369
|
"...",
|
|
2370
|
-
|
|
2371
|
-
|
|
2370
|
+
T("on ", e),
|
|
2371
|
+
d(t, " "),
|
|
2372
2372
|
n
|
|
2373
2373
|
],
|
|
2374
2374
|
" "
|
|
2375
2375
|
)
|
|
2376
2376
|
},
|
|
2377
2377
|
FragmentDefinition: {
|
|
2378
|
-
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives:
|
|
2378
|
+
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
|
|
2379
2379
|
// or removed in the future.
|
|
2380
|
-
`fragment ${e}${
|
|
2380
|
+
`fragment ${e}${T("(", d(n, ", "), ")")} on ${t} ${T("", d(i, " "), " ")}` + r
|
|
2381
2381
|
)
|
|
2382
2382
|
},
|
|
2383
2383
|
// Value
|
|
@@ -2400,17 +2400,17 @@ const Mt = 80, Ut = {
|
|
|
2400
2400
|
leave: ({ value: e }) => e
|
|
2401
2401
|
},
|
|
2402
2402
|
ListValue: {
|
|
2403
|
-
leave: ({ values: e }) => "[" +
|
|
2403
|
+
leave: ({ values: e }) => "[" + d(e, ", ") + "]"
|
|
2404
2404
|
},
|
|
2405
2405
|
ObjectValue: {
|
|
2406
|
-
leave: ({ fields: e }) => "{" +
|
|
2406
|
+
leave: ({ fields: e }) => "{" + d(e, ", ") + "}"
|
|
2407
2407
|
},
|
|
2408
2408
|
ObjectField: {
|
|
2409
2409
|
leave: ({ name: e, value: t }) => e + ": " + t
|
|
2410
2410
|
},
|
|
2411
2411
|
// Directive
|
|
2412
2412
|
Directive: {
|
|
2413
|
-
leave: ({ name: e, arguments: t }) => "@" + e +
|
|
2413
|
+
leave: ({ name: e, arguments: t }) => "@" + e + T("(", d(t, ", "), ")")
|
|
2414
2414
|
},
|
|
2415
2415
|
// Type
|
|
2416
2416
|
NamedType: {
|
|
@@ -2424,148 +2424,148 @@ const Mt = 80, Ut = {
|
|
|
2424
2424
|
},
|
|
2425
2425
|
// Type System Definitions
|
|
2426
2426
|
SchemaDefinition: {
|
|
2427
|
-
leave: ({ description: e, directives: t, operationTypes: n }) =>
|
|
2428
|
-
`) +
|
|
2427
|
+
leave: ({ description: e, directives: t, operationTypes: n }) => T("", e, `
|
|
2428
|
+
`) + d(["schema", d(t, " "), R(n)], " ")
|
|
2429
2429
|
},
|
|
2430
2430
|
OperationTypeDefinition: {
|
|
2431
2431
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
2432
2432
|
},
|
|
2433
2433
|
ScalarTypeDefinition: {
|
|
2434
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2435
|
-
`) +
|
|
2434
|
+
leave: ({ description: e, name: t, directives: n }) => T("", e, `
|
|
2435
|
+
`) + d(["scalar", t, d(n, " ")], " ")
|
|
2436
2436
|
},
|
|
2437
2437
|
ObjectTypeDefinition: {
|
|
2438
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2439
|
-
`) +
|
|
2438
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => T("", e, `
|
|
2439
|
+
`) + d(
|
|
2440
2440
|
[
|
|
2441
2441
|
"type",
|
|
2442
2442
|
t,
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
R(
|
|
2443
|
+
T("implements ", d(n, " & ")),
|
|
2444
|
+
d(i, " "),
|
|
2445
|
+
R(r)
|
|
2446
2446
|
],
|
|
2447
2447
|
" "
|
|
2448
2448
|
)
|
|
2449
2449
|
},
|
|
2450
2450
|
FieldDefinition: {
|
|
2451
|
-
leave: ({ description: e, name: t, arguments: n, type:
|
|
2452
|
-
`) + t + (Ie(n) ?
|
|
2453
|
-
`, K(
|
|
2451
|
+
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => T("", e, `
|
|
2452
|
+
`) + t + (Ie(n) ? T(`(
|
|
2453
|
+
`, K(d(n, `
|
|
2454
2454
|
`)), `
|
|
2455
|
-
)`) :
|
|
2455
|
+
)`) : T("(", d(n, ", "), ")")) + ": " + i + T(" ", d(r, " "))
|
|
2456
2456
|
},
|
|
2457
2457
|
InputValueDefinition: {
|
|
2458
|
-
leave: ({ description: e, name: t, type: n, defaultValue:
|
|
2459
|
-
`) +
|
|
2460
|
-
[t + ": " + n,
|
|
2458
|
+
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => T("", e, `
|
|
2459
|
+
`) + d(
|
|
2460
|
+
[t + ": " + n, T("= ", i), d(r, " ")],
|
|
2461
2461
|
" "
|
|
2462
2462
|
)
|
|
2463
2463
|
},
|
|
2464
2464
|
InterfaceTypeDefinition: {
|
|
2465
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2466
|
-
`) +
|
|
2465
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => T("", e, `
|
|
2466
|
+
`) + d(
|
|
2467
2467
|
[
|
|
2468
2468
|
"interface",
|
|
2469
2469
|
t,
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
R(
|
|
2470
|
+
T("implements ", d(n, " & ")),
|
|
2471
|
+
d(i, " "),
|
|
2472
|
+
R(r)
|
|
2473
2473
|
],
|
|
2474
2474
|
" "
|
|
2475
2475
|
)
|
|
2476
2476
|
},
|
|
2477
2477
|
UnionTypeDefinition: {
|
|
2478
|
-
leave: ({ description: e, name: t, directives: n, types:
|
|
2479
|
-
`) +
|
|
2480
|
-
["union", t,
|
|
2478
|
+
leave: ({ description: e, name: t, directives: n, types: i }) => T("", e, `
|
|
2479
|
+
`) + d(
|
|
2480
|
+
["union", t, d(n, " "), T("= ", d(i, " | "))],
|
|
2481
2481
|
" "
|
|
2482
2482
|
)
|
|
2483
2483
|
},
|
|
2484
2484
|
EnumTypeDefinition: {
|
|
2485
|
-
leave: ({ description: e, name: t, directives: n, values:
|
|
2486
|
-
`) +
|
|
2485
|
+
leave: ({ description: e, name: t, directives: n, values: i }) => T("", e, `
|
|
2486
|
+
`) + d(["enum", t, d(n, " "), R(i)], " ")
|
|
2487
2487
|
},
|
|
2488
2488
|
EnumValueDefinition: {
|
|
2489
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2490
|
-
`) +
|
|
2489
|
+
leave: ({ description: e, name: t, directives: n }) => T("", e, `
|
|
2490
|
+
`) + d([t, d(n, " ")], " ")
|
|
2491
2491
|
},
|
|
2492
2492
|
InputObjectTypeDefinition: {
|
|
2493
|
-
leave: ({ description: e, name: t, directives: n, fields:
|
|
2494
|
-
`) +
|
|
2493
|
+
leave: ({ description: e, name: t, directives: n, fields: i }) => T("", e, `
|
|
2494
|
+
`) + d(["input", t, d(n, " "), R(i)], " ")
|
|
2495
2495
|
},
|
|
2496
2496
|
DirectiveDefinition: {
|
|
2497
|
-
leave: ({ description: e, name: t, arguments: n, repeatable:
|
|
2498
|
-
`) + "directive @" + t + (Ie(n) ?
|
|
2499
|
-
`, K(
|
|
2497
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => T("", e, `
|
|
2498
|
+
`) + "directive @" + t + (Ie(n) ? T(`(
|
|
2499
|
+
`, K(d(n, `
|
|
2500
2500
|
`)), `
|
|
2501
|
-
)`) :
|
|
2501
|
+
)`) : T("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
|
|
2502
2502
|
},
|
|
2503
2503
|
SchemaExtension: {
|
|
2504
|
-
leave: ({ directives: e, operationTypes: t }) =>
|
|
2505
|
-
["extend schema",
|
|
2504
|
+
leave: ({ directives: e, operationTypes: t }) => d(
|
|
2505
|
+
["extend schema", d(e, " "), R(t)],
|
|
2506
2506
|
" "
|
|
2507
2507
|
)
|
|
2508
2508
|
},
|
|
2509
2509
|
ScalarTypeExtension: {
|
|
2510
|
-
leave: ({ name: e, directives: t }) =>
|
|
2510
|
+
leave: ({ name: e, directives: t }) => d(["extend scalar", e, d(t, " ")], " ")
|
|
2511
2511
|
},
|
|
2512
2512
|
ObjectTypeExtension: {
|
|
2513
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
2513
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: i }) => d(
|
|
2514
2514
|
[
|
|
2515
2515
|
"extend type",
|
|
2516
2516
|
e,
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
R(
|
|
2517
|
+
T("implements ", d(t, " & ")),
|
|
2518
|
+
d(n, " "),
|
|
2519
|
+
R(i)
|
|
2520
2520
|
],
|
|
2521
2521
|
" "
|
|
2522
2522
|
)
|
|
2523
2523
|
},
|
|
2524
2524
|
InterfaceTypeExtension: {
|
|
2525
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
2525
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: i }) => d(
|
|
2526
2526
|
[
|
|
2527
2527
|
"extend interface",
|
|
2528
2528
|
e,
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
R(
|
|
2529
|
+
T("implements ", d(t, " & ")),
|
|
2530
|
+
d(n, " "),
|
|
2531
|
+
R(i)
|
|
2532
2532
|
],
|
|
2533
2533
|
" "
|
|
2534
2534
|
)
|
|
2535
2535
|
},
|
|
2536
2536
|
UnionTypeExtension: {
|
|
2537
|
-
leave: ({ name: e, directives: t, types: n }) =>
|
|
2537
|
+
leave: ({ name: e, directives: t, types: n }) => d(
|
|
2538
2538
|
[
|
|
2539
2539
|
"extend union",
|
|
2540
2540
|
e,
|
|
2541
|
-
|
|
2542
|
-
|
|
2541
|
+
d(t, " "),
|
|
2542
|
+
T("= ", d(n, " | "))
|
|
2543
2543
|
],
|
|
2544
2544
|
" "
|
|
2545
2545
|
)
|
|
2546
2546
|
},
|
|
2547
2547
|
EnumTypeExtension: {
|
|
2548
|
-
leave: ({ name: e, directives: t, values: n }) =>
|
|
2548
|
+
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), R(n)], " ")
|
|
2549
2549
|
},
|
|
2550
2550
|
InputObjectTypeExtension: {
|
|
2551
|
-
leave: ({ name: e, directives: t, fields: n }) =>
|
|
2551
|
+
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), R(n)], " ")
|
|
2552
2552
|
}
|
|
2553
2553
|
};
|
|
2554
|
-
function
|
|
2554
|
+
function d(e, t = "") {
|
|
2555
2555
|
var n;
|
|
2556
|
-
return (n = e == null ? void 0 : e.filter((
|
|
2556
|
+
return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
|
|
2557
2557
|
}
|
|
2558
2558
|
function R(e) {
|
|
2559
|
-
return
|
|
2560
|
-
`, K(
|
|
2559
|
+
return T(`{
|
|
2560
|
+
`, K(d(e, `
|
|
2561
2561
|
`)), `
|
|
2562
2562
|
}`);
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function T(e, t, n = "") {
|
|
2565
2565
|
return t != null && t !== "" ? e + t + n : "";
|
|
2566
2566
|
}
|
|
2567
2567
|
function K(e) {
|
|
2568
|
-
return
|
|
2568
|
+
return T(" ", e.replace(/\n/g, `
|
|
2569
2569
|
`));
|
|
2570
2570
|
}
|
|
2571
2571
|
function Ie(e) {
|
|
@@ -2574,16 +2574,16 @@ function Ie(e) {
|
|
|
2574
2574
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2575
2575
|
}
|
|
2576
2576
|
const Oe = (e) => {
|
|
2577
|
-
var
|
|
2577
|
+
var i, r;
|
|
2578
2578
|
let t;
|
|
2579
2579
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
2580
|
-
return n.length === 1 && (t = (
|
|
2580
|
+
return n.length === 1 && (t = (r = (i = n[0]) == null ? void 0 : i.name) == null ? void 0 : r.value), t;
|
|
2581
2581
|
}, le = (e) => {
|
|
2582
2582
|
if (typeof e == "string") {
|
|
2583
2583
|
let n;
|
|
2584
2584
|
try {
|
|
2585
|
-
const
|
|
2586
|
-
n = Oe(
|
|
2585
|
+
const i = Me(e);
|
|
2586
|
+
n = Oe(i);
|
|
2587
2587
|
} catch {
|
|
2588
2588
|
}
|
|
2589
2589
|
return { query: e, operationName: n };
|
|
@@ -2593,15 +2593,15 @@ const Oe = (e) => {
|
|
|
2593
2593
|
};
|
|
2594
2594
|
class H extends Error {
|
|
2595
2595
|
constructor(t, n) {
|
|
2596
|
-
const
|
|
2596
|
+
const i = `${H.extractMessage(t)}: ${JSON.stringify({
|
|
2597
2597
|
response: t,
|
|
2598
2598
|
request: n
|
|
2599
2599
|
})}`;
|
|
2600
|
-
super(
|
|
2600
|
+
super(i), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
|
|
2601
2601
|
}
|
|
2602
2602
|
static extractMessage(t) {
|
|
2603
|
-
var n,
|
|
2604
|
-
return ((
|
|
2603
|
+
var n, i;
|
|
2604
|
+
return ((i = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : i.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
2607
|
var qt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -2610,14 +2610,14 @@ function Vt(e) {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
var ye = { exports: {} };
|
|
2612
2612
|
(function(e, t) {
|
|
2613
|
-
var n = typeof self < "u" ? self : qt,
|
|
2613
|
+
var n = typeof self < "u" ? self : qt, i = function() {
|
|
2614
2614
|
function s() {
|
|
2615
2615
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
2616
2616
|
}
|
|
2617
2617
|
return s.prototype = n, new s();
|
|
2618
2618
|
}();
|
|
2619
2619
|
(function(s) {
|
|
2620
|
-
(function(
|
|
2620
|
+
(function(o) {
|
|
2621
2621
|
var u = {
|
|
2622
2622
|
searchParams: "URLSearchParams" in s,
|
|
2623
2623
|
iterable: "Symbol" in s && "iterator" in Symbol,
|
|
@@ -2631,11 +2631,11 @@ var ye = { exports: {} };
|
|
|
2631
2631
|
formData: "FormData" in s,
|
|
2632
2632
|
arrayBuffer: "ArrayBuffer" in s
|
|
2633
2633
|
};
|
|
2634
|
-
function
|
|
2635
|
-
return
|
|
2634
|
+
function h(a) {
|
|
2635
|
+
return a && DataView.prototype.isPrototypeOf(a);
|
|
2636
2636
|
}
|
|
2637
2637
|
if (u.arrayBuffer)
|
|
2638
|
-
var
|
|
2638
|
+
var p = [
|
|
2639
2639
|
"[object Int8Array]",
|
|
2640
2640
|
"[object Uint8Array]",
|
|
2641
2641
|
"[object Uint8ClampedArray]",
|
|
@@ -2645,108 +2645,108 @@ var ye = { exports: {} };
|
|
|
2645
2645
|
"[object Uint32Array]",
|
|
2646
2646
|
"[object Float32Array]",
|
|
2647
2647
|
"[object Float64Array]"
|
|
2648
|
-
], m = ArrayBuffer.isView || function(
|
|
2649
|
-
return
|
|
2648
|
+
], m = ArrayBuffer.isView || function(a) {
|
|
2649
|
+
return a && p.indexOf(Object.prototype.toString.call(a)) > -1;
|
|
2650
2650
|
};
|
|
2651
|
-
function E(
|
|
2652
|
-
if (typeof
|
|
2651
|
+
function E(a) {
|
|
2652
|
+
if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
|
|
2653
2653
|
throw new TypeError("Invalid character in header field name");
|
|
2654
|
-
return
|
|
2654
|
+
return a.toLowerCase();
|
|
2655
2655
|
}
|
|
2656
|
-
function g(
|
|
2657
|
-
return typeof
|
|
2656
|
+
function g(a) {
|
|
2657
|
+
return typeof a != "string" && (a = String(a)), a;
|
|
2658
2658
|
}
|
|
2659
|
-
function A(
|
|
2659
|
+
function A(a) {
|
|
2660
2660
|
var l = {
|
|
2661
2661
|
next: function() {
|
|
2662
|
-
var
|
|
2663
|
-
return { done:
|
|
2662
|
+
var v = a.shift();
|
|
2663
|
+
return { done: v === void 0, value: v };
|
|
2664
2664
|
}
|
|
2665
2665
|
};
|
|
2666
2666
|
return u.iterable && (l[Symbol.iterator] = function() {
|
|
2667
2667
|
return l;
|
|
2668
2668
|
}), l;
|
|
2669
2669
|
}
|
|
2670
|
-
function y(
|
|
2671
|
-
this.map = {},
|
|
2672
|
-
this.append(
|
|
2673
|
-
}, this) : Array.isArray(
|
|
2670
|
+
function y(a) {
|
|
2671
|
+
this.map = {}, a instanceof y ? a.forEach(function(l, v) {
|
|
2672
|
+
this.append(v, l);
|
|
2673
|
+
}, this) : Array.isArray(a) ? a.forEach(function(l) {
|
|
2674
2674
|
this.append(l[0], l[1]);
|
|
2675
|
-
}, this) :
|
|
2676
|
-
this.append(l,
|
|
2675
|
+
}, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
|
|
2676
|
+
this.append(l, a[l]);
|
|
2677
2677
|
}, this);
|
|
2678
2678
|
}
|
|
2679
|
-
y.prototype.append = function(
|
|
2680
|
-
|
|
2681
|
-
var
|
|
2682
|
-
this.map[
|
|
2683
|
-
}, y.prototype.delete = function(
|
|
2684
|
-
delete this.map[E(
|
|
2685
|
-
}, y.prototype.get = function(
|
|
2686
|
-
return
|
|
2687
|
-
}, y.prototype.has = function(
|
|
2688
|
-
return this.map.hasOwnProperty(E(
|
|
2689
|
-
}, y.prototype.set = function(
|
|
2690
|
-
this.map[E(
|
|
2691
|
-
}, y.prototype.forEach = function(
|
|
2692
|
-
for (var
|
|
2693
|
-
this.map.hasOwnProperty(
|
|
2679
|
+
y.prototype.append = function(a, l) {
|
|
2680
|
+
a = E(a), l = g(l);
|
|
2681
|
+
var v = this.map[a];
|
|
2682
|
+
this.map[a] = v ? v + ", " + l : l;
|
|
2683
|
+
}, y.prototype.delete = function(a) {
|
|
2684
|
+
delete this.map[E(a)];
|
|
2685
|
+
}, y.prototype.get = function(a) {
|
|
2686
|
+
return a = E(a), this.has(a) ? this.map[a] : null;
|
|
2687
|
+
}, y.prototype.has = function(a) {
|
|
2688
|
+
return this.map.hasOwnProperty(E(a));
|
|
2689
|
+
}, y.prototype.set = function(a, l) {
|
|
2690
|
+
this.map[E(a)] = g(l);
|
|
2691
|
+
}, y.prototype.forEach = function(a, l) {
|
|
2692
|
+
for (var v in this.map)
|
|
2693
|
+
this.map.hasOwnProperty(v) && a.call(l, this.map[v], v, this);
|
|
2694
2694
|
}, y.prototype.keys = function() {
|
|
2695
|
-
var
|
|
2696
|
-
return this.forEach(function(l,
|
|
2697
|
-
|
|
2698
|
-
}), A(
|
|
2695
|
+
var a = [];
|
|
2696
|
+
return this.forEach(function(l, v) {
|
|
2697
|
+
a.push(v);
|
|
2698
|
+
}), A(a);
|
|
2699
2699
|
}, y.prototype.values = function() {
|
|
2700
|
-
var
|
|
2700
|
+
var a = [];
|
|
2701
2701
|
return this.forEach(function(l) {
|
|
2702
|
-
|
|
2703
|
-
}), A(
|
|
2702
|
+
a.push(l);
|
|
2703
|
+
}), A(a);
|
|
2704
2704
|
}, y.prototype.entries = function() {
|
|
2705
|
-
var
|
|
2706
|
-
return this.forEach(function(l,
|
|
2707
|
-
|
|
2708
|
-
}), A(
|
|
2705
|
+
var a = [];
|
|
2706
|
+
return this.forEach(function(l, v) {
|
|
2707
|
+
a.push([v, l]);
|
|
2708
|
+
}), A(a);
|
|
2709
2709
|
}, u.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
|
|
2710
|
-
function N(
|
|
2711
|
-
if (
|
|
2710
|
+
function N(a) {
|
|
2711
|
+
if (a.bodyUsed)
|
|
2712
2712
|
return Promise.reject(new TypeError("Already read"));
|
|
2713
|
-
|
|
2713
|
+
a.bodyUsed = !0;
|
|
2714
2714
|
}
|
|
2715
|
-
function D(
|
|
2716
|
-
return new Promise(function(l,
|
|
2717
|
-
|
|
2718
|
-
l(
|
|
2719
|
-
},
|
|
2720
|
-
|
|
2715
|
+
function D(a) {
|
|
2716
|
+
return new Promise(function(l, v) {
|
|
2717
|
+
a.onload = function() {
|
|
2718
|
+
l(a.result);
|
|
2719
|
+
}, a.onerror = function() {
|
|
2720
|
+
v(a.error);
|
|
2721
2721
|
};
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
|
-
function _(
|
|
2725
|
-
var l = new FileReader(),
|
|
2726
|
-
return l.readAsArrayBuffer(
|
|
2724
|
+
function _(a) {
|
|
2725
|
+
var l = new FileReader(), v = D(l);
|
|
2726
|
+
return l.readAsArrayBuffer(a), v;
|
|
2727
2727
|
}
|
|
2728
|
-
function z(
|
|
2729
|
-
var l = new FileReader(),
|
|
2730
|
-
return l.readAsText(
|
|
2728
|
+
function z(a) {
|
|
2729
|
+
var l = new FileReader(), v = D(l);
|
|
2730
|
+
return l.readAsText(a), v;
|
|
2731
2731
|
}
|
|
2732
|
-
function S(
|
|
2733
|
-
for (var l = new Uint8Array(
|
|
2734
|
-
|
|
2735
|
-
return
|
|
2732
|
+
function S(a) {
|
|
2733
|
+
for (var l = new Uint8Array(a), v = new Array(l.length), O = 0; O < l.length; O++)
|
|
2734
|
+
v[O] = String.fromCharCode(l[O]);
|
|
2735
|
+
return v.join("");
|
|
2736
2736
|
}
|
|
2737
|
-
function k(
|
|
2738
|
-
if (
|
|
2739
|
-
return
|
|
2740
|
-
var l = new Uint8Array(
|
|
2741
|
-
return l.set(new Uint8Array(
|
|
2737
|
+
function k(a) {
|
|
2738
|
+
if (a.slice)
|
|
2739
|
+
return a.slice(0);
|
|
2740
|
+
var l = new Uint8Array(a.byteLength);
|
|
2741
|
+
return l.set(new Uint8Array(a)), l.buffer;
|
|
2742
2742
|
}
|
|
2743
2743
|
function B() {
|
|
2744
|
-
return this.bodyUsed = !1, this._initBody = function(
|
|
2745
|
-
this._bodyInit =
|
|
2744
|
+
return this.bodyUsed = !1, this._initBody = function(a) {
|
|
2745
|
+
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : u.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : u.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : u.arrayBuffer && u.blob && h(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
2746
2746
|
}, u.blob && (this.blob = function() {
|
|
2747
|
-
var
|
|
2748
|
-
if (
|
|
2749
|
-
return
|
|
2747
|
+
var a = N(this);
|
|
2748
|
+
if (a)
|
|
2749
|
+
return a;
|
|
2750
2750
|
if (this._bodyBlob)
|
|
2751
2751
|
return Promise.resolve(this._bodyBlob);
|
|
2752
2752
|
if (this._bodyArrayBuffer)
|
|
@@ -2757,9 +2757,9 @@ var ye = { exports: {} };
|
|
|
2757
2757
|
}, this.arrayBuffer = function() {
|
|
2758
2758
|
return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(_);
|
|
2759
2759
|
}), this.text = function() {
|
|
2760
|
-
var
|
|
2761
|
-
if (
|
|
2762
|
-
return
|
|
2760
|
+
var a = N(this);
|
|
2761
|
+
if (a)
|
|
2762
|
+
return a;
|
|
2763
2763
|
if (this._bodyBlob)
|
|
2764
2764
|
return z(this._bodyBlob);
|
|
2765
2765
|
if (this._bodyArrayBuffer)
|
|
@@ -2774,38 +2774,38 @@ var ye = { exports: {} };
|
|
|
2774
2774
|
}, this;
|
|
2775
2775
|
}
|
|
2776
2776
|
var Q = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
2777
|
-
function J(
|
|
2778
|
-
var l =
|
|
2779
|
-
return Q.indexOf(l) > -1 ? l :
|
|
2777
|
+
function J(a) {
|
|
2778
|
+
var l = a.toUpperCase();
|
|
2779
|
+
return Q.indexOf(l) > -1 ? l : a;
|
|
2780
2780
|
}
|
|
2781
|
-
function L(
|
|
2781
|
+
function L(a, l) {
|
|
2782
2782
|
l = l || {};
|
|
2783
|
-
var
|
|
2784
|
-
if (
|
|
2785
|
-
if (
|
|
2783
|
+
var v = l.body;
|
|
2784
|
+
if (a instanceof L) {
|
|
2785
|
+
if (a.bodyUsed)
|
|
2786
2786
|
throw new TypeError("Already read");
|
|
2787
|
-
this.url =
|
|
2787
|
+
this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new y(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !v && a._bodyInit != null && (v = a._bodyInit, a.bodyUsed = !0);
|
|
2788
2788
|
} else
|
|
2789
|
-
this.url = String(
|
|
2790
|
-
if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new y(l.headers)), this.method = J(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") &&
|
|
2789
|
+
this.url = String(a);
|
|
2790
|
+
if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new y(l.headers)), this.method = J(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && v)
|
|
2791
2791
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
2792
|
-
this._initBody(
|
|
2792
|
+
this._initBody(v);
|
|
2793
2793
|
}
|
|
2794
2794
|
L.prototype.clone = function() {
|
|
2795
2795
|
return new L(this, { body: this._bodyInit });
|
|
2796
2796
|
};
|
|
2797
|
-
function je(
|
|
2797
|
+
function je(a) {
|
|
2798
2798
|
var l = new FormData();
|
|
2799
|
-
return
|
|
2800
|
-
if (
|
|
2801
|
-
var O =
|
|
2799
|
+
return a.trim().split("&").forEach(function(v) {
|
|
2800
|
+
if (v) {
|
|
2801
|
+
var O = v.split("="), I = O.shift().replace(/\+/g, " "), C = O.join("=").replace(/\+/g, " ");
|
|
2802
2802
|
l.append(decodeURIComponent(I), decodeURIComponent(C));
|
|
2803
2803
|
}
|
|
2804
2804
|
}), l;
|
|
2805
2805
|
}
|
|
2806
|
-
function $e(
|
|
2807
|
-
var l = new y(),
|
|
2808
|
-
return
|
|
2806
|
+
function $e(a) {
|
|
2807
|
+
var l = new y(), v = a.replace(/\r?\n[\t ]+/g, " ");
|
|
2808
|
+
return v.split(/\r?\n/).forEach(function(O) {
|
|
2809
2809
|
var I = O.split(":"), C = I.shift().trim();
|
|
2810
2810
|
if (C) {
|
|
2811
2811
|
var X = I.join(":").trim();
|
|
@@ -2814,8 +2814,8 @@ var ye = { exports: {} };
|
|
|
2814
2814
|
}), l;
|
|
2815
2815
|
}
|
|
2816
2816
|
B.call(L.prototype);
|
|
2817
|
-
function w(
|
|
2818
|
-
l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new y(l.headers), this.url = l.url || "", this._initBody(
|
|
2817
|
+
function w(a, l) {
|
|
2818
|
+
l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new y(l.headers), this.url = l.url || "", this._initBody(a);
|
|
2819
2819
|
}
|
|
2820
2820
|
B.call(w.prototype), w.prototype.clone = function() {
|
|
2821
2821
|
return new w(this._bodyInit, {
|
|
@@ -2825,29 +2825,29 @@ var ye = { exports: {} };
|
|
|
2825
2825
|
url: this.url
|
|
2826
2826
|
});
|
|
2827
2827
|
}, w.error = function() {
|
|
2828
|
-
var
|
|
2829
|
-
return
|
|
2828
|
+
var a = new w(null, { status: 0, statusText: "" });
|
|
2829
|
+
return a.type = "error", a;
|
|
2830
2830
|
};
|
|
2831
2831
|
var Ge = [301, 302, 303, 307, 308];
|
|
2832
|
-
w.redirect = function(
|
|
2832
|
+
w.redirect = function(a, l) {
|
|
2833
2833
|
if (Ge.indexOf(l) === -1)
|
|
2834
2834
|
throw new RangeError("Invalid status code");
|
|
2835
|
-
return new w(null, { status: l, headers: { location:
|
|
2836
|
-
},
|
|
2835
|
+
return new w(null, { status: l, headers: { location: a } });
|
|
2836
|
+
}, o.DOMException = s.DOMException;
|
|
2837
2837
|
try {
|
|
2838
|
-
new
|
|
2838
|
+
new o.DOMException();
|
|
2839
2839
|
} catch {
|
|
2840
|
-
|
|
2841
|
-
this.message = l, this.name =
|
|
2840
|
+
o.DOMException = function(l, v) {
|
|
2841
|
+
this.message = l, this.name = v;
|
|
2842
2842
|
var O = Error(l);
|
|
2843
2843
|
this.stack = O.stack;
|
|
2844
|
-
},
|
|
2844
|
+
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
2845
2845
|
}
|
|
2846
|
-
function ae(
|
|
2847
|
-
return new Promise(function(
|
|
2848
|
-
var I = new L(
|
|
2846
|
+
function ae(a, l) {
|
|
2847
|
+
return new Promise(function(v, O) {
|
|
2848
|
+
var I = new L(a, l);
|
|
2849
2849
|
if (I.signal && I.signal.aborted)
|
|
2850
|
-
return O(new
|
|
2850
|
+
return O(new o.DOMException("Aborted", "AbortError"));
|
|
2851
2851
|
var C = new XMLHttpRequest();
|
|
2852
2852
|
function X() {
|
|
2853
2853
|
C.abort();
|
|
@@ -2860,13 +2860,13 @@ var ye = { exports: {} };
|
|
|
2860
2860
|
};
|
|
2861
2861
|
j.url = "responseURL" in C ? C.responseURL : j.headers.get("X-Request-URL");
|
|
2862
2862
|
var ce = "response" in C ? C.response : C.responseText;
|
|
2863
|
-
|
|
2863
|
+
v(new w(ce, j));
|
|
2864
2864
|
}, C.onerror = function() {
|
|
2865
2865
|
O(new TypeError("Network request failed"));
|
|
2866
2866
|
}, C.ontimeout = function() {
|
|
2867
2867
|
O(new TypeError("Network request failed"));
|
|
2868
2868
|
}, C.onabort = function() {
|
|
2869
|
-
O(new
|
|
2869
|
+
O(new o.DOMException("Aborted", "AbortError"));
|
|
2870
2870
|
}, C.open(I.method, I.url, !0), I.credentials === "include" ? C.withCredentials = !0 : I.credentials === "omit" && (C.withCredentials = !1), "responseType" in C && u.blob && (C.responseType = "blob"), I.headers.forEach(function(j, ce) {
|
|
2871
2871
|
C.setRequestHeader(ce, j);
|
|
2872
2872
|
}), I.signal && (I.signal.addEventListener("abort", X), C.onreadystatechange = function() {
|
|
@@ -2874,11 +2874,11 @@ var ye = { exports: {} };
|
|
|
2874
2874
|
}), C.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
|
-
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request = L, s.Response = w),
|
|
2877
|
+
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request = L, s.Response = w), o.Headers = y, o.Request = L, o.Response = w, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
2878
2878
|
})({});
|
|
2879
|
-
})(
|
|
2880
|
-
var
|
|
2881
|
-
t =
|
|
2879
|
+
})(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
|
|
2880
|
+
var r = i;
|
|
2881
|
+
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;
|
|
2882
2882
|
})(ye, ye.exports);
|
|
2883
2883
|
var ne = ye.exports;
|
|
2884
2884
|
const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
@@ -2886,59 +2886,59 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2886
2886
|
default: ee
|
|
2887
2887
|
}, [ne]), M = (e) => {
|
|
2888
2888
|
let t = {};
|
|
2889
|
-
return e && (typeof Headers < "u" && e instanceof Headers || jt && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n,
|
|
2890
|
-
n &&
|
|
2889
|
+
return e && (typeof Headers < "u" && e instanceof Headers || jt && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
|
|
2890
|
+
n && i !== void 0 && (t[n] = i);
|
|
2891
2891
|
}) : t = e), t;
|
|
2892
2892
|
}, De = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), $t = (e) => {
|
|
2893
2893
|
if (!Array.isArray(e.query)) {
|
|
2894
|
-
const
|
|
2895
|
-
return e.variables &&
|
|
2894
|
+
const i = e, r = [`query=${encodeURIComponent(De(i.query))}`];
|
|
2895
|
+
return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
|
|
2896
2896
|
}
|
|
2897
2897
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
2898
2898
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
2899
|
-
const t = e, n = e.query.reduce((
|
|
2900
|
-
query: De(
|
|
2899
|
+
const t = e, n = e.query.reduce((i, r, s) => (i.push({
|
|
2900
|
+
query: De(r),
|
|
2901
2901
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
2902
|
-
}),
|
|
2902
|
+
}), i), []);
|
|
2903
2903
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
2904
2904
|
}, Gt = (e) => async (t) => {
|
|
2905
|
-
const { url: n, query:
|
|
2905
|
+
const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: u, middleware: h } = t, p = { ...t.headers };
|
|
2906
2906
|
let m = "", E;
|
|
2907
|
-
e === "POST" ? (E = Yt(
|
|
2908
|
-
query:
|
|
2909
|
-
variables:
|
|
2907
|
+
e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m = $t({
|
|
2908
|
+
query: i,
|
|
2909
|
+
variables: r,
|
|
2910
2910
|
operationName: s,
|
|
2911
2911
|
jsonSerializer: u.jsonSerializer ?? ge
|
|
2912
2912
|
});
|
|
2913
2913
|
const g = {
|
|
2914
2914
|
method: e,
|
|
2915
|
-
headers:
|
|
2915
|
+
headers: p,
|
|
2916
2916
|
body: E,
|
|
2917
2917
|
...u
|
|
2918
2918
|
};
|
|
2919
2919
|
let A = n, y = g;
|
|
2920
|
-
if (
|
|
2921
|
-
const N = await Promise.resolve(
|
|
2920
|
+
if (h) {
|
|
2921
|
+
const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url: D, ..._ } = N;
|
|
2922
2922
|
A = D, y = _;
|
|
2923
2923
|
}
|
|
2924
|
-
return m && (A = `${A}?${m}`), await
|
|
2924
|
+
return m && (A = `${A}?${m}`), await o(A, y);
|
|
2925
2925
|
};
|
|
2926
2926
|
class Ht {
|
|
2927
2927
|
constructor(t, n = {}) {
|
|
2928
|
-
this.url = t, this.requestConfig = n, this.rawRequest = async (...
|
|
2929
|
-
const [
|
|
2928
|
+
this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
|
|
2929
|
+
const [r, s, o] = i, u = We(r, s, o), { headers: h, fetch: p = ee, method: m = "POST", requestMiddleware: E, responseMiddleware: g, ...A } = this.requestConfig, { url: y } = this;
|
|
2930
2930
|
u.signal !== void 0 && (A.signal = u.signal);
|
|
2931
2931
|
const { operationName: N } = le(u.query);
|
|
2932
|
-
return
|
|
2932
|
+
return de({
|
|
2933
2933
|
url: y,
|
|
2934
2934
|
query: u.query,
|
|
2935
2935
|
variables: u.variables,
|
|
2936
2936
|
headers: {
|
|
2937
|
-
...M(
|
|
2937
|
+
...M(he(h)),
|
|
2938
2938
|
...M(u.requestHeaders)
|
|
2939
2939
|
},
|
|
2940
2940
|
operationName: N,
|
|
2941
|
-
fetch:
|
|
2941
|
+
fetch: p,
|
|
2942
2942
|
method: m,
|
|
2943
2943
|
fetchOptions: A,
|
|
2944
2944
|
middleware: E
|
|
@@ -2948,47 +2948,47 @@ class Ht {
|
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
2950
2950
|
async request(t, ...n) {
|
|
2951
|
-
const [
|
|
2951
|
+
const [i, r] = n, s = Xe(t, i, r), { headers: o, fetch: u = ee, method: h = "POST", requestMiddleware: p, responseMiddleware: m, ...E } = this.requestConfig, { url: g } = this;
|
|
2952
2952
|
s.signal !== void 0 && (E.signal = s.signal);
|
|
2953
2953
|
const { query: A, operationName: y } = le(s.document);
|
|
2954
|
-
return
|
|
2954
|
+
return de({
|
|
2955
2955
|
url: g,
|
|
2956
2956
|
query: A,
|
|
2957
2957
|
variables: s.variables,
|
|
2958
2958
|
headers: {
|
|
2959
|
-
...M(
|
|
2959
|
+
...M(he(o)),
|
|
2960
2960
|
...M(s.requestHeaders)
|
|
2961
2961
|
},
|
|
2962
2962
|
operationName: y,
|
|
2963
2963
|
fetch: u,
|
|
2964
|
-
method:
|
|
2964
|
+
method: h,
|
|
2965
2965
|
fetchOptions: E,
|
|
2966
|
-
middleware:
|
|
2966
|
+
middleware: p
|
|
2967
2967
|
}).then((N) => (m && m(N), N.data)).catch((N) => {
|
|
2968
2968
|
throw m && m(N), N;
|
|
2969
2969
|
});
|
|
2970
2970
|
}
|
|
2971
2971
|
// prettier-ignore
|
|
2972
2972
|
batchRequests(t, n) {
|
|
2973
|
-
const
|
|
2974
|
-
|
|
2975
|
-
const
|
|
2976
|
-
return
|
|
2973
|
+
const i = Ze(t, n), { headers: r, ...s } = this.requestConfig;
|
|
2974
|
+
i.signal !== void 0 && (s.signal = i.signal);
|
|
2975
|
+
const o = i.documents.map(({ document: h }) => le(h).query), u = i.documents.map(({ variables: h }) => h);
|
|
2976
|
+
return de({
|
|
2977
2977
|
url: this.url,
|
|
2978
|
-
query:
|
|
2978
|
+
query: o,
|
|
2979
2979
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
2980
2980
|
variables: u,
|
|
2981
2981
|
headers: {
|
|
2982
|
-
...M(
|
|
2983
|
-
...M(
|
|
2982
|
+
...M(he(r)),
|
|
2983
|
+
...M(i.requestHeaders)
|
|
2984
2984
|
},
|
|
2985
2985
|
operationName: void 0,
|
|
2986
2986
|
fetch: this.requestConfig.fetch ?? ee,
|
|
2987
2987
|
method: this.requestConfig.method || "POST",
|
|
2988
2988
|
fetchOptions: s,
|
|
2989
2989
|
middleware: this.requestConfig.requestMiddleware
|
|
2990
|
-
}).then((
|
|
2991
|
-
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(
|
|
2990
|
+
}).then((h) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h.data)).catch((h) => {
|
|
2991
|
+
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h;
|
|
2992
2992
|
});
|
|
2993
2993
|
}
|
|
2994
2994
|
setHeaders(t) {
|
|
@@ -2998,8 +2998,8 @@ class Ht {
|
|
|
2998
2998
|
* Attach a header to the client. All subsequent requests will have this header.
|
|
2999
2999
|
*/
|
|
3000
3000
|
setHeader(t, n) {
|
|
3001
|
-
const { headers:
|
|
3002
|
-
return
|
|
3001
|
+
const { headers: i } = this.requestConfig;
|
|
3002
|
+
return i ? i[t] = n : this.requestConfig.headers = { [t]: n }, this;
|
|
3003
3003
|
}
|
|
3004
3004
|
/**
|
|
3005
3005
|
* Change the client endpoint. All subsequent requests will send to this endpoint.
|
|
@@ -3008,14 +3008,14 @@ class Ht {
|
|
|
3008
3008
|
return this.url = t, this;
|
|
3009
3009
|
}
|
|
3010
3010
|
}
|
|
3011
|
-
const
|
|
3012
|
-
const { query: t, variables: n, fetchOptions:
|
|
3013
|
-
if (
|
|
3014
|
-
const { errors: m, ...E } = (Array.isArray(u), u), g =
|
|
3011
|
+
const de = async (e) => {
|
|
3012
|
+
const { query: t, variables: n, fetchOptions: i } = e, r = Gt(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
|
|
3013
|
+
if (o.ok && p && h) {
|
|
3014
|
+
const { errors: m, ...E } = (Array.isArray(u), u), g = i.errorPolicy === "ignore" ? E : u;
|
|
3015
3015
|
return {
|
|
3016
3016
|
...s ? { data: g } : g,
|
|
3017
|
-
headers:
|
|
3018
|
-
status:
|
|
3017
|
+
headers: o.headers,
|
|
3018
|
+
status: o.status
|
|
3019
3019
|
};
|
|
3020
3020
|
} else {
|
|
3021
3021
|
const m = typeof u == "string" ? {
|
|
@@ -3023,35 +3023,35 @@ const he = async (e) => {
|
|
|
3023
3023
|
} : u;
|
|
3024
3024
|
throw new H(
|
|
3025
3025
|
// @ts-expect-error TODO
|
|
3026
|
-
{ ...m, status:
|
|
3026
|
+
{ ...m, status: o.status, headers: o.headers },
|
|
3027
3027
|
{ query: t, variables: n }
|
|
3028
3028
|
);
|
|
3029
3029
|
}
|
|
3030
|
-
}, Yt = (e, t, n,
|
|
3031
|
-
const
|
|
3030
|
+
}, Yt = (e, t, n, i) => {
|
|
3031
|
+
const r = i ?? ge;
|
|
3032
3032
|
if (!Array.isArray(e))
|
|
3033
|
-
return
|
|
3033
|
+
return r.stringify({ query: e, variables: t, operationName: n });
|
|
3034
3034
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3035
3035
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3036
|
-
const s = e.reduce((
|
|
3037
|
-
return
|
|
3036
|
+
const s = e.reduce((o, u, h) => (o.push({ query: u, variables: t ? t[h] : void 0 }), o), []);
|
|
3037
|
+
return r.stringify(s);
|
|
3038
3038
|
}, zt = async (e, t) => {
|
|
3039
3039
|
let n;
|
|
3040
|
-
return e.headers.forEach((
|
|
3041
|
-
|
|
3040
|
+
return e.headers.forEach((i, r) => {
|
|
3041
|
+
r.toLowerCase() === "content-type" && (n = i);
|
|
3042
3042
|
}), 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();
|
|
3043
|
-
},
|
|
3044
|
-
var
|
|
3045
|
-
return
|
|
3046
|
-
for (var n,
|
|
3047
|
-
n = arguments[
|
|
3043
|
+
}, he = (e) => typeof e == "function" ? e() : e;
|
|
3044
|
+
var re = function() {
|
|
3045
|
+
return re = Object.assign || function(t) {
|
|
3046
|
+
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
|
3047
|
+
n = arguments[i];
|
|
3048
3048
|
for (var s in n)
|
|
3049
3049
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
3050
3050
|
}
|
|
3051
3051
|
return t;
|
|
3052
|
-
},
|
|
3052
|
+
}, re.apply(this, arguments);
|
|
3053
3053
|
};
|
|
3054
|
-
var te = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map(), qe = !0,
|
|
3054
|
+
var te = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map(), qe = !0, ie = !1;
|
|
3055
3055
|
function Ve(e) {
|
|
3056
3056
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
3057
3057
|
}
|
|
@@ -3060,21 +3060,21 @@ function Qt(e) {
|
|
|
3060
3060
|
}
|
|
3061
3061
|
function Jt(e) {
|
|
3062
3062
|
var t = /* @__PURE__ */ new Set(), n = [];
|
|
3063
|
-
return e.definitions.forEach(function(
|
|
3064
|
-
if (
|
|
3065
|
-
var
|
|
3066
|
-
|
|
3063
|
+
return e.definitions.forEach(function(i) {
|
|
3064
|
+
if (i.kind === "FragmentDefinition") {
|
|
3065
|
+
var r = i.name.value, s = Qt(i.loc), o = Ee.get(r);
|
|
3066
|
+
o && !o.has(s) ? qe && console.warn("Warning: fragment with name " + r + ` already exists.
|
|
3067
3067
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
3068
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) :
|
|
3068
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || Ee.set(r, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(i));
|
|
3069
3069
|
} else
|
|
3070
|
-
n.push(
|
|
3071
|
-
}),
|
|
3070
|
+
n.push(i);
|
|
3071
|
+
}), re(re({}, e), { definitions: n });
|
|
3072
3072
|
}
|
|
3073
3073
|
function Xt(e) {
|
|
3074
3074
|
var t = new Set(e.definitions);
|
|
3075
|
-
t.forEach(function(
|
|
3076
|
-
|
|
3077
|
-
var s = r
|
|
3075
|
+
t.forEach(function(i) {
|
|
3076
|
+
i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
|
|
3077
|
+
var s = i[r];
|
|
3078
3078
|
s && typeof s == "object" && t.add(s);
|
|
3079
3079
|
});
|
|
3080
3080
|
});
|
|
@@ -3085,8 +3085,8 @@ function Wt(e) {
|
|
|
3085
3085
|
var t = Ve(e);
|
|
3086
3086
|
if (!te.has(t)) {
|
|
3087
3087
|
var n = Me(e, {
|
|
3088
|
-
experimentalFragmentVariables:
|
|
3089
|
-
allowLegacyFragmentVariables:
|
|
3088
|
+
experimentalFragmentVariables: ie,
|
|
3089
|
+
allowLegacyFragmentVariables: ie
|
|
3090
3090
|
});
|
|
3091
3091
|
if (!n || n.kind !== "Document")
|
|
3092
3092
|
throw new Error("Not a valid GraphQL document.");
|
|
@@ -3098,10 +3098,10 @@ function q(e) {
|
|
|
3098
3098
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
3099
3099
|
t[n - 1] = arguments[n];
|
|
3100
3100
|
typeof e == "string" && (e = [e]);
|
|
3101
|
-
var
|
|
3102
|
-
return t.forEach(function(
|
|
3103
|
-
|
|
3104
|
-
}), Wt(
|
|
3101
|
+
var i = e[0];
|
|
3102
|
+
return t.forEach(function(r, s) {
|
|
3103
|
+
r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
|
|
3104
|
+
}), Wt(i);
|
|
3105
3105
|
}
|
|
3106
3106
|
function Zt() {
|
|
3107
3107
|
te.clear(), Ee.clear();
|
|
@@ -3110,10 +3110,10 @@ function Kt() {
|
|
|
3110
3110
|
qe = !1;
|
|
3111
3111
|
}
|
|
3112
3112
|
function en() {
|
|
3113
|
-
|
|
3113
|
+
ie = !0;
|
|
3114
3114
|
}
|
|
3115
3115
|
function tn() {
|
|
3116
|
-
|
|
3116
|
+
ie = !1;
|
|
3117
3117
|
}
|
|
3118
3118
|
var $ = {
|
|
3119
3119
|
gql: q,
|
|
@@ -3138,6 +3138,20 @@ const P = q, nn = P`
|
|
|
3138
3138
|
location {
|
|
3139
3139
|
id
|
|
3140
3140
|
name
|
|
3141
|
+
phone
|
|
3142
|
+
address {
|
|
3143
|
+
id
|
|
3144
|
+
countryCode
|
|
3145
|
+
country
|
|
3146
|
+
postalCode
|
|
3147
|
+
provinceCode
|
|
3148
|
+
province
|
|
3149
|
+
city
|
|
3150
|
+
address1
|
|
3151
|
+
address2
|
|
3152
|
+
updatedAt
|
|
3153
|
+
createdAt
|
|
3154
|
+
}
|
|
3141
3155
|
}
|
|
3142
3156
|
inventoryQuantity
|
|
3143
3157
|
}
|
|
@@ -3155,6 +3169,20 @@ const P = q, nn = P`
|
|
|
3155
3169
|
location {
|
|
3156
3170
|
id
|
|
3157
3171
|
name
|
|
3172
|
+
phone
|
|
3173
|
+
address {
|
|
3174
|
+
id
|
|
3175
|
+
countryCode
|
|
3176
|
+
country
|
|
3177
|
+
postalCode
|
|
3178
|
+
provinceCode
|
|
3179
|
+
province
|
|
3180
|
+
city
|
|
3181
|
+
address1
|
|
3182
|
+
address2
|
|
3183
|
+
updatedAt
|
|
3184
|
+
createdAt
|
|
3185
|
+
}
|
|
3158
3186
|
}
|
|
3159
3187
|
inventoryQuantity
|
|
3160
3188
|
}
|
|
@@ -3181,6 +3209,20 @@ const P = q, nn = P`
|
|
|
3181
3209
|
nodes {
|
|
3182
3210
|
id
|
|
3183
3211
|
name
|
|
3212
|
+
phone
|
|
3213
|
+
address {
|
|
3214
|
+
id
|
|
3215
|
+
countryCode
|
|
3216
|
+
country
|
|
3217
|
+
postalCode
|
|
3218
|
+
provinceCode
|
|
3219
|
+
province
|
|
3220
|
+
city
|
|
3221
|
+
address1
|
|
3222
|
+
address2
|
|
3223
|
+
updatedAt
|
|
3224
|
+
createdAt
|
|
3225
|
+
}
|
|
3184
3226
|
}
|
|
3185
3227
|
pageInfo {
|
|
3186
3228
|
startCursor
|
|
@@ -3198,8 +3240,11 @@ const P = q, nn = P`
|
|
|
3198
3240
|
nodes {
|
|
3199
3241
|
id
|
|
3200
3242
|
title
|
|
3243
|
+
status
|
|
3201
3244
|
description
|
|
3202
3245
|
code
|
|
3246
|
+
startsAt
|
|
3247
|
+
endsAt
|
|
3203
3248
|
createdAt
|
|
3204
3249
|
updatedAt
|
|
3205
3250
|
}
|
|
@@ -3283,43 +3328,45 @@ const P = q, nn = P`
|
|
|
3283
3328
|
}
|
|
3284
3329
|
}
|
|
3285
3330
|
}
|
|
3286
|
-
`,
|
|
3287
|
-
function
|
|
3331
|
+
`, dn = (e, t, n, i) => e();
|
|
3332
|
+
function hn(e, t = dn) {
|
|
3288
3333
|
return {
|
|
3289
|
-
GetLocationAvailabilities(n,
|
|
3290
|
-
return t((
|
|
3334
|
+
GetLocationAvailabilities(n, i) {
|
|
3335
|
+
return t((r) => e.request(nn, n, { ...i, ...r }), "GetLocationAvailabilities", "query", n);
|
|
3291
3336
|
},
|
|
3292
|
-
GetLocationAvailability(n,
|
|
3293
|
-
return t((
|
|
3337
|
+
GetLocationAvailability(n, i) {
|
|
3338
|
+
return t((r) => e.request(rn, n, { ...i, ...r }), "GetLocationAvailability", "query", n);
|
|
3294
3339
|
},
|
|
3295
|
-
GetPurchasingCustomerMetafield(n,
|
|
3296
|
-
return t((
|
|
3340
|
+
GetPurchasingCustomerMetafield(n, i) {
|
|
3341
|
+
return t((r) => e.request(sn, n, { ...i, ...r }), "GetPurchasingCustomerMetafield", "query", n);
|
|
3297
3342
|
},
|
|
3298
|
-
GetPoints(n,
|
|
3299
|
-
return t((
|
|
3343
|
+
GetPoints(n, i) {
|
|
3344
|
+
return t((r) => e.request(on, n, { ...i, ...r }), "GetPoints", "query", n);
|
|
3300
3345
|
},
|
|
3301
|
-
GetLocations(n,
|
|
3302
|
-
return t((
|
|
3346
|
+
GetLocations(n, i) {
|
|
3347
|
+
return t((r) => e.request(an, n, { ...i, ...r }), "GetLocations", "query", n);
|
|
3303
3348
|
},
|
|
3304
|
-
GetPurchasingCustomerDiscounts(n,
|
|
3305
|
-
return t((
|
|
3349
|
+
GetPurchasingCustomerDiscounts(n, i) {
|
|
3350
|
+
return t((r) => e.request(cn, n, { ...i, ...r }), "GetPurchasingCustomerDiscounts", "query", n);
|
|
3306
3351
|
},
|
|
3307
|
-
GetPurchasingCustomerPointChangeActivities(n,
|
|
3308
|
-
return t((
|
|
3352
|
+
GetPurchasingCustomerPointChangeActivities(n, i) {
|
|
3353
|
+
return t((r) => e.request(un, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
|
|
3309
3354
|
},
|
|
3310
|
-
GetPurchasingCustomerRank(n,
|
|
3311
|
-
return t((
|
|
3355
|
+
GetPurchasingCustomerRank(n, i) {
|
|
3356
|
+
return t((r) => e.request(ln, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
|
|
3312
3357
|
}
|
|
3313
3358
|
};
|
|
3314
3359
|
}
|
|
3315
3360
|
class fn {
|
|
3316
3361
|
constructor(t) {
|
|
3317
3362
|
Ce(this, "api");
|
|
3318
|
-
this.api =
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3363
|
+
this.api = hn(
|
|
3364
|
+
new Ht(`${t}/apps/sq-api`, {
|
|
3365
|
+
headers: {
|
|
3366
|
+
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
3367
|
+
}
|
|
3368
|
+
})
|
|
3369
|
+
);
|
|
3323
3370
|
}
|
|
3324
3371
|
/**
|
|
3325
3372
|
* getLocationAvailabilities は渡されたSKUの各ロケーションにおける残り在庫の一覧を返します。
|
|
@@ -3329,15 +3376,35 @@ class fn {
|
|
|
3329
3376
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3330
3377
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3331
3378
|
*/
|
|
3332
|
-
async getLocationAvailabilities(t, n,
|
|
3333
|
-
const s = await this.api.GetLocationAvailabilities({
|
|
3379
|
+
async getLocationAvailabilities(t, n, i, r) {
|
|
3380
|
+
const s = await this.api.GetLocationAvailabilities({
|
|
3381
|
+
sku: t,
|
|
3382
|
+
first: n,
|
|
3383
|
+
after: i,
|
|
3384
|
+
isReverse: r
|
|
3385
|
+
});
|
|
3334
3386
|
return {
|
|
3335
|
-
nodes: s.locationAvailabilities.nodes.map(
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3387
|
+
nodes: s.locationAvailabilities.nodes.map(
|
|
3388
|
+
(o) => ({
|
|
3389
|
+
location: {
|
|
3390
|
+
id: o.location.id,
|
|
3391
|
+
name: o.location.name,
|
|
3392
|
+
phone: o.location.phone,
|
|
3393
|
+
address: o.location.address ? {
|
|
3394
|
+
id: o.location.address.id,
|
|
3395
|
+
countryCode: o.location.address.countryCode,
|
|
3396
|
+
country: o.location.address.country,
|
|
3397
|
+
postalCode: o.location.address.postalCode,
|
|
3398
|
+
provinceCode: o.location.address.provinceCode,
|
|
3399
|
+
province: o.location.address.province,
|
|
3400
|
+
city: o.location.address.city,
|
|
3401
|
+
address1: o.location.address.address1,
|
|
3402
|
+
address2: o.location.address.address2
|
|
3403
|
+
} : void 0
|
|
3404
|
+
},
|
|
3405
|
+
inventoryQuantity: o.inventoryQuantity
|
|
3406
|
+
})
|
|
3407
|
+
) ?? [],
|
|
3341
3408
|
pageInfo: s.locationAvailabilities.pageInfo ?? null
|
|
3342
3409
|
};
|
|
3343
3410
|
}
|
|
@@ -3347,12 +3414,25 @@ class fn {
|
|
|
3347
3414
|
* @param {string} locationID 在庫情報を取得したいLocationのID。
|
|
3348
3415
|
*/
|
|
3349
3416
|
async getLocationAvailability(t, n) {
|
|
3350
|
-
const
|
|
3417
|
+
const i = await this.api.GetLocationAvailability({ sku: t, locationID: n });
|
|
3351
3418
|
return {
|
|
3352
3419
|
location: {
|
|
3353
|
-
|
|
3420
|
+
id: i.locationAvailability.location.id,
|
|
3421
|
+
name: i.locationAvailability.location.name,
|
|
3422
|
+
phone: i.locationAvailability.location.phone,
|
|
3423
|
+
address: i.locationAvailability.location.address ? {
|
|
3424
|
+
id: i.locationAvailability.location.address.id,
|
|
3425
|
+
countryCode: i.locationAvailability.location.address.countryCode,
|
|
3426
|
+
country: i.locationAvailability.location.address.country,
|
|
3427
|
+
postalCode: i.locationAvailability.location.address.postalCode,
|
|
3428
|
+
provinceCode: i.locationAvailability.location.address.provinceCode,
|
|
3429
|
+
province: i.locationAvailability.location.address.province,
|
|
3430
|
+
city: i.locationAvailability.location.address.city,
|
|
3431
|
+
address1: i.locationAvailability.location.address.address1,
|
|
3432
|
+
address2: i.locationAvailability.location.address.address2
|
|
3433
|
+
} : void 0
|
|
3354
3434
|
},
|
|
3355
|
-
inventoryQuantity:
|
|
3435
|
+
inventoryQuantity: i.locationAvailability.inventoryQuantity
|
|
3356
3436
|
};
|
|
3357
3437
|
}
|
|
3358
3438
|
/**
|
|
@@ -3363,7 +3443,10 @@ class fn {
|
|
|
3363
3443
|
* @param {string} key 取得したいメタフィールドのkey。
|
|
3364
3444
|
*/
|
|
3365
3445
|
async getPurchasingCustomerMetafield(t, n) {
|
|
3366
|
-
return (await this.api.GetPurchasingCustomerMetafield({
|
|
3446
|
+
return (await this.api.GetPurchasingCustomerMetafield({
|
|
3447
|
+
namespace: t,
|
|
3448
|
+
key: n
|
|
3449
|
+
})).purchasingCustomerMetafield ?? null;
|
|
3367
3450
|
}
|
|
3368
3451
|
/**
|
|
3369
3452
|
* getPoints は、現在の保有ポイントと、獲得予定ポイントを返します。
|
|
@@ -3383,14 +3466,26 @@ class fn {
|
|
|
3383
3466
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3384
3467
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3385
3468
|
*/
|
|
3386
|
-
async getLocations(t, n,
|
|
3387
|
-
const
|
|
3469
|
+
async getLocations(t, n, i) {
|
|
3470
|
+
const r = await this.api.GetLocations({ first: t, after: n, isReverse: i });
|
|
3388
3471
|
return {
|
|
3389
|
-
nodes:
|
|
3472
|
+
nodes: r.locations.nodes.map((s) => ({
|
|
3390
3473
|
id: s.id,
|
|
3391
|
-
name: s.name
|
|
3474
|
+
name: s.name,
|
|
3475
|
+
phone: s.phone,
|
|
3476
|
+
address: s.address ? {
|
|
3477
|
+
id: s.address.id,
|
|
3478
|
+
countryCode: s.address.countryCode,
|
|
3479
|
+
country: s.address.country,
|
|
3480
|
+
postalCode: s.address.postalCode,
|
|
3481
|
+
provinceCode: s.address.provinceCode,
|
|
3482
|
+
province: s.address.province,
|
|
3483
|
+
city: s.address.city,
|
|
3484
|
+
address1: s.address.address1,
|
|
3485
|
+
address2: s.address.address2
|
|
3486
|
+
} : void 0
|
|
3392
3487
|
})) ?? [],
|
|
3393
|
-
pageInfo:
|
|
3488
|
+
pageInfo: r.locations.pageInfo ?? null
|
|
3394
3489
|
};
|
|
3395
3490
|
}
|
|
3396
3491
|
/**
|
|
@@ -3400,19 +3495,28 @@ class fn {
|
|
|
3400
3495
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3401
3496
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3402
3497
|
*/
|
|
3403
|
-
async getPurchasingCustomerDiscounts(t, n,
|
|
3404
|
-
const
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3498
|
+
async getPurchasingCustomerDiscounts(t, n, i) {
|
|
3499
|
+
const r = await this.api.GetPurchasingCustomerDiscounts({
|
|
3500
|
+
first: t,
|
|
3501
|
+
after: n,
|
|
3502
|
+
isReverse: i
|
|
3503
|
+
});
|
|
3504
|
+
return r.purchasingCustomer ? {
|
|
3505
|
+
id: r.purchasingCustomer.id,
|
|
3506
|
+
nodes: r.purchasingCustomer.discounts.nodes.map(
|
|
3507
|
+
(s) => ({
|
|
3508
|
+
id: s.id,
|
|
3509
|
+
title: s.title,
|
|
3510
|
+
status: s.status,
|
|
3511
|
+
description: s.description,
|
|
3512
|
+
code: s.code,
|
|
3513
|
+
startsAt: new Date(s.startsAt),
|
|
3514
|
+
endsAt: new Date(s.endsAt),
|
|
3515
|
+
createdAt: new Date(s.createdAt),
|
|
3516
|
+
updatedAt: new Date(s.updatedAt)
|
|
3517
|
+
})
|
|
3518
|
+
) ?? [],
|
|
3519
|
+
pageInfo: r.purchasingCustomer.discounts.pageInfo ?? null
|
|
3416
3520
|
} : null;
|
|
3417
3521
|
}
|
|
3418
3522
|
/**
|
|
@@ -3423,22 +3527,31 @@ class fn {
|
|
|
3423
3527
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3424
3528
|
* @param {PointChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかPOINT_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
|
|
3425
3529
|
*/
|
|
3426
|
-
async getPointChangeActivities(t, n,
|
|
3427
|
-
const s = await this.api.GetPurchasingCustomerPointChangeActivities({
|
|
3530
|
+
async getPointChangeActivities(t, n, i, r) {
|
|
3531
|
+
const s = await this.api.GetPurchasingCustomerPointChangeActivities({
|
|
3532
|
+
first: t,
|
|
3533
|
+
after: n,
|
|
3534
|
+
isReverse: i,
|
|
3535
|
+
sortKeys: r
|
|
3536
|
+
});
|
|
3428
3537
|
return s.purchasingCustomer ? {
|
|
3429
|
-
nodes: s.purchasingCustomer.pointChangeActivities.nodes.map(
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3538
|
+
nodes: s.purchasingCustomer.pointChangeActivities.nodes.map(
|
|
3539
|
+
(o) => ({
|
|
3540
|
+
id: o.id,
|
|
3541
|
+
title: o.title,
|
|
3542
|
+
pointChange: {
|
|
3543
|
+
id: o.pointChange.id,
|
|
3544
|
+
delta: o.pointChange.delta,
|
|
3545
|
+
availableAt: o.pointChange.availableAt ? new Date(o.pointChange.availableAt) : void 0,
|
|
3546
|
+
availableUntil: o.pointChange.availableUntil ? new Date(o.pointChange.availableUntil) : void 0,
|
|
3547
|
+
expiresDate: o.pointChange.expiresDate ? new Date(o.pointChange.expiresDate) : void 0,
|
|
3548
|
+
pointChangeCreatedAt: new Date(
|
|
3549
|
+
o.pointChange.pointChangeCreatedAt
|
|
3550
|
+
),
|
|
3551
|
+
createdAt: new Date(o.pointChange.createdAt)
|
|
3552
|
+
}
|
|
3553
|
+
})
|
|
3554
|
+
),
|
|
3442
3555
|
pageInfo: s.purchasingCustomer.pointChangeActivities.pageInfo
|
|
3443
3556
|
} : null;
|
|
3444
3557
|
}
|
|
@@ -3453,8 +3566,12 @@ class fn {
|
|
|
3453
3566
|
name: t.purchasingCustomer.currentCustomerRank.name,
|
|
3454
3567
|
calculationCondition: {
|
|
3455
3568
|
customerRankCalculationPeriod: t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod ? {
|
|
3456
|
-
start: new Date(
|
|
3457
|
-
|
|
3569
|
+
start: new Date(
|
|
3570
|
+
t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.start
|
|
3571
|
+
),
|
|
3572
|
+
end: new Date(
|
|
3573
|
+
t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.end
|
|
3574
|
+
)
|
|
3458
3575
|
} : void 0,
|
|
3459
3576
|
earnedPoint: t.purchasingCustomer.currentCustomerRank.calculationCondition.earnedPoint,
|
|
3460
3577
|
purchasePrice: t.purchasingCustomer.currentCustomerRank.calculationCondition.purchasePrice
|