@absolutejs/rag 0.17.0 → 0.18.0
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/CHANGELOG.md +6 -0
- package/README.md +4 -0
- package/RESEARCH.md +269 -0
- package/changelog.json +245 -235
- package/dist/angular/index.js +174 -2
- package/dist/angular/index.js.map +6 -4
- package/dist/client/index.js +149 -1
- package/dist/client/index.js.map +5 -4
- package/dist/client/research.js +223 -0
- package/dist/client/research.js.map +10 -0
- package/dist/manifest.js +3722 -269
- package/dist/manifest.js.map +29 -3
- package/dist/react/index.js +158 -2
- package/dist/react/index.js.map +6 -4
- package/dist/research/index.js +125277 -0
- package/dist/research/index.js.map +368 -0
- package/dist/src/angular/index.d.ts +1 -0
- package/dist/src/angular/research.service.d.ts +12 -0
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/client/research.d.ts +30 -0
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/react/useResearch.d.ts +9 -0
- package/dist/src/research/budget.d.ts +26 -0
- package/dist/src/research/evaluation.d.ts +42 -0
- package/dist/src/research/evidence.d.ts +21 -0
- package/dist/src/research/index.d.ts +9 -0
- package/dist/src/research/manifest.d.ts +18 -0
- package/dist/src/research/plugin.d.ts +230 -0
- package/dist/src/research/runtime.d.ts +2 -0
- package/dist/src/research/store.d.ts +29 -0
- package/dist/src/research/types.d.ts +95 -0
- package/dist/src/research/workflows.d.ts +96 -0
- package/dist/src/svelte/createResearch.d.ts +9 -0
- package/dist/src/svelte/index.d.ts +1 -0
- package/dist/src/vue/index.d.ts +1 -0
- package/dist/src/vue/useResearch.d.ts +9 -0
- package/dist/svelte/index.js +164 -2
- package/dist/svelte/index.js.map +6 -4
- package/dist/vue/index.js +164 -2
- package/dist/vue/index.js.map +6 -4
- package/package.json +21 -5
package/dist/manifest.js
CHANGED
|
@@ -47,8 +47,37 @@ var __export = (target, all) => {
|
|
|
47
47
|
};
|
|
48
48
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
49
|
var __require = import.meta.require;
|
|
50
|
-
|
|
51
50
|
// node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
51
|
+
function IsAsyncIterator(value) {
|
|
52
|
+
return IsObject(value) && globalThis.Symbol.asyncIterator in value;
|
|
53
|
+
}
|
|
54
|
+
function IsIterator(value) {
|
|
55
|
+
return IsObject(value) && globalThis.Symbol.iterator in value;
|
|
56
|
+
}
|
|
57
|
+
function IsStandardObject(value) {
|
|
58
|
+
return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null);
|
|
59
|
+
}
|
|
60
|
+
function IsPromise(value) {
|
|
61
|
+
return value instanceof globalThis.Promise;
|
|
62
|
+
}
|
|
63
|
+
function IsDate(value) {
|
|
64
|
+
return value instanceof Date && globalThis.Number.isFinite(value.getTime());
|
|
65
|
+
}
|
|
66
|
+
function IsMap(value) {
|
|
67
|
+
return value instanceof globalThis.Map;
|
|
68
|
+
}
|
|
69
|
+
function IsSet(value) {
|
|
70
|
+
return value instanceof globalThis.Set;
|
|
71
|
+
}
|
|
72
|
+
function IsTypedArray(value) {
|
|
73
|
+
return globalThis.ArrayBuffer.isView(value);
|
|
74
|
+
}
|
|
75
|
+
function IsUint8Array(value) {
|
|
76
|
+
return value instanceof globalThis.Uint8Array;
|
|
77
|
+
}
|
|
78
|
+
function HasPropertyKey(value, key) {
|
|
79
|
+
return key in value;
|
|
80
|
+
}
|
|
52
81
|
function IsObject(value) {
|
|
53
82
|
return value !== null && typeof value === "object";
|
|
54
83
|
}
|
|
@@ -58,10 +87,33 @@ function IsArray(value) {
|
|
|
58
87
|
function IsUndefined(value) {
|
|
59
88
|
return value === undefined;
|
|
60
89
|
}
|
|
90
|
+
function IsNull(value) {
|
|
91
|
+
return value === null;
|
|
92
|
+
}
|
|
93
|
+
function IsBoolean(value) {
|
|
94
|
+
return typeof value === "boolean";
|
|
95
|
+
}
|
|
61
96
|
function IsNumber(value) {
|
|
62
97
|
return typeof value === "number";
|
|
63
98
|
}
|
|
64
|
-
|
|
99
|
+
function IsInteger(value) {
|
|
100
|
+
return globalThis.Number.isInteger(value);
|
|
101
|
+
}
|
|
102
|
+
function IsBigInt(value) {
|
|
103
|
+
return typeof value === "bigint";
|
|
104
|
+
}
|
|
105
|
+
function IsString(value) {
|
|
106
|
+
return typeof value === "string";
|
|
107
|
+
}
|
|
108
|
+
function IsFunction(value) {
|
|
109
|
+
return typeof value === "function";
|
|
110
|
+
}
|
|
111
|
+
function IsSymbol(value) {
|
|
112
|
+
return typeof value === "symbol";
|
|
113
|
+
}
|
|
114
|
+
function IsValueType(value) {
|
|
115
|
+
return IsBigInt(value) || IsBoolean(value) || IsNull(value) || IsNumber(value) || IsString(value) || IsSymbol(value) || IsUndefined(value);
|
|
116
|
+
}
|
|
65
117
|
// node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
66
118
|
var TypeSystemPolicy;
|
|
67
119
|
(function(TypeSystemPolicy2) {
|
|
@@ -94,51 +146,109 @@ var TypeSystemPolicy;
|
|
|
94
146
|
TypeSystemPolicy2.IsVoidLike = IsVoidLike;
|
|
95
147
|
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
96
148
|
|
|
149
|
+
// node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs
|
|
150
|
+
var exports_format = {};
|
|
151
|
+
__export(exports_format, {
|
|
152
|
+
Clear: () => Clear,
|
|
153
|
+
Delete: () => Delete,
|
|
154
|
+
Entries: () => Entries,
|
|
155
|
+
Get: () => Get,
|
|
156
|
+
Has: () => Has,
|
|
157
|
+
Set: () => Set2
|
|
158
|
+
});
|
|
159
|
+
var map = new Map;
|
|
160
|
+
function Entries() {
|
|
161
|
+
return new Map(map);
|
|
162
|
+
}
|
|
163
|
+
function Clear() {
|
|
164
|
+
return map.clear();
|
|
165
|
+
}
|
|
166
|
+
function Delete(format) {
|
|
167
|
+
return map.delete(format);
|
|
168
|
+
}
|
|
169
|
+
function Has(format) {
|
|
170
|
+
return map.has(format);
|
|
171
|
+
}
|
|
172
|
+
function Set2(format, func) {
|
|
173
|
+
map.set(format, func);
|
|
174
|
+
}
|
|
175
|
+
function Get(format) {
|
|
176
|
+
return map.get(format);
|
|
177
|
+
}
|
|
178
|
+
// node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs
|
|
179
|
+
var exports_type = {};
|
|
180
|
+
__export(exports_type, {
|
|
181
|
+
Clear: () => Clear2,
|
|
182
|
+
Delete: () => Delete2,
|
|
183
|
+
Entries: () => Entries2,
|
|
184
|
+
Get: () => Get2,
|
|
185
|
+
Has: () => Has2,
|
|
186
|
+
Set: () => Set3
|
|
187
|
+
});
|
|
188
|
+
var map2 = new Map;
|
|
189
|
+
function Entries2() {
|
|
190
|
+
return new Map(map2);
|
|
191
|
+
}
|
|
192
|
+
function Clear2() {
|
|
193
|
+
return map2.clear();
|
|
194
|
+
}
|
|
195
|
+
function Delete2(kind) {
|
|
196
|
+
return map2.delete(kind);
|
|
197
|
+
}
|
|
198
|
+
function Has2(kind) {
|
|
199
|
+
return map2.has(kind);
|
|
200
|
+
}
|
|
201
|
+
function Set3(kind, func) {
|
|
202
|
+
map2.set(kind, func);
|
|
203
|
+
}
|
|
204
|
+
function Get2(kind) {
|
|
205
|
+
return map2.get(kind);
|
|
206
|
+
}
|
|
97
207
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
98
208
|
var exports_value = {};
|
|
99
209
|
__export(exports_value, {
|
|
100
|
-
HasPropertyKey: () =>
|
|
210
|
+
HasPropertyKey: () => HasPropertyKey2,
|
|
101
211
|
IsArray: () => IsArray2,
|
|
102
|
-
IsAsyncIterator: () =>
|
|
103
|
-
IsBigInt: () =>
|
|
104
|
-
IsBoolean: () =>
|
|
105
|
-
IsDate: () =>
|
|
106
|
-
IsFunction: () =>
|
|
107
|
-
IsIterator: () =>
|
|
108
|
-
IsNull: () =>
|
|
212
|
+
IsAsyncIterator: () => IsAsyncIterator2,
|
|
213
|
+
IsBigInt: () => IsBigInt2,
|
|
214
|
+
IsBoolean: () => IsBoolean2,
|
|
215
|
+
IsDate: () => IsDate2,
|
|
216
|
+
IsFunction: () => IsFunction2,
|
|
217
|
+
IsIterator: () => IsIterator2,
|
|
218
|
+
IsNull: () => IsNull2,
|
|
109
219
|
IsNumber: () => IsNumber2,
|
|
110
220
|
IsObject: () => IsObject2,
|
|
111
221
|
IsRegExp: () => IsRegExp,
|
|
112
|
-
IsString: () =>
|
|
113
|
-
IsSymbol: () =>
|
|
114
|
-
IsUint8Array: () =>
|
|
222
|
+
IsString: () => IsString2,
|
|
223
|
+
IsSymbol: () => IsSymbol2,
|
|
224
|
+
IsUint8Array: () => IsUint8Array2,
|
|
115
225
|
IsUndefined: () => IsUndefined2
|
|
116
226
|
});
|
|
117
|
-
function
|
|
227
|
+
function HasPropertyKey2(value, key) {
|
|
118
228
|
return key in value;
|
|
119
229
|
}
|
|
120
|
-
function
|
|
121
|
-
return IsObject2(value) && !IsArray2(value) && !
|
|
230
|
+
function IsAsyncIterator2(value) {
|
|
231
|
+
return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.asyncIterator in value;
|
|
122
232
|
}
|
|
123
233
|
function IsArray2(value) {
|
|
124
234
|
return Array.isArray(value);
|
|
125
235
|
}
|
|
126
|
-
function
|
|
236
|
+
function IsBigInt2(value) {
|
|
127
237
|
return typeof value === "bigint";
|
|
128
238
|
}
|
|
129
|
-
function
|
|
239
|
+
function IsBoolean2(value) {
|
|
130
240
|
return typeof value === "boolean";
|
|
131
241
|
}
|
|
132
|
-
function
|
|
242
|
+
function IsDate2(value) {
|
|
133
243
|
return value instanceof globalThis.Date;
|
|
134
244
|
}
|
|
135
|
-
function
|
|
245
|
+
function IsFunction2(value) {
|
|
136
246
|
return typeof value === "function";
|
|
137
247
|
}
|
|
138
|
-
function
|
|
139
|
-
return IsObject2(value) && !IsArray2(value) && !
|
|
248
|
+
function IsIterator2(value) {
|
|
249
|
+
return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.iterator in value;
|
|
140
250
|
}
|
|
141
|
-
function
|
|
251
|
+
function IsNull2(value) {
|
|
142
252
|
return value === null;
|
|
143
253
|
}
|
|
144
254
|
function IsNumber2(value) {
|
|
@@ -150,13 +260,13 @@ function IsObject2(value) {
|
|
|
150
260
|
function IsRegExp(value) {
|
|
151
261
|
return value instanceof globalThis.RegExp;
|
|
152
262
|
}
|
|
153
|
-
function
|
|
263
|
+
function IsString2(value) {
|
|
154
264
|
return typeof value === "string";
|
|
155
265
|
}
|
|
156
|
-
function
|
|
266
|
+
function IsSymbol2(value) {
|
|
157
267
|
return typeof value === "symbol";
|
|
158
268
|
}
|
|
159
|
-
function
|
|
269
|
+
function IsUint8Array2(value) {
|
|
160
270
|
return value instanceof globalThis.Uint8Array;
|
|
161
271
|
}
|
|
162
272
|
function IsUndefined2(value) {
|
|
@@ -187,7 +297,7 @@ function ImmutableObject(value) {
|
|
|
187
297
|
return globalThis.Object.freeze(result);
|
|
188
298
|
}
|
|
189
299
|
function Immutable(value) {
|
|
190
|
-
return IsArray2(value) ? ImmutableArray(value) :
|
|
300
|
+
return IsArray2(value) ? ImmutableArray(value) : IsDate2(value) ? ImmutableDate(value) : IsUint8Array2(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject2(value) ? ImmutableObject(value) : value;
|
|
191
301
|
}
|
|
192
302
|
|
|
193
303
|
// node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
|
|
@@ -214,7 +324,7 @@ function ObjectType(value) {
|
|
|
214
324
|
return result;
|
|
215
325
|
}
|
|
216
326
|
function Visit(value) {
|
|
217
|
-
return IsArray2(value) ? ArrayType(value) :
|
|
327
|
+
return IsArray2(value) ? ArrayType(value) : IsDate2(value) ? DateType(value) : IsUint8Array2(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject2(value) ? ObjectType(value) : value;
|
|
218
328
|
}
|
|
219
329
|
function Clone(value) {
|
|
220
330
|
return Visit(value);
|
|
@@ -315,13 +425,13 @@ function IsArgument(value) {
|
|
|
315
425
|
function IsArray3(value) {
|
|
316
426
|
return IsKindOf(value, "Array");
|
|
317
427
|
}
|
|
318
|
-
function
|
|
428
|
+
function IsAsyncIterator3(value) {
|
|
319
429
|
return IsKindOf(value, "AsyncIterator");
|
|
320
430
|
}
|
|
321
|
-
function
|
|
431
|
+
function IsBigInt3(value) {
|
|
322
432
|
return IsKindOf(value, "BigInt");
|
|
323
433
|
}
|
|
324
|
-
function
|
|
434
|
+
function IsBoolean3(value) {
|
|
325
435
|
return IsKindOf(value, "Boolean");
|
|
326
436
|
}
|
|
327
437
|
function IsComputed(value) {
|
|
@@ -330,26 +440,26 @@ function IsComputed(value) {
|
|
|
330
440
|
function IsConstructor(value) {
|
|
331
441
|
return IsKindOf(value, "Constructor");
|
|
332
442
|
}
|
|
333
|
-
function
|
|
443
|
+
function IsDate3(value) {
|
|
334
444
|
return IsKindOf(value, "Date");
|
|
335
445
|
}
|
|
336
|
-
function
|
|
446
|
+
function IsFunction3(value) {
|
|
337
447
|
return IsKindOf(value, "Function");
|
|
338
448
|
}
|
|
339
|
-
function
|
|
449
|
+
function IsInteger2(value) {
|
|
340
450
|
return IsKindOf(value, "Integer");
|
|
341
451
|
}
|
|
342
452
|
function IsIntersect(value) {
|
|
343
453
|
return IsKindOf(value, "Intersect");
|
|
344
454
|
}
|
|
345
|
-
function
|
|
455
|
+
function IsIterator3(value) {
|
|
346
456
|
return IsKindOf(value, "Iterator");
|
|
347
457
|
}
|
|
348
458
|
function IsKindOf(value, kind) {
|
|
349
459
|
return IsObject2(value) && Kind in value && value[Kind] === kind;
|
|
350
460
|
}
|
|
351
461
|
function IsLiteralValue(value) {
|
|
352
|
-
return
|
|
462
|
+
return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
|
|
353
463
|
}
|
|
354
464
|
function IsLiteral(value) {
|
|
355
465
|
return IsKindOf(value, "Literal");
|
|
@@ -366,7 +476,7 @@ function IsNever(value) {
|
|
|
366
476
|
function IsNot(value) {
|
|
367
477
|
return IsKindOf(value, "Not");
|
|
368
478
|
}
|
|
369
|
-
function
|
|
479
|
+
function IsNull3(value) {
|
|
370
480
|
return IsKindOf(value, "Null");
|
|
371
481
|
}
|
|
372
482
|
function IsNumber3(value) {
|
|
@@ -375,7 +485,7 @@ function IsNumber3(value) {
|
|
|
375
485
|
function IsObject3(value) {
|
|
376
486
|
return IsKindOf(value, "Object");
|
|
377
487
|
}
|
|
378
|
-
function
|
|
488
|
+
function IsPromise2(value) {
|
|
379
489
|
return IsKindOf(value, "Promise");
|
|
380
490
|
}
|
|
381
491
|
function IsRecord(value) {
|
|
@@ -387,10 +497,10 @@ function IsRef(value) {
|
|
|
387
497
|
function IsRegExp2(value) {
|
|
388
498
|
return IsKindOf(value, "RegExp");
|
|
389
499
|
}
|
|
390
|
-
function
|
|
500
|
+
function IsString3(value) {
|
|
391
501
|
return IsKindOf(value, "String");
|
|
392
502
|
}
|
|
393
|
-
function
|
|
503
|
+
function IsSymbol3(value) {
|
|
394
504
|
return IsKindOf(value, "Symbol");
|
|
395
505
|
}
|
|
396
506
|
function IsTemplateLiteral(value) {
|
|
@@ -411,7 +521,7 @@ function IsUndefined3(value) {
|
|
|
411
521
|
function IsUnion(value) {
|
|
412
522
|
return IsKindOf(value, "Union");
|
|
413
523
|
}
|
|
414
|
-
function
|
|
524
|
+
function IsUint8Array3(value) {
|
|
415
525
|
return IsKindOf(value, "Uint8Array");
|
|
416
526
|
}
|
|
417
527
|
function IsUnknown(value) {
|
|
@@ -424,10 +534,10 @@ function IsVoid(value) {
|
|
|
424
534
|
return IsKindOf(value, "Void");
|
|
425
535
|
}
|
|
426
536
|
function IsKind(value) {
|
|
427
|
-
return IsObject2(value) && Kind in value &&
|
|
537
|
+
return IsObject2(value) && Kind in value && IsString2(value[Kind]);
|
|
428
538
|
}
|
|
429
539
|
function IsSchema(value) {
|
|
430
|
-
return IsAny(value) || IsArgument(value) || IsArray3(value) ||
|
|
540
|
+
return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed(value) || IsConstructor(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect(value) || IsIterator3(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array3(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
|
|
431
541
|
}
|
|
432
542
|
|
|
433
543
|
// node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
@@ -722,7 +832,7 @@ function Boolean2(options) {
|
|
|
722
832
|
}
|
|
723
833
|
|
|
724
834
|
// node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
725
|
-
function
|
|
835
|
+
function BigInt2(options) {
|
|
726
836
|
return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
|
|
727
837
|
}
|
|
728
838
|
|
|
@@ -739,7 +849,7 @@ function String2(options) {
|
|
|
739
849
|
// node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
740
850
|
function* FromUnion(syntax) {
|
|
741
851
|
const trim = syntax.trim().replace(/"|'/g, "");
|
|
742
|
-
return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield
|
|
852
|
+
return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => {
|
|
743
853
|
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
744
854
|
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
745
855
|
})();
|
|
@@ -790,7 +900,7 @@ function Escape(value) {
|
|
|
790
900
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
791
901
|
}
|
|
792
902
|
function Visit2(schema, acc) {
|
|
793
|
-
return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` :
|
|
903
|
+
return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` : IsInteger2(schema) ? `${acc}${PatternNumber}` : IsBigInt3(schema) ? `${acc}${PatternNumber}` : IsString3(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean3(schema) ? `${acc}${PatternBoolean}` : (() => {
|
|
794
904
|
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
795
905
|
})();
|
|
796
906
|
}
|
|
@@ -807,7 +917,7 @@ function TemplateLiteralToUnion(schema) {
|
|
|
807
917
|
|
|
808
918
|
// node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
809
919
|
function TemplateLiteral(unresolved, options) {
|
|
810
|
-
const pattern =
|
|
920
|
+
const pattern = IsString2(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
811
921
|
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
812
922
|
}
|
|
813
923
|
|
|
@@ -826,7 +936,7 @@ function FromLiteral(literalValue) {
|
|
|
826
936
|
return [literalValue.toString()];
|
|
827
937
|
}
|
|
828
938
|
function IndexPropertyKeys(type) {
|
|
829
|
-
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] :
|
|
939
|
+
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger2(type) ? ["[number]"] : [])];
|
|
830
940
|
}
|
|
831
941
|
|
|
832
942
|
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
@@ -1022,7 +1132,7 @@ function FromProperties4(K, T) {
|
|
|
1022
1132
|
}
|
|
1023
1133
|
function FromSchemaType(K, T) {
|
|
1024
1134
|
const options = { ...T };
|
|
1025
|
-
return IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : IsMappedResult(T) ? FromMappedResult4(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) :
|
|
1135
|
+
return IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : IsMappedResult(T) ? FromMappedResult4(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction3(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator3(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator3(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties4(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise2(T) ? Promise2(FromSchemaType(K, T.item), options) : T;
|
|
1026
1136
|
}
|
|
1027
1137
|
function MappedFunctionReturnType(K, T) {
|
|
1028
1138
|
const Acc = {};
|
|
@@ -1030,9 +1140,9 @@ function MappedFunctionReturnType(K, T) {
|
|
|
1030
1140
|
Acc[L] = FromSchemaType(L, T);
|
|
1031
1141
|
return Acc;
|
|
1032
1142
|
}
|
|
1033
|
-
function Mapped(key,
|
|
1143
|
+
function Mapped(key, map3, options) {
|
|
1034
1144
|
const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
1035
|
-
const RT =
|
|
1145
|
+
const RT = map3({ [Kind]: "MappedKey", keys: K });
|
|
1036
1146
|
const R = MappedFunctionReturnType(K, RT);
|
|
1037
1147
|
return Object2(R, options);
|
|
1038
1148
|
}
|
|
@@ -1083,6 +1193,13 @@ function KeyOfPropertyKeys(type) {
|
|
|
1083
1193
|
return IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
|
|
1084
1194
|
}
|
|
1085
1195
|
var includePatternProperties = false;
|
|
1196
|
+
function KeyOfPattern(schema) {
|
|
1197
|
+
includePatternProperties = true;
|
|
1198
|
+
const keys = KeyOfPropertyKeys(schema);
|
|
1199
|
+
includePatternProperties = false;
|
|
1200
|
+
const pattern = keys.map((key) => `(${key})`);
|
|
1201
|
+
return `^(${pattern.join("|")})$`;
|
|
1202
|
+
}
|
|
1086
1203
|
|
|
1087
1204
|
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1088
1205
|
function FromComputed(target, parameters) {
|
|
@@ -1119,6 +1236,317 @@ function KeyOfFromMappedResult(mappedResult, options) {
|
|
|
1119
1236
|
return MappedResult(properties);
|
|
1120
1237
|
}
|
|
1121
1238
|
|
|
1239
|
+
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs
|
|
1240
|
+
function KeyOfPropertyEntries(schema) {
|
|
1241
|
+
const keys = KeyOfPropertyKeys(schema);
|
|
1242
|
+
const schemas = IndexFromPropertyKeys(schema, keys);
|
|
1243
|
+
return keys.map((_, index) => [keys[index], schemas[index]]);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs
|
|
1247
|
+
function Intersect2(schema) {
|
|
1248
|
+
return schema.allOf.every((schema2) => ExtendsUndefinedCheck(schema2));
|
|
1249
|
+
}
|
|
1250
|
+
function Union2(schema) {
|
|
1251
|
+
return schema.anyOf.some((schema2) => ExtendsUndefinedCheck(schema2));
|
|
1252
|
+
}
|
|
1253
|
+
function Not(schema) {
|
|
1254
|
+
return !ExtendsUndefinedCheck(schema.not);
|
|
1255
|
+
}
|
|
1256
|
+
function ExtendsUndefinedCheck(schema) {
|
|
1257
|
+
return schema[Kind] === "Intersect" ? Intersect2(schema) : schema[Kind] === "Union" ? Union2(schema) : schema[Kind] === "Not" ? Not(schema) : schema[Kind] === "Undefined" ? true : false;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
// node_modules/@sinclair/typebox/build/esm/errors/function.mjs
|
|
1261
|
+
function DefaultErrorFunction(error) {
|
|
1262
|
+
switch (error.errorType) {
|
|
1263
|
+
case ValueErrorType.ArrayContains:
|
|
1264
|
+
return "Expected array to contain at least one matching value";
|
|
1265
|
+
case ValueErrorType.ArrayMaxContains:
|
|
1266
|
+
return `Expected array to contain no more than ${error.schema.maxContains} matching values`;
|
|
1267
|
+
case ValueErrorType.ArrayMinContains:
|
|
1268
|
+
return `Expected array to contain at least ${error.schema.minContains} matching values`;
|
|
1269
|
+
case ValueErrorType.ArrayMaxItems:
|
|
1270
|
+
return `Expected array length to be less or equal to ${error.schema.maxItems}`;
|
|
1271
|
+
case ValueErrorType.ArrayMinItems:
|
|
1272
|
+
return `Expected array length to be greater or equal to ${error.schema.minItems}`;
|
|
1273
|
+
case ValueErrorType.ArrayUniqueItems:
|
|
1274
|
+
return "Expected array elements to be unique";
|
|
1275
|
+
case ValueErrorType.Array:
|
|
1276
|
+
return "Expected array";
|
|
1277
|
+
case ValueErrorType.AsyncIterator:
|
|
1278
|
+
return "Expected AsyncIterator";
|
|
1279
|
+
case ValueErrorType.BigIntExclusiveMaximum:
|
|
1280
|
+
return `Expected bigint to be less than ${error.schema.exclusiveMaximum}`;
|
|
1281
|
+
case ValueErrorType.BigIntExclusiveMinimum:
|
|
1282
|
+
return `Expected bigint to be greater than ${error.schema.exclusiveMinimum}`;
|
|
1283
|
+
case ValueErrorType.BigIntMaximum:
|
|
1284
|
+
return `Expected bigint to be less or equal to ${error.schema.maximum}`;
|
|
1285
|
+
case ValueErrorType.BigIntMinimum:
|
|
1286
|
+
return `Expected bigint to be greater or equal to ${error.schema.minimum}`;
|
|
1287
|
+
case ValueErrorType.BigIntMultipleOf:
|
|
1288
|
+
return `Expected bigint to be a multiple of ${error.schema.multipleOf}`;
|
|
1289
|
+
case ValueErrorType.BigInt:
|
|
1290
|
+
return "Expected bigint";
|
|
1291
|
+
case ValueErrorType.Boolean:
|
|
1292
|
+
return "Expected boolean";
|
|
1293
|
+
case ValueErrorType.DateExclusiveMinimumTimestamp:
|
|
1294
|
+
return `Expected Date timestamp to be greater than ${error.schema.exclusiveMinimumTimestamp}`;
|
|
1295
|
+
case ValueErrorType.DateExclusiveMaximumTimestamp:
|
|
1296
|
+
return `Expected Date timestamp to be less than ${error.schema.exclusiveMaximumTimestamp}`;
|
|
1297
|
+
case ValueErrorType.DateMinimumTimestamp:
|
|
1298
|
+
return `Expected Date timestamp to be greater or equal to ${error.schema.minimumTimestamp}`;
|
|
1299
|
+
case ValueErrorType.DateMaximumTimestamp:
|
|
1300
|
+
return `Expected Date timestamp to be less or equal to ${error.schema.maximumTimestamp}`;
|
|
1301
|
+
case ValueErrorType.DateMultipleOfTimestamp:
|
|
1302
|
+
return `Expected Date timestamp to be a multiple of ${error.schema.multipleOfTimestamp}`;
|
|
1303
|
+
case ValueErrorType.Date:
|
|
1304
|
+
return "Expected Date";
|
|
1305
|
+
case ValueErrorType.Function:
|
|
1306
|
+
return "Expected function";
|
|
1307
|
+
case ValueErrorType.IntegerExclusiveMaximum:
|
|
1308
|
+
return `Expected integer to be less than ${error.schema.exclusiveMaximum}`;
|
|
1309
|
+
case ValueErrorType.IntegerExclusiveMinimum:
|
|
1310
|
+
return `Expected integer to be greater than ${error.schema.exclusiveMinimum}`;
|
|
1311
|
+
case ValueErrorType.IntegerMaximum:
|
|
1312
|
+
return `Expected integer to be less or equal to ${error.schema.maximum}`;
|
|
1313
|
+
case ValueErrorType.IntegerMinimum:
|
|
1314
|
+
return `Expected integer to be greater or equal to ${error.schema.minimum}`;
|
|
1315
|
+
case ValueErrorType.IntegerMultipleOf:
|
|
1316
|
+
return `Expected integer to be a multiple of ${error.schema.multipleOf}`;
|
|
1317
|
+
case ValueErrorType.Integer:
|
|
1318
|
+
return "Expected integer";
|
|
1319
|
+
case ValueErrorType.IntersectUnevaluatedProperties:
|
|
1320
|
+
return "Unexpected property";
|
|
1321
|
+
case ValueErrorType.Intersect:
|
|
1322
|
+
return "Expected all values to match";
|
|
1323
|
+
case ValueErrorType.Iterator:
|
|
1324
|
+
return "Expected Iterator";
|
|
1325
|
+
case ValueErrorType.Literal:
|
|
1326
|
+
return `Expected ${typeof error.schema.const === "string" ? `'${error.schema.const}'` : error.schema.const}`;
|
|
1327
|
+
case ValueErrorType.Never:
|
|
1328
|
+
return "Never";
|
|
1329
|
+
case ValueErrorType.Not:
|
|
1330
|
+
return "Value should not match";
|
|
1331
|
+
case ValueErrorType.Null:
|
|
1332
|
+
return "Expected null";
|
|
1333
|
+
case ValueErrorType.NumberExclusiveMaximum:
|
|
1334
|
+
return `Expected number to be less than ${error.schema.exclusiveMaximum}`;
|
|
1335
|
+
case ValueErrorType.NumberExclusiveMinimum:
|
|
1336
|
+
return `Expected number to be greater than ${error.schema.exclusiveMinimum}`;
|
|
1337
|
+
case ValueErrorType.NumberMaximum:
|
|
1338
|
+
return `Expected number to be less or equal to ${error.schema.maximum}`;
|
|
1339
|
+
case ValueErrorType.NumberMinimum:
|
|
1340
|
+
return `Expected number to be greater or equal to ${error.schema.minimum}`;
|
|
1341
|
+
case ValueErrorType.NumberMultipleOf:
|
|
1342
|
+
return `Expected number to be a multiple of ${error.schema.multipleOf}`;
|
|
1343
|
+
case ValueErrorType.Number:
|
|
1344
|
+
return "Expected number";
|
|
1345
|
+
case ValueErrorType.Object:
|
|
1346
|
+
return "Expected object";
|
|
1347
|
+
case ValueErrorType.ObjectAdditionalProperties:
|
|
1348
|
+
return "Unexpected property";
|
|
1349
|
+
case ValueErrorType.ObjectMaxProperties:
|
|
1350
|
+
return `Expected object to have no more than ${error.schema.maxProperties} properties`;
|
|
1351
|
+
case ValueErrorType.ObjectMinProperties:
|
|
1352
|
+
return `Expected object to have at least ${error.schema.minProperties} properties`;
|
|
1353
|
+
case ValueErrorType.ObjectRequiredProperty:
|
|
1354
|
+
return "Expected required property";
|
|
1355
|
+
case ValueErrorType.Promise:
|
|
1356
|
+
return "Expected Promise";
|
|
1357
|
+
case ValueErrorType.RegExp:
|
|
1358
|
+
return "Expected string to match regular expression";
|
|
1359
|
+
case ValueErrorType.StringFormatUnknown:
|
|
1360
|
+
return `Unknown format '${error.schema.format}'`;
|
|
1361
|
+
case ValueErrorType.StringFormat:
|
|
1362
|
+
return `Expected string to match '${error.schema.format}' format`;
|
|
1363
|
+
case ValueErrorType.StringMaxLength:
|
|
1364
|
+
return `Expected string length less or equal to ${error.schema.maxLength}`;
|
|
1365
|
+
case ValueErrorType.StringMinLength:
|
|
1366
|
+
return `Expected string length greater or equal to ${error.schema.minLength}`;
|
|
1367
|
+
case ValueErrorType.StringPattern:
|
|
1368
|
+
return `Expected string to match '${error.schema.pattern}'`;
|
|
1369
|
+
case ValueErrorType.String:
|
|
1370
|
+
return "Expected string";
|
|
1371
|
+
case ValueErrorType.Symbol:
|
|
1372
|
+
return "Expected symbol";
|
|
1373
|
+
case ValueErrorType.TupleLength:
|
|
1374
|
+
return `Expected tuple to have ${error.schema.maxItems || 0} elements`;
|
|
1375
|
+
case ValueErrorType.Tuple:
|
|
1376
|
+
return "Expected tuple";
|
|
1377
|
+
case ValueErrorType.Uint8ArrayMaxByteLength:
|
|
1378
|
+
return `Expected byte length less or equal to ${error.schema.maxByteLength}`;
|
|
1379
|
+
case ValueErrorType.Uint8ArrayMinByteLength:
|
|
1380
|
+
return `Expected byte length greater or equal to ${error.schema.minByteLength}`;
|
|
1381
|
+
case ValueErrorType.Uint8Array:
|
|
1382
|
+
return "Expected Uint8Array";
|
|
1383
|
+
case ValueErrorType.Undefined:
|
|
1384
|
+
return "Expected undefined";
|
|
1385
|
+
case ValueErrorType.Union:
|
|
1386
|
+
return "Expected union value";
|
|
1387
|
+
case ValueErrorType.Void:
|
|
1388
|
+
return "Expected void";
|
|
1389
|
+
case ValueErrorType.Kind:
|
|
1390
|
+
return `Expected kind '${error.schema[Kind]}'`;
|
|
1391
|
+
default:
|
|
1392
|
+
return "Unknown error type";
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
var errorFunction = DefaultErrorFunction;
|
|
1396
|
+
function GetErrorFunction() {
|
|
1397
|
+
return errorFunction;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
// node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs
|
|
1401
|
+
class TypeDereferenceError extends TypeBoxError {
|
|
1402
|
+
constructor(schema) {
|
|
1403
|
+
super(`Unable to dereference schema with $id '${schema.$ref}'`);
|
|
1404
|
+
this.schema = schema;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
function Resolve(schema, references) {
|
|
1408
|
+
const target = references.find((target2) => target2.$id === schema.$ref);
|
|
1409
|
+
if (target === undefined)
|
|
1410
|
+
throw new TypeDereferenceError(schema);
|
|
1411
|
+
return Deref(target, references);
|
|
1412
|
+
}
|
|
1413
|
+
function Pushref(schema, references) {
|
|
1414
|
+
if (!IsString(schema.$id) || references.some((target) => target.$id === schema.$id))
|
|
1415
|
+
return references;
|
|
1416
|
+
references.push(schema);
|
|
1417
|
+
return references;
|
|
1418
|
+
}
|
|
1419
|
+
function Deref(schema, references) {
|
|
1420
|
+
return schema[Kind] === "This" || schema[Kind] === "Ref" ? Resolve(schema, references) : schema;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
// node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs
|
|
1424
|
+
class ValueHashError extends TypeBoxError {
|
|
1425
|
+
constructor(value) {
|
|
1426
|
+
super(`Unable to hash value`);
|
|
1427
|
+
this.value = value;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
var ByteMarker;
|
|
1431
|
+
(function(ByteMarker2) {
|
|
1432
|
+
ByteMarker2[ByteMarker2["Undefined"] = 0] = "Undefined";
|
|
1433
|
+
ByteMarker2[ByteMarker2["Null"] = 1] = "Null";
|
|
1434
|
+
ByteMarker2[ByteMarker2["Boolean"] = 2] = "Boolean";
|
|
1435
|
+
ByteMarker2[ByteMarker2["Number"] = 3] = "Number";
|
|
1436
|
+
ByteMarker2[ByteMarker2["String"] = 4] = "String";
|
|
1437
|
+
ByteMarker2[ByteMarker2["Object"] = 5] = "Object";
|
|
1438
|
+
ByteMarker2[ByteMarker2["Array"] = 6] = "Array";
|
|
1439
|
+
ByteMarker2[ByteMarker2["Date"] = 7] = "Date";
|
|
1440
|
+
ByteMarker2[ByteMarker2["Uint8Array"] = 8] = "Uint8Array";
|
|
1441
|
+
ByteMarker2[ByteMarker2["Symbol"] = 9] = "Symbol";
|
|
1442
|
+
ByteMarker2[ByteMarker2["BigInt"] = 10] = "BigInt";
|
|
1443
|
+
})(ByteMarker || (ByteMarker = {}));
|
|
1444
|
+
var Accumulator = BigInt("14695981039346656037");
|
|
1445
|
+
var [Prime, Size] = [BigInt("1099511628211"), BigInt("18446744073709551616")];
|
|
1446
|
+
var Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
|
|
1447
|
+
var F64 = new Float64Array(1);
|
|
1448
|
+
var F64In = new DataView(F64.buffer);
|
|
1449
|
+
var F64Out = new Uint8Array(F64.buffer);
|
|
1450
|
+
function* NumberToBytes(value) {
|
|
1451
|
+
const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8);
|
|
1452
|
+
for (let i = 0;i < byteCount; i++) {
|
|
1453
|
+
yield value >> 8 * (byteCount - 1 - i) & 255;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
function ArrayType2(value) {
|
|
1457
|
+
FNV1A64(ByteMarker.Array);
|
|
1458
|
+
for (const item of value) {
|
|
1459
|
+
Visit3(item);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
function BooleanType(value) {
|
|
1463
|
+
FNV1A64(ByteMarker.Boolean);
|
|
1464
|
+
FNV1A64(value ? 1 : 0);
|
|
1465
|
+
}
|
|
1466
|
+
function BigIntType(value) {
|
|
1467
|
+
FNV1A64(ByteMarker.BigInt);
|
|
1468
|
+
F64In.setBigInt64(0, value);
|
|
1469
|
+
for (const byte of F64Out) {
|
|
1470
|
+
FNV1A64(byte);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
function DateType2(value) {
|
|
1474
|
+
FNV1A64(ByteMarker.Date);
|
|
1475
|
+
Visit3(value.getTime());
|
|
1476
|
+
}
|
|
1477
|
+
function NullType(value) {
|
|
1478
|
+
FNV1A64(ByteMarker.Null);
|
|
1479
|
+
}
|
|
1480
|
+
function NumberType(value) {
|
|
1481
|
+
FNV1A64(ByteMarker.Number);
|
|
1482
|
+
F64In.setFloat64(0, value);
|
|
1483
|
+
for (const byte of F64Out) {
|
|
1484
|
+
FNV1A64(byte);
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
function ObjectType2(value) {
|
|
1488
|
+
FNV1A64(ByteMarker.Object);
|
|
1489
|
+
for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) {
|
|
1490
|
+
Visit3(key);
|
|
1491
|
+
Visit3(value[key]);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
function StringType(value) {
|
|
1495
|
+
FNV1A64(ByteMarker.String);
|
|
1496
|
+
for (let i = 0;i < value.length; i++) {
|
|
1497
|
+
for (const byte of NumberToBytes(value.charCodeAt(i))) {
|
|
1498
|
+
FNV1A64(byte);
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
function SymbolType(value) {
|
|
1503
|
+
FNV1A64(ByteMarker.Symbol);
|
|
1504
|
+
Visit3(value.description);
|
|
1505
|
+
}
|
|
1506
|
+
function Uint8ArrayType2(value) {
|
|
1507
|
+
FNV1A64(ByteMarker.Uint8Array);
|
|
1508
|
+
for (let i = 0;i < value.length; i++) {
|
|
1509
|
+
FNV1A64(value[i]);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
function UndefinedType(value) {
|
|
1513
|
+
return FNV1A64(ByteMarker.Undefined);
|
|
1514
|
+
}
|
|
1515
|
+
function Visit3(value) {
|
|
1516
|
+
if (IsArray(value))
|
|
1517
|
+
return ArrayType2(value);
|
|
1518
|
+
if (IsBoolean(value))
|
|
1519
|
+
return BooleanType(value);
|
|
1520
|
+
if (IsBigInt(value))
|
|
1521
|
+
return BigIntType(value);
|
|
1522
|
+
if (IsDate(value))
|
|
1523
|
+
return DateType2(value);
|
|
1524
|
+
if (IsNull(value))
|
|
1525
|
+
return NullType(value);
|
|
1526
|
+
if (IsNumber(value))
|
|
1527
|
+
return NumberType(value);
|
|
1528
|
+
if (IsObject(value))
|
|
1529
|
+
return ObjectType2(value);
|
|
1530
|
+
if (IsString(value))
|
|
1531
|
+
return StringType(value);
|
|
1532
|
+
if (IsSymbol(value))
|
|
1533
|
+
return SymbolType(value);
|
|
1534
|
+
if (IsUint8Array(value))
|
|
1535
|
+
return Uint8ArrayType2(value);
|
|
1536
|
+
if (IsUndefined(value))
|
|
1537
|
+
return UndefinedType(value);
|
|
1538
|
+
throw new ValueHashError(value);
|
|
1539
|
+
}
|
|
1540
|
+
function FNV1A64(byte) {
|
|
1541
|
+
Accumulator = Accumulator ^ Bytes[byte];
|
|
1542
|
+
Accumulator = Accumulator * Prime % Size;
|
|
1543
|
+
}
|
|
1544
|
+
function Hash(value) {
|
|
1545
|
+
Accumulator = BigInt("14695981039346656037");
|
|
1546
|
+
Visit3(value);
|
|
1547
|
+
return Accumulator;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1122
1550
|
// node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
1123
1551
|
function Any(options) {
|
|
1124
1552
|
return CreateType({ [Kind]: "Any" }, options);
|
|
@@ -1129,22 +1557,22 @@ function Unknown(options) {
|
|
|
1129
1557
|
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1130
1558
|
}
|
|
1131
1559
|
// node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
1132
|
-
var
|
|
1133
|
-
__export(
|
|
1560
|
+
var exports_type2 = {};
|
|
1561
|
+
__export(exports_type2, {
|
|
1134
1562
|
IsAny: () => IsAny2,
|
|
1135
1563
|
IsArgument: () => IsArgument2,
|
|
1136
1564
|
IsArray: () => IsArray4,
|
|
1137
|
-
IsAsyncIterator: () =>
|
|
1138
|
-
IsBigInt: () =>
|
|
1139
|
-
IsBoolean: () =>
|
|
1565
|
+
IsAsyncIterator: () => IsAsyncIterator4,
|
|
1566
|
+
IsBigInt: () => IsBigInt4,
|
|
1567
|
+
IsBoolean: () => IsBoolean4,
|
|
1140
1568
|
IsComputed: () => IsComputed2,
|
|
1141
1569
|
IsConstructor: () => IsConstructor2,
|
|
1142
|
-
IsDate: () =>
|
|
1143
|
-
IsFunction: () =>
|
|
1570
|
+
IsDate: () => IsDate4,
|
|
1571
|
+
IsFunction: () => IsFunction4,
|
|
1144
1572
|
IsImport: () => IsImport,
|
|
1145
|
-
IsInteger: () =>
|
|
1573
|
+
IsInteger: () => IsInteger3,
|
|
1146
1574
|
IsIntersect: () => IsIntersect2,
|
|
1147
|
-
IsIterator: () =>
|
|
1575
|
+
IsIterator: () => IsIterator4,
|
|
1148
1576
|
IsKind: () => IsKind2,
|
|
1149
1577
|
IsKindOf: () => IsKindOf2,
|
|
1150
1578
|
IsLiteral: () => IsLiteral2,
|
|
@@ -1156,11 +1584,11 @@ __export(exports_type, {
|
|
|
1156
1584
|
IsMappedResult: () => IsMappedResult2,
|
|
1157
1585
|
IsNever: () => IsNever2,
|
|
1158
1586
|
IsNot: () => IsNot2,
|
|
1159
|
-
IsNull: () =>
|
|
1587
|
+
IsNull: () => IsNull4,
|
|
1160
1588
|
IsNumber: () => IsNumber4,
|
|
1161
1589
|
IsObject: () => IsObject4,
|
|
1162
1590
|
IsOptional: () => IsOptional2,
|
|
1163
|
-
IsPromise: () =>
|
|
1591
|
+
IsPromise: () => IsPromise3,
|
|
1164
1592
|
IsProperties: () => IsProperties,
|
|
1165
1593
|
IsReadonly: () => IsReadonly2,
|
|
1166
1594
|
IsRecord: () => IsRecord2,
|
|
@@ -1168,13 +1596,13 @@ __export(exports_type, {
|
|
|
1168
1596
|
IsRef: () => IsRef2,
|
|
1169
1597
|
IsRegExp: () => IsRegExp3,
|
|
1170
1598
|
IsSchema: () => IsSchema2,
|
|
1171
|
-
IsString: () =>
|
|
1172
|
-
IsSymbol: () =>
|
|
1599
|
+
IsString: () => IsString4,
|
|
1600
|
+
IsSymbol: () => IsSymbol4,
|
|
1173
1601
|
IsTemplateLiteral: () => IsTemplateLiteral2,
|
|
1174
1602
|
IsThis: () => IsThis2,
|
|
1175
1603
|
IsTransform: () => IsTransform2,
|
|
1176
1604
|
IsTuple: () => IsTuple2,
|
|
1177
|
-
IsUint8Array: () =>
|
|
1605
|
+
IsUint8Array: () => IsUint8Array4,
|
|
1178
1606
|
IsUndefined: () => IsUndefined4,
|
|
1179
1607
|
IsUnion: () => IsUnion2,
|
|
1180
1608
|
IsUnionLiteral: () => IsUnionLiteral,
|
|
@@ -1231,7 +1659,7 @@ function IsPattern(value) {
|
|
|
1231
1659
|
}
|
|
1232
1660
|
}
|
|
1233
1661
|
function IsControlCharacterFree(value) {
|
|
1234
|
-
if (!
|
|
1662
|
+
if (!IsString2(value))
|
|
1235
1663
|
return false;
|
|
1236
1664
|
for (let i = 0;i < value.length; i++) {
|
|
1237
1665
|
const code = value.charCodeAt(i);
|
|
@@ -1245,22 +1673,22 @@ function IsAdditionalProperties(value) {
|
|
|
1245
1673
|
return IsOptionalBoolean(value) || IsSchema2(value);
|
|
1246
1674
|
}
|
|
1247
1675
|
function IsOptionalBigInt(value) {
|
|
1248
|
-
return IsUndefined2(value) ||
|
|
1676
|
+
return IsUndefined2(value) || IsBigInt2(value);
|
|
1249
1677
|
}
|
|
1250
1678
|
function IsOptionalNumber(value) {
|
|
1251
1679
|
return IsUndefined2(value) || IsNumber2(value);
|
|
1252
1680
|
}
|
|
1253
1681
|
function IsOptionalBoolean(value) {
|
|
1254
|
-
return IsUndefined2(value) ||
|
|
1682
|
+
return IsUndefined2(value) || IsBoolean2(value);
|
|
1255
1683
|
}
|
|
1256
1684
|
function IsOptionalString(value) {
|
|
1257
|
-
return IsUndefined2(value) ||
|
|
1685
|
+
return IsUndefined2(value) || IsString2(value);
|
|
1258
1686
|
}
|
|
1259
1687
|
function IsOptionalPattern(value) {
|
|
1260
|
-
return IsUndefined2(value) ||
|
|
1688
|
+
return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value) && IsPattern(value);
|
|
1261
1689
|
}
|
|
1262
1690
|
function IsOptionalFormat(value) {
|
|
1263
|
-
return IsUndefined2(value) ||
|
|
1691
|
+
return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value);
|
|
1264
1692
|
}
|
|
1265
1693
|
function IsOptionalSchema(value) {
|
|
1266
1694
|
return IsUndefined2(value) || IsSchema2(value);
|
|
@@ -1280,62 +1708,62 @@ function IsArgument2(value) {
|
|
|
1280
1708
|
function IsArray4(value) {
|
|
1281
1709
|
return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
|
|
1282
1710
|
}
|
|
1283
|
-
function
|
|
1711
|
+
function IsAsyncIterator4(value) {
|
|
1284
1712
|
return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
1285
1713
|
}
|
|
1286
|
-
function
|
|
1714
|
+
function IsBigInt4(value) {
|
|
1287
1715
|
return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
|
|
1288
1716
|
}
|
|
1289
|
-
function
|
|
1717
|
+
function IsBoolean4(value) {
|
|
1290
1718
|
return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
|
|
1291
1719
|
}
|
|
1292
1720
|
function IsComputed2(value) {
|
|
1293
|
-
return IsKindOf2(value, "Computed") &&
|
|
1721
|
+
return IsKindOf2(value, "Computed") && IsString2(value.target) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
|
|
1294
1722
|
}
|
|
1295
1723
|
function IsConstructor2(value) {
|
|
1296
1724
|
return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
1297
1725
|
}
|
|
1298
|
-
function
|
|
1726
|
+
function IsDate4(value) {
|
|
1299
1727
|
return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
|
|
1300
1728
|
}
|
|
1301
|
-
function
|
|
1729
|
+
function IsFunction4(value) {
|
|
1302
1730
|
return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
1303
1731
|
}
|
|
1304
1732
|
function IsImport(value) {
|
|
1305
|
-
return IsKindOf2(value, "Import") &&
|
|
1733
|
+
return IsKindOf2(value, "Import") && HasPropertyKey2(value, "$defs") && IsObject2(value.$defs) && IsProperties(value.$defs) && HasPropertyKey2(value, "$ref") && IsString2(value.$ref) && value.$ref in value.$defs;
|
|
1306
1734
|
}
|
|
1307
|
-
function
|
|
1735
|
+
function IsInteger3(value) {
|
|
1308
1736
|
return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
|
|
1309
1737
|
}
|
|
1310
1738
|
function IsProperties(value) {
|
|
1311
1739
|
return IsObject2(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
|
|
1312
1740
|
}
|
|
1313
1741
|
function IsIntersect2(value) {
|
|
1314
|
-
return IsKindOf2(value, "Intersect") && (
|
|
1742
|
+
return IsKindOf2(value, "Intersect") && (IsString2(value.type) && value.type !== "object" ? false : true) && IsArray2(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
|
|
1315
1743
|
}
|
|
1316
|
-
function
|
|
1744
|
+
function IsIterator4(value) {
|
|
1317
1745
|
return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
1318
1746
|
}
|
|
1319
1747
|
function IsKindOf2(value, kind) {
|
|
1320
1748
|
return IsObject2(value) && Kind in value && value[Kind] === kind;
|
|
1321
1749
|
}
|
|
1322
1750
|
function IsLiteralString(value) {
|
|
1323
|
-
return IsLiteral2(value) &&
|
|
1751
|
+
return IsLiteral2(value) && IsString2(value.const);
|
|
1324
1752
|
}
|
|
1325
1753
|
function IsLiteralNumber(value) {
|
|
1326
1754
|
return IsLiteral2(value) && IsNumber2(value.const);
|
|
1327
1755
|
}
|
|
1328
1756
|
function IsLiteralBoolean(value) {
|
|
1329
|
-
return IsLiteral2(value) &&
|
|
1757
|
+
return IsLiteral2(value) && IsBoolean2(value.const);
|
|
1330
1758
|
}
|
|
1331
1759
|
function IsLiteral2(value) {
|
|
1332
1760
|
return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
|
|
1333
1761
|
}
|
|
1334
1762
|
function IsLiteralValue2(value) {
|
|
1335
|
-
return
|
|
1763
|
+
return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
|
|
1336
1764
|
}
|
|
1337
1765
|
function IsMappedKey2(value) {
|
|
1338
|
-
return IsKindOf2(value, "MappedKey") && IsArray2(value.keys) && value.keys.every((key) => IsNumber2(key) ||
|
|
1766
|
+
return IsKindOf2(value, "MappedKey") && IsArray2(value.keys) && value.keys.every((key) => IsNumber2(key) || IsString2(key));
|
|
1339
1767
|
}
|
|
1340
1768
|
function IsMappedResult2(value) {
|
|
1341
1769
|
return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
|
|
@@ -1346,7 +1774,7 @@ function IsNever2(value) {
|
|
|
1346
1774
|
function IsNot2(value) {
|
|
1347
1775
|
return IsKindOf2(value, "Not") && IsSchema2(value.not);
|
|
1348
1776
|
}
|
|
1349
|
-
function
|
|
1777
|
+
function IsNull4(value) {
|
|
1350
1778
|
return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
|
|
1351
1779
|
}
|
|
1352
1780
|
function IsNumber4(value) {
|
|
@@ -1355,7 +1783,7 @@ function IsNumber4(value) {
|
|
|
1355
1783
|
function IsObject4(value) {
|
|
1356
1784
|
return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
|
|
1357
1785
|
}
|
|
1358
|
-
function
|
|
1786
|
+
function IsPromise3(value) {
|
|
1359
1787
|
return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
|
|
1360
1788
|
}
|
|
1361
1789
|
function IsRecord2(value) {
|
|
@@ -1368,22 +1796,22 @@ function IsRecursive(value) {
|
|
|
1368
1796
|
return IsObject2(value) && Hint in value && value[Hint] === "Recursive";
|
|
1369
1797
|
}
|
|
1370
1798
|
function IsRef2(value) {
|
|
1371
|
-
return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) &&
|
|
1799
|
+
return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString2(value.$ref);
|
|
1372
1800
|
}
|
|
1373
1801
|
function IsRegExp3(value) {
|
|
1374
|
-
return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) &&
|
|
1802
|
+
return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString2(value.source) && IsString2(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
|
|
1375
1803
|
}
|
|
1376
|
-
function
|
|
1804
|
+
function IsString4(value) {
|
|
1377
1805
|
return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
|
|
1378
1806
|
}
|
|
1379
|
-
function
|
|
1807
|
+
function IsSymbol4(value) {
|
|
1380
1808
|
return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
|
|
1381
1809
|
}
|
|
1382
1810
|
function IsTemplateLiteral2(value) {
|
|
1383
|
-
return IsKindOf2(value, "TemplateLiteral") && value.type === "string" &&
|
|
1811
|
+
return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString2(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
|
|
1384
1812
|
}
|
|
1385
1813
|
function IsThis2(value) {
|
|
1386
|
-
return IsKindOf2(value, "This") && IsOptionalString(value.$id) &&
|
|
1814
|
+
return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString2(value.$ref);
|
|
1387
1815
|
}
|
|
1388
1816
|
function IsTransform2(value) {
|
|
1389
1817
|
return IsObject2(value) && TransformKind in value;
|
|
@@ -1400,7 +1828,7 @@ function IsUnionLiteral(value) {
|
|
|
1400
1828
|
function IsUnion2(value) {
|
|
1401
1829
|
return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject2(value) && IsArray2(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
|
|
1402
1830
|
}
|
|
1403
|
-
function
|
|
1831
|
+
function IsUint8Array4(value) {
|
|
1404
1832
|
return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
|
|
1405
1833
|
}
|
|
1406
1834
|
function IsUnknown2(value) {
|
|
@@ -1413,10 +1841,10 @@ function IsVoid2(value) {
|
|
|
1413
1841
|
return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
|
|
1414
1842
|
}
|
|
1415
1843
|
function IsKind2(value) {
|
|
1416
|
-
return IsObject2(value) && Kind in value &&
|
|
1844
|
+
return IsObject2(value) && Kind in value && IsString2(value[Kind]) && !KnownTypes.includes(value[Kind]);
|
|
1417
1845
|
}
|
|
1418
1846
|
function IsSchema2(value) {
|
|
1419
|
-
return IsObject2(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) ||
|
|
1847
|
+
return IsObject2(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean4(value) || IsBigInt4(value) || IsAsyncIterator4(value) || IsComputed2(value) || IsConstructor2(value) || IsDate4(value) || IsFunction4(value) || IsInteger3(value) || IsIntersect2(value) || IsIterator4(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull4(value) || IsNumber4(value) || IsObject4(value) || IsPromise3(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString4(value) || IsSymbol4(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array4(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
|
|
1420
1848
|
}
|
|
1421
1849
|
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
|
|
1422
1850
|
class ExtendsResolverError extends TypeBoxError {
|
|
@@ -1434,61 +1862,61 @@ function Throw(message) {
|
|
|
1434
1862
|
throw new ExtendsResolverError(message);
|
|
1435
1863
|
}
|
|
1436
1864
|
function IsStructuralRight(right) {
|
|
1437
|
-
return
|
|
1865
|
+
return exports_type2.IsNever(right) || exports_type2.IsIntersect(right) || exports_type2.IsUnion(right) || exports_type2.IsUnknown(right) || exports_type2.IsAny(right);
|
|
1438
1866
|
}
|
|
1439
1867
|
function StructuralRight(left, right) {
|
|
1440
|
-
return
|
|
1868
|
+
return exports_type2.IsNever(right) ? FromNeverRight(left, right) : exports_type2.IsIntersect(right) ? FromIntersectRight(left, right) : exports_type2.IsUnion(right) ? FromUnionRight(left, right) : exports_type2.IsUnknown(right) ? FromUnknownRight(left, right) : exports_type2.IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
|
|
1441
1869
|
}
|
|
1442
1870
|
function FromAnyRight(left, right) {
|
|
1443
1871
|
return ExtendsResult.True;
|
|
1444
1872
|
}
|
|
1445
1873
|
function FromAny(left, right) {
|
|
1446
|
-
return
|
|
1874
|
+
return exports_type2.IsIntersect(right) ? FromIntersectRight(left, right) : exports_type2.IsUnion(right) && right.anyOf.some((schema) => exports_type2.IsAny(schema) || exports_type2.IsUnknown(schema)) ? ExtendsResult.True : exports_type2.IsUnion(right) ? ExtendsResult.Union : exports_type2.IsUnknown(right) ? ExtendsResult.True : exports_type2.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
|
|
1447
1875
|
}
|
|
1448
1876
|
function FromArrayRight(left, right) {
|
|
1449
|
-
return
|
|
1877
|
+
return exports_type2.IsUnknown(left) ? ExtendsResult.False : exports_type2.IsAny(left) ? ExtendsResult.Union : exports_type2.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1450
1878
|
}
|
|
1451
1879
|
function FromArray3(left, right) {
|
|
1452
|
-
return
|
|
1880
|
+
return exports_type2.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !exports_type2.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit4(left.items, right.items));
|
|
1453
1881
|
}
|
|
1454
1882
|
function FromAsyncIterator(left, right) {
|
|
1455
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : !
|
|
1883
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : !exports_type2.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit4(left.items, right.items));
|
|
1456
1884
|
}
|
|
1457
1885
|
function FromBigInt(left, right) {
|
|
1458
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1886
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1459
1887
|
}
|
|
1460
1888
|
function FromBooleanRight(left, right) {
|
|
1461
|
-
return
|
|
1889
|
+
return exports_type2.IsLiteralBoolean(left) ? ExtendsResult.True : exports_type2.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1462
1890
|
}
|
|
1463
1891
|
function FromBoolean(left, right) {
|
|
1464
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1892
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1465
1893
|
}
|
|
1466
1894
|
function FromConstructor(left, right) {
|
|
1467
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1895
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : !exports_type2.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit4(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit4(left.returns, right.returns));
|
|
1468
1896
|
}
|
|
1469
1897
|
function FromDate(left, right) {
|
|
1470
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1898
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1471
1899
|
}
|
|
1472
1900
|
function FromFunction(left, right) {
|
|
1473
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1901
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : !exports_type2.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit4(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit4(left.returns, right.returns));
|
|
1474
1902
|
}
|
|
1475
1903
|
function FromIntegerRight(left, right) {
|
|
1476
|
-
return
|
|
1904
|
+
return exports_type2.IsLiteral(left) && exports_value.IsNumber(left.const) ? ExtendsResult.True : exports_type2.IsNumber(left) || exports_type2.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1477
1905
|
}
|
|
1478
1906
|
function FromInteger(left, right) {
|
|
1479
|
-
return
|
|
1907
|
+
return exports_type2.IsInteger(right) || exports_type2.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
|
|
1480
1908
|
}
|
|
1481
1909
|
function FromIntersectRight(left, right) {
|
|
1482
|
-
return right.allOf.every((schema) =>
|
|
1910
|
+
return right.allOf.every((schema) => Visit4(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1483
1911
|
}
|
|
1484
1912
|
function FromIntersect3(left, right) {
|
|
1485
|
-
return left.allOf.some((schema) =>
|
|
1913
|
+
return left.allOf.some((schema) => Visit4(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1486
1914
|
}
|
|
1487
1915
|
function FromIterator(left, right) {
|
|
1488
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) : !
|
|
1916
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : !exports_type2.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit4(left.items, right.items));
|
|
1489
1917
|
}
|
|
1490
1918
|
function FromLiteral2(left, right) {
|
|
1491
|
-
return
|
|
1919
|
+
return exports_type2.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsString(right) ? FromStringRight(left, right) : exports_type2.IsNumber(right) ? FromNumberRight(left, right) : exports_type2.IsInteger(right) ? FromIntegerRight(left, right) : exports_type2.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
|
|
1492
1920
|
}
|
|
1493
1921
|
function FromNeverRight(left, right) {
|
|
1494
1922
|
return ExtendsResult.False;
|
|
@@ -1499,7 +1927,7 @@ function FromNever(left, right) {
|
|
|
1499
1927
|
function UnwrapTNot(schema) {
|
|
1500
1928
|
let [current, depth] = [schema, 0];
|
|
1501
1929
|
while (true) {
|
|
1502
|
-
if (!
|
|
1930
|
+
if (!exports_type2.IsNot(current))
|
|
1503
1931
|
break;
|
|
1504
1932
|
current = current.not;
|
|
1505
1933
|
depth += 1;
|
|
@@ -1507,16 +1935,16 @@ function UnwrapTNot(schema) {
|
|
|
1507
1935
|
return depth % 2 === 0 ? current : Unknown();
|
|
1508
1936
|
}
|
|
1509
1937
|
function FromNot(left, right) {
|
|
1510
|
-
return
|
|
1938
|
+
return exports_type2.IsNot(left) ? Visit4(UnwrapTNot(left), right) : exports_type2.IsNot(right) ? Visit4(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
|
|
1511
1939
|
}
|
|
1512
1940
|
function FromNull(left, right) {
|
|
1513
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1941
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1514
1942
|
}
|
|
1515
1943
|
function FromNumberRight(left, right) {
|
|
1516
|
-
return
|
|
1944
|
+
return exports_type2.IsLiteralNumber(left) ? ExtendsResult.True : exports_type2.IsNumber(left) || exports_type2.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1517
1945
|
}
|
|
1518
1946
|
function FromNumber(left, right) {
|
|
1519
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1947
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsInteger(right) || exports_type2.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1520
1948
|
}
|
|
1521
1949
|
function IsObjectPropertyCount(schema, count) {
|
|
1522
1950
|
return Object.getOwnPropertyNames(schema.properties).length === count;
|
|
@@ -1525,7 +1953,7 @@ function IsObjectStringLike(schema) {
|
|
|
1525
1953
|
return IsObjectArrayLike(schema);
|
|
1526
1954
|
}
|
|
1527
1955
|
function IsObjectSymbolLike(schema) {
|
|
1528
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties &&
|
|
1956
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && exports_type2.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (exports_type2.IsString(schema.properties.description.anyOf[0]) && exports_type2.IsUndefined(schema.properties.description.anyOf[1]) || exports_type2.IsString(schema.properties.description.anyOf[1]) && exports_type2.IsUndefined(schema.properties.description.anyOf[0]));
|
|
1529
1957
|
}
|
|
1530
1958
|
function IsObjectNumberLike(schema) {
|
|
1531
1959
|
return IsObjectPropertyCount(schema, 0);
|
|
@@ -1544,36 +1972,36 @@ function IsObjectUint8ArrayLike(schema) {
|
|
|
1544
1972
|
}
|
|
1545
1973
|
function IsObjectFunctionLike(schema) {
|
|
1546
1974
|
const length = Number2();
|
|
1547
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(
|
|
1975
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit4(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1548
1976
|
}
|
|
1549
1977
|
function IsObjectConstructorLike(schema) {
|
|
1550
1978
|
return IsObjectPropertyCount(schema, 0);
|
|
1551
1979
|
}
|
|
1552
1980
|
function IsObjectArrayLike(schema) {
|
|
1553
1981
|
const length = Number2();
|
|
1554
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(
|
|
1982
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit4(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1555
1983
|
}
|
|
1556
1984
|
function IsObjectPromiseLike(schema) {
|
|
1557
1985
|
const then = Function([Any()], Any());
|
|
1558
|
-
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(
|
|
1986
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit4(schema.properties["then"], then)) === ExtendsResult.True;
|
|
1559
1987
|
}
|
|
1560
1988
|
function Property(left, right) {
|
|
1561
|
-
return
|
|
1989
|
+
return Visit4(left, right) === ExtendsResult.False ? ExtendsResult.False : exports_type2.IsOptional(left) && !exports_type2.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
|
|
1562
1990
|
}
|
|
1563
1991
|
function FromObjectRight(left, right) {
|
|
1564
|
-
return
|
|
1992
|
+
return exports_type2.IsUnknown(left) ? ExtendsResult.False : exports_type2.IsAny(left) ? ExtendsResult.Union : exports_type2.IsNever(left) || exports_type2.IsLiteralString(left) && IsObjectStringLike(right) || exports_type2.IsLiteralNumber(left) && IsObjectNumberLike(right) || exports_type2.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || exports_type2.IsSymbol(left) && IsObjectSymbolLike(right) || exports_type2.IsBigInt(left) && IsObjectBigIntLike(right) || exports_type2.IsString(left) && IsObjectStringLike(right) || exports_type2.IsSymbol(left) && IsObjectSymbolLike(right) || exports_type2.IsNumber(left) && IsObjectNumberLike(right) || exports_type2.IsInteger(left) && IsObjectNumberLike(right) || exports_type2.IsBoolean(left) && IsObjectBooleanLike(right) || exports_type2.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || exports_type2.IsDate(left) && IsObjectDateLike(right) || exports_type2.IsConstructor(left) && IsObjectConstructorLike(right) || exports_type2.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : exports_type2.IsRecord(left) && exports_type2.IsString(RecordKey(left)) ? (() => {
|
|
1565
1993
|
return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
|
|
1566
|
-
})() :
|
|
1994
|
+
})() : exports_type2.IsRecord(left) && exports_type2.IsNumber(RecordKey(left)) ? (() => {
|
|
1567
1995
|
return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
|
|
1568
1996
|
})() : ExtendsResult.False;
|
|
1569
1997
|
}
|
|
1570
1998
|
function FromObject(left, right) {
|
|
1571
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
1999
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : !exports_type2.IsObject(right) ? ExtendsResult.False : (() => {
|
|
1572
2000
|
for (const key of Object.getOwnPropertyNames(right.properties)) {
|
|
1573
|
-
if (!(key in left.properties) && !
|
|
2001
|
+
if (!(key in left.properties) && !exports_type2.IsOptional(right.properties[key])) {
|
|
1574
2002
|
return ExtendsResult.False;
|
|
1575
2003
|
}
|
|
1576
|
-
if (
|
|
2004
|
+
if (exports_type2.IsOptional(right.properties[key])) {
|
|
1577
2005
|
return ExtendsResult.True;
|
|
1578
2006
|
}
|
|
1579
2007
|
if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
|
|
@@ -1584,7 +2012,7 @@ function FromObject(left, right) {
|
|
|
1584
2012
|
})();
|
|
1585
2013
|
}
|
|
1586
2014
|
function FromPromise(left, right) {
|
|
1587
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2015
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !exports_type2.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit4(left.item, right.item));
|
|
1588
2016
|
}
|
|
1589
2017
|
function RecordKey(schema) {
|
|
1590
2018
|
return PatternNumberExact in schema.patternProperties ? Number2() : (PatternStringExact in schema.patternProperties) ? String2() : Throw("Unknown record key pattern");
|
|
@@ -1594,7 +2022,7 @@ function RecordValue(schema) {
|
|
|
1594
2022
|
}
|
|
1595
2023
|
function FromRecordRight(left, right) {
|
|
1596
2024
|
const [Key, Value] = [RecordKey(right), RecordValue(right)];
|
|
1597
|
-
return
|
|
2025
|
+
return exports_type2.IsLiteralString(left) && exports_type2.IsNumber(Key) && IntoBooleanResult(Visit4(left, Value)) === ExtendsResult.True ? ExtendsResult.True : exports_type2.IsUint8Array(left) && exports_type2.IsNumber(Key) ? Visit4(left, Value) : exports_type2.IsString(left) && exports_type2.IsNumber(Key) ? Visit4(left, Value) : exports_type2.IsArray(left) && exports_type2.IsNumber(Key) ? Visit4(left, Value) : exports_type2.IsObject(left) ? (() => {
|
|
1598
2026
|
for (const key of Object.getOwnPropertyNames(left.properties)) {
|
|
1599
2027
|
if (Property(Value, left.properties[key]) === ExtendsResult.False) {
|
|
1600
2028
|
return ExtendsResult.False;
|
|
@@ -1604,63 +2032,63 @@ function FromRecordRight(left, right) {
|
|
|
1604
2032
|
})() : ExtendsResult.False;
|
|
1605
2033
|
}
|
|
1606
2034
|
function FromRecord(left, right) {
|
|
1607
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2035
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : !exports_type2.IsRecord(right) ? ExtendsResult.False : Visit4(RecordValue(left), RecordValue(right));
|
|
1608
2036
|
}
|
|
1609
2037
|
function FromRegExp(left, right) {
|
|
1610
|
-
const L =
|
|
1611
|
-
const R =
|
|
1612
|
-
return
|
|
2038
|
+
const L = exports_type2.IsRegExp(left) ? String2() : left;
|
|
2039
|
+
const R = exports_type2.IsRegExp(right) ? String2() : right;
|
|
2040
|
+
return Visit4(L, R);
|
|
1613
2041
|
}
|
|
1614
2042
|
function FromStringRight(left, right) {
|
|
1615
|
-
return
|
|
2043
|
+
return exports_type2.IsLiteral(left) && exports_value.IsString(left.const) ? ExtendsResult.True : exports_type2.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1616
2044
|
}
|
|
1617
2045
|
function FromString(left, right) {
|
|
1618
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2046
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsString(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1619
2047
|
}
|
|
1620
2048
|
function FromSymbol(left, right) {
|
|
1621
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2049
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1622
2050
|
}
|
|
1623
2051
|
function FromTemplateLiteral2(left, right) {
|
|
1624
|
-
return
|
|
2052
|
+
return exports_type2.IsTemplateLiteral(left) ? Visit4(TemplateLiteralToUnion(left), right) : exports_type2.IsTemplateLiteral(right) ? Visit4(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
|
|
1625
2053
|
}
|
|
1626
2054
|
function IsArrayOfTuple(left, right) {
|
|
1627
|
-
return
|
|
2055
|
+
return exports_type2.IsArray(right) && left.items !== undefined && left.items.every((schema) => Visit4(schema, right.items) === ExtendsResult.True);
|
|
1628
2056
|
}
|
|
1629
2057
|
function FromTupleRight(left, right) {
|
|
1630
|
-
return
|
|
2058
|
+
return exports_type2.IsNever(left) ? ExtendsResult.True : exports_type2.IsUnknown(left) ? ExtendsResult.False : exports_type2.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
|
|
1631
2059
|
}
|
|
1632
2060
|
function FromTuple3(left, right) {
|
|
1633
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2061
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : exports_type2.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !exports_type2.IsTuple(right) ? ExtendsResult.False : exports_value.IsUndefined(left.items) && !exports_value.IsUndefined(right.items) || !exports_value.IsUndefined(left.items) && exports_value.IsUndefined(right.items) ? ExtendsResult.False : exports_value.IsUndefined(left.items) && !exports_value.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit4(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1634
2062
|
}
|
|
1635
2063
|
function FromUint8Array(left, right) {
|
|
1636
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2064
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1637
2065
|
}
|
|
1638
2066
|
function FromUndefined(left, right) {
|
|
1639
|
-
return IsStructuralRight(right) ? StructuralRight(left, right) :
|
|
2067
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsRecord(right) ? FromRecordRight(left, right) : exports_type2.IsVoid(right) ? FromVoidRight(left, right) : exports_type2.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1640
2068
|
}
|
|
1641
2069
|
function FromUnionRight(left, right) {
|
|
1642
|
-
return right.anyOf.some((schema) =>
|
|
2070
|
+
return right.anyOf.some((schema) => Visit4(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1643
2071
|
}
|
|
1644
2072
|
function FromUnion5(left, right) {
|
|
1645
|
-
return left.anyOf.every((schema) =>
|
|
2073
|
+
return left.anyOf.every((schema) => Visit4(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1646
2074
|
}
|
|
1647
2075
|
function FromUnknownRight(left, right) {
|
|
1648
2076
|
return ExtendsResult.True;
|
|
1649
2077
|
}
|
|
1650
2078
|
function FromUnknown(left, right) {
|
|
1651
|
-
return
|
|
2079
|
+
return exports_type2.IsNever(right) ? FromNeverRight(left, right) : exports_type2.IsIntersect(right) ? FromIntersectRight(left, right) : exports_type2.IsUnion(right) ? FromUnionRight(left, right) : exports_type2.IsAny(right) ? FromAnyRight(left, right) : exports_type2.IsString(right) ? FromStringRight(left, right) : exports_type2.IsNumber(right) ? FromNumberRight(left, right) : exports_type2.IsInteger(right) ? FromIntegerRight(left, right) : exports_type2.IsBoolean(right) ? FromBooleanRight(left, right) : exports_type2.IsArray(right) ? FromArrayRight(left, right) : exports_type2.IsTuple(right) ? FromTupleRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1652
2080
|
}
|
|
1653
2081
|
function FromVoidRight(left, right) {
|
|
1654
|
-
return
|
|
2082
|
+
return exports_type2.IsUndefined(left) ? ExtendsResult.True : exports_type2.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1655
2083
|
}
|
|
1656
2084
|
function FromVoid(left, right) {
|
|
1657
|
-
return
|
|
2085
|
+
return exports_type2.IsIntersect(right) ? FromIntersectRight(left, right) : exports_type2.IsUnion(right) ? FromUnionRight(left, right) : exports_type2.IsUnknown(right) ? FromUnknownRight(left, right) : exports_type2.IsAny(right) ? FromAnyRight(left, right) : exports_type2.IsObject(right) ? FromObjectRight(left, right) : exports_type2.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1658
2086
|
}
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
2087
|
+
function Visit4(left, right) {
|
|
2088
|
+
return exports_type2.IsTemplateLiteral(left) || exports_type2.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : exports_type2.IsRegExp(left) || exports_type2.IsRegExp(right) ? FromRegExp(left, right) : exports_type2.IsNot(left) || exports_type2.IsNot(right) ? FromNot(left, right) : exports_type2.IsAny(left) ? FromAny(left, right) : exports_type2.IsArray(left) ? FromArray3(left, right) : exports_type2.IsBigInt(left) ? FromBigInt(left, right) : exports_type2.IsBoolean(left) ? FromBoolean(left, right) : exports_type2.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : exports_type2.IsConstructor(left) ? FromConstructor(left, right) : exports_type2.IsDate(left) ? FromDate(left, right) : exports_type2.IsFunction(left) ? FromFunction(left, right) : exports_type2.IsInteger(left) ? FromInteger(left, right) : exports_type2.IsIntersect(left) ? FromIntersect3(left, right) : exports_type2.IsIterator(left) ? FromIterator(left, right) : exports_type2.IsLiteral(left) ? FromLiteral2(left, right) : exports_type2.IsNever(left) ? FromNever(left, right) : exports_type2.IsNull(left) ? FromNull(left, right) : exports_type2.IsNumber(left) ? FromNumber(left, right) : exports_type2.IsObject(left) ? FromObject(left, right) : exports_type2.IsRecord(left) ? FromRecord(left, right) : exports_type2.IsString(left) ? FromString(left, right) : exports_type2.IsSymbol(left) ? FromSymbol(left, right) : exports_type2.IsTuple(left) ? FromTuple3(left, right) : exports_type2.IsPromise(left) ? FromPromise(left, right) : exports_type2.IsUint8Array(left) ? FromUint8Array(left, right) : exports_type2.IsUndefined(left) ? FromUndefined(left, right) : exports_type2.IsUnion(left) ? FromUnion5(left, right) : exports_type2.IsUnknown(left) ? FromUnknown(left, right) : exports_type2.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`);
|
|
1661
2089
|
}
|
|
1662
2090
|
function ExtendsCheck(left, right) {
|
|
1663
|
-
return
|
|
2091
|
+
return Visit4(left, right);
|
|
1664
2092
|
}
|
|
1665
2093
|
|
|
1666
2094
|
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
|
|
@@ -1706,65 +2134,3090 @@ function ExtendsFromMappedKey(T, U, L, R, options) {
|
|
|
1706
2134
|
return MappedResult(P);
|
|
1707
2135
|
}
|
|
1708
2136
|
|
|
1709
|
-
// node_modules/@sinclair/typebox/build/esm/
|
|
1710
|
-
|
|
1711
|
-
|
|
2137
|
+
// node_modules/@sinclair/typebox/build/esm/value/check/check.mjs
|
|
2138
|
+
class ValueCheckUnknownTypeError extends TypeBoxError {
|
|
2139
|
+
constructor(schema) {
|
|
2140
|
+
super(`Unknown type`);
|
|
2141
|
+
this.schema = schema;
|
|
2142
|
+
}
|
|
1712
2143
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
function Argument(index) {
|
|
1716
|
-
return CreateType({ [Kind]: "Argument", index });
|
|
2144
|
+
function IsAnyOrUnknown(schema) {
|
|
2145
|
+
return schema[Kind] === "Any" || schema[Kind] === "Unknown";
|
|
1717
2146
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
function FromComputed2(target, parameters) {
|
|
1721
|
-
return Computed("Awaited", [Computed(target, parameters)]);
|
|
2147
|
+
function IsDefined(value) {
|
|
2148
|
+
return value !== undefined;
|
|
1722
2149
|
}
|
|
1723
|
-
function
|
|
1724
|
-
return
|
|
2150
|
+
function FromAny2(schema, references, value) {
|
|
2151
|
+
return true;
|
|
1725
2152
|
}
|
|
1726
|
-
function
|
|
1727
|
-
return
|
|
2153
|
+
function FromArgument(schema, references, value) {
|
|
2154
|
+
return true;
|
|
1728
2155
|
}
|
|
1729
|
-
function
|
|
1730
|
-
|
|
2156
|
+
function FromArray4(schema, references, value) {
|
|
2157
|
+
if (!IsArray(value))
|
|
2158
|
+
return false;
|
|
2159
|
+
if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {
|
|
2160
|
+
return false;
|
|
2161
|
+
}
|
|
2162
|
+
if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {
|
|
2163
|
+
return false;
|
|
2164
|
+
}
|
|
2165
|
+
for (const element of value) {
|
|
2166
|
+
if (!Visit5(schema.items, references, element))
|
|
2167
|
+
return false;
|
|
2168
|
+
}
|
|
2169
|
+
if (schema.uniqueItems === true && !function() {
|
|
2170
|
+
const set = new Set;
|
|
2171
|
+
for (const element of value) {
|
|
2172
|
+
const hashed = Hash(element);
|
|
2173
|
+
if (set.has(hashed)) {
|
|
2174
|
+
return false;
|
|
2175
|
+
} else {
|
|
2176
|
+
set.add(hashed);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
return true;
|
|
2180
|
+
}()) {
|
|
2181
|
+
return false;
|
|
2182
|
+
}
|
|
2183
|
+
if (!(IsDefined(schema.contains) || IsNumber(schema.minContains) || IsNumber(schema.maxContains))) {
|
|
2184
|
+
return true;
|
|
2185
|
+
}
|
|
2186
|
+
const containsSchema = IsDefined(schema.contains) ? schema.contains : Never();
|
|
2187
|
+
const containsCount = value.reduce((acc, value2) => Visit5(containsSchema, references, value2) ? acc + 1 : acc, 0);
|
|
2188
|
+
if (containsCount === 0) {
|
|
2189
|
+
return false;
|
|
2190
|
+
}
|
|
2191
|
+
if (IsNumber(schema.minContains) && containsCount < schema.minContains) {
|
|
2192
|
+
return false;
|
|
2193
|
+
}
|
|
2194
|
+
if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) {
|
|
2195
|
+
return false;
|
|
2196
|
+
}
|
|
2197
|
+
return true;
|
|
1731
2198
|
}
|
|
1732
|
-
function
|
|
1733
|
-
return
|
|
2199
|
+
function FromAsyncIterator2(schema, references, value) {
|
|
2200
|
+
return IsAsyncIterator(value);
|
|
1734
2201
|
}
|
|
1735
|
-
function
|
|
1736
|
-
|
|
2202
|
+
function FromBigInt2(schema, references, value) {
|
|
2203
|
+
if (!IsBigInt(value))
|
|
2204
|
+
return false;
|
|
2205
|
+
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2209
|
+
return false;
|
|
2210
|
+
}
|
|
2211
|
+
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
2212
|
+
return false;
|
|
2213
|
+
}
|
|
2214
|
+
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
2215
|
+
return false;
|
|
2216
|
+
}
|
|
2217
|
+
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {
|
|
2218
|
+
return false;
|
|
2219
|
+
}
|
|
2220
|
+
return true;
|
|
1737
2221
|
}
|
|
1738
|
-
function
|
|
1739
|
-
return
|
|
2222
|
+
function FromBoolean2(schema, references, value) {
|
|
2223
|
+
return IsBoolean(value);
|
|
1740
2224
|
}
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
function CompositeKeys(T) {
|
|
1744
|
-
const Acc = [];
|
|
1745
|
-
for (const L of T)
|
|
1746
|
-
Acc.push(...KeyOfPropertyKeys(L));
|
|
1747
|
-
return SetDistinct(Acc);
|
|
2225
|
+
function FromConstructor2(schema, references, value) {
|
|
2226
|
+
return Visit5(schema.returns, references, value.prototype);
|
|
1748
2227
|
}
|
|
1749
|
-
function
|
|
1750
|
-
|
|
2228
|
+
function FromDate2(schema, references, value) {
|
|
2229
|
+
if (!IsDate(value))
|
|
2230
|
+
return false;
|
|
2231
|
+
if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {
|
|
2232
|
+
return false;
|
|
2233
|
+
}
|
|
2234
|
+
if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {
|
|
2235
|
+
return false;
|
|
2236
|
+
}
|
|
2237
|
+
if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {
|
|
2238
|
+
return false;
|
|
2239
|
+
}
|
|
2240
|
+
if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {
|
|
2241
|
+
return false;
|
|
2242
|
+
}
|
|
2243
|
+
if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {
|
|
2244
|
+
return false;
|
|
2245
|
+
}
|
|
2246
|
+
return true;
|
|
1751
2247
|
}
|
|
1752
|
-
function
|
|
1753
|
-
|
|
1754
|
-
for (const L of T)
|
|
1755
|
-
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
1756
|
-
return FilterNever(Acc);
|
|
2248
|
+
function FromFunction2(schema, references, value) {
|
|
2249
|
+
return IsFunction(value);
|
|
1757
2250
|
}
|
|
1758
|
-
function
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}
|
|
1763
|
-
return Acc;
|
|
2251
|
+
function FromImport(schema, references, value) {
|
|
2252
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
2253
|
+
const target = schema.$defs[schema.$ref];
|
|
2254
|
+
return Visit5(target, [...references, ...definitions], value);
|
|
1764
2255
|
}
|
|
1765
|
-
function
|
|
1766
|
-
|
|
1767
|
-
|
|
2256
|
+
function FromInteger2(schema, references, value) {
|
|
2257
|
+
if (!IsInteger(value)) {
|
|
2258
|
+
return false;
|
|
2259
|
+
}
|
|
2260
|
+
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2261
|
+
return false;
|
|
2262
|
+
}
|
|
2263
|
+
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2264
|
+
return false;
|
|
2265
|
+
}
|
|
2266
|
+
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
2267
|
+
return false;
|
|
2268
|
+
}
|
|
2269
|
+
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
2270
|
+
return false;
|
|
2271
|
+
}
|
|
2272
|
+
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
2273
|
+
return false;
|
|
2274
|
+
}
|
|
2275
|
+
return true;
|
|
2276
|
+
}
|
|
2277
|
+
function FromIntersect4(schema, references, value) {
|
|
2278
|
+
const check1 = schema.allOf.every((schema2) => Visit5(schema2, references, value));
|
|
2279
|
+
if (schema.unevaluatedProperties === false) {
|
|
2280
|
+
const keyPattern = new RegExp(KeyOfPattern(schema));
|
|
2281
|
+
const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key));
|
|
2282
|
+
return check1 && check2;
|
|
2283
|
+
} else if (IsSchema(schema.unevaluatedProperties)) {
|
|
2284
|
+
const keyCheck = new RegExp(KeyOfPattern(schema));
|
|
2285
|
+
const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit5(schema.unevaluatedProperties, references, value[key]));
|
|
2286
|
+
return check1 && check2;
|
|
2287
|
+
} else {
|
|
2288
|
+
return check1;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
function FromIterator2(schema, references, value) {
|
|
2292
|
+
return IsIterator(value);
|
|
2293
|
+
}
|
|
2294
|
+
function FromLiteral3(schema, references, value) {
|
|
2295
|
+
return value === schema.const;
|
|
2296
|
+
}
|
|
2297
|
+
function FromNever2(schema, references, value) {
|
|
2298
|
+
return false;
|
|
2299
|
+
}
|
|
2300
|
+
function FromNot2(schema, references, value) {
|
|
2301
|
+
return !Visit5(schema.not, references, value);
|
|
2302
|
+
}
|
|
2303
|
+
function FromNull2(schema, references, value) {
|
|
2304
|
+
return IsNull(value);
|
|
2305
|
+
}
|
|
2306
|
+
function FromNumber2(schema, references, value) {
|
|
2307
|
+
if (!TypeSystemPolicy.IsNumberLike(value))
|
|
2308
|
+
return false;
|
|
2309
|
+
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2310
|
+
return false;
|
|
2311
|
+
}
|
|
2312
|
+
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2313
|
+
return false;
|
|
2314
|
+
}
|
|
2315
|
+
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
2316
|
+
return false;
|
|
2317
|
+
}
|
|
2318
|
+
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
2319
|
+
return false;
|
|
2320
|
+
}
|
|
2321
|
+
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
2322
|
+
return false;
|
|
2323
|
+
}
|
|
2324
|
+
return true;
|
|
2325
|
+
}
|
|
2326
|
+
function FromObject2(schema, references, value) {
|
|
2327
|
+
if (!TypeSystemPolicy.IsObjectLike(value))
|
|
2328
|
+
return false;
|
|
2329
|
+
if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
2330
|
+
return false;
|
|
2331
|
+
}
|
|
2332
|
+
if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
2333
|
+
return false;
|
|
2334
|
+
}
|
|
2335
|
+
const knownKeys = Object.getOwnPropertyNames(schema.properties);
|
|
2336
|
+
for (const knownKey of knownKeys) {
|
|
2337
|
+
const property = schema.properties[knownKey];
|
|
2338
|
+
if (schema.required && schema.required.includes(knownKey)) {
|
|
2339
|
+
if (!Visit5(property, references, value[knownKey])) {
|
|
2340
|
+
return false;
|
|
2341
|
+
}
|
|
2342
|
+
if ((ExtendsUndefinedCheck(property) || IsAnyOrUnknown(property)) && !(knownKey in value)) {
|
|
2343
|
+
return false;
|
|
2344
|
+
}
|
|
2345
|
+
} else {
|
|
2346
|
+
if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey) && !Visit5(property, references, value[knownKey])) {
|
|
2347
|
+
return false;
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
if (schema.additionalProperties === false) {
|
|
2352
|
+
const valueKeys = Object.getOwnPropertyNames(value);
|
|
2353
|
+
if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) {
|
|
2354
|
+
return true;
|
|
2355
|
+
} else {
|
|
2356
|
+
return valueKeys.every((valueKey) => knownKeys.includes(valueKey));
|
|
2357
|
+
}
|
|
2358
|
+
} else if (typeof schema.additionalProperties === "object") {
|
|
2359
|
+
const valueKeys = Object.getOwnPropertyNames(value);
|
|
2360
|
+
return valueKeys.every((key) => knownKeys.includes(key) || Visit5(schema.additionalProperties, references, value[key]));
|
|
2361
|
+
} else {
|
|
2362
|
+
return true;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
function FromPromise2(schema, references, value) {
|
|
2366
|
+
return IsPromise(value);
|
|
2367
|
+
}
|
|
2368
|
+
function FromRecord2(schema, references, value) {
|
|
2369
|
+
if (!TypeSystemPolicy.IsRecordLike(value)) {
|
|
2370
|
+
return false;
|
|
2371
|
+
}
|
|
2372
|
+
if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
2373
|
+
return false;
|
|
2374
|
+
}
|
|
2375
|
+
if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
2376
|
+
return false;
|
|
2377
|
+
}
|
|
2378
|
+
const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];
|
|
2379
|
+
const regex = new RegExp(patternKey);
|
|
2380
|
+
const check1 = Object.entries(value).every(([key, value2]) => {
|
|
2381
|
+
return regex.test(key) ? Visit5(patternSchema, references, value2) : true;
|
|
2382
|
+
});
|
|
2383
|
+
const check2 = typeof schema.additionalProperties === "object" ? Object.entries(value).every(([key, value2]) => {
|
|
2384
|
+
return !regex.test(key) ? Visit5(schema.additionalProperties, references, value2) : true;
|
|
2385
|
+
}) : true;
|
|
2386
|
+
const check3 = schema.additionalProperties === false ? Object.getOwnPropertyNames(value).every((key) => {
|
|
2387
|
+
return regex.test(key);
|
|
2388
|
+
}) : true;
|
|
2389
|
+
return check1 && check2 && check3;
|
|
2390
|
+
}
|
|
2391
|
+
function FromRef2(schema, references, value) {
|
|
2392
|
+
return Visit5(Deref(schema, references), references, value);
|
|
2393
|
+
}
|
|
2394
|
+
function FromRegExp2(schema, references, value) {
|
|
2395
|
+
const regex = new RegExp(schema.source, schema.flags);
|
|
2396
|
+
if (IsDefined(schema.minLength)) {
|
|
2397
|
+
if (!(value.length >= schema.minLength))
|
|
2398
|
+
return false;
|
|
2399
|
+
}
|
|
2400
|
+
if (IsDefined(schema.maxLength)) {
|
|
2401
|
+
if (!(value.length <= schema.maxLength))
|
|
2402
|
+
return false;
|
|
2403
|
+
}
|
|
2404
|
+
return regex.test(value);
|
|
2405
|
+
}
|
|
2406
|
+
function FromString2(schema, references, value) {
|
|
2407
|
+
if (!IsString(value)) {
|
|
2408
|
+
return false;
|
|
2409
|
+
}
|
|
2410
|
+
if (IsDefined(schema.minLength)) {
|
|
2411
|
+
if (!(value.length >= schema.minLength))
|
|
2412
|
+
return false;
|
|
2413
|
+
}
|
|
2414
|
+
if (IsDefined(schema.maxLength)) {
|
|
2415
|
+
if (!(value.length <= schema.maxLength))
|
|
2416
|
+
return false;
|
|
2417
|
+
}
|
|
2418
|
+
if (IsDefined(schema.pattern)) {
|
|
2419
|
+
const regex = new RegExp(schema.pattern);
|
|
2420
|
+
if (!regex.test(value))
|
|
2421
|
+
return false;
|
|
2422
|
+
}
|
|
2423
|
+
if (IsDefined(schema.format)) {
|
|
2424
|
+
if (!exports_format.Has(schema.format))
|
|
2425
|
+
return false;
|
|
2426
|
+
const func = exports_format.Get(schema.format);
|
|
2427
|
+
return func(value);
|
|
2428
|
+
}
|
|
2429
|
+
return true;
|
|
2430
|
+
}
|
|
2431
|
+
function FromSymbol2(schema, references, value) {
|
|
2432
|
+
return IsSymbol(value);
|
|
2433
|
+
}
|
|
2434
|
+
function FromTemplateLiteral3(schema, references, value) {
|
|
2435
|
+
return IsString(value) && new RegExp(schema.pattern).test(value);
|
|
2436
|
+
}
|
|
2437
|
+
function FromThis(schema, references, value) {
|
|
2438
|
+
return Visit5(Deref(schema, references), references, value);
|
|
2439
|
+
}
|
|
2440
|
+
function FromTuple4(schema, references, value) {
|
|
2441
|
+
if (!IsArray(value)) {
|
|
2442
|
+
return false;
|
|
2443
|
+
}
|
|
2444
|
+
if (schema.items === undefined && !(value.length === 0)) {
|
|
2445
|
+
return false;
|
|
2446
|
+
}
|
|
2447
|
+
if (!(value.length === schema.maxItems)) {
|
|
2448
|
+
return false;
|
|
2449
|
+
}
|
|
2450
|
+
if (!schema.items) {
|
|
2451
|
+
return true;
|
|
2452
|
+
}
|
|
2453
|
+
for (let i = 0;i < schema.items.length; i++) {
|
|
2454
|
+
if (!Visit5(schema.items[i], references, value[i]))
|
|
2455
|
+
return false;
|
|
2456
|
+
}
|
|
2457
|
+
return true;
|
|
2458
|
+
}
|
|
2459
|
+
function FromUndefined2(schema, references, value) {
|
|
2460
|
+
return IsUndefined(value);
|
|
2461
|
+
}
|
|
2462
|
+
function FromUnion6(schema, references, value) {
|
|
2463
|
+
return schema.anyOf.some((inner) => Visit5(inner, references, value));
|
|
2464
|
+
}
|
|
2465
|
+
function FromUint8Array2(schema, references, value) {
|
|
2466
|
+
if (!IsUint8Array(value)) {
|
|
2467
|
+
return false;
|
|
2468
|
+
}
|
|
2469
|
+
if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {
|
|
2470
|
+
return false;
|
|
2471
|
+
}
|
|
2472
|
+
if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {
|
|
2473
|
+
return false;
|
|
2474
|
+
}
|
|
2475
|
+
return true;
|
|
2476
|
+
}
|
|
2477
|
+
function FromUnknown2(schema, references, value) {
|
|
2478
|
+
return true;
|
|
2479
|
+
}
|
|
2480
|
+
function FromVoid2(schema, references, value) {
|
|
2481
|
+
return TypeSystemPolicy.IsVoidLike(value);
|
|
2482
|
+
}
|
|
2483
|
+
function FromKind(schema, references, value) {
|
|
2484
|
+
if (!exports_type.Has(schema[Kind]))
|
|
2485
|
+
return false;
|
|
2486
|
+
const func = exports_type.Get(schema[Kind]);
|
|
2487
|
+
return func(schema, value);
|
|
2488
|
+
}
|
|
2489
|
+
function Visit5(schema, references, value) {
|
|
2490
|
+
const references_ = IsDefined(schema.$id) ? Pushref(schema, references) : references;
|
|
2491
|
+
const schema_ = schema;
|
|
2492
|
+
switch (schema_[Kind]) {
|
|
2493
|
+
case "Any":
|
|
2494
|
+
return FromAny2(schema_, references_, value);
|
|
2495
|
+
case "Argument":
|
|
2496
|
+
return FromArgument(schema_, references_, value);
|
|
2497
|
+
case "Array":
|
|
2498
|
+
return FromArray4(schema_, references_, value);
|
|
2499
|
+
case "AsyncIterator":
|
|
2500
|
+
return FromAsyncIterator2(schema_, references_, value);
|
|
2501
|
+
case "BigInt":
|
|
2502
|
+
return FromBigInt2(schema_, references_, value);
|
|
2503
|
+
case "Boolean":
|
|
2504
|
+
return FromBoolean2(schema_, references_, value);
|
|
2505
|
+
case "Constructor":
|
|
2506
|
+
return FromConstructor2(schema_, references_, value);
|
|
2507
|
+
case "Date":
|
|
2508
|
+
return FromDate2(schema_, references_, value);
|
|
2509
|
+
case "Function":
|
|
2510
|
+
return FromFunction2(schema_, references_, value);
|
|
2511
|
+
case "Import":
|
|
2512
|
+
return FromImport(schema_, references_, value);
|
|
2513
|
+
case "Integer":
|
|
2514
|
+
return FromInteger2(schema_, references_, value);
|
|
2515
|
+
case "Intersect":
|
|
2516
|
+
return FromIntersect4(schema_, references_, value);
|
|
2517
|
+
case "Iterator":
|
|
2518
|
+
return FromIterator2(schema_, references_, value);
|
|
2519
|
+
case "Literal":
|
|
2520
|
+
return FromLiteral3(schema_, references_, value);
|
|
2521
|
+
case "Never":
|
|
2522
|
+
return FromNever2(schema_, references_, value);
|
|
2523
|
+
case "Not":
|
|
2524
|
+
return FromNot2(schema_, references_, value);
|
|
2525
|
+
case "Null":
|
|
2526
|
+
return FromNull2(schema_, references_, value);
|
|
2527
|
+
case "Number":
|
|
2528
|
+
return FromNumber2(schema_, references_, value);
|
|
2529
|
+
case "Object":
|
|
2530
|
+
return FromObject2(schema_, references_, value);
|
|
2531
|
+
case "Promise":
|
|
2532
|
+
return FromPromise2(schema_, references_, value);
|
|
2533
|
+
case "Record":
|
|
2534
|
+
return FromRecord2(schema_, references_, value);
|
|
2535
|
+
case "Ref":
|
|
2536
|
+
return FromRef2(schema_, references_, value);
|
|
2537
|
+
case "RegExp":
|
|
2538
|
+
return FromRegExp2(schema_, references_, value);
|
|
2539
|
+
case "String":
|
|
2540
|
+
return FromString2(schema_, references_, value);
|
|
2541
|
+
case "Symbol":
|
|
2542
|
+
return FromSymbol2(schema_, references_, value);
|
|
2543
|
+
case "TemplateLiteral":
|
|
2544
|
+
return FromTemplateLiteral3(schema_, references_, value);
|
|
2545
|
+
case "This":
|
|
2546
|
+
return FromThis(schema_, references_, value);
|
|
2547
|
+
case "Tuple":
|
|
2548
|
+
return FromTuple4(schema_, references_, value);
|
|
2549
|
+
case "Undefined":
|
|
2550
|
+
return FromUndefined2(schema_, references_, value);
|
|
2551
|
+
case "Union":
|
|
2552
|
+
return FromUnion6(schema_, references_, value);
|
|
2553
|
+
case "Uint8Array":
|
|
2554
|
+
return FromUint8Array2(schema_, references_, value);
|
|
2555
|
+
case "Unknown":
|
|
2556
|
+
return FromUnknown2(schema_, references_, value);
|
|
2557
|
+
case "Void":
|
|
2558
|
+
return FromVoid2(schema_, references_, value);
|
|
2559
|
+
default:
|
|
2560
|
+
if (!exports_type.Has(schema_[Kind]))
|
|
2561
|
+
throw new ValueCheckUnknownTypeError(schema_);
|
|
2562
|
+
return FromKind(schema_, references_, value);
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
function Check(...args) {
|
|
2566
|
+
return args.length === 3 ? Visit5(args[0], args[1], args[2]) : Visit5(args[0], [], args[1]);
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
// node_modules/@sinclair/typebox/build/esm/errors/errors.mjs
|
|
2570
|
+
var ValueErrorType;
|
|
2571
|
+
(function(ValueErrorType2) {
|
|
2572
|
+
ValueErrorType2[ValueErrorType2["ArrayContains"] = 0] = "ArrayContains";
|
|
2573
|
+
ValueErrorType2[ValueErrorType2["ArrayMaxContains"] = 1] = "ArrayMaxContains";
|
|
2574
|
+
ValueErrorType2[ValueErrorType2["ArrayMaxItems"] = 2] = "ArrayMaxItems";
|
|
2575
|
+
ValueErrorType2[ValueErrorType2["ArrayMinContains"] = 3] = "ArrayMinContains";
|
|
2576
|
+
ValueErrorType2[ValueErrorType2["ArrayMinItems"] = 4] = "ArrayMinItems";
|
|
2577
|
+
ValueErrorType2[ValueErrorType2["ArrayUniqueItems"] = 5] = "ArrayUniqueItems";
|
|
2578
|
+
ValueErrorType2[ValueErrorType2["Array"] = 6] = "Array";
|
|
2579
|
+
ValueErrorType2[ValueErrorType2["AsyncIterator"] = 7] = "AsyncIterator";
|
|
2580
|
+
ValueErrorType2[ValueErrorType2["BigIntExclusiveMaximum"] = 8] = "BigIntExclusiveMaximum";
|
|
2581
|
+
ValueErrorType2[ValueErrorType2["BigIntExclusiveMinimum"] = 9] = "BigIntExclusiveMinimum";
|
|
2582
|
+
ValueErrorType2[ValueErrorType2["BigIntMaximum"] = 10] = "BigIntMaximum";
|
|
2583
|
+
ValueErrorType2[ValueErrorType2["BigIntMinimum"] = 11] = "BigIntMinimum";
|
|
2584
|
+
ValueErrorType2[ValueErrorType2["BigIntMultipleOf"] = 12] = "BigIntMultipleOf";
|
|
2585
|
+
ValueErrorType2[ValueErrorType2["BigInt"] = 13] = "BigInt";
|
|
2586
|
+
ValueErrorType2[ValueErrorType2["Boolean"] = 14] = "Boolean";
|
|
2587
|
+
ValueErrorType2[ValueErrorType2["DateExclusiveMaximumTimestamp"] = 15] = "DateExclusiveMaximumTimestamp";
|
|
2588
|
+
ValueErrorType2[ValueErrorType2["DateExclusiveMinimumTimestamp"] = 16] = "DateExclusiveMinimumTimestamp";
|
|
2589
|
+
ValueErrorType2[ValueErrorType2["DateMaximumTimestamp"] = 17] = "DateMaximumTimestamp";
|
|
2590
|
+
ValueErrorType2[ValueErrorType2["DateMinimumTimestamp"] = 18] = "DateMinimumTimestamp";
|
|
2591
|
+
ValueErrorType2[ValueErrorType2["DateMultipleOfTimestamp"] = 19] = "DateMultipleOfTimestamp";
|
|
2592
|
+
ValueErrorType2[ValueErrorType2["Date"] = 20] = "Date";
|
|
2593
|
+
ValueErrorType2[ValueErrorType2["Function"] = 21] = "Function";
|
|
2594
|
+
ValueErrorType2[ValueErrorType2["IntegerExclusiveMaximum"] = 22] = "IntegerExclusiveMaximum";
|
|
2595
|
+
ValueErrorType2[ValueErrorType2["IntegerExclusiveMinimum"] = 23] = "IntegerExclusiveMinimum";
|
|
2596
|
+
ValueErrorType2[ValueErrorType2["IntegerMaximum"] = 24] = "IntegerMaximum";
|
|
2597
|
+
ValueErrorType2[ValueErrorType2["IntegerMinimum"] = 25] = "IntegerMinimum";
|
|
2598
|
+
ValueErrorType2[ValueErrorType2["IntegerMultipleOf"] = 26] = "IntegerMultipleOf";
|
|
2599
|
+
ValueErrorType2[ValueErrorType2["Integer"] = 27] = "Integer";
|
|
2600
|
+
ValueErrorType2[ValueErrorType2["IntersectUnevaluatedProperties"] = 28] = "IntersectUnevaluatedProperties";
|
|
2601
|
+
ValueErrorType2[ValueErrorType2["Intersect"] = 29] = "Intersect";
|
|
2602
|
+
ValueErrorType2[ValueErrorType2["Iterator"] = 30] = "Iterator";
|
|
2603
|
+
ValueErrorType2[ValueErrorType2["Kind"] = 31] = "Kind";
|
|
2604
|
+
ValueErrorType2[ValueErrorType2["Literal"] = 32] = "Literal";
|
|
2605
|
+
ValueErrorType2[ValueErrorType2["Never"] = 33] = "Never";
|
|
2606
|
+
ValueErrorType2[ValueErrorType2["Not"] = 34] = "Not";
|
|
2607
|
+
ValueErrorType2[ValueErrorType2["Null"] = 35] = "Null";
|
|
2608
|
+
ValueErrorType2[ValueErrorType2["NumberExclusiveMaximum"] = 36] = "NumberExclusiveMaximum";
|
|
2609
|
+
ValueErrorType2[ValueErrorType2["NumberExclusiveMinimum"] = 37] = "NumberExclusiveMinimum";
|
|
2610
|
+
ValueErrorType2[ValueErrorType2["NumberMaximum"] = 38] = "NumberMaximum";
|
|
2611
|
+
ValueErrorType2[ValueErrorType2["NumberMinimum"] = 39] = "NumberMinimum";
|
|
2612
|
+
ValueErrorType2[ValueErrorType2["NumberMultipleOf"] = 40] = "NumberMultipleOf";
|
|
2613
|
+
ValueErrorType2[ValueErrorType2["Number"] = 41] = "Number";
|
|
2614
|
+
ValueErrorType2[ValueErrorType2["ObjectAdditionalProperties"] = 42] = "ObjectAdditionalProperties";
|
|
2615
|
+
ValueErrorType2[ValueErrorType2["ObjectMaxProperties"] = 43] = "ObjectMaxProperties";
|
|
2616
|
+
ValueErrorType2[ValueErrorType2["ObjectMinProperties"] = 44] = "ObjectMinProperties";
|
|
2617
|
+
ValueErrorType2[ValueErrorType2["ObjectRequiredProperty"] = 45] = "ObjectRequiredProperty";
|
|
2618
|
+
ValueErrorType2[ValueErrorType2["Object"] = 46] = "Object";
|
|
2619
|
+
ValueErrorType2[ValueErrorType2["Promise"] = 47] = "Promise";
|
|
2620
|
+
ValueErrorType2[ValueErrorType2["RegExp"] = 48] = "RegExp";
|
|
2621
|
+
ValueErrorType2[ValueErrorType2["StringFormatUnknown"] = 49] = "StringFormatUnknown";
|
|
2622
|
+
ValueErrorType2[ValueErrorType2["StringFormat"] = 50] = "StringFormat";
|
|
2623
|
+
ValueErrorType2[ValueErrorType2["StringMaxLength"] = 51] = "StringMaxLength";
|
|
2624
|
+
ValueErrorType2[ValueErrorType2["StringMinLength"] = 52] = "StringMinLength";
|
|
2625
|
+
ValueErrorType2[ValueErrorType2["StringPattern"] = 53] = "StringPattern";
|
|
2626
|
+
ValueErrorType2[ValueErrorType2["String"] = 54] = "String";
|
|
2627
|
+
ValueErrorType2[ValueErrorType2["Symbol"] = 55] = "Symbol";
|
|
2628
|
+
ValueErrorType2[ValueErrorType2["TupleLength"] = 56] = "TupleLength";
|
|
2629
|
+
ValueErrorType2[ValueErrorType2["Tuple"] = 57] = "Tuple";
|
|
2630
|
+
ValueErrorType2[ValueErrorType2["Uint8ArrayMaxByteLength"] = 58] = "Uint8ArrayMaxByteLength";
|
|
2631
|
+
ValueErrorType2[ValueErrorType2["Uint8ArrayMinByteLength"] = 59] = "Uint8ArrayMinByteLength";
|
|
2632
|
+
ValueErrorType2[ValueErrorType2["Uint8Array"] = 60] = "Uint8Array";
|
|
2633
|
+
ValueErrorType2[ValueErrorType2["Undefined"] = 61] = "Undefined";
|
|
2634
|
+
ValueErrorType2[ValueErrorType2["Union"] = 62] = "Union";
|
|
2635
|
+
ValueErrorType2[ValueErrorType2["Void"] = 63] = "Void";
|
|
2636
|
+
})(ValueErrorType || (ValueErrorType = {}));
|
|
2637
|
+
|
|
2638
|
+
class ValueErrorsUnknownTypeError extends TypeBoxError {
|
|
2639
|
+
constructor(schema) {
|
|
2640
|
+
super("Unknown type");
|
|
2641
|
+
this.schema = schema;
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
function EscapeKey(key) {
|
|
2645
|
+
return key.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2646
|
+
}
|
|
2647
|
+
function IsDefined2(value) {
|
|
2648
|
+
return value !== undefined;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
class ValueErrorIterator {
|
|
2652
|
+
constructor(iterator) {
|
|
2653
|
+
this.iterator = iterator;
|
|
2654
|
+
}
|
|
2655
|
+
[Symbol.iterator]() {
|
|
2656
|
+
return this.iterator;
|
|
2657
|
+
}
|
|
2658
|
+
First() {
|
|
2659
|
+
const next = this.iterator.next();
|
|
2660
|
+
return next.done ? undefined : next.value;
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
function Create(errorType, schema, path, value, errors = []) {
|
|
2664
|
+
return {
|
|
2665
|
+
type: errorType,
|
|
2666
|
+
schema,
|
|
2667
|
+
path,
|
|
2668
|
+
value,
|
|
2669
|
+
message: GetErrorFunction()({ errorType, path, schema, value, errors }),
|
|
2670
|
+
errors
|
|
2671
|
+
};
|
|
2672
|
+
}
|
|
2673
|
+
function* FromAny3(schema, references, path, value) {}
|
|
2674
|
+
function* FromArgument2(schema, references, path, value) {}
|
|
2675
|
+
function* FromArray5(schema, references, path, value) {
|
|
2676
|
+
if (!IsArray(value)) {
|
|
2677
|
+
return yield Create(ValueErrorType.Array, schema, path, value);
|
|
2678
|
+
}
|
|
2679
|
+
if (IsDefined2(schema.minItems) && !(value.length >= schema.minItems)) {
|
|
2680
|
+
yield Create(ValueErrorType.ArrayMinItems, schema, path, value);
|
|
2681
|
+
}
|
|
2682
|
+
if (IsDefined2(schema.maxItems) && !(value.length <= schema.maxItems)) {
|
|
2683
|
+
yield Create(ValueErrorType.ArrayMaxItems, schema, path, value);
|
|
2684
|
+
}
|
|
2685
|
+
for (let i = 0;i < value.length; i++) {
|
|
2686
|
+
yield* Visit6(schema.items, references, `${path}/${i}`, value[i]);
|
|
2687
|
+
}
|
|
2688
|
+
if (schema.uniqueItems === true && !function() {
|
|
2689
|
+
const set = new Set;
|
|
2690
|
+
for (const element of value) {
|
|
2691
|
+
const hashed = Hash(element);
|
|
2692
|
+
if (set.has(hashed)) {
|
|
2693
|
+
return false;
|
|
2694
|
+
} else {
|
|
2695
|
+
set.add(hashed);
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
return true;
|
|
2699
|
+
}()) {
|
|
2700
|
+
yield Create(ValueErrorType.ArrayUniqueItems, schema, path, value);
|
|
2701
|
+
}
|
|
2702
|
+
if (!(IsDefined2(schema.contains) || IsDefined2(schema.minContains) || IsDefined2(schema.maxContains))) {
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
const containsSchema = IsDefined2(schema.contains) ? schema.contains : Never();
|
|
2706
|
+
const containsCount = value.reduce((acc, value2, index) => Visit6(containsSchema, references, `${path}${index}`, value2).next().done === true ? acc + 1 : acc, 0);
|
|
2707
|
+
if (containsCount === 0) {
|
|
2708
|
+
yield Create(ValueErrorType.ArrayContains, schema, path, value);
|
|
2709
|
+
}
|
|
2710
|
+
if (IsNumber(schema.minContains) && containsCount < schema.minContains) {
|
|
2711
|
+
yield Create(ValueErrorType.ArrayMinContains, schema, path, value);
|
|
2712
|
+
}
|
|
2713
|
+
if (IsNumber(schema.maxContains) && containsCount > schema.maxContains) {
|
|
2714
|
+
yield Create(ValueErrorType.ArrayMaxContains, schema, path, value);
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
function* FromAsyncIterator3(schema, references, path, value) {
|
|
2718
|
+
if (!IsAsyncIterator(value))
|
|
2719
|
+
yield Create(ValueErrorType.AsyncIterator, schema, path, value);
|
|
2720
|
+
}
|
|
2721
|
+
function* FromBigInt3(schema, references, path, value) {
|
|
2722
|
+
if (!IsBigInt(value))
|
|
2723
|
+
return yield Create(ValueErrorType.BigInt, schema, path, value);
|
|
2724
|
+
if (IsDefined2(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2725
|
+
yield Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value);
|
|
2726
|
+
}
|
|
2727
|
+
if (IsDefined2(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2728
|
+
yield Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value);
|
|
2729
|
+
}
|
|
2730
|
+
if (IsDefined2(schema.maximum) && !(value <= schema.maximum)) {
|
|
2731
|
+
yield Create(ValueErrorType.BigIntMaximum, schema, path, value);
|
|
2732
|
+
}
|
|
2733
|
+
if (IsDefined2(schema.minimum) && !(value >= schema.minimum)) {
|
|
2734
|
+
yield Create(ValueErrorType.BigIntMinimum, schema, path, value);
|
|
2735
|
+
}
|
|
2736
|
+
if (IsDefined2(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {
|
|
2737
|
+
yield Create(ValueErrorType.BigIntMultipleOf, schema, path, value);
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
function* FromBoolean3(schema, references, path, value) {
|
|
2741
|
+
if (!IsBoolean(value))
|
|
2742
|
+
yield Create(ValueErrorType.Boolean, schema, path, value);
|
|
2743
|
+
}
|
|
2744
|
+
function* FromConstructor3(schema, references, path, value) {
|
|
2745
|
+
yield* Visit6(schema.returns, references, path, value.prototype);
|
|
2746
|
+
}
|
|
2747
|
+
function* FromDate3(schema, references, path, value) {
|
|
2748
|
+
if (!IsDate(value))
|
|
2749
|
+
return yield Create(ValueErrorType.Date, schema, path, value);
|
|
2750
|
+
if (IsDefined2(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {
|
|
2751
|
+
yield Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value);
|
|
2752
|
+
}
|
|
2753
|
+
if (IsDefined2(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {
|
|
2754
|
+
yield Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value);
|
|
2755
|
+
}
|
|
2756
|
+
if (IsDefined2(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {
|
|
2757
|
+
yield Create(ValueErrorType.DateMaximumTimestamp, schema, path, value);
|
|
2758
|
+
}
|
|
2759
|
+
if (IsDefined2(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {
|
|
2760
|
+
yield Create(ValueErrorType.DateMinimumTimestamp, schema, path, value);
|
|
2761
|
+
}
|
|
2762
|
+
if (IsDefined2(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {
|
|
2763
|
+
yield Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value);
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
function* FromFunction3(schema, references, path, value) {
|
|
2767
|
+
if (!IsFunction(value))
|
|
2768
|
+
yield Create(ValueErrorType.Function, schema, path, value);
|
|
2769
|
+
}
|
|
2770
|
+
function* FromImport2(schema, references, path, value) {
|
|
2771
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
2772
|
+
const target = schema.$defs[schema.$ref];
|
|
2773
|
+
yield* Visit6(target, [...references, ...definitions], path, value);
|
|
2774
|
+
}
|
|
2775
|
+
function* FromInteger3(schema, references, path, value) {
|
|
2776
|
+
if (!IsInteger(value))
|
|
2777
|
+
return yield Create(ValueErrorType.Integer, schema, path, value);
|
|
2778
|
+
if (IsDefined2(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2779
|
+
yield Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value);
|
|
2780
|
+
}
|
|
2781
|
+
if (IsDefined2(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2782
|
+
yield Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value);
|
|
2783
|
+
}
|
|
2784
|
+
if (IsDefined2(schema.maximum) && !(value <= schema.maximum)) {
|
|
2785
|
+
yield Create(ValueErrorType.IntegerMaximum, schema, path, value);
|
|
2786
|
+
}
|
|
2787
|
+
if (IsDefined2(schema.minimum) && !(value >= schema.minimum)) {
|
|
2788
|
+
yield Create(ValueErrorType.IntegerMinimum, schema, path, value);
|
|
2789
|
+
}
|
|
2790
|
+
if (IsDefined2(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
2791
|
+
yield Create(ValueErrorType.IntegerMultipleOf, schema, path, value);
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
function* FromIntersect5(schema, references, path, value) {
|
|
2795
|
+
let hasError = false;
|
|
2796
|
+
for (const inner of schema.allOf) {
|
|
2797
|
+
for (const error of Visit6(inner, references, path, value)) {
|
|
2798
|
+
hasError = true;
|
|
2799
|
+
yield error;
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
if (hasError) {
|
|
2803
|
+
return yield Create(ValueErrorType.Intersect, schema, path, value);
|
|
2804
|
+
}
|
|
2805
|
+
if (schema.unevaluatedProperties === false) {
|
|
2806
|
+
const keyCheck = new RegExp(KeyOfPattern(schema));
|
|
2807
|
+
for (const valueKey of Object.getOwnPropertyNames(value)) {
|
|
2808
|
+
if (!keyCheck.test(valueKey)) {
|
|
2809
|
+
yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value);
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
if (typeof schema.unevaluatedProperties === "object") {
|
|
2814
|
+
const keyCheck = new RegExp(KeyOfPattern(schema));
|
|
2815
|
+
for (const valueKey of Object.getOwnPropertyNames(value)) {
|
|
2816
|
+
if (!keyCheck.test(valueKey)) {
|
|
2817
|
+
const next = Visit6(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next();
|
|
2818
|
+
if (!next.done)
|
|
2819
|
+
yield next.value;
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
function* FromIterator3(schema, references, path, value) {
|
|
2825
|
+
if (!IsIterator(value))
|
|
2826
|
+
yield Create(ValueErrorType.Iterator, schema, path, value);
|
|
2827
|
+
}
|
|
2828
|
+
function* FromLiteral4(schema, references, path, value) {
|
|
2829
|
+
if (!(value === schema.const))
|
|
2830
|
+
yield Create(ValueErrorType.Literal, schema, path, value);
|
|
2831
|
+
}
|
|
2832
|
+
function* FromNever3(schema, references, path, value) {
|
|
2833
|
+
yield Create(ValueErrorType.Never, schema, path, value);
|
|
2834
|
+
}
|
|
2835
|
+
function* FromNot3(schema, references, path, value) {
|
|
2836
|
+
if (Visit6(schema.not, references, path, value).next().done === true)
|
|
2837
|
+
yield Create(ValueErrorType.Not, schema, path, value);
|
|
2838
|
+
}
|
|
2839
|
+
function* FromNull3(schema, references, path, value) {
|
|
2840
|
+
if (!IsNull(value))
|
|
2841
|
+
yield Create(ValueErrorType.Null, schema, path, value);
|
|
2842
|
+
}
|
|
2843
|
+
function* FromNumber3(schema, references, path, value) {
|
|
2844
|
+
if (!TypeSystemPolicy.IsNumberLike(value))
|
|
2845
|
+
return yield Create(ValueErrorType.Number, schema, path, value);
|
|
2846
|
+
if (IsDefined2(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
2847
|
+
yield Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value);
|
|
2848
|
+
}
|
|
2849
|
+
if (IsDefined2(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
2850
|
+
yield Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value);
|
|
2851
|
+
}
|
|
2852
|
+
if (IsDefined2(schema.maximum) && !(value <= schema.maximum)) {
|
|
2853
|
+
yield Create(ValueErrorType.NumberMaximum, schema, path, value);
|
|
2854
|
+
}
|
|
2855
|
+
if (IsDefined2(schema.minimum) && !(value >= schema.minimum)) {
|
|
2856
|
+
yield Create(ValueErrorType.NumberMinimum, schema, path, value);
|
|
2857
|
+
}
|
|
2858
|
+
if (IsDefined2(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
2859
|
+
yield Create(ValueErrorType.NumberMultipleOf, schema, path, value);
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
function* FromObject3(schema, references, path, value) {
|
|
2863
|
+
if (!TypeSystemPolicy.IsObjectLike(value))
|
|
2864
|
+
return yield Create(ValueErrorType.Object, schema, path, value);
|
|
2865
|
+
if (IsDefined2(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
2866
|
+
yield Create(ValueErrorType.ObjectMinProperties, schema, path, value);
|
|
2867
|
+
}
|
|
2868
|
+
if (IsDefined2(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
2869
|
+
yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value);
|
|
2870
|
+
}
|
|
2871
|
+
const requiredKeys = Array.isArray(schema.required) ? schema.required : [];
|
|
2872
|
+
const knownKeys = Object.getOwnPropertyNames(schema.properties);
|
|
2873
|
+
const unknownKeys = Object.getOwnPropertyNames(value);
|
|
2874
|
+
for (const requiredKey of requiredKeys) {
|
|
2875
|
+
if (unknownKeys.includes(requiredKey))
|
|
2876
|
+
continue;
|
|
2877
|
+
yield Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], `${path}/${EscapeKey(requiredKey)}`, undefined);
|
|
2878
|
+
}
|
|
2879
|
+
if (schema.additionalProperties === false) {
|
|
2880
|
+
for (const valueKey of unknownKeys) {
|
|
2881
|
+
if (!knownKeys.includes(valueKey)) {
|
|
2882
|
+
yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(valueKey)}`, value[valueKey]);
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
if (typeof schema.additionalProperties === "object") {
|
|
2887
|
+
for (const valueKey of unknownKeys) {
|
|
2888
|
+
if (knownKeys.includes(valueKey))
|
|
2889
|
+
continue;
|
|
2890
|
+
yield* Visit6(schema.additionalProperties, references, `${path}/${EscapeKey(valueKey)}`, value[valueKey]);
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
for (const knownKey of knownKeys) {
|
|
2894
|
+
const property = schema.properties[knownKey];
|
|
2895
|
+
if (schema.required && schema.required.includes(knownKey)) {
|
|
2896
|
+
yield* Visit6(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]);
|
|
2897
|
+
if (ExtendsUndefinedCheck(schema) && !(knownKey in value)) {
|
|
2898
|
+
yield Create(ValueErrorType.ObjectRequiredProperty, property, `${path}/${EscapeKey(knownKey)}`, undefined);
|
|
2899
|
+
}
|
|
2900
|
+
} else {
|
|
2901
|
+
if (TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) {
|
|
2902
|
+
yield* Visit6(property, references, `${path}/${EscapeKey(knownKey)}`, value[knownKey]);
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
function* FromPromise3(schema, references, path, value) {
|
|
2908
|
+
if (!IsPromise(value))
|
|
2909
|
+
yield Create(ValueErrorType.Promise, schema, path, value);
|
|
2910
|
+
}
|
|
2911
|
+
function* FromRecord3(schema, references, path, value) {
|
|
2912
|
+
if (!TypeSystemPolicy.IsRecordLike(value))
|
|
2913
|
+
return yield Create(ValueErrorType.Object, schema, path, value);
|
|
2914
|
+
if (IsDefined2(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
2915
|
+
yield Create(ValueErrorType.ObjectMinProperties, schema, path, value);
|
|
2916
|
+
}
|
|
2917
|
+
if (IsDefined2(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
2918
|
+
yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value);
|
|
2919
|
+
}
|
|
2920
|
+
const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];
|
|
2921
|
+
const regex = new RegExp(patternKey);
|
|
2922
|
+
for (const [propertyKey, propertyValue] of Object.entries(value)) {
|
|
2923
|
+
if (regex.test(propertyKey))
|
|
2924
|
+
yield* Visit6(patternSchema, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue);
|
|
2925
|
+
}
|
|
2926
|
+
if (typeof schema.additionalProperties === "object") {
|
|
2927
|
+
for (const [propertyKey, propertyValue] of Object.entries(value)) {
|
|
2928
|
+
if (!regex.test(propertyKey))
|
|
2929
|
+
yield* Visit6(schema.additionalProperties, references, `${path}/${EscapeKey(propertyKey)}`, propertyValue);
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
if (schema.additionalProperties === false) {
|
|
2933
|
+
for (const [propertyKey, propertyValue] of Object.entries(value)) {
|
|
2934
|
+
if (regex.test(propertyKey))
|
|
2935
|
+
continue;
|
|
2936
|
+
return yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${EscapeKey(propertyKey)}`, propertyValue);
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
function* FromRef3(schema, references, path, value) {
|
|
2941
|
+
yield* Visit6(Deref(schema, references), references, path, value);
|
|
2942
|
+
}
|
|
2943
|
+
function* FromRegExp3(schema, references, path, value) {
|
|
2944
|
+
if (!IsString(value))
|
|
2945
|
+
return yield Create(ValueErrorType.String, schema, path, value);
|
|
2946
|
+
if (IsDefined2(schema.minLength) && !(value.length >= schema.minLength)) {
|
|
2947
|
+
yield Create(ValueErrorType.StringMinLength, schema, path, value);
|
|
2948
|
+
}
|
|
2949
|
+
if (IsDefined2(schema.maxLength) && !(value.length <= schema.maxLength)) {
|
|
2950
|
+
yield Create(ValueErrorType.StringMaxLength, schema, path, value);
|
|
2951
|
+
}
|
|
2952
|
+
const regex = new RegExp(schema.source, schema.flags);
|
|
2953
|
+
if (!regex.test(value)) {
|
|
2954
|
+
return yield Create(ValueErrorType.RegExp, schema, path, value);
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
function* FromString3(schema, references, path, value) {
|
|
2958
|
+
if (!IsString(value))
|
|
2959
|
+
return yield Create(ValueErrorType.String, schema, path, value);
|
|
2960
|
+
if (IsDefined2(schema.minLength) && !(value.length >= schema.minLength)) {
|
|
2961
|
+
yield Create(ValueErrorType.StringMinLength, schema, path, value);
|
|
2962
|
+
}
|
|
2963
|
+
if (IsDefined2(schema.maxLength) && !(value.length <= schema.maxLength)) {
|
|
2964
|
+
yield Create(ValueErrorType.StringMaxLength, schema, path, value);
|
|
2965
|
+
}
|
|
2966
|
+
if (IsString(schema.pattern)) {
|
|
2967
|
+
const regex = new RegExp(schema.pattern);
|
|
2968
|
+
if (!regex.test(value)) {
|
|
2969
|
+
yield Create(ValueErrorType.StringPattern, schema, path, value);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
if (IsString(schema.format)) {
|
|
2973
|
+
if (!exports_format.Has(schema.format)) {
|
|
2974
|
+
yield Create(ValueErrorType.StringFormatUnknown, schema, path, value);
|
|
2975
|
+
} else {
|
|
2976
|
+
const format = exports_format.Get(schema.format);
|
|
2977
|
+
if (!format(value)) {
|
|
2978
|
+
yield Create(ValueErrorType.StringFormat, schema, path, value);
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
function* FromSymbol3(schema, references, path, value) {
|
|
2984
|
+
if (!IsSymbol(value))
|
|
2985
|
+
yield Create(ValueErrorType.Symbol, schema, path, value);
|
|
2986
|
+
}
|
|
2987
|
+
function* FromTemplateLiteral4(schema, references, path, value) {
|
|
2988
|
+
if (!IsString(value))
|
|
2989
|
+
return yield Create(ValueErrorType.String, schema, path, value);
|
|
2990
|
+
const regex = new RegExp(schema.pattern);
|
|
2991
|
+
if (!regex.test(value)) {
|
|
2992
|
+
yield Create(ValueErrorType.StringPattern, schema, path, value);
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
function* FromThis2(schema, references, path, value) {
|
|
2996
|
+
yield* Visit6(Deref(schema, references), references, path, value);
|
|
2997
|
+
}
|
|
2998
|
+
function* FromTuple5(schema, references, path, value) {
|
|
2999
|
+
if (!IsArray(value))
|
|
3000
|
+
return yield Create(ValueErrorType.Tuple, schema, path, value);
|
|
3001
|
+
if (schema.items === undefined && !(value.length === 0)) {
|
|
3002
|
+
return yield Create(ValueErrorType.TupleLength, schema, path, value);
|
|
3003
|
+
}
|
|
3004
|
+
if (!(value.length === schema.maxItems)) {
|
|
3005
|
+
return yield Create(ValueErrorType.TupleLength, schema, path, value);
|
|
3006
|
+
}
|
|
3007
|
+
if (!schema.items) {
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
for (let i = 0;i < schema.items.length; i++) {
|
|
3011
|
+
yield* Visit6(schema.items[i], references, `${path}/${i}`, value[i]);
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
function* FromUndefined3(schema, references, path, value) {
|
|
3015
|
+
if (!IsUndefined(value))
|
|
3016
|
+
yield Create(ValueErrorType.Undefined, schema, path, value);
|
|
3017
|
+
}
|
|
3018
|
+
function* FromUnion7(schema, references, path, value) {
|
|
3019
|
+
if (Check(schema, references, value))
|
|
3020
|
+
return;
|
|
3021
|
+
const errors = schema.anyOf.map((variant) => new ValueErrorIterator(Visit6(variant, references, path, value)));
|
|
3022
|
+
yield Create(ValueErrorType.Union, schema, path, value, errors);
|
|
3023
|
+
}
|
|
3024
|
+
function* FromUint8Array3(schema, references, path, value) {
|
|
3025
|
+
if (!IsUint8Array(value))
|
|
3026
|
+
return yield Create(ValueErrorType.Uint8Array, schema, path, value);
|
|
3027
|
+
if (IsDefined2(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {
|
|
3028
|
+
yield Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value);
|
|
3029
|
+
}
|
|
3030
|
+
if (IsDefined2(schema.minByteLength) && !(value.length >= schema.minByteLength)) {
|
|
3031
|
+
yield Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value);
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
function* FromUnknown3(schema, references, path, value) {}
|
|
3035
|
+
function* FromVoid3(schema, references, path, value) {
|
|
3036
|
+
if (!TypeSystemPolicy.IsVoidLike(value))
|
|
3037
|
+
yield Create(ValueErrorType.Void, schema, path, value);
|
|
3038
|
+
}
|
|
3039
|
+
function* FromKind2(schema, references, path, value) {
|
|
3040
|
+
const check = exports_type.Get(schema[Kind]);
|
|
3041
|
+
if (!check(schema, value))
|
|
3042
|
+
yield Create(ValueErrorType.Kind, schema, path, value);
|
|
3043
|
+
}
|
|
3044
|
+
function* Visit6(schema, references, path, value) {
|
|
3045
|
+
const references_ = IsDefined2(schema.$id) ? [...references, schema] : references;
|
|
3046
|
+
const schema_ = schema;
|
|
3047
|
+
switch (schema_[Kind]) {
|
|
3048
|
+
case "Any":
|
|
3049
|
+
return yield* FromAny3(schema_, references_, path, value);
|
|
3050
|
+
case "Argument":
|
|
3051
|
+
return yield* FromArgument2(schema_, references_, path, value);
|
|
3052
|
+
case "Array":
|
|
3053
|
+
return yield* FromArray5(schema_, references_, path, value);
|
|
3054
|
+
case "AsyncIterator":
|
|
3055
|
+
return yield* FromAsyncIterator3(schema_, references_, path, value);
|
|
3056
|
+
case "BigInt":
|
|
3057
|
+
return yield* FromBigInt3(schema_, references_, path, value);
|
|
3058
|
+
case "Boolean":
|
|
3059
|
+
return yield* FromBoolean3(schema_, references_, path, value);
|
|
3060
|
+
case "Constructor":
|
|
3061
|
+
return yield* FromConstructor3(schema_, references_, path, value);
|
|
3062
|
+
case "Date":
|
|
3063
|
+
return yield* FromDate3(schema_, references_, path, value);
|
|
3064
|
+
case "Function":
|
|
3065
|
+
return yield* FromFunction3(schema_, references_, path, value);
|
|
3066
|
+
case "Import":
|
|
3067
|
+
return yield* FromImport2(schema_, references_, path, value);
|
|
3068
|
+
case "Integer":
|
|
3069
|
+
return yield* FromInteger3(schema_, references_, path, value);
|
|
3070
|
+
case "Intersect":
|
|
3071
|
+
return yield* FromIntersect5(schema_, references_, path, value);
|
|
3072
|
+
case "Iterator":
|
|
3073
|
+
return yield* FromIterator3(schema_, references_, path, value);
|
|
3074
|
+
case "Literal":
|
|
3075
|
+
return yield* FromLiteral4(schema_, references_, path, value);
|
|
3076
|
+
case "Never":
|
|
3077
|
+
return yield* FromNever3(schema_, references_, path, value);
|
|
3078
|
+
case "Not":
|
|
3079
|
+
return yield* FromNot3(schema_, references_, path, value);
|
|
3080
|
+
case "Null":
|
|
3081
|
+
return yield* FromNull3(schema_, references_, path, value);
|
|
3082
|
+
case "Number":
|
|
3083
|
+
return yield* FromNumber3(schema_, references_, path, value);
|
|
3084
|
+
case "Object":
|
|
3085
|
+
return yield* FromObject3(schema_, references_, path, value);
|
|
3086
|
+
case "Promise":
|
|
3087
|
+
return yield* FromPromise3(schema_, references_, path, value);
|
|
3088
|
+
case "Record":
|
|
3089
|
+
return yield* FromRecord3(schema_, references_, path, value);
|
|
3090
|
+
case "Ref":
|
|
3091
|
+
return yield* FromRef3(schema_, references_, path, value);
|
|
3092
|
+
case "RegExp":
|
|
3093
|
+
return yield* FromRegExp3(schema_, references_, path, value);
|
|
3094
|
+
case "String":
|
|
3095
|
+
return yield* FromString3(schema_, references_, path, value);
|
|
3096
|
+
case "Symbol":
|
|
3097
|
+
return yield* FromSymbol3(schema_, references_, path, value);
|
|
3098
|
+
case "TemplateLiteral":
|
|
3099
|
+
return yield* FromTemplateLiteral4(schema_, references_, path, value);
|
|
3100
|
+
case "This":
|
|
3101
|
+
return yield* FromThis2(schema_, references_, path, value);
|
|
3102
|
+
case "Tuple":
|
|
3103
|
+
return yield* FromTuple5(schema_, references_, path, value);
|
|
3104
|
+
case "Undefined":
|
|
3105
|
+
return yield* FromUndefined3(schema_, references_, path, value);
|
|
3106
|
+
case "Union":
|
|
3107
|
+
return yield* FromUnion7(schema_, references_, path, value);
|
|
3108
|
+
case "Uint8Array":
|
|
3109
|
+
return yield* FromUint8Array3(schema_, references_, path, value);
|
|
3110
|
+
case "Unknown":
|
|
3111
|
+
return yield* FromUnknown3(schema_, references_, path, value);
|
|
3112
|
+
case "Void":
|
|
3113
|
+
return yield* FromVoid3(schema_, references_, path, value);
|
|
3114
|
+
default:
|
|
3115
|
+
if (!exports_type.Has(schema_[Kind]))
|
|
3116
|
+
throw new ValueErrorsUnknownTypeError(schema);
|
|
3117
|
+
return yield* FromKind2(schema_, references_, path, value);
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
function Errors(...args) {
|
|
3121
|
+
const iterator = args.length === 3 ? Visit6(args[0], args[1], "", args[2]) : Visit6(args[0], [], "", args[1]);
|
|
3122
|
+
return new ValueErrorIterator(iterator);
|
|
3123
|
+
}
|
|
3124
|
+
|
|
3125
|
+
// node_modules/@sinclair/typebox/build/esm/value/assert/assert.mjs
|
|
3126
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
3127
|
+
if (kind === "m")
|
|
3128
|
+
throw new TypeError("Private method is not writable");
|
|
3129
|
+
if (kind === "a" && !f)
|
|
3130
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
3131
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
3132
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3133
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
3134
|
+
};
|
|
3135
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
3136
|
+
if (kind === "a" && !f)
|
|
3137
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
3138
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
3139
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3140
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3141
|
+
};
|
|
3142
|
+
var _AssertError_instances;
|
|
3143
|
+
var _AssertError_iterator;
|
|
3144
|
+
var _AssertError_Iterator;
|
|
3145
|
+
|
|
3146
|
+
class AssertError extends TypeBoxError {
|
|
3147
|
+
constructor(iterator) {
|
|
3148
|
+
const error = iterator.First();
|
|
3149
|
+
super(error === undefined ? "Invalid Value" : error.message);
|
|
3150
|
+
_AssertError_instances.add(this);
|
|
3151
|
+
_AssertError_iterator.set(this, undefined);
|
|
3152
|
+
__classPrivateFieldSet(this, _AssertError_iterator, iterator, "f");
|
|
3153
|
+
this.error = error;
|
|
3154
|
+
}
|
|
3155
|
+
Errors() {
|
|
3156
|
+
return new ValueErrorIterator(__classPrivateFieldGet(this, _AssertError_instances, "m", _AssertError_Iterator).call(this));
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
_AssertError_iterator = new WeakMap, _AssertError_instances = new WeakSet, _AssertError_Iterator = function* _AssertError_Iterator2() {
|
|
3160
|
+
if (this.error)
|
|
3161
|
+
yield this.error;
|
|
3162
|
+
yield* __classPrivateFieldGet(this, _AssertError_iterator, "f");
|
|
3163
|
+
};
|
|
3164
|
+
function AssertValue(schema, references, value) {
|
|
3165
|
+
if (Check(schema, references, value))
|
|
3166
|
+
return;
|
|
3167
|
+
throw new AssertError(Errors(schema, references, value));
|
|
3168
|
+
}
|
|
3169
|
+
function Assert(...args) {
|
|
3170
|
+
return args.length === 3 ? AssertValue(args[0], args[1], args[2]) : AssertValue(args[0], [], args[1]);
|
|
3171
|
+
}
|
|
3172
|
+
// node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs
|
|
3173
|
+
function FromObject4(value) {
|
|
3174
|
+
const Acc = {};
|
|
3175
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
3176
|
+
Acc[key] = Clone2(value[key]);
|
|
3177
|
+
}
|
|
3178
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
3179
|
+
Acc[key] = Clone2(value[key]);
|
|
3180
|
+
}
|
|
3181
|
+
return Acc;
|
|
3182
|
+
}
|
|
3183
|
+
function FromArray6(value) {
|
|
3184
|
+
return value.map((element) => Clone2(element));
|
|
3185
|
+
}
|
|
3186
|
+
function FromTypedArray(value) {
|
|
3187
|
+
return value.slice();
|
|
3188
|
+
}
|
|
3189
|
+
function FromMap(value) {
|
|
3190
|
+
return new Map(Clone2([...value.entries()]));
|
|
3191
|
+
}
|
|
3192
|
+
function FromSet(value) {
|
|
3193
|
+
return new Set(Clone2([...value.entries()]));
|
|
3194
|
+
}
|
|
3195
|
+
function FromDate4(value) {
|
|
3196
|
+
return new Date(value.toISOString());
|
|
3197
|
+
}
|
|
3198
|
+
function FromValue(value) {
|
|
3199
|
+
return value;
|
|
3200
|
+
}
|
|
3201
|
+
function Clone2(value) {
|
|
3202
|
+
if (IsArray(value))
|
|
3203
|
+
return FromArray6(value);
|
|
3204
|
+
if (IsDate(value))
|
|
3205
|
+
return FromDate4(value);
|
|
3206
|
+
if (IsTypedArray(value))
|
|
3207
|
+
return FromTypedArray(value);
|
|
3208
|
+
if (IsMap(value))
|
|
3209
|
+
return FromMap(value);
|
|
3210
|
+
if (IsSet(value))
|
|
3211
|
+
return FromSet(value);
|
|
3212
|
+
if (IsObject(value))
|
|
3213
|
+
return FromObject4(value);
|
|
3214
|
+
if (IsValueType(value))
|
|
3215
|
+
return FromValue(value);
|
|
3216
|
+
throw new Error("ValueClone: Unable to clone value");
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
// node_modules/@sinclair/typebox/build/esm/value/create/create.mjs
|
|
3220
|
+
class ValueCreateError extends TypeBoxError {
|
|
3221
|
+
constructor(schema, message) {
|
|
3222
|
+
super(message);
|
|
3223
|
+
this.schema = schema;
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
function FromDefault(value) {
|
|
3227
|
+
return IsFunction(value) ? value() : Clone2(value);
|
|
3228
|
+
}
|
|
3229
|
+
function FromAny4(schema, references) {
|
|
3230
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3231
|
+
return FromDefault(schema.default);
|
|
3232
|
+
} else {
|
|
3233
|
+
return {};
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
3236
|
+
function FromArgument3(schema, references) {
|
|
3237
|
+
return {};
|
|
3238
|
+
}
|
|
3239
|
+
function FromArray7(schema, references) {
|
|
3240
|
+
if (schema.uniqueItems === true && !HasPropertyKey(schema, "default")) {
|
|
3241
|
+
throw new ValueCreateError(schema, "Array with the uniqueItems constraint requires a default value");
|
|
3242
|
+
} else if ("contains" in schema && !HasPropertyKey(schema, "default")) {
|
|
3243
|
+
throw new ValueCreateError(schema, "Array with the contains constraint requires a default value");
|
|
3244
|
+
} else if ("default" in schema) {
|
|
3245
|
+
return FromDefault(schema.default);
|
|
3246
|
+
} else if (schema.minItems !== undefined) {
|
|
3247
|
+
return Array.from({ length: schema.minItems }).map((item) => {
|
|
3248
|
+
return Visit7(schema.items, references);
|
|
3249
|
+
});
|
|
3250
|
+
} else {
|
|
3251
|
+
return [];
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
function FromAsyncIterator4(schema, references) {
|
|
3255
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3256
|
+
return FromDefault(schema.default);
|
|
3257
|
+
} else {
|
|
3258
|
+
return async function* () {}();
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
function FromBigInt4(schema, references) {
|
|
3262
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3263
|
+
return FromDefault(schema.default);
|
|
3264
|
+
} else {
|
|
3265
|
+
return BigInt(0);
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
function FromBoolean4(schema, references) {
|
|
3269
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3270
|
+
return FromDefault(schema.default);
|
|
3271
|
+
} else {
|
|
3272
|
+
return false;
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
function FromConstructor4(schema, references) {
|
|
3276
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3277
|
+
return FromDefault(schema.default);
|
|
3278
|
+
} else {
|
|
3279
|
+
const value = Visit7(schema.returns, references);
|
|
3280
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
3281
|
+
return class {
|
|
3282
|
+
constructor() {
|
|
3283
|
+
for (const [key, val] of Object.entries(value)) {
|
|
3284
|
+
const self = this;
|
|
3285
|
+
self[key] = val;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
};
|
|
3289
|
+
} else {
|
|
3290
|
+
return class {
|
|
3291
|
+
};
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
function FromDate5(schema, references) {
|
|
3296
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3297
|
+
return FromDefault(schema.default);
|
|
3298
|
+
} else if (schema.minimumTimestamp !== undefined) {
|
|
3299
|
+
return new Date(schema.minimumTimestamp);
|
|
3300
|
+
} else {
|
|
3301
|
+
return new Date;
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
function FromFunction4(schema, references) {
|
|
3305
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3306
|
+
return FromDefault(schema.default);
|
|
3307
|
+
} else {
|
|
3308
|
+
return () => Visit7(schema.returns, references);
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
function FromImport3(schema, references) {
|
|
3312
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
3313
|
+
const target = schema.$defs[schema.$ref];
|
|
3314
|
+
return Visit7(target, [...references, ...definitions]);
|
|
3315
|
+
}
|
|
3316
|
+
function FromInteger4(schema, references) {
|
|
3317
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3318
|
+
return FromDefault(schema.default);
|
|
3319
|
+
} else if (schema.minimum !== undefined) {
|
|
3320
|
+
return schema.minimum;
|
|
3321
|
+
} else {
|
|
3322
|
+
return 0;
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
function FromIntersect6(schema, references) {
|
|
3326
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3327
|
+
return FromDefault(schema.default);
|
|
3328
|
+
} else {
|
|
3329
|
+
const value = schema.allOf.reduce((acc, schema2) => {
|
|
3330
|
+
const next = Visit7(schema2, references);
|
|
3331
|
+
return typeof next === "object" ? { ...acc, ...next } : next;
|
|
3332
|
+
}, {});
|
|
3333
|
+
if (!Check(schema, references, value))
|
|
3334
|
+
throw new ValueCreateError(schema, "Intersect produced invalid value. Consider using a default value.");
|
|
3335
|
+
return value;
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
function FromIterator4(schema, references) {
|
|
3339
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3340
|
+
return FromDefault(schema.default);
|
|
3341
|
+
} else {
|
|
3342
|
+
return function* () {}();
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
function FromLiteral5(schema, references) {
|
|
3346
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3347
|
+
return FromDefault(schema.default);
|
|
3348
|
+
} else {
|
|
3349
|
+
return schema.const;
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
function FromNever4(schema, references) {
|
|
3353
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3354
|
+
return FromDefault(schema.default);
|
|
3355
|
+
} else {
|
|
3356
|
+
throw new ValueCreateError(schema, "Never types cannot be created. Consider using a default value.");
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
function FromNot4(schema, references) {
|
|
3360
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3361
|
+
return FromDefault(schema.default);
|
|
3362
|
+
} else {
|
|
3363
|
+
throw new ValueCreateError(schema, "Not types must have a default value");
|
|
3364
|
+
}
|
|
3365
|
+
}
|
|
3366
|
+
function FromNull4(schema, references) {
|
|
3367
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3368
|
+
return FromDefault(schema.default);
|
|
3369
|
+
} else {
|
|
3370
|
+
return null;
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
function FromNumber4(schema, references) {
|
|
3374
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3375
|
+
return FromDefault(schema.default);
|
|
3376
|
+
} else if (schema.minimum !== undefined) {
|
|
3377
|
+
return schema.minimum;
|
|
3378
|
+
} else {
|
|
3379
|
+
return 0;
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
function FromObject5(schema, references) {
|
|
3383
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3384
|
+
return FromDefault(schema.default);
|
|
3385
|
+
} else {
|
|
3386
|
+
const required = new Set(schema.required);
|
|
3387
|
+
const Acc = {};
|
|
3388
|
+
for (const [key, subschema] of Object.entries(schema.properties)) {
|
|
3389
|
+
if (!required.has(key))
|
|
3390
|
+
continue;
|
|
3391
|
+
Acc[key] = Visit7(subschema, references);
|
|
3392
|
+
}
|
|
3393
|
+
return Acc;
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
function FromPromise4(schema, references) {
|
|
3397
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3398
|
+
return FromDefault(schema.default);
|
|
3399
|
+
} else {
|
|
3400
|
+
return Promise.resolve(Visit7(schema.item, references));
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
function FromRecord4(schema, references) {
|
|
3404
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3405
|
+
return FromDefault(schema.default);
|
|
3406
|
+
} else {
|
|
3407
|
+
return {};
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
function FromRef4(schema, references) {
|
|
3411
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3412
|
+
return FromDefault(schema.default);
|
|
3413
|
+
} else {
|
|
3414
|
+
return Visit7(Deref(schema, references), references);
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
function FromRegExp4(schema, references) {
|
|
3418
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3419
|
+
return FromDefault(schema.default);
|
|
3420
|
+
} else {
|
|
3421
|
+
throw new ValueCreateError(schema, "RegExp types cannot be created. Consider using a default value.");
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
function FromString4(schema, references) {
|
|
3425
|
+
if (schema.pattern !== undefined) {
|
|
3426
|
+
if (!HasPropertyKey(schema, "default")) {
|
|
3427
|
+
throw new ValueCreateError(schema, "String types with patterns must specify a default value");
|
|
3428
|
+
} else {
|
|
3429
|
+
return FromDefault(schema.default);
|
|
3430
|
+
}
|
|
3431
|
+
} else if (schema.format !== undefined) {
|
|
3432
|
+
if (!HasPropertyKey(schema, "default")) {
|
|
3433
|
+
throw new ValueCreateError(schema, "String types with formats must specify a default value");
|
|
3434
|
+
} else {
|
|
3435
|
+
return FromDefault(schema.default);
|
|
3436
|
+
}
|
|
3437
|
+
} else {
|
|
3438
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3439
|
+
return FromDefault(schema.default);
|
|
3440
|
+
} else if (schema.minLength !== undefined) {
|
|
3441
|
+
return Array.from({ length: schema.minLength }).map(() => " ").join("");
|
|
3442
|
+
} else {
|
|
3443
|
+
return "";
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3447
|
+
function FromSymbol4(schema, references) {
|
|
3448
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3449
|
+
return FromDefault(schema.default);
|
|
3450
|
+
} else if ("value" in schema) {
|
|
3451
|
+
return Symbol.for(schema.value);
|
|
3452
|
+
} else {
|
|
3453
|
+
return Symbol();
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
function FromTemplateLiteral5(schema, references) {
|
|
3457
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3458
|
+
return FromDefault(schema.default);
|
|
3459
|
+
}
|
|
3460
|
+
if (!IsTemplateLiteralFinite(schema))
|
|
3461
|
+
throw new ValueCreateError(schema, "Can only create template literals that produce a finite variants. Consider using a default value.");
|
|
3462
|
+
const generated = TemplateLiteralGenerate(schema);
|
|
3463
|
+
return generated[0];
|
|
3464
|
+
}
|
|
3465
|
+
function FromThis3(schema, references) {
|
|
3466
|
+
if (recursiveDepth++ > recursiveMaxDepth)
|
|
3467
|
+
throw new ValueCreateError(schema, "Cannot create recursive type as it appears possibly infinite. Consider using a default.");
|
|
3468
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3469
|
+
return FromDefault(schema.default);
|
|
3470
|
+
} else {
|
|
3471
|
+
return Visit7(Deref(schema, references), references);
|
|
3472
|
+
}
|
|
3473
|
+
}
|
|
3474
|
+
function FromTuple6(schema, references) {
|
|
3475
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3476
|
+
return FromDefault(schema.default);
|
|
3477
|
+
}
|
|
3478
|
+
if (schema.items === undefined) {
|
|
3479
|
+
return [];
|
|
3480
|
+
} else {
|
|
3481
|
+
return Array.from({ length: schema.minItems }).map((_, index) => Visit7(schema.items[index], references));
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
function FromUndefined4(schema, references) {
|
|
3485
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3486
|
+
return FromDefault(schema.default);
|
|
3487
|
+
} else {
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
function FromUnion8(schema, references) {
|
|
3492
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3493
|
+
return FromDefault(schema.default);
|
|
3494
|
+
} else if (schema.anyOf.length === 0) {
|
|
3495
|
+
throw new Error("ValueCreate.Union: Cannot create Union with zero variants");
|
|
3496
|
+
} else {
|
|
3497
|
+
return Visit7(schema.anyOf[0], references);
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
function FromUint8Array4(schema, references) {
|
|
3501
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3502
|
+
return FromDefault(schema.default);
|
|
3503
|
+
} else if (schema.minByteLength !== undefined) {
|
|
3504
|
+
return new Uint8Array(schema.minByteLength);
|
|
3505
|
+
} else {
|
|
3506
|
+
return new Uint8Array(0);
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
function FromUnknown4(schema, references) {
|
|
3510
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3511
|
+
return FromDefault(schema.default);
|
|
3512
|
+
} else {
|
|
3513
|
+
return {};
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
function FromVoid4(schema, references) {
|
|
3517
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3518
|
+
return FromDefault(schema.default);
|
|
3519
|
+
} else {
|
|
3520
|
+
return;
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
function FromKind3(schema, references) {
|
|
3524
|
+
if (HasPropertyKey(schema, "default")) {
|
|
3525
|
+
return FromDefault(schema.default);
|
|
3526
|
+
} else {
|
|
3527
|
+
throw new Error("User defined types must specify a default value");
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
function Visit7(schema, references) {
|
|
3531
|
+
const references_ = Pushref(schema, references);
|
|
3532
|
+
const schema_ = schema;
|
|
3533
|
+
switch (schema_[Kind]) {
|
|
3534
|
+
case "Any":
|
|
3535
|
+
return FromAny4(schema_, references_);
|
|
3536
|
+
case "Argument":
|
|
3537
|
+
return FromArgument3(schema_, references_);
|
|
3538
|
+
case "Array":
|
|
3539
|
+
return FromArray7(schema_, references_);
|
|
3540
|
+
case "AsyncIterator":
|
|
3541
|
+
return FromAsyncIterator4(schema_, references_);
|
|
3542
|
+
case "BigInt":
|
|
3543
|
+
return FromBigInt4(schema_, references_);
|
|
3544
|
+
case "Boolean":
|
|
3545
|
+
return FromBoolean4(schema_, references_);
|
|
3546
|
+
case "Constructor":
|
|
3547
|
+
return FromConstructor4(schema_, references_);
|
|
3548
|
+
case "Date":
|
|
3549
|
+
return FromDate5(schema_, references_);
|
|
3550
|
+
case "Function":
|
|
3551
|
+
return FromFunction4(schema_, references_);
|
|
3552
|
+
case "Import":
|
|
3553
|
+
return FromImport3(schema_, references_);
|
|
3554
|
+
case "Integer":
|
|
3555
|
+
return FromInteger4(schema_, references_);
|
|
3556
|
+
case "Intersect":
|
|
3557
|
+
return FromIntersect6(schema_, references_);
|
|
3558
|
+
case "Iterator":
|
|
3559
|
+
return FromIterator4(schema_, references_);
|
|
3560
|
+
case "Literal":
|
|
3561
|
+
return FromLiteral5(schema_, references_);
|
|
3562
|
+
case "Never":
|
|
3563
|
+
return FromNever4(schema_, references_);
|
|
3564
|
+
case "Not":
|
|
3565
|
+
return FromNot4(schema_, references_);
|
|
3566
|
+
case "Null":
|
|
3567
|
+
return FromNull4(schema_, references_);
|
|
3568
|
+
case "Number":
|
|
3569
|
+
return FromNumber4(schema_, references_);
|
|
3570
|
+
case "Object":
|
|
3571
|
+
return FromObject5(schema_, references_);
|
|
3572
|
+
case "Promise":
|
|
3573
|
+
return FromPromise4(schema_, references_);
|
|
3574
|
+
case "Record":
|
|
3575
|
+
return FromRecord4(schema_, references_);
|
|
3576
|
+
case "Ref":
|
|
3577
|
+
return FromRef4(schema_, references_);
|
|
3578
|
+
case "RegExp":
|
|
3579
|
+
return FromRegExp4(schema_, references_);
|
|
3580
|
+
case "String":
|
|
3581
|
+
return FromString4(schema_, references_);
|
|
3582
|
+
case "Symbol":
|
|
3583
|
+
return FromSymbol4(schema_, references_);
|
|
3584
|
+
case "TemplateLiteral":
|
|
3585
|
+
return FromTemplateLiteral5(schema_, references_);
|
|
3586
|
+
case "This":
|
|
3587
|
+
return FromThis3(schema_, references_);
|
|
3588
|
+
case "Tuple":
|
|
3589
|
+
return FromTuple6(schema_, references_);
|
|
3590
|
+
case "Undefined":
|
|
3591
|
+
return FromUndefined4(schema_, references_);
|
|
3592
|
+
case "Union":
|
|
3593
|
+
return FromUnion8(schema_, references_);
|
|
3594
|
+
case "Uint8Array":
|
|
3595
|
+
return FromUint8Array4(schema_, references_);
|
|
3596
|
+
case "Unknown":
|
|
3597
|
+
return FromUnknown4(schema_, references_);
|
|
3598
|
+
case "Void":
|
|
3599
|
+
return FromVoid4(schema_, references_);
|
|
3600
|
+
default:
|
|
3601
|
+
if (!exports_type.Has(schema_[Kind]))
|
|
3602
|
+
throw new ValueCreateError(schema_, "Unknown type");
|
|
3603
|
+
return FromKind3(schema_, references_);
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
var recursiveMaxDepth = 512;
|
|
3607
|
+
var recursiveDepth = 0;
|
|
3608
|
+
function Create2(...args) {
|
|
3609
|
+
recursiveDepth = 0;
|
|
3610
|
+
return args.length === 2 ? Visit7(args[0], args[1]) : Visit7(args[0], []);
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
// node_modules/@sinclair/typebox/build/esm/value/cast/cast.mjs
|
|
3614
|
+
class ValueCastError extends TypeBoxError {
|
|
3615
|
+
constructor(schema, message) {
|
|
3616
|
+
super(message);
|
|
3617
|
+
this.schema = schema;
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
function ScoreUnion(schema, references, value) {
|
|
3621
|
+
if (schema[Kind] === "Object" && typeof value === "object" && !IsNull(value)) {
|
|
3622
|
+
const object = schema;
|
|
3623
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
3624
|
+
const entries = Object.entries(object.properties);
|
|
3625
|
+
return entries.reduce((acc, [key, schema2]) => {
|
|
3626
|
+
const literal = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
|
|
3627
|
+
const checks = Check(schema2, references, value[key]) ? 10 : 0;
|
|
3628
|
+
const exists = keys.includes(key) ? 1 : 0;
|
|
3629
|
+
return acc + (literal + checks + exists);
|
|
3630
|
+
}, 0);
|
|
3631
|
+
} else if (schema[Kind] === "Union") {
|
|
3632
|
+
const schemas = schema.anyOf.map((schema2) => Deref(schema2, references));
|
|
3633
|
+
const scores = schemas.map((schema2) => ScoreUnion(schema2, references, value));
|
|
3634
|
+
return Math.max(...scores);
|
|
3635
|
+
} else {
|
|
3636
|
+
return Check(schema, references, value) ? 1 : 0;
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
function SelectUnion(union, references, value) {
|
|
3640
|
+
const schemas = union.anyOf.map((schema) => Deref(schema, references));
|
|
3641
|
+
let [select, best] = [schemas[0], 0];
|
|
3642
|
+
for (const schema of schemas) {
|
|
3643
|
+
const score = ScoreUnion(schema, references, value);
|
|
3644
|
+
if (score > best) {
|
|
3645
|
+
select = schema;
|
|
3646
|
+
best = score;
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
return select;
|
|
3650
|
+
}
|
|
3651
|
+
function CastUnion(union, references, value) {
|
|
3652
|
+
if ("default" in union) {
|
|
3653
|
+
return typeof value === "function" ? union.default : Clone2(union.default);
|
|
3654
|
+
} else {
|
|
3655
|
+
const schema = SelectUnion(union, references, value);
|
|
3656
|
+
return Cast(schema, references, value);
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
function DefaultClone(schema, references, value) {
|
|
3660
|
+
return Check(schema, references, value) ? Clone2(value) : Create2(schema, references);
|
|
3661
|
+
}
|
|
3662
|
+
function Default(schema, references, value) {
|
|
3663
|
+
return Check(schema, references, value) ? value : Create2(schema, references);
|
|
3664
|
+
}
|
|
3665
|
+
function FromArray8(schema, references, value) {
|
|
3666
|
+
if (Check(schema, references, value))
|
|
3667
|
+
return Clone2(value);
|
|
3668
|
+
const created = IsArray(value) ? Clone2(value) : Create2(schema, references);
|
|
3669
|
+
const minimum = IsNumber(schema.minItems) && created.length < schema.minItems ? [...created, ...Array.from({ length: schema.minItems - created.length }, () => null)] : created;
|
|
3670
|
+
const maximum = IsNumber(schema.maxItems) && minimum.length > schema.maxItems ? minimum.slice(0, schema.maxItems) : minimum;
|
|
3671
|
+
const casted = maximum.map((value2) => Visit8(schema.items, references, value2));
|
|
3672
|
+
if (schema.uniqueItems !== true)
|
|
3673
|
+
return casted;
|
|
3674
|
+
const unique = [...new Set(casted)];
|
|
3675
|
+
if (!Check(schema, references, unique))
|
|
3676
|
+
throw new ValueCastError(schema, "Array cast produced invalid data due to uniqueItems constraint");
|
|
3677
|
+
return unique;
|
|
3678
|
+
}
|
|
3679
|
+
function FromConstructor5(schema, references, value) {
|
|
3680
|
+
if (Check(schema, references, value))
|
|
3681
|
+
return Create2(schema, references);
|
|
3682
|
+
const required = new Set(schema.returns.required || []);
|
|
3683
|
+
const result = function() {};
|
|
3684
|
+
for (const [key, property] of Object.entries(schema.returns.properties)) {
|
|
3685
|
+
if (!required.has(key) && value.prototype[key] === undefined)
|
|
3686
|
+
continue;
|
|
3687
|
+
result.prototype[key] = Visit8(property, references, value.prototype[key]);
|
|
3688
|
+
}
|
|
3689
|
+
return result;
|
|
3690
|
+
}
|
|
3691
|
+
function FromImport4(schema, references, value) {
|
|
3692
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
3693
|
+
const target = schema.$defs[schema.$ref];
|
|
3694
|
+
return Visit8(target, [...references, ...definitions], value);
|
|
3695
|
+
}
|
|
3696
|
+
function IntersectAssign(correct, value) {
|
|
3697
|
+
if (IsObject(correct) && !IsObject(value) || !IsObject(correct) && IsObject(value))
|
|
3698
|
+
return correct;
|
|
3699
|
+
if (!IsObject(correct) || !IsObject(value))
|
|
3700
|
+
return value;
|
|
3701
|
+
return globalThis.Object.getOwnPropertyNames(correct).reduce((result, key) => {
|
|
3702
|
+
const property = key in value ? IntersectAssign(correct[key], value[key]) : correct[key];
|
|
3703
|
+
return { ...result, [key]: property };
|
|
3704
|
+
}, {});
|
|
3705
|
+
}
|
|
3706
|
+
function FromIntersect7(schema, references, value) {
|
|
3707
|
+
if (Check(schema, references, value))
|
|
3708
|
+
return value;
|
|
3709
|
+
const correct = Create2(schema, references);
|
|
3710
|
+
const assigned = IntersectAssign(correct, value);
|
|
3711
|
+
return Check(schema, references, assigned) ? assigned : correct;
|
|
3712
|
+
}
|
|
3713
|
+
function FromNever5(schema, references, value) {
|
|
3714
|
+
throw new ValueCastError(schema, "Never types cannot be cast");
|
|
3715
|
+
}
|
|
3716
|
+
function FromObject6(schema, references, value) {
|
|
3717
|
+
if (Check(schema, references, value))
|
|
3718
|
+
return value;
|
|
3719
|
+
if (value === null || typeof value !== "object")
|
|
3720
|
+
return Create2(schema, references);
|
|
3721
|
+
const required = new Set(schema.required || []);
|
|
3722
|
+
const result = {};
|
|
3723
|
+
for (const [key, property] of Object.entries(schema.properties)) {
|
|
3724
|
+
if (!required.has(key) && value[key] === undefined)
|
|
3725
|
+
continue;
|
|
3726
|
+
result[key] = Visit8(property, references, value[key]);
|
|
3727
|
+
}
|
|
3728
|
+
if (typeof schema.additionalProperties === "object") {
|
|
3729
|
+
const propertyNames = Object.getOwnPropertyNames(schema.properties);
|
|
3730
|
+
for (const propertyName of Object.getOwnPropertyNames(value)) {
|
|
3731
|
+
if (propertyNames.includes(propertyName))
|
|
3732
|
+
continue;
|
|
3733
|
+
result[propertyName] = Visit8(schema.additionalProperties, references, value[propertyName]);
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
return result;
|
|
3737
|
+
}
|
|
3738
|
+
function FromRecord5(schema, references, value) {
|
|
3739
|
+
if (Check(schema, references, value))
|
|
3740
|
+
return Clone2(value);
|
|
3741
|
+
if (value === null || typeof value !== "object" || Array.isArray(value) || value instanceof Date)
|
|
3742
|
+
return Create2(schema, references);
|
|
3743
|
+
const subschemaPropertyName = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
3744
|
+
const subschema = schema.patternProperties[subschemaPropertyName];
|
|
3745
|
+
const result = {};
|
|
3746
|
+
for (const [propKey, propValue] of Object.entries(value)) {
|
|
3747
|
+
result[propKey] = Visit8(subschema, references, propValue);
|
|
3748
|
+
}
|
|
3749
|
+
return result;
|
|
3750
|
+
}
|
|
3751
|
+
function FromRef5(schema, references, value) {
|
|
3752
|
+
return Visit8(Deref(schema, references), references, value);
|
|
3753
|
+
}
|
|
3754
|
+
function FromThis4(schema, references, value) {
|
|
3755
|
+
return Visit8(Deref(schema, references), references, value);
|
|
3756
|
+
}
|
|
3757
|
+
function FromTuple7(schema, references, value) {
|
|
3758
|
+
if (Check(schema, references, value))
|
|
3759
|
+
return Clone2(value);
|
|
3760
|
+
if (!IsArray(value))
|
|
3761
|
+
return Create2(schema, references);
|
|
3762
|
+
if (schema.items === undefined)
|
|
3763
|
+
return [];
|
|
3764
|
+
return schema.items.map((schema2, index) => Visit8(schema2, references, value[index]));
|
|
3765
|
+
}
|
|
3766
|
+
function FromUnion9(schema, references, value) {
|
|
3767
|
+
return Check(schema, references, value) ? Clone2(value) : CastUnion(schema, references, value);
|
|
3768
|
+
}
|
|
3769
|
+
function Visit8(schema, references, value) {
|
|
3770
|
+
const references_ = IsString(schema.$id) ? Pushref(schema, references) : references;
|
|
3771
|
+
const schema_ = schema;
|
|
3772
|
+
switch (schema[Kind]) {
|
|
3773
|
+
case "Array":
|
|
3774
|
+
return FromArray8(schema_, references_, value);
|
|
3775
|
+
case "Constructor":
|
|
3776
|
+
return FromConstructor5(schema_, references_, value);
|
|
3777
|
+
case "Import":
|
|
3778
|
+
return FromImport4(schema_, references_, value);
|
|
3779
|
+
case "Intersect":
|
|
3780
|
+
return FromIntersect7(schema_, references_, value);
|
|
3781
|
+
case "Never":
|
|
3782
|
+
return FromNever5(schema_, references_, value);
|
|
3783
|
+
case "Object":
|
|
3784
|
+
return FromObject6(schema_, references_, value);
|
|
3785
|
+
case "Record":
|
|
3786
|
+
return FromRecord5(schema_, references_, value);
|
|
3787
|
+
case "Ref":
|
|
3788
|
+
return FromRef5(schema_, references_, value);
|
|
3789
|
+
case "This":
|
|
3790
|
+
return FromThis4(schema_, references_, value);
|
|
3791
|
+
case "Tuple":
|
|
3792
|
+
return FromTuple7(schema_, references_, value);
|
|
3793
|
+
case "Union":
|
|
3794
|
+
return FromUnion9(schema_, references_, value);
|
|
3795
|
+
case "Date":
|
|
3796
|
+
case "Symbol":
|
|
3797
|
+
case "Uint8Array":
|
|
3798
|
+
return DefaultClone(schema, references, value);
|
|
3799
|
+
default:
|
|
3800
|
+
return Default(schema_, references_, value);
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
function Cast(...args) {
|
|
3804
|
+
return args.length === 3 ? Visit8(args[0], args[1], args[2]) : Visit8(args[0], [], args[1]);
|
|
3805
|
+
}
|
|
3806
|
+
// node_modules/@sinclair/typebox/build/esm/value/clean/clean.mjs
|
|
3807
|
+
function IsCheckable(schema) {
|
|
3808
|
+
return IsKind(schema) && schema[Kind] !== "Unsafe";
|
|
3809
|
+
}
|
|
3810
|
+
function FromArray9(schema, references, value) {
|
|
3811
|
+
if (!IsArray(value))
|
|
3812
|
+
return value;
|
|
3813
|
+
return value.map((value2) => Visit9(schema.items, references, value2));
|
|
3814
|
+
}
|
|
3815
|
+
function FromImport5(schema, references, value) {
|
|
3816
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
3817
|
+
const target = schema.$defs[schema.$ref];
|
|
3818
|
+
return Visit9(target, [...references, ...definitions], value);
|
|
3819
|
+
}
|
|
3820
|
+
function FromIntersect8(schema, references, value) {
|
|
3821
|
+
const unevaluatedProperties = schema.unevaluatedProperties;
|
|
3822
|
+
const intersections = schema.allOf.map((schema2) => Visit9(schema2, references, Clone2(value)));
|
|
3823
|
+
const composite = intersections.reduce((acc, value2) => IsObject(value2) ? { ...acc, ...value2 } : value2, {});
|
|
3824
|
+
if (!IsObject(value) || !IsObject(composite) || !IsKind(unevaluatedProperties))
|
|
3825
|
+
return composite;
|
|
3826
|
+
const knownkeys = KeyOfPropertyKeys(schema);
|
|
3827
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
3828
|
+
if (knownkeys.includes(key))
|
|
3829
|
+
continue;
|
|
3830
|
+
if (Check(unevaluatedProperties, references, value[key])) {
|
|
3831
|
+
composite[key] = Visit9(unevaluatedProperties, references, value[key]);
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
return composite;
|
|
3835
|
+
}
|
|
3836
|
+
function FromObject7(schema, references, value) {
|
|
3837
|
+
if (!IsObject(value) || IsArray(value))
|
|
3838
|
+
return value;
|
|
3839
|
+
const additionalProperties = schema.additionalProperties;
|
|
3840
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
3841
|
+
if (HasPropertyKey(schema.properties, key)) {
|
|
3842
|
+
value[key] = Visit9(schema.properties[key], references, value[key]);
|
|
3843
|
+
continue;
|
|
3844
|
+
}
|
|
3845
|
+
if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) {
|
|
3846
|
+
value[key] = Visit9(additionalProperties, references, value[key]);
|
|
3847
|
+
continue;
|
|
3848
|
+
}
|
|
3849
|
+
delete value[key];
|
|
3850
|
+
}
|
|
3851
|
+
return value;
|
|
3852
|
+
}
|
|
3853
|
+
function FromRecord6(schema, references, value) {
|
|
3854
|
+
if (!IsObject(value))
|
|
3855
|
+
return value;
|
|
3856
|
+
const additionalProperties = schema.additionalProperties;
|
|
3857
|
+
const propertyKeys = Object.getOwnPropertyNames(value);
|
|
3858
|
+
const [propertyKey, propertySchema] = Object.entries(schema.patternProperties)[0];
|
|
3859
|
+
const propertyKeyTest = new RegExp(propertyKey);
|
|
3860
|
+
for (const key of propertyKeys) {
|
|
3861
|
+
if (propertyKeyTest.test(key)) {
|
|
3862
|
+
value[key] = Visit9(propertySchema, references, value[key]);
|
|
3863
|
+
continue;
|
|
3864
|
+
}
|
|
3865
|
+
if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) {
|
|
3866
|
+
value[key] = Visit9(additionalProperties, references, value[key]);
|
|
3867
|
+
continue;
|
|
3868
|
+
}
|
|
3869
|
+
delete value[key];
|
|
3870
|
+
}
|
|
3871
|
+
return value;
|
|
3872
|
+
}
|
|
3873
|
+
function FromRef6(schema, references, value) {
|
|
3874
|
+
return Visit9(Deref(schema, references), references, value);
|
|
3875
|
+
}
|
|
3876
|
+
function FromThis5(schema, references, value) {
|
|
3877
|
+
return Visit9(Deref(schema, references), references, value);
|
|
3878
|
+
}
|
|
3879
|
+
function FromTuple8(schema, references, value) {
|
|
3880
|
+
if (!IsArray(value))
|
|
3881
|
+
return value;
|
|
3882
|
+
if (IsUndefined(schema.items))
|
|
3883
|
+
return [];
|
|
3884
|
+
const length = Math.min(value.length, schema.items.length);
|
|
3885
|
+
for (let i = 0;i < length; i++) {
|
|
3886
|
+
value[i] = Visit9(schema.items[i], references, value[i]);
|
|
3887
|
+
}
|
|
3888
|
+
return value.length > length ? value.slice(0, length) : value;
|
|
3889
|
+
}
|
|
3890
|
+
function FromUnion10(schema, references, value) {
|
|
3891
|
+
for (const inner of schema.anyOf) {
|
|
3892
|
+
if (IsCheckable(inner) && Check(inner, references, value)) {
|
|
3893
|
+
return Visit9(inner, references, value);
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
return value;
|
|
3897
|
+
}
|
|
3898
|
+
function Visit9(schema, references, value) {
|
|
3899
|
+
const references_ = IsString(schema.$id) ? Pushref(schema, references) : references;
|
|
3900
|
+
const schema_ = schema;
|
|
3901
|
+
switch (schema_[Kind]) {
|
|
3902
|
+
case "Array":
|
|
3903
|
+
return FromArray9(schema_, references_, value);
|
|
3904
|
+
case "Import":
|
|
3905
|
+
return FromImport5(schema_, references_, value);
|
|
3906
|
+
case "Intersect":
|
|
3907
|
+
return FromIntersect8(schema_, references_, value);
|
|
3908
|
+
case "Object":
|
|
3909
|
+
return FromObject7(schema_, references_, value);
|
|
3910
|
+
case "Record":
|
|
3911
|
+
return FromRecord6(schema_, references_, value);
|
|
3912
|
+
case "Ref":
|
|
3913
|
+
return FromRef6(schema_, references_, value);
|
|
3914
|
+
case "This":
|
|
3915
|
+
return FromThis5(schema_, references_, value);
|
|
3916
|
+
case "Tuple":
|
|
3917
|
+
return FromTuple8(schema_, references_, value);
|
|
3918
|
+
case "Union":
|
|
3919
|
+
return FromUnion10(schema_, references_, value);
|
|
3920
|
+
default:
|
|
3921
|
+
return value;
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
function Clean(...args) {
|
|
3925
|
+
return args.length === 3 ? Visit9(args[0], args[1], args[2]) : Visit9(args[0], [], args[1]);
|
|
3926
|
+
}
|
|
3927
|
+
// node_modules/@sinclair/typebox/build/esm/value/convert/convert.mjs
|
|
3928
|
+
function IsStringNumeric(value) {
|
|
3929
|
+
return IsString(value) && !isNaN(value) && !isNaN(parseFloat(value));
|
|
3930
|
+
}
|
|
3931
|
+
function IsValueToString(value) {
|
|
3932
|
+
return IsBigInt(value) || IsBoolean(value) || IsNumber(value);
|
|
3933
|
+
}
|
|
3934
|
+
function IsValueTrue(value) {
|
|
3935
|
+
return value === true || IsNumber(value) && value === 1 || IsBigInt(value) && value === BigInt("1") || IsString(value) && (value.toLowerCase() === "true" || value === "1");
|
|
3936
|
+
}
|
|
3937
|
+
function IsValueFalse(value) {
|
|
3938
|
+
return value === false || IsNumber(value) && (value === 0 || Object.is(value, -0)) || IsBigInt(value) && value === BigInt("0") || IsString(value) && (value.toLowerCase() === "false" || value === "0" || value === "-0");
|
|
3939
|
+
}
|
|
3940
|
+
function IsTimeStringWithTimeZone(value) {
|
|
3941
|
+
return IsString(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value);
|
|
3942
|
+
}
|
|
3943
|
+
function IsTimeStringWithoutTimeZone(value) {
|
|
3944
|
+
return IsString(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value);
|
|
3945
|
+
}
|
|
3946
|
+
function IsDateTimeStringWithTimeZone(value) {
|
|
3947
|
+
return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value);
|
|
3948
|
+
}
|
|
3949
|
+
function IsDateTimeStringWithoutTimeZone(value) {
|
|
3950
|
+
return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value);
|
|
3951
|
+
}
|
|
3952
|
+
function IsDateString(value) {
|
|
3953
|
+
return IsString(value) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(value);
|
|
3954
|
+
}
|
|
3955
|
+
function TryConvertLiteralString(value, target) {
|
|
3956
|
+
const conversion = TryConvertString(value);
|
|
3957
|
+
return conversion === target ? conversion : value;
|
|
3958
|
+
}
|
|
3959
|
+
function TryConvertLiteralNumber(value, target) {
|
|
3960
|
+
const conversion = TryConvertNumber(value);
|
|
3961
|
+
return conversion === target ? conversion : value;
|
|
3962
|
+
}
|
|
3963
|
+
function TryConvertLiteralBoolean(value, target) {
|
|
3964
|
+
const conversion = TryConvertBoolean(value);
|
|
3965
|
+
return conversion === target ? conversion : value;
|
|
3966
|
+
}
|
|
3967
|
+
function TryConvertLiteral(schema, value) {
|
|
3968
|
+
return IsString(schema.const) ? TryConvertLiteralString(value, schema.const) : IsNumber(schema.const) ? TryConvertLiteralNumber(value, schema.const) : IsBoolean(schema.const) ? TryConvertLiteralBoolean(value, schema.const) : value;
|
|
3969
|
+
}
|
|
3970
|
+
function TryConvertBoolean(value) {
|
|
3971
|
+
return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value;
|
|
3972
|
+
}
|
|
3973
|
+
function TryConvertBigInt(value) {
|
|
3974
|
+
const truncateInteger = (value2) => value2.split(".")[0];
|
|
3975
|
+
return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : IsNumber(value) ? BigInt(Math.trunc(value)) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value;
|
|
3976
|
+
}
|
|
3977
|
+
function TryConvertString(value) {
|
|
3978
|
+
return IsSymbol(value) && value.description !== undefined ? value.description.toString() : IsValueToString(value) ? value.toString() : value;
|
|
3979
|
+
}
|
|
3980
|
+
function TryConvertNumber(value) {
|
|
3981
|
+
return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
|
|
3982
|
+
}
|
|
3983
|
+
function TryConvertInteger(value) {
|
|
3984
|
+
return IsStringNumeric(value) ? parseInt(value) : IsNumber(value) ? Math.trunc(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
|
|
3985
|
+
}
|
|
3986
|
+
function TryConvertNull(value) {
|
|
3987
|
+
return IsString(value) && value.toLowerCase() === "null" ? null : value;
|
|
3988
|
+
}
|
|
3989
|
+
function TryConvertUndefined(value) {
|
|
3990
|
+
return IsString(value) && value === "undefined" ? undefined : value;
|
|
3991
|
+
}
|
|
3992
|
+
function TryConvertDate(value) {
|
|
3993
|
+
return IsDate(value) ? value : IsNumber(value) ? new Date(value) : IsValueTrue(value) ? new Date(1) : IsValueFalse(value) ? new Date(0) : IsStringNumeric(value) ? new Date(parseInt(value)) : IsTimeStringWithoutTimeZone(value) ? new Date(`1970-01-01T${value}.000Z`) : IsTimeStringWithTimeZone(value) ? new Date(`1970-01-01T${value}`) : IsDateTimeStringWithoutTimeZone(value) ? new Date(`${value}.000Z`) : IsDateTimeStringWithTimeZone(value) ? new Date(value) : IsDateString(value) ? new Date(`${value}T00:00:00.000Z`) : value;
|
|
3994
|
+
}
|
|
3995
|
+
function Default2(value) {
|
|
3996
|
+
return value;
|
|
3997
|
+
}
|
|
3998
|
+
function FromArray10(schema, references, value) {
|
|
3999
|
+
const elements = IsArray(value) ? value : [value];
|
|
4000
|
+
return elements.map((element) => Visit10(schema.items, references, element));
|
|
4001
|
+
}
|
|
4002
|
+
function FromBigInt5(schema, references, value) {
|
|
4003
|
+
return TryConvertBigInt(value);
|
|
4004
|
+
}
|
|
4005
|
+
function FromBoolean5(schema, references, value) {
|
|
4006
|
+
return TryConvertBoolean(value);
|
|
4007
|
+
}
|
|
4008
|
+
function FromDate6(schema, references, value) {
|
|
4009
|
+
return TryConvertDate(value);
|
|
4010
|
+
}
|
|
4011
|
+
function FromImport6(schema, references, value) {
|
|
4012
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
4013
|
+
const target = schema.$defs[schema.$ref];
|
|
4014
|
+
return Visit10(target, [...references, ...definitions], value);
|
|
4015
|
+
}
|
|
4016
|
+
function FromInteger5(schema, references, value) {
|
|
4017
|
+
return TryConvertInteger(value);
|
|
4018
|
+
}
|
|
4019
|
+
function FromIntersect9(schema, references, value) {
|
|
4020
|
+
return schema.allOf.reduce((value2, schema2) => Visit10(schema2, references, value2), value);
|
|
4021
|
+
}
|
|
4022
|
+
function FromLiteral6(schema, references, value) {
|
|
4023
|
+
return TryConvertLiteral(schema, value);
|
|
4024
|
+
}
|
|
4025
|
+
function FromNull5(schema, references, value) {
|
|
4026
|
+
return TryConvertNull(value);
|
|
4027
|
+
}
|
|
4028
|
+
function FromNumber5(schema, references, value) {
|
|
4029
|
+
return TryConvertNumber(value);
|
|
4030
|
+
}
|
|
4031
|
+
function FromObject8(schema, references, value) {
|
|
4032
|
+
if (!IsObject(value) || IsArray(value))
|
|
4033
|
+
return value;
|
|
4034
|
+
for (const propertyKey of Object.getOwnPropertyNames(schema.properties)) {
|
|
4035
|
+
if (!HasPropertyKey(value, propertyKey))
|
|
4036
|
+
continue;
|
|
4037
|
+
value[propertyKey] = Visit10(schema.properties[propertyKey], references, value[propertyKey]);
|
|
4038
|
+
}
|
|
4039
|
+
return value;
|
|
4040
|
+
}
|
|
4041
|
+
function FromRecord7(schema, references, value) {
|
|
4042
|
+
const isConvertable = IsObject(value) && !IsArray(value);
|
|
4043
|
+
if (!isConvertable)
|
|
4044
|
+
return value;
|
|
4045
|
+
const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
4046
|
+
const property = schema.patternProperties[propertyKey];
|
|
4047
|
+
for (const [propKey, propValue] of Object.entries(value)) {
|
|
4048
|
+
value[propKey] = Visit10(property, references, propValue);
|
|
4049
|
+
}
|
|
4050
|
+
return value;
|
|
4051
|
+
}
|
|
4052
|
+
function FromRef7(schema, references, value) {
|
|
4053
|
+
return Visit10(Deref(schema, references), references, value);
|
|
4054
|
+
}
|
|
4055
|
+
function FromString5(schema, references, value) {
|
|
4056
|
+
return TryConvertString(value);
|
|
4057
|
+
}
|
|
4058
|
+
function FromSymbol5(schema, references, value) {
|
|
4059
|
+
return IsString(value) || IsNumber(value) ? Symbol(value) : value;
|
|
4060
|
+
}
|
|
4061
|
+
function FromThis6(schema, references, value) {
|
|
4062
|
+
return Visit10(Deref(schema, references), references, value);
|
|
4063
|
+
}
|
|
4064
|
+
function FromTuple9(schema, references, value) {
|
|
4065
|
+
const isConvertable = IsArray(value) && !IsUndefined(schema.items);
|
|
4066
|
+
if (!isConvertable)
|
|
4067
|
+
return value;
|
|
4068
|
+
return value.map((value2, index) => {
|
|
4069
|
+
return index < schema.items.length ? Visit10(schema.items[index], references, value2) : value2;
|
|
4070
|
+
});
|
|
4071
|
+
}
|
|
4072
|
+
function FromUndefined5(schema, references, value) {
|
|
4073
|
+
return TryConvertUndefined(value);
|
|
4074
|
+
}
|
|
4075
|
+
function FromUnion11(schema, references, value) {
|
|
4076
|
+
for (const subschema of schema.anyOf) {
|
|
4077
|
+
if (Check(subschema, references, value)) {
|
|
4078
|
+
return value;
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
4081
|
+
for (const subschema of schema.anyOf) {
|
|
4082
|
+
const converted = Visit10(subschema, references, Clone2(value));
|
|
4083
|
+
if (!Check(subschema, references, converted))
|
|
4084
|
+
continue;
|
|
4085
|
+
return converted;
|
|
4086
|
+
}
|
|
4087
|
+
return value;
|
|
4088
|
+
}
|
|
4089
|
+
function Visit10(schema, references, value) {
|
|
4090
|
+
const references_ = Pushref(schema, references);
|
|
4091
|
+
const schema_ = schema;
|
|
4092
|
+
switch (schema[Kind]) {
|
|
4093
|
+
case "Array":
|
|
4094
|
+
return FromArray10(schema_, references_, value);
|
|
4095
|
+
case "BigInt":
|
|
4096
|
+
return FromBigInt5(schema_, references_, value);
|
|
4097
|
+
case "Boolean":
|
|
4098
|
+
return FromBoolean5(schema_, references_, value);
|
|
4099
|
+
case "Date":
|
|
4100
|
+
return FromDate6(schema_, references_, value);
|
|
4101
|
+
case "Import":
|
|
4102
|
+
return FromImport6(schema_, references_, value);
|
|
4103
|
+
case "Integer":
|
|
4104
|
+
return FromInteger5(schema_, references_, value);
|
|
4105
|
+
case "Intersect":
|
|
4106
|
+
return FromIntersect9(schema_, references_, value);
|
|
4107
|
+
case "Literal":
|
|
4108
|
+
return FromLiteral6(schema_, references_, value);
|
|
4109
|
+
case "Null":
|
|
4110
|
+
return FromNull5(schema_, references_, value);
|
|
4111
|
+
case "Number":
|
|
4112
|
+
return FromNumber5(schema_, references_, value);
|
|
4113
|
+
case "Object":
|
|
4114
|
+
return FromObject8(schema_, references_, value);
|
|
4115
|
+
case "Record":
|
|
4116
|
+
return FromRecord7(schema_, references_, value);
|
|
4117
|
+
case "Ref":
|
|
4118
|
+
return FromRef7(schema_, references_, value);
|
|
4119
|
+
case "String":
|
|
4120
|
+
return FromString5(schema_, references_, value);
|
|
4121
|
+
case "Symbol":
|
|
4122
|
+
return FromSymbol5(schema_, references_, value);
|
|
4123
|
+
case "This":
|
|
4124
|
+
return FromThis6(schema_, references_, value);
|
|
4125
|
+
case "Tuple":
|
|
4126
|
+
return FromTuple9(schema_, references_, value);
|
|
4127
|
+
case "Undefined":
|
|
4128
|
+
return FromUndefined5(schema_, references_, value);
|
|
4129
|
+
case "Union":
|
|
4130
|
+
return FromUnion11(schema_, references_, value);
|
|
4131
|
+
default:
|
|
4132
|
+
return Default2(value);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
function Convert(...args) {
|
|
4136
|
+
return args.length === 3 ? Visit10(args[0], args[1], args[2]) : Visit10(args[0], [], args[1]);
|
|
4137
|
+
}
|
|
4138
|
+
// node_modules/@sinclair/typebox/build/esm/value/transform/decode.mjs
|
|
4139
|
+
class TransformDecodeCheckError extends TypeBoxError {
|
|
4140
|
+
constructor(schema, value, error) {
|
|
4141
|
+
super(`Unable to decode value as it does not match the expected schema`);
|
|
4142
|
+
this.schema = schema;
|
|
4143
|
+
this.value = value;
|
|
4144
|
+
this.error = error;
|
|
4145
|
+
}
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4148
|
+
class TransformDecodeError extends TypeBoxError {
|
|
4149
|
+
constructor(schema, path, value, error) {
|
|
4150
|
+
super(error instanceof Error ? error.message : "Unknown error");
|
|
4151
|
+
this.schema = schema;
|
|
4152
|
+
this.path = path;
|
|
4153
|
+
this.value = value;
|
|
4154
|
+
this.error = error;
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
function Default3(schema, path, value) {
|
|
4158
|
+
try {
|
|
4159
|
+
return IsTransform(schema) ? schema[TransformKind].Decode(value) : value;
|
|
4160
|
+
} catch (error) {
|
|
4161
|
+
throw new TransformDecodeError(schema, path, value, error);
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
function FromArray11(schema, references, path, value) {
|
|
4165
|
+
return IsArray(value) ? Default3(schema, path, value.map((value2, index) => Visit11(schema.items, references, `${path}/${index}`, value2))) : Default3(schema, path, value);
|
|
4166
|
+
}
|
|
4167
|
+
function FromIntersect10(schema, references, path, value) {
|
|
4168
|
+
if (!IsObject(value) || IsValueType(value))
|
|
4169
|
+
return Default3(schema, path, value);
|
|
4170
|
+
const knownEntries = KeyOfPropertyEntries(schema);
|
|
4171
|
+
const knownKeys = knownEntries.map((entry) => entry[0]);
|
|
4172
|
+
const knownProperties = { ...value };
|
|
4173
|
+
for (const [knownKey, knownSchema] of knownEntries)
|
|
4174
|
+
if (knownKey in knownProperties) {
|
|
4175
|
+
knownProperties[knownKey] = Visit11(knownSchema, references, `${path}/${knownKey}`, knownProperties[knownKey]);
|
|
4176
|
+
}
|
|
4177
|
+
if (!IsTransform(schema.unevaluatedProperties)) {
|
|
4178
|
+
return Default3(schema, path, knownProperties);
|
|
4179
|
+
}
|
|
4180
|
+
const unknownKeys = Object.getOwnPropertyNames(knownProperties);
|
|
4181
|
+
const unevaluatedProperties = schema.unevaluatedProperties;
|
|
4182
|
+
const unknownProperties = { ...knownProperties };
|
|
4183
|
+
for (const key of unknownKeys)
|
|
4184
|
+
if (!knownKeys.includes(key)) {
|
|
4185
|
+
unknownProperties[key] = Default3(unevaluatedProperties, `${path}/${key}`, unknownProperties[key]);
|
|
4186
|
+
}
|
|
4187
|
+
return Default3(schema, path, unknownProperties);
|
|
4188
|
+
}
|
|
4189
|
+
function FromImport7(schema, references, path, value) {
|
|
4190
|
+
const additional = globalThis.Object.values(schema.$defs);
|
|
4191
|
+
const target = schema.$defs[schema.$ref];
|
|
4192
|
+
const result = Visit11(target, [...references, ...additional], path, value);
|
|
4193
|
+
return Default3(schema, path, result);
|
|
4194
|
+
}
|
|
4195
|
+
function FromNot5(schema, references, path, value) {
|
|
4196
|
+
return Default3(schema, path, Visit11(schema.not, references, path, value));
|
|
4197
|
+
}
|
|
4198
|
+
function FromObject9(schema, references, path, value) {
|
|
4199
|
+
if (!IsObject(value))
|
|
4200
|
+
return Default3(schema, path, value);
|
|
4201
|
+
const knownKeys = KeyOfPropertyKeys(schema);
|
|
4202
|
+
const knownProperties = { ...value };
|
|
4203
|
+
for (const key of knownKeys) {
|
|
4204
|
+
if (!HasPropertyKey(knownProperties, key))
|
|
4205
|
+
continue;
|
|
4206
|
+
if (IsUndefined(knownProperties[key]) && (!IsUndefined3(schema.properties[key]) || TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key)))
|
|
4207
|
+
continue;
|
|
4208
|
+
knownProperties[key] = Visit11(schema.properties[key], references, `${path}/${key}`, knownProperties[key]);
|
|
4209
|
+
}
|
|
4210
|
+
if (!IsSchema(schema.additionalProperties)) {
|
|
4211
|
+
return Default3(schema, path, knownProperties);
|
|
4212
|
+
}
|
|
4213
|
+
const unknownKeys = Object.getOwnPropertyNames(knownProperties);
|
|
4214
|
+
const additionalProperties = schema.additionalProperties;
|
|
4215
|
+
const unknownProperties = { ...knownProperties };
|
|
4216
|
+
for (const key of unknownKeys)
|
|
4217
|
+
if (!knownKeys.includes(key)) {
|
|
4218
|
+
unknownProperties[key] = Default3(additionalProperties, `${path}/${key}`, unknownProperties[key]);
|
|
4219
|
+
}
|
|
4220
|
+
return Default3(schema, path, unknownProperties);
|
|
4221
|
+
}
|
|
4222
|
+
function FromRecord8(schema, references, path, value) {
|
|
4223
|
+
if (!IsObject(value))
|
|
4224
|
+
return Default3(schema, path, value);
|
|
4225
|
+
const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
4226
|
+
const knownKeys = new RegExp(pattern);
|
|
4227
|
+
const knownProperties = { ...value };
|
|
4228
|
+
for (const key of Object.getOwnPropertyNames(value))
|
|
4229
|
+
if (knownKeys.test(key)) {
|
|
4230
|
+
knownProperties[key] = Visit11(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]);
|
|
4231
|
+
}
|
|
4232
|
+
if (!IsSchema(schema.additionalProperties)) {
|
|
4233
|
+
return Default3(schema, path, knownProperties);
|
|
4234
|
+
}
|
|
4235
|
+
const unknownKeys = Object.getOwnPropertyNames(knownProperties);
|
|
4236
|
+
const additionalProperties = schema.additionalProperties;
|
|
4237
|
+
const unknownProperties = { ...knownProperties };
|
|
4238
|
+
for (const key of unknownKeys)
|
|
4239
|
+
if (!knownKeys.test(key)) {
|
|
4240
|
+
unknownProperties[key] = Default3(additionalProperties, `${path}/${key}`, unknownProperties[key]);
|
|
4241
|
+
}
|
|
4242
|
+
return Default3(schema, path, unknownProperties);
|
|
4243
|
+
}
|
|
4244
|
+
function FromRef8(schema, references, path, value) {
|
|
4245
|
+
const target = Deref(schema, references);
|
|
4246
|
+
return Default3(schema, path, Visit11(target, references, path, value));
|
|
4247
|
+
}
|
|
4248
|
+
function FromThis7(schema, references, path, value) {
|
|
4249
|
+
const target = Deref(schema, references);
|
|
4250
|
+
return Default3(schema, path, Visit11(target, references, path, value));
|
|
4251
|
+
}
|
|
4252
|
+
function FromTuple10(schema, references, path, value) {
|
|
4253
|
+
return IsArray(value) && IsArray(schema.items) ? Default3(schema, path, schema.items.map((schema2, index) => Visit11(schema2, references, `${path}/${index}`, value[index]))) : Default3(schema, path, value);
|
|
4254
|
+
}
|
|
4255
|
+
function FromUnion12(schema, references, path, value) {
|
|
4256
|
+
for (const subschema of schema.anyOf) {
|
|
4257
|
+
if (!Check(subschema, references, value))
|
|
4258
|
+
continue;
|
|
4259
|
+
const decoded = Visit11(subschema, references, path, value);
|
|
4260
|
+
return Default3(schema, path, decoded);
|
|
4261
|
+
}
|
|
4262
|
+
return Default3(schema, path, value);
|
|
4263
|
+
}
|
|
4264
|
+
function Visit11(schema, references, path, value) {
|
|
4265
|
+
const references_ = Pushref(schema, references);
|
|
4266
|
+
const schema_ = schema;
|
|
4267
|
+
switch (schema[Kind]) {
|
|
4268
|
+
case "Array":
|
|
4269
|
+
return FromArray11(schema_, references_, path, value);
|
|
4270
|
+
case "Import":
|
|
4271
|
+
return FromImport7(schema_, references_, path, value);
|
|
4272
|
+
case "Intersect":
|
|
4273
|
+
return FromIntersect10(schema_, references_, path, value);
|
|
4274
|
+
case "Not":
|
|
4275
|
+
return FromNot5(schema_, references_, path, value);
|
|
4276
|
+
case "Object":
|
|
4277
|
+
return FromObject9(schema_, references_, path, value);
|
|
4278
|
+
case "Record":
|
|
4279
|
+
return FromRecord8(schema_, references_, path, value);
|
|
4280
|
+
case "Ref":
|
|
4281
|
+
return FromRef8(schema_, references_, path, value);
|
|
4282
|
+
case "Symbol":
|
|
4283
|
+
return Default3(schema_, path, value);
|
|
4284
|
+
case "This":
|
|
4285
|
+
return FromThis7(schema_, references_, path, value);
|
|
4286
|
+
case "Tuple":
|
|
4287
|
+
return FromTuple10(schema_, references_, path, value);
|
|
4288
|
+
case "Union":
|
|
4289
|
+
return FromUnion12(schema_, references_, path, value);
|
|
4290
|
+
default:
|
|
4291
|
+
return Default3(schema_, path, value);
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
function TransformDecode(schema, references, value) {
|
|
4295
|
+
return Visit11(schema, references, "", value);
|
|
4296
|
+
}
|
|
4297
|
+
|
|
4298
|
+
// node_modules/@sinclair/typebox/build/esm/value/transform/encode.mjs
|
|
4299
|
+
class TransformEncodeCheckError extends TypeBoxError {
|
|
4300
|
+
constructor(schema, value, error) {
|
|
4301
|
+
super(`The encoded value does not match the expected schema`);
|
|
4302
|
+
this.schema = schema;
|
|
4303
|
+
this.value = value;
|
|
4304
|
+
this.error = error;
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
|
|
4308
|
+
class TransformEncodeError extends TypeBoxError {
|
|
4309
|
+
constructor(schema, path, value, error) {
|
|
4310
|
+
super(`${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4311
|
+
this.schema = schema;
|
|
4312
|
+
this.path = path;
|
|
4313
|
+
this.value = value;
|
|
4314
|
+
this.error = error;
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
function Default4(schema, path, value) {
|
|
4318
|
+
try {
|
|
4319
|
+
return IsTransform(schema) ? schema[TransformKind].Encode(value) : value;
|
|
4320
|
+
} catch (error) {
|
|
4321
|
+
throw new TransformEncodeError(schema, path, value, error);
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
function FromArray12(schema, references, path, value) {
|
|
4325
|
+
const defaulted = Default4(schema, path, value);
|
|
4326
|
+
return IsArray(defaulted) ? defaulted.map((value2, index) => Visit12(schema.items, references, `${path}/${index}`, value2)) : defaulted;
|
|
4327
|
+
}
|
|
4328
|
+
function FromImport8(schema, references, path, value) {
|
|
4329
|
+
const additional = globalThis.Object.values(schema.$defs);
|
|
4330
|
+
const target = schema.$defs[schema.$ref];
|
|
4331
|
+
const result = Default4(schema, path, value);
|
|
4332
|
+
return Visit12(target, [...references, ...additional], path, result);
|
|
4333
|
+
}
|
|
4334
|
+
function FromIntersect11(schema, references, path, value) {
|
|
4335
|
+
const defaulted = Default4(schema, path, value);
|
|
4336
|
+
if (!IsObject(value) || IsValueType(value))
|
|
4337
|
+
return defaulted;
|
|
4338
|
+
const knownEntries = KeyOfPropertyEntries(schema);
|
|
4339
|
+
const knownKeys = knownEntries.map((entry) => entry[0]);
|
|
4340
|
+
const knownProperties = { ...defaulted };
|
|
4341
|
+
for (const [knownKey, knownSchema] of knownEntries)
|
|
4342
|
+
if (knownKey in knownProperties) {
|
|
4343
|
+
knownProperties[knownKey] = Visit12(knownSchema, references, `${path}/${knownKey}`, knownProperties[knownKey]);
|
|
4344
|
+
}
|
|
4345
|
+
if (!IsTransform(schema.unevaluatedProperties)) {
|
|
4346
|
+
return knownProperties;
|
|
4347
|
+
}
|
|
4348
|
+
const unknownKeys = Object.getOwnPropertyNames(knownProperties);
|
|
4349
|
+
const unevaluatedProperties = schema.unevaluatedProperties;
|
|
4350
|
+
const properties = { ...knownProperties };
|
|
4351
|
+
for (const key of unknownKeys)
|
|
4352
|
+
if (!knownKeys.includes(key)) {
|
|
4353
|
+
properties[key] = Default4(unevaluatedProperties, `${path}/${key}`, properties[key]);
|
|
4354
|
+
}
|
|
4355
|
+
return properties;
|
|
4356
|
+
}
|
|
4357
|
+
function FromNot6(schema, references, path, value) {
|
|
4358
|
+
return Default4(schema.not, path, Default4(schema, path, value));
|
|
4359
|
+
}
|
|
4360
|
+
function FromObject10(schema, references, path, value) {
|
|
4361
|
+
const defaulted = Default4(schema, path, value);
|
|
4362
|
+
if (!IsObject(defaulted))
|
|
4363
|
+
return defaulted;
|
|
4364
|
+
const knownKeys = KeyOfPropertyKeys(schema);
|
|
4365
|
+
const knownProperties = { ...defaulted };
|
|
4366
|
+
for (const key of knownKeys) {
|
|
4367
|
+
if (!HasPropertyKey(knownProperties, key))
|
|
4368
|
+
continue;
|
|
4369
|
+
if (IsUndefined(knownProperties[key]) && (!IsUndefined3(schema.properties[key]) || TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key)))
|
|
4370
|
+
continue;
|
|
4371
|
+
knownProperties[key] = Visit12(schema.properties[key], references, `${path}/${key}`, knownProperties[key]);
|
|
4372
|
+
}
|
|
4373
|
+
if (!IsSchema(schema.additionalProperties)) {
|
|
4374
|
+
return knownProperties;
|
|
4375
|
+
}
|
|
4376
|
+
const unknownKeys = Object.getOwnPropertyNames(knownProperties);
|
|
4377
|
+
const additionalProperties = schema.additionalProperties;
|
|
4378
|
+
const properties = { ...knownProperties };
|
|
4379
|
+
for (const key of unknownKeys)
|
|
4380
|
+
if (!knownKeys.includes(key)) {
|
|
4381
|
+
properties[key] = Default4(additionalProperties, `${path}/${key}`, properties[key]);
|
|
4382
|
+
}
|
|
4383
|
+
return properties;
|
|
4384
|
+
}
|
|
4385
|
+
function FromRecord9(schema, references, path, value) {
|
|
4386
|
+
const defaulted = Default4(schema, path, value);
|
|
4387
|
+
if (!IsObject(value))
|
|
4388
|
+
return defaulted;
|
|
4389
|
+
const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
4390
|
+
const knownKeys = new RegExp(pattern);
|
|
4391
|
+
const knownProperties = { ...defaulted };
|
|
4392
|
+
for (const key of Object.getOwnPropertyNames(value))
|
|
4393
|
+
if (knownKeys.test(key)) {
|
|
4394
|
+
knownProperties[key] = Visit12(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]);
|
|
4395
|
+
}
|
|
4396
|
+
if (!IsSchema(schema.additionalProperties)) {
|
|
4397
|
+
return knownProperties;
|
|
4398
|
+
}
|
|
4399
|
+
const unknownKeys = Object.getOwnPropertyNames(knownProperties);
|
|
4400
|
+
const additionalProperties = schema.additionalProperties;
|
|
4401
|
+
const properties = { ...knownProperties };
|
|
4402
|
+
for (const key of unknownKeys)
|
|
4403
|
+
if (!knownKeys.test(key)) {
|
|
4404
|
+
properties[key] = Default4(additionalProperties, `${path}/${key}`, properties[key]);
|
|
4405
|
+
}
|
|
4406
|
+
return properties;
|
|
4407
|
+
}
|
|
4408
|
+
function FromRef9(schema, references, path, value) {
|
|
4409
|
+
const target = Deref(schema, references);
|
|
4410
|
+
const resolved = Visit12(target, references, path, value);
|
|
4411
|
+
return Default4(schema, path, resolved);
|
|
4412
|
+
}
|
|
4413
|
+
function FromThis8(schema, references, path, value) {
|
|
4414
|
+
const target = Deref(schema, references);
|
|
4415
|
+
const resolved = Visit12(target, references, path, value);
|
|
4416
|
+
return Default4(schema, path, resolved);
|
|
4417
|
+
}
|
|
4418
|
+
function FromTuple11(schema, references, path, value) {
|
|
4419
|
+
const value1 = Default4(schema, path, value);
|
|
4420
|
+
return IsArray(schema.items) ? schema.items.map((schema2, index) => Visit12(schema2, references, `${path}/${index}`, value1[index])) : [];
|
|
4421
|
+
}
|
|
4422
|
+
function FromUnion13(schema, references, path, value) {
|
|
4423
|
+
for (const subschema of schema.anyOf) {
|
|
4424
|
+
if (!Check(subschema, references, value))
|
|
4425
|
+
continue;
|
|
4426
|
+
const value1 = Visit12(subschema, references, path, value);
|
|
4427
|
+
return Default4(schema, path, value1);
|
|
4428
|
+
}
|
|
4429
|
+
for (const subschema of schema.anyOf) {
|
|
4430
|
+
const value1 = Visit12(subschema, references, path, value);
|
|
4431
|
+
if (!Check(schema, references, value1))
|
|
4432
|
+
continue;
|
|
4433
|
+
return Default4(schema, path, value1);
|
|
4434
|
+
}
|
|
4435
|
+
return Default4(schema, path, value);
|
|
4436
|
+
}
|
|
4437
|
+
function Visit12(schema, references, path, value) {
|
|
4438
|
+
const references_ = Pushref(schema, references);
|
|
4439
|
+
const schema_ = schema;
|
|
4440
|
+
switch (schema[Kind]) {
|
|
4441
|
+
case "Array":
|
|
4442
|
+
return FromArray12(schema_, references_, path, value);
|
|
4443
|
+
case "Import":
|
|
4444
|
+
return FromImport8(schema_, references_, path, value);
|
|
4445
|
+
case "Intersect":
|
|
4446
|
+
return FromIntersect11(schema_, references_, path, value);
|
|
4447
|
+
case "Not":
|
|
4448
|
+
return FromNot6(schema_, references_, path, value);
|
|
4449
|
+
case "Object":
|
|
4450
|
+
return FromObject10(schema_, references_, path, value);
|
|
4451
|
+
case "Record":
|
|
4452
|
+
return FromRecord9(schema_, references_, path, value);
|
|
4453
|
+
case "Ref":
|
|
4454
|
+
return FromRef9(schema_, references_, path, value);
|
|
4455
|
+
case "This":
|
|
4456
|
+
return FromThis8(schema_, references_, path, value);
|
|
4457
|
+
case "Tuple":
|
|
4458
|
+
return FromTuple11(schema_, references_, path, value);
|
|
4459
|
+
case "Union":
|
|
4460
|
+
return FromUnion13(schema_, references_, path, value);
|
|
4461
|
+
default:
|
|
4462
|
+
return Default4(schema_, path, value);
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4465
|
+
function TransformEncode(schema, references, value) {
|
|
4466
|
+
return Visit12(schema, references, "", value);
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4469
|
+
// node_modules/@sinclair/typebox/build/esm/value/transform/has.mjs
|
|
4470
|
+
function FromArray13(schema, references) {
|
|
4471
|
+
return IsTransform(schema) || Visit13(schema.items, references);
|
|
4472
|
+
}
|
|
4473
|
+
function FromAsyncIterator5(schema, references) {
|
|
4474
|
+
return IsTransform(schema) || Visit13(schema.items, references);
|
|
4475
|
+
}
|
|
4476
|
+
function FromConstructor6(schema, references) {
|
|
4477
|
+
return IsTransform(schema) || Visit13(schema.returns, references) || schema.parameters.some((schema2) => Visit13(schema2, references));
|
|
4478
|
+
}
|
|
4479
|
+
function FromFunction5(schema, references) {
|
|
4480
|
+
return IsTransform(schema) || Visit13(schema.returns, references) || schema.parameters.some((schema2) => Visit13(schema2, references));
|
|
4481
|
+
}
|
|
4482
|
+
function FromIntersect12(schema, references) {
|
|
4483
|
+
return IsTransform(schema) || IsTransform(schema.unevaluatedProperties) || schema.allOf.some((schema2) => Visit13(schema2, references));
|
|
4484
|
+
}
|
|
4485
|
+
function FromImport9(schema, references) {
|
|
4486
|
+
const additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => [...result, schema.$defs[key]], []);
|
|
4487
|
+
const target = schema.$defs[schema.$ref];
|
|
4488
|
+
return IsTransform(schema) || Visit13(target, [...additional, ...references]);
|
|
4489
|
+
}
|
|
4490
|
+
function FromIterator5(schema, references) {
|
|
4491
|
+
return IsTransform(schema) || Visit13(schema.items, references);
|
|
4492
|
+
}
|
|
4493
|
+
function FromNot7(schema, references) {
|
|
4494
|
+
return IsTransform(schema) || Visit13(schema.not, references);
|
|
4495
|
+
}
|
|
4496
|
+
function FromObject11(schema, references) {
|
|
4497
|
+
return IsTransform(schema) || Object.values(schema.properties).some((schema2) => Visit13(schema2, references)) || IsSchema(schema.additionalProperties) && Visit13(schema.additionalProperties, references);
|
|
4498
|
+
}
|
|
4499
|
+
function FromPromise5(schema, references) {
|
|
4500
|
+
return IsTransform(schema) || Visit13(schema.item, references);
|
|
4501
|
+
}
|
|
4502
|
+
function FromRecord10(schema, references) {
|
|
4503
|
+
const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
4504
|
+
const property = schema.patternProperties[pattern];
|
|
4505
|
+
return IsTransform(schema) || Visit13(property, references) || IsSchema(schema.additionalProperties) && IsTransform(schema.additionalProperties);
|
|
4506
|
+
}
|
|
4507
|
+
function FromRef10(schema, references) {
|
|
4508
|
+
if (IsTransform(schema))
|
|
4509
|
+
return true;
|
|
4510
|
+
return Visit13(Deref(schema, references), references);
|
|
4511
|
+
}
|
|
4512
|
+
function FromThis9(schema, references) {
|
|
4513
|
+
if (IsTransform(schema))
|
|
4514
|
+
return true;
|
|
4515
|
+
return Visit13(Deref(schema, references), references);
|
|
4516
|
+
}
|
|
4517
|
+
function FromTuple12(schema, references) {
|
|
4518
|
+
return IsTransform(schema) || !IsUndefined(schema.items) && schema.items.some((schema2) => Visit13(schema2, references));
|
|
4519
|
+
}
|
|
4520
|
+
function FromUnion14(schema, references) {
|
|
4521
|
+
return IsTransform(schema) || schema.anyOf.some((schema2) => Visit13(schema2, references));
|
|
4522
|
+
}
|
|
4523
|
+
function Visit13(schema, references) {
|
|
4524
|
+
const references_ = Pushref(schema, references);
|
|
4525
|
+
const schema_ = schema;
|
|
4526
|
+
if (schema.$id && visited.has(schema.$id))
|
|
4527
|
+
return false;
|
|
4528
|
+
if (schema.$id)
|
|
4529
|
+
visited.add(schema.$id);
|
|
4530
|
+
switch (schema[Kind]) {
|
|
4531
|
+
case "Array":
|
|
4532
|
+
return FromArray13(schema_, references_);
|
|
4533
|
+
case "AsyncIterator":
|
|
4534
|
+
return FromAsyncIterator5(schema_, references_);
|
|
4535
|
+
case "Constructor":
|
|
4536
|
+
return FromConstructor6(schema_, references_);
|
|
4537
|
+
case "Function":
|
|
4538
|
+
return FromFunction5(schema_, references_);
|
|
4539
|
+
case "Import":
|
|
4540
|
+
return FromImport9(schema_, references_);
|
|
4541
|
+
case "Intersect":
|
|
4542
|
+
return FromIntersect12(schema_, references_);
|
|
4543
|
+
case "Iterator":
|
|
4544
|
+
return FromIterator5(schema_, references_);
|
|
4545
|
+
case "Not":
|
|
4546
|
+
return FromNot7(schema_, references_);
|
|
4547
|
+
case "Object":
|
|
4548
|
+
return FromObject11(schema_, references_);
|
|
4549
|
+
case "Promise":
|
|
4550
|
+
return FromPromise5(schema_, references_);
|
|
4551
|
+
case "Record":
|
|
4552
|
+
return FromRecord10(schema_, references_);
|
|
4553
|
+
case "Ref":
|
|
4554
|
+
return FromRef10(schema_, references_);
|
|
4555
|
+
case "This":
|
|
4556
|
+
return FromThis9(schema_, references_);
|
|
4557
|
+
case "Tuple":
|
|
4558
|
+
return FromTuple12(schema_, references_);
|
|
4559
|
+
case "Union":
|
|
4560
|
+
return FromUnion14(schema_, references_);
|
|
4561
|
+
default:
|
|
4562
|
+
return IsTransform(schema);
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
var visited = new Set;
|
|
4566
|
+
function HasTransform(schema, references) {
|
|
4567
|
+
visited.clear();
|
|
4568
|
+
return Visit13(schema, references);
|
|
4569
|
+
}
|
|
4570
|
+
|
|
4571
|
+
// node_modules/@sinclair/typebox/build/esm/value/decode/decode.mjs
|
|
4572
|
+
function Decode(...args) {
|
|
4573
|
+
const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]];
|
|
4574
|
+
if (!Check(schema, references, value))
|
|
4575
|
+
throw new TransformDecodeCheckError(schema, value, Errors(schema, references, value).First());
|
|
4576
|
+
return HasTransform(schema, references) ? TransformDecode(schema, references, value) : value;
|
|
4577
|
+
}
|
|
4578
|
+
// node_modules/@sinclair/typebox/build/esm/value/default/default.mjs
|
|
4579
|
+
function ValueOrDefault(schema, value) {
|
|
4580
|
+
const defaultValue = HasPropertyKey(schema, "default") ? schema.default : undefined;
|
|
4581
|
+
const clone = IsFunction(defaultValue) ? defaultValue() : Clone2(defaultValue);
|
|
4582
|
+
return IsUndefined(value) ? clone : IsObject(value) && IsObject(clone) ? Object.assign(clone, value) : value;
|
|
4583
|
+
}
|
|
4584
|
+
function HasDefaultProperty(schema) {
|
|
4585
|
+
return IsKind(schema) && "default" in schema;
|
|
4586
|
+
}
|
|
4587
|
+
function FromArray14(schema, references, value) {
|
|
4588
|
+
if (IsArray(value)) {
|
|
4589
|
+
for (let i = 0;i < value.length; i++) {
|
|
4590
|
+
value[i] = Visit14(schema.items, references, value[i]);
|
|
4591
|
+
}
|
|
4592
|
+
return value;
|
|
4593
|
+
}
|
|
4594
|
+
const defaulted = ValueOrDefault(schema, value);
|
|
4595
|
+
if (!IsArray(defaulted))
|
|
4596
|
+
return defaulted;
|
|
4597
|
+
for (let i = 0;i < defaulted.length; i++) {
|
|
4598
|
+
defaulted[i] = Visit14(schema.items, references, defaulted[i]);
|
|
4599
|
+
}
|
|
4600
|
+
return defaulted;
|
|
4601
|
+
}
|
|
4602
|
+
function FromDate7(schema, references, value) {
|
|
4603
|
+
return IsDate(value) ? value : ValueOrDefault(schema, value);
|
|
4604
|
+
}
|
|
4605
|
+
function FromImport10(schema, references, value) {
|
|
4606
|
+
const definitions = globalThis.Object.values(schema.$defs);
|
|
4607
|
+
const target = schema.$defs[schema.$ref];
|
|
4608
|
+
return Visit14(target, [...references, ...definitions], value);
|
|
4609
|
+
}
|
|
4610
|
+
function FromIntersect13(schema, references, value) {
|
|
4611
|
+
const defaulted = ValueOrDefault(schema, value);
|
|
4612
|
+
return schema.allOf.reduce((acc, schema2) => {
|
|
4613
|
+
const next = Visit14(schema2, references, defaulted);
|
|
4614
|
+
return IsObject(next) ? { ...acc, ...next } : next;
|
|
4615
|
+
}, {});
|
|
4616
|
+
}
|
|
4617
|
+
function FromObject12(schema, references, value) {
|
|
4618
|
+
const defaulted = ValueOrDefault(schema, value);
|
|
4619
|
+
if (!IsObject(defaulted))
|
|
4620
|
+
return defaulted;
|
|
4621
|
+
const knownPropertyKeys = Object.getOwnPropertyNames(schema.properties);
|
|
4622
|
+
for (const key of knownPropertyKeys) {
|
|
4623
|
+
const propertyValue = Visit14(schema.properties[key], references, defaulted[key]);
|
|
4624
|
+
if (IsUndefined(propertyValue))
|
|
4625
|
+
continue;
|
|
4626
|
+
defaulted[key] = Visit14(schema.properties[key], references, defaulted[key]);
|
|
4627
|
+
}
|
|
4628
|
+
if (!HasDefaultProperty(schema.additionalProperties))
|
|
4629
|
+
return defaulted;
|
|
4630
|
+
for (const key of Object.getOwnPropertyNames(defaulted)) {
|
|
4631
|
+
if (knownPropertyKeys.includes(key))
|
|
4632
|
+
continue;
|
|
4633
|
+
defaulted[key] = Visit14(schema.additionalProperties, references, defaulted[key]);
|
|
4634
|
+
}
|
|
4635
|
+
return defaulted;
|
|
4636
|
+
}
|
|
4637
|
+
function FromRecord11(schema, references, value) {
|
|
4638
|
+
const defaulted = ValueOrDefault(schema, value);
|
|
4639
|
+
if (!IsObject(defaulted))
|
|
4640
|
+
return defaulted;
|
|
4641
|
+
const additionalPropertiesSchema = schema.additionalProperties;
|
|
4642
|
+
const [propertyKeyPattern, propertySchema] = Object.entries(schema.patternProperties)[0];
|
|
4643
|
+
const knownPropertyKey = new RegExp(propertyKeyPattern);
|
|
4644
|
+
for (const key of Object.getOwnPropertyNames(defaulted)) {
|
|
4645
|
+
if (!(knownPropertyKey.test(key) && HasDefaultProperty(propertySchema)))
|
|
4646
|
+
continue;
|
|
4647
|
+
defaulted[key] = Visit14(propertySchema, references, defaulted[key]);
|
|
4648
|
+
}
|
|
4649
|
+
if (!HasDefaultProperty(additionalPropertiesSchema))
|
|
4650
|
+
return defaulted;
|
|
4651
|
+
for (const key of Object.getOwnPropertyNames(defaulted)) {
|
|
4652
|
+
if (knownPropertyKey.test(key))
|
|
4653
|
+
continue;
|
|
4654
|
+
defaulted[key] = Visit14(additionalPropertiesSchema, references, defaulted[key]);
|
|
4655
|
+
}
|
|
4656
|
+
return defaulted;
|
|
4657
|
+
}
|
|
4658
|
+
function FromRef11(schema, references, value) {
|
|
4659
|
+
return Visit14(Deref(schema, references), references, ValueOrDefault(schema, value));
|
|
4660
|
+
}
|
|
4661
|
+
function FromThis10(schema, references, value) {
|
|
4662
|
+
return Visit14(Deref(schema, references), references, value);
|
|
4663
|
+
}
|
|
4664
|
+
function FromTuple13(schema, references, value) {
|
|
4665
|
+
const defaulted = ValueOrDefault(schema, value);
|
|
4666
|
+
if (!IsArray(defaulted) || IsUndefined(schema.items))
|
|
4667
|
+
return defaulted;
|
|
4668
|
+
const [items, max] = [schema.items, Math.max(schema.items.length, defaulted.length)];
|
|
4669
|
+
for (let i = 0;i < max; i++) {
|
|
4670
|
+
if (i < items.length)
|
|
4671
|
+
defaulted[i] = Visit14(items[i], references, defaulted[i]);
|
|
4672
|
+
}
|
|
4673
|
+
return defaulted;
|
|
4674
|
+
}
|
|
4675
|
+
function FromUnion15(schema, references, value) {
|
|
4676
|
+
const defaulted = ValueOrDefault(schema, value);
|
|
4677
|
+
for (const inner of schema.anyOf) {
|
|
4678
|
+
const result = Visit14(inner, references, Clone2(defaulted));
|
|
4679
|
+
if (Check(inner, references, result)) {
|
|
4680
|
+
return result;
|
|
4681
|
+
}
|
|
4682
|
+
}
|
|
4683
|
+
return defaulted;
|
|
4684
|
+
}
|
|
4685
|
+
function Visit14(schema, references, value) {
|
|
4686
|
+
const references_ = Pushref(schema, references);
|
|
4687
|
+
const schema_ = schema;
|
|
4688
|
+
switch (schema_[Kind]) {
|
|
4689
|
+
case "Array":
|
|
4690
|
+
return FromArray14(schema_, references_, value);
|
|
4691
|
+
case "Date":
|
|
4692
|
+
return FromDate7(schema_, references_, value);
|
|
4693
|
+
case "Import":
|
|
4694
|
+
return FromImport10(schema_, references_, value);
|
|
4695
|
+
case "Intersect":
|
|
4696
|
+
return FromIntersect13(schema_, references_, value);
|
|
4697
|
+
case "Object":
|
|
4698
|
+
return FromObject12(schema_, references_, value);
|
|
4699
|
+
case "Record":
|
|
4700
|
+
return FromRecord11(schema_, references_, value);
|
|
4701
|
+
case "Ref":
|
|
4702
|
+
return FromRef11(schema_, references_, value);
|
|
4703
|
+
case "This":
|
|
4704
|
+
return FromThis10(schema_, references_, value);
|
|
4705
|
+
case "Tuple":
|
|
4706
|
+
return FromTuple13(schema_, references_, value);
|
|
4707
|
+
case "Union":
|
|
4708
|
+
return FromUnion15(schema_, references_, value);
|
|
4709
|
+
default:
|
|
4710
|
+
return ValueOrDefault(schema_, value);
|
|
4711
|
+
}
|
|
4712
|
+
}
|
|
4713
|
+
function Default5(...args) {
|
|
4714
|
+
return args.length === 3 ? Visit14(args[0], args[1], args[2]) : Visit14(args[0], [], args[1]);
|
|
4715
|
+
}
|
|
4716
|
+
// node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.mjs
|
|
4717
|
+
var exports_pointer = {};
|
|
4718
|
+
__export(exports_pointer, {
|
|
4719
|
+
Delete: () => Delete3,
|
|
4720
|
+
Format: () => Format,
|
|
4721
|
+
Get: () => Get3,
|
|
4722
|
+
Has: () => Has3,
|
|
4723
|
+
Set: () => Set4,
|
|
4724
|
+
ValuePointerRootDeleteError: () => ValuePointerRootDeleteError,
|
|
4725
|
+
ValuePointerRootSetError: () => ValuePointerRootSetError
|
|
4726
|
+
});
|
|
4727
|
+
class ValuePointerRootSetError extends TypeBoxError {
|
|
4728
|
+
constructor(value, path, update) {
|
|
4729
|
+
super("Cannot set root value");
|
|
4730
|
+
this.value = value;
|
|
4731
|
+
this.path = path;
|
|
4732
|
+
this.update = update;
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
|
|
4736
|
+
class ValuePointerRootDeleteError extends TypeBoxError {
|
|
4737
|
+
constructor(value, path) {
|
|
4738
|
+
super("Cannot delete root value");
|
|
4739
|
+
this.value = value;
|
|
4740
|
+
this.path = path;
|
|
4741
|
+
}
|
|
4742
|
+
}
|
|
4743
|
+
function Escape2(component) {
|
|
4744
|
+
return component.indexOf("~") === -1 ? component : component.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
4745
|
+
}
|
|
4746
|
+
function* Format(pointer) {
|
|
4747
|
+
if (pointer === "")
|
|
4748
|
+
return;
|
|
4749
|
+
let [start, end] = [0, 0];
|
|
4750
|
+
for (let i = 0;i < pointer.length; i++) {
|
|
4751
|
+
const char = pointer.charAt(i);
|
|
4752
|
+
if (char === "/") {
|
|
4753
|
+
if (i === 0) {
|
|
4754
|
+
start = i + 1;
|
|
4755
|
+
} else {
|
|
4756
|
+
end = i;
|
|
4757
|
+
yield Escape2(pointer.slice(start, end));
|
|
4758
|
+
start = i + 1;
|
|
4759
|
+
}
|
|
4760
|
+
} else {
|
|
4761
|
+
end = i;
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
4764
|
+
yield Escape2(pointer.slice(start));
|
|
4765
|
+
}
|
|
4766
|
+
function Set4(value, pointer, update) {
|
|
4767
|
+
if (pointer === "")
|
|
4768
|
+
throw new ValuePointerRootSetError(value, pointer, update);
|
|
4769
|
+
let [owner, next, key] = [null, value, ""];
|
|
4770
|
+
for (const component of Format(pointer)) {
|
|
4771
|
+
if (next[component] === undefined)
|
|
4772
|
+
next[component] = {};
|
|
4773
|
+
owner = next;
|
|
4774
|
+
next = next[component];
|
|
4775
|
+
key = component;
|
|
4776
|
+
}
|
|
4777
|
+
owner[key] = update;
|
|
4778
|
+
}
|
|
4779
|
+
function Delete3(value, pointer) {
|
|
4780
|
+
if (pointer === "")
|
|
4781
|
+
throw new ValuePointerRootDeleteError(value, pointer);
|
|
4782
|
+
let [owner, next, key] = [null, value, ""];
|
|
4783
|
+
for (const component of Format(pointer)) {
|
|
4784
|
+
if (next[component] === undefined || next[component] === null)
|
|
4785
|
+
return;
|
|
4786
|
+
owner = next;
|
|
4787
|
+
next = next[component];
|
|
4788
|
+
key = component;
|
|
4789
|
+
}
|
|
4790
|
+
if (Array.isArray(owner)) {
|
|
4791
|
+
const index = parseInt(key);
|
|
4792
|
+
owner.splice(index, 1);
|
|
4793
|
+
} else {
|
|
4794
|
+
delete owner[key];
|
|
4795
|
+
}
|
|
4796
|
+
}
|
|
4797
|
+
function Has3(value, pointer) {
|
|
4798
|
+
if (pointer === "")
|
|
4799
|
+
return true;
|
|
4800
|
+
let [owner, next, key] = [null, value, ""];
|
|
4801
|
+
for (const component of Format(pointer)) {
|
|
4802
|
+
if (next[component] === undefined)
|
|
4803
|
+
return false;
|
|
4804
|
+
owner = next;
|
|
4805
|
+
next = next[component];
|
|
4806
|
+
key = component;
|
|
4807
|
+
}
|
|
4808
|
+
return Object.getOwnPropertyNames(owner).includes(key);
|
|
4809
|
+
}
|
|
4810
|
+
function Get3(value, pointer) {
|
|
4811
|
+
if (pointer === "")
|
|
4812
|
+
return value;
|
|
4813
|
+
let current = value;
|
|
4814
|
+
for (const component of Format(pointer)) {
|
|
4815
|
+
if (current[component] === undefined)
|
|
4816
|
+
return;
|
|
4817
|
+
current = current[component];
|
|
4818
|
+
}
|
|
4819
|
+
return current;
|
|
4820
|
+
}
|
|
4821
|
+
// node_modules/@sinclair/typebox/build/esm/value/equal/equal.mjs
|
|
4822
|
+
function ObjectType3(left, right) {
|
|
4823
|
+
if (!IsObject(right))
|
|
4824
|
+
return false;
|
|
4825
|
+
const leftKeys = [...Object.keys(left), ...Object.getOwnPropertySymbols(left)];
|
|
4826
|
+
const rightKeys = [...Object.keys(right), ...Object.getOwnPropertySymbols(right)];
|
|
4827
|
+
if (leftKeys.length !== rightKeys.length)
|
|
4828
|
+
return false;
|
|
4829
|
+
return leftKeys.every((key) => Equal(left[key], right[key]));
|
|
4830
|
+
}
|
|
4831
|
+
function DateType3(left, right) {
|
|
4832
|
+
return IsDate(right) && left.getTime() === right.getTime();
|
|
4833
|
+
}
|
|
4834
|
+
function ArrayType3(left, right) {
|
|
4835
|
+
if (!IsArray(right) || left.length !== right.length)
|
|
4836
|
+
return false;
|
|
4837
|
+
return left.every((value, index) => Equal(value, right[index]));
|
|
4838
|
+
}
|
|
4839
|
+
function TypedArrayType(left, right) {
|
|
4840
|
+
if (!IsTypedArray(right) || left.length !== right.length || Object.getPrototypeOf(left).constructor.name !== Object.getPrototypeOf(right).constructor.name)
|
|
4841
|
+
return false;
|
|
4842
|
+
return left.every((value, index) => Equal(value, right[index]));
|
|
4843
|
+
}
|
|
4844
|
+
function ValueType(left, right) {
|
|
4845
|
+
return left === right;
|
|
4846
|
+
}
|
|
4847
|
+
function Equal(left, right) {
|
|
4848
|
+
if (IsDate(left))
|
|
4849
|
+
return DateType3(left, right);
|
|
4850
|
+
if (IsTypedArray(left))
|
|
4851
|
+
return TypedArrayType(left, right);
|
|
4852
|
+
if (IsArray(left))
|
|
4853
|
+
return ArrayType3(left, right);
|
|
4854
|
+
if (IsObject(left))
|
|
4855
|
+
return ObjectType3(left, right);
|
|
4856
|
+
if (IsValueType(left))
|
|
4857
|
+
return ValueType(left, right);
|
|
4858
|
+
throw new Error("ValueEquals: Unable to compare value");
|
|
4859
|
+
}
|
|
4860
|
+
|
|
4861
|
+
// node_modules/@sinclair/typebox/build/esm/value/delta/delta.mjs
|
|
4862
|
+
var Insert = Object2({
|
|
4863
|
+
type: Literal("insert"),
|
|
4864
|
+
path: String2(),
|
|
4865
|
+
value: Unknown()
|
|
4866
|
+
});
|
|
4867
|
+
var Update = Object2({
|
|
4868
|
+
type: Literal("update"),
|
|
4869
|
+
path: String2(),
|
|
4870
|
+
value: Unknown()
|
|
4871
|
+
});
|
|
4872
|
+
var Delete4 = Object2({
|
|
4873
|
+
type: Literal("delete"),
|
|
4874
|
+
path: String2()
|
|
4875
|
+
});
|
|
4876
|
+
var Edit = Union([Insert, Update, Delete4]);
|
|
4877
|
+
|
|
4878
|
+
class ValueDiffError extends TypeBoxError {
|
|
4879
|
+
constructor(value, message) {
|
|
4880
|
+
super(message);
|
|
4881
|
+
this.value = value;
|
|
4882
|
+
}
|
|
4883
|
+
}
|
|
4884
|
+
function CreateUpdate(path, value) {
|
|
4885
|
+
return { type: "update", path, value };
|
|
4886
|
+
}
|
|
4887
|
+
function CreateInsert(path, value) {
|
|
4888
|
+
return { type: "insert", path, value };
|
|
4889
|
+
}
|
|
4890
|
+
function CreateDelete(path) {
|
|
4891
|
+
return { type: "delete", path };
|
|
4892
|
+
}
|
|
4893
|
+
function AssertDiffable(value) {
|
|
4894
|
+
if (globalThis.Object.getOwnPropertySymbols(value).length > 0)
|
|
4895
|
+
throw new ValueDiffError(value, "Cannot diff objects with symbols");
|
|
4896
|
+
}
|
|
4897
|
+
function* ObjectType4(path, current, next) {
|
|
4898
|
+
AssertDiffable(current);
|
|
4899
|
+
AssertDiffable(next);
|
|
4900
|
+
if (!IsStandardObject(next))
|
|
4901
|
+
return yield CreateUpdate(path, next);
|
|
4902
|
+
const currentKeys = globalThis.Object.getOwnPropertyNames(current);
|
|
4903
|
+
const nextKeys = globalThis.Object.getOwnPropertyNames(next);
|
|
4904
|
+
for (const key of nextKeys) {
|
|
4905
|
+
if (HasPropertyKey(current, key))
|
|
4906
|
+
continue;
|
|
4907
|
+
yield CreateInsert(`${path}/${key}`, next[key]);
|
|
4908
|
+
}
|
|
4909
|
+
for (const key of currentKeys) {
|
|
4910
|
+
if (!HasPropertyKey(next, key))
|
|
4911
|
+
continue;
|
|
4912
|
+
if (Equal(current, next))
|
|
4913
|
+
continue;
|
|
4914
|
+
yield* Visit15(`${path}/${key}`, current[key], next[key]);
|
|
4915
|
+
}
|
|
4916
|
+
for (const key of currentKeys) {
|
|
4917
|
+
if (HasPropertyKey(next, key))
|
|
4918
|
+
continue;
|
|
4919
|
+
yield CreateDelete(`${path}/${key}`);
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
function* ArrayType4(path, current, next) {
|
|
4923
|
+
if (!IsArray(next))
|
|
4924
|
+
return yield CreateUpdate(path, next);
|
|
4925
|
+
for (let i = 0;i < Math.min(current.length, next.length); i++) {
|
|
4926
|
+
yield* Visit15(`${path}/${i}`, current[i], next[i]);
|
|
4927
|
+
}
|
|
4928
|
+
for (let i = 0;i < next.length; i++) {
|
|
4929
|
+
if (i < current.length)
|
|
4930
|
+
continue;
|
|
4931
|
+
yield CreateInsert(`${path}/${i}`, next[i]);
|
|
4932
|
+
}
|
|
4933
|
+
for (let i = current.length - 1;i >= 0; i--) {
|
|
4934
|
+
if (i < next.length)
|
|
4935
|
+
continue;
|
|
4936
|
+
yield CreateDelete(`${path}/${i}`);
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
function* TypedArrayType2(path, current, next) {
|
|
4940
|
+
if (!IsTypedArray(next) || current.length !== next.length || globalThis.Object.getPrototypeOf(current).constructor.name !== globalThis.Object.getPrototypeOf(next).constructor.name)
|
|
4941
|
+
return yield CreateUpdate(path, next);
|
|
4942
|
+
for (let i = 0;i < Math.min(current.length, next.length); i++) {
|
|
4943
|
+
yield* Visit15(`${path}/${i}`, current[i], next[i]);
|
|
4944
|
+
}
|
|
4945
|
+
}
|
|
4946
|
+
function* ValueType2(path, current, next) {
|
|
4947
|
+
if (current === next)
|
|
4948
|
+
return;
|
|
4949
|
+
yield CreateUpdate(path, next);
|
|
4950
|
+
}
|
|
4951
|
+
function* Visit15(path, current, next) {
|
|
4952
|
+
if (IsStandardObject(current))
|
|
4953
|
+
return yield* ObjectType4(path, current, next);
|
|
4954
|
+
if (IsArray(current))
|
|
4955
|
+
return yield* ArrayType4(path, current, next);
|
|
4956
|
+
if (IsTypedArray(current))
|
|
4957
|
+
return yield* TypedArrayType2(path, current, next);
|
|
4958
|
+
if (IsValueType(current))
|
|
4959
|
+
return yield* ValueType2(path, current, next);
|
|
4960
|
+
throw new ValueDiffError(current, "Unable to diff value");
|
|
4961
|
+
}
|
|
4962
|
+
function Diff(current, next) {
|
|
4963
|
+
return [...Visit15("", current, next)];
|
|
4964
|
+
}
|
|
4965
|
+
function IsRootUpdate(edits) {
|
|
4966
|
+
return edits.length > 0 && edits[0].path === "" && edits[0].type === "update";
|
|
4967
|
+
}
|
|
4968
|
+
function IsIdentity(edits) {
|
|
4969
|
+
return edits.length === 0;
|
|
4970
|
+
}
|
|
4971
|
+
function Patch(current, edits) {
|
|
4972
|
+
if (IsRootUpdate(edits)) {
|
|
4973
|
+
return Clone2(edits[0].value);
|
|
4974
|
+
}
|
|
4975
|
+
if (IsIdentity(edits)) {
|
|
4976
|
+
return Clone2(current);
|
|
4977
|
+
}
|
|
4978
|
+
const clone = Clone2(current);
|
|
4979
|
+
for (const edit of edits) {
|
|
4980
|
+
switch (edit.type) {
|
|
4981
|
+
case "insert": {
|
|
4982
|
+
exports_pointer.Set(clone, edit.path, edit.value);
|
|
4983
|
+
break;
|
|
4984
|
+
}
|
|
4985
|
+
case "update": {
|
|
4986
|
+
exports_pointer.Set(clone, edit.path, edit.value);
|
|
4987
|
+
break;
|
|
4988
|
+
}
|
|
4989
|
+
case "delete": {
|
|
4990
|
+
exports_pointer.Delete(clone, edit.path);
|
|
4991
|
+
break;
|
|
4992
|
+
}
|
|
4993
|
+
}
|
|
4994
|
+
}
|
|
4995
|
+
return clone;
|
|
4996
|
+
}
|
|
4997
|
+
// node_modules/@sinclair/typebox/build/esm/value/encode/encode.mjs
|
|
4998
|
+
function Encode(...args) {
|
|
4999
|
+
const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]];
|
|
5000
|
+
const encoded = HasTransform(schema, references) ? TransformEncode(schema, references, value) : value;
|
|
5001
|
+
if (!Check(schema, references, encoded))
|
|
5002
|
+
throw new TransformEncodeCheckError(schema, encoded, Errors(schema, references, encoded).First());
|
|
5003
|
+
return encoded;
|
|
5004
|
+
}
|
|
5005
|
+
// node_modules/@sinclair/typebox/build/esm/value/mutate/mutate.mjs
|
|
5006
|
+
function IsStandardObject2(value) {
|
|
5007
|
+
return IsObject(value) && !IsArray(value);
|
|
5008
|
+
}
|
|
5009
|
+
|
|
5010
|
+
class ValueMutateError extends TypeBoxError {
|
|
5011
|
+
constructor(message) {
|
|
5012
|
+
super(message);
|
|
5013
|
+
}
|
|
5014
|
+
}
|
|
5015
|
+
function ObjectType5(root, path, current, next) {
|
|
5016
|
+
if (!IsStandardObject2(current)) {
|
|
5017
|
+
exports_pointer.Set(root, path, Clone2(next));
|
|
5018
|
+
} else {
|
|
5019
|
+
const currentKeys = Object.getOwnPropertyNames(current);
|
|
5020
|
+
const nextKeys = Object.getOwnPropertyNames(next);
|
|
5021
|
+
for (const currentKey of currentKeys) {
|
|
5022
|
+
if (!nextKeys.includes(currentKey)) {
|
|
5023
|
+
delete current[currentKey];
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5026
|
+
for (const nextKey of nextKeys) {
|
|
5027
|
+
if (!currentKeys.includes(nextKey)) {
|
|
5028
|
+
current[nextKey] = null;
|
|
5029
|
+
}
|
|
5030
|
+
}
|
|
5031
|
+
for (const nextKey of nextKeys) {
|
|
5032
|
+
Visit16(root, `${path}/${nextKey}`, current[nextKey], next[nextKey]);
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
function ArrayType5(root, path, current, next) {
|
|
5037
|
+
if (!IsArray(current)) {
|
|
5038
|
+
exports_pointer.Set(root, path, Clone2(next));
|
|
5039
|
+
} else {
|
|
5040
|
+
for (let index = 0;index < next.length; index++) {
|
|
5041
|
+
Visit16(root, `${path}/${index}`, current[index], next[index]);
|
|
5042
|
+
}
|
|
5043
|
+
current.splice(next.length);
|
|
5044
|
+
}
|
|
5045
|
+
}
|
|
5046
|
+
function TypedArrayType3(root, path, current, next) {
|
|
5047
|
+
if (IsTypedArray(current) && current.length === next.length) {
|
|
5048
|
+
for (let i = 0;i < current.length; i++) {
|
|
5049
|
+
current[i] = next[i];
|
|
5050
|
+
}
|
|
5051
|
+
} else {
|
|
5052
|
+
exports_pointer.Set(root, path, Clone2(next));
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5055
|
+
function ValueType3(root, path, current, next) {
|
|
5056
|
+
if (current === next)
|
|
5057
|
+
return;
|
|
5058
|
+
exports_pointer.Set(root, path, next);
|
|
5059
|
+
}
|
|
5060
|
+
function Visit16(root, path, current, next) {
|
|
5061
|
+
if (IsArray(next))
|
|
5062
|
+
return ArrayType5(root, path, current, next);
|
|
5063
|
+
if (IsTypedArray(next))
|
|
5064
|
+
return TypedArrayType3(root, path, current, next);
|
|
5065
|
+
if (IsStandardObject2(next))
|
|
5066
|
+
return ObjectType5(root, path, current, next);
|
|
5067
|
+
if (IsValueType(next))
|
|
5068
|
+
return ValueType3(root, path, current, next);
|
|
5069
|
+
}
|
|
5070
|
+
function IsNonMutableValue(value) {
|
|
5071
|
+
return IsTypedArray(value) || IsValueType(value);
|
|
5072
|
+
}
|
|
5073
|
+
function IsMismatchedValue(current, next) {
|
|
5074
|
+
return IsStandardObject2(current) && IsArray(next) || IsArray(current) && IsStandardObject2(next);
|
|
5075
|
+
}
|
|
5076
|
+
function Mutate(current, next) {
|
|
5077
|
+
if (IsNonMutableValue(current) || IsNonMutableValue(next))
|
|
5078
|
+
throw new ValueMutateError("Only object and array types can be mutated at the root level");
|
|
5079
|
+
if (IsMismatchedValue(current, next))
|
|
5080
|
+
throw new ValueMutateError("Cannot assign due type mismatch of assignable values");
|
|
5081
|
+
Visit16(current, "", current, next);
|
|
5082
|
+
}
|
|
5083
|
+
// node_modules/@sinclair/typebox/build/esm/value/parse/parse.mjs
|
|
5084
|
+
class ParseError extends TypeBoxError {
|
|
5085
|
+
constructor(message) {
|
|
5086
|
+
super(message);
|
|
5087
|
+
}
|
|
5088
|
+
}
|
|
5089
|
+
var ParseRegistry;
|
|
5090
|
+
(function(ParseRegistry2) {
|
|
5091
|
+
const registry = new Map([
|
|
5092
|
+
["Assert", (type, references, value) => {
|
|
5093
|
+
Assert(type, references, value);
|
|
5094
|
+
return value;
|
|
5095
|
+
}],
|
|
5096
|
+
["Cast", (type, references, value) => Cast(type, references, value)],
|
|
5097
|
+
["Clean", (type, references, value) => Clean(type, references, value)],
|
|
5098
|
+
["Clone", (_type, _references, value) => Clone2(value)],
|
|
5099
|
+
["Convert", (type, references, value) => Convert(type, references, value)],
|
|
5100
|
+
["Decode", (type, references, value) => HasTransform(type, references) ? TransformDecode(type, references, value) : value],
|
|
5101
|
+
["Default", (type, references, value) => Default5(type, references, value)],
|
|
5102
|
+
["Encode", (type, references, value) => HasTransform(type, references) ? TransformEncode(type, references, value) : value]
|
|
5103
|
+
]);
|
|
5104
|
+
function Delete5(key) {
|
|
5105
|
+
registry.delete(key);
|
|
5106
|
+
}
|
|
5107
|
+
ParseRegistry2.Delete = Delete5;
|
|
5108
|
+
function Set5(key, callback) {
|
|
5109
|
+
registry.set(key, callback);
|
|
5110
|
+
}
|
|
5111
|
+
ParseRegistry2.Set = Set5;
|
|
5112
|
+
function Get4(key) {
|
|
5113
|
+
return registry.get(key);
|
|
5114
|
+
}
|
|
5115
|
+
ParseRegistry2.Get = Get4;
|
|
5116
|
+
})(ParseRegistry || (ParseRegistry = {}));
|
|
5117
|
+
var ParseDefault = [
|
|
5118
|
+
"Clone",
|
|
5119
|
+
"Clean",
|
|
5120
|
+
"Default",
|
|
5121
|
+
"Convert",
|
|
5122
|
+
"Assert",
|
|
5123
|
+
"Decode"
|
|
5124
|
+
];
|
|
5125
|
+
function ParseValue(operations, type, references, value) {
|
|
5126
|
+
return operations.reduce((value2, operationKey) => {
|
|
5127
|
+
const operation = ParseRegistry.Get(operationKey);
|
|
5128
|
+
if (IsUndefined(operation))
|
|
5129
|
+
throw new ParseError(`Unable to find Parse operation '${operationKey}'`);
|
|
5130
|
+
return operation(type, references, value2);
|
|
5131
|
+
}, value);
|
|
5132
|
+
}
|
|
5133
|
+
function Parse(...args) {
|
|
5134
|
+
const [operations, schema, references, value] = args.length === 4 ? [args[0], args[1], args[2], args[3]] : args.length === 3 ? IsArray(args[0]) ? [args[0], args[1], [], args[2]] : [ParseDefault, args[0], args[1], args[2]] : args.length === 2 ? [ParseDefault, args[0], [], args[1]] : (() => {
|
|
5135
|
+
throw new ParseError("Invalid Arguments");
|
|
5136
|
+
})();
|
|
5137
|
+
return ParseValue(operations, schema, references, value);
|
|
5138
|
+
}
|
|
5139
|
+
// node_modules/@sinclair/typebox/build/esm/value/value/value.mjs
|
|
5140
|
+
var exports_value2 = {};
|
|
5141
|
+
__export(exports_value2, {
|
|
5142
|
+
Assert: () => Assert,
|
|
5143
|
+
Cast: () => Cast,
|
|
5144
|
+
Check: () => Check,
|
|
5145
|
+
Clean: () => Clean,
|
|
5146
|
+
Clone: () => Clone2,
|
|
5147
|
+
Convert: () => Convert,
|
|
5148
|
+
Create: () => Create2,
|
|
5149
|
+
Decode: () => Decode,
|
|
5150
|
+
Default: () => Default5,
|
|
5151
|
+
Diff: () => Diff,
|
|
5152
|
+
Edit: () => Edit,
|
|
5153
|
+
Encode: () => Encode,
|
|
5154
|
+
Equal: () => Equal,
|
|
5155
|
+
Errors: () => Errors,
|
|
5156
|
+
Hash: () => Hash,
|
|
5157
|
+
Mutate: () => Mutate,
|
|
5158
|
+
Parse: () => Parse,
|
|
5159
|
+
Patch: () => Patch,
|
|
5160
|
+
ValueErrorIterator: () => ValueErrorIterator
|
|
5161
|
+
});
|
|
5162
|
+
// node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
5163
|
+
function CloneType(schema, options) {
|
|
5164
|
+
return options === undefined ? Clone(schema) : Clone({ ...options, ...schema });
|
|
5165
|
+
}
|
|
5166
|
+
|
|
5167
|
+
// node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
|
|
5168
|
+
function Argument(index) {
|
|
5169
|
+
return CreateType({ [Kind]: "Argument", index });
|
|
5170
|
+
}
|
|
5171
|
+
|
|
5172
|
+
// node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
5173
|
+
function FromComputed2(target, parameters) {
|
|
5174
|
+
return Computed("Awaited", [Computed(target, parameters)]);
|
|
5175
|
+
}
|
|
5176
|
+
function FromRef12($ref) {
|
|
5177
|
+
return Computed("Awaited", [Ref($ref)]);
|
|
5178
|
+
}
|
|
5179
|
+
function FromIntersect14(types) {
|
|
5180
|
+
return Intersect(FromRest4(types));
|
|
5181
|
+
}
|
|
5182
|
+
function FromUnion16(types) {
|
|
5183
|
+
return Union(FromRest4(types));
|
|
5184
|
+
}
|
|
5185
|
+
function FromPromise6(type) {
|
|
5186
|
+
return Awaited(type);
|
|
5187
|
+
}
|
|
5188
|
+
function FromRest4(types) {
|
|
5189
|
+
return types.map((type) => Awaited(type));
|
|
5190
|
+
}
|
|
5191
|
+
function Awaited(type, options) {
|
|
5192
|
+
return CreateType(IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsIntersect(type) ? FromIntersect14(type.allOf) : IsUnion(type) ? FromUnion16(type.anyOf) : IsPromise2(type) ? FromPromise6(type.item) : IsRef(type) ? FromRef12(type.$ref) : type, options);
|
|
5193
|
+
}
|
|
5194
|
+
|
|
5195
|
+
// node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
5196
|
+
function CompositeKeys(T) {
|
|
5197
|
+
const Acc = [];
|
|
5198
|
+
for (const L of T)
|
|
5199
|
+
Acc.push(...KeyOfPropertyKeys(L));
|
|
5200
|
+
return SetDistinct(Acc);
|
|
5201
|
+
}
|
|
5202
|
+
function FilterNever(T) {
|
|
5203
|
+
return T.filter((L) => !IsNever(L));
|
|
5204
|
+
}
|
|
5205
|
+
function CompositeProperty(T, K) {
|
|
5206
|
+
const Acc = [];
|
|
5207
|
+
for (const L of T)
|
|
5208
|
+
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
5209
|
+
return FilterNever(Acc);
|
|
5210
|
+
}
|
|
5211
|
+
function CompositeProperties(T, K) {
|
|
5212
|
+
const Acc = {};
|
|
5213
|
+
for (const L of K) {
|
|
5214
|
+
Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
5215
|
+
}
|
|
5216
|
+
return Acc;
|
|
5217
|
+
}
|
|
5218
|
+
function Composite(T, options) {
|
|
5219
|
+
const K = CompositeKeys(T);
|
|
5220
|
+
const P = CompositeProperties(T, K);
|
|
1768
5221
|
const R = Object2(P, options);
|
|
1769
5222
|
return R;
|
|
1770
5223
|
}
|
|
@@ -1795,23 +5248,23 @@ function Uint8Array2(options) {
|
|
|
1795
5248
|
}
|
|
1796
5249
|
|
|
1797
5250
|
// node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
1798
|
-
function
|
|
1799
|
-
return T.map((L) =>
|
|
5251
|
+
function FromArray15(T) {
|
|
5252
|
+
return T.map((L) => FromValue2(L, false));
|
|
1800
5253
|
}
|
|
1801
5254
|
function FromProperties8(value) {
|
|
1802
5255
|
const Acc = {};
|
|
1803
5256
|
for (const K of globalThis.Object.getOwnPropertyNames(value))
|
|
1804
|
-
Acc[K] = Readonly(
|
|
5257
|
+
Acc[K] = Readonly(FromValue2(value[K], false));
|
|
1805
5258
|
return Acc;
|
|
1806
5259
|
}
|
|
1807
5260
|
function ConditionalReadonly(T, root) {
|
|
1808
5261
|
return root === true ? T : Readonly(T);
|
|
1809
5262
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return
|
|
5263
|
+
function FromValue2(value, root) {
|
|
5264
|
+
return IsAsyncIterator2(value) ? ConditionalReadonly(Any(), root) : IsIterator2(value) ? ConditionalReadonly(Any(), root) : IsArray2(value) ? Readonly(Tuple(FromArray15(value))) : IsUint8Array2(value) ? Uint8Array2() : IsDate2(value) ? Date2() : IsObject2(value) ? ConditionalReadonly(Object2(FromProperties8(value)), root) : IsFunction2(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined2(value) ? Undefined() : IsNull2(value) ? Null() : IsSymbol2(value) ? Symbol2() : IsBigInt2(value) ? BigInt2() : IsNumber2(value) ? Literal(value) : IsBoolean2(value) ? Literal(value) : IsString2(value) ? Literal(value) : Object2({});
|
|
1812
5265
|
}
|
|
1813
5266
|
function Const(T, options) {
|
|
1814
|
-
return CreateType(
|
|
5267
|
+
return CreateType(FromValue2(T, true), options);
|
|
1815
5268
|
}
|
|
1816
5269
|
|
|
1817
5270
|
// node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
@@ -1947,7 +5400,7 @@ function FromNumberKey(_, type, options) {
|
|
|
1947
5400
|
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1948
5401
|
}
|
|
1949
5402
|
function Record(key, type, options = {}) {
|
|
1950
|
-
return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) :
|
|
5403
|
+
return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean3(key) ? FromBooleanKey(key, type, options) : IsInteger2(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString3(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
|
|
1951
5404
|
}
|
|
1952
5405
|
function RecordPattern(record) {
|
|
1953
5406
|
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
|
|
@@ -1961,57 +5414,57 @@ function RecordValue2(type) {
|
|
|
1961
5414
|
}
|
|
1962
5415
|
|
|
1963
5416
|
// node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
1964
|
-
function
|
|
5417
|
+
function FromConstructor7(args, type) {
|
|
1965
5418
|
type.parameters = FromTypes(args, type.parameters);
|
|
1966
5419
|
type.returns = FromType(args, type.returns);
|
|
1967
5420
|
return type;
|
|
1968
5421
|
}
|
|
1969
|
-
function
|
|
5422
|
+
function FromFunction6(args, type) {
|
|
1970
5423
|
type.parameters = FromTypes(args, type.parameters);
|
|
1971
5424
|
type.returns = FromType(args, type.returns);
|
|
1972
5425
|
return type;
|
|
1973
5426
|
}
|
|
1974
|
-
function
|
|
5427
|
+
function FromIntersect15(args, type) {
|
|
1975
5428
|
type.allOf = FromTypes(args, type.allOf);
|
|
1976
5429
|
return type;
|
|
1977
5430
|
}
|
|
1978
|
-
function
|
|
5431
|
+
function FromUnion17(args, type) {
|
|
1979
5432
|
type.anyOf = FromTypes(args, type.anyOf);
|
|
1980
5433
|
return type;
|
|
1981
5434
|
}
|
|
1982
|
-
function
|
|
5435
|
+
function FromTuple14(args, type) {
|
|
1983
5436
|
if (IsUndefined2(type.items))
|
|
1984
5437
|
return type;
|
|
1985
5438
|
type.items = FromTypes(args, type.items);
|
|
1986
5439
|
return type;
|
|
1987
5440
|
}
|
|
1988
|
-
function
|
|
5441
|
+
function FromArray16(args, type) {
|
|
1989
5442
|
type.items = FromType(args, type.items);
|
|
1990
5443
|
return type;
|
|
1991
5444
|
}
|
|
1992
|
-
function
|
|
5445
|
+
function FromAsyncIterator6(args, type) {
|
|
1993
5446
|
type.items = FromType(args, type.items);
|
|
1994
5447
|
return type;
|
|
1995
5448
|
}
|
|
1996
|
-
function
|
|
5449
|
+
function FromIterator6(args, type) {
|
|
1997
5450
|
type.items = FromType(args, type.items);
|
|
1998
5451
|
return type;
|
|
1999
5452
|
}
|
|
2000
|
-
function
|
|
5453
|
+
function FromPromise7(args, type) {
|
|
2001
5454
|
type.item = FromType(args, type.item);
|
|
2002
5455
|
return type;
|
|
2003
5456
|
}
|
|
2004
|
-
function
|
|
5457
|
+
function FromObject13(args, type) {
|
|
2005
5458
|
const mappedProperties = FromProperties11(args, type.properties);
|
|
2006
5459
|
return { ...type, ...Object2(mappedProperties) };
|
|
2007
5460
|
}
|
|
2008
|
-
function
|
|
5461
|
+
function FromRecord12(args, type) {
|
|
2009
5462
|
const mappedKey = FromType(args, RecordKey2(type));
|
|
2010
5463
|
const mappedValue = FromType(args, RecordValue2(type));
|
|
2011
5464
|
const result = Record(mappedKey, mappedValue);
|
|
2012
5465
|
return { ...type, ...result };
|
|
2013
5466
|
}
|
|
2014
|
-
function
|
|
5467
|
+
function FromArgument4(args, argument) {
|
|
2015
5468
|
return argument.index in args ? args[argument.index] : Unknown();
|
|
2016
5469
|
}
|
|
2017
5470
|
function FromProperty2(args, type) {
|
|
@@ -2029,7 +5482,7 @@ function FromTypes(args, types) {
|
|
|
2029
5482
|
return types.map((type) => FromType(args, type));
|
|
2030
5483
|
}
|
|
2031
5484
|
function FromType(args, type) {
|
|
2032
|
-
return IsConstructor(type) ?
|
|
5485
|
+
return IsConstructor(type) ? FromConstructor7(args, type) : IsFunction3(type) ? FromFunction6(args, type) : IsIntersect(type) ? FromIntersect15(args, type) : IsUnion(type) ? FromUnion17(args, type) : IsTuple(type) ? FromTuple14(args, type) : IsArray3(type) ? FromArray16(args, type) : IsAsyncIterator3(type) ? FromAsyncIterator6(args, type) : IsIterator3(type) ? FromIterator6(args, type) : IsPromise2(type) ? FromPromise7(args, type) : IsObject3(type) ? FromObject13(args, type) : IsRecord(type) ? FromRecord12(args, type) : IsArgument(type) ? FromArgument4(args, type) : type;
|
|
2033
5486
|
}
|
|
2034
5487
|
function Instantiate(type, args) {
|
|
2035
5488
|
return FromType(args, CloneType(type));
|
|
@@ -2075,7 +5528,7 @@ function ApplyUppercase(value) {
|
|
|
2075
5528
|
function ApplyLowercase(value) {
|
|
2076
5529
|
return value.toLowerCase();
|
|
2077
5530
|
}
|
|
2078
|
-
function
|
|
5531
|
+
function FromTemplateLiteral6(schema, mode, options) {
|
|
2079
5532
|
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
2080
5533
|
const finite = IsTemplateLiteralExpressionFinite(expression);
|
|
2081
5534
|
if (!finite)
|
|
@@ -2093,7 +5546,7 @@ function FromRest5(T, M) {
|
|
|
2093
5546
|
return T.map((L) => Intrinsic(L, M));
|
|
2094
5547
|
}
|
|
2095
5548
|
function Intrinsic(schema, mode, options = {}) {
|
|
2096
|
-
return IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : IsTemplateLiteral(schema) ?
|
|
5549
|
+
return IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : IsTemplateLiteral(schema) ? FromTemplateLiteral6(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : CreateType(schema, options);
|
|
2097
5550
|
}
|
|
2098
5551
|
|
|
2099
5552
|
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
|
|
@@ -2132,10 +5585,10 @@ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
|
2132
5585
|
}
|
|
2133
5586
|
|
|
2134
5587
|
// node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
2135
|
-
function
|
|
5588
|
+
function FromIntersect16(types, propertyKeys) {
|
|
2136
5589
|
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2137
5590
|
}
|
|
2138
|
-
function
|
|
5591
|
+
function FromUnion18(types, propertyKeys) {
|
|
2139
5592
|
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2140
5593
|
}
|
|
2141
5594
|
function FromProperty3(properties, key) {
|
|
@@ -2145,7 +5598,7 @@ function FromProperty3(properties, key) {
|
|
|
2145
5598
|
function FromProperties13(properties, propertyKeys) {
|
|
2146
5599
|
return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
|
|
2147
5600
|
}
|
|
2148
|
-
function
|
|
5601
|
+
function FromObject14(type, propertyKeys, properties) {
|
|
2149
5602
|
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2150
5603
|
const mappedProperties = FromProperties13(properties, propertyKeys);
|
|
2151
5604
|
return Object2(mappedProperties, options);
|
|
@@ -2155,7 +5608,7 @@ function UnionFromPropertyKeys(propertyKeys) {
|
|
|
2155
5608
|
return Union(result);
|
|
2156
5609
|
}
|
|
2157
5610
|
function OmitResolve(type, propertyKeys) {
|
|
2158
|
-
return IsIntersect(type) ? Intersect(
|
|
5611
|
+
return IsIntersect(type) ? Intersect(FromIntersect16(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion18(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject14(type, propertyKeys, type.properties) : Object2({});
|
|
2159
5612
|
}
|
|
2160
5613
|
function Omit(type, key, options) {
|
|
2161
5614
|
const typeKey = IsArray2(key) ? UnionFromPropertyKeys(key) : key;
|
|
@@ -2198,10 +5651,10 @@ function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
|
2198
5651
|
}
|
|
2199
5652
|
|
|
2200
5653
|
// node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2201
|
-
function
|
|
5654
|
+
function FromIntersect17(types, propertyKeys) {
|
|
2202
5655
|
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2203
5656
|
}
|
|
2204
|
-
function
|
|
5657
|
+
function FromUnion19(types, propertyKeys) {
|
|
2205
5658
|
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2206
5659
|
}
|
|
2207
5660
|
function FromProperties15(properties, propertyKeys) {
|
|
@@ -2211,7 +5664,7 @@ function FromProperties15(properties, propertyKeys) {
|
|
|
2211
5664
|
result[K2] = properties[K2];
|
|
2212
5665
|
return result;
|
|
2213
5666
|
}
|
|
2214
|
-
function
|
|
5667
|
+
function FromObject15(Type, keys, properties) {
|
|
2215
5668
|
const options = Discard(Type, [TransformKind, "$id", "required", "properties"]);
|
|
2216
5669
|
const mappedProperties = FromProperties15(properties, keys);
|
|
2217
5670
|
return Object2(mappedProperties, options);
|
|
@@ -2221,7 +5674,7 @@ function UnionFromPropertyKeys2(propertyKeys) {
|
|
|
2221
5674
|
return Union(result);
|
|
2222
5675
|
}
|
|
2223
5676
|
function PickResolve(type, propertyKeys) {
|
|
2224
|
-
return IsIntersect(type) ? Intersect(
|
|
5677
|
+
return IsIntersect(type) ? Intersect(FromIntersect17(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion19(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject15(type, propertyKeys, type.properties) : Object2({});
|
|
2225
5678
|
}
|
|
2226
5679
|
function Pick(type, key, options) {
|
|
2227
5680
|
const typeKey = IsArray2(key) ? UnionFromPropertyKeys2(key) : key;
|
|
@@ -2254,7 +5707,7 @@ function PickFromMappedKey(type, mappedKey, options) {
|
|
|
2254
5707
|
function FromComputed3(target, parameters) {
|
|
2255
5708
|
return Computed("Partial", [Computed(target, parameters)]);
|
|
2256
5709
|
}
|
|
2257
|
-
function
|
|
5710
|
+
function FromRef13($ref) {
|
|
2258
5711
|
return Computed("Partial", [Ref($ref)]);
|
|
2259
5712
|
}
|
|
2260
5713
|
function FromProperties16(properties) {
|
|
@@ -2263,7 +5716,7 @@ function FromProperties16(properties) {
|
|
|
2263
5716
|
partialProperties[K] = Optional(properties[K]);
|
|
2264
5717
|
return partialProperties;
|
|
2265
5718
|
}
|
|
2266
|
-
function
|
|
5719
|
+
function FromObject16(type, properties) {
|
|
2267
5720
|
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2268
5721
|
const mappedProperties = FromProperties16(properties);
|
|
2269
5722
|
return Object2(mappedProperties, options);
|
|
@@ -2272,7 +5725,7 @@ function FromRest6(types) {
|
|
|
2272
5725
|
return types.map((type) => PartialResolve(type));
|
|
2273
5726
|
}
|
|
2274
5727
|
function PartialResolve(type) {
|
|
2275
|
-
return IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ?
|
|
5728
|
+
return IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef13(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject16(type, type.properties) : IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : Object2({});
|
|
2276
5729
|
}
|
|
2277
5730
|
function Partial(type, options) {
|
|
2278
5731
|
if (IsMappedResult(type)) {
|
|
@@ -2301,7 +5754,7 @@ function PartialFromMappedResult(R, options) {
|
|
|
2301
5754
|
function FromComputed4(target, parameters) {
|
|
2302
5755
|
return Computed("Required", [Computed(target, parameters)]);
|
|
2303
5756
|
}
|
|
2304
|
-
function
|
|
5757
|
+
function FromRef14($ref) {
|
|
2305
5758
|
return Computed("Required", [Ref($ref)]);
|
|
2306
5759
|
}
|
|
2307
5760
|
function FromProperties18(properties) {
|
|
@@ -2310,7 +5763,7 @@ function FromProperties18(properties) {
|
|
|
2310
5763
|
requiredProperties[K] = Discard(properties[K], [OptionalKind]);
|
|
2311
5764
|
return requiredProperties;
|
|
2312
5765
|
}
|
|
2313
|
-
function
|
|
5766
|
+
function FromObject17(type, properties) {
|
|
2314
5767
|
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2315
5768
|
const mappedProperties = FromProperties18(properties);
|
|
2316
5769
|
return Object2(mappedProperties, options);
|
|
@@ -2319,7 +5772,7 @@ function FromRest7(types) {
|
|
|
2319
5772
|
return types.map((type) => RequiredResolve(type));
|
|
2320
5773
|
}
|
|
2321
5774
|
function RequiredResolve(type) {
|
|
2322
|
-
return IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ?
|
|
5775
|
+
return IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef14(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject17(type, type.properties) : IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : Object2({});
|
|
2323
5776
|
}
|
|
2324
5777
|
function Required(type, options) {
|
|
2325
5778
|
if (IsMappedResult(type)) {
|
|
@@ -2378,49 +5831,49 @@ function FromComputed5(moduleProperties, target, parameters) {
|
|
|
2378
5831
|
const dereferenced = DereferenceParameters(moduleProperties, parameters);
|
|
2379
5832
|
return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
|
|
2380
5833
|
}
|
|
2381
|
-
function
|
|
5834
|
+
function FromArray17(moduleProperties, type) {
|
|
2382
5835
|
return Array2(FromType2(moduleProperties, type));
|
|
2383
5836
|
}
|
|
2384
|
-
function
|
|
5837
|
+
function FromAsyncIterator7(moduleProperties, type) {
|
|
2385
5838
|
return AsyncIterator(FromType2(moduleProperties, type));
|
|
2386
5839
|
}
|
|
2387
|
-
function
|
|
5840
|
+
function FromConstructor8(moduleProperties, parameters, instanceType) {
|
|
2388
5841
|
return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
|
|
2389
5842
|
}
|
|
2390
|
-
function
|
|
5843
|
+
function FromFunction7(moduleProperties, parameters, returnType) {
|
|
2391
5844
|
return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
|
|
2392
5845
|
}
|
|
2393
|
-
function
|
|
5846
|
+
function FromIntersect18(moduleProperties, types) {
|
|
2394
5847
|
return Intersect(FromTypes2(moduleProperties, types));
|
|
2395
5848
|
}
|
|
2396
|
-
function
|
|
5849
|
+
function FromIterator7(moduleProperties, type) {
|
|
2397
5850
|
return Iterator(FromType2(moduleProperties, type));
|
|
2398
5851
|
}
|
|
2399
|
-
function
|
|
5852
|
+
function FromObject18(moduleProperties, properties) {
|
|
2400
5853
|
return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
|
|
2401
5854
|
return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
|
|
2402
5855
|
}, {}));
|
|
2403
5856
|
}
|
|
2404
|
-
function
|
|
5857
|
+
function FromRecord13(moduleProperties, type) {
|
|
2405
5858
|
const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
|
|
2406
5859
|
const result = CloneType(type);
|
|
2407
5860
|
result.patternProperties[pattern] = value;
|
|
2408
5861
|
return result;
|
|
2409
5862
|
}
|
|
2410
|
-
function FromTransform(moduleProperties,
|
|
2411
|
-
return IsRef(
|
|
5863
|
+
function FromTransform(moduleProperties, transform2) {
|
|
5864
|
+
return IsRef(transform2) ? { ...Dereference(moduleProperties, transform2.$ref), [TransformKind]: transform2[TransformKind] } : transform2;
|
|
2412
5865
|
}
|
|
2413
|
-
function
|
|
5866
|
+
function FromTuple15(moduleProperties, types) {
|
|
2414
5867
|
return Tuple(FromTypes2(moduleProperties, types));
|
|
2415
5868
|
}
|
|
2416
|
-
function
|
|
5869
|
+
function FromUnion20(moduleProperties, types) {
|
|
2417
5870
|
return Union(FromTypes2(moduleProperties, types));
|
|
2418
5871
|
}
|
|
2419
5872
|
function FromTypes2(moduleProperties, types) {
|
|
2420
5873
|
return types.map((type) => FromType2(moduleProperties, type));
|
|
2421
5874
|
}
|
|
2422
5875
|
function FromType2(moduleProperties, type) {
|
|
2423
|
-
return IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : IsArray3(type) ? CreateType(
|
|
5876
|
+
return IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : IsArray3(type) ? CreateType(FromArray17(moduleProperties, type.items), type) : IsAsyncIterator3(type) ? CreateType(FromAsyncIterator7(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor8(moduleProperties, type.parameters, type.returns), type) : IsFunction3(type) ? CreateType(FromFunction7(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect18(moduleProperties, type.allOf), type) : IsIterator3(type) ? CreateType(FromIterator7(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject18(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord13(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple15(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion20(moduleProperties, type.anyOf), type) : type;
|
|
2424
5877
|
}
|
|
2425
5878
|
function ComputeType(moduleProperties, key) {
|
|
2426
5879
|
return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
|
|
@@ -2453,13 +5906,13 @@ function Module(properties) {
|
|
|
2453
5906
|
}
|
|
2454
5907
|
|
|
2455
5908
|
// node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
2456
|
-
function
|
|
5909
|
+
function Not2(type, options) {
|
|
2457
5910
|
return CreateType({ [Kind]: "Not", not: type }, options);
|
|
2458
5911
|
}
|
|
2459
5912
|
|
|
2460
5913
|
// node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2461
5914
|
function Parameters(schema, options) {
|
|
2462
|
-
return
|
|
5915
|
+
return IsFunction3(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2463
5916
|
}
|
|
2464
5917
|
|
|
2465
5918
|
// node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
@@ -2474,7 +5927,7 @@ function Recursive(callback, options = {}) {
|
|
|
2474
5927
|
|
|
2475
5928
|
// node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2476
5929
|
function RegExp2(unresolved, options) {
|
|
2477
|
-
const expr =
|
|
5930
|
+
const expr = IsString2(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2478
5931
|
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2479
5932
|
}
|
|
2480
5933
|
|
|
@@ -2488,7 +5941,7 @@ function Rest(T) {
|
|
|
2488
5941
|
|
|
2489
5942
|
// node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2490
5943
|
function ReturnType(schema, options) {
|
|
2491
|
-
return
|
|
5944
|
+
return IsFunction3(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2492
5945
|
}
|
|
2493
5946
|
|
|
2494
5947
|
// node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
@@ -2496,28 +5949,28 @@ class TransformDecodeBuilder {
|
|
|
2496
5949
|
constructor(schema) {
|
|
2497
5950
|
this.schema = schema;
|
|
2498
5951
|
}
|
|
2499
|
-
Decode(
|
|
2500
|
-
return new TransformEncodeBuilder(this.schema,
|
|
5952
|
+
Decode(decode2) {
|
|
5953
|
+
return new TransformEncodeBuilder(this.schema, decode2);
|
|
2501
5954
|
}
|
|
2502
5955
|
}
|
|
2503
5956
|
|
|
2504
5957
|
class TransformEncodeBuilder {
|
|
2505
|
-
constructor(schema,
|
|
5958
|
+
constructor(schema, decode2) {
|
|
2506
5959
|
this.schema = schema;
|
|
2507
|
-
this.decode =
|
|
5960
|
+
this.decode = decode2;
|
|
2508
5961
|
}
|
|
2509
|
-
EncodeTransform(
|
|
2510
|
-
const
|
|
2511
|
-
const
|
|
2512
|
-
const Codec = { Encode, Decode };
|
|
5962
|
+
EncodeTransform(encode2, schema) {
|
|
5963
|
+
const Encode2 = (value) => schema[TransformKind].Encode(encode2(value));
|
|
5964
|
+
const Decode2 = (value) => this.decode(schema[TransformKind].Decode(value));
|
|
5965
|
+
const Codec = { Encode: Encode2, Decode: Decode2 };
|
|
2513
5966
|
return { ...schema, [TransformKind]: Codec };
|
|
2514
5967
|
}
|
|
2515
|
-
EncodeSchema(
|
|
2516
|
-
const Codec = { Decode: this.decode, Encode:
|
|
5968
|
+
EncodeSchema(encode2, schema) {
|
|
5969
|
+
const Codec = { Decode: this.decode, Encode: encode2 };
|
|
2517
5970
|
return { ...schema, [TransformKind]: Codec };
|
|
2518
5971
|
}
|
|
2519
|
-
Encode(
|
|
2520
|
-
return IsTransform(this.schema) ? this.EncodeTransform(
|
|
5972
|
+
Encode(encode2) {
|
|
5973
|
+
return IsTransform(this.schema) ? this.EncodeTransform(encode2, this.schema) : this.EncodeSchema(encode2, this.schema);
|
|
2521
5974
|
}
|
|
2522
5975
|
}
|
|
2523
5976
|
function Transform(schema) {
|
|
@@ -2530,14 +5983,14 @@ function Void(options) {
|
|
|
2530
5983
|
}
|
|
2531
5984
|
|
|
2532
5985
|
// node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
|
|
2533
|
-
var
|
|
2534
|
-
__export(
|
|
5986
|
+
var exports_type3 = {};
|
|
5987
|
+
__export(exports_type3, {
|
|
2535
5988
|
Any: () => Any,
|
|
2536
5989
|
Argument: () => Argument,
|
|
2537
5990
|
Array: () => Array2,
|
|
2538
5991
|
AsyncIterator: () => AsyncIterator,
|
|
2539
5992
|
Awaited: () => Awaited,
|
|
2540
|
-
BigInt: () =>
|
|
5993
|
+
BigInt: () => BigInt2,
|
|
2541
5994
|
Boolean: () => Boolean2,
|
|
2542
5995
|
Capitalize: () => Capitalize,
|
|
2543
5996
|
Composite: () => Composite,
|
|
@@ -2562,7 +6015,7 @@ __export(exports_type2, {
|
|
|
2562
6015
|
Mapped: () => Mapped,
|
|
2563
6016
|
Module: () => Module,
|
|
2564
6017
|
Never: () => Never,
|
|
2565
|
-
Not: () =>
|
|
6018
|
+
Not: () => Not2,
|
|
2566
6019
|
Null: () => Null,
|
|
2567
6020
|
Number: () => Number2,
|
|
2568
6021
|
Object: () => Object2,
|
|
@@ -2597,7 +6050,7 @@ __export(exports_type2, {
|
|
|
2597
6050
|
});
|
|
2598
6051
|
|
|
2599
6052
|
// node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2600
|
-
var Type =
|
|
6053
|
+
var Type = exports_type3;
|
|
2601
6054
|
|
|
2602
6055
|
// node_modules/@absolutejs/manifest/dist/index.js
|
|
2603
6056
|
var defineImplementation = () => (implementation) => {
|
|
@@ -3338,5 +6791,5 @@ export {
|
|
|
3338
6791
|
manifest
|
|
3339
6792
|
};
|
|
3340
6793
|
|
|
3341
|
-
//# debugId=
|
|
6794
|
+
//# debugId=230C8A3881C10D9064756E2164756E21
|
|
3342
6795
|
//# sourceMappingURL=manifest.js.map
|