@builtbystack/sq-shopify-theme-sdk 0.0.24 → 0.0.27
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 +152 -13
- package/dist/sq-shopify-theme-sdk.d.ts +77 -6
- package/dist/sq-shopify-theme-sdk.js +359 -306
- package/dist/sq-shopify-theme-sdk.umd.js +72 -50
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var He = Object.defineProperty;
|
|
2
2
|
var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var Te = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
function ze(e, t) {
|
|
5
5
|
for (var n = 0; n < t.length; n++) {
|
|
6
6
|
const r = t[n];
|
|
@@ -41,7 +41,7 @@ function Qe(e, t) {
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
const Xe = /\r\n|[\n\r]/g;
|
|
44
|
-
function
|
|
44
|
+
function he(e, t) {
|
|
45
45
|
let n = 0, r = 1;
|
|
46
46
|
for (const i of e.body.matchAll(Xe)) {
|
|
47
47
|
if (typeof i.index == "number" || Qe(!1), i.index >= t)
|
|
@@ -56,32 +56,32 @@ function pe(e, t) {
|
|
|
56
56
|
function We(e) {
|
|
57
57
|
return Oe(
|
|
58
58
|
e.source,
|
|
59
|
-
|
|
59
|
+
he(e.source, e.start)
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
function Oe(e, t) {
|
|
63
|
-
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0,
|
|
63
|
+
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${o}:${p}
|
|
64
64
|
`, m = r.split(/\r\n|[\n\r]/g), y = m[i];
|
|
65
65
|
if (y.length > 120) {
|
|
66
|
-
const C = Math.floor(
|
|
67
|
-
for (let
|
|
68
|
-
g.push(y.slice(
|
|
69
|
-
return
|
|
66
|
+
const C = Math.floor(p / 80), A = p % 80, g = [];
|
|
67
|
+
for (let I = 0; I < y.length; I += 80)
|
|
68
|
+
g.push(y.slice(I, I + 80));
|
|
69
|
+
return h + Ae([
|
|
70
70
|
[`${o} |`, g[0]],
|
|
71
|
-
...g.slice(1, C + 1).map((
|
|
72
|
-
["|", "^".padStart(
|
|
71
|
+
...g.slice(1, C + 1).map((I) => ["|", I]),
|
|
72
|
+
["|", "^".padStart(A)],
|
|
73
73
|
["|", g[C + 1]]
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return h + Ae([
|
|
77
77
|
// Lines specified like this: ["prefix", "string"],
|
|
78
78
|
[`${o - 1} |`, m[i - 1]],
|
|
79
79
|
[`${o} |`, y],
|
|
80
|
-
["|", "^".padStart(
|
|
80
|
+
["|", "^".padStart(p)],
|
|
81
81
|
[`${o + 1} |`, m[i + 1]]
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Ae(e) {
|
|
85
85
|
const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
|
|
86
86
|
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
87
87
|
`);
|
|
@@ -138,18 +138,18 @@ class Ce extends Error {
|
|
|
138
138
|
*/
|
|
139
139
|
constructor(t, ...n) {
|
|
140
140
|
var r, i, s;
|
|
141
|
-
const { nodes: o, source: c, positions:
|
|
142
|
-
super(t), this.name = "GraphQLError", this.path =
|
|
141
|
+
const { nodes: o, source: c, positions: p, path: h, originalError: m, extensions: y } = Ke(n);
|
|
142
|
+
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = m ?? void 0, this.nodes = Ie(
|
|
143
143
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
144
144
|
);
|
|
145
|
-
const C =
|
|
145
|
+
const C = Ie(
|
|
146
146
|
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
|
|
147
147
|
);
|
|
148
|
-
this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions =
|
|
149
|
-
const
|
|
148
|
+
this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = p ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = p && c ? p.map((g) => he(c, g)) : C == null ? void 0 : C.map((g) => he(g.source, g.start));
|
|
149
|
+
const A = Je(
|
|
150
150
|
m == null ? void 0 : m.extensions
|
|
151
151
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
152
|
-
this.extensions = (s = y ??
|
|
152
|
+
this.extensions = (s = y ?? A) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
153
153
|
message: {
|
|
154
154
|
writable: !0,
|
|
155
155
|
enumerable: !0
|
|
@@ -203,10 +203,10 @@ class Ce extends Error {
|
|
|
203
203
|
return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Ie(e) {
|
|
207
207
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function N(e, t, n) {
|
|
210
210
|
return new Ce(`Syntax Error: ${n}`, {
|
|
211
211
|
source: e,
|
|
212
212
|
positions: [t]
|
|
@@ -283,7 +283,7 @@ class De {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const Pe = {
|
|
287
287
|
Name: [],
|
|
288
288
|
Document: ["definitions"],
|
|
289
289
|
OperationDefinition: [
|
|
@@ -357,15 +357,15 @@ const ke = {
|
|
|
357
357
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
358
358
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
359
359
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
360
|
-
}, et = new Set(Object.keys(
|
|
361
|
-
function
|
|
360
|
+
}, et = new Set(Object.keys(Pe));
|
|
361
|
+
function Se(e) {
|
|
362
362
|
const t = e == null ? void 0 : e.kind;
|
|
363
363
|
return typeof t == "string" && et.has(t);
|
|
364
364
|
}
|
|
365
|
-
var
|
|
365
|
+
var M;
|
|
366
366
|
(function(e) {
|
|
367
367
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
368
|
-
})(
|
|
368
|
+
})(M || (M = {}));
|
|
369
369
|
var fe;
|
|
370
370
|
(function(e) {
|
|
371
371
|
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
@@ -380,42 +380,42 @@ function me(e) {
|
|
|
380
380
|
function Y(e) {
|
|
381
381
|
return e >= 48 && e <= 57;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function ke(e) {
|
|
384
384
|
return e >= 97 && e <= 122 || // A-Z
|
|
385
385
|
e >= 65 && e <= 90;
|
|
386
386
|
}
|
|
387
387
|
function _e(e) {
|
|
388
|
-
return
|
|
388
|
+
return ke(e) || e === 95;
|
|
389
389
|
}
|
|
390
390
|
function tt(e) {
|
|
391
|
-
return
|
|
391
|
+
return ke(e) || Y(e) || e === 95;
|
|
392
392
|
}
|
|
393
393
|
function nt(e) {
|
|
394
394
|
var t;
|
|
395
395
|
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
396
396
|
for (let o = 0; o < e.length; ++o) {
|
|
397
397
|
var s;
|
|
398
|
-
const c = e[o],
|
|
399
|
-
|
|
398
|
+
const c = e[o], p = it(c);
|
|
399
|
+
p !== c.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && p < n && (n = p));
|
|
400
400
|
}
|
|
401
401
|
return e.map((o, c) => c === 0 ? o : o.slice(n)).slice(
|
|
402
402
|
(t = r) !== null && t !== void 0 ? t : 0,
|
|
403
403
|
i + 1
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function it(e) {
|
|
407
407
|
let t = 0;
|
|
408
408
|
for (; t < e.length && me(e.charCodeAt(t)); )
|
|
409
409
|
++t;
|
|
410
410
|
return t;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((
|
|
414
|
-
(!i || e.length > 70 ||
|
|
412
|
+
function rt(e, t) {
|
|
413
|
+
const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((A) => A.length === 0 || me(A.charCodeAt(0))), o = n.endsWith('\\"""'), c = e.endsWith('"') && !o, p = e.endsWith("\\"), h = c || p, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
414
|
+
(!i || e.length > 70 || h || s || o);
|
|
415
415
|
let y = "";
|
|
416
416
|
const C = i && me(e.charCodeAt(0));
|
|
417
417
|
return (m && !C || s) && (y += `
|
|
418
|
-
`), y += n, (m ||
|
|
418
|
+
`), y += n, (m || h) && (y += `
|
|
419
419
|
`), '"""' + y + '"""';
|
|
420
420
|
}
|
|
421
421
|
var u;
|
|
@@ -491,7 +491,7 @@ function F(e, t) {
|
|
|
491
491
|
}
|
|
492
492
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function S(e, t, n, r, i) {
|
|
495
495
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
496
496
|
return new De(t, n, r, s, o, i);
|
|
497
497
|
}
|
|
@@ -516,35 +516,35 @@ function at(e, t) {
|
|
|
516
516
|
case 35:
|
|
517
517
|
return ut(e, i);
|
|
518
518
|
case 33:
|
|
519
|
-
return
|
|
519
|
+
return S(e, u.BANG, i, i + 1);
|
|
520
520
|
case 36:
|
|
521
|
-
return
|
|
521
|
+
return S(e, u.DOLLAR, i, i + 1);
|
|
522
522
|
case 38:
|
|
523
|
-
return
|
|
523
|
+
return S(e, u.AMP, i, i + 1);
|
|
524
524
|
case 40:
|
|
525
|
-
return
|
|
525
|
+
return S(e, u.PAREN_L, i, i + 1);
|
|
526
526
|
case 41:
|
|
527
|
-
return
|
|
527
|
+
return S(e, u.PAREN_R, i, i + 1);
|
|
528
528
|
case 46:
|
|
529
529
|
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
|
|
530
|
-
return
|
|
530
|
+
return S(e, u.SPREAD, i, i + 3);
|
|
531
531
|
break;
|
|
532
532
|
case 58:
|
|
533
|
-
return
|
|
533
|
+
return S(e, u.COLON, i, i + 1);
|
|
534
534
|
case 61:
|
|
535
|
-
return
|
|
535
|
+
return S(e, u.EQUALS, i, i + 1);
|
|
536
536
|
case 64:
|
|
537
|
-
return
|
|
537
|
+
return S(e, u.AT, i, i + 1);
|
|
538
538
|
case 91:
|
|
539
|
-
return
|
|
539
|
+
return S(e, u.BRACKET_L, i, i + 1);
|
|
540
540
|
case 93:
|
|
541
|
-
return
|
|
541
|
+
return S(e, u.BRACKET_R, i, i + 1);
|
|
542
542
|
case 123:
|
|
543
|
-
return
|
|
543
|
+
return S(e, u.BRACE_L, i, i + 1);
|
|
544
544
|
case 124:
|
|
545
|
-
return
|
|
545
|
+
return S(e, u.PIPE, i, i + 1);
|
|
546
546
|
case 125:
|
|
547
|
-
return
|
|
547
|
+
return S(e, u.BRACE_R, i, i + 1);
|
|
548
548
|
case 34:
|
|
549
549
|
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? ft(e, i) : lt(e, i);
|
|
550
550
|
}
|
|
@@ -552,13 +552,13 @@ function at(e, t) {
|
|
|
552
552
|
return ct(e, i, s);
|
|
553
553
|
if (_e(s))
|
|
554
554
|
return mt(e, i);
|
|
555
|
-
throw
|
|
555
|
+
throw N(
|
|
556
556
|
e.source,
|
|
557
557
|
i,
|
|
558
558
|
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return S(e, u.EOF, r, r);
|
|
562
562
|
}
|
|
563
563
|
function ut(e, t) {
|
|
564
564
|
const n = e.source.body, r = n.length;
|
|
@@ -574,7 +574,7 @@ function ut(e, t) {
|
|
|
574
574
|
else
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
-
return
|
|
577
|
+
return S(
|
|
578
578
|
e,
|
|
579
579
|
u.COMMENT,
|
|
580
580
|
t,
|
|
@@ -587,7 +587,7 @@ function ct(e, t, n) {
|
|
|
587
587
|
let i = t, s = n, o = !1;
|
|
588
588
|
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
589
589
|
if (s = r.charCodeAt(++i), Y(s))
|
|
590
|
-
throw
|
|
590
|
+
throw N(
|
|
591
591
|
e.source,
|
|
592
592
|
i,
|
|
593
593
|
`Invalid number, unexpected digit after 0: ${F(
|
|
@@ -598,7 +598,7 @@ function ct(e, t, n) {
|
|
|
598
598
|
} else
|
|
599
599
|
i = ce(e, i, s), s = r.charCodeAt(i);
|
|
600
600
|
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 || _e(s))
|
|
601
|
-
throw
|
|
601
|
+
throw N(
|
|
602
602
|
e.source,
|
|
603
603
|
i,
|
|
604
604
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -606,7 +606,7 @@ function ct(e, t, n) {
|
|
|
606
606
|
i
|
|
607
607
|
)}.`
|
|
608
608
|
);
|
|
609
|
-
return
|
|
609
|
+
return S(
|
|
610
610
|
e,
|
|
611
611
|
o ? u.FLOAT : u.INT,
|
|
612
612
|
t,
|
|
@@ -616,7 +616,7 @@ function ct(e, t, n) {
|
|
|
616
616
|
}
|
|
617
617
|
function ce(e, t, n) {
|
|
618
618
|
if (!Y(n))
|
|
619
|
-
throw
|
|
619
|
+
throw N(
|
|
620
620
|
e.source,
|
|
621
621
|
t,
|
|
622
622
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -636,11 +636,11 @@ function lt(e, t) {
|
|
|
636
636
|
for (; i < r; ) {
|
|
637
637
|
const c = n.charCodeAt(i);
|
|
638
638
|
if (c === 34)
|
|
639
|
-
return o += n.slice(s, i),
|
|
639
|
+
return o += n.slice(s, i), S(e, u.STRING, t, i + 1, o);
|
|
640
640
|
if (c === 92) {
|
|
641
641
|
o += n.slice(s, i);
|
|
642
|
-
const
|
|
643
|
-
o +=
|
|
642
|
+
const p = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : pt(e, i) : ht(e, i);
|
|
643
|
+
o += p.value, i += p.size, s = i;
|
|
644
644
|
continue;
|
|
645
645
|
}
|
|
646
646
|
if (c === 10 || c === 13)
|
|
@@ -650,7 +650,7 @@ function lt(e, t) {
|
|
|
650
650
|
else if (se(n, i))
|
|
651
651
|
i += 2;
|
|
652
652
|
else
|
|
653
|
-
throw
|
|
653
|
+
throw N(
|
|
654
654
|
e.source,
|
|
655
655
|
i,
|
|
656
656
|
`Invalid character within String: ${F(
|
|
@@ -659,7 +659,7 @@ function lt(e, t) {
|
|
|
659
659
|
)}.`
|
|
660
660
|
);
|
|
661
661
|
}
|
|
662
|
-
throw
|
|
662
|
+
throw N(e.source, i, "Unterminated string.");
|
|
663
663
|
}
|
|
664
664
|
function dt(e, t) {
|
|
665
665
|
const n = e.source.body;
|
|
@@ -677,7 +677,7 @@ function dt(e, t) {
|
|
|
677
677
|
if (r = r << 4 | j(s), r < 0)
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
|
-
throw
|
|
680
|
+
throw N(
|
|
681
681
|
e.source,
|
|
682
682
|
t,
|
|
683
683
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -686,34 +686,34 @@ function dt(e, t) {
|
|
|
686
686
|
)}".`
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
const n = e.source.body, r =
|
|
689
|
+
function pt(e, t) {
|
|
690
|
+
const n = e.source.body, r = Ne(n, t + 2);
|
|
691
691
|
if (G(r))
|
|
692
692
|
return {
|
|
693
693
|
value: String.fromCodePoint(r),
|
|
694
694
|
size: 6
|
|
695
695
|
};
|
|
696
696
|
if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
697
|
-
const i =
|
|
697
|
+
const i = Ne(n, t + 8);
|
|
698
698
|
if (we(i))
|
|
699
699
|
return {
|
|
700
700
|
value: String.fromCodePoint(r, i),
|
|
701
701
|
size: 12
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
|
-
throw
|
|
704
|
+
throw N(
|
|
705
705
|
e.source,
|
|
706
706
|
t,
|
|
707
707
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
708
708
|
);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Ne(e, t) {
|
|
711
711
|
return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
|
|
712
712
|
}
|
|
713
713
|
function j(e) {
|
|
714
714
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function ht(e, t) {
|
|
717
717
|
const n = e.source.body;
|
|
718
718
|
switch (n.charCodeAt(t + 1)) {
|
|
719
719
|
case 34:
|
|
@@ -758,7 +758,7 @@ function pt(e, t) {
|
|
|
758
758
|
size: 2
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
|
-
throw
|
|
761
|
+
throw N(
|
|
762
762
|
e.source,
|
|
763
763
|
t,
|
|
764
764
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -770,36 +770,36 @@ function pt(e, t) {
|
|
|
770
770
|
function ft(e, t) {
|
|
771
771
|
const n = e.source.body, r = n.length;
|
|
772
772
|
let i = e.lineStart, s = t + 3, o = s, c = "";
|
|
773
|
-
const
|
|
773
|
+
const p = [];
|
|
774
774
|
for (; s < r; ) {
|
|
775
|
-
const
|
|
776
|
-
if (
|
|
777
|
-
c += n.slice(o, s),
|
|
778
|
-
const m =
|
|
775
|
+
const h = n.charCodeAt(s);
|
|
776
|
+
if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
777
|
+
c += n.slice(o, s), p.push(c);
|
|
778
|
+
const m = S(
|
|
779
779
|
e,
|
|
780
780
|
u.BLOCK_STRING,
|
|
781
781
|
t,
|
|
782
782
|
s + 3,
|
|
783
783
|
// Return a string of the lines joined with U+000A.
|
|
784
|
-
nt(
|
|
784
|
+
nt(p).join(`
|
|
785
785
|
`)
|
|
786
786
|
);
|
|
787
|
-
return e.line +=
|
|
787
|
+
return e.line += p.length - 1, e.lineStart = i, m;
|
|
788
788
|
}
|
|
789
|
-
if (
|
|
789
|
+
if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
790
790
|
c += n.slice(o, s), o = s + 1, s += 4;
|
|
791
791
|
continue;
|
|
792
792
|
}
|
|
793
|
-
if (
|
|
794
|
-
c += n.slice(o, s),
|
|
793
|
+
if (h === 10 || h === 13) {
|
|
794
|
+
c += n.slice(o, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, i = s;
|
|
795
795
|
continue;
|
|
796
796
|
}
|
|
797
|
-
if (G(
|
|
797
|
+
if (G(h))
|
|
798
798
|
++s;
|
|
799
799
|
else if (se(n, s))
|
|
800
800
|
s += 2;
|
|
801
801
|
else
|
|
802
|
-
throw
|
|
802
|
+
throw N(
|
|
803
803
|
e.source,
|
|
804
804
|
s,
|
|
805
805
|
`Invalid character within String: ${F(
|
|
@@ -808,7 +808,7 @@ function ft(e, t) {
|
|
|
808
808
|
)}.`
|
|
809
809
|
);
|
|
810
810
|
}
|
|
811
|
-
throw
|
|
811
|
+
throw N(e.source, s, "Unterminated string.");
|
|
812
812
|
}
|
|
813
813
|
function mt(e, t) {
|
|
814
814
|
const n = e.source.body, r = n.length;
|
|
@@ -820,7 +820,7 @@ function mt(e, t) {
|
|
|
820
820
|
else
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
823
|
-
return
|
|
823
|
+
return S(
|
|
824
824
|
e,
|
|
825
825
|
u.NAME,
|
|
826
826
|
t,
|
|
@@ -863,7 +863,7 @@ function Ct(e) {
|
|
|
863
863
|
}
|
|
864
864
|
function Et(e, t) {
|
|
865
865
|
const n = Object.entries(e);
|
|
866
|
-
return n.length === 0 ? "{}" : t.length > Fe ? "[" +
|
|
866
|
+
return n.length === 0 ? "{}" : t.length > Fe ? "[" + Tt(e) + "]" : "{ " + n.map(
|
|
867
867
|
([i, s]) => i + ": " + oe(s, t)
|
|
868
868
|
).join(", ") + " }";
|
|
869
869
|
}
|
|
@@ -877,7 +877,7 @@ function vt(e, t) {
|
|
|
877
877
|
i.push(oe(e[s], t));
|
|
878
878
|
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function Tt(e) {
|
|
881
881
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
882
882
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
883
883
|
const n = e.constructor.name;
|
|
@@ -886,7 +886,7 @@ function At(e) {
|
|
|
886
886
|
}
|
|
887
887
|
return t;
|
|
888
888
|
}
|
|
889
|
-
const
|
|
889
|
+
const At = (
|
|
890
890
|
/* c8 ignore next 6 */
|
|
891
891
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
892
892
|
globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
|
|
@@ -936,15 +936,15 @@ class Be {
|
|
|
936
936
|
return "Source";
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
939
|
+
function It(e) {
|
|
940
|
+
return At(e, Be);
|
|
941
941
|
}
|
|
942
942
|
function Ue(e, t) {
|
|
943
|
-
return new
|
|
943
|
+
return new St(e, t).parseDocument();
|
|
944
944
|
}
|
|
945
|
-
class
|
|
945
|
+
class St {
|
|
946
946
|
constructor(t, n = {}) {
|
|
947
|
-
const r =
|
|
947
|
+
const r = It(t) ? t : new Be(t);
|
|
948
948
|
this._lexer = new st(r), this._options = n, this._tokenCounter = 0;
|
|
949
949
|
}
|
|
950
950
|
/**
|
|
@@ -1018,7 +1018,7 @@ class It {
|
|
|
1018
1018
|
return this.parseDirectiveDefinition();
|
|
1019
1019
|
}
|
|
1020
1020
|
if (t)
|
|
1021
|
-
throw
|
|
1021
|
+
throw N(
|
|
1022
1022
|
this._lexer.source,
|
|
1023
1023
|
this._lexer.token.start,
|
|
1024
1024
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -1047,7 +1047,7 @@ class It {
|
|
|
1047
1047
|
if (this.peek(u.BRACE_L))
|
|
1048
1048
|
return this.node(t, {
|
|
1049
1049
|
kind: f.OPERATION_DEFINITION,
|
|
1050
|
-
operation:
|
|
1050
|
+
operation: M.QUERY,
|
|
1051
1051
|
name: void 0,
|
|
1052
1052
|
variableDefinitions: [],
|
|
1053
1053
|
directives: [],
|
|
@@ -1071,11 +1071,11 @@ class It {
|
|
|
1071
1071
|
const t = this.expectToken(u.NAME);
|
|
1072
1072
|
switch (t.value) {
|
|
1073
1073
|
case "query":
|
|
1074
|
-
return
|
|
1074
|
+
return M.QUERY;
|
|
1075
1075
|
case "mutation":
|
|
1076
|
-
return
|
|
1076
|
+
return M.MUTATION;
|
|
1077
1077
|
case "subscription":
|
|
1078
|
-
return
|
|
1078
|
+
return M.SUBSCRIPTION;
|
|
1079
1079
|
}
|
|
1080
1080
|
throw this.unexpected(t);
|
|
1081
1081
|
}
|
|
@@ -1292,7 +1292,7 @@ class It {
|
|
|
1292
1292
|
if (t)
|
|
1293
1293
|
if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
|
|
1294
1294
|
const r = this._lexer.token.value;
|
|
1295
|
-
throw
|
|
1295
|
+
throw N(
|
|
1296
1296
|
this._lexer.source,
|
|
1297
1297
|
n.start,
|
|
1298
1298
|
`Unexpected variable "$${r}" in constant value.`
|
|
@@ -1639,7 +1639,7 @@ class It {
|
|
|
1639
1639
|
*/
|
|
1640
1640
|
parseEnumValueName() {
|
|
1641
1641
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
1642
|
-
throw
|
|
1642
|
+
throw N(
|
|
1643
1643
|
this._lexer.source,
|
|
1644
1644
|
this._lexer.token.start,
|
|
1645
1645
|
`${W(
|
|
@@ -1932,10 +1932,10 @@ class It {
|
|
|
1932
1932
|
const n = this._lexer.token;
|
|
1933
1933
|
if (n.kind === t)
|
|
1934
1934
|
return this.advanceLexer(), n;
|
|
1935
|
-
throw
|
|
1935
|
+
throw N(
|
|
1936
1936
|
this._lexer.source,
|
|
1937
1937
|
n.start,
|
|
1938
|
-
`Expected ${
|
|
1938
|
+
`Expected ${Me(t)}, found ${W(n)}.`
|
|
1939
1939
|
);
|
|
1940
1940
|
}
|
|
1941
1941
|
/**
|
|
@@ -1954,7 +1954,7 @@ class It {
|
|
|
1954
1954
|
if (n.kind === u.NAME && n.value === t)
|
|
1955
1955
|
this.advanceLexer();
|
|
1956
1956
|
else
|
|
1957
|
-
throw
|
|
1957
|
+
throw N(
|
|
1958
1958
|
this._lexer.source,
|
|
1959
1959
|
n.start,
|
|
1960
1960
|
`Expected "${t}", found ${W(n)}.`
|
|
@@ -1973,7 +1973,7 @@ class It {
|
|
|
1973
1973
|
*/
|
|
1974
1974
|
unexpected(t) {
|
|
1975
1975
|
const n = t ?? this._lexer.token;
|
|
1976
|
-
return
|
|
1976
|
+
return N(
|
|
1977
1977
|
this._lexer.source,
|
|
1978
1978
|
n.start,
|
|
1979
1979
|
`Unexpected ${W(n)}.`
|
|
@@ -2036,7 +2036,7 @@ class It {
|
|
|
2036
2036
|
advanceLexer() {
|
|
2037
2037
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2038
2038
|
if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
2039
|
-
throw
|
|
2039
|
+
throw N(
|
|
2040
2040
|
this._lexer.source,
|
|
2041
2041
|
n.start,
|
|
2042
2042
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -2045,19 +2045,19 @@ class It {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
function W(e) {
|
|
2047
2047
|
const t = e.value;
|
|
2048
|
-
return
|
|
2048
|
+
return Me(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2049
2049
|
}
|
|
2050
|
-
function
|
|
2050
|
+
function Me(e) {
|
|
2051
2051
|
return ot(e) ? `"${e}"` : e;
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2054
|
-
return `"${e.replace(
|
|
2053
|
+
function Nt(e) {
|
|
2054
|
+
return `"${e.replace(Rt, xt)}"`;
|
|
2055
2055
|
}
|
|
2056
|
-
const
|
|
2056
|
+
const Rt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2057
2057
|
function xt(e) {
|
|
2058
|
-
return
|
|
2058
|
+
return bt[e.charCodeAt(0)];
|
|
2059
2059
|
}
|
|
2060
|
-
const
|
|
2060
|
+
const bt = [
|
|
2061
2061
|
"\\u0000",
|
|
2062
2062
|
"\\u0001",
|
|
2063
2063
|
"\\u0002",
|
|
@@ -2224,59 +2224,59 @@ const Rt = [
|
|
|
2224
2224
|
"\\u009E",
|
|
2225
2225
|
"\\u009F"
|
|
2226
2226
|
], Ot = Object.freeze({});
|
|
2227
|
-
function Dt(e, t, n =
|
|
2227
|
+
function Dt(e, t, n = Pe) {
|
|
2228
2228
|
const r = /* @__PURE__ */ new Map();
|
|
2229
2229
|
for (const D of Object.values(f))
|
|
2230
|
-
r.set(D,
|
|
2231
|
-
let i, s = Array.isArray(e), o = [e], c = -1,
|
|
2232
|
-
const C = [],
|
|
2230
|
+
r.set(D, Pt(t, D));
|
|
2231
|
+
let i, s = Array.isArray(e), o = [e], c = -1, p = [], h = e, m, y;
|
|
2232
|
+
const C = [], A = [];
|
|
2233
2233
|
do {
|
|
2234
2234
|
c++;
|
|
2235
|
-
const D = c === o.length, z = D &&
|
|
2235
|
+
const D = c === o.length, z = D && p.length !== 0;
|
|
2236
2236
|
if (D) {
|
|
2237
|
-
if (m =
|
|
2237
|
+
if (m = A.length === 0 ? void 0 : C[C.length - 1], h = y, y = A.pop(), z)
|
|
2238
2238
|
if (s) {
|
|
2239
|
-
|
|
2240
|
-
let
|
|
2241
|
-
for (const [B, J] of
|
|
2242
|
-
const Q = B -
|
|
2243
|
-
J === null ? (
|
|
2239
|
+
h = h.slice();
|
|
2240
|
+
let P = 0;
|
|
2241
|
+
for (const [B, J] of p) {
|
|
2242
|
+
const Q = B - P;
|
|
2243
|
+
J === null ? (h.splice(Q, 1), P++) : h[Q] = J;
|
|
2244
2244
|
}
|
|
2245
2245
|
} else {
|
|
2246
|
-
|
|
2246
|
+
h = Object.defineProperties(
|
|
2247
2247
|
{},
|
|
2248
|
-
Object.getOwnPropertyDescriptors(
|
|
2248
|
+
Object.getOwnPropertyDescriptors(h)
|
|
2249
2249
|
);
|
|
2250
|
-
for (const [
|
|
2251
|
-
|
|
2250
|
+
for (const [P, B] of p)
|
|
2251
|
+
h[P] = B;
|
|
2252
2252
|
}
|
|
2253
|
-
c = i.index, o = i.keys,
|
|
2253
|
+
c = i.index, o = i.keys, p = i.edits, s = i.inArray, i = i.prev;
|
|
2254
2254
|
} else if (y) {
|
|
2255
|
-
if (m = s ? c : o[c],
|
|
2255
|
+
if (m = s ? c : o[c], h = y[m], h == null)
|
|
2256
2256
|
continue;
|
|
2257
2257
|
C.push(m);
|
|
2258
2258
|
}
|
|
2259
2259
|
let _;
|
|
2260
|
-
if (!Array.isArray(
|
|
2261
|
-
var g,
|
|
2262
|
-
|
|
2263
|
-
const
|
|
2264
|
-
if (_ =
|
|
2260
|
+
if (!Array.isArray(h)) {
|
|
2261
|
+
var g, I;
|
|
2262
|
+
Se(h) || K(!1, `Invalid AST Node: ${Ee(h)}.`);
|
|
2263
|
+
const P = D ? (g = r.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (I = r.get(h.kind)) === null || I === void 0 ? void 0 : I.enter;
|
|
2264
|
+
if (_ = P == null ? void 0 : P.call(t, h, m, y, C, A), _ === Ot)
|
|
2265
2265
|
break;
|
|
2266
2266
|
if (_ === !1) {
|
|
2267
2267
|
if (!D) {
|
|
2268
2268
|
C.pop();
|
|
2269
2269
|
continue;
|
|
2270
2270
|
}
|
|
2271
|
-
} else if (_ !== void 0 && (
|
|
2272
|
-
if (
|
|
2273
|
-
|
|
2271
|
+
} else if (_ !== void 0 && (p.push([m, _]), !D))
|
|
2272
|
+
if (Se(_))
|
|
2273
|
+
h = _;
|
|
2274
2274
|
else {
|
|
2275
2275
|
C.pop();
|
|
2276
2276
|
continue;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
if (_ === void 0 && z &&
|
|
2279
|
+
if (_ === void 0 && z && p.push([m, h]), D)
|
|
2280
2280
|
C.pop();
|
|
2281
2281
|
else {
|
|
2282
2282
|
var O;
|
|
@@ -2284,14 +2284,14 @@ function Dt(e, t, n = ke) {
|
|
|
2284
2284
|
inArray: s,
|
|
2285
2285
|
index: c,
|
|
2286
2286
|
keys: o,
|
|
2287
|
-
edits:
|
|
2287
|
+
edits: p,
|
|
2288
2288
|
prev: i
|
|
2289
|
-
}, s = Array.isArray(
|
|
2289
|
+
}, s = Array.isArray(h), o = s ? h : (O = n[h.kind]) !== null && O !== void 0 ? O : [], c = -1, p = [], y && A.push(y), y = h;
|
|
2290
2290
|
}
|
|
2291
2291
|
} while (i !== void 0);
|
|
2292
|
-
return
|
|
2292
|
+
return p.length !== 0 ? p[p.length - 1][1] : e;
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function Pt(e, t) {
|
|
2295
2295
|
const n = e[t];
|
|
2296
2296
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
2297
2297
|
enter: n,
|
|
@@ -2301,7 +2301,7 @@ function kt(e, t) {
|
|
|
2301
2301
|
leave: e.leave
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
|
-
function
|
|
2304
|
+
function kt(e) {
|
|
2305
2305
|
return Dt(e, Lt);
|
|
2306
2306
|
}
|
|
2307
2307
|
const _t = 80, Lt = {
|
|
@@ -2334,7 +2334,7 @@ const _t = 80, Lt = {
|
|
|
2334
2334
|
leave: ({ variable: e, type: t, defaultValue: n, directives: r }) => e + ": " + t + v(" = ", n) + v(" ", d(r, " "))
|
|
2335
2335
|
},
|
|
2336
2336
|
SelectionSet: {
|
|
2337
|
-
leave: ({ selections: e }) =>
|
|
2337
|
+
leave: ({ selections: e }) => k(e)
|
|
2338
2338
|
},
|
|
2339
2339
|
Field: {
|
|
2340
2340
|
leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
|
|
@@ -2378,7 +2378,7 @@ const _t = 80, Lt = {
|
|
|
2378
2378
|
leave: ({ value: e }) => e
|
|
2379
2379
|
},
|
|
2380
2380
|
StringValue: {
|
|
2381
|
-
leave: ({ value: e, block: t }) => t ?
|
|
2381
|
+
leave: ({ value: e, block: t }) => t ? rt(e) : Nt(e)
|
|
2382
2382
|
},
|
|
2383
2383
|
BooleanValue: {
|
|
2384
2384
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2415,7 +2415,7 @@ const _t = 80, Lt = {
|
|
|
2415
2415
|
// Type System Definitions
|
|
2416
2416
|
SchemaDefinition: {
|
|
2417
2417
|
leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
|
|
2418
|
-
`) + d(["schema", d(t, " "),
|
|
2418
|
+
`) + d(["schema", d(t, " "), k(n)], " ")
|
|
2419
2419
|
},
|
|
2420
2420
|
OperationTypeDefinition: {
|
|
2421
2421
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
@@ -2432,14 +2432,14 @@ const _t = 80, Lt = {
|
|
|
2432
2432
|
t,
|
|
2433
2433
|
v("implements ", d(n, " & ")),
|
|
2434
2434
|
d(r, " "),
|
|
2435
|
-
|
|
2435
|
+
k(i)
|
|
2436
2436
|
],
|
|
2437
2437
|
" "
|
|
2438
2438
|
)
|
|
2439
2439
|
},
|
|
2440
2440
|
FieldDefinition: {
|
|
2441
2441
|
leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
|
|
2442
|
-
`) + t + (
|
|
2442
|
+
`) + t + (Re(n) ? v(`(
|
|
2443
2443
|
`, Z(d(n, `
|
|
2444
2444
|
`)), `
|
|
2445
2445
|
)`) : v("(", d(n, ", "), ")")) + ": " + r + v(" ", d(i, " "))
|
|
@@ -2459,7 +2459,7 @@ const _t = 80, Lt = {
|
|
|
2459
2459
|
t,
|
|
2460
2460
|
v("implements ", d(n, " & ")),
|
|
2461
2461
|
d(r, " "),
|
|
2462
|
-
|
|
2462
|
+
k(i)
|
|
2463
2463
|
],
|
|
2464
2464
|
" "
|
|
2465
2465
|
)
|
|
@@ -2473,7 +2473,7 @@ const _t = 80, Lt = {
|
|
|
2473
2473
|
},
|
|
2474
2474
|
EnumTypeDefinition: {
|
|
2475
2475
|
leave: ({ description: e, name: t, directives: n, values: r }) => v("", e, `
|
|
2476
|
-
`) + d(["enum", t, d(n, " "),
|
|
2476
|
+
`) + d(["enum", t, d(n, " "), k(r)], " ")
|
|
2477
2477
|
},
|
|
2478
2478
|
EnumValueDefinition: {
|
|
2479
2479
|
leave: ({ description: e, name: t, directives: n }) => v("", e, `
|
|
@@ -2481,18 +2481,18 @@ const _t = 80, Lt = {
|
|
|
2481
2481
|
},
|
|
2482
2482
|
InputObjectTypeDefinition: {
|
|
2483
2483
|
leave: ({ description: e, name: t, directives: n, fields: r }) => v("", e, `
|
|
2484
|
-
`) + d(["input", t, d(n, " "),
|
|
2484
|
+
`) + d(["input", t, d(n, " "), k(r)], " ")
|
|
2485
2485
|
},
|
|
2486
2486
|
DirectiveDefinition: {
|
|
2487
2487
|
leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
|
|
2488
|
-
`) + "directive @" + t + (
|
|
2488
|
+
`) + "directive @" + t + (Re(n) ? v(`(
|
|
2489
2489
|
`, Z(d(n, `
|
|
2490
2490
|
`)), `
|
|
2491
2491
|
)`) : v("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
|
|
2492
2492
|
},
|
|
2493
2493
|
SchemaExtension: {
|
|
2494
2494
|
leave: ({ directives: e, operationTypes: t }) => d(
|
|
2495
|
-
["extend schema", d(e, " "),
|
|
2495
|
+
["extend schema", d(e, " "), k(t)],
|
|
2496
2496
|
" "
|
|
2497
2497
|
)
|
|
2498
2498
|
},
|
|
@@ -2506,7 +2506,7 @@ const _t = 80, Lt = {
|
|
|
2506
2506
|
e,
|
|
2507
2507
|
v("implements ", d(t, " & ")),
|
|
2508
2508
|
d(n, " "),
|
|
2509
|
-
|
|
2509
|
+
k(r)
|
|
2510
2510
|
],
|
|
2511
2511
|
" "
|
|
2512
2512
|
)
|
|
@@ -2518,7 +2518,7 @@ const _t = 80, Lt = {
|
|
|
2518
2518
|
e,
|
|
2519
2519
|
v("implements ", d(t, " & ")),
|
|
2520
2520
|
d(n, " "),
|
|
2521
|
-
|
|
2521
|
+
k(r)
|
|
2522
2522
|
],
|
|
2523
2523
|
" "
|
|
2524
2524
|
)
|
|
@@ -2535,17 +2535,17 @@ const _t = 80, Lt = {
|
|
|
2535
2535
|
)
|
|
2536
2536
|
},
|
|
2537
2537
|
EnumTypeExtension: {
|
|
2538
|
-
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "),
|
|
2538
|
+
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), k(n)], " ")
|
|
2539
2539
|
},
|
|
2540
2540
|
InputObjectTypeExtension: {
|
|
2541
|
-
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "),
|
|
2541
|
+
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), k(n)], " ")
|
|
2542
2542
|
}
|
|
2543
2543
|
};
|
|
2544
2544
|
function d(e, t = "") {
|
|
2545
2545
|
var n;
|
|
2546
2546
|
return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2548
|
+
function k(e) {
|
|
2549
2549
|
return v(`{
|
|
2550
2550
|
`, Z(d(e, `
|
|
2551
2551
|
`)), `
|
|
@@ -2558,12 +2558,12 @@ function Z(e) {
|
|
|
2558
2558
|
return v(" ", e.replace(/\n/g, `
|
|
2559
2559
|
`));
|
|
2560
2560
|
}
|
|
2561
|
-
function
|
|
2561
|
+
function Re(e) {
|
|
2562
2562
|
var t;
|
|
2563
2563
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2564
2564
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2565
2565
|
}
|
|
2566
|
-
var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(),
|
|
2566
|
+
var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), qe = !0, ie = !1;
|
|
2567
2567
|
function Ge(e) {
|
|
2568
2568
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2569
2569
|
}
|
|
@@ -2575,7 +2575,7 @@ function Ft(e) {
|
|
|
2575
2575
|
return e.definitions.forEach(function(r) {
|
|
2576
2576
|
if (r.kind === "FragmentDefinition") {
|
|
2577
2577
|
var i = r.name.value, s = wt(r.loc), o = ge.get(i);
|
|
2578
|
-
o && !o.has(s) ?
|
|
2578
|
+
o && !o.has(s) ? qe && console.warn("Warning: fragment with name " + i + ` already exists.
|
|
2579
2579
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
2580
2580
|
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ge.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
|
|
2581
2581
|
} else
|
|
@@ -2597,8 +2597,8 @@ function Ut(e) {
|
|
|
2597
2597
|
var t = Ge(e);
|
|
2598
2598
|
if (!ee.has(t)) {
|
|
2599
2599
|
var n = Ue(e, {
|
|
2600
|
-
experimentalFragmentVariables:
|
|
2601
|
-
allowLegacyFragmentVariables:
|
|
2600
|
+
experimentalFragmentVariables: ie,
|
|
2601
|
+
allowLegacyFragmentVariables: ie
|
|
2602
2602
|
});
|
|
2603
2603
|
if (!n || n.kind !== "Document")
|
|
2604
2604
|
throw new Error("Not a valid GraphQL document.");
|
|
@@ -2606,7 +2606,7 @@ function Ut(e) {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
return ee.get(t);
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2609
|
+
function q(e) {
|
|
2610
2610
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
2611
2611
|
t[n - 1] = arguments[n];
|
|
2612
2612
|
typeof e == "string" && (e = [e]);
|
|
@@ -2615,30 +2615,30 @@ function M(e) {
|
|
|
2615
2615
|
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
2616
2616
|
}), Ut(r);
|
|
2617
2617
|
}
|
|
2618
|
-
function
|
|
2618
|
+
function Mt() {
|
|
2619
2619
|
ee.clear(), ge.clear();
|
|
2620
2620
|
}
|
|
2621
|
-
function
|
|
2622
|
-
|
|
2621
|
+
function qt() {
|
|
2622
|
+
qe = !1;
|
|
2623
2623
|
}
|
|
2624
2624
|
function Gt() {
|
|
2625
|
-
|
|
2625
|
+
ie = !0;
|
|
2626
2626
|
}
|
|
2627
2627
|
function Vt() {
|
|
2628
|
-
|
|
2628
|
+
ie = !1;
|
|
2629
2629
|
}
|
|
2630
2630
|
var $ = {
|
|
2631
|
-
gql:
|
|
2632
|
-
resetCaches:
|
|
2633
|
-
disableFragmentWarnings:
|
|
2631
|
+
gql: q,
|
|
2632
|
+
resetCaches: Mt,
|
|
2633
|
+
disableFragmentWarnings: qt,
|
|
2634
2634
|
enableExperimentalFragmentVariables: Gt,
|
|
2635
2635
|
disableExperimentalFragmentVariables: Vt
|
|
2636
2636
|
};
|
|
2637
2637
|
(function(e) {
|
|
2638
2638
|
e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
|
|
2639
|
-
})(
|
|
2640
|
-
|
|
2641
|
-
const x =
|
|
2639
|
+
})(q || (q = {}));
|
|
2640
|
+
q.default = q;
|
|
2641
|
+
const x = q, $t = x`
|
|
2642
2642
|
query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2643
2643
|
locationAvailabilities(
|
|
2644
2644
|
sku: $sku
|
|
@@ -2717,16 +2717,16 @@ const x = M, $t = x`
|
|
|
2717
2717
|
purchasingCustomer {
|
|
2718
2718
|
pointsApproved
|
|
2719
2719
|
pointsPending
|
|
2720
|
+
pointsExpiringSoon {
|
|
2721
|
+
points
|
|
2722
|
+
expiresDate
|
|
2723
|
+
availableUntil
|
|
2724
|
+
}
|
|
2720
2725
|
}
|
|
2721
2726
|
}
|
|
2722
2727
|
`, zt = x`
|
|
2723
|
-
query GetLocations($
|
|
2724
|
-
locations(
|
|
2725
|
-
first: $first
|
|
2726
|
-
after: $after
|
|
2727
|
-
isReverse: $isReverse
|
|
2728
|
-
filter: {tag: $tag, provinceCodes: $provinceCodes}
|
|
2729
|
-
) {
|
|
2728
|
+
query GetLocations($first: Int, $after: String, $filter: LocationFilter, $isReverse: Boolean! = false) {
|
|
2729
|
+
locations(first: $first, after: $after, filter: $filter, isReverse: $isReverse) {
|
|
2730
2730
|
nodes {
|
|
2731
2731
|
id
|
|
2732
2732
|
name
|
|
@@ -2952,6 +2952,8 @@ const x = M, $t = x`
|
|
|
2952
2952
|
pointCampaignOrderRule {
|
|
2953
2953
|
id
|
|
2954
2954
|
title
|
|
2955
|
+
pointMethod
|
|
2956
|
+
targetType
|
|
2955
2957
|
}
|
|
2956
2958
|
multiplier
|
|
2957
2959
|
fixedPoint
|
|
@@ -2960,13 +2962,33 @@ const x = M, $t = x`
|
|
|
2960
2962
|
`, nn = x`
|
|
2961
2963
|
query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
|
|
2962
2964
|
estimatedShopifyCartPoint(input: $input) {
|
|
2963
|
-
|
|
2965
|
+
pointsEarning
|
|
2966
|
+
totalPointsEarning
|
|
2967
|
+
pointCampaign {
|
|
2968
|
+
pointsEarning
|
|
2969
|
+
pointCampaignOrderRule {
|
|
2970
|
+
id
|
|
2971
|
+
title
|
|
2972
|
+
pointMethod
|
|
2973
|
+
targetType
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2964
2976
|
}
|
|
2965
2977
|
}
|
|
2966
2978
|
`, rn = x`
|
|
2967
2979
|
query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
|
|
2968
2980
|
estimatedShopifyCartLineItemPoint(input: $input) {
|
|
2969
|
-
|
|
2981
|
+
pointsEarning
|
|
2982
|
+
totalPointsEarning
|
|
2983
|
+
pointCampaign {
|
|
2984
|
+
pointsEarning
|
|
2985
|
+
pointCampaignOrderRule {
|
|
2986
|
+
id
|
|
2987
|
+
title
|
|
2988
|
+
pointMethod
|
|
2989
|
+
targetType
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2970
2992
|
}
|
|
2971
2993
|
}
|
|
2972
2994
|
`, sn = x`
|
|
@@ -3066,12 +3088,12 @@ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
|
|
|
3066
3088
|
variables: t,
|
|
3067
3089
|
requestHeaders: n,
|
|
3068
3090
|
signal: void 0
|
|
3069
|
-
},
|
|
3091
|
+
}, pn = (e, t, n) => e.query ? e : {
|
|
3070
3092
|
query: e,
|
|
3071
3093
|
variables: t,
|
|
3072
3094
|
requestHeaders: n,
|
|
3073
3095
|
signal: void 0
|
|
3074
|
-
},
|
|
3096
|
+
}, hn = (e, t) => e.documents ? e : {
|
|
3075
3097
|
documents: e,
|
|
3076
3098
|
requestHeaders: t,
|
|
3077
3099
|
signal: void 0
|
|
@@ -3091,7 +3113,7 @@ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
|
|
|
3091
3113
|
return { query: e, operationName: n };
|
|
3092
3114
|
}
|
|
3093
3115
|
const t = xe(e);
|
|
3094
|
-
return { query:
|
|
3116
|
+
return { query: kt(e), operationName: t };
|
|
3095
3117
|
};
|
|
3096
3118
|
class H extends Error {
|
|
3097
3119
|
constructor(t, n) {
|
|
@@ -3133,11 +3155,11 @@ var ye = { exports: {} };
|
|
|
3133
3155
|
formData: "FormData" in s,
|
|
3134
3156
|
arrayBuffer: "ArrayBuffer" in s
|
|
3135
3157
|
};
|
|
3136
|
-
function
|
|
3158
|
+
function p(a) {
|
|
3137
3159
|
return a && DataView.prototype.isPrototypeOf(a);
|
|
3138
3160
|
}
|
|
3139
3161
|
if (c.arrayBuffer)
|
|
3140
|
-
var
|
|
3162
|
+
var h = [
|
|
3141
3163
|
"[object Int8Array]",
|
|
3142
3164
|
"[object Uint8Array]",
|
|
3143
3165
|
"[object Uint8ClampedArray]",
|
|
@@ -3148,7 +3170,7 @@ var ye = { exports: {} };
|
|
|
3148
3170
|
"[object Float32Array]",
|
|
3149
3171
|
"[object Float64Array]"
|
|
3150
3172
|
], m = ArrayBuffer.isView || function(a) {
|
|
3151
|
-
return a &&
|
|
3173
|
+
return a && h.indexOf(Object.prototype.toString.call(a)) > -1;
|
|
3152
3174
|
};
|
|
3153
3175
|
function y(a) {
|
|
3154
3176
|
if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
|
|
@@ -3158,7 +3180,7 @@ var ye = { exports: {} };
|
|
|
3158
3180
|
function C(a) {
|
|
3159
3181
|
return typeof a != "string" && (a = String(a)), a;
|
|
3160
3182
|
}
|
|
3161
|
-
function
|
|
3183
|
+
function A(a) {
|
|
3162
3184
|
var l = {
|
|
3163
3185
|
next: function() {
|
|
3164
3186
|
var E = a.shift();
|
|
@@ -3197,19 +3219,19 @@ var ye = { exports: {} };
|
|
|
3197
3219
|
var a = [];
|
|
3198
3220
|
return this.forEach(function(l, E) {
|
|
3199
3221
|
a.push(E);
|
|
3200
|
-
}),
|
|
3222
|
+
}), A(a);
|
|
3201
3223
|
}, g.prototype.values = function() {
|
|
3202
3224
|
var a = [];
|
|
3203
3225
|
return this.forEach(function(l) {
|
|
3204
3226
|
a.push(l);
|
|
3205
|
-
}),
|
|
3227
|
+
}), A(a);
|
|
3206
3228
|
}, g.prototype.entries = function() {
|
|
3207
3229
|
var a = [];
|
|
3208
3230
|
return this.forEach(function(l, E) {
|
|
3209
3231
|
a.push([E, l]);
|
|
3210
|
-
}),
|
|
3232
|
+
}), A(a);
|
|
3211
3233
|
}, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
|
|
3212
|
-
function
|
|
3234
|
+
function I(a) {
|
|
3213
3235
|
if (a.bodyUsed)
|
|
3214
3236
|
return Promise.reject(new TypeError("Already read"));
|
|
3215
3237
|
a.bodyUsed = !0;
|
|
@@ -3232,11 +3254,11 @@ var ye = { exports: {} };
|
|
|
3232
3254
|
return l.readAsText(a), E;
|
|
3233
3255
|
}
|
|
3234
3256
|
function _(a) {
|
|
3235
|
-
for (var l = new Uint8Array(a), E = new Array(l.length),
|
|
3236
|
-
E[
|
|
3257
|
+
for (var l = new Uint8Array(a), E = new Array(l.length), b = 0; b < l.length; b++)
|
|
3258
|
+
E[b] = String.fromCharCode(l[b]);
|
|
3237
3259
|
return E.join("");
|
|
3238
3260
|
}
|
|
3239
|
-
function
|
|
3261
|
+
function P(a) {
|
|
3240
3262
|
if (a.slice)
|
|
3241
3263
|
return a.slice(0);
|
|
3242
3264
|
var l = new Uint8Array(a.byteLength);
|
|
@@ -3244,9 +3266,9 @@ var ye = { exports: {} };
|
|
|
3244
3266
|
}
|
|
3245
3267
|
function B() {
|
|
3246
3268
|
return this.bodyUsed = !1, this._initBody = function(a) {
|
|
3247
|
-
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 &&
|
|
3269
|
+
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 && p(a) ? (this._bodyArrayBuffer = P(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = P(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"));
|
|
3248
3270
|
}, c.blob && (this.blob = function() {
|
|
3249
|
-
var a =
|
|
3271
|
+
var a = I(this);
|
|
3250
3272
|
if (a)
|
|
3251
3273
|
return a;
|
|
3252
3274
|
if (this._bodyBlob)
|
|
@@ -3257,9 +3279,9 @@ var ye = { exports: {} };
|
|
|
3257
3279
|
throw new Error("could not read FormData body as blob");
|
|
3258
3280
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
3259
3281
|
}, this.arrayBuffer = function() {
|
|
3260
|
-
return this._bodyArrayBuffer ?
|
|
3282
|
+
return this._bodyArrayBuffer ? I(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
|
|
3261
3283
|
}), this.text = function() {
|
|
3262
|
-
var a =
|
|
3284
|
+
var a = I(this);
|
|
3263
3285
|
if (a)
|
|
3264
3286
|
return a;
|
|
3265
3287
|
if (this._bodyBlob)
|
|
@@ -3300,18 +3322,18 @@ var ye = { exports: {} };
|
|
|
3300
3322
|
var l = new FormData();
|
|
3301
3323
|
return a.trim().split("&").forEach(function(E) {
|
|
3302
3324
|
if (E) {
|
|
3303
|
-
var
|
|
3304
|
-
l.append(decodeURIComponent(
|
|
3325
|
+
var b = E.split("="), R = b.shift().replace(/\+/g, " "), T = b.join("=").replace(/\+/g, " ");
|
|
3326
|
+
l.append(decodeURIComponent(R), decodeURIComponent(T));
|
|
3305
3327
|
}
|
|
3306
3328
|
}), l;
|
|
3307
3329
|
}
|
|
3308
3330
|
function $e(a) {
|
|
3309
3331
|
var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
|
|
3310
|
-
return E.split(/\r?\n/).forEach(function(
|
|
3311
|
-
var
|
|
3312
|
-
if (
|
|
3313
|
-
var X =
|
|
3314
|
-
l.append(
|
|
3332
|
+
return E.split(/\r?\n/).forEach(function(b) {
|
|
3333
|
+
var R = b.split(":"), T = R.shift().trim();
|
|
3334
|
+
if (T) {
|
|
3335
|
+
var X = R.join(":").trim();
|
|
3336
|
+
l.append(T, X);
|
|
3315
3337
|
}
|
|
3316
3338
|
}), l;
|
|
3317
3339
|
}
|
|
@@ -3341,39 +3363,39 @@ var ye = { exports: {} };
|
|
|
3341
3363
|
} catch {
|
|
3342
3364
|
o.DOMException = function(l, E) {
|
|
3343
3365
|
this.message = l, this.name = E;
|
|
3344
|
-
var
|
|
3345
|
-
this.stack =
|
|
3366
|
+
var b = Error(l);
|
|
3367
|
+
this.stack = b.stack;
|
|
3346
3368
|
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
3347
3369
|
}
|
|
3348
3370
|
function ae(a, l) {
|
|
3349
|
-
return new Promise(function(E,
|
|
3350
|
-
var
|
|
3351
|
-
if (
|
|
3352
|
-
return
|
|
3353
|
-
var
|
|
3371
|
+
return new Promise(function(E, b) {
|
|
3372
|
+
var R = new w(a, l);
|
|
3373
|
+
if (R.signal && R.signal.aborted)
|
|
3374
|
+
return b(new o.DOMException("Aborted", "AbortError"));
|
|
3375
|
+
var T = new XMLHttpRequest();
|
|
3354
3376
|
function X() {
|
|
3355
|
-
|
|
3377
|
+
T.abort();
|
|
3356
3378
|
}
|
|
3357
|
-
|
|
3379
|
+
T.onload = function() {
|
|
3358
3380
|
var V = {
|
|
3359
|
-
status:
|
|
3360
|
-
statusText:
|
|
3361
|
-
headers: $e(
|
|
3381
|
+
status: T.status,
|
|
3382
|
+
statusText: T.statusText,
|
|
3383
|
+
headers: $e(T.getAllResponseHeaders() || "")
|
|
3362
3384
|
};
|
|
3363
|
-
V.url = "responseURL" in
|
|
3364
|
-
var ue = "response" in
|
|
3385
|
+
V.url = "responseURL" in T ? T.responseURL : V.headers.get("X-Request-URL");
|
|
3386
|
+
var ue = "response" in T ? T.response : T.responseText;
|
|
3365
3387
|
E(new L(ue, V));
|
|
3366
|
-
},
|
|
3367
|
-
|
|
3368
|
-
},
|
|
3369
|
-
|
|
3370
|
-
},
|
|
3371
|
-
|
|
3372
|
-
},
|
|
3373
|
-
|
|
3374
|
-
}),
|
|
3375
|
-
|
|
3376
|
-
}),
|
|
3388
|
+
}, T.onerror = function() {
|
|
3389
|
+
b(new TypeError("Network request failed"));
|
|
3390
|
+
}, T.ontimeout = function() {
|
|
3391
|
+
b(new TypeError("Network request failed"));
|
|
3392
|
+
}, T.onabort = function() {
|
|
3393
|
+
b(new o.DOMException("Aborted", "AbortError"));
|
|
3394
|
+
}, T.open(R.method, R.url, !0), R.credentials === "include" ? T.withCredentials = !0 : R.credentials === "omit" && (T.withCredentials = !1), "responseType" in T && c.blob && (T.responseType = "blob"), R.headers.forEach(function(V, ue) {
|
|
3395
|
+
T.setRequestHeader(ue, V);
|
|
3396
|
+
}), R.signal && (R.signal.addEventListener("abort", X), T.onreadystatechange = function() {
|
|
3397
|
+
T.readyState === 4 && R.signal.removeEventListener("abort", X);
|
|
3398
|
+
}), T.send(typeof R._bodyInit > "u" ? null : R._bodyInit);
|
|
3377
3399
|
});
|
|
3378
3400
|
}
|
|
3379
3401
|
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;
|
|
@@ -3382,31 +3404,31 @@ var ye = { exports: {} };
|
|
|
3382
3404
|
var i = r;
|
|
3383
3405
|
t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
|
|
3384
3406
|
})(ye, ye.exports);
|
|
3385
|
-
var
|
|
3386
|
-
const te = /* @__PURE__ */ mn(
|
|
3407
|
+
var re = ye.exports;
|
|
3408
|
+
const te = /* @__PURE__ */ mn(re), gn = /* @__PURE__ */ ze({
|
|
3387
3409
|
__proto__: null,
|
|
3388
3410
|
default: te
|
|
3389
|
-
}, [
|
|
3411
|
+
}, [re]), U = (e) => {
|
|
3390
3412
|
let t = {};
|
|
3391
|
-
return e && (typeof Headers < "u" && e instanceof Headers || gn &&
|
|
3413
|
+
return e && (typeof Headers < "u" && e instanceof Headers || gn && re.Headers && e instanceof re.Headers ? t = ln(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
|
|
3392
3414
|
n && r !== void 0 && (t[n] = r);
|
|
3393
3415
|
}) : t = e), t;
|
|
3394
|
-
},
|
|
3416
|
+
}, be = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), yn = (e) => {
|
|
3395
3417
|
if (!Array.isArray(e.query)) {
|
|
3396
|
-
const r = e, i = [`query=${encodeURIComponent(
|
|
3418
|
+
const r = e, i = [`query=${encodeURIComponent(be(r.query))}`];
|
|
3397
3419
|
return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
|
|
3398
3420
|
}
|
|
3399
3421
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
3400
3422
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
3401
3423
|
const t = e, n = e.query.reduce((r, i, s) => (r.push({
|
|
3402
|
-
query:
|
|
3424
|
+
query: be(i),
|
|
3403
3425
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
3404
3426
|
}), r), []);
|
|
3405
3427
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
3406
3428
|
}, Cn = (e) => async (t) => {
|
|
3407
|
-
const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware:
|
|
3429
|
+
const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
|
|
3408
3430
|
let m = "", y;
|
|
3409
|
-
e === "POST" ? (y = vn(r, i, s, c.jsonSerializer), typeof y == "string" && (
|
|
3431
|
+
e === "POST" ? (y = vn(r, i, s, c.jsonSerializer), typeof y == "string" && (h["Content-Type"] = "application/json")) : m = yn({
|
|
3410
3432
|
query: r,
|
|
3411
3433
|
variables: i,
|
|
3412
3434
|
operationName: s,
|
|
@@ -3414,35 +3436,35 @@ const te = /* @__PURE__ */ mn(ie), gn = /* @__PURE__ */ ze({
|
|
|
3414
3436
|
});
|
|
3415
3437
|
const C = {
|
|
3416
3438
|
method: e,
|
|
3417
|
-
headers:
|
|
3439
|
+
headers: h,
|
|
3418
3440
|
body: y,
|
|
3419
3441
|
...c
|
|
3420
3442
|
};
|
|
3421
|
-
let
|
|
3422
|
-
if (
|
|
3423
|
-
const
|
|
3424
|
-
|
|
3443
|
+
let A = n, g = C;
|
|
3444
|
+
if (p) {
|
|
3445
|
+
const I = await Promise.resolve(p({ ...C, url: n, operationName: s, variables: i })), { url: O, ...D } = I;
|
|
3446
|
+
A = O, g = D;
|
|
3425
3447
|
}
|
|
3426
|
-
return m && (
|
|
3448
|
+
return m && (A = `${A}?${m}`), await o(A, g);
|
|
3427
3449
|
};
|
|
3428
3450
|
class En {
|
|
3429
3451
|
constructor(t, n = {}) {
|
|
3430
3452
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
|
|
3431
|
-
const [i, s, o] = r, c =
|
|
3432
|
-
c.signal !== void 0 && (
|
|
3433
|
-
const { operationName:
|
|
3453
|
+
const [i, s, o] = r, c = pn(i, s, o), { headers: p, fetch: h = te, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...A } = this.requestConfig, { url: g } = this;
|
|
3454
|
+
c.signal !== void 0 && (A.signal = c.signal);
|
|
3455
|
+
const { operationName: I } = le(c.query);
|
|
3434
3456
|
return de({
|
|
3435
3457
|
url: g,
|
|
3436
3458
|
query: c.query,
|
|
3437
3459
|
variables: c.variables,
|
|
3438
3460
|
headers: {
|
|
3439
|
-
...U(
|
|
3461
|
+
...U(pe(p)),
|
|
3440
3462
|
...U(c.requestHeaders)
|
|
3441
3463
|
},
|
|
3442
|
-
operationName:
|
|
3443
|
-
fetch:
|
|
3464
|
+
operationName: I,
|
|
3465
|
+
fetch: h,
|
|
3444
3466
|
method: m,
|
|
3445
|
-
fetchOptions:
|
|
3467
|
+
fetchOptions: A,
|
|
3446
3468
|
middleware: y
|
|
3447
3469
|
}).then((O) => (C && C(O), O)).catch((O) => {
|
|
3448
3470
|
throw C && C(O), O;
|
|
@@ -3450,38 +3472,38 @@ class En {
|
|
|
3450
3472
|
};
|
|
3451
3473
|
}
|
|
3452
3474
|
async request(t, ...n) {
|
|
3453
|
-
const [r, i] = n, s = dn(t, r, i), { headers: o, fetch: c = te, method:
|
|
3475
|
+
const [r, i] = n, s = dn(t, r, i), { headers: o, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
|
|
3454
3476
|
s.signal !== void 0 && (y.signal = s.signal);
|
|
3455
|
-
const { query:
|
|
3477
|
+
const { query: A, operationName: g } = le(s.document);
|
|
3456
3478
|
return de({
|
|
3457
3479
|
url: C,
|
|
3458
|
-
query:
|
|
3480
|
+
query: A,
|
|
3459
3481
|
variables: s.variables,
|
|
3460
3482
|
headers: {
|
|
3461
|
-
...U(
|
|
3483
|
+
...U(pe(o)),
|
|
3462
3484
|
...U(s.requestHeaders)
|
|
3463
3485
|
},
|
|
3464
3486
|
operationName: g,
|
|
3465
3487
|
fetch: c,
|
|
3466
|
-
method:
|
|
3488
|
+
method: p,
|
|
3467
3489
|
fetchOptions: y,
|
|
3468
|
-
middleware:
|
|
3469
|
-
}).then((
|
|
3470
|
-
throw m && m(
|
|
3490
|
+
middleware: h
|
|
3491
|
+
}).then((I) => (m && m(I), I.data)).catch((I) => {
|
|
3492
|
+
throw m && m(I), I;
|
|
3471
3493
|
});
|
|
3472
3494
|
}
|
|
3473
3495
|
// prettier-ignore
|
|
3474
3496
|
batchRequests(t, n) {
|
|
3475
|
-
const r =
|
|
3497
|
+
const r = hn(t, n), { headers: i, ...s } = this.requestConfig;
|
|
3476
3498
|
r.signal !== void 0 && (s.signal = r.signal);
|
|
3477
|
-
const o = r.documents.map(({ document:
|
|
3499
|
+
const o = r.documents.map(({ document: p }) => le(p).query), c = r.documents.map(({ variables: p }) => p);
|
|
3478
3500
|
return de({
|
|
3479
3501
|
url: this.url,
|
|
3480
3502
|
query: o,
|
|
3481
3503
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
3482
3504
|
variables: c,
|
|
3483
3505
|
headers: {
|
|
3484
|
-
...U(
|
|
3506
|
+
...U(pe(i)),
|
|
3485
3507
|
...U(r.requestHeaders)
|
|
3486
3508
|
},
|
|
3487
3509
|
operationName: void 0,
|
|
@@ -3489,8 +3511,8 @@ class En {
|
|
|
3489
3511
|
method: this.requestConfig.method || "POST",
|
|
3490
3512
|
fetchOptions: s,
|
|
3491
3513
|
middleware: this.requestConfig.requestMiddleware
|
|
3492
|
-
}).then((
|
|
3493
|
-
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(
|
|
3514
|
+
}).then((p) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p.data)).catch((p) => {
|
|
3515
|
+
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p;
|
|
3494
3516
|
});
|
|
3495
3517
|
}
|
|
3496
3518
|
setHeaders(t) {
|
|
@@ -3511,8 +3533,8 @@ class En {
|
|
|
3511
3533
|
}
|
|
3512
3534
|
}
|
|
3513
3535
|
const de = async (e) => {
|
|
3514
|
-
const { query: t, variables: n, fetchOptions: r } = e, i = Cn(cn(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await
|
|
3515
|
-
if (o.ok &&
|
|
3536
|
+
const { query: t, variables: n, fetchOptions: r } = e, i = Cn(cn(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await Tn(o, r.jsonSerializer ?? ve), p = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
|
|
3537
|
+
if (o.ok && h && p) {
|
|
3516
3538
|
const { errors: m, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
|
|
3517
3539
|
return {
|
|
3518
3540
|
...s ? { data: C } : C,
|
|
@@ -3535,18 +3557,18 @@ const de = async (e) => {
|
|
|
3535
3557
|
return i.stringify({ query: e, variables: t, operationName: n });
|
|
3536
3558
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3537
3559
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3538
|
-
const s = e.reduce((o, c,
|
|
3560
|
+
const s = e.reduce((o, c, p) => (o.push({ query: c, variables: t ? t[p] : void 0 }), o), []);
|
|
3539
3561
|
return i.stringify(s);
|
|
3540
|
-
},
|
|
3562
|
+
}, Tn = async (e, t) => {
|
|
3541
3563
|
let n;
|
|
3542
3564
|
return e.headers.forEach((r, i) => {
|
|
3543
3565
|
i.toLowerCase() === "content-type" && (n = r);
|
|
3544
3566
|
}), 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();
|
|
3545
|
-
},
|
|
3546
|
-
var
|
|
3547
|
-
class
|
|
3567
|
+
}, pe = (e) => typeof e == "function" ? e() : e;
|
|
3568
|
+
var An = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(An || {}), In = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(In || {});
|
|
3569
|
+
class Nn {
|
|
3548
3570
|
constructor(t) {
|
|
3549
|
-
|
|
3571
|
+
Te(this, "api");
|
|
3550
3572
|
this.api = un(
|
|
3551
3573
|
new En(`${t}/apps/sq-api`, {
|
|
3552
3574
|
headers: {
|
|
@@ -3640,47 +3662,55 @@ class In {
|
|
|
3640
3662
|
})).purchasingCustomerMetafield ?? null;
|
|
3641
3663
|
}
|
|
3642
3664
|
/**
|
|
3643
|
-
* getPoints
|
|
3644
|
-
* 存在しない場合は0を返します。
|
|
3665
|
+
* getPoints は、Points は SDK から取得できるポイントの情報を返します。
|
|
3645
3666
|
*/
|
|
3646
3667
|
async getPoints() {
|
|
3647
3668
|
const t = await this.api.GetPoints();
|
|
3648
3669
|
return t.purchasingCustomer ? {
|
|
3649
3670
|
pointsApproved: t.purchasingCustomer.pointsApproved,
|
|
3650
|
-
pointsPending: t.purchasingCustomer.pointsPending
|
|
3671
|
+
pointsPending: t.purchasingCustomer.pointsPending,
|
|
3672
|
+
pointsExpiringSoon: t.purchasingCustomer.pointsExpiringSoon ? {
|
|
3673
|
+
points: t.purchasingCustomer.pointsExpiringSoon.points,
|
|
3674
|
+
expiresDate: new Date(t.purchasingCustomer.pointsExpiringSoon.expiresDate),
|
|
3675
|
+
availableUntil: new Date(t.purchasingCustomer.pointsExpiringSoon.availableUntil)
|
|
3676
|
+
} : void 0
|
|
3651
3677
|
} : null;
|
|
3652
3678
|
}
|
|
3653
3679
|
/**
|
|
3654
3680
|
* getLocations は ShopifyIntegration に紐づく LocationGroup の Location の一覧を取得します。
|
|
3655
3681
|
*
|
|
3656
|
-
* @param {string} [tag] 取得したいLocationのタグ。
|
|
3657
|
-
* @param {string[]} [provinceCodes] 取得したいLocationの都道府県コード。
|
|
3658
3682
|
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
3659
3683
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3684
|
+
* @param {LocationFilter} [locationFilter] ロケーションのロケーションのフィルタリング条件。
|
|
3660
3685
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3661
3686
|
*/
|
|
3662
|
-
async getLocations(t, n, r, i
|
|
3663
|
-
const
|
|
3687
|
+
async getLocations(t, n, r, i) {
|
|
3688
|
+
const s = await this.api.GetLocations({
|
|
3689
|
+
first: t,
|
|
3690
|
+
after: n,
|
|
3691
|
+
filter: r,
|
|
3692
|
+
isReverse: i
|
|
3693
|
+
});
|
|
3664
3694
|
return {
|
|
3665
|
-
nodes:
|
|
3666
|
-
id:
|
|
3667
|
-
name:
|
|
3668
|
-
phone:
|
|
3669
|
-
mapURL:
|
|
3670
|
-
tags:
|
|
3671
|
-
address:
|
|
3672
|
-
id:
|
|
3673
|
-
countryCode:
|
|
3674
|
-
country:
|
|
3675
|
-
postalCode:
|
|
3676
|
-
provinceCode:
|
|
3677
|
-
province:
|
|
3678
|
-
city:
|
|
3679
|
-
address1:
|
|
3680
|
-
address2:
|
|
3695
|
+
nodes: s.locations.nodes.map((o) => ({
|
|
3696
|
+
id: o.id,
|
|
3697
|
+
name: o.name,
|
|
3698
|
+
phone: o.phone,
|
|
3699
|
+
mapURL: o.mapURL,
|
|
3700
|
+
tags: o.tags,
|
|
3701
|
+
address: o.address ? {
|
|
3702
|
+
id: o.address.id,
|
|
3703
|
+
countryCode: o.address.countryCode,
|
|
3704
|
+
country: o.address.country,
|
|
3705
|
+
postalCode: o.address.postalCode,
|
|
3706
|
+
provinceCode: o.address.provinceCode,
|
|
3707
|
+
province: o.address.province,
|
|
3708
|
+
city: o.address.city,
|
|
3709
|
+
address1: o.address.address1,
|
|
3710
|
+
address2: o.address.address2
|
|
3681
3711
|
} : void 0
|
|
3682
3712
|
})) ?? [],
|
|
3683
|
-
pageInfo:
|
|
3713
|
+
pageInfo: s.locations.pageInfo ?? null
|
|
3684
3714
|
};
|
|
3685
3715
|
}
|
|
3686
3716
|
/**
|
|
@@ -3895,7 +3925,9 @@ class In {
|
|
|
3895
3925
|
return t.pointCampaignOrderRuleTargetCustomerRank ? {
|
|
3896
3926
|
pointCampaignOrderRule: {
|
|
3897
3927
|
id: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.id,
|
|
3898
|
-
title: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.title
|
|
3928
|
+
title: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.title,
|
|
3929
|
+
targetType: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.targetType,
|
|
3930
|
+
pointMethod: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.pointMethod
|
|
3899
3931
|
},
|
|
3900
3932
|
multiplier: t.pointCampaignOrderRuleTargetCustomerRank.multiplier ? t.pointCampaignOrderRuleTargetCustomerRank.multiplier : void 0,
|
|
3901
3933
|
fixedPoint: t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint ? t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint : void 0
|
|
@@ -3910,7 +3942,17 @@ class In {
|
|
|
3910
3942
|
}
|
|
3911
3943
|
});
|
|
3912
3944
|
return i.estimatedShopifyCartPoint ? {
|
|
3913
|
-
|
|
3945
|
+
pointsEarning: i.estimatedShopifyCartPoint.pointsEarning,
|
|
3946
|
+
totalPointsEarning: i.estimatedShopifyCartPoint.totalPointsEarning,
|
|
3947
|
+
pointCampaign: i.estimatedShopifyCartPoint.pointCampaign ? {
|
|
3948
|
+
pointsEarning: i.estimatedShopifyCartPoint.pointCampaign.pointsEarning,
|
|
3949
|
+
pointCampaignOrderRule: {
|
|
3950
|
+
id: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,
|
|
3951
|
+
title: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,
|
|
3952
|
+
pointMethod: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
|
|
3953
|
+
targetType: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType
|
|
3954
|
+
}
|
|
3955
|
+
} : void 0
|
|
3914
3956
|
} : null;
|
|
3915
3957
|
}
|
|
3916
3958
|
async getEstimatedShopifyCartLineItemPoint(t, n, r, i, s) {
|
|
@@ -3924,7 +3966,17 @@ class In {
|
|
|
3924
3966
|
}
|
|
3925
3967
|
});
|
|
3926
3968
|
return o.estimatedShopifyCartLineItemPoint ? {
|
|
3927
|
-
|
|
3969
|
+
pointsEarning: o.estimatedShopifyCartLineItemPoint.pointsEarning,
|
|
3970
|
+
totalPointsEarning: o.estimatedShopifyCartLineItemPoint.totalPointsEarning,
|
|
3971
|
+
pointCampaign: o.estimatedShopifyCartLineItemPoint.pointCampaign ? {
|
|
3972
|
+
pointsEarning: o.estimatedShopifyCartLineItemPoint.pointCampaign.pointsEarning,
|
|
3973
|
+
pointCampaignOrderRule: {
|
|
3974
|
+
id: o.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.id,
|
|
3975
|
+
title: o.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.title,
|
|
3976
|
+
pointMethod: o.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
|
|
3977
|
+
targetType: o.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.targetType
|
|
3978
|
+
}
|
|
3979
|
+
} : void 0
|
|
3928
3980
|
} : null;
|
|
3929
3981
|
}
|
|
3930
3982
|
/**
|
|
@@ -3967,6 +4019,7 @@ class In {
|
|
|
3967
4019
|
}
|
|
3968
4020
|
}
|
|
3969
4021
|
export {
|
|
3970
|
-
|
|
3971
|
-
In as
|
|
4022
|
+
An as CurrencyCode,
|
|
4023
|
+
In as LocationType,
|
|
4024
|
+
Nn as SDK
|
|
3972
4025
|
};
|