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