@builtbystack/sq-shopify-theme-sdk 0.0.17 → 0.0.19
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 +138 -0
- package/dist/sq-shopify-theme-sdk.d.ts +40 -0
- package/dist/sq-shopify-theme-sdk.js +259 -192
- package/dist/sq-shopify-theme-sdk.umd.js +59 -29
- package/package.json +1 -1
|
@@ -32,16 +32,16 @@ const Ce = JSON, Qe = (e) => e.toUpperCase(), Je = (e) => {
|
|
|
32
32
|
variables: t,
|
|
33
33
|
requestHeaders: n,
|
|
34
34
|
signal: void 0
|
|
35
|
-
},
|
|
35
|
+
}, Ke = (e, t) => e.documents ? e : {
|
|
36
36
|
documents: e,
|
|
37
37
|
requestHeaders: t,
|
|
38
38
|
signal: void 0
|
|
39
39
|
};
|
|
40
|
-
function
|
|
40
|
+
function K(e, t) {
|
|
41
41
|
if (!!!e)
|
|
42
42
|
throw new Error(t);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ze(e) {
|
|
45
45
|
return typeof e == "object" && e !== null;
|
|
46
46
|
}
|
|
47
47
|
function et(e, t) {
|
|
@@ -156,7 +156,7 @@ class Ee extends Error {
|
|
|
156
156
|
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
|
|
157
157
|
);
|
|
158
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
|
-
const T =
|
|
159
|
+
const T = Ze(
|
|
160
160
|
m == null ? void 0 : m.extensions
|
|
161
161
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
162
162
|
this.extensions = (s = y ?? T) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
@@ -216,7 +216,7 @@ class Ee extends Error {
|
|
|
216
216
|
function Ne(e) {
|
|
217
217
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function b(e, t, n) {
|
|
220
220
|
return new Ee(`Syntax Error: ${n}`, {
|
|
221
221
|
source: e,
|
|
222
222
|
positions: [t]
|
|
@@ -293,7 +293,7 @@ class Re {
|
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
const
|
|
296
|
+
const ke = {
|
|
297
297
|
Name: [],
|
|
298
298
|
Document: ["definitions"],
|
|
299
299
|
OperationDefinition: [
|
|
@@ -367,8 +367,8 @@ const _e = {
|
|
|
367
367
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
368
368
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
369
369
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
370
|
-
}, st = new Set(Object.keys(
|
|
371
|
-
function
|
|
370
|
+
}, st = new Set(Object.keys(ke));
|
|
371
|
+
function Ie(e) {
|
|
372
372
|
const t = e == null ? void 0 : e.kind;
|
|
373
373
|
return typeof t == "string" && st.has(t);
|
|
374
374
|
}
|
|
@@ -390,15 +390,15 @@ function me(e) {
|
|
|
390
390
|
function Y(e) {
|
|
391
391
|
return e >= 48 && e <= 57;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function _e(e) {
|
|
394
394
|
return e >= 97 && e <= 122 || // A-Z
|
|
395
395
|
e >= 65 && e <= 90;
|
|
396
396
|
}
|
|
397
397
|
function Pe(e) {
|
|
398
|
-
return
|
|
398
|
+
return _e(e) || e === 95;
|
|
399
399
|
}
|
|
400
400
|
function ot(e) {
|
|
401
|
-
return
|
|
401
|
+
return _e(e) || Y(e) || e === 95;
|
|
402
402
|
}
|
|
403
403
|
function at(e) {
|
|
404
404
|
var t;
|
|
@@ -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)) && we(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 we(e) {
|
|
492
492
|
return e >= 56320 && e <= 57343;
|
|
493
493
|
}
|
|
494
494
|
function F(e, t) {
|
|
@@ -501,7 +501,7 @@ function F(e, t) {
|
|
|
501
501
|
}
|
|
502
502
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function I(e, t, n, r, i) {
|
|
505
505
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
506
506
|
return new Re(t, n, r, s, o, i);
|
|
507
507
|
}
|
|
@@ -526,35 +526,35 @@ function ht(e, t) {
|
|
|
526
526
|
case 35:
|
|
527
527
|
return pt(e, i);
|
|
528
528
|
case 33:
|
|
529
|
-
return
|
|
529
|
+
return I(e, u.BANG, i, i + 1);
|
|
530
530
|
case 36:
|
|
531
|
-
return
|
|
531
|
+
return I(e, u.DOLLAR, i, i + 1);
|
|
532
532
|
case 38:
|
|
533
|
-
return
|
|
533
|
+
return I(e, u.AMP, i, i + 1);
|
|
534
534
|
case 40:
|
|
535
|
-
return
|
|
535
|
+
return I(e, u.PAREN_L, i, i + 1);
|
|
536
536
|
case 41:
|
|
537
|
-
return
|
|
537
|
+
return I(e, u.PAREN_R, i, i + 1);
|
|
538
538
|
case 46:
|
|
539
539
|
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
|
|
540
|
-
return
|
|
540
|
+
return I(e, u.SPREAD, i, i + 3);
|
|
541
541
|
break;
|
|
542
542
|
case 58:
|
|
543
|
-
return
|
|
543
|
+
return I(e, u.COLON, i, i + 1);
|
|
544
544
|
case 61:
|
|
545
|
-
return
|
|
545
|
+
return I(e, u.EQUALS, i, i + 1);
|
|
546
546
|
case 64:
|
|
547
|
-
return
|
|
547
|
+
return I(e, u.AT, i, i + 1);
|
|
548
548
|
case 91:
|
|
549
|
-
return
|
|
549
|
+
return I(e, u.BRACKET_L, i, i + 1);
|
|
550
550
|
case 93:
|
|
551
|
-
return
|
|
551
|
+
return I(e, u.BRACKET_R, i, i + 1);
|
|
552
552
|
case 123:
|
|
553
|
-
return
|
|
553
|
+
return I(e, u.BRACE_L, i, i + 1);
|
|
554
554
|
case 124:
|
|
555
|
-
return
|
|
555
|
+
return I(e, u.PIPE, i, i + 1);
|
|
556
556
|
case 125:
|
|
557
|
-
return
|
|
557
|
+
return I(e, u.BRACE_R, i, i + 1);
|
|
558
558
|
case 34:
|
|
559
559
|
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Et(e, i) : mt(e, i);
|
|
560
560
|
}
|
|
@@ -562,13 +562,13 @@ function ht(e, t) {
|
|
|
562
562
|
return ft(e, i, s);
|
|
563
563
|
if (Pe(s))
|
|
564
564
|
return vt(e, i);
|
|
565
|
-
throw
|
|
565
|
+
throw b(
|
|
566
566
|
e.source,
|
|
567
567
|
i,
|
|
568
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
|
|
571
|
+
return I(e, u.EOF, r, r);
|
|
572
572
|
}
|
|
573
573
|
function pt(e, t) {
|
|
574
574
|
const n = e.source.body, r = n.length;
|
|
@@ -584,7 +584,7 @@ function pt(e, t) {
|
|
|
584
584
|
else
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
|
-
return
|
|
587
|
+
return I(
|
|
588
588
|
e,
|
|
589
589
|
u.COMMENT,
|
|
590
590
|
t,
|
|
@@ -597,7 +597,7 @@ function ft(e, t, n) {
|
|
|
597
597
|
let i = t, s = n, o = !1;
|
|
598
598
|
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
599
599
|
if (s = r.charCodeAt(++i), Y(s))
|
|
600
|
-
throw
|
|
600
|
+
throw b(
|
|
601
601
|
e.source,
|
|
602
602
|
i,
|
|
603
603
|
`Invalid number, unexpected digit after 0: ${F(
|
|
@@ -608,7 +608,7 @@ function ft(e, t, n) {
|
|
|
608
608
|
} else
|
|
609
609
|
i = ce(e, i, s), s = r.charCodeAt(i);
|
|
610
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
|
-
throw
|
|
611
|
+
throw b(
|
|
612
612
|
e.source,
|
|
613
613
|
i,
|
|
614
614
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -616,7 +616,7 @@ function ft(e, t, n) {
|
|
|
616
616
|
i
|
|
617
617
|
)}.`
|
|
618
618
|
);
|
|
619
|
-
return
|
|
619
|
+
return I(
|
|
620
620
|
e,
|
|
621
621
|
o ? u.FLOAT : u.INT,
|
|
622
622
|
t,
|
|
@@ -626,7 +626,7 @@ function ft(e, t, n) {
|
|
|
626
626
|
}
|
|
627
627
|
function ce(e, t, n) {
|
|
628
628
|
if (!Y(n))
|
|
629
|
-
throw
|
|
629
|
+
throw b(
|
|
630
630
|
e.source,
|
|
631
631
|
t,
|
|
632
632
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -646,7 +646,7 @@ function mt(e, t) {
|
|
|
646
646
|
for (; i < r; ) {
|
|
647
647
|
const c = n.charCodeAt(i);
|
|
648
648
|
if (c === 34)
|
|
649
|
-
return o += n.slice(s, i),
|
|
649
|
+
return o += n.slice(s, i), I(e, u.STRING, t, i + 1, o);
|
|
650
650
|
if (c === 92) {
|
|
651
651
|
o += n.slice(s, i);
|
|
652
652
|
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? gt(e, i) : yt(e, i) : Ct(e, i);
|
|
@@ -660,7 +660,7 @@ function mt(e, t) {
|
|
|
660
660
|
else if (se(n, i))
|
|
661
661
|
i += 2;
|
|
662
662
|
else
|
|
663
|
-
throw
|
|
663
|
+
throw b(
|
|
664
664
|
e.source,
|
|
665
665
|
i,
|
|
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 b(e.source, i, "Unterminated string.");
|
|
673
673
|
}
|
|
674
674
|
function gt(e, t) {
|
|
675
675
|
const n = e.source.body;
|
|
@@ -687,7 +687,7 @@ function gt(e, t) {
|
|
|
687
687
|
if (r = r << 4 | $(s), r < 0)
|
|
688
688
|
break;
|
|
689
689
|
}
|
|
690
|
-
throw
|
|
690
|
+
throw b(
|
|
691
691
|
e.source,
|
|
692
692
|
t,
|
|
693
693
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -697,27 +697,27 @@ function gt(e, t) {
|
|
|
697
697
|
);
|
|
698
698
|
}
|
|
699
699
|
function yt(e, t) {
|
|
700
|
-
const n = e.source.body, r =
|
|
700
|
+
const n = e.source.body, r = be(n, t + 2);
|
|
701
701
|
if (V(r))
|
|
702
702
|
return {
|
|
703
703
|
value: String.fromCodePoint(r),
|
|
704
704
|
size: 6
|
|
705
705
|
};
|
|
706
|
-
if (
|
|
707
|
-
const i =
|
|
708
|
-
if (
|
|
706
|
+
if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
707
|
+
const i = be(n, t + 8);
|
|
708
|
+
if (we(i))
|
|
709
709
|
return {
|
|
710
710
|
value: String.fromCodePoint(r, i),
|
|
711
711
|
size: 12
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
throw
|
|
714
|
+
throw b(
|
|
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 be(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 Ct(e, t) {
|
|
|
768
768
|
size: 2
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
-
throw
|
|
771
|
+
throw b(
|
|
772
772
|
e.source,
|
|
773
773
|
t,
|
|
774
774
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -785,7 +785,7 @@ function Et(e, t) {
|
|
|
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
|
-
const m =
|
|
788
|
+
const m = I(
|
|
789
789
|
e,
|
|
790
790
|
u.BLOCK_STRING,
|
|
791
791
|
t,
|
|
@@ -809,7 +809,7 @@ function Et(e, t) {
|
|
|
809
809
|
else if (se(n, s))
|
|
810
810
|
s += 2;
|
|
811
811
|
else
|
|
812
|
-
throw
|
|
812
|
+
throw b(
|
|
813
813
|
e.source,
|
|
814
814
|
s,
|
|
815
815
|
`Invalid character within String: ${F(
|
|
@@ -818,7 +818,7 @@ function Et(e, t) {
|
|
|
818
818
|
)}.`
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
|
-
throw
|
|
821
|
+
throw b(e.source, s, "Unterminated string.");
|
|
822
822
|
}
|
|
823
823
|
function vt(e, t) {
|
|
824
824
|
const n = e.source.body, r = n.length;
|
|
@@ -830,7 +830,7 @@ function vt(e, t) {
|
|
|
830
830
|
else
|
|
831
831
|
break;
|
|
832
832
|
}
|
|
833
|
-
return
|
|
833
|
+
return I(
|
|
834
834
|
e,
|
|
835
835
|
u.NAME,
|
|
836
836
|
t,
|
|
@@ -865,19 +865,19 @@ function Tt(e, t) {
|
|
|
865
865
|
if (r !== e)
|
|
866
866
|
return typeof r == "string" ? r : oe(r, n);
|
|
867
867
|
} else if (Array.isArray(e))
|
|
868
|
-
return
|
|
869
|
-
return
|
|
868
|
+
return bt(e, n);
|
|
869
|
+
return It(e, n);
|
|
870
870
|
}
|
|
871
871
|
function Nt(e) {
|
|
872
872
|
return typeof e.toJSON == "function";
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function It(e, t) {
|
|
875
875
|
const n = Object.entries(e);
|
|
876
|
-
return n.length === 0 ? "{}" : t.length > Fe ? "[" +
|
|
876
|
+
return n.length === 0 ? "{}" : t.length > Fe ? "[" + xt(e) + "]" : "{ " + n.map(
|
|
877
877
|
([i, s]) => i + ": " + oe(s, t)
|
|
878
878
|
).join(", ") + " }";
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function bt(e, t) {
|
|
881
881
|
if (e.length === 0)
|
|
882
882
|
return "[]";
|
|
883
883
|
if (t.length > Fe)
|
|
@@ -887,7 +887,7 @@ function xt(e, t) {
|
|
|
887
887
|
i.push(oe(e[s], t));
|
|
888
888
|
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function xt(e) {
|
|
891
891
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
892
892
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
893
893
|
const n = e.constructor.name;
|
|
@@ -929,15 +929,15 @@ spurious results.`);
|
|
|
929
929
|
return !1;
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
|
-
class
|
|
932
|
+
class Be {
|
|
933
933
|
constructor(t, n = "GraphQL request", r = {
|
|
934
934
|
line: 1,
|
|
935
935
|
column: 1
|
|
936
936
|
}) {
|
|
937
|
-
typeof t == "string" ||
|
|
937
|
+
typeof t == "string" || K(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || K(
|
|
938
938
|
!1,
|
|
939
939
|
"line in locationOffset is 1-indexed and must be positive."
|
|
940
|
-
), this.locationOffset.column > 0 ||
|
|
940
|
+
), this.locationOffset.column > 0 || K(
|
|
941
941
|
!1,
|
|
942
942
|
"column in locationOffset is 1-indexed and must be positive."
|
|
943
943
|
);
|
|
@@ -947,14 +947,14 @@ class Ue {
|
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
function Dt(e) {
|
|
950
|
-
return St(e,
|
|
950
|
+
return St(e, Be);
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function Ue(e, t) {
|
|
953
953
|
return new Ot(e, t).parseDocument();
|
|
954
954
|
}
|
|
955
955
|
class Ot {
|
|
956
956
|
constructor(t, n = {}) {
|
|
957
|
-
const r = Dt(t) ? t : new
|
|
957
|
+
const r = Dt(t) ? t : new Be(t);
|
|
958
958
|
this._lexer = new lt(r), this._options = n, this._tokenCounter = 0;
|
|
959
959
|
}
|
|
960
960
|
/**
|
|
@@ -1028,7 +1028,7 @@ class Ot {
|
|
|
1028
1028
|
return this.parseDirectiveDefinition();
|
|
1029
1029
|
}
|
|
1030
1030
|
if (t)
|
|
1031
|
-
throw
|
|
1031
|
+
throw b(
|
|
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 Ot {
|
|
|
1302
1302
|
if (t)
|
|
1303
1303
|
if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
|
|
1304
1304
|
const r = this._lexer.token.value;
|
|
1305
|
-
throw
|
|
1305
|
+
throw b(
|
|
1306
1306
|
this._lexer.source,
|
|
1307
1307
|
n.start,
|
|
1308
1308
|
`Unexpected variable "$${r}" in constant value.`
|
|
@@ -1649,7 +1649,7 @@ class Ot {
|
|
|
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 b(
|
|
1653
1653
|
this._lexer.source,
|
|
1654
1654
|
this._lexer.token.start,
|
|
1655
1655
|
`${W(
|
|
@@ -1942,7 +1942,7 @@ class Ot {
|
|
|
1942
1942
|
const n = this._lexer.token;
|
|
1943
1943
|
if (n.kind === t)
|
|
1944
1944
|
return this.advanceLexer(), n;
|
|
1945
|
-
throw
|
|
1945
|
+
throw b(
|
|
1946
1946
|
this._lexer.source,
|
|
1947
1947
|
n.start,
|
|
1948
1948
|
`Expected ${Me(t)}, found ${W(n)}.`
|
|
@@ -1964,7 +1964,7 @@ class Ot {
|
|
|
1964
1964
|
if (n.kind === u.NAME && n.value === t)
|
|
1965
1965
|
this.advanceLexer();
|
|
1966
1966
|
else
|
|
1967
|
-
throw
|
|
1967
|
+
throw b(
|
|
1968
1968
|
this._lexer.source,
|
|
1969
1969
|
n.start,
|
|
1970
1970
|
`Expected "${t}", found ${W(n)}.`
|
|
@@ -1983,7 +1983,7 @@ class Ot {
|
|
|
1983
1983
|
*/
|
|
1984
1984
|
unexpected(t) {
|
|
1985
1985
|
const n = t ?? this._lexer.token;
|
|
1986
|
-
return
|
|
1986
|
+
return b(
|
|
1987
1987
|
this._lexer.source,
|
|
1988
1988
|
n.start,
|
|
1989
1989
|
`Unexpected ${W(n)}.`
|
|
@@ -2046,7 +2046,7 @@ class Ot {
|
|
|
2046
2046
|
advanceLexer() {
|
|
2047
2047
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2048
2048
|
if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
2049
|
-
throw
|
|
2049
|
+
throw b(
|
|
2050
2050
|
this._lexer.source,
|
|
2051
2051
|
n.start,
|
|
2052
2052
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -2061,10 +2061,10 @@ function Me(e) {
|
|
|
2061
2061
|
return dt(e) ? `"${e}"` : e;
|
|
2062
2062
|
}
|
|
2063
2063
|
function Rt(e) {
|
|
2064
|
-
return `"${e.replace(
|
|
2064
|
+
return `"${e.replace(kt, _t)}"`;
|
|
2065
2065
|
}
|
|
2066
|
-
const
|
|
2067
|
-
function
|
|
2066
|
+
const kt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2067
|
+
function _t(e) {
|
|
2068
2068
|
return Pt[e.charCodeAt(0)];
|
|
2069
2069
|
}
|
|
2070
2070
|
const Pt = [
|
|
@@ -2233,32 +2233,32 @@ const Pt = [
|
|
|
2233
2233
|
"\\u009D",
|
|
2234
2234
|
"\\u009E",
|
|
2235
2235
|
"\\u009F"
|
|
2236
|
-
],
|
|
2237
|
-
function
|
|
2236
|
+
], Lt = Object.freeze({});
|
|
2237
|
+
function wt(e, t, n = ke) {
|
|
2238
2238
|
const r = /* @__PURE__ */ new Map();
|
|
2239
|
-
for (const
|
|
2240
|
-
r.set(
|
|
2239
|
+
for (const R of Object.values(f))
|
|
2240
|
+
r.set(R, Ft(t, R));
|
|
2241
2241
|
let i, s = Array.isArray(e), o = [e], c = -1, h = [], p = e, m, y;
|
|
2242
2242
|
const C = [], T = [];
|
|
2243
2243
|
do {
|
|
2244
2244
|
c++;
|
|
2245
|
-
const
|
|
2246
|
-
if (
|
|
2245
|
+
const R = c === o.length, z = R && h.length !== 0;
|
|
2246
|
+
if (R) {
|
|
2247
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
|
-
let
|
|
2251
|
-
for (const [
|
|
2252
|
-
const J =
|
|
2253
|
-
Q === null ? (p.splice(J, 1),
|
|
2250
|
+
let k = 0;
|
|
2251
|
+
for (const [B, Q] of h) {
|
|
2252
|
+
const J = B - k;
|
|
2253
|
+
Q === null ? (p.splice(J, 1), k++) : p[J] = Q;
|
|
2254
2254
|
}
|
|
2255
2255
|
} else {
|
|
2256
2256
|
p = Object.defineProperties(
|
|
2257
2257
|
{},
|
|
2258
2258
|
Object.getOwnPropertyDescriptors(p)
|
|
2259
2259
|
);
|
|
2260
|
-
for (const [
|
|
2261
|
-
p[
|
|
2260
|
+
for (const [k, B] of h)
|
|
2261
|
+
p[k] = B;
|
|
2262
2262
|
}
|
|
2263
2263
|
c = i.index, o = i.keys, h = i.edits, s = i.inArray, i = i.prev;
|
|
2264
2264
|
} else if (y) {
|
|
@@ -2269,24 +2269,24 @@ function Lt(e, t, n = _e) {
|
|
|
2269
2269
|
let P;
|
|
2270
2270
|
if (!Array.isArray(p)) {
|
|
2271
2271
|
var g, N;
|
|
2272
|
-
|
|
2273
|
-
const
|
|
2274
|
-
if (P =
|
|
2272
|
+
Ie(p) || K(!1, `Invalid AST Node: ${ve(p)}.`);
|
|
2273
|
+
const k = R ? (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 = k == null ? void 0 : k.call(t, p, m, y, C, T), P === Lt)
|
|
2275
2275
|
break;
|
|
2276
2276
|
if (P === !1) {
|
|
2277
|
-
if (!
|
|
2277
|
+
if (!R) {
|
|
2278
2278
|
C.pop();
|
|
2279
2279
|
continue;
|
|
2280
2280
|
}
|
|
2281
|
-
} else if (P !== void 0 && (h.push([m, P]), !
|
|
2282
|
-
if (
|
|
2281
|
+
} else if (P !== void 0 && (h.push([m, P]), !R))
|
|
2282
|
+
if (Ie(P))
|
|
2283
2283
|
p = P;
|
|
2284
2284
|
else {
|
|
2285
2285
|
C.pop();
|
|
2286
2286
|
continue;
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
|
-
if (P === void 0 && z && h.push([m, p]),
|
|
2289
|
+
if (P === void 0 && z && h.push([m, p]), R)
|
|
2290
2290
|
C.pop();
|
|
2291
2291
|
else {
|
|
2292
2292
|
var D;
|
|
@@ -2311,10 +2311,10 @@ function Ft(e, t) {
|
|
|
2311
2311
|
leave: e.leave
|
|
2312
2312
|
};
|
|
2313
2313
|
}
|
|
2314
|
-
function
|
|
2315
|
-
return
|
|
2314
|
+
function Bt(e) {
|
|
2315
|
+
return wt(e, Mt);
|
|
2316
2316
|
}
|
|
2317
|
-
const
|
|
2317
|
+
const Ut = 80, Mt = {
|
|
2318
2318
|
Name: {
|
|
2319
2319
|
leave: (e) => e.value
|
|
2320
2320
|
},
|
|
@@ -2344,14 +2344,14 @@ const Bt = 80, Mt = {
|
|
|
2344
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 }) => _(e)
|
|
2348
2348
|
},
|
|
2349
2349
|
Field: {
|
|
2350
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
|
-
return o.length >
|
|
2354
|
-
`,
|
|
2353
|
+
return o.length > Ut && (o = s + v(`(
|
|
2354
|
+
`, Z(d(n, `
|
|
2355
2355
|
`)), `
|
|
2356
2356
|
)`)), d([o, d(r, " "), i], " ");
|
|
2357
2357
|
}
|
|
@@ -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, " "), _(n)], " ")
|
|
2429
2429
|
},
|
|
2430
2430
|
OperationTypeDefinition: {
|
|
2431
2431
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
@@ -2442,15 +2442,15 @@ const Bt = 80, Mt = {
|
|
|
2442
2442
|
t,
|
|
2443
2443
|
v("implements ", d(n, " & ")),
|
|
2444
2444
|
d(r, " "),
|
|
2445
|
-
|
|
2445
|
+
_(i)
|
|
2446
2446
|
],
|
|
2447
2447
|
" "
|
|
2448
2448
|
)
|
|
2449
2449
|
},
|
|
2450
2450
|
FieldDefinition: {
|
|
2451
2451
|
leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
|
|
2452
|
-
`) + t + (
|
|
2453
|
-
`,
|
|
2452
|
+
`) + t + (xe(n) ? v(`(
|
|
2453
|
+
`, Z(d(n, `
|
|
2454
2454
|
`)), `
|
|
2455
2455
|
)`) : v("(", d(n, ", "), ")")) + ": " + r + v(" ", d(i, " "))
|
|
2456
2456
|
},
|
|
@@ -2469,7 +2469,7 @@ const Bt = 80, Mt = {
|
|
|
2469
2469
|
t,
|
|
2470
2470
|
v("implements ", d(n, " & ")),
|
|
2471
2471
|
d(r, " "),
|
|
2472
|
-
|
|
2472
|
+
_(i)
|
|
2473
2473
|
],
|
|
2474
2474
|
" "
|
|
2475
2475
|
)
|
|
@@ -2483,7 +2483,7 @@ const Bt = 80, Mt = {
|
|
|
2483
2483
|
},
|
|
2484
2484
|
EnumTypeDefinition: {
|
|
2485
2485
|
leave: ({ description: e, name: t, directives: n, values: r }) => v("", e, `
|
|
2486
|
-
`) + d(["enum", t, d(n, " "),
|
|
2486
|
+
`) + d(["enum", t, d(n, " "), _(r)], " ")
|
|
2487
2487
|
},
|
|
2488
2488
|
EnumValueDefinition: {
|
|
2489
2489
|
leave: ({ description: e, name: t, directives: n }) => v("", e, `
|
|
@@ -2491,18 +2491,18 @@ const Bt = 80, Mt = {
|
|
|
2491
2491
|
},
|
|
2492
2492
|
InputObjectTypeDefinition: {
|
|
2493
2493
|
leave: ({ description: e, name: t, directives: n, fields: r }) => v("", e, `
|
|
2494
|
-
`) + d(["input", t, d(n, " "),
|
|
2494
|
+
`) + d(["input", t, d(n, " "), _(r)], " ")
|
|
2495
2495
|
},
|
|
2496
2496
|
DirectiveDefinition: {
|
|
2497
2497
|
leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
|
|
2498
|
-
`) + "directive @" + t + (
|
|
2499
|
-
`,
|
|
2498
|
+
`) + "directive @" + t + (xe(n) ? v(`(
|
|
2499
|
+
`, Z(d(n, `
|
|
2500
2500
|
`)), `
|
|
2501
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, " "), _(t)],
|
|
2506
2506
|
" "
|
|
2507
2507
|
)
|
|
2508
2508
|
},
|
|
@@ -2516,7 +2516,7 @@ const Bt = 80, Mt = {
|
|
|
2516
2516
|
e,
|
|
2517
2517
|
v("implements ", d(t, " & ")),
|
|
2518
2518
|
d(n, " "),
|
|
2519
|
-
|
|
2519
|
+
_(r)
|
|
2520
2520
|
],
|
|
2521
2521
|
" "
|
|
2522
2522
|
)
|
|
@@ -2528,7 +2528,7 @@ const Bt = 80, Mt = {
|
|
|
2528
2528
|
e,
|
|
2529
2529
|
v("implements ", d(t, " & ")),
|
|
2530
2530
|
d(n, " "),
|
|
2531
|
-
|
|
2531
|
+
_(r)
|
|
2532
2532
|
],
|
|
2533
2533
|
" "
|
|
2534
2534
|
)
|
|
@@ -2545,30 +2545,30 @@ 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, " "), _(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, " "), _(n)], " ")
|
|
2552
2552
|
}
|
|
2553
2553
|
};
|
|
2554
2554
|
function d(e, t = "") {
|
|
2555
2555
|
var n;
|
|
2556
2556
|
return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
|
|
2557
2557
|
}
|
|
2558
|
-
function
|
|
2558
|
+
function _(e) {
|
|
2559
2559
|
return v(`{
|
|
2560
|
-
`,
|
|
2560
|
+
`, Z(d(e, `
|
|
2561
2561
|
`)), `
|
|
2562
2562
|
}`);
|
|
2563
2563
|
}
|
|
2564
2564
|
function v(e, t, n = "") {
|
|
2565
2565
|
return t != null && t !== "" ? e + t + n : "";
|
|
2566
2566
|
}
|
|
2567
|
-
function
|
|
2567
|
+
function Z(e) {
|
|
2568
2568
|
return v(" ", e.replace(/\n/g, `
|
|
2569
2569
|
`));
|
|
2570
2570
|
}
|
|
2571
|
-
function
|
|
2571
|
+
function xe(e) {
|
|
2572
2572
|
var t;
|
|
2573
2573
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2574
2574
|
`))) !== null && t !== void 0 ? t : !1;
|
|
@@ -2582,14 +2582,14 @@ const Se = (e) => {
|
|
|
2582
2582
|
if (typeof e == "string") {
|
|
2583
2583
|
let n;
|
|
2584
2584
|
try {
|
|
2585
|
-
const r =
|
|
2585
|
+
const r = Ue(e);
|
|
2586
2586
|
n = Se(r);
|
|
2587
2587
|
} catch {
|
|
2588
2588
|
}
|
|
2589
2589
|
return { query: e, operationName: n };
|
|
2590
2590
|
}
|
|
2591
2591
|
const t = Se(e);
|
|
2592
|
-
return { query:
|
|
2592
|
+
return { query: Bt(e), operationName: t };
|
|
2593
2593
|
};
|
|
2594
2594
|
class H extends Error {
|
|
2595
2595
|
constructor(t, n) {
|
|
@@ -2721,7 +2721,7 @@ var ge = { exports: {} };
|
|
|
2721
2721
|
};
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
|
-
function
|
|
2724
|
+
function R(a) {
|
|
2725
2725
|
var l = new FileReader(), E = D(l);
|
|
2726
2726
|
return l.readAsArrayBuffer(a), E;
|
|
2727
2727
|
}
|
|
@@ -2734,15 +2734,15 @@ var ge = { exports: {} };
|
|
|
2734
2734
|
E[S] = String.fromCharCode(l[S]);
|
|
2735
2735
|
return E.join("");
|
|
2736
2736
|
}
|
|
2737
|
-
function
|
|
2737
|
+
function k(a) {
|
|
2738
2738
|
if (a.slice)
|
|
2739
2739
|
return a.slice(0);
|
|
2740
2740
|
var l = new Uint8Array(a.byteLength);
|
|
2741
2741
|
return l.set(new Uint8Array(a)), l.buffer;
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2743
|
+
function B() {
|
|
2744
2744
|
return this.bodyUsed = !1, this._initBody = function(a) {
|
|
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 =
|
|
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 = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.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) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
2746
2746
|
}, c.blob && (this.blob = function() {
|
|
2747
2747
|
var a = N(this);
|
|
2748
2748
|
if (a)
|
|
@@ -2755,7 +2755,7 @@ var ge = { 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(R);
|
|
2759
2759
|
}), this.text = function() {
|
|
2760
2760
|
var a = N(this);
|
|
2761
2761
|
if (a)
|
|
@@ -2778,10 +2778,10 @@ var ge = { exports: {} };
|
|
|
2778
2778
|
var l = a.toUpperCase();
|
|
2779
2779
|
return Q.indexOf(l) > -1 ? l : a;
|
|
2780
2780
|
}
|
|
2781
|
-
function
|
|
2781
|
+
function w(a, l) {
|
|
2782
2782
|
l = l || {};
|
|
2783
2783
|
var E = l.body;
|
|
2784
|
-
if (a instanceof
|
|
2784
|
+
if (a instanceof w) {
|
|
2785
2785
|
if (a.bodyUsed)
|
|
2786
2786
|
throw new TypeError("Already read");
|
|
2787
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);
|
|
@@ -2791,48 +2791,48 @@ var ge = { exports: {} };
|
|
|
2791
2791
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
2792
2792
|
this._initBody(E);
|
|
2793
2793
|
}
|
|
2794
|
-
|
|
2795
|
-
return new
|
|
2794
|
+
w.prototype.clone = function() {
|
|
2795
|
+
return new w(this, { body: this._bodyInit });
|
|
2796
2796
|
};
|
|
2797
2797
|
function je(a) {
|
|
2798
2798
|
var l = new FormData();
|
|
2799
2799
|
return a.trim().split("&").forEach(function(E) {
|
|
2800
2800
|
if (E) {
|
|
2801
|
-
var S = E.split("="),
|
|
2802
|
-
l.append(decodeURIComponent(
|
|
2801
|
+
var S = E.split("="), x = S.shift().replace(/\+/g, " "), A = S.join("=").replace(/\+/g, " ");
|
|
2802
|
+
l.append(decodeURIComponent(x), decodeURIComponent(A));
|
|
2803
2803
|
}
|
|
2804
2804
|
}), l;
|
|
2805
2805
|
}
|
|
2806
2806
|
function Ge(a) {
|
|
2807
2807
|
var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
|
|
2808
2808
|
return E.split(/\r?\n/).forEach(function(S) {
|
|
2809
|
-
var
|
|
2809
|
+
var x = S.split(":"), A = x.shift().trim();
|
|
2810
2810
|
if (A) {
|
|
2811
|
-
var X =
|
|
2811
|
+
var X = x.join(":").trim();
|
|
2812
2812
|
l.append(A, X);
|
|
2813
2813
|
}
|
|
2814
2814
|
}), l;
|
|
2815
2815
|
}
|
|
2816
|
-
|
|
2817
|
-
function
|
|
2816
|
+
B.call(w.prototype);
|
|
2817
|
+
function L(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 g(l.headers), this.url = l.url || "", this._initBody(a);
|
|
2819
2819
|
}
|
|
2820
|
-
|
|
2821
|
-
return new
|
|
2820
|
+
B.call(L.prototype), L.prototype.clone = function() {
|
|
2821
|
+
return new L(this._bodyInit, {
|
|
2822
2822
|
status: this.status,
|
|
2823
2823
|
statusText: this.statusText,
|
|
2824
2824
|
headers: new g(this.headers),
|
|
2825
2825
|
url: this.url
|
|
2826
2826
|
});
|
|
2827
|
-
},
|
|
2828
|
-
var a = new
|
|
2827
|
+
}, L.error = function() {
|
|
2828
|
+
var a = new L(null, { status: 0, statusText: "" });
|
|
2829
2829
|
return a.type = "error", a;
|
|
2830
2830
|
};
|
|
2831
2831
|
var $e = [301, 302, 303, 307, 308];
|
|
2832
|
-
|
|
2832
|
+
L.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 L(null, { status: l, headers: { location: a } });
|
|
2836
2836
|
}, o.DOMException = s.DOMException;
|
|
2837
2837
|
try {
|
|
2838
2838
|
new o.DOMException();
|
|
@@ -2845,8 +2845,8 @@ var ge = { exports: {} };
|
|
|
2845
2845
|
}
|
|
2846
2846
|
function ae(a, l) {
|
|
2847
2847
|
return new Promise(function(E, S) {
|
|
2848
|
-
var
|
|
2849
|
-
if (
|
|
2848
|
+
var x = new w(a, l);
|
|
2849
|
+
if (x.signal && x.signal.aborted)
|
|
2850
2850
|
return S(new o.DOMException("Aborted", "AbortError"));
|
|
2851
2851
|
var A = new XMLHttpRequest();
|
|
2852
2852
|
function X() {
|
|
@@ -2860,21 +2860,21 @@ var ge = { exports: {} };
|
|
|
2860
2860
|
};
|
|
2861
2861
|
j.url = "responseURL" in A ? A.responseURL : j.headers.get("X-Request-URL");
|
|
2862
2862
|
var ue = "response" in A ? A.response : A.responseText;
|
|
2863
|
-
E(new
|
|
2863
|
+
E(new L(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
2869
|
S(new o.DOMException("Aborted", "AbortError"));
|
|
2870
|
-
}, A.open(
|
|
2870
|
+
}, A.open(x.method, x.url, !0), x.credentials === "include" ? A.withCredentials = !0 : x.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && c.blob && (A.responseType = "blob"), x.headers.forEach(function(j, ue) {
|
|
2871
2871
|
A.setRequestHeader(ue, j);
|
|
2872
|
-
}),
|
|
2873
|
-
A.readyState === 4 &&
|
|
2874
|
-
}), A.send(typeof
|
|
2872
|
+
}), x.signal && (x.signal.addEventListener("abort", X), A.onreadystatechange = function() {
|
|
2873
|
+
A.readyState === 4 && x.signal.removeEventListener("abort", X);
|
|
2874
|
+
}), A.send(typeof x._bodyInit > "u" ? null : x._bodyInit);
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
|
-
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request =
|
|
2877
|
+
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = w, s.Response = L), o.Headers = g, o.Request = w, o.Response = L, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
2878
2878
|
})({});
|
|
2879
2879
|
})(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
|
|
2880
2880
|
var i = r;
|
|
@@ -2884,7 +2884,7 @@ var ne = ge.exports;
|
|
|
2884
2884
|
const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
2885
2885
|
__proto__: null,
|
|
2886
2886
|
default: ee
|
|
2887
|
-
}, [ne]),
|
|
2887
|
+
}, [ne]), U = (e) => {
|
|
2888
2888
|
let t = {};
|
|
2889
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
2890
|
n && r !== void 0 && (t[n] = r);
|
|
@@ -2918,8 +2918,8 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2918
2918
|
};
|
|
2919
2919
|
let T = n, g = C;
|
|
2920
2920
|
if (h) {
|
|
2921
|
-
const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: D, ...
|
|
2922
|
-
T = D, g =
|
|
2921
|
+
const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: D, ...R } = N;
|
|
2922
|
+
T = D, g = R;
|
|
2923
2923
|
}
|
|
2924
2924
|
return m && (T = `${T}?${m}`), await o(T, g);
|
|
2925
2925
|
};
|
|
@@ -2934,8 +2934,8 @@ class Ht {
|
|
|
2934
2934
|
query: c.query,
|
|
2935
2935
|
variables: c.variables,
|
|
2936
2936
|
headers: {
|
|
2937
|
-
...
|
|
2938
|
-
...
|
|
2937
|
+
...U(he(h)),
|
|
2938
|
+
...U(c.requestHeaders)
|
|
2939
2939
|
},
|
|
2940
2940
|
operationName: N,
|
|
2941
2941
|
fetch: p,
|
|
@@ -2956,8 +2956,8 @@ class Ht {
|
|
|
2956
2956
|
query: T,
|
|
2957
2957
|
variables: s.variables,
|
|
2958
2958
|
headers: {
|
|
2959
|
-
...
|
|
2960
|
-
...
|
|
2959
|
+
...U(he(o)),
|
|
2960
|
+
...U(s.requestHeaders)
|
|
2961
2961
|
},
|
|
2962
2962
|
operationName: g,
|
|
2963
2963
|
fetch: c,
|
|
@@ -2970,7 +2970,7 @@ class Ht {
|
|
|
2970
2970
|
}
|
|
2971
2971
|
// prettier-ignore
|
|
2972
2972
|
batchRequests(t, n) {
|
|
2973
|
-
const r =
|
|
2973
|
+
const r = Ke(t, n), { headers: i, ...s } = this.requestConfig;
|
|
2974
2974
|
r.signal !== void 0 && (s.signal = r.signal);
|
|
2975
2975
|
const o = r.documents.map(({ document: h }) => le(h).query), c = r.documents.map(({ variables: h }) => h);
|
|
2976
2976
|
return de({
|
|
@@ -2979,8 +2979,8 @@ class Ht {
|
|
|
2979
2979
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
2980
2980
|
variables: c,
|
|
2981
2981
|
headers: {
|
|
2982
|
-
...
|
|
2983
|
-
...
|
|
2982
|
+
...U(he(i)),
|
|
2983
|
+
...U(r.requestHeaders)
|
|
2984
2984
|
},
|
|
2985
2985
|
operationName: void 0,
|
|
2986
2986
|
fetch: this.requestConfig.fetch ?? ee,
|
|
@@ -3084,7 +3084,7 @@ function Xt(e) {
|
|
|
3084
3084
|
function Wt(e) {
|
|
3085
3085
|
var t = Ve(e);
|
|
3086
3086
|
if (!te.has(t)) {
|
|
3087
|
-
var n =
|
|
3087
|
+
var n = Ue(e, {
|
|
3088
3088
|
experimentalFragmentVariables: ie,
|
|
3089
3089
|
allowLegacyFragmentVariables: ie
|
|
3090
3090
|
});
|
|
@@ -3103,10 +3103,10 @@ function q(e) {
|
|
|
3103
3103
|
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
3104
3104
|
}), Wt(r);
|
|
3105
3105
|
}
|
|
3106
|
-
function
|
|
3106
|
+
function Kt() {
|
|
3107
3107
|
te.clear(), ye.clear();
|
|
3108
3108
|
}
|
|
3109
|
-
function
|
|
3109
|
+
function Zt() {
|
|
3110
3110
|
qe = !1;
|
|
3111
3111
|
}
|
|
3112
3112
|
function en() {
|
|
@@ -3117,8 +3117,8 @@ function tn() {
|
|
|
3117
3117
|
}
|
|
3118
3118
|
var G = {
|
|
3119
3119
|
gql: q,
|
|
3120
|
-
resetCaches:
|
|
3121
|
-
disableFragmentWarnings:
|
|
3120
|
+
resetCaches: Kt,
|
|
3121
|
+
disableFragmentWarnings: Zt,
|
|
3122
3122
|
enableExperimentalFragmentVariables: en,
|
|
3123
3123
|
disableExperimentalFragmentVariables: tn
|
|
3124
3124
|
};
|
|
@@ -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 O = q, nn = O`
|
|
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 R = q, nn = R`
|
|
|
3164
3164
|
}
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
-
`, rn =
|
|
3167
|
+
`, rn = O`
|
|
3168
3168
|
query GetLocationAvailability($sku: String!, $locationID: ID!) {
|
|
3169
3169
|
locationAvailability(sku: $sku, locationID: $locationID) {
|
|
3170
3170
|
location {
|
|
@@ -3189,7 +3189,7 @@ const R = q, nn = R`
|
|
|
3189
3189
|
inventoryQuantity
|
|
3190
3190
|
}
|
|
3191
3191
|
}
|
|
3192
|
-
`, sn =
|
|
3192
|
+
`, sn = O`
|
|
3193
3193
|
query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
|
|
3194
3194
|
purchasingCustomerMetafield(namespace: $namespace, key: $key) {
|
|
3195
3195
|
id
|
|
@@ -3198,14 +3198,14 @@ const R = q, nn = R`
|
|
|
3198
3198
|
value
|
|
3199
3199
|
}
|
|
3200
3200
|
}
|
|
3201
|
-
`, on =
|
|
3201
|
+
`, on = O`
|
|
3202
3202
|
query GetPoints {
|
|
3203
3203
|
purchasingCustomer {
|
|
3204
3204
|
pointsApproved
|
|
3205
3205
|
pointsPending
|
|
3206
3206
|
}
|
|
3207
3207
|
}
|
|
3208
|
-
`, an =
|
|
3208
|
+
`, an = O`
|
|
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 R = q, nn = R`
|
|
|
3235
3235
|
}
|
|
3236
3236
|
}
|
|
3237
3237
|
}
|
|
3238
|
-
`, un =
|
|
3238
|
+
`, un = O`
|
|
3239
3239
|
query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
3240
3240
|
purchasingCustomer {
|
|
3241
3241
|
id
|
|
@@ -3264,14 +3264,14 @@ const R = q, nn = R`
|
|
|
3264
3264
|
}
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
3267
|
-
`, cn =
|
|
3267
|
+
`, cn = O`
|
|
3268
3268
|
query GetPurchasingCustomerDiscountCodeCount {
|
|
3269
3269
|
purchasingCustomer {
|
|
3270
3270
|
id
|
|
3271
3271
|
orderPriceAdjustmentRuleCount
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
`, ln =
|
|
3274
|
+
`, ln = O`
|
|
3275
3275
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
3276
3276
|
purchasingCustomer {
|
|
3277
3277
|
id
|
|
@@ -3330,7 +3330,7 @@ const R = q, nn = R`
|
|
|
3330
3330
|
}
|
|
3331
3331
|
}
|
|
3332
3332
|
}
|
|
3333
|
-
`, dn =
|
|
3333
|
+
`, dn = O`
|
|
3334
3334
|
query GetPurchasingCustomerRank {
|
|
3335
3335
|
purchasingCustomer {
|
|
3336
3336
|
currentCustomerRank {
|
|
@@ -3369,14 +3369,14 @@ const R = q, nn = R`
|
|
|
3369
3369
|
}
|
|
3370
3370
|
}
|
|
3371
3371
|
}
|
|
3372
|
-
`, hn =
|
|
3372
|
+
`, hn = O`
|
|
3373
3373
|
query GetSharingPurchasingCustomerCount {
|
|
3374
3374
|
purchasingCustomer {
|
|
3375
3375
|
id
|
|
3376
3376
|
sharingPurchasingCustomerCount
|
|
3377
3377
|
}
|
|
3378
3378
|
}
|
|
3379
|
-
`, pn =
|
|
3379
|
+
`, pn = O`
|
|
3380
3380
|
query GetPurchasingCustomerSharing {
|
|
3381
3381
|
purchasingCustomer {
|
|
3382
3382
|
id
|
|
@@ -3393,7 +3393,37 @@ const R = q, nn = R`
|
|
|
3393
3393
|
}
|
|
3394
3394
|
}
|
|
3395
3395
|
}
|
|
3396
|
-
`, fn =
|
|
3396
|
+
`, fn = O`
|
|
3397
|
+
query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
|
|
3398
|
+
productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
|
|
3399
|
+
id
|
|
3400
|
+
title
|
|
3401
|
+
hasBackOrderProductVariants
|
|
3402
|
+
productVariants(
|
|
3403
|
+
first: $first
|
|
3404
|
+
after: $after
|
|
3405
|
+
isReverse: $isReverse
|
|
3406
|
+
sortKeys: $sortKeys
|
|
3407
|
+
) {
|
|
3408
|
+
nodes {
|
|
3409
|
+
id
|
|
3410
|
+
title
|
|
3411
|
+
inventoryItem {
|
|
3412
|
+
id
|
|
3413
|
+
sku
|
|
3414
|
+
}
|
|
3415
|
+
isBackOrderEnable
|
|
3416
|
+
}
|
|
3417
|
+
pageInfo {
|
|
3418
|
+
startCursor
|
|
3419
|
+
endCursor
|
|
3420
|
+
hasNextPage
|
|
3421
|
+
hasPreviousPage
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
`, mn = O`
|
|
3397
3427
|
mutation PurchasingCustomerSendCustomerSharingActivationCode {
|
|
3398
3428
|
purchasingCustomerSendCustomerSharingActivationCode {
|
|
3399
3429
|
purchasingCustomer {
|
|
@@ -3409,7 +3439,7 @@ const R = q, nn = R`
|
|
|
3409
3439
|
}
|
|
3410
3440
|
}
|
|
3411
3441
|
}
|
|
3412
|
-
`,
|
|
3442
|
+
`, gn = O`
|
|
3413
3443
|
mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
|
|
3414
3444
|
purchasingCustomerActivateCustomerSharing(
|
|
3415
3445
|
input: {email: $email, activationCode: $activationCode}
|
|
@@ -3424,8 +3454,8 @@ const R = q, nn = R`
|
|
|
3424
3454
|
}
|
|
3425
3455
|
}
|
|
3426
3456
|
}
|
|
3427
|
-
`,
|
|
3428
|
-
function
|
|
3457
|
+
`, yn = (e, t, n, r) => e();
|
|
3458
|
+
function Cn(e, t = yn) {
|
|
3429
3459
|
return {
|
|
3430
3460
|
GetLocationAvailabilities(n, r) {
|
|
3431
3461
|
return t((i) => e.request(nn, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
|
|
@@ -3460,18 +3490,21 @@ function yn(e, t = gn) {
|
|
|
3460
3490
|
GetPurchasingCustomerSharing(n, r) {
|
|
3461
3491
|
return t((i) => e.request(pn, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
|
|
3462
3492
|
},
|
|
3493
|
+
GetProduct(n, r) {
|
|
3494
|
+
return t((i) => e.request(fn, n, { ...r, ...i }), "GetProduct", "query", n);
|
|
3495
|
+
},
|
|
3463
3496
|
PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
|
|
3464
|
-
return t((i) => e.request(
|
|
3497
|
+
return t((i) => e.request(mn, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
|
|
3465
3498
|
},
|
|
3466
3499
|
PurchasingCustomerActivateCustomerSharing(n, r) {
|
|
3467
|
-
return t((i) => e.request(
|
|
3500
|
+
return t((i) => e.request(gn, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
|
|
3468
3501
|
}
|
|
3469
3502
|
};
|
|
3470
3503
|
}
|
|
3471
|
-
class
|
|
3504
|
+
class vn {
|
|
3472
3505
|
constructor(t) {
|
|
3473
3506
|
Ae(this, "api");
|
|
3474
|
-
this.api =
|
|
3507
|
+
this.api = Cn(
|
|
3475
3508
|
new Ht(`${t}/apps/sq-api`, {
|
|
3476
3509
|
headers: {
|
|
3477
3510
|
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
@@ -3766,14 +3799,43 @@ class En {
|
|
|
3766
3799
|
const t = await this.api.GetPurchasingCustomerSharing();
|
|
3767
3800
|
return (n = t.purchasingCustomer) != null && n.customerSharing ? {
|
|
3768
3801
|
id: t.purchasingCustomer.customerSharing.id,
|
|
3769
|
-
purchasingCustomers: t.purchasingCustomer.customerSharing.purchasingCustomers.map(
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3802
|
+
purchasingCustomers: t.purchasingCustomer.customerSharing.purchasingCustomers.map(
|
|
3803
|
+
(r) => ({
|
|
3804
|
+
id: r.id,
|
|
3805
|
+
sharingPurchasingCustomerCount: r.sharingPurchasingCustomerCount,
|
|
3806
|
+
tenant: {
|
|
3807
|
+
id: r.tenant.id,
|
|
3808
|
+
name: r.tenant.name
|
|
3809
|
+
}
|
|
3810
|
+
})
|
|
3811
|
+
)
|
|
3812
|
+
} : null;
|
|
3813
|
+
}
|
|
3814
|
+
async getProduct(t, n, r, i, s) {
|
|
3815
|
+
const o = await this.api.GetProduct({
|
|
3816
|
+
id: t,
|
|
3817
|
+
first: n,
|
|
3818
|
+
after: r,
|
|
3819
|
+
isReverse: i,
|
|
3820
|
+
sortKeys: s
|
|
3821
|
+
});
|
|
3822
|
+
return o.productByProductShopifyLegacyResourceID ? {
|
|
3823
|
+
id: o.productByProductShopifyLegacyResourceID.id,
|
|
3824
|
+
title: o.productByProductShopifyLegacyResourceID.title,
|
|
3825
|
+
variants: {
|
|
3826
|
+
nodes: o.productByProductShopifyLegacyResourceID.productVariants.nodes.map(
|
|
3827
|
+
(c) => ({
|
|
3828
|
+
id: c.id,
|
|
3829
|
+
title: c.title,
|
|
3830
|
+
isBackOrderEnable: c.isBackOrderEnable,
|
|
3831
|
+
inventoryItem: {
|
|
3832
|
+
id: c.inventoryItem.id,
|
|
3833
|
+
sku: c.inventoryItem.sku
|
|
3834
|
+
}
|
|
3835
|
+
})
|
|
3836
|
+
),
|
|
3837
|
+
pageInfo: o.productByProductShopifyLegacyResourceID.productVariants.pageInfo
|
|
3838
|
+
}
|
|
3777
3839
|
} : null;
|
|
3778
3840
|
}
|
|
3779
3841
|
/**
|
|
@@ -3798,8 +3860,13 @@ class En {
|
|
|
3798
3860
|
*/
|
|
3799
3861
|
async purchasingCustomerActivateCustomerSharing(t, n) {
|
|
3800
3862
|
if (n.length !== 6)
|
|
3801
|
-
throw new Error(
|
|
3802
|
-
|
|
3863
|
+
throw new Error(
|
|
3864
|
+
`Invalid activation code: ${n} is not 6 characters.`
|
|
3865
|
+
);
|
|
3866
|
+
const r = await this.api.PurchasingCustomerActivateCustomerSharing({
|
|
3867
|
+
email: t,
|
|
3868
|
+
activationCode: n
|
|
3869
|
+
});
|
|
3803
3870
|
return r.purchasingCustomerActivateCustomerSharing ? {
|
|
3804
3871
|
id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,
|
|
3805
3872
|
sharingPurchasingCustomerCount: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,
|
|
@@ -3811,5 +3878,5 @@ class En {
|
|
|
3811
3878
|
}
|
|
3812
3879
|
}
|
|
3813
3880
|
export {
|
|
3814
|
-
|
|
3881
|
+
vn as SDK
|
|
3815
3882
|
};
|