@builtbystack/sq-shopify-theme-sdk 0.0.10 → 0.0.12
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 +16 -0
- package/dist/sq-shopify-theme-sdk.d.ts +5 -0
- package/dist/sq-shopify-theme-sdk.js +278 -237
- package/dist/sq-shopify-theme-sdk.umd.js +51 -30
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@ function et(e, t) {
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
const tt = /\r\n|[\n\r]/g;
|
|
54
|
-
function
|
|
54
|
+
function he(e, t) {
|
|
55
55
|
let n = 0, i = 1;
|
|
56
56
|
for (const r of e.body.matchAll(tt)) {
|
|
57
57
|
if (typeof r.index == "number" || et(!1), r.index >= t)
|
|
@@ -66,28 +66,28 @@ function pe(e, t) {
|
|
|
66
66
|
function nt(e) {
|
|
67
67
|
return _e(
|
|
68
68
|
e.source,
|
|
69
|
-
|
|
69
|
+
he(e.source, e.start)
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
function _e(e, t) {
|
|
73
|
-
const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0,
|
|
73
|
+
const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0, p = t.column + u, h = `${e.name}:${o}:${p}
|
|
74
74
|
`, m = i.split(/\r\n|[\n\r]/g), E = m[r];
|
|
75
75
|
if (E.length > 120) {
|
|
76
|
-
const g = Math.floor(
|
|
76
|
+
const g = Math.floor(p / 80), A = p % 80, y = [];
|
|
77
77
|
for (let N = 0; N < E.length; N += 80)
|
|
78
78
|
y.push(E.slice(N, N + 80));
|
|
79
|
-
return
|
|
79
|
+
return h + Ae([
|
|
80
80
|
[`${o} |`, y[0]],
|
|
81
81
|
...y.slice(1, g + 1).map((N) => ["|", N]),
|
|
82
82
|
["|", "^".padStart(A)],
|
|
83
83
|
["|", y[g + 1]]
|
|
84
84
|
]);
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return h + Ae([
|
|
87
87
|
// Lines specified like this: ["prefix", "string"],
|
|
88
88
|
[`${o - 1} |`, m[r - 1]],
|
|
89
89
|
[`${o} |`, E],
|
|
90
|
-
["|", "^".padStart(
|
|
90
|
+
["|", "^".padStart(p)],
|
|
91
91
|
[`${o + 1} |`, m[r + 1]]
|
|
92
92
|
]);
|
|
93
93
|
}
|
|
@@ -107,7 +107,7 @@ function rt(e) {
|
|
|
107
107
|
extensions: e[5]
|
|
108
108
|
} : t;
|
|
109
109
|
}
|
|
110
|
-
class
|
|
110
|
+
class Ce extends Error {
|
|
111
111
|
/**
|
|
112
112
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
113
113
|
* which correspond to this error.
|
|
@@ -148,14 +148,14 @@ class ve extends Error {
|
|
|
148
148
|
*/
|
|
149
149
|
constructor(t, ...n) {
|
|
150
150
|
var i, r, s;
|
|
151
|
-
const { nodes: o, source: u, positions:
|
|
152
|
-
super(t), this.name = "GraphQLError", this.path =
|
|
151
|
+
const { nodes: o, source: u, positions: p, path: h, originalError: m, extensions: E } = rt(n);
|
|
152
|
+
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = m ?? void 0, this.nodes = Ne(
|
|
153
153
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
154
154
|
);
|
|
155
155
|
const g = Ne(
|
|
156
156
|
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((y) => y.loc).filter((y) => y != null)
|
|
157
157
|
);
|
|
158
|
-
this.source = u ?? (g == null || (r = g[0]) === null || r === void 0 ? void 0 : r.source), this.positions =
|
|
158
|
+
this.source = u ?? (g == null || (r = g[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? (g == null ? void 0 : g.map((y) => y.start)), this.locations = p && u ? p.map((y) => he(u, y)) : g == null ? void 0 : g.map((y) => he(y.source, y.start));
|
|
159
159
|
const A = Ke(
|
|
160
160
|
m == null ? void 0 : m.extensions
|
|
161
161
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
@@ -183,7 +183,7 @@ class ve 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, Ce) : Object.defineProperty(this, "stack", {
|
|
187
187
|
value: Error().stack,
|
|
188
188
|
writable: !0,
|
|
189
189
|
configurable: !0
|
|
@@ -216,8 +216,8 @@ class ve extends Error {
|
|
|
216
216
|
function Ne(e) {
|
|
217
217
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return new
|
|
219
|
+
function x(e, t, n) {
|
|
220
|
+
return new Ce(`Syntax Error: ${n}`, {
|
|
221
221
|
source: e,
|
|
222
222
|
positions: [t]
|
|
223
223
|
});
|
|
@@ -368,7 +368,7 @@ const Re = {
|
|
|
368
368
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
369
369
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
370
370
|
}, st = new Set(Object.keys(Re));
|
|
371
|
-
function
|
|
371
|
+
function be(e) {
|
|
372
372
|
const t = e == null ? void 0 : e.kind;
|
|
373
373
|
return typeof t == "string" && st.has(t);
|
|
374
374
|
}
|
|
@@ -405,8 +405,8 @@ function at(e) {
|
|
|
405
405
|
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
406
406
|
for (let o = 0; o < e.length; ++o) {
|
|
407
407
|
var s;
|
|
408
|
-
const u = e[o],
|
|
409
|
-
|
|
408
|
+
const u = e[o], p = ct(u);
|
|
409
|
+
p !== u.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && p < n && (n = p));
|
|
410
410
|
}
|
|
411
411
|
return e.map((o, u) => u === 0 ? o : o.slice(n)).slice(
|
|
412
412
|
(t = i) !== null && t !== void 0 ? t : 0,
|
|
@@ -420,12 +420,12 @@ function ct(e) {
|
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
422
422
|
function ut(e, t) {
|
|
423
|
-
const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((A) => A.length === 0 || me(A.charCodeAt(0))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o,
|
|
424
|
-
(!r || e.length > 70 ||
|
|
423
|
+
const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((A) => A.length === 0 || me(A.charCodeAt(0))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o, p = e.endsWith("\\"), h = u || p, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
424
|
+
(!r || e.length > 70 || h || s || o);
|
|
425
425
|
let E = "";
|
|
426
426
|
const g = r && me(e.charCodeAt(0));
|
|
427
427
|
return (m && !g || s) && (E += `
|
|
428
|
-
`), E += n, (m ||
|
|
428
|
+
`), E += n, (m || h) && (E += `
|
|
429
429
|
`), '"""' + E + '"""';
|
|
430
430
|
}
|
|
431
431
|
var c;
|
|
@@ -469,7 +469,7 @@ class lt {
|
|
|
469
469
|
if (t.next)
|
|
470
470
|
t = t.next;
|
|
471
471
|
else {
|
|
472
|
-
const n =
|
|
472
|
+
const n = pt(this, t.end);
|
|
473
473
|
t.next = n, n.prev = t, t = n;
|
|
474
474
|
}
|
|
475
475
|
while (t.kind === c.COMMENT);
|
|
@@ -483,12 +483,12 @@ 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 Le(e.charCodeAt(t)) && Pe(e.charCodeAt(t + 1));
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Le(e) {
|
|
489
489
|
return e >= 55296 && e <= 56319;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Pe(e) {
|
|
492
492
|
return e >= 56320 && e <= 57343;
|
|
493
493
|
}
|
|
494
494
|
function F(e, t) {
|
|
@@ -501,11 +501,11 @@ function F(e, t) {
|
|
|
501
501
|
}
|
|
502
502
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function b(e, t, n, i, r) {
|
|
505
505
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
506
506
|
return new ke(t, n, i, s, o, r);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function pt(e, t) {
|
|
509
509
|
const n = e.source.body, i = n.length;
|
|
510
510
|
let r = t;
|
|
511
511
|
for (; r < i; ) {
|
|
@@ -524,53 +524,53 @@ function ht(e, t) {
|
|
|
524
524
|
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
525
525
|
continue;
|
|
526
526
|
case 35:
|
|
527
|
-
return
|
|
527
|
+
return ht(e, r);
|
|
528
528
|
case 33:
|
|
529
|
-
return
|
|
529
|
+
return b(e, c.BANG, r, r + 1);
|
|
530
530
|
case 36:
|
|
531
|
-
return
|
|
531
|
+
return b(e, c.DOLLAR, r, r + 1);
|
|
532
532
|
case 38:
|
|
533
|
-
return
|
|
533
|
+
return b(e, c.AMP, r, r + 1);
|
|
534
534
|
case 40:
|
|
535
|
-
return
|
|
535
|
+
return b(e, c.PAREN_L, r, r + 1);
|
|
536
536
|
case 41:
|
|
537
|
-
return
|
|
537
|
+
return b(e, c.PAREN_R, r, r + 1);
|
|
538
538
|
case 46:
|
|
539
539
|
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
540
|
-
return
|
|
540
|
+
return b(e, c.SPREAD, r, r + 3);
|
|
541
541
|
break;
|
|
542
542
|
case 58:
|
|
543
|
-
return
|
|
543
|
+
return b(e, c.COLON, r, r + 1);
|
|
544
544
|
case 61:
|
|
545
|
-
return
|
|
545
|
+
return b(e, c.EQUALS, r, r + 1);
|
|
546
546
|
case 64:
|
|
547
|
-
return
|
|
547
|
+
return b(e, c.AT, r, r + 1);
|
|
548
548
|
case 91:
|
|
549
|
-
return
|
|
549
|
+
return b(e, c.BRACKET_L, r, r + 1);
|
|
550
550
|
case 93:
|
|
551
|
-
return
|
|
551
|
+
return b(e, c.BRACKET_R, r, r + 1);
|
|
552
552
|
case 123:
|
|
553
|
-
return
|
|
553
|
+
return b(e, c.BRACE_L, r, r + 1);
|
|
554
554
|
case 124:
|
|
555
|
-
return
|
|
555
|
+
return b(e, c.PIPE, r, r + 1);
|
|
556
556
|
case 125:
|
|
557
|
-
return
|
|
557
|
+
return b(e, c.BRACE_R, r, r + 1);
|
|
558
558
|
case 34:
|
|
559
|
-
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ?
|
|
559
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Ct(e, r) : mt(e, r);
|
|
560
560
|
}
|
|
561
561
|
if (Y(s) || s === 45)
|
|
562
562
|
return ft(e, r, s);
|
|
563
563
|
if (we(s))
|
|
564
|
-
return
|
|
565
|
-
throw
|
|
564
|
+
return vt(e, r);
|
|
565
|
+
throw x(
|
|
566
566
|
e.source,
|
|
567
567
|
r,
|
|
568
568
|
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : V(s) || se(n, r) ? `Unexpected character: ${F(e, r)}.` : `Invalid character: ${F(e, r)}.`
|
|
569
569
|
);
|
|
570
570
|
}
|
|
571
|
-
return
|
|
571
|
+
return b(e, c.EOF, i, i);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function ht(e, t) {
|
|
574
574
|
const n = e.source.body, i = n.length;
|
|
575
575
|
let r = t + 1;
|
|
576
576
|
for (; r < i; ) {
|
|
@@ -584,7 +584,7 @@ function pt(e, t) {
|
|
|
584
584
|
else
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
|
-
return
|
|
587
|
+
return b(
|
|
588
588
|
e,
|
|
589
589
|
c.COMMENT,
|
|
590
590
|
t,
|
|
@@ -597,7 +597,7 @@ function ft(e, t, n) {
|
|
|
597
597
|
let r = t, s = n, o = !1;
|
|
598
598
|
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
599
599
|
if (s = i.charCodeAt(++r), Y(s))
|
|
600
|
-
throw
|
|
600
|
+
throw x(
|
|
601
601
|
e.source,
|
|
602
602
|
r,
|
|
603
603
|
`Invalid number, unexpected digit after 0: ${F(
|
|
@@ -608,7 +608,7 @@ function ft(e, t, n) {
|
|
|
608
608
|
} else
|
|
609
609
|
r = ue(e, r, s), s = i.charCodeAt(r);
|
|
610
610
|
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = ue(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = ue(e, r, s), s = i.charCodeAt(r)), s === 46 || we(s))
|
|
611
|
-
throw
|
|
611
|
+
throw x(
|
|
612
612
|
e.source,
|
|
613
613
|
r,
|
|
614
614
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -616,7 +616,7 @@ function ft(e, t, n) {
|
|
|
616
616
|
r
|
|
617
617
|
)}.`
|
|
618
618
|
);
|
|
619
|
-
return
|
|
619
|
+
return b(
|
|
620
620
|
e,
|
|
621
621
|
o ? c.FLOAT : c.INT,
|
|
622
622
|
t,
|
|
@@ -626,7 +626,7 @@ function ft(e, t, n) {
|
|
|
626
626
|
}
|
|
627
627
|
function ue(e, t, n) {
|
|
628
628
|
if (!Y(n))
|
|
629
|
-
throw
|
|
629
|
+
throw x(
|
|
630
630
|
e.source,
|
|
631
631
|
t,
|
|
632
632
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -646,11 +646,11 @@ function mt(e, t) {
|
|
|
646
646
|
for (; r < i; ) {
|
|
647
647
|
const u = n.charCodeAt(r);
|
|
648
648
|
if (u === 34)
|
|
649
|
-
return o += n.slice(s, r),
|
|
649
|
+
return o += n.slice(s, r), b(e, c.STRING, t, r + 1, o);
|
|
650
650
|
if (u === 92) {
|
|
651
651
|
o += n.slice(s, r);
|
|
652
|
-
const
|
|
653
|
-
o +=
|
|
652
|
+
const p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? yt(e, r) : Et(e, r) : gt(e, r);
|
|
653
|
+
o += p.value, r += p.size, s = r;
|
|
654
654
|
continue;
|
|
655
655
|
}
|
|
656
656
|
if (u === 10 || u === 13)
|
|
@@ -660,7 +660,7 @@ function mt(e, t) {
|
|
|
660
660
|
else if (se(n, r))
|
|
661
661
|
r += 2;
|
|
662
662
|
else
|
|
663
|
-
throw
|
|
663
|
+
throw x(
|
|
664
664
|
e.source,
|
|
665
665
|
r,
|
|
666
666
|
`Invalid character within String: ${F(
|
|
@@ -669,7 +669,7 @@ function mt(e, t) {
|
|
|
669
669
|
)}.`
|
|
670
670
|
);
|
|
671
671
|
}
|
|
672
|
-
throw
|
|
672
|
+
throw x(e.source, r, "Unterminated string.");
|
|
673
673
|
}
|
|
674
674
|
function yt(e, t) {
|
|
675
675
|
const n = e.source.body;
|
|
@@ -687,7 +687,7 @@ function yt(e, t) {
|
|
|
687
687
|
if (i = i << 4 | $(s), i < 0)
|
|
688
688
|
break;
|
|
689
689
|
}
|
|
690
|
-
throw
|
|
690
|
+
throw x(
|
|
691
691
|
e.source,
|
|
692
692
|
t,
|
|
693
693
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -697,27 +697,27 @@ function yt(e, t) {
|
|
|
697
697
|
);
|
|
698
698
|
}
|
|
699
699
|
function Et(e, t) {
|
|
700
|
-
const n = e.source.body, i =
|
|
700
|
+
const n = e.source.body, i = xe(n, t + 2);
|
|
701
701
|
if (V(i))
|
|
702
702
|
return {
|
|
703
703
|
value: String.fromCodePoint(i),
|
|
704
704
|
size: 6
|
|
705
705
|
};
|
|
706
|
-
if (
|
|
707
|
-
const r =
|
|
708
|
-
if (
|
|
706
|
+
if (Le(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
707
|
+
const r = xe(n, t + 8);
|
|
708
|
+
if (Pe(r))
|
|
709
709
|
return {
|
|
710
710
|
value: String.fromCodePoint(i, r),
|
|
711
711
|
size: 12
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
throw
|
|
714
|
+
throw x(
|
|
715
715
|
e.source,
|
|
716
716
|
t,
|
|
717
717
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
718
718
|
);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function xe(e, t) {
|
|
721
721
|
return $(e.charCodeAt(t)) << 12 | $(e.charCodeAt(t + 1)) << 8 | $(e.charCodeAt(t + 2)) << 4 | $(e.charCodeAt(t + 3));
|
|
722
722
|
}
|
|
723
723
|
function $(e) {
|
|
@@ -768,7 +768,7 @@ function gt(e, t) {
|
|
|
768
768
|
size: 2
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
-
throw
|
|
771
|
+
throw x(
|
|
772
772
|
e.source,
|
|
773
773
|
t,
|
|
774
774
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -777,39 +777,39 @@ function gt(e, t) {
|
|
|
777
777
|
)}".`
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Ct(e, t) {
|
|
781
781
|
const n = e.source.body, i = n.length;
|
|
782
782
|
let r = e.lineStart, s = t + 3, o = s, u = "";
|
|
783
|
-
const
|
|
783
|
+
const p = [];
|
|
784
784
|
for (; s < i; ) {
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
u += n.slice(o, s),
|
|
788
|
-
const m =
|
|
785
|
+
const h = n.charCodeAt(s);
|
|
786
|
+
if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
787
|
+
u += n.slice(o, s), p.push(u);
|
|
788
|
+
const m = b(
|
|
789
789
|
e,
|
|
790
790
|
c.BLOCK_STRING,
|
|
791
791
|
t,
|
|
792
792
|
s + 3,
|
|
793
793
|
// Return a string of the lines joined with U+000A.
|
|
794
|
-
at(
|
|
794
|
+
at(p).join(`
|
|
795
795
|
`)
|
|
796
796
|
);
|
|
797
|
-
return e.line +=
|
|
797
|
+
return e.line += p.length - 1, e.lineStart = r, m;
|
|
798
798
|
}
|
|
799
|
-
if (
|
|
799
|
+
if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
800
800
|
u += n.slice(o, s), o = s + 1, s += 4;
|
|
801
801
|
continue;
|
|
802
802
|
}
|
|
803
|
-
if (
|
|
804
|
-
u += n.slice(o, s),
|
|
803
|
+
if (h === 10 || h === 13) {
|
|
804
|
+
u += n.slice(o, s), p.push(u), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, r = s;
|
|
805
805
|
continue;
|
|
806
806
|
}
|
|
807
|
-
if (V(
|
|
807
|
+
if (V(h))
|
|
808
808
|
++s;
|
|
809
809
|
else if (se(n, s))
|
|
810
810
|
s += 2;
|
|
811
811
|
else
|
|
812
|
-
throw
|
|
812
|
+
throw x(
|
|
813
813
|
e.source,
|
|
814
814
|
s,
|
|
815
815
|
`Invalid character within String: ${F(
|
|
@@ -818,9 +818,9 @@ function vt(e, t) {
|
|
|
818
818
|
)}.`
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
|
-
throw
|
|
821
|
+
throw x(e.source, s, "Unterminated string.");
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function vt(e, t) {
|
|
824
824
|
const n = e.source.body, i = n.length;
|
|
825
825
|
let r = t + 1;
|
|
826
826
|
for (; r < i; ) {
|
|
@@ -830,7 +830,7 @@ function Ct(e, t) {
|
|
|
830
830
|
else
|
|
831
831
|
break;
|
|
832
832
|
}
|
|
833
|
-
return
|
|
833
|
+
return b(
|
|
834
834
|
e,
|
|
835
835
|
c.NAME,
|
|
836
836
|
t,
|
|
@@ -839,7 +839,7 @@ function Ct(e, t) {
|
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
841
|
const Tt = 10, Fe = 2;
|
|
842
|
-
function
|
|
842
|
+
function ve(e) {
|
|
843
843
|
return oe(e, []);
|
|
844
844
|
}
|
|
845
845
|
function oe(e, t) {
|
|
@@ -865,19 +865,19 @@ function At(e, t) {
|
|
|
865
865
|
if (i !== e)
|
|
866
866
|
return typeof i == "string" ? i : oe(i, n);
|
|
867
867
|
} else if (Array.isArray(e))
|
|
868
|
-
return
|
|
869
|
-
return
|
|
868
|
+
return xt(e, n);
|
|
869
|
+
return bt(e, n);
|
|
870
870
|
}
|
|
871
871
|
function Nt(e) {
|
|
872
872
|
return typeof e.toJSON == "function";
|
|
873
873
|
}
|
|
874
|
-
function
|
|
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
|
([r, s]) => r + ": " + oe(s, t)
|
|
878
878
|
).join(", ") + " }";
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function xt(e, t) {
|
|
881
881
|
if (e.length === 0)
|
|
882
882
|
return "[]";
|
|
883
883
|
if (t.length > Fe)
|
|
@@ -911,7 +911,7 @@ const Dt = (
|
|
|
911
911
|
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
912
912
|
);
|
|
913
913
|
if (r === s) {
|
|
914
|
-
const o =
|
|
914
|
+
const o = ve(t);
|
|
915
915
|
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
916
916
|
|
|
917
917
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
@@ -934,7 +934,7 @@ class Be {
|
|
|
934
934
|
line: 1,
|
|
935
935
|
column: 1
|
|
936
936
|
}) {
|
|
937
|
-
typeof t == "string" || Z(!1, `Body must be a string. Received: ${
|
|
937
|
+
typeof t == "string" || Z(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
|
|
938
938
|
!1,
|
|
939
939
|
"line in locationOffset is 1-indexed and must be positive."
|
|
940
940
|
), this.locationOffset.column > 0 || Z(
|
|
@@ -1028,7 +1028,7 @@ class _t {
|
|
|
1028
1028
|
return this.parseDirectiveDefinition();
|
|
1029
1029
|
}
|
|
1030
1030
|
if (t)
|
|
1031
|
-
throw
|
|
1031
|
+
throw x(
|
|
1032
1032
|
this._lexer.source,
|
|
1033
1033
|
this._lexer.token.start,
|
|
1034
1034
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -1302,7 +1302,7 @@ class _t {
|
|
|
1302
1302
|
if (t)
|
|
1303
1303
|
if (this.expectToken(c.DOLLAR), this._lexer.token.kind === c.NAME) {
|
|
1304
1304
|
const i = this._lexer.token.value;
|
|
1305
|
-
throw
|
|
1305
|
+
throw x(
|
|
1306
1306
|
this._lexer.source,
|
|
1307
1307
|
n.start,
|
|
1308
1308
|
`Unexpected variable "$${i}" in constant value.`
|
|
@@ -1649,7 +1649,7 @@ class _t {
|
|
|
1649
1649
|
*/
|
|
1650
1650
|
parseEnumValueName() {
|
|
1651
1651
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
1652
|
-
throw
|
|
1652
|
+
throw x(
|
|
1653
1653
|
this._lexer.source,
|
|
1654
1654
|
this._lexer.token.start,
|
|
1655
1655
|
`${W(
|
|
@@ -1942,7 +1942,7 @@ class _t {
|
|
|
1942
1942
|
const n = this._lexer.token;
|
|
1943
1943
|
if (n.kind === t)
|
|
1944
1944
|
return this.advanceLexer(), n;
|
|
1945
|
-
throw
|
|
1945
|
+
throw x(
|
|
1946
1946
|
this._lexer.source,
|
|
1947
1947
|
n.start,
|
|
1948
1948
|
`Expected ${Ue(t)}, found ${W(n)}.`
|
|
@@ -1964,7 +1964,7 @@ class _t {
|
|
|
1964
1964
|
if (n.kind === c.NAME && n.value === t)
|
|
1965
1965
|
this.advanceLexer();
|
|
1966
1966
|
else
|
|
1967
|
-
throw
|
|
1967
|
+
throw x(
|
|
1968
1968
|
this._lexer.source,
|
|
1969
1969
|
n.start,
|
|
1970
1970
|
`Expected "${t}", found ${W(n)}.`
|
|
@@ -1983,7 +1983,7 @@ class _t {
|
|
|
1983
1983
|
*/
|
|
1984
1984
|
unexpected(t) {
|
|
1985
1985
|
const n = t ?? this._lexer.token;
|
|
1986
|
-
return
|
|
1986
|
+
return x(
|
|
1987
1987
|
this._lexer.source,
|
|
1988
1988
|
n.start,
|
|
1989
1989
|
`Unexpected ${W(n)}.`
|
|
@@ -2046,7 +2046,7 @@ class _t {
|
|
|
2046
2046
|
advanceLexer() {
|
|
2047
2047
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2048
2048
|
if (t !== void 0 && n.kind !== c.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
2049
|
-
throw
|
|
2049
|
+
throw x(
|
|
2050
2050
|
this._lexer.source,
|
|
2051
2051
|
n.start,
|
|
2052
2052
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -2233,60 +2233,60 @@ const wt = [
|
|
|
2233
2233
|
"\\u009D",
|
|
2234
2234
|
"\\u009E",
|
|
2235
2235
|
"\\u009F"
|
|
2236
|
-
],
|
|
2237
|
-
function
|
|
2236
|
+
], Lt = Object.freeze({});
|
|
2237
|
+
function Pt(e, t, n = Re) {
|
|
2238
2238
|
const i = /* @__PURE__ */ new Map();
|
|
2239
2239
|
for (const _ of Object.values(f))
|
|
2240
2240
|
i.set(_, Ft(t, _));
|
|
2241
|
-
let r, s = Array.isArray(e), o = [e], u = -1,
|
|
2241
|
+
let r, s = Array.isArray(e), o = [e], u = -1, p = [], h = e, m, E;
|
|
2242
2242
|
const g = [], A = [];
|
|
2243
2243
|
do {
|
|
2244
2244
|
u++;
|
|
2245
|
-
const _ = u === o.length, z = _ &&
|
|
2245
|
+
const _ = u === o.length, z = _ && p.length !== 0;
|
|
2246
2246
|
if (_) {
|
|
2247
|
-
if (m = A.length === 0 ? void 0 : g[g.length - 1],
|
|
2247
|
+
if (m = A.length === 0 ? void 0 : g[g.length - 1], h = E, E = A.pop(), z)
|
|
2248
2248
|
if (s) {
|
|
2249
|
-
|
|
2249
|
+
h = h.slice();
|
|
2250
2250
|
let k = 0;
|
|
2251
|
-
for (const [B, Q] of
|
|
2251
|
+
for (const [B, Q] of p) {
|
|
2252
2252
|
const J = B - k;
|
|
2253
|
-
Q === null ? (
|
|
2253
|
+
Q === null ? (h.splice(J, 1), k++) : h[J] = Q;
|
|
2254
2254
|
}
|
|
2255
2255
|
} else {
|
|
2256
|
-
|
|
2256
|
+
h = Object.defineProperties(
|
|
2257
2257
|
{},
|
|
2258
|
-
Object.getOwnPropertyDescriptors(
|
|
2258
|
+
Object.getOwnPropertyDescriptors(h)
|
|
2259
2259
|
);
|
|
2260
|
-
for (const [k, B] of
|
|
2261
|
-
|
|
2260
|
+
for (const [k, B] of p)
|
|
2261
|
+
h[k] = B;
|
|
2262
2262
|
}
|
|
2263
|
-
u = r.index, o = r.keys,
|
|
2263
|
+
u = r.index, o = r.keys, p = r.edits, s = r.inArray, r = r.prev;
|
|
2264
2264
|
} else if (E) {
|
|
2265
|
-
if (m = s ? u : o[u],
|
|
2265
|
+
if (m = s ? u : o[u], h = E[m], h == null)
|
|
2266
2266
|
continue;
|
|
2267
2267
|
g.push(m);
|
|
2268
2268
|
}
|
|
2269
2269
|
let S;
|
|
2270
|
-
if (!Array.isArray(
|
|
2270
|
+
if (!Array.isArray(h)) {
|
|
2271
2271
|
var y, N;
|
|
2272
|
-
|
|
2273
|
-
const k = _ ? (y = i.get(
|
|
2274
|
-
if (S = k == null ? void 0 : k.call(t,
|
|
2272
|
+
be(h) || Z(!1, `Invalid AST Node: ${ve(h)}.`);
|
|
2273
|
+
const k = _ ? (y = i.get(h.kind)) === null || y === void 0 ? void 0 : y.leave : (N = i.get(h.kind)) === null || N === void 0 ? void 0 : N.enter;
|
|
2274
|
+
if (S = k == null ? void 0 : k.call(t, h, m, E, g, A), S === Lt)
|
|
2275
2275
|
break;
|
|
2276
2276
|
if (S === !1) {
|
|
2277
2277
|
if (!_) {
|
|
2278
2278
|
g.pop();
|
|
2279
2279
|
continue;
|
|
2280
2280
|
}
|
|
2281
|
-
} else if (S !== void 0 && (
|
|
2282
|
-
if (
|
|
2283
|
-
|
|
2281
|
+
} else if (S !== void 0 && (p.push([m, S]), !_))
|
|
2282
|
+
if (be(S))
|
|
2283
|
+
h = S;
|
|
2284
2284
|
else {
|
|
2285
2285
|
g.pop();
|
|
2286
2286
|
continue;
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
|
-
if (S === void 0 && z &&
|
|
2289
|
+
if (S === void 0 && z && p.push([m, h]), _)
|
|
2290
2290
|
g.pop();
|
|
2291
2291
|
else {
|
|
2292
2292
|
var O;
|
|
@@ -2294,12 +2294,12 @@ function Lt(e, t, n = Re) {
|
|
|
2294
2294
|
inArray: s,
|
|
2295
2295
|
index: u,
|
|
2296
2296
|
keys: o,
|
|
2297
|
-
edits:
|
|
2297
|
+
edits: p,
|
|
2298
2298
|
prev: r
|
|
2299
|
-
}, s = Array.isArray(
|
|
2299
|
+
}, s = Array.isArray(h), o = s ? h : (O = n[h.kind]) !== null && O !== void 0 ? O : [], u = -1, p = [], E && A.push(E), E = h;
|
|
2300
2300
|
}
|
|
2301
2301
|
} while (r !== void 0);
|
|
2302
|
-
return
|
|
2302
|
+
return p.length !== 0 ? p[p.length - 1][1] : e;
|
|
2303
2303
|
}
|
|
2304
2304
|
function Ft(e, t) {
|
|
2305
2305
|
const n = e[t];
|
|
@@ -2312,7 +2312,7 @@ function Ft(e, t) {
|
|
|
2312
2312
|
};
|
|
2313
2313
|
}
|
|
2314
2314
|
function Bt(e) {
|
|
2315
|
-
return
|
|
2315
|
+
return Pt(e, Ut);
|
|
2316
2316
|
}
|
|
2317
2317
|
const Mt = 80, Ut = {
|
|
2318
2318
|
Name: {
|
|
@@ -2329,7 +2329,7 @@ const Mt = 80, Ut = {
|
|
|
2329
2329
|
},
|
|
2330
2330
|
OperationDefinition: {
|
|
2331
2331
|
leave(e) {
|
|
2332
|
-
const t =
|
|
2332
|
+
const t = v("(", d(e.variableDefinitions, ", "), ")"), n = d(
|
|
2333
2333
|
[
|
|
2334
2334
|
e.operation,
|
|
2335
2335
|
d([e.name, t]),
|
|
@@ -2341,16 +2341,16 @@ const Mt = 80, Ut = {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
},
|
|
2343
2343
|
VariableDefinition: {
|
|
2344
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t +
|
|
2344
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + v(" = ", n) + v(" ", d(i, " "))
|
|
2345
2345
|
},
|
|
2346
2346
|
SelectionSet: {
|
|
2347
2347
|
leave: ({ selections: e }) => R(e)
|
|
2348
2348
|
},
|
|
2349
2349
|
Field: {
|
|
2350
2350
|
leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
|
|
2351
|
-
const s =
|
|
2352
|
-
let o = s +
|
|
2353
|
-
return o.length > Mt && (o = s +
|
|
2351
|
+
const s = v("", e, ": ") + t;
|
|
2352
|
+
let o = s + v("(", d(n, ", "), ")");
|
|
2353
|
+
return o.length > Mt && (o = s + v(`(
|
|
2354
2354
|
`, K(d(n, `
|
|
2355
2355
|
`)), `
|
|
2356
2356
|
)`)), d([o, d(i, " "), r], " ");
|
|
@@ -2361,13 +2361,13 @@ const Mt = 80, Ut = {
|
|
|
2361
2361
|
},
|
|
2362
2362
|
// Fragments
|
|
2363
2363
|
FragmentSpread: {
|
|
2364
|
-
leave: ({ name: e, directives: t }) => "..." + e +
|
|
2364
|
+
leave: ({ name: e, directives: t }) => "..." + e + v(" ", d(t, " "))
|
|
2365
2365
|
},
|
|
2366
2366
|
InlineFragment: {
|
|
2367
2367
|
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
|
|
2368
2368
|
[
|
|
2369
2369
|
"...",
|
|
2370
|
-
|
|
2370
|
+
v("on ", e),
|
|
2371
2371
|
d(t, " "),
|
|
2372
2372
|
n
|
|
2373
2373
|
],
|
|
@@ -2377,7 +2377,7 @@ const Mt = 80, Ut = {
|
|
|
2377
2377
|
FragmentDefinition: {
|
|
2378
2378
|
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
|
|
2379
2379
|
// or removed in the future.
|
|
2380
|
-
`fragment ${e}${
|
|
2380
|
+
`fragment ${e}${v("(", d(n, ", "), ")")} on ${t} ${v("", d(i, " "), " ")}` + r
|
|
2381
2381
|
)
|
|
2382
2382
|
},
|
|
2383
2383
|
// Value
|
|
@@ -2410,7 +2410,7 @@ const Mt = 80, Ut = {
|
|
|
2410
2410
|
},
|
|
2411
2411
|
// Directive
|
|
2412
2412
|
Directive: {
|
|
2413
|
-
leave: ({ name: e, arguments: t }) => "@" + e +
|
|
2413
|
+
leave: ({ name: e, arguments: t }) => "@" + e + v("(", d(t, ", "), ")")
|
|
2414
2414
|
},
|
|
2415
2415
|
// Type
|
|
2416
2416
|
NamedType: {
|
|
@@ -2424,23 +2424,23 @@ const Mt = 80, Ut = {
|
|
|
2424
2424
|
},
|
|
2425
2425
|
// Type System Definitions
|
|
2426
2426
|
SchemaDefinition: {
|
|
2427
|
-
leave: ({ description: e, directives: t, operationTypes: n }) =>
|
|
2427
|
+
leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
|
|
2428
2428
|
`) + d(["schema", d(t, " "), R(n)], " ")
|
|
2429
2429
|
},
|
|
2430
2430
|
OperationTypeDefinition: {
|
|
2431
2431
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
2432
2432
|
},
|
|
2433
2433
|
ScalarTypeDefinition: {
|
|
2434
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2434
|
+
leave: ({ description: e, name: t, directives: n }) => v("", e, `
|
|
2435
2435
|
`) + d(["scalar", t, d(n, " ")], " ")
|
|
2436
2436
|
},
|
|
2437
2437
|
ObjectTypeDefinition: {
|
|
2438
|
-
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) =>
|
|
2438
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => v("", e, `
|
|
2439
2439
|
`) + d(
|
|
2440
2440
|
[
|
|
2441
2441
|
"type",
|
|
2442
2442
|
t,
|
|
2443
|
-
|
|
2443
|
+
v("implements ", d(n, " & ")),
|
|
2444
2444
|
d(i, " "),
|
|
2445
2445
|
R(r)
|
|
2446
2446
|
],
|
|
@@ -2448,26 +2448,26 @@ const Mt = 80, Ut = {
|
|
|
2448
2448
|
)
|
|
2449
2449
|
},
|
|
2450
2450
|
FieldDefinition: {
|
|
2451
|
-
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) =>
|
|
2452
|
-
`) + t + (Ie(n) ?
|
|
2451
|
+
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => v("", e, `
|
|
2452
|
+
`) + t + (Ie(n) ? v(`(
|
|
2453
2453
|
`, K(d(n, `
|
|
2454
2454
|
`)), `
|
|
2455
|
-
)`) :
|
|
2455
|
+
)`) : v("(", d(n, ", "), ")")) + ": " + i + v(" ", d(r, " "))
|
|
2456
2456
|
},
|
|
2457
2457
|
InputValueDefinition: {
|
|
2458
|
-
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) =>
|
|
2458
|
+
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => v("", e, `
|
|
2459
2459
|
`) + d(
|
|
2460
|
-
[t + ": " + n,
|
|
2460
|
+
[t + ": " + n, v("= ", i), d(r, " ")],
|
|
2461
2461
|
" "
|
|
2462
2462
|
)
|
|
2463
2463
|
},
|
|
2464
2464
|
InterfaceTypeDefinition: {
|
|
2465
|
-
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) =>
|
|
2465
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => v("", e, `
|
|
2466
2466
|
`) + d(
|
|
2467
2467
|
[
|
|
2468
2468
|
"interface",
|
|
2469
2469
|
t,
|
|
2470
|
-
|
|
2470
|
+
v("implements ", d(n, " & ")),
|
|
2471
2471
|
d(i, " "),
|
|
2472
2472
|
R(r)
|
|
2473
2473
|
],
|
|
@@ -2475,30 +2475,30 @@ const Mt = 80, Ut = {
|
|
|
2475
2475
|
)
|
|
2476
2476
|
},
|
|
2477
2477
|
UnionTypeDefinition: {
|
|
2478
|
-
leave: ({ description: e, name: t, directives: n, types: i }) =>
|
|
2478
|
+
leave: ({ description: e, name: t, directives: n, types: i }) => v("", e, `
|
|
2479
2479
|
`) + d(
|
|
2480
|
-
["union", t, d(n, " "),
|
|
2480
|
+
["union", t, d(n, " "), v("= ", d(i, " | "))],
|
|
2481
2481
|
" "
|
|
2482
2482
|
)
|
|
2483
2483
|
},
|
|
2484
2484
|
EnumTypeDefinition: {
|
|
2485
|
-
leave: ({ description: e, name: t, directives: n, values: i }) =>
|
|
2485
|
+
leave: ({ description: e, name: t, directives: n, values: i }) => v("", e, `
|
|
2486
2486
|
`) + d(["enum", t, d(n, " "), R(i)], " ")
|
|
2487
2487
|
},
|
|
2488
2488
|
EnumValueDefinition: {
|
|
2489
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
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: i }) =>
|
|
2493
|
+
leave: ({ description: e, name: t, directives: n, fields: i }) => v("", e, `
|
|
2494
2494
|
`) + d(["input", t, d(n, " "), R(i)], " ")
|
|
2495
2495
|
},
|
|
2496
2496
|
DirectiveDefinition: {
|
|
2497
|
-
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) =>
|
|
2498
|
-
`) + "directive @" + t + (Ie(n) ?
|
|
2497
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => v("", e, `
|
|
2498
|
+
`) + "directive @" + t + (Ie(n) ? v(`(
|
|
2499
2499
|
`, K(d(n, `
|
|
2500
2500
|
`)), `
|
|
2501
|
-
)`) :
|
|
2501
|
+
)`) : v("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
|
|
2502
2502
|
},
|
|
2503
2503
|
SchemaExtension: {
|
|
2504
2504
|
leave: ({ directives: e, operationTypes: t }) => d(
|
|
@@ -2514,7 +2514,7 @@ const Mt = 80, Ut = {
|
|
|
2514
2514
|
[
|
|
2515
2515
|
"extend type",
|
|
2516
2516
|
e,
|
|
2517
|
-
|
|
2517
|
+
v("implements ", d(t, " & ")),
|
|
2518
2518
|
d(n, " "),
|
|
2519
2519
|
R(i)
|
|
2520
2520
|
],
|
|
@@ -2526,7 +2526,7 @@ const Mt = 80, Ut = {
|
|
|
2526
2526
|
[
|
|
2527
2527
|
"extend interface",
|
|
2528
2528
|
e,
|
|
2529
|
-
|
|
2529
|
+
v("implements ", d(t, " & ")),
|
|
2530
2530
|
d(n, " "),
|
|
2531
2531
|
R(i)
|
|
2532
2532
|
],
|
|
@@ -2539,7 +2539,7 @@ const Mt = 80, Ut = {
|
|
|
2539
2539
|
"extend union",
|
|
2540
2540
|
e,
|
|
2541
2541
|
d(t, " "),
|
|
2542
|
-
|
|
2542
|
+
v("= ", d(n, " | "))
|
|
2543
2543
|
],
|
|
2544
2544
|
" "
|
|
2545
2545
|
)
|
|
@@ -2556,16 +2556,16 @@ function d(e, t = "") {
|
|
|
2556
2556
|
return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
|
|
2557
2557
|
}
|
|
2558
2558
|
function R(e) {
|
|
2559
|
-
return
|
|
2559
|
+
return v(`{
|
|
2560
2560
|
`, K(d(e, `
|
|
2561
2561
|
`)), `
|
|
2562
2562
|
}`);
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function v(e, t, n = "") {
|
|
2565
2565
|
return t != null && t !== "" ? e + t + n : "";
|
|
2566
2566
|
}
|
|
2567
2567
|
function K(e) {
|
|
2568
|
-
return
|
|
2568
|
+
return v(" ", e.replace(/\n/g, `
|
|
2569
2569
|
`));
|
|
2570
2570
|
}
|
|
2571
2571
|
function Ie(e) {
|
|
@@ -2631,11 +2631,11 @@ var ye = { exports: {} };
|
|
|
2631
2631
|
formData: "FormData" in s,
|
|
2632
2632
|
arrayBuffer: "ArrayBuffer" in s
|
|
2633
2633
|
};
|
|
2634
|
-
function
|
|
2634
|
+
function p(a) {
|
|
2635
2635
|
return a && DataView.prototype.isPrototypeOf(a);
|
|
2636
2636
|
}
|
|
2637
2637
|
if (u.arrayBuffer)
|
|
2638
|
-
var
|
|
2638
|
+
var h = [
|
|
2639
2639
|
"[object Int8Array]",
|
|
2640
2640
|
"[object Uint8Array]",
|
|
2641
2641
|
"[object Uint8ClampedArray]",
|
|
@@ -2646,7 +2646,7 @@ var ye = { exports: {} };
|
|
|
2646
2646
|
"[object Float32Array]",
|
|
2647
2647
|
"[object Float64Array]"
|
|
2648
2648
|
], m = ArrayBuffer.isView || function(a) {
|
|
2649
|
-
return a &&
|
|
2649
|
+
return a && h.indexOf(Object.prototype.toString.call(a)) > -1;
|
|
2650
2650
|
};
|
|
2651
2651
|
function E(a) {
|
|
2652
2652
|
if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
|
|
@@ -2659,8 +2659,8 @@ var ye = { exports: {} };
|
|
|
2659
2659
|
function A(a) {
|
|
2660
2660
|
var l = {
|
|
2661
2661
|
next: function() {
|
|
2662
|
-
var
|
|
2663
|
-
return { done:
|
|
2662
|
+
var C = a.shift();
|
|
2663
|
+
return { done: C === void 0, value: C };
|
|
2664
2664
|
}
|
|
2665
2665
|
};
|
|
2666
2666
|
return u.iterable && (l[Symbol.iterator] = function() {
|
|
@@ -2668,8 +2668,8 @@ var ye = { exports: {} };
|
|
|
2668
2668
|
}), l;
|
|
2669
2669
|
}
|
|
2670
2670
|
function y(a) {
|
|
2671
|
-
this.map = {}, a instanceof y ? a.forEach(function(l,
|
|
2672
|
-
this.append(
|
|
2671
|
+
this.map = {}, a instanceof y ? a.forEach(function(l, C) {
|
|
2672
|
+
this.append(C, 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) {
|
|
@@ -2678,8 +2678,8 @@ var ye = { exports: {} };
|
|
|
2678
2678
|
}
|
|
2679
2679
|
y.prototype.append = function(a, l) {
|
|
2680
2680
|
a = E(a), l = g(l);
|
|
2681
|
-
var
|
|
2682
|
-
this.map[a] =
|
|
2681
|
+
var C = this.map[a];
|
|
2682
|
+
this.map[a] = C ? C + ", " + l : l;
|
|
2683
2683
|
}, y.prototype.delete = function(a) {
|
|
2684
2684
|
delete this.map[E(a)];
|
|
2685
2685
|
}, y.prototype.get = function(a) {
|
|
@@ -2689,12 +2689,12 @@ var ye = { exports: {} };
|
|
|
2689
2689
|
}, y.prototype.set = function(a, l) {
|
|
2690
2690
|
this.map[E(a)] = g(l);
|
|
2691
2691
|
}, y.prototype.forEach = function(a, l) {
|
|
2692
|
-
for (var
|
|
2693
|
-
this.map.hasOwnProperty(
|
|
2692
|
+
for (var C in this.map)
|
|
2693
|
+
this.map.hasOwnProperty(C) && a.call(l, this.map[C], C, this);
|
|
2694
2694
|
}, y.prototype.keys = function() {
|
|
2695
2695
|
var a = [];
|
|
2696
|
-
return this.forEach(function(l,
|
|
2697
|
-
a.push(
|
|
2696
|
+
return this.forEach(function(l, C) {
|
|
2697
|
+
a.push(C);
|
|
2698
2698
|
}), A(a);
|
|
2699
2699
|
}, y.prototype.values = function() {
|
|
2700
2700
|
var a = [];
|
|
@@ -2703,8 +2703,8 @@ var ye = { exports: {} };
|
|
|
2703
2703
|
}), A(a);
|
|
2704
2704
|
}, y.prototype.entries = function() {
|
|
2705
2705
|
var a = [];
|
|
2706
|
-
return this.forEach(function(l,
|
|
2707
|
-
a.push([
|
|
2706
|
+
return this.forEach(function(l, C) {
|
|
2707
|
+
a.push([C, l]);
|
|
2708
2708
|
}), A(a);
|
|
2709
2709
|
}, u.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
|
|
2710
2710
|
function N(a) {
|
|
@@ -2713,26 +2713,26 @@ var ye = { exports: {} };
|
|
|
2713
2713
|
a.bodyUsed = !0;
|
|
2714
2714
|
}
|
|
2715
2715
|
function O(a) {
|
|
2716
|
-
return new Promise(function(l,
|
|
2716
|
+
return new Promise(function(l, C) {
|
|
2717
2717
|
a.onload = function() {
|
|
2718
2718
|
l(a.result);
|
|
2719
2719
|
}, a.onerror = function() {
|
|
2720
|
-
|
|
2720
|
+
C(a.error);
|
|
2721
2721
|
};
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
2724
|
function _(a) {
|
|
2725
|
-
var l = new FileReader(),
|
|
2726
|
-
return l.readAsArrayBuffer(a),
|
|
2725
|
+
var l = new FileReader(), C = O(l);
|
|
2726
|
+
return l.readAsArrayBuffer(a), C;
|
|
2727
2727
|
}
|
|
2728
2728
|
function z(a) {
|
|
2729
|
-
var l = new FileReader(),
|
|
2730
|
-
return l.readAsText(a),
|
|
2729
|
+
var l = new FileReader(), C = O(l);
|
|
2730
|
+
return l.readAsText(a), C;
|
|
2731
2731
|
}
|
|
2732
2732
|
function S(a) {
|
|
2733
|
-
for (var l = new Uint8Array(a),
|
|
2734
|
-
|
|
2735
|
-
return
|
|
2733
|
+
for (var l = new Uint8Array(a), C = new Array(l.length), D = 0; D < l.length; D++)
|
|
2734
|
+
C[D] = String.fromCharCode(l[D]);
|
|
2735
|
+
return C.join("");
|
|
2736
2736
|
}
|
|
2737
2737
|
function k(a) {
|
|
2738
2738
|
if (a.slice)
|
|
@@ -2742,7 +2742,7 @@ var ye = { exports: {} };
|
|
|
2742
2742
|
}
|
|
2743
2743
|
function B() {
|
|
2744
2744
|
return this.bodyUsed = !1, this._initBody = function(a) {
|
|
2745
|
-
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : u.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : u.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : u.arrayBuffer && u.blob &&
|
|
2745
|
+
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : u.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : u.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : u.arrayBuffer && u.blob && p(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
2746
2746
|
}, u.blob && (this.blob = function() {
|
|
2747
2747
|
var a = N(this);
|
|
2748
2748
|
if (a)
|
|
@@ -2778,34 +2778,34 @@ var ye = { exports: {} };
|
|
|
2778
2778
|
var l = a.toUpperCase();
|
|
2779
2779
|
return Q.indexOf(l) > -1 ? l : a;
|
|
2780
2780
|
}
|
|
2781
|
-
function
|
|
2781
|
+
function P(a, l) {
|
|
2782
2782
|
l = l || {};
|
|
2783
|
-
var
|
|
2784
|
-
if (a instanceof
|
|
2783
|
+
var C = l.body;
|
|
2784
|
+
if (a instanceof P) {
|
|
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 y(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !
|
|
2787
|
+
this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new y(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !C && a._bodyInit != null && (C = 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 y(l.headers)), this.method = J(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") &&
|
|
2790
|
+
if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new y(l.headers)), this.method = J(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && C)
|
|
2791
2791
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
2792
|
-
this._initBody(
|
|
2792
|
+
this._initBody(C);
|
|
2793
2793
|
}
|
|
2794
|
-
|
|
2795
|
-
return new
|
|
2794
|
+
P.prototype.clone = function() {
|
|
2795
|
+
return new P(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 D =
|
|
2799
|
+
return a.trim().split("&").forEach(function(C) {
|
|
2800
|
+
if (C) {
|
|
2801
|
+
var D = C.split("="), I = D.shift().replace(/\+/g, " "), T = D.join("=").replace(/\+/g, " ");
|
|
2802
2802
|
l.append(decodeURIComponent(I), decodeURIComponent(T));
|
|
2803
2803
|
}
|
|
2804
2804
|
}), l;
|
|
2805
2805
|
}
|
|
2806
2806
|
function Ge(a) {
|
|
2807
|
-
var l = new y(),
|
|
2808
|
-
return
|
|
2807
|
+
var l = new y(), C = a.replace(/\r?\n[\t ]+/g, " ");
|
|
2808
|
+
return C.split(/\r?\n/).forEach(function(D) {
|
|
2809
2809
|
var I = D.split(":"), T = I.shift().trim();
|
|
2810
2810
|
if (T) {
|
|
2811
2811
|
var X = I.join(":").trim();
|
|
@@ -2813,7 +2813,7 @@ var ye = { exports: {} };
|
|
|
2813
2813
|
}
|
|
2814
2814
|
}), l;
|
|
2815
2815
|
}
|
|
2816
|
-
B.call(
|
|
2816
|
+
B.call(P.prototype);
|
|
2817
2817
|
function w(a, l) {
|
|
2818
2818
|
l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new y(l.headers), this.url = l.url || "", this._initBody(a);
|
|
2819
2819
|
}
|
|
@@ -2837,15 +2837,15 @@ var ye = { exports: {} };
|
|
|
2837
2837
|
try {
|
|
2838
2838
|
new o.DOMException();
|
|
2839
2839
|
} catch {
|
|
2840
|
-
o.DOMException = function(l,
|
|
2841
|
-
this.message = l, this.name =
|
|
2840
|
+
o.DOMException = function(l, C) {
|
|
2841
|
+
this.message = l, this.name = C;
|
|
2842
2842
|
var D = Error(l);
|
|
2843
2843
|
this.stack = D.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(C, D) {
|
|
2848
|
+
var I = new P(a, l);
|
|
2849
2849
|
if (I.signal && I.signal.aborted)
|
|
2850
2850
|
return D(new o.DOMException("Aborted", "AbortError"));
|
|
2851
2851
|
var T = new XMLHttpRequest();
|
|
@@ -2860,7 +2860,7 @@ var ye = { exports: {} };
|
|
|
2860
2860
|
};
|
|
2861
2861
|
j.url = "responseURL" in T ? T.responseURL : j.headers.get("X-Request-URL");
|
|
2862
2862
|
var ce = "response" in T ? T.response : T.responseText;
|
|
2863
|
-
|
|
2863
|
+
C(new w(ce, j));
|
|
2864
2864
|
}, T.onerror = function() {
|
|
2865
2865
|
D(new TypeError("Network request failed"));
|
|
2866
2866
|
}, T.ontimeout = function() {
|
|
@@ -2874,7 +2874,7 @@ var ye = { exports: {} };
|
|
|
2874
2874
|
}), T.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
|
-
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request =
|
|
2877
|
+
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request = P, s.Response = w), o.Headers = y, o.Request = P, o.Response = w, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
2878
2878
|
})({});
|
|
2879
2879
|
})(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
|
|
2880
2880
|
var r = i;
|
|
@@ -2902,9 +2902,9 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2902
2902
|
}), i), []);
|
|
2903
2903
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
2904
2904
|
}, $t = (e) => async (t) => {
|
|
2905
|
-
const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: u, middleware:
|
|
2905
|
+
const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: u, middleware: p } = t, h = { ...t.headers };
|
|
2906
2906
|
let m = "", E;
|
|
2907
|
-
e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (
|
|
2907
|
+
e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (h["Content-Type"] = "application/json")) : m = Gt({
|
|
2908
2908
|
query: i,
|
|
2909
2909
|
variables: r,
|
|
2910
2910
|
operationName: s,
|
|
@@ -2912,13 +2912,13 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2912
2912
|
});
|
|
2913
2913
|
const g = {
|
|
2914
2914
|
method: e,
|
|
2915
|
-
headers:
|
|
2915
|
+
headers: h,
|
|
2916
2916
|
body: E,
|
|
2917
2917
|
...u
|
|
2918
2918
|
};
|
|
2919
2919
|
let A = n, y = g;
|
|
2920
|
-
if (
|
|
2921
|
-
const N = await Promise.resolve(
|
|
2920
|
+
if (p) {
|
|
2921
|
+
const N = await Promise.resolve(p({ ...g, url: n, operationName: s, variables: r })), { url: O, ..._ } = N;
|
|
2922
2922
|
A = O, y = _;
|
|
2923
2923
|
}
|
|
2924
2924
|
return m && (A = `${A}?${m}`), await o(A, y);
|
|
@@ -2926,7 +2926,7 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2926
2926
|
class Ht {
|
|
2927
2927
|
constructor(t, n = {}) {
|
|
2928
2928
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
|
|
2929
|
-
const [r, s, o] = i, u = We(r, s, o), { headers:
|
|
2929
|
+
const [r, s, o] = i, u = We(r, s, o), { headers: p, fetch: h = ee, method: m = "POST", requestMiddleware: E, responseMiddleware: g, ...A } = this.requestConfig, { url: y } = this;
|
|
2930
2930
|
u.signal !== void 0 && (A.signal = u.signal);
|
|
2931
2931
|
const { operationName: N } = le(u.query);
|
|
2932
2932
|
return de({
|
|
@@ -2934,11 +2934,11 @@ class Ht {
|
|
|
2934
2934
|
query: u.query,
|
|
2935
2935
|
variables: u.variables,
|
|
2936
2936
|
headers: {
|
|
2937
|
-
...M(
|
|
2937
|
+
...M(pe(p)),
|
|
2938
2938
|
...M(u.requestHeaders)
|
|
2939
2939
|
},
|
|
2940
2940
|
operationName: N,
|
|
2941
|
-
fetch:
|
|
2941
|
+
fetch: h,
|
|
2942
2942
|
method: m,
|
|
2943
2943
|
fetchOptions: A,
|
|
2944
2944
|
middleware: E
|
|
@@ -2948,7 +2948,7 @@ class Ht {
|
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
2950
2950
|
async request(t, ...n) {
|
|
2951
|
-
const [i, r] = n, s = Xe(t, i, r), { headers: o, fetch: u = ee, method:
|
|
2951
|
+
const [i, r] = n, s = Xe(t, i, r), { headers: o, fetch: u = ee, method: p = "POST", requestMiddleware: h, responseMiddleware: m, ...E } = this.requestConfig, { url: g } = this;
|
|
2952
2952
|
s.signal !== void 0 && (E.signal = s.signal);
|
|
2953
2953
|
const { query: A, operationName: y } = le(s.document);
|
|
2954
2954
|
return de({
|
|
@@ -2956,14 +2956,14 @@ class Ht {
|
|
|
2956
2956
|
query: A,
|
|
2957
2957
|
variables: s.variables,
|
|
2958
2958
|
headers: {
|
|
2959
|
-
...M(
|
|
2959
|
+
...M(pe(o)),
|
|
2960
2960
|
...M(s.requestHeaders)
|
|
2961
2961
|
},
|
|
2962
2962
|
operationName: y,
|
|
2963
2963
|
fetch: u,
|
|
2964
|
-
method:
|
|
2964
|
+
method: p,
|
|
2965
2965
|
fetchOptions: E,
|
|
2966
|
-
middleware:
|
|
2966
|
+
middleware: h
|
|
2967
2967
|
}).then((N) => (m && m(N), N.data)).catch((N) => {
|
|
2968
2968
|
throw m && m(N), N;
|
|
2969
2969
|
});
|
|
@@ -2972,14 +2972,14 @@ class Ht {
|
|
|
2972
2972
|
batchRequests(t, n) {
|
|
2973
2973
|
const i = Ze(t, n), { headers: r, ...s } = this.requestConfig;
|
|
2974
2974
|
i.signal !== void 0 && (s.signal = i.signal);
|
|
2975
|
-
const o = i.documents.map(({ document:
|
|
2975
|
+
const o = i.documents.map(({ document: p }) => le(p).query), u = i.documents.map(({ variables: p }) => p);
|
|
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
2980
|
variables: u,
|
|
2981
2981
|
headers: {
|
|
2982
|
-
...M(
|
|
2982
|
+
...M(pe(r)),
|
|
2983
2983
|
...M(i.requestHeaders)
|
|
2984
2984
|
},
|
|
2985
2985
|
operationName: void 0,
|
|
@@ -2987,8 +2987,8 @@ class Ht {
|
|
|
2987
2987
|
method: this.requestConfig.method || "POST",
|
|
2988
2988
|
fetchOptions: s,
|
|
2989
2989
|
middleware: this.requestConfig.requestMiddleware
|
|
2990
|
-
}).then((
|
|
2991
|
-
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(
|
|
2990
|
+
}).then((p) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p.data)).catch((p) => {
|
|
2991
|
+
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p;
|
|
2992
2992
|
});
|
|
2993
2993
|
}
|
|
2994
2994
|
setHeaders(t) {
|
|
@@ -3009,8 +3009,8 @@ class Ht {
|
|
|
3009
3009
|
}
|
|
3010
3010
|
}
|
|
3011
3011
|
const de = async (e) => {
|
|
3012
|
-
const { query: t, variables: n, fetchOptions: i } = e, r = $t(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge),
|
|
3013
|
-
if (o.ok &&
|
|
3012
|
+
const { query: t, variables: n, fetchOptions: i } = e, r = $t(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), p = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, h = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
|
|
3013
|
+
if (o.ok && h && p) {
|
|
3014
3014
|
const { errors: m, ...E } = (Array.isArray(u), u), g = i.errorPolicy === "ignore" ? E : u;
|
|
3015
3015
|
return {
|
|
3016
3016
|
...s ? { data: g } : g,
|
|
@@ -3033,14 +3033,14 @@ const de = async (e) => {
|
|
|
3033
3033
|
return r.stringify({ query: e, variables: t, operationName: n });
|
|
3034
3034
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3035
3035
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3036
|
-
const s = e.reduce((o, u,
|
|
3036
|
+
const s = e.reduce((o, u, p) => (o.push({ query: u, variables: t ? t[p] : void 0 }), o), []);
|
|
3037
3037
|
return r.stringify(s);
|
|
3038
3038
|
}, zt = async (e, t) => {
|
|
3039
3039
|
let n;
|
|
3040
3040
|
return e.headers.forEach((i, r) => {
|
|
3041
3041
|
r.toLowerCase() === "content-type" && (n = i);
|
|
3042
3042
|
}), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
|
|
3043
|
-
},
|
|
3043
|
+
}, pe = (e) => typeof e == "function" ? e() : e;
|
|
3044
3044
|
var re = function() {
|
|
3045
3045
|
return re = Object.assign || function(t) {
|
|
3046
3046
|
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
|
@@ -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 L = q, nn = L`
|
|
3130
3130
|
query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3131
3131
|
locationAvailabilities(
|
|
3132
3132
|
sku: $sku
|
|
@@ -3163,7 +3163,7 @@ const P = q, nn = P`
|
|
|
3163
3163
|
}
|
|
3164
3164
|
}
|
|
3165
3165
|
}
|
|
3166
|
-
`, rn =
|
|
3166
|
+
`, rn = L`
|
|
3167
3167
|
query GetLocationAvailability($sku: String!, $locationID: ID!) {
|
|
3168
3168
|
locationAvailability(sku: $sku, locationID: $locationID) {
|
|
3169
3169
|
location {
|
|
@@ -3187,7 +3187,7 @@ const P = q, nn = P`
|
|
|
3187
3187
|
inventoryQuantity
|
|
3188
3188
|
}
|
|
3189
3189
|
}
|
|
3190
|
-
`, sn =
|
|
3190
|
+
`, sn = L`
|
|
3191
3191
|
query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
|
|
3192
3192
|
purchasingCustomerMetafield(namespace: $namespace, key: $key) {
|
|
3193
3193
|
id
|
|
@@ -3196,14 +3196,14 @@ const P = q, nn = P`
|
|
|
3196
3196
|
value
|
|
3197
3197
|
}
|
|
3198
3198
|
}
|
|
3199
|
-
`, on =
|
|
3199
|
+
`, on = L`
|
|
3200
3200
|
query GetPoints {
|
|
3201
3201
|
purchasingCustomer {
|
|
3202
3202
|
pointsApproved
|
|
3203
3203
|
pointsPending
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
|
-
`, an =
|
|
3206
|
+
`, an = L`
|
|
3207
3207
|
query GetLocations($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3208
3208
|
locations(first: $first, after: $after, isReverse: $isReverse) {
|
|
3209
3209
|
nodes {
|
|
@@ -3232,11 +3232,11 @@ const P = q, nn = P`
|
|
|
3232
3232
|
}
|
|
3233
3233
|
}
|
|
3234
3234
|
}
|
|
3235
|
-
`, cn =
|
|
3235
|
+
`, cn = L`
|
|
3236
3236
|
query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3237
3237
|
purchasingCustomer {
|
|
3238
3238
|
id
|
|
3239
|
-
|
|
3239
|
+
orderPriceAdjustmentRules(first: $first, after: $after, isReverse: $isReverse) {
|
|
3240
3240
|
nodes {
|
|
3241
3241
|
id
|
|
3242
3242
|
title
|
|
@@ -3244,6 +3244,9 @@ const P = q, nn = P`
|
|
|
3244
3244
|
description
|
|
3245
3245
|
code
|
|
3246
3246
|
customerApplicable
|
|
3247
|
+
shopifyStoreApplicable
|
|
3248
|
+
applicableLocationCount
|
|
3249
|
+
hasApplicableLocations
|
|
3247
3250
|
startsAt
|
|
3248
3251
|
endsAt
|
|
3249
3252
|
createdAt
|
|
@@ -3258,14 +3261,14 @@ const P = q, nn = P`
|
|
|
3258
3261
|
}
|
|
3259
3262
|
}
|
|
3260
3263
|
}
|
|
3261
|
-
`, un =
|
|
3264
|
+
`, un = L`
|
|
3262
3265
|
query GetPurchasingCustomerDiscountCodeCount {
|
|
3263
3266
|
purchasingCustomer {
|
|
3264
3267
|
id
|
|
3265
|
-
|
|
3268
|
+
orderPriceAdjustmentRuleCount
|
|
3266
3269
|
}
|
|
3267
3270
|
}
|
|
3268
|
-
`, ln =
|
|
3271
|
+
`, ln = L`
|
|
3269
3272
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
3270
3273
|
purchasingCustomer {
|
|
3271
3274
|
id
|
|
@@ -3287,6 +3290,24 @@ const P = q, nn = P`
|
|
|
3287
3290
|
pointChangeCreatedAt
|
|
3288
3291
|
createdAt
|
|
3289
3292
|
}
|
|
3293
|
+
retailLocation {
|
|
3294
|
+
id
|
|
3295
|
+
name
|
|
3296
|
+
phone
|
|
3297
|
+
address {
|
|
3298
|
+
id
|
|
3299
|
+
countryCode
|
|
3300
|
+
country
|
|
3301
|
+
postalCode
|
|
3302
|
+
provinceCode
|
|
3303
|
+
province
|
|
3304
|
+
city
|
|
3305
|
+
address1
|
|
3306
|
+
address2
|
|
3307
|
+
updatedAt
|
|
3308
|
+
createdAt
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3290
3311
|
}
|
|
3291
3312
|
pageInfo {
|
|
3292
3313
|
startCursor
|
|
@@ -3297,7 +3318,7 @@ const P = q, nn = P`
|
|
|
3297
3318
|
}
|
|
3298
3319
|
}
|
|
3299
3320
|
}
|
|
3300
|
-
`, dn =
|
|
3321
|
+
`, dn = L`
|
|
3301
3322
|
query GetPurchasingCustomerRank {
|
|
3302
3323
|
purchasingCustomer {
|
|
3303
3324
|
currentCustomerRank {
|
|
@@ -3336,8 +3357,8 @@ const P = q, nn = P`
|
|
|
3336
3357
|
}
|
|
3337
3358
|
}
|
|
3338
3359
|
}
|
|
3339
|
-
`,
|
|
3340
|
-
function
|
|
3360
|
+
`, pn = (e, t, n, i) => e();
|
|
3361
|
+
function hn(e, t = pn) {
|
|
3341
3362
|
return {
|
|
3342
3363
|
GetLocationAvailabilities(n, i) {
|
|
3343
3364
|
return t((r) => e.request(nn, n, { ...i, ...r }), "GetLocationAvailabilities", "query", n);
|
|
@@ -3371,7 +3392,7 @@ function pn(e, t = hn) {
|
|
|
3371
3392
|
class mn {
|
|
3372
3393
|
constructor(t) {
|
|
3373
3394
|
Te(this, "api");
|
|
3374
|
-
this.api =
|
|
3395
|
+
this.api = hn(
|
|
3375
3396
|
new Ht(`${t}/apps/sq-api`, {
|
|
3376
3397
|
headers: {
|
|
3377
3398
|
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
@@ -3502,6 +3523,7 @@ class mn {
|
|
|
3502
3523
|
/**
|
|
3503
3524
|
* getPurchasingCustomerDiscounts は購入者の割引情報を返します。
|
|
3504
3525
|
*
|
|
3526
|
+
* @param {string} [retailLocationID] 取得したい割引情報が適用されているLocationのID。
|
|
3505
3527
|
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
3506
3528
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3507
3529
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
@@ -3514,7 +3536,7 @@ class mn {
|
|
|
3514
3536
|
});
|
|
3515
3537
|
return r.purchasingCustomer ? {
|
|
3516
3538
|
id: r.purchasingCustomer.id,
|
|
3517
|
-
nodes: r.purchasingCustomer.
|
|
3539
|
+
nodes: r.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
|
|
3518
3540
|
(s) => ({
|
|
3519
3541
|
id: s.id,
|
|
3520
3542
|
title: s.title,
|
|
@@ -3522,13 +3544,16 @@ class mn {
|
|
|
3522
3544
|
description: s.description,
|
|
3523
3545
|
code: s.code,
|
|
3524
3546
|
customerApplicable: s.customerApplicable,
|
|
3547
|
+
shopifyStoreApplicable: s.shopifyStoreApplicable,
|
|
3548
|
+
applicableLocationCount: s.applicableLocationCount,
|
|
3549
|
+
hasApplicableLocations: s.hasApplicableLocations,
|
|
3525
3550
|
startsAt: new Date(s.startsAt),
|
|
3526
3551
|
endsAt: new Date(s.endsAt),
|
|
3527
3552
|
createdAt: new Date(s.createdAt),
|
|
3528
3553
|
updatedAt: new Date(s.updatedAt)
|
|
3529
3554
|
})
|
|
3530
3555
|
) ?? [],
|
|
3531
|
-
pageInfo: r.purchasingCustomer.
|
|
3556
|
+
pageInfo: r.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
|
|
3532
3557
|
} : null;
|
|
3533
3558
|
}
|
|
3534
3559
|
/**
|
|
@@ -3561,7 +3586,23 @@ class mn {
|
|
|
3561
3586
|
o.pointChange.pointChangeCreatedAt
|
|
3562
3587
|
),
|
|
3563
3588
|
createdAt: new Date(o.pointChange.createdAt)
|
|
3564
|
-
}
|
|
3589
|
+
},
|
|
3590
|
+
retailLocation: o.retailLocation ? {
|
|
3591
|
+
id: o.retailLocation.id,
|
|
3592
|
+
name: o.retailLocation.name,
|
|
3593
|
+
phone: o.retailLocation.phone,
|
|
3594
|
+
address: o.retailLocation.address ? {
|
|
3595
|
+
id: o.retailLocation.address.id,
|
|
3596
|
+
countryCode: o.retailLocation.address.countryCode,
|
|
3597
|
+
country: o.retailLocation.address.country,
|
|
3598
|
+
postalCode: o.retailLocation.address.postalCode,
|
|
3599
|
+
provinceCode: o.retailLocation.address.provinceCode,
|
|
3600
|
+
province: o.retailLocation.address.province,
|
|
3601
|
+
city: o.retailLocation.address.city,
|
|
3602
|
+
address1: o.retailLocation.address.address1,
|
|
3603
|
+
address2: o.retailLocation.address.address2
|
|
3604
|
+
} : void 0
|
|
3605
|
+
} : void 0
|
|
3565
3606
|
})
|
|
3566
3607
|
),
|
|
3567
3608
|
pageInfo: s.purchasingCustomer.pointChangeActivities.pageInfo
|
|
@@ -3617,7 +3658,7 @@ class mn {
|
|
|
3617
3658
|
*/
|
|
3618
3659
|
async getPurchasingCustomerDiscountCodeCount() {
|
|
3619
3660
|
var n;
|
|
3620
|
-
return ((n = (await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer) == null ? void 0 : n.
|
|
3661
|
+
return ((n = (await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer) == null ? void 0 : n.orderPriceAdjustmentRuleCount) ?? 0;
|
|
3621
3662
|
}
|
|
3622
3663
|
}
|
|
3623
3664
|
export {
|