@wp-playground/blueprints 0.6.6 → 0.6.7
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/index.cjs +8 -8
- package/index.js +392 -382
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -8,56 +8,66 @@ var H = (e, t, r) => (Nt(e, t, "read from private field"), r ? r.call(e) : t.get
|
|
|
8
8
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
9
9
|
}, te = (e, t, r, n) => (Nt(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
10
10
|
var ce = (e, t, r) => (Nt(e, t, "access private method"), r);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const currentJsRuntime = function() {
|
|
12
|
+
var e;
|
|
13
|
+
return typeof process < "u" && ((e = process.release) == null ? void 0 : e.name) === "node" ? "NODE" : typeof window < "u" ? "WEB" : (
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
typeof WorkerGlobalScope < "u" && // @ts-ignore
|
|
16
|
+
self instanceof WorkerGlobalScope ? "WORKER" : "NODE"
|
|
17
|
+
);
|
|
18
|
+
}();
|
|
19
|
+
if (currentJsRuntime === "NODE") {
|
|
20
|
+
let e = function(r) {
|
|
21
|
+
return new Promise(function(n, s) {
|
|
22
|
+
r.onload = r.onerror = function(i) {
|
|
23
|
+
r.onload = r.onerror = null, i.type === "load" ? n(r.result) : s(new Error("Failed to read the blob/file"));
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
}, t = function() {
|
|
27
|
+
const r = new Uint8Array([1, 2, 3, 4]), s = new File([r], "test").stream();
|
|
28
|
+
try {
|
|
29
|
+
return s.getReader({ mode: "byob" }), !0;
|
|
30
|
+
} catch {
|
|
31
|
+
return !1;
|
|
17
32
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
typeof Blob.prototype.arrayBuffer > "u" && (Blob.prototype.arrayBuffer = function() {
|
|
29
|
-
const t = new FileReader();
|
|
30
|
-
return t.readAsArrayBuffer(this), asPromise(t);
|
|
31
|
-
});
|
|
32
|
-
typeof Blob.prototype.text > "u" && (Blob.prototype.text = function() {
|
|
33
|
-
const t = new FileReader();
|
|
34
|
-
return t.readAsText(this), asPromise(t);
|
|
35
|
-
});
|
|
36
|
-
function isByobSupported() {
|
|
37
|
-
const e = new Uint8Array([1, 2, 3, 4]), r = new File([e], "test").stream();
|
|
38
|
-
try {
|
|
39
|
-
return r.getReader({ mode: "byob" }), !0;
|
|
40
|
-
} catch {
|
|
41
|
-
return !1;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
(typeof Blob.prototype.stream > "u" || !isByobSupported()) && (Blob.prototype.stream = function() {
|
|
45
|
-
let e = 0;
|
|
46
|
-
const t = this;
|
|
47
|
-
return new ReadableStream({
|
|
48
|
-
type: "bytes",
|
|
49
|
-
// 0.5 MB seems like a reasonable chunk size, let's adjust
|
|
50
|
-
// this if needed.
|
|
51
|
-
autoAllocateChunkSize: 512 * 1024,
|
|
52
|
-
async pull(r) {
|
|
53
|
-
const n = r.byobRequest.view, i = await t.slice(e, e + n.byteLength).arrayBuffer(), o = new Uint8Array(i);
|
|
54
|
-
new Uint8Array(n.buffer).set(o);
|
|
55
|
-
const l = o.byteLength;
|
|
56
|
-
r.byobRequest.respond(l), e += l, e >= t.size && r.close();
|
|
33
|
+
};
|
|
34
|
+
if (typeof File > "u") {
|
|
35
|
+
class r extends Blob {
|
|
36
|
+
constructor(s, i, o) {
|
|
37
|
+
super(s);
|
|
38
|
+
let l;
|
|
39
|
+
o != null && o.lastModified && (l = /* @__PURE__ */ new Date()), (!l || isNaN(l.getFullYear())) && (l = /* @__PURE__ */ new Date()), this.lastModifiedDate = l, this.lastModified = l.getMilliseconds(), this.name = i || "";
|
|
40
|
+
}
|
|
57
41
|
}
|
|
42
|
+
global.File = r;
|
|
43
|
+
}
|
|
44
|
+
typeof Blob.prototype.arrayBuffer > "u" && (Blob.prototype.arrayBuffer = function() {
|
|
45
|
+
const n = new FileReader();
|
|
46
|
+
return n.readAsArrayBuffer(this), e(n);
|
|
47
|
+
}), typeof Blob.prototype.text > "u" && (Blob.prototype.text = function() {
|
|
48
|
+
const n = new FileReader();
|
|
49
|
+
return n.readAsText(this), e(n);
|
|
50
|
+
}), (typeof Blob.prototype.stream > "u" || !t()) && (Blob.prototype.stream = function() {
|
|
51
|
+
let r = 0;
|
|
52
|
+
const n = this;
|
|
53
|
+
return new ReadableStream({
|
|
54
|
+
type: "bytes",
|
|
55
|
+
// 0.5 MB seems like a reasonable chunk size, let's adjust
|
|
56
|
+
// this if needed.
|
|
57
|
+
autoAllocateChunkSize: 512 * 1024,
|
|
58
|
+
async pull(s) {
|
|
59
|
+
const i = s.byobRequest.view, l = await n.slice(
|
|
60
|
+
r,
|
|
61
|
+
r + i.byteLength
|
|
62
|
+
).arrayBuffer(), d = new Uint8Array(l);
|
|
63
|
+
new Uint8Array(i.buffer).set(d);
|
|
64
|
+
const u = d.byteLength;
|
|
65
|
+
s.byobRequest.respond(u), r += u, r >= n.size && s.close();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
58
68
|
});
|
|
59
|
-
}
|
|
60
|
-
if (typeof CustomEvent > "u") {
|
|
69
|
+
}
|
|
70
|
+
if (currentJsRuntime === "NODE" && typeof CustomEvent > "u") {
|
|
61
71
|
class e extends Event {
|
|
62
72
|
constructor(r, n = {}) {
|
|
63
73
|
super(r, n), this.detail = n.detail;
|
|
@@ -1724,16 +1734,16 @@ const SupportedPHPVersions = [
|
|
|
1724
1734
|
], SupportedPHPExtensionBundles = {
|
|
1725
1735
|
"kitchen-sink": SupportedPHPExtensionsList
|
|
1726
1736
|
};
|
|
1727
|
-
var
|
|
1737
|
+
var De, Ge;
|
|
1728
1738
|
class PHPBrowser {
|
|
1729
1739
|
/**
|
|
1730
1740
|
* @param server - The PHP server to browse.
|
|
1731
1741
|
* @param config - The browser configuration.
|
|
1732
1742
|
*/
|
|
1733
1743
|
constructor(t, r = {}) {
|
|
1734
|
-
Q(this,
|
|
1744
|
+
Q(this, De, void 0);
|
|
1735
1745
|
Q(this, Ge, void 0);
|
|
1736
|
-
this.requestHandler = t, te(this,
|
|
1746
|
+
this.requestHandler = t, te(this, De, {}), te(this, Ge, {
|
|
1737
1747
|
handleRedirects: !1,
|
|
1738
1748
|
maxRedirects: 4,
|
|
1739
1749
|
...r
|
|
@@ -1799,19 +1809,19 @@ class PHPBrowser {
|
|
|
1799
1809
|
if (!r.includes("="))
|
|
1800
1810
|
continue;
|
|
1801
1811
|
const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
|
|
1802
|
-
H(this,
|
|
1812
|
+
H(this, De)[s] = i;
|
|
1803
1813
|
} catch (n) {
|
|
1804
1814
|
console.error(n);
|
|
1805
1815
|
}
|
|
1806
1816
|
}
|
|
1807
1817
|
serializeCookies() {
|
|
1808
1818
|
const t = [];
|
|
1809
|
-
for (const r in H(this,
|
|
1810
|
-
t.push(`${r}=${H(this,
|
|
1819
|
+
for (const r in H(this, De))
|
|
1820
|
+
t.push(`${r}=${H(this, De)[r]}`);
|
|
1811
1821
|
return t.join("; ");
|
|
1812
1822
|
}
|
|
1813
1823
|
}
|
|
1814
|
-
|
|
1824
|
+
De = new WeakMap(), Ge = new WeakMap();
|
|
1815
1825
|
const DEFAULT_BASE_URL = "http://example.com";
|
|
1816
1826
|
function toRelativeUrl(e) {
|
|
1817
1827
|
return e.toString().substring(e.origin.length);
|
|
@@ -1850,7 +1860,7 @@ function fileToUint8Array(e) {
|
|
|
1850
1860
|
}, r.readAsArrayBuffer(e);
|
|
1851
1861
|
});
|
|
1852
1862
|
}
|
|
1853
|
-
var Pe, Ke, dt,
|
|
1863
|
+
var Pe, Ke, dt, Ae, Je, ve, Qe, Fe, mt, xt, _t, Wt, $t, Bt;
|
|
1854
1864
|
class PHPRequestHandler {
|
|
1855
1865
|
/**
|
|
1856
1866
|
* @param php - The PHP instance.
|
|
@@ -1885,7 +1895,7 @@ class PHPRequestHandler {
|
|
|
1885
1895
|
Q(this, Pe, void 0);
|
|
1886
1896
|
Q(this, Ke, void 0);
|
|
1887
1897
|
Q(this, dt, void 0);
|
|
1888
|
-
Q(this,
|
|
1898
|
+
Q(this, Ae, void 0);
|
|
1889
1899
|
Q(this, Je, void 0);
|
|
1890
1900
|
Q(this, ve, void 0);
|
|
1891
1901
|
Q(this, Qe, void 0);
|
|
@@ -1897,11 +1907,11 @@ class PHPRequestHandler {
|
|
|
1897
1907
|
} = r;
|
|
1898
1908
|
this.php = t, te(this, Pe, n);
|
|
1899
1909
|
const i = new URL(s);
|
|
1900
|
-
te(this, dt, i.hostname), te(this,
|
|
1901
|
-
const o = H(this,
|
|
1910
|
+
te(this, dt, i.hostname), te(this, Ae, i.port ? Number(i.port) : i.protocol === "https:" ? 443 : 80), te(this, Ke, (i.protocol || "").replace(":", ""));
|
|
1911
|
+
const o = H(this, Ae) !== 443 && H(this, Ae) !== 80;
|
|
1902
1912
|
te(this, Je, [
|
|
1903
1913
|
H(this, dt),
|
|
1904
|
-
o ? `:${H(this,
|
|
1914
|
+
o ? `:${H(this, Ae)}` : ""
|
|
1905
1915
|
].join("")), te(this, ve, i.pathname.replace(/\/+$/, "")), te(this, Qe, [
|
|
1906
1916
|
`${H(this, Ke)}://`,
|
|
1907
1917
|
H(this, Je),
|
|
@@ -1940,7 +1950,7 @@ class PHPRequestHandler {
|
|
|
1940
1950
|
return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, _t, Wt).call(this, t, n) : ce(this, mt, xt).call(this, i);
|
|
1941
1951
|
}
|
|
1942
1952
|
}
|
|
1943
|
-
Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(),
|
|
1953
|
+
Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), Ae = new WeakMap(), Je = new WeakMap(), ve = new WeakMap(), Qe = new WeakMap(), Fe = new WeakMap(), mt = new WeakSet(), xt = function(t) {
|
|
1944
1954
|
if (!this.php.fileExists(t))
|
|
1945
1955
|
return new PHPResponse(
|
|
1946
1956
|
404,
|
|
@@ -2198,7 +2208,7 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
|
|
|
2198
2208
|
return n && s && __defProp(t, r, s), s;
|
|
2199
2209
|
};
|
|
2200
2210
|
const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
|
|
2201
|
-
var Me, Ze, Ye, be,
|
|
2211
|
+
var Me, Ze, Ye, be, Re, Te, Ee, Xe, gt, Gt, yt, Kt, vt, Jt, wt, Qt, Pt, Zt, bt, Yt, Et, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ot, sr;
|
|
2202
2212
|
class BasePHP {
|
|
2203
2213
|
/**
|
|
2204
2214
|
* Initializes a PHP runtime.
|
|
@@ -2216,19 +2226,19 @@ class BasePHP {
|
|
|
2216
2226
|
Q(this, bt);
|
|
2217
2227
|
Q(this, Et);
|
|
2218
2228
|
Q(this, St);
|
|
2219
|
-
Q(this, Tt);
|
|
2220
2229
|
Q(this, Rt);
|
|
2230
|
+
Q(this, Tt);
|
|
2221
2231
|
Q(this, kt);
|
|
2222
2232
|
Q(this, Ot);
|
|
2223
2233
|
Q(this, Me, void 0);
|
|
2224
2234
|
Q(this, Ze, void 0);
|
|
2225
2235
|
Q(this, Ye, void 0);
|
|
2226
2236
|
Q(this, be, void 0);
|
|
2227
|
-
Q(this, Te, void 0);
|
|
2228
2237
|
Q(this, Re, void 0);
|
|
2238
|
+
Q(this, Te, void 0);
|
|
2229
2239
|
Q(this, Ee, void 0);
|
|
2230
2240
|
Q(this, Xe, void 0);
|
|
2231
|
-
te(this, Me, []), te(this, be, !1), te(this,
|
|
2241
|
+
te(this, Me, []), te(this, be, !1), te(this, Re, null), te(this, Te, {}), te(this, Ee, /* @__PURE__ */ new Map()), te(this, Xe, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPBrowser(
|
|
2232
2242
|
new PHPRequestHandler(this, t)
|
|
2233
2243
|
));
|
|
2234
2244
|
}
|
|
@@ -2284,7 +2294,7 @@ class BasePHP {
|
|
|
2284
2294
|
return s;
|
|
2285
2295
|
}
|
|
2286
2296
|
return "";
|
|
2287
|
-
}, te(this,
|
|
2297
|
+
}, te(this, Re, improveWASMErrorReporting(t)), this.dispatchEvent({
|
|
2288
2298
|
type: "runtime.initialized"
|
|
2289
2299
|
});
|
|
2290
2300
|
}
|
|
@@ -2339,10 +2349,10 @@ class BasePHP {
|
|
|
2339
2349
|
);
|
|
2340
2350
|
ce(this, St, er).call(this, e.scriptPath || ""), ce(this, vt, Jt).call(this, e.relativeUri || ""), ce(this, Pt, Zt).call(this, e.method || "GET");
|
|
2341
2351
|
const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443";
|
|
2342
|
-
ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this, bt, Yt).call(this, n), e.body && (r = ce(this, Et, Xt).call(this, e.body)), typeof e.code == "string" && ce(this, kt, nr).call(this, " ?>" + e.code), ce(this,
|
|
2352
|
+
ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this, bt, Yt).call(this, n), e.body && (r = ce(this, Et, Xt).call(this, e.body)), typeof e.code == "string" && ce(this, kt, nr).call(this, " ?>" + e.code), ce(this, Rt, tr).call(this);
|
|
2343
2353
|
const i = e.env || {};
|
|
2344
2354
|
for (const l in i)
|
|
2345
|
-
ce(this,
|
|
2355
|
+
ce(this, Tt, rr).call(this, l, i[l]);
|
|
2346
2356
|
const o = await ce(this, Ot, sr).call(this);
|
|
2347
2357
|
if (e.throwOnError && o.exitCode !== 0) {
|
|
2348
2358
|
const l = {
|
|
@@ -2367,7 +2377,7 @@ class BasePHP {
|
|
|
2367
2377
|
}
|
|
2368
2378
|
}
|
|
2369
2379
|
addServerGlobalEntry(e, t) {
|
|
2370
|
-
H(this,
|
|
2380
|
+
H(this, Te)[e] = t;
|
|
2371
2381
|
}
|
|
2372
2382
|
defineConstant(e, t) {
|
|
2373
2383
|
let r = {};
|
|
@@ -2476,10 +2486,10 @@ class BasePHP {
|
|
|
2476
2486
|
this[__private__dont__use]._exit(e);
|
|
2477
2487
|
} catch {
|
|
2478
2488
|
}
|
|
2479
|
-
te(this, be, !1), te(this,
|
|
2489
|
+
te(this, be, !1), te(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
|
|
2480
2490
|
}
|
|
2481
2491
|
}
|
|
2482
|
-
Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
2492
|
+
Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), Ee = new WeakMap(), Xe = new WeakMap(), gt = new WeakSet(), Gt = function() {
|
|
2483
2493
|
if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
|
|
2484
2494
|
"/internal/consts.php",
|
|
2485
2495
|
`<?php
|
|
@@ -2615,15 +2625,15 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2615
2625
|
[STRING],
|
|
2616
2626
|
[e]
|
|
2617
2627
|
);
|
|
2618
|
-
},
|
|
2619
|
-
for (const e in H(this,
|
|
2628
|
+
}, Rt = new WeakSet(), tr = function() {
|
|
2629
|
+
for (const e in H(this, Te))
|
|
2620
2630
|
this[__private__dont__use].ccall(
|
|
2621
2631
|
"wasm_add_SERVER_entry",
|
|
2622
2632
|
null,
|
|
2623
2633
|
[STRING, STRING],
|
|
2624
|
-
[e, H(this,
|
|
2634
|
+
[e, H(this, Te)[e]]
|
|
2625
2635
|
);
|
|
2626
|
-
},
|
|
2636
|
+
}, Tt = new WeakSet(), rr = function(e, t) {
|
|
2627
2637
|
this[__private__dont__use].ccall(
|
|
2628
2638
|
"wasm_add_ENV_entry",
|
|
2629
2639
|
null,
|
|
@@ -2647,7 +2657,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2647
2657
|
console.error(u), console.error(u.error);
|
|
2648
2658
|
const p = new Error("Rethrown");
|
|
2649
2659
|
p.cause = u.error, p.betterMessage = u.message, o(p);
|
|
2650
|
-
}, (d = H(this,
|
|
2660
|
+
}, (d = H(this, Re)) == null || d.addEventListener(
|
|
2651
2661
|
"error",
|
|
2652
2662
|
t
|
|
2653
2663
|
);
|
|
@@ -2671,7 +2681,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2671
2681
|
const o = i, l = "betterMessage" in o ? o.betterMessage : o.message, d = new Error(l);
|
|
2672
2682
|
throw d.cause = o, console.error(d), d;
|
|
2673
2683
|
} finally {
|
|
2674
|
-
(s = H(this,
|
|
2684
|
+
(s = H(this, Re)) == null || s.removeEventListener("error", t), te(this, Te, {});
|
|
2675
2685
|
}
|
|
2676
2686
|
const { headers: r, httpStatusCode: n } = ce(this, yt, Kt).call(this);
|
|
2677
2687
|
return new PHPResponse(
|
|
@@ -2970,10 +2980,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2970
2980
|
}
|
|
2971
2981
|
e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
2972
2982
|
class r extends t {
|
|
2973
|
-
constructor(
|
|
2974
|
-
if (super(), !e.IDENTIFIER.test(
|
|
2983
|
+
constructor(T) {
|
|
2984
|
+
if (super(), !e.IDENTIFIER.test(T))
|
|
2975
2985
|
throw new Error("CodeGen: name must be a valid identifier");
|
|
2976
|
-
this.str =
|
|
2986
|
+
this.str = T;
|
|
2977
2987
|
}
|
|
2978
2988
|
toString() {
|
|
2979
2989
|
return this.str;
|
|
@@ -2987,8 +2997,8 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2987
2997
|
}
|
|
2988
2998
|
e.Name = r;
|
|
2989
2999
|
class n extends t {
|
|
2990
|
-
constructor(
|
|
2991
|
-
super(), this._items = typeof
|
|
3000
|
+
constructor(T) {
|
|
3001
|
+
super(), this._items = typeof T == "string" ? [T] : T;
|
|
2992
3002
|
}
|
|
2993
3003
|
toString() {
|
|
2994
3004
|
return this.str;
|
|
@@ -2996,66 +3006,66 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2996
3006
|
emptyStr() {
|
|
2997
3007
|
if (this._items.length > 1)
|
|
2998
3008
|
return !1;
|
|
2999
|
-
const
|
|
3000
|
-
return
|
|
3009
|
+
const T = this._items[0];
|
|
3010
|
+
return T === "" || T === '""';
|
|
3001
3011
|
}
|
|
3002
3012
|
get str() {
|
|
3003
|
-
var
|
|
3004
|
-
return (
|
|
3013
|
+
var T;
|
|
3014
|
+
return (T = this._str) !== null && T !== void 0 ? T : this._str = this._items.reduce((S, I) => `${S}${I}`, "");
|
|
3005
3015
|
}
|
|
3006
3016
|
get names() {
|
|
3007
|
-
var
|
|
3008
|
-
return (
|
|
3017
|
+
var T;
|
|
3018
|
+
return (T = this._names) !== null && T !== void 0 ? T : this._names = this._items.reduce((S, I) => (I instanceof r && (S[I.str] = (S[I.str] || 0) + 1), S), {});
|
|
3009
3019
|
}
|
|
3010
3020
|
}
|
|
3011
3021
|
e._Code = n, e.nil = new n("");
|
|
3012
|
-
function s(m, ...
|
|
3022
|
+
function s(m, ...T) {
|
|
3013
3023
|
const S = [m[0]];
|
|
3014
3024
|
let I = 0;
|
|
3015
|
-
for (; I <
|
|
3016
|
-
l(S,
|
|
3025
|
+
for (; I < T.length; )
|
|
3026
|
+
l(S, T[I]), S.push(m[++I]);
|
|
3017
3027
|
return new n(S);
|
|
3018
3028
|
}
|
|
3019
3029
|
e._ = s;
|
|
3020
3030
|
const i = new n("+");
|
|
3021
|
-
function o(m, ...
|
|
3031
|
+
function o(m, ...T) {
|
|
3022
3032
|
const S = [N(m[0])];
|
|
3023
3033
|
let I = 0;
|
|
3024
|
-
for (; I <
|
|
3025
|
-
S.push(i), l(S,
|
|
3034
|
+
for (; I < T.length; )
|
|
3035
|
+
S.push(i), l(S, T[I]), S.push(i, N(m[++I]));
|
|
3026
3036
|
return d(S), new n(S);
|
|
3027
3037
|
}
|
|
3028
3038
|
e.str = o;
|
|
3029
|
-
function l(m,
|
|
3030
|
-
|
|
3039
|
+
function l(m, T) {
|
|
3040
|
+
T instanceof n ? m.push(...T._items) : T instanceof r ? m.push(T) : m.push($(T));
|
|
3031
3041
|
}
|
|
3032
3042
|
e.addCodeArg = l;
|
|
3033
3043
|
function d(m) {
|
|
3034
|
-
let
|
|
3035
|
-
for (;
|
|
3036
|
-
if (m[
|
|
3037
|
-
const S = u(m[
|
|
3044
|
+
let T = 1;
|
|
3045
|
+
for (; T < m.length - 1; ) {
|
|
3046
|
+
if (m[T] === i) {
|
|
3047
|
+
const S = u(m[T - 1], m[T + 1]);
|
|
3038
3048
|
if (S !== void 0) {
|
|
3039
|
-
m.splice(
|
|
3049
|
+
m.splice(T - 1, 3, S);
|
|
3040
3050
|
continue;
|
|
3041
3051
|
}
|
|
3042
|
-
m[
|
|
3052
|
+
m[T++] = "+";
|
|
3043
3053
|
}
|
|
3044
|
-
|
|
3054
|
+
T++;
|
|
3045
3055
|
}
|
|
3046
3056
|
}
|
|
3047
|
-
function u(m,
|
|
3048
|
-
if (
|
|
3057
|
+
function u(m, T) {
|
|
3058
|
+
if (T === '""')
|
|
3049
3059
|
return m;
|
|
3050
3060
|
if (m === '""')
|
|
3051
|
-
return
|
|
3061
|
+
return T;
|
|
3052
3062
|
if (typeof m == "string")
|
|
3053
|
-
return
|
|
3054
|
-
if (typeof
|
|
3055
|
-
return `"${m}${
|
|
3063
|
+
return T instanceof r || m[m.length - 1] !== '"' ? void 0 : typeof T != "string" ? `${m.slice(0, -1)}${T}"` : T[0] === '"' ? m.slice(0, -1) + T.slice(1) : void 0;
|
|
3064
|
+
if (typeof T == "string" && T[0] === '"' && !(m instanceof r))
|
|
3065
|
+
return `"${m}${T.slice(1)}`;
|
|
3056
3066
|
}
|
|
3057
|
-
function p(m,
|
|
3058
|
-
return
|
|
3067
|
+
function p(m, T) {
|
|
3068
|
+
return T.emptyStr() ? m : m.emptyStr() ? T : o`${m}${T}`;
|
|
3059
3069
|
}
|
|
3060
3070
|
e.strConcat = p;
|
|
3061
3071
|
function $(m) {
|
|
@@ -3069,10 +3079,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
3069
3079
|
return JSON.stringify(m).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
3070
3080
|
}
|
|
3071
3081
|
e.safeStringify = N;
|
|
3072
|
-
function
|
|
3082
|
+
function R(m) {
|
|
3073
3083
|
return typeof m == "string" && e.IDENTIFIER.test(m) ? new n(`.${m}`) : s`[${m}]`;
|
|
3074
3084
|
}
|
|
3075
|
-
e.getProperty =
|
|
3085
|
+
e.getProperty = R;
|
|
3076
3086
|
function v(m) {
|
|
3077
3087
|
if (typeof m == "string" && e.IDENTIFIER.test(m))
|
|
3078
3088
|
return new n(`${m}`);
|
|
@@ -3147,15 +3157,15 @@ var scope = {};
|
|
|
3147
3157
|
var $;
|
|
3148
3158
|
if (p.ref === void 0)
|
|
3149
3159
|
throw new Error("CodeGen: ref must be passed in value");
|
|
3150
|
-
const O = this.toName(u), { prefix: N } = O,
|
|
3160
|
+
const O = this.toName(u), { prefix: N } = O, R = ($ = p.key) !== null && $ !== void 0 ? $ : p.ref;
|
|
3151
3161
|
let v = this._values[N];
|
|
3152
3162
|
if (v) {
|
|
3153
|
-
const
|
|
3154
|
-
if (
|
|
3155
|
-
return
|
|
3163
|
+
const T = v.get(R);
|
|
3164
|
+
if (T)
|
|
3165
|
+
return T;
|
|
3156
3166
|
} else
|
|
3157
3167
|
v = this._values[N] = /* @__PURE__ */ new Map();
|
|
3158
|
-
v.set(
|
|
3168
|
+
v.set(R, O);
|
|
3159
3169
|
const g = this._scope[N] || (this._scope[N] = []), m = g.length;
|
|
3160
3170
|
return g[m] = p.ref, O.setValue(p, { property: N, itemIndex: m }), O;
|
|
3161
3171
|
}
|
|
@@ -3180,21 +3190,21 @@ var scope = {};
|
|
|
3180
3190
|
}
|
|
3181
3191
|
_reduceValues(u, p, $ = {}, O) {
|
|
3182
3192
|
let N = t.nil;
|
|
3183
|
-
for (const
|
|
3184
|
-
const v = u[
|
|
3193
|
+
for (const R in u) {
|
|
3194
|
+
const v = u[R];
|
|
3185
3195
|
if (!v)
|
|
3186
3196
|
continue;
|
|
3187
|
-
const g = $[
|
|
3197
|
+
const g = $[R] = $[R] || /* @__PURE__ */ new Map();
|
|
3188
3198
|
v.forEach((m) => {
|
|
3189
3199
|
if (g.has(m))
|
|
3190
3200
|
return;
|
|
3191
3201
|
g.set(m, n.Started);
|
|
3192
|
-
let
|
|
3193
|
-
if (
|
|
3202
|
+
let T = p(m);
|
|
3203
|
+
if (T) {
|
|
3194
3204
|
const S = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
|
|
3195
|
-
N = (0, t._)`${N}${S} ${m} = ${
|
|
3196
|
-
} else if (
|
|
3197
|
-
N = (0, t._)`${N}${
|
|
3205
|
+
N = (0, t._)`${N}${S} ${m} = ${T};${this.opts._n}`;
|
|
3206
|
+
} else if (T = O == null ? void 0 : O(m))
|
|
3207
|
+
N = (0, t._)`${N}${T}${this.opts._n}`;
|
|
3198
3208
|
else
|
|
3199
3209
|
throw new r(m);
|
|
3200
3210
|
g.set(m, n.Completed);
|
|
@@ -3368,17 +3378,17 @@ var scope = {};
|
|
|
3368
3378
|
return this.nodes.reduce((a, h) => K(a, h.names), {});
|
|
3369
3379
|
}
|
|
3370
3380
|
}
|
|
3371
|
-
class
|
|
3381
|
+
class R extends N {
|
|
3372
3382
|
render(a) {
|
|
3373
3383
|
return "{" + a._n + super.render(a) + "}" + a._n;
|
|
3374
3384
|
}
|
|
3375
3385
|
}
|
|
3376
3386
|
class v extends N {
|
|
3377
3387
|
}
|
|
3378
|
-
class g extends
|
|
3388
|
+
class g extends R {
|
|
3379
3389
|
}
|
|
3380
3390
|
g.kind = "else";
|
|
3381
|
-
class m extends
|
|
3391
|
+
class m extends R {
|
|
3382
3392
|
constructor(a, h) {
|
|
3383
3393
|
super(h), this.condition = a;
|
|
3384
3394
|
}
|
|
@@ -3412,10 +3422,10 @@ var scope = {};
|
|
|
3412
3422
|
}
|
|
3413
3423
|
}
|
|
3414
3424
|
m.kind = "if";
|
|
3415
|
-
class
|
|
3425
|
+
class T extends R {
|
|
3416
3426
|
}
|
|
3417
|
-
|
|
3418
|
-
class S extends
|
|
3427
|
+
T.kind = "for";
|
|
3428
|
+
class S extends T {
|
|
3419
3429
|
constructor(a) {
|
|
3420
3430
|
super(), this.iteration = a;
|
|
3421
3431
|
}
|
|
@@ -3430,7 +3440,7 @@ var scope = {};
|
|
|
3430
3440
|
return K(super.names, this.iteration.names);
|
|
3431
3441
|
}
|
|
3432
3442
|
}
|
|
3433
|
-
class I extends
|
|
3443
|
+
class I extends T {
|
|
3434
3444
|
constructor(a, h, C, M) {
|
|
3435
3445
|
super(), this.varKind = a, this.name = h, this.from = C, this.to = M;
|
|
3436
3446
|
}
|
|
@@ -3443,7 +3453,7 @@ var scope = {};
|
|
|
3443
3453
|
return ue(a, this.to);
|
|
3444
3454
|
}
|
|
3445
3455
|
}
|
|
3446
|
-
class
|
|
3456
|
+
class A extends T {
|
|
3447
3457
|
constructor(a, h, C, M) {
|
|
3448
3458
|
super(), this.loop = a, this.varKind = h, this.name = C, this.iterable = M;
|
|
3449
3459
|
}
|
|
@@ -3458,7 +3468,7 @@ var scope = {};
|
|
|
3458
3468
|
return K(super.names, this.iterable.names);
|
|
3459
3469
|
}
|
|
3460
3470
|
}
|
|
3461
|
-
class w extends
|
|
3471
|
+
class w extends R {
|
|
3462
3472
|
constructor(a, h, C) {
|
|
3463
3473
|
super(), this.name = a, this.args = h, this.async = C;
|
|
3464
3474
|
}
|
|
@@ -3473,7 +3483,7 @@ var scope = {};
|
|
|
3473
3483
|
}
|
|
3474
3484
|
}
|
|
3475
3485
|
k.kind = "return";
|
|
3476
|
-
class
|
|
3486
|
+
class D extends R {
|
|
3477
3487
|
render(a) {
|
|
3478
3488
|
let h = "try" + super.render(a);
|
|
3479
3489
|
return this.catch && (h += this.catch.render(a)), this.finally && (h += this.finally.render(a)), h;
|
|
@@ -3491,7 +3501,7 @@ var scope = {};
|
|
|
3491
3501
|
return this.catch && K(a, this.catch.names), this.finally && K(a, this.finally.names), a;
|
|
3492
3502
|
}
|
|
3493
3503
|
}
|
|
3494
|
-
class V extends
|
|
3504
|
+
class V extends R {
|
|
3495
3505
|
constructor(a) {
|
|
3496
3506
|
super(), this.error = a;
|
|
3497
3507
|
}
|
|
@@ -3500,7 +3510,7 @@ var scope = {};
|
|
|
3500
3510
|
}
|
|
3501
3511
|
}
|
|
3502
3512
|
V.kind = "catch";
|
|
3503
|
-
class x extends
|
|
3513
|
+
class x extends R {
|
|
3504
3514
|
render(a) {
|
|
3505
3515
|
return "finally" + super.render(a);
|
|
3506
3516
|
}
|
|
@@ -3616,7 +3626,7 @@ var scope = {};
|
|
|
3616
3626
|
this.var(q, (0, t._)`${W}[${G}]`), C(q);
|
|
3617
3627
|
});
|
|
3618
3628
|
}
|
|
3619
|
-
return this._for(new
|
|
3629
|
+
return this._for(new A("of", M, q, h), () => C(q));
|
|
3620
3630
|
}
|
|
3621
3631
|
// `for-in` statement.
|
|
3622
3632
|
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
@@ -3624,11 +3634,11 @@ var scope = {};
|
|
|
3624
3634
|
if (this.opts.ownProperties)
|
|
3625
3635
|
return this.forOf(a, (0, t._)`Object.keys(${h})`, C);
|
|
3626
3636
|
const q = this._scope.toName(a);
|
|
3627
|
-
return this._for(new
|
|
3637
|
+
return this._for(new A("in", M, q, h), () => C(q));
|
|
3628
3638
|
}
|
|
3629
3639
|
// end `for` loop
|
|
3630
3640
|
endFor() {
|
|
3631
|
-
return this._endBlockNode(
|
|
3641
|
+
return this._endBlockNode(T);
|
|
3632
3642
|
}
|
|
3633
3643
|
// `label` statement
|
|
3634
3644
|
label(a) {
|
|
@@ -3649,7 +3659,7 @@ var scope = {};
|
|
|
3649
3659
|
try(a, h, C) {
|
|
3650
3660
|
if (!h && !C)
|
|
3651
3661
|
throw new Error('CodeGen: "try" without "catch" and "finally"');
|
|
3652
|
-
const M = new
|
|
3662
|
+
const M = new D();
|
|
3653
3663
|
if (this._blockNode(M), this.code(a), h) {
|
|
3654
3664
|
const q = this.name("e");
|
|
3655
3665
|
this._currNode = M.catch = new V(q), h(q);
|
|
@@ -3770,8 +3780,8 @@ var util = {};
|
|
|
3770
3780
|
const t = codegen, r = code$1;
|
|
3771
3781
|
function n(w) {
|
|
3772
3782
|
const k = {};
|
|
3773
|
-
for (const
|
|
3774
|
-
k[
|
|
3783
|
+
for (const D of w)
|
|
3784
|
+
k[D] = !0;
|
|
3775
3785
|
return k;
|
|
3776
3786
|
}
|
|
3777
3787
|
e.toHash = n;
|
|
@@ -3780,19 +3790,19 @@ var util = {};
|
|
|
3780
3790
|
}
|
|
3781
3791
|
e.alwaysValidSchema = s;
|
|
3782
3792
|
function i(w, k = w.schema) {
|
|
3783
|
-
const { opts:
|
|
3784
|
-
if (!
|
|
3793
|
+
const { opts: D, self: V } = w;
|
|
3794
|
+
if (!D.strictSchema || typeof k == "boolean")
|
|
3785
3795
|
return;
|
|
3786
3796
|
const x = V.RULES.keywords;
|
|
3787
3797
|
for (const re in k)
|
|
3788
|
-
x[re] ||
|
|
3798
|
+
x[re] || A(w, `unknown keyword: "${re}"`);
|
|
3789
3799
|
}
|
|
3790
3800
|
e.checkUnknownRules = i;
|
|
3791
3801
|
function o(w, k) {
|
|
3792
3802
|
if (typeof w == "boolean")
|
|
3793
3803
|
return !w;
|
|
3794
|
-
for (const
|
|
3795
|
-
if (k[
|
|
3804
|
+
for (const D in w)
|
|
3805
|
+
if (k[D])
|
|
3796
3806
|
return !0;
|
|
3797
3807
|
return !1;
|
|
3798
3808
|
}
|
|
@@ -3800,18 +3810,18 @@ var util = {};
|
|
|
3800
3810
|
function l(w, k) {
|
|
3801
3811
|
if (typeof w == "boolean")
|
|
3802
3812
|
return !w;
|
|
3803
|
-
for (const
|
|
3804
|
-
if (
|
|
3813
|
+
for (const D in w)
|
|
3814
|
+
if (D !== "$ref" && k.all[D])
|
|
3805
3815
|
return !0;
|
|
3806
3816
|
return !1;
|
|
3807
3817
|
}
|
|
3808
3818
|
e.schemaHasRulesButRef = l;
|
|
3809
|
-
function d({ topSchemaRef: w, schemaPath: k },
|
|
3819
|
+
function d({ topSchemaRef: w, schemaPath: k }, D, V, x) {
|
|
3810
3820
|
if (!x) {
|
|
3811
|
-
if (typeof
|
|
3812
|
-
return
|
|
3813
|
-
if (typeof
|
|
3814
|
-
return (0, t._)`${
|
|
3821
|
+
if (typeof D == "number" || typeof D == "boolean")
|
|
3822
|
+
return D;
|
|
3823
|
+
if (typeof D == "string")
|
|
3824
|
+
return (0, t._)`${D}`;
|
|
3815
3825
|
}
|
|
3816
3826
|
return (0, t._)`${w}${k}${(0, t.getProperty)(V)}`;
|
|
3817
3827
|
}
|
|
@@ -3834,32 +3844,32 @@ var util = {};
|
|
|
3834
3844
|
e.unescapeJsonPointer = O;
|
|
3835
3845
|
function N(w, k) {
|
|
3836
3846
|
if (Array.isArray(w))
|
|
3837
|
-
for (const
|
|
3838
|
-
k(
|
|
3847
|
+
for (const D of w)
|
|
3848
|
+
k(D);
|
|
3839
3849
|
else
|
|
3840
3850
|
k(w);
|
|
3841
3851
|
}
|
|
3842
3852
|
e.eachItem = N;
|
|
3843
|
-
function
|
|
3853
|
+
function R({ mergeNames: w, mergeToName: k, mergeValues: D, resultToName: V }) {
|
|
3844
3854
|
return (x, re, K, ue) => {
|
|
3845
|
-
const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(x, re, K) : k(x, re, K), K) : re instanceof t.Name ? (k(x, K, re), re) :
|
|
3855
|
+
const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(x, re, K) : k(x, re, K), K) : re instanceof t.Name ? (k(x, K, re), re) : D(re, K);
|
|
3846
3856
|
return ue === t.Name && !(oe instanceof t.Name) ? V(x, oe) : oe;
|
|
3847
3857
|
};
|
|
3848
3858
|
}
|
|
3849
3859
|
e.mergeEvaluated = {
|
|
3850
|
-
props:
|
|
3851
|
-
mergeNames: (w, k,
|
|
3852
|
-
w.if((0, t._)`${k} === true`, () => w.assign(
|
|
3860
|
+
props: R({
|
|
3861
|
+
mergeNames: (w, k, D) => w.if((0, t._)`${D} !== true && ${k} !== undefined`, () => {
|
|
3862
|
+
w.if((0, t._)`${k} === true`, () => w.assign(D, !0), () => w.assign(D, (0, t._)`${D} || {}`).code((0, t._)`Object.assign(${D}, ${k})`));
|
|
3853
3863
|
}),
|
|
3854
|
-
mergeToName: (w, k,
|
|
3855
|
-
k === !0 ? w.assign(
|
|
3864
|
+
mergeToName: (w, k, D) => w.if((0, t._)`${D} !== true`, () => {
|
|
3865
|
+
k === !0 ? w.assign(D, !0) : (w.assign(D, (0, t._)`${D} || {}`), g(w, D, k));
|
|
3856
3866
|
}),
|
|
3857
3867
|
mergeValues: (w, k) => w === !0 ? !0 : { ...w, ...k },
|
|
3858
3868
|
resultToName: v
|
|
3859
3869
|
}),
|
|
3860
|
-
items:
|
|
3861
|
-
mergeNames: (w, k,
|
|
3862
|
-
mergeToName: (w, k,
|
|
3870
|
+
items: R({
|
|
3871
|
+
mergeNames: (w, k, D) => w.if((0, t._)`${D} !== true && ${k} !== undefined`, () => w.assign(D, (0, t._)`${k} === true ? true : ${D} > ${k} ? ${D} : ${k}`)),
|
|
3872
|
+
mergeToName: (w, k, D) => w.if((0, t._)`${D} !== true`, () => w.assign(D, k === !0 ? !0 : (0, t._)`${D} > ${k} ? ${D} : ${k}`)),
|
|
3863
3873
|
mergeValues: (w, k) => w === !0 ? !0 : Math.max(w, k),
|
|
3864
3874
|
resultToName: (w, k) => w.var("items", k)
|
|
3865
3875
|
})
|
|
@@ -3867,42 +3877,42 @@ var util = {};
|
|
|
3867
3877
|
function v(w, k) {
|
|
3868
3878
|
if (k === !0)
|
|
3869
3879
|
return w.var("props", !0);
|
|
3870
|
-
const
|
|
3871
|
-
return k !== void 0 && g(w,
|
|
3880
|
+
const D = w.var("props", (0, t._)`{}`);
|
|
3881
|
+
return k !== void 0 && g(w, D, k), D;
|
|
3872
3882
|
}
|
|
3873
3883
|
e.evaluatedPropsToName = v;
|
|
3874
|
-
function g(w, k,
|
|
3875
|
-
Object.keys(
|
|
3884
|
+
function g(w, k, D) {
|
|
3885
|
+
Object.keys(D).forEach((V) => w.assign((0, t._)`${k}${(0, t.getProperty)(V)}`, !0));
|
|
3876
3886
|
}
|
|
3877
3887
|
e.setEvaluated = g;
|
|
3878
3888
|
const m = {};
|
|
3879
|
-
function
|
|
3889
|
+
function T(w, k) {
|
|
3880
3890
|
return w.scopeValue("func", {
|
|
3881
3891
|
ref: k,
|
|
3882
3892
|
code: m[k.code] || (m[k.code] = new r._Code(k.code))
|
|
3883
3893
|
});
|
|
3884
3894
|
}
|
|
3885
|
-
e.useFunc =
|
|
3895
|
+
e.useFunc = T;
|
|
3886
3896
|
var S;
|
|
3887
3897
|
(function(w) {
|
|
3888
3898
|
w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
|
|
3889
3899
|
})(S = e.Type || (e.Type = {}));
|
|
3890
|
-
function I(w, k,
|
|
3900
|
+
function I(w, k, D) {
|
|
3891
3901
|
if (w instanceof t.Name) {
|
|
3892
3902
|
const V = k === S.Num;
|
|
3893
|
-
return
|
|
3903
|
+
return D ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
3894
3904
|
}
|
|
3895
|
-
return
|
|
3905
|
+
return D ? (0, t.getProperty)(w).toString() : "/" + $(w);
|
|
3896
3906
|
}
|
|
3897
3907
|
e.getErrorPath = I;
|
|
3898
|
-
function
|
|
3899
|
-
if (
|
|
3900
|
-
if (k = `strict mode: ${k}`,
|
|
3908
|
+
function A(w, k, D = w.opts.strictSchema) {
|
|
3909
|
+
if (D) {
|
|
3910
|
+
if (k = `strict mode: ${k}`, D === !0)
|
|
3901
3911
|
throw new Error(k);
|
|
3902
3912
|
w.self.logger.warn(k);
|
|
3903
3913
|
}
|
|
3904
3914
|
}
|
|
3905
|
-
e.checkStrictMode =
|
|
3915
|
+
e.checkStrictMode = A;
|
|
3906
3916
|
})(util);
|
|
3907
3917
|
var names$1 = {};
|
|
3908
3918
|
Object.defineProperty(names$1, "__esModule", { value: !0 });
|
|
@@ -3938,36 +3948,36 @@ names$1.default = names;
|
|
|
3938
3948
|
}, e.keyword$DataError = {
|
|
3939
3949
|
message: ({ keyword: g, schemaType: m }) => m ? (0, t.str)`"${g}" keyword must be ${m} ($data)` : (0, t.str)`"${g}" keyword is invalid ($data)`
|
|
3940
3950
|
};
|
|
3941
|
-
function s(g, m = e.keywordError,
|
|
3942
|
-
const { it: I } = g, { gen:
|
|
3943
|
-
S ?? (w || k) ? d(
|
|
3951
|
+
function s(g, m = e.keywordError, T, S) {
|
|
3952
|
+
const { it: I } = g, { gen: A, compositeRule: w, allErrors: k } = I, D = $(g, m, T);
|
|
3953
|
+
S ?? (w || k) ? d(A, D) : u(I, (0, t._)`[${D}]`);
|
|
3944
3954
|
}
|
|
3945
3955
|
e.reportError = s;
|
|
3946
|
-
function i(g, m = e.keywordError,
|
|
3947
|
-
const { it: S } = g, { gen: I, compositeRule:
|
|
3948
|
-
d(I, k),
|
|
3956
|
+
function i(g, m = e.keywordError, T) {
|
|
3957
|
+
const { it: S } = g, { gen: I, compositeRule: A, allErrors: w } = S, k = $(g, m, T);
|
|
3958
|
+
d(I, k), A || w || u(S, n.default.vErrors);
|
|
3949
3959
|
}
|
|
3950
3960
|
e.reportExtraError = i;
|
|
3951
3961
|
function o(g, m) {
|
|
3952
3962
|
g.assign(n.default.errors, m), g.if((0, t._)`${n.default.vErrors} !== null`, () => g.if(m, () => g.assign((0, t._)`${n.default.vErrors}.length`, m), () => g.assign(n.default.vErrors, null)));
|
|
3953
3963
|
}
|
|
3954
3964
|
e.resetErrorsCount = o;
|
|
3955
|
-
function l({ gen: g, keyword: m, schemaValue:
|
|
3965
|
+
function l({ gen: g, keyword: m, schemaValue: T, data: S, errsCount: I, it: A }) {
|
|
3956
3966
|
if (I === void 0)
|
|
3957
3967
|
throw new Error("ajv implementation error");
|
|
3958
3968
|
const w = g.name("err");
|
|
3959
3969
|
g.forRange("i", I, n.default.errors, (k) => {
|
|
3960
|
-
g.const(w, (0, t._)`${n.default.vErrors}[${k}]`), g.if((0, t._)`${w}.instancePath === undefined`, () => g.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath,
|
|
3970
|
+
g.const(w, (0, t._)`${n.default.vErrors}[${k}]`), g.if((0, t._)`${w}.instancePath === undefined`, () => g.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, A.errorPath))), g.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${A.errSchemaPath}/${m}`), A.opts.verbose && (g.assign((0, t._)`${w}.schema`, T), g.assign((0, t._)`${w}.data`, S));
|
|
3961
3971
|
});
|
|
3962
3972
|
}
|
|
3963
3973
|
e.extendErrors = l;
|
|
3964
3974
|
function d(g, m) {
|
|
3965
|
-
const
|
|
3966
|
-
g.if((0, t._)`${n.default.vErrors} === null`, () => g.assign(n.default.vErrors, (0, t._)`[${
|
|
3975
|
+
const T = g.const("err", m);
|
|
3976
|
+
g.if((0, t._)`${n.default.vErrors} === null`, () => g.assign(n.default.vErrors, (0, t._)`[${T}]`), (0, t._)`${n.default.vErrors}.push(${T})`), g.code((0, t._)`${n.default.errors}++`);
|
|
3967
3977
|
}
|
|
3968
3978
|
function u(g, m) {
|
|
3969
|
-
const { gen:
|
|
3970
|
-
I.$async ?
|
|
3979
|
+
const { gen: T, validateName: S, schemaEnv: I } = g;
|
|
3980
|
+
I.$async ? T.throw((0, t._)`new ${g.ValidationError}(${m})`) : (T.assign((0, t._)`${S}.errors`, m), T.return(!1));
|
|
3971
3981
|
}
|
|
3972
3982
|
const p = {
|
|
3973
3983
|
keyword: new t.Name("keyword"),
|
|
@@ -3978,28 +3988,28 @@ names$1.default = names;
|
|
|
3978
3988
|
schema: new t.Name("schema"),
|
|
3979
3989
|
parentSchema: new t.Name("parentSchema")
|
|
3980
3990
|
};
|
|
3981
|
-
function $(g, m,
|
|
3991
|
+
function $(g, m, T) {
|
|
3982
3992
|
const { createErrors: S } = g.it;
|
|
3983
|
-
return S === !1 ? (0, t._)`{}` : O(g, m,
|
|
3993
|
+
return S === !1 ? (0, t._)`{}` : O(g, m, T);
|
|
3984
3994
|
}
|
|
3985
|
-
function O(g, m,
|
|
3986
|
-
const { gen: S, it: I } = g,
|
|
3987
|
-
N(I,
|
|
3988
|
-
|
|
3995
|
+
function O(g, m, T = {}) {
|
|
3996
|
+
const { gen: S, it: I } = g, A = [
|
|
3997
|
+
N(I, T),
|
|
3998
|
+
R(g, T)
|
|
3989
3999
|
];
|
|
3990
|
-
return v(g, m,
|
|
4000
|
+
return v(g, m, A), S.object(...A);
|
|
3991
4001
|
}
|
|
3992
4002
|
function N({ errorPath: g }, { instancePath: m }) {
|
|
3993
|
-
const
|
|
3994
|
-
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath,
|
|
4003
|
+
const T = m ? (0, t.str)`${g}${(0, r.getErrorPath)(m, r.Type.Str)}` : g;
|
|
4004
|
+
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, T)];
|
|
3995
4005
|
}
|
|
3996
|
-
function
|
|
4006
|
+
function R({ keyword: g, it: { errSchemaPath: m } }, { schemaPath: T, parentSchema: S }) {
|
|
3997
4007
|
let I = S ? m : (0, t.str)`${m}/${g}`;
|
|
3998
|
-
return
|
|
4008
|
+
return T && (I = (0, t.str)`${I}${(0, r.getErrorPath)(T, r.Type.Str)}`), [p.schemaPath, I];
|
|
3999
4009
|
}
|
|
4000
|
-
function v(g, { params: m, message:
|
|
4001
|
-
const { keyword: I, data:
|
|
4002
|
-
S.push([p.keyword, I], [p.params, typeof m == "function" ? m(g) : m || (0, t._)`{}`]),
|
|
4010
|
+
function v(g, { params: m, message: T }, S) {
|
|
4011
|
+
const { keyword: I, data: A, schemaValue: w, it: k } = g, { opts: D, propertyName: V, topSchemaRef: x, schemaPath: re } = k;
|
|
4012
|
+
S.push([p.keyword, I], [p.params, typeof m == "function" ? m(g) : m || (0, t._)`{}`]), D.messages && S.push([p.message, typeof T == "function" ? T(g) : T]), D.verbose && S.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${re}`], [n.default.data, A]), V && S.push([p.propertyName, V]);
|
|
4003
4013
|
}
|
|
4004
4014
|
})(errors);
|
|
4005
4015
|
Object.defineProperty(boolSchema, "__esModule", { value: !0 });
|
|
@@ -4099,11 +4109,11 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4099
4109
|
}
|
|
4100
4110
|
e.getJSONTypes = d;
|
|
4101
4111
|
function u(S, I) {
|
|
4102
|
-
const { gen:
|
|
4112
|
+
const { gen: A, data: w, opts: k } = S, D = $(I, k.coerceTypes), V = I.length > 0 && !(D.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(S, I[0]));
|
|
4103
4113
|
if (V) {
|
|
4104
4114
|
const x = v(I, w, k.strictNumbers, o.Wrong);
|
|
4105
|
-
|
|
4106
|
-
|
|
4115
|
+
A.if(x, () => {
|
|
4116
|
+
D.length ? O(S, I, D) : m(S);
|
|
4107
4117
|
});
|
|
4108
4118
|
}
|
|
4109
4119
|
return V;
|
|
@@ -4111,13 +4121,13 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4111
4121
|
e.coerceAndCheckDataType = u;
|
|
4112
4122
|
const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
4113
4123
|
function $(S, I) {
|
|
4114
|
-
return I ? S.filter((
|
|
4124
|
+
return I ? S.filter((A) => p.has(A) || I === "array" && A === "array") : [];
|
|
4115
4125
|
}
|
|
4116
|
-
function O(S, I,
|
|
4117
|
-
const { gen: w, data: k, opts:
|
|
4118
|
-
|
|
4119
|
-
for (const K of
|
|
4120
|
-
(p.has(K) || K === "array" &&
|
|
4126
|
+
function O(S, I, A) {
|
|
4127
|
+
const { gen: w, data: k, opts: D } = S, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
|
|
4128
|
+
D.coerceTypes === "array" && w.if((0, s._)`${V} == 'object' && Array.isArray(${k}) && ${k}.length == 1`, () => w.assign(k, (0, s._)`${k}[0]`).assign(V, (0, s._)`typeof ${k}`).if(v(I, k, D.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
|
|
4129
|
+
for (const K of A)
|
|
4130
|
+
(p.has(K) || K === "array" && D.coerceTypes === "array") && re(K);
|
|
4121
4131
|
w.else(), m(S), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
|
|
4122
4132
|
w.assign(k, x), N(S, x);
|
|
4123
4133
|
});
|
|
@@ -4146,49 +4156,49 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4146
4156
|
}
|
|
4147
4157
|
}
|
|
4148
4158
|
}
|
|
4149
|
-
function N({ gen: S, parentData: I, parentDataProperty:
|
|
4150
|
-
S.if((0, s._)`${I} !== undefined`, () => S.assign((0, s._)`${I}[${
|
|
4159
|
+
function N({ gen: S, parentData: I, parentDataProperty: A }, w) {
|
|
4160
|
+
S.if((0, s._)`${I} !== undefined`, () => S.assign((0, s._)`${I}[${A}]`, w));
|
|
4151
4161
|
}
|
|
4152
|
-
function
|
|
4162
|
+
function R(S, I, A, w = o.Correct) {
|
|
4153
4163
|
const k = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
|
|
4154
|
-
let
|
|
4164
|
+
let D;
|
|
4155
4165
|
switch (S) {
|
|
4156
4166
|
case "null":
|
|
4157
4167
|
return (0, s._)`${I} ${k} null`;
|
|
4158
4168
|
case "array":
|
|
4159
|
-
|
|
4169
|
+
D = (0, s._)`Array.isArray(${I})`;
|
|
4160
4170
|
break;
|
|
4161
4171
|
case "object":
|
|
4162
|
-
|
|
4172
|
+
D = (0, s._)`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;
|
|
4163
4173
|
break;
|
|
4164
4174
|
case "integer":
|
|
4165
|
-
|
|
4175
|
+
D = V((0, s._)`!(${I} % 1) && !isNaN(${I})`);
|
|
4166
4176
|
break;
|
|
4167
4177
|
case "number":
|
|
4168
|
-
|
|
4178
|
+
D = V();
|
|
4169
4179
|
break;
|
|
4170
4180
|
default:
|
|
4171
4181
|
return (0, s._)`typeof ${I} ${k} ${S}`;
|
|
4172
4182
|
}
|
|
4173
|
-
return w === o.Correct ?
|
|
4183
|
+
return w === o.Correct ? D : (0, s.not)(D);
|
|
4174
4184
|
function V(x = s.nil) {
|
|
4175
|
-
return (0, s.and)((0, s._)`typeof ${I} == "number"`, x,
|
|
4185
|
+
return (0, s.and)((0, s._)`typeof ${I} == "number"`, x, A ? (0, s._)`isFinite(${I})` : s.nil);
|
|
4176
4186
|
}
|
|
4177
4187
|
}
|
|
4178
|
-
e.checkDataType =
|
|
4179
|
-
function v(S, I,
|
|
4188
|
+
e.checkDataType = R;
|
|
4189
|
+
function v(S, I, A, w) {
|
|
4180
4190
|
if (S.length === 1)
|
|
4181
|
-
return
|
|
4191
|
+
return R(S[0], I, A, w);
|
|
4182
4192
|
let k;
|
|
4183
|
-
const
|
|
4184
|
-
if (
|
|
4193
|
+
const D = (0, i.toHash)(S);
|
|
4194
|
+
if (D.array && D.object) {
|
|
4185
4195
|
const V = (0, s._)`typeof ${I} != "object"`;
|
|
4186
|
-
k =
|
|
4196
|
+
k = D.null ? V : (0, s._)`!${I} || ${V}`, delete D.null, delete D.array, delete D.object;
|
|
4187
4197
|
} else
|
|
4188
4198
|
k = s.nil;
|
|
4189
|
-
|
|
4190
|
-
for (const V in
|
|
4191
|
-
k = (0, s.and)(k,
|
|
4199
|
+
D.number && delete D.integer;
|
|
4200
|
+
for (const V in D)
|
|
4201
|
+
k = (0, s.and)(k, R(V, I, A, w));
|
|
4192
4202
|
return k;
|
|
4193
4203
|
}
|
|
4194
4204
|
e.checkDataTypes = v;
|
|
@@ -4197,16 +4207,16 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4197
4207
|
params: ({ schema: S, schemaValue: I }) => typeof S == "string" ? (0, s._)`{type: ${S}}` : (0, s._)`{type: ${I}}`
|
|
4198
4208
|
};
|
|
4199
4209
|
function m(S) {
|
|
4200
|
-
const I =
|
|
4210
|
+
const I = T(S);
|
|
4201
4211
|
(0, n.reportError)(I, g);
|
|
4202
4212
|
}
|
|
4203
4213
|
e.reportTypeError = m;
|
|
4204
|
-
function
|
|
4205
|
-
const { gen: I, data:
|
|
4214
|
+
function T(S) {
|
|
4215
|
+
const { gen: I, data: A, schema: w } = S, k = (0, i.schemaRefOrVal)(S, w, "type");
|
|
4206
4216
|
return {
|
|
4207
4217
|
gen: I,
|
|
4208
4218
|
keyword: "type",
|
|
4209
|
-
data:
|
|
4219
|
+
data: A,
|
|
4210
4220
|
schema: w.type,
|
|
4211
4221
|
schemaCode: k,
|
|
4212
4222
|
schemaValue: k,
|
|
@@ -4374,25 +4384,25 @@ function funcKeywordCode(e, t) {
|
|
|
4374
4384
|
if (t.errors === !1)
|
|
4375
4385
|
v(), t.modifying && modifyData(e), g(() => e.error());
|
|
4376
4386
|
else {
|
|
4377
|
-
const m = t.async ? N() :
|
|
4387
|
+
const m = t.async ? N() : R();
|
|
4378
4388
|
t.modifying && modifyData(e), g(() => addErrs(e, m));
|
|
4379
4389
|
}
|
|
4380
4390
|
}
|
|
4381
4391
|
function N() {
|
|
4382
4392
|
const m = n.let("ruleErrs", null);
|
|
4383
|
-
return n.try(() => v((0, codegen_1$p._)`await `), (
|
|
4393
|
+
return n.try(() => v((0, codegen_1$p._)`await `), (T) => n.assign($, !1).if((0, codegen_1$p._)`${T} instanceof ${d.ValidationError}`, () => n.assign(m, (0, codegen_1$p._)`${T}.errors`), () => n.throw(T))), m;
|
|
4384
4394
|
}
|
|
4385
|
-
function
|
|
4395
|
+
function R() {
|
|
4386
4396
|
const m = (0, codegen_1$p._)`${p}.errors`;
|
|
4387
4397
|
return n.assign(m, null), v(codegen_1$p.nil), m;
|
|
4388
4398
|
}
|
|
4389
4399
|
function v(m = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
|
|
4390
|
-
const
|
|
4391
|
-
n.assign($, (0, codegen_1$p._)`${m}${(0, code_1$9.callValidateCode)(e, p,
|
|
4400
|
+
const T = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, S = !("compile" in t && !l || t.schema === !1);
|
|
4401
|
+
n.assign($, (0, codegen_1$p._)`${m}${(0, code_1$9.callValidateCode)(e, p, T, S)}`, t.modifying);
|
|
4392
4402
|
}
|
|
4393
4403
|
function g(m) {
|
|
4394
|
-
var
|
|
4395
|
-
n.if((0, codegen_1$p.not)((
|
|
4404
|
+
var T;
|
|
4405
|
+
n.if((0, codegen_1$p.not)((T = t.valid) !== null && T !== void 0 ? T : $), m);
|
|
4396
4406
|
}
|
|
4397
4407
|
}
|
|
4398
4408
|
keyword.funcKeywordCode = funcKeywordCode;
|
|
@@ -4671,21 +4681,21 @@ function getSchemaRefs(e, t) {
|
|
|
4671
4681
|
if (typeof e == "boolean")
|
|
4672
4682
|
return {};
|
|
4673
4683
|
const { schemaId: r, uriResolver: n } = this.opts, s = normalizeId(e[r] || t), i = { "": s }, o = getFullPath(n, s, !1), l = {}, d = /* @__PURE__ */ new Set();
|
|
4674
|
-
return traverse(e, { allKeys: !0 }, ($, O, N,
|
|
4675
|
-
if (
|
|
4684
|
+
return traverse(e, { allKeys: !0 }, ($, O, N, R) => {
|
|
4685
|
+
if (R === void 0)
|
|
4676
4686
|
return;
|
|
4677
4687
|
const v = o + O;
|
|
4678
|
-
let g = i[
|
|
4679
|
-
typeof $[r] == "string" && (g = m.call(this, $[r])),
|
|
4688
|
+
let g = i[R];
|
|
4689
|
+
typeof $[r] == "string" && (g = m.call(this, $[r])), T.call(this, $.$anchor), T.call(this, $.$dynamicAnchor), i[O] = g;
|
|
4680
4690
|
function m(S) {
|
|
4681
4691
|
const I = this.opts.uriResolver.resolve;
|
|
4682
4692
|
if (S = normalizeId(g ? I(g, S) : S), d.has(S))
|
|
4683
4693
|
throw p(S);
|
|
4684
4694
|
d.add(S);
|
|
4685
|
-
let
|
|
4686
|
-
return typeof
|
|
4695
|
+
let A = this.refs[S];
|
|
4696
|
+
return typeof A == "string" && (A = this.refs[A]), typeof A == "object" ? u($, A.schema, S) : S !== normalizeId(v) && (S[0] === "#" ? (u($, l[S], S), l[S] = $) : this.refs[S] = v), S;
|
|
4687
4697
|
}
|
|
4688
|
-
function
|
|
4698
|
+
function T(S) {
|
|
4689
4699
|
if (typeof S == "string") {
|
|
4690
4700
|
if (!ANCHOR.test(S))
|
|
4691
4701
|
throw new Error(`invalid anchor "${S}"`);
|
|
@@ -5085,11 +5095,11 @@ function compileSchema(e) {
|
|
|
5085
5095
|
p = `${o.scopeRefs(names_1$2.default.scope)}return ${$}`, this.opts.code.process && (p = this.opts.code.process(p, e));
|
|
5086
5096
|
const N = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
|
|
5087
5097
|
if (this.scope.value(d, { ref: N }), N.errors = null, N.schema = e.schema, N.schemaEnv = e, e.$async && (N.$async = !0), this.opts.code.source === !0 && (N.source = { validateName: d, validateCode: $, scopeValues: o._values }), this.opts.unevaluated) {
|
|
5088
|
-
const { props:
|
|
5098
|
+
const { props: R, items: v } = u;
|
|
5089
5099
|
N.evaluated = {
|
|
5090
|
-
props:
|
|
5100
|
+
props: R instanceof codegen_1$m.Name ? void 0 : R,
|
|
5091
5101
|
items: v instanceof codegen_1$m.Name ? void 0 : v,
|
|
5092
|
-
dynamicProps:
|
|
5102
|
+
dynamicProps: R instanceof codegen_1$m.Name,
|
|
5093
5103
|
dynamicItems: v instanceof codegen_1$m.Name
|
|
5094
5104
|
}, N.source && (N.source.evaluated = (0, codegen_1$m.stringify)(N.evaluated));
|
|
5095
5105
|
}
|
|
@@ -5296,7 +5306,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5296
5306
|
return _;
|
|
5297
5307
|
} else
|
|
5298
5308
|
return Array.from(f);
|
|
5299
|
-
},
|
|
5309
|
+
}, R = 2147483647, v = 36, g = 1, m = 26, T = 38, S = 700, I = 72, A = 128, w = "-", k = /^xn--/, D = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
|
|
5300
5310
|
overflow: "Overflow: input needs wider integers to process",
|
|
5301
5311
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5302
5312
|
"invalid-input": "Invalid input"
|
|
@@ -5341,9 +5351,9 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5341
5351
|
b += v
|
|
5342
5352
|
)
|
|
5343
5353
|
c = K(c / re);
|
|
5344
|
-
return K(b + (re + 1) * c / (c +
|
|
5354
|
+
return K(b + (re + 1) * c / (c + T));
|
|
5345
5355
|
}, j = function(c) {
|
|
5346
|
-
var _ = [], E = c.length, b = 0, U =
|
|
5356
|
+
var _ = [], E = c.length, b = 0, U = A, L = I, J = c.lastIndexOf(w);
|
|
5347
5357
|
J < 0 && (J = 0);
|
|
5348
5358
|
for (var Y = 0; Y < J; ++Y)
|
|
5349
5359
|
c.charCodeAt(Y) >= 128 && oe("not-basic"), _.push(c.charCodeAt(Y));
|
|
@@ -5356,21 +5366,21 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5356
5366
|
) {
|
|
5357
5367
|
se >= E && oe("invalid-input");
|
|
5358
5368
|
var z = Ue(c.charCodeAt(se++));
|
|
5359
|
-
(z >= v || z > K((
|
|
5369
|
+
(z >= v || z > K((R - b) / Z)) && oe("overflow"), b += z * Z;
|
|
5360
5370
|
var X = ie <= L ? g : ie >= L + m ? m : ie - L;
|
|
5361
5371
|
if (z < X)
|
|
5362
5372
|
break;
|
|
5363
5373
|
var ae = v - X;
|
|
5364
|
-
Z > K(
|
|
5374
|
+
Z > K(R / ae) && oe("overflow"), Z *= ae;
|
|
5365
5375
|
}
|
|
5366
5376
|
var ee = _.length + 1;
|
|
5367
|
-
L = y(b - B, ee, B == 0), K(b / ee) >
|
|
5377
|
+
L = y(b - B, ee, B == 0), K(b / ee) > R - U && oe("overflow"), U += K(b / ee), b %= ee, _.splice(b++, 0, U);
|
|
5368
5378
|
}
|
|
5369
5379
|
return String.fromCodePoint.apply(String, _);
|
|
5370
5380
|
}, P = function(c) {
|
|
5371
5381
|
var _ = [];
|
|
5372
5382
|
c = qe(c);
|
|
5373
|
-
var E = c.length, b =
|
|
5383
|
+
var E = c.length, b = A, U = 0, L = I, J = !0, Y = !1, se = void 0;
|
|
5374
5384
|
try {
|
|
5375
5385
|
for (var B = c[Symbol.iterator](), Z; !(J = (Z = B.next()).done); J = !0) {
|
|
5376
5386
|
var ie = Z.value;
|
|
@@ -5388,7 +5398,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5388
5398
|
}
|
|
5389
5399
|
var z = _.length, X = z;
|
|
5390
5400
|
for (z && _.push(w); X < E; ) {
|
|
5391
|
-
var ae =
|
|
5401
|
+
var ae = R, ee = !0, Se = !1, $e = void 0;
|
|
5392
5402
|
try {
|
|
5393
5403
|
for (var ge = c[Symbol.iterator](), Be; !(ee = (Be = ge.next()).done); ee = !0) {
|
|
5394
5404
|
var Ie = Be.value;
|
|
@@ -5405,12 +5415,12 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5405
5415
|
}
|
|
5406
5416
|
}
|
|
5407
5417
|
var fe = X + 1;
|
|
5408
|
-
ae - b > K((
|
|
5418
|
+
ae - b > K((R - U) / fe) && oe("overflow"), U += (ae - b) * fe, b = ae;
|
|
5409
5419
|
var ye = !0, je = !1, we = void 0;
|
|
5410
5420
|
try {
|
|
5411
5421
|
for (var ct = c[Symbol.iterator](), Lt; !(ye = (Lt = ct.next()).done); ye = !0) {
|
|
5412
5422
|
var Ht = Lt.value;
|
|
5413
|
-
if (Ht < b && ++U >
|
|
5423
|
+
if (Ht < b && ++U > R && oe("overflow"), Ht == b) {
|
|
5414
5424
|
for (
|
|
5415
5425
|
var pt = U, ft = v;
|
|
5416
5426
|
;
|
|
@@ -5445,7 +5455,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5445
5455
|
});
|
|
5446
5456
|
}, h = function(c) {
|
|
5447
5457
|
return Oe(c, function(_) {
|
|
5448
|
-
return
|
|
5458
|
+
return D.test(_) ? "xn--" + P(_) : _;
|
|
5449
5459
|
});
|
|
5450
5460
|
}, C = {
|
|
5451
5461
|
/**
|
|
@@ -5657,12 +5667,12 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5657
5667
|
}
|
|
5658
5668
|
return c.fragment = void 0, c;
|
|
5659
5669
|
}
|
|
5660
|
-
},
|
|
5670
|
+
}, Dt = {
|
|
5661
5671
|
scheme: "wss",
|
|
5662
5672
|
domainHost: at.domainHost,
|
|
5663
5673
|
parse: at.parse,
|
|
5664
5674
|
serialize: at.serialize
|
|
5665
|
-
}, ir = {},
|
|
5675
|
+
}, ir = {}, At = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", or = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), ar = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", cr = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", lr = n(cr, '[\\"\\\\]'), dr = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", ur = new RegExp(At, "g"), We = new RegExp(or, "g"), pr = new RegExp(n("[^]", ar, "[\\.]", '[\\"]', lr), "g"), Ft = new RegExp(n("[^]", At, dr), "g"), fr = Ft;
|
|
5666
5676
|
function Ct(f) {
|
|
5667
5677
|
var c = W(f);
|
|
5668
5678
|
return c.match(ur) ? c : f;
|
|
@@ -5756,7 +5766,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5756
5766
|
return E.nss = (c.uuid || "").toLowerCase(), E;
|
|
5757
5767
|
}
|
|
5758
5768
|
};
|
|
5759
|
-
M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[
|
|
5769
|
+
M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[Dt.scheme] = Dt, M[Mt.scheme] = Mt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = xe, r.resolve = it, r.normalize = Ce, r.equal = ot, r.escapeComponent = ut, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
|
|
5760
5770
|
});
|
|
5761
5771
|
})(uri_all, uri_all.exports);
|
|
5762
5772
|
var uri_allExports = uri_all.exports;
|
|
@@ -5786,7 +5796,7 @@ uri$1.default = uri;
|
|
|
5786
5796
|
} });
|
|
5787
5797
|
const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, p = util, $ = require$$9, O = uri$1, N = (F, y) => new RegExp(F, y);
|
|
5788
5798
|
N.code = "new RegExp";
|
|
5789
|
-
const
|
|
5799
|
+
const R = ["removeAdditional", "useDefaults", "coerceTypes"], v = /* @__PURE__ */ new Set([
|
|
5790
5800
|
"validate",
|
|
5791
5801
|
"serialize",
|
|
5792
5802
|
"parse",
|
|
@@ -5820,7 +5830,7 @@ uri$1.default = uri;
|
|
|
5820
5830
|
ignoreKeywordsWithRef: "",
|
|
5821
5831
|
jsPropertySyntax: "",
|
|
5822
5832
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
5823
|
-
},
|
|
5833
|
+
}, T = 200;
|
|
5824
5834
|
function S(F) {
|
|
5825
5835
|
var y, j, P, a, h, C, M, q, W, G, ne, he, Le, tt, rt, de, nt, He, Ve, ze, st, me, le, xe, it;
|
|
5826
5836
|
const Ce = F.strict, ot = (y = F.code) === null || y === void 0 ? void 0 : y.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (P = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && P !== void 0 ? P : N, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
|
|
@@ -5831,8 +5841,8 @@ uri$1.default = uri;
|
|
|
5831
5841
|
strictTuples: (he = (ne = F.strictTuples) !== null && ne !== void 0 ? ne : Ce) !== null && he !== void 0 ? he : "log",
|
|
5832
5842
|
strictRequired: (tt = (Le = F.strictRequired) !== null && Le !== void 0 ? Le : Ce) !== null && tt !== void 0 ? tt : !1,
|
|
5833
5843
|
code: F.code ? { ...F.code, optimize: ut, regExp: pe } : { optimize: ut, regExp: pe },
|
|
5834
|
-
loopRequired: (rt = F.loopRequired) !== null && rt !== void 0 ? rt :
|
|
5835
|
-
loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de :
|
|
5844
|
+
loopRequired: (rt = F.loopRequired) !== null && rt !== void 0 ? rt : T,
|
|
5845
|
+
loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : T,
|
|
5836
5846
|
meta: (nt = F.meta) !== null && nt !== void 0 ? nt : !0,
|
|
5837
5847
|
messages: (He = F.messages) !== null && He !== void 0 ? He : !0,
|
|
5838
5848
|
inlineRefs: (Ve = F.inlineRefs) !== null && Ve !== void 0 ? Ve : !0,
|
|
@@ -5851,7 +5861,7 @@ uri$1.default = uri;
|
|
|
5851
5861
|
const { es5: j, lines: P } = this.opts.code;
|
|
5852
5862
|
this.scope = new l.ValueScope({ scope: {}, prefixes: v, es5: j, lines: P }), this.logger = K(y.logger);
|
|
5853
5863
|
const a = y.validateFormats;
|
|
5854
|
-
y.validateFormats = !1, this.RULES = (0, i.getRules)(),
|
|
5864
|
+
y.validateFormats = !1, this.RULES = (0, i.getRules)(), A.call(this, g, y, "NOT SUPPORTED"), A.call(this, m, y, "DEPRECATED", "warn"), this._metaOpts = x.call(this), y.formats && D.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), y.keywords && V.call(this, y.keywords), typeof y.meta == "object" && this.addMetaSchema(y.meta), k.call(this), y.validateFormats = a;
|
|
5855
5865
|
}
|
|
5856
5866
|
_addVocabularies() {
|
|
5857
5867
|
this.addKeyword("$async");
|
|
@@ -6105,7 +6115,7 @@ uri$1.default = uri;
|
|
|
6105
6115
|
}
|
|
6106
6116
|
}
|
|
6107
6117
|
e.default = I, I.ValidationError = n.default, I.MissingRefError = s.default;
|
|
6108
|
-
function
|
|
6118
|
+
function A(F, y, j, P = "error") {
|
|
6109
6119
|
for (const a in F) {
|
|
6110
6120
|
const h = a;
|
|
6111
6121
|
h in y && this.logger[P](`${j}: option ${a}. ${F[h]}`);
|
|
@@ -6123,7 +6133,7 @@ uri$1.default = uri;
|
|
|
6123
6133
|
for (const y in F)
|
|
6124
6134
|
this.addSchema(F[y], y);
|
|
6125
6135
|
}
|
|
6126
|
-
function
|
|
6136
|
+
function D() {
|
|
6127
6137
|
for (const F in this.opts.formats) {
|
|
6128
6138
|
const y = this.opts.formats[F];
|
|
6129
6139
|
y && this.addFormat(F, y);
|
|
@@ -6142,7 +6152,7 @@ uri$1.default = uri;
|
|
|
6142
6152
|
}
|
|
6143
6153
|
function x() {
|
|
6144
6154
|
const F = { ...this.opts };
|
|
6145
|
-
for (const y of
|
|
6155
|
+
for (const y of R)
|
|
6146
6156
|
delete F[y];
|
|
6147
6157
|
return F;
|
|
6148
6158
|
}
|
|
@@ -6232,16 +6242,16 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
|
|
|
6232
6242
|
function $() {
|
|
6233
6243
|
if (i === u)
|
|
6234
6244
|
return callRef(e, o, i, i.$async);
|
|
6235
|
-
const
|
|
6236
|
-
return callRef(e, (0, codegen_1$l._)`${
|
|
6245
|
+
const R = t.scopeValue("root", { ref: u });
|
|
6246
|
+
return callRef(e, (0, codegen_1$l._)`${R}.validate`, u, u.$async);
|
|
6237
6247
|
}
|
|
6238
|
-
function O(
|
|
6239
|
-
const v = getValidate(e,
|
|
6240
|
-
callRef(e, v,
|
|
6248
|
+
function O(R) {
|
|
6249
|
+
const v = getValidate(e, R);
|
|
6250
|
+
callRef(e, v, R, R.$async);
|
|
6241
6251
|
}
|
|
6242
|
-
function N(
|
|
6243
|
-
const v = t.scopeValue("schema", l.code.source === !0 ? { ref:
|
|
6244
|
-
schema:
|
|
6252
|
+
function N(R) {
|
|
6253
|
+
const v = t.scopeValue("schema", l.code.source === !0 ? { ref: R, code: (0, codegen_1$l.stringify)(R) } : { ref: R }), g = t.name("valid"), m = e.subschema({
|
|
6254
|
+
schema: R,
|
|
6245
6255
|
dataTypes: [],
|
|
6246
6256
|
schemaPath: codegen_1$l.nil,
|
|
6247
6257
|
topSchemaRef: v,
|
|
@@ -6262,21 +6272,21 @@ function callRef(e, t, r, n) {
|
|
|
6262
6272
|
function p() {
|
|
6263
6273
|
if (!l.$async)
|
|
6264
6274
|
throw new Error("async schema referenced by sync schema");
|
|
6265
|
-
const
|
|
6275
|
+
const R = s.let("valid");
|
|
6266
6276
|
s.try(() => {
|
|
6267
|
-
s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), N(t), o || s.assign(
|
|
6277
|
+
s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), N(t), o || s.assign(R, !0);
|
|
6268
6278
|
}, (v) => {
|
|
6269
|
-
s.if((0, codegen_1$l._)`!(${v} instanceof ${i.ValidationError})`, () => s.throw(v)), O(v), o || s.assign(
|
|
6270
|
-
}), e.ok(
|
|
6279
|
+
s.if((0, codegen_1$l._)`!(${v} instanceof ${i.ValidationError})`, () => s.throw(v)), O(v), o || s.assign(R, !1);
|
|
6280
|
+
}), e.ok(R);
|
|
6271
6281
|
}
|
|
6272
6282
|
function $() {
|
|
6273
6283
|
e.result((0, code_1$8.callValidateCode)(e, t, u), () => N(t), () => O(t));
|
|
6274
6284
|
}
|
|
6275
|
-
function O(
|
|
6276
|
-
const v = (0, codegen_1$l._)`${
|
|
6285
|
+
function O(R) {
|
|
6286
|
+
const v = (0, codegen_1$l._)`${R}.errors`;
|
|
6277
6287
|
s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${v} : ${names_1$1.default.vErrors}.concat(${v})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
|
|
6278
6288
|
}
|
|
6279
|
-
function N(
|
|
6289
|
+
function N(R) {
|
|
6280
6290
|
var v;
|
|
6281
6291
|
if (!i.opts.unevaluated)
|
|
6282
6292
|
return;
|
|
@@ -6285,14 +6295,14 @@ function callRef(e, t, r, n) {
|
|
|
6285
6295
|
if (g && !g.dynamicProps)
|
|
6286
6296
|
g.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, g.props, i.props));
|
|
6287
6297
|
else {
|
|
6288
|
-
const m = s.var("props", (0, codegen_1$l._)`${
|
|
6298
|
+
const m = s.var("props", (0, codegen_1$l._)`${R}.evaluated.props`);
|
|
6289
6299
|
i.props = util_1$j.mergeEvaluated.props(s, m, i.props, codegen_1$l.Name);
|
|
6290
6300
|
}
|
|
6291
6301
|
if (i.items !== !0)
|
|
6292
6302
|
if (g && !g.dynamicItems)
|
|
6293
6303
|
g.items !== void 0 && (i.items = util_1$j.mergeEvaluated.items(s, g.items, i.items));
|
|
6294
6304
|
else {
|
|
6295
|
-
const m = s.var("items", (0, codegen_1$l._)`${
|
|
6305
|
+
const m = s.var("items", (0, codegen_1$l._)`${R}.evaluated.items`);
|
|
6296
6306
|
i.items = util_1$j.mergeEvaluated.items(s, m, i.items, codegen_1$l.Name);
|
|
6297
6307
|
}
|
|
6298
6308
|
}
|
|
@@ -6434,9 +6444,9 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6434
6444
|
return;
|
|
6435
6445
|
const d = r.length >= l.loopRequired;
|
|
6436
6446
|
if (o.allErrors ? u() : p(), l.strictRequired) {
|
|
6437
|
-
const N = e.parentSchema.properties, { definedProperties:
|
|
6447
|
+
const N = e.parentSchema.properties, { definedProperties: R } = e.it;
|
|
6438
6448
|
for (const v of r)
|
|
6439
|
-
if ((N == null ? void 0 : N[v]) === void 0 && !
|
|
6449
|
+
if ((N == null ? void 0 : N[v]) === void 0 && !R.has(v)) {
|
|
6440
6450
|
const g = o.schemaEnv.baseId + o.errSchemaPath, m = `required property "${v}" is not defined at "${g}" (strictRequired)`;
|
|
6441
6451
|
(0, util_1$h.checkStrictMode)(o, m, o.opts.strictRequired);
|
|
6442
6452
|
}
|
|
@@ -6451,8 +6461,8 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6451
6461
|
function p() {
|
|
6452
6462
|
const N = t.let("missing");
|
|
6453
6463
|
if (d || i) {
|
|
6454
|
-
const
|
|
6455
|
-
e.block$data(
|
|
6464
|
+
const R = t.let("valid", !0);
|
|
6465
|
+
e.block$data(R, () => O(N, R)), e.ok(R);
|
|
6456
6466
|
} else
|
|
6457
6467
|
t.if((0, code_1$6.checkMissingProp)(e, r, N)), (0, code_1$6.reportMissingProp)(e, N), t.else();
|
|
6458
6468
|
}
|
|
@@ -6461,9 +6471,9 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6461
6471
|
e.setParams({ missingProperty: N }), t.if((0, code_1$6.noPropertyInData)(t, s, N, l.ownProperties), () => e.error());
|
|
6462
6472
|
});
|
|
6463
6473
|
}
|
|
6464
|
-
function O(N,
|
|
6474
|
+
function O(N, R) {
|
|
6465
6475
|
e.setParams({ missingProperty: N }), t.forOf(N, n, () => {
|
|
6466
|
-
t.assign(
|
|
6476
|
+
t.assign(R, (0, code_1$6.propertyInData)(t, s, N, l.ownProperties)), t.if((0, codegen_1$f.not)(R), () => {
|
|
6467
6477
|
e.error(), t.break();
|
|
6468
6478
|
});
|
|
6469
6479
|
}, codegen_1$f.nil);
|
|
@@ -6513,23 +6523,23 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
|
|
|
6513
6523
|
const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
|
|
6514
6524
|
e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
|
|
6515
6525
|
function p() {
|
|
6516
|
-
const
|
|
6517
|
-
e.setParams({ i:
|
|
6526
|
+
const R = t.let("i", (0, codegen_1$d._)`${r}.length`), v = t.let("j");
|
|
6527
|
+
e.setParams({ i: R, j: v }), t.assign(d, !0), t.if((0, codegen_1$d._)`${R} > 1`, () => ($() ? O : N)(R, v));
|
|
6518
6528
|
}
|
|
6519
6529
|
function $() {
|
|
6520
|
-
return u.length > 0 && !u.some((
|
|
6521
|
-
}
|
|
6522
|
-
function O(
|
|
6523
|
-
const g = t.name("item"), m = (0, dataType_1.checkDataTypes)(u, g, l.opts.strictNumbers, dataType_1.DataType.Wrong),
|
|
6524
|
-
t.for((0, codegen_1$d._)`;${
|
|
6525
|
-
t.let(g, (0, codegen_1$d._)`${r}[${
|
|
6526
|
-
t.assign(v, (0, codegen_1$d._)`${
|
|
6527
|
-
}).code((0, codegen_1$d._)`${
|
|
6530
|
+
return u.length > 0 && !u.some((R) => R === "object" || R === "array");
|
|
6531
|
+
}
|
|
6532
|
+
function O(R, v) {
|
|
6533
|
+
const g = t.name("item"), m = (0, dataType_1.checkDataTypes)(u, g, l.opts.strictNumbers, dataType_1.DataType.Wrong), T = t.const("indices", (0, codegen_1$d._)`{}`);
|
|
6534
|
+
t.for((0, codegen_1$d._)`;${R}--;`, () => {
|
|
6535
|
+
t.let(g, (0, codegen_1$d._)`${r}[${R}]`), t.if(m, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${g} == "string"`, (0, codegen_1$d._)`${g} += "_"`), t.if((0, codegen_1$d._)`typeof ${T}[${g}] == "number"`, () => {
|
|
6536
|
+
t.assign(v, (0, codegen_1$d._)`${T}[${g}]`), e.error(), t.assign(d, !1).break();
|
|
6537
|
+
}).code((0, codegen_1$d._)`${T}[${g}] = ${R}`);
|
|
6528
6538
|
});
|
|
6529
6539
|
}
|
|
6530
|
-
function N(
|
|
6540
|
+
function N(R, v) {
|
|
6531
6541
|
const g = (0, util_1$g.useFunc)(t, equal_1$2.default), m = t.name("outer");
|
|
6532
|
-
t.label(m).for((0, codegen_1$d._)`;${
|
|
6542
|
+
t.label(m).for((0, codegen_1$d._)`;${R}--;`, () => t.for((0, codegen_1$d._)`${v} = ${R}; ${v}--;`, () => t.if((0, codegen_1$d._)`${g}(${r}[${R}], ${r}[${v}])`, () => {
|
|
6533
6543
|
e.error(), t.assign(d, !1).break(m);
|
|
6534
6544
|
})));
|
|
6535
6545
|
}
|
|
@@ -6575,15 +6585,15 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
|
|
|
6575
6585
|
if (!Array.isArray(s))
|
|
6576
6586
|
throw new Error("ajv implementation error");
|
|
6577
6587
|
const N = t.const("vSchema", i);
|
|
6578
|
-
p = (0, codegen_1$b.or)(...s.map((
|
|
6588
|
+
p = (0, codegen_1$b.or)(...s.map((R, v) => O(N, v)));
|
|
6579
6589
|
}
|
|
6580
6590
|
e.pass(p);
|
|
6581
6591
|
function $() {
|
|
6582
6592
|
t.assign(p, !1), t.forOf("v", i, (N) => t.if((0, codegen_1$b._)`${u()}(${r}, ${N})`, () => t.assign(p, !0).break()));
|
|
6583
6593
|
}
|
|
6584
|
-
function O(N,
|
|
6585
|
-
const v = s[
|
|
6586
|
-
return typeof v == "object" && v !== null ? (0, codegen_1$b._)`${u()}(${r}, ${N}[${
|
|
6594
|
+
function O(N, R) {
|
|
6595
|
+
const v = s[R];
|
|
6596
|
+
return typeof v == "object" && v !== null ? (0, codegen_1$b._)`${u()}(${r}, ${N}[${R}])` : (0, codegen_1$b._)`${r} === ${v}`;
|
|
6587
6597
|
}
|
|
6588
6598
|
}
|
|
6589
6599
|
};
|
|
@@ -6675,9 +6685,9 @@ function validateTuple(e, t, r = e.schema) {
|
|
|
6675
6685
|
}, d)), e.ok(d));
|
|
6676
6686
|
});
|
|
6677
6687
|
function p($) {
|
|
6678
|
-
const { opts: O, errSchemaPath: N } = l,
|
|
6688
|
+
const { opts: O, errSchemaPath: N } = l, R = r.length, v = R === $.minItems && (R === $.maxItems || $[t] === !1);
|
|
6679
6689
|
if (O.strictTuples && !v) {
|
|
6680
|
-
const g = `"${o}" is ${
|
|
6690
|
+
const g = `"${o}" is ${R}-tuple, but minItems or maxItems/${t} are not specified or different at path "${N}"`;
|
|
6681
6691
|
(0, util_1$c.checkStrictMode)(l, g, O.strictTuples);
|
|
6682
6692
|
}
|
|
6683
6693
|
}
|
|
@@ -6746,7 +6756,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6746
6756
|
l === void 0 && o === 1 ? N($, () => t.if($, () => t.break())) : o === 0 ? (t.let($, !0), l !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, O)) : (t.let($, !1), O()), e.result($, () => e.reset());
|
|
6747
6757
|
function O() {
|
|
6748
6758
|
const v = t.name("_valid"), g = t.let("count", 0);
|
|
6749
|
-
N(v, () => t.if(v, () =>
|
|
6759
|
+
N(v, () => t.if(v, () => R(g)));
|
|
6750
6760
|
}
|
|
6751
6761
|
function N(v, g) {
|
|
6752
6762
|
t.forRange("i", 0, p, (m) => {
|
|
@@ -6758,7 +6768,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6758
6768
|
}, v), g();
|
|
6759
6769
|
});
|
|
6760
6770
|
}
|
|
6761
|
-
function
|
|
6771
|
+
function R(v) {
|
|
6762
6772
|
t.code((0, codegen_1$7._)`${v}++`), l === void 0 ? t.if((0, codegen_1$7._)`${v} >= ${o}`, () => t.assign($, !0).break()) : (t.if((0, codegen_1$7._)`${v} > ${l}`, () => t.assign($, !1).break()), o === 1 ? t.assign($, !0) : t.if((0, codegen_1$7._)`${v} >= ${o}`, () => t.assign($, !0)));
|
|
6763
6773
|
}
|
|
6764
6774
|
}
|
|
@@ -6804,13 +6814,13 @@ var dependencies = {};
|
|
|
6804
6814
|
if (Object.keys(u).length === 0)
|
|
6805
6815
|
return;
|
|
6806
6816
|
const N = p.let("missing");
|
|
6807
|
-
for (const
|
|
6808
|
-
const v = u[
|
|
6817
|
+
for (const R in u) {
|
|
6818
|
+
const v = u[R];
|
|
6809
6819
|
if (v.length === 0)
|
|
6810
6820
|
continue;
|
|
6811
|
-
const g = (0, n.propertyInData)(p, $,
|
|
6821
|
+
const g = (0, n.propertyInData)(p, $, R, O.opts.ownProperties);
|
|
6812
6822
|
d.setParams({
|
|
6813
|
-
property:
|
|
6823
|
+
property: R,
|
|
6814
6824
|
depsCount: v.length,
|
|
6815
6825
|
deps: v.join(", ")
|
|
6816
6826
|
}), O.allErrors ? p.if(g, () => {
|
|
@@ -6821,17 +6831,17 @@ var dependencies = {};
|
|
|
6821
6831
|
}
|
|
6822
6832
|
e.validatePropertyDeps = o;
|
|
6823
6833
|
function l(d, u = d.schema) {
|
|
6824
|
-
const { gen: p, data: $, keyword: O, it: N } = d,
|
|
6834
|
+
const { gen: p, data: $, keyword: O, it: N } = d, R = p.name("valid");
|
|
6825
6835
|
for (const v in u)
|
|
6826
6836
|
(0, r.alwaysValidSchema)(N, u[v]) || (p.if(
|
|
6827
6837
|
(0, n.propertyInData)(p, $, v, N.opts.ownProperties),
|
|
6828
6838
|
() => {
|
|
6829
|
-
const g = d.subschema({ keyword: O, schemaProp: v },
|
|
6830
|
-
d.mergeValidEvaluated(g,
|
|
6839
|
+
const g = d.subschema({ keyword: O, schemaProp: v }, R);
|
|
6840
|
+
d.mergeValidEvaluated(g, R);
|
|
6831
6841
|
},
|
|
6832
|
-
() => p.var(
|
|
6842
|
+
() => p.var(R, !0)
|
|
6833
6843
|
// TODO var
|
|
6834
|
-
), d.ok(
|
|
6844
|
+
), d.ok(R));
|
|
6835
6845
|
}
|
|
6836
6846
|
e.validateSchemaDeps = l, e.default = s;
|
|
6837
6847
|
})(dependencies);
|
|
@@ -6887,22 +6897,22 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6887
6897
|
$(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
|
|
6888
6898
|
function $() {
|
|
6889
6899
|
t.forIn("key", s, (g) => {
|
|
6890
|
-
!u.length && !p.length ?
|
|
6900
|
+
!u.length && !p.length ? R(g) : t.if(O(g), () => R(g));
|
|
6891
6901
|
});
|
|
6892
6902
|
}
|
|
6893
6903
|
function O(g) {
|
|
6894
6904
|
let m;
|
|
6895
6905
|
if (u.length > 8) {
|
|
6896
|
-
const
|
|
6897
|
-
m = (0, code_1$3.isOwnProperty)(t,
|
|
6906
|
+
const T = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
|
|
6907
|
+
m = (0, code_1$3.isOwnProperty)(t, T, g);
|
|
6898
6908
|
} else
|
|
6899
|
-
u.length ? m = (0, codegen_1$5.or)(...u.map((
|
|
6900
|
-
return p.length && (m = (0, codegen_1$5.or)(m, ...p.map((
|
|
6909
|
+
u.length ? m = (0, codegen_1$5.or)(...u.map((T) => (0, codegen_1$5._)`${g} === ${T}`)) : m = codegen_1$5.nil;
|
|
6910
|
+
return p.length && (m = (0, codegen_1$5.or)(m, ...p.map((T) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, T)}.test(${g})`))), (0, codegen_1$5.not)(m);
|
|
6901
6911
|
}
|
|
6902
6912
|
function N(g) {
|
|
6903
6913
|
t.code((0, codegen_1$5._)`delete ${s}[${g}]`);
|
|
6904
6914
|
}
|
|
6905
|
-
function
|
|
6915
|
+
function R(g) {
|
|
6906
6916
|
if (d.removeAdditional === "all" || d.removeAdditional && r === !1) {
|
|
6907
6917
|
N(g);
|
|
6908
6918
|
return;
|
|
@@ -6918,13 +6928,13 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6918
6928
|
})) : (v(g, m), l || t.if((0, codegen_1$5.not)(m), () => t.break()));
|
|
6919
6929
|
}
|
|
6920
6930
|
}
|
|
6921
|
-
function v(g, m,
|
|
6931
|
+
function v(g, m, T) {
|
|
6922
6932
|
const S = {
|
|
6923
6933
|
keyword: "additionalProperties",
|
|
6924
6934
|
dataProp: g,
|
|
6925
6935
|
dataPropType: util_1$8.Type.Str
|
|
6926
6936
|
};
|
|
6927
|
-
|
|
6937
|
+
T === !1 && Object.assign(S, {
|
|
6928
6938
|
compositeRule: !0,
|
|
6929
6939
|
createErrors: !1,
|
|
6930
6940
|
allErrors: !1
|
|
@@ -6981,13 +6991,13 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
|
|
|
6981
6991
|
O();
|
|
6982
6992
|
function O() {
|
|
6983
6993
|
for (const v of l)
|
|
6984
|
-
u && N(v), i.allErrors ?
|
|
6994
|
+
u && N(v), i.allErrors ? R(v) : (t.var(p, !0), R(v), t.if(p));
|
|
6985
6995
|
}
|
|
6986
6996
|
function N(v) {
|
|
6987
6997
|
for (const g in u)
|
|
6988
6998
|
new RegExp(v).test(g) && (0, util_1$6.checkStrictMode)(i, `property ${g} matches pattern ${v} (use allowMatchingProperties)`);
|
|
6989
6999
|
}
|
|
6990
|
-
function
|
|
7000
|
+
function R(v) {
|
|
6991
7001
|
t.forIn("key", n, (g) => {
|
|
6992
7002
|
t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, v)}.test(${g})`, () => {
|
|
6993
7003
|
const m = d.includes(v);
|
|
@@ -7181,45 +7191,45 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7181
7191
|
return;
|
|
7182
7192
|
s ? O() : N();
|
|
7183
7193
|
function O() {
|
|
7184
|
-
const
|
|
7194
|
+
const R = r.scopeValue("formats", {
|
|
7185
7195
|
ref: $.formats,
|
|
7186
7196
|
code: d.code.formats
|
|
7187
|
-
}), v = r.const("fDef", (0, codegen_1$1._)`${
|
|
7188
|
-
r.if((0, codegen_1$1._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`, () => r.assign(g, (0, codegen_1$1._)`${v}.type || "string"`).assign(m, (0, codegen_1$1._)`${v}.validate`), () => r.assign(g, (0, codegen_1$1._)`"string"`).assign(m, v)), e.fail$data((0, codegen_1$1.or)(
|
|
7189
|
-
function
|
|
7197
|
+
}), v = r.const("fDef", (0, codegen_1$1._)`${R}[${o}]`), g = r.let("fType"), m = r.let("format");
|
|
7198
|
+
r.if((0, codegen_1$1._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`, () => r.assign(g, (0, codegen_1$1._)`${v}.type || "string"`).assign(m, (0, codegen_1$1._)`${v}.validate`), () => r.assign(g, (0, codegen_1$1._)`"string"`).assign(m, v)), e.fail$data((0, codegen_1$1.or)(T(), S()));
|
|
7199
|
+
function T() {
|
|
7190
7200
|
return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${m}`;
|
|
7191
7201
|
}
|
|
7192
7202
|
function S() {
|
|
7193
|
-
const I = p.$async ? (0, codegen_1$1._)`(${v}.async ? await ${m}(${n}) : ${m}(${n}))` : (0, codegen_1$1._)`${m}(${n})`,
|
|
7194
|
-
return (0, codegen_1$1._)`${m} && ${m} !== true && ${g} === ${t} && !${
|
|
7203
|
+
const I = p.$async ? (0, codegen_1$1._)`(${v}.async ? await ${m}(${n}) : ${m}(${n}))` : (0, codegen_1$1._)`${m}(${n})`, A = (0, codegen_1$1._)`(typeof ${m} == "function" ? ${I} : ${m}.test(${n}))`;
|
|
7204
|
+
return (0, codegen_1$1._)`${m} && ${m} !== true && ${g} === ${t} && !${A}`;
|
|
7195
7205
|
}
|
|
7196
7206
|
}
|
|
7197
7207
|
function N() {
|
|
7198
|
-
const
|
|
7199
|
-
if (!
|
|
7200
|
-
|
|
7208
|
+
const R = $.formats[i];
|
|
7209
|
+
if (!R) {
|
|
7210
|
+
T();
|
|
7201
7211
|
return;
|
|
7202
7212
|
}
|
|
7203
|
-
if (
|
|
7213
|
+
if (R === !0)
|
|
7204
7214
|
return;
|
|
7205
|
-
const [v, g, m] = S(
|
|
7215
|
+
const [v, g, m] = S(R);
|
|
7206
7216
|
v === t && e.pass(I());
|
|
7207
|
-
function
|
|
7217
|
+
function T() {
|
|
7208
7218
|
if (d.strictSchema === !1) {
|
|
7209
|
-
$.logger.warn(
|
|
7219
|
+
$.logger.warn(A());
|
|
7210
7220
|
return;
|
|
7211
7221
|
}
|
|
7212
|
-
throw new Error(
|
|
7213
|
-
function
|
|
7222
|
+
throw new Error(A());
|
|
7223
|
+
function A() {
|
|
7214
7224
|
return `unknown format "${i}" ignored in schema at path "${u}"`;
|
|
7215
7225
|
}
|
|
7216
7226
|
}
|
|
7217
|
-
function S(
|
|
7218
|
-
const w =
|
|
7219
|
-
return typeof
|
|
7227
|
+
function S(A) {
|
|
7228
|
+
const w = A instanceof RegExp ? (0, codegen_1$1.regexpCode)(A) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0, k = r.scopeValue("formats", { key: i, ref: A, code: w });
|
|
7229
|
+
return typeof A == "object" && !(A instanceof RegExp) ? [A.type || "string", A.validate, (0, codegen_1$1._)`${k}.validate`] : ["string", A, k];
|
|
7220
7230
|
}
|
|
7221
7231
|
function I() {
|
|
7222
|
-
if (typeof
|
|
7232
|
+
if (typeof R == "object" && !(R instanceof RegExp) && R.async) {
|
|
7223
7233
|
if (!p.$async)
|
|
7224
7234
|
throw new Error("async format in sync schema");
|
|
7225
7235
|
return (0, codegen_1$1._)`await ${m}(${n})`;
|
|
@@ -7291,45 +7301,45 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7291
7301
|
function p() {
|
|
7292
7302
|
const N = O();
|
|
7293
7303
|
t.if(!1);
|
|
7294
|
-
for (const
|
|
7295
|
-
t.elseIf((0, codegen_1._)`${u} === ${
|
|
7304
|
+
for (const R in N)
|
|
7305
|
+
t.elseIf((0, codegen_1._)`${u} === ${R}`), t.assign(d, $(N[R]));
|
|
7296
7306
|
t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: l }), t.endIf();
|
|
7297
7307
|
}
|
|
7298
7308
|
function $(N) {
|
|
7299
|
-
const
|
|
7300
|
-
return e.mergeEvaluated(v, codegen_1.Name),
|
|
7309
|
+
const R = t.name("valid"), v = e.subschema({ keyword: "oneOf", schemaProp: N }, R);
|
|
7310
|
+
return e.mergeEvaluated(v, codegen_1.Name), R;
|
|
7301
7311
|
}
|
|
7302
7312
|
function O() {
|
|
7303
7313
|
var N;
|
|
7304
|
-
const
|
|
7314
|
+
const R = {}, v = m(s);
|
|
7305
7315
|
let g = !0;
|
|
7306
7316
|
for (let I = 0; I < o.length; I++) {
|
|
7307
|
-
let
|
|
7308
|
-
|
|
7309
|
-
const w = (N =
|
|
7317
|
+
let A = o[I];
|
|
7318
|
+
A != null && A.$ref && !(0, util_1.schemaHasRulesButRef)(A, i.self.RULES) && (A = compile_1.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, A == null ? void 0 : A.$ref), A instanceof compile_1.SchemaEnv && (A = A.schema));
|
|
7319
|
+
const w = (N = A == null ? void 0 : A.properties) === null || N === void 0 ? void 0 : N[l];
|
|
7310
7320
|
if (typeof w != "object")
|
|
7311
7321
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
|
|
7312
|
-
g = g && (v || m(
|
|
7322
|
+
g = g && (v || m(A)), T(w, I);
|
|
7313
7323
|
}
|
|
7314
7324
|
if (!g)
|
|
7315
7325
|
throw new Error(`discriminator: "${l}" must be required`);
|
|
7316
|
-
return
|
|
7326
|
+
return R;
|
|
7317
7327
|
function m({ required: I }) {
|
|
7318
7328
|
return Array.isArray(I) && I.includes(l);
|
|
7319
7329
|
}
|
|
7320
|
-
function
|
|
7330
|
+
function T(I, A) {
|
|
7321
7331
|
if (I.const)
|
|
7322
|
-
S(I.const,
|
|
7332
|
+
S(I.const, A);
|
|
7323
7333
|
else if (I.enum)
|
|
7324
7334
|
for (const w of I.enum)
|
|
7325
|
-
S(w,
|
|
7335
|
+
S(w, A);
|
|
7326
7336
|
else
|
|
7327
7337
|
throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);
|
|
7328
7338
|
}
|
|
7329
|
-
function S(I,
|
|
7330
|
-
if (typeof I != "string" || I in
|
|
7339
|
+
function S(I, A) {
|
|
7340
|
+
if (typeof I != "string" || I in R)
|
|
7331
7341
|
throw new Error(`discriminator: "${l}" values must be unique strings`);
|
|
7332
|
-
|
|
7342
|
+
R[I] = A;
|
|
7333
7343
|
}
|
|
7334
7344
|
}
|
|
7335
7345
|
}
|
|
@@ -7581,13 +7591,13 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
|
|
|
7581
7591
|
const r = core$2, n = draft7, s = discriminator, i = require$$3, o = ["/properties"], l = "http://json-schema.org/draft-07/schema";
|
|
7582
7592
|
class d extends r.default {
|
|
7583
7593
|
_addVocabularies() {
|
|
7584
|
-
super._addVocabularies(), n.default.forEach((
|
|
7594
|
+
super._addVocabularies(), n.default.forEach((R) => this.addVocabulary(R)), this.opts.discriminator && this.addKeyword(s.default);
|
|
7585
7595
|
}
|
|
7586
7596
|
_addDefaultMetaSchema() {
|
|
7587
7597
|
if (super._addDefaultMetaSchema(), !this.opts.meta)
|
|
7588
7598
|
return;
|
|
7589
|
-
const
|
|
7590
|
-
this.addMetaSchema(
|
|
7599
|
+
const R = this.opts.$data ? this.$dataMetaSchema(i, o) : i;
|
|
7600
|
+
this.addMetaSchema(R, l, !1), this.refs["http://json-schema.org/schema"] = l;
|
|
7591
7601
|
}
|
|
7592
7602
|
defaultMeta() {
|
|
7593
7603
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(l) ? l : void 0);
|
|
@@ -9105,7 +9115,7 @@ function compileBlueprint(e, {
|
|
|
9105
9115
|
onStepCompleted: n = () => {
|
|
9106
9116
|
}
|
|
9107
9117
|
} = {}) {
|
|
9108
|
-
var p, $, O, N,
|
|
9118
|
+
var p, $, O, N, R;
|
|
9109
9119
|
if (e = {
|
|
9110
9120
|
...e,
|
|
9111
9121
|
steps: (e.steps || []).filter(isStepDefinition)
|
|
@@ -9190,21 +9200,21 @@ function compileBlueprint(e, {
|
|
|
9190
9200
|
),
|
|
9191
9201
|
features: {
|
|
9192
9202
|
// Disable networking by default
|
|
9193
|
-
networking: ((
|
|
9203
|
+
networking: ((R = e.features) == null ? void 0 : R.networking) ?? !1
|
|
9194
9204
|
},
|
|
9195
9205
|
run: async (v) => {
|
|
9196
9206
|
try {
|
|
9197
9207
|
for (const { resources: g } of u)
|
|
9198
9208
|
for (const m of g)
|
|
9199
9209
|
m.setPlayground(v), m.isAsync && m.resolve();
|
|
9200
|
-
for (const [g, { run: m, step:
|
|
9210
|
+
for (const [g, { run: m, step: T }] of Object.entries(u))
|
|
9201
9211
|
try {
|
|
9202
9212
|
const S = await m(v);
|
|
9203
|
-
n(S,
|
|
9213
|
+
n(S, T);
|
|
9204
9214
|
} catch (S) {
|
|
9205
9215
|
throw console.error(S), new Error(
|
|
9206
9216
|
`Error when executing the blueprint step #${g} (${JSON.stringify(
|
|
9207
|
-
|
|
9217
|
+
T
|
|
9208
9218
|
)}) ${S instanceof Error ? `: ${S.message}` : S}`,
|
|
9209
9219
|
{ cause: S }
|
|
9210
9220
|
);
|