phecda-server 5.2.6 → 5.3.1

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.
Files changed (51) hide show
  1. package/dist/{chunk-AUAAKHWS.js → chunk-ODUYOCDF.js} +1 -6
  2. package/dist/{chunk-5E2AVYP2.mjs → chunk-ORQAEOSE.mjs} +1 -6
  3. package/dist/index.d.mts +11 -5
  4. package/dist/index.d.ts +11 -5
  5. package/dist/index.js +27 -7
  6. package/dist/index.mjs +28 -8
  7. package/dist/rpc/bullmq/index.d.mts +1 -1
  8. package/dist/rpc/bullmq/index.d.ts +1 -1
  9. package/dist/rpc/kafka/index.d.mts +1 -1
  10. package/dist/rpc/kafka/index.d.ts +1 -1
  11. package/dist/rpc/nats/index.d.mts +1 -1
  12. package/dist/rpc/nats/index.d.ts +1 -1
  13. package/dist/rpc/rabbitmq/index.d.mts +1 -1
  14. package/dist/rpc/rabbitmq/index.d.ts +1 -1
  15. package/dist/rpc/redis/index.d.mts +1 -1
  16. package/dist/rpc/redis/index.d.ts +1 -1
  17. package/dist/server/elysia/index.d.mts +1 -1
  18. package/dist/server/elysia/index.d.ts +1 -1
  19. package/dist/server/elysia/index.js +22 -4
  20. package/dist/server/elysia/index.mjs +21 -3
  21. package/dist/server/express/index.d.mts +1 -1
  22. package/dist/server/express/index.d.ts +1 -1
  23. package/dist/server/express/index.js +19 -5
  24. package/dist/server/express/index.mjs +19 -5
  25. package/dist/server/fastify/index.d.mts +1 -1
  26. package/dist/server/fastify/index.d.ts +1 -1
  27. package/dist/server/fastify/index.js +25 -7
  28. package/dist/server/fastify/index.mjs +24 -6
  29. package/dist/server/h3/index.d.mts +1 -1
  30. package/dist/server/h3/index.d.ts +1 -1
  31. package/dist/server/h3/index.js +14 -2
  32. package/dist/server/h3/index.mjs +15 -3
  33. package/dist/server/hono/index.d.mts +1 -1
  34. package/dist/server/hono/index.d.ts +1 -1
  35. package/dist/server/hono/index.js +19 -2
  36. package/dist/server/hono/index.mjs +19 -2
  37. package/dist/server/hyper-express/index.d.mts +1 -1
  38. package/dist/server/hyper-express/index.d.ts +1 -1
  39. package/dist/server/hyper-express/index.js +15 -3
  40. package/dist/server/hyper-express/index.mjs +14 -2
  41. package/dist/server/koa/index.d.mts +1 -1
  42. package/dist/server/koa/index.d.ts +1 -1
  43. package/dist/server/koa/index.js +19 -5
  44. package/dist/server/koa/index.mjs +19 -5
  45. package/dist/{types-vF4Hvnvo.d.mts → types-AgVwUXPC.d.mts} +1 -1
  46. package/dist/{types-CJSkC9tO.d.ts → types-B-ZFZajI.d.ts} +1 -1
  47. package/dist/types-BCJhmpQh.d.ts +45 -0
  48. package/dist/types-Dgxirc9f.d.mts +45 -0
  49. package/package.json +2 -2
  50. package/dist/types-Dp5ixUqW.d.mts +0 -27
  51. package/dist/types-PY43OKEP.d.ts +0 -27
@@ -213,10 +213,6 @@ _chunkRVWBJ6LVjs.__name.call(void 0, Rpc, "Rpc");
213
213
 
214
214
  // src/decorators/ctx.ts
215
215
 
