@builtbystack/sq-shopify-theme-sdk 0.0.29 → 0.0.31
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 +410 -0
- package/dist/sq-shopify-theme-sdk.d.ts +177 -0
- package/dist/sq-shopify-theme-sdk.js +1101 -829
- package/dist/sq-shopify-theme-sdk.umd.js +171 -50
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
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 ve = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
function ze(e, t) {
|
|
5
5
|
for (var n = 0; n < t.length; n++) {
|
|
6
|
-
const
|
|
7
|
-
if (typeof
|
|
8
|
-
for (const
|
|
9
|
-
if (
|
|
10
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
11
|
-
s && Object.defineProperty(e,
|
|
6
|
+
const r = t[n];
|
|
7
|
+
if (typeof r != "string" && !Array.isArray(r)) {
|
|
8
|
+
for (const i in r)
|
|
9
|
+
if (i !== "default" && !(i in e)) {
|
|
10
|
+
const s = Object.getOwnPropertyDescriptor(r, i);
|
|
11
|
+
s && Object.defineProperty(e, i, s.get ? s : {
|
|
12
12
|
enumerable: !0,
|
|
13
|
-
get: () => i
|
|
13
|
+
get: () => r[i]
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -19,15 +19,15 @@ function ze(e, t) {
|
|
|
19
19
|
}
|
|
20
20
|
var ne = function() {
|
|
21
21
|
return ne = Object.assign || function(t) {
|
|
22
|
-
for (var n,
|
|
23
|
-
n = arguments[
|
|
22
|
+
for (var n, r = 1, i = arguments.length; r < i; r++) {
|
|
23
|
+
n = arguments[r];
|
|
24
24
|
for (var s in n)
|
|
25
25
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
26
26
|
}
|
|
27
27
|
return t;
|
|
28
28
|
}, ne.apply(this, arguments);
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function Z(e, t) {
|
|
31
31
|
if (!!!e)
|
|
32
32
|
throw new Error(t);
|
|
33
33
|
}
|
|
@@ -42,51 +42,51 @@ function Qe(e, t) {
|
|
|
42
42
|
}
|
|
43
43
|
const Xe = /\r\n|[\n\r]/g;
|
|
44
44
|
function he(e, t) {
|
|
45
|
-
let n = 0,
|
|
46
|
-
for (const
|
|
47
|
-
if (typeof
|
|
45
|
+
let n = 0, r = 1;
|
|
46
|
+
for (const i of e.body.matchAll(Xe)) {
|
|
47
|
+
if (typeof i.index == "number" || Qe(!1), i.index >= t)
|
|
48
48
|
break;
|
|
49
|
-
n =
|
|
49
|
+
n = i.index + i[0].length, r += 1;
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
|
-
line:
|
|
52
|
+
line: r,
|
|
53
53
|
column: t + 1 - n
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Ke(e) {
|
|
57
57
|
return Pe(
|
|
58
58
|
e.source,
|
|
59
59
|
he(e.source, e.start)
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
function Pe(e, t) {
|
|
63
|
-
const n = e.locationOffset.column - 1,
|
|
64
|
-
`,
|
|
63
|
+
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${a}:${p}
|
|
64
|
+
`, f = r.split(/\r\n|[\n\r]/g), y = f[i];
|
|
65
65
|
if (y.length > 120) {
|
|
66
|
-
const C = Math.floor(p / 80),
|
|
67
|
-
for (let
|
|
68
|
-
g.push(y.slice(
|
|
69
|
-
return h +
|
|
66
|
+
const C = Math.floor(p / 80), I = p % 80, g = [];
|
|
67
|
+
for (let T = 0; T < y.length; T += 80)
|
|
68
|
+
g.push(y.slice(T, T + 80));
|
|
69
|
+
return h + Ie([
|
|
70
70
|
[`${a} |`, g[0]],
|
|
71
|
-
...g.slice(1, C + 1).map((
|
|
72
|
-
["|", "^".padStart(
|
|
71
|
+
...g.slice(1, C + 1).map((T) => ["|", T]),
|
|
72
|
+
["|", "^".padStart(I)],
|
|
73
73
|
["|", g[C + 1]]
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
|
-
return h +
|
|
76
|
+
return h + Ie([
|
|
77
77
|
// Lines specified like this: ["prefix", "string"],
|
|
78
|
-
[`${a - 1} |`,
|
|
78
|
+
[`${a - 1} |`, f[i - 1]],
|
|
79
79
|
[`${a} |`, y],
|
|
80
80
|
["|", "^".padStart(p)],
|
|
81
|
-
[`${a + 1} |`,
|
|
81
|
+
[`${a + 1} |`, f[i + 1]]
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const t = e.filter(([
|
|
86
|
-
return t.map(([
|
|
84
|
+
function Ie(e) {
|
|
85
|
+
const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
|
|
86
|
+
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
87
87
|
`);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function Ze(e) {
|
|
90
90
|
const t = e[0];
|
|
91
91
|
return t == null || "kind" in t || "length" in t ? {
|
|
92
92
|
nodes: t,
|
|
@@ -137,19 +137,19 @@ class Ce extends Error {
|
|
|
137
137
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
138
138
|
*/
|
|
139
139
|
constructor(t, ...n) {
|
|
140
|
-
var
|
|
141
|
-
const { nodes: a, source: c, positions: p, path: h, originalError:
|
|
142
|
-
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError =
|
|
140
|
+
var r, i, s;
|
|
141
|
+
const { nodes: a, source: c, positions: p, path: h, originalError: f, extensions: y } = Ze(n);
|
|
142
|
+
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = f ?? void 0, this.nodes = Te(
|
|
143
143
|
Array.isArray(a) ? a : a ? [a] : void 0
|
|
144
144
|
);
|
|
145
|
-
const C =
|
|
146
|
-
(
|
|
145
|
+
const C = Te(
|
|
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 || (
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
) ?
|
|
152
|
-
this.extensions = (s = y ??
|
|
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 I = Je(
|
|
150
|
+
f == null ? void 0 : f.extensions
|
|
151
|
+
) ? f == null ? void 0 : f.extensions : void 0;
|
|
152
|
+
this.extensions = (s = y ?? I) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
153
153
|
message: {
|
|
154
154
|
writable: !0,
|
|
155
155
|
enumerable: !0
|
|
@@ -169,8 +169,8 @@ class Ce extends Error {
|
|
|
169
169
|
originalError: {
|
|
170
170
|
enumerable: !1
|
|
171
171
|
}
|
|
172
|
-
}),
|
|
173
|
-
value:
|
|
172
|
+
}), f != null && f.stack ? Object.defineProperty(this, "stack", {
|
|
173
|
+
value: f.stack,
|
|
174
174
|
writable: !0,
|
|
175
175
|
configurable: !0
|
|
176
176
|
}) : Error.captureStackTrace ? Error.captureStackTrace(this, Ce) : Object.defineProperty(this, "stack", {
|
|
@@ -188,7 +188,7 @@ class Ce extends Error {
|
|
|
188
188
|
for (const n of this.nodes)
|
|
189
189
|
n.loc && (t += `
|
|
190
190
|
|
|
191
|
-
` +
|
|
191
|
+
` + Ke(n.loc));
|
|
192
192
|
else if (this.source && this.locations)
|
|
193
193
|
for (const n of this.locations)
|
|
194
194
|
t += `
|
|
@@ -203,7 +203,7 @@ 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 Te(e) {
|
|
207
207
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
208
208
|
}
|
|
209
209
|
function R(e, t, n) {
|
|
@@ -212,7 +212,7 @@ function R(e, t, n) {
|
|
|
212
212
|
positions: [t]
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
|
-
class
|
|
215
|
+
class We {
|
|
216
216
|
/**
|
|
217
217
|
* The character offset at which this Node begins.
|
|
218
218
|
*/
|
|
@@ -228,8 +228,8 @@ class Ze {
|
|
|
228
228
|
/**
|
|
229
229
|
* The Source document the AST represents.
|
|
230
230
|
*/
|
|
231
|
-
constructor(t, n,
|
|
232
|
-
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source =
|
|
231
|
+
constructor(t, n, r) {
|
|
232
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
|
|
233
233
|
}
|
|
234
234
|
get [Symbol.toStringTag]() {
|
|
235
235
|
return "Location";
|
|
@@ -241,7 +241,7 @@ class Ze {
|
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class De {
|
|
245
245
|
/**
|
|
246
246
|
* The kind of Token.
|
|
247
247
|
*/
|
|
@@ -268,8 +268,8 @@ class be {
|
|
|
268
268
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
269
269
|
* the last.
|
|
270
270
|
*/
|
|
271
|
-
constructor(t, n,
|
|
272
|
-
this.kind = t, this.start = n, this.end =
|
|
271
|
+
constructor(t, n, r, i, s, a) {
|
|
272
|
+
this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = a, this.prev = null, this.next = null;
|
|
273
273
|
}
|
|
274
274
|
get [Symbol.toStringTag]() {
|
|
275
275
|
return "Token";
|
|
@@ -283,7 +283,7 @@ class be {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const be = {
|
|
287
287
|
Name: [],
|
|
288
288
|
Document: ["definitions"],
|
|
289
289
|
OperationDefinition: [
|
|
@@ -357,24 +357,24 @@ const De = {
|
|
|
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(be));
|
|
361
|
+
function xe(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 q;
|
|
366
366
|
(function(e) {
|
|
367
367
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
368
|
-
})(
|
|
369
|
-
var
|
|
368
|
+
})(q || (q = {}));
|
|
369
|
+
var me;
|
|
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";
|
|
372
|
-
})(
|
|
373
|
-
var
|
|
372
|
+
})(me || (me = {}));
|
|
373
|
+
var m;
|
|
374
374
|
(function(e) {
|
|
375
375
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
376
|
-
})(
|
|
377
|
-
function
|
|
376
|
+
})(m || (m = {}));
|
|
377
|
+
function fe(e) {
|
|
378
378
|
return e === 9 || e === 32;
|
|
379
379
|
}
|
|
380
380
|
function Y(e) {
|
|
@@ -392,30 +392,30 @@ function tt(e) {
|
|
|
392
392
|
}
|
|
393
393
|
function nt(e) {
|
|
394
394
|
var t;
|
|
395
|
-
let n = Number.MAX_SAFE_INTEGER,
|
|
395
|
+
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
396
396
|
for (let a = 0; a < e.length; ++a) {
|
|
397
397
|
var s;
|
|
398
|
-
const c = e[a], p =
|
|
399
|
-
p !== c.length && (
|
|
398
|
+
const c = e[a], p = it(c);
|
|
399
|
+
p !== c.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && p < n && (n = p));
|
|
400
400
|
}
|
|
401
401
|
return e.map((a, c) => c === 0 ? a : a.slice(n)).slice(
|
|
402
|
-
(t =
|
|
403
|
-
|
|
402
|
+
(t = r) !== null && t !== void 0 ? t : 0,
|
|
403
|
+
i + 1
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function it(e) {
|
|
407
407
|
let t = 0;
|
|
408
|
-
for (; t < e.length &&
|
|
408
|
+
for (; t < e.length && fe(e.charCodeAt(t)); )
|
|
409
409
|
++t;
|
|
410
410
|
return t;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
const n = e.replace(/"""/g, '\\"""'),
|
|
414
|
-
(!
|
|
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((I) => I.length === 0 || fe(I.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, p = e.endsWith("\\"), h = c || p, f = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
414
|
+
(!i || e.length > 70 || h || s || a);
|
|
415
415
|
let y = "";
|
|
416
|
-
const C =
|
|
417
|
-
return (
|
|
418
|
-
`), y += n, (
|
|
416
|
+
const C = i && fe(e.charCodeAt(0));
|
|
417
|
+
return (f && !C || s) && (y += `
|
|
418
|
+
`), y += n, (f || h) && (y += `
|
|
419
419
|
`), '"""' + y + '"""';
|
|
420
420
|
}
|
|
421
421
|
var u;
|
|
@@ -436,7 +436,7 @@ class st {
|
|
|
436
436
|
* The character offset at which the current line begins.
|
|
437
437
|
*/
|
|
438
438
|
constructor(t) {
|
|
439
|
-
const n = new
|
|
439
|
+
const n = new De(u.SOF, 0, 0, 0, 0);
|
|
440
440
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
441
441
|
}
|
|
442
442
|
get [Symbol.toStringTag]() {
|
|
@@ -486,91 +486,91 @@ function F(e, t) {
|
|
|
486
486
|
if (n === void 0)
|
|
487
487
|
return u.EOF;
|
|
488
488
|
if (n >= 32 && n <= 126) {
|
|
489
|
-
const
|
|
490
|
-
return
|
|
489
|
+
const r = String.fromCodePoint(n);
|
|
490
|
+
return r === '"' ? `'"'` : `"${r}"`;
|
|
491
491
|
}
|
|
492
492
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
493
493
|
}
|
|
494
|
-
function S(e, t, n,
|
|
494
|
+
function S(e, t, n, r, i) {
|
|
495
495
|
const s = e.line, a = 1 + n - e.lineStart;
|
|
496
|
-
return new
|
|
496
|
+
return new De(t, n, r, s, a, i);
|
|
497
497
|
}
|
|
498
498
|
function ot(e, t) {
|
|
499
|
-
const n = e.source.body,
|
|
500
|
-
let
|
|
501
|
-
for (;
|
|
502
|
-
const s = n.charCodeAt(
|
|
499
|
+
const n = e.source.body, r = n.length;
|
|
500
|
+
let i = t;
|
|
501
|
+
for (; i < r; ) {
|
|
502
|
+
const s = n.charCodeAt(i);
|
|
503
503
|
switch (s) {
|
|
504
504
|
case 65279:
|
|
505
505
|
case 9:
|
|
506
506
|
case 32:
|
|
507
507
|
case 44:
|
|
508
|
-
++
|
|
508
|
+
++i;
|
|
509
509
|
continue;
|
|
510
510
|
case 10:
|
|
511
|
-
++
|
|
511
|
+
++i, ++e.line, e.lineStart = i;
|
|
512
512
|
continue;
|
|
513
513
|
case 13:
|
|
514
|
-
n.charCodeAt(
|
|
514
|
+
n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
|
|
515
515
|
continue;
|
|
516
516
|
case 35:
|
|
517
|
-
return ut(e,
|
|
517
|
+
return ut(e, i);
|
|
518
518
|
case 33:
|
|
519
|
-
return S(e, u.BANG,
|
|
519
|
+
return S(e, u.BANG, i, i + 1);
|
|
520
520
|
case 36:
|
|
521
|
-
return S(e, u.DOLLAR,
|
|
521
|
+
return S(e, u.DOLLAR, i, i + 1);
|
|
522
522
|
case 38:
|
|
523
|
-
return S(e, u.AMP,
|
|
523
|
+
return S(e, u.AMP, i, i + 1);
|
|
524
524
|
case 40:
|
|
525
|
-
return S(e, u.PAREN_L,
|
|
525
|
+
return S(e, u.PAREN_L, i, i + 1);
|
|
526
526
|
case 41:
|
|
527
|
-
return S(e, u.PAREN_R,
|
|
527
|
+
return S(e, u.PAREN_R, i, i + 1);
|
|
528
528
|
case 46:
|
|
529
|
-
if (n.charCodeAt(
|
|
530
|
-
return S(e, u.SPREAD,
|
|
529
|
+
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
|
|
530
|
+
return S(e, u.SPREAD, i, i + 3);
|
|
531
531
|
break;
|
|
532
532
|
case 58:
|
|
533
|
-
return S(e, u.COLON,
|
|
533
|
+
return S(e, u.COLON, i, i + 1);
|
|
534
534
|
case 61:
|
|
535
|
-
return S(e, u.EQUALS,
|
|
535
|
+
return S(e, u.EQUALS, i, i + 1);
|
|
536
536
|
case 64:
|
|
537
|
-
return S(e, u.AT,
|
|
537
|
+
return S(e, u.AT, i, i + 1);
|
|
538
538
|
case 91:
|
|
539
|
-
return S(e, u.BRACKET_L,
|
|
539
|
+
return S(e, u.BRACKET_L, i, i + 1);
|
|
540
540
|
case 93:
|
|
541
|
-
return S(e, u.BRACKET_R,
|
|
541
|
+
return S(e, u.BRACKET_R, i, i + 1);
|
|
542
542
|
case 123:
|
|
543
|
-
return S(e, u.BRACE_L,
|
|
543
|
+
return S(e, u.BRACE_L, i, i + 1);
|
|
544
544
|
case 124:
|
|
545
|
-
return S(e, u.PIPE,
|
|
545
|
+
return S(e, u.PIPE, i, i + 1);
|
|
546
546
|
case 125:
|
|
547
|
-
return S(e, u.BRACE_R,
|
|
547
|
+
return S(e, u.BRACE_R, i, i + 1);
|
|
548
548
|
case 34:
|
|
549
|
-
return n.charCodeAt(
|
|
549
|
+
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? mt(e, i) : lt(e, i);
|
|
550
550
|
}
|
|
551
551
|
if (Y(s) || s === 45)
|
|
552
|
-
return ct(e,
|
|
552
|
+
return ct(e, i, s);
|
|
553
553
|
if (_e(s))
|
|
554
|
-
return
|
|
554
|
+
return ft(e, i);
|
|
555
555
|
throw R(
|
|
556
556
|
e.source,
|
|
557
|
-
|
|
558
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n,
|
|
557
|
+
i,
|
|
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 S(e, u.EOF,
|
|
561
|
+
return S(e, u.EOF, r, r);
|
|
562
562
|
}
|
|
563
563
|
function ut(e, t) {
|
|
564
|
-
const n = e.source.body,
|
|
565
|
-
let
|
|
566
|
-
for (;
|
|
567
|
-
const s = n.charCodeAt(
|
|
564
|
+
const n = e.source.body, r = n.length;
|
|
565
|
+
let i = t + 1;
|
|
566
|
+
for (; i < r; ) {
|
|
567
|
+
const s = n.charCodeAt(i);
|
|
568
568
|
if (s === 10 || s === 13)
|
|
569
569
|
break;
|
|
570
570
|
if (G(s))
|
|
571
|
-
++
|
|
572
|
-
else if (se(n,
|
|
573
|
-
|
|
571
|
+
++i;
|
|
572
|
+
else if (se(n, i))
|
|
573
|
+
i += 2;
|
|
574
574
|
else
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
@@ -578,40 +578,40 @@ function ut(e, t) {
|
|
|
578
578
|
e,
|
|
579
579
|
u.COMMENT,
|
|
580
580
|
t,
|
|
581
|
-
|
|
582
|
-
n.slice(t + 1,
|
|
581
|
+
i,
|
|
582
|
+
n.slice(t + 1, i)
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
585
|
function ct(e, t, n) {
|
|
586
|
-
const
|
|
587
|
-
let
|
|
588
|
-
if (s === 45 && (s =
|
|
589
|
-
if (s =
|
|
586
|
+
const r = e.source.body;
|
|
587
|
+
let i = t, s = n, a = !1;
|
|
588
|
+
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
589
|
+
if (s = r.charCodeAt(++i), Y(s))
|
|
590
590
|
throw R(
|
|
591
591
|
e.source,
|
|
592
|
-
|
|
592
|
+
i,
|
|
593
593
|
`Invalid number, unexpected digit after 0: ${F(
|
|
594
594
|
e,
|
|
595
|
-
|
|
595
|
+
i
|
|
596
596
|
)}.`
|
|
597
597
|
);
|
|
598
598
|
} else
|
|
599
|
-
|
|
600
|
-
if (s === 46 && (a = !0, s =
|
|
599
|
+
i = ce(e, i, s), s = r.charCodeAt(i);
|
|
600
|
+
if (s === 46 && (a = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = !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
601
|
throw R(
|
|
602
602
|
e.source,
|
|
603
|
-
|
|
603
|
+
i,
|
|
604
604
|
`Invalid number, expected digit but got: ${F(
|
|
605
605
|
e,
|
|
606
|
-
|
|
606
|
+
i
|
|
607
607
|
)}.`
|
|
608
608
|
);
|
|
609
609
|
return S(
|
|
610
610
|
e,
|
|
611
611
|
a ? u.FLOAT : u.INT,
|
|
612
612
|
t,
|
|
613
|
-
|
|
614
|
-
|
|
613
|
+
i,
|
|
614
|
+
r.slice(t, i)
|
|
615
615
|
);
|
|
616
616
|
}
|
|
617
617
|
function ce(e, t, n) {
|
|
@@ -624,57 +624,57 @@ function ce(e, t, n) {
|
|
|
624
624
|
t
|
|
625
625
|
)}.`
|
|
626
626
|
);
|
|
627
|
-
const
|
|
628
|
-
let
|
|
629
|
-
for (; Y(
|
|
630
|
-
++
|
|
631
|
-
return
|
|
627
|
+
const r = e.source.body;
|
|
628
|
+
let i = t + 1;
|
|
629
|
+
for (; Y(r.charCodeAt(i)); )
|
|
630
|
+
++i;
|
|
631
|
+
return i;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
const n = e.source.body,
|
|
635
|
-
let
|
|
636
|
-
for (;
|
|
637
|
-
const c = n.charCodeAt(
|
|
633
|
+
function lt(e, t) {
|
|
634
|
+
const n = e.source.body, r = n.length;
|
|
635
|
+
let i = t + 1, s = i, a = "";
|
|
636
|
+
for (; i < r; ) {
|
|
637
|
+
const c = n.charCodeAt(i);
|
|
638
638
|
if (c === 34)
|
|
639
|
-
return a += n.slice(s,
|
|
639
|
+
return a += n.slice(s, i), S(e, u.STRING, t, i + 1, a);
|
|
640
640
|
if (c === 92) {
|
|
641
|
-
a += n.slice(s,
|
|
642
|
-
const p = n.charCodeAt(
|
|
643
|
-
a += p.value,
|
|
641
|
+
a += n.slice(s, i);
|
|
642
|
+
const p = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : pt(e, i) : ht(e, i);
|
|
643
|
+
a += p.value, i += p.size, s = i;
|
|
644
644
|
continue;
|
|
645
645
|
}
|
|
646
646
|
if (c === 10 || c === 13)
|
|
647
647
|
break;
|
|
648
648
|
if (G(c))
|
|
649
|
-
++
|
|
650
|
-
else if (se(n,
|
|
651
|
-
|
|
649
|
+
++i;
|
|
650
|
+
else if (se(n, i))
|
|
651
|
+
i += 2;
|
|
652
652
|
else
|
|
653
653
|
throw R(
|
|
654
654
|
e.source,
|
|
655
|
-
|
|
655
|
+
i,
|
|
656
656
|
`Invalid character within String: ${F(
|
|
657
657
|
e,
|
|
658
|
-
|
|
658
|
+
i
|
|
659
659
|
)}.`
|
|
660
660
|
);
|
|
661
661
|
}
|
|
662
|
-
throw R(e.source,
|
|
662
|
+
throw R(e.source, i, "Unterminated string.");
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function dt(e, t) {
|
|
665
665
|
const n = e.source.body;
|
|
666
|
-
let
|
|
667
|
-
for (;
|
|
668
|
-
const s = n.charCodeAt(t +
|
|
666
|
+
let r = 0, i = 3;
|
|
667
|
+
for (; i < 12; ) {
|
|
668
|
+
const s = n.charCodeAt(t + i++);
|
|
669
669
|
if (s === 125) {
|
|
670
|
-
if (
|
|
670
|
+
if (i < 5 || !G(r))
|
|
671
671
|
break;
|
|
672
672
|
return {
|
|
673
|
-
value: String.fromCodePoint(
|
|
674
|
-
size:
|
|
673
|
+
value: String.fromCodePoint(r),
|
|
674
|
+
size: i
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
if (
|
|
677
|
+
if (r = r << 4 | j(s), r < 0)
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
throw R(
|
|
@@ -682,22 +682,22 @@ function lt(e, t) {
|
|
|
682
682
|
t,
|
|
683
683
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
684
684
|
t,
|
|
685
|
-
t +
|
|
685
|
+
t + i
|
|
686
686
|
)}".`
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
689
|
function pt(e, t) {
|
|
690
|
-
const n = e.source.body,
|
|
691
|
-
if (G(
|
|
690
|
+
const n = e.source.body, r = Se(n, t + 2);
|
|
691
|
+
if (G(r))
|
|
692
692
|
return {
|
|
693
|
-
value: String.fromCodePoint(
|
|
693
|
+
value: String.fromCodePoint(r),
|
|
694
694
|
size: 6
|
|
695
695
|
};
|
|
696
|
-
if (Le(
|
|
697
|
-
const
|
|
698
|
-
if (we(
|
|
696
|
+
if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
697
|
+
const i = Se(n, t + 8);
|
|
698
|
+
if (we(i))
|
|
699
699
|
return {
|
|
700
|
-
value: String.fromCodePoint(
|
|
700
|
+
value: String.fromCodePoint(r, i),
|
|
701
701
|
size: 12
|
|
702
702
|
};
|
|
703
703
|
}
|
|
@@ -707,7 +707,7 @@ function pt(e, t) {
|
|
|
707
707
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
708
708
|
);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Se(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) {
|
|
@@ -767,15 +767,15 @@ function ht(e, t) {
|
|
|
767
767
|
)}".`
|
|
768
768
|
);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
const n = e.source.body,
|
|
772
|
-
let
|
|
770
|
+
function mt(e, t) {
|
|
771
|
+
const n = e.source.body, r = n.length;
|
|
772
|
+
let i = e.lineStart, s = t + 3, a = s, c = "";
|
|
773
773
|
const p = [];
|
|
774
|
-
for (; s <
|
|
774
|
+
for (; s < r; ) {
|
|
775
775
|
const h = n.charCodeAt(s);
|
|
776
776
|
if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
777
777
|
c += n.slice(a, s), p.push(c);
|
|
778
|
-
const
|
|
778
|
+
const f = S(
|
|
779
779
|
e,
|
|
780
780
|
u.BLOCK_STRING,
|
|
781
781
|
t,
|
|
@@ -784,14 +784,14 @@ function ft(e, t) {
|
|
|
784
784
|
nt(p).join(`
|
|
785
785
|
`)
|
|
786
786
|
);
|
|
787
|
-
return e.line += p.length - 1, e.lineStart =
|
|
787
|
+
return e.line += p.length - 1, e.lineStart = i, f;
|
|
788
788
|
}
|
|
789
789
|
if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
790
790
|
c += n.slice(a, s), a = s + 1, s += 4;
|
|
791
791
|
continue;
|
|
792
792
|
}
|
|
793
793
|
if (h === 10 || h === 13) {
|
|
794
|
-
c += n.slice(a, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s,
|
|
794
|
+
c += n.slice(a, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s, i = s;
|
|
795
795
|
continue;
|
|
796
796
|
}
|
|
797
797
|
if (G(h))
|
|
@@ -810,13 +810,13 @@ function ft(e, t) {
|
|
|
810
810
|
}
|
|
811
811
|
throw R(e.source, s, "Unterminated string.");
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
const n = e.source.body,
|
|
815
|
-
let
|
|
816
|
-
for (;
|
|
817
|
-
const s = n.charCodeAt(
|
|
813
|
+
function ft(e, t) {
|
|
814
|
+
const n = e.source.body, r = n.length;
|
|
815
|
+
let i = t + 1;
|
|
816
|
+
for (; i < r; ) {
|
|
817
|
+
const s = n.charCodeAt(i);
|
|
818
818
|
if (tt(s))
|
|
819
|
-
++
|
|
819
|
+
++i;
|
|
820
820
|
else
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
@@ -824,8 +824,8 @@ function mt(e, t) {
|
|
|
824
824
|
e,
|
|
825
825
|
u.NAME,
|
|
826
826
|
t,
|
|
827
|
-
|
|
828
|
-
n.slice(t,
|
|
827
|
+
i,
|
|
828
|
+
n.slice(t, i)
|
|
829
829
|
);
|
|
830
830
|
}
|
|
831
831
|
const gt = 10, Fe = 2;
|
|
@@ -851,11 +851,11 @@ function yt(e, t) {
|
|
|
851
851
|
return "[Circular]";
|
|
852
852
|
const n = [...t, e];
|
|
853
853
|
if (Ct(e)) {
|
|
854
|
-
const
|
|
855
|
-
if (
|
|
856
|
-
return typeof
|
|
854
|
+
const r = e.toJSON();
|
|
855
|
+
if (r !== e)
|
|
856
|
+
return typeof r == "string" ? r : ae(r, n);
|
|
857
857
|
} else if (Array.isArray(e))
|
|
858
|
-
return
|
|
858
|
+
return At(e, n);
|
|
859
859
|
return Et(e, n);
|
|
860
860
|
}
|
|
861
861
|
function Ct(e) {
|
|
@@ -863,21 +863,21 @@ 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 ? "[" +
|
|
867
|
-
([
|
|
866
|
+
return n.length === 0 ? "{}" : t.length > Fe ? "[" + vt(e) + "]" : "{ " + n.map(
|
|
867
|
+
([i, s]) => i + ": " + ae(s, t)
|
|
868
868
|
).join(", ") + " }";
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function At(e, t) {
|
|
871
871
|
if (e.length === 0)
|
|
872
872
|
return "[]";
|
|
873
873
|
if (t.length > Fe)
|
|
874
874
|
return "[Array]";
|
|
875
|
-
const n = Math.min(gt, e.length),
|
|
875
|
+
const n = Math.min(gt, e.length), r = e.length - n, i = [];
|
|
876
876
|
for (let s = 0; s < n; ++s)
|
|
877
|
-
|
|
878
|
-
return
|
|
877
|
+
i.push(ae(e[s], t));
|
|
878
|
+
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function vt(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 Tt(e) {
|
|
|
886
886
|
}
|
|
887
887
|
return t;
|
|
888
888
|
}
|
|
889
|
-
const
|
|
889
|
+
const It = (
|
|
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) {
|
|
@@ -895,14 +895,14 @@ const At = (
|
|
|
895
895
|
if (t instanceof n)
|
|
896
896
|
return !0;
|
|
897
897
|
if (typeof t == "object" && t !== null) {
|
|
898
|
-
var
|
|
899
|
-
const
|
|
898
|
+
var r;
|
|
899
|
+
const i = n.prototype[Symbol.toStringTag], s = (
|
|
900
900
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
901
|
-
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (
|
|
901
|
+
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
|
|
902
902
|
);
|
|
903
|
-
if (
|
|
903
|
+
if (i === s) {
|
|
904
904
|
const a = Ee(t);
|
|
905
|
-
throw new Error(`Cannot use ${
|
|
905
|
+
throw new Error(`Cannot use ${i} "${a}" from another module or realm.
|
|
906
906
|
|
|
907
907
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
908
908
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -919,15 +919,15 @@ spurious results.`);
|
|
|
919
919
|
return !1;
|
|
920
920
|
}
|
|
921
921
|
);
|
|
922
|
-
class
|
|
923
|
-
constructor(t, n = "GraphQL request",
|
|
922
|
+
class Me {
|
|
923
|
+
constructor(t, n = "GraphQL request", r = {
|
|
924
924
|
line: 1,
|
|
925
925
|
column: 1
|
|
926
926
|
}) {
|
|
927
|
-
typeof t == "string" ||
|
|
927
|
+
typeof t == "string" || Z(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || Z(
|
|
928
928
|
!1,
|
|
929
929
|
"line in locationOffset is 1-indexed and must be positive."
|
|
930
|
-
), this.locationOffset.column > 0 ||
|
|
930
|
+
), this.locationOffset.column > 0 || Z(
|
|
931
931
|
!1,
|
|
932
932
|
"column in locationOffset is 1-indexed and must be positive."
|
|
933
933
|
);
|
|
@@ -936,16 +936,16 @@ class Be {
|
|
|
936
936
|
return "Source";
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
939
|
+
function Tt(e) {
|
|
940
|
+
return It(e, Me);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
return new
|
|
942
|
+
function Be(e, t) {
|
|
943
|
+
return new xt(e, t).parseDocument();
|
|
944
944
|
}
|
|
945
|
-
class
|
|
945
|
+
class xt {
|
|
946
946
|
constructor(t, n = {}) {
|
|
947
|
-
const
|
|
948
|
-
this._lexer = new st(
|
|
947
|
+
const r = Tt(t) ? t : new Me(t);
|
|
948
|
+
this._lexer = new st(r), this._options = n, this._tokenCounter = 0;
|
|
949
949
|
}
|
|
950
950
|
/**
|
|
951
951
|
* Converts a name lex token into a name parse node.
|
|
@@ -953,7 +953,7 @@ class St {
|
|
|
953
953
|
parseName() {
|
|
954
954
|
const t = this.expectToken(u.NAME);
|
|
955
955
|
return this.node(t, {
|
|
956
|
-
kind:
|
|
956
|
+
kind: m.NAME,
|
|
957
957
|
value: t.value
|
|
958
958
|
});
|
|
959
959
|
}
|
|
@@ -963,7 +963,7 @@ class St {
|
|
|
963
963
|
*/
|
|
964
964
|
parseDocument() {
|
|
965
965
|
return this.node(this._lexer.token, {
|
|
966
|
-
kind:
|
|
966
|
+
kind: m.DOCUMENT,
|
|
967
967
|
definitions: this.many(
|
|
968
968
|
u.SOF,
|
|
969
969
|
this.parseDefinition,
|
|
@@ -1046,19 +1046,19 @@ class St {
|
|
|
1046
1046
|
const t = this._lexer.token;
|
|
1047
1047
|
if (this.peek(u.BRACE_L))
|
|
1048
1048
|
return this.node(t, {
|
|
1049
|
-
kind:
|
|
1050
|
-
operation:
|
|
1049
|
+
kind: m.OPERATION_DEFINITION,
|
|
1050
|
+
operation: q.QUERY,
|
|
1051
1051
|
name: void 0,
|
|
1052
1052
|
variableDefinitions: [],
|
|
1053
1053
|
directives: [],
|
|
1054
1054
|
selectionSet: this.parseSelectionSet()
|
|
1055
1055
|
});
|
|
1056
1056
|
const n = this.parseOperationType();
|
|
1057
|
-
let
|
|
1058
|
-
return this.peek(u.NAME) && (
|
|
1059
|
-
kind:
|
|
1057
|
+
let r;
|
|
1058
|
+
return this.peek(u.NAME) && (r = this.parseName()), this.node(t, {
|
|
1059
|
+
kind: m.OPERATION_DEFINITION,
|
|
1060
1060
|
operation: n,
|
|
1061
|
-
name:
|
|
1061
|
+
name: r,
|
|
1062
1062
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1063
1063
|
directives: this.parseDirectives(!1),
|
|
1064
1064
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1071,11 +1071,11 @@ class St {
|
|
|
1071
1071
|
const t = this.expectToken(u.NAME);
|
|
1072
1072
|
switch (t.value) {
|
|
1073
1073
|
case "query":
|
|
1074
|
-
return
|
|
1074
|
+
return q.QUERY;
|
|
1075
1075
|
case "mutation":
|
|
1076
|
-
return
|
|
1076
|
+
return q.MUTATION;
|
|
1077
1077
|
case "subscription":
|
|
1078
|
-
return
|
|
1078
|
+
return q.SUBSCRIPTION;
|
|
1079
1079
|
}
|
|
1080
1080
|
throw this.unexpected(t);
|
|
1081
1081
|
}
|
|
@@ -1094,7 +1094,7 @@ class St {
|
|
|
1094
1094
|
*/
|
|
1095
1095
|
parseVariableDefinition() {
|
|
1096
1096
|
return this.node(this._lexer.token, {
|
|
1097
|
-
kind:
|
|
1097
|
+
kind: m.VARIABLE_DEFINITION,
|
|
1098
1098
|
variable: this.parseVariable(),
|
|
1099
1099
|
type: (this.expectToken(u.COLON), this.parseTypeReference()),
|
|
1100
1100
|
defaultValue: this.expectOptionalToken(u.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
@@ -1107,7 +1107,7 @@ class St {
|
|
|
1107
1107
|
parseVariable() {
|
|
1108
1108
|
const t = this._lexer.token;
|
|
1109
1109
|
return this.expectToken(u.DOLLAR), this.node(t, {
|
|
1110
|
-
kind:
|
|
1110
|
+
kind: m.VARIABLE,
|
|
1111
1111
|
name: this.parseName()
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
@@ -1118,7 +1118,7 @@ class St {
|
|
|
1118
1118
|
*/
|
|
1119
1119
|
parseSelectionSet() {
|
|
1120
1120
|
return this.node(this._lexer.token, {
|
|
1121
|
-
kind:
|
|
1121
|
+
kind: m.SELECTION_SET,
|
|
1122
1122
|
selections: this.many(
|
|
1123
1123
|
u.BRACE_L,
|
|
1124
1124
|
this.parseSelection,
|
|
@@ -1142,11 +1142,11 @@ class St {
|
|
|
1142
1142
|
*/
|
|
1143
1143
|
parseField() {
|
|
1144
1144
|
const t = this._lexer.token, n = this.parseName();
|
|
1145
|
-
let
|
|
1146
|
-
return this.expectOptionalToken(u.COLON) ? (
|
|
1147
|
-
kind:
|
|
1148
|
-
alias:
|
|
1149
|
-
name:
|
|
1145
|
+
let r, i;
|
|
1146
|
+
return this.expectOptionalToken(u.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
|
|
1147
|
+
kind: m.FIELD,
|
|
1148
|
+
alias: r,
|
|
1149
|
+
name: i,
|
|
1150
1150
|
arguments: this.parseArguments(!1),
|
|
1151
1151
|
directives: this.parseDirectives(!1),
|
|
1152
1152
|
selectionSet: this.peek(u.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
@@ -1163,10 +1163,10 @@ class St {
|
|
|
1163
1163
|
* Argument[Const] : Name : Value[?Const]
|
|
1164
1164
|
*/
|
|
1165
1165
|
parseArgument(t = !1) {
|
|
1166
|
-
const n = this._lexer.token,
|
|
1166
|
+
const n = this._lexer.token, r = this.parseName();
|
|
1167
1167
|
return this.expectToken(u.COLON), this.node(n, {
|
|
1168
|
-
kind:
|
|
1169
|
-
name:
|
|
1168
|
+
kind: m.ARGUMENT,
|
|
1169
|
+
name: r,
|
|
1170
1170
|
value: this.parseValueLiteral(t)
|
|
1171
1171
|
});
|
|
1172
1172
|
}
|
|
@@ -1186,11 +1186,11 @@ class St {
|
|
|
1186
1186
|
this.expectToken(u.SPREAD);
|
|
1187
1187
|
const n = this.expectOptionalKeyword("on");
|
|
1188
1188
|
return !n && this.peek(u.NAME) ? this.node(t, {
|
|
1189
|
-
kind:
|
|
1189
|
+
kind: m.FRAGMENT_SPREAD,
|
|
1190
1190
|
name: this.parseFragmentName(),
|
|
1191
1191
|
directives: this.parseDirectives(!1)
|
|
1192
1192
|
}) : this.node(t, {
|
|
1193
|
-
kind:
|
|
1193
|
+
kind: m.INLINE_FRAGMENT,
|
|
1194
1194
|
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1195
1195
|
directives: this.parseDirectives(!1),
|
|
1196
1196
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1205,14 +1205,14 @@ class St {
|
|
|
1205
1205
|
parseFragmentDefinition() {
|
|
1206
1206
|
const t = this._lexer.token;
|
|
1207
1207
|
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
|
|
1208
|
-
kind:
|
|
1208
|
+
kind: m.FRAGMENT_DEFINITION,
|
|
1209
1209
|
name: this.parseFragmentName(),
|
|
1210
1210
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1211
1211
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1212
1212
|
directives: this.parseDirectives(!1),
|
|
1213
1213
|
selectionSet: this.parseSelectionSet()
|
|
1214
1214
|
}) : this.node(t, {
|
|
1215
|
-
kind:
|
|
1215
|
+
kind: m.FRAGMENT_DEFINITION,
|
|
1216
1216
|
name: this.parseFragmentName(),
|
|
1217
1217
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1218
1218
|
directives: this.parseDirectives(!1),
|
|
@@ -1255,12 +1255,12 @@ class St {
|
|
|
1255
1255
|
return this.parseObject(t);
|
|
1256
1256
|
case u.INT:
|
|
1257
1257
|
return this.advanceLexer(), this.node(n, {
|
|
1258
|
-
kind:
|
|
1258
|
+
kind: m.INT,
|
|
1259
1259
|
value: n.value
|
|
1260
1260
|
});
|
|
1261
1261
|
case u.FLOAT:
|
|
1262
1262
|
return this.advanceLexer(), this.node(n, {
|
|
1263
|
-
kind:
|
|
1263
|
+
kind: m.FLOAT,
|
|
1264
1264
|
value: n.value
|
|
1265
1265
|
});
|
|
1266
1266
|
case u.STRING:
|
|
@@ -1270,32 +1270,32 @@ class St {
|
|
|
1270
1270
|
switch (this.advanceLexer(), n.value) {
|
|
1271
1271
|
case "true":
|
|
1272
1272
|
return this.node(n, {
|
|
1273
|
-
kind:
|
|
1273
|
+
kind: m.BOOLEAN,
|
|
1274
1274
|
value: !0
|
|
1275
1275
|
});
|
|
1276
1276
|
case "false":
|
|
1277
1277
|
return this.node(n, {
|
|
1278
|
-
kind:
|
|
1278
|
+
kind: m.BOOLEAN,
|
|
1279
1279
|
value: !1
|
|
1280
1280
|
});
|
|
1281
1281
|
case "null":
|
|
1282
1282
|
return this.node(n, {
|
|
1283
|
-
kind:
|
|
1283
|
+
kind: m.NULL
|
|
1284
1284
|
});
|
|
1285
1285
|
default:
|
|
1286
1286
|
return this.node(n, {
|
|
1287
|
-
kind:
|
|
1287
|
+
kind: m.ENUM,
|
|
1288
1288
|
value: n.value
|
|
1289
1289
|
});
|
|
1290
1290
|
}
|
|
1291
1291
|
case u.DOLLAR:
|
|
1292
1292
|
if (t)
|
|
1293
1293
|
if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
|
|
1294
|
-
const
|
|
1294
|
+
const r = this._lexer.token.value;
|
|
1295
1295
|
throw R(
|
|
1296
1296
|
this._lexer.source,
|
|
1297
1297
|
n.start,
|
|
1298
|
-
`Unexpected variable "$${
|
|
1298
|
+
`Unexpected variable "$${r}" in constant value.`
|
|
1299
1299
|
);
|
|
1300
1300
|
} else
|
|
1301
1301
|
throw this.unexpected(n);
|
|
@@ -1310,7 +1310,7 @@ class St {
|
|
|
1310
1310
|
parseStringLiteral() {
|
|
1311
1311
|
const t = this._lexer.token;
|
|
1312
1312
|
return this.advanceLexer(), this.node(t, {
|
|
1313
|
-
kind:
|
|
1313
|
+
kind: m.STRING,
|
|
1314
1314
|
value: t.value,
|
|
1315
1315
|
block: t.kind === u.BLOCK_STRING
|
|
1316
1316
|
});
|
|
@@ -1323,7 +1323,7 @@ class St {
|
|
|
1323
1323
|
parseList(t) {
|
|
1324
1324
|
const n = () => this.parseValueLiteral(t);
|
|
1325
1325
|
return this.node(this._lexer.token, {
|
|
1326
|
-
kind:
|
|
1326
|
+
kind: m.LIST,
|
|
1327
1327
|
values: this.any(u.BRACKET_L, n, u.BRACKET_R)
|
|
1328
1328
|
});
|
|
1329
1329
|
}
|
|
@@ -1337,7 +1337,7 @@ class St {
|
|
|
1337
1337
|
parseObject(t) {
|
|
1338
1338
|
const n = () => this.parseObjectField(t);
|
|
1339
1339
|
return this.node(this._lexer.token, {
|
|
1340
|
-
kind:
|
|
1340
|
+
kind: m.OBJECT,
|
|
1341
1341
|
fields: this.any(u.BRACE_L, n, u.BRACE_R)
|
|
1342
1342
|
});
|
|
1343
1343
|
}
|
|
@@ -1345,10 +1345,10 @@ class St {
|
|
|
1345
1345
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1346
1346
|
*/
|
|
1347
1347
|
parseObjectField(t) {
|
|
1348
|
-
const n = this._lexer.token,
|
|
1348
|
+
const n = this._lexer.token, r = this.parseName();
|
|
1349
1349
|
return this.expectToken(u.COLON), this.node(n, {
|
|
1350
|
-
kind:
|
|
1351
|
-
name:
|
|
1350
|
+
kind: m.OBJECT_FIELD,
|
|
1351
|
+
name: r,
|
|
1352
1352
|
value: this.parseValueLiteral(t)
|
|
1353
1353
|
});
|
|
1354
1354
|
}
|
|
@@ -1373,7 +1373,7 @@ class St {
|
|
|
1373
1373
|
parseDirective(t) {
|
|
1374
1374
|
const n = this._lexer.token;
|
|
1375
1375
|
return this.expectToken(u.AT), this.node(n, {
|
|
1376
|
-
kind:
|
|
1376
|
+
kind: m.DIRECTIVE,
|
|
1377
1377
|
name: this.parseName(),
|
|
1378
1378
|
arguments: this.parseArguments(t)
|
|
1379
1379
|
});
|
|
@@ -1389,15 +1389,15 @@ class St {
|
|
|
1389
1389
|
const t = this._lexer.token;
|
|
1390
1390
|
let n;
|
|
1391
1391
|
if (this.expectOptionalToken(u.BRACKET_L)) {
|
|
1392
|
-
const
|
|
1392
|
+
const r = this.parseTypeReference();
|
|
1393
1393
|
this.expectToken(u.BRACKET_R), n = this.node(t, {
|
|
1394
|
-
kind:
|
|
1395
|
-
type:
|
|
1394
|
+
kind: m.LIST_TYPE,
|
|
1395
|
+
type: r
|
|
1396
1396
|
});
|
|
1397
1397
|
} else
|
|
1398
1398
|
n = this.parseNamedType();
|
|
1399
1399
|
return this.expectOptionalToken(u.BANG) ? this.node(t, {
|
|
1400
|
-
kind:
|
|
1400
|
+
kind: m.NON_NULL_TYPE,
|
|
1401
1401
|
type: n
|
|
1402
1402
|
}) : n;
|
|
1403
1403
|
}
|
|
@@ -1406,7 +1406,7 @@ class St {
|
|
|
1406
1406
|
*/
|
|
1407
1407
|
parseNamedType() {
|
|
1408
1408
|
return this.node(this._lexer.token, {
|
|
1409
|
-
kind:
|
|
1409
|
+
kind: m.NAMED_TYPE,
|
|
1410
1410
|
name: this.parseName()
|
|
1411
1411
|
});
|
|
1412
1412
|
}
|
|
@@ -1429,16 +1429,16 @@ class St {
|
|
|
1429
1429
|
parseSchemaDefinition() {
|
|
1430
1430
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1431
1431
|
this.expectKeyword("schema");
|
|
1432
|
-
const
|
|
1432
|
+
const r = this.parseConstDirectives(), i = this.many(
|
|
1433
1433
|
u.BRACE_L,
|
|
1434
1434
|
this.parseOperationTypeDefinition,
|
|
1435
1435
|
u.BRACE_R
|
|
1436
1436
|
);
|
|
1437
1437
|
return this.node(t, {
|
|
1438
|
-
kind:
|
|
1438
|
+
kind: m.SCHEMA_DEFINITION,
|
|
1439
1439
|
description: n,
|
|
1440
|
-
directives:
|
|
1441
|
-
operationTypes:
|
|
1440
|
+
directives: r,
|
|
1441
|
+
operationTypes: i
|
|
1442
1442
|
});
|
|
1443
1443
|
}
|
|
1444
1444
|
/**
|
|
@@ -1447,11 +1447,11 @@ class St {
|
|
|
1447
1447
|
parseOperationTypeDefinition() {
|
|
1448
1448
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
1449
1449
|
this.expectToken(u.COLON);
|
|
1450
|
-
const
|
|
1450
|
+
const r = this.parseNamedType();
|
|
1451
1451
|
return this.node(t, {
|
|
1452
|
-
kind:
|
|
1452
|
+
kind: m.OPERATION_TYPE_DEFINITION,
|
|
1453
1453
|
operation: n,
|
|
1454
|
-
type:
|
|
1454
|
+
type: r
|
|
1455
1455
|
});
|
|
1456
1456
|
}
|
|
1457
1457
|
/**
|
|
@@ -1460,12 +1460,12 @@ class St {
|
|
|
1460
1460
|
parseScalarTypeDefinition() {
|
|
1461
1461
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1462
1462
|
this.expectKeyword("scalar");
|
|
1463
|
-
const
|
|
1463
|
+
const r = this.parseName(), i = this.parseConstDirectives();
|
|
1464
1464
|
return this.node(t, {
|
|
1465
|
-
kind:
|
|
1465
|
+
kind: m.SCALAR_TYPE_DEFINITION,
|
|
1466
1466
|
description: n,
|
|
1467
|
-
name:
|
|
1468
|
-
directives:
|
|
1467
|
+
name: r,
|
|
1468
|
+
directives: i
|
|
1469
1469
|
});
|
|
1470
1470
|
}
|
|
1471
1471
|
/**
|
|
@@ -1476,12 +1476,12 @@ class St {
|
|
|
1476
1476
|
parseObjectTypeDefinition() {
|
|
1477
1477
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1478
1478
|
this.expectKeyword("type");
|
|
1479
|
-
const
|
|
1479
|
+
const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1480
1480
|
return this.node(t, {
|
|
1481
|
-
kind:
|
|
1481
|
+
kind: m.OBJECT_TYPE_DEFINITION,
|
|
1482
1482
|
description: n,
|
|
1483
|
-
name:
|
|
1484
|
-
interfaces:
|
|
1483
|
+
name: r,
|
|
1484
|
+
interfaces: i,
|
|
1485
1485
|
directives: s,
|
|
1486
1486
|
fields: a
|
|
1487
1487
|
});
|
|
@@ -1511,14 +1511,14 @@ class St {
|
|
|
1511
1511
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1512
1512
|
*/
|
|
1513
1513
|
parseFieldDefinition() {
|
|
1514
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1514
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
|
|
1515
1515
|
this.expectToken(u.COLON);
|
|
1516
1516
|
const s = this.parseTypeReference(), a = this.parseConstDirectives();
|
|
1517
1517
|
return this.node(t, {
|
|
1518
|
-
kind:
|
|
1518
|
+
kind: m.FIELD_DEFINITION,
|
|
1519
1519
|
description: n,
|
|
1520
|
-
name:
|
|
1521
|
-
arguments:
|
|
1520
|
+
name: r,
|
|
1521
|
+
arguments: i,
|
|
1522
1522
|
type: s,
|
|
1523
1523
|
directives: a
|
|
1524
1524
|
});
|
|
@@ -1538,17 +1538,17 @@ class St {
|
|
|
1538
1538
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1539
1539
|
*/
|
|
1540
1540
|
parseInputValueDef() {
|
|
1541
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1541
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
|
|
1542
1542
|
this.expectToken(u.COLON);
|
|
1543
|
-
const
|
|
1543
|
+
const i = this.parseTypeReference();
|
|
1544
1544
|
let s;
|
|
1545
1545
|
this.expectOptionalToken(u.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1546
1546
|
const a = this.parseConstDirectives();
|
|
1547
1547
|
return this.node(t, {
|
|
1548
|
-
kind:
|
|
1548
|
+
kind: m.INPUT_VALUE_DEFINITION,
|
|
1549
1549
|
description: n,
|
|
1550
|
-
name:
|
|
1551
|
-
type:
|
|
1550
|
+
name: r,
|
|
1551
|
+
type: i,
|
|
1552
1552
|
defaultValue: s,
|
|
1553
1553
|
directives: a
|
|
1554
1554
|
});
|
|
@@ -1560,12 +1560,12 @@ class St {
|
|
|
1560
1560
|
parseInterfaceTypeDefinition() {
|
|
1561
1561
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1562
1562
|
this.expectKeyword("interface");
|
|
1563
|
-
const
|
|
1563
|
+
const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1564
1564
|
return this.node(t, {
|
|
1565
|
-
kind:
|
|
1565
|
+
kind: m.INTERFACE_TYPE_DEFINITION,
|
|
1566
1566
|
description: n,
|
|
1567
|
-
name:
|
|
1568
|
-
interfaces:
|
|
1567
|
+
name: r,
|
|
1568
|
+
interfaces: i,
|
|
1569
1569
|
directives: s,
|
|
1570
1570
|
fields: a
|
|
1571
1571
|
});
|
|
@@ -1577,12 +1577,12 @@ class St {
|
|
|
1577
1577
|
parseUnionTypeDefinition() {
|
|
1578
1578
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1579
1579
|
this.expectKeyword("union");
|
|
1580
|
-
const
|
|
1580
|
+
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1581
1581
|
return this.node(t, {
|
|
1582
|
-
kind:
|
|
1582
|
+
kind: m.UNION_TYPE_DEFINITION,
|
|
1583
1583
|
description: n,
|
|
1584
|
-
name:
|
|
1585
|
-
directives:
|
|
1584
|
+
name: r,
|
|
1585
|
+
directives: i,
|
|
1586
1586
|
types: s
|
|
1587
1587
|
});
|
|
1588
1588
|
}
|
|
@@ -1601,12 +1601,12 @@ class St {
|
|
|
1601
1601
|
parseEnumTypeDefinition() {
|
|
1602
1602
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1603
1603
|
this.expectKeyword("enum");
|
|
1604
|
-
const
|
|
1604
|
+
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1605
1605
|
return this.node(t, {
|
|
1606
|
-
kind:
|
|
1606
|
+
kind: m.ENUM_TYPE_DEFINITION,
|
|
1607
1607
|
description: n,
|
|
1608
|
-
name:
|
|
1609
|
-
directives:
|
|
1608
|
+
name: r,
|
|
1609
|
+
directives: i,
|
|
1610
1610
|
values: s
|
|
1611
1611
|
});
|
|
1612
1612
|
}
|
|
@@ -1626,12 +1626,12 @@ class St {
|
|
|
1626
1626
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1627
1627
|
*/
|
|
1628
1628
|
parseEnumValueDefinition() {
|
|
1629
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1629
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
|
|
1630
1630
|
return this.node(t, {
|
|
1631
|
-
kind:
|
|
1631
|
+
kind: m.ENUM_VALUE_DEFINITION,
|
|
1632
1632
|
description: n,
|
|
1633
|
-
name:
|
|
1634
|
-
directives:
|
|
1633
|
+
name: r,
|
|
1634
|
+
directives: i
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
1637
|
/**
|
|
@@ -1642,7 +1642,7 @@ class St {
|
|
|
1642
1642
|
throw R(
|
|
1643
1643
|
this._lexer.source,
|
|
1644
1644
|
this._lexer.token.start,
|
|
1645
|
-
`${
|
|
1645
|
+
`${K(
|
|
1646
1646
|
this._lexer.token
|
|
1647
1647
|
)} is reserved and cannot be used for an enum value.`
|
|
1648
1648
|
);
|
|
@@ -1655,12 +1655,12 @@ class St {
|
|
|
1655
1655
|
parseInputObjectTypeDefinition() {
|
|
1656
1656
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1657
1657
|
this.expectKeyword("input");
|
|
1658
|
-
const
|
|
1658
|
+
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1659
1659
|
return this.node(t, {
|
|
1660
|
-
kind:
|
|
1660
|
+
kind: m.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1661
1661
|
description: n,
|
|
1662
|
-
name:
|
|
1663
|
-
directives:
|
|
1662
|
+
name: r,
|
|
1663
|
+
directives: i,
|
|
1664
1664
|
fields: s
|
|
1665
1665
|
});
|
|
1666
1666
|
}
|
|
@@ -1720,17 +1720,17 @@ class St {
|
|
|
1720
1720
|
parseSchemaExtension() {
|
|
1721
1721
|
const t = this._lexer.token;
|
|
1722
1722
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1723
|
-
const n = this.parseConstDirectives(),
|
|
1723
|
+
const n = this.parseConstDirectives(), r = this.optionalMany(
|
|
1724
1724
|
u.BRACE_L,
|
|
1725
1725
|
this.parseOperationTypeDefinition,
|
|
1726
1726
|
u.BRACE_R
|
|
1727
1727
|
);
|
|
1728
|
-
if (n.length === 0 &&
|
|
1728
|
+
if (n.length === 0 && r.length === 0)
|
|
1729
1729
|
throw this.unexpected();
|
|
1730
1730
|
return this.node(t, {
|
|
1731
|
-
kind:
|
|
1731
|
+
kind: m.SCHEMA_EXTENSION,
|
|
1732
1732
|
directives: n,
|
|
1733
|
-
operationTypes:
|
|
1733
|
+
operationTypes: r
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
/**
|
|
@@ -1740,13 +1740,13 @@ class St {
|
|
|
1740
1740
|
parseScalarTypeExtension() {
|
|
1741
1741
|
const t = this._lexer.token;
|
|
1742
1742
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1743
|
-
const n = this.parseName(),
|
|
1744
|
-
if (
|
|
1743
|
+
const n = this.parseName(), r = this.parseConstDirectives();
|
|
1744
|
+
if (r.length === 0)
|
|
1745
1745
|
throw this.unexpected();
|
|
1746
1746
|
return this.node(t, {
|
|
1747
|
-
kind:
|
|
1747
|
+
kind: m.SCALAR_TYPE_EXTENSION,
|
|
1748
1748
|
name: n,
|
|
1749
|
-
directives:
|
|
1749
|
+
directives: r
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
1752
|
/**
|
|
@@ -1758,14 +1758,14 @@ class St {
|
|
|
1758
1758
|
parseObjectTypeExtension() {
|
|
1759
1759
|
const t = this._lexer.token;
|
|
1760
1760
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1761
|
-
const n = this.parseName(),
|
|
1762
|
-
if (
|
|
1761
|
+
const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1762
|
+
if (r.length === 0 && i.length === 0 && s.length === 0)
|
|
1763
1763
|
throw this.unexpected();
|
|
1764
1764
|
return this.node(t, {
|
|
1765
|
-
kind:
|
|
1765
|
+
kind: m.OBJECT_TYPE_EXTENSION,
|
|
1766
1766
|
name: n,
|
|
1767
|
-
interfaces:
|
|
1768
|
-
directives:
|
|
1767
|
+
interfaces: r,
|
|
1768
|
+
directives: i,
|
|
1769
1769
|
fields: s
|
|
1770
1770
|
});
|
|
1771
1771
|
}
|
|
@@ -1778,14 +1778,14 @@ class St {
|
|
|
1778
1778
|
parseInterfaceTypeExtension() {
|
|
1779
1779
|
const t = this._lexer.token;
|
|
1780
1780
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1781
|
-
const n = this.parseName(),
|
|
1782
|
-
if (
|
|
1781
|
+
const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1782
|
+
if (r.length === 0 && i.length === 0 && s.length === 0)
|
|
1783
1783
|
throw this.unexpected();
|
|
1784
1784
|
return this.node(t, {
|
|
1785
|
-
kind:
|
|
1785
|
+
kind: m.INTERFACE_TYPE_EXTENSION,
|
|
1786
1786
|
name: n,
|
|
1787
|
-
interfaces:
|
|
1788
|
-
directives:
|
|
1787
|
+
interfaces: r,
|
|
1788
|
+
directives: i,
|
|
1789
1789
|
fields: s
|
|
1790
1790
|
});
|
|
1791
1791
|
}
|
|
@@ -1797,14 +1797,14 @@ class St {
|
|
|
1797
1797
|
parseUnionTypeExtension() {
|
|
1798
1798
|
const t = this._lexer.token;
|
|
1799
1799
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1800
|
-
const n = this.parseName(),
|
|
1801
|
-
if (
|
|
1800
|
+
const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
|
|
1801
|
+
if (r.length === 0 && i.length === 0)
|
|
1802
1802
|
throw this.unexpected();
|
|
1803
1803
|
return this.node(t, {
|
|
1804
|
-
kind:
|
|
1804
|
+
kind: m.UNION_TYPE_EXTENSION,
|
|
1805
1805
|
name: n,
|
|
1806
|
-
directives:
|
|
1807
|
-
types:
|
|
1806
|
+
directives: r,
|
|
1807
|
+
types: i
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
1810
1810
|
/**
|
|
@@ -1815,14 +1815,14 @@ class St {
|
|
|
1815
1815
|
parseEnumTypeExtension() {
|
|
1816
1816
|
const t = this._lexer.token;
|
|
1817
1817
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1818
|
-
const n = this.parseName(),
|
|
1819
|
-
if (
|
|
1818
|
+
const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
|
|
1819
|
+
if (r.length === 0 && i.length === 0)
|
|
1820
1820
|
throw this.unexpected();
|
|
1821
1821
|
return this.node(t, {
|
|
1822
|
-
kind:
|
|
1822
|
+
kind: m.ENUM_TYPE_EXTENSION,
|
|
1823
1823
|
name: n,
|
|
1824
|
-
directives:
|
|
1825
|
-
values:
|
|
1824
|
+
directives: r,
|
|
1825
|
+
values: i
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
1828
|
/**
|
|
@@ -1833,14 +1833,14 @@ class St {
|
|
|
1833
1833
|
parseInputObjectTypeExtension() {
|
|
1834
1834
|
const t = this._lexer.token;
|
|
1835
1835
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1836
|
-
const n = this.parseName(),
|
|
1837
|
-
if (
|
|
1836
|
+
const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
|
|
1837
|
+
if (r.length === 0 && i.length === 0)
|
|
1838
1838
|
throw this.unexpected();
|
|
1839
1839
|
return this.node(t, {
|
|
1840
|
-
kind:
|
|
1840
|
+
kind: m.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1841
1841
|
name: n,
|
|
1842
|
-
directives:
|
|
1843
|
-
fields:
|
|
1842
|
+
directives: r,
|
|
1843
|
+
fields: i
|
|
1844
1844
|
});
|
|
1845
1845
|
}
|
|
1846
1846
|
/**
|
|
@@ -1852,14 +1852,14 @@ class St {
|
|
|
1852
1852
|
parseDirectiveDefinition() {
|
|
1853
1853
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1854
1854
|
this.expectKeyword("directive"), this.expectToken(u.AT);
|
|
1855
|
-
const
|
|
1855
|
+
const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1856
1856
|
this.expectKeyword("on");
|
|
1857
1857
|
const a = this.parseDirectiveLocations();
|
|
1858
1858
|
return this.node(t, {
|
|
1859
|
-
kind:
|
|
1859
|
+
kind: m.DIRECTIVE_DEFINITION,
|
|
1860
1860
|
description: n,
|
|
1861
|
-
name:
|
|
1862
|
-
arguments:
|
|
1861
|
+
name: r,
|
|
1862
|
+
arguments: i,
|
|
1863
1863
|
repeatable: s,
|
|
1864
1864
|
locations: a
|
|
1865
1865
|
});
|
|
@@ -1901,7 +1901,7 @@ class St {
|
|
|
1901
1901
|
*/
|
|
1902
1902
|
parseDirectiveLocation() {
|
|
1903
1903
|
const t = this._lexer.token, n = this.parseName();
|
|
1904
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1904
|
+
if (Object.prototype.hasOwnProperty.call(me, n.value))
|
|
1905
1905
|
return n;
|
|
1906
1906
|
throw this.unexpected(t);
|
|
1907
1907
|
}
|
|
@@ -1912,7 +1912,7 @@ class St {
|
|
|
1912
1912
|
* given parsed object.
|
|
1913
1913
|
*/
|
|
1914
1914
|
node(t, n) {
|
|
1915
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
1915
|
+
return this._options.noLocation !== !0 && (n.loc = new We(
|
|
1916
1916
|
t,
|
|
1917
1917
|
this._lexer.lastToken,
|
|
1918
1918
|
this._lexer.source
|
|
@@ -1935,7 +1935,7 @@ class St {
|
|
|
1935
1935
|
throw R(
|
|
1936
1936
|
this._lexer.source,
|
|
1937
1937
|
n.start,
|
|
1938
|
-
`Expected ${
|
|
1938
|
+
`Expected ${qe(t)}, found ${K(n)}.`
|
|
1939
1939
|
);
|
|
1940
1940
|
}
|
|
1941
1941
|
/**
|
|
@@ -1957,7 +1957,7 @@ class St {
|
|
|
1957
1957
|
throw R(
|
|
1958
1958
|
this._lexer.source,
|
|
1959
1959
|
n.start,
|
|
1960
|
-
`Expected "${t}", found ${
|
|
1960
|
+
`Expected "${t}", found ${K(n)}.`
|
|
1961
1961
|
);
|
|
1962
1962
|
}
|
|
1963
1963
|
/**
|
|
@@ -1976,7 +1976,7 @@ class St {
|
|
|
1976
1976
|
return R(
|
|
1977
1977
|
this._lexer.source,
|
|
1978
1978
|
n.start,
|
|
1979
|
-
`Unexpected ${
|
|
1979
|
+
`Unexpected ${K(n)}.`
|
|
1980
1980
|
);
|
|
1981
1981
|
}
|
|
1982
1982
|
/**
|
|
@@ -1984,12 +1984,12 @@ class St {
|
|
|
1984
1984
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
1985
1985
|
* Advances the parser to the next lex token after the closing token.
|
|
1986
1986
|
*/
|
|
1987
|
-
any(t, n,
|
|
1987
|
+
any(t, n, r) {
|
|
1988
1988
|
this.expectToken(t);
|
|
1989
|
-
const
|
|
1990
|
-
for (; !this.expectOptionalToken(
|
|
1991
|
-
|
|
1992
|
-
return
|
|
1989
|
+
const i = [];
|
|
1990
|
+
for (; !this.expectOptionalToken(r); )
|
|
1991
|
+
i.push(n.call(this));
|
|
1992
|
+
return i;
|
|
1993
1993
|
}
|
|
1994
1994
|
/**
|
|
1995
1995
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -1997,13 +1997,13 @@ class St {
|
|
|
1997
1997
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
1998
1998
|
* Advances the parser to the next lex token after the closing token.
|
|
1999
1999
|
*/
|
|
2000
|
-
optionalMany(t, n,
|
|
2000
|
+
optionalMany(t, n, r) {
|
|
2001
2001
|
if (this.expectOptionalToken(t)) {
|
|
2002
|
-
const
|
|
2002
|
+
const i = [];
|
|
2003
2003
|
do
|
|
2004
|
-
|
|
2005
|
-
while (!this.expectOptionalToken(
|
|
2006
|
-
return
|
|
2004
|
+
i.push(n.call(this));
|
|
2005
|
+
while (!this.expectOptionalToken(r));
|
|
2006
|
+
return i;
|
|
2007
2007
|
}
|
|
2008
2008
|
return [];
|
|
2009
2009
|
}
|
|
@@ -2012,13 +2012,13 @@ class St {
|
|
|
2012
2012
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2013
2013
|
* Advances the parser to the next lex token after the closing token.
|
|
2014
2014
|
*/
|
|
2015
|
-
many(t, n,
|
|
2015
|
+
many(t, n, r) {
|
|
2016
2016
|
this.expectToken(t);
|
|
2017
|
-
const
|
|
2017
|
+
const i = [];
|
|
2018
2018
|
do
|
|
2019
|
-
|
|
2020
|
-
while (!this.expectOptionalToken(
|
|
2021
|
-
return
|
|
2019
|
+
i.push(n.call(this));
|
|
2020
|
+
while (!this.expectOptionalToken(r));
|
|
2021
|
+
return i;
|
|
2022
2022
|
}
|
|
2023
2023
|
/**
|
|
2024
2024
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
@@ -2027,11 +2027,11 @@ class St {
|
|
|
2027
2027
|
*/
|
|
2028
2028
|
delimitedMany(t, n) {
|
|
2029
2029
|
this.expectOptionalToken(t);
|
|
2030
|
-
const
|
|
2030
|
+
const r = [];
|
|
2031
2031
|
do
|
|
2032
|
-
|
|
2032
|
+
r.push(n.call(this));
|
|
2033
2033
|
while (this.expectOptionalToken(t));
|
|
2034
|
-
return
|
|
2034
|
+
return r;
|
|
2035
2035
|
}
|
|
2036
2036
|
advanceLexer() {
|
|
2037
2037
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
@@ -2043,21 +2043,21 @@ class St {
|
|
|
2043
2043
|
);
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function K(e) {
|
|
2047
2047
|
const t = e.value;
|
|
2048
|
-
return
|
|
2048
|
+
return qe(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2049
2049
|
}
|
|
2050
|
-
function
|
|
2050
|
+
function qe(e) {
|
|
2051
2051
|
return at(e) ? `"${e}"` : e;
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2054
|
-
return `"${e.replace(
|
|
2053
|
+
function St(e) {
|
|
2054
|
+
return `"${e.replace(Rt, Ot)}"`;
|
|
2055
2055
|
}
|
|
2056
|
-
const
|
|
2057
|
-
function
|
|
2058
|
-
return
|
|
2056
|
+
const Rt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2057
|
+
function Ot(e) {
|
|
2058
|
+
return Nt[e.charCodeAt(0)];
|
|
2059
2059
|
}
|
|
2060
|
-
const
|
|
2060
|
+
const Nt = [
|
|
2061
2061
|
"\\u0000",
|
|
2062
2062
|
"\\u0001",
|
|
2063
2063
|
"\\u0002",
|
|
@@ -2224,74 +2224,74 @@ const Ot = [
|
|
|
2224
2224
|
"\\u009E",
|
|
2225
2225
|
"\\u009F"
|
|
2226
2226
|
], Pt = Object.freeze({});
|
|
2227
|
-
function
|
|
2228
|
-
const
|
|
2229
|
-
for (const
|
|
2230
|
-
|
|
2231
|
-
let
|
|
2232
|
-
const C = [],
|
|
2227
|
+
function Dt(e, t, n = be) {
|
|
2228
|
+
const r = /* @__PURE__ */ new Map();
|
|
2229
|
+
for (const D of Object.values(m))
|
|
2230
|
+
r.set(D, bt(t, D));
|
|
2231
|
+
let i, s = Array.isArray(e), a = [e], c = -1, p = [], h = e, f, y;
|
|
2232
|
+
const C = [], I = [];
|
|
2233
2233
|
do {
|
|
2234
2234
|
c++;
|
|
2235
|
-
const
|
|
2236
|
-
if (
|
|
2237
|
-
if (
|
|
2235
|
+
const D = c === a.length, z = D && p.length !== 0;
|
|
2236
|
+
if (D) {
|
|
2237
|
+
if (f = I.length === 0 ? void 0 : C[C.length - 1], h = y, y = I.pop(), z)
|
|
2238
2238
|
if (s) {
|
|
2239
2239
|
h = h.slice();
|
|
2240
|
-
let
|
|
2241
|
-
for (const [
|
|
2242
|
-
const Q =
|
|
2243
|
-
J === null ? (h.splice(Q, 1),
|
|
2240
|
+
let b = 0;
|
|
2241
|
+
for (const [M, J] of p) {
|
|
2242
|
+
const Q = M - b;
|
|
2243
|
+
J === null ? (h.splice(Q, 1), b++) : h[Q] = J;
|
|
2244
2244
|
}
|
|
2245
2245
|
} else {
|
|
2246
2246
|
h = Object.defineProperties(
|
|
2247
2247
|
{},
|
|
2248
2248
|
Object.getOwnPropertyDescriptors(h)
|
|
2249
2249
|
);
|
|
2250
|
-
for (const [
|
|
2251
|
-
h[
|
|
2250
|
+
for (const [b, M] of p)
|
|
2251
|
+
h[b] = M;
|
|
2252
2252
|
}
|
|
2253
|
-
c =
|
|
2253
|
+
c = i.index, a = i.keys, p = i.edits, s = i.inArray, i = i.prev;
|
|
2254
2254
|
} else if (y) {
|
|
2255
|
-
if (
|
|
2255
|
+
if (f = s ? c : a[c], h = y[f], h == null)
|
|
2256
2256
|
continue;
|
|
2257
|
-
C.push(
|
|
2257
|
+
C.push(f);
|
|
2258
2258
|
}
|
|
2259
2259
|
let _;
|
|
2260
2260
|
if (!Array.isArray(h)) {
|
|
2261
|
-
var g,
|
|
2262
|
-
|
|
2263
|
-
const
|
|
2264
|
-
if (_ =
|
|
2261
|
+
var g, T;
|
|
2262
|
+
xe(h) || Z(!1, `Invalid AST Node: ${Ee(h)}.`);
|
|
2263
|
+
const b = D ? (g = r.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (T = r.get(h.kind)) === null || T === void 0 ? void 0 : T.enter;
|
|
2264
|
+
if (_ = b == null ? void 0 : b.call(t, h, f, y, C, I), _ === Pt)
|
|
2265
2265
|
break;
|
|
2266
2266
|
if (_ === !1) {
|
|
2267
|
-
if (!
|
|
2267
|
+
if (!D) {
|
|
2268
2268
|
C.pop();
|
|
2269
2269
|
continue;
|
|
2270
2270
|
}
|
|
2271
|
-
} else if (_ !== void 0 && (p.push([
|
|
2272
|
-
if (
|
|
2271
|
+
} else if (_ !== void 0 && (p.push([f, _]), !D))
|
|
2272
|
+
if (xe(_))
|
|
2273
2273
|
h = _;
|
|
2274
2274
|
else {
|
|
2275
2275
|
C.pop();
|
|
2276
2276
|
continue;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
if (_ === void 0 && z && p.push([
|
|
2279
|
+
if (_ === void 0 && z && p.push([f, h]), D)
|
|
2280
2280
|
C.pop();
|
|
2281
2281
|
else {
|
|
2282
2282
|
var P;
|
|
2283
|
-
|
|
2283
|
+
i = {
|
|
2284
2284
|
inArray: s,
|
|
2285
2285
|
index: c,
|
|
2286
2286
|
keys: a,
|
|
2287
2287
|
edits: p,
|
|
2288
|
-
prev:
|
|
2289
|
-
}, s = Array.isArray(h), a = s ? h : (P = n[h.kind]) !== null && P !== void 0 ? P : [], c = -1, p = [], y &&
|
|
2288
|
+
prev: i
|
|
2289
|
+
}, s = Array.isArray(h), a = s ? h : (P = n[h.kind]) !== null && P !== void 0 ? P : [], c = -1, p = [], y && I.push(y), y = h;
|
|
2290
2290
|
}
|
|
2291
|
-
} while (
|
|
2291
|
+
} while (i !== void 0);
|
|
2292
2292
|
return p.length !== 0 ? p[p.length - 1][1] : e;
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function bt(e, t) {
|
|
2295
2295
|
const n = e[t];
|
|
2296
2296
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
2297
2297
|
enter: n,
|
|
@@ -2302,7 +2302,7 @@ function Dt(e, t) {
|
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
function kt(e) {
|
|
2305
|
-
return
|
|
2305
|
+
return Dt(e, Lt);
|
|
2306
2306
|
}
|
|
2307
2307
|
const _t = 80, Lt = {
|
|
2308
2308
|
Name: {
|
|
@@ -2313,17 +2313,17 @@ const _t = 80, Lt = {
|
|
|
2313
2313
|
},
|
|
2314
2314
|
// Document
|
|
2315
2315
|
Document: {
|
|
2316
|
-
leave: (e) =>
|
|
2316
|
+
leave: (e) => d(e.definitions, `
|
|
2317
2317
|
|
|
2318
2318
|
`)
|
|
2319
2319
|
},
|
|
2320
2320
|
OperationDefinition: {
|
|
2321
2321
|
leave(e) {
|
|
2322
|
-
const t =
|
|
2322
|
+
const t = A("(", d(e.variableDefinitions, ", "), ")"), n = d(
|
|
2323
2323
|
[
|
|
2324
2324
|
e.operation,
|
|
2325
|
-
|
|
2326
|
-
|
|
2325
|
+
d([e.name, t]),
|
|
2326
|
+
d(e.directives, " ")
|
|
2327
2327
|
],
|
|
2328
2328
|
" "
|
|
2329
2329
|
);
|
|
@@ -2331,19 +2331,19 @@ const _t = 80, Lt = {
|
|
|
2331
2331
|
}
|
|
2332
2332
|
},
|
|
2333
2333
|
VariableDefinition: {
|
|
2334
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives:
|
|
2334
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: r }) => e + ": " + t + A(" = ", n) + A(" ", d(r, " "))
|
|
2335
2335
|
},
|
|
2336
2336
|
SelectionSet: {
|
|
2337
2337
|
leave: ({ selections: e }) => k(e)
|
|
2338
2338
|
},
|
|
2339
2339
|
Field: {
|
|
2340
|
-
leave({ alias: e, name: t, arguments: n, directives:
|
|
2341
|
-
const s =
|
|
2342
|
-
let a = s +
|
|
2343
|
-
return a.length > _t && (a = s +
|
|
2344
|
-
`,
|
|
2340
|
+
leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
|
|
2341
|
+
const s = A("", e, ": ") + t;
|
|
2342
|
+
let a = s + A("(", d(n, ", "), ")");
|
|
2343
|
+
return a.length > _t && (a = s + A(`(
|
|
2344
|
+
`, W(d(n, `
|
|
2345
2345
|
`)), `
|
|
2346
|
-
)`)),
|
|
2346
|
+
)`)), d([a, d(r, " "), i], " ");
|
|
2347
2347
|
}
|
|
2348
2348
|
},
|
|
2349
2349
|
Argument: {
|
|
@@ -2351,23 +2351,23 @@ const _t = 80, Lt = {
|
|
|
2351
2351
|
},
|
|
2352
2352
|
// Fragments
|
|
2353
2353
|
FragmentSpread: {
|
|
2354
|
-
leave: ({ name: e, directives: t }) => "..." + e +
|
|
2354
|
+
leave: ({ name: e, directives: t }) => "..." + e + A(" ", d(t, " "))
|
|
2355
2355
|
},
|
|
2356
2356
|
InlineFragment: {
|
|
2357
|
-
leave: ({ typeCondition: e, directives: t, selectionSet: n }) =>
|
|
2357
|
+
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
|
|
2358
2358
|
[
|
|
2359
2359
|
"...",
|
|
2360
|
-
|
|
2361
|
-
|
|
2360
|
+
A("on ", e),
|
|
2361
|
+
d(t, " "),
|
|
2362
2362
|
n
|
|
2363
2363
|
],
|
|
2364
2364
|
" "
|
|
2365
2365
|
)
|
|
2366
2366
|
},
|
|
2367
2367
|
FragmentDefinition: {
|
|
2368
|
-
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives:
|
|
2368
|
+
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: r, selectionSet: i }) => (
|
|
2369
2369
|
// or removed in the future.
|
|
2370
|
-
`fragment ${e}${
|
|
2370
|
+
`fragment ${e}${A("(", d(n, ", "), ")")} on ${t} ${A("", d(r, " "), " ")}` + i
|
|
2371
2371
|
)
|
|
2372
2372
|
},
|
|
2373
2373
|
// Value
|
|
@@ -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) : St(e)
|
|
2382
2382
|
},
|
|
2383
2383
|
BooleanValue: {
|
|
2384
2384
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2390,17 +2390,17 @@ const _t = 80, Lt = {
|
|
|
2390
2390
|
leave: ({ value: e }) => e
|
|
2391
2391
|
},
|
|
2392
2392
|
ListValue: {
|
|
2393
|
-
leave: ({ values: e }) => "[" +
|
|
2393
|
+
leave: ({ values: e }) => "[" + d(e, ", ") + "]"
|
|
2394
2394
|
},
|
|
2395
2395
|
ObjectValue: {
|
|
2396
|
-
leave: ({ fields: e }) => "{" +
|
|
2396
|
+
leave: ({ fields: e }) => "{" + d(e, ", ") + "}"
|
|
2397
2397
|
},
|
|
2398
2398
|
ObjectField: {
|
|
2399
2399
|
leave: ({ name: e, value: t }) => e + ": " + t
|
|
2400
2400
|
},
|
|
2401
2401
|
// Directive
|
|
2402
2402
|
Directive: {
|
|
2403
|
-
leave: ({ name: e, arguments: t }) => "@" + e +
|
|
2403
|
+
leave: ({ name: e, arguments: t }) => "@" + e + A("(", d(t, ", "), ")")
|
|
2404
2404
|
},
|
|
2405
2405
|
// Type
|
|
2406
2406
|
NamedType: {
|
|
@@ -2414,156 +2414,156 @@ const _t = 80, Lt = {
|
|
|
2414
2414
|
},
|
|
2415
2415
|
// Type System Definitions
|
|
2416
2416
|
SchemaDefinition: {
|
|
2417
|
-
leave: ({ description: e, directives: t, operationTypes: n }) =>
|
|
2418
|
-
`) +
|
|
2417
|
+
leave: ({ description: e, directives: t, operationTypes: n }) => A("", e, `
|
|
2418
|
+
`) + d(["schema", d(t, " "), k(n)], " ")
|
|
2419
2419
|
},
|
|
2420
2420
|
OperationTypeDefinition: {
|
|
2421
2421
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
2422
2422
|
},
|
|
2423
2423
|
ScalarTypeDefinition: {
|
|
2424
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2425
|
-
`) +
|
|
2424
|
+
leave: ({ description: e, name: t, directives: n }) => A("", e, `
|
|
2425
|
+
`) + d(["scalar", t, d(n, " ")], " ")
|
|
2426
2426
|
},
|
|
2427
2427
|
ObjectTypeDefinition: {
|
|
2428
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2429
|
-
`) +
|
|
2428
|
+
leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => A("", e, `
|
|
2429
|
+
`) + d(
|
|
2430
2430
|
[
|
|
2431
2431
|
"type",
|
|
2432
2432
|
t,
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
k(
|
|
2433
|
+
A("implements ", d(n, " & ")),
|
|
2434
|
+
d(r, " "),
|
|
2435
|
+
k(i)
|
|
2436
2436
|
],
|
|
2437
2437
|
" "
|
|
2438
2438
|
)
|
|
2439
2439
|
},
|
|
2440
2440
|
FieldDefinition: {
|
|
2441
|
-
leave: ({ description: e, name: t, arguments: n, type:
|
|
2442
|
-
`) + t + (
|
|
2443
|
-
`,
|
|
2441
|
+
leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => A("", e, `
|
|
2442
|
+
`) + t + (Re(n) ? A(`(
|
|
2443
|
+
`, W(d(n, `
|
|
2444
2444
|
`)), `
|
|
2445
|
-
)`) :
|
|
2445
|
+
)`) : A("(", d(n, ", "), ")")) + ": " + r + A(" ", d(i, " "))
|
|
2446
2446
|
},
|
|
2447
2447
|
InputValueDefinition: {
|
|
2448
|
-
leave: ({ description: e, name: t, type: n, defaultValue:
|
|
2449
|
-
`) +
|
|
2450
|
-
[t + ": " + n,
|
|
2448
|
+
leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => A("", e, `
|
|
2449
|
+
`) + d(
|
|
2450
|
+
[t + ": " + n, A("= ", r), d(i, " ")],
|
|
2451
2451
|
" "
|
|
2452
2452
|
)
|
|
2453
2453
|
},
|
|
2454
2454
|
InterfaceTypeDefinition: {
|
|
2455
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2456
|
-
`) +
|
|
2455
|
+
leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => A("", e, `
|
|
2456
|
+
`) + d(
|
|
2457
2457
|
[
|
|
2458
2458
|
"interface",
|
|
2459
2459
|
t,
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
k(
|
|
2460
|
+
A("implements ", d(n, " & ")),
|
|
2461
|
+
d(r, " "),
|
|
2462
|
+
k(i)
|
|
2463
2463
|
],
|
|
2464
2464
|
" "
|
|
2465
2465
|
)
|
|
2466
2466
|
},
|
|
2467
2467
|
UnionTypeDefinition: {
|
|
2468
|
-
leave: ({ description: e, name: t, directives: n, types:
|
|
2469
|
-
`) +
|
|
2470
|
-
["union", t,
|
|
2468
|
+
leave: ({ description: e, name: t, directives: n, types: r }) => A("", e, `
|
|
2469
|
+
`) + d(
|
|
2470
|
+
["union", t, d(n, " "), A("= ", d(r, " | "))],
|
|
2471
2471
|
" "
|
|
2472
2472
|
)
|
|
2473
2473
|
},
|
|
2474
2474
|
EnumTypeDefinition: {
|
|
2475
|
-
leave: ({ description: e, name: t, directives: n, values:
|
|
2476
|
-
`) +
|
|
2475
|
+
leave: ({ description: e, name: t, directives: n, values: r }) => A("", e, `
|
|
2476
|
+
`) + d(["enum", t, d(n, " "), k(r)], " ")
|
|
2477
2477
|
},
|
|
2478
2478
|
EnumValueDefinition: {
|
|
2479
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2480
|
-
`) +
|
|
2479
|
+
leave: ({ description: e, name: t, directives: n }) => A("", e, `
|
|
2480
|
+
`) + d([t, d(n, " ")], " ")
|
|
2481
2481
|
},
|
|
2482
2482
|
InputObjectTypeDefinition: {
|
|
2483
|
-
leave: ({ description: e, name: t, directives: n, fields:
|
|
2484
|
-
`) +
|
|
2483
|
+
leave: ({ description: e, name: t, directives: n, fields: r }) => A("", e, `
|
|
2484
|
+
`) + d(["input", t, d(n, " "), k(r)], " ")
|
|
2485
2485
|
},
|
|
2486
2486
|
DirectiveDefinition: {
|
|
2487
|
-
leave: ({ description: e, name: t, arguments: n, repeatable:
|
|
2488
|
-
`) + "directive @" + t + (
|
|
2489
|
-
`,
|
|
2487
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => A("", e, `
|
|
2488
|
+
`) + "directive @" + t + (Re(n) ? A(`(
|
|
2489
|
+
`, W(d(n, `
|
|
2490
2490
|
`)), `
|
|
2491
|
-
)`) :
|
|
2491
|
+
)`) : A("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
|
|
2492
2492
|
},
|
|
2493
2493
|
SchemaExtension: {
|
|
2494
|
-
leave: ({ directives: e, operationTypes: t }) =>
|
|
2495
|
-
["extend schema",
|
|
2494
|
+
leave: ({ directives: e, operationTypes: t }) => d(
|
|
2495
|
+
["extend schema", d(e, " "), k(t)],
|
|
2496
2496
|
" "
|
|
2497
2497
|
)
|
|
2498
2498
|
},
|
|
2499
2499
|
ScalarTypeExtension: {
|
|
2500
|
-
leave: ({ name: e, directives: t }) =>
|
|
2500
|
+
leave: ({ name: e, directives: t }) => d(["extend scalar", e, d(t, " ")], " ")
|
|
2501
2501
|
},
|
|
2502
2502
|
ObjectTypeExtension: {
|
|
2503
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
2503
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
|
|
2504
2504
|
[
|
|
2505
2505
|
"extend type",
|
|
2506
2506
|
e,
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
k(
|
|
2507
|
+
A("implements ", d(t, " & ")),
|
|
2508
|
+
d(n, " "),
|
|
2509
|
+
k(r)
|
|
2510
2510
|
],
|
|
2511
2511
|
" "
|
|
2512
2512
|
)
|
|
2513
2513
|
},
|
|
2514
2514
|
InterfaceTypeExtension: {
|
|
2515
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
2515
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
|
|
2516
2516
|
[
|
|
2517
2517
|
"extend interface",
|
|
2518
2518
|
e,
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
k(
|
|
2519
|
+
A("implements ", d(t, " & ")),
|
|
2520
|
+
d(n, " "),
|
|
2521
|
+
k(r)
|
|
2522
2522
|
],
|
|
2523
2523
|
" "
|
|
2524
2524
|
)
|
|
2525
2525
|
},
|
|
2526
2526
|
UnionTypeExtension: {
|
|
2527
|
-
leave: ({ name: e, directives: t, types: n }) =>
|
|
2527
|
+
leave: ({ name: e, directives: t, types: n }) => d(
|
|
2528
2528
|
[
|
|
2529
2529
|
"extend union",
|
|
2530
2530
|
e,
|
|
2531
|
-
|
|
2532
|
-
|
|
2531
|
+
d(t, " "),
|
|
2532
|
+
A("= ", d(n, " | "))
|
|
2533
2533
|
],
|
|
2534
2534
|
" "
|
|
2535
2535
|
)
|
|
2536
2536
|
},
|
|
2537
2537
|
EnumTypeExtension: {
|
|
2538
|
-
leave: ({ name: e, directives: t, values: n }) =>
|
|
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 }) =>
|
|
2541
|
+
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), k(n)], " ")
|
|
2542
2542
|
}
|
|
2543
2543
|
};
|
|
2544
|
-
function
|
|
2544
|
+
function d(e, t = "") {
|
|
2545
2545
|
var n;
|
|
2546
|
-
return (n = e == null ? void 0 : e.filter((
|
|
2546
|
+
return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
|
|
2547
2547
|
}
|
|
2548
2548
|
function k(e) {
|
|
2549
|
-
return
|
|
2550
|
-
`,
|
|
2549
|
+
return A(`{
|
|
2550
|
+
`, W(d(e, `
|
|
2551
2551
|
`)), `
|
|
2552
2552
|
}`);
|
|
2553
2553
|
}
|
|
2554
|
-
function
|
|
2554
|
+
function A(e, t, n = "") {
|
|
2555
2555
|
return t != null && t !== "" ? e + t + n : "";
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2558
|
-
return
|
|
2557
|
+
function W(e) {
|
|
2558
|
+
return A(" ", 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(), Ue = !0, ie = !1;
|
|
2567
2567
|
function Ge(e) {
|
|
2568
2568
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2569
2569
|
}
|
|
@@ -2572,73 +2572,73 @@ function wt(e) {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
function Ft(e) {
|
|
2574
2574
|
var t = /* @__PURE__ */ new Set(), n = [];
|
|
2575
|
-
return e.definitions.forEach(function(
|
|
2576
|
-
if (
|
|
2577
|
-
var
|
|
2578
|
-
a && !a.has(s) ?
|
|
2575
|
+
return e.definitions.forEach(function(r) {
|
|
2576
|
+
if (r.kind === "FragmentDefinition") {
|
|
2577
|
+
var i = r.name.value, s = wt(r.loc), a = ge.get(i);
|
|
2578
|
+
a && !a.has(s) ? Ue && 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
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || ge.set(
|
|
2580
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || ge.set(i, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(r));
|
|
2581
2581
|
} else
|
|
2582
|
-
n.push(
|
|
2582
|
+
n.push(r);
|
|
2583
2583
|
}), ne(ne({}, e), { definitions: n });
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
function Mt(e) {
|
|
2586
2586
|
var t = new Set(e.definitions);
|
|
2587
|
-
t.forEach(function(
|
|
2588
|
-
|
|
2589
|
-
var s = i
|
|
2587
|
+
t.forEach(function(r) {
|
|
2588
|
+
r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
|
|
2589
|
+
var s = r[i];
|
|
2590
2590
|
s && typeof s == "object" && t.add(s);
|
|
2591
2591
|
});
|
|
2592
2592
|
});
|
|
2593
2593
|
var n = e.loc;
|
|
2594
2594
|
return n && (delete n.startToken, delete n.endToken), e;
|
|
2595
2595
|
}
|
|
2596
|
-
function
|
|
2596
|
+
function Bt(e) {
|
|
2597
2597
|
var t = Ge(e);
|
|
2598
2598
|
if (!ee.has(t)) {
|
|
2599
|
-
var n =
|
|
2600
|
-
experimentalFragmentVariables:
|
|
2601
|
-
allowLegacyFragmentVariables:
|
|
2599
|
+
var n = Be(e, {
|
|
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.");
|
|
2605
|
-
ee.set(t,
|
|
2605
|
+
ee.set(t, Mt(Ft(n)));
|
|
2606
2606
|
}
|
|
2607
2607
|
return ee.get(t);
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2609
|
+
function U(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]);
|
|
2613
|
-
var
|
|
2614
|
-
return t.forEach(function(
|
|
2615
|
-
|
|
2616
|
-
}),
|
|
2613
|
+
var r = e[0];
|
|
2614
|
+
return t.forEach(function(i, s) {
|
|
2615
|
+
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
2616
|
+
}), Bt(r);
|
|
2617
2617
|
}
|
|
2618
|
-
function
|
|
2618
|
+
function qt() {
|
|
2619
2619
|
ee.clear(), ge.clear();
|
|
2620
2620
|
}
|
|
2621
|
-
function
|
|
2622
|
-
|
|
2621
|
+
function Ut() {
|
|
2622
|
+
Ue = !1;
|
|
2623
2623
|
}
|
|
2624
2624
|
function Gt() {
|
|
2625
|
-
|
|
2625
|
+
ie = !0;
|
|
2626
2626
|
}
|
|
2627
|
-
function
|
|
2628
|
-
|
|
2627
|
+
function $t() {
|
|
2628
|
+
ie = !1;
|
|
2629
2629
|
}
|
|
2630
|
-
var
|
|
2631
|
-
gql:
|
|
2632
|
-
resetCaches:
|
|
2633
|
-
disableFragmentWarnings:
|
|
2630
|
+
var V = {
|
|
2631
|
+
gql: U,
|
|
2632
|
+
resetCaches: qt,
|
|
2633
|
+
disableFragmentWarnings: Ut,
|
|
2634
2634
|
enableExperimentalFragmentVariables: Gt,
|
|
2635
|
-
disableExperimentalFragmentVariables:
|
|
2635
|
+
disableExperimentalFragmentVariables: $t
|
|
2636
2636
|
};
|
|
2637
2637
|
(function(e) {
|
|
2638
|
-
e.gql =
|
|
2639
|
-
})(
|
|
2640
|
-
|
|
2641
|
-
const
|
|
2638
|
+
e.gql = V.gql, e.resetCaches = V.resetCaches, e.disableFragmentWarnings = V.disableFragmentWarnings, e.enableExperimentalFragmentVariables = V.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = V.disableExperimentalFragmentVariables;
|
|
2639
|
+
})(U || (U = {}));
|
|
2640
|
+
U.default = U;
|
|
2641
|
+
const x = U, Vt = x`
|
|
2642
2642
|
query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2643
2643
|
locationAvailabilities(
|
|
2644
2644
|
sku: $sku
|
|
@@ -2677,7 +2677,7 @@ const N = q, $t = N`
|
|
|
2677
2677
|
}
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
-
`, jt =
|
|
2680
|
+
`, jt = x`
|
|
2681
2681
|
query GetLocationAvailability($sku: String!, $locationID: ID!) {
|
|
2682
2682
|
locationAvailability(sku: $sku, locationID: $locationID) {
|
|
2683
2683
|
location {
|
|
@@ -2703,7 +2703,7 @@ const N = q, $t = N`
|
|
|
2703
2703
|
inventoryQuantity
|
|
2704
2704
|
}
|
|
2705
2705
|
}
|
|
2706
|
-
`, Ht =
|
|
2706
|
+
`, Ht = x`
|
|
2707
2707
|
query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
|
|
2708
2708
|
purchasingCustomerMetafield(namespace: $namespace, key: $key) {
|
|
2709
2709
|
id
|
|
@@ -2712,7 +2712,7 @@ const N = q, $t = N`
|
|
|
2712
2712
|
value
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
`, Yt =
|
|
2715
|
+
`, Yt = x`
|
|
2716
2716
|
query GetPoints {
|
|
2717
2717
|
purchasingCustomer {
|
|
2718
2718
|
pointsApproved
|
|
@@ -2724,7 +2724,7 @@ const N = q, $t = N`
|
|
|
2724
2724
|
}
|
|
2725
2725
|
}
|
|
2726
2726
|
}
|
|
2727
|
-
`, zt =
|
|
2727
|
+
`, zt = x`
|
|
2728
2728
|
query GetLocations($first: Int, $after: String, $filter: LocationFilter, $isReverse: Boolean! = false) {
|
|
2729
2729
|
locations(first: $first, after: $after, filter: $filter, isReverse: $isReverse) {
|
|
2730
2730
|
nodes {
|
|
@@ -2755,7 +2755,7 @@ const N = q, $t = N`
|
|
|
2755
2755
|
}
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
|
-
`, Jt =
|
|
2758
|
+
`, Jt = x`
|
|
2759
2759
|
query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2760
2760
|
purchasingCustomer {
|
|
2761
2761
|
id
|
|
@@ -2784,14 +2784,14 @@ const N = q, $t = N`
|
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
|
-
`, Qt =
|
|
2787
|
+
`, Qt = x`
|
|
2788
2788
|
query GetPurchasingCustomerDiscountCodeCount {
|
|
2789
2789
|
purchasingCustomer {
|
|
2790
2790
|
id
|
|
2791
2791
|
orderPriceAdjustmentRuleCount
|
|
2792
2792
|
}
|
|
2793
2793
|
}
|
|
2794
|
-
`, Xt =
|
|
2794
|
+
`, Xt = x`
|
|
2795
2795
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
2796
2796
|
purchasingCustomer {
|
|
2797
2797
|
id
|
|
@@ -2851,7 +2851,7 @@ const N = q, $t = N`
|
|
|
2851
2851
|
}
|
|
2852
2852
|
}
|
|
2853
2853
|
}
|
|
2854
|
-
`,
|
|
2854
|
+
`, Kt = x`
|
|
2855
2855
|
query GetPurchasingCustomerRank {
|
|
2856
2856
|
purchasingCustomer {
|
|
2857
2857
|
currentCustomerRank {
|
|
@@ -2892,14 +2892,14 @@ const N = q, $t = N`
|
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
|
-
`,
|
|
2895
|
+
`, Zt = x`
|
|
2896
2896
|
query GetSharingPurchasingCustomerCount {
|
|
2897
2897
|
purchasingCustomer {
|
|
2898
2898
|
id
|
|
2899
2899
|
sharingPurchasingCustomerCount
|
|
2900
2900
|
}
|
|
2901
2901
|
}
|
|
2902
|
-
`,
|
|
2902
|
+
`, Wt = x`
|
|
2903
2903
|
query GetPurchasingCustomerSharing {
|
|
2904
2904
|
purchasingCustomer {
|
|
2905
2905
|
id
|
|
@@ -2916,7 +2916,7 @@ const N = q, $t = N`
|
|
|
2916
2916
|
}
|
|
2917
2917
|
}
|
|
2918
2918
|
}
|
|
2919
|
-
`, en =
|
|
2919
|
+
`, en = x`
|
|
2920
2920
|
query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
|
|
2921
2921
|
productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
|
|
2922
2922
|
id
|
|
@@ -2948,14 +2948,14 @@ const N = q, $t = N`
|
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
2950
|
}
|
|
2951
|
-
`, tn =
|
|
2951
|
+
`, tn = x`
|
|
2952
2952
|
query GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID($id: String!) {
|
|
2953
2953
|
productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
|
|
2954
2954
|
id
|
|
2955
2955
|
hasBackOrderProductVariants
|
|
2956
2956
|
}
|
|
2957
2957
|
}
|
|
2958
|
-
`, nn =
|
|
2958
|
+
`, nn = x`
|
|
2959
2959
|
query GetPointCampaignOrderRuleTargetCustomerRank {
|
|
2960
2960
|
pointCampaignOrderRuleTargetCustomerRank {
|
|
2961
2961
|
pointCampaignOrderRule {
|
|
@@ -2968,7 +2968,7 @@ const N = q, $t = N`
|
|
|
2968
2968
|
fixedPoint
|
|
2969
2969
|
}
|
|
2970
2970
|
}
|
|
2971
|
-
`, rn =
|
|
2971
|
+
`, rn = x`
|
|
2972
2972
|
query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
|
|
2973
2973
|
estimatedShopifyCartPoint(input: $input) {
|
|
2974
2974
|
pointsEarning
|
|
@@ -2984,7 +2984,7 @@ const N = q, $t = N`
|
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
2986
|
}
|
|
2987
|
-
`, sn =
|
|
2987
|
+
`, sn = x`
|
|
2988
2988
|
query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
|
|
2989
2989
|
estimatedShopifyCartLineItemPoint(input: $input) {
|
|
2990
2990
|
pointsEarning
|
|
@@ -3000,7 +3000,7 @@ const N = q, $t = N`
|
|
|
3000
3000
|
}
|
|
3001
3001
|
}
|
|
3002
3002
|
}
|
|
3003
|
-
`, an =
|
|
3003
|
+
`, an = x`
|
|
3004
3004
|
mutation PurchasingCustomerSendCustomerSharingActivationCode {
|
|
3005
3005
|
purchasingCustomerSendCustomerSharingActivationCode {
|
|
3006
3006
|
purchasingCustomer {
|
|
@@ -3016,7 +3016,7 @@ const N = q, $t = N`
|
|
|
3016
3016
|
}
|
|
3017
3017
|
}
|
|
3018
3018
|
}
|
|
3019
|
-
`, on =
|
|
3019
|
+
`, on = x`
|
|
3020
3020
|
mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
|
|
3021
3021
|
purchasingCustomerActivateCustomerSharing(
|
|
3022
3022
|
input: {email: $email, activationCode: $activationCode}
|
|
@@ -3031,122 +3031,258 @@ const N = q, $t = N`
|
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
3033
|
}
|
|
3034
|
-
`, un =
|
|
3035
|
-
|
|
3034
|
+
`, un = x`
|
|
3035
|
+
query GetMiles {
|
|
3036
|
+
purchasingCustomer {
|
|
3037
|
+
miles
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
`, cn = x`
|
|
3041
|
+
query GetPurchasingCustomerMileChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: MileChangeActivitySortKey! = CREATED_AT) {
|
|
3042
|
+
purchasingCustomer {
|
|
3043
|
+
id
|
|
3044
|
+
mileChangeActivities(
|
|
3045
|
+
first: $first
|
|
3046
|
+
after: $after
|
|
3047
|
+
isReverse: $isReverse
|
|
3048
|
+
sortKeys: $sortKeys
|
|
3049
|
+
) {
|
|
3050
|
+
nodes {
|
|
3051
|
+
id
|
|
3052
|
+
title
|
|
3053
|
+
mileChange {
|
|
3054
|
+
id
|
|
3055
|
+
delta
|
|
3056
|
+
mileChangeCreatedAt
|
|
3057
|
+
createdAt
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
pageInfo {
|
|
3061
|
+
startCursor
|
|
3062
|
+
endCursor
|
|
3063
|
+
hasNextPage
|
|
3064
|
+
hasPreviousPage
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
`, ln = x`
|
|
3070
|
+
query GetMileItems($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ShopifyMileItemSortKey! = CREATED_AT) {
|
|
3071
|
+
mileItems(
|
|
3072
|
+
first: $first
|
|
3073
|
+
after: $after
|
|
3074
|
+
isReverse: $isReverse
|
|
3075
|
+
sortKeys: $sortKeys
|
|
3076
|
+
) {
|
|
3077
|
+
nodes {
|
|
3078
|
+
id
|
|
3079
|
+
title
|
|
3080
|
+
description
|
|
3081
|
+
miles
|
|
3082
|
+
sku
|
|
3083
|
+
isActive
|
|
3084
|
+
isScheduled
|
|
3085
|
+
customerExchangeable
|
|
3086
|
+
startsAt
|
|
3087
|
+
endsAt
|
|
3088
|
+
}
|
|
3089
|
+
pageInfo {
|
|
3090
|
+
startCursor
|
|
3091
|
+
endCursor
|
|
3092
|
+
hasNextPage
|
|
3093
|
+
hasPreviousPage
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
`, dn = x`
|
|
3098
|
+
query GetMileOrders($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: MileOrderSortKey! = CREATED_AT) {
|
|
3099
|
+
purchasingCustomer {
|
|
3100
|
+
id
|
|
3101
|
+
mileOrders(
|
|
3102
|
+
first: $first
|
|
3103
|
+
after: $after
|
|
3104
|
+
isReverse: $isReverse
|
|
3105
|
+
sortKeys: $sortKeys
|
|
3106
|
+
) {
|
|
3107
|
+
nodes {
|
|
3108
|
+
id
|
|
3109
|
+
mileItem {
|
|
3110
|
+
id
|
|
3111
|
+
title
|
|
3112
|
+
description
|
|
3113
|
+
miles
|
|
3114
|
+
sku
|
|
3115
|
+
isActive
|
|
3116
|
+
isScheduled
|
|
3117
|
+
customerExchangeable
|
|
3118
|
+
startsAt
|
|
3119
|
+
endsAt
|
|
3120
|
+
}
|
|
3121
|
+
miles
|
|
3122
|
+
exchangedAt
|
|
3123
|
+
}
|
|
3124
|
+
pageInfo {
|
|
3125
|
+
startCursor
|
|
3126
|
+
endCursor
|
|
3127
|
+
hasNextPage
|
|
3128
|
+
hasPreviousPage
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
`, pn = x`
|
|
3134
|
+
mutation MileItemExchange($mileItemID: ID!) {
|
|
3135
|
+
mileItemExchange(input: {mileItemID: $mileItemID}) {
|
|
3136
|
+
mileOrder {
|
|
3137
|
+
id
|
|
3138
|
+
mileItem {
|
|
3139
|
+
id
|
|
3140
|
+
title
|
|
3141
|
+
description
|
|
3142
|
+
miles
|
|
3143
|
+
sku
|
|
3144
|
+
isActive
|
|
3145
|
+
isScheduled
|
|
3146
|
+
customerExchangeable
|
|
3147
|
+
startsAt
|
|
3148
|
+
endsAt
|
|
3149
|
+
}
|
|
3150
|
+
miles
|
|
3151
|
+
exchangedAt
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
`, hn = (e, t, n, r) => e();
|
|
3156
|
+
function mn(e, t = hn) {
|
|
3036
3157
|
return {
|
|
3037
|
-
GetLocationAvailabilities(n,
|
|
3038
|
-
return t((
|
|
3158
|
+
GetLocationAvailabilities(n, r) {
|
|
3159
|
+
return t((i) => e.request(Vt, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
|
|
3039
3160
|
},
|
|
3040
|
-
GetLocationAvailability(n,
|
|
3041
|
-
return t((
|
|
3161
|
+
GetLocationAvailability(n, r) {
|
|
3162
|
+
return t((i) => e.request(jt, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
|
|
3042
3163
|
},
|
|
3043
|
-
GetPurchasingCustomerMetafield(n,
|
|
3044
|
-
return t((
|
|
3164
|
+
GetPurchasingCustomerMetafield(n, r) {
|
|
3165
|
+
return t((i) => e.request(Ht, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
|
|
3045
3166
|
},
|
|
3046
|
-
GetPoints(n,
|
|
3047
|
-
return t((
|
|
3167
|
+
GetPoints(n, r) {
|
|
3168
|
+
return t((i) => e.request(Yt, n, { ...r, ...i }), "GetPoints", "query", n);
|
|
3048
3169
|
},
|
|
3049
|
-
GetLocations(n,
|
|
3050
|
-
return t((
|
|
3170
|
+
GetLocations(n, r) {
|
|
3171
|
+
return t((i) => e.request(zt, n, { ...r, ...i }), "GetLocations", "query", n);
|
|
3051
3172
|
},
|
|
3052
|
-
GetPurchasingCustomerDiscounts(n,
|
|
3053
|
-
return t((
|
|
3173
|
+
GetPurchasingCustomerDiscounts(n, r) {
|
|
3174
|
+
return t((i) => e.request(Jt, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
|
|
3054
3175
|
},
|
|
3055
|
-
GetPurchasingCustomerDiscountCodeCount(n,
|
|
3056
|
-
return t((
|
|
3176
|
+
GetPurchasingCustomerDiscountCodeCount(n, r) {
|
|
3177
|
+
return t((i) => e.request(Qt, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
|
|
3057
3178
|
},
|
|
3058
|
-
GetPurchasingCustomerPointChangeActivities(n,
|
|
3059
|
-
return t((
|
|
3179
|
+
GetPurchasingCustomerPointChangeActivities(n, r) {
|
|
3180
|
+
return t((i) => e.request(Xt, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
|
|
3060
3181
|
},
|
|
3061
|
-
GetPurchasingCustomerRank(n,
|
|
3062
|
-
return t((
|
|
3182
|
+
GetPurchasingCustomerRank(n, r) {
|
|
3183
|
+
return t((i) => e.request(Kt, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
|
|
3063
3184
|
},
|
|
3064
|
-
GetSharingPurchasingCustomerCount(n,
|
|
3065
|
-
return t((
|
|
3185
|
+
GetSharingPurchasingCustomerCount(n, r) {
|
|
3186
|
+
return t((i) => e.request(Zt, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
|
|
3066
3187
|
},
|
|
3067
|
-
GetPurchasingCustomerSharing(n,
|
|
3068
|
-
return t((
|
|
3188
|
+
GetPurchasingCustomerSharing(n, r) {
|
|
3189
|
+
return t((i) => e.request(Wt, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
|
|
3069
3190
|
},
|
|
3070
|
-
GetProduct(n,
|
|
3071
|
-
return t((
|
|
3191
|
+
GetProduct(n, r) {
|
|
3192
|
+
return t((i) => e.request(en, n, { ...r, ...i }), "GetProduct", "query", n);
|
|
3072
3193
|
},
|
|
3073
|
-
GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n,
|
|
3074
|
-
return t((
|
|
3194
|
+
GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n, r) {
|
|
3195
|
+
return t((i) => e.request(tn, n, { ...r, ...i }), "GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID", "query", n);
|
|
3075
3196
|
},
|
|
3076
|
-
GetPointCampaignOrderRuleTargetCustomerRank(n,
|
|
3077
|
-
return t((
|
|
3197
|
+
GetPointCampaignOrderRuleTargetCustomerRank(n, r) {
|
|
3198
|
+
return t((i) => e.request(nn, n, { ...r, ...i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
|
|
3078
3199
|
},
|
|
3079
|
-
GetEstimatedShopifyCartPoint(n,
|
|
3080
|
-
return t((
|
|
3200
|
+
GetEstimatedShopifyCartPoint(n, r) {
|
|
3201
|
+
return t((i) => e.request(rn, n, { ...r, ...i }), "GetEstimatedShopifyCartPoint", "query", n);
|
|
3081
3202
|
},
|
|
3082
|
-
GetEstimatedShopifyCartLineItemPoint(n,
|
|
3083
|
-
return t((
|
|
3203
|
+
GetEstimatedShopifyCartLineItemPoint(n, r) {
|
|
3204
|
+
return t((i) => e.request(sn, n, { ...r, ...i }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
|
|
3084
3205
|
},
|
|
3085
|
-
PurchasingCustomerSendCustomerSharingActivationCode(n,
|
|
3086
|
-
return t((
|
|
3206
|
+
PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
|
|
3207
|
+
return t((i) => e.request(an, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
|
|
3087
3208
|
},
|
|
3088
|
-
PurchasingCustomerActivateCustomerSharing(n,
|
|
3089
|
-
return t((
|
|
3209
|
+
PurchasingCustomerActivateCustomerSharing(n, r) {
|
|
3210
|
+
return t((i) => e.request(on, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
|
|
3211
|
+
},
|
|
3212
|
+
GetMiles(n, r) {
|
|
3213
|
+
return t((i) => e.request(un, n, { ...r, ...i }), "GetMiles", "query", n);
|
|
3214
|
+
},
|
|
3215
|
+
GetPurchasingCustomerMileChangeActivities(n, r) {
|
|
3216
|
+
return t((i) => e.request(cn, n, { ...r, ...i }), "GetPurchasingCustomerMileChangeActivities", "query", n);
|
|
3217
|
+
},
|
|
3218
|
+
GetMileItems(n, r) {
|
|
3219
|
+
return t((i) => e.request(ln, n, { ...r, ...i }), "GetMileItems", "query", n);
|
|
3220
|
+
},
|
|
3221
|
+
GetMileOrders(n, r) {
|
|
3222
|
+
return t((i) => e.request(dn, n, { ...r, ...i }), "GetMileOrders", "query", n);
|
|
3223
|
+
},
|
|
3224
|
+
MileItemExchange(n, r) {
|
|
3225
|
+
return t((i) => e.request(pn, n, { ...r, ...i }), "MileItemExchange", "mutation", n);
|
|
3090
3226
|
}
|
|
3091
3227
|
};
|
|
3092
3228
|
}
|
|
3093
|
-
const
|
|
3229
|
+
const Ae = JSON, fn = (e) => e.toUpperCase(), gn = (e) => {
|
|
3094
3230
|
const t = {};
|
|
3095
|
-
return e.forEach((n,
|
|
3096
|
-
t[
|
|
3231
|
+
return e.forEach((n, r) => {
|
|
3232
|
+
t[r] = n;
|
|
3097
3233
|
}), t;
|
|
3098
|
-
},
|
|
3234
|
+
}, yn = (e, t, n) => e.document ? e : {
|
|
3099
3235
|
document: e,
|
|
3100
3236
|
variables: t,
|
|
3101
3237
|
requestHeaders: n,
|
|
3102
3238
|
signal: void 0
|
|
3103
|
-
},
|
|
3239
|
+
}, Cn = (e, t, n) => e.query ? e : {
|
|
3104
3240
|
query: e,
|
|
3105
3241
|
variables: t,
|
|
3106
3242
|
requestHeaders: n,
|
|
3107
3243
|
signal: void 0
|
|
3108
|
-
},
|
|
3244
|
+
}, En = (e, t) => e.documents ? e : {
|
|
3109
3245
|
documents: e,
|
|
3110
3246
|
requestHeaders: t,
|
|
3111
3247
|
signal: void 0
|
|
3112
|
-
},
|
|
3113
|
-
var
|
|
3248
|
+
}, Oe = (e) => {
|
|
3249
|
+
var r, i;
|
|
3114
3250
|
let t;
|
|
3115
3251
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
3116
|
-
return n.length === 1 && (t = (
|
|
3117
|
-
},
|
|
3252
|
+
return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
|
|
3253
|
+
}, le = (e) => {
|
|
3118
3254
|
if (typeof e == "string") {
|
|
3119
3255
|
let n;
|
|
3120
3256
|
try {
|
|
3121
|
-
const
|
|
3122
|
-
n =
|
|
3257
|
+
const r = Be(e);
|
|
3258
|
+
n = Oe(r);
|
|
3123
3259
|
} catch {
|
|
3124
3260
|
}
|
|
3125
3261
|
return { query: e, operationName: n };
|
|
3126
3262
|
}
|
|
3127
|
-
const t =
|
|
3263
|
+
const t = Oe(e);
|
|
3128
3264
|
return { query: kt(e), operationName: t };
|
|
3129
3265
|
};
|
|
3130
3266
|
class H extends Error {
|
|
3131
3267
|
constructor(t, n) {
|
|
3132
|
-
const
|
|
3268
|
+
const r = `${H.extractMessage(t)}: ${JSON.stringify({
|
|
3133
3269
|
response: t,
|
|
3134
3270
|
request: n
|
|
3135
3271
|
})}`;
|
|
3136
|
-
super(
|
|
3272
|
+
super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
|
|
3137
3273
|
}
|
|
3138
3274
|
static extractMessage(t) {
|
|
3139
|
-
var n,
|
|
3140
|
-
return ((
|
|
3275
|
+
var n, r;
|
|
3276
|
+
return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
3141
3277
|
}
|
|
3142
3278
|
}
|
|
3143
|
-
var
|
|
3144
|
-
function
|
|
3279
|
+
var An = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3280
|
+
function vn(e) {
|
|
3145
3281
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3146
3282
|
}
|
|
3147
3283
|
var ye = { exports: {} };
|
|
3148
3284
|
(function(e, t) {
|
|
3149
|
-
var n = typeof self < "u" ? self :
|
|
3285
|
+
var n = typeof self < "u" ? self : An, r = function() {
|
|
3150
3286
|
function s() {
|
|
3151
3287
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
3152
3288
|
}
|
|
@@ -3181,7 +3317,7 @@ var ye = { exports: {} };
|
|
|
3181
3317
|
"[object Uint32Array]",
|
|
3182
3318
|
"[object Float32Array]",
|
|
3183
3319
|
"[object Float64Array]"
|
|
3184
|
-
],
|
|
3320
|
+
], f = ArrayBuffer.isView || function(o) {
|
|
3185
3321
|
return o && h.indexOf(Object.prototype.toString.call(o)) > -1;
|
|
3186
3322
|
};
|
|
3187
3323
|
function y(o) {
|
|
@@ -3192,95 +3328,95 @@ var ye = { exports: {} };
|
|
|
3192
3328
|
function C(o) {
|
|
3193
3329
|
return typeof o != "string" && (o = String(o)), o;
|
|
3194
3330
|
}
|
|
3195
|
-
function
|
|
3196
|
-
var
|
|
3331
|
+
function I(o) {
|
|
3332
|
+
var l = {
|
|
3197
3333
|
next: function() {
|
|
3198
3334
|
var E = o.shift();
|
|
3199
3335
|
return { done: E === void 0, value: E };
|
|
3200
3336
|
}
|
|
3201
3337
|
};
|
|
3202
|
-
return c.iterable && (
|
|
3203
|
-
return
|
|
3204
|
-
}),
|
|
3338
|
+
return c.iterable && (l[Symbol.iterator] = function() {
|
|
3339
|
+
return l;
|
|
3340
|
+
}), l;
|
|
3205
3341
|
}
|
|
3206
3342
|
function g(o) {
|
|
3207
|
-
this.map = {}, o instanceof g ? o.forEach(function(
|
|
3208
|
-
this.append(E,
|
|
3209
|
-
}, this) : Array.isArray(o) ? o.forEach(function(
|
|
3210
|
-
this.append(
|
|
3211
|
-
}, this) : o && Object.getOwnPropertyNames(o).forEach(function(
|
|
3212
|
-
this.append(
|
|
3343
|
+
this.map = {}, o instanceof g ? o.forEach(function(l, E) {
|
|
3344
|
+
this.append(E, l);
|
|
3345
|
+
}, this) : Array.isArray(o) ? o.forEach(function(l) {
|
|
3346
|
+
this.append(l[0], l[1]);
|
|
3347
|
+
}, this) : o && Object.getOwnPropertyNames(o).forEach(function(l) {
|
|
3348
|
+
this.append(l, o[l]);
|
|
3213
3349
|
}, this);
|
|
3214
3350
|
}
|
|
3215
|
-
g.prototype.append = function(o,
|
|
3216
|
-
o = y(o),
|
|
3351
|
+
g.prototype.append = function(o, l) {
|
|
3352
|
+
o = y(o), l = C(l);
|
|
3217
3353
|
var E = this.map[o];
|
|
3218
|
-
this.map[o] = E ? E + ", " +
|
|
3354
|
+
this.map[o] = E ? E + ", " + l : l;
|
|
3219
3355
|
}, g.prototype.delete = function(o) {
|
|
3220
3356
|
delete this.map[y(o)];
|
|
3221
3357
|
}, g.prototype.get = function(o) {
|
|
3222
3358
|
return o = y(o), this.has(o) ? this.map[o] : null;
|
|
3223
3359
|
}, g.prototype.has = function(o) {
|
|
3224
3360
|
return this.map.hasOwnProperty(y(o));
|
|
3225
|
-
}, g.prototype.set = function(o,
|
|
3226
|
-
this.map[y(o)] = C(
|
|
3227
|
-
}, g.prototype.forEach = function(o,
|
|
3361
|
+
}, g.prototype.set = function(o, l) {
|
|
3362
|
+
this.map[y(o)] = C(l);
|
|
3363
|
+
}, g.prototype.forEach = function(o, l) {
|
|
3228
3364
|
for (var E in this.map)
|
|
3229
|
-
this.map.hasOwnProperty(E) && o.call(
|
|
3365
|
+
this.map.hasOwnProperty(E) && o.call(l, this.map[E], E, this);
|
|
3230
3366
|
}, g.prototype.keys = function() {
|
|
3231
3367
|
var o = [];
|
|
3232
|
-
return this.forEach(function(
|
|
3368
|
+
return this.forEach(function(l, E) {
|
|
3233
3369
|
o.push(E);
|
|
3234
|
-
}),
|
|
3370
|
+
}), I(o);
|
|
3235
3371
|
}, g.prototype.values = function() {
|
|
3236
3372
|
var o = [];
|
|
3237
|
-
return this.forEach(function(
|
|
3238
|
-
o.push(
|
|
3239
|
-
}),
|
|
3373
|
+
return this.forEach(function(l) {
|
|
3374
|
+
o.push(l);
|
|
3375
|
+
}), I(o);
|
|
3240
3376
|
}, g.prototype.entries = function() {
|
|
3241
3377
|
var o = [];
|
|
3242
|
-
return this.forEach(function(
|
|
3243
|
-
o.push([E,
|
|
3244
|
-
}),
|
|
3378
|
+
return this.forEach(function(l, E) {
|
|
3379
|
+
o.push([E, l]);
|
|
3380
|
+
}), I(o);
|
|
3245
3381
|
}, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
|
|
3246
|
-
function
|
|
3382
|
+
function T(o) {
|
|
3247
3383
|
if (o.bodyUsed)
|
|
3248
3384
|
return Promise.reject(new TypeError("Already read"));
|
|
3249
3385
|
o.bodyUsed = !0;
|
|
3250
3386
|
}
|
|
3251
3387
|
function P(o) {
|
|
3252
|
-
return new Promise(function(
|
|
3388
|
+
return new Promise(function(l, E) {
|
|
3253
3389
|
o.onload = function() {
|
|
3254
|
-
|
|
3390
|
+
l(o.result);
|
|
3255
3391
|
}, o.onerror = function() {
|
|
3256
3392
|
E(o.error);
|
|
3257
3393
|
};
|
|
3258
3394
|
});
|
|
3259
3395
|
}
|
|
3260
|
-
function
|
|
3261
|
-
var
|
|
3262
|
-
return
|
|
3396
|
+
function D(o) {
|
|
3397
|
+
var l = new FileReader(), E = P(l);
|
|
3398
|
+
return l.readAsArrayBuffer(o), E;
|
|
3263
3399
|
}
|
|
3264
3400
|
function z(o) {
|
|
3265
|
-
var
|
|
3266
|
-
return
|
|
3401
|
+
var l = new FileReader(), E = P(l);
|
|
3402
|
+
return l.readAsText(o), E;
|
|
3267
3403
|
}
|
|
3268
3404
|
function _(o) {
|
|
3269
|
-
for (var
|
|
3270
|
-
E[
|
|
3405
|
+
for (var l = new Uint8Array(o), E = new Array(l.length), N = 0; N < l.length; N++)
|
|
3406
|
+
E[N] = String.fromCharCode(l[N]);
|
|
3271
3407
|
return E.join("");
|
|
3272
3408
|
}
|
|
3273
|
-
function
|
|
3409
|
+
function b(o) {
|
|
3274
3410
|
if (o.slice)
|
|
3275
3411
|
return o.slice(0);
|
|
3276
|
-
var
|
|
3277
|
-
return
|
|
3412
|
+
var l = new Uint8Array(o.byteLength);
|
|
3413
|
+
return l.set(new Uint8Array(o)), l.buffer;
|
|
3278
3414
|
}
|
|
3279
|
-
function
|
|
3415
|
+
function M() {
|
|
3280
3416
|
return this.bodyUsed = !1, this._initBody = function(o) {
|
|
3281
|
-
this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : c.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : c.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : c.arrayBuffer && c.blob && p(o) ? (this._bodyArrayBuffer =
|
|
3417
|
+
this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : c.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : c.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : c.arrayBuffer && c.blob && p(o) ? (this._bodyArrayBuffer = b(o.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(o) || f(o)) ? this._bodyArrayBuffer = b(o) : this._bodyText = o = Object.prototype.toString.call(o) : this._bodyText = "", this.headers.get("content-type") || (typeof o == "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(o) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
3282
3418
|
}, c.blob && (this.blob = function() {
|
|
3283
|
-
var o =
|
|
3419
|
+
var o = T(this);
|
|
3284
3420
|
if (o)
|
|
3285
3421
|
return o;
|
|
3286
3422
|
if (this._bodyBlob)
|
|
@@ -3291,9 +3427,9 @@ var ye = { exports: {} };
|
|
|
3291
3427
|
throw new Error("could not read FormData body as blob");
|
|
3292
3428
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
3293
3429
|
}, this.arrayBuffer = function() {
|
|
3294
|
-
return this._bodyArrayBuffer ?
|
|
3430
|
+
return this._bodyArrayBuffer ? T(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
|
|
3295
3431
|
}), this.text = function() {
|
|
3296
|
-
var o =
|
|
3432
|
+
var o = T(this);
|
|
3297
3433
|
if (o)
|
|
3298
3434
|
return o;
|
|
3299
3435
|
if (this._bodyBlob)
|
|
@@ -3304,56 +3440,56 @@ var ye = { exports: {} };
|
|
|
3304
3440
|
throw new Error("could not read FormData body as text");
|
|
3305
3441
|
return Promise.resolve(this._bodyText);
|
|
3306
3442
|
}, c.formData && (this.formData = function() {
|
|
3307
|
-
return this.text().then(
|
|
3443
|
+
return this.text().then($e);
|
|
3308
3444
|
}), this.json = function() {
|
|
3309
3445
|
return this.text().then(JSON.parse);
|
|
3310
3446
|
}, this;
|
|
3311
3447
|
}
|
|
3312
3448
|
var J = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
3313
3449
|
function Q(o) {
|
|
3314
|
-
var
|
|
3315
|
-
return J.indexOf(
|
|
3450
|
+
var l = o.toUpperCase();
|
|
3451
|
+
return J.indexOf(l) > -1 ? l : o;
|
|
3316
3452
|
}
|
|
3317
|
-
function w(o,
|
|
3318
|
-
|
|
3319
|
-
var E =
|
|
3453
|
+
function w(o, l) {
|
|
3454
|
+
l = l || {};
|
|
3455
|
+
var E = l.body;
|
|
3320
3456
|
if (o instanceof w) {
|
|
3321
3457
|
if (o.bodyUsed)
|
|
3322
3458
|
throw new TypeError("Already read");
|
|
3323
|
-
this.url = o.url, this.credentials = o.credentials,
|
|
3459
|
+
this.url = o.url, this.credentials = o.credentials, l.headers || (this.headers = new g(o.headers)), this.method = o.method, this.mode = o.mode, this.signal = o.signal, !E && o._bodyInit != null && (E = o._bodyInit, o.bodyUsed = !0);
|
|
3324
3460
|
} else
|
|
3325
3461
|
this.url = String(o);
|
|
3326
|
-
if (this.credentials =
|
|
3462
|
+
if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(l.headers)), this.method = Q(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
|
|
3327
3463
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
3328
3464
|
this._initBody(E);
|
|
3329
3465
|
}
|
|
3330
3466
|
w.prototype.clone = function() {
|
|
3331
3467
|
return new w(this, { body: this._bodyInit });
|
|
3332
3468
|
};
|
|
3333
|
-
function
|
|
3334
|
-
var
|
|
3469
|
+
function $e(o) {
|
|
3470
|
+
var l = new FormData();
|
|
3335
3471
|
return o.trim().split("&").forEach(function(E) {
|
|
3336
3472
|
if (E) {
|
|
3337
|
-
var
|
|
3338
|
-
|
|
3473
|
+
var N = E.split("="), O = N.shift().replace(/\+/g, " "), v = N.join("=").replace(/\+/g, " ");
|
|
3474
|
+
l.append(decodeURIComponent(O), decodeURIComponent(v));
|
|
3339
3475
|
}
|
|
3340
|
-
}),
|
|
3476
|
+
}), l;
|
|
3341
3477
|
}
|
|
3342
|
-
function
|
|
3343
|
-
var
|
|
3344
|
-
return E.split(/\r?\n/).forEach(function(
|
|
3345
|
-
var
|
|
3346
|
-
if (
|
|
3347
|
-
var X =
|
|
3348
|
-
|
|
3478
|
+
function Ve(o) {
|
|
3479
|
+
var l = new g(), E = o.replace(/\r?\n[\t ]+/g, " ");
|
|
3480
|
+
return E.split(/\r?\n/).forEach(function(N) {
|
|
3481
|
+
var O = N.split(":"), v = O.shift().trim();
|
|
3482
|
+
if (v) {
|
|
3483
|
+
var X = O.join(":").trim();
|
|
3484
|
+
l.append(v, X);
|
|
3349
3485
|
}
|
|
3350
|
-
}),
|
|
3486
|
+
}), l;
|
|
3351
3487
|
}
|
|
3352
|
-
|
|
3353
|
-
function L(o,
|
|
3354
|
-
|
|
3488
|
+
M.call(w.prototype);
|
|
3489
|
+
function L(o, l) {
|
|
3490
|
+
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(o);
|
|
3355
3491
|
}
|
|
3356
|
-
|
|
3492
|
+
M.call(L.prototype), L.prototype.clone = function() {
|
|
3357
3493
|
return new L(this._bodyInit, {
|
|
3358
3494
|
status: this.status,
|
|
3359
3495
|
statusText: this.statusText,
|
|
@@ -3365,86 +3501,86 @@ var ye = { exports: {} };
|
|
|
3365
3501
|
return o.type = "error", o;
|
|
3366
3502
|
};
|
|
3367
3503
|
var je = [301, 302, 303, 307, 308];
|
|
3368
|
-
L.redirect = function(o,
|
|
3369
|
-
if (je.indexOf(
|
|
3504
|
+
L.redirect = function(o, l) {
|
|
3505
|
+
if (je.indexOf(l) === -1)
|
|
3370
3506
|
throw new RangeError("Invalid status code");
|
|
3371
|
-
return new L(null, { status:
|
|
3507
|
+
return new L(null, { status: l, headers: { location: o } });
|
|
3372
3508
|
}, a.DOMException = s.DOMException;
|
|
3373
3509
|
try {
|
|
3374
3510
|
new a.DOMException();
|
|
3375
3511
|
} catch {
|
|
3376
|
-
a.DOMException = function(
|
|
3377
|
-
this.message =
|
|
3378
|
-
var
|
|
3379
|
-
this.stack =
|
|
3512
|
+
a.DOMException = function(l, E) {
|
|
3513
|
+
this.message = l, this.name = E;
|
|
3514
|
+
var N = Error(l);
|
|
3515
|
+
this.stack = N.stack;
|
|
3380
3516
|
}, a.DOMException.prototype = Object.create(Error.prototype), a.DOMException.prototype.constructor = a.DOMException;
|
|
3381
3517
|
}
|
|
3382
|
-
function oe(o,
|
|
3383
|
-
return new Promise(function(E,
|
|
3384
|
-
var
|
|
3385
|
-
if (
|
|
3386
|
-
return
|
|
3387
|
-
var
|
|
3518
|
+
function oe(o, l) {
|
|
3519
|
+
return new Promise(function(E, N) {
|
|
3520
|
+
var O = new w(o, l);
|
|
3521
|
+
if (O.signal && O.signal.aborted)
|
|
3522
|
+
return N(new a.DOMException("Aborted", "AbortError"));
|
|
3523
|
+
var v = new XMLHttpRequest();
|
|
3388
3524
|
function X() {
|
|
3389
|
-
|
|
3525
|
+
v.abort();
|
|
3390
3526
|
}
|
|
3391
|
-
|
|
3392
|
-
var
|
|
3393
|
-
status:
|
|
3394
|
-
statusText:
|
|
3395
|
-
headers:
|
|
3527
|
+
v.onload = function() {
|
|
3528
|
+
var $ = {
|
|
3529
|
+
status: v.status,
|
|
3530
|
+
statusText: v.statusText,
|
|
3531
|
+
headers: Ve(v.getAllResponseHeaders() || "")
|
|
3396
3532
|
};
|
|
3397
|
-
|
|
3398
|
-
var ue = "response" in
|
|
3399
|
-
E(new L(ue,
|
|
3400
|
-
},
|
|
3401
|
-
|
|
3402
|
-
},
|
|
3403
|
-
|
|
3404
|
-
},
|
|
3405
|
-
|
|
3406
|
-
},
|
|
3407
|
-
|
|
3408
|
-
}),
|
|
3409
|
-
|
|
3410
|
-
}),
|
|
3533
|
+
$.url = "responseURL" in v ? v.responseURL : $.headers.get("X-Request-URL");
|
|
3534
|
+
var ue = "response" in v ? v.response : v.responseText;
|
|
3535
|
+
E(new L(ue, $));
|
|
3536
|
+
}, v.onerror = function() {
|
|
3537
|
+
N(new TypeError("Network request failed"));
|
|
3538
|
+
}, v.ontimeout = function() {
|
|
3539
|
+
N(new TypeError("Network request failed"));
|
|
3540
|
+
}, v.onabort = function() {
|
|
3541
|
+
N(new a.DOMException("Aborted", "AbortError"));
|
|
3542
|
+
}, v.open(O.method, O.url, !0), O.credentials === "include" ? v.withCredentials = !0 : O.credentials === "omit" && (v.withCredentials = !1), "responseType" in v && c.blob && (v.responseType = "blob"), O.headers.forEach(function($, ue) {
|
|
3543
|
+
v.setRequestHeader(ue, $);
|
|
3544
|
+
}), O.signal && (O.signal.addEventListener("abort", X), v.onreadystatechange = function() {
|
|
3545
|
+
v.readyState === 4 && O.signal.removeEventListener("abort", X);
|
|
3546
|
+
}), v.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
|
|
3411
3547
|
});
|
|
3412
3548
|
}
|
|
3413
3549
|
return oe.polyfill = !0, s.fetch || (s.fetch = oe, s.Headers = g, s.Request = w, s.Response = L), a.Headers = g, a.Request = w, a.Response = L, a.fetch = oe, Object.defineProperty(a, "__esModule", { value: !0 }), a;
|
|
3414
3550
|
})({});
|
|
3415
|
-
})(
|
|
3416
|
-
var
|
|
3417
|
-
t =
|
|
3551
|
+
})(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
|
|
3552
|
+
var i = r;
|
|
3553
|
+
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;
|
|
3418
3554
|
})(ye, ye.exports);
|
|
3419
|
-
var
|
|
3420
|
-
const te = /* @__PURE__ */
|
|
3555
|
+
var re = ye.exports;
|
|
3556
|
+
const te = /* @__PURE__ */ vn(re), In = /* @__PURE__ */ ze({
|
|
3421
3557
|
__proto__: null,
|
|
3422
3558
|
default: te
|
|
3423
|
-
}, [
|
|
3559
|
+
}, [re]), B = (e) => {
|
|
3424
3560
|
let t = {};
|
|
3425
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
3426
|
-
n &&
|
|
3561
|
+
return e && (typeof Headers < "u" && e instanceof Headers || In && re.Headers && e instanceof re.Headers ? t = gn(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
|
|
3562
|
+
n && r !== void 0 && (t[n] = r);
|
|
3427
3563
|
}) : t = e), t;
|
|
3428
|
-
},
|
|
3564
|
+
}, Ne = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Tn = (e) => {
|
|
3429
3565
|
if (!Array.isArray(e.query)) {
|
|
3430
|
-
const
|
|
3431
|
-
return e.variables &&
|
|
3566
|
+
const r = e, i = [`query=${encodeURIComponent(Ne(r.query))}`];
|
|
3567
|
+
return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
|
|
3432
3568
|
}
|
|
3433
3569
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
3434
3570
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
3435
|
-
const t = e, n = e.query.reduce((
|
|
3436
|
-
query:
|
|
3571
|
+
const t = e, n = e.query.reduce((r, i, s) => (r.push({
|
|
3572
|
+
query: Ne(i),
|
|
3437
3573
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
3438
|
-
}),
|
|
3574
|
+
}), r), []);
|
|
3439
3575
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
3440
|
-
},
|
|
3441
|
-
const { url: n, query:
|
|
3442
|
-
let
|
|
3443
|
-
e === "POST" ? (y =
|
|
3444
|
-
query:
|
|
3445
|
-
variables:
|
|
3576
|
+
}, xn = (e) => async (t) => {
|
|
3577
|
+
const { url: n, query: r, variables: i, operationName: s, fetch: a, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
|
|
3578
|
+
let f = "", y;
|
|
3579
|
+
e === "POST" ? (y = Rn(r, i, s, c.jsonSerializer), typeof y == "string" && (h["Content-Type"] = "application/json")) : f = Tn({
|
|
3580
|
+
query: r,
|
|
3581
|
+
variables: i,
|
|
3446
3582
|
operationName: s,
|
|
3447
|
-
jsonSerializer: c.jsonSerializer ??
|
|
3583
|
+
jsonSerializer: c.jsonSerializer ?? Ae
|
|
3448
3584
|
});
|
|
3449
3585
|
const C = {
|
|
3450
3586
|
method: e,
|
|
@@ -3452,31 +3588,31 @@ const te = /* @__PURE__ */ gn(ie), yn = /* @__PURE__ */ ze({
|
|
|
3452
3588
|
body: y,
|
|
3453
3589
|
...c
|
|
3454
3590
|
};
|
|
3455
|
-
let
|
|
3591
|
+
let I = n, g = C;
|
|
3456
3592
|
if (p) {
|
|
3457
|
-
const
|
|
3458
|
-
|
|
3593
|
+
const T = await Promise.resolve(p({ ...C, url: n, operationName: s, variables: i })), { url: P, ...D } = T;
|
|
3594
|
+
I = P, g = D;
|
|
3459
3595
|
}
|
|
3460
|
-
return
|
|
3596
|
+
return f && (I = `${I}?${f}`), await a(I, g);
|
|
3461
3597
|
};
|
|
3462
|
-
class
|
|
3598
|
+
class Sn {
|
|
3463
3599
|
constructor(t, n = {}) {
|
|
3464
|
-
this.url = t, this.requestConfig = n, this.rawRequest = async (...
|
|
3465
|
-
const [
|
|
3466
|
-
c.signal !== void 0 && (
|
|
3467
|
-
const { operationName:
|
|
3468
|
-
return
|
|
3600
|
+
this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
|
|
3601
|
+
const [i, s, a] = r, c = Cn(i, s, a), { headers: p, fetch: h = te, method: f = "POST", requestMiddleware: y, responseMiddleware: C, ...I } = this.requestConfig, { url: g } = this;
|
|
3602
|
+
c.signal !== void 0 && (I.signal = c.signal);
|
|
3603
|
+
const { operationName: T } = le(c.query);
|
|
3604
|
+
return de({
|
|
3469
3605
|
url: g,
|
|
3470
3606
|
query: c.query,
|
|
3471
3607
|
variables: c.variables,
|
|
3472
3608
|
headers: {
|
|
3473
|
-
...
|
|
3474
|
-
...
|
|
3609
|
+
...B(pe(p)),
|
|
3610
|
+
...B(c.requestHeaders)
|
|
3475
3611
|
},
|
|
3476
|
-
operationName:
|
|
3612
|
+
operationName: T,
|
|
3477
3613
|
fetch: h,
|
|
3478
|
-
method:
|
|
3479
|
-
fetchOptions:
|
|
3614
|
+
method: f,
|
|
3615
|
+
fetchOptions: I,
|
|
3480
3616
|
middleware: y
|
|
3481
3617
|
}).then((P) => (C && C(P), P)).catch((P) => {
|
|
3482
3618
|
throw C && C(P), P;
|
|
@@ -3484,39 +3620,39 @@ class vn {
|
|
|
3484
3620
|
};
|
|
3485
3621
|
}
|
|
3486
3622
|
async request(t, ...n) {
|
|
3487
|
-
const [
|
|
3623
|
+
const [r, i] = n, s = yn(t, r, i), { headers: a, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: f, ...y } = this.requestConfig, { url: C } = this;
|
|
3488
3624
|
s.signal !== void 0 && (y.signal = s.signal);
|
|
3489
|
-
const { query:
|
|
3490
|
-
return
|
|
3625
|
+
const { query: I, operationName: g } = le(s.document);
|
|
3626
|
+
return de({
|
|
3491
3627
|
url: C,
|
|
3492
|
-
query:
|
|
3628
|
+
query: I,
|
|
3493
3629
|
variables: s.variables,
|
|
3494
3630
|
headers: {
|
|
3495
|
-
...
|
|
3496
|
-
...
|
|
3631
|
+
...B(pe(a)),
|
|
3632
|
+
...B(s.requestHeaders)
|
|
3497
3633
|
},
|
|
3498
3634
|
operationName: g,
|
|
3499
3635
|
fetch: c,
|
|
3500
3636
|
method: p,
|
|
3501
3637
|
fetchOptions: y,
|
|
3502
3638
|
middleware: h
|
|
3503
|
-
}).then((
|
|
3504
|
-
throw
|
|
3639
|
+
}).then((T) => (f && f(T), T.data)).catch((T) => {
|
|
3640
|
+
throw f && f(T), T;
|
|
3505
3641
|
});
|
|
3506
3642
|
}
|
|
3507
3643
|
// prettier-ignore
|
|
3508
3644
|
batchRequests(t, n) {
|
|
3509
|
-
const
|
|
3510
|
-
|
|
3511
|
-
const a =
|
|
3512
|
-
return
|
|
3645
|
+
const r = En(t, n), { headers: i, ...s } = this.requestConfig;
|
|
3646
|
+
r.signal !== void 0 && (s.signal = r.signal);
|
|
3647
|
+
const a = r.documents.map(({ document: p }) => le(p).query), c = r.documents.map(({ variables: p }) => p);
|
|
3648
|
+
return de({
|
|
3513
3649
|
url: this.url,
|
|
3514
3650
|
query: a,
|
|
3515
3651
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
3516
3652
|
variables: c,
|
|
3517
3653
|
headers: {
|
|
3518
|
-
...
|
|
3519
|
-
...
|
|
3654
|
+
...B(pe(i)),
|
|
3655
|
+
...B(r.requestHeaders)
|
|
3520
3656
|
},
|
|
3521
3657
|
operationName: void 0,
|
|
3522
3658
|
fetch: this.requestConfig.fetch ?? te,
|
|
@@ -3534,8 +3670,8 @@ class vn {
|
|
|
3534
3670
|
* Attach a header to the client. All subsequent requests will have this header.
|
|
3535
3671
|
*/
|
|
3536
3672
|
setHeader(t, n) {
|
|
3537
|
-
const { headers:
|
|
3538
|
-
return
|
|
3673
|
+
const { headers: r } = this.requestConfig;
|
|
3674
|
+
return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
|
|
3539
3675
|
}
|
|
3540
3676
|
/**
|
|
3541
3677
|
* Change the client endpoint. All subsequent requests will send to this endpoint.
|
|
@@ -3544,45 +3680,45 @@ class vn {
|
|
|
3544
3680
|
return this.url = t, this;
|
|
3545
3681
|
}
|
|
3546
3682
|
}
|
|
3547
|
-
const
|
|
3548
|
-
const { query: t, variables: n, fetchOptions:
|
|
3683
|
+
const de = async (e) => {
|
|
3684
|
+
const { query: t, variables: n, fetchOptions: r } = e, i = xn(fn(e.method ?? "post")), s = Array.isArray(e.query), a = await i(e), c = await On(a, r.jsonSerializer ?? Ae), p = Array.isArray(c) ? !c.some(({ data: f }) => !f) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
|
|
3549
3685
|
if (a.ok && h && p) {
|
|
3550
|
-
const { errors:
|
|
3686
|
+
const { errors: f, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
|
|
3551
3687
|
return {
|
|
3552
3688
|
...s ? { data: C } : C,
|
|
3553
3689
|
headers: a.headers,
|
|
3554
3690
|
status: a.status
|
|
3555
3691
|
};
|
|
3556
3692
|
} else {
|
|
3557
|
-
const
|
|
3693
|
+
const f = typeof c == "string" ? {
|
|
3558
3694
|
error: c
|
|
3559
3695
|
} : c;
|
|
3560
3696
|
throw new H(
|
|
3561
3697
|
// @ts-expect-error TODO
|
|
3562
|
-
{ ...
|
|
3698
|
+
{ ...f, status: a.status, headers: a.headers },
|
|
3563
3699
|
{ query: t, variables: n }
|
|
3564
3700
|
);
|
|
3565
3701
|
}
|
|
3566
|
-
},
|
|
3567
|
-
const
|
|
3702
|
+
}, Rn = (e, t, n, r) => {
|
|
3703
|
+
const i = r ?? Ae;
|
|
3568
3704
|
if (!Array.isArray(e))
|
|
3569
|
-
return
|
|
3705
|
+
return i.stringify({ query: e, variables: t, operationName: n });
|
|
3570
3706
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3571
3707
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3572
3708
|
const s = e.reduce((a, c, p) => (a.push({ query: c, variables: t ? t[p] : void 0 }), a), []);
|
|
3573
|
-
return
|
|
3574
|
-
},
|
|
3709
|
+
return i.stringify(s);
|
|
3710
|
+
}, On = async (e, t) => {
|
|
3575
3711
|
let n;
|
|
3576
|
-
return e.headers.forEach((
|
|
3577
|
-
|
|
3712
|
+
return e.headers.forEach((r, i) => {
|
|
3713
|
+
i.toLowerCase() === "content-type" && (n = r);
|
|
3578
3714
|
}), 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();
|
|
3579
3715
|
}, pe = (e) => typeof e == "function" ? e() : e;
|
|
3580
|
-
var
|
|
3581
|
-
class
|
|
3716
|
+
var Nn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(Nn || {}), Pn = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(Pn || {});
|
|
3717
|
+
class bn {
|
|
3582
3718
|
constructor(t) {
|
|
3583
|
-
|
|
3584
|
-
this.api =
|
|
3585
|
-
new
|
|
3719
|
+
ve(this, "api");
|
|
3720
|
+
this.api = mn(
|
|
3721
|
+
new Sn(`${t}/apps/sq-api`, {
|
|
3586
3722
|
headers: {
|
|
3587
3723
|
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
3588
3724
|
}
|
|
@@ -3597,12 +3733,12 @@ class Nn {
|
|
|
3597
3733
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3598
3734
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3599
3735
|
*/
|
|
3600
|
-
async getLocationAvailabilities(t, n,
|
|
3736
|
+
async getLocationAvailabilities(t, n, r, i) {
|
|
3601
3737
|
const s = await this.api.GetLocationAvailabilities({
|
|
3602
3738
|
sku: t,
|
|
3603
3739
|
first: n,
|
|
3604
|
-
after:
|
|
3605
|
-
isReverse:
|
|
3740
|
+
after: r,
|
|
3741
|
+
isReverse: i
|
|
3606
3742
|
});
|
|
3607
3743
|
return {
|
|
3608
3744
|
nodes: s.locationAvailabilities.nodes.map(
|
|
@@ -3637,27 +3773,27 @@ class Nn {
|
|
|
3637
3773
|
* @param {string} locationID 在庫情報を取得したいLocationのID。
|
|
3638
3774
|
*/
|
|
3639
3775
|
async getLocationAvailability(t, n) {
|
|
3640
|
-
const
|
|
3776
|
+
const r = await this.api.GetLocationAvailability({ sku: t, locationID: n });
|
|
3641
3777
|
return {
|
|
3642
3778
|
location: {
|
|
3643
|
-
id:
|
|
3644
|
-
name:
|
|
3645
|
-
phone:
|
|
3646
|
-
mapURL:
|
|
3647
|
-
tags:
|
|
3648
|
-
address:
|
|
3649
|
-
id:
|
|
3650
|
-
countryCode:
|
|
3651
|
-
country:
|
|
3652
|
-
postalCode:
|
|
3653
|
-
provinceCode:
|
|
3654
|
-
province:
|
|
3655
|
-
city:
|
|
3656
|
-
address1:
|
|
3657
|
-
address2:
|
|
3779
|
+
id: r.locationAvailability.location.id,
|
|
3780
|
+
name: r.locationAvailability.location.name,
|
|
3781
|
+
phone: r.locationAvailability.location.phone,
|
|
3782
|
+
mapURL: r.locationAvailability.location.mapURL,
|
|
3783
|
+
tags: r.locationAvailability.location.tags,
|
|
3784
|
+
address: r.locationAvailability.location.address ? {
|
|
3785
|
+
id: r.locationAvailability.location.address.id,
|
|
3786
|
+
countryCode: r.locationAvailability.location.address.countryCode,
|
|
3787
|
+
country: r.locationAvailability.location.address.country,
|
|
3788
|
+
postalCode: r.locationAvailability.location.address.postalCode,
|
|
3789
|
+
provinceCode: r.locationAvailability.location.address.provinceCode,
|
|
3790
|
+
province: r.locationAvailability.location.address.province,
|
|
3791
|
+
city: r.locationAvailability.location.address.city,
|
|
3792
|
+
address1: r.locationAvailability.location.address.address1,
|
|
3793
|
+
address2: r.locationAvailability.location.address.address2
|
|
3658
3794
|
} : void 0
|
|
3659
3795
|
},
|
|
3660
|
-
inventoryQuantity:
|
|
3796
|
+
inventoryQuantity: r.locationAvailability.inventoryQuantity
|
|
3661
3797
|
};
|
|
3662
3798
|
}
|
|
3663
3799
|
/**
|
|
@@ -3700,12 +3836,12 @@ class Nn {
|
|
|
3700
3836
|
* @param {LocationFilter} [locationFilter] ロケーションのロケーションのフィルタリング条件。
|
|
3701
3837
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3702
3838
|
*/
|
|
3703
|
-
async getLocations(t, n,
|
|
3839
|
+
async getLocations(t, n, r, i) {
|
|
3704
3840
|
const s = await this.api.GetLocations({
|
|
3705
3841
|
first: t,
|
|
3706
3842
|
after: n,
|
|
3707
|
-
filter:
|
|
3708
|
-
isReverse:
|
|
3843
|
+
filter: r,
|
|
3844
|
+
isReverse: i
|
|
3709
3845
|
});
|
|
3710
3846
|
return {
|
|
3711
3847
|
nodes: s.locations.nodes.map((a) => ({
|
|
@@ -3737,15 +3873,15 @@ class Nn {
|
|
|
3737
3873
|
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
3738
3874
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3739
3875
|
*/
|
|
3740
|
-
async getPurchasingCustomerDiscounts(t, n,
|
|
3741
|
-
const
|
|
3876
|
+
async getPurchasingCustomerDiscounts(t, n, r) {
|
|
3877
|
+
const i = await this.api.GetPurchasingCustomerDiscounts({
|
|
3742
3878
|
first: t,
|
|
3743
3879
|
after: n,
|
|
3744
|
-
isReverse:
|
|
3880
|
+
isReverse: r
|
|
3745
3881
|
});
|
|
3746
|
-
return
|
|
3747
|
-
id:
|
|
3748
|
-
nodes:
|
|
3882
|
+
return i.purchasingCustomer ? {
|
|
3883
|
+
id: i.purchasingCustomer.id,
|
|
3884
|
+
nodes: i.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
|
|
3749
3885
|
(s) => ({
|
|
3750
3886
|
id: s.id,
|
|
3751
3887
|
title: s.title,
|
|
@@ -3762,7 +3898,7 @@ class Nn {
|
|
|
3762
3898
|
updatedAt: new Date(s.updatedAt)
|
|
3763
3899
|
})
|
|
3764
3900
|
) ?? [],
|
|
3765
|
-
pageInfo:
|
|
3901
|
+
pageInfo: i.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
|
|
3766
3902
|
} : null;
|
|
3767
3903
|
}
|
|
3768
3904
|
/**
|
|
@@ -3773,12 +3909,12 @@ class Nn {
|
|
|
3773
3909
|
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
3774
3910
|
* @param {PointChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかPOINT_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
|
|
3775
3911
|
*/
|
|
3776
|
-
async getPointChangeActivities(t, n,
|
|
3912
|
+
async getPointChangeActivities(t, n, r, i) {
|
|
3777
3913
|
const s = await this.api.GetPurchasingCustomerPointChangeActivities({
|
|
3778
3914
|
first: t,
|
|
3779
3915
|
after: n,
|
|
3780
|
-
isReverse:
|
|
3781
|
-
sortKeys:
|
|
3916
|
+
isReverse: r,
|
|
3917
|
+
sortKeys: i
|
|
3782
3918
|
});
|
|
3783
3919
|
return s.purchasingCustomer ? {
|
|
3784
3920
|
nodes: s.purchasingCustomer.pointChangeActivities.nodes.map(
|
|
@@ -3897,23 +4033,23 @@ class Nn {
|
|
|
3897
4033
|
return (n = t.purchasingCustomer) != null && n.customerSharing ? {
|
|
3898
4034
|
id: t.purchasingCustomer.customerSharing.id,
|
|
3899
4035
|
purchasingCustomers: t.purchasingCustomer.customerSharing.purchasingCustomers.map(
|
|
3900
|
-
(
|
|
3901
|
-
id:
|
|
3902
|
-
sharingPurchasingCustomerCount:
|
|
4036
|
+
(r) => ({
|
|
4037
|
+
id: r.id,
|
|
4038
|
+
sharingPurchasingCustomerCount: r.sharingPurchasingCustomerCount,
|
|
3903
4039
|
tenant: {
|
|
3904
|
-
id:
|
|
3905
|
-
name:
|
|
4040
|
+
id: r.tenant.id,
|
|
4041
|
+
name: r.tenant.name
|
|
3906
4042
|
}
|
|
3907
4043
|
})
|
|
3908
4044
|
)
|
|
3909
4045
|
} : null;
|
|
3910
4046
|
}
|
|
3911
|
-
async getProduct(t, n,
|
|
4047
|
+
async getProduct(t, n, r, i, s) {
|
|
3912
4048
|
const a = await this.api.GetProduct({
|
|
3913
4049
|
id: t,
|
|
3914
4050
|
first: n,
|
|
3915
|
-
after:
|
|
3916
|
-
isReverse:
|
|
4051
|
+
after: r,
|
|
4052
|
+
isReverse: i,
|
|
3917
4053
|
sortKeys: s
|
|
3918
4054
|
});
|
|
3919
4055
|
return a.productByProductShopifyLegacyResourceID ? {
|
|
@@ -3962,35 +4098,35 @@ class Nn {
|
|
|
3962
4098
|
fixedPoint: t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint ? t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint : void 0
|
|
3963
4099
|
} : null;
|
|
3964
4100
|
}
|
|
3965
|
-
async getEstimatedShopifyCartPoint(t, n,
|
|
3966
|
-
const
|
|
4101
|
+
async getEstimatedShopifyCartPoint(t, n, r) {
|
|
4102
|
+
const i = await this.api.GetEstimatedShopifyCartPoint({
|
|
3967
4103
|
input: {
|
|
3968
4104
|
currencyCode: t,
|
|
3969
4105
|
taxesIncluded: n,
|
|
3970
|
-
lineItems:
|
|
4106
|
+
lineItems: r
|
|
3971
4107
|
}
|
|
3972
4108
|
});
|
|
3973
|
-
return
|
|
3974
|
-
pointsEarning:
|
|
3975
|
-
totalPointsEarning:
|
|
3976
|
-
pointCampaign:
|
|
3977
|
-
pointsEarning:
|
|
4109
|
+
return i.estimatedShopifyCartPoint ? {
|
|
4110
|
+
pointsEarning: i.estimatedShopifyCartPoint.pointsEarning,
|
|
4111
|
+
totalPointsEarning: i.estimatedShopifyCartPoint.totalPointsEarning,
|
|
4112
|
+
pointCampaign: i.estimatedShopifyCartPoint.pointCampaign ? {
|
|
4113
|
+
pointsEarning: i.estimatedShopifyCartPoint.pointCampaign.pointsEarning,
|
|
3978
4114
|
pointCampaignOrderRule: {
|
|
3979
|
-
id:
|
|
3980
|
-
title:
|
|
3981
|
-
pointMethod:
|
|
3982
|
-
targetType:
|
|
4115
|
+
id: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,
|
|
4116
|
+
title: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,
|
|
4117
|
+
pointMethod: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
|
|
4118
|
+
targetType: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType
|
|
3983
4119
|
}
|
|
3984
4120
|
} : void 0
|
|
3985
4121
|
} : null;
|
|
3986
4122
|
}
|
|
3987
|
-
async getEstimatedShopifyCartLineItemPoint(t, n,
|
|
4123
|
+
async getEstimatedShopifyCartLineItemPoint(t, n, r, i, s) {
|
|
3988
4124
|
const a = await this.api.GetEstimatedShopifyCartLineItemPoint({
|
|
3989
4125
|
input: {
|
|
3990
4126
|
currencyCode: t,
|
|
3991
4127
|
taxesIncluded: n,
|
|
3992
|
-
sku:
|
|
3993
|
-
quantity:
|
|
4128
|
+
sku: r,
|
|
4129
|
+
quantity: i,
|
|
3994
4130
|
unitPrice: s
|
|
3995
4131
|
}
|
|
3996
4132
|
});
|
|
@@ -4033,22 +4169,158 @@ class Nn {
|
|
|
4033
4169
|
throw new Error(
|
|
4034
4170
|
`Invalid activation code: ${n} is not 6 characters.`
|
|
4035
4171
|
);
|
|
4036
|
-
const
|
|
4172
|
+
const r = await this.api.PurchasingCustomerActivateCustomerSharing({
|
|
4037
4173
|
email: t,
|
|
4038
4174
|
activationCode: n
|
|
4039
4175
|
});
|
|
4040
|
-
return
|
|
4041
|
-
id:
|
|
4042
|
-
sharingPurchasingCustomerCount:
|
|
4176
|
+
return r.purchasingCustomerActivateCustomerSharing ? {
|
|
4177
|
+
id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,
|
|
4178
|
+
sharingPurchasingCustomerCount: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,
|
|
4043
4179
|
tenant: {
|
|
4044
|
-
id:
|
|
4045
|
-
name:
|
|
4180
|
+
id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,
|
|
4181
|
+
name: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name
|
|
4046
4182
|
}
|
|
4047
4183
|
} : null;
|
|
4048
4184
|
}
|
|
4185
|
+
/**
|
|
4186
|
+
* getMiles は、Miles は SDK から取得できるマイルの情報を返します。
|
|
4187
|
+
*/
|
|
4188
|
+
async getMiles() {
|
|
4189
|
+
const t = await this.api.GetMiles();
|
|
4190
|
+
return t.purchasingCustomer ? {
|
|
4191
|
+
miles: t.purchasingCustomer.miles
|
|
4192
|
+
} : null;
|
|
4193
|
+
}
|
|
4194
|
+
/**
|
|
4195
|
+
* getMileChangeActivities は購入者のマイル変動履歴を返します。
|
|
4196
|
+
*
|
|
4197
|
+
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
4198
|
+
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
4199
|
+
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
4200
|
+
* @param {MileChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかMILE_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
|
|
4201
|
+
*/
|
|
4202
|
+
async getMileChangeActivities(t, n, r, i) {
|
|
4203
|
+
const s = await this.api.GetPurchasingCustomerMileChangeActivities({
|
|
4204
|
+
first: t,
|
|
4205
|
+
after: n,
|
|
4206
|
+
isReverse: r,
|
|
4207
|
+
sortKeys: i
|
|
4208
|
+
});
|
|
4209
|
+
return s.purchasingCustomer ? {
|
|
4210
|
+
nodes: s.purchasingCustomer.mileChangeActivities.nodes.map(
|
|
4211
|
+
(a) => ({
|
|
4212
|
+
id: a.id,
|
|
4213
|
+
title: a.title,
|
|
4214
|
+
mileChange: {
|
|
4215
|
+
id: a.mileChange.id,
|
|
4216
|
+
delta: a.mileChange.delta,
|
|
4217
|
+
mileChangeCreatedAt: new Date(
|
|
4218
|
+
a.mileChange.mileChangeCreatedAt
|
|
4219
|
+
),
|
|
4220
|
+
createdAt: new Date(a.mileChange.createdAt)
|
|
4221
|
+
}
|
|
4222
|
+
})
|
|
4223
|
+
),
|
|
4224
|
+
pageInfo: s.purchasingCustomer.mileChangeActivities.pageInfo
|
|
4225
|
+
} : null;
|
|
4226
|
+
}
|
|
4227
|
+
/**
|
|
4228
|
+
* getMileItems は顧客が利用可能なマイル交換商品の一覧を返します。
|
|
4229
|
+
*
|
|
4230
|
+
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
4231
|
+
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
4232
|
+
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
4233
|
+
* @param {ShopifyMileItemSortKey} [sortKeys] ソートキー。デフォルトはCREATED_AT。
|
|
4234
|
+
*/
|
|
4235
|
+
async getMileItems(t, n, r, i) {
|
|
4236
|
+
const s = await this.api.GetMileItems({
|
|
4237
|
+
first: t,
|
|
4238
|
+
after: n,
|
|
4239
|
+
isReverse: r,
|
|
4240
|
+
sortKeys: i
|
|
4241
|
+
});
|
|
4242
|
+
return s.mileItems ? {
|
|
4243
|
+
nodes: s.mileItems.nodes.map((a) => ({
|
|
4244
|
+
id: a.id,
|
|
4245
|
+
title: a.title,
|
|
4246
|
+
description: a.description,
|
|
4247
|
+
miles: a.miles,
|
|
4248
|
+
sku: a.sku,
|
|
4249
|
+
isActive: a.isActive,
|
|
4250
|
+
isScheduled: a.isScheduled,
|
|
4251
|
+
customerExchangeable: a.customerExchangeable,
|
|
4252
|
+
startsAt: new Date(a.startsAt),
|
|
4253
|
+
endsAt: a.endsAt ? new Date(a.endsAt) : void 0
|
|
4254
|
+
})),
|
|
4255
|
+
pageInfo: s.mileItems.pageInfo
|
|
4256
|
+
} : null;
|
|
4257
|
+
}
|
|
4258
|
+
/**
|
|
4259
|
+
* getMileOrders は顧客のマイル交換履歴の一覧を返します。
|
|
4260
|
+
*
|
|
4261
|
+
* @param {number} [first] 取得してくる個数。デフォルトは250。
|
|
4262
|
+
* @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
|
|
4263
|
+
* @param {boolean} [isReverse] 並び順。デフォルトはfalse。
|
|
4264
|
+
* @param {MileOrderSortKey} [sortKeys] ソートキー。デフォルトはCREATED_AT。
|
|
4265
|
+
*/
|
|
4266
|
+
async getMileOrders(t, n, r, i) {
|
|
4267
|
+
const s = await this.api.GetMileOrders({
|
|
4268
|
+
first: t,
|
|
4269
|
+
after: n,
|
|
4270
|
+
isReverse: r,
|
|
4271
|
+
sortKeys: i
|
|
4272
|
+
});
|
|
4273
|
+
return s.purchasingCustomer ? {
|
|
4274
|
+
nodes: s.purchasingCustomer.mileOrders.nodes.map((a) => ({
|
|
4275
|
+
id: a.id,
|
|
4276
|
+
mileItem: {
|
|
4277
|
+
id: a.mileItem.id,
|
|
4278
|
+
title: a.mileItem.title,
|
|
4279
|
+
description: a.mileItem.description,
|
|
4280
|
+
miles: a.mileItem.miles,
|
|
4281
|
+
sku: a.mileItem.sku,
|
|
4282
|
+
isActive: a.mileItem.isActive,
|
|
4283
|
+
isScheduled: a.mileItem.isScheduled,
|
|
4284
|
+
customerExchangeable: a.mileItem.customerExchangeable,
|
|
4285
|
+
startsAt: new Date(a.mileItem.startsAt),
|
|
4286
|
+
endsAt: a.mileItem.endsAt ? new Date(a.mileItem.endsAt) : void 0
|
|
4287
|
+
},
|
|
4288
|
+
miles: a.miles,
|
|
4289
|
+
exchangedAt: new Date(a.exchangedAt)
|
|
4290
|
+
})),
|
|
4291
|
+
pageInfo: s.purchasingCustomer.mileOrders.pageInfo
|
|
4292
|
+
} : null;
|
|
4293
|
+
}
|
|
4294
|
+
/**
|
|
4295
|
+
* mileItemExchange は指定したマイル商品を交換します。
|
|
4296
|
+
*
|
|
4297
|
+
* @param {mileItemID} mileItemID 交換したいマイル商品のID。
|
|
4298
|
+
*/
|
|
4299
|
+
async mileItemExchange(t) {
|
|
4300
|
+
const n = await this.api.MileItemExchange({
|
|
4301
|
+
mileItemID: t
|
|
4302
|
+
});
|
|
4303
|
+
return n.mileItemExchange ? {
|
|
4304
|
+
id: n.mileItemExchange.mileOrder.id,
|
|
4305
|
+
mileItem: {
|
|
4306
|
+
id: n.mileItemExchange.mileOrder.mileItem.id,
|
|
4307
|
+
title: n.mileItemExchange.mileOrder.mileItem.title,
|
|
4308
|
+
description: n.mileItemExchange.mileOrder.mileItem.description,
|
|
4309
|
+
miles: n.mileItemExchange.mileOrder.mileItem.miles,
|
|
4310
|
+
sku: n.mileItemExchange.mileOrder.mileItem.sku,
|
|
4311
|
+
isActive: n.mileItemExchange.mileOrder.mileItem.isActive,
|
|
4312
|
+
isScheduled: n.mileItemExchange.mileOrder.mileItem.isScheduled,
|
|
4313
|
+
customerExchangeable: n.mileItemExchange.mileOrder.mileItem.customerExchangeable,
|
|
4314
|
+
startsAt: new Date(n.mileItemExchange.mileOrder.mileItem.startsAt),
|
|
4315
|
+
endsAt: n.mileItemExchange.mileOrder.mileItem.endsAt ? new Date(n.mileItemExchange.mileOrder.mileItem.endsAt) : void 0
|
|
4316
|
+
},
|
|
4317
|
+
miles: n.mileItemExchange.mileOrder.miles,
|
|
4318
|
+
exchangedAt: new Date(n.mileItemExchange.mileOrder.exchangedAt)
|
|
4319
|
+
} : null;
|
|
4320
|
+
}
|
|
4049
4321
|
}
|
|
4050
4322
|
export {
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4323
|
+
Nn as CurrencyCode,
|
|
4324
|
+
Pn as LocationType,
|
|
4325
|
+
bn as SDK
|
|
4054
4326
|
};
|