@elysiajs/jwt 1.1.0 → 1.2.0-rc.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/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +756 -636
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +753 -633
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
15
15
|
var value_exports = {};
|
|
16
16
|
__export(value_exports, {
|
|
17
|
+
HasPropertyKey: () => HasPropertyKey,
|
|
17
18
|
IsArray: () => IsArray,
|
|
18
19
|
IsAsyncIterator: () => IsAsyncIterator,
|
|
19
20
|
IsBigInt: () => IsBigInt,
|
|
@@ -30,6 +31,9 @@ __export(value_exports, {
|
|
|
30
31
|
IsUint8Array: () => IsUint8Array,
|
|
31
32
|
IsUndefined: () => IsUndefined
|
|
32
33
|
});
|
|
34
|
+
function HasPropertyKey(value, key) {
|
|
35
|
+
return key in value;
|
|
36
|
+
}
|
|
33
37
|
function IsAsyncIterator(value) {
|
|
34
38
|
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
|
|
35
39
|
}
|
|
@@ -107,11 +111,94 @@ function Clone(value) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
// node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
110
|
-
function
|
|
111
|
-
return
|
|
114
|
+
function CloneType(schema, options) {
|
|
115
|
+
return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
119
|
+
function IsObject2(value) {
|
|
120
|
+
return value !== null && typeof value === "object";
|
|
121
|
+
}
|
|
122
|
+
function IsArray2(value) {
|
|
123
|
+
return Array.isArray(value) && !ArrayBuffer.isView(value);
|
|
124
|
+
}
|
|
125
|
+
function IsUndefined2(value) {
|
|
126
|
+
return value === void 0;
|
|
127
|
+
}
|
|
128
|
+
function IsNumber2(value) {
|
|
129
|
+
return typeof value === "number";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
133
|
+
var TypeSystemPolicy;
|
|
134
|
+
(function(TypeSystemPolicy2) {
|
|
135
|
+
TypeSystemPolicy2.InstanceMode = "default";
|
|
136
|
+
TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
|
|
137
|
+
TypeSystemPolicy2.AllowArrayObject = false;
|
|
138
|
+
TypeSystemPolicy2.AllowNaN = false;
|
|
139
|
+
TypeSystemPolicy2.AllowNullVoid = false;
|
|
140
|
+
function IsExactOptionalProperty(value, key) {
|
|
141
|
+
return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
|
|
142
|
+
}
|
|
143
|
+
TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
|
|
144
|
+
function IsObjectLike(value) {
|
|
145
|
+
const isObject = IsObject2(value);
|
|
146
|
+
return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
|
|
147
|
+
}
|
|
148
|
+
TypeSystemPolicy2.IsObjectLike = IsObjectLike;
|
|
149
|
+
function IsRecordLike(value) {
|
|
150
|
+
return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
|
|
151
|
+
}
|
|
152
|
+
TypeSystemPolicy2.IsRecordLike = IsRecordLike;
|
|
153
|
+
function IsNumberLike(value) {
|
|
154
|
+
return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
|
|
155
|
+
}
|
|
156
|
+
TypeSystemPolicy2.IsNumberLike = IsNumberLike;
|
|
157
|
+
function IsVoidLike(value) {
|
|
158
|
+
const isUndefined = IsUndefined2(value);
|
|
159
|
+
return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
|
|
160
|
+
}
|
|
161
|
+
TypeSystemPolicy2.IsVoidLike = IsVoidLike;
|
|
162
|
+
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
163
|
+
|
|
164
|
+
// node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
|
|
165
|
+
function ImmutableArray(value) {
|
|
166
|
+
return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
|
|
167
|
+
}
|
|
168
|
+
function ImmutableDate(value) {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
function ImmutableUint8Array(value) {
|
|
172
|
+
return value;
|
|
112
173
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
174
|
+
function ImmutableRegExp(value) {
|
|
175
|
+
return value;
|
|
176
|
+
}
|
|
177
|
+
function ImmutableObject(value) {
|
|
178
|
+
const result = {};
|
|
179
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
180
|
+
result[key] = Immutable(value[key]);
|
|
181
|
+
}
|
|
182
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
183
|
+
result[key] = Immutable(value[key]);
|
|
184
|
+
}
|
|
185
|
+
return globalThis.Object.freeze(result);
|
|
186
|
+
}
|
|
187
|
+
function Immutable(value) {
|
|
188
|
+
return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
|
|
192
|
+
function CreateType(schema, options) {
|
|
193
|
+
const result = options !== void 0 ? { ...options, ...schema } : schema;
|
|
194
|
+
switch (TypeSystemPolicy.InstanceMode) {
|
|
195
|
+
case "freeze":
|
|
196
|
+
return Immutable(result);
|
|
197
|
+
case "clone":
|
|
198
|
+
return Clone(result);
|
|
199
|
+
default:
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
115
202
|
}
|
|
116
203
|
|
|
117
204
|
// node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
|
|
@@ -138,7 +225,7 @@ function IsOptional(value) {
|
|
|
138
225
|
function IsAny(value) {
|
|
139
226
|
return IsKindOf(value, "Any");
|
|
140
227
|
}
|
|
141
|
-
function
|
|
228
|
+
function IsArray3(value) {
|
|
142
229
|
return IsKindOf(value, "Array");
|
|
143
230
|
}
|
|
144
231
|
function IsAsyncIterator2(value) {
|
|
@@ -150,6 +237,9 @@ function IsBigInt2(value) {
|
|
|
150
237
|
function IsBoolean2(value) {
|
|
151
238
|
return IsKindOf(value, "Boolean");
|
|
152
239
|
}
|
|
240
|
+
function IsComputed(value) {
|
|
241
|
+
return IsKindOf(value, "Computed");
|
|
242
|
+
}
|
|
153
243
|
function IsConstructor(value) {
|
|
154
244
|
return IsKindOf(value, "Constructor");
|
|
155
245
|
}
|
|
@@ -171,6 +261,9 @@ function IsIterator2(value) {
|
|
|
171
261
|
function IsKindOf(value, kind) {
|
|
172
262
|
return IsObject(value) && Kind in value && value[Kind] === kind;
|
|
173
263
|
}
|
|
264
|
+
function IsLiteralValue(value) {
|
|
265
|
+
return IsBoolean(value) || IsNumber(value) || IsString(value);
|
|
266
|
+
}
|
|
174
267
|
function IsLiteral(value) {
|
|
175
268
|
return IsKindOf(value, "Literal");
|
|
176
269
|
}
|
|
@@ -189,10 +282,10 @@ function IsNot(value) {
|
|
|
189
282
|
function IsNull2(value) {
|
|
190
283
|
return IsKindOf(value, "Null");
|
|
191
284
|
}
|
|
192
|
-
function
|
|
285
|
+
function IsNumber3(value) {
|
|
193
286
|
return IsKindOf(value, "Number");
|
|
194
287
|
}
|
|
195
|
-
function
|
|
288
|
+
function IsObject3(value) {
|
|
196
289
|
return IsKindOf(value, "Object");
|
|
197
290
|
}
|
|
198
291
|
function IsPromise(value) {
|
|
@@ -225,7 +318,7 @@ function IsTransform(value) {
|
|
|
225
318
|
function IsTuple(value) {
|
|
226
319
|
return IsKindOf(value, "Tuple");
|
|
227
320
|
}
|
|
228
|
-
function
|
|
321
|
+
function IsUndefined3(value) {
|
|
229
322
|
return IsKindOf(value, "Undefined");
|
|
230
323
|
}
|
|
231
324
|
function IsUnion(value) {
|
|
@@ -247,20 +340,22 @@ function IsKind(value) {
|
|
|
247
340
|
return IsObject(value) && Kind in value && IsString(value[Kind]);
|
|
248
341
|
}
|
|
249
342
|
function IsSchema(value) {
|
|
250
|
-
return IsAny(value) ||
|
|
343
|
+
return IsAny(value) || IsArray3(value) || IsBoolean2(value) || IsBigInt2(value) || IsAsyncIterator2(value) || IsComputed(value) || IsConstructor(value) || IsDate2(value) || IsFunction2(value) || IsInteger(value) || IsIntersect(value) || IsIterator2(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull2(value) || IsNumber3(value) || IsObject3(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString2(value) || IsSymbol2(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array2(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
|
|
251
344
|
}
|
|
252
345
|
|
|
253
346
|
// node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
254
347
|
var type_exports = {};
|
|
255
348
|
__export(type_exports, {
|
|
256
349
|
IsAny: () => IsAny2,
|
|
257
|
-
IsArray: () =>
|
|
350
|
+
IsArray: () => IsArray4,
|
|
258
351
|
IsAsyncIterator: () => IsAsyncIterator3,
|
|
259
352
|
IsBigInt: () => IsBigInt3,
|
|
260
353
|
IsBoolean: () => IsBoolean3,
|
|
354
|
+
IsComputed: () => IsComputed2,
|
|
261
355
|
IsConstructor: () => IsConstructor2,
|
|
262
356
|
IsDate: () => IsDate3,
|
|
263
357
|
IsFunction: () => IsFunction3,
|
|
358
|
+
IsImport: () => IsImport,
|
|
264
359
|
IsInteger: () => IsInteger2,
|
|
265
360
|
IsIntersect: () => IsIntersect2,
|
|
266
361
|
IsIterator: () => IsIterator3,
|
|
@@ -270,14 +365,14 @@ __export(type_exports, {
|
|
|
270
365
|
IsLiteralBoolean: () => IsLiteralBoolean,
|
|
271
366
|
IsLiteralNumber: () => IsLiteralNumber,
|
|
272
367
|
IsLiteralString: () => IsLiteralString,
|
|
273
|
-
IsLiteralValue: () =>
|
|
368
|
+
IsLiteralValue: () => IsLiteralValue2,
|
|
274
369
|
IsMappedKey: () => IsMappedKey2,
|
|
275
370
|
IsMappedResult: () => IsMappedResult2,
|
|
276
371
|
IsNever: () => IsNever2,
|
|
277
372
|
IsNot: () => IsNot2,
|
|
278
373
|
IsNull: () => IsNull3,
|
|
279
|
-
IsNumber: () =>
|
|
280
|
-
IsObject: () =>
|
|
374
|
+
IsNumber: () => IsNumber4,
|
|
375
|
+
IsObject: () => IsObject4,
|
|
281
376
|
IsOptional: () => IsOptional2,
|
|
282
377
|
IsPromise: () => IsPromise2,
|
|
283
378
|
IsProperties: () => IsProperties,
|
|
@@ -294,7 +389,7 @@ __export(type_exports, {
|
|
|
294
389
|
IsTransform: () => IsTransform2,
|
|
295
390
|
IsTuple: () => IsTuple2,
|
|
296
391
|
IsUint8Array: () => IsUint8Array3,
|
|
297
|
-
IsUndefined: () =>
|
|
392
|
+
IsUndefined: () => IsUndefined4,
|
|
298
393
|
IsUnion: () => IsUnion2,
|
|
299
394
|
IsUnionLiteral: () => IsUnionLiteral,
|
|
300
395
|
IsUnknown: () => IsUnknown2,
|
|
@@ -310,6 +405,7 @@ var KnownTypes = [
|
|
|
310
405
|
"AsyncIterator",
|
|
311
406
|
"BigInt",
|
|
312
407
|
"Boolean",
|
|
408
|
+
"Computed",
|
|
313
409
|
"Constructor",
|
|
314
410
|
"Date",
|
|
315
411
|
"Enum",
|
|
@@ -391,7 +487,7 @@ function IsOptional2(value) {
|
|
|
391
487
|
function IsAny2(value) {
|
|
392
488
|
return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
|
|
393
489
|
}
|
|
394
|
-
function
|
|
490
|
+
function IsArray4(value) {
|
|
395
491
|
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);
|
|
396
492
|
}
|
|
397
493
|
function IsAsyncIterator3(value) {
|
|
@@ -403,6 +499,9 @@ function IsBigInt3(value) {
|
|
|
403
499
|
function IsBoolean3(value) {
|
|
404
500
|
return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
|
|
405
501
|
}
|
|
502
|
+
function IsComputed2(value) {
|
|
503
|
+
return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
|
|
504
|
+
}
|
|
406
505
|
function IsConstructor2(value) {
|
|
407
506
|
return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
408
507
|
}
|
|
@@ -412,6 +511,9 @@ function IsDate3(value) {
|
|
|
412
511
|
function IsFunction3(value) {
|
|
413
512
|
return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
414
513
|
}
|
|
514
|
+
function IsImport(value) {
|
|
515
|
+
return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
|
|
516
|
+
}
|
|
415
517
|
function IsInteger2(value) {
|
|
416
518
|
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);
|
|
417
519
|
}
|
|
@@ -437,9 +539,9 @@ function IsLiteralBoolean(value) {
|
|
|
437
539
|
return IsLiteral2(value) && IsBoolean(value.const);
|
|
438
540
|
}
|
|
439
541
|
function IsLiteral2(value) {
|
|
440
|
-
return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) &&
|
|
542
|
+
return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
|
|
441
543
|
}
|
|
442
|
-
function
|
|
544
|
+
function IsLiteralValue2(value) {
|
|
443
545
|
return IsBoolean(value) || IsNumber(value) || IsString(value);
|
|
444
546
|
}
|
|
445
547
|
function IsMappedKey2(value) {
|
|
@@ -457,10 +559,10 @@ function IsNot2(value) {
|
|
|
457
559
|
function IsNull3(value) {
|
|
458
560
|
return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
|
|
459
561
|
}
|
|
460
|
-
function
|
|
562
|
+
function IsNumber4(value) {
|
|
461
563
|
return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
|
|
462
564
|
}
|
|
463
|
-
function
|
|
565
|
+
function IsObject4(value) {
|
|
464
566
|
return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
|
|
465
567
|
}
|
|
466
568
|
function IsPromise2(value) {
|
|
@@ -500,7 +602,7 @@ function IsTuple2(value) {
|
|
|
500
602
|
return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
|
|
501
603
|
(IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
|
|
502
604
|
}
|
|
503
|
-
function
|
|
605
|
+
function IsUndefined4(value) {
|
|
504
606
|
return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
|
|
505
607
|
}
|
|
506
608
|
function IsUnionLiteral(value) {
|
|
@@ -525,16 +627,18 @@ function IsKind2(value) {
|
|
|
525
627
|
return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
|
|
526
628
|
}
|
|
527
629
|
function IsSchema2(value) {
|
|
528
|
-
return IsObject(value) && (IsAny2(value) ||
|
|
630
|
+
return IsObject(value) && (IsAny2(value) || IsArray4(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed2(value) || IsConstructor2(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect2(value) || IsIterator3(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull3(value) || IsNumber4(value) || IsObject4(value) || IsPromise2(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array3(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
|
|
529
631
|
}
|
|
530
632
|
|
|
531
633
|
// node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
|
|
532
634
|
var PatternBoolean = "(true|false)";
|
|
533
635
|
var PatternNumber = "(0|[1-9][0-9]*)";
|
|
534
636
|
var PatternString = "(.*)";
|
|
637
|
+
var PatternNever = "(?!.*)";
|
|
535
638
|
var PatternBooleanExact = `^${PatternBoolean}$`;
|
|
536
639
|
var PatternNumberExact = `^${PatternNumber}$`;
|
|
537
640
|
var PatternStringExact = `^${PatternString}$`;
|
|
641
|
+
var PatternNeverExact = `^${PatternNever}$`;
|
|
538
642
|
|
|
539
643
|
// node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
|
|
540
644
|
function SetIncludes(T, S) {
|
|
@@ -562,28 +666,23 @@ function SetUnionMany(T) {
|
|
|
562
666
|
}
|
|
563
667
|
|
|
564
668
|
// node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
565
|
-
function Any(options
|
|
566
|
-
return {
|
|
669
|
+
function Any(options) {
|
|
670
|
+
return CreateType({ [Kind]: "Any" }, options);
|
|
567
671
|
}
|
|
568
672
|
|
|
569
673
|
// node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
|
|
570
|
-
function Array2(
|
|
571
|
-
return {
|
|
572
|
-
...options,
|
|
573
|
-
[Kind]: "Array",
|
|
574
|
-
type: "array",
|
|
575
|
-
items: CloneType(schema)
|
|
576
|
-
};
|
|
674
|
+
function Array2(items, options) {
|
|
675
|
+
return CreateType({ [Kind]: "Array", type: "array", items }, options);
|
|
577
676
|
}
|
|
578
677
|
|
|
579
678
|
// node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
|
|
580
|
-
function AsyncIterator(items, options
|
|
581
|
-
return {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
};
|
|
679
|
+
function AsyncIterator(items, options) {
|
|
680
|
+
return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
|
|
684
|
+
function Computed(target, parameters, options) {
|
|
685
|
+
return CreateType({ [Kind]: "Computed", target, parameters }, options);
|
|
587
686
|
}
|
|
588
687
|
|
|
589
688
|
// node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
|
|
@@ -596,69 +695,54 @@ function Discard(value, keys) {
|
|
|
596
695
|
}
|
|
597
696
|
|
|
598
697
|
// node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
|
|
599
|
-
function Never(options
|
|
600
|
-
return {
|
|
601
|
-
...options,
|
|
602
|
-
[Kind]: "Never",
|
|
603
|
-
not: {}
|
|
604
|
-
};
|
|
698
|
+
function Never(options) {
|
|
699
|
+
return CreateType({ [Kind]: "Never", not: {} }, options);
|
|
605
700
|
}
|
|
606
701
|
|
|
607
702
|
// node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
|
|
608
703
|
function MappedResult(properties) {
|
|
609
|
-
return {
|
|
704
|
+
return CreateType({
|
|
610
705
|
[Kind]: "MappedResult",
|
|
611
706
|
properties
|
|
612
|
-
};
|
|
707
|
+
});
|
|
613
708
|
}
|
|
614
709
|
|
|
615
710
|
// node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
|
|
616
711
|
function Constructor(parameters, returns, options) {
|
|
617
|
-
return {
|
|
618
|
-
...options,
|
|
619
|
-
[Kind]: "Constructor",
|
|
620
|
-
type: "Constructor",
|
|
621
|
-
parameters: CloneRest(parameters),
|
|
622
|
-
returns: CloneType(returns)
|
|
623
|
-
};
|
|
712
|
+
return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
|
|
624
713
|
}
|
|
625
714
|
|
|
626
715
|
// node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
|
|
627
716
|
function Function(parameters, returns, options) {
|
|
628
|
-
return {
|
|
629
|
-
...options,
|
|
630
|
-
[Kind]: "Function",
|
|
631
|
-
type: "Function",
|
|
632
|
-
parameters: CloneRest(parameters),
|
|
633
|
-
returns: CloneType(returns)
|
|
634
|
-
};
|
|
717
|
+
return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
|
|
635
718
|
}
|
|
636
719
|
|
|
637
720
|
// node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
|
|
638
721
|
function UnionCreate(T, options) {
|
|
639
|
-
return {
|
|
722
|
+
return CreateType({ [Kind]: "Union", anyOf: T }, options);
|
|
640
723
|
}
|
|
641
724
|
|
|
642
725
|
// node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
|
|
643
|
-
function IsUnionOptional(
|
|
644
|
-
return
|
|
726
|
+
function IsUnionOptional(types) {
|
|
727
|
+
return types.some((type) => IsOptional(type));
|
|
645
728
|
}
|
|
646
|
-
function RemoveOptionalFromRest(
|
|
647
|
-
return
|
|
729
|
+
function RemoveOptionalFromRest(types) {
|
|
730
|
+
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
|
|
648
731
|
}
|
|
649
732
|
function RemoveOptionalFromType(T) {
|
|
650
733
|
return Discard(T, [OptionalKind]);
|
|
651
734
|
}
|
|
652
|
-
function ResolveUnion(
|
|
653
|
-
|
|
735
|
+
function ResolveUnion(types, options) {
|
|
736
|
+
const isOptional = IsUnionOptional(types);
|
|
737
|
+
return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
|
|
654
738
|
}
|
|
655
|
-
function UnionEvaluated(T, options
|
|
656
|
-
return T.length ===
|
|
739
|
+
function UnionEvaluated(T, options) {
|
|
740
|
+
return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
|
|
657
741
|
}
|
|
658
742
|
|
|
659
743
|
// node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
|
|
660
|
-
function Union(
|
|
661
|
-
return
|
|
744
|
+
function Union(types, options) {
|
|
745
|
+
return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
|
|
662
746
|
}
|
|
663
747
|
|
|
664
748
|
// node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
|
|
@@ -840,51 +924,38 @@ function TemplateLiteralGenerate(schema) {
|
|
|
840
924
|
}
|
|
841
925
|
|
|
842
926
|
// node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
|
|
843
|
-
function Literal(value, options
|
|
844
|
-
return {
|
|
845
|
-
...options,
|
|
927
|
+
function Literal(value, options) {
|
|
928
|
+
return CreateType({
|
|
846
929
|
[Kind]: "Literal",
|
|
847
930
|
const: value,
|
|
848
931
|
type: typeof value
|
|
849
|
-
};
|
|
932
|
+
}, options);
|
|
850
933
|
}
|
|
851
934
|
|
|
852
935
|
// node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
853
|
-
function Boolean(options
|
|
854
|
-
return {
|
|
855
|
-
...options,
|
|
856
|
-
[Kind]: "Boolean",
|
|
857
|
-
type: "boolean"
|
|
858
|
-
};
|
|
936
|
+
function Boolean(options) {
|
|
937
|
+
return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
|
|
859
938
|
}
|
|
860
939
|
|
|
861
940
|
// node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
862
|
-
function BigInt(options
|
|
863
|
-
return {
|
|
864
|
-
...options,
|
|
865
|
-
[Kind]: "BigInt",
|
|
866
|
-
type: "bigint"
|
|
867
|
-
};
|
|
941
|
+
function BigInt(options) {
|
|
942
|
+
return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
|
|
868
943
|
}
|
|
869
944
|
|
|
870
945
|
// node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
|
|
871
|
-
function
|
|
872
|
-
return {
|
|
873
|
-
...options,
|
|
874
|
-
[Kind]: "Number",
|
|
875
|
-
type: "number"
|
|
876
|
-
};
|
|
946
|
+
function Number2(options) {
|
|
947
|
+
return CreateType({ [Kind]: "Number", type: "number" }, options);
|
|
877
948
|
}
|
|
878
949
|
|
|
879
950
|
// node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
|
|
880
|
-
function String(options
|
|
881
|
-
return {
|
|
951
|
+
function String(options) {
|
|
952
|
+
return CreateType({ [Kind]: "String", type: "string" }, options);
|
|
882
953
|
}
|
|
883
954
|
|
|
884
955
|
// node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
885
956
|
function* FromUnion(syntax) {
|
|
886
957
|
const trim = syntax.trim().replace(/"|'/g, "");
|
|
887
|
-
return trim === "boolean" ? yield Boolean() : trim === "number" ? yield
|
|
958
|
+
return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
|
|
888
959
|
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
889
960
|
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
890
961
|
})();
|
|
@@ -925,7 +996,7 @@ function Escape(value) {
|
|
|
925
996
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
926
997
|
}
|
|
927
998
|
function Visit2(schema, acc) {
|
|
928
|
-
return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` :
|
|
999
|
+
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}` : IsInteger(schema) ? `${acc}${PatternNumber}` : IsBigInt2(schema) ? `${acc}${PatternNumber}` : IsString2(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean2(schema) ? `${acc}${PatternBoolean}` : (() => {
|
|
929
1000
|
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
930
1001
|
})();
|
|
931
1002
|
}
|
|
@@ -941,139 +1012,142 @@ function TemplateLiteralToUnion(schema) {
|
|
|
941
1012
|
}
|
|
942
1013
|
|
|
943
1014
|
// node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
944
|
-
function TemplateLiteral(unresolved, options
|
|
1015
|
+
function TemplateLiteral(unresolved, options) {
|
|
945
1016
|
const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
946
|
-
return {
|
|
1017
|
+
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
947
1018
|
}
|
|
948
1019
|
|
|
949
1020
|
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
|
|
950
|
-
function FromTemplateLiteral(
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
}
|
|
954
|
-
function FromUnion2(
|
|
955
|
-
const
|
|
956
|
-
for (const
|
|
957
|
-
|
|
958
|
-
return
|
|
1021
|
+
function FromTemplateLiteral(templateLiteral) {
|
|
1022
|
+
const keys = TemplateLiteralGenerate(templateLiteral);
|
|
1023
|
+
return keys.map((key) => key.toString());
|
|
1024
|
+
}
|
|
1025
|
+
function FromUnion2(types) {
|
|
1026
|
+
const result = [];
|
|
1027
|
+
for (const type of types)
|
|
1028
|
+
result.push(...IndexPropertyKeys(type));
|
|
1029
|
+
return result;
|
|
959
1030
|
}
|
|
960
|
-
function FromLiteral(
|
|
961
|
-
return [
|
|
1031
|
+
function FromLiteral(literalValue) {
|
|
1032
|
+
return [literalValue.toString()];
|
|
962
1033
|
}
|
|
963
|
-
function IndexPropertyKeys(
|
|
964
|
-
return [...new Set(IsTemplateLiteral(
|
|
1034
|
+
function IndexPropertyKeys(type) {
|
|
1035
|
+
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
|
|
965
1036
|
}
|
|
966
1037
|
|
|
967
1038
|
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
968
|
-
function FromProperties(
|
|
969
|
-
const
|
|
970
|
-
for (const K2 of Object.getOwnPropertyNames(
|
|
971
|
-
|
|
1039
|
+
function FromProperties(type, properties, options) {
|
|
1040
|
+
const result = {};
|
|
1041
|
+
for (const K2 of Object.getOwnPropertyNames(properties)) {
|
|
1042
|
+
result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
|
|
972
1043
|
}
|
|
973
|
-
return
|
|
1044
|
+
return result;
|
|
974
1045
|
}
|
|
975
|
-
function FromMappedResult(
|
|
976
|
-
return FromProperties(
|
|
1046
|
+
function FromMappedResult(type, mappedResult, options) {
|
|
1047
|
+
return FromProperties(type, mappedResult.properties, options);
|
|
977
1048
|
}
|
|
978
|
-
function IndexFromMappedResult(
|
|
979
|
-
const
|
|
980
|
-
return MappedResult(
|
|
1049
|
+
function IndexFromMappedResult(type, mappedResult, options) {
|
|
1050
|
+
const properties = FromMappedResult(type, mappedResult, options);
|
|
1051
|
+
return MappedResult(properties);
|
|
981
1052
|
}
|
|
982
1053
|
|
|
983
1054
|
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
|
|
984
|
-
function FromRest(
|
|
985
|
-
return
|
|
1055
|
+
function FromRest(types, key) {
|
|
1056
|
+
return types.map((type) => IndexFromPropertyKey(type, key));
|
|
986
1057
|
}
|
|
987
|
-
function FromIntersectRest(
|
|
988
|
-
return
|
|
1058
|
+
function FromIntersectRest(types) {
|
|
1059
|
+
return types.filter((type) => !IsNever(type));
|
|
989
1060
|
}
|
|
990
|
-
function FromIntersect(
|
|
991
|
-
return IntersectEvaluated(FromIntersectRest(FromRest(
|
|
1061
|
+
function FromIntersect(types, key) {
|
|
1062
|
+
return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
|
|
992
1063
|
}
|
|
993
|
-
function FromUnionRest(
|
|
994
|
-
return
|
|
1064
|
+
function FromUnionRest(types) {
|
|
1065
|
+
return types.some((L) => IsNever(L)) ? [] : types;
|
|
995
1066
|
}
|
|
996
|
-
function FromUnion3(
|
|
997
|
-
return UnionEvaluated(FromUnionRest(FromRest(
|
|
1067
|
+
function FromUnion3(types, key) {
|
|
1068
|
+
return UnionEvaluated(FromUnionRest(FromRest(types, key)));
|
|
998
1069
|
}
|
|
999
|
-
function FromTuple(
|
|
1000
|
-
return
|
|
1070
|
+
function FromTuple(types, key) {
|
|
1071
|
+
return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
|
|
1001
1072
|
}
|
|
1002
|
-
function FromArray(
|
|
1003
|
-
return
|
|
1073
|
+
function FromArray(type, key) {
|
|
1074
|
+
return key === "[number]" ? type : Never();
|
|
1004
1075
|
}
|
|
1005
|
-
function FromProperty(
|
|
1006
|
-
return
|
|
1076
|
+
function FromProperty(properties, propertyKey) {
|
|
1077
|
+
return propertyKey in properties ? properties[propertyKey] : Never();
|
|
1007
1078
|
}
|
|
1008
|
-
function IndexFromPropertyKey(
|
|
1009
|
-
return IsIntersect(
|
|
1079
|
+
function IndexFromPropertyKey(type, propertyKey) {
|
|
1080
|
+
return IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : IsUnion(type) ? FromUnion3(type.anyOf, propertyKey) : IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : IsArray3(type) ? FromArray(type.items, propertyKey) : IsObject3(type) ? FromProperty(type.properties, propertyKey) : Never();
|
|
1010
1081
|
}
|
|
1011
|
-
function IndexFromPropertyKeys(
|
|
1012
|
-
return
|
|
1082
|
+
function IndexFromPropertyKeys(type, propertyKeys) {
|
|
1083
|
+
return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
|
|
1013
1084
|
}
|
|
1014
|
-
function FromSchema(
|
|
1015
|
-
return UnionEvaluated(IndexFromPropertyKeys(
|
|
1085
|
+
function FromSchema(type, propertyKeys) {
|
|
1086
|
+
return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
|
|
1016
1087
|
}
|
|
1017
|
-
function Index(
|
|
1018
|
-
|
|
1088
|
+
function Index(type, key, options) {
|
|
1089
|
+
if (IsRef(type) || IsRef(key)) {
|
|
1090
|
+
const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
|
|
1091
|
+
if (!IsSchema(type) || !IsSchema(key))
|
|
1092
|
+
throw new TypeBoxError(error);
|
|
1093
|
+
return Computed("Index", [type, key]);
|
|
1094
|
+
}
|
|
1095
|
+
if (IsMappedResult(key))
|
|
1096
|
+
return IndexFromMappedResult(type, key, options);
|
|
1097
|
+
if (IsMappedKey(key))
|
|
1098
|
+
return IndexFromMappedKey(type, key, options);
|
|
1099
|
+
return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
1019
1100
|
}
|
|
1020
1101
|
|
|
1021
1102
|
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
|
|
1022
|
-
function MappedIndexPropertyKey(
|
|
1023
|
-
return { [
|
|
1103
|
+
function MappedIndexPropertyKey(type, key, options) {
|
|
1104
|
+
return { [key]: Index(type, [key], Clone(options)) };
|
|
1024
1105
|
}
|
|
1025
|
-
function MappedIndexPropertyKeys(
|
|
1026
|
-
return
|
|
1027
|
-
return { ...
|
|
1106
|
+
function MappedIndexPropertyKeys(type, propertyKeys, options) {
|
|
1107
|
+
return propertyKeys.reduce((result, left) => {
|
|
1108
|
+
return { ...result, ...MappedIndexPropertyKey(type, left, options) };
|
|
1028
1109
|
}, {});
|
|
1029
1110
|
}
|
|
1030
|
-
function MappedIndexProperties(
|
|
1031
|
-
return MappedIndexPropertyKeys(
|
|
1111
|
+
function MappedIndexProperties(type, mappedKey, options) {
|
|
1112
|
+
return MappedIndexPropertyKeys(type, mappedKey.keys, options);
|
|
1032
1113
|
}
|
|
1033
|
-
function IndexFromMappedKey(
|
|
1034
|
-
const
|
|
1035
|
-
return MappedResult(
|
|
1114
|
+
function IndexFromMappedKey(type, mappedKey, options) {
|
|
1115
|
+
const properties = MappedIndexProperties(type, mappedKey, options);
|
|
1116
|
+
return MappedResult(properties);
|
|
1036
1117
|
}
|
|
1037
1118
|
|
|
1038
1119
|
// node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
|
|
1039
|
-
function Iterator(items, options
|
|
1040
|
-
return {
|
|
1041
|
-
...options,
|
|
1042
|
-
[Kind]: "Iterator",
|
|
1043
|
-
type: "Iterator",
|
|
1044
|
-
items: CloneType(items)
|
|
1045
|
-
};
|
|
1120
|
+
function Iterator(items, options) {
|
|
1121
|
+
return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
|
|
1046
1122
|
}
|
|
1047
1123
|
|
|
1048
1124
|
// node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
|
|
1049
|
-
function
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1125
|
+
function RequiredKeys(properties) {
|
|
1126
|
+
const keys = [];
|
|
1127
|
+
for (let key in properties) {
|
|
1128
|
+
if (!IsOptional(properties[key]))
|
|
1129
|
+
keys.push(key);
|
|
1130
|
+
}
|
|
1131
|
+
return keys;
|
|
1132
|
+
}
|
|
1133
|
+
function _Object(properties, options) {
|
|
1134
|
+
const required = RequiredKeys(properties);
|
|
1135
|
+
const schematic = required.length > 0 ? { [Kind]: "Object", type: "object", properties, required } : { [Kind]: "Object", type: "object", properties };
|
|
1136
|
+
return CreateType(schematic, options);
|
|
1058
1137
|
}
|
|
1059
1138
|
var Object2 = _Object;
|
|
1060
1139
|
|
|
1061
1140
|
// node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
|
|
1062
|
-
function Promise2(item, options
|
|
1063
|
-
return {
|
|
1064
|
-
...options,
|
|
1065
|
-
[Kind]: "Promise",
|
|
1066
|
-
type: "Promise",
|
|
1067
|
-
item: CloneType(item)
|
|
1068
|
-
};
|
|
1141
|
+
function Promise2(item, options) {
|
|
1142
|
+
return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
|
|
1069
1143
|
}
|
|
1070
1144
|
|
|
1071
1145
|
// node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
|
|
1072
1146
|
function RemoveReadonly(schema) {
|
|
1073
|
-
return Discard(
|
|
1147
|
+
return CreateType(Discard(schema, [ReadonlyKind]));
|
|
1074
1148
|
}
|
|
1075
1149
|
function AddReadonly(schema) {
|
|
1076
|
-
return { ...
|
|
1150
|
+
return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
|
|
1077
1151
|
}
|
|
1078
1152
|
function ReadonlyWithFlag(schema, F) {
|
|
1079
1153
|
return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
|
|
@@ -1099,9 +1173,8 @@ function ReadonlyFromMappedResult(R, F) {
|
|
|
1099
1173
|
}
|
|
1100
1174
|
|
|
1101
1175
|
// node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
|
|
1102
|
-
function Tuple(
|
|
1103
|
-
|
|
1104
|
-
return items.length > 0 ? { ...options, [Kind]: "Tuple", type: "array", items: CloneRest(items), additionalItems, minItems, maxItems } : { ...options, [Kind]: "Tuple", type: "array", minItems, maxItems };
|
|
1176
|
+
function Tuple(types, options) {
|
|
1177
|
+
return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
|
|
1105
1178
|
}
|
|
1106
1179
|
|
|
1107
1180
|
// node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
|
|
@@ -1134,13 +1207,14 @@ function FromProperties3(K, T) {
|
|
|
1134
1207
|
return Acc;
|
|
1135
1208
|
}
|
|
1136
1209
|
function FromSchemaType(K, T) {
|
|
1210
|
+
const options = { ...T };
|
|
1137
1211
|
return (
|
|
1138
1212
|
// unevaluated modifier types
|
|
1139
1213
|
IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
|
|
1140
1214
|
// unevaluated mapped types
|
|
1141
1215
|
IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
|
|
1142
1216
|
// unevaluated types
|
|
1143
|
-
IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns)) : IsFunction2(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns)) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items)) : IsIterator2(T) ? Iterator(FromSchemaType(K, T.items)) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf)) : IsUnion(T) ? Union(FromRest2(K, T.anyOf)) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? [])) :
|
|
1217
|
+
IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction2(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator2(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(FromProperties3(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise(T) ? Promise2(FromSchemaType(K, T.item), options) : T
|
|
1144
1218
|
)
|
|
1145
1219
|
)
|
|
1146
1220
|
);
|
|
@@ -1151,19 +1225,19 @@ function MappedFunctionReturnType(K, T) {
|
|
|
1151
1225
|
Acc[L] = FromSchemaType(L, T);
|
|
1152
1226
|
return Acc;
|
|
1153
1227
|
}
|
|
1154
|
-
function Mapped(key, map, options
|
|
1228
|
+
function Mapped(key, map, options) {
|
|
1155
1229
|
const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
1156
1230
|
const RT = map({ [Kind]: "MappedKey", keys: K });
|
|
1157
1231
|
const R = MappedFunctionReturnType(K, RT);
|
|
1158
|
-
return
|
|
1232
|
+
return Object2(R, options);
|
|
1159
1233
|
}
|
|
1160
1234
|
|
|
1161
1235
|
// node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
1162
1236
|
function RemoveOptional(schema) {
|
|
1163
|
-
return Discard(
|
|
1237
|
+
return CreateType(Discard(schema, [OptionalKind]));
|
|
1164
1238
|
}
|
|
1165
1239
|
function AddOptional(schema) {
|
|
1166
|
-
return { ...
|
|
1240
|
+
return CreateType({ ...schema, [OptionalKind]: "Optional" });
|
|
1167
1241
|
}
|
|
1168
1242
|
function OptionalWithFlag(schema, F) {
|
|
1169
1243
|
return F === false ? RemoveOptional(schema) : AddOptional(schema);
|
|
@@ -1189,85 +1263,96 @@ function OptionalFromMappedResult(R, F) {
|
|
|
1189
1263
|
}
|
|
1190
1264
|
|
|
1191
1265
|
// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
|
|
1192
|
-
function IntersectCreate(T, options) {
|
|
1193
|
-
const allObjects = T.every((schema) =>
|
|
1194
|
-
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties:
|
|
1195
|
-
return options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...
|
|
1266
|
+
function IntersectCreate(T, options = {}) {
|
|
1267
|
+
const allObjects = T.every((schema) => IsObject3(schema));
|
|
1268
|
+
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1269
|
+
return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
|
|
1196
1270
|
}
|
|
1197
1271
|
|
|
1198
1272
|
// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
|
|
1199
|
-
function IsIntersectOptional(
|
|
1200
|
-
return
|
|
1273
|
+
function IsIntersectOptional(types) {
|
|
1274
|
+
return types.every((left) => IsOptional(left));
|
|
1201
1275
|
}
|
|
1202
|
-
function RemoveOptionalFromType2(
|
|
1203
|
-
return Discard(
|
|
1276
|
+
function RemoveOptionalFromType2(type) {
|
|
1277
|
+
return Discard(type, [OptionalKind]);
|
|
1204
1278
|
}
|
|
1205
|
-
function RemoveOptionalFromRest2(
|
|
1206
|
-
return
|
|
1279
|
+
function RemoveOptionalFromRest2(types) {
|
|
1280
|
+
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
|
|
1207
1281
|
}
|
|
1208
|
-
function ResolveIntersect(
|
|
1209
|
-
return IsIntersectOptional(
|
|
1282
|
+
function ResolveIntersect(types, options) {
|
|
1283
|
+
return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
|
|
1210
1284
|
}
|
|
1211
|
-
function IntersectEvaluated(
|
|
1212
|
-
if (
|
|
1285
|
+
function IntersectEvaluated(types, options = {}) {
|
|
1286
|
+
if (types.length === 1)
|
|
1287
|
+
return CreateType(types[0], options);
|
|
1288
|
+
if (types.length === 0)
|
|
1213
1289
|
return Never(options);
|
|
1214
|
-
if (
|
|
1215
|
-
return CloneType(T[0], options);
|
|
1216
|
-
if (T.some((schema) => IsTransform(schema)))
|
|
1290
|
+
if (types.some((schema) => IsTransform(schema)))
|
|
1217
1291
|
throw new Error("Cannot intersect transform types");
|
|
1218
|
-
return ResolveIntersect(
|
|
1292
|
+
return ResolveIntersect(types, options);
|
|
1219
1293
|
}
|
|
1220
1294
|
|
|
1221
1295
|
// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
|
|
1222
|
-
function Intersect(
|
|
1223
|
-
if (
|
|
1296
|
+
function Intersect(types, options) {
|
|
1297
|
+
if (types.length === 1)
|
|
1298
|
+
return CreateType(types[0], options);
|
|
1299
|
+
if (types.length === 0)
|
|
1224
1300
|
return Never(options);
|
|
1225
|
-
if (
|
|
1226
|
-
return CloneType(T[0], options);
|
|
1227
|
-
if (T.some((schema) => IsTransform(schema)))
|
|
1301
|
+
if (types.some((schema) => IsTransform(schema)))
|
|
1228
1302
|
throw new Error("Cannot intersect transform types");
|
|
1229
|
-
return IntersectCreate(
|
|
1303
|
+
return IntersectCreate(types, options);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
// node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
|
|
1307
|
+
function Ref(...args) {
|
|
1308
|
+
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1309
|
+
if (typeof $ref !== "string")
|
|
1310
|
+
throw new TypeBoxError("Ref: $ref must be a string");
|
|
1311
|
+
return CreateType({ [Kind]: "Ref", $ref }, options);
|
|
1230
1312
|
}
|
|
1231
1313
|
|
|
1232
1314
|
// node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
1233
|
-
function
|
|
1234
|
-
return
|
|
1315
|
+
function FromComputed(target, parameters) {
|
|
1316
|
+
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1317
|
+
}
|
|
1318
|
+
function FromRef($ref) {
|
|
1319
|
+
return Computed("Awaited", [Ref($ref)]);
|
|
1235
1320
|
}
|
|
1236
|
-
function FromIntersect2(
|
|
1237
|
-
return Intersect(FromRest3(
|
|
1321
|
+
function FromIntersect2(types) {
|
|
1322
|
+
return Intersect(FromRest3(types));
|
|
1238
1323
|
}
|
|
1239
|
-
function FromUnion4(
|
|
1240
|
-
return Union(FromRest3(
|
|
1324
|
+
function FromUnion4(types) {
|
|
1325
|
+
return Union(FromRest3(types));
|
|
1241
1326
|
}
|
|
1242
|
-
function FromPromise(
|
|
1243
|
-
return
|
|
1327
|
+
function FromPromise(type) {
|
|
1328
|
+
return Awaited(type);
|
|
1244
1329
|
}
|
|
1245
|
-
function
|
|
1246
|
-
return
|
|
1330
|
+
function FromRest3(types) {
|
|
1331
|
+
return types.map((type) => Awaited(type));
|
|
1247
1332
|
}
|
|
1248
|
-
function Awaited(
|
|
1249
|
-
return
|
|
1333
|
+
function Awaited(type, options) {
|
|
1334
|
+
return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
|
|
1250
1335
|
}
|
|
1251
1336
|
|
|
1252
1337
|
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
|
|
1253
|
-
function FromRest4(
|
|
1254
|
-
const
|
|
1255
|
-
for (const L of
|
|
1256
|
-
|
|
1257
|
-
return
|
|
1338
|
+
function FromRest4(types) {
|
|
1339
|
+
const result = [];
|
|
1340
|
+
for (const L of types)
|
|
1341
|
+
result.push(KeyOfPropertyKeys(L));
|
|
1342
|
+
return result;
|
|
1258
1343
|
}
|
|
1259
|
-
function FromIntersect3(
|
|
1260
|
-
const
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1344
|
+
function FromIntersect3(types) {
|
|
1345
|
+
const propertyKeysArray = FromRest4(types);
|
|
1346
|
+
const propertyKeys = SetUnionMany(propertyKeysArray);
|
|
1347
|
+
return propertyKeys;
|
|
1263
1348
|
}
|
|
1264
|
-
function FromUnion5(
|
|
1265
|
-
const
|
|
1266
|
-
const
|
|
1267
|
-
return
|
|
1349
|
+
function FromUnion5(types) {
|
|
1350
|
+
const propertyKeysArray = FromRest4(types);
|
|
1351
|
+
const propertyKeys = SetIntersectMany(propertyKeysArray);
|
|
1352
|
+
return propertyKeys;
|
|
1268
1353
|
}
|
|
1269
|
-
function FromTuple2(
|
|
1270
|
-
return
|
|
1354
|
+
function FromTuple2(types) {
|
|
1355
|
+
return types.map((_, indexer) => indexer.toString());
|
|
1271
1356
|
}
|
|
1272
1357
|
function FromArray2(_) {
|
|
1273
1358
|
return ["[number]"];
|
|
@@ -1283,39 +1368,44 @@ function FromPatternProperties(patternProperties) {
|
|
|
1283
1368
|
return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
|
|
1284
1369
|
});
|
|
1285
1370
|
}
|
|
1286
|
-
function KeyOfPropertyKeys(
|
|
1287
|
-
return IsIntersect(
|
|
1371
|
+
function KeyOfPropertyKeys(type) {
|
|
1372
|
+
return IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion5(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
|
|
1288
1373
|
}
|
|
1289
1374
|
var includePatternProperties = false;
|
|
1290
1375
|
|
|
1291
1376
|
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1292
|
-
function
|
|
1293
|
-
return
|
|
1377
|
+
function FromComputed2(target, parameters) {
|
|
1378
|
+
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1294
1379
|
}
|
|
1295
|
-
function
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1380
|
+
function FromRef2($ref) {
|
|
1381
|
+
return Computed("KeyOf", [Ref($ref)]);
|
|
1382
|
+
}
|
|
1383
|
+
function KeyOfFromType(type, options) {
|
|
1384
|
+
const propertyKeys = KeyOfPropertyKeys(type);
|
|
1385
|
+
const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
|
|
1386
|
+
const result = UnionEvaluated(propertyKeyTypes);
|
|
1387
|
+
return CreateType(result, options);
|
|
1388
|
+
}
|
|
1389
|
+
function KeyOfPropertyKeysToRest(propertyKeys) {
|
|
1390
|
+
return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
|
|
1391
|
+
}
|
|
1392
|
+
function KeyOf(type, options) {
|
|
1393
|
+
return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
|
|
1304
1394
|
}
|
|
1305
1395
|
|
|
1306
1396
|
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
|
|
1307
|
-
function FromProperties6(
|
|
1308
|
-
const
|
|
1309
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(
|
|
1310
|
-
|
|
1311
|
-
return
|
|
1397
|
+
function FromProperties6(properties, options) {
|
|
1398
|
+
const result = {};
|
|
1399
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
1400
|
+
result[K2] = KeyOf(properties[K2], Clone(options));
|
|
1401
|
+
return result;
|
|
1312
1402
|
}
|
|
1313
|
-
function FromMappedResult5(
|
|
1314
|
-
return FromProperties6(
|
|
1403
|
+
function FromMappedResult5(mappedResult, options) {
|
|
1404
|
+
return FromProperties6(mappedResult.properties, options);
|
|
1315
1405
|
}
|
|
1316
|
-
function KeyOfFromMappedResult(
|
|
1317
|
-
const
|
|
1318
|
-
return MappedResult(
|
|
1406
|
+
function KeyOfFromMappedResult(mappedResult, options) {
|
|
1407
|
+
const properties = FromMappedResult5(mappedResult, options);
|
|
1408
|
+
return MappedResult(properties);
|
|
1319
1409
|
}
|
|
1320
1410
|
|
|
1321
1411
|
// node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
@@ -1341,7 +1431,7 @@ function CompositeProperties(T, K) {
|
|
|
1341
1431
|
}
|
|
1342
1432
|
return Acc;
|
|
1343
1433
|
}
|
|
1344
|
-
function Composite(T, options
|
|
1434
|
+
function Composite(T, options) {
|
|
1345
1435
|
const K = CompositeKeys(T);
|
|
1346
1436
|
const P = CompositeProperties(T, K);
|
|
1347
1437
|
const R = Object2(P, options);
|
|
@@ -1349,44 +1439,33 @@ function Composite(T, options = {}) {
|
|
|
1349
1439
|
}
|
|
1350
1440
|
|
|
1351
1441
|
// node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
|
|
1352
|
-
function Date2(options
|
|
1353
|
-
return {
|
|
1354
|
-
...options,
|
|
1355
|
-
[Kind]: "Date",
|
|
1356
|
-
type: "Date"
|
|
1357
|
-
};
|
|
1442
|
+
function Date2(options) {
|
|
1443
|
+
return CreateType({ [Kind]: "Date", type: "Date" }, options);
|
|
1358
1444
|
}
|
|
1359
1445
|
|
|
1360
1446
|
// node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
|
|
1361
|
-
function Null(options
|
|
1362
|
-
return {
|
|
1363
|
-
...options,
|
|
1364
|
-
[Kind]: "Null",
|
|
1365
|
-
type: "null"
|
|
1366
|
-
};
|
|
1447
|
+
function Null(options) {
|
|
1448
|
+
return CreateType({ [Kind]: "Null", type: "null" }, options);
|
|
1367
1449
|
}
|
|
1368
1450
|
|
|
1369
1451
|
// node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
|
|
1370
1452
|
function Symbol2(options) {
|
|
1371
|
-
return {
|
|
1453
|
+
return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
|
|
1372
1454
|
}
|
|
1373
1455
|
|
|
1374
1456
|
// node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
|
|
1375
|
-
function Undefined(options
|
|
1376
|
-
return {
|
|
1457
|
+
function Undefined(options) {
|
|
1458
|
+
return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
|
|
1377
1459
|
}
|
|
1378
1460
|
|
|
1379
1461
|
// node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
|
|
1380
|
-
function Uint8Array2(options
|
|
1381
|
-
return {
|
|
1462
|
+
function Uint8Array2(options) {
|
|
1463
|
+
return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
|
|
1382
1464
|
}
|
|
1383
1465
|
|
|
1384
1466
|
// node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
|
|
1385
|
-
function Unknown(options
|
|
1386
|
-
return {
|
|
1387
|
-
...options,
|
|
1388
|
-
[Kind]: "Unknown"
|
|
1389
|
-
};
|
|
1467
|
+
function Unknown(options) {
|
|
1468
|
+
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1390
1469
|
}
|
|
1391
1470
|
|
|
1392
1471
|
// node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
@@ -1405,86 +1484,17 @@ function ConditionalReadonly(T, root) {
|
|
|
1405
1484
|
function FromValue(value, root) {
|
|
1406
1485
|
return IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) : IsIterator(value) ? ConditionalReadonly(Any(), root) : IsArray(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array(value) ? Uint8Array2() : IsDate(value) ? Date2() : IsObject(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined(value) ? Undefined() : IsNull(value) ? Null() : IsSymbol(value) ? Symbol2() : IsBigInt(value) ? BigInt() : IsNumber(value) ? Literal(value) : IsBoolean(value) ? Literal(value) : IsString(value) ? Literal(value) : Object2({});
|
|
1407
1486
|
}
|
|
1408
|
-
function Const(T, options
|
|
1409
|
-
return
|
|
1487
|
+
function Const(T, options) {
|
|
1488
|
+
return CreateType(FromValue(T, true), options);
|
|
1410
1489
|
}
|
|
1411
1490
|
|
|
1412
1491
|
// node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
1413
|
-
function ConstructorParameters(schema, options
|
|
1414
|
-
return Tuple(
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
// node_modules/@sinclair/typebox/build/esm/type/deref/deref.mjs
|
|
1418
|
-
function FromRest5(schema, references) {
|
|
1419
|
-
return schema.map((schema2) => Deref(schema2, references));
|
|
1420
|
-
}
|
|
1421
|
-
function FromProperties8(properties, references) {
|
|
1422
|
-
const Acc = {};
|
|
1423
|
-
for (const K of globalThis.Object.getOwnPropertyNames(properties)) {
|
|
1424
|
-
Acc[K] = Deref(properties[K], references);
|
|
1425
|
-
}
|
|
1426
|
-
return Acc;
|
|
1427
|
-
}
|
|
1428
|
-
function FromConstructor(schema, references) {
|
|
1429
|
-
schema.parameters = FromRest5(schema.parameters, references);
|
|
1430
|
-
schema.returns = Deref(schema.returns, references);
|
|
1431
|
-
return schema;
|
|
1432
|
-
}
|
|
1433
|
-
function FromFunction(schema, references) {
|
|
1434
|
-
schema.parameters = FromRest5(schema.parameters, references);
|
|
1435
|
-
schema.returns = Deref(schema.returns, references);
|
|
1436
|
-
return schema;
|
|
1437
|
-
}
|
|
1438
|
-
function FromIntersect4(schema, references) {
|
|
1439
|
-
schema.allOf = FromRest5(schema.allOf, references);
|
|
1440
|
-
return schema;
|
|
1441
|
-
}
|
|
1442
|
-
function FromUnion6(schema, references) {
|
|
1443
|
-
schema.anyOf = FromRest5(schema.anyOf, references);
|
|
1444
|
-
return schema;
|
|
1445
|
-
}
|
|
1446
|
-
function FromTuple3(schema, references) {
|
|
1447
|
-
if (IsUndefined(schema.items))
|
|
1448
|
-
return schema;
|
|
1449
|
-
schema.items = FromRest5(schema.items, references);
|
|
1450
|
-
return schema;
|
|
1451
|
-
}
|
|
1452
|
-
function FromArray4(schema, references) {
|
|
1453
|
-
schema.items = Deref(schema.items, references);
|
|
1454
|
-
return schema;
|
|
1455
|
-
}
|
|
1456
|
-
function FromObject(schema, references) {
|
|
1457
|
-
schema.properties = FromProperties8(schema.properties, references);
|
|
1458
|
-
return schema;
|
|
1459
|
-
}
|
|
1460
|
-
function FromPromise2(schema, references) {
|
|
1461
|
-
schema.item = Deref(schema.item, references);
|
|
1462
|
-
return schema;
|
|
1463
|
-
}
|
|
1464
|
-
function FromAsyncIterator(schema, references) {
|
|
1465
|
-
schema.items = Deref(schema.items, references);
|
|
1466
|
-
return schema;
|
|
1467
|
-
}
|
|
1468
|
-
function FromIterator(schema, references) {
|
|
1469
|
-
schema.items = Deref(schema.items, references);
|
|
1470
|
-
return schema;
|
|
1471
|
-
}
|
|
1472
|
-
function FromRef(schema, references) {
|
|
1473
|
-
const target = references.find((remote) => remote.$id === schema.$ref);
|
|
1474
|
-
if (target === void 0)
|
|
1475
|
-
throw Error(`Unable to dereference schema with $id ${schema.$ref}`);
|
|
1476
|
-
const discard = Discard(target, ["$id"]);
|
|
1477
|
-
return Deref(discard, references);
|
|
1478
|
-
}
|
|
1479
|
-
function DerefResolve(schema, references) {
|
|
1480
|
-
return IsConstructor(schema) ? FromConstructor(schema, references) : IsFunction2(schema) ? FromFunction(schema, references) : IsIntersect(schema) ? FromIntersect4(schema, references) : IsUnion(schema) ? FromUnion6(schema, references) : IsTuple(schema) ? FromTuple3(schema, references) : IsArray2(schema) ? FromArray4(schema, references) : IsObject2(schema) ? FromObject(schema, references) : IsPromise(schema) ? FromPromise2(schema, references) : IsAsyncIterator2(schema) ? FromAsyncIterator(schema, references) : IsIterator2(schema) ? FromIterator(schema, references) : IsRef(schema) ? FromRef(schema, references) : schema;
|
|
1481
|
-
}
|
|
1482
|
-
function Deref(schema, references) {
|
|
1483
|
-
return DerefResolve(CloneType(schema), CloneRest(references));
|
|
1492
|
+
function ConstructorParameters(schema, options) {
|
|
1493
|
+
return Tuple(schema.parameters, options);
|
|
1484
1494
|
}
|
|
1485
1495
|
|
|
1486
1496
|
// node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
|
|
1487
|
-
function Enum(item, options
|
|
1497
|
+
function Enum(item, options) {
|
|
1488
1498
|
if (IsUndefined(item))
|
|
1489
1499
|
throw new Error("Enum undefined or empty");
|
|
1490
1500
|
const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
|
|
@@ -1523,10 +1533,10 @@ function FromAny(left, right) {
|
|
|
1523
1533
|
function FromArrayRight(left, right) {
|
|
1524
1534
|
return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1525
1535
|
}
|
|
1526
|
-
function
|
|
1536
|
+
function FromArray4(left, right) {
|
|
1527
1537
|
return type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1528
1538
|
}
|
|
1529
|
-
function
|
|
1539
|
+
function FromAsyncIterator(left, right) {
|
|
1530
1540
|
return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1531
1541
|
}
|
|
1532
1542
|
function FromBigInt(left, right) {
|
|
@@ -1538,13 +1548,13 @@ function FromBooleanRight(left, right) {
|
|
|
1538
1548
|
function FromBoolean(left, right) {
|
|
1539
1549
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1540
1550
|
}
|
|
1541
|
-
function
|
|
1551
|
+
function FromConstructor(left, right) {
|
|
1542
1552
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
|
|
1543
1553
|
}
|
|
1544
1554
|
function FromDate(left, right) {
|
|
1545
1555
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1546
1556
|
}
|
|
1547
|
-
function
|
|
1557
|
+
function FromFunction(left, right) {
|
|
1548
1558
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
|
|
1549
1559
|
}
|
|
1550
1560
|
function FromIntegerRight(left, right) {
|
|
@@ -1556,10 +1566,10 @@ function FromInteger(left, right) {
|
|
|
1556
1566
|
function FromIntersectRight(left, right) {
|
|
1557
1567
|
return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1558
1568
|
}
|
|
1559
|
-
function
|
|
1569
|
+
function FromIntersect4(left, right) {
|
|
1560
1570
|
return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1561
1571
|
}
|
|
1562
|
-
function
|
|
1572
|
+
function FromIterator(left, right) {
|
|
1563
1573
|
return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1564
1574
|
}
|
|
1565
1575
|
function FromLiteral2(left, right) {
|
|
@@ -1618,14 +1628,14 @@ function IsObjectUint8ArrayLike(schema) {
|
|
|
1618
1628
|
return IsObjectArrayLike(schema);
|
|
1619
1629
|
}
|
|
1620
1630
|
function IsObjectFunctionLike(schema) {
|
|
1621
|
-
const length =
|
|
1631
|
+
const length = Number2();
|
|
1622
1632
|
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1623
1633
|
}
|
|
1624
1634
|
function IsObjectConstructorLike(schema) {
|
|
1625
1635
|
return IsObjectPropertyCount(schema, 0);
|
|
1626
1636
|
}
|
|
1627
1637
|
function IsObjectArrayLike(schema) {
|
|
1628
|
-
const length =
|
|
1638
|
+
const length = Number2();
|
|
1629
1639
|
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1630
1640
|
}
|
|
1631
1641
|
function IsObjectPromiseLike(schema) {
|
|
@@ -1642,7 +1652,7 @@ function FromObjectRight(left, right) {
|
|
|
1642
1652
|
return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
|
|
1643
1653
|
})() : ExtendsResult.False;
|
|
1644
1654
|
}
|
|
1645
|
-
function
|
|
1655
|
+
function FromObject(left, right) {
|
|
1646
1656
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
|
|
1647
1657
|
for (const key of Object.getOwnPropertyNames(right.properties)) {
|
|
1648
1658
|
if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
|
|
@@ -1658,11 +1668,11 @@ function FromObject2(left, right) {
|
|
|
1658
1668
|
return ExtendsResult.True;
|
|
1659
1669
|
})();
|
|
1660
1670
|
}
|
|
1661
|
-
function
|
|
1671
|
+
function FromPromise2(left, right) {
|
|
1662
1672
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !type_exports.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.item, right.item));
|
|
1663
1673
|
}
|
|
1664
1674
|
function RecordKey(schema) {
|
|
1665
|
-
return PatternNumberExact in schema.patternProperties ?
|
|
1675
|
+
return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
|
|
1666
1676
|
}
|
|
1667
1677
|
function RecordValue(schema) {
|
|
1668
1678
|
return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
|
|
@@ -1704,7 +1714,7 @@ function IsArrayOfTuple(left, right) {
|
|
|
1704
1714
|
function FromTupleRight(left, right) {
|
|
1705
1715
|
return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
|
|
1706
1716
|
}
|
|
1707
|
-
function
|
|
1717
|
+
function FromTuple3(left, right) {
|
|
1708
1718
|
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : type_exports.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !type_exports.IsTuple(right) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) || !value_exports.IsUndefined(left.items) && value_exports.IsUndefined(right.items) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit3(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1709
1719
|
}
|
|
1710
1720
|
function FromUint8Array(left, right) {
|
|
@@ -1716,7 +1726,7 @@ function FromUndefined(left, right) {
|
|
|
1716
1726
|
function FromUnionRight(left, right) {
|
|
1717
1727
|
return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1718
1728
|
}
|
|
1719
|
-
function
|
|
1729
|
+
function FromUnion6(left, right) {
|
|
1720
1730
|
return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1721
1731
|
}
|
|
1722
1732
|
function FromUnknownRight(left, right) {
|
|
@@ -1736,7 +1746,7 @@ function Visit3(left, right) {
|
|
|
1736
1746
|
// resolvable
|
|
1737
1747
|
type_exports.IsTemplateLiteral(left) || type_exports.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : type_exports.IsRegExp(left) || type_exports.IsRegExp(right) ? FromRegExp(left, right) : type_exports.IsNot(left) || type_exports.IsNot(right) ? FromNot(left, right) : (
|
|
1738
1748
|
// standard
|
|
1739
|
-
type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ?
|
|
1749
|
+
type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect4(left, right) : type_exports.IsIterator(left) ? FromIterator(left, right) : type_exports.IsLiteral(left) ? FromLiteral2(left, right) : type_exports.IsNever(left) ? FromNever(left, right) : type_exports.IsNull(left) ? FromNull(left, right) : type_exports.IsNumber(left) ? FromNumber(left, right) : type_exports.IsObject(left) ? FromObject(left, right) : type_exports.IsRecord(left) ? FromRecord(left, right) : type_exports.IsString(left) ? FromString(left, right) : type_exports.IsSymbol(left) ? FromSymbol(left, right) : type_exports.IsTuple(left) ? FromTuple3(left, right) : type_exports.IsPromise(left) ? FromPromise2(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion6(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
|
|
1740
1750
|
)
|
|
1741
1751
|
);
|
|
1742
1752
|
}
|
|
@@ -1745,14 +1755,14 @@ function ExtendsCheck(left, right) {
|
|
|
1745
1755
|
}
|
|
1746
1756
|
|
|
1747
1757
|
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
|
|
1748
|
-
function
|
|
1758
|
+
function FromProperties8(P, Right, True, False, options) {
|
|
1749
1759
|
const Acc = {};
|
|
1750
1760
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1751
|
-
Acc[K2] = Extends(P[K2], Right, True, False, options);
|
|
1761
|
+
Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
|
|
1752
1762
|
return Acc;
|
|
1753
1763
|
}
|
|
1754
1764
|
function FromMappedResult6(Left, Right, True, False, options) {
|
|
1755
|
-
return
|
|
1765
|
+
return FromProperties8(Left.properties, Right, True, False, options);
|
|
1756
1766
|
}
|
|
1757
1767
|
function ExtendsFromMappedResult(Left, Right, True, False, options) {
|
|
1758
1768
|
const P = FromMappedResult6(Left, Right, True, False, options);
|
|
@@ -1764,14 +1774,14 @@ function ExtendsResolve(left, right, trueType, falseType) {
|
|
|
1764
1774
|
const R = ExtendsCheck(left, right);
|
|
1765
1775
|
return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
|
|
1766
1776
|
}
|
|
1767
|
-
function Extends(L, R, T, F, options
|
|
1768
|
-
return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ?
|
|
1777
|
+
function Extends(L, R, T, F, options) {
|
|
1778
|
+
return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
|
|
1769
1779
|
}
|
|
1770
1780
|
|
|
1771
1781
|
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
|
|
1772
1782
|
function FromPropertyKey(K, U, L, R, options) {
|
|
1773
1783
|
return {
|
|
1774
|
-
[K]: Extends(Literal(K), U, L, R, options)
|
|
1784
|
+
[K]: Extends(Literal(K), U, L, R, Clone(options))
|
|
1775
1785
|
};
|
|
1776
1786
|
}
|
|
1777
1787
|
function FromPropertyKeys(K, U, L, R, options) {
|
|
@@ -1799,21 +1809,21 @@ function ExcludeRest(L, R) {
|
|
|
1799
1809
|
}
|
|
1800
1810
|
function Exclude(L, R, options = {}) {
|
|
1801
1811
|
if (IsTemplateLiteral(L))
|
|
1802
|
-
return
|
|
1812
|
+
return CreateType(ExcludeFromTemplateLiteral(L, R), options);
|
|
1803
1813
|
if (IsMappedResult(L))
|
|
1804
|
-
return
|
|
1805
|
-
return
|
|
1814
|
+
return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1815
|
+
return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1806
1816
|
}
|
|
1807
1817
|
|
|
1808
1818
|
// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1809
|
-
function
|
|
1819
|
+
function FromProperties9(P, U) {
|
|
1810
1820
|
const Acc = {};
|
|
1811
1821
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1812
1822
|
Acc[K2] = Exclude(P[K2], U);
|
|
1813
1823
|
return Acc;
|
|
1814
1824
|
}
|
|
1815
1825
|
function FromMappedResult7(R, T) {
|
|
1816
|
-
return
|
|
1826
|
+
return FromProperties9(R.properties, T);
|
|
1817
1827
|
}
|
|
1818
1828
|
function ExcludeFromMappedResult(R, T) {
|
|
1819
1829
|
const P = FromMappedResult7(R, T);
|
|
@@ -1830,23 +1840,23 @@ function ExtractRest(L, R) {
|
|
|
1830
1840
|
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1831
1841
|
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
1832
1842
|
}
|
|
1833
|
-
function Extract(L, R, options
|
|
1843
|
+
function Extract(L, R, options) {
|
|
1834
1844
|
if (IsTemplateLiteral(L))
|
|
1835
|
-
return
|
|
1845
|
+
return CreateType(ExtractFromTemplateLiteral(L, R), options);
|
|
1836
1846
|
if (IsMappedResult(L))
|
|
1837
|
-
return
|
|
1838
|
-
return
|
|
1847
|
+
return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1848
|
+
return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1839
1849
|
}
|
|
1840
1850
|
|
|
1841
1851
|
// node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1842
|
-
function
|
|
1852
|
+
function FromProperties10(P, T) {
|
|
1843
1853
|
const Acc = {};
|
|
1844
1854
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1845
1855
|
Acc[K2] = Extract(P[K2], T);
|
|
1846
1856
|
return Acc;
|
|
1847
1857
|
}
|
|
1848
1858
|
function FromMappedResult8(R, T) {
|
|
1849
|
-
return
|
|
1859
|
+
return FromProperties10(R.properties, T);
|
|
1850
1860
|
}
|
|
1851
1861
|
function ExtractFromMappedResult(R, T) {
|
|
1852
1862
|
const P = FromMappedResult8(R, T);
|
|
@@ -1854,29 +1864,26 @@ function ExtractFromMappedResult(R, T) {
|
|
|
1854
1864
|
}
|
|
1855
1865
|
|
|
1856
1866
|
// node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
1857
|
-
function InstanceType(schema, options
|
|
1858
|
-
return
|
|
1867
|
+
function InstanceType(schema, options) {
|
|
1868
|
+
return CreateType(schema.returns, options);
|
|
1859
1869
|
}
|
|
1860
1870
|
|
|
1861
1871
|
// node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
|
|
1862
|
-
function Integer(options
|
|
1863
|
-
return {
|
|
1864
|
-
...options,
|
|
1865
|
-
[Kind]: "Integer",
|
|
1866
|
-
type: "integer"
|
|
1867
|
-
};
|
|
1872
|
+
function Integer(options) {
|
|
1873
|
+
return CreateType({ [Kind]: "Integer", type: "integer" }, options);
|
|
1868
1874
|
}
|
|
1869
1875
|
|
|
1870
1876
|
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
|
|
1871
1877
|
function MappedIntrinsicPropertyKey(K, M, options) {
|
|
1872
1878
|
return {
|
|
1873
|
-
[K]: Intrinsic(Literal(K), M, options)
|
|
1879
|
+
[K]: Intrinsic(Literal(K), M, Clone(options))
|
|
1874
1880
|
};
|
|
1875
1881
|
}
|
|
1876
1882
|
function MappedIntrinsicPropertyKeys(K, M, options) {
|
|
1877
|
-
|
|
1883
|
+
const result = K.reduce((Acc, L) => {
|
|
1878
1884
|
return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
|
|
1879
1885
|
}, {});
|
|
1886
|
+
return result;
|
|
1880
1887
|
}
|
|
1881
1888
|
function MappedIntrinsicProperties(T, M, options) {
|
|
1882
1889
|
return MappedIntrinsicPropertyKeys(T["keys"], M, options);
|
|
@@ -1908,14 +1915,14 @@ function FromTemplateLiteral3(schema, mode, options) {
|
|
|
1908
1915
|
return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
|
|
1909
1916
|
const strings = [...TemplateLiteralExpressionGenerate(expression)];
|
|
1910
1917
|
const literals = strings.map((value) => Literal(value));
|
|
1911
|
-
const mapped =
|
|
1918
|
+
const mapped = FromRest5(literals, mode);
|
|
1912
1919
|
const union = Union(mapped);
|
|
1913
1920
|
return TemplateLiteral([union], options);
|
|
1914
1921
|
}
|
|
1915
1922
|
function FromLiteralValue(value, mode) {
|
|
1916
1923
|
return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
|
|
1917
1924
|
}
|
|
1918
|
-
function
|
|
1925
|
+
function FromRest5(T, M) {
|
|
1919
1926
|
return T.map((L) => Intrinsic(L, M));
|
|
1920
1927
|
}
|
|
1921
1928
|
function Intrinsic(schema, mode, options = {}) {
|
|
@@ -1923,7 +1930,10 @@ function Intrinsic(schema, mode, options = {}) {
|
|
|
1923
1930
|
// Intrinsic-Mapped-Inference
|
|
1924
1931
|
IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
|
|
1925
1932
|
// Standard-Inference
|
|
1926
|
-
IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode,
|
|
1933
|
+
IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
|
|
1934
|
+
// Default Type
|
|
1935
|
+
CreateType(schema, options)
|
|
1936
|
+
)
|
|
1927
1937
|
)
|
|
1928
1938
|
);
|
|
1929
1939
|
}
|
|
@@ -1948,309 +1958,428 @@ function Uppercase(T, options = {}) {
|
|
|
1948
1958
|
return Intrinsic(T, "Uppercase", options);
|
|
1949
1959
|
}
|
|
1950
1960
|
|
|
1951
|
-
// node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
1952
|
-
function Not(schema, options) {
|
|
1953
|
-
return {
|
|
1954
|
-
...options,
|
|
1955
|
-
[Kind]: "Not",
|
|
1956
|
-
not: CloneType(schema)
|
|
1957
|
-
};
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
1961
|
// node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
|
|
1961
|
-
function
|
|
1962
|
-
const
|
|
1963
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(
|
|
1964
|
-
|
|
1965
|
-
return
|
|
1962
|
+
function FromProperties11(properties, propertyKeys, options) {
|
|
1963
|
+
const result = {};
|
|
1964
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
1965
|
+
result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
|
|
1966
|
+
return result;
|
|
1966
1967
|
}
|
|
1967
|
-
function FromMappedResult9(
|
|
1968
|
-
return
|
|
1968
|
+
function FromMappedResult9(mappedResult, propertyKeys, options) {
|
|
1969
|
+
return FromProperties11(mappedResult.properties, propertyKeys, options);
|
|
1969
1970
|
}
|
|
1970
|
-
function OmitFromMappedResult(
|
|
1971
|
-
const
|
|
1972
|
-
return MappedResult(
|
|
1971
|
+
function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
1972
|
+
const properties = FromMappedResult9(mappedResult, propertyKeys, options);
|
|
1973
|
+
return MappedResult(properties);
|
|
1973
1974
|
}
|
|
1974
1975
|
|
|
1975
1976
|
// node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
1976
|
-
function
|
|
1977
|
-
return
|
|
1977
|
+
function FromIntersect5(types, propertyKeys) {
|
|
1978
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
1978
1979
|
}
|
|
1979
|
-
function
|
|
1980
|
-
return
|
|
1980
|
+
function FromUnion7(types, propertyKeys) {
|
|
1981
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
1981
1982
|
}
|
|
1982
|
-
function FromProperty2(
|
|
1983
|
-
const { [
|
|
1983
|
+
function FromProperty2(properties, key) {
|
|
1984
|
+
const { [key]: _, ...R } = properties;
|
|
1984
1985
|
return R;
|
|
1985
1986
|
}
|
|
1986
|
-
function
|
|
1987
|
-
return
|
|
1987
|
+
function FromProperties12(properties, propertyKeys) {
|
|
1988
|
+
return propertyKeys.reduce((T, K2) => FromProperty2(T, K2), properties);
|
|
1989
|
+
}
|
|
1990
|
+
function FromObject2(properties, propertyKeys) {
|
|
1991
|
+
const options = Discard(properties, [TransformKind, "$id", "required", "properties"]);
|
|
1992
|
+
const omittedProperties = FromProperties12(properties["properties"], propertyKeys);
|
|
1993
|
+
return Object2(omittedProperties, options);
|
|
1988
1994
|
}
|
|
1989
|
-
function
|
|
1990
|
-
|
|
1995
|
+
function UnionFromPropertyKeys(propertyKeys) {
|
|
1996
|
+
const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
|
|
1997
|
+
return Union(result);
|
|
1991
1998
|
}
|
|
1992
|
-
function
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
const
|
|
1998
|
-
const
|
|
1999
|
-
const
|
|
2000
|
-
return { ...
|
|
1999
|
+
function OmitResolve(properties, propertyKeys) {
|
|
2000
|
+
return IsIntersect(properties) ? Intersect(FromIntersect5(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion7(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject2(properties, propertyKeys) : Object2({});
|
|
2001
|
+
}
|
|
2002
|
+
function Omit(type, key, options) {
|
|
2003
|
+
const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
|
|
2004
|
+
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2005
|
+
const isTypeRef = IsRef(type);
|
|
2006
|
+
const isKeyRef = IsRef(key);
|
|
2007
|
+
return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
|
|
2001
2008
|
}
|
|
2002
2009
|
|
|
2003
2010
|
// node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
|
|
2004
|
-
function FromPropertyKey2(
|
|
2005
|
-
return {
|
|
2006
|
-
[K]: Omit(T, [K], options)
|
|
2007
|
-
};
|
|
2011
|
+
function FromPropertyKey2(type, key, options) {
|
|
2012
|
+
return { [key]: Omit(type, [key], Clone(options)) };
|
|
2008
2013
|
}
|
|
2009
|
-
function FromPropertyKeys2(
|
|
2010
|
-
return
|
|
2011
|
-
return { ...Acc, ...FromPropertyKey2(
|
|
2014
|
+
function FromPropertyKeys2(type, propertyKeys, options) {
|
|
2015
|
+
return propertyKeys.reduce((Acc, LK) => {
|
|
2016
|
+
return { ...Acc, ...FromPropertyKey2(type, LK, options) };
|
|
2012
2017
|
}, {});
|
|
2013
2018
|
}
|
|
2014
|
-
function FromMappedKey3(
|
|
2015
|
-
return FromPropertyKeys2(
|
|
2019
|
+
function FromMappedKey3(type, mappedKey, options) {
|
|
2020
|
+
return FromPropertyKeys2(type, mappedKey.keys, options);
|
|
2016
2021
|
}
|
|
2017
|
-
function OmitFromMappedKey(
|
|
2018
|
-
const
|
|
2019
|
-
return MappedResult(
|
|
2022
|
+
function OmitFromMappedKey(type, mappedKey, options) {
|
|
2023
|
+
const properties = FromMappedKey3(type, mappedKey, options);
|
|
2024
|
+
return MappedResult(properties);
|
|
2020
2025
|
}
|
|
2021
2026
|
|
|
2022
|
-
// node_modules/@sinclair/typebox/build/esm/type/
|
|
2023
|
-
function
|
|
2024
|
-
|
|
2027
|
+
// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
|
|
2028
|
+
function FromProperties13(properties, propertyKeys, options) {
|
|
2029
|
+
const result = {};
|
|
2030
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2031
|
+
result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
|
|
2032
|
+
return result;
|
|
2033
|
+
}
|
|
2034
|
+
function FromMappedResult10(mappedResult, propertyKeys, options) {
|
|
2035
|
+
return FromProperties13(mappedResult.properties, propertyKeys, options);
|
|
2036
|
+
}
|
|
2037
|
+
function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2038
|
+
const properties = FromMappedResult10(mappedResult, propertyKeys, options);
|
|
2039
|
+
return MappedResult(properties);
|
|
2025
2040
|
}
|
|
2026
2041
|
|
|
2027
|
-
// node_modules/@sinclair/typebox/build/esm/type/
|
|
2028
|
-
function
|
|
2029
|
-
return
|
|
2042
|
+
// node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2043
|
+
function FromIntersect6(types, propertyKeys) {
|
|
2044
|
+
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2030
2045
|
}
|
|
2031
|
-
function
|
|
2032
|
-
|
|
2033
|
-
for (const K of globalThis.Object.getOwnPropertyNames(T))
|
|
2034
|
-
Acc[K] = Optional(T[K]);
|
|
2035
|
-
return Acc;
|
|
2046
|
+
function FromUnion8(types, propertyKeys) {
|
|
2047
|
+
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2036
2048
|
}
|
|
2037
|
-
function
|
|
2038
|
-
|
|
2049
|
+
function FromProperties14(properties, propertyKeys) {
|
|
2050
|
+
const result = {};
|
|
2051
|
+
for (const K2 of propertyKeys)
|
|
2052
|
+
if (K2 in properties)
|
|
2053
|
+
result[K2] = properties[K2];
|
|
2054
|
+
return result;
|
|
2039
2055
|
}
|
|
2040
|
-
function
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
const R = CloneType(PartialResolve(T), options);
|
|
2045
|
-
return { ...D, ...R };
|
|
2056
|
+
function FromObject3(T, K) {
|
|
2057
|
+
const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
|
|
2058
|
+
const properties = FromProperties14(T["properties"], K);
|
|
2059
|
+
return Object2(properties, options);
|
|
2046
2060
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
const Acc = {};
|
|
2051
|
-
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
2052
|
-
Acc[K2] = Partial(K[K2], options);
|
|
2053
|
-
return Acc;
|
|
2061
|
+
function UnionFromPropertyKeys2(propertyKeys) {
|
|
2062
|
+
const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
|
|
2063
|
+
return Union(result);
|
|
2054
2064
|
}
|
|
2055
|
-
function
|
|
2056
|
-
return
|
|
2065
|
+
function PickResolve(properties, propertyKeys) {
|
|
2066
|
+
return IsIntersect(properties) ? Intersect(FromIntersect6(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion8(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject3(properties, propertyKeys) : Object2({});
|
|
2057
2067
|
}
|
|
2058
|
-
function
|
|
2059
|
-
const
|
|
2060
|
-
|
|
2068
|
+
function Pick(type, key, options) {
|
|
2069
|
+
const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
|
|
2070
|
+
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2071
|
+
const isTypeRef = IsRef(type);
|
|
2072
|
+
const isKeyRef = IsRef(key);
|
|
2073
|
+
return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
|
|
2061
2074
|
}
|
|
2062
2075
|
|
|
2063
|
-
// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-
|
|
2064
|
-
function
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
return Acc;
|
|
2076
|
+
// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
|
|
2077
|
+
function FromPropertyKey3(type, key, options) {
|
|
2078
|
+
return {
|
|
2079
|
+
[key]: Pick(type, [key], Clone(options))
|
|
2080
|
+
};
|
|
2069
2081
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return
|
|
2082
|
+
function FromPropertyKeys3(type, propertyKeys, options) {
|
|
2083
|
+
return propertyKeys.reduce((result, leftKey) => {
|
|
2084
|
+
return { ...result, ...FromPropertyKey3(type, leftKey, options) };
|
|
2085
|
+
}, {});
|
|
2072
2086
|
}
|
|
2073
|
-
function
|
|
2074
|
-
|
|
2075
|
-
|
|
2087
|
+
function FromMappedKey4(type, mappedKey, options) {
|
|
2088
|
+
return FromPropertyKeys3(type, mappedKey.keys, options);
|
|
2089
|
+
}
|
|
2090
|
+
function PickFromMappedKey(type, mappedKey, options) {
|
|
2091
|
+
const properties = FromMappedKey4(type, mappedKey, options);
|
|
2092
|
+
return MappedResult(properties);
|
|
2076
2093
|
}
|
|
2077
2094
|
|
|
2078
|
-
// node_modules/@sinclair/typebox/build/esm/type/
|
|
2079
|
-
function
|
|
2080
|
-
return
|
|
2095
|
+
// node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
|
|
2096
|
+
function FromComputed3(target, parameters) {
|
|
2097
|
+
return Computed("Partial", [Computed(target, parameters)]);
|
|
2081
2098
|
}
|
|
2082
|
-
function
|
|
2083
|
-
return
|
|
2099
|
+
function FromRef3($ref) {
|
|
2100
|
+
return Computed("Partial", [Ref($ref)]);
|
|
2084
2101
|
}
|
|
2085
|
-
function
|
|
2086
|
-
const
|
|
2087
|
-
for (const
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
return Acc;
|
|
2102
|
+
function FromProperties15(properties) {
|
|
2103
|
+
const partialProperties = {};
|
|
2104
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2105
|
+
partialProperties[K] = Optional(properties[K]);
|
|
2106
|
+
return partialProperties;
|
|
2091
2107
|
}
|
|
2092
|
-
function
|
|
2093
|
-
|
|
2108
|
+
function FromObject4(T) {
|
|
2109
|
+
const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
|
|
2110
|
+
const properties = FromProperties15(T["properties"]);
|
|
2111
|
+
return Object2(properties, options);
|
|
2094
2112
|
}
|
|
2095
|
-
function
|
|
2096
|
-
|
|
2097
|
-
return PickFromMappedKey(T, K, options);
|
|
2098
|
-
if (IsMappedResult(T))
|
|
2099
|
-
return PickFromMappedResult(T, K, options);
|
|
2100
|
-
const I = IsSchema(K) ? IndexPropertyKeys(K) : K;
|
|
2101
|
-
const D = Discard(T, [TransformKind, "$id", "required"]);
|
|
2102
|
-
const R = CloneType(PickResolve(T, I), options);
|
|
2103
|
-
return { ...D, ...R };
|
|
2113
|
+
function FromRest6(types) {
|
|
2114
|
+
return types.map((type) => PartialResolve(type));
|
|
2104
2115
|
}
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
function FromPropertyKey3(T, K, options) {
|
|
2108
|
-
return {
|
|
2109
|
-
[K]: Pick(T, [K], options)
|
|
2110
|
-
};
|
|
2116
|
+
function PartialResolve(type) {
|
|
2117
|
+
return IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject4(type) : Object2({});
|
|
2111
2118
|
}
|
|
2112
|
-
function
|
|
2113
|
-
|
|
2114
|
-
return
|
|
2115
|
-
}
|
|
2119
|
+
function Partial(type, options) {
|
|
2120
|
+
if (IsMappedResult(type)) {
|
|
2121
|
+
return PartialFromMappedResult(type, options);
|
|
2122
|
+
} else {
|
|
2123
|
+
return CreateType({ ...PartialResolve(type), ...options });
|
|
2124
|
+
}
|
|
2116
2125
|
}
|
|
2117
|
-
|
|
2118
|
-
|
|
2126
|
+
|
|
2127
|
+
// node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
|
|
2128
|
+
function FromProperties16(K, options) {
|
|
2129
|
+
const Acc = {};
|
|
2130
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
2131
|
+
Acc[K2] = Partial(K[K2], Clone(options));
|
|
2132
|
+
return Acc;
|
|
2119
2133
|
}
|
|
2120
|
-
function
|
|
2121
|
-
|
|
2122
|
-
return MappedResult(P);
|
|
2134
|
+
function FromMappedResult11(R, options) {
|
|
2135
|
+
return FromProperties16(R.properties, options);
|
|
2123
2136
|
}
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
return Readonly(Optional(schema));
|
|
2137
|
+
function PartialFromMappedResult(R, options) {
|
|
2138
|
+
const P = FromMappedResult11(R, options);
|
|
2139
|
+
return MappedResult(P);
|
|
2128
2140
|
}
|
|
2129
2141
|
|
|
2130
2142
|
// node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
2131
2143
|
function RecordCreateFromPattern(pattern, T, options) {
|
|
2132
|
-
return {
|
|
2133
|
-
...options,
|
|
2134
|
-
[Kind]: "Record",
|
|
2135
|
-
type: "object",
|
|
2136
|
-
patternProperties: { [pattern]: CloneType(T) }
|
|
2137
|
-
};
|
|
2144
|
+
return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
|
|
2138
2145
|
}
|
|
2139
2146
|
function RecordCreateFromKeys(K, T, options) {
|
|
2140
|
-
const
|
|
2147
|
+
const result = {};
|
|
2141
2148
|
for (const K2 of K)
|
|
2142
|
-
|
|
2143
|
-
return Object2(
|
|
2149
|
+
result[K2] = T;
|
|
2150
|
+
return Object2(result, { ...options, [Hint]: "Record" });
|
|
2144
2151
|
}
|
|
2145
2152
|
function FromTemplateLiteralKey(K, T, options) {
|
|
2146
2153
|
return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
|
|
2147
2154
|
}
|
|
2148
|
-
function FromUnionKey(
|
|
2149
|
-
return RecordCreateFromKeys(IndexPropertyKeys(Union(
|
|
2155
|
+
function FromUnionKey(key, type, options) {
|
|
2156
|
+
return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
|
|
2150
2157
|
}
|
|
2151
|
-
function FromLiteralKey(
|
|
2152
|
-
return RecordCreateFromKeys([
|
|
2158
|
+
function FromLiteralKey(key, type, options) {
|
|
2159
|
+
return RecordCreateFromKeys([key.toString()], type, options);
|
|
2153
2160
|
}
|
|
2154
|
-
function FromRegExpKey(
|
|
2155
|
-
return RecordCreateFromPattern(
|
|
2161
|
+
function FromRegExpKey(key, type, options) {
|
|
2162
|
+
return RecordCreateFromPattern(key.source, type, options);
|
|
2156
2163
|
}
|
|
2157
|
-
function FromStringKey(
|
|
2158
|
-
const pattern = IsUndefined(
|
|
2159
|
-
return RecordCreateFromPattern(pattern,
|
|
2164
|
+
function FromStringKey(key, type, options) {
|
|
2165
|
+
const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
|
|
2166
|
+
return RecordCreateFromPattern(pattern, type, options);
|
|
2160
2167
|
}
|
|
2161
|
-
function
|
|
2162
|
-
return RecordCreateFromPattern(
|
|
2168
|
+
function FromAnyKey(_, type, options) {
|
|
2169
|
+
return RecordCreateFromPattern(PatternStringExact, type, options);
|
|
2163
2170
|
}
|
|
2164
|
-
function
|
|
2165
|
-
return RecordCreateFromPattern(
|
|
2171
|
+
function FromNeverKey(_key, type, options) {
|
|
2172
|
+
return RecordCreateFromPattern(PatternNeverExact, type, options);
|
|
2166
2173
|
}
|
|
2167
|
-
function
|
|
2168
|
-
return
|
|
2174
|
+
function FromIntegerKey(_key, type, options) {
|
|
2175
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
2169
2176
|
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
var Ordinal = 0;
|
|
2173
|
-
function Recursive(callback, options = {}) {
|
|
2174
|
-
if (IsUndefined(options.$id))
|
|
2175
|
-
options.$id = `T${Ordinal++}`;
|
|
2176
|
-
const thisType = callback({ [Kind]: "This", $ref: `${options.$id}` });
|
|
2177
|
-
thisType.$id = options.$id;
|
|
2178
|
-
return CloneType({ ...options, [Hint]: "Recursive", ...thisType });
|
|
2177
|
+
function FromNumberKey(_, type, options) {
|
|
2178
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
2179
2179
|
}
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
function Ref(unresolved, options = {}) {
|
|
2183
|
-
if (IsString(unresolved))
|
|
2184
|
-
return { ...options, [Kind]: "Ref", $ref: unresolved };
|
|
2185
|
-
if (IsUndefined(unresolved.$id))
|
|
2186
|
-
throw new Error("Reference target type must specify an $id");
|
|
2187
|
-
return {
|
|
2188
|
-
...options,
|
|
2189
|
-
[Kind]: "Ref",
|
|
2190
|
-
$ref: unresolved.$id
|
|
2191
|
-
};
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
// node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2195
|
-
function RegExp2(unresolved, options = {}) {
|
|
2196
|
-
const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2197
|
-
return { ...options, [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags };
|
|
2180
|
+
function Record(key, type, options = {}) {
|
|
2181
|
+
return IsComputed(type) ? Computed("Record", [key, Computed(type.target, type.parameters)], options) : IsComputed(key) ? Computed("Record", [Computed(type.target, type.parameters), type], options) : IsRef(key) ? Computed("Record", [Ref(key.$ref), type]) : IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsInteger(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString2(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
|
|
2198
2182
|
}
|
|
2199
2183
|
|
|
2200
2184
|
// node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
|
|
2201
|
-
function
|
|
2202
|
-
return
|
|
2185
|
+
function FromComputed4(target, parameters) {
|
|
2186
|
+
return Computed("Required", [Computed(target, parameters)]);
|
|
2203
2187
|
}
|
|
2204
|
-
function
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2188
|
+
function FromRef4($ref) {
|
|
2189
|
+
return Computed("Required", [Ref($ref)]);
|
|
2190
|
+
}
|
|
2191
|
+
function FromProperties17(properties) {
|
|
2192
|
+
const requiredProperties = {};
|
|
2193
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2194
|
+
requiredProperties[K] = Discard(properties[K], [OptionalKind]);
|
|
2195
|
+
return requiredProperties;
|
|
2196
|
+
}
|
|
2197
|
+
function FromObject5(type) {
|
|
2198
|
+
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2199
|
+
const properties = FromProperties17(type["properties"]);
|
|
2200
|
+
return Object2(properties, options);
|
|
2201
|
+
}
|
|
2202
|
+
function FromRest7(types) {
|
|
2203
|
+
return types.map((type) => RequiredResolve(type));
|
|
2209
2204
|
}
|
|
2210
|
-
function RequiredResolve(
|
|
2211
|
-
return IsIntersect(
|
|
2205
|
+
function RequiredResolve(type) {
|
|
2206
|
+
return IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject5(type) : Object2({});
|
|
2212
2207
|
}
|
|
2213
|
-
function Required(
|
|
2214
|
-
if (IsMappedResult(
|
|
2215
|
-
return RequiredFromMappedResult(
|
|
2208
|
+
function Required(type, options) {
|
|
2209
|
+
if (IsMappedResult(type)) {
|
|
2210
|
+
return RequiredFromMappedResult(type, options);
|
|
2216
2211
|
} else {
|
|
2217
|
-
|
|
2218
|
-
const R = CloneType(RequiredResolve(T), options);
|
|
2219
|
-
return { ...D, ...R };
|
|
2212
|
+
return CreateType({ ...RequiredResolve(type), ...options });
|
|
2220
2213
|
}
|
|
2221
2214
|
}
|
|
2222
2215
|
|
|
2223
2216
|
// node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
|
|
2224
|
-
function
|
|
2217
|
+
function FromProperties18(P, options) {
|
|
2225
2218
|
const Acc = {};
|
|
2226
2219
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
2227
2220
|
Acc[K2] = Required(P[K2], options);
|
|
2228
2221
|
return Acc;
|
|
2229
2222
|
}
|
|
2230
2223
|
function FromMappedResult12(R, options) {
|
|
2231
|
-
return
|
|
2224
|
+
return FromProperties18(R.properties, options);
|
|
2232
2225
|
}
|
|
2233
2226
|
function RequiredFromMappedResult(R, options) {
|
|
2234
2227
|
const P = FromMappedResult12(R, options);
|
|
2235
2228
|
return MappedResult(P);
|
|
2236
2229
|
}
|
|
2237
2230
|
|
|
2231
|
+
// node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
|
|
2232
|
+
function DerefParameters(moduleProperties, types) {
|
|
2233
|
+
return types.map((type) => {
|
|
2234
|
+
return IsRef(type) ? Deref(moduleProperties, type.$ref) : FromType(moduleProperties, type);
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
function Deref(moduleProperties, ref) {
|
|
2238
|
+
return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Deref(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
|
|
2239
|
+
}
|
|
2240
|
+
function FromAwaited(parameters) {
|
|
2241
|
+
return Awaited(parameters[0]);
|
|
2242
|
+
}
|
|
2243
|
+
function FromIndex(parameters) {
|
|
2244
|
+
return Index(parameters[0], parameters[1]);
|
|
2245
|
+
}
|
|
2246
|
+
function FromKeyOf(parameters) {
|
|
2247
|
+
return KeyOf(parameters[0]);
|
|
2248
|
+
}
|
|
2249
|
+
function FromPartial(parameters) {
|
|
2250
|
+
return Partial(parameters[0]);
|
|
2251
|
+
}
|
|
2252
|
+
function FromOmit(parameters) {
|
|
2253
|
+
return Omit(parameters[0], parameters[1]);
|
|
2254
|
+
}
|
|
2255
|
+
function FromPick(parameters) {
|
|
2256
|
+
return Pick(parameters[0], parameters[1]);
|
|
2257
|
+
}
|
|
2258
|
+
function FromRecord2(parameters) {
|
|
2259
|
+
return Record(parameters[0], parameters[1]);
|
|
2260
|
+
}
|
|
2261
|
+
function FromRequired(parameters) {
|
|
2262
|
+
return Required(parameters[0]);
|
|
2263
|
+
}
|
|
2264
|
+
function FromComputed5(moduleProperties, target, parameters) {
|
|
2265
|
+
const dereferenced = DerefParameters(moduleProperties, parameters);
|
|
2266
|
+
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 === "Record" ? FromRecord2(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
|
|
2267
|
+
}
|
|
2268
|
+
function FromObject6(moduleProperties, properties) {
|
|
2269
|
+
return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
|
|
2270
|
+
return { ...result, [key]: FromType(moduleProperties, properties[key]) };
|
|
2271
|
+
}, {}));
|
|
2272
|
+
}
|
|
2273
|
+
function FromConstructor2(moduleProperties, parameters, instanceType) {
|
|
2274
|
+
return Constructor(FromRest8(moduleProperties, parameters), FromType(moduleProperties, instanceType));
|
|
2275
|
+
}
|
|
2276
|
+
function FromFunction2(moduleProperties, parameters, returnType) {
|
|
2277
|
+
return Function(FromRest8(moduleProperties, parameters), FromType(moduleProperties, returnType));
|
|
2278
|
+
}
|
|
2279
|
+
function FromTuple4(moduleProperties, types) {
|
|
2280
|
+
return Tuple(FromRest8(moduleProperties, types));
|
|
2281
|
+
}
|
|
2282
|
+
function FromIntersect7(moduleProperties, types) {
|
|
2283
|
+
return Intersect(FromRest8(moduleProperties, types));
|
|
2284
|
+
}
|
|
2285
|
+
function FromUnion9(moduleProperties, types) {
|
|
2286
|
+
return Union(FromRest8(moduleProperties, types));
|
|
2287
|
+
}
|
|
2288
|
+
function FromArray5(moduleProperties, type) {
|
|
2289
|
+
return Array2(FromType(moduleProperties, type));
|
|
2290
|
+
}
|
|
2291
|
+
function FromAsyncIterator2(moduleProperties, type) {
|
|
2292
|
+
return AsyncIterator(FromType(moduleProperties, type));
|
|
2293
|
+
}
|
|
2294
|
+
function FromIterator2(moduleProperties, type) {
|
|
2295
|
+
return Iterator(FromType(moduleProperties, type));
|
|
2296
|
+
}
|
|
2297
|
+
function FromRest8(moduleProperties, types) {
|
|
2298
|
+
return types.map((type) => FromType(moduleProperties, type));
|
|
2299
|
+
}
|
|
2300
|
+
function FromType(moduleProperties, type) {
|
|
2301
|
+
return (
|
|
2302
|
+
// Modifier Unwrap - Reapplied via CreateType Options
|
|
2303
|
+
IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
|
|
2304
|
+
// Traveral
|
|
2305
|
+
IsArray3(type) ? CreateType(FromArray5(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator2(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor2(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction2(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect7(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator2(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject6(moduleProperties, type.properties), type) : IsTuple(type) ? CreateType(FromTuple4(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion9(moduleProperties, type.anyOf), type) : type
|
|
2306
|
+
)
|
|
2307
|
+
);
|
|
2308
|
+
}
|
|
2309
|
+
function ComputeType(moduleProperties, key) {
|
|
2310
|
+
return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
|
|
2311
|
+
}
|
|
2312
|
+
function ComputeModuleProperties(moduleProperties) {
|
|
2313
|
+
return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
|
|
2314
|
+
return { ...result, [key]: ComputeType(moduleProperties, key) };
|
|
2315
|
+
}, {});
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
// node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
|
|
2319
|
+
var TModule = class {
|
|
2320
|
+
constructor($defs) {
|
|
2321
|
+
const computed = ComputeModuleProperties($defs);
|
|
2322
|
+
const identified = this.WithIdentifiers(computed);
|
|
2323
|
+
this.$defs = identified;
|
|
2324
|
+
}
|
|
2325
|
+
/** `[Json]` Imports a Type by Key. */
|
|
2326
|
+
Import(key, options) {
|
|
2327
|
+
const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
|
|
2328
|
+
return CreateType({ [Kind]: "Import", $defs, $ref: key });
|
|
2329
|
+
}
|
|
2330
|
+
// prettier-ignore
|
|
2331
|
+
WithIdentifiers($defs) {
|
|
2332
|
+
return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
|
|
2333
|
+
return { ...result, [key]: { ...$defs[key], $id: key } };
|
|
2334
|
+
}, {});
|
|
2335
|
+
}
|
|
2336
|
+
};
|
|
2337
|
+
function Module(properties) {
|
|
2338
|
+
return new TModule(properties);
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
// node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
2342
|
+
function Not(type, options) {
|
|
2343
|
+
return CreateType({ [Kind]: "Not", not: type }, options);
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
// node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2347
|
+
function Parameters(schema, options) {
|
|
2348
|
+
return Tuple(schema.parameters, options);
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
// node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
2352
|
+
function ReadonlyOptional(schema) {
|
|
2353
|
+
return Readonly(Optional(schema));
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
// node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
2357
|
+
var Ordinal = 0;
|
|
2358
|
+
function Recursive(callback, options = {}) {
|
|
2359
|
+
if (IsUndefined(options.$id))
|
|
2360
|
+
options.$id = `T${Ordinal++}`;
|
|
2361
|
+
const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
|
|
2362
|
+
thisType.$id = options.$id;
|
|
2363
|
+
return CreateType({ [Hint]: "Recursive", ...thisType }, options);
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
// node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2367
|
+
function RegExp2(unresolved, options) {
|
|
2368
|
+
const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2369
|
+
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2238
2372
|
// node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
|
|
2239
2373
|
function RestResolve(T) {
|
|
2240
|
-
return IsIntersect(T) ?
|
|
2374
|
+
return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
|
|
2241
2375
|
}
|
|
2242
2376
|
function Rest(T) {
|
|
2243
|
-
return
|
|
2377
|
+
return RestResolve(T);
|
|
2244
2378
|
}
|
|
2245
2379
|
|
|
2246
2380
|
// node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2247
|
-
function ReturnType(schema, options
|
|
2248
|
-
return
|
|
2249
|
-
}
|
|
2250
|
-
|
|
2251
|
-
// node_modules/@sinclair/typebox/build/esm/type/strict/strict.mjs
|
|
2252
|
-
function Strict(schema) {
|
|
2253
|
-
return JSON.parse(JSON.stringify(schema));
|
|
2381
|
+
function ReturnType(schema, options) {
|
|
2382
|
+
return CreateType(schema.returns, options);
|
|
2254
2383
|
}
|
|
2255
2384
|
|
|
2256
2385
|
// node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
@@ -2278,8 +2407,7 @@ var TransformEncodeBuilder = class {
|
|
|
2278
2407
|
return { ...schema, [TransformKind]: Codec };
|
|
2279
2408
|
}
|
|
2280
2409
|
Encode(encode) {
|
|
2281
|
-
|
|
2282
|
-
return IsTransform(schema) ? this.EncodeTransform(encode, schema) : this.EncodeSchema(encode, schema);
|
|
2410
|
+
return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
|
|
2283
2411
|
}
|
|
2284
2412
|
};
|
|
2285
2413
|
function Transform(schema) {
|
|
@@ -2288,24 +2416,17 @@ function Transform(schema) {
|
|
|
2288
2416
|
|
|
2289
2417
|
// node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
|
|
2290
2418
|
function Unsafe(options = {}) {
|
|
2291
|
-
return {
|
|
2292
|
-
...options,
|
|
2293
|
-
[Kind]: options[Kind] ?? "Unsafe"
|
|
2294
|
-
};
|
|
2419
|
+
return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
|
|
2295
2420
|
}
|
|
2296
2421
|
|
|
2297
2422
|
// node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2298
|
-
function Void(options
|
|
2299
|
-
return {
|
|
2300
|
-
...options,
|
|
2301
|
-
[Kind]: "Void",
|
|
2302
|
-
type: "void"
|
|
2303
|
-
};
|
|
2423
|
+
function Void(options) {
|
|
2424
|
+
return CreateType({ [Kind]: "Void", type: "void" }, options);
|
|
2304
2425
|
}
|
|
2305
2426
|
|
|
2306
2427
|
// node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
|
|
2307
|
-
var
|
|
2308
|
-
__export(
|
|
2428
|
+
var type_exports2 = {};
|
|
2429
|
+
__export(type_exports2, {
|
|
2309
2430
|
Any: () => Any,
|
|
2310
2431
|
Array: () => Array2,
|
|
2311
2432
|
AsyncIterator: () => AsyncIterator,
|
|
@@ -2318,7 +2439,6 @@ __export(type_exports3, {
|
|
|
2318
2439
|
Constructor: () => Constructor,
|
|
2319
2440
|
ConstructorParameters: () => ConstructorParameters,
|
|
2320
2441
|
Date: () => Date2,
|
|
2321
|
-
Deref: () => Deref,
|
|
2322
2442
|
Enum: () => Enum,
|
|
2323
2443
|
Exclude: () => Exclude,
|
|
2324
2444
|
Extends: () => Extends,
|
|
@@ -2333,10 +2453,11 @@ __export(type_exports3, {
|
|
|
2333
2453
|
Literal: () => Literal,
|
|
2334
2454
|
Lowercase: () => Lowercase,
|
|
2335
2455
|
Mapped: () => Mapped,
|
|
2456
|
+
Module: () => Module,
|
|
2336
2457
|
Never: () => Never,
|
|
2337
2458
|
Not: () => Not,
|
|
2338
2459
|
Null: () => Null,
|
|
2339
|
-
Number: () =>
|
|
2460
|
+
Number: () => Number2,
|
|
2340
2461
|
Object: () => Object2,
|
|
2341
2462
|
Omit: () => Omit,
|
|
2342
2463
|
Optional: () => Optional,
|
|
@@ -2353,7 +2474,6 @@ __export(type_exports3, {
|
|
|
2353
2474
|
Required: () => Required,
|
|
2354
2475
|
Rest: () => Rest,
|
|
2355
2476
|
ReturnType: () => ReturnType,
|
|
2356
|
-
Strict: () => Strict,
|
|
2357
2477
|
String: () => String,
|
|
2358
2478
|
Symbol: () => Symbol2,
|
|
2359
2479
|
TemplateLiteral: () => TemplateLiteral,
|
|
@@ -2370,7 +2490,7 @@ __export(type_exports3, {
|
|
|
2370
2490
|
});
|
|
2371
2491
|
|
|
2372
2492
|
// node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2373
|
-
var Type =
|
|
2493
|
+
var Type = type_exports2;
|
|
2374
2494
|
|
|
2375
2495
|
// src/index.ts
|
|
2376
2496
|
var jwt = ({
|
|
@@ -2445,8 +2565,8 @@ var jwt = ({
|
|
|
2445
2565
|
}
|
|
2446
2566
|
});
|
|
2447
2567
|
};
|
|
2448
|
-
var
|
|
2568
|
+
var index_default = jwt;
|
|
2449
2569
|
export {
|
|
2450
|
-
|
|
2570
|
+
index_default as default,
|
|
2451
2571
|
jwt
|
|
2452
2572
|
};
|