216
- function Injectable() {
217
- return (target) => _phecdacore.Empty.call(void 0, target);
218
- }
219
- _chunkRVWBJ6LVjs.__name.call(void 0, Injectable, "Injectable");
220
216
  var Ctx = /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (target, key) => {
221
217
  _phecdacore.setPropertyState.call(void 0, target, _phecdacore.SHARE_KEY, (state) => {
222
218
  if (!state.ctxs) state.ctxs = /* @__PURE__ */ new Set([
@@ -280,5 +276,4 @@ _chunkRVWBJ6LVjs.__name.call(void 0, Define, "Define");
280
276
 
281
277
 
282
278
 
283
-
284
- exports.BaseParam = BaseParam; exports.Body = Body; exports.Head = Head; exports.Query = Query; exports.Param = Param; exports.Arg = Arg; exports.Guard = Guard; exports.Plugin = Plugin; exports.Interceptor = Interceptor; exports.Filter = Filter; exports.Pipe = Pipe; exports.Route = Route; exports.Header = Header; exports.Get = Get; exports.Post = Post; exports.Put = Put; exports.Patch = Patch; exports.Delete = Delete; exports.Controller = Controller; exports.Event = Event; exports.Queue = Queue; exports.Rpc = Rpc; exports.Injectable = Injectable; exports.Ctx = Ctx; exports.Define = Define;
279
+ exports.BaseParam = BaseParam; exports.Body = Body; exports.Head = Head; exports.Query = Query; exports.Param = Param; exports.Arg = Arg; exports.Guard = Guard; exports.Plugin = Plugin; exports.Interceptor = Interceptor; exports.Filter = Filter; exports.Pipe = Pipe; exports.Route = Route; exports.Header = Header; exports.Get = Get; exports.Post = Post; exports.Put = Put; exports.Patch = Patch; exports.Delete = Delete; exports.Controller = Controller; exports.Event = Event; exports.Queue = Queue; exports.Rpc = Rpc; exports.Ctx = Ctx; exports.Define = Define;
@@ -212,11 +212,7 @@ function Rpc() {
212
212
  __name(Rpc, "Rpc");
213
213
 
214
214
  // src/decorators/ctx.ts
215
- import { Empty, SHARE_KEY, getState as getState5, setPropertyState as setPropertyState5 } from "phecda-core";
216
- function Injectable() {
217
- return (target) => Empty(target);
218
- }
219
- __name(Injectable, "Injectable");
215
+ import { SHARE_KEY, getState as getState5, setPropertyState as setPropertyState5 } from "phecda-core";
220
216
  var Ctx = /* @__PURE__ */ __name((target, key) => {
221
217
  setPropertyState5(target, SHARE_KEY, (state) => {
222
218
  if (!state.ctxs) state.ctxs = /* @__PURE__ */ new Set([
@@ -278,7 +274,6 @@ export {
278
274
  Event,
279
275
  Queue,
280
276
  Rpc,
281
- Injectable,
282
277
  Ctx,
283
278
  Define
284
279
  };
package/dist/index.d.mts CHANGED
@@ -4,8 +4,10 @@ import { G as Generator } from './core-Bc2ENEHX.mjs';
4
4
  export { F as Factory, O as Options, c as createPhecda, e as emitter } from './core-Bc2ENEHX.mjs';
5
5
  import { Base, Construct, AbConstruct } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- export { a as HttpContext, H as HttpOptions } from './types-Dp5ixUqW.mjs';
8
- export { a as RpcClientOptions, b as RpcContext, R as RpcServerOptions } from './types-vF4Hvnvo.mjs';
7
+ import { H as HttpContext } from './types-Dgxirc9f.mjs';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-Dgxirc9f.mjs';
9
+ import { R as RpcContext } from './types-AgVwUXPC.mjs';
10
+ export { b as RpcClientOptions, a as RpcServerOptions } from './types-AgVwUXPC.mjs';
9
11
  import 'node:http';
10
12
 
11
13
  declare class Exception extends Error {
@@ -169,16 +171,20 @@ declare function Event(isEvent?: boolean): (target: any, k?: PropertyKey) => voi
169
171
  declare function Queue(queue?: string): (target: any, k?: PropertyKey) => void;
170
172
  declare function Rpc(): ClassDecorator;
171
173
 
172
- declare function Injectable(): (target: any) => void;
173
174
  declare const Ctx: PropertyDecorator;
174
175
  declare function Define(key: string, value: any): any;
175
176
 
176
177
  declare const defaultPipe: PipeType;
177
178
 
178
179
  declare class ServerBase extends Base {
179
- protected context: BaseContext;
180
180
  emitter: Emitter;
181
181
  }
182
+ declare class HttpBase extends ServerBase {
183
+ context: HttpContext;
184
+ }
185
+ declare class RpcBase extends ServerBase {
186
+ context: RpcContext;
187
+ }
182
188
 
183
189
  declare abstract class PFilter<C extends BaseContext = any, E extends Exception = Exception> extends ServerBase {
184
190
  readonly key: PropertyKey;
@@ -241,4 +247,4 @@ declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): voi
241
247
  declare function log(msg: string, level?: LogLevel): void;
242
248
  declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
243
249
 
244
- export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, Injectable, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
250
+ export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
package/dist/index.d.ts CHANGED
@@ -4,8 +4,10 @@ import { G as Generator } from './core-dx9E5x2N.js';
4
4
  export { F as Factory, O as Options, c as createPhecda, e as emitter } from './core-dx9E5x2N.js';
5
5
  import { Base, Construct, AbConstruct } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- export { a as HttpContext, H as HttpOptions } from './types-PY43OKEP.js';
8
- export { a as RpcClientOptions, b as RpcContext, R as RpcServerOptions } from './types-CJSkC9tO.js';
7
+ import { H as HttpContext } from './types-BCJhmpQh.js';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-BCJhmpQh.js';
9
+ import { R as RpcContext } from './types-B-ZFZajI.js';
10
+ export { b as RpcClientOptions, a as RpcServerOptions } from './types-B-ZFZajI.js';
9
11
  import 'node:http';
10
12
 
11
13
  declare class Exception extends Error {
@@ -169,16 +171,20 @@ declare function Event(isEvent?: boolean): (target: any, k?: PropertyKey) => voi
169
171
  declare function Queue(queue?: string): (target: any, k?: PropertyKey) => void;
170
172
  declare function Rpc(): ClassDecorator;
171
173
 
172
- declare function Injectable(): (target: any) => void;
173
174
  declare const Ctx: PropertyDecorator;
174
175
  declare function Define(key: string, value: any): any;
175
176
 
176
177
  declare const defaultPipe: PipeType;
177
178
 
178
179
  declare class ServerBase extends Base {
179
- protected context: BaseContext;
180
180
  emitter: Emitter;
181
181
  }
182
+ declare class HttpBase extends ServerBase {
183
+ context: HttpContext;
184
+ }
185
+ declare class RpcBase extends ServerBase {
186
+ context: RpcContext;
187
+ }
182
188
 
183
189
  declare abstract class PFilter<C extends BaseContext = any, E extends Exception = Exception> extends ServerBase {
184
190
  readonly key: PropertyKey;
@@ -241,4 +247,4 @@ declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): voi
241
247
  declare function log(msg: string, level?: LogLevel): void;
242
248
  declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
243
249
 
244
- export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, Injectable, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
250
+ export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
package/dist/index.js CHANGED
@@ -29,8 +29,7 @@ var _chunkN4ULJDEQjs = require('./chunk-N4ULJDEQ.js');
29
29
 
30
30
 
31
31
 
32
-
33
- var _chunkAUAAKHWSjs = require('./chunk-AUAAKHWS.js');
32
+ var _chunkODUYOCDFjs = require('./chunk-ODUYOCDF.js');
34
33
 
35
34
 
36
35
 
@@ -88,16 +87,36 @@ function _ts_decorate(decorators, target, key, desc) {
88
87
  return c > 3 && r && Object.defineProperty(target, key, r), r;
89
88
  }
90
89
  _chunkRVWBJ6LVjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
90
+ function _ts_metadata(k, v) {
91
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
92
+ }
93
+ _chunkRVWBJ6LVjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
91
94
  var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
92
95
  static {
93
96
  _chunkRVWBJ6LVjs.__name.call(void 0, this, "ServerBase");
94
97
  }
95
-
96
98
  __init() {this.emitter = exports.emitter = _chunkN4ULJDEQjs.emitter}
97
99
  }, _class);
98
- ServerBase = exports.ServerBase = _ts_decorate([
99
- _phecdacore.Empty
100
- ], ServerBase);
100
+ var HttpBase = class extends ServerBase {
101
+ static {
102
+ _chunkRVWBJ6LVjs.__name.call(void 0, this, "HttpBase");
103
+ }
104
+
105
+ };
106
+ _ts_decorate([
107
+ _chunkODUYOCDFjs.Ctx,
108
+ _ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
109
+ ], HttpBase.prototype, "context", void 0);
110
+ var RpcBase = class extends ServerBase {
111
+ static {
112
+ _chunkRVWBJ6LVjs.__name.call(void 0, this, "RpcBase");
113
+ }
114
+
115
+ };
116
+ _ts_decorate([
117
+ _chunkODUYOCDFjs.Ctx,
118
+ _ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
119
+ ], RpcBase.prototype, "context", void 0);
101
120
 
102
121
  // src/modules/filter.ts
103
122
 
@@ -398,4 +417,5 @@ return ret
398
417
 
399
418
 
400
419
 
401
- exports.Arg = _chunkAUAAKHWSjs.Arg; exports.BadGatewayException = _chunkQYX5Q7KOjs.BadGatewayException; exports.BadRequestException = _chunkQYX5Q7KOjs.BadRequestException; exports.BaseParam = _chunkAUAAKHWSjs.BaseParam; exports.Body = _chunkAUAAKHWSjs.Body; exports.ConflictException = _chunkQYX5Q7KOjs.ConflictException; exports.Context = _chunkQYX5Q7KOjs.Context; exports.Controller = _chunkAUAAKHWSjs.Controller; exports.Ctx = _chunkAUAAKHWSjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkAUAAKHWSjs.Define; exports.Delete = _chunkAUAAKHWSjs.Delete; exports.ERROR_SYMBOL = _chunkRVWBJ6LVjs.ERROR_SYMBOL; exports.Event = _chunkAUAAKHWSjs.Event; exports.Exception = _chunkQYX5Q7KOjs.Exception; exports.Factory = _chunkN4ULJDEQjs.Factory; exports.Filter = _chunkAUAAKHWSjs.Filter; exports.ForbiddenException = _chunkQYX5Q7KOjs.ForbiddenException; exports.FrameworkException = _chunkQYX5Q7KOjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkAUAAKHWSjs.Get; exports.Guard = _chunkAUAAKHWSjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkAUAAKHWSjs.Head; exports.Header = _chunkAUAAKHWSjs.Header; exports.IS_HMR = _chunkRVWBJ6LVjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkRVWBJ6LVjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkRVWBJ6LVjs.IS_STRICT; exports.Injectable = _chunkAUAAKHWSjs.Injectable; exports.Interceptor = _chunkAUAAKHWSjs.Interceptor; exports.InvalidInputException = _chunkQYX5Q7KOjs.InvalidInputException; exports.LOG_LEVEL = _chunkRVWBJ6LVjs.LOG_LEVEL; exports.Meta = _chunkN4ULJDEQjs.Meta; exports.Mix = _chunkRVWBJ6LVjs.Mix; exports.NotFoundException = _chunkQYX5Q7KOjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkRVWBJ6LVjs.PS_EXIT_CODE; exports.Param = _chunkAUAAKHWSjs.Param; exports.Patch = _chunkAUAAKHWSjs.Patch; exports.PayloadLargeException = _chunkQYX5Q7KOjs.PayloadLargeException; exports.Pipe = _chunkAUAAKHWSjs.Pipe; exports.Plugin = _chunkAUAAKHWSjs.Plugin; exports.Post = _chunkAUAAKHWSjs.Post; exports.Put = _chunkAUAAKHWSjs.Put; exports.Query = _chunkAUAAKHWSjs.Query; exports.Queue = _chunkAUAAKHWSjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkAUAAKHWSjs.Route; exports.Rpc = _chunkAUAAKHWSjs.Rpc; exports.ServerBase = ServerBase; exports.ServiceUnavailableException = _chunkQYX5Q7KOjs.ServiceUnavailableException; exports.TimeoutException = _chunkQYX5Q7KOjs.TimeoutException; exports.TimerException = _chunkQYX5Q7KOjs.TimerException; exports.UnauthorizedException = _chunkQYX5Q7KOjs.UnauthorizedException; exports.UndefinedException = _chunkQYX5Q7KOjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkQYX5Q7KOjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkQYX5Q7KOjs.ValidateException; exports.WorkerException = _chunkQYX5Q7KOjs.WorkerException; exports.addFilter = _chunkQYX5Q7KOjs.addFilter; exports.addGuard = _chunkQYX5Q7KOjs.addGuard; exports.addInterceptor = _chunkQYX5Q7KOjs.addInterceptor; exports.addPipe = _chunkQYX5Q7KOjs.addPipe; exports.addPlugin = _chunkQYX5Q7KOjs.addPlugin; exports.createPhecda = _chunkN4ULJDEQjs.createPhecda; exports.defaultPipe = _chunkQYX5Q7KOjs.defaultPipe; exports.emitter = _chunkN4ULJDEQjs.emitter; exports.log = _chunkRVWBJ6LVjs.log; exports.setLogger = _chunkRVWBJ6LVjs.setLogger;
420
+
421
+ exports.Arg = _chunkODUYOCDFjs.Arg; exports.BadGatewayException = _chunkQYX5Q7KOjs.BadGatewayException; exports.BadRequestException = _chunkQYX5Q7KOjs.BadRequestException; exports.BaseParam = _chunkODUYOCDFjs.BaseParam; exports.Body = _chunkODUYOCDFjs.Body; exports.ConflictException = _chunkQYX5Q7KOjs.ConflictException; exports.Context = _chunkQYX5Q7KOjs.Context; exports.Controller = _chunkODUYOCDFjs.Controller; exports.Ctx = _chunkODUYOCDFjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkODUYOCDFjs.Define; exports.Delete = _chunkODUYOCDFjs.Delete; exports.ERROR_SYMBOL = _chunkRVWBJ6LVjs.ERROR_SYMBOL; exports.Event = _chunkODUYOCDFjs.Event; exports.Exception = _chunkQYX5Q7KOjs.Exception; exports.Factory = _chunkN4ULJDEQjs.Factory; exports.Filter = _chunkODUYOCDFjs.Filter; exports.ForbiddenException = _chunkQYX5Q7KOjs.ForbiddenException; exports.FrameworkException = _chunkQYX5Q7KOjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkODUYOCDFjs.Get; exports.Guard = _chunkODUYOCDFjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkODUYOCDFjs.Head; exports.Header = _chunkODUYOCDFjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkRVWBJ6LVjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkRVWBJ6LVjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkRVWBJ6LVjs.IS_STRICT; exports.Interceptor = _chunkODUYOCDFjs.Interceptor; exports.InvalidInputException = _chunkQYX5Q7KOjs.InvalidInputException; exports.LOG_LEVEL = _chunkRVWBJ6LVjs.LOG_LEVEL; exports.Meta = _chunkN4ULJDEQjs.Meta; exports.Mix = _chunkRVWBJ6LVjs.Mix; exports.NotFoundException = _chunkQYX5Q7KOjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkRVWBJ6LVjs.PS_EXIT_CODE; exports.Param = _chunkODUYOCDFjs.Param; exports.Patch = _chunkODUYOCDFjs.Patch; exports.PayloadLargeException = _chunkQYX5Q7KOjs.PayloadLargeException; exports.Pipe = _chunkODUYOCDFjs.Pipe; exports.Plugin = _chunkODUYOCDFjs.Plugin; exports.Post = _chunkODUYOCDFjs.Post; exports.Put = _chunkODUYOCDFjs.Put; exports.Query = _chunkODUYOCDFjs.Query; exports.Queue = _chunkODUYOCDFjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkODUYOCDFjs.Route; exports.Rpc = _chunkODUYOCDFjs.Rpc; exports.RpcBase = RpcBase; exports.ServerBase = ServerBase; exports.ServiceUnavailableException = _chunkQYX5Q7KOjs.ServiceUnavailableException; exports.TimeoutException = _chunkQYX5Q7KOjs.TimeoutException; exports.TimerException = _chunkQYX5Q7KOjs.TimerException; exports.UnauthorizedException = _chunkQYX5Q7KOjs.UnauthorizedException; exports.UndefinedException = _chunkQYX5Q7KOjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkQYX5Q7KOjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkQYX5Q7KOjs.ValidateException; exports.WorkerException = _chunkQYX5Q7KOjs.WorkerException; exports.addFilter = _chunkQYX5Q7KOjs.addFilter; exports.addGuard = _chunkQYX5Q7KOjs.addGuard; exports.addInterceptor = _chunkQYX5Q7KOjs.addInterceptor; exports.addPipe = _chunkQYX5Q7KOjs.addPipe; exports.addPlugin = _chunkQYX5Q7KOjs.addPlugin; exports.createPhecda = _chunkN4ULJDEQjs.createPhecda; exports.defaultPipe = _chunkQYX5Q7KOjs.defaultPipe; exports.emitter = _chunkN4ULJDEQjs.emitter; exports.log = _chunkRVWBJ6LVjs.log; exports.setLogger = _chunkRVWBJ6LVjs.setLogger;
package/dist/index.mjs CHANGED
@@ -18,7 +18,6 @@ import {
18
18
  Guard,
19
19
  Head,
20
20
  Header,
21
- Injectable,
22
21
  Interceptor,
23
22
  Param,
24
23
  Patch,
@@ -30,7 +29,7 @@ import {
30
29
  Queue,
31
30
  Route,
32
31
  Rpc
33
- } from "./chunk-5E2AVYP2.mjs";
32
+ } from "./chunk-ORQAEOSE.mjs";
34
33
  import {
35
34
  BadGatewayException,
36
35
  BadRequestException,
@@ -80,7 +79,7 @@ var CustomResponse = class {
80
79
  };
81
80
 
82
81
  // src/modules/base.ts
83
- import { Base, Empty } from "phecda-core";
82
+ import { Base } from "phecda-core";
84
83
  function _ts_decorate(decorators, target, key, desc) {
85
84
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
86
85
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -88,16 +87,36 @@ function _ts_decorate(decorators, target, key, desc) {
88
87
  return c > 3 && r && Object.defineProperty(target, key, r), r;
89
88
  }
90
89
  __name(_ts_decorate, "_ts_decorate");
90
+ function _ts_metadata(k, v) {
91
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
92
+ }
93
+ __name(_ts_metadata, "_ts_metadata");
91
94
  var ServerBase = class extends Base {
92
95
  static {
93
96
  __name(this, "ServerBase");
94
97
  }
95
- context;
96
98
  emitter = emitter;
97
99
  };
98
- ServerBase = _ts_decorate([
99
- Empty
100
- ], ServerBase);
100
+ var HttpBase = class extends ServerBase {
101
+ static {
102
+ __name(this, "HttpBase");
103
+ }
104
+ context;
105
+ };
106
+ _ts_decorate([
107
+ Ctx,
108
+ _ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
109
+ ], HttpBase.prototype, "context", void 0);
110
+ var RpcBase = class extends ServerBase {
111
+ static {
112
+ __name(this, "RpcBase");
113
+ }
114
+ context;
115
+ };
116
+ _ts_decorate([
117
+ Ctx,
118
+ _ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
119
+ ], RpcBase.prototype, "context", void 0);
101
120
 
102
121
  // src/modules/filter.ts
103
122
  import { getTag } from "phecda-core";
@@ -350,10 +369,10 @@ export {
350
369
  HTTPGenerator,
351
370
  Head,
352
371
  Header,
372
+ HttpBase,
353
373
  IS_HMR,
354
374
  IS_ONLY_GENERATE,
355
375
  IS_STRICT,
356
- Injectable,
357
376
  Interceptor,
358
377
  InvalidInputException,
359
378
  LOG_LEVEL,
@@ -379,6 +398,7 @@ export {
379
398
  RPCGenerator,
380
399
  Route,
381
400
  Rpc,
401
+ RpcBase,
382
402
  ServerBase,
383
403
  ServiceUnavailableException,
384
404
  TimeoutException,
@@ -1,6 +1,6 @@
1
1
  import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
2
2
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-vF4Hvnvo.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
2
2
  import { F as Factory } from '../../core-dx9E5x2N.js';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-CJSkC9tO.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.js';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { Consumer, Producer } from 'kafkajs';
2
2
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-vF4Hvnvo.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { Consumer, Producer } from 'kafkajs';
2
2
  import { F as Factory } from '../../core-dx9E5x2N.js';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-CJSkC9tO.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.js';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { NatsConnection } from 'nats';
2
2
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-vF4Hvnvo.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { NatsConnection } from 'nats';
2
2
  import { F as Factory } from '../../core-dx9E5x2N.js';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-CJSkC9tO.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.js';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import amqplib from 'amqplib';
2
2
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-vF4Hvnvo.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import amqplib from 'amqplib';
2
2
  import { F as Factory } from '../../core-dx9E5x2N.js';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-CJSkC9tO.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.js';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import Redis from 'ioredis';
2
2
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-vF4Hvnvo.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import Redis from 'ioredis';
2
2
  import { F as Factory } from '../../core-dx9E5x2N.js';
3
- import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-CJSkC9tO.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
4
4
  import { T as ToClientMap } from '../../types-BlIBlnVT.js';
5
5
  import 'phecda-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
2
2
  import { BaseMacro } from 'elysia/dist/types';
3
- import { a as HttpContext, H as HttpOptions } from '../../types-Dp5ixUqW.mjs';
3
+ import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
4
4
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
5
5
  import 'node:http';
6
6
  import '../../types-BlIBlnVT.mjs';
@@ -1,6 +1,6 @@
1
1
  import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
2
2
  import { BaseMacro } from 'elysia/dist/types';
3
- import { a as HttpContext, H as HttpOptions } from '../../types-PY43OKEP.js';
3
+ import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
4
4
  import { F as Factory } from '../../core-dx9E5x2N.js';
5
5
  import 'node:http';
6
6
  import '../../types-BlIBlnVT.js';
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkAUAAKHWSjs = require('../../chunk-AUAAKHWS.js');
3
+ var _chunkODUYOCDFjs = require('../../chunk-ODUYOCDF.js');
4
4
 
5
5
 
6
6
 
@@ -68,7 +68,16 @@ function bind(app, data, opts = {}) {
68
68
  tag,
69
69
  func,
70
70
  app,
71
- ..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, c.headers)
71
+ ..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, c.headers),
72
+ getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
73
+ setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
74
+ ...opts2,
75
+ value
76
+ }), "setCookie"),
77
+ delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
78
+ redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
79
+ setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
80
+ setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus")
72
81
  };
73
82
  const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
74
83
  context.run({
@@ -107,7 +116,16 @@ function bind(app, data, opts = {}) {
107
116
  body: c.body,
108
117
  params: c.params,
109
118
  headers: c.headers,
110
- app
119
+ app,
120
+ getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
121
+ setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
122
+ ...opts2,
123
+ value
124
+ }), "setCookie"),
125
+ delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
126
+ redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
127
+ setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
128
+ setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus")
111
129
  };
112
130
  const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
113
131
  if (http.headers) c.set.headers = http.headers;
@@ -129,7 +147,7 @@ function bind(app, data, opts = {}) {
129
147
  }
130
148
  _chunkRVWBJ6LVjs.__name.call(void 0, bind, "bind");
131
149
  function Elysia(opts) {
132
- return _chunkAUAAKHWSjs.Define.call(void 0, "elysia", opts);
150
+ return _chunkODUYOCDFjs.Define.call(void 0, "elysia", opts);
133
151
  }
134
152
  _chunkRVWBJ6LVjs.__name.call(void 0, Elysia, "Elysia");
135
153
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Define
3
- } from "../../chunk-5E2AVYP2.mjs";
3
+ } from "../../chunk-ORQAEOSE.mjs";
4
4
  import {
5
5
  BadRequestException,
6
6
  Context,
@@ -68,7 +68,16 @@ function bind(app, data, opts = {}) {
68
68
  tag,
69
69
  func,
70
70
  app,
71
- ...argToReq(params, item.args, c.headers)
71
+ ...argToReq(params, item.args, c.headers),
72
+ getCookie: /* @__PURE__ */ __name((key) => c.cookie[key].value, "getCookie"),
73
+ setCookie: /* @__PURE__ */ __name((key, value, opts2 = {}) => c.cookie[key].set({
74
+ ...opts2,
75
+ value
76
+ }), "setCookie"),
77
+ delCookie: /* @__PURE__ */ __name((key) => c.cookie[key].remove(), "delCookie"),
78
+ redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
79
+ setResHeaders: /* @__PURE__ */ __name((headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
80
+ setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus")
72
81
  };
73
82
  const context = new Context(contextData);
74
83
  context.run({
@@ -107,7 +116,16 @@ function bind(app, data, opts = {}) {
107
116
  body: c.body,
108
117
  params: c.params,
109
118
  headers: c.headers,
110
- app
119
+ app,
120
+ getCookie: /* @__PURE__ */ __name((key) => c.cookie[key].value, "getCookie"),
121
+ setCookie: /* @__PURE__ */ __name((key, value, opts2 = {}) => c.cookie[key].set({
122
+ ...opts2,
123
+ value
124
+ }), "setCookie"),
125
+ delCookie: /* @__PURE__ */ __name((key) => c.cookie[key].remove(), "delCookie"),
126
+ redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
127
+ setResHeaders: /* @__PURE__ */ __name((headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
128
+ setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus")
111
129
  };
112
130
  const context = new Context(contextData);
113
131
  if (http.headers) c.set.headers = http.headers;
@@ -1,5 +1,5 @@
1
1
  import { Request, Response, Router, RequestHandler } from 'express';
2
- import { a as HttpContext, H as HttpOptions } from '../../types-Dp5ixUqW.mjs';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
3
3
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
4
4
  import 'node:http';
5
5
  import '../../types-BlIBlnVT.mjs';
@@ -1,5 +1,5 @@
1
1
  import { Request, Response, Router, RequestHandler } from 'express';
2
- import { a as HttpContext, H as HttpOptions } from '../../types-PY43OKEP.js';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
3
3
  import { F as Factory } from '../../core-dx9E5x2N.js';
4
4
  import 'node:http';
5
5
  import '../../types-BlIBlnVT.js';
@@ -69,7 +69,15 @@ function bind(router, data, opts = {}) {
69
69
  func,
70
70
  next,
71
71
  app: router,
72
- ..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers)
72
+ ..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers),
73
+ getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
74
+ setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
75
+ delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.cookie(key, "", {
76
+ expires: /* @__PURE__ */ new Date(0)
77
+ }), "delCookie"),
78
+ redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
79
+ setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
80
+ setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
73
81
  };
74
82
  const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
75
83
  context.run({
@@ -107,12 +115,18 @@ function bind(router, data, opts = {}) {
107
115
  params: req.params,
108
116
  headers: req.headers,
109
117
  app: router,
110
- next
118
+ next,
119
+ getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
120
+ setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
121
+ delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.cookie(key, "", {
122
+ expires: /* @__PURE__ */ new Date(0)
123
+ }), "delCookie"),
124
+ redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
125
+ setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
126
+ setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
111
127
  };
112
128
  const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
113
- if (http.headers) {
114
- for (const name in http.headers) res.set(name, http.headers[name]);
115
- }
129
+ if (http.headers) res.set(http.headers);
116
130
  await context.run({
117
131
  globalGuards,
118
132
  globalInterceptors,
@@ -69,7 +69,15 @@ function bind(router, data, opts = {}) {
69
69
  func,
70
70
  next,
71
71
  app: router,
72
- ...argToReq(params, item.args, req.headers)
72
+ ...argToReq(params, item.args, req.headers),
73
+ getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
74
+ setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
75
+ delCookie: /* @__PURE__ */ __name((key) => res.cookie(key, "", {
76
+ expires: /* @__PURE__ */ new Date(0)
77
+ }), "delCookie"),
78
+ redirect: /* @__PURE__ */ __name((url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
79
+ setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
80
+ setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
73
81
  };
74
82
  const context = new Context(contextData);
75
83
  context.run({
@@ -107,12 +115,18 @@ function bind(router, data, opts = {}) {
107
115
  params: req.params,
108
116
  headers: req.headers,
109
117
  app: router,
110
- next
118
+ next,
119
+ getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
120
+ setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
121
+ delCookie: /* @__PURE__ */ __name((key) => res.cookie(key, "", {
122
+ expires: /* @__PURE__ */ new Date(0)
123
+ }), "delCookie"),
124
+ redirect: /* @__PURE__ */ __name((url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
125
+ setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
126
+ setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
111
127
  };
112
128
  const context = new Context(contextData);
113
- if (http.headers) {
114
- for (const name in http.headers) res.set(name, http.headers[name]);
115
- }
129
+ if (http.headers) res.set(http.headers);
116
130
  await context.run({
117
131
  globalGuards,
118
132
  globalInterceptors,
@@ -1,5 +1,5 @@
1
1
  import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
2
- import { a as HttpContext, H as HttpOptions } from '../../types-Dp5ixUqW.mjs';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
3
3
  import { F as Factory } from '../../core-Bc2ENEHX.mjs';
4
4
  import 'node:http';
5
5
  import '../../types-BlIBlnVT.mjs';
@@ -1,5 +1,5 @@
1
1
  import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
2
- import { a as HttpContext, H as HttpOptions } from '../../types-PY43OKEP.js';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
3
3
  import { F as Factory } from '../../core-dx9E5x2N.js';
4
4
  import 'node:http';
5
5
  import '../../types-BlIBlnVT.js';