@ticketapp-dev/shop-sdk 1.0.44 → 1.0.46
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 +1115 -949
- package/dist/sdk.d.ts +4 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/services/basket/basket.service.d.ts +2 -3
- package/dist/services/basket/basket.service.d.ts.map +1 -1
- package/dist/services/category/category.service.d.ts +2 -2
- package/dist/services/category/category.service.d.ts.map +1 -1
- package/dist/services/event/event.service.d.ts +3 -2
- package/dist/services/event/event.service.d.ts.map +1 -1
- package/dist/services/event/event.service.generated.d.ts +42 -0
- package/dist/services/event/event.service.generated.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/package/package.service.d.ts +3 -2
- package/dist/services/package/package.service.d.ts.map +1 -1
- package/dist/services/package/package.service.generated.d.ts +34 -0
- package/dist/services/package/package.service.generated.d.ts.map +1 -1
- package/dist/services/shop/shop.service.d.ts +14 -0
- package/dist/services/shop/shop.service.d.ts.map +1 -0
- package/dist/services/shop/shop.service.generated.d.ts +63 -0
- package/dist/services/shop/shop.service.generated.d.ts.map +1 -0
- package/dist/types/index.d.ts +52 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,99 +1,101 @@
|
|
|
1
|
-
import { GraphQLClient as
|
|
2
|
-
import { DateTime as
|
|
3
|
-
var T = /* @__PURE__ */ ((t) => (t.PACKAGE = "PACKAGE", t.PRODUCT = "PRODUCT", t.ADD_ONS = "ADD_ONS", t.DELIVERY = "DELIVERY", t.PICKUP = "PICKUP", t))(T || {}), R = /* @__PURE__ */ ((t) => (t.AdditionalEvent = "ADDITIONAL_EVENT", t.Addon = "ADDON", t.Regular = "REGULAR", t))(R || {}),
|
|
1
|
+
import { GraphQLClient as N } from "graphql-request";
|
|
2
|
+
import { DateTime as k } from "luxon";
|
|
3
|
+
var T = /* @__PURE__ */ ((t) => (t.PACKAGE = "PACKAGE", t.PRODUCT = "PRODUCT", t.ADD_ONS = "ADD_ONS", t.DELIVERY = "DELIVERY", t.PICKUP = "PICKUP", t))(T || {}), R = /* @__PURE__ */ ((t) => (t.AdditionalEvent = "ADDITIONAL_EVENT", t.Addon = "ADDON", t.Regular = "REGULAR", t))(R || {}), Z = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Concept = "CONCEPT", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(Z || {}), K = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t))(K || {}), ee = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(ee || {}), te = /* @__PURE__ */ ((t) => (t.Asc = "ASC", t.Desc = "DESC", t))(te || {}), ne = /* @__PURE__ */ ((t) => (t.AllReserved = "ALL_RESERVED", t.Available = "AVAILABLE", t.SoldOut = "SOLD_OUT", t))(ne || {}), ie = /* @__PURE__ */ ((t) => (t.Addon = "ADDON", t.Delivery = "DELIVERY", t.Door = "DOOR", t.Friend = "FRIEND", t.Guest = "GUEST", t.Pickup = "PICKUP", t.Promoter = "PROMOTER", t.Ticket = "TICKET", t))(ie || {}), re = /* @__PURE__ */ ((t) => (t.FIXED = "FIXED", t.PERCENTAGE = "PERCENTAGE", t))(re || {}), se = /* @__PURE__ */ ((t) => (t.AddOn = "ADD_ON", t.DeliveryOption = "DELIVERY_OPTION", t.EntranceTicket = "ENTRANCE_TICKET", t))(se || {}), ae = /* @__PURE__ */ ((t) => (t.Fixed = "FIXED", t.Percentage = "PERCENTAGE", t))(ae || {}), oe = /* @__PURE__ */ ((t) => (t.Default = "DEFAULT", t.Transparent = "TRANSPARENT", t))(oe || {}), ce = /* @__PURE__ */ ((t) => (t.Calendar = "CALENDAR", t.Large = "LARGE", t.Small = "SMALL", t))(ce || {}), F = /* @__PURE__ */ ((t) => (t.Event = "EVENT", t.Package = "PACKAGE", t))(F || {});
|
|
4
4
|
const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
5
|
__proto__: null,
|
|
6
6
|
BasketOrderType: T,
|
|
7
|
-
DiscountType:
|
|
8
|
-
EventStatus:
|
|
9
|
-
MetricsType:
|
|
10
|
-
OrderItemType:
|
|
7
|
+
DiscountType: ae,
|
|
8
|
+
EventStatus: ee,
|
|
9
|
+
MetricsType: F,
|
|
10
|
+
OrderItemType: se,
|
|
11
11
|
PackageItemType: R,
|
|
12
|
-
PackageStatus:
|
|
13
|
-
PackageTabType:
|
|
14
|
-
PaymentMethodFeeType:
|
|
15
|
-
ProductStatus:
|
|
16
|
-
ProductType:
|
|
17
|
-
|
|
12
|
+
PackageStatus: Z,
|
|
13
|
+
PackageTabType: K,
|
|
14
|
+
PaymentMethodFeeType: re,
|
|
15
|
+
ProductStatus: ne,
|
|
16
|
+
ProductType: ie,
|
|
17
|
+
ShopTemplateType: oe,
|
|
18
|
+
ShopVariationType: ce,
|
|
19
|
+
SortOrder: te
|
|
18
20
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
-
var
|
|
20
|
-
return
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
for (var s in
|
|
21
|
+
var w = function() {
|
|
22
|
+
return w = Object.assign || function(e) {
|
|
23
|
+
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
|
24
|
+
n = arguments[i];
|
|
25
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]);
|
|
24
26
|
}
|
|
25
|
-
return
|
|
26
|
-
},
|
|
27
|
+
return e;
|
|
28
|
+
}, w.apply(this, arguments);
|
|
27
29
|
};
|
|
28
|
-
function U(t,
|
|
30
|
+
function U(t, e) {
|
|
29
31
|
if (!!!t)
|
|
30
|
-
throw new Error(
|
|
32
|
+
throw new Error(e);
|
|
31
33
|
}
|
|
32
|
-
function
|
|
34
|
+
function De(t) {
|
|
33
35
|
return typeof t == "object" && t !== null;
|
|
34
36
|
}
|
|
35
|
-
function Ne(t,
|
|
37
|
+
function Ne(t, e) {
|
|
36
38
|
if (!!!t)
|
|
37
39
|
throw new Error(
|
|
38
40
|
"Unexpected invariant triggered."
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
|
-
const
|
|
42
|
-
function z(t,
|
|
43
|
-
let
|
|
44
|
-
for (const r of t.body.matchAll(
|
|
45
|
-
if (typeof r.index == "number" || Ne(!1), r.index >=
|
|
43
|
+
const ve = /\r\n|[\n\r]/g;
|
|
44
|
+
function z(t, e) {
|
|
45
|
+
let n = 0, i = 1;
|
|
46
|
+
for (const r of t.body.matchAll(ve)) {
|
|
47
|
+
if (typeof r.index == "number" || Ne(!1), r.index >= e)
|
|
46
48
|
break;
|
|
47
|
-
|
|
49
|
+
n = r.index + r[0].length, i += 1;
|
|
48
50
|
}
|
|
49
51
|
return {
|
|
50
52
|
line: i,
|
|
51
|
-
column:
|
|
53
|
+
column: e + 1 - n
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
56
|
+
function Pe(t) {
|
|
57
|
+
return de(
|
|
56
58
|
t.source,
|
|
57
59
|
z(t.source, t.start)
|
|
58
60
|
);
|
|
59
61
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
`,
|
|
62
|
+
function de(t, e) {
|
|
63
|
+
const n = t.locationOffset.column - 1, i = "".padStart(n) + t.body, r = e.line - 1, s = t.locationOffset.line - 1, o = e.line + s, l = e.line === 1 ? n : 0, p = e.column + l, E = `${t.name}:${o}:${p}
|
|
64
|
+
`, g = i.split(/\r\n|[\n\r]/g), d = g[r];
|
|
63
65
|
if (d.length > 120) {
|
|
64
|
-
const
|
|
66
|
+
const m = Math.floor(p / 80), y = p % 80, h = [];
|
|
65
67
|
for (let O = 0; O < d.length; O += 80)
|
|
66
|
-
|
|
68
|
+
h.push(d.slice(O, O + 80));
|
|
67
69
|
return E + Q([
|
|
68
|
-
[`${o} |`,
|
|
69
|
-
...
|
|
70
|
+
[`${o} |`, h[0]],
|
|
71
|
+
...h.slice(1, m + 1).map((O) => ["|", O]),
|
|
70
72
|
["|", "^".padStart(y)],
|
|
71
|
-
["|",
|
|
73
|
+
["|", h[m + 1]]
|
|
72
74
|
]);
|
|
73
75
|
}
|
|
74
76
|
return E + Q([
|
|
75
77
|
// Lines specified like this: ["prefix", "string"],
|
|
76
|
-
[`${o - 1} |`,
|
|
78
|
+
[`${o - 1} |`, g[r - 1]],
|
|
77
79
|
[`${o} |`, d],
|
|
78
|
-
["|", "^".padStart(
|
|
79
|
-
[`${o + 1} |`,
|
|
80
|
+
["|", "^".padStart(p)],
|
|
81
|
+
[`${o + 1} |`, g[r + 1]]
|
|
80
82
|
]);
|
|
81
83
|
}
|
|
82
84
|
function Q(t) {
|
|
83
|
-
const
|
|
84
|
-
return
|
|
85
|
+
const e = t.filter(([i, r]) => r !== void 0), n = Math.max(...e.map(([i]) => i.length));
|
|
86
|
+
return e.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
85
87
|
`);
|
|
86
88
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
nodes:
|
|
89
|
+
function be(t) {
|
|
90
|
+
const e = t[0];
|
|
91
|
+
return e == null || "kind" in e || "length" in e ? {
|
|
92
|
+
nodes: e,
|
|
91
93
|
source: t[1],
|
|
92
94
|
positions: t[2],
|
|
93
95
|
path: t[3],
|
|
94
96
|
originalError: t[4],
|
|
95
97
|
extensions: t[5]
|
|
96
|
-
} :
|
|
98
|
+
} : e;
|
|
97
99
|
}
|
|
98
100
|
class j extends Error {
|
|
99
101
|
/**
|
|
@@ -134,19 +136,19 @@ class j extends Error {
|
|
|
134
136
|
/**
|
|
135
137
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
136
138
|
*/
|
|
137
|
-
constructor(
|
|
139
|
+
constructor(e, ...n) {
|
|
138
140
|
var i, r, s;
|
|
139
|
-
const { nodes: o, source:
|
|
140
|
-
super(
|
|
141
|
+
const { nodes: o, source: l, positions: p, path: E, originalError: g, extensions: d } = be(n);
|
|
142
|
+
super(e), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = g ?? void 0, this.nodes = X(
|
|
141
143
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
142
144
|
);
|
|
143
|
-
const
|
|
144
|
-
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((
|
|
145
|
+
const m = X(
|
|
146
|
+
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((h) => h.loc).filter((h) => h != null)
|
|
145
147
|
);
|
|
146
|
-
this.source =
|
|
147
|
-
const y =
|
|
148
|
-
|
|
149
|
-
) ?
|
|
148
|
+
this.source = l ?? (m == null || (r = m[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? m?.map((h) => h.start), this.locations = p && l ? p.map((h) => z(l, h)) : m?.map((h) => z(h.source, h.start));
|
|
149
|
+
const y = De(
|
|
150
|
+
g?.extensions
|
|
151
|
+
) ? g?.extensions : void 0;
|
|
150
152
|
this.extensions = (s = d ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
151
153
|
message: {
|
|
152
154
|
writable: !0,
|
|
@@ -167,8 +169,8 @@ class j extends Error {
|
|
|
167
169
|
originalError: {
|
|
168
170
|
enumerable: !1
|
|
169
171
|
}
|
|
170
|
-
}),
|
|
171
|
-
value:
|
|
172
|
+
}), g != null && g.stack ? Object.defineProperty(this, "stack", {
|
|
173
|
+
value: g.stack,
|
|
172
174
|
writable: !0,
|
|
173
175
|
configurable: !0
|
|
174
176
|
}) : Error.captureStackTrace ? Error.captureStackTrace(this, j) : Object.defineProperty(this, "stack", {
|
|
@@ -181,36 +183,36 @@ class j extends Error {
|
|
|
181
183
|
return "GraphQLError";
|
|
182
184
|
}
|
|
183
185
|
toString() {
|
|
184
|
-
let
|
|
186
|
+
let e = this.message;
|
|
185
187
|
if (this.nodes)
|
|
186
|
-
for (const
|
|
187
|
-
|
|
188
|
+
for (const n of this.nodes)
|
|
189
|
+
n.loc && (e += `
|
|
188
190
|
|
|
189
|
-
` +
|
|
191
|
+
` + Pe(n.loc));
|
|
190
192
|
else if (this.source && this.locations)
|
|
191
|
-
for (const
|
|
192
|
-
|
|
193
|
+
for (const n of this.locations)
|
|
194
|
+
e += `
|
|
193
195
|
|
|
194
|
-
` +
|
|
195
|
-
return
|
|
196
|
+
` + de(this.source, n);
|
|
197
|
+
return e;
|
|
196
198
|
}
|
|
197
199
|
toJSON() {
|
|
198
|
-
const
|
|
200
|
+
const e = {
|
|
199
201
|
message: this.message
|
|
200
202
|
};
|
|
201
|
-
return this.locations != null && (
|
|
203
|
+
return this.locations != null && (e.locations = this.locations), this.path != null && (e.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (e.extensions = this.extensions), e;
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
function X(t) {
|
|
205
207
|
return t === void 0 || t.length === 0 ? void 0 : t;
|
|
206
208
|
}
|
|
207
|
-
function I(t,
|
|
208
|
-
return new j(`Syntax Error: ${
|
|
209
|
+
function I(t, e, n) {
|
|
210
|
+
return new j(`Syntax Error: ${n}`, {
|
|
209
211
|
source: t,
|
|
210
|
-
positions: [
|
|
212
|
+
positions: [e]
|
|
211
213
|
});
|
|
212
214
|
}
|
|
213
|
-
class
|
|
215
|
+
class Se {
|
|
214
216
|
/**
|
|
215
217
|
* The character offset at which this Node begins.
|
|
216
218
|
*/
|
|
@@ -226,8 +228,8 @@ class xe {
|
|
|
226
228
|
/**
|
|
227
229
|
* The Source document the AST represents.
|
|
228
230
|
*/
|
|
229
|
-
constructor(
|
|
230
|
-
this.start =
|
|
231
|
+
constructor(e, n, i) {
|
|
232
|
+
this.start = e.start, this.end = n.end, this.startToken = e, this.endToken = n, this.source = i;
|
|
231
233
|
}
|
|
232
234
|
get [Symbol.toStringTag]() {
|
|
233
235
|
return "Location";
|
|
@@ -239,7 +241,7 @@ class xe {
|
|
|
239
241
|
};
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
|
-
class
|
|
244
|
+
class ue {
|
|
243
245
|
/**
|
|
244
246
|
* The kind of Token.
|
|
245
247
|
*/
|
|
@@ -266,8 +268,8 @@ class de {
|
|
|
266
268
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
267
269
|
* the last.
|
|
268
270
|
*/
|
|
269
|
-
constructor(
|
|
270
|
-
this.kind =
|
|
271
|
+
constructor(e, n, i, r, s, o) {
|
|
272
|
+
this.kind = e, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
|
|
271
273
|
}
|
|
272
274
|
get [Symbol.toStringTag]() {
|
|
273
275
|
return "Token";
|
|
@@ -281,7 +283,7 @@ class de {
|
|
|
281
283
|
};
|
|
282
284
|
}
|
|
283
285
|
}
|
|
284
|
-
const
|
|
286
|
+
const xe = {
|
|
285
287
|
Name: [],
|
|
286
288
|
Document: ["definitions"],
|
|
287
289
|
OperationDefinition: [
|
|
@@ -369,11 +371,11 @@ const be = {
|
|
|
369
371
|
DirectiveCoordinate: ["name"],
|
|
370
372
|
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
371
373
|
};
|
|
372
|
-
new Set(Object.keys(
|
|
373
|
-
var
|
|
374
|
+
new Set(Object.keys(xe));
|
|
375
|
+
var v;
|
|
374
376
|
(function(t) {
|
|
375
377
|
t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription";
|
|
376
|
-
})(
|
|
378
|
+
})(v || (v = {}));
|
|
377
379
|
var q;
|
|
378
380
|
(function(t) {
|
|
379
381
|
t.QUERY = "QUERY", t.MUTATION = "MUTATION", t.SUBSCRIPTION = "SUBSCRIPTION", t.FIELD = "FIELD", t.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", t.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", t.INLINE_FRAGMENT = "INLINE_FRAGMENT", t.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", t.SCHEMA = "SCHEMA", t.SCALAR = "SCALAR", t.OBJECT = "OBJECT", t.FIELD_DEFINITION = "FIELD_DEFINITION", t.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", t.INTERFACE = "INTERFACE", t.UNION = "UNION", t.ENUM = "ENUM", t.ENUM_VALUE = "ENUM_VALUE", t.INPUT_OBJECT = "INPUT_OBJECT", t.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
@@ -382,46 +384,46 @@ var c;
|
|
|
382
384
|
(function(t) {
|
|
383
385
|
t.NAME = "Name", t.DOCUMENT = "Document", t.OPERATION_DEFINITION = "OperationDefinition", t.VARIABLE_DEFINITION = "VariableDefinition", t.SELECTION_SET = "SelectionSet", t.FIELD = "Field", t.ARGUMENT = "Argument", t.FRAGMENT_SPREAD = "FragmentSpread", t.INLINE_FRAGMENT = "InlineFragment", t.FRAGMENT_DEFINITION = "FragmentDefinition", t.VARIABLE = "Variable", t.INT = "IntValue", t.FLOAT = "FloatValue", t.STRING = "StringValue", t.BOOLEAN = "BooleanValue", t.NULL = "NullValue", t.ENUM = "EnumValue", t.LIST = "ListValue", t.OBJECT = "ObjectValue", t.OBJECT_FIELD = "ObjectField", t.DIRECTIVE = "Directive", t.NAMED_TYPE = "NamedType", t.LIST_TYPE = "ListType", t.NON_NULL_TYPE = "NonNullType", t.SCHEMA_DEFINITION = "SchemaDefinition", t.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", t.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", t.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", t.FIELD_DEFINITION = "FieldDefinition", t.INPUT_VALUE_DEFINITION = "InputValueDefinition", t.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", t.UNION_TYPE_DEFINITION = "UnionTypeDefinition", t.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", t.ENUM_VALUE_DEFINITION = "EnumValueDefinition", t.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", t.DIRECTIVE_DEFINITION = "DirectiveDefinition", t.SCHEMA_EXTENSION = "SchemaExtension", t.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", t.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", t.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", t.UNION_TYPE_EXTENSION = "UnionTypeExtension", t.ENUM_TYPE_EXTENSION = "EnumTypeExtension", t.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", t.TYPE_COORDINATE = "TypeCoordinate", t.MEMBER_COORDINATE = "MemberCoordinate", t.ARGUMENT_COORDINATE = "ArgumentCoordinate", t.DIRECTIVE_COORDINATE = "DirectiveCoordinate", t.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
|
|
384
386
|
})(c || (c = {}));
|
|
385
|
-
function
|
|
387
|
+
function Ce(t) {
|
|
386
388
|
return t === 9 || t === 32;
|
|
387
389
|
}
|
|
388
|
-
function
|
|
390
|
+
function x(t) {
|
|
389
391
|
return t >= 48 && t <= 57;
|
|
390
392
|
}
|
|
391
|
-
function
|
|
393
|
+
function le(t) {
|
|
392
394
|
return t >= 97 && t <= 122 || // A-Z
|
|
393
395
|
t >= 65 && t <= 90;
|
|
394
396
|
}
|
|
395
|
-
function
|
|
396
|
-
return
|
|
397
|
-
}
|
|
398
|
-
function Ce(t) {
|
|
399
|
-
return ue(t) || S(t) || t === 95;
|
|
397
|
+
function pe(t) {
|
|
398
|
+
return le(t) || t === 95;
|
|
400
399
|
}
|
|
401
400
|
function _e(t) {
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
return le(t) || x(t) || t === 95;
|
|
402
|
+
}
|
|
403
|
+
function Le(t) {
|
|
404
|
+
var e;
|
|
405
|
+
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
404
406
|
for (let o = 0; o < t.length; ++o) {
|
|
405
407
|
var s;
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
+
const l = t[o], p = Re(l);
|
|
409
|
+
p !== l.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && p < n && (n = p));
|
|
408
410
|
}
|
|
409
|
-
return t.map((o,
|
|
410
|
-
(
|
|
411
|
+
return t.map((o, l) => l === 0 ? o : o.slice(n)).slice(
|
|
412
|
+
(e = i) !== null && e !== void 0 ? e : 0,
|
|
411
413
|
r + 1
|
|
412
414
|
);
|
|
413
415
|
}
|
|
414
|
-
function
|
|
415
|
-
let
|
|
416
|
-
for (;
|
|
417
|
-
++
|
|
418
|
-
return
|
|
416
|
+
function Re(t) {
|
|
417
|
+
let e = 0;
|
|
418
|
+
for (; e < t.length && Ce(t.charCodeAt(e)); )
|
|
419
|
+
++e;
|
|
420
|
+
return e;
|
|
419
421
|
}
|
|
420
422
|
var a;
|
|
421
423
|
(function(t) {
|
|
422
424
|
t.SOF = "<SOF>", t.EOF = "<EOF>", t.BANG = "!", t.DOLLAR = "$", t.AMP = "&", t.PAREN_L = "(", t.PAREN_R = ")", t.DOT = ".", t.SPREAD = "...", t.COLON = ":", t.EQUALS = "=", t.AT = "@", t.BRACKET_L = "[", t.BRACKET_R = "]", t.BRACE_L = "{", t.PIPE = "|", t.BRACE_R = "}", t.NAME = "Name", t.INT = "Int", t.FLOAT = "Float", t.STRING = "String", t.BLOCK_STRING = "BlockString", t.COMMENT = "Comment";
|
|
423
425
|
})(a || (a = {}));
|
|
424
|
-
class
|
|
426
|
+
class Fe {
|
|
425
427
|
/**
|
|
426
428
|
* The previously focused non-ignored token.
|
|
427
429
|
*/
|
|
@@ -434,9 +436,9 @@ class Re {
|
|
|
434
436
|
/**
|
|
435
437
|
* The character offset at which the current line begins.
|
|
436
438
|
*/
|
|
437
|
-
constructor(
|
|
438
|
-
const
|
|
439
|
-
this.source =
|
|
439
|
+
constructor(e) {
|
|
440
|
+
const n = new ue(a.SOF, 0, 0, 0, 0);
|
|
441
|
+
this.source = e, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
440
442
|
}
|
|
441
443
|
get [Symbol.toStringTag]() {
|
|
442
444
|
return "Lexer";
|
|
@@ -452,17 +454,17 @@ class Re {
|
|
|
452
454
|
* the state of Lexer.
|
|
453
455
|
*/
|
|
454
456
|
lookahead() {
|
|
455
|
-
let
|
|
456
|
-
if (
|
|
457
|
+
let e = this.token;
|
|
458
|
+
if (e.kind !== a.EOF)
|
|
457
459
|
do
|
|
458
|
-
if (
|
|
459
|
-
|
|
460
|
+
if (e.next)
|
|
461
|
+
e = e.next;
|
|
460
462
|
else {
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
+
const n = $e(this, e.end);
|
|
464
|
+
e.next = n, n.prev = e, e = n;
|
|
463
465
|
}
|
|
464
|
-
while (
|
|
465
|
-
return
|
|
466
|
+
while (e.kind === a.COMMENT);
|
|
467
|
+
return e;
|
|
466
468
|
}
|
|
467
469
|
}
|
|
468
470
|
function we(t) {
|
|
@@ -471,34 +473,34 @@ function we(t) {
|
|
|
471
473
|
function P(t) {
|
|
472
474
|
return t >= 0 && t <= 55295 || t >= 57344 && t <= 1114111;
|
|
473
475
|
}
|
|
474
|
-
function B(t,
|
|
475
|
-
return he(t.charCodeAt(
|
|
476
|
+
function B(t, e) {
|
|
477
|
+
return he(t.charCodeAt(e)) && ge(t.charCodeAt(e + 1));
|
|
476
478
|
}
|
|
477
479
|
function he(t) {
|
|
478
480
|
return t >= 55296 && t <= 56319;
|
|
479
481
|
}
|
|
480
|
-
function
|
|
482
|
+
function ge(t) {
|
|
481
483
|
return t >= 56320 && t <= 57343;
|
|
482
484
|
}
|
|
483
|
-
function
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
485
|
+
function D(t, e) {
|
|
486
|
+
const n = t.source.body.codePointAt(e);
|
|
487
|
+
if (n === void 0)
|
|
486
488
|
return a.EOF;
|
|
487
|
-
if (
|
|
488
|
-
const i = String.fromCodePoint(
|
|
489
|
+
if (n >= 32 && n <= 126) {
|
|
490
|
+
const i = String.fromCodePoint(n);
|
|
489
491
|
return i === '"' ? `'"'` : `"${i}"`;
|
|
490
492
|
}
|
|
491
|
-
return "U+" +
|
|
493
|
+
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
492
494
|
}
|
|
493
|
-
function
|
|
494
|
-
const s = t.line, o = 1 +
|
|
495
|
-
return new
|
|
495
|
+
function f(t, e, n, i, r) {
|
|
496
|
+
const s = t.line, o = 1 + n - t.lineStart;
|
|
497
|
+
return new ue(e, n, i, s, o, r);
|
|
496
498
|
}
|
|
497
|
-
function
|
|
498
|
-
const
|
|
499
|
-
let r =
|
|
499
|
+
function $e(t, e) {
|
|
500
|
+
const n = t.source.body, i = n.length;
|
|
501
|
+
let r = e;
|
|
500
502
|
for (; r < i; ) {
|
|
501
|
-
const s =
|
|
503
|
+
const s = n.charCodeAt(r);
|
|
502
504
|
switch (s) {
|
|
503
505
|
// Ignored ::
|
|
504
506
|
// - UnicodeBOM
|
|
@@ -531,11 +533,11 @@ function Fe(t, n) {
|
|
|
531
533
|
++r, ++t.line, t.lineStart = r;
|
|
532
534
|
continue;
|
|
533
535
|
case 13:
|
|
534
|
-
|
|
536
|
+
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++t.line, t.lineStart = r;
|
|
535
537
|
continue;
|
|
536
538
|
// Comment
|
|
537
539
|
case 35:
|
|
538
|
-
return
|
|
540
|
+
return Be(t, r);
|
|
539
541
|
// Token ::
|
|
540
542
|
// - Punctuator
|
|
541
543
|
// - Name
|
|
@@ -545,145 +547,145 @@ function Fe(t, n) {
|
|
|
545
547
|
//
|
|
546
548
|
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
|
|
547
549
|
case 33:
|
|
548
|
-
return
|
|
550
|
+
return f(t, a.BANG, r, r + 1);
|
|
549
551
|
case 36:
|
|
550
|
-
return
|
|
552
|
+
return f(t, a.DOLLAR, r, r + 1);
|
|
551
553
|
case 38:
|
|
552
|
-
return
|
|
554
|
+
return f(t, a.AMP, r, r + 1);
|
|
553
555
|
case 40:
|
|
554
|
-
return
|
|
556
|
+
return f(t, a.PAREN_L, r, r + 1);
|
|
555
557
|
case 41:
|
|
556
|
-
return
|
|
558
|
+
return f(t, a.PAREN_R, r, r + 1);
|
|
557
559
|
case 46:
|
|
558
|
-
if (
|
|
559
|
-
return
|
|
560
|
+
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
561
|
+
return f(t, a.SPREAD, r, r + 3);
|
|
560
562
|
break;
|
|
561
563
|
case 58:
|
|
562
|
-
return
|
|
564
|
+
return f(t, a.COLON, r, r + 1);
|
|
563
565
|
case 61:
|
|
564
|
-
return
|
|
566
|
+
return f(t, a.EQUALS, r, r + 1);
|
|
565
567
|
case 64:
|
|
566
|
-
return
|
|
568
|
+
return f(t, a.AT, r, r + 1);
|
|
567
569
|
case 91:
|
|
568
|
-
return
|
|
570
|
+
return f(t, a.BRACKET_L, r, r + 1);
|
|
569
571
|
case 93:
|
|
570
|
-
return
|
|
572
|
+
return f(t, a.BRACKET_R, r, r + 1);
|
|
571
573
|
case 123:
|
|
572
|
-
return
|
|
574
|
+
return f(t, a.BRACE_L, r, r + 1);
|
|
573
575
|
case 124:
|
|
574
|
-
return
|
|
576
|
+
return f(t, a.PIPE, r, r + 1);
|
|
575
577
|
case 125:
|
|
576
|
-
return
|
|
578
|
+
return f(t, a.BRACE_R, r, r + 1);
|
|
577
579
|
// StringValue
|
|
578
580
|
case 34:
|
|
579
|
-
return
|
|
581
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Ge(t, r) : Ue(t, r);
|
|
580
582
|
}
|
|
581
|
-
if (
|
|
582
|
-
return
|
|
583
|
-
if (
|
|
584
|
-
return
|
|
583
|
+
if (x(s) || s === 45)
|
|
584
|
+
return Ve(t, r, s);
|
|
585
|
+
if (pe(s))
|
|
586
|
+
return je(t, r);
|
|
585
587
|
throw I(
|
|
586
588
|
t.source,
|
|
587
589
|
r,
|
|
588
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(
|
|
590
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(n, r) ? `Unexpected character: ${D(t, r)}.` : `Invalid character: ${D(t, r)}.`
|
|
589
591
|
);
|
|
590
592
|
}
|
|
591
|
-
return
|
|
593
|
+
return f(t, a.EOF, i, i);
|
|
592
594
|
}
|
|
593
|
-
function
|
|
594
|
-
const
|
|
595
|
-
let r =
|
|
595
|
+
function Be(t, e) {
|
|
596
|
+
const n = t.source.body, i = n.length;
|
|
597
|
+
let r = e + 1;
|
|
596
598
|
for (; r < i; ) {
|
|
597
|
-
const s =
|
|
599
|
+
const s = n.charCodeAt(r);
|
|
598
600
|
if (s === 10 || s === 13)
|
|
599
601
|
break;
|
|
600
602
|
if (P(s))
|
|
601
603
|
++r;
|
|
602
|
-
else if (B(
|
|
604
|
+
else if (B(n, r))
|
|
603
605
|
r += 2;
|
|
604
606
|
else
|
|
605
607
|
break;
|
|
606
608
|
}
|
|
607
|
-
return
|
|
609
|
+
return f(
|
|
608
610
|
t,
|
|
609
611
|
a.COMMENT,
|
|
610
|
-
|
|
612
|
+
e,
|
|
611
613
|
r,
|
|
612
|
-
|
|
614
|
+
n.slice(e + 1, r)
|
|
613
615
|
);
|
|
614
616
|
}
|
|
615
|
-
function
|
|
617
|
+
function Ve(t, e, n) {
|
|
616
618
|
const i = t.source.body;
|
|
617
|
-
let r =
|
|
619
|
+
let r = e, s = n, o = !1;
|
|
618
620
|
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
619
|
-
if (s = i.charCodeAt(++r),
|
|
621
|
+
if (s = i.charCodeAt(++r), x(s))
|
|
620
622
|
throw I(
|
|
621
623
|
t.source,
|
|
622
624
|
r,
|
|
623
|
-
`Invalid number, unexpected digit after 0: ${
|
|
625
|
+
`Invalid number, unexpected digit after 0: ${D(
|
|
624
626
|
t,
|
|
625
627
|
r
|
|
626
628
|
)}.`
|
|
627
629
|
);
|
|
628
630
|
} else
|
|
629
631
|
r = M(t, r, s), s = i.charCodeAt(r);
|
|
630
|
-
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = M(t, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = M(t, r, s), s = i.charCodeAt(r)), s === 46 ||
|
|
632
|
+
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = M(t, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = M(t, r, s), s = i.charCodeAt(r)), s === 46 || pe(s))
|
|
631
633
|
throw I(
|
|
632
634
|
t.source,
|
|
633
635
|
r,
|
|
634
|
-
`Invalid number, expected digit but got: ${
|
|
636
|
+
`Invalid number, expected digit but got: ${D(
|
|
635
637
|
t,
|
|
636
638
|
r
|
|
637
639
|
)}.`
|
|
638
640
|
);
|
|
639
|
-
return
|
|
641
|
+
return f(
|
|
640
642
|
t,
|
|
641
643
|
o ? a.FLOAT : a.INT,
|
|
642
|
-
|
|
644
|
+
e,
|
|
643
645
|
r,
|
|
644
|
-
i.slice(
|
|
646
|
+
i.slice(e, r)
|
|
645
647
|
);
|
|
646
648
|
}
|
|
647
|
-
function M(t,
|
|
648
|
-
if (!
|
|
649
|
+
function M(t, e, n) {
|
|
650
|
+
if (!x(n))
|
|
649
651
|
throw I(
|
|
650
652
|
t.source,
|
|
651
|
-
|
|
652
|
-
`Invalid number, expected digit but got: ${
|
|
653
|
+
e,
|
|
654
|
+
`Invalid number, expected digit but got: ${D(
|
|
653
655
|
t,
|
|
654
|
-
|
|
656
|
+
e
|
|
655
657
|
)}.`
|
|
656
658
|
);
|
|
657
659
|
const i = t.source.body;
|
|
658
|
-
let r =
|
|
659
|
-
for (;
|
|
660
|
+
let r = e + 1;
|
|
661
|
+
for (; x(i.charCodeAt(r)); )
|
|
660
662
|
++r;
|
|
661
663
|
return r;
|
|
662
664
|
}
|
|
663
|
-
function
|
|
664
|
-
const
|
|
665
|
-
let r =
|
|
665
|
+
function Ue(t, e) {
|
|
666
|
+
const n = t.source.body, i = n.length;
|
|
667
|
+
let r = e + 1, s = r, o = "";
|
|
666
668
|
for (; r < i; ) {
|
|
667
|
-
const
|
|
668
|
-
if (
|
|
669
|
-
return o +=
|
|
670
|
-
if (
|
|
671
|
-
o +=
|
|
672
|
-
const
|
|
673
|
-
o +=
|
|
669
|
+
const l = n.charCodeAt(r);
|
|
670
|
+
if (l === 34)
|
|
671
|
+
return o += n.slice(s, r), f(t, a.STRING, e, r + 1, o);
|
|
672
|
+
if (l === 92) {
|
|
673
|
+
o += n.slice(s, r);
|
|
674
|
+
const p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Me(t, r) : ze(t, r) : qe(t, r);
|
|
675
|
+
o += p.value, r += p.size, s = r;
|
|
674
676
|
continue;
|
|
675
677
|
}
|
|
676
|
-
if (
|
|
678
|
+
if (l === 10 || l === 13)
|
|
677
679
|
break;
|
|
678
|
-
if (P(
|
|
680
|
+
if (P(l))
|
|
679
681
|
++r;
|
|
680
|
-
else if (B(
|
|
682
|
+
else if (B(n, r))
|
|
681
683
|
r += 2;
|
|
682
684
|
else
|
|
683
685
|
throw I(
|
|
684
686
|
t.source,
|
|
685
687
|
r,
|
|
686
|
-
`Invalid character within String: ${
|
|
688
|
+
`Invalid character within String: ${D(
|
|
687
689
|
t,
|
|
688
690
|
r
|
|
689
691
|
)}.`
|
|
@@ -691,11 +693,11 @@ function Ve(t, n) {
|
|
|
691
693
|
}
|
|
692
694
|
throw I(t.source, r, "Unterminated string.");
|
|
693
695
|
}
|
|
694
|
-
function
|
|
695
|
-
const
|
|
696
|
+
function Me(t, e) {
|
|
697
|
+
const n = t.source.body;
|
|
696
698
|
let i = 0, r = 3;
|
|
697
699
|
for (; r < 12; ) {
|
|
698
|
-
const s =
|
|
700
|
+
const s = n.charCodeAt(e + r++);
|
|
699
701
|
if (s === 125) {
|
|
700
702
|
if (r < 5 || !P(i))
|
|
701
703
|
break;
|
|
@@ -704,28 +706,28 @@ function Ue(t, n) {
|
|
|
704
706
|
size: r
|
|
705
707
|
};
|
|
706
708
|
}
|
|
707
|
-
if (i = i << 4 |
|
|
709
|
+
if (i = i << 4 | S(s), i < 0)
|
|
708
710
|
break;
|
|
709
711
|
}
|
|
710
712
|
throw I(
|
|
711
713
|
t.source,
|
|
712
|
-
|
|
713
|
-
`Invalid Unicode escape sequence: "${
|
|
714
|
-
|
|
715
|
-
|
|
714
|
+
e,
|
|
715
|
+
`Invalid Unicode escape sequence: "${n.slice(
|
|
716
|
+
e,
|
|
717
|
+
e + r
|
|
716
718
|
)}".`
|
|
717
719
|
);
|
|
718
720
|
}
|
|
719
|
-
function
|
|
720
|
-
const
|
|
721
|
+
function ze(t, e) {
|
|
722
|
+
const n = t.source.body, i = W(n, e + 2);
|
|
721
723
|
if (P(i))
|
|
722
724
|
return {
|
|
723
725
|
value: String.fromCodePoint(i),
|
|
724
726
|
size: 6
|
|
725
727
|
};
|
|
726
|
-
if (he(i) &&
|
|
727
|
-
const r = W(
|
|
728
|
-
if (
|
|
728
|
+
if (he(i) && n.charCodeAt(e + 6) === 92 && n.charCodeAt(e + 7) === 117) {
|
|
729
|
+
const r = W(n, e + 8);
|
|
730
|
+
if (ge(r))
|
|
729
731
|
return {
|
|
730
732
|
value: String.fromCodePoint(i, r),
|
|
731
733
|
size: 12
|
|
@@ -733,19 +735,19 @@ function Me(t, n) {
|
|
|
733
735
|
}
|
|
734
736
|
throw I(
|
|
735
737
|
t.source,
|
|
736
|
-
|
|
737
|
-
`Invalid Unicode escape sequence: "${
|
|
738
|
+
e,
|
|
739
|
+
`Invalid Unicode escape sequence: "${n.slice(e, e + 6)}".`
|
|
738
740
|
);
|
|
739
741
|
}
|
|
740
|
-
function W(t,
|
|
741
|
-
return
|
|
742
|
+
function W(t, e) {
|
|
743
|
+
return S(t.charCodeAt(e)) << 12 | S(t.charCodeAt(e + 1)) << 8 | S(t.charCodeAt(e + 2)) << 4 | S(t.charCodeAt(e + 3));
|
|
742
744
|
}
|
|
743
|
-
function
|
|
745
|
+
function S(t) {
|
|
744
746
|
return t >= 48 && t <= 57 ? t - 48 : t >= 65 && t <= 70 ? t - 55 : t >= 97 && t <= 102 ? t - 87 : -1;
|
|
745
747
|
}
|
|
746
|
-
function
|
|
747
|
-
const
|
|
748
|
-
switch (
|
|
748
|
+
function qe(t, e) {
|
|
749
|
+
const n = t.source.body;
|
|
750
|
+
switch (n.charCodeAt(e + 1)) {
|
|
749
751
|
case 34:
|
|
750
752
|
return {
|
|
751
753
|
value: '"',
|
|
@@ -790,49 +792,49 @@ function ze(t, n) {
|
|
|
790
792
|
}
|
|
791
793
|
throw I(
|
|
792
794
|
t.source,
|
|
793
|
-
|
|
794
|
-
`Invalid character escape sequence: "${
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
e,
|
|
796
|
+
`Invalid character escape sequence: "${n.slice(
|
|
797
|
+
e,
|
|
798
|
+
e + 2
|
|
797
799
|
)}".`
|
|
798
800
|
);
|
|
799
801
|
}
|
|
800
|
-
function
|
|
801
|
-
const
|
|
802
|
-
let r = t.lineStart, s =
|
|
803
|
-
const
|
|
802
|
+
function Ge(t, e) {
|
|
803
|
+
const n = t.source.body, i = n.length;
|
|
804
|
+
let r = t.lineStart, s = e + 3, o = s, l = "";
|
|
805
|
+
const p = [];
|
|
804
806
|
for (; s < i; ) {
|
|
805
|
-
const E =
|
|
806
|
-
if (E === 34 &&
|
|
807
|
-
|
|
808
|
-
const
|
|
807
|
+
const E = n.charCodeAt(s);
|
|
808
|
+
if (E === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
809
|
+
l += n.slice(o, s), p.push(l);
|
|
810
|
+
const g = f(
|
|
809
811
|
t,
|
|
810
812
|
a.BLOCK_STRING,
|
|
811
|
-
|
|
813
|
+
e,
|
|
812
814
|
s + 3,
|
|
813
815
|
// Return a string of the lines joined with U+000A.
|
|
814
|
-
|
|
816
|
+
Le(p).join(`
|
|
815
817
|
`)
|
|
816
818
|
);
|
|
817
|
-
return t.line +=
|
|
819
|
+
return t.line += p.length - 1, t.lineStart = r, g;
|
|
818
820
|
}
|
|
819
|
-
if (E === 92 &&
|
|
820
|
-
|
|
821
|
+
if (E === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
822
|
+
l += n.slice(o, s), o = s + 1, s += 4;
|
|
821
823
|
continue;
|
|
822
824
|
}
|
|
823
825
|
if (E === 10 || E === 13) {
|
|
824
|
-
|
|
826
|
+
l += n.slice(o, s), p.push(l), E === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", o = s, r = s;
|
|
825
827
|
continue;
|
|
826
828
|
}
|
|
827
829
|
if (P(E))
|
|
828
830
|
++s;
|
|
829
|
-
else if (B(
|
|
831
|
+
else if (B(n, s))
|
|
830
832
|
s += 2;
|
|
831
833
|
else
|
|
832
834
|
throw I(
|
|
833
835
|
t.source,
|
|
834
836
|
s,
|
|
835
|
-
`Invalid character within String: ${
|
|
837
|
+
`Invalid character within String: ${D(
|
|
836
838
|
t,
|
|
837
839
|
s
|
|
838
840
|
)}.`
|
|
@@ -840,99 +842,99 @@ function qe(t, n) {
|
|
|
840
842
|
}
|
|
841
843
|
throw I(t.source, s, "Unterminated string.");
|
|
842
844
|
}
|
|
843
|
-
function
|
|
844
|
-
const
|
|
845
|
-
let r =
|
|
845
|
+
function je(t, e) {
|
|
846
|
+
const n = t.source.body, i = n.length;
|
|
847
|
+
let r = e + 1;
|
|
846
848
|
for (; r < i; ) {
|
|
847
|
-
const s =
|
|
848
|
-
if (
|
|
849
|
+
const s = n.charCodeAt(r);
|
|
850
|
+
if (_e(s))
|
|
849
851
|
++r;
|
|
850
852
|
else
|
|
851
853
|
break;
|
|
852
854
|
}
|
|
853
|
-
return
|
|
855
|
+
return f(
|
|
854
856
|
t,
|
|
855
857
|
a.NAME,
|
|
856
|
-
|
|
858
|
+
e,
|
|
857
859
|
r,
|
|
858
|
-
|
|
860
|
+
n.slice(e, r)
|
|
859
861
|
);
|
|
860
862
|
}
|
|
861
|
-
const
|
|
863
|
+
const Ye = 10, me = 2;
|
|
862
864
|
function fe(t) {
|
|
863
865
|
return V(t, []);
|
|
864
866
|
}
|
|
865
|
-
function V(t,
|
|
867
|
+
function V(t, e) {
|
|
866
868
|
switch (typeof t) {
|
|
867
869
|
case "string":
|
|
868
870
|
return JSON.stringify(t);
|
|
869
871
|
case "function":
|
|
870
872
|
return t.name ? `[function ${t.name}]` : "[function]";
|
|
871
873
|
case "object":
|
|
872
|
-
return
|
|
874
|
+
return He(t, e);
|
|
873
875
|
default:
|
|
874
876
|
return String(t);
|
|
875
877
|
}
|
|
876
878
|
}
|
|
877
|
-
function
|
|
879
|
+
function He(t, e) {
|
|
878
880
|
if (t === null)
|
|
879
881
|
return "null";
|
|
880
|
-
if (
|
|
882
|
+
if (e.includes(t))
|
|
881
883
|
return "[Circular]";
|
|
882
|
-
const
|
|
883
|
-
if (
|
|
884
|
+
const n = [...e, t];
|
|
885
|
+
if (Je(t)) {
|
|
884
886
|
const i = t.toJSON();
|
|
885
887
|
if (i !== t)
|
|
886
|
-
return typeof i == "string" ? i : V(i,
|
|
888
|
+
return typeof i == "string" ? i : V(i, n);
|
|
887
889
|
} else if (Array.isArray(t))
|
|
888
|
-
return
|
|
889
|
-
return
|
|
890
|
+
return Xe(t, n);
|
|
891
|
+
return Qe(t, n);
|
|
890
892
|
}
|
|
891
|
-
function
|
|
893
|
+
function Je(t) {
|
|
892
894
|
return typeof t.toJSON == "function";
|
|
893
895
|
}
|
|
894
|
-
function
|
|
895
|
-
const
|
|
896
|
-
return
|
|
897
|
-
([r, s]) => r + ": " + V(s,
|
|
896
|
+
function Qe(t, e) {
|
|
897
|
+
const n = Object.entries(t);
|
|
898
|
+
return n.length === 0 ? "{}" : e.length > me ? "[" + We(t) + "]" : "{ " + n.map(
|
|
899
|
+
([r, s]) => r + ": " + V(s, e)
|
|
898
900
|
).join(", ") + " }";
|
|
899
901
|
}
|
|
900
|
-
function
|
|
902
|
+
function Xe(t, e) {
|
|
901
903
|
if (t.length === 0)
|
|
902
904
|
return "[]";
|
|
903
|
-
if (
|
|
905
|
+
if (e.length > me)
|
|
904
906
|
return "[Array]";
|
|
905
|
-
const
|
|
906
|
-
for (let s = 0; s <
|
|
907
|
-
r.push(V(t[s],
|
|
907
|
+
const n = Math.min(Ye, t.length), i = t.length - n, r = [];
|
|
908
|
+
for (let s = 0; s < n; ++s)
|
|
909
|
+
r.push(V(t[s], e));
|
|
908
910
|
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
909
911
|
}
|
|
910
|
-
function
|
|
911
|
-
const
|
|
912
|
-
if (
|
|
913
|
-
const
|
|
914
|
-
if (typeof
|
|
915
|
-
return
|
|
912
|
+
function We(t) {
|
|
913
|
+
const e = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
|
|
914
|
+
if (e === "Object" && typeof t.constructor == "function") {
|
|
915
|
+
const n = t.constructor.name;
|
|
916
|
+
if (typeof n == "string" && n !== "")
|
|
917
|
+
return n;
|
|
916
918
|
}
|
|
917
|
-
return
|
|
919
|
+
return e;
|
|
918
920
|
}
|
|
919
|
-
const
|
|
920
|
-
process.env.NODE_ENV === "production",
|
|
921
|
+
const Ze = globalThis.process && // eslint-disable-next-line no-undef
|
|
922
|
+
process.env.NODE_ENV === "production", Ke = (
|
|
921
923
|
/* c8 ignore next 6 */
|
|
922
924
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
923
|
-
|
|
924
|
-
return
|
|
925
|
-
} : function(
|
|
926
|
-
if (
|
|
925
|
+
Ze ? function(e, n) {
|
|
926
|
+
return e instanceof n;
|
|
927
|
+
} : function(e, n) {
|
|
928
|
+
if (e instanceof n)
|
|
927
929
|
return !0;
|
|
928
|
-
if (typeof
|
|
930
|
+
if (typeof e == "object" && e !== null) {
|
|
929
931
|
var i;
|
|
930
|
-
const r =
|
|
932
|
+
const r = n.prototype[Symbol.toStringTag], s = (
|
|
931
933
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
932
|
-
Symbol.toStringTag in
|
|
934
|
+
Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name
|
|
933
935
|
);
|
|
934
936
|
if (r === s) {
|
|
935
|
-
const o = fe(
|
|
937
|
+
const o = fe(e);
|
|
936
938
|
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
937
939
|
|
|
938
940
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
@@ -950,12 +952,12 @@ spurious results.`);
|
|
|
950
952
|
return !1;
|
|
951
953
|
}
|
|
952
954
|
);
|
|
953
|
-
class
|
|
954
|
-
constructor(
|
|
955
|
+
class Ie {
|
|
956
|
+
constructor(e, n = "GraphQL request", i = {
|
|
955
957
|
line: 1,
|
|
956
958
|
column: 1
|
|
957
959
|
}) {
|
|
958
|
-
typeof
|
|
960
|
+
typeof e == "string" || U(!1, `Body must be a string. Received: ${fe(e)}.`), this.body = e, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || U(
|
|
959
961
|
!1,
|
|
960
962
|
"line in locationOffset is 1-indexed and must be positive."
|
|
961
963
|
), this.locationOffset.column > 0 || U(
|
|
@@ -967,24 +969,24 @@ class ge {
|
|
|
967
969
|
return "Source";
|
|
968
970
|
}
|
|
969
971
|
}
|
|
970
|
-
function
|
|
971
|
-
return
|
|
972
|
+
function et(t) {
|
|
973
|
+
return Ke(t, Ie);
|
|
972
974
|
}
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
+
function tt(t, e) {
|
|
976
|
+
const n = new nt(t, e), i = n.parseDocument();
|
|
975
977
|
return Object.defineProperty(i, "tokenCount", {
|
|
976
978
|
enumerable: !1,
|
|
977
|
-
value:
|
|
979
|
+
value: n.tokenCount
|
|
978
980
|
}), i;
|
|
979
981
|
}
|
|
980
|
-
class
|
|
981
|
-
constructor(
|
|
982
|
-
const { lexer: i, ...r } =
|
|
982
|
+
class nt {
|
|
983
|
+
constructor(e, n = {}) {
|
|
984
|
+
const { lexer: i, ...r } = n;
|
|
983
985
|
if (i)
|
|
984
986
|
this._lexer = i;
|
|
985
987
|
else {
|
|
986
|
-
const s =
|
|
987
|
-
this._lexer = new
|
|
988
|
+
const s = et(e) ? e : new Ie(e);
|
|
989
|
+
this._lexer = new Fe(s);
|
|
988
990
|
}
|
|
989
991
|
this._options = r, this._tokenCounter = 0;
|
|
990
992
|
}
|
|
@@ -995,10 +997,10 @@ class tt {
|
|
|
995
997
|
* Converts a name lex token into a name parse node.
|
|
996
998
|
*/
|
|
997
999
|
parseName() {
|
|
998
|
-
const
|
|
999
|
-
return this.node(
|
|
1000
|
+
const e = this.expectToken(a.NAME);
|
|
1001
|
+
return this.node(e, {
|
|
1000
1002
|
kind: c.NAME,
|
|
1001
|
-
value:
|
|
1003
|
+
value: e.value
|
|
1002
1004
|
});
|
|
1003
1005
|
}
|
|
1004
1006
|
// Implements the parsing rules in the Document section.
|
|
@@ -1041,15 +1043,15 @@ class tt {
|
|
|
1041
1043
|
parseDefinition() {
|
|
1042
1044
|
if (this.peek(a.BRACE_L))
|
|
1043
1045
|
return this.parseOperationDefinition();
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1046
|
+
const e = this.peekDescription(), n = e ? this._lexer.lookahead() : this._lexer.token;
|
|
1047
|
+
if (e && n.kind === a.BRACE_L)
|
|
1046
1048
|
throw I(
|
|
1047
1049
|
this._lexer.source,
|
|
1048
1050
|
this._lexer.token.start,
|
|
1049
1051
|
"Unexpected description, descriptions are not supported on shorthand queries."
|
|
1050
1052
|
);
|
|
1051
|
-
if (
|
|
1052
|
-
switch (
|
|
1053
|
+
if (n.kind === a.NAME) {
|
|
1054
|
+
switch (n.value) {
|
|
1053
1055
|
case "schema":
|
|
1054
1056
|
return this.parseSchemaDefinition();
|
|
1055
1057
|
case "scalar":
|
|
@@ -1067,7 +1069,7 @@ class tt {
|
|
|
1067
1069
|
case "directive":
|
|
1068
1070
|
return this.parseDirectiveDefinition();
|
|
1069
1071
|
}
|
|
1070
|
-
switch (
|
|
1072
|
+
switch (n.value) {
|
|
1071
1073
|
case "query":
|
|
1072
1074
|
case "mutation":
|
|
1073
1075
|
case "subscription":
|
|
@@ -1075,16 +1077,16 @@ class tt {
|
|
|
1075
1077
|
case "fragment":
|
|
1076
1078
|
return this.parseFragmentDefinition();
|
|
1077
1079
|
}
|
|
1078
|
-
if (
|
|
1080
|
+
if (e)
|
|
1079
1081
|
throw I(
|
|
1080
1082
|
this._lexer.source,
|
|
1081
1083
|
this._lexer.token.start,
|
|
1082
1084
|
"Unexpected description, only GraphQL definitions support descriptions."
|
|
1083
1085
|
);
|
|
1084
|
-
if (
|
|
1086
|
+
if (n.value === "extend")
|
|
1085
1087
|
return this.parseTypeSystemExtension();
|
|
1086
1088
|
}
|
|
1087
|
-
throw this.unexpected(
|
|
1089
|
+
throw this.unexpected(n);
|
|
1088
1090
|
}
|
|
1089
1091
|
// Implements the parsing rules in the Operations section.
|
|
1090
1092
|
/**
|
|
@@ -1093,23 +1095,23 @@ class tt {
|
|
|
1093
1095
|
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
|
|
1094
1096
|
*/
|
|
1095
1097
|
parseOperationDefinition() {
|
|
1096
|
-
const
|
|
1098
|
+
const e = this._lexer.token;
|
|
1097
1099
|
if (this.peek(a.BRACE_L))
|
|
1098
|
-
return this.node(
|
|
1100
|
+
return this.node(e, {
|
|
1099
1101
|
kind: c.OPERATION_DEFINITION,
|
|
1100
|
-
operation:
|
|
1102
|
+
operation: v.QUERY,
|
|
1101
1103
|
description: void 0,
|
|
1102
1104
|
name: void 0,
|
|
1103
1105
|
variableDefinitions: [],
|
|
1104
1106
|
directives: [],
|
|
1105
1107
|
selectionSet: this.parseSelectionSet()
|
|
1106
1108
|
});
|
|
1107
|
-
const
|
|
1109
|
+
const n = this.parseDescription(), i = this.parseOperationType();
|
|
1108
1110
|
let r;
|
|
1109
|
-
return this.peek(a.NAME) && (r = this.parseName()), this.node(
|
|
1111
|
+
return this.peek(a.NAME) && (r = this.parseName()), this.node(e, {
|
|
1110
1112
|
kind: c.OPERATION_DEFINITION,
|
|
1111
1113
|
operation: i,
|
|
1112
|
-
description:
|
|
1114
|
+
description: n,
|
|
1113
1115
|
name: r,
|
|
1114
1116
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1115
1117
|
directives: this.parseDirectives(!1),
|
|
@@ -1120,16 +1122,16 @@ class tt {
|
|
|
1120
1122
|
* OperationType : one of query mutation subscription
|
|
1121
1123
|
*/
|
|
1122
1124
|
parseOperationType() {
|
|
1123
|
-
const
|
|
1124
|
-
switch (
|
|
1125
|
+
const e = this.expectToken(a.NAME);
|
|
1126
|
+
switch (e.value) {
|
|
1125
1127
|
case "query":
|
|
1126
|
-
return
|
|
1128
|
+
return v.QUERY;
|
|
1127
1129
|
case "mutation":
|
|
1128
|
-
return
|
|
1130
|
+
return v.MUTATION;
|
|
1129
1131
|
case "subscription":
|
|
1130
|
-
return
|
|
1132
|
+
return v.SUBSCRIPTION;
|
|
1131
1133
|
}
|
|
1132
|
-
throw this.unexpected(
|
|
1134
|
+
throw this.unexpected(e);
|
|
1133
1135
|
}
|
|
1134
1136
|
/**
|
|
1135
1137
|
* VariableDefinitions : ( VariableDefinition+ )
|
|
@@ -1158,8 +1160,8 @@ class tt {
|
|
|
1158
1160
|
* Variable : $ Name
|
|
1159
1161
|
*/
|
|
1160
1162
|
parseVariable() {
|
|
1161
|
-
const
|
|
1162
|
-
return this.expectToken(a.DOLLAR), this.node(
|
|
1163
|
+
const e = this._lexer.token;
|
|
1164
|
+
return this.expectToken(a.DOLLAR), this.node(e, {
|
|
1163
1165
|
kind: c.VARIABLE,
|
|
1164
1166
|
name: this.parseName()
|
|
1165
1167
|
});
|
|
@@ -1194,9 +1196,9 @@ class tt {
|
|
|
1194
1196
|
* Alias : Name :
|
|
1195
1197
|
*/
|
|
1196
1198
|
parseField() {
|
|
1197
|
-
const
|
|
1199
|
+
const e = this._lexer.token, n = this.parseName();
|
|
1198
1200
|
let i, r;
|
|
1199
|
-
return this.expectOptionalToken(a.COLON) ? (i =
|
|
1201
|
+
return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(e, {
|
|
1200
1202
|
kind: c.FIELD,
|
|
1201
1203
|
alias: i,
|
|
1202
1204
|
name: r,
|
|
@@ -1208,19 +1210,19 @@ class tt {
|
|
|
1208
1210
|
/**
|
|
1209
1211
|
* Arguments[Const] : ( Argument[?Const]+ )
|
|
1210
1212
|
*/
|
|
1211
|
-
parseArguments(
|
|
1212
|
-
const
|
|
1213
|
-
return this.optionalMany(a.PAREN_L,
|
|
1213
|
+
parseArguments(e) {
|
|
1214
|
+
const n = e ? this.parseConstArgument : this.parseArgument;
|
|
1215
|
+
return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
|
|
1214
1216
|
}
|
|
1215
1217
|
/**
|
|
1216
1218
|
* Argument[Const] : Name : Value[?Const]
|
|
1217
1219
|
*/
|
|
1218
|
-
parseArgument(
|
|
1219
|
-
const
|
|
1220
|
-
return this.expectToken(a.COLON), this.node(
|
|
1220
|
+
parseArgument(e = !1) {
|
|
1221
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1222
|
+
return this.expectToken(a.COLON), this.node(n, {
|
|
1221
1223
|
kind: c.ARGUMENT,
|
|
1222
1224
|
name: i,
|
|
1223
|
-
value: this.parseValueLiteral(
|
|
1225
|
+
value: this.parseValueLiteral(e)
|
|
1224
1226
|
});
|
|
1225
1227
|
}
|
|
1226
1228
|
parseConstArgument() {
|
|
@@ -1235,16 +1237,16 @@ class tt {
|
|
|
1235
1237
|
* InlineFragment : ... TypeCondition? Directives? SelectionSet
|
|
1236
1238
|
*/
|
|
1237
1239
|
parseFragment() {
|
|
1238
|
-
const
|
|
1240
|
+
const e = this._lexer.token;
|
|
1239
1241
|
this.expectToken(a.SPREAD);
|
|
1240
|
-
const
|
|
1241
|
-
return !
|
|
1242
|
+
const n = this.expectOptionalKeyword("on");
|
|
1243
|
+
return !n && this.peek(a.NAME) ? this.node(e, {
|
|
1242
1244
|
kind: c.FRAGMENT_SPREAD,
|
|
1243
1245
|
name: this.parseFragmentName(),
|
|
1244
1246
|
directives: this.parseDirectives(!1)
|
|
1245
|
-
}) : this.node(
|
|
1247
|
+
}) : this.node(e, {
|
|
1246
1248
|
kind: c.INLINE_FRAGMENT,
|
|
1247
|
-
typeCondition:
|
|
1249
|
+
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1248
1250
|
directives: this.parseDirectives(!1),
|
|
1249
1251
|
selectionSet: this.parseSelectionSet()
|
|
1250
1252
|
});
|
|
@@ -1256,18 +1258,18 @@ class tt {
|
|
|
1256
1258
|
* TypeCondition : NamedType
|
|
1257
1259
|
*/
|
|
1258
1260
|
parseFragmentDefinition() {
|
|
1259
|
-
const
|
|
1260
|
-
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(
|
|
1261
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1262
|
+
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, {
|
|
1261
1263
|
kind: c.FRAGMENT_DEFINITION,
|
|
1262
|
-
description:
|
|
1264
|
+
description: n,
|
|
1263
1265
|
name: this.parseFragmentName(),
|
|
1264
1266
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1265
1267
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1266
1268
|
directives: this.parseDirectives(!1),
|
|
1267
1269
|
selectionSet: this.parseSelectionSet()
|
|
1268
|
-
}) : this.node(
|
|
1270
|
+
}) : this.node(e, {
|
|
1269
1271
|
kind: c.FRAGMENT_DEFINITION,
|
|
1270
|
-
description:
|
|
1272
|
+
description: n,
|
|
1271
1273
|
name: this.parseFragmentName(),
|
|
1272
1274
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1273
1275
|
directives: this.parseDirectives(!1),
|
|
@@ -1301,59 +1303,59 @@ class tt {
|
|
|
1301
1303
|
*
|
|
1302
1304
|
* EnumValue : Name but not `true`, `false` or `null`
|
|
1303
1305
|
*/
|
|
1304
|
-
parseValueLiteral(
|
|
1305
|
-
const
|
|
1306
|
-
switch (
|
|
1306
|
+
parseValueLiteral(e) {
|
|
1307
|
+
const n = this._lexer.token;
|
|
1308
|
+
switch (n.kind) {
|
|
1307
1309
|
case a.BRACKET_L:
|
|
1308
|
-
return this.parseList(
|
|
1310
|
+
return this.parseList(e);
|
|
1309
1311
|
case a.BRACE_L:
|
|
1310
|
-
return this.parseObject(
|
|
1312
|
+
return this.parseObject(e);
|
|
1311
1313
|
case a.INT:
|
|
1312
|
-
return this.advanceLexer(), this.node(
|
|
1314
|
+
return this.advanceLexer(), this.node(n, {
|
|
1313
1315
|
kind: c.INT,
|
|
1314
|
-
value:
|
|
1316
|
+
value: n.value
|
|
1315
1317
|
});
|
|
1316
1318
|
case a.FLOAT:
|
|
1317
|
-
return this.advanceLexer(), this.node(
|
|
1319
|
+
return this.advanceLexer(), this.node(n, {
|
|
1318
1320
|
kind: c.FLOAT,
|
|
1319
|
-
value:
|
|
1321
|
+
value: n.value
|
|
1320
1322
|
});
|
|
1321
1323
|
case a.STRING:
|
|
1322
1324
|
case a.BLOCK_STRING:
|
|
1323
1325
|
return this.parseStringLiteral();
|
|
1324
1326
|
case a.NAME:
|
|
1325
|
-
switch (this.advanceLexer(),
|
|
1327
|
+
switch (this.advanceLexer(), n.value) {
|
|
1326
1328
|
case "true":
|
|
1327
|
-
return this.node(
|
|
1329
|
+
return this.node(n, {
|
|
1328
1330
|
kind: c.BOOLEAN,
|
|
1329
1331
|
value: !0
|
|
1330
1332
|
});
|
|
1331
1333
|
case "false":
|
|
1332
|
-
return this.node(
|
|
1334
|
+
return this.node(n, {
|
|
1333
1335
|
kind: c.BOOLEAN,
|
|
1334
1336
|
value: !1
|
|
1335
1337
|
});
|
|
1336
1338
|
case "null":
|
|
1337
|
-
return this.node(
|
|
1339
|
+
return this.node(n, {
|
|
1338
1340
|
kind: c.NULL
|
|
1339
1341
|
});
|
|
1340
1342
|
default:
|
|
1341
|
-
return this.node(
|
|
1343
|
+
return this.node(n, {
|
|
1342
1344
|
kind: c.ENUM,
|
|
1343
|
-
value:
|
|
1345
|
+
value: n.value
|
|
1344
1346
|
});
|
|
1345
1347
|
}
|
|
1346
1348
|
case a.DOLLAR:
|
|
1347
|
-
if (
|
|
1349
|
+
if (e)
|
|
1348
1350
|
if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
|
|
1349
1351
|
const i = this._lexer.token.value;
|
|
1350
1352
|
throw I(
|
|
1351
1353
|
this._lexer.source,
|
|
1352
|
-
|
|
1354
|
+
n.start,
|
|
1353
1355
|
`Unexpected variable "$${i}" in constant value.`
|
|
1354
1356
|
);
|
|
1355
1357
|
} else
|
|
1356
|
-
throw this.unexpected(
|
|
1358
|
+
throw this.unexpected(n);
|
|
1357
1359
|
return this.parseVariable();
|
|
1358
1360
|
default:
|
|
1359
1361
|
throw this.unexpected();
|
|
@@ -1363,11 +1365,11 @@ class tt {
|
|
|
1363
1365
|
return this.parseValueLiteral(!0);
|
|
1364
1366
|
}
|
|
1365
1367
|
parseStringLiteral() {
|
|
1366
|
-
const
|
|
1367
|
-
return this.advanceLexer(), this.node(
|
|
1368
|
+
const e = this._lexer.token;
|
|
1369
|
+
return this.advanceLexer(), this.node(e, {
|
|
1368
1370
|
kind: c.STRING,
|
|
1369
|
-
value:
|
|
1370
|
-
block:
|
|
1371
|
+
value: e.value,
|
|
1372
|
+
block: e.kind === a.BLOCK_STRING
|
|
1371
1373
|
});
|
|
1372
1374
|
}
|
|
1373
1375
|
/**
|
|
@@ -1375,11 +1377,11 @@ class tt {
|
|
|
1375
1377
|
* - [ ]
|
|
1376
1378
|
* - [ Value[?Const]+ ]
|
|
1377
1379
|
*/
|
|
1378
|
-
parseList(
|
|
1379
|
-
const
|
|
1380
|
+
parseList(e) {
|
|
1381
|
+
const n = () => this.parseValueLiteral(e);
|
|
1380
1382
|
return this.node(this._lexer.token, {
|
|
1381
1383
|
kind: c.LIST,
|
|
1382
|
-
values: this.any(a.BRACKET_L,
|
|
1384
|
+
values: this.any(a.BRACKET_L, n, a.BRACKET_R)
|
|
1383
1385
|
});
|
|
1384
1386
|
}
|
|
1385
1387
|
/**
|
|
@@ -1389,33 +1391,33 @@ class tt {
|
|
|
1389
1391
|
* - { ObjectField[?Const]+ }
|
|
1390
1392
|
* ```
|
|
1391
1393
|
*/
|
|
1392
|
-
parseObject(
|
|
1393
|
-
const
|
|
1394
|
+
parseObject(e) {
|
|
1395
|
+
const n = () => this.parseObjectField(e);
|
|
1394
1396
|
return this.node(this._lexer.token, {
|
|
1395
1397
|
kind: c.OBJECT,
|
|
1396
|
-
fields: this.any(a.BRACE_L,
|
|
1398
|
+
fields: this.any(a.BRACE_L, n, a.BRACE_R)
|
|
1397
1399
|
});
|
|
1398
1400
|
}
|
|
1399
1401
|
/**
|
|
1400
1402
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1401
1403
|
*/
|
|
1402
|
-
parseObjectField(
|
|
1403
|
-
const
|
|
1404
|
-
return this.expectToken(a.COLON), this.node(
|
|
1404
|
+
parseObjectField(e) {
|
|
1405
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1406
|
+
return this.expectToken(a.COLON), this.node(n, {
|
|
1405
1407
|
kind: c.OBJECT_FIELD,
|
|
1406
1408
|
name: i,
|
|
1407
|
-
value: this.parseValueLiteral(
|
|
1409
|
+
value: this.parseValueLiteral(e)
|
|
1408
1410
|
});
|
|
1409
1411
|
}
|
|
1410
1412
|
// Implements the parsing rules in the Directives section.
|
|
1411
1413
|
/**
|
|
1412
1414
|
* Directives[Const] : Directive[?Const]+
|
|
1413
1415
|
*/
|
|
1414
|
-
parseDirectives(
|
|
1415
|
-
const
|
|
1416
|
+
parseDirectives(e) {
|
|
1417
|
+
const n = [];
|
|
1416
1418
|
for (; this.peek(a.AT); )
|
|
1417
|
-
|
|
1418
|
-
return
|
|
1419
|
+
n.push(this.parseDirective(e));
|
|
1420
|
+
return n;
|
|
1419
1421
|
}
|
|
1420
1422
|
parseConstDirectives() {
|
|
1421
1423
|
return this.parseDirectives(!0);
|
|
@@ -1425,12 +1427,12 @@ class tt {
|
|
|
1425
1427
|
* Directive[Const] : @ Name Arguments[?Const]?
|
|
1426
1428
|
* ```
|
|
1427
1429
|
*/
|
|
1428
|
-
parseDirective(
|
|
1429
|
-
const
|
|
1430
|
-
return this.expectToken(a.AT), this.node(
|
|
1430
|
+
parseDirective(e) {
|
|
1431
|
+
const n = this._lexer.token;
|
|
1432
|
+
return this.expectToken(a.AT), this.node(n, {
|
|
1431
1433
|
kind: c.DIRECTIVE,
|
|
1432
1434
|
name: this.parseName(),
|
|
1433
|
-
arguments: this.parseArguments(
|
|
1435
|
+
arguments: this.parseArguments(e)
|
|
1434
1436
|
});
|
|
1435
1437
|
}
|
|
1436
1438
|
// Implements the parsing rules in the Types section.
|
|
@@ -1441,20 +1443,20 @@ class tt {
|
|
|
1441
1443
|
* - NonNullType
|
|
1442
1444
|
*/
|
|
1443
1445
|
parseTypeReference() {
|
|
1444
|
-
const
|
|
1445
|
-
let
|
|
1446
|
+
const e = this._lexer.token;
|
|
1447
|
+
let n;
|
|
1446
1448
|
if (this.expectOptionalToken(a.BRACKET_L)) {
|
|
1447
1449
|
const i = this.parseTypeReference();
|
|
1448
|
-
this.expectToken(a.BRACKET_R),
|
|
1450
|
+
this.expectToken(a.BRACKET_R), n = this.node(e, {
|
|
1449
1451
|
kind: c.LIST_TYPE,
|
|
1450
1452
|
type: i
|
|
1451
1453
|
});
|
|
1452
1454
|
} else
|
|
1453
|
-
|
|
1454
|
-
return this.expectOptionalToken(a.BANG) ? this.node(
|
|
1455
|
+
n = this.parseNamedType();
|
|
1456
|
+
return this.expectOptionalToken(a.BANG) ? this.node(e, {
|
|
1455
1457
|
kind: c.NON_NULL_TYPE,
|
|
1456
|
-
type:
|
|
1457
|
-
}) :
|
|
1458
|
+
type: n
|
|
1459
|
+
}) : n;
|
|
1458
1460
|
}
|
|
1459
1461
|
/**
|
|
1460
1462
|
* NamedType : Name
|
|
@@ -1482,16 +1484,16 @@ class tt {
|
|
|
1482
1484
|
* ```
|
|
1483
1485
|
*/
|
|
1484
1486
|
parseSchemaDefinition() {
|
|
1485
|
-
const
|
|
1487
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1486
1488
|
this.expectKeyword("schema");
|
|
1487
1489
|
const i = this.parseConstDirectives(), r = this.many(
|
|
1488
1490
|
a.BRACE_L,
|
|
1489
1491
|
this.parseOperationTypeDefinition,
|
|
1490
1492
|
a.BRACE_R
|
|
1491
1493
|
);
|
|
1492
|
-
return this.node(
|
|
1494
|
+
return this.node(e, {
|
|
1493
1495
|
kind: c.SCHEMA_DEFINITION,
|
|
1494
|
-
description:
|
|
1496
|
+
description: n,
|
|
1495
1497
|
directives: i,
|
|
1496
1498
|
operationTypes: r
|
|
1497
1499
|
});
|
|
@@ -1500,12 +1502,12 @@ class tt {
|
|
|
1500
1502
|
* OperationTypeDefinition : OperationType : NamedType
|
|
1501
1503
|
*/
|
|
1502
1504
|
parseOperationTypeDefinition() {
|
|
1503
|
-
const
|
|
1505
|
+
const e = this._lexer.token, n = this.parseOperationType();
|
|
1504
1506
|
this.expectToken(a.COLON);
|
|
1505
1507
|
const i = this.parseNamedType();
|
|
1506
|
-
return this.node(
|
|
1508
|
+
return this.node(e, {
|
|
1507
1509
|
kind: c.OPERATION_TYPE_DEFINITION,
|
|
1508
|
-
operation:
|
|
1510
|
+
operation: n,
|
|
1509
1511
|
type: i
|
|
1510
1512
|
});
|
|
1511
1513
|
}
|
|
@@ -1513,12 +1515,12 @@ class tt {
|
|
|
1513
1515
|
* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
|
|
1514
1516
|
*/
|
|
1515
1517
|
parseScalarTypeDefinition() {
|
|
1516
|
-
const
|
|
1518
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1517
1519
|
this.expectKeyword("scalar");
|
|
1518
1520
|
const i = this.parseName(), r = this.parseConstDirectives();
|
|
1519
|
-
return this.node(
|
|
1521
|
+
return this.node(e, {
|
|
1520
1522
|
kind: c.SCALAR_TYPE_DEFINITION,
|
|
1521
|
-
description:
|
|
1523
|
+
description: n,
|
|
1522
1524
|
name: i,
|
|
1523
1525
|
directives: r
|
|
1524
1526
|
});
|
|
@@ -1529,12 +1531,12 @@ class tt {
|
|
|
1529
1531
|
* type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
|
|
1530
1532
|
*/
|
|
1531
1533
|
parseObjectTypeDefinition() {
|
|
1532
|
-
const
|
|
1534
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1533
1535
|
this.expectKeyword("type");
|
|
1534
1536
|
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1535
|
-
return this.node(
|
|
1537
|
+
return this.node(e, {
|
|
1536
1538
|
kind: c.OBJECT_TYPE_DEFINITION,
|
|
1537
|
-
description:
|
|
1539
|
+
description: n,
|
|
1538
1540
|
name: i,
|
|
1539
1541
|
interfaces: r,
|
|
1540
1542
|
directives: s,
|
|
@@ -1566,12 +1568,12 @@ class tt {
|
|
|
1566
1568
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1567
1569
|
*/
|
|
1568
1570
|
parseFieldDefinition() {
|
|
1569
|
-
const
|
|
1571
|
+
const e = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
1570
1572
|
this.expectToken(a.COLON);
|
|
1571
1573
|
const s = this.parseTypeReference(), o = this.parseConstDirectives();
|
|
1572
|
-
return this.node(
|
|
1574
|
+
return this.node(e, {
|
|
1573
1575
|
kind: c.FIELD_DEFINITION,
|
|
1574
|
-
description:
|
|
1576
|
+
description: n,
|
|
1575
1577
|
name: i,
|
|
1576
1578
|
arguments: r,
|
|
1577
1579
|
type: s,
|
|
@@ -1593,15 +1595,15 @@ class tt {
|
|
|
1593
1595
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1594
1596
|
*/
|
|
1595
1597
|
parseInputValueDef() {
|
|
1596
|
-
const
|
|
1598
|
+
const e = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
1597
1599
|
this.expectToken(a.COLON);
|
|
1598
1600
|
const r = this.parseTypeReference();
|
|
1599
1601
|
let s;
|
|
1600
1602
|
this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1601
1603
|
const o = this.parseConstDirectives();
|
|
1602
|
-
return this.node(
|
|
1604
|
+
return this.node(e, {
|
|
1603
1605
|
kind: c.INPUT_VALUE_DEFINITION,
|
|
1604
|
-
description:
|
|
1606
|
+
description: n,
|
|
1605
1607
|
name: i,
|
|
1606
1608
|
type: r,
|
|
1607
1609
|
defaultValue: s,
|
|
@@ -1613,12 +1615,12 @@ class tt {
|
|
|
1613
1615
|
* - Description? interface Name Directives[Const]? FieldsDefinition?
|
|
1614
1616
|
*/
|
|
1615
1617
|
parseInterfaceTypeDefinition() {
|
|
1616
|
-
const
|
|
1618
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1617
1619
|
this.expectKeyword("interface");
|
|
1618
1620
|
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1619
|
-
return this.node(
|
|
1621
|
+
return this.node(e, {
|
|
1620
1622
|
kind: c.INTERFACE_TYPE_DEFINITION,
|
|
1621
|
-
description:
|
|
1623
|
+
description: n,
|
|
1622
1624
|
name: i,
|
|
1623
1625
|
interfaces: r,
|
|
1624
1626
|
directives: s,
|
|
@@ -1630,12 +1632,12 @@ class tt {
|
|
|
1630
1632
|
* - Description? union Name Directives[Const]? UnionMemberTypes?
|
|
1631
1633
|
*/
|
|
1632
1634
|
parseUnionTypeDefinition() {
|
|
1633
|
-
const
|
|
1635
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1634
1636
|
this.expectKeyword("union");
|
|
1635
1637
|
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1636
|
-
return this.node(
|
|
1638
|
+
return this.node(e, {
|
|
1637
1639
|
kind: c.UNION_TYPE_DEFINITION,
|
|
1638
|
-
description:
|
|
1640
|
+
description: n,
|
|
1639
1641
|
name: i,
|
|
1640
1642
|
directives: r,
|
|
1641
1643
|
types: s
|
|
@@ -1654,12 +1656,12 @@ class tt {
|
|
|
1654
1656
|
* - Description? enum Name Directives[Const]? EnumValuesDefinition?
|
|
1655
1657
|
*/
|
|
1656
1658
|
parseEnumTypeDefinition() {
|
|
1657
|
-
const
|
|
1659
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1658
1660
|
this.expectKeyword("enum");
|
|
1659
1661
|
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1660
|
-
return this.node(
|
|
1662
|
+
return this.node(e, {
|
|
1661
1663
|
kind: c.ENUM_TYPE_DEFINITION,
|
|
1662
|
-
description:
|
|
1664
|
+
description: n,
|
|
1663
1665
|
name: i,
|
|
1664
1666
|
directives: r,
|
|
1665
1667
|
values: s
|
|
@@ -1681,10 +1683,10 @@ class tt {
|
|
|
1681
1683
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1682
1684
|
*/
|
|
1683
1685
|
parseEnumValueDefinition() {
|
|
1684
|
-
const
|
|
1685
|
-
return this.node(
|
|
1686
|
+
const e = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
1687
|
+
return this.node(e, {
|
|
1686
1688
|
kind: c.ENUM_VALUE_DEFINITION,
|
|
1687
|
-
description:
|
|
1689
|
+
description: n,
|
|
1688
1690
|
name: i,
|
|
1689
1691
|
directives: r
|
|
1690
1692
|
});
|
|
@@ -1708,12 +1710,12 @@ class tt {
|
|
|
1708
1710
|
* - Description? input Name Directives[Const]? InputFieldsDefinition?
|
|
1709
1711
|
*/
|
|
1710
1712
|
parseInputObjectTypeDefinition() {
|
|
1711
|
-
const
|
|
1713
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1712
1714
|
this.expectKeyword("input");
|
|
1713
1715
|
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1714
|
-
return this.node(
|
|
1716
|
+
return this.node(e, {
|
|
1715
1717
|
kind: c.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1716
|
-
description:
|
|
1718
|
+
description: n,
|
|
1717
1719
|
name: i,
|
|
1718
1720
|
directives: r,
|
|
1719
1721
|
fields: s
|
|
@@ -1745,9 +1747,9 @@ class tt {
|
|
|
1745
1747
|
* - InputObjectTypeDefinition
|
|
1746
1748
|
*/
|
|
1747
1749
|
parseTypeSystemExtension() {
|
|
1748
|
-
const
|
|
1749
|
-
if (
|
|
1750
|
-
switch (
|
|
1750
|
+
const e = this._lexer.lookahead();
|
|
1751
|
+
if (e.kind === a.NAME)
|
|
1752
|
+
switch (e.value) {
|
|
1751
1753
|
case "schema":
|
|
1752
1754
|
return this.parseSchemaExtension();
|
|
1753
1755
|
case "scalar":
|
|
@@ -1763,7 +1765,7 @@ class tt {
|
|
|
1763
1765
|
case "input":
|
|
1764
1766
|
return this.parseInputObjectTypeExtension();
|
|
1765
1767
|
}
|
|
1766
|
-
throw this.unexpected(
|
|
1768
|
+
throw this.unexpected(e);
|
|
1767
1769
|
}
|
|
1768
1770
|
/**
|
|
1769
1771
|
* ```
|
|
@@ -1773,18 +1775,18 @@ class tt {
|
|
|
1773
1775
|
* ```
|
|
1774
1776
|
*/
|
|
1775
1777
|
parseSchemaExtension() {
|
|
1776
|
-
const
|
|
1778
|
+
const e = this._lexer.token;
|
|
1777
1779
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1778
|
-
const
|
|
1780
|
+
const n = this.parseConstDirectives(), i = this.optionalMany(
|
|
1779
1781
|
a.BRACE_L,
|
|
1780
1782
|
this.parseOperationTypeDefinition,
|
|
1781
1783
|
a.BRACE_R
|
|
1782
1784
|
);
|
|
1783
|
-
if (
|
|
1785
|
+
if (n.length === 0 && i.length === 0)
|
|
1784
1786
|
throw this.unexpected();
|
|
1785
|
-
return this.node(
|
|
1787
|
+
return this.node(e, {
|
|
1786
1788
|
kind: c.SCHEMA_EXTENSION,
|
|
1787
|
-
directives:
|
|
1789
|
+
directives: n,
|
|
1788
1790
|
operationTypes: i
|
|
1789
1791
|
});
|
|
1790
1792
|
}
|
|
@@ -1793,14 +1795,14 @@ class tt {
|
|
|
1793
1795
|
* - extend scalar Name Directives[Const]
|
|
1794
1796
|
*/
|
|
1795
1797
|
parseScalarTypeExtension() {
|
|
1796
|
-
const
|
|
1798
|
+
const e = this._lexer.token;
|
|
1797
1799
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1798
|
-
const
|
|
1800
|
+
const n = this.parseName(), i = this.parseConstDirectives();
|
|
1799
1801
|
if (i.length === 0)
|
|
1800
1802
|
throw this.unexpected();
|
|
1801
|
-
return this.node(
|
|
1803
|
+
return this.node(e, {
|
|
1802
1804
|
kind: c.SCALAR_TYPE_EXTENSION,
|
|
1803
|
-
name:
|
|
1805
|
+
name: n,
|
|
1804
1806
|
directives: i
|
|
1805
1807
|
});
|
|
1806
1808
|
}
|
|
@@ -1811,14 +1813,14 @@ class tt {
|
|
|
1811
1813
|
* - extend type Name ImplementsInterfaces
|
|
1812
1814
|
*/
|
|
1813
1815
|
parseObjectTypeExtension() {
|
|
1814
|
-
const
|
|
1816
|
+
const e = this._lexer.token;
|
|
1815
1817
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1816
|
-
const
|
|
1818
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1817
1819
|
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1818
1820
|
throw this.unexpected();
|
|
1819
|
-
return this.node(
|
|
1821
|
+
return this.node(e, {
|
|
1820
1822
|
kind: c.OBJECT_TYPE_EXTENSION,
|
|
1821
|
-
name:
|
|
1823
|
+
name: n,
|
|
1822
1824
|
interfaces: i,
|
|
1823
1825
|
directives: r,
|
|
1824
1826
|
fields: s
|
|
@@ -1831,14 +1833,14 @@ class tt {
|
|
|
1831
1833
|
* - extend interface Name ImplementsInterfaces
|
|
1832
1834
|
*/
|
|
1833
1835
|
parseInterfaceTypeExtension() {
|
|
1834
|
-
const
|
|
1836
|
+
const e = this._lexer.token;
|
|
1835
1837
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1836
|
-
const
|
|
1838
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1837
1839
|
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1838
1840
|
throw this.unexpected();
|
|
1839
|
-
return this.node(
|
|
1841
|
+
return this.node(e, {
|
|
1840
1842
|
kind: c.INTERFACE_TYPE_EXTENSION,
|
|
1841
|
-
name:
|
|
1843
|
+
name: n,
|
|
1842
1844
|
interfaces: i,
|
|
1843
1845
|
directives: r,
|
|
1844
1846
|
fields: s
|
|
@@ -1850,14 +1852,14 @@ class tt {
|
|
|
1850
1852
|
* - extend union Name Directives[Const]
|
|
1851
1853
|
*/
|
|
1852
1854
|
parseUnionTypeExtension() {
|
|
1853
|
-
const
|
|
1855
|
+
const e = this._lexer.token;
|
|
1854
1856
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1855
|
-
const
|
|
1857
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
1856
1858
|
if (i.length === 0 && r.length === 0)
|
|
1857
1859
|
throw this.unexpected();
|
|
1858
|
-
return this.node(
|
|
1860
|
+
return this.node(e, {
|
|
1859
1861
|
kind: c.UNION_TYPE_EXTENSION,
|
|
1860
|
-
name:
|
|
1862
|
+
name: n,
|
|
1861
1863
|
directives: i,
|
|
1862
1864
|
types: r
|
|
1863
1865
|
});
|
|
@@ -1868,14 +1870,14 @@ class tt {
|
|
|
1868
1870
|
* - extend enum Name Directives[Const]
|
|
1869
1871
|
*/
|
|
1870
1872
|
parseEnumTypeExtension() {
|
|
1871
|
-
const
|
|
1873
|
+
const e = this._lexer.token;
|
|
1872
1874
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1873
|
-
const
|
|
1875
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
1874
1876
|
if (i.length === 0 && r.length === 0)
|
|
1875
1877
|
throw this.unexpected();
|
|
1876
|
-
return this.node(
|
|
1878
|
+
return this.node(e, {
|
|
1877
1879
|
kind: c.ENUM_TYPE_EXTENSION,
|
|
1878
|
-
name:
|
|
1880
|
+
name: n,
|
|
1879
1881
|
directives: i,
|
|
1880
1882
|
values: r
|
|
1881
1883
|
});
|
|
@@ -1886,14 +1888,14 @@ class tt {
|
|
|
1886
1888
|
* - extend input Name Directives[Const]
|
|
1887
1889
|
*/
|
|
1888
1890
|
parseInputObjectTypeExtension() {
|
|
1889
|
-
const
|
|
1891
|
+
const e = this._lexer.token;
|
|
1890
1892
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1891
|
-
const
|
|
1893
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
1892
1894
|
if (i.length === 0 && r.length === 0)
|
|
1893
1895
|
throw this.unexpected();
|
|
1894
|
-
return this.node(
|
|
1896
|
+
return this.node(e, {
|
|
1895
1897
|
kind: c.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1896
|
-
name:
|
|
1898
|
+
name: n,
|
|
1897
1899
|
directives: i,
|
|
1898
1900
|
fields: r
|
|
1899
1901
|
});
|
|
@@ -1905,14 +1907,14 @@ class tt {
|
|
|
1905
1907
|
* ```
|
|
1906
1908
|
*/
|
|
1907
1909
|
parseDirectiveDefinition() {
|
|
1908
|
-
const
|
|
1910
|
+
const e = this._lexer.token, n = this.parseDescription();
|
|
1909
1911
|
this.expectKeyword("directive"), this.expectToken(a.AT);
|
|
1910
1912
|
const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1911
1913
|
this.expectKeyword("on");
|
|
1912
1914
|
const o = this.parseDirectiveLocations();
|
|
1913
|
-
return this.node(
|
|
1915
|
+
return this.node(e, {
|
|
1914
1916
|
kind: c.DIRECTIVE_DEFINITION,
|
|
1915
|
-
description:
|
|
1917
|
+
description: n,
|
|
1916
1918
|
name: i,
|
|
1917
1919
|
arguments: r,
|
|
1918
1920
|
repeatable: s,
|
|
@@ -1955,10 +1957,10 @@ class tt {
|
|
|
1955
1957
|
* `INPUT_FIELD_DEFINITION`
|
|
1956
1958
|
*/
|
|
1957
1959
|
parseDirectiveLocation() {
|
|
1958
|
-
const
|
|
1959
|
-
if (Object.prototype.hasOwnProperty.call(q,
|
|
1960
|
-
return
|
|
1961
|
-
throw this.unexpected(
|
|
1960
|
+
const e = this._lexer.token, n = this.parseName();
|
|
1961
|
+
if (Object.prototype.hasOwnProperty.call(q, n.value))
|
|
1962
|
+
return n;
|
|
1963
|
+
throw this.unexpected(e);
|
|
1962
1964
|
}
|
|
1963
1965
|
// Schema Coordinates
|
|
1964
1966
|
/**
|
|
@@ -1970,27 +1972,27 @@ class tt {
|
|
|
1970
1972
|
* - \@ Name ( Name : )
|
|
1971
1973
|
*/
|
|
1972
1974
|
parseSchemaCoordinate() {
|
|
1973
|
-
const
|
|
1975
|
+
const e = this._lexer.token, n = this.expectOptionalToken(a.AT), i = this.parseName();
|
|
1974
1976
|
let r;
|
|
1975
|
-
!
|
|
1977
|
+
!n && this.expectOptionalToken(a.DOT) && (r = this.parseName());
|
|
1976
1978
|
let s;
|
|
1977
|
-
return (
|
|
1979
|
+
return (n || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(e, {
|
|
1978
1980
|
kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
|
|
1979
1981
|
name: i,
|
|
1980
1982
|
argumentName: s
|
|
1981
|
-
}) : this.node(
|
|
1983
|
+
}) : this.node(e, {
|
|
1982
1984
|
kind: c.DIRECTIVE_COORDINATE,
|
|
1983
1985
|
name: i
|
|
1984
|
-
}) : r ? s ? this.node(
|
|
1986
|
+
}) : r ? s ? this.node(e, {
|
|
1985
1987
|
kind: c.ARGUMENT_COORDINATE,
|
|
1986
1988
|
name: i,
|
|
1987
1989
|
fieldName: r,
|
|
1988
1990
|
argumentName: s
|
|
1989
|
-
}) : this.node(
|
|
1991
|
+
}) : this.node(e, {
|
|
1990
1992
|
kind: c.MEMBER_COORDINATE,
|
|
1991
1993
|
name: i,
|
|
1992
1994
|
memberName: r
|
|
1993
|
-
}) : this.node(
|
|
1995
|
+
}) : this.node(e, {
|
|
1994
1996
|
kind: c.TYPE_COORDINATE,
|
|
1995
1997
|
name: i
|
|
1996
1998
|
});
|
|
@@ -2001,72 +2003,72 @@ class tt {
|
|
|
2001
2003
|
* location object, used to identify the place in the source that created a
|
|
2002
2004
|
* given parsed object.
|
|
2003
2005
|
*/
|
|
2004
|
-
node(
|
|
2005
|
-
return this._options.noLocation !== !0 && (
|
|
2006
|
-
|
|
2006
|
+
node(e, n) {
|
|
2007
|
+
return this._options.noLocation !== !0 && (n.loc = new Se(
|
|
2008
|
+
e,
|
|
2007
2009
|
this._lexer.lastToken,
|
|
2008
2010
|
this._lexer.source
|
|
2009
|
-
)),
|
|
2011
|
+
)), n;
|
|
2010
2012
|
}
|
|
2011
2013
|
/**
|
|
2012
2014
|
* Determines if the next token is of a given kind
|
|
2013
2015
|
*/
|
|
2014
|
-
peek(
|
|
2015
|
-
return this._lexer.token.kind ===
|
|
2016
|
+
peek(e) {
|
|
2017
|
+
return this._lexer.token.kind === e;
|
|
2016
2018
|
}
|
|
2017
2019
|
/**
|
|
2018
2020
|
* If the next token is of the given kind, return that token after advancing the lexer.
|
|
2019
2021
|
* Otherwise, do not change the parser state and throw an error.
|
|
2020
2022
|
*/
|
|
2021
|
-
expectToken(
|
|
2022
|
-
const
|
|
2023
|
-
if (
|
|
2024
|
-
return this.advanceLexer(),
|
|
2023
|
+
expectToken(e) {
|
|
2024
|
+
const n = this._lexer.token;
|
|
2025
|
+
if (n.kind === e)
|
|
2026
|
+
return this.advanceLexer(), n;
|
|
2025
2027
|
throw I(
|
|
2026
2028
|
this._lexer.source,
|
|
2027
|
-
|
|
2028
|
-
`Expected ${
|
|
2029
|
+
n.start,
|
|
2030
|
+
`Expected ${Ee(e)}, found ${_(n)}.`
|
|
2029
2031
|
);
|
|
2030
2032
|
}
|
|
2031
2033
|
/**
|
|
2032
2034
|
* If the next token is of the given kind, return "true" after advancing the lexer.
|
|
2033
2035
|
* Otherwise, do not change the parser state and return "false".
|
|
2034
2036
|
*/
|
|
2035
|
-
expectOptionalToken(
|
|
2036
|
-
return this._lexer.token.kind ===
|
|
2037
|
+
expectOptionalToken(e) {
|
|
2038
|
+
return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
|
|
2037
2039
|
}
|
|
2038
2040
|
/**
|
|
2039
2041
|
* If the next token is a given keyword, advance the lexer.
|
|
2040
2042
|
* Otherwise, do not change the parser state and throw an error.
|
|
2041
2043
|
*/
|
|
2042
|
-
expectKeyword(
|
|
2043
|
-
const
|
|
2044
|
-
if (
|
|
2044
|
+
expectKeyword(e) {
|
|
2045
|
+
const n = this._lexer.token;
|
|
2046
|
+
if (n.kind === a.NAME && n.value === e)
|
|
2045
2047
|
this.advanceLexer();
|
|
2046
2048
|
else
|
|
2047
2049
|
throw I(
|
|
2048
2050
|
this._lexer.source,
|
|
2049
|
-
|
|
2050
|
-
`Expected "${
|
|
2051
|
+
n.start,
|
|
2052
|
+
`Expected "${e}", found ${_(n)}.`
|
|
2051
2053
|
);
|
|
2052
2054
|
}
|
|
2053
2055
|
/**
|
|
2054
2056
|
* If the next token is a given keyword, return "true" after advancing the lexer.
|
|
2055
2057
|
* Otherwise, do not change the parser state and return "false".
|
|
2056
2058
|
*/
|
|
2057
|
-
expectOptionalKeyword(
|
|
2058
|
-
const
|
|
2059
|
-
return
|
|
2059
|
+
expectOptionalKeyword(e) {
|
|
2060
|
+
const n = this._lexer.token;
|
|
2061
|
+
return n.kind === a.NAME && n.value === e ? (this.advanceLexer(), !0) : !1;
|
|
2060
2062
|
}
|
|
2061
2063
|
/**
|
|
2062
2064
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
2063
2065
|
*/
|
|
2064
|
-
unexpected(
|
|
2065
|
-
const
|
|
2066
|
+
unexpected(e) {
|
|
2067
|
+
const n = e ?? this._lexer.token;
|
|
2066
2068
|
return I(
|
|
2067
2069
|
this._lexer.source,
|
|
2068
|
-
|
|
2069
|
-
`Unexpected ${_(
|
|
2070
|
+
n.start,
|
|
2071
|
+
`Unexpected ${_(n)}.`
|
|
2070
2072
|
);
|
|
2071
2073
|
}
|
|
2072
2074
|
/**
|
|
@@ -2074,11 +2076,11 @@ class tt {
|
|
|
2074
2076
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2075
2077
|
* Advances the parser to the next lex token after the closing token.
|
|
2076
2078
|
*/
|
|
2077
|
-
any(
|
|
2078
|
-
this.expectToken(
|
|
2079
|
+
any(e, n, i) {
|
|
2080
|
+
this.expectToken(e);
|
|
2079
2081
|
const r = [];
|
|
2080
2082
|
for (; !this.expectOptionalToken(i); )
|
|
2081
|
-
r.push(
|
|
2083
|
+
r.push(n.call(this));
|
|
2082
2084
|
return r;
|
|
2083
2085
|
}
|
|
2084
2086
|
/**
|
|
@@ -2087,11 +2089,11 @@ class tt {
|
|
|
2087
2089
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2088
2090
|
* Advances the parser to the next lex token after the closing token.
|
|
2089
2091
|
*/
|
|
2090
|
-
optionalMany(
|
|
2091
|
-
if (this.expectOptionalToken(
|
|
2092
|
+
optionalMany(e, n, i) {
|
|
2093
|
+
if (this.expectOptionalToken(e)) {
|
|
2092
2094
|
const r = [];
|
|
2093
2095
|
do
|
|
2094
|
-
r.push(
|
|
2096
|
+
r.push(n.call(this));
|
|
2095
2097
|
while (!this.expectOptionalToken(i));
|
|
2096
2098
|
return r;
|
|
2097
2099
|
}
|
|
@@ -2102,11 +2104,11 @@ class tt {
|
|
|
2102
2104
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2103
2105
|
* Advances the parser to the next lex token after the closing token.
|
|
2104
2106
|
*/
|
|
2105
|
-
many(
|
|
2106
|
-
this.expectToken(
|
|
2107
|
+
many(e, n, i) {
|
|
2108
|
+
this.expectToken(e);
|
|
2107
2109
|
const r = [];
|
|
2108
2110
|
do
|
|
2109
|
-
r.push(
|
|
2111
|
+
r.push(n.call(this));
|
|
2110
2112
|
while (!this.expectOptionalToken(i));
|
|
2111
2113
|
return r;
|
|
2112
2114
|
}
|
|
@@ -2115,107 +2117,107 @@ class tt {
|
|
|
2115
2117
|
* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
|
|
2116
2118
|
* Advances the parser to the next lex token after last item in the list.
|
|
2117
2119
|
*/
|
|
2118
|
-
delimitedMany(
|
|
2119
|
-
this.expectOptionalToken(
|
|
2120
|
+
delimitedMany(e, n) {
|
|
2121
|
+
this.expectOptionalToken(e);
|
|
2120
2122
|
const i = [];
|
|
2121
2123
|
do
|
|
2122
|
-
i.push(
|
|
2123
|
-
while (this.expectOptionalToken(
|
|
2124
|
+
i.push(n.call(this));
|
|
2125
|
+
while (this.expectOptionalToken(e));
|
|
2124
2126
|
return i;
|
|
2125
2127
|
}
|
|
2126
2128
|
advanceLexer() {
|
|
2127
|
-
const { maxTokens:
|
|
2128
|
-
if (
|
|
2129
|
+
const { maxTokens: e } = this._options, n = this._lexer.advance();
|
|
2130
|
+
if (n.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e))
|
|
2129
2131
|
throw I(
|
|
2130
2132
|
this._lexer.source,
|
|
2131
|
-
|
|
2132
|
-
`Document contains more that ${
|
|
2133
|
+
n.start,
|
|
2134
|
+
`Document contains more that ${e} tokens. Parsing aborted.`
|
|
2133
2135
|
);
|
|
2134
2136
|
}
|
|
2135
2137
|
}
|
|
2136
2138
|
function _(t) {
|
|
2137
|
-
const
|
|
2138
|
-
return
|
|
2139
|
+
const e = t.value;
|
|
2140
|
+
return Ee(t.kind) + (e != null ? ` "${e}"` : "");
|
|
2139
2141
|
}
|
|
2140
|
-
function
|
|
2142
|
+
function Ee(t) {
|
|
2141
2143
|
return we(t) ? `"${t}"` : t;
|
|
2142
2144
|
}
|
|
2143
|
-
var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(),
|
|
2144
|
-
function
|
|
2145
|
+
var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), ye = !0, $ = !1;
|
|
2146
|
+
function ke(t) {
|
|
2145
2147
|
return t.replace(/[\s,]+/g, " ").trim();
|
|
2146
2148
|
}
|
|
2147
|
-
function nt(t) {
|
|
2148
|
-
return ye(t.source.body.substring(t.start, t.end));
|
|
2149
|
-
}
|
|
2150
2149
|
function it(t) {
|
|
2151
|
-
|
|
2150
|
+
return ke(t.source.body.substring(t.start, t.end));
|
|
2151
|
+
}
|
|
2152
|
+
function rt(t) {
|
|
2153
|
+
var e = /* @__PURE__ */ new Set(), n = [];
|
|
2152
2154
|
return t.definitions.forEach(function(i) {
|
|
2153
2155
|
if (i.kind === "FragmentDefinition") {
|
|
2154
|
-
var r = i.name.value, s =
|
|
2155
|
-
o && !o.has(s) ?
|
|
2156
|
+
var r = i.name.value, s = it(i.loc), o = G.get(r);
|
|
2157
|
+
o && !o.has(s) ? ye && console.warn("Warning: fragment with name " + r + ` already exists.
|
|
2156
2158
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
2157
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(r, o = /* @__PURE__ */ new Set()), o.add(s),
|
|
2159
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(r, o = /* @__PURE__ */ new Set()), o.add(s), e.has(s) || (e.add(s), n.push(i));
|
|
2158
2160
|
} else
|
|
2159
|
-
|
|
2160
|
-
}),
|
|
2161
|
+
n.push(i);
|
|
2162
|
+
}), w(w({}, t), { definitions: n });
|
|
2161
2163
|
}
|
|
2162
|
-
function
|
|
2163
|
-
var
|
|
2164
|
-
|
|
2164
|
+
function st(t) {
|
|
2165
|
+
var e = new Set(t.definitions);
|
|
2166
|
+
e.forEach(function(i) {
|
|
2165
2167
|
i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
|
|
2166
2168
|
var s = i[r];
|
|
2167
|
-
s && typeof s == "object" &&
|
|
2169
|
+
s && typeof s == "object" && e.add(s);
|
|
2168
2170
|
});
|
|
2169
2171
|
});
|
|
2170
|
-
var
|
|
2171
|
-
return
|
|
2172
|
+
var n = t.loc;
|
|
2173
|
+
return n && (delete n.startToken, delete n.endToken), t;
|
|
2172
2174
|
}
|
|
2173
|
-
function
|
|
2174
|
-
var
|
|
2175
|
-
if (!L.has(
|
|
2176
|
-
var
|
|
2175
|
+
function at(t) {
|
|
2176
|
+
var e = ke(t);
|
|
2177
|
+
if (!L.has(e)) {
|
|
2178
|
+
var n = tt(t, {
|
|
2177
2179
|
experimentalFragmentVariables: $,
|
|
2178
2180
|
allowLegacyFragmentVariables: $
|
|
2179
2181
|
});
|
|
2180
|
-
if (!
|
|
2182
|
+
if (!n || n.kind !== "Document")
|
|
2181
2183
|
throw new Error("Not a valid GraphQL document.");
|
|
2182
|
-
L.set(
|
|
2184
|
+
L.set(e, st(rt(n)));
|
|
2183
2185
|
}
|
|
2184
|
-
return L.get(
|
|
2186
|
+
return L.get(e);
|
|
2185
2187
|
}
|
|
2186
|
-
function
|
|
2187
|
-
for (var
|
|
2188
|
-
n
|
|
2188
|
+
function u(t) {
|
|
2189
|
+
for (var e = [], n = 1; n < arguments.length; n++)
|
|
2190
|
+
e[n - 1] = arguments[n];
|
|
2189
2191
|
typeof t == "string" && (t = [t]);
|
|
2190
2192
|
var i = t[0];
|
|
2191
|
-
return
|
|
2193
|
+
return e.forEach(function(r, s) {
|
|
2192
2194
|
r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += t[s + 1];
|
|
2193
|
-
}),
|
|
2194
|
-
}
|
|
2195
|
-
function at() {
|
|
2196
|
-
L.clear(), G.clear();
|
|
2195
|
+
}), at(i);
|
|
2197
2196
|
}
|
|
2198
2197
|
function ot() {
|
|
2199
|
-
|
|
2198
|
+
L.clear(), G.clear();
|
|
2200
2199
|
}
|
|
2201
2200
|
function ct() {
|
|
2202
|
-
|
|
2201
|
+
ye = !1;
|
|
2203
2202
|
}
|
|
2204
2203
|
function dt() {
|
|
2204
|
+
$ = !0;
|
|
2205
|
+
}
|
|
2206
|
+
function ut() {
|
|
2205
2207
|
$ = !1;
|
|
2206
2208
|
}
|
|
2207
|
-
var
|
|
2208
|
-
gql:
|
|
2209
|
-
resetCaches:
|
|
2210
|
-
disableFragmentWarnings:
|
|
2211
|
-
enableExperimentalFragmentVariables:
|
|
2212
|
-
disableExperimentalFragmentVariables:
|
|
2209
|
+
var b = {
|
|
2210
|
+
gql: u,
|
|
2211
|
+
resetCaches: ot,
|
|
2212
|
+
disableFragmentWarnings: ct,
|
|
2213
|
+
enableExperimentalFragmentVariables: dt,
|
|
2214
|
+
disableExperimentalFragmentVariables: ut
|
|
2213
2215
|
};
|
|
2214
2216
|
(function(t) {
|
|
2215
|
-
t.gql =
|
|
2216
|
-
})(
|
|
2217
|
-
|
|
2218
|
-
const
|
|
2217
|
+
t.gql = b.gql, t.resetCaches = b.resetCaches, t.disableFragmentWarnings = b.disableFragmentWarnings, t.enableExperimentalFragmentVariables = b.enableExperimentalFragmentVariables, t.disableExperimentalFragmentVariables = b.disableExperimentalFragmentVariables;
|
|
2218
|
+
})(u || (u = {}));
|
|
2219
|
+
u.default = u;
|
|
2220
|
+
const lt = u`
|
|
2219
2221
|
query findActiveOrderById($id: String) {
|
|
2220
2222
|
findOrder(id: $id) {
|
|
2221
2223
|
id
|
|
@@ -2302,7 +2304,7 @@ const ut = l`
|
|
|
2302
2304
|
}
|
|
2303
2305
|
}
|
|
2304
2306
|
}
|
|
2305
|
-
`,
|
|
2307
|
+
`, pt = u`
|
|
2306
2308
|
query findOrderById($id: String, $reference: String) {
|
|
2307
2309
|
findOrder(id: $id, reference: $reference) {
|
|
2308
2310
|
id
|
|
@@ -2346,7 +2348,7 @@ const ut = l`
|
|
|
2346
2348
|
downloadCode
|
|
2347
2349
|
}
|
|
2348
2350
|
}
|
|
2349
|
-
`, ht =
|
|
2351
|
+
`, ht = u`
|
|
2350
2352
|
mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
|
|
2351
2353
|
reserveProduct(
|
|
2352
2354
|
input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
|
|
@@ -2356,7 +2358,7 @@ const ut = l`
|
|
|
2356
2358
|
amountReserved
|
|
2357
2359
|
}
|
|
2358
2360
|
}
|
|
2359
|
-
`,
|
|
2361
|
+
`, gt = u`
|
|
2360
2362
|
mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
|
|
2361
2363
|
releaseProduct(
|
|
2362
2364
|
input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
|
|
@@ -2365,7 +2367,7 @@ const ut = l`
|
|
|
2365
2367
|
amountReleased
|
|
2366
2368
|
}
|
|
2367
2369
|
}
|
|
2368
|
-
`, mt =
|
|
2370
|
+
`, mt = u`
|
|
2369
2371
|
mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
|
|
2370
2372
|
configurePackage(
|
|
2371
2373
|
input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
|
|
@@ -2375,7 +2377,7 @@ const ut = l`
|
|
|
2375
2377
|
amountReserved
|
|
2376
2378
|
}
|
|
2377
2379
|
}
|
|
2378
|
-
`, ft =
|
|
2380
|
+
`, ft = u`
|
|
2379
2381
|
mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
|
|
2380
2382
|
reserveAdditionalPackageItem(
|
|
2381
2383
|
input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
|
|
@@ -2385,158 +2387,158 @@ const ut = l`
|
|
|
2385
2387
|
amountReserved
|
|
2386
2388
|
}
|
|
2387
2389
|
}
|
|
2388
|
-
`,
|
|
2390
|
+
`, It = u`
|
|
2389
2391
|
mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
|
|
2390
2392
|
configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
|
|
2391
2393
|
}
|
|
2392
|
-
`,
|
|
2394
|
+
`, Et = u`
|
|
2393
2395
|
mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
|
|
2394
2396
|
createOrderCustomer(
|
|
2395
2397
|
input: {id: $orderId, countryCode: $countryCode, customer: $customer}
|
|
2396
2398
|
)
|
|
2397
2399
|
}
|
|
2398
|
-
`,
|
|
2400
|
+
`, yt = u`
|
|
2399
2401
|
mutation deleteOrder($orderId: ID!) {
|
|
2400
2402
|
cancelOrder(id: $orderId)
|
|
2401
2403
|
}
|
|
2402
|
-
`,
|
|
2403
|
-
function Ot(t,
|
|
2404
|
+
`, kt = (t, e, n, i) => t();
|
|
2405
|
+
function Ot(t, e = kt) {
|
|
2404
2406
|
return {
|
|
2405
|
-
findActiveOrderById(
|
|
2406
|
-
return
|
|
2407
|
+
findActiveOrderById(n, i, r) {
|
|
2408
|
+
return e((s) => t.request({ document: lt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
|
|
2407
2409
|
},
|
|
2408
|
-
findOrderById(
|
|
2409
|
-
return
|
|
2410
|
+
findOrderById(n, i, r) {
|
|
2411
|
+
return e((s) => t.request({ document: pt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", n);
|
|
2410
2412
|
},
|
|
2411
|
-
addToOrder(
|
|
2412
|
-
return
|
|
2413
|
+
addToOrder(n, i, r) {
|
|
2414
|
+
return e((s) => t.request({ document: ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
|
|
2413
2415
|
},
|
|
2414
|
-
removeFromOrder(
|
|
2415
|
-
return
|
|
2416
|
+
removeFromOrder(n, i, r) {
|
|
2417
|
+
return e((s) => t.request({ document: gt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
|
|
2416
2418
|
},
|
|
2417
|
-
configurePackage(
|
|
2418
|
-
return
|
|
2419
|
+
configurePackage(n, i, r) {
|
|
2420
|
+
return e((s) => t.request({ document: mt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
|
|
2419
2421
|
},
|
|
2420
|
-
reserveAdditionalPackageItem(
|
|
2421
|
-
return
|
|
2422
|
+
reserveAdditionalPackageItem(n, i, r) {
|
|
2423
|
+
return e((s) => t.request({ document: ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", n);
|
|
2422
2424
|
},
|
|
2423
|
-
configureOrderDeliveryOption(
|
|
2424
|
-
return
|
|
2425
|
+
configureOrderDeliveryOption(n, i, r) {
|
|
2426
|
+
return e((s) => t.request({ document: It, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
|
|
2425
2427
|
},
|
|
2426
|
-
createOrderCustomer(
|
|
2427
|
-
return
|
|
2428
|
+
createOrderCustomer(n, i, r) {
|
|
2429
|
+
return e((s) => t.request({ document: Et, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
|
|
2428
2430
|
},
|
|
2429
|
-
deleteOrder(
|
|
2430
|
-
return
|
|
2431
|
+
deleteOrder(n, i, r) {
|
|
2432
|
+
return e((s) => t.request({ document: yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
|
|
2431
2433
|
}
|
|
2432
2434
|
};
|
|
2433
2435
|
}
|
|
2434
|
-
class
|
|
2436
|
+
class At {
|
|
2435
2437
|
config;
|
|
2436
2438
|
sdk;
|
|
2437
|
-
constructor(
|
|
2438
|
-
this.config =
|
|
2439
|
+
constructor(e) {
|
|
2440
|
+
this.config = e, this.sdk = Ot(new N(e.apiUrl));
|
|
2439
2441
|
}
|
|
2440
2442
|
// Basket update functions
|
|
2441
|
-
async addProduct(n,
|
|
2443
|
+
async addProduct(e, n, i) {
|
|
2442
2444
|
try {
|
|
2443
2445
|
return this.debugLog("Adding product", {
|
|
2444
|
-
productId:
|
|
2445
|
-
orderId:
|
|
2446
|
-
amount:
|
|
2447
|
-
seat:
|
|
2446
|
+
productId: n.id,
|
|
2447
|
+
orderId: e,
|
|
2448
|
+
amount: n.amount,
|
|
2449
|
+
seat: n.seat
|
|
2448
2450
|
}), (await this.sdk.addToOrder({
|
|
2449
|
-
productId:
|
|
2450
|
-
orderId:
|
|
2451
|
-
additionalData:
|
|
2451
|
+
productId: n.id,
|
|
2452
|
+
orderId: e,
|
|
2453
|
+
additionalData: n.seat ? {
|
|
2452
2454
|
seat: {
|
|
2453
|
-
seatId:
|
|
2454
|
-
seatLabel:
|
|
2455
|
-
holdToken:
|
|
2455
|
+
seatId: n.seat.id,
|
|
2456
|
+
seatLabel: n.seat.label,
|
|
2457
|
+
holdToken: n.seat.holdToken
|
|
2456
2458
|
}
|
|
2457
2459
|
} : null,
|
|
2458
2460
|
trackerId: this.config.trackerId,
|
|
2459
|
-
shopId:
|
|
2460
|
-
amount:
|
|
2461
|
+
shopId: i,
|
|
2462
|
+
amount: n.amount
|
|
2461
2463
|
})).reserveProduct;
|
|
2462
|
-
} catch (
|
|
2463
|
-
throw this.debugLog("Error adding product",
|
|
2464
|
+
} catch (r) {
|
|
2465
|
+
throw this.debugLog("Error adding product", r), this.handleError(r), r;
|
|
2464
2466
|
}
|
|
2465
2467
|
}
|
|
2466
|
-
async removeProduct(
|
|
2468
|
+
async removeProduct(e, n) {
|
|
2467
2469
|
try {
|
|
2468
2470
|
return this.debugLog("Removing product", {
|
|
2469
|
-
productId:
|
|
2470
|
-
orderId:
|
|
2471
|
-
amount:
|
|
2471
|
+
productId: n.id,
|
|
2472
|
+
orderId: e,
|
|
2473
|
+
amount: n.amount
|
|
2472
2474
|
}), (await this.sdk.removeFromOrder({
|
|
2473
|
-
productId:
|
|
2474
|
-
orderId:
|
|
2475
|
-
additionalData:
|
|
2475
|
+
productId: n.id,
|
|
2476
|
+
orderId: e,
|
|
2477
|
+
additionalData: n.seat ? {
|
|
2476
2478
|
seat: {
|
|
2477
|
-
seatId:
|
|
2478
|
-
seatLabel:
|
|
2479
|
+
seatId: n.seat.id,
|
|
2480
|
+
seatLabel: n.seat.label
|
|
2479
2481
|
}
|
|
2480
2482
|
} : null,
|
|
2481
|
-
amount:
|
|
2483
|
+
amount: n.amount
|
|
2482
2484
|
})).releaseProduct ?? null;
|
|
2483
2485
|
} catch (i) {
|
|
2484
2486
|
throw this.debugLog("Error removing product", i), this.handleError(i), i;
|
|
2485
2487
|
}
|
|
2486
2488
|
}
|
|
2487
|
-
async configurePackage(n,
|
|
2489
|
+
async configurePackage(e, n, i) {
|
|
2488
2490
|
try {
|
|
2489
|
-
const
|
|
2490
|
-
packageItemId:
|
|
2491
|
-
eventId:
|
|
2491
|
+
const r = n.items.map((o) => ({
|
|
2492
|
+
packageItemId: o.packageItemId,
|
|
2493
|
+
eventId: o.eventId
|
|
2492
2494
|
}));
|
|
2493
2495
|
this.debugLog("Configuring package", {
|
|
2494
|
-
packageId:
|
|
2495
|
-
orderId:
|
|
2496
|
-
amount:
|
|
2497
|
-
items:
|
|
2498
|
-
shopId:
|
|
2496
|
+
packageId: n.id,
|
|
2497
|
+
orderId: e,
|
|
2498
|
+
amount: n.amount,
|
|
2499
|
+
items: r,
|
|
2500
|
+
shopId: i
|
|
2499
2501
|
});
|
|
2500
|
-
const
|
|
2502
|
+
const s = await this.sdk.configurePackage({
|
|
2501
2503
|
trackerId: this.config.trackerId,
|
|
2502
|
-
shopId:
|
|
2503
|
-
packageId:
|
|
2504
|
-
orderId:
|
|
2505
|
-
amount:
|
|
2506
|
-
items:
|
|
2504
|
+
shopId: i,
|
|
2505
|
+
packageId: n.id,
|
|
2506
|
+
orderId: e,
|
|
2507
|
+
amount: n.amount,
|
|
2508
|
+
items: r
|
|
2507
2509
|
});
|
|
2508
|
-
return this.debugLog("Configure package response"),
|
|
2509
|
-
} catch (
|
|
2510
|
-
throw this.debugLog("Error configuring package",
|
|
2510
|
+
return this.debugLog("Configure package response"), s.configurePackage ?? null;
|
|
2511
|
+
} catch (r) {
|
|
2512
|
+
throw this.debugLog("Error configuring package", r), this.handleError(r), r;
|
|
2511
2513
|
}
|
|
2512
2514
|
}
|
|
2513
|
-
async configureCustomer(
|
|
2514
|
-
this.debugLog("Creating/replacing customer", { orderId:
|
|
2515
|
+
async configureCustomer(e, n) {
|
|
2516
|
+
this.debugLog("Creating/replacing customer", { orderId: e, email: n.email });
|
|
2515
2517
|
try {
|
|
2516
2518
|
const i = await this.sdk.createOrderCustomer({
|
|
2517
|
-
orderId:
|
|
2518
|
-
customer:
|
|
2519
|
+
orderId: e,
|
|
2520
|
+
customer: n
|
|
2519
2521
|
});
|
|
2520
2522
|
this.debugLog("Customer set successfully", i);
|
|
2521
2523
|
} catch (i) {
|
|
2522
2524
|
throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
|
|
2523
2525
|
}
|
|
2524
2526
|
}
|
|
2525
|
-
async reserveAdditionalPackageItem(
|
|
2527
|
+
async reserveAdditionalPackageItem(e, n) {
|
|
2526
2528
|
try {
|
|
2527
2529
|
this.debugLog("reserve additional packageItem", {
|
|
2528
|
-
orderId:
|
|
2529
|
-
eventId:
|
|
2530
|
-
amount:
|
|
2531
|
-
packageId:
|
|
2532
|
-
packageItemId:
|
|
2530
|
+
orderId: e,
|
|
2531
|
+
eventId: n.eventId,
|
|
2532
|
+
amount: n.amount,
|
|
2533
|
+
packageId: n.packageId,
|
|
2534
|
+
packageItemId: n.packageItemId
|
|
2533
2535
|
});
|
|
2534
2536
|
const i = await this.sdk.reserveAdditionalPackageItem({
|
|
2535
|
-
orderId:
|
|
2536
|
-
eventId:
|
|
2537
|
-
amount:
|
|
2538
|
-
packageId:
|
|
2539
|
-
packageItemId:
|
|
2537
|
+
orderId: e,
|
|
2538
|
+
eventId: n.eventId,
|
|
2539
|
+
amount: n.amount,
|
|
2540
|
+
packageId: n.packageId,
|
|
2541
|
+
packageItemId: n.packageItemId
|
|
2540
2542
|
});
|
|
2541
2543
|
return this.debugLog("reserve additional packageItem"), i.reserveAdditionalPackageItem ?? null;
|
|
2542
2544
|
} catch (i) {
|
|
@@ -2544,12 +2546,12 @@ class kt {
|
|
|
2544
2546
|
}
|
|
2545
2547
|
}
|
|
2546
2548
|
// Cancel and clear order functions
|
|
2547
|
-
async cancelOrder(
|
|
2548
|
-
|
|
2549
|
+
async cancelOrder(e) {
|
|
2550
|
+
e && (this.debugLog("Cancelling order", { orderId: e }), await this.sdk.deleteOrder({ orderId: e }), this.debugLog("Order cancelled successfully"));
|
|
2549
2551
|
}
|
|
2550
|
-
async findOrder(
|
|
2552
|
+
async findOrder(e, n) {
|
|
2551
2553
|
try {
|
|
2552
|
-
const i = await this.sdk.findOrderById({ id:
|
|
2554
|
+
const i = await this.sdk.findOrderById({ id: e, reference: n });
|
|
2553
2555
|
return i.findOrder ? {
|
|
2554
2556
|
id: i.findOrder.id,
|
|
2555
2557
|
reference: i.findOrder.reference,
|
|
@@ -2574,19 +2576,19 @@ class kt {
|
|
|
2574
2576
|
return this.debugLog("Error finding order", i), this.handleError(i), null;
|
|
2575
2577
|
}
|
|
2576
2578
|
}
|
|
2577
|
-
async findActiveOrder(
|
|
2578
|
-
this.debugLog("Fetching order from server", { orderId:
|
|
2579
|
+
async findActiveOrder(e) {
|
|
2580
|
+
this.debugLog("Fetching order from server", { orderId: e });
|
|
2579
2581
|
try {
|
|
2580
|
-
const
|
|
2581
|
-
if (!
|
|
2582
|
+
const n = await this.sdk.findActiveOrderById({ id: e });
|
|
2583
|
+
if (!n?.findOrder)
|
|
2582
2584
|
return null;
|
|
2583
|
-
const i =
|
|
2585
|
+
const i = n.findOrder;
|
|
2584
2586
|
this.debugLog("Order fetched successfully", i);
|
|
2585
2587
|
const r = i.items, s = r.filter((d) => d.product != null && d.amount > 0).map((d) => {
|
|
2586
|
-
let
|
|
2587
|
-
return d.product.type === "PROMOTER" ?
|
|
2588
|
+
let m = T.PRODUCT;
|
|
2589
|
+
return d.product.type === "PROMOTER" ? m = T.ADD_ONS : d.product.type === "PICKUP" ? m = T.PICKUP : d.product.type === "DELIVERY" && (m = T.DELIVERY), {
|
|
2588
2590
|
id: d.product.id,
|
|
2589
|
-
type:
|
|
2591
|
+
type: m,
|
|
2590
2592
|
name: d.product.name,
|
|
2591
2593
|
icon: d.product.icon,
|
|
2592
2594
|
description: d.product.description,
|
|
@@ -2600,18 +2602,18 @@ class kt {
|
|
|
2600
2602
|
label: y.label
|
|
2601
2603
|
}))
|
|
2602
2604
|
};
|
|
2603
|
-
}), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d,
|
|
2605
|
+
}), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
|
|
2604
2606
|
const {
|
|
2605
2607
|
packageItem: y,
|
|
2606
|
-
event:
|
|
2608
|
+
event: h,
|
|
2607
2609
|
amount: O,
|
|
2608
2610
|
price: C,
|
|
2609
2611
|
serviceFee: Y,
|
|
2610
2612
|
depositPrice: H,
|
|
2611
2613
|
originalPrice: J
|
|
2612
|
-
} =
|
|
2613
|
-
d[
|
|
2614
|
-
id:
|
|
2614
|
+
} = m, A = y.package.id;
|
|
2615
|
+
d[A] ? (d[A].price += C ?? 0, d[A].serviceFee += Y ?? 0, d[A].originalPrice += J ?? 0, d[A].depositPrice += H ?? C ?? 0) : d[A] = {
|
|
2616
|
+
id: A,
|
|
2615
2617
|
type: T.PACKAGE,
|
|
2616
2618
|
name: y.package.name,
|
|
2617
2619
|
amount: O,
|
|
@@ -2621,30 +2623,30 @@ class kt {
|
|
|
2621
2623
|
originalPrice: J ?? 0,
|
|
2622
2624
|
packageItems: []
|
|
2623
2625
|
};
|
|
2624
|
-
const Oe =
|
|
2625
|
-
zone:
|
|
2626
|
-
}),
|
|
2627
|
-
zone:
|
|
2626
|
+
const Oe = k.fromISO(h.startAt, {
|
|
2627
|
+
zone: h.timezone
|
|
2628
|
+
}), Ae = k.fromISO(h.endAt, {
|
|
2629
|
+
zone: h.timezone
|
|
2628
2630
|
});
|
|
2629
|
-
return d[
|
|
2631
|
+
return d[A].packageItems.push({
|
|
2630
2632
|
packageItemId: y.id,
|
|
2631
|
-
eventId:
|
|
2632
|
-
name:
|
|
2633
|
+
eventId: h.id,
|
|
2634
|
+
name: h.name,
|
|
2633
2635
|
startAt: Oe.toJSDate().toISOString(),
|
|
2634
|
-
endAt:
|
|
2636
|
+
endAt: Ae.toJSDate().toISOString()
|
|
2635
2637
|
}), d;
|
|
2636
|
-
}, {}),
|
|
2638
|
+
}, {}), l = [
|
|
2637
2639
|
...s,
|
|
2638
2640
|
...Object.values(o)
|
|
2639
|
-
],
|
|
2640
|
-
if (
|
|
2641
|
+
], p = l.reduce((d, m) => d + (m.amount || 0), 0);
|
|
2642
|
+
if (p === 0)
|
|
2641
2643
|
return null;
|
|
2642
|
-
const E = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()),
|
|
2644
|
+
const E = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), g = k.fromMillis(Math.min(...E));
|
|
2643
2645
|
return {
|
|
2644
2646
|
id: i.id,
|
|
2645
2647
|
currency: i.currency,
|
|
2646
|
-
expiredAt:
|
|
2647
|
-
items:
|
|
2648
|
+
expiredAt: g?.toJSDate().toISOString(),
|
|
2649
|
+
items: l,
|
|
2648
2650
|
customer: i.mainBooker ? {
|
|
2649
2651
|
firstName: i.mainBooker.firstName,
|
|
2650
2652
|
lastName: i.mainBooker.lastName,
|
|
@@ -2654,29 +2656,29 @@ class kt {
|
|
|
2654
2656
|
residence: i.mainBooker.residence,
|
|
2655
2657
|
extraInfo: i.mainBooker.extraInfo
|
|
2656
2658
|
} : null,
|
|
2657
|
-
count:
|
|
2659
|
+
count: p,
|
|
2658
2660
|
orderProtection: !1
|
|
2659
2661
|
};
|
|
2660
|
-
} catch (
|
|
2661
|
-
throw this.debugLog("Error fetching order",
|
|
2662
|
+
} catch (n) {
|
|
2663
|
+
throw this.debugLog("Error fetching order", n), n;
|
|
2662
2664
|
}
|
|
2663
2665
|
}
|
|
2664
|
-
debugLog(
|
|
2665
|
-
this.config.debug && console.log(`[BasketService] ${
|
|
2666
|
+
debugLog(e, n) {
|
|
2667
|
+
this.config.debug && console.log(`[BasketService] ${e}`, n || "");
|
|
2666
2668
|
}
|
|
2667
|
-
handleError(
|
|
2668
|
-
const
|
|
2669
|
-
if (
|
|
2670
|
-
const i =
|
|
2669
|
+
handleError(e) {
|
|
2670
|
+
const n = e;
|
|
2671
|
+
if (n.graphQLErrors && n.graphQLErrors.length > 0) {
|
|
2672
|
+
const i = n.graphQLErrors[0];
|
|
2671
2673
|
i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
|
|
2672
2674
|
}
|
|
2673
|
-
if (
|
|
2674
|
-
const i =
|
|
2675
|
+
if (n.response?.errors && n.response.errors.length > 0) {
|
|
2676
|
+
const i = n.response.errors[0];
|
|
2675
2677
|
console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
|
|
2676
2678
|
}
|
|
2677
2679
|
}
|
|
2678
2680
|
}
|
|
2679
|
-
const Tt =
|
|
2681
|
+
const Tt = u`
|
|
2680
2682
|
query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
|
|
2681
2683
|
findAllPublicEventByOrganizationId(
|
|
2682
2684
|
id: $organizationId
|
|
@@ -2721,7 +2723,7 @@ const Tt = l`
|
|
|
2721
2723
|
count
|
|
2722
2724
|
}
|
|
2723
2725
|
}
|
|
2724
|
-
`,
|
|
2726
|
+
`, Dt = u`
|
|
2725
2727
|
query EventDetailPage($eventId: ID!) {
|
|
2726
2728
|
findPublicEventById(id: $eventId) {
|
|
2727
2729
|
id
|
|
@@ -2753,7 +2755,39 @@ const Tt = l`
|
|
|
2753
2755
|
totalViews
|
|
2754
2756
|
}
|
|
2755
2757
|
}
|
|
2756
|
-
`, Nt =
|
|
2758
|
+
`, Nt = u`
|
|
2759
|
+
query FindPublicEventBySlug($organizationId: ID!, $slug: String!) {
|
|
2760
|
+
findPublicEventBySlug(organizationId: $organizationId, slug: $slug) {
|
|
2761
|
+
id
|
|
2762
|
+
name
|
|
2763
|
+
icon
|
|
2764
|
+
banner
|
|
2765
|
+
description
|
|
2766
|
+
addonDescription
|
|
2767
|
+
startAt
|
|
2768
|
+
endAt
|
|
2769
|
+
startSalesAt
|
|
2770
|
+
endSalesAt
|
|
2771
|
+
facebookPixelId
|
|
2772
|
+
timezone
|
|
2773
|
+
slug
|
|
2774
|
+
status
|
|
2775
|
+
location {
|
|
2776
|
+
id
|
|
2777
|
+
name
|
|
2778
|
+
address
|
|
2779
|
+
}
|
|
2780
|
+
hosting {
|
|
2781
|
+
id
|
|
2782
|
+
name
|
|
2783
|
+
}
|
|
2784
|
+
infoDescription
|
|
2785
|
+
maxAmountOfTicketsPerOrder
|
|
2786
|
+
startingPrice
|
|
2787
|
+
totalViews
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
`, vt = u`
|
|
2757
2791
|
query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
|
|
2758
2792
|
findPublicProductsByEventId(
|
|
2759
2793
|
eventId: $eventId
|
|
@@ -2769,6 +2803,7 @@ const Tt = l`
|
|
|
2769
2803
|
price
|
|
2770
2804
|
depositPrice
|
|
2771
2805
|
discountPrice
|
|
2806
|
+
promoterDiscountPrice
|
|
2772
2807
|
serviceFee
|
|
2773
2808
|
type
|
|
2774
2809
|
startSalesAt
|
|
@@ -2787,106 +2822,109 @@ const Tt = l`
|
|
|
2787
2822
|
showEndSalesAtTag
|
|
2788
2823
|
}
|
|
2789
2824
|
}
|
|
2790
|
-
`,
|
|
2791
|
-
function
|
|
2825
|
+
`, Pt = (t, e, n, i) => t();
|
|
2826
|
+
function bt(t, e = Pt) {
|
|
2792
2827
|
return {
|
|
2793
|
-
EventOverviewPage(
|
|
2794
|
-
return
|
|
2828
|
+
EventOverviewPage(n, i, r) {
|
|
2829
|
+
return e((s) => t.request({ document: Tt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
|
|
2795
2830
|
},
|
|
2796
|
-
EventDetailPage(
|
|
2797
|
-
return
|
|
2831
|
+
EventDetailPage(n, i, r) {
|
|
2832
|
+
return e((s) => t.request({ document: Dt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", n);
|
|
2798
2833
|
},
|
|
2799
|
-
|
|
2800
|
-
return
|
|
2834
|
+
FindPublicEventBySlug(n, i, r) {
|
|
2835
|
+
return e((s) => t.request({ document: Nt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "FindPublicEventBySlug", "query", n);
|
|
2836
|
+
},
|
|
2837
|
+
findProductsByEventId(n, i, r) {
|
|
2838
|
+
return e((s) => t.request({ document: vt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
|
|
2801
2839
|
}
|
|
2802
2840
|
};
|
|
2803
2841
|
}
|
|
2804
|
-
class
|
|
2842
|
+
class St {
|
|
2805
2843
|
config;
|
|
2806
2844
|
sdk;
|
|
2807
|
-
constructor(
|
|
2808
|
-
this.config =
|
|
2845
|
+
constructor(e) {
|
|
2846
|
+
this.config = e, this.sdk = bt(new N(e.apiUrl));
|
|
2809
2847
|
}
|
|
2810
|
-
async getEvents(n
|
|
2848
|
+
async getEvents(e, n) {
|
|
2811
2849
|
try {
|
|
2812
|
-
|
|
2813
|
-
index:
|
|
2814
|
-
size:
|
|
2850
|
+
e.page && (e.page = {
|
|
2851
|
+
index: e.page.index ?? 0,
|
|
2852
|
+
size: e.page.size ?? 20
|
|
2815
2853
|
}), this.debugLog("Fetching events with parameters", {
|
|
2816
|
-
organizationId: this.config.organizationId,
|
|
2817
|
-
hostingIds:
|
|
2818
|
-
filterEventStatuses:
|
|
2819
|
-
dateRange:
|
|
2820
|
-
page:
|
|
2821
|
-
sorts:
|
|
2854
|
+
organizationId: this.config.organizationId ?? n ?? "",
|
|
2855
|
+
hostingIds: e.hostingIds,
|
|
2856
|
+
filterEventStatuses: e.statuses,
|
|
2857
|
+
dateRange: e.dateRange,
|
|
2858
|
+
page: e.page,
|
|
2859
|
+
sorts: e.sorts,
|
|
2822
2860
|
trackerId: this.config.trackerId
|
|
2823
2861
|
});
|
|
2824
|
-
const
|
|
2825
|
-
organizationId: this.config.organizationId,
|
|
2826
|
-
hostingIds:
|
|
2827
|
-
locationIds:
|
|
2828
|
-
excludedEventIds:
|
|
2829
|
-
filterEventStatuses:
|
|
2830
|
-
dateRange:
|
|
2831
|
-
from:
|
|
2832
|
-
till:
|
|
2862
|
+
const i = await this.sdk.EventOverviewPage({
|
|
2863
|
+
organizationId: this.config.organizationId ?? n ?? "",
|
|
2864
|
+
hostingIds: e.hostingIds,
|
|
2865
|
+
locationIds: e.locationIds,
|
|
2866
|
+
excludedEventIds: e.excludedEventIds,
|
|
2867
|
+
filterEventStatuses: e.statuses,
|
|
2868
|
+
dateRange: e.dateRange && e.dateRange.from && e.dateRange.till ? {
|
|
2869
|
+
from: e.dateRange.from.toISO(),
|
|
2870
|
+
till: e.dateRange.till.toISO()
|
|
2833
2871
|
} : void 0,
|
|
2834
|
-
page:
|
|
2835
|
-
sorts:
|
|
2872
|
+
page: e.page,
|
|
2873
|
+
sorts: e.sorts,
|
|
2836
2874
|
trackerId: this.config.trackerId,
|
|
2837
|
-
searchTerm:
|
|
2838
|
-
priceRange:
|
|
2875
|
+
searchTerm: e.searchTerm,
|
|
2876
|
+
priceRange: e.priceRange
|
|
2839
2877
|
});
|
|
2840
|
-
if (this.debugLog("Raw GraphQL response",
|
|
2841
|
-
const
|
|
2842
|
-
id:
|
|
2843
|
-
name:
|
|
2844
|
-
icon:
|
|
2845
|
-
banner:
|
|
2846
|
-
description:
|
|
2847
|
-
addonDescription:
|
|
2848
|
-
startAt:
|
|
2849
|
-
endAt:
|
|
2850
|
-
timezone:
|
|
2878
|
+
if (this.debugLog("Raw GraphQL response", i), i?.findAllPublicEventByOrganizationId?.data) {
|
|
2879
|
+
const r = i.findAllPublicEventByOrganizationId.data.map((s) => ({
|
|
2880
|
+
id: s.id,
|
|
2881
|
+
name: s.name,
|
|
2882
|
+
icon: s.icon,
|
|
2883
|
+
banner: s.banner,
|
|
2884
|
+
description: s.description,
|
|
2885
|
+
addonDescription: s.addonDescription,
|
|
2886
|
+
startAt: k.fromISO(s.startAt, { zone: s.timezone }).toJSDate().toISOString(),
|
|
2887
|
+
endAt: k.fromISO(s.endAt, { zone: s.timezone }).toJSDate().toISOString(),
|
|
2888
|
+
timezone: s.timezone,
|
|
2851
2889
|
startSalesAt: null,
|
|
2852
2890
|
endSalesAt: null,
|
|
2853
|
-
slug:
|
|
2891
|
+
slug: s.slug ?? "ERROR",
|
|
2854
2892
|
facebookPixelId: null,
|
|
2855
|
-
status:
|
|
2856
|
-
location:
|
|
2857
|
-
id:
|
|
2858
|
-
name:
|
|
2859
|
-
address:
|
|
2893
|
+
status: s.status,
|
|
2894
|
+
location: s.location ? {
|
|
2895
|
+
id: s.location.id,
|
|
2896
|
+
name: s.location.name,
|
|
2897
|
+
address: s.location.address
|
|
2860
2898
|
} : void 0,
|
|
2861
|
-
hosting:
|
|
2862
|
-
id:
|
|
2863
|
-
name:
|
|
2899
|
+
hosting: s.hosting ? {
|
|
2900
|
+
id: s.hosting.id,
|
|
2901
|
+
name: s.hosting.name
|
|
2864
2902
|
} : void 0,
|
|
2865
|
-
infoDescription:
|
|
2866
|
-
startingPrice:
|
|
2867
|
-
totalViews:
|
|
2903
|
+
infoDescription: s.infoDescription,
|
|
2904
|
+
startingPrice: s.startingPrice,
|
|
2905
|
+
totalViews: s.totalViews
|
|
2868
2906
|
}));
|
|
2869
|
-
return this.debugLog("Processed events", { events:
|
|
2907
|
+
return this.debugLog("Processed events", { events: r, count: r.length }), [r, i.findAllPublicEventByOrganizationId.count ?? 0];
|
|
2870
2908
|
} else
|
|
2871
2909
|
return this.debugLog("No events found in response"), [[], 0];
|
|
2872
|
-
} catch (
|
|
2873
|
-
throw this.debugLog("Error fetching events",
|
|
2910
|
+
} catch (i) {
|
|
2911
|
+
throw this.debugLog("Error fetching events", i), i;
|
|
2874
2912
|
}
|
|
2875
2913
|
}
|
|
2876
|
-
async getEvent(
|
|
2914
|
+
async getEvent(e) {
|
|
2877
2915
|
try {
|
|
2878
|
-
this.debugLog("Fetching single event", { eventId:
|
|
2879
|
-
const
|
|
2880
|
-
if (this.debugLog("Raw GraphQL response",
|
|
2881
|
-
const i =
|
|
2916
|
+
this.debugLog("Fetching single event", { eventId: e });
|
|
2917
|
+
const n = await this.sdk.EventDetailPage({ eventId: e });
|
|
2918
|
+
if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
|
|
2919
|
+
const i = n.findPublicEventById, r = {
|
|
2882
2920
|
id: i.id,
|
|
2883
2921
|
name: i.name,
|
|
2884
2922
|
icon: i.icon,
|
|
2885
2923
|
banner: i.banner,
|
|
2886
2924
|
description: i.description,
|
|
2887
2925
|
addonDescription: i.addonDescription,
|
|
2888
|
-
startAt:
|
|
2889
|
-
endAt:
|
|
2926
|
+
startAt: k.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
|
|
2927
|
+
endAt: k.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
|
|
2890
2928
|
timezone: i.timezone,
|
|
2891
2929
|
startSalesAt: i.startSalesAt,
|
|
2892
2930
|
endSalesAt: i.endSalesAt,
|
|
@@ -2908,26 +2946,68 @@ class Pt {
|
|
|
2908
2946
|
};
|
|
2909
2947
|
return this.debugLog("Processed single event", r), r;
|
|
2910
2948
|
} else {
|
|
2911
|
-
this.debugLog("No event found for id",
|
|
2949
|
+
this.debugLog("No event found for id", e);
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
} catch (n) {
|
|
2953
|
+
throw this.debugLog("Error fetching single event", n), n;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
async getEventBySlug(e, n) {
|
|
2957
|
+
try {
|
|
2958
|
+
this.debugLog("Fetching single event by slug", { organizationId: e, slug: n });
|
|
2959
|
+
const i = await this.sdk.FindPublicEventBySlug({ organizationId: e, slug: n });
|
|
2960
|
+
if (this.debugLog("Raw GraphQL response", i), i?.findPublicEventBySlug) {
|
|
2961
|
+
const r = i.findPublicEventBySlug, s = {
|
|
2962
|
+
id: r.id,
|
|
2963
|
+
name: r.name,
|
|
2964
|
+
icon: r.icon,
|
|
2965
|
+
banner: r.banner,
|
|
2966
|
+
description: r.description,
|
|
2967
|
+
addonDescription: r.addonDescription,
|
|
2968
|
+
startAt: k.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
|
|
2969
|
+
endAt: k.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
|
|
2970
|
+
timezone: r.timezone,
|
|
2971
|
+
startSalesAt: r.startSalesAt,
|
|
2972
|
+
endSalesAt: r.endSalesAt,
|
|
2973
|
+
slug: r.slug ?? "ERROR",
|
|
2974
|
+
facebookPixelId: r.facebookPixelId,
|
|
2975
|
+
status: r.status,
|
|
2976
|
+
location: r.location ? {
|
|
2977
|
+
id: r.location.id,
|
|
2978
|
+
name: r.location.name,
|
|
2979
|
+
address: r.location.address
|
|
2980
|
+
} : void 0,
|
|
2981
|
+
hosting: r.hosting ? {
|
|
2982
|
+
id: r.hosting.id,
|
|
2983
|
+
name: r.hosting.name
|
|
2984
|
+
} : void 0,
|
|
2985
|
+
infoDescription: r.infoDescription,
|
|
2986
|
+
startingPrice: r.startingPrice,
|
|
2987
|
+
totalViews: r.totalViews
|
|
2988
|
+
};
|
|
2989
|
+
return this.debugLog("Processed single event", s), s;
|
|
2990
|
+
} else {
|
|
2991
|
+
this.debugLog("No event found for id by slug", { organizationId: e, slug: n });
|
|
2912
2992
|
return;
|
|
2913
2993
|
}
|
|
2914
|
-
} catch (
|
|
2915
|
-
throw this.debugLog("Error fetching single event",
|
|
2994
|
+
} catch (i) {
|
|
2995
|
+
throw this.debugLog("Error fetching single event", i), i;
|
|
2916
2996
|
}
|
|
2917
2997
|
}
|
|
2918
|
-
async getProducts(
|
|
2998
|
+
async getProducts(e, n, i) {
|
|
2919
2999
|
try {
|
|
2920
3000
|
this.debugLog("Fetching products for event", {
|
|
2921
|
-
eventId:
|
|
3001
|
+
eventId: e,
|
|
2922
3002
|
promoCode: i,
|
|
2923
3003
|
trackerId: this.config.trackerId,
|
|
2924
|
-
productTypes:
|
|
3004
|
+
productTypes: n
|
|
2925
3005
|
});
|
|
2926
3006
|
const r = await this.sdk.findProductsByEventId({
|
|
2927
|
-
eventId:
|
|
3007
|
+
eventId: e,
|
|
2928
3008
|
promoCode: i,
|
|
2929
3009
|
trackerId: this.config.trackerId,
|
|
2930
|
-
productTypes:
|
|
3010
|
+
productTypes: n
|
|
2931
3011
|
});
|
|
2932
3012
|
if (r?.findPublicProductsByEventId) {
|
|
2933
3013
|
const s = r.findPublicProductsByEventId.map((o) => ({
|
|
@@ -2941,7 +3021,7 @@ class Pt {
|
|
|
2941
3021
|
currency: o.currency,
|
|
2942
3022
|
depositPrice: o.depositPrice,
|
|
2943
3023
|
description: o.description,
|
|
2944
|
-
discountPrice: o.discountPrice,
|
|
3024
|
+
discountPrice: o.promoterDiscountPrice ?? o.discountPrice,
|
|
2945
3025
|
startSalesAt: o.startSalesAt,
|
|
2946
3026
|
endSalesAt: o.endSalesAt,
|
|
2947
3027
|
icon: o.icon,
|
|
@@ -2955,21 +3035,21 @@ class Pt {
|
|
|
2955
3035
|
type: o.type
|
|
2956
3036
|
}));
|
|
2957
3037
|
return this.debugLog("Products fetched", {
|
|
2958
|
-
eventId:
|
|
3038
|
+
eventId: e,
|
|
2959
3039
|
count: s.length,
|
|
2960
3040
|
types: s.map((o) => o.type)
|
|
2961
3041
|
}), s;
|
|
2962
3042
|
}
|
|
2963
3043
|
return;
|
|
2964
3044
|
} catch (r) {
|
|
2965
|
-
throw this.debugLog("Error fetching products", { eventId:
|
|
3045
|
+
throw this.debugLog("Error fetching products", { eventId: e, error: r }), r;
|
|
2966
3046
|
}
|
|
2967
3047
|
}
|
|
2968
|
-
debugLog(
|
|
2969
|
-
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${
|
|
3048
|
+
debugLog(e, n) {
|
|
3049
|
+
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${e}`, n || "");
|
|
2970
3050
|
}
|
|
2971
3051
|
}
|
|
2972
|
-
const xt =
|
|
3052
|
+
const xt = u`
|
|
2973
3053
|
query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
|
|
2974
3054
|
findPaymentDetails(
|
|
2975
3055
|
orderId: $orderId
|
|
@@ -2999,40 +3079,40 @@ const xt = l`
|
|
|
2999
3079
|
protectionFee
|
|
3000
3080
|
}
|
|
3001
3081
|
}
|
|
3002
|
-
`,
|
|
3082
|
+
`, Ct = u`
|
|
3003
3083
|
mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
|
|
3004
3084
|
createDigitalOrderPayment(input: $input)
|
|
3005
3085
|
}
|
|
3006
|
-
`,
|
|
3007
|
-
function
|
|
3086
|
+
`, _t = (t, e, n, i) => t();
|
|
3087
|
+
function Lt(t, e = _t) {
|
|
3008
3088
|
return {
|
|
3009
|
-
findPaymentMethods(
|
|
3010
|
-
return
|
|
3089
|
+
findPaymentMethods(n, i, r) {
|
|
3090
|
+
return e((s) => t.request({ document: xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
|
|
3011
3091
|
},
|
|
3012
|
-
createDigitalPayment(
|
|
3013
|
-
return
|
|
3092
|
+
createDigitalPayment(n, i, r) {
|
|
3093
|
+
return e((s) => t.request({ document: Ct, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
|
|
3014
3094
|
}
|
|
3015
3095
|
};
|
|
3016
3096
|
}
|
|
3017
|
-
class
|
|
3097
|
+
class Rt {
|
|
3018
3098
|
config;
|
|
3019
3099
|
sdk;
|
|
3020
|
-
constructor(
|
|
3021
|
-
this.config =
|
|
3100
|
+
constructor(e) {
|
|
3101
|
+
this.config = e, this.sdk = Lt(new N(e.apiUrl));
|
|
3022
3102
|
}
|
|
3023
|
-
async getPaymentDetails(
|
|
3024
|
-
this.debugLog("Fetching payment methods",
|
|
3103
|
+
async getPaymentDetails(e) {
|
|
3104
|
+
this.debugLog("Fetching payment methods", e);
|
|
3025
3105
|
try {
|
|
3026
|
-
const
|
|
3027
|
-
orderId:
|
|
3028
|
-
orderItemId:
|
|
3029
|
-
amountOfTickets:
|
|
3030
|
-
paymentMethodId:
|
|
3031
|
-
withTicketProtection:
|
|
3106
|
+
const n = await this.sdk.findPaymentMethods({
|
|
3107
|
+
orderId: e.orderId,
|
|
3108
|
+
orderItemId: e.orderItemId,
|
|
3109
|
+
amountOfTickets: e.amountOfTickets,
|
|
3110
|
+
paymentMethodId: e.paymentMethodId,
|
|
3111
|
+
withTicketProtection: e.withTicketProtection
|
|
3032
3112
|
});
|
|
3033
|
-
if (!
|
|
3113
|
+
if (!n?.findPaymentDetails)
|
|
3034
3114
|
throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
|
|
3035
|
-
const i =
|
|
3115
|
+
const i = n.findPaymentDetails;
|
|
3036
3116
|
return this.debugLog("Payment methods fetched successfully", {
|
|
3037
3117
|
methodCount: i.methods?.length ?? 0,
|
|
3038
3118
|
transactionPrice: i.transactionPrice,
|
|
@@ -3061,42 +3141,42 @@ class _t {
|
|
|
3061
3141
|
})) ?? null
|
|
3062
3142
|
})) ?? null
|
|
3063
3143
|
};
|
|
3064
|
-
} catch (
|
|
3065
|
-
throw this.debugLog("Error fetching payment methods",
|
|
3144
|
+
} catch (n) {
|
|
3145
|
+
throw this.debugLog("Error fetching payment methods", n), n;
|
|
3066
3146
|
}
|
|
3067
3147
|
}
|
|
3068
|
-
async createPayment(
|
|
3069
|
-
this.debugLog("Creating payment",
|
|
3148
|
+
async createPayment(e) {
|
|
3149
|
+
this.debugLog("Creating payment", e);
|
|
3070
3150
|
try {
|
|
3071
|
-
const
|
|
3072
|
-
orderId:
|
|
3073
|
-
paymentMethodId:
|
|
3074
|
-
issuerId:
|
|
3075
|
-
redirectUrl:
|
|
3151
|
+
const n = {
|
|
3152
|
+
orderId: e.orderId,
|
|
3153
|
+
paymentMethodId: e.paymentMethodId,
|
|
3154
|
+
issuerId: e.issuerId,
|
|
3155
|
+
redirectUrl: e.redirectUrl,
|
|
3076
3156
|
// For payment links this input in used
|
|
3077
|
-
initiatedByUserId:
|
|
3078
|
-
initiatedByTeamId:
|
|
3079
|
-
amountOfTickets:
|
|
3080
|
-
orderItemId:
|
|
3081
|
-
withTicketProtection:
|
|
3157
|
+
initiatedByUserId: e.initiatedByUserId,
|
|
3158
|
+
initiatedByTeamId: e.initiatedByTeamId,
|
|
3159
|
+
amountOfTickets: e.amountOfTickets,
|
|
3160
|
+
orderItemId: e.orderItemId,
|
|
3161
|
+
withTicketProtection: e.withTicketProtection
|
|
3082
3162
|
};
|
|
3083
|
-
|
|
3163
|
+
e.customer && (n.customer = e.customer), e.products && (n.products = e.products), e.description && (n.description = e.description), e.reference && (n.reference = e.reference), e.ipAddress && (n.ipAddress = e.ipAddress);
|
|
3084
3164
|
const i = await this.sdk.createDigitalPayment({
|
|
3085
|
-
input:
|
|
3165
|
+
input: n
|
|
3086
3166
|
});
|
|
3087
3167
|
if (!i?.createDigitalOrderPayment)
|
|
3088
3168
|
throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
|
|
3089
3169
|
const r = i.createDigitalOrderPayment;
|
|
3090
3170
|
return this.debugLog("Payment created successfully", { paymentUrl: r }), { paymentUrl: r };
|
|
3091
|
-
} catch (
|
|
3092
|
-
throw this.debugLog("Error creating payment",
|
|
3171
|
+
} catch (n) {
|
|
3172
|
+
throw this.debugLog("Error creating payment", n), n;
|
|
3093
3173
|
}
|
|
3094
3174
|
}
|
|
3095
|
-
debugLog(
|
|
3096
|
-
this.config.debug && console.log(`[PaymentService] ${
|
|
3175
|
+
debugLog(e, n) {
|
|
3176
|
+
this.config.debug && console.log(`[PaymentService] ${e}`, n || "");
|
|
3097
3177
|
}
|
|
3098
3178
|
}
|
|
3099
|
-
const
|
|
3179
|
+
const Ft = u`
|
|
3100
3180
|
query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
|
|
3101
3181
|
findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
|
|
3102
3182
|
data {
|
|
@@ -3121,7 +3201,7 @@ const Lt = l`
|
|
|
3121
3201
|
count
|
|
3122
3202
|
}
|
|
3123
3203
|
}
|
|
3124
|
-
`,
|
|
3204
|
+
`, wt = u`
|
|
3125
3205
|
query findPublicPackageById($packageId: ID!) {
|
|
3126
3206
|
findPublicPackageById(id: $packageId) {
|
|
3127
3207
|
id
|
|
@@ -3147,7 +3227,33 @@ const Lt = l`
|
|
|
3147
3227
|
}
|
|
3148
3228
|
}
|
|
3149
3229
|
}
|
|
3150
|
-
`,
|
|
3230
|
+
`, $t = u`
|
|
3231
|
+
query findPublicPackageBySlug($organizationId: ID!, $slug: String!) {
|
|
3232
|
+
findPublicPackageBySlug(organizationId: $organizationId, slug: $slug) {
|
|
3233
|
+
id
|
|
3234
|
+
slug
|
|
3235
|
+
status
|
|
3236
|
+
name
|
|
3237
|
+
description
|
|
3238
|
+
shortTitle
|
|
3239
|
+
shortDescription
|
|
3240
|
+
startAvailabilityAt
|
|
3241
|
+
endAvailabilityAt
|
|
3242
|
+
maxAmountOfPersonsPerOrder
|
|
3243
|
+
icon
|
|
3244
|
+
banner
|
|
3245
|
+
currency
|
|
3246
|
+
amountOfEvents
|
|
3247
|
+
amountOfAddons
|
|
3248
|
+
prices {
|
|
3249
|
+
price
|
|
3250
|
+
deposit
|
|
3251
|
+
discount
|
|
3252
|
+
serviceFee
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
`, Bt = u`
|
|
3151
3257
|
query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
|
|
3152
3258
|
findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
|
|
3153
3259
|
data {
|
|
@@ -3182,77 +3288,96 @@ const Lt = l`
|
|
|
3182
3288
|
count
|
|
3183
3289
|
}
|
|
3184
3290
|
}
|
|
3185
|
-
`,
|
|
3186
|
-
function
|
|
3291
|
+
`, Vt = (t, e, n, i) => t();
|
|
3292
|
+
function Ut(t, e = Vt) {
|
|
3187
3293
|
return {
|
|
3188
|
-
findAllPublicPackagesByOrganizationId(
|
|
3189
|
-
return
|
|
3294
|
+
findAllPublicPackagesByOrganizationId(n, i, r) {
|
|
3295
|
+
return e((s) => t.request({ document: Ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
|
|
3190
3296
|
},
|
|
3191
|
-
findPublicPackageById(
|
|
3192
|
-
return
|
|
3297
|
+
findPublicPackageById(n, i, r) {
|
|
3298
|
+
return e((s) => t.request({ document: wt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", n);
|
|
3193
3299
|
},
|
|
3194
|
-
|
|
3195
|
-
return
|
|
3300
|
+
findPublicPackageBySlug(n, i, r) {
|
|
3301
|
+
return e((s) => t.request({ document: $t, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageBySlug", "query", n);
|
|
3302
|
+
},
|
|
3303
|
+
findPublicItemsByPackageId(n, i, r) {
|
|
3304
|
+
return e((s) => t.request({ document: Bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
|
|
3196
3305
|
}
|
|
3197
3306
|
};
|
|
3198
3307
|
}
|
|
3199
|
-
class
|
|
3308
|
+
class Mt {
|
|
3200
3309
|
config;
|
|
3201
3310
|
sdk;
|
|
3202
|
-
constructor(
|
|
3203
|
-
this.config =
|
|
3311
|
+
constructor(e) {
|
|
3312
|
+
this.config = e, this.sdk = Ut(new N(e.apiUrl));
|
|
3204
3313
|
}
|
|
3205
|
-
debugLog(
|
|
3206
|
-
this.config.debug && console.log(`[PackageService] ${
|
|
3314
|
+
debugLog(e, n) {
|
|
3315
|
+
this.config.debug && console.log(`[PackageService] ${e}`, n || "");
|
|
3207
3316
|
}
|
|
3208
|
-
async getPackages(n
|
|
3317
|
+
async getPackages(e, n) {
|
|
3209
3318
|
try {
|
|
3210
|
-
let
|
|
3211
|
-
|
|
3212
|
-
index:
|
|
3213
|
-
size:
|
|
3319
|
+
let i;
|
|
3320
|
+
e.page && (i = {
|
|
3321
|
+
index: e.page.index ?? 0,
|
|
3322
|
+
size: e.page.size ?? 20
|
|
3214
3323
|
}), this.debugLog("Fetching public packages", {
|
|
3215
|
-
organizationId: this.config.organizationId,
|
|
3216
|
-
page:
|
|
3217
|
-
tab:
|
|
3218
|
-
statuses:
|
|
3324
|
+
organizationId: this.config.organizationId ?? n ?? "",
|
|
3325
|
+
page: i,
|
|
3326
|
+
tab: e.tab,
|
|
3327
|
+
statuses: e.statuses
|
|
3219
3328
|
});
|
|
3220
|
-
const
|
|
3221
|
-
organizationId: this.config.organizationId
|
|
3329
|
+
const r = await this.sdk.findAllPublicPackagesByOrganizationId({
|
|
3330
|
+
organizationId: this.config.organizationId ?? n ?? ""
|
|
3222
3331
|
});
|
|
3223
|
-
if (
|
|
3224
|
-
const
|
|
3332
|
+
if (r?.findAllPublicPackagesByOrganizationId) {
|
|
3333
|
+
const s = r.findAllPublicPackagesByOrganizationId;
|
|
3225
3334
|
return this.debugLog("Public packages fetched", {
|
|
3226
|
-
count:
|
|
3227
|
-
dataLength:
|
|
3228
|
-
}),
|
|
3335
|
+
count: s.count,
|
|
3336
|
+
dataLength: s.data.length
|
|
3337
|
+
}), s.data;
|
|
3229
3338
|
}
|
|
3230
3339
|
return null;
|
|
3231
|
-
} catch (
|
|
3232
|
-
throw this.debugLog("Error fetching public packages",
|
|
3340
|
+
} catch (i) {
|
|
3341
|
+
throw this.debugLog("Error fetching public packages", i), i;
|
|
3233
3342
|
}
|
|
3234
3343
|
}
|
|
3235
|
-
async getPackage(
|
|
3344
|
+
async getPackage(e) {
|
|
3236
3345
|
try {
|
|
3237
3346
|
this.debugLog("Fetching public packages", {
|
|
3238
|
-
packageId:
|
|
3347
|
+
packageId: e
|
|
3239
3348
|
});
|
|
3240
|
-
const
|
|
3241
|
-
if (
|
|
3242
|
-
const i =
|
|
3349
|
+
const n = await this.sdk.findPublicPackageById({ packageId: e });
|
|
3350
|
+
if (n?.findPublicPackageById) {
|
|
3351
|
+
const i = n.findPublicPackageById;
|
|
3243
3352
|
return this.debugLog("Public package fetched"), i;
|
|
3244
3353
|
}
|
|
3245
3354
|
return null;
|
|
3246
|
-
} catch (
|
|
3247
|
-
throw this.debugLog("Error fetching public packages",
|
|
3355
|
+
} catch (n) {
|
|
3356
|
+
throw this.debugLog("Error fetching public packages", n), n;
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
async getPackageBySlug(e, n) {
|
|
3360
|
+
try {
|
|
3361
|
+
this.debugLog("Fetching public packages by slug", {
|
|
3362
|
+
organizationId: e,
|
|
3363
|
+
slug: n
|
|
3364
|
+
});
|
|
3365
|
+
const i = await this.sdk.findPublicPackageBySlug({ organizationId: e, slug: n });
|
|
3366
|
+
if (i?.findPublicPackageBySlug) {
|
|
3367
|
+
const r = i.findPublicPackageBySlug;
|
|
3368
|
+
return this.debugLog("Public package fetched"), r;
|
|
3369
|
+
}
|
|
3370
|
+
return null;
|
|
3371
|
+
} catch (i) {
|
|
3372
|
+
throw this.debugLog("Error fetching public packages", i), i;
|
|
3248
3373
|
}
|
|
3249
3374
|
}
|
|
3250
|
-
async getPackageItems(
|
|
3375
|
+
async getPackageItems(e, n = [R.Regular, R.AdditionalEvent]) {
|
|
3251
3376
|
try {
|
|
3252
|
-
this.debugLog("Fetching public package items", { packageId:
|
|
3377
|
+
this.debugLog("Fetching public package items", { packageId: e, types: n });
|
|
3253
3378
|
const i = await this.sdk.findPublicItemsByPackageId({
|
|
3254
|
-
packageId:
|
|
3255
|
-
types:
|
|
3379
|
+
packageId: e,
|
|
3380
|
+
types: n,
|
|
3256
3381
|
page: { index: 0, size: 100 }
|
|
3257
3382
|
});
|
|
3258
3383
|
if (i?.findPublicItemsByPackageId) {
|
|
@@ -3268,7 +3393,7 @@ class Bt {
|
|
|
3268
3393
|
}
|
|
3269
3394
|
}
|
|
3270
3395
|
}
|
|
3271
|
-
const
|
|
3396
|
+
const zt = u`
|
|
3272
3397
|
query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
|
|
3273
3398
|
findAllPublicLocationsByOrganizationId(id: $organizationId) {
|
|
3274
3399
|
data {
|
|
@@ -3288,89 +3413,89 @@ const Vt = l`
|
|
|
3288
3413
|
count
|
|
3289
3414
|
}
|
|
3290
3415
|
}
|
|
3291
|
-
`,
|
|
3292
|
-
function
|
|
3416
|
+
`, qt = (t, e, n, i) => t();
|
|
3417
|
+
function Gt(t, e = qt) {
|
|
3293
3418
|
return {
|
|
3294
|
-
findAllPublicCategoriesByOrganizationId(
|
|
3295
|
-
return
|
|
3419
|
+
findAllPublicCategoriesByOrganizationId(n, i, r) {
|
|
3420
|
+
return e((s) => t.request({ document: zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", n);
|
|
3296
3421
|
}
|
|
3297
3422
|
};
|
|
3298
3423
|
}
|
|
3299
|
-
class
|
|
3424
|
+
class jt {
|
|
3300
3425
|
config;
|
|
3301
3426
|
sdk;
|
|
3302
|
-
constructor(
|
|
3303
|
-
this.config =
|
|
3427
|
+
constructor(e) {
|
|
3428
|
+
this.config = e, this.sdk = Gt(new N(e.apiUrl));
|
|
3304
3429
|
}
|
|
3305
|
-
debugLog(
|
|
3306
|
-
this.config.debug && console.log(`[CategoryService] ${
|
|
3430
|
+
debugLog(e, n) {
|
|
3431
|
+
this.config.debug && console.log(`[CategoryService] ${e}`, n || "");
|
|
3307
3432
|
}
|
|
3308
|
-
async getCategories(n) {
|
|
3433
|
+
async getCategories(e, n) {
|
|
3309
3434
|
try {
|
|
3310
3435
|
this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
|
|
3311
|
-
const
|
|
3312
|
-
if (
|
|
3313
|
-
const
|
|
3314
|
-
return this.debugLog("Categories fetched", { count:
|
|
3315
|
-
...
|
|
3316
|
-
...
|
|
3436
|
+
const i = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId ?? n ?? "", dateRange: e ?? null });
|
|
3437
|
+
if (i?.findAllPublicHostingsByOrganizationId) {
|
|
3438
|
+
const r = i.findAllPublicHostingsByOrganizationId, s = i.findAllPublicLocationsByOrganizationId;
|
|
3439
|
+
return this.debugLog("Categories fetched", { count: r.count + s.count, dataLength: r.data.length + s.data.length }), [
|
|
3440
|
+
...r.data.map((o) => ({ id: o.id, name: o.name, icon: o.icon, activeEvents: o.amountOfActiveEvents, type: "HOSTING" })),
|
|
3441
|
+
...s.data.map((o) => ({ id: o.id, name: o.name, activeEvents: o.amountOfActiveEvents, type: "LOCATION" }))
|
|
3317
3442
|
];
|
|
3318
3443
|
}
|
|
3319
3444
|
return [];
|
|
3320
|
-
} catch (
|
|
3321
|
-
throw this.debugLog("Error fetching categories",
|
|
3445
|
+
} catch (i) {
|
|
3446
|
+
throw this.debugLog("Error fetching categories", i), i;
|
|
3322
3447
|
}
|
|
3323
3448
|
}
|
|
3324
3449
|
}
|
|
3325
|
-
const
|
|
3450
|
+
const Yt = u`
|
|
3326
3451
|
mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
|
|
3327
3452
|
createShopView(id: $id, trackerId: $trackerLinkId)
|
|
3328
3453
|
}
|
|
3329
|
-
`,
|
|
3454
|
+
`, Ht = u`
|
|
3330
3455
|
mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
3331
3456
|
createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
3332
3457
|
}
|
|
3333
|
-
`,
|
|
3458
|
+
`, Jt = u`
|
|
3334
3459
|
mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
3335
3460
|
createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
3336
3461
|
}
|
|
3337
|
-
`,
|
|
3338
|
-
function
|
|
3462
|
+
`, Qt = (t, e, n, i) => t();
|
|
3463
|
+
function Xt(t, e = Qt) {
|
|
3339
3464
|
return {
|
|
3340
|
-
CreateShopView(
|
|
3341
|
-
return
|
|
3465
|
+
CreateShopView(n, i, r) {
|
|
3466
|
+
return e((s) => t.request({ document: Yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", n);
|
|
3342
3467
|
},
|
|
3343
|
-
CreateEventView(
|
|
3344
|
-
return
|
|
3468
|
+
CreateEventView(n, i, r) {
|
|
3469
|
+
return e((s) => t.request({ document: Ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", n);
|
|
3345
3470
|
},
|
|
3346
|
-
CreatePackageView(
|
|
3347
|
-
return
|
|
3471
|
+
CreatePackageView(n, i, r) {
|
|
3472
|
+
return e((s) => t.request({ document: Jt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", n);
|
|
3348
3473
|
}
|
|
3349
3474
|
};
|
|
3350
3475
|
}
|
|
3351
|
-
class
|
|
3476
|
+
class Wt {
|
|
3352
3477
|
config;
|
|
3353
3478
|
sdk;
|
|
3354
|
-
constructor(
|
|
3355
|
-
this.config =
|
|
3479
|
+
constructor(e) {
|
|
3480
|
+
this.config = e, this.sdk = Xt(new N(e.apiUrl));
|
|
3356
3481
|
}
|
|
3357
|
-
createMetric = async (
|
|
3358
|
-
switch (!
|
|
3359
|
-
id:
|
|
3482
|
+
createMetric = async (e, n, i) => {
|
|
3483
|
+
switch (!n && !i && await this.sdk.CreateShopView({
|
|
3484
|
+
id: e,
|
|
3360
3485
|
trackerLinkId: this.config.trackerId
|
|
3361
3486
|
}), i) {
|
|
3362
|
-
case
|
|
3487
|
+
case F.Event:
|
|
3363
3488
|
await this.sdk.CreateEventView({
|
|
3364
|
-
id:
|
|
3365
|
-
shopId:
|
|
3489
|
+
id: e,
|
|
3490
|
+
shopId: n,
|
|
3366
3491
|
trackerLinkId: this.config.trackerId
|
|
3367
3492
|
});
|
|
3368
3493
|
break;
|
|
3369
|
-
case
|
|
3494
|
+
case F.Package:
|
|
3370
3495
|
await this.sdk.CreatePackageView(
|
|
3371
3496
|
{
|
|
3372
|
-
id:
|
|
3373
|
-
shopId:
|
|
3497
|
+
id: e,
|
|
3498
|
+
shopId: n,
|
|
3374
3499
|
trackerLinkId: this.config.trackerId
|
|
3375
3500
|
}
|
|
3376
3501
|
);
|
|
@@ -3378,70 +3503,111 @@ class Jt {
|
|
|
3378
3503
|
}
|
|
3379
3504
|
};
|
|
3380
3505
|
}
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3506
|
+
const Zt = u`
|
|
3507
|
+
query getShopBySlug($slug: String!, $trackerLinkId: String) {
|
|
3508
|
+
findShopBySlug(slug: $slug, promoterId: $trackerLinkId) {
|
|
3509
|
+
id
|
|
3510
|
+
name
|
|
3511
|
+
description
|
|
3512
|
+
filteredLocationIds
|
|
3513
|
+
filteredHostingIds
|
|
3514
|
+
slug
|
|
3515
|
+
enablePromoCode
|
|
3516
|
+
enableDoorTickets
|
|
3517
|
+
removeServiceFee
|
|
3518
|
+
organization {
|
|
3519
|
+
id
|
|
3520
|
+
name
|
|
3521
|
+
logo
|
|
3522
|
+
socials {
|
|
3523
|
+
key
|
|
3524
|
+
value
|
|
3525
|
+
}
|
|
3526
|
+
billing_address_name
|
|
3527
|
+
terms_and_conditions
|
|
3528
|
+
facebook_pixel
|
|
3529
|
+
google_tag
|
|
3530
|
+
seatsIoWorkspaceId
|
|
3531
|
+
}
|
|
3532
|
+
template(trackerId: $trackerLinkId) {
|
|
3533
|
+
type
|
|
3534
|
+
variation
|
|
3535
|
+
backgroundColor
|
|
3536
|
+
primaryColor
|
|
3537
|
+
secondaryColor
|
|
3538
|
+
textColor
|
|
3539
|
+
slogan
|
|
3540
|
+
title
|
|
3541
|
+
notes
|
|
3542
|
+
description
|
|
3543
|
+
banner
|
|
3544
|
+
autoSelectFirstEvent
|
|
3545
|
+
useDarkTheme
|
|
3546
|
+
}
|
|
3547
|
+
blockedLanguages
|
|
3548
|
+
}
|
|
3549
|
+
}
|
|
3550
|
+
`, Kt = (t, e, n, i) => t();
|
|
3551
|
+
function en(t, e = Kt) {
|
|
3552
|
+
return {
|
|
3553
|
+
getShopBySlug(n, i, r) {
|
|
3554
|
+
return e((s) => t.request({ document: Zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "getShopBySlug", "query", n);
|
|
3555
|
+
}
|
|
3556
|
+
};
|
|
3557
|
+
}
|
|
3558
|
+
class tn {
|
|
3559
|
+
config;
|
|
3560
|
+
sdk;
|
|
3561
|
+
constructor(e) {
|
|
3562
|
+
this.config = e, this.sdk = en(new N(e.apiUrl));
|
|
3563
|
+
}
|
|
3564
|
+
async getShop(e) {
|
|
3565
|
+
try {
|
|
3566
|
+
this.debugLog("Fetching shop", { slug: e });
|
|
3567
|
+
const n = await this.sdk.getShopBySlug({ slug: e, trackerLinkId: this.config.trackerId });
|
|
3568
|
+
if (this.debugLog("Raw GraphQL response", n), n?.findShopBySlug) {
|
|
3569
|
+
const i = n.findShopBySlug;
|
|
3570
|
+
return this.debugLog("Public Shop fetched"), i;
|
|
3571
|
+
}
|
|
3572
|
+
return null;
|
|
3573
|
+
} catch (n) {
|
|
3574
|
+
throw this.debugLog("Error fetching single Shop", n), n;
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
debugLog(e, n) {
|
|
3578
|
+
this.config.debug && console.log(`[ShopService] ${e}`, n || "");
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
const nn = "https://api.ticketapp.com/graphql";
|
|
3582
|
+
class an {
|
|
3383
3583
|
basket;
|
|
3384
3584
|
event;
|
|
3385
3585
|
payment;
|
|
3386
3586
|
package;
|
|
3387
3587
|
category;
|
|
3388
3588
|
metric;
|
|
3589
|
+
shop;
|
|
3389
3590
|
// Attach selected public types to the SDK class
|
|
3390
3591
|
static Types = Te;
|
|
3391
|
-
constructor(
|
|
3392
|
-
const { organizationId:
|
|
3393
|
-
this.
|
|
3394
|
-
}
|
|
3395
|
-
// Resolve tracker id from (in order): explicit config, URL query, or session storage
|
|
3396
|
-
// Persist to session when found via config or URL for subsequent page loads
|
|
3397
|
-
getOrInitTrackerId() {
|
|
3398
|
-
try {
|
|
3399
|
-
let n = null, e = null;
|
|
3400
|
-
if (typeof window < "u") {
|
|
3401
|
-
try {
|
|
3402
|
-
e = new URL(window.location.href).searchParams.get("trackerId");
|
|
3403
|
-
} catch {
|
|
3404
|
-
}
|
|
3405
|
-
try {
|
|
3406
|
-
n = window.sessionStorage?.getItem(Z) ?? null;
|
|
3407
|
-
} catch {
|
|
3408
|
-
}
|
|
3409
|
-
}
|
|
3410
|
-
if (e && e.trim().length > 0) {
|
|
3411
|
-
try {
|
|
3412
|
-
typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Z, e);
|
|
3413
|
-
} catch {
|
|
3414
|
-
}
|
|
3415
|
-
return e;
|
|
3416
|
-
}
|
|
3417
|
-
if (n && n.trim().length > 0) {
|
|
3418
|
-
try {
|
|
3419
|
-
if (typeof window < "u") {
|
|
3420
|
-
const i = new URL(window.location.href);
|
|
3421
|
-
i.searchParams.get("trackerId") || (i.searchParams.set("trackerId", n), window.history.replaceState({}, "", i.toString()));
|
|
3422
|
-
}
|
|
3423
|
-
} catch {
|
|
3424
|
-
}
|
|
3425
|
-
return n;
|
|
3426
|
-
}
|
|
3427
|
-
return;
|
|
3428
|
-
} catch {
|
|
3429
|
-
return;
|
|
3430
|
-
}
|
|
3592
|
+
constructor(e) {
|
|
3593
|
+
const { organizationId: n, debug: i = !1, apiUrl: r = nn } = e;
|
|
3594
|
+
this.event = new St({ organizationId: n, debug: i, apiUrl: r, trackerId: e.trackerId }), this.package = new Mt({ organizationId: n, debug: i, apiUrl: r }), this.category = new jt({ organizationId: n, debug: i, apiUrl: r }), this.metric = new Wt({ apiUrl: r, trackerId: e.trackerId }), this.shop = new tn({ debug: i, apiUrl: r, trackerId: e.trackerId }), this.basket = new At({ debug: i, apiUrl: r, trackerId: e.trackerId }), this.payment = new Rt({ debug: i, apiUrl: r });
|
|
3431
3595
|
}
|
|
3432
3596
|
}
|
|
3433
3597
|
export {
|
|
3434
3598
|
T as BasketOrderType,
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3599
|
+
ae as DiscountType,
|
|
3600
|
+
ee as EventStatus,
|
|
3601
|
+
F as MetricsType,
|
|
3602
|
+
se as OrderItemType,
|
|
3439
3603
|
R as PackageItemType,
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3604
|
+
Z as PackageStatus,
|
|
3605
|
+
K as PackageTabType,
|
|
3606
|
+
re as PaymentMethodFeeType,
|
|
3607
|
+
ne as ProductStatus,
|
|
3608
|
+
ie as ProductType,
|
|
3609
|
+
oe as ShopTemplateType,
|
|
3610
|
+
ce as ShopVariationType,
|
|
3611
|
+
te as SortOrder,
|
|
3612
|
+
an as TicketappSDK
|
|
3447
3613
|
};
|