phecda-server 6.0.1 → 6.1.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.
Files changed (80) hide show
  1. package/dist/{chunk-YUXERDQ6.mjs → chunk-2CFYUXPM.mjs} +9 -12
  2. package/dist/{chunk-HDQAT2IM.mjs → chunk-3H3T54IC.mjs} +116 -87
  3. package/dist/{chunk-TZYATAJX.js → chunk-DVTBLV6I.js} +62 -65
  4. package/dist/{chunk-UXD62LGG.mjs → chunk-G7TD2VB7.mjs} +10 -2
  5. package/dist/{chunk-F3W3NN7F.mjs → chunk-J7B24YSE.mjs} +1 -1
  6. package/dist/{chunk-XCND2QW3.js → chunk-JDV2XJYE.js} +25 -25
  7. package/dist/chunk-NL6QBQAR.js +266 -0
  8. package/dist/{chunk-GHFSIZUO.js → chunk-TVT62GIX.js} +11 -3
  9. package/dist/core-BlN0Spy9.d.ts +47 -0
  10. package/dist/core-P1CsH6jz.d.mts +47 -0
  11. package/dist/helper.d.mts +1 -1
  12. package/dist/helper.d.ts +1 -1
  13. package/dist/helper.js +3 -3
  14. package/dist/helper.mjs +2 -2
  15. package/dist/index.d.mts +12 -11
  16. package/dist/index.d.ts +12 -11
  17. package/dist/index.js +49 -43
  18. package/dist/index.mjs +19 -13
  19. package/dist/{types-BlIBlnVT.d.ts → meta-KtfiBIde.d.mts} +44 -44
  20. package/dist/{types-BlIBlnVT.d.mts → meta-KtfiBIde.d.ts} +44 -44
  21. package/dist/rpc/bullmq/index.d.mts +3 -3
  22. package/dist/rpc/bullmq/index.d.ts +3 -3
  23. package/dist/rpc/bullmq/index.js +12 -12
  24. package/dist/rpc/bullmq/index.mjs +2 -2
  25. package/dist/rpc/kafka/index.d.mts +3 -3
  26. package/dist/rpc/kafka/index.d.ts +3 -3
  27. package/dist/rpc/kafka/index.js +12 -12
  28. package/dist/rpc/kafka/index.mjs +2 -2
  29. package/dist/rpc/nats/index.d.mts +3 -3
  30. package/dist/rpc/nats/index.d.ts +3 -3
  31. package/dist/rpc/nats/index.js +11 -11
  32. package/dist/rpc/nats/index.mjs +2 -2
  33. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  34. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  35. package/dist/rpc/rabbitmq/index.js +13 -13
  36. package/dist/rpc/rabbitmq/index.mjs +2 -2
  37. package/dist/rpc/redis/index.d.mts +3 -3
  38. package/dist/rpc/redis/index.d.ts +3 -3
  39. package/dist/rpc/redis/index.js +11 -11
  40. package/dist/rpc/redis/index.mjs +2 -2
  41. package/dist/server/elysia/index.d.mts +3 -3
  42. package/dist/server/elysia/index.d.ts +3 -3
  43. package/dist/server/elysia/index.js +44 -32
  44. package/dist/server/elysia/index.mjs +17 -5
  45. package/dist/server/express/index.d.mts +3 -3
  46. package/dist/server/express/index.d.ts +3 -3
  47. package/dist/server/express/index.js +34 -30
  48. package/dist/server/express/index.mjs +8 -4
  49. package/dist/server/fastify/index.d.mts +3 -3
  50. package/dist/server/fastify/index.d.ts +3 -3
  51. package/dist/server/fastify/index.js +35 -31
  52. package/dist/server/fastify/index.mjs +9 -5
  53. package/dist/server/h3/index.d.mts +3 -3
  54. package/dist/server/h3/index.d.ts +3 -3
  55. package/dist/server/h3/index.js +34 -30
  56. package/dist/server/h3/index.mjs +8 -4
  57. package/dist/server/hono/index.d.mts +3 -3
  58. package/dist/server/hono/index.d.ts +3 -3
  59. package/dist/server/hono/index.js +33 -29
  60. package/dist/server/hono/index.mjs +8 -4
  61. package/dist/server/hyper-express/index.d.mts +3 -3
  62. package/dist/server/hyper-express/index.d.ts +3 -3
  63. package/dist/server/hyper-express/index.js +33 -29
  64. package/dist/server/hyper-express/index.mjs +8 -4
  65. package/dist/server/koa/index.d.mts +3 -3
  66. package/dist/server/koa/index.d.ts +3 -3
  67. package/dist/server/koa/index.js +34 -30
  68. package/dist/server/koa/index.mjs +8 -4
  69. package/dist/test.d.mts +3 -3
  70. package/dist/test.d.ts +3 -3
  71. package/dist/test.js +6 -6
  72. package/dist/test.mjs +2 -2
  73. package/dist/{types-BCJhmpQh.d.ts → types-BvD3B5Ny.d.mts} +4 -2
  74. package/dist/{types-Dgxirc9f.d.mts → types-DIw7B6Up.d.ts} +4 -2
  75. package/dist/{types-B-ZFZajI.d.ts → types-JVT0mgLD.d.ts} +1 -1
  76. package/dist/{types-AgVwUXPC.d.mts → types-t9D1fU6G.d.mts} +1 -1
  77. package/package.json +2 -2
  78. package/dist/chunk-LYEZ6RGX.js +0 -237
  79. package/dist/core-Blq8frmr.d.ts +0 -30
  80. package/dist/core-D2oL8Ge0.d.mts +0 -30
