xmlui 0.6.3-beta.8 → 0.6.5
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/{apiInterceptorWorker-DWQMI2Uj.mjs → apiInterceptorWorker-_5iH0RMM.mjs} +631 -584
- package/dist/{index-CdzFKPyG.mjs → index-D0nGVSKW.mjs} +7100 -7027
- package/dist/index.css +1 -1
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +1813 -1666
- package/dist/xmlui-metadata.umd.js +1 -1
- package/dist/xmlui-standalone.umd.js +127 -127
- package/dist/xmlui.mjs +1 -1
- package/dist/xmlui.umd.js +84 -84
- package/package.json +1 -1
|
@@ -3,11 +3,11 @@ var Be = (e) => {
|
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
5
|
var Lr = (e, t, r) => t in e ? Pr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
6
|
-
var
|
|
7
|
-
var Q = (e, t, r) => (ve(e, t, "read from private field"), r ? r.call(e) : t.get(e)),
|
|
6
|
+
var U = (e, t, r) => Lr(e, typeof t != "symbol" ? t + "" : t, r), ve = (e, t, r) => t.has(e) || Be("Cannot " + r);
|
|
7
|
+
var Q = (e, t, r) => (ve(e, t, "read from private field"), r ? r.call(e) : t.get(e)), we = (e, t, r) => t.has(e) ? Be("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Ve = (e, t, r, s) => (ve(e, t, "write to private field"), s ? s.call(e, r) : t.set(e, r), r), ie = (e, t, r) => (ve(e, t, "access private method"), r);
|
|
8
8
|
import { isArray as It, isObject as Nt, mapValues as Sr } from "lodash-es";
|
|
9
9
|
import { delay as Dr, HttpResponse as K, http as Cr } from "msw";
|
|
10
|
-
import { r as
|
|
10
|
+
import { r as Mr, d as qr, m as $r, a as Ur, g as jr, o as Ee, T as Fr } from "./index-D0nGVSKW.mjs";
|
|
11
11
|
import We from "dexie";
|
|
12
12
|
var Br = /(%?)(%([sdijo]))/g;
|
|
13
13
|
function Vr(e, t) {
|
|
@@ -48,15 +48,15 @@ function Gr(e) {
|
|
|
48
48
|
t.splice(1, Wr), e.stack = t.join(`
|
|
49
49
|
`);
|
|
50
50
|
}
|
|
51
|
-
var
|
|
51
|
+
var zr = class extends Error {
|
|
52
52
|
constructor(e, ...t) {
|
|
53
53
|
super(e), this.message = e, this.name = "Invariant Violation", this.message = Y(e, ...t), Gr(this);
|
|
54
54
|
}
|
|
55
|
-
},
|
|
55
|
+
}, C = (e, t, ...r) => {
|
|
56
56
|
if (!e)
|
|
57
|
-
throw new
|
|
57
|
+
throw new zr(t, ...r);
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
C.as = (e, t, r, ...s) => {
|
|
60
60
|
if (!t) {
|
|
61
61
|
const n = s.length === 0 ? r : Y(r, ...s);
|
|
62
62
|
let i;
|
|
@@ -79,7 +79,7 @@ function Ce() {
|
|
|
79
79
|
}
|
|
80
80
|
return !1;
|
|
81
81
|
}
|
|
82
|
-
var
|
|
82
|
+
var j = async (e) => {
|
|
83
83
|
try {
|
|
84
84
|
return { error: null, data: await e().catch((r) => {
|
|
85
85
|
throw r;
|
|
@@ -88,20 +88,20 @@ var U = async (e) => {
|
|
|
88
88
|
return { error: t, data: null };
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
const
|
|
92
|
-
function
|
|
91
|
+
const Hr = "[MSW]";
|
|
92
|
+
function Me(e, ...t) {
|
|
93
93
|
const r = Y(e, ...t);
|
|
94
|
-
return `${
|
|
94
|
+
return `${Hr} ${r}`;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
console.warn(
|
|
96
|
+
function Xr(e, ...t) {
|
|
97
|
+
console.warn(Me(e, ...t));
|
|
98
98
|
}
|
|
99
99
|
function Yr(e, ...t) {
|
|
100
|
-
console.error(
|
|
100
|
+
console.error(Me(e, ...t));
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
formatMessage:
|
|
104
|
-
warn:
|
|
102
|
+
const O = {
|
|
103
|
+
formatMessage: Me,
|
|
104
|
+
warn: Xr,
|
|
105
105
|
error: Yr
|
|
106
106
|
};
|
|
107
107
|
var Jr = (e, t, r) => new Promise((s, n) => {
|
|
@@ -164,24 +164,24 @@ var Kr = Object.create, kt = Object.defineProperty, Zr = Object.getOwnPropertyDe
|
|
|
164
164
|
o++;
|
|
165
165
|
if (a -= o, l -= o, a === 0 || l < 3)
|
|
166
166
|
return l;
|
|
167
|
-
var c = 0, u, h, d, m,
|
|
167
|
+
var c = 0, u, h, d, m, p, y, g, E, b, v, _, A, x = [];
|
|
168
168
|
for (u = 0; u < a; u++)
|
|
169
|
-
|
|
170
|
-
for (var
|
|
171
|
-
for (
|
|
172
|
-
|
|
169
|
+
x.push(u + 1), x.push(s.charCodeAt(o + u));
|
|
170
|
+
for (var P = x.length - 1; c < l - 3; )
|
|
171
|
+
for (b = n.charCodeAt(o + (h = c)), v = n.charCodeAt(o + (d = c + 1)), _ = n.charCodeAt(o + (m = c + 2)), A = n.charCodeAt(o + (p = c + 3)), y = c += 4, u = 0; u < P; u += 2)
|
|
172
|
+
g = x[u], E = x[u + 1], h = r(g, h, d, b, E), d = r(h, d, m, v, E), m = r(d, m, p, _, E), y = r(m, p, y, A, E), x[u] = y, p = m, m = d, d = h, h = g;
|
|
173
173
|
for (; c < l; )
|
|
174
|
-
for (
|
|
175
|
-
|
|
174
|
+
for (b = n.charCodeAt(o + (h = c)), y = ++c, u = 0; u < P; u += 2)
|
|
175
|
+
g = x[u], x[u] = y = r(g, h, y, b, x[u + 1]), h = g;
|
|
176
176
|
return y;
|
|
177
177
|
};
|
|
178
178
|
}();
|
|
179
179
|
}
|
|
180
180
|
}), an = sn(on()), cn = an.default;
|
|
181
181
|
function ln() {
|
|
182
|
-
|
|
182
|
+
C(
|
|
183
183
|
typeof URL < "u",
|
|
184
|
-
|
|
184
|
+
O.formatMessage(
|
|
185
185
|
`Global "URL" class is not defined. This likely means that you're running MSW in an environment that doesn't support all Node.js standard API (e.g. React Native). If that's the case, please use an appropriate polyfill for the "URL" class, like "react-native-url-polyfill".`
|
|
186
186
|
)
|
|
187
187
|
);
|
|
@@ -365,9 +365,9 @@ class fn extends pn {
|
|
|
365
365
|
}
|
|
366
366
|
validateHandlers(...t) {
|
|
367
367
|
for (const r of t)
|
|
368
|
-
|
|
368
|
+
C(
|
|
369
369
|
!Array.isArray(r),
|
|
370
|
-
|
|
370
|
+
O.formatMessage(
|
|
371
371
|
'Failed to construct "%s" given an Array of request handlers. Make sure you spread the request handlers when calling the respective setup function.'
|
|
372
372
|
),
|
|
373
373
|
this.constructor.name
|
|
@@ -407,14 +407,14 @@ function gn(e) {
|
|
|
407
407
|
function vn(e) {
|
|
408
408
|
return e ? typeof e[Symbol.iterator] == "function" : !1;
|
|
409
409
|
}
|
|
410
|
-
var
|
|
410
|
+
var wn = Object.defineProperty, En = Object.defineProperties, bn = Object.getOwnPropertyDescriptors, ze = Object.getOwnPropertySymbols, _n = Object.prototype.hasOwnProperty, xn = Object.prototype.propertyIsEnumerable, He = (e, t, r) => t in e ? wn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Xe = (e, t) => {
|
|
411
411
|
for (var r in t || (t = {}))
|
|
412
|
-
_n.call(t, r) &&
|
|
413
|
-
if (
|
|
414
|
-
for (var r of
|
|
415
|
-
xn.call(t, r) &&
|
|
412
|
+
_n.call(t, r) && He(e, r, t[r]);
|
|
413
|
+
if (ze)
|
|
414
|
+
for (var r of ze(t))
|
|
415
|
+
xn.call(t, r) && He(e, r, t[r]);
|
|
416
416
|
return e;
|
|
417
|
-
}, Ye = (e, t) =>
|
|
417
|
+
}, Ye = (e, t) => En(e, bn(t)), oe = (e, t, r) => new Promise((s, n) => {
|
|
418
418
|
var i = (o) => {
|
|
419
419
|
try {
|
|
420
420
|
l(r.next(o));
|
|
@@ -434,7 +434,7 @@ class St {
|
|
|
434
434
|
constructor(t) {
|
|
435
435
|
this.resolver = t.resolver, this.options = t.options;
|
|
436
436
|
const r = gn(new Error());
|
|
437
|
-
this.info = Ye(
|
|
437
|
+
this.info = Ye(Xe({}, t.info), {
|
|
438
438
|
callFrame: r
|
|
439
439
|
}), this.isUsed = !1;
|
|
440
440
|
}
|
|
@@ -490,7 +490,7 @@ class St {
|
|
|
490
490
|
const a = this.wrapResolver(this.resolver), l = this.extendResolverArgs({
|
|
491
491
|
request: t.request,
|
|
492
492
|
parsedResult: n
|
|
493
|
-
}), o = yield a(Ye(
|
|
493
|
+
}), o = yield a(Ye(Xe({}, l), {
|
|
494
494
|
request: t.request
|
|
495
495
|
}));
|
|
496
496
|
return this.createExecutionResult({
|
|
@@ -508,7 +508,7 @@ class St {
|
|
|
508
508
|
if (vn(s)) {
|
|
509
509
|
this.isUsed = !1;
|
|
510
510
|
const { value: n, done: i } = s[Symbol.iterator]().next(), a = yield n;
|
|
511
|
-
return i && (this.isUsed = !0), !a && i ? (
|
|
511
|
+
return i && (this.isUsed = !0), !a && i ? (C(
|
|
512
512
|
this.resolverGeneratorResult,
|
|
513
513
|
"Failed to returned a previously stored generator response: the value is not a valid Response."
|
|
514
514
|
), this.resolverGeneratorResult.clone()) : (this.resolverGenerator || (this.resolverGenerator = s), a && (this.resolverGeneratorResult = a == null ? void 0 : a.clone()), a);
|
|
@@ -531,7 +531,7 @@ function Dt(e, t) {
|
|
|
531
531
|
function Ct(e) {
|
|
532
532
|
return e < 300 ? "#69AB32" : e < 400 ? "#F0BB4B" : "#E95F5D";
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Mt() {
|
|
535
535
|
const e = /* @__PURE__ */ new Date();
|
|
536
536
|
return [e.getHours(), e.getMinutes(), e.getSeconds()].map(String).map((t) => t.slice(0, 2)).map((t) => t.padStart(2, "0")).join(":");
|
|
537
537
|
}
|
|
@@ -551,7 +551,7 @@ var Tn = (e, t, r) => new Promise((s, n) => {
|
|
|
551
551
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
552
552
|
l((r = r.apply(e, t)).next());
|
|
553
553
|
});
|
|
554
|
-
function
|
|
554
|
+
function qt(e) {
|
|
555
555
|
return Tn(this, null, function* () {
|
|
556
556
|
const r = yield e.clone().text();
|
|
557
557
|
return {
|
|
@@ -723,10 +723,10 @@ var Cn = (e, t, r) => new Promise((s, n) => {
|
|
|
723
723
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
724
724
|
l((r = r.apply(e, t)).next());
|
|
725
725
|
});
|
|
726
|
-
const { message:
|
|
726
|
+
const { message: Mn } = Dn;
|
|
727
727
|
function Ft(e) {
|
|
728
728
|
return Cn(this, null, function* () {
|
|
729
|
-
const t = e.clone(), r = yield t.text(), s = t.status || 200, n = t.statusText ||
|
|
729
|
+
const t = e.clone(), r = yield t.text(), s = t.status || 200, n = t.statusText || Mn[s] || "OK";
|
|
730
730
|
return {
|
|
731
731
|
status: s,
|
|
732
732
|
statusText: n,
|
|
@@ -735,7 +735,7 @@ function Ft(e) {
|
|
|
735
735
|
};
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function qn(e) {
|
|
739
739
|
for (var t = [], r = 0; r < e.length; ) {
|
|
740
740
|
var s = e[r];
|
|
741
741
|
if (s === "*" || s === "+" || s === "?") {
|
|
@@ -805,58 +805,58 @@ function Mn(e) {
|
|
|
805
805
|
}
|
|
806
806
|
function $n(e, t) {
|
|
807
807
|
t === void 0 && (t = {});
|
|
808
|
-
for (var r =
|
|
808
|
+
for (var r = qn(e), s = t.prefixes, n = s === void 0 ? "./" : s, i = t.delimiter, a = i === void 0 ? "/#?" : i, l = [], o = 0, c = 0, u = "", h = function(N) {
|
|
809
809
|
if (c < r.length && r[c].type === N)
|
|
810
810
|
return r[c++].value;
|
|
811
811
|
}, d = function(N) {
|
|
812
|
-
var
|
|
813
|
-
if (
|
|
814
|
-
return
|
|
812
|
+
var R = h(N);
|
|
813
|
+
if (R !== void 0)
|
|
814
|
+
return R;
|
|
815
815
|
var L = r[c], ge = L.type, kr = L.index;
|
|
816
816
|
throw new TypeError("Unexpected ".concat(ge, " at ").concat(kr, ", expected ").concat(N));
|
|
817
817
|
}, m = function() {
|
|
818
|
-
for (var N = "",
|
|
819
|
-
N +=
|
|
818
|
+
for (var N = "", R; R = h("CHAR") || h("ESCAPED_CHAR"); )
|
|
819
|
+
N += R;
|
|
820
820
|
return N;
|
|
821
|
-
},
|
|
822
|
-
for (var
|
|
823
|
-
var ge = L[
|
|
821
|
+
}, p = function(N) {
|
|
822
|
+
for (var R = 0, L = a; R < L.length; R++) {
|
|
823
|
+
var ge = L[R];
|
|
824
824
|
if (N.indexOf(ge) > -1)
|
|
825
825
|
return !0;
|
|
826
826
|
}
|
|
827
827
|
return !1;
|
|
828
828
|
}, y = function(N) {
|
|
829
|
-
var
|
|
830
|
-
if (
|
|
831
|
-
throw new TypeError('Must have text between two parameters, missing text after "'.concat(
|
|
832
|
-
return !L ||
|
|
829
|
+
var R = l[l.length - 1], L = N || (R && typeof R == "string" ? R : "");
|
|
830
|
+
if (R && !L)
|
|
831
|
+
throw new TypeError('Must have text between two parameters, missing text after "'.concat(R.name, '"'));
|
|
832
|
+
return !L || p(L) ? "[^".concat(q(a), "]+?") : "(?:(?!".concat(q(L), ")[^").concat(q(a), "])+?");
|
|
833
833
|
}; c < r.length; ) {
|
|
834
|
-
var
|
|
835
|
-
if (E ||
|
|
836
|
-
var
|
|
837
|
-
n.indexOf(
|
|
834
|
+
var g = h("CHAR"), E = h("NAME"), b = h("PATTERN");
|
|
835
|
+
if (E || b) {
|
|
836
|
+
var v = g || "";
|
|
837
|
+
n.indexOf(v) === -1 && (u += v, v = ""), u && (l.push(u), u = ""), l.push({
|
|
838
838
|
name: E || o++,
|
|
839
|
-
prefix:
|
|
839
|
+
prefix: v,
|
|
840
840
|
suffix: "",
|
|
841
|
-
pattern:
|
|
841
|
+
pattern: b || y(v),
|
|
842
842
|
modifier: h("MODIFIER") || ""
|
|
843
843
|
});
|
|
844
844
|
continue;
|
|
845
845
|
}
|
|
846
|
-
var _ =
|
|
846
|
+
var _ = g || h("ESCAPED_CHAR");
|
|
847
847
|
if (_) {
|
|
848
848
|
u += _;
|
|
849
849
|
continue;
|
|
850
850
|
}
|
|
851
851
|
u && (l.push(u), u = "");
|
|
852
|
-
var
|
|
853
|
-
if (
|
|
854
|
-
var
|
|
852
|
+
var A = h("OPEN");
|
|
853
|
+
if (A) {
|
|
854
|
+
var v = m(), x = h("NAME") || "", P = h("PATTERN") || "", M = m();
|
|
855
855
|
d("CLOSE"), l.push({
|
|
856
|
-
name:
|
|
857
|
-
pattern:
|
|
858
|
-
prefix:
|
|
859
|
-
suffix:
|
|
856
|
+
name: x || (P ? o++ : ""),
|
|
857
|
+
pattern: x && !P ? y(v) : P,
|
|
858
|
+
prefix: v,
|
|
859
|
+
suffix: M,
|
|
860
860
|
modifier: h("MODIFIER") || ""
|
|
861
861
|
});
|
|
862
862
|
continue;
|
|
@@ -882,8 +882,8 @@ function jn(e, t, r) {
|
|
|
882
882
|
if (a[d] === void 0)
|
|
883
883
|
return "continue";
|
|
884
884
|
var m = t[d - 1];
|
|
885
|
-
m.modifier === "*" || m.modifier === "+" ? c[m.name] = a[d].split(m.prefix + m.suffix).map(function(
|
|
886
|
-
return n(
|
|
885
|
+
m.modifier === "*" || m.modifier === "+" ? c[m.name] = a[d].split(m.prefix + m.suffix).map(function(p) {
|
|
886
|
+
return n(p, m);
|
|
887
887
|
}) : c[m.name] = n(a[d], m);
|
|
888
888
|
}, h = 1; h < a.length; h++)
|
|
889
889
|
u(h);
|
|
@@ -921,35 +921,35 @@ function Vn(e, t, r) {
|
|
|
921
921
|
}
|
|
922
922
|
function Wn(e, t, r) {
|
|
923
923
|
r === void 0 && (r = {});
|
|
924
|
-
for (var s = r.strict, n = s === void 0 ? !1 : s, i = r.start, a = i === void 0 ? !0 : i, l = r.end, o = l === void 0 ? !0 : l, c = r.encode, u = c === void 0 ? function(
|
|
925
|
-
return
|
|
926
|
-
} : c, h = r.delimiter, d = h === void 0 ? "/#?" : h, m = r.endsWith,
|
|
927
|
-
var _ = b
|
|
924
|
+
for (var s = r.strict, n = s === void 0 ? !1 : s, i = r.start, a = i === void 0 ? !0 : i, l = r.end, o = l === void 0 ? !0 : l, c = r.encode, u = c === void 0 ? function(R) {
|
|
925
|
+
return R;
|
|
926
|
+
} : c, h = r.delimiter, d = h === void 0 ? "/#?" : h, m = r.endsWith, p = m === void 0 ? "" : m, y = "[".concat(q(p), "]|$"), g = "[".concat(q(d), "]"), E = a ? "^" : "", b = 0, v = e; b < v.length; b++) {
|
|
927
|
+
var _ = v[b];
|
|
928
928
|
if (typeof _ == "string")
|
|
929
929
|
E += q(u(_));
|
|
930
930
|
else {
|
|
931
|
-
var
|
|
931
|
+
var A = q(u(_.prefix)), x = q(u(_.suffix));
|
|
932
932
|
if (_.pattern)
|
|
933
|
-
if (t && t.push(_),
|
|
933
|
+
if (t && t.push(_), A || x)
|
|
934
934
|
if (_.modifier === "+" || _.modifier === "*") {
|
|
935
|
-
var
|
|
936
|
-
E += "(?:".concat(
|
|
935
|
+
var P = _.modifier === "*" ? "?" : "";
|
|
936
|
+
E += "(?:".concat(A, "((?:").concat(_.pattern, ")(?:").concat(x).concat(A, "(?:").concat(_.pattern, "))*)").concat(x, ")").concat(P);
|
|
937
937
|
} else
|
|
938
|
-
E += "(?:".concat(
|
|
938
|
+
E += "(?:".concat(A, "(").concat(_.pattern, ")").concat(x, ")").concat(_.modifier);
|
|
939
939
|
else {
|
|
940
940
|
if (_.modifier === "+" || _.modifier === "*")
|
|
941
941
|
throw new TypeError('Can not repeat "'.concat(_.name, '" without a prefix and suffix'));
|
|
942
942
|
E += "(".concat(_.pattern, ")").concat(_.modifier);
|
|
943
943
|
}
|
|
944
944
|
else
|
|
945
|
-
E += "(?:".concat(
|
|
945
|
+
E += "(?:".concat(A).concat(x, ")").concat(_.modifier);
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
if (o)
|
|
949
|
-
n || (E += "".concat(
|
|
949
|
+
n || (E += "".concat(g, "?")), E += r.endsWith ? "(?=".concat(y, ")") : "$";
|
|
950
950
|
else {
|
|
951
|
-
var
|
|
952
|
-
n || (E += "(?:".concat(
|
|
951
|
+
var M = e[e.length - 1], N = typeof M == "string" ? g.indexOf(M[M.length - 1]) > -1 : M === void 0;
|
|
952
|
+
n || (E += "(?:".concat(g, "(?=").concat(y, "))?")), N || (E += "(?=".concat(g, "|").concat(y, ")"));
|
|
953
953
|
}
|
|
954
954
|
return new RegExp(E, Bt(r));
|
|
955
955
|
}
|
|
@@ -957,13 +957,13 @@ function Vt(e, t, r) {
|
|
|
957
957
|
return e instanceof RegExp ? Fn(e, t) : Array.isArray(e) ? Bn(e, t, r) : Vn(e, t, r);
|
|
958
958
|
}
|
|
959
959
|
var Gn = new TextEncoder();
|
|
960
|
-
function
|
|
960
|
+
function zn(e) {
|
|
961
961
|
return Gn.encode(e);
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function Hn(e, t) {
|
|
964
964
|
return new TextDecoder(t).decode(e);
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function Xn(e) {
|
|
967
967
|
return e.buffer.slice(
|
|
968
968
|
e.byteOffset,
|
|
969
969
|
e.byteOffset + e.byteLength
|
|
@@ -1007,10 +1007,10 @@ function rs(e) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
var fe = Ce(), Wt = class {
|
|
1009
1009
|
constructor(e) {
|
|
1010
|
-
|
|
1010
|
+
U(this, "prefix");
|
|
1011
1011
|
this.name = e, this.prefix = `[${this.name}]`;
|
|
1012
1012
|
const t = Je("DEBUG"), r = Je("LOG_LEVEL");
|
|
1013
|
-
t === "1" || t === "true" || typeof t < "u" && this.name.startsWith(t) ? (this.debug = Z(r, "debug") ?
|
|
1013
|
+
t === "1" || t === "true" || typeof t < "u" && this.name.startsWith(t) ? (this.debug = Z(r, "debug") ? D : this.debug, this.info = Z(r, "info") ? D : this.info, this.success = Z(r, "success") ? D : this.success, this.warning = Z(r, "warning") ? D : this.warning, this.error = Z(r, "error") ? D : this.error) : (this.info = D, this.success = D, this.warning = D, this.error = D, this.only = D);
|
|
1014
1014
|
}
|
|
1015
1015
|
extend(e) {
|
|
1016
1016
|
return new Wt(`${this.name}:${e}`);
|
|
@@ -1164,9 +1164,9 @@ var fe = Ce(), Wt = class {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
}, ns = class {
|
|
1166
1166
|
constructor() {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1167
|
+
U(this, "startTime");
|
|
1168
|
+
U(this, "endTime");
|
|
1169
|
+
U(this, "deltaTime");
|
|
1170
1170
|
this.startTime = performance.now();
|
|
1171
1171
|
}
|
|
1172
1172
|
measure() {
|
|
@@ -1174,7 +1174,7 @@ var fe = Ce(), Wt = class {
|
|
|
1174
1174
|
const e = this.endTime - this.startTime;
|
|
1175
1175
|
this.deltaTime = e.toFixed(2);
|
|
1176
1176
|
}
|
|
1177
|
-
},
|
|
1177
|
+
}, D = () => {
|
|
1178
1178
|
};
|
|
1179
1179
|
function ss(e, ...t) {
|
|
1180
1180
|
if (fe) {
|
|
@@ -1210,7 +1210,7 @@ function Z(e, t) {
|
|
|
1210
1210
|
function Qe(e) {
|
|
1211
1211
|
return typeof e > "u" ? "undefined" : e === null ? "null" : typeof e == "string" ? e : typeof e == "object" ? JSON.stringify(e) : e.toString();
|
|
1212
1212
|
}
|
|
1213
|
-
var
|
|
1213
|
+
var H = Symbol("isPatchedModule");
|
|
1214
1214
|
function Ke(e) {
|
|
1215
1215
|
return (
|
|
1216
1216
|
// @ts-ignore https://github.com/Microsoft/TypeScript/issues/24587
|
|
@@ -1223,7 +1223,7 @@ function as(e, t) {
|
|
|
1223
1223
|
function cs(e) {
|
|
1224
1224
|
delete globalThis[e];
|
|
1225
1225
|
}
|
|
1226
|
-
var
|
|
1226
|
+
var qe = class {
|
|
1227
1227
|
constructor(e) {
|
|
1228
1228
|
this.symbol = e, this.readyState = "INACTIVE", this.emitter = new de(), this.subscriptions = [], this.logger = new Wt(e.description), this.emitter.setMaxListeners(0), this.logger.info("constructing the interceptor...");
|
|
1229
1229
|
}
|
|
@@ -1313,7 +1313,7 @@ var Me = class {
|
|
|
1313
1313
|
clearInstance() {
|
|
1314
1314
|
cs(this.symbol), this.logger.info("cleared global instance!", this.symbol.description);
|
|
1315
1315
|
}
|
|
1316
|
-
}, Ne = class extends
|
|
1316
|
+
}, Ne = class extends qe {
|
|
1317
1317
|
constructor(e) {
|
|
1318
1318
|
Ne.symbol = Symbol(e.name), super(Ne.symbol), this.interceptors = e.interceptors;
|
|
1319
1319
|
}
|
|
@@ -1381,7 +1381,7 @@ function ms(e) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
).replace(/([^\/])(:)(?=\d+)/, "$1\\$2").replace(/^([^\/]+)(:)(?=\/\/)/, "$1\\$2");
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function zt(e, t, r) {
|
|
1385
1385
|
const s = fs(t, r), n = typeof s == "string" ? ms(s) : s, i = ls(e), a = Un(n, { decode: decodeURIComponent })(i), l = a && a.params || {};
|
|
1386
1386
|
return {
|
|
1387
1387
|
matches: a !== !1,
|
|
@@ -1394,130 +1394,144 @@ function se(e) {
|
|
|
1394
1394
|
const t = new URL(e.url);
|
|
1395
1395
|
return t.origin === location.origin ? t.pathname : t.origin + t.pathname;
|
|
1396
1396
|
}
|
|
1397
|
-
var ys = Object.create,
|
|
1398
|
-
return t || (0, e[
|
|
1397
|
+
var ys = Object.create, Ht = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, Xt = Object.getOwnPropertyNames, vs = Object.getPrototypeOf, ws = Object.prototype.hasOwnProperty, Es = (e, t) => function() {
|
|
1398
|
+
return t || (0, e[Xt(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
1399
1399
|
}, bs = (e, t, r, s) => {
|
|
1400
1400
|
if (t && typeof t == "object" || typeof t == "function")
|
|
1401
|
-
for (let n of
|
|
1402
|
-
!
|
|
1401
|
+
for (let n of Xt(t))
|
|
1402
|
+
!ws.call(e, n) && n !== r && Ht(e, n, { get: () => t[n], enumerable: !(s = gs(t, n)) || s.enumerable });
|
|
1403
1403
|
return e;
|
|
1404
1404
|
}, _s = (e, t, r) => (r = e != null ? ys(vs(e)) : {}, bs(
|
|
1405
1405
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
1406
1406
|
// file that has been converted to a CommonJS file using a Babel-
|
|
1407
1407
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1408
1408
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1409
|
-
|
|
1409
|
+
Ht(r, "default", { value: e, enumerable: !0 }),
|
|
1410
1410
|
e
|
|
1411
|
-
)), xs =
|
|
1411
|
+
)), xs = Es({
|
|
1412
1412
|
"node_modules/cookie/index.js"(e) {
|
|
1413
|
-
e.parse =
|
|
1414
|
-
var t = Object.prototype.toString, r = /^[\
|
|
1415
|
-
function
|
|
1416
|
-
if (typeof
|
|
1413
|
+
e.parse = l, e.serialize = u;
|
|
1414
|
+
var t = Object.prototype.toString, r = Object.prototype.hasOwnProperty, s = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/, n = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/, i = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, a = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
1415
|
+
function l(p, y) {
|
|
1416
|
+
if (typeof p != "string")
|
|
1417
1417
|
throw new TypeError("argument str must be a string");
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
if (v === -1)
|
|
1424
|
-
|
|
1425
|
-
else if (
|
|
1426
|
-
|
|
1418
|
+
var g = {}, E = p.length;
|
|
1419
|
+
if (E < 2) return g;
|
|
1420
|
+
var b = y && y.decode || h, v = 0, _ = 0, A = 0;
|
|
1421
|
+
do {
|
|
1422
|
+
if (_ = p.indexOf("=", v), _ === -1) break;
|
|
1423
|
+
if (A = p.indexOf(";", v), A === -1)
|
|
1424
|
+
A = E;
|
|
1425
|
+
else if (_ > A) {
|
|
1426
|
+
v = p.lastIndexOf(";", _ - 1) + 1;
|
|
1427
1427
|
continue;
|
|
1428
1428
|
}
|
|
1429
|
-
var
|
|
1430
|
-
if (
|
|
1431
|
-
var
|
|
1432
|
-
|
|
1429
|
+
var x = o(p, v, _), P = c(p, _, x), M = p.slice(x, P);
|
|
1430
|
+
if (!r.call(g, M)) {
|
|
1431
|
+
var N = o(p, _ + 1, A), R = c(p, A, N);
|
|
1432
|
+
p.charCodeAt(N) === 34 && p.charCodeAt(R - 1) === 34 && (N++, R--);
|
|
1433
|
+
var L = p.slice(N, R);
|
|
1434
|
+
g[M] = m(L, b);
|
|
1433
1435
|
}
|
|
1434
|
-
|
|
1436
|
+
v = A + 1;
|
|
1437
|
+
} while (v < E);
|
|
1438
|
+
return g;
|
|
1439
|
+
}
|
|
1440
|
+
function o(p, y, g) {
|
|
1441
|
+
do {
|
|
1442
|
+
var E = p.charCodeAt(y);
|
|
1443
|
+
if (E !== 32 && E !== 9) return y;
|
|
1444
|
+
} while (++y < g);
|
|
1445
|
+
return g;
|
|
1446
|
+
}
|
|
1447
|
+
function c(p, y, g) {
|
|
1448
|
+
for (; y > g; ) {
|
|
1449
|
+
var E = p.charCodeAt(--y);
|
|
1450
|
+
if (E !== 32 && E !== 9) return y + 1;
|
|
1435
1451
|
}
|
|
1436
|
-
return
|
|
1452
|
+
return g;
|
|
1437
1453
|
}
|
|
1438
|
-
function
|
|
1439
|
-
var
|
|
1440
|
-
if (typeof
|
|
1454
|
+
function u(p, y, g) {
|
|
1455
|
+
var E = g && g.encode || encodeURIComponent;
|
|
1456
|
+
if (typeof E != "function")
|
|
1441
1457
|
throw new TypeError("option encode is invalid");
|
|
1442
|
-
if (!
|
|
1458
|
+
if (!s.test(p))
|
|
1443
1459
|
throw new TypeError("argument name is invalid");
|
|
1444
|
-
var
|
|
1445
|
-
if (
|
|
1460
|
+
var b = E(y);
|
|
1461
|
+
if (!n.test(b))
|
|
1446
1462
|
throw new TypeError("argument val is invalid");
|
|
1447
|
-
var
|
|
1448
|
-
if (
|
|
1449
|
-
|
|
1450
|
-
|
|
1463
|
+
var v = p + "=" + b;
|
|
1464
|
+
if (!g) return v;
|
|
1465
|
+
if (g.maxAge != null) {
|
|
1466
|
+
var _ = Math.floor(g.maxAge);
|
|
1467
|
+
if (!isFinite(_))
|
|
1451
1468
|
throw new TypeError("option maxAge is invalid");
|
|
1452
|
-
|
|
1469
|
+
v += "; Max-Age=" + _;
|
|
1453
1470
|
}
|
|
1454
|
-
if (
|
|
1455
|
-
if (!
|
|
1471
|
+
if (g.domain) {
|
|
1472
|
+
if (!i.test(g.domain))
|
|
1456
1473
|
throw new TypeError("option domain is invalid");
|
|
1457
|
-
|
|
1474
|
+
v += "; Domain=" + g.domain;
|
|
1458
1475
|
}
|
|
1459
|
-
if (
|
|
1460
|
-
if (!
|
|
1476
|
+
if (g.path) {
|
|
1477
|
+
if (!a.test(g.path))
|
|
1461
1478
|
throw new TypeError("option path is invalid");
|
|
1462
|
-
|
|
1479
|
+
v += "; Path=" + g.path;
|
|
1463
1480
|
}
|
|
1464
|
-
if (
|
|
1465
|
-
var
|
|
1466
|
-
if (!
|
|
1481
|
+
if (g.expires) {
|
|
1482
|
+
var A = g.expires;
|
|
1483
|
+
if (!d(A) || isNaN(A.valueOf()))
|
|
1467
1484
|
throw new TypeError("option expires is invalid");
|
|
1468
|
-
|
|
1485
|
+
v += "; Expires=" + A.toUTCString();
|
|
1469
1486
|
}
|
|
1470
|
-
if (
|
|
1471
|
-
var
|
|
1472
|
-
switch (
|
|
1487
|
+
if (g.httpOnly && (v += "; HttpOnly"), g.secure && (v += "; Secure"), g.partitioned && (v += "; Partitioned"), g.priority) {
|
|
1488
|
+
var x = typeof g.priority == "string" ? g.priority.toLowerCase() : g.priority;
|
|
1489
|
+
switch (x) {
|
|
1473
1490
|
case "low":
|
|
1474
|
-
|
|
1491
|
+
v += "; Priority=Low";
|
|
1475
1492
|
break;
|
|
1476
1493
|
case "medium":
|
|
1477
|
-
|
|
1494
|
+
v += "; Priority=Medium";
|
|
1478
1495
|
break;
|
|
1479
1496
|
case "high":
|
|
1480
|
-
|
|
1497
|
+
v += "; Priority=High";
|
|
1481
1498
|
break;
|
|
1482
1499
|
default:
|
|
1483
1500
|
throw new TypeError("option priority is invalid");
|
|
1484
1501
|
}
|
|
1485
1502
|
}
|
|
1486
|
-
if (
|
|
1487
|
-
var
|
|
1488
|
-
switch (
|
|
1503
|
+
if (g.sameSite) {
|
|
1504
|
+
var P = typeof g.sameSite == "string" ? g.sameSite.toLowerCase() : g.sameSite;
|
|
1505
|
+
switch (P) {
|
|
1489
1506
|
case !0:
|
|
1490
|
-
|
|
1507
|
+
v += "; SameSite=Strict";
|
|
1491
1508
|
break;
|
|
1492
1509
|
case "lax":
|
|
1493
|
-
|
|
1510
|
+
v += "; SameSite=Lax";
|
|
1494
1511
|
break;
|
|
1495
1512
|
case "strict":
|
|
1496
|
-
|
|
1513
|
+
v += "; SameSite=Strict";
|
|
1497
1514
|
break;
|
|
1498
1515
|
case "none":
|
|
1499
|
-
|
|
1516
|
+
v += "; SameSite=None";
|
|
1500
1517
|
break;
|
|
1501
1518
|
default:
|
|
1502
1519
|
throw new TypeError("option sameSite is invalid");
|
|
1503
1520
|
}
|
|
1504
1521
|
}
|
|
1505
|
-
return
|
|
1522
|
+
return v;
|
|
1506
1523
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return
|
|
1524
|
+
function h(p) {
|
|
1525
|
+
return p.indexOf("%") !== -1 ? decodeURIComponent(p) : p;
|
|
1509
1526
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return
|
|
1512
|
-
}
|
|
1513
|
-
function l(c) {
|
|
1514
|
-
return t.call(c) === "[object Date]" || c instanceof Date;
|
|
1527
|
+
function d(p) {
|
|
1528
|
+
return t.call(p) === "[object Date]";
|
|
1515
1529
|
}
|
|
1516
|
-
function
|
|
1530
|
+
function m(p, y) {
|
|
1517
1531
|
try {
|
|
1518
|
-
return
|
|
1532
|
+
return y(p);
|
|
1519
1533
|
} catch {
|
|
1520
|
-
return
|
|
1534
|
+
return p;
|
|
1521
1535
|
}
|
|
1522
1536
|
}
|
|
1523
1537
|
}
|
|
@@ -1553,23 +1567,23 @@ var Os = Object.create, Jt = Object.defineProperty, As = Object.getOwnPropertyDe
|
|
|
1553
1567
|
return typeof o == "string" && !!o.trim();
|
|
1554
1568
|
}
|
|
1555
1569
|
function n(o, c) {
|
|
1556
|
-
var u = o.split(";").filter(s), h = u.shift(), d = i(h), m = d.name,
|
|
1570
|
+
var u = o.split(";").filter(s), h = u.shift(), d = i(h), m = d.name, p = d.value;
|
|
1557
1571
|
c = c ? Object.assign({}, r, c) : r;
|
|
1558
1572
|
try {
|
|
1559
|
-
|
|
1560
|
-
} catch (
|
|
1573
|
+
p = c.decodeValues ? decodeURIComponent(p) : p;
|
|
1574
|
+
} catch (g) {
|
|
1561
1575
|
console.error(
|
|
1562
|
-
"set-cookie-parser encountered an error while decoding a cookie with value '" +
|
|
1563
|
-
|
|
1576
|
+
"set-cookie-parser encountered an error while decoding a cookie with value '" + p + "'. Set options.decodeValues to false to disable this feature.",
|
|
1577
|
+
g
|
|
1564
1578
|
);
|
|
1565
1579
|
}
|
|
1566
1580
|
var y = {
|
|
1567
1581
|
name: m,
|
|
1568
|
-
value:
|
|
1582
|
+
value: p
|
|
1569
1583
|
};
|
|
1570
|
-
return u.forEach(function(
|
|
1571
|
-
var E =
|
|
1572
|
-
|
|
1584
|
+
return u.forEach(function(g) {
|
|
1585
|
+
var E = g.split("="), b = E.shift().trimLeft().toLowerCase(), v = E.join("=");
|
|
1586
|
+
b === "expires" ? y.expires = new Date(v) : b === "max-age" ? y.maxAge = parseInt(v, 10) : b === "secure" ? y.secure = !0 : b === "httponly" ? y.httpOnly = !0 : b === "samesite" ? y.sameSite = v : y[b] = v;
|
|
1573
1587
|
}), y;
|
|
1574
1588
|
}
|
|
1575
1589
|
function i(o) {
|
|
@@ -1595,8 +1609,8 @@ var Os = Object.create, Jt = Object.defineProperty, As = Object.getOwnPropertyDe
|
|
|
1595
1609
|
if (Array.isArray(o) || (o = [o]), c = c ? Object.assign({}, r, c) : r, c.map) {
|
|
1596
1610
|
var h = {};
|
|
1597
1611
|
return o.filter(s).reduce(function(d, m) {
|
|
1598
|
-
var
|
|
1599
|
-
return d[
|
|
1612
|
+
var p = n(m, c);
|
|
1613
|
+
return d[p.name] = p, d;
|
|
1600
1614
|
}, h);
|
|
1601
1615
|
} else
|
|
1602
1616
|
return o.filter(s).map(function(d) {
|
|
@@ -1608,8 +1622,8 @@ var Os = Object.create, Jt = Object.defineProperty, As = Object.getOwnPropertyDe
|
|
|
1608
1622
|
return o;
|
|
1609
1623
|
if (typeof o != "string")
|
|
1610
1624
|
return [];
|
|
1611
|
-
var c = [], u = 0, h, d, m,
|
|
1612
|
-
function
|
|
1625
|
+
var c = [], u = 0, h, d, m, p, y;
|
|
1626
|
+
function g() {
|
|
1613
1627
|
for (; u < o.length && /\s/.test(o.charAt(u)); )
|
|
1614
1628
|
u += 1;
|
|
1615
1629
|
return u < o.length;
|
|
@@ -1618,11 +1632,11 @@ var Os = Object.create, Jt = Object.defineProperty, As = Object.getOwnPropertyDe
|
|
|
1618
1632
|
return d = o.charAt(u), d !== "=" && d !== ";" && d !== ",";
|
|
1619
1633
|
}
|
|
1620
1634
|
for (; u < o.length; ) {
|
|
1621
|
-
for (h = u, y = !1;
|
|
1635
|
+
for (h = u, y = !1; g(); )
|
|
1622
1636
|
if (d = o.charAt(u), d === ",") {
|
|
1623
|
-
for (m = u, u += 1,
|
|
1637
|
+
for (m = u, u += 1, g(), p = u; u < o.length && E(); )
|
|
1624
1638
|
u += 1;
|
|
1625
|
-
u < o.length && o.charAt(u) === "=" ? (y = !0, u =
|
|
1639
|
+
u < o.length && o.charAt(u) === "=" ? (y = !0, u = p, c.push(o.substring(h, m)), h = u) : u = m + 1;
|
|
1626
1640
|
} else
|
|
1627
1641
|
u += 1;
|
|
1628
1642
|
(!y || u >= o.length) && c.push(o.substring(h, o.length));
|
|
@@ -1743,12 +1757,12 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
1743
1757
|
}), t.size === 0 && this.store.delete(r);
|
|
1744
1758
|
});
|
|
1745
1759
|
}
|
|
1746
|
-
}, pe = new Ds(), Cs = Object.defineProperty, rt = Object.getOwnPropertySymbols,
|
|
1760
|
+
}, pe = new Ds(), Cs = Object.defineProperty, rt = Object.getOwnPropertySymbols, Ms = Object.prototype.hasOwnProperty, qs = Object.prototype.propertyIsEnumerable, nt = (e, t, r) => t in e ? Cs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ae = (e, t) => {
|
|
1747
1761
|
for (var r in t || (t = {}))
|
|
1748
|
-
|
|
1762
|
+
Ms.call(t, r) && nt(e, r, t[r]);
|
|
1749
1763
|
if (rt)
|
|
1750
1764
|
for (var r of rt(t))
|
|
1751
|
-
|
|
1765
|
+
qs.call(t, r) && nt(e, r, t[r]);
|
|
1752
1766
|
return e;
|
|
1753
1767
|
};
|
|
1754
1768
|
function st() {
|
|
@@ -1813,14 +1827,14 @@ class js extends St {
|
|
|
1813
1827
|
if (r instanceof RegExp || Gt(r) === r)
|
|
1814
1828
|
return;
|
|
1815
1829
|
hs(r).forEach((i, a) => {
|
|
1816
|
-
}),
|
|
1830
|
+
}), O.warn(
|
|
1817
1831
|
`Found a redundant usage of query parameters in the request handler URL for "${t} ${r}". Please match against a path instead and access query parameters in the response resolver function using "req.url.searchParams".`
|
|
1818
1832
|
);
|
|
1819
1833
|
}
|
|
1820
1834
|
parse(t) {
|
|
1821
1835
|
return it(this, null, function* () {
|
|
1822
1836
|
var r;
|
|
1823
|
-
const s = new URL(t.request.url), n =
|
|
1837
|
+
const s = new URL(t.request.url), n = zt(
|
|
1824
1838
|
s,
|
|
1825
1839
|
this.info.path,
|
|
1826
1840
|
(r = t.resolutionContext) == null ? void 0 : r.baseUrl
|
|
@@ -1847,10 +1861,10 @@ class js extends St {
|
|
|
1847
1861
|
}
|
|
1848
1862
|
log(t) {
|
|
1849
1863
|
return it(this, null, function* () {
|
|
1850
|
-
const r = se(t.request), s = yield
|
|
1864
|
+
const r = se(t.request), s = yield qt(t.request), n = yield Ft(t.response), i = Ct(n.status);
|
|
1851
1865
|
console.groupCollapsed(
|
|
1852
|
-
|
|
1853
|
-
|
|
1866
|
+
O.formatMessage("%s %s %s (%c%s%c)"),
|
|
1867
|
+
Mt(),
|
|
1854
1868
|
t.request.method,
|
|
1855
1869
|
r,
|
|
1856
1870
|
`color:${i}`,
|
|
@@ -1896,14 +1910,14 @@ function Kt(e, t) {
|
|
|
1896
1910
|
const r = e.locationOffset.column - 1, s = "".padStart(r) + e.body, n = t.line - 1, i = e.locationOffset.line - 1, a = t.line + i, l = t.line === 1 ? r : 0, o = t.column + l, c = `${e.name}:${a}:${o}
|
|
1897
1911
|
`, u = s.split(/\r\n|[\n\r]/g), h = u[n];
|
|
1898
1912
|
if (h.length > 120) {
|
|
1899
|
-
const d = Math.floor(o / 80), m = o % 80,
|
|
1913
|
+
const d = Math.floor(o / 80), m = o % 80, p = [];
|
|
1900
1914
|
for (let y = 0; y < h.length; y += 80)
|
|
1901
|
-
|
|
1915
|
+
p.push(h.slice(y, y + 80));
|
|
1902
1916
|
return c + ot([
|
|
1903
|
-
[`${a} |`,
|
|
1904
|
-
...
|
|
1917
|
+
[`${a} |`, p[0]],
|
|
1918
|
+
...p.slice(1, d + 1).map((y) => ["|", y]),
|
|
1905
1919
|
["|", "^".padStart(m)],
|
|
1906
|
-
["|",
|
|
1920
|
+
["|", p[d + 1]]
|
|
1907
1921
|
]);
|
|
1908
1922
|
}
|
|
1909
1923
|
return c + ot([
|
|
@@ -1976,9 +1990,9 @@ class $e extends Error {
|
|
|
1976
1990
|
Array.isArray(a) ? a : a ? [a] : void 0
|
|
1977
1991
|
);
|
|
1978
1992
|
const d = at(
|
|
1979
|
-
(s = this.nodes) === null || s === void 0 ? void 0 : s.map((
|
|
1993
|
+
(s = this.nodes) === null || s === void 0 ? void 0 : s.map((p) => p.loc).filter((p) => p != null)
|
|
1980
1994
|
);
|
|
1981
|
-
this.source = l ?? (d == null || (n = d[0]) === null || n === void 0 ? void 0 : n.source), this.positions = o ?? (d == null ? void 0 : d.map((
|
|
1995
|
+
this.source = l ?? (d == null || (n = d[0]) === null || n === void 0 ? void 0 : n.source), this.positions = o ?? (d == null ? void 0 : d.map((p) => p.start)), this.locations = o && l ? o.map((p) => ke(l, p)) : d == null ? void 0 : d.map((p) => ke(p.source, p.start));
|
|
1982
1996
|
const m = Fs(
|
|
1983
1997
|
u == null ? void 0 : u.extensions
|
|
1984
1998
|
) ? u == null ? void 0 : u.extensions : void 0;
|
|
@@ -2039,13 +2053,13 @@ class $e extends Error {
|
|
|
2039
2053
|
function at(e) {
|
|
2040
2054
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
2041
2055
|
}
|
|
2042
|
-
function
|
|
2056
|
+
function k(e, t, r) {
|
|
2043
2057
|
return new $e(`Syntax Error: ${r}`, {
|
|
2044
2058
|
source: e,
|
|
2045
2059
|
positions: [t]
|
|
2046
2060
|
});
|
|
2047
2061
|
}
|
|
2048
|
-
class
|
|
2062
|
+
class zs {
|
|
2049
2063
|
/**
|
|
2050
2064
|
* The character offset at which this Node begins.
|
|
2051
2065
|
*/
|
|
@@ -2116,7 +2130,7 @@ class Zt {
|
|
|
2116
2130
|
};
|
|
2117
2131
|
}
|
|
2118
2132
|
}
|
|
2119
|
-
const
|
|
2133
|
+
const Hs = {
|
|
2120
2134
|
Name: [],
|
|
2121
2135
|
Document: ["definitions"],
|
|
2122
2136
|
OperationDefinition: [
|
|
@@ -2191,20 +2205,20 @@ const Xs = {
|
|
|
2191
2205
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
2192
2206
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
2193
2207
|
};
|
|
2194
|
-
new Set(Object.keys(
|
|
2195
|
-
var
|
|
2208
|
+
new Set(Object.keys(Hs));
|
|
2209
|
+
var z;
|
|
2196
2210
|
(function(e) {
|
|
2197
2211
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
2198
|
-
})(
|
|
2212
|
+
})(z || (z = {}));
|
|
2199
2213
|
var Pe;
|
|
2200
2214
|
(function(e) {
|
|
2201
2215
|
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
2202
2216
|
})(Pe || (Pe = {}));
|
|
2203
|
-
var
|
|
2217
|
+
var w;
|
|
2204
2218
|
(function(e) {
|
|
2205
2219
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
2206
|
-
})(
|
|
2207
|
-
function
|
|
2220
|
+
})(w || (w = {}));
|
|
2221
|
+
function Xs(e) {
|
|
2208
2222
|
return e === 9 || e === 32;
|
|
2209
2223
|
}
|
|
2210
2224
|
function ne(e) {
|
|
@@ -2235,14 +2249,14 @@ function Js(e) {
|
|
|
2235
2249
|
}
|
|
2236
2250
|
function Qs(e) {
|
|
2237
2251
|
let t = 0;
|
|
2238
|
-
for (; t < e.length &&
|
|
2252
|
+
for (; t < e.length && Xs(e.charCodeAt(t)); )
|
|
2239
2253
|
++t;
|
|
2240
2254
|
return t;
|
|
2241
2255
|
}
|
|
2242
|
-
var
|
|
2256
|
+
var f;
|
|
2243
2257
|
(function(e) {
|
|
2244
2258
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
2245
|
-
})(
|
|
2259
|
+
})(f || (f = {}));
|
|
2246
2260
|
class Ks {
|
|
2247
2261
|
/**
|
|
2248
2262
|
* The previously focused non-ignored token.
|
|
@@ -2257,7 +2271,7 @@ class Ks {
|
|
|
2257
2271
|
* The character offset at which the current line begins.
|
|
2258
2272
|
*/
|
|
2259
2273
|
constructor(t) {
|
|
2260
|
-
const r = new Zt(
|
|
2274
|
+
const r = new Zt(f.SOF, 0, 0, 0, 0);
|
|
2261
2275
|
this.source = t, this.lastToken = r, this.token = r, this.line = 1, this.lineStart = 0;
|
|
2262
2276
|
}
|
|
2263
2277
|
get [Symbol.toStringTag]() {
|
|
@@ -2275,7 +2289,7 @@ class Ks {
|
|
|
2275
2289
|
*/
|
|
2276
2290
|
lookahead() {
|
|
2277
2291
|
let t = this.token;
|
|
2278
|
-
if (t.kind !==
|
|
2292
|
+
if (t.kind !== f.EOF)
|
|
2279
2293
|
do
|
|
2280
2294
|
if (t.next)
|
|
2281
2295
|
t = t.next;
|
|
@@ -2283,12 +2297,12 @@ class Ks {
|
|
|
2283
2297
|
const r = ei(this, t.end);
|
|
2284
2298
|
t.next = r, r.prev = t, t = r;
|
|
2285
2299
|
}
|
|
2286
|
-
while (t.kind ===
|
|
2300
|
+
while (t.kind === f.COMMENT);
|
|
2287
2301
|
return t;
|
|
2288
2302
|
}
|
|
2289
2303
|
}
|
|
2290
2304
|
function Zs(e) {
|
|
2291
|
-
return e ===
|
|
2305
|
+
return e === f.BANG || e === f.DOLLAR || e === f.AMP || e === f.PAREN_L || e === f.PAREN_R || e === f.SPREAD || e === f.COLON || e === f.EQUALS || e === f.AT || e === f.BRACKET_L || e === f.BRACKET_R || e === f.BRACE_L || e === f.PIPE || e === f.BRACE_R;
|
|
2292
2306
|
}
|
|
2293
2307
|
function J(e) {
|
|
2294
2308
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
@@ -2302,17 +2316,17 @@ function rr(e) {
|
|
|
2302
2316
|
function nr(e) {
|
|
2303
2317
|
return e >= 56320 && e <= 57343;
|
|
2304
2318
|
}
|
|
2305
|
-
function
|
|
2319
|
+
function F(e, t) {
|
|
2306
2320
|
const r = e.source.body.codePointAt(t);
|
|
2307
2321
|
if (r === void 0)
|
|
2308
|
-
return
|
|
2322
|
+
return f.EOF;
|
|
2309
2323
|
if (r >= 32 && r <= 126) {
|
|
2310
2324
|
const s = String.fromCodePoint(r);
|
|
2311
2325
|
return s === '"' ? `'"'` : `"${s}"`;
|
|
2312
2326
|
}
|
|
2313
2327
|
return "U+" + r.toString(16).toUpperCase().padStart(4, "0");
|
|
2314
2328
|
}
|
|
2315
|
-
function
|
|
2329
|
+
function I(e, t, r, s, n) {
|
|
2316
2330
|
const i = e.line, a = 1 + r - e.lineStart;
|
|
2317
2331
|
return new Zt(t, r, s, i, a, n);
|
|
2318
2332
|
}
|
|
@@ -2337,35 +2351,35 @@ function ei(e, t) {
|
|
|
2337
2351
|
case 35:
|
|
2338
2352
|
return ti(e, n);
|
|
2339
2353
|
case 33:
|
|
2340
|
-
return
|
|
2354
|
+
return I(e, f.BANG, n, n + 1);
|
|
2341
2355
|
case 36:
|
|
2342
|
-
return
|
|
2356
|
+
return I(e, f.DOLLAR, n, n + 1);
|
|
2343
2357
|
case 38:
|
|
2344
|
-
return
|
|
2358
|
+
return I(e, f.AMP, n, n + 1);
|
|
2345
2359
|
case 40:
|
|
2346
|
-
return
|
|
2360
|
+
return I(e, f.PAREN_L, n, n + 1);
|
|
2347
2361
|
case 41:
|
|
2348
|
-
return
|
|
2362
|
+
return I(e, f.PAREN_R, n, n + 1);
|
|
2349
2363
|
case 46:
|
|
2350
2364
|
if (r.charCodeAt(n + 1) === 46 && r.charCodeAt(n + 2) === 46)
|
|
2351
|
-
return
|
|
2365
|
+
return I(e, f.SPREAD, n, n + 3);
|
|
2352
2366
|
break;
|
|
2353
2367
|
case 58:
|
|
2354
|
-
return
|
|
2368
|
+
return I(e, f.COLON, n, n + 1);
|
|
2355
2369
|
case 61:
|
|
2356
|
-
return
|
|
2370
|
+
return I(e, f.EQUALS, n, n + 1);
|
|
2357
2371
|
case 64:
|
|
2358
|
-
return
|
|
2372
|
+
return I(e, f.AT, n, n + 1);
|
|
2359
2373
|
case 91:
|
|
2360
|
-
return
|
|
2374
|
+
return I(e, f.BRACKET_L, n, n + 1);
|
|
2361
2375
|
case 93:
|
|
2362
|
-
return
|
|
2376
|
+
return I(e, f.BRACKET_R, n, n + 1);
|
|
2363
2377
|
case 123:
|
|
2364
|
-
return
|
|
2378
|
+
return I(e, f.BRACE_L, n, n + 1);
|
|
2365
2379
|
case 124:
|
|
2366
|
-
return
|
|
2380
|
+
return I(e, f.PIPE, n, n + 1);
|
|
2367
2381
|
case 125:
|
|
2368
|
-
return
|
|
2382
|
+
return I(e, f.BRACE_R, n, n + 1);
|
|
2369
2383
|
case 34:
|
|
2370
2384
|
return r.charCodeAt(n + 1) === 34 && r.charCodeAt(n + 2) === 34 ? ai(e, n) : ni(e, n);
|
|
2371
2385
|
}
|
|
@@ -2373,13 +2387,13 @@ function ei(e, t) {
|
|
|
2373
2387
|
return ri(e, n, i);
|
|
2374
2388
|
if (tr(i))
|
|
2375
2389
|
return ci(e, n);
|
|
2376
|
-
throw
|
|
2390
|
+
throw k(
|
|
2377
2391
|
e.source,
|
|
2378
2392
|
n,
|
|
2379
|
-
i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : J(i) || me(r, n) ? `Unexpected character: ${
|
|
2393
|
+
i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : J(i) || me(r, n) ? `Unexpected character: ${F(e, n)}.` : `Invalid character: ${F(e, n)}.`
|
|
2380
2394
|
);
|
|
2381
2395
|
}
|
|
2382
|
-
return
|
|
2396
|
+
return I(e, f.EOF, s, s);
|
|
2383
2397
|
}
|
|
2384
2398
|
function ti(e, t) {
|
|
2385
2399
|
const r = e.source.body, s = r.length;
|
|
@@ -2395,9 +2409,9 @@ function ti(e, t) {
|
|
|
2395
2409
|
else
|
|
2396
2410
|
break;
|
|
2397
2411
|
}
|
|
2398
|
-
return
|
|
2412
|
+
return I(
|
|
2399
2413
|
e,
|
|
2400
|
-
|
|
2414
|
+
f.COMMENT,
|
|
2401
2415
|
t,
|
|
2402
2416
|
n,
|
|
2403
2417
|
r.slice(t + 1, n)
|
|
@@ -2408,10 +2422,10 @@ function ri(e, t, r) {
|
|
|
2408
2422
|
let n = t, i = r, a = !1;
|
|
2409
2423
|
if (i === 45 && (i = s.charCodeAt(++n)), i === 48) {
|
|
2410
2424
|
if (i = s.charCodeAt(++n), ne(i))
|
|
2411
|
-
throw
|
|
2425
|
+
throw k(
|
|
2412
2426
|
e.source,
|
|
2413
2427
|
n,
|
|
2414
|
-
`Invalid number, unexpected digit after 0: ${
|
|
2428
|
+
`Invalid number, unexpected digit after 0: ${F(
|
|
2415
2429
|
e,
|
|
2416
2430
|
n
|
|
2417
2431
|
)}.`
|
|
@@ -2419,17 +2433,17 @@ function ri(e, t, r) {
|
|
|
2419
2433
|
} else
|
|
2420
2434
|
n = _e(e, n, i), i = s.charCodeAt(n);
|
|
2421
2435
|
if (i === 46 && (a = !0, i = s.charCodeAt(++n), n = _e(e, n, i), i = s.charCodeAt(n)), (i === 69 || i === 101) && (a = !0, i = s.charCodeAt(++n), (i === 43 || i === 45) && (i = s.charCodeAt(++n)), n = _e(e, n, i), i = s.charCodeAt(n)), i === 46 || tr(i))
|
|
2422
|
-
throw
|
|
2436
|
+
throw k(
|
|
2423
2437
|
e.source,
|
|
2424
2438
|
n,
|
|
2425
|
-
`Invalid number, expected digit but got: ${
|
|
2439
|
+
`Invalid number, expected digit but got: ${F(
|
|
2426
2440
|
e,
|
|
2427
2441
|
n
|
|
2428
2442
|
)}.`
|
|
2429
2443
|
);
|
|
2430
|
-
return
|
|
2444
|
+
return I(
|
|
2431
2445
|
e,
|
|
2432
|
-
a ?
|
|
2446
|
+
a ? f.FLOAT : f.INT,
|
|
2433
2447
|
t,
|
|
2434
2448
|
n,
|
|
2435
2449
|
s.slice(t, n)
|
|
@@ -2437,10 +2451,10 @@ function ri(e, t, r) {
|
|
|
2437
2451
|
}
|
|
2438
2452
|
function _e(e, t, r) {
|
|
2439
2453
|
if (!ne(r))
|
|
2440
|
-
throw
|
|
2454
|
+
throw k(
|
|
2441
2455
|
e.source,
|
|
2442
2456
|
t,
|
|
2443
|
-
`Invalid number, expected digit but got: ${
|
|
2457
|
+
`Invalid number, expected digit but got: ${F(
|
|
2444
2458
|
e,
|
|
2445
2459
|
t
|
|
2446
2460
|
)}.`
|
|
@@ -2457,7 +2471,7 @@ function ni(e, t) {
|
|
|
2457
2471
|
for (; n < s; ) {
|
|
2458
2472
|
const l = r.charCodeAt(n);
|
|
2459
2473
|
if (l === 34)
|
|
2460
|
-
return a += r.slice(i, n),
|
|
2474
|
+
return a += r.slice(i, n), I(e, f.STRING, t, n + 1, a);
|
|
2461
2475
|
if (l === 92) {
|
|
2462
2476
|
a += r.slice(i, n);
|
|
2463
2477
|
const o = r.charCodeAt(n + 1) === 117 ? r.charCodeAt(n + 2) === 123 ? si(e, n) : ii(e, n) : oi(e, n);
|
|
@@ -2471,16 +2485,16 @@ function ni(e, t) {
|
|
|
2471
2485
|
else if (me(r, n))
|
|
2472
2486
|
n += 2;
|
|
2473
2487
|
else
|
|
2474
|
-
throw
|
|
2488
|
+
throw k(
|
|
2475
2489
|
e.source,
|
|
2476
2490
|
n,
|
|
2477
|
-
`Invalid character within String: ${
|
|
2491
|
+
`Invalid character within String: ${F(
|
|
2478
2492
|
e,
|
|
2479
2493
|
n
|
|
2480
2494
|
)}.`
|
|
2481
2495
|
);
|
|
2482
2496
|
}
|
|
2483
|
-
throw
|
|
2497
|
+
throw k(e.source, n, "Unterminated string.");
|
|
2484
2498
|
}
|
|
2485
2499
|
function si(e, t) {
|
|
2486
2500
|
const r = e.source.body;
|
|
@@ -2498,7 +2512,7 @@ function si(e, t) {
|
|
|
2498
2512
|
if (s = s << 4 | re(i), s < 0)
|
|
2499
2513
|
break;
|
|
2500
2514
|
}
|
|
2501
|
-
throw
|
|
2515
|
+
throw k(
|
|
2502
2516
|
e.source,
|
|
2503
2517
|
t,
|
|
2504
2518
|
`Invalid Unicode escape sequence: "${r.slice(
|
|
@@ -2522,7 +2536,7 @@ function ii(e, t) {
|
|
|
2522
2536
|
size: 12
|
|
2523
2537
|
};
|
|
2524
2538
|
}
|
|
2525
|
-
throw
|
|
2539
|
+
throw k(
|
|
2526
2540
|
e.source,
|
|
2527
2541
|
t,
|
|
2528
2542
|
`Invalid Unicode escape sequence: "${r.slice(t, t + 6)}".`
|
|
@@ -2579,7 +2593,7 @@ function oi(e, t) {
|
|
|
2579
2593
|
size: 2
|
|
2580
2594
|
};
|
|
2581
2595
|
}
|
|
2582
|
-
throw
|
|
2596
|
+
throw k(
|
|
2583
2597
|
e.source,
|
|
2584
2598
|
t,
|
|
2585
2599
|
`Invalid character escape sequence: "${r.slice(
|
|
@@ -2596,9 +2610,9 @@ function ai(e, t) {
|
|
|
2596
2610
|
const c = r.charCodeAt(i);
|
|
2597
2611
|
if (c === 34 && r.charCodeAt(i + 1) === 34 && r.charCodeAt(i + 2) === 34) {
|
|
2598
2612
|
l += r.slice(a, i), o.push(l);
|
|
2599
|
-
const u =
|
|
2613
|
+
const u = I(
|
|
2600
2614
|
e,
|
|
2601
|
-
|
|
2615
|
+
f.BLOCK_STRING,
|
|
2602
2616
|
t,
|
|
2603
2617
|
i + 3,
|
|
2604
2618
|
// Return a string of the lines joined with U+000A.
|
|
@@ -2620,16 +2634,16 @@ function ai(e, t) {
|
|
|
2620
2634
|
else if (me(r, i))
|
|
2621
2635
|
i += 2;
|
|
2622
2636
|
else
|
|
2623
|
-
throw
|
|
2637
|
+
throw k(
|
|
2624
2638
|
e.source,
|
|
2625
2639
|
i,
|
|
2626
|
-
`Invalid character within String: ${
|
|
2640
|
+
`Invalid character within String: ${F(
|
|
2627
2641
|
e,
|
|
2628
2642
|
i
|
|
2629
2643
|
)}.`
|
|
2630
2644
|
);
|
|
2631
2645
|
}
|
|
2632
|
-
throw
|
|
2646
|
+
throw k(e.source, i, "Unterminated string.");
|
|
2633
2647
|
}
|
|
2634
2648
|
function ci(e, t) {
|
|
2635
2649
|
const r = e.source.body, s = r.length;
|
|
@@ -2641,9 +2655,9 @@ function ci(e, t) {
|
|
|
2641
2655
|
else
|
|
2642
2656
|
break;
|
|
2643
2657
|
}
|
|
2644
|
-
return
|
|
2658
|
+
return I(
|
|
2645
2659
|
e,
|
|
2646
|
-
|
|
2660
|
+
f.NAME,
|
|
2647
2661
|
t,
|
|
2648
2662
|
n,
|
|
2649
2663
|
r.slice(t, n)
|
|
@@ -2762,9 +2776,9 @@ function gi(e) {
|
|
|
2762
2776
|
return yi(e, or);
|
|
2763
2777
|
}
|
|
2764
2778
|
function vi(e, t) {
|
|
2765
|
-
return new
|
|
2779
|
+
return new wi(e, t).parseDocument();
|
|
2766
2780
|
}
|
|
2767
|
-
class
|
|
2781
|
+
class wi {
|
|
2768
2782
|
constructor(t, r = {}) {
|
|
2769
2783
|
const s = gi(t) ? t : new or(t);
|
|
2770
2784
|
this._lexer = new Ks(s), this._options = r, this._tokenCounter = 0;
|
|
@@ -2773,9 +2787,9 @@ class Ei {
|
|
|
2773
2787
|
* Converts a name lex token into a name parse node.
|
|
2774
2788
|
*/
|
|
2775
2789
|
parseName() {
|
|
2776
|
-
const t = this.expectToken(
|
|
2790
|
+
const t = this.expectToken(f.NAME);
|
|
2777
2791
|
return this.node(t, {
|
|
2778
|
-
kind:
|
|
2792
|
+
kind: w.NAME,
|
|
2779
2793
|
value: t.value
|
|
2780
2794
|
});
|
|
2781
2795
|
}
|
|
@@ -2785,11 +2799,11 @@ class Ei {
|
|
|
2785
2799
|
*/
|
|
2786
2800
|
parseDocument() {
|
|
2787
2801
|
return this.node(this._lexer.token, {
|
|
2788
|
-
kind:
|
|
2802
|
+
kind: w.DOCUMENT,
|
|
2789
2803
|
definitions: this.many(
|
|
2790
|
-
|
|
2804
|
+
f.SOF,
|
|
2791
2805
|
this.parseDefinition,
|
|
2792
|
-
|
|
2806
|
+
f.EOF
|
|
2793
2807
|
)
|
|
2794
2808
|
});
|
|
2795
2809
|
}
|
|
@@ -2817,10 +2831,10 @@ class Ei {
|
|
|
2817
2831
|
* - InputObjectTypeDefinition
|
|
2818
2832
|
*/
|
|
2819
2833
|
parseDefinition() {
|
|
2820
|
-
if (this.peek(
|
|
2834
|
+
if (this.peek(f.BRACE_L))
|
|
2821
2835
|
return this.parseOperationDefinition();
|
|
2822
2836
|
const t = this.peekDescription(), r = t ? this._lexer.lookahead() : this._lexer.token;
|
|
2823
|
-
if (r.kind ===
|
|
2837
|
+
if (r.kind === f.NAME) {
|
|
2824
2838
|
switch (r.value) {
|
|
2825
2839
|
case "schema":
|
|
2826
2840
|
return this.parseSchemaDefinition();
|
|
@@ -2840,7 +2854,7 @@ class Ei {
|
|
|
2840
2854
|
return this.parseDirectiveDefinition();
|
|
2841
2855
|
}
|
|
2842
2856
|
if (t)
|
|
2843
|
-
throw
|
|
2857
|
+
throw k(
|
|
2844
2858
|
this._lexer.source,
|
|
2845
2859
|
this._lexer.token.start,
|
|
2846
2860
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -2866,10 +2880,10 @@ class Ei {
|
|
|
2866
2880
|
*/
|
|
2867
2881
|
parseOperationDefinition() {
|
|
2868
2882
|
const t = this._lexer.token;
|
|
2869
|
-
if (this.peek(
|
|
2883
|
+
if (this.peek(f.BRACE_L))
|
|
2870
2884
|
return this.node(t, {
|
|
2871
|
-
kind:
|
|
2872
|
-
operation:
|
|
2885
|
+
kind: w.OPERATION_DEFINITION,
|
|
2886
|
+
operation: z.QUERY,
|
|
2873
2887
|
name: void 0,
|
|
2874
2888
|
variableDefinitions: [],
|
|
2875
2889
|
directives: [],
|
|
@@ -2877,8 +2891,8 @@ class Ei {
|
|
|
2877
2891
|
});
|
|
2878
2892
|
const r = this.parseOperationType();
|
|
2879
2893
|
let s;
|
|
2880
|
-
return this.peek(
|
|
2881
|
-
kind:
|
|
2894
|
+
return this.peek(f.NAME) && (s = this.parseName()), this.node(t, {
|
|
2895
|
+
kind: w.OPERATION_DEFINITION,
|
|
2882
2896
|
operation: r,
|
|
2883
2897
|
name: s,
|
|
2884
2898
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
@@ -2890,14 +2904,14 @@ class Ei {
|
|
|
2890
2904
|
* OperationType : one of query mutation subscription
|
|
2891
2905
|
*/
|
|
2892
2906
|
parseOperationType() {
|
|
2893
|
-
const t = this.expectToken(
|
|
2907
|
+
const t = this.expectToken(f.NAME);
|
|
2894
2908
|
switch (t.value) {
|
|
2895
2909
|
case "query":
|
|
2896
|
-
return
|
|
2910
|
+
return z.QUERY;
|
|
2897
2911
|
case "mutation":
|
|
2898
|
-
return
|
|
2912
|
+
return z.MUTATION;
|
|
2899
2913
|
case "subscription":
|
|
2900
|
-
return
|
|
2914
|
+
return z.SUBSCRIPTION;
|
|
2901
2915
|
}
|
|
2902
2916
|
throw this.unexpected(t);
|
|
2903
2917
|
}
|
|
@@ -2906,9 +2920,9 @@ class Ei {
|
|
|
2906
2920
|
*/
|
|
2907
2921
|
parseVariableDefinitions() {
|
|
2908
2922
|
return this.optionalMany(
|
|
2909
|
-
|
|
2923
|
+
f.PAREN_L,
|
|
2910
2924
|
this.parseVariableDefinition,
|
|
2911
|
-
|
|
2925
|
+
f.PAREN_R
|
|
2912
2926
|
);
|
|
2913
2927
|
}
|
|
2914
2928
|
/**
|
|
@@ -2916,10 +2930,10 @@ class Ei {
|
|
|
2916
2930
|
*/
|
|
2917
2931
|
parseVariableDefinition() {
|
|
2918
2932
|
return this.node(this._lexer.token, {
|
|
2919
|
-
kind:
|
|
2933
|
+
kind: w.VARIABLE_DEFINITION,
|
|
2920
2934
|
variable: this.parseVariable(),
|
|
2921
|
-
type: (this.expectToken(
|
|
2922
|
-
defaultValue: this.expectOptionalToken(
|
|
2935
|
+
type: (this.expectToken(f.COLON), this.parseTypeReference()),
|
|
2936
|
+
defaultValue: this.expectOptionalToken(f.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
2923
2937
|
directives: this.parseConstDirectives()
|
|
2924
2938
|
});
|
|
2925
2939
|
}
|
|
@@ -2928,8 +2942,8 @@ class Ei {
|
|
|
2928
2942
|
*/
|
|
2929
2943
|
parseVariable() {
|
|
2930
2944
|
const t = this._lexer.token;
|
|
2931
|
-
return this.expectToken(
|
|
2932
|
-
kind:
|
|
2945
|
+
return this.expectToken(f.DOLLAR), this.node(t, {
|
|
2946
|
+
kind: w.VARIABLE,
|
|
2933
2947
|
name: this.parseName()
|
|
2934
2948
|
});
|
|
2935
2949
|
}
|
|
@@ -2940,11 +2954,11 @@ class Ei {
|
|
|
2940
2954
|
*/
|
|
2941
2955
|
parseSelectionSet() {
|
|
2942
2956
|
return this.node(this._lexer.token, {
|
|
2943
|
-
kind:
|
|
2957
|
+
kind: w.SELECTION_SET,
|
|
2944
2958
|
selections: this.many(
|
|
2945
|
-
|
|
2959
|
+
f.BRACE_L,
|
|
2946
2960
|
this.parseSelection,
|
|
2947
|
-
|
|
2961
|
+
f.BRACE_R
|
|
2948
2962
|
)
|
|
2949
2963
|
});
|
|
2950
2964
|
}
|
|
@@ -2955,7 +2969,7 @@ class Ei {
|
|
|
2955
2969
|
* - InlineFragment
|
|
2956
2970
|
*/
|
|
2957
2971
|
parseSelection() {
|
|
2958
|
-
return this.peek(
|
|
2972
|
+
return this.peek(f.SPREAD) ? this.parseFragment() : this.parseField();
|
|
2959
2973
|
}
|
|
2960
2974
|
/**
|
|
2961
2975
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
@@ -2965,13 +2979,13 @@ class Ei {
|
|
|
2965
2979
|
parseField() {
|
|
2966
2980
|
const t = this._lexer.token, r = this.parseName();
|
|
2967
2981
|
let s, n;
|
|
2968
|
-
return this.expectOptionalToken(
|
|
2969
|
-
kind:
|
|
2982
|
+
return this.expectOptionalToken(f.COLON) ? (s = r, n = this.parseName()) : n = r, this.node(t, {
|
|
2983
|
+
kind: w.FIELD,
|
|
2970
2984
|
alias: s,
|
|
2971
2985
|
name: n,
|
|
2972
2986
|
arguments: this.parseArguments(!1),
|
|
2973
2987
|
directives: this.parseDirectives(!1),
|
|
2974
|
-
selectionSet: this.peek(
|
|
2988
|
+
selectionSet: this.peek(f.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
2975
2989
|
});
|
|
2976
2990
|
}
|
|
2977
2991
|
/**
|
|
@@ -2979,15 +2993,15 @@ class Ei {
|
|
|
2979
2993
|
*/
|
|
2980
2994
|
parseArguments(t) {
|
|
2981
2995
|
const r = t ? this.parseConstArgument : this.parseArgument;
|
|
2982
|
-
return this.optionalMany(
|
|
2996
|
+
return this.optionalMany(f.PAREN_L, r, f.PAREN_R);
|
|
2983
2997
|
}
|
|
2984
2998
|
/**
|
|
2985
2999
|
* Argument[Const] : Name : Value[?Const]
|
|
2986
3000
|
*/
|
|
2987
3001
|
parseArgument(t = !1) {
|
|
2988
3002
|
const r = this._lexer.token, s = this.parseName();
|
|
2989
|
-
return this.expectToken(
|
|
2990
|
-
kind:
|
|
3003
|
+
return this.expectToken(f.COLON), this.node(r, {
|
|
3004
|
+
kind: w.ARGUMENT,
|
|
2991
3005
|
name: s,
|
|
2992
3006
|
value: this.parseValueLiteral(t)
|
|
2993
3007
|
});
|
|
@@ -3005,14 +3019,14 @@ class Ei {
|
|
|
3005
3019
|
*/
|
|
3006
3020
|
parseFragment() {
|
|
3007
3021
|
const t = this._lexer.token;
|
|
3008
|
-
this.expectToken(
|
|
3022
|
+
this.expectToken(f.SPREAD);
|
|
3009
3023
|
const r = this.expectOptionalKeyword("on");
|
|
3010
|
-
return !r && this.peek(
|
|
3011
|
-
kind:
|
|
3024
|
+
return !r && this.peek(f.NAME) ? this.node(t, {
|
|
3025
|
+
kind: w.FRAGMENT_SPREAD,
|
|
3012
3026
|
name: this.parseFragmentName(),
|
|
3013
3027
|
directives: this.parseDirectives(!1)
|
|
3014
3028
|
}) : this.node(t, {
|
|
3015
|
-
kind:
|
|
3029
|
+
kind: w.INLINE_FRAGMENT,
|
|
3016
3030
|
typeCondition: r ? this.parseNamedType() : void 0,
|
|
3017
3031
|
directives: this.parseDirectives(!1),
|
|
3018
3032
|
selectionSet: this.parseSelectionSet()
|
|
@@ -3027,14 +3041,14 @@ class Ei {
|
|
|
3027
3041
|
parseFragmentDefinition() {
|
|
3028
3042
|
const t = this._lexer.token;
|
|
3029
3043
|
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
|
|
3030
|
-
kind:
|
|
3044
|
+
kind: w.FRAGMENT_DEFINITION,
|
|
3031
3045
|
name: this.parseFragmentName(),
|
|
3032
3046
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
3033
3047
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
3034
3048
|
directives: this.parseDirectives(!1),
|
|
3035
3049
|
selectionSet: this.parseSelectionSet()
|
|
3036
3050
|
}) : this.node(t, {
|
|
3037
|
-
kind:
|
|
3051
|
+
kind: w.FRAGMENT_DEFINITION,
|
|
3038
3052
|
name: this.parseFragmentName(),
|
|
3039
3053
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
3040
3054
|
directives: this.parseDirectives(!1),
|
|
@@ -3071,50 +3085,50 @@ class Ei {
|
|
|
3071
3085
|
parseValueLiteral(t) {
|
|
3072
3086
|
const r = this._lexer.token;
|
|
3073
3087
|
switch (r.kind) {
|
|
3074
|
-
case
|
|
3088
|
+
case f.BRACKET_L:
|
|
3075
3089
|
return this.parseList(t);
|
|
3076
|
-
case
|
|
3090
|
+
case f.BRACE_L:
|
|
3077
3091
|
return this.parseObject(t);
|
|
3078
|
-
case
|
|
3092
|
+
case f.INT:
|
|
3079
3093
|
return this.advanceLexer(), this.node(r, {
|
|
3080
|
-
kind:
|
|
3094
|
+
kind: w.INT,
|
|
3081
3095
|
value: r.value
|
|
3082
3096
|
});
|
|
3083
|
-
case
|
|
3097
|
+
case f.FLOAT:
|
|
3084
3098
|
return this.advanceLexer(), this.node(r, {
|
|
3085
|
-
kind:
|
|
3099
|
+
kind: w.FLOAT,
|
|
3086
3100
|
value: r.value
|
|
3087
3101
|
});
|
|
3088
|
-
case
|
|
3089
|
-
case
|
|
3102
|
+
case f.STRING:
|
|
3103
|
+
case f.BLOCK_STRING:
|
|
3090
3104
|
return this.parseStringLiteral();
|
|
3091
|
-
case
|
|
3105
|
+
case f.NAME:
|
|
3092
3106
|
switch (this.advanceLexer(), r.value) {
|
|
3093
3107
|
case "true":
|
|
3094
3108
|
return this.node(r, {
|
|
3095
|
-
kind:
|
|
3109
|
+
kind: w.BOOLEAN,
|
|
3096
3110
|
value: !0
|
|
3097
3111
|
});
|
|
3098
3112
|
case "false":
|
|
3099
3113
|
return this.node(r, {
|
|
3100
|
-
kind:
|
|
3114
|
+
kind: w.BOOLEAN,
|
|
3101
3115
|
value: !1
|
|
3102
3116
|
});
|
|
3103
3117
|
case "null":
|
|
3104
3118
|
return this.node(r, {
|
|
3105
|
-
kind:
|
|
3119
|
+
kind: w.NULL
|
|
3106
3120
|
});
|
|
3107
3121
|
default:
|
|
3108
3122
|
return this.node(r, {
|
|
3109
|
-
kind:
|
|
3123
|
+
kind: w.ENUM,
|
|
3110
3124
|
value: r.value
|
|
3111
3125
|
});
|
|
3112
3126
|
}
|
|
3113
|
-
case
|
|
3127
|
+
case f.DOLLAR:
|
|
3114
3128
|
if (t)
|
|
3115
|
-
if (this.expectToken(
|
|
3129
|
+
if (this.expectToken(f.DOLLAR), this._lexer.token.kind === f.NAME) {
|
|
3116
3130
|
const s = this._lexer.token.value;
|
|
3117
|
-
throw
|
|
3131
|
+
throw k(
|
|
3118
3132
|
this._lexer.source,
|
|
3119
3133
|
r.start,
|
|
3120
3134
|
`Unexpected variable "$${s}" in constant value.`
|
|
@@ -3132,9 +3146,9 @@ class Ei {
|
|
|
3132
3146
|
parseStringLiteral() {
|
|
3133
3147
|
const t = this._lexer.token;
|
|
3134
3148
|
return this.advanceLexer(), this.node(t, {
|
|
3135
|
-
kind:
|
|
3149
|
+
kind: w.STRING,
|
|
3136
3150
|
value: t.value,
|
|
3137
|
-
block: t.kind ===
|
|
3151
|
+
block: t.kind === f.BLOCK_STRING
|
|
3138
3152
|
});
|
|
3139
3153
|
}
|
|
3140
3154
|
/**
|
|
@@ -3145,8 +3159,8 @@ class Ei {
|
|
|
3145
3159
|
parseList(t) {
|
|
3146
3160
|
const r = () => this.parseValueLiteral(t);
|
|
3147
3161
|
return this.node(this._lexer.token, {
|
|
3148
|
-
kind:
|
|
3149
|
-
values: this.any(
|
|
3162
|
+
kind: w.LIST,
|
|
3163
|
+
values: this.any(f.BRACKET_L, r, f.BRACKET_R)
|
|
3150
3164
|
});
|
|
3151
3165
|
}
|
|
3152
3166
|
/**
|
|
@@ -3159,8 +3173,8 @@ class Ei {
|
|
|
3159
3173
|
parseObject(t) {
|
|
3160
3174
|
const r = () => this.parseObjectField(t);
|
|
3161
3175
|
return this.node(this._lexer.token, {
|
|
3162
|
-
kind:
|
|
3163
|
-
fields: this.any(
|
|
3176
|
+
kind: w.OBJECT,
|
|
3177
|
+
fields: this.any(f.BRACE_L, r, f.BRACE_R)
|
|
3164
3178
|
});
|
|
3165
3179
|
}
|
|
3166
3180
|
/**
|
|
@@ -3168,8 +3182,8 @@ class Ei {
|
|
|
3168
3182
|
*/
|
|
3169
3183
|
parseObjectField(t) {
|
|
3170
3184
|
const r = this._lexer.token, s = this.parseName();
|
|
3171
|
-
return this.expectToken(
|
|
3172
|
-
kind:
|
|
3185
|
+
return this.expectToken(f.COLON), this.node(r, {
|
|
3186
|
+
kind: w.OBJECT_FIELD,
|
|
3173
3187
|
name: s,
|
|
3174
3188
|
value: this.parseValueLiteral(t)
|
|
3175
3189
|
});
|
|
@@ -3180,7 +3194,7 @@ class Ei {
|
|
|
3180
3194
|
*/
|
|
3181
3195
|
parseDirectives(t) {
|
|
3182
3196
|
const r = [];
|
|
3183
|
-
for (; this.peek(
|
|
3197
|
+
for (; this.peek(f.AT); )
|
|
3184
3198
|
r.push(this.parseDirective(t));
|
|
3185
3199
|
return r;
|
|
3186
3200
|
}
|
|
@@ -3194,8 +3208,8 @@ class Ei {
|
|
|
3194
3208
|
*/
|
|
3195
3209
|
parseDirective(t) {
|
|
3196
3210
|
const r = this._lexer.token;
|
|
3197
|
-
return this.expectToken(
|
|
3198
|
-
kind:
|
|
3211
|
+
return this.expectToken(f.AT), this.node(r, {
|
|
3212
|
+
kind: w.DIRECTIVE,
|
|
3199
3213
|
name: this.parseName(),
|
|
3200
3214
|
arguments: this.parseArguments(t)
|
|
3201
3215
|
});
|
|
@@ -3210,16 +3224,16 @@ class Ei {
|
|
|
3210
3224
|
parseTypeReference() {
|
|
3211
3225
|
const t = this._lexer.token;
|
|
3212
3226
|
let r;
|
|
3213
|
-
if (this.expectOptionalToken(
|
|
3227
|
+
if (this.expectOptionalToken(f.BRACKET_L)) {
|
|
3214
3228
|
const s = this.parseTypeReference();
|
|
3215
|
-
this.expectToken(
|
|
3216
|
-
kind:
|
|
3229
|
+
this.expectToken(f.BRACKET_R), r = this.node(t, {
|
|
3230
|
+
kind: w.LIST_TYPE,
|
|
3217
3231
|
type: s
|
|
3218
3232
|
});
|
|
3219
3233
|
} else
|
|
3220
3234
|
r = this.parseNamedType();
|
|
3221
|
-
return this.expectOptionalToken(
|
|
3222
|
-
kind:
|
|
3235
|
+
return this.expectOptionalToken(f.BANG) ? this.node(t, {
|
|
3236
|
+
kind: w.NON_NULL_TYPE,
|
|
3223
3237
|
type: r
|
|
3224
3238
|
}) : r;
|
|
3225
3239
|
}
|
|
@@ -3228,13 +3242,13 @@ class Ei {
|
|
|
3228
3242
|
*/
|
|
3229
3243
|
parseNamedType() {
|
|
3230
3244
|
return this.node(this._lexer.token, {
|
|
3231
|
-
kind:
|
|
3245
|
+
kind: w.NAMED_TYPE,
|
|
3232
3246
|
name: this.parseName()
|
|
3233
3247
|
});
|
|
3234
3248
|
}
|
|
3235
3249
|
// Implements the parsing rules in the Type Definition section.
|
|
3236
3250
|
peekDescription() {
|
|
3237
|
-
return this.peek(
|
|
3251
|
+
return this.peek(f.STRING) || this.peek(f.BLOCK_STRING);
|
|
3238
3252
|
}
|
|
3239
3253
|
/**
|
|
3240
3254
|
* Description : StringValue
|
|
@@ -3252,12 +3266,12 @@ class Ei {
|
|
|
3252
3266
|
const t = this._lexer.token, r = this.parseDescription();
|
|
3253
3267
|
this.expectKeyword("schema");
|
|
3254
3268
|
const s = this.parseConstDirectives(), n = this.many(
|
|
3255
|
-
|
|
3269
|
+
f.BRACE_L,
|
|
3256
3270
|
this.parseOperationTypeDefinition,
|
|
3257
|
-
|
|
3271
|
+
f.BRACE_R
|
|
3258
3272
|
);
|
|
3259
3273
|
return this.node(t, {
|
|
3260
|
-
kind:
|
|
3274
|
+
kind: w.SCHEMA_DEFINITION,
|
|
3261
3275
|
description: r,
|
|
3262
3276
|
directives: s,
|
|
3263
3277
|
operationTypes: n
|
|
@@ -3268,10 +3282,10 @@ class Ei {
|
|
|
3268
3282
|
*/
|
|
3269
3283
|
parseOperationTypeDefinition() {
|
|
3270
3284
|
const t = this._lexer.token, r = this.parseOperationType();
|
|
3271
|
-
this.expectToken(
|
|
3285
|
+
this.expectToken(f.COLON);
|
|
3272
3286
|
const s = this.parseNamedType();
|
|
3273
3287
|
return this.node(t, {
|
|
3274
|
-
kind:
|
|
3288
|
+
kind: w.OPERATION_TYPE_DEFINITION,
|
|
3275
3289
|
operation: r,
|
|
3276
3290
|
type: s
|
|
3277
3291
|
});
|
|
@@ -3284,7 +3298,7 @@ class Ei {
|
|
|
3284
3298
|
this.expectKeyword("scalar");
|
|
3285
3299
|
const s = this.parseName(), n = this.parseConstDirectives();
|
|
3286
3300
|
return this.node(t, {
|
|
3287
|
-
kind:
|
|
3301
|
+
kind: w.SCALAR_TYPE_DEFINITION,
|
|
3288
3302
|
description: r,
|
|
3289
3303
|
name: s,
|
|
3290
3304
|
directives: n
|
|
@@ -3300,7 +3314,7 @@ class Ei {
|
|
|
3300
3314
|
this.expectKeyword("type");
|
|
3301
3315
|
const s = this.parseName(), n = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
3302
3316
|
return this.node(t, {
|
|
3303
|
-
kind:
|
|
3317
|
+
kind: w.OBJECT_TYPE_DEFINITION,
|
|
3304
3318
|
description: r,
|
|
3305
3319
|
name: s,
|
|
3306
3320
|
interfaces: n,
|
|
@@ -3314,7 +3328,7 @@ class Ei {
|
|
|
3314
3328
|
* - ImplementsInterfaces & NamedType
|
|
3315
3329
|
*/
|
|
3316
3330
|
parseImplementsInterfaces() {
|
|
3317
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(
|
|
3331
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(f.AMP, this.parseNamedType) : [];
|
|
3318
3332
|
}
|
|
3319
3333
|
/**
|
|
3320
3334
|
* ```
|
|
@@ -3323,9 +3337,9 @@ class Ei {
|
|
|
3323
3337
|
*/
|
|
3324
3338
|
parseFieldsDefinition() {
|
|
3325
3339
|
return this.optionalMany(
|
|
3326
|
-
|
|
3340
|
+
f.BRACE_L,
|
|
3327
3341
|
this.parseFieldDefinition,
|
|
3328
|
-
|
|
3342
|
+
f.BRACE_R
|
|
3329
3343
|
);
|
|
3330
3344
|
}
|
|
3331
3345
|
/**
|
|
@@ -3334,10 +3348,10 @@ class Ei {
|
|
|
3334
3348
|
*/
|
|
3335
3349
|
parseFieldDefinition() {
|
|
3336
3350
|
const t = this._lexer.token, r = this.parseDescription(), s = this.parseName(), n = this.parseArgumentDefs();
|
|
3337
|
-
this.expectToken(
|
|
3351
|
+
this.expectToken(f.COLON);
|
|
3338
3352
|
const i = this.parseTypeReference(), a = this.parseConstDirectives();
|
|
3339
3353
|
return this.node(t, {
|
|
3340
|
-
kind:
|
|
3354
|
+
kind: w.FIELD_DEFINITION,
|
|
3341
3355
|
description: r,
|
|
3342
3356
|
name: s,
|
|
3343
3357
|
arguments: n,
|
|
@@ -3350,9 +3364,9 @@ class Ei {
|
|
|
3350
3364
|
*/
|
|
3351
3365
|
parseArgumentDefs() {
|
|
3352
3366
|
return this.optionalMany(
|
|
3353
|
-
|
|
3367
|
+
f.PAREN_L,
|
|
3354
3368
|
this.parseInputValueDef,
|
|
3355
|
-
|
|
3369
|
+
f.PAREN_R
|
|
3356
3370
|
);
|
|
3357
3371
|
}
|
|
3358
3372
|
/**
|
|
@@ -3361,13 +3375,13 @@ class Ei {
|
|
|
3361
3375
|
*/
|
|
3362
3376
|
parseInputValueDef() {
|
|
3363
3377
|
const t = this._lexer.token, r = this.parseDescription(), s = this.parseName();
|
|
3364
|
-
this.expectToken(
|
|
3378
|
+
this.expectToken(f.COLON);
|
|
3365
3379
|
const n = this.parseTypeReference();
|
|
3366
3380
|
let i;
|
|
3367
|
-
this.expectOptionalToken(
|
|
3381
|
+
this.expectOptionalToken(f.EQUALS) && (i = this.parseConstValueLiteral());
|
|
3368
3382
|
const a = this.parseConstDirectives();
|
|
3369
3383
|
return this.node(t, {
|
|
3370
|
-
kind:
|
|
3384
|
+
kind: w.INPUT_VALUE_DEFINITION,
|
|
3371
3385
|
description: r,
|
|
3372
3386
|
name: s,
|
|
3373
3387
|
type: n,
|
|
@@ -3384,7 +3398,7 @@ class Ei {
|
|
|
3384
3398
|
this.expectKeyword("interface");
|
|
3385
3399
|
const s = this.parseName(), n = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
3386
3400
|
return this.node(t, {
|
|
3387
|
-
kind:
|
|
3401
|
+
kind: w.INTERFACE_TYPE_DEFINITION,
|
|
3388
3402
|
description: r,
|
|
3389
3403
|
name: s,
|
|
3390
3404
|
interfaces: n,
|
|
@@ -3401,7 +3415,7 @@ class Ei {
|
|
|
3401
3415
|
this.expectKeyword("union");
|
|
3402
3416
|
const s = this.parseName(), n = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
|
|
3403
3417
|
return this.node(t, {
|
|
3404
|
-
kind:
|
|
3418
|
+
kind: w.UNION_TYPE_DEFINITION,
|
|
3405
3419
|
description: r,
|
|
3406
3420
|
name: s,
|
|
3407
3421
|
directives: n,
|
|
@@ -3414,7 +3428,7 @@ class Ei {
|
|
|
3414
3428
|
* - UnionMemberTypes | NamedType
|
|
3415
3429
|
*/
|
|
3416
3430
|
parseUnionMemberTypes() {
|
|
3417
|
-
return this.expectOptionalToken(
|
|
3431
|
+
return this.expectOptionalToken(f.EQUALS) ? this.delimitedMany(f.PIPE, this.parseNamedType) : [];
|
|
3418
3432
|
}
|
|
3419
3433
|
/**
|
|
3420
3434
|
* EnumTypeDefinition :
|
|
@@ -3425,7 +3439,7 @@ class Ei {
|
|
|
3425
3439
|
this.expectKeyword("enum");
|
|
3426
3440
|
const s = this.parseName(), n = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
|
|
3427
3441
|
return this.node(t, {
|
|
3428
|
-
kind:
|
|
3442
|
+
kind: w.ENUM_TYPE_DEFINITION,
|
|
3429
3443
|
description: r,
|
|
3430
3444
|
name: s,
|
|
3431
3445
|
directives: n,
|
|
@@ -3439,9 +3453,9 @@ class Ei {
|
|
|
3439
3453
|
*/
|
|
3440
3454
|
parseEnumValuesDefinition() {
|
|
3441
3455
|
return this.optionalMany(
|
|
3442
|
-
|
|
3456
|
+
f.BRACE_L,
|
|
3443
3457
|
this.parseEnumValueDefinition,
|
|
3444
|
-
|
|
3458
|
+
f.BRACE_R
|
|
3445
3459
|
);
|
|
3446
3460
|
}
|
|
3447
3461
|
/**
|
|
@@ -3450,7 +3464,7 @@ class Ei {
|
|
|
3450
3464
|
parseEnumValueDefinition() {
|
|
3451
3465
|
const t = this._lexer.token, r = this.parseDescription(), s = this.parseEnumValueName(), n = this.parseConstDirectives();
|
|
3452
3466
|
return this.node(t, {
|
|
3453
|
-
kind:
|
|
3467
|
+
kind: w.ENUM_VALUE_DEFINITION,
|
|
3454
3468
|
description: r,
|
|
3455
3469
|
name: s,
|
|
3456
3470
|
directives: n
|
|
@@ -3461,7 +3475,7 @@ class Ei {
|
|
|
3461
3475
|
*/
|
|
3462
3476
|
parseEnumValueName() {
|
|
3463
3477
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
3464
|
-
throw
|
|
3478
|
+
throw k(
|
|
3465
3479
|
this._lexer.source,
|
|
3466
3480
|
this._lexer.token.start,
|
|
3467
3481
|
`${ce(
|
|
@@ -3479,7 +3493,7 @@ class Ei {
|
|
|
3479
3493
|
this.expectKeyword("input");
|
|
3480
3494
|
const s = this.parseName(), n = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
|
|
3481
3495
|
return this.node(t, {
|
|
3482
|
-
kind:
|
|
3496
|
+
kind: w.INPUT_OBJECT_TYPE_DEFINITION,
|
|
3483
3497
|
description: r,
|
|
3484
3498
|
name: s,
|
|
3485
3499
|
directives: n,
|
|
@@ -3493,9 +3507,9 @@ class Ei {
|
|
|
3493
3507
|
*/
|
|
3494
3508
|
parseInputFieldsDefinition() {
|
|
3495
3509
|
return this.optionalMany(
|
|
3496
|
-
|
|
3510
|
+
f.BRACE_L,
|
|
3497
3511
|
this.parseInputValueDef,
|
|
3498
|
-
|
|
3512
|
+
f.BRACE_R
|
|
3499
3513
|
);
|
|
3500
3514
|
}
|
|
3501
3515
|
/**
|
|
@@ -3513,7 +3527,7 @@ class Ei {
|
|
|
3513
3527
|
*/
|
|
3514
3528
|
parseTypeSystemExtension() {
|
|
3515
3529
|
const t = this._lexer.lookahead();
|
|
3516
|
-
if (t.kind ===
|
|
3530
|
+
if (t.kind === f.NAME)
|
|
3517
3531
|
switch (t.value) {
|
|
3518
3532
|
case "schema":
|
|
3519
3533
|
return this.parseSchemaExtension();
|
|
@@ -3543,14 +3557,14 @@ class Ei {
|
|
|
3543
3557
|
const t = this._lexer.token;
|
|
3544
3558
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
3545
3559
|
const r = this.parseConstDirectives(), s = this.optionalMany(
|
|
3546
|
-
|
|
3560
|
+
f.BRACE_L,
|
|
3547
3561
|
this.parseOperationTypeDefinition,
|
|
3548
|
-
|
|
3562
|
+
f.BRACE_R
|
|
3549
3563
|
);
|
|
3550
3564
|
if (r.length === 0 && s.length === 0)
|
|
3551
3565
|
throw this.unexpected();
|
|
3552
3566
|
return this.node(t, {
|
|
3553
|
-
kind:
|
|
3567
|
+
kind: w.SCHEMA_EXTENSION,
|
|
3554
3568
|
directives: r,
|
|
3555
3569
|
operationTypes: s
|
|
3556
3570
|
});
|
|
@@ -3566,7 +3580,7 @@ class Ei {
|
|
|
3566
3580
|
if (s.length === 0)
|
|
3567
3581
|
throw this.unexpected();
|
|
3568
3582
|
return this.node(t, {
|
|
3569
|
-
kind:
|
|
3583
|
+
kind: w.SCALAR_TYPE_EXTENSION,
|
|
3570
3584
|
name: r,
|
|
3571
3585
|
directives: s
|
|
3572
3586
|
});
|
|
@@ -3584,7 +3598,7 @@ class Ei {
|
|
|
3584
3598
|
if (s.length === 0 && n.length === 0 && i.length === 0)
|
|
3585
3599
|
throw this.unexpected();
|
|
3586
3600
|
return this.node(t, {
|
|
3587
|
-
kind:
|
|
3601
|
+
kind: w.OBJECT_TYPE_EXTENSION,
|
|
3588
3602
|
name: r,
|
|
3589
3603
|
interfaces: s,
|
|
3590
3604
|
directives: n,
|
|
@@ -3604,7 +3618,7 @@ class Ei {
|
|
|
3604
3618
|
if (s.length === 0 && n.length === 0 && i.length === 0)
|
|
3605
3619
|
throw this.unexpected();
|
|
3606
3620
|
return this.node(t, {
|
|
3607
|
-
kind:
|
|
3621
|
+
kind: w.INTERFACE_TYPE_EXTENSION,
|
|
3608
3622
|
name: r,
|
|
3609
3623
|
interfaces: s,
|
|
3610
3624
|
directives: n,
|
|
@@ -3623,7 +3637,7 @@ class Ei {
|
|
|
3623
3637
|
if (s.length === 0 && n.length === 0)
|
|
3624
3638
|
throw this.unexpected();
|
|
3625
3639
|
return this.node(t, {
|
|
3626
|
-
kind:
|
|
3640
|
+
kind: w.UNION_TYPE_EXTENSION,
|
|
3627
3641
|
name: r,
|
|
3628
3642
|
directives: s,
|
|
3629
3643
|
types: n
|
|
@@ -3641,7 +3655,7 @@ class Ei {
|
|
|
3641
3655
|
if (s.length === 0 && n.length === 0)
|
|
3642
3656
|
throw this.unexpected();
|
|
3643
3657
|
return this.node(t, {
|
|
3644
|
-
kind:
|
|
3658
|
+
kind: w.ENUM_TYPE_EXTENSION,
|
|
3645
3659
|
name: r,
|
|
3646
3660
|
directives: s,
|
|
3647
3661
|
values: n
|
|
@@ -3659,7 +3673,7 @@ class Ei {
|
|
|
3659
3673
|
if (s.length === 0 && n.length === 0)
|
|
3660
3674
|
throw this.unexpected();
|
|
3661
3675
|
return this.node(t, {
|
|
3662
|
-
kind:
|
|
3676
|
+
kind: w.INPUT_OBJECT_TYPE_EXTENSION,
|
|
3663
3677
|
name: r,
|
|
3664
3678
|
directives: s,
|
|
3665
3679
|
fields: n
|
|
@@ -3673,12 +3687,12 @@ class Ei {
|
|
|
3673
3687
|
*/
|
|
3674
3688
|
parseDirectiveDefinition() {
|
|
3675
3689
|
const t = this._lexer.token, r = this.parseDescription();
|
|
3676
|
-
this.expectKeyword("directive"), this.expectToken(
|
|
3690
|
+
this.expectKeyword("directive"), this.expectToken(f.AT);
|
|
3677
3691
|
const s = this.parseName(), n = this.parseArgumentDefs(), i = this.expectOptionalKeyword("repeatable");
|
|
3678
3692
|
this.expectKeyword("on");
|
|
3679
3693
|
const a = this.parseDirectiveLocations();
|
|
3680
3694
|
return this.node(t, {
|
|
3681
|
-
kind:
|
|
3695
|
+
kind: w.DIRECTIVE_DEFINITION,
|
|
3682
3696
|
description: r,
|
|
3683
3697
|
name: s,
|
|
3684
3698
|
arguments: n,
|
|
@@ -3692,7 +3706,7 @@ class Ei {
|
|
|
3692
3706
|
* - DirectiveLocations | DirectiveLocation
|
|
3693
3707
|
*/
|
|
3694
3708
|
parseDirectiveLocations() {
|
|
3695
|
-
return this.delimitedMany(
|
|
3709
|
+
return this.delimitedMany(f.PIPE, this.parseDirectiveLocation);
|
|
3696
3710
|
}
|
|
3697
3711
|
/*
|
|
3698
3712
|
* DirectiveLocation :
|
|
@@ -3734,7 +3748,7 @@ class Ei {
|
|
|
3734
3748
|
* given parsed object.
|
|
3735
3749
|
*/
|
|
3736
3750
|
node(t, r) {
|
|
3737
|
-
return this._options.noLocation !== !0 && (r.loc = new
|
|
3751
|
+
return this._options.noLocation !== !0 && (r.loc = new zs(
|
|
3738
3752
|
t,
|
|
3739
3753
|
this._lexer.lastToken,
|
|
3740
3754
|
this._lexer.source
|
|
@@ -3754,7 +3768,7 @@ class Ei {
|
|
|
3754
3768
|
const r = this._lexer.token;
|
|
3755
3769
|
if (r.kind === t)
|
|
3756
3770
|
return this.advanceLexer(), r;
|
|
3757
|
-
throw
|
|
3771
|
+
throw k(
|
|
3758
3772
|
this._lexer.source,
|
|
3759
3773
|
r.start,
|
|
3760
3774
|
`Expected ${ar(t)}, found ${ce(r)}.`
|
|
@@ -3773,10 +3787,10 @@ class Ei {
|
|
|
3773
3787
|
*/
|
|
3774
3788
|
expectKeyword(t) {
|
|
3775
3789
|
const r = this._lexer.token;
|
|
3776
|
-
if (r.kind ===
|
|
3790
|
+
if (r.kind === f.NAME && r.value === t)
|
|
3777
3791
|
this.advanceLexer();
|
|
3778
3792
|
else
|
|
3779
|
-
throw
|
|
3793
|
+
throw k(
|
|
3780
3794
|
this._lexer.source,
|
|
3781
3795
|
r.start,
|
|
3782
3796
|
`Expected "${t}", found ${ce(r)}.`
|
|
@@ -3788,14 +3802,14 @@ class Ei {
|
|
|
3788
3802
|
*/
|
|
3789
3803
|
expectOptionalKeyword(t) {
|
|
3790
3804
|
const r = this._lexer.token;
|
|
3791
|
-
return r.kind ===
|
|
3805
|
+
return r.kind === f.NAME && r.value === t ? (this.advanceLexer(), !0) : !1;
|
|
3792
3806
|
}
|
|
3793
3807
|
/**
|
|
3794
3808
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
3795
3809
|
*/
|
|
3796
3810
|
unexpected(t) {
|
|
3797
3811
|
const r = t ?? this._lexer.token;
|
|
3798
|
-
return
|
|
3812
|
+
return k(
|
|
3799
3813
|
this._lexer.source,
|
|
3800
3814
|
r.start,
|
|
3801
3815
|
`Unexpected ${ce(r)}.`
|
|
@@ -3857,8 +3871,8 @@ class Ei {
|
|
|
3857
3871
|
}
|
|
3858
3872
|
advanceLexer() {
|
|
3859
3873
|
const { maxTokens: t } = this._options, r = this._lexer.advance();
|
|
3860
|
-
if (t !== void 0 && r.kind !==
|
|
3861
|
-
throw
|
|
3874
|
+
if (t !== void 0 && r.kind !== f.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
3875
|
+
throw k(
|
|
3862
3876
|
this._lexer.source,
|
|
3863
3877
|
r.start,
|
|
3864
3878
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -3879,14 +3893,14 @@ function xe(e) {
|
|
|
3879
3893
|
return;
|
|
3880
3894
|
}
|
|
3881
3895
|
}
|
|
3882
|
-
var
|
|
3896
|
+
var Ei = Object.create, cr = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, lr = Object.getOwnPropertyNames, _i = Object.getPrototypeOf, xi = Object.prototype.hasOwnProperty, Ti = (e, t) => function() {
|
|
3883
3897
|
return t || (0, e[lr(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
3884
3898
|
}, Oi = (e, t, r, s) => {
|
|
3885
3899
|
if (t && typeof t == "object" || typeof t == "function")
|
|
3886
3900
|
for (let n of lr(t))
|
|
3887
3901
|
!xi.call(e, n) && n !== r && cr(e, n, { get: () => t[n], enumerable: !(s = bi(t, n)) || s.enumerable });
|
|
3888
3902
|
return e;
|
|
3889
|
-
}, Ai = (e, t, r) => (r = e != null ?
|
|
3903
|
+
}, Ai = (e, t, r) => (r = e != null ? Ei(_i(e)) : {}, Oi(
|
|
3890
3904
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
3891
3905
|
// file that has been converted to a CommonJS file using a Babel-
|
|
3892
3906
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -3904,23 +3918,23 @@ var wi = Object.create, cr = Object.defineProperty, bi = Object.getOwnPropertyDe
|
|
|
3904
3918
|
return typeof o == "string" && !!o.trim();
|
|
3905
3919
|
}
|
|
3906
3920
|
function n(o, c) {
|
|
3907
|
-
var u = o.split(";").filter(s), h = u.shift(), d = i(h), m = d.name,
|
|
3921
|
+
var u = o.split(";").filter(s), h = u.shift(), d = i(h), m = d.name, p = d.value;
|
|
3908
3922
|
c = c ? Object.assign({}, r, c) : r;
|
|
3909
3923
|
try {
|
|
3910
|
-
|
|
3911
|
-
} catch (
|
|
3924
|
+
p = c.decodeValues ? decodeURIComponent(p) : p;
|
|
3925
|
+
} catch (g) {
|
|
3912
3926
|
console.error(
|
|
3913
|
-
"set-cookie-parser encountered an error while decoding a cookie with value '" +
|
|
3914
|
-
|
|
3927
|
+
"set-cookie-parser encountered an error while decoding a cookie with value '" + p + "'. Set options.decodeValues to false to disable this feature.",
|
|
3928
|
+
g
|
|
3915
3929
|
);
|
|
3916
3930
|
}
|
|
3917
3931
|
var y = {
|
|
3918
3932
|
name: m,
|
|
3919
|
-
value:
|
|
3933
|
+
value: p
|
|
3920
3934
|
};
|
|
3921
|
-
return u.forEach(function(
|
|
3922
|
-
var E =
|
|
3923
|
-
|
|
3935
|
+
return u.forEach(function(g) {
|
|
3936
|
+
var E = g.split("="), b = E.shift().trimLeft().toLowerCase(), v = E.join("=");
|
|
3937
|
+
b === "expires" ? y.expires = new Date(v) : b === "max-age" ? y.maxAge = parseInt(v, 10) : b === "secure" ? y.secure = !0 : b === "httponly" ? y.httpOnly = !0 : b === "samesite" ? y.sameSite = v : y[b] = v;
|
|
3924
3938
|
}), y;
|
|
3925
3939
|
}
|
|
3926
3940
|
function i(o) {
|
|
@@ -3946,8 +3960,8 @@ var wi = Object.create, cr = Object.defineProperty, bi = Object.getOwnPropertyDe
|
|
|
3946
3960
|
if (Array.isArray(o) || (o = [o]), c = c ? Object.assign({}, r, c) : r, c.map) {
|
|
3947
3961
|
var h = {};
|
|
3948
3962
|
return o.filter(s).reduce(function(d, m) {
|
|
3949
|
-
var
|
|
3950
|
-
return d[
|
|
3963
|
+
var p = n(m, c);
|
|
3964
|
+
return d[p.name] = p, d;
|
|
3951
3965
|
}, h);
|
|
3952
3966
|
} else
|
|
3953
3967
|
return o.filter(s).map(function(d) {
|
|
@@ -3959,8 +3973,8 @@ var wi = Object.create, cr = Object.defineProperty, bi = Object.getOwnPropertyDe
|
|
|
3959
3973
|
return o;
|
|
3960
3974
|
if (typeof o != "string")
|
|
3961
3975
|
return [];
|
|
3962
|
-
var c = [], u = 0, h, d, m,
|
|
3963
|
-
function
|
|
3976
|
+
var c = [], u = 0, h, d, m, p, y;
|
|
3977
|
+
function g() {
|
|
3964
3978
|
for (; u < o.length && /\s/.test(o.charAt(u)); )
|
|
3965
3979
|
u += 1;
|
|
3966
3980
|
return u < o.length;
|
|
@@ -3969,11 +3983,11 @@ var wi = Object.create, cr = Object.defineProperty, bi = Object.getOwnPropertyDe
|
|
|
3969
3983
|
return d = o.charAt(u), d !== "=" && d !== ";" && d !== ",";
|
|
3970
3984
|
}
|
|
3971
3985
|
for (; u < o.length; ) {
|
|
3972
|
-
for (h = u, y = !1;
|
|
3986
|
+
for (h = u, y = !1; g(); )
|
|
3973
3987
|
if (d = o.charAt(u), d === ",") {
|
|
3974
|
-
for (m = u, u += 1,
|
|
3988
|
+
for (m = u, u += 1, g(), p = u; u < o.length && E(); )
|
|
3975
3989
|
u += 1;
|
|
3976
|
-
u < o.length && o.charAt(u) === "=" ? (y = !0, u =
|
|
3990
|
+
u < o.length && o.charAt(u) === "=" ? (y = !0, u = p, c.push(o.substring(h, m)), h = u) : u = m + 1;
|
|
3977
3991
|
} else
|
|
3978
3992
|
u += 1;
|
|
3979
3993
|
(!y || u >= o.length) && c.push(o.substring(h, o.length));
|
|
@@ -4191,21 +4205,21 @@ function Ci(e, t) {
|
|
|
4191
4205
|
\r
|
|
4192
4206
|
`), h = u.join(`\r
|
|
4193
4207
|
\r
|
|
4194
|
-
`), { contentType: d, filename: m, name:
|
|
4195
|
-
|
|
4208
|
+
`), { contentType: d, filename: m, name: p } = Di(c), y = m === void 0 ? h : new File([h], m, { type: d }), g = l[p];
|
|
4209
|
+
g === void 0 ? l[p] = y : Array.isArray(g) ? l[p] = [...g, y] : l[p] = [g, y];
|
|
4196
4210
|
}
|
|
4197
4211
|
return l;
|
|
4198
4212
|
} catch {
|
|
4199
4213
|
return;
|
|
4200
4214
|
}
|
|
4201
4215
|
}
|
|
4202
|
-
var mt = Object.getOwnPropertySymbols,
|
|
4216
|
+
var mt = Object.getOwnPropertySymbols, Mi = Object.prototype.hasOwnProperty, qi = Object.prototype.propertyIsEnumerable, $i = (e, t) => {
|
|
4203
4217
|
var r = {};
|
|
4204
4218
|
for (var s in e)
|
|
4205
|
-
|
|
4219
|
+
Mi.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
|
|
4206
4220
|
if (e != null && mt)
|
|
4207
4221
|
for (var s of mt(e))
|
|
4208
|
-
t.indexOf(s) < 0 &&
|
|
4222
|
+
t.indexOf(s) < 0 && qi.call(e, s) && (r[s] = e[s]);
|
|
4209
4223
|
return r;
|
|
4210
4224
|
}, hr = (e, t, r) => new Promise((s, n) => {
|
|
4211
4225
|
var i = (o) => {
|
|
@@ -4315,7 +4329,7 @@ function pr(e) {
|
|
|
4315
4329
|
if (n instanceof Error) {
|
|
4316
4330
|
const i = se(e);
|
|
4317
4331
|
throw new Error(
|
|
4318
|
-
|
|
4332
|
+
O.formatMessage(
|
|
4319
4333
|
`Failed to intercept a GraphQL request to "%s %s": cannot parse query. See the error message from the parser below.
|
|
4320
4334
|
|
|
4321
4335
|
%s`,
|
|
@@ -4390,11 +4404,11 @@ class Vi extends St {
|
|
|
4390
4404
|
return !1;
|
|
4391
4405
|
if (!t.parsedResult.operationName && this.info.operationType !== "all") {
|
|
4392
4406
|
const i = se(t.request);
|
|
4393
|
-
return
|
|
4407
|
+
return O.warn(`Failed to intercept a GraphQL request at "${t.request.method} ${i}": anonymous GraphQL operations are not supported.
|
|
4394
4408
|
|
|
4395
4409
|
Consider naming this operation or using "graphql.operation()" request handler to intercept GraphQL requests regardless of their operation name/type. Read more: https://mswjs.io/docs/api/graphql/operation`), !1;
|
|
4396
4410
|
}
|
|
4397
|
-
const r =
|
|
4411
|
+
const r = zt(
|
|
4398
4412
|
new URL(t.request.url),
|
|
4399
4413
|
this.endpoint
|
|
4400
4414
|
), s = this.info.operationType === "all" || t.parsedResult.operationType === this.info.operationType, n = this.info.operationName instanceof RegExp ? this.info.operationName.test(t.parsedResult.operationName || "") : t.parsedResult.operationName === this.info.operationName;
|
|
@@ -4411,10 +4425,10 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
4411
4425
|
log(t) {
|
|
4412
4426
|
return yt(this, null, function* () {
|
|
4413
4427
|
var r, s, n, i;
|
|
4414
|
-
const a = yield
|
|
4428
|
+
const a = yield qt(t.request), l = yield Ft(t.response), o = Ct(l.status), c = (r = t.parsedResult) != null && r.operationName ? `${(s = t.parsedResult) == null ? void 0 : s.operationType} ${(n = t.parsedResult) == null ? void 0 : n.operationName}` : `anonymous ${(i = t.parsedResult) == null ? void 0 : i.operationType}`;
|
|
4415
4429
|
console.groupCollapsed(
|
|
4416
|
-
|
|
4417
|
-
|
|
4430
|
+
O.formatMessage("%s %s (%c%s%c)"),
|
|
4431
|
+
Mt(),
|
|
4418
4432
|
`${c}`,
|
|
4419
4433
|
`color:${o}`,
|
|
4420
4434
|
`${l.status} ${l.statusText}`,
|
|
@@ -4440,8 +4454,8 @@ var Wi = (e, t, r) => new Promise((s, n) => {
|
|
|
4440
4454
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
4441
4455
|
l((r = r.apply(e, t)).next());
|
|
4442
4456
|
});
|
|
4443
|
-
const fr = cn, Gi = 3,
|
|
4444
|
-
function
|
|
4457
|
+
const fr = cn, Gi = 3, zi = 4, mr = 0.5;
|
|
4458
|
+
function Hi(e) {
|
|
4445
4459
|
return e.reduce(
|
|
4446
4460
|
(t, r) => (r instanceof js && t.http.push(r), r instanceof Vi && t.graphql.push(r), t),
|
|
4447
4461
|
{
|
|
@@ -4450,7 +4464,7 @@ function Xi(e) {
|
|
|
4450
4464
|
}
|
|
4451
4465
|
);
|
|
4452
4466
|
}
|
|
4453
|
-
function
|
|
4467
|
+
function Xi() {
|
|
4454
4468
|
return (e, t) => {
|
|
4455
4469
|
const { path: r, method: s } = t.info;
|
|
4456
4470
|
if (r instanceof RegExp || s instanceof RegExp)
|
|
@@ -4474,7 +4488,7 @@ function Ji(e, t, r) {
|
|
|
4474
4488
|
return t.reduce((n, i) => {
|
|
4475
4489
|
const a = r(e, i);
|
|
4476
4490
|
return n.concat([[a, i]]);
|
|
4477
|
-
}, []).sort(([n], [i]) => n - i).filter(([n]) => n <= Gi).slice(0,
|
|
4491
|
+
}, []).sort(([n], [i]) => n - i).filter(([n]) => n <= Gi).slice(0, zi).map(([, n]) => n);
|
|
4478
4492
|
}
|
|
4479
4493
|
function Qi(e) {
|
|
4480
4494
|
return e.length > 1 ? `Did you mean to request one of the following resources instead?
|
|
@@ -4488,10 +4502,10 @@ function Ki(e, t, r = "warn") {
|
|
|
4488
4502
|
() => null
|
|
4489
4503
|
), n = se(e);
|
|
4490
4504
|
function i() {
|
|
4491
|
-
const c =
|
|
4505
|
+
const c = Hi(t), u = s ? c.graphql : c.http, h = Ji(
|
|
4492
4506
|
e,
|
|
4493
4507
|
u,
|
|
4494
|
-
s ? Yi(s) :
|
|
4508
|
+
s ? Yi(s) : Xi()
|
|
4495
4509
|
);
|
|
4496
4510
|
return h.length > 0 ? Qi(h) : "";
|
|
4497
4511
|
}
|
|
@@ -4514,20 +4528,20 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
4514
4528
|
const u = l();
|
|
4515
4529
|
switch (c) {
|
|
4516
4530
|
case "error":
|
|
4517
|
-
throw
|
|
4518
|
-
|
|
4531
|
+
throw O.error("Error: %s", u), new Error(
|
|
4532
|
+
O.formatMessage(
|
|
4519
4533
|
'Cannot bypass a request when using the "error" strategy for the "onUnhandledRequest" option.'
|
|
4520
4534
|
)
|
|
4521
4535
|
);
|
|
4522
4536
|
case "warn": {
|
|
4523
|
-
|
|
4537
|
+
O.warn("Warning: %s", u);
|
|
4524
4538
|
break;
|
|
4525
4539
|
}
|
|
4526
4540
|
case "bypass":
|
|
4527
4541
|
break;
|
|
4528
4542
|
default:
|
|
4529
4543
|
throw new Error(
|
|
4530
|
-
|
|
4544
|
+
O.formatMessage(
|
|
4531
4545
|
'Failed to react to an unhandled request: unknown strategy "%s". Please provide one of the supported strategies ("bypass", "warn", "error") or a custom callback function as the value of the "onUnhandledRequest" option.',
|
|
4532
4546
|
c
|
|
4533
4547
|
)
|
|
@@ -4578,7 +4592,7 @@ function yr(e, t, r, s, n, i) {
|
|
|
4578
4592
|
n.emit("request:end", { request: e, requestId: t }), (a = i == null ? void 0 : i.onPassthroughResponse) == null || a.call(i, e);
|
|
4579
4593
|
return;
|
|
4580
4594
|
}
|
|
4581
|
-
const d = yield
|
|
4595
|
+
const d = yield j(() => Qr(
|
|
4582
4596
|
e,
|
|
4583
4597
|
r,
|
|
4584
4598
|
i == null ? void 0 : i.resolutionContext
|
|
@@ -4603,11 +4617,11 @@ function yr(e, t, r, s, n, i) {
|
|
|
4603
4617
|
return;
|
|
4604
4618
|
}
|
|
4605
4619
|
oo(e, m), n.emit("request:match", { request: e, requestId: t });
|
|
4606
|
-
const
|
|
4620
|
+
const p = d.data, y = ((u = i == null ? void 0 : i.transformResponse) == null ? void 0 : u.call(i, m)) || m;
|
|
4607
4621
|
return (h = i == null ? void 0 : i.onMockedResponse) == null || h.call(
|
|
4608
4622
|
i,
|
|
4609
4623
|
y,
|
|
4610
|
-
|
|
4624
|
+
p
|
|
4611
4625
|
), n.emit("request:end", { request: e, requestId: t }), y;
|
|
4612
4626
|
});
|
|
4613
4627
|
}
|
|
@@ -4618,13 +4632,13 @@ function co(e) {
|
|
|
4618
4632
|
headers: Object.fromEntries(e.headers.entries())
|
|
4619
4633
|
};
|
|
4620
4634
|
}
|
|
4621
|
-
function
|
|
4635
|
+
function wt(e) {
|
|
4622
4636
|
return e != null && typeof e == "object" && !Array.isArray(e);
|
|
4623
4637
|
}
|
|
4624
4638
|
function gr(e, t) {
|
|
4625
4639
|
return Object.entries(t).reduce((r, [s, n]) => {
|
|
4626
4640
|
const i = r[s];
|
|
4627
|
-
return Array.isArray(i) && Array.isArray(n) ? (r[s] = i.concat(n), r) :
|
|
4641
|
+
return Array.isArray(i) && Array.isArray(n) ? (r[s] = i.concat(n), r) : wt(i) && wt(n) ? (r[s] = gr(i, n), r) : (r[s] = n, r);
|
|
4628
4642
|
}, Object.assign({}, e));
|
|
4629
4643
|
}
|
|
4630
4644
|
function lo() {
|
|
@@ -4646,40 +4660,40 @@ function lo() {
|
|
|
4646
4660
|
};
|
|
4647
4661
|
return e;
|
|
4648
4662
|
}
|
|
4649
|
-
var
|
|
4663
|
+
var $, X, ue, Rt, vr = (Rt = class extends Promise {
|
|
4650
4664
|
constructor(t = null) {
|
|
4651
4665
|
const r = lo();
|
|
4652
4666
|
super((s, n) => {
|
|
4653
4667
|
r(s, n), t == null || t(r.resolve, r.reject);
|
|
4654
4668
|
});
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
Ve(this,
|
|
4669
|
+
we(this, X);
|
|
4670
|
+
we(this, $);
|
|
4671
|
+
U(this, "resolve");
|
|
4672
|
+
U(this, "reject");
|
|
4673
|
+
Ve(this, $, r), this.resolve = Q(this, $).resolve, this.reject = Q(this, $).reject;
|
|
4660
4674
|
}
|
|
4661
4675
|
get state() {
|
|
4662
|
-
return Q(this,
|
|
4676
|
+
return Q(this, $).state;
|
|
4663
4677
|
}
|
|
4664
4678
|
get rejectionReason() {
|
|
4665
|
-
return Q(this,
|
|
4679
|
+
return Q(this, $).rejectionReason;
|
|
4666
4680
|
}
|
|
4667
4681
|
then(t, r) {
|
|
4668
|
-
return ie(this,
|
|
4682
|
+
return ie(this, X, ue).call(this, super.then(t, r));
|
|
4669
4683
|
}
|
|
4670
4684
|
catch(t) {
|
|
4671
|
-
return ie(this,
|
|
4685
|
+
return ie(this, X, ue).call(this, super.catch(t));
|
|
4672
4686
|
}
|
|
4673
4687
|
finally(t) {
|
|
4674
|
-
return ie(this,
|
|
4688
|
+
return ie(this, X, ue).call(this, super.finally(t));
|
|
4675
4689
|
}
|
|
4676
|
-
},
|
|
4690
|
+
}, $ = new WeakMap(), X = new WeakSet(), ue = function(t) {
|
|
4677
4691
|
return Object.defineProperties(t, {
|
|
4678
4692
|
resolve: { configurable: !0, value: this.resolve },
|
|
4679
4693
|
reject: { configurable: !0, value: this.reject }
|
|
4680
4694
|
});
|
|
4681
4695
|
}, Rt);
|
|
4682
|
-
function
|
|
4696
|
+
function wr() {
|
|
4683
4697
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
4684
4698
|
const t = Math.random() * 16 | 0;
|
|
4685
4699
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
@@ -4690,7 +4704,7 @@ var uo = class {
|
|
|
4690
4704
|
this.request = e, this.responsePromise = new vr();
|
|
4691
4705
|
}
|
|
4692
4706
|
respondWith(e) {
|
|
4693
|
-
|
|
4707
|
+
C(
|
|
4694
4708
|
this.responsePromise.state === "pending",
|
|
4695
4709
|
'Failed to respond to "%s %s" request: the "request" event has already been responded to.',
|
|
4696
4710
|
this.request.method,
|
|
@@ -4698,7 +4712,7 @@ var uo = class {
|
|
|
4698
4712
|
), this.responsePromise.resolve(e);
|
|
4699
4713
|
}
|
|
4700
4714
|
};
|
|
4701
|
-
function
|
|
4715
|
+
function Er(e) {
|
|
4702
4716
|
const t = new uo(e);
|
|
4703
4717
|
return Reflect.set(
|
|
4704
4718
|
e,
|
|
@@ -4729,7 +4743,7 @@ function po(e) {
|
|
|
4729
4743
|
return !1;
|
|
4730
4744
|
}
|
|
4731
4745
|
}
|
|
4732
|
-
var _r = class extends
|
|
4746
|
+
var _r = class extends qe {
|
|
4733
4747
|
constructor() {
|
|
4734
4748
|
super(_r.symbol);
|
|
4735
4749
|
}
|
|
@@ -4738,14 +4752,14 @@ var _r = class extends Me {
|
|
|
4738
4752
|
}
|
|
4739
4753
|
setup() {
|
|
4740
4754
|
const e = globalThis.fetch;
|
|
4741
|
-
|
|
4742
|
-
!e[
|
|
4755
|
+
C(
|
|
4756
|
+
!e[H],
|
|
4743
4757
|
'Failed to patch the "fetch" module: already patched.'
|
|
4744
4758
|
), globalThis.fetch = async (t, r) => {
|
|
4745
4759
|
var s;
|
|
4746
|
-
const n =
|
|
4760
|
+
const n = wr(), i = typeof t == "string" && typeof location < "u" && !po(t) ? new URL(t, location.origin) : t, a = new Request(i, r);
|
|
4747
4761
|
this.logger.info("[%s] %s", a.method, a.url);
|
|
4748
|
-
const { interactiveRequest: l, requestController: o } =
|
|
4762
|
+
const { interactiveRequest: l, requestController: o } = Er(a);
|
|
4749
4763
|
this.logger.info(
|
|
4750
4764
|
'emitting the "request" event for %d listener(s)...',
|
|
4751
4765
|
this.emitter.listenerCount("request")
|
|
@@ -4760,7 +4774,7 @@ var _r = class extends Me {
|
|
|
4760
4774
|
},
|
|
4761
4775
|
{ once: !0 }
|
|
4762
4776
|
);
|
|
4763
|
-
const h = await
|
|
4777
|
+
const h = await j(async () => {
|
|
4764
4778
|
const m = br(this.emitter, "request", {
|
|
4765
4779
|
request: l,
|
|
4766
4780
|
requestId: n
|
|
@@ -4773,19 +4787,19 @@ var _r = class extends Me {
|
|
|
4773
4787
|
m,
|
|
4774
4788
|
o.responsePromise
|
|
4775
4789
|
]), this.logger.info("all request listeners have been resolved!");
|
|
4776
|
-
const
|
|
4777
|
-
return this.logger.info("event.respondWith called with:",
|
|
4790
|
+
const p = await o.responsePromise;
|
|
4791
|
+
return this.logger.info("event.respondWith called with:", p), p;
|
|
4778
4792
|
});
|
|
4779
4793
|
if (u.state === "rejected")
|
|
4780
4794
|
return Promise.reject(u.rejectionReason);
|
|
4781
4795
|
if (h.error)
|
|
4782
|
-
return Promise.reject(
|
|
4796
|
+
return Promise.reject(Et(h.error));
|
|
4783
4797
|
const d = h.data;
|
|
4784
4798
|
if (d && !((s = a.signal) != null && s.aborted)) {
|
|
4785
4799
|
if (this.logger.info("received mocked response:", d), ho(d, "type") && d.type === "error")
|
|
4786
4800
|
return this.logger.info(
|
|
4787
4801
|
"received a network error response, rejecting the request promise..."
|
|
4788
|
-
), Promise.reject(
|
|
4802
|
+
), Promise.reject(Et(d));
|
|
4789
4803
|
const m = d.clone();
|
|
4790
4804
|
return this.emitter.emit("response", {
|
|
4791
4805
|
response: m,
|
|
@@ -4800,20 +4814,20 @@ var _r = class extends Me {
|
|
|
4800
4814
|
}), d;
|
|
4801
4815
|
}
|
|
4802
4816
|
return this.logger.info("no mocked response received!"), e(a).then((m) => {
|
|
4803
|
-
const
|
|
4804
|
-
return this.logger.info("original fetch performed",
|
|
4805
|
-
response:
|
|
4817
|
+
const p = m.clone();
|
|
4818
|
+
return this.logger.info("original fetch performed", p), this.emitter.emit("response", {
|
|
4819
|
+
response: p,
|
|
4806
4820
|
isMockedResponse: !1,
|
|
4807
4821
|
request: l,
|
|
4808
4822
|
requestId: n
|
|
4809
4823
|
}), m;
|
|
4810
4824
|
});
|
|
4811
|
-
}, Object.defineProperty(globalThis.fetch,
|
|
4825
|
+
}, Object.defineProperty(globalThis.fetch, H, {
|
|
4812
4826
|
enumerable: !0,
|
|
4813
4827
|
configurable: !0,
|
|
4814
4828
|
value: !0
|
|
4815
4829
|
}), this.subscriptions.push(() => {
|
|
4816
|
-
Object.defineProperty(globalThis.fetch,
|
|
4830
|
+
Object.defineProperty(globalThis.fetch, H, {
|
|
4817
4831
|
value: void 0
|
|
4818
4832
|
}), globalThis.fetch = e, this.logger.info(
|
|
4819
4833
|
'restored native "globalThis.fetch"!',
|
|
@@ -4823,7 +4837,7 @@ var _r = class extends Me {
|
|
|
4823
4837
|
}
|
|
4824
4838
|
}, xr = _r;
|
|
4825
4839
|
xr.symbol = Symbol("fetch");
|
|
4826
|
-
function
|
|
4840
|
+
function Et(e) {
|
|
4827
4841
|
return Object.assign(new TypeError("Failed to fetch"), {
|
|
4828
4842
|
cause: e
|
|
4829
4843
|
});
|
|
@@ -4911,7 +4925,7 @@ function vo(e) {
|
|
|
4911
4925
|
} : u;
|
|
4912
4926
|
}, i;
|
|
4913
4927
|
}
|
|
4914
|
-
function
|
|
4928
|
+
function wo(e) {
|
|
4915
4929
|
return [
|
|
4916
4930
|
"application/xhtml+xml",
|
|
4917
4931
|
"application/xml",
|
|
@@ -4920,7 +4934,7 @@ function Eo(e) {
|
|
|
4920
4934
|
"text/xml"
|
|
4921
4935
|
].some((r) => e.startsWith(r));
|
|
4922
4936
|
}
|
|
4923
|
-
function
|
|
4937
|
+
function Eo(e) {
|
|
4924
4938
|
try {
|
|
4925
4939
|
return JSON.parse(e);
|
|
4926
4940
|
} catch {
|
|
@@ -4949,7 +4963,7 @@ function _o(e) {
|
|
|
4949
4963
|
}
|
|
4950
4964
|
var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
4951
4965
|
constructor(e, t) {
|
|
4952
|
-
this.initialRequest = e, this.logger = t, this.method = "GET", this.url = null, this.events = /* @__PURE__ */ new Map(), this.requestId =
|
|
4966
|
+
this.initialRequest = e, this.logger = t, this.method = "GET", this.url = null, this.events = /* @__PURE__ */ new Map(), this.requestId = wr(), this.requestHeaders = new Headers(), this.responseBuffer = new Uint8Array(), this.request = bt(e, {
|
|
4953
4967
|
setProperty: ([r, s], n) => {
|
|
4954
4968
|
switch (r) {
|
|
4955
4969
|
case "ontimeout": {
|
|
@@ -4979,7 +4993,7 @@ var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
|
4979
4993
|
}
|
|
4980
4994
|
case "send": {
|
|
4981
4995
|
const [a] = s;
|
|
4982
|
-
a != null && (this.requestBody = typeof a == "string" ?
|
|
4996
|
+
a != null && (this.requestBody = typeof a == "string" ? zn(a) : a), this.request.addEventListener("load", () => {
|
|
4983
4997
|
if (typeof this.onResponse < "u") {
|
|
4984
4998
|
const c = bo(
|
|
4985
4999
|
this.request,
|
|
@@ -5106,7 +5120,7 @@ var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
|
5106
5120
|
r();
|
|
5107
5121
|
}
|
|
5108
5122
|
responseBufferToText() {
|
|
5109
|
-
return
|
|
5123
|
+
return Hn(this.responseBuffer);
|
|
5110
5124
|
}
|
|
5111
5125
|
get response() {
|
|
5112
5126
|
if (this.logger.info(
|
|
@@ -5116,11 +5130,11 @@ var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
|
5116
5130
|
return null;
|
|
5117
5131
|
switch (this.request.responseType) {
|
|
5118
5132
|
case "json": {
|
|
5119
|
-
const e =
|
|
5133
|
+
const e = Eo(this.responseBufferToText());
|
|
5120
5134
|
return this.logger.info("resolved response JSON", e), e;
|
|
5121
5135
|
}
|
|
5122
5136
|
case "arraybuffer": {
|
|
5123
|
-
const e =
|
|
5137
|
+
const e = Xn(this.responseBuffer);
|
|
5124
5138
|
return this.logger.info("resolved response ArrayBuffer", e), e;
|
|
5125
5139
|
}
|
|
5126
5140
|
case "blob": {
|
|
@@ -5144,7 +5158,7 @@ var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
|
5144
5158
|
}
|
|
5145
5159
|
}
|
|
5146
5160
|
get responseText() {
|
|
5147
|
-
if (
|
|
5161
|
+
if (C(
|
|
5148
5162
|
this.request.responseType === "" || this.request.responseType === "text",
|
|
5149
5163
|
"InvalidStateError: The object is in invalid state."
|
|
5150
5164
|
), this.request.readyState !== this.request.LOADING && this.request.readyState !== this.request.DONE)
|
|
@@ -5153,7 +5167,7 @@ var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
|
5153
5167
|
return this.logger.info('getResponseText: "%s"', e), e;
|
|
5154
5168
|
}
|
|
5155
5169
|
get responseXML() {
|
|
5156
|
-
if (
|
|
5170
|
+
if (C(
|
|
5157
5171
|
this.request.responseType === "" || this.request.responseType === "document",
|
|
5158
5172
|
"InvalidStateError: The object is in invalid state."
|
|
5159
5173
|
), this.request.readyState !== this.request.DONE)
|
|
@@ -5161,7 +5175,7 @@ var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
|
5161
5175
|
const e = this.request.getResponseHeader("Content-Type") || "";
|
|
5162
5176
|
return typeof DOMParser > "u" ? (console.warn(
|
|
5163
5177
|
"Cannot retrieve XMLHttpRequest response body as XML: DOMParser is not defined. You are likely using an environment that is not browser or does not polyfill browser globals correctly."
|
|
5164
|
-
), null) :
|
|
5178
|
+
), null) : wo(e) ? new DOMParser().parseFromString(
|
|
5165
5179
|
this.responseBufferToText(),
|
|
5166
5180
|
e
|
|
5167
5181
|
) : null;
|
|
@@ -5264,11 +5278,11 @@ function Oo({
|
|
|
5264
5278
|
t
|
|
5265
5279
|
);
|
|
5266
5280
|
return o.onRequest = async function({ request: c, requestId: u }) {
|
|
5267
|
-
const { interactiveRequest: h, requestController: d } =
|
|
5281
|
+
const { interactiveRequest: h, requestController: d } = Er(c);
|
|
5268
5282
|
this.logger.info("awaiting mocked response..."), e.once("request", ({ requestId: y }) => {
|
|
5269
5283
|
y === u && d.responsePromise.state === "pending" && d.respondWith(void 0);
|
|
5270
5284
|
});
|
|
5271
|
-
const m = await
|
|
5285
|
+
const m = await j(async () => {
|
|
5272
5286
|
this.logger.info(
|
|
5273
5287
|
'emitting the "request" event for %s listener(s)...',
|
|
5274
5288
|
e.listenerCount("request")
|
|
@@ -5286,19 +5300,19 @@ function Oo({
|
|
|
5286
5300
|
), o.errorWith(m.error);
|
|
5287
5301
|
return;
|
|
5288
5302
|
}
|
|
5289
|
-
const
|
|
5290
|
-
if (typeof
|
|
5303
|
+
const p = m.data;
|
|
5304
|
+
if (typeof p < "u") {
|
|
5291
5305
|
if (this.logger.info(
|
|
5292
5306
|
"received mocked response: %d %s",
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
),
|
|
5307
|
+
p.status,
|
|
5308
|
+
p.statusText
|
|
5309
|
+
), p.type === "error") {
|
|
5296
5310
|
this.logger.info(
|
|
5297
5311
|
"received a network error response, rejecting the request promise..."
|
|
5298
5312
|
), o.errorWith(new TypeError("Network error"));
|
|
5299
5313
|
return;
|
|
5300
5314
|
}
|
|
5301
|
-
return o.respondWith(
|
|
5315
|
+
return o.respondWith(p);
|
|
5302
5316
|
}
|
|
5303
5317
|
this.logger.info(
|
|
5304
5318
|
"no mocked response received, performing request as-is..."
|
|
@@ -5322,7 +5336,7 @@ function Oo({
|
|
|
5322
5336
|
}
|
|
5323
5337
|
});
|
|
5324
5338
|
}
|
|
5325
|
-
var Ar = class extends
|
|
5339
|
+
var Ar = class extends qe {
|
|
5326
5340
|
constructor() {
|
|
5327
5341
|
super(Ar.interceptorSymbol);
|
|
5328
5342
|
}
|
|
@@ -5333,8 +5347,8 @@ var Ar = class extends Me {
|
|
|
5333
5347
|
const e = this.logger.extend("setup");
|
|
5334
5348
|
e.info('patching "XMLHttpRequest" module...');
|
|
5335
5349
|
const t = globalThis.XMLHttpRequest;
|
|
5336
|
-
|
|
5337
|
-
!t[
|
|
5350
|
+
C(
|
|
5351
|
+
!t[H],
|
|
5338
5352
|
'Failed to patch the "XMLHttpRequest" module: already patched.'
|
|
5339
5353
|
), globalThis.XMLHttpRequest = Oo({
|
|
5340
5354
|
emitter: this.emitter,
|
|
@@ -5342,12 +5356,12 @@ var Ar = class extends Me {
|
|
|
5342
5356
|
}), e.info(
|
|
5343
5357
|
'native "XMLHttpRequest" module patched!',
|
|
5344
5358
|
globalThis.XMLHttpRequest.name
|
|
5345
|
-
), Object.defineProperty(globalThis.XMLHttpRequest,
|
|
5359
|
+
), Object.defineProperty(globalThis.XMLHttpRequest, H, {
|
|
5346
5360
|
enumerable: !0,
|
|
5347
5361
|
configurable: !0,
|
|
5348
5362
|
value: !0
|
|
5349
5363
|
}), this.subscriptions.push(() => {
|
|
5350
|
-
Object.defineProperty(globalThis.XMLHttpRequest,
|
|
5364
|
+
Object.defineProperty(globalThis.XMLHttpRequest, H, {
|
|
5351
5365
|
value: void 0
|
|
5352
5366
|
}), globalThis.XMLHttpRequest = t, e.info(
|
|
5353
5367
|
'native "XMLHttpRequest" module restored!',
|
|
@@ -5364,7 +5378,7 @@ var Ao = Object.defineProperty, Ro = Object.defineProperties, Io = Object.getOwn
|
|
|
5364
5378
|
for (var r of Tt(t))
|
|
5365
5379
|
ko.call(t, r) && Ot(e, r, t[r]);
|
|
5366
5380
|
return e;
|
|
5367
|
-
}, Se = (e, t) => Ro(e, Io(t)),
|
|
5381
|
+
}, Se = (e, t) => Ro(e, Io(t)), S = (e, t, r) => new Promise((s, n) => {
|
|
5368
5382
|
var i = (o) => {
|
|
5369
5383
|
try {
|
|
5370
5384
|
l(r.next(o));
|
|
@@ -5390,7 +5404,7 @@ function Ae(e, t, r) {
|
|
|
5390
5404
|
e.waiting
|
|
5391
5405
|
].filter((a) => a != null).find((a) => r(a.scriptURL, t)) || null;
|
|
5392
5406
|
}
|
|
5393
|
-
var Lo = (e, ...t) =>
|
|
5407
|
+
var Lo = (e, ...t) => S(void 0, [e, ...t], function* (r, s = {}, n) {
|
|
5394
5408
|
const i = Po(r), a = yield navigator.serviceWorker.getRegistrations().then(
|
|
5395
5409
|
(c) => c.filter(
|
|
5396
5410
|
(u) => Ae(u, i, n)
|
|
@@ -5407,8 +5421,8 @@ var Lo = (e, ...t) => k(void 0, [e, ...t], function* (r, s = {}, n) {
|
|
|
5407
5421
|
),
|
|
5408
5422
|
l
|
|
5409
5423
|
]);
|
|
5410
|
-
const o = yield
|
|
5411
|
-
() =>
|
|
5424
|
+
const o = yield j(
|
|
5425
|
+
() => S(void 0, null, function* () {
|
|
5412
5426
|
const c = yield navigator.serviceWorker.register(r, s);
|
|
5413
5427
|
return [
|
|
5414
5428
|
// Compare existing worker registration by its worker URL,
|
|
@@ -5422,7 +5436,7 @@ var Lo = (e, ...t) => k(void 0, [e, ...t], function* (r, s = {}, n) {
|
|
|
5422
5436
|
if (o.error.message.includes("(404)")) {
|
|
5423
5437
|
const u = new URL((s == null ? void 0 : s.scope) || "/", location.href);
|
|
5424
5438
|
throw new Error(
|
|
5425
|
-
|
|
5439
|
+
O.formatMessage(`Failed to register a Service Worker for scope ('${u.href}') with script ('${i}'): Service Worker script does not exist at the given path.
|
|
5426
5440
|
|
|
5427
5441
|
Did you forget to run "npx msw init <PUBLIC_DIR>"?
|
|
5428
5442
|
|
|
@@ -5430,7 +5444,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
5430
5444
|
);
|
|
5431
5445
|
}
|
|
5432
5446
|
throw new Error(
|
|
5433
|
-
|
|
5447
|
+
O.formatMessage(
|
|
5434
5448
|
`Failed to register the Service Worker:
|
|
5435
5449
|
|
|
5436
5450
|
%s`,
|
|
@@ -5445,7 +5459,7 @@ function Ir(e = {}) {
|
|
|
5445
5459
|
return;
|
|
5446
5460
|
const t = e.message || "Mocking enabled.";
|
|
5447
5461
|
console.groupCollapsed(
|
|
5448
|
-
`%c${
|
|
5462
|
+
`%c${O.formatMessage(t)}`,
|
|
5449
5463
|
"color:orangered;font-weight:bold;"
|
|
5450
5464
|
), console.log(
|
|
5451
5465
|
"%cDocumentation: %chttps://mswjs.io/docs",
|
|
@@ -5454,10 +5468,10 @@ function Ir(e = {}) {
|
|
|
5454
5468
|
), console.log("Found an issue? https://github.com/mswjs/msw/issues"), e.workerUrl && console.log("Worker script URL:", e.workerUrl), e.workerScope && console.log("Worker scope:", e.workerScope), console.groupEnd();
|
|
5455
5469
|
}
|
|
5456
5470
|
function So(e, t) {
|
|
5457
|
-
return
|
|
5471
|
+
return S(this, null, function* () {
|
|
5458
5472
|
var r, s;
|
|
5459
5473
|
if (e.workerChannel.send("MOCK_ACTIVATE"), yield e.events.once("MOCKING_ENABLED"), e.isMockingEnabled) {
|
|
5460
|
-
|
|
5474
|
+
O.warn(
|
|
5461
5475
|
'Found a redundant "worker.start()" call. Note that starting the worker while mocking is already enabled will have no effect. Consider removing this "worker.start()" call.'
|
|
5462
5476
|
);
|
|
5463
5477
|
return;
|
|
@@ -5489,14 +5503,14 @@ function Co(e) {
|
|
|
5489
5503
|
if (!["HEAD", "GET"].includes(e.method))
|
|
5490
5504
|
return e.body;
|
|
5491
5505
|
}
|
|
5492
|
-
function
|
|
5506
|
+
function Mo(e) {
|
|
5493
5507
|
return new Request(e.url, Se(Le({}, e), {
|
|
5494
5508
|
body: Co(e)
|
|
5495
5509
|
}));
|
|
5496
5510
|
}
|
|
5497
|
-
var
|
|
5511
|
+
var qo = (e, t) => (r, s) => S(void 0, null, function* () {
|
|
5498
5512
|
var n;
|
|
5499
|
-
const i = new Do(r.ports[0]), a = s.payload.id, l =
|
|
5513
|
+
const i = new Do(r.ports[0]), a = s.payload.id, l = Mo(s.payload), o = l.clone();
|
|
5500
5514
|
try {
|
|
5501
5515
|
let c;
|
|
5502
5516
|
yield yr(
|
|
@@ -5510,28 +5524,28 @@ var Mo = (e, t) => (r, s) => k(void 0, null, function* () {
|
|
|
5510
5524
|
i.postMessage("NOT_FOUND");
|
|
5511
5525
|
},
|
|
5512
5526
|
onMockedResponse(u, h) {
|
|
5513
|
-
return
|
|
5514
|
-
const y = d.clone(),
|
|
5527
|
+
return S(this, arguments, function* (d, { handler: m, parsedResult: p }) {
|
|
5528
|
+
const y = d.clone(), g = d.clone(), E = co(d);
|
|
5515
5529
|
if (e.supports.readableStreamTransfer) {
|
|
5516
|
-
const
|
|
5530
|
+
const b = d.body;
|
|
5517
5531
|
i.postMessage(
|
|
5518
5532
|
"MOCK_RESPONSE",
|
|
5519
5533
|
Se(Le({}, E), {
|
|
5520
|
-
body:
|
|
5534
|
+
body: b
|
|
5521
5535
|
}),
|
|
5522
|
-
|
|
5536
|
+
b ? [b] : void 0
|
|
5523
5537
|
);
|
|
5524
5538
|
} else {
|
|
5525
|
-
const
|
|
5539
|
+
const b = yield y.arrayBuffer();
|
|
5526
5540
|
i.postMessage("MOCK_RESPONSE", Se(Le({}, E), {
|
|
5527
|
-
body:
|
|
5541
|
+
body: b
|
|
5528
5542
|
}));
|
|
5529
5543
|
}
|
|
5530
5544
|
t.quiet || e.emitter.once("response:mocked", () => {
|
|
5531
5545
|
m.log({
|
|
5532
5546
|
request: o,
|
|
5533
|
-
response:
|
|
5534
|
-
parsedResult:
|
|
5547
|
+
response: g,
|
|
5548
|
+
parsedResult: p
|
|
5535
5549
|
});
|
|
5536
5550
|
});
|
|
5537
5551
|
});
|
|
@@ -5539,7 +5553,7 @@ var Mo = (e, t) => (r, s) => k(void 0, null, function* () {
|
|
|
5539
5553
|
}
|
|
5540
5554
|
);
|
|
5541
5555
|
} catch (c) {
|
|
5542
|
-
c instanceof Error && (
|
|
5556
|
+
c instanceof Error && (O.error(
|
|
5543
5557
|
`Uncaught exception in the request handler for "%s %s":
|
|
5544
5558
|
|
|
5545
5559
|
%s
|
|
@@ -5563,7 +5577,7 @@ This exception has been gracefully handled as a 500 response, however, it's stro
|
|
|
5563
5577
|
}
|
|
5564
5578
|
});
|
|
5565
5579
|
function $o(e, t) {
|
|
5566
|
-
return
|
|
5580
|
+
return S(this, null, function* () {
|
|
5567
5581
|
e.workerChannel.send("INTEGRITY_CHECK_REQUEST");
|
|
5568
5582
|
const { payload: r } = yield e.events.once(
|
|
5569
5583
|
"INTEGRITY_CHECK_RESPONSE"
|
|
@@ -5578,13 +5592,13 @@ function $o(e, t) {
|
|
|
5578
5592
|
function Uo(e) {
|
|
5579
5593
|
const t = window.XMLHttpRequest.prototype.send;
|
|
5580
5594
|
window.XMLHttpRequest.prototype.send = function(...s) {
|
|
5581
|
-
|
|
5595
|
+
j(() => e).then(() => {
|
|
5582
5596
|
window.XMLHttpRequest.prototype.send = t, this.send(...s);
|
|
5583
5597
|
});
|
|
5584
5598
|
};
|
|
5585
5599
|
const r = window.fetch;
|
|
5586
|
-
window.fetch = (...s) =>
|
|
5587
|
-
return yield
|
|
5600
|
+
window.fetch = (...s) => S(this, null, function* () {
|
|
5601
|
+
return yield j(() => e), window.fetch = r, window.fetch(...s);
|
|
5588
5602
|
});
|
|
5589
5603
|
}
|
|
5590
5604
|
function jo(e) {
|
|
@@ -5609,7 +5623,7 @@ function jo(e) {
|
|
|
5609
5623
|
};
|
|
5610
5624
|
}
|
|
5611
5625
|
function Fo(e, t) {
|
|
5612
|
-
!(t != null && t.quiet) && !location.href.startsWith(e.scope) &&
|
|
5626
|
+
!(t != null && t.quiet) && !location.href.startsWith(e.scope) && O.warn(
|
|
5613
5627
|
`Cannot intercept requests on this page because it's outside of the worker's scope ("${e.scope}"). If you wish to mock API requests on this page, you must resolve this scope issue.
|
|
5614
5628
|
|
|
5615
5629
|
- (Recommended) Register the worker at the root level ("/") of your application.
|
|
@@ -5617,10 +5631,10 @@ function Fo(e, t) {
|
|
|
5617
5631
|
);
|
|
5618
5632
|
}
|
|
5619
5633
|
var Bo = (e) => function(r, s) {
|
|
5620
|
-
const i =
|
|
5634
|
+
const i = S(this, null, function* () {
|
|
5621
5635
|
e.events.removeAllListeners(), e.workerChannel.on(
|
|
5622
5636
|
"REQUEST",
|
|
5623
|
-
|
|
5637
|
+
qo(e, r)
|
|
5624
5638
|
), e.workerChannel.on("RESPONSE", jo(e));
|
|
5625
5639
|
const a = yield Lo(
|
|
5626
5640
|
r.serviceWorker.url,
|
|
@@ -5628,14 +5642,14 @@ var Bo = (e) => function(r, s) {
|
|
|
5628
5642
|
r.findWorker
|
|
5629
5643
|
), [l, o] = a;
|
|
5630
5644
|
if (!l) {
|
|
5631
|
-
const u = s != null && s.findWorker ?
|
|
5645
|
+
const u = s != null && s.findWorker ? O.formatMessage(
|
|
5632
5646
|
`Failed to locate the Service Worker registration using a custom "findWorker" predicate.
|
|
5633
5647
|
|
|
5634
5648
|
Please ensure that the custom predicate properly locates the Service Worker registration at "%s".
|
|
5635
5649
|
More details: https://mswjs.io/docs/api/setup-worker/start#findworker
|
|
5636
5650
|
`,
|
|
5637
5651
|
r.serviceWorker.url
|
|
5638
|
-
) :
|
|
5652
|
+
) : O.formatMessage(
|
|
5639
5653
|
`Failed to locate the Service Worker registration.
|
|
5640
5654
|
|
|
5641
5655
|
This most likely means that the worker script URL "%s" cannot resolve against the actual public hostname (%s). This may happen if your application runs behind a proxy, or has a dynamic hostname.
|
|
@@ -5649,10 +5663,10 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
5649
5663
|
e.worker = l, e.registration = o, e.events.addListener(window, "beforeunload", () => {
|
|
5650
5664
|
l.state !== "redundant" && e.workerChannel.send("CLIENT_CLOSED"), window.clearInterval(e.keepAliveInterval);
|
|
5651
5665
|
});
|
|
5652
|
-
const c = yield
|
|
5666
|
+
const c = yield j(
|
|
5653
5667
|
() => $o(e, l)
|
|
5654
5668
|
);
|
|
5655
|
-
return c.error &&
|
|
5669
|
+
return c.error && O.error(`Detected outdated Service Worker: ${c.error.message}
|
|
5656
5670
|
|
|
5657
5671
|
The mocking is still enabled, but it's highly recommended that you update your Service Worker by running:
|
|
5658
5672
|
|
|
@@ -5664,7 +5678,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
5664
5678
|
5e3
|
|
5665
5679
|
), Fo(o, e.startOptions), o;
|
|
5666
5680
|
}).then(
|
|
5667
|
-
(a) =>
|
|
5681
|
+
(a) => S(this, null, function* () {
|
|
5668
5682
|
const l = a.installing || a.waiting;
|
|
5669
5683
|
return l && (yield new Promise((o) => {
|
|
5670
5684
|
l.addEventListener("statechange", () => {
|
|
@@ -5680,14 +5694,14 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
5680
5694
|
};
|
|
5681
5695
|
function Nr(e = {}) {
|
|
5682
5696
|
e.quiet || console.log(
|
|
5683
|
-
`%c${
|
|
5697
|
+
`%c${O.formatMessage("Mocking disabled.")}`,
|
|
5684
5698
|
"color:orangered;font-weight:bold;"
|
|
5685
5699
|
);
|
|
5686
5700
|
}
|
|
5687
5701
|
var Vo = (e) => function() {
|
|
5688
5702
|
var r;
|
|
5689
5703
|
if (!e.isMockingEnabled) {
|
|
5690
|
-
|
|
5704
|
+
O.warn(
|
|
5691
5705
|
'Found a redundant "worker.stop()" call. Note that stopping the worker while mocking already stopped has no effect. Consider removing this "worker.stop()" call.'
|
|
5692
5706
|
);
|
|
5693
5707
|
return;
|
|
@@ -5710,7 +5724,7 @@ function Go(e, t) {
|
|
|
5710
5724
|
name: "fallback",
|
|
5711
5725
|
interceptors: [new xr(), new Rr()]
|
|
5712
5726
|
});
|
|
5713
|
-
return r.on("request", (s) =>
|
|
5727
|
+
return r.on("request", (s) => S(this, [s], function* ({ request: n, requestId: i }) {
|
|
5714
5728
|
const a = n.clone(), l = yield yr(
|
|
5715
5729
|
n,
|
|
5716
5730
|
i,
|
|
@@ -5744,9 +5758,9 @@ function Go(e, t) {
|
|
|
5744
5758
|
}
|
|
5745
5759
|
), r.apply(), r;
|
|
5746
5760
|
}
|
|
5747
|
-
function
|
|
5761
|
+
function zo(e) {
|
|
5748
5762
|
return function(r) {
|
|
5749
|
-
return
|
|
5763
|
+
return S(this, null, function* () {
|
|
5750
5764
|
e.fallbackInterceptor = Go(
|
|
5751
5765
|
e,
|
|
5752
5766
|
r
|
|
@@ -5757,13 +5771,13 @@ function Ho(e) {
|
|
|
5757
5771
|
});
|
|
5758
5772
|
};
|
|
5759
5773
|
}
|
|
5760
|
-
function
|
|
5774
|
+
function Ho(e) {
|
|
5761
5775
|
return function() {
|
|
5762
5776
|
var r, s;
|
|
5763
5777
|
(r = e.fallbackInterceptor) == null || r.dispose(), Nr({ quiet: (s = e.startOptions) == null ? void 0 : s.quiet });
|
|
5764
5778
|
};
|
|
5765
5779
|
}
|
|
5766
|
-
function
|
|
5780
|
+
function Xo() {
|
|
5767
5781
|
try {
|
|
5768
5782
|
const e = new ReadableStream({
|
|
5769
5783
|
start: (r) => r.close()
|
|
@@ -5775,9 +5789,9 @@ function zo() {
|
|
|
5775
5789
|
}
|
|
5776
5790
|
var Yo = class extends fn {
|
|
5777
5791
|
constructor(...e) {
|
|
5778
|
-
super(...e), this.startHandler = null, this.stopHandler = null,
|
|
5792
|
+
super(...e), this.startHandler = null, this.stopHandler = null, C(
|
|
5779
5793
|
!Ce(),
|
|
5780
|
-
|
|
5794
|
+
O.formatMessage(
|
|
5781
5795
|
"Failed to execute `setupWorker` in a non-browser environment. Consider using `setupServer` for Node.js environment instead."
|
|
5782
5796
|
)
|
|
5783
5797
|
), this.listeners = [], this.context = this.createWorkerContext();
|
|
@@ -5849,17 +5863,17 @@ var Yo = class extends fn {
|
|
|
5849
5863
|
},
|
|
5850
5864
|
supports: {
|
|
5851
5865
|
serviceWorkerApi: !("serviceWorker" in navigator) || location.protocol === "file:",
|
|
5852
|
-
readableStreamTransfer:
|
|
5866
|
+
readableStreamTransfer: Xo()
|
|
5853
5867
|
}
|
|
5854
5868
|
};
|
|
5855
5869
|
return Object.defineProperties(e, {
|
|
5856
5870
|
requestHandlers: {
|
|
5857
5871
|
get: () => this.currentHandlers
|
|
5858
5872
|
}
|
|
5859
|
-
}), this.startHandler = e.supports.serviceWorkerApi ?
|
|
5873
|
+
}), this.startHandler = e.supports.serviceWorkerApi ? zo(e) : Bo(e), this.stopHandler = e.supports.serviceWorkerApi ? Ho(e) : Vo(e), e;
|
|
5860
5874
|
}
|
|
5861
5875
|
start() {
|
|
5862
|
-
return
|
|
5876
|
+
return S(this, arguments, function* (e = {}) {
|
|
5863
5877
|
return this.context.startOptions = gr(
|
|
5864
5878
|
Wo,
|
|
5865
5879
|
e
|
|
@@ -5874,22 +5888,22 @@ function Jo(...e) {
|
|
|
5874
5888
|
return new Yo(...e);
|
|
5875
5889
|
}
|
|
5876
5890
|
var he = /* @__PURE__ */ ((e) => (e[e.Continue = 100] = "Continue", e[e.SwitchingProtocols = 101] = "SwitchingProtocols", e[e.Processing = 102] = "Processing", e[e.EarlyHints = 103] = "EarlyHints", e[e.Ok = 200] = "Ok", e[e.Created = 201] = "Created", e[e.Accepted = 202] = "Accepted", e[e.NonAuthoritativeInformation = 203] = "NonAuthoritativeInformation", e[e.NoContent = 204] = "NoContent", e[e.ResetContent = 205] = "ResetContent", e[e.PartialContent = 206] = "PartialContent", e[e.MultiStatus = 207] = "MultiStatus", e[e.AlreadyReported = 208] = "AlreadyReported", e[e.ImUsed = 226] = "ImUsed", e[e.MultipleChoices = 300] = "MultipleChoices", e[e.MovedPermanently = 301] = "MovedPermanently", e[e.Found = 302] = "Found", e[e.SeeOther = 303] = "SeeOther", e[e.NotModified = 304] = "NotModified", e[e.UseProxy = 305] = "UseProxy", e[e.Unused = 306] = "Unused", e[e.TemporaryRedirect = 307] = "TemporaryRedirect", e[e.PermanentRedirect = 308] = "PermanentRedirect", e[e.BadRequest = 400] = "BadRequest", e[e.Unauthorized = 401] = "Unauthorized", e[e.PaymentRequired = 402] = "PaymentRequired", e[e.Forbidden = 403] = "Forbidden", e[e.NotFound = 404] = "NotFound", e[e.MethodNotAllowed = 405] = "MethodNotAllowed", e[e.NotAcceptable = 406] = "NotAcceptable", e[e.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", e[e.RequestTimeout = 408] = "RequestTimeout", e[e.Conflict = 409] = "Conflict", e[e.Gone = 410] = "Gone", e[e.LengthRequired = 411] = "LengthRequired", e[e.PreconditionFailed = 412] = "PreconditionFailed", e[e.PayloadTooLarge = 413] = "PayloadTooLarge", e[e.UriTooLong = 414] = "UriTooLong", e[e.UnsupportedMediaType = 415] = "UnsupportedMediaType", e[e.RangeNotSatisfiable = 416] = "RangeNotSatisfiable", e[e.ExpectationFailed = 417] = "ExpectationFailed", e[e.ImATeapot = 418] = "ImATeapot", e[e.MisdirectedRequest = 421] = "MisdirectedRequest", e[e.UnprocessableEntity = 422] = "UnprocessableEntity", e[e.Locked = 423] = "Locked", e[e.FailedDependency = 424] = "FailedDependency", e[e.TooEarly = 425] = "TooEarly", e[e.UpgradeRequired = 426] = "UpgradeRequired", e[e.PreconditionRequired = 428] = "PreconditionRequired", e[e.TooManyRequests = 429] = "TooManyRequests", e[e.RequestHeaderFieldsTooLarge = 431] = "RequestHeaderFieldsTooLarge", e[e.UnavailableForLegalReasons = 451] = "UnavailableForLegalReasons", e[e.InternalServerError = 500] = "InternalServerError", e[e.NotImplemented = 501] = "NotImplemented", e[e.BadGateway = 502] = "BadGateway", e[e.ServiceUnavailable = 503] = "ServiceUnavailable", e[e.GatewayTimeout = 504] = "GatewayTimeout", e[e.HttpVersionNotSupported = 505] = "HttpVersionNotSupported", e[e.VariantAlsoNegotiates = 506] = "VariantAlsoNegotiates", e[e.InsufficientStorage = 507] = "InsufficientStorage", e[e.LoopDetected = 508] = "LoopDetected", e[e.NotExtended = 510] = "NotExtended", e[e.NetworkAuthenticationRequired = 511] = "NetworkAuthenticationRequired", e))(he || {});
|
|
5877
|
-
class
|
|
5891
|
+
class B extends Error {
|
|
5878
5892
|
constructor(t, r) {
|
|
5879
|
-
super((r == null ? void 0 : r.message) || "Not found"), this.details = r, this.status = t, Object.setPrototypeOf(this,
|
|
5893
|
+
super((r == null ? void 0 : r.message) || "Not found"), this.details = r, this.status = t, Object.setPrototypeOf(this, B.prototype);
|
|
5880
5894
|
}
|
|
5881
5895
|
}
|
|
5882
|
-
class Ue extends
|
|
5896
|
+
class Ue extends B {
|
|
5883
5897
|
constructor(t) {
|
|
5884
5898
|
super(404, t), Object.setPrototypeOf(this, Ue.prototype);
|
|
5885
5899
|
}
|
|
5886
5900
|
}
|
|
5887
|
-
class je extends
|
|
5901
|
+
class je extends B {
|
|
5888
5902
|
constructor(t) {
|
|
5889
5903
|
super(401, t), Object.setPrototypeOf(this, je.prototype);
|
|
5890
5904
|
}
|
|
5891
5905
|
}
|
|
5892
|
-
class Fe extends
|
|
5906
|
+
class Fe extends B {
|
|
5893
5907
|
constructor(t) {
|
|
5894
5908
|
super(409, t), Object.setPrototypeOf(this, Fe.prototype);
|
|
5895
5909
|
}
|
|
@@ -5903,7 +5917,7 @@ function le(e) {
|
|
|
5903
5917
|
const Qo = {
|
|
5904
5918
|
NotFound404: (e) => new Ue(le(e)),
|
|
5905
5919
|
Unauthorized401: (e) => new je(le(e)),
|
|
5906
|
-
HttpError: (e, t) => new
|
|
5920
|
+
HttpError: (e, t) => new B(e, le(t)),
|
|
5907
5921
|
Conflict409: (e) => new Fe(le(e))
|
|
5908
5922
|
}, Ko = {
|
|
5909
5923
|
getDate: (e) => e ? new Date(e) : /* @__PURE__ */ new Date()
|
|
@@ -5938,7 +5952,7 @@ class ea {
|
|
|
5938
5952
|
}
|
|
5939
5953
|
class ta {
|
|
5940
5954
|
constructor(t, r, s) {
|
|
5941
|
-
this.definition = t, this.db = r, this.authService = s, this.apiStateHash = {}, this.resolvedHelpers = De(t.helpers, (n) => typeof n == "string" ? (...i) => this.runFn(n, ...i) : n);
|
|
5955
|
+
this.definition = t, this.db = r, this.authService = s, this.apiStateHash = {}, this.resolvedHelpers = De(t.helpers, (n) => typeof n == "string" ? (...i) => this.runFn(n, ...i) : n), t.initialize && this.runFn(t.initialize);
|
|
5942
5956
|
}
|
|
5943
5957
|
async executeOperation(t, r, s, n) {
|
|
5944
5958
|
var a;
|
|
@@ -5970,7 +5984,7 @@ class ta {
|
|
|
5970
5984
|
localContext: s,
|
|
5971
5985
|
eventArgs: r,
|
|
5972
5986
|
appContext: {
|
|
5973
|
-
...
|
|
5987
|
+
...qr,
|
|
5974
5988
|
...$r,
|
|
5975
5989
|
delay: Ur,
|
|
5976
5990
|
Errors: Qo,
|
|
@@ -5978,7 +5992,7 @@ class ta {
|
|
|
5978
5992
|
getDate: jr
|
|
5979
5993
|
}
|
|
5980
5994
|
});
|
|
5981
|
-
return await
|
|
5995
|
+
return await Mr(t, n), (h = (u = n.mainThread) == null ? void 0 : u.blocks) != null && h.length ? n.mainThread.blocks[n.mainThread.blocks.length - 1].returnValue : void 0;
|
|
5982
5996
|
}
|
|
5983
5997
|
}
|
|
5984
5998
|
function ra(e) {
|
|
@@ -5992,7 +6006,7 @@ function ra(e) {
|
|
|
5992
6006
|
...e
|
|
5993
6007
|
};
|
|
5994
6008
|
}
|
|
5995
|
-
class
|
|
6009
|
+
class T {
|
|
5996
6010
|
constructor(t) {
|
|
5997
6011
|
this.list = [];
|
|
5998
6012
|
for (const r of t)
|
|
@@ -6010,7 +6024,7 @@ class x {
|
|
|
6010
6024
|
return this.list[t];
|
|
6011
6025
|
}
|
|
6012
6026
|
all() {
|
|
6013
|
-
return new
|
|
6027
|
+
return new T(this.list);
|
|
6014
6028
|
}
|
|
6015
6029
|
async single(t) {
|
|
6016
6030
|
const r = await this.where(t);
|
|
@@ -6029,20 +6043,20 @@ class x {
|
|
|
6029
6043
|
return s.at(0);
|
|
6030
6044
|
}
|
|
6031
6045
|
async where(t) {
|
|
6032
|
-
return new
|
|
6046
|
+
return new T(await this.whereAsArray(t));
|
|
6033
6047
|
}
|
|
6034
6048
|
async whereAsArray(t) {
|
|
6035
6049
|
const r = await Promise.all(this.list.map(t ?? (async () => !0)));
|
|
6036
6050
|
return this.list.filter((s, n) => r[n]);
|
|
6037
6051
|
}
|
|
6038
6052
|
async orderBy(...t) {
|
|
6039
|
-
return new
|
|
6053
|
+
return new T(await Ee(this.list, ...t));
|
|
6040
6054
|
}
|
|
6041
6055
|
async orderByAsArray(...t) {
|
|
6042
|
-
return await
|
|
6056
|
+
return await Ee(this.list, ...t);
|
|
6043
6057
|
}
|
|
6044
6058
|
async groupBy(t) {
|
|
6045
|
-
return new
|
|
6059
|
+
return new T(await this.groupByAsArray(t));
|
|
6046
6060
|
}
|
|
6047
6061
|
async groupByAsArray(t) {
|
|
6048
6062
|
const r = /* @__PURE__ */ new Map();
|
|
@@ -6060,23 +6074,23 @@ class x {
|
|
|
6060
6074
|
const r = /* @__PURE__ */ new Set();
|
|
6061
6075
|
for (const s of this.list)
|
|
6062
6076
|
r.add(await t(s));
|
|
6063
|
-
return new
|
|
6077
|
+
return new T(r.values());
|
|
6064
6078
|
}
|
|
6065
6079
|
async distinctAsArray(t) {
|
|
6066
6080
|
return (await this.distinct(t)).toArray();
|
|
6067
6081
|
}
|
|
6068
6082
|
async maxValue(t = "id", r) {
|
|
6069
|
-
let s = r ? (await new
|
|
6070
|
-
return s = await
|
|
6083
|
+
let s = r ? (await new T(this.list).where(r)).toArray() : this.list;
|
|
6084
|
+
return s = await Ee(s, (n) => n[t], !0), s.length === 0 ? void 0 : s[0][t];
|
|
6071
6085
|
}
|
|
6072
6086
|
async skip(t) {
|
|
6073
|
-
return new
|
|
6087
|
+
return new T(this.list.slice(t));
|
|
6074
6088
|
}
|
|
6075
6089
|
async take(t) {
|
|
6076
|
-
return new
|
|
6090
|
+
return new T(this.list.slice(0, t));
|
|
6077
6091
|
}
|
|
6078
6092
|
async skipTake(t, r) {
|
|
6079
|
-
return new
|
|
6093
|
+
return new T(this.list.slice(t, r + t));
|
|
6080
6094
|
}
|
|
6081
6095
|
}
|
|
6082
6096
|
class na {
|
|
@@ -6161,20 +6175,20 @@ async function sa(e) {
|
|
|
6161
6175
|
return e.schema.primKey.src === "++id" && (n = Number(s)), e.get(n);
|
|
6162
6176
|
},
|
|
6163
6177
|
toArray: async () => await e.toArray(),
|
|
6164
|
-
single: async (s) => await new
|
|
6165
|
-
singleOrDefault: async (s, n) => await new
|
|
6166
|
-
where: async (s) => new
|
|
6178
|
+
single: async (s) => await new T(await e.toArray()).single(s),
|
|
6179
|
+
singleOrDefault: async (s, n) => await new T(await e.toArray()).singleOrDefault(s, n),
|
|
6180
|
+
where: async (s) => new T(await r(s)),
|
|
6167
6181
|
whereAsArray: async (s) => await r(s),
|
|
6168
|
-
orderBy: async (...s) => await new
|
|
6169
|
-
orderByAsArray: async (...s) => await new
|
|
6170
|
-
groupBy: async (s) => await new
|
|
6171
|
-
groupByAsArray: async (s) => await new
|
|
6172
|
-
distinct: async (s) => await new
|
|
6173
|
-
distinctAsArray: async (s) => await new
|
|
6174
|
-
maxValue: async (s = "id", n) => await new
|
|
6175
|
-
skip: async (s) => await new
|
|
6176
|
-
take: async (s) => await new
|
|
6177
|
-
skipTake: async (s, n) => await new
|
|
6182
|
+
orderBy: async (...s) => await new T(await e.toArray()).orderBy(...s),
|
|
6183
|
+
orderByAsArray: async (...s) => await new T(await e.toArray()).orderByAsArray(...s),
|
|
6184
|
+
groupBy: async (s) => await new T(await e.toArray()).groupBy(s),
|
|
6185
|
+
groupByAsArray: async (s) => await new T(await e.toArray()).groupByAsArray(s),
|
|
6186
|
+
distinct: async (s) => await new T(await e.toArray()).distinct(s),
|
|
6187
|
+
distinctAsArray: async (s) => await new T(await e.toArray()).distinctAsArray(s),
|
|
6188
|
+
maxValue: async (s = "id", n) => await new T(await e.toArray()).maxValue(s, n),
|
|
6189
|
+
skip: async (s) => await new T(await e.toArray()).skip(s),
|
|
6190
|
+
take: async (s) => await new T(await e.toArray()).take(s),
|
|
6191
|
+
skipTake: async (s, n) => await new T(await e.toArray()).skipTake(s, n)
|
|
6178
6192
|
};
|
|
6179
6193
|
}
|
|
6180
6194
|
function At(e, t) {
|
|
@@ -6236,7 +6250,32 @@ function At(e, t) {
|
|
|
6236
6250
|
}
|
|
6237
6251
|
}), r;
|
|
6238
6252
|
}
|
|
6239
|
-
|
|
6253
|
+
class ia {
|
|
6254
|
+
constructor(t, r = {}, s) {
|
|
6255
|
+
this.tables = t, this.initialData = r, this.config = s;
|
|
6256
|
+
}
|
|
6257
|
+
getItems(t) {
|
|
6258
|
+
throw new Error("Method not implemented.");
|
|
6259
|
+
}
|
|
6260
|
+
getItem(t, r) {
|
|
6261
|
+
throw new Error("Method not implemented.");
|
|
6262
|
+
}
|
|
6263
|
+
getItemById(t, r) {
|
|
6264
|
+
throw new Error("Method not implemented.");
|
|
6265
|
+
}
|
|
6266
|
+
deleteItems(t, r) {
|
|
6267
|
+
throw new Error("Method not implemented.");
|
|
6268
|
+
}
|
|
6269
|
+
insertItem(t, r) {
|
|
6270
|
+
throw new Error("Method not implemented.");
|
|
6271
|
+
}
|
|
6272
|
+
updateItem(t, r) {
|
|
6273
|
+
throw new Error("Method not implemented.");
|
|
6274
|
+
}
|
|
6275
|
+
async initialize() {
|
|
6276
|
+
}
|
|
6277
|
+
}
|
|
6278
|
+
function oa(...e) {
|
|
6240
6279
|
const t = {};
|
|
6241
6280
|
for (const r of e) {
|
|
6242
6281
|
if (!Nt(r))
|
|
@@ -6247,7 +6286,7 @@ function ia(...e) {
|
|
|
6247
6286
|
}
|
|
6248
6287
|
return new Headers(t);
|
|
6249
6288
|
}
|
|
6250
|
-
class
|
|
6289
|
+
class aa {
|
|
6251
6290
|
constructor(t) {
|
|
6252
6291
|
const r = JSON.parse(sessionStorage.getItem("session-logged-in-user"));
|
|
6253
6292
|
this.loggedInUser = r || (t == null ? void 0 : t.defaultLoggedInUser);
|
|
@@ -6268,23 +6307,31 @@ class oa {
|
|
|
6268
6307
|
return this.loggedInUser;
|
|
6269
6308
|
}
|
|
6270
6309
|
}
|
|
6271
|
-
|
|
6310
|
+
async function ca(e) {
|
|
6311
|
+
var t, r;
|
|
6312
|
+
switch (e.type) {
|
|
6313
|
+
case "in-memory":
|
|
6314
|
+
return new ia((t = e.schemaDescriptor) == null ? void 0 : t.tables, e.initialData, e.config);
|
|
6315
|
+
default:
|
|
6316
|
+
const s = new na((r = e.schemaDescriptor) == null ? void 0 : r.tables, e.initialData, e.config);
|
|
6317
|
+
return await s.initialize(), s;
|
|
6318
|
+
}
|
|
6319
|
+
}
|
|
6320
|
+
class la {
|
|
6272
6321
|
constructor(t) {
|
|
6273
6322
|
this.apiDef = t, this.backend = null;
|
|
6274
6323
|
}
|
|
6275
6324
|
async initialize() {
|
|
6276
|
-
var i;
|
|
6277
6325
|
const t = {};
|
|
6278
|
-
Object.entries(this.apiDef.operations || {}).forEach(([
|
|
6279
|
-
t[
|
|
6326
|
+
Object.entries(this.apiDef.operations || {}).forEach(([i, a]) => {
|
|
6327
|
+
t[i] = a.handler;
|
|
6280
6328
|
});
|
|
6281
|
-
const r =
|
|
6282
|
-
await s.initialize();
|
|
6283
|
-
const n = {
|
|
6329
|
+
const r = await ca(this.apiDef), s = new aa(this.apiDef.auth), n = {
|
|
6284
6330
|
operations: t,
|
|
6331
|
+
initialize: this.apiDef.initialize,
|
|
6285
6332
|
helpers: this.apiDef.helpers
|
|
6286
6333
|
};
|
|
6287
|
-
this.backend = new ta(n,
|
|
6334
|
+
this.backend = new ta(n, r, s);
|
|
6288
6335
|
}
|
|
6289
6336
|
getOperations() {
|
|
6290
6337
|
return this.apiDef.operations || {};
|
|
@@ -6305,8 +6352,8 @@ class aa {
|
|
|
6305
6352
|
if (i.requestShape === "formData") {
|
|
6306
6353
|
const h = await r.formData(), d = {};
|
|
6307
6354
|
for (const m of h.keys()) {
|
|
6308
|
-
const
|
|
6309
|
-
|
|
6355
|
+
const p = h.getAll(m);
|
|
6356
|
+
p.length === 1 ? d[m] = p[0] : d[m] = p;
|
|
6310
6357
|
}
|
|
6311
6358
|
a = d;
|
|
6312
6359
|
} else i.requestShape === "blob" ? a = await r.blob() : a = await r.json();
|
|
@@ -6325,19 +6372,19 @@ class aa {
|
|
|
6325
6372
|
await Dr();
|
|
6326
6373
|
const o = new Zo(), c = new ea();
|
|
6327
6374
|
try {
|
|
6328
|
-
const h = await this.backend.executeOperation(t, l, o, c), d = h == null, m = i.successStatusCode ?? (d ? he.NoContent : he.Ok),
|
|
6329
|
-
return h instanceof File ? (
|
|
6330
|
-
headers:
|
|
6375
|
+
const h = await this.backend.executeOperation(t, l, o, c), d = h == null, m = i.successStatusCode ?? (d ? he.NoContent : he.Ok), p = oa(o.getCookieHeader(), c.getHeaders());
|
|
6376
|
+
return h instanceof File ? (p.append("Content-type", h.type), p.append("Content-Length", h.size + ""), p.append("Content-Disposition", `attachment; filename="${h.name}"; filename*=utf-8''${h.name}`), K.arrayBuffer(await h.arrayBuffer(), {
|
|
6377
|
+
headers: p,
|
|
6331
6378
|
status: m
|
|
6332
6379
|
})) : d ? new K(null, {
|
|
6333
|
-
headers:
|
|
6380
|
+
headers: p,
|
|
6334
6381
|
status: m
|
|
6335
6382
|
}) : K.json(h, {
|
|
6336
|
-
headers:
|
|
6383
|
+
headers: p,
|
|
6337
6384
|
status: m
|
|
6338
6385
|
});
|
|
6339
6386
|
} catch (h) {
|
|
6340
|
-
return console.error(h), h instanceof Fr && h.errorObject instanceof
|
|
6387
|
+
return console.error(h), h instanceof Fr && h.errorObject instanceof B ? K.json(h.errorObject.details, {
|
|
6341
6388
|
headers: o.getCookieHeader(),
|
|
6342
6389
|
status: h.errorObject.status
|
|
6343
6390
|
}) : K.json(
|
|
@@ -6358,7 +6405,7 @@ class aa {
|
|
|
6358
6405
|
};
|
|
6359
6406
|
}
|
|
6360
6407
|
}
|
|
6361
|
-
function
|
|
6408
|
+
function ua(e) {
|
|
6362
6409
|
const t = e.getOperations();
|
|
6363
6410
|
let r = [];
|
|
6364
6411
|
return Object.entries(t).forEach(([s, n]) => {
|
|
@@ -6373,13 +6420,13 @@ function ca(e) {
|
|
|
6373
6420
|
});
|
|
6374
6421
|
}), r;
|
|
6375
6422
|
}
|
|
6376
|
-
const
|
|
6377
|
-
const r = new
|
|
6423
|
+
const ya = async (e, t) => {
|
|
6424
|
+
const r = new la(e);
|
|
6378
6425
|
await r.initialize();
|
|
6379
|
-
const s =
|
|
6426
|
+
const s = ua(r);
|
|
6380
6427
|
let n = t;
|
|
6381
6428
|
return n || (n = Jo()), n.use(...s), n;
|
|
6382
6429
|
};
|
|
6383
6430
|
export {
|
|
6384
|
-
|
|
6431
|
+
ya as createApiInterceptorWorker
|
|
6385
6432
|
};
|