@kohost/api-client 3.0.0-beta.6 → 3.0.0-beta.8
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/cjs/Client.js +570 -247
- package/dist/cjs/Commands.js +70 -22
- package/dist/cjs/Errors.js +24 -22
- package/dist/cjs/Events.js +26 -14
- package/dist/cjs/Models.js +56 -26
- package/dist/cjs/defs.js +4 -1
- package/dist/cjs/utils.js +8 -4
- package/dist/esm/Client.js +858 -451
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +70 -22
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Errors.js +24 -22
- package/dist/esm/Errors.js.map +1 -1
- package/dist/esm/Events.js +26 -14
- package/dist/esm/Events.js.map +2 -2
- package/dist/esm/Models.js +719 -95
- package/dist/esm/Models.js.map +1 -1
- package/dist/esm/defs.js +292 -205
- package/dist/esm/defs.js.map +2 -2
- package/dist/esm/utils.js +379 -50
- package/dist/esm/utils.js.map +1 -1
- package/dist/useCases/AdminCreateAdminUser.js +32 -0
- package/dist/useCases/AdminCreateCustomer.js +32 -0
- package/dist/useCases/AdminDescribeCustomer.js +32 -0
- package/dist/useCases/AdminListAdminUsers.js +32 -0
- package/dist/useCases/{LoginGateway.js → AdminLoginUser.js} +2 -2
- package/dist/useCases/AdminRefreshToken.js +32 -0
- package/dist/useCases/AdminRequestLoginLink.js +32 -0
- package/dist/useCases/AdminUpdateCustomer.js +32 -0
- package/package.json +1 -1
package/dist/esm/utils.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
1
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
2
4
|
var __commonJS = (cb, mod) => function __require() {
|
|
3
5
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
6
|
};
|
|
@@ -9,6 +11,7 @@ var require_getFormalDeviceType = __commonJS({
|
|
|
9
11
|
function getFormalDeviceType(deviceType) {
|
|
10
12
|
return deviceType.charAt(0).toUpperCase() + deviceType.slice(1);
|
|
11
13
|
}
|
|
14
|
+
__name(getFormalDeviceType, "getFormalDeviceType");
|
|
12
15
|
module.exports = getFormalDeviceType;
|
|
13
16
|
}
|
|
14
17
|
});
|
|
@@ -40,6 +43,7 @@ var require_getDeviceTypes = __commonJS({
|
|
|
40
43
|
function getDeviceTypes() {
|
|
41
44
|
return deviceTypes;
|
|
42
45
|
}
|
|
46
|
+
__name(getDeviceTypes, "getDeviceTypes");
|
|
43
47
|
module.exports = getDeviceTypes;
|
|
44
48
|
}
|
|
45
49
|
});
|
|
@@ -52,6 +56,7 @@ var require_code = __commonJS({
|
|
|
52
56
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
53
57
|
var _CodeOrName = class {
|
|
54
58
|
};
|
|
59
|
+
__name(_CodeOrName, "_CodeOrName");
|
|
55
60
|
exports._CodeOrName = _CodeOrName;
|
|
56
61
|
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
57
62
|
var Name = class extends _CodeOrName {
|
|
@@ -71,6 +76,7 @@ var require_code = __commonJS({
|
|
|
71
76
|
return { [this.str]: 1 };
|
|
72
77
|
}
|
|
73
78
|
};
|
|
79
|
+
__name(Name, "Name");
|
|
74
80
|
exports.Name = Name;
|
|
75
81
|
var _Code = class extends _CodeOrName {
|
|
76
82
|
constructor(code) {
|
|
@@ -99,6 +105,7 @@ var require_code = __commonJS({
|
|
|
99
105
|
}, {});
|
|
100
106
|
}
|
|
101
107
|
};
|
|
108
|
+
__name(_Code, "_Code");
|
|
102
109
|
exports._Code = _Code;
|
|
103
110
|
exports.nil = new _Code("");
|
|
104
111
|
function _(strs, ...args) {
|
|
@@ -110,6 +117,7 @@ var require_code = __commonJS({
|
|
|
110
117
|
}
|
|
111
118
|
return new _Code(code);
|
|
112
119
|
}
|
|
120
|
+
__name(_, "_");
|
|
113
121
|
exports._ = _;
|
|
114
122
|
var plus = new _Code("+");
|
|
115
123
|
function str(strs, ...args) {
|
|
@@ -123,6 +131,7 @@ var require_code = __commonJS({
|
|
|
123
131
|
optimize(expr);
|
|
124
132
|
return new _Code(expr);
|
|
125
133
|
}
|
|
134
|
+
__name(str, "str");
|
|
126
135
|
exports.str = str;
|
|
127
136
|
function addCodeArg(code, arg) {
|
|
128
137
|
if (arg instanceof _Code)
|
|
@@ -132,6 +141,7 @@ var require_code = __commonJS({
|
|
|
132
141
|
else
|
|
133
142
|
code.push(interpolate(arg));
|
|
134
143
|
}
|
|
144
|
+
__name(addCodeArg, "addCodeArg");
|
|
135
145
|
exports.addCodeArg = addCodeArg;
|
|
136
146
|
function optimize(expr) {
|
|
137
147
|
let i = 1;
|
|
@@ -147,6 +157,7 @@ var require_code = __commonJS({
|
|
|
147
157
|
i++;
|
|
148
158
|
}
|
|
149
159
|
}
|
|
160
|
+
__name(optimize, "optimize");
|
|
150
161
|
function mergeExprItems(a, b) {
|
|
151
162
|
if (b === '""')
|
|
152
163
|
return a;
|
|
@@ -165,24 +176,30 @@ var require_code = __commonJS({
|
|
|
165
176
|
return `"${a}${b.slice(1)}`;
|
|
166
177
|
return;
|
|
167
178
|
}
|
|
179
|
+
__name(mergeExprItems, "mergeExprItems");
|
|
168
180
|
function strConcat(c1, c2) {
|
|
169
181
|
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
|
|
170
182
|
}
|
|
183
|
+
__name(strConcat, "strConcat");
|
|
171
184
|
exports.strConcat = strConcat;
|
|
172
185
|
function interpolate(x) {
|
|
173
186
|
return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
|
|
174
187
|
}
|
|
188
|
+
__name(interpolate, "interpolate");
|
|
175
189
|
function stringify(x) {
|
|
176
190
|
return new _Code(safeStringify(x));
|
|
177
191
|
}
|
|
192
|
+
__name(stringify, "stringify");
|
|
178
193
|
exports.stringify = stringify;
|
|
179
194
|
function safeStringify(x) {
|
|
180
195
|
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
181
196
|
}
|
|
197
|
+
__name(safeStringify, "safeStringify");
|
|
182
198
|
exports.safeStringify = safeStringify;
|
|
183
199
|
function getProperty(key) {
|
|
184
200
|
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
|
|
185
201
|
}
|
|
202
|
+
__name(getProperty, "getProperty");
|
|
186
203
|
exports.getProperty = getProperty;
|
|
187
204
|
function getEsmExportName(key) {
|
|
188
205
|
if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
|
|
@@ -190,10 +207,12 @@ var require_code = __commonJS({
|
|
|
190
207
|
}
|
|
191
208
|
throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
|
|
192
209
|
}
|
|
210
|
+
__name(getEsmExportName, "getEsmExportName");
|
|
193
211
|
exports.getEsmExportName = getEsmExportName;
|
|
194
212
|
function regexpCode(rx) {
|
|
195
213
|
return new _Code(rx.toString());
|
|
196
214
|
}
|
|
215
|
+
__name(regexpCode, "regexpCode");
|
|
197
216
|
exports.regexpCode = regexpCode;
|
|
198
217
|
}
|
|
199
218
|
});
|
|
@@ -211,6 +230,7 @@ var require_scope = __commonJS({
|
|
|
211
230
|
this.value = name.value;
|
|
212
231
|
}
|
|
213
232
|
};
|
|
233
|
+
__name(ValueError, "ValueError");
|
|
214
234
|
var UsedValueState;
|
|
215
235
|
(function(UsedValueState2) {
|
|
216
236
|
UsedValueState2[UsedValueState2["Started"] = 0] = "Started";
|
|
@@ -245,6 +265,7 @@ var require_scope = __commonJS({
|
|
|
245
265
|
return this._names[prefix] = { prefix, index: 0 };
|
|
246
266
|
}
|
|
247
267
|
};
|
|
268
|
+
__name(Scope, "Scope");
|
|
248
269
|
exports.Scope = Scope;
|
|
249
270
|
var ValueScopeName = class extends code_1.Name {
|
|
250
271
|
constructor(prefix, nameStr) {
|
|
@@ -256,6 +277,7 @@ var require_scope = __commonJS({
|
|
|
256
277
|
this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;
|
|
257
278
|
}
|
|
258
279
|
};
|
|
280
|
+
__name(ValueScopeName, "ValueScopeName");
|
|
259
281
|
exports.ValueScopeName = ValueScopeName;
|
|
260
282
|
var line = (0, code_1._)`\n`;
|
|
261
283
|
var ValueScope = class extends Scope {
|
|
@@ -339,6 +361,7 @@ var require_scope = __commonJS({
|
|
|
339
361
|
return code;
|
|
340
362
|
}
|
|
341
363
|
};
|
|
364
|
+
__name(ValueScope, "ValueScope");
|
|
342
365
|
exports.ValueScope = ValueScope;
|
|
343
366
|
}
|
|
344
367
|
});
|
|
@@ -409,6 +432,7 @@ var require_codegen = __commonJS({
|
|
|
409
432
|
return this;
|
|
410
433
|
}
|
|
411
434
|
};
|
|
435
|
+
__name(Node, "Node");
|
|
412
436
|
var Def = class extends Node {
|
|
413
437
|
constructor(varKind, name, rhs) {
|
|
414
438
|
super();
|
|
@@ -432,6 +456,7 @@ var require_codegen = __commonJS({
|
|
|
432
456
|
return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
|
|
433
457
|
}
|
|
434
458
|
};
|
|
459
|
+
__name(Def, "Def");
|
|
435
460
|
var Assign = class extends Node {
|
|
436
461
|
constructor(lhs, rhs, sideEffects) {
|
|
437
462
|
super();
|
|
@@ -453,6 +478,7 @@ var require_codegen = __commonJS({
|
|
|
453
478
|
return addExprNames(names, this.rhs);
|
|
454
479
|
}
|
|
455
480
|
};
|
|
481
|
+
__name(Assign, "Assign");
|
|
456
482
|
var AssignOp = class extends Assign {
|
|
457
483
|
constructor(lhs, op, rhs, sideEffects) {
|
|
458
484
|
super(lhs, rhs, sideEffects);
|
|
@@ -462,6 +488,7 @@ var require_codegen = __commonJS({
|
|
|
462
488
|
return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
|
|
463
489
|
}
|
|
464
490
|
};
|
|
491
|
+
__name(AssignOp, "AssignOp");
|
|
465
492
|
var Label = class extends Node {
|
|
466
493
|
constructor(label) {
|
|
467
494
|
super();
|
|
@@ -472,6 +499,7 @@ var require_codegen = __commonJS({
|
|
|
472
499
|
return `${this.label}:` + _n;
|
|
473
500
|
}
|
|
474
501
|
};
|
|
502
|
+
__name(Label, "Label");
|
|
475
503
|
var Break = class extends Node {
|
|
476
504
|
constructor(label) {
|
|
477
505
|
super();
|
|
@@ -483,6 +511,7 @@ var require_codegen = __commonJS({
|
|
|
483
511
|
return `break${label};` + _n;
|
|
484
512
|
}
|
|
485
513
|
};
|
|
514
|
+
__name(Break, "Break");
|
|
486
515
|
var Throw = class extends Node {
|
|
487
516
|
constructor(error) {
|
|
488
517
|
super();
|
|
@@ -495,6 +524,7 @@ var require_codegen = __commonJS({
|
|
|
495
524
|
return this.error.names;
|
|
496
525
|
}
|
|
497
526
|
};
|
|
527
|
+
__name(Throw, "Throw");
|
|
498
528
|
var AnyCode = class extends Node {
|
|
499
529
|
constructor(code) {
|
|
500
530
|
super();
|
|
@@ -514,6 +544,7 @@ var require_codegen = __commonJS({
|
|
|
514
544
|
return this.code instanceof code_1._CodeOrName ? this.code.names : {};
|
|
515
545
|
}
|
|
516
546
|
};
|
|
547
|
+
__name(AnyCode, "AnyCode");
|
|
517
548
|
var ParentNode = class extends Node {
|
|
518
549
|
constructor(nodes = []) {
|
|
519
550
|
super();
|
|
@@ -552,15 +583,19 @@ var require_codegen = __commonJS({
|
|
|
552
583
|
return this.nodes.reduce((names, n) => addNames(names, n.names), {});
|
|
553
584
|
}
|
|
554
585
|
};
|
|
586
|
+
__name(ParentNode, "ParentNode");
|
|
555
587
|
var BlockNode = class extends ParentNode {
|
|
556
588
|
render(opts) {
|
|
557
589
|
return "{" + opts._n + super.render(opts) + "}" + opts._n;
|
|
558
590
|
}
|
|
559
591
|
};
|
|
592
|
+
__name(BlockNode, "BlockNode");
|
|
560
593
|
var Root = class extends ParentNode {
|
|
561
594
|
};
|
|
595
|
+
__name(Root, "Root");
|
|
562
596
|
var Else = class extends BlockNode {
|
|
563
597
|
};
|
|
598
|
+
__name(Else, "Else");
|
|
564
599
|
Else.kind = "else";
|
|
565
600
|
var If = class extends BlockNode {
|
|
566
601
|
constructor(condition, nodes) {
|
|
@@ -610,9 +645,11 @@ var require_codegen = __commonJS({
|
|
|
610
645
|
return names;
|
|
611
646
|
}
|
|
612
647
|
};
|
|
648
|
+
__name(If, "If");
|
|
613
649
|
If.kind = "if";
|
|
614
650
|
var For = class extends BlockNode {
|
|
615
651
|
};
|
|
652
|
+
__name(For, "For");
|
|
616
653
|
For.kind = "for";
|
|
617
654
|
var ForLoop = class extends For {
|
|
618
655
|
constructor(iteration) {
|
|
@@ -632,6 +669,7 @@ var require_codegen = __commonJS({
|
|
|
632
669
|
return addNames(super.names, this.iteration.names);
|
|
633
670
|
}
|
|
634
671
|
};
|
|
672
|
+
__name(ForLoop, "ForLoop");
|
|
635
673
|
var ForRange = class extends For {
|
|
636
674
|
constructor(varKind, name, from, to) {
|
|
637
675
|
super();
|
|
@@ -650,6 +688,7 @@ var require_codegen = __commonJS({
|
|
|
650
688
|
return addExprNames(names, this.to);
|
|
651
689
|
}
|
|
652
690
|
};
|
|
691
|
+
__name(ForRange, "ForRange");
|
|
653
692
|
var ForIter = class extends For {
|
|
654
693
|
constructor(loop, varKind, name, iterable) {
|
|
655
694
|
super();
|
|
@@ -671,6 +710,7 @@ var require_codegen = __commonJS({
|
|
|
671
710
|
return addNames(super.names, this.iterable.names);
|
|
672
711
|
}
|
|
673
712
|
};
|
|
713
|
+
__name(ForIter, "ForIter");
|
|
674
714
|
var Func = class extends BlockNode {
|
|
675
715
|
constructor(name, args, async) {
|
|
676
716
|
super();
|
|
@@ -683,12 +723,14 @@ var require_codegen = __commonJS({
|
|
|
683
723
|
return `${_async}function ${this.name}(${this.args})` + super.render(opts);
|
|
684
724
|
}
|
|
685
725
|
};
|
|
726
|
+
__name(Func, "Func");
|
|
686
727
|
Func.kind = "func";
|
|
687
728
|
var Return = class extends ParentNode {
|
|
688
729
|
render(opts) {
|
|
689
730
|
return "return " + super.render(opts);
|
|
690
731
|
}
|
|
691
732
|
};
|
|
733
|
+
__name(Return, "Return");
|
|
692
734
|
Return.kind = "return";
|
|
693
735
|
var Try = class extends BlockNode {
|
|
694
736
|
render(opts) {
|
|
@@ -722,6 +764,7 @@ var require_codegen = __commonJS({
|
|
|
722
764
|
return names;
|
|
723
765
|
}
|
|
724
766
|
};
|
|
767
|
+
__name(Try, "Try");
|
|
725
768
|
var Catch = class extends BlockNode {
|
|
726
769
|
constructor(error) {
|
|
727
770
|
super();
|
|
@@ -731,12 +774,14 @@ var require_codegen = __commonJS({
|
|
|
731
774
|
return `catch(${this.error})` + super.render(opts);
|
|
732
775
|
}
|
|
733
776
|
};
|
|
777
|
+
__name(Catch, "Catch");
|
|
734
778
|
Catch.kind = "catch";
|
|
735
779
|
var Finally = class extends BlockNode {
|
|
736
780
|
render(opts) {
|
|
737
781
|
return "finally" + super.render(opts);
|
|
738
782
|
}
|
|
739
783
|
};
|
|
784
|
+
__name(Finally, "Finally");
|
|
740
785
|
Finally.kind = "finally";
|
|
741
786
|
var CodeGen = class {
|
|
742
787
|
constructor(extScope, opts = {}) {
|
|
@@ -1002,15 +1047,18 @@ var require_codegen = __commonJS({
|
|
|
1002
1047
|
ns[ns.length - 1] = node;
|
|
1003
1048
|
}
|
|
1004
1049
|
};
|
|
1050
|
+
__name(CodeGen, "CodeGen");
|
|
1005
1051
|
exports.CodeGen = CodeGen;
|
|
1006
1052
|
function addNames(names, from) {
|
|
1007
1053
|
for (const n in from)
|
|
1008
1054
|
names[n] = (names[n] || 0) + (from[n] || 0);
|
|
1009
1055
|
return names;
|
|
1010
1056
|
}
|
|
1057
|
+
__name(addNames, "addNames");
|
|
1011
1058
|
function addExprNames(names, from) {
|
|
1012
1059
|
return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
|
|
1013
1060
|
}
|
|
1061
|
+
__name(addExprNames, "addExprNames");
|
|
1014
1062
|
function optimizeExpr(expr, names, constants) {
|
|
1015
1063
|
if (expr instanceof code_1.Name)
|
|
1016
1064
|
return replaceName(expr);
|
|
@@ -1032,34 +1080,43 @@ var require_codegen = __commonJS({
|
|
|
1032
1080
|
delete names[n.str];
|
|
1033
1081
|
return c;
|
|
1034
1082
|
}
|
|
1083
|
+
__name(replaceName, "replaceName");
|
|
1035
1084
|
function canOptimize(e) {
|
|
1036
1085
|
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
|
|
1037
1086
|
}
|
|
1087
|
+
__name(canOptimize, "canOptimize");
|
|
1038
1088
|
}
|
|
1089
|
+
__name(optimizeExpr, "optimizeExpr");
|
|
1039
1090
|
function subtractNames(names, from) {
|
|
1040
1091
|
for (const n in from)
|
|
1041
1092
|
names[n] = (names[n] || 0) - (from[n] || 0);
|
|
1042
1093
|
}
|
|
1094
|
+
__name(subtractNames, "subtractNames");
|
|
1043
1095
|
function not(x) {
|
|
1044
1096
|
return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
|
|
1045
1097
|
}
|
|
1098
|
+
__name(not, "not");
|
|
1046
1099
|
exports.not = not;
|
|
1047
1100
|
var andCode = mappend(exports.operators.AND);
|
|
1048
1101
|
function and(...args) {
|
|
1049
1102
|
return args.reduce(andCode);
|
|
1050
1103
|
}
|
|
1104
|
+
__name(and, "and");
|
|
1051
1105
|
exports.and = and;
|
|
1052
1106
|
var orCode = mappend(exports.operators.OR);
|
|
1053
1107
|
function or(...args) {
|
|
1054
1108
|
return args.reduce(orCode);
|
|
1055
1109
|
}
|
|
1110
|
+
__name(or, "or");
|
|
1056
1111
|
exports.or = or;
|
|
1057
1112
|
function mappend(op) {
|
|
1058
1113
|
return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
|
|
1059
1114
|
}
|
|
1115
|
+
__name(mappend, "mappend");
|
|
1060
1116
|
function par(x) {
|
|
1061
1117
|
return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
|
|
1062
1118
|
}
|
|
1119
|
+
__name(par, "par");
|
|
1063
1120
|
}
|
|
1064
1121
|
});
|
|
1065
1122
|
|
|
@@ -1077,6 +1134,7 @@ var require_util = __commonJS({
|
|
|
1077
1134
|
hash[item] = true;
|
|
1078
1135
|
return hash;
|
|
1079
1136
|
}
|
|
1137
|
+
__name(toHash, "toHash");
|
|
1080
1138
|
exports.toHash = toHash;
|
|
1081
1139
|
function alwaysValidSchema(it, schema) {
|
|
1082
1140
|
if (typeof schema == "boolean")
|
|
@@ -1086,6 +1144,7 @@ var require_util = __commonJS({
|
|
|
1086
1144
|
checkUnknownRules(it, schema);
|
|
1087
1145
|
return !schemaHasRules(schema, it.self.RULES.all);
|
|
1088
1146
|
}
|
|
1147
|
+
__name(alwaysValidSchema, "alwaysValidSchema");
|
|
1089
1148
|
exports.alwaysValidSchema = alwaysValidSchema;
|
|
1090
1149
|
function checkUnknownRules(it, schema = it.schema) {
|
|
1091
1150
|
const { opts, self } = it;
|
|
@@ -1099,6 +1158,7 @@ var require_util = __commonJS({
|
|
|
1099
1158
|
checkStrictMode(it, `unknown keyword: "${key}"`);
|
|
1100
1159
|
}
|
|
1101
1160
|
}
|
|
1161
|
+
__name(checkUnknownRules, "checkUnknownRules");
|
|
1102
1162
|
exports.checkUnknownRules = checkUnknownRules;
|
|
1103
1163
|
function schemaHasRules(schema, rules) {
|
|
1104
1164
|
if (typeof schema == "boolean")
|
|
@@ -1108,6 +1168,7 @@ var require_util = __commonJS({
|
|
|
1108
1168
|
return true;
|
|
1109
1169
|
return false;
|
|
1110
1170
|
}
|
|
1171
|
+
__name(schemaHasRules, "schemaHasRules");
|
|
1111
1172
|
exports.schemaHasRules = schemaHasRules;
|
|
1112
1173
|
function schemaHasRulesButRef(schema, RULES) {
|
|
1113
1174
|
if (typeof schema == "boolean")
|
|
@@ -1117,6 +1178,7 @@ var require_util = __commonJS({
|
|
|
1117
1178
|
return true;
|
|
1118
1179
|
return false;
|
|
1119
1180
|
}
|
|
1181
|
+
__name(schemaHasRulesButRef, "schemaHasRulesButRef");
|
|
1120
1182
|
exports.schemaHasRulesButRef = schemaHasRulesButRef;
|
|
1121
1183
|
function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
|
|
1122
1184
|
if (!$data) {
|
|
@@ -1127,24 +1189,29 @@ var require_util = __commonJS({
|
|
|
1127
1189
|
}
|
|
1128
1190
|
return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
|
|
1129
1191
|
}
|
|
1192
|
+
__name(schemaRefOrVal, "schemaRefOrVal");
|
|
1130
1193
|
exports.schemaRefOrVal = schemaRefOrVal;
|
|
1131
1194
|
function unescapeFragment(str) {
|
|
1132
1195
|
return unescapeJsonPointer(decodeURIComponent(str));
|
|
1133
1196
|
}
|
|
1197
|
+
__name(unescapeFragment, "unescapeFragment");
|
|
1134
1198
|
exports.unescapeFragment = unescapeFragment;
|
|
1135
1199
|
function escapeFragment(str) {
|
|
1136
1200
|
return encodeURIComponent(escapeJsonPointer(str));
|
|
1137
1201
|
}
|
|
1202
|
+
__name(escapeFragment, "escapeFragment");
|
|
1138
1203
|
exports.escapeFragment = escapeFragment;
|
|
1139
1204
|
function escapeJsonPointer(str) {
|
|
1140
1205
|
if (typeof str == "number")
|
|
1141
1206
|
return `${str}`;
|
|
1142
1207
|
return str.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1143
1208
|
}
|
|
1209
|
+
__name(escapeJsonPointer, "escapeJsonPointer");
|
|
1144
1210
|
exports.escapeJsonPointer = escapeJsonPointer;
|
|
1145
1211
|
function unescapeJsonPointer(str) {
|
|
1146
1212
|
return str.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1147
1213
|
}
|
|
1214
|
+
__name(unescapeJsonPointer, "unescapeJsonPointer");
|
|
1148
1215
|
exports.unescapeJsonPointer = unescapeJsonPointer;
|
|
1149
1216
|
function eachItem(xs, f) {
|
|
1150
1217
|
if (Array.isArray(xs)) {
|
|
@@ -1154,6 +1221,7 @@ var require_util = __commonJS({
|
|
|
1154
1221
|
f(xs);
|
|
1155
1222
|
}
|
|
1156
1223
|
}
|
|
1224
|
+
__name(eachItem, "eachItem");
|
|
1157
1225
|
exports.eachItem = eachItem;
|
|
1158
1226
|
function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) {
|
|
1159
1227
|
return (gen, from, to, toName) => {
|
|
@@ -1161,6 +1229,7 @@ var require_util = __commonJS({
|
|
|
1161
1229
|
return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
|
|
1162
1230
|
};
|
|
1163
1231
|
}
|
|
1232
|
+
__name(makeMergeEvaluated, "makeMergeEvaluated");
|
|
1164
1233
|
exports.mergeEvaluated = {
|
|
1165
1234
|
props: makeMergeEvaluated({
|
|
1166
1235
|
mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
|
|
@@ -1192,10 +1261,12 @@ var require_util = __commonJS({
|
|
|
1192
1261
|
setEvaluated(gen, props, ps);
|
|
1193
1262
|
return props;
|
|
1194
1263
|
}
|
|
1264
|
+
__name(evaluatedPropsToName, "evaluatedPropsToName");
|
|
1195
1265
|
exports.evaluatedPropsToName = evaluatedPropsToName;
|
|
1196
1266
|
function setEvaluated(gen, props, ps) {
|
|
1197
1267
|
Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
|
|
1198
1268
|
}
|
|
1269
|
+
__name(setEvaluated, "setEvaluated");
|
|
1199
1270
|
exports.setEvaluated = setEvaluated;
|
|
1200
1271
|
var snippets = {};
|
|
1201
1272
|
function useFunc(gen, f) {
|
|
@@ -1204,6 +1275,7 @@ var require_util = __commonJS({
|
|
|
1204
1275
|
code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))
|
|
1205
1276
|
});
|
|
1206
1277
|
}
|
|
1278
|
+
__name(useFunc, "useFunc");
|
|
1207
1279
|
exports.useFunc = useFunc;
|
|
1208
1280
|
var Type;
|
|
1209
1281
|
(function(Type2) {
|
|
@@ -1217,6 +1289,7 @@ var require_util = __commonJS({
|
|
|
1217
1289
|
}
|
|
1218
1290
|
return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
|
|
1219
1291
|
}
|
|
1292
|
+
__name(getErrorPath, "getErrorPath");
|
|
1220
1293
|
exports.getErrorPath = getErrorPath;
|
|
1221
1294
|
function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
|
|
1222
1295
|
if (!mode)
|
|
@@ -1226,6 +1299,7 @@ var require_util = __commonJS({
|
|
|
1226
1299
|
throw new Error(msg);
|
|
1227
1300
|
it.self.logger.warn(msg);
|
|
1228
1301
|
}
|
|
1302
|
+
__name(checkStrictMode, "checkStrictMode");
|
|
1229
1303
|
exports.checkStrictMode = checkStrictMode;
|
|
1230
1304
|
}
|
|
1231
1305
|
});
|
|
@@ -1288,6 +1362,7 @@ var require_errors = __commonJS({
|
|
|
1288
1362
|
returnErrors(it, (0, codegen_1._)`[${errObj}]`);
|
|
1289
1363
|
}
|
|
1290
1364
|
}
|
|
1365
|
+
__name(reportError, "reportError");
|
|
1291
1366
|
exports.reportError = reportError;
|
|
1292
1367
|
function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
|
|
1293
1368
|
const { it } = cxt;
|
|
@@ -1298,11 +1373,13 @@ var require_errors = __commonJS({
|
|
|
1298
1373
|
returnErrors(it, names_1.default.vErrors);
|
|
1299
1374
|
}
|
|
1300
1375
|
}
|
|
1376
|
+
__name(reportExtraError, "reportExtraError");
|
|
1301
1377
|
exports.reportExtraError = reportExtraError;
|
|
1302
1378
|
function resetErrorsCount(gen, errsCount) {
|
|
1303
1379
|
gen.assign(names_1.default.errors, errsCount);
|
|
1304
1380
|
gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
|
|
1305
1381
|
}
|
|
1382
|
+
__name(resetErrorsCount, "resetErrorsCount");
|
|
1306
1383
|
exports.resetErrorsCount = resetErrorsCount;
|
|
1307
1384
|
function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {
|
|
1308
1385
|
if (errsCount === void 0)
|
|
@@ -1318,12 +1395,14 @@ var require_errors = __commonJS({
|
|
|
1318
1395
|
}
|
|
1319
1396
|
});
|
|
1320
1397
|
}
|
|
1398
|
+
__name(extendErrors, "extendErrors");
|
|
1321
1399
|
exports.extendErrors = extendErrors;
|
|
1322
1400
|
function addError(gen, errObj) {
|
|
1323
1401
|
const err = gen.const("err", errObj);
|
|
1324
1402
|
gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);
|
|
1325
1403
|
gen.code((0, codegen_1._)`${names_1.default.errors}++`);
|
|
1326
1404
|
}
|
|
1405
|
+
__name(addError, "addError");
|
|
1327
1406
|
function returnErrors(it, errs) {
|
|
1328
1407
|
const { gen, validateName, schemaEnv } = it;
|
|
1329
1408
|
if (schemaEnv.$async) {
|
|
@@ -1333,6 +1412,7 @@ var require_errors = __commonJS({
|
|
|
1333
1412
|
gen.return(false);
|
|
1334
1413
|
}
|
|
1335
1414
|
}
|
|
1415
|
+
__name(returnErrors, "returnErrors");
|
|
1336
1416
|
var E = {
|
|
1337
1417
|
keyword: new codegen_1.Name("keyword"),
|
|
1338
1418
|
schemaPath: new codegen_1.Name("schemaPath"),
|
|
@@ -1348,6 +1428,7 @@ var require_errors = __commonJS({
|
|
|
1348
1428
|
return (0, codegen_1._)`{}`;
|
|
1349
1429
|
return errorObject(cxt, error, errorPaths);
|
|
1350
1430
|
}
|
|
1431
|
+
__name(errorObjectCode, "errorObjectCode");
|
|
1351
1432
|
function errorObject(cxt, error, errorPaths = {}) {
|
|
1352
1433
|
const { gen, it } = cxt;
|
|
1353
1434
|
const keyValues = [
|
|
@@ -1357,10 +1438,12 @@ var require_errors = __commonJS({
|
|
|
1357
1438
|
extraErrorProps(cxt, error, keyValues);
|
|
1358
1439
|
return gen.object(...keyValues);
|
|
1359
1440
|
}
|
|
1441
|
+
__name(errorObject, "errorObject");
|
|
1360
1442
|
function errorInstancePath({ errorPath }, { instancePath }) {
|
|
1361
1443
|
const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;
|
|
1362
1444
|
return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
|
|
1363
1445
|
}
|
|
1446
|
+
__name(errorInstancePath, "errorInstancePath");
|
|
1364
1447
|
function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
|
|
1365
1448
|
let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;
|
|
1366
1449
|
if (schemaPath) {
|
|
@@ -1368,6 +1451,7 @@ var require_errors = __commonJS({
|
|
|
1368
1451
|
}
|
|
1369
1452
|
return [E.schemaPath, schPath];
|
|
1370
1453
|
}
|
|
1454
|
+
__name(errorSchemaPath, "errorSchemaPath");
|
|
1371
1455
|
function extraErrorProps(cxt, { params, message }, keyValues) {
|
|
1372
1456
|
const { keyword, data, schemaValue, it } = cxt;
|
|
1373
1457
|
const { opts, propertyName, topSchemaRef, schemaPath } = it;
|
|
@@ -1381,6 +1465,7 @@ var require_errors = __commonJS({
|
|
|
1381
1465
|
if (propertyName)
|
|
1382
1466
|
keyValues.push([E.propertyName, propertyName]);
|
|
1383
1467
|
}
|
|
1468
|
+
__name(extraErrorProps, "extraErrorProps");
|
|
1384
1469
|
}
|
|
1385
1470
|
});
|
|
1386
1471
|
|
|
@@ -1407,6 +1492,7 @@ var require_boolSchema = __commonJS({
|
|
|
1407
1492
|
gen.return(true);
|
|
1408
1493
|
}
|
|
1409
1494
|
}
|
|
1495
|
+
__name(topBoolOrEmptySchema, "topBoolOrEmptySchema");
|
|
1410
1496
|
exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
|
|
1411
1497
|
function boolOrEmptySchema(it, valid) {
|
|
1412
1498
|
const { gen, schema } = it;
|
|
@@ -1417,6 +1503,7 @@ var require_boolSchema = __commonJS({
|
|
|
1417
1503
|
gen.var(valid, true);
|
|
1418
1504
|
}
|
|
1419
1505
|
}
|
|
1506
|
+
__name(boolOrEmptySchema, "boolOrEmptySchema");
|
|
1420
1507
|
exports.boolOrEmptySchema = boolOrEmptySchema;
|
|
1421
1508
|
function falseSchemaError(it, overrideAllErrors) {
|
|
1422
1509
|
const { gen, data } = it;
|
|
@@ -1432,6 +1519,7 @@ var require_boolSchema = __commonJS({
|
|
|
1432
1519
|
};
|
|
1433
1520
|
(0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
|
|
1434
1521
|
}
|
|
1522
|
+
__name(falseSchemaError, "falseSchemaError");
|
|
1435
1523
|
}
|
|
1436
1524
|
});
|
|
1437
1525
|
|
|
@@ -1446,6 +1534,7 @@ var require_rules = __commonJS({
|
|
|
1446
1534
|
function isJSONType(x) {
|
|
1447
1535
|
return typeof x == "string" && jsonTypes.has(x);
|
|
1448
1536
|
}
|
|
1537
|
+
__name(isJSONType, "isJSONType");
|
|
1449
1538
|
exports.isJSONType = isJSONType;
|
|
1450
1539
|
function getRules() {
|
|
1451
1540
|
const groups = {
|
|
@@ -1462,6 +1551,7 @@ var require_rules = __commonJS({
|
|
|
1462
1551
|
keywords: {}
|
|
1463
1552
|
};
|
|
1464
1553
|
}
|
|
1554
|
+
__name(getRules, "getRules");
|
|
1465
1555
|
exports.getRules = getRules;
|
|
1466
1556
|
}
|
|
1467
1557
|
});
|
|
@@ -1476,15 +1566,18 @@ var require_applicability = __commonJS({
|
|
|
1476
1566
|
const group = self.RULES.types[type];
|
|
1477
1567
|
return group && group !== true && shouldUseGroup(schema, group);
|
|
1478
1568
|
}
|
|
1569
|
+
__name(schemaHasRulesForType, "schemaHasRulesForType");
|
|
1479
1570
|
exports.schemaHasRulesForType = schemaHasRulesForType;
|
|
1480
1571
|
function shouldUseGroup(schema, group) {
|
|
1481
1572
|
return group.rules.some((rule) => shouldUseRule(schema, rule));
|
|
1482
1573
|
}
|
|
1574
|
+
__name(shouldUseGroup, "shouldUseGroup");
|
|
1483
1575
|
exports.shouldUseGroup = shouldUseGroup;
|
|
1484
1576
|
function shouldUseRule(schema, rule) {
|
|
1485
1577
|
var _a;
|
|
1486
1578
|
return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));
|
|
1487
1579
|
}
|
|
1580
|
+
__name(shouldUseRule, "shouldUseRule");
|
|
1488
1581
|
exports.shouldUseRule = shouldUseRule;
|
|
1489
1582
|
}
|
|
1490
1583
|
});
|
|
@@ -1520,6 +1613,7 @@ var require_dataType = __commonJS({
|
|
|
1520
1613
|
}
|
|
1521
1614
|
return types;
|
|
1522
1615
|
}
|
|
1616
|
+
__name(getSchemaTypes, "getSchemaTypes");
|
|
1523
1617
|
exports.getSchemaTypes = getSchemaTypes;
|
|
1524
1618
|
function getJSONTypes(ts) {
|
|
1525
1619
|
const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
|
|
@@ -1527,6 +1621,7 @@ var require_dataType = __commonJS({
|
|
|
1527
1621
|
return types;
|
|
1528
1622
|
throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
|
|
1529
1623
|
}
|
|
1624
|
+
__name(getJSONTypes, "getJSONTypes");
|
|
1530
1625
|
exports.getJSONTypes = getJSONTypes;
|
|
1531
1626
|
function coerceAndCheckDataType(it, types) {
|
|
1532
1627
|
const { gen, data, opts } = it;
|
|
@@ -1543,11 +1638,13 @@ var require_dataType = __commonJS({
|
|
|
1543
1638
|
}
|
|
1544
1639
|
return checkTypes;
|
|
1545
1640
|
}
|
|
1641
|
+
__name(coerceAndCheckDataType, "coerceAndCheckDataType");
|
|
1546
1642
|
exports.coerceAndCheckDataType = coerceAndCheckDataType;
|
|
1547
1643
|
var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
1548
1644
|
function coerceToTypes(types, coerceTypes) {
|
|
1549
1645
|
return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
|
|
1550
1646
|
}
|
|
1647
|
+
__name(coerceToTypes, "coerceToTypes");
|
|
1551
1648
|
function coerceData(it, types, coerceTo) {
|
|
1552
1649
|
const { gen, data, opts } = it;
|
|
1553
1650
|
const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`);
|
|
@@ -1593,10 +1690,13 @@ var require_dataType = __commonJS({
|
|
|
1593
1690
|
|| ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);
|
|
1594
1691
|
}
|
|
1595
1692
|
}
|
|
1693
|
+
__name(coerceSpecificType, "coerceSpecificType");
|
|
1596
1694
|
}
|
|
1695
|
+
__name(coerceData, "coerceData");
|
|
1597
1696
|
function assignParentData({ gen, parentData, parentDataProperty }, expr) {
|
|
1598
1697
|
gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
|
|
1599
1698
|
}
|
|
1699
|
+
__name(assignParentData, "assignParentData");
|
|
1600
1700
|
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
|
|
1601
1701
|
const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
|
|
1602
1702
|
let cond;
|
|
@@ -1622,7 +1722,9 @@ var require_dataType = __commonJS({
|
|
|
1622
1722
|
function numCond(_cond = codegen_1.nil) {
|
|
1623
1723
|
return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);
|
|
1624
1724
|
}
|
|
1725
|
+
__name(numCond, "numCond");
|
|
1625
1726
|
}
|
|
1727
|
+
__name(checkDataType, "checkDataType");
|
|
1626
1728
|
exports.checkDataType = checkDataType;
|
|
1627
1729
|
function checkDataTypes(dataTypes, data, strictNums, correct) {
|
|
1628
1730
|
if (dataTypes.length === 1) {
|
|
@@ -1645,6 +1747,7 @@ var require_dataType = __commonJS({
|
|
|
1645
1747
|
cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
|
|
1646
1748
|
return cond;
|
|
1647
1749
|
}
|
|
1750
|
+
__name(checkDataTypes, "checkDataTypes");
|
|
1648
1751
|
exports.checkDataTypes = checkDataTypes;
|
|
1649
1752
|
var typeError = {
|
|
1650
1753
|
message: ({ schema }) => `must be ${schema}`,
|
|
@@ -1654,6 +1757,7 @@ var require_dataType = __commonJS({
|
|
|
1654
1757
|
const cxt = getTypeErrorContext(it);
|
|
1655
1758
|
(0, errors_1.reportError)(cxt, typeError);
|
|
1656
1759
|
}
|
|
1760
|
+
__name(reportTypeError, "reportTypeError");
|
|
1657
1761
|
exports.reportTypeError = reportTypeError;
|
|
1658
1762
|
function getTypeErrorContext(it) {
|
|
1659
1763
|
const { gen, data, schema } = it;
|
|
@@ -1670,6 +1774,7 @@ var require_dataType = __commonJS({
|
|
|
1670
1774
|
it
|
|
1671
1775
|
};
|
|
1672
1776
|
}
|
|
1777
|
+
__name(getTypeErrorContext, "getTypeErrorContext");
|
|
1673
1778
|
}
|
|
1674
1779
|
});
|
|
1675
1780
|
|
|
@@ -1691,6 +1796,7 @@ var require_defaults = __commonJS({
|
|
|
1691
1796
|
items.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
1692
1797
|
}
|
|
1693
1798
|
}
|
|
1799
|
+
__name(assignDefaults, "assignDefaults");
|
|
1694
1800
|
exports.assignDefaults = assignDefaults;
|
|
1695
1801
|
function assignDefault(it, prop, defaultValue) {
|
|
1696
1802
|
const { gen, compositeRule, data, opts } = it;
|
|
@@ -1707,6 +1813,7 @@ var require_defaults = __commonJS({
|
|
|
1707
1813
|
}
|
|
1708
1814
|
gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
|
|
1709
1815
|
}
|
|
1816
|
+
__name(assignDefault, "assignDefault");
|
|
1710
1817
|
}
|
|
1711
1818
|
});
|
|
1712
1819
|
|
|
@@ -1727,15 +1834,18 @@ var require_code2 = __commonJS({
|
|
|
1727
1834
|
cxt.error();
|
|
1728
1835
|
});
|
|
1729
1836
|
}
|
|
1837
|
+
__name(checkReportMissingProp, "checkReportMissingProp");
|
|
1730
1838
|
exports.checkReportMissingProp = checkReportMissingProp;
|
|
1731
1839
|
function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
|
|
1732
1840
|
return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
|
|
1733
1841
|
}
|
|
1842
|
+
__name(checkMissingProp, "checkMissingProp");
|
|
1734
1843
|
exports.checkMissingProp = checkMissingProp;
|
|
1735
1844
|
function reportMissingProp(cxt, missing) {
|
|
1736
1845
|
cxt.setParams({ missingProperty: missing }, true);
|
|
1737
1846
|
cxt.error();
|
|
1738
1847
|
}
|
|
1848
|
+
__name(reportMissingProp, "reportMissingProp");
|
|
1739
1849
|
exports.reportMissingProp = reportMissingProp;
|
|
1740
1850
|
function hasPropFunc(gen) {
|
|
1741
1851
|
return gen.scopeValue("func", {
|
|
@@ -1744,28 +1854,34 @@ var require_code2 = __commonJS({
|
|
|
1744
1854
|
code: (0, codegen_1._)`Object.prototype.hasOwnProperty`
|
|
1745
1855
|
});
|
|
1746
1856
|
}
|
|
1857
|
+
__name(hasPropFunc, "hasPropFunc");
|
|
1747
1858
|
exports.hasPropFunc = hasPropFunc;
|
|
1748
1859
|
function isOwnProperty(gen, data, property) {
|
|
1749
1860
|
return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
|
|
1750
1861
|
}
|
|
1862
|
+
__name(isOwnProperty, "isOwnProperty");
|
|
1751
1863
|
exports.isOwnProperty = isOwnProperty;
|
|
1752
1864
|
function propertyInData(gen, data, property, ownProperties) {
|
|
1753
1865
|
const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
|
|
1754
1866
|
return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
|
|
1755
1867
|
}
|
|
1868
|
+
__name(propertyInData, "propertyInData");
|
|
1756
1869
|
exports.propertyInData = propertyInData;
|
|
1757
1870
|
function noPropertyInData(gen, data, property, ownProperties) {
|
|
1758
1871
|
const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;
|
|
1759
1872
|
return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
|
|
1760
1873
|
}
|
|
1874
|
+
__name(noPropertyInData, "noPropertyInData");
|
|
1761
1875
|
exports.noPropertyInData = noPropertyInData;
|
|
1762
1876
|
function allSchemaProperties(schemaMap) {
|
|
1763
1877
|
return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
|
|
1764
1878
|
}
|
|
1879
|
+
__name(allSchemaProperties, "allSchemaProperties");
|
|
1765
1880
|
exports.allSchemaProperties = allSchemaProperties;
|
|
1766
1881
|
function schemaProperties(it, schemaMap) {
|
|
1767
1882
|
return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
|
|
1768
1883
|
}
|
|
1884
|
+
__name(schemaProperties, "schemaProperties");
|
|
1769
1885
|
exports.schemaProperties = schemaProperties;
|
|
1770
1886
|
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
|
|
1771
1887
|
const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
|
|
@@ -1780,6 +1896,7 @@ var require_code2 = __commonJS({
|
|
|
1780
1896
|
const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
|
|
1781
1897
|
return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
|
|
1782
1898
|
}
|
|
1899
|
+
__name(callValidateCode, "callValidateCode");
|
|
1783
1900
|
exports.callValidateCode = callValidateCode;
|
|
1784
1901
|
var newRegExp = (0, codegen_1._)`new RegExp`;
|
|
1785
1902
|
function usePattern({ gen, it: { opts } }, pattern) {
|
|
@@ -1792,6 +1909,7 @@ var require_code2 = __commonJS({
|
|
|
1792
1909
|
code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
|
|
1793
1910
|
});
|
|
1794
1911
|
}
|
|
1912
|
+
__name(usePattern, "usePattern");
|
|
1795
1913
|
exports.usePattern = usePattern;
|
|
1796
1914
|
function validateArray(cxt) {
|
|
1797
1915
|
const { gen, data, keyword, it } = cxt;
|
|
@@ -1815,7 +1933,9 @@ var require_code2 = __commonJS({
|
|
|
1815
1933
|
gen.if((0, codegen_1.not)(valid), notValid);
|
|
1816
1934
|
});
|
|
1817
1935
|
}
|
|
1936
|
+
__name(validateItems, "validateItems");
|
|
1818
1937
|
}
|
|
1938
|
+
__name(validateArray, "validateArray");
|
|
1819
1939
|
exports.validateArray = validateArray;
|
|
1820
1940
|
function validateUnion(cxt) {
|
|
1821
1941
|
const { gen, schema, keyword, it } = cxt;
|
|
@@ -1839,6 +1959,7 @@ var require_code2 = __commonJS({
|
|
|
1839
1959
|
}));
|
|
1840
1960
|
cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
|
|
1841
1961
|
}
|
|
1962
|
+
__name(validateUnion, "validateUnion");
|
|
1842
1963
|
exports.validateUnion = validateUnion;
|
|
1843
1964
|
}
|
|
1844
1965
|
});
|
|
@@ -1869,6 +1990,7 @@ var require_keyword = __commonJS({
|
|
|
1869
1990
|
}, valid);
|
|
1870
1991
|
cxt.pass(valid, () => cxt.error(true));
|
|
1871
1992
|
}
|
|
1993
|
+
__name(macroKeywordCode, "macroKeywordCode");
|
|
1872
1994
|
exports.macroKeywordCode = macroKeywordCode;
|
|
1873
1995
|
function funcKeywordCode(cxt, def) {
|
|
1874
1996
|
var _a;
|
|
@@ -1892,32 +2014,39 @@ var require_keyword = __commonJS({
|
|
|
1892
2014
|
reportErrs(() => addErrs(cxt, ruleErrs));
|
|
1893
2015
|
}
|
|
1894
2016
|
}
|
|
2017
|
+
__name(validateKeyword, "validateKeyword");
|
|
1895
2018
|
function validateAsync() {
|
|
1896
2019
|
const ruleErrs = gen.let("ruleErrs", null);
|
|
1897
2020
|
gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
|
|
1898
2021
|
return ruleErrs;
|
|
1899
2022
|
}
|
|
2023
|
+
__name(validateAsync, "validateAsync");
|
|
1900
2024
|
function validateSync() {
|
|
1901
2025
|
const validateErrs = (0, codegen_1._)`${validateRef}.errors`;
|
|
1902
2026
|
gen.assign(validateErrs, null);
|
|
1903
2027
|
assignValid(codegen_1.nil);
|
|
1904
2028
|
return validateErrs;
|
|
1905
2029
|
}
|
|
2030
|
+
__name(validateSync, "validateSync");
|
|
1906
2031
|
function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {
|
|
1907
2032
|
const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
|
|
1908
2033
|
const passSchema = !("compile" in def && !$data || def.schema === false);
|
|
1909
2034
|
gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
|
|
1910
2035
|
}
|
|
2036
|
+
__name(assignValid, "assignValid");
|
|
1911
2037
|
function reportErrs(errors) {
|
|
1912
2038
|
var _a2;
|
|
1913
2039
|
gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors);
|
|
1914
2040
|
}
|
|
2041
|
+
__name(reportErrs, "reportErrs");
|
|
1915
2042
|
}
|
|
2043
|
+
__name(funcKeywordCode, "funcKeywordCode");
|
|
1916
2044
|
exports.funcKeywordCode = funcKeywordCode;
|
|
1917
2045
|
function modifyData(cxt) {
|
|
1918
2046
|
const { gen, data, it } = cxt;
|
|
1919
2047
|
gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));
|
|
1920
2048
|
}
|
|
2049
|
+
__name(modifyData, "modifyData");
|
|
1921
2050
|
function addErrs(cxt, errs) {
|
|
1922
2051
|
const { gen } = cxt;
|
|
1923
2052
|
gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {
|
|
@@ -1925,18 +2054,22 @@ var require_keyword = __commonJS({
|
|
|
1925
2054
|
(0, errors_1.extendErrors)(cxt);
|
|
1926
2055
|
}, () => cxt.error());
|
|
1927
2056
|
}
|
|
2057
|
+
__name(addErrs, "addErrs");
|
|
1928
2058
|
function checkAsyncKeyword({ schemaEnv }, def) {
|
|
1929
2059
|
if (def.async && !schemaEnv.$async)
|
|
1930
2060
|
throw new Error("async keyword in sync schema");
|
|
1931
2061
|
}
|
|
2062
|
+
__name(checkAsyncKeyword, "checkAsyncKeyword");
|
|
1932
2063
|
function useKeyword(gen, keyword, result) {
|
|
1933
2064
|
if (result === void 0)
|
|
1934
2065
|
throw new Error(`keyword "${keyword}" failed to compile`);
|
|
1935
2066
|
return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
|
|
1936
2067
|
}
|
|
2068
|
+
__name(useKeyword, "useKeyword");
|
|
1937
2069
|
function validSchemaType(schema, schemaType, allowUndefined = false) {
|
|
1938
2070
|
return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined");
|
|
1939
2071
|
}
|
|
2072
|
+
__name(validSchemaType, "validSchemaType");
|
|
1940
2073
|
exports.validSchemaType = validSchemaType;
|
|
1941
2074
|
function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
|
|
1942
2075
|
if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
|
|
@@ -1957,6 +2090,7 @@ var require_keyword = __commonJS({
|
|
|
1957
2090
|
}
|
|
1958
2091
|
}
|
|
1959
2092
|
}
|
|
2093
|
+
__name(validateKeywordUsage, "validateKeywordUsage");
|
|
1960
2094
|
exports.validateKeywordUsage = validateKeywordUsage;
|
|
1961
2095
|
}
|
|
1962
2096
|
});
|
|
@@ -1998,6 +2132,7 @@ var require_subschema = __commonJS({
|
|
|
1998
2132
|
}
|
|
1999
2133
|
throw new Error('either "keyword" or "schema" must be passed');
|
|
2000
2134
|
}
|
|
2135
|
+
__name(getSubschema, "getSubschema");
|
|
2001
2136
|
exports.getSubschema = getSubschema;
|
|
2002
2137
|
function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
|
|
2003
2138
|
if (data !== void 0 && dataProp !== void 0) {
|
|
@@ -2028,7 +2163,9 @@ var require_subschema = __commonJS({
|
|
|
2028
2163
|
subschema.parentData = it.data;
|
|
2029
2164
|
subschema.dataNames = [...it.dataNames, _nextData];
|
|
2030
2165
|
}
|
|
2166
|
+
__name(dataContextProps, "dataContextProps");
|
|
2031
2167
|
}
|
|
2168
|
+
__name(extendSubschemaData, "extendSubschemaData");
|
|
2032
2169
|
exports.extendSubschemaData = extendSubschemaData;
|
|
2033
2170
|
function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
|
|
2034
2171
|
if (compositeRule !== void 0)
|
|
@@ -2040,6 +2177,7 @@ var require_subschema = __commonJS({
|
|
|
2040
2177
|
subschema.jtdDiscriminator = jtdDiscriminator;
|
|
2041
2178
|
subschema.jtdMetadata = jtdMetadata;
|
|
2042
2179
|
}
|
|
2180
|
+
__name(extendSubschemaMode, "extendSubschemaMode");
|
|
2043
2181
|
exports.extendSubschemaMode = extendSubschemaMode;
|
|
2044
2182
|
}
|
|
2045
2183
|
});
|
|
@@ -2048,7 +2186,7 @@ var require_subschema = __commonJS({
|
|
|
2048
2186
|
var require_fast_deep_equal = __commonJS({
|
|
2049
2187
|
"node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
2050
2188
|
"use strict";
|
|
2051
|
-
module.exports = function equal(a, b) {
|
|
2189
|
+
module.exports = /* @__PURE__ */ __name(function equal(a, b) {
|
|
2052
2190
|
if (a === b)
|
|
2053
2191
|
return true;
|
|
2054
2192
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
@@ -2085,7 +2223,7 @@ var require_fast_deep_equal = __commonJS({
|
|
|
2085
2223
|
return true;
|
|
2086
2224
|
}
|
|
2087
2225
|
return a !== a && b !== b;
|
|
2088
|
-
};
|
|
2226
|
+
}, "equal");
|
|
2089
2227
|
}
|
|
2090
2228
|
});
|
|
2091
2229
|
|
|
@@ -2171,9 +2309,11 @@ var require_json_schema_traverse = __commonJS({
|
|
|
2171
2309
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
2172
2310
|
}
|
|
2173
2311
|
}
|
|
2312
|
+
__name(_traverse, "_traverse");
|
|
2174
2313
|
function escapeJsonPtr(str) {
|
|
2175
2314
|
return str.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2176
2315
|
}
|
|
2316
|
+
__name(escapeJsonPtr, "escapeJsonPtr");
|
|
2177
2317
|
}
|
|
2178
2318
|
});
|
|
2179
2319
|
|
|
@@ -2213,6 +2353,7 @@ var require_resolve = __commonJS({
|
|
|
2213
2353
|
return false;
|
|
2214
2354
|
return countKeys(schema) <= limit;
|
|
2215
2355
|
}
|
|
2356
|
+
__name(inlineRef, "inlineRef");
|
|
2216
2357
|
exports.inlineRef = inlineRef;
|
|
2217
2358
|
var REF_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2218
2359
|
"$ref",
|
|
@@ -2233,6 +2374,7 @@ var require_resolve = __commonJS({
|
|
|
2233
2374
|
}
|
|
2234
2375
|
return false;
|
|
2235
2376
|
}
|
|
2377
|
+
__name(hasRef, "hasRef");
|
|
2236
2378
|
function countKeys(schema) {
|
|
2237
2379
|
let count = 0;
|
|
2238
2380
|
for (const key in schema) {
|
|
@@ -2249,27 +2391,32 @@ var require_resolve = __commonJS({
|
|
|
2249
2391
|
}
|
|
2250
2392
|
return count;
|
|
2251
2393
|
}
|
|
2394
|
+
__name(countKeys, "countKeys");
|
|
2252
2395
|
function getFullPath(resolver, id = "", normalize) {
|
|
2253
2396
|
if (normalize !== false)
|
|
2254
2397
|
id = normalizeId(id);
|
|
2255
2398
|
const p = resolver.parse(id);
|
|
2256
2399
|
return _getFullPath(resolver, p);
|
|
2257
2400
|
}
|
|
2401
|
+
__name(getFullPath, "getFullPath");
|
|
2258
2402
|
exports.getFullPath = getFullPath;
|
|
2259
2403
|
function _getFullPath(resolver, p) {
|
|
2260
2404
|
const serialized = resolver.serialize(p);
|
|
2261
2405
|
return serialized.split("#")[0] + "#";
|
|
2262
2406
|
}
|
|
2407
|
+
__name(_getFullPath, "_getFullPath");
|
|
2263
2408
|
exports._getFullPath = _getFullPath;
|
|
2264
2409
|
var TRAILING_SLASH_HASH = /#\/?$/;
|
|
2265
2410
|
function normalizeId(id) {
|
|
2266
2411
|
return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
|
|
2267
2412
|
}
|
|
2413
|
+
__name(normalizeId, "normalizeId");
|
|
2268
2414
|
exports.normalizeId = normalizeId;
|
|
2269
2415
|
function resolveUrl(resolver, baseId, id) {
|
|
2270
2416
|
id = normalizeId(id);
|
|
2271
2417
|
return resolver.resolve(baseId, id);
|
|
2272
2418
|
}
|
|
2419
|
+
__name(resolveUrl, "resolveUrl");
|
|
2273
2420
|
exports.resolveUrl = resolveUrl;
|
|
2274
2421
|
var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
2275
2422
|
function getSchemaRefs(schema, baseId) {
|
|
@@ -2312,6 +2459,7 @@ var require_resolve = __commonJS({
|
|
|
2312
2459
|
}
|
|
2313
2460
|
return ref;
|
|
2314
2461
|
}
|
|
2462
|
+
__name(addRef, "addRef");
|
|
2315
2463
|
function addAnchor(anchor) {
|
|
2316
2464
|
if (typeof anchor == "string") {
|
|
2317
2465
|
if (!ANCHOR.test(anchor))
|
|
@@ -2319,16 +2467,20 @@ var require_resolve = __commonJS({
|
|
|
2319
2467
|
addRef.call(this, `#${anchor}`);
|
|
2320
2468
|
}
|
|
2321
2469
|
}
|
|
2470
|
+
__name(addAnchor, "addAnchor");
|
|
2322
2471
|
});
|
|
2323
2472
|
return localRefs;
|
|
2324
2473
|
function checkAmbiguosRef(sch1, sch2, ref) {
|
|
2325
2474
|
if (sch2 !== void 0 && !equal(sch1, sch2))
|
|
2326
2475
|
throw ambiguos(ref);
|
|
2327
2476
|
}
|
|
2477
|
+
__name(checkAmbiguosRef, "checkAmbiguosRef");
|
|
2328
2478
|
function ambiguos(ref) {
|
|
2329
2479
|
return new Error(`reference "${ref}" resolves to more than one schema`);
|
|
2330
2480
|
}
|
|
2481
|
+
__name(ambiguos, "ambiguos");
|
|
2331
2482
|
}
|
|
2483
|
+
__name(getSchemaRefs, "getSchemaRefs");
|
|
2332
2484
|
exports.getSchemaRefs = getSchemaRefs;
|
|
2333
2485
|
}
|
|
2334
2486
|
});
|
|
@@ -2361,6 +2513,7 @@ var require_validate = __commonJS({
|
|
|
2361
2513
|
}
|
|
2362
2514
|
validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
|
|
2363
2515
|
}
|
|
2516
|
+
__name(validateFunctionCode, "validateFunctionCode");
|
|
2364
2517
|
exports.validateFunctionCode = validateFunctionCode;
|
|
2365
2518
|
function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
|
|
2366
2519
|
if (opts.code.es5) {
|
|
@@ -2373,9 +2526,11 @@ var require_validate = __commonJS({
|
|
|
2373
2526
|
gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
|
|
2374
2527
|
}
|
|
2375
2528
|
}
|
|
2529
|
+
__name(validateFunction, "validateFunction");
|
|
2376
2530
|
function destructureValCxt(opts) {
|
|
2377
2531
|
return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
|
|
2378
2532
|
}
|
|
2533
|
+
__name(destructureValCxt, "destructureValCxt");
|
|
2379
2534
|
function destructureValCxtES5(gen, opts) {
|
|
2380
2535
|
gen.if(names_1.default.valCxt, () => {
|
|
2381
2536
|
gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
|
|
@@ -2393,6 +2548,7 @@ var require_validate = __commonJS({
|
|
|
2393
2548
|
gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
|
|
2394
2549
|
});
|
|
2395
2550
|
}
|
|
2551
|
+
__name(destructureValCxtES5, "destructureValCxtES5");
|
|
2396
2552
|
function topSchemaObjCode(it) {
|
|
2397
2553
|
const { schema, opts, gen } = it;
|
|
2398
2554
|
validateFunction(it, () => {
|
|
@@ -2408,16 +2564,19 @@ var require_validate = __commonJS({
|
|
|
2408
2564
|
});
|
|
2409
2565
|
return;
|
|
2410
2566
|
}
|
|
2567
|
+
__name(topSchemaObjCode, "topSchemaObjCode");
|
|
2411
2568
|
function resetEvaluated(it) {
|
|
2412
2569
|
const { gen, validateName } = it;
|
|
2413
2570
|
it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
|
|
2414
2571
|
gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
|
|
2415
2572
|
gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
|
|
2416
2573
|
}
|
|
2574
|
+
__name(resetEvaluated, "resetEvaluated");
|
|
2417
2575
|
function funcSourceUrl(schema, opts) {
|
|
2418
2576
|
const schId = typeof schema == "object" && schema[opts.schemaId];
|
|
2419
2577
|
return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
|
|
2420
2578
|
}
|
|
2579
|
+
__name(funcSourceUrl, "funcSourceUrl");
|
|
2421
2580
|
function subschemaCode(it, valid) {
|
|
2422
2581
|
if (isSchemaObj(it)) {
|
|
2423
2582
|
checkKeywords(it);
|
|
@@ -2428,6 +2587,7 @@ var require_validate = __commonJS({
|
|
|
2428
2587
|
}
|
|
2429
2588
|
(0, boolSchema_1.boolOrEmptySchema)(it, valid);
|
|
2430
2589
|
}
|
|
2590
|
+
__name(subschemaCode, "subschemaCode");
|
|
2431
2591
|
function schemaCxtHasRules({ schema, self }) {
|
|
2432
2592
|
if (typeof schema == "boolean")
|
|
2433
2593
|
return !schema;
|
|
@@ -2436,9 +2596,11 @@ var require_validate = __commonJS({
|
|
|
2436
2596
|
return true;
|
|
2437
2597
|
return false;
|
|
2438
2598
|
}
|
|
2599
|
+
__name(schemaCxtHasRules, "schemaCxtHasRules");
|
|
2439
2600
|
function isSchemaObj(it) {
|
|
2440
2601
|
return typeof it.schema != "boolean";
|
|
2441
2602
|
}
|
|
2603
|
+
__name(isSchemaObj, "isSchemaObj");
|
|
2442
2604
|
function subSchemaObjCode(it, valid) {
|
|
2443
2605
|
const { schema, gen, opts } = it;
|
|
2444
2606
|
if (opts.$comment && schema.$comment)
|
|
@@ -2449,10 +2611,12 @@ var require_validate = __commonJS({
|
|
|
2449
2611
|
typeAndKeywords(it, errsCount);
|
|
2450
2612
|
gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
2451
2613
|
}
|
|
2614
|
+
__name(subSchemaObjCode, "subSchemaObjCode");
|
|
2452
2615
|
function checkKeywords(it) {
|
|
2453
2616
|
(0, util_1.checkUnknownRules)(it);
|
|
2454
2617
|
checkRefsAndKeywords(it);
|
|
2455
2618
|
}
|
|
2619
|
+
__name(checkKeywords, "checkKeywords");
|
|
2456
2620
|
function typeAndKeywords(it, errsCount) {
|
|
2457
2621
|
if (it.opts.jtd)
|
|
2458
2622
|
return schemaKeywords(it, [], false, errsCount);
|
|
@@ -2460,27 +2624,32 @@ var require_validate = __commonJS({
|
|
|
2460
2624
|
const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
|
|
2461
2625
|
schemaKeywords(it, types, !checkedTypes, errsCount);
|
|
2462
2626
|
}
|
|
2627
|
+
__name(typeAndKeywords, "typeAndKeywords");
|
|
2463
2628
|
function checkRefsAndKeywords(it) {
|
|
2464
2629
|
const { schema, errSchemaPath, opts, self } = it;
|
|
2465
2630
|
if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
|
|
2466
2631
|
self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
|
|
2467
2632
|
}
|
|
2468
2633
|
}
|
|
2634
|
+
__name(checkRefsAndKeywords, "checkRefsAndKeywords");
|
|
2469
2635
|
function checkNoDefault(it) {
|
|
2470
2636
|
const { schema, opts } = it;
|
|
2471
2637
|
if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
|
|
2472
2638
|
(0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
|
|
2473
2639
|
}
|
|
2474
2640
|
}
|
|
2641
|
+
__name(checkNoDefault, "checkNoDefault");
|
|
2475
2642
|
function updateContext(it) {
|
|
2476
2643
|
const schId = it.schema[it.opts.schemaId];
|
|
2477
2644
|
if (schId)
|
|
2478
2645
|
it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
|
|
2479
2646
|
}
|
|
2647
|
+
__name(updateContext, "updateContext");
|
|
2480
2648
|
function checkAsyncSchema(it) {
|
|
2481
2649
|
if (it.schema.$async && !it.schemaEnv.$async)
|
|
2482
2650
|
throw new Error("async schema in sync schema");
|
|
2483
2651
|
}
|
|
2652
|
+
__name(checkAsyncSchema, "checkAsyncSchema");
|
|
2484
2653
|
function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
|
|
2485
2654
|
const msg = schema.$comment;
|
|
2486
2655
|
if (opts.$comment === true) {
|
|
@@ -2491,6 +2660,7 @@ var require_validate = __commonJS({
|
|
|
2491
2660
|
gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
|
|
2492
2661
|
}
|
|
2493
2662
|
}
|
|
2663
|
+
__name(commentKeyword, "commentKeyword");
|
|
2494
2664
|
function returnResults(it) {
|
|
2495
2665
|
const { gen, schemaEnv, validateName, ValidationError, opts } = it;
|
|
2496
2666
|
if (schemaEnv.$async) {
|
|
@@ -2502,12 +2672,14 @@ var require_validate = __commonJS({
|
|
|
2502
2672
|
gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
|
|
2503
2673
|
}
|
|
2504
2674
|
}
|
|
2675
|
+
__name(returnResults, "returnResults");
|
|
2505
2676
|
function assignEvaluated({ gen, evaluated, props, items }) {
|
|
2506
2677
|
if (props instanceof codegen_1.Name)
|
|
2507
2678
|
gen.assign((0, codegen_1._)`${evaluated}.props`, props);
|
|
2508
2679
|
if (items instanceof codegen_1.Name)
|
|
2509
2680
|
gen.assign((0, codegen_1._)`${evaluated}.items`, items);
|
|
2510
2681
|
}
|
|
2682
|
+
__name(assignEvaluated, "assignEvaluated");
|
|
2511
2683
|
function schemaKeywords(it, types, typeErrors, errsCount) {
|
|
2512
2684
|
const { gen, schema, data, allErrors, opts, self } = it;
|
|
2513
2685
|
const { RULES } = self;
|
|
@@ -2539,7 +2711,9 @@ var require_validate = __commonJS({
|
|
|
2539
2711
|
if (!allErrors)
|
|
2540
2712
|
gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
|
|
2541
2713
|
}
|
|
2714
|
+
__name(groupKeywords, "groupKeywords");
|
|
2542
2715
|
}
|
|
2716
|
+
__name(schemaKeywords, "schemaKeywords");
|
|
2543
2717
|
function iterateKeywords(it, group) {
|
|
2544
2718
|
const { gen, schema, opts: { useDefaults } } = it;
|
|
2545
2719
|
if (useDefaults)
|
|
@@ -2552,6 +2726,7 @@ var require_validate = __commonJS({
|
|
|
2552
2726
|
}
|
|
2553
2727
|
});
|
|
2554
2728
|
}
|
|
2729
|
+
__name(iterateKeywords, "iterateKeywords");
|
|
2555
2730
|
function checkStrictTypes(it, types) {
|
|
2556
2731
|
if (it.schemaEnv.meta || !it.opts.strictTypes)
|
|
2557
2732
|
return;
|
|
@@ -2560,6 +2735,7 @@ var require_validate = __commonJS({
|
|
|
2560
2735
|
checkMultipleTypes(it, types);
|
|
2561
2736
|
checkKeywordTypes(it, it.dataTypes);
|
|
2562
2737
|
}
|
|
2738
|
+
__name(checkStrictTypes, "checkStrictTypes");
|
|
2563
2739
|
function checkContextTypes(it, types) {
|
|
2564
2740
|
if (!types.length)
|
|
2565
2741
|
return;
|
|
@@ -2574,11 +2750,13 @@ var require_validate = __commonJS({
|
|
|
2574
2750
|
});
|
|
2575
2751
|
narrowSchemaTypes(it, types);
|
|
2576
2752
|
}
|
|
2753
|
+
__name(checkContextTypes, "checkContextTypes");
|
|
2577
2754
|
function checkMultipleTypes(it, ts) {
|
|
2578
2755
|
if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
|
|
2579
2756
|
strictTypesError(it, "use allowUnionTypes to allow union type keyword");
|
|
2580
2757
|
}
|
|
2581
2758
|
}
|
|
2759
|
+
__name(checkMultipleTypes, "checkMultipleTypes");
|
|
2582
2760
|
function checkKeywordTypes(it, ts) {
|
|
2583
2761
|
const rules = it.self.RULES.all;
|
|
2584
2762
|
for (const keyword in rules) {
|
|
@@ -2591,12 +2769,15 @@ var require_validate = __commonJS({
|
|
|
2591
2769
|
}
|
|
2592
2770
|
}
|
|
2593
2771
|
}
|
|
2772
|
+
__name(checkKeywordTypes, "checkKeywordTypes");
|
|
2594
2773
|
function hasApplicableType(schTs, kwdT) {
|
|
2595
2774
|
return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
|
|
2596
2775
|
}
|
|
2776
|
+
__name(hasApplicableType, "hasApplicableType");
|
|
2597
2777
|
function includesType(ts, t) {
|
|
2598
2778
|
return ts.includes(t) || t === "integer" && ts.includes("number");
|
|
2599
2779
|
}
|
|
2780
|
+
__name(includesType, "includesType");
|
|
2600
2781
|
function narrowSchemaTypes(it, withTypes) {
|
|
2601
2782
|
const ts = [];
|
|
2602
2783
|
for (const t of it.dataTypes) {
|
|
@@ -2607,11 +2788,13 @@ var require_validate = __commonJS({
|
|
|
2607
2788
|
}
|
|
2608
2789
|
it.dataTypes = ts;
|
|
2609
2790
|
}
|
|
2791
|
+
__name(narrowSchemaTypes, "narrowSchemaTypes");
|
|
2610
2792
|
function strictTypesError(it, msg) {
|
|
2611
2793
|
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
|
|
2612
2794
|
msg += ` at "${schemaPath}" (strictTypes)`;
|
|
2613
2795
|
(0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
|
|
2614
2796
|
}
|
|
2797
|
+
__name(strictTypesError, "strictTypesError");
|
|
2615
2798
|
var KeywordCxt = class {
|
|
2616
2799
|
constructor(it, def, keyword) {
|
|
2617
2800
|
(0, keyword_1.validateKeywordUsage)(it, def, keyword);
|
|
@@ -2747,6 +2930,7 @@ var require_validate = __commonJS({
|
|
|
2747
2930
|
}
|
|
2748
2931
|
return codegen_1.nil;
|
|
2749
2932
|
}
|
|
2933
|
+
__name(wrong$DataType, "wrong$DataType");
|
|
2750
2934
|
function invalid$DataSchema() {
|
|
2751
2935
|
if (def.validateSchema) {
|
|
2752
2936
|
const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
|
|
@@ -2754,6 +2938,7 @@ var require_validate = __commonJS({
|
|
|
2754
2938
|
}
|
|
2755
2939
|
return codegen_1.nil;
|
|
2756
2940
|
}
|
|
2941
|
+
__name(invalid$DataSchema, "invalid$DataSchema");
|
|
2757
2942
|
}
|
|
2758
2943
|
subschema(appl, valid) {
|
|
2759
2944
|
const subschema = (0, subschema_1.getSubschema)(this.it, appl);
|
|
@@ -2782,6 +2967,7 @@ var require_validate = __commonJS({
|
|
|
2782
2967
|
}
|
|
2783
2968
|
}
|
|
2784
2969
|
};
|
|
2970
|
+
__name(KeywordCxt, "KeywordCxt");
|
|
2785
2971
|
exports.KeywordCxt = KeywordCxt;
|
|
2786
2972
|
function keywordCode(it, keyword, def, ruleType) {
|
|
2787
2973
|
const cxt = new KeywordCxt(it, def, keyword);
|
|
@@ -2795,6 +2981,7 @@ var require_validate = __commonJS({
|
|
|
2795
2981
|
(0, keyword_1.funcKeywordCode)(cxt, def);
|
|
2796
2982
|
}
|
|
2797
2983
|
}
|
|
2984
|
+
__name(keywordCode, "keywordCode");
|
|
2798
2985
|
var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
|
|
2799
2986
|
var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
2800
2987
|
function getData($data, { dataLevel, dataNames, dataPathArr }) {
|
|
@@ -2836,7 +3023,9 @@ var require_validate = __commonJS({
|
|
|
2836
3023
|
function errorMsg(pointerType, up) {
|
|
2837
3024
|
return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
|
|
2838
3025
|
}
|
|
3026
|
+
__name(errorMsg, "errorMsg");
|
|
2839
3027
|
}
|
|
3028
|
+
__name(getData, "getData");
|
|
2840
3029
|
exports.getData = getData;
|
|
2841
3030
|
}
|
|
2842
3031
|
});
|
|
@@ -2853,6 +3042,7 @@ var require_validation_error = __commonJS({
|
|
|
2853
3042
|
this.ajv = this.validation = true;
|
|
2854
3043
|
}
|
|
2855
3044
|
};
|
|
3045
|
+
__name(ValidationError, "ValidationError");
|
|
2856
3046
|
exports.default = ValidationError;
|
|
2857
3047
|
}
|
|
2858
3048
|
});
|
|
@@ -2870,6 +3060,7 @@ var require_ref_error = __commonJS({
|
|
|
2870
3060
|
this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
|
|
2871
3061
|
}
|
|
2872
3062
|
};
|
|
3063
|
+
__name(MissingRefError, "MissingRefError");
|
|
2873
3064
|
exports.default = MissingRefError;
|
|
2874
3065
|
}
|
|
2875
3066
|
});
|
|
@@ -2905,6 +3096,7 @@ var require_compile = __commonJS({
|
|
|
2905
3096
|
this.refs = {};
|
|
2906
3097
|
}
|
|
2907
3098
|
};
|
|
3099
|
+
__name(SchemaEnv, "SchemaEnv");
|
|
2908
3100
|
exports.SchemaEnv = SchemaEnv;
|
|
2909
3101
|
function compileSchema(sch) {
|
|
2910
3102
|
const _sch = getCompilingSchema.call(this, sch);
|
|
@@ -2990,6 +3182,7 @@ var require_compile = __commonJS({
|
|
|
2990
3182
|
this._compilations.delete(sch);
|
|
2991
3183
|
}
|
|
2992
3184
|
}
|
|
3185
|
+
__name(compileSchema, "compileSchema");
|
|
2993
3186
|
exports.compileSchema = compileSchema;
|
|
2994
3187
|
function resolveRef(root, baseId, ref) {
|
|
2995
3188
|
var _a;
|
|
@@ -3008,28 +3201,33 @@ var require_compile = __commonJS({
|
|
|
3008
3201
|
return;
|
|
3009
3202
|
return root.refs[ref] = inlineOrCompile.call(this, _sch);
|
|
3010
3203
|
}
|
|
3204
|
+
__name(resolveRef, "resolveRef");
|
|
3011
3205
|
exports.resolveRef = resolveRef;
|
|
3012
3206
|
function inlineOrCompile(sch) {
|
|
3013
3207
|
if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
|
|
3014
3208
|
return sch.schema;
|
|
3015
3209
|
return sch.validate ? sch : compileSchema.call(this, sch);
|
|
3016
3210
|
}
|
|
3211
|
+
__name(inlineOrCompile, "inlineOrCompile");
|
|
3017
3212
|
function getCompilingSchema(schEnv) {
|
|
3018
3213
|
for (const sch of this._compilations) {
|
|
3019
3214
|
if (sameSchemaEnv(sch, schEnv))
|
|
3020
3215
|
return sch;
|
|
3021
3216
|
}
|
|
3022
3217
|
}
|
|
3218
|
+
__name(getCompilingSchema, "getCompilingSchema");
|
|
3023
3219
|
exports.getCompilingSchema = getCompilingSchema;
|
|
3024
3220
|
function sameSchemaEnv(s1, s2) {
|
|
3025
3221
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
3026
3222
|
}
|
|
3223
|
+
__name(sameSchemaEnv, "sameSchemaEnv");
|
|
3027
3224
|
function resolve(root, ref) {
|
|
3028
3225
|
let sch;
|
|
3029
3226
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
3030
3227
|
ref = sch;
|
|
3031
3228
|
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
3032
3229
|
}
|
|
3230
|
+
__name(resolve, "resolve");
|
|
3033
3231
|
function resolveSchema(root, ref) {
|
|
3034
3232
|
const p = this.opts.uriResolver.parse(ref);
|
|
3035
3233
|
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
|
|
@@ -3059,6 +3257,7 @@ var require_compile = __commonJS({
|
|
|
3059
3257
|
}
|
|
3060
3258
|
return getJsonPointer.call(this, p, schOrRef);
|
|
3061
3259
|
}
|
|
3260
|
+
__name(resolveSchema, "resolveSchema");
|
|
3062
3261
|
exports.resolveSchema = resolveSchema;
|
|
3063
3262
|
var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
|
|
3064
3263
|
"properties",
|
|
@@ -3094,6 +3293,7 @@ var require_compile = __commonJS({
|
|
|
3094
3293
|
return env;
|
|
3095
3294
|
return void 0;
|
|
3096
3295
|
}
|
|
3296
|
+
__name(getJsonPointer, "getJsonPointer");
|
|
3097
3297
|
}
|
|
3098
3298
|
});
|
|
3099
3299
|
|
|
@@ -3139,18 +3339,23 @@ var require_uri_all = __commonJS({
|
|
|
3139
3339
|
return sets[0];
|
|
3140
3340
|
}
|
|
3141
3341
|
}
|
|
3342
|
+
__name(merge, "merge");
|
|
3142
3343
|
function subexp(str) {
|
|
3143
3344
|
return "(?:" + str + ")";
|
|
3144
3345
|
}
|
|
3346
|
+
__name(subexp, "subexp");
|
|
3145
3347
|
function typeOf(o) {
|
|
3146
3348
|
return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
|
|
3147
3349
|
}
|
|
3350
|
+
__name(typeOf, "typeOf");
|
|
3148
3351
|
function toUpperCase(str) {
|
|
3149
3352
|
return str.toUpperCase();
|
|
3150
3353
|
}
|
|
3354
|
+
__name(toUpperCase, "toUpperCase");
|
|
3151
3355
|
function toArray(obj) {
|
|
3152
3356
|
return obj !== void 0 && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
|
|
3153
3357
|
}
|
|
3358
|
+
__name(toArray, "toArray");
|
|
3154
3359
|
function assign(target, source) {
|
|
3155
3360
|
var obj = target;
|
|
3156
3361
|
if (source) {
|
|
@@ -3160,6 +3365,7 @@ var require_uri_all = __commonJS({
|
|
|
3160
3365
|
}
|
|
3161
3366
|
return obj;
|
|
3162
3367
|
}
|
|
3368
|
+
__name(assign, "assign");
|
|
3163
3369
|
function buildExps(isIRI2) {
|
|
3164
3370
|
var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
|
|
3165
3371
|
return {
|
|
@@ -3179,6 +3385,7 @@ var require_uri_all = __commonJS({
|
|
|
3179
3385
|
//RFC 6874, with relaxed parsing rules
|
|
3180
3386
|
};
|
|
3181
3387
|
}
|
|
3388
|
+
__name(buildExps, "buildExps");
|
|
3182
3389
|
var URI_PROTOCOL = buildExps(false);
|
|
3183
3390
|
var IRI_PROTOCOL = buildExps(true);
|
|
3184
3391
|
var slicedToArray = function() {
|
|
@@ -3207,6 +3414,7 @@ var require_uri_all = __commonJS({
|
|
|
3207
3414
|
}
|
|
3208
3415
|
return _arr;
|
|
3209
3416
|
}
|
|
3417
|
+
__name(sliceIterator, "sliceIterator");
|
|
3210
3418
|
return function(arr, i) {
|
|
3211
3419
|
if (Array.isArray(arr)) {
|
|
3212
3420
|
return arr;
|
|
@@ -3217,7 +3425,7 @@ var require_uri_all = __commonJS({
|
|
|
3217
3425
|
}
|
|
3218
3426
|
};
|
|
3219
3427
|
}();
|
|
3220
|
-
var toConsumableArray = function(arr) {
|
|
3428
|
+
var toConsumableArray = /* @__PURE__ */ __name(function(arr) {
|
|
3221
3429
|
if (Array.isArray(arr)) {
|
|
3222
3430
|
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++)
|
|
3223
3431
|
arr2[i] = arr[i];
|
|
@@ -3225,7 +3433,7 @@ var require_uri_all = __commonJS({
|
|
|
3225
3433
|
} else {
|
|
3226
3434
|
return Array.from(arr);
|
|
3227
3435
|
}
|
|
3228
|
-
};
|
|
3436
|
+
}, "toConsumableArray");
|
|
3229
3437
|
var maxInt = 2147483647;
|
|
3230
3438
|
var base = 36;
|
|
3231
3439
|
var tMin = 1;
|
|
@@ -3249,6 +3457,7 @@ var require_uri_all = __commonJS({
|
|
|
3249
3457
|
function error$1(type) {
|
|
3250
3458
|
throw new RangeError(errors[type]);
|
|
3251
3459
|
}
|
|
3460
|
+
__name(error$1, "error$1");
|
|
3252
3461
|
function map(array, fn) {
|
|
3253
3462
|
var result = [];
|
|
3254
3463
|
var length = array.length;
|
|
@@ -3257,6 +3466,7 @@ var require_uri_all = __commonJS({
|
|
|
3257
3466
|
}
|
|
3258
3467
|
return result;
|
|
3259
3468
|
}
|
|
3469
|
+
__name(map, "map");
|
|
3260
3470
|
function mapDomain(string, fn) {
|
|
3261
3471
|
var parts = string.split("@");
|
|
3262
3472
|
var result = "";
|
|
@@ -3269,6 +3479,7 @@ var require_uri_all = __commonJS({
|
|
|
3269
3479
|
var encoded = map(labels, fn).join(".");
|
|
3270
3480
|
return result + encoded;
|
|
3271
3481
|
}
|
|
3482
|
+
__name(mapDomain, "mapDomain");
|
|
3272
3483
|
function ucs2decode(string) {
|
|
3273
3484
|
var output = [];
|
|
3274
3485
|
var counter = 0;
|
|
@@ -3289,10 +3500,11 @@ var require_uri_all = __commonJS({
|
|
|
3289
3500
|
}
|
|
3290
3501
|
return output;
|
|
3291
3502
|
}
|
|
3292
|
-
|
|
3503
|
+
__name(ucs2decode, "ucs2decode");
|
|
3504
|
+
var ucs2encode = /* @__PURE__ */ __name(function ucs2encode2(array) {
|
|
3293
3505
|
return String.fromCodePoint.apply(String, toConsumableArray(array));
|
|
3294
|
-
};
|
|
3295
|
-
var basicToDigit = function basicToDigit2(codePoint) {
|
|
3506
|
+
}, "ucs2encode");
|
|
3507
|
+
var basicToDigit = /* @__PURE__ */ __name(function basicToDigit2(codePoint) {
|
|
3296
3508
|
if (codePoint - 48 < 10) {
|
|
3297
3509
|
return codePoint - 22;
|
|
3298
3510
|
}
|
|
@@ -3303,11 +3515,11 @@ var require_uri_all = __commonJS({
|
|
|
3303
3515
|
return codePoint - 97;
|
|
3304
3516
|
}
|
|
3305
3517
|
return base;
|
|
3306
|
-
};
|
|
3307
|
-
var digitToBasic = function digitToBasic2(digit, flag) {
|
|
3518
|
+
}, "basicToDigit");
|
|
3519
|
+
var digitToBasic = /* @__PURE__ */ __name(function digitToBasic2(digit, flag) {
|
|
3308
3520
|
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
3309
|
-
};
|
|
3310
|
-
var adapt = function adapt2(delta, numPoints, firstTime) {
|
|
3521
|
+
}, "digitToBasic");
|
|
3522
|
+
var adapt = /* @__PURE__ */ __name(function adapt2(delta, numPoints, firstTime) {
|
|
3311
3523
|
var k = 0;
|
|
3312
3524
|
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
3313
3525
|
delta += floor(delta / numPoints);
|
|
@@ -3320,8 +3532,8 @@ var require_uri_all = __commonJS({
|
|
|
3320
3532
|
delta = floor(delta / baseMinusTMin);
|
|
3321
3533
|
}
|
|
3322
3534
|
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
3323
|
-
};
|
|
3324
|
-
var decode = function decode2(input) {
|
|
3535
|
+
}, "adapt");
|
|
3536
|
+
var decode = /* @__PURE__ */ __name(function decode2(input) {
|
|
3325
3537
|
var output = [];
|
|
3326
3538
|
var inputLength = input.length;
|
|
3327
3539
|
var i = 0;
|
|
@@ -3373,8 +3585,8 @@ var require_uri_all = __commonJS({
|
|
|
3373
3585
|
output.splice(i++, 0, n);
|
|
3374
3586
|
}
|
|
3375
3587
|
return String.fromCodePoint.apply(String, output);
|
|
3376
|
-
};
|
|
3377
|
-
var encode = function encode2(input) {
|
|
3588
|
+
}, "decode");
|
|
3589
|
+
var encode = /* @__PURE__ */ __name(function encode2(input) {
|
|
3378
3590
|
var output = [];
|
|
3379
3591
|
input = ucs2decode(input);
|
|
3380
3592
|
var inputLength = input.length;
|
|
@@ -3492,17 +3704,17 @@ var require_uri_all = __commonJS({
|
|
|
3492
3704
|
++n;
|
|
3493
3705
|
}
|
|
3494
3706
|
return output.join("");
|
|
3495
|
-
};
|
|
3496
|
-
var toUnicode = function toUnicode2(input) {
|
|
3707
|
+
}, "encode");
|
|
3708
|
+
var toUnicode = /* @__PURE__ */ __name(function toUnicode2(input) {
|
|
3497
3709
|
return mapDomain(input, function(string) {
|
|
3498
3710
|
return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
|
|
3499
3711
|
});
|
|
3500
|
-
};
|
|
3501
|
-
var toASCII = function toASCII2(input) {
|
|
3712
|
+
}, "toUnicode");
|
|
3713
|
+
var toASCII = /* @__PURE__ */ __name(function toASCII2(input) {
|
|
3502
3714
|
return mapDomain(input, function(string) {
|
|
3503
3715
|
return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
|
|
3504
3716
|
});
|
|
3505
|
-
};
|
|
3717
|
+
}, "toASCII");
|
|
3506
3718
|
var punycode = {
|
|
3507
3719
|
/**
|
|
3508
3720
|
* A string representing the current Punycode.js version number.
|
|
@@ -3540,6 +3752,7 @@ var require_uri_all = __commonJS({
|
|
|
3540
3752
|
e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
|
|
3541
3753
|
return e;
|
|
3542
3754
|
}
|
|
3755
|
+
__name(pctEncChar, "pctEncChar");
|
|
3543
3756
|
function pctDecChars(str) {
|
|
3544
3757
|
var newStr = "";
|
|
3545
3758
|
var i = 0;
|
|
@@ -3573,11 +3786,13 @@ var require_uri_all = __commonJS({
|
|
|
3573
3786
|
}
|
|
3574
3787
|
return newStr;
|
|
3575
3788
|
}
|
|
3789
|
+
__name(pctDecChars, "pctDecChars");
|
|
3576
3790
|
function _normalizeComponentEncoding(components, protocol) {
|
|
3577
3791
|
function decodeUnreserved2(str) {
|
|
3578
3792
|
var decStr = pctDecChars(str);
|
|
3579
3793
|
return !decStr.match(protocol.UNRESERVED) ? str : decStr;
|
|
3580
3794
|
}
|
|
3795
|
+
__name(decodeUnreserved2, "decodeUnreserved");
|
|
3581
3796
|
if (components.scheme)
|
|
3582
3797
|
components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
|
|
3583
3798
|
if (components.userinfo !== void 0)
|
|
@@ -3592,9 +3807,11 @@ var require_uri_all = __commonJS({
|
|
|
3592
3807
|
components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
3593
3808
|
return components;
|
|
3594
3809
|
}
|
|
3810
|
+
__name(_normalizeComponentEncoding, "_normalizeComponentEncoding");
|
|
3595
3811
|
function _stripLeadingZeros(str) {
|
|
3596
3812
|
return str.replace(/^0*(.*)/, "$1") || "0";
|
|
3597
3813
|
}
|
|
3814
|
+
__name(_stripLeadingZeros, "_stripLeadingZeros");
|
|
3598
3815
|
function _normalizeIPv4(host, protocol) {
|
|
3599
3816
|
var matches = host.match(protocol.IPV4ADDRESS) || [];
|
|
3600
3817
|
var _matches = slicedToArray(matches, 2), address = _matches[1];
|
|
@@ -3604,6 +3821,7 @@ var require_uri_all = __commonJS({
|
|
|
3604
3821
|
return host;
|
|
3605
3822
|
}
|
|
3606
3823
|
}
|
|
3824
|
+
__name(_normalizeIPv4, "_normalizeIPv4");
|
|
3607
3825
|
function _normalizeIPv6(host, protocol) {
|
|
3608
3826
|
var matches = host.match(protocol.IPV6ADDRESS) || [];
|
|
3609
3827
|
var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
|
|
@@ -3651,6 +3869,7 @@ var require_uri_all = __commonJS({
|
|
|
3651
3869
|
return host;
|
|
3652
3870
|
}
|
|
3653
3871
|
}
|
|
3872
|
+
__name(_normalizeIPv6, "_normalizeIPv6");
|
|
3654
3873
|
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
|
|
3655
3874
|
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
|
|
3656
3875
|
function parse(uriString) {
|
|
@@ -3720,6 +3939,7 @@ var require_uri_all = __commonJS({
|
|
|
3720
3939
|
}
|
|
3721
3940
|
return components;
|
|
3722
3941
|
}
|
|
3942
|
+
__name(parse, "parse");
|
|
3723
3943
|
function _recomposeAuthority(components, options) {
|
|
3724
3944
|
var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
3725
3945
|
var uriTokens = [];
|
|
@@ -3738,6 +3958,7 @@ var require_uri_all = __commonJS({
|
|
|
3738
3958
|
}
|
|
3739
3959
|
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
3740
3960
|
}
|
|
3961
|
+
__name(_recomposeAuthority, "_recomposeAuthority");
|
|
3741
3962
|
var RDS1 = /^\.\.?\//;
|
|
3742
3963
|
var RDS2 = /^\/\.(\/|$)/;
|
|
3743
3964
|
var RDS3 = /^\/\.\.(\/|$)/;
|
|
@@ -3767,6 +3988,7 @@ var require_uri_all = __commonJS({
|
|
|
3767
3988
|
}
|
|
3768
3989
|
return output.join("");
|
|
3769
3990
|
}
|
|
3991
|
+
__name(removeDotSegments, "removeDotSegments");
|
|
3770
3992
|
function serialize(components) {
|
|
3771
3993
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3772
3994
|
var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
@@ -3819,6 +4041,7 @@ var require_uri_all = __commonJS({
|
|
|
3819
4041
|
}
|
|
3820
4042
|
return uriTokens.join("");
|
|
3821
4043
|
}
|
|
4044
|
+
__name(serialize, "serialize");
|
|
3822
4045
|
function resolveComponents(base2, relative) {
|
|
3823
4046
|
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3824
4047
|
var skipNormalization = arguments[3];
|
|
@@ -3874,10 +4097,12 @@ var require_uri_all = __commonJS({
|
|
|
3874
4097
|
target.fragment = relative.fragment;
|
|
3875
4098
|
return target;
|
|
3876
4099
|
}
|
|
4100
|
+
__name(resolveComponents, "resolveComponents");
|
|
3877
4101
|
function resolve(baseURI, relativeURI, options) {
|
|
3878
4102
|
var schemelessOptions = assign({ scheme: "null" }, options);
|
|
3879
4103
|
return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
3880
4104
|
}
|
|
4105
|
+
__name(resolve, "resolve");
|
|
3881
4106
|
function normalize(uri, options) {
|
|
3882
4107
|
if (typeof uri === "string") {
|
|
3883
4108
|
uri = serialize(parse(uri, options), options);
|
|
@@ -3886,6 +4111,7 @@ var require_uri_all = __commonJS({
|
|
|
3886
4111
|
}
|
|
3887
4112
|
return uri;
|
|
3888
4113
|
}
|
|
4114
|
+
__name(normalize, "normalize");
|
|
3889
4115
|
function equal(uriA, uriB, options) {
|
|
3890
4116
|
if (typeof uriA === "string") {
|
|
3891
4117
|
uriA = serialize(parse(uriA, options), options);
|
|
@@ -3899,22 +4125,25 @@ var require_uri_all = __commonJS({
|
|
|
3899
4125
|
}
|
|
3900
4126
|
return uriA === uriB;
|
|
3901
4127
|
}
|
|
4128
|
+
__name(equal, "equal");
|
|
3902
4129
|
function escapeComponent(str, options) {
|
|
3903
4130
|
return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
|
|
3904
4131
|
}
|
|
4132
|
+
__name(escapeComponent, "escapeComponent");
|
|
3905
4133
|
function unescapeComponent(str, options) {
|
|
3906
4134
|
return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
|
|
3907
4135
|
}
|
|
4136
|
+
__name(unescapeComponent, "unescapeComponent");
|
|
3908
4137
|
var handler = {
|
|
3909
4138
|
scheme: "http",
|
|
3910
4139
|
domainHost: true,
|
|
3911
|
-
parse: function parse2(components, options) {
|
|
4140
|
+
parse: /* @__PURE__ */ __name(function parse2(components, options) {
|
|
3912
4141
|
if (!components.host) {
|
|
3913
4142
|
components.error = components.error || "HTTP URIs must have a host.";
|
|
3914
4143
|
}
|
|
3915
4144
|
return components;
|
|
3916
|
-
},
|
|
3917
|
-
serialize: function serialize2(components, options) {
|
|
4145
|
+
}, "parse"),
|
|
4146
|
+
serialize: /* @__PURE__ */ __name(function serialize2(components, options) {
|
|
3918
4147
|
var secure = String(components.scheme).toLowerCase() === "https";
|
|
3919
4148
|
if (components.port === (secure ? 443 : 80) || components.port === "") {
|
|
3920
4149
|
components.port = void 0;
|
|
@@ -3923,7 +4152,7 @@ var require_uri_all = __commonJS({
|
|
|
3923
4152
|
components.path = "/";
|
|
3924
4153
|
}
|
|
3925
4154
|
return components;
|
|
3926
|
-
}
|
|
4155
|
+
}, "serialize")
|
|
3927
4156
|
};
|
|
3928
4157
|
var handler$1 = {
|
|
3929
4158
|
scheme: "https",
|
|
@@ -3934,18 +4163,19 @@ var require_uri_all = __commonJS({
|
|
|
3934
4163
|
function isSecure(wsComponents) {
|
|
3935
4164
|
return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
|
|
3936
4165
|
}
|
|
4166
|
+
__name(isSecure, "isSecure");
|
|
3937
4167
|
var handler$2 = {
|
|
3938
4168
|
scheme: "ws",
|
|
3939
4169
|
domainHost: true,
|
|
3940
|
-
parse: function parse2(components, options) {
|
|
4170
|
+
parse: /* @__PURE__ */ __name(function parse2(components, options) {
|
|
3941
4171
|
var wsComponents = components;
|
|
3942
4172
|
wsComponents.secure = isSecure(wsComponents);
|
|
3943
4173
|
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
3944
4174
|
wsComponents.path = void 0;
|
|
3945
4175
|
wsComponents.query = void 0;
|
|
3946
4176
|
return wsComponents;
|
|
3947
|
-
},
|
|
3948
|
-
serialize: function serialize2(wsComponents, options) {
|
|
4177
|
+
}, "parse"),
|
|
4178
|
+
serialize: /* @__PURE__ */ __name(function serialize2(wsComponents, options) {
|
|
3949
4179
|
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
|
|
3950
4180
|
wsComponents.port = void 0;
|
|
3951
4181
|
}
|
|
@@ -3961,7 +4191,7 @@ var require_uri_all = __commonJS({
|
|
|
3961
4191
|
}
|
|
3962
4192
|
wsComponents.fragment = void 0;
|
|
3963
4193
|
return wsComponents;
|
|
3964
|
-
}
|
|
4194
|
+
}, "serialize")
|
|
3965
4195
|
};
|
|
3966
4196
|
var handler$3 = {
|
|
3967
4197
|
scheme: "wss",
|
|
@@ -3987,9 +4217,10 @@ var require_uri_all = __commonJS({
|
|
|
3987
4217
|
var decStr = pctDecChars(str);
|
|
3988
4218
|
return !decStr.match(UNRESERVED) ? str : decStr;
|
|
3989
4219
|
}
|
|
4220
|
+
__name(decodeUnreserved, "decodeUnreserved");
|
|
3990
4221
|
var handler$4 = {
|
|
3991
4222
|
scheme: "mailto",
|
|
3992
|
-
parse: function parse$$1(components, options) {
|
|
4223
|
+
parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
|
|
3993
4224
|
var mailtoComponents = components;
|
|
3994
4225
|
var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
|
|
3995
4226
|
mailtoComponents.path = void 0;
|
|
@@ -4037,8 +4268,8 @@ var require_uri_all = __commonJS({
|
|
|
4037
4268
|
to[_x2] = addr.join("@");
|
|
4038
4269
|
}
|
|
4039
4270
|
return mailtoComponents;
|
|
4040
|
-
},
|
|
4041
|
-
serialize: function serialize$$1(mailtoComponents, options) {
|
|
4271
|
+
}, "parse$$1"),
|
|
4272
|
+
serialize: /* @__PURE__ */ __name(function serialize$$1(mailtoComponents, options) {
|
|
4042
4273
|
var components = mailtoComponents;
|
|
4043
4274
|
var to = toArray(mailtoComponents.to);
|
|
4044
4275
|
if (to) {
|
|
@@ -4071,12 +4302,12 @@ var require_uri_all = __commonJS({
|
|
|
4071
4302
|
components.query = fields.join("&");
|
|
4072
4303
|
}
|
|
4073
4304
|
return components;
|
|
4074
|
-
}
|
|
4305
|
+
}, "serialize$$1")
|
|
4075
4306
|
};
|
|
4076
4307
|
var URN_PARSE = /^([^\:]+)\:(.*)/;
|
|
4077
4308
|
var handler$5 = {
|
|
4078
4309
|
scheme: "urn",
|
|
4079
|
-
parse: function parse$$1(components, options) {
|
|
4310
|
+
parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
|
|
4080
4311
|
var matches = components.path && components.path.match(URN_PARSE);
|
|
4081
4312
|
var urnComponents = components;
|
|
4082
4313
|
if (matches) {
|
|
@@ -4095,8 +4326,8 @@ var require_uri_all = __commonJS({
|
|
|
4095
4326
|
urnComponents.error = urnComponents.error || "URN can not be parsed.";
|
|
4096
4327
|
}
|
|
4097
4328
|
return urnComponents;
|
|
4098
|
-
},
|
|
4099
|
-
serialize: function serialize$$1(urnComponents, options) {
|
|
4329
|
+
}, "parse$$1"),
|
|
4330
|
+
serialize: /* @__PURE__ */ __name(function serialize$$1(urnComponents, options) {
|
|
4100
4331
|
var scheme = options.scheme || urnComponents.scheme || "urn";
|
|
4101
4332
|
var nid = urnComponents.nid;
|
|
4102
4333
|
var urnScheme = scheme + ":" + (options.nid || nid);
|
|
@@ -4108,12 +4339,12 @@ var require_uri_all = __commonJS({
|
|
|
4108
4339
|
var nss = urnComponents.nss;
|
|
4109
4340
|
uriComponents.path = (nid || options.nid) + ":" + nss;
|
|
4110
4341
|
return uriComponents;
|
|
4111
|
-
}
|
|
4342
|
+
}, "serialize$$1")
|
|
4112
4343
|
};
|
|
4113
4344
|
var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
|
|
4114
4345
|
var handler$6 = {
|
|
4115
4346
|
scheme: "urn:uuid",
|
|
4116
|
-
parse: function parse2(urnComponents, options) {
|
|
4347
|
+
parse: /* @__PURE__ */ __name(function parse2(urnComponents, options) {
|
|
4117
4348
|
var uuidComponents = urnComponents;
|
|
4118
4349
|
uuidComponents.uuid = uuidComponents.nss;
|
|
4119
4350
|
uuidComponents.nss = void 0;
|
|
@@ -4121,12 +4352,12 @@ var require_uri_all = __commonJS({
|
|
|
4121
4352
|
uuidComponents.error = uuidComponents.error || "UUID is not valid.";
|
|
4122
4353
|
}
|
|
4123
4354
|
return uuidComponents;
|
|
4124
|
-
},
|
|
4125
|
-
serialize: function serialize2(uuidComponents, options) {
|
|
4355
|
+
}, "parse"),
|
|
4356
|
+
serialize: /* @__PURE__ */ __name(function serialize2(uuidComponents, options) {
|
|
4126
4357
|
var urnComponents = uuidComponents;
|
|
4127
4358
|
urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
|
|
4128
4359
|
return urnComponents;
|
|
4129
|
-
}
|
|
4360
|
+
}, "serialize")
|
|
4130
4361
|
};
|
|
4131
4362
|
SCHEMES[handler.scheme] = handler;
|
|
4132
4363
|
SCHEMES[handler$1.scheme] = handler$1;
|
|
@@ -4202,7 +4433,7 @@ var require_core = __commonJS({
|
|
|
4202
4433
|
var util_1 = require_util();
|
|
4203
4434
|
var $dataRefSchema = require_data();
|
|
4204
4435
|
var uri_1 = require_uri();
|
|
4205
|
-
var defaultRegExp = (str, flags) => new RegExp(str, flags);
|
|
4436
|
+
var defaultRegExp = /* @__PURE__ */ __name((str, flags) => new RegExp(str, flags), "defaultRegExp");
|
|
4206
4437
|
defaultRegExp.code = "new RegExp";
|
|
4207
4438
|
var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
|
|
4208
4439
|
var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -4271,6 +4502,7 @@ var require_core = __commonJS({
|
|
|
4271
4502
|
uriResolver
|
|
4272
4503
|
};
|
|
4273
4504
|
}
|
|
4505
|
+
__name(requiredOptions, "requiredOptions");
|
|
4274
4506
|
var Ajv = class {
|
|
4275
4507
|
constructor(opts = {}) {
|
|
4276
4508
|
this.schemas = {};
|
|
@@ -4347,11 +4579,13 @@ var require_core = __commonJS({
|
|
|
4347
4579
|
const sch = this._addSchema(_schema, _meta);
|
|
4348
4580
|
return sch.validate || _compileAsync.call(this, sch);
|
|
4349
4581
|
}
|
|
4582
|
+
__name(runCompileAsync, "runCompileAsync");
|
|
4350
4583
|
async function loadMetaSchema($ref) {
|
|
4351
4584
|
if ($ref && !this.getSchema($ref)) {
|
|
4352
4585
|
await runCompileAsync.call(this, { $ref }, true);
|
|
4353
4586
|
}
|
|
4354
4587
|
}
|
|
4588
|
+
__name(loadMetaSchema, "loadMetaSchema");
|
|
4355
4589
|
async function _compileAsync(sch) {
|
|
4356
4590
|
try {
|
|
4357
4591
|
return this._compileSchemaEnv(sch);
|
|
@@ -4363,11 +4597,13 @@ var require_core = __commonJS({
|
|
|
4363
4597
|
return _compileAsync.call(this, sch);
|
|
4364
4598
|
}
|
|
4365
4599
|
}
|
|
4600
|
+
__name(_compileAsync, "_compileAsync");
|
|
4366
4601
|
function checkLoaded({ missingSchema: ref, missingRef }) {
|
|
4367
4602
|
if (this.refs[ref]) {
|
|
4368
4603
|
throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
|
|
4369
4604
|
}
|
|
4370
4605
|
}
|
|
4606
|
+
__name(checkLoaded, "checkLoaded");
|
|
4371
4607
|
async function loadMissingSchema(ref) {
|
|
4372
4608
|
const _schema = await _loadSchema.call(this, ref);
|
|
4373
4609
|
if (!this.refs[ref])
|
|
@@ -4375,6 +4611,7 @@ var require_core = __commonJS({
|
|
|
4375
4611
|
if (!this.refs[ref])
|
|
4376
4612
|
this.addSchema(_schema, ref, meta);
|
|
4377
4613
|
}
|
|
4614
|
+
__name(loadMissingSchema, "loadMissingSchema");
|
|
4378
4615
|
async function _loadSchema(ref) {
|
|
4379
4616
|
const p = this._loading[ref];
|
|
4380
4617
|
if (p)
|
|
@@ -4385,6 +4622,7 @@ var require_core = __commonJS({
|
|
|
4385
4622
|
delete this._loading[ref];
|
|
4386
4623
|
}
|
|
4387
4624
|
}
|
|
4625
|
+
__name(_loadSchema, "_loadSchema");
|
|
4388
4626
|
}
|
|
4389
4627
|
// Adds schema to the instance
|
|
4390
4628
|
addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {
|
|
@@ -4641,6 +4879,7 @@ var require_core = __commonJS({
|
|
|
4641
4879
|
}
|
|
4642
4880
|
}
|
|
4643
4881
|
};
|
|
4882
|
+
__name(Ajv, "Ajv");
|
|
4644
4883
|
exports.default = Ajv;
|
|
4645
4884
|
Ajv.ValidationError = validation_error_1.default;
|
|
4646
4885
|
Ajv.MissingRefError = ref_error_1.default;
|
|
@@ -4651,10 +4890,12 @@ var require_core = __commonJS({
|
|
|
4651
4890
|
this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
4652
4891
|
}
|
|
4653
4892
|
}
|
|
4893
|
+
__name(checkOptions, "checkOptions");
|
|
4654
4894
|
function getSchEnv(keyRef) {
|
|
4655
4895
|
keyRef = (0, resolve_1.normalizeId)(keyRef);
|
|
4656
4896
|
return this.schemas[keyRef] || this.refs[keyRef];
|
|
4657
4897
|
}
|
|
4898
|
+
__name(getSchEnv, "getSchEnv");
|
|
4658
4899
|
function addInitialSchemas() {
|
|
4659
4900
|
const optsSchemas = this.opts.schemas;
|
|
4660
4901
|
if (!optsSchemas)
|
|
@@ -4665,6 +4906,7 @@ var require_core = __commonJS({
|
|
|
4665
4906
|
for (const key in optsSchemas)
|
|
4666
4907
|
this.addSchema(optsSchemas[key], key);
|
|
4667
4908
|
}
|
|
4909
|
+
__name(addInitialSchemas, "addInitialSchemas");
|
|
4668
4910
|
function addInitialFormats() {
|
|
4669
4911
|
for (const name in this.opts.formats) {
|
|
4670
4912
|
const format = this.opts.formats[name];
|
|
@@ -4672,6 +4914,7 @@ var require_core = __commonJS({
|
|
|
4672
4914
|
this.addFormat(name, format);
|
|
4673
4915
|
}
|
|
4674
4916
|
}
|
|
4917
|
+
__name(addInitialFormats, "addInitialFormats");
|
|
4675
4918
|
function addInitialKeywords(defs) {
|
|
4676
4919
|
if (Array.isArray(defs)) {
|
|
4677
4920
|
this.addVocabulary(defs);
|
|
@@ -4685,12 +4928,14 @@ var require_core = __commonJS({
|
|
|
4685
4928
|
this.addKeyword(def);
|
|
4686
4929
|
}
|
|
4687
4930
|
}
|
|
4931
|
+
__name(addInitialKeywords, "addInitialKeywords");
|
|
4688
4932
|
function getMetaSchemaOptions() {
|
|
4689
4933
|
const metaOpts = { ...this.opts };
|
|
4690
4934
|
for (const opt of META_IGNORE_OPTIONS)
|
|
4691
4935
|
delete metaOpts[opt];
|
|
4692
4936
|
return metaOpts;
|
|
4693
4937
|
}
|
|
4938
|
+
__name(getMetaSchemaOptions, "getMetaSchemaOptions");
|
|
4694
4939
|
var noLogs = { log() {
|
|
4695
4940
|
}, warn() {
|
|
4696
4941
|
}, error() {
|
|
@@ -4704,6 +4949,7 @@ var require_core = __commonJS({
|
|
|
4704
4949
|
return logger;
|
|
4705
4950
|
throw new Error("logger must implement log, warn and error methods");
|
|
4706
4951
|
}
|
|
4952
|
+
__name(getLogger, "getLogger");
|
|
4707
4953
|
var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
4708
4954
|
function checkKeyword(keyword, def) {
|
|
4709
4955
|
const { RULES } = this;
|
|
@@ -4719,6 +4965,7 @@ var require_core = __commonJS({
|
|
|
4719
4965
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
4720
4966
|
}
|
|
4721
4967
|
}
|
|
4968
|
+
__name(checkKeyword, "checkKeyword");
|
|
4722
4969
|
function addRule(keyword, definition, dataType) {
|
|
4723
4970
|
var _a;
|
|
4724
4971
|
const post = definition === null || definition === void 0 ? void 0 : definition.post;
|
|
@@ -4748,6 +4995,7 @@ var require_core = __commonJS({
|
|
|
4748
4995
|
RULES.all[keyword] = rule;
|
|
4749
4996
|
(_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
|
|
4750
4997
|
}
|
|
4998
|
+
__name(addRule, "addRule");
|
|
4751
4999
|
function addBeforeRule(ruleGroup, rule, before) {
|
|
4752
5000
|
const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
|
|
4753
5001
|
if (i >= 0) {
|
|
@@ -4757,6 +5005,7 @@ var require_core = __commonJS({
|
|
|
4757
5005
|
this.logger.warn(`rule ${before} is not defined`);
|
|
4758
5006
|
}
|
|
4759
5007
|
}
|
|
5008
|
+
__name(addBeforeRule, "addBeforeRule");
|
|
4760
5009
|
function keywordMetaschema(def) {
|
|
4761
5010
|
let { metaSchema } = def;
|
|
4762
5011
|
if (metaSchema === void 0)
|
|
@@ -4765,12 +5014,14 @@ var require_core = __commonJS({
|
|
|
4765
5014
|
metaSchema = schemaOrData(metaSchema);
|
|
4766
5015
|
def.validateSchema = this.compile(metaSchema, true);
|
|
4767
5016
|
}
|
|
5017
|
+
__name(keywordMetaschema, "keywordMetaschema");
|
|
4768
5018
|
var $dataRef = {
|
|
4769
5019
|
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
|
|
4770
5020
|
};
|
|
4771
5021
|
function schemaOrData(schema) {
|
|
4772
5022
|
return { anyOf: [schema, $dataRef] };
|
|
4773
5023
|
}
|
|
5024
|
+
__name(schemaOrData, "schemaOrData");
|
|
4774
5025
|
}
|
|
4775
5026
|
});
|
|
4776
5027
|
|
|
@@ -4822,10 +5073,12 @@ var require_ref = __commonJS({
|
|
|
4822
5073
|
const rootName = gen.scopeValue("root", { ref: root });
|
|
4823
5074
|
return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
|
|
4824
5075
|
}
|
|
5076
|
+
__name(callRootRef, "callRootRef");
|
|
4825
5077
|
function callValidate(sch) {
|
|
4826
5078
|
const v = getValidate(cxt, sch);
|
|
4827
5079
|
callRef(cxt, v, sch, sch.$async);
|
|
4828
5080
|
}
|
|
5081
|
+
__name(callValidate, "callValidate");
|
|
4829
5082
|
function inlineRefSchema(sch) {
|
|
4830
5083
|
const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
|
|
4831
5084
|
const valid = gen.name("valid");
|
|
@@ -4839,12 +5092,14 @@ var require_ref = __commonJS({
|
|
|
4839
5092
|
cxt.mergeEvaluated(schCxt);
|
|
4840
5093
|
cxt.ok(valid);
|
|
4841
5094
|
}
|
|
5095
|
+
__name(inlineRefSchema, "inlineRefSchema");
|
|
4842
5096
|
}
|
|
4843
5097
|
};
|
|
4844
5098
|
function getValidate(cxt, sch) {
|
|
4845
5099
|
const { gen } = cxt;
|
|
4846
5100
|
return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
|
|
4847
5101
|
}
|
|
5102
|
+
__name(getValidate, "getValidate");
|
|
4848
5103
|
exports.getValidate = getValidate;
|
|
4849
5104
|
function callRef(cxt, v, sch, $async) {
|
|
4850
5105
|
const { gen, it } = cxt;
|
|
@@ -4871,14 +5126,17 @@ var require_ref = __commonJS({
|
|
|
4871
5126
|
});
|
|
4872
5127
|
cxt.ok(valid);
|
|
4873
5128
|
}
|
|
5129
|
+
__name(callAsyncRef, "callAsyncRef");
|
|
4874
5130
|
function callSyncRef() {
|
|
4875
5131
|
cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
|
|
4876
5132
|
}
|
|
5133
|
+
__name(callSyncRef, "callSyncRef");
|
|
4877
5134
|
function addErrorsFrom(source) {
|
|
4878
5135
|
const errs = (0, codegen_1._)`${source}.errors`;
|
|
4879
5136
|
gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
|
|
4880
5137
|
gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
|
|
4881
5138
|
}
|
|
5139
|
+
__name(addErrorsFrom, "addErrorsFrom");
|
|
4882
5140
|
function addEvaluatedFrom(source) {
|
|
4883
5141
|
var _a;
|
|
4884
5142
|
if (!it.opts.unevaluated)
|
|
@@ -4905,7 +5163,9 @@ var require_ref = __commonJS({
|
|
|
4905
5163
|
}
|
|
4906
5164
|
}
|
|
4907
5165
|
}
|
|
5166
|
+
__name(addEvaluatedFrom, "addEvaluatedFrom");
|
|
4908
5167
|
}
|
|
5168
|
+
__name(callRef, "callRef");
|
|
4909
5169
|
exports.callRef = callRef;
|
|
4910
5170
|
exports.default = def;
|
|
4911
5171
|
}
|
|
@@ -5013,6 +5273,7 @@ var require_ucs2length = __commonJS({
|
|
|
5013
5273
|
}
|
|
5014
5274
|
return length;
|
|
5015
5275
|
}
|
|
5276
|
+
__name(ucs2length, "ucs2length");
|
|
5016
5277
|
exports.default = ucs2length;
|
|
5017
5278
|
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
5018
5279
|
}
|
|
@@ -5155,6 +5416,7 @@ var require_required = __commonJS({
|
|
|
5155
5416
|
}
|
|
5156
5417
|
}
|
|
5157
5418
|
}
|
|
5419
|
+
__name(allErrorsMode, "allErrorsMode");
|
|
5158
5420
|
function exitOnErrorMode() {
|
|
5159
5421
|
const missing = gen.let("missing");
|
|
5160
5422
|
if (useLoop || $data) {
|
|
@@ -5167,12 +5429,14 @@ var require_required = __commonJS({
|
|
|
5167
5429
|
gen.else();
|
|
5168
5430
|
}
|
|
5169
5431
|
}
|
|
5432
|
+
__name(exitOnErrorMode, "exitOnErrorMode");
|
|
5170
5433
|
function loopAllRequired() {
|
|
5171
5434
|
gen.forOf("prop", schemaCode, (prop) => {
|
|
5172
5435
|
cxt.setParams({ missingProperty: prop });
|
|
5173
5436
|
gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
|
|
5174
5437
|
});
|
|
5175
5438
|
}
|
|
5439
|
+
__name(loopAllRequired, "loopAllRequired");
|
|
5176
5440
|
function loopUntilMissing(missing, valid) {
|
|
5177
5441
|
cxt.setParams({ missingProperty: missing });
|
|
5178
5442
|
gen.forOf(missing, schemaCode, () => {
|
|
@@ -5183,6 +5447,7 @@ var require_required = __commonJS({
|
|
|
5183
5447
|
});
|
|
5184
5448
|
}, codegen_1.nil);
|
|
5185
5449
|
}
|
|
5450
|
+
__name(loopUntilMissing, "loopUntilMissing");
|
|
5186
5451
|
}
|
|
5187
5452
|
};
|
|
5188
5453
|
exports.default = def;
|
|
@@ -5263,9 +5528,11 @@ var require_uniqueItems = __commonJS({
|
|
|
5263
5528
|
gen.assign(valid, true);
|
|
5264
5529
|
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
|
|
5265
5530
|
}
|
|
5531
|
+
__name(validateUniqueItems, "validateUniqueItems");
|
|
5266
5532
|
function canOptimize() {
|
|
5267
5533
|
return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
|
|
5268
5534
|
}
|
|
5535
|
+
__name(canOptimize, "canOptimize");
|
|
5269
5536
|
function loopN(i, j) {
|
|
5270
5537
|
const item = gen.name("item");
|
|
5271
5538
|
const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
|
|
@@ -5282,6 +5549,7 @@ var require_uniqueItems = __commonJS({
|
|
|
5282
5549
|
}).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
|
|
5283
5550
|
});
|
|
5284
5551
|
}
|
|
5552
|
+
__name(loopN, "loopN");
|
|
5285
5553
|
function loopN2(i, j) {
|
|
5286
5554
|
const eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
5287
5555
|
const outer = gen.name("outer");
|
|
@@ -5290,6 +5558,7 @@ var require_uniqueItems = __commonJS({
|
|
|
5290
5558
|
gen.assign(valid, false).break(outer);
|
|
5291
5559
|
})));
|
|
5292
5560
|
}
|
|
5561
|
+
__name(loopN2, "loopN2");
|
|
5293
5562
|
}
|
|
5294
5563
|
};
|
|
5295
5564
|
exports.default = def;
|
|
@@ -5348,7 +5617,7 @@ var require_enum = __commonJS({
|
|
|
5348
5617
|
throw new Error("enum must have non-empty array");
|
|
5349
5618
|
const useLoop = schema.length >= it.opts.loopEnum;
|
|
5350
5619
|
let eql;
|
|
5351
|
-
const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
5620
|
+
const getEql = /* @__PURE__ */ __name(() => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default), "getEql");
|
|
5352
5621
|
let valid;
|
|
5353
5622
|
if (useLoop || $data) {
|
|
5354
5623
|
valid = gen.let("valid");
|
|
@@ -5364,10 +5633,12 @@ var require_enum = __commonJS({
|
|
|
5364
5633
|
gen.assign(valid, false);
|
|
5365
5634
|
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
5366
5635
|
}
|
|
5636
|
+
__name(loopEnum, "loopEnum");
|
|
5367
5637
|
function equalCode(vSchema, i) {
|
|
5368
5638
|
const sch = schema[i];
|
|
5369
5639
|
return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
|
|
5370
5640
|
}
|
|
5641
|
+
__name(equalCode, "equalCode");
|
|
5371
5642
|
}
|
|
5372
5643
|
};
|
|
5373
5644
|
exports.default = def;
|
|
@@ -5459,7 +5730,9 @@ var require_additionalItems = __commonJS({
|
|
|
5459
5730
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5460
5731
|
});
|
|
5461
5732
|
}
|
|
5733
|
+
__name(validateItems, "validateItems");
|
|
5462
5734
|
}
|
|
5735
|
+
__name(validateAdditionalItems, "validateAdditionalItems");
|
|
5463
5736
|
exports.validateAdditionalItems = validateAdditionalItems;
|
|
5464
5737
|
exports.default = def;
|
|
5465
5738
|
}
|
|
@@ -5516,7 +5789,9 @@ var require_items = __commonJS({
|
|
|
5516
5789
|
(0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
|
|
5517
5790
|
}
|
|
5518
5791
|
}
|
|
5792
|
+
__name(checkStrictTuple, "checkStrictTuple");
|
|
5519
5793
|
}
|
|
5794
|
+
__name(validateTuple, "validateTuple");
|
|
5520
5795
|
exports.validateTuple = validateTuple;
|
|
5521
5796
|
exports.default = def;
|
|
5522
5797
|
}
|
|
@@ -5639,6 +5914,7 @@ var require_contains = __commonJS({
|
|
|
5639
5914
|
const count = gen.let("count", 0);
|
|
5640
5915
|
validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
|
|
5641
5916
|
}
|
|
5917
|
+
__name(validateItemsWithCount, "validateItemsWithCount");
|
|
5642
5918
|
function validateItems(_valid, block) {
|
|
5643
5919
|
gen.forRange("i", 0, len, (i) => {
|
|
5644
5920
|
cxt.subschema({
|
|
@@ -5650,6 +5926,7 @@ var require_contains = __commonJS({
|
|
|
5650
5926
|
block();
|
|
5651
5927
|
});
|
|
5652
5928
|
}
|
|
5929
|
+
__name(validateItems, "validateItems");
|
|
5653
5930
|
function checkLimits(count) {
|
|
5654
5931
|
gen.code((0, codegen_1._)`${count}++`);
|
|
5655
5932
|
if (max === void 0) {
|
|
@@ -5662,6 +5939,7 @@ var require_contains = __commonJS({
|
|
|
5662
5939
|
gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
|
|
5663
5940
|
}
|
|
5664
5941
|
}
|
|
5942
|
+
__name(checkLimits, "checkLimits");
|
|
5665
5943
|
}
|
|
5666
5944
|
};
|
|
5667
5945
|
exports.default = def;
|
|
@@ -5710,6 +5988,7 @@ var require_dependencies = __commonJS({
|
|
|
5710
5988
|
}
|
|
5711
5989
|
return [propertyDeps, schemaDeps];
|
|
5712
5990
|
}
|
|
5991
|
+
__name(splitDependencies, "splitDependencies");
|
|
5713
5992
|
function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
|
|
5714
5993
|
const { gen, data, it } = cxt;
|
|
5715
5994
|
if (Object.keys(propertyDeps).length === 0)
|
|
@@ -5738,6 +6017,7 @@ var require_dependencies = __commonJS({
|
|
|
5738
6017
|
}
|
|
5739
6018
|
}
|
|
5740
6019
|
}
|
|
6020
|
+
__name(validatePropertyDeps, "validatePropertyDeps");
|
|
5741
6021
|
exports.validatePropertyDeps = validatePropertyDeps;
|
|
5742
6022
|
function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
|
|
5743
6023
|
const { gen, data, keyword, it } = cxt;
|
|
@@ -5757,6 +6037,7 @@ var require_dependencies = __commonJS({
|
|
|
5757
6037
|
cxt.ok(valid);
|
|
5758
6038
|
}
|
|
5759
6039
|
}
|
|
6040
|
+
__name(validateSchemaDeps, "validateSchemaDeps");
|
|
5760
6041
|
exports.validateSchemaDeps = validateSchemaDeps;
|
|
5761
6042
|
exports.default = def;
|
|
5762
6043
|
}
|
|
@@ -5845,6 +6126,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5845
6126
|
gen.if(isAdditional(key), () => additionalPropertyCode(key));
|
|
5846
6127
|
});
|
|
5847
6128
|
}
|
|
6129
|
+
__name(checkAdditionalProperties, "checkAdditionalProperties");
|
|
5848
6130
|
function isAdditional(key) {
|
|
5849
6131
|
let definedProp;
|
|
5850
6132
|
if (props.length > 8) {
|
|
@@ -5860,9 +6142,11 @@ var require_additionalProperties = __commonJS({
|
|
|
5860
6142
|
}
|
|
5861
6143
|
return (0, codegen_1.not)(definedProp);
|
|
5862
6144
|
}
|
|
6145
|
+
__name(isAdditional, "isAdditional");
|
|
5863
6146
|
function deleteAdditional(key) {
|
|
5864
6147
|
gen.code((0, codegen_1._)`delete ${data}[${key}]`);
|
|
5865
6148
|
}
|
|
6149
|
+
__name(deleteAdditional, "deleteAdditional");
|
|
5866
6150
|
function additionalPropertyCode(key) {
|
|
5867
6151
|
if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
|
|
5868
6152
|
deleteAdditional(key);
|
|
@@ -5890,6 +6174,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5890
6174
|
}
|
|
5891
6175
|
}
|
|
5892
6176
|
}
|
|
6177
|
+
__name(additionalPropertyCode, "additionalPropertyCode");
|
|
5893
6178
|
function applyAdditionalSchema(key, valid, errors) {
|
|
5894
6179
|
const subschema = {
|
|
5895
6180
|
keyword: "additionalProperties",
|
|
@@ -5905,6 +6190,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5905
6190
|
}
|
|
5906
6191
|
cxt.subschema(subschema, valid);
|
|
5907
6192
|
}
|
|
6193
|
+
__name(applyAdditionalSchema, "applyAdditionalSchema");
|
|
5908
6194
|
}
|
|
5909
6195
|
};
|
|
5910
6196
|
exports.default = def;
|
|
@@ -5956,6 +6242,7 @@ var require_properties = __commonJS({
|
|
|
5956
6242
|
function hasDefault(prop) {
|
|
5957
6243
|
return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
|
|
5958
6244
|
}
|
|
6245
|
+
__name(hasDefault, "hasDefault");
|
|
5959
6246
|
function applyPropertySchema(prop) {
|
|
5960
6247
|
cxt.subschema({
|
|
5961
6248
|
keyword: "properties",
|
|
@@ -5963,6 +6250,7 @@ var require_properties = __commonJS({
|
|
|
5963
6250
|
dataProp: prop
|
|
5964
6251
|
}, valid);
|
|
5965
6252
|
}
|
|
6253
|
+
__name(applyPropertySchema, "applyPropertySchema");
|
|
5966
6254
|
}
|
|
5967
6255
|
};
|
|
5968
6256
|
exports.default = def;
|
|
@@ -6010,6 +6298,7 @@ var require_patternProperties = __commonJS({
|
|
|
6010
6298
|
}
|
|
6011
6299
|
}
|
|
6012
6300
|
}
|
|
6301
|
+
__name(validatePatternProperties, "validatePatternProperties");
|
|
6013
6302
|
function checkMatchingProperties(pat) {
|
|
6014
6303
|
for (const prop in checkProperties) {
|
|
6015
6304
|
if (new RegExp(pat).test(prop)) {
|
|
@@ -6017,6 +6306,7 @@ var require_patternProperties = __commonJS({
|
|
|
6017
6306
|
}
|
|
6018
6307
|
}
|
|
6019
6308
|
}
|
|
6309
|
+
__name(checkMatchingProperties, "checkMatchingProperties");
|
|
6020
6310
|
function validateProperties(pat) {
|
|
6021
6311
|
gen.forIn("key", data, (key) => {
|
|
6022
6312
|
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
|
|
@@ -6037,6 +6327,7 @@ var require_patternProperties = __commonJS({
|
|
|
6037
6327
|
});
|
|
6038
6328
|
});
|
|
6039
6329
|
}
|
|
6330
|
+
__name(validateProperties, "validateProperties");
|
|
6040
6331
|
}
|
|
6041
6332
|
};
|
|
6042
6333
|
exports.default = def;
|
|
@@ -6143,6 +6434,7 @@ var require_oneOf = __commonJS({
|
|
|
6143
6434
|
});
|
|
6144
6435
|
});
|
|
6145
6436
|
}
|
|
6437
|
+
__name(validateOneOf, "validateOneOf");
|
|
6146
6438
|
}
|
|
6147
6439
|
};
|
|
6148
6440
|
exports.default = def;
|
|
@@ -6224,6 +6516,7 @@ var require_if = __commonJS({
|
|
|
6224
6516
|
}, schValid);
|
|
6225
6517
|
cxt.mergeEvaluated(schCxt);
|
|
6226
6518
|
}
|
|
6519
|
+
__name(validateIf, "validateIf");
|
|
6227
6520
|
function validateClause(keyword, ifClause) {
|
|
6228
6521
|
return () => {
|
|
6229
6522
|
const schCxt = cxt.subschema({ keyword }, schValid);
|
|
@@ -6235,12 +6528,14 @@ var require_if = __commonJS({
|
|
|
6235
6528
|
cxt.setParams({ ifClause: keyword });
|
|
6236
6529
|
};
|
|
6237
6530
|
}
|
|
6531
|
+
__name(validateClause, "validateClause");
|
|
6238
6532
|
}
|
|
6239
6533
|
};
|
|
6240
6534
|
function hasSchema(it, keyword) {
|
|
6241
6535
|
const schema = it.schema[keyword];
|
|
6242
6536
|
return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);
|
|
6243
6537
|
}
|
|
6538
|
+
__name(hasSchema, "hasSchema");
|
|
6244
6539
|
exports.default = def;
|
|
6245
6540
|
}
|
|
6246
6541
|
});
|
|
@@ -6307,6 +6602,7 @@ var require_applicator = __commonJS({
|
|
|
6307
6602
|
applicator.push(contains_1.default);
|
|
6308
6603
|
return applicator;
|
|
6309
6604
|
}
|
|
6605
|
+
__name(getApplicator, "getApplicator");
|
|
6310
6606
|
exports.default = getApplicator;
|
|
6311
6607
|
}
|
|
6312
6608
|
});
|
|
@@ -6351,12 +6647,15 @@ var require_format = __commonJS({
|
|
|
6351
6647
|
return codegen_1.nil;
|
|
6352
6648
|
return (0, codegen_1._)`${schemaCode} && !${format}`;
|
|
6353
6649
|
}
|
|
6650
|
+
__name(unknownFmt, "unknownFmt");
|
|
6354
6651
|
function invalidFmt() {
|
|
6355
6652
|
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
|
|
6356
6653
|
const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
|
|
6357
6654
|
return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
6358
6655
|
}
|
|
6656
|
+
__name(invalidFmt, "invalidFmt");
|
|
6359
6657
|
}
|
|
6658
|
+
__name(validate$DataFormat, "validate$DataFormat");
|
|
6360
6659
|
function validateFormat() {
|
|
6361
6660
|
const formatDef = self.formats[schema];
|
|
6362
6661
|
if (!formatDef) {
|
|
@@ -6377,7 +6676,9 @@ var require_format = __commonJS({
|
|
|
6377
6676
|
function unknownMsg() {
|
|
6378
6677
|
return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
|
|
6379
6678
|
}
|
|
6679
|
+
__name(unknownMsg, "unknownMsg");
|
|
6380
6680
|
}
|
|
6681
|
+
__name(unknownFormat, "unknownFormat");
|
|
6381
6682
|
function getFormat(fmtDef) {
|
|
6382
6683
|
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
|
|
6383
6684
|
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
|
|
@@ -6386,6 +6687,7 @@ var require_format = __commonJS({
|
|
|
6386
6687
|
}
|
|
6387
6688
|
return ["string", fmtDef, fmt];
|
|
6388
6689
|
}
|
|
6690
|
+
__name(getFormat, "getFormat");
|
|
6389
6691
|
function validCondition() {
|
|
6390
6692
|
if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
|
|
6391
6693
|
if (!schemaEnv.$async)
|
|
@@ -6394,7 +6696,9 @@ var require_format = __commonJS({
|
|
|
6394
6696
|
}
|
|
6395
6697
|
return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
|
|
6396
6698
|
}
|
|
6699
|
+
__name(validCondition, "validCondition");
|
|
6397
6700
|
}
|
|
6701
|
+
__name(validateFormat, "validateFormat");
|
|
6398
6702
|
}
|
|
6399
6703
|
};
|
|
6400
6704
|
exports.default = def;
|
|
@@ -6517,12 +6821,14 @@ var require_discriminator = __commonJS({
|
|
|
6517
6821
|
cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
|
|
6518
6822
|
gen.endIf();
|
|
6519
6823
|
}
|
|
6824
|
+
__name(validateMapping, "validateMapping");
|
|
6520
6825
|
function applyTagSchema(schemaProp) {
|
|
6521
6826
|
const _valid = gen.name("valid");
|
|
6522
6827
|
const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
|
|
6523
6828
|
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
6524
6829
|
return _valid;
|
|
6525
6830
|
}
|
|
6831
|
+
__name(applyTagSchema, "applyTagSchema");
|
|
6526
6832
|
function getMapping() {
|
|
6527
6833
|
var _a;
|
|
6528
6834
|
const oneOfMapping = {};
|
|
@@ -6548,6 +6854,7 @@ var require_discriminator = __commonJS({
|
|
|
6548
6854
|
function hasRequired({ required }) {
|
|
6549
6855
|
return Array.isArray(required) && required.includes(tagName);
|
|
6550
6856
|
}
|
|
6857
|
+
__name(hasRequired, "hasRequired");
|
|
6551
6858
|
function addMappings(sch, i) {
|
|
6552
6859
|
if (sch.const) {
|
|
6553
6860
|
addMapping(sch.const, i);
|
|
@@ -6559,13 +6866,16 @@ var require_discriminator = __commonJS({
|
|
|
6559
6866
|
throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
|
|
6560
6867
|
}
|
|
6561
6868
|
}
|
|
6869
|
+
__name(addMappings, "addMappings");
|
|
6562
6870
|
function addMapping(tagValue, i) {
|
|
6563
6871
|
if (typeof tagValue != "string" || tagValue in oneOfMapping) {
|
|
6564
6872
|
throw new Error(`discriminator: "${tagName}" values must be unique strings`);
|
|
6565
6873
|
}
|
|
6566
6874
|
oneOfMapping[tagValue] = i;
|
|
6567
6875
|
}
|
|
6876
|
+
__name(addMapping, "addMapping");
|
|
6568
6877
|
}
|
|
6878
|
+
__name(getMapping, "getMapping");
|
|
6569
6879
|
}
|
|
6570
6880
|
};
|
|
6571
6881
|
exports.default = def;
|
|
@@ -6760,6 +7070,7 @@ var require_ajv = __commonJS({
|
|
|
6760
7070
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
|
|
6761
7071
|
}
|
|
6762
7072
|
};
|
|
7073
|
+
__name(Ajv, "Ajv");
|
|
6763
7074
|
module.exports = exports = Ajv;
|
|
6764
7075
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6765
7076
|
exports.default = Ajv;
|
|
@@ -6806,6 +7117,7 @@ var require_formats = __commonJS({
|
|
|
6806
7117
|
function fmtDef(validate, compare) {
|
|
6807
7118
|
return { validate, compare };
|
|
6808
7119
|
}
|
|
7120
|
+
__name(fmtDef, "fmtDef");
|
|
6809
7121
|
exports.fullFormats = {
|
|
6810
7122
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
6811
7123
|
date: fmtDef(date, compareDate),
|
|
@@ -6868,6 +7180,7 @@ var require_formats = __commonJS({
|
|
|
6868
7180
|
function isLeapYear(year) {
|
|
6869
7181
|
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
6870
7182
|
}
|
|
7183
|
+
__name(isLeapYear, "isLeapYear");
|
|
6871
7184
|
var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
6872
7185
|
var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
6873
7186
|
function date(str) {
|
|
@@ -6879,6 +7192,7 @@ var require_formats = __commonJS({
|
|
|
6879
7192
|
const day = +matches[3];
|
|
6880
7193
|
return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
|
|
6881
7194
|
}
|
|
7195
|
+
__name(date, "date");
|
|
6882
7196
|
function compareDate(d1, d2) {
|
|
6883
7197
|
if (!(d1 && d2))
|
|
6884
7198
|
return void 0;
|
|
@@ -6888,6 +7202,7 @@ var require_formats = __commonJS({
|
|
|
6888
7202
|
return -1;
|
|
6889
7203
|
return 0;
|
|
6890
7204
|
}
|
|
7205
|
+
__name(compareDate, "compareDate");
|
|
6891
7206
|
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
6892
7207
|
function time(str, withTimeZone) {
|
|
6893
7208
|
const matches = TIME.exec(str);
|
|
@@ -6899,6 +7214,7 @@ var require_formats = __commonJS({
|
|
|
6899
7214
|
const timeZone = matches[5];
|
|
6900
7215
|
return (hour <= 23 && minute <= 59 && second <= 59 || hour === 23 && minute === 59 && second === 60) && (!withTimeZone || timeZone !== "");
|
|
6901
7216
|
}
|
|
7217
|
+
__name(time, "time");
|
|
6902
7218
|
function compareTime(t1, t2) {
|
|
6903
7219
|
if (!(t1 && t2))
|
|
6904
7220
|
return void 0;
|
|
@@ -6914,11 +7230,13 @@ var require_formats = __commonJS({
|
|
|
6914
7230
|
return -1;
|
|
6915
7231
|
return 0;
|
|
6916
7232
|
}
|
|
7233
|
+
__name(compareTime, "compareTime");
|
|
6917
7234
|
var DATE_TIME_SEPARATOR = /t|\s/i;
|
|
6918
7235
|
function date_time(str) {
|
|
6919
7236
|
const dateTime = str.split(DATE_TIME_SEPARATOR);
|
|
6920
7237
|
return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true);
|
|
6921
7238
|
}
|
|
7239
|
+
__name(date_time, "date_time");
|
|
6922
7240
|
function compareDateTime(dt1, dt2) {
|
|
6923
7241
|
if (!(dt1 && dt2))
|
|
6924
7242
|
return void 0;
|
|
@@ -6929,27 +7247,33 @@ var require_formats = __commonJS({
|
|
|
6929
7247
|
return void 0;
|
|
6930
7248
|
return res || compareTime(t1, t2);
|
|
6931
7249
|
}
|
|
7250
|
+
__name(compareDateTime, "compareDateTime");
|
|
6932
7251
|
var NOT_URI_FRAGMENT = /\/|:/;
|
|
6933
7252
|
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
6934
7253
|
function uri(str) {
|
|
6935
7254
|
return NOT_URI_FRAGMENT.test(str) && URI.test(str);
|
|
6936
7255
|
}
|
|
7256
|
+
__name(uri, "uri");
|
|
6937
7257
|
var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
6938
7258
|
function byte(str) {
|
|
6939
7259
|
BYTE.lastIndex = 0;
|
|
6940
7260
|
return BYTE.test(str);
|
|
6941
7261
|
}
|
|
7262
|
+
__name(byte, "byte");
|
|
6942
7263
|
var MIN_INT32 = -(2 ** 31);
|
|
6943
7264
|
var MAX_INT32 = 2 ** 31 - 1;
|
|
6944
7265
|
function validateInt32(value) {
|
|
6945
7266
|
return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
|
|
6946
7267
|
}
|
|
7268
|
+
__name(validateInt32, "validateInt32");
|
|
6947
7269
|
function validateInt64(value) {
|
|
6948
7270
|
return Number.isInteger(value);
|
|
6949
7271
|
}
|
|
7272
|
+
__name(validateInt64, "validateInt64");
|
|
6950
7273
|
function validateNumber() {
|
|
6951
7274
|
return true;
|
|
6952
7275
|
}
|
|
7276
|
+
__name(validateNumber, "validateNumber");
|
|
6953
7277
|
var Z_ANCHOR = /[^\\]\\Z/;
|
|
6954
7278
|
function regex(str) {
|
|
6955
7279
|
if (Z_ANCHOR.test(str))
|
|
@@ -6961,6 +7285,7 @@ var require_formats = __commonJS({
|
|
|
6961
7285
|
return false;
|
|
6962
7286
|
}
|
|
6963
7287
|
}
|
|
7288
|
+
__name(regex, "regex");
|
|
6964
7289
|
}
|
|
6965
7290
|
});
|
|
6966
7291
|
|
|
@@ -7007,6 +7332,7 @@ var require_limit = __commonJS({
|
|
|
7007
7332
|
const fmt = gen.const("fmt", codegen_1._`${fmts}[${fCxt.schemaCode}]`);
|
|
7008
7333
|
cxt.fail$data(codegen_1.or(codegen_1._`typeof ${fmt} != "object"`, codegen_1._`${fmt} instanceof RegExp`, codegen_1._`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
|
|
7009
7334
|
}
|
|
7335
|
+
__name(validate$DataFormat, "validate$DataFormat");
|
|
7010
7336
|
function validateFormat() {
|
|
7011
7337
|
const format = fCxt.schema;
|
|
7012
7338
|
const fmtDef = self.formats[format];
|
|
@@ -7022,16 +7348,18 @@ var require_limit = __commonJS({
|
|
|
7022
7348
|
});
|
|
7023
7349
|
cxt.fail$data(compareCode(fmt));
|
|
7024
7350
|
}
|
|
7351
|
+
__name(validateFormat, "validateFormat");
|
|
7025
7352
|
function compareCode(fmt) {
|
|
7026
7353
|
return codegen_1._`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
|
|
7027
7354
|
}
|
|
7355
|
+
__name(compareCode, "compareCode");
|
|
7028
7356
|
},
|
|
7029
7357
|
dependencies: ["format"]
|
|
7030
7358
|
};
|
|
7031
|
-
var formatLimitPlugin = (ajv) => {
|
|
7359
|
+
var formatLimitPlugin = /* @__PURE__ */ __name((ajv) => {
|
|
7032
7360
|
ajv.addKeyword(exports.formatLimitDefinition);
|
|
7033
7361
|
return ajv;
|
|
7034
|
-
};
|
|
7362
|
+
}, "formatLimitPlugin");
|
|
7035
7363
|
exports.default = formatLimitPlugin;
|
|
7036
7364
|
}
|
|
7037
7365
|
});
|
|
@@ -7046,7 +7374,7 @@ var require_dist = __commonJS({
|
|
|
7046
7374
|
var codegen_1 = require_codegen();
|
|
7047
7375
|
var fullName = new codegen_1.Name("fullFormats");
|
|
7048
7376
|
var fastName = new codegen_1.Name("fastFormats");
|
|
7049
|
-
var formatsPlugin = (ajv, opts = { keywords: true }) => {
|
|
7377
|
+
var formatsPlugin = /* @__PURE__ */ __name((ajv, opts = { keywords: true }) => {
|
|
7050
7378
|
if (Array.isArray(opts)) {
|
|
7051
7379
|
addFormats(ajv, opts, formats_1.fullFormats, fullName);
|
|
7052
7380
|
return ajv;
|
|
@@ -7057,7 +7385,7 @@ var require_dist = __commonJS({
|
|
|
7057
7385
|
if (opts.keywords)
|
|
7058
7386
|
limit_1.default(ajv);
|
|
7059
7387
|
return ajv;
|
|
7060
|
-
};
|
|
7388
|
+
}, "formatsPlugin");
|
|
7061
7389
|
formatsPlugin.get = (name, mode = "full") => {
|
|
7062
7390
|
const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
|
|
7063
7391
|
const f = formats[name];
|
|
@@ -7072,6 +7400,7 @@ var require_dist = __commonJS({
|
|
|
7072
7400
|
for (const f of list)
|
|
7073
7401
|
ajv.addFormat(f, fs[f]);
|
|
7074
7402
|
}
|
|
7403
|
+
__name(addFormats, "addFormats");
|
|
7075
7404
|
module.exports = exports = formatsPlugin;
|
|
7076
7405
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7077
7406
|
exports.default = formatsPlugin;
|
|
@@ -7259,12 +7588,12 @@ var require_schema = __commonJS({
|
|
|
7259
7588
|
ajv.addSchema(commonDefs);
|
|
7260
7589
|
ajv.addSchema(deviceDefs);
|
|
7261
7590
|
module.exports = {
|
|
7262
|
-
add: function add(schema) {
|
|
7591
|
+
add: /* @__PURE__ */ __name(function add(schema) {
|
|
7263
7592
|
ajv.addSchema(schema);
|
|
7264
|
-
},
|
|
7265
|
-
compile: function compile(schema) {
|
|
7593
|
+
}, "add"),
|
|
7594
|
+
compile: /* @__PURE__ */ __name(function compile(schema) {
|
|
7266
7595
|
return ajv.compile(schema);
|
|
7267
|
-
}
|
|
7596
|
+
}, "compile")
|
|
7268
7597
|
};
|
|
7269
7598
|
}
|
|
7270
7599
|
});
|