phecda-server 7.1.4 → 8.0.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 (85) hide show
  1. package/dist/{chunk-MKRHYZCL.mjs → chunk-FI5756JX.mjs} +2 -2
  2. package/dist/{chunk-P3CS65OP.mjs → chunk-G5IH3TP7.mjs} +81 -21
  3. package/dist/{chunk-OV3UJLGP.js → chunk-LD7YMHIE.js} +81 -21
  4. package/dist/{chunk-YRS4ECPT.js → chunk-OLNN4U3O.js} +12 -8
  5. package/dist/{chunk-5MAGRSEM.mjs → chunk-PFPOEZHH.mjs} +12 -8
  6. package/dist/{chunk-DPPDWBYO.js → chunk-UYZSUBX4.js} +2 -2
  7. package/dist/{core-B5yKYkMJ.d.mts → core-BTSHIAyB.d.ts} +2 -1
  8. package/dist/{core-BRuvL6hY.d.ts → core-D1YYphEn.d.mts} +2 -1
  9. package/dist/helper.d.mts +1 -1
  10. package/dist/helper.d.ts +1 -1
  11. package/dist/helper.js +2 -2
  12. package/dist/helper.mjs +1 -1
  13. package/dist/http/elysia/index.d.mts +3 -3
  14. package/dist/http/elysia/index.d.ts +3 -3
  15. package/dist/http/elysia/index.js +30 -30
  16. package/dist/http/elysia/index.mjs +15 -15
  17. package/dist/http/express/index.d.mts +3 -3
  18. package/dist/http/express/index.d.ts +3 -3
  19. package/dist/http/express/index.js +27 -27
  20. package/dist/http/express/index.mjs +14 -14
  21. package/dist/http/fastify/index.d.mts +3 -3
  22. package/dist/http/fastify/index.d.ts +3 -3
  23. package/dist/http/fastify/index.js +29 -29
  24. package/dist/http/fastify/index.mjs +15 -15
  25. package/dist/http/h3/index.d.mts +3 -3
  26. package/dist/http/h3/index.d.ts +3 -3
  27. package/dist/http/h3/index.js +28 -28
  28. package/dist/http/h3/index.mjs +14 -14
  29. package/dist/http/hono/index.d.mts +3 -3
  30. package/dist/http/hono/index.d.ts +3 -3
  31. package/dist/http/hono/index.js +26 -26
  32. package/dist/http/hono/index.mjs +14 -14
  33. package/dist/http/hyper-express/index.d.mts +3 -3
  34. package/dist/http/hyper-express/index.d.ts +3 -3
  35. package/dist/http/hyper-express/index.js +26 -26
  36. package/dist/http/hyper-express/index.mjs +14 -14
  37. package/dist/http/koa/index.d.mts +3 -3
  38. package/dist/http/koa/index.d.ts +3 -3
  39. package/dist/http/koa/index.js +27 -27
  40. package/dist/http/koa/index.mjs +14 -14
  41. package/dist/index.d.mts +20 -13
  42. package/dist/index.d.ts +20 -13
  43. package/dist/index.js +112 -71
  44. package/dist/index.mjs +69 -28
  45. package/dist/{meta-C_eDyXnK.d.ts → meta-DNF6Fl27.d.mts} +11 -9
  46. package/dist/{meta-C_eDyXnK.d.mts → meta-DNF6Fl27.d.ts} +11 -9
  47. package/dist/rpc/bullmq/index.d.mts +3 -3
  48. package/dist/rpc/bullmq/index.d.ts +3 -3
  49. package/dist/rpc/bullmq/index.js +16 -16
  50. package/dist/rpc/bullmq/index.mjs +11 -11
  51. package/dist/rpc/electron/index.d.mts +3 -3
  52. package/dist/rpc/electron/index.d.ts +3 -3
  53. package/dist/rpc/electron/index.js +11 -11
  54. package/dist/rpc/electron/index.mjs +7 -7
  55. package/dist/rpc/kafka/index.d.mts +3 -3
  56. package/dist/rpc/kafka/index.d.ts +3 -3
  57. package/dist/rpc/kafka/index.js +14 -14
  58. package/dist/rpc/kafka/index.mjs +9 -9
  59. package/dist/rpc/nats/index.d.mts +3 -3
  60. package/dist/rpc/nats/index.d.ts +3 -3
  61. package/dist/rpc/nats/index.js +14 -14
  62. package/dist/rpc/nats/index.mjs +9 -9
  63. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  64. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  65. package/dist/rpc/rabbitmq/index.js +14 -14
  66. package/dist/rpc/rabbitmq/index.mjs +9 -9
  67. package/dist/rpc/redis/index.d.mts +3 -3
  68. package/dist/rpc/redis/index.d.ts +3 -3
  69. package/dist/rpc/redis/index.js +14 -14
  70. package/dist/rpc/redis/index.mjs +9 -9
  71. package/dist/rpc/ws/index.d.mts +3 -3
  72. package/dist/rpc/ws/index.d.ts +3 -3
  73. package/dist/rpc/ws/index.js +10 -10
  74. package/dist/rpc/ws/index.mjs +6 -6
  75. package/dist/test.d.mts +2 -2
  76. package/dist/test.d.ts +2 -2
  77. package/dist/test.js +5 -5
  78. package/dist/test.mjs +4 -4
  79. package/dist/{types-7-m2wEkP.d.mts → types-BOZ8yE2L.d.mts} +1 -1
  80. package/dist/{types-BuvMT1ta.d.ts → types-Cosv4nol.d.ts} +1 -1
  81. package/dist/{types-BKHBmSQN.d.mts → types-DtiHAXQB.d.mts} +1 -1
  82. package/dist/{types-B6aU8oT-.d.ts → types-YJ55P7A_.d.ts} +1 -1
  83. package/package.json +3 -4
  84. package/register/export.mjs +5 -1
  85. package/register/utils.mjs +0 -1
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Define
3
- } from "../../chunk-MKRHYZCL.mjs";
3
+ } from "../../chunk-FI5756JX.mjs";
4
4
  import {
5
5
  BadRequestException,
6
6
  Context,
7
7
  createControllerMetaMap,
8
8
  detectAopDep,
9
9
  joinUrl
10
- } from "../../chunk-P3CS65OP.mjs";
10
+ } from "../../chunk-G5IH3TP7.mjs";
11
11
  import {
12
12
  __name
13
13
  } from "../../chunk-NQ55PA2X.mjs";
