@wp-playground/blueprints 0.6.7 → 0.6.9
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 +188 -97
- package/index.cjs +17 -17
- package/index.d.ts +34 -9
- package/index.js +357 -265
- package/lib/steps/activate-theme.d.ts +1 -2
- package/lib/steps/wp-cli.d.ts +1 -1
- package/package.json +2 -2
- package/schema-readme.md +1 -1
package/index.js
CHANGED
|
@@ -269,7 +269,6 @@ const activatePlugin = async (e, { pluginPath: t, pluginName: r }, n) => {
|
|
|
269
269
|
n == null || n.tracker.setCaption(`Activating ${r || t}`);
|
|
270
270
|
const s = await e.documentRoot;
|
|
271
271
|
await e.run({
|
|
272
|
-
throwOnError: !0,
|
|
273
272
|
code: `<?php
|
|
274
273
|
define( 'WP_ADMIN', true );
|
|
275
274
|
require_once( ${phpVar(s)}. "/wp-load.php" );
|
|
@@ -301,7 +300,6 @@ exit(1);
|
|
|
301
300
|
r == null || r.tracker.setCaption(`Activating ${t}`);
|
|
302
301
|
const n = await e.documentRoot;
|
|
303
302
|
await e.run({
|
|
304
|
-
throwOnError: !0,
|
|
305
303
|
code: `<?php
|
|
306
304
|
define( 'WP_ADMIN', true );
|
|
307
305
|
require_once( ${phpVar(n)}. "/wp-load.php" );
|
|
@@ -312,7 +310,7 @@ set_current_user( get_users(array('role' => 'Administrator') )[0] );
|
|
|
312
310
|
switch_theme( ${phpVar(t)} );
|
|
313
311
|
`
|
|
314
312
|
});
|
|
315
|
-
}, runPHP = async (e, { code: t }) => await e.run({ code: t
|
|
313
|
+
}, runPHP = async (e, { code: t }) => await e.run({ code: t }), runPHPWithOptions = async (e, { options: t }) => await e.run(t), rm = async (e, { path: t }) => {
|
|
316
314
|
await e.unlink(t);
|
|
317
315
|
}, runSql = async (e, { sql: t }, r) => {
|
|
318
316
|
r == null || r.tracker.setCaption("Executing SQL Queries");
|
|
@@ -712,7 +710,6 @@ async function rewriteDefineCalls(e, t, r) {
|
|
|
712
710
|
consts: r
|
|
713
711
|
});
|
|
714
712
|
return await e.run({
|
|
715
|
-
throwOnError: !0,
|
|
716
713
|
code: `${rewriteWpConfigToDefineConstants}
|
|
717
714
|
$wp_config_path = '/tmp/code.php';
|
|
718
715
|
$wp_config = file_get_contents($wp_config_path);
|
|
@@ -745,7 +742,6 @@ const login = async (e, { username: t = "admin", password: r = "password" } = {}
|
|
|
745
742
|
}, setSiteOptions = async (e, { options: t }) => {
|
|
746
743
|
const r = await e.documentRoot;
|
|
747
744
|
await e.run({
|
|
748
|
-
throwOnError: !0,
|
|
749
745
|
code: `<?php
|
|
750
746
|
include ${phpVar(r)} . '/wp-load.php';
|
|
751
747
|
$site_options = ${phpVar(t)};
|
|
@@ -758,7 +754,6 @@ const login = async (e, { username: t = "admin", password: r = "password" } = {}
|
|
|
758
754
|
}, updateUserMeta = async (e, { meta: t, userId: r }) => {
|
|
759
755
|
const n = await e.documentRoot;
|
|
760
756
|
await e.run({
|
|
761
|
-
throwOnError: !0,
|
|
762
757
|
code: `<?php
|
|
763
758
|
include ${phpVar(n)} . '/wp-load.php';
|
|
764
759
|
$meta = ${phpVar(t)};
|
|
@@ -794,7 +789,6 @@ const enableMultisite = async (e) => {
|
|
|
794
789
|
}
|
|
795
790
|
}), await login(e, {});
|
|
796
791
|
const s = await e.documentRoot, o = (await e.run({
|
|
797
|
-
throwOnError: !0,
|
|
798
792
|
code: `<?php
|
|
799
793
|
define( 'WP_ADMIN', true );
|
|
800
794
|
require_once(${phpVar(s)} . "/wp-load.php");
|
|
@@ -1035,7 +1029,6 @@ function delTree($dir)
|
|
|
1035
1029
|
`;
|
|
1036
1030
|
async function runPhpWithZipFunctions(e, t) {
|
|
1037
1031
|
return await e.run({
|
|
1038
|
-
throwOnError: !0,
|
|
1039
1032
|
code: zipFunctions + t
|
|
1040
1033
|
});
|
|
1041
1034
|
}
|
|
@@ -1101,7 +1094,6 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
|
|
|
1101
1094
|
joinPaths(n, "wp-admin", "upgrade.php")
|
|
1102
1095
|
);
|
|
1103
1096
|
await e.run({
|
|
1104
|
-
throwOnError: !0,
|
|
1105
1097
|
code: `<?php
|
|
1106
1098
|
$_GET['step'] = 'upgrade_db';
|
|
1107
1099
|
require ${u};
|
|
@@ -1734,16 +1726,16 @@ const SupportedPHPVersions = [
|
|
|
1734
1726
|
], SupportedPHPExtensionBundles = {
|
|
1735
1727
|
"kitchen-sink": SupportedPHPExtensionsList
|
|
1736
1728
|
};
|
|
1737
|
-
var
|
|
1729
|
+
var Ae, Ge;
|
|
1738
1730
|
class PHPBrowser {
|
|
1739
1731
|
/**
|
|
1740
1732
|
* @param server - The PHP server to browse.
|
|
1741
1733
|
* @param config - The browser configuration.
|
|
1742
1734
|
*/
|
|
1743
1735
|
constructor(t, r = {}) {
|
|
1744
|
-
Q(this,
|
|
1736
|
+
Q(this, Ae, void 0);
|
|
1745
1737
|
Q(this, Ge, void 0);
|
|
1746
|
-
this.requestHandler = t, te(this,
|
|
1738
|
+
this.requestHandler = t, te(this, Ae, {}), te(this, Ge, {
|
|
1747
1739
|
handleRedirects: !1,
|
|
1748
1740
|
maxRedirects: 4,
|
|
1749
1741
|
...r
|
|
@@ -1809,19 +1801,19 @@ class PHPBrowser {
|
|
|
1809
1801
|
if (!r.includes("="))
|
|
1810
1802
|
continue;
|
|
1811
1803
|
const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
|
|
1812
|
-
H(this,
|
|
1804
|
+
H(this, Ae)[s] = i;
|
|
1813
1805
|
} catch (n) {
|
|
1814
1806
|
console.error(n);
|
|
1815
1807
|
}
|
|
1816
1808
|
}
|
|
1817
1809
|
serializeCookies() {
|
|
1818
1810
|
const t = [];
|
|
1819
|
-
for (const r in H(this,
|
|
1820
|
-
t.push(`${r}=${H(this,
|
|
1811
|
+
for (const r in H(this, Ae))
|
|
1812
|
+
t.push(`${r}=${H(this, Ae)[r]}`);
|
|
1821
1813
|
return t.join("; ");
|
|
1822
1814
|
}
|
|
1823
1815
|
}
|
|
1824
|
-
|
|
1816
|
+
Ae = new WeakMap(), Ge = new WeakMap();
|
|
1825
1817
|
const DEFAULT_BASE_URL = "http://example.com";
|
|
1826
1818
|
function toRelativeUrl(e) {
|
|
1827
1819
|
return e.toString().substring(e.origin.length);
|
|
@@ -1860,7 +1852,7 @@ function fileToUint8Array(e) {
|
|
|
1860
1852
|
}, r.readAsArrayBuffer(e);
|
|
1861
1853
|
});
|
|
1862
1854
|
}
|
|
1863
|
-
var Pe, Ke, dt,
|
|
1855
|
+
var Pe, Ke, dt, De, Je, ve, Qe, Fe, mt, xt, _t, Wt, $t, Bt;
|
|
1864
1856
|
class PHPRequestHandler {
|
|
1865
1857
|
/**
|
|
1866
1858
|
* @param php - The PHP instance.
|
|
@@ -1895,7 +1887,7 @@ class PHPRequestHandler {
|
|
|
1895
1887
|
Q(this, Pe, void 0);
|
|
1896
1888
|
Q(this, Ke, void 0);
|
|
1897
1889
|
Q(this, dt, void 0);
|
|
1898
|
-
Q(this,
|
|
1890
|
+
Q(this, De, void 0);
|
|
1899
1891
|
Q(this, Je, void 0);
|
|
1900
1892
|
Q(this, ve, void 0);
|
|
1901
1893
|
Q(this, Qe, void 0);
|
|
@@ -1903,20 +1895,21 @@ class PHPRequestHandler {
|
|
|
1903
1895
|
te(this, Fe, new Semaphore({ concurrency: 1 }));
|
|
1904
1896
|
const {
|
|
1905
1897
|
documentRoot: n = "/www/",
|
|
1906
|
-
absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : ""
|
|
1898
|
+
absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : "",
|
|
1899
|
+
rewriteRules: i = []
|
|
1907
1900
|
} = r;
|
|
1908
1901
|
this.php = t, te(this, Pe, n);
|
|
1909
|
-
const
|
|
1910
|
-
te(this, dt,
|
|
1911
|
-
const
|
|
1902
|
+
const o = new URL(s);
|
|
1903
|
+
te(this, dt, o.hostname), te(this, De, o.port ? Number(o.port) : o.protocol === "https:" ? 443 : 80), te(this, Ke, (o.protocol || "").replace(":", ""));
|
|
1904
|
+
const l = H(this, De) !== 443 && H(this, De) !== 80;
|
|
1912
1905
|
te(this, Je, [
|
|
1913
1906
|
H(this, dt),
|
|
1914
|
-
|
|
1915
|
-
].join("")), te(this, ve,
|
|
1907
|
+
l ? `:${H(this, De)}` : ""
|
|
1908
|
+
].join("")), te(this, ve, o.pathname.replace(/\/+$/, "")), te(this, Qe, [
|
|
1916
1909
|
`${H(this, Ke)}://`,
|
|
1917
1910
|
H(this, Je),
|
|
1918
1911
|
H(this, ve)
|
|
1919
|
-
].join(""));
|
|
1912
|
+
].join("")), this.rewriteRules = i;
|
|
1920
1913
|
}
|
|
1921
1914
|
/** @inheritDoc */
|
|
1922
1915
|
pathToInternalUrl(t) {
|
|
@@ -1941,16 +1934,17 @@ class PHPRequestHandler {
|
|
|
1941
1934
|
/** @inheritDoc */
|
|
1942
1935
|
async request(t) {
|
|
1943
1936
|
const r = t.url.startsWith("http://") || t.url.startsWith("https://"), n = new URL(
|
|
1944
|
-
|
|
1937
|
+
// Remove the hash part of the URL as it's not meant for the server.
|
|
1938
|
+
t.url.split("#")[0],
|
|
1945
1939
|
r ? void 0 : DEFAULT_BASE_URL
|
|
1946
|
-
), s =
|
|
1947
|
-
n.pathname,
|
|
1948
|
-
|
|
1940
|
+
), s = applyRewriteRules(
|
|
1941
|
+
removePathPrefix(n.pathname, H(this, ve)),
|
|
1942
|
+
this.rewriteRules
|
|
1949
1943
|
), i = `${H(this, Pe)}${s}`;
|
|
1950
1944
|
return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, _t, Wt).call(this, t, n) : ce(this, mt, xt).call(this, i);
|
|
1951
1945
|
}
|
|
1952
1946
|
}
|
|
1953
|
-
Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(),
|
|
1947
|
+
Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(), Je = new WeakMap(), ve = new WeakMap(), Qe = new WeakMap(), Fe = new WeakMap(), mt = new WeakSet(), xt = function(t) {
|
|
1954
1948
|
if (!this.php.fileExists(t))
|
|
1955
1949
|
return new PHPResponse(
|
|
1956
1950
|
404,
|
|
@@ -1976,7 +1970,7 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), Ae = new WeakMap(),
|
|
|
1976
1970
|
r
|
|
1977
1971
|
);
|
|
1978
1972
|
}, _t = new WeakSet(), Wt = async function(t, r) {
|
|
1979
|
-
var s
|
|
1973
|
+
var s;
|
|
1980
1974
|
if (H(this, Fe).running > 0 && ((s = t.headers) == null ? void 0 : s["x-request-issuer"]) === "php")
|
|
1981
1975
|
return console.warn(
|
|
1982
1976
|
"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."
|
|
@@ -1991,28 +1985,20 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), Ae = new WeakMap(),
|
|
|
1991
1985
|
"HTTPS",
|
|
1992
1986
|
H(this, Qe).startsWith("https://") ? "on" : ""
|
|
1993
1987
|
);
|
|
1994
|
-
let
|
|
1995
|
-
const
|
|
1988
|
+
let i = "GET";
|
|
1989
|
+
const o = {
|
|
1996
1990
|
host: H(this, Je),
|
|
1997
1991
|
...normalizeHeaders(t.headers || {})
|
|
1998
1992
|
};
|
|
1999
|
-
let
|
|
2000
|
-
if (typeof
|
|
2001
|
-
|
|
2002
|
-
const { bytes:
|
|
2003
|
-
|
|
1993
|
+
let l = t.body;
|
|
1994
|
+
if (typeof l == "object" && !(l instanceof Uint8Array)) {
|
|
1995
|
+
i = "POST";
|
|
1996
|
+
const { bytes: u, contentType: p } = await encodeAsMultipart(l);
|
|
1997
|
+
l = u, o["content-type"] = p;
|
|
2004
1998
|
}
|
|
2005
|
-
let
|
|
1999
|
+
let d;
|
|
2006
2000
|
try {
|
|
2007
|
-
|
|
2008
|
-
if ((i = t.headers) != null && i["x-rewrite-url"])
|
|
2009
|
-
try {
|
|
2010
|
-
p = new URL(
|
|
2011
|
-
t.headers["x-rewrite-url"]
|
|
2012
|
-
).pathname;
|
|
2013
|
-
} catch {
|
|
2014
|
-
}
|
|
2015
|
-
u = ce(this, $t, Bt).call(this, p);
|
|
2001
|
+
d = ce(this, $t, Bt).call(this, r.pathname);
|
|
2016
2002
|
} catch {
|
|
2017
2003
|
return new PHPResponse(
|
|
2018
2004
|
404,
|
|
@@ -2026,17 +2012,17 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), Ae = new WeakMap(),
|
|
|
2026
2012
|
H(this, ve)
|
|
2027
2013
|
),
|
|
2028
2014
|
protocol: H(this, Ke),
|
|
2029
|
-
method: t.method ||
|
|
2030
|
-
body:
|
|
2031
|
-
scriptPath:
|
|
2032
|
-
headers:
|
|
2015
|
+
method: t.method || i,
|
|
2016
|
+
body: l,
|
|
2017
|
+
scriptPath: d,
|
|
2018
|
+
headers: o
|
|
2033
2019
|
});
|
|
2034
2020
|
} finally {
|
|
2035
2021
|
n();
|
|
2036
2022
|
}
|
|
2037
2023
|
}, $t = new WeakSet(), Bt = function(t) {
|
|
2038
2024
|
let r = removePathPrefix(t, H(this, ve));
|
|
2039
|
-
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";
|
|
2025
|
+
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";
|
|
2040
2026
|
const n = `${H(this, Pe)}${r}`;
|
|
2041
2027
|
if (this.php.fileExists(n))
|
|
2042
2028
|
return n;
|
|
@@ -2091,6 +2077,12 @@ function seemsLikeAPHPFile(e) {
|
|
|
2091
2077
|
function seemsLikeADirectoryRoot(e) {
|
|
2092
2078
|
return !e.split("/").pop().includes(".");
|
|
2093
2079
|
}
|
|
2080
|
+
function applyRewriteRules(e, t) {
|
|
2081
|
+
for (const r of t)
|
|
2082
|
+
if (new RegExp(r.match).test(e))
|
|
2083
|
+
return e.replace(r.match, r.replacement);
|
|
2084
|
+
return e;
|
|
2085
|
+
}
|
|
2094
2086
|
const FileErrorCodes = {
|
|
2095
2087
|
0: "No error occurred. System call completed successfully.",
|
|
2096
2088
|
1: "Argument list too long.",
|
|
@@ -2354,7 +2346,7 @@ class BasePHP {
|
|
|
2354
2346
|
for (const l in i)
|
|
2355
2347
|
ce(this, Tt, rr).call(this, l, i[l]);
|
|
2356
2348
|
const o = await ce(this, Ot, sr).call(this);
|
|
2357
|
-
if (
|
|
2349
|
+
if (o.exitCode !== 0) {
|
|
2358
2350
|
const l = {
|
|
2359
2351
|
stdout: o.text,
|
|
2360
2352
|
stderr: o.errors
|
|
@@ -2363,9 +2355,16 @@ class BasePHP {
|
|
|
2363
2355
|
const d = new Error(
|
|
2364
2356
|
`PHP.run() failed with exit code ${o.exitCode} and the following output: ` + o.errors
|
|
2365
2357
|
);
|
|
2366
|
-
throw d.output = l, console.error(d), d;
|
|
2358
|
+
throw d.output = l, d.source = "request", console.error(d), d;
|
|
2367
2359
|
}
|
|
2368
2360
|
return o;
|
|
2361
|
+
} catch (n) {
|
|
2362
|
+
throw this.dispatchEvent({
|
|
2363
|
+
type: "request.error",
|
|
2364
|
+
error: n,
|
|
2365
|
+
// Distinguish between PHP request and PHP-wasm errors
|
|
2366
|
+
source: n.source ?? "php-wasm"
|
|
2367
|
+
}), n;
|
|
2369
2368
|
} finally {
|
|
2370
2369
|
try {
|
|
2371
2370
|
r && this[__private__dont__use].free(r);
|
|
@@ -3453,7 +3452,7 @@ var scope = {};
|
|
|
3453
3452
|
return ue(a, this.to);
|
|
3454
3453
|
}
|
|
3455
3454
|
}
|
|
3456
|
-
class
|
|
3455
|
+
class D extends T {
|
|
3457
3456
|
constructor(a, h, C, M) {
|
|
3458
3457
|
super(), this.loop = a, this.varKind = h, this.name = C, this.iterable = M;
|
|
3459
3458
|
}
|
|
@@ -3483,7 +3482,7 @@ var scope = {};
|
|
|
3483
3482
|
}
|
|
3484
3483
|
}
|
|
3485
3484
|
k.kind = "return";
|
|
3486
|
-
class
|
|
3485
|
+
class A extends R {
|
|
3487
3486
|
render(a) {
|
|
3488
3487
|
let h = "try" + super.render(a);
|
|
3489
3488
|
return this.catch && (h += this.catch.render(a)), this.finally && (h += this.finally.render(a)), h;
|
|
@@ -3626,7 +3625,7 @@ var scope = {};
|
|
|
3626
3625
|
this.var(q, (0, t._)`${W}[${G}]`), C(q);
|
|
3627
3626
|
});
|
|
3628
3627
|
}
|
|
3629
|
-
return this._for(new
|
|
3628
|
+
return this._for(new D("of", M, q, h), () => C(q));
|
|
3630
3629
|
}
|
|
3631
3630
|
// `for-in` statement.
|
|
3632
3631
|
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
@@ -3634,7 +3633,7 @@ var scope = {};
|
|
|
3634
3633
|
if (this.opts.ownProperties)
|
|
3635
3634
|
return this.forOf(a, (0, t._)`Object.keys(${h})`, C);
|
|
3636
3635
|
const q = this._scope.toName(a);
|
|
3637
|
-
return this._for(new
|
|
3636
|
+
return this._for(new D("in", M, q, h), () => C(q));
|
|
3638
3637
|
}
|
|
3639
3638
|
// end `for` loop
|
|
3640
3639
|
endFor() {
|
|
@@ -3659,7 +3658,7 @@ var scope = {};
|
|
|
3659
3658
|
try(a, h, C) {
|
|
3660
3659
|
if (!h && !C)
|
|
3661
3660
|
throw new Error('CodeGen: "try" without "catch" and "finally"');
|
|
3662
|
-
const M = new
|
|
3661
|
+
const M = new A();
|
|
3663
3662
|
if (this._blockNode(M), this.code(a), h) {
|
|
3664
3663
|
const q = this.name("e");
|
|
3665
3664
|
this._currNode = M.catch = new V(q), h(q);
|
|
@@ -3780,8 +3779,8 @@ var util = {};
|
|
|
3780
3779
|
const t = codegen, r = code$1;
|
|
3781
3780
|
function n(w) {
|
|
3782
3781
|
const k = {};
|
|
3783
|
-
for (const
|
|
3784
|
-
k[
|
|
3782
|
+
for (const A of w)
|
|
3783
|
+
k[A] = !0;
|
|
3785
3784
|
return k;
|
|
3786
3785
|
}
|
|
3787
3786
|
e.toHash = n;
|
|
@@ -3790,19 +3789,19 @@ var util = {};
|
|
|
3790
3789
|
}
|
|
3791
3790
|
e.alwaysValidSchema = s;
|
|
3792
3791
|
function i(w, k = w.schema) {
|
|
3793
|
-
const { opts:
|
|
3794
|
-
if (!
|
|
3792
|
+
const { opts: A, self: V } = w;
|
|
3793
|
+
if (!A.strictSchema || typeof k == "boolean")
|
|
3795
3794
|
return;
|
|
3796
3795
|
const x = V.RULES.keywords;
|
|
3797
3796
|
for (const re in k)
|
|
3798
|
-
x[re] ||
|
|
3797
|
+
x[re] || D(w, `unknown keyword: "${re}"`);
|
|
3799
3798
|
}
|
|
3800
3799
|
e.checkUnknownRules = i;
|
|
3801
3800
|
function o(w, k) {
|
|
3802
3801
|
if (typeof w == "boolean")
|
|
3803
3802
|
return !w;
|
|
3804
|
-
for (const
|
|
3805
|
-
if (k[
|
|
3803
|
+
for (const A in w)
|
|
3804
|
+
if (k[A])
|
|
3806
3805
|
return !0;
|
|
3807
3806
|
return !1;
|
|
3808
3807
|
}
|
|
@@ -3810,18 +3809,18 @@ var util = {};
|
|
|
3810
3809
|
function l(w, k) {
|
|
3811
3810
|
if (typeof w == "boolean")
|
|
3812
3811
|
return !w;
|
|
3813
|
-
for (const
|
|
3814
|
-
if (
|
|
3812
|
+
for (const A in w)
|
|
3813
|
+
if (A !== "$ref" && k.all[A])
|
|
3815
3814
|
return !0;
|
|
3816
3815
|
return !1;
|
|
3817
3816
|
}
|
|
3818
3817
|
e.schemaHasRulesButRef = l;
|
|
3819
|
-
function d({ topSchemaRef: w, schemaPath: k },
|
|
3818
|
+
function d({ topSchemaRef: w, schemaPath: k }, A, V, x) {
|
|
3820
3819
|
if (!x) {
|
|
3821
|
-
if (typeof
|
|
3822
|
-
return
|
|
3823
|
-
if (typeof
|
|
3824
|
-
return (0, t._)`${
|
|
3820
|
+
if (typeof A == "number" || typeof A == "boolean")
|
|
3821
|
+
return A;
|
|
3822
|
+
if (typeof A == "string")
|
|
3823
|
+
return (0, t._)`${A}`;
|
|
3825
3824
|
}
|
|
3826
3825
|
return (0, t._)`${w}${k}${(0, t.getProperty)(V)}`;
|
|
3827
3826
|
}
|
|
@@ -3844,32 +3843,32 @@ var util = {};
|
|
|
3844
3843
|
e.unescapeJsonPointer = O;
|
|
3845
3844
|
function N(w, k) {
|
|
3846
3845
|
if (Array.isArray(w))
|
|
3847
|
-
for (const
|
|
3848
|
-
k(
|
|
3846
|
+
for (const A of w)
|
|
3847
|
+
k(A);
|
|
3849
3848
|
else
|
|
3850
3849
|
k(w);
|
|
3851
3850
|
}
|
|
3852
3851
|
e.eachItem = N;
|
|
3853
|
-
function R({ mergeNames: w, mergeToName: k, mergeValues:
|
|
3852
|
+
function R({ mergeNames: w, mergeToName: k, mergeValues: A, resultToName: V }) {
|
|
3854
3853
|
return (x, re, K, ue) => {
|
|
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) :
|
|
3854
|
+
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);
|
|
3856
3855
|
return ue === t.Name && !(oe instanceof t.Name) ? V(x, oe) : oe;
|
|
3857
3856
|
};
|
|
3858
3857
|
}
|
|
3859
3858
|
e.mergeEvaluated = {
|
|
3860
3859
|
props: R({
|
|
3861
|
-
mergeNames: (w, k,
|
|
3862
|
-
w.if((0, t._)`${k} === true`, () => w.assign(
|
|
3860
|
+
mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => {
|
|
3861
|
+
w.if((0, t._)`${k} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${k})`));
|
|
3863
3862
|
}),
|
|
3864
|
-
mergeToName: (w, k,
|
|
3865
|
-
k === !0 ? w.assign(
|
|
3863
|
+
mergeToName: (w, k, A) => w.if((0, t._)`${A} !== true`, () => {
|
|
3864
|
+
k === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), g(w, A, k));
|
|
3866
3865
|
}),
|
|
3867
3866
|
mergeValues: (w, k) => w === !0 ? !0 : { ...w, ...k },
|
|
3868
3867
|
resultToName: v
|
|
3869
3868
|
}),
|
|
3870
3869
|
items: R({
|
|
3871
|
-
mergeNames: (w, k,
|
|
3872
|
-
mergeToName: (w, k,
|
|
3870
|
+
mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => w.assign(A, (0, t._)`${k} === true ? true : ${A} > ${k} ? ${A} : ${k}`)),
|
|
3871
|
+
mergeToName: (w, k, A) => w.if((0, t._)`${A} !== true`, () => w.assign(A, k === !0 ? !0 : (0, t._)`${A} > ${k} ? ${A} : ${k}`)),
|
|
3873
3872
|
mergeValues: (w, k) => w === !0 ? !0 : Math.max(w, k),
|
|
3874
3873
|
resultToName: (w, k) => w.var("items", k)
|
|
3875
3874
|
})
|
|
@@ -3877,12 +3876,12 @@ var util = {};
|
|
|
3877
3876
|
function v(w, k) {
|
|
3878
3877
|
if (k === !0)
|
|
3879
3878
|
return w.var("props", !0);
|
|
3880
|
-
const
|
|
3881
|
-
return k !== void 0 && g(w,
|
|
3879
|
+
const A = w.var("props", (0, t._)`{}`);
|
|
3880
|
+
return k !== void 0 && g(w, A, k), A;
|
|
3882
3881
|
}
|
|
3883
3882
|
e.evaluatedPropsToName = v;
|
|
3884
|
-
function g(w, k,
|
|
3885
|
-
Object.keys(
|
|
3883
|
+
function g(w, k, A) {
|
|
3884
|
+
Object.keys(A).forEach((V) => w.assign((0, t._)`${k}${(0, t.getProperty)(V)}`, !0));
|
|
3886
3885
|
}
|
|
3887
3886
|
e.setEvaluated = g;
|
|
3888
3887
|
const m = {};
|
|
@@ -3897,22 +3896,22 @@ var util = {};
|
|
|
3897
3896
|
(function(w) {
|
|
3898
3897
|
w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
|
|
3899
3898
|
})(S = e.Type || (e.Type = {}));
|
|
3900
|
-
function I(w, k,
|
|
3899
|
+
function I(w, k, A) {
|
|
3901
3900
|
if (w instanceof t.Name) {
|
|
3902
3901
|
const V = k === S.Num;
|
|
3903
|
-
return
|
|
3902
|
+
return A ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
3904
3903
|
}
|
|
3905
|
-
return
|
|
3904
|
+
return A ? (0, t.getProperty)(w).toString() : "/" + $(w);
|
|
3906
3905
|
}
|
|
3907
3906
|
e.getErrorPath = I;
|
|
3908
|
-
function
|
|
3909
|
-
if (
|
|
3910
|
-
if (k = `strict mode: ${k}`,
|
|
3907
|
+
function D(w, k, A = w.opts.strictSchema) {
|
|
3908
|
+
if (A) {
|
|
3909
|
+
if (k = `strict mode: ${k}`, A === !0)
|
|
3911
3910
|
throw new Error(k);
|
|
3912
3911
|
w.self.logger.warn(k);
|
|
3913
3912
|
}
|
|
3914
3913
|
}
|
|
3915
|
-
e.checkStrictMode =
|
|
3914
|
+
e.checkStrictMode = D;
|
|
3916
3915
|
})(util);
|
|
3917
3916
|
var names$1 = {};
|
|
3918
3917
|
Object.defineProperty(names$1, "__esModule", { value: !0 });
|
|
@@ -3949,25 +3948,25 @@ names$1.default = names;
|
|
|
3949
3948
|
message: ({ keyword: g, schemaType: m }) => m ? (0, t.str)`"${g}" keyword must be ${m} ($data)` : (0, t.str)`"${g}" keyword is invalid ($data)`
|
|
3950
3949
|
};
|
|
3951
3950
|
function s(g, m = e.keywordError, T, S) {
|
|
3952
|
-
const { it: I } = g, { gen:
|
|
3953
|
-
S ?? (w || k) ? d(
|
|
3951
|
+
const { it: I } = g, { gen: D, compositeRule: w, allErrors: k } = I, A = $(g, m, T);
|
|
3952
|
+
S ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
|
|
3954
3953
|
}
|
|
3955
3954
|
e.reportError = s;
|
|
3956
3955
|
function i(g, m = e.keywordError, T) {
|
|
3957
|
-
const { it: S } = g, { gen: I, compositeRule:
|
|
3958
|
-
d(I, k),
|
|
3956
|
+
const { it: S } = g, { gen: I, compositeRule: D, allErrors: w } = S, k = $(g, m, T);
|
|
3957
|
+
d(I, k), D || w || u(S, n.default.vErrors);
|
|
3959
3958
|
}
|
|
3960
3959
|
e.reportExtraError = i;
|
|
3961
3960
|
function o(g, m) {
|
|
3962
3961
|
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)));
|
|
3963
3962
|
}
|
|
3964
3963
|
e.resetErrorsCount = o;
|
|
3965
|
-
function l({ gen: g, keyword: m, schemaValue: T, data: S, errsCount: I, it:
|
|
3964
|
+
function l({ gen: g, keyword: m, schemaValue: T, data: S, errsCount: I, it: D }) {
|
|
3966
3965
|
if (I === void 0)
|
|
3967
3966
|
throw new Error("ajv implementation error");
|
|
3968
3967
|
const w = g.name("err");
|
|
3969
3968
|
g.forRange("i", I, n.default.errors, (k) => {
|
|
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,
|
|
3969
|
+
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));
|
|
3971
3970
|
});
|
|
3972
3971
|
}
|
|
3973
3972
|
e.extendErrors = l;
|
|
@@ -3993,11 +3992,11 @@ names$1.default = names;
|
|
|
3993
3992
|
return S === !1 ? (0, t._)`{}` : O(g, m, T);
|
|
3994
3993
|
}
|
|
3995
3994
|
function O(g, m, T = {}) {
|
|
3996
|
-
const { gen: S, it: I } = g,
|
|
3995
|
+
const { gen: S, it: I } = g, D = [
|
|
3997
3996
|
N(I, T),
|
|
3998
3997
|
R(g, T)
|
|
3999
3998
|
];
|
|
4000
|
-
return v(g, m,
|
|
3999
|
+
return v(g, m, D), S.object(...D);
|
|
4001
4000
|
}
|
|
4002
4001
|
function N({ errorPath: g }, { instancePath: m }) {
|
|
4003
4002
|
const T = m ? (0, t.str)`${g}${(0, r.getErrorPath)(m, r.Type.Str)}` : g;
|
|
@@ -4008,8 +4007,8 @@ names$1.default = names;
|
|
|
4008
4007
|
return T && (I = (0, t.str)`${I}${(0, r.getErrorPath)(T, r.Type.Str)}`), [p.schemaPath, I];
|
|
4009
4008
|
}
|
|
4010
4009
|
function v(g, { params: m, message: T }, S) {
|
|
4011
|
-
const { keyword: I, data:
|
|
4012
|
-
S.push([p.keyword, I], [p.params, typeof m == "function" ? m(g) : m || (0, t._)`{}`]),
|
|
4010
|
+
const { keyword: I, data: D, schemaValue: w, it: k } = g, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: re } = k;
|
|
4011
|
+
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]);
|
|
4013
4012
|
}
|
|
4014
4013
|
})(errors);
|
|
4015
4014
|
Object.defineProperty(boolSchema, "__esModule", { value: !0 });
|
|
@@ -4109,11 +4108,11 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4109
4108
|
}
|
|
4110
4109
|
e.getJSONTypes = d;
|
|
4111
4110
|
function u(S, I) {
|
|
4112
|
-
const { gen:
|
|
4111
|
+
const { gen: D, data: w, opts: k } = S, A = $(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(S, I[0]));
|
|
4113
4112
|
if (V) {
|
|
4114
4113
|
const x = v(I, w, k.strictNumbers, o.Wrong);
|
|
4115
|
-
|
|
4116
|
-
|
|
4114
|
+
D.if(x, () => {
|
|
4115
|
+
A.length ? O(S, I, A) : m(S);
|
|
4117
4116
|
});
|
|
4118
4117
|
}
|
|
4119
4118
|
return V;
|
|
@@ -4121,13 +4120,13 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4121
4120
|
e.coerceAndCheckDataType = u;
|
|
4122
4121
|
const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
4123
4122
|
function $(S, I) {
|
|
4124
|
-
return I ? S.filter((
|
|
4123
|
+
return I ? S.filter((D) => p.has(D) || I === "array" && D === "array") : [];
|
|
4125
4124
|
}
|
|
4126
|
-
function O(S, I,
|
|
4127
|
-
const { gen: w, data: k, opts:
|
|
4128
|
-
|
|
4129
|
-
for (const K of
|
|
4130
|
-
(p.has(K) || K === "array" &&
|
|
4125
|
+
function O(S, I, D) {
|
|
4126
|
+
const { gen: w, data: k, opts: A } = S, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
|
|
4127
|
+
A.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, A.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
|
|
4128
|
+
for (const K of D)
|
|
4129
|
+
(p.has(K) || K === "array" && A.coerceTypes === "array") && re(K);
|
|
4131
4130
|
w.else(), m(S), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
|
|
4132
4131
|
w.assign(k, x), N(S, x);
|
|
4133
4132
|
});
|
|
@@ -4156,49 +4155,49 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4156
4155
|
}
|
|
4157
4156
|
}
|
|
4158
4157
|
}
|
|
4159
|
-
function N({ gen: S, parentData: I, parentDataProperty:
|
|
4160
|
-
S.if((0, s._)`${I} !== undefined`, () => S.assign((0, s._)`${I}[${
|
|
4158
|
+
function N({ gen: S, parentData: I, parentDataProperty: D }, w) {
|
|
4159
|
+
S.if((0, s._)`${I} !== undefined`, () => S.assign((0, s._)`${I}[${D}]`, w));
|
|
4161
4160
|
}
|
|
4162
|
-
function R(S, I,
|
|
4161
|
+
function R(S, I, D, w = o.Correct) {
|
|
4163
4162
|
const k = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
|
|
4164
|
-
let
|
|
4163
|
+
let A;
|
|
4165
4164
|
switch (S) {
|
|
4166
4165
|
case "null":
|
|
4167
4166
|
return (0, s._)`${I} ${k} null`;
|
|
4168
4167
|
case "array":
|
|
4169
|
-
|
|
4168
|
+
A = (0, s._)`Array.isArray(${I})`;
|
|
4170
4169
|
break;
|
|
4171
4170
|
case "object":
|
|
4172
|
-
|
|
4171
|
+
A = (0, s._)`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;
|
|
4173
4172
|
break;
|
|
4174
4173
|
case "integer":
|
|
4175
|
-
|
|
4174
|
+
A = V((0, s._)`!(${I} % 1) && !isNaN(${I})`);
|
|
4176
4175
|
break;
|
|
4177
4176
|
case "number":
|
|
4178
|
-
|
|
4177
|
+
A = V();
|
|
4179
4178
|
break;
|
|
4180
4179
|
default:
|
|
4181
4180
|
return (0, s._)`typeof ${I} ${k} ${S}`;
|
|
4182
4181
|
}
|
|
4183
|
-
return w === o.Correct ?
|
|
4182
|
+
return w === o.Correct ? A : (0, s.not)(A);
|
|
4184
4183
|
function V(x = s.nil) {
|
|
4185
|
-
return (0, s.and)((0, s._)`typeof ${I} == "number"`, x,
|
|
4184
|
+
return (0, s.and)((0, s._)`typeof ${I} == "number"`, x, D ? (0, s._)`isFinite(${I})` : s.nil);
|
|
4186
4185
|
}
|
|
4187
4186
|
}
|
|
4188
4187
|
e.checkDataType = R;
|
|
4189
|
-
function v(S, I,
|
|
4188
|
+
function v(S, I, D, w) {
|
|
4190
4189
|
if (S.length === 1)
|
|
4191
|
-
return R(S[0], I,
|
|
4190
|
+
return R(S[0], I, D, w);
|
|
4192
4191
|
let k;
|
|
4193
|
-
const
|
|
4194
|
-
if (
|
|
4192
|
+
const A = (0, i.toHash)(S);
|
|
4193
|
+
if (A.array && A.object) {
|
|
4195
4194
|
const V = (0, s._)`typeof ${I} != "object"`;
|
|
4196
|
-
k =
|
|
4195
|
+
k = A.null ? V : (0, s._)`!${I} || ${V}`, delete A.null, delete A.array, delete A.object;
|
|
4197
4196
|
} else
|
|
4198
4197
|
k = s.nil;
|
|
4199
|
-
|
|
4200
|
-
for (const V in
|
|
4201
|
-
k = (0, s.and)(k, R(V, I,
|
|
4198
|
+
A.number && delete A.integer;
|
|
4199
|
+
for (const V in A)
|
|
4200
|
+
k = (0, s.and)(k, R(V, I, D, w));
|
|
4202
4201
|
return k;
|
|
4203
4202
|
}
|
|
4204
4203
|
e.checkDataTypes = v;
|
|
@@ -4212,11 +4211,11 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4212
4211
|
}
|
|
4213
4212
|
e.reportTypeError = m;
|
|
4214
4213
|
function T(S) {
|
|
4215
|
-
const { gen: I, data:
|
|
4214
|
+
const { gen: I, data: D, schema: w } = S, k = (0, i.schemaRefOrVal)(S, w, "type");
|
|
4216
4215
|
return {
|
|
4217
4216
|
gen: I,
|
|
4218
4217
|
keyword: "type",
|
|
4219
|
-
data:
|
|
4218
|
+
data: D,
|
|
4220
4219
|
schema: w.type,
|
|
4221
4220
|
schemaCode: k,
|
|
4222
4221
|
schemaValue: k,
|
|
@@ -4692,8 +4691,8 @@ function getSchemaRefs(e, t) {
|
|
|
4692
4691
|
if (S = normalizeId(g ? I(g, S) : S), d.has(S))
|
|
4693
4692
|
throw p(S);
|
|
4694
4693
|
d.add(S);
|
|
4695
|
-
let
|
|
4696
|
-
return typeof
|
|
4694
|
+
let D = this.refs[S];
|
|
4695
|
+
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;
|
|
4697
4696
|
}
|
|
4698
4697
|
function T(S) {
|
|
4699
4698
|
if (typeof S == "string") {
|
|
@@ -5306,7 +5305,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5306
5305
|
return _;
|
|
5307
5306
|
} else
|
|
5308
5307
|
return Array.from(f);
|
|
5309
|
-
}, R = 2147483647, v = 36, g = 1, m = 26, T = 38, S = 700, I = 72,
|
|
5308
|
+
}, 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 = {
|
|
5310
5309
|
overflow: "Overflow: input needs wider integers to process",
|
|
5311
5310
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5312
5311
|
"invalid-input": "Invalid input"
|
|
@@ -5353,7 +5352,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5353
5352
|
c = K(c / re);
|
|
5354
5353
|
return K(b + (re + 1) * c / (c + T));
|
|
5355
5354
|
}, j = function(c) {
|
|
5356
|
-
var _ = [], E = c.length, b = 0, U =
|
|
5355
|
+
var _ = [], E = c.length, b = 0, U = D, L = I, J = c.lastIndexOf(w);
|
|
5357
5356
|
J < 0 && (J = 0);
|
|
5358
5357
|
for (var Y = 0; Y < J; ++Y)
|
|
5359
5358
|
c.charCodeAt(Y) >= 128 && oe("not-basic"), _.push(c.charCodeAt(Y));
|
|
@@ -5380,7 +5379,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5380
5379
|
}, P = function(c) {
|
|
5381
5380
|
var _ = [];
|
|
5382
5381
|
c = qe(c);
|
|
5383
|
-
var E = c.length, b =
|
|
5382
|
+
var E = c.length, b = D, U = 0, L = I, J = !0, Y = !1, se = void 0;
|
|
5384
5383
|
try {
|
|
5385
5384
|
for (var B = c[Symbol.iterator](), Z; !(J = (Z = B.next()).done); J = !0) {
|
|
5386
5385
|
var ie = Z.value;
|
|
@@ -5455,7 +5454,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5455
5454
|
});
|
|
5456
5455
|
}, h = function(c) {
|
|
5457
5456
|
return Oe(c, function(_) {
|
|
5458
|
-
return
|
|
5457
|
+
return A.test(_) ? "xn--" + P(_) : _;
|
|
5459
5458
|
});
|
|
5460
5459
|
}, C = {
|
|
5461
5460
|
/**
|
|
@@ -5667,12 +5666,12 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5667
5666
|
}
|
|
5668
5667
|
return c.fragment = void 0, c;
|
|
5669
5668
|
}
|
|
5670
|
-
},
|
|
5669
|
+
}, At = {
|
|
5671
5670
|
scheme: "wss",
|
|
5672
5671
|
domainHost: at.domainHost,
|
|
5673
5672
|
parse: at.parse,
|
|
5674
5673
|
serialize: at.serialize
|
|
5675
|
-
}, ir = {},
|
|
5674
|
+
}, ir = {}, Dt = "[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(Dt, "g"), We = new RegExp(or, "g"), pr = new RegExp(n("[^]", ar, "[\\.]", '[\\"]', lr), "g"), Ft = new RegExp(n("[^]", Dt, dr), "g"), fr = Ft;
|
|
5676
5675
|
function Ct(f) {
|
|
5677
5676
|
var c = W(f);
|
|
5678
5677
|
return c.match(ur) ? c : f;
|
|
@@ -5766,7 +5765,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5766
5765
|
return E.nss = (c.uuid || "").toLowerCase(), E;
|
|
5767
5766
|
}
|
|
5768
5767
|
};
|
|
5769
|
-
M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[
|
|
5768
|
+
M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[At.scheme] = At, 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 });
|
|
5770
5769
|
});
|
|
5771
5770
|
})(uri_all, uri_all.exports);
|
|
5772
5771
|
var uri_allExports = uri_all.exports;
|
|
@@ -5861,7 +5860,7 @@ uri$1.default = uri;
|
|
|
5861
5860
|
const { es5: j, lines: P } = this.opts.code;
|
|
5862
5861
|
this.scope = new l.ValueScope({ scope: {}, prefixes: v, es5: j, lines: P }), this.logger = K(y.logger);
|
|
5863
5862
|
const a = y.validateFormats;
|
|
5864
|
-
y.validateFormats = !1, this.RULES = (0, i.getRules)(),
|
|
5863
|
+
y.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, g, y, "NOT SUPPORTED"), D.call(this, m, y, "DEPRECATED", "warn"), this._metaOpts = x.call(this), y.formats && A.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;
|
|
5865
5864
|
}
|
|
5866
5865
|
_addVocabularies() {
|
|
5867
5866
|
this.addKeyword("$async");
|
|
@@ -6115,7 +6114,7 @@ uri$1.default = uri;
|
|
|
6115
6114
|
}
|
|
6116
6115
|
}
|
|
6117
6116
|
e.default = I, I.ValidationError = n.default, I.MissingRefError = s.default;
|
|
6118
|
-
function
|
|
6117
|
+
function D(F, y, j, P = "error") {
|
|
6119
6118
|
for (const a in F) {
|
|
6120
6119
|
const h = a;
|
|
6121
6120
|
h in y && this.logger[P](`${j}: option ${a}. ${F[h]}`);
|
|
@@ -6133,7 +6132,7 @@ uri$1.default = uri;
|
|
|
6133
6132
|
for (const y in F)
|
|
6134
6133
|
this.addSchema(F[y], y);
|
|
6135
6134
|
}
|
|
6136
|
-
function
|
|
6135
|
+
function A() {
|
|
6137
6136
|
for (const F in this.opts.formats) {
|
|
6138
6137
|
const y = this.opts.formats[F];
|
|
6139
6138
|
y && this.addFormat(F, y);
|
|
@@ -7200,8 +7199,8 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7200
7199
|
return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${m}`;
|
|
7201
7200
|
}
|
|
7202
7201
|
function S() {
|
|
7203
|
-
const I = p.$async ? (0, codegen_1$1._)`(${v}.async ? await ${m}(${n}) : ${m}(${n}))` : (0, codegen_1$1._)`${m}(${n})`,
|
|
7204
|
-
return (0, codegen_1$1._)`${m} && ${m} !== true && ${g} === ${t} && !${
|
|
7202
|
+
const I = p.$async ? (0, codegen_1$1._)`(${v}.async ? await ${m}(${n}) : ${m}(${n}))` : (0, codegen_1$1._)`${m}(${n})`, D = (0, codegen_1$1._)`(typeof ${m} == "function" ? ${I} : ${m}.test(${n}))`;
|
|
7203
|
+
return (0, codegen_1$1._)`${m} && ${m} !== true && ${g} === ${t} && !${D}`;
|
|
7205
7204
|
}
|
|
7206
7205
|
}
|
|
7207
7206
|
function N() {
|
|
@@ -7216,17 +7215,17 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7216
7215
|
v === t && e.pass(I());
|
|
7217
7216
|
function T() {
|
|
7218
7217
|
if (d.strictSchema === !1) {
|
|
7219
|
-
$.logger.warn(
|
|
7218
|
+
$.logger.warn(D());
|
|
7220
7219
|
return;
|
|
7221
7220
|
}
|
|
7222
|
-
throw new Error(
|
|
7223
|
-
function
|
|
7221
|
+
throw new Error(D());
|
|
7222
|
+
function D() {
|
|
7224
7223
|
return `unknown format "${i}" ignored in schema at path "${u}"`;
|
|
7225
7224
|
}
|
|
7226
7225
|
}
|
|
7227
|
-
function S(
|
|
7228
|
-
const w =
|
|
7229
|
-
return typeof
|
|
7226
|
+
function S(D) {
|
|
7227
|
+
const w = D instanceof RegExp ? (0, codegen_1$1.regexpCode)(D) : 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: D, code: w });
|
|
7228
|
+
return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${k}.validate`] : ["string", D, k];
|
|
7230
7229
|
}
|
|
7231
7230
|
function I() {
|
|
7232
7231
|
if (typeof R == "object" && !(R instanceof RegExp) && R.async) {
|
|
@@ -7314,12 +7313,12 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7314
7313
|
const R = {}, v = m(s);
|
|
7315
7314
|
let g = !0;
|
|
7316
7315
|
for (let I = 0; I < o.length; I++) {
|
|
7317
|
-
let
|
|
7318
|
-
|
|
7319
|
-
const w = (N =
|
|
7316
|
+
let D = o[I];
|
|
7317
|
+
D != null && D.$ref && !(0, util_1.schemaHasRulesButRef)(D, i.self.RULES) && (D = compile_1.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, D == null ? void 0 : D.$ref), D instanceof compile_1.SchemaEnv && (D = D.schema));
|
|
7318
|
+
const w = (N = D == null ? void 0 : D.properties) === null || N === void 0 ? void 0 : N[l];
|
|
7320
7319
|
if (typeof w != "object")
|
|
7321
7320
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
|
|
7322
|
-
g = g && (v || m(
|
|
7321
|
+
g = g && (v || m(D)), T(w, I);
|
|
7323
7322
|
}
|
|
7324
7323
|
if (!g)
|
|
7325
7324
|
throw new Error(`discriminator: "${l}" must be required`);
|
|
@@ -7327,19 +7326,19 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7327
7326
|
function m({ required: I }) {
|
|
7328
7327
|
return Array.isArray(I) && I.includes(l);
|
|
7329
7328
|
}
|
|
7330
|
-
function T(I,
|
|
7329
|
+
function T(I, D) {
|
|
7331
7330
|
if (I.const)
|
|
7332
|
-
S(I.const,
|
|
7331
|
+
S(I.const, D);
|
|
7333
7332
|
else if (I.enum)
|
|
7334
7333
|
for (const w of I.enum)
|
|
7335
|
-
S(w,
|
|
7334
|
+
S(w, D);
|
|
7336
7335
|
else
|
|
7337
7336
|
throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);
|
|
7338
7337
|
}
|
|
7339
|
-
function S(I,
|
|
7338
|
+
function S(I, D) {
|
|
7340
7339
|
if (typeof I != "string" || I in R)
|
|
7341
7340
|
throw new Error(`discriminator: "${l}" values must be unique strings`);
|
|
7342
|
-
R[I] =
|
|
7341
|
+
R[I] = D;
|
|
7343
7342
|
}
|
|
7344
7343
|
}
|
|
7345
7344
|
}
|
|
@@ -7642,7 +7641,38 @@ const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports), $schema = "http
|
|
|
7642
7641
|
},
|
|
7643
7642
|
description: {
|
|
7644
7643
|
type: "string",
|
|
7645
|
-
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."
|
|
7644
|
+
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.",
|
|
7645
|
+
deprecated: "Use meta.description instead."
|
|
7646
|
+
},
|
|
7647
|
+
meta: {
|
|
7648
|
+
type: "object",
|
|
7649
|
+
properties: {
|
|
7650
|
+
title: {
|
|
7651
|
+
type: "string",
|
|
7652
|
+
description: "A clear and concise name for your Blueprint."
|
|
7653
|
+
},
|
|
7654
|
+
description: {
|
|
7655
|
+
type: "string",
|
|
7656
|
+
description: "A brief explanation of what your Blueprint offers."
|
|
7657
|
+
},
|
|
7658
|
+
author: {
|
|
7659
|
+
type: "string",
|
|
7660
|
+
description: "A GitHub username of the author of this Blueprint."
|
|
7661
|
+
},
|
|
7662
|
+
categories: {
|
|
7663
|
+
type: "array",
|
|
7664
|
+
items: {
|
|
7665
|
+
type: "string"
|
|
7666
|
+
},
|
|
7667
|
+
description: "Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."
|
|
7668
|
+
}
|
|
7669
|
+
},
|
|
7670
|
+
required: [
|
|
7671
|
+
"title",
|
|
7672
|
+
"author"
|
|
7673
|
+
],
|
|
7674
|
+
additionalProperties: !1,
|
|
7675
|
+
description: "Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"
|
|
7646
7676
|
},
|
|
7647
7677
|
preferredVersions: {
|
|
7648
7678
|
type: "object",
|
|
@@ -8919,46 +8949,129 @@ for existing apps using this option.`
|
|
|
8919
8949
|
$ref: "#/definitions/PHPRequestHeaders",
|
|
8920
8950
|
description: "Request headers."
|
|
8921
8951
|
},
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8952
|
+
body: {
|
|
8953
|
+
anyOf: [
|
|
8954
|
+
{
|
|
8955
|
+
type: "string"
|
|
8956
|
+
},
|
|
8957
|
+
{
|
|
8958
|
+
type: "object",
|
|
8959
|
+
properties: {
|
|
8960
|
+
BYTES_PER_ELEMENT: {
|
|
8961
|
+
type: "number"
|
|
8962
|
+
},
|
|
8963
|
+
buffer: {
|
|
8964
|
+
type: "object",
|
|
8965
|
+
properties: {
|
|
8966
|
+
byteLength: {
|
|
8967
|
+
type: "number"
|
|
8968
|
+
}
|
|
8969
|
+
},
|
|
8970
|
+
required: [
|
|
8971
|
+
"byteLength"
|
|
8972
|
+
],
|
|
8973
|
+
additionalProperties: !1
|
|
8974
|
+
},
|
|
8975
|
+
byteLength: {
|
|
8976
|
+
type: "number"
|
|
8977
|
+
},
|
|
8978
|
+
byteOffset: {
|
|
8979
|
+
type: "number"
|
|
8980
|
+
},
|
|
8981
|
+
length: {
|
|
8982
|
+
type: "number"
|
|
8983
|
+
}
|
|
8932
8984
|
},
|
|
8933
|
-
|
|
8985
|
+
required: [
|
|
8986
|
+
"BYTES_PER_ELEMENT",
|
|
8987
|
+
"buffer",
|
|
8988
|
+
"byteLength",
|
|
8989
|
+
"byteOffset",
|
|
8990
|
+
"length"
|
|
8991
|
+
],
|
|
8992
|
+
additionalProperties: {
|
|
8934
8993
|
type: "number"
|
|
8935
|
-
},
|
|
8936
|
-
name: {
|
|
8937
|
-
type: "string"
|
|
8938
|
-
},
|
|
8939
|
-
webkitRelativePath: {
|
|
8940
|
-
type: "string"
|
|
8941
8994
|
}
|
|
8942
8995
|
},
|
|
8943
|
-
|
|
8944
|
-
"
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8996
|
+
{
|
|
8997
|
+
type: "object",
|
|
8998
|
+
additionalProperties: {
|
|
8999
|
+
anyOf: [
|
|
9000
|
+
{
|
|
9001
|
+
type: "string"
|
|
9002
|
+
},
|
|
9003
|
+
{
|
|
9004
|
+
type: "object",
|
|
9005
|
+
properties: {
|
|
9006
|
+
BYTES_PER_ELEMENT: {
|
|
9007
|
+
type: "number"
|
|
9008
|
+
},
|
|
9009
|
+
buffer: {
|
|
9010
|
+
type: "object",
|
|
9011
|
+
properties: {
|
|
9012
|
+
byteLength: {
|
|
9013
|
+
type: "number"
|
|
9014
|
+
}
|
|
9015
|
+
},
|
|
9016
|
+
required: [
|
|
9017
|
+
"byteLength"
|
|
9018
|
+
],
|
|
9019
|
+
additionalProperties: !1
|
|
9020
|
+
},
|
|
9021
|
+
byteLength: {
|
|
9022
|
+
type: "number"
|
|
9023
|
+
},
|
|
9024
|
+
byteOffset: {
|
|
9025
|
+
type: "number"
|
|
9026
|
+
},
|
|
9027
|
+
length: {
|
|
9028
|
+
type: "number"
|
|
9029
|
+
}
|
|
9030
|
+
},
|
|
9031
|
+
required: [
|
|
9032
|
+
"BYTES_PER_ELEMENT",
|
|
9033
|
+
"buffer",
|
|
9034
|
+
"byteLength",
|
|
9035
|
+
"byteOffset",
|
|
9036
|
+
"length"
|
|
9037
|
+
],
|
|
9038
|
+
additionalProperties: {
|
|
9039
|
+
type: "number"
|
|
9040
|
+
}
|
|
9041
|
+
},
|
|
9042
|
+
{
|
|
9043
|
+
type: "object",
|
|
9044
|
+
properties: {
|
|
9045
|
+
size: {
|
|
9046
|
+
type: "number"
|
|
9047
|
+
},
|
|
9048
|
+
type: {
|
|
9049
|
+
type: "string"
|
|
9050
|
+
},
|
|
9051
|
+
lastModified: {
|
|
9052
|
+
type: "number"
|
|
9053
|
+
},
|
|
9054
|
+
name: {
|
|
9055
|
+
type: "string"
|
|
9056
|
+
},
|
|
9057
|
+
webkitRelativePath: {
|
|
9058
|
+
type: "string"
|
|
9059
|
+
}
|
|
9060
|
+
},
|
|
9061
|
+
required: [
|
|
9062
|
+
"lastModified",
|
|
9063
|
+
"name",
|
|
9064
|
+
"size",
|
|
9065
|
+
"type",
|
|
9066
|
+
"webkitRelativePath"
|
|
9067
|
+
],
|
|
9068
|
+
additionalProperties: !1
|
|
9069
|
+
}
|
|
9070
|
+
]
|
|
9071
|
+
}
|
|
9072
|
+
}
|
|
9073
|
+
],
|
|
9074
|
+
description: "Request body. If an object is given, the request will be encoded as multipart and sent with a `multipart/form-data` header."
|
|
8962
9075
|
}
|
|
8963
9076
|
},
|
|
8964
9077
|
required: [
|
|
@@ -9008,85 +9121,64 @@ for existing apps using this option.`
|
|
|
9008
9121
|
description: "Request headers."
|
|
9009
9122
|
},
|
|
9010
9123
|
body: {
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
fileInfos: {
|
|
9015
|
-
type: "array",
|
|
9016
|
-
items: {
|
|
9017
|
-
$ref: "#/definitions/FileInfo"
|
|
9018
|
-
},
|
|
9019
|
-
description: "Uploaded files."
|
|
9020
|
-
},
|
|
9021
|
-
code: {
|
|
9022
|
-
type: "string",
|
|
9023
|
-
description: "The code snippet to eval instead of a php file."
|
|
9024
|
-
},
|
|
9025
|
-
throwOnError: {
|
|
9026
|
-
type: "boolean",
|
|
9027
|
-
description: "Whether to throw an error if the PHP process exits with a non-zero code or outputs to stderr."
|
|
9028
|
-
}
|
|
9029
|
-
},
|
|
9030
|
-
additionalProperties: !1
|
|
9031
|
-
},
|
|
9032
|
-
FileInfo: {
|
|
9033
|
-
type: "object",
|
|
9034
|
-
properties: {
|
|
9035
|
-
key: {
|
|
9036
|
-
type: "string"
|
|
9037
|
-
},
|
|
9038
|
-
name: {
|
|
9039
|
-
type: "string"
|
|
9040
|
-
},
|
|
9041
|
-
type: {
|
|
9042
|
-
type: "string"
|
|
9043
|
-
},
|
|
9044
|
-
data: {
|
|
9045
|
-
type: "object",
|
|
9046
|
-
properties: {
|
|
9047
|
-
BYTES_PER_ELEMENT: {
|
|
9048
|
-
type: "number"
|
|
9124
|
+
anyOf: [
|
|
9125
|
+
{
|
|
9126
|
+
type: "string"
|
|
9049
9127
|
},
|
|
9050
|
-
|
|
9128
|
+
{
|
|
9051
9129
|
type: "object",
|
|
9052
9130
|
properties: {
|
|
9131
|
+
BYTES_PER_ELEMENT: {
|
|
9132
|
+
type: "number"
|
|
9133
|
+
},
|
|
9134
|
+
buffer: {
|
|
9135
|
+
type: "object",
|
|
9136
|
+
properties: {
|
|
9137
|
+
byteLength: {
|
|
9138
|
+
type: "number"
|
|
9139
|
+
}
|
|
9140
|
+
},
|
|
9141
|
+
required: [
|
|
9142
|
+
"byteLength"
|
|
9143
|
+
],
|
|
9144
|
+
additionalProperties: !1
|
|
9145
|
+
},
|
|
9053
9146
|
byteLength: {
|
|
9054
9147
|
type: "number"
|
|
9148
|
+
},
|
|
9149
|
+
byteOffset: {
|
|
9150
|
+
type: "number"
|
|
9151
|
+
},
|
|
9152
|
+
length: {
|
|
9153
|
+
type: "number"
|
|
9055
9154
|
}
|
|
9056
9155
|
},
|
|
9057
9156
|
required: [
|
|
9058
|
-
"
|
|
9157
|
+
"BYTES_PER_ELEMENT",
|
|
9158
|
+
"buffer",
|
|
9159
|
+
"byteLength",
|
|
9160
|
+
"byteOffset",
|
|
9161
|
+
"length"
|
|
9059
9162
|
],
|
|
9060
|
-
additionalProperties:
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
type: "number"
|
|
9064
|
-
},
|
|
9065
|
-
byteOffset: {
|
|
9066
|
-
type: "number"
|
|
9067
|
-
},
|
|
9068
|
-
length: {
|
|
9069
|
-
type: "number"
|
|
9163
|
+
additionalProperties: {
|
|
9164
|
+
type: "number"
|
|
9165
|
+
}
|
|
9070
9166
|
}
|
|
9071
|
-
},
|
|
9072
|
-
required: [
|
|
9073
|
-
"BYTES_PER_ELEMENT",
|
|
9074
|
-
"buffer",
|
|
9075
|
-
"byteLength",
|
|
9076
|
-
"byteOffset",
|
|
9077
|
-
"length"
|
|
9078
9167
|
],
|
|
9168
|
+
description: "Request body."
|
|
9169
|
+
},
|
|
9170
|
+
env: {
|
|
9171
|
+
type: "object",
|
|
9079
9172
|
additionalProperties: {
|
|
9080
|
-
type: "
|
|
9081
|
-
}
|
|
9173
|
+
type: "string"
|
|
9174
|
+
},
|
|
9175
|
+
description: "Environment variables to set for this run."
|
|
9176
|
+
},
|
|
9177
|
+
code: {
|
|
9178
|
+
type: "string",
|
|
9179
|
+
description: "The code snippet to eval instead of a php file."
|
|
9082
9180
|
}
|
|
9083
9181
|
},
|
|
9084
|
-
required: [
|
|
9085
|
-
"key",
|
|
9086
|
-
"name",
|
|
9087
|
-
"type",
|
|
9088
|
-
"data"
|
|
9089
|
-
],
|
|
9090
9182
|
additionalProperties: !1
|
|
9091
9183
|
},
|
|
9092
9184
|
WordPressInstallationOptions: {
|