@reformer/renderer-json 9.0.0-beta.1 → 9.0.0-beta.2
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/{index-Bu5XPCQ7.js → index-DrpWfdbU.js} +24 -14
- package/dist/index.d.ts +11 -4
- package/dist/index.js +541 -162
- package/dist/locale/i18n.d.ts +21 -0
- package/dist/locale/locale-context.d.ts +36 -0
- package/dist/locale/locale-service.d.ts +76 -0
- package/dist/locale/locale-service.test.d.ts +1 -0
- package/dist/locale/use-signal-value.d.ts +15 -0
- package/dist/locale/use-signal-value.test.d.ts +1 -0
- package/dist/operators.d.ts +37 -3
- package/dist/operators.test.d.ts +1 -0
- package/dist/registry/component-registry.d.ts +2 -0
- package/dist/registry/component-registry.test.d.ts +1 -0
- package/dist/registry/constants.d.ts +17 -0
- package/dist/registry/types.d.ts +24 -3
- package/dist/schema/index.d.ts +18 -0
- package/dist/validate.d.ts +5 -1
- package/dist/validate.js +1156 -1155
- package/llms.txt +663 -12
- package/package.json +1 -1
package/dist/validate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as on,
|
|
2
|
-
function
|
|
1
|
+
import { g as on, h as un, j as cn, k as ln, f as dn, p as fn, i as hn } from "./index-DrpWfdbU.js";
|
|
2
|
+
function mn(e) {
|
|
3
3
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
4
|
}
|
|
5
5
|
var Oe = { exports: {} }, bt = {}, he = {}, ge = {}, Et = {}, St = {}, Pt = {}, Ut;
|
|
@@ -26,7 +26,7 @@ function ht() {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
e.Name = S;
|
|
29
|
-
class
|
|
29
|
+
class l extends r {
|
|
30
30
|
constructor(t) {
|
|
31
31
|
super(), this._items = typeof t == "string" ? [t] : t;
|
|
32
32
|
}
|
|
@@ -41,40 +41,40 @@ function ht() {
|
|
|
41
41
|
}
|
|
42
42
|
get str() {
|
|
43
43
|
var t;
|
|
44
|
-
return (t = this._str) !== null && t !== void 0 ? t : this._str = this._items.reduce((i,
|
|
44
|
+
return (t = this._str) !== null && t !== void 0 ? t : this._str = this._items.reduce((i, m) => `${i}${m}`, "");
|
|
45
45
|
}
|
|
46
46
|
get names() {
|
|
47
47
|
var t;
|
|
48
|
-
return (t = this._names) !== null && t !== void 0 ? t : this._names = this._items.reduce((i,
|
|
48
|
+
return (t = this._names) !== null && t !== void 0 ? t : this._names = this._items.reduce((i, m) => (m instanceof S && (i[m.str] = (i[m.str] || 0) + 1), i), {});
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
e._Code =
|
|
52
|
-
function
|
|
51
|
+
e._Code = l, e.nil = new l("");
|
|
52
|
+
function v(o, ...t) {
|
|
53
53
|
const i = [o[0]];
|
|
54
|
-
let
|
|
55
|
-
for (;
|
|
56
|
-
c(i, t[
|
|
57
|
-
return new
|
|
54
|
+
let m = 0;
|
|
55
|
+
for (; m < t.length; )
|
|
56
|
+
c(i, t[m]), i.push(o[++m]);
|
|
57
|
+
return new l(i);
|
|
58
58
|
}
|
|
59
|
-
e._ =
|
|
60
|
-
const s = new
|
|
59
|
+
e._ = v;
|
|
60
|
+
const s = new l("+");
|
|
61
61
|
function f(o, ...t) {
|
|
62
62
|
const i = [y(o[0])];
|
|
63
|
-
let
|
|
64
|
-
for (;
|
|
65
|
-
i.push(s), c(i, t[
|
|
66
|
-
return
|
|
63
|
+
let m = 0;
|
|
64
|
+
for (; m < t.length; )
|
|
65
|
+
i.push(s), c(i, t[m]), i.push(s, y(o[++m]));
|
|
66
|
+
return h(i), new l(i);
|
|
67
67
|
}
|
|
68
68
|
e.str = f;
|
|
69
69
|
function c(o, t) {
|
|
70
|
-
t instanceof
|
|
70
|
+
t instanceof l ? o.push(...t._items) : t instanceof S ? o.push(t) : o.push(P(t));
|
|
71
71
|
}
|
|
72
72
|
e.addCodeArg = c;
|
|
73
|
-
function
|
|
73
|
+
function h(o) {
|
|
74
74
|
let t = 1;
|
|
75
75
|
for (; t < o.length - 1; ) {
|
|
76
76
|
if (o[t] === s) {
|
|
77
|
-
const i =
|
|
77
|
+
const i = $(o[t - 1], o[t + 1]);
|
|
78
78
|
if (i !== void 0) {
|
|
79
79
|
o.splice(t - 1, 3, i);
|
|
80
80
|
continue;
|
|
@@ -84,7 +84,7 @@ function ht() {
|
|
|
84
84
|
t++;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function $(o, t) {
|
|
88
88
|
if (t === '""')
|
|
89
89
|
return o;
|
|
90
90
|
if (o === '""')
|
|
@@ -94,33 +94,33 @@ function ht() {
|
|
|
94
94
|
if (typeof t == "string" && t[0] === '"' && !(o instanceof S))
|
|
95
95
|
return `"${o}${t.slice(1)}`;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function _(o, t) {
|
|
98
98
|
return t.emptyStr() ? o : o.emptyStr() ? t : f`${o}${t}`;
|
|
99
99
|
}
|
|
100
|
-
e.strConcat =
|
|
100
|
+
e.strConcat = _;
|
|
101
101
|
function P(o) {
|
|
102
102
|
return typeof o == "number" || typeof o == "boolean" || o === null ? o : y(Array.isArray(o) ? o.join(",") : o);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return new
|
|
104
|
+
function g(o) {
|
|
105
|
+
return new l(y(o));
|
|
106
106
|
}
|
|
107
|
-
e.stringify =
|
|
107
|
+
e.stringify = g;
|
|
108
108
|
function y(o) {
|
|
109
109
|
return JSON.stringify(o).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
110
110
|
}
|
|
111
111
|
e.safeStringify = y;
|
|
112
112
|
function p(o) {
|
|
113
|
-
return typeof o == "string" && e.IDENTIFIER.test(o) ? new
|
|
113
|
+
return typeof o == "string" && e.IDENTIFIER.test(o) ? new l(`.${o}`) : v`[${o}]`;
|
|
114
114
|
}
|
|
115
115
|
e.getProperty = p;
|
|
116
116
|
function b(o) {
|
|
117
117
|
if (typeof o == "string" && e.IDENTIFIER.test(o))
|
|
118
|
-
return new
|
|
118
|
+
return new l(`${o}`);
|
|
119
119
|
throw new Error(`CodeGen: invalid export name: ${o}, use explicit $id name mapping`);
|
|
120
120
|
}
|
|
121
121
|
e.getEsmExportName = b;
|
|
122
122
|
function a(o) {
|
|
123
|
-
return new
|
|
123
|
+
return new l(o.toString());
|
|
124
124
|
}
|
|
125
125
|
e.regexpCode = a;
|
|
126
126
|
})(Pt)), Pt;
|
|
@@ -131,65 +131,65 @@ function Ft() {
|
|
|
131
131
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
|
|
132
132
|
const r = ht();
|
|
133
133
|
class S extends Error {
|
|
134
|
-
constructor(
|
|
135
|
-
super(`CodeGen: "code" for ${
|
|
134
|
+
constructor($) {
|
|
135
|
+
super(`CodeGen: "code" for ${$} not defined`), this.value = $.value;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
var
|
|
139
|
-
(function(
|
|
140
|
-
|
|
141
|
-
})(
|
|
138
|
+
var l;
|
|
139
|
+
(function(h) {
|
|
140
|
+
h[h.Started = 0] = "Started", h[h.Completed = 1] = "Completed";
|
|
141
|
+
})(l || (e.UsedValueState = l = {})), e.varKinds = {
|
|
142
142
|
const: new r.Name("const"),
|
|
143
143
|
let: new r.Name("let"),
|
|
144
144
|
var: new r.Name("var")
|
|
145
145
|
};
|
|
146
|
-
class
|
|
147
|
-
constructor({ prefixes:
|
|
148
|
-
this._names = {}, this._prefixes =
|
|
146
|
+
class v {
|
|
147
|
+
constructor({ prefixes: $, parent: _ } = {}) {
|
|
148
|
+
this._names = {}, this._prefixes = $, this._parent = _;
|
|
149
149
|
}
|
|
150
|
-
toName(
|
|
151
|
-
return
|
|
150
|
+
toName($) {
|
|
151
|
+
return $ instanceof r.Name ? $ : this.name($);
|
|
152
152
|
}
|
|
153
|
-
name(
|
|
154
|
-
return new r.Name(this._newName(
|
|
153
|
+
name($) {
|
|
154
|
+
return new r.Name(this._newName($));
|
|
155
155
|
}
|
|
156
|
-
_newName(
|
|
157
|
-
const
|
|
158
|
-
return `${
|
|
156
|
+
_newName($) {
|
|
157
|
+
const _ = this._names[$] || this._nameGroup($);
|
|
158
|
+
return `${$}${_.index++}`;
|
|
159
159
|
}
|
|
160
|
-
_nameGroup(
|
|
161
|
-
var
|
|
162
|
-
if (!((P = (
|
|
163
|
-
throw new Error(`CodeGen: prefix "${
|
|
164
|
-
return this._names[
|
|
160
|
+
_nameGroup($) {
|
|
161
|
+
var _, P;
|
|
162
|
+
if (!((P = (_ = this._parent) === null || _ === void 0 ? void 0 : _._prefixes) === null || P === void 0) && P.has($) || this._prefixes && !this._prefixes.has($))
|
|
163
|
+
throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);
|
|
164
|
+
return this._names[$] = { prefix: $, index: 0 };
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
e.Scope =
|
|
167
|
+
e.Scope = v;
|
|
168
168
|
class s extends r.Name {
|
|
169
|
-
constructor(
|
|
170
|
-
super(
|
|
169
|
+
constructor($, _) {
|
|
170
|
+
super(_), this.prefix = $;
|
|
171
171
|
}
|
|
172
|
-
setValue(
|
|
173
|
-
this.value =
|
|
172
|
+
setValue($, { property: _, itemIndex: P }) {
|
|
173
|
+
this.value = $, this.scopePath = (0, r._)`.${new r.Name(_)}[${P}]`;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
e.ValueScopeName = s;
|
|
177
177
|
const f = (0, r._)`\n`;
|
|
178
|
-
class c extends
|
|
179
|
-
constructor(
|
|
180
|
-
super(
|
|
178
|
+
class c extends v {
|
|
179
|
+
constructor($) {
|
|
180
|
+
super($), this._values = {}, this._scope = $.scope, this.opts = { ...$, _n: $.lines ? f : r.nil };
|
|
181
181
|
}
|
|
182
182
|
get() {
|
|
183
183
|
return this._scope;
|
|
184
184
|
}
|
|
185
|
-
name(
|
|
186
|
-
return new s(
|
|
185
|
+
name($) {
|
|
186
|
+
return new s($, this._newName($));
|
|
187
187
|
}
|
|
188
|
-
value(
|
|
188
|
+
value($, _) {
|
|
189
189
|
var P;
|
|
190
|
-
if (
|
|
190
|
+
if (_.ref === void 0)
|
|
191
191
|
throw new Error("CodeGen: ref must be passed in value");
|
|
192
|
-
const
|
|
192
|
+
const g = this.toName($), { prefix: y } = g, p = (P = _.key) !== null && P !== void 0 ? P : _.ref;
|
|
193
193
|
let b = this._values[y];
|
|
194
194
|
if (b) {
|
|
195
195
|
const t = b.get(p);
|
|
@@ -197,49 +197,49 @@ function Ft() {
|
|
|
197
197
|
return t;
|
|
198
198
|
} else
|
|
199
199
|
b = this._values[y] = /* @__PURE__ */ new Map();
|
|
200
|
-
b.set(p,
|
|
200
|
+
b.set(p, g);
|
|
201
201
|
const a = this._scope[y] || (this._scope[y] = []), o = a.length;
|
|
202
|
-
return a[o] =
|
|
202
|
+
return a[o] = _.ref, g.setValue(_, { property: y, itemIndex: o }), g;
|
|
203
203
|
}
|
|
204
|
-
getValue(
|
|
205
|
-
const P = this._values[
|
|
204
|
+
getValue($, _) {
|
|
205
|
+
const P = this._values[$];
|
|
206
206
|
if (P)
|
|
207
|
-
return P.get(
|
|
207
|
+
return P.get(_);
|
|
208
208
|
}
|
|
209
|
-
scopeRefs(
|
|
210
|
-
return this._reduceValues(
|
|
209
|
+
scopeRefs($, _ = this._values) {
|
|
210
|
+
return this._reduceValues(_, (P) => {
|
|
211
211
|
if (P.scopePath === void 0)
|
|
212
212
|
throw new Error(`CodeGen: name "${P}" has no value`);
|
|
213
|
-
return (0, r._)`${
|
|
213
|
+
return (0, r._)`${$}${P.scopePath}`;
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
scopeCode(
|
|
217
|
-
return this._reduceValues(
|
|
218
|
-
if (
|
|
219
|
-
throw new Error(`CodeGen: name "${
|
|
220
|
-
return
|
|
221
|
-
},
|
|
216
|
+
scopeCode($ = this._values, _, P) {
|
|
217
|
+
return this._reduceValues($, (g) => {
|
|
218
|
+
if (g.value === void 0)
|
|
219
|
+
throw new Error(`CodeGen: name "${g}" has no value`);
|
|
220
|
+
return g.value.code;
|
|
221
|
+
}, _, P);
|
|
222
222
|
}
|
|
223
|
-
_reduceValues(
|
|
223
|
+
_reduceValues($, _, P = {}, g) {
|
|
224
224
|
let y = r.nil;
|
|
225
|
-
for (const p in
|
|
226
|
-
const b =
|
|
225
|
+
for (const p in $) {
|
|
226
|
+
const b = $[p];
|
|
227
227
|
if (!b)
|
|
228
228
|
continue;
|
|
229
229
|
const a = P[p] = P[p] || /* @__PURE__ */ new Map();
|
|
230
230
|
b.forEach((o) => {
|
|
231
231
|
if (a.has(o))
|
|
232
232
|
return;
|
|
233
|
-
a.set(o,
|
|
234
|
-
let t =
|
|
233
|
+
a.set(o, l.Started);
|
|
234
|
+
let t = _(o);
|
|
235
235
|
if (t) {
|
|
236
236
|
const i = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
|
|
237
237
|
y = (0, r._)`${y}${i} ${o} = ${t};${this.opts._n}`;
|
|
238
|
-
} else if (t =
|
|
238
|
+
} else if (t = g?.(o))
|
|
239
239
|
y = (0, r._)`${y}${t}${this.opts._n}`;
|
|
240
240
|
else
|
|
241
241
|
throw new S(o);
|
|
242
|
-
a.set(o,
|
|
242
|
+
a.set(o, l.Completed);
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
return y;
|
|
@@ -253,33 +253,33 @@ function J() {
|
|
|
253
253
|
return Kt || (Kt = 1, (function(e) {
|
|
254
254
|
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;
|
|
255
255
|
const r = ht(), S = Ft();
|
|
256
|
-
var
|
|
256
|
+
var l = ht();
|
|
257
257
|
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
258
|
-
return
|
|
258
|
+
return l._;
|
|
259
259
|
} }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
|
|
260
|
-
return
|
|
260
|
+
return l.str;
|
|
261
261
|
} }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() {
|
|
262
|
-
return
|
|
262
|
+
return l.strConcat;
|
|
263
263
|
} }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
|
|
264
|
-
return
|
|
264
|
+
return l.nil;
|
|
265
265
|
} }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() {
|
|
266
|
-
return
|
|
266
|
+
return l.getProperty;
|
|
267
267
|
} }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
|
|
268
|
-
return
|
|
268
|
+
return l.stringify;
|
|
269
269
|
} }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() {
|
|
270
|
-
return
|
|
270
|
+
return l.regexpCode;
|
|
271
271
|
} }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
|
|
272
|
-
return
|
|
272
|
+
return l.Name;
|
|
273
273
|
} });
|
|
274
|
-
var
|
|
274
|
+
var v = Ft();
|
|
275
275
|
Object.defineProperty(e, "Scope", { enumerable: !0, get: function() {
|
|
276
|
-
return
|
|
276
|
+
return v.Scope;
|
|
277
277
|
} }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() {
|
|
278
|
-
return
|
|
278
|
+
return v.ValueScope;
|
|
279
279
|
} }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() {
|
|
280
|
-
return
|
|
280
|
+
return v.ValueScopeName;
|
|
281
281
|
} }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() {
|
|
282
|
-
return
|
|
282
|
+
return v.varKinds;
|
|
283
283
|
} }), e.operators = {
|
|
284
284
|
GT: new r._Code(">"),
|
|
285
285
|
GTE: new r._Code(">="),
|
|
@@ -332,7 +332,7 @@ function J() {
|
|
|
332
332
|
return K(u, this.rhs);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
class
|
|
335
|
+
class h extends c {
|
|
336
336
|
constructor(u, E, I, U) {
|
|
337
337
|
super(u, I, U), this.op = E;
|
|
338
338
|
}
|
|
@@ -340,7 +340,7 @@ function J() {
|
|
|
340
340
|
return `${this.lhs} ${this.op}= ${this.rhs};` + u;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
class
|
|
343
|
+
class $ extends s {
|
|
344
344
|
constructor(u) {
|
|
345
345
|
super(), this.label = u, this.names = {};
|
|
346
346
|
}
|
|
@@ -348,7 +348,7 @@ function J() {
|
|
|
348
348
|
return `${this.label}:` + u;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
class
|
|
351
|
+
class _ extends s {
|
|
352
352
|
constructor(u) {
|
|
353
353
|
super(), this.label = u, this.names = {};
|
|
354
354
|
}
|
|
@@ -367,7 +367,7 @@ function J() {
|
|
|
367
367
|
return this.error.names;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
class
|
|
370
|
+
class g extends s {
|
|
371
371
|
constructor(u) {
|
|
372
372
|
super(), this.code = u;
|
|
373
373
|
}
|
|
@@ -475,7 +475,7 @@ function J() {
|
|
|
475
475
|
return L(super.names, this.iteration.names);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
class
|
|
478
|
+
class m extends t {
|
|
479
479
|
constructor(u, E, I, U) {
|
|
480
480
|
super(), this.varKind = u, this.name = E, this.from = I, this.to = U;
|
|
481
481
|
}
|
|
@@ -503,7 +503,7 @@ function J() {
|
|
|
503
503
|
return L(super.names, this.iterable.names);
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
class
|
|
506
|
+
class d extends p {
|
|
507
507
|
constructor(u, E, I) {
|
|
508
508
|
super(), this.name = u, this.args = E, this.async = I;
|
|
509
509
|
}
|
|
@@ -511,13 +511,13 @@ function J() {
|
|
|
511
511
|
return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(u);
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
|
|
515
|
-
class
|
|
514
|
+
d.kind = "func";
|
|
515
|
+
class w extends y {
|
|
516
516
|
render(u) {
|
|
517
517
|
return "return " + super.render(u);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
|
|
520
|
+
w.kind = "return";
|
|
521
521
|
class j extends p {
|
|
522
522
|
render(u) {
|
|
523
523
|
let E = "try" + super.render(u);
|
|
@@ -605,11 +605,11 @@ function J() {
|
|
|
605
605
|
}
|
|
606
606
|
// `+=` code
|
|
607
607
|
add(u, E) {
|
|
608
|
-
return this._leafNode(new
|
|
608
|
+
return this._leafNode(new h(u, e.operators.ADD, E));
|
|
609
609
|
}
|
|
610
610
|
// appends passed SafeExpr to code or executes Block
|
|
611
611
|
code(u) {
|
|
612
|
-
return typeof u == "function" ? u() : u !== r.nil && this._leafNode(new
|
|
612
|
+
return typeof u == "function" ? u() : u !== r.nil && this._leafNode(new g(u)), this;
|
|
613
613
|
}
|
|
614
614
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
615
615
|
object(...u) {
|
|
@@ -650,7 +650,7 @@ function J() {
|
|
|
650
650
|
// `for` statement for a range of values
|
|
651
651
|
forRange(u, E, I, U, F = this.opts.es5 ? S.varKinds.var : S.varKinds.let) {
|
|
652
652
|
const X = this._scope.toName(u);
|
|
653
|
-
return this._for(new
|
|
653
|
+
return this._for(new m(F, X, E, I), () => U(X));
|
|
654
654
|
}
|
|
655
655
|
// `for-of` statement (in es5 mode replace with a normal for loop)
|
|
656
656
|
forOf(u, E, I, U = S.varKinds.const) {
|
|
@@ -677,18 +677,18 @@ function J() {
|
|
|
677
677
|
}
|
|
678
678
|
// `label` statement
|
|
679
679
|
label(u) {
|
|
680
|
-
return this._leafNode(new
|
|
680
|
+
return this._leafNode(new $(u));
|
|
681
681
|
}
|
|
682
682
|
// `break` statement
|
|
683
683
|
break(u) {
|
|
684
|
-
return this._leafNode(new
|
|
684
|
+
return this._leafNode(new _(u));
|
|
685
685
|
}
|
|
686
686
|
// `return` statement
|
|
687
687
|
return(u) {
|
|
688
|
-
const E = new
|
|
688
|
+
const E = new w();
|
|
689
689
|
if (this._blockNode(E), this.code(u), E.nodes.length !== 1)
|
|
690
690
|
throw new Error('CodeGen: "return" should have one node');
|
|
691
|
-
return this._endBlockNode(
|
|
691
|
+
return this._endBlockNode(w);
|
|
692
692
|
}
|
|
693
693
|
// `try` statement
|
|
694
694
|
try(u, E, I) {
|
|
@@ -721,11 +721,11 @@ function J() {
|
|
|
721
721
|
}
|
|
722
722
|
// `function` heading (or definition if funcBody is passed)
|
|
723
723
|
func(u, E = r.nil, I, U) {
|
|
724
|
-
return this._blockNode(new
|
|
724
|
+
return this._blockNode(new d(u, E, I)), U && this.code(U).endFunc(), this;
|
|
725
725
|
}
|
|
726
726
|
// end function definition
|
|
727
727
|
endFunc() {
|
|
728
|
-
return this._endBlockNode(
|
|
728
|
+
return this._endBlockNode(d);
|
|
729
729
|
}
|
|
730
730
|
optimize(u = 1) {
|
|
731
731
|
for (; u-- > 0; )
|
|
@@ -816,117 +816,117 @@ function Q() {
|
|
|
816
816
|
Lt = 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;
|
|
817
817
|
const e = J(), r = ht();
|
|
818
818
|
function S(n) {
|
|
819
|
-
const
|
|
820
|
-
for (const
|
|
821
|
-
|
|
822
|
-
return
|
|
819
|
+
const d = {};
|
|
820
|
+
for (const w of n)
|
|
821
|
+
d[w] = !0;
|
|
822
|
+
return d;
|
|
823
823
|
}
|
|
824
824
|
H.toHash = S;
|
|
825
|
-
function
|
|
826
|
-
return typeof
|
|
825
|
+
function l(n, d) {
|
|
826
|
+
return typeof d == "boolean" ? d : Object.keys(d).length === 0 ? !0 : (v(n, d), !s(d, n.self.RULES.all));
|
|
827
827
|
}
|
|
828
|
-
H.alwaysValidSchema =
|
|
829
|
-
function
|
|
830
|
-
const { opts:
|
|
831
|
-
if (
|
|
828
|
+
H.alwaysValidSchema = l;
|
|
829
|
+
function v(n, d = n.schema) {
|
|
830
|
+
const { opts: w, self: j } = n;
|
|
831
|
+
if (!w.strictSchema || typeof d == "boolean")
|
|
832
832
|
return;
|
|
833
833
|
const C = j.RULES.keywords;
|
|
834
|
-
for (const D in
|
|
835
|
-
C[D] ||
|
|
834
|
+
for (const D in d)
|
|
835
|
+
C[D] || m(n, `unknown keyword: "${D}"`);
|
|
836
836
|
}
|
|
837
|
-
H.checkUnknownRules =
|
|
838
|
-
function s(n,
|
|
837
|
+
H.checkUnknownRules = v;
|
|
838
|
+
function s(n, d) {
|
|
839
839
|
if (typeof n == "boolean")
|
|
840
840
|
return !n;
|
|
841
|
-
for (const
|
|
842
|
-
if (
|
|
841
|
+
for (const w in n)
|
|
842
|
+
if (d[w])
|
|
843
843
|
return !0;
|
|
844
844
|
return !1;
|
|
845
845
|
}
|
|
846
846
|
H.schemaHasRules = s;
|
|
847
|
-
function f(n,
|
|
847
|
+
function f(n, d) {
|
|
848
848
|
if (typeof n == "boolean")
|
|
849
849
|
return !n;
|
|
850
|
-
for (const
|
|
851
|
-
if (
|
|
850
|
+
for (const w in n)
|
|
851
|
+
if (w !== "$ref" && d.all[w])
|
|
852
852
|
return !0;
|
|
853
853
|
return !1;
|
|
854
854
|
}
|
|
855
855
|
H.schemaHasRulesButRef = f;
|
|
856
|
-
function c({ topSchemaRef: n, schemaPath:
|
|
856
|
+
function c({ topSchemaRef: n, schemaPath: d }, w, j, C) {
|
|
857
857
|
if (!C) {
|
|
858
|
-
if (typeof
|
|
859
|
-
return
|
|
860
|
-
if (typeof
|
|
861
|
-
return (0, e._)`${
|
|
858
|
+
if (typeof w == "number" || typeof w == "boolean")
|
|
859
|
+
return w;
|
|
860
|
+
if (typeof w == "string")
|
|
861
|
+
return (0, e._)`${w}`;
|
|
862
862
|
}
|
|
863
|
-
return (0, e._)`${n}${
|
|
863
|
+
return (0, e._)`${n}${d}${(0, e.getProperty)(j)}`;
|
|
864
864
|
}
|
|
865
865
|
H.schemaRefOrVal = c;
|
|
866
|
-
function
|
|
866
|
+
function h(n) {
|
|
867
867
|
return P(decodeURIComponent(n));
|
|
868
868
|
}
|
|
869
|
-
H.unescapeFragment =
|
|
870
|
-
function
|
|
871
|
-
return encodeURIComponent(
|
|
869
|
+
H.unescapeFragment = h;
|
|
870
|
+
function $(n) {
|
|
871
|
+
return encodeURIComponent(_(n));
|
|
872
872
|
}
|
|
873
|
-
H.escapeFragment =
|
|
874
|
-
function
|
|
873
|
+
H.escapeFragment = $;
|
|
874
|
+
function _(n) {
|
|
875
875
|
return typeof n == "number" ? `${n}` : n.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
876
876
|
}
|
|
877
|
-
H.escapeJsonPointer =
|
|
877
|
+
H.escapeJsonPointer = _;
|
|
878
878
|
function P(n) {
|
|
879
879
|
return n.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
880
880
|
}
|
|
881
881
|
H.unescapeJsonPointer = P;
|
|
882
|
-
function
|
|
882
|
+
function g(n, d) {
|
|
883
883
|
if (Array.isArray(n))
|
|
884
|
-
for (const
|
|
885
|
-
|
|
884
|
+
for (const w of n)
|
|
885
|
+
d(w);
|
|
886
886
|
else
|
|
887
|
-
|
|
887
|
+
d(n);
|
|
888
888
|
}
|
|
889
|
-
H.eachItem =
|
|
890
|
-
function y({ mergeNames: n, mergeToName:
|
|
889
|
+
H.eachItem = g;
|
|
890
|
+
function y({ mergeNames: n, mergeToName: d, mergeValues: w, resultToName: j }) {
|
|
891
891
|
return (C, D, V, L) => {
|
|
892
|
-
const K = V === void 0 ? D : V instanceof e.Name ? (D instanceof e.Name ? n(C, D, V) :
|
|
892
|
+
const K = V === void 0 ? D : V instanceof e.Name ? (D instanceof e.Name ? n(C, D, V) : d(C, D, V), V) : D instanceof e.Name ? (d(C, V, D), D) : w(D, V);
|
|
893
893
|
return L === e.Name && !(K instanceof e.Name) ? j(C, K) : K;
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
896
|
H.mergeEvaluated = {
|
|
897
897
|
props: y({
|
|
898
|
-
mergeNames: (n,
|
|
899
|
-
n.if((0, e._)`${
|
|
898
|
+
mergeNames: (n, d, w) => n.if((0, e._)`${w} !== true && ${d} !== undefined`, () => {
|
|
899
|
+
n.if((0, e._)`${d} === true`, () => n.assign(w, !0), () => n.assign(w, (0, e._)`${w} || {}`).code((0, e._)`Object.assign(${w}, ${d})`));
|
|
900
900
|
}),
|
|
901
|
-
mergeToName: (n,
|
|
902
|
-
|
|
901
|
+
mergeToName: (n, d, w) => n.if((0, e._)`${w} !== true`, () => {
|
|
902
|
+
d === !0 ? n.assign(w, !0) : (n.assign(w, (0, e._)`${w} || {}`), b(n, w, d));
|
|
903
903
|
}),
|
|
904
|
-
mergeValues: (n,
|
|
904
|
+
mergeValues: (n, d) => n === !0 ? !0 : { ...n, ...d },
|
|
905
905
|
resultToName: p
|
|
906
906
|
}),
|
|
907
907
|
items: y({
|
|
908
|
-
mergeNames: (n,
|
|
909
|
-
mergeToName: (n,
|
|
910
|
-
mergeValues: (n,
|
|
911
|
-
resultToName: (n,
|
|
908
|
+
mergeNames: (n, d, w) => n.if((0, e._)`${w} !== true && ${d} !== undefined`, () => n.assign(w, (0, e._)`${d} === true ? true : ${w} > ${d} ? ${w} : ${d}`)),
|
|
909
|
+
mergeToName: (n, d, w) => n.if((0, e._)`${w} !== true`, () => n.assign(w, d === !0 ? !0 : (0, e._)`${w} > ${d} ? ${w} : ${d}`)),
|
|
910
|
+
mergeValues: (n, d) => n === !0 ? !0 : Math.max(n, d),
|
|
911
|
+
resultToName: (n, d) => n.var("items", d)
|
|
912
912
|
})
|
|
913
913
|
};
|
|
914
|
-
function p(n,
|
|
915
|
-
if (
|
|
914
|
+
function p(n, d) {
|
|
915
|
+
if (d === !0)
|
|
916
916
|
return n.var("props", !0);
|
|
917
|
-
const
|
|
918
|
-
return
|
|
917
|
+
const w = n.var("props", (0, e._)`{}`);
|
|
918
|
+
return d !== void 0 && b(n, w, d), w;
|
|
919
919
|
}
|
|
920
920
|
H.evaluatedPropsToName = p;
|
|
921
|
-
function b(n,
|
|
922
|
-
Object.keys(
|
|
921
|
+
function b(n, d, w) {
|
|
922
|
+
Object.keys(w).forEach((j) => n.assign((0, e._)`${d}${(0, e.getProperty)(j)}`, !0));
|
|
923
923
|
}
|
|
924
924
|
H.setEvaluated = b;
|
|
925
925
|
const a = {};
|
|
926
|
-
function o(n,
|
|
926
|
+
function o(n, d) {
|
|
927
927
|
return n.scopeValue("func", {
|
|
928
|
-
ref:
|
|
929
|
-
code: a[
|
|
928
|
+
ref: d,
|
|
929
|
+
code: a[d.code] || (a[d.code] = new r._Code(d.code))
|
|
930
930
|
});
|
|
931
931
|
}
|
|
932
932
|
H.useFunc = o;
|
|
@@ -934,22 +934,22 @@ function Q() {
|
|
|
934
934
|
(function(n) {
|
|
935
935
|
n[n.Num = 0] = "Num", n[n.Str = 1] = "Str";
|
|
936
936
|
})(t || (H.Type = t = {}));
|
|
937
|
-
function i(n,
|
|
937
|
+
function i(n, d, w) {
|
|
938
938
|
if (n instanceof e.Name) {
|
|
939
|
-
const j =
|
|
940
|
-
return
|
|
939
|
+
const j = d === t.Num;
|
|
940
|
+
return w ? j ? (0, e._)`"[" + ${n} + "]"` : (0, e._)`"['" + ${n} + "']"` : j ? (0, e._)`"/" + ${n}` : (0, e._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
941
941
|
}
|
|
942
|
-
return
|
|
942
|
+
return w ? (0, e.getProperty)(n).toString() : "/" + _(n);
|
|
943
943
|
}
|
|
944
944
|
H.getErrorPath = i;
|
|
945
|
-
function
|
|
946
|
-
if (
|
|
947
|
-
if (
|
|
948
|
-
throw new Error(
|
|
949
|
-
n.self.logger.warn(
|
|
945
|
+
function m(n, d, w = n.opts.strictSchema) {
|
|
946
|
+
if (w) {
|
|
947
|
+
if (d = `strict mode: ${d}`, w === !0)
|
|
948
|
+
throw new Error(d);
|
|
949
|
+
n.self.logger.warn(d);
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
return H.checkStrictMode =
|
|
952
|
+
return H.checkStrictMode = m, H;
|
|
953
953
|
}
|
|
954
954
|
var je = {}, Ht;
|
|
955
955
|
function _e() {
|
|
@@ -990,44 +990,44 @@ var Gt;
|
|
|
990
990
|
function pt() {
|
|
991
991
|
return Gt || (Gt = 1, (function(e) {
|
|
992
992
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
|
|
993
|
-
const r = J(), S = Q(),
|
|
993
|
+
const r = J(), S = Q(), l = _e();
|
|
994
994
|
e.keywordError = {
|
|
995
995
|
message: ({ keyword: a }) => (0, r.str)`must pass "${a}" keyword validation`
|
|
996
996
|
}, e.keyword$DataError = {
|
|
997
997
|
message: ({ keyword: a, schemaType: o }) => o ? (0, r.str)`"${a}" keyword must be ${o} ($data)` : (0, r.str)`"${a}" keyword is invalid ($data)`
|
|
998
998
|
};
|
|
999
|
-
function
|
|
1000
|
-
const { it:
|
|
1001
|
-
i ?? (
|
|
999
|
+
function v(a, o = e.keywordError, t, i) {
|
|
1000
|
+
const { it: m } = a, { gen: n, compositeRule: d, allErrors: w } = m, j = P(a, o, t);
|
|
1001
|
+
i ?? (d || w) ? h(n, j) : $(m, (0, r._)`[${j}]`);
|
|
1002
1002
|
}
|
|
1003
|
-
e.reportError =
|
|
1003
|
+
e.reportError = v;
|
|
1004
1004
|
function s(a, o = e.keywordError, t) {
|
|
1005
|
-
const { it: i } = a, { gen:
|
|
1006
|
-
m
|
|
1005
|
+
const { it: i } = a, { gen: m, compositeRule: n, allErrors: d } = i, w = P(a, o, t);
|
|
1006
|
+
h(m, w), n || d || $(i, l.default.vErrors);
|
|
1007
1007
|
}
|
|
1008
1008
|
e.reportExtraError = s;
|
|
1009
1009
|
function f(a, o) {
|
|
1010
|
-
a.assign(
|
|
1010
|
+
a.assign(l.default.errors, o), a.if((0, r._)`${l.default.vErrors} !== null`, () => a.if(o, () => a.assign((0, r._)`${l.default.vErrors}.length`, o), () => a.assign(l.default.vErrors, null)));
|
|
1011
1011
|
}
|
|
1012
1012
|
e.resetErrorsCount = f;
|
|
1013
|
-
function c({ gen: a, keyword: o, schemaValue: t, data: i, errsCount:
|
|
1014
|
-
if (
|
|
1013
|
+
function c({ gen: a, keyword: o, schemaValue: t, data: i, errsCount: m, it: n }) {
|
|
1014
|
+
if (m === void 0)
|
|
1015
1015
|
throw new Error("ajv implementation error");
|
|
1016
|
-
const
|
|
1017
|
-
a.forRange("i",
|
|
1018
|
-
a.const(
|
|
1016
|
+
const d = a.name("err");
|
|
1017
|
+
a.forRange("i", m, l.default.errors, (w) => {
|
|
1018
|
+
a.const(d, (0, r._)`${l.default.vErrors}[${w}]`), a.if((0, r._)`${d}.instancePath === undefined`, () => a.assign((0, r._)`${d}.instancePath`, (0, r.strConcat)(l.default.instancePath, n.errorPath))), a.assign((0, r._)`${d}.schemaPath`, (0, r.str)`${n.errSchemaPath}/${o}`), n.opts.verbose && (a.assign((0, r._)`${d}.schema`, t), a.assign((0, r._)`${d}.data`, i));
|
|
1019
1019
|
});
|
|
1020
1020
|
}
|
|
1021
1021
|
e.extendErrors = c;
|
|
1022
|
-
function
|
|
1022
|
+
function h(a, o) {
|
|
1023
1023
|
const t = a.const("err", o);
|
|
1024
|
-
a.if((0, r._)`${
|
|
1024
|
+
a.if((0, r._)`${l.default.vErrors} === null`, () => a.assign(l.default.vErrors, (0, r._)`[${t}]`), (0, r._)`${l.default.vErrors}.push(${t})`), a.code((0, r._)`${l.default.errors}++`);
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const { gen: t, validateName: i, schemaEnv:
|
|
1028
|
-
|
|
1026
|
+
function $(a, o) {
|
|
1027
|
+
const { gen: t, validateName: i, schemaEnv: m } = a;
|
|
1028
|
+
m.$async ? t.throw((0, r._)`new ${a.ValidationError}(${o})`) : (t.assign((0, r._)`${i}.errors`, o), t.return(!1));
|
|
1029
1029
|
}
|
|
1030
|
-
const
|
|
1030
|
+
const _ = {
|
|
1031
1031
|
keyword: new r.Name("keyword"),
|
|
1032
1032
|
schemaPath: new r.Name("schemaPath"),
|
|
1033
1033
|
// also used in JTD errors
|
|
@@ -1039,58 +1039,58 @@ function pt() {
|
|
|
1039
1039
|
};
|
|
1040
1040
|
function P(a, o, t) {
|
|
1041
1041
|
const { createErrors: i } = a.it;
|
|
1042
|
-
return i === !1 ? (0, r._)`{}` :
|
|
1042
|
+
return i === !1 ? (0, r._)`{}` : g(a, o, t);
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1045
|
-
const { gen: i, it:
|
|
1046
|
-
y(
|
|
1044
|
+
function g(a, o, t = {}) {
|
|
1045
|
+
const { gen: i, it: m } = a, n = [
|
|
1046
|
+
y(m, t),
|
|
1047
1047
|
p(a, t)
|
|
1048
1048
|
];
|
|
1049
1049
|
return b(a, o, n), i.object(...n);
|
|
1050
1050
|
}
|
|
1051
1051
|
function y({ errorPath: a }, { instancePath: o }) {
|
|
1052
1052
|
const t = o ? (0, r.str)`${a}${(0, S.getErrorPath)(o, S.Type.Str)}` : a;
|
|
1053
|
-
return [
|
|
1053
|
+
return [l.default.instancePath, (0, r.strConcat)(l.default.instancePath, t)];
|
|
1054
1054
|
}
|
|
1055
1055
|
function p({ keyword: a, it: { errSchemaPath: o } }, { schemaPath: t, parentSchema: i }) {
|
|
1056
|
-
let
|
|
1057
|
-
return t && (
|
|
1056
|
+
let m = i ? o : (0, r.str)`${o}/${a}`;
|
|
1057
|
+
return t && (m = (0, r.str)`${m}${(0, S.getErrorPath)(t, S.Type.Str)}`), [_.schemaPath, m];
|
|
1058
1058
|
}
|
|
1059
1059
|
function b(a, { params: o, message: t }, i) {
|
|
1060
|
-
const { keyword:
|
|
1061
|
-
i.push([
|
|
1060
|
+
const { keyword: m, data: n, schemaValue: d, it: w } = a, { opts: j, propertyName: C, topSchemaRef: D, schemaPath: V } = w;
|
|
1061
|
+
i.push([_.keyword, m], [_.params, typeof o == "function" ? o(a) : o || (0, r._)`{}`]), j.messages && i.push([_.message, typeof t == "function" ? t(a) : t]), j.verbose && i.push([_.schema, d], [_.parentSchema, (0, r._)`${D}${V}`], [l.default.data, n]), C && i.push([_.propertyName, C]);
|
|
1062
1062
|
}
|
|
1063
1063
|
})(Et)), Et;
|
|
1064
1064
|
}
|
|
1065
1065
|
var Jt;
|
|
1066
|
-
function
|
|
1066
|
+
function pn() {
|
|
1067
1067
|
if (Jt) return ge;
|
|
1068
1068
|
Jt = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.boolOrEmptySchema = ge.topBoolOrEmptySchema = void 0;
|
|
1069
|
-
const e = pt(), r = J(), S = _e(),
|
|
1069
|
+
const e = pt(), r = J(), S = _e(), l = {
|
|
1070
1070
|
message: "boolean schema is false"
|
|
1071
1071
|
};
|
|
1072
|
-
function
|
|
1073
|
-
const { gen:
|
|
1074
|
-
|
|
1072
|
+
function v(c) {
|
|
1073
|
+
const { gen: h, schema: $, validateName: _ } = c;
|
|
1074
|
+
$ === !1 ? f(c, !1) : typeof $ == "object" && $.$async === !0 ? h.return(S.default.data) : (h.assign((0, r._)`${_}.errors`, null), h.return(!0));
|
|
1075
1075
|
}
|
|
1076
|
-
ge.topBoolOrEmptySchema =
|
|
1077
|
-
function s(c,
|
|
1078
|
-
const { gen:
|
|
1079
|
-
|
|
1076
|
+
ge.topBoolOrEmptySchema = v;
|
|
1077
|
+
function s(c, h) {
|
|
1078
|
+
const { gen: $, schema: _ } = c;
|
|
1079
|
+
_ === !1 ? ($.var(h, !1), f(c)) : $.var(h, !0);
|
|
1080
1080
|
}
|
|
1081
1081
|
ge.boolOrEmptySchema = s;
|
|
1082
|
-
function f(c,
|
|
1083
|
-
const { gen:
|
|
1084
|
-
gen:
|
|
1082
|
+
function f(c, h) {
|
|
1083
|
+
const { gen: $, data: _ } = c, P = {
|
|
1084
|
+
gen: $,
|
|
1085
1085
|
keyword: "false schema",
|
|
1086
|
-
data:
|
|
1086
|
+
data: _,
|
|
1087
1087
|
schema: !1,
|
|
1088
1088
|
schemaCode: !1,
|
|
1089
1089
|
schemaValue: !1,
|
|
1090
1090
|
params: {},
|
|
1091
1091
|
it: c
|
|
1092
1092
|
};
|
|
1093
|
-
(0, e.reportError)(P,
|
|
1093
|
+
(0, e.reportError)(P, l, void 0, h);
|
|
1094
1094
|
}
|
|
1095
1095
|
return ge;
|
|
1096
1096
|
}
|
|
@@ -1099,43 +1099,43 @@ function Zr() {
|
|
|
1099
1099
|
if (Wt) return $e;
|
|
1100
1100
|
Wt = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.getRules = $e.isJSONType = void 0;
|
|
1101
1101
|
const e = ["string", "number", "integer", "boolean", "null", "object", "array"], r = new Set(e);
|
|
1102
|
-
function S(
|
|
1103
|
-
return typeof
|
|
1102
|
+
function S(v) {
|
|
1103
|
+
return typeof v == "string" && r.has(v);
|
|
1104
1104
|
}
|
|
1105
1105
|
$e.isJSONType = S;
|
|
1106
|
-
function
|
|
1107
|
-
const
|
|
1106
|
+
function l() {
|
|
1107
|
+
const v = {
|
|
1108
1108
|
number: { type: "number", rules: [] },
|
|
1109
1109
|
string: { type: "string", rules: [] },
|
|
1110
1110
|
array: { type: "array", rules: [] },
|
|
1111
1111
|
object: { type: "object", rules: [] }
|
|
1112
1112
|
};
|
|
1113
1113
|
return {
|
|
1114
|
-
types: { ...
|
|
1115
|
-
rules: [{ rules: [] },
|
|
1114
|
+
types: { ...v, integer: !0, boolean: !0, null: !0 },
|
|
1115
|
+
rules: [{ rules: [] }, v.number, v.string, v.array, v.object],
|
|
1116
1116
|
post: { rules: [] },
|
|
1117
1117
|
all: {},
|
|
1118
1118
|
keywords: {}
|
|
1119
1119
|
};
|
|
1120
1120
|
}
|
|
1121
|
-
return $e.getRules =
|
|
1121
|
+
return $e.getRules = l, $e;
|
|
1122
1122
|
}
|
|
1123
1123
|
var me = {}, Bt;
|
|
1124
1124
|
function xr() {
|
|
1125
1125
|
if (Bt) return me;
|
|
1126
1126
|
Bt = 1, Object.defineProperty(me, "__esModule", { value: !0 }), me.shouldUseRule = me.shouldUseGroup = me.schemaHasRulesForType = void 0;
|
|
1127
|
-
function e({ schema:
|
|
1128
|
-
const f =
|
|
1129
|
-
return f && f !== !0 && r(
|
|
1127
|
+
function e({ schema: l, self: v }, s) {
|
|
1128
|
+
const f = v.RULES.types[s];
|
|
1129
|
+
return f && f !== !0 && r(l, f);
|
|
1130
1130
|
}
|
|
1131
1131
|
me.schemaHasRulesForType = e;
|
|
1132
|
-
function r(
|
|
1133
|
-
return
|
|
1132
|
+
function r(l, v) {
|
|
1133
|
+
return v.rules.some((s) => S(l, s));
|
|
1134
1134
|
}
|
|
1135
1135
|
me.shouldUseGroup = r;
|
|
1136
|
-
function S(
|
|
1136
|
+
function S(l, v) {
|
|
1137
1137
|
var s;
|
|
1138
|
-
return
|
|
1138
|
+
return l[v.keyword] !== void 0 || ((s = v.definition.implements) === null || s === void 0 ? void 0 : s.some((f) => l[f] !== void 0));
|
|
1139
1139
|
}
|
|
1140
1140
|
return me.shouldUseRule = S, me;
|
|
1141
1141
|
}
|
|
@@ -1143,7 +1143,7 @@ var Qt;
|
|
|
1143
1143
|
function mt() {
|
|
1144
1144
|
if (Qt) return re;
|
|
1145
1145
|
Qt = 1, Object.defineProperty(re, "__esModule", { value: !0 }), re.reportTypeError = re.checkDataTypes = re.checkDataType = re.coerceAndCheckDataType = re.getJSONTypes = re.getSchemaTypes = re.DataType = void 0;
|
|
1146
|
-
const e = Zr(), r = xr(), S = pt(),
|
|
1146
|
+
const e = Zr(), r = xr(), S = pt(), l = J(), v = Q();
|
|
1147
1147
|
var s;
|
|
1148
1148
|
(function(t) {
|
|
1149
1149
|
t[t.Correct = 0] = "Correct", t[t.Wrong = 1] = "Wrong";
|
|
@@ -1168,103 +1168,103 @@ function mt() {
|
|
|
1168
1168
|
throw new Error("type must be JSONType or JSONType[]: " + i.join(","));
|
|
1169
1169
|
}
|
|
1170
1170
|
re.getJSONTypes = c;
|
|
1171
|
-
function
|
|
1172
|
-
const { gen:
|
|
1171
|
+
function h(t, i) {
|
|
1172
|
+
const { gen: m, data: n, opts: d } = t, w = _(i, d.coerceTypes), j = i.length > 0 && !(w.length === 0 && i.length === 1 && (0, r.schemaHasRulesForType)(t, i[0]));
|
|
1173
1173
|
if (j) {
|
|
1174
|
-
const C = p(i, n,
|
|
1175
|
-
|
|
1176
|
-
|
|
1174
|
+
const C = p(i, n, d.strictNumbers, s.Wrong);
|
|
1175
|
+
m.if(C, () => {
|
|
1176
|
+
w.length ? P(t, i, w) : a(t);
|
|
1177
1177
|
});
|
|
1178
1178
|
}
|
|
1179
1179
|
return j;
|
|
1180
1180
|
}
|
|
1181
|
-
re.coerceAndCheckDataType =
|
|
1182
|
-
const
|
|
1183
|
-
function
|
|
1184
|
-
return i ? t.filter((
|
|
1185
|
-
}
|
|
1186
|
-
function P(t, i,
|
|
1187
|
-
const { gen: n, data:
|
|
1188
|
-
|
|
1189
|
-
for (const V of
|
|
1190
|
-
(
|
|
1191
|
-
n.else(), a(t), n.endIf(), n.if((0,
|
|
1192
|
-
n.assign(
|
|
1181
|
+
re.coerceAndCheckDataType = h;
|
|
1182
|
+
const $ = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
1183
|
+
function _(t, i) {
|
|
1184
|
+
return i ? t.filter((m) => $.has(m) || i === "array" && m === "array") : [];
|
|
1185
|
+
}
|
|
1186
|
+
function P(t, i, m) {
|
|
1187
|
+
const { gen: n, data: d, opts: w } = t, j = n.let("dataType", (0, l._)`typeof ${d}`), C = n.let("coerced", (0, l._)`undefined`);
|
|
1188
|
+
w.coerceTypes === "array" && n.if((0, l._)`${j} == 'object' && Array.isArray(${d}) && ${d}.length == 1`, () => n.assign(d, (0, l._)`${d}[0]`).assign(j, (0, l._)`typeof ${d}`).if(p(i, d, w.strictNumbers), () => n.assign(C, d))), n.if((0, l._)`${C} !== undefined`);
|
|
1189
|
+
for (const V of m)
|
|
1190
|
+
($.has(V) || V === "array" && w.coerceTypes === "array") && D(V);
|
|
1191
|
+
n.else(), a(t), n.endIf(), n.if((0, l._)`${C} !== undefined`, () => {
|
|
1192
|
+
n.assign(d, C), g(t, C);
|
|
1193
1193
|
});
|
|
1194
1194
|
function D(V) {
|
|
1195
1195
|
switch (V) {
|
|
1196
1196
|
case "string":
|
|
1197
|
-
n.elseIf((0,
|
|
1197
|
+
n.elseIf((0, l._)`${j} == "number" || ${j} == "boolean"`).assign(C, (0, l._)`"" + ${d}`).elseIf((0, l._)`${d} === null`).assign(C, (0, l._)`""`);
|
|
1198
1198
|
return;
|
|
1199
1199
|
case "number":
|
|
1200
|
-
n.elseIf((0,
|
|
1201
|
-
|| (${j} == "string" && ${
|
|
1200
|
+
n.elseIf((0, l._)`${j} == "boolean" || ${d} === null
|
|
1201
|
+
|| (${j} == "string" && ${d} && ${d} == +${d})`).assign(C, (0, l._)`+${d}`);
|
|
1202
1202
|
return;
|
|
1203
1203
|
case "integer":
|
|
1204
|
-
n.elseIf((0,
|
|
1205
|
-
|| (${j} === "string" && ${
|
|
1204
|
+
n.elseIf((0, l._)`${j} === "boolean" || ${d} === null
|
|
1205
|
+
|| (${j} === "string" && ${d} && ${d} == +${d} && !(${d} % 1))`).assign(C, (0, l._)`+${d}`);
|
|
1206
1206
|
return;
|
|
1207
1207
|
case "boolean":
|
|
1208
|
-
n.elseIf((0,
|
|
1208
|
+
n.elseIf((0, l._)`${d} === "false" || ${d} === 0 || ${d} === null`).assign(C, !1).elseIf((0, l._)`${d} === "true" || ${d} === 1`).assign(C, !0);
|
|
1209
1209
|
return;
|
|
1210
1210
|
case "null":
|
|
1211
|
-
n.elseIf((0,
|
|
1211
|
+
n.elseIf((0, l._)`${d} === "" || ${d} === 0 || ${d} === false`), n.assign(C, null);
|
|
1212
1212
|
return;
|
|
1213
1213
|
case "array":
|
|
1214
|
-
n.elseIf((0,
|
|
1215
|
-
|| ${j} === "boolean" || ${
|
|
1214
|
+
n.elseIf((0, l._)`${j} === "string" || ${j} === "number"
|
|
1215
|
+
|| ${j} === "boolean" || ${d} === null`).assign(C, (0, l._)`[${d}]`);
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1220
|
-
t.if((0,
|
|
1219
|
+
function g({ gen: t, parentData: i, parentDataProperty: m }, n) {
|
|
1220
|
+
t.if((0, l._)`${i} !== undefined`, () => t.assign((0, l._)`${i}[${m}]`, n));
|
|
1221
1221
|
}
|
|
1222
|
-
function y(t, i,
|
|
1223
|
-
const
|
|
1224
|
-
let
|
|
1222
|
+
function y(t, i, m, n = s.Correct) {
|
|
1223
|
+
const d = n === s.Correct ? l.operators.EQ : l.operators.NEQ;
|
|
1224
|
+
let w;
|
|
1225
1225
|
switch (t) {
|
|
1226
1226
|
case "null":
|
|
1227
|
-
return (0,
|
|
1227
|
+
return (0, l._)`${i} ${d} null`;
|
|
1228
1228
|
case "array":
|
|
1229
|
-
|
|
1229
|
+
w = (0, l._)`Array.isArray(${i})`;
|
|
1230
1230
|
break;
|
|
1231
1231
|
case "object":
|
|
1232
|
-
|
|
1232
|
+
w = (0, l._)`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;
|
|
1233
1233
|
break;
|
|
1234
1234
|
case "integer":
|
|
1235
|
-
|
|
1235
|
+
w = j((0, l._)`!(${i} % 1) && !isNaN(${i})`);
|
|
1236
1236
|
break;
|
|
1237
1237
|
case "number":
|
|
1238
|
-
|
|
1238
|
+
w = j();
|
|
1239
1239
|
break;
|
|
1240
1240
|
default:
|
|
1241
|
-
return (0,
|
|
1241
|
+
return (0, l._)`typeof ${i} ${d} ${t}`;
|
|
1242
1242
|
}
|
|
1243
|
-
return n === s.Correct ?
|
|
1244
|
-
function j(C =
|
|
1245
|
-
return (0,
|
|
1243
|
+
return n === s.Correct ? w : (0, l.not)(w);
|
|
1244
|
+
function j(C = l.nil) {
|
|
1245
|
+
return (0, l.and)((0, l._)`typeof ${i} == "number"`, C, m ? (0, l._)`isFinite(${i})` : l.nil);
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
1248
|
re.checkDataType = y;
|
|
1249
|
-
function p(t, i,
|
|
1249
|
+
function p(t, i, m, n) {
|
|
1250
1250
|
if (t.length === 1)
|
|
1251
|
-
return y(t[0], i,
|
|
1252
|
-
let
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1255
|
-
const j = (0,
|
|
1256
|
-
|
|
1251
|
+
return y(t[0], i, m, n);
|
|
1252
|
+
let d;
|
|
1253
|
+
const w = (0, v.toHash)(t);
|
|
1254
|
+
if (w.array && w.object) {
|
|
1255
|
+
const j = (0, l._)`typeof ${i} != "object"`;
|
|
1256
|
+
d = w.null ? j : (0, l._)`!${i} || ${j}`, delete w.null, delete w.array, delete w.object;
|
|
1257
1257
|
} else
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
for (const j in
|
|
1261
|
-
|
|
1262
|
-
return
|
|
1258
|
+
d = l.nil;
|
|
1259
|
+
w.number && delete w.integer;
|
|
1260
|
+
for (const j in w)
|
|
1261
|
+
d = (0, l.and)(d, y(j, i, m, n));
|
|
1262
|
+
return d;
|
|
1263
1263
|
}
|
|
1264
1264
|
re.checkDataTypes = p;
|
|
1265
1265
|
const b = {
|
|
1266
1266
|
message: ({ schema: t }) => `must be ${t}`,
|
|
1267
|
-
params: ({ schema: t, schemaValue: i }) => typeof t == "string" ? (0,
|
|
1267
|
+
params: ({ schema: t, schemaValue: i }) => typeof t == "string" ? (0, l._)`{type: ${t}}` : (0, l._)`{type: ${i}}`
|
|
1268
1268
|
};
|
|
1269
1269
|
function a(t) {
|
|
1270
1270
|
const i = o(t);
|
|
@@ -1272,14 +1272,14 @@ function mt() {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
re.reportTypeError = a;
|
|
1274
1274
|
function o(t) {
|
|
1275
|
-
const { gen: i, data:
|
|
1275
|
+
const { gen: i, data: m, schema: n } = t, d = (0, v.schemaRefOrVal)(t, n, "type");
|
|
1276
1276
|
return {
|
|
1277
1277
|
gen: i,
|
|
1278
1278
|
keyword: "type",
|
|
1279
|
-
data:
|
|
1279
|
+
data: m,
|
|
1280
1280
|
schema: n.type,
|
|
1281
|
-
schemaCode:
|
|
1282
|
-
schemaValue:
|
|
1281
|
+
schemaCode: d,
|
|
1282
|
+
schemaValue: d,
|
|
1283
1283
|
parentSchema: n,
|
|
1284
1284
|
params: {},
|
|
1285
1285
|
it: t
|
|
@@ -1288,29 +1288,29 @@ function mt() {
|
|
|
1288
1288
|
return re;
|
|
1289
1289
|
}
|
|
1290
1290
|
var Ne = {}, Xt;
|
|
1291
|
-
function
|
|
1291
|
+
function yn() {
|
|
1292
1292
|
if (Xt) return Ne;
|
|
1293
1293
|
Xt = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.assignDefaults = void 0;
|
|
1294
1294
|
const e = J(), r = Q();
|
|
1295
|
-
function S(
|
|
1296
|
-
const { properties: f, items: c } =
|
|
1295
|
+
function S(v, s) {
|
|
1296
|
+
const { properties: f, items: c } = v.schema;
|
|
1297
1297
|
if (s === "object" && f)
|
|
1298
|
-
for (const
|
|
1299
|
-
|
|
1300
|
-
else s === "array" && Array.isArray(c) && c.forEach((
|
|
1298
|
+
for (const h in f)
|
|
1299
|
+
l(v, h, f[h].default);
|
|
1300
|
+
else s === "array" && Array.isArray(c) && c.forEach((h, $) => l(v, $, h.default));
|
|
1301
1301
|
}
|
|
1302
1302
|
Ne.assignDefaults = S;
|
|
1303
|
-
function
|
|
1304
|
-
const { gen: c, compositeRule:
|
|
1303
|
+
function l(v, s, f) {
|
|
1304
|
+
const { gen: c, compositeRule: h, data: $, opts: _ } = v;
|
|
1305
1305
|
if (f === void 0)
|
|
1306
1306
|
return;
|
|
1307
|
-
const P = (0, e._)`${
|
|
1308
|
-
if (
|
|
1309
|
-
(0, r.checkStrictMode)(
|
|
1307
|
+
const P = (0, e._)`${$}${(0, e.getProperty)(s)}`;
|
|
1308
|
+
if (h) {
|
|
1309
|
+
(0, r.checkStrictMode)(v, `default is ignored for: ${P}`);
|
|
1310
1310
|
return;
|
|
1311
1311
|
}
|
|
1312
|
-
let
|
|
1313
|
-
|
|
1312
|
+
let g = (0, e._)`${P} === undefined`;
|
|
1313
|
+
_.useDefaults === "empty" && (g = (0, e._)`${g} || ${P} === null || ${P} === ""`), c.if(g, (0, e._)`${P} = ${(0, e.stringify)(f)}`);
|
|
1314
1314
|
}
|
|
1315
1315
|
return Ne;
|
|
1316
1316
|
}
|
|
@@ -1318,16 +1318,16 @@ var ce = {}, Y = {}, Yt;
|
|
|
1318
1318
|
function le() {
|
|
1319
1319
|
if (Yt) return Y;
|
|
1320
1320
|
Yt = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.validateUnion = Y.validateArray = Y.usePattern = Y.callValidateCode = Y.schemaProperties = Y.allSchemaProperties = Y.noPropertyInData = Y.propertyInData = Y.isOwnProperty = Y.hasPropFunc = Y.reportMissingProp = Y.checkMissingProp = Y.checkReportMissingProp = void 0;
|
|
1321
|
-
const e = J(), r = Q(), S = _e(),
|
|
1322
|
-
function
|
|
1323
|
-
const { gen:
|
|
1324
|
-
|
|
1321
|
+
const e = J(), r = Q(), S = _e(), l = Q();
|
|
1322
|
+
function v(t, i) {
|
|
1323
|
+
const { gen: m, data: n, it: d } = t;
|
|
1324
|
+
m.if(_(m, n, i, d.opts.ownProperties), () => {
|
|
1325
1325
|
t.setParams({ missingProperty: (0, e._)`${i}` }, !0), t.error();
|
|
1326
1326
|
});
|
|
1327
1327
|
}
|
|
1328
|
-
Y.checkReportMissingProp =
|
|
1329
|
-
function s({ gen: t, data: i, it: { opts:
|
|
1330
|
-
return (0, e.or)(...n.map((
|
|
1328
|
+
Y.checkReportMissingProp = v;
|
|
1329
|
+
function s({ gen: t, data: i, it: { opts: m } }, n, d) {
|
|
1330
|
+
return (0, e.or)(...n.map((w) => (0, e.and)(_(t, i, w, m.ownProperties), (0, e._)`${d} = ${w}`)));
|
|
1331
1331
|
}
|
|
1332
1332
|
Y.checkMissingProp = s;
|
|
1333
1333
|
function f(t, i) {
|
|
@@ -1342,77 +1342,77 @@ function le() {
|
|
|
1342
1342
|
});
|
|
1343
1343
|
}
|
|
1344
1344
|
Y.hasPropFunc = c;
|
|
1345
|
-
function
|
|
1346
|
-
return (0, e._)`${c(t)}.call(${i}, ${
|
|
1345
|
+
function h(t, i, m) {
|
|
1346
|
+
return (0, e._)`${c(t)}.call(${i}, ${m})`;
|
|
1347
1347
|
}
|
|
1348
|
-
Y.isOwnProperty =
|
|
1349
|
-
function
|
|
1350
|
-
const
|
|
1351
|
-
return n ? (0, e._)`${
|
|
1348
|
+
Y.isOwnProperty = h;
|
|
1349
|
+
function $(t, i, m, n) {
|
|
1350
|
+
const d = (0, e._)`${i}${(0, e.getProperty)(m)} !== undefined`;
|
|
1351
|
+
return n ? (0, e._)`${d} && ${h(t, i, m)}` : d;
|
|
1352
1352
|
}
|
|
1353
|
-
Y.propertyInData =
|
|
1354
|
-
function
|
|
1355
|
-
const
|
|
1356
|
-
return n ? (0, e.or)(
|
|
1353
|
+
Y.propertyInData = $;
|
|
1354
|
+
function _(t, i, m, n) {
|
|
1355
|
+
const d = (0, e._)`${i}${(0, e.getProperty)(m)} === undefined`;
|
|
1356
|
+
return n ? (0, e.or)(d, (0, e.not)(h(t, i, m))) : d;
|
|
1357
1357
|
}
|
|
1358
|
-
Y.noPropertyInData =
|
|
1358
|
+
Y.noPropertyInData = _;
|
|
1359
1359
|
function P(t) {
|
|
1360
1360
|
return t ? Object.keys(t).filter((i) => i !== "__proto__") : [];
|
|
1361
1361
|
}
|
|
1362
1362
|
Y.allSchemaProperties = P;
|
|
1363
|
-
function
|
|
1364
|
-
return P(i).filter((
|
|
1363
|
+
function g(t, i) {
|
|
1364
|
+
return P(i).filter((m) => !(0, r.alwaysValidSchema)(t, i[m]));
|
|
1365
1365
|
}
|
|
1366
|
-
Y.schemaProperties =
|
|
1367
|
-
function y({ schemaCode: t, data: i, it: { gen:
|
|
1368
|
-
const L = V ? (0, e._)`${t}, ${i}, ${n}${
|
|
1369
|
-
[S.default.instancePath, (0, e.strConcat)(S.default.instancePath,
|
|
1366
|
+
Y.schemaProperties = g;
|
|
1367
|
+
function y({ schemaCode: t, data: i, it: { gen: m, topSchemaRef: n, schemaPath: d, errorPath: w }, it: j }, C, D, V) {
|
|
1368
|
+
const L = V ? (0, e._)`${t}, ${i}, ${n}${d}` : i, K = [
|
|
1369
|
+
[S.default.instancePath, (0, e.strConcat)(S.default.instancePath, w)],
|
|
1370
1370
|
[S.default.parentData, j.parentData],
|
|
1371
1371
|
[S.default.parentDataProperty, j.parentDataProperty],
|
|
1372
1372
|
[S.default.rootData, S.default.rootData]
|
|
1373
1373
|
];
|
|
1374
1374
|
j.opts.dynamicRef && K.push([S.default.dynamicAnchors, S.default.dynamicAnchors]);
|
|
1375
|
-
const B = (0, e._)`${L}, ${
|
|
1375
|
+
const B = (0, e._)`${L}, ${m.object(...K)}`;
|
|
1376
1376
|
return D !== e.nil ? (0, e._)`${C}.call(${D}, ${B})` : (0, e._)`${C}(${B})`;
|
|
1377
1377
|
}
|
|
1378
1378
|
Y.callValidateCode = y;
|
|
1379
1379
|
const p = (0, e._)`new RegExp`;
|
|
1380
|
-
function b({ gen: t, it: { opts: i } },
|
|
1381
|
-
const n = i.unicodeRegExp ? "u" : "", { regExp:
|
|
1380
|
+
function b({ gen: t, it: { opts: i } }, m) {
|
|
1381
|
+
const n = i.unicodeRegExp ? "u" : "", { regExp: d } = i.code, w = d(m, n);
|
|
1382
1382
|
return t.scopeValue("pattern", {
|
|
1383
|
-
key:
|
|
1384
|
-
ref:
|
|
1385
|
-
code: (0, e._)`${
|
|
1383
|
+
key: w.toString(),
|
|
1384
|
+
ref: w,
|
|
1385
|
+
code: (0, e._)`${d.code === "new RegExp" ? p : (0, l.useFunc)(t, d)}(${m}, ${n})`
|
|
1386
1386
|
});
|
|
1387
1387
|
}
|
|
1388
1388
|
Y.usePattern = b;
|
|
1389
1389
|
function a(t) {
|
|
1390
|
-
const { gen: i, data:
|
|
1391
|
-
if (
|
|
1390
|
+
const { gen: i, data: m, keyword: n, it: d } = t, w = i.name("valid");
|
|
1391
|
+
if (d.allErrors) {
|
|
1392
1392
|
const C = i.let("valid", !0);
|
|
1393
1393
|
return j(() => i.assign(C, !1)), C;
|
|
1394
1394
|
}
|
|
1395
|
-
return i.var(
|
|
1395
|
+
return i.var(w, !0), j(() => i.break()), w;
|
|
1396
1396
|
function j(C) {
|
|
1397
|
-
const D = i.const("len", (0, e._)`${
|
|
1397
|
+
const D = i.const("len", (0, e._)`${m}.length`);
|
|
1398
1398
|
i.forRange("i", 0, D, (V) => {
|
|
1399
1399
|
t.subschema({
|
|
1400
1400
|
keyword: n,
|
|
1401
1401
|
dataProp: V,
|
|
1402
1402
|
dataPropType: r.Type.Num
|
|
1403
|
-
},
|
|
1403
|
+
}, w), i.if((0, e.not)(w), C);
|
|
1404
1404
|
});
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
1407
|
Y.validateArray = a;
|
|
1408
1408
|
function o(t) {
|
|
1409
|
-
const { gen: i, schema:
|
|
1410
|
-
if (!Array.isArray(
|
|
1409
|
+
const { gen: i, schema: m, keyword: n, it: d } = t;
|
|
1410
|
+
if (!Array.isArray(m))
|
|
1411
1411
|
throw new Error("ajv implementation error");
|
|
1412
|
-
if (
|
|
1412
|
+
if (m.some((D) => (0, r.alwaysValidSchema)(d, D)) && !d.opts.unevaluated)
|
|
1413
1413
|
return;
|
|
1414
1414
|
const j = i.let("valid", !1), C = i.name("_valid");
|
|
1415
|
-
i.block(() =>
|
|
1415
|
+
i.block(() => m.forEach((D, V) => {
|
|
1416
1416
|
const L = t.subschema({
|
|
1417
1417
|
keyword: n,
|
|
1418
1418
|
schemaProp: V,
|
|
@@ -1424,149 +1424,149 @@ function le() {
|
|
|
1424
1424
|
return Y.validateUnion = o, Y;
|
|
1425
1425
|
}
|
|
1426
1426
|
var Zt;
|
|
1427
|
-
function
|
|
1427
|
+
function vn() {
|
|
1428
1428
|
if (Zt) return ce;
|
|
1429
1429
|
Zt = 1, Object.defineProperty(ce, "__esModule", { value: !0 }), ce.validateKeywordUsage = ce.validSchemaType = ce.funcKeywordCode = ce.macroKeywordCode = void 0;
|
|
1430
|
-
const e = J(), r = _e(), S = le(),
|
|
1431
|
-
function g
|
|
1432
|
-
const { gen: p, keyword: b, schema: a, parentSchema: o, it: t } =
|
|
1430
|
+
const e = J(), r = _e(), S = le(), l = pt();
|
|
1431
|
+
function v(g, y) {
|
|
1432
|
+
const { gen: p, keyword: b, schema: a, parentSchema: o, it: t } = g, i = y.macro.call(t.self, a, o, t), m = $(p, b, i);
|
|
1433
1433
|
t.opts.validateSchema !== !1 && t.self.validateSchema(i, !0);
|
|
1434
1434
|
const n = p.name("valid");
|
|
1435
|
-
|
|
1435
|
+
g.subschema({
|
|
1436
1436
|
schema: i,
|
|
1437
1437
|
schemaPath: e.nil,
|
|
1438
1438
|
errSchemaPath: `${t.errSchemaPath}/${b}`,
|
|
1439
|
-
topSchemaRef:
|
|
1439
|
+
topSchemaRef: m,
|
|
1440
1440
|
compositeRule: !0
|
|
1441
|
-
}, n),
|
|
1441
|
+
}, n), g.pass(n, () => g.error(!0));
|
|
1442
1442
|
}
|
|
1443
|
-
ce.macroKeywordCode =
|
|
1444
|
-
function s(
|
|
1443
|
+
ce.macroKeywordCode = v;
|
|
1444
|
+
function s(g, y) {
|
|
1445
1445
|
var p;
|
|
1446
|
-
const { gen: b, keyword: a, schema: o, parentSchema: t, $data: i, it:
|
|
1447
|
-
m
|
|
1448
|
-
const n = !i && y.compile ? y.compile.call(
|
|
1449
|
-
|
|
1446
|
+
const { gen: b, keyword: a, schema: o, parentSchema: t, $data: i, it: m } = g;
|
|
1447
|
+
h(m, y);
|
|
1448
|
+
const n = !i && y.compile ? y.compile.call(m.self, o, t, m) : y.validate, d = $(b, a, n), w = b.let("valid");
|
|
1449
|
+
g.block$data(w, j), g.ok((p = y.valid) !== null && p !== void 0 ? p : w);
|
|
1450
1450
|
function j() {
|
|
1451
1451
|
if (y.errors === !1)
|
|
1452
|
-
V(), y.modifying && f(
|
|
1452
|
+
V(), y.modifying && f(g), L(() => g.error());
|
|
1453
1453
|
else {
|
|
1454
1454
|
const K = y.async ? C() : D();
|
|
1455
|
-
y.modifying && f(
|
|
1455
|
+
y.modifying && f(g), L(() => c(g, K));
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
function C() {
|
|
1459
1459
|
const K = b.let("ruleErrs", null);
|
|
1460
|
-
return b.try(() => V((0, e._)`await `), (B) => b.assign(
|
|
1460
|
+
return b.try(() => V((0, e._)`await `), (B) => b.assign(w, !1).if((0, e._)`${B} instanceof ${m.ValidationError}`, () => b.assign(K, (0, e._)`${B}.errors`), () => b.throw(B))), K;
|
|
1461
1461
|
}
|
|
1462
1462
|
function D() {
|
|
1463
|
-
const K = (0, e._)`${
|
|
1463
|
+
const K = (0, e._)`${d}.errors`;
|
|
1464
1464
|
return b.assign(K, null), V(e.nil), K;
|
|
1465
1465
|
}
|
|
1466
1466
|
function V(K = y.async ? (0, e._)`await ` : e.nil) {
|
|
1467
|
-
const B =
|
|
1468
|
-
b.assign(
|
|
1467
|
+
const B = m.opts.passContext ? r.default.this : r.default.self, x = !("compile" in y && !i || y.schema === !1);
|
|
1468
|
+
b.assign(w, (0, e._)`${K}${(0, S.callValidateCode)(g, d, B, x)}`, y.modifying);
|
|
1469
1469
|
}
|
|
1470
1470
|
function L(K) {
|
|
1471
1471
|
var B;
|
|
1472
|
-
b.if((0, e.not)((B = y.valid) !== null && B !== void 0 ? B :
|
|
1472
|
+
b.if((0, e.not)((B = y.valid) !== null && B !== void 0 ? B : w), K);
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
1475
|
ce.funcKeywordCode = s;
|
|
1476
|
-
function f(
|
|
1477
|
-
const { gen: y, data: p, it: b } =
|
|
1476
|
+
function f(g) {
|
|
1477
|
+
const { gen: y, data: p, it: b } = g;
|
|
1478
1478
|
y.if(b.parentData, () => y.assign(p, (0, e._)`${b.parentData}[${b.parentDataProperty}]`));
|
|
1479
1479
|
}
|
|
1480
|
-
function c(
|
|
1481
|
-
const { gen: p } =
|
|
1480
|
+
function c(g, y) {
|
|
1481
|
+
const { gen: p } = g;
|
|
1482
1482
|
p.if((0, e._)`Array.isArray(${y})`, () => {
|
|
1483
|
-
p.assign(r.default.vErrors, (0, e._)`${r.default.vErrors} === null ? ${y} : ${r.default.vErrors}.concat(${y})`).assign(r.default.errors, (0, e._)`${r.default.vErrors}.length`), (0,
|
|
1484
|
-
}, () =>
|
|
1483
|
+
p.assign(r.default.vErrors, (0, e._)`${r.default.vErrors} === null ? ${y} : ${r.default.vErrors}.concat(${y})`).assign(r.default.errors, (0, e._)`${r.default.vErrors}.length`), (0, l.extendErrors)(g);
|
|
1484
|
+
}, () => g.error());
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1487
|
-
if (y.async && !
|
|
1486
|
+
function h({ schemaEnv: g }, y) {
|
|
1487
|
+
if (y.async && !g.$async)
|
|
1488
1488
|
throw new Error("async keyword in sync schema");
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function $(g, y, p) {
|
|
1491
1491
|
if (p === void 0)
|
|
1492
1492
|
throw new Error(`keyword "${y}" failed to compile`);
|
|
1493
|
-
return
|
|
1493
|
+
return g.scopeValue("keyword", typeof p == "function" ? { ref: p } : { ref: p, code: (0, e.stringify)(p) });
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1496
|
-
return !y.length || y.some((b) => b === "array" ? Array.isArray(
|
|
1495
|
+
function _(g, y, p = !1) {
|
|
1496
|
+
return !y.length || y.some((b) => b === "array" ? Array.isArray(g) : b === "object" ? g && typeof g == "object" && !Array.isArray(g) : typeof g == b || p && typeof g > "u");
|
|
1497
1497
|
}
|
|
1498
|
-
ce.validSchemaType =
|
|
1499
|
-
function P({ schema:
|
|
1498
|
+
ce.validSchemaType = _;
|
|
1499
|
+
function P({ schema: g, opts: y, self: p, errSchemaPath: b }, a, o) {
|
|
1500
1500
|
if (Array.isArray(a.keyword) ? !a.keyword.includes(o) : a.keyword !== o)
|
|
1501
1501
|
throw new Error("ajv implementation error");
|
|
1502
1502
|
const t = a.dependencies;
|
|
1503
|
-
if (t?.some((i) => !Object.prototype.hasOwnProperty.call(
|
|
1503
|
+
if (t?.some((i) => !Object.prototype.hasOwnProperty.call(g, i)))
|
|
1504
1504
|
throw new Error(`parent schema must have dependencies of ${o}: ${t.join(",")}`);
|
|
1505
|
-
if (a.validateSchema && !a.validateSchema(
|
|
1506
|
-
const
|
|
1505
|
+
if (a.validateSchema && !a.validateSchema(g[o])) {
|
|
1506
|
+
const m = `keyword "${o}" value is invalid at path "${b}": ` + p.errorsText(a.validateSchema.errors);
|
|
1507
1507
|
if (y.validateSchema === "log")
|
|
1508
|
-
p.logger.error(
|
|
1508
|
+
p.logger.error(m);
|
|
1509
1509
|
else
|
|
1510
|
-
throw new Error(
|
|
1510
|
+
throw new Error(m);
|
|
1511
1511
|
}
|
|
1512
1512
|
}
|
|
1513
1513
|
return ce.validateKeywordUsage = P, ce;
|
|
1514
1514
|
}
|
|
1515
1515
|
var pe = {}, xt;
|
|
1516
|
-
function
|
|
1516
|
+
function _n() {
|
|
1517
1517
|
if (xt) return pe;
|
|
1518
1518
|
xt = 1, Object.defineProperty(pe, "__esModule", { value: !0 }), pe.extendSubschemaMode = pe.extendSubschemaData = pe.getSubschema = void 0;
|
|
1519
1519
|
const e = J(), r = Q();
|
|
1520
|
-
function S(s, { keyword: f, schemaProp: c, schema:
|
|
1521
|
-
if (f !== void 0 &&
|
|
1520
|
+
function S(s, { keyword: f, schemaProp: c, schema: h, schemaPath: $, errSchemaPath: _, topSchemaRef: P }) {
|
|
1521
|
+
if (f !== void 0 && h !== void 0)
|
|
1522
1522
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
1523
1523
|
if (f !== void 0) {
|
|
1524
|
-
const
|
|
1524
|
+
const g = s.schema[f];
|
|
1525
1525
|
return c === void 0 ? {
|
|
1526
|
-
schema:
|
|
1526
|
+
schema: g,
|
|
1527
1527
|
schemaPath: (0, e._)`${s.schemaPath}${(0, e.getProperty)(f)}`,
|
|
1528
1528
|
errSchemaPath: `${s.errSchemaPath}/${f}`
|
|
1529
1529
|
} : {
|
|
1530
|
-
schema:
|
|
1530
|
+
schema: g[c],
|
|
1531
1531
|
schemaPath: (0, e._)`${s.schemaPath}${(0, e.getProperty)(f)}${(0, e.getProperty)(c)}`,
|
|
1532
1532
|
errSchemaPath: `${s.errSchemaPath}/${f}/${(0, r.escapeFragment)(c)}`
|
|
1533
1533
|
};
|
|
1534
1534
|
}
|
|
1535
|
-
if (
|
|
1536
|
-
if (
|
|
1535
|
+
if (h !== void 0) {
|
|
1536
|
+
if ($ === void 0 || _ === void 0 || P === void 0)
|
|
1537
1537
|
throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
|
|
1538
1538
|
return {
|
|
1539
|
-
schema:
|
|
1540
|
-
schemaPath:
|
|
1539
|
+
schema: h,
|
|
1540
|
+
schemaPath: $,
|
|
1541
1541
|
topSchemaRef: P,
|
|
1542
|
-
errSchemaPath:
|
|
1542
|
+
errSchemaPath: _
|
|
1543
1543
|
};
|
|
1544
1544
|
}
|
|
1545
1545
|
throw new Error('either "keyword" or "schema" must be passed');
|
|
1546
1546
|
}
|
|
1547
1547
|
pe.getSubschema = S;
|
|
1548
|
-
function
|
|
1549
|
-
if (
|
|
1548
|
+
function l(s, f, { dataProp: c, dataPropType: h, data: $, dataTypes: _, propertyName: P }) {
|
|
1549
|
+
if ($ !== void 0 && c !== void 0)
|
|
1550
1550
|
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
1551
|
-
const { gen:
|
|
1551
|
+
const { gen: g } = f;
|
|
1552
1552
|
if (c !== void 0) {
|
|
1553
|
-
const { errorPath: p, dataPathArr: b, opts: a } = f, o =
|
|
1554
|
-
y(o), s.errorPath = (0, e.str)`${p}${(0, r.getErrorPath)(c,
|
|
1553
|
+
const { errorPath: p, dataPathArr: b, opts: a } = f, o = g.let("data", (0, e._)`${f.data}${(0, e.getProperty)(c)}`, !0);
|
|
1554
|
+
y(o), s.errorPath = (0, e.str)`${p}${(0, r.getErrorPath)(c, h, a.jsPropertySyntax)}`, s.parentDataProperty = (0, e._)`${c}`, s.dataPathArr = [...b, s.parentDataProperty];
|
|
1555
1555
|
}
|
|
1556
|
-
if (
|
|
1557
|
-
const p =
|
|
1556
|
+
if ($ !== void 0) {
|
|
1557
|
+
const p = $ instanceof e.Name ? $ : g.let("data", $, !0);
|
|
1558
1558
|
y(p), P !== void 0 && (s.propertyName = P);
|
|
1559
1559
|
}
|
|
1560
|
-
|
|
1560
|
+
_ && (s.dataTypes = _);
|
|
1561
1561
|
function y(p) {
|
|
1562
1562
|
s.data = p, s.dataLevel = f.dataLevel + 1, s.dataTypes = [], f.definedProperties = /* @__PURE__ */ new Set(), s.parentData = f.data, s.dataNames = [...f.dataNames, p];
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
|
-
pe.extendSubschemaData =
|
|
1566
|
-
function
|
|
1567
|
-
|
|
1565
|
+
pe.extendSubschemaData = l;
|
|
1566
|
+
function v(s, { jtdDiscriminator: f, jtdMetadata: c, compositeRule: h, createErrors: $, allErrors: _ }) {
|
|
1567
|
+
h !== void 0 && (s.compositeRule = h), $ !== void 0 && (s.createErrors = $), _ !== void 0 && (s.allErrors = _), s.jtdDiscriminator = f, s.jtdMetadata = c;
|
|
1568
1568
|
}
|
|
1569
|
-
return pe.extendSubschemaMode =
|
|
1569
|
+
return pe.extendSubschemaMode = v, pe;
|
|
1570
1570
|
}
|
|
1571
1571
|
var ne = {}, Rt, er;
|
|
1572
1572
|
function en() {
|
|
@@ -1574,21 +1574,21 @@ function en() {
|
|
|
1574
1574
|
if (r === S) return !0;
|
|
1575
1575
|
if (r && S && typeof r == "object" && typeof S == "object") {
|
|
1576
1576
|
if (r.constructor !== S.constructor) return !1;
|
|
1577
|
-
var
|
|
1577
|
+
var l, v, s;
|
|
1578
1578
|
if (Array.isArray(r)) {
|
|
1579
|
-
if (
|
|
1580
|
-
for (
|
|
1581
|
-
if (!e(r[
|
|
1579
|
+
if (l = r.length, l != S.length) return !1;
|
|
1580
|
+
for (v = l; v-- !== 0; )
|
|
1581
|
+
if (!e(r[v], S[v])) return !1;
|
|
1582
1582
|
return !0;
|
|
1583
1583
|
}
|
|
1584
1584
|
if (r.constructor === RegExp) return r.source === S.source && r.flags === S.flags;
|
|
1585
1585
|
if (r.valueOf !== Object.prototype.valueOf) return r.valueOf() === S.valueOf();
|
|
1586
1586
|
if (r.toString !== Object.prototype.toString) return r.toString() === S.toString();
|
|
1587
|
-
if (s = Object.keys(r),
|
|
1588
|
-
for (
|
|
1589
|
-
if (!Object.prototype.hasOwnProperty.call(S, s[
|
|
1590
|
-
for (
|
|
1591
|
-
var f = s[
|
|
1587
|
+
if (s = Object.keys(r), l = s.length, l !== Object.keys(S).length) return !1;
|
|
1588
|
+
for (v = l; v-- !== 0; )
|
|
1589
|
+
if (!Object.prototype.hasOwnProperty.call(S, s[v])) return !1;
|
|
1590
|
+
for (v = l; v-- !== 0; ) {
|
|
1591
|
+
var f = s[v];
|
|
1592
1592
|
if (!e(r[f], S[f])) return !1;
|
|
1593
1593
|
}
|
|
1594
1594
|
return !0;
|
|
@@ -1597,15 +1597,15 @@ function en() {
|
|
|
1597
1597
|
}), Rt;
|
|
1598
1598
|
}
|
|
1599
1599
|
var kt = { exports: {} }, tr;
|
|
1600
|
-
function
|
|
1600
|
+
function gn() {
|
|
1601
1601
|
if (tr) return kt.exports;
|
|
1602
1602
|
tr = 1;
|
|
1603
|
-
var e = kt.exports = function(
|
|
1604
|
-
typeof
|
|
1603
|
+
var e = kt.exports = function(l, v, s) {
|
|
1604
|
+
typeof v == "function" && (s = v, v = {}), s = v.cb || s;
|
|
1605
1605
|
var f = typeof s == "function" ? s : s.pre || function() {
|
|
1606
1606
|
}, c = s.post || function() {
|
|
1607
1607
|
};
|
|
1608
|
-
r(
|
|
1608
|
+
r(v, f, c, l, "", l);
|
|
1609
1609
|
};
|
|
1610
1610
|
e.keywords = {
|
|
1611
1611
|
additionalItems: !0,
|
|
@@ -1648,26 +1648,26 @@ function vn() {
|
|
|
1648
1648
|
maxProperties: !0,
|
|
1649
1649
|
minProperties: !0
|
|
1650
1650
|
};
|
|
1651
|
-
function r(
|
|
1651
|
+
function r(l, v, s, f, c, h, $, _, P, g) {
|
|
1652
1652
|
if (f && typeof f == "object" && !Array.isArray(f)) {
|
|
1653
|
-
|
|
1653
|
+
v(f, c, h, $, _, P, g);
|
|
1654
1654
|
for (var y in f) {
|
|
1655
1655
|
var p = f[y];
|
|
1656
1656
|
if (Array.isArray(p)) {
|
|
1657
1657
|
if (y in e.arrayKeywords)
|
|
1658
1658
|
for (var b = 0; b < p.length; b++)
|
|
1659
|
-
r(
|
|
1659
|
+
r(l, v, s, p[b], c + "/" + y + "/" + b, h, c, y, f, b);
|
|
1660
1660
|
} else if (y in e.propsKeywords) {
|
|
1661
1661
|
if (p && typeof p == "object")
|
|
1662
1662
|
for (var a in p)
|
|
1663
|
-
r(
|
|
1664
|
-
} else (y in e.keywords ||
|
|
1663
|
+
r(l, v, s, p[a], c + "/" + y + "/" + S(a), h, c, y, f, a);
|
|
1664
|
+
} else (y in e.keywords || l.allKeys && !(y in e.skipKeywords)) && r(l, v, s, p, c + "/" + y, h, c, y, f);
|
|
1665
1665
|
}
|
|
1666
|
-
s(f, c,
|
|
1666
|
+
s(f, c, h, $, _, P, g);
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
|
-
function S(
|
|
1670
|
-
return
|
|
1669
|
+
function S(l) {
|
|
1670
|
+
return l.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1671
1671
|
}
|
|
1672
1672
|
return kt.exports;
|
|
1673
1673
|
}
|
|
@@ -1675,7 +1675,7 @@ var rr;
|
|
|
1675
1675
|
function yt() {
|
|
1676
1676
|
if (rr) return ne;
|
|
1677
1677
|
rr = 1, Object.defineProperty(ne, "__esModule", { value: !0 }), ne.getSchemaRefs = ne.resolveUrl = ne.normalizeId = ne._getFullPath = ne.getFullPath = ne.inlineRef = void 0;
|
|
1678
|
-
const e = Q(), r = en(), S =
|
|
1678
|
+
const e = Q(), r = en(), S = gn(), l = /* @__PURE__ */ new Set([
|
|
1679
1679
|
"type",
|
|
1680
1680
|
"format",
|
|
1681
1681
|
"pattern",
|
|
@@ -1693,10 +1693,10 @@ function yt() {
|
|
|
1693
1693
|
"enum",
|
|
1694
1694
|
"const"
|
|
1695
1695
|
]);
|
|
1696
|
-
function
|
|
1696
|
+
function v(b, a = !0) {
|
|
1697
1697
|
return typeof b == "boolean" ? !0 : a === !0 ? !f(b) : a ? c(b) <= a : !1;
|
|
1698
1698
|
}
|
|
1699
|
-
ne.inlineRef =
|
|
1699
|
+
ne.inlineRef = v;
|
|
1700
1700
|
const s = /* @__PURE__ */ new Set([
|
|
1701
1701
|
"$ref",
|
|
1702
1702
|
"$recursiveRef",
|
|
@@ -1719,48 +1719,48 @@ function yt() {
|
|
|
1719
1719
|
for (const o in b) {
|
|
1720
1720
|
if (o === "$ref")
|
|
1721
1721
|
return 1 / 0;
|
|
1722
|
-
if (a++, !
|
|
1722
|
+
if (a++, !l.has(o) && (typeof b[o] == "object" && (0, e.eachItem)(b[o], (t) => a += c(t)), a === 1 / 0))
|
|
1723
1723
|
return 1 / 0;
|
|
1724
1724
|
}
|
|
1725
1725
|
return a;
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1727
|
+
function h(b, a = "", o) {
|
|
1728
1728
|
o !== !1 && (a = P(a));
|
|
1729
1729
|
const t = b.parse(a);
|
|
1730
|
-
return
|
|
1730
|
+
return $(b, t);
|
|
1731
1731
|
}
|
|
1732
|
-
ne.getFullPath =
|
|
1733
|
-
function
|
|
1732
|
+
ne.getFullPath = h;
|
|
1733
|
+
function $(b, a) {
|
|
1734
1734
|
return b.serialize(a).split("#")[0] + "#";
|
|
1735
1735
|
}
|
|
1736
|
-
ne._getFullPath =
|
|
1737
|
-
const
|
|
1736
|
+
ne._getFullPath = $;
|
|
1737
|
+
const _ = /#\/?$/;
|
|
1738
1738
|
function P(b) {
|
|
1739
|
-
return b ? b.replace(
|
|
1739
|
+
return b ? b.replace(_, "") : "";
|
|
1740
1740
|
}
|
|
1741
1741
|
ne.normalizeId = P;
|
|
1742
|
-
function
|
|
1742
|
+
function g(b, a, o) {
|
|
1743
1743
|
return o = P(o), b.resolve(a, o);
|
|
1744
1744
|
}
|
|
1745
|
-
ne.resolveUrl =
|
|
1745
|
+
ne.resolveUrl = g;
|
|
1746
1746
|
const y = /^[a-z_][-a-z0-9._]*$/i;
|
|
1747
1747
|
function p(b, a) {
|
|
1748
1748
|
if (typeof b == "boolean")
|
|
1749
1749
|
return {};
|
|
1750
|
-
const { schemaId: o, uriResolver: t } = this.opts, i = P(b[o] || a),
|
|
1750
|
+
const { schemaId: o, uriResolver: t } = this.opts, i = P(b[o] || a), m = { "": i }, n = h(t, i, !1), d = {}, w = /* @__PURE__ */ new Set();
|
|
1751
1751
|
return S(b, { allKeys: !0 }, (D, V, L, K) => {
|
|
1752
1752
|
if (K === void 0)
|
|
1753
1753
|
return;
|
|
1754
1754
|
const B = n + V;
|
|
1755
|
-
let x =
|
|
1756
|
-
typeof D[o] == "string" && (x = de.call(this, D[o])), fe.call(this, D.$anchor), fe.call(this, D.$dynamicAnchor),
|
|
1755
|
+
let x = m[K];
|
|
1756
|
+
typeof D[o] == "string" && (x = de.call(this, D[o])), fe.call(this, D.$anchor), fe.call(this, D.$dynamicAnchor), m[V] = x;
|
|
1757
1757
|
function de(Z) {
|
|
1758
1758
|
const ye = this.opts.uriResolver.resolve;
|
|
1759
|
-
if (Z = P(x ? ye(x, Z) : Z),
|
|
1759
|
+
if (Z = P(x ? ye(x, Z) : Z), w.has(Z))
|
|
1760
1760
|
throw C(Z);
|
|
1761
|
-
|
|
1761
|
+
w.add(Z);
|
|
1762
1762
|
let A = this.refs[Z];
|
|
1763
|
-
return typeof A == "string" && (A = this.refs[A]), typeof A == "object" ? j(D, A.schema, Z) : Z !== P(B) && (Z[0] === "#" ? (j(D,
|
|
1763
|
+
return typeof A == "string" && (A = this.refs[A]), typeof A == "object" ? j(D, A.schema, Z) : Z !== P(B) && (Z[0] === "#" ? (j(D, d[Z], Z), d[Z] = D) : this.refs[Z] = B), Z;
|
|
1764
1764
|
}
|
|
1765
1765
|
function fe(Z) {
|
|
1766
1766
|
if (typeof Z == "string") {
|
|
@@ -1769,7 +1769,7 @@ function yt() {
|
|
|
1769
1769
|
de.call(this, `#${Z}`);
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
1772
|
-
}),
|
|
1772
|
+
}), d;
|
|
1773
1773
|
function j(D, V, L) {
|
|
1774
1774
|
if (V !== void 0 && !r(D, V))
|
|
1775
1775
|
throw C(L);
|
|
@@ -1784,34 +1784,34 @@ var nr;
|
|
|
1784
1784
|
function vt() {
|
|
1785
1785
|
if (nr) return he;
|
|
1786
1786
|
nr = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.getData = he.KeywordCxt = he.validateFunctionCode = void 0;
|
|
1787
|
-
const e =
|
|
1788
|
-
function
|
|
1789
|
-
if (n(N) && (
|
|
1787
|
+
const e = pn(), r = mt(), S = xr(), l = mt(), v = yn(), s = vn(), f = _n(), c = J(), h = _e(), $ = yt(), _ = Q(), P = pt();
|
|
1788
|
+
function g(N) {
|
|
1789
|
+
if (n(N) && (w(N), m(N))) {
|
|
1790
1790
|
a(N);
|
|
1791
1791
|
return;
|
|
1792
1792
|
}
|
|
1793
1793
|
y(N, () => (0, e.topBoolOrEmptySchema)(N));
|
|
1794
1794
|
}
|
|
1795
|
-
he.validateFunctionCode =
|
|
1795
|
+
he.validateFunctionCode = g;
|
|
1796
1796
|
function y({ gen: N, validateName: k, schema: q, schemaEnv: M, opts: z }, G) {
|
|
1797
|
-
z.code.es5 ? N.func(k, (0, c._)`${
|
|
1797
|
+
z.code.es5 ? N.func(k, (0, c._)`${h.default.data}, ${h.default.valCxt}`, M.$async, () => {
|
|
1798
1798
|
N.code((0, c._)`"use strict"; ${t(q, z)}`), b(N, z), N.code(G);
|
|
1799
|
-
}) : N.func(k, (0, c._)`${
|
|
1799
|
+
}) : N.func(k, (0, c._)`${h.default.data}, ${p(z)}`, M.$async, () => N.code(t(q, z)).code(G));
|
|
1800
1800
|
}
|
|
1801
1801
|
function p(N) {
|
|
1802
|
-
return (0, c._)`{${
|
|
1802
|
+
return (0, c._)`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${N.dynamicRef ? (0, c._)`, ${h.default.dynamicAnchors}={}` : c.nil}}={}`;
|
|
1803
1803
|
}
|
|
1804
1804
|
function b(N, k) {
|
|
1805
|
-
N.if(
|
|
1806
|
-
N.var(
|
|
1805
|
+
N.if(h.default.valCxt, () => {
|
|
1806
|
+
N.var(h.default.instancePath, (0, c._)`${h.default.valCxt}.${h.default.instancePath}`), N.var(h.default.parentData, (0, c._)`${h.default.valCxt}.${h.default.parentData}`), N.var(h.default.parentDataProperty, (0, c._)`${h.default.valCxt}.${h.default.parentDataProperty}`), N.var(h.default.rootData, (0, c._)`${h.default.valCxt}.${h.default.rootData}`), k.dynamicRef && N.var(h.default.dynamicAnchors, (0, c._)`${h.default.valCxt}.${h.default.dynamicAnchors}`);
|
|
1807
1807
|
}, () => {
|
|
1808
|
-
N.var(
|
|
1808
|
+
N.var(h.default.instancePath, (0, c._)`""`), N.var(h.default.parentData, (0, c._)`undefined`), N.var(h.default.parentDataProperty, (0, c._)`undefined`), N.var(h.default.rootData, h.default.data), k.dynamicRef && N.var(h.default.dynamicAnchors, (0, c._)`{}`);
|
|
1809
1809
|
});
|
|
1810
1810
|
}
|
|
1811
1811
|
function a(N) {
|
|
1812
1812
|
const { schema: k, opts: q, gen: M } = N;
|
|
1813
1813
|
y(N, () => {
|
|
1814
|
-
q.$comment && k.$comment && K(N), D(N), M.let(
|
|
1814
|
+
q.$comment && k.$comment && K(N), D(N), M.let(h.default.vErrors, null), M.let(h.default.errors, 0), q.unevaluated && o(N), j(N), B(N);
|
|
1815
1815
|
});
|
|
1816
1816
|
}
|
|
1817
1817
|
function o(N) {
|
|
@@ -1823,13 +1823,13 @@ function vt() {
|
|
|
1823
1823
|
return q && (k.code.source || k.code.process) ? (0, c._)`/*# sourceURL=${q} */` : c.nil;
|
|
1824
1824
|
}
|
|
1825
1825
|
function i(N, k) {
|
|
1826
|
-
if (n(N) && (
|
|
1827
|
-
|
|
1826
|
+
if (n(N) && (w(N), m(N))) {
|
|
1827
|
+
d(N, k);
|
|
1828
1828
|
return;
|
|
1829
1829
|
}
|
|
1830
1830
|
(0, e.boolOrEmptySchema)(N, k);
|
|
1831
1831
|
}
|
|
1832
|
-
function
|
|
1832
|
+
function m({ schema: N, self: k }) {
|
|
1833
1833
|
if (typeof N == "boolean")
|
|
1834
1834
|
return !N;
|
|
1835
1835
|
for (const q in N)
|
|
@@ -1840,14 +1840,14 @@ function vt() {
|
|
|
1840
1840
|
function n(N) {
|
|
1841
1841
|
return typeof N.schema != "boolean";
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1843
|
+
function d(N, k) {
|
|
1844
1844
|
const { schema: q, gen: M, opts: z } = N;
|
|
1845
1845
|
z.$comment && q.$comment && K(N), V(N), L(N);
|
|
1846
|
-
const G = M.const("_errs",
|
|
1847
|
-
j(N, G), M.var(k, (0, c._)`${G} === ${
|
|
1846
|
+
const G = M.const("_errs", h.default.errors);
|
|
1847
|
+
j(N, G), M.var(k, (0, c._)`${G} === ${h.default.errors}`);
|
|
1848
1848
|
}
|
|
1849
|
-
function
|
|
1850
|
-
(0,
|
|
1849
|
+
function w(N) {
|
|
1850
|
+
(0, _.checkUnknownRules)(N), C(N);
|
|
1851
1851
|
}
|
|
1852
1852
|
function j(N, k) {
|
|
1853
1853
|
if (N.opts.jtd)
|
|
@@ -1857,15 +1857,15 @@ function vt() {
|
|
|
1857
1857
|
}
|
|
1858
1858
|
function C(N) {
|
|
1859
1859
|
const { schema: k, errSchemaPath: q, opts: M, self: z } = N;
|
|
1860
|
-
k.$ref && M.ignoreKeywordsWithRef && (0,
|
|
1860
|
+
k.$ref && M.ignoreKeywordsWithRef && (0, _.schemaHasRulesButRef)(k, z.RULES) && z.logger.warn(`$ref: keywords ignored in schema at path "${q}"`);
|
|
1861
1861
|
}
|
|
1862
1862
|
function D(N) {
|
|
1863
1863
|
const { schema: k, opts: q } = N;
|
|
1864
|
-
k.default !== void 0 && q.useDefaults && q.strictSchema && (0,
|
|
1864
|
+
k.default !== void 0 && q.useDefaults && q.strictSchema && (0, _.checkStrictMode)(N, "default is ignored in the schema root");
|
|
1865
1865
|
}
|
|
1866
1866
|
function V(N) {
|
|
1867
1867
|
const k = N.schema[N.opts.schemaId];
|
|
1868
|
-
k && (N.baseId = (0,
|
|
1868
|
+
k && (N.baseId = (0, $.resolveUrl)(N.opts.uriResolver, N.baseId, k));
|
|
1869
1869
|
}
|
|
1870
1870
|
function L(N) {
|
|
1871
1871
|
if (N.schema.$async && !N.schemaEnv.$async)
|
|
@@ -1874,22 +1874,22 @@ function vt() {
|
|
|
1874
1874
|
function K({ gen: N, schemaEnv: k, schema: q, errSchemaPath: M, opts: z }) {
|
|
1875
1875
|
const G = q.$comment;
|
|
1876
1876
|
if (z.$comment === !0)
|
|
1877
|
-
N.code((0, c._)`${
|
|
1877
|
+
N.code((0, c._)`${h.default.self}.logger.log(${G})`);
|
|
1878
1878
|
else if (typeof z.$comment == "function") {
|
|
1879
1879
|
const ee = (0, c.str)`${M}/$comment`, ue = N.scopeValue("root", { ref: k.root });
|
|
1880
|
-
N.code((0, c._)`${
|
|
1880
|
+
N.code((0, c._)`${h.default.self}.opts.$comment(${G}, ${ee}, ${ue}.schema)`);
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
1883
1883
|
function B(N) {
|
|
1884
1884
|
const { gen: k, schemaEnv: q, validateName: M, ValidationError: z, opts: G } = N;
|
|
1885
|
-
q.$async ? k.if((0, c._)`${
|
|
1885
|
+
q.$async ? k.if((0, c._)`${h.default.errors} === 0`, () => k.return(h.default.data), () => k.throw((0, c._)`new ${z}(${h.default.vErrors})`)) : (k.assign((0, c._)`${M}.errors`, h.default.vErrors), G.unevaluated && x(N), k.return((0, c._)`${h.default.errors} === 0`));
|
|
1886
1886
|
}
|
|
1887
1887
|
function x({ gen: N, evaluated: k, props: q, items: M }) {
|
|
1888
1888
|
q instanceof c.Name && N.assign((0, c._)`${k}.props`, q), M instanceof c.Name && N.assign((0, c._)`${k}.items`, M);
|
|
1889
1889
|
}
|
|
1890
1890
|
function de(N, k, q, M) {
|
|
1891
1891
|
const { gen: z, schema: G, data: ee, allErrors: ue, opts: se, self: ae } = N, { RULES: te } = ae;
|
|
1892
|
-
if (G.$ref && (se.ignoreKeywordsWithRef || !(0,
|
|
1892
|
+
if (G.$ref && (se.ignoreKeywordsWithRef || !(0, _.schemaHasRulesButRef)(G, te))) {
|
|
1893
1893
|
z.block(() => U(N, "$ref", te.all.$ref.definition));
|
|
1894
1894
|
return;
|
|
1895
1895
|
}
|
|
@@ -1899,12 +1899,12 @@ function vt() {
|
|
|
1899
1899
|
be(te.post);
|
|
1900
1900
|
});
|
|
1901
1901
|
function be(oe) {
|
|
1902
|
-
(0, S.shouldUseGroup)(G, oe) && (oe.type ? (z.if((0,
|
|
1902
|
+
(0, S.shouldUseGroup)(G, oe) && (oe.type ? (z.if((0, l.checkDataType)(oe.type, ee, se.strictNumbers)), fe(N, oe), k.length === 1 && k[0] === oe.type && q && (z.else(), (0, l.reportTypeError)(N)), z.endIf()) : fe(N, oe), ue || z.if((0, c._)`${h.default.errors} === ${M || 0}`));
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
function fe(N, k) {
|
|
1906
1906
|
const { gen: q, schema: M, opts: { useDefaults: z } } = N;
|
|
1907
|
-
z && (0,
|
|
1907
|
+
z && (0, v.assignDefaults)(N, k.type), q.block(() => {
|
|
1908
1908
|
for (const G of k.rules)
|
|
1909
1909
|
(0, S.shouldUseRule)(M, G) && U(N, G.keyword, G.definition, k.type);
|
|
1910
1910
|
});
|
|
@@ -1950,15 +1950,15 @@ function vt() {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
function E(N, k) {
|
|
1952
1952
|
const q = N.schemaEnv.baseId + N.errSchemaPath;
|
|
1953
|
-
k += ` at "${q}" (strictTypes)`, (0,
|
|
1953
|
+
k += ` at "${q}" (strictTypes)`, (0, _.checkStrictMode)(N, k, N.opts.strictTypes);
|
|
1954
1954
|
}
|
|
1955
1955
|
class I {
|
|
1956
1956
|
constructor(k, q, M) {
|
|
1957
|
-
if ((0, s.validateKeywordUsage)(k, q, M), this.gen = k.gen, this.allErrors = k.allErrors, this.keyword = M, this.data = k.data, this.schema = k.schema[M], this.$data = q.$data && k.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0,
|
|
1957
|
+
if ((0, s.validateKeywordUsage)(k, q, M), this.gen = k.gen, this.allErrors = k.allErrors, this.keyword = M, this.data = k.data, this.schema = k.schema[M], this.$data = q.$data && k.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, _.schemaRefOrVal)(k, this.schema, M, this.$data), this.schemaType = q.schemaType, this.parentSchema = k.schema, this.params = {}, this.it = k, this.def = q, this.$data)
|
|
1958
1958
|
this.schemaCode = k.gen.const("vSchema", W(this.$data, k));
|
|
1959
1959
|
else if (this.schemaCode = this.schemaValue, !(0, s.validSchemaType)(this.schema, q.schemaType, q.allowUndefined))
|
|
1960
1960
|
throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);
|
|
1961
|
-
("code" in q ? q.trackErrors : q.errors !== !1) && (this.errsCount = k.gen.const("_errs",
|
|
1961
|
+
("code" in q ? q.trackErrors : q.errors !== !1) && (this.errsCount = k.gen.const("_errs", h.default.errors));
|
|
1962
1962
|
}
|
|
1963
1963
|
result(k, q, M) {
|
|
1964
1964
|
this.failResult((0, c.not)(k), q, M);
|
|
@@ -2025,7 +2025,7 @@ function vt() {
|
|
|
2025
2025
|
if (!(q instanceof c.Name))
|
|
2026
2026
|
throw new Error("ajv implementation error");
|
|
2027
2027
|
const se = Array.isArray(M) ? M : [M];
|
|
2028
|
-
return (0, c._)`${(0,
|
|
2028
|
+
return (0, c._)`${(0, l.checkDataTypes)(se, q, G.opts.strictNumbers, l.DataType.Wrong)}`;
|
|
2029
2029
|
}
|
|
2030
2030
|
return c.nil;
|
|
2031
2031
|
}
|
|
@@ -2045,7 +2045,7 @@ function vt() {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
mergeEvaluated(k, q) {
|
|
2047
2047
|
const { it: M, gen: z } = this;
|
|
2048
|
-
M.opts.unevaluated && (M.props !== !0 && k.props !== void 0 && (M.props =
|
|
2048
|
+
M.opts.unevaluated && (M.props !== !0 && k.props !== void 0 && (M.props = _.mergeEvaluated.props(z, k.props, M.props, q)), M.items !== !0 && k.items !== void 0 && (M.items = _.mergeEvaluated.items(z, k.items, M.items, q)));
|
|
2049
2049
|
}
|
|
2050
2050
|
mergeValidEvaluated(k, q) {
|
|
2051
2051
|
const { it: M, gen: z } = this;
|
|
@@ -2062,11 +2062,11 @@ function vt() {
|
|
|
2062
2062
|
function W(N, { dataLevel: k, dataNames: q, dataPathArr: M }) {
|
|
2063
2063
|
let z, G;
|
|
2064
2064
|
if (N === "")
|
|
2065
|
-
return
|
|
2065
|
+
return h.default.rootData;
|
|
2066
2066
|
if (N[0] === "/") {
|
|
2067
2067
|
if (!F.test(N))
|
|
2068
2068
|
throw new Error(`Invalid JSON-pointer: ${N}`);
|
|
2069
|
-
z = N, G =
|
|
2069
|
+
z = N, G = h.default.rootData;
|
|
2070
2070
|
} else {
|
|
2071
2071
|
const ae = X.exec(N);
|
|
2072
2072
|
if (!ae)
|
|
@@ -2085,7 +2085,7 @@ function vt() {
|
|
|
2085
2085
|
let ee = G;
|
|
2086
2086
|
const ue = z.split("/");
|
|
2087
2087
|
for (const ae of ue)
|
|
2088
|
-
ae && (G = (0, c._)`${G}${(0, c.getProperty)((0,
|
|
2088
|
+
ae && (G = (0, c._)`${G}${(0, c.getProperty)((0, _.unescapeJsonPointer)(ae))}`, ee = (0, c._)`${ee} && ${G}`);
|
|
2089
2089
|
return ee;
|
|
2090
2090
|
function se(ae, te) {
|
|
2091
2091
|
return `Cannot access ${ae} ${te} levels up, current level is ${k}`;
|
|
@@ -2110,8 +2110,8 @@ function _t() {
|
|
|
2110
2110
|
ar = 1, Object.defineProperty(qe, "__esModule", { value: !0 });
|
|
2111
2111
|
const e = yt();
|
|
2112
2112
|
class r extends Error {
|
|
2113
|
-
constructor(
|
|
2114
|
-
super(f || `can't resolve reference ${s} from id ${
|
|
2113
|
+
constructor(l, v, s, f) {
|
|
2114
|
+
super(f || `can't resolve reference ${s} from id ${v}`), this.missingRef = (0, e.resolveUrl)(l, v, s), this.missingSchema = (0, e.normalizeId)((0, e.getFullPath)(l, this.missingRef));
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
return qe.default = r, qe;
|
|
@@ -2120,30 +2120,30 @@ var ie = {}, ir;
|
|
|
2120
2120
|
function At() {
|
|
2121
2121
|
if (ir) return ie;
|
|
2122
2122
|
ir = 1, Object.defineProperty(ie, "__esModule", { value: !0 }), ie.resolveSchema = ie.getCompilingSchema = ie.resolveRef = ie.compileSchema = ie.SchemaEnv = void 0;
|
|
2123
|
-
const e = J(), r = Ct(), S = _e(),
|
|
2123
|
+
const e = J(), r = Ct(), S = _e(), l = yt(), v = Q(), s = vt();
|
|
2124
2124
|
class f {
|
|
2125
2125
|
constructor(o) {
|
|
2126
2126
|
var t;
|
|
2127
2127
|
this.refs = {}, this.dynamicAnchors = {};
|
|
2128
2128
|
let i;
|
|
2129
|
-
typeof o.schema == "object" && (i = o.schema), this.schema = o.schema, this.schemaId = o.schemaId, this.root = o.root || this, this.baseId = (t = o.baseId) !== null && t !== void 0 ? t : (0,
|
|
2129
|
+
typeof o.schema == "object" && (i = o.schema), this.schema = o.schema, this.schemaId = o.schemaId, this.root = o.root || this, this.baseId = (t = o.baseId) !== null && t !== void 0 ? t : (0, l.normalizeId)(i?.[o.schemaId || "$id"]), this.schemaPath = o.schemaPath, this.localRefs = o.localRefs, this.meta = o.meta, this.$async = i?.$async, this.refs = {};
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
2132
2132
|
ie.SchemaEnv = f;
|
|
2133
2133
|
function c(a) {
|
|
2134
|
-
const o =
|
|
2134
|
+
const o = _.call(this, a);
|
|
2135
2135
|
if (o)
|
|
2136
2136
|
return o;
|
|
2137
|
-
const t = (0,
|
|
2138
|
-
let
|
|
2139
|
-
a.$async && (
|
|
2137
|
+
const t = (0, l.getFullPath)(this.opts.uriResolver, a.root.baseId), { es5: i, lines: m } = this.opts.code, { ownProperties: n } = this.opts, d = new e.CodeGen(this.scope, { es5: i, lines: m, ownProperties: n });
|
|
2138
|
+
let w;
|
|
2139
|
+
a.$async && (w = d.scopeValue("Error", {
|
|
2140
2140
|
ref: r.default,
|
|
2141
2141
|
code: (0, e._)`require("ajv/dist/runtime/validation_error").default`
|
|
2142
2142
|
}));
|
|
2143
|
-
const j =
|
|
2143
|
+
const j = d.scopeName("validate");
|
|
2144
2144
|
a.validateName = j;
|
|
2145
2145
|
const C = {
|
|
2146
|
-
gen:
|
|
2146
|
+
gen: d,
|
|
2147
2147
|
allErrors: this.opts.allErrors,
|
|
2148
2148
|
data: S.default.data,
|
|
2149
2149
|
parentData: S.default.parentData,
|
|
@@ -2154,9 +2154,9 @@ function At() {
|
|
|
2154
2154
|
dataLevel: 0,
|
|
2155
2155
|
dataTypes: [],
|
|
2156
2156
|
definedProperties: /* @__PURE__ */ new Set(),
|
|
2157
|
-
topSchemaRef:
|
|
2157
|
+
topSchemaRef: d.scopeValue("schema", this.opts.code.source === !0 ? { ref: a.schema, code: (0, e.stringify)(a.schema) } : { ref: a.schema }),
|
|
2158
2158
|
validateName: j,
|
|
2159
|
-
ValidationError:
|
|
2159
|
+
ValidationError: w,
|
|
2160
2160
|
schema: a.schema,
|
|
2161
2161
|
schemaEnv: a,
|
|
2162
2162
|
rootId: t,
|
|
@@ -2169,11 +2169,11 @@ function At() {
|
|
|
2169
2169
|
};
|
|
2170
2170
|
let D;
|
|
2171
2171
|
try {
|
|
2172
|
-
this._compilations.add(a), (0, s.validateFunctionCode)(C),
|
|
2173
|
-
const V =
|
|
2174
|
-
D = `${
|
|
2172
|
+
this._compilations.add(a), (0, s.validateFunctionCode)(C), d.optimize(this.opts.code.optimize);
|
|
2173
|
+
const V = d.toString();
|
|
2174
|
+
D = `${d.scopeRefs(S.default.scope)}return ${V}`, this.opts.code.process && (D = this.opts.code.process(D, a));
|
|
2175
2175
|
const K = new Function(`${S.default.self}`, `${S.default.scope}`, D)(this, this.scope.get());
|
|
2176
|
-
if (this.scope.value(j, { ref: K }), K.errors = null, K.schema = a.schema, K.schemaEnv = a, a.$async && (K.$async = !0), this.opts.code.source === !0 && (K.source = { validateName: j, validateCode: V, scopeValues:
|
|
2176
|
+
if (this.scope.value(j, { ref: K }), K.errors = null, K.schema = a.schema, K.schemaEnv = a, a.$async && (K.$async = !0), this.opts.code.source === !0 && (K.source = { validateName: j, validateCode: V, scopeValues: d._values }), this.opts.unevaluated) {
|
|
2177
2177
|
const { props: B, items: x } = C;
|
|
2178
2178
|
K.evaluated = {
|
|
2179
2179
|
props: B instanceof e.Name ? void 0 : B,
|
|
@@ -2190,55 +2190,55 @@ function At() {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
2192
|
ie.compileSchema = c;
|
|
2193
|
-
function
|
|
2193
|
+
function h(a, o, t) {
|
|
2194
2194
|
var i;
|
|
2195
|
-
t = (0,
|
|
2196
|
-
const
|
|
2197
|
-
if (
|
|
2198
|
-
return
|
|
2199
|
-
let n =
|
|
2195
|
+
t = (0, l.resolveUrl)(this.opts.uriResolver, o, t);
|
|
2196
|
+
const m = a.refs[t];
|
|
2197
|
+
if (m)
|
|
2198
|
+
return m;
|
|
2199
|
+
let n = g.call(this, a, t);
|
|
2200
2200
|
if (n === void 0) {
|
|
2201
|
-
const
|
|
2202
|
-
|
|
2201
|
+
const d = (i = a.localRefs) === null || i === void 0 ? void 0 : i[t], { schemaId: w } = this.opts;
|
|
2202
|
+
d && (n = new f({ schema: d, schemaId: w, root: a, baseId: o }));
|
|
2203
2203
|
}
|
|
2204
2204
|
if (n !== void 0)
|
|
2205
|
-
return a.refs[t] =
|
|
2205
|
+
return a.refs[t] = $.call(this, n);
|
|
2206
2206
|
}
|
|
2207
|
-
ie.resolveRef =
|
|
2208
|
-
function
|
|
2209
|
-
return (0,
|
|
2207
|
+
ie.resolveRef = h;
|
|
2208
|
+
function $(a) {
|
|
2209
|
+
return (0, l.inlineRef)(a.schema, this.opts.inlineRefs) ? a.schema : a.validate ? a : c.call(this, a);
|
|
2210
2210
|
}
|
|
2211
|
-
function
|
|
2211
|
+
function _(a) {
|
|
2212
2212
|
for (const o of this._compilations)
|
|
2213
2213
|
if (P(o, a))
|
|
2214
2214
|
return o;
|
|
2215
2215
|
}
|
|
2216
|
-
ie.getCompilingSchema =
|
|
2216
|
+
ie.getCompilingSchema = _;
|
|
2217
2217
|
function P(a, o) {
|
|
2218
2218
|
return a.schema === o.schema && a.root === o.root && a.baseId === o.baseId;
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function g(a, o) {
|
|
2221
2221
|
let t;
|
|
2222
2222
|
for (; typeof (t = this.refs[o]) == "string"; )
|
|
2223
2223
|
o = t;
|
|
2224
2224
|
return t || this.schemas[o] || y.call(this, a, o);
|
|
2225
2225
|
}
|
|
2226
2226
|
function y(a, o) {
|
|
2227
|
-
const t = this.opts.uriResolver.parse(o), i = (0,
|
|
2228
|
-
let
|
|
2229
|
-
if (Object.keys(a.schema).length > 0 && i ===
|
|
2227
|
+
const t = this.opts.uriResolver.parse(o), i = (0, l._getFullPath)(this.opts.uriResolver, t);
|
|
2228
|
+
let m = (0, l.getFullPath)(this.opts.uriResolver, a.baseId, void 0);
|
|
2229
|
+
if (Object.keys(a.schema).length > 0 && i === m)
|
|
2230
2230
|
return b.call(this, t, a);
|
|
2231
|
-
const n = (0,
|
|
2232
|
-
if (typeof
|
|
2233
|
-
const
|
|
2234
|
-
return typeof
|
|
2231
|
+
const n = (0, l.normalizeId)(i), d = this.refs[n] || this.schemas[n];
|
|
2232
|
+
if (typeof d == "string") {
|
|
2233
|
+
const w = y.call(this, a, d);
|
|
2234
|
+
return typeof w?.schema != "object" ? void 0 : b.call(this, t, w);
|
|
2235
2235
|
}
|
|
2236
|
-
if (typeof
|
|
2237
|
-
if (
|
|
2238
|
-
const { schema:
|
|
2239
|
-
return C && (
|
|
2236
|
+
if (typeof d?.schema == "object") {
|
|
2237
|
+
if (d.validate || c.call(this, d), n === (0, l.normalizeId)(o)) {
|
|
2238
|
+
const { schema: w } = d, { schemaId: j } = this.opts, C = w[j];
|
|
2239
|
+
return C && (m = (0, l.resolveUrl)(this.opts.uriResolver, m, C)), new f({ schema: w, schemaId: j, root: a, baseId: m });
|
|
2240
2240
|
}
|
|
2241
|
-
return b.call(this, t,
|
|
2241
|
+
return b.call(this, t, d);
|
|
2242
2242
|
}
|
|
2243
2243
|
}
|
|
2244
2244
|
ie.resolveSchema = y;
|
|
@@ -2250,80 +2250,80 @@ function At() {
|
|
|
2250
2250
|
"definitions"
|
|
2251
2251
|
]);
|
|
2252
2252
|
function b(a, { baseId: o, schema: t, root: i }) {
|
|
2253
|
-
var
|
|
2254
|
-
if (((
|
|
2253
|
+
var m;
|
|
2254
|
+
if (((m = a.fragment) === null || m === void 0 ? void 0 : m[0]) !== "/")
|
|
2255
2255
|
return;
|
|
2256
|
-
for (const
|
|
2256
|
+
for (const w of a.fragment.slice(1).split("/")) {
|
|
2257
2257
|
if (typeof t == "boolean")
|
|
2258
2258
|
return;
|
|
2259
|
-
const j = t[(0,
|
|
2259
|
+
const j = t[(0, v.unescapeFragment)(w)];
|
|
2260
2260
|
if (j === void 0)
|
|
2261
2261
|
return;
|
|
2262
2262
|
t = j;
|
|
2263
2263
|
const C = typeof t == "object" && t[this.opts.schemaId];
|
|
2264
|
-
!p.has(
|
|
2264
|
+
!p.has(w) && C && (o = (0, l.resolveUrl)(this.opts.uriResolver, o, C));
|
|
2265
2265
|
}
|
|
2266
2266
|
let n;
|
|
2267
|
-
if (typeof t != "boolean" && t.$ref && !(0,
|
|
2268
|
-
const
|
|
2269
|
-
n = y.call(this, i,
|
|
2267
|
+
if (typeof t != "boolean" && t.$ref && !(0, v.schemaHasRulesButRef)(t, this.RULES)) {
|
|
2268
|
+
const w = (0, l.resolveUrl)(this.opts.uriResolver, o, t.$ref);
|
|
2269
|
+
n = y.call(this, i, w);
|
|
2270
2270
|
}
|
|
2271
|
-
const { schemaId:
|
|
2272
|
-
if (n = n || new f({ schema: t, schemaId:
|
|
2271
|
+
const { schemaId: d } = this.opts;
|
|
2272
|
+
if (n = n || new f({ schema: t, schemaId: d, root: i, baseId: o }), n.schema !== n.root.schema)
|
|
2273
2273
|
return n;
|
|
2274
2274
|
}
|
|
2275
2275
|
return ie;
|
|
2276
2276
|
}
|
|
2277
|
-
const
|
|
2278
|
-
$id:
|
|
2279
|
-
description:
|
|
2280
|
-
type:
|
|
2281
|
-
required:
|
|
2282
|
-
properties:
|
|
2283
|
-
additionalProperties:
|
|
2277
|
+
const $n = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", wn = "Meta-schema for $data reference (JSON AnySchema extension proposal)", bn = "object", En = ["$data"], Sn = { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, Pn = !1, Nn = {
|
|
2278
|
+
$id: $n,
|
|
2279
|
+
description: wn,
|
|
2280
|
+
type: bn,
|
|
2281
|
+
required: En,
|
|
2282
|
+
properties: Sn,
|
|
2283
|
+
additionalProperties: Pn
|
|
2284
2284
|
};
|
|
2285
2285
|
var Te = {}, Re = { exports: {} }, Ot, or;
|
|
2286
2286
|
function tn() {
|
|
2287
2287
|
if (or) return Ot;
|
|
2288
2288
|
or = 1;
|
|
2289
2289
|
const e = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), r = 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);
|
|
2290
|
-
function S(
|
|
2290
|
+
function S(g) {
|
|
2291
2291
|
let y = "", p = 0, b = 0;
|
|
2292
|
-
for (b = 0; b <
|
|
2293
|
-
if (p =
|
|
2292
|
+
for (b = 0; b < g.length; b++)
|
|
2293
|
+
if (p = g[b].charCodeAt(0), p !== 48) {
|
|
2294
2294
|
if (!(p >= 48 && p <= 57 || p >= 65 && p <= 70 || p >= 97 && p <= 102))
|
|
2295
2295
|
return "";
|
|
2296
|
-
y +=
|
|
2296
|
+
y += g[b];
|
|
2297
2297
|
break;
|
|
2298
2298
|
}
|
|
2299
|
-
for (b += 1; b <
|
|
2300
|
-
if (p =
|
|
2299
|
+
for (b += 1; b < g.length; b++) {
|
|
2300
|
+
if (p = g[b].charCodeAt(0), !(p >= 48 && p <= 57 || p >= 65 && p <= 70 || p >= 97 && p <= 102))
|
|
2301
2301
|
return "";
|
|
2302
|
-
y +=
|
|
2302
|
+
y += g[b];
|
|
2303
2303
|
}
|
|
2304
2304
|
return y;
|
|
2305
2305
|
}
|
|
2306
|
-
const
|
|
2307
|
-
function g
|
|
2308
|
-
return
|
|
2306
|
+
const l = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
2307
|
+
function v(g) {
|
|
2308
|
+
return g.length = 0, !0;
|
|
2309
2309
|
}
|
|
2310
|
-
function s(
|
|
2311
|
-
if (
|
|
2312
|
-
const b = S(
|
|
2310
|
+
function s(g, y, p) {
|
|
2311
|
+
if (g.length) {
|
|
2312
|
+
const b = S(g);
|
|
2313
2313
|
if (b !== "")
|
|
2314
2314
|
y.push(b);
|
|
2315
2315
|
else
|
|
2316
2316
|
return p.error = !0, !1;
|
|
2317
|
-
|
|
2317
|
+
g.length = 0;
|
|
2318
2318
|
}
|
|
2319
2319
|
return !0;
|
|
2320
2320
|
}
|
|
2321
|
-
function f(
|
|
2321
|
+
function f(g) {
|
|
2322
2322
|
let y = 0;
|
|
2323
2323
|
const p = { error: !1, address: "", zone: "" }, b = [], a = [];
|
|
2324
2324
|
let o = !1, t = !1, i = s;
|
|
2325
|
-
for (let
|
|
2326
|
-
const n =
|
|
2325
|
+
for (let m = 0; m < g.length; m++) {
|
|
2326
|
+
const n = g[m];
|
|
2327
2327
|
if (!(n === "[" || n === "]"))
|
|
2328
2328
|
if (n === ":") {
|
|
2329
2329
|
if (o === !0 && (t = !0), !i(a, b, p))
|
|
@@ -2332,38 +2332,38 @@ function tn() {
|
|
|
2332
2332
|
p.error = !0;
|
|
2333
2333
|
break;
|
|
2334
2334
|
}
|
|
2335
|
-
|
|
2335
|
+
m > 0 && g[m - 1] === ":" && (o = !0), b.push(":");
|
|
2336
2336
|
continue;
|
|
2337
2337
|
} else if (n === "%") {
|
|
2338
2338
|
if (!i(a, b, p))
|
|
2339
2339
|
break;
|
|
2340
|
-
i =
|
|
2340
|
+
i = v;
|
|
2341
2341
|
} else {
|
|
2342
2342
|
a.push(n);
|
|
2343
2343
|
continue;
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
-
return a.length && (i ===
|
|
2346
|
+
return a.length && (i === v ? p.zone = a.join("") : t ? b.push(a.join("")) : b.push(S(a))), p.address = b.join(""), p;
|
|
2347
2347
|
}
|
|
2348
|
-
function c(
|
|
2349
|
-
if (
|
|
2350
|
-
return { host:
|
|
2351
|
-
const y = f(
|
|
2348
|
+
function c(g) {
|
|
2349
|
+
if (h(g, ":") < 2)
|
|
2350
|
+
return { host: g, isIPV6: !1 };
|
|
2351
|
+
const y = f(g);
|
|
2352
2352
|
if (y.error)
|
|
2353
|
-
return { host:
|
|
2353
|
+
return { host: g, isIPV6: !1 };
|
|
2354
2354
|
{
|
|
2355
2355
|
let p = y.address, b = y.address;
|
|
2356
2356
|
return y.zone && (p += "%" + y.zone, b += "%25" + y.zone), { host: p, isIPV6: !0, escapedHost: b };
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
|
-
function
|
|
2359
|
+
function h(g, y) {
|
|
2360
2360
|
let p = 0;
|
|
2361
|
-
for (let b = 0; b <
|
|
2362
|
-
|
|
2361
|
+
for (let b = 0; b < g.length; b++)
|
|
2362
|
+
g[b] === y && p++;
|
|
2363
2363
|
return p;
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2366
|
-
let y =
|
|
2365
|
+
function $(g) {
|
|
2366
|
+
let y = g;
|
|
2367
2367
|
const p = [];
|
|
2368
2368
|
let b = -1, a = 0;
|
|
2369
2369
|
for (; a = y.length; ) {
|
|
@@ -2420,27 +2420,27 @@ function tn() {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
return p.join("");
|
|
2422
2422
|
}
|
|
2423
|
-
function
|
|
2423
|
+
function _(g, y) {
|
|
2424
2424
|
const p = y !== !0 ? escape : unescape;
|
|
2425
|
-
return
|
|
2425
|
+
return g.scheme !== void 0 && (g.scheme = p(g.scheme)), g.userinfo !== void 0 && (g.userinfo = p(g.userinfo)), g.host !== void 0 && (g.host = p(g.host)), g.path !== void 0 && (g.path = p(g.path)), g.query !== void 0 && (g.query = p(g.query)), g.fragment !== void 0 && (g.fragment = p(g.fragment)), g;
|
|
2426
2426
|
}
|
|
2427
|
-
function P(
|
|
2427
|
+
function P(g) {
|
|
2428
2428
|
const y = [];
|
|
2429
|
-
if (
|
|
2430
|
-
let p = unescape(
|
|
2429
|
+
if (g.userinfo !== void 0 && (y.push(g.userinfo), y.push("@")), g.host !== void 0) {
|
|
2430
|
+
let p = unescape(g.host);
|
|
2431
2431
|
if (!r(p)) {
|
|
2432
2432
|
const b = c(p);
|
|
2433
|
-
b.isIPV6 === !0 ? p = `[${b.escapedHost}]` : p =
|
|
2433
|
+
b.isIPV6 === !0 ? p = `[${b.escapedHost}]` : p = g.host;
|
|
2434
2434
|
}
|
|
2435
2435
|
y.push(p);
|
|
2436
2436
|
}
|
|
2437
|
-
return (typeof
|
|
2437
|
+
return (typeof g.port == "number" || typeof g.port == "string") && (y.push(":"), y.push(String(g.port))), y.length ? y.join("") : void 0;
|
|
2438
2438
|
}
|
|
2439
2439
|
return Ot = {
|
|
2440
|
-
nonSimpleDomain:
|
|
2440
|
+
nonSimpleDomain: l,
|
|
2441
2441
|
recomposeAuthority: P,
|
|
2442
|
-
normalizeComponentEncoding:
|
|
2443
|
-
removeDotSegments:
|
|
2442
|
+
normalizeComponentEncoding: _,
|
|
2443
|
+
removeDotSegments: $,
|
|
2444
2444
|
isIPv4: r,
|
|
2445
2445
|
isUUID: e,
|
|
2446
2446
|
normalizeIPv6: c,
|
|
@@ -2448,7 +2448,7 @@ function tn() {
|
|
|
2448
2448
|
}, Ot;
|
|
2449
2449
|
}
|
|
2450
2450
|
var jt, ur;
|
|
2451
|
-
function
|
|
2451
|
+
function Rn() {
|
|
2452
2452
|
if (ur) return jt;
|
|
2453
2453
|
ur = 1;
|
|
2454
2454
|
const { isUUID: e } = tn(), r = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu, S = (
|
|
@@ -2462,60 +2462,60 @@ function Pn() {
|
|
|
2462
2462
|
"urn:uuid"
|
|
2463
2463
|
]
|
|
2464
2464
|
);
|
|
2465
|
-
function
|
|
2465
|
+
function l(n) {
|
|
2466
2466
|
return S.indexOf(
|
|
2467
2467
|
/** @type {*} */
|
|
2468
2468
|
n
|
|
2469
2469
|
) !== -1;
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function v(n) {
|
|
2472
2472
|
return n.secure === !0 ? !0 : n.secure === !1 ? !1 : n.scheme ? n.scheme.length === 3 && (n.scheme[0] === "w" || n.scheme[0] === "W") && (n.scheme[1] === "s" || n.scheme[1] === "S") && (n.scheme[2] === "s" || n.scheme[2] === "S") : !1;
|
|
2473
2473
|
}
|
|
2474
2474
|
function s(n) {
|
|
2475
2475
|
return n.host || (n.error = n.error || "HTTP URIs must have a host."), n;
|
|
2476
2476
|
}
|
|
2477
2477
|
function f(n) {
|
|
2478
|
-
const
|
|
2479
|
-
return (n.port === (
|
|
2478
|
+
const d = String(n.scheme).toLowerCase() === "https";
|
|
2479
|
+
return (n.port === (d ? 443 : 80) || n.port === "") && (n.port = void 0), n.path || (n.path = "/"), n;
|
|
2480
2480
|
}
|
|
2481
2481
|
function c(n) {
|
|
2482
|
-
return n.secure =
|
|
2482
|
+
return n.secure = v(n), n.resourceName = (n.path || "/") + (n.query ? "?" + n.query : ""), n.path = void 0, n.query = void 0, n;
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2485
|
-
if ((n.port === (
|
|
2486
|
-
const [
|
|
2487
|
-
n.path =
|
|
2484
|
+
function h(n) {
|
|
2485
|
+
if ((n.port === (v(n) ? 443 : 80) || n.port === "") && (n.port = void 0), typeof n.secure == "boolean" && (n.scheme = n.secure ? "wss" : "ws", n.secure = void 0), n.resourceName) {
|
|
2486
|
+
const [d, w] = n.resourceName.split("?");
|
|
2487
|
+
n.path = d && d !== "/" ? d : void 0, n.query = w, n.resourceName = void 0;
|
|
2488
2488
|
}
|
|
2489
2489
|
return n.fragment = void 0, n;
|
|
2490
2490
|
}
|
|
2491
|
-
function
|
|
2491
|
+
function $(n, d) {
|
|
2492
2492
|
if (!n.path)
|
|
2493
2493
|
return n.error = "URN can not be parsed", n;
|
|
2494
|
-
const
|
|
2495
|
-
if (
|
|
2496
|
-
const j =
|
|
2497
|
-
n.nid =
|
|
2498
|
-
const C = `${j}:${
|
|
2499
|
-
n.path = void 0, D && (n = D.parse(n,
|
|
2494
|
+
const w = n.path.match(r);
|
|
2495
|
+
if (w) {
|
|
2496
|
+
const j = d.scheme || n.scheme || "urn";
|
|
2497
|
+
n.nid = w[1].toLowerCase(), n.nss = w[2];
|
|
2498
|
+
const C = `${j}:${d.nid || n.nid}`, D = m(C);
|
|
2499
|
+
n.path = void 0, D && (n = D.parse(n, d));
|
|
2500
2500
|
} else
|
|
2501
2501
|
n.error = n.error || "URN can not be parsed.";
|
|
2502
2502
|
return n;
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function _(n, d) {
|
|
2505
2505
|
if (n.nid === void 0)
|
|
2506
2506
|
throw new Error("URN without nid cannot be serialized");
|
|
2507
|
-
const
|
|
2508
|
-
D && (n = D.serialize(n,
|
|
2507
|
+
const w = d.scheme || n.scheme || "urn", j = n.nid.toLowerCase(), C = `${w}:${d.nid || j}`, D = m(C);
|
|
2508
|
+
D && (n = D.serialize(n, d));
|
|
2509
2509
|
const V = n, L = n.nss;
|
|
2510
|
-
return V.path = `${j ||
|
|
2510
|
+
return V.path = `${j || d.nid}:${L}`, d.skipEscape = !0, V;
|
|
2511
2511
|
}
|
|
2512
|
-
function P(n,
|
|
2513
|
-
const
|
|
2514
|
-
return
|
|
2512
|
+
function P(n, d) {
|
|
2513
|
+
const w = n;
|
|
2514
|
+
return w.uuid = w.nss, w.nss = void 0, !d.tolerant && (!w.uuid || !e(w.uuid)) && (w.error = w.error || "UUID is not valid."), w;
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2517
|
-
const
|
|
2518
|
-
return
|
|
2516
|
+
function g(n) {
|
|
2517
|
+
const d = n;
|
|
2518
|
+
return d.nss = (n.uuid || "").toLowerCase(), d;
|
|
2519
2519
|
}
|
|
2520
2520
|
const y = (
|
|
2521
2521
|
/** @type {SchemeHandler} */
|
|
@@ -2539,7 +2539,7 @@ function Pn() {
|
|
|
2539
2539
|
scheme: "ws",
|
|
2540
2540
|
domainHost: !0,
|
|
2541
2541
|
parse: c,
|
|
2542
|
-
serialize:
|
|
2542
|
+
serialize: h
|
|
2543
2543
|
}
|
|
2544
2544
|
), a = (
|
|
2545
2545
|
/** @type {SchemeHandler} */
|
|
@@ -2560,8 +2560,8 @@ function Pn() {
|
|
|
2560
2560
|
/** @type {SchemeHandler} */
|
|
2561
2561
|
{
|
|
2562
2562
|
scheme: "urn",
|
|
2563
|
-
parse:
|
|
2564
|
-
serialize:
|
|
2563
|
+
parse: $,
|
|
2564
|
+
serialize: _,
|
|
2565
2565
|
skipNormalize: !0
|
|
2566
2566
|
}
|
|
2567
2567
|
),
|
|
@@ -2570,14 +2570,14 @@ function Pn() {
|
|
|
2570
2570
|
{
|
|
2571
2571
|
scheme: "urn:uuid",
|
|
2572
2572
|
parse: P,
|
|
2573
|
-
serialize:
|
|
2573
|
+
serialize: g,
|
|
2574
2574
|
skipNormalize: !0
|
|
2575
2575
|
}
|
|
2576
2576
|
)
|
|
2577
2577
|
}
|
|
2578
2578
|
);
|
|
2579
2579
|
Object.setPrototypeOf(i, null);
|
|
2580
|
-
function
|
|
2580
|
+
function m(n) {
|
|
2581
2581
|
return n && (i[
|
|
2582
2582
|
/** @type {SchemeName} */
|
|
2583
2583
|
n
|
|
@@ -2587,34 +2587,34 @@ function Pn() {
|
|
|
2587
2587
|
]) || void 0;
|
|
2588
2588
|
}
|
|
2589
2589
|
return jt = {
|
|
2590
|
-
wsIsSecure:
|
|
2590
|
+
wsIsSecure: v,
|
|
2591
2591
|
SCHEMES: i,
|
|
2592
|
-
isValidSchemeName:
|
|
2593
|
-
getSchemeHandler:
|
|
2592
|
+
isValidSchemeName: l,
|
|
2593
|
+
getSchemeHandler: m
|
|
2594
2594
|
}, jt;
|
|
2595
2595
|
}
|
|
2596
2596
|
var cr;
|
|
2597
|
-
function
|
|
2597
|
+
function kn() {
|
|
2598
2598
|
if (cr) return Re.exports;
|
|
2599
2599
|
cr = 1;
|
|
2600
|
-
const { normalizeIPv6: e, removeDotSegments: r, recomposeAuthority: S, normalizeComponentEncoding:
|
|
2601
|
-
function
|
|
2600
|
+
const { normalizeIPv6: e, removeDotSegments: r, recomposeAuthority: S, normalizeComponentEncoding: l, isIPv4: v, nonSimpleDomain: s } = tn(), { SCHEMES: f, getSchemeHandler: c } = Rn();
|
|
2601
|
+
function h(a, o) {
|
|
2602
2602
|
return typeof a == "string" ? a = /** @type {T} */
|
|
2603
|
-
|
|
2604
|
-
p(
|
|
2603
|
+
g(p(a, o), o) : typeof a == "object" && (a = /** @type {T} */
|
|
2604
|
+
p(g(a, o), o)), a;
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2607
|
-
const i = t ? Object.assign({ scheme: "null" }, t) : { scheme: "null" },
|
|
2608
|
-
return i.skipEscape = !0,
|
|
2606
|
+
function $(a, o, t) {
|
|
2607
|
+
const i = t ? Object.assign({ scheme: "null" }, t) : { scheme: "null" }, m = _(p(a, i), p(o, i), i, !0);
|
|
2608
|
+
return i.skipEscape = !0, g(m, i);
|
|
2609
2609
|
}
|
|
2610
|
-
function
|
|
2611
|
-
const
|
|
2612
|
-
return i || (a = p(
|
|
2610
|
+
function _(a, o, t, i) {
|
|
2611
|
+
const m = {};
|
|
2612
|
+
return i || (a = p(g(a, t), t), o = p(g(o, t), t)), t = t || {}, !t.tolerant && o.scheme ? (m.scheme = o.scheme, m.userinfo = o.userinfo, m.host = o.host, m.port = o.port, m.path = r(o.path || ""), m.query = o.query) : (o.userinfo !== void 0 || o.host !== void 0 || o.port !== void 0 ? (m.userinfo = o.userinfo, m.host = o.host, m.port = o.port, m.path = r(o.path || ""), m.query = o.query) : (o.path ? (o.path[0] === "/" ? m.path = r(o.path) : ((a.userinfo !== void 0 || a.host !== void 0 || a.port !== void 0) && !a.path ? m.path = "/" + o.path : a.path ? m.path = a.path.slice(0, a.path.lastIndexOf("/") + 1) + o.path : m.path = o.path, m.path = r(m.path)), m.query = o.query) : (m.path = a.path, o.query !== void 0 ? m.query = o.query : m.query = a.query), m.userinfo = a.userinfo, m.host = a.host, m.port = a.port), m.scheme = a.scheme), m.fragment = o.fragment, m;
|
|
2613
2613
|
}
|
|
2614
2614
|
function P(a, o, t) {
|
|
2615
|
-
return typeof a == "string" ? (a = unescape(a), a =
|
|
2615
|
+
return typeof a == "string" ? (a = unescape(a), a = g(l(p(a, t), !0), { ...t, skipEscape: !0 })) : typeof a == "object" && (a = g(l(a, !0), { ...t, skipEscape: !0 })), typeof o == "string" ? (o = unescape(o), o = g(l(p(o, t), !0), { ...t, skipEscape: !0 })) : typeof o == "object" && (o = g(l(o, !0), { ...t, skipEscape: !0 })), a.toLowerCase() === o.toLowerCase();
|
|
2616
2616
|
}
|
|
2617
|
-
function
|
|
2617
|
+
function g(a, o) {
|
|
2618
2618
|
const t = {
|
|
2619
2619
|
host: a.host,
|
|
2620
2620
|
scheme: a.scheme,
|
|
@@ -2630,14 +2630,14 @@ function Nn() {
|
|
|
2630
2630
|
resourceName: a.resourceName,
|
|
2631
2631
|
secure: a.secure,
|
|
2632
2632
|
error: ""
|
|
2633
|
-
}, i = Object.assign({}, o),
|
|
2634
|
-
n && n.serialize && n.serialize(t, i), t.path !== void 0 && (i.skipEscape ? t.path = unescape(t.path) : (t.path = escape(t.path), t.scheme !== void 0 && (t.path = t.path.split("%3A").join(":")))), i.reference !== "suffix" && t.scheme &&
|
|
2635
|
-
const
|
|
2636
|
-
if (
|
|
2637
|
-
let
|
|
2638
|
-
!i.absolutePath && (!n || !n.absolutePath) && (
|
|
2633
|
+
}, i = Object.assign({}, o), m = [], n = c(i.scheme || t.scheme);
|
|
2634
|
+
n && n.serialize && n.serialize(t, i), t.path !== void 0 && (i.skipEscape ? t.path = unescape(t.path) : (t.path = escape(t.path), t.scheme !== void 0 && (t.path = t.path.split("%3A").join(":")))), i.reference !== "suffix" && t.scheme && m.push(t.scheme, ":");
|
|
2635
|
+
const d = S(t);
|
|
2636
|
+
if (d !== void 0 && (i.reference !== "suffix" && m.push("//"), m.push(d), t.path && t.path[0] !== "/" && m.push("/")), t.path !== void 0) {
|
|
2637
|
+
let w = t.path;
|
|
2638
|
+
!i.absolutePath && (!n || !n.absolutePath) && (w = r(w)), d === void 0 && w[0] === "/" && w[1] === "/" && (w = "/%2F" + w.slice(2)), m.push(w);
|
|
2639
2639
|
}
|
|
2640
|
-
return t.query !== void 0 &&
|
|
2640
|
+
return t.query !== void 0 && m.push("?", t.query), t.fragment !== void 0 && m.push("#", t.fragment), m.join("");
|
|
2641
2641
|
}
|
|
2642
2642
|
const y = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
2643
2643
|
function p(a, o) {
|
|
@@ -2650,49 +2650,49 @@ function Nn() {
|
|
|
2650
2650
|
query: void 0,
|
|
2651
2651
|
fragment: void 0
|
|
2652
2652
|
};
|
|
2653
|
-
let
|
|
2653
|
+
let m = !1;
|
|
2654
2654
|
t.reference === "suffix" && (t.scheme ? a = t.scheme + ":" + a : a = "//" + a);
|
|
2655
2655
|
const n = a.match(y);
|
|
2656
2656
|
if (n) {
|
|
2657
2657
|
if (i.scheme = n[1], i.userinfo = n[3], i.host = n[4], i.port = parseInt(n[5], 10), i.path = n[6] || "", i.query = n[7], i.fragment = n[8], isNaN(i.port) && (i.port = n[5]), i.host)
|
|
2658
|
-
if (
|
|
2658
|
+
if (v(i.host) === !1) {
|
|
2659
2659
|
const j = e(i.host);
|
|
2660
|
-
i.host = j.host.toLowerCase(),
|
|
2660
|
+
i.host = j.host.toLowerCase(), m = j.isIPV6;
|
|
2661
2661
|
} else
|
|
2662
|
-
|
|
2662
|
+
m = !0;
|
|
2663
2663
|
i.scheme === void 0 && i.userinfo === void 0 && i.host === void 0 && i.port === void 0 && i.query === void 0 && !i.path ? i.reference = "same-document" : i.scheme === void 0 ? i.reference = "relative" : i.fragment === void 0 ? i.reference = "absolute" : i.reference = "uri", t.reference && t.reference !== "suffix" && t.reference !== i.reference && (i.error = i.error || "URI is not a " + t.reference + " reference.");
|
|
2664
|
-
const
|
|
2665
|
-
if (!t.unicodeSupport && (!
|
|
2664
|
+
const d = c(t.scheme || i.scheme);
|
|
2665
|
+
if (!t.unicodeSupport && (!d || !d.unicodeSupport) && i.host && (t.domainHost || d && d.domainHost) && m === !1 && s(i.host))
|
|
2666
2666
|
try {
|
|
2667
2667
|
i.host = URL.domainToASCII(i.host.toLowerCase());
|
|
2668
|
-
} catch (
|
|
2669
|
-
i.error = i.error || "Host's domain name can not be converted to ASCII: " +
|
|
2668
|
+
} catch (w) {
|
|
2669
|
+
i.error = i.error || "Host's domain name can not be converted to ASCII: " + w;
|
|
2670
2670
|
}
|
|
2671
|
-
(!
|
|
2671
|
+
(!d || d && !d.skipNormalize) && (a.indexOf("%") !== -1 && (i.scheme !== void 0 && (i.scheme = unescape(i.scheme)), i.host !== void 0 && (i.host = unescape(i.host))), i.path && (i.path = escape(unescape(i.path))), i.fragment && (i.fragment = encodeURI(decodeURIComponent(i.fragment)))), d && d.parse && d.parse(i, t);
|
|
2672
2672
|
} else
|
|
2673
2673
|
i.error = i.error || "URI can not be parsed.";
|
|
2674
2674
|
return i;
|
|
2675
2675
|
}
|
|
2676
2676
|
const b = {
|
|
2677
2677
|
SCHEMES: f,
|
|
2678
|
-
normalize:
|
|
2679
|
-
resolve:
|
|
2680
|
-
resolveComponent:
|
|
2678
|
+
normalize: h,
|
|
2679
|
+
resolve: $,
|
|
2680
|
+
resolveComponent: _,
|
|
2681
2681
|
equal: P,
|
|
2682
|
-
serialize:
|
|
2682
|
+
serialize: g,
|
|
2683
2683
|
parse: p
|
|
2684
2684
|
};
|
|
2685
2685
|
return Re.exports = b, Re.exports.default = b, Re.exports.fastUri = b, Re.exports;
|
|
2686
2686
|
}
|
|
2687
2687
|
var lr;
|
|
2688
|
-
function
|
|
2688
|
+
function On() {
|
|
2689
2689
|
if (lr) return Te;
|
|
2690
2690
|
lr = 1, Object.defineProperty(Te, "__esModule", { value: !0 });
|
|
2691
|
-
const e =
|
|
2691
|
+
const e = kn();
|
|
2692
2692
|
return e.code = 'require("ajv/dist/runtime/uri").default', Te.default = e, Te;
|
|
2693
2693
|
}
|
|
2694
2694
|
var dr;
|
|
2695
|
-
function
|
|
2695
|
+
function jn() {
|
|
2696
2696
|
return dr || (dr = 1, (function(e) {
|
|
2697
2697
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
|
|
2698
2698
|
var r = vt();
|
|
@@ -2713,7 +2713,7 @@ function kn() {
|
|
|
2713
2713
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
2714
2714
|
return S.CodeGen;
|
|
2715
2715
|
} });
|
|
2716
|
-
const
|
|
2716
|
+
const l = Ct(), v = _t(), s = Zr(), f = At(), c = J(), h = yt(), $ = mt(), _ = Q(), P = Nn, g = On(), y = (A, R) => new RegExp(A, R);
|
|
2717
2717
|
y.code = "new RegExp";
|
|
2718
2718
|
const p = ["removeAdditional", "useDefaults", "coerceTypes"], b = /* @__PURE__ */ new Set([
|
|
2719
2719
|
"validate",
|
|
@@ -2752,7 +2752,7 @@ function kn() {
|
|
|
2752
2752
|
}, t = 200;
|
|
2753
2753
|
function i(A) {
|
|
2754
2754
|
var R, T, O, u, E, I, U, F, X, W, N, k, q, M, z, G, ee, ue, se, ae, te, be, oe, gt, $t;
|
|
2755
|
-
const Pe = A.strict, wt = (R = A.code) === null || R === void 0 ? void 0 : R.optimize, Dt = wt === !0 || wt === void 0 ? 1 : wt || 0, Vt = (O = (T = A.code) === null || T === void 0 ? void 0 : T.regExp) !== null && O !== void 0 ? O : y, an = (u = A.uriResolver) !== null && u !== void 0 ? u :
|
|
2755
|
+
const Pe = A.strict, wt = (R = A.code) === null || R === void 0 ? void 0 : R.optimize, Dt = wt === !0 || wt === void 0 ? 1 : wt || 0, Vt = (O = (T = A.code) === null || T === void 0 ? void 0 : T.regExp) !== null && O !== void 0 ? O : y, an = (u = A.uriResolver) !== null && u !== void 0 ? u : g.default;
|
|
2756
2756
|
return {
|
|
2757
2757
|
strictSchema: (I = (E = A.strictSchema) !== null && E !== void 0 ? E : Pe) !== null && I !== void 0 ? I : !0,
|
|
2758
2758
|
strictNumbers: (F = (U = A.strictNumbers) !== null && U !== void 0 ? U : Pe) !== null && F !== void 0 ? F : !0,
|
|
@@ -2774,13 +2774,13 @@ function kn() {
|
|
|
2774
2774
|
uriResolver: an
|
|
2775
2775
|
};
|
|
2776
2776
|
}
|
|
2777
|
-
class
|
|
2777
|
+
class m {
|
|
2778
2778
|
constructor(R = {}) {
|
|
2779
2779
|
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), R = this.opts = { ...R, ...i(R) };
|
|
2780
2780
|
const { es5: T, lines: O } = this.opts.code;
|
|
2781
2781
|
this.scope = new c.ValueScope({ scope: {}, prefixes: b, es5: T, lines: O }), this.logger = L(R.logger);
|
|
2782
2782
|
const u = R.validateFormats;
|
|
2783
|
-
R.validateFormats = !1, this.RULES = (0, s.getRules)(), n.call(this, a, R, "NOT SUPPORTED"), n.call(this, o, R, "DEPRECATED", "warn"), this._metaOpts = D.call(this), R.formats && j.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), R.keywords && C.call(this, R.keywords), typeof R.meta == "object" && this.addMetaSchema(R.meta),
|
|
2783
|
+
R.validateFormats = !1, this.RULES = (0, s.getRules)(), n.call(this, a, R, "NOT SUPPORTED"), n.call(this, o, R, "DEPRECATED", "warn"), this._metaOpts = D.call(this), R.formats && j.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), R.keywords && C.call(this, R.keywords), typeof R.meta == "object" && this.addMetaSchema(R.meta), w.call(this), R.validateFormats = u;
|
|
2784
2784
|
}
|
|
2785
2785
|
_addVocabularies() {
|
|
2786
2786
|
this.addKeyword("$async");
|
|
@@ -2825,7 +2825,7 @@ function kn() {
|
|
|
2825
2825
|
try {
|
|
2826
2826
|
return this._compileSchemaEnv(W);
|
|
2827
2827
|
} catch (N) {
|
|
2828
|
-
if (!(N instanceof
|
|
2828
|
+
if (!(N instanceof v.default))
|
|
2829
2829
|
throw N;
|
|
2830
2830
|
return U.call(this, N), await F.call(this, N.missingSchema), I.call(this, W);
|
|
2831
2831
|
}
|
|
@@ -2862,7 +2862,7 @@ function kn() {
|
|
|
2862
2862
|
if (E = R[I], E !== void 0 && typeof E != "string")
|
|
2863
2863
|
throw new Error(`schema ${I} must be string`);
|
|
2864
2864
|
}
|
|
2865
|
-
return T = (0,
|
|
2865
|
+
return T = (0, h.normalizeId)(T || E), this._checkUnique(T), this.schemas[T] = this._addSchema(R, O, T, u, !0), this;
|
|
2866
2866
|
}
|
|
2867
2867
|
// Add schema that will be used to validate other schemas
|
|
2868
2868
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
@@ -2892,7 +2892,7 @@ function kn() {
|
|
|
2892
2892
|
// (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
|
|
2893
2893
|
getSchema(R) {
|
|
2894
2894
|
let T;
|
|
2895
|
-
for (; typeof (T =
|
|
2895
|
+
for (; typeof (T = d.call(this, R)) == "string"; )
|
|
2896
2896
|
R = T;
|
|
2897
2897
|
if (T === void 0) {
|
|
2898
2898
|
const { schemaId: O } = this.opts, u = new f.SchemaEnv({ schema: {}, schemaId: O });
|
|
@@ -2913,14 +2913,14 @@ function kn() {
|
|
|
2913
2913
|
case "undefined":
|
|
2914
2914
|
return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
|
|
2915
2915
|
case "string": {
|
|
2916
|
-
const T =
|
|
2916
|
+
const T = d.call(this, R);
|
|
2917
2917
|
return typeof T == "object" && this._cache.delete(T.schema), delete this.schemas[R], delete this.refs[R], this;
|
|
2918
2918
|
}
|
|
2919
2919
|
case "object": {
|
|
2920
2920
|
const T = R;
|
|
2921
2921
|
this._cache.delete(T);
|
|
2922
2922
|
let O = R[this.opts.schemaId];
|
|
2923
|
-
return O && (O = (0,
|
|
2923
|
+
return O && (O = (0, h.normalizeId)(O), delete this.schemas[O], delete this.refs[O]), this;
|
|
2924
2924
|
}
|
|
2925
2925
|
default:
|
|
2926
2926
|
throw new Error("ajv.removeSchema: invalid parameter");
|
|
@@ -2942,14 +2942,14 @@ function kn() {
|
|
|
2942
2942
|
} else
|
|
2943
2943
|
throw new Error("invalid addKeywords parameters");
|
|
2944
2944
|
if (B.call(this, O, T), !T)
|
|
2945
|
-
return (0,
|
|
2945
|
+
return (0, _.eachItem)(O, (E) => x.call(this, E)), this;
|
|
2946
2946
|
fe.call(this, T);
|
|
2947
2947
|
const u = {
|
|
2948
2948
|
...T,
|
|
2949
|
-
type: (0,
|
|
2950
|
-
schemaType: (0,
|
|
2949
|
+
type: (0, $.getJSONTypes)(T.type),
|
|
2950
|
+
schemaType: (0, $.getJSONTypes)(T.schemaType)
|
|
2951
2951
|
};
|
|
2952
|
-
return (0,
|
|
2952
|
+
return (0, _.eachItem)(O, u.type.length === 0 ? (E) => x.call(this, E, u) : (E) => u.type.forEach((I) => x.call(this, E, u, I))), this;
|
|
2953
2953
|
}
|
|
2954
2954
|
getKeyword(R) {
|
|
2955
2955
|
const T = this.RULES.all[R];
|
|
@@ -3010,8 +3010,8 @@ function kn() {
|
|
|
3010
3010
|
let F = this._cache.get(R);
|
|
3011
3011
|
if (F !== void 0)
|
|
3012
3012
|
return F;
|
|
3013
|
-
O = (0,
|
|
3014
|
-
const X =
|
|
3013
|
+
O = (0, h.normalizeId)(I || O);
|
|
3014
|
+
const X = h.getSchemaRefs.call(this, R, O);
|
|
3015
3015
|
return F = new f.SchemaEnv({ schema: R, schemaId: U, meta: T, baseId: O, localRefs: X }), this._cache.set(F.schema, F), E && !O.startsWith("#") && (O && this._checkUnique(O), this.refs[O] = F), u && this.validateSchema(R, !0), F;
|
|
3016
3016
|
}
|
|
3017
3017
|
_checkUnique(R) {
|
|
@@ -3033,17 +3033,17 @@ function kn() {
|
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
3035
3035
|
}
|
|
3036
|
-
|
|
3036
|
+
m.ValidationError = l.default, m.MissingRefError = v.default, e.default = m;
|
|
3037
3037
|
function n(A, R, T, O = "error") {
|
|
3038
3038
|
for (const u in A) {
|
|
3039
3039
|
const E = u;
|
|
3040
3040
|
E in R && this.logger[O](`${T}: option ${u}. ${A[E]}`);
|
|
3041
3041
|
}
|
|
3042
3042
|
}
|
|
3043
|
-
function
|
|
3044
|
-
return A = (0,
|
|
3043
|
+
function d(A) {
|
|
3044
|
+
return A = (0, h.normalizeId)(A), this.schemas[A] || this.refs[A];
|
|
3045
3045
|
}
|
|
3046
|
-
function
|
|
3046
|
+
function w() {
|
|
3047
3047
|
const A = this.opts.schemas;
|
|
3048
3048
|
if (A)
|
|
3049
3049
|
if (Array.isArray(A))
|
|
@@ -3091,7 +3091,7 @@ function kn() {
|
|
|
3091
3091
|
const K = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
3092
3092
|
function B(A, R) {
|
|
3093
3093
|
const { RULES: T } = this;
|
|
3094
|
-
if ((0,
|
|
3094
|
+
if ((0, _.eachItem)(A, (O) => {
|
|
3095
3095
|
if (T.keywords[O])
|
|
3096
3096
|
throw new Error(`Keyword ${O} is already defined`);
|
|
3097
3097
|
if (!K.test(O))
|
|
@@ -3112,8 +3112,8 @@ function kn() {
|
|
|
3112
3112
|
keyword: A,
|
|
3113
3113
|
definition: {
|
|
3114
3114
|
...R,
|
|
3115
|
-
type: (0,
|
|
3116
|
-
schemaType: (0,
|
|
3115
|
+
type: (0, $.getJSONTypes)(R.type),
|
|
3116
|
+
schemaType: (0, $.getJSONTypes)(R.schemaType)
|
|
3117
3117
|
}
|
|
3118
3118
|
};
|
|
3119
3119
|
R.before ? de.call(this, I, U, R.before) : I.rules.push(U), E.all[A] = U, (O = R.implements) === null || O === void 0 || O.forEach((F) => this.addKeyword(F));
|
|
@@ -3135,7 +3135,7 @@ function kn() {
|
|
|
3135
3135
|
})(bt)), bt;
|
|
3136
3136
|
}
|
|
3137
3137
|
var Ce = {}, Ae = {}, Me = {}, fr;
|
|
3138
|
-
function
|
|
3138
|
+
function In() {
|
|
3139
3139
|
if (fr) return Me;
|
|
3140
3140
|
fr = 1, Object.defineProperty(Me, "__esModule", { value: !0 });
|
|
3141
3141
|
const e = {
|
|
@@ -3147,70 +3147,70 @@ function On() {
|
|
|
3147
3147
|
return Me.default = e, Me;
|
|
3148
3148
|
}
|
|
3149
3149
|
var ve = {}, hr;
|
|
3150
|
-
function
|
|
3150
|
+
function qn() {
|
|
3151
3151
|
if (hr) return ve;
|
|
3152
3152
|
hr = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.callRef = ve.getValidate = void 0;
|
|
3153
|
-
const e = _t(), r = le(), S = J(),
|
|
3153
|
+
const e = _t(), r = le(), S = J(), l = _e(), v = At(), s = Q(), f = {
|
|
3154
3154
|
keyword: "$ref",
|
|
3155
3155
|
schemaType: "string",
|
|
3156
|
-
code(
|
|
3157
|
-
const { gen:
|
|
3156
|
+
code($) {
|
|
3157
|
+
const { gen: _, schema: P, it: g } = $, { baseId: y, schemaEnv: p, validateName: b, opts: a, self: o } = g, { root: t } = p;
|
|
3158
3158
|
if ((P === "#" || P === "#/") && y === t.baseId)
|
|
3159
|
-
return
|
|
3160
|
-
const i =
|
|
3159
|
+
return m();
|
|
3160
|
+
const i = v.resolveRef.call(o, t, y, P);
|
|
3161
3161
|
if (i === void 0)
|
|
3162
|
-
throw new e.default(
|
|
3163
|
-
if (i instanceof
|
|
3162
|
+
throw new e.default(g.opts.uriResolver, y, P);
|
|
3163
|
+
if (i instanceof v.SchemaEnv)
|
|
3164
3164
|
return n(i);
|
|
3165
|
-
return
|
|
3166
|
-
function
|
|
3165
|
+
return d(i);
|
|
3166
|
+
function m() {
|
|
3167
3167
|
if (p === t)
|
|
3168
|
-
return
|
|
3169
|
-
const
|
|
3170
|
-
return
|
|
3168
|
+
return h($, b, p, p.$async);
|
|
3169
|
+
const w = _.scopeValue("root", { ref: t });
|
|
3170
|
+
return h($, (0, S._)`${w}.validate`, t, t.$async);
|
|
3171
3171
|
}
|
|
3172
|
-
function n(
|
|
3173
|
-
const j = c(w
|
|
3174
|
-
|
|
3172
|
+
function n(w) {
|
|
3173
|
+
const j = c($, w);
|
|
3174
|
+
h($, j, w, w.$async);
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3177
|
-
const j =
|
|
3178
|
-
schema:
|
|
3176
|
+
function d(w) {
|
|
3177
|
+
const j = _.scopeValue("schema", a.code.source === !0 ? { ref: w, code: (0, S.stringify)(w) } : { ref: w }), C = _.name("valid"), D = $.subschema({
|
|
3178
|
+
schema: w,
|
|
3179
3179
|
dataTypes: [],
|
|
3180
3180
|
schemaPath: S.nil,
|
|
3181
3181
|
topSchemaRef: j,
|
|
3182
3182
|
errSchemaPath: P
|
|
3183
3183
|
}, C);
|
|
3184
|
-
|
|
3184
|
+
$.mergeEvaluated(D), $.ok(C);
|
|
3185
3185
|
}
|
|
3186
3186
|
}
|
|
3187
3187
|
};
|
|
3188
|
-
function c(
|
|
3189
|
-
const { gen: P } =
|
|
3190
|
-
return
|
|
3188
|
+
function c($, _) {
|
|
3189
|
+
const { gen: P } = $;
|
|
3190
|
+
return _.validate ? P.scopeValue("validate", { ref: _.validate }) : (0, S._)`${P.scopeValue("wrapper", { ref: _ })}.validate`;
|
|
3191
3191
|
}
|
|
3192
3192
|
ve.getValidate = c;
|
|
3193
|
-
function
|
|
3194
|
-
const { gen: y, it: p } =
|
|
3195
|
-
|
|
3193
|
+
function h($, _, P, g) {
|
|
3194
|
+
const { gen: y, it: p } = $, { allErrors: b, schemaEnv: a, opts: o } = p, t = o.passContext ? l.default.this : S.nil;
|
|
3195
|
+
g ? i() : m();
|
|
3196
3196
|
function i() {
|
|
3197
3197
|
if (!a.$async)
|
|
3198
3198
|
throw new Error("async schema referenced by sync schema");
|
|
3199
|
-
const
|
|
3199
|
+
const w = y.let("valid");
|
|
3200
3200
|
y.try(() => {
|
|
3201
|
-
y.code((0, S._)`await ${(0, r.callValidateCode)(
|
|
3201
|
+
y.code((0, S._)`await ${(0, r.callValidateCode)($, _, t)}`), d(_), b || y.assign(w, !0);
|
|
3202
3202
|
}, (j) => {
|
|
3203
|
-
y.if((0, S._)`!(${j} instanceof ${p.ValidationError})`, () => y.throw(j)), n(j), b || y.assign(
|
|
3204
|
-
}),
|
|
3203
|
+
y.if((0, S._)`!(${j} instanceof ${p.ValidationError})`, () => y.throw(j)), n(j), b || y.assign(w, !1);
|
|
3204
|
+
}), $.ok(w);
|
|
3205
3205
|
}
|
|
3206
|
-
function
|
|
3207
|
-
|
|
3206
|
+
function m() {
|
|
3207
|
+
$.result((0, r.callValidateCode)($, _, t), () => d(_), () => n(_));
|
|
3208
3208
|
}
|
|
3209
|
-
function n(
|
|
3210
|
-
const j = (0, S._)`${
|
|
3211
|
-
y.assign(
|
|
3209
|
+
function n(w) {
|
|
3210
|
+
const j = (0, S._)`${w}.errors`;
|
|
3211
|
+
y.assign(l.default.vErrors, (0, S._)`${l.default.vErrors} === null ? ${j} : ${l.default.vErrors}.concat(${j})`), y.assign(l.default.errors, (0, S._)`${l.default.vErrors}.length`);
|
|
3212
3212
|
}
|
|
3213
|
-
function
|
|
3213
|
+
function d(w) {
|
|
3214
3214
|
var j;
|
|
3215
3215
|
if (!p.opts.unevaluated)
|
|
3216
3216
|
return;
|
|
@@ -3219,25 +3219,25 @@ function jn() {
|
|
|
3219
3219
|
if (C && !C.dynamicProps)
|
|
3220
3220
|
C.props !== void 0 && (p.props = s.mergeEvaluated.props(y, C.props, p.props));
|
|
3221
3221
|
else {
|
|
3222
|
-
const D = y.var("props", (0, S._)`${
|
|
3222
|
+
const D = y.var("props", (0, S._)`${w}.evaluated.props`);
|
|
3223
3223
|
p.props = s.mergeEvaluated.props(y, D, p.props, S.Name);
|
|
3224
3224
|
}
|
|
3225
3225
|
if (p.items !== !0)
|
|
3226
3226
|
if (C && !C.dynamicItems)
|
|
3227
3227
|
C.items !== void 0 && (p.items = s.mergeEvaluated.items(y, C.items, p.items));
|
|
3228
3228
|
else {
|
|
3229
|
-
const D = y.var("items", (0, S._)`${
|
|
3229
|
+
const D = y.var("items", (0, S._)`${w}.evaluated.items`);
|
|
3230
3230
|
p.items = s.mergeEvaluated.items(y, D, p.items, S.Name);
|
|
3231
3231
|
}
|
|
3232
3232
|
}
|
|
3233
3233
|
}
|
|
3234
|
-
return ve.callRef =
|
|
3234
|
+
return ve.callRef = h, ve.default = f, ve;
|
|
3235
3235
|
}
|
|
3236
3236
|
var mr;
|
|
3237
|
-
function
|
|
3237
|
+
function Tn() {
|
|
3238
3238
|
if (mr) return Ae;
|
|
3239
3239
|
mr = 1, Object.defineProperty(Ae, "__esModule", { value: !0 });
|
|
3240
|
-
const e =
|
|
3240
|
+
const e = In(), r = qn(), S = [
|
|
3241
3241
|
"$schema",
|
|
3242
3242
|
"$id",
|
|
3243
3243
|
"$defs",
|
|
@@ -3250,7 +3250,7 @@ function In() {
|
|
|
3250
3250
|
return Ae.default = S, Ae;
|
|
3251
3251
|
}
|
|
3252
3252
|
var De = {}, Ve = {}, pr;
|
|
3253
|
-
function
|
|
3253
|
+
function Cn() {
|
|
3254
3254
|
if (pr) return Ve;
|
|
3255
3255
|
pr = 1, Object.defineProperty(Ve, "__esModule", { value: !0 });
|
|
3256
3256
|
const e = J(), r = e.operators, S = {
|
|
@@ -3258,24 +3258,24 @@ function qn() {
|
|
|
3258
3258
|
minimum: { okStr: ">=", ok: r.GTE, fail: r.LT },
|
|
3259
3259
|
exclusiveMaximum: { okStr: "<", ok: r.LT, fail: r.GTE },
|
|
3260
3260
|
exclusiveMinimum: { okStr: ">", ok: r.GT, fail: r.LTE }
|
|
3261
|
-
},
|
|
3261
|
+
}, l = {
|
|
3262
3262
|
message: ({ keyword: s, schemaCode: f }) => (0, e.str)`must be ${S[s].okStr} ${f}`,
|
|
3263
3263
|
params: ({ keyword: s, schemaCode: f }) => (0, e._)`{comparison: ${S[s].okStr}, limit: ${f}}`
|
|
3264
|
-
},
|
|
3264
|
+
}, v = {
|
|
3265
3265
|
keyword: Object.keys(S),
|
|
3266
3266
|
type: "number",
|
|
3267
3267
|
schemaType: "number",
|
|
3268
3268
|
$data: !0,
|
|
3269
|
-
error:
|
|
3269
|
+
error: l,
|
|
3270
3270
|
code(s) {
|
|
3271
|
-
const { keyword: f, data: c, schemaCode:
|
|
3272
|
-
s.fail$data((0, e._)`${c} ${S[f].fail} ${
|
|
3271
|
+
const { keyword: f, data: c, schemaCode: h } = s;
|
|
3272
|
+
s.fail$data((0, e._)`${c} ${S[f].fail} ${h} || isNaN(${c})`);
|
|
3273
3273
|
}
|
|
3274
3274
|
};
|
|
3275
|
-
return Ve.default =
|
|
3275
|
+
return Ve.default = v, Ve;
|
|
3276
3276
|
}
|
|
3277
3277
|
var Ue = {}, yr;
|
|
3278
|
-
function
|
|
3278
|
+
function An() {
|
|
3279
3279
|
if (yr) return Ue;
|
|
3280
3280
|
yr = 1, Object.defineProperty(Ue, "__esModule", { value: !0 });
|
|
3281
3281
|
const e = J(), S = {
|
|
@@ -3284,34 +3284,34 @@ function Tn() {
|
|
|
3284
3284
|
schemaType: "number",
|
|
3285
3285
|
$data: !0,
|
|
3286
3286
|
error: {
|
|
3287
|
-
message: ({ schemaCode:
|
|
3288
|
-
params: ({ schemaCode:
|
|
3287
|
+
message: ({ schemaCode: l }) => (0, e.str)`must be multiple of ${l}`,
|
|
3288
|
+
params: ({ schemaCode: l }) => (0, e._)`{multipleOf: ${l}}`
|
|
3289
3289
|
},
|
|
3290
|
-
code(
|
|
3291
|
-
const { gen:
|
|
3292
|
-
|
|
3290
|
+
code(l) {
|
|
3291
|
+
const { gen: v, data: s, schemaCode: f, it: c } = l, h = c.opts.multipleOfPrecision, $ = v.let("res"), _ = h ? (0, e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${h}` : (0, e._)`${$} !== parseInt(${$})`;
|
|
3292
|
+
l.fail$data((0, e._)`(${f} === 0 || (${$} = ${s}/${f}, ${_}))`);
|
|
3293
3293
|
}
|
|
3294
3294
|
};
|
|
3295
3295
|
return Ue.default = S, Ue;
|
|
3296
3296
|
}
|
|
3297
3297
|
var ze = {}, Fe = {}, vr;
|
|
3298
|
-
function
|
|
3298
|
+
function Mn() {
|
|
3299
3299
|
if (vr) return Fe;
|
|
3300
3300
|
vr = 1, Object.defineProperty(Fe, "__esModule", { value: !0 });
|
|
3301
3301
|
function e(r) {
|
|
3302
3302
|
const S = r.length;
|
|
3303
|
-
let
|
|
3304
|
-
for (;
|
|
3305
|
-
|
|
3306
|
-
return
|
|
3303
|
+
let l = 0, v = 0, s;
|
|
3304
|
+
for (; v < S; )
|
|
3305
|
+
l++, s = r.charCodeAt(v++), s >= 55296 && s <= 56319 && v < S && (s = r.charCodeAt(v), (s & 64512) === 56320 && v++);
|
|
3306
|
+
return l;
|
|
3307
3307
|
}
|
|
3308
3308
|
return Fe.default = e, e.code = 'require("ajv/dist/runtime/ucs2length").default', Fe;
|
|
3309
3309
|
}
|
|
3310
3310
|
var _r;
|
|
3311
|
-
function
|
|
3311
|
+
function Dn() {
|
|
3312
3312
|
if (_r) return ze;
|
|
3313
3313
|
_r = 1, Object.defineProperty(ze, "__esModule", { value: !0 });
|
|
3314
|
-
const e = J(), r = Q(), S =
|
|
3314
|
+
const e = J(), r = Q(), S = Mn(), v = {
|
|
3315
3315
|
keyword: ["maxLength", "minLength"],
|
|
3316
3316
|
type: "string",
|
|
3317
3317
|
schemaType: "number",
|
|
@@ -3324,34 +3324,34 @@ function An() {
|
|
|
3324
3324
|
params: ({ schemaCode: s }) => (0, e._)`{limit: ${s}}`
|
|
3325
3325
|
},
|
|
3326
3326
|
code(s) {
|
|
3327
|
-
const { keyword: f, data: c, schemaCode:
|
|
3328
|
-
s.fail$data((0, e._)`${P} ${
|
|
3327
|
+
const { keyword: f, data: c, schemaCode: h, it: $ } = s, _ = f === "maxLength" ? e.operators.GT : e.operators.LT, P = $.opts.unicode === !1 ? (0, e._)`${c}.length` : (0, e._)`${(0, r.useFunc)(s.gen, S.default)}(${c})`;
|
|
3328
|
+
s.fail$data((0, e._)`${P} ${_} ${h}`);
|
|
3329
3329
|
}
|
|
3330
3330
|
};
|
|
3331
|
-
return ze.default =
|
|
3331
|
+
return ze.default = v, ze;
|
|
3332
3332
|
}
|
|
3333
3333
|
var Ke = {}, gr;
|
|
3334
|
-
function
|
|
3334
|
+
function Vn() {
|
|
3335
3335
|
if (gr) return Ke;
|
|
3336
3336
|
gr = 1, Object.defineProperty(Ke, "__esModule", { value: !0 });
|
|
3337
|
-
const e = le(), r = J(),
|
|
3337
|
+
const e = le(), r = J(), l = {
|
|
3338
3338
|
keyword: "pattern",
|
|
3339
3339
|
type: "string",
|
|
3340
3340
|
schemaType: "string",
|
|
3341
3341
|
$data: !0,
|
|
3342
3342
|
error: {
|
|
3343
|
-
message: ({ schemaCode:
|
|
3344
|
-
params: ({ schemaCode:
|
|
3343
|
+
message: ({ schemaCode: v }) => (0, r.str)`must match pattern "${v}"`,
|
|
3344
|
+
params: ({ schemaCode: v }) => (0, r._)`{pattern: ${v}}`
|
|
3345
3345
|
},
|
|
3346
|
-
code(
|
|
3347
|
-
const { data: s, $data: f, schema: c, schemaCode:
|
|
3348
|
-
|
|
3346
|
+
code(v) {
|
|
3347
|
+
const { data: s, $data: f, schema: c, schemaCode: h, it: $ } = v, _ = $.opts.unicodeRegExp ? "u" : "", P = f ? (0, r._)`(new RegExp(${h}, ${_}))` : (0, e.usePattern)(v, c);
|
|
3348
|
+
v.fail$data((0, r._)`!${P}.test(${s})`);
|
|
3349
3349
|
}
|
|
3350
3350
|
};
|
|
3351
|
-
return Ke.default =
|
|
3351
|
+
return Ke.default = l, Ke;
|
|
3352
3352
|
}
|
|
3353
3353
|
var Le = {}, $r;
|
|
3354
|
-
function
|
|
3354
|
+
function Un() {
|
|
3355
3355
|
if ($r) return Le;
|
|
3356
3356
|
$r = 1, Object.defineProperty(Le, "__esModule", { value: !0 });
|
|
3357
3357
|
const e = J(), S = {
|
|
@@ -3360,24 +3360,24 @@ function Dn() {
|
|
|
3360
3360
|
schemaType: "number",
|
|
3361
3361
|
$data: !0,
|
|
3362
3362
|
error: {
|
|
3363
|
-
message({ keyword:
|
|
3364
|
-
const s =
|
|
3365
|
-
return (0, e.str)`must NOT have ${s} than ${
|
|
3363
|
+
message({ keyword: l, schemaCode: v }) {
|
|
3364
|
+
const s = l === "maxProperties" ? "more" : "fewer";
|
|
3365
|
+
return (0, e.str)`must NOT have ${s} than ${v} properties`;
|
|
3366
3366
|
},
|
|
3367
|
-
params: ({ schemaCode:
|
|
3367
|
+
params: ({ schemaCode: l }) => (0, e._)`{limit: ${l}}`
|
|
3368
3368
|
},
|
|
3369
|
-
code(
|
|
3370
|
-
const { keyword:
|
|
3371
|
-
|
|
3369
|
+
code(l) {
|
|
3370
|
+
const { keyword: v, data: s, schemaCode: f } = l, c = v === "maxProperties" ? e.operators.GT : e.operators.LT;
|
|
3371
|
+
l.fail$data((0, e._)`Object.keys(${s}).length ${c} ${f}`);
|
|
3372
3372
|
}
|
|
3373
3373
|
};
|
|
3374
3374
|
return Le.default = S, Le;
|
|
3375
3375
|
}
|
|
3376
3376
|
var He = {}, wr;
|
|
3377
|
-
function
|
|
3377
|
+
function zn() {
|
|
3378
3378
|
if (wr) return He;
|
|
3379
3379
|
wr = 1, Object.defineProperty(He, "__esModule", { value: !0 });
|
|
3380
|
-
const e = le(), r = J(), S = Q(),
|
|
3380
|
+
const e = le(), r = J(), S = Q(), v = {
|
|
3381
3381
|
keyword: "required",
|
|
3382
3382
|
type: "object",
|
|
3383
3383
|
schemaType: "array",
|
|
@@ -3387,20 +3387,20 @@ function Vn() {
|
|
|
3387
3387
|
params: ({ params: { missingProperty: s } }) => (0, r._)`{missingProperty: ${s}}`
|
|
3388
3388
|
},
|
|
3389
3389
|
code(s) {
|
|
3390
|
-
const { gen: f, schema: c, schemaCode:
|
|
3391
|
-
if (!
|
|
3390
|
+
const { gen: f, schema: c, schemaCode: h, data: $, $data: _, it: P } = s, { opts: g } = P;
|
|
3391
|
+
if (!_ && c.length === 0)
|
|
3392
3392
|
return;
|
|
3393
|
-
const y = c.length >=
|
|
3394
|
-
if (P.allErrors ? p() : b(),
|
|
3393
|
+
const y = c.length >= g.loopRequired;
|
|
3394
|
+
if (P.allErrors ? p() : b(), g.strictRequired) {
|
|
3395
3395
|
const t = s.parentSchema.properties, { definedProperties: i } = s.it;
|
|
3396
|
-
for (const
|
|
3397
|
-
if (t?.[
|
|
3398
|
-
const n = P.schemaEnv.baseId + P.errSchemaPath,
|
|
3399
|
-
(0, S.checkStrictMode)(P,
|
|
3396
|
+
for (const m of c)
|
|
3397
|
+
if (t?.[m] === void 0 && !i.has(m)) {
|
|
3398
|
+
const n = P.schemaEnv.baseId + P.errSchemaPath, d = `required property "${m}" is not defined at "${n}" (strictRequired)`;
|
|
3399
|
+
(0, S.checkStrictMode)(P, d, P.opts.strictRequired);
|
|
3400
3400
|
}
|
|
3401
3401
|
}
|
|
3402
3402
|
function p() {
|
|
3403
|
-
if (y ||
|
|
3403
|
+
if (y || _)
|
|
3404
3404
|
s.block$data(r.nil, a);
|
|
3405
3405
|
else
|
|
3406
3406
|
for (const t of c)
|
|
@@ -3408,30 +3408,30 @@ function Vn() {
|
|
|
3408
3408
|
}
|
|
3409
3409
|
function b() {
|
|
3410
3410
|
const t = f.let("missing");
|
|
3411
|
-
if (y ||
|
|
3411
|
+
if (y || _) {
|
|
3412
3412
|
const i = f.let("valid", !0);
|
|
3413
3413
|
s.block$data(i, () => o(t, i)), s.ok(i);
|
|
3414
3414
|
} else
|
|
3415
3415
|
f.if((0, e.checkMissingProp)(s, c, t)), (0, e.reportMissingProp)(s, t), f.else();
|
|
3416
3416
|
}
|
|
3417
3417
|
function a() {
|
|
3418
|
-
f.forOf("prop",
|
|
3419
|
-
s.setParams({ missingProperty: t }), f.if((0, e.noPropertyInData)(f,
|
|
3418
|
+
f.forOf("prop", h, (t) => {
|
|
3419
|
+
s.setParams({ missingProperty: t }), f.if((0, e.noPropertyInData)(f, $, t, g.ownProperties), () => s.error());
|
|
3420
3420
|
});
|
|
3421
3421
|
}
|
|
3422
3422
|
function o(t, i) {
|
|
3423
|
-
s.setParams({ missingProperty: t }), f.forOf(t,
|
|
3424
|
-
f.assign(i, (0, e.propertyInData)(f,
|
|
3423
|
+
s.setParams({ missingProperty: t }), f.forOf(t, h, () => {
|
|
3424
|
+
f.assign(i, (0, e.propertyInData)(f, $, t, g.ownProperties)), f.if((0, r.not)(i), () => {
|
|
3425
3425
|
s.error(), f.break();
|
|
3426
3426
|
});
|
|
3427
3427
|
}, r.nil);
|
|
3428
3428
|
}
|
|
3429
3429
|
}
|
|
3430
3430
|
};
|
|
3431
|
-
return He.default =
|
|
3431
|
+
return He.default = v, He;
|
|
3432
3432
|
}
|
|
3433
3433
|
var Ge = {}, br;
|
|
3434
|
-
function
|
|
3434
|
+
function Fn() {
|
|
3435
3435
|
if (br) return Ge;
|
|
3436
3436
|
br = 1, Object.defineProperty(Ge, "__esModule", { value: !0 });
|
|
3437
3437
|
const e = J(), S = {
|
|
@@ -3440,15 +3440,15 @@ function Un() {
|
|
|
3440
3440
|
schemaType: "number",
|
|
3441
3441
|
$data: !0,
|
|
3442
3442
|
error: {
|
|
3443
|
-
message({ keyword:
|
|
3444
|
-
const s =
|
|
3445
|
-
return (0, e.str)`must NOT have ${s} than ${
|
|
3443
|
+
message({ keyword: l, schemaCode: v }) {
|
|
3444
|
+
const s = l === "maxItems" ? "more" : "fewer";
|
|
3445
|
+
return (0, e.str)`must NOT have ${s} than ${v} items`;
|
|
3446
3446
|
},
|
|
3447
|
-
params: ({ schemaCode:
|
|
3447
|
+
params: ({ schemaCode: l }) => (0, e._)`{limit: ${l}}`
|
|
3448
3448
|
},
|
|
3449
|
-
code(
|
|
3450
|
-
const { keyword:
|
|
3451
|
-
|
|
3449
|
+
code(l) {
|
|
3450
|
+
const { keyword: v, data: s, schemaCode: f } = l, c = v === "maxItems" ? e.operators.GT : e.operators.LT;
|
|
3451
|
+
l.fail$data((0, e._)`${s}.length ${c} ${f}`);
|
|
3452
3452
|
}
|
|
3453
3453
|
};
|
|
3454
3454
|
return Ge.default = S, Ge;
|
|
@@ -3461,10 +3461,10 @@ function Mt() {
|
|
|
3461
3461
|
return e.code = 'require("ajv/dist/runtime/equal").default', We.default = e, We;
|
|
3462
3462
|
}
|
|
3463
3463
|
var Sr;
|
|
3464
|
-
function
|
|
3464
|
+
function Kn() {
|
|
3465
3465
|
if (Sr) return Je;
|
|
3466
3466
|
Sr = 1, Object.defineProperty(Je, "__esModule", { value: !0 });
|
|
3467
|
-
const e = mt(), r = J(), S = Q(),
|
|
3467
|
+
const e = mt(), r = J(), S = Q(), l = Mt(), s = {
|
|
3468
3468
|
keyword: "uniqueItems",
|
|
3469
3469
|
type: "array",
|
|
3470
3470
|
schemaType: "boolean",
|
|
@@ -3474,30 +3474,30 @@ function zn() {
|
|
|
3474
3474
|
params: ({ params: { i: f, j: c } }) => (0, r._)`{i: ${f}, j: ${c}}`
|
|
3475
3475
|
},
|
|
3476
3476
|
code(f) {
|
|
3477
|
-
const { gen: c, data:
|
|
3478
|
-
if (
|
|
3477
|
+
const { gen: c, data: h, $data: $, schema: _, parentSchema: P, schemaCode: g, it: y } = f;
|
|
3478
|
+
if (!$ && !_)
|
|
3479
3479
|
return;
|
|
3480
3480
|
const p = c.let("valid"), b = P.items ? (0, e.getSchemaTypes)(P.items) : [];
|
|
3481
|
-
f.block$data(p, a, (0, r._)`${
|
|
3481
|
+
f.block$data(p, a, (0, r._)`${g} === false`), f.ok(p);
|
|
3482
3482
|
function a() {
|
|
3483
|
-
const
|
|
3484
|
-
f.setParams({ i:
|
|
3483
|
+
const m = c.let("i", (0, r._)`${h}.length`), n = c.let("j");
|
|
3484
|
+
f.setParams({ i: m, j: n }), c.assign(p, !0), c.if((0, r._)`${m} > 1`, () => (o() ? t : i)(m, n));
|
|
3485
3485
|
}
|
|
3486
3486
|
function o() {
|
|
3487
|
-
return b.length > 0 && !b.some((
|
|
3488
|
-
}
|
|
3489
|
-
function t(
|
|
3490
|
-
const
|
|
3491
|
-
c.for((0, r._)`;${
|
|
3492
|
-
c.let(
|
|
3493
|
-
c.assign(n, (0, r._)`${j}[${
|
|
3494
|
-
}).code((0, r._)`${j}[${
|
|
3487
|
+
return b.length > 0 && !b.some((m) => m === "object" || m === "array");
|
|
3488
|
+
}
|
|
3489
|
+
function t(m, n) {
|
|
3490
|
+
const d = c.name("item"), w = (0, e.checkDataTypes)(b, d, y.opts.strictNumbers, e.DataType.Wrong), j = c.const("indices", (0, r._)`{}`);
|
|
3491
|
+
c.for((0, r._)`;${m}--;`, () => {
|
|
3492
|
+
c.let(d, (0, r._)`${h}[${m}]`), c.if(w, (0, r._)`continue`), b.length > 1 && c.if((0, r._)`typeof ${d} == "string"`, (0, r._)`${d} += "_"`), c.if((0, r._)`typeof ${j}[${d}] == "number"`, () => {
|
|
3493
|
+
c.assign(n, (0, r._)`${j}[${d}]`), f.error(), c.assign(p, !1).break();
|
|
3494
|
+
}).code((0, r._)`${j}[${d}] = ${m}`);
|
|
3495
3495
|
});
|
|
3496
3496
|
}
|
|
3497
|
-
function i(
|
|
3498
|
-
const
|
|
3499
|
-
c.label(
|
|
3500
|
-
f.error(), c.assign(p, !1).break(
|
|
3497
|
+
function i(m, n) {
|
|
3498
|
+
const d = (0, S.useFunc)(c, l.default), w = c.name("outer");
|
|
3499
|
+
c.label(w).for((0, r._)`;${m}--;`, () => c.for((0, r._)`${n} = ${m}; ${n}--;`, () => c.if((0, r._)`${d}(${h}[${m}], ${h}[${n}])`, () => {
|
|
3500
|
+
f.error(), c.assign(p, !1).break(w);
|
|
3501
3501
|
})));
|
|
3502
3502
|
}
|
|
3503
3503
|
}
|
|
@@ -3505,10 +3505,10 @@ function zn() {
|
|
|
3505
3505
|
return Je.default = s, Je;
|
|
3506
3506
|
}
|
|
3507
3507
|
var Be = {}, Pr;
|
|
3508
|
-
function
|
|
3508
|
+
function Ln() {
|
|
3509
3509
|
if (Pr) return Be;
|
|
3510
3510
|
Pr = 1, Object.defineProperty(Be, "__esModule", { value: !0 });
|
|
3511
|
-
const e = J(), r = Q(), S = Mt(),
|
|
3511
|
+
const e = J(), r = Q(), S = Mt(), v = {
|
|
3512
3512
|
keyword: "const",
|
|
3513
3513
|
$data: !0,
|
|
3514
3514
|
error: {
|
|
@@ -3516,17 +3516,17 @@ function Fn() {
|
|
|
3516
3516
|
params: ({ schemaCode: s }) => (0, e._)`{allowedValue: ${s}}`
|
|
3517
3517
|
},
|
|
3518
3518
|
code(s) {
|
|
3519
|
-
const { gen: f, data: c, $data:
|
|
3520
|
-
|
|
3519
|
+
const { gen: f, data: c, $data: h, schemaCode: $, schema: _ } = s;
|
|
3520
|
+
h || _ && typeof _ == "object" ? s.fail$data((0, e._)`!${(0, r.useFunc)(f, S.default)}(${c}, ${$})`) : s.fail((0, e._)`${_} !== ${c}`);
|
|
3521
3521
|
}
|
|
3522
3522
|
};
|
|
3523
|
-
return Be.default =
|
|
3523
|
+
return Be.default = v, Be;
|
|
3524
3524
|
}
|
|
3525
3525
|
var Qe = {}, Nr;
|
|
3526
|
-
function
|
|
3526
|
+
function Hn() {
|
|
3527
3527
|
if (Nr) return Qe;
|
|
3528
3528
|
Nr = 1, Object.defineProperty(Qe, "__esModule", { value: !0 });
|
|
3529
|
-
const e = J(), r = Q(), S = Mt(),
|
|
3529
|
+
const e = J(), r = Q(), S = Mt(), v = {
|
|
3530
3530
|
keyword: "enum",
|
|
3531
3531
|
schemaType: "array",
|
|
3532
3532
|
$data: !0,
|
|
@@ -3535,46 +3535,46 @@ function Kn() {
|
|
|
3535
3535
|
params: ({ schemaCode: s }) => (0, e._)`{allowedValues: ${s}}`
|
|
3536
3536
|
},
|
|
3537
3537
|
code(s) {
|
|
3538
|
-
const { gen: f, data: c, $data:
|
|
3539
|
-
if (!
|
|
3538
|
+
const { gen: f, data: c, $data: h, schema: $, schemaCode: _, it: P } = s;
|
|
3539
|
+
if (!h && $.length === 0)
|
|
3540
3540
|
throw new Error("enum must have non-empty array");
|
|
3541
|
-
const
|
|
3541
|
+
const g = $.length >= P.opts.loopEnum;
|
|
3542
3542
|
let y;
|
|
3543
3543
|
const p = () => y ?? (y = (0, r.useFunc)(f, S.default));
|
|
3544
3544
|
let b;
|
|
3545
|
-
if (
|
|
3545
|
+
if (g || h)
|
|
3546
3546
|
b = f.let("valid"), s.block$data(b, a);
|
|
3547
3547
|
else {
|
|
3548
|
-
if (!Array.isArray(
|
|
3548
|
+
if (!Array.isArray($))
|
|
3549
3549
|
throw new Error("ajv implementation error");
|
|
3550
|
-
const t = f.const("vSchema",
|
|
3551
|
-
b = (0, e.or)(
|
|
3550
|
+
const t = f.const("vSchema", _);
|
|
3551
|
+
b = (0, e.or)(...$.map((i, m) => o(t, m)));
|
|
3552
3552
|
}
|
|
3553
3553
|
s.pass(b);
|
|
3554
3554
|
function a() {
|
|
3555
|
-
f.assign(b, !1), f.forOf("v",
|
|
3555
|
+
f.assign(b, !1), f.forOf("v", _, (t) => f.if((0, e._)`${p()}(${c}, ${t})`, () => f.assign(b, !0).break()));
|
|
3556
3556
|
}
|
|
3557
3557
|
function o(t, i) {
|
|
3558
|
-
const
|
|
3559
|
-
return typeof
|
|
3558
|
+
const m = $[i];
|
|
3559
|
+
return typeof m == "object" && m !== null ? (0, e._)`${p()}(${c}, ${t}[${i}])` : (0, e._)`${c} === ${m}`;
|
|
3560
3560
|
}
|
|
3561
3561
|
}
|
|
3562
3562
|
};
|
|
3563
|
-
return Qe.default =
|
|
3563
|
+
return Qe.default = v, Qe;
|
|
3564
3564
|
}
|
|
3565
3565
|
var Rr;
|
|
3566
|
-
function
|
|
3566
|
+
function Gn() {
|
|
3567
3567
|
if (Rr) return De;
|
|
3568
3568
|
Rr = 1, Object.defineProperty(De, "__esModule", { value: !0 });
|
|
3569
|
-
const e =
|
|
3569
|
+
const e = Cn(), r = An(), S = Dn(), l = Vn(), v = Un(), s = zn(), f = Fn(), c = Kn(), h = Ln(), $ = Hn(), _ = [
|
|
3570
3570
|
// number
|
|
3571
3571
|
e.default,
|
|
3572
3572
|
r.default,
|
|
3573
3573
|
// string
|
|
3574
3574
|
S.default,
|
|
3575
|
-
|
|
3575
|
+
l.default,
|
|
3576
3576
|
// object
|
|
3577
|
-
|
|
3577
|
+
v.default,
|
|
3578
3578
|
s.default,
|
|
3579
3579
|
// array
|
|
3580
3580
|
f.default,
|
|
@@ -3582,16 +3582,16 @@ function Ln() {
|
|
|
3582
3582
|
// any
|
|
3583
3583
|
{ keyword: "type", schemaType: ["string", "array"] },
|
|
3584
3584
|
{ keyword: "nullable", schemaType: "boolean" },
|
|
3585
|
-
|
|
3586
|
-
|
|
3585
|
+
h.default,
|
|
3586
|
+
$.default
|
|
3587
3587
|
];
|
|
3588
|
-
return De.default =
|
|
3588
|
+
return De.default = _, De;
|
|
3589
3589
|
}
|
|
3590
3590
|
var Xe = {}, Ee = {}, kr;
|
|
3591
3591
|
function rn() {
|
|
3592
3592
|
if (kr) return Ee;
|
|
3593
3593
|
kr = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.validateAdditionalItems = void 0;
|
|
3594
|
-
const e = J(), r = Q(),
|
|
3594
|
+
const e = J(), r = Q(), l = {
|
|
3595
3595
|
keyword: "additionalItems",
|
|
3596
3596
|
type: "array",
|
|
3597
3597
|
schemaType: ["boolean", "object"],
|
|
@@ -3601,37 +3601,37 @@ function rn() {
|
|
|
3601
3601
|
params: ({ params: { len: s } }) => (0, e._)`{limit: ${s}}`
|
|
3602
3602
|
},
|
|
3603
3603
|
code(s) {
|
|
3604
|
-
const { parentSchema: f, it: c } = s, { items:
|
|
3605
|
-
if (!Array.isArray(
|
|
3604
|
+
const { parentSchema: f, it: c } = s, { items: h } = f;
|
|
3605
|
+
if (!Array.isArray(h)) {
|
|
3606
3606
|
(0, r.checkStrictMode)(c, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
3607
3607
|
return;
|
|
3608
3608
|
}
|
|
3609
|
-
|
|
3609
|
+
v(s, h);
|
|
3610
3610
|
}
|
|
3611
3611
|
};
|
|
3612
|
-
function
|
|
3613
|
-
const { gen: c, schema:
|
|
3612
|
+
function v(s, f) {
|
|
3613
|
+
const { gen: c, schema: h, data: $, keyword: _, it: P } = s;
|
|
3614
3614
|
P.items = !0;
|
|
3615
|
-
const
|
|
3616
|
-
if (
|
|
3617
|
-
s.setParams({ len: f.length }), s.pass((0, e._)`${
|
|
3618
|
-
else if (typeof
|
|
3619
|
-
const p = c.var("valid", (0, e._)`${
|
|
3615
|
+
const g = c.const("len", (0, e._)`${$}.length`);
|
|
3616
|
+
if (h === !1)
|
|
3617
|
+
s.setParams({ len: f.length }), s.pass((0, e._)`${g} <= ${f.length}`);
|
|
3618
|
+
else if (typeof h == "object" && !(0, r.alwaysValidSchema)(P, h)) {
|
|
3619
|
+
const p = c.var("valid", (0, e._)`${g} <= ${f.length}`);
|
|
3620
3620
|
c.if((0, e.not)(p), () => y(p)), s.ok(p);
|
|
3621
3621
|
}
|
|
3622
3622
|
function y(p) {
|
|
3623
|
-
c.forRange("i", f.length,
|
|
3624
|
-
s.subschema({ keyword:
|
|
3623
|
+
c.forRange("i", f.length, g, (b) => {
|
|
3624
|
+
s.subschema({ keyword: _, dataProp: b, dataPropType: r.Type.Num }, p), P.allErrors || c.if((0, e.not)(p), () => c.break());
|
|
3625
3625
|
});
|
|
3626
3626
|
}
|
|
3627
3627
|
}
|
|
3628
|
-
return Ee.validateAdditionalItems =
|
|
3628
|
+
return Ee.validateAdditionalItems = v, Ee.default = l, Ee;
|
|
3629
3629
|
}
|
|
3630
3630
|
var Ye = {}, Se = {}, Or;
|
|
3631
3631
|
function nn() {
|
|
3632
3632
|
if (Or) return Se;
|
|
3633
3633
|
Or = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.validateTuple = void 0;
|
|
3634
|
-
const e = J(), r = Q(), S = le(),
|
|
3634
|
+
const e = J(), r = Q(), S = le(), l = {
|
|
3635
3635
|
keyword: "items",
|
|
3636
3636
|
type: "array",
|
|
3637
3637
|
schemaType: ["object", "array", "boolean"],
|
|
@@ -3639,33 +3639,33 @@ function nn() {
|
|
|
3639
3639
|
code(s) {
|
|
3640
3640
|
const { schema: f, it: c } = s;
|
|
3641
3641
|
if (Array.isArray(f))
|
|
3642
|
-
return
|
|
3642
|
+
return v(s, "additionalItems", f);
|
|
3643
3643
|
c.items = !0, !(0, r.alwaysValidSchema)(c, f) && s.ok((0, S.validateArray)(s));
|
|
3644
3644
|
}
|
|
3645
3645
|
};
|
|
3646
|
-
function
|
|
3647
|
-
const { gen:
|
|
3648
|
-
b(
|
|
3649
|
-
const y =
|
|
3646
|
+
function v(s, f, c = s.schema) {
|
|
3647
|
+
const { gen: h, parentSchema: $, data: _, keyword: P, it: g } = s;
|
|
3648
|
+
b($), g.opts.unevaluated && c.length && g.items !== !0 && (g.items = r.mergeEvaluated.items(h, c.length, g.items));
|
|
3649
|
+
const y = h.name("valid"), p = h.const("len", (0, e._)`${_}.length`);
|
|
3650
3650
|
c.forEach((a, o) => {
|
|
3651
|
-
(0, r.alwaysValidSchema)(
|
|
3651
|
+
(0, r.alwaysValidSchema)(g, a) || (h.if((0, e._)`${p} > ${o}`, () => s.subschema({
|
|
3652
3652
|
keyword: P,
|
|
3653
3653
|
schemaProp: o,
|
|
3654
3654
|
dataProp: o
|
|
3655
3655
|
}, y)), s.ok(y));
|
|
3656
3656
|
});
|
|
3657
3657
|
function b(a) {
|
|
3658
|
-
const { opts: o, errSchemaPath: t } =
|
|
3659
|
-
if (o.strictTuples && !
|
|
3658
|
+
const { opts: o, errSchemaPath: t } = g, i = c.length, m = i === a.minItems && (i === a.maxItems || a[f] === !1);
|
|
3659
|
+
if (o.strictTuples && !m) {
|
|
3660
3660
|
const n = `"${P}" is ${i}-tuple, but minItems or maxItems/${f} are not specified or different at path "${t}"`;
|
|
3661
|
-
(0, r.checkStrictMode)(
|
|
3661
|
+
(0, r.checkStrictMode)(g, n, o.strictTuples);
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
|
-
return Se.validateTuple =
|
|
3665
|
+
return Se.validateTuple = v, Se.default = l, Se;
|
|
3666
3666
|
}
|
|
3667
3667
|
var jr;
|
|
3668
|
-
function
|
|
3668
|
+
function Jn() {
|
|
3669
3669
|
if (jr) return Ye;
|
|
3670
3670
|
jr = 1, Object.defineProperty(Ye, "__esModule", { value: !0 });
|
|
3671
3671
|
const e = nn(), r = {
|
|
@@ -3678,10 +3678,10 @@ function Hn() {
|
|
|
3678
3678
|
return Ye.default = r, Ye;
|
|
3679
3679
|
}
|
|
3680
3680
|
var Ze = {}, Ir;
|
|
3681
|
-
function
|
|
3681
|
+
function Wn() {
|
|
3682
3682
|
if (Ir) return Ze;
|
|
3683
3683
|
Ir = 1, Object.defineProperty(Ze, "__esModule", { value: !0 });
|
|
3684
|
-
const e = J(), r = Q(), S = le(),
|
|
3684
|
+
const e = J(), r = Q(), S = le(), l = rn(), s = {
|
|
3685
3685
|
keyword: "items",
|
|
3686
3686
|
type: "array",
|
|
3687
3687
|
schemaType: ["object", "boolean"],
|
|
@@ -3691,179 +3691,179 @@ function Gn() {
|
|
|
3691
3691
|
params: ({ params: { len: f } }) => (0, e._)`{limit: ${f}}`
|
|
3692
3692
|
},
|
|
3693
3693
|
code(f) {
|
|
3694
|
-
const { schema: c, parentSchema:
|
|
3695
|
-
|
|
3694
|
+
const { schema: c, parentSchema: h, it: $ } = f, { prefixItems: _ } = h;
|
|
3695
|
+
$.items = !0, !(0, r.alwaysValidSchema)($, c) && (_ ? (0, l.validateAdditionalItems)(f, _) : f.ok((0, S.validateArray)(f)));
|
|
3696
3696
|
}
|
|
3697
3697
|
};
|
|
3698
3698
|
return Ze.default = s, Ze;
|
|
3699
3699
|
}
|
|
3700
3700
|
var xe = {}, qr;
|
|
3701
|
-
function
|
|
3701
|
+
function Bn() {
|
|
3702
3702
|
if (qr) return xe;
|
|
3703
3703
|
qr = 1, Object.defineProperty(xe, "__esModule", { value: !0 });
|
|
3704
|
-
const e = J(), r = Q(),
|
|
3704
|
+
const e = J(), r = Q(), l = {
|
|
3705
3705
|
keyword: "contains",
|
|
3706
3706
|
type: "array",
|
|
3707
3707
|
schemaType: ["object", "boolean"],
|
|
3708
3708
|
before: "uniqueItems",
|
|
3709
3709
|
trackErrors: !0,
|
|
3710
3710
|
error: {
|
|
3711
|
-
message: ({ params: { min:
|
|
3712
|
-
params: ({ params: { min:
|
|
3711
|
+
message: ({ params: { min: v, max: s } }) => s === void 0 ? (0, e.str)`must contain at least ${v} valid item(s)` : (0, e.str)`must contain at least ${v} and no more than ${s} valid item(s)`,
|
|
3712
|
+
params: ({ params: { min: v, max: s } }) => s === void 0 ? (0, e._)`{minContains: ${v}}` : (0, e._)`{minContains: ${v}, maxContains: ${s}}`
|
|
3713
3713
|
},
|
|
3714
|
-
code(
|
|
3715
|
-
const { gen: s, schema: f, parentSchema: c, data:
|
|
3716
|
-
let
|
|
3717
|
-
const { minContains:
|
|
3718
|
-
|
|
3719
|
-
const p = s.const("len", (0, e._)`${
|
|
3720
|
-
if (
|
|
3721
|
-
(0, r.checkStrictMode)(
|
|
3714
|
+
code(v) {
|
|
3715
|
+
const { gen: s, schema: f, parentSchema: c, data: h, it: $ } = v;
|
|
3716
|
+
let _, P;
|
|
3717
|
+
const { minContains: g, maxContains: y } = c;
|
|
3718
|
+
$.opts.next ? (_ = g === void 0 ? 1 : g, P = y) : _ = 1;
|
|
3719
|
+
const p = s.const("len", (0, e._)`${h}.length`);
|
|
3720
|
+
if (v.setParams({ min: _, max: P }), P === void 0 && _ === 0) {
|
|
3721
|
+
(0, r.checkStrictMode)($, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
|
|
3722
3722
|
return;
|
|
3723
3723
|
}
|
|
3724
|
-
if (P !== void 0 &&
|
|
3725
|
-
(0, r.checkStrictMode)(
|
|
3724
|
+
if (P !== void 0 && _ > P) {
|
|
3725
|
+
(0, r.checkStrictMode)($, '"minContains" > "maxContains" is always invalid'), v.fail();
|
|
3726
3726
|
return;
|
|
3727
3727
|
}
|
|
3728
|
-
if ((0, r.alwaysValidSchema)(
|
|
3729
|
-
let i = (0, e._)`${p} >= ${
|
|
3730
|
-
P !== void 0 && (i = (0, e._)`${i} && ${p} <= ${P}`),
|
|
3728
|
+
if ((0, r.alwaysValidSchema)($, f)) {
|
|
3729
|
+
let i = (0, e._)`${p} >= ${_}`;
|
|
3730
|
+
P !== void 0 && (i = (0, e._)`${i} && ${p} <= ${P}`), v.pass(i);
|
|
3731
3731
|
return;
|
|
3732
3732
|
}
|
|
3733
|
-
|
|
3733
|
+
$.items = !0;
|
|
3734
3734
|
const b = s.name("valid");
|
|
3735
|
-
P === void 0 &&
|
|
3735
|
+
P === void 0 && _ === 1 ? o(b, () => s.if(b, () => s.break())) : _ === 0 ? (s.let(b, !0), P !== void 0 && s.if((0, e._)`${h}.length > 0`, a)) : (s.let(b, !1), a()), v.result(b, () => v.reset());
|
|
3736
3736
|
function a() {
|
|
3737
|
-
const i = s.name("_valid"),
|
|
3738
|
-
o(i, () => s.if(i, () => t(
|
|
3737
|
+
const i = s.name("_valid"), m = s.let("count", 0);
|
|
3738
|
+
o(i, () => s.if(i, () => t(m)));
|
|
3739
3739
|
}
|
|
3740
|
-
function o(i,
|
|
3740
|
+
function o(i, m) {
|
|
3741
3741
|
s.forRange("i", 0, p, (n) => {
|
|
3742
|
-
|
|
3742
|
+
v.subschema({
|
|
3743
3743
|
keyword: "contains",
|
|
3744
3744
|
dataProp: n,
|
|
3745
3745
|
dataPropType: r.Type.Num,
|
|
3746
3746
|
compositeRule: !0
|
|
3747
|
-
}, i),
|
|
3747
|
+
}, i), m();
|
|
3748
3748
|
});
|
|
3749
3749
|
}
|
|
3750
3750
|
function t(i) {
|
|
3751
|
-
s.code((0, e._)`${i}++`), P === void 0 ? s.if((0, e._)`${i} >= ${
|
|
3751
|
+
s.code((0, e._)`${i}++`), P === void 0 ? s.if((0, e._)`${i} >= ${_}`, () => s.assign(b, !0).break()) : (s.if((0, e._)`${i} > ${P}`, () => s.assign(b, !1).break()), _ === 1 ? s.assign(b, !0) : s.if((0, e._)`${i} >= ${_}`, () => s.assign(b, !0)));
|
|
3752
3752
|
}
|
|
3753
3753
|
}
|
|
3754
3754
|
};
|
|
3755
|
-
return xe.default =
|
|
3755
|
+
return xe.default = l, xe;
|
|
3756
3756
|
}
|
|
3757
3757
|
var It = {}, Tr;
|
|
3758
|
-
function
|
|
3758
|
+
function Qn() {
|
|
3759
3759
|
return Tr || (Tr = 1, (function(e) {
|
|
3760
3760
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
|
|
3761
|
-
const r = J(), S = Q(),
|
|
3761
|
+
const r = J(), S = Q(), l = le();
|
|
3762
3762
|
e.error = {
|
|
3763
|
-
message: ({ params: { property:
|
|
3764
|
-
const P =
|
|
3765
|
-
return (0, r.str)`must have ${P} ${
|
|
3763
|
+
message: ({ params: { property: h, depsCount: $, deps: _ } }) => {
|
|
3764
|
+
const P = $ === 1 ? "property" : "properties";
|
|
3765
|
+
return (0, r.str)`must have ${P} ${_} when property ${h} is present`;
|
|
3766
3766
|
},
|
|
3767
|
-
params: ({ params: { property:
|
|
3767
|
+
params: ({ params: { property: h, depsCount: $, deps: _, missingProperty: P } }) => (0, r._)`{property: ${h},
|
|
3768
3768
|
missingProperty: ${P},
|
|
3769
|
-
depsCount: ${
|
|
3770
|
-
deps: ${
|
|
3769
|
+
depsCount: ${$},
|
|
3770
|
+
deps: ${_}}`
|
|
3771
3771
|
// TODO change to reference
|
|
3772
3772
|
};
|
|
3773
|
-
const
|
|
3773
|
+
const v = {
|
|
3774
3774
|
keyword: "dependencies",
|
|
3775
3775
|
type: "object",
|
|
3776
3776
|
schemaType: "object",
|
|
3777
3777
|
error: e.error,
|
|
3778
|
-
code(
|
|
3779
|
-
const [
|
|
3780
|
-
f(
|
|
3778
|
+
code(h) {
|
|
3779
|
+
const [$, _] = s(h);
|
|
3780
|
+
f(h, $), c(h, _);
|
|
3781
3781
|
}
|
|
3782
3782
|
};
|
|
3783
|
-
function s({ schema:
|
|
3784
|
-
const
|
|
3785
|
-
for (const P in
|
|
3783
|
+
function s({ schema: h }) {
|
|
3784
|
+
const $ = {}, _ = {};
|
|
3785
|
+
for (const P in h) {
|
|
3786
3786
|
if (P === "__proto__")
|
|
3787
3787
|
continue;
|
|
3788
|
-
const
|
|
3789
|
-
|
|
3788
|
+
const g = Array.isArray(h[P]) ? $ : _;
|
|
3789
|
+
g[P] = h[P];
|
|
3790
3790
|
}
|
|
3791
|
-
return [
|
|
3791
|
+
return [$, _];
|
|
3792
3792
|
}
|
|
3793
|
-
function f(
|
|
3794
|
-
const { gen:
|
|
3795
|
-
if (Object.keys(
|
|
3793
|
+
function f(h, $ = h.schema) {
|
|
3794
|
+
const { gen: _, data: P, it: g } = h;
|
|
3795
|
+
if (Object.keys($).length === 0)
|
|
3796
3796
|
return;
|
|
3797
|
-
const y =
|
|
3798
|
-
for (const p in
|
|
3799
|
-
const b =
|
|
3797
|
+
const y = _.let("missing");
|
|
3798
|
+
for (const p in $) {
|
|
3799
|
+
const b = $[p];
|
|
3800
3800
|
if (b.length === 0)
|
|
3801
3801
|
continue;
|
|
3802
|
-
const a = (0,
|
|
3803
|
-
|
|
3802
|
+
const a = (0, l.propertyInData)(_, P, p, g.opts.ownProperties);
|
|
3803
|
+
h.setParams({
|
|
3804
3804
|
property: p,
|
|
3805
3805
|
depsCount: b.length,
|
|
3806
3806
|
deps: b.join(", ")
|
|
3807
|
-
}),
|
|
3807
|
+
}), g.allErrors ? _.if(a, () => {
|
|
3808
3808
|
for (const o of b)
|
|
3809
|
-
(0,
|
|
3810
|
-
}) : (
|
|
3809
|
+
(0, l.checkReportMissingProp)(h, o);
|
|
3810
|
+
}) : (_.if((0, r._)`${a} && (${(0, l.checkMissingProp)(h, b, y)})`), (0, l.reportMissingProp)(h, y), _.else());
|
|
3811
3811
|
}
|
|
3812
3812
|
}
|
|
3813
3813
|
e.validatePropertyDeps = f;
|
|
3814
|
-
function c(
|
|
3815
|
-
const { gen:
|
|
3816
|
-
for (const b in
|
|
3817
|
-
(0, S.alwaysValidSchema)(y,
|
|
3818
|
-
(0,
|
|
3814
|
+
function c(h, $ = h.schema) {
|
|
3815
|
+
const { gen: _, data: P, keyword: g, it: y } = h, p = _.name("valid");
|
|
3816
|
+
for (const b in $)
|
|
3817
|
+
(0, S.alwaysValidSchema)(y, $[b]) || (_.if(
|
|
3818
|
+
(0, l.propertyInData)(_, P, b, y.opts.ownProperties),
|
|
3819
3819
|
() => {
|
|
3820
|
-
const a =
|
|
3821
|
-
|
|
3820
|
+
const a = h.subschema({ keyword: g, schemaProp: b }, p);
|
|
3821
|
+
h.mergeValidEvaluated(a, p);
|
|
3822
3822
|
},
|
|
3823
|
-
() =>
|
|
3823
|
+
() => _.var(p, !0)
|
|
3824
3824
|
// TODO var
|
|
3825
|
-
),
|
|
3825
|
+
), h.ok(p));
|
|
3826
3826
|
}
|
|
3827
|
-
e.validateSchemaDeps = c, e.default =
|
|
3827
|
+
e.validateSchemaDeps = c, e.default = v;
|
|
3828
3828
|
})(It)), It;
|
|
3829
3829
|
}
|
|
3830
3830
|
var et = {}, Cr;
|
|
3831
|
-
function
|
|
3831
|
+
function Xn() {
|
|
3832
3832
|
if (Cr) return et;
|
|
3833
3833
|
Cr = 1, Object.defineProperty(et, "__esModule", { value: !0 });
|
|
3834
|
-
const e = J(), r = Q(),
|
|
3834
|
+
const e = J(), r = Q(), l = {
|
|
3835
3835
|
keyword: "propertyNames",
|
|
3836
3836
|
type: "object",
|
|
3837
3837
|
schemaType: ["object", "boolean"],
|
|
3838
3838
|
error: {
|
|
3839
3839
|
message: "property name must be valid",
|
|
3840
|
-
params: ({ params:
|
|
3840
|
+
params: ({ params: v }) => (0, e._)`{propertyName: ${v.propertyName}}`
|
|
3841
3841
|
},
|
|
3842
|
-
code(
|
|
3843
|
-
const { gen: s, schema: f, data: c, it:
|
|
3844
|
-
if ((0, r.alwaysValidSchema)(
|
|
3842
|
+
code(v) {
|
|
3843
|
+
const { gen: s, schema: f, data: c, it: h } = v;
|
|
3844
|
+
if ((0, r.alwaysValidSchema)(h, f))
|
|
3845
3845
|
return;
|
|
3846
|
-
const
|
|
3847
|
-
s.forIn("key", c, (
|
|
3848
|
-
|
|
3846
|
+
const $ = s.name("valid");
|
|
3847
|
+
s.forIn("key", c, (_) => {
|
|
3848
|
+
v.setParams({ propertyName: _ }), v.subschema({
|
|
3849
3849
|
keyword: "propertyNames",
|
|
3850
|
-
data:
|
|
3850
|
+
data: _,
|
|
3851
3851
|
dataTypes: ["string"],
|
|
3852
|
-
propertyName:
|
|
3852
|
+
propertyName: _,
|
|
3853
3853
|
compositeRule: !0
|
|
3854
|
-
},
|
|
3855
|
-
|
|
3854
|
+
}, $), s.if((0, e.not)($), () => {
|
|
3855
|
+
v.error(!0), h.allErrors || s.break();
|
|
3856
3856
|
});
|
|
3857
|
-
}),
|
|
3857
|
+
}), v.ok($);
|
|
3858
3858
|
}
|
|
3859
3859
|
};
|
|
3860
|
-
return et.default =
|
|
3860
|
+
return et.default = l, et;
|
|
3861
3861
|
}
|
|
3862
3862
|
var tt = {}, Ar;
|
|
3863
3863
|
function sn() {
|
|
3864
3864
|
if (Ar) return tt;
|
|
3865
3865
|
Ar = 1, Object.defineProperty(tt, "__esModule", { value: !0 });
|
|
3866
|
-
const e = le(), r = J(), S = _e(),
|
|
3866
|
+
const e = le(), r = J(), S = _e(), l = Q(), s = {
|
|
3867
3867
|
keyword: "additionalProperties",
|
|
3868
3868
|
type: ["object"],
|
|
3869
3869
|
schemaType: ["boolean", "object"],
|
|
@@ -3874,85 +3874,85 @@ function sn() {
|
|
|
3874
3874
|
params: ({ params: f }) => (0, r._)`{additionalProperty: ${f.additionalProperty}}`
|
|
3875
3875
|
},
|
|
3876
3876
|
code(f) {
|
|
3877
|
-
const { gen: c, schema:
|
|
3877
|
+
const { gen: c, schema: h, parentSchema: $, data: _, errsCount: P, it: g } = f;
|
|
3878
3878
|
if (!P)
|
|
3879
3879
|
throw new Error("ajv implementation error");
|
|
3880
|
-
const { allErrors: y, opts: p } =
|
|
3881
|
-
if (
|
|
3880
|
+
const { allErrors: y, opts: p } = g;
|
|
3881
|
+
if (g.props = !0, p.removeAdditional !== "all" && (0, l.alwaysValidSchema)(g, h))
|
|
3882
3882
|
return;
|
|
3883
|
-
const b = (0, e.allSchemaProperties)(
|
|
3883
|
+
const b = (0, e.allSchemaProperties)($.properties), a = (0, e.allSchemaProperties)($.patternProperties);
|
|
3884
3884
|
o(), f.ok((0, r._)`${P} === ${S.default.errors}`);
|
|
3885
3885
|
function o() {
|
|
3886
|
-
c.forIn("key",
|
|
3887
|
-
!b.length && !a.length ?
|
|
3886
|
+
c.forIn("key", _, (d) => {
|
|
3887
|
+
!b.length && !a.length ? m(d) : c.if(t(d), () => m(d));
|
|
3888
3888
|
});
|
|
3889
3889
|
}
|
|
3890
|
-
function t(
|
|
3891
|
-
let
|
|
3890
|
+
function t(d) {
|
|
3891
|
+
let w;
|
|
3892
3892
|
if (b.length > 8) {
|
|
3893
|
-
const j = (0,
|
|
3894
|
-
|
|
3895
|
-
} else b.length ?
|
|
3896
|
-
return a.length && (
|
|
3893
|
+
const j = (0, l.schemaRefOrVal)(g, $.properties, "properties");
|
|
3894
|
+
w = (0, e.isOwnProperty)(c, j, d);
|
|
3895
|
+
} else b.length ? w = (0, r.or)(...b.map((j) => (0, r._)`${d} === ${j}`)) : w = r.nil;
|
|
3896
|
+
return a.length && (w = (0, r.or)(w, ...a.map((j) => (0, r._)`${(0, e.usePattern)(f, j)}.test(${d})`))), (0, r.not)(w);
|
|
3897
3897
|
}
|
|
3898
|
-
function i(
|
|
3899
|
-
c.code((0, r._)`delete ${
|
|
3898
|
+
function i(d) {
|
|
3899
|
+
c.code((0, r._)`delete ${_}[${d}]`);
|
|
3900
3900
|
}
|
|
3901
|
-
function
|
|
3902
|
-
if (p.removeAdditional === "all" || p.removeAdditional &&
|
|
3903
|
-
i(
|
|
3901
|
+
function m(d) {
|
|
3902
|
+
if (p.removeAdditional === "all" || p.removeAdditional && h === !1) {
|
|
3903
|
+
i(d);
|
|
3904
3904
|
return;
|
|
3905
3905
|
}
|
|
3906
|
-
if (
|
|
3907
|
-
f.setParams({ additionalProperty:
|
|
3906
|
+
if (h === !1) {
|
|
3907
|
+
f.setParams({ additionalProperty: d }), f.error(), y || c.break();
|
|
3908
3908
|
return;
|
|
3909
3909
|
}
|
|
3910
|
-
if (typeof
|
|
3911
|
-
const
|
|
3912
|
-
p.removeAdditional === "failing" ? (n(
|
|
3913
|
-
f.reset(), i(
|
|
3914
|
-
})) : (n(
|
|
3910
|
+
if (typeof h == "object" && !(0, l.alwaysValidSchema)(g, h)) {
|
|
3911
|
+
const w = c.name("valid");
|
|
3912
|
+
p.removeAdditional === "failing" ? (n(d, w, !1), c.if((0, r.not)(w), () => {
|
|
3913
|
+
f.reset(), i(d);
|
|
3914
|
+
})) : (n(d, w), y || c.if((0, r.not)(w), () => c.break()));
|
|
3915
3915
|
}
|
|
3916
3916
|
}
|
|
3917
|
-
function n(
|
|
3917
|
+
function n(d, w, j) {
|
|
3918
3918
|
const C = {
|
|
3919
3919
|
keyword: "additionalProperties",
|
|
3920
|
-
dataProp:
|
|
3921
|
-
dataPropType:
|
|
3920
|
+
dataProp: d,
|
|
3921
|
+
dataPropType: l.Type.Str
|
|
3922
3922
|
};
|
|
3923
3923
|
j === !1 && Object.assign(C, {
|
|
3924
3924
|
compositeRule: !0,
|
|
3925
3925
|
createErrors: !1,
|
|
3926
3926
|
allErrors: !1
|
|
3927
|
-
}), f.subschema(C,
|
|
3927
|
+
}), f.subschema(C, w);
|
|
3928
3928
|
}
|
|
3929
3929
|
}
|
|
3930
3930
|
};
|
|
3931
3931
|
return tt.default = s, tt;
|
|
3932
3932
|
}
|
|
3933
3933
|
var rt = {}, Mr;
|
|
3934
|
-
function
|
|
3934
|
+
function Yn() {
|
|
3935
3935
|
if (Mr) return rt;
|
|
3936
3936
|
Mr = 1, Object.defineProperty(rt, "__esModule", { value: !0 });
|
|
3937
|
-
const e = vt(), r = le(), S = Q(),
|
|
3937
|
+
const e = vt(), r = le(), S = Q(), l = sn(), v = {
|
|
3938
3938
|
keyword: "properties",
|
|
3939
3939
|
type: "object",
|
|
3940
3940
|
schemaType: "object",
|
|
3941
3941
|
code(s) {
|
|
3942
|
-
const { gen: f, schema: c, parentSchema:
|
|
3943
|
-
|
|
3942
|
+
const { gen: f, schema: c, parentSchema: h, data: $, it: _ } = s;
|
|
3943
|
+
_.opts.removeAdditional === "all" && h.additionalProperties === void 0 && l.default.code(new e.KeywordCxt(_, l.default, "additionalProperties"));
|
|
3944
3944
|
const P = (0, r.allSchemaProperties)(c);
|
|
3945
3945
|
for (const a of P)
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
const
|
|
3949
|
-
if (
|
|
3946
|
+
_.definedProperties.add(a);
|
|
3947
|
+
_.opts.unevaluated && P.length && _.props !== !0 && (_.props = S.mergeEvaluated.props(f, (0, S.toHash)(P), _.props));
|
|
3948
|
+
const g = P.filter((a) => !(0, S.alwaysValidSchema)(_, c[a]));
|
|
3949
|
+
if (g.length === 0)
|
|
3950
3950
|
return;
|
|
3951
3951
|
const y = f.name("valid");
|
|
3952
|
-
for (const a of
|
|
3953
|
-
p(a) ? b(a) : (f.if((0, r.propertyInData)(f,
|
|
3952
|
+
for (const a of g)
|
|
3953
|
+
p(a) ? b(a) : (f.if((0, r.propertyInData)(f, $, a, _.opts.ownProperties)), b(a), _.allErrors || f.else().var(y, !0), f.endIf()), s.it.definedProperties.add(a), s.ok(y);
|
|
3954
3954
|
function p(a) {
|
|
3955
|
-
return
|
|
3955
|
+
return _.opts.useDefaults && !_.compositeRule && c[a].default !== void 0;
|
|
3956
3956
|
}
|
|
3957
3957
|
function b(a) {
|
|
3958
3958
|
s.subschema({
|
|
@@ -3963,51 +3963,51 @@ function Qn() {
|
|
|
3963
3963
|
}
|
|
3964
3964
|
}
|
|
3965
3965
|
};
|
|
3966
|
-
return rt.default =
|
|
3966
|
+
return rt.default = v, rt;
|
|
3967
3967
|
}
|
|
3968
3968
|
var nt = {}, Dr;
|
|
3969
|
-
function
|
|
3969
|
+
function Zn() {
|
|
3970
3970
|
if (Dr) return nt;
|
|
3971
3971
|
Dr = 1, Object.defineProperty(nt, "__esModule", { value: !0 });
|
|
3972
|
-
const e = le(), r = J(), S = Q(),
|
|
3972
|
+
const e = le(), r = J(), S = Q(), l = Q(), v = {
|
|
3973
3973
|
keyword: "patternProperties",
|
|
3974
3974
|
type: "object",
|
|
3975
3975
|
schemaType: "object",
|
|
3976
3976
|
code(s) {
|
|
3977
|
-
const { gen: f, schema: c, data:
|
|
3978
|
-
if (
|
|
3977
|
+
const { gen: f, schema: c, data: h, parentSchema: $, it: _ } = s, { opts: P } = _, g = (0, e.allSchemaProperties)(c), y = g.filter((m) => (0, S.alwaysValidSchema)(_, c[m]));
|
|
3978
|
+
if (g.length === 0 || y.length === g.length && (!_.opts.unevaluated || _.props === !0))
|
|
3979
3979
|
return;
|
|
3980
|
-
const p = P.strictSchema && !P.allowMatchingProperties &&
|
|
3981
|
-
|
|
3982
|
-
const { props: a } =
|
|
3980
|
+
const p = P.strictSchema && !P.allowMatchingProperties && $.properties, b = f.name("valid");
|
|
3981
|
+
_.props !== !0 && !(_.props instanceof r.Name) && (_.props = (0, l.evaluatedPropsToName)(f, _.props));
|
|
3982
|
+
const { props: a } = _;
|
|
3983
3983
|
o();
|
|
3984
3984
|
function o() {
|
|
3985
|
-
for (const
|
|
3986
|
-
p && t(
|
|
3985
|
+
for (const m of g)
|
|
3986
|
+
p && t(m), _.allErrors ? i(m) : (f.var(b, !0), i(m), f.if(b));
|
|
3987
3987
|
}
|
|
3988
|
-
function t(
|
|
3988
|
+
function t(m) {
|
|
3989
3989
|
for (const n in p)
|
|
3990
|
-
new RegExp(
|
|
3990
|
+
new RegExp(m).test(n) && (0, S.checkStrictMode)(_, `property ${n} matches pattern ${m} (use allowMatchingProperties)`);
|
|
3991
3991
|
}
|
|
3992
|
-
function i(
|
|
3993
|
-
f.forIn("key",
|
|
3994
|
-
f.if((0, r._)`${(0, e.usePattern)(s,
|
|
3995
|
-
const
|
|
3996
|
-
|
|
3992
|
+
function i(m) {
|
|
3993
|
+
f.forIn("key", h, (n) => {
|
|
3994
|
+
f.if((0, r._)`${(0, e.usePattern)(s, m)}.test(${n})`, () => {
|
|
3995
|
+
const d = y.includes(m);
|
|
3996
|
+
d || s.subschema({
|
|
3997
3997
|
keyword: "patternProperties",
|
|
3998
|
-
schemaProp:
|
|
3998
|
+
schemaProp: m,
|
|
3999
3999
|
dataProp: n,
|
|
4000
|
-
dataPropType:
|
|
4001
|
-
}, b),
|
|
4000
|
+
dataPropType: l.Type.Str
|
|
4001
|
+
}, b), _.opts.unevaluated && a !== !0 ? f.assign((0, r._)`${a}[${n}]`, !0) : !d && !_.allErrors && f.if((0, r.not)(b), () => f.break());
|
|
4002
4002
|
});
|
|
4003
4003
|
});
|
|
4004
4004
|
}
|
|
4005
4005
|
}
|
|
4006
4006
|
};
|
|
4007
|
-
return nt.default =
|
|
4007
|
+
return nt.default = v, nt;
|
|
4008
4008
|
}
|
|
4009
4009
|
var st = {}, Vr;
|
|
4010
|
-
function
|
|
4010
|
+
function xn() {
|
|
4011
4011
|
if (Vr) return st;
|
|
4012
4012
|
Vr = 1, Object.defineProperty(st, "__esModule", { value: !0 });
|
|
4013
4013
|
const e = Q(), r = {
|
|
@@ -4015,12 +4015,12 @@ function Yn() {
|
|
|
4015
4015
|
schemaType: ["object", "boolean"],
|
|
4016
4016
|
trackErrors: !0,
|
|
4017
4017
|
code(S) {
|
|
4018
|
-
const { gen:
|
|
4019
|
-
if ((0, e.alwaysValidSchema)(s,
|
|
4018
|
+
const { gen: l, schema: v, it: s } = S;
|
|
4019
|
+
if ((0, e.alwaysValidSchema)(s, v)) {
|
|
4020
4020
|
S.fail();
|
|
4021
4021
|
return;
|
|
4022
4022
|
}
|
|
4023
|
-
const f =
|
|
4023
|
+
const f = l.name("valid");
|
|
4024
4024
|
S.subschema({
|
|
4025
4025
|
keyword: "not",
|
|
4026
4026
|
compositeRule: !0,
|
|
@@ -4033,7 +4033,7 @@ function Yn() {
|
|
|
4033
4033
|
return st.default = r, st;
|
|
4034
4034
|
}
|
|
4035
4035
|
var at = {}, Ur;
|
|
4036
|
-
function
|
|
4036
|
+
function es() {
|
|
4037
4037
|
if (Ur) return at;
|
|
4038
4038
|
Ur = 1, Object.defineProperty(at, "__esModule", { value: !0 });
|
|
4039
4039
|
const r = {
|
|
@@ -4046,68 +4046,68 @@ function Zn() {
|
|
|
4046
4046
|
return at.default = r, at;
|
|
4047
4047
|
}
|
|
4048
4048
|
var it = {}, zr;
|
|
4049
|
-
function
|
|
4049
|
+
function ts() {
|
|
4050
4050
|
if (zr) return it;
|
|
4051
4051
|
zr = 1, Object.defineProperty(it, "__esModule", { value: !0 });
|
|
4052
|
-
const e = J(), r = Q(),
|
|
4052
|
+
const e = J(), r = Q(), l = {
|
|
4053
4053
|
keyword: "oneOf",
|
|
4054
4054
|
schemaType: "array",
|
|
4055
4055
|
trackErrors: !0,
|
|
4056
4056
|
error: {
|
|
4057
4057
|
message: "must match exactly one schema in oneOf",
|
|
4058
|
-
params: ({ params:
|
|
4058
|
+
params: ({ params: v }) => (0, e._)`{passingSchemas: ${v.passing}}`
|
|
4059
4059
|
},
|
|
4060
|
-
code(
|
|
4061
|
-
const { gen: s, schema: f, parentSchema: c, it:
|
|
4060
|
+
code(v) {
|
|
4061
|
+
const { gen: s, schema: f, parentSchema: c, it: h } = v;
|
|
4062
4062
|
if (!Array.isArray(f))
|
|
4063
4063
|
throw new Error("ajv implementation error");
|
|
4064
|
-
if (
|
|
4064
|
+
if (h.opts.discriminator && c.discriminator)
|
|
4065
4065
|
return;
|
|
4066
|
-
const
|
|
4067
|
-
|
|
4066
|
+
const $ = f, _ = s.let("valid", !1), P = s.let("passing", null), g = s.name("_valid");
|
|
4067
|
+
v.setParams({ passing: P }), s.block(y), v.result(_, () => v.reset(), () => v.error(!0));
|
|
4068
4068
|
function y() {
|
|
4069
|
-
|
|
4069
|
+
$.forEach((p, b) => {
|
|
4070
4070
|
let a;
|
|
4071
|
-
(0, r.alwaysValidSchema)(
|
|
4071
|
+
(0, r.alwaysValidSchema)(h, p) ? s.var(g, !0) : a = v.subschema({
|
|
4072
4072
|
keyword: "oneOf",
|
|
4073
4073
|
schemaProp: b,
|
|
4074
4074
|
compositeRule: !0
|
|
4075
|
-
},
|
|
4076
|
-
s.assign(
|
|
4075
|
+
}, g), b > 0 && s.if((0, e._)`${g} && ${_}`).assign(_, !1).assign(P, (0, e._)`[${P}, ${b}]`).else(), s.if(g, () => {
|
|
4076
|
+
s.assign(_, !0), s.assign(P, b), a && v.mergeEvaluated(a, e.Name);
|
|
4077
4077
|
});
|
|
4078
4078
|
});
|
|
4079
4079
|
}
|
|
4080
4080
|
}
|
|
4081
4081
|
};
|
|
4082
|
-
return it.default =
|
|
4082
|
+
return it.default = l, it;
|
|
4083
4083
|
}
|
|
4084
4084
|
var ot = {}, Fr;
|
|
4085
|
-
function
|
|
4085
|
+
function rs() {
|
|
4086
4086
|
if (Fr) return ot;
|
|
4087
4087
|
Fr = 1, Object.defineProperty(ot, "__esModule", { value: !0 });
|
|
4088
4088
|
const e = Q(), r = {
|
|
4089
4089
|
keyword: "allOf",
|
|
4090
4090
|
schemaType: "array",
|
|
4091
4091
|
code(S) {
|
|
4092
|
-
const { gen:
|
|
4093
|
-
if (!Array.isArray(
|
|
4092
|
+
const { gen: l, schema: v, it: s } = S;
|
|
4093
|
+
if (!Array.isArray(v))
|
|
4094
4094
|
throw new Error("ajv implementation error");
|
|
4095
|
-
const f =
|
|
4096
|
-
|
|
4095
|
+
const f = l.name("valid");
|
|
4096
|
+
v.forEach((c, h) => {
|
|
4097
4097
|
if ((0, e.alwaysValidSchema)(s, c))
|
|
4098
4098
|
return;
|
|
4099
|
-
const
|
|
4100
|
-
S.ok(f), S.mergeEvaluated(
|
|
4099
|
+
const $ = S.subschema({ keyword: "allOf", schemaProp: h }, f);
|
|
4100
|
+
S.ok(f), S.mergeEvaluated($);
|
|
4101
4101
|
});
|
|
4102
4102
|
}
|
|
4103
4103
|
};
|
|
4104
4104
|
return ot.default = r, ot;
|
|
4105
4105
|
}
|
|
4106
4106
|
var ut = {}, Kr;
|
|
4107
|
-
function
|
|
4107
|
+
function ns() {
|
|
4108
4108
|
if (Kr) return ut;
|
|
4109
4109
|
Kr = 1, Object.defineProperty(ut, "__esModule", { value: !0 });
|
|
4110
|
-
const e = J(), r = Q(),
|
|
4110
|
+
const e = J(), r = Q(), l = {
|
|
4111
4111
|
keyword: "if",
|
|
4112
4112
|
schemaType: ["object", "boolean"],
|
|
4113
4113
|
trackErrors: !0,
|
|
@@ -4116,16 +4116,16 @@ function ts() {
|
|
|
4116
4116
|
params: ({ params: s }) => (0, e._)`{failingKeyword: ${s.ifClause}}`
|
|
4117
4117
|
},
|
|
4118
4118
|
code(s) {
|
|
4119
|
-
const { gen: f, parentSchema: c, it:
|
|
4120
|
-
c.then === void 0 && c.else === void 0 && (0, r.checkStrictMode)(
|
|
4121
|
-
const
|
|
4122
|
-
if (
|
|
4119
|
+
const { gen: f, parentSchema: c, it: h } = s;
|
|
4120
|
+
c.then === void 0 && c.else === void 0 && (0, r.checkStrictMode)(h, '"if" without "then" and "else" is ignored');
|
|
4121
|
+
const $ = v(h, "then"), _ = v(h, "else");
|
|
4122
|
+
if (!$ && !_)
|
|
4123
4123
|
return;
|
|
4124
|
-
const P = f.let("valid", !0),
|
|
4125
|
-
if (y(), s.reset(),
|
|
4124
|
+
const P = f.let("valid", !0), g = f.name("_valid");
|
|
4125
|
+
if (y(), s.reset(), $ && _) {
|
|
4126
4126
|
const b = f.let("ifClause");
|
|
4127
|
-
s.setParams({ ifClause: b }), f.if(
|
|
4128
|
-
} else
|
|
4127
|
+
s.setParams({ ifClause: b }), f.if(g, p("then", b), p("else", b));
|
|
4128
|
+
} else $ ? f.if(g, p("then")) : f.if((0, e.not)(g), p("else"));
|
|
4129
4129
|
s.pass(P, () => s.error(!0));
|
|
4130
4130
|
function y() {
|
|
4131
4131
|
const b = s.subschema({
|
|
@@ -4133,47 +4133,47 @@ function ts() {
|
|
|
4133
4133
|
compositeRule: !0,
|
|
4134
4134
|
createErrors: !1,
|
|
4135
4135
|
allErrors: !1
|
|
4136
|
-
},
|
|
4136
|
+
}, g);
|
|
4137
4137
|
s.mergeEvaluated(b);
|
|
4138
4138
|
}
|
|
4139
4139
|
function p(b, a) {
|
|
4140
4140
|
return () => {
|
|
4141
|
-
const o = s.subschema({ keyword: b },
|
|
4142
|
-
f.assign(P,
|
|
4141
|
+
const o = s.subschema({ keyword: b }, g);
|
|
4142
|
+
f.assign(P, g), s.mergeValidEvaluated(o, P), a ? f.assign(a, (0, e._)`${b}`) : s.setParams({ ifClause: b });
|
|
4143
4143
|
};
|
|
4144
4144
|
}
|
|
4145
4145
|
}
|
|
4146
4146
|
};
|
|
4147
|
-
function
|
|
4147
|
+
function v(s, f) {
|
|
4148
4148
|
const c = s.schema[f];
|
|
4149
4149
|
return c !== void 0 && !(0, r.alwaysValidSchema)(s, c);
|
|
4150
4150
|
}
|
|
4151
|
-
return ut.default =
|
|
4151
|
+
return ut.default = l, ut;
|
|
4152
4152
|
}
|
|
4153
4153
|
var ct = {}, Lr;
|
|
4154
|
-
function
|
|
4154
|
+
function ss() {
|
|
4155
4155
|
if (Lr) return ct;
|
|
4156
4156
|
Lr = 1, Object.defineProperty(ct, "__esModule", { value: !0 });
|
|
4157
4157
|
const e = Q(), r = {
|
|
4158
4158
|
keyword: ["then", "else"],
|
|
4159
4159
|
schemaType: ["object", "boolean"],
|
|
4160
|
-
code({ keyword: S, parentSchema:
|
|
4161
|
-
|
|
4160
|
+
code({ keyword: S, parentSchema: l, it: v }) {
|
|
4161
|
+
l.if === void 0 && (0, e.checkStrictMode)(v, `"${S}" without "if" is ignored`);
|
|
4162
4162
|
}
|
|
4163
4163
|
};
|
|
4164
4164
|
return ct.default = r, ct;
|
|
4165
4165
|
}
|
|
4166
4166
|
var Hr;
|
|
4167
|
-
function
|
|
4167
|
+
function as() {
|
|
4168
4168
|
if (Hr) return Xe;
|
|
4169
4169
|
Hr = 1, Object.defineProperty(Xe, "__esModule", { value: !0 });
|
|
4170
|
-
const e = rn(), r =
|
|
4170
|
+
const e = rn(), r = Jn(), S = nn(), l = Wn(), v = Bn(), s = Qn(), f = Xn(), c = sn(), h = Yn(), $ = Zn(), _ = xn(), P = es(), g = ts(), y = rs(), p = ns(), b = ss();
|
|
4171
4171
|
function a(o = !1) {
|
|
4172
4172
|
const t = [
|
|
4173
4173
|
// any
|
|
4174
|
-
v.default,
|
|
4175
|
-
P.default,
|
|
4176
4174
|
_.default,
|
|
4175
|
+
P.default,
|
|
4176
|
+
g.default,
|
|
4177
4177
|
y.default,
|
|
4178
4178
|
p.default,
|
|
4179
4179
|
b.default,
|
|
@@ -4181,15 +4181,15 @@ function ns() {
|
|
|
4181
4181
|
f.default,
|
|
4182
4182
|
c.default,
|
|
4183
4183
|
s.default,
|
|
4184
|
-
|
|
4185
|
-
|
|
4184
|
+
h.default,
|
|
4185
|
+
$.default
|
|
4186
4186
|
];
|
|
4187
|
-
return o ? t.push(r.default,
|
|
4187
|
+
return o ? t.push(r.default, l.default) : t.push(e.default, S.default), t.push(v.default), t;
|
|
4188
4188
|
}
|
|
4189
4189
|
return Xe.default = a, Xe;
|
|
4190
4190
|
}
|
|
4191
4191
|
var lt = {}, dt = {}, Gr;
|
|
4192
|
-
function
|
|
4192
|
+
function is() {
|
|
4193
4193
|
if (Gr) return dt;
|
|
4194
4194
|
Gr = 1, Object.defineProperty(dt, "__esModule", { value: !0 });
|
|
4195
4195
|
const e = J(), S = {
|
|
@@ -4198,11 +4198,11 @@ function ss() {
|
|
|
4198
4198
|
schemaType: "string",
|
|
4199
4199
|
$data: !0,
|
|
4200
4200
|
error: {
|
|
4201
|
-
message: ({ schemaCode:
|
|
4202
|
-
params: ({ schemaCode:
|
|
4201
|
+
message: ({ schemaCode: l }) => (0, e.str)`must match format "${l}"`,
|
|
4202
|
+
params: ({ schemaCode: l }) => (0, e._)`{format: ${l}}`
|
|
4203
4203
|
},
|
|
4204
|
-
code(
|
|
4205
|
-
const { gen: s, data: f, $data: c, schema:
|
|
4204
|
+
code(l, v) {
|
|
4205
|
+
const { gen: s, data: f, $data: c, schema: h, schemaCode: $, it: _ } = l, { opts: P, errSchemaPath: g, schemaEnv: y, self: p } = _;
|
|
4206
4206
|
if (!P.validateFormats)
|
|
4207
4207
|
return;
|
|
4208
4208
|
c ? b() : a();
|
|
@@ -4210,26 +4210,26 @@ function ss() {
|
|
|
4210
4210
|
const o = s.scopeValue("formats", {
|
|
4211
4211
|
ref: p.formats,
|
|
4212
4212
|
code: P.code.formats
|
|
4213
|
-
}), t = s.const("fDef", (0, e._)`${o}[${
|
|
4214
|
-
s.if((0, e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`, () => s.assign(i, (0, e._)`${t}.type || "string"`).assign(
|
|
4213
|
+
}), t = s.const("fDef", (0, e._)`${o}[${$}]`), i = s.let("fType"), m = s.let("format");
|
|
4214
|
+
s.if((0, e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`, () => s.assign(i, (0, e._)`${t}.type || "string"`).assign(m, (0, e._)`${t}.validate`), () => s.assign(i, (0, e._)`"string"`).assign(m, t)), l.fail$data((0, e.or)(n(), d()));
|
|
4215
4215
|
function n() {
|
|
4216
|
-
return P.strictSchema === !1 ? e.nil : (0, e._)`${
|
|
4216
|
+
return P.strictSchema === !1 ? e.nil : (0, e._)`${$} && !${m}`;
|
|
4217
4217
|
}
|
|
4218
|
-
function
|
|
4219
|
-
const
|
|
4220
|
-
return (0, e._)`${
|
|
4218
|
+
function d() {
|
|
4219
|
+
const w = y.$async ? (0, e._)`(${t}.async ? await ${m}(${f}) : ${m}(${f}))` : (0, e._)`${m}(${f})`, j = (0, e._)`(typeof ${m} == "function" ? ${w} : ${m}.test(${f}))`;
|
|
4220
|
+
return (0, e._)`${m} && ${m} !== true && ${i} === ${v} && !${j}`;
|
|
4221
4221
|
}
|
|
4222
4222
|
}
|
|
4223
4223
|
function a() {
|
|
4224
|
-
const o = p.formats[
|
|
4224
|
+
const o = p.formats[h];
|
|
4225
4225
|
if (!o) {
|
|
4226
4226
|
n();
|
|
4227
4227
|
return;
|
|
4228
4228
|
}
|
|
4229
4229
|
if (o === !0)
|
|
4230
4230
|
return;
|
|
4231
|
-
const [t, i,
|
|
4232
|
-
t ===
|
|
4231
|
+
const [t, i, m] = d(o);
|
|
4232
|
+
t === v && l.pass(w());
|
|
4233
4233
|
function n() {
|
|
4234
4234
|
if (P.strictSchema === !1) {
|
|
4235
4235
|
p.logger.warn(j());
|
|
@@ -4237,20 +4237,20 @@ function ss() {
|
|
|
4237
4237
|
}
|
|
4238
4238
|
throw new Error(j());
|
|
4239
4239
|
function j() {
|
|
4240
|
-
return `unknown format "${
|
|
4240
|
+
return `unknown format "${h}" ignored in schema at path "${g}"`;
|
|
4241
4241
|
}
|
|
4242
4242
|
}
|
|
4243
|
-
function
|
|
4244
|
-
const C = j instanceof RegExp ? (0, e.regexpCode)(j) : P.code.formats ? (0, e._)`${P.code.formats}${(0, e.getProperty)(
|
|
4243
|
+
function d(j) {
|
|
4244
|
+
const C = j instanceof RegExp ? (0, e.regexpCode)(j) : P.code.formats ? (0, e._)`${P.code.formats}${(0, e.getProperty)(h)}` : void 0, D = s.scopeValue("formats", { key: h, ref: j, code: C });
|
|
4245
4245
|
return typeof j == "object" && !(j instanceof RegExp) ? [j.type || "string", j.validate, (0, e._)`${D}.validate`] : ["string", j, D];
|
|
4246
4246
|
}
|
|
4247
|
-
function
|
|
4247
|
+
function w() {
|
|
4248
4248
|
if (typeof o == "object" && !(o instanceof RegExp) && o.async) {
|
|
4249
4249
|
if (!y.$async)
|
|
4250
4250
|
throw new Error("async format in sync schema");
|
|
4251
|
-
return (0, e._)`await ${
|
|
4251
|
+
return (0, e._)`await ${m}(${f})`;
|
|
4252
4252
|
}
|
|
4253
|
-
return typeof i == "function" ? (0, e._)`${
|
|
4253
|
+
return typeof i == "function" ? (0, e._)`${m}(${f})` : (0, e._)`${m}.test(${f})`;
|
|
4254
4254
|
}
|
|
4255
4255
|
}
|
|
4256
4256
|
}
|
|
@@ -4258,14 +4258,14 @@ function ss() {
|
|
|
4258
4258
|
return dt.default = S, dt;
|
|
4259
4259
|
}
|
|
4260
4260
|
var Jr;
|
|
4261
|
-
function
|
|
4261
|
+
function os() {
|
|
4262
4262
|
if (Jr) return lt;
|
|
4263
4263
|
Jr = 1, Object.defineProperty(lt, "__esModule", { value: !0 });
|
|
4264
|
-
const r = [
|
|
4264
|
+
const r = [is().default];
|
|
4265
4265
|
return lt.default = r, lt;
|
|
4266
4266
|
}
|
|
4267
4267
|
var we = {}, Wr;
|
|
4268
|
-
function
|
|
4268
|
+
function us() {
|
|
4269
4269
|
return Wr || (Wr = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.contentVocabulary = we.metadataVocabulary = void 0, we.metadataVocabulary = [
|
|
4270
4270
|
"title",
|
|
4271
4271
|
"description",
|
|
@@ -4281,21 +4281,21 @@ function is() {
|
|
|
4281
4281
|
]), we;
|
|
4282
4282
|
}
|
|
4283
4283
|
var Br;
|
|
4284
|
-
function
|
|
4284
|
+
function cs() {
|
|
4285
4285
|
if (Br) return Ce;
|
|
4286
4286
|
Br = 1, Object.defineProperty(Ce, "__esModule", { value: !0 });
|
|
4287
|
-
const e =
|
|
4287
|
+
const e = Tn(), r = Gn(), S = as(), l = os(), v = us(), s = [
|
|
4288
4288
|
e.default,
|
|
4289
4289
|
r.default,
|
|
4290
4290
|
(0, S.default)(),
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4291
|
+
l.default,
|
|
4292
|
+
v.metadataVocabulary,
|
|
4293
|
+
v.contentVocabulary
|
|
4294
4294
|
];
|
|
4295
4295
|
return Ce.default = s, Ce;
|
|
4296
4296
|
}
|
|
4297
4297
|
var ft = {}, ke = {}, Qr;
|
|
4298
|
-
function
|
|
4298
|
+
function ls() {
|
|
4299
4299
|
if (Qr) return ke;
|
|
4300
4300
|
Qr = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.DiscrError = void 0;
|
|
4301
4301
|
var e;
|
|
@@ -4304,58 +4304,58 @@ function us() {
|
|
|
4304
4304
|
})(e || (ke.DiscrError = e = {})), ke;
|
|
4305
4305
|
}
|
|
4306
4306
|
var Xr;
|
|
4307
|
-
function
|
|
4307
|
+
function ds() {
|
|
4308
4308
|
if (Xr) return ft;
|
|
4309
4309
|
Xr = 1, Object.defineProperty(ft, "__esModule", { value: !0 });
|
|
4310
|
-
const e = J(), r =
|
|
4310
|
+
const e = J(), r = ls(), S = At(), l = _t(), v = Q(), f = {
|
|
4311
4311
|
keyword: "discriminator",
|
|
4312
4312
|
type: "object",
|
|
4313
4313
|
schemaType: "object",
|
|
4314
4314
|
error: {
|
|
4315
|
-
message: ({ params: { discrError: c, tagName:
|
|
4316
|
-
params: ({ params: { discrError: c, tag:
|
|
4315
|
+
message: ({ params: { discrError: c, tagName: h } }) => c === r.DiscrError.Tag ? `tag "${h}" must be string` : `value of tag "${h}" must be in oneOf`,
|
|
4316
|
+
params: ({ params: { discrError: c, tag: h, tagName: $ } }) => (0, e._)`{error: ${c}, tag: ${$}, tagValue: ${h}}`
|
|
4317
4317
|
},
|
|
4318
4318
|
code(c) {
|
|
4319
|
-
const { gen:
|
|
4320
|
-
if (!
|
|
4319
|
+
const { gen: h, data: $, schema: _, parentSchema: P, it: g } = c, { oneOf: y } = P;
|
|
4320
|
+
if (!g.opts.discriminator)
|
|
4321
4321
|
throw new Error("discriminator: requires discriminator option");
|
|
4322
|
-
const p =
|
|
4322
|
+
const p = _.propertyName;
|
|
4323
4323
|
if (typeof p != "string")
|
|
4324
4324
|
throw new Error("discriminator: requires propertyName");
|
|
4325
|
-
if (
|
|
4325
|
+
if (_.mapping)
|
|
4326
4326
|
throw new Error("discriminator: mapping is not supported");
|
|
4327
4327
|
if (!y)
|
|
4328
4328
|
throw new Error("discriminator: requires oneOf keyword");
|
|
4329
|
-
const b =
|
|
4330
|
-
|
|
4329
|
+
const b = h.let("valid", !1), a = h.const("tag", (0, e._)`${$}${(0, e.getProperty)(p)}`);
|
|
4330
|
+
h.if((0, e._)`typeof ${a} == "string"`, () => o(), () => c.error(!1, { discrError: r.DiscrError.Tag, tag: a, tagName: p })), c.ok(b);
|
|
4331
4331
|
function o() {
|
|
4332
|
-
const
|
|
4333
|
-
|
|
4334
|
-
for (const n in
|
|
4335
|
-
|
|
4336
|
-
|
|
4332
|
+
const m = i();
|
|
4333
|
+
h.if(!1);
|
|
4334
|
+
for (const n in m)
|
|
4335
|
+
h.elseIf((0, e._)`${a} === ${n}`), h.assign(b, t(m[n]));
|
|
4336
|
+
h.else(), c.error(!1, { discrError: r.DiscrError.Mapping, tag: a, tagName: p }), h.endIf();
|
|
4337
4337
|
}
|
|
4338
|
-
function t(
|
|
4339
|
-
const n =
|
|
4340
|
-
return c.mergeEvaluated(
|
|
4338
|
+
function t(m) {
|
|
4339
|
+
const n = h.name("valid"), d = c.subschema({ keyword: "oneOf", schemaProp: m }, n);
|
|
4340
|
+
return c.mergeEvaluated(d, e.Name), n;
|
|
4341
4341
|
}
|
|
4342
4342
|
function i() {
|
|
4343
|
-
var
|
|
4344
|
-
const n = {},
|
|
4345
|
-
let
|
|
4343
|
+
var m;
|
|
4344
|
+
const n = {}, d = j(P);
|
|
4345
|
+
let w = !0;
|
|
4346
4346
|
for (let V = 0; V < y.length; V++) {
|
|
4347
4347
|
let L = y[V];
|
|
4348
|
-
if (L?.$ref && !(0,
|
|
4348
|
+
if (L?.$ref && !(0, v.schemaHasRulesButRef)(L, g.self.RULES)) {
|
|
4349
4349
|
const B = L.$ref;
|
|
4350
|
-
if (L = S.resolveRef.call(
|
|
4351
|
-
throw new
|
|
4350
|
+
if (L = S.resolveRef.call(g.self, g.schemaEnv.root, g.baseId, B), L instanceof S.SchemaEnv && (L = L.schema), L === void 0)
|
|
4351
|
+
throw new l.default(g.opts.uriResolver, g.baseId, B);
|
|
4352
4352
|
}
|
|
4353
|
-
const K = (
|
|
4353
|
+
const K = (m = L?.properties) === null || m === void 0 ? void 0 : m[p];
|
|
4354
4354
|
if (typeof K != "object")
|
|
4355
4355
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);
|
|
4356
|
-
|
|
4356
|
+
w = w && (d || j(L)), C(K, V);
|
|
4357
4357
|
}
|
|
4358
|
-
if (
|
|
4358
|
+
if (!w)
|
|
4359
4359
|
throw new Error(`discriminator: "${p}" must be required`);
|
|
4360
4360
|
return n;
|
|
4361
4361
|
function j({ required: V }) {
|
|
@@ -4380,23 +4380,23 @@ function cs() {
|
|
|
4380
4380
|
};
|
|
4381
4381
|
return ft.default = f, ft;
|
|
4382
4382
|
}
|
|
4383
|
-
const
|
|
4384
|
-
$schema:
|
|
4385
|
-
$id:
|
|
4386
|
-
title:
|
|
4387
|
-
definitions:
|
|
4388
|
-
type:
|
|
4389
|
-
properties:
|
|
4383
|
+
const fs = "http://json-schema.org/draft-07/schema#", hs = "http://json-schema.org/draft-07/schema#", ms = "Core schema meta-schema", ps = { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, ys = ["object", "boolean"], vs = { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, _s = {
|
|
4384
|
+
$schema: fs,
|
|
4385
|
+
$id: hs,
|
|
4386
|
+
title: ms,
|
|
4387
|
+
definitions: ps,
|
|
4388
|
+
type: ys,
|
|
4389
|
+
properties: vs,
|
|
4390
4390
|
default: !0
|
|
4391
4391
|
};
|
|
4392
4392
|
var Yr;
|
|
4393
|
-
function
|
|
4393
|
+
function gs() {
|
|
4394
4394
|
return Yr || (Yr = 1, (function(e, r) {
|
|
4395
4395
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.MissingRefError = r.ValidationError = r.CodeGen = r.Name = r.nil = r.stringify = r.str = r._ = r.KeywordCxt = r.Ajv = void 0;
|
|
4396
|
-
const S =
|
|
4397
|
-
class
|
|
4396
|
+
const S = jn(), l = cs(), v = ds(), s = _s, f = ["/properties"], c = "http://json-schema.org/draft-07/schema";
|
|
4397
|
+
class h extends S.default {
|
|
4398
4398
|
_addVocabularies() {
|
|
4399
|
-
super._addVocabularies(),
|
|
4399
|
+
super._addVocabularies(), l.default.forEach((p) => this.addVocabulary(p)), this.opts.discriminator && this.addKeyword(v.default);
|
|
4400
4400
|
}
|
|
4401
4401
|
_addDefaultMetaSchema() {
|
|
4402
4402
|
if (super._addDefaultMetaSchema(), !this.opts.meta)
|
|
@@ -4408,77 +4408,78 @@ function vs() {
|
|
|
4408
4408
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(c) ? c : void 0);
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
|
-
r.Ajv =
|
|
4412
|
-
var
|
|
4411
|
+
r.Ajv = h, e.exports = r = h, e.exports.Ajv = h, Object.defineProperty(r, "__esModule", { value: !0 }), r.default = h;
|
|
4412
|
+
var $ = vt();
|
|
4413
4413
|
Object.defineProperty(r, "KeywordCxt", { enumerable: !0, get: function() {
|
|
4414
|
-
return
|
|
4414
|
+
return $.KeywordCxt;
|
|
4415
4415
|
} });
|
|
4416
|
-
var
|
|
4416
|
+
var _ = J();
|
|
4417
4417
|
Object.defineProperty(r, "_", { enumerable: !0, get: function() {
|
|
4418
|
-
return
|
|
4418
|
+
return _._;
|
|
4419
4419
|
} }), Object.defineProperty(r, "str", { enumerable: !0, get: function() {
|
|
4420
|
-
return
|
|
4420
|
+
return _.str;
|
|
4421
4421
|
} }), Object.defineProperty(r, "stringify", { enumerable: !0, get: function() {
|
|
4422
|
-
return
|
|
4422
|
+
return _.stringify;
|
|
4423
4423
|
} }), Object.defineProperty(r, "nil", { enumerable: !0, get: function() {
|
|
4424
|
-
return
|
|
4424
|
+
return _.nil;
|
|
4425
4425
|
} }), Object.defineProperty(r, "Name", { enumerable: !0, get: function() {
|
|
4426
|
-
return
|
|
4426
|
+
return _.Name;
|
|
4427
4427
|
} }), Object.defineProperty(r, "CodeGen", { enumerable: !0, get: function() {
|
|
4428
|
-
return
|
|
4428
|
+
return _.CodeGen;
|
|
4429
4429
|
} });
|
|
4430
4430
|
var P = Ct();
|
|
4431
4431
|
Object.defineProperty(r, "ValidationError", { enumerable: !0, get: function() {
|
|
4432
4432
|
return P.default;
|
|
4433
4433
|
} });
|
|
4434
|
-
var
|
|
4434
|
+
var g = _t();
|
|
4435
4435
|
Object.defineProperty(r, "MissingRefError", { enumerable: !0, get: function() {
|
|
4436
|
-
return
|
|
4436
|
+
return g.default;
|
|
4437
4437
|
} });
|
|
4438
4438
|
})(Oe, Oe.exports)), Oe.exports;
|
|
4439
4439
|
}
|
|
4440
|
-
var
|
|
4441
|
-
const
|
|
4442
|
-
function qt(e, r, S,
|
|
4440
|
+
var $s = gs();
|
|
4441
|
+
const ws = /* @__PURE__ */ mn($s);
|
|
4442
|
+
function qt(e, r, S, l) {
|
|
4443
4443
|
if (typeof e == "string") {
|
|
4444
|
-
const
|
|
4445
|
-
|
|
4444
|
+
const v = fn(e), { componentNames: s, dataSourceNames: f, fnNames: c, localeKeys: h } = S;
|
|
4445
|
+
v?.op === "component" && s && !s.includes(v.arg) ? l.push(`${r || "/"}: unknown component "${v.arg}"`) : v?.op === "dataSource" && f && !f.includes(v.arg) ? l.push(`${r || "/"}: unknown dataSource "${v.arg}"`) : v?.op === "fn" && c && !c.includes(v.arg) ? l.push(`${r || "/"}: unknown fn "${v.arg}"`) : v?.op === "locale" && h && !h.includes(v.arg) && l.push(`${r || "/"}: unknown locale key "${v.arg}"`);
|
|
4446
4446
|
return;
|
|
4447
4447
|
}
|
|
4448
4448
|
if (Array.isArray(e)) {
|
|
4449
|
-
e.forEach(
|
|
4450
|
-
(s, f) => qt(s, `${r}[${f}]`, S, d, g)
|
|
4451
|
-
);
|
|
4449
|
+
e.forEach((v, s) => qt(v, `${r}[${s}]`, S, l));
|
|
4452
4450
|
return;
|
|
4453
4451
|
}
|
|
4454
|
-
if (e !== null && typeof e == "object")
|
|
4452
|
+
if (e !== null && typeof e == "object") {
|
|
4453
|
+
const v = e;
|
|
4454
|
+
typeof v.$locale == "string" && S.localeKeys && !S.localeKeys.includes(v.$locale) && l.push(`${r ? `${r}.` : ""}$locale: unknown locale key "${v.$locale}"`);
|
|
4455
4455
|
for (const [s, f] of Object.entries(e))
|
|
4456
|
-
qt(f, r ? `${r}.${s}` : s, S,
|
|
4456
|
+
qt(f, r ? `${r}.${s}` : s, S, l);
|
|
4457
|
+
}
|
|
4457
4458
|
}
|
|
4458
|
-
function
|
|
4459
|
-
return
|
|
4459
|
+
function bs(e) {
|
|
4460
|
+
return hn(e.array) && typeof e.item == "object" && e.item !== null && "$template" in e.item;
|
|
4460
4461
|
}
|
|
4461
4462
|
function Tt(e, r, S) {
|
|
4462
4463
|
if (Array.isArray(e)) {
|
|
4463
|
-
e.forEach((
|
|
4464
|
+
e.forEach((l, v) => Tt(l, `${r}[${v}]`, S));
|
|
4464
4465
|
return;
|
|
4465
4466
|
}
|
|
4466
4467
|
if (e !== null && typeof e == "object") {
|
|
4467
|
-
const
|
|
4468
|
-
|
|
4468
|
+
const l = e;
|
|
4469
|
+
bs(l) && l.initialValue === void 0 && S.push(
|
|
4469
4470
|
`${r || "/"}: array node is missing "initialValue" — the "Add" button would create an empty element and its "$model(...)" template leaves would render nothing. Provide an "initialValue" literal with the element's keys.`
|
|
4470
4471
|
);
|
|
4471
|
-
for (const [
|
|
4472
|
-
Tt(s, r ? `${r}.${
|
|
4472
|
+
for (const [v, s] of Object.entries(l))
|
|
4473
|
+
Tt(s, r ? `${r}.${v}` : v, S);
|
|
4473
4474
|
}
|
|
4474
4475
|
}
|
|
4475
|
-
function
|
|
4476
|
-
const S = r.componentNames ?? (r.registry ? on(r.registry) : void 0),
|
|
4477
|
-
if (!
|
|
4478
|
-
for (const
|
|
4479
|
-
|
|
4480
|
-
return qt(e, "", S,
|
|
4476
|
+
function Ss(e, r = {}) {
|
|
4477
|
+
const S = r.componentNames ?? (r.registry ? on(r.registry) : void 0), l = r.dataSourceNames ?? (r.registry ? un(r.registry) : void 0), v = r.fnNames ?? (r.registry ? cn(r.registry) : void 0), s = r.localeKeys ?? (r.registry ? ln(r.registry) : void 0), f = [], h = new ws({ allErrors: !0 }).compile(dn);
|
|
4478
|
+
if (!h(e))
|
|
4479
|
+
for (const $ of h.errors ?? [])
|
|
4480
|
+
$.keyword !== "if" && f.push(`${$.instancePath || "/"} ${$.message ?? "invalid"}`.trim());
|
|
4481
|
+
return qt(e, "", { componentNames: S, dataSourceNames: l, fnNames: v, localeKeys: s }, f), Tt(e, "", f), { valid: f.length === 0, errors: f };
|
|
4481
4482
|
}
|
|
4482
4483
|
export {
|
|
4483
|
-
|
|
4484
|
+
Ss as validateFormSchema
|
|
4484
4485
|
};
|