@@ -19,9 +19,9 @@ function bind(fastify, data, opts = {}) {
19
19
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, fastifyOpts, dynamic = false } = opts;
20
20
  const { moduleMap, meta } = data;
21
21
  const metaMap = createControllerMetaMap(meta, (meta2) => {
22
- const { controller, http, func, tag } = meta2.data;
23
- if (controller === "http" && http?.type) {
24
- debug(`register method "${func}" in module "${tag}"`);
22
+ const { controller, http, method, tag } = meta2.data;
23
+ if (controller === "http" && http?.method) {
24
+ debug(`register method "${method}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
@@ -49,11 +49,11 @@ function bind(fastify, data, opts = {}) {
49
49
  return Promise.all(body.map((item, i) => {
50
50
  return new Promise(async (resolve) => {
51
51
  if (!item) return resolve(null);
52
- const { tag, func } = item;
53
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
52
+ const { tag, method } = item;
53
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
54
54
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
55
- const meta2 = metaMap.get(tag)[func];
56
- if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
55
+ const meta2 = metaMap.get(tag)[method];
56
+ if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
57
57
  const aop = Context.getAop(meta2, {
58
58
  globalFilter,
59
59
  globalGuards,
@@ -96,10 +96,10 @@ function bind(fastify, data, opts = {}) {
96
96
  });
97
97
  }
98
98
  for (const [tag, record] of metaMap) {
99
- for (const func in record) {
100
- const meta2 = metaMap.get(tag)[func];
99
+ for (const method in record) {
100
+ const meta2 = metaMap.get(tag)[method];
101
101
  const { data: { addons, define, http } } = meta2;
102
- if (!http?.type) continue;
102
+ if (!http?.method) continue;
103
103
  fastify2.register(async (fastify3, _opts, done2) => {
104
104
  Context.applyAddons(addons, fastify3, "fastify");
105
105
  let aop;
@@ -110,8 +110,8 @@ function bind(fastify, data, opts = {}) {
110
110
  globalPipe
111
111
  });
112
112
  }
113
- fastify3[http.type](joinUrl(http.prefix, http.route), define?.fastify || {}, async (req, res) => {
114
- debug(`invoke method "${func}" in module "${tag}"`);
113
+ fastify3[http.method](joinUrl(http.prefix, http.route), define?.fastify || {}, async (req, res) => {
114
+ debug(`invoke method "${method}" in module "${tag}"`);
115
115
  const contextData = {
116
116
  type: "fastify",
117
117
  category: "http",
@@ -120,7 +120,7 @@ function bind(fastify, data, opts = {}) {
120
120
  response: res,
121
121
  moduleMap,
122
122
  tag,
123
- func,
123
+ method,
124
124
  query: req.query,
125
125
  body: req.body,
126
126
  params: req.params,
@@ -1,8 +1,8 @@
1
1
  import { H3Event, Router, _RequestMiddleware } from 'h3';
2
- import { F as Factory } from '../../core-B5yKYkMJ.mjs';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-BKHBmSQN.mjs';
2
+ import { F as Factory } from '../../core-D1YYphEn.mjs';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-DtiHAXQB.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-C_eDyXnK.mjs';
5
+ import '../../meta-DNF6Fl27.mjs';
6
6
  import 'node:http';
7
7
 
8
8
  interface H3Ctx extends HttpCtx {
@@ -1,8 +1,8 @@
1
1
  import { H3Event, Router, _RequestMiddleware } from 'h3';
2
- import { F as Factory } from '../../core-BRuvL6hY.js';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-BuvMT1ta.js';
2
+ import { F as Factory } from '../../core-BTSHIAyB.js';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Cosv4nol.js';
4
4
  import 'phecda-core';
5
- import '../../meta-C_eDyXnK.js';
5
+ import '../../meta-DNF6Fl27.js';
6
6
  import 'node:http';
7
7
 
8
8
  interface H3Ctx extends HttpCtx {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkOV3UJLGPjs = require('../../chunk-OV3UJLGP.js');
7
+ var _chunkLD7YMHIEjs = require('../../chunk-LD7YMHIE.js');
8
8
 
9
9
 
10
10
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -16,14 +16,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/h3");
16
16
  function bind(router, data, opts = {}) {
17
17
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
18
18
  const { moduleMap, meta } = data;
19
- const metaMap = _chunkOV3UJLGPjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
- const { controller, http, func, tag } = meta2.data;
21
- if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
22
- debug(`register method "${func}" in module "${tag}"`);
19
+ const metaMap = _chunkLD7YMHIEjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const { controller, http, method, tag } = meta2.data;
21
+ if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
22
+ debug(`register method "${method}" in module "${tag}"`);
23
23
  return true;
24
24
  }
25
25
  });
26
- _chunkOV3UJLGPjs.detectAopDep.call(void 0, meta, {
26
+ _chunkLD7YMHIEjs.detectAopDep.call(void 0, meta, {
27
27
  addons: [
28
28
  ...globalAddons,
29
29
  ...parallelAddons
@@ -32,32 +32,32 @@ function bind(router, data, opts = {}) {
32
32
  });
33
33
  registerRoute();
34
34
  function registerRoute() {
35
- _chunkOV3UJLGPjs.Context.applyAddons(globalAddons, router, "h3");
35
+ _chunkLD7YMHIEjs.Context.applyAddons(globalAddons, router, "h3");
36
36
  if (parallelRoute) {
37
37
  const subRouter = _h3.createRouter.call(void 0, );
38
- _chunkOV3UJLGPjs.Context.applyAddons(parallelAddons, subRouter, "h3");
38
+ _chunkLD7YMHIEjs.Context.applyAddons(parallelAddons, subRouter, "h3");
39
39
  subRouter.post(parallelRoute, _h3.eventHandler.call(void 0, {
40
40
  handler: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, async (event) => {
41
41
  const body = await _h3.readBody.call(void 0, event, {
42
42
  strict: true
43
43
  });
44
44
  async function errorHandler(e) {
45
- const error = await _chunkOV3UJLGPjs.Context.filterRecord.default(e);
45
+ const error = await _chunkLD7YMHIEjs.Context.filterRecord.default(e);
46
46
  _h3.setResponseStatus.call(void 0, event, error.status);
47
47
  return error;
48
48
  }
49
49
  _chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
50
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkOV3UJLGPjs.BadRequestException)("data format should be an array"));
50
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkLD7YMHIEjs.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
  if (!item) return resolve(null);
55
- const { tag, func } = item;
56
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
57
- if (!metaMap.has(tag)) return resolve(await _chunkOV3UJLGPjs.Context.filterRecord.default(new (0, _chunkOV3UJLGPjs.BadRequestException)(`module "${tag}" doesn't exist`)));
58
- const meta2 = metaMap.get(tag)[func];
59
- if (!meta2) return resolve(await _chunkOV3UJLGPjs.Context.filterRecord.default(new (0, _chunkOV3UJLGPjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
60
- const aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
55
+ const { tag, method } = item;
56
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
57
+ if (!metaMap.has(tag)) return resolve(await _chunkLD7YMHIEjs.Context.filterRecord.default(new (0, _chunkLD7YMHIEjs.BadRequestException)(`module "${tag}" doesn't exist`)));
58
+ const meta2 = metaMap.get(tag)[method];
59
+ if (!meta2) return resolve(await _chunkLD7YMHIEjs.Context.filterRecord.default(new (0, _chunkLD7YMHIEjs.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
60
+ const aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
61
61
  globalFilter,
62
62
  globalGuards,
63
63
  globalPipe
@@ -81,7 +81,7 @@ function bind(router, data, opts = {}) {
81
81
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => event.node.req, "getRequest"),
82
82
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => event.node.res, "getResponse")
83
83
  };
84
- const context = new (0, _chunkOV3UJLGPjs.Context)(contextData);
84
+ const context = new (0, _chunkLD7YMHIEjs.Context)(contextData);
85
85
  context.run(aop, resolve, resolve);
86
86
  });
87
87
  }));
@@ -93,23 +93,23 @@ function bind(router, data, opts = {}) {
93
93
  router.use(parallelRoute, _h3.useBase.call(void 0, "", subRouter.handler));
94
94
  }
95
95
  for (const [tag, record] of metaMap) {
96
- for (const func in record) {
97
- const meta2 = metaMap.get(tag)[func];
96
+ for (const method in record) {
97
+ const meta2 = metaMap.get(tag)[method];
98
98
  const { data: { http, params, addons } } = meta2;
99
- if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
99
+ if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
100
100
  const needBody = params.some((item) => item.type === "body");
101
101
  let aop;
102
102
  if (!dynamic) {
103
- aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
103
+ aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
104
104
  globalFilter,
105
105
  globalGuards,
106
106
  globalPipe
107
107
  });
108
108
  }
109
109
  const subRouter = _h3.createRouter.call(void 0, );
110
- _chunkOV3UJLGPjs.Context.applyAddons(addons, subRouter, "h3");
111
- subRouter[http.type](_chunkOV3UJLGPjs.joinUrl.call(void 0, http.prefix, http.route), _h3.defineEventHandler.call(void 0, async (event) => {
112
- debug(`invoke method "${func}" in module "${tag}"`);
110
+ _chunkLD7YMHIEjs.Context.applyAddons(addons, subRouter, "h3");
111
+ subRouter[http.method](_chunkLD7YMHIEjs.joinUrl.call(void 0, http.prefix, http.route), _h3.defineEventHandler.call(void 0, async (event) => {
112
+ debug(`invoke method "${method}" in module "${tag}"`);
113
113
  const contextData = {
114
114
  type: "h3",
115
115
  category: "http",
@@ -117,7 +117,7 @@ function bind(router, data, opts = {}) {
117
117
  event,
118
118
  moduleMap,
119
119
  tag,
120
- func,
120
+ method,
121
121
  headers: _h3.getRequestHeaders.call(void 0, event),
122
122
  params: _h3.getRouterParams.call(void 0, event),
123
123
  query: _h3.getQuery.call(void 0, event),
@@ -134,10 +134,10 @@ function bind(router, data, opts = {}) {
134
134
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => event.node.req, "getRequest"),
135
135
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => event.node.res, "getResponse")
136
136
  };
137
- const context = new (0, _chunkOV3UJLGPjs.Context)(contextData);
137
+ const context = new (0, _chunkLD7YMHIEjs.Context)(contextData);
138
138
  _h3.setHeaders.call(void 0, event, http.headers || {});
139
139
  if (dynamic) {
140
- aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
140
+ aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
141
141
  globalFilter,
142
142
  globalGuards,
143
143
  globalPipe
@@ -148,7 +148,7 @@ function bind(router, data, opts = {}) {
148
148
  return err;
149
149
  });
150
150
  }));
151
- router.use(_chunkOV3UJLGPjs.joinUrl.call(void 0, http.prefix, http.route), _h3.useBase.call(void 0, "", subRouter.handler));
151
+ router.use(_chunkLD7YMHIEjs.joinUrl.call(void 0, http.prefix, http.route), _h3.useBase.call(void 0, "", subRouter.handler));
152
152
  }
153
153
  }
154
154
  }
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  joinUrl
7
- } from "../../chunk-P3CS65OP.mjs";
7
+ } from "../../chunk-G5IH3TP7.mjs";
8
8
  import {
9
9
  __name
10
10
  } from "../../chunk-NQ55PA2X.mjs";
@@ -17,9 +17,9 @@ function bind(router, data, opts = {}) {
17
17
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
18
18
  const { moduleMap, meta } = data;
19
19
  const metaMap = createControllerMetaMap(meta, (meta2) => {
20
- const { controller, http, func, tag } = meta2.data;
21
- if (controller === "http" && http?.type) {
22
- debug(`register method "${func}" in module "${tag}"`);
20
+ const { controller, http, method, tag } = meta2.data;
21
+ if (controller === "http" && http?.method) {
22
+ debug(`register method "${method}" in module "${tag}"`);
23
23
  return true;
24
24
  }
25
25
  });
@@ -52,11 +52,11 @@ function bind(router, data, opts = {}) {
52
52
  return Promise.all(body.map((item, i) => {
53
53
  return new Promise(async (resolve) => {
54
54
  if (!item) return resolve(null);
55
- const { tag, func } = item;
56
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
55
+ const { tag, method } = item;
56
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
57
57
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
58
- const meta2 = metaMap.get(tag)[func];
59
- if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
58
+ const meta2 = metaMap.get(tag)[method];
59
+ if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
60
60
  const aop = Context.getAop(meta2, {
61
61
  globalFilter,
62
62
  globalGuards,
@@ -93,10 +93,10 @@ function bind(router, data, opts = {}) {
93
93
  router.use(parallelRoute, useBase("", subRouter.handler));
94
94
  }
95
95
  for (const [tag, record] of metaMap) {
96
- for (const func in record) {
97
- const meta2 = metaMap.get(tag)[func];
96
+ for (const method in record) {
97
+ const meta2 = metaMap.get(tag)[method];
98
98
  const { data: { http, params, addons } } = meta2;
99
- if (!http?.type) continue;
99
+ if (!http?.method) continue;
100
100
  const needBody = params.some((item) => item.type === "body");
101
101
  let aop;
102
102
  if (!dynamic) {
@@ -108,8 +108,8 @@ function bind(router, data, opts = {}) {
108
108
  }
109
109
  const subRouter = createRouter();
110
110
  Context.applyAddons(addons, subRouter, "h3");
111
- subRouter[http.type](joinUrl(http.prefix, http.route), defineEventHandler(async (event) => {
112
- debug(`invoke method "${func}" in module "${tag}"`);
111
+ subRouter[http.method](joinUrl(http.prefix, http.route), defineEventHandler(async (event) => {
112
+ debug(`invoke method "${method}" in module "${tag}"`);
113
113
  const contextData = {
114
114
  type: "h3",
115
115
  category: "http",
@@ -117,7 +117,7 @@ function bind(router, data, opts = {}) {
117
117
  event,
118
118
  moduleMap,
119
119
  tag,
120
- func,
120
+ method,
121
121
  headers: getRequestHeaders(event),
122
122
  params: getRouterParams(event),
123
123
  query: getQuery(event),
@@ -1,8 +1,8 @@
1
1
  import { Context, Hono, MiddlewareHandler } from 'hono';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-BKHBmSQN.mjs';
3
- import { F as Factory } from '../../core-B5yKYkMJ.mjs';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-DtiHAXQB.mjs';
3
+ import { F as Factory } from '../../core-D1YYphEn.mjs';
4
4
  import 'node:http';
5
- import '../../meta-C_eDyXnK.mjs';
5
+ import '../../meta-DNF6Fl27.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface HonoCtx extends HttpCtx {
@@ -1,8 +1,8 @@
1
1
  import { Context, Hono, MiddlewareHandler } from 'hono';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-BuvMT1ta.js';
3
- import { F as Factory } from '../../core-BRuvL6hY.js';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Cosv4nol.js';
3
+ import { F as Factory } from '../../core-BTSHIAyB.js';
4
4
  import 'node:http';
5
- import '../../meta-C_eDyXnK.js';
5
+ import '../../meta-DNF6Fl27.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface HonoCtx extends HttpCtx {
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkOV3UJLGPjs = require('../../chunk-OV3UJLGP.js');
6
+ var _chunkLD7YMHIEjs = require('../../chunk-LD7YMHIE.js');
7
7
 
8
8
 
9
9
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -16,14 +16,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/hono");
16
16
  function bind(router, data, opts = {}) {
17
17
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
18
18
  const { moduleMap, meta } = data;
19
- const metaMap = _chunkOV3UJLGPjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
- const { controller, http, func, tag } = meta2.data;
21
- if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
22
- debug(`register method "${func}" in module "${tag}"`);
19
+ const metaMap = _chunkLD7YMHIEjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const { controller, http, method, tag } = meta2.data;
21
+ if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
22
+ debug(`register method "${method}" in module "${tag}"`);
23
23
  return true;
24
24
  }
25
25
  });
26
- _chunkOV3UJLGPjs.detectAopDep.call(void 0, meta, {
26
+ _chunkLD7YMHIEjs.detectAopDep.call(void 0, meta, {
27
27
  addons: [
28
28
  ...globalAddons,
29
29
  ...parallelAddons
@@ -34,26 +34,26 @@ function bind(router, data, opts = {}) {
34
34
  function registerRoute() {
35
35
  if (parallelRoute) {
36
36
  const subApp = new (0, _hono.Hono)();
37
- _chunkOV3UJLGPjs.Context.applyAddons(parallelAddons, subApp, "hono");
37
+ _chunkLD7YMHIEjs.Context.applyAddons(parallelAddons, subApp, "hono");
38
38
  subApp.post("", async (c) => {
39
39
  const body = await c.req.json();
40
40
  async function errorHandler(e) {
41
- const error = await _chunkOV3UJLGPjs.Context.filterRecord.default(e);
41
+ const error = await _chunkLD7YMHIEjs.Context.filterRecord.default(e);
42
42
  c.status(error.status);
43
43
  return c.json(error);
44
44
  }
45
45
  _chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
46
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkOV3UJLGPjs.BadRequestException)("data format should be an array"));
46
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkLD7YMHIEjs.BadRequestException)("data format should be an array"));
47
47
  try {
48
48
  return Promise.all(body.map((item, i) => {
49
49
  return new Promise(async (resolve) => {
50
50
  if (!item) return resolve(null);
51
- const { tag, func } = item;
52
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
53
- if (!metaMap.has(tag)) return resolve(await _chunkOV3UJLGPjs.Context.filterRecord.default(new (0, _chunkOV3UJLGPjs.BadRequestException)(`module "${tag}" doesn't exist`)));
54
- const meta2 = metaMap.get(tag)[func];
55
- if (!meta2) return resolve(await _chunkOV3UJLGPjs.Context.filterRecord.default(new (0, _chunkOV3UJLGPjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
56
- const aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
51
+ const { tag, method } = item;
52
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
53
+ if (!metaMap.has(tag)) return resolve(await _chunkLD7YMHIEjs.Context.filterRecord.default(new (0, _chunkLD7YMHIEjs.BadRequestException)(`module "${tag}" doesn't exist`)));
54
+ const meta2 = metaMap.get(tag)[method];
55
+ if (!meta2) return resolve(await _chunkLD7YMHIEjs.Context.filterRecord.default(new (0, _chunkLD7YMHIEjs.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
56
+ const aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
57
57
  globalFilter,
58
58
  globalGuards,
59
59
  globalPipe
@@ -79,7 +79,7 @@ function bind(router, data, opts = {}) {
79
79
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => c.req.raw, "getRequest"),
80
80
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => c.res, "getResponse")
81
81
  };
82
- const context = new (0, _chunkOV3UJLGPjs.Context)(contextData);
82
+ const context = new (0, _chunkLD7YMHIEjs.Context)(contextData);
83
83
  context.run(aop, resolve, resolve);
84
84
  });
85
85
  })).then((ret) => {
@@ -92,23 +92,23 @@ function bind(router, data, opts = {}) {
92
92
  router.route(parallelRoute, subApp);
93
93
  }
94
94
  for (const [tag, record] of metaMap) {
95
- for (const func in record) {
96
- const meta2 = metaMap.get(tag)[func];
95
+ for (const method in record) {
96
+ const meta2 = metaMap.get(tag)[method];
97
97
  const { data: { params, addons, http } } = meta2;
98
- if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
98
+ if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
99
99
  const needBody = params.some((item) => item.type === "body");
100
100
  let aop;
101
101
  if (!dynamic) {
102
- aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
102
+ aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
103
103
  globalFilter,
104
104
  globalGuards,
105
105
  globalPipe
106
106
  });
107
107
  }
108
108
  const subApp = new (0, _hono.Hono)();
109
- _chunkOV3UJLGPjs.Context.applyAddons(addons, subApp, "hono");
110
- subApp[http.type](http.route, async (c) => {
111
- debug(`invoke method "${func}" in module "${tag}"`);
109
+ _chunkLD7YMHIEjs.Context.applyAddons(addons, subApp, "hono");
110
+ subApp[http.method](http.route, async (c) => {
111
+ debug(`invoke method "${method}" in module "${tag}"`);
112
112
  const contextData = {
113
113
  type: "hono",
114
114
  category: "http",
@@ -116,7 +116,7 @@ function bind(router, data, opts = {}) {
116
116
  meta: meta2,
117
117
  moduleMap,
118
118
  tag,
119
- func,
119
+ method,
120
120
  query: c.req.query(),
121
121
  body: needBody ? await c.req.json() : void 0,
122
122
  params: c.req.param(),
@@ -133,12 +133,12 @@ function bind(router, data, opts = {}) {
133
133
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => c.req.raw, "getRequest"),
134
134
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => c.res, "getResponse")
135
135
  };
136
- const context = new (0, _chunkOV3UJLGPjs.Context)(contextData);
136
+ const context = new (0, _chunkLD7YMHIEjs.Context)(contextData);
137
137
  if (http.headers) {
138
138
  for (const name in http.headers) c.header(name, http.headers[name]);
139
139
  }
140
140
  if (dynamic) {
141
- aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
141
+ aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
142
142
  globalFilter,
143
143
  globalGuards,
144
144
  globalPipe
@@ -3,7 +3,7 @@ import {
3
3
  Context,
4
4
  createControllerMetaMap,
5
5
  detectAopDep
6
- } from "../../chunk-P3CS65OP.mjs";
6
+ } from "../../chunk-G5IH3TP7.mjs";
7
7
  import {
8
8
  __name
9
9
  } from "../../chunk-NQ55PA2X.mjs";
@@ -17,9 +17,9 @@ function bind(router, data, opts = {}) {
17
17
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
18
18
  const { moduleMap, meta } = data;
19
19
  const metaMap = createControllerMetaMap(meta, (meta2) => {
20
- const { controller, http, func, tag } = meta2.data;
21
- if (controller === "http" && http?.type) {
22
- debug(`register method "${func}" in module "${tag}"`);
20
+ const { controller, http, method, tag } = meta2.data;
21
+ if (controller === "http" && http?.method) {
22
+ debug(`register method "${method}" in module "${tag}"`);
23
23
  return true;
24
24
  }
25
25
  });
@@ -48,11 +48,11 @@ function bind(router, data, opts = {}) {
48
48
  return Promise.all(body.map((item, i) => {
49
49
  return new Promise(async (resolve) => {
50
50
  if (!item) return resolve(null);
51
- const { tag, func } = item;
52
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
51
+ const { tag, method } = item;
52
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
53
53
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
54
- const meta2 = metaMap.get(tag)[func];
55
- if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
54
+ const meta2 = metaMap.get(tag)[method];
55
+ if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
56
56
  const aop = Context.getAop(meta2, {
57
57
  globalFilter,
58
58
  globalGuards,
@@ -92,10 +92,10 @@ function bind(router, data, opts = {}) {
92
92
  router.route(parallelRoute, subApp);
93
93
  }
94
94
  for (const [tag, record] of metaMap) {
95
- for (const func in record) {
96
- const meta2 = metaMap.get(tag)[func];
95
+ for (const method in record) {
96
+ const meta2 = metaMap.get(tag)[method];
97
97
  const { data: { params, addons, http } } = meta2;
98
- if (!http?.type) continue;
98
+ if (!http?.method) continue;
99
99
  const needBody = params.some((item) => item.type === "body");
100
100
  let aop;
101
101
  if (!dynamic) {
@@ -107,8 +107,8 @@ function bind(router, data, opts = {}) {
107
107
  }
108
108
  const subApp = new Hono();
109
109
  Context.applyAddons(addons, subApp, "hono");
110
- subApp[http.type](http.route, async (c) => {
111
- debug(`invoke method "${func}" in module "${tag}"`);
110
+ subApp[http.method](http.route, async (c) => {
111
+ debug(`invoke method "${method}" in module "${tag}"`);
112
112
  const contextData = {
113
113
  type: "hono",
114
114
  category: "http",
@@ -116,7 +116,7 @@ function bind(router, data, opts = {}) {
116
116
  meta: meta2,
117
117
  moduleMap,
118
118
  tag,
119
- func,
119
+ method,
120
120
  query: c.req.query(),
121
121
  body: needBody ? await c.req.json() : void 0,
122
122
  params: c.req.param(),
@@ -1,8 +1,8 @@
1
1
  import { Request, Response, Router, MiddlewareHandler } from 'hyper-express';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-BKHBmSQN.mjs';
3
- import { F as Factory } from '../../core-B5yKYkMJ.mjs';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-DtiHAXQB.mjs';
3
+ import { F as Factory } from '../../core-D1YYphEn.mjs';
4
4
  import 'node:http';
5
- import '../../meta-C_eDyXnK.mjs';
5
+ import '../../meta-DNF6Fl27.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface HyperExpressCtx extends HttpCtx {
@@ -1,8 +1,8 @@
1
1
  import { Request, Response, Router, MiddlewareHandler } from 'hyper-express';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-BuvMT1ta.js';
3
- import { F as Factory } from '../../core-BRuvL6hY.js';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Cosv4nol.js';
3
+ import { F as Factory } from '../../core-BTSHIAyB.js';
4
4
  import 'node:http';
5
- import '../../meta-C_eDyXnK.js';
5
+ import '../../meta-DNF6Fl27.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface HyperExpressCtx extends HttpCtx {