@elysiajs/jwt 1.2.0 → 1.3.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/index.mjs CHANGED
@@ -120,7 +120,7 @@ function IsObject2(value) {
120
120
  return value !== null && typeof value === "object";
121
121
  }
122
122
  function IsArray2(value) {
123
- return Array.isArray(value) && !ArrayBuffer.isView(value);
123
+ return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
124
124
  }
125
125
  function IsUndefined2(value) {
126
126
  return value === void 0;
@@ -225,6 +225,9 @@ function IsOptional(value) {
225
225
  function IsAny(value) {
226
226
  return IsKindOf(value, "Any");
227
227
  }
228
+ function IsArgument(value) {
229
+ return IsKindOf(value, "Argument");
230
+ }
228
231
  function IsArray3(value) {
229
232
  return IsKindOf(value, "Array");
230
233
  }
@@ -340,13 +343,14 @@ function IsKind(value) {
340
343
  return IsObject(value) && Kind in value && IsString(value[Kind]);
341
344
  }
342
345
  function IsSchema(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);
346
+ return IsAny(value) || IsArgument(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);
344
347
  }
345
348
 
346
349
  // node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
347
350
  var type_exports = {};
348
351
  __export(type_exports, {
349
352
  IsAny: () => IsAny2,
353
+ IsArgument: () => IsArgument2,
350
354
  IsArray: () => IsArray4,
351
355
  IsAsyncIterator: () => IsAsyncIterator3,
352
356
  IsBigInt: () => IsBigInt3,
@@ -400,6 +404,7 @@ __export(type_exports, {
400
404
  var TypeGuardUnknownTypeError = class extends TypeBoxError {
401
405
  };
402
406
  var KnownTypes = [
407
+ "Argument",
403
408
  "Any",
404
409
  "Array",
405
410
  "AsyncIterator",
@@ -487,6 +492,9 @@ function IsOptional2(value) {
487
492
  function IsAny2(value) {
488
493
  return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
489
494
  }
495
+ function IsArgument2(value) {
496
+ return IsKindOf2(value, "Argument") && IsNumber(value.index);
497
+ }
490
498
  function IsArray4(value) {
491
499
  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);
492
500
  }
@@ -627,7 +635,7 @@ function IsKind2(value) {
627
635
  return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
628
636
  }
629
637
  function IsSchema2(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));
638
+ return IsObject(value) && (IsAny2(value) || IsArgument2(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));
631
639
  }
632
640
 
633
641
  // node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
@@ -675,6 +683,11 @@ function Array2(items, options) {
675
683
  return CreateType({ [Kind]: "Array", type: "array", items }, options);
676
684
  }
677
685
 
686
+ // node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
687
+ function Argument(index) {
688
+ return CreateType({ [Kind]: "Argument", index });
689
+ }
690
+
678
691
  // node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
679
692
  function AsyncIterator(items, options) {
680
693
  return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
@@ -1490,7 +1503,7 @@ function Const(T, options) {
1490
1503
 
1491
1504
  // node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1492
1505
  function ConstructorParameters(schema, options) {
1493
- return Tuple(schema.parameters, options);
1506
+ return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
1494
1507
  }
1495
1508
 
1496
1509
  // node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
@@ -1865,7 +1878,142 @@ function ExtractFromMappedResult(R, T) {
1865
1878
 
1866
1879
  // node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1867
1880
  function InstanceType(schema, options) {
1868
- return CreateType(schema.returns, options);
1881
+ return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
1882
+ }
1883
+
1884
+ // node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
1885
+ function ReadonlyOptional(schema) {
1886
+ return Readonly(Optional(schema));
1887
+ }
1888
+
1889
+ // node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
1890
+ function RecordCreateFromPattern(pattern, T, options) {
1891
+ return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
1892
+ }
1893
+ function RecordCreateFromKeys(K, T, options) {
1894
+ const result = {};
1895
+ for (const K2 of K)
1896
+ result[K2] = T;
1897
+ return Object2(result, { ...options, [Hint]: "Record" });
1898
+ }
1899
+ function FromTemplateLiteralKey(K, T, options) {
1900
+ return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
1901
+ }
1902
+ function FromUnionKey(key, type, options) {
1903
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
1904
+ }
1905
+ function FromLiteralKey(key, type, options) {
1906
+ return RecordCreateFromKeys([key.toString()], type, options);
1907
+ }
1908
+ function FromRegExpKey(key, type, options) {
1909
+ return RecordCreateFromPattern(key.source, type, options);
1910
+ }
1911
+ function FromStringKey(key, type, options) {
1912
+ const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
1913
+ return RecordCreateFromPattern(pattern, type, options);
1914
+ }
1915
+ function FromAnyKey(_, type, options) {
1916
+ return RecordCreateFromPattern(PatternStringExact, type, options);
1917
+ }
1918
+ function FromNeverKey(_key, type, options) {
1919
+ return RecordCreateFromPattern(PatternNeverExact, type, options);
1920
+ }
1921
+ function FromBooleanKey(_key, type, options) {
1922
+ return Object2({ true: type, false: type }, options);
1923
+ }
1924
+ function FromIntegerKey(_key, type, options) {
1925
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
1926
+ }
1927
+ function FromNumberKey(_, type, options) {
1928
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
1929
+ }
1930
+ function Record(key, type, options = {}) {
1931
+ return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean2(key) ? FromBooleanKey(key, 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);
1932
+ }
1933
+ function RecordPattern(record) {
1934
+ return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
1935
+ }
1936
+ function RecordKey2(type) {
1937
+ const pattern = RecordPattern(type);
1938
+ return pattern === PatternStringExact ? String() : pattern === PatternNumberExact ? Number2() : String({ pattern });
1939
+ }
1940
+ function RecordValue2(type) {
1941
+ return type.patternProperties[RecordPattern(type)];
1942
+ }
1943
+
1944
+ // node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
1945
+ function FromConstructor2(args, type) {
1946
+ type.parameters = FromTypes(args, type.parameters);
1947
+ type.returns = FromType(args, type.returns);
1948
+ return type;
1949
+ }
1950
+ function FromFunction2(args, type) {
1951
+ type.parameters = FromTypes(args, type.parameters);
1952
+ type.returns = FromType(args, type.returns);
1953
+ return type;
1954
+ }
1955
+ function FromIntersect5(args, type) {
1956
+ type.allOf = FromTypes(args, type.allOf);
1957
+ return type;
1958
+ }
1959
+ function FromUnion7(args, type) {
1960
+ type.anyOf = FromTypes(args, type.anyOf);
1961
+ return type;
1962
+ }
1963
+ function FromTuple4(args, type) {
1964
+ if (IsUndefined(type.items))
1965
+ return type;
1966
+ type.items = FromTypes(args, type.items);
1967
+ return type;
1968
+ }
1969
+ function FromArray5(args, type) {
1970
+ type.items = FromType(args, type.items);
1971
+ return type;
1972
+ }
1973
+ function FromAsyncIterator2(args, type) {
1974
+ type.items = FromType(args, type.items);
1975
+ return type;
1976
+ }
1977
+ function FromIterator2(args, type) {
1978
+ type.items = FromType(args, type.items);
1979
+ return type;
1980
+ }
1981
+ function FromPromise3(args, type) {
1982
+ type.item = FromType(args, type.item);
1983
+ return type;
1984
+ }
1985
+ function FromObject2(args, type) {
1986
+ const mappedProperties = FromProperties11(args, type.properties);
1987
+ return { ...type, ...Object2(mappedProperties) };
1988
+ }
1989
+ function FromRecord2(args, type) {
1990
+ const mappedKey = FromType(args, RecordKey2(type));
1991
+ const mappedValue = FromType(args, RecordValue2(type));
1992
+ const result = Record(mappedKey, mappedValue);
1993
+ return { ...type, ...result };
1994
+ }
1995
+ function FromArgument(args, argument) {
1996
+ return argument.index in args ? args[argument.index] : Unknown();
1997
+ }
1998
+ function FromProperty2(args, type) {
1999
+ const isReadonly = IsReadonly(type);
2000
+ const isOptional = IsOptional(type);
2001
+ const mapped = FromType(args, type);
2002
+ return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
2003
+ }
2004
+ function FromProperties11(args, properties) {
2005
+ return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
2006
+ return { ...result, [key]: FromProperty2(args, properties[key]) };
2007
+ }, {});
2008
+ }
2009
+ function FromTypes(args, types) {
2010
+ return types.map((type) => FromType(args, type));
2011
+ }
2012
+ function FromType(args, type) {
2013
+ return IsConstructor(type) ? FromConstructor2(args, type) : IsFunction2(type) ? FromFunction2(args, type) : IsIntersect(type) ? FromIntersect5(args, type) : IsUnion(type) ? FromUnion7(args, type) : IsTuple(type) ? FromTuple4(args, type) : IsArray3(type) ? FromArray5(args, type) : IsAsyncIterator2(type) ? FromAsyncIterator2(args, type) : IsIterator2(type) ? FromIterator2(args, type) : IsPromise(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject2(args, type) : IsRecord(type) ? FromRecord2(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
2014
+ }
2015
+ function Instantiate(type, args) {
2016
+ return FromType(args, CloneType(type));
1869
2017
  }
1870
2018
 
1871
2019
  // node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
@@ -1959,14 +2107,14 @@ function Uppercase(T, options = {}) {
1959
2107
  }
1960
2108
 
1961
2109
  // node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
1962
- function FromProperties11(properties, propertyKeys, options) {
2110
+ function FromProperties12(properties, propertyKeys, options) {
1963
2111
  const result = {};
1964
2112
  for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1965
2113
  result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
1966
2114
  return result;
1967
2115
  }
1968
2116
  function FromMappedResult9(mappedResult, propertyKeys, options) {
1969
- return FromProperties11(mappedResult.properties, propertyKeys, options);
2117
+ return FromProperties12(mappedResult.properties, propertyKeys, options);
1970
2118
  }
1971
2119
  function OmitFromMappedResult(mappedResult, propertyKeys, options) {
1972
2120
  const properties = FromMappedResult9(mappedResult, propertyKeys, options);
@@ -1974,22 +2122,22 @@ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
1974
2122
  }
1975
2123
 
1976
2124
  // node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
1977
- function FromIntersect5(types, propertyKeys) {
2125
+ function FromIntersect6(types, propertyKeys) {
1978
2126
  return types.map((type) => OmitResolve(type, propertyKeys));
1979
2127
  }
1980
- function FromUnion7(types, propertyKeys) {
2128
+ function FromUnion8(types, propertyKeys) {
1981
2129
  return types.map((type) => OmitResolve(type, propertyKeys));
1982
2130
  }
1983
- function FromProperty2(properties, key) {
2131
+ function FromProperty3(properties, key) {
1984
2132
  const { [key]: _, ...R } = properties;
1985
2133
  return R;
1986
2134
  }
1987
- function FromProperties12(properties, propertyKeys) {
1988
- return propertyKeys.reduce((T, K2) => FromProperty2(T, K2), properties);
2135
+ function FromProperties13(properties, propertyKeys) {
2136
+ return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
1989
2137
  }
1990
- function FromObject2(properties, propertyKeys) {
2138
+ function FromObject3(properties, propertyKeys) {
1991
2139
  const options = Discard(properties, [TransformKind, "$id", "required", "properties"]);
1992
- const omittedProperties = FromProperties12(properties["properties"], propertyKeys);
2140
+ const omittedProperties = FromProperties13(properties["properties"], propertyKeys);
1993
2141
  return Object2(omittedProperties, options);
1994
2142
  }
1995
2143
  function UnionFromPropertyKeys(propertyKeys) {
@@ -1997,7 +2145,7 @@ function UnionFromPropertyKeys(propertyKeys) {
1997
2145
  return Union(result);
1998
2146
  }
1999
2147
  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({});
2148
+ return IsIntersect(properties) ? Intersect(FromIntersect6(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion8(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject3(properties, propertyKeys) : Object2({});
2001
2149
  }
2002
2150
  function Omit(type, key, options) {
2003
2151
  const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
@@ -2025,14 +2173,14 @@ function OmitFromMappedKey(type, mappedKey, options) {
2025
2173
  }
2026
2174
 
2027
2175
  // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2028
- function FromProperties13(properties, propertyKeys, options) {
2176
+ function FromProperties14(properties, propertyKeys, options) {
2029
2177
  const result = {};
2030
2178
  for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2031
2179
  result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2032
2180
  return result;
2033
2181
  }
2034
2182
  function FromMappedResult10(mappedResult, propertyKeys, options) {
2035
- return FromProperties13(mappedResult.properties, propertyKeys, options);
2183
+ return FromProperties14(mappedResult.properties, propertyKeys, options);
2036
2184
  }
2037
2185
  function PickFromMappedResult(mappedResult, propertyKeys, options) {
2038
2186
  const properties = FromMappedResult10(mappedResult, propertyKeys, options);
@@ -2040,22 +2188,22 @@ function PickFromMappedResult(mappedResult, propertyKeys, options) {
2040
2188
  }
2041
2189
 
2042
2190
  // node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2043
- function FromIntersect6(types, propertyKeys) {
2191
+ function FromIntersect7(types, propertyKeys) {
2044
2192
  return types.map((type) => PickResolve(type, propertyKeys));
2045
2193
  }
2046
- function FromUnion8(types, propertyKeys) {
2194
+ function FromUnion9(types, propertyKeys) {
2047
2195
  return types.map((type) => PickResolve(type, propertyKeys));
2048
2196
  }
2049
- function FromProperties14(properties, propertyKeys) {
2197
+ function FromProperties15(properties, propertyKeys) {
2050
2198
  const result = {};
2051
2199
  for (const K2 of propertyKeys)
2052
2200
  if (K2 in properties)
2053
2201
  result[K2] = properties[K2];
2054
2202
  return result;
2055
2203
  }
2056
- function FromObject3(T, K) {
2204
+ function FromObject4(T, K) {
2057
2205
  const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
2058
- const properties = FromProperties14(T["properties"], K);
2206
+ const properties = FromProperties15(T["properties"], K);
2059
2207
  return Object2(properties, options);
2060
2208
  }
2061
2209
  function UnionFromPropertyKeys2(propertyKeys) {
@@ -2063,7 +2211,7 @@ function UnionFromPropertyKeys2(propertyKeys) {
2063
2211
  return Union(result);
2064
2212
  }
2065
2213
  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({});
2214
+ return IsIntersect(properties) ? Intersect(FromIntersect7(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion9(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject4(properties, propertyKeys) : Object2({});
2067
2215
  }
2068
2216
  function Pick(type, key, options) {
2069
2217
  const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
@@ -2099,22 +2247,31 @@ function FromComputed3(target, parameters) {
2099
2247
  function FromRef3($ref) {
2100
2248
  return Computed("Partial", [Ref($ref)]);
2101
2249
  }
2102
- function FromProperties15(properties) {
2250
+ function FromProperties16(properties) {
2103
2251
  const partialProperties = {};
2104
2252
  for (const K of globalThis.Object.getOwnPropertyNames(properties))
2105
2253
  partialProperties[K] = Optional(properties[K]);
2106
2254
  return partialProperties;
2107
2255
  }
2108
- function FromObject4(T) {
2109
- const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
2110
- const properties = FromProperties15(T["properties"]);
2256
+ function FromObject5(type) {
2257
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2258
+ const properties = FromProperties16(type["properties"]);
2111
2259
  return Object2(properties, options);
2112
2260
  }
2113
2261
  function FromRest6(types) {
2114
2262
  return types.map((type) => PartialResolve(type));
2115
2263
  }
2116
2264
  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({});
2265
+ return (
2266
+ // Mappable
2267
+ 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) ? FromObject5(type) : (
2268
+ // Intrinsic
2269
+ IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2270
+ // Passthrough
2271
+ Object2({})
2272
+ )
2273
+ )
2274
+ );
2118
2275
  }
2119
2276
  function Partial(type, options) {
2120
2277
  if (IsMappedResult(type)) {
@@ -2125,62 +2282,20 @@ function Partial(type, options) {
2125
2282
  }
2126
2283
 
2127
2284
  // node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2128
- function FromProperties16(K, options) {
2285
+ function FromProperties17(K, options) {
2129
2286
  const Acc = {};
2130
2287
  for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2131
2288
  Acc[K2] = Partial(K[K2], Clone(options));
2132
2289
  return Acc;
2133
2290
  }
2134
2291
  function FromMappedResult11(R, options) {
2135
- return FromProperties16(R.properties, options);
2292
+ return FromProperties17(R.properties, options);
2136
2293
  }
2137
2294
  function PartialFromMappedResult(R, options) {
2138
2295
  const P = FromMappedResult11(R, options);
2139
2296
  return MappedResult(P);
2140
2297
  }
2141
2298
 
2142
- // node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
2143
- function RecordCreateFromPattern(pattern, T, options) {
2144
- return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
2145
- }
2146
- function RecordCreateFromKeys(K, T, options) {
2147
- const result = {};
2148
- for (const K2 of K)
2149
- result[K2] = T;
2150
- return Object2(result, { ...options, [Hint]: "Record" });
2151
- }
2152
- function FromTemplateLiteralKey(K, T, options) {
2153
- return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2154
- }
2155
- function FromUnionKey(key, type, options) {
2156
- return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
2157
- }
2158
- function FromLiteralKey(key, type, options) {
2159
- return RecordCreateFromKeys([key.toString()], type, options);
2160
- }
2161
- function FromRegExpKey(key, type, options) {
2162
- return RecordCreateFromPattern(key.source, type, options);
2163
- }
2164
- function FromStringKey(key, type, options) {
2165
- const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
2166
- return RecordCreateFromPattern(pattern, type, options);
2167
- }
2168
- function FromAnyKey(_, type, options) {
2169
- return RecordCreateFromPattern(PatternStringExact, type, options);
2170
- }
2171
- function FromNeverKey(_key, type, options) {
2172
- return RecordCreateFromPattern(PatternNeverExact, type, options);
2173
- }
2174
- function FromIntegerKey(_key, type, options) {
2175
- return RecordCreateFromPattern(PatternNumberExact, type, options);
2176
- }
2177
- function FromNumberKey(_, type, options) {
2178
- return RecordCreateFromPattern(PatternNumberExact, type, options);
2179
- }
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);
2182
- }
2183
-
2184
2299
  // node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2185
2300
  function FromComputed4(target, parameters) {
2186
2301
  return Computed("Required", [Computed(target, parameters)]);
@@ -2188,22 +2303,31 @@ function FromComputed4(target, parameters) {
2188
2303
  function FromRef4($ref) {
2189
2304
  return Computed("Required", [Ref($ref)]);
2190
2305
  }
2191
- function FromProperties17(properties) {
2306
+ function FromProperties18(properties) {
2192
2307
  const requiredProperties = {};
2193
2308
  for (const K of globalThis.Object.getOwnPropertyNames(properties))
2194
2309
  requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2195
2310
  return requiredProperties;
2196
2311
  }
2197
- function FromObject5(type) {
2312
+ function FromObject6(type) {
2198
2313
  const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2199
- const properties = FromProperties17(type["properties"]);
2314
+ const properties = FromProperties18(type["properties"]);
2200
2315
  return Object2(properties, options);
2201
2316
  }
2202
2317
  function FromRest7(types) {
2203
2318
  return types.map((type) => RequiredResolve(type));
2204
2319
  }
2205
2320
  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({});
2321
+ return (
2322
+ // Mappable
2323
+ 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) ? FromObject6(type) : (
2324
+ // Intrinsic
2325
+ IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2326
+ // Passthrough
2327
+ Object2({})
2328
+ )
2329
+ )
2330
+ );
2207
2331
  }
2208
2332
  function Required(type, options) {
2209
2333
  if (IsMappedResult(type)) {
@@ -2214,14 +2338,14 @@ function Required(type, options) {
2214
2338
  }
2215
2339
 
2216
2340
  // node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2217
- function FromProperties18(P, options) {
2341
+ function FromProperties19(P, options) {
2218
2342
  const Acc = {};
2219
2343
  for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2220
2344
  Acc[K2] = Required(P[K2], options);
2221
2345
  return Acc;
2222
2346
  }
2223
2347
  function FromMappedResult12(R, options) {
2224
- return FromProperties18(R.properties, options);
2348
+ return FromProperties19(R.properties, options);
2225
2349
  }
2226
2350
  function RequiredFromMappedResult(R, options) {
2227
2351
  const P = FromMappedResult12(R, options);
@@ -2229,13 +2353,13 @@ function RequiredFromMappedResult(R, options) {
2229
2353
  }
2230
2354
 
2231
2355
  // node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2232
- function DerefParameters(moduleProperties, types) {
2356
+ function DereferenceParameters(moduleProperties, types) {
2233
2357
  return types.map((type) => {
2234
- return IsRef(type) ? Deref(moduleProperties, type.$ref) : FromType(moduleProperties, type);
2358
+ return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
2235
2359
  });
2236
2360
  }
2237
- function Deref(moduleProperties, ref) {
2238
- return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Deref(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
2361
+ function Dereference(moduleProperties, ref) {
2362
+ return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
2239
2363
  }
2240
2364
  function FromAwaited(parameters) {
2241
2365
  return Awaited(parameters[0]);
@@ -2255,59 +2379,68 @@ function FromOmit(parameters) {
2255
2379
  function FromPick(parameters) {
2256
2380
  return Pick(parameters[0], parameters[1]);
2257
2381
  }
2258
- function FromRecord2(parameters) {
2259
- return Record(parameters[0], parameters[1]);
2260
- }
2261
2382
  function FromRequired(parameters) {
2262
2383
  return Required(parameters[0]);
2263
2384
  }
2264
2385
  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();
2386
+ const dereferenced = DereferenceParameters(moduleProperties, parameters);
2387
+ return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
2267
2388
  }
2268
- function FromObject6(moduleProperties, properties) {
2269
- return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2270
- return { ...result, [key]: FromType(moduleProperties, properties[key]) };
2271
- }, {}));
2389
+ function FromArray6(moduleProperties, type) {
2390
+ return Array2(FromType2(moduleProperties, type));
2272
2391
  }
2273
- function FromConstructor2(moduleProperties, parameters, instanceType) {
2274
- return Constructor(FromRest8(moduleProperties, parameters), FromType(moduleProperties, instanceType));
2392
+ function FromAsyncIterator3(moduleProperties, type) {
2393
+ return AsyncIterator(FromType2(moduleProperties, type));
2275
2394
  }
2276
- function FromFunction2(moduleProperties, parameters, returnType) {
2277
- return Function(FromRest8(moduleProperties, parameters), FromType(moduleProperties, returnType));
2395
+ function FromConstructor3(moduleProperties, parameters, instanceType) {
2396
+ return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
2278
2397
  }
2279
- function FromTuple4(moduleProperties, types) {
2280
- return Tuple(FromRest8(moduleProperties, types));
2398
+ function FromFunction3(moduleProperties, parameters, returnType) {
2399
+ return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
2281
2400
  }
2282
- function FromIntersect7(moduleProperties, types) {
2283
- return Intersect(FromRest8(moduleProperties, types));
2401
+ function FromIntersect8(moduleProperties, types) {
2402
+ return Intersect(FromTypes2(moduleProperties, types));
2403
+ }
2404
+ function FromIterator3(moduleProperties, type) {
2405
+ return Iterator(FromType2(moduleProperties, type));
2406
+ }
2407
+ function FromObject7(moduleProperties, properties) {
2408
+ return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2409
+ return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
2410
+ }, {}));
2284
2411
  }
2285
- function FromUnion9(moduleProperties, types) {
2286
- return Union(FromRest8(moduleProperties, types));
2412
+ function FromRecord3(moduleProperties, type) {
2413
+ const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
2414
+ const result = CloneType(type);
2415
+ result.patternProperties[pattern] = value;
2416
+ return result;
2287
2417
  }
2288
- function FromArray5(moduleProperties, type) {
2289
- return Array2(FromType(moduleProperties, type));
2418
+ function FromTransform(moduleProperties, transform) {
2419
+ return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
2290
2420
  }
2291
- function FromAsyncIterator2(moduleProperties, type) {
2292
- return AsyncIterator(FromType(moduleProperties, type));
2421
+ function FromTuple5(moduleProperties, types) {
2422
+ return Tuple(FromTypes2(moduleProperties, types));
2293
2423
  }
2294
- function FromIterator2(moduleProperties, type) {
2295
- return Iterator(FromType(moduleProperties, type));
2424
+ function FromUnion10(moduleProperties, types) {
2425
+ return Union(FromTypes2(moduleProperties, types));
2296
2426
  }
2297
- function FromRest8(moduleProperties, types) {
2298
- return types.map((type) => FromType(moduleProperties, type));
2427
+ function FromTypes2(moduleProperties, types) {
2428
+ return types.map((type) => FromType2(moduleProperties, type));
2299
2429
  }
2300
- function FromType(moduleProperties, type) {
2430
+ function FromType2(moduleProperties, type) {
2301
2431
  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
2432
+ // Modifiers
2433
+ IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2434
+ // Transform
2435
+ IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
2436
+ // Types
2437
+ IsArray3(type) ? CreateType(FromArray6(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator3(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor3(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction3(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect8(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator3(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject7(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord3(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple5(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion10(moduleProperties, type.anyOf), type) : type
2438
+ )
2306
2439
  )
2307
2440
  );
2308
2441
  }
2309
2442
  function ComputeType(moduleProperties, key) {
2310
- return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
2443
+ return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
2311
2444
  }
2312
2445
  function ComputeModuleProperties(moduleProperties) {
2313
2446
  return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
@@ -2345,12 +2478,7 @@ function Not(type, options) {
2345
2478
 
2346
2479
  // node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2347
2480
  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));
2481
+ return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
2354
2482
  }
2355
2483
 
2356
2484
  // node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
@@ -2379,7 +2507,7 @@ function Rest(T) {
2379
2507
 
2380
2508
  // node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2381
2509
  function ReturnType(schema, options) {
2382
- return CreateType(schema.returns, options);
2510
+ return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
2383
2511
  }
2384
2512
 
2385
2513
  // node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
@@ -2428,6 +2556,7 @@ function Void(options) {
2428
2556
  var type_exports2 = {};
2429
2557
  __export(type_exports2, {
2430
2558
  Any: () => Any,
2559
+ Argument: () => Argument,
2431
2560
  Array: () => Array2,
2432
2561
  AsyncIterator: () => AsyncIterator,
2433
2562
  Awaited: () => Awaited,
@@ -2446,6 +2575,7 @@ __export(type_exports2, {
2446
2575
  Function: () => Function,
2447
2576
  Index: () => Index,
2448
2577
  InstanceType: () => InstanceType,
2578
+ Instantiate: () => Instantiate,
2449
2579
  Integer: () => Integer,
2450
2580
  Intersect: () => Intersect,
2451
2581
  Iterator: () => Iterator,
@@ -2523,7 +2653,9 @@ var jwt = ({
2523
2653
  iat: Type.Optional(Type.String())
2524
2654
  })
2525
2655
  ]),
2526
- {}
2656
+ {
2657
+ modules: Type.Module({})
2658
+ }
2527
2659
  ) : void 0;
2528
2660
  return new Elysia({
2529
2661
  name: "@elysiajs/jwt",