elysia 1.4.4 → 1.4.5

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.
@@ -2679,7 +2679,7 @@ var hasProperty = (expectedProperty, _schema) => {
2679
2679
  ...rest,
2680
2680
  ...v
2681
2681
  };
2682
- return delete value.required, properties2 && v.type === "string" && v.format === "ObjectString" && v.default === "{}" && (transform = t.ObjectString(properties2, rest), value.properties = properties2), items && v.type === "string" && v.format === "ArrayString" && v.default === "[]" && (transform = t.ArrayString(items, rest), value.items = items), value;
2682
+ return delete value.required, properties2 && v.type === "string" && v.format === "ObjectString" && v.default === "{}" ? (transform = t.ObjectString(properties2, rest), value.properties = properties2) : items && v.type === "string" && v.format === "ArrayString" && v.default === "[]" && (transform = t.ArrayString(items, rest), value.items = items), value;
2683
2683
  };
2684
2684
  if (isRoot) {
2685
2685
  if (properties2) {
@@ -2856,22 +2856,16 @@ var hasProperty = (expectedProperty, _schema) => {
2856
2856
  if (typeof s2 != "string") schema2 = s2;
2857
2857
  else if (schema2 = // @ts-expect-error private property
2858
2858
  modules && s2 in modules.$defs ? modules.Import(s2) : models[s2], !schema2) return;
2859
- let _doesHaveRef;
2860
- if (Kind3 in schema2 && schema2[Kind3] !== "Import" && (_doesHaveRef = hasRef(schema2))) {
2861
- let id = randomId();
2862
- doesHaveRef === void 0 && (doesHaveRef = _doesHaveRef), schema2 = t.Module({
2863
- // @ts-expect-error private property
2864
- ...modules?.$defs,
2865
- [id]: schema2
2866
- }).Import(id);
2867
- }
2868
2859
  if (Kind3 in schema2)
2869
- if (schema2[Kind3] === "Import") {
2870
- let newDefs = {};
2871
- for (let [key2, value] of Object.entries(schema2.$defs))
2872
- newDefs[key2] = replaceSchema(value);
2873
- let key = schema2.$ref;
2874
- schema2 = t.Module(newDefs).Import(key);
2860
+ if (schema2[Kind3] === "Import")
2861
+ hasRef(schema2.$defs[schema2.$ref]) || (schema2 = schema2.$defs[schema2.$ref], (coerce || additionalCoerce) && (schema2 = replaceSchema(schema2)));
2862
+ else if (hasRef(schema2)) {
2863
+ let id = randomId();
2864
+ schema2 = t.Module({
2865
+ // @ts-expect-error private property
2866
+ ...modules?.$defs,
2867
+ [id]: schema2
2868
+ }).Import(id);
2875
2869
  } else (coerce || additionalCoerce) && (schema2 = replaceSchema(schema2));
2876
2870
  return schema2;
2877
2871
  }, schema = mapSchema(s), _validators = validators;
@@ -2679,7 +2679,7 @@ var hasProperty = (expectedProperty, _schema) => {
2679
2679
  ...rest,
2680
2680
  ...v
2681
2681
  };
2682
- return delete value.required, properties2 && v.type === "string" && v.format === "ObjectString" && v.default === "{}" && (transform = t.ObjectString(properties2, rest), value.properties = properties2), items && v.type === "string" && v.format === "ArrayString" && v.default === "[]" && (transform = t.ArrayString(items, rest), value.items = items), value;
2682
+ return delete value.required, properties2 && v.type === "string" && v.format === "ObjectString" && v.default === "{}" ? (transform = t.ObjectString(properties2, rest), value.properties = properties2) : items && v.type === "string" && v.format === "ArrayString" && v.default === "[]" && (transform = t.ArrayString(items, rest), value.items = items), value;
2683
2683
  };
2684
2684
  if (isRoot) {
2685
2685
  if (properties2) {
@@ -2856,22 +2856,16 @@ var hasProperty = (expectedProperty, _schema) => {
2856
2856
  if (typeof s2 != "string") schema2 = s2;
2857
2857
  else if (schema2 = // @ts-expect-error private property
2858
2858
  modules && s2 in modules.$defs ? modules.Import(s2) : models[s2], !schema2) return;
2859
- let _doesHaveRef;
2860
- if (Kind3 in schema2 && schema2[Kind3] !== "Import" && (_doesHaveRef = hasRef(schema2))) {
2861
- let id = randomId();
2862
- doesHaveRef === void 0 && (doesHaveRef = _doesHaveRef), schema2 = t.Module({
2863
- // @ts-expect-error private property
2864
- ...modules?.$defs,
2865
- [id]: schema2
2866
- }).Import(id);
2867
- }
2868
2859
  if (Kind3 in schema2)
2869
- if (schema2[Kind3] === "Import") {
2870
- let newDefs = {};
2871
- for (let [key2, value] of Object.entries(schema2.$defs))
2872
- newDefs[key2] = replaceSchema(value);
2873
- let key = schema2.$ref;
2874
- schema2 = t.Module(newDefs).Import(key);
2860
+ if (schema2[Kind3] === "Import")
2861
+ hasRef(schema2.$defs[schema2.$ref]) || (schema2 = schema2.$defs[schema2.$ref], (coerce || additionalCoerce) && (schema2 = replaceSchema(schema2)));
2862
+ else if (hasRef(schema2)) {
2863
+ let id = randomId();
2864
+ schema2 = t.Module({
2865
+ // @ts-expect-error private property
2866
+ ...modules?.$defs,
2867
+ [id]: schema2
2868
+ }).Import(id);
2875
2869
  } else (coerce || additionalCoerce) && (schema2 = replaceSchema(schema2));
2876
2870
  return schema2;
2877
2871
  }, schema = mapSchema(s), _validators = validators;
@@ -9,7 +9,7 @@ import { PromiseGroup } from './utils';
9
9
  import { type DynamicHandler } from './dynamic-handle';
10
10
  import { ValidationError, type ParseError, type NotFoundError, type InternalServerError, type ElysiaCustomStatusResponse } from './error';
11
11
  import type { TraceHandler } from './trace';
12
- import type { ElysiaConfig, SingletonBase, DefinitionBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, PreHandler, BodyHandler, OptionalHandler, ErrorHandler, LifeCycleStore, MaybePromise, Prettify, Prettify2, AddPrefix, AddSuffix, AddPrefixCapitalize, AddSuffixCapitalize, MaybeArray, GracefulHandler, MapResponse, MacroToProperty, TransformHandler, MetadataBase, RouteBase, CreateEden, ComposeElysiaResponse, InlineHandler, HookContainer, LifeCycleType, EphemeralType, ExcludeElysiaResponse, ModelValidator, ContextAppendType, Reconcile, AfterResponseHandler, HigherOrderFunction, JoinPath, ValidatorLayer, MergeElysiaInstances, Macro, MacroToContext, StandaloneValidator, GuardSchemaType, Or, DocumentDecoration, AfterHandler, NonResolvableMacroKey, StandardSchemaV1Like, ElysiaHandlerToResponseSchema, ElysiaHandlerToResponseSchemas, ExtractErrorFromHandle, ElysiaHandlerToResponseSchemaAmbiguous, GuardLocalHook, PickIfExists, SimplifyToSchema, UnionResponseStatus, CreateEdenResponse, MacroProperty, MaybeValueOrVoidFunction } from './types';
12
+ import type { ElysiaConfig, SingletonBase, DefinitionBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, PreHandler, BodyHandler, OptionalHandler, ErrorHandler, LifeCycleStore, MaybePromise, Prettify, Prettify2, AddPrefix, AddSuffix, AddPrefixCapitalize, AddSuffixCapitalize, MaybeArray, GracefulHandler, MapResponse, MacroToProperty, TransformHandler, MetadataBase, RouteBase, CreateEden, ComposeElysiaResponse, InlineHandler, HookContainer, LifeCycleType, EphemeralType, ExcludeElysiaResponse, ModelValidator, ContextAppendType, Reconcile, AfterResponseHandler, HigherOrderFunction, JoinPath, ValidatorLayer, MergeElysiaInstances, Macro, MacroToContext, StandaloneValidator, GuardSchemaType, Or, DocumentDecoration, AfterHandler, NonResolvableMacroKey, StandardSchemaV1Like, ElysiaHandlerToResponseSchema, ElysiaHandlerToResponseSchemas, ExtractErrorFromHandle, ElysiaHandlerToResponseSchemaAmbiguous, GuardLocalHook, PickIfExists, SimplifyToSchema, UnionResponseStatus, CreateEdenResponse, MacroProperty, MaybeValueOrVoidFunction, IntersectIfObjectSchema } from './types';
13
13
  export type AnyElysia = Elysia<any, any, any, any, any, any, any>;
14
14
  /**
15
15
  * ### Elysia Server
@@ -1270,25 +1270,21 @@ export default class Elysia<const in out BasePath extends string = '', const in
1270
1270
  parser: Metadata['parser'];
1271
1271
  response: Metadata['response'];
1272
1272
  }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Singleton, Definitions, Metadata, Prettify<Routes & NewElysia['~Routes']>, Ephemeral, Volatile>;
1273
- group<const Prefix extends string, const NewElysia extends AnyElysia, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Prefix>>, Metadata['schema']> & Metadata['standaloneSchema']>(prefix: Prefix, schema: LocalHook<Input, Schema & {
1274
- response: {};
1275
- return: {};
1276
- resolve: {};
1277
- }, Singleton & {
1273
+ group<const Prefix extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Prefix>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<Definitions['error'], Schema, Singleton>>, const NewElysia extends AnyElysia>(prefix: Prefix, schema: GuardLocalHook<Input, Schema & MacroContext, Singleton & {
1278
1274
  derive: Ephemeral['derive'] & Volatile['derive'];
1279
- resolve: Ephemeral['resolve'] & Volatile['resolve'];
1280
- }, Definitions['error'], keyof Metadata['parser']>, run: (group: Elysia<JoinPath<BasePath, Prefix>, {
1275
+ resolve: Ephemeral['resolve'] & Volatile['resolve'] & MacroContext['response'];
1276
+ }, keyof Metadata['parser'], BeforeHandle, AfterHandle, ErrorHandle>, run: (group: Elysia<JoinPath<BasePath, Prefix>, {
1281
1277
  decorator: Singleton['decorator'];
1282
1278
  store: Singleton['store'];
1283
- derive: Prettify<Singleton['derive'] & Ephemeral['derive'] & Volatile['derive']>;
1284
- resolve: Prettify<Singleton['resolve'] & Ephemeral['resolve'] & Volatile['resolve']>;
1279
+ derive: Singleton['derive'];
1280
+ resolve: Prettify<Singleton['resolve'] & MacroContext['resolve']>;
1285
1281
  }, Definitions, {
1286
1282
  schema: Schema;
1287
- standaloneSchema: Metadata['standaloneSchema'];
1283
+ standaloneSchema: Metadata['standaloneSchema'] & Schema & MacroContext;
1288
1284
  macro: Metadata['macro'];
1289
1285
  macroFn: Metadata['macroFn'];
1290
1286
  parser: Metadata['parser'];
1291
- response: Metadata['response'];
1287
+ response: Metadata['response'] & MacroContext['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle>;
1292
1288
  }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & NewElysia['~Routes'], Ephemeral, Volatile>;
1293
1289
  /**
1294
1290
  * ### guard
@@ -1308,10 +1304,10 @@ export default class Elysia<const in out BasePath extends string = '', const in
1308
1304
  * })
1309
1305
  * ```
1310
1306
  */
1311
- guard<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, Metadata['schema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], NoInfer<Omit<Input, keyof InputSchema>>>, const GuardType extends GuardSchemaType, const AsType extends LifeCycleType, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<Definitions['error'], Schema, Singleton>>>(hook: GuardLocalHook<Input, Schema, Singleton & {
1307
+ guard<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, Metadata['schema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], NoInfer<Omit<Input, keyof InputSchema>>>, const GuardType extends GuardSchemaType, const AsType extends LifeCycleType, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<Definitions['error'], Schema, Singleton>>>(hook: GuardLocalHook<Input, Schema & MacroContext, Singleton & {
1312
1308
  derive: Ephemeral['derive'] & Volatile['derive'];
1313
- resolve: Ephemeral['resolve'] & Volatile['resolve'];
1314
- }, keyof Metadata['parser'], GuardType, AsType, BeforeHandle, AfterHandle, ErrorHandle>): Or<GuardSchemaType extends GuardType ? true : false, GuardType extends 'override' ? true : false> extends true ? Or<LifeCycleType extends AsType ? true : false, AsType extends 'local' ? true : false> extends true ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
1309
+ resolve: Ephemeral['resolve'] & Volatile['resolve'] & MacroContext['response'];
1310
+ }, keyof Metadata['parser'], BeforeHandle, AfterHandle, ErrorHandle, GuardType, AsType>): Or<GuardSchemaType extends GuardType ? true : false, GuardType extends 'override' ? true : false> extends true ? Or<LifeCycleType extends AsType ? true : false, AsType extends 'local' ? true : false> extends true ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
1315
1311
  derive: Volatile['derive'];
1316
1312
  resolve: Prettify<Volatile['resolve'] & MacroContext['resolve']>;
1317
1313
  schema: {} extends PickIfExists<Input, keyof InputSchema> ? Volatile['schema'] : Prettify<MergeSchema<UnwrapRoute<Input, Definitions['typebox']>, Metadata['schema']>>;
@@ -1360,27 +1356,27 @@ export default class Elysia<const in out BasePath extends string = '', const in
1360
1356
  standaloneSchema: Prettify<SimplifyToSchema<MacroContext> & ({} extends PickIfExists<Input, keyof InputSchema> ? Ephemeral['standaloneSchema'] : Ephemeral['standaloneSchema'] & UnwrapRoute<Input, Definitions['typebox']>)>;
1361
1357
  response: Prettify<Ephemeral['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return']>;
1362
1358
  }, Volatile>;
1363
- guard<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const NewElysia extends AnyElysia, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, Metadata['schema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], NoInfer<Omit<Input, keyof InputSchema>>>>(schema: LocalHook<Input, Schema & MacroContext, Singleton & {
1359
+ guard<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<any, Schema, Singleton>>, const NewElysia extends AnyElysia>(schema: GuardLocalHook<Input, Schema & MacroContext, Singleton & {
1364
1360
  derive: Ephemeral['derive'] & Volatile['derive'];
1365
1361
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1366
- }, Definitions['error'], keyof Metadata['parser']>, run: (group: Elysia<BasePath, {
1362
+ }, keyof Metadata['parser'], BeforeHandle, AfterHandle, ErrorHandle>, run: (group: Elysia<BasePath, {
1367
1363
  decorator: Singleton['decorator'];
1368
1364
  store: Singleton['store'];
1369
1365
  derive: Singleton['derive'];
1370
1366
  resolve: Prettify<Singleton['resolve'] & MacroContext['resolve']>;
1371
1367
  }, Definitions, {
1372
1368
  schema: Schema;
1373
- standaloneSchema: Metadata['standaloneSchema'];
1369
+ standaloneSchema: Metadata['standaloneSchema'] & Schema & MacroContext;
1374
1370
  macro: Metadata['macro'];
1375
1371
  macroFn: Metadata['macroFn'];
1376
1372
  parser: Metadata['parser'];
1377
- response: Metadata['response'];
1373
+ response: Metadata['response'] & MacroContext['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle>;
1378
1374
  }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Singleton, Definitions, Metadata, Prettify<Routes & NewElysia['~Routes']>, Ephemeral, {
1379
1375
  derive: Volatile['derive'];
1380
1376
  resolve: Prettify<Volatile['resolve'] & MacroContext['resolve']>;
1381
1377
  schema: Volatile['schema'];
1382
1378
  standaloneSchema: Volatile['standaloneSchema'];
1383
- response: Volatile['response'];
1379
+ response: Volatile['response'] & MacroContext['response'];
1384
1380
  }>;
1385
1381
  /**
1386
1382
  * Inline fn
@@ -1457,7 +1453,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1457
1453
  private _use;
1458
1454
  macro<const Name extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Property extends MaybeValueOrVoidFunction<MacroProperty<Schema & MacroContext, Singleton & {
1459
1455
  derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
1460
- resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
1456
+ resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']> & MacroContext['resolve'];
1461
1457
  }, Definitions['error']>>>(name: Name, macro: (Input extends any ? Input : Prettify<Input>) & Property): Elysia<BasePath, Singleton, Definitions, {
1462
1458
  schema: Metadata['schema'];
1463
1459
  standaloneSchema: Metadata['standaloneSchema'];
@@ -1504,7 +1500,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1504
1500
  * })
1505
1501
  * ```
1506
1502
  */
1507
- get<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1503
+ get<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1508
1504
  derive: Ephemeral['derive'] & Volatile['derive'];
1509
1505
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1510
1506
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, Decorator, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1526,7 +1522,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1526
1522
  * })
1527
1523
  * ```
1528
1524
  */
1529
- post<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1525
+ post<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1530
1526
  derive: Ephemeral['derive'] & Volatile['derive'];
1531
1527
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1532
1528
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1548,7 +1544,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1548
1544
  * })
1549
1545
  * ```
1550
1546
  */
1551
- put<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1547
+ put<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1552
1548
  derive: Ephemeral['derive'] & Volatile['derive'];
1553
1549
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1554
1550
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1570,7 +1566,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1570
1566
  * })
1571
1567
  * ```
1572
1568
  */
1573
- patch<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1569
+ patch<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1574
1570
  derive: Ephemeral['derive'] & Volatile['derive'];
1575
1571
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1576
1572
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1592,7 +1588,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1592
1588
  * })
1593
1589
  * ```
1594
1590
  */
1595
- delete<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1591
+ delete<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1596
1592
  derive: Ephemeral['derive'] & Volatile['derive'];
1597
1593
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1598
1594
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1614,7 +1610,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1614
1610
  * })
1615
1611
  * ```
1616
1612
  */
1617
- options<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1613
+ options<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1618
1614
  derive: Ephemeral['derive'] & Volatile['derive'];
1619
1615
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1620
1616
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1636,7 +1632,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1636
1632
  * })
1637
1633
  * ```
1638
1634
  */
1639
- all<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1635
+ all<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1640
1636
  derive: Ephemeral['derive'] & Volatile['derive'];
1641
1637
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1642
1638
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1658,7 +1654,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1658
1654
  * })
