@builtbystack/sq-shopify-theme-sdk 0.0.14 → 0.0.16
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 +121 -3
- package/dist/sq-shopify-theme-sdk.d.ts +34 -2
- package/dist/sq-shopify-theme-sdk.js +801 -701
- package/dist/sq-shopify-theme-sdk.umd.js +80 -35
- package/package.json +1 -1
|
@@ -3,24 +3,24 @@ var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var Ae = (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 r = t[n];
|
|
7
|
+
if (typeof r != "string" && !Array.isArray(r)) {
|
|
8
|
+
for (const i in r)
|
|
9
|
+
if (i !== "default" && !(i in e)) {
|
|
10
|
+
const s = Object.getOwnPropertyDescriptor(r, i);
|
|
11
|
+
s && Object.defineProperty(e, i, s.get ? s : {
|
|
12
12
|
enumerable: !0,
|
|
13
|
-
get: () => i
|
|
13
|
+
get: () => r[i]
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const Ce = JSON, Qe = (e) => e.toUpperCase(), Je = (e) => {
|
|
21
21
|
const t = {};
|
|
22
|
-
return e.forEach((n,
|
|
23
|
-
t[
|
|
22
|
+
return e.forEach((n, r) => {
|
|
23
|
+
t[r] = n;
|
|
24
24
|
}), t;
|
|
25
25
|
}, Xe = (e, t, n) => e.document ? e : {
|
|
26
26
|
document: e,
|
|
@@ -52,48 +52,48 @@ function et(e, t) {
|
|
|
52
52
|
}
|
|
53
53
|
const tt = /\r\n|[\n\r]/g;
|
|
54
54
|
function pe(e, t) {
|
|
55
|
-
let n = 0,
|
|
56
|
-
for (const
|
|
57
|
-
if (typeof
|
|
55
|
+
let n = 0, r = 1;
|
|
56
|
+
for (const i of e.body.matchAll(tt)) {
|
|
57
|
+
if (typeof i.index == "number" || et(!1), i.index >= t)
|
|
58
58
|
break;
|
|
59
|
-
n =
|
|
59
|
+
n = i.index + i[0].length, r += 1;
|
|
60
60
|
}
|
|
61
61
|
return {
|
|
62
|
-
line:
|
|
62
|
+
line: r,
|
|
63
63
|
column: t + 1 - n
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function nt(e) {
|
|
67
|
-
return
|
|
67
|
+
return Oe(
|
|
68
68
|
e.source,
|
|
69
69
|
pe(e.source, e.start)
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const n = e.locationOffset.column - 1,
|
|
74
|
-
`, m =
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
for (let N = 0; N <
|
|
78
|
-
|
|
72
|
+
function Oe(e, t) {
|
|
73
|
+
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0, h = t.column + c, p = `${e.name}:${o}:${h}
|
|
74
|
+
`, m = r.split(/\r\n|[\n\r]/g), y = m[i];
|
|
75
|
+
if (y.length > 120) {
|
|
76
|
+
const C = Math.floor(h / 80), T = h % 80, g = [];
|
|
77
|
+
for (let N = 0; N < y.length; N += 80)
|
|
78
|
+
g.push(y.slice(N, N + 80));
|
|
79
79
|
return p + Te([
|
|
80
|
-
[`${o} |`,
|
|
81
|
-
...
|
|
80
|
+
[`${o} |`, g[0]],
|
|
81
|
+
...g.slice(1, C + 1).map((N) => ["|", N]),
|
|
82
82
|
["|", "^".padStart(T)],
|
|
83
|
-
["|",
|
|
83
|
+
["|", g[C + 1]]
|
|
84
84
|
]);
|
|
85
85
|
}
|
|
86
86
|
return p + Te([
|
|
87
87
|
// Lines specified like this: ["prefix", "string"],
|
|
88
|
-
[`${o - 1} |`, m[
|
|
89
|
-
[`${o} |`,
|
|
88
|
+
[`${o - 1} |`, m[i - 1]],
|
|
89
|
+
[`${o} |`, y],
|
|
90
90
|
["|", "^".padStart(h)],
|
|
91
|
-
[`${o + 1} |`, m[
|
|
91
|
+
[`${o + 1} |`, m[i + 1]]
|
|
92
92
|
]);
|
|
93
93
|
}
|
|
94
94
|
function Te(e) {
|
|
95
|
-
const t = e.filter(([
|
|
96
|
-
return t.map(([
|
|
95
|
+
const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
|
|
96
|
+
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
97
97
|
`);
|
|
98
98
|
}
|
|
99
99
|
function rt(e) {
|
|
@@ -107,7 +107,7 @@ function rt(e) {
|
|
|
107
107
|
extensions: e[5]
|
|
108
108
|
} : t;
|
|
109
109
|
}
|
|
110
|
-
class
|
|
110
|
+
class Ee 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,19 +147,19 @@ class Ce extends Error {
|
|
|
147
147
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
148
148
|
*/
|
|
149
149
|
constructor(t, ...n) {
|
|
150
|
-
var
|
|
151
|
-
const { nodes: o, source:
|
|
150
|
+
var r, i, s;
|
|
151
|
+
const { nodes: o, source: c, positions: h, path: p, originalError: m, extensions: y } = rt(n);
|
|
152
152
|
super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = m ?? void 0, this.nodes = Ne(
|
|
153
153
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
154
154
|
);
|
|
155
|
-
const
|
|
156
|
-
(
|
|
155
|
+
const C = Ne(
|
|
156
|
+
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
|
|
157
157
|
);
|
|
158
|
-
this.source =
|
|
158
|
+
this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = h && c ? h.map((g) => pe(c, g)) : C == null ? void 0 : C.map((g) => pe(g.source, g.start));
|
|
159
159
|
const T = Ke(
|
|
160
160
|
m == null ? void 0 : m.extensions
|
|
161
161
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
162
|
-
this.extensions = (s =
|
|
162
|
+
this.extensions = (s = y ?? T) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
163
163
|
message: {
|
|
164
164
|
writable: !0,
|
|
165
165
|
enumerable: !0
|
|
@@ -183,7 +183,7 @@ class Ce 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, Ee) : Object.defineProperty(this, "stack", {
|
|
187
187
|
value: Error().stack,
|
|
188
188
|
writable: !0,
|
|
189
189
|
configurable: !0
|
|
@@ -203,7 +203,7 @@ class Ce extends Error {
|
|
|
203
203
|
for (const n of this.locations)
|
|
204
204
|
t += `
|
|
205
205
|
|
|
206
|
-
` +
|
|
206
|
+
` + Oe(this.source, n);
|
|
207
207
|
return t;
|
|
208
208
|
}
|
|
209
209
|
toJSON() {
|
|
@@ -217,7 +217,7 @@ function Ne(e) {
|
|
|
217
217
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
218
218
|
}
|
|
219
219
|
function x(e, t, n) {
|
|
220
|
-
return new
|
|
220
|
+
return new Ee(`Syntax Error: ${n}`, {
|
|
221
221
|
source: e,
|
|
222
222
|
positions: [t]
|
|
223
223
|
});
|
|
@@ -238,8 +238,8 @@ class it {
|
|
|
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, r) {
|
|
242
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
|
|
243
243
|
}
|
|
244
244
|
get [Symbol.toStringTag]() {
|
|
245
245
|
return "Location";
|
|
@@ -251,7 +251,7 @@ class it {
|
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
class
|
|
254
|
+
class Re {
|
|
255
255
|
/**
|
|
256
256
|
* The kind of Token.
|
|
257
257
|
*/
|
|
@@ -278,8 +278,8 @@ class _e {
|
|
|
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, r, i, s, o) {
|
|
282
|
+
this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = o, this.prev = null, this.next = null;
|
|
283
283
|
}
|
|
284
284
|
get [Symbol.toStringTag]() {
|
|
285
285
|
return "Token";
|
|
@@ -293,7 +293,7 @@ class _e {
|
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
const
|
|
296
|
+
const _e = {
|
|
297
297
|
Name: [],
|
|
298
298
|
Document: ["definitions"],
|
|
299
299
|
OperationDefinition: [
|
|
@@ -367,7 +367,7 @@ const Se = {
|
|
|
367
367
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
368
368
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
369
369
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
370
|
-
}, st = new Set(Object.keys(
|
|
370
|
+
}, st = new Set(Object.keys(_e));
|
|
371
371
|
function be(e) {
|
|
372
372
|
const t = e == null ? void 0 : e.kind;
|
|
373
373
|
return typeof t == "string" && st.has(t);
|
|
@@ -394,7 +394,7 @@ function ke(e) {
|
|
|
394
394
|
return e >= 97 && e <= 122 || // A-Z
|
|
395
395
|
e >= 65 && e <= 90;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Pe(e) {
|
|
398
398
|
return ke(e) || e === 95;
|
|
399
399
|
}
|
|
400
400
|
function ot(e) {
|
|
@@ -402,36 +402,36 @@ function ot(e) {
|
|
|
402
402
|
}
|
|
403
403
|
function at(e) {
|
|
404
404
|
var t;
|
|
405
|
-
let n = Number.MAX_SAFE_INTEGER,
|
|
405
|
+
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
406
406
|
for (let o = 0; o < e.length; ++o) {
|
|
407
407
|
var s;
|
|
408
|
-
const
|
|
409
|
-
h !==
|
|
408
|
+
const c = e[o], h = ut(c);
|
|
409
|
+
h !== c.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
|
|
410
410
|
}
|
|
411
|
-
return e.map((o,
|
|
412
|
-
(t =
|
|
413
|
-
|
|
411
|
+
return e.map((o, c) => c === 0 ? o : o.slice(n)).slice(
|
|
412
|
+
(t = r) !== null && t !== void 0 ? t : 0,
|
|
413
|
+
i + 1
|
|
414
414
|
);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function ut(e) {
|
|
417
417
|
let t = 0;
|
|
418
418
|
for (; t < e.length && me(e.charCodeAt(t)); )
|
|
419
419
|
++t;
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
const n = e.replace(/"""/g, '\\"""'),
|
|
424
|
-
(!
|
|
425
|
-
let
|
|
426
|
-
const
|
|
427
|
-
return (m && !
|
|
428
|
-
`),
|
|
429
|
-
`), '"""' +
|
|
422
|
+
function ct(e, t) {
|
|
423
|
+
const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((T) => T.length === 0 || me(T.charCodeAt(0))), o = n.endsWith('\\"""'), c = e.endsWith('"') && !o, h = e.endsWith("\\"), p = c || h, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
424
|
+
(!i || e.length > 70 || p || s || o);
|
|
425
|
+
let y = "";
|
|
426
|
+
const C = i && me(e.charCodeAt(0));
|
|
427
|
+
return (m && !C || s) && (y += `
|
|
428
|
+
`), y += n, (m || p) && (y += `
|
|
429
|
+
`), '"""' + y + '"""';
|
|
430
430
|
}
|
|
431
|
-
var
|
|
431
|
+
var u;
|
|
432
432
|
(function(e) {
|
|
433
433
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
434
|
-
})(
|
|
434
|
+
})(u || (u = {}));
|
|
435
435
|
class lt {
|
|
436
436
|
/**
|
|
437
437
|
* The previously focused non-ignored token.
|
|
@@ -446,7 +446,7 @@ class lt {
|
|
|
446
446
|
* The character offset at which the current line begins.
|
|
447
447
|
*/
|
|
448
448
|
constructor(t) {
|
|
449
|
-
const n = new
|
|
449
|
+
const n = new Re(u.SOF, 0, 0, 0, 0);
|
|
450
450
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
451
451
|
}
|
|
452
452
|
get [Symbol.toStringTag]() {
|
|
@@ -464,7 +464,7 @@ class lt {
|
|
|
464
464
|
*/
|
|
465
465
|
lookahead() {
|
|
466
466
|
let t = this.token;
|
|
467
|
-
if (t.kind !==
|
|
467
|
+
if (t.kind !== u.EOF)
|
|
468
468
|
do
|
|
469
469
|
if (t.next)
|
|
470
470
|
t = t.next;
|
|
@@ -472,159 +472,159 @@ class lt {
|
|
|
472
472
|
const n = ht(this, t.end);
|
|
473
473
|
t.next = n, n.prev = t, t = n;
|
|
474
474
|
}
|
|
475
|
-
while (t.kind ===
|
|
475
|
+
while (t.kind === u.COMMENT);
|
|
476
476
|
return t;
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
function dt(e) {
|
|
480
|
-
return e ===
|
|
480
|
+
return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
|
|
481
481
|
}
|
|
482
482
|
function V(e) {
|
|
483
483
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
484
484
|
}
|
|
485
485
|
function se(e, t) {
|
|
486
|
-
return
|
|
486
|
+
return we(e.charCodeAt(t)) && Le(e.charCodeAt(t + 1));
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function we(e) {
|
|
489
489
|
return e >= 55296 && e <= 56319;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Le(e) {
|
|
492
492
|
return e >= 56320 && e <= 57343;
|
|
493
493
|
}
|
|
494
494
|
function F(e, t) {
|
|
495
495
|
const n = e.source.body.codePointAt(t);
|
|
496
496
|
if (n === void 0)
|
|
497
|
-
return
|
|
497
|
+
return u.EOF;
|
|
498
498
|
if (n >= 32 && n <= 126) {
|
|
499
|
-
const
|
|
500
|
-
return
|
|
499
|
+
const r = String.fromCodePoint(n);
|
|
500
|
+
return r === '"' ? `'"'` : `"${r}"`;
|
|
501
501
|
}
|
|
502
502
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
503
503
|
}
|
|
504
|
-
function b(e, t, n,
|
|
504
|
+
function b(e, t, n, r, i) {
|
|
505
505
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
506
|
-
return new
|
|
506
|
+
return new Re(t, n, r, s, o, i);
|
|
507
507
|
}
|
|
508
508
|
function ht(e, t) {
|
|
509
|
-
const n = e.source.body,
|
|
510
|
-
let
|
|
511
|
-
for (;
|
|
512
|
-
const s = n.charCodeAt(
|
|
509
|
+
const n = e.source.body, r = n.length;
|
|
510
|
+
let i = t;
|
|
511
|
+
for (; i < r; ) {
|
|
512
|
+
const s = n.charCodeAt(i);
|
|
513
513
|
switch (s) {
|
|
514
514
|
case 65279:
|
|
515
515
|
case 9:
|
|
516
516
|
case 32:
|
|
517
517
|
case 44:
|
|
518
|
-
++
|
|
518
|
+
++i;
|
|
519
519
|
continue;
|
|
520
520
|
case 10:
|
|
521
|
-
++
|
|
521
|
+
++i, ++e.line, e.lineStart = i;
|
|
522
522
|
continue;
|
|
523
523
|
case 13:
|
|
524
|
-
n.charCodeAt(
|
|
524
|
+
n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
|
|
525
525
|
continue;
|
|
526
526
|
case 35:
|
|
527
|
-
return pt(e,
|
|
527
|
+
return pt(e, i);
|
|
528
528
|
case 33:
|
|
529
|
-
return b(e,
|
|
529
|
+
return b(e, u.BANG, i, i + 1);
|
|
530
530
|
case 36:
|
|
531
|
-
return b(e,
|
|
531
|
+
return b(e, u.DOLLAR, i, i + 1);
|
|
532
532
|
case 38:
|
|
533
|
-
return b(e,
|
|
533
|
+
return b(e, u.AMP, i, i + 1);
|
|
534
534
|
case 40:
|
|
535
|
-
return b(e,
|
|
535
|
+
return b(e, u.PAREN_L, i, i + 1);
|
|
536
536
|
case 41:
|
|
537
|
-
return b(e,
|
|
537
|
+
return b(e, u.PAREN_R, i, i + 1);
|
|
538
538
|
case 46:
|
|
539
|
-
if (n.charCodeAt(
|
|
540
|
-
return b(e,
|
|
539
|
+
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
|
|
540
|
+
return b(e, u.SPREAD, i, i + 3);
|
|
541
541
|
break;
|
|
542
542
|
case 58:
|
|
543
|
-
return b(e,
|
|
543
|
+
return b(e, u.COLON, i, i + 1);
|
|
544
544
|
case 61:
|
|
545
|
-
return b(e,
|
|
545
|
+
return b(e, u.EQUALS, i, i + 1);
|
|
546
546
|
case 64:
|
|
547
|
-
return b(e,
|
|
547
|
+
return b(e, u.AT, i, i + 1);
|
|
548
548
|
case 91:
|
|
549
|
-
return b(e,
|
|
549
|
+
return b(e, u.BRACKET_L, i, i + 1);
|
|
550
550
|
case 93:
|
|
551
|
-
return b(e,
|
|
551
|
+
return b(e, u.BRACKET_R, i, i + 1);
|
|
552
552
|
case 123:
|
|
553
|
-
return b(e,
|
|
553
|
+
return b(e, u.BRACE_L, i, i + 1);
|
|
554
554
|
case 124:
|
|
555
|
-
return b(e,
|
|
555
|
+
return b(e, u.PIPE, i, i + 1);
|
|
556
556
|
case 125:
|
|
557
|
-
return b(e,
|
|
557
|
+
return b(e, u.BRACE_R, i, i + 1);
|
|
558
558
|
case 34:
|
|
559
|
-
return n.charCodeAt(
|
|
559
|
+
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Et(e, i) : mt(e, i);
|
|
560
560
|
}
|
|
561
561
|
if (Y(s) || s === 45)
|
|
562
|
-
return ft(e,
|
|
563
|
-
if (
|
|
564
|
-
return vt(e,
|
|
562
|
+
return ft(e, i, s);
|
|
563
|
+
if (Pe(s))
|
|
564
|
+
return vt(e, i);
|
|
565
565
|
throw x(
|
|
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
|
+
i,
|
|
568
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : V(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
|
|
569
569
|
);
|
|
570
570
|
}
|
|
571
|
-
return b(e,
|
|
571
|
+
return b(e, u.EOF, r, r);
|
|
572
572
|
}
|
|
573
573
|
function pt(e, t) {
|
|
574
|
-
const n = e.source.body,
|
|
575
|
-
let
|
|
576
|
-
for (;
|
|
577
|
-
const s = n.charCodeAt(
|
|
574
|
+
const n = e.source.body, r = n.length;
|
|
575
|
+
let i = t + 1;
|
|
576
|
+
for (; i < r; ) {
|
|
577
|
+
const s = n.charCodeAt(i);
|
|
578
578
|
if (s === 10 || s === 13)
|
|
579
579
|
break;
|
|
580
580
|
if (V(s))
|
|
581
|
-
++
|
|
582
|
-
else if (se(n,
|
|
583
|
-
|
|
581
|
+
++i;
|
|
582
|
+
else if (se(n, i))
|
|
583
|
+
i += 2;
|
|
584
584
|
else
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
587
|
return b(
|
|
588
588
|
e,
|
|
589
|
-
|
|
589
|
+
u.COMMENT,
|
|
590
590
|
t,
|
|
591
|
-
|
|
592
|
-
n.slice(t + 1,
|
|
591
|
+
i,
|
|
592
|
+
n.slice(t + 1, i)
|
|
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 r = e.source.body;
|
|
597
|
+
let i = t, s = n, o = !1;
|
|
598
|
+
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
599
|
+
if (s = r.charCodeAt(++i), Y(s))
|
|
600
600
|
throw x(
|
|
601
601
|
e.source,
|
|
602
|
-
|
|
602
|
+
i,
|
|
603
603
|
`Invalid number, unexpected digit after 0: ${F(
|
|
604
604
|
e,
|
|
605
|
-
|
|
605
|
+
i
|
|
606
606
|
)}.`
|
|
607
607
|
);
|
|
608
608
|
} else
|
|
609
|
-
|
|
610
|
-
if (s === 46 && (o = !0, s =
|
|
609
|
+
i = ce(e, i, s), s = r.charCodeAt(i);
|
|
610
|
+
if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ce(e, i, s), s = r.charCodeAt(i)), s === 46 || Pe(s))
|
|
611
611
|
throw x(
|
|
612
612
|
e.source,
|
|
613
|
-
|
|
613
|
+
i,
|
|
614
614
|
`Invalid number, expected digit but got: ${F(
|
|
615
615
|
e,
|
|
616
|
-
|
|
616
|
+
i
|
|
617
617
|
)}.`
|
|
618
618
|
);
|
|
619
619
|
return b(
|
|
620
620
|
e,
|
|
621
|
-
o ?
|
|
621
|
+
o ? u.FLOAT : u.INT,
|
|
622
622
|
t,
|
|
623
|
-
|
|
624
|
-
|
|
623
|
+
i,
|
|
624
|
+
r.slice(t, i)
|
|
625
625
|
);
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function ce(e, t, n) {
|
|
628
628
|
if (!Y(n))
|
|
629
629
|
throw x(
|
|
630
630
|
e.source,
|
|
@@ -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 r = e.source.body;
|
|
638
|
+
let i = t + 1;
|
|
639
|
+
for (; Y(r.charCodeAt(i)); )
|
|
640
|
+
++i;
|
|
641
|
+
return i;
|
|
642
642
|
}
|
|
643
643
|
function mt(e, t) {
|
|
644
|
-
const n = e.source.body,
|
|
645
|
-
let
|
|
646
|
-
for (;
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
649
|
-
return o += n.slice(s,
|
|
650
|
-
if (
|
|
651
|
-
o += n.slice(s,
|
|
652
|
-
const h = n.charCodeAt(
|
|
653
|
-
o += h.value,
|
|
644
|
+
const n = e.source.body, r = n.length;
|
|
645
|
+
let i = t + 1, s = i, o = "";
|
|
646
|
+
for (; i < r; ) {
|
|
647
|
+
const c = n.charCodeAt(i);
|
|
648
|
+
if (c === 34)
|
|
649
|
+
return o += n.slice(s, i), b(e, u.STRING, t, i + 1, o);
|
|
650
|
+
if (c === 92) {
|
|
651
|
+
o += n.slice(s, i);
|
|
652
|
+
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? gt(e, i) : yt(e, i) : Ct(e, i);
|
|
653
|
+
o += h.value, i += h.size, s = i;
|
|
654
654
|
continue;
|
|
655
655
|
}
|
|
656
|
-
if (
|
|
656
|
+
if (c === 10 || c === 13)
|
|
657
657
|
break;
|
|
658
|
-
if (V(
|
|
659
|
-
++
|
|
660
|
-
else if (se(n,
|
|
661
|
-
|
|
658
|
+
if (V(c))
|
|
659
|
+
++i;
|
|
660
|
+
else if (se(n, i))
|
|
661
|
+
i += 2;
|
|
662
662
|
else
|
|
663
663
|
throw x(
|
|
664
664
|
e.source,
|
|
665
|
-
|
|
665
|
+
i,
|
|
666
666
|
`Invalid character within String: ${F(
|
|
667
667
|
e,
|
|
668
|
-
|
|
668
|
+
i
|
|
669
669
|
)}.`
|
|
670
670
|
);
|
|
671
671
|
}
|
|
672
|
-
throw x(e.source,
|
|
672
|
+
throw x(e.source, i, "Unterminated string.");
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function gt(e, t) {
|
|
675
675
|
const n = e.source.body;
|
|
676
|
-
let
|
|
677
|
-
for (;
|
|
678
|
-
const s = n.charCodeAt(t +
|
|
676
|
+
let r = 0, i = 3;
|
|
677
|
+
for (; i < 12; ) {
|
|
678
|
+
const s = n.charCodeAt(t + i++);
|
|
679
679
|
if (s === 125) {
|
|
680
|
-
if (
|
|
680
|
+
if (i < 5 || !V(r))
|
|
681
681
|
break;
|
|
682
682
|
return {
|
|
683
|
-
value: String.fromCodePoint(
|
|
684
|
-
size:
|
|
683
|
+
value: String.fromCodePoint(r),
|
|
684
|
+
size: i
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
if (
|
|
687
|
+
if (r = r << 4 | $(s), r < 0)
|
|
688
688
|
break;
|
|
689
689
|
}
|
|
690
690
|
throw x(
|
|
@@ -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 + i
|
|
696
696
|
)}".`
|
|
697
697
|
);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
const n = e.source.body,
|
|
701
|
-
if (V(
|
|
699
|
+
function yt(e, t) {
|
|
700
|
+
const n = e.source.body, r = xe(n, t + 2);
|
|
701
|
+
if (V(r))
|
|
702
702
|
return {
|
|
703
|
-
value: String.fromCodePoint(
|
|
703
|
+
value: String.fromCodePoint(r),
|
|
704
704
|
size: 6
|
|
705
705
|
};
|
|
706
|
-
if (
|
|
707
|
-
const
|
|
708
|
-
if (
|
|
706
|
+
if (we(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
707
|
+
const i = xe(n, t + 8);
|
|
708
|
+
if (Le(i))
|
|
709
709
|
return {
|
|
710
|
-
value: String.fromCodePoint(
|
|
710
|
+
value: String.fromCodePoint(r, i),
|
|
711
711
|
size: 12
|
|
712
712
|
};
|
|
713
713
|
}
|
|
@@ -723,7 +723,7 @@ function xe(e, t) {
|
|
|
723
723
|
function $(e) {
|
|
724
724
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function Ct(e, t) {
|
|
727
727
|
const n = e.source.body;
|
|
728
728
|
switch (n.charCodeAt(t + 1)) {
|
|
729
729
|
case 34:
|
|
@@ -777,31 +777,31 @@ function Et(e, t) {
|
|
|
777
777
|
)}".`
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
const n = e.source.body,
|
|
782
|
-
let
|
|
780
|
+
function Et(e, t) {
|
|
781
|
+
const n = e.source.body, r = n.length;
|
|
782
|
+
let i = e.lineStart, s = t + 3, o = s, c = "";
|
|
783
783
|
const h = [];
|
|
784
|
-
for (; s <
|
|
784
|
+
for (; s < r; ) {
|
|
785
785
|
const p = n.charCodeAt(s);
|
|
786
786
|
if (p === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
787
|
-
|
|
787
|
+
c += n.slice(o, s), h.push(c);
|
|
788
788
|
const m = b(
|
|
789
789
|
e,
|
|
790
|
-
|
|
790
|
+
u.BLOCK_STRING,
|
|
791
791
|
t,
|
|
792
792
|
s + 3,
|
|
793
793
|
// Return a string of the lines joined with U+000A.
|
|
794
794
|
at(h).join(`
|
|
795
795
|
`)
|
|
796
796
|
);
|
|
797
|
-
return e.line += h.length - 1, e.lineStart =
|
|
797
|
+
return e.line += h.length - 1, e.lineStart = i, m;
|
|
798
798
|
}
|
|
799
799
|
if (p === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
800
|
-
|
|
800
|
+
c += n.slice(o, s), o = s + 1, s += 4;
|
|
801
801
|
continue;
|
|
802
802
|
}
|
|
803
803
|
if (p === 10 || p === 13) {
|
|
804
|
-
|
|
804
|
+
c += n.slice(o, s), h.push(c), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, i = s;
|
|
805
805
|
continue;
|
|
806
806
|
}
|
|
807
807
|
if (V(p))
|
|
@@ -821,21 +821,21 @@ function Ct(e, t) {
|
|
|
821
821
|
throw x(e.source, s, "Unterminated string.");
|
|
822
822
|
}
|
|
823
823
|
function vt(e, t) {
|
|
824
|
-
const n = e.source.body,
|
|
825
|
-
let
|
|
826
|
-
for (;
|
|
827
|
-
const s = n.charCodeAt(
|
|
824
|
+
const n = e.source.body, r = n.length;
|
|
825
|
+
let i = t + 1;
|
|
826
|
+
for (; i < r; ) {
|
|
827
|
+
const s = n.charCodeAt(i);
|
|
828
828
|
if (ot(s))
|
|
829
|
-
++
|
|
829
|
+
++i;
|
|
830
830
|
else
|
|
831
831
|
break;
|
|
832
832
|
}
|
|
833
833
|
return b(
|
|
834
834
|
e,
|
|
835
|
-
|
|
835
|
+
u.NAME,
|
|
836
836
|
t,
|
|
837
|
-
|
|
838
|
-
n.slice(t,
|
|
837
|
+
i,
|
|
838
|
+
n.slice(t, i)
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
841
|
const At = 10, Fe = 2;
|
|
@@ -861,9 +861,9 @@ function Tt(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 r = e.toJSON();
|
|
865
|
+
if (r !== e)
|
|
866
|
+
return typeof r == "string" ? r : oe(r, n);
|
|
867
867
|
} else if (Array.isArray(e))
|
|
868
868
|
return xt(e, n);
|
|
869
869
|
return bt(e, n);
|
|
@@ -874,7 +874,7 @@ function Nt(e) {
|
|
|
874
874
|
function bt(e, t) {
|
|
875
875
|
const n = Object.entries(e);
|
|
876
876
|
return n.length === 0 ? "{}" : t.length > Fe ? "[" + It(e) + "]" : "{ " + n.map(
|
|
877
|
-
([
|
|
877
|
+
([i, s]) => i + ": " + oe(s, t)
|
|
878
878
|
).join(", ") + " }";
|
|
879
879
|
}
|
|
880
880
|
function xt(e, t) {
|
|
@@ -882,10 +882,10 @@ function xt(e, t) {
|
|
|
882
882
|
return "[]";
|
|
883
883
|
if (t.length > Fe)
|
|
884
884
|
return "[Array]";
|
|
885
|
-
const n = Math.min(At, e.length),
|
|
885
|
+
const n = Math.min(At, e.length), r = e.length - n, i = [];
|
|
886
886
|
for (let s = 0; s < n; ++s)
|
|
887
|
-
|
|
888
|
-
return
|
|
887
|
+
i.push(oe(e[s], t));
|
|
888
|
+
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
889
889
|
}
|
|
890
890
|
function It(e) {
|
|
891
891
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
@@ -896,7 +896,7 @@ function It(e) {
|
|
|
896
896
|
}
|
|
897
897
|
return t;
|
|
898
898
|
}
|
|
899
|
-
const
|
|
899
|
+
const St = (
|
|
900
900
|
/* c8 ignore next 6 */
|
|
901
901
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
902
902
|
globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
|
|
@@ -905,14 +905,14 @@ const Dt = (
|
|
|
905
905
|
if (t instanceof n)
|
|
906
906
|
return !0;
|
|
907
907
|
if (typeof t == "object" && t !== null) {
|
|
908
|
-
var
|
|
909
|
-
const
|
|
908
|
+
var r;
|
|
909
|
+
const i = 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] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
|
|
912
912
|
);
|
|
913
|
-
if (
|
|
913
|
+
if (i === s) {
|
|
914
914
|
const o = ve(t);
|
|
915
|
-
throw new Error(`Cannot use ${
|
|
915
|
+
throw new Error(`Cannot use ${i} "${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 Ue {
|
|
933
|
-
constructor(t, n = "GraphQL request",
|
|
933
|
+
constructor(t, n = "GraphQL request", r = {
|
|
934
934
|
line: 1,
|
|
935
935
|
column: 1
|
|
936
936
|
}) {
|
|
937
|
-
typeof t == "string" || Z(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset =
|
|
937
|
+
typeof t == "string" || Z(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset = r, 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(
|
|
@@ -946,22 +946,22 @@ class Ue {
|
|
|
946
946
|
return "Source";
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
function
|
|
950
|
-
return
|
|
949
|
+
function Dt(e) {
|
|
950
|
+
return St(e, Ue);
|
|
951
951
|
}
|
|
952
952
|
function Be(e, t) {
|
|
953
|
-
return new
|
|
953
|
+
return new Ot(e, t).parseDocument();
|
|
954
954
|
}
|
|
955
|
-
class
|
|
955
|
+
class Ot {
|
|
956
956
|
constructor(t, n = {}) {
|
|
957
|
-
const
|
|
958
|
-
this._lexer = new lt(
|
|
957
|
+
const r = Dt(t) ? t : new Ue(t);
|
|
958
|
+
this._lexer = new lt(r), this._options = n, this._tokenCounter = 0;
|
|
959
959
|
}
|
|
960
960
|
/**
|
|
961
961
|
* Converts a name lex token into a name parse node.
|
|
962
962
|
*/
|
|
963
963
|
parseName() {
|
|
964
|
-
const t = this.expectToken(
|
|
964
|
+
const t = this.expectToken(u.NAME);
|
|
965
965
|
return this.node(t, {
|
|
966
966
|
kind: f.NAME,
|
|
967
967
|
value: t.value
|
|
@@ -975,9 +975,9 @@ class Rt {
|
|
|
975
975
|
return this.node(this._lexer.token, {
|
|
976
976
|
kind: f.DOCUMENT,
|
|
977
977
|
definitions: this.many(
|
|
978
|
-
|
|
978
|
+
u.SOF,
|
|
979
979
|
this.parseDefinition,
|
|
980
|
-
|
|
980
|
+
u.EOF
|
|
981
981
|
)
|
|
982
982
|
});
|
|
983
983
|
}
|
|
@@ -1005,10 +1005,10 @@ class Rt {
|
|
|
1005
1005
|
* - InputObjectTypeDefinition
|
|
1006
1006
|
*/
|
|
1007
1007
|
parseDefinition() {
|
|
1008
|
-
if (this.peek(
|
|
1008
|
+
if (this.peek(u.BRACE_L))
|
|
1009
1009
|
return this.parseOperationDefinition();
|
|
1010
1010
|
const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1011
|
-
if (n.kind ===
|
|
1011
|
+
if (n.kind === u.NAME) {
|
|
1012
1012
|
switch (n.value) {
|
|
1013
1013
|
case "schema":
|
|
1014
1014
|
return this.parseSchemaDefinition();
|
|
@@ -1054,7 +1054,7 @@ class Rt {
|
|
|
1054
1054
|
*/
|
|
1055
1055
|
parseOperationDefinition() {
|
|
1056
1056
|
const t = this._lexer.token;
|
|
1057
|
-
if (this.peek(
|
|
1057
|
+
if (this.peek(u.BRACE_L))
|
|
1058
1058
|
return this.node(t, {
|
|
1059
1059
|
kind: f.OPERATION_DEFINITION,
|
|
1060
1060
|
operation: M.QUERY,
|
|
@@ -1064,11 +1064,11 @@ class Rt {
|
|
|
1064
1064
|
selectionSet: this.parseSelectionSet()
|
|
1065
1065
|
});
|
|
1066
1066
|
const n = this.parseOperationType();
|
|
1067
|
-
let
|
|
1068
|
-
return this.peek(
|
|
1067
|
+
let r;
|
|
1068
|
+
return this.peek(u.NAME) && (r = this.parseName()), this.node(t, {
|
|
1069
1069
|
kind: f.OPERATION_DEFINITION,
|
|
1070
1070
|
operation: n,
|
|
1071
|
-
name:
|
|
1071
|
+
name: r,
|
|
1072
1072
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1073
1073
|
directives: this.parseDirectives(!1),
|
|
1074
1074
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1078,7 +1078,7 @@ class Rt {
|
|
|
1078
1078
|
* OperationType : one of query mutation subscription
|
|
1079
1079
|
*/
|
|
1080
1080
|
parseOperationType() {
|
|
1081
|
-
const t = this.expectToken(
|
|
1081
|
+
const t = this.expectToken(u.NAME);
|
|
1082
1082
|
switch (t.value) {
|
|
1083
1083
|
case "query":
|
|
1084
1084
|
return M.QUERY;
|
|
@@ -1094,9 +1094,9 @@ class Rt {
|
|
|
1094
1094
|
*/
|
|
1095
1095
|
parseVariableDefinitions() {
|
|
1096
1096
|
return this.optionalMany(
|
|
1097
|
-
|
|
1097
|
+
u.PAREN_L,
|
|
1098
1098
|
this.parseVariableDefinition,
|
|
1099
|
-
|
|
1099
|
+
u.PAREN_R
|
|
1100
1100
|
);
|
|
1101
1101
|
}
|
|
1102
1102
|
/**
|
|
@@ -1106,8 +1106,8 @@ class Rt {
|
|
|
1106
1106
|
return this.node(this._lexer.token, {
|
|
1107
1107
|
kind: f.VARIABLE_DEFINITION,
|
|
1108
1108
|
variable: this.parseVariable(),
|
|
1109
|
-
type: (this.expectToken(
|
|
1110
|
-
defaultValue: this.expectOptionalToken(
|
|
1109
|
+
type: (this.expectToken(u.COLON), this.parseTypeReference()),
|
|
1110
|
+
defaultValue: this.expectOptionalToken(u.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
1111
1111
|
directives: this.parseConstDirectives()
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
@@ -1116,7 +1116,7 @@ class Rt {
|
|
|
1116
1116
|
*/
|
|
1117
1117
|
parseVariable() {
|
|
1118
1118
|
const t = this._lexer.token;
|
|
1119
|
-
return this.expectToken(
|
|
1119
|
+
return this.expectToken(u.DOLLAR), this.node(t, {
|
|
1120
1120
|
kind: f.VARIABLE,
|
|
1121
1121
|
name: this.parseName()
|
|
1122
1122
|
});
|
|
@@ -1130,9 +1130,9 @@ class Rt {
|
|
|
1130
1130
|
return this.node(this._lexer.token, {
|
|
1131
1131
|
kind: f.SELECTION_SET,
|
|
1132
1132
|
selections: this.many(
|
|
1133
|
-
|
|
1133
|
+
u.BRACE_L,
|
|
1134
1134
|
this.parseSelection,
|
|
1135
|
-
|
|
1135
|
+
u.BRACE_R
|
|
1136
1136
|
)
|
|
1137
1137
|
});
|
|
1138
1138
|
}
|
|
@@ -1143,7 +1143,7 @@ class Rt {
|
|
|
1143
1143
|
* - InlineFragment
|
|
1144
1144
|
*/
|
|
1145
1145
|
parseSelection() {
|
|
1146
|
-
return this.peek(
|
|
1146
|
+
return this.peek(u.SPREAD) ? this.parseFragment() : this.parseField();
|
|
1147
1147
|
}
|
|
1148
1148
|
/**
|
|
1149
1149
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
@@ -1152,14 +1152,14 @@ class Rt {
|
|
|
1152
1152
|
*/
|
|
1153
1153
|
parseField() {
|
|
1154
1154
|
const t = this._lexer.token, n = this.parseName();
|
|
1155
|
-
let
|
|
1156
|
-
return this.expectOptionalToken(
|
|
1155
|
+
let r, i;
|
|
1156
|
+
return this.expectOptionalToken(u.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
|
|
1157
1157
|
kind: f.FIELD,
|
|
1158
|
-
alias:
|
|
1159
|
-
name:
|
|
1158
|
+
alias: r,
|
|
1159
|
+
name: i,
|
|
1160
1160
|
arguments: this.parseArguments(!1),
|
|
1161
1161
|
directives: this.parseDirectives(!1),
|
|
1162
|
-
selectionSet: this.peek(
|
|
1162
|
+
selectionSet: this.peek(u.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
1163
1163
|
});
|
|
1164
1164
|
}
|
|
1165
1165
|
/**
|
|
@@ -1167,16 +1167,16 @@ class Rt {
|
|
|
1167
1167
|
*/
|
|
1168
1168
|
parseArguments(t) {
|
|
1169
1169
|
const n = t ? this.parseConstArgument : this.parseArgument;
|
|
1170
|
-
return this.optionalMany(
|
|
1170
|
+
return this.optionalMany(u.PAREN_L, n, u.PAREN_R);
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
1173
1173
|
* Argument[Const] : Name : Value[?Const]
|
|
1174
1174
|
*/
|
|
1175
1175
|
parseArgument(t = !1) {
|
|
1176
|
-
const n = this._lexer.token,
|
|
1177
|
-
return this.expectToken(
|
|
1176
|
+
const n = this._lexer.token, r = this.parseName();
|
|
1177
|
+
return this.expectToken(u.COLON), this.node(n, {
|
|
1178
1178
|
kind: f.ARGUMENT,
|
|
1179
|
-
name:
|
|
1179
|
+
name: r,
|
|
1180
1180
|
value: this.parseValueLiteral(t)
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
@@ -1193,9 +1193,9 @@ class Rt {
|
|
|
1193
1193
|
*/
|
|
1194
1194
|
parseFragment() {
|
|
1195
1195
|
const t = this._lexer.token;
|
|
1196
|
-
this.expectToken(
|
|
1196
|
+
this.expectToken(u.SPREAD);
|
|
1197
1197
|
const n = this.expectOptionalKeyword("on");
|
|
1198
|
-
return !n && this.peek(
|
|
1198
|
+
return !n && this.peek(u.NAME) ? this.node(t, {
|
|
1199
1199
|
kind: f.FRAGMENT_SPREAD,
|
|
1200
1200
|
name: this.parseFragmentName(),
|
|
1201
1201
|
directives: this.parseDirectives(!1)
|
|
@@ -1259,24 +1259,24 @@ class Rt {
|
|
|
1259
1259
|
parseValueLiteral(t) {
|
|
1260
1260
|
const n = this._lexer.token;
|
|
1261
1261
|
switch (n.kind) {
|
|
1262
|
-
case
|
|
1262
|
+
case u.BRACKET_L:
|
|
1263
1263
|
return this.parseList(t);
|
|
1264
|
-
case
|
|
1264
|
+
case u.BRACE_L:
|
|
1265
1265
|
return this.parseObject(t);
|
|
1266
|
-
case
|
|
1266
|
+
case u.INT:
|
|
1267
1267
|
return this.advanceLexer(), this.node(n, {
|
|
1268
1268
|
kind: f.INT,
|
|
1269
1269
|
value: n.value
|
|
1270
1270
|
});
|
|
1271
|
-
case
|
|
1271
|
+
case u.FLOAT:
|
|
1272
1272
|
return this.advanceLexer(), this.node(n, {
|
|
1273
1273
|
kind: f.FLOAT,
|
|
1274
1274
|
value: n.value
|
|
1275
1275
|
});
|
|
1276
|
-
case
|
|
1277
|
-
case
|
|
1276
|
+
case u.STRING:
|
|
1277
|
+
case u.BLOCK_STRING:
|
|
1278
1278
|
return this.parseStringLiteral();
|
|
1279
|
-
case
|
|
1279
|
+
case u.NAME:
|
|
1280
1280
|
switch (this.advanceLexer(), n.value) {
|
|
1281
1281
|
case "true":
|
|
1282
1282
|
return this.node(n, {
|
|
@@ -1298,14 +1298,14 @@ class Rt {
|
|
|
1298
1298
|
value: n.value
|
|
1299
1299
|
});
|
|
1300
1300
|
}
|
|
1301
|
-
case
|
|
1301
|
+
case u.DOLLAR:
|
|
1302
1302
|
if (t)
|
|
1303
|
-
if (this.expectToken(
|
|
1304
|
-
const
|
|
1303
|
+
if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
|
|
1304
|
+
const r = this._lexer.token.value;
|
|
1305
1305
|
throw x(
|
|
1306
1306
|
this._lexer.source,
|
|
1307
1307
|
n.start,
|
|
1308
|
-
`Unexpected variable "$${
|
|
1308
|
+
`Unexpected variable "$${r}" in constant value.`
|
|
1309
1309
|
);
|
|
1310
1310
|
} else
|
|
1311
1311
|
throw this.unexpected(n);
|
|
@@ -1322,7 +1322,7 @@ class Rt {
|
|
|
1322
1322
|
return this.advanceLexer(), this.node(t, {
|
|
1323
1323
|
kind: f.STRING,
|
|
1324
1324
|
value: t.value,
|
|
1325
|
-
block: t.kind ===
|
|
1325
|
+
block: t.kind === u.BLOCK_STRING
|
|
1326
1326
|
});
|
|
1327
1327
|
}
|
|
1328
1328
|
/**
|
|
@@ -1334,7 +1334,7 @@ class Rt {
|
|
|
1334
1334
|
const n = () => this.parseValueLiteral(t);
|
|
1335
1335
|
return this.node(this._lexer.token, {
|
|
1336
1336
|
kind: f.LIST,
|
|
1337
|
-
values: this.any(
|
|
1337
|
+
values: this.any(u.BRACKET_L, n, u.BRACKET_R)
|
|
1338
1338
|
});
|
|
1339
1339
|
}
|
|
1340
1340
|
/**
|
|
@@ -1348,17 +1348,17 @@ class Rt {
|
|
|
1348
1348
|
const n = () => this.parseObjectField(t);
|
|
1349
1349
|
return this.node(this._lexer.token, {
|
|
1350
1350
|
kind: f.OBJECT,
|
|
1351
|
-
fields: this.any(
|
|
1351
|
+
fields: this.any(u.BRACE_L, n, u.BRACE_R)
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
1354
|
/**
|
|
1355
1355
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1356
1356
|
*/
|
|
1357
1357
|
parseObjectField(t) {
|
|
1358
|
-
const n = this._lexer.token,
|
|
1359
|
-
return this.expectToken(
|
|
1358
|
+
const n = this._lexer.token, r = this.parseName();
|
|
1359
|
+
return this.expectToken(u.COLON), this.node(n, {
|
|
1360
1360
|
kind: f.OBJECT_FIELD,
|
|
1361
|
-
name:
|
|
1361
|
+
name: r,
|
|
1362
1362
|
value: this.parseValueLiteral(t)
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
@@ -1368,7 +1368,7 @@ class Rt {
|
|
|
1368
1368
|
*/
|
|
1369
1369
|
parseDirectives(t) {
|
|
1370
1370
|
const n = [];
|
|
1371
|
-
for (; this.peek(
|
|
1371
|
+
for (; this.peek(u.AT); )
|
|
1372
1372
|
n.push(this.parseDirective(t));
|
|
1373
1373
|
return n;
|
|
1374
1374
|
}
|
|
@@ -1382,7 +1382,7 @@ class Rt {
|
|
|
1382
1382
|
*/
|
|
1383
1383
|
parseDirective(t) {
|
|
1384
1384
|
const n = this._lexer.token;
|
|
1385
|
-
return this.expectToken(
|
|
1385
|
+
return this.expectToken(u.AT), this.node(n, {
|
|
1386
1386
|
kind: f.DIRECTIVE,
|
|
1387
1387
|
name: this.parseName(),
|
|
1388
1388
|
arguments: this.parseArguments(t)
|
|
@@ -1398,15 +1398,15 @@ class Rt {
|
|
|
1398
1398
|
parseTypeReference() {
|
|
1399
1399
|
const t = this._lexer.token;
|
|
1400
1400
|
let n;
|
|
1401
|
-
if (this.expectOptionalToken(
|
|
1402
|
-
const
|
|
1403
|
-
this.expectToken(
|
|
1401
|
+
if (this.expectOptionalToken(u.BRACKET_L)) {
|
|
1402
|
+
const r = this.parseTypeReference();
|
|
1403
|
+
this.expectToken(u.BRACKET_R), n = this.node(t, {
|
|
1404
1404
|
kind: f.LIST_TYPE,
|
|
1405
|
-
type:
|
|
1405
|
+
type: r
|
|
1406
1406
|
});
|
|
1407
1407
|
} else
|
|
1408
1408
|
n = this.parseNamedType();
|
|
1409
|
-
return this.expectOptionalToken(
|
|
1409
|
+
return this.expectOptionalToken(u.BANG) ? this.node(t, {
|
|
1410
1410
|
kind: f.NON_NULL_TYPE,
|
|
1411
1411
|
type: n
|
|
1412
1412
|
}) : n;
|
|
@@ -1422,7 +1422,7 @@ class Rt {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
// Implements the parsing rules in the Type Definition section.
|
|
1424
1424
|
peekDescription() {
|
|
1425
|
-
return this.peek(
|
|
1425
|
+
return this.peek(u.STRING) || this.peek(u.BLOCK_STRING);
|
|
1426
1426
|
}
|
|
1427
1427
|
/**
|
|
1428
1428
|
* Description : StringValue
|
|
@@ -1439,16 +1439,16 @@ class Rt {
|
|
|
1439
1439
|
parseSchemaDefinition() {
|
|
1440
1440
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1441
1441
|
this.expectKeyword("schema");
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1442
|
+
const r = this.parseConstDirectives(), i = this.many(
|
|
1443
|
+
u.BRACE_L,
|
|
1444
1444
|
this.parseOperationTypeDefinition,
|
|
1445
|
-
|
|
1445
|
+
u.BRACE_R
|
|
1446
1446
|
);
|
|
1447
1447
|
return this.node(t, {
|
|
1448
1448
|
kind: f.SCHEMA_DEFINITION,
|
|
1449
1449
|
description: n,
|
|
1450
|
-
directives:
|
|
1451
|
-
operationTypes:
|
|
1450
|
+
directives: r,
|
|
1451
|
+
operationTypes: i
|
|
1452
1452
|
});
|
|
1453
1453
|
}
|
|
1454
1454
|
/**
|
|
@@ -1456,12 +1456,12 @@ class Rt {
|
|
|
1456
1456
|
*/
|
|
1457
1457
|
parseOperationTypeDefinition() {
|
|
1458
1458
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
1459
|
-
this.expectToken(
|
|
1460
|
-
const
|
|
1459
|
+
this.expectToken(u.COLON);
|
|
1460
|
+
const r = this.parseNamedType();
|
|
1461
1461
|
return this.node(t, {
|
|
1462
1462
|
kind: f.OPERATION_TYPE_DEFINITION,
|
|
1463
1463
|
operation: n,
|
|
1464
|
-
type:
|
|
1464
|
+
type: r
|
|
1465
1465
|
});
|
|
1466
1466
|
}
|
|
1467
1467
|
/**
|
|
@@ -1470,12 +1470,12 @@ class Rt {
|
|
|
1470
1470
|
parseScalarTypeDefinition() {
|
|
1471
1471
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1472
1472
|
this.expectKeyword("scalar");
|
|
1473
|
-
const
|
|
1473
|
+
const r = this.parseName(), i = 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: r,
|
|
1478
|
+
directives: i
|
|
1479
1479
|
});
|
|
1480
1480
|
}
|
|
1481
1481
|
/**
|
|
@@ -1486,12 +1486,12 @@ class Rt {
|
|
|
1486
1486
|
parseObjectTypeDefinition() {
|
|
1487
1487
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1488
1488
|
this.expectKeyword("type");
|
|
1489
|
-
const
|
|
1489
|
+
const r = this.parseName(), i = 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: r,
|
|
1494
|
+
interfaces: i,
|
|
1495
1495
|
directives: s,
|
|
1496
1496
|
fields: o
|
|
1497
1497
|
});
|
|
@@ -1502,7 +1502,7 @@ class Rt {
|
|
|
1502
1502
|
* - ImplementsInterfaces & NamedType
|
|
1503
1503
|
*/
|
|
1504
1504
|
parseImplementsInterfaces() {
|
|
1505
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(
|
|
1505
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(u.AMP, this.parseNamedType) : [];
|
|
1506
1506
|
}
|
|
1507
1507
|
/**
|
|
1508
1508
|
* ```
|
|
@@ -1511,9 +1511,9 @@ class Rt {
|
|
|
1511
1511
|
*/
|
|
1512
1512
|
parseFieldsDefinition() {
|
|
1513
1513
|
return this.optionalMany(
|
|
1514
|
-
|
|
1514
|
+
u.BRACE_L,
|
|
1515
1515
|
this.parseFieldDefinition,
|
|
1516
|
-
|
|
1516
|
+
u.BRACE_R
|
|
1517
1517
|
);
|
|
1518
1518
|
}
|
|
1519
1519
|
/**
|
|
@@ -1521,14 +1521,14 @@ class Rt {
|
|
|
1521
1521
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1522
1522
|
*/
|
|
1523
1523
|
parseFieldDefinition() {
|
|
1524
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1525
|
-
this.expectToken(
|
|
1524
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
|
|
1525
|
+
this.expectToken(u.COLON);
|
|
1526
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: r,
|
|
1531
|
+
arguments: i,
|
|
1532
1532
|
type: s,
|
|
1533
1533
|
directives: o
|
|
1534
1534
|
});
|
|
@@ -1538,9 +1538,9 @@ class Rt {
|
|
|
1538
1538
|
*/
|
|
1539
1539
|
parseArgumentDefs() {
|
|
1540
1540
|
return this.optionalMany(
|
|
1541
|
-
|
|
1541
|
+
u.PAREN_L,
|
|
1542
1542
|
this.parseInputValueDef,
|
|
1543
|
-
|
|
1543
|
+
u.PAREN_R
|
|
1544
1544
|
);
|
|
1545
1545
|
}
|
|
1546
1546
|
/**
|
|
@@ -1548,17 +1548,17 @@ class Rt {
|
|
|
1548
1548
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1549
1549
|
*/
|
|
1550
1550
|
parseInputValueDef() {
|
|
1551
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1552
|
-
this.expectToken(
|
|
1553
|
-
const
|
|
1551
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
|
|
1552
|
+
this.expectToken(u.COLON);
|
|
1553
|
+
const i = this.parseTypeReference();
|
|
1554
1554
|
let s;
|
|
1555
|
-
this.expectOptionalToken(
|
|
1555
|
+
this.expectOptionalToken(u.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1556
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: r,
|
|
1561
|
+
type: i,
|
|
1562
1562
|
defaultValue: s,
|
|
1563
1563
|
directives: o
|
|
1564
1564
|
});
|
|
@@ -1570,12 +1570,12 @@ class Rt {
|
|
|
1570
1570
|
parseInterfaceTypeDefinition() {
|
|
1571
1571
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1572
1572
|
this.expectKeyword("interface");
|
|
1573
|
-
const
|
|
1573
|
+
const r = this.parseName(), i = 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: r,
|
|
1578
|
+
interfaces: i,
|
|
1579
1579
|
directives: s,
|
|
1580
1580
|
fields: o
|
|
1581
1581
|
});
|
|
@@ -1587,12 +1587,12 @@ class Rt {
|
|
|
1587
1587
|
parseUnionTypeDefinition() {
|
|
1588
1588
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1589
1589
|
this.expectKeyword("union");
|
|
1590
|
-
const
|
|
1590
|
+
const r = this.parseName(), i = 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: r,
|
|
1595
|
+
directives: i,
|
|
1596
1596
|
types: s
|
|
1597
1597
|
});
|
|
1598
1598
|
}
|
|
@@ -1602,7 +1602,7 @@ class Rt {
|
|
|
1602
1602
|
* - UnionMemberTypes | NamedType
|
|
1603
1603
|
*/
|
|
1604
1604
|
parseUnionMemberTypes() {
|
|
1605
|
-
return this.expectOptionalToken(
|
|
1605
|
+
return this.expectOptionalToken(u.EQUALS) ? this.delimitedMany(u.PIPE, this.parseNamedType) : [];
|
|
1606
1606
|
}
|
|
1607
1607
|
/**
|
|
1608
1608
|
* EnumTypeDefinition :
|
|
@@ -1611,12 +1611,12 @@ class Rt {
|
|
|
1611
1611
|
parseEnumTypeDefinition() {
|
|
1612
1612
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1613
1613
|
this.expectKeyword("enum");
|
|
1614
|
-
const
|
|
1614
|
+
const r = this.parseName(), i = 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: r,
|
|
1619
|
+
directives: i,
|
|
1620
1620
|
values: s
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
@@ -1627,21 +1627,21 @@ class Rt {
|
|
|
1627
1627
|
*/
|
|
1628
1628
|
parseEnumValuesDefinition() {
|
|
1629
1629
|
return this.optionalMany(
|
|
1630
|
-
|
|
1630
|
+
u.BRACE_L,
|
|
1631
1631
|
this.parseEnumValueDefinition,
|
|
1632
|
-
|
|
1632
|
+
u.BRACE_R
|
|
1633
1633
|
);
|
|
1634
1634
|
}
|
|
1635
1635
|
/**
|
|
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(), r = this.parseEnumValueName(), i = 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: r,
|
|
1644
|
+
directives: i
|
|
1645
1645
|
});
|
|
1646
1646
|
}
|
|
1647
1647
|
/**
|
|
@@ -1665,12 +1665,12 @@ class Rt {
|
|
|
1665
1665
|
parseInputObjectTypeDefinition() {
|
|
1666
1666
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1667
1667
|
this.expectKeyword("input");
|
|
1668
|
-
const
|
|
1668
|
+
const r = this.parseName(), i = 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: r,
|
|
1673
|
+
directives: i,
|
|
1674
1674
|
fields: s
|
|
1675
1675
|
});
|
|
1676
1676
|
}
|
|
@@ -1681,9 +1681,9 @@ class Rt {
|
|
|
1681
1681
|
*/
|
|
1682
1682
|
parseInputFieldsDefinition() {
|
|
1683
1683
|
return this.optionalMany(
|
|
1684
|
-
|
|
1684
|
+
u.BRACE_L,
|
|
1685
1685
|
this.parseInputValueDef,
|
|
1686
|
-
|
|
1686
|
+
u.BRACE_R
|
|
1687
1687
|
);
|
|
1688
1688
|
}
|
|
1689
1689
|
/**
|
|
@@ -1701,7 +1701,7 @@ class Rt {
|
|
|
1701
1701
|
*/
|
|
1702
1702
|
parseTypeSystemExtension() {
|
|
1703
1703
|
const t = this._lexer.lookahead();
|
|
1704
|
-
if (t.kind ===
|
|
1704
|
+
if (t.kind === u.NAME)
|
|
1705
1705
|
switch (t.value) {
|
|
1706
1706
|
case "schema":
|
|
1707
1707
|
return this.parseSchemaExtension();
|
|
@@ -1730,17 +1730,17 @@ class Rt {
|
|
|
1730
1730
|
parseSchemaExtension() {
|
|
1731
1731
|
const t = this._lexer.token;
|
|
1732
1732
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1733
|
-
const n = this.parseConstDirectives(),
|
|
1734
|
-
|
|
1733
|
+
const n = this.parseConstDirectives(), r = this.optionalMany(
|
|
1734
|
+
u.BRACE_L,
|
|
1735
1735
|
this.parseOperationTypeDefinition,
|
|
1736
|
-
|
|
1736
|
+
u.BRACE_R
|
|
1737
1737
|
);
|
|
1738
|
-
if (n.length === 0 &&
|
|
1738
|
+
if (n.length === 0 && r.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: r
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
/**
|
|
@@ -1750,13 +1750,13 @@ class Rt {
|
|
|
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(), r = this.parseConstDirectives();
|
|
1754
|
+
if (r.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: r
|
|
1760
1760
|
});
|
|
1761
1761
|
}
|
|
1762
1762
|
/**
|
|
@@ -1768,14 +1768,14 @@ class Rt {
|
|
|
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(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1772
|
+
if (r.length === 0 && i.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: r,
|
|
1778
|
+
directives: i,
|
|
1779
1779
|
fields: s
|
|
1780
1780
|
});
|
|
1781
1781
|
}
|
|
@@ -1788,14 +1788,14 @@ class Rt {
|
|
|
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(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1792
|
+
if (r.length === 0 && i.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: r,
|
|
1798
|
+
directives: i,
|
|
1799
1799
|
fields: s
|
|
1800
1800
|
});
|
|
1801
1801
|
}
|
|
@@ -1807,14 +1807,14 @@ class Rt {
|
|
|
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(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
|
|
1811
|
+
if (r.length === 0 && i.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: r,
|
|
1817
|
+
types: i
|
|
1818
1818
|
});
|
|
1819
1819
|
}
|
|
1820
1820
|
/**
|
|
@@ -1825,14 +1825,14 @@ class Rt {
|
|
|
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(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
|
|
1829
|
+
if (r.length === 0 && i.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: r,
|
|
1835
|
+
values: i
|
|
1836
1836
|
});
|
|
1837
1837
|
}
|
|
1838
1838
|
/**
|
|
@@ -1843,14 +1843,14 @@ class Rt {
|
|
|
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(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
|
|
1847
|
+
if (r.length === 0 && i.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: r,
|
|
1853
|
+
fields: i
|
|
1854
1854
|
});
|
|
1855
1855
|
}
|
|
1856
1856
|
/**
|
|
@@ -1861,15 +1861,15 @@ class Rt {
|
|
|
1861
1861
|
*/
|
|
1862
1862
|
parseDirectiveDefinition() {
|
|
1863
1863
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1864
|
-
this.expectKeyword("directive"), this.expectToken(
|
|
1865
|
-
const
|
|
1864
|
+
this.expectKeyword("directive"), this.expectToken(u.AT);
|
|
1865
|
+
const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1866
1866
|
this.expectKeyword("on");
|
|
1867
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: r,
|
|
1872
|
+
arguments: i,
|
|
1873
1873
|
repeatable: s,
|
|
1874
1874
|
locations: o
|
|
1875
1875
|
});
|
|
@@ -1880,7 +1880,7 @@ class Rt {
|
|
|
1880
1880
|
* - DirectiveLocations | DirectiveLocation
|
|
1881
1881
|
*/
|
|
1882
1882
|
parseDirectiveLocations() {
|
|
1883
|
-
return this.delimitedMany(
|
|
1883
|
+
return this.delimitedMany(u.PIPE, this.parseDirectiveLocation);
|
|
1884
1884
|
}
|
|
1885
1885
|
/*
|
|
1886
1886
|
* DirectiveLocation :
|
|
@@ -1961,7 +1961,7 @@ class Rt {
|
|
|
1961
1961
|
*/
|
|
1962
1962
|
expectKeyword(t) {
|
|
1963
1963
|
const n = this._lexer.token;
|
|
1964
|
-
if (n.kind ===
|
|
1964
|
+
if (n.kind === u.NAME && n.value === t)
|
|
1965
1965
|
this.advanceLexer();
|
|
1966
1966
|
else
|
|
1967
1967
|
throw x(
|
|
@@ -1976,7 +1976,7 @@ class Rt {
|
|
|
1976
1976
|
*/
|
|
1977
1977
|
expectOptionalKeyword(t) {
|
|
1978
1978
|
const n = this._lexer.token;
|
|
1979
|
-
return n.kind ===
|
|
1979
|
+
return n.kind === u.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
|
|
1980
1980
|
}
|
|
1981
1981
|
/**
|
|
1982
1982
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
@@ -1994,12 +1994,12 @@ class Rt {
|
|
|
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, r) {
|
|
1998
1998
|
this.expectToken(t);
|
|
1999
|
-
const
|
|
2000
|
-
for (; !this.expectOptionalToken(
|
|
2001
|
-
|
|
2002
|
-
return
|
|
1999
|
+
const i = [];
|
|
2000
|
+
for (; !this.expectOptionalToken(r); )
|
|
2001
|
+
i.push(n.call(this));
|
|
2002
|
+
return i;
|
|
2003
2003
|
}
|
|
2004
2004
|
/**
|
|
2005
2005
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -2007,13 +2007,13 @@ class Rt {
|
|
|
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, r) {
|
|
2011
2011
|
if (this.expectOptionalToken(t)) {
|
|
2012
|
-
const
|
|
2012
|
+
const i = [];
|
|
2013
2013
|
do
|
|
2014
|
-
|
|
2015
|
-
while (!this.expectOptionalToken(
|
|
2016
|
-
return
|
|
2014
|
+
i.push(n.call(this));
|
|
2015
|
+
while (!this.expectOptionalToken(r));
|
|
2016
|
+
return i;
|
|
2017
2017
|
}
|
|
2018
2018
|
return [];
|
|
2019
2019
|
}
|
|
@@ -2022,13 +2022,13 @@ class Rt {
|
|
|
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, r) {
|
|
2026
2026
|
this.expectToken(t);
|
|
2027
|
-
const
|
|
2027
|
+
const i = [];
|
|
2028
2028
|
do
|
|
2029
|
-
|
|
2030
|
-
while (!this.expectOptionalToken(
|
|
2031
|
-
return
|
|
2029
|
+
i.push(n.call(this));
|
|
2030
|
+
while (!this.expectOptionalToken(r));
|
|
2031
|
+
return i;
|
|
2032
2032
|
}
|
|
2033
2033
|
/**
|
|
2034
2034
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
@@ -2037,15 +2037,15 @@ class Rt {
|
|
|
2037
2037
|
*/
|
|
2038
2038
|
delimitedMany(t, n) {
|
|
2039
2039
|
this.expectOptionalToken(t);
|
|
2040
|
-
const
|
|
2040
|
+
const r = [];
|
|
2041
2041
|
do
|
|
2042
|
-
|
|
2042
|
+
r.push(n.call(this));
|
|
2043
2043
|
while (this.expectOptionalToken(t));
|
|
2044
|
-
return
|
|
2044
|
+
return r;
|
|
2045
2045
|
}
|
|
2046
2046
|
advanceLexer() {
|
|
2047
2047
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2048
|
-
if (t !== void 0 && n.kind !==
|
|
2048
|
+
if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
2049
2049
|
throw x(
|
|
2050
2050
|
this._lexer.source,
|
|
2051
2051
|
n.start,
|
|
@@ -2060,14 +2060,14 @@ function W(e) {
|
|
|
2060
2060
|
function Me(e) {
|
|
2061
2061
|
return dt(e) ? `"${e}"` : e;
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2064
|
-
return `"${e.replace(
|
|
2063
|
+
function Rt(e) {
|
|
2064
|
+
return `"${e.replace(_t, kt)}"`;
|
|
2065
2065
|
}
|
|
2066
|
-
const
|
|
2066
|
+
const _t = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2067
2067
|
function kt(e) {
|
|
2068
|
-
return
|
|
2068
|
+
return Pt[e.charCodeAt(0)];
|
|
2069
2069
|
}
|
|
2070
|
-
const
|
|
2070
|
+
const Pt = [
|
|
2071
2071
|
"\\u0000",
|
|
2072
2072
|
"\\u0001",
|
|
2073
2073
|
"\\u0002",
|
|
@@ -2233,18 +2233,18 @@ const wt = [
|
|
|
2233
2233
|
"\\u009D",
|
|
2234
2234
|
"\\u009E",
|
|
2235
2235
|
"\\u009F"
|
|
2236
|
-
],
|
|
2237
|
-
function
|
|
2238
|
-
const
|
|
2239
|
-
for (const
|
|
2240
|
-
|
|
2241
|
-
let
|
|
2242
|
-
const
|
|
2236
|
+
], wt = Object.freeze({});
|
|
2237
|
+
function Lt(e, t, n = _e) {
|
|
2238
|
+
const r = /* @__PURE__ */ new Map();
|
|
2239
|
+
for (const O of Object.values(f))
|
|
2240
|
+
r.set(O, Ft(t, O));
|
|
2241
|
+
let i, s = Array.isArray(e), o = [e], c = -1, h = [], p = e, m, y;
|
|
2242
|
+
const C = [], T = [];
|
|
2243
2243
|
do {
|
|
2244
|
-
|
|
2245
|
-
const
|
|
2246
|
-
if (
|
|
2247
|
-
if (m = T.length === 0 ? void 0 :
|
|
2244
|
+
c++;
|
|
2245
|
+
const O = c === o.length, z = O && h.length !== 0;
|
|
2246
|
+
if (O) {
|
|
2247
|
+
if (m = T.length === 0 ? void 0 : C[C.length - 1], p = y, y = T.pop(), z)
|
|
2248
2248
|
if (s) {
|
|
2249
2249
|
p = p.slice();
|
|
2250
2250
|
let _ = 0;
|
|
@@ -2260,45 +2260,45 @@ function Pt(e, t, n = Se) {
|
|
|
2260
2260
|
for (const [_, U] of h)
|
|
2261
2261
|
p[_] = U;
|
|
2262
2262
|
}
|
|
2263
|
-
|
|
2264
|
-
} else if (
|
|
2265
|
-
if (m = s ?
|
|
2263
|
+
c = i.index, o = i.keys, h = i.edits, s = i.inArray, i = i.prev;
|
|
2264
|
+
} else if (y) {
|
|
2265
|
+
if (m = s ? c : o[c], p = y[m], p == null)
|
|
2266
2266
|
continue;
|
|
2267
|
-
|
|
2267
|
+
C.push(m);
|
|
2268
2268
|
}
|
|
2269
|
-
let
|
|
2269
|
+
let P;
|
|
2270
2270
|
if (!Array.isArray(p)) {
|
|
2271
|
-
var
|
|
2271
|
+
var g, N;
|
|
2272
2272
|
be(p) || Z(!1, `Invalid AST Node: ${ve(p)}.`);
|
|
2273
|
-
const _ =
|
|
2274
|
-
if (
|
|
2273
|
+
const _ = O ? (g = r.get(p.kind)) === null || g === void 0 ? void 0 : g.leave : (N = r.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
|
|
2274
|
+
if (P = _ == null ? void 0 : _.call(t, p, m, y, C, T), P === wt)
|
|
2275
2275
|
break;
|
|
2276
|
-
if (
|
|
2277
|
-
if (!
|
|
2278
|
-
|
|
2276
|
+
if (P === !1) {
|
|
2277
|
+
if (!O) {
|
|
2278
|
+
C.pop();
|
|
2279
2279
|
continue;
|
|
2280
2280
|
}
|
|
2281
|
-
} else if (
|
|
2282
|
-
if (be(
|
|
2283
|
-
p =
|
|
2281
|
+
} else if (P !== void 0 && (h.push([m, P]), !O))
|
|
2282
|
+
if (be(P))
|
|
2283
|
+
p = P;
|
|
2284
2284
|
else {
|
|
2285
|
-
|
|
2285
|
+
C.pop();
|
|
2286
2286
|
continue;
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
|
-
if (
|
|
2290
|
-
|
|
2289
|
+
if (P === void 0 && z && h.push([m, p]), O)
|
|
2290
|
+
C.pop();
|
|
2291
2291
|
else {
|
|
2292
|
-
var
|
|
2293
|
-
|
|
2292
|
+
var D;
|
|
2293
|
+
i = {
|
|
2294
2294
|
inArray: s,
|
|
2295
|
-
index:
|
|
2295
|
+
index: c,
|
|
2296
2296
|
keys: o,
|
|
2297
2297
|
edits: h,
|
|
2298
|
-
prev:
|
|
2299
|
-
}, s = Array.isArray(p), o = s ? p : (
|
|
2298
|
+
prev: i
|
|
2299
|
+
}, s = Array.isArray(p), o = s ? p : (D = n[p.kind]) !== null && D !== void 0 ? D : [], c = -1, h = [], y && T.push(y), y = p;
|
|
2300
2300
|
}
|
|
2301
|
-
} while (
|
|
2301
|
+
} while (i !== void 0);
|
|
2302
2302
|
return h.length !== 0 ? h[h.length - 1][1] : e;
|
|
2303
2303
|
}
|
|
2304
2304
|
function Ft(e, t) {
|
|
@@ -2312,7 +2312,7 @@ function Ft(e, t) {
|
|
|
2312
2312
|
};
|
|
2313
2313
|
}
|
|
2314
2314
|
function Ut(e) {
|
|
2315
|
-
return
|
|
2315
|
+
return Lt(e, Mt);
|
|
2316
2316
|
}
|
|
2317
2317
|
const Bt = 80, Mt = {
|
|
2318
2318
|
Name: {
|
|
@@ -2341,19 +2341,19 @@ const Bt = 80, Mt = {
|
|
|
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: r }) => e + ": " + t + v(" = ", n) + v(" ", d(r, " "))
|
|
2345
2345
|
},
|
|
2346
2346
|
SelectionSet: {
|
|
2347
|
-
leave: ({ selections: e }) =>
|
|
2347
|
+
leave: ({ selections: e }) => k(e)
|
|
2348
2348
|
},
|
|
2349
2349
|
Field: {
|
|
2350
|
-
leave({ alias: e, name: t, arguments: n, directives:
|
|
2350
|
+
leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
|
|
2351
2351
|
const s = v("", e, ": ") + t;
|
|
2352
2352
|
let o = s + v("(", d(n, ", "), ")");
|
|
2353
2353
|
return o.length > Bt && (o = s + v(`(
|
|
2354
2354
|
`, K(d(n, `
|
|
2355
2355
|
`)), `
|
|
2356
|
-
)`)), d([o, d(
|
|
2356
|
+
)`)), d([o, d(r, " "), i], " ");
|
|
2357
2357
|
}
|
|
2358
2358
|
},
|
|
2359
2359
|
Argument: {
|
|
@@ -2375,9 +2375,9 @@ const Bt = 80, Mt = {
|
|
|
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: r, selectionSet: i }) => (
|
|
2379
2379
|
// or removed in the future.
|
|
2380
|
-
`fragment ${e}${v("(", d(n, ", "), ")")} on ${t} ${v("", d(
|
|
2380
|
+
`fragment ${e}${v("(", d(n, ", "), ")")} on ${t} ${v("", d(r, " "), " ")}` + i
|
|
2381
2381
|
)
|
|
2382
2382
|
},
|
|
2383
2383
|
// Value
|
|
@@ -2388,7 +2388,7 @@ const Bt = 80, Mt = {
|
|
|
2388
2388
|
leave: ({ value: e }) => e
|
|
2389
2389
|
},
|
|
2390
2390
|
StringValue: {
|
|
2391
|
-
leave: ({ value: e, block: t }) => t ?
|
|
2391
|
+
leave: ({ value: e, block: t }) => t ? ct(e) : Rt(e)
|
|
2392
2392
|
},
|
|
2393
2393
|
BooleanValue: {
|
|
2394
2394
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2425,7 +2425,7 @@ const Bt = 80, Mt = {
|
|
|
2425
2425
|
// Type System Definitions
|
|
2426
2426
|
SchemaDefinition: {
|
|
2427
2427
|
leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
|
|
2428
|
-
`) + d(["schema", d(t, " "),
|
|
2428
|
+
`) + d(["schema", d(t, " "), k(n)], " ")
|
|
2429
2429
|
},
|
|
2430
2430
|
OperationTypeDefinition: {
|
|
2431
2431
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
@@ -2435,74 +2435,74 @@ const Bt = 80, Mt = {
|
|
|
2435
2435
|
`) + d(["scalar", t, d(n, " ")], " ")
|
|
2436
2436
|
},
|
|
2437
2437
|
ObjectTypeDefinition: {
|
|
2438
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2438
|
+
leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => v("", e, `
|
|
2439
2439
|
`) + d(
|
|
2440
2440
|
[
|
|
2441
2441
|
"type",
|
|
2442
2442
|
t,
|
|
2443
2443
|
v("implements ", d(n, " & ")),
|
|
2444
|
-
d(
|
|
2445
|
-
|
|
2444
|
+
d(r, " "),
|
|
2445
|
+
k(i)
|
|
2446
2446
|
],
|
|
2447
2447
|
" "
|
|
2448
2448
|
)
|
|
2449
2449
|
},
|
|
2450
2450
|
FieldDefinition: {
|
|
2451
|
-
leave: ({ description: e, name: t, arguments: n, type:
|
|
2451
|
+
leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
|
|
2452
2452
|
`) + t + (Ie(n) ? v(`(
|
|
2453
2453
|
`, K(d(n, `
|
|
2454
2454
|
`)), `
|
|
2455
|
-
)`) : v("(", d(n, ", "), ")")) + ": " +
|
|
2455
|
+
)`) : v("(", d(n, ", "), ")")) + ": " + r + v(" ", d(i, " "))
|
|
2456
2456
|
},
|
|
2457
2457
|
InputValueDefinition: {
|
|
2458
|
-
leave: ({ description: e, name: t, type: n, defaultValue:
|
|
2458
|
+
leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => v("", e, `
|
|
2459
2459
|
`) + d(
|
|
2460
|
-
[t + ": " + n, v("= ",
|
|
2460
|
+
[t + ": " + n, v("= ", r), d(i, " ")],
|
|
2461
2461
|
" "
|
|
2462
2462
|
)
|
|
2463
2463
|
},
|
|
2464
2464
|
InterfaceTypeDefinition: {
|
|
2465
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2465
|
+
leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => v("", e, `
|
|
2466
2466
|
`) + d(
|
|
2467
2467
|
[
|
|
2468
2468
|
"interface",
|
|
2469
2469
|
t,
|
|
2470
2470
|
v("implements ", d(n, " & ")),
|
|
2471
|
-
d(
|
|
2472
|
-
|
|
2471
|
+
d(r, " "),
|
|
2472
|
+
k(i)
|
|
2473
2473
|
],
|
|
2474
2474
|
" "
|
|
2475
2475
|
)
|
|
2476
2476
|
},
|
|
2477
2477
|
UnionTypeDefinition: {
|
|
2478
|
-
leave: ({ description: e, name: t, directives: n, types:
|
|
2478
|
+
leave: ({ description: e, name: t, directives: n, types: r }) => v("", e, `
|
|
2479
2479
|
`) + d(
|
|
2480
|
-
["union", t, d(n, " "), v("= ", d(
|
|
2480
|
+
["union", t, d(n, " "), v("= ", d(r, " | "))],
|
|
2481
2481
|
" "
|
|
2482
2482
|
)
|
|
2483
2483
|
},
|
|
2484
2484
|
EnumTypeDefinition: {
|
|
2485
|
-
leave: ({ description: e, name: t, directives: n, values:
|
|
2486
|
-
`) + d(["enum", t, d(n, " "),
|
|
2485
|
+
leave: ({ description: e, name: t, directives: n, values: r }) => v("", e, `
|
|
2486
|
+
`) + d(["enum", t, d(n, " "), k(r)], " ")
|
|
2487
2487
|
},
|
|
2488
2488
|
EnumValueDefinition: {
|
|
2489
2489
|
leave: ({ description: e, name: t, directives: n }) => v("", e, `
|
|
2490
2490
|
`) + d([t, d(n, " ")], " ")
|
|
2491
2491
|
},
|
|
2492
2492
|
InputObjectTypeDefinition: {
|
|
2493
|
-
leave: ({ description: e, name: t, directives: n, fields:
|
|
2494
|
-
`) + d(["input", t, d(n, " "),
|
|
2493
|
+
leave: ({ description: e, name: t, directives: n, fields: r }) => v("", e, `
|
|
2494
|
+
`) + d(["input", t, d(n, " "), k(r)], " ")
|
|
2495
2495
|
},
|
|
2496
2496
|
DirectiveDefinition: {
|
|
2497
|
-
leave: ({ description: e, name: t, arguments: n, repeatable:
|
|
2497
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
|
|
2498
2498
|
`) + "directive @" + t + (Ie(n) ? v(`(
|
|
2499
2499
|
`, K(d(n, `
|
|
2500
2500
|
`)), `
|
|
2501
|
-
)`) : v("(", d(n, ", "), ")")) + (
|
|
2501
|
+
)`) : v("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
|
|
2502
2502
|
},
|
|
2503
2503
|
SchemaExtension: {
|
|
2504
2504
|
leave: ({ directives: e, operationTypes: t }) => d(
|
|
2505
|
-
["extend schema", d(e, " "),
|
|
2505
|
+
["extend schema", d(e, " "), k(t)],
|
|
2506
2506
|
" "
|
|
2507
2507
|
)
|
|
2508
2508
|
},
|
|
@@ -2510,25 +2510,25 @@ const Bt = 80, Mt = {
|
|
|
2510
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: r }) => d(
|
|
2514
2514
|
[
|
|
2515
2515
|
"extend type",
|
|
2516
2516
|
e,
|
|
2517
2517
|
v("implements ", d(t, " & ")),
|
|
2518
2518
|
d(n, " "),
|
|
2519
|
-
|
|
2519
|
+
k(r)
|
|
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: r }) => d(
|
|
2526
2526
|
[
|
|
2527
2527
|
"extend interface",
|
|
2528
2528
|
e,
|
|
2529
2529
|
v("implements ", d(t, " & ")),
|
|
2530
2530
|
d(n, " "),
|
|
2531
|
-
|
|
2531
|
+
k(r)
|
|
2532
2532
|
],
|
|
2533
2533
|
" "
|
|
2534
2534
|
)
|
|
@@ -2545,17 +2545,17 @@ const Bt = 80, Mt = {
|
|
|
2545
2545
|
)
|
|
2546
2546
|
},
|
|
2547
2547
|
EnumTypeExtension: {
|
|
2548
|
-
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "),
|
|
2548
|
+
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), k(n)], " ")
|
|
2549
2549
|
},
|
|
2550
2550
|
InputObjectTypeExtension: {
|
|
2551
|
-
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "),
|
|
2551
|
+
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), k(n)], " ")
|
|
2552
2552
|
}
|
|
2553
2553
|
};
|
|
2554
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((r) => r).join(t)) !== null && n !== void 0 ? n : "";
|
|
2557
2557
|
}
|
|
2558
|
-
function
|
|
2558
|
+
function k(e) {
|
|
2559
2559
|
return v(`{
|
|
2560
2560
|
`, K(d(e, `
|
|
2561
2561
|
`)), `
|
|
@@ -2573,44 +2573,44 @@ function Ie(e) {
|
|
|
2573
2573
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2574
2574
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2575
2575
|
}
|
|
2576
|
-
const
|
|
2577
|
-
var
|
|
2576
|
+
const Se = (e) => {
|
|
2577
|
+
var r, i;
|
|
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 = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
|
|
2581
2581
|
}, le = (e) => {
|
|
2582
2582
|
if (typeof e == "string") {
|
|
2583
2583
|
let n;
|
|
2584
2584
|
try {
|
|
2585
|
-
const
|
|
2586
|
-
n =
|
|
2585
|
+
const r = Be(e);
|
|
2586
|
+
n = Se(r);
|
|
2587
2587
|
} catch {
|
|
2588
2588
|
}
|
|
2589
2589
|
return { query: e, operationName: n };
|
|
2590
2590
|
}
|
|
2591
|
-
const t =
|
|
2591
|
+
const t = Se(e);
|
|
2592
2592
|
return { query: Ut(e), operationName: t };
|
|
2593
2593
|
};
|
|
2594
2594
|
class H extends Error {
|
|
2595
2595
|
constructor(t, n) {
|
|
2596
|
-
const
|
|
2596
|
+
const r = `${H.extractMessage(t)}: ${JSON.stringify({
|
|
2597
2597
|
response: t,
|
|
2598
2598
|
request: n
|
|
2599
2599
|
})}`;
|
|
2600
|
-
super(
|
|
2600
|
+
super(r), 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, r;
|
|
2604
|
+
return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.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 : {};
|
|
2608
2608
|
function Vt(e) {
|
|
2609
2609
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2610
2610
|
}
|
|
2611
|
-
var
|
|
2611
|
+
var ge = { exports: {} };
|
|
2612
2612
|
(function(e, t) {
|
|
2613
|
-
var n = typeof self < "u" ? self : qt,
|
|
2613
|
+
var n = typeof self < "u" ? self : qt, r = function() {
|
|
2614
2614
|
function s() {
|
|
2615
2615
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
2616
2616
|
}
|
|
@@ -2618,7 +2618,7 @@ var ye = { exports: {} };
|
|
|
2618
2618
|
}();
|
|
2619
2619
|
(function(s) {
|
|
2620
2620
|
(function(o) {
|
|
2621
|
-
var
|
|
2621
|
+
var c = {
|
|
2622
2622
|
searchParams: "URLSearchParams" in s,
|
|
2623
2623
|
iterable: "Symbol" in s && "iterator" in Symbol,
|
|
2624
2624
|
blob: "FileReader" in s && "Blob" in s && function() {
|
|
@@ -2634,7 +2634,7 @@ var ye = { exports: {} };
|
|
|
2634
2634
|
function h(a) {
|
|
2635
2635
|
return a && DataView.prototype.isPrototypeOf(a);
|
|
2636
2636
|
}
|
|
2637
|
-
if (
|
|
2637
|
+
if (c.arrayBuffer)
|
|
2638
2638
|
var p = [
|
|
2639
2639
|
"[object Int8Array]",
|
|
2640
2640
|
"[object Uint8Array]",
|
|
@@ -2648,91 +2648,91 @@ var ye = { exports: {} };
|
|
|
2648
2648
|
], m = ArrayBuffer.isView || function(a) {
|
|
2649
2649
|
return a && p.indexOf(Object.prototype.toString.call(a)) > -1;
|
|
2650
2650
|
};
|
|
2651
|
-
function
|
|
2651
|
+
function y(a) {
|
|
2652
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
2654
|
return a.toLowerCase();
|
|
2655
2655
|
}
|
|
2656
|
-
function
|
|
2656
|
+
function C(a) {
|
|
2657
2657
|
return typeof a != "string" && (a = String(a)), a;
|
|
2658
2658
|
}
|
|
2659
2659
|
function T(a) {
|
|
2660
2660
|
var l = {
|
|
2661
2661
|
next: function() {
|
|
2662
|
-
var
|
|
2663
|
-
return { done:
|
|
2662
|
+
var E = a.shift();
|
|
2663
|
+
return { done: E === void 0, value: E };
|
|
2664
2664
|
}
|
|
2665
2665
|
};
|
|
2666
|
-
return
|
|
2666
|
+
return c.iterable && (l[Symbol.iterator] = function() {
|
|
2667
2667
|
return l;
|
|
2668
2668
|
}), l;
|
|
2669
2669
|
}
|
|
2670
|
-
function
|
|
2671
|
-
this.map = {}, a instanceof
|
|
2672
|
-
this.append(
|
|
2670
|
+
function g(a) {
|
|
2671
|
+
this.map = {}, a instanceof g ? a.forEach(function(l, E) {
|
|
2672
|
+
this.append(E, l);
|
|
2673
2673
|
}, this) : Array.isArray(a) ? a.forEach(function(l) {
|
|
2674
2674
|
this.append(l[0], l[1]);
|
|
2675
2675
|
}, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
|
|
2676
2676
|
this.append(l, a[l]);
|
|
2677
2677
|
}, this);
|
|
2678
2678
|
}
|
|
2679
|
-
|
|
2680
|
-
a =
|
|
2681
|
-
var
|
|
2682
|
-
this.map[a] =
|
|
2683
|
-
},
|
|
2684
|
-
delete this.map[
|
|
2685
|
-
},
|
|
2686
|
-
return a =
|
|
2687
|
-
},
|
|
2688
|
-
return this.map.hasOwnProperty(
|
|
2689
|
-
},
|
|
2690
|
-
this.map[
|
|
2691
|
-
},
|
|
2692
|
-
for (var
|
|
2693
|
-
this.map.hasOwnProperty(
|
|
2694
|
-
},
|
|
2679
|
+
g.prototype.append = function(a, l) {
|
|
2680
|
+
a = y(a), l = C(l);
|
|
2681
|
+
var E = this.map[a];
|
|
2682
|
+
this.map[a] = E ? E + ", " + l : l;
|
|
2683
|
+
}, g.prototype.delete = function(a) {
|
|
2684
|
+
delete this.map[y(a)];
|
|
2685
|
+
}, g.prototype.get = function(a) {
|
|
2686
|
+
return a = y(a), this.has(a) ? this.map[a] : null;
|
|
2687
|
+
}, g.prototype.has = function(a) {
|
|
2688
|
+
return this.map.hasOwnProperty(y(a));
|
|
2689
|
+
}, g.prototype.set = function(a, l) {
|
|
2690
|
+
this.map[y(a)] = C(l);
|
|
2691
|
+
}, g.prototype.forEach = function(a, l) {
|
|
2692
|
+
for (var E in this.map)
|
|
2693
|
+
this.map.hasOwnProperty(E) && a.call(l, this.map[E], E, this);
|
|
2694
|
+
}, g.prototype.keys = function() {
|
|
2695
2695
|
var a = [];
|
|
2696
|
-
return this.forEach(function(l,
|
|
2697
|
-
a.push(
|
|
2696
|
+
return this.forEach(function(l, E) {
|
|
2697
|
+
a.push(E);
|
|
2698
2698
|
}), T(a);
|
|
2699
|
-
},
|
|
2699
|
+
}, g.prototype.values = function() {
|
|
2700
2700
|
var a = [];
|
|
2701
2701
|
return this.forEach(function(l) {
|
|
2702
2702
|
a.push(l);
|
|
2703
2703
|
}), T(a);
|
|
2704
|
-
},
|
|
2704
|
+
}, g.prototype.entries = function() {
|
|
2705
2705
|
var a = [];
|
|
2706
|
-
return this.forEach(function(l,
|
|
2707
|
-
a.push([
|
|
2706
|
+
return this.forEach(function(l, E) {
|
|
2707
|
+
a.push([E, l]);
|
|
2708
2708
|
}), T(a);
|
|
2709
|
-
},
|
|
2709
|
+
}, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
|
|
2710
2710
|
function N(a) {
|
|
2711
2711
|
if (a.bodyUsed)
|
|
2712
2712
|
return Promise.reject(new TypeError("Already read"));
|
|
2713
2713
|
a.bodyUsed = !0;
|
|
2714
2714
|
}
|
|
2715
|
-
function
|
|
2716
|
-
return new Promise(function(l,
|
|
2715
|
+
function D(a) {
|
|
2716
|
+
return new Promise(function(l, E) {
|
|
2717
2717
|
a.onload = function() {
|
|
2718
2718
|
l(a.result);
|
|
2719
2719
|
}, a.onerror = function() {
|
|
2720
|
-
|
|
2720
|
+
E(a.error);
|
|
2721
2721
|
};
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
|
-
function
|
|
2725
|
-
var l = new FileReader(),
|
|
2726
|
-
return l.readAsArrayBuffer(a),
|
|
2724
|
+
function O(a) {
|
|
2725
|
+
var l = new FileReader(), E = D(l);
|
|
2726
|
+
return l.readAsArrayBuffer(a), E;
|
|
2727
2727
|
}
|
|
2728
2728
|
function z(a) {
|
|
2729
|
-
var l = new FileReader(),
|
|
2730
|
-
return l.readAsText(a),
|
|
2729
|
+
var l = new FileReader(), E = D(l);
|
|
2730
|
+
return l.readAsText(a), E;
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2733
|
-
for (var l = new Uint8Array(a),
|
|
2734
|
-
|
|
2735
|
-
return
|
|
2732
|
+
function P(a) {
|
|
2733
|
+
for (var l = new Uint8Array(a), E = new Array(l.length), S = 0; S < l.length; S++)
|
|
2734
|
+
E[S] = String.fromCharCode(l[S]);
|
|
2735
|
+
return E.join("");
|
|
2736
2736
|
}
|
|
2737
2737
|
function _(a) {
|
|
2738
2738
|
if (a.slice)
|
|
@@ -2742,8 +2742,8 @@ var ye = { exports: {} };
|
|
|
2742
2742
|
}
|
|
2743
2743
|
function U() {
|
|
2744
2744
|
return this.bodyUsed = !1, this._initBody = function(a) {
|
|
2745
|
-
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a :
|
|
2746
|
-
},
|
|
2745
|
+
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : c.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : c.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : c.arrayBuffer && c.blob && h(a) ? (this._bodyArrayBuffer = _(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = _(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) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
2746
|
+
}, c.blob && (this.blob = function() {
|
|
2747
2747
|
var a = N(this);
|
|
2748
2748
|
if (a)
|
|
2749
2749
|
return a;
|
|
@@ -2755,7 +2755,7 @@ var ye = { exports: {} };
|
|
|
2755
2755
|
throw new Error("could not read FormData body as blob");
|
|
2756
2756
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
2757
2757
|
}, this.arrayBuffer = function() {
|
|
2758
|
-
return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(
|
|
2758
|
+
return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(O);
|
|
2759
2759
|
}), this.text = function() {
|
|
2760
2760
|
var a = N(this);
|
|
2761
2761
|
if (a)
|
|
@@ -2763,11 +2763,11 @@ var ye = { exports: {} };
|
|
|
2763
2763
|
if (this._bodyBlob)
|
|
2764
2764
|
return z(this._bodyBlob);
|
|
2765
2765
|
if (this._bodyArrayBuffer)
|
|
2766
|
-
return Promise.resolve(
|
|
2766
|
+
return Promise.resolve(P(this._bodyArrayBuffer));
|
|
2767
2767
|
if (this._bodyFormData)
|
|
2768
2768
|
throw new Error("could not read FormData body as text");
|
|
2769
2769
|
return Promise.resolve(this._bodyText);
|
|
2770
|
-
},
|
|
2770
|
+
}, c.formData && (this.formData = function() {
|
|
2771
2771
|
return this.text().then(je);
|
|
2772
2772
|
}), this.json = function() {
|
|
2773
2773
|
return this.text().then(JSON.parse);
|
|
@@ -2778,76 +2778,76 @@ var ye = { exports: {} };
|
|
|
2778
2778
|
var l = a.toUpperCase();
|
|
2779
2779
|
return Q.indexOf(l) > -1 ? l : a;
|
|
2780
2780
|
}
|
|
2781
|
-
function
|
|
2781
|
+
function L(a, l) {
|
|
2782
2782
|
l = l || {};
|
|
2783
|
-
var
|
|
2784
|
-
if (a instanceof
|
|
2783
|
+
var E = l.body;
|
|
2784
|
+
if (a instanceof L) {
|
|
2785
2785
|
if (a.bodyUsed)
|
|
2786
2786
|
throw new TypeError("Already read");
|
|
2787
|
-
this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new
|
|
2787
|
+
this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new g(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !E && a._bodyInit != null && (E = a._bodyInit, a.bodyUsed = !0);
|
|
2788
2788
|
} else
|
|
2789
2789
|
this.url = String(a);
|
|
2790
|
-
if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new
|
|
2790
|
+
if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(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") && E)
|
|
2791
2791
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
2792
|
-
this._initBody(
|
|
2792
|
+
this._initBody(E);
|
|
2793
2793
|
}
|
|
2794
|
-
|
|
2795
|
-
return new
|
|
2794
|
+
L.prototype.clone = function() {
|
|
2795
|
+
return new L(this, { body: this._bodyInit });
|
|
2796
2796
|
};
|
|
2797
2797
|
function je(a) {
|
|
2798
2798
|
var l = new FormData();
|
|
2799
|
-
return a.trim().split("&").forEach(function(
|
|
2800
|
-
if (
|
|
2801
|
-
var
|
|
2799
|
+
return a.trim().split("&").forEach(function(E) {
|
|
2800
|
+
if (E) {
|
|
2801
|
+
var S = E.split("="), I = S.shift().replace(/\+/g, " "), A = S.join("=").replace(/\+/g, " ");
|
|
2802
2802
|
l.append(decodeURIComponent(I), decodeURIComponent(A));
|
|
2803
2803
|
}
|
|
2804
2804
|
}), l;
|
|
2805
2805
|
}
|
|
2806
2806
|
function Ge(a) {
|
|
2807
|
-
var l = new
|
|
2808
|
-
return
|
|
2809
|
-
var I =
|
|
2807
|
+
var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
|
|
2808
|
+
return E.split(/\r?\n/).forEach(function(S) {
|
|
2809
|
+
var I = S.split(":"), A = I.shift().trim();
|
|
2810
2810
|
if (A) {
|
|
2811
2811
|
var X = I.join(":").trim();
|
|
2812
2812
|
l.append(A, X);
|
|
2813
2813
|
}
|
|
2814
2814
|
}), l;
|
|
2815
2815
|
}
|
|
2816
|
-
U.call(
|
|
2817
|
-
function
|
|
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
|
|
2816
|
+
U.call(L.prototype);
|
|
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 g(l.headers), this.url = l.url || "", this._initBody(a);
|
|
2819
2819
|
}
|
|
2820
|
-
U.call(
|
|
2821
|
-
return new
|
|
2820
|
+
U.call(w.prototype), w.prototype.clone = function() {
|
|
2821
|
+
return new w(this._bodyInit, {
|
|
2822
2822
|
status: this.status,
|
|
2823
2823
|
statusText: this.statusText,
|
|
2824
|
-
headers: new
|
|
2824
|
+
headers: new g(this.headers),
|
|
2825
2825
|
url: this.url
|
|
2826
2826
|
});
|
|
2827
|
-
},
|
|
2828
|
-
var a = new
|
|
2827
|
+
}, w.error = function() {
|
|
2828
|
+
var a = new w(null, { status: 0, statusText: "" });
|
|
2829
2829
|
return a.type = "error", a;
|
|
2830
2830
|
};
|
|
2831
2831
|
var $e = [301, 302, 303, 307, 308];
|
|
2832
|
-
|
|
2832
|
+
w.redirect = function(a, l) {
|
|
2833
2833
|
if ($e.indexOf(l) === -1)
|
|
2834
2834
|
throw new RangeError("Invalid status code");
|
|
2835
|
-
return new
|
|
2835
|
+
return new w(null, { status: l, headers: { location: a } });
|
|
2836
2836
|
}, o.DOMException = s.DOMException;
|
|
2837
2837
|
try {
|
|
2838
2838
|
new o.DOMException();
|
|
2839
2839
|
} catch {
|
|
2840
|
-
o.DOMException = function(l,
|
|
2841
|
-
this.message = l, this.name =
|
|
2842
|
-
var
|
|
2843
|
-
this.stack =
|
|
2840
|
+
o.DOMException = function(l, E) {
|
|
2841
|
+
this.message = l, this.name = E;
|
|
2842
|
+
var S = Error(l);
|
|
2843
|
+
this.stack = S.stack;
|
|
2844
2844
|
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
2845
2845
|
}
|
|
2846
2846
|
function ae(a, l) {
|
|
2847
|
-
return new Promise(function(
|
|
2848
|
-
var I = new
|
|
2847
|
+
return new Promise(function(E, S) {
|
|
2848
|
+
var I = new L(a, l);
|
|
2849
2849
|
if (I.signal && I.signal.aborted)
|
|
2850
|
-
return
|
|
2850
|
+
return S(new o.DOMException("Aborted", "AbortError"));
|
|
2851
2851
|
var A = new XMLHttpRequest();
|
|
2852
2852
|
function X() {
|
|
2853
2853
|
A.abort();
|
|
@@ -2859,110 +2859,110 @@ var ye = { exports: {} };
|
|
|
2859
2859
|
headers: Ge(A.getAllResponseHeaders() || "")
|
|
2860
2860
|
};
|
|
2861
2861
|
j.url = "responseURL" in A ? A.responseURL : j.headers.get("X-Request-URL");
|
|
2862
|
-
var
|
|
2863
|
-
|
|
2862
|
+
var ue = "response" in A ? A.response : A.responseText;
|
|
2863
|
+
E(new w(ue, j));
|
|
2864
2864
|
}, A.onerror = function() {
|
|
2865
|
-
|
|
2865
|
+
S(new TypeError("Network request failed"));
|
|
2866
2866
|
}, A.ontimeout = function() {
|
|
2867
|
-
|
|
2867
|
+
S(new TypeError("Network request failed"));
|
|
2868
2868
|
}, A.onabort = function() {
|
|
2869
|
-
|
|
2870
|
-
}, A.open(I.method, I.url, !0), I.credentials === "include" ? A.withCredentials = !0 : I.credentials === "omit" && (A.withCredentials = !1), "responseType" in A &&
|
|
2871
|
-
A.setRequestHeader(
|
|
2869
|
+
S(new o.DOMException("Aborted", "AbortError"));
|
|
2870
|
+
}, A.open(I.method, I.url, !0), I.credentials === "include" ? A.withCredentials = !0 : I.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && c.blob && (A.responseType = "blob"), I.headers.forEach(function(j, ue) {
|
|
2871
|
+
A.setRequestHeader(ue, j);
|
|
2872
2872
|
}), I.signal && (I.signal.addEventListener("abort", X), A.onreadystatechange = function() {
|
|
2873
2873
|
A.readyState === 4 && I.signal.removeEventListener("abort", X);
|
|
2874
2874
|
}), A.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
|
-
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers =
|
|
2877
|
+
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = L, s.Response = w), o.Headers = g, o.Request = L, o.Response = w, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
2878
2878
|
})({});
|
|
2879
|
-
})(
|
|
2880
|
-
var
|
|
2881
|
-
t =
|
|
2882
|
-
})(
|
|
2883
|
-
var ne =
|
|
2879
|
+
})(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
|
|
2880
|
+
var i = r;
|
|
2881
|
+
t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
|
|
2882
|
+
})(ge, ge.exports);
|
|
2883
|
+
var ne = ge.exports;
|
|
2884
2884
|
const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
2885
2885
|
__proto__: null,
|
|
2886
2886
|
default: ee
|
|
2887
2887
|
}, [ne]), B = (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, r]) => {
|
|
2890
|
+
n && r !== void 0 && (t[n] = r);
|
|
2891
2891
|
}) : t = e), t;
|
|
2892
|
-
},
|
|
2892
|
+
}, De = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Gt = (e) => {
|
|
2893
2893
|
if (!Array.isArray(e.query)) {
|
|
2894
|
-
const
|
|
2895
|
-
return e.variables &&
|
|
2894
|
+
const r = e, i = [`query=${encodeURIComponent(De(r.query))}`];
|
|
2895
|
+
return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.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:
|
|
2899
|
+
const t = e, n = e.query.reduce((r, i, s) => (r.push({
|
|
2900
|
+
query: De(i),
|
|
2901
2901
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
2902
|
-
}),
|
|
2902
|
+
}), r), []);
|
|
2903
2903
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
2904
2904
|
}, $t = (e) => async (t) => {
|
|
2905
|
-
const { url: n, query:
|
|
2906
|
-
let m = "",
|
|
2907
|
-
e === "POST" ? (
|
|
2908
|
-
query:
|
|
2909
|
-
variables:
|
|
2905
|
+
const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware: h } = t, p = { ...t.headers };
|
|
2906
|
+
let m = "", y;
|
|
2907
|
+
e === "POST" ? (y = Yt(r, i, s, c.jsonSerializer), typeof y == "string" && (p["Content-Type"] = "application/json")) : m = Gt({
|
|
2908
|
+
query: r,
|
|
2909
|
+
variables: i,
|
|
2910
2910
|
operationName: s,
|
|
2911
|
-
jsonSerializer:
|
|
2911
|
+
jsonSerializer: c.jsonSerializer ?? Ce
|
|
2912
2912
|
});
|
|
2913
|
-
const
|
|
2913
|
+
const C = {
|
|
2914
2914
|
method: e,
|
|
2915
2915
|
headers: p,
|
|
2916
|
-
body:
|
|
2917
|
-
...
|
|
2916
|
+
body: y,
|
|
2917
|
+
...c
|
|
2918
2918
|
};
|
|
2919
|
-
let T = n,
|
|
2919
|
+
let T = n, g = C;
|
|
2920
2920
|
if (h) {
|
|
2921
|
-
const N = await Promise.resolve(h({ ...
|
|
2922
|
-
T =
|
|
2921
|
+
const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: D, ...O } = N;
|
|
2922
|
+
T = D, g = O;
|
|
2923
2923
|
}
|
|
2924
|
-
return m && (T = `${T}?${m}`), await o(T,
|
|
2924
|
+
return m && (T = `${T}?${m}`), await o(T, g);
|
|
2925
2925
|
};
|
|
2926
2926
|
class Ht {
|
|
2927
2927
|
constructor(t, n = {}) {
|
|
2928
|
-
this.url = t, this.requestConfig = n, this.rawRequest = async (...
|
|
2929
|
-
const [
|
|
2930
|
-
|
|
2931
|
-
const { operationName: N } = le(
|
|
2928
|
+
this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
|
|
2929
|
+
const [i, s, o] = r, c = We(i, s, o), { headers: h, fetch: p = ee, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...T } = this.requestConfig, { url: g } = this;
|
|
2930
|
+
c.signal !== void 0 && (T.signal = c.signal);
|
|
2931
|
+
const { operationName: N } = le(c.query);
|
|
2932
2932
|
return de({
|
|
2933
|
-
url:
|
|
2934
|
-
query:
|
|
2935
|
-
variables:
|
|
2933
|
+
url: g,
|
|
2934
|
+
query: c.query,
|
|
2935
|
+
variables: c.variables,
|
|
2936
2936
|
headers: {
|
|
2937
2937
|
...B(he(h)),
|
|
2938
|
-
...B(
|
|
2938
|
+
...B(c.requestHeaders)
|
|
2939
2939
|
},
|
|
2940
2940
|
operationName: N,
|
|
2941
2941
|
fetch: p,
|
|
2942
2942
|
method: m,
|
|
2943
2943
|
fetchOptions: T,
|
|
2944
|
-
middleware:
|
|
2945
|
-
}).then((
|
|
2946
|
-
throw
|
|
2944
|
+
middleware: y
|
|
2945
|
+
}).then((D) => (C && C(D), D)).catch((D) => {
|
|
2946
|
+
throw C && C(D), D;
|
|
2947
2947
|
});
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
2950
2950
|
async request(t, ...n) {
|
|
2951
|
-
const [
|
|
2952
|
-
s.signal !== void 0 && (
|
|
2953
|
-
const { query: T, operationName:
|
|
2951
|
+
const [r, i] = n, s = Xe(t, r, i), { headers: o, fetch: c = ee, method: h = "POST", requestMiddleware: p, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
|
|
2952
|
+
s.signal !== void 0 && (y.signal = s.signal);
|
|
2953
|
+
const { query: T, operationName: g } = le(s.document);
|
|
2954
2954
|
return de({
|
|
2955
|
-
url:
|
|
2955
|
+
url: C,
|
|
2956
2956
|
query: T,
|
|
2957
2957
|
variables: s.variables,
|
|
2958
2958
|
headers: {
|
|
2959
2959
|
...B(he(o)),
|
|
2960
2960
|
...B(s.requestHeaders)
|
|
2961
2961
|
},
|
|
2962
|
-
operationName:
|
|
2963
|
-
fetch:
|
|
2962
|
+
operationName: g,
|
|
2963
|
+
fetch: c,
|
|
2964
2964
|
method: h,
|
|
2965
|
-
fetchOptions:
|
|
2965
|
+
fetchOptions: y,
|
|
2966
2966
|
middleware: p
|
|
2967
2967
|
}).then((N) => (m && m(N), N.data)).catch((N) => {
|
|
2968
2968
|
throw m && m(N), N;
|
|
@@ -2970,17 +2970,17 @@ class Ht {
|
|
|
2970
2970
|
}
|
|
2971
2971
|
// prettier-ignore
|
|
2972
2972
|
batchRequests(t, n) {
|
|
2973
|
-
const
|
|
2974
|
-
|
|
2975
|
-
const o =
|
|
2973
|
+
const r = Ze(t, n), { headers: i, ...s } = this.requestConfig;
|
|
2974
|
+
r.signal !== void 0 && (s.signal = r.signal);
|
|
2975
|
+
const o = r.documents.map(({ document: h }) => le(h).query), c = r.documents.map(({ variables: h }) => h);
|
|
2976
2976
|
return de({
|
|
2977
2977
|
url: this.url,
|
|
2978
2978
|
query: o,
|
|
2979
2979
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
2980
|
-
variables:
|
|
2980
|
+
variables: c,
|
|
2981
2981
|
headers: {
|
|
2982
|
-
...B(he(
|
|
2983
|
-
...B(
|
|
2982
|
+
...B(he(i)),
|
|
2983
|
+
...B(r.requestHeaders)
|
|
2984
2984
|
},
|
|
2985
2985
|
operationName: void 0,
|
|
2986
2986
|
fetch: this.requestConfig.fetch ?? ee,
|
|
@@ -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: r } = this.requestConfig;
|
|
3002
|
+
return r ? r[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.
|
|
@@ -3009,49 +3009,49 @@ class Ht {
|
|
|
3009
3009
|
}
|
|
3010
3010
|
}
|
|
3011
3011
|
const de = async (e) => {
|
|
3012
|
-
const { query: t, variables: n, fetchOptions:
|
|
3012
|
+
const { query: t, variables: n, fetchOptions: r } = e, i = $t(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await zt(o, r.jsonSerializer ?? Ce), h = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, p = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
|
|
3013
3013
|
if (o.ok && p && h) {
|
|
3014
|
-
const { errors: m, ...
|
|
3014
|
+
const { errors: m, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
|
|
3015
3015
|
return {
|
|
3016
|
-
...s ? { data:
|
|
3016
|
+
...s ? { data: C } : C,
|
|
3017
3017
|
headers: o.headers,
|
|
3018
3018
|
status: o.status
|
|
3019
3019
|
};
|
|
3020
3020
|
} else {
|
|
3021
|
-
const m = typeof
|
|
3022
|
-
error:
|
|
3023
|
-
} :
|
|
3021
|
+
const m = typeof c == "string" ? {
|
|
3022
|
+
error: c
|
|
3023
|
+
} : c;
|
|
3024
3024
|
throw new H(
|
|
3025
3025
|
// @ts-expect-error TODO
|
|
3026
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, r) => {
|
|
3031
|
+
const i = r ?? Ce;
|
|
3032
3032
|
if (!Array.isArray(e))
|
|
3033
|
-
return
|
|
3033
|
+
return i.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((o,
|
|
3037
|
-
return
|
|
3036
|
+
const s = e.reduce((o, c, h) => (o.push({ query: c, variables: t ? t[h] : void 0 }), o), []);
|
|
3037
|
+
return i.stringify(s);
|
|
3038
3038
|
}, zt = async (e, t) => {
|
|
3039
3039
|
let n;
|
|
3040
|
-
return e.headers.forEach((
|
|
3041
|
-
|
|
3040
|
+
return e.headers.forEach((r, i) => {
|
|
3041
|
+
i.toLowerCase() === "content-type" && (n = r);
|
|
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
3043
|
}, he = (e) => typeof e == "function" ? e() : e;
|
|
3044
3044
|
var re = function() {
|
|
3045
3045
|
return re = Object.assign || function(t) {
|
|
3046
|
-
for (var n,
|
|
3047
|
-
n = arguments[
|
|
3046
|
+
for (var n, r = 1, i = arguments.length; r < i; r++) {
|
|
3047
|
+
n = arguments[r];
|
|
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(),
|
|
3054
|
+
var te = /* @__PURE__ */ new Map(), ye = /* @__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
|
-
o && !o.has(s) ? qe && console.warn("Warning: fragment with name " +
|
|
3063
|
+
return e.definitions.forEach(function(r) {
|
|
3064
|
+
if (r.kind === "FragmentDefinition") {
|
|
3065
|
+
var i = r.name.value, s = Qt(r.loc), o = ye.get(i);
|
|
3066
|
+
o && !o.has(s) ? qe && console.warn("Warning: fragment with name " + i + ` 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`) : o ||
|
|
3068
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ye.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
|
|
3069
3069
|
} else
|
|
3070
|
-
n.push(
|
|
3070
|
+
n.push(r);
|
|
3071
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 = i
|
|
3075
|
+
t.forEach(function(r) {
|
|
3076
|
+
r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
|
|
3077
|
+
var s = r[i];
|
|
3078
3078
|
s && typeof s == "object" && t.add(s);
|
|
3079
3079
|
});
|
|
3080
3080
|
});
|
|
@@ -3098,13 +3098,13 @@ 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 r = e[0];
|
|
3102
|
+
return t.forEach(function(i, s) {
|
|
3103
|
+
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
3104
|
+
}), Wt(r);
|
|
3105
3105
|
}
|
|
3106
3106
|
function Zt() {
|
|
3107
|
-
te.clear(),
|
|
3107
|
+
te.clear(), ye.clear();
|
|
3108
3108
|
}
|
|
3109
3109
|
function Kt() {
|
|
3110
3110
|
qe = !1;
|
|
@@ -3126,7 +3126,7 @@ var G = {
|
|
|
3126
3126
|
e.gql = G.gql, e.resetCaches = G.resetCaches, e.disableFragmentWarnings = G.disableFragmentWarnings, e.enableExperimentalFragmentVariables = G.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = G.disableExperimentalFragmentVariables;
|
|
3127
3127
|
})(q || (q = {}));
|
|
3128
3128
|
q.default = q;
|
|
3129
|
-
const
|
|
3129
|
+
const R = q, nn = R`
|
|
3130
3130
|
query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3131
3131
|
locationAvailabilities(
|
|
3132
3132
|
sku: $sku
|
|
@@ -3164,7 +3164,7 @@ const k = q, nn = k`
|
|
|
3164
3164
|
}
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
-
`, rn =
|
|
3167
|
+
`, rn = R`
|
|
3168
3168
|
query GetLocationAvailability($sku: String!, $locationID: ID!) {
|
|
3169
3169
|
locationAvailability(sku: $sku, locationID: $locationID) {
|
|
3170
3170
|
location {
|
|
@@ -3189,7 +3189,7 @@ const k = q, nn = k`
|
|
|
3189
3189
|
inventoryQuantity
|
|
3190
3190
|
}
|
|
3191
3191
|
}
|
|
3192
|
-
`, sn =
|
|
3192
|
+
`, sn = R`
|
|
3193
3193
|
query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
|
|
3194
3194
|
purchasingCustomerMetafield(namespace: $namespace, key: $key) {
|
|
3195
3195
|
id
|
|
@@ -3198,14 +3198,14 @@ const k = q, nn = k`
|
|
|
3198
3198
|
value
|
|
3199
3199
|
}
|
|
3200
3200
|
}
|
|
3201
|
-
`, on =
|
|
3201
|
+
`, on = R`
|
|
3202
3202
|
query GetPoints {
|
|
3203
3203
|
purchasingCustomer {
|
|
3204
3204
|
pointsApproved
|
|
3205
3205
|
pointsPending
|
|
3206
3206
|
}
|
|
3207
3207
|
}
|
|
3208
|
-
`, an =
|
|
3208
|
+
`, an = R`
|
|
3209
3209
|
query GetLocations($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3210
3210
|
locations(first: $first, after: $after, isReverse: $isReverse) {
|
|
3211
3211
|
nodes {
|
|
@@ -3235,7 +3235,7 @@ const k = q, nn = k`
|
|
|
3235
3235
|
}
|
|
3236
3236
|
}
|
|
3237
3237
|
}
|
|
3238
|
-
`,
|
|
3238
|
+
`, un = R`
|
|
3239
3239
|
query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3240
3240
|
purchasingCustomer {
|
|
3241
3241
|
id
|
|
@@ -3264,14 +3264,14 @@ const k = q, nn = k`
|
|
|
3264
3264
|
}
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
3267
|
-
`,
|
|
3267
|
+
`, cn = R`
|
|
3268
3268
|
query GetPurchasingCustomerDiscountCodeCount {
|
|
3269
3269
|
purchasingCustomer {
|
|
3270
3270
|
id
|
|
3271
3271
|
orderPriceAdjustmentRuleCount
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
`, ln =
|
|
3274
|
+
`, ln = R`
|
|
3275
3275
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
3276
3276
|
purchasingCustomer {
|
|
3277
3277
|
id
|
|
@@ -3284,6 +3284,10 @@ const k = q, nn = k`
|
|
|
3284
3284
|
nodes {
|
|
3285
3285
|
id
|
|
3286
3286
|
title
|
|
3287
|
+
tenant {
|
|
3288
|
+
id
|
|
3289
|
+
name
|
|
3290
|
+
}
|
|
3287
3291
|
pointChange {
|
|
3288
3292
|
id
|
|
3289
3293
|
delta
|
|
@@ -3291,6 +3295,10 @@ const k = q, nn = k`
|
|
|
3291
3295
|
expiresDate
|
|
3292
3296
|
availableUntil
|
|
3293
3297
|
pointChangeCreatedAt
|
|
3298
|
+
tenant {
|
|
3299
|
+
id
|
|
3300
|
+
name
|
|
3301
|
+
}
|
|
3294
3302
|
createdAt
|
|
3295
3303
|
}
|
|
3296
3304
|
retailLocation {
|
|
@@ -3322,7 +3330,7 @@ const k = q, nn = k`
|
|
|
3322
3330
|
}
|
|
3323
3331
|
}
|
|
3324
3332
|
}
|
|
3325
|
-
`, dn =
|
|
3333
|
+
`, dn = R`
|
|
3326
3334
|
query GetPurchasingCustomerRank {
|
|
3327
3335
|
purchasingCustomer {
|
|
3328
3336
|
currentCustomerRank {
|
|
@@ -3361,66 +3369,109 @@ const k = q, nn = k`
|
|
|
3361
3369
|
}
|
|
3362
3370
|
}
|
|
3363
3371
|
}
|
|
3364
|
-
`, hn =
|
|
3372
|
+
`, hn = R`
|
|
3365
3373
|
query GetSharingPurchasingCustomerCount {
|
|
3366
3374
|
purchasingCustomer {
|
|
3367
3375
|
id
|
|
3368
3376
|
sharingPurchasingCustomerCount
|
|
3369
3377
|
}
|
|
3370
3378
|
}
|
|
3371
|
-
`, pn =
|
|
3379
|
+
`, pn = R`
|
|
3380
|
+
query GetPurchasingCustomerSharing {
|
|
3381
|
+
purchasingCustomer {
|
|
3382
|
+
id
|
|
3383
|
+
customerSharing {
|
|
3384
|
+
id
|
|
3385
|
+
purchasingCustomers {
|
|
3386
|
+
id
|
|
3387
|
+
sharingPurchasingCustomerCount
|
|
3388
|
+
tenant {
|
|
3389
|
+
id
|
|
3390
|
+
name
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
`, fn = R`
|
|
3372
3397
|
mutation PurchasingCustomerSendCustomerSharingActivationCode {
|
|
3373
3398
|
purchasingCustomerSendCustomerSharingActivationCode {
|
|
3374
3399
|
purchasingCustomer {
|
|
3375
3400
|
id
|
|
3401
|
+
sharingPurchasingCustomerCount
|
|
3402
|
+
tenant {
|
|
3403
|
+
id
|
|
3404
|
+
name
|
|
3405
|
+
}
|
|
3376
3406
|
}
|
|
3377
3407
|
customerSharingActivationCode {
|
|
3378
3408
|
id
|
|
3379
3409
|
}
|
|
3380
3410
|
}
|
|
3381
3411
|
}
|
|
3382
|
-
`,
|
|
3383
|
-
|
|
3412
|
+
`, mn = R`
|
|
3413
|
+
mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
|
|
3414
|
+
purchasingCustomerActivateCustomerSharing(
|
|
3415
|
+
input: {email: $email, activationCode: $activationCode}
|
|
3416
|
+
) {
|
|
3417
|
+
purchasingCustomer {
|
|
3418
|
+
id
|
|
3419
|
+
sharingPurchasingCustomerCount
|
|
3420
|
+
tenant {
|
|
3421
|
+
id
|
|
3422
|
+
name
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
`, gn = (e, t, n, r) => e();
|
|
3428
|
+
function yn(e, t = gn) {
|
|
3384
3429
|
return {
|
|
3385
|
-
GetLocationAvailabilities(n,
|
|
3386
|
-
return t((
|
|
3430
|
+
GetLocationAvailabilities(n, r) {
|
|
3431
|
+
return t((i) => e.request(nn, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
|
|
3432
|
+
},
|
|
3433
|
+
GetLocationAvailability(n, r) {
|
|
3434
|
+
return t((i) => e.request(rn, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
|
|
3387
3435
|
},
|
|
3388
|
-
|
|
3389
|
-
return t((
|
|
3436
|
+
GetPurchasingCustomerMetafield(n, r) {
|
|
3437
|
+
return t((i) => e.request(sn, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
|
|
3390
3438
|
},
|
|
3391
|
-
|
|
3392
|
-
return t((
|
|
3439
|
+
GetPoints(n, r) {
|
|
3440
|
+
return t((i) => e.request(on, n, { ...r, ...i }), "GetPoints", "query", n);
|
|
3393
3441
|
},
|
|
3394
|
-
|
|
3395
|
-
return t((
|
|
3442
|
+
GetLocations(n, r) {
|
|
3443
|
+
return t((i) => e.request(an, n, { ...r, ...i }), "GetLocations", "query", n);
|
|
3396
3444
|
},
|
|
3397
|
-
|
|
3398
|
-
return t((
|
|
3445
|
+
GetPurchasingCustomerDiscounts(n, r) {
|
|
3446
|
+
return t((i) => e.request(un, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
|
|
3399
3447
|
},
|
|
3400
|
-
|
|
3401
|
-
return t((
|
|
3448
|
+
GetPurchasingCustomerDiscountCodeCount(n, r) {
|
|
3449
|
+
return t((i) => e.request(cn, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
|
|
3402
3450
|
},
|
|
3403
|
-
|
|
3404
|
-
return t((
|
|
3451
|
+
GetPurchasingCustomerPointChangeActivities(n, r) {
|
|
3452
|
+
return t((i) => e.request(ln, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
|
|
3405
3453
|
},
|
|
3406
|
-
|
|
3407
|
-
return t((
|
|
3454
|
+
GetPurchasingCustomerRank(n, r) {
|
|
3455
|
+
return t((i) => e.request(dn, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
|
|
3408
3456
|
},
|
|
3409
|
-
|
|
3410
|
-
return t((
|
|
3457
|
+
GetSharingPurchasingCustomerCount(n, r) {
|
|
3458
|
+
return t((i) => e.request(hn, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
|
|
3411
3459
|
},
|
|
3412
|
-
|
|
3413
|
-
return t((
|
|
3460
|
+
GetPurchasingCustomerSharing(n, r) {
|
|
3461
|
+
return t((i) => e.request(pn, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
|
|
3414
3462
|
},
|
|
3415
|
-
PurchasingCustomerSendCustomerSharingActivationCode(n,
|
|
3416
|
-
return t((
|
|
3463
|
+
PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
|
|
3464
|
+
return t((i) => e.request(fn, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
|
|
3465
|
+
},
|
|
3466
|
+
PurchasingCustomerActivateCustomerSharing(n, r) {
|
|
3467
|
+
return t((i) => e.request(mn, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
|
|
3417
3468
|
}
|
|
3418
3469
|
};
|
|
3419
3470
|
}
|
|
3420
|
-
class
|
|
3471
|
+
class En {
|
|
3421
3472
|
constructor(t) {
|
|
3422
3473
|
Ae(this, "api");
|
|
3423
|
-
this.api =
|
|
3474
|
+
this.api = yn(
|
|
3424
3475
|
new Ht(`${t}/apps/sq-api`, {
|
|
3425
3476
|
headers: {
|
|
3426
3477
|
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
@@ -3436,12 +3487,12 @@ class gn {
|
|
|
3436
3487
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3437
3488
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3438
3489
|
*/
|
|
3439
|
-
async getLocationAvailabilities(t, n,
|
|
3490
|
+
async getLocationAvailabilities(t, n, r, i) {
|
|
3440
3491
|
const s = await this.api.GetLocationAvailabilities({
|
|
3441
3492
|
sku: t,
|
|
3442
3493
|
first: n,
|
|
3443
|
-
after:
|
|
3444
|
-
isReverse:
|
|
3494
|
+
after: r,
|
|
3495
|
+
isReverse: i
|
|
3445
3496
|
});
|
|
3446
3497
|
return {
|
|
3447
3498
|
nodes: s.locationAvailabilities.nodes.map(
|
|
@@ -3475,26 +3526,26 @@ class gn {
|
|
|
3475
3526
|
* @param {string} locationID 在庫情報を取得したいLocationのID。
|
|
3476
3527
|
*/
|
|
3477
3528
|
async getLocationAvailability(t, n) {
|
|
3478
|
-
const
|
|
3529
|
+
const r = await this.api.GetLocationAvailability({ sku: t, locationID: n });
|
|
3479
3530
|
return {
|
|
3480
3531
|
location: {
|
|
3481
|
-
id:
|
|
3482
|
-
name:
|
|
3483
|
-
phone:
|
|
3484
|
-
mapURL:
|
|
3485
|
-
address:
|
|
3486
|
-
id:
|
|
3487
|
-
countryCode:
|
|
3488
|
-
country:
|
|
3489
|
-
postalCode:
|
|
3490
|
-
provinceCode:
|
|
3491
|
-
province:
|
|
3492
|
-
city:
|
|
3493
|
-
address1:
|
|
3494
|
-
address2:
|
|
3532
|
+
id: r.locationAvailability.location.id,
|
|
3533
|
+
name: r.locationAvailability.location.name,
|
|
3534
|
+
phone: r.locationAvailability.location.phone,
|
|
3535
|
+
mapURL: r.locationAvailability.location.mapURL,
|
|
3536
|
+
address: r.locationAvailability.location.address ? {
|
|
3537
|
+
id: r.locationAvailability.location.address.id,
|
|
3538
|
+
countryCode: r.locationAvailability.location.address.countryCode,
|
|
3539
|
+
country: r.locationAvailability.location.address.country,
|
|
3540
|
+
postalCode: r.locationAvailability.location.address.postalCode,
|
|
3541
|
+
provinceCode: r.locationAvailability.location.address.provinceCode,
|
|
3542
|
+
province: r.locationAvailability.location.address.province,
|
|
3543
|
+
city: r.locationAvailability.location.address.city,
|
|
3544
|
+
address1: r.locationAvailability.location.address.address1,
|
|
3545
|
+
address2: r.locationAvailability.location.address.address2
|
|
3495
3546
|
} : void 0
|
|
3496
3547
|
},
|
|
3497
|
-
inventoryQuantity:
|
|
3548
|
+
inventoryQuantity: r.locationAvailability.inventoryQuantity
|
|
3498
3549
|
};
|
|
3499
3550
|
}
|
|
3500
3551
|
/**
|
|
@@ -3528,10 +3579,10 @@ class gn {
|
|
|
3528
3579
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3529
3580
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3530
3581
|
*/
|
|
3531
|
-
async getLocations(t, n,
|
|
3532
|
-
const
|
|
3582
|
+
async getLocations(t, n, r) {
|
|
3583
|
+
const i = await this.api.GetLocations({ first: t, after: n, isReverse: r });
|
|
3533
3584
|
return {
|
|
3534
|
-
nodes:
|
|
3585
|
+
nodes: i.locations.nodes.map((s) => ({
|
|
3535
3586
|
id: s.id,
|
|
3536
3587
|
name: s.name,
|
|
3537
3588
|
phone: s.phone,
|
|
@@ -3548,7 +3599,7 @@ class gn {
|
|
|
3548
3599
|
address2: s.address.address2
|
|
3549
3600
|
} : void 0
|
|
3550
3601
|
})) ?? [],
|
|
3551
|
-
pageInfo:
|
|
3602
|
+
pageInfo: i.locations.pageInfo ?? null
|
|
3552
3603
|
};
|
|
3553
3604
|
}
|
|
3554
3605
|
/**
|
|
@@ -3559,15 +3610,15 @@ class gn {
|
|
|
3559
3610
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3560
3611
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3561
3612
|
*/
|
|
3562
|
-
async getPurchasingCustomerDiscounts(t, n,
|
|
3563
|
-
const
|
|
3613
|
+
async getPurchasingCustomerDiscounts(t, n, r) {
|
|
3614
|
+
const i = await this.api.GetPurchasingCustomerDiscounts({
|
|
3564
3615
|
first: t,
|
|
3565
3616
|
after: n,
|
|
3566
|
-
isReverse:
|
|
3617
|
+
isReverse: r
|
|
3567
3618
|
});
|
|
3568
|
-
return
|
|
3569
|
-
id:
|
|
3570
|
-
nodes:
|
|
3619
|
+
return i.purchasingCustomer ? {
|
|
3620
|
+
id: i.purchasingCustomer.id,
|
|
3621
|
+
nodes: i.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
|
|
3571
3622
|
(s) => ({
|
|
3572
3623
|
id: s.id,
|
|
3573
3624
|
title: s.title,
|
|
@@ -3584,7 +3635,7 @@ class gn {
|
|
|
3584
3635
|
updatedAt: new Date(s.updatedAt)
|
|
3585
3636
|
})
|
|
3586
3637
|
) ?? [],
|
|
3587
|
-
pageInfo:
|
|
3638
|
+
pageInfo: i.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
|
|
3588
3639
|
} : null;
|
|
3589
3640
|
}
|
|
3590
3641
|
/**
|
|
@@ -3595,12 +3646,12 @@ class gn {
|
|
|
3595
3646
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3596
3647
|
* @param {PointChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかPOINT_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
|
|
3597
3648
|
*/
|
|
3598
|
-
async getPointChangeActivities(t, n,
|
|
3649
|
+
async getPointChangeActivities(t, n, r, i) {
|
|
3599
3650
|
const s = await this.api.GetPurchasingCustomerPointChangeActivities({
|
|
3600
3651
|
first: t,
|
|
3601
3652
|
after: n,
|
|
3602
|
-
isReverse:
|
|
3603
|
-
sortKeys:
|
|
3653
|
+
isReverse: r,
|
|
3654
|
+
sortKeys: i
|
|
3604
3655
|
});
|
|
3605
3656
|
return s.purchasingCustomer ? {
|
|
3606
3657
|
nodes: s.purchasingCustomer.pointChangeActivities.nodes.map(
|
|
@@ -3616,6 +3667,10 @@ class gn {
|
|
|
3616
3667
|
pointChangeCreatedAt: new Date(
|
|
3617
3668
|
o.pointChange.pointChangeCreatedAt
|
|
3618
3669
|
),
|
|
3670
|
+
tenant: {
|
|
3671
|
+
id: o.pointChange.tenant.id,
|
|
3672
|
+
name: o.pointChange.tenant.name
|
|
3673
|
+
},
|
|
3619
3674
|
createdAt: new Date(o.pointChange.createdAt)
|
|
3620
3675
|
},
|
|
3621
3676
|
retailLocation: o.retailLocation ? {
|
|
@@ -3634,7 +3689,11 @@ class gn {
|
|
|
3634
3689
|
address1: o.retailLocation.address.address1,
|
|
3635
3690
|
address2: o.retailLocation.address.address2
|
|
3636
3691
|
} : void 0
|
|
3637
|
-
} : void 0
|
|
3692
|
+
} : void 0,
|
|
3693
|
+
tenant: {
|
|
3694
|
+
id: o.tenant.id,
|
|
3695
|
+
name: o.tenant.name
|
|
3696
|
+
}
|
|
3638
3697
|
})
|
|
3639
3698
|
),
|
|
3640
3699
|
pageInfo: s.purchasingCustomer.pointChangeActivities.pageInfo
|
|
@@ -3700,16 +3759,57 @@ class gn {
|
|
|
3700
3759
|
return ((n = (await this.api.GetSharingPurchasingCustomerCount()).purchasingCustomer) == null ? void 0 : n.sharingPurchasingCustomerCount) ?? 0;
|
|
3701
3760
|
}
|
|
3702
3761
|
/**
|
|
3703
|
-
*
|
|
3762
|
+
* getPurchasingCustomerSharing は共有化している顧客情報を返します。
|
|
3763
|
+
*/
|
|
3764
|
+
async getPurchasingCustomerSharing() {
|
|
3765
|
+
var n;
|
|
3766
|
+
const t = await this.api.GetPurchasingCustomerSharing();
|
|
3767
|
+
return (n = t.purchasingCustomer) != null && n.customerSharing ? {
|
|
3768
|
+
id: t.purchasingCustomer.customerSharing.id,
|
|
3769
|
+
purchasingCustomers: t.purchasingCustomer.customerSharing.purchasingCustomers.map((r) => ({
|
|
3770
|
+
id: r.id,
|
|
3771
|
+
sharingPurchasingCustomerCount: r.sharingPurchasingCustomerCount,
|
|
3772
|
+
tenant: {
|
|
3773
|
+
id: r.tenant.id,
|
|
3774
|
+
name: r.tenant.name
|
|
3775
|
+
}
|
|
3776
|
+
}))
|
|
3777
|
+
} : null;
|
|
3778
|
+
}
|
|
3779
|
+
/**
|
|
3780
|
+
* purchasingCustomerSendCustomerSharingActivationCode はログインしているアカウントのメールアドレスに顧客情報共有のためのアクティベーションコードを送信します。
|
|
3704
3781
|
*/
|
|
3705
3782
|
async purchasingCustomerSendCustomerSharingActivationCode() {
|
|
3706
3783
|
const t = await this.api.PurchasingCustomerSendCustomerSharingActivationCode();
|
|
3707
3784
|
return t.purchasingCustomerSendCustomerSharingActivationCode ? {
|
|
3708
|
-
|
|
3785
|
+
purchasingCustomer: {
|
|
3786
|
+
id: t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.id,
|
|
3787
|
+
sharingPurchasingCustomerCount: t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.sharingPurchasingCustomerCount,
|
|
3788
|
+
tenant: {
|
|
3789
|
+
id: t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.tenant.id,
|
|
3790
|
+
name: t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.tenant.name
|
|
3791
|
+
}
|
|
3792
|
+
},
|
|
3709
3793
|
customerSharingActivationCodeID: t.purchasingCustomerSendCustomerSharingActivationCode.customerSharingActivationCode.id
|
|
3710
3794
|
} : null;
|
|
3711
3795
|
}
|
|
3796
|
+
/**
|
|
3797
|
+
* purchasingCustomerActivateCustomerSharing はクティベーションコードを入力して顧客を有効化する。
|
|
3798
|
+
*/
|
|
3799
|
+
async purchasingCustomerActivateCustomerSharing(t, n) {
|
|
3800
|
+
if (n.length !== 6)
|
|
3801
|
+
throw new Error(`Invalid activation code: ${n} is not 6 characters.`);
|
|
3802
|
+
const r = await this.api.PurchasingCustomerActivateCustomerSharing({ email: t, activationCode: n });
|
|
3803
|
+
return r.purchasingCustomerActivateCustomerSharing ? {
|
|
3804
|
+
id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,
|
|
3805
|
+
sharingPurchasingCustomerCount: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,
|
|
3806
|
+
tenant: {
|
|
3807
|
+
id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,
|
|
3808
|
+
name: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name
|
|
3809
|
+
}
|
|
3810
|
+
} : null;
|
|
3811
|
+
}
|
|
3712
3812
|
}
|
|
3713
3813
|
export {
|
|
3714
|
-
|
|
3814
|
+
En as SDK
|
|
3715
3815
|
};
|