@ticketapp-dev/shop-sdk 1.0.49 → 1.0.51
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 +780 -749
- package/dist/services/basket/basket.service.d.ts +3 -1
- package/dist/services/basket/basket.service.d.ts.map +1 -1
- package/dist/services/basket/basket.service.generated.d.ts +18 -0
- package/dist/services/basket/basket.service.generated.d.ts.map +1 -1
- package/dist/services/event/event.service.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { GraphQLClient as T } from "graphql-request";
|
|
2
|
-
import { DateTime as
|
|
3
|
-
var
|
|
2
|
+
import { DateTime as O } from "luxon";
|
|
3
|
+
var D = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(D || {}), R = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(R || {}), Z = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Z || {}), K = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(K || {}), ee = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(ee || {}), te = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(te || {}), ne = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(ne || {}), re = /* @__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))(re || {}), ie = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(ie || {}), se = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(se || {}), oe = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(oe || {}), ae = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Transparent = "TRANSPARENT", e))(ae || {}), ce = /* @__PURE__ */ ((e) => (e.Calendar = "CALENDAR", e.Large = "LARGE", e.Small = "SMALL", e))(ce || {}), F = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(F || {}), de = /* @__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))(de || {}), ue = /* @__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))(ue || {}), le = /* @__PURE__ */ ((e) => (e.ONLINE = "ONLINE", e.OFFLINE = "OFFLINE", e))(le || {});
|
|
4
4
|
const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
5
|
__proto__: null,
|
|
6
|
-
BasketOrderType:
|
|
6
|
+
BasketOrderType: D,
|
|
7
7
|
CustomFieldMandatoryType: ue,
|
|
8
8
|
CustomFieldType: de,
|
|
9
|
-
DiscountType:
|
|
9
|
+
DiscountType: oe,
|
|
10
10
|
EventStatus: ee,
|
|
11
11
|
MetricsType: F,
|
|
12
12
|
OrderItemType: se,
|
|
13
13
|
PackageItemType: R,
|
|
14
14
|
PackageStatus: Z,
|
|
15
15
|
PackageTabType: K,
|
|
16
|
-
PaymentMethodFeeType:
|
|
16
|
+
PaymentMethodFeeType: ie,
|
|
17
17
|
ProductStatus: ne,
|
|
18
|
-
ProductType:
|
|
18
|
+
ProductType: re,
|
|
19
19
|
SalesLocations: le,
|
|
20
|
-
ShopTemplateType:
|
|
20
|
+
ShopTemplateType: ae,
|
|
21
21
|
ShopVariationType: ce,
|
|
22
22
|
SortOrder: te
|
|
23
23
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
24
24
|
var w = function() {
|
|
25
25
|
return w = Object.assign || function(t) {
|
|
26
|
-
for (var n,
|
|
27
|
-
n = arguments[
|
|
26
|
+
for (var n, r = 1, i = arguments.length; r < i; r++) {
|
|
27
|
+
n = arguments[r];
|
|
28
28
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
29
29
|
}
|
|
30
30
|
return t;
|
|
@@ -44,52 +44,52 @@ function be(e, t) {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
const Se = /\r\n|[\n\r]/g;
|
|
47
|
-
function
|
|
48
|
-
let n = 0,
|
|
49
|
-
for (const
|
|
50
|
-
if (typeof
|
|
47
|
+
function q(e, t) {
|
|
48
|
+
let n = 0, r = 1;
|
|
49
|
+
for (const i of e.body.matchAll(Se)) {
|
|
50
|
+
if (typeof i.index == "number" || be(!1), i.index >= t)
|
|
51
51
|
break;
|
|
52
|
-
n =
|
|
52
|
+
n = i.index + i[0].length, r += 1;
|
|
53
53
|
}
|
|
54
54
|
return {
|
|
55
|
-
line:
|
|
55
|
+
line: r,
|
|
56
56
|
column: t + 1 - n
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
function xe(e) {
|
|
60
60
|
return he(
|
|
61
61
|
e.source,
|
|
62
|
-
|
|
62
|
+
q(e.source, e.start)
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
function he(e, t) {
|
|
66
|
-
const n = e.locationOffset.column - 1,
|
|
67
|
-
`, g =
|
|
66
|
+
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, l = t.line === 1 ? n : 0, h = t.column + l, E = `${e.name}:${a}:${h}
|
|
67
|
+
`, g = r.split(/\r\n|[\n\r]/g), d = g[i];
|
|
68
68
|
if (d.length > 120) {
|
|
69
69
|
const m = Math.floor(h / 80), y = h % 80, p = [];
|
|
70
|
-
for (let
|
|
71
|
-
p.push(d.slice(
|
|
70
|
+
for (let k = 0; k < d.length; k += 80)
|
|
71
|
+
p.push(d.slice(k, k + 80));
|
|
72
72
|
return E + Q([
|
|
73
|
-
[`${
|
|
74
|
-
...p.slice(1, m + 1).map((
|
|
73
|
+
[`${a} |`, p[0]],
|
|
74
|
+
...p.slice(1, m + 1).map((k) => ["|", k]),
|
|
75
75
|
["|", "^".padStart(y)],
|
|
76
76
|
["|", p[m + 1]]
|
|
77
77
|
]);
|
|
78
78
|
}
|
|
79
79
|
return E + Q([
|
|
80
80
|
// Lines specified like this: ["prefix", "string"],
|
|
81
|
-
[`${
|
|
82
|
-
[`${
|
|
81
|
+
[`${a - 1} |`, g[i - 1]],
|
|
82
|
+
[`${a} |`, d],
|
|
83
83
|
["|", "^".padStart(h)],
|
|
84
|
-
[`${
|
|
84
|
+
[`${a + 1} |`, g[i + 1]]
|
|
85
85
|
]);
|
|
86
86
|
}
|
|
87
87
|
function Q(e) {
|
|
88
|
-
const t = e.filter(([
|
|
89
|
-
return t.map(([
|
|
88
|
+
const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
|
|
89
|
+
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
90
90
|
`);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Ce(e) {
|
|
93
93
|
const t = e[0];
|
|
94
94
|
return t == null || "kind" in t || "length" in t ? {
|
|
95
95
|
nodes: t,
|
|
@@ -140,15 +140,15 @@ class j extends Error {
|
|
|
140
140
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
141
141
|
*/
|
|
142
142
|
constructor(t, ...n) {
|
|
143
|
-
var
|
|
144
|
-
const { nodes:
|
|
143
|
+
var r, i, s;
|
|
144
|
+
const { nodes: a, source: l, positions: h, path: E, originalError: g, extensions: d } = Ce(n);
|
|
145
145
|
super(t), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = g ?? void 0, this.nodes = X(
|
|
146
|
-
Array.isArray(
|
|
146
|
+
Array.isArray(a) ? a : a ? [a] : void 0
|
|
147
147
|
);
|
|
148
148
|
const m = X(
|
|
149
|
-
(
|
|
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 ?? (m == null || (
|
|
151
|
+
this.source = l ?? (m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? m?.map((p) => p.start), this.locations = h && l ? h.map((p) => q(l, p)) : m?.map((p) => q(p.source, p.start));
|
|
152
152
|
const y = Pe(
|
|
153
153
|
g?.extensions
|
|
154
154
|
) ? g?.extensions : void 0;
|
|
@@ -215,7 +215,7 @@ function I(e, t, n) {
|
|
|
215
215
|
positions: [t]
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
class
|
|
218
|
+
class _e {
|
|
219
219
|
/**
|
|
220
220
|
* The character offset at which this Node begins.
|
|
221
221
|
*/
|
|
@@ -231,8 +231,8 @@ class Ce {
|
|
|
231
231
|
/**
|
|
232
232
|
* The Source document the AST represents.
|
|
233
233
|
*/
|
|
234
|
-
constructor(t, n,
|
|
235
|
-
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source =
|
|
234
|
+
constructor(t, n, r) {
|
|
235
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
|
|
236
236
|
}
|
|
237
237
|
get [Symbol.toStringTag]() {
|
|
238
238
|
return "Location";
|
|
@@ -271,8 +271,8 @@ class pe {
|
|
|
271
271
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
272
272
|
* the last.
|
|
273
273
|
*/
|
|
274
|
-
constructor(t, n,
|
|
275
|
-
this.kind = t, this.start = n, this.end =
|
|
274
|
+
constructor(t, n, r, i, s, a) {
|
|
275
|
+
this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = a, this.prev = null, this.next = null;
|
|
276
276
|
}
|
|
277
277
|
get [Symbol.toStringTag]() {
|
|
278
278
|
return "Token";
|
|
@@ -379,10 +379,10 @@ var v;
|
|
|
379
379
|
(function(e) {
|
|
380
380
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
381
381
|
})(v || (v = {}));
|
|
382
|
-
var
|
|
382
|
+
var z;
|
|
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
|
+
})(z || (z = {}));
|
|
386
386
|
var c;
|
|
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";
|
|
@@ -405,15 +405,15 @@ function Fe(e) {
|
|
|
405
405
|
}
|
|
406
406
|
function we(e) {
|
|
407
407
|
var t;
|
|
408
|
-
let n = Number.MAX_SAFE_INTEGER,
|
|
409
|
-
for (let
|
|
408
|
+
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
409
|
+
for (let a = 0; a < e.length; ++a) {
|
|
410
410
|
var s;
|
|
411
|
-
const l = e[
|
|
412
|
-
h !== l.length && (
|
|
411
|
+
const l = e[a], h = $e(l);
|
|
412
|
+
h !== l.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && h < n && (n = h));
|
|
413
413
|
}
|
|
414
|
-
return e.map((
|
|
415
|
-
(t =
|
|
416
|
-
|
|
414
|
+
return e.map((a, l) => l === 0 ? a : a.slice(n)).slice(
|
|
415
|
+
(t = r) !== null && t !== void 0 ? t : 0,
|
|
416
|
+
i + 1
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
419
|
function $e(e) {
|
|
@@ -422,10 +422,10 @@ function $e(e) {
|
|
|
422
422
|
++t;
|
|
423
423
|
return t;
|
|
424
424
|
}
|
|
425
|
-
var
|
|
425
|
+
var o;
|
|
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
|
+
})(o || (o = {}));
|
|
429
429
|
class Be {
|
|
430
430
|
/**
|
|
431
431
|
* The previously focused non-ignored token.
|
|
@@ -440,7 +440,7 @@ class Be {
|
|
|
440
440
|
* The character offset at which the current line begins.
|
|
441
441
|
*/
|
|
442
442
|
constructor(t) {
|
|
443
|
-
const n = new pe(
|
|
443
|
+
const n = new pe(o.SOF, 0, 0, 0, 0);
|
|
444
444
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
445
445
|
}
|
|
446
446
|
get [Symbol.toStringTag]() {
|
|
@@ -458,7 +458,7 @@ class Be {
|
|
|
458
458
|
*/
|
|
459
459
|
lookahead() {
|
|
460
460
|
let t = this.token;
|
|
461
|
-
if (t.kind !==
|
|
461
|
+
if (t.kind !== o.EOF)
|
|
462
462
|
do
|
|
463
463
|
if (t.next)
|
|
464
464
|
t = t.next;
|
|
@@ -466,12 +466,12 @@ class Be {
|
|
|
466
466
|
const n = Ve(this, t.end);
|
|
467
467
|
t.next = n, n.prev = t, t = n;
|
|
468
468
|
}
|
|
469
|
-
while (t.kind ===
|
|
469
|
+
while (t.kind === o.COMMENT);
|
|
470
470
|
return t;
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
function Ue(e) {
|
|
474
|
-
return e ===
|
|
474
|
+
return e === o.BANG || e === o.DOLLAR || e === o.AMP || e === o.PAREN_L || e === o.PAREN_R || e === o.DOT || e === o.SPREAD || e === o.COLON || e === o.EQUALS || e === o.AT || e === o.BRACKET_L || e === o.BRACKET_R || e === o.BRACE_L || e === o.PIPE || e === o.BRACE_R;
|
|
475
475
|
}
|
|
476
476
|
function P(e) {
|
|
477
477
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
@@ -485,25 +485,25 @@ function fe(e) {
|
|
|
485
485
|
function Ie(e) {
|
|
486
486
|
return e >= 56320 && e <= 57343;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function N(e, t) {
|
|
489
489
|
const n = e.source.body.codePointAt(t);
|
|
490
490
|
if (n === void 0)
|
|
491
|
-
return
|
|
491
|
+
return o.EOF;
|
|
492
492
|
if (n >= 32 && n <= 126) {
|
|
493
|
-
const
|
|
494
|
-
return
|
|
493
|
+
const r = String.fromCodePoint(n);
|
|
494
|
+
return r === '"' ? `'"'` : `"${r}"`;
|
|
495
495
|
}
|
|
496
496
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
497
497
|
}
|
|
498
|
-
function f(e, t, n,
|
|
499
|
-
const s = e.line,
|
|
500
|
-
return new pe(t, n,
|
|
498
|
+
function f(e, t, n, r, i) {
|
|
499
|
+
const s = e.line, a = 1 + n - e.lineStart;
|
|
500
|
+
return new pe(t, n, r, s, a, i);
|
|
501
501
|
}
|
|
502
502
|
function Ve(e, t) {
|
|
503
|
-
const n = e.source.body,
|
|
504
|
-
let
|
|
505
|
-
for (;
|
|
506
|
-
const s = n.charCodeAt(
|
|
503
|
+
const n = e.source.body, r = n.length;
|
|
504
|
+
let i = t;
|
|
505
|
+
for (; i < r; ) {
|
|
506
|
+
const s = n.charCodeAt(i);
|
|
507
507
|
switch (s) {
|
|
508
508
|
// Ignored ::
|
|
509
509
|
// - UnicodeBOM
|
|
@@ -526,21 +526,21 @@ function Ve(e, t) {
|
|
|
526
526
|
case 32:
|
|
527
527
|
// <space>
|
|
528
528
|
case 44:
|
|
529
|
-
++
|
|
529
|
+
++i;
|
|
530
530
|
continue;
|
|
531
531
|
// LineTerminator ::
|
|
532
532
|
// - "New Line (U+000A)"
|
|
533
533
|
// - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
|
|
534
534
|
// - "Carriage Return (U+000D)" "New Line (U+000A)"
|
|
535
535
|
case 10:
|
|
536
|
-
++
|
|
536
|
+
++i, ++e.line, e.lineStart = i;
|
|
537
537
|
continue;
|
|
538
538
|
case 13:
|
|
539
|
-
n.charCodeAt(
|
|
539
|
+
n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
|
|
540
540
|
continue;
|
|
541
541
|
// Comment
|
|
542
542
|
case 35:
|
|
543
|
-
return Me(e,
|
|
543
|
+
return Me(e, i);
|
|
544
544
|
// Token ::
|
|
545
545
|
// - Punctuator
|
|
546
546
|
// - Name
|
|
@@ -550,103 +550,103 @@ function Ve(e, t) {
|
|
|
550
550
|
//
|
|
551
551
|
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
|
|
552
552
|
case 33:
|
|
553
|
-
return f(e,
|
|
553
|
+
return f(e, o.BANG, i, i + 1);
|
|
554
554
|
case 36:
|
|
555
|
-
return f(e,
|
|
555
|
+
return f(e, o.DOLLAR, i, i + 1);
|
|
556
556
|
case 38:
|
|
557
|
-
return f(e,
|
|
557
|
+
return f(e, o.AMP, i, i + 1);
|
|
558
558
|
case 40:
|
|
559
|
-
return f(e,
|
|
559
|
+
return f(e, o.PAREN_L, i, i + 1);
|
|
560
560
|
case 41:
|
|
561
|
-
return f(e,
|
|
561
|
+
return f(e, o.PAREN_R, i, i + 1);
|
|
562
562
|
case 46:
|
|
563
|
-
if (n.charCodeAt(
|
|
564
|
-
return f(e,
|
|
563
|
+
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
|
|
564
|
+
return f(e, o.SPREAD, i, i + 3);
|
|
565
565
|
break;
|
|
566
566
|
case 58:
|
|
567
|
-
return f(e,
|
|
567
|
+
return f(e, o.COLON, i, i + 1);
|
|
568
568
|
case 61:
|
|
569
|
-
return f(e,
|
|
569
|
+
return f(e, o.EQUALS, i, i + 1);
|
|
570
570
|
case 64:
|
|
571
|
-
return f(e,
|
|
571
|
+
return f(e, o.AT, i, i + 1);
|
|
572
572
|
case 91:
|
|
573
|
-
return f(e,
|
|
573
|
+
return f(e, o.BRACKET_L, i, i + 1);
|
|
574
574
|
case 93:
|
|
575
|
-
return f(e,
|
|
575
|
+
return f(e, o.BRACKET_R, i, i + 1);
|
|
576
576
|
case 123:
|
|
577
|
-
return f(e,
|
|
577
|
+
return f(e, o.BRACE_L, i, i + 1);
|
|
578
578
|
case 124:
|
|
579
|
-
return f(e,
|
|
579
|
+
return f(e, o.PIPE, i, i + 1);
|
|
580
580
|
case 125:
|
|
581
|
-
return f(e,
|
|
581
|
+
return f(e, o.BRACE_R, i, i + 1);
|
|
582
582
|
// StringValue
|
|
583
583
|
case 34:
|
|
584
|
-
return n.charCodeAt(
|
|
584
|
+
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Ye(e, i) : ze(e, i);
|
|
585
585
|
}
|
|
586
586
|
if (x(s) || s === 45)
|
|
587
|
-
return
|
|
587
|
+
return qe(e, i, s);
|
|
588
588
|
if (me(s))
|
|
589
|
-
return Je(e,
|
|
589
|
+
return Je(e, i);
|
|
590
590
|
throw I(
|
|
591
591
|
e.source,
|
|
592
|
-
|
|
593
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(n,
|
|
592
|
+
i,
|
|
593
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(n, i) ? `Unexpected character: ${N(e, i)}.` : `Invalid character: ${N(e, i)}.`
|
|
594
594
|
);
|
|
595
595
|
}
|
|
596
|
-
return f(e,
|
|
596
|
+
return f(e, o.EOF, r, r);
|
|
597
597
|
}
|
|
598
598
|
function Me(e, t) {
|
|
599
|
-
const n = e.source.body,
|
|
600
|
-
let
|
|
601
|
-
for (;
|
|
602
|
-
const s = n.charCodeAt(
|
|
599
|
+
const n = e.source.body, r = n.length;
|
|
600
|
+
let i = t + 1;
|
|
601
|
+
for (; i < r; ) {
|
|
602
|
+
const s = n.charCodeAt(i);
|
|
603
603
|
if (s === 10 || s === 13)
|
|
604
604
|
break;
|
|
605
605
|
if (P(s))
|
|
606
|
-
++
|
|
607
|
-
else if (B(n,
|
|
608
|
-
|
|
606
|
+
++i;
|
|
607
|
+
else if (B(n, i))
|
|
608
|
+
i += 2;
|
|
609
609
|
else
|
|
610
610
|
break;
|
|
611
611
|
}
|
|
612
612
|
return f(
|
|
613
613
|
e,
|
|
614
|
-
|
|
614
|
+
o.COMMENT,
|
|
615
615
|
t,
|
|
616
|
-
|
|
617
|
-
n.slice(t + 1,
|
|
616
|
+
i,
|
|
617
|
+
n.slice(t + 1, i)
|
|
618
618
|
);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
const
|
|
622
|
-
let
|
|
623
|
-
if (s === 45 && (s =
|
|
624
|
-
if (s =
|
|
620
|
+
function qe(e, t, n) {
|
|
621
|
+
const r = e.source.body;
|
|
622
|
+
let i = t, s = n, a = !1;
|
|
623
|
+
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
624
|
+
if (s = r.charCodeAt(++i), x(s))
|
|
625
625
|
throw I(
|
|
626
626
|
e.source,
|
|
627
|
-
|
|
628
|
-
`Invalid number, unexpected digit after 0: ${
|
|
627
|
+
i,
|
|
628
|
+
`Invalid number, unexpected digit after 0: ${N(
|
|
629
629
|
e,
|
|
630
|
-
|
|
630
|
+
i
|
|
631
631
|
)}.`
|
|
632
632
|
);
|
|
633
633
|
} else
|
|
634
|
-
|
|
635
|
-
if (s === 46 && (
|
|
634
|
+
i = M(e, i, s), s = r.charCodeAt(i);
|
|
635
|
+
if (s === 46 && (a = !0, s = r.charCodeAt(++i), i = M(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 = M(e, i, s), s = r.charCodeAt(i)), s === 46 || me(s))
|
|
636
636
|
throw I(
|
|
637
637
|
e.source,
|
|
638
|
-
|
|
639
|
-
`Invalid number, expected digit but got: ${
|
|
638
|
+
i,
|
|
639
|
+
`Invalid number, expected digit but got: ${N(
|
|
640
640
|
e,
|
|
641
|
-
|
|
641
|
+
i
|
|
642
642
|
)}.`
|
|
643
643
|
);
|
|
644
644
|
return f(
|
|
645
645
|
e,
|
|
646
|
-
|
|
646
|
+
a ? o.FLOAT : o.INT,
|
|
647
647
|
t,
|
|
648
|
-
|
|
649
|
-
|
|
648
|
+
i,
|
|
649
|
+
r.slice(t, i)
|
|
650
650
|
);
|
|
651
651
|
}
|
|
652
652
|
function M(e, t, n) {
|
|
@@ -654,62 +654,62 @@ function M(e, t, n) {
|
|
|
654
654
|
throw I(
|
|
655
655
|
e.source,
|
|
656
656
|
t,
|
|
657
|
-
`Invalid number, expected digit but got: ${
|
|
657
|
+
`Invalid number, expected digit but got: ${N(
|
|
658
658
|
e,
|
|
659
659
|
t
|
|
660
660
|
)}.`
|
|
661
661
|
);
|
|
662
|
-
const
|
|
663
|
-
let
|
|
664
|
-
for (; x(
|
|
665
|
-
++
|
|
666
|
-
return
|
|
667
|
-
}
|
|
668
|
-
function
|
|
669
|
-
const n = e.source.body,
|
|
670
|
-
let
|
|
671
|
-
for (;
|
|
672
|
-
const l = n.charCodeAt(
|
|
662
|
+
const r = e.source.body;
|
|
663
|
+
let i = t + 1;
|
|
664
|
+
for (; x(r.charCodeAt(i)); )
|
|
665
|
+
++i;
|
|
666
|
+
return i;
|
|
667
|
+
}
|
|
668
|
+
function ze(e, t) {
|
|
669
|
+
const n = e.source.body, r = n.length;
|
|
670
|
+
let i = t + 1, s = i, a = "";
|
|
671
|
+
for (; i < r; ) {
|
|
672
|
+
const l = n.charCodeAt(i);
|
|
673
673
|
if (l === 34)
|
|
674
|
-
return
|
|
674
|
+
return a += n.slice(s, i), f(e, o.STRING, t, i + 1, a);
|
|
675
675
|
if (l === 92) {
|
|
676
|
-
|
|
677
|
-
const h = n.charCodeAt(
|
|
678
|
-
|
|
676
|
+
a += n.slice(s, i);
|
|
677
|
+
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? Ge(e, i) : je(e, i) : He(e, i);
|
|
678
|
+
a += h.value, i += h.size, s = i;
|
|
679
679
|
continue;
|
|
680
680
|
}
|
|
681
681
|
if (l === 10 || l === 13)
|
|
682
682
|
break;
|
|
683
683
|
if (P(l))
|
|
684
|
-
++
|
|
685
|
-
else if (B(n,
|
|
686
|
-
|
|
684
|
+
++i;
|
|
685
|
+
else if (B(n, i))
|
|
686
|
+
i += 2;
|
|
687
687
|
else
|
|
688
688
|
throw I(
|
|
689
689
|
e.source,
|
|
690
|
-
|
|
691
|
-
`Invalid character within String: ${
|
|
690
|
+
i,
|
|
691
|
+
`Invalid character within String: ${N(
|
|
692
692
|
e,
|
|
693
|
-
|
|
693
|
+
i
|
|
694
694
|
)}.`
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
-
throw I(e.source,
|
|
697
|
+
throw I(e.source, i, "Unterminated string.");
|
|
698
698
|
}
|
|
699
699
|
function Ge(e, t) {
|
|
700
700
|
const n = e.source.body;
|
|
701
|
-
let
|
|
702
|
-
for (;
|
|
703
|
-
const s = n.charCodeAt(t +
|
|
701
|
+
let r = 0, i = 3;
|
|
702
|
+
for (; i < 12; ) {
|
|
703
|
+
const s = n.charCodeAt(t + i++);
|
|
704
704
|
if (s === 125) {
|
|
705
|
-
if (
|
|
705
|
+
if (i < 5 || !P(r))
|
|
706
706
|
break;
|
|
707
707
|
return {
|
|
708
|
-
value: String.fromCodePoint(
|
|
709
|
-
size:
|
|
708
|
+
value: String.fromCodePoint(r),
|
|
709
|
+
size: i
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
if (
|
|
712
|
+
if (r = r << 4 | S(s), r < 0)
|
|
713
713
|
break;
|
|
714
714
|
}
|
|
715
715
|
throw I(
|
|
@@ -717,22 +717,22 @@ function Ge(e, t) {
|
|
|
717
717
|
t,
|
|
718
718
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
719
719
|
t,
|
|
720
|
-
t +
|
|
720
|
+
t + i
|
|
721
721
|
)}".`
|
|
722
722
|
);
|
|
723
723
|
}
|
|
724
724
|
function je(e, t) {
|
|
725
|
-
const n = e.source.body,
|
|
726
|
-
if (P(
|
|
725
|
+
const n = e.source.body, r = W(n, t + 2);
|
|
726
|
+
if (P(r))
|
|
727
727
|
return {
|
|
728
|
-
value: String.fromCodePoint(
|
|
728
|
+
value: String.fromCodePoint(r),
|
|
729
729
|
size: 6
|
|
730
730
|
};
|
|
731
|
-
if (fe(
|
|
732
|
-
const
|
|
733
|
-
if (Ie(
|
|
731
|
+
if (fe(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
732
|
+
const i = W(n, t + 8);
|
|
733
|
+
if (Ie(i))
|
|
734
734
|
return {
|
|
735
|
-
value: String.fromCodePoint(
|
|
735
|
+
value: String.fromCodePoint(r, i),
|
|
736
736
|
size: 12
|
|
737
737
|
};
|
|
738
738
|
}
|
|
@@ -748,7 +748,7 @@ function W(e, t) {
|
|
|
748
748
|
function S(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 He(e, t) {
|
|
752
752
|
const n = e.source.body;
|
|
753
753
|
switch (n.charCodeAt(t + 1)) {
|
|
754
754
|
case 34:
|
|
@@ -802,31 +802,31 @@ function Ye(e, t) {
|
|
|
802
802
|
)}".`
|
|
803
803
|
);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
const n = e.source.body,
|
|
807
|
-
let
|
|
805
|
+
function Ye(e, t) {
|
|
806
|
+
const n = e.source.body, r = n.length;
|
|
807
|
+
let i = e.lineStart, s = t + 3, a = s, l = "";
|
|
808
808
|
const h = [];
|
|
809
|
-
for (; s <
|
|
809
|
+
for (; s < r; ) {
|
|
810
810
|
const E = n.charCodeAt(s);
|
|
811
811
|
if (E === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
812
|
-
l += n.slice(
|
|
812
|
+
l += n.slice(a, s), h.push(l);
|
|
813
813
|
const g = f(
|
|
814
814
|
e,
|
|
815
|
-
|
|
815
|
+
o.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 =
|
|
822
|
+
return e.line += h.length - 1, e.lineStart = i, g;
|
|
823
823
|
}
|
|
824
824
|
if (E === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
825
|
-
l += n.slice(
|
|
825
|
+
l += n.slice(a, s), a = s + 1, s += 4;
|
|
826
826
|
continue;
|
|
827
827
|
}
|
|
828
828
|
if (E === 10 || E === 13) {
|
|
829
|
-
l += n.slice(
|
|
829
|
+
l += n.slice(a, s), h.push(l), E === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", a = s, i = s;
|
|
830
830
|
continue;
|
|
831
831
|
}
|
|
832
832
|
if (P(E))
|
|
@@ -837,7 +837,7 @@ function He(e, t) {
|
|
|
837
837
|
throw I(
|
|
838
838
|
e.source,
|
|
839
839
|
s,
|
|
840
|
-
`Invalid character within String: ${
|
|
840
|
+
`Invalid character within String: ${N(
|
|
841
841
|
e,
|
|
842
842
|
s
|
|
843
843
|
)}.`
|
|
@@ -846,21 +846,21 @@ function He(e, t) {
|
|
|
846
846
|
throw I(e.source, s, "Unterminated string.");
|
|
847
847
|
}
|
|
848
848
|
function Je(e, t) {
|
|
849
|
-
const n = e.source.body,
|
|
850
|
-
let
|
|
851
|
-
for (;
|
|
852
|
-
const s = n.charCodeAt(
|
|
849
|
+
const n = e.source.body, r = n.length;
|
|
850
|
+
let i = t + 1;
|
|
851
|
+
for (; i < r; ) {
|
|
852
|
+
const s = n.charCodeAt(i);
|
|
853
853
|
if (Fe(s))
|
|
854
|
-
++
|
|
854
|
+
++i;
|
|
855
855
|
else
|
|
856
856
|
break;
|
|
857
857
|
}
|
|
858
858
|
return f(
|
|
859
859
|
e,
|
|
860
|
-
|
|
860
|
+
o.NAME,
|
|
861
861
|
t,
|
|
862
|
-
|
|
863
|
-
n.slice(t,
|
|
862
|
+
i,
|
|
863
|
+
n.slice(t, i)
|
|
864
864
|
);
|
|
865
865
|
}
|
|
866
866
|
const Qe = 10, Ee = 2;
|
|
@@ -886,9 +886,9 @@ function Xe(e, t) {
|
|
|
886
886
|
return "[Circular]";
|
|
887
887
|
const n = [...t, e];
|
|
888
888
|
if (We(e)) {
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
return typeof
|
|
889
|
+
const r = e.toJSON();
|
|
890
|
+
if (r !== e)
|
|
891
|
+
return typeof r == "string" ? r : U(r, n);
|
|
892
892
|
} else if (Array.isArray(e))
|
|
893
893
|
return Ke(e, n);
|
|
894
894
|
return Ze(e, n);
|
|
@@ -899,7 +899,7 @@ function We(e) {
|
|
|
899
899
|
function Ze(e, t) {
|
|
900
900
|
const n = Object.entries(e);
|
|
901
901
|
return n.length === 0 ? "{}" : t.length > Ee ? "[" + et(e) + "]" : "{ " + n.map(
|
|
902
|
-
([
|
|
902
|
+
([i, s]) => i + ": " + U(s, t)
|
|
903
903
|
).join(", ") + " }";
|
|
904
904
|
}
|
|
905
905
|
function Ke(e, t) {
|
|
@@ -907,10 +907,10 @@ function Ke(e, t) {
|
|
|
907
907
|
return "[]";
|
|
908
908
|
if (t.length > Ee)
|
|
909
909
|
return "[Array]";
|
|
910
|
-
const n = Math.min(Qe, e.length),
|
|
910
|
+
const n = Math.min(Qe, e.length), r = e.length - n, i = [];
|
|
911
911
|
for (let s = 0; s < n; ++s)
|
|
912
|
-
|
|
913
|
-
return
|
|
912
|
+
i.push(U(e[s], t));
|
|
913
|
+
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
914
914
|
}
|
|
915
915
|
function et(e) {
|
|
916
916
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
@@ -931,14 +931,14 @@ process.env.NODE_ENV === "production", nt = (
|
|
|
931
931
|
if (t instanceof n)
|
|
932
932
|
return !0;
|
|
933
933
|
if (typeof t == "object" && t !== null) {
|
|
934
|
-
var
|
|
935
|
-
const
|
|
934
|
+
var r;
|
|
935
|
+
const i = n.prototype[Symbol.toStringTag], s = (
|
|
936
936
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
937
|
-
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (
|
|
937
|
+
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
|
|
938
938
|
);
|
|
939
|
-
if (
|
|
940
|
-
const
|
|
941
|
-
throw new Error(`Cannot use ${
|
|
939
|
+
if (i === s) {
|
|
940
|
+
const a = ye(t);
|
|
941
|
+
throw new Error(`Cannot use ${i} "${a}" from another module or realm.
|
|
942
942
|
|
|
943
943
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
944
944
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -955,12 +955,12 @@ spurious results.`);
|
|
|
955
955
|
return !1;
|
|
956
956
|
}
|
|
957
957
|
);
|
|
958
|
-
class
|
|
959
|
-
constructor(t, n = "GraphQL request",
|
|
958
|
+
class Oe {
|
|
959
|
+
constructor(t, n = "GraphQL request", r = {
|
|
960
960
|
line: 1,
|
|
961
961
|
column: 1
|
|
962
962
|
}) {
|
|
963
|
-
typeof t == "string" || V(!1, `Body must be a string. Received: ${ye(t)}.`), this.body = t, this.name = n, this.locationOffset =
|
|
963
|
+
typeof t == "string" || V(!1, `Body must be a string. Received: ${ye(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || V(
|
|
964
964
|
!1,
|
|
965
965
|
"line in locationOffset is 1-indexed and must be positive."
|
|
966
966
|
), this.locationOffset.column > 0 || V(
|
|
@@ -972,26 +972,26 @@ class ke {
|
|
|
972
972
|
return "Source";
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
return nt(e,
|
|
975
|
+
function rt(e) {
|
|
976
|
+
return nt(e, Oe);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
const n = new st(e, t),
|
|
980
|
-
return Object.defineProperty(
|
|
978
|
+
function it(e, t) {
|
|
979
|
+
const n = new st(e, t), r = n.parseDocument();
|
|
980
|
+
return Object.defineProperty(r, "tokenCount", {
|
|
981
981
|
enumerable: !1,
|
|
982
982
|
value: n.tokenCount
|
|
983
|
-
}),
|
|
983
|
+
}), r;
|
|
984
984
|
}
|
|
985
985
|
class st {
|
|
986
986
|
constructor(t, n = {}) {
|
|
987
|
-
const { lexer:
|
|
988
|
-
if (
|
|
989
|
-
this._lexer =
|
|
987
|
+
const { lexer: r, ...i } = n;
|
|
988
|
+
if (r)
|
|
989
|
+
this._lexer = r;
|
|
990
990
|
else {
|
|
991
|
-
const s =
|
|
991
|
+
const s = rt(t) ? t : new Oe(t);
|
|
992
992
|
this._lexer = new Be(s);
|
|
993
993
|
}
|
|
994
|
-
this._options =
|
|
994
|
+
this._options = i, this._tokenCounter = 0;
|
|
995
995
|
}
|
|
996
996
|
get tokenCount() {
|
|
997
997
|
return this._tokenCounter;
|
|
@@ -1000,7 +1000,7 @@ class st {
|
|
|
1000
1000
|
* Converts a name lex token into a name parse node.
|
|
1001
1001
|
*/
|
|
1002
1002
|
parseName() {
|
|
1003
|
-
const t = this.expectToken(
|
|
1003
|
+
const t = this.expectToken(o.NAME);
|
|
1004
1004
|
return this.node(t, {
|
|
1005
1005
|
kind: c.NAME,
|
|
1006
1006
|
value: t.value
|
|
@@ -1014,9 +1014,9 @@ class st {
|
|
|
1014
1014
|
return this.node(this._lexer.token, {
|
|
1015
1015
|
kind: c.DOCUMENT,
|
|
1016
1016
|
definitions: this.many(
|
|
1017
|
-
|
|
1017
|
+
o.SOF,
|
|
1018
1018
|
this.parseDefinition,
|
|
1019
|
-
|
|
1019
|
+
o.EOF
|
|
1020
1020
|
)
|
|
1021
1021
|
});
|
|
1022
1022
|
}
|
|
@@ -1044,16 +1044,16 @@ class st {
|
|
|
1044
1044
|
* - InputObjectTypeDefinition
|
|
1045
1045
|
*/
|
|
1046
1046
|
parseDefinition() {
|
|
1047
|
-
if (this.peek(
|
|
1047
|
+
if (this.peek(o.BRACE_L))
|
|
1048
1048
|
return this.parseOperationDefinition();
|
|
1049
1049
|
const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1050
|
-
if (t && n.kind ===
|
|
1050
|
+
if (t && n.kind === o.BRACE_L)
|
|
1051
1051
|
throw I(
|
|
1052
1052
|
this._lexer.source,
|
|
1053
1053
|
this._lexer.token.start,
|
|
1054
1054
|
"Unexpected description, descriptions are not supported on shorthand queries."
|
|
1055
1055
|
);
|
|
1056
|
-
if (n.kind ===
|
|
1056
|
+
if (n.kind === o.NAME) {
|
|
1057
1057
|
switch (n.value) {
|
|
1058
1058
|
case "schema":
|
|
1059
1059
|
return this.parseSchemaDefinition();
|
|
@@ -1099,7 +1099,7 @@ class st {
|
|
|
1099
1099
|
*/
|
|
1100
1100
|
parseOperationDefinition() {
|
|
1101
1101
|
const t = this._lexer.token;
|
|
1102
|
-
if (this.peek(
|
|
1102
|
+
if (this.peek(o.BRACE_L))
|
|
1103
1103
|
return this.node(t, {
|
|
1104
1104
|
kind: c.OPERATION_DEFINITION,
|
|
1105
1105
|
operation: v.QUERY,
|
|
@@ -1109,13 +1109,13 @@ class st {
|
|
|
1109
1109
|
directives: [],
|
|
1110
1110
|
selectionSet: this.parseSelectionSet()
|
|
1111
1111
|
});
|
|
1112
|
-
const n = this.parseDescription(),
|
|
1113
|
-
let
|
|
1114
|
-
return this.peek(
|
|
1112
|
+
const n = this.parseDescription(), r = this.parseOperationType();
|
|
1113
|
+
let i;
|
|
1114
|
+
return this.peek(o.NAME) && (i = this.parseName()), this.node(t, {
|
|
1115
1115
|
kind: c.OPERATION_DEFINITION,
|
|
1116
|
-
operation:
|
|
1116
|
+
operation: r,
|
|
1117
1117
|
description: n,
|
|
1118
|
-
name:
|
|
1118
|
+
name: i,
|
|
1119
1119
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1120
1120
|
directives: this.parseDirectives(!1),
|
|
1121
1121
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1125,7 +1125,7 @@ class st {
|
|
|
1125
1125
|
* OperationType : one of query mutation subscription
|
|
1126
1126
|
*/
|
|
1127
1127
|
parseOperationType() {
|
|
1128
|
-
const t = this.expectToken(
|
|
1128
|
+
const t = this.expectToken(o.NAME);
|
|
1129
1129
|
switch (t.value) {
|
|
1130
1130
|
case "query":
|
|
1131
1131
|
return v.QUERY;
|
|
@@ -1141,9 +1141,9 @@ class st {
|
|
|
1141
1141
|
*/
|
|
1142
1142
|
parseVariableDefinitions() {
|
|
1143
1143
|
return this.optionalMany(
|
|
1144
|
-
|
|
1144
|
+
o.PAREN_L,
|
|
1145
1145
|
this.parseVariableDefinition,
|
|
1146
|
-
|
|
1146
|
+
o.PAREN_R
|
|
1147
1147
|
);
|
|
1148
1148
|
}
|
|
1149
1149
|
/**
|
|
@@ -1154,8 +1154,8 @@ class st {
|
|
|
1154
1154
|
kind: c.VARIABLE_DEFINITION,
|
|
1155
1155
|
description: this.parseDescription(),
|
|
1156
1156
|
variable: this.parseVariable(),
|
|
1157
|
-
type: (this.expectToken(
|
|
1158
|
-
defaultValue: this.expectOptionalToken(
|
|
1157
|
+
type: (this.expectToken(o.COLON), this.parseTypeReference()),
|
|
1158
|
+
defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
1159
1159
|
directives: this.parseConstDirectives()
|
|
1160
1160
|
});
|
|
1161
1161
|
}
|
|
@@ -1164,7 +1164,7 @@ class st {
|
|
|
1164
1164
|
*/
|
|
1165
1165
|
parseVariable() {
|
|
1166
1166
|
const t = this._lexer.token;
|
|
1167
|
-
return this.expectToken(
|
|
1167
|
+
return this.expectToken(o.DOLLAR), this.node(t, {
|
|
1168
1168
|
kind: c.VARIABLE,
|
|
1169
1169
|
name: this.parseName()
|
|
1170
1170
|
});
|
|
@@ -1178,9 +1178,9 @@ class st {
|
|
|
1178
1178
|
return this.node(this._lexer.token, {
|
|
1179
1179
|
kind: c.SELECTION_SET,
|
|
1180
1180
|
selections: this.many(
|
|
1181
|
-
|
|
1181
|
+
o.BRACE_L,
|
|
1182
1182
|
this.parseSelection,
|
|
1183
|
-
|
|
1183
|
+
o.BRACE_R
|
|
1184
1184
|
)
|
|
1185
1185
|
});
|
|
1186
1186
|
}
|
|
@@ -1191,7 +1191,7 @@ class st {
|
|
|
1191
1191
|
* - InlineFragment
|
|
1192
1192
|
*/
|
|
1193
1193
|
parseSelection() {
|
|
1194
|
-
return this.peek(
|
|
1194
|
+
return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
|
|
1195
1195
|
}
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
@@ -1200,14 +1200,14 @@ class st {
|
|
|
1200
1200
|
*/
|
|
1201
1201
|
parseField() {
|
|
1202
1202
|
const t = this._lexer.token, n = this.parseName();
|
|
1203
|
-
let
|
|
1204
|
-
return this.expectOptionalToken(
|
|
1203
|
+
let r, i;
|
|
1204
|
+
return this.expectOptionalToken(o.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
|
|
1205
1205
|
kind: c.FIELD,
|
|
1206
|
-
alias:
|
|
1207
|
-
name:
|
|
1206
|
+
alias: r,
|
|
1207
|
+
name: i,
|
|
1208
1208
|
arguments: this.parseArguments(!1),
|
|
1209
1209
|
directives: this.parseDirectives(!1),
|
|
1210
|
-
selectionSet: this.peek(
|
|
1210
|
+
selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
/**
|
|
@@ -1215,16 +1215,16 @@ class st {
|
|
|
1215
1215
|
*/
|
|
1216
1216
|
parseArguments(t) {
|
|
1217
1217
|
const n = t ? this.parseConstArgument : this.parseArgument;
|
|
1218
|
-
return this.optionalMany(
|
|
1218
|
+
return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
|
|
1219
1219
|
}
|
|
1220
1220
|
/**
|
|
1221
1221
|
* Argument[Const] : Name : Value[?Const]
|
|
1222
1222
|
*/
|
|
1223
1223
|
parseArgument(t = !1) {
|
|
1224
|
-
const n = this._lexer.token,
|
|
1225
|
-
return this.expectToken(
|
|
1224
|
+
const n = this._lexer.token, r = this.parseName();
|
|
1225
|
+
return this.expectToken(o.COLON), this.node(n, {
|
|
1226
1226
|
kind: c.ARGUMENT,
|
|
1227
|
-
name:
|
|
1227
|
+
name: r,
|
|
1228
1228
|
value: this.parseValueLiteral(t)
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
@@ -1241,9 +1241,9 @@ class st {
|
|
|
1241
1241
|
*/
|
|
1242
1242
|
parseFragment() {
|
|
1243
1243
|
const t = this._lexer.token;
|
|
1244
|
-
this.expectToken(
|
|
1244
|
+
this.expectToken(o.SPREAD);
|
|
1245
1245
|
const n = this.expectOptionalKeyword("on");
|
|
1246
|
-
return !n && this.peek(
|
|
1246
|
+
return !n && this.peek(o.NAME) ? this.node(t, {
|
|
1247
1247
|
kind: c.FRAGMENT_SPREAD,
|
|
1248
1248
|
name: this.parseFragmentName(),
|
|
1249
1249
|
directives: this.parseDirectives(!1)
|
|
@@ -1309,24 +1309,24 @@ class st {
|
|
|
1309
1309
|
parseValueLiteral(t) {
|
|
1310
1310
|
const n = this._lexer.token;
|
|
1311
1311
|
switch (n.kind) {
|
|
1312
|
-
case
|
|
1312
|
+
case o.BRACKET_L:
|
|
1313
1313
|
return this.parseList(t);
|
|
1314
|
-
case
|
|
1314
|
+
case o.BRACE_L:
|
|
1315
1315
|
return this.parseObject(t);
|
|
1316
|
-
case
|
|
1316
|
+
case o.INT:
|
|
1317
1317
|
return this.advanceLexer(), this.node(n, {
|
|
1318
1318
|
kind: c.INT,
|
|
1319
1319
|
value: n.value
|
|
1320
1320
|
});
|
|
1321
|
-
case
|
|
1321
|
+
case o.FLOAT:
|
|
1322
1322
|
return this.advanceLexer(), this.node(n, {
|
|
1323
1323
|
kind: c.FLOAT,
|
|
1324
1324
|
value: n.value
|
|
1325
1325
|
});
|
|
1326
|
-
case
|
|
1327
|
-
case
|
|
1326
|
+
case o.STRING:
|
|
1327
|
+
case o.BLOCK_STRING:
|
|
1328
1328
|
return this.parseStringLiteral();
|
|
1329
|
-
case
|
|
1329
|
+
case o.NAME:
|
|
1330
1330
|
switch (this.advanceLexer(), n.value) {
|
|
1331
1331
|
case "true":
|
|
1332
1332
|
return this.node(n, {
|
|
@@ -1348,14 +1348,14 @@ class st {
|
|
|
1348
1348
|
value: n.value
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
1351
|
-
case
|
|
1351
|
+
case o.DOLLAR:
|
|
1352
1352
|
if (t)
|
|
1353
|
-
if (this.expectToken(
|
|
1354
|
-
const
|
|
1353
|
+
if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
|
|
1354
|
+
const r = this._lexer.token.value;
|
|
1355
1355
|
throw I(
|
|
1356
1356
|
this._lexer.source,
|
|
1357
1357
|
n.start,
|
|
1358
|
-
`Unexpected variable "$${
|
|
1358
|
+
`Unexpected variable "$${r}" in constant value.`
|
|
1359
1359
|
);
|
|
1360
1360
|
} else
|
|
1361
1361
|
throw this.unexpected(n);
|
|
@@ -1372,7 +1372,7 @@ class st {
|
|
|
1372
1372
|
return this.advanceLexer(), this.node(t, {
|
|
1373
1373
|
kind: c.STRING,
|
|
1374
1374
|
value: t.value,
|
|
1375
|
-
block: t.kind ===
|
|
1375
|
+
block: t.kind === o.BLOCK_STRING
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
1378
1378
|
/**
|
|
@@ -1384,7 +1384,7 @@ class st {
|
|
|
1384
1384
|
const n = () => this.parseValueLiteral(t);
|
|
1385
1385
|
return this.node(this._lexer.token, {
|
|
1386
1386
|
kind: c.LIST,
|
|
1387
|
-
values: this.any(
|
|
1387
|
+
values: this.any(o.BRACKET_L, n, o.BRACKET_R)
|
|
1388
1388
|
});
|
|
1389
1389
|
}
|
|
1390
1390
|
/**
|
|
@@ -1398,17 +1398,17 @@ class st {
|
|
|
1398
1398
|
const n = () => this.parseObjectField(t);
|
|
1399
1399
|
return this.node(this._lexer.token, {
|
|
1400
1400
|
kind: c.OBJECT,
|
|
1401
|
-
fields: this.any(
|
|
1401
|
+
fields: this.any(o.BRACE_L, n, o.BRACE_R)
|
|
1402
1402
|
});
|
|
1403
1403
|
}
|
|
1404
1404
|
/**
|
|
1405
1405
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1406
1406
|
*/
|
|
1407
1407
|
parseObjectField(t) {
|
|
1408
|
-
const n = this._lexer.token,
|
|
1409
|
-
return this.expectToken(
|
|
1408
|
+
const n = this._lexer.token, r = this.parseName();
|
|
1409
|
+
return this.expectToken(o.COLON), this.node(n, {
|
|
1410
1410
|
kind: c.OBJECT_FIELD,
|
|
1411
|
-
name:
|
|
1411
|
+
name: r,
|
|
1412
1412
|
value: this.parseValueLiteral(t)
|
|
1413
1413
|
});
|
|
1414
1414
|
}
|
|
@@ -1418,7 +1418,7 @@ class st {
|
|
|
1418
1418
|
*/
|
|
1419
1419
|
parseDirectives(t) {
|
|
1420
1420
|
const n = [];
|
|
1421
|
-
for (; this.peek(
|
|
1421
|
+
for (; this.peek(o.AT); )
|
|
1422
1422
|
n.push(this.parseDirective(t));
|
|
1423
1423
|
return n;
|
|
1424
1424
|
}
|
|
@@ -1432,7 +1432,7 @@ class st {
|
|
|
1432
1432
|
*/
|
|
1433
1433
|
parseDirective(t) {
|
|
1434
1434
|
const n = this._lexer.token;
|
|
1435
|
-
return this.expectToken(
|
|
1435
|
+
return this.expectToken(o.AT), this.node(n, {
|
|
1436
1436
|
kind: c.DIRECTIVE,
|
|
1437
1437
|
name: this.parseName(),
|
|
1438
1438
|
arguments: this.parseArguments(t)
|
|
@@ -1448,15 +1448,15 @@ class st {
|
|
|
1448
1448
|
parseTypeReference() {
|
|
1449
1449
|
const t = this._lexer.token;
|
|
1450
1450
|
let n;
|
|
1451
|
-
if (this.expectOptionalToken(
|
|
1452
|
-
const
|
|
1453
|
-
this.expectToken(
|
|
1451
|
+
if (this.expectOptionalToken(o.BRACKET_L)) {
|
|
1452
|
+
const r = this.parseTypeReference();
|
|
1453
|
+
this.expectToken(o.BRACKET_R), n = this.node(t, {
|
|
1454
1454
|
kind: c.LIST_TYPE,
|
|
1455
|
-
type:
|
|
1455
|
+
type: r
|
|
1456
1456
|
});
|
|
1457
1457
|
} else
|
|
1458
1458
|
n = this.parseNamedType();
|
|
1459
|
-
return this.expectOptionalToken(
|
|
1459
|
+
return this.expectOptionalToken(o.BANG) ? this.node(t, {
|
|
1460
1460
|
kind: c.NON_NULL_TYPE,
|
|
1461
1461
|
type: n
|
|
1462
1462
|
}) : n;
|
|
@@ -1472,7 +1472,7 @@ class st {
|
|
|
1472
1472
|
}
|
|
1473
1473
|
// Implements the parsing rules in the Type Definition section.
|
|
1474
1474
|
peekDescription() {
|
|
1475
|
-
return this.peek(
|
|
1475
|
+
return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
|
|
1476
1476
|
}
|
|
1477
1477
|
/**
|
|
1478
1478
|
* Description : StringValue
|
|
@@ -1489,16 +1489,16 @@ class st {
|
|
|
1489
1489
|
parseSchemaDefinition() {
|
|
1490
1490
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1491
1491
|
this.expectKeyword("schema");
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1492
|
+
const r = this.parseConstDirectives(), i = this.many(
|
|
1493
|
+
o.BRACE_L,
|
|
1494
1494
|
this.parseOperationTypeDefinition,
|
|
1495
|
-
|
|
1495
|
+
o.BRACE_R
|
|
1496
1496
|
);
|
|
1497
1497
|
return this.node(t, {
|
|
1498
1498
|
kind: c.SCHEMA_DEFINITION,
|
|
1499
1499
|
description: n,
|
|
1500
|
-
directives:
|
|
1501
|
-
operationTypes:
|
|
1500
|
+
directives: r,
|
|
1501
|
+
operationTypes: i
|
|
1502
1502
|
});
|
|
1503
1503
|
}
|
|
1504
1504
|
/**
|
|
@@ -1506,12 +1506,12 @@ class st {
|
|
|
1506
1506
|
*/
|
|
1507
1507
|
parseOperationTypeDefinition() {
|
|
1508
1508
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
1509
|
-
this.expectToken(
|
|
1510
|
-
const
|
|
1509
|
+
this.expectToken(o.COLON);
|
|
1510
|
+
const r = this.parseNamedType();
|
|
1511
1511
|
return this.node(t, {
|
|
1512
1512
|
kind: c.OPERATION_TYPE_DEFINITION,
|
|
1513
1513
|
operation: n,
|
|
1514
|
-
type:
|
|
1514
|
+
type: r
|
|
1515
1515
|
});
|
|
1516
1516
|
}
|
|
1517
1517
|
/**
|
|
@@ -1520,12 +1520,12 @@ class st {
|
|
|
1520
1520
|
parseScalarTypeDefinition() {
|
|
1521
1521
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1522
1522
|
this.expectKeyword("scalar");
|
|
1523
|
-
const
|
|
1523
|
+
const r = this.parseName(), i = this.parseConstDirectives();
|
|
1524
1524
|
return this.node(t, {
|
|
1525
1525
|
kind: c.SCALAR_TYPE_DEFINITION,
|
|
1526
1526
|
description: n,
|
|
1527
|
-
name:
|
|
1528
|
-
directives:
|
|
1527
|
+
name: r,
|
|
1528
|
+
directives: i
|
|
1529
1529
|
});
|
|
1530
1530
|
}
|
|
1531
1531
|
/**
|
|
@@ -1536,14 +1536,14 @@ class st {
|
|
|
1536
1536
|
parseObjectTypeDefinition() {
|
|
1537
1537
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1538
1538
|
this.expectKeyword("type");
|
|
1539
|
-
const
|
|
1539
|
+
const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1540
1540
|
return this.node(t, {
|
|
1541
1541
|
kind: c.OBJECT_TYPE_DEFINITION,
|
|
1542
1542
|
description: n,
|
|
1543
|
-
name:
|
|
1544
|
-
interfaces:
|
|
1543
|
+
name: r,
|
|
1544
|
+
interfaces: i,
|
|
1545
1545
|
directives: s,
|
|
1546
|
-
fields:
|
|
1546
|
+
fields: a
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
/**
|
|
@@ -1552,7 +1552,7 @@ class st {
|
|
|
1552
1552
|
* - ImplementsInterfaces & NamedType
|
|
1553
1553
|
*/
|
|
1554
1554
|
parseImplementsInterfaces() {
|
|
1555
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(
|
|
1555
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
|
|
1556
1556
|
}
|
|
1557
1557
|
/**
|
|
1558
1558
|
* ```
|
|
@@ -1561,9 +1561,9 @@ class st {
|
|
|
1561
1561
|
*/
|
|
1562
1562
|
parseFieldsDefinition() {
|
|
1563
1563
|
return this.optionalMany(
|
|
1564
|
-
|
|
1564
|
+
o.BRACE_L,
|
|
1565
1565
|
this.parseFieldDefinition,
|
|
1566
|
-
|
|
1566
|
+
o.BRACE_R
|
|
1567
1567
|
);
|
|
1568
1568
|
}
|
|
1569
1569
|
/**
|
|
@@ -1571,16 +1571,16 @@ class st {
|
|
|
1571
1571
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1572
1572
|
*/
|
|
1573
1573
|
parseFieldDefinition() {
|
|
1574
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1575
|
-
this.expectToken(
|
|
1576
|
-
const s = this.parseTypeReference(),
|
|
1574
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
|
|
1575
|
+
this.expectToken(o.COLON);
|
|
1576
|
+
const s = this.parseTypeReference(), a = this.parseConstDirectives();
|
|
1577
1577
|
return this.node(t, {
|
|
1578
1578
|
kind: c.FIELD_DEFINITION,
|
|
1579
1579
|
description: n,
|
|
1580
|
-
name:
|
|
1581
|
-
arguments:
|
|
1580
|
+
name: r,
|
|
1581
|
+
arguments: i,
|
|
1582
1582
|
type: s,
|
|
1583
|
-
directives:
|
|
1583
|
+
directives: a
|
|
1584
1584
|
});
|
|
1585
1585
|
}
|
|
1586
1586
|
/**
|
|
@@ -1588,9 +1588,9 @@ class st {
|
|
|
1588
1588
|
*/
|
|
1589
1589
|
parseArgumentDefs() {
|
|
1590
1590
|
return this.optionalMany(
|
|
1591
|
-
|
|
1591
|
+
o.PAREN_L,
|
|
1592
1592
|
this.parseInputValueDef,
|
|
1593
|
-
|
|
1593
|
+
o.PAREN_R
|
|
1594
1594
|
);
|
|
1595
1595
|
}
|
|
1596
1596
|
/**
|
|
@@ -1598,19 +1598,19 @@ class st {
|
|
|
1598
1598
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1599
1599
|
*/
|
|
1600
1600
|
parseInputValueDef() {
|
|
1601
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1602
|
-
this.expectToken(
|
|
1603
|
-
const
|
|
1601
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
|
|
1602
|
+
this.expectToken(o.COLON);
|
|
1603
|
+
const i = this.parseTypeReference();
|
|
1604
1604
|
let s;
|
|
1605
|
-
this.expectOptionalToken(
|
|
1606
|
-
const
|
|
1605
|
+
this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1606
|
+
const a = this.parseConstDirectives();
|
|
1607
1607
|
return this.node(t, {
|
|
1608
1608
|
kind: c.INPUT_VALUE_DEFINITION,
|
|
1609
1609
|
description: n,
|
|
1610
|
-
name:
|
|
1611
|
-
type:
|
|
1610
|
+
name: r,
|
|
1611
|
+
type: i,
|
|
1612
1612
|
defaultValue: s,
|
|
1613
|
-
directives:
|
|
1613
|
+
directives: a
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
/**
|
|
@@ -1620,14 +1620,14 @@ class st {
|
|
|
1620
1620
|
parseInterfaceTypeDefinition() {
|
|
1621
1621
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1622
1622
|
this.expectKeyword("interface");
|
|
1623
|
-
const
|
|
1623
|
+
const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1624
1624
|
return this.node(t, {
|
|
1625
1625
|
kind: c.INTERFACE_TYPE_DEFINITION,
|
|
1626
1626
|
description: n,
|
|
1627
|
-
name:
|
|
1628
|
-
interfaces:
|
|
1627
|
+
name: r,
|
|
1628
|
+
interfaces: i,
|
|
1629
1629
|
directives: s,
|
|
1630
|
-
fields:
|
|
1630
|
+
fields: a
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
1633
|
/**
|
|
@@ -1637,12 +1637,12 @@ class st {
|
|
|
1637
1637
|
parseUnionTypeDefinition() {
|
|
1638
1638
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1639
1639
|
this.expectKeyword("union");
|
|
1640
|
-
const
|
|
1640
|
+
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1641
1641
|
return this.node(t, {
|
|
1642
1642
|
kind: c.UNION_TYPE_DEFINITION,
|
|
1643
1643
|
description: n,
|
|
1644
|
-
name:
|
|
1645
|
-
directives:
|
|
1644
|
+
name: r,
|
|
1645
|
+
directives: i,
|
|
1646
1646
|
types: s
|
|
1647
1647
|
});
|
|
1648
1648
|
}
|
|
@@ -1652,7 +1652,7 @@ class st {
|
|
|
1652
1652
|
* - UnionMemberTypes | NamedType
|
|
1653
1653
|
*/
|
|
1654
1654
|
parseUnionMemberTypes() {
|
|
1655
|
-
return this.expectOptionalToken(
|
|
1655
|
+
return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
* EnumTypeDefinition :
|
|
@@ -1661,12 +1661,12 @@ class st {
|
|
|
1661
1661
|
parseEnumTypeDefinition() {
|
|
1662
1662
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1663
1663
|
this.expectKeyword("enum");
|
|
1664
|
-
const
|
|
1664
|
+
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1665
1665
|
return this.node(t, {
|
|
1666
1666
|
kind: c.ENUM_TYPE_DEFINITION,
|
|
1667
1667
|
description: n,
|
|
1668
|
-
name:
|
|
1669
|
-
directives:
|
|
1668
|
+
name: r,
|
|
1669
|
+
directives: i,
|
|
1670
1670
|
values: s
|
|
1671
1671
|
});
|
|
1672
1672
|
}
|
|
@@ -1677,21 +1677,21 @@ class st {
|
|
|
1677
1677
|
*/
|
|
1678
1678
|
parseEnumValuesDefinition() {
|
|
1679
1679
|
return this.optionalMany(
|
|
1680
|
-
|
|
1680
|
+
o.BRACE_L,
|
|
1681
1681
|
this.parseEnumValueDefinition,
|
|
1682
|
-
|
|
1682
|
+
o.BRACE_R
|
|
1683
1683
|
);
|
|
1684
1684
|
}
|
|
1685
1685
|
/**
|
|
1686
1686
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1687
1687
|
*/
|
|
1688
1688
|
parseEnumValueDefinition() {
|
|
1689
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1689
|
+
const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
|
|
1690
1690
|
return this.node(t, {
|
|
1691
1691
|
kind: c.ENUM_VALUE_DEFINITION,
|
|
1692
1692
|
description: n,
|
|
1693
|
-
name:
|
|
1694
|
-
directives:
|
|
1693
|
+
name: r,
|
|
1694
|
+
directives: i
|
|
1695
1695
|
});
|
|
1696
1696
|
}
|
|
1697
1697
|
/**
|
|
@@ -1702,7 +1702,7 @@ class st {
|
|
|
1702
1702
|
throw I(
|
|
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
|
);
|
|
@@ -1715,12 +1715,12 @@ class st {
|
|
|
1715
1715
|
parseInputObjectTypeDefinition() {
|
|
1716
1716
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1717
1717
|
this.expectKeyword("input");
|
|
1718
|
-
const
|
|
1718
|
+
const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1719
1719
|
return this.node(t, {
|
|
1720
1720
|
kind: c.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1721
1721
|
description: n,
|
|
1722
|
-
name:
|
|
1723
|
-
directives:
|
|
1722
|
+
name: r,
|
|
1723
|
+
directives: i,
|
|
1724
1724
|
fields: s
|
|
1725
1725
|
});
|
|
1726
1726
|
}
|
|
@@ -1731,9 +1731,9 @@ class st {
|
|
|
1731
1731
|
*/
|
|
1732
1732
|
parseInputFieldsDefinition() {
|
|
1733
1733
|
return this.optionalMany(
|
|
1734
|
-
|
|
1734
|
+
o.BRACE_L,
|
|
1735
1735
|
this.parseInputValueDef,
|
|
1736
|
-
|
|
1736
|
+
o.BRACE_R
|
|
1737
1737
|
);
|
|
1738
1738
|
}
|
|
1739
1739
|
/**
|
|
@@ -1751,7 +1751,7 @@ class st {
|
|
|
1751
1751
|
*/
|
|
1752
1752
|
parseTypeSystemExtension() {
|
|
1753
1753
|
const t = this._lexer.lookahead();
|
|
1754
|
-
if (t.kind ===
|
|
1754
|
+
if (t.kind === o.NAME)
|
|
1755
1755
|
switch (t.value) {
|
|
1756
1756
|
case "schema":
|
|
1757
1757
|
return this.parseSchemaExtension();
|
|
@@ -1780,17 +1780,17 @@ class st {
|
|
|
1780
1780
|
parseSchemaExtension() {
|
|
1781
1781
|
const t = this._lexer.token;
|
|
1782
1782
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1783
|
-
const n = this.parseConstDirectives(),
|
|
1784
|
-
|
|
1783
|
+
const n = this.parseConstDirectives(), r = this.optionalMany(
|
|
1784
|
+
o.BRACE_L,
|
|
1785
1785
|
this.parseOperationTypeDefinition,
|
|
1786
|
-
|
|
1786
|
+
o.BRACE_R
|
|
1787
1787
|
);
|
|
1788
|
-
if (n.length === 0 &&
|
|
1788
|
+
if (n.length === 0 && r.length === 0)
|
|
1789
1789
|
throw this.unexpected();
|
|
1790
1790
|
return this.node(t, {
|
|
1791
1791
|
kind: c.SCHEMA_EXTENSION,
|
|
1792
1792
|
directives: n,
|
|
1793
|
-
operationTypes:
|
|
1793
|
+
operationTypes: r
|
|
1794
1794
|
});
|
|
1795
1795
|
}
|
|
1796
1796
|
/**
|
|
@@ -1800,13 +1800,13 @@ class st {
|
|
|
1800
1800
|
parseScalarTypeExtension() {
|
|
1801
1801
|
const t = this._lexer.token;
|
|
1802
1802
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1803
|
-
const n = this.parseName(),
|
|
1804
|
-
if (
|
|
1803
|
+
const n = this.parseName(), r = this.parseConstDirectives();
|
|
1804
|
+
if (r.length === 0)
|
|
1805
1805
|
throw this.unexpected();
|
|
1806
1806
|
return this.node(t, {
|
|
1807
1807
|
kind: c.SCALAR_TYPE_EXTENSION,
|
|
1808
1808
|
name: n,
|
|
1809
|
-
directives:
|
|
1809
|
+
directives: r
|
|
1810
1810
|
});
|
|
1811
1811
|
}
|
|
1812
1812
|
/**
|
|
@@ -1818,14 +1818,14 @@ class st {
|
|
|
1818
1818
|
parseObjectTypeExtension() {
|
|
1819
1819
|
const t = this._lexer.token;
|
|
1820
1820
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1821
|
-
const n = this.parseName(),
|
|
1822
|
-
if (
|
|
1821
|
+
const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1822
|
+
if (r.length === 0 && i.length === 0 && s.length === 0)
|
|
1823
1823
|
throw this.unexpected();
|
|
1824
1824
|
return this.node(t, {
|
|
1825
1825
|
kind: c.OBJECT_TYPE_EXTENSION,
|
|
1826
1826
|
name: n,
|
|
1827
|
-
interfaces:
|
|
1828
|
-
directives:
|
|
1827
|
+
interfaces: r,
|
|
1828
|
+
directives: i,
|
|
1829
1829
|
fields: s
|
|
1830
1830
|
});
|
|
1831
1831
|
}
|
|
@@ -1838,14 +1838,14 @@ class st {
|
|
|
1838
1838
|
parseInterfaceTypeExtension() {
|
|
1839
1839
|
const t = this._lexer.token;
|
|
1840
1840
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1841
|
-
const n = this.parseName(),
|
|
1842
|
-
if (
|
|
1841
|
+
const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1842
|
+
if (r.length === 0 && i.length === 0 && s.length === 0)
|
|
1843
1843
|
throw this.unexpected();
|
|
1844
1844
|
return this.node(t, {
|
|
1845
1845
|
kind: c.INTERFACE_TYPE_EXTENSION,
|
|
1846
1846
|
name: n,
|
|
1847
|
-
interfaces:
|
|
1848
|
-
directives:
|
|
1847
|
+
interfaces: r,
|
|
1848
|
+
directives: i,
|
|
1849
1849
|
fields: s
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
@@ -1857,14 +1857,14 @@ class st {
|
|
|
1857
1857
|
parseUnionTypeExtension() {
|
|
1858
1858
|
const t = this._lexer.token;
|
|
1859
1859
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1860
|
-
const n = this.parseName(),
|
|
1861
|
-
if (
|
|
1860
|
+
const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
|
|
1861
|
+
if (r.length === 0 && i.length === 0)
|
|
1862
1862
|
throw this.unexpected();
|
|
1863
1863
|
return this.node(t, {
|
|
1864
1864
|
kind: c.UNION_TYPE_EXTENSION,
|
|
1865
1865
|
name: n,
|
|
1866
|
-
directives:
|
|
1867
|
-
types:
|
|
1866
|
+
directives: r,
|
|
1867
|
+
types: i
|
|
1868
1868
|
});
|
|
1869
1869
|
}
|
|
1870
1870
|
/**
|
|
@@ -1875,14 +1875,14 @@ class st {
|
|
|
1875
1875
|
parseEnumTypeExtension() {
|
|
1876
1876
|
const t = this._lexer.token;
|
|
1877
1877
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1878
|
-
const n = this.parseName(),
|
|
1879
|
-
if (
|
|
1878
|
+
const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
|
|
1879
|
+
if (r.length === 0 && i.length === 0)
|
|
1880
1880
|
throw this.unexpected();
|
|
1881
1881
|
return this.node(t, {
|
|
1882
1882
|
kind: c.ENUM_TYPE_EXTENSION,
|
|
1883
1883
|
name: n,
|
|
1884
|
-
directives:
|
|
1885
|
-
values:
|
|
1884
|
+
directives: r,
|
|
1885
|
+
values: i
|
|
1886
1886
|
});
|
|
1887
1887
|
}
|
|
1888
1888
|
/**
|
|
@@ -1893,14 +1893,14 @@ class st {
|
|
|
1893
1893
|
parseInputObjectTypeExtension() {
|
|
1894
1894
|
const t = this._lexer.token;
|
|
1895
1895
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1896
|
-
const n = this.parseName(),
|
|
1897
|
-
if (
|
|
1896
|
+
const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
|
|
1897
|
+
if (r.length === 0 && i.length === 0)
|
|
1898
1898
|
throw this.unexpected();
|
|
1899
1899
|
return this.node(t, {
|
|
1900
1900
|
kind: c.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1901
1901
|
name: n,
|
|
1902
|
-
directives:
|
|
1903
|
-
fields:
|
|
1902
|
+
directives: r,
|
|
1903
|
+
fields: i
|
|
1904
1904
|
});
|
|
1905
1905
|
}
|
|
1906
1906
|
/**
|
|
@@ -1911,17 +1911,17 @@ class st {
|
|
|
1911
1911
|
*/
|
|
1912
1912
|
parseDirectiveDefinition() {
|
|
1913
1913
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1914
|
-
this.expectKeyword("directive"), this.expectToken(
|
|
1915
|
-
const
|
|
1914
|
+
this.expectKeyword("directive"), this.expectToken(o.AT);
|
|
1915
|
+
const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1916
1916
|
this.expectKeyword("on");
|
|
1917
|
-
const
|
|
1917
|
+
const a = this.parseDirectiveLocations();
|
|
1918
1918
|
return this.node(t, {
|
|
1919
1919
|
kind: c.DIRECTIVE_DEFINITION,
|
|
1920
1920
|
description: n,
|
|
1921
|
-
name:
|
|
1922
|
-
arguments:
|
|
1921
|
+
name: r,
|
|
1922
|
+
arguments: i,
|
|
1923
1923
|
repeatable: s,
|
|
1924
|
-
locations:
|
|
1924
|
+
locations: a
|
|
1925
1925
|
});
|
|
1926
1926
|
}
|
|
1927
1927
|
/**
|
|
@@ -1930,7 +1930,7 @@ class st {
|
|
|
1930
1930
|
* - DirectiveLocations | DirectiveLocation
|
|
1931
1931
|
*/
|
|
1932
1932
|
parseDirectiveLocations() {
|
|
1933
|
-
return this.delimitedMany(
|
|
1933
|
+
return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
|
|
1934
1934
|
}
|
|
1935
1935
|
/*
|
|
1936
1936
|
* DirectiveLocation :
|
|
@@ -1961,7 +1961,7 @@ class st {
|
|
|
1961
1961
|
*/
|
|
1962
1962
|
parseDirectiveLocation() {
|
|
1963
1963
|
const t = this._lexer.token, n = this.parseName();
|
|
1964
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1964
|
+
if (Object.prototype.hasOwnProperty.call(z, n.value))
|
|
1965
1965
|
return n;
|
|
1966
1966
|
throw this.unexpected(t);
|
|
1967
1967
|
}
|
|
@@ -1975,29 +1975,29 @@ class st {
|
|
|
1975
1975
|
* - \@ Name ( Name : )
|
|
1976
1976
|
*/
|
|
1977
1977
|
parseSchemaCoordinate() {
|
|
1978
|
-
const t = this._lexer.token, n = this.expectOptionalToken(
|
|
1979
|
-
let
|
|
1980
|
-
!n && this.expectOptionalToken(
|
|
1978
|
+
const t = this._lexer.token, n = this.expectOptionalToken(o.AT), r = this.parseName();
|
|
1979
|
+
let i;
|
|
1980
|
+
!n && this.expectOptionalToken(o.DOT) && (i = this.parseName());
|
|
1981
1981
|
let s;
|
|
1982
|
-
return (n ||
|
|
1982
|
+
return (n || i) && this.expectOptionalToken(o.PAREN_L) && (s = this.parseName(), this.expectToken(o.COLON), this.expectToken(o.PAREN_R)), n ? s ? this.node(t, {
|
|
1983
1983
|
kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
|
|
1984
|
-
name:
|
|
1984
|
+
name: r,
|
|
1985
1985
|
argumentName: s
|
|
1986
1986
|
}) : this.node(t, {
|
|
1987
1987
|
kind: c.DIRECTIVE_COORDINATE,
|
|
1988
|
-
name:
|
|
1989
|
-
}) :
|
|
1988
|
+
name: r
|
|
1989
|
+
}) : i ? s ? this.node(t, {
|
|
1990
1990
|
kind: c.ARGUMENT_COORDINATE,
|
|
1991
|
-
name:
|
|
1992
|
-
fieldName:
|
|
1991
|
+
name: r,
|
|
1992
|
+
fieldName: i,
|
|
1993
1993
|
argumentName: s
|
|
1994
1994
|
}) : this.node(t, {
|
|
1995
1995
|
kind: c.MEMBER_COORDINATE,
|
|
1996
|
-
name:
|
|
1997
|
-
memberName:
|
|
1996
|
+
name: r,
|
|
1997
|
+
memberName: i
|
|
1998
1998
|
}) : this.node(t, {
|
|
1999
1999
|
kind: c.TYPE_COORDINATE,
|
|
2000
|
-
name:
|
|
2000
|
+
name: r
|
|
2001
2001
|
});
|
|
2002
2002
|
}
|
|
2003
2003
|
// Core parsing utility functions
|
|
@@ -2007,7 +2007,7 @@ class st {
|
|
|
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 _e(
|
|
2011
2011
|
t,
|
|
2012
2012
|
this._lexer.lastToken,
|
|
2013
2013
|
this._lexer.source
|
|
@@ -2030,7 +2030,7 @@ class st {
|
|
|
2030
2030
|
throw I(
|
|
2031
2031
|
this._lexer.source,
|
|
2032
2032
|
n.start,
|
|
2033
|
-
`Expected ${
|
|
2033
|
+
`Expected ${ke(t)}, found ${_(n)}.`
|
|
2034
2034
|
);
|
|
2035
2035
|
}
|
|
2036
2036
|
/**
|
|
@@ -2046,13 +2046,13 @@ class st {
|
|
|
2046
2046
|
*/
|
|
2047
2047
|
expectKeyword(t) {
|
|
2048
2048
|
const n = this._lexer.token;
|
|
2049
|
-
if (n.kind ===
|
|
2049
|
+
if (n.kind === o.NAME && n.value === t)
|
|
2050
2050
|
this.advanceLexer();
|
|
2051
2051
|
else
|
|
2052
2052
|
throw I(
|
|
2053
2053
|
this._lexer.source,
|
|
2054
2054
|
n.start,
|
|
2055
|
-
`Expected "${t}", found ${
|
|
2055
|
+
`Expected "${t}", found ${_(n)}.`
|
|
2056
2056
|
);
|
|
2057
2057
|
}
|
|
2058
2058
|
/**
|
|
@@ -2061,7 +2061,7 @@ class st {
|
|
|
2061
2061
|
*/
|
|
2062
2062
|
expectOptionalKeyword(t) {
|
|
2063
2063
|
const n = this._lexer.token;
|
|
2064
|
-
return n.kind ===
|
|
2064
|
+
return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
|
|
2065
2065
|
}
|
|
2066
2066
|
/**
|
|
2067
2067
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
@@ -2071,7 +2071,7 @@ class st {
|
|
|
2071
2071
|
return I(
|
|
2072
2072
|
this._lexer.source,
|
|
2073
2073
|
n.start,
|
|
2074
|
-
`Unexpected ${
|
|
2074
|
+
`Unexpected ${_(n)}.`
|
|
2075
2075
|
);
|
|
2076
2076
|
}
|
|
2077
2077
|
/**
|
|
@@ -2079,12 +2079,12 @@ class st {
|
|
|
2079
2079
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2080
2080
|
* Advances the parser to the next lex token after the closing token.
|
|
2081
2081
|
*/
|
|
2082
|
-
any(t, n,
|
|
2082
|
+
any(t, n, r) {
|
|
2083
2083
|
this.expectToken(t);
|
|
2084
|
-
const
|
|
2085
|
-
for (; !this.expectOptionalToken(
|
|
2086
|
-
|
|
2087
|
-
return
|
|
2084
|
+
const i = [];
|
|
2085
|
+
for (; !this.expectOptionalToken(r); )
|
|
2086
|
+
i.push(n.call(this));
|
|
2087
|
+
return i;
|
|
2088
2088
|
}
|
|
2089
2089
|
/**
|
|
2090
2090
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -2092,13 +2092,13 @@ class st {
|
|
|
2092
2092
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2093
2093
|
* Advances the parser to the next lex token after the closing token.
|
|
2094
2094
|
*/
|
|
2095
|
-
optionalMany(t, n,
|
|
2095
|
+
optionalMany(t, n, r) {
|
|
2096
2096
|
if (this.expectOptionalToken(t)) {
|
|
2097
|
-
const
|
|
2097
|
+
const i = [];
|
|
2098
2098
|
do
|
|
2099
|
-
|
|
2100
|
-
while (!this.expectOptionalToken(
|
|
2101
|
-
return
|
|
2099
|
+
i.push(n.call(this));
|
|
2100
|
+
while (!this.expectOptionalToken(r));
|
|
2101
|
+
return i;
|
|
2102
2102
|
}
|
|
2103
2103
|
return [];
|
|
2104
2104
|
}
|
|
@@ -2107,13 +2107,13 @@ class st {
|
|
|
2107
2107
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2108
2108
|
* Advances the parser to the next lex token after the closing token.
|
|
2109
2109
|
*/
|
|
2110
|
-
many(t, n,
|
|
2110
|
+
many(t, n, r) {
|
|
2111
2111
|
this.expectToken(t);
|
|
2112
|
-
const
|
|
2112
|
+
const i = [];
|
|
2113
2113
|
do
|
|
2114
|
-
|
|
2115
|
-
while (!this.expectOptionalToken(
|
|
2116
|
-
return
|
|
2114
|
+
i.push(n.call(this));
|
|
2115
|
+
while (!this.expectOptionalToken(r));
|
|
2116
|
+
return i;
|
|
2117
2117
|
}
|
|
2118
2118
|
/**
|
|
2119
2119
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
@@ -2122,15 +2122,15 @@ class st {
|
|
|
2122
2122
|
*/
|
|
2123
2123
|
delimitedMany(t, n) {
|
|
2124
2124
|
this.expectOptionalToken(t);
|
|
2125
|
-
const
|
|
2125
|
+
const r = [];
|
|
2126
2126
|
do
|
|
2127
|
-
|
|
2127
|
+
r.push(n.call(this));
|
|
2128
2128
|
while (this.expectOptionalToken(t));
|
|
2129
|
-
return
|
|
2129
|
+
return r;
|
|
2130
2130
|
}
|
|
2131
2131
|
advanceLexer() {
|
|
2132
2132
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2133
|
-
if (n.kind !==
|
|
2133
|
+
if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
|
|
2134
2134
|
throw I(
|
|
2135
2135
|
this._lexer.source,
|
|
2136
2136
|
n.start,
|
|
@@ -2138,37 +2138,37 @@ class st {
|
|
|
2138
2138
|
);
|
|
2139
2139
|
}
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function _(e) {
|
|
2142
2142
|
const t = e.value;
|
|
2143
|
-
return
|
|
2143
|
+
return ke(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2144
2144
|
}
|
|
2145
|
-
function
|
|
2145
|
+
function ke(e) {
|
|
2146
2146
|
return Ue(e) ? `"${e}"` : e;
|
|
2147
2147
|
}
|
|
2148
2148
|
var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), Ae = !0, $ = !1;
|
|
2149
2149
|
function Te(e) {
|
|
2150
2150
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2151
2151
|
}
|
|
2152
|
-
function
|
|
2152
|
+
function ot(e) {
|
|
2153
2153
|
return Te(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
|
-
return e.definitions.forEach(function(
|
|
2158
|
-
if (
|
|
2159
|
-
var
|
|
2160
|
-
|
|
2157
|
+
return e.definitions.forEach(function(r) {
|
|
2158
|
+
if (r.kind === "FragmentDefinition") {
|
|
2159
|
+
var i = r.name.value, s = ot(r.loc), a = G.get(i);
|
|
2160
|
+
a && !a.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
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) :
|
|
2162
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || G.set(i, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(r));
|
|
2163
2163
|
} else
|
|
2164
|
-
n.push(
|
|
2164
|
+
n.push(r);
|
|
2165
2165
|
}), w(w({}, e), { definitions: n });
|
|
2166
2166
|
}
|
|
2167
2167
|
function ct(e) {
|
|
2168
2168
|
var t = new Set(e.definitions);
|
|
2169
|
-
t.forEach(function(
|
|
2170
|
-
|
|
2171
|
-
var s = i
|
|
2169
|
+
t.forEach(function(r) {
|
|
2170
|
+
r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
|
|
2171
|
+
var s = r[i];
|
|
2172
2172
|
s && typeof s == "object" && t.add(s);
|
|
2173
2173
|
});
|
|
2174
2174
|
});
|
|
@@ -2178,13 +2178,13 @@ function ct(e) {
|
|
|
2178
2178
|
function dt(e) {
|
|
2179
2179
|
var t = Te(e);
|
|
2180
2180
|
if (!L.has(t)) {
|
|
2181
|
-
var n =
|
|
2181
|
+
var n = it(e, {
|
|
2182
2182
|
experimentalFragmentVariables: $,
|
|
2183
2183
|
allowLegacyFragmentVariables: $
|
|
2184
2184
|
});
|
|
2185
2185
|
if (!n || n.kind !== "Document")
|
|
2186
2186
|
throw new Error("Not a valid GraphQL document.");
|
|
2187
|
-
L.set(t, ct(
|
|
2187
|
+
L.set(t, ct(at(n)));
|
|
2188
2188
|
}
|
|
2189
2189
|
return L.get(t);
|
|
2190
2190
|
}
|
|
@@ -2192,10 +2192,10 @@ function u(e) {
|
|
|
2192
2192
|
for (var t = [], n = 1; n < arguments.length; n++)
|
|
2193
2193
|
t[n - 1] = arguments[n];
|
|
2194
2194
|
typeof e == "string" && (e = [e]);
|
|
2195
|
-
var
|
|
2196
|
-
return t.forEach(function(
|
|
2197
|
-
|
|
2198
|
-
}), dt(
|
|
2195
|
+
var r = e[0];
|
|
2196
|
+
return t.forEach(function(i, s) {
|
|
2197
|
+
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
2198
|
+
}), dt(r);
|
|
2199
2199
|
}
|
|
2200
2200
|
function ut() {
|
|
2201
2201
|
L.clear(), G.clear();
|
|
@@ -2305,6 +2305,9 @@ const gt = u`
|
|
|
2305
2305
|
label
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
|
+
discount {
|
|
2309
|
+
code
|
|
2310
|
+
}
|
|
2308
2311
|
}
|
|
2309
2312
|
}
|
|
2310
2313
|
`, mt = u`
|
|
@@ -2349,6 +2352,9 @@ const gt = u`
|
|
|
2349
2352
|
}
|
|
2350
2353
|
}
|
|
2351
2354
|
downloadCode
|
|
2355
|
+
discount {
|
|
2356
|
+
code
|
|
2357
|
+
}
|
|
2352
2358
|
}
|
|
2353
2359
|
}
|
|
2354
2360
|
`, ft = u`
|
|
@@ -2371,6 +2377,13 @@ const gt = u`
|
|
|
2371
2377
|
}
|
|
2372
2378
|
}
|
|
2373
2379
|
`, Et = u`
|
|
2380
|
+
mutation configureDiscount($orderId: ID!, $discountCode: String) {
|
|
2381
|
+
createOrderDiscount(input: {id: $orderId, discountCode: $discountCode}) {
|
|
2382
|
+
amount
|
|
2383
|
+
code
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
`, yt = u`
|
|
2374
2387
|
mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
|
|
2375
2388
|
configurePackage(
|
|
2376
2389
|
input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
|
|
@@ -2380,7 +2393,7 @@ const gt = u`
|
|
|
2380
2393
|
amountReserved
|
|
2381
2394
|
}
|
|
2382
2395
|
}
|
|
2383
|
-
`,
|
|
2396
|
+
`, Ot = u`
|
|
2384
2397
|
mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
|
|
2385
2398
|
reserveAdditionalPackageItem(
|
|
2386
2399
|
input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
|
|
@@ -2394,56 +2407,59 @@ const gt = u`
|
|
|
2394
2407
|
mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
|
|
2395
2408
|
configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
|
|
2396
2409
|
}
|
|
2397
|
-
`,
|
|
2410
|
+
`, At = u`
|
|
2398
2411
|
mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
|
|
2399
2412
|
createOrderCustomer(
|
|
2400
2413
|
input: {id: $orderId, countryCode: $countryCode, customer: $customer}
|
|
2401
2414
|
)
|
|
2402
2415
|
}
|
|
2403
|
-
`,
|
|
2416
|
+
`, Tt = u`
|
|
2404
2417
|
mutation deleteOrder($orderId: ID!) {
|
|
2405
2418
|
cancelOrder(id: $orderId)
|
|
2406
2419
|
}
|
|
2407
|
-
`,
|
|
2408
|
-
function Nt(e, t =
|
|
2420
|
+
`, Dt = (e, t, n, r) => e();
|
|
2421
|
+
function Nt(e, t = Dt) {
|
|
2409
2422
|
return {
|
|
2410
|
-
findActiveOrderById(n,
|
|
2411
|
-
return t((s) => e.request({ document: gt, variables: n, requestHeaders: { ...
|
|
2423
|
+
findActiveOrderById(n, r, i) {
|
|
2424
|
+
return t((s) => e.request({ document: gt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findActiveOrderById", "query", n);
|
|
2425
|
+
},
|
|
2426
|
+
findOrderById(n, r, i) {
|
|
2427
|
+
return t((s) => e.request({ document: mt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findOrderById", "query", n);
|
|
2412
2428
|
},
|
|
2413
|
-
|
|
2414
|
-
return t((s) => e.request({ document:
|
|
2429
|
+
addToOrder(n, r, i) {
|
|
2430
|
+
return t((s) => e.request({ document: ft, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "addToOrder", "mutation", n);
|
|
2415
2431
|
},
|
|
2416
|
-
|
|
2417
|
-
return t((s) => e.request({ document:
|
|
2432
|
+
removeFromOrder(n, r, i) {
|
|
2433
|
+
return t((s) => e.request({ document: It, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "removeFromOrder", "mutation", n);
|
|
2418
2434
|
},
|
|
2419
|
-
|
|
2420
|
-
return t((s) => e.request({ document:
|
|
2435
|
+
configureDiscount(n, r, i) {
|
|
2436
|
+
return t((s) => e.request({ document: Et, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureDiscount", "mutation", n);
|
|
2421
2437
|
},
|
|
2422
|
-
configurePackage(n,
|
|
2423
|
-
return t((s) => e.request({ document:
|
|
2438
|
+
configurePackage(n, r, i) {
|
|
2439
|
+
return t((s) => e.request({ document: yt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configurePackage", "mutation", n);
|
|
2424
2440
|
},
|
|
2425
|
-
reserveAdditionalPackageItem(n,
|
|
2426
|
-
return t((s) => e.request({ document:
|
|
2441
|
+
reserveAdditionalPackageItem(n, r, i) {
|
|
2442
|
+
return t((s) => e.request({ document: Ot, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "reserveAdditionalPackageItem", "mutation", n);
|
|
2427
2443
|
},
|
|
2428
|
-
configureOrderDeliveryOption(n,
|
|
2429
|
-
return t((s) => e.request({ document: kt, variables: n, requestHeaders: { ...
|
|
2444
|
+
configureOrderDeliveryOption(n, r, i) {
|
|
2445
|
+
return t((s) => e.request({ document: kt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureOrderDeliveryOption", "mutation", n);
|
|
2430
2446
|
},
|
|
2431
|
-
createOrderCustomer(n,
|
|
2432
|
-
return t((s) => e.request({ document:
|
|
2447
|
+
createOrderCustomer(n, r, i) {
|
|
2448
|
+
return t((s) => e.request({ document: At, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createOrderCustomer", "mutation", n);
|
|
2433
2449
|
},
|
|
2434
|
-
deleteOrder(n,
|
|
2435
|
-
return t((s) => e.request({ document:
|
|
2450
|
+
deleteOrder(n, r, i) {
|
|
2451
|
+
return t((s) => e.request({ document: Tt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "deleteOrder", "mutation", n);
|
|
2436
2452
|
}
|
|
2437
2453
|
};
|
|
2438
2454
|
}
|
|
2439
|
-
class
|
|
2455
|
+
class vt {
|
|
2440
2456
|
config;
|
|
2441
2457
|
sdk;
|
|
2442
2458
|
constructor(t) {
|
|
2443
2459
|
this.config = t, this.sdk = Nt(new T(t.apiUrl));
|
|
2444
2460
|
}
|
|
2445
2461
|
// Basket update functions
|
|
2446
|
-
async addProduct(t, n,
|
|
2462
|
+
async addProduct(t, n, r) {
|
|
2447
2463
|
try {
|
|
2448
2464
|
return this.debugLog("Adding product", {
|
|
2449
2465
|
productId: n.id,
|
|
@@ -2461,11 +2477,11 @@ class Dt {
|
|
|
2461
2477
|
}
|
|
2462
2478
|
} : null,
|
|
2463
2479
|
trackerId: this.config.trackerId,
|
|
2464
|
-
shopId:
|
|
2480
|
+
shopId: r,
|
|
2465
2481
|
amount: n.amount
|
|
2466
2482
|
})).reserveProduct;
|
|
2467
|
-
} catch (
|
|
2468
|
-
throw this.debugLog("Error adding product",
|
|
2483
|
+
} catch (i) {
|
|
2484
|
+
throw this.debugLog("Error adding product", i), this.handleError(i), i;
|
|
2469
2485
|
}
|
|
2470
2486
|
}
|
|
2471
2487
|
async removeProduct(t, n) {
|
|
@@ -2485,46 +2501,46 @@ class Dt {
|
|
|
2485
2501
|
} : null,
|
|
2486
2502
|
amount: n.amount
|
|
2487
2503
|
})).releaseProduct ?? null;
|
|
2488
|
-
} catch (
|
|
2489
|
-
throw this.debugLog("Error removing product",
|
|
2504
|
+
} catch (r) {
|
|
2505
|
+
throw this.debugLog("Error removing product", r), this.handleError(r), r;
|
|
2490
2506
|
}
|
|
2491
2507
|
}
|
|
2492
|
-
async configurePackage(t, n,
|
|
2508
|
+
async configurePackage(t, n, r) {
|
|
2493
2509
|
try {
|
|
2494
|
-
const
|
|
2495
|
-
packageItemId:
|
|
2496
|
-
eventId:
|
|
2510
|
+
const i = n.items.map((a) => ({
|
|
2511
|
+
packageItemId: a.packageItemId,
|
|
2512
|
+
eventId: a.eventId
|
|
2497
2513
|
}));
|
|
2498
2514
|
this.debugLog("Configuring package", {
|
|
2499
2515
|
packageId: n.id,
|
|
2500
2516
|
orderId: t,
|
|
2501
2517
|
amount: n.amount,
|
|
2502
|
-
items:
|
|
2503
|
-
shopId:
|
|
2518
|
+
items: i,
|
|
2519
|
+
shopId: r
|
|
2504
2520
|
});
|
|
2505
2521
|
const s = await this.sdk.configurePackage({
|
|
2506
2522
|
trackerId: this.config.trackerId,
|
|
2507
|
-
shopId:
|
|
2523
|
+
shopId: r,
|
|
2508
2524
|
packageId: n.id,
|
|
2509
2525
|
orderId: t,
|
|
2510
2526
|
amount: n.amount,
|
|
2511
|
-
items:
|
|
2527
|
+
items: i
|
|
2512
2528
|
});
|
|
2513
2529
|
return this.debugLog("Configure package response"), s.configurePackage ?? null;
|
|
2514
|
-
} catch (
|
|
2515
|
-
throw this.debugLog("Error configuring package",
|
|
2530
|
+
} catch (i) {
|
|
2531
|
+
throw this.debugLog("Error configuring package", i), this.handleError(i), i;
|
|
2516
2532
|
}
|
|
2517
2533
|
}
|
|
2518
2534
|
async configureCustomer(t, n) {
|
|
2519
2535
|
this.debugLog("Creating/replacing customer", { orderId: t, email: n.email });
|
|
2520
2536
|
try {
|
|
2521
|
-
const
|
|
2537
|
+
const r = await this.sdk.createOrderCustomer({
|
|
2522
2538
|
orderId: t,
|
|
2523
2539
|
customer: n
|
|
2524
2540
|
});
|
|
2525
|
-
this.debugLog("Customer set successfully",
|
|
2526
|
-
} catch (
|
|
2527
|
-
throw this.debugLog("Failed to set customer",
|
|
2541
|
+
this.debugLog("Customer set successfully", r);
|
|
2542
|
+
} catch (r) {
|
|
2543
|
+
throw this.debugLog("Failed to set customer", r), new Error(`Failed to set customer: ${r.message}`);
|
|
2528
2544
|
}
|
|
2529
2545
|
}
|
|
2530
2546
|
async reserveAdditionalPackageItem(t, n) {
|
|
@@ -2536,16 +2552,16 @@ class Dt {
|
|
|
2536
2552
|
packageId: n.packageId,
|
|
2537
2553
|
packageItemId: n.packageItemId
|
|
2538
2554
|
});
|
|
2539
|
-
const
|
|
2555
|
+
const r = await this.sdk.reserveAdditionalPackageItem({
|
|
2540
2556
|
orderId: t,
|
|
2541
2557
|
eventId: n.eventId,
|
|
2542
2558
|
amount: n.amount,
|
|
2543
2559
|
packageId: n.packageId,
|
|
2544
2560
|
packageItemId: n.packageItemId
|
|
2545
2561
|
});
|
|
2546
|
-
return this.debugLog("reserve additional packageItem"),
|
|
2547
|
-
} catch (
|
|
2548
|
-
throw this.debugLog("Error configuring package",
|
|
2562
|
+
return this.debugLog("reserve additional packageItem"), r.reserveAdditionalPackageItem ?? null;
|
|
2563
|
+
} catch (r) {
|
|
2564
|
+
throw this.debugLog("Error configuring package", r), this.handleError(r), r;
|
|
2549
2565
|
}
|
|
2550
2566
|
}
|
|
2551
2567
|
// Cancel and clear order functions
|
|
@@ -2554,29 +2570,43 @@ class Dt {
|
|
|
2554
2570
|
}
|
|
2555
2571
|
async findOrder(t, n) {
|
|
2556
2572
|
try {
|
|
2557
|
-
const
|
|
2558
|
-
return
|
|
2559
|
-
id:
|
|
2560
|
-
reference:
|
|
2561
|
-
currency:
|
|
2562
|
-
downloadCode:
|
|
2573
|
+
const r = await this.sdk.findOrderById({ id: t, reference: n });
|
|
2574
|
+
return r.findOrder ? {
|
|
2575
|
+
id: r.findOrder.id,
|
|
2576
|
+
reference: r.findOrder.reference,
|
|
2577
|
+
currency: r.findOrder.currency,
|
|
2578
|
+
downloadCode: r.findOrder.downloadCode,
|
|
2563
2579
|
organization: {
|
|
2564
|
-
name:
|
|
2565
|
-
paymentBanner:
|
|
2580
|
+
name: r.findOrder.organization.name,
|
|
2581
|
+
paymentBanner: r.findOrder.organization.name
|
|
2566
2582
|
},
|
|
2567
|
-
customer:
|
|
2568
|
-
firstName:
|
|
2569
|
-
lastName:
|
|
2570
|
-
email:
|
|
2571
|
-
age:
|
|
2572
|
-
gender:
|
|
2573
|
-
residence:
|
|
2574
|
-
extraInfo:
|
|
2583
|
+
customer: r.findOrder.mainBooker ? {
|
|
2584
|
+
firstName: r.findOrder.mainBooker.firstName,
|
|
2585
|
+
lastName: r.findOrder.mainBooker.lastName,
|
|
2586
|
+
email: r.findOrder.mainBooker.email,
|
|
2587
|
+
age: r.findOrder.mainBooker.age,
|
|
2588
|
+
gender: r.findOrder.mainBooker.gender,
|
|
2589
|
+
residence: r.findOrder.mainBooker.residence,
|
|
2590
|
+
extraInfo: r.findOrder.mainBooker.extraInfo
|
|
2575
2591
|
} : null,
|
|
2576
|
-
items:
|
|
2592
|
+
items: r.findOrder.items,
|
|
2593
|
+
discountCode: r.findOrder.discount?.code
|
|
2577
2594
|
} : null;
|
|
2578
|
-
} catch (
|
|
2579
|
-
return this.debugLog("Error finding order",
|
|
2595
|
+
} catch (r) {
|
|
2596
|
+
return this.debugLog("Error finding order", r), this.handleError(r), null;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
async configureDiscountCode(t, n) {
|
|
2600
|
+
try {
|
|
2601
|
+
return this.debugLog("Configuring discount", {
|
|
2602
|
+
discountCode: n.code,
|
|
2603
|
+
orderId: t
|
|
2604
|
+
}), await this.sdk.configureDiscount({
|
|
2605
|
+
orderId: t,
|
|
2606
|
+
discountCode: n.code
|
|
2607
|
+
});
|
|
2608
|
+
} catch (r) {
|
|
2609
|
+
return this.debugLog("Error configuring discount", r), this.handleError(r), null;
|
|
2580
2610
|
}
|
|
2581
2611
|
}
|
|
2582
2612
|
async findActiveOrder(t) {
|
|
@@ -2585,11 +2615,11 @@ class Dt {
|
|
|
2585
2615
|
const n = await this.sdk.findActiveOrderById({ id: t });
|
|
2586
2616
|
if (!n?.findOrder)
|
|
2587
2617
|
return null;
|
|
2588
|
-
const
|
|
2589
|
-
this.debugLog("Order fetched successfully",
|
|
2590
|
-
const
|
|
2591
|
-
let m =
|
|
2592
|
-
return d.product.type === "PROMOTER" ? m =
|
|
2618
|
+
const r = n.findOrder;
|
|
2619
|
+
this.debugLog("Order fetched successfully", r);
|
|
2620
|
+
const i = r.items, s = i.filter((d) => d.product != null && d.amount > 0).map((d) => {
|
|
2621
|
+
let m = D.PRODUCT;
|
|
2622
|
+
return d.product.type === "PROMOTER" ? m = D.ADD_ONS : d.product.type === "PICKUP" ? m = D.PICKUP : d.product.type === "DELIVERY" && (m = D.DELIVERY), {
|
|
2593
2623
|
id: d.product.id,
|
|
2594
2624
|
type: m,
|
|
2595
2625
|
name: d.product.name,
|
|
@@ -2605,59 +2635,59 @@ class Dt {
|
|
|
2605
2635
|
label: y.label
|
|
2606
2636
|
}))
|
|
2607
2637
|
};
|
|
2608
|
-
}),
|
|
2638
|
+
}), a = i.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
|
|
2609
2639
|
const {
|
|
2610
2640
|
packageItem: y,
|
|
2611
2641
|
event: p,
|
|
2612
|
-
amount:
|
|
2613
|
-
price:
|
|
2614
|
-
serviceFee:
|
|
2615
|
-
depositPrice:
|
|
2642
|
+
amount: k,
|
|
2643
|
+
price: C,
|
|
2644
|
+
serviceFee: H,
|
|
2645
|
+
depositPrice: Y,
|
|
2616
2646
|
originalPrice: J
|
|
2617
2647
|
} = m, A = y.package.id;
|
|
2618
|
-
d[A] ? (d[A].price +=
|
|
2648
|
+
d[A] ? (d[A].price += C ?? 0, d[A].serviceFee += H ?? 0, d[A].originalPrice += J ?? 0, d[A].depositPrice += Y ?? C ?? 0) : d[A] = {
|
|
2619
2649
|
id: A,
|
|
2620
|
-
type:
|
|
2650
|
+
type: D.PACKAGE,
|
|
2621
2651
|
name: y.package.name,
|
|
2622
|
-
amount:
|
|
2623
|
-
price:
|
|
2624
|
-
serviceFee:
|
|
2625
|
-
depositPrice:
|
|
2652
|
+
amount: k,
|
|
2653
|
+
price: C ?? 0,
|
|
2654
|
+
serviceFee: H ?? 0,
|
|
2655
|
+
depositPrice: Y ?? C ?? 0,
|
|
2626
2656
|
originalPrice: J ?? 0,
|
|
2627
2657
|
packageItems: []
|
|
2628
2658
|
};
|
|
2629
|
-
const
|
|
2659
|
+
const De = O.fromISO(p.startAt, {
|
|
2630
2660
|
zone: p.timezone
|
|
2631
|
-
}),
|
|
2661
|
+
}), Ne = O.fromISO(p.endAt, {
|
|
2632
2662
|
zone: p.timezone
|
|
2633
2663
|
});
|
|
2634
2664
|
return d[A].packageItems.push({
|
|
2635
2665
|
packageItemId: y.id,
|
|
2636
2666
|
eventId: p.id,
|
|
2637
2667
|
name: p.name,
|
|
2638
|
-
startAt:
|
|
2639
|
-
endAt:
|
|
2668
|
+
startAt: De.toJSDate().toISOString(),
|
|
2669
|
+
endAt: Ne.toJSDate().toISOString()
|
|
2640
2670
|
}), d;
|
|
2641
2671
|
}, {}), l = [
|
|
2642
2672
|
...s,
|
|
2643
|
-
...Object.values(
|
|
2673
|
+
...Object.values(a)
|
|
2644
2674
|
], h = l.reduce((d, m) => d + (m.amount || 0), 0);
|
|
2645
2675
|
if (h === 0)
|
|
2646
2676
|
return null;
|
|
2647
|
-
const E =
|
|
2677
|
+
const E = i.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), g = O.fromMillis(Math.min(...E));
|
|
2648
2678
|
return {
|
|
2649
|
-
id:
|
|
2650
|
-
currency:
|
|
2679
|
+
id: r.id,
|
|
2680
|
+
currency: r.currency,
|
|
2651
2681
|
expiredAt: g?.toJSDate().toISOString(),
|
|
2652
2682
|
items: l,
|
|
2653
|
-
customer:
|
|
2654
|
-
firstName:
|
|
2655
|
-
lastName:
|
|
2656
|
-
email:
|
|
2657
|
-
age:
|
|
2658
|
-
gender:
|
|
2659
|
-
residence:
|
|
2660
|
-
extraInfo:
|
|
2683
|
+
customer: r.mainBooker ? {
|
|
2684
|
+
firstName: r.mainBooker.firstName,
|
|
2685
|
+
lastName: r.mainBooker.lastName,
|
|
2686
|
+
email: r.mainBooker.email,
|
|
2687
|
+
age: r.mainBooker.age,
|
|
2688
|
+
gender: r.mainBooker.gender,
|
|
2689
|
+
residence: r.mainBooker.residence,
|
|
2690
|
+
extraInfo: r.mainBooker.extraInfo
|
|
2661
2691
|
} : null,
|
|
2662
2692
|
count: h,
|
|
2663
2693
|
orderProtection: !1
|
|
@@ -2672,16 +2702,16 @@ class Dt {
|
|
|
2672
2702
|
handleError(t) {
|
|
2673
2703
|
const n = t;
|
|
2674
2704
|
if (n.graphQLErrors && n.graphQLErrors.length > 0) {
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2705
|
+
const r = n.graphQLErrors[0];
|
|
2706
|
+
r.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), r.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
|
|
2677
2707
|
}
|
|
2678
2708
|
if (n.response?.errors && n.response.errors.length > 0) {
|
|
2679
|
-
const
|
|
2680
|
-
console.error("GraphQL Error:",
|
|
2709
|
+
const r = n.response.errors[0];
|
|
2710
|
+
console.error("GraphQL Error:", r.message), r.extensions?.code && console.error("Error Code:", r.extensions.code);
|
|
2681
2711
|
}
|
|
2682
2712
|
}
|
|
2683
2713
|
}
|
|
2684
|
-
const
|
|
2714
|
+
const Pt = u`
|
|
2685
2715
|
query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
|
|
2686
2716
|
findAllPublicEventByOrganizationId(
|
|
2687
2717
|
id: $organizationId
|
|
@@ -2727,7 +2757,7 @@ const vt = u`
|
|
|
2727
2757
|
count
|
|
2728
2758
|
}
|
|
2729
2759
|
}
|
|
2730
|
-
`,
|
|
2760
|
+
`, bt = u`
|
|
2731
2761
|
query EventDetailPage($eventId: ID!) {
|
|
2732
2762
|
findPublicEventById(id: $eventId) {
|
|
2733
2763
|
id
|
|
@@ -2760,7 +2790,7 @@ const vt = u`
|
|
|
2760
2790
|
seatsIoEventId
|
|
2761
2791
|
}
|
|
2762
2792
|
}
|
|
2763
|
-
`,
|
|
2793
|
+
`, St = u`
|
|
2764
2794
|
query FindPublicEventBySlug($organizationId: ID!, $slug: String!) {
|
|
2765
2795
|
findPublicEventBySlug(organizationId: $organizationId, slug: $slug) {
|
|
2766
2796
|
id
|
|
@@ -2793,7 +2823,7 @@ const vt = u`
|
|
|
2793
2823
|
seatsIoEventId
|
|
2794
2824
|
}
|
|
2795
2825
|
}
|
|
2796
|
-
`,
|
|
2826
|
+
`, xt = u`
|
|
2797
2827
|
query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
|
|
2798
2828
|
findPublicProductsByEventId(
|
|
2799
2829
|
eventId: $eventId
|
|
@@ -2828,24 +2858,24 @@ const vt = u`
|
|
|
2828
2858
|
showEndSalesAtTag
|
|
2829
2859
|
}
|
|
2830
2860
|
}
|
|
2831
|
-
`,
|
|
2832
|
-
function _t(e, t =
|
|
2861
|
+
`, Ct = (e, t, n, r) => e();
|
|
2862
|
+
function _t(e, t = Ct) {
|
|
2833
2863
|
return {
|
|
2834
|
-
EventOverviewPage(n,
|
|
2835
|
-
return t((s) => e.request({ document:
|
|
2864
|
+
EventOverviewPage(n, r, i) {
|
|
2865
|
+
return t((s) => e.request({ document: Pt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventOverviewPage", "query", n);
|
|
2836
2866
|
},
|
|
2837
|
-
EventDetailPage(n,
|
|
2838
|
-
return t((s) => e.request({ document:
|
|
2867
|
+
EventDetailPage(n, r, i) {
|
|
2868
|
+
return t((s) => e.request({ document: bt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventDetailPage", "query", n);
|
|
2839
2869
|
},
|
|
2840
|
-
FindPublicEventBySlug(n,
|
|
2841
|
-
return t((s) => e.request({ document:
|
|
2870
|
+
FindPublicEventBySlug(n, r, i) {
|
|
2871
|
+
return t((s) => e.request({ document: St, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "FindPublicEventBySlug", "query", n);
|
|
2842
2872
|
},
|
|
2843
|
-
findProductsByEventId(n,
|
|
2844
|
-
return t((s) => e.request({ document:
|
|
2873
|
+
findProductsByEventId(n, r, i) {
|
|
2874
|
+
return t((s) => e.request({ document: xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findProductsByEventId", "query", n);
|
|
2845
2875
|
}
|
|
2846
2876
|
};
|
|
2847
2877
|
}
|
|
2848
|
-
class
|
|
2878
|
+
class Lt {
|
|
2849
2879
|
config;
|
|
2850
2880
|
sdk;
|
|
2851
2881
|
constructor(t) {
|
|
@@ -2865,7 +2895,7 @@ class Ct {
|
|
|
2865
2895
|
sorts: t.sorts,
|
|
2866
2896
|
trackerId: this.config.trackerId
|
|
2867
2897
|
});
|
|
2868
|
-
const
|
|
2898
|
+
const r = await this.sdk.EventOverviewPage({
|
|
2869
2899
|
organizationId: this.config.organizationId ?? n ?? "",
|
|
2870
2900
|
hostingIds: t.hostingIds,
|
|
2871
2901
|
locationIds: t.locationIds,
|
|
@@ -2881,16 +2911,16 @@ class Ct {
|
|
|
2881
2911
|
searchTerm: t.searchTerm,
|
|
2882
2912
|
priceRange: t.priceRange
|
|
2883
2913
|
});
|
|
2884
|
-
if (this.debugLog("Raw GraphQL response",
|
|
2885
|
-
const
|
|
2914
|
+
if (this.debugLog("Raw GraphQL response", r), r?.findAllPublicEventByOrganizationId?.data) {
|
|
2915
|
+
const i = r.findAllPublicEventByOrganizationId.data.map((s) => ({
|
|
2886
2916
|
id: s.id,
|
|
2887
2917
|
name: s.name,
|
|
2888
2918
|
icon: s.icon,
|
|
2889
2919
|
banner: s.banner,
|
|
2890
2920
|
description: s.description,
|
|
2891
2921
|
addonDescription: s.addonDescription,
|
|
2892
|
-
startAt:
|
|
2893
|
-
endAt:
|
|
2922
|
+
startAt: O.fromISO(s.startAt, { zone: s.timezone }).toJSDate().toISOString(),
|
|
2923
|
+
endAt: O.fromISO(s.endAt, { zone: s.timezone }).toJSDate().toISOString(),
|
|
2894
2924
|
timezone: s.timezone,
|
|
2895
2925
|
startSalesAt: null,
|
|
2896
2926
|
endSalesAt: null,
|
|
@@ -2908,14 +2938,13 @@ class Ct {
|
|
|
2908
2938
|
} : void 0,
|
|
2909
2939
|
infoDescription: s.infoDescription,
|
|
2910
2940
|
startingPrice: s.startingPrice,
|
|
2911
|
-
totalViews: s.totalViews
|
|
2912
|
-
seatsIoEventId: s.seatsIoEventId
|
|
2941
|
+
totalViews: s.totalViews
|
|
2913
2942
|
}));
|
|
2914
|
-
return this.debugLog("Processed events", { events:
|
|
2943
|
+
return this.debugLog("Processed events", { events: i, count: i.length }), [i, r.findAllPublicEventByOrganizationId.count ?? 0];
|
|
2915
2944
|
} else
|
|
2916
2945
|
return this.debugLog("No events found in response"), [[], 0];
|
|
2917
|
-
} catch (
|
|
2918
|
-
throw this.debugLog("Error fetching events",
|
|
2946
|
+
} catch (r) {
|
|
2947
|
+
throw this.debugLog("Error fetching events", r), r;
|
|
2919
2948
|
}
|
|
2920
2949
|
}
|
|
2921
2950
|
async getEvent(t) {
|
|
@@ -2923,58 +2952,15 @@ class Ct {
|
|
|
2923
2952
|
this.debugLog("Fetching single event", { eventId: t });
|
|
2924
2953
|
const n = await this.sdk.EventDetailPage({ eventId: t });
|
|
2925
2954
|
if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
|
|
2926
|
-
const
|
|
2927
|
-
id: i.id,
|
|
2928
|
-
name: i.name,
|
|
2929
|
-
icon: i.icon,
|
|
2930
|
-
banner: i.banner,
|
|
2931
|
-
description: i.description,
|
|
2932
|
-
addonDescription: i.addonDescription,
|
|
2933
|
-
startAt: k.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
|
|
2934
|
-
endAt: k.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
|
|
2935
|
-
timezone: i.timezone,
|
|
2936
|
-
startSalesAt: i.startSalesAt,
|
|
2937
|
-
endSalesAt: i.endSalesAt,
|
|
2938
|
-
slug: i.slug ?? "ERROR",
|
|
2939
|
-
facebookPixelId: i.facebookPixelId,
|
|
2940
|
-
status: i.status,
|
|
2941
|
-
location: i.location ? {
|
|
2942
|
-
id: i.location.id,
|
|
2943
|
-
name: i.location.name,
|
|
2944
|
-
address: i.location.address
|
|
2945
|
-
} : void 0,
|
|
2946
|
-
hosting: i.hosting ? {
|
|
2947
|
-
id: i.hosting.id,
|
|
2948
|
-
name: i.hosting.name
|
|
2949
|
-
} : void 0,
|
|
2950
|
-
infoDescription: i.infoDescription,
|
|
2951
|
-
startingPrice: i.startingPrice,
|
|
2952
|
-
totalViews: i.totalViews,
|
|
2953
|
-
seatsIoEventId: i.seatsIoEventId
|
|
2954
|
-
};
|
|
2955
|
-
return this.debugLog("Processed single event", r), r;
|
|
2956
|
-
} else {
|
|
2957
|
-
this.debugLog("No event found for id", t);
|
|
2958
|
-
return;
|
|
2959
|
-
}
|
|
2960
|
-
} catch (n) {
|
|
2961
|
-
throw this.debugLog("Error fetching single event", n), n;
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
async getEventBySlug(t, n) {
|
|
2965
|
-
try {
|
|
2966
|
-
this.debugLog("Fetching single event by slug", { organizationId: t, slug: n });
|
|
2967
|
-
const i = await this.sdk.FindPublicEventBySlug({ organizationId: t, slug: n });
|
|
2968
|
-
if (this.debugLog("Raw GraphQL response", i), i?.findPublicEventBySlug) {
|
|
2969
|
-
const r = i.findPublicEventBySlug, s = {
|
|
2955
|
+
const r = n.findPublicEventById, i = {
|
|
2970
2956
|
id: r.id,
|
|
2971
2957
|
name: r.name,
|
|
2972
2958
|
icon: r.icon,
|
|
2973
2959
|
banner: r.banner,
|
|
2974
2960
|
description: r.description,
|
|
2975
2961
|
addonDescription: r.addonDescription,
|
|
2976
|
-
startAt:
|
|
2977
|
-
endAt:
|
|
2962
|
+
startAt: O.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
|
|
2963
|
+
endAt: O.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
|
|
2978
2964
|
timezone: r.timezone,
|
|
2979
2965
|
startSalesAt: r.startSalesAt,
|
|
2980
2966
|
endSalesAt: r.endSalesAt,
|
|
@@ -2993,74 +2979,119 @@ class Ct {
|
|
|
2993
2979
|
infoDescription: r.infoDescription,
|
|
2994
2980
|
startingPrice: r.startingPrice,
|
|
2995
2981
|
totalViews: r.totalViews,
|
|
2996
|
-
seatsIoEventId: r.seatsIoEventId
|
|
2982
|
+
seatsIoEventId: r.seatsIoEventId,
|
|
2983
|
+
maxAmountOfTicketsPerOrder: r.maxAmountOfTicketsPerOrder
|
|
2984
|
+
};
|
|
2985
|
+
return this.debugLog("Processed single event", i), i;
|
|
2986
|
+
} else {
|
|
2987
|
+
this.debugLog("No event found for id", t);
|
|
2988
|
+
return;
|
|
2989
|
+
}
|
|
2990
|
+
} catch (n) {
|
|
2991
|
+
throw this.debugLog("Error fetching single event", n), n;
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
async getEventBySlug(t, n) {
|
|
2995
|
+
try {
|
|
2996
|
+
this.debugLog("Fetching single event by slug", { organizationId: t, slug: n });
|
|
2997
|
+
const r = await this.sdk.FindPublicEventBySlug({ organizationId: t, slug: n });
|
|
2998
|
+
if (this.debugLog("Raw GraphQL response", r), r?.findPublicEventBySlug) {
|
|
2999
|
+
const i = r.findPublicEventBySlug, s = {
|
|
3000
|
+
id: i.id,
|
|
3001
|
+
name: i.name,
|
|
3002
|
+
icon: i.icon,
|
|
3003
|
+
banner: i.banner,
|
|
3004
|
+
description: i.description,
|
|
3005
|
+
addonDescription: i.addonDescription,
|
|
3006
|
+
startAt: O.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
|
|
3007
|
+
endAt: O.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
|
|
3008
|
+
timezone: i.timezone,
|
|
3009
|
+
startSalesAt: i.startSalesAt,
|
|
3010
|
+
endSalesAt: i.endSalesAt,
|
|
3011
|
+
slug: i.slug ?? "ERROR",
|
|
3012
|
+
facebookPixelId: i.facebookPixelId,
|
|
3013
|
+
status: i.status,
|
|
3014
|
+
location: i.location ? {
|
|
3015
|
+
id: i.location.id,
|
|
3016
|
+
name: i.location.name,
|
|
3017
|
+
address: i.location.address
|
|
3018
|
+
} : void 0,
|
|
3019
|
+
hosting: i.hosting ? {
|
|
3020
|
+
id: i.hosting.id,
|
|
3021
|
+
name: i.hosting.name
|
|
3022
|
+
} : void 0,
|
|
3023
|
+
infoDescription: i.infoDescription,
|
|
3024
|
+
startingPrice: i.startingPrice,
|
|
3025
|
+
totalViews: i.totalViews,
|
|
3026
|
+
seatsIoEventId: i.seatsIoEventId,
|
|
3027
|
+
maxAmountOfTicketsPerOrder: i.maxAmountOfTicketsPerOrder
|
|
2997
3028
|
};
|
|
2998
3029
|
return this.debugLog("Processed single event", s), s;
|
|
2999
3030
|
} else {
|
|
3000
3031
|
this.debugLog("No event found for id by slug", { organizationId: t, slug: n });
|
|
3001
3032
|
return;
|
|
3002
3033
|
}
|
|
3003
|
-
} catch (
|
|
3004
|
-
throw this.debugLog("Error fetching single event",
|
|
3034
|
+
} catch (r) {
|
|
3035
|
+
throw this.debugLog("Error fetching single event", r), r;
|
|
3005
3036
|
}
|
|
3006
3037
|
}
|
|
3007
|
-
async getProducts(t, n,
|
|
3038
|
+
async getProducts(t, n, r) {
|
|
3008
3039
|
try {
|
|
3009
3040
|
this.debugLog("Fetching products for event", {
|
|
3010
3041
|
eventId: t,
|
|
3011
|
-
promoCode:
|
|
3042
|
+
promoCode: r,
|
|
3012
3043
|
trackerId: this.config.trackerId,
|
|
3013
3044
|
productTypes: n
|
|
3014
3045
|
});
|
|
3015
|
-
const
|
|
3046
|
+
const i = await this.sdk.findProductsByEventId({
|
|
3016
3047
|
eventId: t,
|
|
3017
|
-
promoCode:
|
|
3048
|
+
promoCode: r,
|
|
3018
3049
|
trackerId: this.config.trackerId,
|
|
3019
3050
|
productTypes: n
|
|
3020
3051
|
});
|
|
3021
|
-
if (
|
|
3022
|
-
const s =
|
|
3023
|
-
id:
|
|
3024
|
-
name:
|
|
3025
|
-
category:
|
|
3026
|
-
id:
|
|
3027
|
-
name:
|
|
3028
|
-
description:
|
|
3029
|
-
order:
|
|
3052
|
+
if (i?.findPublicProductsByEventId) {
|
|
3053
|
+
const s = i.findPublicProductsByEventId.map((a) => ({
|
|
3054
|
+
id: a.id,
|
|
3055
|
+
name: a.name,
|
|
3056
|
+
category: a.category ? {
|
|
3057
|
+
id: a.category.id,
|
|
3058
|
+
name: a.category.name,
|
|
3059
|
+
description: a.category.description,
|
|
3060
|
+
order: a.category.order
|
|
3030
3061
|
} : void 0,
|
|
3031
|
-
currency:
|
|
3032
|
-
depositPrice:
|
|
3033
|
-
description:
|
|
3034
|
-
discountPrice:
|
|
3035
|
-
startSalesAt:
|
|
3036
|
-
endSalesAt:
|
|
3037
|
-
icon:
|
|
3038
|
-
maxAmountOfAddons:
|
|
3039
|
-
minAmountOfAddons:
|
|
3040
|
-
maxAmountPerOrder:
|
|
3041
|
-
price:
|
|
3042
|
-
serviceFee:
|
|
3043
|
-
showEndSalesAtTag:
|
|
3044
|
-
status:
|
|
3045
|
-
type:
|
|
3046
|
-
seatsCategory:
|
|
3062
|
+
currency: a.currency,
|
|
3063
|
+
depositPrice: a.depositPrice,
|
|
3064
|
+
description: a.description,
|
|
3065
|
+
discountPrice: a.promoterDiscountPrice ?? a.discountPrice,
|
|
3066
|
+
startSalesAt: a.startSalesAt,
|
|
3067
|
+
endSalesAt: a.endSalesAt,
|
|
3068
|
+
icon: a.icon,
|
|
3069
|
+
maxAmountOfAddons: a.maxAmountOfAddons,
|
|
3070
|
+
minAmountOfAddons: a.minAmountOfAddons,
|
|
3071
|
+
maxAmountPerOrder: a.maxAmountPerOrder,
|
|
3072
|
+
price: a.price,
|
|
3073
|
+
serviceFee: a.serviceFee,
|
|
3074
|
+
showEndSalesAtTag: a.showEndSalesAtTag,
|
|
3075
|
+
status: a.status,
|
|
3076
|
+
type: a.type,
|
|
3077
|
+
seatsCategory: a.seatsCategory
|
|
3047
3078
|
}));
|
|
3048
3079
|
return this.debugLog("Products fetched", {
|
|
3049
3080
|
eventId: t,
|
|
3050
3081
|
count: s.length,
|
|
3051
|
-
types: s.map((
|
|
3082
|
+
types: s.map((a) => a.type)
|
|
3052
3083
|
}), s;
|
|
3053
3084
|
}
|
|
3054
3085
|
return;
|
|
3055
|
-
} catch (
|
|
3056
|
-
throw this.debugLog("Error fetching products", { eventId: t, error:
|
|
3086
|
+
} catch (i) {
|
|
3087
|
+
throw this.debugLog("Error fetching products", { eventId: t, error: i }), i;
|
|
3057
3088
|
}
|
|
3058
3089
|
}
|
|
3059
3090
|
debugLog(t, n) {
|
|
3060
3091
|
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
|
|
3061
3092
|
}
|
|
3062
3093
|
}
|
|
3063
|
-
const
|
|
3094
|
+
const Rt = u`
|
|
3064
3095
|
query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
|
|
3065
3096
|
findPaymentDetails(
|
|
3066
3097
|
orderId: $orderId
|
|
@@ -3090,26 +3121,26 @@ const Lt = u`
|
|
|
3090
3121
|
protectionFee
|
|
3091
3122
|
}
|
|
3092
3123
|
}
|
|
3093
|
-
`,
|
|
3124
|
+
`, Ft = u`
|
|
3094
3125
|
mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
|
|
3095
3126
|
createDigitalOrderPayment(input: $input)
|
|
3096
3127
|
}
|
|
3097
|
-
`,
|
|
3098
|
-
function
|
|
3128
|
+
`, wt = (e, t, n, r) => e();
|
|
3129
|
+
function $t(e, t = wt) {
|
|
3099
3130
|
return {
|
|
3100
|
-
findPaymentMethods(n,
|
|
3101
|
-
return t((s) => e.request({ document:
|
|
3131
|
+
findPaymentMethods(n, r, i) {
|
|
3132
|
+
return t((s) => e.request({ document: Rt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPaymentMethods", "query", n);
|
|
3102
3133
|
},
|
|
3103
|
-
createDigitalPayment(n,
|
|
3104
|
-
return t((s) => e.request({ document:
|
|
3134
|
+
createDigitalPayment(n, r, i) {
|
|
3135
|
+
return t((s) => e.request({ document: Ft, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createDigitalPayment", "mutation", n);
|
|
3105
3136
|
}
|
|
3106
3137
|
};
|
|
3107
3138
|
}
|
|
3108
|
-
class
|
|
3139
|
+
class Bt {
|
|
3109
3140
|
config;
|
|
3110
3141
|
sdk;
|
|
3111
3142
|
constructor(t) {
|
|
3112
|
-
this.config = t, this.sdk =
|
|
3143
|
+
this.config = t, this.sdk = $t(new T(t.apiUrl));
|
|
3113
3144
|
}
|
|
3114
3145
|
async getPaymentDetails(t) {
|
|
3115
3146
|
this.debugLog("Fetching payment methods", t);
|
|
@@ -3123,29 +3154,29 @@ class $t {
|
|
|
3123
3154
|
});
|
|
3124
3155
|
if (!n?.findPaymentDetails)
|
|
3125
3156
|
throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
|
|
3126
|
-
const
|
|
3157
|
+
const r = n.findPaymentDetails;
|
|
3127
3158
|
return this.debugLog("Payment methods fetched successfully", {
|
|
3128
|
-
methodCount:
|
|
3129
|
-
transactionPrice:
|
|
3130
|
-
transactionDiscount:
|
|
3131
|
-
transactionFee:
|
|
3132
|
-
paymentSpesificTransactionFee:
|
|
3133
|
-
protectionFee:
|
|
3159
|
+
methodCount: r.methods?.length ?? 0,
|
|
3160
|
+
transactionPrice: r.transactionPrice,
|
|
3161
|
+
transactionDiscount: r.transactionDiscount,
|
|
3162
|
+
transactionFee: r.transactionFee,
|
|
3163
|
+
paymentSpesificTransactionFee: r.paymentSpesificTransactionFee,
|
|
3164
|
+
protectionFee: r.protectionFee
|
|
3134
3165
|
}), {
|
|
3135
|
-
transactionPrice:
|
|
3136
|
-
transactionDiscount:
|
|
3137
|
-
transactionFee:
|
|
3138
|
-
protectionFee:
|
|
3139
|
-
paymentSpesificTransactionFee:
|
|
3140
|
-
methods:
|
|
3141
|
-
id:
|
|
3142
|
-
name:
|
|
3143
|
-
image:
|
|
3144
|
-
fee:
|
|
3145
|
-
type:
|
|
3146
|
-
value:
|
|
3166
|
+
transactionPrice: r.transactionPrice,
|
|
3167
|
+
transactionDiscount: r.transactionPrice,
|
|
3168
|
+
transactionFee: r.transactionFee,
|
|
3169
|
+
protectionFee: r.protectionFee,
|
|
3170
|
+
paymentSpesificTransactionFee: r.paymentSpesificTransactionFee,
|
|
3171
|
+
methods: r.methods?.map((i) => ({
|
|
3172
|
+
id: i.id,
|
|
3173
|
+
name: i.name,
|
|
3174
|
+
image: i.image,
|
|
3175
|
+
fee: i.fee ? {
|
|
3176
|
+
type: i.fee.type,
|
|
3177
|
+
value: i.fee.value
|
|
3147
3178
|
} : null,
|
|
3148
|
-
issuers:
|
|
3179
|
+
issuers: i.issuers?.map((s) => ({
|
|
3149
3180
|
id: s.id,
|
|
3150
3181
|
name: s.name,
|
|
3151
3182
|
image: s.image
|
|
@@ -3172,13 +3203,13 @@ class $t {
|
|
|
3172
3203
|
withTicketProtection: t.withTicketProtection
|
|
3173
3204
|
};
|
|
3174
3205
|
t.customer && (n.customer = t.customer), t.products && (n.products = t.products), t.description && (n.description = t.description), t.reference && (n.reference = t.reference), t.ipAddress && (n.ipAddress = t.ipAddress);
|
|
3175
|
-
const
|
|
3206
|
+
const r = await this.sdk.createDigitalPayment({
|
|
3176
3207
|
input: n
|
|
3177
3208
|
});
|
|
3178
|
-
if (!
|
|
3209
|
+
if (!r?.createDigitalOrderPayment)
|
|
3179
3210
|
throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
|
|
3180
|
-
const
|
|
3181
|
-
return this.debugLog("Payment created successfully", { paymentUrl:
|
|
3211
|
+
const i = r.createDigitalOrderPayment;
|
|
3212
|
+
return this.debugLog("Payment created successfully", { paymentUrl: i }), { paymentUrl: i };
|
|
3182
3213
|
} catch (n) {
|
|
3183
3214
|
throw this.debugLog("Error creating payment", n), n;
|
|
3184
3215
|
}
|
|
@@ -3187,7 +3218,7 @@ class $t {
|
|
|
3187
3218
|
this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
|
|
3188
3219
|
}
|
|
3189
3220
|
}
|
|
3190
|
-
const
|
|
3221
|
+
const Ut = u`
|
|
3191
3222
|
query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
|
|
3192
3223
|
findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
|
|
3193
3224
|
data {
|
|
@@ -3212,7 +3243,7 @@ const Bt = u`
|
|
|
3212
3243
|
count
|
|
3213
3244
|
}
|
|
3214
3245
|
}
|
|
3215
|
-
`,
|
|
3246
|
+
`, Vt = u`
|
|
3216
3247
|
query findPublicPackageById($packageId: ID!) {
|
|
3217
3248
|
findPublicPackageById(id: $packageId) {
|
|
3218
3249
|
id
|
|
@@ -3238,7 +3269,7 @@ const Bt = u`
|
|
|
3238
3269
|
}
|
|
3239
3270
|
}
|
|
3240
3271
|
}
|
|
3241
|
-
`,
|
|
3272
|
+
`, Mt = u`
|
|
3242
3273
|
query findPublicPackageBySlug($organizationId: ID!, $slug: String!) {
|
|
3243
3274
|
findPublicPackageBySlug(organizationId: $organizationId, slug: $slug) {
|
|
3244
3275
|
id
|
|
@@ -3264,7 +3295,7 @@ const Bt = u`
|
|
|
3264
3295
|
}
|
|
3265
3296
|
}
|
|
3266
3297
|
}
|
|
3267
|
-
`,
|
|
3298
|
+
`, qt = u`
|
|
3268
3299
|
query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
|
|
3269
3300
|
findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
|
|
3270
3301
|
data {
|
|
@@ -3299,57 +3330,57 @@ const Bt = u`
|
|
|
3299
3330
|
count
|
|
3300
3331
|
}
|
|
3301
3332
|
}
|
|
3302
|
-
`, zt = (e, t, n,
|
|
3303
|
-
function
|
|
3333
|
+
`, zt = (e, t, n, r) => e();
|
|
3334
|
+
function Gt(e, t = zt) {
|
|
3304
3335
|
return {
|
|
3305
|
-
findAllPublicPackagesByOrganizationId(n,
|
|
3306
|
-
return t((s) => e.request({ document:
|
|
3336
|
+
findAllPublicPackagesByOrganizationId(n, r, i) {
|
|
3337
|
+
return t((s) => e.request({ document: Ut, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicPackagesByOrganizationId", "query", n);
|
|
3307
3338
|
},
|
|
3308
|
-
findPublicPackageById(n,
|
|
3309
|
-
return t((s) => e.request({ document:
|
|
3339
|
+
findPublicPackageById(n, r, i) {
|
|
3340
|
+
return t((s) => e.request({ document: Vt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageById", "query", n);
|
|
3310
3341
|
},
|
|
3311
|
-
findPublicPackageBySlug(n,
|
|
3312
|
-
return t((s) => e.request({ document:
|
|
3342
|
+
findPublicPackageBySlug(n, r, i) {
|
|
3343
|
+
return t((s) => e.request({ document: Mt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageBySlug", "query", n);
|
|
3313
3344
|
},
|
|
3314
|
-
findPublicItemsByPackageId(n,
|
|
3315
|
-
return t((s) => e.request({ document:
|
|
3345
|
+
findPublicItemsByPackageId(n, r, i) {
|
|
3346
|
+
return t((s) => e.request({ document: qt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicItemsByPackageId", "query", n);
|
|
3316
3347
|
}
|
|
3317
3348
|
};
|
|
3318
3349
|
}
|
|
3319
|
-
class
|
|
3350
|
+
class jt {
|
|
3320
3351
|
config;
|
|
3321
3352
|
sdk;
|
|
3322
3353
|
constructor(t) {
|
|
3323
|
-
this.config = t, this.sdk =
|
|
3354
|
+
this.config = t, this.sdk = Gt(new T(t.apiUrl));
|
|
3324
3355
|
}
|
|
3325
3356
|
debugLog(t, n) {
|
|
3326
3357
|
this.config.debug && console.log(`[PackageService] ${t}`, n || "");
|
|
3327
3358
|
}
|
|
3328
3359
|
async getPackages(t, n) {
|
|
3329
3360
|
try {
|
|
3330
|
-
let
|
|
3331
|
-
t.page && (
|
|
3361
|
+
let r;
|
|
3362
|
+
t.page && (r = {
|
|
3332
3363
|
index: t.page.index ?? 0,
|
|
3333
3364
|
size: t.page.size ?? 20
|
|
3334
3365
|
}), this.debugLog("Fetching public packages", {
|
|
3335
3366
|
organizationId: this.config.organizationId ?? n ?? "",
|
|
3336
|
-
page:
|
|
3367
|
+
page: r,
|
|
3337
3368
|
tab: t.tab,
|
|
3338
3369
|
statuses: t.statuses
|
|
3339
3370
|
});
|
|
3340
|
-
const
|
|
3371
|
+
const i = await this.sdk.findAllPublicPackagesByOrganizationId({
|
|
3341
3372
|
organizationId: this.config.organizationId ?? n ?? ""
|
|
3342
3373
|
});
|
|
3343
|
-
if (
|
|
3344
|
-
const s =
|
|
3374
|
+
if (i?.findAllPublicPackagesByOrganizationId) {
|
|
3375
|
+
const s = i.findAllPublicPackagesByOrganizationId;
|
|
3345
3376
|
return this.debugLog("Public packages fetched", {
|
|
3346
3377
|
count: s.count,
|
|
3347
3378
|
dataLength: s.data.length
|
|
3348
3379
|
}), s.data;
|
|
3349
3380
|
}
|
|
3350
3381
|
return null;
|
|
3351
|
-
} catch (
|
|
3352
|
-
throw this.debugLog("Error fetching public packages",
|
|
3382
|
+
} catch (r) {
|
|
3383
|
+
throw this.debugLog("Error fetching public packages", r), r;
|
|
3353
3384
|
}
|
|
3354
3385
|
}
|
|
3355
3386
|
async getPackage(t) {
|
|
@@ -3359,8 +3390,8 @@ class Gt {
|
|
|
3359
3390
|
});
|
|
3360
3391
|
const n = await this.sdk.findPublicPackageById({ packageId: t });
|
|
3361
3392
|
if (n?.findPublicPackageById) {
|
|
3362
|
-
const
|
|
3363
|
-
return this.debugLog("Public package fetched"),
|
|
3393
|
+
const r = n.findPublicPackageById;
|
|
3394
|
+
return this.debugLog("Public package fetched"), r;
|
|
3364
3395
|
}
|
|
3365
3396
|
return null;
|
|
3366
3397
|
} catch (n) {
|
|
@@ -3373,38 +3404,38 @@ class Gt {
|
|
|
3373
3404
|
organizationId: t,
|
|
3374
3405
|
slug: n
|
|
3375
3406
|
});
|
|
3376
|
-
const
|
|
3377
|
-
if (
|
|
3378
|
-
const
|
|
3379
|
-
return this.debugLog("Public package fetched"),
|
|
3407
|
+
const r = await this.sdk.findPublicPackageBySlug({ organizationId: t, slug: n });
|
|
3408
|
+
if (r?.findPublicPackageBySlug) {
|
|
3409
|
+
const i = r.findPublicPackageBySlug;
|
|
3410
|
+
return this.debugLog("Public package fetched"), i;
|
|
3380
3411
|
}
|
|
3381
3412
|
return null;
|
|
3382
|
-
} catch (
|
|
3383
|
-
throw this.debugLog("Error fetching public packages",
|
|
3413
|
+
} catch (r) {
|
|
3414
|
+
throw this.debugLog("Error fetching public packages", r), r;
|
|
3384
3415
|
}
|
|
3385
3416
|
}
|
|
3386
3417
|
async getPackageItems(t, n = [R.Regular, R.AdditionalEvent]) {
|
|
3387
3418
|
try {
|
|
3388
3419
|
this.debugLog("Fetching public package items", { packageId: t, types: n });
|
|
3389
|
-
const
|
|
3420
|
+
const r = await this.sdk.findPublicItemsByPackageId({
|
|
3390
3421
|
packageId: t,
|
|
3391
3422
|
types: n,
|
|
3392
3423
|
page: { index: 0, size: 100 }
|
|
3393
3424
|
});
|
|
3394
|
-
if (
|
|
3395
|
-
const
|
|
3425
|
+
if (r?.findPublicItemsByPackageId) {
|
|
3426
|
+
const i = r.findPublicItemsByPackageId;
|
|
3396
3427
|
return this.debugLog("Public package items fetched", {
|
|
3397
|
-
count:
|
|
3398
|
-
dataLength:
|
|
3399
|
-
}),
|
|
3428
|
+
count: i.count,
|
|
3429
|
+
dataLength: i.data.length
|
|
3430
|
+
}), i.data;
|
|
3400
3431
|
}
|
|
3401
3432
|
return null;
|
|
3402
|
-
} catch (
|
|
3403
|
-
throw this.debugLog("Error fetching public package items",
|
|
3433
|
+
} catch (r) {
|
|
3434
|
+
throw this.debugLog("Error fetching public package items", r), r;
|
|
3404
3435
|
}
|
|
3405
3436
|
}
|
|
3406
3437
|
}
|
|
3407
|
-
const
|
|
3438
|
+
const Ht = u`
|
|
3408
3439
|
query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
|
|
3409
3440
|
findAllPublicLocationsByOrganizationId(id: $organizationId) {
|
|
3410
3441
|
data {
|
|
@@ -3424,19 +3455,19 @@ const jt = u`
|
|
|
3424
3455
|
count
|
|
3425
3456
|
}
|
|
3426
3457
|
}
|
|
3427
|
-
`, Yt = (e, t, n,
|
|
3428
|
-
function
|
|
3458
|
+
`, Yt = (e, t, n, r) => e();
|
|
3459
|
+
function Jt(e, t = Yt) {
|
|
3429
3460
|
return {
|
|
3430
|
-
findAllPublicCategoriesByOrganizationId(n,
|
|
3431
|
-
return t((s) => e.request({ document:
|
|
3461
|
+
findAllPublicCategoriesByOrganizationId(n, r, i) {
|
|
3462
|
+
return t((s) => e.request({ document: Ht, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicCategoriesByOrganizationId", "query", n);
|
|
3432
3463
|
}
|
|
3433
3464
|
};
|
|
3434
3465
|
}
|
|
3435
|
-
class
|
|
3466
|
+
class Qt {
|
|
3436
3467
|
config;
|
|
3437
3468
|
sdk;
|
|
3438
3469
|
constructor(t) {
|
|
3439
|
-
this.config = t, this.sdk =
|
|
3470
|
+
this.config = t, this.sdk = Jt(new T(t.apiUrl));
|
|
3440
3471
|
}
|
|
3441
3472
|
debugLog(t, n) {
|
|
3442
3473
|
this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
|
|
@@ -3444,57 +3475,57 @@ class Jt {
|
|
|
3444
3475
|
async getCategories(t, n) {
|
|
3445
3476
|
try {
|
|
3446
3477
|
this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
|
|
3447
|
-
const
|
|
3448
|
-
if (
|
|
3449
|
-
const
|
|
3450
|
-
return this.debugLog("Categories fetched", { count:
|
|
3451
|
-
...
|
|
3452
|
-
...s.data.map((
|
|
3478
|
+
const r = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId ?? n ?? "", dateRange: t ?? null });
|
|
3479
|
+
if (r?.findAllPublicHostingsByOrganizationId) {
|
|
3480
|
+
const i = r.findAllPublicHostingsByOrganizationId, s = r.findAllPublicLocationsByOrganizationId;
|
|
3481
|
+
return this.debugLog("Categories fetched", { count: i.count + s.count, dataLength: i.data.length + s.data.length }), [
|
|
3482
|
+
...i.data.map((a) => ({ id: a.id, name: a.name, icon: a.icon, activeEvents: a.amountOfActiveEvents, type: "HOSTING" })),
|
|
3483
|
+
...s.data.map((a) => ({ id: a.id, name: a.name, activeEvents: a.amountOfActiveEvents, type: "LOCATION" }))
|
|
3453
3484
|
];
|
|
3454
3485
|
}
|
|
3455
3486
|
return [];
|
|
3456
|
-
} catch (
|
|
3457
|
-
throw this.debugLog("Error fetching categories",
|
|
3487
|
+
} catch (r) {
|
|
3488
|
+
throw this.debugLog("Error fetching categories", r), r;
|
|
3458
3489
|
}
|
|
3459
3490
|
}
|
|
3460
3491
|
}
|
|
3461
|
-
const
|
|
3492
|
+
const Xt = u`
|
|
3462
3493
|
mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
|
|
3463
3494
|
createShopView(id: $id, trackerId: $trackerLinkId)
|
|
3464
3495
|
}
|
|
3465
|
-
`,
|
|
3496
|
+
`, Wt = u`
|
|
3466
3497
|
mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
3467
3498
|
createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
3468
3499
|
}
|
|
3469
|
-
`,
|
|
3500
|
+
`, Zt = u`
|
|
3470
3501
|
mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
3471
3502
|
createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
3472
3503
|
}
|
|
3473
|
-
`,
|
|
3474
|
-
function
|
|
3504
|
+
`, Kt = (e, t, n, r) => e();
|
|
3505
|
+
function en(e, t = Kt) {
|
|
3475
3506
|
return {
|
|
3476
|
-
CreateShopView(n,
|
|
3477
|
-
return t((s) => e.request({ document:
|
|
3507
|
+
CreateShopView(n, r, i) {
|
|
3508
|
+
return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateShopView", "mutation", n);
|
|
3478
3509
|
},
|
|
3479
|
-
CreateEventView(n,
|
|
3480
|
-
return t((s) => e.request({ document:
|
|
3510
|
+
CreateEventView(n, r, i) {
|
|
3511
|
+
return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateEventView", "mutation", n);
|
|
3481
3512
|
},
|
|
3482
|
-
CreatePackageView(n,
|
|
3483
|
-
return t((s) => e.request({ document:
|
|
3513
|
+
CreatePackageView(n, r, i) {
|
|
3514
|
+
return t((s) => e.request({ document: Zt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreatePackageView", "mutation", n);
|
|
3484
3515
|
}
|
|
3485
3516
|
};
|
|
3486
3517
|
}
|
|
3487
|
-
class
|
|
3518
|
+
class tn {
|
|
3488
3519
|
config;
|
|
3489
3520
|
sdk;
|
|
3490
3521
|
constructor(t) {
|
|
3491
|
-
this.config = t, this.sdk =
|
|
3522
|
+
this.config = t, this.sdk = en(new T(t.apiUrl));
|
|
3492
3523
|
}
|
|
3493
|
-
createMetric = async (t, n,
|
|
3494
|
-
switch (!n && !
|
|
3524
|
+
createMetric = async (t, n, r) => {
|
|
3525
|
+
switch (!n && !r && await this.sdk.CreateShopView({
|
|
3495
3526
|
id: t,
|
|
3496
3527
|
trackerLinkId: this.config.trackerId
|
|
3497
|
-
}),
|
|
3528
|
+
}), r) {
|
|
3498
3529
|
case F.Event:
|
|
3499
3530
|
await this.sdk.CreateEventView({
|
|
3500
3531
|
id: t,
|
|
@@ -3514,7 +3545,7 @@ class en {
|
|
|
3514
3545
|
}
|
|
3515
3546
|
};
|
|
3516
3547
|
}
|
|
3517
|
-
const
|
|
3548
|
+
const nn = u`
|
|
3518
3549
|
query getShopBySlug($slug: String!, $trackerLinkId: String) {
|
|
3519
3550
|
findShopBySlug(slug: $slug, promoterId: $trackerLinkId) {
|
|
3520
3551
|
id
|
|
@@ -3558,27 +3589,27 @@ const tn = u`
|
|
|
3558
3589
|
blockedLanguages
|
|
3559
3590
|
}
|
|
3560
3591
|
}
|
|
3561
|
-
`,
|
|
3562
|
-
function
|
|
3592
|
+
`, rn = (e, t, n, r) => e();
|
|
3593
|
+
function sn(e, t = rn) {
|
|
3563
3594
|
return {
|
|
3564
|
-
getShopBySlug(n,
|
|
3565
|
-
return t((s) => e.request({ document:
|
|
3595
|
+
getShopBySlug(n, r, i) {
|
|
3596
|
+
return t((s) => e.request({ document: nn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "getShopBySlug", "query", n);
|
|
3566
3597
|
}
|
|
3567
3598
|
};
|
|
3568
3599
|
}
|
|
3569
|
-
class
|
|
3600
|
+
class on {
|
|
3570
3601
|
config;
|
|
3571
3602
|
sdk;
|
|
3572
3603
|
constructor(t) {
|
|
3573
|
-
this.config = t, this.sdk =
|
|
3604
|
+
this.config = t, this.sdk = sn(new T(t.apiUrl));
|
|
3574
3605
|
}
|
|
3575
3606
|
async getShop(t) {
|
|
3576
3607
|
try {
|
|
3577
3608
|
this.debugLog("Fetching shop", { slug: t });
|
|
3578
3609
|
const n = await this.sdk.getShopBySlug({ slug: t, trackerLinkId: this.config.trackerId });
|
|
3579
3610
|
if (this.debugLog("Raw GraphQL response", n), n?.findShopBySlug) {
|
|
3580
|
-
const
|
|
3581
|
-
return this.debugLog("Public Shop fetched"),
|
|
3611
|
+
const r = n.findShopBySlug;
|
|
3612
|
+
return this.debugLog("Public Shop fetched"), r;
|
|
3582
3613
|
}
|
|
3583
3614
|
return null;
|
|
3584
3615
|
} catch (n) {
|
|
@@ -3608,38 +3639,38 @@ const an = u`
|
|
|
3608
3639
|
confirm
|
|
3609
3640
|
}
|
|
3610
3641
|
}
|
|
3611
|
-
`,
|
|
3612
|
-
function
|
|
3642
|
+
`, cn = (e, t, n, r) => e();
|
|
3643
|
+
function dn(e, t = cn) {
|
|
3613
3644
|
return {
|
|
3614
|
-
findAllCustomFieldsByOrderId(n,
|
|
3615
|
-
return t((s) => e.request({ document: an, variables: n, requestHeaders: { ...
|
|
3645
|
+
findAllCustomFieldsByOrderId(n, r, i) {
|
|
3646
|
+
return t((s) => e.request({ document: an, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllCustomFieldsByOrderId", "query", n);
|
|
3616
3647
|
}
|
|
3617
3648
|
};
|
|
3618
3649
|
}
|
|
3619
|
-
class
|
|
3650
|
+
class un {
|
|
3620
3651
|
config;
|
|
3621
3652
|
sdk;
|
|
3622
3653
|
constructor(t) {
|
|
3623
|
-
this.config = t, this.sdk =
|
|
3654
|
+
this.config = t, this.sdk = dn(new T(t.apiUrl));
|
|
3624
3655
|
}
|
|
3625
3656
|
async findByOrderId(t, n) {
|
|
3626
3657
|
try {
|
|
3627
3658
|
this.debugLog("Fetching custom fields for order", { orderId: t, salesLocations: n });
|
|
3628
|
-
const
|
|
3659
|
+
const r = await this.sdk.findAllCustomFieldsByOrderId({
|
|
3629
3660
|
orderId: t,
|
|
3630
3661
|
salesLocations: n || null
|
|
3631
3662
|
});
|
|
3632
|
-
return this.debugLog("Custom fields fetched successfully",
|
|
3633
|
-
} catch (
|
|
3634
|
-
throw this.debugLog("Error fetching custom fields for order",
|
|
3663
|
+
return this.debugLog("Custom fields fetched successfully", r.findAllCustomFieldsByOrderId), r.findAllCustomFieldsByOrderId;
|
|
3664
|
+
} catch (r) {
|
|
3665
|
+
throw this.debugLog("Error fetching custom fields for order", r), r;
|
|
3635
3666
|
}
|
|
3636
3667
|
}
|
|
3637
3668
|
debugLog(t, n) {
|
|
3638
3669
|
this.config.debug && console.log(`[CustomFieldService] ${t}`, n || "");
|
|
3639
3670
|
}
|
|
3640
3671
|
}
|
|
3641
|
-
const
|
|
3642
|
-
class
|
|
3672
|
+
const ln = "https://api.ticketapp.com/graphql";
|
|
3673
|
+
class gn {
|
|
3643
3674
|
basket;
|
|
3644
3675
|
event;
|
|
3645
3676
|
payment;
|
|
@@ -3651,27 +3682,27 @@ class pn {
|
|
|
3651
3682
|
// Attach selected public types to the SDK class
|
|
3652
3683
|
static Types = ve;
|
|
3653
3684
|
constructor(t) {
|
|
3654
|
-
const { organizationId: n, debug:
|
|
3655
|
-
this.event = new
|
|
3685
|
+
const { organizationId: n, debug: r = !1, apiUrl: i = ln } = t;
|
|
3686
|
+
this.event = new Lt({ organizationId: n, debug: r, apiUrl: i, trackerId: t.trackerId }), this.package = new jt({ organizationId: n, debug: r, apiUrl: i }), this.category = new Qt({ organizationId: n, debug: r, apiUrl: i }), this.metric = new tn({ apiUrl: i, trackerId: t.trackerId }), this.shop = new on({ debug: r, apiUrl: i, trackerId: t.trackerId }), this.customField = new un({ debug: r, apiUrl: i }), this.basket = new vt({ debug: r, apiUrl: i, trackerId: t.trackerId }), this.payment = new Bt({ debug: r, apiUrl: i });
|
|
3656
3687
|
}
|
|
3657
3688
|
}
|
|
3658
3689
|
export {
|
|
3659
|
-
|
|
3690
|
+
D as BasketOrderType,
|
|
3660
3691
|
ue as CustomFieldMandatoryType,
|
|
3661
3692
|
de as CustomFieldType,
|
|
3662
|
-
|
|
3693
|
+
oe as DiscountType,
|
|
3663
3694
|
ee as EventStatus,
|
|
3664
3695
|
F as MetricsType,
|
|
3665
3696
|
se as OrderItemType,
|
|
3666
3697
|
R as PackageItemType,
|
|
3667
3698
|
Z as PackageStatus,
|
|
3668
3699
|
K as PackageTabType,
|
|
3669
|
-
|
|
3700
|
+
ie as PaymentMethodFeeType,
|
|
3670
3701
|
ne as ProductStatus,
|
|
3671
|
-
|
|
3702
|
+
re as ProductType,
|
|
3672
3703
|
le as SalesLocations,
|
|
3673
|
-
|
|
3704
|
+
ae as ShopTemplateType,
|
|
3674
3705
|
ce as ShopVariationType,
|
|
3675
3706
|
te as SortOrder,
|
|
3676
|
-
|
|
3707
|
+
gn as TicketappSDK
|
|
3677
3708
|
};
|