1659
1655
  * ```
1660
1656
  */
1661
- head<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1657
+ head<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1662
1658
  derive: Ephemeral['derive'] & Volatile['derive'];
1663
1659
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1664
1660
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1680,7 +1676,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1680
1676
  * })
1681
1677
  * ```
1682
1678
  */
1683
- connect<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1679
+ connect<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1684
1680
  derive: Ephemeral['derive'] & Volatile['derive'];
1685
1681
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1686
1682
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
@@ -1702,7 +1698,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1702
1698
  * })
1703
1699
  * ```
1704
1700
  */
1705
- route<const Method extends HTTPMethod, const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const Decorator extends Singleton & {
1701
+ route<const Method extends HTTPMethod, const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
1706
1702
  derive: Ephemeral['derive'] & Volatile['derive'];
1707
1703
  resolve: Ephemeral['resolve'] & Volatile['resolve'];
1708
1704
  }, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(method: Method, path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Definitions['error'], keyof Metadata['parser']> & {
@@ -1730,7 +1726,7 @@ export default class Elysia<const in out BasePath extends string = '', const in
1730
1726
  * })
1731
1727
  * ```
1732
1728
  */
1733
- ws<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>>>(path: Path, options: WSLocalHook<Input, Schema, Singleton & {
1729
+ ws<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>>>(path: Path, options: WSLocalHook<Input, Schema, Singleton & {
1734
1730
  derive: Ephemeral['derive'] & Volatile['derive'];
1735
1731
  resolve: Ephemeral['resolve'] & Volatile['resolve'] & MacroContext['resolve'];
1736
1732
  }>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {