@anov/cic-standard-sdk 0.0.12 → 0.0.14
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/dist/cic-sdk.cjs.js +4 -4
- package/dist/cic-sdk.es.js +874 -841
- package/dist/cic-sdk.umd.js +4 -4
- package/dist/sdk/generators/common.d.ts +1 -1
- package/dist/types/page.d.ts +1 -1
- package/package.json +2 -2
package/dist/cic-sdk.es.js
CHANGED
|
@@ -8,11 +8,11 @@ function Et() {
|
|
|
8
8
|
class t {
|
|
9
9
|
}
|
|
10
10
|
e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
11
|
-
class
|
|
12
|
-
constructor(
|
|
13
|
-
if (super(), !e.IDENTIFIER.test(
|
|
11
|
+
class r extends t {
|
|
12
|
+
constructor(n) {
|
|
13
|
+
if (super(), !e.IDENTIFIER.test(n))
|
|
14
14
|
throw new Error("CodeGen: name must be a valid identifier");
|
|
15
|
-
this.str =
|
|
15
|
+
this.str = n;
|
|
16
16
|
}
|
|
17
17
|
toString() {
|
|
18
18
|
return this.str;
|
|
@@ -24,10 +24,10 @@ function Et() {
|
|
|
24
24
|
return { [this.str]: 1 };
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
e.Name =
|
|
27
|
+
e.Name = r;
|
|
28
28
|
class i extends t {
|
|
29
|
-
constructor(
|
|
30
|
-
super(), this._items = typeof
|
|
29
|
+
constructor(n) {
|
|
30
|
+
super(), this._items = typeof n == "string" ? [n] : n;
|
|
31
31
|
}
|
|
32
32
|
toString() {
|
|
33
33
|
return this.str;
|
|
@@ -35,66 +35,66 @@ function Et() {
|
|
|
35
35
|
emptyStr() {
|
|
36
36
|
if (this._items.length > 1)
|
|
37
37
|
return !1;
|
|
38
|
-
const
|
|
39
|
-
return
|
|
38
|
+
const n = this._items[0];
|
|
39
|
+
return n === "" || n === '""';
|
|
40
40
|
}
|
|
41
41
|
get str() {
|
|
42
|
-
var
|
|
43
|
-
return (
|
|
42
|
+
var n;
|
|
43
|
+
return (n = this._str) !== null && n !== void 0 ? n : this._str = this._items.reduce((c, g) => `${c}${g}`, "");
|
|
44
44
|
}
|
|
45
45
|
get names() {
|
|
46
|
-
var
|
|
47
|
-
return (
|
|
46
|
+
var n;
|
|
47
|
+
return (n = this._names) !== null && n !== void 0 ? n : this._names = this._items.reduce((c, g) => (g instanceof r && (c[g.str] = (c[g.str] || 0) + 1), c), {});
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
e._Code = i, e.nil = new i("");
|
|
51
|
-
function y(u, ...
|
|
51
|
+
function y(u, ...n) {
|
|
52
52
|
const c = [u[0]];
|
|
53
53
|
let g = 0;
|
|
54
|
-
for (; g <
|
|
55
|
-
d(c,
|
|
54
|
+
for (; g < n.length; )
|
|
55
|
+
d(c, n[g]), c.push(u[++g]);
|
|
56
56
|
return new i(c);
|
|
57
57
|
}
|
|
58
58
|
e._ = y;
|
|
59
59
|
const s = new i("+");
|
|
60
|
-
function l(u, ...
|
|
60
|
+
function l(u, ...n) {
|
|
61
61
|
const c = [v(u[0])];
|
|
62
62
|
let g = 0;
|
|
63
|
-
for (; g <
|
|
64
|
-
c.push(s), d(c,
|
|
63
|
+
for (; g < n.length; )
|
|
64
|
+
c.push(s), d(c, n[g]), c.push(s, v(u[++g]));
|
|
65
65
|
return f(c), new i(c);
|
|
66
66
|
}
|
|
67
67
|
e.str = l;
|
|
68
|
-
function d(u,
|
|
69
|
-
|
|
68
|
+
function d(u, n) {
|
|
69
|
+
n instanceof i ? u.push(...n._items) : n instanceof r ? u.push(n) : u.push(E(n));
|
|
70
70
|
}
|
|
71
71
|
e.addCodeArg = d;
|
|
72
72
|
function f(u) {
|
|
73
|
-
let
|
|
74
|
-
for (;
|
|
75
|
-
if (u[
|
|
76
|
-
const c = w(u[
|
|
73
|
+
let n = 1;
|
|
74
|
+
for (; n < u.length - 1; ) {
|
|
75
|
+
if (u[n] === s) {
|
|
76
|
+
const c = w(u[n - 1], u[n + 1]);
|
|
77
77
|
if (c !== void 0) {
|
|
78
|
-
u.splice(
|
|
78
|
+
u.splice(n - 1, 3, c);
|
|
79
79
|
continue;
|
|
80
80
|
}
|
|
81
|
-
u[
|
|
81
|
+
u[n++] = "+";
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
n++;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function w(u,
|
|
87
|
-
if (
|
|
86
|
+
function w(u, n) {
|
|
87
|
+
if (n === '""')
|
|
88
88
|
return u;
|
|
89
89
|
if (u === '""')
|
|
90
|
-
return
|
|
90
|
+
return n;
|
|
91
91
|
if (typeof u == "string")
|
|
92
|
-
return
|
|
93
|
-
if (typeof
|
|
94
|
-
return `"${u}${
|
|
92
|
+
return n instanceof r || u[u.length - 1] !== '"' ? void 0 : typeof n != "string" ? `${u.slice(0, -1)}${n}"` : n[0] === '"' ? u.slice(0, -1) + n.slice(1) : void 0;
|
|
93
|
+
if (typeof n == "string" && n[0] === '"' && !(u instanceof r))
|
|
94
|
+
return `"${u}${n.slice(1)}`;
|
|
95
95
|
}
|
|
96
|
-
function $(u,
|
|
97
|
-
return
|
|
96
|
+
function $(u, n) {
|
|
97
|
+
return n.emptyStr() ? u : u.emptyStr() ? n : l`${u}${n}`;
|
|
98
98
|
}
|
|
99
99
|
e.strConcat = $;
|
|
100
100
|
function E(u) {
|
|
@@ -129,7 +129,7 @@ function ur() {
|
|
|
129
129
|
return dr || (dr = 1, (function(e) {
|
|
130
130
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
|
|
131
131
|
const t = Et();
|
|
132
|
-
class
|
|
132
|
+
class r extends Error {
|
|
133
133
|
constructor(w) {
|
|
134
134
|
super(`CodeGen: "code" for ${w} not defined`), this.value = w.value;
|
|
135
135
|
}
|
|
@@ -191,9 +191,9 @@ function ur() {
|
|
|
191
191
|
const _ = this.toName(w), { prefix: v } = _, b = (E = $.key) !== null && E !== void 0 ? E : $.ref;
|
|
192
192
|
let h = this._values[v];
|
|
193
193
|
if (h) {
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
return
|
|
194
|
+
const n = h.get(b);
|
|
195
|
+
if (n)
|
|
196
|
+
return n;
|
|
197
197
|
} else
|
|
198
198
|
h = this._values[v] = /* @__PURE__ */ new Map();
|
|
199
199
|
h.set(b, _);
|
|
@@ -230,14 +230,14 @@ function ur() {
|
|
|
230
230
|
if (a.has(u))
|
|
231
231
|
return;
|
|
232
232
|
a.set(u, i.Started);
|
|
233
|
-
let
|
|
234
|
-
if (
|
|
233
|
+
let n = $(u);
|
|
234
|
+
if (n) {
|
|
235
235
|
const c = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
|
|
236
|
-
v = (0, t._)`${v}${c} ${u} = ${
|
|
237
|
-
} else if (
|
|
238
|
-
v = (0, t._)`${v}${
|
|
236
|
+
v = (0, t._)`${v}${c} ${u} = ${n};${this.opts._n}`;
|
|
237
|
+
} else if (n = _?.(u))
|
|
238
|
+
v = (0, t._)`${v}${n}${this.opts._n}`;
|
|
239
239
|
else
|
|
240
|
-
throw new
|
|
240
|
+
throw new r(u);
|
|
241
241
|
a.set(u, i.Completed);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
@@ -251,7 +251,7 @@ var lr;
|
|
|
251
251
|
function G() {
|
|
252
252
|
return lr || (lr = 1, (function(e) {
|
|
253
253
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
|
|
254
|
-
const t = Et(),
|
|
254
|
+
const t = Et(), r = ur();
|
|
255
255
|
var i = Et();
|
|
256
256
|
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
257
257
|
return i._;
|
|
@@ -304,7 +304,7 @@ function G() {
|
|
|
304
304
|
super(), this.varKind = p, this.name = S, this.rhs = N;
|
|
305
305
|
}
|
|
306
306
|
render({ es5: p, _n: S }) {
|
|
307
|
-
const N = p ?
|
|
307
|
+
const N = p ? r.varKinds.var : this.varKind, U = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
308
308
|
return `${N} ${this.name}${U};` + S;
|
|
309
309
|
}
|
|
310
310
|
optimizeNames(p, S) {
|
|
@@ -404,7 +404,7 @@ function G() {
|
|
|
404
404
|
let U = N.length;
|
|
405
405
|
for (; U--; ) {
|
|
406
406
|
const J = N[U];
|
|
407
|
-
J.optimizeNames(p, S) || (
|
|
407
|
+
J.optimizeNames(p, S) || (x(p, J.names), N.splice(U, 1));
|
|
408
408
|
}
|
|
409
409
|
return N.length > 0 ? this : void 0;
|
|
410
410
|
}
|
|
@@ -456,10 +456,10 @@ function G() {
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
u.kind = "if";
|
|
459
|
-
class
|
|
459
|
+
class n extends b {
|
|
460
460
|
}
|
|
461
|
-
|
|
462
|
-
class c extends
|
|
461
|
+
n.kind = "for";
|
|
462
|
+
class c extends n {
|
|
463
463
|
constructor(p) {
|
|
464
464
|
super(), this.iteration = p;
|
|
465
465
|
}
|
|
@@ -474,12 +474,12 @@ function G() {
|
|
|
474
474
|
return V(super.names, this.iteration.names);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
class g extends
|
|
477
|
+
class g extends n {
|
|
478
478
|
constructor(p, S, N, U) {
|
|
479
479
|
super(), this.varKind = p, this.name = S, this.from = N, this.to = U;
|
|
480
480
|
}
|
|
481
481
|
render(p) {
|
|
482
|
-
const S = p.es5 ?
|
|
482
|
+
const S = p.es5 ? r.varKinds.var : this.varKind, { name: N, from: U, to: J } = this;
|
|
483
483
|
return `for(${S} ${N}=${U}; ${N}<${J}; ${N}++)` + super.render(p);
|
|
484
484
|
}
|
|
485
485
|
get names() {
|
|
@@ -487,7 +487,7 @@ function G() {
|
|
|
487
487
|
return F(p, this.to);
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
class o extends
|
|
490
|
+
class o extends n {
|
|
491
491
|
constructor(p, S, N, U) {
|
|
492
492
|
super(), this.loop = p, this.varKind = S, this.name = N, this.iterable = U;
|
|
493
493
|
}
|
|
@@ -553,7 +553,7 @@ function G() {
|
|
|
553
553
|
class C {
|
|
554
554
|
constructor(p, S = {}) {
|
|
555
555
|
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...S, _n: S.lines ? `
|
|
556
|
-
` : "" }, this._extScope = p, this._scope = new
|
|
556
|
+
` : "" }, this._extScope = p, this._scope = new r.Scope({ parent: p }), this._nodes = [new h()];
|
|
557
557
|
}
|
|
558
558
|
toString() {
|
|
559
559
|
return this._root.render(this.opts);
|
|
@@ -588,15 +588,15 @@ function G() {
|
|
|
588
588
|
}
|
|
589
589
|
// `const` declaration (`var` in es5 mode)
|
|
590
590
|
const(p, S, N) {
|
|
591
|
-
return this._def(
|
|
591
|
+
return this._def(r.varKinds.const, p, S, N);
|
|
592
592
|
}
|
|
593
593
|
// `let` declaration with optional assignment (`var` in es5 mode)
|
|
594
594
|
let(p, S, N) {
|
|
595
|
-
return this._def(
|
|
595
|
+
return this._def(r.varKinds.let, p, S, N);
|
|
596
596
|
}
|
|
597
597
|
// `var` declaration with optional assignment
|
|
598
598
|
var(p, S, N) {
|
|
599
|
-
return this._def(
|
|
599
|
+
return this._def(r.varKinds.var, p, S, N);
|
|
600
600
|
}
|
|
601
601
|
// assignment code
|
|
602
602
|
assign(p, S, N) {
|
|
@@ -647,24 +647,24 @@ function G() {
|
|
|
647
647
|
return this._for(new c(p), S);
|
|
648
648
|
}
|
|
649
649
|
// `for` statement for a range of values
|
|
650
|
-
forRange(p, S, N, U, J = this.opts.es5 ?
|
|
651
|
-
const
|
|
652
|
-
return this._for(new g(J,
|
|
650
|
+
forRange(p, S, N, U, J = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
|
|
651
|
+
const Q = this._scope.toName(p);
|
|
652
|
+
return this._for(new g(J, Q, S, N), () => U(Q));
|
|
653
653
|
}
|
|
654
654
|
// `for-of` statement (in es5 mode replace with a normal for loop)
|
|
655
|
-
forOf(p, S, N, U =
|
|
655
|
+
forOf(p, S, N, U = r.varKinds.const) {
|
|
656
656
|
const J = this._scope.toName(p);
|
|
657
657
|
if (this.opts.es5) {
|
|
658
|
-
const
|
|
659
|
-
return this.forRange("_i", 0, (0, t._)`${
|
|
660
|
-
this.var(J, (0, t._)`${
|
|
658
|
+
const Q = S instanceof t.Name ? S : this.var("_arr", S);
|
|
659
|
+
return this.forRange("_i", 0, (0, t._)`${Q}.length`, (B) => {
|
|
660
|
+
this.var(J, (0, t._)`${Q}[${B}]`), N(J);
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
663
|
return this._for(new o("of", U, J, S), () => N(J));
|
|
664
664
|
}
|
|
665
665
|
// `for-in` statement.
|
|
666
666
|
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
667
|
-
forIn(p, S, N, U = this.opts.es5 ?
|
|
667
|
+
forIn(p, S, N, U = this.opts.es5 ? r.varKinds.var : r.varKinds.const) {
|
|
668
668
|
if (this.opts.ownProperties)
|
|
669
669
|
return this.forOf(p, (0, t._)`Object.keys(${S})`, N);
|
|
670
670
|
const J = this._scope.toName(p);
|
|
@@ -672,7 +672,7 @@ function G() {
|
|
|
672
672
|
}
|
|
673
673
|
// end `for` loop
|
|
674
674
|
endFor() {
|
|
675
|
-
return this._endBlockNode(
|
|
675
|
+
return this._endBlockNode(n);
|
|
676
676
|
}
|
|
677
677
|
// `label` statement
|
|
678
678
|
label(p) {
|
|
@@ -761,51 +761,51 @@ function G() {
|
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
e.CodeGen = C;
|
|
764
|
-
function V(
|
|
764
|
+
function V(I, p) {
|
|
765
765
|
for (const S in p)
|
|
766
|
-
|
|
767
|
-
return
|
|
768
|
-
}
|
|
769
|
-
function F(
|
|
770
|
-
return p instanceof t._CodeOrName ? V(
|
|
771
|
-
}
|
|
772
|
-
function L(
|
|
773
|
-
if (
|
|
774
|
-
return N(
|
|
775
|
-
if (!U(
|
|
776
|
-
return
|
|
777
|
-
return new t._Code(
|
|
766
|
+
I[S] = (I[S] || 0) + (p[S] || 0);
|
|
767
|
+
return I;
|
|
768
|
+
}
|
|
769
|
+
function F(I, p) {
|
|
770
|
+
return p instanceof t._CodeOrName ? V(I, p.names) : I;
|
|
771
|
+
}
|
|
772
|
+
function L(I, p, S) {
|
|
773
|
+
if (I instanceof t.Name)
|
|
774
|
+
return N(I);
|
|
775
|
+
if (!U(I))
|
|
776
|
+
return I;
|
|
777
|
+
return new t._Code(I._items.reduce((J, Q) => (Q instanceof t.Name && (Q = N(Q)), Q instanceof t._Code ? J.push(...Q._items) : J.push(Q), J), []));
|
|
778
778
|
function N(J) {
|
|
779
|
-
const
|
|
780
|
-
return
|
|
779
|
+
const Q = S[J.str];
|
|
780
|
+
return Q === void 0 || p[J.str] !== 1 ? J : (delete p[J.str], Q);
|
|
781
781
|
}
|
|
782
782
|
function U(J) {
|
|
783
|
-
return J instanceof t._Code && J._items.some((
|
|
783
|
+
return J instanceof t._Code && J._items.some((Q) => Q instanceof t.Name && p[Q.str] === 1 && S[Q.str] !== void 0);
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function x(I, p) {
|
|
787
787
|
for (const S in p)
|
|
788
|
-
|
|
788
|
+
I[S] = (I[S] || 0) - (p[S] || 0);
|
|
789
789
|
}
|
|
790
|
-
function ie(
|
|
791
|
-
return typeof
|
|
790
|
+
function ie(I) {
|
|
791
|
+
return typeof I == "boolean" || typeof I == "number" || I === null ? !I : (0, t._)`!${D(I)}`;
|
|
792
792
|
}
|
|
793
793
|
e.not = ie;
|
|
794
794
|
const oe = j(e.operators.AND);
|
|
795
|
-
function X(...
|
|
796
|
-
return
|
|
795
|
+
function X(...I) {
|
|
796
|
+
return I.reduce(oe);
|
|
797
797
|
}
|
|
798
798
|
e.and = X;
|
|
799
799
|
const pe = j(e.operators.OR);
|
|
800
|
-
function M(...
|
|
801
|
-
return
|
|
800
|
+
function M(...I) {
|
|
801
|
+
return I.reduce(pe);
|
|
802
802
|
}
|
|
803
803
|
e.or = M;
|
|
804
|
-
function j(
|
|
805
|
-
return (p, S) => p === t.nil ? S : S === t.nil ? p : (0, t._)`${D(p)} ${
|
|
804
|
+
function j(I) {
|
|
805
|
+
return (p, S) => p === t.nil ? S : S === t.nil ? p : (0, t._)`${D(p)} ${I} ${D(S)}`;
|
|
806
806
|
}
|
|
807
|
-
function D(
|
|
808
|
-
return
|
|
807
|
+
function D(I) {
|
|
808
|
+
return I instanceof t.Name ? I : (0, t._)`(${I})`;
|
|
809
809
|
}
|
|
810
810
|
})(Kt)), Kt;
|
|
811
811
|
}
|
|
@@ -814,13 +814,13 @@ function Y() {
|
|
|
814
814
|
if (fr) return H;
|
|
815
815
|
fr = 1, Object.defineProperty(H, "__esModule", { value: !0 }), H.checkStrictMode = H.getErrorPath = H.Type = H.useFunc = H.setEvaluated = H.evaluatedPropsToName = H.mergeEvaluated = H.eachItem = H.unescapeJsonPointer = H.escapeJsonPointer = H.escapeFragment = H.unescapeFragment = H.schemaRefOrVal = H.schemaHasRulesButRef = H.schemaHasRules = H.checkUnknownRules = H.alwaysValidSchema = H.toHash = void 0;
|
|
816
816
|
const e = G(), t = Et();
|
|
817
|
-
function
|
|
817
|
+
function r(o) {
|
|
818
818
|
const m = {};
|
|
819
819
|
for (const P of o)
|
|
820
820
|
m[P] = !0;
|
|
821
821
|
return m;
|
|
822
822
|
}
|
|
823
|
-
H.toHash =
|
|
823
|
+
H.toHash = r;
|
|
824
824
|
function i(o, m) {
|
|
825
825
|
return typeof m == "boolean" ? m : Object.keys(m).length === 0 ? !0 : (y(o, m), !s(m, o.self.RULES.all));
|
|
826
826
|
}
|
|
@@ -929,13 +929,13 @@ function Y() {
|
|
|
929
929
|
});
|
|
930
930
|
}
|
|
931
931
|
H.useFunc = u;
|
|
932
|
-
var
|
|
932
|
+
var n;
|
|
933
933
|
(function(o) {
|
|
934
934
|
o[o.Num = 0] = "Num", o[o.Str = 1] = "Str";
|
|
935
|
-
})(
|
|
935
|
+
})(n || (H.Type = n = {}));
|
|
936
936
|
function c(o, m, P) {
|
|
937
937
|
if (o instanceof e.Name) {
|
|
938
|
-
const O = m ===
|
|
938
|
+
const O = m === n.Num;
|
|
939
939
|
return P ? O ? (0, e._)`"[" + ${o} + "]"` : (0, e._)`"['" + ${o} + "']"` : O ? (0, e._)`"/" + ${o}` : (0, e._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
940
940
|
}
|
|
941
941
|
return P ? (0, e.getProperty)(o).toString() : "/" + $(o);
|
|
@@ -989,19 +989,19 @@ var mr;
|
|
|
989
989
|
function Dt() {
|
|
990
990
|
return mr || (mr = 1, (function(e) {
|
|
991
991
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
|
|
992
|
-
const t = G(),
|
|
992
|
+
const t = G(), r = Y(), i = Se();
|
|
993
993
|
e.keywordError = {
|
|
994
994
|
message: ({ keyword: a }) => (0, t.str)`must pass "${a}" keyword validation`
|
|
995
995
|
}, e.keyword$DataError = {
|
|
996
996
|
message: ({ keyword: a, schemaType: u }) => u ? (0, t.str)`"${a}" keyword must be ${u} ($data)` : (0, t.str)`"${a}" keyword is invalid ($data)`
|
|
997
997
|
};
|
|
998
|
-
function y(a, u = e.keywordError,
|
|
999
|
-
const { it: g } = a, { gen: o, compositeRule: m, allErrors: P } = g, O = E(a, u,
|
|
998
|
+
function y(a, u = e.keywordError, n, c) {
|
|
999
|
+
const { it: g } = a, { gen: o, compositeRule: m, allErrors: P } = g, O = E(a, u, n);
|
|
1000
1000
|
c ?? (m || P) ? f(o, O) : w(g, (0, t._)`[${O}]`);
|
|
1001
1001
|
}
|
|
1002
1002
|
e.reportError = y;
|
|
1003
|
-
function s(a, u = e.keywordError,
|
|
1004
|
-
const { it: c } = a, { gen: g, compositeRule: o, allErrors: m } = c, P = E(a, u,
|
|
1003
|
+
function s(a, u = e.keywordError, n) {
|
|
1004
|
+
const { it: c } = a, { gen: g, compositeRule: o, allErrors: m } = c, P = E(a, u, n);
|
|
1005
1005
|
f(g, P), o || m || w(c, i.default.vErrors);
|
|
1006
1006
|
}
|
|
1007
1007
|
e.reportExtraError = s;
|
|
@@ -1009,22 +1009,22 @@ function Dt() {
|
|
|
1009
1009
|
a.assign(i.default.errors, u), a.if((0, t._)`${i.default.vErrors} !== null`, () => a.if(u, () => a.assign((0, t._)`${i.default.vErrors}.length`, u), () => a.assign(i.default.vErrors, null)));
|
|
1010
1010
|
}
|
|
1011
1011
|
e.resetErrorsCount = l;
|
|
1012
|
-
function d({ gen: a, keyword: u, schemaValue:
|
|
1012
|
+
function d({ gen: a, keyword: u, schemaValue: n, data: c, errsCount: g, it: o }) {
|
|
1013
1013
|
if (g === void 0)
|
|
1014
1014
|
throw new Error("ajv implementation error");
|
|
1015
1015
|
const m = a.name("err");
|
|
1016
1016
|
a.forRange("i", g, i.default.errors, (P) => {
|
|
1017
|
-
a.const(m, (0, t._)`${i.default.vErrors}[${P}]`), a.if((0, t._)`${m}.instancePath === undefined`, () => a.assign((0, t._)`${m}.instancePath`, (0, t.strConcat)(i.default.instancePath, o.errorPath))), a.assign((0, t._)`${m}.schemaPath`, (0, t.str)`${o.errSchemaPath}/${u}`), o.opts.verbose && (a.assign((0, t._)`${m}.schema`,
|
|
1017
|
+
a.const(m, (0, t._)`${i.default.vErrors}[${P}]`), a.if((0, t._)`${m}.instancePath === undefined`, () => a.assign((0, t._)`${m}.instancePath`, (0, t.strConcat)(i.default.instancePath, o.errorPath))), a.assign((0, t._)`${m}.schemaPath`, (0, t.str)`${o.errSchemaPath}/${u}`), o.opts.verbose && (a.assign((0, t._)`${m}.schema`, n), a.assign((0, t._)`${m}.data`, c));
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
e.extendErrors = d;
|
|
1021
1021
|
function f(a, u) {
|
|
1022
|
-
const
|
|
1023
|
-
a.if((0, t._)`${i.default.vErrors} === null`, () => a.assign(i.default.vErrors, (0, t._)`[${
|
|
1022
|
+
const n = a.const("err", u);
|
|
1023
|
+
a.if((0, t._)`${i.default.vErrors} === null`, () => a.assign(i.default.vErrors, (0, t._)`[${n}]`), (0, t._)`${i.default.vErrors}.push(${n})`), a.code((0, t._)`${i.default.errors}++`);
|
|
1024
1024
|
}
|
|
1025
1025
|
function w(a, u) {
|
|
1026
|
-
const { gen:
|
|
1027
|
-
g.$async ?
|
|
1026
|
+
const { gen: n, validateName: c, schemaEnv: g } = a;
|
|
1027
|
+
g.$async ? n.throw((0, t._)`new ${a.ValidationError}(${u})`) : (n.assign((0, t._)`${c}.errors`, u), n.return(!1));
|
|
1028
1028
|
}
|
|
1029
1029
|
const $ = {
|
|
1030
1030
|
keyword: new t.Name("keyword"),
|
|
@@ -1036,28 +1036,28 @@ function Dt() {
|
|
|
1036
1036
|
schema: new t.Name("schema"),
|
|
1037
1037
|
parentSchema: new t.Name("parentSchema")
|
|
1038
1038
|
};
|
|
1039
|
-
function E(a, u,
|
|
1039
|
+
function E(a, u, n) {
|
|
1040
1040
|
const { createErrors: c } = a.it;
|
|
1041
|
-
return c === !1 ? (0, t._)`{}` : _(a, u,
|
|
1041
|
+
return c === !1 ? (0, t._)`{}` : _(a, u, n);
|
|
1042
1042
|
}
|
|
1043
|
-
function _(a, u,
|
|
1043
|
+
function _(a, u, n = {}) {
|
|
1044
1044
|
const { gen: c, it: g } = a, o = [
|
|
1045
|
-
v(g,
|
|
1046
|
-
b(a,
|
|
1045
|
+
v(g, n),
|
|
1046
|
+
b(a, n)
|
|
1047
1047
|
];
|
|
1048
1048
|
return h(a, u, o), c.object(...o);
|
|
1049
1049
|
}
|
|
1050
1050
|
function v({ errorPath: a }, { instancePath: u }) {
|
|
1051
|
-
const
|
|
1052
|
-
return [i.default.instancePath, (0, t.strConcat)(i.default.instancePath,
|
|
1051
|
+
const n = u ? (0, t.str)`${a}${(0, r.getErrorPath)(u, r.Type.Str)}` : a;
|
|
1052
|
+
return [i.default.instancePath, (0, t.strConcat)(i.default.instancePath, n)];
|
|
1053
1053
|
}
|
|
1054
|
-
function b({ keyword: a, it: { errSchemaPath: u } }, { schemaPath:
|
|
1054
|
+
function b({ keyword: a, it: { errSchemaPath: u } }, { schemaPath: n, parentSchema: c }) {
|
|
1055
1055
|
let g = c ? u : (0, t.str)`${u}/${a}`;
|
|
1056
|
-
return
|
|
1056
|
+
return n && (g = (0, t.str)`${g}${(0, r.getErrorPath)(n, r.Type.Str)}`), [$.schemaPath, g];
|
|
1057
1057
|
}
|
|
1058
|
-
function h(a, { params: u, message:
|
|
1058
|
+
function h(a, { params: u, message: n }, c) {
|
|
1059
1059
|
const { keyword: g, data: o, schemaValue: m, it: P } = a, { opts: O, propertyName: T, topSchemaRef: z, schemaPath: C } = P;
|
|
1060
|
-
c.push([$.keyword, g], [$.params, typeof u == "function" ? u(a) : u || (0, t._)`{}`]), O.messages && c.push([$.message, typeof
|
|
1060
|
+
c.push([$.keyword, g], [$.params, typeof u == "function" ? u(a) : u || (0, t._)`{}`]), O.messages && c.push([$.message, typeof n == "function" ? n(a) : n]), O.verbose && c.push([$.schema, m], [$.parentSchema, (0, t._)`${z}${C}`], [i.default.data, o]), T && c.push([$.propertyName, T]);
|
|
1061
1061
|
}
|
|
1062
1062
|
})(Ut)), Ut;
|
|
1063
1063
|
}
|
|
@@ -1065,12 +1065,12 @@ var hr;
|
|
|
1065
1065
|
function ls() {
|
|
1066
1066
|
if (hr) return Ee;
|
|
1067
1067
|
hr = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.boolOrEmptySchema = Ee.topBoolOrEmptySchema = void 0;
|
|
1068
|
-
const e = Dt(), t = G(),
|
|
1068
|
+
const e = Dt(), t = G(), r = Se(), i = {
|
|
1069
1069
|
message: "boolean schema is false"
|
|
1070
1070
|
};
|
|
1071
1071
|
function y(d) {
|
|
1072
1072
|
const { gen: f, schema: w, validateName: $ } = d;
|
|
1073
|
-
w === !1 ? l(d, !1) : typeof w == "object" && w.$async === !0 ? f.return(
|
|
1073
|
+
w === !1 ? l(d, !1) : typeof w == "object" && w.$async === !0 ? f.return(r.default.data) : (f.assign((0, t._)`${$}.errors`, null), f.return(!0));
|
|
1074
1074
|
}
|
|
1075
1075
|
Ee.topBoolOrEmptySchema = y;
|
|
1076
1076
|
function s(d, f) {
|
|
@@ -1094,14 +1094,14 @@ function ls() {
|
|
|
1094
1094
|
return Ee;
|
|
1095
1095
|
}
|
|
1096
1096
|
var se = {}, ke = {}, yr;
|
|
1097
|
-
function
|
|
1097
|
+
function Rn() {
|
|
1098
1098
|
if (yr) return ke;
|
|
1099
1099
|
yr = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.getRules = ke.isJSONType = void 0;
|
|
1100
1100
|
const e = ["string", "number", "integer", "boolean", "null", "object", "array"], t = new Set(e);
|
|
1101
|
-
function
|
|
1101
|
+
function r(y) {
|
|
1102
1102
|
return typeof y == "string" && t.has(y);
|
|
1103
1103
|
}
|
|
1104
|
-
ke.isJSONType =
|
|
1104
|
+
ke.isJSONType = r;
|
|
1105
1105
|
function i() {
|
|
1106
1106
|
const y = {
|
|
1107
1107
|
number: { type: "number", rules: [] },
|
|
@@ -1120,7 +1120,7 @@ function In() {
|
|
|
1120
1120
|
return ke.getRules = i, ke;
|
|
1121
1121
|
}
|
|
1122
1122
|
var _e = {}, gr;
|
|
1123
|
-
function
|
|
1123
|
+
function In() {
|
|
1124
1124
|
if (gr) return _e;
|
|
1125
1125
|
gr = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.shouldUseRule = _e.shouldUseGroup = _e.schemaHasRulesForType = void 0;
|
|
1126
1126
|
function e({ schema: i, self: y }, s) {
|
|
@@ -1129,66 +1129,66 @@ function Rn() {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
_e.schemaHasRulesForType = e;
|
|
1131
1131
|
function t(i, y) {
|
|
1132
|
-
return y.rules.some((s) =>
|
|
1132
|
+
return y.rules.some((s) => r(i, s));
|
|
1133
1133
|
}
|
|
1134
1134
|
_e.shouldUseGroup = t;
|
|
1135
|
-
function
|
|
1135
|
+
function r(i, y) {
|
|
1136
1136
|
var s;
|
|
1137
1137
|
return i[y.keyword] !== void 0 || ((s = y.definition.implements) === null || s === void 0 ? void 0 : s.some((l) => i[l] !== void 0));
|
|
1138
1138
|
}
|
|
1139
|
-
return _e.shouldUseRule =
|
|
1139
|
+
return _e.shouldUseRule = r, _e;
|
|
1140
1140
|
}
|
|
1141
1141
|
var vr;
|
|
1142
1142
|
function kt() {
|
|
1143
1143
|
if (vr) return se;
|
|
1144
1144
|
vr = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.reportTypeError = se.checkDataTypes = se.checkDataType = se.coerceAndCheckDataType = se.getJSONTypes = se.getSchemaTypes = se.DataType = void 0;
|
|
1145
|
-
const e =
|
|
1145
|
+
const e = Rn(), t = In(), r = Dt(), i = G(), y = Y();
|
|
1146
1146
|
var s;
|
|
1147
|
-
(function(
|
|
1148
|
-
|
|
1147
|
+
(function(n) {
|
|
1148
|
+
n[n.Correct = 0] = "Correct", n[n.Wrong = 1] = "Wrong";
|
|
1149
1149
|
})(s || (se.DataType = s = {}));
|
|
1150
|
-
function l(
|
|
1151
|
-
const c = d(
|
|
1150
|
+
function l(n) {
|
|
1151
|
+
const c = d(n.type);
|
|
1152
1152
|
if (c.includes("null")) {
|
|
1153
|
-
if (
|
|
1153
|
+
if (n.nullable === !1)
|
|
1154
1154
|
throw new Error("type: null contradicts nullable: false");
|
|
1155
1155
|
} else {
|
|
1156
|
-
if (!c.length &&
|
|
1156
|
+
if (!c.length && n.nullable !== void 0)
|
|
1157
1157
|
throw new Error('"nullable" cannot be used without "type"');
|
|
1158
|
-
|
|
1158
|
+
n.nullable === !0 && c.push("null");
|
|
1159
1159
|
}
|
|
1160
1160
|
return c;
|
|
1161
1161
|
}
|
|
1162
1162
|
se.getSchemaTypes = l;
|
|
1163
|
-
function d(
|
|
1164
|
-
const c = Array.isArray(
|
|
1163
|
+
function d(n) {
|
|
1164
|
+
const c = Array.isArray(n) ? n : n ? [n] : [];
|
|
1165
1165
|
if (c.every(e.isJSONType))
|
|
1166
1166
|
return c;
|
|
1167
1167
|
throw new Error("type must be JSONType or JSONType[]: " + c.join(","));
|
|
1168
1168
|
}
|
|
1169
1169
|
se.getJSONTypes = d;
|
|
1170
|
-
function f(
|
|
1171
|
-
const { gen: g, data: o, opts: m } =
|
|
1170
|
+
function f(n, c) {
|
|
1171
|
+
const { gen: g, data: o, opts: m } = n, P = $(c, m.coerceTypes), O = c.length > 0 && !(P.length === 0 && c.length === 1 && (0, t.schemaHasRulesForType)(n, c[0]));
|
|
1172
1172
|
if (O) {
|
|
1173
1173
|
const T = b(c, o, m.strictNumbers, s.Wrong);
|
|
1174
1174
|
g.if(T, () => {
|
|
1175
|
-
P.length ? E(
|
|
1175
|
+
P.length ? E(n, c, P) : a(n);
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
return O;
|
|
1179
1179
|
}
|
|
1180
1180
|
se.coerceAndCheckDataType = f;
|
|
1181
1181
|
const w = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
1182
|
-
function $(
|
|
1183
|
-
return c ?
|
|
1182
|
+
function $(n, c) {
|
|
1183
|
+
return c ? n.filter((g) => w.has(g) || c === "array" && g === "array") : [];
|
|
1184
1184
|
}
|
|
1185
|
-
function E(
|
|
1186
|
-
const { gen: o, data: m, opts: P } =
|
|
1185
|
+
function E(n, c, g) {
|
|
1186
|
+
const { gen: o, data: m, opts: P } = n, O = o.let("dataType", (0, i._)`typeof ${m}`), T = o.let("coerced", (0, i._)`undefined`);
|
|
1187
1187
|
P.coerceTypes === "array" && o.if((0, i._)`${O} == 'object' && Array.isArray(${m}) && ${m}.length == 1`, () => o.assign(m, (0, i._)`${m}[0]`).assign(O, (0, i._)`typeof ${m}`).if(b(c, m, P.strictNumbers), () => o.assign(T, m))), o.if((0, i._)`${T} !== undefined`);
|
|
1188
1188
|
for (const C of g)
|
|
1189
1189
|
(w.has(C) || C === "array" && P.coerceTypes === "array") && z(C);
|
|
1190
|
-
o.else(), a(
|
|
1191
|
-
o.assign(m, T), _(
|
|
1190
|
+
o.else(), a(n), o.endIf(), o.if((0, i._)`${T} !== undefined`, () => {
|
|
1191
|
+
o.assign(m, T), _(n, T);
|
|
1192
1192
|
});
|
|
1193
1193
|
function z(C) {
|
|
1194
1194
|
switch (C) {
|
|
@@ -1215,13 +1215,13 @@ function kt() {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
|
-
function _({ gen:
|
|
1219
|
-
|
|
1218
|
+
function _({ gen: n, parentData: c, parentDataProperty: g }, o) {
|
|
1219
|
+
n.if((0, i._)`${c} !== undefined`, () => n.assign((0, i._)`${c}[${g}]`, o));
|
|
1220
1220
|
}
|
|
1221
|
-
function v(
|
|
1221
|
+
function v(n, c, g, o = s.Correct) {
|
|
1222
1222
|
const m = o === s.Correct ? i.operators.EQ : i.operators.NEQ;
|
|
1223
1223
|
let P;
|
|
1224
|
-
switch (
|
|
1224
|
+
switch (n) {
|
|
1225
1225
|
case "null":
|
|
1226
1226
|
return (0, i._)`${c} ${m} null`;
|
|
1227
1227
|
case "array":
|
|
@@ -1237,7 +1237,7 @@ function kt() {
|
|
|
1237
1237
|
P = O();
|
|
1238
1238
|
break;
|
|
1239
1239
|
default:
|
|
1240
|
-
return (0, i._)`typeof ${c} ${m} ${
|
|
1240
|
+
return (0, i._)`typeof ${c} ${m} ${n}`;
|
|
1241
1241
|
}
|
|
1242
1242
|
return o === s.Correct ? P : (0, i.not)(P);
|
|
1243
1243
|
function O(T = i.nil) {
|
|
@@ -1245,11 +1245,11 @@ function kt() {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
1247
|
se.checkDataType = v;
|
|
1248
|
-
function b(
|
|
1249
|
-
if (
|
|
1250
|
-
return v(
|
|
1248
|
+
function b(n, c, g, o) {
|
|
1249
|
+
if (n.length === 1)
|
|
1250
|
+
return v(n[0], c, g, o);
|
|
1251
1251
|
let m;
|
|
1252
|
-
const P = (0, y.toHash)(
|
|
1252
|
+
const P = (0, y.toHash)(n);
|
|
1253
1253
|
if (P.array && P.object) {
|
|
1254
1254
|
const O = (0, i._)`typeof ${c} != "object"`;
|
|
1255
1255
|
m = P.null ? O : (0, i._)`!${c} || ${O}`, delete P.null, delete P.array, delete P.object;
|
|
@@ -1262,16 +1262,16 @@ function kt() {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
se.checkDataTypes = b;
|
|
1264
1264
|
const h = {
|
|
1265
|
-
message: ({ schema:
|
|
1266
|
-
params: ({ schema:
|
|
1265
|
+
message: ({ schema: n }) => `must be ${n}`,
|
|
1266
|
+
params: ({ schema: n, schemaValue: c }) => typeof n == "string" ? (0, i._)`{type: ${n}}` : (0, i._)`{type: ${c}}`
|
|
1267
1267
|
};
|
|
1268
|
-
function a(
|
|
1269
|
-
const c = u(
|
|
1270
|
-
(0,
|
|
1268
|
+
function a(n) {
|
|
1269
|
+
const c = u(n);
|
|
1270
|
+
(0, r.reportError)(c, h);
|
|
1271
1271
|
}
|
|
1272
1272
|
se.reportTypeError = a;
|
|
1273
|
-
function u(
|
|
1274
|
-
const { gen: c, data: g, schema: o } =
|
|
1273
|
+
function u(n) {
|
|
1274
|
+
const { gen: c, data: g, schema: o } = n, m = (0, y.schemaRefOrVal)(n, o, "type");
|
|
1275
1275
|
return {
|
|
1276
1276
|
gen: c,
|
|
1277
1277
|
keyword: "type",
|
|
@@ -1281,7 +1281,7 @@ function kt() {
|
|
|
1281
1281
|
schemaValue: m,
|
|
1282
1282
|
parentSchema: o,
|
|
1283
1283
|
params: {},
|
|
1284
|
-
it:
|
|
1284
|
+
it: n
|
|
1285
1285
|
};
|
|
1286
1286
|
}
|
|
1287
1287
|
return se;
|
|
@@ -1291,14 +1291,14 @@ function fs() {
|
|
|
1291
1291
|
if (_r) return qe;
|
|
1292
1292
|
_r = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.assignDefaults = void 0;
|
|
1293
1293
|
const e = G(), t = Y();
|
|
1294
|
-
function
|
|
1294
|
+
function r(y, s) {
|
|
1295
1295
|
const { properties: l, items: d } = y.schema;
|
|
1296
1296
|
if (s === "object" && l)
|
|
1297
1297
|
for (const f in l)
|
|
1298
1298
|
i(y, f, l[f].default);
|
|
1299
1299
|
else s === "array" && Array.isArray(d) && d.forEach((f, w) => i(y, w, f.default));
|
|
1300
1300
|
}
|
|
1301
|
-
qe.assignDefaults =
|
|
1301
|
+
qe.assignDefaults = r;
|
|
1302
1302
|
function i(y, s, l) {
|
|
1303
1303
|
const { gen: d, compositeRule: f, data: w, opts: $ } = y;
|
|
1304
1304
|
if (l === void 0)
|
|
@@ -1317,76 +1317,76 @@ var he = {}, Z = {}, $r;
|
|
|
1317
1317
|
function ge() {
|
|
1318
1318
|
if ($r) return Z;
|
|
1319
1319
|
$r = 1, Object.defineProperty(Z, "__esModule", { value: !0 }), Z.validateUnion = Z.validateArray = Z.usePattern = Z.callValidateCode = Z.schemaProperties = Z.allSchemaProperties = Z.noPropertyInData = Z.propertyInData = Z.isOwnProperty = Z.hasPropFunc = Z.reportMissingProp = Z.checkMissingProp = Z.checkReportMissingProp = void 0;
|
|
1320
|
-
const e = G(), t = Y(),
|
|
1321
|
-
function y(
|
|
1322
|
-
const { gen: g, data: o, it: m } =
|
|
1320
|
+
const e = G(), t = Y(), r = Se(), i = Y();
|
|
1321
|
+
function y(n, c) {
|
|
1322
|
+
const { gen: g, data: o, it: m } = n;
|
|
1323
1323
|
g.if($(g, o, c, m.opts.ownProperties), () => {
|
|
1324
|
-
|
|
1324
|
+
n.setParams({ missingProperty: (0, e._)`${c}` }, !0), n.error();
|
|
1325
1325
|
});
|
|
1326
1326
|
}
|
|
1327
1327
|
Z.checkReportMissingProp = y;
|
|
1328
|
-
function s({ gen:
|
|
1329
|
-
return (0, e.or)(...o.map((P) => (0, e.and)($(
|
|
1328
|
+
function s({ gen: n, data: c, it: { opts: g } }, o, m) {
|
|
1329
|
+
return (0, e.or)(...o.map((P) => (0, e.and)($(n, c, P, g.ownProperties), (0, e._)`${m} = ${P}`)));
|
|
1330
1330
|
}
|
|
1331
1331
|
Z.checkMissingProp = s;
|
|
1332
|
-
function l(
|
|
1333
|
-
|
|
1332
|
+
function l(n, c) {
|
|
1333
|
+
n.setParams({ missingProperty: c }, !0), n.error();
|
|
1334
1334
|
}
|
|
1335
1335
|
Z.reportMissingProp = l;
|
|
1336
|
-
function d(
|
|
1337
|
-
return
|
|
1336
|
+
function d(n) {
|
|
1337
|
+
return n.scopeValue("func", {
|
|
1338
1338
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
1339
1339
|
ref: Object.prototype.hasOwnProperty,
|
|
1340
1340
|
code: (0, e._)`Object.prototype.hasOwnProperty`
|
|
1341
1341
|
});
|
|
1342
1342
|
}
|
|
1343
1343
|
Z.hasPropFunc = d;
|
|
1344
|
-
function f(
|
|
1345
|
-
return (0, e._)`${d(
|
|
1344
|
+
function f(n, c, g) {
|
|
1345
|
+
return (0, e._)`${d(n)}.call(${c}, ${g})`;
|
|
1346
1346
|
}
|
|
1347
1347
|
Z.isOwnProperty = f;
|
|
1348
|
-
function w(
|
|
1348
|
+
function w(n, c, g, o) {
|
|
1349
1349
|
const m = (0, e._)`${c}${(0, e.getProperty)(g)} !== undefined`;
|
|
1350
|
-
return o ? (0, e._)`${m} && ${f(
|
|
1350
|
+
return o ? (0, e._)`${m} && ${f(n, c, g)}` : m;
|
|
1351
1351
|
}
|
|
1352
1352
|
Z.propertyInData = w;
|
|
1353
|
-
function $(
|
|
1353
|
+
function $(n, c, g, o) {
|
|
1354
1354
|
const m = (0, e._)`${c}${(0, e.getProperty)(g)} === undefined`;
|
|
1355
|
-
return o ? (0, e.or)(m, (0, e.not)(f(
|
|
1355
|
+
return o ? (0, e.or)(m, (0, e.not)(f(n, c, g))) : m;
|
|
1356
1356
|
}
|
|
1357
1357
|
Z.noPropertyInData = $;
|
|
1358
|
-
function E(
|
|
1359
|
-
return
|
|
1358
|
+
function E(n) {
|
|
1359
|
+
return n ? Object.keys(n).filter((c) => c !== "__proto__") : [];
|
|
1360
1360
|
}
|
|
1361
1361
|
Z.allSchemaProperties = E;
|
|
1362
|
-
function _(
|
|
1363
|
-
return E(c).filter((g) => !(0, t.alwaysValidSchema)(
|
|
1362
|
+
function _(n, c) {
|
|
1363
|
+
return E(c).filter((g) => !(0, t.alwaysValidSchema)(n, c[g]));
|
|
1364
1364
|
}
|
|
1365
1365
|
Z.schemaProperties = _;
|
|
1366
|
-
function v({ schemaCode:
|
|
1367
|
-
const V = C ? (0, e._)`${
|
|
1368
|
-
[
|
|
1369
|
-
[
|
|
1370
|
-
[
|
|
1371
|
-
[
|
|
1366
|
+
function v({ schemaCode: n, data: c, it: { gen: g, topSchemaRef: o, schemaPath: m, errorPath: P }, it: O }, T, z, C) {
|
|
1367
|
+
const V = C ? (0, e._)`${n}, ${c}, ${o}${m}` : c, F = [
|
|
1368
|
+
[r.default.instancePath, (0, e.strConcat)(r.default.instancePath, P)],
|
|
1369
|
+
[r.default.parentData, O.parentData],
|
|
1370
|
+
[r.default.parentDataProperty, O.parentDataProperty],
|
|
1371
|
+
[r.default.rootData, r.default.rootData]
|
|
1372
1372
|
];
|
|
1373
|
-
O.opts.dynamicRef && F.push([
|
|
1373
|
+
O.opts.dynamicRef && F.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
|
|
1374
1374
|
const L = (0, e._)`${V}, ${g.object(...F)}`;
|
|
1375
1375
|
return z !== e.nil ? (0, e._)`${T}.call(${z}, ${L})` : (0, e._)`${T}(${L})`;
|
|
1376
1376
|
}
|
|
1377
1377
|
Z.callValidateCode = v;
|
|
1378
1378
|
const b = (0, e._)`new RegExp`;
|
|
1379
|
-
function h({ gen:
|
|
1379
|
+
function h({ gen: n, it: { opts: c } }, g) {
|
|
1380
1380
|
const o = c.unicodeRegExp ? "u" : "", { regExp: m } = c.code, P = m(g, o);
|
|
1381
|
-
return
|
|
1381
|
+
return n.scopeValue("pattern", {
|
|
1382
1382
|
key: P.toString(),
|
|
1383
1383
|
ref: P,
|
|
1384
|
-
code: (0, e._)`${m.code === "new RegExp" ? b : (0, i.useFunc)(
|
|
1384
|
+
code: (0, e._)`${m.code === "new RegExp" ? b : (0, i.useFunc)(n, m)}(${g}, ${o})`
|
|
1385
1385
|
});
|
|
1386
1386
|
}
|
|
1387
1387
|
Z.usePattern = h;
|
|
1388
|
-
function a(
|
|
1389
|
-
const { gen: c, data: g, keyword: o, it: m } =
|
|
1388
|
+
function a(n) {
|
|
1389
|
+
const { gen: c, data: g, keyword: o, it: m } = n, P = c.name("valid");
|
|
1390
1390
|
if (m.allErrors) {
|
|
1391
1391
|
const T = c.let("valid", !0);
|
|
1392
1392
|
return O(() => c.assign(T, !1)), T;
|
|
@@ -1395,7 +1395,7 @@ function ge() {
|
|
|
1395
1395
|
function O(T) {
|
|
1396
1396
|
const z = c.const("len", (0, e._)`${g}.length`);
|
|
1397
1397
|
c.forRange("i", 0, z, (C) => {
|
|
1398
|
-
|
|
1398
|
+
n.subschema({
|
|
1399
1399
|
keyword: o,
|
|
1400
1400
|
dataProp: C,
|
|
1401
1401
|
dataPropType: t.Type.Num
|
|
@@ -1404,21 +1404,21 @@ function ge() {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
1406
|
Z.validateArray = a;
|
|
1407
|
-
function u(
|
|
1408
|
-
const { gen: c, schema: g, keyword: o, it: m } =
|
|
1407
|
+
function u(n) {
|
|
1408
|
+
const { gen: c, schema: g, keyword: o, it: m } = n;
|
|
1409
1409
|
if (!Array.isArray(g))
|
|
1410
1410
|
throw new Error("ajv implementation error");
|
|
1411
1411
|
if (g.some((z) => (0, t.alwaysValidSchema)(m, z)) && !m.opts.unevaluated)
|
|
1412
1412
|
return;
|
|
1413
1413
|
const O = c.let("valid", !1), T = c.name("_valid");
|
|
1414
1414
|
c.block(() => g.forEach((z, C) => {
|
|
1415
|
-
const V =
|
|
1415
|
+
const V = n.subschema({
|
|
1416
1416
|
keyword: o,
|
|
1417
1417
|
schemaProp: C,
|
|
1418
1418
|
compositeRule: !0
|
|
1419
1419
|
}, T);
|
|
1420
|
-
c.assign(O, (0, e._)`${O} || ${T}`),
|
|
1421
|
-
})),
|
|
1420
|
+
c.assign(O, (0, e._)`${O} || ${T}`), n.mergeValidEvaluated(V, T) || c.if((0, e.not)(O));
|
|
1421
|
+
})), n.result(O, () => n.reset(), () => n.error(!0));
|
|
1422
1422
|
}
|
|
1423
1423
|
return Z.validateUnion = u, Z;
|
|
1424
1424
|
}
|
|
@@ -1426,15 +1426,15 @@ var br;
|
|
|
1426
1426
|
function ps() {
|
|
1427
1427
|
if (br) return he;
|
|
1428
1428
|
br = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.validateKeywordUsage = he.validSchemaType = he.funcKeywordCode = he.macroKeywordCode = void 0;
|
|
1429
|
-
const e = G(), t = Se(),
|
|
1429
|
+
const e = G(), t = Se(), r = ge(), i = Dt();
|
|
1430
1430
|
function y(_, v) {
|
|
1431
|
-
const { gen: b, keyword: h, schema: a, parentSchema: u, it:
|
|
1432
|
-
|
|
1431
|
+
const { gen: b, keyword: h, schema: a, parentSchema: u, it: n } = _, c = v.macro.call(n.self, a, u, n), g = w(b, h, c);
|
|
1432
|
+
n.opts.validateSchema !== !1 && n.self.validateSchema(c, !0);
|
|
1433
1433
|
const o = b.name("valid");
|
|
1434
1434
|
_.subschema({
|
|
1435
1435
|
schema: c,
|
|
1436
1436
|
schemaPath: e.nil,
|
|
1437
|
-
errSchemaPath: `${
|
|
1437
|
+
errSchemaPath: `${n.errSchemaPath}/${h}`,
|
|
1438
1438
|
topSchemaRef: g,
|
|
1439
1439
|
compositeRule: !0
|
|
1440
1440
|
}, o), _.pass(o, () => _.error(!0));
|
|
@@ -1442,9 +1442,9 @@ function ps() {
|
|
|
1442
1442
|
he.macroKeywordCode = y;
|
|
1443
1443
|
function s(_, v) {
|
|
1444
1444
|
var b;
|
|
1445
|
-
const { gen: h, keyword: a, schema: u, parentSchema:
|
|
1445
|
+
const { gen: h, keyword: a, schema: u, parentSchema: n, $data: c, it: g } = _;
|
|
1446
1446
|
f(g, v);
|
|
1447
|
-
const o = !c && v.compile ? v.compile.call(g.self, u,
|
|
1447
|
+
const o = !c && v.compile ? v.compile.call(g.self, u, n, g) : v.validate, m = w(h, a, o), P = h.let("valid");
|
|
1448
1448
|
_.block$data(P, O), _.ok((b = v.valid) !== null && b !== void 0 ? b : P);
|
|
1449
1449
|
function O() {
|
|
1450
1450
|
if (v.errors === !1)
|
|
@@ -1463,8 +1463,8 @@ function ps() {
|
|
|
1463
1463
|
return h.assign(F, null), C(e.nil), F;
|
|
1464
1464
|
}
|
|
1465
1465
|
function C(F = v.async ? (0, e._)`await ` : e.nil) {
|
|
1466
|
-
const L = g.opts.passContext ? t.default.this : t.default.self,
|
|
1467
|
-
h.assign(P, (0, e._)`${F}${(0,
|
|
1466
|
+
const L = g.opts.passContext ? t.default.this : t.default.self, x = !("compile" in v && !c || v.schema === !1);
|
|
1467
|
+
h.assign(P, (0, e._)`${F}${(0, r.callValidateCode)(_, m, L, x)}`, v.modifying);
|
|
1468
1468
|
}
|
|
1469
1469
|
function V(F) {
|
|
1470
1470
|
var L;
|
|
@@ -1498,9 +1498,9 @@ function ps() {
|
|
|
1498
1498
|
function E({ schema: _, opts: v, self: b, errSchemaPath: h }, a, u) {
|
|
1499
1499
|
if (Array.isArray(a.keyword) ? !a.keyword.includes(u) : a.keyword !== u)
|
|
1500
1500
|
throw new Error("ajv implementation error");
|
|
1501
|
-
const
|
|
1502
|
-
if (
|
|
1503
|
-
throw new Error(`parent schema must have dependencies of ${u}: ${
|
|
1501
|
+
const n = a.dependencies;
|
|
1502
|
+
if (n?.some((c) => !Object.prototype.hasOwnProperty.call(_, c)))
|
|
1503
|
+
throw new Error(`parent schema must have dependencies of ${u}: ${n.join(",")}`);
|
|
1504
1504
|
if (a.validateSchema && !a.validateSchema(_[u])) {
|
|
1505
1505
|
const g = `keyword "${u}" value is invalid at path "${h}": ` + b.errorsText(a.validateSchema.errors);
|
|
1506
1506
|
if (v.validateSchema === "log")
|
|
@@ -1516,7 +1516,7 @@ function ms() {
|
|
|
1516
1516
|
if (wr) return $e;
|
|
1517
1517
|
wr = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.extendSubschemaMode = $e.extendSubschemaData = $e.getSubschema = void 0;
|
|
1518
1518
|
const e = G(), t = Y();
|
|
1519
|
-
function
|
|
1519
|
+
function r(s, { keyword: l, schemaProp: d, schema: f, schemaPath: w, errSchemaPath: $, topSchemaRef: E }) {
|
|
1520
1520
|
if (l !== void 0 && f !== void 0)
|
|
1521
1521
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
1522
1522
|
if (l !== void 0) {
|
|
@@ -1543,7 +1543,7 @@ function ms() {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
throw new Error('either "keyword" or "schema" must be passed');
|
|
1545
1545
|
}
|
|
1546
|
-
$e.getSubschema =
|
|
1546
|
+
$e.getSubschema = r;
|
|
1547
1547
|
function i(s, l, { dataProp: d, dataPropType: f, data: w, dataTypes: $, propertyName: E }) {
|
|
1548
1548
|
if (w !== void 0 && d !== void 0)
|
|
1549
1549
|
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
@@ -1569,30 +1569,30 @@ function ms() {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
var ae = {}, Gt, Pr;
|
|
1571
1571
|
function On() {
|
|
1572
|
-
return Pr || (Pr = 1, Gt = function e(t,
|
|
1573
|
-
if (t ===
|
|
1574
|
-
if (t &&
|
|
1575
|
-
if (t.constructor !==
|
|
1572
|
+
return Pr || (Pr = 1, Gt = function e(t, r) {
|
|
1573
|
+
if (t === r) return !0;
|
|
1574
|
+
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
1575
|
+
if (t.constructor !== r.constructor) return !1;
|
|
1576
1576
|
var i, y, s;
|
|
1577
1577
|
if (Array.isArray(t)) {
|
|
1578
|
-
if (i = t.length, i !=
|
|
1578
|
+
if (i = t.length, i != r.length) return !1;
|
|
1579
1579
|
for (y = i; y-- !== 0; )
|
|
1580
|
-
if (!e(t[y],
|
|
1580
|
+
if (!e(t[y], r[y])) return !1;
|
|
1581
1581
|
return !0;
|
|
1582
1582
|
}
|
|
1583
|
-
if (t.constructor === RegExp) return t.source ===
|
|
1584
|
-
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() ===
|
|
1585
|
-
if (t.toString !== Object.prototype.toString) return t.toString() ===
|
|
1586
|
-
if (s = Object.keys(t), i = s.length, i !== Object.keys(
|
|
1583
|
+
if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
|
|
1584
|
+
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
|
|
1585
|
+
if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
|
|
1586
|
+
if (s = Object.keys(t), i = s.length, i !== Object.keys(r).length) return !1;
|
|
1587
1587
|
for (y = i; y-- !== 0; )
|
|
1588
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1588
|
+
if (!Object.prototype.hasOwnProperty.call(r, s[y])) return !1;
|
|
1589
1589
|
for (y = i; y-- !== 0; ) {
|
|
1590
1590
|
var l = s[y];
|
|
1591
|
-
if (!e(t[l],
|
|
1591
|
+
if (!e(t[l], r[l])) return !1;
|
|
1592
1592
|
}
|
|
1593
1593
|
return !0;
|
|
1594
1594
|
}
|
|
1595
|
-
return t !== t &&
|
|
1595
|
+
return t !== t && r !== r;
|
|
1596
1596
|
}), Gt;
|
|
1597
1597
|
}
|
|
1598
1598
|
var Wt = { exports: {} }, Sr;
|
|
@@ -1659,13 +1659,13 @@ function hs() {
|
|
|
1659
1659
|
} else if (v in e.propsKeywords) {
|
|
1660
1660
|
if (b && typeof b == "object")
|
|
1661
1661
|
for (var a in b)
|
|
1662
|
-
t(i, y, s, b[a], d + "/" + v + "/" +
|
|
1662
|
+
t(i, y, s, b[a], d + "/" + v + "/" + r(a), f, d, v, l, a);
|
|
1663
1663
|
} else (v in e.keywords || i.allKeys && !(v in e.skipKeywords)) && t(i, y, s, b, d + "/" + v, f, d, v, l);
|
|
1664
1664
|
}
|
|
1665
1665
|
s(l, d, f, w, $, E, _);
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
1668
|
-
function
|
|
1668
|
+
function r(i) {
|
|
1669
1669
|
return i.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1670
1670
|
}
|
|
1671
1671
|
return Wt.exports;
|
|
@@ -1674,7 +1674,7 @@ var Er;
|
|
|
1674
1674
|
function Tt() {
|
|
1675
1675
|
if (Er) return ae;
|
|
1676
1676
|
Er = 1, Object.defineProperty(ae, "__esModule", { value: !0 }), ae.getSchemaRefs = ae.resolveUrl = ae.normalizeId = ae._getFullPath = ae.getFullPath = ae.inlineRef = void 0;
|
|
1677
|
-
const e = Y(), t = On(),
|
|
1677
|
+
const e = Y(), t = On(), r = hs(), i = /* @__PURE__ */ new Set([
|
|
1678
1678
|
"type",
|
|
1679
1679
|
"format",
|
|
1680
1680
|
"pattern",
|
|
@@ -1718,15 +1718,15 @@ function Tt() {
|
|
|
1718
1718
|
for (const u in h) {
|
|
1719
1719
|
if (u === "$ref")
|
|
1720
1720
|
return 1 / 0;
|
|
1721
|
-
if (a++, !i.has(u) && (typeof h[u] == "object" && (0, e.eachItem)(h[u], (
|
|
1721
|
+
if (a++, !i.has(u) && (typeof h[u] == "object" && (0, e.eachItem)(h[u], (n) => a += d(n)), a === 1 / 0))
|
|
1722
1722
|
return 1 / 0;
|
|
1723
1723
|
}
|
|
1724
1724
|
return a;
|
|
1725
1725
|
}
|
|
1726
1726
|
function f(h, a = "", u) {
|
|
1727
1727
|
u !== !1 && (a = E(a));
|
|
1728
|
-
const
|
|
1729
|
-
return w(h,
|
|
1728
|
+
const n = h.parse(a);
|
|
1729
|
+
return w(h, n);
|
|
1730
1730
|
}
|
|
1731
1731
|
ae.getFullPath = f;
|
|
1732
1732
|
function w(h, a) {
|
|
@@ -1746,16 +1746,16 @@ function Tt() {
|
|
|
1746
1746
|
function b(h, a) {
|
|
1747
1747
|
if (typeof h == "boolean")
|
|
1748
1748
|
return {};
|
|
1749
|
-
const { schemaId: u, uriResolver:
|
|
1750
|
-
return
|
|
1749
|
+
const { schemaId: u, uriResolver: n } = this.opts, c = E(h[u] || a), g = { "": c }, o = f(n, c, !1), m = {}, P = /* @__PURE__ */ new Set();
|
|
1750
|
+
return r(h, { allKeys: !0 }, (z, C, V, F) => {
|
|
1751
1751
|
if (F === void 0)
|
|
1752
1752
|
return;
|
|
1753
1753
|
const L = o + C;
|
|
1754
|
-
let
|
|
1755
|
-
typeof z[u] == "string" && (
|
|
1754
|
+
let x = g[F];
|
|
1755
|
+
typeof z[u] == "string" && (x = ie.call(this, z[u])), oe.call(this, z.$anchor), oe.call(this, z.$dynamicAnchor), g[C] = x;
|
|
1756
1756
|
function ie(X) {
|
|
1757
1757
|
const pe = this.opts.uriResolver.resolve;
|
|
1758
|
-
if (X = E(
|
|
1758
|
+
if (X = E(x ? pe(x, X) : X), P.has(X))
|
|
1759
1759
|
throw T(X);
|
|
1760
1760
|
P.add(X);
|
|
1761
1761
|
let M = this.refs[X];
|
|
@@ -1783,7 +1783,7 @@ var kr;
|
|
|
1783
1783
|
function Mt() {
|
|
1784
1784
|
if (kr) return ve;
|
|
1785
1785
|
kr = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.getData = ve.KeywordCxt = ve.validateFunctionCode = void 0;
|
|
1786
|
-
const e = ls(), t = kt(),
|
|
1786
|
+
const e = ls(), t = kt(), r = In(), i = kt(), y = fs(), s = ps(), l = ms(), d = G(), f = Se(), w = Tt(), $ = Y(), E = Dt();
|
|
1787
1787
|
function _(k) {
|
|
1788
1788
|
if (o(k) && (P(k), g(k))) {
|
|
1789
1789
|
a(k);
|
|
@@ -1792,204 +1792,204 @@ function Mt() {
|
|
|
1792
1792
|
v(k, () => (0, e.topBoolOrEmptySchema)(k));
|
|
1793
1793
|
}
|
|
1794
1794
|
ve.validateFunctionCode = _;
|
|
1795
|
-
function v({ gen: k, validateName:
|
|
1796
|
-
K.code.es5 ? k.func(
|
|
1797
|
-
k.code((0, d._)`"use strict"; ${
|
|
1798
|
-
}) : k.func(
|
|
1795
|
+
function v({ gen: k, validateName: R, schema: q, schemaEnv: A, opts: K }, W) {
|
|
1796
|
+
K.code.es5 ? k.func(R, (0, d._)`${f.default.data}, ${f.default.valCxt}`, A.$async, () => {
|
|
1797
|
+
k.code((0, d._)`"use strict"; ${n(q, K)}`), h(k, K), k.code(W);
|
|
1798
|
+
}) : k.func(R, (0, d._)`${f.default.data}, ${b(K)}`, A.$async, () => k.code(n(q, K)).code(W));
|
|
1799
1799
|
}
|
|
1800
1800
|
function b(k) {
|
|
1801
1801
|
return (0, d._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef ? (0, d._)`, ${f.default.dynamicAnchors}={}` : d.nil}}={}`;
|
|
1802
1802
|
}
|
|
1803
|
-
function h(k,
|
|
1803
|
+
function h(k, R) {
|
|
1804
1804
|
k.if(f.default.valCxt, () => {
|
|
1805
|
-
k.var(f.default.instancePath, (0, d._)`${f.default.valCxt}.${f.default.instancePath}`), k.var(f.default.parentData, (0, d._)`${f.default.valCxt}.${f.default.parentData}`), k.var(f.default.parentDataProperty, (0, d._)`${f.default.valCxt}.${f.default.parentDataProperty}`), k.var(f.default.rootData, (0, d._)`${f.default.valCxt}.${f.default.rootData}`),
|
|
1805
|
+
k.var(f.default.instancePath, (0, d._)`${f.default.valCxt}.${f.default.instancePath}`), k.var(f.default.parentData, (0, d._)`${f.default.valCxt}.${f.default.parentData}`), k.var(f.default.parentDataProperty, (0, d._)`${f.default.valCxt}.${f.default.parentDataProperty}`), k.var(f.default.rootData, (0, d._)`${f.default.valCxt}.${f.default.rootData}`), R.dynamicRef && k.var(f.default.dynamicAnchors, (0, d._)`${f.default.valCxt}.${f.default.dynamicAnchors}`);
|
|
1806
1806
|
}, () => {
|
|
1807
|
-
k.var(f.default.instancePath, (0, d._)`""`), k.var(f.default.parentData, (0, d._)`undefined`), k.var(f.default.parentDataProperty, (0, d._)`undefined`), k.var(f.default.rootData, f.default.data),
|
|
1807
|
+
k.var(f.default.instancePath, (0, d._)`""`), k.var(f.default.parentData, (0, d._)`undefined`), k.var(f.default.parentDataProperty, (0, d._)`undefined`), k.var(f.default.rootData, f.default.data), R.dynamicRef && k.var(f.default.dynamicAnchors, (0, d._)`{}`);
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
1810
1810
|
function a(k) {
|
|
1811
|
-
const { schema:
|
|
1811
|
+
const { schema: R, opts: q, gen: A } = k;
|
|
1812
1812
|
v(k, () => {
|
|
1813
|
-
q.$comment &&
|
|
1813
|
+
q.$comment && R.$comment && F(k), z(k), A.let(f.default.vErrors, null), A.let(f.default.errors, 0), q.unevaluated && u(k), O(k), L(k);
|
|
1814
1814
|
});
|
|
1815
1815
|
}
|
|
1816
1816
|
function u(k) {
|
|
1817
|
-
const { gen:
|
|
1818
|
-
k.evaluated =
|
|
1817
|
+
const { gen: R, validateName: q } = k;
|
|
1818
|
+
k.evaluated = R.const("evaluated", (0, d._)`${q}.evaluated`), R.if((0, d._)`${k.evaluated}.dynamicProps`, () => R.assign((0, d._)`${k.evaluated}.props`, (0, d._)`undefined`)), R.if((0, d._)`${k.evaluated}.dynamicItems`, () => R.assign((0, d._)`${k.evaluated}.items`, (0, d._)`undefined`));
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1821
|
-
const q = typeof k == "object" && k[
|
|
1822
|
-
return q && (
|
|
1820
|
+
function n(k, R) {
|
|
1821
|
+
const q = typeof k == "object" && k[R.schemaId];
|
|
1822
|
+
return q && (R.code.source || R.code.process) ? (0, d._)`/*# sourceURL=${q} */` : d.nil;
|
|
1823
1823
|
}
|
|
1824
|
-
function c(k,
|
|
1824
|
+
function c(k, R) {
|
|
1825
1825
|
if (o(k) && (P(k), g(k))) {
|
|
1826
|
-
m(k,
|
|
1826
|
+
m(k, R);
|
|
1827
1827
|
return;
|
|
1828
1828
|
}
|
|
1829
|
-
(0, e.boolOrEmptySchema)(k,
|
|
1829
|
+
(0, e.boolOrEmptySchema)(k, R);
|
|
1830
1830
|
}
|
|
1831
|
-
function g({ schema: k, self:
|
|
1831
|
+
function g({ schema: k, self: R }) {
|
|
1832
1832
|
if (typeof k == "boolean")
|
|
1833
1833
|
return !k;
|
|
1834
1834
|
for (const q in k)
|
|
1835
|
-
if (
|
|
1835
|
+
if (R.RULES.all[q])
|
|
1836
1836
|
return !0;
|
|
1837
1837
|
return !1;
|
|
1838
1838
|
}
|
|
1839
1839
|
function o(k) {
|
|
1840
1840
|
return typeof k.schema != "boolean";
|
|
1841
1841
|
}
|
|
1842
|
-
function m(k,
|
|
1842
|
+
function m(k, R) {
|
|
1843
1843
|
const { schema: q, gen: A, opts: K } = k;
|
|
1844
1844
|
K.$comment && q.$comment && F(k), C(k), V(k);
|
|
1845
1845
|
const W = A.const("_errs", f.default.errors);
|
|
1846
|
-
O(k, W), A.var(
|
|
1846
|
+
O(k, W), A.var(R, (0, d._)`${W} === ${f.default.errors}`);
|
|
1847
1847
|
}
|
|
1848
1848
|
function P(k) {
|
|
1849
1849
|
(0, $.checkUnknownRules)(k), T(k);
|
|
1850
1850
|
}
|
|
1851
|
-
function O(k,
|
|
1851
|
+
function O(k, R) {
|
|
1852
1852
|
if (k.opts.jtd)
|
|
1853
|
-
return ie(k, [], !1,
|
|
1853
|
+
return ie(k, [], !1, R);
|
|
1854
1854
|
const q = (0, t.getSchemaTypes)(k.schema), A = (0, t.coerceAndCheckDataType)(k, q);
|
|
1855
|
-
ie(k, q, !A,
|
|
1855
|
+
ie(k, q, !A, R);
|
|
1856
1856
|
}
|
|
1857
1857
|
function T(k) {
|
|
1858
|
-
const { schema:
|
|
1859
|
-
|
|
1858
|
+
const { schema: R, errSchemaPath: q, opts: A, self: K } = k;
|
|
1859
|
+
R.$ref && A.ignoreKeywordsWithRef && (0, $.schemaHasRulesButRef)(R, K.RULES) && K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`);
|
|
1860
1860
|
}
|
|
1861
1861
|
function z(k) {
|
|
1862
|
-
const { schema:
|
|
1863
|
-
|
|
1862
|
+
const { schema: R, opts: q } = k;
|
|
1863
|
+
R.default !== void 0 && q.useDefaults && q.strictSchema && (0, $.checkStrictMode)(k, "default is ignored in the schema root");
|
|
1864
1864
|
}
|
|
1865
1865
|
function C(k) {
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1866
|
+
const R = k.schema[k.opts.schemaId];
|
|
1867
|
+
R && (k.baseId = (0, w.resolveUrl)(k.opts.uriResolver, k.baseId, R));
|
|
1868
1868
|
}
|
|
1869
1869
|
function V(k) {
|
|
1870
1870
|
if (k.schema.$async && !k.schemaEnv.$async)
|
|
1871
1871
|
throw new Error("async schema in sync schema");
|
|
1872
1872
|
}
|
|
1873
|
-
function F({ gen: k, schemaEnv:
|
|
1873
|
+
function F({ gen: k, schemaEnv: R, schema: q, errSchemaPath: A, opts: K }) {
|
|
1874
1874
|
const W = q.$comment;
|
|
1875
1875
|
if (K.$comment === !0)
|
|
1876
1876
|
k.code((0, d._)`${f.default.self}.logger.log(${W})`);
|
|
1877
1877
|
else if (typeof K.$comment == "function") {
|
|
1878
|
-
const re = (0, d.str)`${A}/$comment`, me = k.scopeValue("root", { ref:
|
|
1878
|
+
const re = (0, d.str)`${A}/$comment`, me = k.scopeValue("root", { ref: R.root });
|
|
1879
1879
|
k.code((0, d._)`${f.default.self}.opts.$comment(${W}, ${re}, ${me}.schema)`);
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
1882
|
function L(k) {
|
|
1883
|
-
const { gen:
|
|
1884
|
-
q.$async ?
|
|
1883
|
+
const { gen: R, schemaEnv: q, validateName: A, ValidationError: K, opts: W } = k;
|
|
1884
|
+
q.$async ? R.if((0, d._)`${f.default.errors} === 0`, () => R.return(f.default.data), () => R.throw((0, d._)`new ${K}(${f.default.vErrors})`)) : (R.assign((0, d._)`${A}.errors`, f.default.vErrors), W.unevaluated && x(k), R.return((0, d._)`${f.default.errors} === 0`));
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1887
|
-
q instanceof d.Name && k.assign((0, d._)`${
|
|
1886
|
+
function x({ gen: k, evaluated: R, props: q, items: A }) {
|
|
1887
|
+
q instanceof d.Name && k.assign((0, d._)`${R}.props`, q), A instanceof d.Name && k.assign((0, d._)`${R}.items`, A);
|
|
1888
1888
|
}
|
|
1889
|
-
function ie(k,
|
|
1889
|
+
function ie(k, R, q, A) {
|
|
1890
1890
|
const { gen: K, schema: W, data: re, allErrors: me, opts: ce, self: de } = k, { RULES: ne } = de;
|
|
1891
1891
|
if (W.$ref && (ce.ignoreKeywordsWithRef || !(0, $.schemaHasRulesButRef)(W, ne))) {
|
|
1892
1892
|
K.block(() => U(k, "$ref", ne.all.$ref.definition));
|
|
1893
1893
|
return;
|
|
1894
1894
|
}
|
|
1895
|
-
ce.jtd || X(k,
|
|
1896
|
-
for (const
|
|
1897
|
-
|
|
1898
|
-
|
|
1895
|
+
ce.jtd || X(k, R), K.block(() => {
|
|
1896
|
+
for (const fe of ne.rules)
|
|
1897
|
+
Re(fe);
|
|
1898
|
+
Re(ne.post);
|
|
1899
1899
|
});
|
|
1900
|
-
function
|
|
1901
|
-
(0,
|
|
1900
|
+
function Re(fe) {
|
|
1901
|
+
(0, r.shouldUseGroup)(W, fe) && (fe.type ? (K.if((0, i.checkDataType)(fe.type, re, ce.strictNumbers)), oe(k, fe), R.length === 1 && R[0] === fe.type && q && (K.else(), (0, i.reportTypeError)(k)), K.endIf()) : oe(k, fe), me || K.if((0, d._)`${f.default.errors} === ${A || 0}`));
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
|
-
function oe(k,
|
|
1904
|
+
function oe(k, R) {
|
|
1905
1905
|
const { gen: q, schema: A, opts: { useDefaults: K } } = k;
|
|
1906
|
-
K && (0, y.assignDefaults)(k,
|
|
1907
|
-
for (const W of
|
|
1908
|
-
(0,
|
|
1906
|
+
K && (0, y.assignDefaults)(k, R.type), q.block(() => {
|
|
1907
|
+
for (const W of R.rules)
|
|
1908
|
+
(0, r.shouldUseRule)(A, W) && U(k, W.keyword, W.definition, R.type);
|
|
1909
1909
|
});
|
|
1910
1910
|
}
|
|
1911
|
-
function X(k,
|
|
1912
|
-
k.schemaEnv.meta || !k.opts.strictTypes || (pe(k,
|
|
1911
|
+
function X(k, R) {
|
|
1912
|
+
k.schemaEnv.meta || !k.opts.strictTypes || (pe(k, R), k.opts.allowUnionTypes || M(k, R), j(k, k.dataTypes));
|
|
1913
1913
|
}
|
|
1914
|
-
function pe(k,
|
|
1915
|
-
if (
|
|
1914
|
+
function pe(k, R) {
|
|
1915
|
+
if (R.length) {
|
|
1916
1916
|
if (!k.dataTypes.length) {
|
|
1917
|
-
k.dataTypes =
|
|
1917
|
+
k.dataTypes = R;
|
|
1918
1918
|
return;
|
|
1919
1919
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}), p(k,
|
|
1920
|
+
R.forEach((q) => {
|
|
1921
|
+
I(k.dataTypes, q) || S(k, `type "${q}" not allowed by context "${k.dataTypes.join(",")}"`);
|
|
1922
|
+
}), p(k, R);
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
1925
|
-
function M(k,
|
|
1926
|
-
|
|
1925
|
+
function M(k, R) {
|
|
1926
|
+
R.length > 1 && !(R.length === 2 && R.includes("null")) && S(k, "use allowUnionTypes to allow union type keyword");
|
|
1927
1927
|
}
|
|
1928
|
-
function j(k,
|
|
1928
|
+
function j(k, R) {
|
|
1929
1929
|
const q = k.self.RULES.all;
|
|
1930
1930
|
for (const A in q) {
|
|
1931
1931
|
const K = q[A];
|
|
1932
|
-
if (typeof K == "object" && (0,
|
|
1932
|
+
if (typeof K == "object" && (0, r.shouldUseRule)(k.schema, K)) {
|
|
1933
1933
|
const { type: W } = K.definition;
|
|
1934
|
-
W.length && !W.some((re) => D(
|
|
1934
|
+
W.length && !W.some((re) => D(R, re)) && S(k, `missing type "${W.join(",")}" for keyword "${A}"`);
|
|
1935
1935
|
}
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
function D(k,
|
|
1939
|
-
return k.includes(
|
|
1938
|
+
function D(k, R) {
|
|
1939
|
+
return k.includes(R) || R === "number" && k.includes("integer");
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1942
|
-
return k.includes(
|
|
1941
|
+
function I(k, R) {
|
|
1942
|
+
return k.includes(R) || R === "integer" && k.includes("number");
|
|
1943
1943
|
}
|
|
1944
|
-
function p(k,
|
|
1944
|
+
function p(k, R) {
|
|
1945
1945
|
const q = [];
|
|
1946
1946
|
for (const A of k.dataTypes)
|
|
1947
|
-
R
|
|
1947
|
+
I(R, A) ? q.push(A) : R.includes("integer") && A === "number" && q.push("integer");
|
|
1948
1948
|
k.dataTypes = q;
|
|
1949
1949
|
}
|
|
1950
|
-
function S(k,
|
|
1950
|
+
function S(k, R) {
|
|
1951
1951
|
const q = k.schemaEnv.baseId + k.errSchemaPath;
|
|
1952
|
-
|
|
1952
|
+
R += ` at "${q}" (strictTypes)`, (0, $.checkStrictMode)(k, R, k.opts.strictTypes);
|
|
1953
1953
|
}
|
|
1954
1954
|
class N {
|
|
1955
|
-
constructor(
|
|
1956
|
-
if ((0, s.validateKeywordUsage)(
|
|
1957
|
-
this.schemaCode =
|
|
1955
|
+
constructor(R, q, A) {
|
|
1956
|
+
if ((0, s.validateKeywordUsage)(R, q, A), this.gen = R.gen, this.allErrors = R.allErrors, this.keyword = A, this.data = R.data, this.schema = R.schema[A], this.$data = q.$data && R.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, $.schemaRefOrVal)(R, this.schema, A, this.$data), this.schemaType = q.schemaType, this.parentSchema = R.schema, this.params = {}, this.it = R, this.def = q, this.$data)
|
|
1957
|
+
this.schemaCode = R.gen.const("vSchema", B(this.$data, R));
|
|
1958
1958
|
else if (this.schemaCode = this.schemaValue, !(0, s.validSchemaType)(this.schema, q.schemaType, q.allowUndefined))
|
|
1959
1959
|
throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);
|
|
1960
|
-
("code" in q ? q.trackErrors : q.errors !== !1) && (this.errsCount =
|
|
1960
|
+
("code" in q ? q.trackErrors : q.errors !== !1) && (this.errsCount = R.gen.const("_errs", f.default.errors));
|
|
1961
1961
|
}
|
|
1962
|
-
result(
|
|
1963
|
-
this.failResult((0, d.not)(
|
|
1962
|
+
result(R, q, A) {
|
|
1963
|
+
this.failResult((0, d.not)(R), q, A);
|
|
1964
1964
|
}
|
|
1965
|
-
failResult(
|
|
1966
|
-
this.gen.if(
|
|
1965
|
+
failResult(R, q, A) {
|
|
1966
|
+
this.gen.if(R), A ? A() : this.error(), q ? (this.gen.else(), q(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
|
|
1967
1967
|
}
|
|
1968
|
-
pass(
|
|
1969
|
-
this.failResult((0, d.not)(
|
|
1968
|
+
pass(R, q) {
|
|
1969
|
+
this.failResult((0, d.not)(R), void 0, q);
|
|
1970
1970
|
}
|
|
1971
|
-
fail(
|
|
1972
|
-
if (
|
|
1971
|
+
fail(R) {
|
|
1972
|
+
if (R === void 0) {
|
|
1973
1973
|
this.error(), this.allErrors || this.gen.if(!1);
|
|
1974
1974
|
return;
|
|
1975
1975
|
}
|
|
1976
|
-
this.gen.if(
|
|
1976
|
+
this.gen.if(R), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
|
|
1977
1977
|
}
|
|
1978
|
-
fail$data(
|
|
1978
|
+
fail$data(R) {
|
|
1979
1979
|
if (!this.$data)
|
|
1980
|
-
return this.fail(
|
|
1980
|
+
return this.fail(R);
|
|
1981
1981
|
const { schemaCode: q } = this;
|
|
1982
|
-
this.fail((0, d._)`${q} !== undefined && (${(0, d.or)(this.invalid$data(),
|
|
1982
|
+
this.fail((0, d._)`${q} !== undefined && (${(0, d.or)(this.invalid$data(), R)})`);
|
|
1983
1983
|
}
|
|
1984
|
-
error(
|
|
1984
|
+
error(R, q, A) {
|
|
1985
1985
|
if (q) {
|
|
1986
|
-
this.setParams(q), this._error(
|
|
1986
|
+
this.setParams(q), this._error(R, A), this.setParams({});
|
|
1987
1987
|
return;
|
|
1988
1988
|
}
|
|
1989
|
-
this._error(
|
|
1989
|
+
this._error(R, A);
|
|
1990
1990
|
}
|
|
1991
|
-
_error(
|
|
1992
|
-
(
|
|
1991
|
+
_error(R, q) {
|
|
1992
|
+
(R ? E.reportExtraError : E.reportError)(this, this.def.error, q);
|
|
1993
1993
|
}
|
|
1994
1994
|
$dataError() {
|
|
1995
1995
|
(0, E.reportError)(this, this.def.$dataError || E.keyword$DataError);
|
|
@@ -1999,25 +1999,25 @@ function Mt() {
|
|
|
1999
1999
|
throw new Error('add "trackErrors" to keyword definition');
|
|
2000
2000
|
(0, E.resetErrorsCount)(this.gen, this.errsCount);
|
|
2001
2001
|
}
|
|
2002
|
-
ok(
|
|
2003
|
-
this.allErrors || this.gen.if(
|
|
2002
|
+
ok(R) {
|
|
2003
|
+
this.allErrors || this.gen.if(R);
|
|
2004
2004
|
}
|
|
2005
|
-
setParams(
|
|
2006
|
-
q ? Object.assign(this.params,
|
|
2005
|
+
setParams(R, q) {
|
|
2006
|
+
q ? Object.assign(this.params, R) : this.params = R;
|
|
2007
2007
|
}
|
|
2008
|
-
block$data(
|
|
2008
|
+
block$data(R, q, A = d.nil) {
|
|
2009
2009
|
this.gen.block(() => {
|
|
2010
|
-
this.check$data(
|
|
2010
|
+
this.check$data(R, A), q();
|
|
2011
2011
|
});
|
|
2012
2012
|
}
|
|
2013
|
-
check$data(
|
|
2013
|
+
check$data(R = d.nil, q = d.nil) {
|
|
2014
2014
|
if (!this.$data)
|
|
2015
2015
|
return;
|
|
2016
2016
|
const { gen: A, schemaCode: K, schemaType: W, def: re } = this;
|
|
2017
|
-
A.if((0, d.or)((0, d._)`${K} === undefined`, q)),
|
|
2017
|
+
A.if((0, d.or)((0, d._)`${K} === undefined`, q)), R !== d.nil && A.assign(R, !0), (W.length || re.validateSchema) && (A.elseIf(this.invalid$data()), this.$dataError(), R !== d.nil && A.assign(R, !1)), A.else();
|
|
2018
2018
|
}
|
|
2019
2019
|
invalid$data() {
|
|
2020
|
-
const { gen:
|
|
2020
|
+
const { gen: R, schemaCode: q, schemaType: A, def: K, it: W } = this;
|
|
2021
2021
|
return (0, d.or)(re(), me());
|
|
2022
2022
|
function re() {
|
|
2023
2023
|
if (A.length) {
|
|
@@ -2030,35 +2030,35 @@ function Mt() {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
function me() {
|
|
2032
2032
|
if (K.validateSchema) {
|
|
2033
|
-
const ce =
|
|
2033
|
+
const ce = R.scopeValue("validate$data", { ref: K.validateSchema });
|
|
2034
2034
|
return (0, d._)`!${ce}(${q})`;
|
|
2035
2035
|
}
|
|
2036
2036
|
return d.nil;
|
|
2037
2037
|
}
|
|
2038
2038
|
}
|
|
2039
|
-
subschema(
|
|
2040
|
-
const A = (0, l.getSubschema)(this.it,
|
|
2041
|
-
(0, l.extendSubschemaData)(A, this.it,
|
|
2039
|
+
subschema(R, q) {
|
|
2040
|
+
const A = (0, l.getSubschema)(this.it, R);
|
|
2041
|
+
(0, l.extendSubschemaData)(A, this.it, R), (0, l.extendSubschemaMode)(A, R);
|
|
2042
2042
|
const K = { ...this.it, ...A, items: void 0, props: void 0 };
|
|
2043
2043
|
return c(K, q), K;
|
|
2044
2044
|
}
|
|
2045
|
-
mergeEvaluated(
|
|
2045
|
+
mergeEvaluated(R, q) {
|
|
2046
2046
|
const { it: A, gen: K } = this;
|
|
2047
|
-
A.opts.unevaluated && (A.props !== !0 &&
|
|
2047
|
+
A.opts.unevaluated && (A.props !== !0 && R.props !== void 0 && (A.props = $.mergeEvaluated.props(K, R.props, A.props, q)), A.items !== !0 && R.items !== void 0 && (A.items = $.mergeEvaluated.items(K, R.items, A.items, q)));
|
|
2048
2048
|
}
|
|
2049
|
-
mergeValidEvaluated(
|
|
2049
|
+
mergeValidEvaluated(R, q) {
|
|
2050
2050
|
const { it: A, gen: K } = this;
|
|
2051
2051
|
if (A.opts.unevaluated && (A.props !== !0 || A.items !== !0))
|
|
2052
|
-
return K.if(q, () => this.mergeEvaluated(
|
|
2052
|
+
return K.if(q, () => this.mergeEvaluated(R, d.Name)), !0;
|
|
2053
2053
|
}
|
|
2054
2054
|
}
|
|
2055
2055
|
ve.KeywordCxt = N;
|
|
2056
|
-
function U(k,
|
|
2057
|
-
const K = new N(k, q,
|
|
2056
|
+
function U(k, R, q, A) {
|
|
2057
|
+
const K = new N(k, q, R);
|
|
2058
2058
|
"code" in q ? q.code(K, A) : K.$data && q.validate ? (0, s.funcKeywordCode)(K, q) : "macro" in q ? (0, s.macroKeywordCode)(K, q) : (q.compile || q.validate) && (0, s.funcKeywordCode)(K, q);
|
|
2059
2059
|
}
|
|
2060
|
-
const J = /^\/(?:[^~]|~0|~1)*$/,
|
|
2061
|
-
function B(k, { dataLevel:
|
|
2060
|
+
const J = /^\/(?:[^~]|~0|~1)*$/, Q = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
2061
|
+
function B(k, { dataLevel: R, dataNames: q, dataPathArr: A }) {
|
|
2062
2062
|
let K, W;
|
|
2063
2063
|
if (k === "")
|
|
2064
2064
|
return f.default.rootData;
|
|
@@ -2067,18 +2067,18 @@ function Mt() {
|
|
|
2067
2067
|
throw new Error(`Invalid JSON-pointer: ${k}`);
|
|
2068
2068
|
K = k, W = f.default.rootData;
|
|
2069
2069
|
} else {
|
|
2070
|
-
const de =
|
|
2070
|
+
const de = Q.exec(k);
|
|
2071
2071
|
if (!de)
|
|
2072
2072
|
throw new Error(`Invalid JSON-pointer: ${k}`);
|
|
2073
2073
|
const ne = +de[1];
|
|
2074
2074
|
if (K = de[2], K === "#") {
|
|
2075
|
-
if (ne >=
|
|
2075
|
+
if (ne >= R)
|
|
2076
2076
|
throw new Error(ce("property/index", ne));
|
|
2077
|
-
return A[
|
|
2077
|
+
return A[R - ne];
|
|
2078
2078
|
}
|
|
2079
|
-
if (ne >
|
|
2079
|
+
if (ne > R)
|
|
2080
2080
|
throw new Error(ce("data", ne));
|
|
2081
|
-
if (W = q[
|
|
2081
|
+
if (W = q[R - ne], !K)
|
|
2082
2082
|
return W;
|
|
2083
2083
|
}
|
|
2084
2084
|
let re = W;
|
|
@@ -2087,7 +2087,7 @@ function Mt() {
|
|
|
2087
2087
|
de && (W = (0, d._)`${W}${(0, d.getProperty)((0, $.unescapeJsonPointer)(de))}`, re = (0, d._)`${re} && ${W}`);
|
|
2088
2088
|
return re;
|
|
2089
2089
|
function ce(de, ne) {
|
|
2090
|
-
return `Cannot access ${de} ${ne} levels up, current level is ${
|
|
2090
|
+
return `Cannot access ${de} ${ne} levels up, current level is ${R}`;
|
|
2091
2091
|
}
|
|
2092
2092
|
}
|
|
2093
2093
|
return ve.getData = B, ve;
|
|
@@ -2097,16 +2097,16 @@ function er() {
|
|
|
2097
2097
|
if (jr) return Le;
|
|
2098
2098
|
jr = 1, Object.defineProperty(Le, "__esModule", { value: !0 });
|
|
2099
2099
|
class e extends Error {
|
|
2100
|
-
constructor(
|
|
2101
|
-
super("validation failed"), this.errors =
|
|
2100
|
+
constructor(r) {
|
|
2101
|
+
super("validation failed"), this.errors = r, this.ajv = this.validation = !0;
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
2104
|
return Le.default = e, Le;
|
|
2105
2105
|
}
|
|
2106
|
-
var Ue = {},
|
|
2106
|
+
var Ue = {}, Rr;
|
|
2107
2107
|
function At() {
|
|
2108
|
-
if (
|
|
2109
|
-
|
|
2108
|
+
if (Rr) return Ue;
|
|
2109
|
+
Rr = 1, Object.defineProperty(Ue, "__esModule", { value: !0 });
|
|
2110
2110
|
const e = Tt();
|
|
2111
2111
|
class t extends Error {
|
|
2112
2112
|
constructor(i, y, s, l) {
|
|
@@ -2115,25 +2115,25 @@ function At() {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
return Ue.default = t, Ue;
|
|
2117
2117
|
}
|
|
2118
|
-
var
|
|
2118
|
+
var le = {}, Ir;
|
|
2119
2119
|
function tr() {
|
|
2120
|
-
if (
|
|
2121
|
-
|
|
2122
|
-
const e = G(), t = er(),
|
|
2120
|
+
if (Ir) return le;
|
|
2121
|
+
Ir = 1, Object.defineProperty(le, "__esModule", { value: !0 }), le.resolveSchema = le.getCompilingSchema = le.resolveRef = le.compileSchema = le.SchemaEnv = void 0;
|
|
2122
|
+
const e = G(), t = er(), r = Se(), i = Tt(), y = Y(), s = Mt();
|
|
2123
2123
|
class l {
|
|
2124
2124
|
constructor(u) {
|
|
2125
|
-
var
|
|
2125
|
+
var n;
|
|
2126
2126
|
this.refs = {}, this.dynamicAnchors = {};
|
|
2127
2127
|
let c;
|
|
2128
|
-
typeof u.schema == "object" && (c = u.schema), this.schema = u.schema, this.schemaId = u.schemaId, this.root = u.root || this, this.baseId = (
|
|
2128
|
+
typeof u.schema == "object" && (c = u.schema), this.schema = u.schema, this.schemaId = u.schemaId, this.root = u.root || this, this.baseId = (n = u.baseId) !== null && n !== void 0 ? n : (0, i.normalizeId)(c?.[u.schemaId || "$id"]), this.schemaPath = u.schemaPath, this.localRefs = u.localRefs, this.meta = u.meta, this.$async = c?.$async, this.refs = {};
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
|
-
|
|
2131
|
+
le.SchemaEnv = l;
|
|
2132
2132
|
function d(a) {
|
|
2133
2133
|
const u = $.call(this, a);
|
|
2134
2134
|
if (u)
|
|
2135
2135
|
return u;
|
|
2136
|
-
const
|
|
2136
|
+
const n = (0, i.getFullPath)(this.opts.uriResolver, a.root.baseId), { es5: c, lines: g } = this.opts.code, { ownProperties: o } = this.opts, m = new e.CodeGen(this.scope, { es5: c, lines: g, ownProperties: o });
|
|
2137
2137
|
let P;
|
|
2138
2138
|
a.$async && (P = m.scopeValue("Error", {
|
|
2139
2139
|
ref: t.default,
|
|
@@ -2144,10 +2144,10 @@ function tr() {
|
|
|
2144
2144
|
const T = {
|
|
2145
2145
|
gen: m,
|
|
2146
2146
|
allErrors: this.opts.allErrors,
|
|
2147
|
-
data:
|
|
2148
|
-
parentData:
|
|
2149
|
-
parentDataProperty:
|
|
2150
|
-
dataNames: [
|
|
2147
|
+
data: r.default.data,
|
|
2148
|
+
parentData: r.default.parentData,
|
|
2149
|
+
parentDataProperty: r.default.parentDataProperty,
|
|
2150
|
+
dataNames: [r.default.data],
|
|
2151
2151
|
dataPathArr: [e.nil],
|
|
2152
2152
|
// TODO can its length be used as dataLevel if nil is removed?
|
|
2153
2153
|
dataLevel: 0,
|
|
@@ -2158,8 +2158,8 @@ function tr() {
|
|
|
2158
2158
|
ValidationError: P,
|
|
2159
2159
|
schema: a.schema,
|
|
2160
2160
|
schemaEnv: a,
|
|
2161
|
-
rootId:
|
|
2162
|
-
baseId: a.baseId ||
|
|
2161
|
+
rootId: n,
|
|
2162
|
+
baseId: a.baseId || n,
|
|
2163
2163
|
schemaPath: e.nil,
|
|
2164
2164
|
errSchemaPath: a.schemaPath || (this.opts.jtd ? "" : "#"),
|
|
2165
2165
|
errorPath: (0, e._)`""`,
|
|
@@ -2170,15 +2170,15 @@ function tr() {
|
|
|
2170
2170
|
try {
|
|
2171
2171
|
this._compilations.add(a), (0, s.validateFunctionCode)(T), m.optimize(this.opts.code.optimize);
|
|
2172
2172
|
const C = m.toString();
|
|
2173
|
-
z = `${m.scopeRefs(
|
|
2174
|
-
const F = new Function(`${
|
|
2173
|
+
z = `${m.scopeRefs(r.default.scope)}return ${C}`, this.opts.code.process && (z = this.opts.code.process(z, a));
|
|
2174
|
+
const F = new Function(`${r.default.self}`, `${r.default.scope}`, z)(this, this.scope.get());
|
|
2175
2175
|
if (this.scope.value(O, { ref: F }), F.errors = null, F.schema = a.schema, F.schemaEnv = a, a.$async && (F.$async = !0), this.opts.code.source === !0 && (F.source = { validateName: O, validateCode: C, scopeValues: m._values }), this.opts.unevaluated) {
|
|
2176
|
-
const { props: L, items:
|
|
2176
|
+
const { props: L, items: x } = T;
|
|
2177
2177
|
F.evaluated = {
|
|
2178
2178
|
props: L instanceof e.Name ? void 0 : L,
|
|
2179
|
-
items:
|
|
2179
|
+
items: x instanceof e.Name ? void 0 : x,
|
|
2180
2180
|
dynamicProps: L instanceof e.Name,
|
|
2181
|
-
dynamicItems:
|
|
2181
|
+
dynamicItems: x instanceof e.Name
|
|
2182
2182
|
}, F.source && (F.source.evaluated = (0, e.stringify)(F.evaluated));
|
|
2183
2183
|
}
|
|
2184
2184
|
return a.validate = F, a;
|
|
@@ -2188,22 +2188,22 @@ function tr() {
|
|
|
2188
2188
|
this._compilations.delete(a);
|
|
2189
2189
|
}
|
|
2190
2190
|
}
|
|
2191
|
-
|
|
2192
|
-
function f(a, u,
|
|
2191
|
+
le.compileSchema = d;
|
|
2192
|
+
function f(a, u, n) {
|
|
2193
2193
|
var c;
|
|
2194
|
-
|
|
2195
|
-
const g = a.refs[
|
|
2194
|
+
n = (0, i.resolveUrl)(this.opts.uriResolver, u, n);
|
|
2195
|
+
const g = a.refs[n];
|
|
2196
2196
|
if (g)
|
|
2197
2197
|
return g;
|
|
2198
|
-
let o = _.call(this, a,
|
|
2198
|
+
let o = _.call(this, a, n);
|
|
2199
2199
|
if (o === void 0) {
|
|
2200
|
-
const m = (c = a.localRefs) === null || c === void 0 ? void 0 : c[
|
|
2200
|
+
const m = (c = a.localRefs) === null || c === void 0 ? void 0 : c[n], { schemaId: P } = this.opts;
|
|
2201
2201
|
m && (o = new l({ schema: m, schemaId: P, root: a, baseId: u }));
|
|
2202
2202
|
}
|
|
2203
2203
|
if (o !== void 0)
|
|
2204
|
-
return a.refs[
|
|
2204
|
+
return a.refs[n] = w.call(this, o);
|
|
2205
2205
|
}
|
|
2206
|
-
|
|
2206
|
+
le.resolveRef = f;
|
|
2207
2207
|
function w(a) {
|
|
2208
2208
|
return (0, i.inlineRef)(a.schema, this.opts.inlineRefs) ? a.schema : a.validate ? a : d.call(this, a);
|
|
2209
2209
|
}
|
|
@@ -2212,35 +2212,35 @@ function tr() {
|
|
|
2212
2212
|
if (E(u, a))
|
|
2213
2213
|
return u;
|
|
2214
2214
|
}
|
|
2215
|
-
|
|
2215
|
+
le.getCompilingSchema = $;
|
|
2216
2216
|
function E(a, u) {
|
|
2217
2217
|
return a.schema === u.schema && a.root === u.root && a.baseId === u.baseId;
|
|
2218
2218
|
}
|
|
2219
2219
|
function _(a, u) {
|
|
2220
|
-
let
|
|
2221
|
-
for (; typeof (
|
|
2222
|
-
u =
|
|
2223
|
-
return
|
|
2220
|
+
let n;
|
|
2221
|
+
for (; typeof (n = this.refs[u]) == "string"; )
|
|
2222
|
+
u = n;
|
|
2223
|
+
return n || this.schemas[u] || v.call(this, a, u);
|
|
2224
2224
|
}
|
|
2225
2225
|
function v(a, u) {
|
|
2226
|
-
const
|
|
2226
|
+
const n = this.opts.uriResolver.parse(u), c = (0, i._getFullPath)(this.opts.uriResolver, n);
|
|
2227
2227
|
let g = (0, i.getFullPath)(this.opts.uriResolver, a.baseId, void 0);
|
|
2228
2228
|
if (Object.keys(a.schema).length > 0 && c === g)
|
|
2229
|
-
return h.call(this,
|
|
2229
|
+
return h.call(this, n, a);
|
|
2230
2230
|
const o = (0, i.normalizeId)(c), m = this.refs[o] || this.schemas[o];
|
|
2231
2231
|
if (typeof m == "string") {
|
|
2232
2232
|
const P = v.call(this, a, m);
|
|
2233
|
-
return typeof P?.schema != "object" ? void 0 : h.call(this,
|
|
2233
|
+
return typeof P?.schema != "object" ? void 0 : h.call(this, n, P);
|
|
2234
2234
|
}
|
|
2235
2235
|
if (typeof m?.schema == "object") {
|
|
2236
2236
|
if (m.validate || d.call(this, m), o === (0, i.normalizeId)(u)) {
|
|
2237
2237
|
const { schema: P } = m, { schemaId: O } = this.opts, T = P[O];
|
|
2238
2238
|
return T && (g = (0, i.resolveUrl)(this.opts.uriResolver, g, T)), new l({ schema: P, schemaId: O, root: a, baseId: g });
|
|
2239
2239
|
}
|
|
2240
|
-
return h.call(this,
|
|
2240
|
+
return h.call(this, n, m);
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
|
-
|
|
2243
|
+
le.resolveSchema = v;
|
|
2244
2244
|
const b = /* @__PURE__ */ new Set([
|
|
2245
2245
|
"properties",
|
|
2246
2246
|
"patternProperties",
|
|
@@ -2248,30 +2248,30 @@ function tr() {
|
|
|
2248
2248
|
"dependencies",
|
|
2249
2249
|
"definitions"
|
|
2250
2250
|
]);
|
|
2251
|
-
function h(a, { baseId: u, schema:
|
|
2251
|
+
function h(a, { baseId: u, schema: n, root: c }) {
|
|
2252
2252
|
var g;
|
|
2253
2253
|
if (((g = a.fragment) === null || g === void 0 ? void 0 : g[0]) !== "/")
|
|
2254
2254
|
return;
|
|
2255
2255
|
for (const P of a.fragment.slice(1).split("/")) {
|
|
2256
|
-
if (typeof
|
|
2256
|
+
if (typeof n == "boolean")
|
|
2257
2257
|
return;
|
|
2258
|
-
const O =
|
|
2258
|
+
const O = n[(0, y.unescapeFragment)(P)];
|
|
2259
2259
|
if (O === void 0)
|
|
2260
2260
|
return;
|
|
2261
|
-
|
|
2262
|
-
const T = typeof
|
|
2261
|
+
n = O;
|
|
2262
|
+
const T = typeof n == "object" && n[this.opts.schemaId];
|
|
2263
2263
|
!b.has(P) && T && (u = (0, i.resolveUrl)(this.opts.uriResolver, u, T));
|
|
2264
2264
|
}
|
|
2265
2265
|
let o;
|
|
2266
|
-
if (typeof
|
|
2267
|
-
const P = (0, i.resolveUrl)(this.opts.uriResolver, u,
|
|
2266
|
+
if (typeof n != "boolean" && n.$ref && !(0, y.schemaHasRulesButRef)(n, this.RULES)) {
|
|
2267
|
+
const P = (0, i.resolveUrl)(this.opts.uriResolver, u, n.$ref);
|
|
2268
2268
|
o = v.call(this, c, P);
|
|
2269
2269
|
}
|
|
2270
2270
|
const { schemaId: m } = this.opts;
|
|
2271
|
-
if (o = o || new l({ schema:
|
|
2271
|
+
if (o = o || new l({ schema: n, schemaId: m, root: c, baseId: u }), o.schema !== o.root.schema)
|
|
2272
2272
|
return o;
|
|
2273
2273
|
}
|
|
2274
|
-
return
|
|
2274
|
+
return le;
|
|
2275
2275
|
}
|
|
2276
2276
|
const ys = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", gs = "Meta-schema for $data reference (JSON AnySchema extension proposal)", vs = "object", _s = ["$data"], $s = { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, bs = !1, ws = {
|
|
2277
2277
|
$id: ys,
|
|
@@ -2286,7 +2286,7 @@ function Nn() {
|
|
|
2286
2286
|
if (Or) return Bt;
|
|
2287
2287
|
Or = 1;
|
|
2288
2288
|
const e = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), t = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
2289
|
-
function
|
|
2289
|
+
function r(_) {
|
|
2290
2290
|
let v = "", b = 0, h = 0;
|
|
2291
2291
|
for (h = 0; h < _.length; h++)
|
|
2292
2292
|
if (b = _[h].charCodeAt(0), b !== 48) {
|
|
@@ -2308,7 +2308,7 @@ function Nn() {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
function s(_, v, b) {
|
|
2310
2310
|
if (_.length) {
|
|
2311
|
-
const h =
|
|
2311
|
+
const h = r(_);
|
|
2312
2312
|
if (h !== "")
|
|
2313
2313
|
v.push(h);
|
|
2314
2314
|
else
|
|
@@ -2320,12 +2320,12 @@ function Nn() {
|
|
|
2320
2320
|
function l(_) {
|
|
2321
2321
|
let v = 0;
|
|
2322
2322
|
const b = { error: !1, address: "", zone: "" }, h = [], a = [];
|
|
2323
|
-
let u = !1,
|
|
2323
|
+
let u = !1, n = !1, c = s;
|
|
2324
2324
|
for (let g = 0; g < _.length; g++) {
|
|
2325
2325
|
const o = _[g];
|
|
2326
2326
|
if (!(o === "[" || o === "]"))
|
|
2327
2327
|
if (o === ":") {
|
|
2328
|
-
if (u === !0 && (
|
|
2328
|
+
if (u === !0 && (n = !0), !c(a, h, b))
|
|
2329
2329
|
break;
|
|
2330
2330
|
if (++v > 7) {
|
|
2331
2331
|
b.error = !0;
|
|
@@ -2342,7 +2342,7 @@ function Nn() {
|
|
|
2342
2342
|
continue;
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
return a.length && (c === y ? b.zone = a.join("") :
|
|
2345
|
+
return a.length && (c === y ? b.zone = a.join("") : n ? h.push(a.join("")) : h.push(r(a))), b.address = h.join(""), b;
|
|
2346
2346
|
}
|
|
2347
2347
|
function d(_) {
|
|
2348
2348
|
if (f(_, ":") < 2)
|
|
@@ -2443,14 +2443,14 @@ function Nn() {
|
|
|
2443
2443
|
isIPv4: t,
|
|
2444
2444
|
isUUID: e,
|
|
2445
2445
|
normalizeIPv6: d,
|
|
2446
|
-
stringArrayToHexStripped:
|
|
2446
|
+
stringArrayToHexStripped: r
|
|
2447
2447
|
}, Bt;
|
|
2448
2448
|
}
|
|
2449
2449
|
var Yt, Nr;
|
|
2450
2450
|
function Ps() {
|
|
2451
2451
|
if (Nr) return Yt;
|
|
2452
2452
|
Nr = 1;
|
|
2453
|
-
const { isUUID: e } = Nn(), t = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,
|
|
2453
|
+
const { isUUID: e } = Nn(), t = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu, r = (
|
|
2454
2454
|
/** @type {const} */
|
|
2455
2455
|
[
|
|
2456
2456
|
"http",
|
|
@@ -2462,7 +2462,7 @@ function Ps() {
|
|
|
2462
2462
|
]
|
|
2463
2463
|
);
|
|
2464
2464
|
function i(o) {
|
|
2465
|
-
return
|
|
2465
|
+
return r.indexOf(
|
|
2466
2466
|
/** @type {*} */
|
|
2467
2467
|
o
|
|
2468
2468
|
) !== -1;
|
|
@@ -2596,25 +2596,25 @@ var Cr;
|
|
|
2596
2596
|
function Ss() {
|
|
2597
2597
|
if (Cr) return De.exports;
|
|
2598
2598
|
Cr = 1;
|
|
2599
|
-
const { normalizeIPv6: e, removeDotSegments: t, recomposeAuthority:
|
|
2599
|
+
const { normalizeIPv6: e, removeDotSegments: t, recomposeAuthority: r, normalizeComponentEncoding: i, isIPv4: y, nonSimpleDomain: s } = Nn(), { SCHEMES: l, getSchemeHandler: d } = Ps();
|
|
2600
2600
|
function f(a, u) {
|
|
2601
2601
|
return typeof a == "string" ? a = /** @type {T} */
|
|
2602
2602
|
_(b(a, u), u) : typeof a == "object" && (a = /** @type {T} */
|
|
2603
2603
|
b(_(a, u), u)), a;
|
|
2604
2604
|
}
|
|
2605
|
-
function w(a, u,
|
|
2606
|
-
const c =
|
|
2605
|
+
function w(a, u, n) {
|
|
2606
|
+
const c = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, g = $(b(a, c), b(u, c), c, !0);
|
|
2607
2607
|
return c.skipEscape = !0, _(g, c);
|
|
2608
2608
|
}
|
|
2609
|
-
function $(a, u,
|
|
2609
|
+
function $(a, u, n, c) {
|
|
2610
2610
|
const g = {};
|
|
2611
|
-
return c || (a = b(_(a,
|
|
2611
|
+
return c || (a = b(_(a, n), n), u = b(_(u, n), n)), n = n || {}, !n.tolerant && u.scheme ? (g.scheme = u.scheme, g.userinfo = u.userinfo, g.host = u.host, g.port = u.port, g.path = t(u.path || ""), g.query = u.query) : (u.userinfo !== void 0 || u.host !== void 0 || u.port !== void 0 ? (g.userinfo = u.userinfo, g.host = u.host, g.port = u.port, g.path = t(u.path || ""), g.query = u.query) : (u.path ? (u.path[0] === "/" ? g.path = t(u.path) : ((a.userinfo !== void 0 || a.host !== void 0 || a.port !== void 0) && !a.path ? g.path = "/" + u.path : a.path ? g.path = a.path.slice(0, a.path.lastIndexOf("/") + 1) + u.path : g.path = u.path, g.path = t(g.path)), g.query = u.query) : (g.path = a.path, u.query !== void 0 ? g.query = u.query : g.query = a.query), g.userinfo = a.userinfo, g.host = a.host, g.port = a.port), g.scheme = a.scheme), g.fragment = u.fragment, g;
|
|
2612
2612
|
}
|
|
2613
|
-
function E(a, u,
|
|
2614
|
-
return typeof a == "string" ? (a = unescape(a), a = _(i(b(a,
|
|
2613
|
+
function E(a, u, n) {
|
|
2614
|
+
return typeof a == "string" ? (a = unescape(a), a = _(i(b(a, n), !0), { ...n, skipEscape: !0 })) : typeof a == "object" && (a = _(i(a, !0), { ...n, skipEscape: !0 })), typeof u == "string" ? (u = unescape(u), u = _(i(b(u, n), !0), { ...n, skipEscape: !0 })) : typeof u == "object" && (u = _(i(u, !0), { ...n, skipEscape: !0 })), a.toLowerCase() === u.toLowerCase();
|
|
2615
2615
|
}
|
|
2616
2616
|
function _(a, u) {
|
|
2617
|
-
const
|
|
2617
|
+
const n = {
|
|
2618
2618
|
host: a.host,
|
|
2619
2619
|
scheme: a.scheme,
|
|
2620
2620
|
userinfo: a.userinfo,
|
|
@@ -2629,18 +2629,18 @@ function Ss() {
|
|
|
2629
2629
|
resourceName: a.resourceName,
|
|
2630
2630
|
secure: a.secure,
|
|
2631
2631
|
error: ""
|
|
2632
|
-
}, c = Object.assign({}, u), g = [], o = d(c.scheme ||
|
|
2633
|
-
o && o.serialize && o.serialize(
|
|
2634
|
-
const m = n
|
|
2635
|
-
if (m !== void 0 && (c.reference !== "suffix" && g.push("//"), g.push(m),
|
|
2636
|
-
let P =
|
|
2632
|
+
}, c = Object.assign({}, u), g = [], o = d(c.scheme || n.scheme);
|
|
2633
|
+
o && o.serialize && o.serialize(n, c), n.path !== void 0 && (c.skipEscape ? n.path = unescape(n.path) : (n.path = escape(n.path), n.scheme !== void 0 && (n.path = n.path.split("%3A").join(":")))), c.reference !== "suffix" && n.scheme && g.push(n.scheme, ":");
|
|
2634
|
+
const m = r(n);
|
|
2635
|
+
if (m !== void 0 && (c.reference !== "suffix" && g.push("//"), g.push(m), n.path && n.path[0] !== "/" && g.push("/")), n.path !== void 0) {
|
|
2636
|
+
let P = n.path;
|
|
2637
2637
|
!c.absolutePath && (!o || !o.absolutePath) && (P = t(P)), m === void 0 && P[0] === "/" && P[1] === "/" && (P = "/%2F" + P.slice(2)), g.push(P);
|
|
2638
2638
|
}
|
|
2639
|
-
return
|
|
2639
|
+
return n.query !== void 0 && g.push("?", n.query), n.fragment !== void 0 && g.push("#", n.fragment), g.join("");
|
|
2640
2640
|
}
|
|
2641
2641
|
const v = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
2642
2642
|
function b(a, u) {
|
|
2643
|
-
const
|
|
2643
|
+
const n = Object.assign({}, u), c = {
|
|
2644
2644
|
scheme: void 0,
|
|
2645
2645
|
userinfo: void 0,
|
|
2646
2646
|
host: "",
|
|
@@ -2650,7 +2650,7 @@ function Ss() {
|
|
|
2650
2650
|
fragment: void 0
|
|
2651
2651
|
};
|
|
2652
2652
|
let g = !1;
|
|
2653
|
-
|
|
2653
|
+
n.reference === "suffix" && (n.scheme ? a = n.scheme + ":" + a : a = "//" + a);
|
|
2654
2654
|
const o = a.match(v);
|
|
2655
2655
|
if (o) {
|
|
2656
2656
|
if (c.scheme = o[1], c.userinfo = o[3], c.host = o[4], c.port = parseInt(o[5], 10), c.path = o[6] || "", c.query = o[7], c.fragment = o[8], isNaN(c.port) && (c.port = o[5]), c.host)
|
|
@@ -2659,15 +2659,15 @@ function Ss() {
|
|
|
2659
2659
|
c.host = O.host.toLowerCase(), g = O.isIPV6;
|
|
2660
2660
|
} else
|
|
2661
2661
|
g = !0;
|
|
2662
|
-
c.scheme === void 0 && c.userinfo === void 0 && c.host === void 0 && c.port === void 0 && c.query === void 0 && !c.path ? c.reference = "same-document" : c.scheme === void 0 ? c.reference = "relative" : c.fragment === void 0 ? c.reference = "absolute" : c.reference = "uri",
|
|
2663
|
-
const m = d(
|
|
2664
|
-
if (!
|
|
2662
|
+
c.scheme === void 0 && c.userinfo === void 0 && c.host === void 0 && c.port === void 0 && c.query === void 0 && !c.path ? c.reference = "same-document" : c.scheme === void 0 ? c.reference = "relative" : c.fragment === void 0 ? c.reference = "absolute" : c.reference = "uri", n.reference && n.reference !== "suffix" && n.reference !== c.reference && (c.error = c.error || "URI is not a " + n.reference + " reference.");
|
|
2663
|
+
const m = d(n.scheme || c.scheme);
|
|
2664
|
+
if (!n.unicodeSupport && (!m || !m.unicodeSupport) && c.host && (n.domainHost || m && m.domainHost) && g === !1 && s(c.host))
|
|
2665
2665
|
try {
|
|
2666
2666
|
c.host = URL.domainToASCII(c.host.toLowerCase());
|
|
2667
2667
|
} catch (P) {
|
|
2668
2668
|
c.error = c.error || "Host's domain name can not be converted to ASCII: " + P;
|
|
2669
2669
|
}
|
|
2670
|
-
(!m || m && !m.skipNormalize) && (a.indexOf("%") !== -1 && (c.scheme !== void 0 && (c.scheme = unescape(c.scheme)), c.host !== void 0 && (c.host = unescape(c.host))), c.path && (c.path = escape(unescape(c.path))), c.fragment && (c.fragment = encodeURI(decodeURIComponent(c.fragment)))), m && m.parse && m.parse(c,
|
|
2670
|
+
(!m || m && !m.skipNormalize) && (a.indexOf("%") !== -1 && (c.scheme !== void 0 && (c.scheme = unescape(c.scheme)), c.host !== void 0 && (c.host = unescape(c.host))), c.path && (c.path = escape(unescape(c.path))), c.fragment && (c.fragment = encodeURI(decodeURIComponent(c.fragment)))), m && m.parse && m.parse(c, n);
|
|
2671
2671
|
} else
|
|
2672
2672
|
c.error = c.error || "URI can not be parsed.";
|
|
2673
2673
|
return c;
|
|
@@ -2698,21 +2698,21 @@ function ks() {
|
|
|
2698
2698
|
Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
|
|
2699
2699
|
return t.KeywordCxt;
|
|
2700
2700
|
} });
|
|
2701
|
-
var
|
|
2701
|
+
var r = G();
|
|
2702
2702
|
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
2703
|
-
return
|
|
2703
|
+
return r._;
|
|
2704
2704
|
} }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
|
|
2705
|
-
return
|
|
2705
|
+
return r.str;
|
|
2706
2706
|
} }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
|
|
2707
|
-
return
|
|
2707
|
+
return r.stringify;
|
|
2708
2708
|
} }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
|
|
2709
|
-
return
|
|
2709
|
+
return r.nil;
|
|
2710
2710
|
} }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
|
|
2711
|
-
return
|
|
2711
|
+
return r.Name;
|
|
2712
2712
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
2713
|
-
return
|
|
2713
|
+
return r.CodeGen;
|
|
2714
2714
|
} });
|
|
2715
|
-
const i = er(), y = At(), s =
|
|
2715
|
+
const i = er(), y = At(), s = Rn(), l = tr(), d = G(), f = Tt(), w = kt(), $ = Y(), E = ws, _ = Es(), v = (M, j) => new RegExp(M, j);
|
|
2716
2716
|
v.code = "new RegExp";
|
|
2717
2717
|
const b = ["removeAdditional", "useDefaults", "coerceTypes"], h = /* @__PURE__ */ new Set([
|
|
2718
2718
|
"validate",
|
|
@@ -2748,26 +2748,26 @@ function ks() {
|
|
|
2748
2748
|
ignoreKeywordsWithRef: "",
|
|
2749
2749
|
jsPropertySyntax: "",
|
|
2750
2750
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
2751
|
-
},
|
|
2751
|
+
}, n = 200;
|
|
2752
2752
|
function c(M) {
|
|
2753
|
-
var j, D,
|
|
2754
|
-
const Ce = M.strict, Ft = (j = M.code) === null || j === void 0 ? void 0 : j.optimize, or = Ft === !0 || Ft === void 0 ? 1 : Ft || 0, ar = (
|
|
2753
|
+
var j, D, I, p, S, N, U, J, Q, B, k, R, q, A, K, W, re, me, ce, de, ne, Re, fe, Vt, zt;
|
|
2754
|
+
const Ce = M.strict, Ft = (j = M.code) === null || j === void 0 ? void 0 : j.optimize, or = Ft === !0 || Ft === void 0 ? 1 : Ft || 0, ar = (I = (D = M.code) === null || D === void 0 ? void 0 : D.regExp) !== null && I !== void 0 ? I : v, us = (p = M.uriResolver) !== null && p !== void 0 ? p : _.default;
|
|
2755
2755
|
return {
|
|
2756
2756
|
strictSchema: (N = (S = M.strictSchema) !== null && S !== void 0 ? S : Ce) !== null && N !== void 0 ? N : !0,
|
|
2757
2757
|
strictNumbers: (J = (U = M.strictNumbers) !== null && U !== void 0 ? U : Ce) !== null && J !== void 0 ? J : !0,
|
|
2758
|
-
strictTypes: (B = (
|
|
2759
|
-
strictTuples: (
|
|
2758
|
+
strictTypes: (B = (Q = M.strictTypes) !== null && Q !== void 0 ? Q : Ce) !== null && B !== void 0 ? B : "log",
|
|
2759
|
+
strictTuples: (R = (k = M.strictTuples) !== null && k !== void 0 ? k : Ce) !== null && R !== void 0 ? R : "log",
|
|
2760
2760
|
strictRequired: (A = (q = M.strictRequired) !== null && q !== void 0 ? q : Ce) !== null && A !== void 0 ? A : !1,
|
|
2761
2761
|
code: M.code ? { ...M.code, optimize: or, regExp: ar } : { optimize: or, regExp: ar },
|
|
2762
|
-
loopRequired: (K = M.loopRequired) !== null && K !== void 0 ? K :
|
|
2763
|
-
loopEnum: (W = M.loopEnum) !== null && W !== void 0 ? W :
|
|
2762
|
+
loopRequired: (K = M.loopRequired) !== null && K !== void 0 ? K : n,
|
|
2763
|
+
loopEnum: (W = M.loopEnum) !== null && W !== void 0 ? W : n,
|
|
2764
2764
|
meta: (re = M.meta) !== null && re !== void 0 ? re : !0,
|
|
2765
2765
|
messages: (me = M.messages) !== null && me !== void 0 ? me : !0,
|
|
2766
2766
|
inlineRefs: (ce = M.inlineRefs) !== null && ce !== void 0 ? ce : !0,
|
|
2767
2767
|
schemaId: (de = M.schemaId) !== null && de !== void 0 ? de : "$id",
|
|
2768
2768
|
addUsedSchema: (ne = M.addUsedSchema) !== null && ne !== void 0 ? ne : !0,
|
|
2769
|
-
validateSchema: (
|
|
2770
|
-
validateFormats: (
|
|
2769
|
+
validateSchema: (Re = M.validateSchema) !== null && Re !== void 0 ? Re : !0,
|
|
2770
|
+
validateFormats: (fe = M.validateFormats) !== null && fe !== void 0 ? fe : !0,
|
|
2771
2771
|
unicodeRegExp: (Vt = M.unicodeRegExp) !== null && Vt !== void 0 ? Vt : !0,
|
|
2772
2772
|
int32range: (zt = M.int32range) !== null && zt !== void 0 ? zt : !0,
|
|
2773
2773
|
uriResolver: us
|
|
@@ -2776,8 +2776,8 @@ function ks() {
|
|
|
2776
2776
|
class g {
|
|
2777
2777
|
constructor(j = {}) {
|
|
2778
2778
|
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), j = this.opts = { ...j, ...c(j) };
|
|
2779
|
-
const { es5: D, lines:
|
|
2780
|
-
this.scope = new d.ValueScope({ scope: {}, prefixes: h, es5: D, lines:
|
|
2779
|
+
const { es5: D, lines: I } = this.opts.code;
|
|
2780
|
+
this.scope = new d.ValueScope({ scope: {}, prefixes: h, es5: D, lines: I }), this.logger = V(j.logger);
|
|
2781
2781
|
const p = j.validateFormats;
|
|
2782
2782
|
j.validateFormats = !1, this.RULES = (0, s.getRules)(), o.call(this, a, j, "NOT SUPPORTED"), o.call(this, u, j, "DEPRECATED", "warn"), this._metaOpts = z.call(this), j.formats && O.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), j.keywords && T.call(this, j.keywords), typeof j.meta == "object" && this.addMetaSchema(j.meta), P.call(this), j.validateFormats = p;
|
|
2783
2783
|
}
|
|
@@ -2785,37 +2785,37 @@ function ks() {
|
|
|
2785
2785
|
this.addKeyword("$async");
|
|
2786
2786
|
}
|
|
2787
2787
|
_addDefaultMetaSchema() {
|
|
2788
|
-
const { $data: j, meta: D, schemaId:
|
|
2788
|
+
const { $data: j, meta: D, schemaId: I } = this.opts;
|
|
2789
2789
|
let p = E;
|
|
2790
|
-
|
|
2790
|
+
I === "id" && (p = { ...E }, p.id = p.$id, delete p.$id), D && j && this.addMetaSchema(p, p[I], !1);
|
|
2791
2791
|
}
|
|
2792
2792
|
defaultMeta() {
|
|
2793
2793
|
const { meta: j, schemaId: D } = this.opts;
|
|
2794
2794
|
return this.opts.defaultMeta = typeof j == "object" ? j[D] || j : void 0;
|
|
2795
2795
|
}
|
|
2796
2796
|
validate(j, D) {
|
|
2797
|
-
let
|
|
2797
|
+
let I;
|
|
2798
2798
|
if (typeof j == "string") {
|
|
2799
|
-
if (
|
|
2799
|
+
if (I = this.getSchema(j), !I)
|
|
2800
2800
|
throw new Error(`no schema with key or ref "${j}"`);
|
|
2801
2801
|
} else
|
|
2802
|
-
|
|
2803
|
-
const p =
|
|
2804
|
-
return "$async" in
|
|
2802
|
+
I = this.compile(j);
|
|
2803
|
+
const p = I(D);
|
|
2804
|
+
return "$async" in I || (this.errors = I.errors), p;
|
|
2805
2805
|
}
|
|
2806
2806
|
compile(j, D) {
|
|
2807
|
-
const
|
|
2808
|
-
return
|
|
2807
|
+
const I = this._addSchema(j, D);
|
|
2808
|
+
return I.validate || this._compileSchemaEnv(I);
|
|
2809
2809
|
}
|
|
2810
2810
|
compileAsync(j, D) {
|
|
2811
2811
|
if (typeof this.opts.loadSchema != "function")
|
|
2812
2812
|
throw new Error("options.loadSchema should be a function");
|
|
2813
|
-
const { loadSchema:
|
|
2813
|
+
const { loadSchema: I } = this.opts;
|
|
2814
2814
|
return p.call(this, j, D);
|
|
2815
2815
|
async function p(B, k) {
|
|
2816
2816
|
await S.call(this, B.$schema);
|
|
2817
|
-
const
|
|
2818
|
-
return
|
|
2817
|
+
const R = this._addSchema(B, k);
|
|
2818
|
+
return R.validate || N.call(this, R);
|
|
2819
2819
|
}
|
|
2820
2820
|
async function S(B) {
|
|
2821
2821
|
B && !this.getSchema(B) && await p.call(this, { $ref: B }, !0);
|
|
@@ -2834,25 +2834,25 @@ function ks() {
|
|
|
2834
2834
|
throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`);
|
|
2835
2835
|
}
|
|
2836
2836
|
async function J(B) {
|
|
2837
|
-
const k = await
|
|
2837
|
+
const k = await Q.call(this, B);
|
|
2838
2838
|
this.refs[B] || await S.call(this, k.$schema), this.refs[B] || this.addSchema(k, B, D);
|
|
2839
2839
|
}
|
|
2840
|
-
async function
|
|
2840
|
+
async function Q(B) {
|
|
2841
2841
|
const k = this._loading[B];
|
|
2842
2842
|
if (k)
|
|
2843
2843
|
return k;
|
|
2844
2844
|
try {
|
|
2845
|
-
return await (this._loading[B] =
|
|
2845
|
+
return await (this._loading[B] = I(B));
|
|
2846
2846
|
} finally {
|
|
2847
2847
|
delete this._loading[B];
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
2850
|
}
|
|
2851
2851
|
// Adds schema to the instance
|
|
2852
|
-
addSchema(j, D,
|
|
2852
|
+
addSchema(j, D, I, p = this.opts.validateSchema) {
|
|
2853
2853
|
if (Array.isArray(j)) {
|
|
2854
2854
|
for (const N of j)
|
|
2855
|
-
this.addSchema(N, void 0,
|
|
2855
|
+
this.addSchema(N, void 0, I, p);
|
|
2856
2856
|
return this;
|
|
2857
2857
|
}
|
|
2858
2858
|
let S;
|
|
@@ -2861,23 +2861,23 @@ function ks() {
|
|
|
2861
2861
|
if (S = j[N], S !== void 0 && typeof S != "string")
|
|
2862
2862
|
throw new Error(`schema ${N} must be string`);
|
|
2863
2863
|
}
|
|
2864
|
-
return D = (0, f.normalizeId)(D || S), this._checkUnique(D), this.schemas[D] = this._addSchema(j,
|
|
2864
|
+
return D = (0, f.normalizeId)(D || S), this._checkUnique(D), this.schemas[D] = this._addSchema(j, I, D, p, !0), this;
|
|
2865
2865
|
}
|
|
2866
2866
|
// Add schema that will be used to validate other schemas
|
|
2867
2867
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
2868
|
-
addMetaSchema(j, D,
|
|
2869
|
-
return this.addSchema(j, D, !0,
|
|
2868
|
+
addMetaSchema(j, D, I = this.opts.validateSchema) {
|
|
2869
|
+
return this.addSchema(j, D, !0, I), this;
|
|
2870
2870
|
}
|
|
2871
2871
|
// Validate schema against its meta-schema
|
|
2872
2872
|
validateSchema(j, D) {
|
|
2873
2873
|
if (typeof j == "boolean")
|
|
2874
2874
|
return !0;
|
|
2875
|
-
let
|
|
2876
|
-
if (
|
|
2875
|
+
let I;
|
|
2876
|
+
if (I = j.$schema, I !== void 0 && typeof I != "string")
|
|
2877
2877
|
throw new Error("$schema must be a string");
|
|
2878
|
-
if (
|
|
2878
|
+
if (I = I || this.opts.defaultMeta || this.defaultMeta(), !I)
|
|
2879
2879
|
return this.logger.warn("meta-schema not available"), this.errors = null, !0;
|
|
2880
|
-
const p = this.validate(
|
|
2880
|
+
const p = this.validate(I, j);
|
|
2881
2881
|
if (!p && D) {
|
|
2882
2882
|
const S = "schema is invalid: " + this.errorsText();
|
|
2883
2883
|
if (this.opts.validateSchema === "log")
|
|
@@ -2894,7 +2894,7 @@ function ks() {
|
|
|
2894
2894
|
for (; typeof (D = m.call(this, j)) == "string"; )
|
|
2895
2895
|
j = D;
|
|
2896
2896
|
if (D === void 0) {
|
|
2897
|
-
const { schemaId:
|
|
2897
|
+
const { schemaId: I } = this.opts, p = new l.SchemaEnv({ schema: {}, schemaId: I });
|
|
2898
2898
|
if (D = l.resolveSchema.call(this, p, j), !D)
|
|
2899
2899
|
return;
|
|
2900
2900
|
this.refs[j] = D;
|
|
@@ -2918,8 +2918,8 @@ function ks() {
|
|
|
2918
2918
|
case "object": {
|
|
2919
2919
|
const D = j;
|
|
2920
2920
|
this._cache.delete(D);
|
|
2921
|
-
let
|
|
2922
|
-
return
|
|
2921
|
+
let I = j[this.opts.schemaId];
|
|
2922
|
+
return I && (I = (0, f.normalizeId)(I), delete this.schemas[I], delete this.refs[I]), this;
|
|
2923
2923
|
}
|
|
2924
2924
|
default:
|
|
2925
2925
|
throw new Error("ajv.removeSchema: invalid parameter");
|
|
@@ -2932,23 +2932,23 @@ function ks() {
|
|
|
2932
2932
|
return this;
|
|
2933
2933
|
}
|
|
2934
2934
|
addKeyword(j, D) {
|
|
2935
|
-
let
|
|
2935
|
+
let I;
|
|
2936
2936
|
if (typeof j == "string")
|
|
2937
|
-
|
|
2937
|
+
I = j, typeof D == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), D.keyword = I);
|
|
2938
2938
|
else if (typeof j == "object" && D === void 0) {
|
|
2939
|
-
if (D = j,
|
|
2939
|
+
if (D = j, I = D.keyword, Array.isArray(I) && !I.length)
|
|
2940
2940
|
throw new Error("addKeywords: keyword must be string or non-empty array");
|
|
2941
2941
|
} else
|
|
2942
2942
|
throw new Error("invalid addKeywords parameters");
|
|
2943
|
-
if (L.call(this,
|
|
2944
|
-
return (0, $.eachItem)(
|
|
2943
|
+
if (L.call(this, I, D), !D)
|
|
2944
|
+
return (0, $.eachItem)(I, (S) => x.call(this, S)), this;
|
|
2945
2945
|
oe.call(this, D);
|
|
2946
2946
|
const p = {
|
|
2947
2947
|
...D,
|
|
2948
2948
|
type: (0, w.getJSONTypes)(D.type),
|
|
2949
2949
|
schemaType: (0, w.getJSONTypes)(D.schemaType)
|
|
2950
2950
|
};
|
|
2951
|
-
return (0, $.eachItem)(
|
|
2951
|
+
return (0, $.eachItem)(I, p.type.length === 0 ? (S) => x.call(this, S, p) : (S) => p.type.forEach((N) => x.call(this, S, p, N))), this;
|
|
2952
2952
|
}
|
|
2953
2953
|
getKeyword(j) {
|
|
2954
2954
|
const D = this.RULES.all[j];
|
|
@@ -2958,9 +2958,9 @@ function ks() {
|
|
|
2958
2958
|
removeKeyword(j) {
|
|
2959
2959
|
const { RULES: D } = this;
|
|
2960
2960
|
delete D.keywords[j], delete D.all[j];
|
|
2961
|
-
for (const
|
|
2962
|
-
const p =
|
|
2963
|
-
p >= 0 &&
|
|
2961
|
+
for (const I of D.rules) {
|
|
2962
|
+
const p = I.rules.findIndex((S) => S.keyword === j);
|
|
2963
|
+
p >= 0 && I.rules.splice(p, 1);
|
|
2964
2964
|
}
|
|
2965
2965
|
return this;
|
|
2966
2966
|
}
|
|
@@ -2968,34 +2968,34 @@ function ks() {
|
|
|
2968
2968
|
addFormat(j, D) {
|
|
2969
2969
|
return typeof D == "string" && (D = new RegExp(D)), this.formats[j] = D, this;
|
|
2970
2970
|
}
|
|
2971
|
-
errorsText(j = this.errors, { separator: D = ", ", dataVar:
|
|
2972
|
-
return !j || j.length === 0 ? "No errors" : j.map((p) => `${
|
|
2971
|
+
errorsText(j = this.errors, { separator: D = ", ", dataVar: I = "data" } = {}) {
|
|
2972
|
+
return !j || j.length === 0 ? "No errors" : j.map((p) => `${I}${p.instancePath} ${p.message}`).reduce((p, S) => p + D + S);
|
|
2973
2973
|
}
|
|
2974
2974
|
$dataMetaSchema(j, D) {
|
|
2975
|
-
const
|
|
2975
|
+
const I = this.RULES.all;
|
|
2976
2976
|
j = JSON.parse(JSON.stringify(j));
|
|
2977
2977
|
for (const p of D) {
|
|
2978
2978
|
const S = p.split("/").slice(1);
|
|
2979
2979
|
let N = j;
|
|
2980
2980
|
for (const U of S)
|
|
2981
2981
|
N = N[U];
|
|
2982
|
-
for (const U in
|
|
2983
|
-
const J =
|
|
2982
|
+
for (const U in I) {
|
|
2983
|
+
const J = I[U];
|
|
2984
2984
|
if (typeof J != "object")
|
|
2985
2985
|
continue;
|
|
2986
|
-
const { $data:
|
|
2987
|
-
|
|
2986
|
+
const { $data: Q } = J.definition, B = N[U];
|
|
2987
|
+
Q && B && (N[U] = pe(B));
|
|
2988
2988
|
}
|
|
2989
2989
|
}
|
|
2990
2990
|
return j;
|
|
2991
2991
|
}
|
|
2992
2992
|
_removeAllSchemas(j, D) {
|
|
2993
|
-
for (const
|
|
2994
|
-
const p = j[
|
|
2995
|
-
(!D || D.test(
|
|
2993
|
+
for (const I in j) {
|
|
2994
|
+
const p = j[I];
|
|
2995
|
+
(!D || D.test(I)) && (typeof p == "string" ? delete j[I] : p && !p.meta && (this._cache.delete(p.schema), delete j[I]));
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
|
-
_addSchema(j, D,
|
|
2998
|
+
_addSchema(j, D, I, p = this.opts.validateSchema, S = this.opts.addUsedSchema) {
|
|
2999
2999
|
let N;
|
|
3000
3000
|
const { schemaId: U } = this.opts;
|
|
3001
3001
|
if (typeof j == "object")
|
|
@@ -3009,9 +3009,9 @@ function ks() {
|
|
|
3009
3009
|
let J = this._cache.get(j);
|
|
3010
3010
|
if (J !== void 0)
|
|
3011
3011
|
return J;
|
|
3012
|
-
|
|
3013
|
-
const
|
|
3014
|
-
return J = new l.SchemaEnv({ schema: j, schemaId: U, meta: D, baseId:
|
|
3012
|
+
I = (0, f.normalizeId)(N || I);
|
|
3013
|
+
const Q = f.getSchemaRefs.call(this, j, I);
|
|
3014
|
+
return J = new l.SchemaEnv({ schema: j, schemaId: U, meta: D, baseId: I, localRefs: Q }), this._cache.set(J.schema, J), S && !I.startsWith("#") && (I && this._checkUnique(I), this.refs[I] = J), p && this.validateSchema(j, !0), J;
|
|
3015
3015
|
}
|
|
3016
3016
|
_checkUnique(j) {
|
|
3017
3017
|
if (this.schemas[j] || this.refs[j])
|
|
@@ -3033,10 +3033,10 @@ function ks() {
|
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
3035
3035
|
g.ValidationError = i.default, g.MissingRefError = y.default, e.default = g;
|
|
3036
|
-
function o(M, j, D,
|
|
3036
|
+
function o(M, j, D, I = "error") {
|
|
3037
3037
|
for (const p in M) {
|
|
3038
3038
|
const S = p;
|
|
3039
|
-
S in j && this.logger[
|
|
3039
|
+
S in j && this.logger[I](`${D}: option ${p}. ${M[S]}`);
|
|
3040
3040
|
}
|
|
3041
3041
|
}
|
|
3042
3042
|
function m(M) {
|
|
@@ -3090,16 +3090,16 @@ function ks() {
|
|
|
3090
3090
|
const F = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
3091
3091
|
function L(M, j) {
|
|
3092
3092
|
const { RULES: D } = this;
|
|
3093
|
-
if ((0, $.eachItem)(M, (
|
|
3094
|
-
if (D.keywords[
|
|
3095
|
-
throw new Error(`Keyword ${
|
|
3096
|
-
if (!F.test(
|
|
3097
|
-
throw new Error(`Keyword ${
|
|
3093
|
+
if ((0, $.eachItem)(M, (I) => {
|
|
3094
|
+
if (D.keywords[I])
|
|
3095
|
+
throw new Error(`Keyword ${I} is already defined`);
|
|
3096
|
+
if (!F.test(I))
|
|
3097
|
+
throw new Error(`Keyword ${I} has invalid name`);
|
|
3098
3098
|
}), !!j && j.$data && !("code" in j || "validate" in j))
|
|
3099
3099
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
3100
3100
|
}
|
|
3101
|
-
function
|
|
3102
|
-
var
|
|
3101
|
+
function x(M, j, D) {
|
|
3102
|
+
var I;
|
|
3103
3103
|
const p = j?.post;
|
|
3104
3104
|
if (D && p)
|
|
3105
3105
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
@@ -3115,11 +3115,11 @@ function ks() {
|
|
|
3115
3115
|
schemaType: (0, w.getJSONTypes)(j.schemaType)
|
|
3116
3116
|
}
|
|
3117
3117
|
};
|
|
3118
|
-
j.before ? ie.call(this, N, U, j.before) : N.rules.push(U), S.all[M] = U, (
|
|
3118
|
+
j.before ? ie.call(this, N, U, j.before) : N.rules.push(U), S.all[M] = U, (I = j.implements) === null || I === void 0 || I.forEach((J) => this.addKeyword(J));
|
|
3119
3119
|
}
|
|
3120
3120
|
function ie(M, j, D) {
|
|
3121
|
-
const
|
|
3122
|
-
|
|
3121
|
+
const I = M.rules.findIndex((p) => p.keyword === D);
|
|
3122
|
+
I >= 0 ? M.rules.splice(I, 0, j) : (M.rules.push(j), this.logger.warn(`rule ${D} is not defined`));
|
|
3123
3123
|
}
|
|
3124
3124
|
function oe(M) {
|
|
3125
3125
|
let { metaSchema: j } = M;
|
|
@@ -3146,37 +3146,37 @@ function js() {
|
|
|
3146
3146
|
return Ge.default = e, Ge;
|
|
3147
3147
|
}
|
|
3148
3148
|
var be = {}, Mr;
|
|
3149
|
-
function
|
|
3149
|
+
function Rs() {
|
|
3150
3150
|
if (Mr) return be;
|
|
3151
3151
|
Mr = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.callRef = be.getValidate = void 0;
|
|
3152
|
-
const e = At(), t = ge(),
|
|
3152
|
+
const e = At(), t = ge(), r = G(), i = Se(), y = tr(), s = Y(), l = {
|
|
3153
3153
|
keyword: "$ref",
|
|
3154
3154
|
schemaType: "string",
|
|
3155
3155
|
code(w) {
|
|
3156
|
-
const { gen: $, schema: E, it: _ } = w, { baseId: v, schemaEnv: b, validateName: h, opts: a, self: u } = _, { root:
|
|
3157
|
-
if ((E === "#" || E === "#/") && v ===
|
|
3156
|
+
const { gen: $, schema: E, it: _ } = w, { baseId: v, schemaEnv: b, validateName: h, opts: a, self: u } = _, { root: n } = b;
|
|
3157
|
+
if ((E === "#" || E === "#/") && v === n.baseId)
|
|
3158
3158
|
return g();
|
|
3159
|
-
const c = y.resolveRef.call(u,
|
|
3159
|
+
const c = y.resolveRef.call(u, n, v, E);
|
|
3160
3160
|
if (c === void 0)
|
|
3161
3161
|
throw new e.default(_.opts.uriResolver, v, E);
|
|
3162
3162
|
if (c instanceof y.SchemaEnv)
|
|
3163
3163
|
return o(c);
|
|
3164
3164
|
return m(c);
|
|
3165
3165
|
function g() {
|
|
3166
|
-
if (b ===
|
|
3166
|
+
if (b === n)
|
|
3167
3167
|
return f(w, h, b, b.$async);
|
|
3168
|
-
const P = $.scopeValue("root", { ref:
|
|
3169
|
-
return f(w, (0,
|
|
3168
|
+
const P = $.scopeValue("root", { ref: n });
|
|
3169
|
+
return f(w, (0, r._)`${P}.validate`, n, n.$async);
|
|
3170
3170
|
}
|
|
3171
3171
|
function o(P) {
|
|
3172
3172
|
const O = d(w, P);
|
|
3173
3173
|
f(w, O, P, P.$async);
|
|
3174
3174
|
}
|
|
3175
3175
|
function m(P) {
|
|
3176
|
-
const O = $.scopeValue("schema", a.code.source === !0 ? { ref: P, code: (0,
|
|
3176
|
+
const O = $.scopeValue("schema", a.code.source === !0 ? { ref: P, code: (0, r.stringify)(P) } : { ref: P }), T = $.name("valid"), z = w.subschema({
|
|
3177
3177
|
schema: P,
|
|
3178
3178
|
dataTypes: [],
|
|
3179
|
-
schemaPath:
|
|
3179
|
+
schemaPath: r.nil,
|
|
3180
3180
|
topSchemaRef: O,
|
|
3181
3181
|
errSchemaPath: E
|
|
3182
3182
|
}, T);
|
|
@@ -3186,28 +3186,28 @@ function Is() {
|
|
|
3186
3186
|
};
|
|
3187
3187
|
function d(w, $) {
|
|
3188
3188
|
const { gen: E } = w;
|
|
3189
|
-
return $.validate ? E.scopeValue("validate", { ref: $.validate }) : (0,
|
|
3189
|
+
return $.validate ? E.scopeValue("validate", { ref: $.validate }) : (0, r._)`${E.scopeValue("wrapper", { ref: $ })}.validate`;
|
|
3190
3190
|
}
|
|
3191
3191
|
be.getValidate = d;
|
|
3192
3192
|
function f(w, $, E, _) {
|
|
3193
|
-
const { gen: v, it: b } = w, { allErrors: h, schemaEnv: a, opts: u } = b,
|
|
3193
|
+
const { gen: v, it: b } = w, { allErrors: h, schemaEnv: a, opts: u } = b, n = u.passContext ? i.default.this : r.nil;
|
|
3194
3194
|
_ ? c() : g();
|
|
3195
3195
|
function c() {
|
|
3196
3196
|
if (!a.$async)
|
|
3197
3197
|
throw new Error("async schema referenced by sync schema");
|
|
3198
3198
|
const P = v.let("valid");
|
|
3199
3199
|
v.try(() => {
|
|
3200
|
-
v.code((0,
|
|
3200
|
+
v.code((0, r._)`await ${(0, t.callValidateCode)(w, $, n)}`), m($), h || v.assign(P, !0);
|
|
3201
3201
|
}, (O) => {
|
|
3202
|
-
v.if((0,
|
|
3202
|
+
v.if((0, r._)`!(${O} instanceof ${b.ValidationError})`, () => v.throw(O)), o(O), h || v.assign(P, !1);
|
|
3203
3203
|
}), w.ok(P);
|
|
3204
3204
|
}
|
|
3205
3205
|
function g() {
|
|
3206
|
-
w.result((0, t.callValidateCode)(w, $,
|
|
3206
|
+
w.result((0, t.callValidateCode)(w, $, n), () => m($), () => o($));
|
|
3207
3207
|
}
|
|
3208
3208
|
function o(P) {
|
|
3209
|
-
const O = (0,
|
|
3210
|
-
v.assign(i.default.vErrors, (0,
|
|
3209
|
+
const O = (0, r._)`${P}.errors`;
|
|
3210
|
+
v.assign(i.default.vErrors, (0, r._)`${i.default.vErrors} === null ? ${O} : ${i.default.vErrors}.concat(${O})`), v.assign(i.default.errors, (0, r._)`${i.default.vErrors}.length`);
|
|
3211
3211
|
}
|
|
3212
3212
|
function m(P) {
|
|
3213
3213
|
var O;
|
|
@@ -3218,25 +3218,25 @@ function Is() {
|
|
|
3218
3218
|
if (T && !T.dynamicProps)
|
|
3219
3219
|
T.props !== void 0 && (b.props = s.mergeEvaluated.props(v, T.props, b.props));
|
|
3220
3220
|
else {
|
|
3221
|
-
const z = v.var("props", (0,
|
|
3222
|
-
b.props = s.mergeEvaluated.props(v, z, b.props,
|
|
3221
|
+
const z = v.var("props", (0, r._)`${P}.evaluated.props`);
|
|
3222
|
+
b.props = s.mergeEvaluated.props(v, z, b.props, r.Name);
|
|
3223
3223
|
}
|
|
3224
3224
|
if (b.items !== !0)
|
|
3225
3225
|
if (T && !T.dynamicItems)
|
|
3226
3226
|
T.items !== void 0 && (b.items = s.mergeEvaluated.items(v, T.items, b.items));
|
|
3227
3227
|
else {
|
|
3228
|
-
const z = v.var("items", (0,
|
|
3229
|
-
b.items = s.mergeEvaluated.items(v, z, b.items,
|
|
3228
|
+
const z = v.var("items", (0, r._)`${P}.evaluated.items`);
|
|
3229
|
+
b.items = s.mergeEvaluated.items(v, z, b.items, r.Name);
|
|
3230
3230
|
}
|
|
3231
3231
|
}
|
|
3232
3232
|
}
|
|
3233
3233
|
return be.callRef = f, be.default = l, be;
|
|
3234
3234
|
}
|
|
3235
3235
|
var Ar;
|
|
3236
|
-
function
|
|
3236
|
+
function Is() {
|
|
3237
3237
|
if (Ar) return He;
|
|
3238
3238
|
Ar = 1, Object.defineProperty(He, "__esModule", { value: !0 });
|
|
3239
|
-
const e = js(), t =
|
|
3239
|
+
const e = js(), t = Rs(), r = [
|
|
3240
3240
|
"$schema",
|
|
3241
3241
|
"$id",
|
|
3242
3242
|
"$defs",
|
|
@@ -3246,29 +3246,29 @@ function Rs() {
|
|
|
3246
3246
|
e.default,
|
|
3247
3247
|
t.default
|
|
3248
3248
|
];
|
|
3249
|
-
return He.default =
|
|
3249
|
+
return He.default = r, He;
|
|
3250
3250
|
}
|
|
3251
3251
|
var We = {}, Be = {}, Vr;
|
|
3252
3252
|
function Os() {
|
|
3253
3253
|
if (Vr) return Be;
|
|
3254
3254
|
Vr = 1, Object.defineProperty(Be, "__esModule", { value: !0 });
|
|
3255
|
-
const e = G(), t = e.operators,
|
|
3255
|
+
const e = G(), t = e.operators, r = {
|
|
3256
3256
|
maximum: { okStr: "<=", ok: t.LTE, fail: t.GT },
|
|
3257
3257
|
minimum: { okStr: ">=", ok: t.GTE, fail: t.LT },
|
|
3258
3258
|
exclusiveMaximum: { okStr: "<", ok: t.LT, fail: t.GTE },
|
|
3259
3259
|
exclusiveMinimum: { okStr: ">", ok: t.GT, fail: t.LTE }
|
|
3260
3260
|
}, i = {
|
|
3261
|
-
message: ({ keyword: s, schemaCode: l }) => (0, e.str)`must be ${
|
|
3262
|
-
params: ({ keyword: s, schemaCode: l }) => (0, e._)`{comparison: ${
|
|
3261
|
+
message: ({ keyword: s, schemaCode: l }) => (0, e.str)`must be ${r[s].okStr} ${l}`,
|
|
3262
|
+
params: ({ keyword: s, schemaCode: l }) => (0, e._)`{comparison: ${r[s].okStr}, limit: ${l}}`
|
|
3263
3263
|
}, y = {
|
|
3264
|
-
keyword: Object.keys(
|
|
3264
|
+
keyword: Object.keys(r),
|
|
3265
3265
|
type: "number",
|
|
3266
3266
|
schemaType: "number",
|
|
3267
3267
|
$data: !0,
|
|
3268
3268
|
error: i,
|
|
3269
3269
|
code(s) {
|
|
3270
3270
|
const { keyword: l, data: d, schemaCode: f } = s;
|
|
3271
|
-
s.fail$data((0, e._)`${d} ${
|
|
3271
|
+
s.fail$data((0, e._)`${d} ${r[l].fail} ${f} || isNaN(${d})`);
|
|
3272
3272
|
}
|
|
3273
3273
|
};
|
|
3274
3274
|
return Be.default = y, Be;
|
|
@@ -3277,7 +3277,7 @@ var Ye = {}, zr;
|
|
|
3277
3277
|
function Ns() {
|
|
3278
3278
|
if (zr) return Ye;
|
|
3279
3279
|
zr = 1, Object.defineProperty(Ye, "__esModule", { value: !0 });
|
|
3280
|
-
const e = G(),
|
|
3280
|
+
const e = G(), r = {
|
|
3281
3281
|
keyword: "multipleOf",
|
|
3282
3282
|
type: "number",
|
|
3283
3283
|
schemaType: "number",
|
|
@@ -3291,26 +3291,26 @@ function Ns() {
|
|
|
3291
3291
|
i.fail$data((0, e._)`(${l} === 0 || (${w} = ${s}/${l}, ${$}))`);
|
|
3292
3292
|
}
|
|
3293
3293
|
};
|
|
3294
|
-
return Ye.default =
|
|
3294
|
+
return Ye.default = r, Ye;
|
|
3295
3295
|
}
|
|
3296
|
-
var
|
|
3296
|
+
var Qe = {}, xe = {}, Fr;
|
|
3297
3297
|
function Cs() {
|
|
3298
|
-
if (Fr) return
|
|
3299
|
-
Fr = 1, Object.defineProperty(
|
|
3298
|
+
if (Fr) return xe;
|
|
3299
|
+
Fr = 1, Object.defineProperty(xe, "__esModule", { value: !0 });
|
|
3300
3300
|
function e(t) {
|
|
3301
|
-
const
|
|
3301
|
+
const r = t.length;
|
|
3302
3302
|
let i = 0, y = 0, s;
|
|
3303
|
-
for (; y <
|
|
3304
|
-
i++, s = t.charCodeAt(y++), s >= 55296 && s <= 56319 && y <
|
|
3303
|
+
for (; y < r; )
|
|
3304
|
+
i++, s = t.charCodeAt(y++), s >= 55296 && s <= 56319 && y < r && (s = t.charCodeAt(y), (s & 64512) === 56320 && y++);
|
|
3305
3305
|
return i;
|
|
3306
3306
|
}
|
|
3307
|
-
return
|
|
3307
|
+
return xe.default = e, e.code = 'require("ajv/dist/runtime/ucs2length").default', xe;
|
|
3308
3308
|
}
|
|
3309
3309
|
var Lr;
|
|
3310
3310
|
function qs() {
|
|
3311
|
-
if (Lr) return
|
|
3312
|
-
Lr = 1, Object.defineProperty(
|
|
3313
|
-
const e = G(), t = Y(),
|
|
3311
|
+
if (Lr) return Qe;
|
|
3312
|
+
Lr = 1, Object.defineProperty(Qe, "__esModule", { value: !0 });
|
|
3313
|
+
const e = G(), t = Y(), r = Cs(), y = {
|
|
3314
3314
|
keyword: ["maxLength", "minLength"],
|
|
3315
3315
|
type: "string",
|
|
3316
3316
|
schemaType: "number",
|
|
@@ -3323,11 +3323,11 @@ function qs() {
|
|
|
3323
3323
|
params: ({ schemaCode: s }) => (0, e._)`{limit: ${s}}`
|
|
3324
3324
|
},
|
|
3325
3325
|
code(s) {
|
|
3326
|
-
const { keyword: l, data: d, schemaCode: f, it: w } = s, $ = l === "maxLength" ? e.operators.GT : e.operators.LT, E = w.opts.unicode === !1 ? (0, e._)`${d}.length` : (0, e._)`${(0, t.useFunc)(s.gen,
|
|
3326
|
+
const { keyword: l, data: d, schemaCode: f, it: w } = s, $ = l === "maxLength" ? e.operators.GT : e.operators.LT, E = w.opts.unicode === !1 ? (0, e._)`${d}.length` : (0, e._)`${(0, t.useFunc)(s.gen, r.default)}(${d})`;
|
|
3327
3327
|
s.fail$data((0, e._)`${E} ${$} ${f}`);
|
|
3328
3328
|
}
|
|
3329
3329
|
};
|
|
3330
|
-
return
|
|
3330
|
+
return Qe.default = y, Qe;
|
|
3331
3331
|
}
|
|
3332
3332
|
var Ze = {}, Ur;
|
|
3333
3333
|
function Ds() {
|
|
@@ -3353,7 +3353,7 @@ var Xe = {}, Kr;
|
|
|
3353
3353
|
function Ts() {
|
|
3354
3354
|
if (Kr) return Xe;
|
|
3355
3355
|
Kr = 1, Object.defineProperty(Xe, "__esModule", { value: !0 });
|
|
3356
|
-
const e = G(),
|
|
3356
|
+
const e = G(), r = {
|
|
3357
3357
|
keyword: ["maxProperties", "minProperties"],
|
|
3358
3358
|
type: "object",
|
|
3359
3359
|
schemaType: "number",
|
|
@@ -3370,13 +3370,13 @@ function Ts() {
|
|
|
3370
3370
|
i.fail$data((0, e._)`Object.keys(${s}).length ${d} ${l}`);
|
|
3371
3371
|
}
|
|
3372
3372
|
};
|
|
3373
|
-
return Xe.default =
|
|
3373
|
+
return Xe.default = r, Xe;
|
|
3374
3374
|
}
|
|
3375
3375
|
var et = {}, Jr;
|
|
3376
3376
|
function Ms() {
|
|
3377
3377
|
if (Jr) return et;
|
|
3378
3378
|
Jr = 1, Object.defineProperty(et, "__esModule", { value: !0 });
|
|
3379
|
-
const e = ge(), t = G(),
|
|
3379
|
+
const e = ge(), t = G(), r = Y(), y = {
|
|
3380
3380
|
keyword: "required",
|
|
3381
3381
|
type: "object",
|
|
3382
3382
|
schemaType: "array",
|
|
@@ -3391,36 +3391,36 @@ function Ms() {
|
|
|
3391
3391
|
return;
|
|
3392
3392
|
const v = d.length >= _.loopRequired;
|
|
3393
3393
|
if (E.allErrors ? b() : h(), _.strictRequired) {
|
|
3394
|
-
const
|
|
3394
|
+
const n = s.parentSchema.properties, { definedProperties: c } = s.it;
|
|
3395
3395
|
for (const g of d)
|
|
3396
|
-
if (
|
|
3396
|
+
if (n?.[g] === void 0 && !c.has(g)) {
|
|
3397
3397
|
const o = E.schemaEnv.baseId + E.errSchemaPath, m = `required property "${g}" is not defined at "${o}" (strictRequired)`;
|
|
3398
|
-
(0,
|
|
3398
|
+
(0, r.checkStrictMode)(E, m, E.opts.strictRequired);
|
|
3399
3399
|
}
|
|
3400
3400
|
}
|
|
3401
3401
|
function b() {
|
|
3402
3402
|
if (v || $)
|
|
3403
3403
|
s.block$data(t.nil, a);
|
|
3404
3404
|
else
|
|
3405
|
-
for (const
|
|
3406
|
-
(0, e.checkReportMissingProp)(s,
|
|
3405
|
+
for (const n of d)
|
|
3406
|
+
(0, e.checkReportMissingProp)(s, n);
|
|
3407
3407
|
}
|
|
3408
3408
|
function h() {
|
|
3409
|
-
const
|
|
3409
|
+
const n = l.let("missing");
|
|
3410
3410
|
if (v || $) {
|
|
3411
3411
|
const c = l.let("valid", !0);
|
|
3412
|
-
s.block$data(c, () => u(
|
|
3412
|
+
s.block$data(c, () => u(n, c)), s.ok(c);
|
|
3413
3413
|
} else
|
|
3414
|
-
l.if((0, e.checkMissingProp)(s, d,
|
|
3414
|
+
l.if((0, e.checkMissingProp)(s, d, n)), (0, e.reportMissingProp)(s, n), l.else();
|
|
3415
3415
|
}
|
|
3416
3416
|
function a() {
|
|
3417
|
-
l.forOf("prop", f, (
|
|
3418
|
-
s.setParams({ missingProperty:
|
|
3417
|
+
l.forOf("prop", f, (n) => {
|
|
3418
|
+
s.setParams({ missingProperty: n }), l.if((0, e.noPropertyInData)(l, w, n, _.ownProperties), () => s.error());
|
|
3419
3419
|
});
|
|
3420
3420
|
}
|
|
3421
|
-
function u(
|
|
3422
|
-
s.setParams({ missingProperty:
|
|
3423
|
-
l.assign(c, (0, e.propertyInData)(l, w,
|
|
3421
|
+
function u(n, c) {
|
|
3422
|
+
s.setParams({ missingProperty: n }), l.forOf(n, f, () => {
|
|
3423
|
+
l.assign(c, (0, e.propertyInData)(l, w, n, _.ownProperties)), l.if((0, t.not)(c), () => {
|
|
3424
3424
|
s.error(), l.break();
|
|
3425
3425
|
});
|
|
3426
3426
|
}, t.nil);
|
|
@@ -3433,7 +3433,7 @@ var tt = {}, Hr;
|
|
|
3433
3433
|
function As() {
|
|
3434
3434
|
if (Hr) return tt;
|
|
3435
3435
|
Hr = 1, Object.defineProperty(tt, "__esModule", { value: !0 });
|
|
3436
|
-
const e = G(),
|
|
3436
|
+
const e = G(), r = {
|
|
3437
3437
|
keyword: ["maxItems", "minItems"],
|
|
3438
3438
|
type: "array",
|
|
3439
3439
|
schemaType: "number",
|
|
@@ -3450,7 +3450,7 @@ function As() {
|
|
|
3450
3450
|
i.fail$data((0, e._)`${s}.length ${d} ${l}`);
|
|
3451
3451
|
}
|
|
3452
3452
|
};
|
|
3453
|
-
return tt.default =
|
|
3453
|
+
return tt.default = r, tt;
|
|
3454
3454
|
}
|
|
3455
3455
|
var rt = {}, nt = {}, Gr;
|
|
3456
3456
|
function rr() {
|
|
@@ -3463,7 +3463,7 @@ var Wr;
|
|
|
3463
3463
|
function Vs() {
|
|
3464
3464
|
if (Wr) return rt;
|
|
3465
3465
|
Wr = 1, Object.defineProperty(rt, "__esModule", { value: !0 });
|
|
3466
|
-
const e = kt(), t = G(),
|
|
3466
|
+
const e = kt(), t = G(), r = Y(), i = rr(), s = {
|
|
3467
3467
|
keyword: "uniqueItems",
|
|
3468
3468
|
type: "array",
|
|
3469
3469
|
schemaType: "boolean",
|
|
@@ -3480,12 +3480,12 @@ function Vs() {
|
|
|
3480
3480
|
l.block$data(b, a, (0, t._)`${_} === false`), l.ok(b);
|
|
3481
3481
|
function a() {
|
|
3482
3482
|
const g = d.let("i", (0, t._)`${f}.length`), o = d.let("j");
|
|
3483
|
-
l.setParams({ i: g, j: o }), d.assign(b, !0), d.if((0, t._)`${g} > 1`, () => (u() ?
|
|
3483
|
+
l.setParams({ i: g, j: o }), d.assign(b, !0), d.if((0, t._)`${g} > 1`, () => (u() ? n : c)(g, o));
|
|
3484
3484
|
}
|
|
3485
3485
|
function u() {
|
|
3486
3486
|
return h.length > 0 && !h.some((g) => g === "object" || g === "array");
|
|
3487
3487
|
}
|
|
3488
|
-
function
|
|
3488
|
+
function n(g, o) {
|
|
3489
3489
|
const m = d.name("item"), P = (0, e.checkDataTypes)(h, m, v.opts.strictNumbers, e.DataType.Wrong), O = d.const("indices", (0, t._)`{}`);
|
|
3490
3490
|
d.for((0, t._)`;${g}--;`, () => {
|
|
3491
3491
|
d.let(m, (0, t._)`${f}[${g}]`), d.if(P, (0, t._)`continue`), h.length > 1 && d.if((0, t._)`typeof ${m} == "string"`, (0, t._)`${m} += "_"`), d.if((0, t._)`typeof ${O}[${m}] == "number"`, () => {
|
|
@@ -3494,7 +3494,7 @@ function Vs() {
|
|
|
3494
3494
|
});
|
|
3495
3495
|
}
|
|
3496
3496
|
function c(g, o) {
|
|
3497
|
-
const m = (0,
|
|
3497
|
+
const m = (0, r.useFunc)(d, i.default), P = d.name("outer");
|
|
3498
3498
|
d.label(P).for((0, t._)`;${g}--;`, () => d.for((0, t._)`${o} = ${g}; ${o}--;`, () => d.if((0, t._)`${m}(${f}[${g}], ${f}[${o}])`, () => {
|
|
3499
3499
|
l.error(), d.assign(b, !1).break(P);
|
|
3500
3500
|
})));
|
|
@@ -3507,7 +3507,7 @@ var st = {}, Br;
|
|
|
3507
3507
|
function zs() {
|
|
3508
3508
|
if (Br) return st;
|
|
3509
3509
|
Br = 1, Object.defineProperty(st, "__esModule", { value: !0 });
|
|
3510
|
-
const e = G(), t = Y(),
|
|
3510
|
+
const e = G(), t = Y(), r = rr(), y = {
|
|
3511
3511
|
keyword: "const",
|
|
3512
3512
|
$data: !0,
|
|
3513
3513
|
error: {
|
|
@@ -3516,7 +3516,7 @@ function zs() {
|
|
|
3516
3516
|
},
|
|
3517
3517
|
code(s) {
|
|
3518
3518
|
const { gen: l, data: d, $data: f, schemaCode: w, schema: $ } = s;
|
|
3519
|
-
f || $ && typeof $ == "object" ? s.fail$data((0, e._)`!${(0, t.useFunc)(l,
|
|
3519
|
+
f || $ && typeof $ == "object" ? s.fail$data((0, e._)`!${(0, t.useFunc)(l, r.default)}(${d}, ${w})`) : s.fail((0, e._)`${$} !== ${d}`);
|
|
3520
3520
|
}
|
|
3521
3521
|
};
|
|
3522
3522
|
return st.default = y, st;
|
|
@@ -3525,7 +3525,7 @@ var it = {}, Yr;
|
|
|
3525
3525
|
function Fs() {
|
|
3526
3526
|
if (Yr) return it;
|
|
3527
3527
|
Yr = 1, Object.defineProperty(it, "__esModule", { value: !0 });
|
|
3528
|
-
const e = G(), t = Y(),
|
|
3528
|
+
const e = G(), t = Y(), r = rr(), y = {
|
|
3529
3529
|
keyword: "enum",
|
|
3530
3530
|
schemaType: "array",
|
|
3531
3531
|
$data: !0,
|
|
@@ -3539,38 +3539,38 @@ function Fs() {
|
|
|
3539
3539
|
throw new Error("enum must have non-empty array");
|
|
3540
3540
|
const _ = w.length >= E.opts.loopEnum;
|
|
3541
3541
|
let v;
|
|
3542
|
-
const b = () => v ?? (v = (0, t.useFunc)(l,
|
|
3542
|
+
const b = () => v ?? (v = (0, t.useFunc)(l, r.default));
|
|
3543
3543
|
let h;
|
|
3544
3544
|
if (_ || f)
|
|
3545
3545
|
h = l.let("valid"), s.block$data(h, a);
|
|
3546
3546
|
else {
|
|
3547
3547
|
if (!Array.isArray(w))
|
|
3548
3548
|
throw new Error("ajv implementation error");
|
|
3549
|
-
const
|
|
3550
|
-
h = (0, e.or)(...w.map((c, g) => u(
|
|
3549
|
+
const n = l.const("vSchema", $);
|
|
3550
|
+
h = (0, e.or)(...w.map((c, g) => u(n, g)));
|
|
3551
3551
|
}
|
|
3552
3552
|
s.pass(h);
|
|
3553
3553
|
function a() {
|
|
3554
|
-
l.assign(h, !1), l.forOf("v", $, (
|
|
3554
|
+
l.assign(h, !1), l.forOf("v", $, (n) => l.if((0, e._)`${b()}(${d}, ${n})`, () => l.assign(h, !0).break()));
|
|
3555
3555
|
}
|
|
3556
|
-
function u(
|
|
3556
|
+
function u(n, c) {
|
|
3557
3557
|
const g = w[c];
|
|
3558
|
-
return typeof g == "object" && g !== null ? (0, e._)`${b()}(${d}, ${
|
|
3558
|
+
return typeof g == "object" && g !== null ? (0, e._)`${b()}(${d}, ${n}[${c}])` : (0, e._)`${d} === ${g}`;
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
3561
|
};
|
|
3562
3562
|
return it.default = y, it;
|
|
3563
3563
|
}
|
|
3564
|
-
var
|
|
3564
|
+
var Qr;
|
|
3565
3565
|
function Ls() {
|
|
3566
|
-
if (
|
|
3567
|
-
|
|
3568
|
-
const e = Os(), t = Ns(),
|
|
3566
|
+
if (Qr) return We;
|
|
3567
|
+
Qr = 1, Object.defineProperty(We, "__esModule", { value: !0 });
|
|
3568
|
+
const e = Os(), t = Ns(), r = qs(), i = Ds(), y = Ts(), s = Ms(), l = As(), d = Vs(), f = zs(), w = Fs(), $ = [
|
|
3569
3569
|
// number
|
|
3570
3570
|
e.default,
|
|
3571
3571
|
t.default,
|
|
3572
3572
|
// string
|
|
3573
|
-
|
|
3573
|
+
r.default,
|
|
3574
3574
|
i.default,
|
|
3575
3575
|
// object
|
|
3576
3576
|
y.default,
|
|
@@ -3586,10 +3586,10 @@ function Ls() {
|
|
|
3586
3586
|
];
|
|
3587
3587
|
return We.default = $, We;
|
|
3588
3588
|
}
|
|
3589
|
-
var ot = {},
|
|
3589
|
+
var ot = {}, Ie = {}, xr;
|
|
3590
3590
|
function Cn() {
|
|
3591
|
-
if (
|
|
3592
|
-
|
|
3591
|
+
if (xr) return Ie;
|
|
3592
|
+
xr = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.validateAdditionalItems = void 0;
|
|
3593
3593
|
const e = G(), t = Y(), i = {
|
|
3594
3594
|
keyword: "additionalItems",
|
|
3595
3595
|
type: "array",
|
|
@@ -3624,13 +3624,13 @@ function Cn() {
|
|
|
3624
3624
|
});
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
|
-
return
|
|
3627
|
+
return Ie.validateAdditionalItems = y, Ie.default = i, Ie;
|
|
3628
3628
|
}
|
|
3629
3629
|
var at = {}, Oe = {}, Zr;
|
|
3630
3630
|
function qn() {
|
|
3631
3631
|
if (Zr) return Oe;
|
|
3632
3632
|
Zr = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.validateTuple = void 0;
|
|
3633
|
-
const e = G(), t = Y(),
|
|
3633
|
+
const e = G(), t = Y(), r = ge(), i = {
|
|
3634
3634
|
keyword: "items",
|
|
3635
3635
|
type: "array",
|
|
3636
3636
|
schemaType: ["object", "array", "boolean"],
|
|
@@ -3639,7 +3639,7 @@ function qn() {
|
|
|
3639
3639
|
const { schema: l, it: d } = s;
|
|
3640
3640
|
if (Array.isArray(l))
|
|
3641
3641
|
return y(s, "additionalItems", l);
|
|
3642
|
-
d.items = !0, !(0, t.alwaysValidSchema)(d, l) && s.ok((0,
|
|
3642
|
+
d.items = !0, !(0, t.alwaysValidSchema)(d, l) && s.ok((0, r.validateArray)(s));
|
|
3643
3643
|
}
|
|
3644
3644
|
};
|
|
3645
3645
|
function y(s, l, d = s.schema) {
|
|
@@ -3654,9 +3654,9 @@ function qn() {
|
|
|
3654
3654
|
}, v)), s.ok(v));
|
|
3655
3655
|
});
|
|
3656
3656
|
function h(a) {
|
|
3657
|
-
const { opts: u, errSchemaPath:
|
|
3657
|
+
const { opts: u, errSchemaPath: n } = _, c = d.length, g = c === a.minItems && (c === a.maxItems || a[l] === !1);
|
|
3658
3658
|
if (u.strictTuples && !g) {
|
|
3659
|
-
const o = `"${E}" is ${c}-tuple, but minItems or maxItems/${l} are not specified or different at path "${
|
|
3659
|
+
const o = `"${E}" is ${c}-tuple, but minItems or maxItems/${l} are not specified or different at path "${n}"`;
|
|
3660
3660
|
(0, t.checkStrictMode)(_, o, u.strictTuples);
|
|
3661
3661
|
}
|
|
3662
3662
|
}
|
|
@@ -3672,7 +3672,7 @@ function Us() {
|
|
|
3672
3672
|
type: "array",
|
|
3673
3673
|
schemaType: ["array"],
|
|
3674
3674
|
before: "uniqueItems",
|
|
3675
|
-
code: (
|
|
3675
|
+
code: (r) => (0, e.validateTuple)(r, "items")
|
|
3676
3676
|
};
|
|
3677
3677
|
return at.default = t, at;
|
|
3678
3678
|
}
|
|
@@ -3680,7 +3680,7 @@ var ct = {}, en;
|
|
|
3680
3680
|
function Ks() {
|
|
3681
3681
|
if (en) return ct;
|
|
3682
3682
|
en = 1, Object.defineProperty(ct, "__esModule", { value: !0 });
|
|
3683
|
-
const e = G(), t = Y(),
|
|
3683
|
+
const e = G(), t = Y(), r = ge(), i = Cn(), s = {
|
|
3684
3684
|
keyword: "items",
|
|
3685
3685
|
type: "array",
|
|
3686
3686
|
schemaType: ["object", "boolean"],
|
|
@@ -3691,7 +3691,7 @@ function Ks() {
|
|
|
3691
3691
|
},
|
|
3692
3692
|
code(l) {
|
|
3693
3693
|
const { schema: d, parentSchema: f, it: w } = l, { prefixItems: $ } = f;
|
|
3694
|
-
w.items = !0, !(0, t.alwaysValidSchema)(w, d) && ($ ? (0, i.validateAdditionalItems)(l, $) : l.ok((0,
|
|
3694
|
+
w.items = !0, !(0, t.alwaysValidSchema)(w, d) && ($ ? (0, i.validateAdditionalItems)(l, $) : l.ok((0, r.validateArray)(l)));
|
|
3695
3695
|
}
|
|
3696
3696
|
};
|
|
3697
3697
|
return ct.default = s, ct;
|
|
@@ -3734,7 +3734,7 @@ function Js() {
|
|
|
3734
3734
|
E === void 0 && $ === 1 ? u(h, () => s.if(h, () => s.break())) : $ === 0 ? (s.let(h, !0), E !== void 0 && s.if((0, e._)`${f}.length > 0`, a)) : (s.let(h, !1), a()), y.result(h, () => y.reset());
|
|
3735
3735
|
function a() {
|
|
3736
3736
|
const c = s.name("_valid"), g = s.let("count", 0);
|
|
3737
|
-
u(c, () => s.if(c, () =>
|
|
3737
|
+
u(c, () => s.if(c, () => n(g)));
|
|
3738
3738
|
}
|
|
3739
3739
|
function u(c, g) {
|
|
3740
3740
|
s.forRange("i", 0, b, (o) => {
|
|
@@ -3746,18 +3746,18 @@ function Js() {
|
|
|
3746
3746
|
}, c), g();
|
|
3747
3747
|
});
|
|
3748
3748
|
}
|
|
3749
|
-
function
|
|
3749
|
+
function n(c) {
|
|
3750
3750
|
s.code((0, e._)`${c}++`), E === void 0 ? s.if((0, e._)`${c} >= ${$}`, () => s.assign(h, !0).break()) : (s.if((0, e._)`${c} > ${E}`, () => s.assign(h, !1).break()), $ === 1 ? s.assign(h, !0) : s.if((0, e._)`${c} >= ${$}`, () => s.assign(h, !0)));
|
|
3751
3751
|
}
|
|
3752
3752
|
}
|
|
3753
3753
|
};
|
|
3754
3754
|
return dt.default = i, dt;
|
|
3755
3755
|
}
|
|
3756
|
-
var
|
|
3756
|
+
var Qt = {}, rn;
|
|
3757
3757
|
function Hs() {
|
|
3758
3758
|
return rn || (rn = 1, (function(e) {
|
|
3759
3759
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
|
|
3760
|
-
const t = G(),
|
|
3760
|
+
const t = G(), r = Y(), i = ge();
|
|
3761
3761
|
e.error = {
|
|
3762
3762
|
message: ({ params: { property: f, depsCount: w, deps: $ } }) => {
|
|
3763
3763
|
const E = w === 1 ? "property" : "properties";
|
|
@@ -3813,7 +3813,7 @@ function Hs() {
|
|
|
3813
3813
|
function d(f, w = f.schema) {
|
|
3814
3814
|
const { gen: $, data: E, keyword: _, it: v } = f, b = $.name("valid");
|
|
3815
3815
|
for (const h in w)
|
|
3816
|
-
(0,
|
|
3816
|
+
(0, r.alwaysValidSchema)(v, w[h]) || ($.if(
|
|
3817
3817
|
(0, i.propertyInData)($, E, h, v.opts.ownProperties),
|
|
3818
3818
|
() => {
|
|
3819
3819
|
const a = f.subschema({ keyword: _, schemaProp: h }, b);
|
|
@@ -3824,7 +3824,7 @@ function Hs() {
|
|
|
3824
3824
|
), f.ok(b));
|
|
3825
3825
|
}
|
|
3826
3826
|
e.validateSchemaDeps = d, e.default = y;
|
|
3827
|
-
})(
|
|
3827
|
+
})(Qt)), Qt;
|
|
3828
3828
|
}
|
|
3829
3829
|
var ut = {}, nn;
|
|
3830
3830
|
function Gs() {
|
|
@@ -3862,7 +3862,7 @@ var lt = {}, sn;
|
|
|
3862
3862
|
function Dn() {
|
|
3863
3863
|
if (sn) return lt;
|
|
3864
3864
|
sn = 1, Object.defineProperty(lt, "__esModule", { value: !0 });
|
|
3865
|
-
const e = ge(), t = G(),
|
|
3865
|
+
const e = ge(), t = G(), r = Se(), i = Y(), s = {
|
|
3866
3866
|
keyword: "additionalProperties",
|
|
3867
3867
|
type: ["object"],
|
|
3868
3868
|
schemaType: ["boolean", "object"],
|
|
@@ -3880,13 +3880,13 @@ function Dn() {
|
|
|
3880
3880
|
if (_.props = !0, b.removeAdditional !== "all" && (0, i.alwaysValidSchema)(_, f))
|
|
3881
3881
|
return;
|
|
3882
3882
|
const h = (0, e.allSchemaProperties)(w.properties), a = (0, e.allSchemaProperties)(w.patternProperties);
|
|
3883
|
-
u(), l.ok((0, t._)`${E} === ${
|
|
3883
|
+
u(), l.ok((0, t._)`${E} === ${r.default.errors}`);
|
|
3884
3884
|
function u() {
|
|
3885
3885
|
d.forIn("key", $, (m) => {
|
|
3886
|
-
!h.length && !a.length ? g(m) : d.if(
|
|
3886
|
+
!h.length && !a.length ? g(m) : d.if(n(m), () => g(m));
|
|
3887
3887
|
});
|
|
3888
3888
|
}
|
|
3889
|
-
function
|
|
3889
|
+
function n(m) {
|
|
3890
3890
|
let P;
|
|
3891
3891
|
if (h.length > 8) {
|
|
3892
3892
|
const O = (0, i.schemaRefOrVal)(_, w.properties, "properties");
|
|
@@ -3933,7 +3933,7 @@ var ft = {}, on;
|
|
|
3933
3933
|
function Ws() {
|
|
3934
3934
|
if (on) return ft;
|
|
3935
3935
|
on = 1, Object.defineProperty(ft, "__esModule", { value: !0 });
|
|
3936
|
-
const e = Mt(), t = ge(),
|
|
3936
|
+
const e = Mt(), t = ge(), r = Y(), i = Dn(), y = {
|
|
3937
3937
|
keyword: "properties",
|
|
3938
3938
|
type: "object",
|
|
3939
3939
|
schemaType: "object",
|
|
@@ -3943,8 +3943,8 @@ function Ws() {
|
|
|
3943
3943
|
const E = (0, t.allSchemaProperties)(d);
|
|
3944
3944
|
for (const a of E)
|
|
3945
3945
|
$.definedProperties.add(a);
|
|
3946
|
-
$.opts.unevaluated && E.length && $.props !== !0 && ($.props =
|
|
3947
|
-
const _ = E.filter((a) => !(0,
|
|
3946
|
+
$.opts.unevaluated && E.length && $.props !== !0 && ($.props = r.mergeEvaluated.props(l, (0, r.toHash)(E), $.props));
|
|
3947
|
+
const _ = E.filter((a) => !(0, r.alwaysValidSchema)($, d[a]));
|
|
3948
3948
|
if (_.length === 0)
|
|
3949
3949
|
return;
|
|
3950
3950
|
const v = l.name("valid");
|
|
@@ -3968,12 +3968,12 @@ var pt = {}, an;
|
|
|
3968
3968
|
function Bs() {
|
|
3969
3969
|
if (an) return pt;
|
|
3970
3970
|
an = 1, Object.defineProperty(pt, "__esModule", { value: !0 });
|
|
3971
|
-
const e = ge(), t = G(),
|
|
3971
|
+
const e = ge(), t = G(), r = Y(), i = Y(), y = {
|
|
3972
3972
|
keyword: "patternProperties",
|
|
3973
3973
|
type: "object",
|
|
3974
3974
|
schemaType: "object",
|
|
3975
3975
|
code(s) {
|
|
3976
|
-
const { gen: l, schema: d, data: f, parentSchema: w, it: $ } = s, { opts: E } = $, _ = (0, e.allSchemaProperties)(d), v = _.filter((g) => (0,
|
|
3976
|
+
const { gen: l, schema: d, data: f, parentSchema: w, it: $ } = s, { opts: E } = $, _ = (0, e.allSchemaProperties)(d), v = _.filter((g) => (0, r.alwaysValidSchema)($, d[g]));
|
|
3977
3977
|
if (_.length === 0 || v.length === _.length && (!$.opts.unevaluated || $.props === !0))
|
|
3978
3978
|
return;
|
|
3979
3979
|
const b = E.strictSchema && !E.allowMatchingProperties && w.properties, h = l.name("valid");
|
|
@@ -3982,11 +3982,11 @@ function Bs() {
|
|
|
3982
3982
|
u();
|
|
3983
3983
|
function u() {
|
|
3984
3984
|
for (const g of _)
|
|
3985
|
-
b &&
|
|
3985
|
+
b && n(g), $.allErrors ? c(g) : (l.var(h, !0), c(g), l.if(h));
|
|
3986
3986
|
}
|
|
3987
|
-
function
|
|
3987
|
+
function n(g) {
|
|
3988
3988
|
for (const o in b)
|
|
3989
|
-
new RegExp(g).test(o) && (0,
|
|
3989
|
+
new RegExp(g).test(o) && (0, r.checkStrictMode)($, `property ${o} matches pattern ${g} (use allowMatchingProperties)`);
|
|
3990
3990
|
}
|
|
3991
3991
|
function c(g) {
|
|
3992
3992
|
l.forIn("key", f, (o) => {
|
|
@@ -4013,26 +4013,26 @@ function Ys() {
|
|
|
4013
4013
|
keyword: "not",
|
|
4014
4014
|
schemaType: ["object", "boolean"],
|
|
4015
4015
|
trackErrors: !0,
|
|
4016
|
-
code(
|
|
4017
|
-
const { gen: i, schema: y, it: s } =
|
|
4016
|
+
code(r) {
|
|
4017
|
+
const { gen: i, schema: y, it: s } = r;
|
|
4018
4018
|
if ((0, e.alwaysValidSchema)(s, y)) {
|
|
4019
|
-
|
|
4019
|
+
r.fail();
|
|
4020
4020
|
return;
|
|
4021
4021
|
}
|
|
4022
4022
|
const l = i.name("valid");
|
|
4023
|
-
|
|
4023
|
+
r.subschema({
|
|
4024
4024
|
keyword: "not",
|
|
4025
4025
|
compositeRule: !0,
|
|
4026
4026
|
createErrors: !1,
|
|
4027
4027
|
allErrors: !1
|
|
4028
|
-
}, l),
|
|
4028
|
+
}, l), r.failResult(l, () => r.reset(), () => r.error());
|
|
4029
4029
|
},
|
|
4030
4030
|
error: { message: "must NOT be valid" }
|
|
4031
4031
|
};
|
|
4032
4032
|
return mt.default = t, mt;
|
|
4033
4033
|
}
|
|
4034
4034
|
var ht = {}, dn;
|
|
4035
|
-
function
|
|
4035
|
+
function Qs() {
|
|
4036
4036
|
if (dn) return ht;
|
|
4037
4037
|
dn = 1, Object.defineProperty(ht, "__esModule", { value: !0 });
|
|
4038
4038
|
const t = {
|
|
@@ -4045,7 +4045,7 @@ function xs() {
|
|
|
4045
4045
|
return ht.default = t, ht;
|
|
4046
4046
|
}
|
|
4047
4047
|
var yt = {}, un;
|
|
4048
|
-
function
|
|
4048
|
+
function xs() {
|
|
4049
4049
|
if (un) return yt;
|
|
4050
4050
|
un = 1, Object.defineProperty(yt, "__esModule", { value: !0 });
|
|
4051
4051
|
const e = G(), t = Y(), i = {
|
|
@@ -4087,16 +4087,16 @@ function Zs() {
|
|
|
4087
4087
|
const e = Y(), t = {
|
|
4088
4088
|
keyword: "allOf",
|
|
4089
4089
|
schemaType: "array",
|
|
4090
|
-
code(
|
|
4091
|
-
const { gen: i, schema: y, it: s } =
|
|
4090
|
+
code(r) {
|
|
4091
|
+
const { gen: i, schema: y, it: s } = r;
|
|
4092
4092
|
if (!Array.isArray(y))
|
|
4093
4093
|
throw new Error("ajv implementation error");
|
|
4094
4094
|
const l = i.name("valid");
|
|
4095
4095
|
y.forEach((d, f) => {
|
|
4096
4096
|
if ((0, e.alwaysValidSchema)(s, d))
|
|
4097
4097
|
return;
|
|
4098
|
-
const w =
|
|
4099
|
-
|
|
4098
|
+
const w = r.subschema({ keyword: "allOf", schemaProp: f }, l);
|
|
4099
|
+
r.ok(l), r.mergeEvaluated(w);
|
|
4100
4100
|
});
|
|
4101
4101
|
}
|
|
4102
4102
|
};
|
|
@@ -4156,8 +4156,8 @@ function ei() {
|
|
|
4156
4156
|
const e = Y(), t = {
|
|
4157
4157
|
keyword: ["then", "else"],
|
|
4158
4158
|
schemaType: ["object", "boolean"],
|
|
4159
|
-
code({ keyword:
|
|
4160
|
-
i.if === void 0 && (0, e.checkStrictMode)(y, `"${
|
|
4159
|
+
code({ keyword: r, parentSchema: i, it: y }) {
|
|
4160
|
+
i.if === void 0 && (0, e.checkStrictMode)(y, `"${r}" without "if" is ignored`);
|
|
4161
4161
|
}
|
|
4162
4162
|
};
|
|
4163
4163
|
return _t.default = t, _t;
|
|
@@ -4166,9 +4166,9 @@ var mn;
|
|
|
4166
4166
|
function ti() {
|
|
4167
4167
|
if (mn) return ot;
|
|
4168
4168
|
mn = 1, Object.defineProperty(ot, "__esModule", { value: !0 });
|
|
4169
|
-
const e = Cn(), t = Us(),
|
|
4169
|
+
const e = Cn(), t = Us(), r = qn(), i = Ks(), y = Js(), s = Hs(), l = Gs(), d = Dn(), f = Ws(), w = Bs(), $ = Ys(), E = Qs(), _ = xs(), v = Zs(), b = Xs(), h = ei();
|
|
4170
4170
|
function a(u = !1) {
|
|
4171
|
-
const
|
|
4171
|
+
const n = [
|
|
4172
4172
|
// any
|
|
4173
4173
|
$.default,
|
|
4174
4174
|
E.default,
|
|
@@ -4183,7 +4183,7 @@ function ti() {
|
|
|
4183
4183
|
f.default,
|
|
4184
4184
|
w.default
|
|
4185
4185
|
];
|
|
4186
|
-
return u ?
|
|
4186
|
+
return u ? n.push(t.default, i.default) : n.push(e.default, r.default), n.push(y.default), n;
|
|
4187
4187
|
}
|
|
4188
4188
|
return ot.default = a, ot;
|
|
4189
4189
|
}
|
|
@@ -4191,7 +4191,7 @@ var $t = {}, bt = {}, hn;
|
|
|
4191
4191
|
function ri() {
|
|
4192
4192
|
if (hn) return bt;
|
|
4193
4193
|
hn = 1, Object.defineProperty(bt, "__esModule", { value: !0 });
|
|
4194
|
-
const e = G(),
|
|
4194
|
+
const e = G(), r = {
|
|
4195
4195
|
keyword: "format",
|
|
4196
4196
|
type: ["number", "string"],
|
|
4197
4197
|
schemaType: "string",
|
|
@@ -4209,13 +4209,13 @@ function ri() {
|
|
|
4209
4209
|
const u = s.scopeValue("formats", {
|
|
4210
4210
|
ref: b.formats,
|
|
4211
4211
|
code: E.code.formats
|
|
4212
|
-
}),
|
|
4213
|
-
s.if((0, e._)`typeof ${
|
|
4212
|
+
}), n = s.const("fDef", (0, e._)`${u}[${w}]`), c = s.let("fType"), g = s.let("format");
|
|
4213
|
+
s.if((0, e._)`typeof ${n} == "object" && !(${n} instanceof RegExp)`, () => s.assign(c, (0, e._)`${n}.type || "string"`).assign(g, (0, e._)`${n}.validate`), () => s.assign(c, (0, e._)`"string"`).assign(g, n)), i.fail$data((0, e.or)(o(), m()));
|
|
4214
4214
|
function o() {
|
|
4215
4215
|
return E.strictSchema === !1 ? e.nil : (0, e._)`${w} && !${g}`;
|
|
4216
4216
|
}
|
|
4217
4217
|
function m() {
|
|
4218
|
-
const P = v.$async ? (0, e._)`(${
|
|
4218
|
+
const P = v.$async ? (0, e._)`(${n}.async ? await ${g}(${l}) : ${g}(${l}))` : (0, e._)`${g}(${l})`, O = (0, e._)`(typeof ${g} == "function" ? ${P} : ${g}.test(${l}))`;
|
|
4219
4219
|
return (0, e._)`${g} && ${g} !== true && ${c} === ${y} && !${O}`;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
@@ -4227,8 +4227,8 @@ function ri() {
|
|
|
4227
4227
|
}
|
|
4228
4228
|
if (u === !0)
|
|
4229
4229
|
return;
|
|
4230
|
-
const [
|
|
4231
|
-
|
|
4230
|
+
const [n, c, g] = m(u);
|
|
4231
|
+
n === y && i.pass(P());
|
|
4232
4232
|
function o() {
|
|
4233
4233
|
if (E.strictSchema === !1) {
|
|
4234
4234
|
b.logger.warn(O());
|
|
@@ -4254,7 +4254,7 @@ function ri() {
|
|
|
4254
4254
|
}
|
|
4255
4255
|
}
|
|
4256
4256
|
};
|
|
4257
|
-
return bt.default =
|
|
4257
|
+
return bt.default = r, bt;
|
|
4258
4258
|
}
|
|
4259
4259
|
var yn;
|
|
4260
4260
|
function ni() {
|
|
@@ -4283,10 +4283,10 @@ var vn;
|
|
|
4283
4283
|
function ii() {
|
|
4284
4284
|
if (vn) return Je;
|
|
4285
4285
|
vn = 1, Object.defineProperty(Je, "__esModule", { value: !0 });
|
|
4286
|
-
const e =
|
|
4286
|
+
const e = Is(), t = Ls(), r = ti(), i = ni(), y = si(), s = [
|
|
4287
4287
|
e.default,
|
|
4288
4288
|
t.default,
|
|
4289
|
-
(0,
|
|
4289
|
+
(0, r.default)(),
|
|
4290
4290
|
i.default,
|
|
4291
4291
|
y.metadataVocabulary,
|
|
4292
4292
|
y.contentVocabulary
|
|
@@ -4306,7 +4306,7 @@ var $n;
|
|
|
4306
4306
|
function ai() {
|
|
4307
4307
|
if ($n) return wt;
|
|
4308
4308
|
$n = 1, Object.defineProperty(wt, "__esModule", { value: !0 });
|
|
4309
|
-
const e = G(), t = oi(),
|
|
4309
|
+
const e = G(), t = oi(), r = tr(), i = At(), y = Y(), l = {
|
|
4310
4310
|
keyword: "discriminator",
|
|
4311
4311
|
type: "object",
|
|
4312
4312
|
schemaType: "object",
|
|
@@ -4331,10 +4331,10 @@ function ai() {
|
|
|
4331
4331
|
const g = c();
|
|
4332
4332
|
f.if(!1);
|
|
4333
4333
|
for (const o in g)
|
|
4334
|
-
f.elseIf((0, e._)`${a} === ${o}`), f.assign(h,
|
|
4334
|
+
f.elseIf((0, e._)`${a} === ${o}`), f.assign(h, n(g[o]));
|
|
4335
4335
|
f.else(), d.error(!1, { discrError: t.DiscrError.Mapping, tag: a, tagName: b }), f.endIf();
|
|
4336
4336
|
}
|
|
4337
|
-
function
|
|
4337
|
+
function n(g) {
|
|
4338
4338
|
const o = f.name("valid"), m = d.subschema({ keyword: "oneOf", schemaProp: g }, o);
|
|
4339
4339
|
return d.mergeEvaluated(m, e.Name), o;
|
|
4340
4340
|
}
|
|
@@ -4346,7 +4346,7 @@ function ai() {
|
|
|
4346
4346
|
let V = v[C];
|
|
4347
4347
|
if (V?.$ref && !(0, y.schemaHasRulesButRef)(V, _.self.RULES)) {
|
|
4348
4348
|
const L = V.$ref;
|
|
4349
|
-
if (V =
|
|
4349
|
+
if (V = r.resolveRef.call(_.self, _.schemaEnv.root, _.baseId, L), V instanceof r.SchemaEnv && (V = V.schema), V === void 0)
|
|
4350
4350
|
throw new i.default(_.opts.uriResolver, _.baseId, L);
|
|
4351
4351
|
}
|
|
4352
4352
|
const F = (g = V?.properties) === null || g === void 0 ? void 0 : g[b];
|
|
@@ -4392,8 +4392,8 @@ var bn;
|
|
|
4392
4392
|
function Tn() {
|
|
4393
4393
|
return bn || (bn = 1, (function(e, t) {
|
|
4394
4394
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv = void 0;
|
|
4395
|
-
const
|
|
4396
|
-
class f extends
|
|
4395
|
+
const r = ks(), i = ii(), y = ai(), s = mi, l = ["/properties"], d = "http://json-schema.org/draft-07/schema";
|
|
4396
|
+
class f extends r.default {
|
|
4397
4397
|
_addVocabularies() {
|
|
4398
4398
|
super._addVocabularies(), i.default.forEach((b) => this.addVocabulary(b)), this.opts.discriminator && this.addKeyword(y.default);
|
|
4399
4399
|
}
|
|
@@ -4438,7 +4438,7 @@ function Tn() {
|
|
|
4438
4438
|
}
|
|
4439
4439
|
var hi = Tn();
|
|
4440
4440
|
const yi = /* @__PURE__ */ jn(hi);
|
|
4441
|
-
var Pt = { exports: {} },
|
|
4441
|
+
var Pt = { exports: {} }, xt = {}, wn;
|
|
4442
4442
|
function gi() {
|
|
4443
4443
|
return wn || (wn = 1, (function(e) {
|
|
4444
4444
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.formatNames = e.fastFormats = e.fullFormats = void 0;
|
|
@@ -4506,7 +4506,7 @@ function gi() {
|
|
|
4506
4506
|
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
|
|
4507
4507
|
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
|
|
4508
4508
|
}, e.formatNames = Object.keys(e.fullFormats);
|
|
4509
|
-
function
|
|
4509
|
+
function r(C) {
|
|
4510
4510
|
return C % 4 === 0 && (C % 100 !== 0 || C % 400 === 0);
|
|
4511
4511
|
}
|
|
4512
4512
|
const i = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, y = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
@@ -4514,8 +4514,8 @@ function gi() {
|
|
|
4514
4514
|
const V = i.exec(C);
|
|
4515
4515
|
if (!V)
|
|
4516
4516
|
return !1;
|
|
4517
|
-
const F = +V[1], L = +V[2],
|
|
4518
|
-
return L >= 1 && L <= 12 &&
|
|
4517
|
+
const F = +V[1], L = +V[2], x = +V[3];
|
|
4518
|
+
return L >= 1 && L <= 12 && x >= 1 && x <= (L === 2 && r(F) ? 29 : y[L]);
|
|
4519
4519
|
}
|
|
4520
4520
|
function l(C, V) {
|
|
4521
4521
|
if (C && V)
|
|
@@ -4527,13 +4527,13 @@ function gi() {
|
|
|
4527
4527
|
const L = d.exec(F);
|
|
4528
4528
|
if (!L)
|
|
4529
4529
|
return !1;
|
|
4530
|
-
const
|
|
4530
|
+
const x = +L[1], ie = +L[2], oe = +L[3], X = L[4], pe = L[5] === "-" ? -1 : 1, M = +(L[6] || 0), j = +(L[7] || 0);
|
|
4531
4531
|
if (M > 23 || j > 59 || C && !X)
|
|
4532
4532
|
return !1;
|
|
4533
|
-
if (
|
|
4533
|
+
if (x <= 23 && ie <= 59 && oe < 60)
|
|
4534
4534
|
return !0;
|
|
4535
|
-
const D = ie - j * pe,
|
|
4536
|
-
return (
|
|
4535
|
+
const D = ie - j * pe, I = x - M * pe - (D < 0 ? 1 : 0);
|
|
4536
|
+
return (I === 23 || I === -1) && (D === 59 || D === -1) && oe < 61;
|
|
4537
4537
|
};
|
|
4538
4538
|
}
|
|
4539
4539
|
function w(C, V) {
|
|
@@ -4554,8 +4554,8 @@ function gi() {
|
|
|
4554
4554
|
function _(C) {
|
|
4555
4555
|
const V = f(C);
|
|
4556
4556
|
return function(L) {
|
|
4557
|
-
const
|
|
4558
|
-
return
|
|
4557
|
+
const x = L.split(E);
|
|
4558
|
+
return x.length === 2 && s(x[0]) && V(x[1]);
|
|
4559
4559
|
};
|
|
4560
4560
|
}
|
|
4561
4561
|
function v(C, V) {
|
|
@@ -4568,7 +4568,7 @@ function gi() {
|
|
|
4568
4568
|
function b(C, V) {
|
|
4569
4569
|
if (!(C && V))
|
|
4570
4570
|
return;
|
|
4571
|
-
const [F, L] = C.split(E), [
|
|
4571
|
+
const [F, L] = C.split(E), [x, ie] = V.split(E), oe = l(F, x);
|
|
4572
4572
|
if (oe !== void 0)
|
|
4573
4573
|
return oe || w(L, ie);
|
|
4574
4574
|
}
|
|
@@ -4576,9 +4576,9 @@ function gi() {
|
|
|
4576
4576
|
function u(C) {
|
|
4577
4577
|
return h.test(C) && a.test(C);
|
|
4578
4578
|
}
|
|
4579
|
-
const
|
|
4579
|
+
const n = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
4580
4580
|
function c(C) {
|
|
4581
|
-
return
|
|
4581
|
+
return n.lastIndex = 0, n.test(C);
|
|
4582
4582
|
}
|
|
4583
4583
|
const g = -2147483648, o = 2 ** 31 - 1;
|
|
4584
4584
|
function m(C) {
|
|
@@ -4600,20 +4600,20 @@ function gi() {
|
|
|
4600
4600
|
return !1;
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
|
-
})(
|
|
4603
|
+
})(xt)), xt;
|
|
4604
4604
|
}
|
|
4605
4605
|
var Zt = {}, Pn;
|
|
4606
4606
|
function vi() {
|
|
4607
4607
|
return Pn || (Pn = 1, (function(e) {
|
|
4608
4608
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.formatLimitDefinition = void 0;
|
|
4609
|
-
const t = Tn(),
|
|
4609
|
+
const t = Tn(), r = G(), i = r.operators, y = {
|
|
4610
4610
|
formatMaximum: { okStr: "<=", ok: i.LTE, fail: i.GT },
|
|
4611
4611
|
formatMinimum: { okStr: ">=", ok: i.GTE, fail: i.LT },
|
|
4612
4612
|
formatExclusiveMaximum: { okStr: "<", ok: i.LT, fail: i.GTE },
|
|
4613
4613
|
formatExclusiveMinimum: { okStr: ">", ok: i.GT, fail: i.LTE }
|
|
4614
4614
|
}, s = {
|
|
4615
|
-
message: ({ keyword: d, schemaCode: f }) => (0,
|
|
4616
|
-
params: ({ keyword: d, schemaCode: f }) => (0,
|
|
4615
|
+
message: ({ keyword: d, schemaCode: f }) => (0, r.str)`should be ${y[d].okStr} ${f}`,
|
|
4616
|
+
params: ({ keyword: d, schemaCode: f }) => (0, r._)`{comparison: ${y[d].okStr}, limit: ${f}}`
|
|
4617
4617
|
};
|
|
4618
4618
|
e.formatLimitDefinition = {
|
|
4619
4619
|
keyword: Object.keys(y),
|
|
@@ -4631,8 +4631,8 @@ function vi() {
|
|
|
4631
4631
|
const c = f.scopeValue("formats", {
|
|
4632
4632
|
ref: b.formats,
|
|
4633
4633
|
code: v.code.formats
|
|
4634
|
-
}), g = f.const("fmt", (0,
|
|
4635
|
-
d.fail$data((0,
|
|
4634
|
+
}), g = f.const("fmt", (0, r._)`${c}[${h.schemaCode}]`);
|
|
4635
|
+
d.fail$data((0, r.or)((0, r._)`typeof ${g} != "object"`, (0, r._)`${g} instanceof RegExp`, (0, r._)`typeof ${g}.compare != "function"`, n(g)));
|
|
4636
4636
|
}
|
|
4637
4637
|
function u() {
|
|
4638
4638
|
const c = h.schema, g = b.formats[c];
|
|
@@ -4643,12 +4643,12 @@ function vi() {
|
|
|
4643
4643
|
const o = f.scopeValue("formats", {
|
|
4644
4644
|
key: c,
|
|
4645
4645
|
ref: g,
|
|
4646
|
-
code: v.code.formats ? (0,
|
|
4646
|
+
code: v.code.formats ? (0, r._)`${v.code.formats}${(0, r.getProperty)(c)}` : void 0
|
|
4647
4647
|
});
|
|
4648
|
-
d.fail$data(
|
|
4648
|
+
d.fail$data(n(o));
|
|
4649
4649
|
}
|
|
4650
|
-
function
|
|
4651
|
-
return (0,
|
|
4650
|
+
function n(c) {
|
|
4651
|
+
return (0, r._)`${c}.compare(${w}, ${$}) ${y[E].fail} 0`;
|
|
4652
4652
|
}
|
|
4653
4653
|
},
|
|
4654
4654
|
dependencies: ["format"]
|
|
@@ -4661,14 +4661,14 @@ var Sn;
|
|
|
4661
4661
|
function _i() {
|
|
4662
4662
|
return Sn || (Sn = 1, (function(e, t) {
|
|
4663
4663
|
Object.defineProperty(t, "__esModule", { value: !0 });
|
|
4664
|
-
const
|
|
4664
|
+
const r = gi(), i = vi(), y = G(), s = new y.Name("fullFormats"), l = new y.Name("fastFormats"), d = (w, $ = { keywords: !0 }) => {
|
|
4665
4665
|
if (Array.isArray($))
|
|
4666
|
-
return f(w, $,
|
|
4667
|
-
const [E, _] = $.mode === "fast" ? [
|
|
4666
|
+
return f(w, $, r.fullFormats, s), w;
|
|
4667
|
+
const [E, _] = $.mode === "fast" ? [r.fastFormats, l] : [r.fullFormats, s], v = $.formats || r.formatNames;
|
|
4668
4668
|
return f(w, v, E, _), $.keywords && (0, i.default)(w), w;
|
|
4669
4669
|
};
|
|
4670
4670
|
d.get = (w, $ = "full") => {
|
|
4671
|
-
const _ = ($ === "fast" ?
|
|
4671
|
+
const _ = ($ === "fast" ? r.fastFormats : r.fullFormats)[w];
|
|
4672
4672
|
if (!_)
|
|
4673
4673
|
throw new Error(`Unknown format "${w}"`);
|
|
4674
4674
|
return _;
|
|
@@ -4683,11 +4683,11 @@ function _i() {
|
|
|
4683
4683
|
})(Pt, Pt.exports)), Pt.exports;
|
|
4684
4684
|
}
|
|
4685
4685
|
var $i = _i();
|
|
4686
|
-
const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#", Pi = "#/definitions/CICConfig", Si = /* @__PURE__ */ JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}'), Ve = {
|
|
4686
|
+
const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#", Pi = "#/definitions/CICConfig", Si = /* @__PURE__ */ JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}'), Ve = {
|
|
4687
4687
|
$schema: wi,
|
|
4688
4688
|
$ref: Pi,
|
|
4689
4689
|
definitions: Si
|
|
4690
|
-
},
|
|
4690
|
+
}, ue = {
|
|
4691
4691
|
REQUIRED: "required",
|
|
4692
4692
|
TYPE: "type",
|
|
4693
4693
|
ENUM: "enum",
|
|
@@ -4705,55 +4705,61 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4705
4705
|
enum: (e) => `取值必须为枚举之一:${e.join(", ")}`,
|
|
4706
4706
|
constOne: (e) => `取值必须为:${JSON.stringify(e)}`,
|
|
4707
4707
|
additionalProp: (e) => `不允许额外字段:${e}`
|
|
4708
|
-
},
|
|
4708
|
+
}, Ei = [
|
|
4709
|
+
{ rootPattern: /(\/|^)components\/\d+/, discriminator: "role", keepRequired: ["role", "id"] },
|
|
4710
|
+
{ rootPattern: /(\/|^)global\/[^\/]+$/, discriminator: "type", keepRequired: ["type"] },
|
|
4711
|
+
{ rootPattern: /(\/|^)page\/[^\/]+\/[^\/]+$/, discriminator: "type", keepRequired: ["type"] },
|
|
4712
|
+
{ rootPattern: /(\/|^)component\/[^\/]+\/[^\/]+$/, discriminator: "type", keepRequired: ["type"] },
|
|
4713
|
+
{ rootPattern: /(\/|^)dataSources\/\d+/, discriminator: "type", keepRequired: ["type", "id"] }
|
|
4714
|
+
], Me = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, nr = () => {
|
|
4709
4715
|
const e = globalThis;
|
|
4710
4716
|
if (e?.crypto?.randomUUID)
|
|
4711
4717
|
return e.crypto.randomUUID();
|
|
4712
4718
|
if (e?.crypto?.getRandomValues) {
|
|
4713
4719
|
const t = new Uint8Array(16);
|
|
4714
4720
|
e.crypto.getRandomValues(t), t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128;
|
|
4715
|
-
const
|
|
4716
|
-
return `${
|
|
4721
|
+
const r = Array.from(t, (i) => i.toString(16).padStart(2, "0"));
|
|
4722
|
+
return `${r.slice(0, 4).join("")}-${r.slice(4, 6).join("")}-${r.slice(6, 8).join("")}-${r.slice(8, 10).join("")}-${r.slice(10).join("")}`;
|
|
4717
4723
|
}
|
|
4718
4724
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
4719
|
-
const
|
|
4720
|
-
return (t === "x" ?
|
|
4725
|
+
const r = Math.random() * 16 | 0;
|
|
4726
|
+
return (t === "x" ? r : r & 3 | 8).toString(16);
|
|
4721
4727
|
});
|
|
4722
4728
|
}, ee = (e) => {
|
|
4723
4729
|
if (!Array.isArray(e)) return [];
|
|
4724
4730
|
const t = (h) => {
|
|
4725
|
-
const a = h.instancePath || h.path || "", u = h.keyword,
|
|
4731
|
+
const a = h.instancePath || h.path || "", u = h.keyword, n = h.params || {};
|
|
4726
4732
|
let c = h.message || "";
|
|
4727
4733
|
switch (u) {
|
|
4728
|
-
case
|
|
4729
|
-
|
|
4734
|
+
case ue.REQUIRED:
|
|
4735
|
+
n.missingProperty && (c = Ne.missing(n.missingProperty));
|
|
4730
4736
|
break;
|
|
4731
|
-
case
|
|
4737
|
+
case ue.TYPE:
|
|
4732
4738
|
h.schema && (c = Ne.type(h.schema));
|
|
4733
4739
|
break;
|
|
4734
|
-
case
|
|
4735
|
-
Array.isArray(
|
|
4740
|
+
case ue.ENUM:
|
|
4741
|
+
Array.isArray(n.allowedValues) && (c = Ne.enum(n.allowedValues));
|
|
4736
4742
|
break;
|
|
4737
|
-
case
|
|
4738
|
-
c =
|
|
4743
|
+
case ue.CONST:
|
|
4744
|
+
c = n.allowedValue !== void 0 ? Ne.constOne(n.allowedValue) : "必须等于常量";
|
|
4739
4745
|
break;
|
|
4740
|
-
case
|
|
4741
|
-
|
|
4746
|
+
case ue.ADDITIONAL:
|
|
4747
|
+
n.additionalProperty && (c = Ne.additionalProp(n.additionalProperty));
|
|
4742
4748
|
break;
|
|
4743
4749
|
}
|
|
4744
|
-
return { path: a, message: c, keyword: u, params:
|
|
4745
|
-
},
|
|
4746
|
-
for (const h of
|
|
4747
|
-
if (h.keyword ===
|
|
4748
|
-
const a = h.path, u = y.get(a) || { path: h.path, values: [] },
|
|
4749
|
-
|
|
4750
|
+
return { path: a, message: c, keyword: u, params: n };
|
|
4751
|
+
}, r = e.map(t), i = [], y = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
4752
|
+
for (const h of r)
|
|
4753
|
+
if (h.keyword === ue.CONST && h.path.endsWith(we.TYPE)) {
|
|
4754
|
+
const a = h.path, u = y.get(a) || { path: h.path, values: [] }, n = h.params?.allowedValue;
|
|
4755
|
+
n !== void 0 && !u.values.includes(n) && u.values.push(n), y.set(a, u);
|
|
4750
4756
|
} else
|
|
4751
4757
|
i.push(h);
|
|
4752
4758
|
for (const [, h] of y)
|
|
4753
4759
|
if (h.values.length <= 1)
|
|
4754
4760
|
h.values.length === 1 && i.push({
|
|
4755
4761
|
path: h.path,
|
|
4756
|
-
keyword:
|
|
4762
|
+
keyword: ue.CONST,
|
|
4757
4763
|
params: { allowedValue: h.values[0] },
|
|
4758
4764
|
message: Ne.constOne(h.values[0])
|
|
4759
4765
|
});
|
|
@@ -4777,17 +4783,25 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4777
4783
|
}
|
|
4778
4784
|
const E = [];
|
|
4779
4785
|
for (const [h, a] of w.entries()) {
|
|
4786
|
+
const u = Ei.find((c) => c.rootPattern.test(h));
|
|
4787
|
+
if (u && a.some(
|
|
4788
|
+
(g) => g.keyword === ue.REQUIRED && g.params?.missingProperty === u.discriminator
|
|
4789
|
+
)) {
|
|
4790
|
+
for (const g of a)
|
|
4791
|
+
g.keyword === ue.REQUIRED && u.keepRequired.includes(g.params?.missingProperty) && E.push(g);
|
|
4792
|
+
continue;
|
|
4793
|
+
}
|
|
4780
4794
|
if (!s.has(h)) {
|
|
4781
4795
|
E.push(...a);
|
|
4782
4796
|
continue;
|
|
4783
4797
|
}
|
|
4784
|
-
for (const
|
|
4785
|
-
const
|
|
4786
|
-
|
|
4798
|
+
for (const c of a) {
|
|
4799
|
+
const g = c.keyword === ue.TYPE && (c.path === `${h}${we.VALUE}` || c.path === `${h}${we.DEFAULT}`), o = c.keyword === ue.ADDITIONAL && c.path === h;
|
|
4800
|
+
g || o || E.push(c);
|
|
4787
4801
|
}
|
|
4788
4802
|
}
|
|
4789
|
-
const v = E.some((h) => h.keyword !==
|
|
4790
|
-
if (h.keyword ===
|
|
4803
|
+
const v = E.some((h) => h.keyword !== ue.ANY_OF) ? E.filter((h) => h.keyword !== ue.ANY_OF) : E, b = (h) => {
|
|
4804
|
+
if (h.keyword === ue.REQUIRED) {
|
|
4791
4805
|
const a = h.params?.missingProperty;
|
|
4792
4806
|
return a === "type" || a === "role" ? 0 : a === "id" ? 1 : 2;
|
|
4793
4807
|
}
|
|
@@ -4796,13 +4810,13 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4796
4810
|
return v.sort((h, a) => b(h) - b(a));
|
|
4797
4811
|
}, ye = (e, t) => {
|
|
4798
4812
|
if (!t || typeof t != "object") return e;
|
|
4799
|
-
const
|
|
4813
|
+
const r = e ?? {};
|
|
4800
4814
|
for (const i of Object.keys(t))
|
|
4801
|
-
(!(i in
|
|
4802
|
-
return
|
|
4803
|
-
}, Pe = (e, t) => t?.length ? t.map((
|
|
4804
|
-
...
|
|
4805
|
-
path: `${e}${
|
|
4815
|
+
(!(i in r) || r[i] === void 0) && (r[i] = t[i]);
|
|
4816
|
+
return r;
|
|
4817
|
+
}, Pe = (e, t) => t?.length ? t.map((r) => ({
|
|
4818
|
+
...r,
|
|
4819
|
+
path: `${e}${r.path ? `.${r.path}` : ""}`
|
|
4806
4820
|
})) : [], Xt = (e) => {
|
|
4807
4821
|
try {
|
|
4808
4822
|
return { ok: !0, value: JSON.parse(e) };
|
|
@@ -4818,7 +4832,7 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4818
4832
|
]
|
|
4819
4833
|
};
|
|
4820
4834
|
}
|
|
4821
|
-
},
|
|
4835
|
+
}, ki = (e) => e.map((t) => ({
|
|
4822
4836
|
path: "",
|
|
4823
4837
|
keyword: "required",
|
|
4824
4838
|
params: { missingProperty: t },
|
|
@@ -4826,7 +4840,7 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4826
4840
|
})), Mn = ({
|
|
4827
4841
|
input: e,
|
|
4828
4842
|
normalize: t,
|
|
4829
|
-
base:
|
|
4843
|
+
base: r,
|
|
4830
4844
|
branches: i,
|
|
4831
4845
|
key: y,
|
|
4832
4846
|
missingKeys: s,
|
|
@@ -4838,17 +4852,17 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4838
4852
|
if (w)
|
|
4839
4853
|
return w(f) ? l(f) : { ok: !1, errors: ee(w.errors) };
|
|
4840
4854
|
}
|
|
4841
|
-
return
|
|
4842
|
-
}, sr = (e, t,
|
|
4855
|
+
return r(d) ? l(d) : !f || typeof f[y] != "string" ? { ok: !1, errors: ki(s) } : { ok: !1, errors: ee(r.errors) };
|
|
4856
|
+
}, sr = (e, t, r, i) => Mn({
|
|
4843
4857
|
input: e,
|
|
4844
4858
|
base: t,
|
|
4845
|
-
branches:
|
|
4859
|
+
branches: r,
|
|
4846
4860
|
key: i,
|
|
4847
4861
|
missingKeys: [i, "id"],
|
|
4848
|
-
onSuccess: () => ({ ok: !0 })
|
|
4849
|
-
}), ir = (e, t,
|
|
4862
|
+
onSuccess: () => ({ ok: !0, value: null })
|
|
4863
|
+
}), ir = (e, t, r, i, y, s, l = [s, "id"]) => Mn({
|
|
4850
4864
|
input: e,
|
|
4851
|
-
normalize: (d) =>
|
|
4865
|
+
normalize: (d) => r(d, t),
|
|
4852
4866
|
base: i,
|
|
4853
4867
|
branches: y,
|
|
4854
4868
|
key: s,
|
|
@@ -4856,7 +4870,7 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
4856
4870
|
onSuccess: (d) => ({ ok: !0, value: d })
|
|
4857
4871
|
});
|
|
4858
4872
|
let St = null;
|
|
4859
|
-
const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St), En = /* @__PURE__ */ new Map(),
|
|
4873
|
+
const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St), En = /* @__PURE__ */ new Map(), ji = JSON.stringify(Ve), Ri = {
|
|
4860
4874
|
CICPage: ["#/definitions/CICPage", "#/$defs/CICPage", "#/properties/pages/items", "#/definitions/CICConfig/properties/pages/items"],
|
|
4861
4875
|
Meta: ["#/definitions/Meta", "#/$defs/Meta", "#/properties/meta"],
|
|
4862
4876
|
Layout: ["#/definitions/Layout", "#/$defs/Layout", "#/properties/meta/properties/layout"],
|
|
@@ -4873,6 +4887,7 @@ const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St
|
|
|
4873
4887
|
DataSourceFunction: ["#/definitions/DataSourceFunction", "#/$defs/DataSourceFunction"],
|
|
4874
4888
|
RegistryComponents: ["#/definitions/RegistryComponents", "#/$defs/RegistryComponents"],
|
|
4875
4889
|
Variables: ["#/definitions/Variables", "#/$defs/Variables", "#/properties/variables"],
|
|
4890
|
+
// 依赖项
|
|
4876
4891
|
Dependency: ["#/definitions/Dependency", "#/$defs/Dependency"],
|
|
4877
4892
|
JSDependency: ["#/definitions/JSDependency", "#/$defs/JSDependency"],
|
|
4878
4893
|
CSSDependency: ["#/definitions/CSSDependency", "#/$defs/CSSDependency"],
|
|
@@ -4881,22 +4896,23 @@ const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St
|
|
|
4881
4896
|
JSONDependency: ["#/definitions/JSONDependency", "#/$defs/JSONDependency"],
|
|
4882
4897
|
WasmDependency: ["#/definitions/WasmDependency", "#/$defs/WasmDependency"],
|
|
4883
4898
|
OtherDependency: ["#/definitions/OtherDependency", "#/$defs/OtherDependency"],
|
|
4899
|
+
// 布局
|
|
4884
4900
|
LayoutConfig: ["#/definitions/Layout", "#/properties/meta/properties/layout"]
|
|
4885
4901
|
}, Ii = (e, t) => e.compile({ $ref: t, definitions: Ve.definitions, properties: Ve.properties }), te = (e) => {
|
|
4886
|
-
const t = An(),
|
|
4902
|
+
const t = An(), r = `type:${e}::${ji}`, i = En.get(r);
|
|
4887
4903
|
if (i) return i;
|
|
4888
|
-
const y =
|
|
4904
|
+
const y = Ri[e] || [`#/definitions/${e}`, `#/$defs/${e}`];
|
|
4889
4905
|
for (const s of y)
|
|
4890
4906
|
try {
|
|
4891
4907
|
const l = Ii(t, s);
|
|
4892
|
-
return En.set(
|
|
4908
|
+
return En.set(r, l), l;
|
|
4893
4909
|
} catch {
|
|
4894
4910
|
}
|
|
4895
4911
|
throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`);
|
|
4896
|
-
}, Vn = te("DataSourceItem"), zn = te("DataSourceRest"), Fn = te("DataSourceWebSocket"), Ln = te("DataSourceStatic"), Un = te("DataSourceFunction"),
|
|
4897
|
-
const
|
|
4898
|
-
return t?.generateId && !
|
|
4899
|
-
},
|
|
4912
|
+
}, Vn = te("DataSourceItem"), zn = te("DataSourceRest"), Fn = te("DataSourceWebSocket"), Ln = te("DataSourceStatic"), Un = te("DataSourceFunction"), Oi = (e, t) => {
|
|
4913
|
+
const r = { ...e };
|
|
4914
|
+
return t?.generateId && !r.id && (r.id = nr()), r.type && (r.type === "rest" ? (t?.strict || ("pollInterval" in r && Me(r.pollInterval) && (r.pollInterval = Math.round(r.pollInterval)), "timeout" in r && Me(r.timeout) && (r.timeout = Math.round(r.timeout))), ye(r, t?.defaults)) : r.type === "websocket" ? (r.heartbeat && typeof r.heartbeat == "object" && (t?.strict || "interval" in r.heartbeat && Me(r.heartbeat.interval) && (r.heartbeat.interval = Math.round(r.heartbeat.interval))), t?.strict || "pollInterval" in r && Me(r.pollInterval) && (r.pollInterval = Math.round(r.pollInterval)), ye(r, t?.defaults)) : r.type === "static" ? t?.strict || ye(r, t?.defaults) : r.type === "function" && (t?.strict || "timeout" in r && Me(r.timeout) && (r.timeout = Math.round(r.timeout)), t?.strict || ye(r, t?.defaults))), r;
|
|
4915
|
+
}, Ni = (e) => sr(
|
|
4900
4916
|
e,
|
|
4901
4917
|
Vn,
|
|
4902
4918
|
{ rest: zn, websocket: Fn, static: Ln, function: Un },
|
|
@@ -4904,15 +4920,15 @@ const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St
|
|
|
4904
4920
|
), Kn = (e, t) => ir(
|
|
4905
4921
|
e,
|
|
4906
4922
|
t,
|
|
4907
|
-
|
|
4923
|
+
Oi,
|
|
4908
4924
|
Vn,
|
|
4909
4925
|
{ rest: zn, websocket: Fn, static: Ln, function: Un },
|
|
4910
4926
|
"type",
|
|
4911
4927
|
["type", "id"]
|
|
4912
|
-
), Jn = te("ComponentInstance"), Hn = te("ViewComponentInstance"), Gn = te("ContainerComponentInstance"), Wn = te("LogicComponentInstanceRef"),
|
|
4913
|
-
const
|
|
4914
|
-
return t?.generateId && !
|
|
4915
|
-
},
|
|
4928
|
+
), Jn = te("ComponentInstance"), Hn = te("ViewComponentInstance"), Gn = te("ContainerComponentInstance"), Wn = te("LogicComponentInstanceRef"), Ci = (e, t) => {
|
|
4929
|
+
const r = { ...e };
|
|
4930
|
+
return t?.generateId && !r.id && (r.id = nr()), t?.strict || (r.role === "view" ? delete r.children : r.role === "container" ? delete r.component : r.role === "logic" && delete r.children), ye(r, t?.defaults), r;
|
|
4931
|
+
}, qi = (e) => sr(
|
|
4916
4932
|
e,
|
|
4917
4933
|
Jn,
|
|
4918
4934
|
{ view: Hn, container: Gn, logic: Wn },
|
|
@@ -4920,27 +4936,27 @@ const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St
|
|
|
4920
4936
|
), Bn = (e, t) => ir(
|
|
4921
4937
|
e,
|
|
4922
4938
|
t,
|
|
4923
|
-
|
|
4939
|
+
Ci,
|
|
4924
4940
|
Jn,
|
|
4925
4941
|
{ view: Hn, container: Gn, logic: Wn },
|
|
4926
4942
|
"role",
|
|
4927
4943
|
["role", "id"]
|
|
4928
|
-
), jt = te("CICPage"),
|
|
4929
|
-
const
|
|
4930
|
-
return t?.generateId && !
|
|
4931
|
-
},
|
|
4932
|
-
const
|
|
4933
|
-
return jt(
|
|
4934
|
-
},
|
|
4935
|
-
const
|
|
4936
|
-
return
|
|
4937
|
-
},
|
|
4938
|
-
const
|
|
4939
|
-
return
|
|
4940
|
-
}, Ot = te("Variables"),
|
|
4941
|
-
const
|
|
4942
|
-
return Ot(
|
|
4943
|
-
}, Xn = te("Dependency"), es = te("JSDependency"), ts = te("CSSDependency"), rs = te("FontDependency"), ns = te("ImageDependency"), ss = te("JSONDependency"), is = te("WasmDependency"), os = te("OtherDependency"),
|
|
4944
|
+
), jt = te("CICPage"), Di = (e, t) => {
|
|
4945
|
+
const r = { ...e };
|
|
4946
|
+
return t?.generateId && !r.id && (r.id = nr()), t?.strict || ye(r, t?.defaults), r;
|
|
4947
|
+
}, Ti = (e) => jt(e) ? { ok: !0, value: null } : { ok: !1, errors: ee(jt.errors || []) }, Yn = (e, t) => {
|
|
4948
|
+
const r = Di(e, t);
|
|
4949
|
+
return jt(r) ? { ok: !0, value: r } : { ok: !1, errors: ee(jt.errors || []) };
|
|
4950
|
+
}, Rt = te("Meta"), It = te("Layout"), Mi = (e) => Rt(e) ? { ok: !0, value: null } : { ok: !1, errors: ee(Rt.errors || []) }, Ai = (e) => It(e) ? { ok: !0, value: null } : { ok: !1, errors: ee(It.errors || []) }, Qn = (e, t) => {
|
|
4951
|
+
const r = t?.strict ? e : ye(e, t?.defaults);
|
|
4952
|
+
return Rt(r) ? { ok: !0, value: r } : { ok: !1, errors: ee(Rt.errors || []) };
|
|
4953
|
+
}, xn = (e, t) => {
|
|
4954
|
+
const r = t?.strict ? e : ye(e, t?.defaults);
|
|
4955
|
+
return It(r) ? { ok: !0, value: r } : { ok: !1, errors: ee(It.errors || []) };
|
|
4956
|
+
}, Ot = te("Variables"), Vi = (e) => Ot(e) ? { ok: !0, value: null } : { ok: !1, errors: ee(Ot.errors || []) }, Zn = (e, t) => {
|
|
4957
|
+
const r = t?.strict ? e : ye(e, t?.defaults);
|
|
4958
|
+
return Ot(r) ? { ok: !0, value: r } : { ok: !1, errors: ee(Ot.errors || []) };
|
|
4959
|
+
}, Xn = te("Dependency"), es = te("JSDependency"), ts = te("CSSDependency"), rs = te("FontDependency"), ns = te("ImageDependency"), ss = te("JSONDependency"), is = te("WasmDependency"), os = te("OtherDependency"), zi = (e) => sr(
|
|
4944
4960
|
e,
|
|
4945
4961
|
Xn,
|
|
4946
4962
|
{ js: es, css: ts, font: rs, image: ns, json: ss, wasm: is, other: os },
|
|
@@ -4953,43 +4969,60 @@ const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St
|
|
|
4953
4969
|
{ js: es, css: ts, font: rs, image: ns, json: ss, wasm: is, other: os },
|
|
4954
4970
|
"type",
|
|
4955
4971
|
["type", "id"]
|
|
4956
|
-
), Nt = te("RegistryComponents"),
|
|
4957
|
-
const
|
|
4958
|
-
return Nt(
|
|
4972
|
+
), Nt = te("RegistryComponents"), Fi = (e) => Nt(e) ? { ok: !0, value: null } : { ok: !1, errors: ee(Nt.errors || []) }, cs = (e, t) => {
|
|
4973
|
+
const r = t?.strict ? e : ye(e, t?.defaults);
|
|
4974
|
+
return Nt(r) ? { ok: !0, value: r } : { ok: !1, errors: ee(Nt.errors || []) };
|
|
4959
4975
|
};
|
|
4960
4976
|
let Ct, kn;
|
|
4961
|
-
const
|
|
4977
|
+
const Li = () => {
|
|
4962
4978
|
const e = An(), t = JSON.stringify(Ve);
|
|
4963
4979
|
(!Ct || kn !== t) && (Ct = e.compile(Ve), kn = t);
|
|
4964
4980
|
}, qt = (e) => {
|
|
4965
4981
|
try {
|
|
4966
|
-
|
|
4982
|
+
if (Li(), Ct(e)) {
|
|
4983
|
+
const r = [], i = /* @__PURE__ */ new Map(), y = Array.isArray(e.pages) ? e.pages : [];
|
|
4984
|
+
for (let s = 0; s < y.length; s++) {
|
|
4985
|
+
const l = y[s]?.name;
|
|
4986
|
+
if (typeof l == "string") {
|
|
4987
|
+
const d = l.trim();
|
|
4988
|
+
if (!d) continue;
|
|
4989
|
+
i.has(d) ? r.push({
|
|
4990
|
+
path: `/pages[${s}]/name`,
|
|
4991
|
+
message: `页面名称重复:"${d}"`,
|
|
4992
|
+
keyword: "anyOf",
|
|
4993
|
+
params: {}
|
|
4994
|
+
}) : i.set(d, s);
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
return r.length ? { ok: !1, errors: ee(r) } : { ok: !0, value: null };
|
|
4998
|
+
}
|
|
4999
|
+
return { ok: !1, errors: ee(Ct.errors || []) };
|
|
4967
5000
|
} catch (t) {
|
|
4968
|
-
const
|
|
4969
|
-
return { ok: !1, errors: ee(
|
|
5001
|
+
const r = [{ path: "", message: t?.message || String(t), keyword: "anyOf", params: {} }];
|
|
5002
|
+
return { ok: !1, errors: ee(r) };
|
|
4970
5003
|
}
|
|
4971
|
-
},
|
|
5004
|
+
}, Ui = (e, t) => {
|
|
4972
5005
|
if (e && typeof e == "object")
|
|
4973
5006
|
return Ae(e, t);
|
|
4974
|
-
const
|
|
4975
|
-
if (!(
|
|
5007
|
+
const r = (e || "").trim();
|
|
5008
|
+
if (!(r.startsWith("{") || r.startsWith("[")))
|
|
4976
5009
|
return { ok: !1, errors: ee([{ path: "", message: "非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入", keyword: "type", params: {} }]) };
|
|
4977
|
-
const y = Xt(
|
|
5010
|
+
const y = Xt(r);
|
|
4978
5011
|
return y.ok ? Ae(y.value, t) : { ok: !1, errors: y.errors };
|
|
4979
|
-
},
|
|
5012
|
+
}, Ki = async (e, t) => {
|
|
4980
5013
|
if (e && typeof e == "object")
|
|
4981
5014
|
return Ae(e, t);
|
|
4982
|
-
const
|
|
4983
|
-
if (
|
|
4984
|
-
const s = Xt(
|
|
5015
|
+
const r = (e || "").trim();
|
|
5016
|
+
if (r.startsWith("{") || r.startsWith("[")) {
|
|
5017
|
+
const s = Xt(r);
|
|
4985
5018
|
return s.ok ? Ae(s.value, t) : { ok: !1, errors: s.errors };
|
|
4986
5019
|
}
|
|
4987
5020
|
if (!(typeof globalThis.fetch == "function"))
|
|
4988
5021
|
return { ok: !1, errors: ee([{ path: "", message: "当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象", keyword: "type", params: {} }]) };
|
|
4989
|
-
if (/^file:\/\//i.test(
|
|
5022
|
+
if (/^file:\/\//i.test(r))
|
|
4990
5023
|
return { ok: !1, errors: ee([{ path: "", message: "不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)", keyword: "type", params: {} }]) };
|
|
4991
5024
|
try {
|
|
4992
|
-
const s = await globalThis.fetch(
|
|
5025
|
+
const s = await globalThis.fetch(r);
|
|
4993
5026
|
if (!s || !s.ok) {
|
|
4994
5027
|
const f = [{ path: "", message: `网络或资源错误:${s?.status} ${s?.statusText || ""}`.trim(), keyword: "type", params: {} }];
|
|
4995
5028
|
return { ok: !1, errors: ee(f) };
|
|
@@ -5000,10 +5033,10 @@ const Fi = () => {
|
|
|
5000
5033
|
const l = [{ path: "", message: `请求失败:${s?.message || s}`, keyword: "type", params: {} }];
|
|
5001
5034
|
return { ok: !1, errors: ee(l) };
|
|
5002
5035
|
}
|
|
5003
|
-
},
|
|
5036
|
+
}, Ji = (e) => {
|
|
5004
5037
|
const t = qt(e);
|
|
5005
5038
|
if (!t.ok) return { ok: !1, errors: t.errors };
|
|
5006
|
-
const
|
|
5039
|
+
const r = {
|
|
5007
5040
|
version: e.version,
|
|
5008
5041
|
meta: e.meta,
|
|
5009
5042
|
pages: e.pages,
|
|
@@ -5012,41 +5045,41 @@ const Fi = () => {
|
|
|
5012
5045
|
deps: e.deps,
|
|
5013
5046
|
extensions: e.extensions
|
|
5014
5047
|
};
|
|
5015
|
-
return { ok: !0, value: JSON.stringify(
|
|
5048
|
+
return { ok: !0, value: JSON.stringify(r, null, 2) };
|
|
5016
5049
|
}, Ae = (e, t) => {
|
|
5017
|
-
const
|
|
5018
|
-
if (!
|
|
5050
|
+
const r = typeof e == "object" ? { ...e } : e, i = [];
|
|
5051
|
+
if (!r || typeof r != "object")
|
|
5019
5052
|
return i.push({ path: "", message: "配置必须为对象", keyword: "type", params: { schema: "object" } }), { ok: !1, errors: ee(i) };
|
|
5020
|
-
if (
|
|
5021
|
-
const y =
|
|
5022
|
-
if (y.ok || i.push(...Pe("/meta", y.errors)),
|
|
5023
|
-
const l =
|
|
5024
|
-
l.ok ?
|
|
5053
|
+
if (r.version || i.push({ path: "/version", message: "缺少必填字段:version", keyword: "required", params: { missingProperty: "version" } }), r.meta || i.push({ path: "/meta", message: "缺少必填字段:meta", keyword: "required", params: { missingProperty: "meta" } }), r.pages || i.push({ path: "/pages", message: "缺少必填字段:pages", keyword: "required", params: { missingProperty: "pages" } }), i.length) return { ok: !1, errors: ee(i) };
|
|
5054
|
+
const y = Qn(r.meta, t?.meta);
|
|
5055
|
+
if (y.ok || i.push(...Pe("/meta", y.errors)), r.meta?.layout) {
|
|
5056
|
+
const l = xn(r.meta.layout, t?.layout);
|
|
5057
|
+
l.ok ? r.meta.layout = l.value : i.push(...Pe("/meta/layout", l.errors));
|
|
5025
5058
|
}
|
|
5026
|
-
if (y.ok && (
|
|
5027
|
-
const l = Zn(
|
|
5028
|
-
l.ok ?
|
|
5059
|
+
if (y.ok && (r.meta = y.value), r.variables) {
|
|
5060
|
+
const l = Zn(r.variables, t?.variables);
|
|
5061
|
+
l.ok ? r.variables = l.value : i.push(...Pe("/variables", l.errors));
|
|
5029
5062
|
}
|
|
5030
|
-
if (
|
|
5063
|
+
if (r.registry?.components) {
|
|
5031
5064
|
const l = [];
|
|
5032
|
-
for (let d = 0; d <
|
|
5033
|
-
const f = cs(
|
|
5065
|
+
for (let d = 0; d < r.registry.components.length; d++) {
|
|
5066
|
+
const f = cs(r.registry.components[d], t?.registry);
|
|
5034
5067
|
f.ok ? l.push(f.value) : i.push(...Pe(`/registry/components[${d}]`, f.errors));
|
|
5035
5068
|
}
|
|
5036
|
-
|
|
5069
|
+
r.registry.components = l;
|
|
5037
5070
|
}
|
|
5038
|
-
if (
|
|
5071
|
+
if (r.deps) {
|
|
5039
5072
|
const l = [];
|
|
5040
|
-
for (let d = 0; d <
|
|
5041
|
-
const f = as(
|
|
5073
|
+
for (let d = 0; d < r.deps.length; d++) {
|
|
5074
|
+
const f = as(r.deps[d], t?.dependency);
|
|
5042
5075
|
f.ok ? l.push(f.value) : i.push(...Pe(`/deps[${d}]`, f.errors));
|
|
5043
5076
|
}
|
|
5044
|
-
|
|
5077
|
+
r.deps = l;
|
|
5045
5078
|
}
|
|
5046
|
-
if (Array.isArray(
|
|
5079
|
+
if (Array.isArray(r.pages)) {
|
|
5047
5080
|
const l = [];
|
|
5048
|
-
for (let d = 0; d <
|
|
5049
|
-
const f =
|
|
5081
|
+
for (let d = 0; d < r.pages.length; d++) {
|
|
5082
|
+
const f = r.pages[d], w = Yn(f, t?.page);
|
|
5050
5083
|
if (!w.ok) {
|
|
5051
5084
|
i.push(...Pe(`/pages[${d}]`, w.errors));
|
|
5052
5085
|
continue;
|
|
@@ -5070,66 +5103,66 @@ const Fi = () => {
|
|
|
5070
5103
|
}
|
|
5071
5104
|
l.push($);
|
|
5072
5105
|
}
|
|
5073
|
-
|
|
5106
|
+
r.pages = l;
|
|
5074
5107
|
}
|
|
5075
5108
|
if (i.length) return { ok: !1, errors: ee(i) };
|
|
5076
|
-
const s = qt(
|
|
5077
|
-
return s.ok ? { ok: !0, value:
|
|
5109
|
+
const s = qt(r);
|
|
5110
|
+
return s.ok ? { ok: !0, value: r } : { ok: !1, errors: s.errors };
|
|
5078
5111
|
};
|
|
5079
5112
|
class ds {
|
|
5080
5113
|
config;
|
|
5081
5114
|
constructor(t) {
|
|
5082
|
-
const
|
|
5083
|
-
if (!
|
|
5084
|
-
throw new Error(`Invalid CIC Configuration: ${JSON.stringify(
|
|
5115
|
+
const r = qt(t);
|
|
5116
|
+
if (!r.ok)
|
|
5117
|
+
throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);
|
|
5085
5118
|
this.config = t;
|
|
5086
5119
|
}
|
|
5087
5120
|
getConfig() {
|
|
5088
5121
|
return this.config;
|
|
5089
5122
|
}
|
|
5090
5123
|
findComponent(t) {
|
|
5091
|
-
let
|
|
5092
|
-
return this.walkComponents((i) => i.id === t ? (
|
|
5124
|
+
let r;
|
|
5125
|
+
return this.walkComponents((i) => i.id === t ? (r = i, !1) : !0), r;
|
|
5093
5126
|
}
|
|
5094
5127
|
findPageByComponent(t) {
|
|
5095
|
-
let
|
|
5096
|
-
return this.walkComponents((i, y) => i.id === t ? (
|
|
5128
|
+
let r;
|
|
5129
|
+
return this.walkComponents((i, y) => i.id === t ? (r = y, !1) : !0), r;
|
|
5097
5130
|
}
|
|
5098
|
-
getVariable(t,
|
|
5131
|
+
getVariable(t, r) {
|
|
5099
5132
|
const i = this.config.variables;
|
|
5100
5133
|
if (i) {
|
|
5101
5134
|
if (t.componentId && i.component && i.component[t.componentId]) {
|
|
5102
|
-
const y = i.component[t.componentId][
|
|
5135
|
+
const y = i.component[t.componentId][r];
|
|
5103
5136
|
if (y) return y.value ?? y.default;
|
|
5104
5137
|
}
|
|
5105
5138
|
if (t.pageId && i.page && i.page[t.pageId]) {
|
|
5106
|
-
const y = i.page[t.pageId][
|
|
5139
|
+
const y = i.page[t.pageId][r];
|
|
5107
5140
|
if (y) return y.value ?? y.default;
|
|
5108
5141
|
}
|
|
5109
|
-
if (i.global && i.global[
|
|
5110
|
-
const y = i.global[
|
|
5142
|
+
if (i.global && i.global[r]) {
|
|
5143
|
+
const y = i.global[r];
|
|
5111
5144
|
return y.value ?? y.default;
|
|
5112
5145
|
}
|
|
5113
5146
|
}
|
|
5114
5147
|
}
|
|
5115
5148
|
getVariableByRef(t) {
|
|
5116
|
-
const
|
|
5117
|
-
if (!
|
|
5118
|
-
const [, i, y, s] =
|
|
5149
|
+
const r = t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);
|
|
5150
|
+
if (!r) return;
|
|
5151
|
+
const [, i, y, s] = r;
|
|
5119
5152
|
if (i === "global") return this.getVariable({}, s);
|
|
5120
5153
|
if (i === "page") return this.getVariable({ pageId: y }, s);
|
|
5121
5154
|
if (i === "component") return this.getVariable({ componentId: y }, s);
|
|
5122
5155
|
}
|
|
5123
5156
|
walkComponents(t) {
|
|
5124
5157
|
if (this.config.pages)
|
|
5125
|
-
for (const
|
|
5158
|
+
for (const r of this.config.pages) {
|
|
5126
5159
|
const i = [];
|
|
5127
|
-
for (const s of
|
|
5160
|
+
for (const s of r.components || [])
|
|
5128
5161
|
i.push({ node: s });
|
|
5129
5162
|
let y = !1;
|
|
5130
5163
|
for (; i.length > 0 && !y; ) {
|
|
5131
5164
|
const { node: s, parent: l } = i.pop();
|
|
5132
|
-
if (t(s,
|
|
5165
|
+
if (t(s, r, l) === !1) {
|
|
5133
5166
|
y = !0;
|
|
5134
5167
|
break;
|
|
5135
5168
|
}
|
|
@@ -5143,10 +5176,10 @@ class ds {
|
|
|
5143
5176
|
/**
|
|
5144
5177
|
* 按路径获取对象值(支持 a.b[0].c 语法)
|
|
5145
5178
|
*/
|
|
5146
|
-
static getValueByPath(t,
|
|
5147
|
-
if (t == null || !
|
|
5179
|
+
static getValueByPath(t, r, i) {
|
|
5180
|
+
if (t == null || !r) return i;
|
|
5148
5181
|
const y = [];
|
|
5149
|
-
|
|
5182
|
+
r.replace(/\[(\d+)\]/g, ".$1").split(".").forEach((l) => {
|
|
5150
5183
|
l.trim() && y.push(l.trim());
|
|
5151
5184
|
});
|
|
5152
5185
|
let s = t;
|
|
@@ -5160,39 +5193,39 @@ class ds {
|
|
|
5160
5193
|
* 深度遍历组件树(纯函数递归版本)
|
|
5161
5194
|
* 用于单独处理某个组件树片段
|
|
5162
5195
|
*/
|
|
5163
|
-
static traverseTree(t,
|
|
5196
|
+
static traverseTree(t, r, i) {
|
|
5164
5197
|
const y = Array.isArray(t) ? t : [t];
|
|
5165
5198
|
for (const s of y)
|
|
5166
|
-
|
|
5199
|
+
r(s, i) !== !1 && s.children && s.children.length > 0 && ds.traverseTree(s.children, r, s);
|
|
5167
5200
|
}
|
|
5168
5201
|
/** 创建 DataSource */
|
|
5169
5202
|
static createDataSource = Kn;
|
|
5170
|
-
static validateDataSource =
|
|
5203
|
+
static validateDataSource = Ni;
|
|
5171
5204
|
/** 创建 Component */
|
|
5172
5205
|
static createComponent = Bn;
|
|
5173
|
-
static validateComponent =
|
|
5206
|
+
static validateComponent = qi;
|
|
5174
5207
|
/** 创建 Page */
|
|
5175
5208
|
static createPage = Yn;
|
|
5176
|
-
static validatePage =
|
|
5209
|
+
static validatePage = Ti;
|
|
5177
5210
|
/** 创建 Meta/Layout */
|
|
5178
|
-
static createMeta =
|
|
5179
|
-
static createLayout =
|
|
5180
|
-
static validateMeta =
|
|
5181
|
-
static validateLayout =
|
|
5211
|
+
static createMeta = Qn;
|
|
5212
|
+
static createLayout = xn;
|
|
5213
|
+
static validateMeta = Mi;
|
|
5214
|
+
static validateLayout = Ai;
|
|
5182
5215
|
/** 创建 Variables */
|
|
5183
5216
|
static createVariables = Zn;
|
|
5184
|
-
static validateVariables =
|
|
5217
|
+
static validateVariables = Vi;
|
|
5185
5218
|
/** 创建 Dependency */
|
|
5186
5219
|
static createDependency = as;
|
|
5187
|
-
static validateDependency =
|
|
5220
|
+
static validateDependency = zi;
|
|
5188
5221
|
/** 创建 Registry 组件项 */
|
|
5189
5222
|
static createRegistryComponent = cs;
|
|
5190
|
-
static validateRegistryComponent =
|
|
5223
|
+
static validateRegistryComponent = Fi;
|
|
5191
5224
|
/** 顶层导入/导出 验证(基于 JSON Schema)*/
|
|
5192
|
-
static importCIC =
|
|
5193
|
-
static exportCIC =
|
|
5225
|
+
static importCIC = Ui;
|
|
5226
|
+
static exportCIC = Ji;
|
|
5194
5227
|
static validateCIC = qt;
|
|
5195
|
-
static importCICAsync =
|
|
5228
|
+
static importCICAsync = Ki;
|
|
5196
5229
|
}
|
|
5197
5230
|
export {
|
|
5198
5231
|
ds as CICSDK
|