@anov/cic-standard-sdk 0.0.12 → 0.0.13
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 +1095 -1079
- package/dist/cic-sdk.umd.js +4 -4
- package/dist/sdk/generators/common.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, y) => `${c}${y}`, "");
|
|
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, y) => (y instanceof r && (c[y.str] = (c[y.str] || 0) + 1), c), {});
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
e._Code = i, e.nil = new i("");
|
|
51
|
-
function
|
|
51
|
+
function g(u, ...n) {
|
|
52
52
|
const c = [u[0]];
|
|
53
|
-
let
|
|
54
|
-
for (;
|
|
55
|
-
d(c,
|
|
53
|
+
let y = 0;
|
|
54
|
+
for (; y < n.length; )
|
|
55
|
+
d(c, n[y]), c.push(u[++y]);
|
|
56
56
|
return new i(c);
|
|
57
57
|
}
|
|
58
|
-
e._ =
|
|
58
|
+
e._ = g;
|
|
59
59
|
const s = new i("+");
|
|
60
|
-
function l(u, ...
|
|
60
|
+
function l(u, ...n) {
|
|
61
61
|
const c = [v(u[0])];
|
|
62
|
-
let
|
|
63
|
-
for (;
|
|
64
|
-
c.push(s), d(c,
|
|
62
|
+
let y = 0;
|
|
63
|
+
for (; y < n.length; )
|
|
64
|
+
c.push(s), d(c, n[y]), c.push(s, v(u[++y]));
|
|
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) {
|
|
@@ -109,7 +109,7 @@ function Et() {
|
|
|
109
109
|
}
|
|
110
110
|
e.safeStringify = v;
|
|
111
111
|
function b(u) {
|
|
112
|
-
return typeof u == "string" && e.IDENTIFIER.test(u) ? new i(`.${u}`) :
|
|
112
|
+
return typeof u == "string" && e.IDENTIFIER.test(u) ? new i(`.${u}`) : g`[${u}]`;
|
|
113
113
|
}
|
|
114
114
|
e.getProperty = b;
|
|
115
115
|
function h(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
|
}
|
|
@@ -142,7 +142,7 @@ function ur() {
|
|
|
142
142
|
let: new t.Name("let"),
|
|
143
143
|
var: new t.Name("var")
|
|
144
144
|
};
|
|
145
|
-
class
|
|
145
|
+
class g {
|
|
146
146
|
constructor({ prefixes: w, parent: $ } = {}) {
|
|
147
147
|
this._names = {}, this._prefixes = w, this._parent = $;
|
|
148
148
|
}
|
|
@@ -163,7 +163,7 @@ function ur() {
|
|
|
163
163
|
return this._names[w] = { prefix: w, index: 0 };
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
e.Scope =
|
|
166
|
+
e.Scope = g;
|
|
167
167
|
class s extends t.Name {
|
|
168
168
|
constructor(w, $) {
|
|
169
169
|
super($), this.prefix = w;
|
|
@@ -174,7 +174,7 @@ function ur() {
|
|
|
174
174
|
}
|
|
175
175
|
e.ValueScopeName = s;
|
|
176
176
|
const l = (0, t._)`\n`;
|
|
177
|
-
class d extends
|
|
177
|
+
class d extends g {
|
|
178
178
|
constructor(w) {
|
|
179
179
|
super(w), this._values = {}, this._scope = w.scope, this.opts = { ...w, _n: w.lines ? l : t.nil };
|
|
180
180
|
}
|
|
@@ -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._;
|
|
@@ -270,15 +270,15 @@ function G() {
|
|
|
270
270
|
} }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
|
|
271
271
|
return i.Name;
|
|
272
272
|
} });
|
|
273
|
-
var
|
|
273
|
+
var g = ur();
|
|
274
274
|
Object.defineProperty(e, "Scope", { enumerable: !0, get: function() {
|
|
275
|
-
return
|
|
275
|
+
return g.Scope;
|
|
276
276
|
} }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() {
|
|
277
|
-
return
|
|
277
|
+
return g.ValueScope;
|
|
278
278
|
} }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() {
|
|
279
|
-
return
|
|
279
|
+
return g.ValueScopeName;
|
|
280
280
|
} }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() {
|
|
281
|
-
return
|
|
281
|
+
return g.varKinds;
|
|
282
282
|
} }), e.operators = {
|
|
283
283
|
GT: new t._Code(">"),
|
|
284
284
|
GTE: new t._Code(">="),
|
|
@@ -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
|
|
477
|
+
class y 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
|
|
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 y(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,26 +814,26 @@ 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
|
-
return typeof m == "boolean" ? m : Object.keys(m).length === 0 ? !0 : (
|
|
825
|
+
return typeof m == "boolean" ? m : Object.keys(m).length === 0 ? !0 : (g(o, m), !s(m, o.self.RULES.all));
|
|
826
826
|
}
|
|
827
827
|
H.alwaysValidSchema = i;
|
|
828
|
-
function
|
|
828
|
+
function g(o, m = o.schema) {
|
|
829
829
|
const { opts: P, self: O } = o;
|
|
830
830
|
if (!P.strictSchema || typeof m == "boolean")
|
|
831
831
|
return;
|
|
832
832
|
const T = O.RULES.keywords;
|
|
833
833
|
for (const z in m)
|
|
834
|
-
T[z] ||
|
|
834
|
+
T[z] || y(o, `unknown keyword: "${z}"`);
|
|
835
835
|
}
|
|
836
|
-
H.checkUnknownRules =
|
|
836
|
+
H.checkUnknownRules = g;
|
|
837
837
|
function s(o, m) {
|
|
838
838
|
if (typeof o == "boolean")
|
|
839
839
|
return !o;
|
|
@@ -929,26 +929,26 @@ 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);
|
|
942
942
|
}
|
|
943
943
|
H.getErrorPath = c;
|
|
944
|
-
function
|
|
944
|
+
function y(o, m, P = o.opts.strictSchema) {
|
|
945
945
|
if (P) {
|
|
946
946
|
if (m = `strict mode: ${m}`, P === !0)
|
|
947
947
|
throw new Error(m);
|
|
948
948
|
o.self.logger.warn(m);
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
|
-
return H.checkStrictMode =
|
|
951
|
+
return H.checkStrictMode = y, H;
|
|
952
952
|
}
|
|
953
953
|
var Fe = {}, pr;
|
|
954
954
|
function Se() {
|
|
@@ -989,42 +989,42 @@ 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
|
|
999
|
-
const { it:
|
|
1000
|
-
c ?? (m || P) ? f(o, O) : w(
|
|
998
|
+
function g(a, u = e.keywordError, n, c) {
|
|
999
|
+
const { it: y } = a, { gen: o, compositeRule: m, allErrors: P } = y, O = E(a, u, n);
|
|
1000
|
+
c ?? (m || P) ? f(o, O) : w(y, (0, t._)`[${O}]`);
|
|
1001
1001
|
}
|
|
1002
|
-
e.reportError =
|
|
1003
|
-
function s(a, u = e.keywordError,
|
|
1004
|
-
const { it: c } = a, { gen:
|
|
1005
|
-
f(
|
|
1002
|
+
e.reportError = g;
|
|
1003
|
+
function s(a, u = e.keywordError, n) {
|
|
1004
|
+
const { it: c } = a, { gen: y, compositeRule: o, allErrors: m } = c, P = E(a, u, n);
|
|
1005
|
+
f(y, P), o || m || w(c, i.default.vErrors);
|
|
1006
1006
|
}
|
|
1007
1007
|
e.reportExtraError = s;
|
|
1008
1008
|
function l(a, u) {
|
|
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:
|
|
1013
|
-
if (
|
|
1012
|
+
function d({ gen: a, keyword: u, schemaValue: n, data: c, errsCount: y, it: o }) {
|
|
1013
|
+
if (y === void 0)
|
|
1014
1014
|
throw new Error("ajv implementation error");
|
|
1015
1015
|
const m = a.name("err");
|
|
1016
|
-
a.forRange("i",
|
|
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`,
|
|
1016
|
+
a.forRange("i", y, 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`, 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
|
-
|
|
1026
|
+
const { gen: n, validateName: c, schemaEnv: y } = a;
|
|
1027
|
+
y.$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,
|
|
1044
|
-
const { gen: c, it:
|
|
1045
|
-
v(
|
|
1046
|
-
b(a,
|
|
1043
|
+
function _(a, u, n = {}) {
|
|
1044
|
+
const { gen: c, it: y } = a, o = [
|
|
1045
|
+
v(y, 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:
|
|
1055
|
-
let
|
|
1056
|
-
return
|
|
1054
|
+
function b({ keyword: a, it: { errSchemaPath: u } }, { schemaPath: n, parentSchema: c }) {
|
|
1055
|
+
let y = c ? u : (0, t.str)`${u}/${a}`;
|
|
1056
|
+
return n && (y = (0, t.str)`${y}${(0, r.getErrorPath)(n, r.Type.Str)}`), [$.schemaPath, y];
|
|
1057
1057
|
}
|
|
1058
|
-
function h(a, { params: u, message:
|
|
1059
|
-
const { keyword:
|
|
1060
|
-
c.push([$.keyword,
|
|
1058
|
+
function h(a, { params: u, message: n }, c) {
|
|
1059
|
+
const { keyword: y, data: o, schemaValue: m, it: P } = a, { opts: O, propertyName: T, topSchemaRef: z, schemaPath: C } = P;
|
|
1060
|
+
c.push([$.keyword, y], [$.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,14 +1065,14 @@ 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
|
-
function
|
|
1071
|
+
function g(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
|
-
Ee.topBoolOrEmptySchema =
|
|
1075
|
+
Ee.topBoolOrEmptySchema = g;
|
|
1076
1076
|
function s(d, f) {
|
|
1077
1077
|
const { gen: w, schema: $ } = d;
|
|
1078
1078
|
$ === !1 ? (w.var(f, !1), l(d)) : w.var(f, !0);
|
|
@@ -1094,24 +1094,24 @@ 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
|
|
1102
|
-
return typeof
|
|
1101
|
+
function r(g) {
|
|
1102
|
+
return typeof g == "string" && t.has(g);
|
|
1103
1103
|
}
|
|
1104
|
-
ke.isJSONType =
|
|
1104
|
+
ke.isJSONType = r;
|
|
1105
1105
|
function i() {
|
|
1106
|
-
const
|
|
1106
|
+
const g = {
|
|
1107
1107
|
number: { type: "number", rules: [] },
|
|
1108
1108
|
string: { type: "string", rules: [] },
|
|
1109
1109
|
array: { type: "array", rules: [] },
|
|
1110
1110
|
object: { type: "object", rules: [] }
|
|
1111
1111
|
};
|
|
1112
1112
|
return {
|
|
1113
|
-
types: { ...
|
|
1114
|
-
rules: [{ rules: [] },
|
|
1113
|
+
types: { ...g, integer: !0, boolean: !0, null: !0 },
|
|
1114
|
+
rules: [{ rules: [] }, g.number, g.string, g.array, g.object],
|
|
1115
1115
|
post: { rules: [] },
|
|
1116
1116
|
all: {},
|
|
1117
1117
|
keywords: {}
|
|
@@ -1120,75 +1120,75 @@ 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
|
-
function e({ schema: i, self:
|
|
1127
|
-
const l =
|
|
1126
|
+
function e({ schema: i, self: g }, s) {
|
|
1127
|
+
const l = g.RULES.types[s];
|
|
1128
1128
|
return l && l !== !0 && t(i, l);
|
|
1129
1129
|
}
|
|
1130
1130
|
_e.schemaHasRulesForType = e;
|
|
1131
|
-
function t(i,
|
|
1132
|
-
return
|
|
1131
|
+
function t(i, g) {
|
|
1132
|
+
return g.rules.some((s) => r(i, s));
|
|
1133
1133
|
}
|
|
1134
1134
|
_e.shouldUseGroup = t;
|
|
1135
|
-
function
|
|
1135
|
+
function r(i, g) {
|
|
1136
1136
|
var s;
|
|
1137
|
-
return i[
|
|
1137
|
+
return i[g.keyword] !== void 0 || ((s = g.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(), g = 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:
|
|
1170
|
+
function f(n, c) {
|
|
1171
|
+
const { gen: y, 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
|
-
|
|
1175
|
-
P.length ? E(
|
|
1174
|
+
y.if(T, () => {
|
|
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((y) => w.has(y) || c === "array" && y === "array") : [];
|
|
1184
1184
|
}
|
|
1185
|
-
function E(
|
|
1186
|
-
const { gen: o, data: m, opts: P } =
|
|
1185
|
+
function E(n, c, y) {
|
|
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
|
-
for (const C of
|
|
1188
|
+
for (const C of y)
|
|
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: y }, o) {
|
|
1219
|
+
n.if((0, i._)`${c} !== undefined`, () => n.assign((0, i._)`${c}[${y}]`, o));
|
|
1220
1220
|
}
|
|
1221
|
-
function v(
|
|
1221
|
+
function v(n, c, y, 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,19 +1237,19 @@ 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) {
|
|
1244
|
-
return (0, i.and)((0, i._)`typeof ${c} == "number"`, T,
|
|
1244
|
+
return (0, i.and)((0, i._)`typeof ${c} == "number"`, T, y ? (0, i._)`isFinite(${c})` : i.nil);
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
1247
|
se.checkDataType = v;
|
|
1248
|
-
function b(
|
|
1249
|
-
if (
|
|
1250
|
-
return v(
|
|
1248
|
+
function b(n, c, y, o) {
|
|
1249
|
+
if (n.length === 1)
|
|
1250
|
+
return v(n[0], c, y, o);
|
|
1251
1251
|
let m;
|
|
1252
|
-
const P = (0,
|
|
1252
|
+
const P = (0, g.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;
|
|
@@ -1257,31 +1257,31 @@ function kt() {
|
|
|
1257
1257
|
m = i.nil;
|
|
1258
1258
|
P.number && delete P.integer;
|
|
1259
1259
|
for (const O in P)
|
|
1260
|
-
m = (0, i.and)(m, v(O, c,
|
|
1260
|
+
m = (0, i.and)(m, v(O, c, y, o));
|
|
1261
1261
|
return m;
|
|
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:
|
|
1273
|
+
function u(n) {
|
|
1274
|
+
const { gen: c, data: y, schema: o } = n, m = (0, g.schemaRefOrVal)(n, o, "type");
|
|
1275
1275
|
return {
|
|
1276
1276
|
gen: c,
|
|
1277
1277
|
keyword: "type",
|
|
1278
|
-
data:
|
|
1278
|
+
data: y,
|
|
1279
1279
|
schema: o.type,
|
|
1280
1280
|
schemaCode: m,
|
|
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,21 +1291,21 @@ 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
|
|
1295
|
-
const { properties: l, items: d } =
|
|
1294
|
+
function r(g, s) {
|
|
1295
|
+
const { properties: l, items: d } = g.schema;
|
|
1296
1296
|
if (s === "object" && l)
|
|
1297
1297
|
for (const f in l)
|
|
1298
|
-
i(
|
|
1299
|
-
else s === "array" && Array.isArray(d) && d.forEach((f, w) => i(
|
|
1298
|
+
i(g, f, l[f].default);
|
|
1299
|
+
else s === "array" && Array.isArray(d) && d.forEach((f, w) => i(g, w, f.default));
|
|
1300
1300
|
}
|
|
1301
|
-
qe.assignDefaults =
|
|
1302
|
-
function i(
|
|
1303
|
-
const { gen: d, compositeRule: f, data: w, opts: $ } =
|
|
1301
|
+
qe.assignDefaults = r;
|
|
1302
|
+
function i(g, s, l) {
|
|
1303
|
+
const { gen: d, compositeRule: f, data: w, opts: $ } = g;
|
|
1304
1304
|
if (l === void 0)
|
|
1305
1305
|
return;
|
|
1306
1306
|
const E = (0, e._)`${w}${(0, e.getProperty)(s)}`;
|
|
1307
1307
|
if (f) {
|
|
1308
|
-
(0, t.checkStrictMode)(
|
|
1308
|
+
(0, t.checkStrictMode)(g, `default is ignored for: ${E}`);
|
|
1309
1309
|
return;
|
|
1310
1310
|
}
|
|
1311
1311
|
let _ = (0, e._)`${E} === undefined`;
|
|
@@ -1317,85 +1317,85 @@ 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
|
|
1322
|
-
const { gen:
|
|
1323
|
-
|
|
1324
|
-
|
|
1320
|
+
const e = G(), t = Y(), r = Se(), i = Y();
|
|
1321
|
+
function g(n, c) {
|
|
1322
|
+
const { gen: y, data: o, it: m } = n;
|
|
1323
|
+
y.if($(y, o, c, m.opts.ownProperties), () => {
|
|
1324
|
+
n.setParams({ missingProperty: (0, e._)`${c}` }, !0), n.error();
|
|
1325
1325
|
});
|
|
1326
1326
|
}
|
|
1327
|
-
Z.checkReportMissingProp =
|
|
1328
|
-
function s({ gen:
|
|
1329
|
-
return (0, e.or)(...o.map((P) => (0, e.and)($(
|
|
1327
|
+
Z.checkReportMissingProp = g;
|
|
1328
|
+
function s({ gen: n, data: c, it: { opts: y } }, o, m) {
|
|
1329
|
+
return (0, e.or)(...o.map((P) => (0, e.and)($(n, c, P, y.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, y) {
|
|
1345
|
+
return (0, e._)`${d(n)}.call(${c}, ${y})`;
|
|
1346
1346
|
}
|
|
1347
1347
|
Z.isOwnProperty = f;
|
|
1348
|
-
function w(
|
|
1349
|
-
const m = (0, e._)`${c}${(0, e.getProperty)(
|
|
1350
|
-
return o ? (0, e._)`${m} && ${f(
|
|
1348
|
+
function w(n, c, y, o) {
|
|
1349
|
+
const m = (0, e._)`${c}${(0, e.getProperty)(y)} !== undefined`;
|
|
1350
|
+
return o ? (0, e._)`${m} && ${f(n, c, y)}` : m;
|
|
1351
1351
|
}
|
|
1352
1352
|
Z.propertyInData = w;
|
|
1353
|
-
function $(
|
|
1354
|
-
const m = (0, e._)`${c}${(0, e.getProperty)(
|
|
1355
|
-
return o ? (0, e.or)(m, (0, e.not)(f(
|
|
1353
|
+
function $(n, c, y, o) {
|
|
1354
|
+
const m = (0, e._)`${c}${(0, e.getProperty)(y)} === undefined`;
|
|
1355
|
+
return o ? (0, e.or)(m, (0, e.not)(f(n, c, y))) : 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((
|
|
1362
|
+
function _(n, c) {
|
|
1363
|
+
return E(c).filter((y) => !(0, t.alwaysValidSchema)(n, c[y]));
|
|
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: y, 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([
|
|
1374
|
-
const L = (0, e._)`${V}, ${
|
|
1373
|
+
O.opts.dynamicRef && F.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
|
|
1374
|
+
const L = (0, e._)`${V}, ${y.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:
|
|
1380
|
-
const o = c.unicodeRegExp ? "u" : "", { regExp: m } = c.code, P = m(
|
|
1381
|
-
return
|
|
1379
|
+
function h({ gen: n, it: { opts: c } }, y) {
|
|
1380
|
+
const o = c.unicodeRegExp ? "u" : "", { regExp: m } = c.code, P = m(y, o);
|
|
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)}(${y}, ${o})`
|
|
1385
1385
|
});
|
|
1386
1386
|
}
|
|
1387
1387
|
Z.usePattern = h;
|
|
1388
|
-
function a(
|
|
1389
|
-
const { gen: c, data:
|
|
1388
|
+
function a(n) {
|
|
1389
|
+
const { gen: c, data: y, 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;
|
|
1393
1393
|
}
|
|
1394
1394
|
return c.var(P, !0), O(() => c.break()), P;
|
|
1395
1395
|
function O(T) {
|
|
1396
|
-
const z = c.const("len", (0, e._)`${
|
|
1396
|
+
const z = c.const("len", (0, e._)`${y}.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:
|
|
1409
|
-
if (!Array.isArray(
|
|
1407
|
+
function u(n) {
|
|
1408
|
+
const { gen: c, schema: y, keyword: o, it: m } = n;
|
|
1409
|
+
if (!Array.isArray(y))
|
|
1410
1410
|
throw new Error("ajv implementation error");
|
|
1411
|
-
if (
|
|
1411
|
+
if (y.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
|
-
c.block(() =>
|
|
1415
|
-
const V =
|
|
1414
|
+
c.block(() => y.forEach((z, C) => {
|
|
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,25 +1426,25 @@ 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(),
|
|
1430
|
-
function
|
|
1431
|
-
const { gen: b, keyword: h, schema: a, parentSchema: u, it:
|
|
1432
|
-
|
|
1429
|
+
const e = G(), t = Se(), r = ge(), i = Dt();
|
|
1430
|
+
function g(_, v) {
|
|
1431
|
+
const { gen: b, keyword: h, schema: a, parentSchema: u, it: n } = _, c = v.macro.call(n.self, a, u, n), y = 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: `${
|
|
1438
|
-
topSchemaRef:
|
|
1437
|
+
errSchemaPath: `${n.errSchemaPath}/${h}`,
|
|
1438
|
+
topSchemaRef: y,
|
|
1439
1439
|
compositeRule: !0
|
|
1440
1440
|
}, o), _.pass(o, () => _.error(!0));
|
|
1441
1441
|
}
|
|
1442
|
-
he.macroKeywordCode =
|
|
1442
|
+
he.macroKeywordCode = g;
|
|
1443
1443
|
function s(_, v) {
|
|
1444
1444
|
var b;
|
|
1445
|
-
const { gen: h, keyword: a, schema: u, parentSchema:
|
|
1446
|
-
f(
|
|
1447
|
-
const o = !c && v.compile ? v.compile.call(
|
|
1445
|
+
const { gen: h, keyword: a, schema: u, parentSchema: n, $data: c, it: y } = _;
|
|
1446
|
+
f(y, v);
|
|
1447
|
+
const o = !c && v.compile ? v.compile.call(y.self, u, n, y) : 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)
|
|
@@ -1456,15 +1456,15 @@ function ps() {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
function T() {
|
|
1458
1458
|
const F = h.let("ruleErrs", null);
|
|
1459
|
-
return h.try(() => C((0, e._)`await `), (L) => h.assign(P, !1).if((0, e._)`${L} instanceof ${
|
|
1459
|
+
return h.try(() => C((0, e._)`await `), (L) => h.assign(P, !1).if((0, e._)`${L} instanceof ${y.ValidationError}`, () => h.assign(F, (0, e._)`${L}.errors`), () => h.throw(L))), F;
|
|
1460
1460
|
}
|
|
1461
1461
|
function z() {
|
|
1462
1462
|
const F = (0, e._)`${m}.errors`;
|
|
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 =
|
|
1467
|
-
h.assign(P, (0, e._)`${F}${(0,
|
|
1466
|
+
const L = y.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,15 +1498,15 @@ 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
|
-
const
|
|
1505
|
+
const y = `keyword "${u}" value is invalid at path "${h}": ` + b.errorsText(a.validateSchema.errors);
|
|
1506
1506
|
if (v.validateSchema === "log")
|
|
1507
|
-
b.logger.error(
|
|
1507
|
+
b.logger.error(y);
|
|
1508
1508
|
else
|
|
1509
|
-
throw new Error(
|
|
1509
|
+
throw new Error(y);
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
1512
|
return he.validateKeywordUsage = E, he;
|
|
@@ -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');
|
|
@@ -1562,49 +1562,49 @@ function ms() {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
1564
|
$e.extendSubschemaData = i;
|
|
1565
|
-
function
|
|
1565
|
+
function g(s, { jtdDiscriminator: l, jtdMetadata: d, compositeRule: f, createErrors: w, allErrors: $ }) {
|
|
1566
1566
|
f !== void 0 && (s.compositeRule = f), w !== void 0 && (s.createErrors = w), $ !== void 0 && (s.allErrors = $), s.jtdDiscriminator = l, s.jtdMetadata = d;
|
|
1567
1567
|
}
|
|
1568
|
-
return $e.extendSubschemaMode =
|
|
1568
|
+
return $e.extendSubschemaMode = g, $e;
|
|
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 !==
|
|
1576
|
-
var i,
|
|
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
|
+
var i, g, s;
|
|
1577
1577
|
if (Array.isArray(t)) {
|
|
1578
|
-
if (i = t.length, i !=
|
|
1579
|
-
for (
|
|
1580
|
-
if (!e(t[
|
|
1578
|
+
if (i = t.length, i != r.length) return !1;
|
|
1579
|
+
for (g = i; g-- !== 0; )
|
|
1580
|
+
if (!e(t[g], r[g])) 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(
|
|
1587
|
-
for (
|
|
1588
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1589
|
-
for (
|
|
1590
|
-
var l = s[
|
|
1591
|
-
if (!e(t[l],
|
|
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
|
+
for (g = i; g-- !== 0; )
|
|
1588
|
+
if (!Object.prototype.hasOwnProperty.call(r, s[g])) return !1;
|
|
1589
|
+
for (g = i; g-- !== 0; ) {
|
|
1590
|
+
var l = s[g];
|
|
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;
|
|
1599
1599
|
function hs() {
|
|
1600
1600
|
if (Sr) return Wt.exports;
|
|
1601
1601
|
Sr = 1;
|
|
1602
|
-
var e = Wt.exports = function(i,
|
|
1603
|
-
typeof
|
|
1602
|
+
var e = Wt.exports = function(i, g, s) {
|
|
1603
|
+
typeof g == "function" && (s = g, g = {}), s = g.cb || s;
|
|
1604
1604
|
var l = typeof s == "function" ? s : s.pre || function() {
|
|
1605
1605
|
}, d = s.post || function() {
|
|
1606
1606
|
};
|
|
1607
|
-
t(
|
|
1607
|
+
t(g, l, d, i, "", i);
|
|
1608
1608
|
};
|
|
1609
1609
|
e.keywords = {
|
|
1610
1610
|
additionalItems: !0,
|
|
@@ -1647,25 +1647,25 @@ function hs() {
|
|
|
1647
1647
|
maxProperties: !0,
|
|
1648
1648
|
minProperties: !0
|
|
1649
1649
|
};
|
|
1650
|
-
function t(i,
|
|
1650
|
+
function t(i, g, s, l, d, f, w, $, E, _) {
|
|
1651
1651
|
if (l && typeof l == "object" && !Array.isArray(l)) {
|
|
1652
|
-
|
|
1652
|
+
g(l, d, f, w, $, E, _);
|
|
1653
1653
|
for (var v in l) {
|
|
1654
1654
|
var b = l[v];
|
|
1655
1655
|
if (Array.isArray(b)) {
|
|
1656
1656
|
if (v in e.arrayKeywords)
|
|
1657
1657
|
for (var h = 0; h < b.length; h++)
|
|
1658
|
-
t(i,
|
|
1658
|
+
t(i, g, s, b[h], d + "/" + v + "/" + h, f, d, v, l, h);
|
|
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,
|
|
1663
|
-
} else (v in e.keywords || i.allKeys && !(v in e.skipKeywords)) && t(i,
|
|
1662
|
+
t(i, g, s, b[a], d + "/" + v + "/" + r(a), f, d, v, l, a);
|
|
1663
|
+
} else (v in e.keywords || i.allKeys && !(v in e.skipKeywords)) && t(i, g, 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",
|
|
@@ -1692,10 +1692,10 @@ function Tt() {
|
|
|
1692
1692
|
"enum",
|
|
1693
1693
|
"const"
|
|
1694
1694
|
]);
|
|
1695
|
-
function
|
|
1695
|
+
function g(h, a = !0) {
|
|
1696
1696
|
return typeof h == "boolean" ? !0 : a === !0 ? !l(h) : a ? d(h) <= a : !1;
|
|
1697
1697
|
}
|
|
1698
|
-
ae.inlineRef =
|
|
1698
|
+
ae.inlineRef = g;
|
|
1699
1699
|
const s = /* @__PURE__ */ new Set([
|
|
1700
1700
|
"$ref",
|
|
1701
1701
|
"$recursiveRef",
|
|
@@ -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), y = { "": 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 = y[F];
|
|
1755
|
+
typeof z[u] == "string" && (x = ie.call(this, z[u])), oe.call(this, z.$anchor), oe.call(this, z.$dynamicAnchor), y[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,213 +1783,213 @@ 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(), g = fs(), s = ps(), l = ms(), d = G(), f = Se(), w = Tt(), $ = Y(), E = Dt();
|
|
1787
1787
|
function _(k) {
|
|
1788
|
-
if (o(k) && (P(k),
|
|
1788
|
+
if (o(k) && (P(k), y(k))) {
|
|
1789
1789
|
a(k);
|
|
1790
1790
|
return;
|
|
1791
1791
|
}
|
|
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,
|
|
1825
|
-
if (o(k) && (P(k),
|
|
1826
|
-
m(k,
|
|
1824
|
+
function c(k, R) {
|
|
1825
|
+
if (o(k) && (P(k), y(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
|
|
1831
|
+
function y({ 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,
|
|
1907
|
-
for (const W of
|
|
1908
|
-
(0,
|
|
1906
|
+
K && (0, g.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,43 +2097,43 @@ 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
|
-
constructor(i,
|
|
2113
|
-
super(l || `can't resolve reference ${s} from id ${
|
|
2112
|
+
constructor(i, g, s, l) {
|
|
2113
|
+
super(l || `can't resolve reference ${s} from id ${g}`), this.missingRef = (0, e.resolveUrl)(i, g, s), this.missingSchema = (0, e.normalizeId)((0, e.getFullPath)(i, this.missingRef));
|
|
2114
2114
|
}
|
|
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(), g = 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: y } = this.opts.code, { ownProperties: o } = this.opts, m = new e.CodeGen(this.scope, { es5: c, lines: y, 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
|
|
2196
|
-
if (
|
|
2197
|
-
return
|
|
2198
|
-
let o = _.call(this, a,
|
|
2194
|
+
n = (0, i.resolveUrl)(this.opts.uriResolver, u, n);
|
|
2195
|
+
const y = a.refs[n];
|
|
2196
|
+
if (y)
|
|
2197
|
+
return y;
|
|
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
|
|
2227
|
-
let
|
|
2228
|
-
if (Object.keys(a.schema).length > 0 && c ===
|
|
2229
|
-
return h.call(this,
|
|
2226
|
+
const n = this.opts.uriResolver.parse(u), c = (0, i._getFullPath)(this.opts.uriResolver, n);
|
|
2227
|
+
let y = (0, i.getFullPath)(this.opts.uriResolver, a.baseId, void 0);
|
|
2228
|
+
if (Object.keys(a.schema).length > 0 && c === y)
|
|
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
|
-
return T && (
|
|
2238
|
+
return T && (y = (0, i.resolveUrl)(this.opts.uriResolver, y, T)), new l({ schema: P, schemaId: O, root: a, baseId: y });
|
|
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:
|
|
2252
|
-
var
|
|
2253
|
-
if (((
|
|
2251
|
+
function h(a, { baseId: u, schema: n, root: c }) {
|
|
2252
|
+
var y;
|
|
2253
|
+
if (((y = a.fragment) === null || y === void 0 ? void 0 : y[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, g.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, g.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) {
|
|
@@ -2303,12 +2303,12 @@ function Nn() {
|
|
|
2303
2303
|
return v;
|
|
2304
2304
|
}
|
|
2305
2305
|
const i = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
2306
|
-
function
|
|
2306
|
+
function g(_) {
|
|
2307
2307
|
return _.length = 0, !0;
|
|
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,29 +2320,29 @@ 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,
|
|
2324
|
-
for (let
|
|
2325
|
-
const o = _[
|
|
2323
|
+
let u = !1, n = !1, c = s;
|
|
2324
|
+
for (let y = 0; y < _.length; y++) {
|
|
2325
|
+
const o = _[y];
|
|
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;
|
|
2332
2332
|
break;
|
|
2333
2333
|
}
|
|
2334
|
-
|
|
2334
|
+
y > 0 && _[y - 1] === ":" && (u = !0), h.push(":");
|
|
2335
2335
|
continue;
|
|
2336
2336
|
} else if (o === "%") {
|
|
2337
2337
|
if (!c(a, h, b))
|
|
2338
2338
|
break;
|
|
2339
|
-
c =
|
|
2339
|
+
c = g;
|
|
2340
2340
|
} else {
|
|
2341
2341
|
a.push(o);
|
|
2342
2342
|
continue;
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
return a.length && (c ===
|
|
2345
|
+
return a.length && (c === g ? 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,12 +2462,12 @@ 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;
|
|
2469
2469
|
}
|
|
2470
|
-
function
|
|
2470
|
+
function g(o) {
|
|
2471
2471
|
return o.secure === !0 ? !0 : o.secure === !1 ? !1 : o.scheme ? o.scheme.length === 3 && (o.scheme[0] === "w" || o.scheme[0] === "W") && (o.scheme[1] === "s" || o.scheme[1] === "S") && (o.scheme[2] === "s" || o.scheme[2] === "S") : !1;
|
|
2472
2472
|
}
|
|
2473
2473
|
function s(o) {
|
|
@@ -2478,10 +2478,10 @@ function Ps() {
|
|
|
2478
2478
|
return (o.port === (m ? 443 : 80) || o.port === "") && (o.port = void 0), o.path || (o.path = "/"), o;
|
|
2479
2479
|
}
|
|
2480
2480
|
function d(o) {
|
|
2481
|
-
return o.secure =
|
|
2481
|
+
return o.secure = g(o), o.resourceName = (o.path || "/") + (o.query ? "?" + o.query : ""), o.path = void 0, o.query = void 0, o;
|
|
2482
2482
|
}
|
|
2483
2483
|
function f(o) {
|
|
2484
|
-
if ((o.port === (
|
|
2484
|
+
if ((o.port === (g(o) ? 443 : 80) || o.port === "") && (o.port = void 0), typeof o.secure == "boolean" && (o.scheme = o.secure ? "wss" : "ws", o.secure = void 0), o.resourceName) {
|
|
2485
2485
|
const [m, P] = o.resourceName.split("?");
|
|
2486
2486
|
o.path = m && m !== "/" ? m : void 0, o.query = P, o.resourceName = void 0;
|
|
2487
2487
|
}
|
|
@@ -2494,7 +2494,7 @@ function Ps() {
|
|
|
2494
2494
|
if (P) {
|
|
2495
2495
|
const O = m.scheme || o.scheme || "urn";
|
|
2496
2496
|
o.nid = P[1].toLowerCase(), o.nss = P[2];
|
|
2497
|
-
const T = `${O}:${m.nid || o.nid}`, z =
|
|
2497
|
+
const T = `${O}:${m.nid || o.nid}`, z = y(T);
|
|
2498
2498
|
o.path = void 0, z && (o = z.parse(o, m));
|
|
2499
2499
|
} else
|
|
2500
2500
|
o.error = o.error || "URN can not be parsed.";
|
|
@@ -2503,7 +2503,7 @@ function Ps() {
|
|
|
2503
2503
|
function $(o, m) {
|
|
2504
2504
|
if (o.nid === void 0)
|
|
2505
2505
|
throw new Error("URN without nid cannot be serialized");
|
|
2506
|
-
const P = m.scheme || o.scheme || "urn", O = o.nid.toLowerCase(), T = `${P}:${m.nid || O}`, z =
|
|
2506
|
+
const P = m.scheme || o.scheme || "urn", O = o.nid.toLowerCase(), T = `${P}:${m.nid || O}`, z = y(T);
|
|
2507
2507
|
z && (o = z.serialize(o, m));
|
|
2508
2508
|
const C = o, V = o.nss;
|
|
2509
2509
|
return C.path = `${O || m.nid}:${V}`, m.skipEscape = !0, C;
|
|
@@ -2576,7 +2576,7 @@ function Ps() {
|
|
|
2576
2576
|
}
|
|
2577
2577
|
);
|
|
2578
2578
|
Object.setPrototypeOf(c, null);
|
|
2579
|
-
function
|
|
2579
|
+
function y(o) {
|
|
2580
2580
|
return o && (c[
|
|
2581
2581
|
/** @type {SchemeName} */
|
|
2582
2582
|
o
|
|
@@ -2586,35 +2586,35 @@ function Ps() {
|
|
|
2586
2586
|
]) || void 0;
|
|
2587
2587
|
}
|
|
2588
2588
|
return Yt = {
|
|
2589
|
-
wsIsSecure:
|
|
2589
|
+
wsIsSecure: g,
|
|
2590
2590
|
SCHEMES: c,
|
|
2591
2591
|
isValidSchemeName: i,
|
|
2592
|
-
getSchemeHandler:
|
|
2592
|
+
getSchemeHandler: y
|
|
2593
2593
|
}, Yt;
|
|
2594
2594
|
}
|
|
2595
2595
|
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: g, 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 =
|
|
2607
|
-
return c.skipEscape = !0, _(
|
|
2605
|
+
function w(a, u, n) {
|
|
2606
|
+
const c = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, y = $(b(a, c), b(u, c), c, !0);
|
|
2607
|
+
return c.skipEscape = !0, _(y, c);
|
|
2608
2608
|
}
|
|
2609
|
-
function $(a, u,
|
|
2610
|
-
const
|
|
2611
|
-
return c || (a = b(_(a,
|
|
2609
|
+
function $(a, u, n, c) {
|
|
2610
|
+
const y = {};
|
|
2611
|
+
return c || (a = b(_(a, n), n), u = b(_(u, n), n)), n = n || {}, !n.tolerant && u.scheme ? (y.scheme = u.scheme, y.userinfo = u.userinfo, y.host = u.host, y.port = u.port, y.path = t(u.path || ""), y.query = u.query) : (u.userinfo !== void 0 || u.host !== void 0 || u.port !== void 0 ? (y.userinfo = u.userinfo, y.host = u.host, y.port = u.port, y.path = t(u.path || ""), y.query = u.query) : (u.path ? (u.path[0] === "/" ? y.path = t(u.path) : ((a.userinfo !== void 0 || a.host !== void 0 || a.port !== void 0) && !a.path ? y.path = "/" + u.path : a.path ? y.path = a.path.slice(0, a.path.lastIndexOf("/") + 1) + u.path : y.path = u.path, y.path = t(y.path)), y.query = u.query) : (y.path = a.path, u.query !== void 0 ? y.query = u.query : y.query = a.query), y.userinfo = a.userinfo, y.host = a.host, y.port = a.port), y.scheme = a.scheme), y.fragment = u.fragment, y;
|
|
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),
|
|
2633
|
-
o && o.serialize && o.serialize(
|
|
2634
|
-
const m = n
|
|
2635
|
-
if (m !== void 0 && (c.reference !== "suffix" &&
|
|
2636
|
-
let P =
|
|
2637
|
-
!c.absolutePath && (!o || !o.absolutePath) && (P = t(P)), m === void 0 && P[0] === "/" && P[1] === "/" && (P = "/%2F" + P.slice(2)),
|
|
2632
|
+
}, c = Object.assign({}, u), y = [], 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 && y.push(n.scheme, ":");
|
|
2634
|
+
const m = r(n);
|
|
2635
|
+
if (m !== void 0 && (c.reference !== "suffix" && y.push("//"), y.push(m), n.path && n.path[0] !== "/" && y.push("/")), n.path !== void 0) {
|
|
2636
|
+
let P = n.path;
|
|
2637
|
+
!c.absolutePath && (!o || !o.absolutePath) && (P = t(P)), m === void 0 && P[0] === "/" && P[1] === "/" && (P = "/%2F" + P.slice(2)), y.push(P);
|
|
2638
2638
|
}
|
|
2639
|
-
return
|
|
2639
|
+
return n.query !== void 0 && y.push("?", n.query), n.fragment !== void 0 && y.push("#", n.fragment), y.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: "",
|
|
@@ -2649,25 +2649,25 @@ function Ss() {
|
|
|
2649
2649
|
query: void 0,
|
|
2650
2650
|
fragment: void 0
|
|
2651
2651
|
};
|
|
2652
|
-
let
|
|
2653
|
-
|
|
2652
|
+
let y = !1;
|
|
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)
|
|
2657
|
-
if (
|
|
2657
|
+
if (g(c.host) === !1) {
|
|
2658
2658
|
const O = e(c.host);
|
|
2659
|
-
c.host = O.host.toLowerCase(),
|
|
2659
|
+
c.host = O.host.toLowerCase(), y = O.isIPV6;
|
|
2660
2660
|
} else
|
|
2661
|
-
|
|
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 (!
|
|
2661
|
+
y = !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", 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) && y === !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(),
|
|
2715
|
+
const i = er(), g = 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,36 +2748,36 @@ 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
|
|
2774
2774
|
};
|
|
2775
2775
|
}
|
|
2776
|
-
class
|
|
2776
|
+
class y {
|
|
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);
|
|
@@ -2824,7 +2824,7 @@ function ks() {
|
|
|
2824
2824
|
try {
|
|
2825
2825
|
return this._compileSchemaEnv(B);
|
|
2826
2826
|
} catch (k) {
|
|
2827
|
-
if (!(k instanceof
|
|
2827
|
+
if (!(k instanceof g.default))
|
|
2828
2828
|
throw k;
|
|
2829
2829
|
return U.call(this, k), await J.call(this, k.missingSchema), N.call(this, B);
|
|
2830
2830
|
}
|
|
@@ -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])
|
|
@@ -3032,11 +3032,11 @@ function ks() {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
3035
|
-
|
|
3036
|
-
function o(M, j, D,
|
|
3035
|
+
y.ValidationError = i.default, y.MissingRefError = g.default, e.default = y;
|
|
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(), g = 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 ===
|
|
3158
|
-
return
|
|
3159
|
-
const c =
|
|
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
|
+
return y();
|
|
3159
|
+
const c = g.resolveRef.call(u, n, v, E);
|
|
3160
3160
|
if (c === void 0)
|
|
3161
3161
|
throw new e.default(_.opts.uriResolver, v, E);
|
|
3162
|
-
if (c instanceof
|
|
3162
|
+
if (c instanceof g.SchemaEnv)
|
|
3163
3163
|
return o(c);
|
|
3164
3164
|
return m(c);
|
|
3165
|
-
function
|
|
3166
|
-
if (b ===
|
|
3165
|
+
function y() {
|
|
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,
|
|
3194
|
-
_ ? c() :
|
|
3193
|
+
const { gen: v, it: b } = w, { allErrors: h, schemaEnv: a, opts: u } = b, n = u.passContext ? i.default.this : r.nil;
|
|
3194
|
+
_ ? c() : y();
|
|
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
|
-
function
|
|
3206
|
-
w.result((0, t.callValidateCode)(w, $,
|
|
3205
|
+
function y() {
|
|
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,38 +3246,38 @@ 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: ${
|
|
3263
|
-
},
|
|
3264
|
-
keyword: Object.keys(
|
|
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
|
+
}, g = {
|
|
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
|
-
return Be.default =
|
|
3274
|
+
return Be.default = g, Be;
|
|
3275
3275
|
}
|
|
3276
3276
|
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",
|
|
@@ -3287,30 +3287,30 @@ function Ns() {
|
|
|
3287
3287
|
params: ({ schemaCode: i }) => (0, e._)`{multipleOf: ${i}}`
|
|
3288
3288
|
},
|
|
3289
3289
|
code(i) {
|
|
3290
|
-
const { gen:
|
|
3290
|
+
const { gen: g, data: s, schemaCode: l, it: d } = i, f = d.opts.multipleOfPrecision, w = g.let("res"), $ = f ? (0, e._)`Math.abs(Math.round(${w}) - ${w}) > 1e-${f}` : (0, e._)`${w} !== parseInt(${w})`;
|
|
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
|
|
3302
|
-
let i = 0,
|
|
3303
|
-
for (;
|
|
3304
|
-
i++, s = t.charCodeAt(
|
|
3301
|
+
const r = t.length;
|
|
3302
|
+
let i = 0, g = 0, s;
|
|
3303
|
+
for (; g < r; )
|
|
3304
|
+
i++, s = t.charCodeAt(g++), s >= 55296 && s <= 56319 && g < r && (s = t.charCodeAt(g), (s & 64512) === 56320 && g++);
|
|
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(), g = {
|
|
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 = g, Qe;
|
|
3331
3331
|
}
|
|
3332
3332
|
var Ze = {}, Ur;
|
|
3333
3333
|
function Ds() {
|
|
@@ -3339,12 +3339,12 @@ function Ds() {
|
|
|
3339
3339
|
schemaType: "string",
|
|
3340
3340
|
$data: !0,
|
|
3341
3341
|
error: {
|
|
3342
|
-
message: ({ schemaCode:
|
|
3343
|
-
params: ({ schemaCode:
|
|
3342
|
+
message: ({ schemaCode: g }) => (0, t.str)`must match pattern "${g}"`,
|
|
3343
|
+
params: ({ schemaCode: g }) => (0, t._)`{pattern: ${g}}`
|
|
3344
3344
|
},
|
|
3345
|
-
code(
|
|
3346
|
-
const { data: s, $data: l, schema: d, schemaCode: f, it: w } =
|
|
3347
|
-
|
|
3345
|
+
code(g) {
|
|
3346
|
+
const { data: s, $data: l, schema: d, schemaCode: f, it: w } = g, $ = w.opts.unicodeRegExp ? "u" : "", E = l ? (0, t._)`(new RegExp(${f}, ${$}))` : (0, e.usePattern)(g, d);
|
|
3347
|
+
g.fail$data((0, t._)`!${E}.test(${s})`);
|
|
3348
3348
|
}
|
|
3349
3349
|
};
|
|
3350
3350
|
return Ze.default = i, Ze;
|
|
@@ -3353,30 +3353,30 @@ 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",
|
|
3360
3360
|
$data: !0,
|
|
3361
3361
|
error: {
|
|
3362
|
-
message({ keyword: i, schemaCode:
|
|
3362
|
+
message({ keyword: i, schemaCode: g }) {
|
|
3363
3363
|
const s = i === "maxProperties" ? "more" : "fewer";
|
|
3364
|
-
return (0, e.str)`must NOT have ${s} than ${
|
|
3364
|
+
return (0, e.str)`must NOT have ${s} than ${g} properties`;
|
|
3365
3365
|
},
|
|
3366
3366
|
params: ({ schemaCode: i }) => (0, e._)`{limit: ${i}}`
|
|
3367
3367
|
},
|
|
3368
3368
|
code(i) {
|
|
3369
|
-
const { keyword:
|
|
3369
|
+
const { keyword: g, data: s, schemaCode: l } = i, d = g === "maxProperties" ? e.operators.GT : e.operators.LT;
|
|
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(), g = {
|
|
3380
3380
|
keyword: "required",
|
|
3381
3381
|
type: "object",
|
|
3382
3382
|
schemaType: "array",
|
|
@@ -3391,66 +3391,66 @@ function Ms() {
|
|
|
3391
3391
|
return;
|
|
3392
3392
|
const v = d.length >= _.loopRequired;
|
|
3393
3393
|
if (E.allErrors ? b() : h(), _.strictRequired) {
|
|
3394
|
-
const
|
|
3395
|
-
for (const
|
|
3396
|
-
if (
|
|
3397
|
-
const o = E.schemaEnv.baseId + E.errSchemaPath, m = `required property "${
|
|
3398
|
-
(0,
|
|
3394
|
+
const n = s.parentSchema.properties, { definedProperties: c } = s.it;
|
|
3395
|
+
for (const y of d)
|
|
3396
|
+
if (n?.[y] === void 0 && !c.has(y)) {
|
|
3397
|
+
const o = E.schemaEnv.baseId + E.errSchemaPath, m = `required property "${y}" is not defined at "${o}" (strictRequired)`;
|
|
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);
|
|
3427
3427
|
}
|
|
3428
3428
|
}
|
|
3429
3429
|
};
|
|
3430
|
-
return et.default =
|
|
3430
|
+
return et.default = g, et;
|
|
3431
3431
|
}
|
|
3432
3432
|
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",
|
|
3440
3440
|
$data: !0,
|
|
3441
3441
|
error: {
|
|
3442
|
-
message({ keyword: i, schemaCode:
|
|
3442
|
+
message({ keyword: i, schemaCode: g }) {
|
|
3443
3443
|
const s = i === "maxItems" ? "more" : "fewer";
|
|
3444
|
-
return (0, e.str)`must NOT have ${s} than ${
|
|
3444
|
+
return (0, e.str)`must NOT have ${s} than ${g} items`;
|
|
3445
3445
|
},
|
|
3446
3446
|
params: ({ schemaCode: i }) => (0, e._)`{limit: ${i}}`
|
|
3447
3447
|
},
|
|
3448
3448
|
code(i) {
|
|
3449
|
-
const { keyword:
|
|
3449
|
+
const { keyword: g, data: s, schemaCode: l } = i, d = g === "maxItems" ? e.operators.GT : e.operators.LT;
|
|
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",
|
|
@@ -3479,23 +3479,23 @@ function Vs() {
|
|
|
3479
3479
|
const b = d.let("valid"), h = E.items ? (0, e.getSchemaTypes)(E.items) : [];
|
|
3480
3480
|
l.block$data(b, a, (0, t._)`${_} === false`), l.ok(b);
|
|
3481
3481
|
function a() {
|
|
3482
|
-
const
|
|
3483
|
-
l.setParams({ i:
|
|
3482
|
+
const y = d.let("i", (0, t._)`${f}.length`), o = d.let("j");
|
|
3483
|
+
l.setParams({ i: y, j: o }), d.assign(b, !0), d.if((0, t._)`${y} > 1`, () => (u() ? n : c)(y, o));
|
|
3484
3484
|
}
|
|
3485
3485
|
function u() {
|
|
3486
|
-
return h.length > 0 && !h.some((
|
|
3486
|
+
return h.length > 0 && !h.some((y) => y === "object" || y === "array");
|
|
3487
3487
|
}
|
|
3488
|
-
function
|
|
3488
|
+
function n(y, 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
|
-
d.for((0, t._)`;${
|
|
3491
|
-
d.let(m, (0, t._)`${f}[${
|
|
3490
|
+
d.for((0, t._)`;${y}--;`, () => {
|
|
3491
|
+
d.let(m, (0, t._)`${f}[${y}]`), 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"`, () => {
|
|
3492
3492
|
d.assign(o, (0, t._)`${O}[${m}]`), l.error(), d.assign(b, !1).break();
|
|
3493
|
-
}).code((0, t._)`${O}[${m}] = ${
|
|
3493
|
+
}).code((0, t._)`${O}[${m}] = ${y}`);
|
|
3494
3494
|
});
|
|
3495
3495
|
}
|
|
3496
|
-
function c(
|
|
3497
|
-
const m = (0,
|
|
3498
|
-
d.label(P).for((0, t._)`;${
|
|
3496
|
+
function c(y, o) {
|
|
3497
|
+
const m = (0, r.useFunc)(d, i.default), P = d.name("outer");
|
|
3498
|
+
d.label(P).for((0, t._)`;${y}--;`, () => d.for((0, t._)`${o} = ${y}; ${o}--;`, () => d.if((0, t._)`${m}(${f}[${y}], ${f}[${o}])`, () => {
|
|
3499
3499
|
l.error(), d.assign(b, !1).break(P);
|
|
3500
3500
|
})));
|
|
3501
3501
|
}
|
|
@@ -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(), g = {
|
|
3511
3511
|
keyword: "const",
|
|
3512
3512
|
$data: !0,
|
|
3513
3513
|
error: {
|
|
@@ -3516,16 +3516,16 @@ 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
|
-
return st.default =
|
|
3522
|
+
return st.default = g, st;
|
|
3523
3523
|
}
|
|
3524
3524
|
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(), g = {
|
|
3529
3529
|
keyword: "enum",
|
|
3530
3530
|
schemaType: "array",
|
|
3531
3531
|
$data: !0,
|
|
@@ -3539,41 +3539,41 @@ 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,
|
|
3549
|
+
const n = l.const("vSchema", $);
|
|
3550
|
+
h = (0, e.or)(...w.map((c, y) => u(n, y)));
|
|
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(
|
|
3557
|
-
const
|
|
3558
|
-
return typeof
|
|
3556
|
+
function u(n, c) {
|
|
3557
|
+
const y = w[c];
|
|
3558
|
+
return typeof y == "object" && y !== null ? (0, e._)`${b()}(${d}, ${n}[${c}])` : (0, e._)`${d} === ${y}`;
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
3561
|
};
|
|
3562
|
-
return it.default =
|
|
3562
|
+
return it.default = g, 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(), g = 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
|
+
g.default,
|
|
3577
3577
|
s.default,
|
|
3578
3578
|
// array
|
|
3579
3579
|
l.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",
|
|
@@ -3605,10 +3605,10 @@ function Cn() {
|
|
|
3605
3605
|
(0, t.checkStrictMode)(d, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
3606
3606
|
return;
|
|
3607
3607
|
}
|
|
3608
|
-
|
|
3608
|
+
g(s, f);
|
|
3609
3609
|
}
|
|
3610
3610
|
};
|
|
3611
|
-
function
|
|
3611
|
+
function g(s, l) {
|
|
3612
3612
|
const { gen: d, schema: f, data: w, keyword: $, it: E } = s;
|
|
3613
3613
|
E.items = !0;
|
|
3614
3614
|
const _ = d.const("len", (0, e._)`${w}.length`);
|
|
@@ -3624,13 +3624,13 @@ function Cn() {
|
|
|
3624
3624
|
});
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
|
-
return
|
|
3627
|
+
return Ie.validateAdditionalItems = g, 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"],
|
|
@@ -3638,11 +3638,11 @@ function qn() {
|
|
|
3638
3638
|
code(s) {
|
|
3639
3639
|
const { schema: l, it: d } = s;
|
|
3640
3640
|
if (Array.isArray(l))
|
|
3641
|
-
return
|
|
3642
|
-
d.items = !0, !(0, t.alwaysValidSchema)(d, l) && s.ok((0,
|
|
3641
|
+
return g(s, "additionalItems", l);
|
|
3642
|
+
d.items = !0, !(0, t.alwaysValidSchema)(d, l) && s.ok((0, r.validateArray)(s));
|
|
3643
3643
|
}
|
|
3644
3644
|
};
|
|
3645
|
-
function
|
|
3645
|
+
function g(s, l, d = s.schema) {
|
|
3646
3646
|
const { gen: f, parentSchema: w, data: $, keyword: E, it: _ } = s;
|
|
3647
3647
|
h(w), _.opts.unevaluated && d.length && _.items !== !0 && (_.items = t.mergeEvaluated.items(f, d.length, _.items));
|
|
3648
3648
|
const v = f.name("valid"), b = f.const("len", (0, e._)`${$}.length`);
|
|
@@ -3654,14 +3654,14 @@ function qn() {
|
|
|
3654
3654
|
}, v)), s.ok(v));
|
|
3655
3655
|
});
|
|
3656
3656
|
function h(a) {
|
|
3657
|
-
const { opts: u, errSchemaPath:
|
|
3658
|
-
if (u.strictTuples && !
|
|
3659
|
-
const o = `"${E}" is ${c}-tuple, but minItems or maxItems/${l} are not specified or different at path "${
|
|
3657
|
+
const { opts: u, errSchemaPath: n } = _, c = d.length, y = c === a.minItems && (c === a.maxItems || a[l] === !1);
|
|
3658
|
+
if (u.strictTuples && !y) {
|
|
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
|
}
|
|
3663
3663
|
}
|
|
3664
|
-
return Oe.validateTuple =
|
|
3664
|
+
return Oe.validateTuple = g, Oe.default = i, Oe;
|
|
3665
3665
|
}
|
|
3666
3666
|
var Xr;
|
|
3667
3667
|
function Us() {
|
|
@@ -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;
|
|
@@ -3707,57 +3707,57 @@ function Js() {
|
|
|
3707
3707
|
before: "uniqueItems",
|
|
3708
3708
|
trackErrors: !0,
|
|
3709
3709
|
error: {
|
|
3710
|
-
message: ({ params: { min:
|
|
3711
|
-
params: ({ params: { min:
|
|
3710
|
+
message: ({ params: { min: g, max: s } }) => s === void 0 ? (0, e.str)`must contain at least ${g} valid item(s)` : (0, e.str)`must contain at least ${g} and no more than ${s} valid item(s)`,
|
|
3711
|
+
params: ({ params: { min: g, max: s } }) => s === void 0 ? (0, e._)`{minContains: ${g}}` : (0, e._)`{minContains: ${g}, maxContains: ${s}}`
|
|
3712
3712
|
},
|
|
3713
|
-
code(
|
|
3714
|
-
const { gen: s, schema: l, parentSchema: d, data: f, it: w } =
|
|
3713
|
+
code(g) {
|
|
3714
|
+
const { gen: s, schema: l, parentSchema: d, data: f, it: w } = g;
|
|
3715
3715
|
let $, E;
|
|
3716
3716
|
const { minContains: _, maxContains: v } = d;
|
|
3717
3717
|
w.opts.next ? ($ = _ === void 0 ? 1 : _, E = v) : $ = 1;
|
|
3718
3718
|
const b = s.const("len", (0, e._)`${f}.length`);
|
|
3719
|
-
if (
|
|
3719
|
+
if (g.setParams({ min: $, max: E }), E === void 0 && $ === 0) {
|
|
3720
3720
|
(0, t.checkStrictMode)(w, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
|
|
3721
3721
|
return;
|
|
3722
3722
|
}
|
|
3723
3723
|
if (E !== void 0 && $ > E) {
|
|
3724
|
-
(0, t.checkStrictMode)(w, '"minContains" > "maxContains" is always invalid'),
|
|
3724
|
+
(0, t.checkStrictMode)(w, '"minContains" > "maxContains" is always invalid'), g.fail();
|
|
3725
3725
|
return;
|
|
3726
3726
|
}
|
|
3727
3727
|
if ((0, t.alwaysValidSchema)(w, l)) {
|
|
3728
3728
|
let c = (0, e._)`${b} >= ${$}`;
|
|
3729
|
-
E !== void 0 && (c = (0, e._)`${c} && ${b} <= ${E}`),
|
|
3729
|
+
E !== void 0 && (c = (0, e._)`${c} && ${b} <= ${E}`), g.pass(c);
|
|
3730
3730
|
return;
|
|
3731
3731
|
}
|
|
3732
3732
|
w.items = !0;
|
|
3733
3733
|
const h = s.name("valid");
|
|
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()),
|
|
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()), g.result(h, () => g.reset());
|
|
3735
3735
|
function a() {
|
|
3736
|
-
const c = s.name("_valid"),
|
|
3737
|
-
u(c, () => s.if(c, () =>
|
|
3736
|
+
const c = s.name("_valid"), y = s.let("count", 0);
|
|
3737
|
+
u(c, () => s.if(c, () => n(y)));
|
|
3738
3738
|
}
|
|
3739
|
-
function u(c,
|
|
3739
|
+
function u(c, y) {
|
|
3740
3740
|
s.forRange("i", 0, b, (o) => {
|
|
3741
|
-
|
|
3741
|
+
g.subschema({
|
|
3742
3742
|
keyword: "contains",
|
|
3743
3743
|
dataProp: o,
|
|
3744
3744
|
dataPropType: t.Type.Num,
|
|
3745
3745
|
compositeRule: !0
|
|
3746
|
-
}, c),
|
|
3746
|
+
}, c), y();
|
|
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";
|
|
@@ -3769,7 +3769,7 @@ function Hs() {
|
|
|
3769
3769
|
deps: ${$}}`
|
|
3770
3770
|
// TODO change to reference
|
|
3771
3771
|
};
|
|
3772
|
-
const
|
|
3772
|
+
const g = {
|
|
3773
3773
|
keyword: "dependencies",
|
|
3774
3774
|
type: "object",
|
|
3775
3775
|
schemaType: "object",
|
|
@@ -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);
|
|
@@ -3823,8 +3823,8 @@ function Hs() {
|
|
|
3823
3823
|
// TODO var
|
|
3824
3824
|
), f.ok(b));
|
|
3825
3825
|
}
|
|
3826
|
-
e.validateSchemaDeps = d, e.default =
|
|
3827
|
-
})(
|
|
3826
|
+
e.validateSchemaDeps = d, e.default = g;
|
|
3827
|
+
})(Qt)), Qt;
|
|
3828
3828
|
}
|
|
3829
3829
|
var ut = {}, nn;
|
|
3830
3830
|
function Gs() {
|
|
@@ -3836,24 +3836,24 @@ function Gs() {
|
|
|
3836
3836
|
schemaType: ["object", "boolean"],
|
|
3837
3837
|
error: {
|
|
3838
3838
|
message: "property name must be valid",
|
|
3839
|
-
params: ({ params:
|
|
3839
|
+
params: ({ params: g }) => (0, e._)`{propertyName: ${g.propertyName}}`
|
|
3840
3840
|
},
|
|
3841
|
-
code(
|
|
3842
|
-
const { gen: s, schema: l, data: d, it: f } =
|
|
3841
|
+
code(g) {
|
|
3842
|
+
const { gen: s, schema: l, data: d, it: f } = g;
|
|
3843
3843
|
if ((0, t.alwaysValidSchema)(f, l))
|
|
3844
3844
|
return;
|
|
3845
3845
|
const w = s.name("valid");
|
|
3846
3846
|
s.forIn("key", d, ($) => {
|
|
3847
|
-
|
|
3847
|
+
g.setParams({ propertyName: $ }), g.subschema({
|
|
3848
3848
|
keyword: "propertyNames",
|
|
3849
3849
|
data: $,
|
|
3850
3850
|
dataTypes: ["string"],
|
|
3851
3851
|
propertyName: $,
|
|
3852
3852
|
compositeRule: !0
|
|
3853
3853
|
}, w), s.if((0, e.not)(w), () => {
|
|
3854
|
-
|
|
3854
|
+
g.error(!0), f.allErrors || s.break();
|
|
3855
3855
|
});
|
|
3856
|
-
}),
|
|
3856
|
+
}), g.ok(w);
|
|
3857
3857
|
}
|
|
3858
3858
|
};
|
|
3859
3859
|
return ut.default = i, ut;
|
|
@@ -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 ?
|
|
3886
|
+
!h.length && !a.length ? y(m) : d.if(n(m), () => y(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");
|
|
@@ -3897,7 +3897,7 @@ function Dn() {
|
|
|
3897
3897
|
function c(m) {
|
|
3898
3898
|
d.code((0, t._)`delete ${$}[${m}]`);
|
|
3899
3899
|
}
|
|
3900
|
-
function
|
|
3900
|
+
function y(m) {
|
|
3901
3901
|
if (b.removeAdditional === "all" || b.removeAdditional && f === !1) {
|
|
3902
3902
|
c(m);
|
|
3903
3903
|
return;
|
|
@@ -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(), g = {
|
|
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");
|
|
@@ -3962,18 +3962,18 @@ function Ws() {
|
|
|
3962
3962
|
}
|
|
3963
3963
|
}
|
|
3964
3964
|
};
|
|
3965
|
-
return ft.default =
|
|
3965
|
+
return ft.default = g, ft;
|
|
3966
3966
|
}
|
|
3967
3967
|
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(), g = {
|
|
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((
|
|
3976
|
+
const { gen: l, schema: d, data: f, parentSchema: w, it: $ } = s, { opts: E } = $, _ = (0, e.allSchemaProperties)(d), v = _.filter((y) => (0, r.alwaysValidSchema)($, d[y]));
|
|
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");
|
|
@@ -3981,20 +3981,20 @@ function Bs() {
|
|
|
3981
3981
|
const { props: a } = $;
|
|
3982
3982
|
u();
|
|
3983
3983
|
function u() {
|
|
3984
|
-
for (const
|
|
3985
|
-
b &&
|
|
3984
|
+
for (const y of _)
|
|
3985
|
+
b && n(y), $.allErrors ? c(y) : (l.var(h, !0), c(y), l.if(h));
|
|
3986
3986
|
}
|
|
3987
|
-
function
|
|
3987
|
+
function n(y) {
|
|
3988
3988
|
for (const o in b)
|
|
3989
|
-
new RegExp(
|
|
3989
|
+
new RegExp(y).test(o) && (0, r.checkStrictMode)($, `property ${o} matches pattern ${y} (use allowMatchingProperties)`);
|
|
3990
3990
|
}
|
|
3991
|
-
function c(
|
|
3991
|
+
function c(y) {
|
|
3992
3992
|
l.forIn("key", f, (o) => {
|
|
3993
|
-
l.if((0, t._)`${(0, e.usePattern)(s,
|
|
3994
|
-
const m = v.includes(
|
|
3993
|
+
l.if((0, t._)`${(0, e.usePattern)(s, y)}.test(${o})`, () => {
|
|
3994
|
+
const m = v.includes(y);
|
|
3995
3995
|
m || s.subschema({
|
|
3996
3996
|
keyword: "patternProperties",
|
|
3997
|
-
schemaProp:
|
|
3997
|
+
schemaProp: y,
|
|
3998
3998
|
dataProp: o,
|
|
3999
3999
|
dataPropType: i.Type.Str
|
|
4000
4000
|
}, h), $.opts.unevaluated && a !== !0 ? l.assign((0, t._)`${a}[${o}]`, !0) : !m && !$.allErrors && l.if((0, t.not)(h), () => l.break());
|
|
@@ -4003,7 +4003,7 @@ function Bs() {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
}
|
|
4005
4005
|
};
|
|
4006
|
-
return pt.default =
|
|
4006
|
+
return pt.default = g, pt;
|
|
4007
4007
|
}
|
|
4008
4008
|
var mt = {}, cn;
|
|
4009
4009
|
function Ys() {
|
|
@@ -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:
|
|
4018
|
-
if ((0, e.alwaysValidSchema)(s,
|
|
4019
|
-
|
|
4016
|
+
code(r) {
|
|
4017
|
+
const { gen: i, schema: g, it: s } = r;
|
|
4018
|
+
if ((0, e.alwaysValidSchema)(s, g)) {
|
|
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 = {
|
|
@@ -4054,25 +4054,25 @@ function Qs() {
|
|
|
4054
4054
|
trackErrors: !0,
|
|
4055
4055
|
error: {
|
|
4056
4056
|
message: "must match exactly one schema in oneOf",
|
|
4057
|
-
params: ({ params:
|
|
4057
|
+
params: ({ params: g }) => (0, e._)`{passingSchemas: ${g.passing}}`
|
|
4058
4058
|
},
|
|
4059
|
-
code(
|
|
4060
|
-
const { gen: s, schema: l, parentSchema: d, it: f } =
|
|
4059
|
+
code(g) {
|
|
4060
|
+
const { gen: s, schema: l, parentSchema: d, it: f } = g;
|
|
4061
4061
|
if (!Array.isArray(l))
|
|
4062
4062
|
throw new Error("ajv implementation error");
|
|
4063
4063
|
if (f.opts.discriminator && d.discriminator)
|
|
4064
4064
|
return;
|
|
4065
4065
|
const w = l, $ = s.let("valid", !1), E = s.let("passing", null), _ = s.name("_valid");
|
|
4066
|
-
|
|
4066
|
+
g.setParams({ passing: E }), s.block(v), g.result($, () => g.reset(), () => g.error(!0));
|
|
4067
4067
|
function v() {
|
|
4068
4068
|
w.forEach((b, h) => {
|
|
4069
4069
|
let a;
|
|
4070
|
-
(0, t.alwaysValidSchema)(f, b) ? s.var(_, !0) : a =
|
|
4070
|
+
(0, t.alwaysValidSchema)(f, b) ? s.var(_, !0) : a = g.subschema({
|
|
4071
4071
|
keyword: "oneOf",
|
|
4072
4072
|
schemaProp: h,
|
|
4073
4073
|
compositeRule: !0
|
|
4074
4074
|
}, _), h > 0 && s.if((0, e._)`${_} && ${$}`).assign($, !1).assign(E, (0, e._)`[${E}, ${h}]`).else(), s.if(_, () => {
|
|
4075
|
-
s.assign($, !0), s.assign(E, h), a &&
|
|
4075
|
+
s.assign($, !0), s.assign(E, h), a && g.mergeEvaluated(a, e.Name);
|
|
4076
4076
|
});
|
|
4077
4077
|
});
|
|
4078
4078
|
}
|
|
@@ -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:
|
|
4092
|
-
if (!Array.isArray(
|
|
4090
|
+
code(r) {
|
|
4091
|
+
const { gen: i, schema: g, it: s } = r;
|
|
4092
|
+
if (!Array.isArray(g))
|
|
4093
4093
|
throw new Error("ajv implementation error");
|
|
4094
4094
|
const l = i.name("valid");
|
|
4095
|
-
|
|
4095
|
+
g.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
|
};
|
|
@@ -4117,7 +4117,7 @@ function Xs() {
|
|
|
4117
4117
|
code(s) {
|
|
4118
4118
|
const { gen: l, parentSchema: d, it: f } = s;
|
|
4119
4119
|
d.then === void 0 && d.else === void 0 && (0, t.checkStrictMode)(f, '"if" without "then" and "else" is ignored');
|
|
4120
|
-
const w =
|
|
4120
|
+
const w = g(f, "then"), $ = g(f, "else");
|
|
4121
4121
|
if (!w && !$)
|
|
4122
4122
|
return;
|
|
4123
4123
|
const E = l.let("valid", !0), _ = l.name("_valid");
|
|
@@ -4143,7 +4143,7 @@ function Xs() {
|
|
|
4143
4143
|
}
|
|
4144
4144
|
}
|
|
4145
4145
|
};
|
|
4146
|
-
function
|
|
4146
|
+
function g(s, l) {
|
|
4147
4147
|
const d = s.schema[l];
|
|
4148
4148
|
return d !== void 0 && !(0, t.alwaysValidSchema)(s, d);
|
|
4149
4149
|
}
|
|
@@ -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)(
|
|
4159
|
+
code({ keyword: r, parentSchema: i, it: g }) {
|
|
4160
|
+
i.if === void 0 && (0, e.checkStrictMode)(g, `"${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(), g = 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(g.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",
|
|
@@ -4200,7 +4200,7 @@ function ri() {
|
|
|
4200
4200
|
message: ({ schemaCode: i }) => (0, e.str)`must match format "${i}"`,
|
|
4201
4201
|
params: ({ schemaCode: i }) => (0, e._)`{format: ${i}}`
|
|
4202
4202
|
},
|
|
4203
|
-
code(i,
|
|
4203
|
+
code(i, g) {
|
|
4204
4204
|
const { gen: s, data: l, $data: d, schema: f, schemaCode: w, it: $ } = i, { opts: E, errSchemaPath: _, schemaEnv: v, self: b } = $;
|
|
4205
4205
|
if (!E.validateFormats)
|
|
4206
4206
|
return;
|
|
@@ -4209,14 +4209,14 @@ 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"), y = s.let("format");
|
|
4213
|
+
s.if((0, e._)`typeof ${n} == "object" && !(${n} instanceof RegExp)`, () => s.assign(c, (0, e._)`${n}.type || "string"`).assign(y, (0, e._)`${n}.validate`), () => s.assign(c, (0, e._)`"string"`).assign(y, n)), i.fail$data((0, e.or)(o(), m()));
|
|
4214
4214
|
function o() {
|
|
4215
|
-
return E.strictSchema === !1 ? e.nil : (0, e._)`${w} && !${
|
|
4215
|
+
return E.strictSchema === !1 ? e.nil : (0, e._)`${w} && !${y}`;
|
|
4216
4216
|
}
|
|
4217
4217
|
function m() {
|
|
4218
|
-
const P = v.$async ? (0, e._)`(${
|
|
4219
|
-
return (0, e._)`${
|
|
4218
|
+
const P = v.$async ? (0, e._)`(${n}.async ? await ${y}(${l}) : ${y}(${l}))` : (0, e._)`${y}(${l})`, O = (0, e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${l}))`;
|
|
4219
|
+
return (0, e._)`${y} && ${y} !== true && ${c} === ${g} && !${O}`;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
4222
4222
|
function a() {
|
|
@@ -4227,8 +4227,8 @@ function ri() {
|
|
|
4227
4227
|
}
|
|
4228
4228
|
if (u === !0)
|
|
4229
4229
|
return;
|
|
4230
|
-
const [
|
|
4231
|
-
|
|
4230
|
+
const [n, c, y] = m(u);
|
|
4231
|
+
n === g && i.pass(P());
|
|
4232
4232
|
function o() {
|
|
4233
4233
|
if (E.strictSchema === !1) {
|
|
4234
4234
|
b.logger.warn(O());
|
|
@@ -4247,14 +4247,14 @@ function ri() {
|
|
|
4247
4247
|
if (typeof u == "object" && !(u instanceof RegExp) && u.async) {
|
|
4248
4248
|
if (!v.$async)
|
|
4249
4249
|
throw new Error("async format in sync schema");
|
|
4250
|
-
return (0, e._)`await ${
|
|
4250
|
+
return (0, e._)`await ${y}(${l})`;
|
|
4251
4251
|
}
|
|
4252
|
-
return typeof c == "function" ? (0, e._)`${
|
|
4252
|
+
return typeof c == "function" ? (0, e._)`${y}(${l})` : (0, e._)`${y}.test(${l})`;
|
|
4253
4253
|
}
|
|
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,13 +4283,13 @@ 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(), g = si(), s = [
|
|
4287
4287
|
e.default,
|
|
4288
4288
|
t.default,
|
|
4289
|
-
(0,
|
|
4289
|
+
(0, r.default)(),
|
|
4290
4290
|
i.default,
|
|
4291
|
-
|
|
4292
|
-
|
|
4291
|
+
g.metadataVocabulary,
|
|
4292
|
+
g.contentVocabulary
|
|
4293
4293
|
];
|
|
4294
4294
|
return Je.default = s, Je;
|
|
4295
4295
|
}
|
|
@@ -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(), g = Y(), l = {
|
|
4310
4310
|
keyword: "discriminator",
|
|
4311
4311
|
type: "object",
|
|
4312
4312
|
schemaType: "object",
|
|
@@ -4328,28 +4328,28 @@ function ai() {
|
|
|
4328
4328
|
const h = f.let("valid", !1), a = f.const("tag", (0, e._)`${w}${(0, e.getProperty)(b)}`);
|
|
4329
4329
|
f.if((0, e._)`typeof ${a} == "string"`, () => u(), () => d.error(!1, { discrError: t.DiscrError.Tag, tag: a, tagName: b })), d.ok(h);
|
|
4330
4330
|
function u() {
|
|
4331
|
-
const
|
|
4331
|
+
const y = c();
|
|
4332
4332
|
f.if(!1);
|
|
4333
|
-
for (const o in
|
|
4334
|
-
f.elseIf((0, e._)`${a} === ${o}`), f.assign(h,
|
|
4333
|
+
for (const o in y)
|
|
4334
|
+
f.elseIf((0, e._)`${a} === ${o}`), f.assign(h, n(y[o]));
|
|
4335
4335
|
f.else(), d.error(!1, { discrError: t.DiscrError.Mapping, tag: a, tagName: b }), f.endIf();
|
|
4336
4336
|
}
|
|
4337
|
-
function
|
|
4338
|
-
const o = f.name("valid"), m = d.subschema({ keyword: "oneOf", schemaProp:
|
|
4337
|
+
function n(y) {
|
|
4338
|
+
const o = f.name("valid"), m = d.subschema({ keyword: "oneOf", schemaProp: y }, o);
|
|
4339
4339
|
return d.mergeEvaluated(m, e.Name), o;
|
|
4340
4340
|
}
|
|
4341
4341
|
function c() {
|
|
4342
|
-
var
|
|
4342
|
+
var y;
|
|
4343
4343
|
const o = {}, m = O(E);
|
|
4344
4344
|
let P = !0;
|
|
4345
4345
|
for (let C = 0; C < v.length; C++) {
|
|
4346
4346
|
let V = v[C];
|
|
4347
|
-
if (V?.$ref && !(0,
|
|
4347
|
+
if (V?.$ref && !(0, g.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
|
-
const F = (
|
|
4352
|
+
const F = (y = V?.properties) === null || y === void 0 ? void 0 : y[b];
|
|
4353
4353
|
if (typeof F != "object")
|
|
4354
4354
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);
|
|
4355
4355
|
P = P && (m || O(V)), T(F, C);
|
|
@@ -4392,10 +4392,10 @@ 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(), g = ai(), s = mi, l = ["/properties"], d = "http://json-schema.org/draft-07/schema";
|
|
4396
|
+
class f extends r.default {
|
|
4397
4397
|
_addVocabularies() {
|
|
4398
|
-
super._addVocabularies(), i.default.forEach((b) => this.addVocabulary(b)), this.opts.discriminator && this.addKeyword(
|
|
4398
|
+
super._addVocabularies(), i.default.forEach((b) => this.addVocabulary(b)), this.opts.discriminator && this.addKeyword(g.default);
|
|
4399
4399
|
}
|
|
4400
4400
|
_addDefaultMetaSchema() {
|
|
4401
4401
|
if (super._addDefaultMetaSchema(), !this.opts.meta)
|
|
@@ -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,16 +4506,16 @@ 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
|
-
const i = /^(\d\d\d\d)-(\d\d)-(\d\d)$/,
|
|
4512
|
+
const i = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, g = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4513
4513
|
function s(C) {
|
|
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 : g[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,13 +4576,13 @@ 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
|
-
const
|
|
4583
|
+
const y = -2147483648, o = 2 ** 31 - 1;
|
|
4584
4584
|
function m(C) {
|
|
4585
|
-
return Number.isInteger(C) && C <= o && C >=
|
|
4585
|
+
return Number.isInteger(C) && C <= o && C >= y;
|
|
4586
4586
|
}
|
|
4587
4587
|
function P(C) {
|
|
4588
4588
|
return Number.isInteger(C);
|
|
@@ -4600,23 +4600,23 @@ 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, g = {
|
|
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 ${g[d].okStr} ${f}`,
|
|
4616
|
+
params: ({ keyword: d, schemaCode: f }) => (0, r._)`{comparison: ${g[d].okStr}, limit: ${f}}`
|
|
4617
4617
|
};
|
|
4618
4618
|
e.formatLimitDefinition = {
|
|
4619
|
-
keyword: Object.keys(
|
|
4619
|
+
keyword: Object.keys(g),
|
|
4620
4620
|
type: "string",
|
|
4621
4621
|
schemaType: "string",
|
|
4622
4622
|
$data: !0,
|
|
@@ -4631,24 +4631,24 @@ function vi() {
|
|
|
4631
4631
|
const c = f.scopeValue("formats", {
|
|
4632
4632
|
ref: b.formats,
|
|
4633
4633
|
code: v.code.formats
|
|
4634
|
-
}),
|
|
4635
|
-
d.fail$data((0,
|
|
4634
|
+
}), y = f.const("fmt", (0, r._)`${c}[${h.schemaCode}]`);
|
|
4635
|
+
d.fail$data((0, r.or)((0, r._)`typeof ${y} != "object"`, (0, r._)`${y} instanceof RegExp`, (0, r._)`typeof ${y}.compare != "function"`, n(y)));
|
|
4636
4636
|
}
|
|
4637
4637
|
function u() {
|
|
4638
|
-
const c = h.schema,
|
|
4639
|
-
if (!
|
|
4638
|
+
const c = h.schema, y = b.formats[c];
|
|
4639
|
+
if (!y || y === !0)
|
|
4640
4640
|
return;
|
|
4641
|
-
if (typeof
|
|
4641
|
+
if (typeof y != "object" || y instanceof RegExp || typeof y.compare != "function")
|
|
4642
4642
|
throw new Error(`"${E}": format "${c}" does not define "compare" function`);
|
|
4643
4643
|
const o = f.scopeValue("formats", {
|
|
4644
4644
|
key: c,
|
|
4645
|
-
ref:
|
|
4646
|
-
code: v.code.formats ? (0,
|
|
4645
|
+
ref: y,
|
|
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}, ${$}) ${g[E].fail} 0`;
|
|
4652
4652
|
}
|
|
4653
4653
|
},
|
|
4654
4654
|
dependencies: ["format"]
|
|
@@ -4661,21 +4661,21 @@ 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(), g = G(), s = new g.Name("fullFormats"), l = new g.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 _;
|
|
4675
4675
|
};
|
|
4676
4676
|
function f(w, $, E, _) {
|
|
4677
4677
|
var v, b;
|
|
4678
|
-
(v = (b = w.opts.code).formats) !== null && v !== void 0 || (b.formats = (0,
|
|
4678
|
+
(v = (b = w.opts.code).formats) !== null && v !== void 0 || (b.formats = (0, g._)`require("ajv-formats/dist/formats").${_}`);
|
|
4679
4679
|
for (const h of $)
|
|
4680
4680
|
w.addFormat(h, E[h]);
|
|
4681
4681
|
}
|
|
@@ -4687,7 +4687,7 @@ const bi = /* @__PURE__ */ jn($i), wi = "http://json-schema.org/draft-07/schema#
|
|
|
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 =
|
|
4749
|
-
|
|
4750
|
+
return { path: a, message: c, keyword: u, params: n };
|
|
4751
|
+
}, r = e.map(t), i = [], g = /* @__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 = g.get(a) || { path: h.path, values: [] }, n = h.params?.allowedValue;
|
|
4755
|
+
n !== void 0 && !u.values.includes(n) && u.values.push(n), g.set(a, u);
|
|
4750
4756
|
} else
|
|
4751
4757
|
i.push(h);
|
|
4752
|
-
for (const [, h] of
|
|
4758
|
+
for (const [, h] of g)
|
|
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
|
+
(y) => y.keyword === ue.REQUIRED && y.params?.missingProperty === u.discriminator
|
|
4789
|
+
)) {
|
|
4790
|
+
for (const y of a)
|
|
4791
|
+
y.keyword === ue.REQUIRED && u.keepRequired.includes(y.params?.missingProperty) && E.push(y);
|
|
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 y = c.keyword === ue.TYPE && (c.path === `${h}${we.VALUE}` || c.path === `${h}${we.DEFAULT}`), o = c.keyword === ue.ADDITIONAL && c.path === h;
|
|
4800
|
+
y || 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,37 +4840,37 @@ 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
|
-
key:
|
|
4845
|
+
key: g,
|
|
4832
4846
|
missingKeys: s,
|
|
4833
4847
|
onSuccess: l
|
|
4834
4848
|
}) => {
|
|
4835
4849
|
const d = t ? t(e) : e, f = d;
|
|
4836
|
-
if (f && typeof f == "object" && typeof f[
|
|
4837
|
-
const w = i[f[
|
|
4850
|
+
if (f && typeof f == "object" && typeof f[g] == "string") {
|
|
4851
|
+
const w = i[f[g]];
|
|
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[g] != "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, g, s, l = [s, "id"]) => Mn({
|
|
4850
4864
|
input: e,
|
|
4851
|
-
normalize: (d) =>
|
|
4865
|
+
normalize: (d) => r(d, t),
|
|
4852
4866
|
base: i,
|
|
4853
|
-
branches:
|
|
4867
|
+
branches: g,
|
|
4854
4868
|
key: s,
|
|
4855
4869
|
missingKeys: l,
|
|
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
|
|
4889
|
-
for (const s of
|
|
4904
|
+
const g = Ri[e] || [`#/definitions/${e}`, `#/$defs/${e}`];
|
|
4905
|
+
for (const s of g)
|
|
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 },
|
|
@@ -4948,48 +4964,48 @@ const An = () => (St || (St = new yi({ allErrors: !0, strict: !1 }), bi(St)), St
|
|
|
4948
4964
|
), as = (e, t) => ir(
|
|
4949
4965
|
e,
|
|
4950
4966
|
t,
|
|
4951
|
-
(i,
|
|
4967
|
+
(i, g) => g?.strict ? i : ye(i, g?.defaults),
|
|
4952
4968
|
Xn,
|
|
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
|
-
return
|
|
4982
|
+
return Li(), Ct(e) ? { ok: !0, value: null } : { ok: !1, errors: ee(Ct.errors || []) };
|
|
4967
4983
|
} catch (t) {
|
|
4968
|
-
const
|
|
4969
|
-
return { ok: !1, errors: ee(
|
|
4984
|
+
const r = [{ path: "", message: t?.message || String(t), keyword: "anyOf", params: {} }];
|
|
4985
|
+
return { ok: !1, errors: ee(r) };
|
|
4970
4986
|
}
|
|
4971
|
-
},
|
|
4987
|
+
}, Ui = (e, t) => {
|
|
4972
4988
|
if (e && typeof e == "object")
|
|
4973
4989
|
return Ae(e, t);
|
|
4974
|
-
const
|
|
4975
|
-
if (!(
|
|
4990
|
+
const r = (e || "").trim();
|
|
4991
|
+
if (!(r.startsWith("{") || r.startsWith("[")))
|
|
4976
4992
|
return { ok: !1, errors: ee([{ path: "", message: "非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入", keyword: "type", params: {} }]) };
|
|
4977
|
-
const
|
|
4978
|
-
return
|
|
4979
|
-
},
|
|
4993
|
+
const g = Xt(r);
|
|
4994
|
+
return g.ok ? Ae(g.value, t) : { ok: !1, errors: g.errors };
|
|
4995
|
+
}, Ki = async (e, t) => {
|
|
4980
4996
|
if (e && typeof e == "object")
|
|
4981
4997
|
return Ae(e, t);
|
|
4982
|
-
const
|
|
4983
|
-
if (
|
|
4984
|
-
const s = Xt(
|
|
4998
|
+
const r = (e || "").trim();
|
|
4999
|
+
if (r.startsWith("{") || r.startsWith("[")) {
|
|
5000
|
+
const s = Xt(r);
|
|
4985
5001
|
return s.ok ? Ae(s.value, t) : { ok: !1, errors: s.errors };
|
|
4986
5002
|
}
|
|
4987
5003
|
if (!(typeof globalThis.fetch == "function"))
|
|
4988
5004
|
return { ok: !1, errors: ee([{ path: "", message: "当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象", keyword: "type", params: {} }]) };
|
|
4989
|
-
if (/^file:\/\//i.test(
|
|
5005
|
+
if (/^file:\/\//i.test(r))
|
|
4990
5006
|
return { ok: !1, errors: ee([{ path: "", message: "不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)", keyword: "type", params: {} }]) };
|
|
4991
5007
|
try {
|
|
4992
|
-
const s = await globalThis.fetch(
|
|
5008
|
+
const s = await globalThis.fetch(r);
|
|
4993
5009
|
if (!s || !s.ok) {
|
|
4994
5010
|
const f = [{ path: "", message: `网络或资源错误:${s?.status} ${s?.statusText || ""}`.trim(), keyword: "type", params: {} }];
|
|
4995
5011
|
return { ok: !1, errors: ee(f) };
|
|
@@ -5000,10 +5016,10 @@ const Fi = () => {
|
|
|
5000
5016
|
const l = [{ path: "", message: `请求失败:${s?.message || s}`, keyword: "type", params: {} }];
|
|
5001
5017
|
return { ok: !1, errors: ee(l) };
|
|
5002
5018
|
}
|
|
5003
|
-
},
|
|
5019
|
+
}, Ji = (e) => {
|
|
5004
5020
|
const t = qt(e);
|
|
5005
5021
|
if (!t.ok) return { ok: !1, errors: t.errors };
|
|
5006
|
-
const
|
|
5022
|
+
const r = {
|
|
5007
5023
|
version: e.version,
|
|
5008
5024
|
meta: e.meta,
|
|
5009
5025
|
pages: e.pages,
|
|
@@ -5012,41 +5028,41 @@ const Fi = () => {
|
|
|
5012
5028
|
deps: e.deps,
|
|
5013
5029
|
extensions: e.extensions
|
|
5014
5030
|
};
|
|
5015
|
-
return { ok: !0, value: JSON.stringify(
|
|
5031
|
+
return { ok: !0, value: JSON.stringify(r, null, 2) };
|
|
5016
5032
|
}, Ae = (e, t) => {
|
|
5017
|
-
const
|
|
5018
|
-
if (!
|
|
5033
|
+
const r = typeof e == "object" ? { ...e } : e, i = [];
|
|
5034
|
+
if (!r || typeof r != "object")
|
|
5019
5035
|
return i.push({ path: "", message: "配置必须为对象", keyword: "type", params: { schema: "object" } }), { ok: !1, errors: ee(i) };
|
|
5020
|
-
if (
|
|
5021
|
-
const
|
|
5022
|
-
if (
|
|
5023
|
-
const l =
|
|
5024
|
-
l.ok ?
|
|
5036
|
+
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) };
|
|
5037
|
+
const g = Qn(r.meta, t?.meta);
|
|
5038
|
+
if (g.ok || i.push(...Pe("/meta", g.errors)), r.meta?.layout) {
|
|
5039
|
+
const l = xn(r.meta.layout, t?.layout);
|
|
5040
|
+
l.ok ? r.meta.layout = l.value : i.push(...Pe("/meta/layout", l.errors));
|
|
5025
5041
|
}
|
|
5026
|
-
if (
|
|
5027
|
-
const l = Zn(
|
|
5028
|
-
l.ok ?
|
|
5042
|
+
if (g.ok && (r.meta = g.value), r.variables) {
|
|
5043
|
+
const l = Zn(r.variables, t?.variables);
|
|
5044
|
+
l.ok ? r.variables = l.value : i.push(...Pe("/variables", l.errors));
|
|
5029
5045
|
}
|
|
5030
|
-
if (
|
|
5046
|
+
if (r.registry?.components) {
|
|
5031
5047
|
const l = [];
|
|
5032
|
-
for (let d = 0; d <
|
|
5033
|
-
const f = cs(
|
|
5048
|
+
for (let d = 0; d < r.registry.components.length; d++) {
|
|
5049
|
+
const f = cs(r.registry.components[d], t?.registry);
|
|
5034
5050
|
f.ok ? l.push(f.value) : i.push(...Pe(`/registry/components[${d}]`, f.errors));
|
|
5035
5051
|
}
|
|
5036
|
-
|
|
5052
|
+
r.registry.components = l;
|
|
5037
5053
|
}
|
|
5038
|
-
if (
|
|
5054
|
+
if (r.deps) {
|
|
5039
5055
|
const l = [];
|
|
5040
|
-
for (let d = 0; d <
|
|
5041
|
-
const f = as(
|
|
5056
|
+
for (let d = 0; d < r.deps.length; d++) {
|
|
5057
|
+
const f = as(r.deps[d], t?.dependency);
|
|
5042
5058
|
f.ok ? l.push(f.value) : i.push(...Pe(`/deps[${d}]`, f.errors));
|
|
5043
5059
|
}
|
|
5044
|
-
|
|
5060
|
+
r.deps = l;
|
|
5045
5061
|
}
|
|
5046
|
-
if (Array.isArray(
|
|
5062
|
+
if (Array.isArray(r.pages)) {
|
|
5047
5063
|
const l = [];
|
|
5048
|
-
for (let d = 0; d <
|
|
5049
|
-
const f =
|
|
5064
|
+
for (let d = 0; d < r.pages.length; d++) {
|
|
5065
|
+
const f = r.pages[d], w = Yn(f, t?.page);
|
|
5050
5066
|
if (!w.ok) {
|
|
5051
5067
|
i.push(...Pe(`/pages[${d}]`, w.errors));
|
|
5052
5068
|
continue;
|
|
@@ -5070,87 +5086,87 @@ const Fi = () => {
|
|
|
5070
5086
|
}
|
|
5071
5087
|
l.push($);
|
|
5072
5088
|
}
|
|
5073
|
-
|
|
5089
|
+
r.pages = l;
|
|
5074
5090
|
}
|
|
5075
5091
|
if (i.length) return { ok: !1, errors: ee(i) };
|
|
5076
|
-
const s = qt(
|
|
5077
|
-
return s.ok ? { ok: !0, value:
|
|
5092
|
+
const s = qt(r);
|
|
5093
|
+
return s.ok ? { ok: !0, value: r } : { ok: !1, errors: s.errors };
|
|
5078
5094
|
};
|
|
5079
5095
|
class ds {
|
|
5080
5096
|
config;
|
|
5081
5097
|
constructor(t) {
|
|
5082
|
-
const
|
|
5083
|
-
if (!
|
|
5084
|
-
throw new Error(`Invalid CIC Configuration: ${JSON.stringify(
|
|
5098
|
+
const r = qt(t);
|
|
5099
|
+
if (!r.ok)
|
|
5100
|
+
throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);
|
|
5085
5101
|
this.config = t;
|
|
5086
5102
|
}
|
|
5087
5103
|
getConfig() {
|
|
5088
5104
|
return this.config;
|
|
5089
5105
|
}
|
|
5090
5106
|
findComponent(t) {
|
|
5091
|
-
let
|
|
5092
|
-
return this.walkComponents((i) => i.id === t ? (
|
|
5107
|
+
let r;
|
|
5108
|
+
return this.walkComponents((i) => i.id === t ? (r = i, !1) : !0), r;
|
|
5093
5109
|
}
|
|
5094
5110
|
findPageByComponent(t) {
|
|
5095
|
-
let
|
|
5096
|
-
return this.walkComponents((i,
|
|
5111
|
+
let r;
|
|
5112
|
+
return this.walkComponents((i, g) => i.id === t ? (r = g, !1) : !0), r;
|
|
5097
5113
|
}
|
|
5098
|
-
getVariable(t,
|
|
5114
|
+
getVariable(t, r) {
|
|
5099
5115
|
const i = this.config.variables;
|
|
5100
5116
|
if (i) {
|
|
5101
5117
|
if (t.componentId && i.component && i.component[t.componentId]) {
|
|
5102
|
-
const
|
|
5103
|
-
if (
|
|
5118
|
+
const g = i.component[t.componentId][r];
|
|
5119
|
+
if (g) return g.value ?? g.default;
|
|
5104
5120
|
}
|
|
5105
5121
|
if (t.pageId && i.page && i.page[t.pageId]) {
|
|
5106
|
-
const
|
|
5107
|
-
if (
|
|
5122
|
+
const g = i.page[t.pageId][r];
|
|
5123
|
+
if (g) return g.value ?? g.default;
|
|
5108
5124
|
}
|
|
5109
|
-
if (i.global && i.global[
|
|
5110
|
-
const
|
|
5111
|
-
return
|
|
5125
|
+
if (i.global && i.global[r]) {
|
|
5126
|
+
const g = i.global[r];
|
|
5127
|
+
return g.value ?? g.default;
|
|
5112
5128
|
}
|
|
5113
5129
|
}
|
|
5114
5130
|
}
|
|
5115
5131
|
getVariableByRef(t) {
|
|
5116
|
-
const
|
|
5117
|
-
if (!
|
|
5118
|
-
const [, i,
|
|
5132
|
+
const r = t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);
|
|
5133
|
+
if (!r) return;
|
|
5134
|
+
const [, i, g, s] = r;
|
|
5119
5135
|
if (i === "global") return this.getVariable({}, s);
|
|
5120
|
-
if (i === "page") return this.getVariable({ pageId:
|
|
5121
|
-
if (i === "component") return this.getVariable({ componentId:
|
|
5136
|
+
if (i === "page") return this.getVariable({ pageId: g }, s);
|
|
5137
|
+
if (i === "component") return this.getVariable({ componentId: g }, s);
|
|
5122
5138
|
}
|
|
5123
5139
|
walkComponents(t) {
|
|
5124
5140
|
if (this.config.pages)
|
|
5125
|
-
for (const
|
|
5141
|
+
for (const r of this.config.pages) {
|
|
5126
5142
|
const i = [];
|
|
5127
|
-
for (const s of
|
|
5143
|
+
for (const s of r.components || [])
|
|
5128
5144
|
i.push({ node: s });
|
|
5129
|
-
let
|
|
5130
|
-
for (; i.length > 0 && !
|
|
5145
|
+
let g = !1;
|
|
5146
|
+
for (; i.length > 0 && !g; ) {
|
|
5131
5147
|
const { node: s, parent: l } = i.pop();
|
|
5132
|
-
if (t(s,
|
|
5133
|
-
|
|
5148
|
+
if (t(s, r, l) === !1) {
|
|
5149
|
+
g = !0;
|
|
5134
5150
|
break;
|
|
5135
5151
|
}
|
|
5136
5152
|
if (s.children && s.children.length > 0)
|
|
5137
5153
|
for (let f = s.children.length - 1; f >= 0; f--)
|
|
5138
5154
|
i.push({ node: s.children[f], parent: s });
|
|
5139
5155
|
}
|
|
5140
|
-
if (
|
|
5156
|
+
if (g) break;
|
|
5141
5157
|
}
|
|
5142
5158
|
}
|
|
5143
5159
|
/**
|
|
5144
5160
|
* 按路径获取对象值(支持 a.b[0].c 语法)
|
|
5145
5161
|
*/
|
|
5146
|
-
static getValueByPath(t,
|
|
5147
|
-
if (t == null || !
|
|
5148
|
-
const
|
|
5149
|
-
|
|
5150
|
-
l.trim() &&
|
|
5162
|
+
static getValueByPath(t, r, i) {
|
|
5163
|
+
if (t == null || !r) return i;
|
|
5164
|
+
const g = [];
|
|
5165
|
+
r.replace(/\[(\d+)\]/g, ".$1").split(".").forEach((l) => {
|
|
5166
|
+
l.trim() && g.push(l.trim());
|
|
5151
5167
|
});
|
|
5152
5168
|
let s = t;
|
|
5153
|
-
for (const l of
|
|
5169
|
+
for (const l of g) {
|
|
5154
5170
|
if (s == null) return i;
|
|
5155
5171
|
s = s[l];
|
|
5156
5172
|
}
|
|
@@ -5160,39 +5176,39 @@ class ds {
|
|
|
5160
5176
|
* 深度遍历组件树(纯函数递归版本)
|
|
5161
5177
|
* 用于单独处理某个组件树片段
|
|
5162
5178
|
*/
|
|
5163
|
-
static traverseTree(t,
|
|
5164
|
-
const
|
|
5165
|
-
for (const s of
|
|
5166
|
-
|
|
5179
|
+
static traverseTree(t, r, i) {
|
|
5180
|
+
const g = Array.isArray(t) ? t : [t];
|
|
5181
|
+
for (const s of g)
|
|
5182
|
+
r(s, i) !== !1 && s.children && s.children.length > 0 && ds.traverseTree(s.children, r, s);
|
|
5167
5183
|
}
|
|
5168
5184
|
/** 创建 DataSource */
|
|
5169
5185
|
static createDataSource = Kn;
|
|
5170
|
-
static validateDataSource =
|
|
5186
|
+
static validateDataSource = Ni;
|
|
5171
5187
|
/** 创建 Component */
|
|
5172
5188
|
static createComponent = Bn;
|
|
5173
|
-
static validateComponent =
|
|
5189
|
+
static validateComponent = qi;
|
|
5174
5190
|
/** 创建 Page */
|
|
5175
5191
|
static createPage = Yn;
|
|
5176
|
-
static validatePage =
|
|
5192
|
+
static validatePage = Ti;
|
|
5177
5193
|
/** 创建 Meta/Layout */
|
|
5178
|
-
static createMeta =
|
|
5179
|
-
static createLayout =
|
|
5180
|
-
static validateMeta =
|
|
5181
|
-
static validateLayout =
|
|
5194
|
+
static createMeta = Qn;
|
|
5195
|
+
static createLayout = xn;
|
|
5196
|
+
static validateMeta = Mi;
|
|
5197
|
+
static validateLayout = Ai;
|
|
5182
5198
|
/** 创建 Variables */
|
|
5183
5199
|
static createVariables = Zn;
|
|
5184
|
-
static validateVariables =
|
|
5200
|
+
static validateVariables = Vi;
|
|
5185
5201
|
/** 创建 Dependency */
|
|
5186
5202
|
static createDependency = as;
|
|
5187
|
-
static validateDependency =
|
|
5203
|
+
static validateDependency = zi;
|
|
5188
5204
|
/** 创建 Registry 组件项 */
|
|
5189
5205
|
static createRegistryComponent = cs;
|
|
5190
|
-
static validateRegistryComponent =
|
|
5206
|
+
static validateRegistryComponent = Fi;
|
|
5191
5207
|
/** 顶层导入/导出 验证(基于 JSON Schema)*/
|
|
5192
|
-
static importCIC =
|
|
5193
|
-
static exportCIC =
|
|
5208
|
+
static importCIC = Ui;
|
|
5209
|
+
static exportCIC = Ji;
|
|
5194
5210
|
static validateCIC = qt;
|
|
5195
|
-
static importCICAsync =
|
|
5211
|
+
static importCICAsync = Ki;
|
|
5196
5212
|
}
|
|
5197
5213
|
export {
|
|
5198
5214
|
ds as CICSDK
|