@wp-playground/blueprints 0.3.0 → 0.3.1
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 +25 -25
- package/index.d.ts +5 -1
- package/index.js +767 -771
- package/lib/resources.d.ts +0 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ps = async (t, { pluginPath: e, pluginName: r }, n) => {
|
|
2
2
|
n?.tracker.setCaption(`Activating ${r || e}`);
|
|
3
3
|
const s = [
|
|
4
4
|
`${await t.documentRoot}/wp-load.php`,
|
|
@@ -32,7 +32,7 @@ echo 'NO_ENTRY_FILE';
|
|
|
32
32
|
`
|
|
33
33
|
})).text.endsWith("NO_ENTRY_FILE"))
|
|
34
34
|
throw new Error("Could not find plugin entry file.");
|
|
35
|
-
},
|
|
35
|
+
}, Es = async (t, { themeFolderName: e }, r) => {
|
|
36
36
|
r?.tracker.setCaption(`Activating ${e}`);
|
|
37
37
|
const n = `${await t.documentRoot}/wp-load.php`;
|
|
38
38
|
if (!t.fileExists(n))
|
|
@@ -55,10 +55,10 @@ async function at(t, e, r) {
|
|
|
55
55
|
let n = "";
|
|
56
56
|
await t.fileExists(e) && (n = await t.readFileAsText(e)), await t.writeFile(e, r(n));
|
|
57
57
|
}
|
|
58
|
-
async function
|
|
58
|
+
async function Oi(t) {
|
|
59
59
|
return new Uint8Array(await t.arrayBuffer());
|
|
60
60
|
}
|
|
61
|
-
class
|
|
61
|
+
class Ni extends File {
|
|
62
62
|
constructor(e, r) {
|
|
63
63
|
super(e, r), this.buffers = e;
|
|
64
64
|
}
|
|
@@ -66,9 +66,9 @@ class Ci extends File {
|
|
|
66
66
|
return this.buffers[0];
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const Hr = File.prototype.arrayBuffer instanceof Function ? File :
|
|
70
|
-
const n = await t.documentRoot, s = r ?
|
|
71
|
-
return r && (t.mkdir(
|
|
69
|
+
const Hr = File.prototype.arrayBuffer instanceof Function ? File : Ni, Wn = "/vfs-blueprints", Wt = async (t, { consts: e, virtualize: r = !1 }) => {
|
|
70
|
+
const n = await t.documentRoot, s = r ? Wn : n, i = `${s}/playground-consts.json`, c = `${s}/wp-config.php`;
|
|
71
|
+
return r && (t.mkdir(Wn), t.setPhpIniEntry("auto_prepend_file", c)), await at(
|
|
72
72
|
t,
|
|
73
73
|
i,
|
|
74
74
|
(l) => JSON.stringify({
|
|
@@ -83,7 +83,7 @@ const Hr = File.prototype.arrayBuffer instanceof Function ? File : Ci, Kn = "/vf
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
?>${l}`), c;
|
|
86
|
-
},
|
|
86
|
+
}, Ci = `<?php
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* This transport delegates PHP HTTP requests to JavaScript synchronous XHR.
|
|
@@ -228,7 +228,7 @@ JAVASCRIPT;
|
|
|
228
228
|
return true;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
`,
|
|
231
|
+
`, ji = `<?php
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* This transport does not perform any HTTP requests and only exists
|
|
@@ -271,7 +271,7 @@ class Requests_Transport_Dummy implements Requests_Transport
|
|
|
271
271
|
return true;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`, ki = `<?php
|
|
275
275
|
/**
|
|
276
276
|
* The default WordPress requests transports have been disabled
|
|
277
277
|
* at this point. However, the Requests class requires at least
|
|
@@ -295,7 +295,7 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
|
|
|
295
295
|
require(__DIR__ . '/includes/requests_transport_dummy.php');
|
|
296
296
|
Requests::add_transport('Requests_Transport_Dummy');
|
|
297
297
|
}
|
|
298
|
-
`,
|
|
298
|
+
`, Ii = `<?php
|
|
299
299
|
/**
|
|
300
300
|
* Add a notice to wp-login.php offering the username and password.
|
|
301
301
|
*/
|
|
@@ -310,7 +310,7 @@ add_action(
|
|
|
310
310
|
EOT;
|
|
311
311
|
}
|
|
312
312
|
);
|
|
313
|
-
`,
|
|
313
|
+
`, Ai = `<?php
|
|
314
314
|
/**
|
|
315
315
|
* Because the in-browser Playground doesn't have access to the internet,
|
|
316
316
|
* network-dependent features like directories don't work. Normally, you'll
|
|
@@ -345,7 +345,7 @@ add_filter( 'gettext', function( $translation ) {
|
|
|
345
345
|
}
|
|
346
346
|
return $translation;
|
|
347
347
|
} );
|
|
348
|
-
`,
|
|
348
|
+
`, Di = `<?php
|
|
349
349
|
/**
|
|
350
350
|
* Links with target="top" don't work in the playground iframe because of
|
|
351
351
|
* the sandbox attribute. What they really should be targeting is the
|
|
@@ -366,18 +366,18 @@ add_action('admin_print_scripts', function () {
|
|
|
366
366
|
<\/script>
|
|
367
367
|
<?php
|
|
368
368
|
});
|
|
369
|
-
`,
|
|
370
|
-
const r = new
|
|
369
|
+
`, qi = async (t, e) => {
|
|
370
|
+
const r = new Fi(
|
|
371
371
|
t,
|
|
372
372
|
e.wordpressPath || "/wordpress",
|
|
373
373
|
e.siteUrl
|
|
374
374
|
);
|
|
375
|
-
e.addPhpInfo === !0 && await r.addPhpInfo(), e.siteUrl && await r.patchSiteUrl(), e.patchSecrets === !0 && await r.patchSecrets(), e.disableSiteHealth === !0 && await r.disableSiteHealth(), e.disableWpNewBlogNotification === !0 && await r.disableWpNewBlogNotification(), e.makeEditorFrameControlled === !0 && await
|
|
375
|
+
e.addPhpInfo === !0 && await r.addPhpInfo(), e.siteUrl && await r.patchSiteUrl(), e.patchSecrets === !0 && await r.patchSecrets(), e.disableSiteHealth === !0 && await r.disableSiteHealth(), e.disableWpNewBlogNotification === !0 && await r.disableWpNewBlogNotification(), e.makeEditorFrameControlled === !0 && await Ss(t, r.wordpressPath, [
|
|
376
376
|
`${r.wordpressPath}/wp-includes/js/dist/block-editor.js`,
|
|
377
377
|
`${r.wordpressPath}/wp-includes/js/dist/block-editor.min.js`
|
|
378
378
|
]), e.prepareForRunningInsideWebBrowser === !0 && await r.prepareForRunningInsideWebBrowser();
|
|
379
379
|
};
|
|
380
|
-
class
|
|
380
|
+
class Fi {
|
|
381
381
|
constructor(e, r, n) {
|
|
382
382
|
this.php = e, this.scopedSiteUrl = n, this.wordpressPath = r;
|
|
383
383
|
}
|
|
@@ -458,22 +458,22 @@ class Mi {
|
|
|
458
458
|
`${this.wordpressPath}/wp-content/mu-plugins/includes`
|
|
459
459
|
), await this.php.writeFile(
|
|
460
460
|
`${this.wordpressPath}/wp-content/mu-plugins/includes/requests_transport_fetch.php`,
|
|
461
|
-
|
|
461
|
+
Ci
|
|
462
462
|
), await this.php.writeFile(
|
|
463
463
|
`${this.wordpressPath}/wp-content/mu-plugins/includes/requests_transport_dummy.php`,
|
|
464
|
-
|
|
464
|
+
ji
|
|
465
465
|
), await this.php.writeFile(
|
|
466
466
|
`${this.wordpressPath}/wp-content/mu-plugins/add_requests_transport.php`,
|
|
467
|
-
|
|
467
|
+
ki
|
|
468
468
|
), await this.php.writeFile(
|
|
469
469
|
`${this.wordpressPath}/wp-content/mu-plugins/1-show-admin-credentials-on-wp-login.php`,
|
|
470
|
-
|
|
470
|
+
Ii
|
|
471
471
|
), await this.php.writeFile(
|
|
472
472
|
`${this.wordpressPath}/wp-content/mu-plugins/2-nice-error-messages-for-plugins-and-themes-directories.php`,
|
|
473
|
-
|
|
473
|
+
Ai
|
|
474
474
|
), await this.php.writeFile(
|
|
475
475
|
`${this.wordpressPath}/wp-content/mu-plugins/3-links-targeting-top-frame-should-target-playground-iframe.php`,
|
|
476
|
-
|
|
476
|
+
Di
|
|
477
477
|
);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
@@ -484,7 +484,7 @@ function Be(t) {
|
|
|
484
484
|
r += e[Math.floor(Math.random() * e.length)];
|
|
485
485
|
return r;
|
|
486
486
|
}
|
|
487
|
-
async function
|
|
487
|
+
async function Ss(t, e, r) {
|
|
488
488
|
const n = `
|
|
489
489
|
/**
|
|
490
490
|
* A synchronous function to read a blob URL as text.
|
|
@@ -545,30 +545,30 @@ async function Ts(t, e, r) {
|
|
|
545
545
|
"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>"
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
|
-
const
|
|
548
|
+
const Mi = async (t, { code: e }) => await t.run({ code: e }), Ui = async (t, { options: e }) => await t.run(e), Li = async (t, { key: e, value: r }) => {
|
|
549
549
|
await t.setPhpIniEntry(e, r);
|
|
550
|
-
},
|
|
550
|
+
}, Hi = async (t, { request: e }) => await t.request(e), Vi = async (t, { fromPath: e, toPath: r }) => {
|
|
551
551
|
await t.writeFile(
|
|
552
552
|
r,
|
|
553
553
|
await t.readFileAsBuffer(e)
|
|
554
554
|
);
|
|
555
|
-
},
|
|
555
|
+
}, zi = async (t, { fromPath: e, toPath: r }) => {
|
|
556
556
|
await t.mv(e, r);
|
|
557
|
-
},
|
|
557
|
+
}, Wi = async (t, { path: e }) => {
|
|
558
558
|
await t.unlink(e);
|
|
559
|
-
},
|
|
559
|
+
}, Ki = async (t, { path: e }) => {
|
|
560
560
|
await t.mkdir(e);
|
|
561
|
-
},
|
|
561
|
+
}, Bi = async (t, { path: e }) => {
|
|
562
562
|
await t.rmdir(e);
|
|
563
|
-
},
|
|
564
|
-
r instanceof File && (r = await
|
|
565
|
-
},
|
|
563
|
+
}, Ts = async (t, { path: e, data: r }) => {
|
|
564
|
+
r instanceof File && (r = await Oi(r)), await t.writeFile(e, r);
|
|
565
|
+
}, Gi = async (t, { siteUrl: e }) => await Wt(t, {
|
|
566
566
|
consts: {
|
|
567
567
|
WP_HOME: e,
|
|
568
568
|
WP_SITEURL: e
|
|
569
569
|
}
|
|
570
570
|
});
|
|
571
|
-
class
|
|
571
|
+
class Rs {
|
|
572
572
|
constructor({ concurrency: e }) {
|
|
573
573
|
this._running = 0, this.concurrency = e, this.queue = [];
|
|
574
574
|
}
|
|
@@ -596,7 +596,7 @@ class Os {
|
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
const
|
|
599
|
+
const xi = Symbol("literal");
|
|
600
600
|
function Tt(t) {
|
|
601
601
|
if (typeof t == "string")
|
|
602
602
|
return t.startsWith("$") ? t : JSON.stringify(t);
|
|
@@ -607,7 +607,7 @@ function Tt(t) {
|
|
|
607
607
|
if (t === null)
|
|
608
608
|
return "null";
|
|
609
609
|
if (typeof t == "object")
|
|
610
|
-
return
|
|
610
|
+
return xi in t ? t.toString() : `array(${Object.entries(t).map(([r, n]) => `${JSON.stringify(r)} => ${Tt(n)}`).join(", ")})`;
|
|
611
611
|
if (typeof t == "function")
|
|
612
612
|
return t();
|
|
613
613
|
throw new Error(`Unsupported value: ${t}`);
|
|
@@ -618,7 +618,7 @@ function Vr(t) {
|
|
|
618
618
|
e[r] = Tt(t[r]);
|
|
619
619
|
return e;
|
|
620
620
|
}
|
|
621
|
-
const
|
|
621
|
+
const Kn = `<?php
|
|
622
622
|
|
|
623
623
|
function zipDir($dir, $output, $additionalFiles = array())
|
|
624
624
|
{
|
|
@@ -681,19 +681,19 @@ function delTree($dir)
|
|
|
681
681
|
return rmdir($dir);
|
|
682
682
|
}
|
|
683
683
|
`;
|
|
684
|
-
async function
|
|
684
|
+
async function Ji(t) {
|
|
685
685
|
const e = "wordpress-playground.zip", r = `/tmp/${e}`, n = Vr({
|
|
686
686
|
zipPath: r,
|
|
687
687
|
documentRoot: await t.documentRoot
|
|
688
688
|
});
|
|
689
|
-
await
|
|
689
|
+
await Os(
|
|
690
690
|
t,
|
|
691
691
|
`zipDir(${n.documentRoot}, ${n.zipPath});`
|
|
692
692
|
);
|
|
693
693
|
const s = await t.readFileAsBuffer(r);
|
|
694
694
|
return t.unlink(r), new File([s], e);
|
|
695
695
|
}
|
|
696
|
-
const
|
|
696
|
+
const Yi = async (t, { fullSiteZip: e }) => {
|
|
697
697
|
const r = "/import.zip";
|
|
698
698
|
await t.writeFile(
|
|
699
699
|
r,
|
|
@@ -702,7 +702,7 @@ const Zi = async (t, { fullSiteZip: e }) => {
|
|
|
702
702
|
const n = await t.absoluteUrl, s = await t.documentRoot;
|
|
703
703
|
await t.rmdir(s), await zr(t, { zipPath: r, extractToPath: "/" });
|
|
704
704
|
const i = Vr({ absoluteUrl: n });
|
|
705
|
-
await
|
|
705
|
+
await Xi(
|
|
706
706
|
t,
|
|
707
707
|
`${s}/wp-config.php`,
|
|
708
708
|
(c) => `<?php
|
|
@@ -717,25 +717,25 @@ const Zi = async (t, { fullSiteZip: e }) => {
|
|
|
717
717
|
zipPath: e,
|
|
718
718
|
extractToPath: r
|
|
719
719
|
});
|
|
720
|
-
await
|
|
720
|
+
await Os(
|
|
721
721
|
t,
|
|
722
722
|
`unzip(${n.zipPath}, ${n.extractToPath});`
|
|
723
723
|
);
|
|
724
|
-
},
|
|
724
|
+
}, Zi = async (t, { file: e }) => {
|
|
725
725
|
const r = await t.request({
|
|
726
726
|
url: "/wp-admin/admin.php?import=wordpress"
|
|
727
|
-
}), n =
|
|
727
|
+
}), n = Bn(r).getElementById("import-upload-form")?.getAttribute("action"), s = await t.request({
|
|
728
728
|
url: `/wp-admin/${n}`,
|
|
729
729
|
method: "POST",
|
|
730
730
|
files: { import: e }
|
|
731
|
-
}), i =
|
|
731
|
+
}), i = Bn(s).querySelector(
|
|
732
732
|
"#wpbody-content form"
|
|
733
733
|
);
|
|
734
734
|
if (!i)
|
|
735
735
|
throw console.log(s.text), new Error(
|
|
736
736
|
"Could not find an importer form in response. See the response text above for details."
|
|
737
737
|
);
|
|
738
|
-
const c =
|
|
738
|
+
const c = Qi(i);
|
|
739
739
|
c.fetch_attachments = "1";
|
|
740
740
|
for (const l in c)
|
|
741
741
|
if (l.startsWith("user_map[")) {
|
|
@@ -748,31 +748,31 @@ const Zi = async (t, { fullSiteZip: e }) => {
|
|
|
748
748
|
formData: c
|
|
749
749
|
});
|
|
750
750
|
};
|
|
751
|
-
function
|
|
751
|
+
function Bn(t) {
|
|
752
752
|
return new DOMParser().parseFromString(t.text, "text/html");
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function Qi(t) {
|
|
755
755
|
return Object.fromEntries(new FormData(t).entries());
|
|
756
756
|
}
|
|
757
|
-
async function
|
|
757
|
+
async function Xi(t, e, r) {
|
|
758
758
|
await t.writeFile(
|
|
759
759
|
e,
|
|
760
760
|
r(await t.readFileAsText(e))
|
|
761
761
|
);
|
|
762
762
|
}
|
|
763
|
-
async function
|
|
763
|
+
async function Os(t, e) {
|
|
764
764
|
const r = await t.run({
|
|
765
|
-
code:
|
|
765
|
+
code: Kn + e
|
|
766
766
|
});
|
|
767
767
|
if (r.exitCode !== 0)
|
|
768
|
-
throw console.log(
|
|
768
|
+
throw console.log(Kn + e), console.log(e + ""), console.log(r.errors), r.errors;
|
|
769
769
|
return r;
|
|
770
770
|
}
|
|
771
|
-
async function
|
|
771
|
+
async function Ns(t, { targetPath: e, zipFile: r }) {
|
|
772
772
|
const n = r.name, s = n.replace(/\.zip$/, ""), i = `/tmp/assets/${s}`, c = `/tmp/${n}`, l = () => t.rmdir(i, {
|
|
773
773
|
recursive: !0
|
|
774
774
|
});
|
|
775
|
-
await t.fileExists(i) && await l(), await
|
|
775
|
+
await t.fileExists(i) && await l(), await Ts(t, {
|
|
776
776
|
path: c,
|
|
777
777
|
data: r
|
|
778
778
|
});
|
|
@@ -796,43 +796,43 @@ async function Cs(t, { targetPath: e, zipFile: r }) {
|
|
|
796
796
|
throw await m(), u;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
const
|
|
799
|
+
const eo = async (t, { pluginZipFile: e, options: r = {} }, n) => {
|
|
800
800
|
const s = e.name.split("/").pop() || "plugin.zip", i = wr(s);
|
|
801
801
|
n?.tracker.setCaption(`Installing the ${i} plugin`);
|
|
802
802
|
try {
|
|
803
|
-
const { assetFolderPath: c } = await
|
|
803
|
+
const { assetFolderPath: c } = await Ns(t, {
|
|
804
804
|
zipFile: e,
|
|
805
805
|
targetPath: `${await t.documentRoot}/wp-content/plugins`
|
|
806
806
|
});
|
|
807
|
-
("activate" in r ? r.activate : !0) && await
|
|
807
|
+
("activate" in r ? r.activate : !0) && await Ps(
|
|
808
808
|
t,
|
|
809
809
|
{
|
|
810
810
|
pluginPath: c,
|
|
811
811
|
pluginName: i
|
|
812
812
|
},
|
|
813
813
|
n
|
|
814
|
-
), await
|
|
814
|
+
), await to(t);
|
|
815
815
|
} catch (c) {
|
|
816
816
|
console.error(
|
|
817
817
|
`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${c}`
|
|
818
818
|
), console.error(c);
|
|
819
819
|
}
|
|
820
820
|
};
|
|
821
|
-
async function
|
|
822
|
-
await t.isDir("/wordpress/wp-content/plugins/gutenberg") && !await t.fileExists("/wordpress/.gutenberg-patched") && (await t.writeFile("/wordpress/.gutenberg-patched", "1"), await
|
|
821
|
+
async function to(t) {
|
|
822
|
+
await t.isDir("/wordpress/wp-content/plugins/gutenberg") && !await t.fileExists("/wordpress/.gutenberg-patched") && (await t.writeFile("/wordpress/.gutenberg-patched", "1"), await Ss(t, "/wordpress", [
|
|
823
823
|
"/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js",
|
|
824
824
|
"/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js"
|
|
825
825
|
]));
|
|
826
826
|
}
|
|
827
|
-
const
|
|
827
|
+
const ro = async (t, { themeZipFile: e, options: r = {} }, n) => {
|
|
828
828
|
const s = wr(e.name);
|
|
829
829
|
n?.tracker.setCaption(`Installing the ${s} theme`);
|
|
830
830
|
try {
|
|
831
|
-
const { assetFolderName: i } = await
|
|
831
|
+
const { assetFolderName: i } = await Ns(t, {
|
|
832
832
|
zipFile: e,
|
|
833
833
|
targetPath: `${await t.documentRoot}/wp-content/themes`
|
|
834
834
|
});
|
|
835
|
-
("activate" in r ? r.activate : !0) && await
|
|
835
|
+
("activate" in r ? r.activate : !0) && await Es(
|
|
836
836
|
t,
|
|
837
837
|
{
|
|
838
838
|
themeFolderName: i
|
|
@@ -844,7 +844,7 @@ const no = async (t, { themeZipFile: e, options: r = {} }, n) => {
|
|
|
844
844
|
`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`
|
|
845
845
|
), console.error(i);
|
|
846
846
|
}
|
|
847
|
-
},
|
|
847
|
+
}, no = async (t, { username: e = "admin", password: r = "password" } = {}, n) => {
|
|
848
848
|
n?.tracker.setCaption(n?.initialCaption || "Logging in"), await t.request({
|
|
849
849
|
url: "/wp-login.php"
|
|
850
850
|
}), await t.request({
|
|
@@ -856,7 +856,7 @@ const no = async (t, { themeZipFile: e, options: r = {} }, n) => {
|
|
|
856
856
|
rememberme: "forever"
|
|
857
857
|
}
|
|
858
858
|
});
|
|
859
|
-
},
|
|
859
|
+
}, so = async (t, { options: e }) => {
|
|
860
860
|
await t.request({
|
|
861
861
|
url: "/wp-admin/install.php?step=2",
|
|
862
862
|
method: "POST",
|
|
@@ -873,7 +873,7 @@ const no = async (t, { themeZipFile: e, options: r = {} }, n) => {
|
|
|
873
873
|
admin_email: "admin@localhost.com"
|
|
874
874
|
}
|
|
875
875
|
});
|
|
876
|
-
},
|
|
876
|
+
}, io = async (t, { options: e }) => {
|
|
877
877
|
const r = `<?php
|
|
878
878
|
include 'wordpress/wp-load.php';
|
|
879
879
|
$site_options = ${Tt(e)};
|
|
@@ -884,8 +884,8 @@ const no = async (t, { themeZipFile: e, options: r = {} }, n) => {
|
|
|
884
884
|
`, n = await t.run({
|
|
885
885
|
code: r
|
|
886
886
|
});
|
|
887
|
-
return
|
|
888
|
-
},
|
|
887
|
+
return Cs(n), { code: r, result: n };
|
|
888
|
+
}, oo = async (t, { meta: e, userId: r }) => {
|
|
889
889
|
const n = `<?php
|
|
890
890
|
include 'wordpress/wp-load.php';
|
|
891
891
|
$meta = ${Tt(e)};
|
|
@@ -896,42 +896,42 @@ const no = async (t, { themeZipFile: e, options: r = {} }, n) => {
|
|
|
896
896
|
`, s = await t.run({
|
|
897
897
|
code: n
|
|
898
898
|
});
|
|
899
|
-
return
|
|
899
|
+
return Cs(s), { code: n, result: s };
|
|
900
900
|
};
|
|
901
|
-
async function
|
|
901
|
+
async function Cs(t) {
|
|
902
902
|
if (t.text !== "Success")
|
|
903
903
|
throw console.log(t), new Error(`Failed to run code: ${t.text} ${t.errors}`);
|
|
904
904
|
}
|
|
905
|
-
const
|
|
905
|
+
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
906
906
|
__proto__: null,
|
|
907
|
-
activatePlugin:
|
|
908
|
-
activateTheme:
|
|
909
|
-
applyWordPressPatches:
|
|
910
|
-
cp:
|
|
911
|
-
defineSiteUrl:
|
|
907
|
+
activatePlugin: Ps,
|
|
908
|
+
activateTheme: Es,
|
|
909
|
+
applyWordPressPatches: qi,
|
|
910
|
+
cp: Vi,
|
|
911
|
+
defineSiteUrl: Gi,
|
|
912
912
|
defineWpConfigConsts: Wt,
|
|
913
|
-
importFile:
|
|
914
|
-
installPlugin:
|
|
915
|
-
installTheme:
|
|
916
|
-
login:
|
|
917
|
-
mkdir:
|
|
918
|
-
mv:
|
|
919
|
-
replaceSite:
|
|
920
|
-
request:
|
|
921
|
-
rm:
|
|
922
|
-
rmdir:
|
|
923
|
-
runPHP:
|
|
924
|
-
runPHPWithOptions:
|
|
925
|
-
runWpInstallationWizard:
|
|
926
|
-
setPhpIniEntry:
|
|
927
|
-
setSiteOptions:
|
|
913
|
+
importFile: Zi,
|
|
914
|
+
installPlugin: eo,
|
|
915
|
+
installTheme: ro,
|
|
916
|
+
login: no,
|
|
917
|
+
mkdir: Ki,
|
|
918
|
+
mv: zi,
|
|
919
|
+
replaceSite: Yi,
|
|
920
|
+
request: Hi,
|
|
921
|
+
rm: Wi,
|
|
922
|
+
rmdir: Bi,
|
|
923
|
+
runPHP: Mi,
|
|
924
|
+
runPHPWithOptions: Ui,
|
|
925
|
+
runWpInstallationWizard: so,
|
|
926
|
+
setPhpIniEntry: Li,
|
|
927
|
+
setSiteOptions: io,
|
|
928
928
|
unzip: zr,
|
|
929
|
-
updateUserMeta:
|
|
930
|
-
writeFile:
|
|
931
|
-
zipEntireSite:
|
|
932
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
933
|
-
function
|
|
934
|
-
const r = t.headers.get("content-length") || "", n = parseInt(r, 10) ||
|
|
929
|
+
updateUserMeta: oo,
|
|
930
|
+
writeFile: Ts,
|
|
931
|
+
zipEntireSite: Ji
|
|
932
|
+
}, Symbol.toStringTag, { value: "Module" })), co = 5 * 1024 * 1024;
|
|
933
|
+
function lo(t, e) {
|
|
934
|
+
const r = t.headers.get("content-length") || "", n = parseInt(r, 10) || co;
|
|
935
935
|
function s(i, c) {
|
|
936
936
|
e(
|
|
937
937
|
new CustomEvent("progress", {
|
|
@@ -1139,7 +1139,7 @@ class Wr extends EventTarget {
|
|
|
1139
1139
|
this.dispatchEvent(new CustomEvent("done"));
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const Gn = Symbol("error"), xn = Symbol("message");
|
|
1143
1143
|
class Kr extends Event {
|
|
1144
1144
|
/**
|
|
1145
1145
|
* Create a new `ErrorEvent`.
|
|
@@ -1149,22 +1149,22 @@ class Kr extends Event {
|
|
|
1149
1149
|
* attributes via object members of the same name.
|
|
1150
1150
|
*/
|
|
1151
1151
|
constructor(e, r = {}) {
|
|
1152
|
-
super(e), this[
|
|
1152
|
+
super(e), this[Gn] = r.error === void 0 ? null : r.error, this[xn] = r.message === void 0 ? "" : r.message;
|
|
1153
1153
|
}
|
|
1154
1154
|
get error() {
|
|
1155
|
-
return this[
|
|
1155
|
+
return this[Gn];
|
|
1156
1156
|
}
|
|
1157
1157
|
get message() {
|
|
1158
|
-
return this[
|
|
1158
|
+
return this[xn];
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
1161
|
Object.defineProperty(Kr.prototype, "error", { enumerable: !0 });
|
|
1162
1162
|
Object.defineProperty(Kr.prototype, "message", { enumerable: !0 });
|
|
1163
|
-
const
|
|
1164
|
-
function
|
|
1163
|
+
const uo = typeof globalThis.ErrorEvent == "function" ? globalThis.ErrorEvent : Kr;
|
|
1164
|
+
function po(t) {
|
|
1165
1165
|
return t instanceof Error ? "exitCode" in t && t?.exitCode === 0 || t?.name === "ExitStatus" && "status" in t && t.status === 0 : !1;
|
|
1166
1166
|
}
|
|
1167
|
-
class
|
|
1167
|
+
class fo extends EventTarget {
|
|
1168
1168
|
constructor() {
|
|
1169
1169
|
super(...arguments), this.listenersCount = 0;
|
|
1170
1170
|
}
|
|
@@ -1178,11 +1178,11 @@ class ho extends EventTarget {
|
|
|
1178
1178
|
return this.listenersCount > 0;
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function ho(t) {
|
|
1182
1182
|
t.asm = {
|
|
1183
1183
|
...t.asm
|
|
1184
1184
|
};
|
|
1185
|
-
const e = new
|
|
1185
|
+
const e = new fo();
|
|
1186
1186
|
for (const r in t.asm)
|
|
1187
1187
|
if (typeof t.asm[r] == "function") {
|
|
1188
1188
|
const n = t.asm[r];
|
|
@@ -1192,38 +1192,38 @@ function mo(t) {
|
|
|
1192
1192
|
} catch (i) {
|
|
1193
1193
|
if (!(i instanceof Error))
|
|
1194
1194
|
throw i;
|
|
1195
|
-
const c =
|
|
1195
|
+
const c = yo(
|
|
1196
1196
|
i,
|
|
1197
1197
|
t.lastAsyncifyStackSource?.stack
|
|
1198
1198
|
);
|
|
1199
1199
|
if (t.lastAsyncifyStackSource && (i.cause = t.lastAsyncifyStackSource), e.hasListeners()) {
|
|
1200
1200
|
e.dispatchEvent(
|
|
1201
|
-
new
|
|
1201
|
+
new uo("error", {
|
|
1202
1202
|
error: i,
|
|
1203
1203
|
message: c
|
|
1204
1204
|
})
|
|
1205
1205
|
);
|
|
1206
1206
|
return;
|
|
1207
1207
|
}
|
|
1208
|
-
throw
|
|
1208
|
+
throw po(i) || _o(c), i;
|
|
1209
1209
|
}
|
|
1210
1210
|
};
|
|
1211
1211
|
}
|
|
1212
1212
|
return e;
|
|
1213
1213
|
}
|
|
1214
1214
|
let Ir = [];
|
|
1215
|
-
function
|
|
1215
|
+
function mo() {
|
|
1216
1216
|
return Ir;
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function yo(t, e) {
|
|
1219
1219
|
if (t.message === "unreachable") {
|
|
1220
|
-
let r =
|
|
1220
|
+
let r = go;
|
|
1221
1221
|
e || (r += `
|
|
1222
1222
|
|
|
1223
1223
|
This stack trace is lacking. For a better one initialize
|
|
1224
1224
|
the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
|
|
1225
1225
|
|
|
1226
|
-
`), Ir =
|
|
1226
|
+
`), Ir = vo(
|
|
1227
1227
|
e || t.stack || ""
|
|
1228
1228
|
);
|
|
1229
1229
|
for (const n of Ir)
|
|
@@ -1233,7 +1233,7 @@ the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
|
|
|
1233
1233
|
}
|
|
1234
1234
|
return t.message;
|
|
1235
1235
|
}
|
|
1236
|
-
const
|
|
1236
|
+
const go = `
|
|
1237
1237
|
"unreachable" WASM instruction executed.
|
|
1238
1238
|
|
|
1239
1239
|
The typical reason is a PHP function missing from the ASYNCIFY_ONLY
|
|
@@ -1257,20 +1257,20 @@ the Dockerfile, you'll need to trigger this error again with long stack
|
|
|
1257
1257
|
traces enabled. In node.js, you can do it using the --stack-trace-limit=100
|
|
1258
1258
|
CLI option:
|
|
1259
1259
|
|
|
1260
|
-
`,
|
|
1261
|
-
let
|
|
1262
|
-
function
|
|
1263
|
-
if (!
|
|
1264
|
-
|
|
1265
|
-
${
|
|
1266
|
-
${
|
|
1260
|
+
`, Jn = "\x1B[41m", $o = "\x1B[1m", Yn = "\x1B[0m", Zn = "\x1B[K";
|
|
1261
|
+
let Qn = !1;
|
|
1262
|
+
function _o(t) {
|
|
1263
|
+
if (!Qn) {
|
|
1264
|
+
Qn = !0, console.log(`${Jn}
|
|
1265
|
+
${Zn}
|
|
1266
|
+
${$o} WASM ERROR${Yn}${Jn}`);
|
|
1267
1267
|
for (const e of t.split(`
|
|
1268
1268
|
`))
|
|
1269
|
-
console.log(`${
|
|
1270
|
-
console.log(`${
|
|
1269
|
+
console.log(`${Zn} ${e} `);
|
|
1270
|
+
console.log(`${Yn}`);
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function vo(t) {
|
|
1274
1274
|
try {
|
|
1275
1275
|
const e = t.split(`
|
|
1276
1276
|
`).slice(1).map((r) => {
|
|
@@ -1322,7 +1322,7 @@ class Et {
|
|
|
1322
1322
|
return new TextDecoder().decode(this.bytes);
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
const
|
|
1325
|
+
const js = [
|
|
1326
1326
|
"8.2",
|
|
1327
1327
|
"8.1",
|
|
1328
1328
|
"8.0",
|
|
@@ -1332,15 +1332,15 @@ const ks = [
|
|
|
1332
1332
|
"7.1",
|
|
1333
1333
|
"7.0",
|
|
1334
1334
|
"5.6"
|
|
1335
|
-
],
|
|
1335
|
+
], wo = js[0], ks = [
|
|
1336
1336
|
"iconv",
|
|
1337
1337
|
"mbstring",
|
|
1338
1338
|
"xml-bundle",
|
|
1339
1339
|
"gd"
|
|
1340
|
-
],
|
|
1341
|
-
"kitchen-sink":
|
|
1340
|
+
], Xn = {
|
|
1341
|
+
"kitchen-sink": ks
|
|
1342
1342
|
};
|
|
1343
|
-
class
|
|
1343
|
+
class bo {
|
|
1344
1344
|
#e;
|
|
1345
1345
|
#t;
|
|
1346
1346
|
/**
|
|
@@ -1426,17 +1426,17 @@ class Po {
|
|
|
1426
1426
|
return e.join("; ");
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
|
-
const
|
|
1430
|
-
function
|
|
1429
|
+
const Po = "http://example.com";
|
|
1430
|
+
function es(t) {
|
|
1431
1431
|
return t.toString().substring(t.origin.length);
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function ts(t, e) {
|
|
1434
1434
|
return !e || !t.startsWith(e) ? t : t.substring(e.length);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function Eo(t, e) {
|
|
1437
1437
|
return !e || t.startsWith(e) ? t : e + t;
|
|
1438
1438
|
}
|
|
1439
|
-
class
|
|
1439
|
+
class So {
|
|
1440
1440
|
#e;
|
|
1441
1441
|
#t;
|
|
1442
1442
|
#n;
|
|
@@ -1450,7 +1450,7 @@ class To {
|
|
|
1450
1450
|
* @param config - Request Handler configuration.
|
|
1451
1451
|
*/
|
|
1452
1452
|
constructor(e, r = {}) {
|
|
1453
|
-
this.#a = new
|
|
1453
|
+
this.#a = new Rs({ concurrency: 1 });
|
|
1454
1454
|
const {
|
|
1455
1455
|
documentRoot: n = "/www/",
|
|
1456
1456
|
absoluteUrl: s = typeof location == "object" ? location?.href : ""
|
|
@@ -1475,7 +1475,7 @@ class To {
|
|
|
1475
1475
|
/** @inheritDoc */
|
|
1476
1476
|
internalUrlToPath(e) {
|
|
1477
1477
|
const r = new URL(e);
|
|
1478
|
-
return r.pathname.startsWith(this.#s) && (r.pathname = r.pathname.slice(this.#s.length)),
|
|
1478
|
+
return r.pathname.startsWith(this.#s) && (r.pathname = r.pathname.slice(this.#s.length)), es(r);
|
|
1479
1479
|
}
|
|
1480
1480
|
get isRequestRunning() {
|
|
1481
1481
|
return this.#a.running > 0;
|
|
@@ -1492,12 +1492,12 @@ class To {
|
|
|
1492
1492
|
async request(e) {
|
|
1493
1493
|
const r = e.url.startsWith("http://") || e.url.startsWith("https://"), n = new URL(
|
|
1494
1494
|
e.url,
|
|
1495
|
-
r ? void 0 :
|
|
1496
|
-
), s =
|
|
1495
|
+
r ? void 0 : Po
|
|
1496
|
+
), s = ts(
|
|
1497
1497
|
n.pathname,
|
|
1498
1498
|
this.#s
|
|
1499
1499
|
), i = `${this.#e}${s}`;
|
|
1500
|
-
return
|
|
1500
|
+
return Oo(i) ? await this.#l(e, n) : this.#c(i);
|
|
1501
1501
|
}
|
|
1502
1502
|
/**
|
|
1503
1503
|
* Serves a static file from the PHP filesystem.
|
|
@@ -1524,7 +1524,7 @@ class To {
|
|
|
1524
1524
|
// @TODO: Infer the content-type from the arrayBuffer instead of the file path.
|
|
1525
1525
|
// The code below won't return the correct mime-type if the extension
|
|
1526
1526
|
// was tampered with.
|
|
1527
|
-
"content-type": [
|
|
1527
|
+
"content-type": [Ro(e)],
|
|
1528
1528
|
"accept-ranges": ["bytes"],
|
|
1529
1529
|
"cache-control": ["public, max-age=0"]
|
|
1530
1530
|
},
|
|
@@ -1548,7 +1548,7 @@ class To {
|
|
|
1548
1548
|
let s = "GET";
|
|
1549
1549
|
const i = {
|
|
1550
1550
|
host: this.#i,
|
|
1551
|
-
...
|
|
1551
|
+
...Is(e.headers || {})
|
|
1552
1552
|
}, c = [];
|
|
1553
1553
|
if (e.files && Object.keys(e.files).length) {
|
|
1554
1554
|
s = "POST";
|
|
@@ -1561,7 +1561,7 @@ class To {
|
|
|
1561
1561
|
data: new Uint8Array(await p.arrayBuffer())
|
|
1562
1562
|
});
|
|
1563
1563
|
}
|
|
1564
|
-
i["content-type"]?.startsWith("multipart/form-data") && (e.formData =
|
|
1564
|
+
i["content-type"]?.startsWith("multipart/form-data") && (e.formData = To(
|
|
1565
1565
|
e.body || ""
|
|
1566
1566
|
), i["content-type"] = "application/x-www-form-urlencoded", delete e.body);
|
|
1567
1567
|
}
|
|
@@ -1580,8 +1580,8 @@ class To {
|
|
|
1580
1580
|
);
|
|
1581
1581
|
}
|
|
1582
1582
|
return await this.php.run({
|
|
1583
|
-
relativeUri:
|
|
1584
|
-
|
|
1583
|
+
relativeUri: Eo(
|
|
1584
|
+
es(r),
|
|
1585
1585
|
this.#s
|
|
1586
1586
|
),
|
|
1587
1587
|
protocol: this.#t,
|
|
@@ -1605,7 +1605,7 @@ class To {
|
|
|
1605
1605
|
* @returns The resolved filesystem path.
|
|
1606
1606
|
*/
|
|
1607
1607
|
#u(e) {
|
|
1608
|
-
let r =
|
|
1608
|
+
let r = ts(e, this.#s);
|
|
1609
1609
|
r.includes(".php") ? r = r.split(".php")[0] + ".php" : (r.endsWith("/") || (r += "/"), r.endsWith("index.php") || (r += "index.php"));
|
|
1610
1610
|
const n = `${this.#e}${r}`;
|
|
1611
1611
|
if (this.php.fileExists(n))
|
|
@@ -1615,7 +1615,7 @@ class To {
|
|
|
1615
1615
|
return `${this.#e}/index.php`;
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
-
function
|
|
1618
|
+
function To(t) {
|
|
1619
1619
|
const e = {}, r = t.match(/--(.*)\r\n/);
|
|
1620
1620
|
if (!r)
|
|
1621
1621
|
return e;
|
|
@@ -1630,7 +1630,7 @@ function Ro(t) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
}), e;
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function Ro(t) {
|
|
1634
1634
|
switch (t.split(".").pop()) {
|
|
1635
1635
|
case "css":
|
|
1636
1636
|
return "text/css";
|
|
@@ -1670,16 +1670,16 @@ function Oo(t) {
|
|
|
1670
1670
|
return "application-octet-stream";
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1674
|
-
return
|
|
1673
|
+
function Oo(t) {
|
|
1674
|
+
return No(t) || Co(t);
|
|
1675
1675
|
}
|
|
1676
|
-
function
|
|
1676
|
+
function No(t) {
|
|
1677
1677
|
return t.endsWith(".php") || t.includes(".php/");
|
|
1678
1678
|
}
|
|
1679
|
-
function
|
|
1679
|
+
function Co(t) {
|
|
1680
1680
|
return !t.split("/").pop().includes(".");
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1682
|
+
const rs = {
|
|
1683
1683
|
0: "No error occurred. System call completed successfully.",
|
|
1684
1684
|
1: "Argument list too long.",
|
|
1685
1685
|
2: "Permission denied.",
|
|
@@ -1766,8 +1766,8 @@ function Ce(t = "") {
|
|
|
1766
1766
|
return i.apply(this, c);
|
|
1767
1767
|
} catch (l) {
|
|
1768
1768
|
const m = typeof l == "object" ? l?.errno : null;
|
|
1769
|
-
if (m in
|
|
1770
|
-
const u =
|
|
1769
|
+
if (m in rs) {
|
|
1770
|
+
const u = rs[m], p = typeof c[0] == "string" ? c[0] : null, g = p !== null ? t.replaceAll("{path}", p) : t;
|
|
1771
1771
|
throw new Error(`${g}: ${u}`, {
|
|
1772
1772
|
cause: l
|
|
1773
1773
|
});
|
|
@@ -1777,17 +1777,17 @@ function Ce(t = "") {
|
|
|
1777
1777
|
};
|
|
1778
1778
|
};
|
|
1779
1779
|
}
|
|
1780
|
-
const
|
|
1781
|
-
function
|
|
1782
|
-
return
|
|
1780
|
+
const jo = [];
|
|
1781
|
+
function ko(t) {
|
|
1782
|
+
return jo[t];
|
|
1783
1783
|
}
|
|
1784
1784
|
(function() {
|
|
1785
1785
|
return typeof process < "u" && process.release?.name === "node" ? "NODE" : typeof window < "u" ? "WEB" : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? "WORKER" : "NODE";
|
|
1786
1786
|
})();
|
|
1787
|
-
var
|
|
1788
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1787
|
+
var Io = Object.defineProperty, Ao = Object.getOwnPropertyDescriptor, je = (t, e, r, n) => {
|
|
1788
|
+
for (var s = n > 1 ? void 0 : n ? Ao(e, r) : e, i = t.length - 1, c; i >= 0; i--)
|
|
1789
1789
|
(c = t[i]) && (s = (n ? c(e, r, s) : c(s)) || s);
|
|
1790
|
-
return n && s &&
|
|
1790
|
+
return n && s && Io(e, r, s), s;
|
|
1791
1791
|
};
|
|
1792
1792
|
const me = "string", vt = "number", ee = Symbol("__private__dont__use");
|
|
1793
1793
|
class ke {
|
|
@@ -1799,8 +1799,8 @@ class ke {
|
|
|
1799
1799
|
* @param serverOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
|
|
1800
1800
|
*/
|
|
1801
1801
|
constructor(e, r) {
|
|
1802
|
-
this.#e = [], this.#t = !1, this.#n = null, this.#r = {}, this.#i = [], e !== void 0 && this.initializeRuntime(e), r && (this.requestHandler = new
|
|
1803
|
-
new
|
|
1802
|
+
this.#e = [], this.#t = !1, this.#n = null, this.#r = {}, this.#i = [], e !== void 0 && this.initializeRuntime(e), r && (this.requestHandler = new bo(
|
|
1803
|
+
new So(this, r)
|
|
1804
1804
|
));
|
|
1805
1805
|
}
|
|
1806
1806
|
#e;
|
|
@@ -1833,13 +1833,13 @@ class ke {
|
|
|
1833
1833
|
initializeRuntime(e) {
|
|
1834
1834
|
if (this[ee])
|
|
1835
1835
|
throw new Error("PHP runtime already initialized.");
|
|
1836
|
-
const r =
|
|
1836
|
+
const r = ko(e);
|
|
1837
1837
|
if (!r)
|
|
1838
1838
|
throw new Error("Invalid PHP runtime id.");
|
|
1839
1839
|
this[ee] = r, r.onMessage = (n) => {
|
|
1840
1840
|
for (const s of this.#i)
|
|
1841
1841
|
s(n);
|
|
1842
|
-
}, this.#n =
|
|
1842
|
+
}, this.#n = ho(r);
|
|
1843
1843
|
}
|
|
1844
1844
|
/** @inheritDoc */
|
|
1845
1845
|
setPhpIniPath(e) {
|
|
@@ -1873,7 +1873,7 @@ class ke {
|
|
|
1873
1873
|
this.#t || (this.#s(), this.#t = !0), this.#p(e.scriptPath || ""), this.#a(e.relativeUri || ""), this.#l(e.method || "GET");
|
|
1874
1874
|
const { host: r, ...n } = {
|
|
1875
1875
|
host: "example.com:443",
|
|
1876
|
-
...
|
|
1876
|
+
...Is(e.headers || {})
|
|
1877
1877
|
};
|
|
1878
1878
|
if (this.#c(r, e.protocol || "http"), this.#u(n), e.body && this.#d(e.body), e.fileInfos)
|
|
1879
1879
|
for (const s of e.fileInfos)
|
|
@@ -2068,7 +2068,7 @@ class ke {
|
|
|
2068
2068
|
"PHP runtime has crashed – see the earlier error for details."
|
|
2069
2069
|
);
|
|
2070
2070
|
});
|
|
2071
|
-
this.functionsMaybeMissingFromAsyncify =
|
|
2071
|
+
this.functionsMaybeMissingFromAsyncify = mo();
|
|
2072
2072
|
const c = i, l = "betterMessage" in c ? c.betterMessage : c.message, m = new Error(l);
|
|
2073
2073
|
throw m.cause = c, m;
|
|
2074
2074
|
} finally {
|
|
@@ -2172,21 +2172,21 @@ je([
|
|
|
2172
2172
|
je([
|
|
2173
2173
|
Ce('Could not stat "{path}"')
|
|
2174
2174
|
], ke.prototype, "fileExists", 1);
|
|
2175
|
-
function
|
|
2175
|
+
function Is(t) {
|
|
2176
2176
|
const e = {};
|
|
2177
2177
|
for (const r in t)
|
|
2178
2178
|
e[r.toLowerCase()] = t[r];
|
|
2179
2179
|
return e;
|
|
2180
2180
|
}
|
|
2181
|
-
const
|
|
2181
|
+
const Do = [
|
|
2182
2182
|
"vfs",
|
|
2183
2183
|
"literal",
|
|
2184
2184
|
"wordpress.org/themes",
|
|
2185
2185
|
"wordpress.org/plugins",
|
|
2186
2186
|
"url"
|
|
2187
2187
|
];
|
|
2188
|
-
function
|
|
2189
|
-
return t && typeof t == "object" && typeof t.resource == "string" &&
|
|
2188
|
+
function qo(t) {
|
|
2189
|
+
return t && typeof t == "object" && typeof t.resource == "string" && Do.includes(t.resource);
|
|
2190
2190
|
}
|
|
2191
2191
|
class ut {
|
|
2192
2192
|
/**
|
|
@@ -2200,24 +2200,24 @@ class ut {
|
|
|
2200
2200
|
let s;
|
|
2201
2201
|
switch (e.resource) {
|
|
2202
2202
|
case "vfs":
|
|
2203
|
-
s = new
|
|
2203
|
+
s = new Fo(e, n);
|
|
2204
2204
|
break;
|
|
2205
2205
|
case "literal":
|
|
2206
|
-
s = new
|
|
2206
|
+
s = new Mo(e, n);
|
|
2207
2207
|
break;
|
|
2208
2208
|
case "wordpress.org/themes":
|
|
2209
|
-
s = new
|
|
2209
|
+
s = new Ho(e, n);
|
|
2210
2210
|
break;
|
|
2211
2211
|
case "wordpress.org/plugins":
|
|
2212
|
-
s = new
|
|
2212
|
+
s = new Vo(e, n);
|
|
2213
2213
|
break;
|
|
2214
2214
|
case "url":
|
|
2215
|
-
s = new
|
|
2215
|
+
s = new Lo(e, n);
|
|
2216
2216
|
break;
|
|
2217
2217
|
default:
|
|
2218
2218
|
throw new Error(`Invalid resource: ${e}`);
|
|
2219
2219
|
}
|
|
2220
|
-
return s = new
|
|
2220
|
+
return s = new zo(s), r && (s = new Wo(s, r)), s;
|
|
2221
2221
|
}
|
|
2222
2222
|
setPlayground(e) {
|
|
2223
2223
|
this.playground = e;
|
|
@@ -2227,7 +2227,7 @@ class ut {
|
|
|
2227
2227
|
return !1;
|
|
2228
2228
|
}
|
|
2229
2229
|
}
|
|
2230
|
-
class
|
|
2230
|
+
class Fo extends ut {
|
|
2231
2231
|
/**
|
|
2232
2232
|
* Creates a new instance of `VFSResource`.
|
|
2233
2233
|
* @param playground The playground client.
|
|
@@ -2249,7 +2249,7 @@ class Mo extends ut {
|
|
|
2249
2249
|
return this.resource.path.split("/").pop() || "";
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
|
-
class
|
|
2252
|
+
class Mo extends ut {
|
|
2253
2253
|
/**
|
|
2254
2254
|
* Creates a new instance of `LiteralResource`.
|
|
2255
2255
|
* @param resource The literal reference.
|
|
@@ -2280,9 +2280,9 @@ class Br extends ut {
|
|
|
2280
2280
|
this.progress?.setCaption(this.caption);
|
|
2281
2281
|
const e = this.getURL();
|
|
2282
2282
|
let r = await fetch(e);
|
|
2283
|
-
if (r = await
|
|
2283
|
+
if (r = await lo(
|
|
2284
2284
|
r,
|
|
2285
|
-
this.progress?.loadingListener ??
|
|
2285
|
+
this.progress?.loadingListener ?? Uo
|
|
2286
2286
|
), r.status !== 200)
|
|
2287
2287
|
throw new Error(`Could not download "${e}"`);
|
|
2288
2288
|
return new Hr([await r.blob()], this.name);
|
|
@@ -2307,9 +2307,9 @@ class Br extends ut {
|
|
|
2307
2307
|
return !0;
|
|
2308
2308
|
}
|
|
2309
2309
|
}
|
|
2310
|
-
const
|
|
2310
|
+
const Uo = () => {
|
|
2311
2311
|
};
|
|
2312
|
-
class
|
|
2312
|
+
class Lo extends Br {
|
|
2313
2313
|
/**
|
|
2314
2314
|
* Creates a new instance of `UrlResource`.
|
|
2315
2315
|
* @param resource The URL reference.
|
|
@@ -2327,11 +2327,7 @@ class Ho extends Br {
|
|
|
2327
2327
|
return this.resource.caption ?? super.caption;
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
|
-
|
|
2331
|
-
function Zu(t) {
|
|
2332
|
-
Gr = t;
|
|
2333
|
-
}
|
|
2334
|
-
class Vo extends Br {
|
|
2330
|
+
class Ho extends Br {
|
|
2335
2331
|
constructor(e, r) {
|
|
2336
2332
|
super(r), this.resource = e;
|
|
2337
2333
|
}
|
|
@@ -2339,11 +2335,10 @@ class Vo extends Br {
|
|
|
2339
2335
|
return wr(this.resource.slug);
|
|
2340
2336
|
}
|
|
2341
2337
|
getURL() {
|
|
2342
|
-
|
|
2343
|
-
return `${Gr}?theme=` + e;
|
|
2338
|
+
return `https://downloads.wordpress.org/theme/${As(this.resource.slug)}`;
|
|
2344
2339
|
}
|
|
2345
2340
|
}
|
|
2346
|
-
class
|
|
2341
|
+
class Vo extends Br {
|
|
2347
2342
|
constructor(e, r) {
|
|
2348
2343
|
super(r), this.resource = e;
|
|
2349
2344
|
}
|
|
@@ -2353,14 +2348,13 @@ class zo extends Br {
|
|
|
2353
2348
|
}
|
|
2354
2349
|
/** @inheritDoc */
|
|
2355
2350
|
getURL() {
|
|
2356
|
-
|
|
2357
|
-
return `${Gr}?plugin=` + e;
|
|
2351
|
+
return `https://downloads.wordpress.org/plugin/${As(this.resource.slug)}`;
|
|
2358
2352
|
}
|
|
2359
2353
|
}
|
|
2360
|
-
function
|
|
2354
|
+
function As(t) {
|
|
2361
2355
|
return !t || t.endsWith(".zip") ? t : t + ".latest-stable.zip";
|
|
2362
2356
|
}
|
|
2363
|
-
class
|
|
2357
|
+
class Ds extends ut {
|
|
2364
2358
|
constructor(e) {
|
|
2365
2359
|
super(), this.resource = e;
|
|
2366
2360
|
}
|
|
@@ -2389,13 +2383,13 @@ class qs extends ut {
|
|
|
2389
2383
|
return this.resource.isAsync;
|
|
2390
2384
|
}
|
|
2391
2385
|
}
|
|
2392
|
-
class
|
|
2386
|
+
class zo extends Ds {
|
|
2393
2387
|
/** @inheritDoc */
|
|
2394
2388
|
async resolve() {
|
|
2395
2389
|
return this.promise || (this.promise = super.resolve()), this.promise;
|
|
2396
2390
|
}
|
|
2397
2391
|
}
|
|
2398
|
-
class
|
|
2392
|
+
class Wo extends Ds {
|
|
2399
2393
|
constructor(e, r) {
|
|
2400
2394
|
super(e), this.semaphore = r;
|
|
2401
2395
|
}
|
|
@@ -2404,11 +2398,11 @@ class Ko extends qs {
|
|
|
2404
2398
|
return this.isAsync ? this.semaphore.run(() => super.resolve()) : super.resolve();
|
|
2405
2399
|
}
|
|
2406
2400
|
}
|
|
2407
|
-
var
|
|
2408
|
-
function
|
|
2401
|
+
var Ko = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2402
|
+
function Bo(t) {
|
|
2409
2403
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2410
2404
|
}
|
|
2411
|
-
var Ar = { exports: {} },
|
|
2405
|
+
var Ar = { exports: {} }, qs = {}, Ne = {}, Rt = {}, Zt = {}, B = {}, Yt = {};
|
|
2412
2406
|
(function(t) {
|
|
2413
2407
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.regexpCode = t.getEsmExportName = t.getProperty = t.safeStringify = t.stringify = t.strConcat = t.addCodeArg = t.str = t._ = t.nil = t._Code = t.Name = t.IDENTIFIER = t._CodeOrName = void 0;
|
|
2414
2408
|
class e {
|
|
@@ -3351,7 +3345,7 @@ var X = {};
|
|
|
3351
3345
|
})(X);
|
|
3352
3346
|
var He = {};
|
|
3353
3347
|
Object.defineProperty(He, "__esModule", { value: !0 });
|
|
3354
|
-
const ye = B,
|
|
3348
|
+
const ye = B, Go = {
|
|
3355
3349
|
// validation function arguments
|
|
3356
3350
|
data: new ye.Name("data"),
|
|
3357
3351
|
// args passed from referencing schema
|
|
@@ -3374,7 +3368,7 @@ const ye = B, xo = {
|
|
|
3374
3368
|
jsonLen: new ye.Name("jsonLen"),
|
|
3375
3369
|
jsonPart: new ye.Name("jsonPart")
|
|
3376
3370
|
};
|
|
3377
|
-
He.default =
|
|
3371
|
+
He.default = Go;
|
|
3378
3372
|
(function(t) {
|
|
3379
3373
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.extendErrors = t.resetErrorsCount = t.reportExtraError = t.reportError = t.keyword$DataError = t.keywordError = void 0;
|
|
3380
3374
|
const e = B, r = X, n = He;
|
|
@@ -3449,20 +3443,20 @@ He.default = xo;
|
|
|
3449
3443
|
})(Zt);
|
|
3450
3444
|
Object.defineProperty(Rt, "__esModule", { value: !0 });
|
|
3451
3445
|
Rt.boolOrEmptySchema = Rt.topBoolOrEmptySchema = void 0;
|
|
3452
|
-
const
|
|
3446
|
+
const xo = Zt, Jo = B, Yo = He, Zo = {
|
|
3453
3447
|
message: "boolean schema is false"
|
|
3454
3448
|
};
|
|
3455
|
-
function
|
|
3449
|
+
function Qo(t) {
|
|
3456
3450
|
const { gen: e, schema: r, validateName: n } = t;
|
|
3457
|
-
r === !1 ?
|
|
3451
|
+
r === !1 ? Fs(t, !1) : typeof r == "object" && r.$async === !0 ? e.return(Yo.default.data) : (e.assign((0, Jo._)`${n}.errors`, null), e.return(!0));
|
|
3458
3452
|
}
|
|
3459
|
-
Rt.topBoolOrEmptySchema =
|
|
3460
|
-
function
|
|
3453
|
+
Rt.topBoolOrEmptySchema = Qo;
|
|
3454
|
+
function Xo(t, e) {
|
|
3461
3455
|
const { gen: r, schema: n } = t;
|
|
3462
|
-
n === !1 ? (r.var(e, !1),
|
|
3456
|
+
n === !1 ? (r.var(e, !1), Fs(t)) : r.var(e, !0);
|
|
3463
3457
|
}
|
|
3464
|
-
Rt.boolOrEmptySchema =
|
|
3465
|
-
function
|
|
3458
|
+
Rt.boolOrEmptySchema = Xo;
|
|
3459
|
+
function Fs(t, e) {
|
|
3466
3460
|
const { gen: r, data: n } = t, s = {
|
|
3467
3461
|
gen: r,
|
|
3468
3462
|
keyword: "false schema",
|
|
@@ -3473,17 +3467,17 @@ function Ms(t, e) {
|
|
|
3473
3467
|
params: {},
|
|
3474
3468
|
it: t
|
|
3475
3469
|
};
|
|
3476
|
-
(0,
|
|
3470
|
+
(0, xo.reportError)(s, Zo, void 0, e);
|
|
3477
3471
|
}
|
|
3478
3472
|
var Qt = {}, ct = {};
|
|
3479
3473
|
Object.defineProperty(ct, "__esModule", { value: !0 });
|
|
3480
3474
|
ct.getRules = ct.isJSONType = void 0;
|
|
3481
|
-
const
|
|
3482
|
-
function
|
|
3483
|
-
return typeof t == "string" &&
|
|
3475
|
+
const ea = ["string", "number", "integer", "boolean", "null", "object", "array"], ta = new Set(ea);
|
|
3476
|
+
function ra(t) {
|
|
3477
|
+
return typeof t == "string" && ta.has(t);
|
|
3484
3478
|
}
|
|
3485
|
-
ct.isJSONType =
|
|
3486
|
-
function
|
|
3479
|
+
ct.isJSONType = ra;
|
|
3480
|
+
function na() {
|
|
3487
3481
|
const t = {
|
|
3488
3482
|
number: { type: "number", rules: [] },
|
|
3489
3483
|
string: { type: "string", rules: [] },
|
|
@@ -3498,24 +3492,24 @@ function sa() {
|
|
|
3498
3492
|
keywords: {}
|
|
3499
3493
|
};
|
|
3500
3494
|
}
|
|
3501
|
-
ct.getRules =
|
|
3495
|
+
ct.getRules = na;
|
|
3502
3496
|
var ze = {};
|
|
3503
3497
|
Object.defineProperty(ze, "__esModule", { value: !0 });
|
|
3504
3498
|
ze.shouldUseRule = ze.shouldUseGroup = ze.schemaHasRulesForType = void 0;
|
|
3505
|
-
function
|
|
3499
|
+
function sa({ schema: t, self: e }, r) {
|
|
3506
3500
|
const n = e.RULES.types[r];
|
|
3507
|
-
return n && n !== !0 &&
|
|
3501
|
+
return n && n !== !0 && Ms(t, n);
|
|
3508
3502
|
}
|
|
3509
|
-
ze.schemaHasRulesForType =
|
|
3510
|
-
function
|
|
3511
|
-
return e.rules.some((r) =>
|
|
3503
|
+
ze.schemaHasRulesForType = sa;
|
|
3504
|
+
function Ms(t, e) {
|
|
3505
|
+
return e.rules.some((r) => Us(t, r));
|
|
3512
3506
|
}
|
|
3513
|
-
ze.shouldUseGroup =
|
|
3514
|
-
function
|
|
3507
|
+
ze.shouldUseGroup = Ms;
|
|
3508
|
+
function Us(t, e) {
|
|
3515
3509
|
var r;
|
|
3516
3510
|
return t[e.keyword] !== void 0 || ((r = e.definition.implements) === null || r === void 0 ? void 0 : r.some((n) => t[n] !== void 0));
|
|
3517
3511
|
}
|
|
3518
|
-
ze.shouldUseRule =
|
|
3512
|
+
ze.shouldUseRule = Us;
|
|
3519
3513
|
(function(t) {
|
|
3520
3514
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.reportTypeError = t.checkDataTypes = t.checkDataType = t.coerceAndCheckDataType = t.getJSONTypes = t.getSchemaTypes = t.DataType = void 0;
|
|
3521
3515
|
const e = ct, r = ze, n = Zt, s = B, i = X;
|
|
@@ -3664,23 +3658,23 @@ ze.shouldUseRule = Ls;
|
|
|
3664
3658
|
var br = {};
|
|
3665
3659
|
Object.defineProperty(br, "__esModule", { value: !0 });
|
|
3666
3660
|
br.assignDefaults = void 0;
|
|
3667
|
-
const wt = B,
|
|
3668
|
-
function
|
|
3661
|
+
const wt = B, ia = X;
|
|
3662
|
+
function oa(t, e) {
|
|
3669
3663
|
const { properties: r, items: n } = t.schema;
|
|
3670
3664
|
if (e === "object" && r)
|
|
3671
3665
|
for (const s in r)
|
|
3672
|
-
|
|
3666
|
+
ns(t, s, r[s].default);
|
|
3673
3667
|
else
|
|
3674
|
-
e === "array" && Array.isArray(n) && n.forEach((s, i) =>
|
|
3668
|
+
e === "array" && Array.isArray(n) && n.forEach((s, i) => ns(t, i, s.default));
|
|
3675
3669
|
}
|
|
3676
|
-
br.assignDefaults =
|
|
3677
|
-
function
|
|
3670
|
+
br.assignDefaults = oa;
|
|
3671
|
+
function ns(t, e, r) {
|
|
3678
3672
|
const { gen: n, compositeRule: s, data: i, opts: c } = t;
|
|
3679
3673
|
if (r === void 0)
|
|
3680
3674
|
return;
|
|
3681
3675
|
const l = (0, wt._)`${i}${(0, wt.getProperty)(e)}`;
|
|
3682
3676
|
if (s) {
|
|
3683
|
-
(0,
|
|
3677
|
+
(0, ia.checkStrictMode)(t, `default is ignored for: ${l}`);
|
|
3684
3678
|
return;
|
|
3685
3679
|
}
|
|
3686
3680
|
let m = (0, wt._)`${l} === undefined`;
|
|
@@ -3689,53 +3683,53 @@ function ss(t, e, r) {
|
|
|
3689
3683
|
var Le = {}, K = {};
|
|
3690
3684
|
Object.defineProperty(K, "__esModule", { value: !0 });
|
|
3691
3685
|
K.validateUnion = K.validateArray = K.usePattern = K.callValidateCode = K.schemaProperties = K.allSchemaProperties = K.noPropertyInData = K.propertyInData = K.isOwnProperty = K.hasPropFunc = K.reportMissingProp = K.checkMissingProp = K.checkReportMissingProp = void 0;
|
|
3692
|
-
const ne = B,
|
|
3693
|
-
function
|
|
3686
|
+
const ne = B, Gr = X, Ge = He, aa = X;
|
|
3687
|
+
function ca(t, e) {
|
|
3694
3688
|
const { gen: r, data: n, it: s } = t;
|
|
3695
|
-
r.if(
|
|
3689
|
+
r.if(Jr(r, n, e, s.opts.ownProperties), () => {
|
|
3696
3690
|
t.setParams({ missingProperty: (0, ne._)`${e}` }, !0), t.error();
|
|
3697
3691
|
});
|
|
3698
3692
|
}
|
|
3699
|
-
K.checkReportMissingProp =
|
|
3700
|
-
function
|
|
3701
|
-
return (0, ne.or)(...n.map((i) => (0, ne.and)(
|
|
3693
|
+
K.checkReportMissingProp = ca;
|
|
3694
|
+
function la({ gen: t, data: e, it: { opts: r } }, n, s) {
|
|
3695
|
+
return (0, ne.or)(...n.map((i) => (0, ne.and)(Jr(t, e, i, r.ownProperties), (0, ne._)`${s} = ${i}`)));
|
|
3702
3696
|
}
|
|
3703
|
-
K.checkMissingProp =
|
|
3704
|
-
function
|
|
3697
|
+
K.checkMissingProp = la;
|
|
3698
|
+
function ua(t, e) {
|
|
3705
3699
|
t.setParams({ missingProperty: e }, !0), t.error();
|
|
3706
3700
|
}
|
|
3707
|
-
K.reportMissingProp =
|
|
3708
|
-
function
|
|
3701
|
+
K.reportMissingProp = ua;
|
|
3702
|
+
function Ls(t) {
|
|
3709
3703
|
return t.scopeValue("func", {
|
|
3710
3704
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
3711
3705
|
ref: Object.prototype.hasOwnProperty,
|
|
3712
3706
|
code: (0, ne._)`Object.prototype.hasOwnProperty`
|
|
3713
3707
|
});
|
|
3714
3708
|
}
|
|
3715
|
-
K.hasPropFunc =
|
|
3716
|
-
function
|
|
3717
|
-
return (0, ne._)`${
|
|
3709
|
+
K.hasPropFunc = Ls;
|
|
3710
|
+
function xr(t, e, r) {
|
|
3711
|
+
return (0, ne._)`${Ls(t)}.call(${e}, ${r})`;
|
|
3718
3712
|
}
|
|
3719
|
-
K.isOwnProperty =
|
|
3720
|
-
function
|
|
3713
|
+
K.isOwnProperty = xr;
|
|
3714
|
+
function da(t, e, r, n) {
|
|
3721
3715
|
const s = (0, ne._)`${e}${(0, ne.getProperty)(r)} !== undefined`;
|
|
3722
|
-
return n ? (0, ne._)`${s} && ${
|
|
3716
|
+
return n ? (0, ne._)`${s} && ${xr(t, e, r)}` : s;
|
|
3723
3717
|
}
|
|
3724
|
-
K.propertyInData =
|
|
3725
|
-
function
|
|
3718
|
+
K.propertyInData = da;
|
|
3719
|
+
function Jr(t, e, r, n) {
|
|
3726
3720
|
const s = (0, ne._)`${e}${(0, ne.getProperty)(r)} === undefined`;
|
|
3727
|
-
return n ? (0, ne.or)(s, (0, ne.not)(
|
|
3721
|
+
return n ? (0, ne.or)(s, (0, ne.not)(xr(t, e, r))) : s;
|
|
3728
3722
|
}
|
|
3729
|
-
K.noPropertyInData =
|
|
3730
|
-
function
|
|
3723
|
+
K.noPropertyInData = Jr;
|
|
3724
|
+
function Hs(t) {
|
|
3731
3725
|
return t ? Object.keys(t).filter((e) => e !== "__proto__") : [];
|
|
3732
3726
|
}
|
|
3733
|
-
K.allSchemaProperties =
|
|
3734
|
-
function
|
|
3735
|
-
return
|
|
3727
|
+
K.allSchemaProperties = Hs;
|
|
3728
|
+
function pa(t, e) {
|
|
3729
|
+
return Hs(e).filter((r) => !(0, Gr.alwaysValidSchema)(t, e[r]));
|
|
3736
3730
|
}
|
|
3737
|
-
K.schemaProperties =
|
|
3738
|
-
function
|
|
3731
|
+
K.schemaProperties = pa;
|
|
3732
|
+
function fa({ schemaCode: t, data: e, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: c }, l, m, u) {
|
|
3739
3733
|
const p = u ? (0, ne._)`${t}, ${e}, ${n}${s}` : e, g = [
|
|
3740
3734
|
[Ge.default.instancePath, (0, ne.strConcat)(Ge.default.instancePath, i)],
|
|
3741
3735
|
[Ge.default.parentData, c.parentData],
|
|
@@ -3746,18 +3740,18 @@ function ha({ schemaCode: t, data: e, it: { gen: r, topSchemaRef: n, schemaPath:
|
|
|
3746
3740
|
const k = (0, ne._)`${p}, ${r.object(...g)}`;
|
|
3747
3741
|
return m !== ne.nil ? (0, ne._)`${l}.call(${m}, ${k})` : (0, ne._)`${l}(${k})`;
|
|
3748
3742
|
}
|
|
3749
|
-
K.callValidateCode =
|
|
3750
|
-
const
|
|
3751
|
-
function
|
|
3743
|
+
K.callValidateCode = fa;
|
|
3744
|
+
const ha = (0, ne._)`new RegExp`;
|
|
3745
|
+
function ma({ gen: t, it: { opts: e } }, r) {
|
|
3752
3746
|
const n = e.unicodeRegExp ? "u" : "", { regExp: s } = e.code, i = s(r, n);
|
|
3753
3747
|
return t.scopeValue("pattern", {
|
|
3754
3748
|
key: i.toString(),
|
|
3755
3749
|
ref: i,
|
|
3756
|
-
code: (0, ne._)`${s.code === "new RegExp" ?
|
|
3750
|
+
code: (0, ne._)`${s.code === "new RegExp" ? ha : (0, aa.useFunc)(t, s)}(${r}, ${n})`
|
|
3757
3751
|
});
|
|
3758
3752
|
}
|
|
3759
|
-
K.usePattern =
|
|
3760
|
-
function
|
|
3753
|
+
K.usePattern = ma;
|
|
3754
|
+
function ya(t) {
|
|
3761
3755
|
const { gen: e, data: r, keyword: n, it: s } = t, i = e.name("valid");
|
|
3762
3756
|
if (s.allErrors) {
|
|
3763
3757
|
const l = e.let("valid", !0);
|
|
@@ -3770,17 +3764,17 @@ function ga(t) {
|
|
|
3770
3764
|
t.subschema({
|
|
3771
3765
|
keyword: n,
|
|
3772
3766
|
dataProp: u,
|
|
3773
|
-
dataPropType:
|
|
3767
|
+
dataPropType: Gr.Type.Num
|
|
3774
3768
|
}, i), e.if((0, ne.not)(i), l);
|
|
3775
3769
|
});
|
|
3776
3770
|
}
|
|
3777
3771
|
}
|
|
3778
|
-
K.validateArray =
|
|
3779
|
-
function
|
|
3772
|
+
K.validateArray = ya;
|
|
3773
|
+
function ga(t) {
|
|
3780
3774
|
const { gen: e, schema: r, keyword: n, it: s } = t;
|
|
3781
3775
|
if (!Array.isArray(r))
|
|
3782
3776
|
throw new Error("ajv implementation error");
|
|
3783
|
-
if (r.some((m) => (0,
|
|
3777
|
+
if (r.some((m) => (0, Gr.alwaysValidSchema)(s, m)) && !s.opts.unevaluated)
|
|
3784
3778
|
return;
|
|
3785
3779
|
const c = e.let("valid", !1), l = e.name("_valid");
|
|
3786
3780
|
e.block(() => r.forEach((m, u) => {
|
|
@@ -3792,12 +3786,12 @@ function $a(t) {
|
|
|
3792
3786
|
e.assign(c, (0, ne._)`${c} || ${l}`), t.mergeValidEvaluated(p, l) || e.if((0, ne.not)(c));
|
|
3793
3787
|
})), t.result(c, () => t.reset(), () => t.error(!0));
|
|
3794
3788
|
}
|
|
3795
|
-
K.validateUnion =
|
|
3789
|
+
K.validateUnion = ga;
|
|
3796
3790
|
Object.defineProperty(Le, "__esModule", { value: !0 });
|
|
3797
3791
|
Le.validateKeywordUsage = Le.validSchemaType = Le.funcKeywordCode = Le.macroKeywordCode = void 0;
|
|
3798
|
-
const ge = B, st = He,
|
|
3799
|
-
function
|
|
3800
|
-
const { gen: r, keyword: n, schema: s, parentSchema: i, it: c } = t, l = e.macro.call(c.self, s, i, c), m =
|
|
3792
|
+
const ge = B, st = He, $a = K, _a = Zt;
|
|
3793
|
+
function va(t, e) {
|
|
3794
|
+
const { gen: r, keyword: n, schema: s, parentSchema: i, it: c } = t, l = e.macro.call(c.self, s, i, c), m = Vs(r, n, l);
|
|
3801
3795
|
c.opts.validateSchema !== !1 && c.self.validateSchema(l, !0);
|
|
3802
3796
|
const u = r.name("valid");
|
|
3803
3797
|
t.subschema({
|
|
@@ -3808,19 +3802,19 @@ function wa(t, e) {
|
|
|
3808
3802
|
compositeRule: !0
|
|
3809
3803
|
}, u), t.pass(u, () => t.error(!0));
|
|
3810
3804
|
}
|
|
3811
|
-
Le.macroKeywordCode =
|
|
3812
|
-
function
|
|
3805
|
+
Le.macroKeywordCode = va;
|
|
3806
|
+
function wa(t, e) {
|
|
3813
3807
|
var r;
|
|
3814
3808
|
const { gen: n, keyword: s, schema: i, parentSchema: c, $data: l, it: m } = t;
|
|
3815
|
-
|
|
3816
|
-
const u = !l && e.compile ? e.compile.call(m.self, i, c, m) : e.validate, p =
|
|
3809
|
+
Pa(m, e);
|
|
3810
|
+
const u = !l && e.compile ? e.compile.call(m.self, i, c, m) : e.validate, p = Vs(n, s, u), g = n.let("valid");
|
|
3817
3811
|
t.block$data(g, k), t.ok((r = e.valid) !== null && r !== void 0 ? r : g);
|
|
3818
3812
|
function k() {
|
|
3819
3813
|
if (e.errors === !1)
|
|
3820
|
-
S(), e.modifying &&
|
|
3814
|
+
S(), e.modifying && ss(t), _(() => t.error());
|
|
3821
3815
|
else {
|
|
3822
3816
|
const y = e.async ? C() : E();
|
|
3823
|
-
e.modifying &&
|
|
3817
|
+
e.modifying && ss(t), _(() => ba(t, y));
|
|
3824
3818
|
}
|
|
3825
3819
|
}
|
|
3826
3820
|
function C() {
|
|
@@ -3833,38 +3827,38 @@ function ba(t, e) {
|
|
|
3833
3827
|
}
|
|
3834
3828
|
function S(y = e.async ? (0, ge._)`await ` : ge.nil) {
|
|
3835
3829
|
const T = m.opts.passContext ? st.default.this : st.default.self, R = !("compile" in e && !l || e.schema === !1);
|
|
3836
|
-
n.assign(g, (0, ge._)`${y}${(0,
|
|
3830
|
+
n.assign(g, (0, ge._)`${y}${(0, $a.callValidateCode)(t, p, T, R)}`, e.modifying);
|
|
3837
3831
|
}
|
|
3838
3832
|
function _(y) {
|
|
3839
3833
|
var T;
|
|
3840
3834
|
n.if((0, ge.not)((T = e.valid) !== null && T !== void 0 ? T : g), y);
|
|
3841
3835
|
}
|
|
3842
3836
|
}
|
|
3843
|
-
Le.funcKeywordCode =
|
|
3844
|
-
function
|
|
3837
|
+
Le.funcKeywordCode = wa;
|
|
3838
|
+
function ss(t) {
|
|
3845
3839
|
const { gen: e, data: r, it: n } = t;
|
|
3846
3840
|
e.if(n.parentData, () => e.assign(r, (0, ge._)`${n.parentData}[${n.parentDataProperty}]`));
|
|
3847
3841
|
}
|
|
3848
|
-
function
|
|
3842
|
+
function ba(t, e) {
|
|
3849
3843
|
const { gen: r } = t;
|
|
3850
3844
|
r.if((0, ge._)`Array.isArray(${e})`, () => {
|
|
3851
|
-
r.assign(st.default.vErrors, (0, ge._)`${st.default.vErrors} === null ? ${e} : ${st.default.vErrors}.concat(${e})`).assign(st.default.errors, (0, ge._)`${st.default.vErrors}.length`), (0,
|
|
3845
|
+
r.assign(st.default.vErrors, (0, ge._)`${st.default.vErrors} === null ? ${e} : ${st.default.vErrors}.concat(${e})`).assign(st.default.errors, (0, ge._)`${st.default.vErrors}.length`), (0, _a.extendErrors)(t);
|
|
3852
3846
|
}, () => t.error());
|
|
3853
3847
|
}
|
|
3854
|
-
function
|
|
3848
|
+
function Pa({ schemaEnv: t }, e) {
|
|
3855
3849
|
if (e.async && !t.$async)
|
|
3856
3850
|
throw new Error("async keyword in sync schema");
|
|
3857
3851
|
}
|
|
3858
|
-
function
|
|
3852
|
+
function Vs(t, e, r) {
|
|
3859
3853
|
if (r === void 0)
|
|
3860
3854
|
throw new Error(`keyword "${e}" failed to compile`);
|
|
3861
3855
|
return t.scopeValue("keyword", typeof r == "function" ? { ref: r } : { ref: r, code: (0, ge.stringify)(r) });
|
|
3862
3856
|
}
|
|
3863
|
-
function
|
|
3857
|
+
function Ea(t, e, r = !1) {
|
|
3864
3858
|
return !e.length || e.some((n) => n === "array" ? Array.isArray(t) : n === "object" ? t && typeof t == "object" && !Array.isArray(t) : typeof t == n || r && typeof t > "u");
|
|
3865
3859
|
}
|
|
3866
|
-
Le.validSchemaType =
|
|
3867
|
-
function
|
|
3860
|
+
Le.validSchemaType = Ea;
|
|
3861
|
+
function Sa({ schema: t, opts: e, self: r, errSchemaPath: n }, s, i) {
|
|
3868
3862
|
if (Array.isArray(s.keyword) ? !s.keyword.includes(i) : s.keyword !== i)
|
|
3869
3863
|
throw new Error("ajv implementation error");
|
|
3870
3864
|
const c = s.dependencies;
|
|
@@ -3878,12 +3872,12 @@ function Ta({ schema: t, opts: e, self: r, errSchemaPath: n }, s, i) {
|
|
|
3878
3872
|
throw new Error(m);
|
|
3879
3873
|
}
|
|
3880
3874
|
}
|
|
3881
|
-
Le.validateKeywordUsage =
|
|
3875
|
+
Le.validateKeywordUsage = Sa;
|
|
3882
3876
|
var Ye = {};
|
|
3883
3877
|
Object.defineProperty(Ye, "__esModule", { value: !0 });
|
|
3884
3878
|
Ye.extendSubschemaMode = Ye.extendSubschemaData = Ye.getSubschema = void 0;
|
|
3885
|
-
const Ue = B,
|
|
3886
|
-
function
|
|
3879
|
+
const Ue = B, zs = X;
|
|
3880
|
+
function Ta(t, { keyword: e, schemaProp: r, schema: n, schemaPath: s, errSchemaPath: i, topSchemaRef: c }) {
|
|
3887
3881
|
if (e !== void 0 && n !== void 0)
|
|
3888
3882
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
3889
3883
|
if (e !== void 0) {
|
|
@@ -3895,7 +3889,7 @@ function Ra(t, { keyword: e, schemaProp: r, schema: n, schemaPath: s, errSchemaP
|
|
|
3895
3889
|
} : {
|
|
3896
3890
|
schema: l[r],
|
|
3897
3891
|
schemaPath: (0, Ue._)`${t.schemaPath}${(0, Ue.getProperty)(e)}${(0, Ue.getProperty)(r)}`,
|
|
3898
|
-
errSchemaPath: `${t.errSchemaPath}/${e}/${(0,
|
|
3892
|
+
errSchemaPath: `${t.errSchemaPath}/${e}/${(0, zs.escapeFragment)(r)}`
|
|
3899
3893
|
};
|
|
3900
3894
|
}
|
|
3901
3895
|
if (n !== void 0) {
|
|
@@ -3910,14 +3904,14 @@ function Ra(t, { keyword: e, schemaProp: r, schema: n, schemaPath: s, errSchemaP
|
|
|
3910
3904
|
}
|
|
3911
3905
|
throw new Error('either "keyword" or "schema" must be passed');
|
|
3912
3906
|
}
|
|
3913
|
-
Ye.getSubschema =
|
|
3914
|
-
function
|
|
3907
|
+
Ye.getSubschema = Ta;
|
|
3908
|
+
function Ra(t, e, { dataProp: r, dataPropType: n, data: s, dataTypes: i, propertyName: c }) {
|
|
3915
3909
|
if (s !== void 0 && r !== void 0)
|
|
3916
3910
|
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
3917
3911
|
const { gen: l } = e;
|
|
3918
3912
|
if (r !== void 0) {
|
|
3919
3913
|
const { errorPath: u, dataPathArr: p, opts: g } = e, k = l.let("data", (0, Ue._)`${e.data}${(0, Ue.getProperty)(r)}`, !0);
|
|
3920
|
-
m(k), t.errorPath = (0, Ue.str)`${u}${(0,
|
|
3914
|
+
m(k), t.errorPath = (0, Ue.str)`${u}${(0, zs.getErrorPath)(r, n, g.jsPropertySyntax)}`, t.parentDataProperty = (0, Ue._)`${r}`, t.dataPathArr = [...p, t.parentDataProperty];
|
|
3921
3915
|
}
|
|
3922
3916
|
if (s !== void 0) {
|
|
3923
3917
|
const u = s instanceof Ue.Name ? s : l.let("data", s, !0);
|
|
@@ -3928,12 +3922,12 @@ function Oa(t, e, { dataProp: r, dataPropType: n, data: s, dataTypes: i, propert
|
|
|
3928
3922
|
t.data = u, t.dataLevel = e.dataLevel + 1, t.dataTypes = [], e.definedProperties = /* @__PURE__ */ new Set(), t.parentData = e.data, t.dataNames = [...e.dataNames, u];
|
|
3929
3923
|
}
|
|
3930
3924
|
}
|
|
3931
|
-
Ye.extendSubschemaData =
|
|
3932
|
-
function
|
|
3925
|
+
Ye.extendSubschemaData = Ra;
|
|
3926
|
+
function Oa(t, { jtdDiscriminator: e, jtdMetadata: r, compositeRule: n, createErrors: s, allErrors: i }) {
|
|
3933
3927
|
n !== void 0 && (t.compositeRule = n), s !== void 0 && (t.createErrors = s), i !== void 0 && (t.allErrors = i), t.jtdDiscriminator = e, t.jtdMetadata = r;
|
|
3934
3928
|
}
|
|
3935
|
-
Ye.extendSubschemaMode =
|
|
3936
|
-
var he = {},
|
|
3929
|
+
Ye.extendSubschemaMode = Oa;
|
|
3930
|
+
var he = {}, Ws = function t(e, r) {
|
|
3937
3931
|
if (e === r)
|
|
3938
3932
|
return !0;
|
|
3939
3933
|
if (e && r && typeof e == "object" && typeof r == "object") {
|
|
@@ -3967,7 +3961,7 @@ var he = {}, Ks = function t(e, r) {
|
|
|
3967
3961
|
return !0;
|
|
3968
3962
|
}
|
|
3969
3963
|
return e !== e && r !== r;
|
|
3970
|
-
},
|
|
3964
|
+
}, Ks = { exports: {} }, Je = Ks.exports = function(t, e, r) {
|
|
3971
3965
|
typeof e == "function" && (r = e, e = {}), r = e.cb || r;
|
|
3972
3966
|
var n = typeof r == "function" ? r : r.pre || function() {
|
|
3973
3967
|
}, s = r.post || function() {
|
|
@@ -4030,20 +4024,20 @@ function pr(t, e, r, n, s, i, c, l, m, u) {
|
|
|
4030
4024
|
} else if (p in Je.propsKeywords) {
|
|
4031
4025
|
if (g && typeof g == "object")
|
|
4032
4026
|
for (var C in g)
|
|
4033
|
-
pr(t, e, r, g[C], s + "/" + p + "/" +
|
|
4027
|
+
pr(t, e, r, g[C], s + "/" + p + "/" + Na(C), i, s, p, n, C);
|
|
4034
4028
|
} else
|
|
4035
4029
|
(p in Je.keywords || t.allKeys && !(p in Je.skipKeywords)) && pr(t, e, r, g, s + "/" + p, i, s, p, n);
|
|
4036
4030
|
}
|
|
4037
4031
|
r(n, s, i, c, l, m, u);
|
|
4038
4032
|
}
|
|
4039
4033
|
}
|
|
4040
|
-
function
|
|
4034
|
+
function Na(t) {
|
|
4041
4035
|
return t.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
4042
4036
|
}
|
|
4043
|
-
var
|
|
4037
|
+
var Ca = Ks.exports;
|
|
4044
4038
|
Object.defineProperty(he, "__esModule", { value: !0 });
|
|
4045
4039
|
he.getSchemaRefs = he.resolveUrl = he.normalizeId = he._getFullPath = he.getFullPath = he.inlineRef = void 0;
|
|
4046
|
-
const
|
|
4040
|
+
const ja = X, ka = Ws, Ia = Ca, Aa = /* @__PURE__ */ new Set([
|
|
4047
4041
|
"type",
|
|
4048
4042
|
"format",
|
|
4049
4043
|
"pattern",
|
|
@@ -4061,11 +4055,11 @@ const ka = X, Ia = Ks, Aa = ja, Da = /* @__PURE__ */ new Set([
|
|
|
4061
4055
|
"enum",
|
|
4062
4056
|
"const"
|
|
4063
4057
|
]);
|
|
4064
|
-
function
|
|
4065
|
-
return typeof t == "boolean" ? !0 : e === !0 ? !qr(t) : e ?
|
|
4058
|
+
function Da(t, e = !0) {
|
|
4059
|
+
return typeof t == "boolean" ? !0 : e === !0 ? !qr(t) : e ? Bs(t) <= e : !1;
|
|
4066
4060
|
}
|
|
4067
|
-
he.inlineRef =
|
|
4068
|
-
const
|
|
4061
|
+
he.inlineRef = Da;
|
|
4062
|
+
const qa = /* @__PURE__ */ new Set([
|
|
4069
4063
|
"$ref",
|
|
4070
4064
|
"$recursiveRef",
|
|
4071
4065
|
"$recursiveAnchor",
|
|
@@ -4074,7 +4068,7 @@ const Fa = /* @__PURE__ */ new Set([
|
|
|
4074
4068
|
]);
|
|
4075
4069
|
function qr(t) {
|
|
4076
4070
|
for (const e in t) {
|
|
4077
|
-
if (
|
|
4071
|
+
if (qa.has(e))
|
|
4078
4072
|
return !0;
|
|
4079
4073
|
const r = t[e];
|
|
4080
4074
|
if (Array.isArray(r) && r.some(qr) || typeof r == "object" && qr(r))
|
|
@@ -4082,41 +4076,41 @@ function qr(t) {
|
|
|
4082
4076
|
}
|
|
4083
4077
|
return !1;
|
|
4084
4078
|
}
|
|
4085
|
-
function
|
|
4079
|
+
function Bs(t) {
|
|
4086
4080
|
let e = 0;
|
|
4087
4081
|
for (const r in t) {
|
|
4088
4082
|
if (r === "$ref")
|
|
4089
4083
|
return 1 / 0;
|
|
4090
|
-
if (e++, !
|
|
4084
|
+
if (e++, !Aa.has(r) && (typeof t[r] == "object" && (0, ja.eachItem)(t[r], (n) => e += Bs(n)), e === 1 / 0))
|
|
4091
4085
|
return 1 / 0;
|
|
4092
4086
|
}
|
|
4093
4087
|
return e;
|
|
4094
4088
|
}
|
|
4095
|
-
function
|
|
4089
|
+
function Gs(t, e = "", r) {
|
|
4096
4090
|
r !== !1 && (e = St(e));
|
|
4097
4091
|
const n = t.parse(e);
|
|
4098
|
-
return
|
|
4092
|
+
return xs(t, n);
|
|
4099
4093
|
}
|
|
4100
|
-
he.getFullPath =
|
|
4101
|
-
function
|
|
4094
|
+
he.getFullPath = Gs;
|
|
4095
|
+
function xs(t, e) {
|
|
4102
4096
|
return t.serialize(e).split("#")[0] + "#";
|
|
4103
4097
|
}
|
|
4104
|
-
he._getFullPath =
|
|
4105
|
-
const
|
|
4098
|
+
he._getFullPath = xs;
|
|
4099
|
+
const Fa = /#\/?$/;
|
|
4106
4100
|
function St(t) {
|
|
4107
|
-
return t ? t.replace(
|
|
4101
|
+
return t ? t.replace(Fa, "") : "";
|
|
4108
4102
|
}
|
|
4109
4103
|
he.normalizeId = St;
|
|
4110
|
-
function
|
|
4104
|
+
function Ma(t, e, r) {
|
|
4111
4105
|
return r = St(r), t.resolve(e, r);
|
|
4112
4106
|
}
|
|
4113
|
-
he.resolveUrl =
|
|
4114
|
-
const
|
|
4115
|
-
function
|
|
4107
|
+
he.resolveUrl = Ma;
|
|
4108
|
+
const Ua = /^[a-z_][-a-z0-9._]*$/i;
|
|
4109
|
+
function La(t, e) {
|
|
4116
4110
|
if (typeof t == "boolean")
|
|
4117
4111
|
return {};
|
|
4118
|
-
const { schemaId: r, uriResolver: n } = this.opts, s = St(t[r] || e), i = { "": s }, c =
|
|
4119
|
-
return
|
|
4112
|
+
const { schemaId: r, uriResolver: n } = this.opts, s = St(t[r] || e), i = { "": s }, c = Gs(n, s, !1), l = {}, m = /* @__PURE__ */ new Set();
|
|
4113
|
+
return Ia(t, { allKeys: !0 }, (g, k, C, E) => {
|
|
4120
4114
|
if (E === void 0)
|
|
4121
4115
|
return;
|
|
4122
4116
|
const S = c + k;
|
|
@@ -4132,69 +4126,69 @@ function Ha(t, e) {
|
|
|
4132
4126
|
}
|
|
4133
4127
|
function T(R) {
|
|
4134
4128
|
if (typeof R == "string") {
|
|
4135
|
-
if (!
|
|
4129
|
+
if (!Ua.test(R))
|
|
4136
4130
|
throw new Error(`invalid anchor "${R}"`);
|
|
4137
4131
|
y.call(this, `#${R}`);
|
|
4138
4132
|
}
|
|
4139
4133
|
}
|
|
4140
4134
|
}), l;
|
|
4141
4135
|
function u(g, k, C) {
|
|
4142
|
-
if (k !== void 0 && !
|
|
4136
|
+
if (k !== void 0 && !ka(g, k))
|
|
4143
4137
|
throw p(C);
|
|
4144
4138
|
}
|
|
4145
4139
|
function p(g) {
|
|
4146
4140
|
return new Error(`reference "${g}" resolves to more than one schema`);
|
|
4147
4141
|
}
|
|
4148
4142
|
}
|
|
4149
|
-
he.getSchemaRefs =
|
|
4143
|
+
he.getSchemaRefs = La;
|
|
4150
4144
|
Object.defineProperty(Ne, "__esModule", { value: !0 });
|
|
4151
4145
|
Ne.getData = Ne.KeywordCxt = Ne.validateFunctionCode = void 0;
|
|
4152
|
-
const
|
|
4153
|
-
function
|
|
4154
|
-
if (
|
|
4155
|
-
|
|
4146
|
+
const Js = Rt, is = Qt, Yr = ze, yr = Qt, Ha = br, Kt = Le, Or = Ye, U = B, V = He, Va = he, We = X, Ht = Zt;
|
|
4147
|
+
function za(t) {
|
|
4148
|
+
if (Qs(t) && (Xs(t), Zs(t))) {
|
|
4149
|
+
Ba(t);
|
|
4156
4150
|
return;
|
|
4157
4151
|
}
|
|
4158
|
-
|
|
4152
|
+
Ys(t, () => (0, Js.topBoolOrEmptySchema)(t));
|
|
4159
4153
|
}
|
|
4160
|
-
Ne.validateFunctionCode =
|
|
4161
|
-
function
|
|
4154
|
+
Ne.validateFunctionCode = za;
|
|
4155
|
+
function Ys({ gen: t, validateName: e, schema: r, schemaEnv: n, opts: s }, i) {
|
|
4162
4156
|
s.code.es5 ? t.func(e, (0, U._)`${V.default.data}, ${V.default.valCxt}`, n.$async, () => {
|
|
4163
|
-
t.code((0, U._)`"use strict"; ${
|
|
4164
|
-
}) : t.func(e, (0, U._)`${V.default.data}, ${
|
|
4157
|
+
t.code((0, U._)`"use strict"; ${os(r, s)}`), Ka(t, s), t.code(i);
|
|
4158
|
+
}) : t.func(e, (0, U._)`${V.default.data}, ${Wa(s)}`, n.$async, () => t.code(os(r, s)).code(i));
|
|
4165
4159
|
}
|
|
4166
|
-
function
|
|
4160
|
+
function Wa(t) {
|
|
4167
4161
|
return (0, U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${t.dynamicRef ? (0, U._)`, ${V.default.dynamicAnchors}={}` : U.nil}}={}`;
|
|
4168
4162
|
}
|
|
4169
|
-
function
|
|
4163
|
+
function Ka(t, e) {
|
|
4170
4164
|
t.if(V.default.valCxt, () => {
|
|
4171
4165
|
t.var(V.default.instancePath, (0, U._)`${V.default.valCxt}.${V.default.instancePath}`), t.var(V.default.parentData, (0, U._)`${V.default.valCxt}.${V.default.parentData}`), t.var(V.default.parentDataProperty, (0, U._)`${V.default.valCxt}.${V.default.parentDataProperty}`), t.var(V.default.rootData, (0, U._)`${V.default.valCxt}.${V.default.rootData}`), e.dynamicRef && t.var(V.default.dynamicAnchors, (0, U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`);
|
|
4172
4166
|
}, () => {
|
|
4173
4167
|
t.var(V.default.instancePath, (0, U._)`""`), t.var(V.default.parentData, (0, U._)`undefined`), t.var(V.default.parentDataProperty, (0, U._)`undefined`), t.var(V.default.rootData, V.default.data), e.dynamicRef && t.var(V.default.dynamicAnchors, (0, U._)`{}`);
|
|
4174
4168
|
});
|
|
4175
4169
|
}
|
|
4176
|
-
function
|
|
4170
|
+
function Ba(t) {
|
|
4177
4171
|
const { schema: e, opts: r, gen: n } = t;
|
|
4178
|
-
|
|
4179
|
-
r.$comment && e.$comment &&
|
|
4172
|
+
Ys(t, () => {
|
|
4173
|
+
r.$comment && e.$comment && ti(t), Za(t), n.let(V.default.vErrors, null), n.let(V.default.errors, 0), r.unevaluated && Ga(t), ei(t), ec(t);
|
|
4180
4174
|
});
|
|
4181
4175
|
}
|
|
4182
|
-
function
|
|
4176
|
+
function Ga(t) {
|
|
4183
4177
|
const { gen: e, validateName: r } = t;
|
|
4184
4178
|
t.evaluated = e.const("evaluated", (0, U._)`${r}.evaluated`), e.if((0, U._)`${t.evaluated}.dynamicProps`, () => e.assign((0, U._)`${t.evaluated}.props`, (0, U._)`undefined`)), e.if((0, U._)`${t.evaluated}.dynamicItems`, () => e.assign((0, U._)`${t.evaluated}.items`, (0, U._)`undefined`));
|
|
4185
4179
|
}
|
|
4186
|
-
function
|
|
4180
|
+
function os(t, e) {
|
|
4187
4181
|
const r = typeof t == "object" && t[e.schemaId];
|
|
4188
4182
|
return r && (e.code.source || e.code.process) ? (0, U._)`/*# sourceURL=${r} */` : U.nil;
|
|
4189
4183
|
}
|
|
4190
|
-
function
|
|
4191
|
-
if (
|
|
4192
|
-
|
|
4184
|
+
function xa(t, e) {
|
|
4185
|
+
if (Qs(t) && (Xs(t), Zs(t))) {
|
|
4186
|
+
Ja(t, e);
|
|
4193
4187
|
return;
|
|
4194
4188
|
}
|
|
4195
|
-
(0,
|
|
4189
|
+
(0, Js.boolOrEmptySchema)(t, e);
|
|
4196
4190
|
}
|
|
4197
|
-
function
|
|
4191
|
+
function Zs({ schema: t, self: e }) {
|
|
4198
4192
|
if (typeof t == "boolean")
|
|
4199
4193
|
return !t;
|
|
4200
4194
|
for (const r in t)
|
|
@@ -4202,41 +4196,41 @@ function Qs({ schema: t, self: e }) {
|
|
|
4202
4196
|
return !0;
|
|
4203
4197
|
return !1;
|
|
4204
4198
|
}
|
|
4205
|
-
function
|
|
4199
|
+
function Qs(t) {
|
|
4206
4200
|
return typeof t.schema != "boolean";
|
|
4207
4201
|
}
|
|
4208
|
-
function
|
|
4202
|
+
function Ja(t, e) {
|
|
4209
4203
|
const { schema: r, gen: n, opts: s } = t;
|
|
4210
|
-
s.$comment && r.$comment &&
|
|
4204
|
+
s.$comment && r.$comment && ti(t), Qa(t), Xa(t);
|
|
4211
4205
|
const i = n.const("_errs", V.default.errors);
|
|
4212
|
-
|
|
4206
|
+
ei(t, i), n.var(e, (0, U._)`${i} === ${V.default.errors}`);
|
|
4213
4207
|
}
|
|
4214
|
-
function
|
|
4215
|
-
(0, We.checkUnknownRules)(t),
|
|
4208
|
+
function Xs(t) {
|
|
4209
|
+
(0, We.checkUnknownRules)(t), Ya(t);
|
|
4216
4210
|
}
|
|
4217
|
-
function
|
|
4211
|
+
function ei(t, e) {
|
|
4218
4212
|
if (t.opts.jtd)
|
|
4219
|
-
return
|
|
4220
|
-
const r = (0,
|
|
4221
|
-
|
|
4213
|
+
return as(t, [], !1, e);
|
|
4214
|
+
const r = (0, is.getSchemaTypes)(t.schema), n = (0, is.coerceAndCheckDataType)(t, r);
|
|
4215
|
+
as(t, r, !n, e);
|
|
4222
4216
|
}
|
|
4223
|
-
function
|
|
4217
|
+
function Ya(t) {
|
|
4224
4218
|
const { schema: e, errSchemaPath: r, opts: n, self: s } = t;
|
|
4225
4219
|
e.$ref && n.ignoreKeywordsWithRef && (0, We.schemaHasRulesButRef)(e, s.RULES) && s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`);
|
|
4226
4220
|
}
|
|
4227
|
-
function
|
|
4221
|
+
function Za(t) {
|
|
4228
4222
|
const { schema: e, opts: r } = t;
|
|
4229
4223
|
e.default !== void 0 && r.useDefaults && r.strictSchema && (0, We.checkStrictMode)(t, "default is ignored in the schema root");
|
|
4230
4224
|
}
|
|
4231
|
-
function
|
|
4225
|
+
function Qa(t) {
|
|
4232
4226
|
const e = t.schema[t.opts.schemaId];
|
|
4233
|
-
e && (t.baseId = (0,
|
|
4227
|
+
e && (t.baseId = (0, Va.resolveUrl)(t.opts.uriResolver, t.baseId, e));
|
|
4234
4228
|
}
|
|
4235
|
-
function
|
|
4229
|
+
function Xa(t) {
|
|
4236
4230
|
if (t.schema.$async && !t.schemaEnv.$async)
|
|
4237
4231
|
throw new Error("async schema in sync schema");
|
|
4238
4232
|
}
|
|
4239
|
-
function
|
|
4233
|
+
function ti({ gen: t, schemaEnv: e, schema: r, errSchemaPath: n, opts: s }) {
|
|
4240
4234
|
const i = r.$comment;
|
|
4241
4235
|
if (s.$comment === !0)
|
|
4242
4236
|
t.code((0, U._)`${V.default.self}.logger.log(${i})`);
|
|
@@ -4245,82 +4239,82 @@ function ri({ gen: t, schemaEnv: e, schema: r, errSchemaPath: n, opts: s }) {
|
|
|
4245
4239
|
t.code((0, U._)`${V.default.self}.opts.$comment(${i}, ${c}, ${l}.schema)`);
|
|
4246
4240
|
}
|
|
4247
4241
|
}
|
|
4248
|
-
function
|
|
4242
|
+
function ec(t) {
|
|
4249
4243
|
const { gen: e, schemaEnv: r, validateName: n, ValidationError: s, opts: i } = t;
|
|
4250
|
-
r.$async ? e.if((0, U._)`${V.default.errors} === 0`, () => e.return(V.default.data), () => e.throw((0, U._)`new ${s}(${V.default.vErrors})`)) : (e.assign((0, U._)`${n}.errors`, V.default.vErrors), i.unevaluated &&
|
|
4244
|
+
r.$async ? e.if((0, U._)`${V.default.errors} === 0`, () => e.return(V.default.data), () => e.throw((0, U._)`new ${s}(${V.default.vErrors})`)) : (e.assign((0, U._)`${n}.errors`, V.default.vErrors), i.unevaluated && tc(t), e.return((0, U._)`${V.default.errors} === 0`));
|
|
4251
4245
|
}
|
|
4252
|
-
function
|
|
4246
|
+
function tc({ gen: t, evaluated: e, props: r, items: n }) {
|
|
4253
4247
|
r instanceof U.Name && t.assign((0, U._)`${e}.props`, r), n instanceof U.Name && t.assign((0, U._)`${e}.items`, n);
|
|
4254
4248
|
}
|
|
4255
|
-
function
|
|
4249
|
+
function as(t, e, r, n) {
|
|
4256
4250
|
const { gen: s, schema: i, data: c, allErrors: l, opts: m, self: u } = t, { RULES: p } = u;
|
|
4257
4251
|
if (i.$ref && (m.ignoreKeywordsWithRef || !(0, We.schemaHasRulesButRef)(i, p))) {
|
|
4258
|
-
s.block(() =>
|
|
4252
|
+
s.block(() => si(t, "$ref", p.all.$ref.definition));
|
|
4259
4253
|
return;
|
|
4260
4254
|
}
|
|
4261
|
-
m.jtd ||
|
|
4255
|
+
m.jtd || rc(t, e), s.block(() => {
|
|
4262
4256
|
for (const k of p.rules)
|
|
4263
4257
|
g(k);
|
|
4264
4258
|
g(p.post);
|
|
4265
4259
|
});
|
|
4266
4260
|
function g(k) {
|
|
4267
|
-
(0,
|
|
4261
|
+
(0, Yr.shouldUseGroup)(i, k) && (k.type ? (s.if((0, yr.checkDataType)(k.type, c, m.strictNumbers)), cs(t, k), e.length === 1 && e[0] === k.type && r && (s.else(), (0, yr.reportTypeError)(t)), s.endIf()) : cs(t, k), l || s.if((0, U._)`${V.default.errors} === ${n || 0}`));
|
|
4268
4262
|
}
|
|
4269
4263
|
}
|
|
4270
|
-
function
|
|
4264
|
+
function cs(t, e) {
|
|
4271
4265
|
const { gen: r, schema: n, opts: { useDefaults: s } } = t;
|
|
4272
|
-
s && (0,
|
|
4266
|
+
s && (0, Ha.assignDefaults)(t, e.type), r.block(() => {
|
|
4273
4267
|
for (const i of e.rules)
|
|
4274
|
-
(0,
|
|
4268
|
+
(0, Yr.shouldUseRule)(n, i) && si(t, i.keyword, i.definition, e.type);
|
|
4275
4269
|
});
|
|
4276
4270
|
}
|
|
4277
|
-
function
|
|
4278
|
-
t.schemaEnv.meta || !t.opts.strictTypes || (
|
|
4271
|
+
function rc(t, e) {
|
|
4272
|
+
t.schemaEnv.meta || !t.opts.strictTypes || (nc(t, e), t.opts.allowUnionTypes || sc(t, e), ic(t, t.dataTypes));
|
|
4279
4273
|
}
|
|
4280
|
-
function
|
|
4274
|
+
function nc(t, e) {
|
|
4281
4275
|
if (e.length) {
|
|
4282
4276
|
if (!t.dataTypes.length) {
|
|
4283
4277
|
t.dataTypes = e;
|
|
4284
4278
|
return;
|
|
4285
4279
|
}
|
|
4286
4280
|
e.forEach((r) => {
|
|
4287
|
-
|
|
4288
|
-
}),
|
|
4281
|
+
ri(t.dataTypes, r) || Zr(t, `type "${r}" not allowed by context "${t.dataTypes.join(",")}"`);
|
|
4282
|
+
}), ac(t, e);
|
|
4289
4283
|
}
|
|
4290
4284
|
}
|
|
4291
|
-
function
|
|
4292
|
-
e.length > 1 && !(e.length === 2 && e.includes("null")) &&
|
|
4285
|
+
function sc(t, e) {
|
|
4286
|
+
e.length > 1 && !(e.length === 2 && e.includes("null")) && Zr(t, "use allowUnionTypes to allow union type keyword");
|
|
4293
4287
|
}
|
|
4294
|
-
function
|
|
4288
|
+
function ic(t, e) {
|
|
4295
4289
|
const r = t.self.RULES.all;
|
|
4296
4290
|
for (const n in r) {
|
|
4297
4291
|
const s = r[n];
|
|
4298
|
-
if (typeof s == "object" && (0,
|
|
4292
|
+
if (typeof s == "object" && (0, Yr.shouldUseRule)(t.schema, s)) {
|
|
4299
4293
|
const { type: i } = s.definition;
|
|
4300
|
-
i.length && !i.some((c) =>
|
|
4294
|
+
i.length && !i.some((c) => oc(e, c)) && Zr(t, `missing type "${i.join(",")}" for keyword "${n}"`);
|
|
4301
4295
|
}
|
|
4302
4296
|
}
|
|
4303
4297
|
}
|
|
4304
|
-
function
|
|
4298
|
+
function oc(t, e) {
|
|
4305
4299
|
return t.includes(e) || e === "number" && t.includes("integer");
|
|
4306
4300
|
}
|
|
4307
|
-
function
|
|
4301
|
+
function ri(t, e) {
|
|
4308
4302
|
return t.includes(e) || e === "integer" && t.includes("number");
|
|
4309
4303
|
}
|
|
4310
|
-
function
|
|
4304
|
+
function ac(t, e) {
|
|
4311
4305
|
const r = [];
|
|
4312
4306
|
for (const n of t.dataTypes)
|
|
4313
|
-
|
|
4307
|
+
ri(e, n) ? r.push(n) : e.includes("integer") && n === "number" && r.push("integer");
|
|
4314
4308
|
t.dataTypes = r;
|
|
4315
4309
|
}
|
|
4316
|
-
function
|
|
4310
|
+
function Zr(t, e) {
|
|
4317
4311
|
const r = t.schemaEnv.baseId + t.errSchemaPath;
|
|
4318
4312
|
e += ` at "${r}" (strictTypes)`, (0, We.checkStrictMode)(t, e, t.opts.strictTypes);
|
|
4319
4313
|
}
|
|
4320
|
-
class
|
|
4314
|
+
class ni {
|
|
4321
4315
|
constructor(e, r, n) {
|
|
4322
4316
|
if ((0, Kt.validateKeywordUsage)(e, r, n), this.gen = e.gen, this.allErrors = e.allErrors, this.keyword = n, this.data = e.data, this.schema = e.schema[n], this.$data = r.$data && e.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, We.schemaRefOrVal)(e, this.schema, n, this.$data), this.schemaType = r.schemaType, this.parentSchema = e.schema, this.params = {}, this.it = e, this.def = r, this.$data)
|
|
4323
|
-
this.schemaCode = e.gen.const("vSchema",
|
|
4317
|
+
this.schemaCode = e.gen.const("vSchema", ii(this.$data, e));
|
|
4324
4318
|
else if (this.schemaCode = this.schemaValue, !(0, Kt.validSchemaType)(this.schema, r.schemaType, r.allowUndefined))
|
|
4325
4319
|
throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);
|
|
4326
4320
|
("code" in r ? r.trackErrors : r.errors !== !1) && (this.errsCount = e.gen.const("_errs", V.default.errors));
|
|
@@ -4406,7 +4400,7 @@ class si {
|
|
|
4406
4400
|
const n = (0, Or.getSubschema)(this.it, e);
|
|
4407
4401
|
(0, Or.extendSubschemaData)(n, this.it, e), (0, Or.extendSubschemaMode)(n, e);
|
|
4408
4402
|
const s = { ...this.it, ...n, items: void 0, props: void 0 };
|
|
4409
|
-
return
|
|
4403
|
+
return xa(s, r), s;
|
|
4410
4404
|
}
|
|
4411
4405
|
mergeEvaluated(e, r) {
|
|
4412
4406
|
const { it: n, gen: s } = this;
|
|
@@ -4418,22 +4412,22 @@ class si {
|
|
|
4418
4412
|
return s.if(r, () => this.mergeEvaluated(e, U.Name)), !0;
|
|
4419
4413
|
}
|
|
4420
4414
|
}
|
|
4421
|
-
Ne.KeywordCxt =
|
|
4422
|
-
function
|
|
4423
|
-
const s = new
|
|
4415
|
+
Ne.KeywordCxt = ni;
|
|
4416
|
+
function si(t, e, r, n) {
|
|
4417
|
+
const s = new ni(t, r, e);
|
|
4424
4418
|
"code" in r ? r.code(s, n) : s.$data && r.validate ? (0, Kt.funcKeywordCode)(s, r) : "macro" in r ? (0, Kt.macroKeywordCode)(s, r) : (r.compile || r.validate) && (0, Kt.funcKeywordCode)(s, r);
|
|
4425
4419
|
}
|
|
4426
|
-
const
|
|
4427
|
-
function
|
|
4420
|
+
const cc = /^\/(?:[^~]|~0|~1)*$/, lc = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
4421
|
+
function ii(t, { dataLevel: e, dataNames: r, dataPathArr: n }) {
|
|
4428
4422
|
let s, i;
|
|
4429
4423
|
if (t === "")
|
|
4430
4424
|
return V.default.rootData;
|
|
4431
4425
|
if (t[0] === "/") {
|
|
4432
|
-
if (!
|
|
4426
|
+
if (!cc.test(t))
|
|
4433
4427
|
throw new Error(`Invalid JSON-pointer: ${t}`);
|
|
4434
4428
|
s = t, i = V.default.rootData;
|
|
4435
4429
|
} else {
|
|
4436
|
-
const u =
|
|
4430
|
+
const u = lc.exec(t);
|
|
4437
4431
|
if (!u)
|
|
4438
4432
|
throw new Error(`Invalid JSON-pointer: ${t}`);
|
|
4439
4433
|
const p = +u[1];
|
|
@@ -4456,28 +4450,28 @@ function oi(t, { dataLevel: e, dataNames: r, dataPathArr: n }) {
|
|
|
4456
4450
|
return `Cannot access ${u} ${p} levels up, current level is ${e}`;
|
|
4457
4451
|
}
|
|
4458
4452
|
}
|
|
4459
|
-
Ne.getData =
|
|
4453
|
+
Ne.getData = ii;
|
|
4460
4454
|
var Xt = {};
|
|
4461
4455
|
Object.defineProperty(Xt, "__esModule", { value: !0 });
|
|
4462
|
-
class
|
|
4456
|
+
class uc extends Error {
|
|
4463
4457
|
constructor(e) {
|
|
4464
4458
|
super("validation failed"), this.errors = e, this.ajv = this.validation = !0;
|
|
4465
4459
|
}
|
|
4466
4460
|
}
|
|
4467
|
-
Xt.default =
|
|
4461
|
+
Xt.default = uc;
|
|
4468
4462
|
var er = {};
|
|
4469
4463
|
Object.defineProperty(er, "__esModule", { value: !0 });
|
|
4470
4464
|
const Nr = he;
|
|
4471
|
-
class
|
|
4465
|
+
class dc extends Error {
|
|
4472
4466
|
constructor(e, r, n, s) {
|
|
4473
4467
|
super(s || `can't resolve reference ${n} from id ${r}`), this.missingRef = (0, Nr.resolveUrl)(e, r, n), this.missingSchema = (0, Nr.normalizeId)((0, Nr.getFullPath)(e, this.missingRef));
|
|
4474
4468
|
}
|
|
4475
4469
|
}
|
|
4476
|
-
er.default =
|
|
4470
|
+
er.default = dc;
|
|
4477
4471
|
var ve = {};
|
|
4478
4472
|
Object.defineProperty(ve, "__esModule", { value: !0 });
|
|
4479
4473
|
ve.resolveSchema = ve.getCompilingSchema = ve.resolveRef = ve.compileSchema = ve.SchemaEnv = void 0;
|
|
4480
|
-
const Te = B,
|
|
4474
|
+
const Te = B, pc = Xt, nt = He, Oe = he, ls = X, fc = Ne;
|
|
4481
4475
|
class Pr {
|
|
4482
4476
|
constructor(e) {
|
|
4483
4477
|
var r;
|
|
@@ -4487,14 +4481,14 @@ class Pr {
|
|
|
4487
4481
|
}
|
|
4488
4482
|
}
|
|
4489
4483
|
ve.SchemaEnv = Pr;
|
|
4490
|
-
function
|
|
4491
|
-
const e =
|
|
4484
|
+
function Qr(t) {
|
|
4485
|
+
const e = oi.call(this, t);
|
|
4492
4486
|
if (e)
|
|
4493
4487
|
return e;
|
|
4494
4488
|
const r = (0, Oe.getFullPath)(this.opts.uriResolver, t.root.baseId), { es5: n, lines: s } = this.opts.code, { ownProperties: i } = this.opts, c = new Te.CodeGen(this.scope, { es5: n, lines: s, ownProperties: i });
|
|
4495
4489
|
let l;
|
|
4496
4490
|
t.$async && (l = c.scopeValue("Error", {
|
|
4497
|
-
ref:
|
|
4491
|
+
ref: pc.default,
|
|
4498
4492
|
code: (0, Te._)`require("ajv/dist/runtime/validation_error").default`
|
|
4499
4493
|
}));
|
|
4500
4494
|
const m = c.scopeName("validate");
|
|
@@ -4525,7 +4519,7 @@ function Xr(t) {
|
|
|
4525
4519
|
};
|
|
4526
4520
|
let p;
|
|
4527
4521
|
try {
|
|
4528
|
-
this._compilations.add(t), (0,
|
|
4522
|
+
this._compilations.add(t), (0, fc.validateFunctionCode)(u), c.optimize(this.opts.code.optimize);
|
|
4529
4523
|
const g = c.toString();
|
|
4530
4524
|
p = `${c.scopeRefs(nt.default.scope)}return ${g}`, this.opts.code.process && (p = this.opts.code.process(p, t));
|
|
4531
4525
|
const C = new Function(`${nt.default.self}`, `${nt.default.scope}`, p)(this, this.scope.get());
|
|
@@ -4545,35 +4539,35 @@ function Xr(t) {
|
|
|
4545
4539
|
this._compilations.delete(t);
|
|
4546
4540
|
}
|
|
4547
4541
|
}
|
|
4548
|
-
ve.compileSchema =
|
|
4549
|
-
function
|
|
4542
|
+
ve.compileSchema = Qr;
|
|
4543
|
+
function hc(t, e, r) {
|
|
4550
4544
|
var n;
|
|
4551
4545
|
r = (0, Oe.resolveUrl)(this.opts.uriResolver, e, r);
|
|
4552
4546
|
const s = t.refs[r];
|
|
4553
4547
|
if (s)
|
|
4554
4548
|
return s;
|
|
4555
|
-
let i =
|
|
4549
|
+
let i = gc.call(this, t, r);
|
|
4556
4550
|
if (i === void 0) {
|
|
4557
4551
|
const c = (n = t.localRefs) === null || n === void 0 ? void 0 : n[r], { schemaId: l } = this.opts;
|
|
4558
4552
|
c && (i = new Pr({ schema: c, schemaId: l, root: t, baseId: e }));
|
|
4559
4553
|
}
|
|
4560
4554
|
if (i !== void 0)
|
|
4561
|
-
return t.refs[r] =
|
|
4555
|
+
return t.refs[r] = mc.call(this, i);
|
|
4562
4556
|
}
|
|
4563
|
-
ve.resolveRef =
|
|
4564
|
-
function
|
|
4565
|
-
return (0, Oe.inlineRef)(t.schema, this.opts.inlineRefs) ? t.schema : t.validate ? t :
|
|
4557
|
+
ve.resolveRef = hc;
|
|
4558
|
+
function mc(t) {
|
|
4559
|
+
return (0, Oe.inlineRef)(t.schema, this.opts.inlineRefs) ? t.schema : t.validate ? t : Qr.call(this, t);
|
|
4566
4560
|
}
|
|
4567
|
-
function
|
|
4561
|
+
function oi(t) {
|
|
4568
4562
|
for (const e of this._compilations)
|
|
4569
|
-
if (
|
|
4563
|
+
if (yc(e, t))
|
|
4570
4564
|
return e;
|
|
4571
4565
|
}
|
|
4572
|
-
ve.getCompilingSchema =
|
|
4573
|
-
function
|
|
4566
|
+
ve.getCompilingSchema = oi;
|
|
4567
|
+
function yc(t, e) {
|
|
4574
4568
|
return t.schema === e.schema && t.root === e.root && t.baseId === e.baseId;
|
|
4575
4569
|
}
|
|
4576
|
-
function
|
|
4570
|
+
function gc(t, e) {
|
|
4577
4571
|
let r;
|
|
4578
4572
|
for (; typeof (r = this.refs[e]) == "string"; )
|
|
4579
4573
|
e = r;
|
|
@@ -4590,7 +4584,7 @@ function Er(t, e) {
|
|
|
4590
4584
|
return typeof l?.schema != "object" ? void 0 : Cr.call(this, r, l);
|
|
4591
4585
|
}
|
|
4592
4586
|
if (typeof c?.schema == "object") {
|
|
4593
|
-
if (c.validate ||
|
|
4587
|
+
if (c.validate || Qr.call(this, c), i === (0, Oe.normalizeId)(e)) {
|
|
4594
4588
|
const { schema: l } = c, { schemaId: m } = this.opts, u = l[m];
|
|
4595
4589
|
return u && (s = (0, Oe.resolveUrl)(this.opts.uriResolver, s, u)), new Pr({ schema: l, schemaId: m, root: t, baseId: s });
|
|
4596
4590
|
}
|
|
@@ -4598,7 +4592,7 @@ function Er(t, e) {
|
|
|
4598
4592
|
}
|
|
4599
4593
|
}
|
|
4600
4594
|
ve.resolveSchema = Er;
|
|
4601
|
-
const
|
|
4595
|
+
const $c = /* @__PURE__ */ new Set([
|
|
4602
4596
|
"properties",
|
|
4603
4597
|
"patternProperties",
|
|
4604
4598
|
"enum",
|
|
@@ -4612,15 +4606,15 @@ function Cr(t, { baseId: e, schema: r, root: n }) {
|
|
|
4612
4606
|
for (const l of t.fragment.slice(1).split("/")) {
|
|
4613
4607
|
if (typeof r == "boolean")
|
|
4614
4608
|
return;
|
|
4615
|
-
const m = r[(0,
|
|
4609
|
+
const m = r[(0, ls.unescapeFragment)(l)];
|
|
4616
4610
|
if (m === void 0)
|
|
4617
4611
|
return;
|
|
4618
4612
|
r = m;
|
|
4619
4613
|
const u = typeof r == "object" && r[this.opts.schemaId];
|
|
4620
|
-
|
|
4614
|
+
!$c.has(l) && u && (e = (0, Oe.resolveUrl)(this.opts.uriResolver, e, u));
|
|
4621
4615
|
}
|
|
4622
4616
|
let i;
|
|
4623
|
-
if (typeof r != "boolean" && r.$ref && !(0,
|
|
4617
|
+
if (typeof r != "boolean" && r.$ref && !(0, ls.schemaHasRulesButRef)(r, this.RULES)) {
|
|
4624
4618
|
const l = (0, Oe.resolveUrl)(this.opts.uriResolver, e, r.$ref);
|
|
4625
4619
|
i = Er.call(this, n, l);
|
|
4626
4620
|
}
|
|
@@ -4628,9 +4622,9 @@ function Cr(t, { baseId: e, schema: r, root: n }) {
|
|
|
4628
4622
|
if (i = i || new Pr({ schema: r, schemaId: c, root: n, baseId: e }), i.schema !== i.root.schema)
|
|
4629
4623
|
return i;
|
|
4630
4624
|
}
|
|
4631
|
-
const
|
|
4625
|
+
const _c = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", vc = "Meta-schema for $data reference (JSON AnySchema extension proposal)", wc = "object", bc = [
|
|
4632
4626
|
"$data"
|
|
4633
|
-
],
|
|
4627
|
+
], Pc = {
|
|
4634
4628
|
$data: {
|
|
4635
4629
|
type: "string",
|
|
4636
4630
|
anyOf: [
|
|
@@ -4642,20 +4636,20 @@ const vc = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/
|
|
|
4642
4636
|
}
|
|
4643
4637
|
]
|
|
4644
4638
|
}
|
|
4645
|
-
},
|
|
4646
|
-
$id:
|
|
4647
|
-
description:
|
|
4648
|
-
type:
|
|
4649
|
-
required:
|
|
4650
|
-
properties:
|
|
4651
|
-
additionalProperties:
|
|
4639
|
+
}, Ec = !1, Sc = {
|
|
4640
|
+
$id: _c,
|
|
4641
|
+
description: vc,
|
|
4642
|
+
type: wc,
|
|
4643
|
+
required: bc,
|
|
4644
|
+
properties: Pc,
|
|
4645
|
+
additionalProperties: Ec
|
|
4652
4646
|
};
|
|
4653
|
-
var
|
|
4647
|
+
var Xr = {}, Fr = { exports: {} };
|
|
4654
4648
|
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
4655
4649
|
(function(t, e) {
|
|
4656
4650
|
(function(r, n) {
|
|
4657
4651
|
n(e);
|
|
4658
|
-
})(
|
|
4652
|
+
})(Ko, function(r) {
|
|
4659
4653
|
function n() {
|
|
4660
4654
|
for (var d = arguments.length, a = Array(d), h = 0; h < d; h++)
|
|
4661
4655
|
a[h] = arguments[h];
|
|
@@ -4853,9 +4847,9 @@ var en = {}, Fr = { exports: {} };
|
|
|
4853
4847
|
pe - b > Z((E - L) / Ee) && de("overflow"), L += (pe - b) * Ee, b = pe;
|
|
4854
4848
|
var Me = !0, rt = !1, Ve = void 0;
|
|
4855
4849
|
try {
|
|
4856
|
-
for (var Ut = a[Symbol.iterator](),
|
|
4857
|
-
var
|
|
4858
|
-
if (
|
|
4850
|
+
for (var Ut = a[Symbol.iterator](), Ln; !(Me = (Ln = Ut.next()).done); Me = !0) {
|
|
4851
|
+
var Hn = Ln.value;
|
|
4852
|
+
if (Hn < b && ++L > E && de("overflow"), Hn == b) {
|
|
4859
4853
|
for (
|
|
4860
4854
|
var nr = L, sr = S;
|
|
4861
4855
|
;
|
|
@@ -4865,8 +4859,8 @@ var en = {}, Fr = { exports: {} };
|
|
|
4865
4859
|
var ir = sr <= H ? _ : sr >= H + y ? y : sr - H;
|
|
4866
4860
|
if (nr < ir)
|
|
4867
4861
|
break;
|
|
4868
|
-
var
|
|
4869
|
-
h.push(be(q(ir +
|
|
4862
|
+
var Vn = nr - ir, zn = S - ir;
|
|
4863
|
+
h.push(be(q(ir + Vn % zn, 0))), nr = Z(Vn / zn);
|
|
4870
4864
|
}
|
|
4871
4865
|
h.push(be(q(nr, 0))), H = $(L, Ee, se == W), L = 0, ++se;
|
|
4872
4866
|
}
|
|
@@ -5079,13 +5073,13 @@ var en = {}, Fr = { exports: {} };
|
|
|
5079
5073
|
var P = String(a.scheme).toLowerCase() === "https";
|
|
5080
5074
|
return (a.port === (P ? 443 : 80) || a.port === "") && (a.port = void 0), a.path || (a.path = "/"), a;
|
|
5081
5075
|
}
|
|
5082
|
-
},
|
|
5076
|
+
}, kn = {
|
|
5083
5077
|
scheme: "https",
|
|
5084
5078
|
domainHost: et.domainHost,
|
|
5085
5079
|
parse: et.parse,
|
|
5086
5080
|
serialize: et.serialize
|
|
5087
5081
|
};
|
|
5088
|
-
function
|
|
5082
|
+
function In(d) {
|
|
5089
5083
|
return typeof d.secure == "boolean" ? d.secure : String(d.scheme).toLowerCase() === "wss";
|
|
5090
5084
|
}
|
|
5091
5085
|
var Mt = {
|
|
@@ -5093,26 +5087,26 @@ var en = {}, Fr = { exports: {} };
|
|
|
5093
5087
|
domainHost: !0,
|
|
5094
5088
|
parse: function(a, h) {
|
|
5095
5089
|
var P = a;
|
|
5096
|
-
return P.secure =
|
|
5090
|
+
return P.secure = In(P), P.resourceName = (P.path || "/") + (P.query ? "?" + P.query : ""), P.path = void 0, P.query = void 0, P;
|
|
5097
5091
|
},
|
|
5098
5092
|
serialize: function(a, h) {
|
|
5099
|
-
if ((a.port === (
|
|
5093
|
+
if ((a.port === (In(a) ? 443 : 80) || a.port === "") && (a.port = void 0), typeof a.secure == "boolean" && (a.scheme = a.secure ? "wss" : "ws", a.secure = void 0), a.resourceName) {
|
|
5100
5094
|
var P = a.resourceName.split("?"), b = k(P, 2), L = b[0], H = b[1];
|
|
5101
5095
|
a.path = L && L !== "/" ? L : void 0, a.query = H, a.resourceName = void 0;
|
|
5102
5096
|
}
|
|
5103
5097
|
return a.fragment = void 0, a;
|
|
5104
5098
|
}
|
|
5105
|
-
},
|
|
5099
|
+
}, An = {
|
|
5106
5100
|
scheme: "wss",
|
|
5107
5101
|
domainHost: Mt.domainHost,
|
|
5108
5102
|
parse: Mt.parse,
|
|
5109
5103
|
serialize: Mt.serialize
|
|
5110
|
-
},
|
|
5104
|
+
}, gi = {}, Dn = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", De = "[0-9A-Fa-f]", $i = s(s("%[EFef]" + De + "%" + De + De + "%" + De + De) + "|" + s("%[89A-Fa-f]" + De + "%" + De + De) + "|" + s("%" + De + De)), _i = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", vi = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", wi = n(vi, '[\\"\\\\]'), bi = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", Pi = new RegExp(Dn, "g"), $t = new RegExp($i, "g"), Ei = new RegExp(n("[^]", _i, "[\\.]", '[\\"]', wi), "g"), qn = new RegExp(n("[^]", Dn, bi), "g"), Si = qn;
|
|
5111
5105
|
function Tr(d) {
|
|
5112
5106
|
var a = x(d);
|
|
5113
|
-
return a.match(
|
|
5107
|
+
return a.match(Pi) ? a : d;
|
|
5114
5108
|
}
|
|
5115
|
-
var
|
|
5109
|
+
var Fn = {
|
|
5116
5110
|
scheme: "mailto",
|
|
5117
5111
|
parse: function(a, h) {
|
|
5118
5112
|
var P = a, b = P.to = P.path ? P.path.split(",") : [];
|
|
@@ -5156,7 +5150,7 @@ var en = {}, Fr = { exports: {} };
|
|
|
5156
5150
|
var P = a, b = l(a.to);
|
|
5157
5151
|
if (b) {
|
|
5158
5152
|
for (var L = 0, H = b.length; L < H; ++L) {
|
|
5159
|
-
var Q = String(b[L]), re = Q.lastIndexOf("@"), ce = Q.slice(0, re).replace($t, Tr).replace($t, c).replace(
|
|
5153
|
+
var Q = String(b[L]), re = Q.lastIndexOf("@"), ce = Q.slice(0, re).replace($t, Tr).replace($t, c).replace(Ei, M), J = Q.slice(re + 1);
|
|
5160
5154
|
try {
|
|
5161
5155
|
J = h.iri ? N.toUnicode(J) : N.toASCII(Pe(J, h).toLowerCase());
|
|
5162
5156
|
} catch (se) {
|
|
@@ -5170,13 +5164,13 @@ var en = {}, Fr = { exports: {} };
|
|
|
5170
5164
|
a.subject && (te.subject = a.subject), a.body && (te.body = a.body);
|
|
5171
5165
|
var le = [];
|
|
5172
5166
|
for (var W in te)
|
|
5173
|
-
te[W] !==
|
|
5167
|
+
te[W] !== gi[W] && le.push(W.replace($t, Tr).replace($t, c).replace(qn, M) + "=" + te[W].replace($t, Tr).replace($t, c).replace(Si, M));
|
|
5174
5168
|
return le.length && (P.query = le.join("&")), P;
|
|
5175
5169
|
}
|
|
5176
|
-
},
|
|
5170
|
+
}, Ti = /^([^\:]+)\:(.*)/, Mn = {
|
|
5177
5171
|
scheme: "urn",
|
|
5178
5172
|
parse: function(a, h) {
|
|
5179
|
-
var P = a.path && a.path.match(
|
|
5173
|
+
var P = a.path && a.path.match(Ti), b = a;
|
|
5180
5174
|
if (P) {
|
|
5181
5175
|
var L = h.scheme || b.scheme || "urn", H = P[1].toLowerCase(), Q = P[2], re = L + ":" + (h.nid || H), ce = F[re];
|
|
5182
5176
|
b.nid = H, b.nss = Q, b.path = void 0, ce && (b = ce.parse(b, h));
|
|
@@ -5190,25 +5184,25 @@ var en = {}, Fr = { exports: {} };
|
|
|
5190
5184
|
var Q = a, re = a.nss;
|
|
5191
5185
|
return Q.path = (b || h.nid) + ":" + re, Q;
|
|
5192
5186
|
}
|
|
5193
|
-
},
|
|
5187
|
+
}, Ri = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Un = {
|
|
5194
5188
|
scheme: "urn:uuid",
|
|
5195
5189
|
parse: function(a, h) {
|
|
5196
5190
|
var P = a;
|
|
5197
|
-
return P.uuid = P.nss, P.nss = void 0, !h.tolerant && (!P.uuid || !P.uuid.match(
|
|
5191
|
+
return P.uuid = P.nss, P.nss = void 0, !h.tolerant && (!P.uuid || !P.uuid.match(Ri)) && (P.error = P.error || "UUID is not valid."), P;
|
|
5198
5192
|
},
|
|
5199
5193
|
serialize: function(a, h) {
|
|
5200
5194
|
var P = a;
|
|
5201
5195
|
return P.nss = (a.uuid || "").toLowerCase(), P;
|
|
5202
5196
|
}
|
|
5203
5197
|
};
|
|
5204
|
-
F[et.scheme] = et, F[
|
|
5198
|
+
F[et.scheme] = et, F[kn.scheme] = kn, F[Mt.scheme] = Mt, F[An.scheme] = An, F[Fn.scheme] = Fn, F[Mn.scheme] = Mn, F[Un.scheme] = Un, r.SCHEMES = F, r.pctEncChar = M, r.pctDecChars = x, r.parse = we, r.removeDotSegments = Ae, r.serialize = $e, r.resolveComponents = gt, r.resolve = qt, r.normalize = Xe, r.equal = Ft, r.escapeComponent = rr, r.unescapeComponent = Pe, Object.defineProperty(r, "__esModule", { value: !0 });
|
|
5205
5199
|
});
|
|
5206
5200
|
})(Fr, Fr.exports);
|
|
5207
|
-
var
|
|
5208
|
-
Object.defineProperty(
|
|
5209
|
-
const
|
|
5210
|
-
|
|
5211
|
-
|
|
5201
|
+
var Tc = Fr.exports;
|
|
5202
|
+
Object.defineProperty(Xr, "__esModule", { value: !0 });
|
|
5203
|
+
const ai = Tc;
|
|
5204
|
+
ai.code = 'require("ajv/dist/runtime/uri").default';
|
|
5205
|
+
Xr.default = ai;
|
|
5212
5206
|
(function(t) {
|
|
5213
5207
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0;
|
|
5214
5208
|
var e = Ne;
|
|
@@ -5229,7 +5223,7 @@ en.default = ci;
|
|
|
5229
5223
|
} }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
|
|
5230
5224
|
return r.CodeGen;
|
|
5231
5225
|
} });
|
|
5232
|
-
const n = Xt, s = er, i = ct, c = ve, l = B, m = he, u = Qt, p = X, g =
|
|
5226
|
+
const n = Xt, s = er, i = ct, c = ve, l = B, m = he, u = Qt, p = X, g = Sc, k = Xr, C = (q, $) => new RegExp(q, $);
|
|
5233
5227
|
C.code = "new RegExp";
|
|
5234
5228
|
const E = ["removeAdditional", "useDefaults", "coerceTypes"], S = /* @__PURE__ */ new Set([
|
|
5235
5229
|
"validate",
|
|
@@ -5648,30 +5642,30 @@ en.default = ci;
|
|
|
5648
5642
|
function pt(q) {
|
|
5649
5643
|
return { anyOf: [q, jt] };
|
|
5650
5644
|
}
|
|
5651
|
-
})(
|
|
5652
|
-
var
|
|
5653
|
-
Object.defineProperty(
|
|
5654
|
-
const
|
|
5645
|
+
})(qs);
|
|
5646
|
+
var en = {}, tn = {}, rn = {};
|
|
5647
|
+
Object.defineProperty(rn, "__esModule", { value: !0 });
|
|
5648
|
+
const Rc = {
|
|
5655
5649
|
keyword: "id",
|
|
5656
5650
|
code() {
|
|
5657
5651
|
throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
|
|
5658
5652
|
}
|
|
5659
5653
|
};
|
|
5660
|
-
|
|
5654
|
+
rn.default = Rc;
|
|
5661
5655
|
var lt = {};
|
|
5662
5656
|
Object.defineProperty(lt, "__esModule", { value: !0 });
|
|
5663
5657
|
lt.callRef = lt.getValidate = void 0;
|
|
5664
|
-
const
|
|
5658
|
+
const Oc = er, us = K, _e = B, bt = He, ds = ve, or = X, Nc = {
|
|
5665
5659
|
keyword: "$ref",
|
|
5666
5660
|
schemaType: "string",
|
|
5667
5661
|
code(t) {
|
|
5668
5662
|
const { gen: e, schema: r, it: n } = t, { baseId: s, schemaEnv: i, validateName: c, opts: l, self: m } = n, { root: u } = i;
|
|
5669
5663
|
if ((r === "#" || r === "#/") && s === u.baseId)
|
|
5670
5664
|
return g();
|
|
5671
|
-
const p =
|
|
5665
|
+
const p = ds.resolveRef.call(m, u, s, r);
|
|
5672
5666
|
if (p === void 0)
|
|
5673
|
-
throw new
|
|
5674
|
-
if (p instanceof
|
|
5667
|
+
throw new Oc.default(n.opts.uriResolver, s, r);
|
|
5668
|
+
if (p instanceof ds.SchemaEnv)
|
|
5675
5669
|
return k(p);
|
|
5676
5670
|
return C(p);
|
|
5677
5671
|
function g() {
|
|
@@ -5681,7 +5675,7 @@ const Nc = er, ds = K, _e = B, bt = He, ps = ve, or = X, Cc = {
|
|
|
5681
5675
|
return fr(t, (0, _e._)`${E}.validate`, u, u.$async);
|
|
5682
5676
|
}
|
|
5683
5677
|
function k(E) {
|
|
5684
|
-
const S =
|
|
5678
|
+
const S = ci(t, E);
|
|
5685
5679
|
fr(t, S, E, E.$async);
|
|
5686
5680
|
}
|
|
5687
5681
|
function C(E) {
|
|
@@ -5696,11 +5690,11 @@ const Nc = er, ds = K, _e = B, bt = He, ps = ve, or = X, Cc = {
|
|
|
5696
5690
|
}
|
|
5697
5691
|
}
|
|
5698
5692
|
};
|
|
5699
|
-
function
|
|
5693
|
+
function ci(t, e) {
|
|
5700
5694
|
const { gen: r } = t;
|
|
5701
5695
|
return e.validate ? r.scopeValue("validate", { ref: e.validate }) : (0, _e._)`${r.scopeValue("wrapper", { ref: e })}.validate`;
|
|
5702
5696
|
}
|
|
5703
|
-
lt.getValidate =
|
|
5697
|
+
lt.getValidate = ci;
|
|
5704
5698
|
function fr(t, e, r, n) {
|
|
5705
5699
|
const { gen: s, it: i } = t, { allErrors: c, schemaEnv: l, opts: m } = i, u = m.passContext ? bt.default.this : _e.nil;
|
|
5706
5700
|
n ? p() : g();
|
|
@@ -5709,13 +5703,13 @@ function fr(t, e, r, n) {
|
|
|
5709
5703
|
throw new Error("async schema referenced by sync schema");
|
|
5710
5704
|
const E = s.let("valid");
|
|
5711
5705
|
s.try(() => {
|
|
5712
|
-
s.code((0, _e._)`await ${(0,
|
|
5706
|
+
s.code((0, _e._)`await ${(0, us.callValidateCode)(t, e, u)}`), C(e), c || s.assign(E, !0);
|
|
5713
5707
|
}, (S) => {
|
|
5714
5708
|
s.if((0, _e._)`!(${S} instanceof ${i.ValidationError})`, () => s.throw(S)), k(S), c || s.assign(E, !1);
|
|
5715
5709
|
}), t.ok(E);
|
|
5716
5710
|
}
|
|
5717
5711
|
function g() {
|
|
5718
|
-
t.result((0,
|
|
5712
|
+
t.result((0, us.callValidateCode)(t, e, u), () => C(e), () => k(e));
|
|
5719
5713
|
}
|
|
5720
5714
|
function k(E) {
|
|
5721
5715
|
const S = (0, _e._)`${E}.errors`;
|
|
@@ -5743,136 +5737,136 @@ function fr(t, e, r, n) {
|
|
|
5743
5737
|
}
|
|
5744
5738
|
}
|
|
5745
5739
|
lt.callRef = fr;
|
|
5746
|
-
lt.default =
|
|
5747
|
-
Object.defineProperty(
|
|
5748
|
-
const
|
|
5740
|
+
lt.default = Nc;
|
|
5741
|
+
Object.defineProperty(tn, "__esModule", { value: !0 });
|
|
5742
|
+
const Cc = rn, jc = lt, kc = [
|
|
5749
5743
|
"$schema",
|
|
5750
5744
|
"$id",
|
|
5751
5745
|
"$defs",
|
|
5752
5746
|
"$vocabulary",
|
|
5753
5747
|
{ keyword: "$comment" },
|
|
5754
5748
|
"definitions",
|
|
5755
|
-
|
|
5756
|
-
|
|
5749
|
+
Cc.default,
|
|
5750
|
+
jc.default
|
|
5757
5751
|
];
|
|
5758
|
-
|
|
5759
|
-
var
|
|
5760
|
-
Object.defineProperty(
|
|
5752
|
+
tn.default = kc;
|
|
5753
|
+
var nn = {}, sn = {};
|
|
5754
|
+
Object.defineProperty(sn, "__esModule", { value: !0 });
|
|
5761
5755
|
const gr = B, xe = gr.operators, $r = {
|
|
5762
5756
|
maximum: { okStr: "<=", ok: xe.LTE, fail: xe.GT },
|
|
5763
5757
|
minimum: { okStr: ">=", ok: xe.GTE, fail: xe.LT },
|
|
5764
5758
|
exclusiveMaximum: { okStr: "<", ok: xe.LT, fail: xe.GTE },
|
|
5765
5759
|
exclusiveMinimum: { okStr: ">", ok: xe.GT, fail: xe.LTE }
|
|
5766
|
-
},
|
|
5760
|
+
}, Ic = {
|
|
5767
5761
|
message: ({ keyword: t, schemaCode: e }) => (0, gr.str)`must be ${$r[t].okStr} ${e}`,
|
|
5768
5762
|
params: ({ keyword: t, schemaCode: e }) => (0, gr._)`{comparison: ${$r[t].okStr}, limit: ${e}}`
|
|
5769
|
-
},
|
|
5763
|
+
}, Ac = {
|
|
5770
5764
|
keyword: Object.keys($r),
|
|
5771
5765
|
type: "number",
|
|
5772
5766
|
schemaType: "number",
|
|
5773
5767
|
$data: !0,
|
|
5774
|
-
error:
|
|
5768
|
+
error: Ic,
|
|
5775
5769
|
code(t) {
|
|
5776
5770
|
const { keyword: e, data: r, schemaCode: n } = t;
|
|
5777
5771
|
t.fail$data((0, gr._)`${r} ${$r[e].fail} ${n} || isNaN(${r})`);
|
|
5778
5772
|
}
|
|
5779
5773
|
};
|
|
5780
|
-
|
|
5781
|
-
var
|
|
5782
|
-
Object.defineProperty(
|
|
5783
|
-
const Bt = B,
|
|
5774
|
+
sn.default = Ac;
|
|
5775
|
+
var on = {};
|
|
5776
|
+
Object.defineProperty(on, "__esModule", { value: !0 });
|
|
5777
|
+
const Bt = B, Dc = {
|
|
5784
5778
|
message: ({ schemaCode: t }) => (0, Bt.str)`must be multiple of ${t}`,
|
|
5785
5779
|
params: ({ schemaCode: t }) => (0, Bt._)`{multipleOf: ${t}}`
|
|
5786
|
-
},
|
|
5780
|
+
}, qc = {
|
|
5787
5781
|
keyword: "multipleOf",
|
|
5788
5782
|
type: "number",
|
|
5789
5783
|
schemaType: "number",
|
|
5790
5784
|
$data: !0,
|
|
5791
|
-
error:
|
|
5785
|
+
error: Dc,
|
|
5792
5786
|
code(t) {
|
|
5793
5787
|
const { gen: e, data: r, schemaCode: n, it: s } = t, i = s.opts.multipleOfPrecision, c = e.let("res"), l = i ? (0, Bt._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${i}` : (0, Bt._)`${c} !== parseInt(${c})`;
|
|
5794
5788
|
t.fail$data((0, Bt._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`);
|
|
5795
5789
|
}
|
|
5796
5790
|
};
|
|
5797
|
-
|
|
5798
|
-
var
|
|
5799
|
-
Object.defineProperty(
|
|
5800
|
-
function
|
|
5791
|
+
on.default = qc;
|
|
5792
|
+
var an = {}, cn = {};
|
|
5793
|
+
Object.defineProperty(cn, "__esModule", { value: !0 });
|
|
5794
|
+
function li(t) {
|
|
5801
5795
|
const e = t.length;
|
|
5802
5796
|
let r = 0, n = 0, s;
|
|
5803
5797
|
for (; n < e; )
|
|
5804
5798
|
r++, s = t.charCodeAt(n++), s >= 55296 && s <= 56319 && n < e && (s = t.charCodeAt(n), (s & 64512) === 56320 && n++);
|
|
5805
5799
|
return r;
|
|
5806
5800
|
}
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
Object.defineProperty(
|
|
5810
|
-
const it = B,
|
|
5801
|
+
cn.default = li;
|
|
5802
|
+
li.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
5803
|
+
Object.defineProperty(an, "__esModule", { value: !0 });
|
|
5804
|
+
const it = B, Fc = X, Mc = cn, Uc = {
|
|
5811
5805
|
message({ keyword: t, schemaCode: e }) {
|
|
5812
5806
|
const r = t === "maxLength" ? "more" : "fewer";
|
|
5813
5807
|
return (0, it.str)`must NOT have ${r} than ${e} characters`;
|
|
5814
5808
|
},
|
|
5815
5809
|
params: ({ schemaCode: t }) => (0, it._)`{limit: ${t}}`
|
|
5816
|
-
},
|
|
5810
|
+
}, Lc = {
|
|
5817
5811
|
keyword: ["maxLength", "minLength"],
|
|
5818
5812
|
type: "string",
|
|
5819
5813
|
schemaType: "number",
|
|
5820
5814
|
$data: !0,
|
|
5821
|
-
error:
|
|
5815
|
+
error: Uc,
|
|
5822
5816
|
code(t) {
|
|
5823
|
-
const { keyword: e, data: r, schemaCode: n, it: s } = t, i = e === "maxLength" ? it.operators.GT : it.operators.LT, c = s.opts.unicode === !1 ? (0, it._)`${r}.length` : (0, it._)`${(0,
|
|
5817
|
+
const { keyword: e, data: r, schemaCode: n, it: s } = t, i = e === "maxLength" ? it.operators.GT : it.operators.LT, c = s.opts.unicode === !1 ? (0, it._)`${r}.length` : (0, it._)`${(0, Fc.useFunc)(t.gen, Mc.default)}(${r})`;
|
|
5824
5818
|
t.fail$data((0, it._)`${c} ${i} ${n}`);
|
|
5825
5819
|
}
|
|
5826
5820
|
};
|
|
5827
|
-
|
|
5828
|
-
var
|
|
5829
|
-
Object.defineProperty(
|
|
5830
|
-
const
|
|
5821
|
+
an.default = Lc;
|
|
5822
|
+
var ln = {};
|
|
5823
|
+
Object.defineProperty(ln, "__esModule", { value: !0 });
|
|
5824
|
+
const Hc = K, _r = B, Vc = {
|
|
5831
5825
|
message: ({ schemaCode: t }) => (0, _r.str)`must match pattern "${t}"`,
|
|
5832
5826
|
params: ({ schemaCode: t }) => (0, _r._)`{pattern: ${t}}`
|
|
5833
|
-
},
|
|
5827
|
+
}, zc = {
|
|
5834
5828
|
keyword: "pattern",
|
|
5835
5829
|
type: "string",
|
|
5836
5830
|
schemaType: "string",
|
|
5837
5831
|
$data: !0,
|
|
5838
|
-
error:
|
|
5832
|
+
error: Vc,
|
|
5839
5833
|
code(t) {
|
|
5840
|
-
const { data: e, $data: r, schema: n, schemaCode: s, it: i } = t, c = i.opts.unicodeRegExp ? "u" : "", l = r ? (0, _r._)`(new RegExp(${s}, ${c}))` : (0,
|
|
5834
|
+
const { data: e, $data: r, schema: n, schemaCode: s, it: i } = t, c = i.opts.unicodeRegExp ? "u" : "", l = r ? (0, _r._)`(new RegExp(${s}, ${c}))` : (0, Hc.usePattern)(t, n);
|
|
5841
5835
|
t.fail$data((0, _r._)`!${l}.test(${e})`);
|
|
5842
5836
|
}
|
|
5843
5837
|
};
|
|
5844
|
-
|
|
5845
|
-
var
|
|
5846
|
-
Object.defineProperty(
|
|
5847
|
-
const Gt = B,
|
|
5838
|
+
ln.default = zc;
|
|
5839
|
+
var un = {};
|
|
5840
|
+
Object.defineProperty(un, "__esModule", { value: !0 });
|
|
5841
|
+
const Gt = B, Wc = {
|
|
5848
5842
|
message({ keyword: t, schemaCode: e }) {
|
|
5849
5843
|
const r = t === "maxProperties" ? "more" : "fewer";
|
|
5850
5844
|
return (0, Gt.str)`must NOT have ${r} than ${e} properties`;
|
|
5851
5845
|
},
|
|
5852
5846
|
params: ({ schemaCode: t }) => (0, Gt._)`{limit: ${t}}`
|
|
5853
|
-
},
|
|
5847
|
+
}, Kc = {
|
|
5854
5848
|
keyword: ["maxProperties", "minProperties"],
|
|
5855
5849
|
type: "object",
|
|
5856
5850
|
schemaType: "number",
|
|
5857
5851
|
$data: !0,
|
|
5858
|
-
error:
|
|
5852
|
+
error: Wc,
|
|
5859
5853
|
code(t) {
|
|
5860
5854
|
const { keyword: e, data: r, schemaCode: n } = t, s = e === "maxProperties" ? Gt.operators.GT : Gt.operators.LT;
|
|
5861
5855
|
t.fail$data((0, Gt._)`Object.keys(${r}).length ${s} ${n}`);
|
|
5862
5856
|
}
|
|
5863
5857
|
};
|
|
5864
|
-
|
|
5865
|
-
var
|
|
5866
|
-
Object.defineProperty(
|
|
5867
|
-
const Vt = K, xt = B,
|
|
5858
|
+
un.default = Kc;
|
|
5859
|
+
var dn = {};
|
|
5860
|
+
Object.defineProperty(dn, "__esModule", { value: !0 });
|
|
5861
|
+
const Vt = K, xt = B, Bc = X, Gc = {
|
|
5868
5862
|
message: ({ params: { missingProperty: t } }) => (0, xt.str)`must have required property '${t}'`,
|
|
5869
5863
|
params: ({ params: { missingProperty: t } }) => (0, xt._)`{missingProperty: ${t}}`
|
|
5870
|
-
},
|
|
5864
|
+
}, xc = {
|
|
5871
5865
|
keyword: "required",
|
|
5872
5866
|
type: "object",
|
|
5873
5867
|
schemaType: "array",
|
|
5874
5868
|
$data: !0,
|
|
5875
|
-
error:
|
|
5869
|
+
error: Gc,
|
|
5876
5870
|
code(t) {
|
|
5877
5871
|
const { gen: e, schema: r, schemaCode: n, data: s, $data: i, it: c } = t, { opts: l } = c;
|
|
5878
5872
|
if (!i && r.length === 0)
|
|
@@ -5883,7 +5877,7 @@ const Vt = K, xt = B, Gc = X, xc = {
|
|
|
5883
5877
|
for (const S of r)
|
|
5884
5878
|
if (C?.[S] === void 0 && !E.has(S)) {
|
|
5885
5879
|
const _ = c.schemaEnv.baseId + c.errSchemaPath, y = `required property "${S}" is not defined at "${_}" (strictRequired)`;
|
|
5886
|
-
(0,
|
|
5880
|
+
(0, Bc.checkStrictMode)(c, y, c.opts.strictRequired);
|
|
5887
5881
|
}
|
|
5888
5882
|
}
|
|
5889
5883
|
function u() {
|
|
@@ -5915,42 +5909,42 @@ const Vt = K, xt = B, Gc = X, xc = {
|
|
|
5915
5909
|
}
|
|
5916
5910
|
}
|
|
5917
5911
|
};
|
|
5918
|
-
|
|
5919
|
-
var
|
|
5920
|
-
Object.defineProperty(
|
|
5921
|
-
const Jt = B,
|
|
5912
|
+
dn.default = xc;
|
|
5913
|
+
var pn = {};
|
|
5914
|
+
Object.defineProperty(pn, "__esModule", { value: !0 });
|
|
5915
|
+
const Jt = B, Jc = {
|
|
5922
5916
|
message({ keyword: t, schemaCode: e }) {
|
|
5923
5917
|
const r = t === "maxItems" ? "more" : "fewer";
|
|
5924
5918
|
return (0, Jt.str)`must NOT have ${r} than ${e} items`;
|
|
5925
5919
|
},
|
|
5926
5920
|
params: ({ schemaCode: t }) => (0, Jt._)`{limit: ${t}}`
|
|
5927
|
-
},
|
|
5921
|
+
}, Yc = {
|
|
5928
5922
|
keyword: ["maxItems", "minItems"],
|
|
5929
5923
|
type: "array",
|
|
5930
5924
|
schemaType: "number",
|
|
5931
5925
|
$data: !0,
|
|
5932
|
-
error:
|
|
5926
|
+
error: Jc,
|
|
5933
5927
|
code(t) {
|
|
5934
5928
|
const { keyword: e, data: r, schemaCode: n } = t, s = e === "maxItems" ? Jt.operators.GT : Jt.operators.LT;
|
|
5935
5929
|
t.fail$data((0, Jt._)`${r}.length ${s} ${n}`);
|
|
5936
5930
|
}
|
|
5937
5931
|
};
|
|
5938
|
-
|
|
5939
|
-
var
|
|
5932
|
+
pn.default = Yc;
|
|
5933
|
+
var fn = {}, tr = {};
|
|
5940
5934
|
Object.defineProperty(tr, "__esModule", { value: !0 });
|
|
5941
|
-
const
|
|
5942
|
-
|
|
5943
|
-
tr.default =
|
|
5944
|
-
Object.defineProperty(
|
|
5945
|
-
const jr = Qt, fe = B,
|
|
5935
|
+
const ui = Ws;
|
|
5936
|
+
ui.code = 'require("ajv/dist/runtime/equal").default';
|
|
5937
|
+
tr.default = ui;
|
|
5938
|
+
Object.defineProperty(fn, "__esModule", { value: !0 });
|
|
5939
|
+
const jr = Qt, fe = B, Zc = X, Qc = tr, Xc = {
|
|
5946
5940
|
message: ({ params: { i: t, j: e } }) => (0, fe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,
|
|
5947
5941
|
params: ({ params: { i: t, j: e } }) => (0, fe._)`{i: ${t}, j: ${e}}`
|
|
5948
|
-
},
|
|
5942
|
+
}, el = {
|
|
5949
5943
|
keyword: "uniqueItems",
|
|
5950
5944
|
type: "array",
|
|
5951
5945
|
schemaType: "boolean",
|
|
5952
5946
|
$data: !0,
|
|
5953
|
-
error:
|
|
5947
|
+
error: Xc,
|
|
5954
5948
|
code(t) {
|
|
5955
5949
|
const { gen: e, data: r, $data: n, schema: s, parentSchema: i, schemaCode: c, it: l } = t;
|
|
5956
5950
|
if (!n && !s)
|
|
@@ -5973,46 +5967,46 @@ const jr = Qt, fe = B, Qc = X, Xc = tr, el = {
|
|
|
5973
5967
|
});
|
|
5974
5968
|
}
|
|
5975
5969
|
function C(E, S) {
|
|
5976
|
-
const _ = (0,
|
|
5970
|
+
const _ = (0, Zc.useFunc)(e, Qc.default), y = e.name("outer");
|
|
5977
5971
|
e.label(y).for((0, fe._)`;${E}--;`, () => e.for((0, fe._)`${S} = ${E}; ${S}--;`, () => e.if((0, fe._)`${_}(${r}[${E}], ${r}[${S}])`, () => {
|
|
5978
5972
|
t.error(), e.assign(m, !1).break(y);
|
|
5979
5973
|
})));
|
|
5980
5974
|
}
|
|
5981
5975
|
}
|
|
5982
5976
|
};
|
|
5983
|
-
|
|
5984
|
-
var
|
|
5985
|
-
Object.defineProperty(
|
|
5986
|
-
const Mr = B,
|
|
5977
|
+
fn.default = el;
|
|
5978
|
+
var hn = {};
|
|
5979
|
+
Object.defineProperty(hn, "__esModule", { value: !0 });
|
|
5980
|
+
const Mr = B, tl = X, rl = tr, nl = {
|
|
5987
5981
|
message: "must be equal to constant",
|
|
5988
5982
|
params: ({ schemaCode: t }) => (0, Mr._)`{allowedValue: ${t}}`
|
|
5989
|
-
},
|
|
5983
|
+
}, sl = {
|
|
5990
5984
|
keyword: "const",
|
|
5991
5985
|
$data: !0,
|
|
5992
|
-
error:
|
|
5986
|
+
error: nl,
|
|
5993
5987
|
code(t) {
|
|
5994
5988
|
const { gen: e, data: r, $data: n, schemaCode: s, schema: i } = t;
|
|
5995
|
-
n || i && typeof i == "object" ? t.fail$data((0, Mr._)`!${(0,
|
|
5989
|
+
n || i && typeof i == "object" ? t.fail$data((0, Mr._)`!${(0, tl.useFunc)(e, rl.default)}(${r}, ${s})`) : t.fail((0, Mr._)`${i} !== ${r}`);
|
|
5996
5990
|
}
|
|
5997
5991
|
};
|
|
5998
|
-
|
|
5999
|
-
var
|
|
6000
|
-
Object.defineProperty(
|
|
6001
|
-
const zt = B,
|
|
5992
|
+
hn.default = sl;
|
|
5993
|
+
var mn = {};
|
|
5994
|
+
Object.defineProperty(mn, "__esModule", { value: !0 });
|
|
5995
|
+
const zt = B, il = X, ol = tr, al = {
|
|
6002
5996
|
message: "must be equal to one of the allowed values",
|
|
6003
5997
|
params: ({ schemaCode: t }) => (0, zt._)`{allowedValues: ${t}}`
|
|
6004
|
-
},
|
|
5998
|
+
}, cl = {
|
|
6005
5999
|
keyword: "enum",
|
|
6006
6000
|
schemaType: "array",
|
|
6007
6001
|
$data: !0,
|
|
6008
|
-
error:
|
|
6002
|
+
error: al,
|
|
6009
6003
|
code(t) {
|
|
6010
6004
|
const { gen: e, data: r, $data: n, schema: s, schemaCode: i, it: c } = t;
|
|
6011
6005
|
if (!n && s.length === 0)
|
|
6012
6006
|
throw new Error("enum must have non-empty array");
|
|
6013
6007
|
const l = s.length >= c.opts.loopEnum;
|
|
6014
6008
|
let m;
|
|
6015
|
-
const u = () => m ?? (m = (0,
|
|
6009
|
+
const u = () => m ?? (m = (0, il.useFunc)(e, ol.default));
|
|
6016
6010
|
let p;
|
|
6017
6011
|
if (l || n)
|
|
6018
6012
|
p = e.let("valid"), t.block$data(p, g);
|
|
@@ -6032,50 +6026,50 @@ const zt = B, ol = X, al = tr, cl = {
|
|
|
6032
6026
|
}
|
|
6033
6027
|
}
|
|
6034
6028
|
};
|
|
6035
|
-
|
|
6036
|
-
Object.defineProperty(
|
|
6037
|
-
const ul = on, dl = an, pl =
|
|
6029
|
+
mn.default = cl;
|
|
6030
|
+
Object.defineProperty(nn, "__esModule", { value: !0 });
|
|
6031
|
+
const ll = sn, ul = on, dl = an, pl = ln, fl = un, hl = dn, ml = pn, yl = fn, gl = hn, $l = mn, _l = [
|
|
6038
6032
|
// number
|
|
6033
|
+
ll.default,
|
|
6039
6034
|
ul.default,
|
|
6040
|
-
dl.default,
|
|
6041
6035
|
// string
|
|
6036
|
+
dl.default,
|
|
6042
6037
|
pl.default,
|
|
6043
|
-
fl.default,
|
|
6044
6038
|
// object
|
|
6039
|
+
fl.default,
|
|
6045
6040
|
hl.default,
|
|
6046
|
-
ml.default,
|
|
6047
6041
|
// array
|
|
6042
|
+
ml.default,
|
|
6048
6043
|
yl.default,
|
|
6049
|
-
gl.default,
|
|
6050
6044
|
// any
|
|
6051
6045
|
{ keyword: "type", schemaType: ["string", "array"] },
|
|
6052
6046
|
{ keyword: "nullable", schemaType: "boolean" },
|
|
6053
|
-
|
|
6054
|
-
|
|
6047
|
+
gl.default,
|
|
6048
|
+
$l.default
|
|
6055
6049
|
];
|
|
6056
|
-
|
|
6057
|
-
var
|
|
6050
|
+
nn.default = _l;
|
|
6051
|
+
var yn = {}, Nt = {};
|
|
6058
6052
|
Object.defineProperty(Nt, "__esModule", { value: !0 });
|
|
6059
6053
|
Nt.validateAdditionalItems = void 0;
|
|
6060
|
-
const ot = B, Ur = X,
|
|
6054
|
+
const ot = B, Ur = X, vl = {
|
|
6061
6055
|
message: ({ params: { len: t } }) => (0, ot.str)`must NOT have more than ${t} items`,
|
|
6062
6056
|
params: ({ params: { len: t } }) => (0, ot._)`{limit: ${t}}`
|
|
6063
|
-
},
|
|
6057
|
+
}, wl = {
|
|
6064
6058
|
keyword: "additionalItems",
|
|
6065
6059
|
type: "array",
|
|
6066
6060
|
schemaType: ["boolean", "object"],
|
|
6067
6061
|
before: "uniqueItems",
|
|
6068
|
-
error:
|
|
6062
|
+
error: vl,
|
|
6069
6063
|
code(t) {
|
|
6070
6064
|
const { parentSchema: e, it: r } = t, { items: n } = e;
|
|
6071
6065
|
if (!Array.isArray(n)) {
|
|
6072
6066
|
(0, Ur.checkStrictMode)(r, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
6073
6067
|
return;
|
|
6074
6068
|
}
|
|
6075
|
-
|
|
6069
|
+
di(t, n);
|
|
6076
6070
|
}
|
|
6077
6071
|
};
|
|
6078
|
-
function
|
|
6072
|
+
function di(t, e) {
|
|
6079
6073
|
const { gen: r, schema: n, data: s, keyword: i, it: c } = t;
|
|
6080
6074
|
c.items = !0;
|
|
6081
6075
|
const l = r.const("len", (0, ot._)`${s}.length`);
|
|
@@ -6091,12 +6085,12 @@ function pi(t, e) {
|
|
|
6091
6085
|
});
|
|
6092
6086
|
}
|
|
6093
6087
|
}
|
|
6094
|
-
Nt.validateAdditionalItems =
|
|
6095
|
-
Nt.default =
|
|
6096
|
-
var
|
|
6088
|
+
Nt.validateAdditionalItems = di;
|
|
6089
|
+
Nt.default = wl;
|
|
6090
|
+
var gn = {}, Ct = {};
|
|
6097
6091
|
Object.defineProperty(Ct, "__esModule", { value: !0 });
|
|
6098
6092
|
Ct.validateTuple = void 0;
|
|
6099
|
-
const
|
|
6093
|
+
const ps = B, hr = X, bl = K, Pl = {
|
|
6100
6094
|
keyword: "items",
|
|
6101
6095
|
type: "array",
|
|
6102
6096
|
schemaType: ["object", "array", "boolean"],
|
|
@@ -6104,16 +6098,16 @@ const fs = B, hr = X, Pl = K, El = {
|
|
|
6104
6098
|
code(t) {
|
|
6105
6099
|
const { schema: e, it: r } = t;
|
|
6106
6100
|
if (Array.isArray(e))
|
|
6107
|
-
return
|
|
6108
|
-
r.items = !0, !(0, hr.alwaysValidSchema)(r, e) && t.ok((0,
|
|
6101
|
+
return pi(t, "additionalItems", e);
|
|
6102
|
+
r.items = !0, !(0, hr.alwaysValidSchema)(r, e) && t.ok((0, bl.validateArray)(t));
|
|
6109
6103
|
}
|
|
6110
6104
|
};
|
|
6111
|
-
function
|
|
6105
|
+
function pi(t, e, r = t.schema) {
|
|
6112
6106
|
const { gen: n, parentSchema: s, data: i, keyword: c, it: l } = t;
|
|
6113
6107
|
p(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = hr.mergeEvaluated.items(n, r.length, l.items));
|
|
6114
|
-
const m = n.name("valid"), u = n.const("len", (0,
|
|
6108
|
+
const m = n.name("valid"), u = n.const("len", (0, ps._)`${i}.length`);
|
|
6115
6109
|
r.forEach((g, k) => {
|
|
6116
|
-
(0, hr.alwaysValidSchema)(l, g) || (n.if((0,
|
|
6110
|
+
(0, hr.alwaysValidSchema)(l, g) || (n.if((0, ps._)`${u} > ${k}`, () => t.subschema({
|
|
6117
6111
|
keyword: c,
|
|
6118
6112
|
schemaProp: k,
|
|
6119
6113
|
dataProp: k
|
|
@@ -6127,46 +6121,46 @@ function fi(t, e, r = t.schema) {
|
|
|
6127
6121
|
}
|
|
6128
6122
|
}
|
|
6129
6123
|
}
|
|
6130
|
-
Ct.validateTuple =
|
|
6131
|
-
Ct.default =
|
|
6132
|
-
Object.defineProperty(
|
|
6133
|
-
const
|
|
6124
|
+
Ct.validateTuple = pi;
|
|
6125
|
+
Ct.default = Pl;
|
|
6126
|
+
Object.defineProperty(gn, "__esModule", { value: !0 });
|
|
6127
|
+
const El = Ct, Sl = {
|
|
6134
6128
|
keyword: "prefixItems",
|
|
6135
6129
|
type: "array",
|
|
6136
6130
|
schemaType: ["array"],
|
|
6137
6131
|
before: "uniqueItems",
|
|
6138
|
-
code: (t) => (0,
|
|
6132
|
+
code: (t) => (0, El.validateTuple)(t, "items")
|
|
6139
6133
|
};
|
|
6140
|
-
|
|
6141
|
-
var
|
|
6142
|
-
Object.defineProperty(
|
|
6143
|
-
const
|
|
6144
|
-
message: ({ params: { len: t } }) => (0,
|
|
6145
|
-
params: ({ params: { len: t } }) => (0,
|
|
6146
|
-
},
|
|
6134
|
+
gn.default = Sl;
|
|
6135
|
+
var $n = {};
|
|
6136
|
+
Object.defineProperty($n, "__esModule", { value: !0 });
|
|
6137
|
+
const fs = B, Tl = X, Rl = K, Ol = Nt, Nl = {
|
|
6138
|
+
message: ({ params: { len: t } }) => (0, fs.str)`must NOT have more than ${t} items`,
|
|
6139
|
+
params: ({ params: { len: t } }) => (0, fs._)`{limit: ${t}}`
|
|
6140
|
+
}, Cl = {
|
|
6147
6141
|
keyword: "items",
|
|
6148
6142
|
type: "array",
|
|
6149
6143
|
schemaType: ["object", "boolean"],
|
|
6150
6144
|
before: "uniqueItems",
|
|
6151
|
-
error:
|
|
6145
|
+
error: Nl,
|
|
6152
6146
|
code(t) {
|
|
6153
6147
|
const { schema: e, parentSchema: r, it: n } = t, { prefixItems: s } = r;
|
|
6154
|
-
n.items = !0, !(0,
|
|
6148
|
+
n.items = !0, !(0, Tl.alwaysValidSchema)(n, e) && (s ? (0, Ol.validateAdditionalItems)(t, s) : t.ok((0, Rl.validateArray)(t)));
|
|
6155
6149
|
}
|
|
6156
6150
|
};
|
|
6157
|
-
|
|
6158
|
-
var
|
|
6159
|
-
Object.defineProperty(
|
|
6160
|
-
const Se = B, ar = X,
|
|
6151
|
+
$n.default = Cl;
|
|
6152
|
+
var _n = {};
|
|
6153
|
+
Object.defineProperty(_n, "__esModule", { value: !0 });
|
|
6154
|
+
const Se = B, ar = X, jl = {
|
|
6161
6155
|
message: ({ params: { min: t, max: e } }) => e === void 0 ? (0, Se.str)`must contain at least ${t} valid item(s)` : (0, Se.str)`must contain at least ${t} and no more than ${e} valid item(s)`,
|
|
6162
6156
|
params: ({ params: { min: t, max: e } }) => e === void 0 ? (0, Se._)`{minContains: ${t}}` : (0, Se._)`{minContains: ${t}, maxContains: ${e}}`
|
|
6163
|
-
},
|
|
6157
|
+
}, kl = {
|
|
6164
6158
|
keyword: "contains",
|
|
6165
6159
|
type: "array",
|
|
6166
6160
|
schemaType: ["object", "boolean"],
|
|
6167
6161
|
before: "uniqueItems",
|
|
6168
6162
|
trackErrors: !0,
|
|
6169
|
-
error:
|
|
6163
|
+
error: jl,
|
|
6170
6164
|
code(t) {
|
|
6171
6165
|
const { gen: e, schema: r, parentSchema: n, data: s, it: i } = t;
|
|
6172
6166
|
let c, l;
|
|
@@ -6208,8 +6202,8 @@ const Se = B, ar = X, kl = {
|
|
|
6208
6202
|
}
|
|
6209
6203
|
}
|
|
6210
6204
|
};
|
|
6211
|
-
|
|
6212
|
-
var
|
|
6205
|
+
_n.default = kl;
|
|
6206
|
+
var fi = {};
|
|
6213
6207
|
(function(t) {
|
|
6214
6208
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.validateSchemaDeps = t.validatePropertyDeps = t.error = void 0;
|
|
6215
6209
|
const e = B, r = X, n = K;
|
|
@@ -6279,20 +6273,20 @@ var hi = {};
|
|
|
6279
6273
|
), m.ok(E));
|
|
6280
6274
|
}
|
|
6281
6275
|
t.validateSchemaDeps = l, t.default = s;
|
|
6282
|
-
})(
|
|
6283
|
-
var
|
|
6284
|
-
Object.defineProperty(
|
|
6285
|
-
const
|
|
6276
|
+
})(fi);
|
|
6277
|
+
var vn = {};
|
|
6278
|
+
Object.defineProperty(vn, "__esModule", { value: !0 });
|
|
6279
|
+
const hi = B, Il = X, Al = {
|
|
6286
6280
|
message: "property name must be valid",
|
|
6287
|
-
params: ({ params: t }) => (0,
|
|
6288
|
-
},
|
|
6281
|
+
params: ({ params: t }) => (0, hi._)`{propertyName: ${t.propertyName}}`
|
|
6282
|
+
}, Dl = {
|
|
6289
6283
|
keyword: "propertyNames",
|
|
6290
6284
|
type: "object",
|
|
6291
6285
|
schemaType: ["object", "boolean"],
|
|
6292
|
-
error:
|
|
6286
|
+
error: Al,
|
|
6293
6287
|
code(t) {
|
|
6294
6288
|
const { gen: e, schema: r, data: n, it: s } = t;
|
|
6295
|
-
if ((0,
|
|
6289
|
+
if ((0, Il.alwaysValidSchema)(s, r))
|
|
6296
6290
|
return;
|
|
6297
6291
|
const i = e.name("valid");
|
|
6298
6292
|
e.forIn("key", n, (c) => {
|
|
@@ -6302,25 +6296,25 @@ const mi = B, Al = X, Dl = {
|
|
|
6302
6296
|
dataTypes: ["string"],
|
|
6303
6297
|
propertyName: c,
|
|
6304
6298
|
compositeRule: !0
|
|
6305
|
-
}, i), e.if((0,
|
|
6299
|
+
}, i), e.if((0, hi.not)(i), () => {
|
|
6306
6300
|
t.error(!0), s.allErrors || e.break();
|
|
6307
6301
|
});
|
|
6308
6302
|
}), t.ok(i);
|
|
6309
6303
|
}
|
|
6310
6304
|
};
|
|
6311
|
-
|
|
6305
|
+
vn.default = Dl;
|
|
6312
6306
|
var Sr = {};
|
|
6313
6307
|
Object.defineProperty(Sr, "__esModule", { value: !0 });
|
|
6314
|
-
const cr = K, Re = B,
|
|
6308
|
+
const cr = K, Re = B, ql = He, lr = X, Fl = {
|
|
6315
6309
|
message: "must NOT have additional properties",
|
|
6316
6310
|
params: ({ params: t }) => (0, Re._)`{additionalProperty: ${t.additionalProperty}}`
|
|
6317
|
-
},
|
|
6311
|
+
}, Ml = {
|
|
6318
6312
|
keyword: "additionalProperties",
|
|
6319
6313
|
type: ["object"],
|
|
6320
6314
|
schemaType: ["boolean", "object"],
|
|
6321
6315
|
allowUndefined: !0,
|
|
6322
6316
|
trackErrors: !0,
|
|
6323
|
-
error:
|
|
6317
|
+
error: Fl,
|
|
6324
6318
|
code(t) {
|
|
6325
6319
|
const { gen: e, schema: r, parentSchema: n, data: s, errsCount: i, it: c } = t;
|
|
6326
6320
|
if (!i)
|
|
@@ -6329,7 +6323,7 @@ const cr = K, Re = B, Fl = He, lr = X, Ml = {
|
|
|
6329
6323
|
if (c.props = !0, m.removeAdditional !== "all" && (0, lr.alwaysValidSchema)(c, r))
|
|
6330
6324
|
return;
|
|
6331
6325
|
const u = (0, cr.allSchemaProperties)(n.properties), p = (0, cr.allSchemaProperties)(n.patternProperties);
|
|
6332
|
-
g(), t.ok((0, Re._)`${i} === ${
|
|
6326
|
+
g(), t.ok((0, Re._)`${i} === ${ql.default.errors}`);
|
|
6333
6327
|
function g() {
|
|
6334
6328
|
e.forIn("key", s, (_) => {
|
|
6335
6329
|
!u.length && !p.length ? E(_) : e.if(k(_), () => E(_));
|
|
@@ -6377,17 +6371,17 @@ const cr = K, Re = B, Fl = He, lr = X, Ml = {
|
|
|
6377
6371
|
}
|
|
6378
6372
|
}
|
|
6379
6373
|
};
|
|
6380
|
-
Sr.default =
|
|
6381
|
-
var
|
|
6382
|
-
Object.defineProperty(
|
|
6383
|
-
const
|
|
6374
|
+
Sr.default = Ml;
|
|
6375
|
+
var wn = {};
|
|
6376
|
+
Object.defineProperty(wn, "__esModule", { value: !0 });
|
|
6377
|
+
const Ul = Ne, hs = K, kr = X, ms = Sr, Ll = {
|
|
6384
6378
|
keyword: "properties",
|
|
6385
6379
|
type: "object",
|
|
6386
6380
|
schemaType: "object",
|
|
6387
6381
|
code(t) {
|
|
6388
6382
|
const { gen: e, schema: r, parentSchema: n, data: s, it: i } = t;
|
|
6389
|
-
i.opts.removeAdditional === "all" && n.additionalProperties === void 0 &&
|
|
6390
|
-
const c = (0,
|
|
6383
|
+
i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && ms.default.code(new Ul.KeywordCxt(i, ms.default, "additionalProperties"));
|
|
6384
|
+
const c = (0, hs.allSchemaProperties)(r);
|
|
6391
6385
|
for (const g of c)
|
|
6392
6386
|
i.definedProperties.add(g);
|
|
6393
6387
|
i.opts.unevaluated && c.length && i.props !== !0 && (i.props = kr.mergeEvaluated.props(e, (0, kr.toHash)(c), i.props));
|
|
@@ -6396,7 +6390,7 @@ const Ll = Ne, ms = K, kr = X, ys = Sr, Hl = {
|
|
|
6396
6390
|
return;
|
|
6397
6391
|
const m = e.name("valid");
|
|
6398
6392
|
for (const g of l)
|
|
6399
|
-
u(g) ? p(g) : (e.if((0,
|
|
6393
|
+
u(g) ? p(g) : (e.if((0, hs.propertyInData)(e, s, g, i.opts.ownProperties)), p(g), i.allErrors || e.else().var(m, !0), e.endIf()), t.it.definedProperties.add(g), t.ok(m);
|
|
6400
6394
|
function u(g) {
|
|
6401
6395
|
return i.opts.useDefaults && !i.compositeRule && r[g].default !== void 0;
|
|
6402
6396
|
}
|
|
@@ -6409,19 +6403,19 @@ const Ll = Ne, ms = K, kr = X, ys = Sr, Hl = {
|
|
|
6409
6403
|
}
|
|
6410
6404
|
}
|
|
6411
6405
|
};
|
|
6412
|
-
|
|
6413
|
-
var
|
|
6414
|
-
Object.defineProperty(
|
|
6415
|
-
const
|
|
6406
|
+
wn.default = Ll;
|
|
6407
|
+
var bn = {};
|
|
6408
|
+
Object.defineProperty(bn, "__esModule", { value: !0 });
|
|
6409
|
+
const ys = K, ur = B, gs = X, $s = X, Hl = {
|
|
6416
6410
|
keyword: "patternProperties",
|
|
6417
6411
|
type: "object",
|
|
6418
6412
|
schemaType: "object",
|
|
6419
6413
|
code(t) {
|
|
6420
|
-
const { gen: e, schema: r, data: n, parentSchema: s, it: i } = t, { opts: c } = i, l = (0,
|
|
6414
|
+
const { gen: e, schema: r, data: n, parentSchema: s, it: i } = t, { opts: c } = i, l = (0, ys.allSchemaProperties)(r), m = l.filter((S) => (0, gs.alwaysValidSchema)(i, r[S]));
|
|
6421
6415
|
if (l.length === 0 || m.length === l.length && (!i.opts.unevaluated || i.props === !0))
|
|
6422
6416
|
return;
|
|
6423
6417
|
const u = c.strictSchema && !c.allowMatchingProperties && s.properties, p = e.name("valid");
|
|
6424
|
-
i.props !== !0 && !(i.props instanceof ur.Name) && (i.props = (0,
|
|
6418
|
+
i.props !== !0 && !(i.props instanceof ur.Name) && (i.props = (0, $s.evaluatedPropsToName)(e, i.props));
|
|
6425
6419
|
const { props: g } = i;
|
|
6426
6420
|
k();
|
|
6427
6421
|
function k() {
|
|
@@ -6430,33 +6424,33 @@ const gs = K, ur = B, $s = X, _s = X, Vl = {
|
|
|
6430
6424
|
}
|
|
6431
6425
|
function C(S) {
|
|
6432
6426
|
for (const _ in u)
|
|
6433
|
-
new RegExp(S).test(_) && (0,
|
|
6427
|
+
new RegExp(S).test(_) && (0, gs.checkStrictMode)(i, `property ${_} matches pattern ${S} (use allowMatchingProperties)`);
|
|
6434
6428
|
}
|
|
6435
6429
|
function E(S) {
|
|
6436
6430
|
e.forIn("key", n, (_) => {
|
|
6437
|
-
e.if((0, ur._)`${(0,
|
|
6431
|
+
e.if((0, ur._)`${(0, ys.usePattern)(t, S)}.test(${_})`, () => {
|
|
6438
6432
|
const y = m.includes(S);
|
|
6439
6433
|
y || t.subschema({
|
|
6440
6434
|
keyword: "patternProperties",
|
|
6441
6435
|
schemaProp: S,
|
|
6442
6436
|
dataProp: _,
|
|
6443
|
-
dataPropType:
|
|
6437
|
+
dataPropType: $s.Type.Str
|
|
6444
6438
|
}, p), i.opts.unevaluated && g !== !0 ? e.assign((0, ur._)`${g}[${_}]`, !0) : !y && !i.allErrors && e.if((0, ur.not)(p), () => e.break());
|
|
6445
6439
|
});
|
|
6446
6440
|
});
|
|
6447
6441
|
}
|
|
6448
6442
|
}
|
|
6449
6443
|
};
|
|
6450
|
-
|
|
6451
|
-
var
|
|
6452
|
-
Object.defineProperty(
|
|
6453
|
-
const
|
|
6444
|
+
bn.default = Hl;
|
|
6445
|
+
var Pn = {};
|
|
6446
|
+
Object.defineProperty(Pn, "__esModule", { value: !0 });
|
|
6447
|
+
const Vl = X, zl = {
|
|
6454
6448
|
keyword: "not",
|
|
6455
6449
|
schemaType: ["object", "boolean"],
|
|
6456
6450
|
trackErrors: !0,
|
|
6457
6451
|
code(t) {
|
|
6458
6452
|
const { gen: e, schema: r, it: n } = t;
|
|
6459
|
-
if ((0,
|
|
6453
|
+
if ((0, Vl.alwaysValidSchema)(n, r)) {
|
|
6460
6454
|
t.fail();
|
|
6461
6455
|
return;
|
|
6462
6456
|
}
|
|
@@ -6470,27 +6464,27 @@ const zl = X, Wl = {
|
|
|
6470
6464
|
},
|
|
6471
6465
|
error: { message: "must NOT be valid" }
|
|
6472
6466
|
};
|
|
6473
|
-
|
|
6474
|
-
var
|
|
6475
|
-
Object.defineProperty(
|
|
6476
|
-
const
|
|
6467
|
+
Pn.default = zl;
|
|
6468
|
+
var En = {};
|
|
6469
|
+
Object.defineProperty(En, "__esModule", { value: !0 });
|
|
6470
|
+
const Wl = K, Kl = {
|
|
6477
6471
|
keyword: "anyOf",
|
|
6478
6472
|
schemaType: "array",
|
|
6479
6473
|
trackErrors: !0,
|
|
6480
|
-
code:
|
|
6474
|
+
code: Wl.validateUnion,
|
|
6481
6475
|
error: { message: "must match a schema in anyOf" }
|
|
6482
6476
|
};
|
|
6483
|
-
|
|
6484
|
-
var
|
|
6485
|
-
Object.defineProperty(
|
|
6486
|
-
const mr = B,
|
|
6477
|
+
En.default = Kl;
|
|
6478
|
+
var Sn = {};
|
|
6479
|
+
Object.defineProperty(Sn, "__esModule", { value: !0 });
|
|
6480
|
+
const mr = B, Bl = X, Gl = {
|
|
6487
6481
|
message: "must match exactly one schema in oneOf",
|
|
6488
6482
|
params: ({ params: t }) => (0, mr._)`{passingSchemas: ${t.passing}}`
|
|
6489
|
-
},
|
|
6483
|
+
}, xl = {
|
|
6490
6484
|
keyword: "oneOf",
|
|
6491
6485
|
schemaType: "array",
|
|
6492
6486
|
trackErrors: !0,
|
|
6493
|
-
error:
|
|
6487
|
+
error: Gl,
|
|
6494
6488
|
code(t) {
|
|
6495
6489
|
const { gen: e, schema: r, parentSchema: n, it: s } = t;
|
|
6496
6490
|
if (!Array.isArray(r))
|
|
@@ -6502,7 +6496,7 @@ const mr = B, Gl = X, xl = {
|
|
|
6502
6496
|
function u() {
|
|
6503
6497
|
i.forEach((p, g) => {
|
|
6504
6498
|
let k;
|
|
6505
|
-
(0,
|
|
6499
|
+
(0, Bl.alwaysValidSchema)(s, p) ? e.var(m, !0) : k = t.subschema({
|
|
6506
6500
|
keyword: "oneOf",
|
|
6507
6501
|
schemaProp: g,
|
|
6508
6502
|
compositeRule: !0
|
|
@@ -6513,10 +6507,10 @@ const mr = B, Gl = X, xl = {
|
|
|
6513
6507
|
}
|
|
6514
6508
|
}
|
|
6515
6509
|
};
|
|
6516
|
-
|
|
6517
|
-
var
|
|
6518
|
-
Object.defineProperty(
|
|
6519
|
-
const
|
|
6510
|
+
Sn.default = xl;
|
|
6511
|
+
var Tn = {};
|
|
6512
|
+
Object.defineProperty(Tn, "__esModule", { value: !0 });
|
|
6513
|
+
const Jl = X, Yl = {
|
|
6520
6514
|
keyword: "allOf",
|
|
6521
6515
|
schemaType: "array",
|
|
6522
6516
|
code(t) {
|
|
@@ -6525,28 +6519,28 @@ const Yl = X, Zl = {
|
|
|
6525
6519
|
throw new Error("ajv implementation error");
|
|
6526
6520
|
const s = e.name("valid");
|
|
6527
6521
|
r.forEach((i, c) => {
|
|
6528
|
-
if ((0,
|
|
6522
|
+
if ((0, Jl.alwaysValidSchema)(n, i))
|
|
6529
6523
|
return;
|
|
6530
6524
|
const l = t.subschema({ keyword: "allOf", schemaProp: c }, s);
|
|
6531
6525
|
t.ok(s), t.mergeEvaluated(l);
|
|
6532
6526
|
});
|
|
6533
6527
|
}
|
|
6534
6528
|
};
|
|
6535
|
-
|
|
6536
|
-
var
|
|
6537
|
-
Object.defineProperty(
|
|
6538
|
-
const vr = B,
|
|
6529
|
+
Tn.default = Yl;
|
|
6530
|
+
var Rn = {};
|
|
6531
|
+
Object.defineProperty(Rn, "__esModule", { value: !0 });
|
|
6532
|
+
const vr = B, mi = X, Zl = {
|
|
6539
6533
|
message: ({ params: t }) => (0, vr.str)`must match "${t.ifClause}" schema`,
|
|
6540
6534
|
params: ({ params: t }) => (0, vr._)`{failingKeyword: ${t.ifClause}}`
|
|
6541
|
-
},
|
|
6535
|
+
}, Ql = {
|
|
6542
6536
|
keyword: "if",
|
|
6543
6537
|
schemaType: ["object", "boolean"],
|
|
6544
6538
|
trackErrors: !0,
|
|
6545
|
-
error:
|
|
6539
|
+
error: Zl,
|
|
6546
6540
|
code(t) {
|
|
6547
6541
|
const { gen: e, parentSchema: r, it: n } = t;
|
|
6548
|
-
r.then === void 0 && r.else === void 0 && (0,
|
|
6549
|
-
const s =
|
|
6542
|
+
r.then === void 0 && r.else === void 0 && (0, mi.checkStrictMode)(n, '"if" without "then" and "else" is ignored');
|
|
6543
|
+
const s = _s(n, "then"), i = _s(n, "else");
|
|
6550
6544
|
if (!s && !i)
|
|
6551
6545
|
return;
|
|
6552
6546
|
const c = e.let("valid", !0), l = e.name("_valid");
|
|
@@ -6573,53 +6567,53 @@ const vr = B, yi = X, Ql = {
|
|
|
6573
6567
|
}
|
|
6574
6568
|
}
|
|
6575
6569
|
};
|
|
6576
|
-
function
|
|
6570
|
+
function _s(t, e) {
|
|
6577
6571
|
const r = t.schema[e];
|
|
6578
|
-
return r !== void 0 && !(0,
|
|
6572
|
+
return r !== void 0 && !(0, mi.alwaysValidSchema)(t, r);
|
|
6579
6573
|
}
|
|
6580
|
-
|
|
6581
|
-
var
|
|
6582
|
-
Object.defineProperty(
|
|
6583
|
-
const
|
|
6574
|
+
Rn.default = Ql;
|
|
6575
|
+
var On = {};
|
|
6576
|
+
Object.defineProperty(On, "__esModule", { value: !0 });
|
|
6577
|
+
const Xl = X, eu = {
|
|
6584
6578
|
keyword: ["then", "else"],
|
|
6585
6579
|
schemaType: ["object", "boolean"],
|
|
6586
6580
|
code({ keyword: t, parentSchema: e, it: r }) {
|
|
6587
|
-
e.if === void 0 && (0,
|
|
6581
|
+
e.if === void 0 && (0, Xl.checkStrictMode)(r, `"${t}" without "if" is ignored`);
|
|
6588
6582
|
}
|
|
6589
6583
|
};
|
|
6590
|
-
|
|
6591
|
-
Object.defineProperty(
|
|
6592
|
-
const
|
|
6593
|
-
function
|
|
6584
|
+
On.default = eu;
|
|
6585
|
+
Object.defineProperty(yn, "__esModule", { value: !0 });
|
|
6586
|
+
const tu = Nt, ru = gn, nu = Ct, su = $n, iu = _n, ou = fi, au = vn, cu = Sr, lu = wn, uu = bn, du = Pn, pu = En, fu = Sn, hu = Tn, mu = Rn, yu = On;
|
|
6587
|
+
function gu(t = !1) {
|
|
6594
6588
|
const e = [
|
|
6595
6589
|
// any
|
|
6590
|
+
du.default,
|
|
6596
6591
|
pu.default,
|
|
6597
6592
|
fu.default,
|
|
6598
6593
|
hu.default,
|
|
6599
6594
|
mu.default,
|
|
6600
6595
|
yu.default,
|
|
6601
|
-
gu.default,
|
|
6602
6596
|
// object
|
|
6597
|
+
au.default,
|
|
6603
6598
|
cu.default,
|
|
6599
|
+
ou.default,
|
|
6604
6600
|
lu.default,
|
|
6605
|
-
|
|
6606
|
-
uu.default,
|
|
6607
|
-
du.default
|
|
6601
|
+
uu.default
|
|
6608
6602
|
];
|
|
6609
|
-
return t ? e.push(
|
|
6603
|
+
return t ? e.push(ru.default, su.default) : e.push(tu.default, nu.default), e.push(iu.default), e;
|
|
6610
6604
|
}
|
|
6611
|
-
|
|
6612
|
-
var
|
|
6613
|
-
Object.defineProperty(
|
|
6614
|
-
const ue = B,
|
|
6605
|
+
yn.default = gu;
|
|
6606
|
+
var Nn = {}, Cn = {};
|
|
6607
|
+
Object.defineProperty(Cn, "__esModule", { value: !0 });
|
|
6608
|
+
const ue = B, $u = {
|
|
6615
6609
|
message: ({ schemaCode: t }) => (0, ue.str)`must match format "${t}"`,
|
|
6616
6610
|
params: ({ schemaCode: t }) => (0, ue._)`{format: ${t}}`
|
|
6617
|
-
},
|
|
6611
|
+
}, _u = {
|
|
6618
6612
|
keyword: "format",
|
|
6619
6613
|
type: ["number", "string"],
|
|
6620
6614
|
schemaType: "string",
|
|
6621
6615
|
$data: !0,
|
|
6622
|
-
error:
|
|
6616
|
+
error: $u,
|
|
6623
6617
|
code(t, e) {
|
|
6624
6618
|
const { gen: r, data: n, $data: s, schema: i, schemaCode: c, it: l } = t, { opts: m, errSchemaPath: u, schemaEnv: p, self: g } = l;
|
|
6625
6619
|
if (!m.validateFormats)
|
|
@@ -6674,10 +6668,10 @@ const ue = B, _u = {
|
|
|
6674
6668
|
}
|
|
6675
6669
|
}
|
|
6676
6670
|
};
|
|
6677
|
-
|
|
6678
|
-
Object.defineProperty(
|
|
6679
|
-
const
|
|
6680
|
-
|
|
6671
|
+
Cn.default = _u;
|
|
6672
|
+
Object.defineProperty(Nn, "__esModule", { value: !0 });
|
|
6673
|
+
const vu = Cn, wu = [vu.default];
|
|
6674
|
+
Nn.default = wu;
|
|
6681
6675
|
var Ot = {};
|
|
6682
6676
|
Object.defineProperty(Ot, "__esModule", { value: !0 });
|
|
6683
6677
|
Ot.contentVocabulary = Ot.metadataVocabulary = void 0;
|
|
@@ -6695,31 +6689,31 @@ Ot.contentVocabulary = [
|
|
|
6695
6689
|
"contentEncoding",
|
|
6696
6690
|
"contentSchema"
|
|
6697
6691
|
];
|
|
6698
|
-
Object.defineProperty(
|
|
6699
|
-
const
|
|
6692
|
+
Object.defineProperty(en, "__esModule", { value: !0 });
|
|
6693
|
+
const bu = tn, Pu = nn, Eu = yn, Su = Nn, vs = Ot, Tu = [
|
|
6694
|
+
bu.default,
|
|
6700
6695
|
Pu.default,
|
|
6701
|
-
Eu.default,
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
ws.contentVocabulary
|
|
6696
|
+
(0, Eu.default)(),
|
|
6697
|
+
Su.default,
|
|
6698
|
+
vs.metadataVocabulary,
|
|
6699
|
+
vs.contentVocabulary
|
|
6706
6700
|
];
|
|
6707
|
-
|
|
6708
|
-
var
|
|
6701
|
+
en.default = Tu;
|
|
6702
|
+
var jn = {}, yi = {};
|
|
6709
6703
|
(function(t) {
|
|
6710
6704
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.DiscrError = void 0, function(e) {
|
|
6711
6705
|
e.Tag = "tag", e.Mapping = "mapping";
|
|
6712
6706
|
}(t.DiscrError || (t.DiscrError = {}));
|
|
6713
|
-
})(
|
|
6714
|
-
Object.defineProperty(
|
|
6715
|
-
const Pt = B, Lr =
|
|
6707
|
+
})(yi);
|
|
6708
|
+
Object.defineProperty(jn, "__esModule", { value: !0 });
|
|
6709
|
+
const Pt = B, Lr = yi, ws = ve, Ru = X, Ou = {
|
|
6716
6710
|
message: ({ params: { discrError: t, tagName: e } }) => t === Lr.DiscrError.Tag ? `tag "${e}" must be string` : `value of tag "${e}" must be in oneOf`,
|
|
6717
6711
|
params: ({ params: { discrError: t, tag: e, tagName: r } }) => (0, Pt._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`
|
|
6718
|
-
},
|
|
6712
|
+
}, Nu = {
|
|
6719
6713
|
keyword: "discriminator",
|
|
6720
6714
|
type: "object",
|
|
6721
6715
|
schemaType: "object",
|
|
6722
|
-
error:
|
|
6716
|
+
error: Ou,
|
|
6723
6717
|
code(t) {
|
|
6724
6718
|
const { gen: e, data: r, schema: n, parentSchema: s, it: i } = t, { oneOf: c } = s;
|
|
6725
6719
|
if (!i.opts.discriminator)
|
|
@@ -6750,7 +6744,7 @@ const Pt = B, Lr = gi, bs = ve, Ou = X, Nu = {
|
|
|
6750
6744
|
let _ = !0;
|
|
6751
6745
|
for (let j = 0; j < c.length; j++) {
|
|
6752
6746
|
let D = c[j];
|
|
6753
|
-
D?.$ref && !(0,
|
|
6747
|
+
D?.$ref && !(0, Ru.schemaHasRulesButRef)(D, i.self.RULES) && (D = ws.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, D?.$ref), D instanceof ws.SchemaEnv && (D = D.schema));
|
|
6754
6748
|
const v = (C = D?.properties) === null || C === void 0 ? void 0 : C[l];
|
|
6755
6749
|
if (typeof v != "object")
|
|
6756
6750
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
|
|
@@ -6779,8 +6773,8 @@ const Pt = B, Lr = gi, bs = ve, Ou = X, Nu = {
|
|
|
6779
6773
|
}
|
|
6780
6774
|
}
|
|
6781
6775
|
};
|
|
6782
|
-
|
|
6783
|
-
const
|
|
6776
|
+
jn.default = Nu;
|
|
6777
|
+
const Cu = "http://json-schema.org/draft-07/schema#", ju = "http://json-schema.org/draft-07/schema#", ku = "Core schema meta-schema", Iu = {
|
|
6784
6778
|
schemaArray: {
|
|
6785
6779
|
type: "array",
|
|
6786
6780
|
minItems: 1,
|
|
@@ -6821,10 +6815,10 @@ const ju = "http://json-schema.org/draft-07/schema#", ku = "http://json-schema.o
|
|
|
6821
6815
|
uniqueItems: !0,
|
|
6822
6816
|
default: []
|
|
6823
6817
|
}
|
|
6824
|
-
},
|
|
6818
|
+
}, Au = [
|
|
6825
6819
|
"object",
|
|
6826
6820
|
"boolean"
|
|
6827
|
-
],
|
|
6821
|
+
], Du = {
|
|
6828
6822
|
$id: {
|
|
6829
6823
|
type: "string",
|
|
6830
6824
|
format: "uri-reference"
|
|
@@ -7012,18 +7006,18 @@ const ju = "http://json-schema.org/draft-07/schema#", ku = "http://json-schema.o
|
|
|
7012
7006
|
not: {
|
|
7013
7007
|
$ref: "#"
|
|
7014
7008
|
}
|
|
7015
|
-
},
|
|
7016
|
-
$schema:
|
|
7017
|
-
$id:
|
|
7018
|
-
title:
|
|
7019
|
-
definitions:
|
|
7020
|
-
type:
|
|
7021
|
-
properties:
|
|
7009
|
+
}, qu = {
|
|
7010
|
+
$schema: Cu,
|
|
7011
|
+
$id: ju,
|
|
7012
|
+
title: ku,
|
|
7013
|
+
definitions: Iu,
|
|
7014
|
+
type: Au,
|
|
7015
|
+
properties: Du,
|
|
7022
7016
|
default: !0
|
|
7023
7017
|
};
|
|
7024
7018
|
(function(t, e) {
|
|
7025
7019
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.MissingRefError = e.ValidationError = e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
|
|
7026
|
-
const r =
|
|
7020
|
+
const r = qs, n = en, s = jn, i = qu, c = ["/properties"], l = "http://json-schema.org/draft-07/schema";
|
|
7027
7021
|
class m extends r.default {
|
|
7028
7022
|
_addVocabularies() {
|
|
7029
7023
|
super._addVocabularies(), n.default.forEach((E) => this.addVocabulary(E)), this.opts.discriminator && this.addKeyword(s.default);
|
|
@@ -7066,8 +7060,8 @@ const ju = "http://json-schema.org/draft-07/schema#", ku = "http://json-schema.o
|
|
|
7066
7060
|
return k.default;
|
|
7067
7061
|
} });
|
|
7068
7062
|
})(Ar, Ar.exports);
|
|
7069
|
-
var
|
|
7070
|
-
const
|
|
7063
|
+
var Fu = Ar.exports;
|
|
7064
|
+
const Mu = /* @__PURE__ */ Bo(Fu), Uu = "http://json-schema.org/schema", Lu = "#/definitions/Blueprint", Hu = {
|
|
7071
7065
|
Blueprint: {
|
|
7072
7066
|
type: "object",
|
|
7073
7067
|
properties: {
|
|
@@ -8385,22 +8379,22 @@ const Uu = /* @__PURE__ */ Go(Mu), Lu = "http://json-schema.org/schema", Hu = "#
|
|
|
8385
8379
|
},
|
|
8386
8380
|
additionalProperties: !1
|
|
8387
8381
|
}
|
|
8388
|
-
},
|
|
8389
|
-
$schema:
|
|
8390
|
-
$ref:
|
|
8391
|
-
definitions:
|
|
8382
|
+
}, Vu = {
|
|
8383
|
+
$schema: Uu,
|
|
8384
|
+
$ref: Lu,
|
|
8385
|
+
definitions: Hu
|
|
8392
8386
|
};
|
|
8393
|
-
function
|
|
8387
|
+
function Yu(t, {
|
|
8394
8388
|
progress: e = new Wr(),
|
|
8395
|
-
semaphore: r = new
|
|
8389
|
+
semaphore: r = new Rs({ concurrency: 3 }),
|
|
8396
8390
|
onStepCompleted: n = () => {
|
|
8397
8391
|
}
|
|
8398
8392
|
} = {}) {
|
|
8399
8393
|
t = {
|
|
8400
8394
|
...t,
|
|
8401
|
-
steps: (t.steps || []).filter(
|
|
8395
|
+
steps: (t.steps || []).filter(Gu)
|
|
8402
8396
|
};
|
|
8403
|
-
const { valid: s, errors: i } =
|
|
8397
|
+
const { valid: s, errors: i } = Wu(t);
|
|
8404
8398
|
if (!s) {
|
|
8405
8399
|
const u = new Error(
|
|
8406
8400
|
`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`
|
|
@@ -8411,7 +8405,7 @@ function Qu(t, {
|
|
|
8411
8405
|
(u, p) => u + (p.progress?.weight || 1),
|
|
8412
8406
|
0
|
|
8413
8407
|
), m = c.map(
|
|
8414
|
-
(u) =>
|
|
8408
|
+
(u) => xu(u, {
|
|
8415
8409
|
semaphore: r,
|
|
8416
8410
|
rootProgressTracker: e,
|
|
8417
8411
|
totalProgressWeight: l
|
|
@@ -8419,14 +8413,14 @@ function Qu(t, {
|
|
|
8419
8413
|
);
|
|
8420
8414
|
return {
|
|
8421
8415
|
versions: {
|
|
8422
|
-
php:
|
|
8416
|
+
php: Ku(
|
|
8423
8417
|
t.preferredVersions?.php,
|
|
8424
|
-
|
|
8425
|
-
|
|
8418
|
+
js,
|
|
8419
|
+
wo
|
|
8426
8420
|
),
|
|
8427
8421
|
wp: t.preferredVersions?.wp || "latest"
|
|
8428
8422
|
},
|
|
8429
|
-
phpExtensions:
|
|
8423
|
+
phpExtensions: Bu(
|
|
8430
8424
|
[],
|
|
8431
8425
|
t.phpExtensionBundles || []
|
|
8432
8426
|
),
|
|
@@ -8451,10 +8445,10 @@ function Qu(t, {
|
|
|
8451
8445
|
}
|
|
8452
8446
|
};
|
|
8453
8447
|
}
|
|
8454
|
-
const
|
|
8448
|
+
const zu = new Mu({ discriminator: !0 });
|
|
8455
8449
|
let dr;
|
|
8456
|
-
function
|
|
8457
|
-
dr =
|
|
8450
|
+
function Wu(t) {
|
|
8451
|
+
dr = zu.compile(Vu);
|
|
8458
8452
|
const e = dr(t);
|
|
8459
8453
|
if (e)
|
|
8460
8454
|
return { valid: e };
|
|
@@ -8469,21 +8463,21 @@ function Ku(t) {
|
|
|
8469
8463
|
errors: n
|
|
8470
8464
|
};
|
|
8471
8465
|
}
|
|
8472
|
-
function
|
|
8466
|
+
function Ku(t, e, r) {
|
|
8473
8467
|
return t && e.includes(t) ? t : r;
|
|
8474
8468
|
}
|
|
8475
|
-
function
|
|
8476
|
-
const r =
|
|
8469
|
+
function Bu(t, e) {
|
|
8470
|
+
const r = ks.filter(
|
|
8477
8471
|
(s) => t.includes(s)
|
|
8478
8472
|
), n = e.flatMap(
|
|
8479
|
-
(s) => s in
|
|
8473
|
+
(s) => s in Xn ? Xn[s] : []
|
|
8480
8474
|
);
|
|
8481
8475
|
return Array.from(/* @__PURE__ */ new Set([...r, ...n]));
|
|
8482
8476
|
}
|
|
8483
|
-
function
|
|
8477
|
+
function Gu(t) {
|
|
8484
8478
|
return !!(typeof t == "object" && t);
|
|
8485
8479
|
}
|
|
8486
|
-
function
|
|
8480
|
+
function xu(t, {
|
|
8487
8481
|
semaphore: e,
|
|
8488
8482
|
rootProgressTracker: r,
|
|
8489
8483
|
totalProgressWeight: n
|
|
@@ -8493,15 +8487,15 @@ function Ju(t, {
|
|
|
8493
8487
|
), i = {};
|
|
8494
8488
|
for (const p of Object.keys(t)) {
|
|
8495
8489
|
let g = t[p];
|
|
8496
|
-
|
|
8490
|
+
qo(g) && (g = ut.create(g, {
|
|
8497
8491
|
semaphore: e
|
|
8498
8492
|
})), i[p] = g;
|
|
8499
8493
|
}
|
|
8500
8494
|
const c = async (p) => {
|
|
8501
8495
|
try {
|
|
8502
|
-
return s.fillSlowly(), await
|
|
8496
|
+
return s.fillSlowly(), await ao[t.step](
|
|
8503
8497
|
p,
|
|
8504
|
-
await
|
|
8498
|
+
await Ju(i),
|
|
8505
8499
|
{
|
|
8506
8500
|
tracker: s,
|
|
8507
8501
|
initialCaption: t.progress?.caption
|
|
@@ -8510,14 +8504,14 @@ function Ju(t, {
|
|
|
8510
8504
|
} finally {
|
|
8511
8505
|
s.finish();
|
|
8512
8506
|
}
|
|
8513
|
-
}, l =
|
|
8507
|
+
}, l = bs(i), m = bs(i).filter(
|
|
8514
8508
|
(p) => p.isAsync
|
|
8515
8509
|
), u = 1 / (m.length + 1);
|
|
8516
8510
|
for (const p of m)
|
|
8517
8511
|
p.progress = s.stage(u);
|
|
8518
8512
|
return { run: c, step: t, resources: l };
|
|
8519
8513
|
}
|
|
8520
|
-
function
|
|
8514
|
+
function bs(t) {
|
|
8521
8515
|
const e = [];
|
|
8522
8516
|
for (const r in t) {
|
|
8523
8517
|
const n = t[r];
|
|
@@ -8525,7 +8519,7 @@ function Ps(t) {
|
|
|
8525
8519
|
}
|
|
8526
8520
|
return e;
|
|
8527
8521
|
}
|
|
8528
|
-
async function
|
|
8522
|
+
async function Ju(t) {
|
|
8529
8523
|
const e = {};
|
|
8530
8524
|
for (const r in t) {
|
|
8531
8525
|
const n = t[r];
|
|
@@ -8533,36 +8527,38 @@ async function Yu(t) {
|
|
|
8533
8527
|
}
|
|
8534
8528
|
return e;
|
|
8535
8529
|
}
|
|
8536
|
-
async function
|
|
8530
|
+
async function Zu(t, e) {
|
|
8537
8531
|
await t.run(e);
|
|
8538
8532
|
}
|
|
8533
|
+
function Qu() {
|
|
8534
|
+
}
|
|
8539
8535
|
export {
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8536
|
+
Ps as activatePlugin,
|
|
8537
|
+
Es as activateTheme,
|
|
8538
|
+
qi as applyWordPressPatches,
|
|
8539
|
+
Yu as compileBlueprint,
|
|
8540
|
+
Vi as cp,
|
|
8541
|
+
Gi as defineSiteUrl,
|
|
8546
8542
|
Wt as defineWpConfigConsts,
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8543
|
+
Zi as importFile,
|
|
8544
|
+
eo as installPlugin,
|
|
8545
|
+
ro as installTheme,
|
|
8546
|
+
no as login,
|
|
8547
|
+
Ki as mkdir,
|
|
8548
|
+
zi as mv,
|
|
8549
|
+
Yi as replaceSite,
|
|
8550
|
+
Hi as request,
|
|
8551
|
+
Wi as rm,
|
|
8552
|
+
Bi as rmdir,
|
|
8553
|
+
Zu as runBlueprintSteps,
|
|
8554
|
+
Mi as runPHP,
|
|
8555
|
+
Ui as runPHPWithOptions,
|
|
8556
|
+
so as runWpInstallationWizard,
|
|
8557
|
+
Li as setPhpIniEntry,
|
|
8558
|
+
Qu as setPluginProxyURL,
|
|
8559
|
+
io as setSiteOptions,
|
|
8564
8560
|
zr as unzip,
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8561
|
+
oo as updateUserMeta,
|
|
8562
|
+
Ts as writeFile,
|
|
8563
|
+
Ji as zipEntireSite
|
|
8568
8564
|
};
|