@wp-playground/blueprints 0.6.6 → 0.6.8
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/blueprint-schema.json +192 -97
- package/index.cjs +7 -7
- package/index.d.ts +32 -3
- package/index.js +522 -411
- package/lib/steps/activate-theme.d.ts +1 -2
- 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;
|
|
@@ -1893,20 +1903,21 @@ class PHPRequestHandler {
|
|
|
1893
1903
|
te(this, Fe, new Semaphore({ concurrency: 1 }));
|
|
1894
1904
|
const {
|
|
1895
1905
|
documentRoot: n = "/www/",
|
|
1896
|
-
absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : ""
|
|
1906
|
+
absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : "",
|
|
1907
|
+
rewriteRules: i = []
|
|
1897
1908
|
} = r;
|
|
1898
1909
|
this.php = t, te(this, Pe, n);
|
|
1899
|
-
const
|
|
1900
|
-
te(this, dt,
|
|
1901
|
-
const
|
|
1910
|
+
const o = new URL(s);
|
|
1911
|
+
te(this, dt, o.hostname), te(this, De, o.port ? Number(o.port) : o.protocol === "https:" ? 443 : 80), te(this, Ke, (o.protocol || "").replace(":", ""));
|
|
1912
|
+
const l = H(this, De) !== 443 && H(this, De) !== 80;
|
|
1902
1913
|
te(this, Je, [
|
|
1903
1914
|
H(this, dt),
|
|
1904
|
-
|
|
1905
|
-
].join("")), te(this, ve,
|
|
1915
|
+
l ? `:${H(this, De)}` : ""
|
|
1916
|
+
].join("")), te(this, ve, o.pathname.replace(/\/+$/, "")), te(this, Qe, [
|
|
1906
1917
|
`${H(this, Ke)}://`,
|
|
1907
1918
|
H(this, Je),
|
|
1908
1919
|
H(this, ve)
|
|
1909
|
-
].join(""));
|
|
1920
|
+
].join("")), this.rewriteRules = i;
|
|
1910
1921
|
}
|
|
1911
1922
|
/** @inheritDoc */
|
|
1912
1923
|
pathToInternalUrl(t) {
|
|
@@ -1933,9 +1944,9 @@ class PHPRequestHandler {
|
|
|
1933
1944
|
const r = t.url.startsWith("http://") || t.url.startsWith("https://"), n = new URL(
|
|
1934
1945
|
t.url,
|
|
1935
1946
|
r ? void 0 : DEFAULT_BASE_URL
|
|
1936
|
-
), s =
|
|
1937
|
-
n.pathname,
|
|
1938
|
-
|
|
1947
|
+
), s = applyRewriteRules(
|
|
1948
|
+
removePathPrefix(n.pathname, H(this, ve)),
|
|
1949
|
+
this.rewriteRules
|
|
1939
1950
|
), i = `${H(this, Pe)}${s}`;
|
|
1940
1951
|
return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, _t, Wt).call(this, t, n) : ce(this, mt, xt).call(this, i);
|
|
1941
1952
|
}
|
|
@@ -1966,7 +1977,7 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
1966
1977
|
r
|
|
1967
1978
|
);
|
|
1968
1979
|
}, _t = new WeakSet(), Wt = async function(t, r) {
|
|
1969
|
-
var s
|
|
1980
|
+
var s;
|
|
1970
1981
|
if (H(this, Fe).running > 0 && ((s = t.headers) == null ? void 0 : s["x-request-issuer"]) === "php")
|
|
1971
1982
|
return console.warn(
|
|
1972
1983
|
"Possible deadlock: Called request() before the previous request() have finished. PHP likely issued an HTTP call to itself. Normally this would lead to infinite waiting as Request 1 holds the lock that the Request 2 is waiting to acquire. That's not useful, so PHPRequestHandler will return error 502 instead."
|
|
@@ -1981,28 +1992,20 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
1981
1992
|
"HTTPS",
|
|
1982
1993
|
H(this, Qe).startsWith("https://") ? "on" : ""
|
|
1983
1994
|
);
|
|
1984
|
-
let
|
|
1985
|
-
const
|
|
1995
|
+
let i = "GET";
|
|
1996
|
+
const o = {
|
|
1986
1997
|
host: H(this, Je),
|
|
1987
1998
|
...normalizeHeaders(t.headers || {})
|
|
1988
1999
|
};
|
|
1989
|
-
let
|
|
1990
|
-
if (typeof
|
|
1991
|
-
|
|
1992
|
-
const { bytes:
|
|
1993
|
-
|
|
2000
|
+
let l = t.body;
|
|
2001
|
+
if (typeof l == "object" && !(l instanceof Uint8Array)) {
|
|
2002
|
+
i = "POST";
|
|
2003
|
+
const { bytes: u, contentType: p } = await encodeAsMultipart(l);
|
|
2004
|
+
l = u, o["content-type"] = p;
|
|
1994
2005
|
}
|
|
1995
|
-
let
|
|
2006
|
+
let d;
|
|
1996
2007
|
try {
|
|
1997
|
-
|
|
1998
|
-
if ((i = t.headers) != null && i["x-rewrite-url"])
|
|
1999
|
-
try {
|
|
2000
|
-
p = new URL(
|
|
2001
|
-
t.headers["x-rewrite-url"]
|
|
2002
|
-
).pathname;
|
|
2003
|
-
} catch {
|
|
2004
|
-
}
|
|
2005
|
-
u = ce(this, $t, Bt).call(this, p);
|
|
2008
|
+
d = ce(this, $t, Bt).call(this, r.pathname);
|
|
2006
2009
|
} catch {
|
|
2007
2010
|
return new PHPResponse(
|
|
2008
2011
|
404,
|
|
@@ -2016,17 +2019,17 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
2016
2019
|
H(this, ve)
|
|
2017
2020
|
),
|
|
2018
2021
|
protocol: H(this, Ke),
|
|
2019
|
-
method: t.method ||
|
|
2020
|
-
body:
|
|
2021
|
-
scriptPath:
|
|
2022
|
-
headers:
|
|
2022
|
+
method: t.method || i,
|
|
2023
|
+
body: l,
|
|
2024
|
+
scriptPath: d,
|
|
2025
|
+
headers: o
|
|
2023
2026
|
});
|
|
2024
2027
|
} finally {
|
|
2025
2028
|
n();
|
|
2026
2029
|
}
|
|
2027
2030
|
}, $t = new WeakSet(), Bt = function(t) {
|
|
2028
2031
|
let r = removePathPrefix(t, H(this, ve));
|
|
2029
|
-
r.includes(".php") ? r = r.split(".php")[0] + ".php" : this.php.isDir(`${H(this, Pe)}${r}`) ? (r.endsWith("/") || (r = `${r}/`), r = `${r}index.php`) : r = "/index.php";
|
|
2032
|
+
r = applyRewriteRules(r, this.rewriteRules), r.includes(".php") ? r = r.split(".php")[0] + ".php" : this.php.isDir(`${H(this, Pe)}${r}`) ? (r.endsWith("/") || (r = `${r}/`), r = `${r}index.php`) : r = "/index.php";
|
|
2030
2033
|
const n = `${H(this, Pe)}${r}`;
|
|
2031
2034
|
if (this.php.fileExists(n))
|
|
2032
2035
|
return n;
|
|
@@ -2081,6 +2084,12 @@ function seemsLikeAPHPFile(e) {
|
|
|
2081
2084
|
function seemsLikeADirectoryRoot(e) {
|
|
2082
2085
|
return !e.split("/").pop().includes(".");
|
|
2083
2086
|
}
|
|
2087
|
+
function applyRewriteRules(e, t) {
|
|
2088
|
+
for (const r of t)
|
|
2089
|
+
if (new RegExp(r.match).test(e))
|
|
2090
|
+
return e.replace(r.match, r.replacement);
|
|
2091
|
+
return e;
|
|
2092
|
+
}
|
|
2084
2093
|
const FileErrorCodes = {
|
|
2085
2094
|
0: "No error occurred. System call completed successfully.",
|
|
2086
2095
|
1: "Argument list too long.",
|
|
@@ -2198,7 +2207,7 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
|
|
|
2198
2207
|
return n && s && __defProp(t, r, s), s;
|
|
2199
2208
|
};
|
|
2200
2209
|
const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
|
|
2201
|
-
var Me, Ze, Ye, be,
|
|
2210
|
+
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
2211
|
class BasePHP {
|
|
2203
2212
|
/**
|
|
2204
2213
|
* Initializes a PHP runtime.
|
|
@@ -2216,19 +2225,19 @@ class BasePHP {
|
|
|
2216
2225
|
Q(this, bt);
|
|
2217
2226
|
Q(this, Et);
|
|
2218
2227
|
Q(this, St);
|
|
2219
|
-
Q(this, Tt);
|
|
2220
2228
|
Q(this, Rt);
|
|
2229
|
+
Q(this, Tt);
|
|
2221
2230
|
Q(this, kt);
|
|
2222
2231
|
Q(this, Ot);
|
|
2223
2232
|
Q(this, Me, void 0);
|
|
2224
2233
|
Q(this, Ze, void 0);
|
|
2225
2234
|
Q(this, Ye, void 0);
|
|
2226
2235
|
Q(this, be, void 0);
|
|
2227
|
-
Q(this, Te, void 0);
|
|
2228
2236
|
Q(this, Re, void 0);
|
|
2237
|
+
Q(this, Te, void 0);
|
|
2229
2238
|
Q(this, Ee, void 0);
|
|
2230
2239
|
Q(this, Xe, void 0);
|
|
2231
|
-
te(this, Me, []), te(this, be, !1), te(this,
|
|
2240
|
+
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
2241
|
new PHPRequestHandler(this, t)
|
|
2233
2242
|
));
|
|
2234
2243
|
}
|
|
@@ -2284,7 +2293,7 @@ class BasePHP {
|
|
|
2284
2293
|
return s;
|
|
2285
2294
|
}
|
|
2286
2295
|
return "";
|
|
2287
|
-
}, te(this,
|
|
2296
|
+
}, te(this, Re, improveWASMErrorReporting(t)), this.dispatchEvent({
|
|
2288
2297
|
type: "runtime.initialized"
|
|
2289
2298
|
});
|
|
2290
2299
|
}
|
|
@@ -2339,10 +2348,10 @@ class BasePHP {
|
|
|
2339
2348
|
);
|
|
2340
2349
|
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
2350
|
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,
|
|
2351
|
+
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
2352
|
const i = e.env || {};
|
|
2344
2353
|
for (const l in i)
|
|
2345
|
-
ce(this,
|
|
2354
|
+
ce(this, Tt, rr).call(this, l, i[l]);
|
|
2346
2355
|
const o = await ce(this, Ot, sr).call(this);
|
|
2347
2356
|
if (e.throwOnError && o.exitCode !== 0) {
|
|
2348
2357
|
const l = {
|
|
@@ -2356,6 +2365,11 @@ class BasePHP {
|
|
|
2356
2365
|
throw d.output = l, console.error(d), d;
|
|
2357
2366
|
}
|
|
2358
2367
|
return o;
|
|
2368
|
+
} catch (n) {
|
|
2369
|
+
throw this.dispatchEvent({
|
|
2370
|
+
type: "request.error",
|
|
2371
|
+
error: n
|
|
2372
|
+
}), n;
|
|
2359
2373
|
} finally {
|
|
2360
2374
|
try {
|
|
2361
2375
|
r && this[__private__dont__use].free(r);
|
|
@@ -2367,7 +2381,7 @@ class BasePHP {
|
|
|
2367
2381
|
}
|
|
2368
2382
|
}
|
|
2369
2383
|
addServerGlobalEntry(e, t) {
|
|
2370
|
-
H(this,
|
|
2384
|
+
H(this, Te)[e] = t;
|
|
2371
2385
|
}
|
|
2372
2386
|
defineConstant(e, t) {
|
|
2373
2387
|
let r = {};
|
|
@@ -2476,10 +2490,10 @@ class BasePHP {
|
|
|
2476
2490
|
this[__private__dont__use]._exit(e);
|
|
2477
2491
|
} catch {
|
|
2478
2492
|
}
|
|
2479
|
-
te(this, be, !1), te(this,
|
|
2493
|
+
te(this, be, !1), te(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
|
|
2480
2494
|
}
|
|
2481
2495
|
}
|
|
2482
|
-
Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
2496
|
+
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
2497
|
if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
|
|
2484
2498
|
"/internal/consts.php",
|
|
2485
2499
|
`<?php
|
|
@@ -2615,15 +2629,15 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2615
2629
|
[STRING],
|
|
2616
2630
|
[e]
|
|
2617
2631
|
);
|
|
2618
|
-
},
|
|
2619
|
-
for (const e in H(this,
|
|
2632
|
+
}, Rt = new WeakSet(), tr = function() {
|
|
2633
|
+
for (const e in H(this, Te))
|
|
2620
2634
|
this[__private__dont__use].ccall(
|
|
2621
2635
|
"wasm_add_SERVER_entry",
|
|
2622
2636
|
null,
|
|
2623
2637
|
[STRING, STRING],
|
|
2624
|
-
[e, H(this,
|
|
2638
|
+
[e, H(this, Te)[e]]
|
|
2625
2639
|
);
|
|
2626
|
-
},
|
|
2640
|
+
}, Tt = new WeakSet(), rr = function(e, t) {
|
|
2627
2641
|
this[__private__dont__use].ccall(
|
|
2628
2642
|
"wasm_add_ENV_entry",
|
|
2629
2643
|
null,
|
|
@@ -2647,7 +2661,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2647
2661
|
console.error(u), console.error(u.error);
|
|
2648
2662
|
const p = new Error("Rethrown");
|
|
2649
2663
|
p.cause = u.error, p.betterMessage = u.message, o(p);
|
|
2650
|
-
}, (d = H(this,
|
|
2664
|
+
}, (d = H(this, Re)) == null || d.addEventListener(
|
|
2651
2665
|
"error",
|
|
2652
2666
|
t
|
|
2653
2667
|
);
|
|
@@ -2671,7 +2685,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2671
2685
|
const o = i, l = "betterMessage" in o ? o.betterMessage : o.message, d = new Error(l);
|
|
2672
2686
|
throw d.cause = o, console.error(d), d;
|
|
2673
2687
|
} finally {
|
|
2674
|
-
(s = H(this,
|
|
2688
|
+
(s = H(this, Re)) == null || s.removeEventListener("error", t), te(this, Te, {});
|
|
2675
2689
|
}
|
|
2676
2690
|
const { headers: r, httpStatusCode: n } = ce(this, yt, Kt).call(this);
|
|
2677
2691
|
return new PHPResponse(
|
|
@@ -2970,10 +2984,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2970
2984
|
}
|
|
2971
2985
|
e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
2972
2986
|
class r extends t {
|
|
2973
|
-
constructor(
|
|
2974
|
-
if (super(), !e.IDENTIFIER.test(
|
|
2987
|
+
constructor(T) {
|
|
2988
|
+
if (super(), !e.IDENTIFIER.test(T))
|
|
2975
2989
|
throw new Error("CodeGen: name must be a valid identifier");
|
|
2976
|
-
this.str =
|
|
2990
|
+
this.str = T;
|
|
2977
2991
|
}
|
|
2978
2992
|
toString() {
|
|
2979
2993
|
return this.str;
|
|
@@ -2987,8 +3001,8 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2987
3001
|
}
|
|
2988
3002
|
e.Name = r;
|
|
2989
3003
|
class n extends t {
|
|
2990
|
-
constructor(
|
|
2991
|
-
super(), this._items = typeof
|
|
3004
|
+
constructor(T) {
|
|
3005
|
+
super(), this._items = typeof T == "string" ? [T] : T;
|
|
2992
3006
|
}
|
|
2993
3007
|
toString() {
|
|
2994
3008
|
return this.str;
|
|
@@ -2996,66 +3010,66 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2996
3010
|
emptyStr() {
|
|
2997
3011
|
if (this._items.length > 1)
|
|
2998
3012
|
return !1;
|
|
2999
|
-
const
|
|
3000
|
-
return
|
|
3013
|
+
const T = this._items[0];
|
|
3014
|
+
return T === "" || T === '""';
|
|
3001
3015
|
}
|
|
3002
3016
|
get str() {
|
|
3003
|
-
var
|
|
3004
|
-
return (
|
|
3017
|
+
var T;
|
|
3018
|
+
return (T = this._str) !== null && T !== void 0 ? T : this._str = this._items.reduce((S, I) => `${S}${I}`, "");
|
|
3005
3019
|
}
|
|
3006
3020
|
get names() {
|
|
3007
|
-
var
|
|
3008
|
-
return (
|
|
3021
|
+
var T;
|
|
3022
|
+
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
3023
|
}
|
|
3010
3024
|
}
|
|
3011
3025
|
e._Code = n, e.nil = new n("");
|
|
3012
|
-
function s(m, ...
|
|
3026
|
+
function s(m, ...T) {
|
|
3013
3027
|
const S = [m[0]];
|
|
3014
3028
|
let I = 0;
|
|
3015
|
-
for (; I <
|
|
3016
|
-
l(S,
|
|
3029
|
+
for (; I < T.length; )
|
|
3030
|
+
l(S, T[I]), S.push(m[++I]);
|
|
3017
3031
|
return new n(S);
|
|
3018
3032
|
}
|
|
3019
3033
|
e._ = s;
|
|
3020
3034
|
const i = new n("+");
|
|
3021
|
-
function o(m, ...
|
|
3035
|
+
function o(m, ...T) {
|
|
3022
3036
|
const S = [N(m[0])];
|
|
3023
3037
|
let I = 0;
|
|
3024
|
-
for (; I <
|
|
3025
|
-
S.push(i), l(S,
|
|
3038
|
+
for (; I < T.length; )
|
|
3039
|
+
S.push(i), l(S, T[I]), S.push(i, N(m[++I]));
|
|
3026
3040
|
return d(S), new n(S);
|
|
3027
3041
|
}
|
|
3028
3042
|
e.str = o;
|
|
3029
|
-
function l(m,
|
|
3030
|
-
|
|
3043
|
+
function l(m, T) {
|
|
3044
|
+
T instanceof n ? m.push(...T._items) : T instanceof r ? m.push(T) : m.push($(T));
|
|
3031
3045
|
}
|
|
3032
3046
|
e.addCodeArg = l;
|
|
3033
3047
|
function d(m) {
|
|
3034
|
-
let
|
|
3035
|
-
for (;
|
|
3036
|
-
if (m[
|
|
3037
|
-
const S = u(m[
|
|
3048
|
+
let T = 1;
|
|
3049
|
+
for (; T < m.length - 1; ) {
|
|
3050
|
+
if (m[T] === i) {
|
|
3051
|
+
const S = u(m[T - 1], m[T + 1]);
|
|
3038
3052
|
if (S !== void 0) {
|
|
3039
|
-
m.splice(
|
|
3053
|
+
m.splice(T - 1, 3, S);
|
|
3040
3054
|
continue;
|
|
3041
3055
|
}
|
|
3042
|
-
m[
|
|
3056
|
+
m[T++] = "+";
|
|
3043
3057
|
}
|
|
3044
|
-
|
|
3058
|
+
T++;
|
|
3045
3059
|
}
|
|
3046
3060
|
}
|
|
3047
|
-
function u(m,
|
|
3048
|
-
if (
|
|
3061
|
+
function u(m, T) {
|
|
3062
|
+
if (T === '""')
|
|
3049
3063
|
return m;
|
|
3050
3064
|
if (m === '""')
|
|
3051
|
-
return
|
|
3065
|
+
return T;
|
|
3052
3066
|
if (typeof m == "string")
|
|
3053
|
-
return
|
|
3054
|
-
if (typeof
|
|
3055
|
-
return `"${m}${
|
|
3067
|
+
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;
|
|
3068
|
+
if (typeof T == "string" && T[0] === '"' && !(m instanceof r))
|
|
3069
|
+
return `"${m}${T.slice(1)}`;
|
|
3056
3070
|
}
|
|
3057
|
-
function p(m,
|
|
3058
|
-
return
|
|
3071
|
+
function p(m, T) {
|
|
3072
|
+
return T.emptyStr() ? m : m.emptyStr() ? T : o`${m}${T}`;
|
|
3059
3073
|
}
|
|
3060
3074
|
e.strConcat = p;
|
|
3061
3075
|
function $(m) {
|
|
@@ -3069,10 +3083,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
3069
3083
|
return JSON.stringify(m).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
3070
3084
|
}
|
|
3071
3085
|
e.safeStringify = N;
|
|
3072
|
-
function
|
|
3086
|
+
function R(m) {
|
|
3073
3087
|
return typeof m == "string" && e.IDENTIFIER.test(m) ? new n(`.${m}`) : s`[${m}]`;
|
|
3074
3088
|
}
|
|
3075
|
-
e.getProperty =
|
|
3089
|
+
e.getProperty = R;
|
|
3076
3090
|
function v(m) {
|
|
3077
3091
|
if (typeof m == "string" && e.IDENTIFIER.test(m))
|
|
3078
3092
|
return new n(`${m}`);
|
|
@@ -3147,15 +3161,15 @@ var scope = {};
|
|
|
3147
3161
|
var $;
|
|
3148
3162
|
if (p.ref === void 0)
|
|
3149
3163
|
throw new Error("CodeGen: ref must be passed in value");
|
|
3150
|
-
const O = this.toName(u), { prefix: N } = O,
|
|
3164
|
+
const O = this.toName(u), { prefix: N } = O, R = ($ = p.key) !== null && $ !== void 0 ? $ : p.ref;
|
|
3151
3165
|
let v = this._values[N];
|
|
3152
3166
|
if (v) {
|
|
3153
|
-
const
|
|
3154
|
-
if (
|
|
3155
|
-
return
|
|
3167
|
+
const T = v.get(R);
|
|
3168
|
+
if (T)
|
|
3169
|
+
return T;
|
|
3156
3170
|
} else
|
|
3157
3171
|
v = this._values[N] = /* @__PURE__ */ new Map();
|
|
3158
|
-
v.set(
|
|
3172
|
+
v.set(R, O);
|
|
3159
3173
|
const g = this._scope[N] || (this._scope[N] = []), m = g.length;
|
|
3160
3174
|
return g[m] = p.ref, O.setValue(p, { property: N, itemIndex: m }), O;
|
|
3161
3175
|
}
|
|
@@ -3180,21 +3194,21 @@ var scope = {};
|
|
|
3180
3194
|
}
|
|
3181
3195
|
_reduceValues(u, p, $ = {}, O) {
|
|
3182
3196
|
let N = t.nil;
|
|
3183
|
-
for (const
|
|
3184
|
-
const v = u[
|
|
3197
|
+
for (const R in u) {
|
|
3198
|
+
const v = u[R];
|
|
3185
3199
|
if (!v)
|
|
3186
3200
|
continue;
|
|
3187
|
-
const g = $[
|
|
3201
|
+
const g = $[R] = $[R] || /* @__PURE__ */ new Map();
|
|
3188
3202
|
v.forEach((m) => {
|
|
3189
3203
|
if (g.has(m))
|
|
3190
3204
|
return;
|
|
3191
3205
|
g.set(m, n.Started);
|
|
3192
|
-
let
|
|
3193
|
-
if (
|
|
3206
|
+
let T = p(m);
|
|
3207
|
+
if (T) {
|
|
3194
3208
|
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}${
|
|
3209
|
+
N = (0, t._)`${N}${S} ${m} = ${T};${this.opts._n}`;
|
|
3210
|
+
} else if (T = O == null ? void 0 : O(m))
|
|
3211
|
+
N = (0, t._)`${N}${T}${this.opts._n}`;
|
|
3198
3212
|
else
|
|
3199
3213
|
throw new r(m);
|
|
3200
3214
|
g.set(m, n.Completed);
|
|
@@ -3368,17 +3382,17 @@ var scope = {};
|
|
|
3368
3382
|
return this.nodes.reduce((a, h) => K(a, h.names), {});
|
|
3369
3383
|
}
|
|
3370
3384
|
}
|
|
3371
|
-
class
|
|
3385
|
+
class R extends N {
|
|
3372
3386
|
render(a) {
|
|
3373
3387
|
return "{" + a._n + super.render(a) + "}" + a._n;
|
|
3374
3388
|
}
|
|
3375
3389
|
}
|
|
3376
3390
|
class v extends N {
|
|
3377
3391
|
}
|
|
3378
|
-
class g extends
|
|
3392
|
+
class g extends R {
|
|
3379
3393
|
}
|
|
3380
3394
|
g.kind = "else";
|
|
3381
|
-
class m extends
|
|
3395
|
+
class m extends R {
|
|
3382
3396
|
constructor(a, h) {
|
|
3383
3397
|
super(h), this.condition = a;
|
|
3384
3398
|
}
|
|
@@ -3412,10 +3426,10 @@ var scope = {};
|
|
|
3412
3426
|
}
|
|
3413
3427
|
}
|
|
3414
3428
|
m.kind = "if";
|
|
3415
|
-
class
|
|
3429
|
+
class T extends R {
|
|
3416
3430
|
}
|
|
3417
|
-
|
|
3418
|
-
class S extends
|
|
3431
|
+
T.kind = "for";
|
|
3432
|
+
class S extends T {
|
|
3419
3433
|
constructor(a) {
|
|
3420
3434
|
super(), this.iteration = a;
|
|
3421
3435
|
}
|
|
@@ -3430,7 +3444,7 @@ var scope = {};
|
|
|
3430
3444
|
return K(super.names, this.iteration.names);
|
|
3431
3445
|
}
|
|
3432
3446
|
}
|
|
3433
|
-
class I extends
|
|
3447
|
+
class I extends T {
|
|
3434
3448
|
constructor(a, h, C, M) {
|
|
3435
3449
|
super(), this.varKind = a, this.name = h, this.from = C, this.to = M;
|
|
3436
3450
|
}
|
|
@@ -3443,7 +3457,7 @@ var scope = {};
|
|
|
3443
3457
|
return ue(a, this.to);
|
|
3444
3458
|
}
|
|
3445
3459
|
}
|
|
3446
|
-
class D extends
|
|
3460
|
+
class D extends T {
|
|
3447
3461
|
constructor(a, h, C, M) {
|
|
3448
3462
|
super(), this.loop = a, this.varKind = h, this.name = C, this.iterable = M;
|
|
3449
3463
|
}
|
|
@@ -3458,7 +3472,7 @@ var scope = {};
|
|
|
3458
3472
|
return K(super.names, this.iterable.names);
|
|
3459
3473
|
}
|
|
3460
3474
|
}
|
|
3461
|
-
class w extends
|
|
3475
|
+
class w extends R {
|
|
3462
3476
|
constructor(a, h, C) {
|
|
3463
3477
|
super(), this.name = a, this.args = h, this.async = C;
|
|
3464
3478
|
}
|
|
@@ -3473,7 +3487,7 @@ var scope = {};
|
|
|
3473
3487
|
}
|
|
3474
3488
|
}
|
|
3475
3489
|
k.kind = "return";
|
|
3476
|
-
class A extends
|
|
3490
|
+
class A extends R {
|
|
3477
3491
|
render(a) {
|
|
3478
3492
|
let h = "try" + super.render(a);
|
|
3479
3493
|
return this.catch && (h += this.catch.render(a)), this.finally && (h += this.finally.render(a)), h;
|
|
@@ -3491,7 +3505,7 @@ var scope = {};
|
|
|
3491
3505
|
return this.catch && K(a, this.catch.names), this.finally && K(a, this.finally.names), a;
|
|
3492
3506
|
}
|
|
3493
3507
|
}
|
|
3494
|
-
class V extends
|
|
3508
|
+
class V extends R {
|
|
3495
3509
|
constructor(a) {
|
|
3496
3510
|
super(), this.error = a;
|
|
3497
3511
|
}
|
|
@@ -3500,7 +3514,7 @@ var scope = {};
|
|
|
3500
3514
|
}
|
|
3501
3515
|
}
|
|
3502
3516
|
V.kind = "catch";
|
|
3503
|
-
class x extends
|
|
3517
|
+
class x extends R {
|
|
3504
3518
|
render(a) {
|
|
3505
3519
|
return "finally" + super.render(a);
|
|
3506
3520
|
}
|
|
@@ -3628,7 +3642,7 @@ var scope = {};
|
|
|
3628
3642
|
}
|
|
3629
3643
|
// end `for` loop
|
|
3630
3644
|
endFor() {
|
|
3631
|
-
return this._endBlockNode(
|
|
3645
|
+
return this._endBlockNode(T);
|
|
3632
3646
|
}
|
|
3633
3647
|
// `label` statement
|
|
3634
3648
|
label(a) {
|
|
@@ -3840,14 +3854,14 @@ var util = {};
|
|
|
3840
3854
|
k(w);
|
|
3841
3855
|
}
|
|
3842
3856
|
e.eachItem = N;
|
|
3843
|
-
function
|
|
3857
|
+
function R({ mergeNames: w, mergeToName: k, mergeValues: A, resultToName: V }) {
|
|
3844
3858
|
return (x, re, K, ue) => {
|
|
3845
3859
|
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) : A(re, K);
|
|
3846
3860
|
return ue === t.Name && !(oe instanceof t.Name) ? V(x, oe) : oe;
|
|
3847
3861
|
};
|
|
3848
3862
|
}
|
|
3849
3863
|
e.mergeEvaluated = {
|
|
3850
|
-
props:
|
|
3864
|
+
props: R({
|
|
3851
3865
|
mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => {
|
|
3852
3866
|
w.if((0, t._)`${k} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${k})`));
|
|
3853
3867
|
}),
|
|
@@ -3857,7 +3871,7 @@ var util = {};
|
|
|
3857
3871
|
mergeValues: (w, k) => w === !0 ? !0 : { ...w, ...k },
|
|
3858
3872
|
resultToName: v
|
|
3859
3873
|
}),
|
|
3860
|
-
items:
|
|
3874
|
+
items: R({
|
|
3861
3875
|
mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => w.assign(A, (0, t._)`${k} === true ? true : ${A} > ${k} ? ${A} : ${k}`)),
|
|
3862
3876
|
mergeToName: (w, k, A) => w.if((0, t._)`${A} !== true`, () => w.assign(A, k === !0 ? !0 : (0, t._)`${A} > ${k} ? ${A} : ${k}`)),
|
|
3863
3877
|
mergeValues: (w, k) => w === !0 ? !0 : Math.max(w, k),
|
|
@@ -3876,13 +3890,13 @@ var util = {};
|
|
|
3876
3890
|
}
|
|
3877
3891
|
e.setEvaluated = g;
|
|
3878
3892
|
const m = {};
|
|
3879
|
-
function
|
|
3893
|
+
function T(w, k) {
|
|
3880
3894
|
return w.scopeValue("func", {
|
|
3881
3895
|
ref: k,
|
|
3882
3896
|
code: m[k.code] || (m[k.code] = new r._Code(k.code))
|
|
3883
3897
|
});
|
|
3884
3898
|
}
|
|
3885
|
-
e.useFunc =
|
|
3899
|
+
e.useFunc = T;
|
|
3886
3900
|
var S;
|
|
3887
3901
|
(function(w) {
|
|
3888
3902
|
w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
|
|
@@ -3938,13 +3952,13 @@ names$1.default = names;
|
|
|
3938
3952
|
}, e.keyword$DataError = {
|
|
3939
3953
|
message: ({ keyword: g, schemaType: m }) => m ? (0, t.str)`"${g}" keyword must be ${m} ($data)` : (0, t.str)`"${g}" keyword is invalid ($data)`
|
|
3940
3954
|
};
|
|
3941
|
-
function s(g, m = e.keywordError,
|
|
3942
|
-
const { it: I } = g, { gen: D, compositeRule: w, allErrors: k } = I, A = $(g, m,
|
|
3955
|
+
function s(g, m = e.keywordError, T, S) {
|
|
3956
|
+
const { it: I } = g, { gen: D, compositeRule: w, allErrors: k } = I, A = $(g, m, T);
|
|
3943
3957
|
S ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
|
|
3944
3958
|
}
|
|
3945
3959
|
e.reportError = s;
|
|
3946
|
-
function i(g, m = e.keywordError,
|
|
3947
|
-
const { it: S } = g, { gen: I, compositeRule: D, allErrors: w } = S, k = $(g, m,
|
|
3960
|
+
function i(g, m = e.keywordError, T) {
|
|
3961
|
+
const { it: S } = g, { gen: I, compositeRule: D, allErrors: w } = S, k = $(g, m, T);
|
|
3948
3962
|
d(I, k), D || w || u(S, n.default.vErrors);
|
|
3949
3963
|
}
|
|
3950
3964
|
e.reportExtraError = i;
|
|
@@ -3952,22 +3966,22 @@ names$1.default = names;
|
|
|
3952
3966
|
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
3967
|
}
|
|
3954
3968
|
e.resetErrorsCount = o;
|
|
3955
|
-
function l({ gen: g, keyword: m, schemaValue:
|
|
3969
|
+
function l({ gen: g, keyword: m, schemaValue: T, data: S, errsCount: I, it: D }) {
|
|
3956
3970
|
if (I === void 0)
|
|
3957
3971
|
throw new Error("ajv implementation error");
|
|
3958
3972
|
const w = g.name("err");
|
|
3959
3973
|
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, D.errorPath))), g.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${m}`), D.opts.verbose && (g.assign((0, t._)`${w}.schema`,
|
|
3974
|
+
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, D.errorPath))), g.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${m}`), D.opts.verbose && (g.assign((0, t._)`${w}.schema`, T), g.assign((0, t._)`${w}.data`, S));
|
|
3961
3975
|
});
|
|
3962
3976
|
}
|
|
3963
3977
|
e.extendErrors = l;
|
|
3964
3978
|
function d(g, m) {
|
|
3965
|
-
const
|
|
3966
|
-
g.if((0, t._)`${n.default.vErrors} === null`, () => g.assign(n.default.vErrors, (0, t._)`[${
|
|
3979
|
+
const T = g.const("err", m);
|
|
3980
|
+
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
3981
|
}
|
|
3968
3982
|
function u(g, m) {
|
|
3969
|
-
const { gen:
|
|
3970
|
-
I.$async ?
|
|
3983
|
+
const { gen: T, validateName: S, schemaEnv: I } = g;
|
|
3984
|
+
I.$async ? T.throw((0, t._)`new ${g.ValidationError}(${m})`) : (T.assign((0, t._)`${S}.errors`, m), T.return(!1));
|
|
3971
3985
|
}
|
|
3972
3986
|
const p = {
|
|
3973
3987
|
keyword: new t.Name("keyword"),
|
|
@@ -3978,28 +3992,28 @@ names$1.default = names;
|
|
|
3978
3992
|
schema: new t.Name("schema"),
|
|
3979
3993
|
parentSchema: new t.Name("parentSchema")
|
|
3980
3994
|
};
|
|
3981
|
-
function $(g, m,
|
|
3995
|
+
function $(g, m, T) {
|
|
3982
3996
|
const { createErrors: S } = g.it;
|
|
3983
|
-
return S === !1 ? (0, t._)`{}` : O(g, m,
|
|
3997
|
+
return S === !1 ? (0, t._)`{}` : O(g, m, T);
|
|
3984
3998
|
}
|
|
3985
|
-
function O(g, m,
|
|
3999
|
+
function O(g, m, T = {}) {
|
|
3986
4000
|
const { gen: S, it: I } = g, D = [
|
|
3987
|
-
N(I,
|
|
3988
|
-
|
|
4001
|
+
N(I, T),
|
|
4002
|
+
R(g, T)
|
|
3989
4003
|
];
|
|
3990
4004
|
return v(g, m, D), S.object(...D);
|
|
3991
4005
|
}
|
|
3992
4006
|
function N({ errorPath: g }, { instancePath: m }) {
|
|
3993
|
-
const
|
|
3994
|
-
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath,
|
|
4007
|
+
const T = m ? (0, t.str)`${g}${(0, r.getErrorPath)(m, r.Type.Str)}` : g;
|
|
4008
|
+
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, T)];
|
|
3995
4009
|
}
|
|
3996
|
-
function
|
|
4010
|
+
function R({ keyword: g, it: { errSchemaPath: m } }, { schemaPath: T, parentSchema: S }) {
|
|
3997
4011
|
let I = S ? m : (0, t.str)`${m}/${g}`;
|
|
3998
|
-
return
|
|
4012
|
+
return T && (I = (0, t.str)`${I}${(0, r.getErrorPath)(T, r.Type.Str)}`), [p.schemaPath, I];
|
|
3999
4013
|
}
|
|
4000
|
-
function v(g, { params: m, message:
|
|
4014
|
+
function v(g, { params: m, message: T }, S) {
|
|
4001
4015
|
const { keyword: I, data: D, schemaValue: w, it: k } = g, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: re } = k;
|
|
4002
|
-
S.push([p.keyword, I], [p.params, typeof m == "function" ? m(g) : m || (0, t._)`{}`]), A.messages && S.push([p.message, typeof
|
|
4016
|
+
S.push([p.keyword, I], [p.params, typeof m == "function" ? m(g) : m || (0, t._)`{}`]), A.messages && S.push([p.message, typeof T == "function" ? T(g) : T]), A.verbose && S.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${re}`], [n.default.data, D]), V && S.push([p.propertyName, V]);
|
|
4003
4017
|
}
|
|
4004
4018
|
})(errors);
|
|
4005
4019
|
Object.defineProperty(boolSchema, "__esModule", { value: !0 });
|
|
@@ -4149,7 +4163,7 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4149
4163
|
function N({ gen: S, parentData: I, parentDataProperty: D }, w) {
|
|
4150
4164
|
S.if((0, s._)`${I} !== undefined`, () => S.assign((0, s._)`${I}[${D}]`, w));
|
|
4151
4165
|
}
|
|
4152
|
-
function
|
|
4166
|
+
function R(S, I, D, w = o.Correct) {
|
|
4153
4167
|
const k = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
|
|
4154
4168
|
let A;
|
|
4155
4169
|
switch (S) {
|
|
@@ -4175,10 +4189,10 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4175
4189
|
return (0, s.and)((0, s._)`typeof ${I} == "number"`, x, D ? (0, s._)`isFinite(${I})` : s.nil);
|
|
4176
4190
|
}
|
|
4177
4191
|
}
|
|
4178
|
-
e.checkDataType =
|
|
4192
|
+
e.checkDataType = R;
|
|
4179
4193
|
function v(S, I, D, w) {
|
|
4180
4194
|
if (S.length === 1)
|
|
4181
|
-
return
|
|
4195
|
+
return R(S[0], I, D, w);
|
|
4182
4196
|
let k;
|
|
4183
4197
|
const A = (0, i.toHash)(S);
|
|
4184
4198
|
if (A.array && A.object) {
|
|
@@ -4188,7 +4202,7 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4188
4202
|
k = s.nil;
|
|
4189
4203
|
A.number && delete A.integer;
|
|
4190
4204
|
for (const V in A)
|
|
4191
|
-
k = (0, s.and)(k,
|
|
4205
|
+
k = (0, s.and)(k, R(V, I, D, w));
|
|
4192
4206
|
return k;
|
|
4193
4207
|
}
|
|
4194
4208
|
e.checkDataTypes = v;
|
|
@@ -4197,11 +4211,11 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4197
4211
|
params: ({ schema: S, schemaValue: I }) => typeof S == "string" ? (0, s._)`{type: ${S}}` : (0, s._)`{type: ${I}}`
|
|
4198
4212
|
};
|
|
4199
4213
|
function m(S) {
|
|
4200
|
-
const I =
|
|
4214
|
+
const I = T(S);
|
|
4201
4215
|
(0, n.reportError)(I, g);
|
|
4202
4216
|
}
|
|
4203
4217
|
e.reportTypeError = m;
|
|
4204
|
-
function
|
|
4218
|
+
function T(S) {
|
|
4205
4219
|
const { gen: I, data: D, schema: w } = S, k = (0, i.schemaRefOrVal)(S, w, "type");
|
|
4206
4220
|
return {
|
|
4207
4221
|
gen: I,
|
|
@@ -4374,25 +4388,25 @@ function funcKeywordCode(e, t) {
|
|
|
4374
4388
|
if (t.errors === !1)
|
|
4375
4389
|
v(), t.modifying && modifyData(e), g(() => e.error());
|
|
4376
4390
|
else {
|
|
4377
|
-
const m = t.async ? N() :
|
|
4391
|
+
const m = t.async ? N() : R();
|
|
4378
4392
|
t.modifying && modifyData(e), g(() => addErrs(e, m));
|
|
4379
4393
|
}
|
|
4380
4394
|
}
|
|
4381
4395
|
function N() {
|
|
4382
4396
|
const m = n.let("ruleErrs", null);
|
|
4383
|
-
return n.try(() => v((0, codegen_1$p._)`await `), (
|
|
4397
|
+
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
4398
|
}
|
|
4385
|
-
function
|
|
4399
|
+
function R() {
|
|
4386
4400
|
const m = (0, codegen_1$p._)`${p}.errors`;
|
|
4387
4401
|
return n.assign(m, null), v(codegen_1$p.nil), m;
|
|
4388
4402
|
}
|
|
4389
4403
|
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,
|
|
4404
|
+
const T = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, S = !("compile" in t && !l || t.schema === !1);
|
|
4405
|
+
n.assign($, (0, codegen_1$p._)`${m}${(0, code_1$9.callValidateCode)(e, p, T, S)}`, t.modifying);
|
|
4392
4406
|
}
|
|
4393
4407
|
function g(m) {
|
|
4394
|
-
var
|
|
4395
|
-
n.if((0, codegen_1$p.not)((
|
|
4408
|
+
var T;
|
|
4409
|
+
n.if((0, codegen_1$p.not)((T = t.valid) !== null && T !== void 0 ? T : $), m);
|
|
4396
4410
|
}
|
|
4397
4411
|
}
|
|
4398
4412
|
keyword.funcKeywordCode = funcKeywordCode;
|
|
@@ -4671,12 +4685,12 @@ function getSchemaRefs(e, t) {
|
|
|
4671
4685
|
if (typeof e == "boolean")
|
|
4672
4686
|
return {};
|
|
4673
4687
|
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 (
|
|
4688
|
+
return traverse(e, { allKeys: !0 }, ($, O, N, R) => {
|
|
4689
|
+
if (R === void 0)
|
|
4676
4690
|
return;
|
|
4677
4691
|
const v = o + O;
|
|
4678
|
-
let g = i[
|
|
4679
|
-
typeof $[r] == "string" && (g = m.call(this, $[r])),
|
|
4692
|
+
let g = i[R];
|
|
4693
|
+
typeof $[r] == "string" && (g = m.call(this, $[r])), T.call(this, $.$anchor), T.call(this, $.$dynamicAnchor), i[O] = g;
|
|
4680
4694
|
function m(S) {
|
|
4681
4695
|
const I = this.opts.uriResolver.resolve;
|
|
4682
4696
|
if (S = normalizeId(g ? I(g, S) : S), d.has(S))
|
|
@@ -4685,7 +4699,7 @@ function getSchemaRefs(e, t) {
|
|
|
4685
4699
|
let D = this.refs[S];
|
|
4686
4700
|
return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u($, D.schema, S) : S !== normalizeId(v) && (S[0] === "#" ? (u($, l[S], S), l[S] = $) : this.refs[S] = v), S;
|
|
4687
4701
|
}
|
|
4688
|
-
function
|
|
4702
|
+
function T(S) {
|
|
4689
4703
|
if (typeof S == "string") {
|
|
4690
4704
|
if (!ANCHOR.test(S))
|
|
4691
4705
|
throw new Error(`invalid anchor "${S}"`);
|
|
@@ -5085,11 +5099,11 @@ function compileSchema(e) {
|
|
|
5085
5099
|
p = `${o.scopeRefs(names_1$2.default.scope)}return ${$}`, this.opts.code.process && (p = this.opts.code.process(p, e));
|
|
5086
5100
|
const N = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
|
|
5087
5101
|
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:
|
|
5102
|
+
const { props: R, items: v } = u;
|
|
5089
5103
|
N.evaluated = {
|
|
5090
|
-
props:
|
|
5104
|
+
props: R instanceof codegen_1$m.Name ? void 0 : R,
|
|
5091
5105
|
items: v instanceof codegen_1$m.Name ? void 0 : v,
|
|
5092
|
-
dynamicProps:
|
|
5106
|
+
dynamicProps: R instanceof codegen_1$m.Name,
|
|
5093
5107
|
dynamicItems: v instanceof codegen_1$m.Name
|
|
5094
5108
|
}, N.source && (N.source.evaluated = (0, codegen_1$m.stringify)(N.evaluated));
|
|
5095
5109
|
}
|
|
@@ -5296,7 +5310,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5296
5310
|
return _;
|
|
5297
5311
|
} else
|
|
5298
5312
|
return Array.from(f);
|
|
5299
|
-
},
|
|
5313
|
+
}, R = 2147483647, v = 36, g = 1, m = 26, T = 38, S = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
|
|
5300
5314
|
overflow: "Overflow: input needs wider integers to process",
|
|
5301
5315
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5302
5316
|
"invalid-input": "Invalid input"
|
|
@@ -5341,7 +5355,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5341
5355
|
b += v
|
|
5342
5356
|
)
|
|
5343
5357
|
c = K(c / re);
|
|
5344
|
-
return K(b + (re + 1) * c / (c +
|
|
5358
|
+
return K(b + (re + 1) * c / (c + T));
|
|
5345
5359
|
}, j = function(c) {
|
|
5346
5360
|
var _ = [], E = c.length, b = 0, U = D, L = I, J = c.lastIndexOf(w);
|
|
5347
5361
|
J < 0 && (J = 0);
|
|
@@ -5356,15 +5370,15 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5356
5370
|
) {
|
|
5357
5371
|
se >= E && oe("invalid-input");
|
|
5358
5372
|
var z = Ue(c.charCodeAt(se++));
|
|
5359
|
-
(z >= v || z > K((
|
|
5373
|
+
(z >= v || z > K((R - b) / Z)) && oe("overflow"), b += z * Z;
|
|
5360
5374
|
var X = ie <= L ? g : ie >= L + m ? m : ie - L;
|
|
5361
5375
|
if (z < X)
|
|
5362
5376
|
break;
|
|
5363
5377
|
var ae = v - X;
|
|
5364
|
-
Z > K(
|
|
5378
|
+
Z > K(R / ae) && oe("overflow"), Z *= ae;
|
|
5365
5379
|
}
|
|
5366
5380
|
var ee = _.length + 1;
|
|
5367
|
-
L = y(b - B, ee, B == 0), K(b / ee) >
|
|
5381
|
+
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
5382
|
}
|
|
5369
5383
|
return String.fromCodePoint.apply(String, _);
|
|
5370
5384
|
}, P = function(c) {
|
|
@@ -5388,7 +5402,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5388
5402
|
}
|
|
5389
5403
|
var z = _.length, X = z;
|
|
5390
5404
|
for (z && _.push(w); X < E; ) {
|
|
5391
|
-
var ae =
|
|
5405
|
+
var ae = R, ee = !0, Se = !1, $e = void 0;
|
|
5392
5406
|
try {
|
|
5393
5407
|
for (var ge = c[Symbol.iterator](), Be; !(ee = (Be = ge.next()).done); ee = !0) {
|
|
5394
5408
|
var Ie = Be.value;
|
|
@@ -5405,12 +5419,12 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5405
5419
|
}
|
|
5406
5420
|
}
|
|
5407
5421
|
var fe = X + 1;
|
|
5408
|
-
ae - b > K((
|
|
5422
|
+
ae - b > K((R - U) / fe) && oe("overflow"), U += (ae - b) * fe, b = ae;
|
|
5409
5423
|
var ye = !0, je = !1, we = void 0;
|
|
5410
5424
|
try {
|
|
5411
5425
|
for (var ct = c[Symbol.iterator](), Lt; !(ye = (Lt = ct.next()).done); ye = !0) {
|
|
5412
5426
|
var Ht = Lt.value;
|
|
5413
|
-
if (Ht < b && ++U >
|
|
5427
|
+
if (Ht < b && ++U > R && oe("overflow"), Ht == b) {
|
|
5414
5428
|
for (
|
|
5415
5429
|
var pt = U, ft = v;
|
|
5416
5430
|
;
|
|
@@ -5786,7 +5800,7 @@ uri$1.default = uri;
|
|
|
5786
5800
|
} });
|
|
5787
5801
|
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
5802
|
N.code = "new RegExp";
|
|
5789
|
-
const
|
|
5803
|
+
const R = ["removeAdditional", "useDefaults", "coerceTypes"], v = /* @__PURE__ */ new Set([
|
|
5790
5804
|
"validate",
|
|
5791
5805
|
"serialize",
|
|
5792
5806
|
"parse",
|
|
@@ -5820,7 +5834,7 @@ uri$1.default = uri;
|
|
|
5820
5834
|
ignoreKeywordsWithRef: "",
|
|
5821
5835
|
jsPropertySyntax: "",
|
|
5822
5836
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
5823
|
-
},
|
|
5837
|
+
}, T = 200;
|
|
5824
5838
|
function S(F) {
|
|
5825
5839
|
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
5840
|
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 +5845,8 @@ uri$1.default = uri;
|
|
|
5831
5845
|
strictTuples: (he = (ne = F.strictTuples) !== null && ne !== void 0 ? ne : Ce) !== null && he !== void 0 ? he : "log",
|
|
5832
5846
|
strictRequired: (tt = (Le = F.strictRequired) !== null && Le !== void 0 ? Le : Ce) !== null && tt !== void 0 ? tt : !1,
|
|
5833
5847
|
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 :
|
|
5848
|
+
loopRequired: (rt = F.loopRequired) !== null && rt !== void 0 ? rt : T,
|
|
5849
|
+
loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : T,
|
|
5836
5850
|
meta: (nt = F.meta) !== null && nt !== void 0 ? nt : !0,
|
|
5837
5851
|
messages: (He = F.messages) !== null && He !== void 0 ? He : !0,
|
|
5838
5852
|
inlineRefs: (Ve = F.inlineRefs) !== null && Ve !== void 0 ? Ve : !0,
|
|
@@ -6142,7 +6156,7 @@ uri$1.default = uri;
|
|
|
6142
6156
|
}
|
|
6143
6157
|
function x() {
|
|
6144
6158
|
const F = { ...this.opts };
|
|
6145
|
-
for (const y of
|
|
6159
|
+
for (const y of R)
|
|
6146
6160
|
delete F[y];
|
|
6147
6161
|
return F;
|
|
6148
6162
|
}
|
|
@@ -6232,16 +6246,16 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
|
|
|
6232
6246
|
function $() {
|
|
6233
6247
|
if (i === u)
|
|
6234
6248
|
return callRef(e, o, i, i.$async);
|
|
6235
|
-
const
|
|
6236
|
-
return callRef(e, (0, codegen_1$l._)`${
|
|
6249
|
+
const R = t.scopeValue("root", { ref: u });
|
|
6250
|
+
return callRef(e, (0, codegen_1$l._)`${R}.validate`, u, u.$async);
|
|
6237
6251
|
}
|
|
6238
|
-
function O(
|
|
6239
|
-
const v = getValidate(e,
|
|
6240
|
-
callRef(e, v,
|
|
6252
|
+
function O(R) {
|
|
6253
|
+
const v = getValidate(e, R);
|
|
6254
|
+
callRef(e, v, R, R.$async);
|
|
6241
6255
|
}
|
|
6242
|
-
function N(
|
|
6243
|
-
const v = t.scopeValue("schema", l.code.source === !0 ? { ref:
|
|
6244
|
-
schema:
|
|
6256
|
+
function N(R) {
|
|
6257
|
+
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({
|
|
6258
|
+
schema: R,
|
|
6245
6259
|
dataTypes: [],
|
|
6246
6260
|
schemaPath: codegen_1$l.nil,
|
|
6247
6261
|
topSchemaRef: v,
|
|
@@ -6262,21 +6276,21 @@ function callRef(e, t, r, n) {
|
|
|
6262
6276
|
function p() {
|
|
6263
6277
|
if (!l.$async)
|
|
6264
6278
|
throw new Error("async schema referenced by sync schema");
|
|
6265
|
-
const
|
|
6279
|
+
const R = s.let("valid");
|
|
6266
6280
|
s.try(() => {
|
|
6267
|
-
s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), N(t), o || s.assign(
|
|
6281
|
+
s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), N(t), o || s.assign(R, !0);
|
|
6268
6282
|
}, (v) => {
|
|
6269
|
-
s.if((0, codegen_1$l._)`!(${v} instanceof ${i.ValidationError})`, () => s.throw(v)), O(v), o || s.assign(
|
|
6270
|
-
}), e.ok(
|
|
6283
|
+
s.if((0, codegen_1$l._)`!(${v} instanceof ${i.ValidationError})`, () => s.throw(v)), O(v), o || s.assign(R, !1);
|
|
6284
|
+
}), e.ok(R);
|
|
6271
6285
|
}
|
|
6272
6286
|
function $() {
|
|
6273
6287
|
e.result((0, code_1$8.callValidateCode)(e, t, u), () => N(t), () => O(t));
|
|
6274
6288
|
}
|
|
6275
|
-
function O(
|
|
6276
|
-
const v = (0, codegen_1$l._)`${
|
|
6289
|
+
function O(R) {
|
|
6290
|
+
const v = (0, codegen_1$l._)`${R}.errors`;
|
|
6277
6291
|
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
6292
|
}
|
|
6279
|
-
function N(
|
|
6293
|
+
function N(R) {
|
|
6280
6294
|
var v;
|
|
6281
6295
|
if (!i.opts.unevaluated)
|
|
6282
6296
|
return;
|
|
@@ -6285,14 +6299,14 @@ function callRef(e, t, r, n) {
|
|
|
6285
6299
|
if (g && !g.dynamicProps)
|
|
6286
6300
|
g.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, g.props, i.props));
|
|
6287
6301
|
else {
|
|
6288
|
-
const m = s.var("props", (0, codegen_1$l._)`${
|
|
6302
|
+
const m = s.var("props", (0, codegen_1$l._)`${R}.evaluated.props`);
|
|
6289
6303
|
i.props = util_1$j.mergeEvaluated.props(s, m, i.props, codegen_1$l.Name);
|
|
6290
6304
|
}
|
|
6291
6305
|
if (i.items !== !0)
|
|
6292
6306
|
if (g && !g.dynamicItems)
|
|
6293
6307
|
g.items !== void 0 && (i.items = util_1$j.mergeEvaluated.items(s, g.items, i.items));
|
|
6294
6308
|
else {
|
|
6295
|
-
const m = s.var("items", (0, codegen_1$l._)`${
|
|
6309
|
+
const m = s.var("items", (0, codegen_1$l._)`${R}.evaluated.items`);
|
|
6296
6310
|
i.items = util_1$j.mergeEvaluated.items(s, m, i.items, codegen_1$l.Name);
|
|
6297
6311
|
}
|
|
6298
6312
|
}
|
|
@@ -6434,9 +6448,9 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6434
6448
|
return;
|
|
6435
6449
|
const d = r.length >= l.loopRequired;
|
|
6436
6450
|
if (o.allErrors ? u() : p(), l.strictRequired) {
|
|
6437
|
-
const N = e.parentSchema.properties, { definedProperties:
|
|
6451
|
+
const N = e.parentSchema.properties, { definedProperties: R } = e.it;
|
|
6438
6452
|
for (const v of r)
|
|
6439
|
-
if ((N == null ? void 0 : N[v]) === void 0 && !
|
|
6453
|
+
if ((N == null ? void 0 : N[v]) === void 0 && !R.has(v)) {
|
|
6440
6454
|
const g = o.schemaEnv.baseId + o.errSchemaPath, m = `required property "${v}" is not defined at "${g}" (strictRequired)`;
|
|
6441
6455
|
(0, util_1$h.checkStrictMode)(o, m, o.opts.strictRequired);
|
|
6442
6456
|
}
|
|
@@ -6451,8 +6465,8 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6451
6465
|
function p() {
|
|
6452
6466
|
const N = t.let("missing");
|
|
6453
6467
|
if (d || i) {
|
|
6454
|
-
const
|
|
6455
|
-
e.block$data(
|
|
6468
|
+
const R = t.let("valid", !0);
|
|
6469
|
+
e.block$data(R, () => O(N, R)), e.ok(R);
|
|
6456
6470
|
} else
|
|
6457
6471
|
t.if((0, code_1$6.checkMissingProp)(e, r, N)), (0, code_1$6.reportMissingProp)(e, N), t.else();
|
|
6458
6472
|
}
|
|
@@ -6461,9 +6475,9 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6461
6475
|
e.setParams({ missingProperty: N }), t.if((0, code_1$6.noPropertyInData)(t, s, N, l.ownProperties), () => e.error());
|
|
6462
6476
|
});
|
|
6463
6477
|
}
|
|
6464
|
-
function O(N,
|
|
6478
|
+
function O(N, R) {
|
|
6465
6479
|
e.setParams({ missingProperty: N }), t.forOf(N, n, () => {
|
|
6466
|
-
t.assign(
|
|
6480
|
+
t.assign(R, (0, code_1$6.propertyInData)(t, s, N, l.ownProperties)), t.if((0, codegen_1$f.not)(R), () => {
|
|
6467
6481
|
e.error(), t.break();
|
|
6468
6482
|
});
|
|
6469
6483
|
}, codegen_1$f.nil);
|
|
@@ -6513,23 +6527,23 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
|
|
|
6513
6527
|
const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
|
|
6514
6528
|
e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
|
|
6515
6529
|
function p() {
|
|
6516
|
-
const
|
|
6517
|
-
e.setParams({ i:
|
|
6530
|
+
const R = t.let("i", (0, codegen_1$d._)`${r}.length`), v = t.let("j");
|
|
6531
|
+
e.setParams({ i: R, j: v }), t.assign(d, !0), t.if((0, codegen_1$d._)`${R} > 1`, () => ($() ? O : N)(R, v));
|
|
6518
6532
|
}
|
|
6519
6533
|
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._)`${
|
|
6534
|
+
return u.length > 0 && !u.some((R) => R === "object" || R === "array");
|
|
6535
|
+
}
|
|
6536
|
+
function O(R, v) {
|
|
6537
|
+
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._)`{}`);
|
|
6538
|
+
t.for((0, codegen_1$d._)`;${R}--;`, () => {
|
|
6539
|
+
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"`, () => {
|
|
6540
|
+
t.assign(v, (0, codegen_1$d._)`${T}[${g}]`), e.error(), t.assign(d, !1).break();
|
|
6541
|
+
}).code((0, codegen_1$d._)`${T}[${g}] = ${R}`);
|
|
6528
6542
|
});
|
|
6529
6543
|
}
|
|
6530
|
-
function N(
|
|
6544
|
+
function N(R, v) {
|
|
6531
6545
|
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._)`;${
|
|
6546
|
+
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
6547
|
e.error(), t.assign(d, !1).break(m);
|
|
6534
6548
|
})));
|
|
6535
6549
|
}
|
|
@@ -6575,15 +6589,15 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
|
|
|
6575
6589
|
if (!Array.isArray(s))
|
|
6576
6590
|
throw new Error("ajv implementation error");
|
|
6577
6591
|
const N = t.const("vSchema", i);
|
|
6578
|
-
p = (0, codegen_1$b.or)(...s.map((
|
|
6592
|
+
p = (0, codegen_1$b.or)(...s.map((R, v) => O(N, v)));
|
|
6579
6593
|
}
|
|
6580
6594
|
e.pass(p);
|
|
6581
6595
|
function $() {
|
|
6582
6596
|
t.assign(p, !1), t.forOf("v", i, (N) => t.if((0, codegen_1$b._)`${u()}(${r}, ${N})`, () => t.assign(p, !0).break()));
|
|
6583
6597
|
}
|
|
6584
|
-
function O(N,
|
|
6585
|
-
const v = s[
|
|
6586
|
-
return typeof v == "object" && v !== null ? (0, codegen_1$b._)`${u()}(${r}, ${N}[${
|
|
6598
|
+
function O(N, R) {
|
|
6599
|
+
const v = s[R];
|
|
6600
|
+
return typeof v == "object" && v !== null ? (0, codegen_1$b._)`${u()}(${r}, ${N}[${R}])` : (0, codegen_1$b._)`${r} === ${v}`;
|
|
6587
6601
|
}
|
|
6588
6602
|
}
|
|
6589
6603
|
};
|
|
@@ -6675,9 +6689,9 @@ function validateTuple(e, t, r = e.schema) {
|
|
|
6675
6689
|
}, d)), e.ok(d));
|
|
6676
6690
|
});
|
|
6677
6691
|
function p($) {
|
|
6678
|
-
const { opts: O, errSchemaPath: N } = l,
|
|
6692
|
+
const { opts: O, errSchemaPath: N } = l, R = r.length, v = R === $.minItems && (R === $.maxItems || $[t] === !1);
|
|
6679
6693
|
if (O.strictTuples && !v) {
|
|
6680
|
-
const g = `"${o}" is ${
|
|
6694
|
+
const g = `"${o}" is ${R}-tuple, but minItems or maxItems/${t} are not specified or different at path "${N}"`;
|
|
6681
6695
|
(0, util_1$c.checkStrictMode)(l, g, O.strictTuples);
|
|
6682
6696
|
}
|
|
6683
6697
|
}
|
|
@@ -6746,7 +6760,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6746
6760
|
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
6761
|
function O() {
|
|
6748
6762
|
const v = t.name("_valid"), g = t.let("count", 0);
|
|
6749
|
-
N(v, () => t.if(v, () =>
|
|
6763
|
+
N(v, () => t.if(v, () => R(g)));
|
|
6750
6764
|
}
|
|
6751
6765
|
function N(v, g) {
|
|
6752
6766
|
t.forRange("i", 0, p, (m) => {
|
|
@@ -6758,7 +6772,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6758
6772
|
}, v), g();
|
|
6759
6773
|
});
|
|
6760
6774
|
}
|
|
6761
|
-
function
|
|
6775
|
+
function R(v) {
|
|
6762
6776
|
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
6777
|
}
|
|
6764
6778
|
}
|
|
@@ -6804,13 +6818,13 @@ var dependencies = {};
|
|
|
6804
6818
|
if (Object.keys(u).length === 0)
|
|
6805
6819
|
return;
|
|
6806
6820
|
const N = p.let("missing");
|
|
6807
|
-
for (const
|
|
6808
|
-
const v = u[
|
|
6821
|
+
for (const R in u) {
|
|
6822
|
+
const v = u[R];
|
|
6809
6823
|
if (v.length === 0)
|
|
6810
6824
|
continue;
|
|
6811
|
-
const g = (0, n.propertyInData)(p, $,
|
|
6825
|
+
const g = (0, n.propertyInData)(p, $, R, O.opts.ownProperties);
|
|
6812
6826
|
d.setParams({
|
|
6813
|
-
property:
|
|
6827
|
+
property: R,
|
|
6814
6828
|
depsCount: v.length,
|
|
6815
6829
|
deps: v.join(", ")
|
|
6816
6830
|
}), O.allErrors ? p.if(g, () => {
|
|
@@ -6821,17 +6835,17 @@ var dependencies = {};
|
|
|
6821
6835
|
}
|
|
6822
6836
|
e.validatePropertyDeps = o;
|
|
6823
6837
|
function l(d, u = d.schema) {
|
|
6824
|
-
const { gen: p, data: $, keyword: O, it: N } = d,
|
|
6838
|
+
const { gen: p, data: $, keyword: O, it: N } = d, R = p.name("valid");
|
|
6825
6839
|
for (const v in u)
|
|
6826
6840
|
(0, r.alwaysValidSchema)(N, u[v]) || (p.if(
|
|
6827
6841
|
(0, n.propertyInData)(p, $, v, N.opts.ownProperties),
|
|
6828
6842
|
() => {
|
|
6829
|
-
const g = d.subschema({ keyword: O, schemaProp: v },
|
|
6830
|
-
d.mergeValidEvaluated(g,
|
|
6843
|
+
const g = d.subschema({ keyword: O, schemaProp: v }, R);
|
|
6844
|
+
d.mergeValidEvaluated(g, R);
|
|
6831
6845
|
},
|
|
6832
|
-
() => p.var(
|
|
6846
|
+
() => p.var(R, !0)
|
|
6833
6847
|
// TODO var
|
|
6834
|
-
), d.ok(
|
|
6848
|
+
), d.ok(R));
|
|
6835
6849
|
}
|
|
6836
6850
|
e.validateSchemaDeps = l, e.default = s;
|
|
6837
6851
|
})(dependencies);
|
|
@@ -6887,22 +6901,22 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6887
6901
|
$(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
|
|
6888
6902
|
function $() {
|
|
6889
6903
|
t.forIn("key", s, (g) => {
|
|
6890
|
-
!u.length && !p.length ?
|
|
6904
|
+
!u.length && !p.length ? R(g) : t.if(O(g), () => R(g));
|
|
6891
6905
|
});
|
|
6892
6906
|
}
|
|
6893
6907
|
function O(g) {
|
|
6894
6908
|
let m;
|
|
6895
6909
|
if (u.length > 8) {
|
|
6896
|
-
const
|
|
6897
|
-
m = (0, code_1$3.isOwnProperty)(t,
|
|
6910
|
+
const T = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
|
|
6911
|
+
m = (0, code_1$3.isOwnProperty)(t, T, g);
|
|
6898
6912
|
} 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((
|
|
6913
|
+
u.length ? m = (0, codegen_1$5.or)(...u.map((T) => (0, codegen_1$5._)`${g} === ${T}`)) : m = codegen_1$5.nil;
|
|
6914
|
+
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
6915
|
}
|
|
6902
6916
|
function N(g) {
|
|
6903
6917
|
t.code((0, codegen_1$5._)`delete ${s}[${g}]`);
|
|
6904
6918
|
}
|
|
6905
|
-
function
|
|
6919
|
+
function R(g) {
|
|
6906
6920
|
if (d.removeAdditional === "all" || d.removeAdditional && r === !1) {
|
|
6907
6921
|
N(g);
|
|
6908
6922
|
return;
|
|
@@ -6918,13 +6932,13 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6918
6932
|
})) : (v(g, m), l || t.if((0, codegen_1$5.not)(m), () => t.break()));
|
|
6919
6933
|
}
|
|
6920
6934
|
}
|
|
6921
|
-
function v(g, m,
|
|
6935
|
+
function v(g, m, T) {
|
|
6922
6936
|
const S = {
|
|
6923
6937
|
keyword: "additionalProperties",
|
|
6924
6938
|
dataProp: g,
|
|
6925
6939
|
dataPropType: util_1$8.Type.Str
|
|
6926
6940
|
};
|
|
6927
|
-
|
|
6941
|
+
T === !1 && Object.assign(S, {
|
|
6928
6942
|
compositeRule: !0,
|
|
6929
6943
|
createErrors: !1,
|
|
6930
6944
|
allErrors: !1
|
|
@@ -6981,13 +6995,13 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
|
|
|
6981
6995
|
O();
|
|
6982
6996
|
function O() {
|
|
6983
6997
|
for (const v of l)
|
|
6984
|
-
u && N(v), i.allErrors ?
|
|
6998
|
+
u && N(v), i.allErrors ? R(v) : (t.var(p, !0), R(v), t.if(p));
|
|
6985
6999
|
}
|
|
6986
7000
|
function N(v) {
|
|
6987
7001
|
for (const g in u)
|
|
6988
7002
|
new RegExp(v).test(g) && (0, util_1$6.checkStrictMode)(i, `property ${g} matches pattern ${v} (use allowMatchingProperties)`);
|
|
6989
7003
|
}
|
|
6990
|
-
function
|
|
7004
|
+
function R(v) {
|
|
6991
7005
|
t.forIn("key", n, (g) => {
|
|
6992
7006
|
t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, v)}.test(${g})`, () => {
|
|
6993
7007
|
const m = d.includes(v);
|
|
@@ -7181,12 +7195,12 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7181
7195
|
return;
|
|
7182
7196
|
s ? O() : N();
|
|
7183
7197
|
function O() {
|
|
7184
|
-
const
|
|
7198
|
+
const R = r.scopeValue("formats", {
|
|
7185
7199
|
ref: $.formats,
|
|
7186
7200
|
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
|
|
7201
|
+
}), v = r.const("fDef", (0, codegen_1$1._)`${R}[${o}]`), g = r.let("fType"), m = r.let("format");
|
|
7202
|
+
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()));
|
|
7203
|
+
function T() {
|
|
7190
7204
|
return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${m}`;
|
|
7191
7205
|
}
|
|
7192
7206
|
function S() {
|
|
@@ -7195,16 +7209,16 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7195
7209
|
}
|
|
7196
7210
|
}
|
|
7197
7211
|
function N() {
|
|
7198
|
-
const
|
|
7199
|
-
if (!
|
|
7200
|
-
|
|
7212
|
+
const R = $.formats[i];
|
|
7213
|
+
if (!R) {
|
|
7214
|
+
T();
|
|
7201
7215
|
return;
|
|
7202
7216
|
}
|
|
7203
|
-
if (
|
|
7217
|
+
if (R === !0)
|
|
7204
7218
|
return;
|
|
7205
|
-
const [v, g, m] = S(
|
|
7219
|
+
const [v, g, m] = S(R);
|
|
7206
7220
|
v === t && e.pass(I());
|
|
7207
|
-
function
|
|
7221
|
+
function T() {
|
|
7208
7222
|
if (d.strictSchema === !1) {
|
|
7209
7223
|
$.logger.warn(D());
|
|
7210
7224
|
return;
|
|
@@ -7219,7 +7233,7 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7219
7233
|
return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${k}.validate`] : ["string", D, k];
|
|
7220
7234
|
}
|
|
7221
7235
|
function I() {
|
|
7222
|
-
if (typeof
|
|
7236
|
+
if (typeof R == "object" && !(R instanceof RegExp) && R.async) {
|
|
7223
7237
|
if (!p.$async)
|
|
7224
7238
|
throw new Error("async format in sync schema");
|
|
7225
7239
|
return (0, codegen_1$1._)`await ${m}(${n})`;
|
|
@@ -7291,17 +7305,17 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7291
7305
|
function p() {
|
|
7292
7306
|
const N = O();
|
|
7293
7307
|
t.if(!1);
|
|
7294
|
-
for (const
|
|
7295
|
-
t.elseIf((0, codegen_1._)`${u} === ${
|
|
7308
|
+
for (const R in N)
|
|
7309
|
+
t.elseIf((0, codegen_1._)`${u} === ${R}`), t.assign(d, $(N[R]));
|
|
7296
7310
|
t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: l }), t.endIf();
|
|
7297
7311
|
}
|
|
7298
7312
|
function $(N) {
|
|
7299
|
-
const
|
|
7300
|
-
return e.mergeEvaluated(v, codegen_1.Name),
|
|
7313
|
+
const R = t.name("valid"), v = e.subschema({ keyword: "oneOf", schemaProp: N }, R);
|
|
7314
|
+
return e.mergeEvaluated(v, codegen_1.Name), R;
|
|
7301
7315
|
}
|
|
7302
7316
|
function O() {
|
|
7303
7317
|
var N;
|
|
7304
|
-
const
|
|
7318
|
+
const R = {}, v = m(s);
|
|
7305
7319
|
let g = !0;
|
|
7306
7320
|
for (let I = 0; I < o.length; I++) {
|
|
7307
7321
|
let D = o[I];
|
|
@@ -7309,15 +7323,15 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7309
7323
|
const w = (N = D == null ? void 0 : D.properties) === null || N === void 0 ? void 0 : N[l];
|
|
7310
7324
|
if (typeof w != "object")
|
|
7311
7325
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
|
|
7312
|
-
g = g && (v || m(D)),
|
|
7326
|
+
g = g && (v || m(D)), T(w, I);
|
|
7313
7327
|
}
|
|
7314
7328
|
if (!g)
|
|
7315
7329
|
throw new Error(`discriminator: "${l}" must be required`);
|
|
7316
|
-
return
|
|
7330
|
+
return R;
|
|
7317
7331
|
function m({ required: I }) {
|
|
7318
7332
|
return Array.isArray(I) && I.includes(l);
|
|
7319
7333
|
}
|
|
7320
|
-
function
|
|
7334
|
+
function T(I, D) {
|
|
7321
7335
|
if (I.const)
|
|
7322
7336
|
S(I.const, D);
|
|
7323
7337
|
else if (I.enum)
|
|
@@ -7327,9 +7341,9 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7327
7341
|
throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);
|
|
7328
7342
|
}
|
|
7329
7343
|
function S(I, D) {
|
|
7330
|
-
if (typeof I != "string" || I in
|
|
7344
|
+
if (typeof I != "string" || I in R)
|
|
7331
7345
|
throw new Error(`discriminator: "${l}" values must be unique strings`);
|
|
7332
|
-
|
|
7346
|
+
R[I] = D;
|
|
7333
7347
|
}
|
|
7334
7348
|
}
|
|
7335
7349
|
}
|
|
@@ -7581,13 +7595,13 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
|
|
|
7581
7595
|
const r = core$2, n = draft7, s = discriminator, i = require$$3, o = ["/properties"], l = "http://json-schema.org/draft-07/schema";
|
|
7582
7596
|
class d extends r.default {
|
|
7583
7597
|
_addVocabularies() {
|
|
7584
|
-
super._addVocabularies(), n.default.forEach((
|
|
7598
|
+
super._addVocabularies(), n.default.forEach((R) => this.addVocabulary(R)), this.opts.discriminator && this.addKeyword(s.default);
|
|
7585
7599
|
}
|
|
7586
7600
|
_addDefaultMetaSchema() {
|
|
7587
7601
|
if (super._addDefaultMetaSchema(), !this.opts.meta)
|
|
7588
7602
|
return;
|
|
7589
|
-
const
|
|
7590
|
-
this.addMetaSchema(
|
|
7603
|
+
const R = this.opts.$data ? this.$dataMetaSchema(i, o) : i;
|
|
7604
|
+
this.addMetaSchema(R, l, !1), this.refs["http://json-schema.org/schema"] = l;
|
|
7591
7605
|
}
|
|
7592
7606
|
defaultMeta() {
|
|
7593
7607
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(l) ? l : void 0);
|
|
@@ -7632,7 +7646,38 @@ const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports), $schema = "http
|
|
|
7632
7646
|
},
|
|
7633
7647
|
description: {
|
|
7634
7648
|
type: "string",
|
|
7635
|
-
description: "Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what."
|
|
7649
|
+
description: "Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what.",
|
|
7650
|
+
deprecated: "Use meta.description instead."
|
|
7651
|
+
},
|
|
7652
|
+
meta: {
|
|
7653
|
+
type: "object",
|
|
7654
|
+
properties: {
|
|
7655
|
+
title: {
|
|
7656
|
+
type: "string",
|
|
7657
|
+
description: "A clear and concise name for your Blueprint."
|
|
7658
|
+
},
|
|
7659
|
+
description: {
|
|
7660
|
+
type: "string",
|
|
7661
|
+
description: "A brief explanation of what your Blueprint offers."
|
|
7662
|
+
},
|
|
7663
|
+
author: {
|
|
7664
|
+
type: "string",
|
|
7665
|
+
description: "A GitHub username of the author of this Blueprint."
|
|
7666
|
+
},
|
|
7667
|
+
categories: {
|
|
7668
|
+
type: "array",
|
|
7669
|
+
items: {
|
|
7670
|
+
type: "string"
|
|
7671
|
+
},
|
|
7672
|
+
description: "Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."
|
|
7673
|
+
}
|
|
7674
|
+
},
|
|
7675
|
+
required: [
|
|
7676
|
+
"title",
|
|
7677
|
+
"author"
|
|
7678
|
+
],
|
|
7679
|
+
additionalProperties: !1,
|
|
7680
|
+
description: "Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"
|
|
7636
7681
|
},
|
|
7637
7682
|
preferredVersions: {
|
|
7638
7683
|
type: "object",
|
|
@@ -8909,46 +8954,129 @@ for existing apps using this option.`
|
|
|
8909
8954
|
$ref: "#/definitions/PHPRequestHeaders",
|
|
8910
8955
|
description: "Request headers."
|
|
8911
8956
|
},
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8957
|
+
body: {
|
|
8958
|
+
anyOf: [
|
|
8959
|
+
{
|
|
8960
|
+
type: "string"
|
|
8961
|
+
},
|
|
8962
|
+
{
|
|
8963
|
+
type: "object",
|
|
8964
|
+
properties: {
|
|
8965
|
+
BYTES_PER_ELEMENT: {
|
|
8966
|
+
type: "number"
|
|
8967
|
+
},
|
|
8968
|
+
buffer: {
|
|
8969
|
+
type: "object",
|
|
8970
|
+
properties: {
|
|
8971
|
+
byteLength: {
|
|
8972
|
+
type: "number"
|
|
8973
|
+
}
|
|
8974
|
+
},
|
|
8975
|
+
required: [
|
|
8976
|
+
"byteLength"
|
|
8977
|
+
],
|
|
8978
|
+
additionalProperties: !1
|
|
8979
|
+
},
|
|
8980
|
+
byteLength: {
|
|
8981
|
+
type: "number"
|
|
8982
|
+
},
|
|
8983
|
+
byteOffset: {
|
|
8984
|
+
type: "number"
|
|
8985
|
+
},
|
|
8986
|
+
length: {
|
|
8987
|
+
type: "number"
|
|
8988
|
+
}
|
|
8922
8989
|
},
|
|
8923
|
-
|
|
8990
|
+
required: [
|
|
8991
|
+
"BYTES_PER_ELEMENT",
|
|
8992
|
+
"buffer",
|
|
8993
|
+
"byteLength",
|
|
8994
|
+
"byteOffset",
|
|
8995
|
+
"length"
|
|
8996
|
+
],
|
|
8997
|
+
additionalProperties: {
|
|
8924
8998
|
type: "number"
|
|
8925
|
-
},
|
|
8926
|
-
name: {
|
|
8927
|
-
type: "string"
|
|
8928
|
-
},
|
|
8929
|
-
webkitRelativePath: {
|
|
8930
|
-
type: "string"
|
|
8931
8999
|
}
|
|
8932
9000
|
},
|
|
8933
|
-
|
|
8934
|
-
"
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
9001
|
+
{
|
|
9002
|
+
type: "object",
|
|
9003
|
+
additionalProperties: {
|
|
9004
|
+
anyOf: [
|
|
9005
|
+
{
|
|
9006
|
+
type: "string"
|
|
9007
|
+
},
|
|
9008
|
+
{
|
|
9009
|
+
type: "object",
|
|
9010
|
+
properties: {
|
|
9011
|
+
BYTES_PER_ELEMENT: {
|
|
9012
|
+
type: "number"
|
|
9013
|
+
},
|
|
9014
|
+
buffer: {
|
|
9015
|
+
type: "object",
|
|
9016
|
+
properties: {
|
|
9017
|
+
byteLength: {
|
|
9018
|
+
type: "number"
|
|
9019
|
+
}
|
|
9020
|
+
},
|
|
9021
|
+
required: [
|
|
9022
|
+
"byteLength"
|
|
9023
|
+
],
|
|
9024
|
+
additionalProperties: !1
|
|
9025
|
+
},
|
|
9026
|
+
byteLength: {
|
|
9027
|
+
type: "number"
|
|
9028
|
+
},
|
|
9029
|
+
byteOffset: {
|
|
9030
|
+
type: "number"
|
|
9031
|
+
},
|
|
9032
|
+
length: {
|
|
9033
|
+
type: "number"
|
|
9034
|
+
}
|
|
9035
|
+
},
|
|
9036
|
+
required: [
|
|
9037
|
+
"BYTES_PER_ELEMENT",
|
|
9038
|
+
"buffer",
|
|
9039
|
+
"byteLength",
|
|
9040
|
+
"byteOffset",
|
|
9041
|
+
"length"
|
|
9042
|
+
],
|
|
9043
|
+
additionalProperties: {
|
|
9044
|
+
type: "number"
|
|
9045
|
+
}
|
|
9046
|
+
},
|
|
9047
|
+
{
|
|
9048
|
+
type: "object",
|
|
9049
|
+
properties: {
|
|
9050
|
+
size: {
|
|
9051
|
+
type: "number"
|
|
9052
|
+
},
|
|
9053
|
+
type: {
|
|
9054
|
+
type: "string"
|
|
9055
|
+
},
|
|
9056
|
+
lastModified: {
|
|
9057
|
+
type: "number"
|
|
9058
|
+
},
|
|
9059
|
+
name: {
|
|
9060
|
+
type: "string"
|
|
9061
|
+
},
|
|
9062
|
+
webkitRelativePath: {
|
|
9063
|
+
type: "string"
|
|
9064
|
+
}
|
|
9065
|
+
},
|
|
9066
|
+
required: [
|
|
9067
|
+
"lastModified",
|
|
9068
|
+
"name",
|
|
9069
|
+
"size",
|
|
9070
|
+
"type",
|
|
9071
|
+
"webkitRelativePath"
|
|
9072
|
+
],
|
|
9073
|
+
additionalProperties: !1
|
|
9074
|
+
}
|
|
9075
|
+
]
|
|
9076
|
+
}
|
|
9077
|
+
}
|
|
9078
|
+
],
|
|
9079
|
+
description: "Request body. If an object is given, the request will be encoded as multipart and sent with a `multipart/form-data` header."
|
|
8952
9080
|
}
|
|
8953
9081
|
},
|
|
8954
9082
|
required: [
|
|
@@ -8998,85 +9126,68 @@ for existing apps using this option.`
|
|
|
8998
9126
|
description: "Request headers."
|
|
8999
9127
|
},
|
|
9000
9128
|
body: {
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
fileInfos: {
|
|
9005
|
-
type: "array",
|
|
9006
|
-
items: {
|
|
9007
|
-
$ref: "#/definitions/FileInfo"
|
|
9008
|
-
},
|
|
9009
|
-
description: "Uploaded files."
|
|
9010
|
-
},
|
|
9011
|
-
code: {
|
|
9012
|
-
type: "string",
|
|
9013
|
-
description: "The code snippet to eval instead of a php file."
|
|
9014
|
-
},
|
|
9015
|
-
throwOnError: {
|
|
9016
|
-
type: "boolean",
|
|
9017
|
-
description: "Whether to throw an error if the PHP process exits with a non-zero code or outputs to stderr."
|
|
9018
|
-
}
|
|
9019
|
-
},
|
|
9020
|
-
additionalProperties: !1
|
|
9021
|
-
},
|
|
9022
|
-
FileInfo: {
|
|
9023
|
-
type: "object",
|
|
9024
|
-
properties: {
|
|
9025
|
-
key: {
|
|
9026
|
-
type: "string"
|
|
9027
|
-
},
|
|
9028
|
-
name: {
|
|
9029
|
-
type: "string"
|
|
9030
|
-
},
|
|
9031
|
-
type: {
|
|
9032
|
-
type: "string"
|
|
9033
|
-
},
|
|
9034
|
-
data: {
|
|
9035
|
-
type: "object",
|
|
9036
|
-
properties: {
|
|
9037
|
-
BYTES_PER_ELEMENT: {
|
|
9038
|
-
type: "number"
|
|
9129
|
+
anyOf: [
|
|
9130
|
+
{
|
|
9131
|
+
type: "string"
|
|
9039
9132
|
},
|
|
9040
|
-
|
|
9133
|
+
{
|
|
9041
9134
|
type: "object",
|
|
9042
9135
|
properties: {
|
|
9136
|
+
BYTES_PER_ELEMENT: {
|
|
9137
|
+
type: "number"
|
|
9138
|
+
},
|
|
9139
|
+
buffer: {
|
|
9140
|
+
type: "object",
|
|
9141
|
+
properties: {
|
|
9142
|
+
byteLength: {
|
|
9143
|
+
type: "number"
|
|
9144
|
+
}
|
|
9145
|
+
},
|
|
9146
|
+
required: [
|
|
9147
|
+
"byteLength"
|
|
9148
|
+
],
|
|
9149
|
+
additionalProperties: !1
|
|
9150
|
+
},
|
|
9043
9151
|
byteLength: {
|
|
9044
9152
|
type: "number"
|
|
9153
|
+
},
|
|
9154
|
+
byteOffset: {
|
|
9155
|
+
type: "number"
|
|
9156
|
+
},
|
|
9157
|
+
length: {
|
|
9158
|
+
type: "number"
|
|
9045
9159
|
}
|
|
9046
9160
|
},
|
|
9047
9161
|
required: [
|
|
9048
|
-
"
|
|
9162
|
+
"BYTES_PER_ELEMENT",
|
|
9163
|
+
"buffer",
|
|
9164
|
+
"byteLength",
|
|
9165
|
+
"byteOffset",
|
|
9166
|
+
"length"
|
|
9049
9167
|
],
|
|
9050
|
-
additionalProperties:
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
type: "number"
|
|
9054
|
-
},
|
|
9055
|
-
byteOffset: {
|
|
9056
|
-
type: "number"
|
|
9057
|
-
},
|
|
9058
|
-
length: {
|
|
9059
|
-
type: "number"
|
|
9168
|
+
additionalProperties: {
|
|
9169
|
+
type: "number"
|
|
9170
|
+
}
|
|
9060
9171
|
}
|
|
9061
|
-
},
|
|
9062
|
-
required: [
|
|
9063
|
-
"BYTES_PER_ELEMENT",
|
|
9064
|
-
"buffer",
|
|
9065
|
-
"byteLength",
|
|
9066
|
-
"byteOffset",
|
|
9067
|
-
"length"
|
|
9068
9172
|
],
|
|
9173
|
+
description: "Request body."
|
|
9174
|
+
},
|
|
9175
|
+
env: {
|
|
9176
|
+
type: "object",
|
|
9069
9177
|
additionalProperties: {
|
|
9070
|
-
type: "
|
|
9071
|
-
}
|
|
9178
|
+
type: "string"
|
|
9179
|
+
},
|
|
9180
|
+
description: "Environment variables to set for this run."
|
|
9181
|
+
},
|
|
9182
|
+
code: {
|
|
9183
|
+
type: "string",
|
|
9184
|
+
description: "The code snippet to eval instead of a php file."
|
|
9185
|
+
},
|
|
9186
|
+
throwOnError: {
|
|
9187
|
+
type: "boolean",
|
|
9188
|
+
description: "Whether to throw an error if the PHP process exits with a non-zero code or outputs to stderr."
|
|
9072
9189
|
}
|
|
9073
9190
|
},
|
|
9074
|
-
required: [
|
|
9075
|
-
"key",
|
|
9076
|
-
"name",
|
|
9077
|
-
"type",
|
|
9078
|
-
"data"
|
|
9079
|
-
],
|
|
9080
9191
|
additionalProperties: !1
|
|
9081
9192
|
},
|
|
9082
9193
|
WordPressInstallationOptions: {
|
|
@@ -9105,7 +9216,7 @@ function compileBlueprint(e, {
|
|
|
9105
9216
|
onStepCompleted: n = () => {
|
|
9106
9217
|
}
|
|
9107
9218
|
} = {}) {
|
|
9108
|
-
var p, $, O, N,
|
|
9219
|
+
var p, $, O, N, R;
|
|
9109
9220
|
if (e = {
|
|
9110
9221
|
...e,
|
|
9111
9222
|
steps: (e.steps || []).filter(isStepDefinition)
|
|
@@ -9190,21 +9301,21 @@ function compileBlueprint(e, {
|
|
|
9190
9301
|
),
|
|
9191
9302
|
features: {
|
|
9192
9303
|
// Disable networking by default
|
|
9193
|
-
networking: ((
|
|
9304
|
+
networking: ((R = e.features) == null ? void 0 : R.networking) ?? !1
|
|
9194
9305
|
},
|
|
9195
9306
|
run: async (v) => {
|
|
9196
9307
|
try {
|
|
9197
9308
|
for (const { resources: g } of u)
|
|
9198
9309
|
for (const m of g)
|
|
9199
9310
|
m.setPlayground(v), m.isAsync && m.resolve();
|
|
9200
|
-
for (const [g, { run: m, step:
|
|
9311
|
+
for (const [g, { run: m, step: T }] of Object.entries(u))
|
|
9201
9312
|
try {
|
|
9202
9313
|
const S = await m(v);
|
|
9203
|
-
n(S,
|
|
9314
|
+
n(S, T);
|
|
9204
9315
|
} catch (S) {
|
|
9205
9316
|
throw console.error(S), new Error(
|
|
9206
9317
|
`Error when executing the blueprint step #${g} (${JSON.stringify(
|
|
9207
|
-
|
|
9318
|
+
T
|
|
9208
9319
|
)}) ${S instanceof Error ? `: ${S.message}` : S}`,
|
|
9209
9320
|
{ cause: S }
|
|
9210
9321
|
);
|