@ticketapp-dev/shop-sdk 1.0.62 → 1.0.63
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/dist/index.js +398 -375
- package/dist/services/basket/basket.service.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { GraphQLClient as
|
|
2
|
-
import { DateTime as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { GraphQLClient as T } from "graphql-request";
|
|
2
|
+
import { DateTime as De } from "luxon";
|
|
3
|
+
var O = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(O || {}), v = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(v || {}), W = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(W || {}), Z = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Z || {}), K = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(K || {}), ee = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(ee || {}), te = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(te || {}), ne = /* @__PURE__ */ ((e) => (e.Addon = "ADDON", e.Delivery = "DELIVERY", e.Door = "DOOR", e.Friend = "FRIEND", e.Guest = "GUEST", e.Pickup = "PICKUP", e.Promoter = "PROMOTER", e.Ticket = "TICKET", e))(ne || {}), re = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(re || {}), ie = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(ie || {}), se = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(se || {}), ae = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Transparent = "TRANSPARENT", e))(ae || {}), oe = /* @__PURE__ */ ((e) => (e.Calendar = "CALENDAR", e.Large = "LARGE", e.Small = "SMALL", e))(oe || {}), R = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(R || {}), ce = /* @__PURE__ */ ((e) => (e.RADIO_BUTTON = "RADIO_BUTTON", e.DATE = "DATE", e.EMAIL = "EMAIL", e.NUMERIC = "NUMERIC", e.DROPDOWN = "DROPDOWN", e.TEXT = "TEXT", e.TEXT_AREA = "TEXT_AREA", e.TIME = "TIME", e.CHECKBOX = "CHECKBOX", e.PHONE_NUMBER = "PHONE_NUMBER", e))(ce || {}), de = /* @__PURE__ */ ((e) => (e.GENDER = "GENDER", e.FIRST_NAME = "FIRST_NAME", e.LAST_NAME = "LAST_NAME", e.EMAIL = "EMAIL", e.AGE = "AGE", e.RESIDENCE = "RESIDENCE", e.GOOGLE_PLACE = "GOOGLE_PLACE", e))(de || {}), ue = /* @__PURE__ */ ((e) => (e.ONLINE = "ONLINE", e.OFFLINE = "OFFLINE", e))(ue || {});
|
|
4
|
+
const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
5
|
__proto__: null,
|
|
6
|
-
BasketOrderType:
|
|
6
|
+
BasketOrderType: O,
|
|
7
7
|
CustomFieldMandatoryType: de,
|
|
8
8
|
CustomFieldType: ce,
|
|
9
9
|
DiscountType: se,
|
|
10
10
|
EventStatus: K,
|
|
11
11
|
MetricsType: R,
|
|
12
12
|
OrderItemType: ie,
|
|
13
|
-
PackageItemType:
|
|
13
|
+
PackageItemType: v,
|
|
14
14
|
PackageStatus: W,
|
|
15
15
|
PackageTabType: Z,
|
|
16
16
|
PaymentMethodFeeType: re,
|
|
@@ -34,20 +34,20 @@ function U(e, t) {
|
|
|
34
34
|
if (!!!e)
|
|
35
35
|
throw new Error(t);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ve(e) {
|
|
38
38
|
return typeof e == "object" && e !== null;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Pe(e, t) {
|
|
41
41
|
if (!!!e)
|
|
42
42
|
throw new Error(
|
|
43
43
|
"Unexpected invariant triggered."
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const be = /\r\n|[\n\r]/g;
|
|
47
47
|
function M(e, t) {
|
|
48
48
|
let n = 0, r = 1;
|
|
49
|
-
for (const i of e.body.matchAll(
|
|
50
|
-
if (typeof i.index == "number" ||
|
|
49
|
+
for (const i of e.body.matchAll(be)) {
|
|
50
|
+
if (typeof i.index == "number" || Pe(!1), i.index >= t)
|
|
51
51
|
break;
|
|
52
52
|
n = i.index + i[0].length, r += 1;
|
|
53
53
|
}
|
|
@@ -56,32 +56,32 @@ function M(e, t) {
|
|
|
56
56
|
column: t + 1 - n
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function xe(e) {
|
|
60
60
|
return le(
|
|
61
61
|
e.source,
|
|
62
62
|
M(e.source, e.start)
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
function le(e, t) {
|
|
66
|
-
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, l = t.line === 1 ? n : 0, h = t.column + l,
|
|
67
|
-
`,
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
for (let
|
|
71
|
-
|
|
72
|
-
return
|
|
73
|
-
[`${o} |`,
|
|
74
|
-
...
|
|
75
|
-
["|", "^".padStart(
|
|
76
|
-
["|",
|
|
66
|
+
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, l = t.line === 1 ? n : 0, h = t.column + l, I = `${e.name}:${o}:${h}
|
|
67
|
+
`, g = r.split(/\r\n|[\n\r]/g), k = g[i];
|
|
68
|
+
if (k.length > 120) {
|
|
69
|
+
const c = Math.floor(h / 80), E = h % 80, p = [];
|
|
70
|
+
for (let y = 0; y < k.length; y += 80)
|
|
71
|
+
p.push(k.slice(y, y + 80));
|
|
72
|
+
return I + Q([
|
|
73
|
+
[`${o} |`, p[0]],
|
|
74
|
+
...p.slice(1, c + 1).map((y) => ["|", y]),
|
|
75
|
+
["|", "^".padStart(E)],
|
|
76
|
+
["|", p[c + 1]]
|
|
77
77
|
]);
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return I + Q([
|
|
80
80
|
// Lines specified like this: ["prefix", "string"],
|
|
81
|
-
[`${o - 1} |`,
|
|
82
|
-
[`${o} |`,
|
|
81
|
+
[`${o - 1} |`, g[i - 1]],
|
|
82
|
+
[`${o} |`, k],
|
|
83
83
|
["|", "^".padStart(h)],
|
|
84
|
-
[`${o + 1} |`,
|
|
84
|
+
[`${o + 1} |`, g[i + 1]]
|
|
85
85
|
]);
|
|
86
86
|
}
|
|
87
87
|
function Q(e) {
|
|
@@ -89,7 +89,7 @@ function Q(e) {
|
|
|
89
89
|
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
90
90
|
`);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Se(e) {
|
|
93
93
|
const t = e[0];
|
|
94
94
|
return t == null || "kind" in t || "length" in t ? {
|
|
95
95
|
nodes: t,
|
|
@@ -141,18 +141,18 @@ class G extends Error {
|
|
|
141
141
|
*/
|
|
142
142
|
constructor(t, ...n) {
|
|
143
143
|
var r, i, s;
|
|
144
|
-
const { nodes: o, source: l, positions: h, path:
|
|
145
|
-
super(t), this.name = "GraphQLError", this.path =
|
|
144
|
+
const { nodes: o, source: l, positions: h, path: I, originalError: g, extensions: k } = Se(n);
|
|
145
|
+
super(t), this.name = "GraphQLError", this.path = I ?? void 0, this.originalError = g ?? void 0, this.nodes = X(
|
|
146
146
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
147
147
|
);
|
|
148
|
-
const
|
|
149
|
-
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((
|
|
148
|
+
const c = X(
|
|
149
|
+
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((p) => p.loc).filter((p) => p != null)
|
|
150
150
|
);
|
|
151
|
-
this.source = l ?? (
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
) ?
|
|
155
|
-
this.extensions = (s =
|
|
151
|
+
this.source = l ?? (c == null || (i = c[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? c?.map((p) => p.start), this.locations = h && l ? h.map((p) => M(l, p)) : c?.map((p) => M(p.source, p.start));
|
|
152
|
+
const E = ve(
|
|
153
|
+
g?.extensions
|
|
154
|
+
) ? g?.extensions : void 0;
|
|
155
|
+
this.extensions = (s = k ?? E) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
156
156
|
message: {
|
|
157
157
|
writable: !0,
|
|
158
158
|
enumerable: !0
|
|
@@ -172,8 +172,8 @@ class G extends Error {
|
|
|
172
172
|
originalError: {
|
|
173
173
|
enumerable: !1
|
|
174
174
|
}
|
|
175
|
-
}),
|
|
176
|
-
value:
|
|
175
|
+
}), g != null && g.stack ? Object.defineProperty(this, "stack", {
|
|
176
|
+
value: g.stack,
|
|
177
177
|
writable: !0,
|
|
178
178
|
configurable: !0
|
|
179
179
|
}) : Error.captureStackTrace ? Error.captureStackTrace(this, G) : Object.defineProperty(this, "stack", {
|
|
@@ -191,7 +191,7 @@ class G extends Error {
|
|
|
191
191
|
for (const n of this.nodes)
|
|
192
192
|
n.loc && (t += `
|
|
193
193
|
|
|
194
|
-
` +
|
|
194
|
+
` + xe(n.loc));
|
|
195
195
|
else if (this.source && this.locations)
|
|
196
196
|
for (const n of this.locations)
|
|
197
197
|
t += `
|
|
@@ -209,13 +209,13 @@ class G extends Error {
|
|
|
209
209
|
function X(e) {
|
|
210
210
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function f(e, t, n) {
|
|
213
213
|
return new G(`Syntax Error: ${n}`, {
|
|
214
214
|
source: e,
|
|
215
215
|
positions: [t]
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
class
|
|
218
|
+
class Ce {
|
|
219
219
|
/**
|
|
220
220
|
* The character offset at which this Node begins.
|
|
221
221
|
*/
|
|
@@ -286,7 +286,7 @@ class he {
|
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const _e = {
|
|
290
290
|
Name: [],
|
|
291
291
|
Document: ["definitions"],
|
|
292
292
|
OperationDefinition: [
|
|
@@ -374,7 +374,7 @@ const Ce = {
|
|
|
374
374
|
DirectiveCoordinate: ["name"],
|
|
375
375
|
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
376
376
|
};
|
|
377
|
-
new Set(Object.keys(
|
|
377
|
+
new Set(Object.keys(_e));
|
|
378
378
|
var N;
|
|
379
379
|
(function(e) {
|
|
380
380
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
@@ -383,14 +383,14 @@ var q;
|
|
|
383
383
|
(function(e) {
|
|
384
384
|
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";
|
|
385
385
|
})(q || (q = {}));
|
|
386
|
-
var
|
|
386
|
+
var d;
|
|
387
387
|
(function(e) {
|
|
388
388
|
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", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
|
|
389
|
-
})(
|
|
390
|
-
function
|
|
389
|
+
})(d || (d = {}));
|
|
390
|
+
function Le(e) {
|
|
391
391
|
return e === 9 || e === 32;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function S(e) {
|
|
394
394
|
return e >= 48 && e <= 57;
|
|
395
395
|
}
|
|
396
396
|
function pe(e) {
|
|
@@ -400,15 +400,15 @@ function pe(e) {
|
|
|
400
400
|
function ge(e) {
|
|
401
401
|
return pe(e) || e === 95;
|
|
402
402
|
}
|
|
403
|
-
function Le(e) {
|
|
404
|
-
return pe(e) || x(e) || e === 95;
|
|
405
|
-
}
|
|
406
403
|
function Re(e) {
|
|
404
|
+
return pe(e) || S(e) || e === 95;
|
|
405
|
+
}
|
|
406
|
+
function we(e) {
|
|
407
407
|
var t;
|
|
408
408
|
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
409
409
|
for (let o = 0; o < e.length; ++o) {
|
|
410
410
|
var s;
|
|
411
|
-
const l = e[o], h =
|
|
411
|
+
const l = e[o], h = Fe(l);
|
|
412
412
|
h !== l.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
|
|
413
413
|
}
|
|
414
414
|
return e.map((o, l) => l === 0 ? o : o.slice(n)).slice(
|
|
@@ -416,9 +416,9 @@ function Re(e) {
|
|
|
416
416
|
i + 1
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Fe(e) {
|
|
420
420
|
let t = 0;
|
|
421
|
-
for (; t < e.length &&
|
|
421
|
+
for (; t < e.length && Le(e.charCodeAt(t)); )
|
|
422
422
|
++t;
|
|
423
423
|
return t;
|
|
424
424
|
}
|
|
@@ -426,7 +426,7 @@ var a;
|
|
|
426
426
|
(function(e) {
|
|
427
427
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
428
428
|
})(a || (a = {}));
|
|
429
|
-
class
|
|
429
|
+
class $e {
|
|
430
430
|
/**
|
|
431
431
|
* The previously focused non-ignored token.
|
|
432
432
|
*/
|
|
@@ -463,17 +463,17 @@ class Fe {
|
|
|
463
463
|
if (t.next)
|
|
464
464
|
t = t.next;
|
|
465
465
|
else {
|
|
466
|
-
const n =
|
|
466
|
+
const n = Ue(this, t.end);
|
|
467
467
|
t.next = n, n.prev = t, t = n;
|
|
468
468
|
}
|
|
469
469
|
while (t.kind === a.COMMENT);
|
|
470
470
|
return t;
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Be(e) {
|
|
474
474
|
return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function P(e) {
|
|
477
477
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
478
478
|
}
|
|
479
479
|
function $(e, t) {
|
|
@@ -495,11 +495,11 @@ function D(e, t) {
|
|
|
495
495
|
}
|
|
496
496
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function m(e, t, n, r, i) {
|
|
499
499
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
500
500
|
return new he(t, n, r, s, o, i);
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Ue(e, t) {
|
|
503
503
|
const n = e.source.body, r = n.length;
|
|
504
504
|
let i = t;
|
|
505
505
|
for (; i < r; ) {
|
|
@@ -540,7 +540,7 @@ function Be(e, t) {
|
|
|
540
540
|
continue;
|
|
541
541
|
// Comment
|
|
542
542
|
case 35:
|
|
543
|
-
return
|
|
543
|
+
return Ve(e, i);
|
|
544
544
|
// Token ::
|
|
545
545
|
// - Punctuator
|
|
546
546
|
// - Name
|
|
@@ -550,66 +550,66 @@ function Be(e, t) {
|
|
|
550
550
|
//
|
|
551
551
|
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
|
|
552
552
|
case 33:
|
|
553
|
-
return
|
|
553
|
+
return m(e, a.BANG, i, i + 1);
|
|
554
554
|
case 36:
|
|
555
|
-
return
|
|
555
|
+
return m(e, a.DOLLAR, i, i + 1);
|
|
556
556
|
case 38:
|
|
557
|
-
return
|
|
557
|
+
return m(e, a.AMP, i, i + 1);
|
|
558
558
|
case 40:
|
|
559
|
-
return
|
|
559
|
+
return m(e, a.PAREN_L, i, i + 1);
|
|
560
560
|
case 41:
|
|
561
|
-
return
|
|
561
|
+
return m(e, a.PAREN_R, i, i + 1);
|
|
562
562
|
case 46:
|
|
563
563
|
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
|
|
564
|
-
return
|
|
564
|
+
return m(e, a.SPREAD, i, i + 3);
|
|
565
565
|
break;
|
|
566
566
|
case 58:
|
|
567
|
-
return
|
|
567
|
+
return m(e, a.COLON, i, i + 1);
|
|
568
568
|
case 61:
|
|
569
|
-
return
|
|
569
|
+
return m(e, a.EQUALS, i, i + 1);
|
|
570
570
|
case 64:
|
|
571
|
-
return
|
|
571
|
+
return m(e, a.AT, i, i + 1);
|
|
572
572
|
case 91:
|
|
573
|
-
return
|
|
573
|
+
return m(e, a.BRACKET_L, i, i + 1);
|
|
574
574
|
case 93:
|
|
575
|
-
return
|
|
575
|
+
return m(e, a.BRACKET_R, i, i + 1);
|
|
576
576
|
case 123:
|
|
577
|
-
return
|
|
577
|
+
return m(e, a.BRACE_L, i, i + 1);
|
|
578
578
|
case 124:
|
|
579
|
-
return
|
|
579
|
+
return m(e, a.PIPE, i, i + 1);
|
|
580
580
|
case 125:
|
|
581
|
-
return
|
|
581
|
+
return m(e, a.BRACE_R, i, i + 1);
|
|
582
582
|
// StringValue
|
|
583
583
|
case 34:
|
|
584
|
-
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ?
|
|
584
|
+
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? He(e, i) : qe(e, i);
|
|
585
585
|
}
|
|
586
|
-
if (
|
|
587
|
-
return
|
|
586
|
+
if (S(s) || s === 45)
|
|
587
|
+
return Me(e, i, s);
|
|
588
588
|
if (ge(s))
|
|
589
|
-
return
|
|
590
|
-
throw
|
|
589
|
+
return Ye(e, i);
|
|
590
|
+
throw f(
|
|
591
591
|
e.source,
|
|
592
592
|
i,
|
|
593
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` :
|
|
593
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || $(n, i) ? `Unexpected character: ${D(e, i)}.` : `Invalid character: ${D(e, i)}.`
|
|
594
594
|
);
|
|
595
595
|
}
|
|
596
|
-
return
|
|
596
|
+
return m(e, a.EOF, r, r);
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Ve(e, t) {
|
|
599
599
|
const n = e.source.body, r = n.length;
|
|
600
600
|
let i = t + 1;
|
|
601
601
|
for (; i < r; ) {
|
|
602
602
|
const s = n.charCodeAt(i);
|
|
603
603
|
if (s === 10 || s === 13)
|
|
604
604
|
break;
|
|
605
|
-
if (
|
|
605
|
+
if (P(s))
|
|
606
606
|
++i;
|
|
607
607
|
else if ($(n, i))
|
|
608
608
|
i += 2;
|
|
609
609
|
else
|
|
610
610
|
break;
|
|
611
611
|
}
|
|
612
|
-
return
|
|
612
|
+
return m(
|
|
613
613
|
e,
|
|
614
614
|
a.COMMENT,
|
|
615
615
|
t,
|
|
@@ -617,12 +617,12 @@ function Ue(e, t) {
|
|
|
617
617
|
n.slice(t + 1, i)
|
|
618
618
|
);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Me(e, t, n) {
|
|
621
621
|
const r = e.source.body;
|
|
622
622
|
let i = t, s = n, o = !1;
|
|
623
623
|
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
624
|
-
if (s = r.charCodeAt(++i),
|
|
625
|
-
throw
|
|
624
|
+
if (s = r.charCodeAt(++i), S(s))
|
|
625
|
+
throw f(
|
|
626
626
|
e.source,
|
|
627
627
|
i,
|
|
628
628
|
`Invalid number, unexpected digit after 0: ${D(
|
|
@@ -633,7 +633,7 @@ function Ve(e, t, n) {
|
|
|
633
633
|
} else
|
|
634
634
|
i = V(e, i, s), s = r.charCodeAt(i);
|
|
635
635
|
if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = V(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = V(e, i, s), s = r.charCodeAt(i)), s === 46 || ge(s))
|
|
636
|
-
throw
|
|
636
|
+
throw f(
|
|
637
637
|
e.source,
|
|
638
638
|
i,
|
|
639
639
|
`Invalid number, expected digit but got: ${D(
|
|
@@ -641,7 +641,7 @@ function Ve(e, t, n) {
|
|
|
641
641
|
i
|
|
642
642
|
)}.`
|
|
643
643
|
);
|
|
644
|
-
return
|
|
644
|
+
return m(
|
|
645
645
|
e,
|
|
646
646
|
o ? a.FLOAT : a.INT,
|
|
647
647
|
t,
|
|
@@ -650,8 +650,8 @@ function Ve(e, t, n) {
|
|
|
650
650
|
);
|
|
651
651
|
}
|
|
652
652
|
function V(e, t, n) {
|
|
653
|
-
if (!
|
|
654
|
-
throw
|
|
653
|
+
if (!S(n))
|
|
654
|
+
throw f(
|
|
655
655
|
e.source,
|
|
656
656
|
t,
|
|
657
657
|
`Invalid number, expected digit but got: ${D(
|
|
@@ -661,31 +661,31 @@ function V(e, t, n) {
|
|
|
661
661
|
);
|
|
662
662
|
const r = e.source.body;
|
|
663
663
|
let i = t + 1;
|
|
664
|
-
for (;
|
|
664
|
+
for (; S(r.charCodeAt(i)); )
|
|
665
665
|
++i;
|
|
666
666
|
return i;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function qe(e, t) {
|
|
669
669
|
const n = e.source.body, r = n.length;
|
|
670
670
|
let i = t + 1, s = i, o = "";
|
|
671
671
|
for (; i < r; ) {
|
|
672
672
|
const l = n.charCodeAt(i);
|
|
673
673
|
if (l === 34)
|
|
674
|
-
return o += n.slice(s, i),
|
|
674
|
+
return o += n.slice(s, i), m(e, a.STRING, t, i + 1, o);
|
|
675
675
|
if (l === 92) {
|
|
676
676
|
o += n.slice(s, i);
|
|
677
|
-
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ?
|
|
677
|
+
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? ze(e, i) : Ge(e, i) : je(e, i);
|
|
678
678
|
o += h.value, i += h.size, s = i;
|
|
679
679
|
continue;
|
|
680
680
|
}
|
|
681
681
|
if (l === 10 || l === 13)
|
|
682
682
|
break;
|
|
683
|
-
if (
|
|
683
|
+
if (P(l))
|
|
684
684
|
++i;
|
|
685
685
|
else if ($(n, i))
|
|
686
686
|
i += 2;
|
|
687
687
|
else
|
|
688
|
-
throw
|
|
688
|
+
throw f(
|
|
689
689
|
e.source,
|
|
690
690
|
i,
|
|
691
691
|
`Invalid character within String: ${D(
|
|
@@ -694,25 +694,25 @@ function Me(e, t) {
|
|
|
694
694
|
)}.`
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
-
throw
|
|
697
|
+
throw f(e.source, i, "Unterminated string.");
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function ze(e, t) {
|
|
700
700
|
const n = e.source.body;
|
|
701
701
|
let r = 0, i = 3;
|
|
702
702
|
for (; i < 12; ) {
|
|
703
703
|
const s = n.charCodeAt(t + i++);
|
|
704
704
|
if (s === 125) {
|
|
705
|
-
if (i < 5 || !
|
|
705
|
+
if (i < 5 || !P(r))
|
|
706
706
|
break;
|
|
707
707
|
return {
|
|
708
708
|
value: String.fromCodePoint(r),
|
|
709
709
|
size: i
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
if (r = r << 4 |
|
|
712
|
+
if (r = r << 4 | x(s), r < 0)
|
|
713
713
|
break;
|
|
714
714
|
}
|
|
715
|
-
throw
|
|
715
|
+
throw f(
|
|
716
716
|
e.source,
|
|
717
717
|
t,
|
|
718
718
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -721,9 +721,9 @@ function qe(e, t) {
|
|
|
721
721
|
)}".`
|
|
722
722
|
);
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Ge(e, t) {
|
|
725
725
|
const n = e.source.body, r = J(n, t + 2);
|
|
726
|
-
if (
|
|
726
|
+
if (P(r))
|
|
727
727
|
return {
|
|
728
728
|
value: String.fromCodePoint(r),
|
|
729
729
|
size: 6
|
|
@@ -736,19 +736,19 @@ function ze(e, t) {
|
|
|
736
736
|
size: 12
|
|
737
737
|
};
|
|
738
738
|
}
|
|
739
|
-
throw
|
|
739
|
+
throw f(
|
|
740
740
|
e.source,
|
|
741
741
|
t,
|
|
742
742
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
743
743
|
);
|
|
744
744
|
}
|
|
745
745
|
function J(e, t) {
|
|
746
|
-
return
|
|
746
|
+
return x(e.charCodeAt(t)) << 12 | x(e.charCodeAt(t + 1)) << 8 | x(e.charCodeAt(t + 2)) << 4 | x(e.charCodeAt(t + 3));
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function x(e) {
|
|
749
749
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function je(e, t) {
|
|
752
752
|
const n = e.source.body;
|
|
753
753
|
switch (n.charCodeAt(t + 1)) {
|
|
754
754
|
case 34:
|
|
@@ -793,7 +793,7 @@ function Ge(e, t) {
|
|
|
793
793
|
size: 2
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
|
-
throw
|
|
796
|
+
throw f(
|
|
797
797
|
e.source,
|
|
798
798
|
t,
|
|
799
799
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -802,39 +802,39 @@ function Ge(e, t) {
|
|
|
802
802
|
)}".`
|
|
803
803
|
);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function He(e, t) {
|
|
806
806
|
const n = e.source.body, r = n.length;
|
|
807
807
|
let i = e.lineStart, s = t + 3, o = s, l = "";
|
|
808
808
|
const h = [];
|
|
809
809
|
for (; s < r; ) {
|
|
810
|
-
const
|
|
811
|
-
if (
|
|
810
|
+
const I = n.charCodeAt(s);
|
|
811
|
+
if (I === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
812
812
|
l += n.slice(o, s), h.push(l);
|
|
813
|
-
const
|
|
813
|
+
const g = m(
|
|
814
814
|
e,
|
|
815
815
|
a.BLOCK_STRING,
|
|
816
816
|
t,
|
|
817
817
|
s + 3,
|
|
818
818
|
// Return a string of the lines joined with U+000A.
|
|
819
|
-
|
|
819
|
+
we(h).join(`
|
|
820
820
|
`)
|
|
821
821
|
);
|
|
822
|
-
return e.line += h.length - 1, e.lineStart = i,
|
|
822
|
+
return e.line += h.length - 1, e.lineStart = i, g;
|
|
823
823
|
}
|
|
824
|
-
if (
|
|
824
|
+
if (I === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
825
825
|
l += n.slice(o, s), o = s + 1, s += 4;
|
|
826
826
|
continue;
|
|
827
827
|
}
|
|
828
|
-
if (
|
|
829
|
-
l += n.slice(o, s), h.push(l),
|
|
828
|
+
if (I === 10 || I === 13) {
|
|
829
|
+
l += n.slice(o, s), h.push(l), I === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", o = s, i = s;
|
|
830
830
|
continue;
|
|
831
831
|
}
|
|
832
|
-
if (
|
|
832
|
+
if (P(I))
|
|
833
833
|
++s;
|
|
834
834
|
else if ($(n, s))
|
|
835
835
|
s += 2;
|
|
836
836
|
else
|
|
837
|
-
throw
|
|
837
|
+
throw f(
|
|
838
838
|
e.source,
|
|
839
839
|
s,
|
|
840
840
|
`Invalid character within String: ${D(
|
|
@@ -843,19 +843,19 @@ function je(e, t) {
|
|
|
843
843
|
)}.`
|
|
844
844
|
);
|
|
845
845
|
}
|
|
846
|
-
throw
|
|
846
|
+
throw f(e.source, s, "Unterminated string.");
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function Ye(e, t) {
|
|
849
849
|
const n = e.source.body, r = n.length;
|
|
850
850
|
let i = t + 1;
|
|
851
851
|
for (; i < r; ) {
|
|
852
852
|
const s = n.charCodeAt(i);
|
|
853
|
-
if (
|
|
853
|
+
if (Re(s))
|
|
854
854
|
++i;
|
|
855
855
|
else
|
|
856
856
|
break;
|
|
857
857
|
}
|
|
858
|
-
return
|
|
858
|
+
return m(
|
|
859
859
|
e,
|
|
860
860
|
a.NAME,
|
|
861
861
|
t,
|
|
@@ -863,7 +863,7 @@ function He(e, t) {
|
|
|
863
863
|
n.slice(t, i)
|
|
864
864
|
);
|
|
865
865
|
}
|
|
866
|
-
const
|
|
866
|
+
const Qe = 10, Ie = 2;
|
|
867
867
|
function Ee(e) {
|
|
868
868
|
return B(e, []);
|
|
869
869
|
}
|
|
@@ -874,45 +874,45 @@ function B(e, t) {
|
|
|
874
874
|
case "function":
|
|
875
875
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
876
876
|
case "object":
|
|
877
|
-
return
|
|
877
|
+
return Xe(e, t);
|
|
878
878
|
default:
|
|
879
879
|
return String(e);
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function Xe(e, t) {
|
|
883
883
|
if (e === null)
|
|
884
884
|
return "null";
|
|
885
885
|
if (t.includes(e))
|
|
886
886
|
return "[Circular]";
|
|
887
887
|
const n = [...t, e];
|
|
888
|
-
if (
|
|
888
|
+
if (Je(e)) {
|
|
889
889
|
const r = e.toJSON();
|
|
890
890
|
if (r !== e)
|
|
891
891
|
return typeof r == "string" ? r : B(r, n);
|
|
892
892
|
} else if (Array.isArray(e))
|
|
893
|
-
return
|
|
894
|
-
return
|
|
893
|
+
return Ze(e, n);
|
|
894
|
+
return We(e, n);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function Je(e) {
|
|
897
897
|
return typeof e.toJSON == "function";
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function We(e, t) {
|
|
900
900
|
const n = Object.entries(e);
|
|
901
|
-
return n.length === 0 ? "{}" : t.length > Ie ? "[" +
|
|
901
|
+
return n.length === 0 ? "{}" : t.length > Ie ? "[" + Ke(e) + "]" : "{ " + n.map(
|
|
902
902
|
([i, s]) => i + ": " + B(s, t)
|
|
903
903
|
).join(", ") + " }";
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function Ze(e, t) {
|
|
906
906
|
if (e.length === 0)
|
|
907
907
|
return "[]";
|
|
908
908
|
if (t.length > Ie)
|
|
909
909
|
return "[Array]";
|
|
910
|
-
const n = Math.min(
|
|
910
|
+
const n = Math.min(Qe, e.length), r = e.length - n, i = [];
|
|
911
911
|
for (let s = 0; s < n; ++s)
|
|
912
912
|
i.push(B(e[s], t));
|
|
913
913
|
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Ke(e) {
|
|
916
916
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
917
917
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
918
918
|
const n = e.constructor.name;
|
|
@@ -921,11 +921,11 @@ function Ze(e) {
|
|
|
921
921
|
}
|
|
922
922
|
return t;
|
|
923
923
|
}
|
|
924
|
-
const
|
|
925
|
-
process.env.NODE_ENV === "production",
|
|
924
|
+
const et = globalThis.process && // eslint-disable-next-line no-undef
|
|
925
|
+
process.env.NODE_ENV === "production", tt = (
|
|
926
926
|
/* c8 ignore next 6 */
|
|
927
927
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
928
|
-
|
|
928
|
+
et ? function(t, n) {
|
|
929
929
|
return t instanceof n;
|
|
930
930
|
} : function(t, n) {
|
|
931
931
|
if (t instanceof n)
|
|
@@ -972,24 +972,24 @@ class ye {
|
|
|
972
972
|
return "Source";
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
return
|
|
975
|
+
function nt(e) {
|
|
976
|
+
return tt(e, ye);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
const n = new
|
|
978
|
+
function rt(e, t) {
|
|
979
|
+
const n = new it(e, t), r = n.parseDocument();
|
|
980
980
|
return Object.defineProperty(r, "tokenCount", {
|
|
981
981
|
enumerable: !1,
|
|
982
982
|
value: n.tokenCount
|
|
983
983
|
}), r;
|
|
984
984
|
}
|
|
985
|
-
class
|
|
985
|
+
class it {
|
|
986
986
|
constructor(t, n = {}) {
|
|
987
987
|
const { lexer: r, ...i } = n;
|
|
988
988
|
if (r)
|
|
989
989
|
this._lexer = r;
|
|
990
990
|
else {
|
|
991
|
-
const s =
|
|
992
|
-
this._lexer = new
|
|
991
|
+
const s = nt(t) ? t : new ye(t);
|
|
992
|
+
this._lexer = new $e(s);
|
|
993
993
|
}
|
|
994
994
|
this._options = i, this._tokenCounter = 0;
|
|
995
995
|
}
|
|
@@ -1002,7 +1002,7 @@ class rt {
|
|
|
1002
1002
|
parseName() {
|
|
1003
1003
|
const t = this.expectToken(a.NAME);
|
|
1004
1004
|
return this.node(t, {
|
|
1005
|
-
kind:
|
|
1005
|
+
kind: d.NAME,
|
|
1006
1006
|
value: t.value
|
|
1007
1007
|
});
|
|
1008
1008
|
}
|
|
@@ -1012,7 +1012,7 @@ class rt {
|
|
|
1012
1012
|
*/
|
|
1013
1013
|
parseDocument() {
|
|
1014
1014
|
return this.node(this._lexer.token, {
|
|
1015
|
-
kind:
|
|
1015
|
+
kind: d.DOCUMENT,
|
|
1016
1016
|
definitions: this.many(
|
|
1017
1017
|
a.SOF,
|
|
1018
1018
|
this.parseDefinition,
|
|
@@ -1048,7 +1048,7 @@ class rt {
|
|
|
1048
1048
|
return this.parseOperationDefinition();
|
|
1049
1049
|
const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1050
1050
|
if (t && n.kind === a.BRACE_L)
|
|
1051
|
-
throw
|
|
1051
|
+
throw f(
|
|
1052
1052
|
this._lexer.source,
|
|
1053
1053
|
this._lexer.token.start,
|
|
1054
1054
|
"Unexpected description, descriptions are not supported on shorthand queries."
|
|
@@ -1081,7 +1081,7 @@ class rt {
|
|
|
1081
1081
|
return this.parseFragmentDefinition();
|
|
1082
1082
|
}
|
|
1083
1083
|
if (t)
|
|
1084
|
-
throw
|
|
1084
|
+
throw f(
|
|
1085
1085
|
this._lexer.source,
|
|
1086
1086
|
this._lexer.token.start,
|
|
1087
1087
|
"Unexpected description, only GraphQL definitions support descriptions."
|
|
@@ -1101,7 +1101,7 @@ class rt {
|
|
|
1101
1101
|
const t = this._lexer.token;
|
|
1102
1102
|
if (this.peek(a.BRACE_L))
|
|
1103
1103
|
return this.node(t, {
|
|
1104
|
-
kind:
|
|
1104
|
+
kind: d.OPERATION_DEFINITION,
|
|
1105
1105
|
operation: N.QUERY,
|
|
1106
1106
|
description: void 0,
|
|
1107
1107
|
name: void 0,
|
|
@@ -1112,7 +1112,7 @@ class rt {
|
|
|
1112
1112
|
const n = this.parseDescription(), r = this.parseOperationType();
|
|
1113
1113
|
let i;
|
|
1114
1114
|
return this.peek(a.NAME) && (i = this.parseName()), this.node(t, {
|
|
1115
|
-
kind:
|
|
1115
|
+
kind: d.OPERATION_DEFINITION,
|
|
1116
1116
|
operation: r,
|
|
1117
1117
|
description: n,
|
|
1118
1118
|
name: i,
|
|
@@ -1151,7 +1151,7 @@ class rt {
|
|
|
1151
1151
|
*/
|
|
1152
1152
|
parseVariableDefinition() {
|
|
1153
1153
|
return this.node(this._lexer.token, {
|
|
1154
|
-
kind:
|
|
1154
|
+
kind: d.VARIABLE_DEFINITION,
|
|
1155
1155
|
description: this.parseDescription(),
|
|
1156
1156
|
variable: this.parseVariable(),
|
|
1157
1157
|
type: (this.expectToken(a.COLON), this.parseTypeReference()),
|
|
@@ -1165,7 +1165,7 @@ class rt {
|
|
|
1165
1165
|
parseVariable() {
|
|
1166
1166
|
const t = this._lexer.token;
|
|
1167
1167
|
return this.expectToken(a.DOLLAR), this.node(t, {
|
|
1168
|
-
kind:
|
|
1168
|
+
kind: d.VARIABLE,
|
|
1169
1169
|
name: this.parseName()
|
|
1170
1170
|
});
|
|
1171
1171
|
}
|
|
@@ -1176,7 +1176,7 @@ class rt {
|
|
|
1176
1176
|
*/
|
|
1177
1177
|
parseSelectionSet() {
|
|
1178
1178
|
return this.node(this._lexer.token, {
|
|
1179
|
-
kind:
|
|
1179
|
+
kind: d.SELECTION_SET,
|
|
1180
1180
|
selections: this.many(
|
|
1181
1181
|
a.BRACE_L,
|
|
1182
1182
|
this.parseSelection,
|
|
@@ -1202,7 +1202,7 @@ class rt {
|
|
|
1202
1202
|
const t = this._lexer.token, n = this.parseName();
|
|
1203
1203
|
let r, i;
|
|
1204
1204
|
return this.expectOptionalToken(a.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
|
|
1205
|
-
kind:
|
|
1205
|
+
kind: d.FIELD,
|
|
1206
1206
|
alias: r,
|
|
1207
1207
|
name: i,
|
|
1208
1208
|
arguments: this.parseArguments(!1),
|
|
@@ -1223,7 +1223,7 @@ class rt {
|
|
|
1223
1223
|
parseArgument(t = !1) {
|
|
1224
1224
|
const n = this._lexer.token, r = this.parseName();
|
|
1225
1225
|
return this.expectToken(a.COLON), this.node(n, {
|
|
1226
|
-
kind:
|
|
1226
|
+
kind: d.ARGUMENT,
|
|
1227
1227
|
name: r,
|
|
1228
1228
|
value: this.parseValueLiteral(t)
|
|
1229
1229
|
});
|
|
@@ -1244,11 +1244,11 @@ class rt {
|
|
|
1244
1244
|
this.expectToken(a.SPREAD);
|
|
1245
1245
|
const n = this.expectOptionalKeyword("on");
|
|
1246
1246
|
return !n && this.peek(a.NAME) ? this.node(t, {
|
|
1247
|
-
kind:
|
|
1247
|
+
kind: d.FRAGMENT_SPREAD,
|
|
1248
1248
|
name: this.parseFragmentName(),
|
|
1249
1249
|
directives: this.parseDirectives(!1)
|
|
1250
1250
|
}) : this.node(t, {
|
|
1251
|
-
kind:
|
|
1251
|
+
kind: d.INLINE_FRAGMENT,
|
|
1252
1252
|
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1253
1253
|
directives: this.parseDirectives(!1),
|
|
1254
1254
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1263,7 +1263,7 @@ class rt {
|
|
|
1263
1263
|
parseFragmentDefinition() {
|
|
1264
1264
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1265
1265
|
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
|
|
1266
|
-
kind:
|
|
1266
|
+
kind: d.FRAGMENT_DEFINITION,
|
|
1267
1267
|
description: n,
|
|
1268
1268
|
name: this.parseFragmentName(),
|
|
1269
1269
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
@@ -1271,7 +1271,7 @@ class rt {
|
|
|
1271
1271
|
directives: this.parseDirectives(!1),
|
|
1272
1272
|
selectionSet: this.parseSelectionSet()
|
|
1273
1273
|
}) : this.node(t, {
|
|
1274
|
-
kind:
|
|
1274
|
+
kind: d.FRAGMENT_DEFINITION,
|
|
1275
1275
|
description: n,
|
|
1276
1276
|
name: this.parseFragmentName(),
|
|
1277
1277
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
@@ -1315,12 +1315,12 @@ class rt {
|
|
|
1315
1315
|
return this.parseObject(t);
|
|
1316
1316
|
case a.INT:
|
|
1317
1317
|
return this.advanceLexer(), this.node(n, {
|
|
1318
|
-
kind:
|
|
1318
|
+
kind: d.INT,
|
|
1319
1319
|
value: n.value
|
|
1320
1320
|
});
|
|
1321
1321
|
case a.FLOAT:
|
|
1322
1322
|
return this.advanceLexer(), this.node(n, {
|
|
1323
|
-
kind:
|
|
1323
|
+
kind: d.FLOAT,
|
|
1324
1324
|
value: n.value
|
|
1325
1325
|
});
|
|
1326
1326
|
case a.STRING:
|
|
@@ -1330,21 +1330,21 @@ class rt {
|
|
|
1330
1330
|
switch (this.advanceLexer(), n.value) {
|
|
1331
1331
|
case "true":
|
|
1332
1332
|
return this.node(n, {
|
|
1333
|
-
kind:
|
|
1333
|
+
kind: d.BOOLEAN,
|
|
1334
1334
|
value: !0
|
|
1335
1335
|
});
|
|
1336
1336
|
case "false":
|
|
1337
1337
|
return this.node(n, {
|
|
1338
|
-
kind:
|
|
1338
|
+
kind: d.BOOLEAN,
|
|
1339
1339
|
value: !1
|
|
1340
1340
|
});
|
|
1341
1341
|
case "null":
|
|
1342
1342
|
return this.node(n, {
|
|
1343
|
-
kind:
|
|
1343
|
+
kind: d.NULL
|
|
1344
1344
|
});
|
|
1345
1345
|
default:
|
|
1346
1346
|
return this.node(n, {
|
|
1347
|
-
kind:
|
|
1347
|
+
kind: d.ENUM,
|
|
1348
1348
|
value: n.value
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
@@ -1352,7 +1352,7 @@ class rt {
|
|
|
1352
1352
|
if (t)
|
|
1353
1353
|
if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
|
|
1354
1354
|
const r = this._lexer.token.value;
|
|
1355
|
-
throw
|
|
1355
|
+
throw f(
|
|
1356
1356
|
this._lexer.source,
|
|
1357
1357
|
n.start,
|
|
1358
1358
|
`Unexpected variable "$${r}" in constant value.`
|
|
@@ -1370,7 +1370,7 @@ class rt {
|
|
|
1370
1370
|
parseStringLiteral() {
|
|
1371
1371
|
const t = this._lexer.token;
|
|
1372
1372
|
return this.advanceLexer(), this.node(t, {
|
|
1373
|
-
kind:
|
|
1373
|
+
kind: d.STRING,
|
|
1374
1374
|
value: t.value,
|
|
1375
1375
|
block: t.kind === a.BLOCK_STRING
|
|
1376
1376
|
});
|
|
@@ -1383,7 +1383,7 @@ class rt {
|
|
|
1383
1383
|
parseList(t) {
|
|
1384
1384
|
const n = () => this.parseValueLiteral(t);
|
|
1385
1385
|
return this.node(this._lexer.token, {
|
|
1386
|
-
kind:
|
|
1386
|
+
kind: d.LIST,
|
|
1387
1387
|
values: this.any(a.BRACKET_L, n, a.BRACKET_R)
|
|
1388
1388
|
});
|
|
1389
1389
|
}
|
|
@@ -1397,7 +1397,7 @@ class rt {
|
|
|
1397
1397
|
parseObject(t) {
|
|
1398
1398
|
const n = () => this.parseObjectField(t);
|
|
1399
1399
|
return this.node(this._lexer.token, {
|
|
1400
|
-
kind:
|
|
1400
|
+
kind: d.OBJECT,
|
|
1401
1401
|
fields: this.any(a.BRACE_L, n, a.BRACE_R)
|
|
1402
1402
|
});
|
|
1403
1403
|
}
|
|
@@ -1407,7 +1407,7 @@ class rt {
|
|
|
1407
1407
|
parseObjectField(t) {
|
|
1408
1408
|
const n = this._lexer.token, r = this.parseName();
|
|
1409
1409
|
return this.expectToken(a.COLON), this.node(n, {
|
|
1410
|
-
kind:
|
|
1410
|
+
kind: d.OBJECT_FIELD,
|
|
1411
1411
|
name: r,
|
|
1412
1412
|
value: this.parseValueLiteral(t)
|
|
1413
1413
|
});
|
|
@@ -1433,7 +1433,7 @@ class rt {
|
|
|
1433
1433
|
parseDirective(t) {
|
|
1434
1434
|
const n = this._lexer.token;
|
|
1435
1435
|
return this.expectToken(a.AT), this.node(n, {
|
|
1436
|
-
kind:
|
|
1436
|
+
kind: d.DIRECTIVE,
|
|
1437
1437
|
name: this.parseName(),
|
|
1438
1438
|
arguments: this.parseArguments(t)
|
|
1439
1439
|
});
|
|
@@ -1451,13 +1451,13 @@ class rt {
|
|
|
1451
1451
|
if (this.expectOptionalToken(a.BRACKET_L)) {
|
|
1452
1452
|
const r = this.parseTypeReference();
|
|
1453
1453
|
this.expectToken(a.BRACKET_R), n = this.node(t, {
|
|
1454
|
-
kind:
|
|
1454
|
+
kind: d.LIST_TYPE,
|
|
1455
1455
|
type: r
|
|
1456
1456
|
});
|
|
1457
1457
|
} else
|
|
1458
1458
|
n = this.parseNamedType();
|
|
1459
1459
|
return this.expectOptionalToken(a.BANG) ? this.node(t, {
|
|
1460
|
-
kind:
|
|
1460
|
+
kind: d.NON_NULL_TYPE,
|
|
1461
1461
|
type: n
|
|
1462
1462
|
}) : n;
|
|
1463
1463
|
}
|
|
@@ -1466,7 +1466,7 @@ class rt {
|
|
|
1466
1466
|
*/
|
|
1467
1467
|
parseNamedType() {
|
|
1468
1468
|
return this.node(this._lexer.token, {
|
|
1469
|
-
kind:
|
|
1469
|
+
kind: d.NAMED_TYPE,
|
|
1470
1470
|
name: this.parseName()
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
@@ -1495,7 +1495,7 @@ class rt {
|
|
|
1495
1495
|
a.BRACE_R
|
|
1496
1496
|
);
|
|
1497
1497
|
return this.node(t, {
|
|
1498
|
-
kind:
|
|
1498
|
+
kind: d.SCHEMA_DEFINITION,
|
|
1499
1499
|
description: n,
|
|
1500
1500
|
directives: r,
|
|
1501
1501
|
operationTypes: i
|
|
@@ -1509,7 +1509,7 @@ class rt {
|
|
|
1509
1509
|
this.expectToken(a.COLON);
|
|
1510
1510
|
const r = this.parseNamedType();
|
|
1511
1511
|
return this.node(t, {
|
|
1512
|
-
kind:
|
|
1512
|
+
kind: d.OPERATION_TYPE_DEFINITION,
|
|
1513
1513
|
operation: n,
|
|
1514
1514
|
type: r
|
|
1515
1515
|
});
|
|
@@ -1522,7 +1522,7 @@ class rt {
|
|
|
1522
1522
|
this.expectKeyword("scalar");
|
|
1523
1523
|
const r = this.parseName(), i = this.parseConstDirectives();
|
|
1524
1524
|
return this.node(t, {
|
|
1525
|
-
kind:
|
|
1525
|
+
kind: d.SCALAR_TYPE_DEFINITION,
|
|
1526
1526
|
description: n,
|
|
1527
1527
|
name: r,
|
|
1528
1528
|
directives: i
|
|
@@ -1538,7 +1538,7 @@ class rt {
|
|
|
1538
1538
|
this.expectKeyword("type");
|
|
1539
1539
|
const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1540
1540
|
return this.node(t, {
|
|
1541
|
-
kind:
|
|
1541
|
+
kind: d.OBJECT_TYPE_DEFINITION,
|
|
1542
1542
|
description: n,
|
|
1543
1543
|
name: r,
|
|
1544
1544
|
interfaces: i,
|
|
@@ -1575,7 +1575,7 @@ class rt {
|
|
|
1575
1575
|
this.expectToken(a.COLON);
|
|
1576
1576
|
const s = this.parseTypeReference(), o = this.parseConstDirectives();
|
|
1577
1577
|
return this.node(t, {
|
|
1578
|
-
kind:
|
|
1578
|
+
kind: d.FIELD_DEFINITION,
|
|
1579
1579
|
description: n,
|
|
1580
1580
|
name: r,
|
|
1581
1581
|
arguments: i,
|
|
@@ -1605,7 +1605,7 @@ class rt {
|
|
|
1605
1605
|
this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1606
1606
|
const o = this.parseConstDirectives();
|
|
1607
1607
|
return this.node(t, {
|
|
1608
|
-
kind:
|
|
1608
|
+
kind: d.INPUT_VALUE_DEFINITION,
|
|
1609
1609
|
description: n,
|
|
1610
1610
|
name: r,
|
|
1611
1611
|
type: i,
|
|
@@ -1622,7 +1622,7 @@ class rt {
|
|
|
1622
1622
|
this.expectKeyword("interface");
|
|
1623
1623
|
const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1624
1624
|
return this.node(t, {
|
|
1625
|
-
kind:
|
|
1625
|
+
kind: d.INTERFACE_TYPE_DEFINITION,
|
|
1626
1626
|
description: n,
|
|
1627
1627
|
name: r,
|
|
1628
1628
|
interfaces: i,
|
|
@@ -1639,7 +1639,7 @@ class rt {
|
|
|
1639
1639
|
this.expectKeyword("union");
|
|
1640
1640
|
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1641
1641
|
return this.node(t, {
|
|
1642
|
-
kind:
|
|
1642
|
+
kind: d.UNION_TYPE_DEFINITION,
|
|
1643
1643
|
description: n,
|
|
1644
1644
|
name: r,
|
|
1645
1645
|
directives: i,
|
|
@@ -1663,7 +1663,7 @@ class rt {
|
|
|
1663
1663
|
this.expectKeyword("enum");
|
|
1664
1664
|
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1665
1665
|
return this.node(t, {
|
|
1666
|
-
kind:
|
|
1666
|
+
kind: d.ENUM_TYPE_DEFINITION,
|
|
1667
1667
|
description: n,
|
|
1668
1668
|
name: r,
|
|
1669
1669
|
directives: i,
|
|
@@ -1688,7 +1688,7 @@ class rt {
|
|
|
1688
1688
|
parseEnumValueDefinition() {
|
|
1689
1689
|
const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
|
|
1690
1690
|
return this.node(t, {
|
|
1691
|
-
kind:
|
|
1691
|
+
kind: d.ENUM_VALUE_DEFINITION,
|
|
1692
1692
|
description: n,
|
|
1693
1693
|
name: r,
|
|
1694
1694
|
directives: i
|
|
@@ -1699,10 +1699,10 @@ class rt {
|
|
|
1699
1699
|
*/
|
|
1700
1700
|
parseEnumValueName() {
|
|
1701
1701
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
1702
|
-
throw
|
|
1702
|
+
throw f(
|
|
1703
1703
|
this._lexer.source,
|
|
1704
1704
|
this._lexer.token.start,
|
|
1705
|
-
`${
|
|
1705
|
+
`${_(
|
|
1706
1706
|
this._lexer.token
|
|
1707
1707
|
)} is reserved and cannot be used for an enum value.`
|
|
1708
1708
|
);
|
|
@@ -1717,7 +1717,7 @@ class rt {
|
|
|
1717
1717
|
this.expectKeyword("input");
|
|
1718
1718
|
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1719
1719
|
return this.node(t, {
|
|
1720
|
-
kind:
|
|
1720
|
+
kind: d.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1721
1721
|
description: n,
|
|
1722
1722
|
name: r,
|
|
1723
1723
|
directives: i,
|
|
@@ -1788,7 +1788,7 @@ class rt {
|
|
|
1788
1788
|
if (n.length === 0 && r.length === 0)
|
|
1789
1789
|
throw this.unexpected();
|
|
1790
1790
|
return this.node(t, {
|
|
1791
|
-
kind:
|
|
1791
|
+
kind: d.SCHEMA_EXTENSION,
|
|
1792
1792
|
directives: n,
|
|
1793
1793
|
operationTypes: r
|
|
1794
1794
|
});
|
|
@@ -1804,7 +1804,7 @@ class rt {
|
|
|
1804
1804
|
if (r.length === 0)
|
|
1805
1805
|
throw this.unexpected();
|
|
1806
1806
|
return this.node(t, {
|
|
1807
|
-
kind:
|
|
1807
|
+
kind: d.SCALAR_TYPE_EXTENSION,
|
|
1808
1808
|
name: n,
|
|
1809
1809
|
directives: r
|
|
1810
1810
|
});
|
|
@@ -1822,7 +1822,7 @@ class rt {
|
|
|
1822
1822
|
if (r.length === 0 && i.length === 0 && s.length === 0)
|
|
1823
1823
|
throw this.unexpected();
|
|
1824
1824
|
return this.node(t, {
|
|
1825
|
-
kind:
|
|
1825
|
+
kind: d.OBJECT_TYPE_EXTENSION,
|
|
1826
1826
|
name: n,
|
|
1827
1827
|
interfaces: r,
|
|
1828
1828
|
directives: i,
|
|
@@ -1842,7 +1842,7 @@ class rt {
|
|
|
1842
1842
|
if (r.length === 0 && i.length === 0 && s.length === 0)
|
|
1843
1843
|
throw this.unexpected();
|
|
1844
1844
|
return this.node(t, {
|
|
1845
|
-
kind:
|
|
1845
|
+
kind: d.INTERFACE_TYPE_EXTENSION,
|
|
1846
1846
|
name: n,
|
|
1847
1847
|
interfaces: r,
|
|
1848
1848
|
directives: i,
|
|
@@ -1861,7 +1861,7 @@ class rt {
|
|
|
1861
1861
|
if (r.length === 0 && i.length === 0)
|
|
1862
1862
|
throw this.unexpected();
|
|
1863
1863
|
return this.node(t, {
|
|
1864
|
-
kind:
|
|
1864
|
+
kind: d.UNION_TYPE_EXTENSION,
|
|
1865
1865
|
name: n,
|
|
1866
1866
|
directives: r,
|
|
1867
1867
|
types: i
|
|
@@ -1879,7 +1879,7 @@ class rt {
|
|
|
1879
1879
|
if (r.length === 0 && i.length === 0)
|
|
1880
1880
|
throw this.unexpected();
|
|
1881
1881
|
return this.node(t, {
|
|
1882
|
-
kind:
|
|
1882
|
+
kind: d.ENUM_TYPE_EXTENSION,
|
|
1883
1883
|
name: n,
|
|
1884
1884
|
directives: r,
|
|
1885
1885
|
values: i
|
|
@@ -1897,7 +1897,7 @@ class rt {
|
|
|
1897
1897
|
if (r.length === 0 && i.length === 0)
|
|
1898
1898
|
throw this.unexpected();
|
|
1899
1899
|
return this.node(t, {
|
|
1900
|
-
kind:
|
|
1900
|
+
kind: d.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1901
1901
|
name: n,
|
|
1902
1902
|
directives: r,
|
|
1903
1903
|
fields: i
|
|
@@ -1916,7 +1916,7 @@ class rt {
|
|
|
1916
1916
|
this.expectKeyword("on");
|
|
1917
1917
|
const o = this.parseDirectiveLocations();
|
|
1918
1918
|
return this.node(t, {
|
|
1919
|
-
kind:
|
|
1919
|
+
kind: d.DIRECTIVE_DEFINITION,
|
|
1920
1920
|
description: n,
|
|
1921
1921
|
name: r,
|
|
1922
1922
|
arguments: i,
|
|
@@ -1980,23 +1980,23 @@ class rt {
|
|
|
1980
1980
|
!n && this.expectOptionalToken(a.DOT) && (i = this.parseName());
|
|
1981
1981
|
let s;
|
|
1982
1982
|
return (n || i) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(t, {
|
|
1983
|
-
kind:
|
|
1983
|
+
kind: d.DIRECTIVE_ARGUMENT_COORDINATE,
|
|
1984
1984
|
name: r,
|
|
1985
1985
|
argumentName: s
|
|
1986
1986
|
}) : this.node(t, {
|
|
1987
|
-
kind:
|
|
1987
|
+
kind: d.DIRECTIVE_COORDINATE,
|
|
1988
1988
|
name: r
|
|
1989
1989
|
}) : i ? s ? this.node(t, {
|
|
1990
|
-
kind:
|
|
1990
|
+
kind: d.ARGUMENT_COORDINATE,
|
|
1991
1991
|
name: r,
|
|
1992
1992
|
fieldName: i,
|
|
1993
1993
|
argumentName: s
|
|
1994
1994
|
}) : this.node(t, {
|
|
1995
|
-
kind:
|
|
1995
|
+
kind: d.MEMBER_COORDINATE,
|
|
1996
1996
|
name: r,
|
|
1997
1997
|
memberName: i
|
|
1998
1998
|
}) : this.node(t, {
|
|
1999
|
-
kind:
|
|
1999
|
+
kind: d.TYPE_COORDINATE,
|
|
2000
2000
|
name: r
|
|
2001
2001
|
});
|
|
2002
2002
|
}
|
|
@@ -2007,7 +2007,7 @@ class rt {
|
|
|
2007
2007
|
* given parsed object.
|
|
2008
2008
|
*/
|
|
2009
2009
|
node(t, n) {
|
|
2010
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
2010
|
+
return this._options.noLocation !== !0 && (n.loc = new Ce(
|
|
2011
2011
|
t,
|
|
2012
2012
|
this._lexer.lastToken,
|
|
2013
2013
|
this._lexer.source
|
|
@@ -2027,10 +2027,10 @@ class rt {
|
|
|
2027
2027
|
const n = this._lexer.token;
|
|
2028
2028
|
if (n.kind === t)
|
|
2029
2029
|
return this.advanceLexer(), n;
|
|
2030
|
-
throw
|
|
2030
|
+
throw f(
|
|
2031
2031
|
this._lexer.source,
|
|
2032
2032
|
n.start,
|
|
2033
|
-
`Expected ${ke(t)}, found ${
|
|
2033
|
+
`Expected ${ke(t)}, found ${_(n)}.`
|
|
2034
2034
|
);
|
|
2035
2035
|
}
|
|
2036
2036
|
/**
|
|
@@ -2049,10 +2049,10 @@ class rt {
|
|
|
2049
2049
|
if (n.kind === a.NAME && n.value === t)
|
|
2050
2050
|
this.advanceLexer();
|
|
2051
2051
|
else
|
|
2052
|
-
throw
|
|
2052
|
+
throw f(
|
|
2053
2053
|
this._lexer.source,
|
|
2054
2054
|
n.start,
|
|
2055
|
-
`Expected "${t}", found ${
|
|
2055
|
+
`Expected "${t}", found ${_(n)}.`
|
|
2056
2056
|
);
|
|
2057
2057
|
}
|
|
2058
2058
|
/**
|
|
@@ -2068,10 +2068,10 @@ class rt {
|
|
|
2068
2068
|
*/
|
|
2069
2069
|
unexpected(t) {
|
|
2070
2070
|
const n = t ?? this._lexer.token;
|
|
2071
|
-
return
|
|
2071
|
+
return f(
|
|
2072
2072
|
this._lexer.source,
|
|
2073
2073
|
n.start,
|
|
2074
|
-
`Unexpected ${
|
|
2074
|
+
`Unexpected ${_(n)}.`
|
|
2075
2075
|
);
|
|
2076
2076
|
}
|
|
2077
2077
|
/**
|
|
@@ -2131,32 +2131,32 @@ class rt {
|
|
|
2131
2131
|
advanceLexer() {
|
|
2132
2132
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2133
2133
|
if (n.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
|
|
2134
|
-
throw
|
|
2134
|
+
throw f(
|
|
2135
2135
|
this._lexer.source,
|
|
2136
2136
|
n.start,
|
|
2137
2137
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
2138
2138
|
);
|
|
2139
2139
|
}
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function _(e) {
|
|
2142
2142
|
const t = e.value;
|
|
2143
2143
|
return ke(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2144
2144
|
}
|
|
2145
2145
|
function ke(e) {
|
|
2146
|
-
return
|
|
2146
|
+
return Be(e) ? `"${e}"` : e;
|
|
2147
2147
|
}
|
|
2148
|
-
var
|
|
2148
|
+
var L = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), Ae = !0, F = !1;
|
|
2149
2149
|
function Oe(e) {
|
|
2150
2150
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2151
2151
|
}
|
|
2152
|
-
function
|
|
2152
|
+
function st(e) {
|
|
2153
2153
|
return Oe(e.source.body.substring(e.start, e.end));
|
|
2154
2154
|
}
|
|
2155
|
-
function
|
|
2155
|
+
function at(e) {
|
|
2156
2156
|
var t = /* @__PURE__ */ new Set(), n = [];
|
|
2157
2157
|
return e.definitions.forEach(function(r) {
|
|
2158
2158
|
if (r.kind === "FragmentDefinition") {
|
|
2159
|
-
var i = r.name.value, s =
|
|
2159
|
+
var i = r.name.value, s = st(r.loc), o = z.get(i);
|
|
2160
2160
|
o && !o.has(s) ? Ae && console.warn("Warning: fragment with name " + i + ` already exists.
|
|
2161
2161
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
2162
2162
|
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || z.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
|
|
@@ -2164,7 +2164,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) :
|
|
|
2164
2164
|
n.push(r);
|
|
2165
2165
|
}), w(w({}, e), { definitions: n });
|
|
2166
2166
|
}
|
|
2167
|
-
function
|
|
2167
|
+
function ot(e) {
|
|
2168
2168
|
var t = new Set(e.definitions);
|
|
2169
2169
|
t.forEach(function(r) {
|
|
2170
2170
|
r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
|
|
@@ -2175,18 +2175,18 @@ function at(e) {
|
|
|
2175
2175
|
var n = e.loc;
|
|
2176
2176
|
return n && (delete n.startToken, delete n.endToken), e;
|
|
2177
2177
|
}
|
|
2178
|
-
function
|
|
2178
|
+
function ct(e) {
|
|
2179
2179
|
var t = Oe(e);
|
|
2180
|
-
if (!
|
|
2181
|
-
var n =
|
|
2180
|
+
if (!L.has(t)) {
|
|
2181
|
+
var n = rt(e, {
|
|
2182
2182
|
experimentalFragmentVariables: F,
|
|
2183
2183
|
allowLegacyFragmentVariables: F
|
|
2184
2184
|
});
|
|
2185
2185
|
if (!n || n.kind !== "Document")
|
|
2186
2186
|
throw new Error("Not a valid GraphQL document.");
|
|
2187
|
-
|
|
2187
|
+
L.set(t, ot(at(n)));
|
|
2188
2188
|
}
|
|
2189
|
-
return
|
|
2189
|
+
return L.get(t);
|
|
2190
2190
|
}
|
|
2191
2191
|
function u(e) {
|
|
2192
2192
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
@@ -2195,32 +2195,32 @@ function u(e) {
|
|
|
2195
2195
|
var r = e[0];
|
|
2196
2196
|
return t.forEach(function(i, s) {
|
|
2197
2197
|
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
2198
|
-
}),
|
|
2199
|
-
}
|
|
2200
|
-
function ct() {
|
|
2201
|
-
_.clear(), z.clear();
|
|
2198
|
+
}), ct(r);
|
|
2202
2199
|
}
|
|
2203
2200
|
function dt() {
|
|
2204
|
-
|
|
2201
|
+
L.clear(), z.clear();
|
|
2205
2202
|
}
|
|
2206
2203
|
function ut() {
|
|
2207
|
-
|
|
2204
|
+
Ae = !1;
|
|
2208
2205
|
}
|
|
2209
2206
|
function lt() {
|
|
2207
|
+
F = !0;
|
|
2208
|
+
}
|
|
2209
|
+
function ht() {
|
|
2210
2210
|
F = !1;
|
|
2211
2211
|
}
|
|
2212
|
-
var
|
|
2212
|
+
var b = {
|
|
2213
2213
|
gql: u,
|
|
2214
|
-
resetCaches:
|
|
2215
|
-
disableFragmentWarnings:
|
|
2216
|
-
enableExperimentalFragmentVariables:
|
|
2217
|
-
disableExperimentalFragmentVariables:
|
|
2214
|
+
resetCaches: dt,
|
|
2215
|
+
disableFragmentWarnings: ut,
|
|
2216
|
+
enableExperimentalFragmentVariables: lt,
|
|
2217
|
+
disableExperimentalFragmentVariables: ht
|
|
2218
2218
|
};
|
|
2219
2219
|
(function(e) {
|
|
2220
|
-
e.gql =
|
|
2220
|
+
e.gql = b.gql, e.resetCaches = b.resetCaches, e.disableFragmentWarnings = b.disableFragmentWarnings, e.enableExperimentalFragmentVariables = b.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = b.disableExperimentalFragmentVariables;
|
|
2221
2221
|
})(u || (u = {}));
|
|
2222
2222
|
u.default = u;
|
|
2223
|
-
const
|
|
2223
|
+
const pt = u`
|
|
2224
2224
|
query findActiveOrderById($id: String) {
|
|
2225
2225
|
findOrder(id: $id) {
|
|
2226
2226
|
id
|
|
@@ -2311,7 +2311,7 @@ const ht = u`
|
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
2313
2313
|
}
|
|
2314
|
-
`,
|
|
2314
|
+
`, gt = u`
|
|
2315
2315
|
query findOrderById($id: String, $reference: String) {
|
|
2316
2316
|
findOrder(id: $id, reference: $reference) {
|
|
2317
2317
|
id
|
|
@@ -2358,7 +2358,7 @@ const ht = u`
|
|
|
2358
2358
|
}
|
|
2359
2359
|
}
|
|
2360
2360
|
}
|
|
2361
|
-
`,
|
|
2361
|
+
`, mt = u`
|
|
2362
2362
|
mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
|
|
2363
2363
|
reserveProduct(
|
|
2364
2364
|
input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
|
|
@@ -2368,7 +2368,7 @@ const ht = u`
|
|
|
2368
2368
|
amountReserved
|
|
2369
2369
|
}
|
|
2370
2370
|
}
|
|
2371
|
-
`,
|
|
2371
|
+
`, ft = u`
|
|
2372
2372
|
mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
|
|
2373
2373
|
releaseProduct(
|
|
2374
2374
|
input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
|
|
@@ -2377,14 +2377,14 @@ const ht = u`
|
|
|
2377
2377
|
amountReleased
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
|
-
`,
|
|
2380
|
+
`, It = u`
|
|
2381
2381
|
mutation configureDiscount($orderId: ID!, $discountCode: String) {
|
|
2382
2382
|
createOrderDiscount(input: {id: $orderId, discountCode: $discountCode}) {
|
|
2383
2383
|
amount
|
|
2384
2384
|
code
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
|
-
`,
|
|
2387
|
+
`, Et = u`
|
|
2388
2388
|
mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
|
|
2389
2389
|
configurePackage(
|
|
2390
2390
|
input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
|
|
@@ -2394,7 +2394,7 @@ const ht = u`
|
|
|
2394
2394
|
amountReserved
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
`,
|
|
2397
|
+
`, yt = u`
|
|
2398
2398
|
mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
|
|
2399
2399
|
reserveAdditionalPackageItem(
|
|
2400
2400
|
input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
|
|
@@ -2404,60 +2404,60 @@ const ht = u`
|
|
|
2404
2404
|
amountReserved
|
|
2405
2405
|
}
|
|
2406
2406
|
}
|
|
2407
|
-
`,
|
|
2407
|
+
`, kt = u`
|
|
2408
2408
|
mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
|
|
2409
2409
|
configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
|
|
2410
2410
|
}
|
|
2411
|
-
`,
|
|
2411
|
+
`, At = u`
|
|
2412
2412
|
mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
|
|
2413
2413
|
createOrderCustomer(
|
|
2414
2414
|
input: {id: $orderId, countryCode: $countryCode, customer: $customer}
|
|
2415
2415
|
)
|
|
2416
2416
|
}
|
|
2417
|
-
`,
|
|
2417
|
+
`, Ot = u`
|
|
2418
2418
|
mutation deleteOrder($orderId: ID!) {
|
|
2419
2419
|
cancelOrder(id: $orderId)
|
|
2420
2420
|
}
|
|
2421
|
-
`,
|
|
2422
|
-
function
|
|
2421
|
+
`, Tt = (e, t, n, r) => e();
|
|
2422
|
+
function Dt(e, t = Tt) {
|
|
2423
2423
|
return {
|
|
2424
2424
|
findActiveOrderById(n, r, i) {
|
|
2425
|
-
return t((s) => e.request({ document:
|
|
2425
|
+
return t((s) => e.request({ document: pt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findActiveOrderById", "query", n);
|
|
2426
2426
|
},
|
|
2427
2427
|
findOrderById(n, r, i) {
|
|
2428
|
-
return t((s) => e.request({ document:
|
|
2428
|
+
return t((s) => e.request({ document: gt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findOrderById", "query", n);
|
|
2429
2429
|
},
|
|
2430
2430
|
addToOrder(n, r, i) {
|
|
2431
|
-
return t((s) => e.request({ document:
|
|
2431
|
+
return t((s) => e.request({ document: mt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "addToOrder", "mutation", n);
|
|
2432
2432
|
},
|
|
2433
2433
|
removeFromOrder(n, r, i) {
|
|
2434
|
-
return t((s) => e.request({ document:
|
|
2434
|
+
return t((s) => e.request({ document: ft, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "removeFromOrder", "mutation", n);
|
|
2435
2435
|
},
|
|
2436
2436
|
configureDiscount(n, r, i) {
|
|
2437
|
-
return t((s) => e.request({ document:
|
|
2437
|
+
return t((s) => e.request({ document: It, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureDiscount", "mutation", n);
|
|
2438
2438
|
},
|
|
2439
2439
|
configurePackage(n, r, i) {
|
|
2440
|
-
return t((s) => e.request({ document:
|
|
2440
|
+
return t((s) => e.request({ document: Et, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configurePackage", "mutation", n);
|
|
2441
2441
|
},
|
|
2442
2442
|
reserveAdditionalPackageItem(n, r, i) {
|
|
2443
|
-
return t((s) => e.request({ document:
|
|
2443
|
+
return t((s) => e.request({ document: yt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "reserveAdditionalPackageItem", "mutation", n);
|
|
2444
2444
|
},
|
|
2445
2445
|
configureOrderDeliveryOption(n, r, i) {
|
|
2446
|
-
return t((s) => e.request({ document:
|
|
2446
|
+
return t((s) => e.request({ document: kt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureOrderDeliveryOption", "mutation", n);
|
|
2447
2447
|
},
|
|
2448
2448
|
createOrderCustomer(n, r, i) {
|
|
2449
|
-
return t((s) => e.request({ document:
|
|
2449
|
+
return t((s) => e.request({ document: At, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createOrderCustomer", "mutation", n);
|
|
2450
2450
|
},
|
|
2451
2451
|
deleteOrder(n, r, i) {
|
|
2452
|
-
return t((s) => e.request({ document:
|
|
2452
|
+
return t((s) => e.request({ document: Ot, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "deleteOrder", "mutation", n);
|
|
2453
2453
|
}
|
|
2454
2454
|
};
|
|
2455
2455
|
}
|
|
2456
|
-
class
|
|
2456
|
+
class Nt {
|
|
2457
2457
|
config;
|
|
2458
2458
|
sdk;
|
|
2459
2459
|
constructor(t) {
|
|
2460
|
-
this.config = t, this.sdk =
|
|
2460
|
+
this.config = t, this.sdk = Dt(new T(t.apiUrl));
|
|
2461
2461
|
}
|
|
2462
2462
|
// Basket update functions
|
|
2463
2463
|
async addProduct(t, n, r) {
|
|
@@ -2618,67 +2618,90 @@ class Dt {
|
|
|
2618
2618
|
return null;
|
|
2619
2619
|
const r = n.findOrder;
|
|
2620
2620
|
this.debugLog("Order fetched successfully", r);
|
|
2621
|
-
const i = r.items, s = i.filter((
|
|
2622
|
-
let
|
|
2623
|
-
return
|
|
2624
|
-
id:
|
|
2625
|
-
type:
|
|
2626
|
-
name:
|
|
2627
|
-
icon:
|
|
2628
|
-
description:
|
|
2629
|
-
amount:
|
|
2630
|
-
price:
|
|
2631
|
-
depositPrice:
|
|
2632
|
-
originalPrice:
|
|
2633
|
-
serviceFee:
|
|
2634
|
-
maxAmountOfAddons:
|
|
2635
|
-
minAmountOfAddons:
|
|
2636
|
-
seats:
|
|
2637
|
-
id:
|
|
2638
|
-
label:
|
|
2639
|
-
amount:
|
|
2621
|
+
const i = r.items, s = i.filter((c) => c.product != null && c.amount > 0).map((c) => {
|
|
2622
|
+
let E = O.PRODUCT;
|
|
2623
|
+
return c.product.type === "ADDON" ? E = O.ADD_ONS : c.product.type === "PICKUP" ? E = O.PICKUP : c.product.type === "DELIVERY" && (E = O.DELIVERY), {
|
|
2624
|
+
id: c.product.id,
|
|
2625
|
+
type: E,
|
|
2626
|
+
name: c.product.name,
|
|
2627
|
+
icon: c.product.icon,
|
|
2628
|
+
description: c.product.description,
|
|
2629
|
+
amount: c.amount,
|
|
2630
|
+
price: c.price ?? 0,
|
|
2631
|
+
depositPrice: c.depositPrice ?? 0,
|
|
2632
|
+
originalPrice: c.originalPrice ?? 0,
|
|
2633
|
+
serviceFee: c.serviceFee ?? 0,
|
|
2634
|
+
maxAmountOfAddons: c.product?.maxAmountOfAddons ?? 0,
|
|
2635
|
+
minAmountOfAddons: c.product?.minAmountOfAddons ?? 0,
|
|
2636
|
+
seats: c.seats?.map((p) => ({
|
|
2637
|
+
id: p.seatsIoId,
|
|
2638
|
+
label: p.label,
|
|
2639
|
+
amount: p.amount
|
|
2640
2640
|
}))
|
|
2641
2641
|
};
|
|
2642
|
-
}), o = i.filter(
|
|
2642
|
+
}), o = i.filter(
|
|
2643
|
+
(c) => c.packageItem != null && c.packageItem.type !== v.Regular && c.amount
|
|
2644
|
+
).map((c) => ({
|
|
2645
|
+
id: c.packageItem.id,
|
|
2646
|
+
type: O.ADD_ONS,
|
|
2647
|
+
name: c.event.name,
|
|
2648
|
+
icon: c.event.icon,
|
|
2649
|
+
amount: c.amount,
|
|
2650
|
+
price: c.price,
|
|
2651
|
+
depositPrice: c.depositPrice,
|
|
2652
|
+
originalPrice: c.originalPrice,
|
|
2653
|
+
serviceFee: c.serviceFee,
|
|
2654
|
+
packageItems: [
|
|
2655
|
+
{
|
|
2656
|
+
packageItemId: c.packageItem.id,
|
|
2657
|
+
eventId: c.event.id,
|
|
2658
|
+
name: c.event.name,
|
|
2659
|
+
startAt: c.event.startAt,
|
|
2660
|
+
endAt: c.event.endAt,
|
|
2661
|
+
timezone: c.event.timezone
|
|
2662
|
+
}
|
|
2663
|
+
]
|
|
2664
|
+
})), l = i.filter((c) => c.packageItem != null && c.amount > 0 && c.packageItem.type === v.Regular).reduce((c, E) => {
|
|
2643
2665
|
const {
|
|
2644
|
-
packageItem:
|
|
2645
|
-
event:
|
|
2646
|
-
amount:
|
|
2647
|
-
price:
|
|
2666
|
+
packageItem: p,
|
|
2667
|
+
event: y,
|
|
2668
|
+
amount: Te,
|
|
2669
|
+
price: C,
|
|
2648
2670
|
serviceFee: j,
|
|
2649
2671
|
depositPrice: H,
|
|
2650
2672
|
originalPrice: Y
|
|
2651
|
-
} =
|
|
2652
|
-
return
|
|
2673
|
+
} = E, A = p.package.id;
|
|
2674
|
+
return c[A] ? (c[A].price += C ?? 0, c[A].serviceFee += j ?? 0, c[A].originalPrice += Y ?? 0, c[A].depositPrice += H ?? C ?? 0) : c[A] = {
|
|
2653
2675
|
id: A,
|
|
2654
|
-
type:
|
|
2655
|
-
name:
|
|
2656
|
-
amount:
|
|
2657
|
-
price:
|
|
2676
|
+
type: O.PACKAGE,
|
|
2677
|
+
name: p.package.name,
|
|
2678
|
+
amount: Te,
|
|
2679
|
+
price: C ?? 0,
|
|
2658
2680
|
serviceFee: j ?? 0,
|
|
2659
|
-
depositPrice: H ??
|
|
2681
|
+
depositPrice: H ?? C ?? 0,
|
|
2660
2682
|
originalPrice: Y ?? 0,
|
|
2661
2683
|
packageItems: []
|
|
2662
|
-
},
|
|
2663
|
-
packageItemId:
|
|
2664
|
-
eventId:
|
|
2665
|
-
name:
|
|
2666
|
-
startAt:
|
|
2667
|
-
endAt:
|
|
2668
|
-
timezone:
|
|
2669
|
-
}),
|
|
2670
|
-
}, {}),
|
|
2684
|
+
}, c[A].packageItems.push({
|
|
2685
|
+
packageItemId: p.id,
|
|
2686
|
+
eventId: y.id,
|
|
2687
|
+
name: y.name,
|
|
2688
|
+
startAt: y.startAt,
|
|
2689
|
+
endAt: y.endAt,
|
|
2690
|
+
timezone: y.timezone
|
|
2691
|
+
}), c;
|
|
2692
|
+
}, {}), h = [
|
|
2671
2693
|
...s,
|
|
2672
|
-
...
|
|
2673
|
-
|
|
2674
|
-
|
|
2694
|
+
...o,
|
|
2695
|
+
...Object.values(l)
|
|
2696
|
+
], I = h.reduce((c, E) => c + (E.amount || 0), 0);
|
|
2697
|
+
if (I === 0)
|
|
2675
2698
|
return null;
|
|
2676
|
-
const
|
|
2699
|
+
const g = i.filter((c) => c.amount > 0).map((c) => new Date(c.expiredAt).getTime()), k = De.fromMillis(Math.min(...g));
|
|
2677
2700
|
return {
|
|
2678
2701
|
id: r.id,
|
|
2679
2702
|
currency: r.currency,
|
|
2680
|
-
expiredAt:
|
|
2681
|
-
items:
|
|
2703
|
+
expiredAt: k?.toJSDate().toISOString(),
|
|
2704
|
+
items: h,
|
|
2682
2705
|
customer: r.mainBooker ? {
|
|
2683
2706
|
firstName: r.mainBooker.firstName,
|
|
2684
2707
|
lastName: r.mainBooker.lastName,
|
|
@@ -2688,7 +2711,7 @@ class Dt {
|
|
|
2688
2711
|
residence: r.mainBooker.residence,
|
|
2689
2712
|
extraInfo: r.mainBooker.extraInfo
|
|
2690
2713
|
} : null,
|
|
2691
|
-
count:
|
|
2714
|
+
count: I,
|
|
2692
2715
|
orderProtection: !1,
|
|
2693
2716
|
discountCode: r.discount?.code
|
|
2694
2717
|
};
|
|
@@ -2711,7 +2734,7 @@ class Dt {
|
|
|
2711
2734
|
}
|
|
2712
2735
|
}
|
|
2713
2736
|
}
|
|
2714
|
-
const
|
|
2737
|
+
const vt = u`
|
|
2715
2738
|
query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput, $showDoorTickets: Boolean) {
|
|
2716
2739
|
findAllPublicEventByOrganizationId(
|
|
2717
2740
|
id: $organizationId
|
|
@@ -2758,7 +2781,7 @@ const Nt = u`
|
|
|
2758
2781
|
count
|
|
2759
2782
|
}
|
|
2760
2783
|
}
|
|
2761
|
-
`,
|
|
2784
|
+
`, Pt = u`
|
|
2762
2785
|
query EventDetailPage($eventId: ID!) {
|
|
2763
2786
|
findPublicEventById(id: $eventId) {
|
|
2764
2787
|
id
|
|
@@ -2791,7 +2814,7 @@ const Nt = u`
|
|
|
2791
2814
|
seatsIoEventId
|
|
2792
2815
|
}
|
|
2793
2816
|
}
|
|
2794
|
-
`,
|
|
2817
|
+
`, bt = u`
|
|
2795
2818
|
query FindPublicEventBySlug($organizationId: ID!, $slug: String!) {
|
|
2796
2819
|
findPublicEventBySlug(organizationId: $organizationId, slug: $slug) {
|
|
2797
2820
|
id
|
|
@@ -2824,7 +2847,7 @@ const Nt = u`
|
|
|
2824
2847
|
seatsIoEventId
|
|
2825
2848
|
}
|
|
2826
2849
|
}
|
|
2827
|
-
`,
|
|
2850
|
+
`, xt = u`
|
|
2828
2851
|
query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
|
|
2829
2852
|
findPublicProductsByEventId(
|
|
2830
2853
|
eventId: $eventId
|
|
@@ -2859,28 +2882,28 @@ const Nt = u`
|
|
|
2859
2882
|
showEndSalesAtTag
|
|
2860
2883
|
}
|
|
2861
2884
|
}
|
|
2862
|
-
`,
|
|
2863
|
-
function
|
|
2885
|
+
`, St = (e, t, n, r) => e();
|
|
2886
|
+
function Ct(e, t = St) {
|
|
2864
2887
|
return {
|
|
2865
2888
|
EventOverviewPage(n, r, i) {
|
|
2866
|
-
return t((s) => e.request({ document:
|
|
2889
|
+
return t((s) => e.request({ document: vt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventOverviewPage", "query", n);
|
|
2867
2890
|
},
|
|
2868
2891
|
EventDetailPage(n, r, i) {
|
|
2869
|
-
return t((s) => e.request({ document:
|
|
2892
|
+
return t((s) => e.request({ document: Pt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventDetailPage", "query", n);
|
|
2870
2893
|
},
|
|
2871
2894
|
FindPublicEventBySlug(n, r, i) {
|
|
2872
|
-
return t((s) => e.request({ document:
|
|
2895
|
+
return t((s) => e.request({ document: bt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "FindPublicEventBySlug", "query", n);
|
|
2873
2896
|
},
|
|
2874
2897
|
findProductsByEventId(n, r, i) {
|
|
2875
|
-
return t((s) => e.request({ document:
|
|
2898
|
+
return t((s) => e.request({ document: xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findProductsByEventId", "query", n);
|
|
2876
2899
|
}
|
|
2877
2900
|
};
|
|
2878
2901
|
}
|
|
2879
|
-
class
|
|
2902
|
+
class _t {
|
|
2880
2903
|
config;
|
|
2881
2904
|
sdk;
|
|
2882
2905
|
constructor(t) {
|
|
2883
|
-
this.config = t, this.sdk =
|
|
2906
|
+
this.config = t, this.sdk = Ct(new T(t.apiUrl));
|
|
2884
2907
|
}
|
|
2885
2908
|
async getEvents(t, n) {
|
|
2886
2909
|
try {
|
|
@@ -3096,7 +3119,7 @@ class Ct {
|
|
|
3096
3119
|
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
|
|
3097
3120
|
}
|
|
3098
3121
|
}
|
|
3099
|
-
const
|
|
3122
|
+
const Lt = u`
|
|
3100
3123
|
query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
|
|
3101
3124
|
findPaymentDetails(
|
|
3102
3125
|
orderId: $orderId
|
|
@@ -3126,26 +3149,26 @@ const _t = u`
|
|
|
3126
3149
|
protectionFee
|
|
3127
3150
|
}
|
|
3128
3151
|
}
|
|
3129
|
-
`,
|
|
3152
|
+
`, Rt = u`
|
|
3130
3153
|
mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
|
|
3131
3154
|
createDigitalOrderPayment(input: $input)
|
|
3132
3155
|
}
|
|
3133
|
-
`,
|
|
3134
|
-
function
|
|
3156
|
+
`, wt = (e, t, n, r) => e();
|
|
3157
|
+
function Ft(e, t = wt) {
|
|
3135
3158
|
return {
|
|
3136
3159
|
findPaymentMethods(n, r, i) {
|
|
3137
|
-
return t((s) => e.request({ document:
|
|
3160
|
+
return t((s) => e.request({ document: Lt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPaymentMethods", "query", n);
|
|
3138
3161
|
},
|
|
3139
3162
|
createDigitalPayment(n, r, i) {
|
|
3140
|
-
return t((s) => e.request({ document:
|
|
3163
|
+
return t((s) => e.request({ document: Rt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createDigitalPayment", "mutation", n);
|
|
3141
3164
|
}
|
|
3142
3165
|
};
|
|
3143
3166
|
}
|
|
3144
|
-
class
|
|
3167
|
+
class $t {
|
|
3145
3168
|
config;
|
|
3146
3169
|
sdk;
|
|
3147
3170
|
constructor(t) {
|
|
3148
|
-
this.config = t, this.sdk =
|
|
3171
|
+
this.config = t, this.sdk = Ft(new T(t.apiUrl));
|
|
3149
3172
|
}
|
|
3150
3173
|
async getPaymentDetails(t) {
|
|
3151
3174
|
this.debugLog("Fetching payment methods", t);
|
|
@@ -3223,7 +3246,7 @@ class Ft {
|
|
|
3223
3246
|
this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
|
|
3224
3247
|
}
|
|
3225
3248
|
}
|
|
3226
|
-
const
|
|
3249
|
+
const Bt = u`
|
|
3227
3250
|
query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
|
|
3228
3251
|
findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
|
|
3229
3252
|
data {
|
|
@@ -3250,7 +3273,7 @@ const $t = u`
|
|
|
3250
3273
|
count
|
|
3251
3274
|
}
|
|
3252
3275
|
}
|
|
3253
|
-
`,
|
|
3276
|
+
`, Ut = u`
|
|
3254
3277
|
query findPublicPackageById($packageId: ID!) {
|
|
3255
3278
|
findPublicPackageById(id: $packageId) {
|
|
3256
3279
|
id
|
|
@@ -3278,7 +3301,7 @@ const $t = u`
|
|
|
3278
3301
|
amountOfDaysToPlanAhead
|
|
3279
3302
|
}
|
|
3280
3303
|
}
|
|
3281
|
-
`,
|
|
3304
|
+
`, Vt = u`
|
|
3282
3305
|
query findPublicPackageBySlug($organizationId: ID!, $slug: String!) {
|
|
3283
3306
|
findPublicPackageBySlug(organizationId: $organizationId, slug: $slug) {
|
|
3284
3307
|
id
|
|
@@ -3306,7 +3329,7 @@ const $t = u`
|
|
|
3306
3329
|
amountOfDaysToPlanAhead
|
|
3307
3330
|
}
|
|
3308
3331
|
}
|
|
3309
|
-
`,
|
|
3332
|
+
`, Mt = u`
|
|
3310
3333
|
query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
|
|
3311
3334
|
findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
|
|
3312
3335
|
data {
|
|
@@ -3342,28 +3365,28 @@ const $t = u`
|
|
|
3342
3365
|
count
|
|
3343
3366
|
}
|
|
3344
3367
|
}
|
|
3345
|
-
`,
|
|
3346
|
-
function
|
|
3368
|
+
`, qt = (e, t, n, r) => e();
|
|
3369
|
+
function zt(e, t = qt) {
|
|
3347
3370
|
return {
|
|
3348
3371
|
findAllPublicPackagesByOrganizationId(n, r, i) {
|
|
3349
|
-
return t((s) => e.request({ document:
|
|
3372
|
+
return t((s) => e.request({ document: Bt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicPackagesByOrganizationId", "query", n);
|
|
3350
3373
|
},
|
|
3351
3374
|
findPublicPackageById(n, r, i) {
|
|
3352
|
-
return t((s) => e.request({ document:
|
|
3375
|
+
return t((s) => e.request({ document: Ut, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageById", "query", n);
|
|
3353
3376
|
},
|
|
3354
3377
|
findPublicPackageBySlug(n, r, i) {
|
|
3355
|
-
return t((s) => e.request({ document:
|
|
3378
|
+
return t((s) => e.request({ document: Vt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageBySlug", "query", n);
|
|
3356
3379
|
},
|
|
3357
3380
|
findPublicItemsByPackageId(n, r, i) {
|
|
3358
|
-
return t((s) => e.request({ document:
|
|
3381
|
+
return t((s) => e.request({ document: Mt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicItemsByPackageId", "query", n);
|
|
3359
3382
|
}
|
|
3360
3383
|
};
|
|
3361
3384
|
}
|
|
3362
|
-
class
|
|
3385
|
+
class Gt {
|
|
3363
3386
|
config;
|
|
3364
3387
|
sdk;
|
|
3365
3388
|
constructor(t) {
|
|
3366
|
-
this.config = t, this.sdk =
|
|
3389
|
+
this.config = t, this.sdk = zt(new T(t.apiUrl));
|
|
3367
3390
|
}
|
|
3368
3391
|
debugLog(t, n) {
|
|
3369
3392
|
this.config.debug && console.log(`[PackageService] ${t}`, n || "");
|
|
@@ -3426,7 +3449,7 @@ class zt {
|
|
|
3426
3449
|
throw this.debugLog("Error fetching public packages", r), r;
|
|
3427
3450
|
}
|
|
3428
3451
|
}
|
|
3429
|
-
async getPackageItems(t, n = [
|
|
3452
|
+
async getPackageItems(t, n = [v.Regular, v.AdditionalEvent]) {
|
|
3430
3453
|
try {
|
|
3431
3454
|
this.debugLog("Fetching public package items", { packageId: t, types: n });
|
|
3432
3455
|
const r = await this.sdk.findPublicItemsByPackageId({
|
|
@@ -3447,7 +3470,7 @@ class zt {
|
|
|
3447
3470
|
}
|
|
3448
3471
|
}
|
|
3449
3472
|
}
|
|
3450
|
-
const
|
|
3473
|
+
const jt = u`
|
|
3451
3474
|
query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
|
|
3452
3475
|
findAllPublicLocationsByOrganizationId(id: $organizationId) {
|
|
3453
3476
|
data {
|
|
@@ -3467,19 +3490,19 @@ const Gt = u`
|
|
|
3467
3490
|
count
|
|
3468
3491
|
}
|
|
3469
3492
|
}
|
|
3470
|
-
`,
|
|
3471
|
-
function
|
|
3493
|
+
`, Ht = (e, t, n, r) => e();
|
|
3494
|
+
function Yt(e, t = Ht) {
|
|
3472
3495
|
return {
|
|
3473
3496
|
findAllPublicCategoriesByOrganizationId(n, r, i) {
|
|
3474
|
-
return t((s) => e.request({ document:
|
|
3497
|
+
return t((s) => e.request({ document: jt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicCategoriesByOrganizationId", "query", n);
|
|
3475
3498
|
}
|
|
3476
3499
|
};
|
|
3477
3500
|
}
|
|
3478
|
-
class
|
|
3501
|
+
class Qt {
|
|
3479
3502
|
config;
|
|
3480
3503
|
sdk;
|
|
3481
3504
|
constructor(t) {
|
|
3482
|
-
this.config = t, this.sdk =
|
|
3505
|
+
this.config = t, this.sdk = Yt(new T(t.apiUrl));
|
|
3483
3506
|
}
|
|
3484
3507
|
debugLog(t, n) {
|
|
3485
3508
|
this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
|
|
@@ -3501,37 +3524,37 @@ class Yt {
|
|
|
3501
3524
|
}
|
|
3502
3525
|
}
|
|
3503
3526
|
}
|
|
3504
|
-
const
|
|
3527
|
+
const Xt = u`
|
|
3505
3528
|
mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
|
|
3506
3529
|
createShopView(id: $id, trackerId: $trackerLinkId)
|
|
3507
3530
|
}
|
|
3508
|
-
`,
|
|
3531
|
+
`, Jt = u`
|
|
3509
3532
|
mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
3510
3533
|
createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
3511
3534
|
}
|
|
3512
|
-
`,
|
|
3535
|
+
`, Wt = u`
|
|
3513
3536
|
mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
3514
3537
|
createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
3515
3538
|
}
|
|
3516
|
-
`,
|
|
3517
|
-
function
|
|
3539
|
+
`, Zt = (e, t, n, r) => e();
|
|
3540
|
+
function Kt(e, t = Zt) {
|
|
3518
3541
|
return {
|
|
3519
3542
|
CreateShopView(n, r, i) {
|
|
3520
|
-
return t((s) => e.request({ document:
|
|
3543
|
+
return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateShopView", "mutation", n);
|
|
3521
3544
|
},
|
|
3522
3545
|
CreateEventView(n, r, i) {
|
|
3523
|
-
return t((s) => e.request({ document:
|
|
3546
|
+
return t((s) => e.request({ document: Jt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateEventView", "mutation", n);
|
|
3524
3547
|
},
|
|
3525
3548
|
CreatePackageView(n, r, i) {
|
|
3526
|
-
return t((s) => e.request({ document:
|
|
3549
|
+
return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreatePackageView", "mutation", n);
|
|
3527
3550
|
}
|
|
3528
3551
|
};
|
|
3529
3552
|
}
|
|
3530
|
-
class
|
|
3553
|
+
class en {
|
|
3531
3554
|
config;
|
|
3532
3555
|
sdk;
|
|
3533
3556
|
constructor(t) {
|
|
3534
|
-
this.config = t, this.sdk =
|
|
3557
|
+
this.config = t, this.sdk = Kt(new T(t.apiUrl));
|
|
3535
3558
|
}
|
|
3536
3559
|
createMetric = async (t, n, r) => {
|
|
3537
3560
|
switch (!n && !r && await this.sdk.CreateShopView({
|
|
@@ -3557,7 +3580,7 @@ class Kt {
|
|
|
3557
3580
|
}
|
|
3558
3581
|
};
|
|
3559
3582
|
}
|
|
3560
|
-
const
|
|
3583
|
+
const tn = u`
|
|
3561
3584
|
query getShopBySlug($slug: String!, $trackerLinkId: String) {
|
|
3562
3585
|
findShopBySlug(slug: $slug, promoterId: $trackerLinkId) {
|
|
3563
3586
|
id
|
|
@@ -3601,19 +3624,19 @@ const en = u`
|
|
|
3601
3624
|
blockedLanguages
|
|
3602
3625
|
}
|
|
3603
3626
|
}
|
|
3604
|
-
`,
|
|
3605
|
-
function
|
|
3627
|
+
`, nn = (e, t, n, r) => e();
|
|
3628
|
+
function rn(e, t = nn) {
|
|
3606
3629
|
return {
|
|
3607
3630
|
getShopBySlug(n, r, i) {
|
|
3608
|
-
return t((s) => e.request({ document:
|
|
3631
|
+
return t((s) => e.request({ document: tn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "getShopBySlug", "query", n);
|
|
3609
3632
|
}
|
|
3610
3633
|
};
|
|
3611
3634
|
}
|
|
3612
|
-
class
|
|
3635
|
+
class sn {
|
|
3613
3636
|
config;
|
|
3614
3637
|
sdk;
|
|
3615
3638
|
constructor(t) {
|
|
3616
|
-
this.config = t, this.sdk =
|
|
3639
|
+
this.config = t, this.sdk = rn(new T(t.apiUrl));
|
|
3617
3640
|
}
|
|
3618
3641
|
async getShop(t) {
|
|
3619
3642
|
try {
|
|
@@ -3632,7 +3655,7 @@ class rn {
|
|
|
3632
3655
|
this.config.debug && console.log(`[ShopService] ${t}`, n || "");
|
|
3633
3656
|
}
|
|
3634
3657
|
}
|
|
3635
|
-
const
|
|
3658
|
+
const an = u`
|
|
3636
3659
|
query findAllCustomFieldsByOrderId($orderId: String!, $salesLocations: [SalesLocations!]) {
|
|
3637
3660
|
findAllCustomFieldsByOrderId(orderId: $orderId, salesLocations: $salesLocations) {
|
|
3638
3661
|
id
|
|
@@ -3651,19 +3674,19 @@ const sn = u`
|
|
|
3651
3674
|
confirm
|
|
3652
3675
|
}
|
|
3653
3676
|
}
|
|
3654
|
-
`,
|
|
3655
|
-
function
|
|
3677
|
+
`, on = (e, t, n, r) => e();
|
|
3678
|
+
function cn(e, t = on) {
|
|
3656
3679
|
return {
|
|
3657
3680
|
findAllCustomFieldsByOrderId(n, r, i) {
|
|
3658
|
-
return t((s) => e.request({ document:
|
|
3681
|
+
return t((s) => e.request({ document: an, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllCustomFieldsByOrderId", "query", n);
|
|
3659
3682
|
}
|
|
3660
3683
|
};
|
|
3661
3684
|
}
|
|
3662
|
-
class
|
|
3685
|
+
class dn {
|
|
3663
3686
|
config;
|
|
3664
3687
|
sdk;
|
|
3665
3688
|
constructor(t) {
|
|
3666
|
-
this.config = t, this.sdk =
|
|
3689
|
+
this.config = t, this.sdk = cn(new T(t.apiUrl));
|
|
3667
3690
|
}
|
|
3668
3691
|
async findByOrderId(t, n) {
|
|
3669
3692
|
try {
|
|
@@ -3681,8 +3704,8 @@ class cn {
|
|
|
3681
3704
|
this.config.debug && console.log(`[CustomFieldService] ${t}`, n || "");
|
|
3682
3705
|
}
|
|
3683
3706
|
}
|
|
3684
|
-
const
|
|
3685
|
-
class
|
|
3707
|
+
const un = "https://api.ticketapp.com/graphql";
|
|
3708
|
+
class pn {
|
|
3686
3709
|
basket;
|
|
3687
3710
|
event;
|
|
3688
3711
|
payment;
|
|
@@ -3692,21 +3715,21 @@ class hn {
|
|
|
3692
3715
|
shop;
|
|
3693
3716
|
customField;
|
|
3694
3717
|
// Attach selected public types to the SDK class
|
|
3695
|
-
static Types =
|
|
3718
|
+
static Types = Ne;
|
|
3696
3719
|
constructor(t) {
|
|
3697
|
-
const { organizationId: n, debug: r = !1, apiUrl: i =
|
|
3698
|
-
this.event = new
|
|
3720
|
+
const { organizationId: n, debug: r = !1, apiUrl: i = un } = t;
|
|
3721
|
+
this.event = new _t({ organizationId: n, debug: r, apiUrl: i, trackerId: t.trackerId }), this.package = new Gt({ organizationId: n, debug: r, apiUrl: i }), this.category = new Qt({ organizationId: n, debug: r, apiUrl: i }), this.metric = new en({ apiUrl: i, trackerId: t.trackerId }), this.shop = new sn({ debug: r, apiUrl: i, trackerId: t.trackerId }), this.customField = new dn({ debug: r, apiUrl: i }), this.basket = new Nt({ debug: r, apiUrl: i, trackerId: t.trackerId }), this.payment = new $t({ debug: r, apiUrl: i });
|
|
3699
3722
|
}
|
|
3700
3723
|
}
|
|
3701
3724
|
export {
|
|
3702
|
-
|
|
3725
|
+
O as BasketOrderType,
|
|
3703
3726
|
de as CustomFieldMandatoryType,
|
|
3704
3727
|
ce as CustomFieldType,
|
|
3705
3728
|
se as DiscountType,
|
|
3706
3729
|
K as EventStatus,
|
|
3707
3730
|
R as MetricsType,
|
|
3708
3731
|
ie as OrderItemType,
|
|
3709
|
-
|
|
3732
|
+
v as PackageItemType,
|
|
3710
3733
|
W as PackageStatus,
|
|
3711
3734
|
Z as PackageTabType,
|
|
3712
3735
|
re as PaymentMethodFeeType,
|
|
@@ -3716,5 +3739,5 @@ export {
|
|
|
3716
3739
|
ae as ShopTemplateType,
|
|
3717
3740
|
oe as ShopVariationType,
|
|
3718
3741
|
ee as SortOrder,
|
|
3719
|
-
|
|
3742
|
+
pn as TicketappSDK
|
|
3720
3743
|
};
|