@wp-playground/blueprints 0.6.15 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +50 -22
- package/index.d.ts +22 -170
- package/index.js +1061 -940
- package/lib/steps/handlers.d.ts +0 -1
- package/lib/steps/index.d.ts +2 -3
- package/package.json +2 -2
- package/lib/steps/set-php-ini-entry.d.ts +0 -25
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var It = (e, t, r) => {
|
|
2
2
|
if (!t.has(e))
|
|
3
3
|
throw TypeError("Cannot " + r);
|
|
4
4
|
};
|
|
5
|
-
var H = (e, t, r) => (
|
|
5
|
+
var H = (e, t, r) => (It(e, t, "read from private field"), r ? r.call(e) : t.get(e)), K = (e, t, r) => {
|
|
6
6
|
if (t.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
9
|
-
},
|
|
10
|
-
var ce = (e, t, r) => (
|
|
9
|
+
}, ie = (e, t, r, n) => (It(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
10
|
+
var ce = (e, t, r) => (It(e, t, "access private method"), r);
|
|
11
11
|
const currentJsRuntime = function() {
|
|
12
12
|
var e;
|
|
13
13
|
return typeof process < "u" && ((e = process.release) == null ? void 0 : e.name) === "node" ? "NODE" : typeof window < "u" ? "WEB" : (
|
|
@@ -97,19 +97,40 @@ const wpContentFilesExcludedFromExport = [
|
|
|
97
97
|
"themes/twentytwentyfour",
|
|
98
98
|
"themes/twentytwentyfive",
|
|
99
99
|
"themes/twentytwentysix"
|
|
100
|
-
];
|
|
100
|
+
], SleepFinished = Symbol("SleepFinished");
|
|
101
|
+
function sleep(e) {
|
|
102
|
+
return new Promise((t) => {
|
|
103
|
+
setTimeout(() => t(SleepFinished), e);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
class AcquireTimeoutError extends Error {
|
|
107
|
+
constructor() {
|
|
108
|
+
super("Acquiring lock timed out");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
101
111
|
class Semaphore {
|
|
102
|
-
constructor({ concurrency: t }) {
|
|
103
|
-
this._running = 0, this.concurrency = t, this.queue = [];
|
|
112
|
+
constructor({ concurrency: t, timeout: r }) {
|
|
113
|
+
this._running = 0, this.concurrency = t, this.timeout = r, this.queue = [];
|
|
114
|
+
}
|
|
115
|
+
get remaining() {
|
|
116
|
+
return this.concurrency - this.running;
|
|
104
117
|
}
|
|
105
118
|
get running() {
|
|
106
119
|
return this._running;
|
|
107
120
|
}
|
|
108
121
|
async acquire() {
|
|
109
122
|
for (; ; )
|
|
110
|
-
if (this._running >= this.concurrency)
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
if (this._running >= this.concurrency) {
|
|
124
|
+
const t = new Promise((r) => {
|
|
125
|
+
this.queue.push(r);
|
|
126
|
+
});
|
|
127
|
+
this.timeout !== void 0 ? await Promise.race([t, sleep(this.timeout)]).then(
|
|
128
|
+
(r) => {
|
|
129
|
+
if (r === SleepFinished)
|
|
130
|
+
throw new AcquireTimeoutError();
|
|
131
|
+
}
|
|
132
|
+
) : await t;
|
|
133
|
+
} else {
|
|
113
134
|
this._running++;
|
|
114
135
|
let t = !1;
|
|
115
136
|
return () => {
|
|
@@ -274,7 +295,7 @@ require_once( ${phpVar(s)}. "/wp-load.php" );
|
|
|
274
295
|
require_once( ${phpVar(s)}. "/wp-admin/includes/plugin.php" );
|
|
275
296
|
|
|
276
297
|
// Set current user to admin
|
|
277
|
-
|
|
298
|
+
wp_set_current_user( get_users(array('role' => 'Administrator') )[0]->ID );
|
|
278
299
|
|
|
279
300
|
$plugin_path = ${phpVar(t)};
|
|
280
301
|
|
|
@@ -304,7 +325,7 @@ define( 'WP_ADMIN', true );
|
|
|
304
325
|
require_once( ${phpVar(n)}. "/wp-load.php" );
|
|
305
326
|
|
|
306
327
|
// Set current user to admin
|
|
307
|
-
|
|
328
|
+
wp_set_current_user( get_users(array('role' => 'Administrator') )[0]->ID );
|
|
308
329
|
|
|
309
330
|
switch_theme( ${phpVar(t)} );
|
|
310
331
|
`
|
|
@@ -341,8 +362,6 @@ switch_theme( ${phpVar(t)} );
|
|
|
341
362
|
`
|
|
342
363
|
});
|
|
343
364
|
return await rm(e, { path: n }), o;
|
|
344
|
-
}, setPhpIniEntry = async (e, { key: t, value: r }) => {
|
|
345
|
-
await e.setPhpIniEntry(t, r);
|
|
346
365
|
}, request = async (e, { request: t }) => {
|
|
347
366
|
const r = await e.request(t);
|
|
348
367
|
if (r.httpStatusCode > 399 || r.httpStatusCode < 200)
|
|
@@ -793,7 +812,7 @@ define( 'WP_ADMIN', true );
|
|
|
793
812
|
require_once(${phpVar(s)} . "/wp-load.php");
|
|
794
813
|
|
|
795
814
|
// Set current user to admin
|
|
796
|
-
|
|
815
|
+
( get_users(array('role' => 'Administrator') )[0] );
|
|
797
816
|
|
|
798
817
|
require_once(${phpVar(s)} . "/wp-admin/includes/plugin.php");
|
|
799
818
|
$plugins_root = ${phpVar(s)} . "/wp-content/plugins";
|
|
@@ -858,16 +877,16 @@ echo json_encode($deactivated_plugins);
|
|
|
858
877
|
PATH_CURRENT_SITE: r
|
|
859
878
|
}
|
|
860
879
|
});
|
|
861
|
-
const
|
|
880
|
+
const p = new URL(await e.absoluteUrl), g = isURLScoped(p) ? "scope:" + getURLScope(p) : null;
|
|
862
881
|
await e.writeFile(
|
|
863
882
|
joinPaths(s, "/wp-content/sunrise.php"),
|
|
864
883
|
`<?php
|
|
865
884
|
if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
|
|
866
885
|
define( 'BLOG_ID_CURRENT_SITE', 1 );
|
|
867
886
|
}
|
|
868
|
-
$folder = ${phpVar(
|
|
887
|
+
$folder = ${phpVar(g)};
|
|
869
888
|
if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
|
|
870
|
-
$_SERVER['HTTP_HOST'] = ${phpVar(
|
|
889
|
+
$_SERVER['HTTP_HOST'] = ${phpVar(p.hostname)};
|
|
871
890
|
$_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
|
|
872
891
|
}
|
|
873
892
|
`
|
|
@@ -1049,14 +1068,14 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
|
|
|
1049
1068
|
extractToPath: s
|
|
1050
1069
|
}), s = joinPaths(s, r);
|
|
1051
1070
|
const i = joinPaths(s, "wp-content"), o = joinPaths(n, "wp-content");
|
|
1052
|
-
for (const
|
|
1053
|
-
const
|
|
1071
|
+
for (const p of wpContentFilesExcludedFromExport) {
|
|
1072
|
+
const g = joinPaths(
|
|
1054
1073
|
i,
|
|
1055
|
-
|
|
1074
|
+
p
|
|
1056
1075
|
);
|
|
1057
|
-
await removePath(e,
|
|
1058
|
-
const O = joinPaths(o,
|
|
1059
|
-
await e.fileExists(O) && (await e.mkdir(dirname(
|
|
1076
|
+
await removePath(e, g);
|
|
1077
|
+
const O = joinPaths(o, p);
|
|
1078
|
+
await e.fileExists(O) && (await e.mkdir(dirname(g)), await e.mv(O, g));
|
|
1060
1079
|
}
|
|
1061
1080
|
const l = joinPaths(
|
|
1062
1081
|
s,
|
|
@@ -1068,10 +1087,10 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
|
|
|
1068
1087
|
l
|
|
1069
1088
|
);
|
|
1070
1089
|
const d = await e.listFiles(s);
|
|
1071
|
-
for (const
|
|
1072
|
-
await removePath(e, joinPaths(n,
|
|
1073
|
-
joinPaths(s,
|
|
1074
|
-
joinPaths(n,
|
|
1090
|
+
for (const p of d)
|
|
1091
|
+
await removePath(e, joinPaths(n, p)), await e.mv(
|
|
1092
|
+
joinPaths(s, p),
|
|
1093
|
+
joinPaths(n, p)
|
|
1075
1094
|
);
|
|
1076
1095
|
await e.rmdir(s), await defineSiteUrl(e, {
|
|
1077
1096
|
siteUrl: await e.absoluteUrl
|
|
@@ -1113,14 +1132,14 @@ async function installAsset(e, {
|
|
|
1113
1132
|
prependPath: !0
|
|
1114
1133
|
});
|
|
1115
1134
|
u = u.filter((S) => !S.endsWith("/__MACOSX"));
|
|
1116
|
-
const
|
|
1117
|
-
let
|
|
1118
|
-
|
|
1119
|
-
const C = `${t}/${
|
|
1135
|
+
const p = u.length === 1 && await e.isDir(u[0]);
|
|
1136
|
+
let g, O = "";
|
|
1137
|
+
p ? (O = u[0], g = u[0].split("/").pop()) : (O = d, g = i);
|
|
1138
|
+
const C = `${t}/${g}`;
|
|
1120
1139
|
if (await e.fileExists(C)) {
|
|
1121
1140
|
if (!await e.isDir(C))
|
|
1122
1141
|
throw new Error(
|
|
1123
|
-
`Cannot install asset ${
|
|
1142
|
+
`Cannot install asset ${g} to ${C} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`
|
|
1124
1143
|
);
|
|
1125
1144
|
if (n === "overwrite")
|
|
1126
1145
|
await e.rmdir(C, {
|
|
@@ -1130,16 +1149,16 @@ async function installAsset(e, {
|
|
|
1130
1149
|
if (n === "skip")
|
|
1131
1150
|
return {
|
|
1132
1151
|
assetFolderPath: C,
|
|
1133
|
-
assetFolderName:
|
|
1152
|
+
assetFolderName: g
|
|
1134
1153
|
};
|
|
1135
1154
|
throw new Error(
|
|
1136
|
-
`Cannot install asset ${
|
|
1155
|
+
`Cannot install asset ${g} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`
|
|
1137
1156
|
);
|
|
1138
1157
|
}
|
|
1139
1158
|
}
|
|
1140
1159
|
return await e.mv(O, C), {
|
|
1141
1160
|
assetFolderPath: C,
|
|
1142
|
-
assetFolderName:
|
|
1161
|
+
assetFolderName: g
|
|
1143
1162
|
};
|
|
1144
1163
|
} finally {
|
|
1145
1164
|
await e.rmdir(l, {
|
|
@@ -1298,7 +1317,6 @@ const allStepHandlers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1298
1317
|
runPHPWithOptions,
|
|
1299
1318
|
runSql,
|
|
1300
1319
|
runWpInstallationWizard,
|
|
1301
|
-
setPhpIniEntry,
|
|
1302
1320
|
setSiteOptions,
|
|
1303
1321
|
unzip,
|
|
1304
1322
|
updateUserMeta,
|
|
@@ -1731,96 +1749,7 @@ const SupportedPHPVersions = [
|
|
|
1731
1749
|
], SupportedPHPExtensionBundles = {
|
|
1732
1750
|
"kitchen-sink": SupportedPHPExtensionsList,
|
|
1733
1751
|
light: []
|
|
1734
|
-
};
|
|
1735
|
-
var Ae, Ge;
|
|
1736
|
-
class PHPBrowser {
|
|
1737
|
-
/**
|
|
1738
|
-
* @param server - The PHP server to browse.
|
|
1739
|
-
* @param config - The browser configuration.
|
|
1740
|
-
*/
|
|
1741
|
-
constructor(t, r = {}) {
|
|
1742
|
-
Q(this, Ae, void 0);
|
|
1743
|
-
Q(this, Ge, void 0);
|
|
1744
|
-
this.requestHandler = t, te(this, Ae, {}), te(this, Ge, {
|
|
1745
|
-
handleRedirects: !1,
|
|
1746
|
-
maxRedirects: 4,
|
|
1747
|
-
...r
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
/**
|
|
1751
|
-
* Sends the request to the server.
|
|
1752
|
-
*
|
|
1753
|
-
* When cookies are present in the response, this method stores
|
|
1754
|
-
* them and sends them with any subsequent requests.
|
|
1755
|
-
*
|
|
1756
|
-
* When a redirection is present in the response, this method
|
|
1757
|
-
* follows it by discarding a response and sending a subsequent
|
|
1758
|
-
* request.
|
|
1759
|
-
*
|
|
1760
|
-
* @param request - The request.
|
|
1761
|
-
* @param redirects - Internal. The number of redirects handled so far.
|
|
1762
|
-
* @returns PHPRequestHandler response.
|
|
1763
|
-
*/
|
|
1764
|
-
async request(t, r = 0) {
|
|
1765
|
-
const n = await this.requestHandler.request({
|
|
1766
|
-
...t,
|
|
1767
|
-
headers: {
|
|
1768
|
-
...t.headers,
|
|
1769
|
-
cookie: this.serializeCookies()
|
|
1770
|
-
}
|
|
1771
|
-
});
|
|
1772
|
-
if (n.headers["set-cookie"] && this.setCookies(n.headers["set-cookie"]), H(this, Ge).handleRedirects && n.headers.location && r < H(this, Ge).maxRedirects) {
|
|
1773
|
-
const s = new URL(
|
|
1774
|
-
n.headers.location[0],
|
|
1775
|
-
this.requestHandler.absoluteUrl
|
|
1776
|
-
);
|
|
1777
|
-
return this.request(
|
|
1778
|
-
{
|
|
1779
|
-
url: s.toString(),
|
|
1780
|
-
method: "GET",
|
|
1781
|
-
headers: {}
|
|
1782
|
-
},
|
|
1783
|
-
r + 1
|
|
1784
|
-
);
|
|
1785
|
-
}
|
|
1786
|
-
return n;
|
|
1787
|
-
}
|
|
1788
|
-
/** @inheritDoc */
|
|
1789
|
-
pathToInternalUrl(t) {
|
|
1790
|
-
return this.requestHandler.pathToInternalUrl(t);
|
|
1791
|
-
}
|
|
1792
|
-
/** @inheritDoc */
|
|
1793
|
-
internalUrlToPath(t) {
|
|
1794
|
-
return this.requestHandler.internalUrlToPath(t);
|
|
1795
|
-
}
|
|
1796
|
-
/** @inheritDoc */
|
|
1797
|
-
get absoluteUrl() {
|
|
1798
|
-
return this.requestHandler.absoluteUrl;
|
|
1799
|
-
}
|
|
1800
|
-
/** @inheritDoc */
|
|
1801
|
-
get documentRoot() {
|
|
1802
|
-
return this.requestHandler.documentRoot;
|
|
1803
|
-
}
|
|
1804
|
-
setCookies(t) {
|
|
1805
|
-
for (const r of t)
|
|
1806
|
-
try {
|
|
1807
|
-
if (!r.includes("="))
|
|
1808
|
-
continue;
|
|
1809
|
-
const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
|
|
1810
|
-
H(this, Ae)[s] = i;
|
|
1811
|
-
} catch (n) {
|
|
1812
|
-
console.error(n);
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
serializeCookies() {
|
|
1816
|
-
const t = [];
|
|
1817
|
-
for (const r in H(this, Ae))
|
|
1818
|
-
t.push(`${r}=${H(this, Ae)[r]}`);
|
|
1819
|
-
return t.join("; ");
|
|
1820
|
-
}
|
|
1821
|
-
}
|
|
1822
|
-
Ae = new WeakMap(), Ge = new WeakMap();
|
|
1823
|
-
const DEFAULT_BASE_URL = "http://example.com";
|
|
1752
|
+
}, DEFAULT_BASE_URL = "http://example.com";
|
|
1824
1753
|
function toRelativeUrl(e) {
|
|
1825
1754
|
return e.toString().substring(e.origin.length);
|
|
1826
1755
|
}
|
|
@@ -1858,7 +1787,30 @@ function fileToUint8Array(e) {
|
|
|
1858
1787
|
}, r.readAsArrayBuffer(e);
|
|
1859
1788
|
});
|
|
1860
1789
|
}
|
|
1861
|
-
|
|
1790
|
+
class HttpCookieStore {
|
|
1791
|
+
constructor() {
|
|
1792
|
+
this.cookies = {};
|
|
1793
|
+
}
|
|
1794
|
+
rememberCookiesFromResponseHeaders(t) {
|
|
1795
|
+
if (t != null && t["set-cookie"])
|
|
1796
|
+
for (const r of t["set-cookie"])
|
|
1797
|
+
try {
|
|
1798
|
+
if (!r.includes("="))
|
|
1799
|
+
continue;
|
|
1800
|
+
const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
|
|
1801
|
+
this.cookies[s] = i;
|
|
1802
|
+
} catch (n) {
|
|
1803
|
+
console.error(n);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
getCookieRequestHeader() {
|
|
1807
|
+
const t = [];
|
|
1808
|
+
for (const r in this.cookies)
|
|
1809
|
+
t.push(`${r}=${this.cookies[r]}`);
|
|
1810
|
+
return t.join("; ");
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
var Pe, We, ct, je, Be, ve, Ge, Ae, Ke, ft, Wt, ht, Bt, mt, Gt;
|
|
1862
1814
|
class PHPRequestHandler {
|
|
1863
1815
|
/**
|
|
1864
1816
|
* @param php - The PHP instance.
|
|
@@ -1871,7 +1823,7 @@ class PHPRequestHandler {
|
|
|
1871
1823
|
* @param fsPath - Absolute path of the static file to serve.
|
|
1872
1824
|
* @returns The response.
|
|
1873
1825
|
*/
|
|
1874
|
-
|
|
1826
|
+
K(this, ft);
|
|
1875
1827
|
/**
|
|
1876
1828
|
* Runs the requested PHP file with all the request and $_SERVER
|
|
1877
1829
|
* superglobals populated.
|
|
@@ -1879,7 +1831,7 @@ class PHPRequestHandler {
|
|
|
1879
1831
|
* @param request - The request.
|
|
1880
1832
|
* @returns The response.
|
|
1881
1833
|
*/
|
|
1882
|
-
|
|
1834
|
+
K(this, ht);
|
|
1883
1835
|
/**
|
|
1884
1836
|
* Resolve the requested path to the filesystem path of the requested PHP file.
|
|
1885
1837
|
*
|
|
@@ -1889,55 +1841,120 @@ class PHPRequestHandler {
|
|
|
1889
1841
|
* @throws {Error} If the requested path doesn't exist.
|
|
1890
1842
|
* @returns The resolved filesystem path.
|
|
1891
1843
|
*/
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1844
|
+
K(this, mt);
|
|
1845
|
+
K(this, Pe, void 0);
|
|
1846
|
+
K(this, We, void 0);
|
|
1847
|
+
K(this, ct, void 0);
|
|
1848
|
+
K(this, je, void 0);
|
|
1849
|
+
K(this, Be, void 0);
|
|
1850
|
+
K(this, ve, void 0);
|
|
1851
|
+
K(this, Ge, void 0);
|
|
1852
|
+
K(this, Ae, void 0);
|
|
1853
|
+
K(this, Ke, void 0);
|
|
1854
|
+
ie(this, Ae, new Semaphore({ concurrency: 1 }));
|
|
1902
1855
|
const {
|
|
1903
1856
|
documentRoot: n = "/www/",
|
|
1904
1857
|
absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : "",
|
|
1905
1858
|
rewriteRules: i = []
|
|
1906
1859
|
} = r;
|
|
1907
|
-
this.php = t,
|
|
1860
|
+
this.php = t, ie(this, Ke, new HttpCookieStore()), ie(this, Pe, n);
|
|
1908
1861
|
const o = new URL(s);
|
|
1909
|
-
|
|
1910
|
-
const l = H(this,
|
|
1911
|
-
|
|
1912
|
-
H(this,
|
|
1913
|
-
l ? `:${H(this,
|
|
1914
|
-
].join("")),
|
|
1915
|
-
`${H(this,
|
|
1916
|
-
H(this,
|
|
1862
|
+
ie(this, ct, o.hostname), ie(this, je, o.port ? Number(o.port) : o.protocol === "https:" ? 443 : 80), ie(this, We, (o.protocol || "").replace(":", ""));
|
|
1863
|
+
const l = H(this, je) !== 443 && H(this, je) !== 80;
|
|
1864
|
+
ie(this, Be, [
|
|
1865
|
+
H(this, ct),
|
|
1866
|
+
l ? `:${H(this, je)}` : ""
|
|
1867
|
+
].join("")), ie(this, ve, o.pathname.replace(/\/+$/, "")), ie(this, Ge, [
|
|
1868
|
+
`${H(this, We)}://`,
|
|
1869
|
+
H(this, Be),
|
|
1917
1870
|
H(this, ve)
|
|
1918
1871
|
].join("")), this.rewriteRules = i;
|
|
1919
1872
|
}
|
|
1920
|
-
/**
|
|
1873
|
+
/**
|
|
1874
|
+
* Converts a path to an absolute URL based at the PHPRequestHandler
|
|
1875
|
+
* root.
|
|
1876
|
+
*
|
|
1877
|
+
* @param path The server path to convert to an absolute URL.
|
|
1878
|
+
* @returns The absolute URL.
|
|
1879
|
+
*/
|
|
1921
1880
|
pathToInternalUrl(t) {
|
|
1922
1881
|
return `${this.absoluteUrl}${t}`;
|
|
1923
1882
|
}
|
|
1924
|
-
/**
|
|
1883
|
+
/**
|
|
1884
|
+
* Converts an absolute URL based at the PHPRequestHandler to a relative path
|
|
1885
|
+
* without the server pathname and scope.
|
|
1886
|
+
*
|
|
1887
|
+
* @param internalUrl An absolute URL based at the PHPRequestHandler root.
|
|
1888
|
+
* @returns The relative path.
|
|
1889
|
+
*/
|
|
1925
1890
|
internalUrlToPath(t) {
|
|
1926
1891
|
const r = new URL(t);
|
|
1927
1892
|
return r.pathname.startsWith(H(this, ve)) && (r.pathname = r.pathname.slice(H(this, ve).length)), toRelativeUrl(r);
|
|
1928
1893
|
}
|
|
1929
1894
|
get isRequestRunning() {
|
|
1930
|
-
return H(this,
|
|
1895
|
+
return H(this, Ae).running > 0;
|
|
1931
1896
|
}
|
|
1932
|
-
/**
|
|
1897
|
+
/**
|
|
1898
|
+
* The absolute URL of this PHPRequestHandler instance.
|
|
1899
|
+
*/
|
|
1933
1900
|
get absoluteUrl() {
|
|
1934
|
-
return H(this,
|
|
1901
|
+
return H(this, Ge);
|
|
1935
1902
|
}
|
|
1936
|
-
/**
|
|
1903
|
+
/**
|
|
1904
|
+
* The directory in the PHP filesystem where the server will look
|
|
1905
|
+
* for the files to serve. Default: `/var/www`.
|
|
1906
|
+
*/
|
|
1937
1907
|
get documentRoot() {
|
|
1938
1908
|
return H(this, Pe);
|
|
1939
1909
|
}
|
|
1940
|
-
/**
|
|
1910
|
+
/**
|
|
1911
|
+
* Serves the request – either by serving a static file, or by
|
|
1912
|
+
* dispatching it to the PHP runtime.
|
|
1913
|
+
*
|
|
1914
|
+
* The request() method mode behaves like a web server and only works if
|
|
1915
|
+
* the PHP was initialized with a `requestHandler` option (which the online version
|
|
1916
|
+
* of WordPress Playground does by default).
|
|
1917
|
+
*
|
|
1918
|
+
* In the request mode, you pass an object containing the request information
|
|
1919
|
+
* (method, headers, body, etc.) and the path to the PHP file to run:
|
|
1920
|
+
*
|
|
1921
|
+
* ```ts
|
|
1922
|
+
* const php = PHP.load('7.4', {
|
|
1923
|
+
* requestHandler: {
|
|
1924
|
+
* documentRoot: "/www"
|
|
1925
|
+
* }
|
|
1926
|
+
* })
|
|
1927
|
+
* php.writeFile("/www/index.php", `<?php echo file_get_contents("php://input");`);
|
|
1928
|
+
* const result = await php.request({
|
|
1929
|
+
* method: "GET",
|
|
1930
|
+
* headers: {
|
|
1931
|
+
* "Content-Type": "text/plain"
|
|
1932
|
+
* },
|
|
1933
|
+
* body: "Hello world!",
|
|
1934
|
+
* path: "/www/index.php"
|
|
1935
|
+
* });
|
|
1936
|
+
* // result.text === "Hello world!"
|
|
1937
|
+
* ```
|
|
1938
|
+
*
|
|
1939
|
+
* The `request()` method cannot be used in conjunction with `cli()`.
|
|
1940
|
+
*
|
|
1941
|
+
* @example
|
|
1942
|
+
* ```js
|
|
1943
|
+
* const output = await php.request({
|
|
1944
|
+
* method: 'GET',
|
|
1945
|
+
* url: '/index.php',
|
|
1946
|
+
* headers: {
|
|
1947
|
+
* 'X-foo': 'bar',
|
|
1948
|
+
* },
|
|
1949
|
+
* body: {
|
|
1950
|
+
* foo: 'bar',
|
|
1951
|
+
* },
|
|
1952
|
+
* });
|
|
1953
|
+
* console.log(output.stdout); // "Hello world!"
|
|
1954
|
+
* ```
|
|
1955
|
+
*
|
|
1956
|
+
* @param request - PHP Request data.
|
|
1957
|
+
*/
|
|
1941
1958
|
async request(t) {
|
|
1942
1959
|
const r = t.url.startsWith("http://") || t.url.startsWith("https://"), n = new URL(
|
|
1943
1960
|
// Remove the hash part of the URL as it's not meant for the server.
|
|
@@ -1950,10 +1967,10 @@ class PHPRequestHandler {
|
|
|
1950
1967
|
),
|
|
1951
1968
|
this.rewriteRules
|
|
1952
1969
|
), i = joinPaths(H(this, Pe), s);
|
|
1953
|
-
return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this,
|
|
1970
|
+
return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, ht, Bt).call(this, t, n) : ce(this, ft, Wt).call(this, i);
|
|
1954
1971
|
}
|
|
1955
1972
|
}
|
|
1956
|
-
Pe = new WeakMap(),
|
|
1973
|
+
Pe = new WeakMap(), We = new WeakMap(), ct = new WeakMap(), je = new WeakMap(), Be = new WeakMap(), ve = new WeakMap(), Ge = new WeakMap(), Ae = new WeakMap(), Ke = new WeakMap(), ft = new WeakSet(), Wt = function(t) {
|
|
1957
1974
|
if (!this.php.fileExists(t))
|
|
1958
1975
|
return new PHPResponse(
|
|
1959
1976
|
404,
|
|
@@ -1978,9 +1995,9 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
1978
1995
|
},
|
|
1979
1996
|
r
|
|
1980
1997
|
);
|
|
1981
|
-
},
|
|
1998
|
+
}, ht = new WeakSet(), Bt = async function(t, r) {
|
|
1982
1999
|
var s;
|
|
1983
|
-
if (H(this,
|
|
2000
|
+
if (H(this, Ae).running > 0 && ((s = t.headers) == null ? void 0 : s["x-request-issuer"]) === "php")
|
|
1984
2001
|
return console.warn(
|
|
1985
2002
|
"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."
|
|
1986
2003
|
), new PHPResponse(
|
|
@@ -1988,26 +2005,23 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
1988
2005
|
{},
|
|
1989
2006
|
new TextEncoder().encode("502 Bad Gateway")
|
|
1990
2007
|
);
|
|
1991
|
-
const n = await H(this,
|
|
2008
|
+
const n = await H(this, Ae).acquire();
|
|
1992
2009
|
try {
|
|
1993
|
-
this.php.addServerGlobalEntry("REMOTE_ADDR", "127.0.0.1"), this.php.addServerGlobalEntry("DOCUMENT_ROOT", H(this, Pe)), this.php.addServerGlobalEntry(
|
|
1994
|
-
"HTTPS",
|
|
1995
|
-
H(this, Qe).startsWith("https://") ? "on" : ""
|
|
1996
|
-
);
|
|
1997
2010
|
let i = "GET";
|
|
1998
2011
|
const o = {
|
|
1999
|
-
host: H(this,
|
|
2000
|
-
...normalizeHeaders(t.headers || {})
|
|
2012
|
+
host: H(this, Be),
|
|
2013
|
+
...normalizeHeaders(t.headers || {}),
|
|
2014
|
+
cookie: H(this, Ke).getCookieRequestHeader()
|
|
2001
2015
|
};
|
|
2002
2016
|
let l = t.body;
|
|
2003
2017
|
if (typeof l == "object" && !(l instanceof Uint8Array)) {
|
|
2004
2018
|
i = "POST";
|
|
2005
|
-
const { bytes: u, contentType:
|
|
2006
|
-
l = u, o["content-type"] =
|
|
2019
|
+
const { bytes: u, contentType: p } = await encodeAsMultipart(l);
|
|
2020
|
+
l = u, o["content-type"] = p;
|
|
2007
2021
|
}
|
|
2008
2022
|
let d;
|
|
2009
2023
|
try {
|
|
2010
|
-
d = ce(this,
|
|
2024
|
+
d = ce(this, mt, Gt).call(this, decodeURIComponent(r.pathname));
|
|
2011
2025
|
} catch {
|
|
2012
2026
|
return new PHPResponse(
|
|
2013
2027
|
404,
|
|
@@ -2015,21 +2029,36 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
2015
2029
|
new TextEncoder().encode("404 File not found")
|
|
2016
2030
|
);
|
|
2017
2031
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2032
|
+
try {
|
|
2033
|
+
const u = await this.php.run({
|
|
2034
|
+
relativeUri: ensurePathPrefix(
|
|
2035
|
+
toRelativeUrl(r),
|
|
2036
|
+
H(this, ve)
|
|
2037
|
+
),
|
|
2038
|
+
protocol: H(this, We),
|
|
2039
|
+
method: t.method || i,
|
|
2040
|
+
$_SERVER: {
|
|
2041
|
+
REMOTE_ADDR: "127.0.0.1",
|
|
2042
|
+
DOCUMENT_ROOT: H(this, Pe),
|
|
2043
|
+
HTTPS: H(this, Ge).startsWith("https://") ? "on" : ""
|
|
2044
|
+
},
|
|
2045
|
+
body: l,
|
|
2046
|
+
scriptPath: d,
|
|
2047
|
+
headers: o
|
|
2048
|
+
});
|
|
2049
|
+
return H(this, Ke).rememberCookiesFromResponseHeaders(
|
|
2050
|
+
u.headers
|
|
2051
|
+
), u;
|
|
2052
|
+
} catch (u) {
|
|
2053
|
+
const p = u;
|
|
2054
|
+
if (p != null && p.response)
|
|
2055
|
+
return p.response;
|
|
2056
|
+
throw u;
|
|
2057
|
+
}
|
|
2029
2058
|
} finally {
|
|
2030
2059
|
n();
|
|
2031
2060
|
}
|
|
2032
|
-
},
|
|
2061
|
+
}, mt = new WeakSet(), Gt = function(t) {
|
|
2033
2062
|
let r = removePathPrefix(t, H(this, ve));
|
|
2034
2063
|
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";
|
|
2035
2064
|
const n = `${H(this, Pe)}${r}`;
|
|
@@ -2073,6 +2102,38 @@ function inferMimeType(e) {
|
|
|
2073
2102
|
case "txt":
|
|
2074
2103
|
case "md":
|
|
2075
2104
|
return "text/plain";
|
|
2105
|
+
case "pdf":
|
|
2106
|
+
return "application/pdf";
|
|
2107
|
+
case "webp":
|
|
2108
|
+
return "image/webp";
|
|
2109
|
+
case "mp3":
|
|
2110
|
+
return "audio/mpeg";
|
|
2111
|
+
case "mp4":
|
|
2112
|
+
return "video/mp4";
|
|
2113
|
+
case "csv":
|
|
2114
|
+
return "text/csv";
|
|
2115
|
+
case "xls":
|
|
2116
|
+
return "application/vnd.ms-excel";
|
|
2117
|
+
case "xlsx":
|
|
2118
|
+
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
2119
|
+
case "doc":
|
|
2120
|
+
return "application/msword";
|
|
2121
|
+
case "docx":
|
|
2122
|
+
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
2123
|
+
case "ppt":
|
|
2124
|
+
return "application/vnd.ms-powerpoint";
|
|
2125
|
+
case "pptx":
|
|
2126
|
+
return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
2127
|
+
case "zip":
|
|
2128
|
+
return "application/zip";
|
|
2129
|
+
case "rar":
|
|
2130
|
+
return "application/x-rar-compressed";
|
|
2131
|
+
case "tar":
|
|
2132
|
+
return "application/x-tar";
|
|
2133
|
+
case "gz":
|
|
2134
|
+
return "application/gzip";
|
|
2135
|
+
case "7z":
|
|
2136
|
+
return "application/x-7z-compressed";
|
|
2076
2137
|
default:
|
|
2077
2138
|
return "application-octet-stream";
|
|
2078
2139
|
}
|
|
@@ -2185,8 +2246,8 @@ function rethrowFileSystemError(e = "") {
|
|
|
2185
2246
|
} catch (l) {
|
|
2186
2247
|
const d = typeof l == "object" ? l == null ? void 0 : l.errno : null;
|
|
2187
2248
|
if (d in FileErrorCodes) {
|
|
2188
|
-
const u = FileErrorCodes[d],
|
|
2189
|
-
throw new Error(`${
|
|
2249
|
+
const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null, g = p !== null ? e.replaceAll("{path}", p) : e;
|
|
2250
|
+
throw new Error(`${g}: ${u}`, {
|
|
2190
2251
|
cause: l
|
|
2191
2252
|
});
|
|
2192
2253
|
}
|
|
@@ -2209,7 +2270,12 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
|
|
|
2209
2270
|
return n && s && __defProp(t, r, s), s;
|
|
2210
2271
|
};
|
|
2211
2272
|
const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
|
|
2212
|
-
|
|
2273
|
+
class PHPExecutionFailureError extends Error {
|
|
2274
|
+
constructor(t, r, n) {
|
|
2275
|
+
super(t), this.response = r, this.source = n;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
var De, Je, Qe, be, Re, Ee, Ye, _t, Kt, gt, Jt, $t, Qt, yt, Yt, vt, Zt, wt, Xt, Pt, er, bt, tr, Et, rr, St, nr, Rt, sr, Tt, ir, kt, or, Ct, ar, Ot, cr;
|
|
2213
2279
|
class BasePHP {
|
|
2214
2280
|
/**
|
|
2215
2281
|
* Initializes a PHP runtime.
|
|
@@ -2219,29 +2285,38 @@ class BasePHP {
|
|
|
2219
2285
|
* @param serverOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
|
|
2220
2286
|
*/
|
|
2221
2287
|
constructor(e, t) {
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
)
|
|
2288
|
+
/**
|
|
2289
|
+
* Prepares the $_SERVER entries for the PHP runtime.
|
|
2290
|
+
*
|
|
2291
|
+
* @param defaults Default entries to include in $_SERVER.
|
|
2292
|
+
* @param headers HTTP headers to include in $_SERVER (as HTTP_ prefixed entries).
|
|
2293
|
+
* @param port HTTP port, used to determine infer $_SERVER['HTTPS'] value if none
|
|
2294
|
+
* was provided.
|
|
2295
|
+
* @returns Computed $_SERVER entries.
|
|
2296
|
+
*/
|
|
2297
|
+
K(this, _t);
|
|
2298
|
+
K(this, gt);
|
|
2299
|
+
K(this, $t);
|
|
2300
|
+
K(this, yt);
|
|
2301
|
+
K(this, vt);
|
|
2302
|
+
K(this, wt);
|
|
2303
|
+
K(this, Pt);
|
|
2304
|
+
K(this, bt);
|
|
2305
|
+
K(this, Et);
|
|
2306
|
+
K(this, St);
|
|
2307
|
+
K(this, Rt);
|
|
2308
|
+
K(this, Tt);
|
|
2309
|
+
K(this, kt);
|
|
2310
|
+
K(this, Ct);
|
|
2311
|
+
K(this, Ot);
|
|
2312
|
+
K(this, De, void 0);
|
|
2313
|
+
K(this, Je, void 0);
|
|
2314
|
+
K(this, Qe, void 0);
|
|
2315
|
+
K(this, be, void 0);
|
|
2316
|
+
K(this, Re, void 0);
|
|
2317
|
+
K(this, Ee, void 0);
|
|
2318
|
+
K(this, Ye, void 0);
|
|
2319
|
+
ie(this, De, []), ie(this, be, !1), ie(this, Re, null), ie(this, Ee, /* @__PURE__ */ new Map()), ie(this, Ye, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPRequestHandler(this, t));
|
|
2245
2320
|
}
|
|
2246
2321
|
addEventListener(e, t) {
|
|
2247
2322
|
H(this, Ee).has(e) || H(this, Ee).set(e, /* @__PURE__ */ new Set()), H(this, Ee).get(e).add(t);
|
|
@@ -2258,7 +2333,7 @@ class BasePHP {
|
|
|
2258
2333
|
}
|
|
2259
2334
|
/** @inheritDoc */
|
|
2260
2335
|
async onMessage(e) {
|
|
2261
|
-
H(this,
|
|
2336
|
+
H(this, Ye).push(e);
|
|
2262
2337
|
}
|
|
2263
2338
|
/** @inheritDoc */
|
|
2264
2339
|
async setSpawnHandler(handler) {
|
|
@@ -2266,21 +2341,19 @@ class BasePHP {
|
|
|
2266
2341
|
}
|
|
2267
2342
|
/** @inheritDoc */
|
|
2268
2343
|
get absoluteUrl() {
|
|
2269
|
-
return this.requestHandler.
|
|
2344
|
+
return this.requestHandler.absoluteUrl;
|
|
2270
2345
|
}
|
|
2271
2346
|
/** @inheritDoc */
|
|
2272
2347
|
get documentRoot() {
|
|
2273
|
-
return this.requestHandler.
|
|
2348
|
+
return this.requestHandler.documentRoot;
|
|
2274
2349
|
}
|
|
2275
2350
|
/** @inheritDoc */
|
|
2276
2351
|
pathToInternalUrl(e) {
|
|
2277
|
-
return this.requestHandler.
|
|
2352
|
+
return this.requestHandler.pathToInternalUrl(e);
|
|
2278
2353
|
}
|
|
2279
2354
|
/** @inheritDoc */
|
|
2280
2355
|
internalUrlToPath(e) {
|
|
2281
|
-
return this.requestHandler.
|
|
2282
|
-
e
|
|
2283
|
-
);
|
|
2356
|
+
return this.requestHandler.internalUrlToPath(e);
|
|
2284
2357
|
}
|
|
2285
2358
|
initializeRuntime(e) {
|
|
2286
2359
|
if (this[__private__dont__use])
|
|
@@ -2289,13 +2362,13 @@ class BasePHP {
|
|
|
2289
2362
|
if (!t)
|
|
2290
2363
|
throw new Error("Invalid PHP runtime id.");
|
|
2291
2364
|
this[__private__dont__use] = t, t.onMessage = async (r) => {
|
|
2292
|
-
for (const n of H(this,
|
|
2365
|
+
for (const n of H(this, Ye)) {
|
|
2293
2366
|
const s = await n(r);
|
|
2294
2367
|
if (s)
|
|
2295
2368
|
return s;
|
|
2296
2369
|
}
|
|
2297
2370
|
return "";
|
|
2298
|
-
},
|
|
2371
|
+
}, ie(this, Re, improveWASMErrorReporting(t)), this.dispatchEvent({
|
|
2299
2372
|
type: "runtime.initialized"
|
|
2300
2373
|
});
|
|
2301
2374
|
}
|
|
@@ -2310,13 +2383,13 @@ class BasePHP {
|
|
|
2310
2383
|
throw new Error(
|
|
2311
2384
|
"Could not set SAPI name. This can only be done before the PHP WASM module is initialized.Did you already dispatch any requests?"
|
|
2312
2385
|
);
|
|
2313
|
-
|
|
2386
|
+
ie(this, Qe, e);
|
|
2314
2387
|
}
|
|
2315
2388
|
/** @inheritDoc */
|
|
2316
2389
|
setPhpIniPath(e) {
|
|
2317
2390
|
if (H(this, be))
|
|
2318
2391
|
throw new Error("Cannot set PHP ini path after calling run().");
|
|
2319
|
-
|
|
2392
|
+
ie(this, Je, e), this[__private__dont__use].ccall(
|
|
2320
2393
|
"wasm_set_phpini_path",
|
|
2321
2394
|
null,
|
|
2322
2395
|
["string"],
|
|
@@ -2327,42 +2400,47 @@ class BasePHP {
|
|
|
2327
2400
|
setPhpIniEntry(e, t) {
|
|
2328
2401
|
if (H(this, be))
|
|
2329
2402
|
throw new Error("Cannot set PHP ini entries after calling run().");
|
|
2330
|
-
H(this,
|
|
2403
|
+
H(this, De).push([e, t]);
|
|
2331
2404
|
}
|
|
2332
2405
|
/** @inheritDoc */
|
|
2333
2406
|
chdir(e) {
|
|
2334
2407
|
this[__private__dont__use].FS.chdir(e);
|
|
2335
2408
|
}
|
|
2336
2409
|
/** @inheritDoc */
|
|
2337
|
-
async request(e
|
|
2410
|
+
async request(e) {
|
|
2338
2411
|
if (!this.requestHandler)
|
|
2339
2412
|
throw new Error("No request handler available.");
|
|
2340
|
-
return this.requestHandler.request(e
|
|
2413
|
+
return this.requestHandler.request(e);
|
|
2341
2414
|
}
|
|
2342
2415
|
/** @inheritDoc */
|
|
2343
2416
|
async run(e) {
|
|
2344
2417
|
const t = await this.semaphore.acquire();
|
|
2345
2418
|
let r;
|
|
2346
2419
|
try {
|
|
2347
|
-
if (H(this, be) || (ce(this, gt,
|
|
2420
|
+
if (H(this, be) || (ce(this, gt, Jt).call(this), ie(this, be, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
|
|
2348
2421
|
throw new Error(
|
|
2349
2422
|
`The script path "${e.scriptPath}" does not exist.`
|
|
2350
2423
|
);
|
|
2351
|
-
ce(this,
|
|
2352
|
-
const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443";
|
|
2353
|
-
ce(this,
|
|
2354
|
-
const
|
|
2355
|
-
for (const
|
|
2356
|
-
ce(this, Tt,
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2424
|
+
ce(this, Rt, sr).call(this, e.scriptPath || ""), ce(this, yt, Yt).call(this, e.relativeUri || ""), ce(this, bt, tr).call(this, e.method || "GET");
|
|
2425
|
+
const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443", i = ce(this, Pt, er).call(this, s, e.protocol || "http");
|
|
2426
|
+
ce(this, vt, Zt).call(this, s), ce(this, wt, Xt).call(this, i), ce(this, Et, rr).call(this, n), e.body && (r = ce(this, St, nr).call(this, e.body)), typeof e.code == "string" && ce(this, Ct, ar).call(this, " ?>" + e.code);
|
|
2427
|
+
const o = ce(this, _t, Kt).call(this, e.$_SERVER, n, i);
|
|
2428
|
+
for (const u in o)
|
|
2429
|
+
ce(this, Tt, ir).call(this, u, o[u]);
|
|
2430
|
+
const l = e.env || {};
|
|
2431
|
+
for (const u in l)
|
|
2432
|
+
ce(this, kt, or).call(this, u, l[u]);
|
|
2433
|
+
const d = await ce(this, Ot, cr).call(this);
|
|
2434
|
+
if (d.exitCode !== 0) {
|
|
2435
|
+
console.warn("PHP.run() output was:", d.text);
|
|
2436
|
+
const u = new PHPExecutionFailureError(
|
|
2437
|
+
`PHP.run() failed with exit code ${d.exitCode} and the following output: ` + d.errors,
|
|
2438
|
+
d,
|
|
2439
|
+
"request"
|
|
2362
2440
|
);
|
|
2363
|
-
throw
|
|
2441
|
+
throw console.error(u), u;
|
|
2364
2442
|
}
|
|
2365
|
-
return
|
|
2443
|
+
return d;
|
|
2366
2444
|
} catch (n) {
|
|
2367
2445
|
throw this.dispatchEvent({
|
|
2368
2446
|
type: "request.error",
|
|
@@ -2380,9 +2458,6 @@ class BasePHP {
|
|
|
2380
2458
|
}
|
|
2381
2459
|
}
|
|
2382
2460
|
}
|
|
2383
|
-
addServerGlobalEntry(e, t) {
|
|
2384
|
-
H(this, Te)[e] = t;
|
|
2385
|
-
}
|
|
2386
2461
|
defineConstant(e, t) {
|
|
2387
2462
|
let r = {};
|
|
2388
2463
|
try {
|
|
@@ -2470,17 +2545,18 @@ class BasePHP {
|
|
|
2470
2545
|
* interrupting the operations of this PHP instance.
|
|
2471
2546
|
*
|
|
2472
2547
|
* @param runtime
|
|
2548
|
+
* @param cwd. Internal, the VFS path to recreate in the new runtime.
|
|
2549
|
+
* This arg is temporary and will be removed once BasePHP
|
|
2550
|
+
* is fully decoupled from the request handler and
|
|
2551
|
+
* accepts a constructor-level cwd argument.
|
|
2473
2552
|
*/
|
|
2474
|
-
hotSwapPHPRuntime(e) {
|
|
2475
|
-
const
|
|
2553
|
+
hotSwapPHPRuntime(e, t) {
|
|
2554
|
+
const r = this[__private__dont__use].FS;
|
|
2476
2555
|
try {
|
|
2477
2556
|
this.exit();
|
|
2478
2557
|
} catch {
|
|
2479
2558
|
}
|
|
2480
|
-
|
|
2481
|
-
const r = this.documentRoot;
|
|
2482
|
-
copyFS(t, this[__private__dont__use].FS, r);
|
|
2483
|
-
}
|
|
2559
|
+
this.initializeRuntime(e), H(this, Je) && this.setPhpIniPath(H(this, Je)), H(this, Qe) && this.setSapiName(H(this, Qe)), t && copyFS(r, this[__private__dont__use].FS, t);
|
|
2484
2560
|
}
|
|
2485
2561
|
exit(e = 0) {
|
|
2486
2562
|
this.dispatchEvent({
|
|
@@ -2490,10 +2566,20 @@ class BasePHP {
|
|
|
2490
2566
|
this[__private__dont__use]._exit(e);
|
|
2491
2567
|
} catch {
|
|
2492
2568
|
}
|
|
2493
|
-
|
|
2569
|
+
ie(this, be, !1), ie(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
|
|
2494
2570
|
}
|
|
2495
2571
|
}
|
|
2496
|
-
|
|
2572
|
+
De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(), Re = new WeakMap(), Ee = new WeakMap(), Ye = new WeakMap(), _t = new WeakSet(), Kt = function(e, t, r) {
|
|
2573
|
+
const n = {
|
|
2574
|
+
...e || {}
|
|
2575
|
+
};
|
|
2576
|
+
n.HTTPS = n.HTTPS || r === 443 ? "on" : "off";
|
|
2577
|
+
for (const s in t) {
|
|
2578
|
+
let i = "HTTP_";
|
|
2579
|
+
["content-type", "content-length"].includes(s.toLowerCase()) && (i = ""), n[`${i}${s.toUpperCase().replace(/-/g, "_")}`] = t[s];
|
|
2580
|
+
}
|
|
2581
|
+
return n;
|
|
2582
|
+
}, gt = new WeakSet(), Jt = function() {
|
|
2497
2583
|
if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
|
|
2498
2584
|
"/internal/consts.php",
|
|
2499
2585
|
`<?php
|
|
@@ -2505,8 +2591,8 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2505
2591
|
}
|
|
2506
2592
|
}
|
|
2507
2593
|
}`
|
|
2508
|
-
), H(this,
|
|
2509
|
-
const e = H(this,
|
|
2594
|
+
), H(this, De).length > 0) {
|
|
2595
|
+
const e = H(this, De).map(([t, r]) => `${t}=${r}`).join(`
|
|
2510
2596
|
`) + `
|
|
2511
2597
|
|
|
2512
2598
|
`;
|
|
@@ -2518,7 +2604,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2518
2604
|
);
|
|
2519
2605
|
}
|
|
2520
2606
|
this[__private__dont__use].ccall("php_wasm_init", null, [], []);
|
|
2521
|
-
},
|
|
2607
|
+
}, $t = new WeakSet(), Qt = function() {
|
|
2522
2608
|
const e = "/internal/headers.json";
|
|
2523
2609
|
if (!this.fileExists(e))
|
|
2524
2610
|
throw new Error(
|
|
@@ -2535,7 +2621,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2535
2621
|
headers: r,
|
|
2536
2622
|
httpStatusCode: t.status
|
|
2537
2623
|
};
|
|
2538
|
-
},
|
|
2624
|
+
}, yt = new WeakSet(), Yt = function(e) {
|
|
2539
2625
|
if (this[__private__dont__use].ccall(
|
|
2540
2626
|
"wasm_set_request_uri",
|
|
2541
2627
|
null,
|
|
@@ -2550,32 +2636,35 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2550
2636
|
[t]
|
|
2551
2637
|
);
|
|
2552
2638
|
}
|
|
2553
|
-
},
|
|
2639
|
+
}, vt = new WeakSet(), Zt = function(e) {
|
|
2554
2640
|
this[__private__dont__use].ccall(
|
|
2555
2641
|
"wasm_set_request_host",
|
|
2556
2642
|
null,
|
|
2557
2643
|
[STRING],
|
|
2558
2644
|
[e]
|
|
2559
2645
|
);
|
|
2646
|
+
}, wt = new WeakSet(), Xt = function(e) {
|
|
2647
|
+
this[__private__dont__use].ccall(
|
|
2648
|
+
"wasm_set_request_port",
|
|
2649
|
+
null,
|
|
2650
|
+
[NUMBER],
|
|
2651
|
+
[e]
|
|
2652
|
+
);
|
|
2653
|
+
}, Pt = new WeakSet(), er = function(e, t) {
|
|
2560
2654
|
let r;
|
|
2561
2655
|
try {
|
|
2562
2656
|
r = parseInt(new URL(e).port, 10);
|
|
2563
2657
|
} catch {
|
|
2564
2658
|
}
|
|
2565
|
-
(!r || isNaN(r) || r === 80) && (r = t === "https" ? 443 : 80),
|
|
2566
|
-
|
|
2567
|
-
null,
|
|
2568
|
-
[NUMBER],
|
|
2569
|
-
[r]
|
|
2570
|
-
), (t === "https" || !t && r === 443) && this.addServerGlobalEntry("HTTPS", "on");
|
|
2571
|
-
}, Pt = new WeakSet(), Zt = function(e) {
|
|
2659
|
+
return (!r || isNaN(r) || r === 80) && (r = t === "https" ? 443 : 80), r;
|
|
2660
|
+
}, bt = new WeakSet(), tr = function(e) {
|
|
2572
2661
|
this[__private__dont__use].ccall(
|
|
2573
2662
|
"wasm_set_request_method",
|
|
2574
2663
|
null,
|
|
2575
2664
|
[STRING],
|
|
2576
2665
|
[e]
|
|
2577
2666
|
);
|
|
2578
|
-
},
|
|
2667
|
+
}, Et = new WeakSet(), rr = function(e) {
|
|
2579
2668
|
e.cookie && this[__private__dont__use].ccall(
|
|
2580
2669
|
"wasm_set_cookies",
|
|
2581
2670
|
null,
|
|
@@ -2592,14 +2681,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2592
2681
|
[NUMBER],
|
|
2593
2682
|
[parseInt(e["content-length"], 10)]
|
|
2594
2683
|
);
|
|
2595
|
-
|
|
2596
|
-
let r = "HTTP_";
|
|
2597
|
-
["content-type", "content-length"].includes(t.toLowerCase()) && (r = ""), this.addServerGlobalEntry(
|
|
2598
|
-
`${r}${t.toUpperCase().replace(/-/g, "_")}`,
|
|
2599
|
-
e[t]
|
|
2600
|
-
);
|
|
2601
|
-
}
|
|
2602
|
-
}, Et = new WeakSet(), Xt = function(e) {
|
|
2684
|
+
}, St = new WeakSet(), nr = function(e) {
|
|
2603
2685
|
let t, r;
|
|
2604
2686
|
typeof e == "string" ? (console.warn(
|
|
2605
2687
|
"Passing a string as the request body is deprecated. Please use a Uint8Array instead. See https://github.com/WordPress/wordpress-playground/issues/997 for more details"
|
|
@@ -2622,36 +2704,35 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2622
2704
|
[NUMBER],
|
|
2623
2705
|
[r]
|
|
2624
2706
|
), n;
|
|
2625
|
-
},
|
|
2707
|
+
}, Rt = new WeakSet(), sr = function(e) {
|
|
2626
2708
|
this[__private__dont__use].ccall(
|
|
2627
2709
|
"wasm_set_path_translated",
|
|
2628
2710
|
null,
|
|
2629
2711
|
[STRING],
|
|
2630
2712
|
[e]
|
|
2631
2713
|
);
|
|
2632
|
-
},
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
}, Tt = new WeakSet(), rr = function(e, t) {
|
|
2714
|
+
}, Tt = new WeakSet(), ir = function(e, t) {
|
|
2715
|
+
this[__private__dont__use].ccall(
|
|
2716
|
+
"wasm_add_SERVER_entry",
|
|
2717
|
+
null,
|
|
2718
|
+
[STRING, STRING],
|
|
2719
|
+
[e, t]
|
|
2720
|
+
);
|
|
2721
|
+
}, kt = new WeakSet(), or = function(e, t) {
|
|
2641
2722
|
this[__private__dont__use].ccall(
|
|
2642
2723
|
"wasm_add_ENV_entry",
|
|
2643
2724
|
null,
|
|
2644
2725
|
[STRING, STRING],
|
|
2645
2726
|
[e, t]
|
|
2646
2727
|
);
|
|
2647
|
-
},
|
|
2728
|
+
}, Ct = new WeakSet(), ar = function(e) {
|
|
2648
2729
|
this[__private__dont__use].ccall(
|
|
2649
2730
|
"wasm_set_php_code",
|
|
2650
2731
|
null,
|
|
2651
2732
|
[STRING],
|
|
2652
2733
|
[e]
|
|
2653
2734
|
);
|
|
2654
|
-
},
|
|
2735
|
+
}, Ot = new WeakSet(), cr = async function() {
|
|
2655
2736
|
var s;
|
|
2656
2737
|
let e, t;
|
|
2657
2738
|
try {
|
|
@@ -2659,8 +2740,8 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2659
2740
|
var d;
|
|
2660
2741
|
t = (u) => {
|
|
2661
2742
|
console.error(u), console.error(u.error);
|
|
2662
|
-
const
|
|
2663
|
-
|
|
2743
|
+
const p = new Error("Rethrown");
|
|
2744
|
+
p.cause = u.error, p.betterMessage = u.message, o(p);
|
|
2664
2745
|
}, (d = H(this, Re)) == null || d.addEventListener(
|
|
2665
2746
|
"error",
|
|
2666
2747
|
t
|
|
@@ -2685,11 +2766,11 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2685
2766
|
const o = i, l = "betterMessage" in o ? o.betterMessage : o.message, d = new Error(l);
|
|
2686
2767
|
throw d.cause = o, console.error(d), d;
|
|
2687
2768
|
} finally {
|
|
2688
|
-
(s = H(this, Re)) == null || s.removeEventListener("error", t)
|
|
2769
|
+
(s = H(this, Re)) == null || s.removeEventListener("error", t);
|
|
2689
2770
|
}
|
|
2690
|
-
const { headers: r, httpStatusCode: n } = ce(this,
|
|
2771
|
+
const { headers: r, httpStatusCode: n } = ce(this, $t, Qt).call(this);
|
|
2691
2772
|
return new PHPResponse(
|
|
2692
|
-
n,
|
|
2773
|
+
e === 0 ? n : 500,
|
|
2693
2774
|
r,
|
|
2694
2775
|
this.readFileAsBuffer("/internal/stdout"),
|
|
2695
2776
|
this.readFileAsText("/internal/stderr"),
|
|
@@ -2851,16 +2932,52 @@ class FetchResource extends Resource {
|
|
|
2851
2932
|
}
|
|
2852
2933
|
/** @inheritDoc */
|
|
2853
2934
|
async resolve() {
|
|
2854
|
-
var
|
|
2855
|
-
(
|
|
2935
|
+
var r, n;
|
|
2936
|
+
(r = this.progress) == null || r.setCaption(this.caption);
|
|
2856
2937
|
const t = this.getURL();
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2938
|
+
try {
|
|
2939
|
+
let s = await fetch(t);
|
|
2940
|
+
if (!s.ok)
|
|
2941
|
+
throw new Error(`Could not download "${t}"`);
|
|
2942
|
+
if (s = await cloneResponseMonitorProgress(
|
|
2943
|
+
s,
|
|
2944
|
+
((n = this.progress) == null ? void 0 : n.loadingListener) ?? noop
|
|
2945
|
+
), s.status !== 200)
|
|
2946
|
+
throw new Error(`Could not download "${t}"`);
|
|
2947
|
+
return new File([await s.blob()], this.name);
|
|
2948
|
+
} catch (s) {
|
|
2949
|
+
throw new Error(
|
|
2950
|
+
`Could not download "${t}".
|
|
2951
|
+
Check if the URL is correct and the server is reachable.
|
|
2952
|
+
If the url is reachable, the server might be blocking the request.
|
|
2953
|
+
Check the console and network for more information.
|
|
2954
|
+
|
|
2955
|
+
## Does the console shows an error about "No 'Access-Control-Allow-Origin' header"?
|
|
2956
|
+
|
|
2957
|
+
This means the server where your file is hosted does not allow requests from other sites
|
|
2958
|
+
(cross-origin requests, or CORS). You will need to move it to another server that allows
|
|
2959
|
+
cross-origin file downloads. You can learn more about CORS at
|
|
2960
|
+
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.
|
|
2961
|
+
|
|
2962
|
+
If you're loading a file from https://github.com/, there's an easy fix – you can load it from
|
|
2963
|
+
raw.githubusercontent.com instead. Here's how to do that:
|
|
2964
|
+
|
|
2965
|
+
1. Start with the original GitHub URL for the file. For example:
|
|
2966
|
+
'''
|
|
2967
|
+
https://github.com/username/repository/blob/branch/filename
|
|
2968
|
+
'''
|
|
2969
|
+
2. Replace 'github.com' with 'raw.githubusercontent.com'.
|
|
2970
|
+
3. Remove the '/blob/' part of the URL.
|
|
2971
|
+
|
|
2972
|
+
The resulting URL should look like this:
|
|
2973
|
+
'''
|
|
2974
|
+
https://raw.githubusercontent.com/username/repository/branch/filename
|
|
2975
|
+
'''
|
|
2976
|
+
|
|
2977
|
+
Error:
|
|
2978
|
+
${s}`
|
|
2979
|
+
);
|
|
2980
|
+
}
|
|
2864
2981
|
}
|
|
2865
2982
|
/**
|
|
2866
2983
|
* Gets the caption for the progress tracker.
|
|
@@ -2984,10 +3101,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2984
3101
|
}
|
|
2985
3102
|
e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
2986
3103
|
class r extends t {
|
|
2987
|
-
constructor(
|
|
2988
|
-
if (super(), !e.IDENTIFIER.test(
|
|
3104
|
+
constructor($) {
|
|
3105
|
+
if (super(), !e.IDENTIFIER.test($))
|
|
2989
3106
|
throw new Error("CodeGen: name must be a valid identifier");
|
|
2990
|
-
this.str =
|
|
3107
|
+
this.str = $;
|
|
2991
3108
|
}
|
|
2992
3109
|
toString() {
|
|
2993
3110
|
return this.str;
|
|
@@ -3001,8 +3118,8 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
3001
3118
|
}
|
|
3002
3119
|
e.Name = r;
|
|
3003
3120
|
class n extends t {
|
|
3004
|
-
constructor(
|
|
3005
|
-
super(), this._items = typeof
|
|
3121
|
+
constructor($) {
|
|
3122
|
+
super(), this._items = typeof $ == "string" ? [$] : $;
|
|
3006
3123
|
}
|
|
3007
3124
|
toString() {
|
|
3008
3125
|
return this.str;
|
|
@@ -3010,69 +3127,69 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
3010
3127
|
emptyStr() {
|
|
3011
3128
|
if (this._items.length > 1)
|
|
3012
3129
|
return !1;
|
|
3013
|
-
const
|
|
3014
|
-
return
|
|
3130
|
+
const $ = this._items[0];
|
|
3131
|
+
return $ === "" || $ === '""';
|
|
3015
3132
|
}
|
|
3016
3133
|
get str() {
|
|
3017
|
-
var
|
|
3018
|
-
return (
|
|
3134
|
+
var $;
|
|
3135
|
+
return ($ = this._str) !== null && $ !== void 0 ? $ : this._str = this._items.reduce((P, I) => `${P}${I}`, "");
|
|
3019
3136
|
}
|
|
3020
3137
|
get names() {
|
|
3021
|
-
var
|
|
3022
|
-
return (
|
|
3138
|
+
var $;
|
|
3139
|
+
return ($ = this._names) !== null && $ !== void 0 ? $ : this._names = this._items.reduce((P, I) => (I instanceof r && (P[I.str] = (P[I.str] || 0) + 1), P), {});
|
|
3023
3140
|
}
|
|
3024
3141
|
}
|
|
3025
3142
|
e._Code = n, e.nil = new n("");
|
|
3026
|
-
function s(_,
|
|
3143
|
+
function s(_, ...$) {
|
|
3027
3144
|
const P = [_[0]];
|
|
3028
3145
|
let I = 0;
|
|
3029
|
-
for (; I <
|
|
3030
|
-
l(P,
|
|
3146
|
+
for (; I < $.length; )
|
|
3147
|
+
l(P, $[I]), P.push(_[++I]);
|
|
3031
3148
|
return new n(P);
|
|
3032
3149
|
}
|
|
3033
3150
|
e._ = s;
|
|
3034
3151
|
const i = new n("+");
|
|
3035
|
-
function o(_,
|
|
3152
|
+
function o(_, ...$) {
|
|
3036
3153
|
const P = [C(_[0])];
|
|
3037
3154
|
let I = 0;
|
|
3038
|
-
for (; I <
|
|
3039
|
-
P.push(i), l(P,
|
|
3155
|
+
for (; I < $.length; )
|
|
3156
|
+
P.push(i), l(P, $[I]), P.push(i, C(_[++I]));
|
|
3040
3157
|
return d(P), new n(P);
|
|
3041
3158
|
}
|
|
3042
3159
|
e.str = o;
|
|
3043
|
-
function l(_,
|
|
3044
|
-
|
|
3160
|
+
function l(_, $) {
|
|
3161
|
+
$ instanceof n ? _.push(...$._items) : $ instanceof r ? _.push($) : _.push(g($));
|
|
3045
3162
|
}
|
|
3046
3163
|
e.addCodeArg = l;
|
|
3047
3164
|
function d(_) {
|
|
3048
|
-
let
|
|
3049
|
-
for (;
|
|
3050
|
-
if (_[
|
|
3051
|
-
const P = u(_[
|
|
3165
|
+
let $ = 1;
|
|
3166
|
+
for (; $ < _.length - 1; ) {
|
|
3167
|
+
if (_[$] === i) {
|
|
3168
|
+
const P = u(_[$ - 1], _[$ + 1]);
|
|
3052
3169
|
if (P !== void 0) {
|
|
3053
|
-
_.splice(
|
|
3170
|
+
_.splice($ - 1, 3, P);
|
|
3054
3171
|
continue;
|
|
3055
3172
|
}
|
|
3056
|
-
_[
|
|
3173
|
+
_[$++] = "+";
|
|
3057
3174
|
}
|
|
3058
|
-
|
|
3175
|
+
$++;
|
|
3059
3176
|
}
|
|
3060
3177
|
}
|
|
3061
|
-
function u(_,
|
|
3062
|
-
if (
|
|
3178
|
+
function u(_, $) {
|
|
3179
|
+
if ($ === '""')
|
|
3063
3180
|
return _;
|
|
3064
3181
|
if (_ === '""')
|
|
3065
|
-
return
|
|
3182
|
+
return $;
|
|
3066
3183
|
if (typeof _ == "string")
|
|
3067
|
-
return
|
|
3068
|
-
if (typeof
|
|
3069
|
-
return `"${_}${
|
|
3184
|
+
return $ instanceof r || _[_.length - 1] !== '"' ? void 0 : typeof $ != "string" ? `${_.slice(0, -1)}${$}"` : $[0] === '"' ? _.slice(0, -1) + $.slice(1) : void 0;
|
|
3185
|
+
if (typeof $ == "string" && $[0] === '"' && !(_ instanceof r))
|
|
3186
|
+
return `"${_}${$.slice(1)}`;
|
|
3070
3187
|
}
|
|
3071
|
-
function
|
|
3072
|
-
return
|
|
3188
|
+
function p(_, $) {
|
|
3189
|
+
return $.emptyStr() ? _ : _.emptyStr() ? $ : o`${_}${$}`;
|
|
3073
3190
|
}
|
|
3074
|
-
e.strConcat =
|
|
3075
|
-
function
|
|
3191
|
+
e.strConcat = p;
|
|
3192
|
+
function g(_) {
|
|
3076
3193
|
return typeof _ == "number" || typeof _ == "boolean" || _ === null ? _ : C(Array.isArray(_) ? _.join(",") : _);
|
|
3077
3194
|
}
|
|
3078
3195
|
function O(_) {
|
|
@@ -3116,8 +3233,8 @@ var scope = {};
|
|
|
3116
3233
|
var: new t.Name("var")
|
|
3117
3234
|
};
|
|
3118
3235
|
class s {
|
|
3119
|
-
constructor({ prefixes: u, parent:
|
|
3120
|
-
this._names = {}, this._prefixes = u, this._parent =
|
|
3236
|
+
constructor({ prefixes: u, parent: p } = {}) {
|
|
3237
|
+
this._names = {}, this._prefixes = u, this._parent = p;
|
|
3121
3238
|
}
|
|
3122
3239
|
toName(u) {
|
|
3123
3240
|
return u instanceof t.Name ? u : this.name(u);
|
|
@@ -3126,23 +3243,23 @@ var scope = {};
|
|
|
3126
3243
|
return new t.Name(this._newName(u));
|
|
3127
3244
|
}
|
|
3128
3245
|
_newName(u) {
|
|
3129
|
-
const
|
|
3130
|
-
return `${u}${
|
|
3246
|
+
const p = this._names[u] || this._nameGroup(u);
|
|
3247
|
+
return `${u}${p.index++}`;
|
|
3131
3248
|
}
|
|
3132
3249
|
_nameGroup(u) {
|
|
3133
|
-
var
|
|
3134
|
-
if (!((
|
|
3250
|
+
var p, g;
|
|
3251
|
+
if (!((g = (p = this._parent) === null || p === void 0 ? void 0 : p._prefixes) === null || g === void 0) && g.has(u) || this._prefixes && !this._prefixes.has(u))
|
|
3135
3252
|
throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);
|
|
3136
3253
|
return this._names[u] = { prefix: u, index: 0 };
|
|
3137
3254
|
}
|
|
3138
3255
|
}
|
|
3139
3256
|
e.Scope = s;
|
|
3140
3257
|
class i extends t.Name {
|
|
3141
|
-
constructor(u,
|
|
3142
|
-
super(
|
|
3258
|
+
constructor(u, p) {
|
|
3259
|
+
super(p), this.prefix = u;
|
|
3143
3260
|
}
|
|
3144
|
-
setValue(u, { property:
|
|
3145
|
-
this.value = u, this.scopePath = (0, t._)`.${new t.Name(
|
|
3261
|
+
setValue(u, { property: p, itemIndex: g }) {
|
|
3262
|
+
this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${g}]`;
|
|
3146
3263
|
}
|
|
3147
3264
|
}
|
|
3148
3265
|
e.ValueScopeName = i;
|
|
@@ -3157,58 +3274,58 @@ var scope = {};
|
|
|
3157
3274
|
name(u) {
|
|
3158
3275
|
return new i(u, this._newName(u));
|
|
3159
3276
|
}
|
|
3160
|
-
value(u,
|
|
3161
|
-
var
|
|
3162
|
-
if (
|
|
3277
|
+
value(u, p) {
|
|
3278
|
+
var g;
|
|
3279
|
+
if (p.ref === void 0)
|
|
3163
3280
|
throw new Error("CodeGen: ref must be passed in value");
|
|
3164
|
-
const O = this.toName(u), { prefix: C } = O, S = (
|
|
3281
|
+
const O = this.toName(u), { prefix: C } = O, S = (g = p.key) !== null && g !== void 0 ? g : p.ref;
|
|
3165
3282
|
let T = this._values[C];
|
|
3166
3283
|
if (T) {
|
|
3167
|
-
const
|
|
3168
|
-
if (
|
|
3169
|
-
return
|
|
3284
|
+
const $ = T.get(S);
|
|
3285
|
+
if ($)
|
|
3286
|
+
return $;
|
|
3170
3287
|
} else
|
|
3171
3288
|
T = this._values[C] = /* @__PURE__ */ new Map();
|
|
3172
3289
|
T.set(S, O);
|
|
3173
3290
|
const y = this._scope[C] || (this._scope[C] = []), _ = y.length;
|
|
3174
|
-
return y[_] =
|
|
3175
|
-
}
|
|
3176
|
-
getValue(u,
|
|
3177
|
-
const
|
|
3178
|
-
if (
|
|
3179
|
-
return
|
|
3180
|
-
}
|
|
3181
|
-
scopeRefs(u,
|
|
3182
|
-
return this._reduceValues(
|
|
3183
|
-
if (
|
|
3184
|
-
throw new Error(`CodeGen: name "${
|
|
3185
|
-
return (0, t._)`${u}${
|
|
3291
|
+
return y[_] = p.ref, O.setValue(p, { property: C, itemIndex: _ }), O;
|
|
3292
|
+
}
|
|
3293
|
+
getValue(u, p) {
|
|
3294
|
+
const g = this._values[u];
|
|
3295
|
+
if (g)
|
|
3296
|
+
return g.get(p);
|
|
3297
|
+
}
|
|
3298
|
+
scopeRefs(u, p = this._values) {
|
|
3299
|
+
return this._reduceValues(p, (g) => {
|
|
3300
|
+
if (g.scopePath === void 0)
|
|
3301
|
+
throw new Error(`CodeGen: name "${g}" has no value`);
|
|
3302
|
+
return (0, t._)`${u}${g.scopePath}`;
|
|
3186
3303
|
});
|
|
3187
3304
|
}
|
|
3188
|
-
scopeCode(u = this._values,
|
|
3305
|
+
scopeCode(u = this._values, p, g) {
|
|
3189
3306
|
return this._reduceValues(u, (O) => {
|
|
3190
3307
|
if (O.value === void 0)
|
|
3191
3308
|
throw new Error(`CodeGen: name "${O}" has no value`);
|
|
3192
3309
|
return O.value.code;
|
|
3193
|
-
},
|
|
3310
|
+
}, p, g);
|
|
3194
3311
|
}
|
|
3195
|
-
_reduceValues(u,
|
|
3312
|
+
_reduceValues(u, p, g = {}, O) {
|
|
3196
3313
|
let C = t.nil;
|
|
3197
3314
|
for (const S in u) {
|
|
3198
3315
|
const T = u[S];
|
|
3199
3316
|
if (!T)
|
|
3200
3317
|
continue;
|
|
3201
|
-
const y =
|
|
3318
|
+
const y = g[S] = g[S] || /* @__PURE__ */ new Map();
|
|
3202
3319
|
T.forEach((_) => {
|
|
3203
3320
|
if (y.has(_))
|
|
3204
3321
|
return;
|
|
3205
3322
|
y.set(_, n.Started);
|
|
3206
|
-
let
|
|
3207
|
-
if (
|
|
3323
|
+
let $ = p(_);
|
|
3324
|
+
if ($) {
|
|
3208
3325
|
const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
|
|
3209
|
-
C = (0, t._)`${C}${P} ${_} = ${
|
|
3210
|
-
} else if (
|
|
3211
|
-
C = (0, t._)`${C}${
|
|
3326
|
+
C = (0, t._)`${C}${P} ${_} = ${$};${this.opts._n}`;
|
|
3327
|
+
} else if ($ = O == null ? void 0 : O(_))
|
|
3328
|
+
C = (0, t._)`${C}${$}${this.opts._n}`;
|
|
3212
3329
|
else
|
|
3213
3330
|
throw new r(_);
|
|
3214
3331
|
y.set(_, n.Completed);
|
|
@@ -3317,7 +3434,7 @@ var scope = {};
|
|
|
3317
3434
|
return `${this.label}:` + a;
|
|
3318
3435
|
}
|
|
3319
3436
|
}
|
|
3320
|
-
class
|
|
3437
|
+
class p extends i {
|
|
3321
3438
|
constructor(a) {
|
|
3322
3439
|
super(), this.label = a, this.names = {};
|
|
3323
3440
|
}
|
|
@@ -3325,7 +3442,7 @@ var scope = {};
|
|
|
3325
3442
|
return `break${this.label ? ` ${this.label}` : ""};` + a;
|
|
3326
3443
|
}
|
|
3327
3444
|
}
|
|
3328
|
-
class
|
|
3445
|
+
class g extends i {
|
|
3329
3446
|
constructor(a) {
|
|
3330
3447
|
super(), this.error = a;
|
|
3331
3448
|
}
|
|
@@ -3374,12 +3491,12 @@ var scope = {};
|
|
|
3374
3491
|
let M = N.length;
|
|
3375
3492
|
for (; M--; ) {
|
|
3376
3493
|
const q = N[M];
|
|
3377
|
-
q.optimizeNames(a, h) || (
|
|
3494
|
+
q.optimizeNames(a, h) || (Te(a, q.names), N.splice(M, 1));
|
|
3378
3495
|
}
|
|
3379
3496
|
return N.length > 0 ? this : void 0;
|
|
3380
3497
|
}
|
|
3381
3498
|
get names() {
|
|
3382
|
-
return this.nodes.reduce((a, h) =>
|
|
3499
|
+
return this.nodes.reduce((a, h) => J(a, h.names), {});
|
|
3383
3500
|
}
|
|
3384
3501
|
}
|
|
3385
3502
|
class S extends C {
|
|
@@ -3411,7 +3528,7 @@ var scope = {};
|
|
|
3411
3528
|
h = this.else = Array.isArray(N) ? new y(N) : N;
|
|
3412
3529
|
}
|
|
3413
3530
|
if (h)
|
|
3414
|
-
return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(
|
|
3531
|
+
return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(ke(a), h instanceof _ ? [h] : h.nodes);
|
|
3415
3532
|
if (!(a === !1 || !this.nodes.length))
|
|
3416
3533
|
return this;
|
|
3417
3534
|
}
|
|
@@ -3422,14 +3539,14 @@ var scope = {};
|
|
|
3422
3539
|
}
|
|
3423
3540
|
get names() {
|
|
3424
3541
|
const a = super.names;
|
|
3425
|
-
return ue(a, this.condition), this.else &&
|
|
3542
|
+
return ue(a, this.condition), this.else && J(a, this.else.names), a;
|
|
3426
3543
|
}
|
|
3427
3544
|
}
|
|
3428
3545
|
_.kind = "if";
|
|
3429
|
-
class
|
|
3546
|
+
class $ extends S {
|
|
3430
3547
|
}
|
|
3431
|
-
|
|
3432
|
-
class P extends
|
|
3548
|
+
$.kind = "for";
|
|
3549
|
+
class P extends $ {
|
|
3433
3550
|
constructor(a) {
|
|
3434
3551
|
super(), this.iteration = a;
|
|
3435
3552
|
}
|
|
@@ -3441,10 +3558,10 @@ var scope = {};
|
|
|
3441
3558
|
return this.iteration = oe(this.iteration, a, h), this;
|
|
3442
3559
|
}
|
|
3443
3560
|
get names() {
|
|
3444
|
-
return
|
|
3561
|
+
return J(super.names, this.iteration.names);
|
|
3445
3562
|
}
|
|
3446
3563
|
}
|
|
3447
|
-
class I extends
|
|
3564
|
+
class I extends $ {
|
|
3448
3565
|
constructor(a, h, N, M) {
|
|
3449
3566
|
super(), this.varKind = a, this.name = h, this.from = N, this.to = M;
|
|
3450
3567
|
}
|
|
@@ -3457,7 +3574,7 @@ var scope = {};
|
|
|
3457
3574
|
return ue(a, this.to);
|
|
3458
3575
|
}
|
|
3459
3576
|
}
|
|
3460
|
-
class D extends
|
|
3577
|
+
class D extends $ {
|
|
3461
3578
|
constructor(a, h, N, M) {
|
|
3462
3579
|
super(), this.loop = a, this.varKind = h, this.name = N, this.iterable = M;
|
|
3463
3580
|
}
|
|
@@ -3469,7 +3586,7 @@ var scope = {};
|
|
|
3469
3586
|
return this.iterable = oe(this.iterable, a, h), this;
|
|
3470
3587
|
}
|
|
3471
3588
|
get names() {
|
|
3472
|
-
return
|
|
3589
|
+
return J(super.names, this.iterable.names);
|
|
3473
3590
|
}
|
|
3474
3591
|
}
|
|
3475
3592
|
class w extends S {
|
|
@@ -3502,7 +3619,7 @@ var scope = {};
|
|
|
3502
3619
|
}
|
|
3503
3620
|
get names() {
|
|
3504
3621
|
const a = super.names;
|
|
3505
|
-
return this.catch &&
|
|
3622
|
+
return this.catch && J(a, this.catch.names), this.finally && J(a, this.finally.names), a;
|
|
3506
3623
|
}
|
|
3507
3624
|
}
|
|
3508
3625
|
class V extends S {
|
|
@@ -3520,7 +3637,7 @@ var scope = {};
|
|
|
3520
3637
|
}
|
|
3521
3638
|
}
|
|
3522
3639
|
x.kind = "finally";
|
|
3523
|
-
class
|
|
3640
|
+
class te {
|
|
3524
3641
|
constructor(a, h = {}) {
|
|
3525
3642
|
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...h, _n: h.lines ? `
|
|
3526
3643
|
` : "" }, this._extScope = a, this._scope = new r.Scope({ parent: a }), this._nodes = [new T()];
|
|
@@ -3642,7 +3759,7 @@ var scope = {};
|
|
|
3642
3759
|
}
|
|
3643
3760
|
// end `for` loop
|
|
3644
3761
|
endFor() {
|
|
3645
|
-
return this._endBlockNode(
|
|
3762
|
+
return this._endBlockNode($);
|
|
3646
3763
|
}
|
|
3647
3764
|
// `label` statement
|
|
3648
3765
|
label(a) {
|
|
@@ -3650,7 +3767,7 @@ var scope = {};
|
|
|
3650
3767
|
}
|
|
3651
3768
|
// `break` statement
|
|
3652
3769
|
break(a) {
|
|
3653
|
-
return this._leafNode(new
|
|
3770
|
+
return this._leafNode(new p(a));
|
|
3654
3771
|
}
|
|
3655
3772
|
// `return` statement
|
|
3656
3773
|
return(a) {
|
|
@@ -3672,7 +3789,7 @@ var scope = {};
|
|
|
3672
3789
|
}
|
|
3673
3790
|
// `throw` statement
|
|
3674
3791
|
throw(a) {
|
|
3675
|
-
return this._leafNode(new
|
|
3792
|
+
return this._leafNode(new g(a));
|
|
3676
3793
|
}
|
|
3677
3794
|
// start self-balancing block
|
|
3678
3795
|
block(a, h) {
|
|
@@ -3730,14 +3847,14 @@ var scope = {};
|
|
|
3730
3847
|
h[h.length - 1] = a;
|
|
3731
3848
|
}
|
|
3732
3849
|
}
|
|
3733
|
-
e.CodeGen =
|
|
3734
|
-
function
|
|
3850
|
+
e.CodeGen = te;
|
|
3851
|
+
function J(b, a) {
|
|
3735
3852
|
for (const h in a)
|
|
3736
3853
|
b[h] = (b[h] || 0) + (a[h] || 0);
|
|
3737
3854
|
return b;
|
|
3738
3855
|
}
|
|
3739
3856
|
function ue(b, a) {
|
|
3740
|
-
return a instanceof t._CodeOrName ?
|
|
3857
|
+
return a instanceof t._CodeOrName ? J(b, a.names) : b;
|
|
3741
3858
|
}
|
|
3742
3859
|
function oe(b, a, h) {
|
|
3743
3860
|
if (b instanceof t.Name)
|
|
@@ -3753,22 +3870,22 @@ var scope = {};
|
|
|
3753
3870
|
return q instanceof t._Code && q._items.some((W) => W instanceof t.Name && a[W.str] === 1 && h[W.str] !== void 0);
|
|
3754
3871
|
}
|
|
3755
3872
|
}
|
|
3756
|
-
function
|
|
3873
|
+
function Te(b, a) {
|
|
3757
3874
|
for (const h in a)
|
|
3758
3875
|
b[h] = (b[h] || 0) - (a[h] || 0);
|
|
3759
3876
|
}
|
|
3760
|
-
function
|
|
3877
|
+
function ke(b) {
|
|
3761
3878
|
return typeof b == "boolean" || typeof b == "number" || b === null ? !b : (0, t._)`!${j(b)}`;
|
|
3762
3879
|
}
|
|
3763
|
-
e.not =
|
|
3764
|
-
const
|
|
3765
|
-
function
|
|
3766
|
-
return b.reduce(
|
|
3880
|
+
e.not = ke;
|
|
3881
|
+
const Fe = v(e.operators.AND);
|
|
3882
|
+
function Ze(...b) {
|
|
3883
|
+
return b.reduce(Fe);
|
|
3767
3884
|
}
|
|
3768
|
-
e.and =
|
|
3769
|
-
const
|
|
3885
|
+
e.and = Ze;
|
|
3886
|
+
const Me = v(e.operators.OR);
|
|
3770
3887
|
function F(...b) {
|
|
3771
|
-
return b.reduce(
|
|
3888
|
+
return b.reduce(Me);
|
|
3772
3889
|
}
|
|
3773
3890
|
e.or = F;
|
|
3774
3891
|
function v(b) {
|
|
@@ -3798,8 +3915,8 @@ var util = {};
|
|
|
3798
3915
|
if (!A.strictSchema || typeof k == "boolean")
|
|
3799
3916
|
return;
|
|
3800
3917
|
const x = V.RULES.keywords;
|
|
3801
|
-
for (const
|
|
3802
|
-
x[
|
|
3918
|
+
for (const te in k)
|
|
3919
|
+
x[te] || D(w, `unknown keyword: "${te}"`);
|
|
3803
3920
|
}
|
|
3804
3921
|
e.checkUnknownRules = i;
|
|
3805
3922
|
function o(w, k) {
|
|
@@ -3834,14 +3951,14 @@ var util = {};
|
|
|
3834
3951
|
return O(decodeURIComponent(w));
|
|
3835
3952
|
}
|
|
3836
3953
|
e.unescapeFragment = u;
|
|
3837
|
-
function
|
|
3838
|
-
return encodeURIComponent(
|
|
3954
|
+
function p(w) {
|
|
3955
|
+
return encodeURIComponent(g(w));
|
|
3839
3956
|
}
|
|
3840
|
-
e.escapeFragment =
|
|
3841
|
-
function
|
|
3957
|
+
e.escapeFragment = p;
|
|
3958
|
+
function g(w) {
|
|
3842
3959
|
return typeof w == "number" ? `${w}` : w.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3843
3960
|
}
|
|
3844
|
-
e.escapeJsonPointer =
|
|
3961
|
+
e.escapeJsonPointer = g;
|
|
3845
3962
|
function O(w) {
|
|
3846
3963
|
return w.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
3847
3964
|
}
|
|
@@ -3855,8 +3972,8 @@ var util = {};
|
|
|
3855
3972
|
}
|
|
3856
3973
|
e.eachItem = C;
|
|
3857
3974
|
function S({ mergeNames: w, mergeToName: k, mergeValues: A, resultToName: V }) {
|
|
3858
|
-
return (x,
|
|
3859
|
-
const oe =
|
|
3975
|
+
return (x, te, J, ue) => {
|
|
3976
|
+
const oe = J === void 0 ? te : J instanceof t.Name ? (te instanceof t.Name ? w(x, te, J) : k(x, te, J), J) : te instanceof t.Name ? (k(x, J, te), te) : A(te, J);
|
|
3860
3977
|
return ue === t.Name && !(oe instanceof t.Name) ? V(x, oe) : oe;
|
|
3861
3978
|
};
|
|
3862
3979
|
}
|
|
@@ -3890,13 +4007,13 @@ var util = {};
|
|
|
3890
4007
|
}
|
|
3891
4008
|
e.setEvaluated = y;
|
|
3892
4009
|
const _ = {};
|
|
3893
|
-
function
|
|
4010
|
+
function $(w, k) {
|
|
3894
4011
|
return w.scopeValue("func", {
|
|
3895
4012
|
ref: k,
|
|
3896
4013
|
code: _[k.code] || (_[k.code] = new r._Code(k.code))
|
|
3897
4014
|
});
|
|
3898
4015
|
}
|
|
3899
|
-
e.useFunc =
|
|
4016
|
+
e.useFunc = $;
|
|
3900
4017
|
var P;
|
|
3901
4018
|
(function(w) {
|
|
3902
4019
|
w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
|
|
@@ -3906,7 +4023,7 @@ var util = {};
|
|
|
3906
4023
|
const V = k === P.Num;
|
|
3907
4024
|
return A ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
3908
4025
|
}
|
|
3909
|
-
return A ? (0, t.getProperty)(w).toString() : "/" +
|
|
4026
|
+
return A ? (0, t.getProperty)(w).toString() : "/" + g(w);
|
|
3910
4027
|
}
|
|
3911
4028
|
e.getErrorPath = I;
|
|
3912
4029
|
function D(w, k, A = w.opts.strictSchema) {
|
|
@@ -3952,13 +4069,13 @@ names$1.default = names;
|
|
|
3952
4069
|
}, e.keyword$DataError = {
|
|
3953
4070
|
message: ({ keyword: y, schemaType: _ }) => _ ? (0, t.str)`"${y}" keyword must be ${_} ($data)` : (0, t.str)`"${y}" keyword is invalid ($data)`
|
|
3954
4071
|
};
|
|
3955
|
-
function s(y, _ = e.keywordError,
|
|
3956
|
-
const { it: I } = y, { gen: D, compositeRule: w, allErrors: k } = I, A =
|
|
4072
|
+
function s(y, _ = e.keywordError, $, P) {
|
|
4073
|
+
const { it: I } = y, { gen: D, compositeRule: w, allErrors: k } = I, A = g(y, _, $);
|
|
3957
4074
|
P ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
|
|
3958
4075
|
}
|
|
3959
4076
|
e.reportError = s;
|
|
3960
|
-
function i(y, _ = e.keywordError,
|
|
3961
|
-
const { it: P } = y, { gen: I, compositeRule: D, allErrors: w } = P, k =
|
|
4077
|
+
function i(y, _ = e.keywordError, $) {
|
|
4078
|
+
const { it: P } = y, { gen: I, compositeRule: D, allErrors: w } = P, k = g(y, _, $);
|
|
3962
4079
|
d(I, k), D || w || u(P, n.default.vErrors);
|
|
3963
4080
|
}
|
|
3964
4081
|
e.reportExtraError = i;
|
|
@@ -3966,24 +4083,24 @@ names$1.default = names;
|
|
|
3966
4083
|
y.assign(n.default.errors, _), y.if((0, t._)`${n.default.vErrors} !== null`, () => y.if(_, () => y.assign((0, t._)`${n.default.vErrors}.length`, _), () => y.assign(n.default.vErrors, null)));
|
|
3967
4084
|
}
|
|
3968
4085
|
e.resetErrorsCount = o;
|
|
3969
|
-
function l({ gen: y, keyword: _, schemaValue:
|
|
4086
|
+
function l({ gen: y, keyword: _, schemaValue: $, data: P, errsCount: I, it: D }) {
|
|
3970
4087
|
if (I === void 0)
|
|
3971
4088
|
throw new Error("ajv implementation error");
|
|
3972
4089
|
const w = y.name("err");
|
|
3973
4090
|
y.forRange("i", I, n.default.errors, (k) => {
|
|
3974
|
-
y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && (y.assign((0, t._)`${w}.schema`,
|
|
4091
|
+
y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && (y.assign((0, t._)`${w}.schema`, $), y.assign((0, t._)`${w}.data`, P));
|
|
3975
4092
|
});
|
|
3976
4093
|
}
|
|
3977
4094
|
e.extendErrors = l;
|
|
3978
4095
|
function d(y, _) {
|
|
3979
|
-
const
|
|
3980
|
-
y.if((0, t._)`${n.default.vErrors} === null`, () => y.assign(n.default.vErrors, (0, t._)`[${
|
|
4096
|
+
const $ = y.const("err", _);
|
|
4097
|
+
y.if((0, t._)`${n.default.vErrors} === null`, () => y.assign(n.default.vErrors, (0, t._)`[${$}]`), (0, t._)`${n.default.vErrors}.push(${$})`), y.code((0, t._)`${n.default.errors}++`);
|
|
3981
4098
|
}
|
|
3982
4099
|
function u(y, _) {
|
|
3983
|
-
const { gen:
|
|
3984
|
-
I.$async ?
|
|
4100
|
+
const { gen: $, validateName: P, schemaEnv: I } = y;
|
|
4101
|
+
I.$async ? $.throw((0, t._)`new ${y.ValidationError}(${_})`) : ($.assign((0, t._)`${P}.errors`, _), $.return(!1));
|
|
3985
4102
|
}
|
|
3986
|
-
const
|
|
4103
|
+
const p = {
|
|
3987
4104
|
keyword: new t.Name("keyword"),
|
|
3988
4105
|
schemaPath: new t.Name("schemaPath"),
|
|
3989
4106
|
params: new t.Name("params"),
|
|
@@ -3992,28 +4109,28 @@ names$1.default = names;
|
|
|
3992
4109
|
schema: new t.Name("schema"),
|
|
3993
4110
|
parentSchema: new t.Name("parentSchema")
|
|
3994
4111
|
};
|
|
3995
|
-
function
|
|
4112
|
+
function g(y, _, $) {
|
|
3996
4113
|
const { createErrors: P } = y.it;
|
|
3997
|
-
return P === !1 ? (0, t._)`{}` : O(y, _,
|
|
4114
|
+
return P === !1 ? (0, t._)`{}` : O(y, _, $);
|
|
3998
4115
|
}
|
|
3999
|
-
function O(y, _,
|
|
4116
|
+
function O(y, _, $ = {}) {
|
|
4000
4117
|
const { gen: P, it: I } = y, D = [
|
|
4001
|
-
C(I,
|
|
4002
|
-
S(y,
|
|
4118
|
+
C(I, $),
|
|
4119
|
+
S(y, $)
|
|
4003
4120
|
];
|
|
4004
4121
|
return T(y, _, D), P.object(...D);
|
|
4005
4122
|
}
|
|
4006
4123
|
function C({ errorPath: y }, { instancePath: _ }) {
|
|
4007
|
-
const
|
|
4008
|
-
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath,
|
|
4124
|
+
const $ = _ ? (0, t.str)`${y}${(0, r.getErrorPath)(_, r.Type.Str)}` : y;
|
|
4125
|
+
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, $)];
|
|
4009
4126
|
}
|
|
4010
|
-
function S({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath:
|
|
4127
|
+
function S({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath: $, parentSchema: P }) {
|
|
4011
4128
|
let I = P ? _ : (0, t.str)`${_}/${y}`;
|
|
4012
|
-
return
|
|
4129
|
+
return $ && (I = (0, t.str)`${I}${(0, r.getErrorPath)($, r.Type.Str)}`), [p.schemaPath, I];
|
|
4013
4130
|
}
|
|
4014
|
-
function T(y, { params: _, message:
|
|
4015
|
-
const { keyword: I, data: D, schemaValue: w, it: k } = y, { opts: A, propertyName: V, topSchemaRef: x, schemaPath:
|
|
4016
|
-
P.push([
|
|
4131
|
+
function T(y, { params: _, message: $ }, P) {
|
|
4132
|
+
const { keyword: I, data: D, schemaValue: w, it: k } = y, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: te } = k;
|
|
4133
|
+
P.push([p.keyword, I], [p.params, typeof _ == "function" ? _(y) : _ || (0, t._)`{}`]), A.messages && P.push([p.message, typeof $ == "function" ? $(y) : $]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${te}`], [n.default.data, D]), V && P.push([p.propertyName, V]);
|
|
4017
4134
|
}
|
|
4018
4135
|
})(errors);
|
|
4019
4136
|
Object.defineProperty(boolSchema, "__esModule", { value: !0 });
|
|
@@ -4113,7 +4230,7 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4113
4230
|
}
|
|
4114
4231
|
e.getJSONTypes = d;
|
|
4115
4232
|
function u(P, I) {
|
|
4116
|
-
const { gen: D, data: w, opts: k } = P, A =
|
|
4233
|
+
const { gen: D, data: w, opts: k } = P, A = g(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
|
|
4117
4234
|
if (V) {
|
|
4118
4235
|
const x = T(I, w, k.strictNumbers, o.Wrong);
|
|
4119
4236
|
D.if(x, () => {
|
|
@@ -4123,20 +4240,20 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4123
4240
|
return V;
|
|
4124
4241
|
}
|
|
4125
4242
|
e.coerceAndCheckDataType = u;
|
|
4126
|
-
const
|
|
4127
|
-
function
|
|
4128
|
-
return I ? P.filter((D) =>
|
|
4243
|
+
const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
4244
|
+
function g(P, I) {
|
|
4245
|
+
return I ? P.filter((D) => p.has(D) || I === "array" && D === "array") : [];
|
|
4129
4246
|
}
|
|
4130
4247
|
function O(P, I, D) {
|
|
4131
4248
|
const { gen: w, data: k, opts: A } = P, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
|
|
4132
4249
|
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(T(I, k, A.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
|
|
4133
|
-
for (const
|
|
4134
|
-
(
|
|
4250
|
+
for (const J of D)
|
|
4251
|
+
(p.has(J) || J === "array" && A.coerceTypes === "array") && te(J);
|
|
4135
4252
|
w.else(), _(P), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
|
|
4136
4253
|
w.assign(k, x), C(P, x);
|
|
4137
4254
|
});
|
|
4138
|
-
function
|
|
4139
|
-
switch (
|
|
4255
|
+
function te(J) {
|
|
4256
|
+
switch (J) {
|
|
4140
4257
|
case "string":
|
|
4141
4258
|
w.elseIf((0, s._)`${V} == "number" || ${V} == "boolean"`).assign(x, (0, s._)`"" + ${k}`).elseIf((0, s._)`${k} === null`).assign(x, (0, s._)`""`);
|
|
4142
4259
|
return;
|
|
@@ -4211,11 +4328,11 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4211
4328
|
params: ({ schema: P, schemaValue: I }) => typeof P == "string" ? (0, s._)`{type: ${P}}` : (0, s._)`{type: ${I}}`
|
|
4212
4329
|
};
|
|
4213
4330
|
function _(P) {
|
|
4214
|
-
const I =
|
|
4331
|
+
const I = $(P);
|
|
4215
4332
|
(0, n.reportError)(I, y);
|
|
4216
4333
|
}
|
|
4217
4334
|
e.reportTypeError = _;
|
|
4218
|
-
function
|
|
4335
|
+
function $(P) {
|
|
4219
4336
|
const { gen: I, data: D, schema: w } = P, k = (0, i.schemaRefOrVal)(P, w, "type");
|
|
4220
4337
|
return {
|
|
4221
4338
|
gen: I,
|
|
@@ -4305,14 +4422,14 @@ function schemaProperties(e, t) {
|
|
|
4305
4422
|
}
|
|
4306
4423
|
code.schemaProperties = schemaProperties;
|
|
4307
4424
|
function callValidateCode({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: o }, l, d, u) {
|
|
4308
|
-
const
|
|
4425
|
+
const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, g = [
|
|
4309
4426
|
[names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, i)],
|
|
4310
4427
|
[names_1$5.default.parentData, o.parentData],
|
|
4311
4428
|
[names_1$5.default.parentDataProperty, o.parentDataProperty],
|
|
4312
4429
|
[names_1$5.default.rootData, names_1$5.default.rootData]
|
|
4313
4430
|
];
|
|
4314
|
-
o.opts.dynamicRef &&
|
|
4315
|
-
const O = (0, codegen_1$q._)`${
|
|
4431
|
+
o.opts.dynamicRef && g.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
|
|
4432
|
+
const O = (0, codegen_1$q._)`${p}, ${r.object(...g)}`;
|
|
4316
4433
|
return d !== codegen_1$q.nil ? (0, codegen_1$q._)`${l}.call(${d}, ${O})` : (0, codegen_1$q._)`${l}(${O})`;
|
|
4317
4434
|
}
|
|
4318
4435
|
code.callValidateCode = callValidateCode;
|
|
@@ -4353,12 +4470,12 @@ function validateUnion(e) {
|
|
|
4353
4470
|
return;
|
|
4354
4471
|
const o = t.let("valid", !1), l = t.name("_valid");
|
|
4355
4472
|
t.block(() => r.forEach((d, u) => {
|
|
4356
|
-
const
|
|
4473
|
+
const p = e.subschema({
|
|
4357
4474
|
keyword: n,
|
|
4358
4475
|
schemaProp: u,
|
|
4359
4476
|
compositeRule: !0
|
|
4360
4477
|
}, l);
|
|
4361
|
-
t.assign(o, (0, codegen_1$q._)`${o} || ${l}`), e.mergeValidEvaluated(
|
|
4478
|
+
t.assign(o, (0, codegen_1$q._)`${o} || ${l}`), e.mergeValidEvaluated(p, l) || t.if((0, codegen_1$q.not)(o));
|
|
4362
4479
|
})), e.result(o, () => e.reset(), () => e.error(!0));
|
|
4363
4480
|
}
|
|
4364
4481
|
code.validateUnion = validateUnion;
|
|
@@ -4382,8 +4499,8 @@ function funcKeywordCode(e, t) {
|
|
|
4382
4499
|
var r;
|
|
4383
4500
|
const { gen: n, keyword: s, schema: i, parentSchema: o, $data: l, it: d } = e;
|
|
4384
4501
|
checkAsyncKeyword(d, t);
|
|
4385
|
-
const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate,
|
|
4386
|
-
e.block$data(
|
|
4502
|
+
const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u), g = n.let("valid");
|
|
4503
|
+
e.block$data(g, O), e.ok((r = t.valid) !== null && r !== void 0 ? r : g);
|
|
4387
4504
|
function O() {
|
|
4388
4505
|
if (t.errors === !1)
|
|
4389
4506
|
T(), t.modifying && modifyData(e), y(() => e.error());
|
|
@@ -4394,19 +4511,19 @@ function funcKeywordCode(e, t) {
|
|
|
4394
4511
|
}
|
|
4395
4512
|
function C() {
|
|
4396
4513
|
const _ = n.let("ruleErrs", null);
|
|
4397
|
-
return n.try(() => T((0, codegen_1$p._)`await `), (
|
|
4514
|
+
return n.try(() => T((0, codegen_1$p._)`await `), ($) => n.assign(g, !1).if((0, codegen_1$p._)`${$} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${$}.errors`), () => n.throw($))), _;
|
|
4398
4515
|
}
|
|
4399
4516
|
function S() {
|
|
4400
|
-
const _ = (0, codegen_1$p._)`${
|
|
4517
|
+
const _ = (0, codegen_1$p._)`${p}.errors`;
|
|
4401
4518
|
return n.assign(_, null), T(codegen_1$p.nil), _;
|
|
4402
4519
|
}
|
|
4403
4520
|
function T(_ = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
|
|
4404
|
-
const
|
|
4405
|
-
n.assign(
|
|
4521
|
+
const $ = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !l || t.schema === !1);
|
|
4522
|
+
n.assign(g, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, p, $, P)}`, t.modifying);
|
|
4406
4523
|
}
|
|
4407
4524
|
function y(_) {
|
|
4408
|
-
var
|
|
4409
|
-
n.if((0, codegen_1$p.not)((
|
|
4525
|
+
var $;
|
|
4526
|
+
n.if((0, codegen_1$p.not)(($ = t.valid) !== null && $ !== void 0 ? $ : g), _);
|
|
4410
4527
|
}
|
|
4411
4528
|
}
|
|
4412
4529
|
keyword.funcKeywordCode = funcKeywordCode;
|
|
@@ -4485,8 +4602,8 @@ function extendSubschemaData(e, t, { dataProp: r, dataPropType: n, data: s, data
|
|
|
4485
4602
|
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
4486
4603
|
const { gen: l } = t;
|
|
4487
4604
|
if (r !== void 0) {
|
|
4488
|
-
const { errorPath: u, dataPathArr:
|
|
4489
|
-
d(O), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n,
|
|
4605
|
+
const { errorPath: u, dataPathArr: p, opts: g } = t, O = l.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
|
|
4606
|
+
d(O), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, g.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
|
|
4490
4607
|
}
|
|
4491
4608
|
if (s !== void 0) {
|
|
4492
4609
|
const u = s instanceof codegen_1$o.Name ? s : l.let("data", s, !0);
|
|
@@ -4590,18 +4707,18 @@ traverse$1.skipKeywords = {
|
|
|
4590
4707
|
function _traverse(e, t, r, n, s, i, o, l, d, u) {
|
|
4591
4708
|
if (n && typeof n == "object" && !Array.isArray(n)) {
|
|
4592
4709
|
t(n, s, i, o, l, d, u);
|
|
4593
|
-
for (var
|
|
4594
|
-
var
|
|
4595
|
-
if (Array.isArray(
|
|
4596
|
-
if (
|
|
4597
|
-
for (var O = 0; O <
|
|
4598
|
-
_traverse(e, t, r,
|
|
4599
|
-
} else if (
|
|
4600
|
-
if (
|
|
4601
|
-
for (var C in
|
|
4602
|
-
_traverse(e, t, r,
|
|
4710
|
+
for (var p in n) {
|
|
4711
|
+
var g = n[p];
|
|
4712
|
+
if (Array.isArray(g)) {
|
|
4713
|
+
if (p in traverse$1.arrayKeywords)
|
|
4714
|
+
for (var O = 0; O < g.length; O++)
|
|
4715
|
+
_traverse(e, t, r, g[O], s + "/" + p + "/" + O, i, s, p, n, O);
|
|
4716
|
+
} else if (p in traverse$1.propsKeywords) {
|
|
4717
|
+
if (g && typeof g == "object")
|
|
4718
|
+
for (var C in g)
|
|
4719
|
+
_traverse(e, t, r, g[C], s + "/" + p + "/" + escapeJsonPtr(C), i, s, p, n, C);
|
|
4603
4720
|
} else
|
|
4604
|
-
(
|
|
4721
|
+
(p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r, g, s + "/" + p, i, s, p, n);
|
|
4605
4722
|
}
|
|
4606
4723
|
r(n, s, i, o, l, d, u);
|
|
4607
4724
|
}
|
|
@@ -4685,21 +4802,21 @@ function getSchemaRefs(e, t) {
|
|
|
4685
4802
|
if (typeof e == "boolean")
|
|
4686
4803
|
return {};
|
|
4687
4804
|
const { schemaId: r, uriResolver: n } = this.opts, s = normalizeId(e[r] || t), i = { "": s }, o = getFullPath(n, s, !1), l = {}, d = /* @__PURE__ */ new Set();
|
|
4688
|
-
return traverse(e, { allKeys: !0 }, (
|
|
4805
|
+
return traverse(e, { allKeys: !0 }, (g, O, C, S) => {
|
|
4689
4806
|
if (S === void 0)
|
|
4690
4807
|
return;
|
|
4691
4808
|
const T = o + O;
|
|
4692
4809
|
let y = i[S];
|
|
4693
|
-
typeof
|
|
4810
|
+
typeof g[r] == "string" && (y = _.call(this, g[r])), $.call(this, g.$anchor), $.call(this, g.$dynamicAnchor), i[O] = y;
|
|
4694
4811
|
function _(P) {
|
|
4695
4812
|
const I = this.opts.uriResolver.resolve;
|
|
4696
4813
|
if (P = normalizeId(y ? I(y, P) : P), d.has(P))
|
|
4697
|
-
throw
|
|
4814
|
+
throw p(P);
|
|
4698
4815
|
d.add(P);
|
|
4699
4816
|
let D = this.refs[P];
|
|
4700
|
-
return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(
|
|
4817
|
+
return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(g, D.schema, P) : P !== normalizeId(T) && (P[0] === "#" ? (u(g, l[P], P), l[P] = g) : this.refs[P] = T), P;
|
|
4701
4818
|
}
|
|
4702
|
-
function
|
|
4819
|
+
function $(P) {
|
|
4703
4820
|
if (typeof P == "string") {
|
|
4704
4821
|
if (!ANCHOR.test(P))
|
|
4705
4822
|
throw new Error(`invalid anchor "${P}"`);
|
|
@@ -4707,12 +4824,12 @@ function getSchemaRefs(e, t) {
|
|
|
4707
4824
|
}
|
|
4708
4825
|
}
|
|
4709
4826
|
}), l;
|
|
4710
|
-
function u(
|
|
4711
|
-
if (O !== void 0 && !equal$2(
|
|
4712
|
-
throw
|
|
4827
|
+
function u(g, O, C) {
|
|
4828
|
+
if (O !== void 0 && !equal$2(g, O))
|
|
4829
|
+
throw p(C);
|
|
4713
4830
|
}
|
|
4714
|
-
function
|
|
4715
|
-
return new Error(`reference "${
|
|
4831
|
+
function p(g) {
|
|
4832
|
+
return new Error(`reference "${g}" resolves to more than one schema`);
|
|
4716
4833
|
}
|
|
4717
4834
|
}
|
|
4718
4835
|
resolve$1.getSchemaRefs = getSchemaRefs;
|
|
@@ -4822,17 +4939,17 @@ function assignEvaluated({ gen: e, evaluated: t, props: r, items: n }) {
|
|
|
4822
4939
|
r instanceof codegen_1$n.Name && e.assign((0, codegen_1$n._)`${t}.props`, r), n instanceof codegen_1$n.Name && e.assign((0, codegen_1$n._)`${t}.items`, n);
|
|
4823
4940
|
}
|
|
4824
4941
|
function schemaKeywords(e, t, r, n) {
|
|
4825
|
-
const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES:
|
|
4826
|
-
if (i.$ref && (d.ignoreKeywordsWithRef || !(0, util_1$l.schemaHasRulesButRef)(i,
|
|
4827
|
-
s.block(() => keywordCode(e, "$ref",
|
|
4942
|
+
const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES: p } = u;
|
|
4943
|
+
if (i.$ref && (d.ignoreKeywordsWithRef || !(0, util_1$l.schemaHasRulesButRef)(i, p))) {
|
|
4944
|
+
s.block(() => keywordCode(e, "$ref", p.all.$ref.definition));
|
|
4828
4945
|
return;
|
|
4829
4946
|
}
|
|
4830
4947
|
d.jtd || checkStrictTypes(e, t), s.block(() => {
|
|
4831
|
-
for (const O of
|
|
4832
|
-
|
|
4833
|
-
|
|
4948
|
+
for (const O of p.rules)
|
|
4949
|
+
g(O);
|
|
4950
|
+
g(p.post);
|
|
4834
4951
|
});
|
|
4835
|
-
function
|
|
4952
|
+
function g(O) {
|
|
4836
4953
|
(0, applicability_1.shouldUseGroup)(i, O) && (O.type ? (s.if((0, dataType_2.checkDataType)(O.type, o, d.strictNumbers)), iterateKeywords(e, O), t.length === 1 && t[0] === O.type && r && (s.else(), (0, dataType_2.reportTypeError)(e)), s.endIf()) : iterateKeywords(e, O), l || s.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${n || 0}`));
|
|
4837
4954
|
}
|
|
4838
4955
|
}
|
|
@@ -5005,15 +5122,15 @@ function getData(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
|
|
|
5005
5122
|
const u = RELATIVE_JSON_POINTER.exec(e);
|
|
5006
5123
|
if (!u)
|
|
5007
5124
|
throw new Error(`Invalid JSON-pointer: ${e}`);
|
|
5008
|
-
const
|
|
5125
|
+
const p = +u[1];
|
|
5009
5126
|
if (s = u[2], s === "#") {
|
|
5010
|
-
if (
|
|
5011
|
-
throw new Error(d("property/index",
|
|
5012
|
-
return n[t -
|
|
5127
|
+
if (p >= t)
|
|
5128
|
+
throw new Error(d("property/index", p));
|
|
5129
|
+
return n[t - p];
|
|
5013
5130
|
}
|
|
5014
|
-
if (
|
|
5015
|
-
throw new Error(d("data",
|
|
5016
|
-
if (i = r[t -
|
|
5131
|
+
if (p > t)
|
|
5132
|
+
throw new Error(d("data", p));
|
|
5133
|
+
if (i = r[t - p], !s)
|
|
5017
5134
|
return i;
|
|
5018
5135
|
}
|
|
5019
5136
|
let o = i;
|
|
@@ -5021,8 +5138,8 @@ function getData(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
|
|
|
5021
5138
|
for (const u of l)
|
|
5022
5139
|
u && (i = (0, codegen_1$n._)`${i}${(0, codegen_1$n.getProperty)((0, util_1$l.unescapeJsonPointer)(u))}`, o = (0, codegen_1$n._)`${o} && ${i}`);
|
|
5023
5140
|
return o;
|
|
5024
|
-
function d(u,
|
|
5025
|
-
return `Cannot access ${u} ${
|
|
5141
|
+
function d(u, p) {
|
|
5142
|
+
return `Cannot access ${u} ${p} levels up, current level is ${t}`;
|
|
5026
5143
|
}
|
|
5027
5144
|
}
|
|
5028
5145
|
validate.getData = getData;
|
|
@@ -5092,13 +5209,13 @@ function compileSchema(e) {
|
|
|
5092
5209
|
opts: this.opts,
|
|
5093
5210
|
self: this
|
|
5094
5211
|
};
|
|
5095
|
-
let
|
|
5212
|
+
let p;
|
|
5096
5213
|
try {
|
|
5097
5214
|
this._compilations.add(e), (0, validate_1$1.validateFunctionCode)(u), o.optimize(this.opts.code.optimize);
|
|
5098
|
-
const
|
|
5099
|
-
|
|
5100
|
-
const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`,
|
|
5101
|
-
if (this.scope.value(d, { ref: C }), C.errors = null, C.schema = e.schema, C.schemaEnv = e, e.$async && (C.$async = !0), this.opts.code.source === !0 && (C.source = { validateName: d, validateCode:
|
|
5215
|
+
const g = o.toString();
|
|
5216
|
+
p = `${o.scopeRefs(names_1$2.default.scope)}return ${g}`, this.opts.code.process && (p = this.opts.code.process(p, e));
|
|
5217
|
+
const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
|
|
5218
|
+
if (this.scope.value(d, { ref: C }), C.errors = null, C.schema = e.schema, C.schemaEnv = e, e.$async && (C.$async = !0), this.opts.code.source === !0 && (C.source = { validateName: d, validateCode: g, scopeValues: o._values }), this.opts.unevaluated) {
|
|
5102
5219
|
const { props: S, items: T } = u;
|
|
5103
5220
|
C.evaluated = {
|
|
5104
5221
|
props: S instanceof codegen_1$m.Name ? void 0 : S,
|
|
@@ -5108,8 +5225,8 @@ function compileSchema(e) {
|
|
|
5108
5225
|
}, C.source && (C.source.evaluated = (0, codegen_1$m.stringify)(C.evaluated));
|
|
5109
5226
|
}
|
|
5110
5227
|
return e.validate = C, e;
|
|
5111
|
-
} catch (
|
|
5112
|
-
throw delete e.validate, delete e.validateName,
|
|
5228
|
+
} catch (g) {
|
|
5229
|
+
throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p), g;
|
|
5113
5230
|
} finally {
|
|
5114
5231
|
this._compilations.delete(e);
|
|
5115
5232
|
}
|
|
@@ -5226,7 +5343,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5226
5343
|
n(t);
|
|
5227
5344
|
})(commonjsGlobal, function(r) {
|
|
5228
5345
|
function n() {
|
|
5229
|
-
for (var
|
|
5346
|
+
for (var f = arguments.length, c = Array(f), m = 0; m < f; m++)
|
|
5230
5347
|
c[m] = arguments[m];
|
|
5231
5348
|
if (c.length > 1) {
|
|
5232
5349
|
c[0] = c[0].slice(0, -1);
|
|
@@ -5236,59 +5353,59 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5236
5353
|
} else
|
|
5237
5354
|
return c[0];
|
|
5238
5355
|
}
|
|
5239
|
-
function s(
|
|
5240
|
-
return "(?:" +
|
|
5356
|
+
function s(f) {
|
|
5357
|
+
return "(?:" + f + ")";
|
|
5241
5358
|
}
|
|
5242
|
-
function i(
|
|
5243
|
-
return
|
|
5359
|
+
function i(f) {
|
|
5360
|
+
return f === void 0 ? "undefined" : f === null ? "null" : Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase();
|
|
5244
5361
|
}
|
|
5245
|
-
function o(
|
|
5246
|
-
return
|
|
5362
|
+
function o(f) {
|
|
5363
|
+
return f.toUpperCase();
|
|
5247
5364
|
}
|
|
5248
|
-
function l(
|
|
5249
|
-
return
|
|
5365
|
+
function l(f) {
|
|
5366
|
+
return f != null ? f instanceof Array ? f : typeof f.length != "number" || f.split || f.setInterval || f.call ? [f] : Array.prototype.slice.call(f) : [];
|
|
5250
5367
|
}
|
|
5251
|
-
function d(
|
|
5252
|
-
var m =
|
|
5368
|
+
function d(f, c) {
|
|
5369
|
+
var m = f;
|
|
5253
5370
|
if (c)
|
|
5254
5371
|
for (var R in c)
|
|
5255
5372
|
m[R] = c[R];
|
|
5256
5373
|
return m;
|
|
5257
5374
|
}
|
|
5258
|
-
function u(
|
|
5259
|
-
var c = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
|
|
5375
|
+
function u(f) {
|
|
5376
|
+
var c = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", Q = n(U, L), Z = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", ne = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, m, "[\\-\\.\\_\\~]", Z);
|
|
5260
5377
|
s(c + n(c, m, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(B, L, "[\\:]")) + "*");
|
|
5261
|
-
var
|
|
5378
|
+
var Y = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), se = s(Y + "\\." + Y + "\\." + Y + "\\." + Y), z = s(R + "{1,4}"), X = s(s(z + "\\:" + z) + "|" + se), ae = s(s(z + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(z + "\\:") + "{5}" + X), Se = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + X), ge = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + X), $e = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + X), xe = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + X), Ne = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + X), fe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), Ie = s([ae, ee, Se, ge, $e, xe, Ne, fe, ye].join("|")), we = s(s(B + "|" + E) + "+");
|
|
5262
5379
|
s("[vV]" + R + "+\\." + n(B, L, "[\\:]") + "+"), s(s(E + "|" + n(B, L)) + "*");
|
|
5263
|
-
var
|
|
5264
|
-
return s(s(E + "|" + n(B, L, "[\\@]")) + "+"), s(s(
|
|
5380
|
+
var ot = s(E + "|" + n(B, L, "[\\:\\@]"));
|
|
5381
|
+
return s(s(E + "|" + n(B, L, "[\\@]")) + "+"), s(s(ot + "|" + n("[\\/\\?]", ne)) + "*"), {
|
|
5265
5382
|
NOT_SCHEME: new RegExp(n("[^]", c, m, "[\\+\\-\\.]"), "g"),
|
|
5266
5383
|
NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, L), "g"),
|
|
5267
5384
|
NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, L), "g"),
|
|
5268
5385
|
NOT_PATH: new RegExp(n("[^\\%\\/\\:\\@]", B, L), "g"),
|
|
5269
5386
|
NOT_PATH_NOSCHEME: new RegExp(n("[^\\%\\/\\@]", B, L), "g"),
|
|
5270
|
-
NOT_QUERY: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]",
|
|
5387
|
+
NOT_QUERY: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]", ne), "g"),
|
|
5271
5388
|
NOT_FRAGMENT: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]"), "g"),
|
|
5272
5389
|
ESCAPE: new RegExp(n("[^]", B, L), "g"),
|
|
5273
5390
|
UNRESERVED: new RegExp(B, "g"),
|
|
5274
|
-
OTHER_CHARS: new RegExp(n("[^\\%]", B,
|
|
5391
|
+
OTHER_CHARS: new RegExp(n("[^\\%]", B, Q), "g"),
|
|
5275
5392
|
PCT_ENCODED: new RegExp(E, "g"),
|
|
5276
|
-
IPV4ADDRESS: new RegExp("^(" +
|
|
5277
|
-
IPV6ADDRESS: new RegExp("^\\[?(" +
|
|
5393
|
+
IPV4ADDRESS: new RegExp("^(" + se + ")$"),
|
|
5394
|
+
IPV6ADDRESS: new RegExp("^\\[?(" + Ie + ")" + s(s("\\%25|\\%(?!" + R + "{2})") + "(" + we + ")") + "?\\]?$")
|
|
5278
5395
|
//RFC 6874, with relaxed parsing rules
|
|
5279
5396
|
};
|
|
5280
5397
|
}
|
|
5281
|
-
var
|
|
5282
|
-
function
|
|
5398
|
+
var p = u(!1), g = u(!0), O = function() {
|
|
5399
|
+
function f(c, m) {
|
|
5283
5400
|
var R = [], E = !0, U = !1, L = void 0;
|
|
5284
5401
|
try {
|
|
5285
|
-
for (var
|
|
5402
|
+
for (var Q = c[Symbol.iterator](), Z; !(E = (Z = Q.next()).done) && (R.push(Z.value), !(m && R.length === m)); E = !0)
|
|
5286
5403
|
;
|
|
5287
|
-
} catch (
|
|
5288
|
-
U = !0, L =
|
|
5404
|
+
} catch (ne) {
|
|
5405
|
+
U = !0, L = ne;
|
|
5289
5406
|
} finally {
|
|
5290
5407
|
try {
|
|
5291
|
-
!E &&
|
|
5408
|
+
!E && Q.return && Q.return();
|
|
5292
5409
|
} finally {
|
|
5293
5410
|
if (U)
|
|
5294
5411
|
throw L;
|
|
@@ -5300,153 +5417,153 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5300
5417
|
if (Array.isArray(c))
|
|
5301
5418
|
return c;
|
|
5302
5419
|
if (Symbol.iterator in Object(c))
|
|
5303
|
-
return
|
|
5420
|
+
return f(c, m);
|
|
5304
5421
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
5305
5422
|
};
|
|
5306
|
-
}(), C = function(
|
|
5307
|
-
if (Array.isArray(
|
|
5308
|
-
for (var c = 0, m = Array(
|
|
5309
|
-
m[c] =
|
|
5423
|
+
}(), C = function(f) {
|
|
5424
|
+
if (Array.isArray(f)) {
|
|
5425
|
+
for (var c = 0, m = Array(f.length); c < f.length; c++)
|
|
5426
|
+
m[c] = f[c];
|
|
5310
5427
|
return m;
|
|
5311
5428
|
} else
|
|
5312
|
-
return Array.from(
|
|
5313
|
-
}, S = 2147483647, T = 36, y = 1, _ = 26,
|
|
5429
|
+
return Array.from(f);
|
|
5430
|
+
}, S = 2147483647, T = 36, y = 1, _ = 26, $ = 38, P = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
|
|
5314
5431
|
overflow: "Overflow: input needs wider integers to process",
|
|
5315
5432
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5316
5433
|
"invalid-input": "Invalid input"
|
|
5317
|
-
},
|
|
5318
|
-
function oe(
|
|
5319
|
-
throw new RangeError(x[
|
|
5434
|
+
}, te = T - y, J = Math.floor, ue = String.fromCharCode;
|
|
5435
|
+
function oe(f) {
|
|
5436
|
+
throw new RangeError(x[f]);
|
|
5320
5437
|
}
|
|
5321
|
-
function
|
|
5322
|
-
for (var m = [], R =
|
|
5323
|
-
m[R] = c(
|
|
5438
|
+
function Te(f, c) {
|
|
5439
|
+
for (var m = [], R = f.length; R--; )
|
|
5440
|
+
m[R] = c(f[R]);
|
|
5324
5441
|
return m;
|
|
5325
5442
|
}
|
|
5326
|
-
function
|
|
5327
|
-
var m =
|
|
5328
|
-
m.length > 1 && (R = m[0] + "@",
|
|
5329
|
-
var E =
|
|
5443
|
+
function ke(f, c) {
|
|
5444
|
+
var m = f.split("@"), R = "";
|
|
5445
|
+
m.length > 1 && (R = m[0] + "@", f = m[1]), f = f.replace(V, ".");
|
|
5446
|
+
var E = f.split("."), U = Te(E, c).join(".");
|
|
5330
5447
|
return R + U;
|
|
5331
5448
|
}
|
|
5332
|
-
function
|
|
5333
|
-
for (var c = [], m = 0, R =
|
|
5334
|
-
var E =
|
|
5449
|
+
function Fe(f) {
|
|
5450
|
+
for (var c = [], m = 0, R = f.length; m < R; ) {
|
|
5451
|
+
var E = f.charCodeAt(m++);
|
|
5335
5452
|
if (E >= 55296 && E <= 56319 && m < R) {
|
|
5336
|
-
var U =
|
|
5453
|
+
var U = f.charCodeAt(m++);
|
|
5337
5454
|
(U & 64512) == 56320 ? c.push(((E & 1023) << 10) + (U & 1023) + 65536) : (c.push(E), m--);
|
|
5338
5455
|
} else
|
|
5339
5456
|
c.push(E);
|
|
5340
5457
|
}
|
|
5341
5458
|
return c;
|
|
5342
5459
|
}
|
|
5343
|
-
var
|
|
5460
|
+
var Ze = function(c) {
|
|
5344
5461
|
return String.fromCodePoint.apply(String, C(c));
|
|
5345
|
-
},
|
|
5462
|
+
}, Me = function(c) {
|
|
5346
5463
|
return c - 48 < 10 ? c - 22 : c - 65 < 26 ? c - 65 : c - 97 < 26 ? c - 97 : T;
|
|
5347
5464
|
}, F = function(c, m) {
|
|
5348
5465
|
return c + 22 + 75 * (c < 26) - ((m != 0) << 5);
|
|
5349
5466
|
}, v = function(c, m, R) {
|
|
5350
5467
|
var E = 0;
|
|
5351
5468
|
for (
|
|
5352
|
-
c = R ?
|
|
5469
|
+
c = R ? J(c / P) : c >> 1, c += J(c / m);
|
|
5353
5470
|
/* no initialization */
|
|
5354
|
-
c >
|
|
5471
|
+
c > te * _ >> 1;
|
|
5355
5472
|
E += T
|
|
5356
5473
|
)
|
|
5357
|
-
c =
|
|
5358
|
-
return
|
|
5474
|
+
c = J(c / te);
|
|
5475
|
+
return J(E + (te + 1) * c / (c + $));
|
|
5359
5476
|
}, j = function(c) {
|
|
5360
|
-
var m = [], R = c.length, E = 0, U = D, L = I,
|
|
5361
|
-
|
|
5362
|
-
for (var
|
|
5363
|
-
c.charCodeAt(
|
|
5364
|
-
for (var
|
|
5477
|
+
var m = [], R = c.length, E = 0, U = D, L = I, Q = c.lastIndexOf(w);
|
|
5478
|
+
Q < 0 && (Q = 0);
|
|
5479
|
+
for (var Z = 0; Z < Q; ++Z)
|
|
5480
|
+
c.charCodeAt(Z) >= 128 && oe("not-basic"), m.push(c.charCodeAt(Z));
|
|
5481
|
+
for (var ne = Q > 0 ? Q + 1 : 0; ne < R; ) {
|
|
5365
5482
|
for (
|
|
5366
|
-
var B = E,
|
|
5483
|
+
var B = E, Y = 1, se = T;
|
|
5367
5484
|
;
|
|
5368
5485
|
/* no condition */
|
|
5369
|
-
|
|
5486
|
+
se += T
|
|
5370
5487
|
) {
|
|
5371
|
-
|
|
5372
|
-
var z =
|
|
5373
|
-
(z >= T || z >
|
|
5374
|
-
var X =
|
|
5488
|
+
ne >= R && oe("invalid-input");
|
|
5489
|
+
var z = Me(c.charCodeAt(ne++));
|
|
5490
|
+
(z >= T || z > J((S - E) / Y)) && oe("overflow"), E += z * Y;
|
|
5491
|
+
var X = se <= L ? y : se >= L + _ ? _ : se - L;
|
|
5375
5492
|
if (z < X)
|
|
5376
5493
|
break;
|
|
5377
5494
|
var ae = T - X;
|
|
5378
|
-
|
|
5495
|
+
Y > J(S / ae) && oe("overflow"), Y *= ae;
|
|
5379
5496
|
}
|
|
5380
5497
|
var ee = m.length + 1;
|
|
5381
|
-
L = v(E - B, ee, B == 0),
|
|
5498
|
+
L = v(E - B, ee, B == 0), J(E / ee) > S - U && oe("overflow"), U += J(E / ee), E %= ee, m.splice(E++, 0, U);
|
|
5382
5499
|
}
|
|
5383
5500
|
return String.fromCodePoint.apply(String, m);
|
|
5384
5501
|
}, b = function(c) {
|
|
5385
5502
|
var m = [];
|
|
5386
|
-
c =
|
|
5387
|
-
var R = c.length, E = D, U = 0, L = I,
|
|
5503
|
+
c = Fe(c);
|
|
5504
|
+
var R = c.length, E = D, U = 0, L = I, Q = !0, Z = !1, ne = void 0;
|
|
5388
5505
|
try {
|
|
5389
|
-
for (var B = c[Symbol.iterator](),
|
|
5390
|
-
var
|
|
5391
|
-
|
|
5506
|
+
for (var B = c[Symbol.iterator](), Y; !(Q = (Y = B.next()).done); Q = !0) {
|
|
5507
|
+
var se = Y.value;
|
|
5508
|
+
se < 128 && m.push(ue(se));
|
|
5392
5509
|
}
|
|
5393
|
-
} catch (
|
|
5394
|
-
|
|
5510
|
+
} catch (at) {
|
|
5511
|
+
Z = !0, ne = at;
|
|
5395
5512
|
} finally {
|
|
5396
5513
|
try {
|
|
5397
|
-
!
|
|
5514
|
+
!Q && B.return && B.return();
|
|
5398
5515
|
} finally {
|
|
5399
|
-
if (
|
|
5400
|
-
throw
|
|
5516
|
+
if (Z)
|
|
5517
|
+
throw ne;
|
|
5401
5518
|
}
|
|
5402
5519
|
}
|
|
5403
5520
|
var z = m.length, X = z;
|
|
5404
5521
|
for (z && m.push(w); X < R; ) {
|
|
5405
|
-
var ae = S, ee = !0, Se = !1,
|
|
5522
|
+
var ae = S, ee = !0, Se = !1, ge = void 0;
|
|
5406
5523
|
try {
|
|
5407
|
-
for (var
|
|
5408
|
-
var
|
|
5409
|
-
|
|
5524
|
+
for (var $e = c[Symbol.iterator](), xe; !(ee = (xe = $e.next()).done); ee = !0) {
|
|
5525
|
+
var Ne = xe.value;
|
|
5526
|
+
Ne >= E && Ne < ae && (ae = Ne);
|
|
5410
5527
|
}
|
|
5411
|
-
} catch (
|
|
5412
|
-
Se = !0,
|
|
5528
|
+
} catch (at) {
|
|
5529
|
+
Se = !0, ge = at;
|
|
5413
5530
|
} finally {
|
|
5414
5531
|
try {
|
|
5415
|
-
!ee &&
|
|
5532
|
+
!ee && $e.return && $e.return();
|
|
5416
5533
|
} finally {
|
|
5417
5534
|
if (Se)
|
|
5418
|
-
throw
|
|
5535
|
+
throw ge;
|
|
5419
5536
|
}
|
|
5420
5537
|
}
|
|
5421
5538
|
var fe = X + 1;
|
|
5422
|
-
ae - E >
|
|
5423
|
-
var ye = !0,
|
|
5539
|
+
ae - E > J((S - U) / fe) && oe("overflow"), U += (ae - E) * fe, E = ae;
|
|
5540
|
+
var ye = !0, Ie = !1, we = void 0;
|
|
5424
5541
|
try {
|
|
5425
|
-
for (var
|
|
5426
|
-
var
|
|
5427
|
-
if (
|
|
5542
|
+
for (var ot = c[Symbol.iterator](), Ht; !(ye = (Ht = ot.next()).done); ye = !0) {
|
|
5543
|
+
var Vt = Ht.value;
|
|
5544
|
+
if (Vt < E && ++U > S && oe("overflow"), Vt == E) {
|
|
5428
5545
|
for (
|
|
5429
|
-
var
|
|
5546
|
+
var dt = U, ut = T;
|
|
5430
5547
|
;
|
|
5431
5548
|
/* no condition */
|
|
5432
|
-
|
|
5549
|
+
ut += T
|
|
5433
5550
|
) {
|
|
5434
|
-
var
|
|
5435
|
-
if (
|
|
5551
|
+
var pt = ut <= L ? y : ut >= L + _ ? _ : ut - L;
|
|
5552
|
+
if (dt < pt)
|
|
5436
5553
|
break;
|
|
5437
|
-
var
|
|
5438
|
-
m.push(ue(F(
|
|
5554
|
+
var zt = dt - pt, xt = T - pt;
|
|
5555
|
+
m.push(ue(F(pt + zt % xt, 0))), dt = J(zt / xt);
|
|
5439
5556
|
}
|
|
5440
|
-
m.push(ue(F(
|
|
5557
|
+
m.push(ue(F(dt, 0))), L = v(U, fe, X == z), U = 0, ++X;
|
|
5441
5558
|
}
|
|
5442
5559
|
}
|
|
5443
|
-
} catch (
|
|
5444
|
-
|
|
5560
|
+
} catch (at) {
|
|
5561
|
+
Ie = !0, we = at;
|
|
5445
5562
|
} finally {
|
|
5446
5563
|
try {
|
|
5447
|
-
!ye &&
|
|
5564
|
+
!ye && ot.return && ot.return();
|
|
5448
5565
|
} finally {
|
|
5449
|
-
if (
|
|
5566
|
+
if (Ie)
|
|
5450
5567
|
throw we;
|
|
5451
5568
|
}
|
|
5452
5569
|
}
|
|
@@ -5454,11 +5571,11 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5454
5571
|
}
|
|
5455
5572
|
return m.join("");
|
|
5456
5573
|
}, a = function(c) {
|
|
5457
|
-
return
|
|
5574
|
+
return ke(c, function(m) {
|
|
5458
5575
|
return k.test(m) ? j(m.slice(4).toLowerCase()) : m;
|
|
5459
5576
|
});
|
|
5460
5577
|
}, h = function(c) {
|
|
5461
|
-
return
|
|
5578
|
+
return ke(c, function(m) {
|
|
5462
5579
|
return A.test(m) ? "xn--" + b(m) : m;
|
|
5463
5580
|
});
|
|
5464
5581
|
}, N = {
|
|
@@ -5476,87 +5593,87 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5476
5593
|
* @type Object
|
|
5477
5594
|
*/
|
|
5478
5595
|
ucs2: {
|
|
5479
|
-
decode:
|
|
5480
|
-
encode:
|
|
5596
|
+
decode: Fe,
|
|
5597
|
+
encode: Ze
|
|
5481
5598
|
},
|
|
5482
5599
|
decode: j,
|
|
5483
5600
|
encode: b,
|
|
5484
5601
|
toASCII: h,
|
|
5485
5602
|
toUnicode: a
|
|
5486
5603
|
}, M = {};
|
|
5487
|
-
function q(
|
|
5488
|
-
var c =
|
|
5604
|
+
function q(f) {
|
|
5605
|
+
var c = f.charCodeAt(0), m = void 0;
|
|
5489
5606
|
return c < 16 ? m = "%0" + c.toString(16).toUpperCase() : c < 128 ? m = "%" + c.toString(16).toUpperCase() : c < 2048 ? m = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase() : m = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(), m;
|
|
5490
5607
|
}
|
|
5491
|
-
function W(
|
|
5492
|
-
for (var c = "", m = 0, R =
|
|
5493
|
-
var E = parseInt(
|
|
5608
|
+
function W(f) {
|
|
5609
|
+
for (var c = "", m = 0, R = f.length; m < R; ) {
|
|
5610
|
+
var E = parseInt(f.substr(m + 1, 2), 16);
|
|
5494
5611
|
if (E < 128)
|
|
5495
5612
|
c += String.fromCharCode(E), m += 3;
|
|
5496
5613
|
else if (E >= 194 && E < 224) {
|
|
5497
5614
|
if (R - m >= 6) {
|
|
5498
|
-
var U = parseInt(
|
|
5615
|
+
var U = parseInt(f.substr(m + 4, 2), 16);
|
|
5499
5616
|
c += String.fromCharCode((E & 31) << 6 | U & 63);
|
|
5500
5617
|
} else
|
|
5501
|
-
c +=
|
|
5618
|
+
c += f.substr(m, 6);
|
|
5502
5619
|
m += 6;
|
|
5503
5620
|
} else if (E >= 224) {
|
|
5504
5621
|
if (R - m >= 9) {
|
|
5505
|
-
var L = parseInt(
|
|
5506
|
-
c += String.fromCharCode((E & 15) << 12 | (L & 63) << 6 |
|
|
5622
|
+
var L = parseInt(f.substr(m + 4, 2), 16), Q = parseInt(f.substr(m + 7, 2), 16);
|
|
5623
|
+
c += String.fromCharCode((E & 15) << 12 | (L & 63) << 6 | Q & 63);
|
|
5507
5624
|
} else
|
|
5508
|
-
c +=
|
|
5625
|
+
c += f.substr(m, 9);
|
|
5509
5626
|
m += 9;
|
|
5510
5627
|
} else
|
|
5511
|
-
c +=
|
|
5628
|
+
c += f.substr(m, 3), m += 3;
|
|
5512
5629
|
}
|
|
5513
5630
|
return c;
|
|
5514
5631
|
}
|
|
5515
|
-
function G(
|
|
5632
|
+
function G(f, c) {
|
|
5516
5633
|
function m(R) {
|
|
5517
5634
|
var E = W(R);
|
|
5518
5635
|
return E.match(c.UNRESERVED) ? E : R;
|
|
5519
5636
|
}
|
|
5520
|
-
return
|
|
5637
|
+
return f.scheme && (f.scheme = String(f.scheme).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(c.PCT_ENCODED, m).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(c.PCT_ENCODED, m).replace(f.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(c.PCT_ENCODED, m).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(c.PCT_ENCODED, m).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), f;
|
|
5521
5638
|
}
|
|
5522
|
-
function
|
|
5523
|
-
return
|
|
5639
|
+
function re(f) {
|
|
5640
|
+
return f.replace(/^0*(.*)/, "$1") || "0";
|
|
5524
5641
|
}
|
|
5525
|
-
function he(
|
|
5526
|
-
var m =
|
|
5527
|
-
return E ? E.split(".").map(
|
|
5642
|
+
function he(f, c) {
|
|
5643
|
+
var m = f.match(c.IPV4ADDRESS) || [], R = O(m, 2), E = R[1];
|
|
5644
|
+
return E ? E.split(".").map(re).join(".") : f;
|
|
5528
5645
|
}
|
|
5529
|
-
function
|
|
5530
|
-
var m =
|
|
5646
|
+
function qe(f, c) {
|
|
5647
|
+
var m = f.match(c.IPV6ADDRESS) || [], R = O(m, 3), E = R[1], U = R[2];
|
|
5531
5648
|
if (E) {
|
|
5532
|
-
for (var L = E.toLowerCase().split("::").reverse(),
|
|
5533
|
-
ae[ee] = B[ee] ||
|
|
5534
|
-
|
|
5535
|
-
var Se = ae.reduce(function(fe, ye,
|
|
5649
|
+
for (var L = E.toLowerCase().split("::").reverse(), Q = O(L, 2), Z = Q[0], ne = Q[1], B = ne ? ne.split(":").map(re) : [], Y = Z.split(":").map(re), se = c.IPV4ADDRESS.test(Y[Y.length - 1]), z = se ? 7 : 8, X = Y.length - z, ae = Array(z), ee = 0; ee < z; ++ee)
|
|
5650
|
+
ae[ee] = B[ee] || Y[X + ee] || "";
|
|
5651
|
+
se && (ae[z - 1] = he(ae[z - 1], c));
|
|
5652
|
+
var Se = ae.reduce(function(fe, ye, Ie) {
|
|
5536
5653
|
if (!ye || ye === "0") {
|
|
5537
5654
|
var we = fe[fe.length - 1];
|
|
5538
|
-
we && we.index + we.length ===
|
|
5655
|
+
we && we.index + we.length === Ie ? we.length++ : fe.push({ index: Ie, length: 1 });
|
|
5539
5656
|
}
|
|
5540
5657
|
return fe;
|
|
5541
|
-
}, []),
|
|
5658
|
+
}, []), ge = Se.sort(function(fe, ye) {
|
|
5542
5659
|
return ye.length - fe.length;
|
|
5543
|
-
})[0],
|
|
5544
|
-
if (
|
|
5545
|
-
var
|
|
5546
|
-
|
|
5660
|
+
})[0], $e = void 0;
|
|
5661
|
+
if (ge && ge.length > 1) {
|
|
5662
|
+
var xe = ae.slice(0, ge.index), Ne = ae.slice(ge.index + ge.length);
|
|
5663
|
+
$e = xe.join(":") + "::" + Ne.join(":");
|
|
5547
5664
|
} else
|
|
5548
|
-
|
|
5549
|
-
return U && (
|
|
5665
|
+
$e = ae.join(":");
|
|
5666
|
+
return U && ($e += "%" + U), $e;
|
|
5550
5667
|
} else
|
|
5551
|
-
return
|
|
5668
|
+
return f;
|
|
5552
5669
|
}
|
|
5553
|
-
var
|
|
5554
|
-
function de(
|
|
5555
|
-
var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = c.iri !== !1 ?
|
|
5556
|
-
c.reference === "suffix" && (
|
|
5557
|
-
var E =
|
|
5670
|
+
var Xe = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, et = "".match(/(){0}/)[1] === void 0;
|
|
5671
|
+
function de(f) {
|
|
5672
|
+
var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = c.iri !== !1 ? g : p;
|
|
5673
|
+
c.reference === "suffix" && (f = (c.scheme ? c.scheme + ":" : "") + "//" + f);
|
|
5674
|
+
var E = f.match(Xe);
|
|
5558
5675
|
if (E) {
|
|
5559
|
-
|
|
5676
|
+
et ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? E[3] : void 0, m.host = f.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = f.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = qe(he(m.host, R), R)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", c.reference && c.reference !== "suffix" && c.reference !== m.reference && (m.error = m.error || "URI is not a " + c.reference + " reference.");
|
|
5560
5677
|
var U = M[(c.scheme || m.scheme || "").toLowerCase()];
|
|
5561
5678
|
if (!c.unicodeSupport && (!U || !U.unicodeSupport)) {
|
|
5562
5679
|
if (m.host && (c.domainHost || U && U.domainHost))
|
|
@@ -5565,7 +5682,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5565
5682
|
} catch (L) {
|
|
5566
5683
|
m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + L;
|
|
5567
5684
|
}
|
|
5568
|
-
G(m,
|
|
5685
|
+
G(m, p);
|
|
5569
5686
|
} else
|
|
5570
5687
|
G(m, R);
|
|
5571
5688
|
U && U.parse && U.parse(m, c);
|
|
@@ -5573,72 +5690,72 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5573
5690
|
m.error = m.error || "URI can not be parsed.";
|
|
5574
5691
|
return m;
|
|
5575
5692
|
}
|
|
5576
|
-
function
|
|
5577
|
-
var m = c.iri !== !1 ?
|
|
5578
|
-
return
|
|
5693
|
+
function tt(f, c) {
|
|
5694
|
+
var m = c.iri !== !1 ? g : p, R = [];
|
|
5695
|
+
return f.userinfo !== void 0 && (R.push(f.userinfo), R.push("@")), f.host !== void 0 && R.push(qe(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(E, U, L) {
|
|
5579
5696
|
return "[" + U + (L ? "%25" + L : "") + "]";
|
|
5580
|
-
})), (typeof
|
|
5581
|
-
}
|
|
5582
|
-
var
|
|
5583
|
-
function me(
|
|
5584
|
-
for (var c = [];
|
|
5585
|
-
if (
|
|
5586
|
-
|
|
5587
|
-
else if (
|
|
5588
|
-
|
|
5589
|
-
else if (
|
|
5590
|
-
|
|
5591
|
-
else if (
|
|
5592
|
-
|
|
5697
|
+
})), (typeof f.port == "number" || typeof f.port == "string") && (R.push(":"), R.push(String(f.port))), R.length ? R.join("") : void 0;
|
|
5698
|
+
}
|
|
5699
|
+
var Ue = /^\.\.?\//, Le = /^\/\.(\/|$)/, He = /^\/\.\.(\/|$)/, rt = /^\/?(?:.|\n)*?(?=\/|$)/;
|
|
5700
|
+
function me(f) {
|
|
5701
|
+
for (var c = []; f.length; )
|
|
5702
|
+
if (f.match(Ue))
|
|
5703
|
+
f = f.replace(Ue, "");
|
|
5704
|
+
else if (f.match(Le))
|
|
5705
|
+
f = f.replace(Le, "/");
|
|
5706
|
+
else if (f.match(He))
|
|
5707
|
+
f = f.replace(He, "/"), c.pop();
|
|
5708
|
+
else if (f === "." || f === "..")
|
|
5709
|
+
f = "";
|
|
5593
5710
|
else {
|
|
5594
|
-
var m =
|
|
5711
|
+
var m = f.match(rt);
|
|
5595
5712
|
if (m) {
|
|
5596
5713
|
var R = m[0];
|
|
5597
|
-
|
|
5714
|
+
f = f.slice(R.length), c.push(R);
|
|
5598
5715
|
} else
|
|
5599
5716
|
throw new Error("Unexpected dot segment condition");
|
|
5600
5717
|
}
|
|
5601
5718
|
return c.join("");
|
|
5602
5719
|
}
|
|
5603
|
-
function le(
|
|
5604
|
-
var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ?
|
|
5605
|
-
if (E && E.serialize && E.serialize(
|
|
5720
|
+
function le(f) {
|
|
5721
|
+
var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ? g : p, R = [], E = M[(c.scheme || f.scheme || "").toLowerCase()];
|
|
5722
|
+
if (E && E.serialize && E.serialize(f, c), f.host && !m.IPV6ADDRESS.test(f.host)) {
|
|
5606
5723
|
if (c.domainHost || E && E.domainHost)
|
|
5607
5724
|
try {
|
|
5608
|
-
|
|
5609
|
-
} catch (
|
|
5610
|
-
|
|
5725
|
+
f.host = c.iri ? N.toUnicode(f.host) : N.toASCII(f.host.replace(m.PCT_ENCODED, W).toLowerCase());
|
|
5726
|
+
} catch (Q) {
|
|
5727
|
+
f.error = f.error || "Host's domain name can not be converted to " + (c.iri ? "Unicode" : "ASCII") + " via punycode: " + Q;
|
|
5611
5728
|
}
|
|
5612
5729
|
}
|
|
5613
|
-
G(
|
|
5614
|
-
var U =
|
|
5615
|
-
if (U !== void 0 && (c.reference !== "suffix" && R.push("//"), R.push(U),
|
|
5616
|
-
var L =
|
|
5730
|
+
G(f, m), c.reference !== "suffix" && f.scheme && (R.push(f.scheme), R.push(":"));
|
|
5731
|
+
var U = tt(f, c);
|
|
5732
|
+
if (U !== void 0 && (c.reference !== "suffix" && R.push("//"), R.push(U), f.path && f.path.charAt(0) !== "/" && R.push("/")), f.path !== void 0) {
|
|
5733
|
+
var L = f.path;
|
|
5617
5734
|
!c.absolutePath && (!E || !E.absolutePath) && (L = me(L)), U === void 0 && (L = L.replace(/^\/\//, "/%2F")), R.push(L);
|
|
5618
5735
|
}
|
|
5619
|
-
return
|
|
5736
|
+
return f.query !== void 0 && (R.push("?"), R.push(f.query)), f.fragment !== void 0 && (R.push("#"), R.push(f.fragment)), R.join("");
|
|
5620
5737
|
}
|
|
5621
|
-
function
|
|
5738
|
+
function Ve(f, c) {
|
|
5622
5739
|
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, R = arguments[3], E = {};
|
|
5623
|
-
return R || (
|
|
5740
|
+
return R || (f = de(le(f, m), m), c = de(le(c, m), m)), m = m || {}, !m.tolerant && c.scheme ? (E.scheme = c.scheme, E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? E.path = me(c.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? E.path = "/" + c.path : f.path ? E.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + c.path : E.path = c.path, E.path = me(E.path)), E.query = c.query) : (E.path = f.path, c.query !== void 0 ? E.query = c.query : E.query = f.query), E.userinfo = f.userinfo, E.host = f.host, E.port = f.port), E.scheme = f.scheme), E.fragment = c.fragment, E;
|
|
5624
5741
|
}
|
|
5625
|
-
function
|
|
5742
|
+
function nt(f, c, m) {
|
|
5626
5743
|
var R = d({ scheme: "null" }, m);
|
|
5627
|
-
return le(
|
|
5744
|
+
return le(Ve(de(f, R), de(c, R), R, !0), R);
|
|
5628
5745
|
}
|
|
5629
|
-
function
|
|
5630
|
-
return typeof
|
|
5746
|
+
function Ce(f, c) {
|
|
5747
|
+
return typeof f == "string" ? f = le(de(f, c), c) : i(f) === "object" && (f = de(le(f, c), c)), f;
|
|
5631
5748
|
}
|
|
5632
|
-
function
|
|
5633
|
-
return typeof
|
|
5749
|
+
function st(f, c, m) {
|
|
5750
|
+
return typeof f == "string" ? f = le(de(f, m), m) : i(f) === "object" && (f = le(f, m)), typeof c == "string" ? c = le(de(c, m), m) : i(c) === "object" && (c = le(c, m)), f === c;
|
|
5634
5751
|
}
|
|
5635
|
-
function
|
|
5636
|
-
return
|
|
5752
|
+
function lt(f, c) {
|
|
5753
|
+
return f && f.toString().replace(!c || !c.iri ? p.ESCAPE : g.ESCAPE, q);
|
|
5637
5754
|
}
|
|
5638
|
-
function pe(
|
|
5639
|
-
return
|
|
5755
|
+
function pe(f, c) {
|
|
5756
|
+
return f && f.toString().replace(!c || !c.iri ? p.PCT_ENCODED : g.PCT_ENCODED, W);
|
|
5640
5757
|
}
|
|
5641
|
-
var
|
|
5758
|
+
var Oe = {
|
|
5642
5759
|
scheme: "http",
|
|
5643
5760
|
domainHost: !0,
|
|
5644
5761
|
parse: function(c, m) {
|
|
@@ -5648,50 +5765,50 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5648
5765
|
var R = String(c.scheme).toLowerCase() === "https";
|
|
5649
5766
|
return (c.port === (R ? 443 : 80) || c.port === "") && (c.port = void 0), c.path || (c.path = "/"), c;
|
|
5650
5767
|
}
|
|
5651
|
-
},
|
|
5768
|
+
}, jt = {
|
|
5652
5769
|
scheme: "https",
|
|
5653
|
-
domainHost:
|
|
5654
|
-
parse:
|
|
5655
|
-
serialize:
|
|
5770
|
+
domainHost: Oe.domainHost,
|
|
5771
|
+
parse: Oe.parse,
|
|
5772
|
+
serialize: Oe.serialize
|
|
5656
5773
|
};
|
|
5657
|
-
function
|
|
5658
|
-
return typeof
|
|
5774
|
+
function At(f) {
|
|
5775
|
+
return typeof f.secure == "boolean" ? f.secure : String(f.scheme).toLowerCase() === "wss";
|
|
5659
5776
|
}
|
|
5660
|
-
var
|
|
5777
|
+
var it = {
|
|
5661
5778
|
scheme: "ws",
|
|
5662
5779
|
domainHost: !0,
|
|
5663
5780
|
parse: function(c, m) {
|
|
5664
5781
|
var R = c;
|
|
5665
|
-
return R.secure =
|
|
5782
|
+
return R.secure = At(R), R.resourceName = (R.path || "/") + (R.query ? "?" + R.query : ""), R.path = void 0, R.query = void 0, R;
|
|
5666
5783
|
},
|
|
5667
5784
|
serialize: function(c, m) {
|
|
5668
|
-
if ((c.port === (
|
|
5785
|
+
if ((c.port === (At(c) ? 443 : 80) || c.port === "") && (c.port = void 0), typeof c.secure == "boolean" && (c.scheme = c.secure ? "wss" : "ws", c.secure = void 0), c.resourceName) {
|
|
5669
5786
|
var R = c.resourceName.split("?"), E = O(R, 2), U = E[0], L = E[1];
|
|
5670
5787
|
c.path = U && U !== "/" ? U : void 0, c.query = L, c.resourceName = void 0;
|
|
5671
5788
|
}
|
|
5672
5789
|
return c.fragment = void 0, c;
|
|
5673
5790
|
}
|
|
5674
|
-
},
|
|
5791
|
+
}, Dt = {
|
|
5675
5792
|
scheme: "wss",
|
|
5676
|
-
domainHost:
|
|
5677
|
-
parse:
|
|
5678
|
-
serialize:
|
|
5679
|
-
},
|
|
5680
|
-
function
|
|
5681
|
-
var c = W(
|
|
5682
|
-
return c.match(
|
|
5683
|
-
}
|
|
5684
|
-
var
|
|
5793
|
+
domainHost: it.domainHost,
|
|
5794
|
+
parse: it.parse,
|
|
5795
|
+
serialize: it.serialize
|
|
5796
|
+
}, lr = {}, Ft = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", dr = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), ur = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", pr = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", fr = n(pr, '[\\"\\\\]'), hr = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", mr = new RegExp(Ft, "g"), ze = new RegExp(dr, "g"), _r = new RegExp(n("[^]", ur, "[\\.]", '[\\"]', fr), "g"), Mt = new RegExp(n("[^]", Ft, hr), "g"), gr = Mt;
|
|
5797
|
+
function Nt(f) {
|
|
5798
|
+
var c = W(f);
|
|
5799
|
+
return c.match(mr) ? c : f;
|
|
5800
|
+
}
|
|
5801
|
+
var qt = {
|
|
5685
5802
|
scheme: "mailto",
|
|
5686
5803
|
parse: function(c, m) {
|
|
5687
5804
|
var R = c, E = R.to = R.path ? R.path.split(",") : [];
|
|
5688
5805
|
if (R.path = void 0, R.query) {
|
|
5689
|
-
for (var U = !1, L = {},
|
|
5690
|
-
var B =
|
|
5806
|
+
for (var U = !1, L = {}, Q = R.query.split("&"), Z = 0, ne = Q.length; Z < ne; ++Z) {
|
|
5807
|
+
var B = Q[Z].split("=");
|
|
5691
5808
|
switch (B[0]) {
|
|
5692
5809
|
case "to":
|
|
5693
|
-
for (var
|
|
5694
|
-
E.push(
|
|
5810
|
+
for (var Y = B[1].split(","), se = 0, z = Y.length; se < z; ++se)
|
|
5811
|
+
E.push(Y[se]);
|
|
5695
5812
|
break;
|
|
5696
5813
|
case "subject":
|
|
5697
5814
|
R.subject = pe(B[1], m);
|
|
@@ -5725,30 +5842,30 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5725
5842
|
var R = c, E = l(c.to);
|
|
5726
5843
|
if (E) {
|
|
5727
5844
|
for (var U = 0, L = E.length; U < L; ++U) {
|
|
5728
|
-
var
|
|
5845
|
+
var Q = String(E[U]), Z = Q.lastIndexOf("@"), ne = Q.slice(0, Z).replace(ze, Nt).replace(ze, o).replace(_r, q), B = Q.slice(Z + 1);
|
|
5729
5846
|
try {
|
|
5730
5847
|
B = m.iri ? N.toUnicode(B) : N.toASCII(pe(B, m).toLowerCase());
|
|
5731
5848
|
} catch (X) {
|
|
5732
5849
|
R.error = R.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
|
|
5733
5850
|
}
|
|
5734
|
-
E[U] =
|
|
5851
|
+
E[U] = ne + "@" + B;
|
|
5735
5852
|
}
|
|
5736
5853
|
R.path = E.join(",");
|
|
5737
5854
|
}
|
|
5738
|
-
var
|
|
5739
|
-
c.subject && (
|
|
5740
|
-
var
|
|
5741
|
-
for (var z in
|
|
5742
|
-
|
|
5743
|
-
return
|
|
5855
|
+
var Y = c.headers = c.headers || {};
|
|
5856
|
+
c.subject && (Y.subject = c.subject), c.body && (Y.body = c.body);
|
|
5857
|
+
var se = [];
|
|
5858
|
+
for (var z in Y)
|
|
5859
|
+
Y[z] !== lr[z] && se.push(z.replace(ze, Nt).replace(ze, o).replace(Mt, q) + "=" + Y[z].replace(ze, Nt).replace(ze, o).replace(gr, q));
|
|
5860
|
+
return se.length && (R.query = se.join("&")), R;
|
|
5744
5861
|
}
|
|
5745
|
-
},
|
|
5862
|
+
}, $r = /^([^\:]+)\:(.*)/, Ut = {
|
|
5746
5863
|
scheme: "urn",
|
|
5747
5864
|
parse: function(c, m) {
|
|
5748
|
-
var R = c.path && c.path.match(
|
|
5865
|
+
var R = c.path && c.path.match($r), E = c;
|
|
5749
5866
|
if (R) {
|
|
5750
|
-
var U = m.scheme || E.scheme || "urn", L = R[1].toLowerCase(),
|
|
5751
|
-
E.nid = L, E.nss =
|
|
5867
|
+
var U = m.scheme || E.scheme || "urn", L = R[1].toLowerCase(), Q = R[2], Z = U + ":" + (m.nid || L), ne = M[Z];
|
|
5868
|
+
E.nid = L, E.nss = Q, E.path = void 0, ne && (E = ne.parse(E, m));
|
|
5752
5869
|
} else
|
|
5753
5870
|
E.error = E.error || "URN can not be parsed.";
|
|
5754
5871
|
return E;
|
|
@@ -5756,21 +5873,21 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5756
5873
|
serialize: function(c, m) {
|
|
5757
5874
|
var R = m.scheme || c.scheme || "urn", E = c.nid, U = R + ":" + (m.nid || E), L = M[U];
|
|
5758
5875
|
L && (c = L.serialize(c, m));
|
|
5759
|
-
var
|
|
5760
|
-
return
|
|
5876
|
+
var Q = c, Z = c.nss;
|
|
5877
|
+
return Q.path = (E || m.nid) + ":" + Z, Q;
|
|
5761
5878
|
}
|
|
5762
|
-
},
|
|
5879
|
+
}, yr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Lt = {
|
|
5763
5880
|
scheme: "urn:uuid",
|
|
5764
5881
|
parse: function(c, m) {
|
|
5765
5882
|
var R = c;
|
|
5766
|
-
return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(
|
|
5883
|
+
return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(yr)) && (R.error = R.error || "UUID is not valid."), R;
|
|
5767
5884
|
},
|
|
5768
5885
|
serialize: function(c, m) {
|
|
5769
5886
|
var R = c;
|
|
5770
5887
|
return R.nss = (c.uuid || "").toLowerCase(), R;
|
|
5771
5888
|
}
|
|
5772
5889
|
};
|
|
5773
|
-
M[
|
|
5890
|
+
M[Oe.scheme] = Oe, M[jt.scheme] = jt, M[it.scheme] = it, M[Dt.scheme] = Dt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, M[Lt.scheme] = Lt, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = Ve, r.resolve = nt, r.normalize = Ce, r.equal = st, r.escapeComponent = lt, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
|
|
5774
5891
|
});
|
|
5775
5892
|
})(uri_all, uri_all.exports);
|
|
5776
5893
|
var uri_allExports = uri_all.exports;
|
|
@@ -5798,7 +5915,7 @@ uri$1.default = uri;
|
|
|
5798
5915
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
5799
5916
|
return r.CodeGen;
|
|
5800
5917
|
} });
|
|
5801
|
-
const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType,
|
|
5918
|
+
const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, p = util, g = require$$9, O = uri$1, C = (F, v) => new RegExp(F, v);
|
|
5802
5919
|
C.code = "new RegExp";
|
|
5803
5920
|
const S = ["removeAdditional", "useDefaults", "coerceTypes"], T = /* @__PURE__ */ new Set([
|
|
5804
5921
|
"validate",
|
|
@@ -5834,36 +5951,36 @@ uri$1.default = uri;
|
|
|
5834
5951
|
ignoreKeywordsWithRef: "",
|
|
5835
5952
|
jsPropertySyntax: "",
|
|
5836
5953
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
5837
|
-
},
|
|
5954
|
+
}, $ = 200;
|
|
5838
5955
|
function P(F) {
|
|
5839
|
-
var v, j, b, a, h, N, M, q, W, G,
|
|
5840
|
-
const
|
|
5956
|
+
var v, j, b, a, h, N, M, q, W, G, re, he, qe, Xe, et, de, tt, Ue, Le, He, rt, me, le, Ve, nt;
|
|
5957
|
+
const Ce = F.strict, st = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, lt = st === !0 || st === void 0 ? 1 : st || 0, pe = (b = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && b !== void 0 ? b : C, Oe = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
|
|
5841
5958
|
return {
|
|
5842
|
-
strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h :
|
|
5843
|
-
strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M :
|
|
5844
|
-
strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W :
|
|
5845
|
-
strictTuples: (he = (
|
|
5846
|
-
strictRequired: (
|
|
5847
|
-
code: F.code ? { ...F.code, optimize:
|
|
5848
|
-
loopRequired: (
|
|
5849
|
-
loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de :
|
|
5850
|
-
meta: (
|
|
5851
|
-
messages: (
|
|
5852
|
-
inlineRefs: (
|
|
5853
|
-
schemaId: (
|
|
5854
|
-
addUsedSchema: (
|
|
5959
|
+
strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Ce) !== null && N !== void 0 ? N : !0,
|
|
5960
|
+
strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Ce) !== null && q !== void 0 ? q : !0,
|
|
5961
|
+
strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W : Ce) !== null && G !== void 0 ? G : "log",
|
|
5962
|
+
strictTuples: (he = (re = F.strictTuples) !== null && re !== void 0 ? re : Ce) !== null && he !== void 0 ? he : "log",
|
|
5963
|
+
strictRequired: (Xe = (qe = F.strictRequired) !== null && qe !== void 0 ? qe : Ce) !== null && Xe !== void 0 ? Xe : !1,
|
|
5964
|
+
code: F.code ? { ...F.code, optimize: lt, regExp: pe } : { optimize: lt, regExp: pe },
|
|
5965
|
+
loopRequired: (et = F.loopRequired) !== null && et !== void 0 ? et : $,
|
|
5966
|
+
loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : $,
|
|
5967
|
+
meta: (tt = F.meta) !== null && tt !== void 0 ? tt : !0,
|
|
5968
|
+
messages: (Ue = F.messages) !== null && Ue !== void 0 ? Ue : !0,
|
|
5969
|
+
inlineRefs: (Le = F.inlineRefs) !== null && Le !== void 0 ? Le : !0,
|
|
5970
|
+
schemaId: (He = F.schemaId) !== null && He !== void 0 ? He : "$id",
|
|
5971
|
+
addUsedSchema: (rt = F.addUsedSchema) !== null && rt !== void 0 ? rt : !0,
|
|
5855
5972
|
validateSchema: (me = F.validateSchema) !== null && me !== void 0 ? me : !0,
|
|
5856
5973
|
validateFormats: (le = F.validateFormats) !== null && le !== void 0 ? le : !0,
|
|
5857
|
-
unicodeRegExp: (
|
|
5858
|
-
int32range: (
|
|
5859
|
-
uriResolver:
|
|
5974
|
+
unicodeRegExp: (Ve = F.unicodeRegExp) !== null && Ve !== void 0 ? Ve : !0,
|
|
5975
|
+
int32range: (nt = F.int32range) !== null && nt !== void 0 ? nt : !0,
|
|
5976
|
+
uriResolver: Oe
|
|
5860
5977
|
};
|
|
5861
5978
|
}
|
|
5862
5979
|
class I {
|
|
5863
5980
|
constructor(v = {}) {
|
|
5864
5981
|
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...P(v) };
|
|
5865
5982
|
const { es5: j, lines: b } = this.opts.code;
|
|
5866
|
-
this.scope = new l.ValueScope({ scope: {}, prefixes: T, es5: j, lines: b }), this.logger =
|
|
5983
|
+
this.scope = new l.ValueScope({ scope: {}, prefixes: T, es5: j, lines: b }), this.logger = J(v.logger);
|
|
5867
5984
|
const a = v.validateFormats;
|
|
5868
5985
|
v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, y, v, "NOT SUPPORTED"), D.call(this, _, v, "DEPRECATED", "warn"), this._metaOpts = x.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && V.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), k.call(this), v.validateFormats = a;
|
|
5869
5986
|
}
|
|
@@ -5872,8 +5989,8 @@ uri$1.default = uri;
|
|
|
5872
5989
|
}
|
|
5873
5990
|
_addDefaultMetaSchema() {
|
|
5874
5991
|
const { $data: v, meta: j, schemaId: b } = this.opts;
|
|
5875
|
-
let a =
|
|
5876
|
-
b === "id" && (a = {
|
|
5992
|
+
let a = g;
|
|
5993
|
+
b === "id" && (a = { ...g }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[b], !1);
|
|
5877
5994
|
}
|
|
5878
5995
|
defaultMeta() {
|
|
5879
5996
|
const { meta: v, schemaId: j } = this.opts;
|
|
@@ -5898,9 +6015,9 @@ uri$1.default = uri;
|
|
|
5898
6015
|
throw new Error("options.loadSchema should be a function");
|
|
5899
6016
|
const { loadSchema: b } = this.opts;
|
|
5900
6017
|
return a.call(this, v, j);
|
|
5901
|
-
async function a(G,
|
|
6018
|
+
async function a(G, re) {
|
|
5902
6019
|
await h.call(this, G.$schema);
|
|
5903
|
-
const he = this._addSchema(G,
|
|
6020
|
+
const he = this._addSchema(G, re);
|
|
5904
6021
|
return he.validate || N.call(this, he);
|
|
5905
6022
|
}
|
|
5906
6023
|
async function h(G) {
|
|
@@ -5909,24 +6026,24 @@ uri$1.default = uri;
|
|
|
5909
6026
|
async function N(G) {
|
|
5910
6027
|
try {
|
|
5911
6028
|
return this._compileSchemaEnv(G);
|
|
5912
|
-
} catch (
|
|
5913
|
-
if (!(
|
|
5914
|
-
throw
|
|
5915
|
-
return M.call(this,
|
|
6029
|
+
} catch (re) {
|
|
6030
|
+
if (!(re instanceof s.default))
|
|
6031
|
+
throw re;
|
|
6032
|
+
return M.call(this, re), await q.call(this, re.missingSchema), N.call(this, G);
|
|
5916
6033
|
}
|
|
5917
6034
|
}
|
|
5918
|
-
function M({ missingSchema: G, missingRef:
|
|
6035
|
+
function M({ missingSchema: G, missingRef: re }) {
|
|
5919
6036
|
if (this.refs[G])
|
|
5920
|
-
throw new Error(`AnySchema ${G} is loaded but ${
|
|
6037
|
+
throw new Error(`AnySchema ${G} is loaded but ${re} cannot be resolved`);
|
|
5921
6038
|
}
|
|
5922
6039
|
async function q(G) {
|
|
5923
|
-
const
|
|
5924
|
-
this.refs[G] || await h.call(this,
|
|
6040
|
+
const re = await W.call(this, G);
|
|
6041
|
+
this.refs[G] || await h.call(this, re.$schema), this.refs[G] || this.addSchema(re, G, j);
|
|
5925
6042
|
}
|
|
5926
6043
|
async function W(G) {
|
|
5927
|
-
const
|
|
5928
|
-
if (
|
|
5929
|
-
return
|
|
6044
|
+
const re = this._loading[G];
|
|
6045
|
+
if (re)
|
|
6046
|
+
return re;
|
|
5930
6047
|
try {
|
|
5931
6048
|
return await (this._loading[G] = b(G));
|
|
5932
6049
|
} finally {
|
|
@@ -6027,14 +6144,14 @@ uri$1.default = uri;
|
|
|
6027
6144
|
} else
|
|
6028
6145
|
throw new Error("invalid addKeywords parameters");
|
|
6029
6146
|
if (oe.call(this, b, j), !j)
|
|
6030
|
-
return (0,
|
|
6031
|
-
|
|
6147
|
+
return (0, p.eachItem)(b, (h) => Te.call(this, h)), this;
|
|
6148
|
+
Fe.call(this, j);
|
|
6032
6149
|
const a = {
|
|
6033
6150
|
...j,
|
|
6034
6151
|
type: (0, u.getJSONTypes)(j.type),
|
|
6035
6152
|
schemaType: (0, u.getJSONTypes)(j.schemaType)
|
|
6036
6153
|
};
|
|
6037
|
-
return (0,
|
|
6154
|
+
return (0, p.eachItem)(b, a.type.length === 0 ? (h) => Te.call(this, h, a) : (h) => a.type.forEach((N) => Te.call(this, h, a, N))), this;
|
|
6038
6155
|
}
|
|
6039
6156
|
getKeyword(v) {
|
|
6040
6157
|
const j = this.RULES.all[v];
|
|
@@ -6070,7 +6187,7 @@ uri$1.default = uri;
|
|
|
6070
6187
|
if (typeof q != "object")
|
|
6071
6188
|
continue;
|
|
6072
6189
|
const { $data: W } = q.definition, G = N[M];
|
|
6073
|
-
W && G && (N[M] =
|
|
6190
|
+
W && G && (N[M] = Me(G));
|
|
6074
6191
|
}
|
|
6075
6192
|
}
|
|
6076
6193
|
return v;
|
|
@@ -6160,13 +6277,13 @@ uri$1.default = uri;
|
|
|
6160
6277
|
delete F[v];
|
|
6161
6278
|
return F;
|
|
6162
6279
|
}
|
|
6163
|
-
const
|
|
6280
|
+
const te = { log() {
|
|
6164
6281
|
}, warn() {
|
|
6165
6282
|
}, error() {
|
|
6166
6283
|
} };
|
|
6167
|
-
function
|
|
6284
|
+
function J(F) {
|
|
6168
6285
|
if (F === !1)
|
|
6169
|
-
return
|
|
6286
|
+
return te;
|
|
6170
6287
|
if (F === void 0)
|
|
6171
6288
|
return console;
|
|
6172
6289
|
if (F.log && F.warn && F.error)
|
|
@@ -6176,7 +6293,7 @@ uri$1.default = uri;
|
|
|
6176
6293
|
const ue = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
6177
6294
|
function oe(F, v) {
|
|
6178
6295
|
const { RULES: j } = this;
|
|
6179
|
-
if ((0,
|
|
6296
|
+
if ((0, p.eachItem)(F, (b) => {
|
|
6180
6297
|
if (j.keywords[b])
|
|
6181
6298
|
throw new Error(`Keyword ${b} is already defined`);
|
|
6182
6299
|
if (!ue.test(b))
|
|
@@ -6184,7 +6301,7 @@ uri$1.default = uri;
|
|
|
6184
6301
|
}), !!v && v.$data && !("code" in v || "validate" in v))
|
|
6185
6302
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
6186
6303
|
}
|
|
6187
|
-
function
|
|
6304
|
+
function Te(F, v, j) {
|
|
6188
6305
|
var b;
|
|
6189
6306
|
const a = v == null ? void 0 : v.post;
|
|
6190
6307
|
if (j && a)
|
|
@@ -6201,21 +6318,21 @@ uri$1.default = uri;
|
|
|
6201
6318
|
schemaType: (0, u.getJSONTypes)(v.schemaType)
|
|
6202
6319
|
}
|
|
6203
6320
|
};
|
|
6204
|
-
v.before ?
|
|
6321
|
+
v.before ? ke.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (b = v.implements) === null || b === void 0 || b.forEach((q) => this.addKeyword(q));
|
|
6205
6322
|
}
|
|
6206
|
-
function
|
|
6323
|
+
function ke(F, v, j) {
|
|
6207
6324
|
const b = F.rules.findIndex((a) => a.keyword === j);
|
|
6208
6325
|
b >= 0 ? F.rules.splice(b, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
|
|
6209
6326
|
}
|
|
6210
|
-
function
|
|
6327
|
+
function Fe(F) {
|
|
6211
6328
|
let { metaSchema: v } = F;
|
|
6212
|
-
v !== void 0 && (F.$data && this.opts.$data && (v =
|
|
6329
|
+
v !== void 0 && (F.$data && this.opts.$data && (v = Me(v)), F.validateSchema = this.compile(v, !0));
|
|
6213
6330
|
}
|
|
6214
|
-
const
|
|
6331
|
+
const Ze = {
|
|
6215
6332
|
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
|
|
6216
6333
|
};
|
|
6217
|
-
function
|
|
6218
|
-
return { anyOf: [F,
|
|
6334
|
+
function Me(F) {
|
|
6335
|
+
return { anyOf: [F, Ze] };
|
|
6219
6336
|
}
|
|
6220
6337
|
})(core$2);
|
|
6221
6338
|
var draft7 = {}, core$1 = {}, id = {};
|
|
@@ -6236,14 +6353,14 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
|
|
|
6236
6353
|
code(e) {
|
|
6237
6354
|
const { gen: t, schema: r, it: n } = e, { baseId: s, schemaEnv: i, validateName: o, opts: l, self: d } = n, { root: u } = i;
|
|
6238
6355
|
if ((r === "#" || r === "#/") && s === u.baseId)
|
|
6239
|
-
return
|
|
6240
|
-
const
|
|
6241
|
-
if (
|
|
6356
|
+
return g();
|
|
6357
|
+
const p = compile_1$1.resolveRef.call(d, u, s, r);
|
|
6358
|
+
if (p === void 0)
|
|
6242
6359
|
throw new ref_error_1.default(n.opts.uriResolver, s, r);
|
|
6243
|
-
if (
|
|
6244
|
-
return O(
|
|
6245
|
-
return C(
|
|
6246
|
-
function
|
|
6360
|
+
if (p instanceof compile_1$1.SchemaEnv)
|
|
6361
|
+
return O(p);
|
|
6362
|
+
return C(p);
|
|
6363
|
+
function g() {
|
|
6247
6364
|
if (i === u)
|
|
6248
6365
|
return callRef(e, o, i, i.$async);
|
|
6249
6366
|
const S = t.scopeValue("root", { ref: u });
|
|
@@ -6272,8 +6389,8 @@ function getValidate(e, t) {
|
|
|
6272
6389
|
ref.getValidate = getValidate;
|
|
6273
6390
|
function callRef(e, t, r, n) {
|
|
6274
6391
|
const { gen: s, it: i } = e, { allErrors: o, schemaEnv: l, opts: d } = i, u = d.passContext ? names_1$1.default.this : codegen_1$l.nil;
|
|
6275
|
-
n ?
|
|
6276
|
-
function
|
|
6392
|
+
n ? p() : g();
|
|
6393
|
+
function p() {
|
|
6277
6394
|
if (!l.$async)
|
|
6278
6395
|
throw new Error("async schema referenced by sync schema");
|
|
6279
6396
|
const S = s.let("valid");
|
|
@@ -6283,7 +6400,7 @@ function callRef(e, t, r, n) {
|
|
|
6283
6400
|
s.if((0, codegen_1$l._)`!(${T} instanceof ${i.ValidationError})`, () => s.throw(T)), O(T), o || s.assign(S, !1);
|
|
6284
6401
|
}), e.ok(S);
|
|
6285
6402
|
}
|
|
6286
|
-
function
|
|
6403
|
+
function g() {
|
|
6287
6404
|
e.result((0, code_1$8.callValidateCode)(e, t, u), () => C(t), () => O(t));
|
|
6288
6405
|
}
|
|
6289
6406
|
function O(S) {
|
|
@@ -6447,7 +6564,7 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6447
6564
|
if (!i && r.length === 0)
|
|
6448
6565
|
return;
|
|
6449
6566
|
const d = r.length >= l.loopRequired;
|
|
6450
|
-
if (o.allErrors ? u() :
|
|
6567
|
+
if (o.allErrors ? u() : p(), l.strictRequired) {
|
|
6451
6568
|
const C = e.parentSchema.properties, { definedProperties: S } = e.it;
|
|
6452
6569
|
for (const T of r)
|
|
6453
6570
|
if ((C == null ? void 0 : C[T]) === void 0 && !S.has(T)) {
|
|
@@ -6457,12 +6574,12 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6457
6574
|
}
|
|
6458
6575
|
function u() {
|
|
6459
6576
|
if (d || i)
|
|
6460
|
-
e.block$data(codegen_1$f.nil,
|
|
6577
|
+
e.block$data(codegen_1$f.nil, g);
|
|
6461
6578
|
else
|
|
6462
6579
|
for (const C of r)
|
|
6463
6580
|
(0, code_1$6.checkReportMissingProp)(e, C);
|
|
6464
6581
|
}
|
|
6465
|
-
function
|
|
6582
|
+
function p() {
|
|
6466
6583
|
const C = t.let("missing");
|
|
6467
6584
|
if (d || i) {
|
|
6468
6585
|
const S = t.let("valid", !0);
|
|
@@ -6470,7 +6587,7 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6470
6587
|
} else
|
|
6471
6588
|
t.if((0, code_1$6.checkMissingProp)(e, r, C)), (0, code_1$6.reportMissingProp)(e, C), t.else();
|
|
6472
6589
|
}
|
|
6473
|
-
function
|
|
6590
|
+
function g() {
|
|
6474
6591
|
t.forOf("prop", n, (C) => {
|
|
6475
6592
|
e.setParams({ missingProperty: C }), t.if((0, code_1$6.noPropertyInData)(t, s, C, l.ownProperties), () => e.error());
|
|
6476
6593
|
});
|
|
@@ -6525,20 +6642,20 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
|
|
|
6525
6642
|
if (!n && !s)
|
|
6526
6643
|
return;
|
|
6527
6644
|
const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
|
|
6528
|
-
e.block$data(d,
|
|
6529
|
-
function
|
|
6645
|
+
e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
|
|
6646
|
+
function p() {
|
|
6530
6647
|
const S = t.let("i", (0, codegen_1$d._)`${r}.length`), T = t.let("j");
|
|
6531
|
-
e.setParams({ i: S, j: T }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (
|
|
6648
|
+
e.setParams({ i: S, j: T }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (g() ? O : C)(S, T));
|
|
6532
6649
|
}
|
|
6533
|
-
function
|
|
6650
|
+
function g() {
|
|
6534
6651
|
return u.length > 0 && !u.some((S) => S === "object" || S === "array");
|
|
6535
6652
|
}
|
|
6536
6653
|
function O(S, T) {
|
|
6537
|
-
const y = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, y, l.opts.strictNumbers, dataType_1.DataType.Wrong),
|
|
6654
|
+
const y = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, y, l.opts.strictNumbers, dataType_1.DataType.Wrong), $ = t.const("indices", (0, codegen_1$d._)`{}`);
|
|
6538
6655
|
t.for((0, codegen_1$d._)`;${S}--;`, () => {
|
|
6539
|
-
t.let(y, (0, codegen_1$d._)`${r}[${S}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${y} == "string"`, (0, codegen_1$d._)`${y} += "_"`), t.if((0, codegen_1$d._)`typeof ${
|
|
6540
|
-
t.assign(T, (0, codegen_1$d._)`${
|
|
6541
|
-
}).code((0, codegen_1$d._)`${
|
|
6656
|
+
t.let(y, (0, codegen_1$d._)`${r}[${S}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${y} == "string"`, (0, codegen_1$d._)`${y} += "_"`), t.if((0, codegen_1$d._)`typeof ${$}[${y}] == "number"`, () => {
|
|
6657
|
+
t.assign(T, (0, codegen_1$d._)`${$}[${y}]`), e.error(), t.assign(d, !1).break();
|
|
6658
|
+
}).code((0, codegen_1$d._)`${$}[${y}] = ${S}`);
|
|
6542
6659
|
});
|
|
6543
6660
|
}
|
|
6544
6661
|
function C(S, T) {
|
|
@@ -6582,18 +6699,18 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
|
|
|
6582
6699
|
const l = s.length >= o.opts.loopEnum;
|
|
6583
6700
|
let d;
|
|
6584
6701
|
const u = () => d ?? (d = (0, util_1$e.useFunc)(t, equal_1.default));
|
|
6585
|
-
let
|
|
6702
|
+
let p;
|
|
6586
6703
|
if (l || n)
|
|
6587
|
-
|
|
6704
|
+
p = t.let("valid"), e.block$data(p, g);
|
|
6588
6705
|
else {
|
|
6589
6706
|
if (!Array.isArray(s))
|
|
6590
6707
|
throw new Error("ajv implementation error");
|
|
6591
6708
|
const C = t.const("vSchema", i);
|
|
6592
|
-
|
|
6709
|
+
p = (0, codegen_1$b.or)(...s.map((S, T) => O(C, T)));
|
|
6593
6710
|
}
|
|
6594
|
-
e.pass(
|
|
6595
|
-
function
|
|
6596
|
-
t.assign(
|
|
6711
|
+
e.pass(p);
|
|
6712
|
+
function g() {
|
|
6713
|
+
t.assign(p, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(p, !0).break()));
|
|
6597
6714
|
}
|
|
6598
6715
|
function O(C, S) {
|
|
6599
6716
|
const T = s[S];
|
|
@@ -6655,8 +6772,8 @@ function validateAdditionalItems(e, t) {
|
|
|
6655
6772
|
r.if((0, codegen_1$a.not)(u), () => d(u)), e.ok(u);
|
|
6656
6773
|
}
|
|
6657
6774
|
function d(u) {
|
|
6658
|
-
r.forRange("i", t.length, l, (
|
|
6659
|
-
e.subschema({ keyword: i, dataProp:
|
|
6775
|
+
r.forRange("i", t.length, l, (p) => {
|
|
6776
|
+
e.subschema({ keyword: i, dataProp: p, dataPropType: util_1$d.Type.Num }, u), o.allErrors || r.if((0, codegen_1$a.not)(u), () => r.break());
|
|
6660
6777
|
});
|
|
6661
6778
|
}
|
|
6662
6779
|
}
|
|
@@ -6679,17 +6796,17 @@ const codegen_1$9 = codegen, util_1$c = util, code_1$5 = code, def$f = {
|
|
|
6679
6796
|
};
|
|
6680
6797
|
function validateTuple(e, t, r = e.schema) {
|
|
6681
6798
|
const { gen: n, parentSchema: s, data: i, keyword: o, it: l } = e;
|
|
6682
|
-
|
|
6799
|
+
p(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = util_1$c.mergeEvaluated.items(n, r.length, l.items));
|
|
6683
6800
|
const d = n.name("valid"), u = n.const("len", (0, codegen_1$9._)`${i}.length`);
|
|
6684
|
-
r.forEach((
|
|
6685
|
-
(0, util_1$c.alwaysValidSchema)(l,
|
|
6801
|
+
r.forEach((g, O) => {
|
|
6802
|
+
(0, util_1$c.alwaysValidSchema)(l, g) || (n.if((0, codegen_1$9._)`${u} > ${O}`, () => e.subschema({
|
|
6686
6803
|
keyword: o,
|
|
6687
6804
|
schemaProp: O,
|
|
6688
6805
|
dataProp: O
|
|
6689
6806
|
}, d)), e.ok(d));
|
|
6690
6807
|
});
|
|
6691
|
-
function
|
|
6692
|
-
const { opts: O, errSchemaPath: C } = l, S = r.length, T = S ===
|
|
6808
|
+
function p(g) {
|
|
6809
|
+
const { opts: O, errSchemaPath: C } = l, S = r.length, T = S === g.minItems && (S === g.maxItems || g[t] === !1);
|
|
6693
6810
|
if (O.strictTuples && !T) {
|
|
6694
6811
|
const y = `"${o}" is ${S}-tuple, but minItems or maxItems/${t} are not specified or different at path "${C}"`;
|
|
6695
6812
|
(0, util_1$c.checkStrictMode)(l, y, O.strictTuples);
|
|
@@ -6741,7 +6858,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6741
6858
|
let o, l;
|
|
6742
6859
|
const { minContains: d, maxContains: u } = n;
|
|
6743
6860
|
i.opts.next ? (o = d === void 0 ? 1 : d, l = u) : o = 1;
|
|
6744
|
-
const
|
|
6861
|
+
const p = t.const("len", (0, codegen_1$7._)`${s}.length`);
|
|
6745
6862
|
if (e.setParams({ min: o, max: l }), l === void 0 && o === 0) {
|
|
6746
6863
|
(0, util_1$a.checkStrictMode)(i, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
|
|
6747
6864
|
return;
|
|
@@ -6751,19 +6868,19 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6751
6868
|
return;
|
|
6752
6869
|
}
|
|
6753
6870
|
if ((0, util_1$a.alwaysValidSchema)(i, r)) {
|
|
6754
|
-
let T = (0, codegen_1$7._)`${
|
|
6755
|
-
l !== void 0 && (T = (0, codegen_1$7._)`${T} && ${
|
|
6871
|
+
let T = (0, codegen_1$7._)`${p} >= ${o}`;
|
|
6872
|
+
l !== void 0 && (T = (0, codegen_1$7._)`${T} && ${p} <= ${l}`), e.pass(T);
|
|
6756
6873
|
return;
|
|
6757
6874
|
}
|
|
6758
6875
|
i.items = !0;
|
|
6759
|
-
const
|
|
6760
|
-
l === void 0 && o === 1 ? C(
|
|
6876
|
+
const g = t.name("valid");
|
|
6877
|
+
l === void 0 && o === 1 ? C(g, () => t.if(g, () => t.break())) : o === 0 ? (t.let(g, !0), l !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, O)) : (t.let(g, !1), O()), e.result(g, () => e.reset());
|
|
6761
6878
|
function O() {
|
|
6762
6879
|
const T = t.name("_valid"), y = t.let("count", 0);
|
|
6763
6880
|
C(T, () => t.if(T, () => S(y)));
|
|
6764
6881
|
}
|
|
6765
6882
|
function C(T, y) {
|
|
6766
|
-
t.forRange("i", 0,
|
|
6883
|
+
t.forRange("i", 0, p, (_) => {
|
|
6767
6884
|
e.subschema({
|
|
6768
6885
|
keyword: "contains",
|
|
6769
6886
|
dataProp: _,
|
|
@@ -6773,7 +6890,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6773
6890
|
});
|
|
6774
6891
|
}
|
|
6775
6892
|
function S(T) {
|
|
6776
|
-
t.code((0, codegen_1$7._)`${T}++`), l === void 0 ? t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(
|
|
6893
|
+
t.code((0, codegen_1$7._)`${T}++`), l === void 0 ? t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(g, !0).break()) : (t.if((0, codegen_1$7._)`${T} > ${l}`, () => t.assign(g, !1).break()), o === 1 ? t.assign(g, !0) : t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(g, !0)));
|
|
6777
6894
|
}
|
|
6778
6895
|
}
|
|
6779
6896
|
};
|
|
@@ -6783,14 +6900,14 @@ var dependencies = {};
|
|
|
6783
6900
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
|
|
6784
6901
|
const t = codegen, r = util, n = code;
|
|
6785
6902
|
e.error = {
|
|
6786
|
-
message: ({ params: { property: d, depsCount: u, deps:
|
|
6787
|
-
const
|
|
6788
|
-
return (0, t.str)`must have ${
|
|
6903
|
+
message: ({ params: { property: d, depsCount: u, deps: p } }) => {
|
|
6904
|
+
const g = u === 1 ? "property" : "properties";
|
|
6905
|
+
return (0, t.str)`must have ${g} ${p} when property ${d} is present`;
|
|
6789
6906
|
},
|
|
6790
|
-
params: ({ params: { property: d, depsCount: u, deps:
|
|
6791
|
-
missingProperty: ${
|
|
6907
|
+
params: ({ params: { property: d, depsCount: u, deps: p, missingProperty: g } }) => (0, t._)`{property: ${d},
|
|
6908
|
+
missingProperty: ${g},
|
|
6792
6909
|
depsCount: ${u},
|
|
6793
|
-
deps: ${
|
|
6910
|
+
deps: ${p}}`
|
|
6794
6911
|
// TODO change to reference
|
|
6795
6912
|
};
|
|
6796
6913
|
const s = {
|
|
@@ -6799,51 +6916,51 @@ var dependencies = {};
|
|
|
6799
6916
|
schemaType: "object",
|
|
6800
6917
|
error: e.error,
|
|
6801
6918
|
code(d) {
|
|
6802
|
-
const [u,
|
|
6803
|
-
o(d, u), l(d,
|
|
6919
|
+
const [u, p] = i(d);
|
|
6920
|
+
o(d, u), l(d, p);
|
|
6804
6921
|
}
|
|
6805
6922
|
};
|
|
6806
6923
|
function i({ schema: d }) {
|
|
6807
|
-
const u = {},
|
|
6808
|
-
for (const
|
|
6809
|
-
if (
|
|
6924
|
+
const u = {}, p = {};
|
|
6925
|
+
for (const g in d) {
|
|
6926
|
+
if (g === "__proto__")
|
|
6810
6927
|
continue;
|
|
6811
|
-
const O = Array.isArray(d[
|
|
6812
|
-
O[
|
|
6928
|
+
const O = Array.isArray(d[g]) ? u : p;
|
|
6929
|
+
O[g] = d[g];
|
|
6813
6930
|
}
|
|
6814
|
-
return [u,
|
|
6931
|
+
return [u, p];
|
|
6815
6932
|
}
|
|
6816
6933
|
function o(d, u = d.schema) {
|
|
6817
|
-
const { gen:
|
|
6934
|
+
const { gen: p, data: g, it: O } = d;
|
|
6818
6935
|
if (Object.keys(u).length === 0)
|
|
6819
6936
|
return;
|
|
6820
|
-
const C =
|
|
6937
|
+
const C = p.let("missing");
|
|
6821
6938
|
for (const S in u) {
|
|
6822
6939
|
const T = u[S];
|
|
6823
6940
|
if (T.length === 0)
|
|
6824
6941
|
continue;
|
|
6825
|
-
const y = (0, n.propertyInData)(
|
|
6942
|
+
const y = (0, n.propertyInData)(p, g, S, O.opts.ownProperties);
|
|
6826
6943
|
d.setParams({
|
|
6827
6944
|
property: S,
|
|
6828
6945
|
depsCount: T.length,
|
|
6829
6946
|
deps: T.join(", ")
|
|
6830
|
-
}), O.allErrors ?
|
|
6947
|
+
}), O.allErrors ? p.if(y, () => {
|
|
6831
6948
|
for (const _ of T)
|
|
6832
6949
|
(0, n.checkReportMissingProp)(d, _);
|
|
6833
|
-
}) : (
|
|
6950
|
+
}) : (p.if((0, t._)`${y} && (${(0, n.checkMissingProp)(d, T, C)})`), (0, n.reportMissingProp)(d, C), p.else());
|
|
6834
6951
|
}
|
|
6835
6952
|
}
|
|
6836
6953
|
e.validatePropertyDeps = o;
|
|
6837
6954
|
function l(d, u = d.schema) {
|
|
6838
|
-
const { gen:
|
|
6955
|
+
const { gen: p, data: g, keyword: O, it: C } = d, S = p.name("valid");
|
|
6839
6956
|
for (const T in u)
|
|
6840
|
-
(0, r.alwaysValidSchema)(C, u[T]) || (
|
|
6841
|
-
(0, n.propertyInData)(
|
|
6957
|
+
(0, r.alwaysValidSchema)(C, u[T]) || (p.if(
|
|
6958
|
+
(0, n.propertyInData)(p, g, T, C.opts.ownProperties),
|
|
6842
6959
|
() => {
|
|
6843
6960
|
const y = d.subschema({ keyword: O, schemaProp: T }, S);
|
|
6844
6961
|
d.mergeValidEvaluated(y, S);
|
|
6845
6962
|
},
|
|
6846
|
-
() =>
|
|
6963
|
+
() => p.var(S, !0)
|
|
6847
6964
|
// TODO var
|
|
6848
6965
|
), d.ok(S));
|
|
6849
6966
|
}
|
|
@@ -6897,21 +7014,21 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6897
7014
|
const { allErrors: l, opts: d } = o;
|
|
6898
7015
|
if (o.props = !0, d.removeAdditional !== "all" && (0, util_1$8.alwaysValidSchema)(o, r))
|
|
6899
7016
|
return;
|
|
6900
|
-
const u = (0, code_1$3.allSchemaProperties)(n.properties),
|
|
6901
|
-
|
|
6902
|
-
function
|
|
7017
|
+
const u = (0, code_1$3.allSchemaProperties)(n.properties), p = (0, code_1$3.allSchemaProperties)(n.patternProperties);
|
|
7018
|
+
g(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
|
|
7019
|
+
function g() {
|
|
6903
7020
|
t.forIn("key", s, (y) => {
|
|
6904
|
-
!u.length && !
|
|
7021
|
+
!u.length && !p.length ? S(y) : t.if(O(y), () => S(y));
|
|
6905
7022
|
});
|
|
6906
7023
|
}
|
|
6907
7024
|
function O(y) {
|
|
6908
7025
|
let _;
|
|
6909
7026
|
if (u.length > 8) {
|
|
6910
|
-
const
|
|
6911
|
-
_ = (0, code_1$3.isOwnProperty)(t,
|
|
7027
|
+
const $ = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
|
|
7028
|
+
_ = (0, code_1$3.isOwnProperty)(t, $, y);
|
|
6912
7029
|
} else
|
|
6913
|
-
u.length ? _ = (0, codegen_1$5.or)(...u.map((
|
|
6914
|
-
return
|
|
7030
|
+
u.length ? _ = (0, codegen_1$5.or)(...u.map(($) => (0, codegen_1$5._)`${y} === ${$}`)) : _ = codegen_1$5.nil;
|
|
7031
|
+
return p.length && (_ = (0, codegen_1$5.or)(_, ...p.map(($) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, $)}.test(${y})`))), (0, codegen_1$5.not)(_);
|
|
6915
7032
|
}
|
|
6916
7033
|
function C(y) {
|
|
6917
7034
|
t.code((0, codegen_1$5._)`delete ${s}[${y}]`);
|
|
@@ -6932,13 +7049,13 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6932
7049
|
})) : (T(y, _), l || t.if((0, codegen_1$5.not)(_), () => t.break()));
|
|
6933
7050
|
}
|
|
6934
7051
|
}
|
|
6935
|
-
function T(y, _,
|
|
7052
|
+
function T(y, _, $) {
|
|
6936
7053
|
const P = {
|
|
6937
7054
|
keyword: "additionalProperties",
|
|
6938
7055
|
dataProp: y,
|
|
6939
7056
|
dataPropType: util_1$8.Type.Str
|
|
6940
7057
|
};
|
|
6941
|
-
|
|
7058
|
+
$ === !1 && Object.assign(P, {
|
|
6942
7059
|
compositeRule: !0,
|
|
6943
7060
|
createErrors: !1,
|
|
6944
7061
|
allErrors: !1
|
|
@@ -6957,23 +7074,23 @@ const validate_1 = validate, code_1$2 = code, util_1$7 = util, additionalPropert
|
|
|
6957
7074
|
const { gen: t, schema: r, parentSchema: n, data: s, it: i } = e;
|
|
6958
7075
|
i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && additionalProperties_1$1.default.code(new validate_1.KeywordCxt(i, additionalProperties_1$1.default, "additionalProperties"));
|
|
6959
7076
|
const o = (0, code_1$2.allSchemaProperties)(r);
|
|
6960
|
-
for (const
|
|
6961
|
-
i.definedProperties.add(
|
|
7077
|
+
for (const g of o)
|
|
7078
|
+
i.definedProperties.add(g);
|
|
6962
7079
|
i.opts.unevaluated && o.length && i.props !== !0 && (i.props = util_1$7.mergeEvaluated.props(t, (0, util_1$7.toHash)(o), i.props));
|
|
6963
|
-
const l = o.filter((
|
|
7080
|
+
const l = o.filter((g) => !(0, util_1$7.alwaysValidSchema)(i, r[g]));
|
|
6964
7081
|
if (l.length === 0)
|
|
6965
7082
|
return;
|
|
6966
7083
|
const d = t.name("valid");
|
|
6967
|
-
for (const
|
|
6968
|
-
u(
|
|
6969
|
-
function u(
|
|
6970
|
-
return i.opts.useDefaults && !i.compositeRule && r[
|
|
7084
|
+
for (const g of l)
|
|
7085
|
+
u(g) ? p(g) : (t.if((0, code_1$2.propertyInData)(t, s, g, i.opts.ownProperties)), p(g), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(g), e.ok(d);
|
|
7086
|
+
function u(g) {
|
|
7087
|
+
return i.opts.useDefaults && !i.compositeRule && r[g].default !== void 0;
|
|
6971
7088
|
}
|
|
6972
|
-
function
|
|
7089
|
+
function p(g) {
|
|
6973
7090
|
e.subschema({
|
|
6974
7091
|
keyword: "properties",
|
|
6975
|
-
schemaProp:
|
|
6976
|
-
dataProp:
|
|
7092
|
+
schemaProp: g,
|
|
7093
|
+
dataProp: g
|
|
6977
7094
|
}, d);
|
|
6978
7095
|
}
|
|
6979
7096
|
}
|
|
@@ -6989,13 +7106,13 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
|
|
|
6989
7106
|
const { gen: t, schema: r, data: n, parentSchema: s, it: i } = e, { opts: o } = i, l = (0, code_1$1.allSchemaProperties)(r), d = l.filter((T) => (0, util_1$6.alwaysValidSchema)(i, r[T]));
|
|
6990
7107
|
if (l.length === 0 || d.length === l.length && (!i.opts.unevaluated || i.props === !0))
|
|
6991
7108
|
return;
|
|
6992
|
-
const u = o.strictSchema && !o.allowMatchingProperties && s.properties,
|
|
7109
|
+
const u = o.strictSchema && !o.allowMatchingProperties && s.properties, p = t.name("valid");
|
|
6993
7110
|
i.props !== !0 && !(i.props instanceof codegen_1$4.Name) && (i.props = (0, util_2.evaluatedPropsToName)(t, i.props));
|
|
6994
|
-
const { props:
|
|
7111
|
+
const { props: g } = i;
|
|
6995
7112
|
O();
|
|
6996
7113
|
function O() {
|
|
6997
7114
|
for (const T of l)
|
|
6998
|
-
u && C(T), i.allErrors ? S(T) : (t.var(
|
|
7115
|
+
u && C(T), i.allErrors ? S(T) : (t.var(p, !0), S(T), t.if(p));
|
|
6999
7116
|
}
|
|
7000
7117
|
function C(T) {
|
|
7001
7118
|
for (const y in u)
|
|
@@ -7010,7 +7127,7 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
|
|
|
7010
7127
|
schemaProp: T,
|
|
7011
7128
|
dataProp: y,
|
|
7012
7129
|
dataPropType: util_2.Type.Str
|
|
7013
|
-
},
|
|
7130
|
+
}, p), i.opts.unevaluated && g !== !0 ? t.assign((0, codegen_1$4._)`${g}[${y}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
|
|
7014
7131
|
});
|
|
7015
7132
|
});
|
|
7016
7133
|
}
|
|
@@ -7069,14 +7186,14 @@ const codegen_1$3 = codegen, util_1$4 = util, error$3 = {
|
|
|
7069
7186
|
const i = r, o = t.let("valid", !1), l = t.let("passing", null), d = t.name("_valid");
|
|
7070
7187
|
e.setParams({ passing: l }), t.block(u), e.result(o, () => e.reset(), () => e.error(!0));
|
|
7071
7188
|
function u() {
|
|
7072
|
-
i.forEach((
|
|
7189
|
+
i.forEach((p, g) => {
|
|
7073
7190
|
let O;
|
|
7074
|
-
(0, util_1$4.alwaysValidSchema)(s,
|
|
7191
|
+
(0, util_1$4.alwaysValidSchema)(s, p) ? t.var(d, !0) : O = e.subschema({
|
|
7075
7192
|
keyword: "oneOf",
|
|
7076
|
-
schemaProp:
|
|
7193
|
+
schemaProp: g,
|
|
7077
7194
|
compositeRule: !0
|
|
7078
|
-
}, d),
|
|
7079
|
-
t.assign(o, !0), t.assign(l,
|
|
7195
|
+
}, d), g > 0 && t.if((0, codegen_1$3._)`${d} && ${o}`).assign(o, !1).assign(l, (0, codegen_1$3._)`[${l}, ${g}]`).else(), t.if(d, () => {
|
|
7196
|
+
t.assign(o, !0), t.assign(l, g), O && e.mergeEvaluated(O, codegen_1$3.Name);
|
|
7080
7197
|
});
|
|
7081
7198
|
});
|
|
7082
7199
|
}
|
|
@@ -7120,24 +7237,24 @@ const codegen_1$2 = codegen, util_1$2 = util, error$2 = {
|
|
|
7120
7237
|
return;
|
|
7121
7238
|
const o = t.let("valid", !0), l = t.name("_valid");
|
|
7122
7239
|
if (d(), e.reset(), s && i) {
|
|
7123
|
-
const
|
|
7124
|
-
e.setParams({ ifClause:
|
|
7240
|
+
const p = t.let("ifClause");
|
|
7241
|
+
e.setParams({ ifClause: p }), t.if(l, u("then", p), u("else", p));
|
|
7125
7242
|
} else
|
|
7126
7243
|
s ? t.if(l, u("then")) : t.if((0, codegen_1$2.not)(l), u("else"));
|
|
7127
7244
|
e.pass(o, () => e.error(!0));
|
|
7128
7245
|
function d() {
|
|
7129
|
-
const
|
|
7246
|
+
const p = e.subschema({
|
|
7130
7247
|
keyword: "if",
|
|
7131
7248
|
compositeRule: !0,
|
|
7132
7249
|
createErrors: !1,
|
|
7133
7250
|
allErrors: !1
|
|
7134
7251
|
}, l);
|
|
7135
|
-
e.mergeEvaluated(
|
|
7252
|
+
e.mergeEvaluated(p);
|
|
7136
7253
|
}
|
|
7137
|
-
function u(
|
|
7254
|
+
function u(p, g) {
|
|
7138
7255
|
return () => {
|
|
7139
|
-
const O = e.subschema({ keyword:
|
|
7140
|
-
t.assign(o, l), e.mergeValidEvaluated(O, o),
|
|
7256
|
+
const O = e.subschema({ keyword: p }, l);
|
|
7257
|
+
t.assign(o, l), e.mergeValidEvaluated(O, o), g ? t.assign(g, (0, codegen_1$2._)`${p}`) : e.setParams({ ifClause: p });
|
|
7141
7258
|
};
|
|
7142
7259
|
}
|
|
7143
7260
|
}
|
|
@@ -7190,37 +7307,37 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7190
7307
|
$data: !0,
|
|
7191
7308
|
error: error$1,
|
|
7192
7309
|
code(e, t) {
|
|
7193
|
-
const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv:
|
|
7310
|
+
const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: g } = l;
|
|
7194
7311
|
if (!d.validateFormats)
|
|
7195
7312
|
return;
|
|
7196
7313
|
s ? O() : C();
|
|
7197
7314
|
function O() {
|
|
7198
7315
|
const S = r.scopeValue("formats", {
|
|
7199
|
-
ref:
|
|
7316
|
+
ref: g.formats,
|
|
7200
7317
|
code: d.code.formats
|
|
7201
7318
|
}), T = r.const("fDef", (0, codegen_1$1._)`${S}[${o}]`), y = r.let("fType"), _ = r.let("format");
|
|
7202
|
-
r.if((0, codegen_1$1._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${T}.type || "string"`).assign(_, (0, codegen_1$1._)`${T}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, T)), e.fail$data((0, codegen_1$1.or)(
|
|
7203
|
-
function
|
|
7319
|
+
r.if((0, codegen_1$1._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${T}.type || "string"`).assign(_, (0, codegen_1$1._)`${T}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, T)), e.fail$data((0, codegen_1$1.or)($(), P()));
|
|
7320
|
+
function $() {
|
|
7204
7321
|
return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${_}`;
|
|
7205
7322
|
}
|
|
7206
7323
|
function P() {
|
|
7207
|
-
const I =
|
|
7324
|
+
const I = p.$async ? (0, codegen_1$1._)`(${T}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, D = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
|
|
7208
7325
|
return (0, codegen_1$1._)`${_} && ${_} !== true && ${y} === ${t} && !${D}`;
|
|
7209
7326
|
}
|
|
7210
7327
|
}
|
|
7211
7328
|
function C() {
|
|
7212
|
-
const S =
|
|
7329
|
+
const S = g.formats[i];
|
|
7213
7330
|
if (!S) {
|
|
7214
|
-
|
|
7331
|
+
$();
|
|
7215
7332
|
return;
|
|
7216
7333
|
}
|
|
7217
7334
|
if (S === !0)
|
|
7218
7335
|
return;
|
|
7219
7336
|
const [T, y, _] = P(S);
|
|
7220
7337
|
T === t && e.pass(I());
|
|
7221
|
-
function
|
|
7338
|
+
function $() {
|
|
7222
7339
|
if (d.strictSchema === !1) {
|
|
7223
|
-
|
|
7340
|
+
g.logger.warn(D());
|
|
7224
7341
|
return;
|
|
7225
7342
|
}
|
|
7226
7343
|
throw new Error(D());
|
|
@@ -7234,7 +7351,7 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7234
7351
|
}
|
|
7235
7352
|
function I() {
|
|
7236
7353
|
if (typeof S == "object" && !(S instanceof RegExp) && S.async) {
|
|
7237
|
-
if (!
|
|
7354
|
+
if (!p.$async)
|
|
7238
7355
|
throw new Error("async format in sync schema");
|
|
7239
7356
|
return (0, codegen_1$1._)`await ${_}(${n})`;
|
|
7240
7357
|
}
|
|
@@ -7301,15 +7418,15 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7301
7418
|
if (!o)
|
|
7302
7419
|
throw new Error("discriminator: requires oneOf keyword");
|
|
7303
7420
|
const d = t.let("valid", !1), u = t.const("tag", (0, codegen_1._)`${r}${(0, codegen_1.getProperty)(l)}`);
|
|
7304
|
-
t.if((0, codegen_1._)`typeof ${u} == "string"`, () =>
|
|
7305
|
-
function
|
|
7421
|
+
t.if((0, codegen_1._)`typeof ${u} == "string"`, () => p(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: l })), e.ok(d);
|
|
7422
|
+
function p() {
|
|
7306
7423
|
const C = O();
|
|
7307
7424
|
t.if(!1);
|
|
7308
7425
|
for (const S in C)
|
|
7309
|
-
t.elseIf((0, codegen_1._)`${u} === ${S}`), t.assign(d,
|
|
7426
|
+
t.elseIf((0, codegen_1._)`${u} === ${S}`), t.assign(d, g(C[S]));
|
|
7310
7427
|
t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: l }), t.endIf();
|
|
7311
7428
|
}
|
|
7312
|
-
function
|
|
7429
|
+
function g(C) {
|
|
7313
7430
|
const S = t.name("valid"), T = e.subschema({ keyword: "oneOf", schemaProp: C }, S);
|
|
7314
7431
|
return e.mergeEvaluated(T, codegen_1.Name), S;
|
|
7315
7432
|
}
|
|
@@ -7323,7 +7440,7 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7323
7440
|
const w = (C = D == null ? void 0 : D.properties) === null || C === void 0 ? void 0 : C[l];
|
|
7324
7441
|
if (typeof w != "object")
|
|
7325
7442
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
|
|
7326
|
-
y = y && (T || _(D)),
|
|
7443
|
+
y = y && (T || _(D)), $(w, I);
|
|
7327
7444
|
}
|
|
7328
7445
|
if (!y)
|
|
7329
7446
|
throw new Error(`discriminator: "${l}" must be required`);
|
|
@@ -7331,7 +7448,7 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7331
7448
|
function _({ required: I }) {
|
|
7332
7449
|
return Array.isArray(I) && I.includes(l);
|
|
7333
7450
|
}
|
|
7334
|
-
function
|
|
7451
|
+
function $(I, D) {
|
|
7335
7452
|
if (I.const)
|
|
7336
7453
|
P(I.const, D);
|
|
7337
7454
|
else if (I.enum)
|
|
@@ -7612,23 +7729,23 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
|
|
|
7612
7729
|
Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
|
|
7613
7730
|
return u.KeywordCxt;
|
|
7614
7731
|
} });
|
|
7615
|
-
var
|
|
7732
|
+
var p = codegen;
|
|
7616
7733
|
Object.defineProperty(t, "_", { enumerable: !0, get: function() {
|
|
7617
|
-
return
|
|
7734
|
+
return p._;
|
|
7618
7735
|
} }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
|
|
7619
|
-
return
|
|
7736
|
+
return p.str;
|
|
7620
7737
|
} }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
|
|
7621
|
-
return
|
|
7738
|
+
return p.stringify;
|
|
7622
7739
|
} }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
|
|
7623
|
-
return
|
|
7740
|
+
return p.nil;
|
|
7624
7741
|
} }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
|
|
7625
|
-
return
|
|
7742
|
+
return p.Name;
|
|
7626
7743
|
} }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
|
|
7627
|
-
return
|
|
7744
|
+
return p.CodeGen;
|
|
7628
7745
|
} });
|
|
7629
|
-
var
|
|
7746
|
+
var g = validation_error;
|
|
7630
7747
|
Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
|
|
7631
|
-
return
|
|
7748
|
+
return g.default;
|
|
7632
7749
|
} });
|
|
7633
7750
|
var O = ref_error;
|
|
7634
7751
|
Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
|
|
@@ -9234,13 +9351,13 @@ function compileBlueprint(e, {
|
|
|
9234
9351
|
onStepCompleted: n = () => {
|
|
9235
9352
|
}
|
|
9236
9353
|
} = {}) {
|
|
9237
|
-
var
|
|
9354
|
+
var g, O, C, S, T, y, _;
|
|
9238
9355
|
e = {
|
|
9239
9356
|
...e,
|
|
9240
|
-
steps: (e.steps || []).filter(isStepDefinition)
|
|
9357
|
+
steps: (e.steps || []).filter(isStepDefinition).filter(isStepStillSupported)
|
|
9241
9358
|
};
|
|
9242
|
-
for (const
|
|
9243
|
-
typeof
|
|
9359
|
+
for (const $ of e.steps)
|
|
9360
|
+
typeof $ == "object" && $.step === "importFile" && ($.step = "importWxr", console.warn(
|
|
9244
9361
|
'The "importFile" step is deprecated. Use "importWxr" instead.'
|
|
9245
9362
|
));
|
|
9246
9363
|
if (e.constants && e.steps.unshift({
|
|
@@ -9250,7 +9367,7 @@ function compileBlueprint(e, {
|
|
|
9250
9367
|
step: "setSiteOptions",
|
|
9251
9368
|
options: e.siteOptions
|
|
9252
9369
|
}), e.plugins) {
|
|
9253
|
-
const
|
|
9370
|
+
const $ = e.plugins.map((P) => typeof P == "string" ? P.startsWith("https://") ? {
|
|
9254
9371
|
resource: "url",
|
|
9255
9372
|
url: P
|
|
9256
9373
|
} : {
|
|
@@ -9260,17 +9377,17 @@ function compileBlueprint(e, {
|
|
|
9260
9377
|
step: "installPlugin",
|
|
9261
9378
|
pluginZipFile: P
|
|
9262
9379
|
}));
|
|
9263
|
-
e.steps.unshift(
|
|
9380
|
+
e.steps.unshift(...$);
|
|
9264
9381
|
}
|
|
9265
9382
|
e.login && e.steps.push({
|
|
9266
9383
|
step: "login",
|
|
9267
9384
|
...e.login === !0 ? { username: "admin", password: "password" } : e.login
|
|
9268
9385
|
}), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles.length === 0 && e.phpExtensionBundles.push("kitchen-sink");
|
|
9269
|
-
const s = (
|
|
9270
|
-
(
|
|
9386
|
+
const s = (g = e.steps) == null ? void 0 : g.findIndex(
|
|
9387
|
+
($) => typeof $ == "object" && ($ == null ? void 0 : $.step) === "wp-cli"
|
|
9271
9388
|
);
|
|
9272
9389
|
s !== void 0 && s > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
|
|
9273
|
-
(
|
|
9390
|
+
($) => $ !== "light"
|
|
9274
9391
|
), console.warn(
|
|
9275
9392
|
"The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
|
|
9276
9393
|
)), (O = e.steps) == null || O.splice(s, 0, {
|
|
@@ -9292,10 +9409,10 @@ function compileBlueprint(e, {
|
|
|
9292
9409
|
path: "/tmp/wp-cli.phar"
|
|
9293
9410
|
}));
|
|
9294
9411
|
const i = (C = e.steps) == null ? void 0 : C.findIndex(
|
|
9295
|
-
(
|
|
9412
|
+
($) => typeof $ == "object" && ($ == null ? void 0 : $.step) === "importWxr"
|
|
9296
9413
|
);
|
|
9297
9414
|
i !== void 0 && i > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
|
|
9298
|
-
(
|
|
9415
|
+
($) => $ !== "light"
|
|
9299
9416
|
), console.warn(
|
|
9300
9417
|
"The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
|
|
9301
9418
|
)), (S = e.steps) == null || S.splice(i, 0, {
|
|
@@ -9308,19 +9425,19 @@ function compileBlueprint(e, {
|
|
|
9308
9425
|
}));
|
|
9309
9426
|
const { valid: o, errors: l } = validateBlueprint(e);
|
|
9310
9427
|
if (!o) {
|
|
9311
|
-
const
|
|
9428
|
+
const $ = new Error(
|
|
9312
9429
|
`Invalid blueprint: ${l[0].message} at ${l[0].instancePath}`
|
|
9313
9430
|
);
|
|
9314
|
-
throw
|
|
9431
|
+
throw $.errors = l, $;
|
|
9315
9432
|
}
|
|
9316
9433
|
const d = e.steps || [], u = d.reduce(
|
|
9317
|
-
(
|
|
9434
|
+
($, P) => {
|
|
9318
9435
|
var I;
|
|
9319
|
-
return
|
|
9436
|
+
return $ + (((I = P.progress) == null ? void 0 : I.weight) || 1);
|
|
9320
9437
|
},
|
|
9321
9438
|
0
|
|
9322
|
-
),
|
|
9323
|
-
(
|
|
9439
|
+
), p = d.map(
|
|
9440
|
+
($) => compileStep($, {
|
|
9324
9441
|
semaphore: r,
|
|
9325
9442
|
rootProgressTracker: t,
|
|
9326
9443
|
totalProgressWeight: u
|
|
@@ -9343,14 +9460,14 @@ function compileBlueprint(e, {
|
|
|
9343
9460
|
// Disable networking by default
|
|
9344
9461
|
networking: ((_ = e.features) == null ? void 0 : _.networking) ?? !1
|
|
9345
9462
|
},
|
|
9346
|
-
run: async (
|
|
9463
|
+
run: async ($) => {
|
|
9347
9464
|
try {
|
|
9348
|
-
for (const { resources: P } of
|
|
9465
|
+
for (const { resources: P } of p)
|
|
9349
9466
|
for (const I of P)
|
|
9350
|
-
I.setPlayground(
|
|
9351
|
-
for (const [P, { run: I, step: D }] of Object.entries(
|
|
9467
|
+
I.setPlayground($), I.isAsync && I.resolve();
|
|
9468
|
+
for (const [P, { run: I, step: D }] of Object.entries(p))
|
|
9352
9469
|
try {
|
|
9353
|
-
const w = await I(
|
|
9470
|
+
const w = await I($);
|
|
9354
9471
|
n(w, D);
|
|
9355
9472
|
} catch (w) {
|
|
9356
9473
|
throw console.error(w), new Error(
|
|
@@ -9362,7 +9479,7 @@ function compileBlueprint(e, {
|
|
|
9362
9479
|
}
|
|
9363
9480
|
} finally {
|
|
9364
9481
|
try {
|
|
9365
|
-
await
|
|
9482
|
+
await $.goTo(
|
|
9366
9483
|
e.landingPage || "/"
|
|
9367
9484
|
);
|
|
9368
9485
|
} catch {
|
|
@@ -9405,26 +9522,31 @@ function compilePHPExtensions(e, t) {
|
|
|
9405
9522
|
function isStepDefinition(e) {
|
|
9406
9523
|
return !!(typeof e == "object" && e);
|
|
9407
9524
|
}
|
|
9525
|
+
function isStepStillSupported(e) {
|
|
9526
|
+
return e.step === "setPhpIniEntry" ? (console.warn(
|
|
9527
|
+
'The "setPhpIniEntry" Blueprint is no longer supported and you can remove it from your Blueprint.'
|
|
9528
|
+
), !1) : !0;
|
|
9529
|
+
}
|
|
9408
9530
|
function compileStep(e, {
|
|
9409
9531
|
semaphore: t,
|
|
9410
9532
|
rootProgressTracker: r,
|
|
9411
9533
|
totalProgressWeight: n
|
|
9412
9534
|
}) {
|
|
9413
|
-
var
|
|
9535
|
+
var p;
|
|
9414
9536
|
const s = r.stage(
|
|
9415
|
-
(((
|
|
9537
|
+
(((p = e.progress) == null ? void 0 : p.weight) || 1) / n
|
|
9416
9538
|
), i = {};
|
|
9417
|
-
for (const
|
|
9418
|
-
let O = e[
|
|
9539
|
+
for (const g of Object.keys(e)) {
|
|
9540
|
+
let O = e[g];
|
|
9419
9541
|
isFileReference(O) && (O = Resource.create(O, {
|
|
9420
9542
|
semaphore: t
|
|
9421
|
-
})), i[
|
|
9543
|
+
})), i[g] = O;
|
|
9422
9544
|
}
|
|
9423
|
-
const o = async (
|
|
9545
|
+
const o = async (g) => {
|
|
9424
9546
|
var O;
|
|
9425
9547
|
try {
|
|
9426
9548
|
return s.fillSlowly(), await keyedStepHandlers[e.step](
|
|
9427
|
-
|
|
9549
|
+
g,
|
|
9428
9550
|
await resolveArguments(i),
|
|
9429
9551
|
{
|
|
9430
9552
|
tracker: s,
|
|
@@ -9435,10 +9557,10 @@ function compileStep(e, {
|
|
|
9435
9557
|
s.finish();
|
|
9436
9558
|
}
|
|
9437
9559
|
}, l = getResources(i), d = getResources(i).filter(
|
|
9438
|
-
(
|
|
9560
|
+
(g) => g.isAsync
|
|
9439
9561
|
), u = 1 / (d.length + 1);
|
|
9440
|
-
for (const
|
|
9441
|
-
|
|
9562
|
+
for (const g of d)
|
|
9563
|
+
g.progress = s.stage(u);
|
|
9442
9564
|
return { run: o, step: e, resources: l };
|
|
9443
9565
|
}
|
|
9444
9566
|
function getResources(e) {
|
|
@@ -9486,7 +9608,6 @@ export {
|
|
|
9486
9608
|
runPHPWithOptions,
|
|
9487
9609
|
runSql,
|
|
9488
9610
|
runWpInstallationWizard,
|
|
9489
|
-
setPhpIniEntry,
|
|
9490
9611
|
setPluginProxyURL,
|
|
9491
9612
|
setSiteOptions,
|
|
9492
9613
|
unzip,
|