@@ -1,16 +1,16 @@
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 _chunkXCND2QW3js = require('../../chunk-XCND2QW3.js');
3
+ var _chunkJDV2XJYEjs = require('../../chunk-JDV2XJYE.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkTZYATAJXjs = require('../../chunk-TZYATAJX.js');
10
+ var _chunkDVTBLV6Ijs = require('../../chunk-DVTBLV6I.js');
11
11
 
12
12
 
13
- var _chunkGHFSIZUOjs = require('../../chunk-GHFSIZUO.js');
13
+ var _chunkTVT62GIXjs = require('../../chunk-TVT62GIX.js');
14
14
 
15
15
  // src/server/elysia/bind.ts
16
16
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
@@ -19,14 +19,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/elysia");
19
19
  function bind(app, data, opts = {}) {
20
20
  const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
21
21
  const { moduleMap, meta } = data;
22
- const metaMap = _chunkTZYATAJXjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
+ const metaMap = _chunkDVTBLV6Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
23
23
  const { controller, http, func, tag } = meta2.data;
24
24
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
25
25
  debug(`register method "${func}" in module "${tag}"`);
26
26
  return true;
27
27
  }
28
28
  });
29
- _chunkTZYATAJXjs.detectAopDep.call(void 0, meta, {
29
+ _chunkDVTBLV6Ijs.detectAopDep.call(void 0, meta, {
30
30
  plugins: [
31
31
  ...globalPlugins,
32
32
  ...parallelPlugins
@@ -36,27 +36,27 @@ function bind(app, data, opts = {}) {
36
36
  });
37
37
  registerRoute();
38
38
  async function registerRoute() {
39
- _chunkTZYATAJXjs.Context.usePlugin(globalPlugins, "elysia").forEach((p) => p(app));
39
+ _chunkDVTBLV6Ijs.Context.usePlugin(globalPlugins, "elysia").forEach((p) => p(app));
40
40
  const parallelRouter = new (0, _elysia.Elysia)();
41
- _chunkTZYATAJXjs.Context.usePlugin(parallelPlugins, "elysia").forEach((p) => p(parallelRouter));
41
+ _chunkDVTBLV6Ijs.Context.usePlugin(parallelPlugins, "elysia").forEach((p) => p(parallelRouter));
42
42
  if (parallelRoute) {
43
43
  parallelRouter.post(parallelRoute, async (c) => {
44
44
  const { body } = c;
45
45
  async function errorHandler(e) {
46
- const error = await _chunkTZYATAJXjs.Context.filterRecord.default(e);
46
+ const error = await _chunkDVTBLV6Ijs.Context.filterRecord.default(e);
47
47
  c.set.status = error.status;
48
48
  return error;
49
49
  }
50
- _chunkGHFSIZUOjs.__name.call(void 0, errorHandler, "errorHandler");
51
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkTZYATAJXjs.BadRequestException)("data format should be an array"));
50
+ _chunkTVT62GIXjs.__name.call(void 0, errorHandler, "errorHandler");
51
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkDVTBLV6Ijs.BadRequestException)("data format should be an array"));
52
52
  try {
53
53
  return Promise.all(body.map((item, i) => {
54
54
  return new Promise(async (resolve) => {
55
55
  const { tag, func } = item;
56
56
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
57
- if (!metaMap.has(tag)) return resolve(await _chunkTZYATAJXjs.Context.filterRecord.default(new (0, _chunkTZYATAJXjs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
+ if (!metaMap.has(tag)) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`module "${tag}" doesn't exist`)));
58
58
  const meta2 = metaMap.get(tag)[func];
59
- if (!meta2) return resolve(await _chunkTZYATAJXjs.Context.filterRecord.default(new (0, _chunkTZYATAJXjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
59
+ if (!meta2) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
60
60
  const { data: { params } } = meta2;
61
61
  const contextData = {
62
62
  type: "elysia",
@@ -68,18 +68,24 @@ function bind(app, data, opts = {}) {
68
68
  tag,
69
69
  func,
70
70
  app,
71
- ..._chunkTZYATAJXjs.argToReq.call(void 0, params, item.args, c.headers),
72
- getCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
73
- setCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
71
+ ..._chunkDVTBLV6Ijs.argToReq.call(void 0, params, item.args, c.headers),
72
+ getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
73
+ setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
74
74
  ...opts2,
75
75
  value
76
76
  }), "setCookie"),
77
- delCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
78
- redirect: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
79
- setResHeaders: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
80
- setResStatus: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus")
77
+ delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
78
+ redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
79
+ setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
80
+ setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus"),
81
+ getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => {
82
+ throw new Error("elysia can't support getRequest");
83
+ }, "getRequest"),
84
+ getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => {
85
+ throw new Error("elysia can't support getResponse");
86
+ }, "getResponse")
81
87
  };
82
- const context = new (0, _chunkTZYATAJXjs.Context)(contextData);
88
+ const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
83
89
  context.run({
84
90
  globalGuards,
85
91
  globalInterceptors,
@@ -102,7 +108,7 @@ function bind(app, data, opts = {}) {
102
108
  const { data: { define, plugins, http } } = meta2;
103
109
  const funcRouter = new (0, _elysia.Elysia)();
104
110
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
105
- _chunkTZYATAJXjs.Context.usePlugin(plugins, "elysia").forEach((p) => p(funcRouter));
111
+ _chunkDVTBLV6Ijs.Context.usePlugin(plugins, "elysia").forEach((p) => p(funcRouter));
106
112
  funcRouter[http.type](http.prefix + http.route, async (c) => {
107
113
  debug(`invoke method "${func}" in module "${tag}"`);
108
114
  const contextData = {
@@ -117,17 +123,23 @@ function bind(app, data, opts = {}) {
117
123
  params: c.params,
118
124
  headers: c.headers,
119
125
  app,
120
- getCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
121
- setCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
126
+ getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
127
+ setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
122
128
  ...opts2,
123
129
  value
124
130
  }), "setCookie"),
125
- delCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
126
- redirect: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
127
- setResHeaders: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
128
- setResStatus: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus")
131
+ delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
132
+ redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
133
+ setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
134
+ setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus"),
135
+ getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => {
136
+ throw new Error("elysia can't support getRequest");
137
+ }, "getRequest"),
138
+ getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => {
139
+ throw new Error("elysia can't support getResponse");
140
+ }, "getResponse")
129
141
  };
130
- const context = new (0, _chunkTZYATAJXjs.Context)(contextData);
142
+ const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
131
143
  if (http.headers) c.set.headers = http.headers;
132
144
  return context.run({
133
145
  globalGuards,
@@ -143,13 +155,13 @@ function bind(app, data, opts = {}) {
143
155
  }
144
156
  }
145
157
  }
146
- _chunkGHFSIZUOjs.__name.call(void 0, registerRoute, "registerRoute");
158
+ _chunkTVT62GIXjs.__name.call(void 0, registerRoute, "registerRoute");
147
159
  }
148
- _chunkGHFSIZUOjs.__name.call(void 0, bind, "bind");
160
+ _chunkTVT62GIXjs.__name.call(void 0, bind, "bind");
149
161
  function Elysia(opts) {
150
- return _chunkXCND2QW3js.Define.call(void 0, "elysia", opts);
162
+ return _chunkJDV2XJYEjs.Define.call(void 0, "elysia", opts);
151
163
  }
152
- _chunkGHFSIZUOjs.__name.call(void 0, Elysia, "Elysia");
164
+ _chunkTVT62GIXjs.__name.call(void 0, Elysia, "Elysia");
153
165
 
154
166
 
155
167
 
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  Define
3
- } from "../../chunk-F3W3NN7F.mjs";
3
+ } from "../../chunk-J7B24YSE.mjs";
4
4
  import {
5
5
  BadRequestException,
6
6
  Context,
7
7
  argToReq,
8
8
  createControllerMetaMap,
9
9
  detectAopDep
10
- } from "../../chunk-YUXERDQ6.mjs";
10
+ } from "../../chunk-2CFYUXPM.mjs";
11
11
  import {
12
12
  __name
13
- } from "../../chunk-UXD62LGG.mjs";
13
+ } from "../../chunk-G7TD2VB7.mjs";
14
14
 
15
15
  // src/server/elysia/bind.ts
16
16
  import Debug from "debug";
@@ -77,7 +77,13 @@ function bind(app, data, opts = {}) {
77
77
  delCookie: /* @__PURE__ */ __name((key) => c.cookie[key].remove(), "delCookie"),
78
78
  redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
79
79
  setResHeaders: /* @__PURE__ */ __name((headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
80
- setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus")
80
+ setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus"),
81
+ getRequest: /* @__PURE__ */ __name(() => {
82
+ throw new Error("elysia can't support getRequest");
83
+ }, "getRequest"),
84
+ getResponse: /* @__PURE__ */ __name(() => {
85
+ throw new Error("elysia can't support getResponse");
86
+ }, "getResponse")
81
87
  };
82
88
  const context = new Context(contextData);
83
89
  context.run({
@@ -125,7 +131,13 @@ function bind(app, data, opts = {}) {
125
131
  delCookie: /* @__PURE__ */ __name((key) => c.cookie[key].remove(), "delCookie"),
126
132
  redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
127
133
  setResHeaders: /* @__PURE__ */ __name((headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
128
- setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus")
134
+ setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus"),
135
+ getRequest: /* @__PURE__ */ __name(() => {
136
+ throw new Error("elysia can't support getRequest");
137
+ }, "getRequest"),
138
+ getResponse: /* @__PURE__ */ __name(() => {
139
+ throw new Error("elysia can't support getResponse");
140
+ }, "getResponse")
129
141
  };
130
142
  const context = new Context(contextData);
131
143
  if (http.headers) c.set.headers = http.headers;
@@ -1,8 +1,8 @@
1
1
  import { Request, Response, Router, RequestHandler } from 'express';
2
- import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
3
- import { F as Factory } from '../../core-D2oL8Ge0.mjs';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-BvD3B5Ny.mjs';
3
+ import { F as Factory } from '../../core-P1CsH6jz.mjs';
4
4
  import 'node:http';
5
- import '../../types-BlIBlnVT.mjs';
5
+ import '../../meta-KtfiBIde.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface ExpressCtx extends HttpContext {
@@ -1,8 +1,8 @@
1
1
  import { Request, Response, Router, RequestHandler } from 'express';
2
- import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
3
- import { F as Factory } from '../../core-Blq8frmr.js';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-DIw7B6Up.js';
3
+ import { F as Factory } from '../../core-BlN0Spy9.js';
4
4
  import 'node:http';
5
- import '../../types-BlIBlnVT.js';
5
+ import '../../meta-KtfiBIde.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface ExpressCtx extends HttpContext {
@@ -5,10 +5,10 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkTZYATAJXjs = require('../../chunk-TZYATAJX.js');
8
+ var _chunkDVTBLV6Ijs = require('../../chunk-DVTBLV6I.js');
9
9
 
10
10
 
11
- var _chunkGHFSIZUOjs = require('../../chunk-GHFSIZUO.js');
11
+ var _chunkTVT62GIXjs = require('../../chunk-TVT62GIX.js');
12
12
 
13
13
  // src/server/express/bind.ts
14
14
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
@@ -17,14 +17,14 @@ function bind(router, data, opts = {}) {
17
17
  const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
18
18
  const { moduleMap, meta } = data;
19
19
  const originStack = router.stack.slice(0, router.stack.length);
20
- const metaMap = _chunkTZYATAJXjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const metaMap = _chunkDVTBLV6Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
21
  const { controller, http, func, tag } = meta2.data;
22
22
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
23
23
  debug(`register method "${func}" in module "${tag}"`);
24
24
  return true;
25
25
  }
26
26
  });
27
- _chunkTZYATAJXjs.detectAopDep.call(void 0, meta, {
27
+ _chunkDVTBLV6Ijs.detectAopDep.call(void 0, meta, {
28
28
  plugins: [
29
29
  ...globalPlugins,
30
30
  ...parallelPlugins
@@ -33,29 +33,29 @@ function bind(router, data, opts = {}) {
33
33
  interceptors: globalInterceptors
34
34
  });
35
35
  registerRoute();
36
- _chunkTZYATAJXjs.HMR.call(void 0, async () => {
36
+ _chunkDVTBLV6Ijs.HMR.call(void 0, async () => {
37
37
  router.stack = originStack;
38
38
  registerRoute();
39
39
  });
40
40
  async function registerRoute() {
41
- _chunkTZYATAJXjs.Context.usePlugin(globalPlugins, "express").forEach((p) => router.use(p));
41
+ _chunkDVTBLV6Ijs.Context.usePlugin(globalPlugins, "express").forEach((p) => router.use(p));
42
42
  if (parallelRoute) {
43
- router.post(parallelRoute, ..._chunkTZYATAJXjs.Context.usePlugin(parallelPlugins, "express"), async (req, res, next) => {
43
+ router.post(parallelRoute, ..._chunkDVTBLV6Ijs.Context.usePlugin(parallelPlugins, "express"), async (req, res, next) => {
44
44
  const { body } = req;
45
45
  async function errorHandler(e) {
46
- const error = await _chunkTZYATAJXjs.Context.filterRecord.default(e);
46
+ const error = await _chunkDVTBLV6Ijs.Context.filterRecord.default(e);
47
47
  return res.status(error.status).json(error);
48
48
  }
49
- _chunkGHFSIZUOjs.__name.call(void 0, errorHandler, "errorHandler");
50
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkTZYATAJXjs.BadRequestException)("data format should be an array"));
49
+ _chunkTVT62GIXjs.__name.call(void 0, errorHandler, "errorHandler");
50
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkDVTBLV6Ijs.BadRequestException)("data format should be an array"));
51
51
  try {
52
52
  return Promise.all(body.map((item, i) => {
53
53
  return new Promise(async (resolve) => {
54
54
  const { tag, func } = item;
55
55
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
56
- if (!metaMap.has(tag)) return resolve(await _chunkTZYATAJXjs.Context.filterRecord.default(new (0, _chunkTZYATAJXjs.BadRequestException)(`module "${tag}" doesn't exist`)));
56
+ if (!metaMap.has(tag)) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
57
  const meta2 = metaMap.get(tag)[func];
58
- if (!meta2) return resolve(await _chunkTZYATAJXjs.Context.filterRecord.default(new (0, _chunkTZYATAJXjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
58
+ if (!meta2) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
59
59
  const { data: { params } } = meta2;
60
60
  const contextData = {
61
61
  type: "express",
@@ -69,17 +69,19 @@ function bind(router, data, opts = {}) {
69
69
  func,
70
70
  next,
71
71
  app: router,
72
- ..._chunkTZYATAJXjs.argToReq.call(void 0, params, item.args, req.headers),
73
- getCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
74
- setCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
75
- delCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => res.cookie(key, "", {
72
+ ..._chunkDVTBLV6Ijs.argToReq.call(void 0, params, item.args, req.headers),
73
+ getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
74
+ setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
75
+ delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => res.cookie(key, "", {
76
76
  expires: /* @__PURE__ */ new Date(0)
77
77
  }), "delCookie"),
78
- redirect: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
79
- setResHeaders: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
80
- setResStatus: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
78
+ redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
79
+ setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
80
+ setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (code) => res.status(code), "setResStatus"),
81
+ getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => req, "getRequest"),
82
+ getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => res, "getResponse")
81
83
  };
82
- const context = new (0, _chunkTZYATAJXjs.Context)(contextData);
84
+ const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
83
85
  context.run({
84
86
  globalGuards,
85
87
  globalInterceptors,
@@ -100,7 +102,7 @@ function bind(router, data, opts = {}) {
100
102
  const meta2 = metaMap.get(tag)[func];
101
103
  const { data: { plugins, http } } = meta2;
102
104
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
103
- router[http.type](http.prefix + http.route, ..._chunkTZYATAJXjs.Context.usePlugin(plugins, "express"), async (req, res, next) => {
105
+ router[http.type](http.prefix + http.route, ..._chunkDVTBLV6Ijs.Context.usePlugin(plugins, "express"), async (req, res, next) => {
104
106
  debug(`invoke method "${func}" in module "${tag}"`);
105
107
  const contextData = {
106
108
  type: "express",
@@ -116,16 +118,18 @@ function bind(router, data, opts = {}) {
116
118
  headers: req.headers,
117
119
  app: router,
118
120
  next,
119
- getCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
120
- setCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
121
- delCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => res.cookie(key, "", {
121
+ getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
122
+ setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
123
+ delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => res.cookie(key, "", {
122
124
  expires: /* @__PURE__ */ new Date(0)
123
125
  }), "delCookie"),
124
- redirect: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
125
- setResHeaders: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
126
- setResStatus: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
126
+ redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
127
+ setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
128
+ setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (code) => res.status(code), "setResStatus"),
129
+ getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => req, "getRequest"),
130
+ getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => res, "getResponse")
127
131
  };
128
- const context = new (0, _chunkTZYATAJXjs.Context)(contextData);
132
+ const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
129
133
  if (http.headers) res.set(http.headers);
130
134
  await context.run({
131
135
  globalGuards,
@@ -144,9 +148,9 @@ function bind(router, data, opts = {}) {
144
148
  }
145
149
  }
146
150
  }
147
- _chunkGHFSIZUOjs.__name.call(void 0, registerRoute, "registerRoute");
151
+ _chunkTVT62GIXjs.__name.call(void 0, registerRoute, "registerRoute");
148
152
  }
149
- _chunkGHFSIZUOjs.__name.call(void 0, bind, "bind");
153
+ _chunkTVT62GIXjs.__name.call(void 0, bind, "bind");
150
154
 
151
155
 
152
156
  exports.bind = bind;
@@ -5,10 +5,10 @@ import {
5
5
  argToReq,
6
6
  createControllerMetaMap,
7
7
  detectAopDep
8
- } from "../../chunk-YUXERDQ6.mjs";
8
+ } from "../../chunk-2CFYUXPM.mjs";
9
9
  import {
10
10
  __name
11
- } from "../../chunk-UXD62LGG.mjs";
11
+ } from "../../chunk-G7TD2VB7.mjs";
12
12
 
13
13
  // src/server/express/bind.ts
14
14
  import Debug from "debug";
@@ -77,7 +77,9 @@ function bind(router, data, opts = {}) {
77
77
  }), "delCookie"),
78
78
  redirect: /* @__PURE__ */ __name((url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
79
79
  setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
80
- setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
80
+ setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus"),
81
+ getRequest: /* @__PURE__ */ __name(() => req, "getRequest"),
82
+ getResponse: /* @__PURE__ */ __name(() => res, "getResponse")
81
83
  };
82
84
  const context = new Context(contextData);
83
85
  context.run({
@@ -123,7 +125,9 @@ function bind(router, data, opts = {}) {
123
125
  }), "delCookie"),
124
126
  redirect: /* @__PURE__ */ __name((url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
125
127
  setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
126
- setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
128
+ setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus"),
129
+ getRequest: /* @__PURE__ */ __name(() => req, "getRequest"),
130
+ getResponse: /* @__PURE__ */ __name(() => res, "getResponse")
127
131
  };
128
132
  const context = new Context(contextData);
129
133
  if (http.headers) res.set(http.headers);
@@ -1,8 +1,8 @@
1
1
  import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
2
- import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
3
- import { F as Factory } from '../../core-D2oL8Ge0.mjs';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-BvD3B5Ny.mjs';
3
+ import { F as Factory } from '../../core-P1CsH6jz.mjs';
4
4
  import 'node:http';
5
- import '../../types-BlIBlnVT.mjs';
5
+ import '../../meta-KtfiBIde.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface FastifyCtx extends HttpContext {
@@ -1,8 +1,8 @@
1
1
  import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
2
- import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
3
- import { F as Factory } from '../../core-Blq8frmr.js';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-DIw7B6Up.js';
3
+ import { F as Factory } from '../../core-BlN0Spy9.js';
4
4
  import 'node:http';
5
- import '../../types-BlIBlnVT.js';
5
+ import '../../meta-KtfiBIde.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface FastifyCtx extends HttpContext {
@@ -1,16 +1,16 @@
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 _chunkXCND2QW3js = require('../../chunk-XCND2QW3.js');
3
+ var _chunkJDV2XJYEjs = require('../../chunk-JDV2XJYE.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkTZYATAJXjs = require('../../chunk-TZYATAJX.js');
10
+ var _chunkDVTBLV6Ijs = require('../../chunk-DVTBLV6I.js');
11
11
 
12
12
 
13
- var _chunkGHFSIZUOjs = require('../../chunk-GHFSIZUO.js');
13
+ var _chunkTVT62GIXjs = require('../../chunk-TVT62GIX.js');
14
14
 
15
15
  // src/server/fastify/bind.ts
16
16
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
@@ -18,14 +18,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/fastify");
18
18
  function bind(fastify, data, opts = {}) {
19
19
  const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe, fastifyOpts } = opts;
20
20
  const { moduleMap, meta } = data;
21
- const metaMap = _chunkTZYATAJXjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkDVTBLV6Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, http, func, tag } = meta2.data;
23
23
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _2 => _2.type])) {
24
24
  debug(`register method "${func}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkTZYATAJXjs.detectAopDep.call(void 0, meta, {
28
+ _chunkDVTBLV6Ijs.detectAopDep.call(void 0, meta, {
29
29
  plugins: [
30
30
  ...globalPlugins,
31
31
  ...parallelPlugins
@@ -34,12 +34,12 @@ function bind(fastify, data, opts = {}) {
34
34
  interceptors: globalInterceptors
35
35
  });
36
36
  fastify.register((fastify2, _, done) => {
37
- _chunkTZYATAJXjs.Context.usePlugin(globalPlugins, "fastify").forEach((p) => {
37
+ _chunkDVTBLV6Ijs.Context.usePlugin(globalPlugins, "fastify").forEach((p) => {
38
38
  p[Symbol.for("skip-override")] = true;
39
39
  fastify2.register(p);
40
40
  });
41
41
  fastify2.register((fastify3, _opts, done2) => {
42
- _chunkTZYATAJXjs.Context.usePlugin(parallelPlugins, "fastify").forEach((p) => {
42
+ _chunkDVTBLV6Ijs.Context.usePlugin(parallelPlugins, "fastify").forEach((p) => {
43
43
  p[Symbol.for("skip-override")] = true;
44
44
  fastify3.register(p);
45
45
  });
@@ -47,19 +47,19 @@ function bind(fastify, data, opts = {}) {
47
47
  fastify3.post(parallelRoute, async (req, res) => {
48
48
  const { body } = req;
49
49
  async function errorHandler(e) {
50
- const error = await _chunkTZYATAJXjs.Context.filterRecord.default(e);
50
+ const error = await _chunkDVTBLV6Ijs.Context.filterRecord.default(e);
51
51
  return res.status(error.status).send(error);
52
52
  }
53
- _chunkGHFSIZUOjs.__name.call(void 0, errorHandler, "errorHandler");
54
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkTZYATAJXjs.BadRequestException)("data format should be an array"));
53
+ _chunkTVT62GIXjs.__name.call(void 0, errorHandler, "errorHandler");
54
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkDVTBLV6Ijs.BadRequestException)("data format should be an array"));
55
55
  try {
56
56
  return Promise.all(body.map((item, i) => {
57
57
  return new Promise(async (resolve) => {
58
58
  const { tag, func } = item;
59
59
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
60
- if (!metaMap.has(tag)) return resolve(await _chunkTZYATAJXjs.Context.filterRecord.default(new (0, _chunkTZYATAJXjs.BadRequestException)(`module "${tag}" doesn't exist`)));
60
+ if (!metaMap.has(tag)) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`module "${tag}" doesn't exist`)));
61
61
  const meta2 = metaMap.get(tag)[func];
62
- if (!meta2) return resolve(await _chunkTZYATAJXjs.Context.filterRecord.default(new (0, _chunkTZYATAJXjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
62
+ if (!meta2) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
63
63
  const { data: { params } } = meta2;
64
64
  const contextData = {
65
65
  type: "fastify",
@@ -72,18 +72,20 @@ function bind(fastify, data, opts = {}) {
72
72
  tag,
73
73
  func,
74
74
  app: fastify3,
75
- ..._chunkTZYATAJXjs.argToReq.call(void 0, params, item.args, req.headers),
75
+ ..._chunkDVTBLV6Ijs.argToReq.call(void 0, params, item.args, req.headers),
76
76
  // @ts-expect-error need @fastify/cookie
77
- getCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
77
+ getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
78
78
  // @ts-expect-error need @fastify/cookie
79
- setCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
79
+ setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
80
80
  // @ts-expect-error need @fastify/cookie
81
- delCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => res.clearCookie(key), "delCookie"),
82
- redirect: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (url, status) => res.redirect(url, status), "redirect"),
83
- setResHeaders: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (headers) => res.headers(headers), "setResHeaders"),
84
- setResStatus: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
81
+ delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => res.clearCookie(key), "delCookie"),
82
+ redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url, status) => res.redirect(url, status), "redirect"),
83
+ setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => res.headers(headers), "setResHeaders"),
84
+ setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (code) => res.status(code), "setResStatus"),
85
+ getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => req, "getRequest"),
86
+ getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => res, "getResponse")
85
87
  };
86
- const context = new (0, _chunkTZYATAJXjs.Context)(contextData);
88
+ const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
87
89
  context.run({
88
90
  globalGuards,
89
91
  globalInterceptors,
@@ -107,7 +109,7 @@ function bind(fastify, data, opts = {}) {
107
109
  const { data: { plugins, define, http } } = meta2;
108
110
  if (!_optionalChain([http, 'optionalAccess', _3 => _3.type])) continue;
109
111
  fastify2.register((fastify3, _opts, done2) => {
110
- _chunkTZYATAJXjs.Context.usePlugin(plugins, "fastify").forEach((p) => {
112
+ _chunkDVTBLV6Ijs.Context.usePlugin(plugins, "fastify").forEach((p) => {
111
113
  p[Symbol.for("skip-override")] = true;
112
114
  fastify3.register(p);
113
115
  });
@@ -127,18 +129,20 @@ function bind(fastify, data, opts = {}) {
127
129
  headers: req.headers,
128
130
  app: fastify3,
129
131
  // @ts-expect-error need @fastify/cookie
130
- getCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
132
+ getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
131
133
  // @ts-expect-error need @fastify/cookie
132
- setCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
134
+ setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
133
135
  // @ts-expect-error need @fastify/cookie
134
- delCookie: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (key) => res.clearCookie(key, {
136
+ delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => res.clearCookie(key, {
135
137
  path: ""
136
138
  }), "delCookie"),
137
- redirect: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (url, status) => res.redirect(url, status), "redirect"),
138
- setResHeaders: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (headers) => res.headers(headers), "setResHeaders"),
139
- setResStatus: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
139
+ redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url, status) => res.redirect(url, status), "redirect"),
140
+ setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => res.headers(headers), "setResHeaders"),
141
+ setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (code) => res.status(code), "setResStatus"),
142
+ getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => req, "getRequest"),
143
+ getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => res, "getResponse")
140
144
  };
141
- const context = new (0, _chunkTZYATAJXjs.Context)(contextData);
145
+ const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
142
146
  if (http.headers) res.headers(http.headers);
143
147
  return context.run({
144
148
  globalGuards,
@@ -160,11 +164,11 @@ function bind(fastify, data, opts = {}) {
160
164
  done();
161
165
  }, fastifyOpts);
162
166
  }
163
- _chunkGHFSIZUOjs.__name.call(void 0, bind, "bind");
167
+ _chunkTVT62GIXjs.__name.call(void 0, bind, "bind");
164
168
  function Fastify(opts) {
165
- return _chunkXCND2QW3js.Define.call(void 0, "fastify", opts);
169
+ return _chunkJDV2XJYEjs.Define.call(void 0, "fastify", opts);
166
170
  }
167
- _chunkGHFSIZUOjs.__name.call(void 0, Fastify, "Fastify");
171
+ _chunkTVT62GIXjs.__name.call(void 0, Fastify, "Fastify");
168
172
 
169
173
 
170
174