phecda-server 7.0.0-alpha.0 → 7.0.0-alpha.2

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 (76) hide show
  1. package/assets/ps.json +24 -24
  2. package/bin/cli.mjs +12 -7
  3. package/dist/{chunk-P75VKZJY.mjs → chunk-3FHZB3Z5.mjs} +48 -17
  4. package/dist/{chunk-BGXSMOLX.js → chunk-7YQ57BQS.js} +1 -1
  5. package/dist/{chunk-SW5IKE5H.js → chunk-NQIFUZL4.js} +47 -16
  6. package/dist/{chunk-5622RBNB.mjs → chunk-XYVMNY2X.mjs} +1 -1
  7. package/dist/{core-CYwEPfN4.d.ts → core-C1kHRqU9.d.ts} +1 -1
  8. package/dist/{core-BIcUwV18.d.mts → core-CSiaRU7r.d.mts} +1 -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 +19 -17
  16. package/dist/http/elysia/index.mjs +3 -1
  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 +19 -17
  20. package/dist/http/express/index.mjs +3 -1
  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 +18 -16
  24. package/dist/http/fastify/index.mjs +3 -1
  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 +18 -16
  28. package/dist/http/h3/index.mjs +3 -1
  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 +17 -15
  32. package/dist/http/hono/index.mjs +3 -1
  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 +17 -15
  36. package/dist/http/hyper-express/index.mjs +3 -1
  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 +19 -17
  40. package/dist/http/koa/index.mjs +3 -1
  41. package/dist/index.d.mts +11 -11
  42. package/dist/index.d.ts +11 -11
  43. package/dist/index.js +21 -21
  44. package/dist/index.mjs +3 -3
  45. package/dist/{meta-BXKLFTgG.d.mts → meta-D1M85Hef.d.mts} +1 -0
  46. package/dist/{meta-BXKLFTgG.d.ts → meta-D1M85Hef.d.ts} +1 -0
  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 +9 -8
  50. package/dist/rpc/bullmq/index.mjs +2 -1
  51. package/dist/rpc/kafka/index.d.mts +3 -3
  52. package/dist/rpc/kafka/index.d.ts +3 -3
  53. package/dist/rpc/kafka/index.js +8 -7
  54. package/dist/rpc/kafka/index.mjs +2 -1
  55. package/dist/rpc/nats/index.d.mts +3 -3
  56. package/dist/rpc/nats/index.d.ts +3 -3
  57. package/dist/rpc/nats/index.js +8 -7
  58. package/dist/rpc/nats/index.mjs +2 -1
  59. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  60. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  61. package/dist/rpc/rabbitmq/index.js +9 -8
  62. package/dist/rpc/rabbitmq/index.mjs +2 -1
  63. package/dist/rpc/redis/index.d.mts +3 -3
  64. package/dist/rpc/redis/index.d.ts +3 -3
  65. package/dist/rpc/redis/index.js +9 -8
  66. package/dist/rpc/redis/index.mjs +2 -1
  67. package/dist/test.d.mts +3 -3
  68. package/dist/test.d.ts +3 -3
  69. package/dist/test.js +2 -2
  70. package/dist/test.mjs +1 -1
  71. package/dist/{types-BtbL49Zs.d.mts → types-C9Remkup.d.ts} +2 -1
  72. package/dist/{types-m3IEDKjP.d.ts → types-JMhFVp-Z.d.mts} +2 -1
  73. package/dist/{types-VFzEM7LL.d.ts → types-ee1FBodH.d.ts} +2 -1
  74. package/dist/{types-h40T3cRG.d.mts → types-wbHHC93P.d.mts} +2 -1
  75. package/package.json +1 -1
  76. package/register/loader.mjs +366 -367
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkSW5IKE5Hjs = require('../../chunk-SW5IKE5H.js');
8
+ var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
9
9
 
10
10
 
11
11
  var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
@@ -18,14 +18,14 @@ function bind(router, data, opts = {}) {
18
18
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
19
19
  const { moduleMap, meta } = data;
20
20
  const originStack = router.stack.slice(0, router.stack.length);
21
- const metaMap = _chunkSW5IKE5Hjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, http, func, tag } = meta2.data;
23
23
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
24
24
  debug(`register method "${func}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkSW5IKE5Hjs.detectAopDep.call(void 0, meta, {
28
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -33,39 +33,40 @@ function bind(router, data, opts = {}) {
33
33
  guards: globalGuards
34
34
  });
35
35
  registerRoute();
36
- _chunkSW5IKE5Hjs.HMR.call(void 0, async () => {
36
+ _chunkNQIFUZL4js.HMR.call(void 0, async () => {
37
37
  router.stack = originStack;
38
38
  registerRoute();
39
39
  });
40
40
  function registerRoute() {
41
- _chunkSW5IKE5Hjs.Context.applyAddons(globalAddons, router, "express");
41
+ _chunkNQIFUZL4js.Context.applyAddons(globalAddons, router, "express");
42
42
  if (parallelRoute) {
43
43
  const subRouter = _express.Router.call(void 0, );
44
- _chunkSW5IKE5Hjs.Context.applyAddons(parallelAddons, subRouter, "express");
44
+ _chunkNQIFUZL4js.Context.applyAddons(parallelAddons, subRouter, "express");
45
45
  subRouter.use(async (req, res, next) => {
46
46
  const { body } = req;
47
47
  async function errorHandler(e) {
48
- const error = await _chunkSW5IKE5Hjs.Context.filterRecord.default(e);
48
+ const error = await _chunkNQIFUZL4js.Context.filterRecord.default(e);
49
49
  return res.status(error.status).json(error);
50
50
  }
51
51
  _chunkJ5CFUN4Vjs.__name.call(void 0, errorHandler, "errorHandler");
52
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkSW5IKE5Hjs.BadRequestException)("data format should be an array"));
52
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkNQIFUZL4js.BadRequestException)("data format should be an array"));
53
53
  try {
54
54
  return Promise.all(body.map((item, i) => {
55
55
  return new Promise(async (resolve) => {
56
56
  const { tag, func } = item;
57
57
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
58
- if (!metaMap.has(tag)) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`module "${tag}" doesn't exist`)));
58
+ if (!metaMap.has(tag)) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`module "${tag}" doesn't exist`)));
59
59
  const meta2 = metaMap.get(tag)[func];
60
- if (!meta2) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
60
+ if (!meta2) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
61
61
  const { data: { params } } = meta2;
62
- const aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
62
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
63
63
  globalFilter,
64
64
  globalGuards,
65
65
  globalPipe
66
66
  });
67
67
  const contextData = {
68
68
  type: "express",
69
+ category: "http",
69
70
  parallel: true,
70
71
  request: req,
71
72
  index: i,
@@ -76,7 +77,7 @@ function bind(router, data, opts = {}) {
76
77
  func,
77
78
  next,
78
79
  app: router,
79
- ..._chunkSW5IKE5Hjs.argToReq.call(void 0, params, item.args, req.headers),
80
+ ..._chunkNQIFUZL4js.argToReq.call(void 0, params, item.args, req.headers),
80
81
  getCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
81
82
  setCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
82
83
  delCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => res.cookie(key, "", {
@@ -88,7 +89,7 @@ function bind(router, data, opts = {}) {
88
89
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => req, "getRequest"),
89
90
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => res, "getResponse")
90
91
  };
91
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
92
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
92
93
  context.run(aop, resolve, resolve);
93
94
  });
94
95
  })).then((ret) => {
@@ -107,18 +108,19 @@ function bind(router, data, opts = {}) {
107
108
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
108
109
  let aop;
109
110
  if (!dynamic) {
110
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
111
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
111
112
  globalFilter,
112
113
  globalGuards,
113
114
  globalPipe
114
115
  });
115
116
  }
116
117
  const subRouter = _express.Router.call(void 0, );
117
- _chunkSW5IKE5Hjs.Context.applyAddons(addons, subRouter, "express");
118
+ _chunkNQIFUZL4js.Context.applyAddons(addons, subRouter, "express");
118
119
  subRouter[http.type](http.prefix + http.route, async (req, res, next) => {
119
120
  debug(`invoke method "${func}" in module "${tag}"`);
120
121
  const contextData = {
121
122
  type: "express",
123
+ category: "http",
122
124
  request: req,
123
125
  meta: meta2,
124
126
  response: res,
@@ -142,10 +144,10 @@ function bind(router, data, opts = {}) {
142
144
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => req, "getRequest"),
143
145
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => res, "getResponse")
144
146
  };
145
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
147
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
146
148
  if (http.headers) res.set(http.headers);
147
149
  if (dynamic) {
148
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
150
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
149
151
  globalFilter,
150
152
  globalGuards,
151
153
  globalPipe
@@ -5,7 +5,7 @@ import {
5
5
  argToReq,
6
6
  createControllerMetaMap,
7
7
  detectAopDep
8
- } from "../../chunk-P75VKZJY.mjs";
8
+ } from "../../chunk-3FHZB3Z5.mjs";
9
9
  import {
10
10
  __name
11
11
  } from "../../chunk-WHJ5FALK.mjs";
@@ -66,6 +66,7 @@ function bind(router, data, opts = {}) {
66
66
  });
67
67
  const contextData = {
68
68
  type: "express",
69
+ category: "http",
69
70
  parallel: true,
70
71
  request: req,
71
72
  index: i,
@@ -119,6 +120,7 @@ function bind(router, data, opts = {}) {
119
120
  debug(`invoke method "${func}" in module "${tag}"`);
120
121
  const contextData = {
121
122
  type: "express",
123
+ category: "http",
122
124
  request: req,
123
125
  meta: meta2,
124
126
  response: res,
@@ -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-h40T3cRG.mjs';
3
- import { F as Factory } from '../../core-BIcUwV18.mjs';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-wbHHC93P.mjs';
3
+ import { F as Factory } from '../../core-CSiaRU7r.mjs';
4
4
  import 'node:http';
5
- import '../../meta-BXKLFTgG.mjs';
5
+ import '../../meta-D1M85Hef.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-VFzEM7LL.js';
3
- import { F as Factory } from '../../core-CYwEPfN4.js';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-ee1FBodH.js';
3
+ import { F as Factory } from '../../core-C1kHRqU9.js';
4
4
  import 'node:http';
5
- import '../../meta-BXKLFTgG.js';
5
+ import '../../meta-D1M85Hef.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface FastifyCtx extends HttpContext {
@@ -7,7 +7,7 @@ var _chunkMBCHNDAYjs = require('../../chunk-MBCHNDAY.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkSW5IKE5Hjs = require('../../chunk-SW5IKE5H.js');
10
+ var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
11
11
 
12
12
 
13
13
  var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
@@ -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, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, fastifyOpts, dynamic = false } = opts;
20
20
  const { moduleMap, meta } = data;
21
- const metaMap = _chunkSW5IKE5Hjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkNQIFUZL4js.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
- _chunkSW5IKE5Hjs.detectAopDep.call(void 0, meta, {
28
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -33,34 +33,35 @@ function bind(fastify, data, opts = {}) {
33
33
  guards: globalGuards
34
34
  });
35
35
  fastify.register(async (fastify2, _, done) => {
36
- _chunkSW5IKE5Hjs.Context.applyAddons(globalAddons, fastify2, "fastify");
36
+ _chunkNQIFUZL4js.Context.applyAddons(globalAddons, fastify2, "fastify");
37
37
  if (parallelRoute) {
38
38
  fastify2.register(async (fastify3, _opts, done2) => {
39
- _chunkSW5IKE5Hjs.Context.applyAddons(parallelAddons, fastify3, "fastify");
39
+ _chunkNQIFUZL4js.Context.applyAddons(parallelAddons, fastify3, "fastify");
40
40
  fastify3.post(parallelRoute, async (req, res) => {
41
41
  const { body } = req;
42
42
  async function errorHandler(e) {
43
- const error = await _chunkSW5IKE5Hjs.Context.filterRecord.default(e);
43
+ const error = await _chunkNQIFUZL4js.Context.filterRecord.default(e);
44
44
  return res.status(error.status).send(error);
45
45
  }
46
46
  _chunkJ5CFUN4Vjs.__name.call(void 0, errorHandler, "errorHandler");
47
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkSW5IKE5Hjs.BadRequestException)("data format should be an array"));
47
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkNQIFUZL4js.BadRequestException)("data format should be an array"));
48
48
  try {
49
49
  return Promise.all(body.map((item, i) => {
50
50
  return new Promise(async (resolve) => {
51
51
  const { tag, func } = item;
52
52
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
53
- if (!metaMap.has(tag)) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`module "${tag}" doesn't exist`)));
53
+ if (!metaMap.has(tag)) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`module "${tag}" doesn't exist`)));
54
54
  const meta2 = metaMap.get(tag)[func];
55
- if (!meta2) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
55
+ if (!meta2) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
56
56
  const { data: { params } } = meta2;
57
- const aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
57
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
58
58
  globalFilter,
59
59
  globalGuards,
60
60
  globalPipe
61
61
  });
62
62
  const contextData = {
63
63
  type: "fastify",
64
+ category: "http",
64
65
  parallel: true,
65
66
  request: req,
66
67
  index: i,
@@ -70,7 +71,7 @@ function bind(fastify, data, opts = {}) {
70
71
  tag,
71
72
  func,
72
73
  app: fastify3,
73
- ..._chunkSW5IKE5Hjs.argToReq.call(void 0, params, item.args, req.headers),
74
+ ..._chunkNQIFUZL4js.argToReq.call(void 0, params, item.args, req.headers),
74
75
  // @ts-expect-error need @fastify/cookie
75
76
  getCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
76
77
  // @ts-expect-error need @fastify/cookie
@@ -83,7 +84,7 @@ function bind(fastify, data, opts = {}) {
83
84
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => req.raw, "getRequest"),
84
85
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => res.raw, "getResponse")
85
86
  };
86
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
87
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
87
88
  context.run(aop, resolve, resolve);
88
89
  });
89
90
  })).then((ret) => {
@@ -102,10 +103,10 @@ function bind(fastify, data, opts = {}) {
102
103
  const { data: { addons, define, http } } = meta2;
103
104
  if (!_optionalChain([http, 'optionalAccess', _3 => _3.type])) continue;
104
105
  fastify2.register(async (fastify3, _opts, done2) => {
105
- _chunkSW5IKE5Hjs.Context.applyAddons(addons, fastify3, "fastify");
106
+ _chunkNQIFUZL4js.Context.applyAddons(addons, fastify3, "fastify");
106
107
  let aop;
107
108
  if (!dynamic) {
108
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
109
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
109
110
  globalFilter,
110
111
  globalGuards,
111
112
  globalPipe
@@ -115,6 +116,7 @@ function bind(fastify, data, opts = {}) {
115
116
  debug(`invoke method "${func}" in module "${tag}"`);
116
117
  const contextData = {
117
118
  type: "fastify",
119
+ category: "http",
118
120
  request: req,
119
121
  meta: meta2,
120
122
  response: res,
@@ -140,10 +142,10 @@ function bind(fastify, data, opts = {}) {
140
142
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => req.raw, "getRequest"),
141
143
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => res.raw, "getResponse")
142
144
  };
143
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
145
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
144
146
  if (http.headers) res.headers(http.headers);
145
147
  if (dynamic) {
146
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
148
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
147
149
  globalFilter,
148
150
  globalGuards,
149
151
  globalPipe
@@ -7,7 +7,7 @@ import {
7
7
  argToReq,
8
8
  createControllerMetaMap,
9
9
  detectAopDep
10
- } from "../../chunk-P75VKZJY.mjs";
10
+ } from "../../chunk-3FHZB3Z5.mjs";
11
11
  import {
12
12
  __name
13
13
  } from "../../chunk-WHJ5FALK.mjs";
@@ -61,6 +61,7 @@ function bind(fastify, data, opts = {}) {
61
61
  });
62
62
  const contextData = {
63
63
  type: "fastify",
64
+ category: "http",
64
65
  parallel: true,
65
66
  request: req,
66
67
  index: i,
@@ -115,6 +116,7 @@ function bind(fastify, data, opts = {}) {
115
116
  debug(`invoke method "${func}" in module "${tag}"`);
116
117
  const contextData = {
117
118
  type: "fastify",
119
+ category: "http",
118
120
  request: req,
119
121
  meta: meta2,
120
122
  response: res,
@@ -1,8 +1,8 @@
1
1
  import { H3Event, Router, _RequestMiddleware } from 'h3';
2
- import { F as Factory } from '../../core-BIcUwV18.mjs';
3
- import { H as HttpContext, a as HttpOptions } from '../../types-h40T3cRG.mjs';
2
+ import { F as Factory } from '../../core-CSiaRU7r.mjs';
3
+ import { H as HttpContext, a as HttpOptions } from '../../types-wbHHC93P.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-BXKLFTgG.mjs';
5
+ import '../../meta-D1M85Hef.mjs';
6
6
  import 'node:http';
7
7
 
8
8
  interface H3Ctx extends HttpContext {
@@ -1,8 +1,8 @@
1
1
  import { H3Event, Router, _RequestMiddleware } from 'h3';
2
- import { F as Factory } from '../../core-CYwEPfN4.js';
3
- import { H as HttpContext, a as HttpOptions } from '../../types-VFzEM7LL.js';
2
+ import { F as Factory } from '../../core-C1kHRqU9.js';
3
+ import { H as HttpContext, a as HttpOptions } from '../../types-ee1FBodH.js';
4
4
  import 'phecda-core';
5
- import '../../meta-BXKLFTgG.js';
5
+ import '../../meta-D1M85Hef.js';
6
6
  import 'node:http';
7
7
 
8
8
  interface H3Ctx extends HttpContext {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkSW5IKE5Hjs = require('../../chunk-SW5IKE5H.js');
7
+ var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
8
8
 
9
9
 
10
10
  var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.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 = _chunkSW5IKE5Hjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
19
+ const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
20
  const { controller, http, func, tag } = meta2.data;
21
21
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
22
22
  debug(`register method "${func}" in module "${tag}"`);
23
23
  return true;
24
24
  }
25
25
  });
26
- _chunkSW5IKE5Hjs.detectAopDep.call(void 0, meta, {
26
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
27
27
  addons: [
28
28
  ...globalAddons,
29
29
  ...parallelAddons
@@ -32,38 +32,39 @@ function bind(router, data, opts = {}) {
32
32
  });
33
33
  registerRoute();
34
34
  function registerRoute() {
35
- _chunkSW5IKE5Hjs.Context.applyAddons(globalAddons, router, "h3");
35
+ _chunkNQIFUZL4js.Context.applyAddons(globalAddons, router, "h3");
36
36
  if (parallelRoute) {
37
37
  const subRouter = _h3.createRouter.call(void 0, );
38
- _chunkSW5IKE5Hjs.Context.applyAddons(parallelAddons, subRouter, "h3");
38
+ _chunkNQIFUZL4js.Context.applyAddons(parallelAddons, subRouter, "h3");
39
39
  subRouter.post(parallelRoute, _h3.eventHandler.call(void 0, {
40
40
  handler: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__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 _chunkSW5IKE5Hjs.Context.filterRecord.default(e);
45
+ const error = await _chunkNQIFUZL4js.Context.filterRecord.default(e);
46
46
  _h3.setResponseStatus.call(void 0, event, error.status);
47
47
  return error;
48
48
  }
49
49
  _chunkJ5CFUN4Vjs.__name.call(void 0, errorHandler, "errorHandler");
50
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkSW5IKE5Hjs.BadRequestException)("data format should be an array"));
50
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkNQIFUZL4js.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 _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`module "${tag}" doesn't exist`)));
56
+ if (!metaMap.has(tag)) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`module "${tag}" doesn't exist`)));
57
57
  const meta2 = metaMap.get(tag)[func];
58
- if (!meta2) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
58
+ if (!meta2) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
59
59
  const { data: { params } } = meta2;
60
- const aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
60
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
61
61
  globalFilter,
62
62
  globalGuards,
63
63
  globalPipe
64
64
  });
65
65
  const contextData = {
66
66
  type: "h3",
67
+ category: "http",
67
68
  index: i,
68
69
  event,
69
70
  meta: meta2,
@@ -72,7 +73,7 @@ function bind(router, data, opts = {}) {
72
73
  func,
73
74
  parallel: true,
74
75
  app: router,
75
- ..._chunkSW5IKE5Hjs.argToReq.call(void 0, params, item.args, _h3.getRequestHeaders.call(void 0, event)),
76
+ ..._chunkNQIFUZL4js.argToReq.call(void 0, params, item.args, _h3.getRequestHeaders.call(void 0, event)),
76
77
  getCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => _h3.getCookie.call(void 0, event, key), "getCookie"),
77
78
  setCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key, value, opts2) => _h3.setCookie.call(void 0, event, key, value, opts2), "setCookie"),
78
79
  delCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => _h3.deleteCookie.call(void 0, event, key), "delCookie"),
@@ -82,7 +83,7 @@ function bind(router, data, opts = {}) {
82
83
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => event.node.req, "getRequest"),
83
84
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => event.node.res, "getResponse")
84
85
  };
85
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
86
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
86
87
  context.run(aop, resolve, resolve);
87
88
  });
88
89
  }));
@@ -101,18 +102,19 @@ function bind(router, data, opts = {}) {
101
102
  const needBody = params.some((item) => item.type === "body");
102
103
  let aop;
103
104
  if (!dynamic) {
104
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
105
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
105
106
  globalFilter,
106
107
  globalGuards,
107
108
  globalPipe
108
109
  });
109
110
  }
110
111
  const subRouter = _h3.createRouter.call(void 0, );
111
- _chunkSW5IKE5Hjs.Context.applyAddons(addons, subRouter, "h3");
112
+ _chunkNQIFUZL4js.Context.applyAddons(addons, subRouter, "h3");
112
113
  subRouter[http.type](http.prefix + http.route, _h3.defineEventHandler.call(void 0, async (event) => {
113
114
  debug(`invoke method "${func}" in module "${tag}"`);
114
115
  const contextData = {
115
116
  type: "h3",
117
+ category: "http",
116
118
  meta: meta2,
117
119
  event,
118
120
  moduleMap,
@@ -134,10 +136,10 @@ function bind(router, data, opts = {}) {
134
136
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => event.node.req, "getRequest"),
135
137
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => event.node.res, "getResponse")
136
138
  };
137
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
139
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
138
140
  _h3.setHeaders.call(void 0, event, http.headers || {});
139
141
  if (dynamic) {
140
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
142
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
141
143
  globalFilter,
142
144
  globalGuards,
143
145
  globalPipe
@@ -4,7 +4,7 @@ import {
4
4
  argToReq,
5
5
  createControllerMetaMap,
6
6
  detectAopDep
7
- } from "../../chunk-P75VKZJY.mjs";
7
+ } from "../../chunk-3FHZB3Z5.mjs";
8
8
  import {
9
9
  __name
10
10
  } from "../../chunk-WHJ5FALK.mjs";
@@ -64,6 +64,7 @@ function bind(router, data, opts = {}) {
64
64
  });
65
65
  const contextData = {
66
66
  type: "h3",
67
+ category: "http",
67
68
  index: i,
68
69
  event,
69
70
  meta: meta2,
@@ -113,6 +114,7 @@ function bind(router, data, opts = {}) {
113
114
  debug(`invoke method "${func}" in module "${tag}"`);
114
115
  const contextData = {
115
116
  type: "h3",
117
+ category: "http",
116
118
  meta: meta2,
117
119
  event,
118
120
  moduleMap,
@@ -1,8 +1,8 @@
1
1
  import { Context, Hono, MiddlewareHandler } from 'hono';
2
- import { H as HttpContext, a as HttpOptions } from '../../types-h40T3cRG.mjs';
3
- import { F as Factory } from '../../core-BIcUwV18.mjs';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-wbHHC93P.mjs';
3
+ import { F as Factory } from '../../core-CSiaRU7r.mjs';
4
4
  import 'node:http';
5
- import '../../meta-BXKLFTgG.mjs';
5
+ import '../../meta-D1M85Hef.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface HonoCtx extends HttpContext {
@@ -1,8 +1,8 @@
1
1
  import { Context, Hono, MiddlewareHandler } from 'hono';
2
- import { H as HttpContext, a as HttpOptions } from '../../types-VFzEM7LL.js';
3
- import { F as Factory } from '../../core-CYwEPfN4.js';
2
+ import { H as HttpContext, a as HttpOptions } from '../../types-ee1FBodH.js';
3
+ import { F as Factory } from '../../core-C1kHRqU9.js';
4
4
  import 'node:http';
5
- import '../../meta-BXKLFTgG.js';
5
+ import '../../meta-D1M85Hef.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface HonoCtx extends HttpContext {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkSW5IKE5Hjs = require('../../chunk-SW5IKE5H.js');
7
+ var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
8
8
 
9
9
 
10
10
  var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
@@ -17,14 +17,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/hono");
17
17
  function bind(router, data, opts = {}) {
18
18
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
19
19
  const { moduleMap, meta } = data;
20
- const metaMap = _chunkSW5IKE5Hjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const metaMap = _chunkNQIFUZL4js.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
- _chunkSW5IKE5Hjs.detectAopDep.call(void 0, meta, {
27
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
28
28
  addons: [
29
29
  ...globalAddons,
30
30
  ...parallelAddons
@@ -35,26 +35,26 @@ function bind(router, data, opts = {}) {
35
35
  function registerRoute() {
36
36
  if (parallelRoute) {
37
37
  const subApp = new (0, _hono.Hono)();
38
- _chunkSW5IKE5Hjs.Context.applyAddons(parallelAddons, subApp, "hono");
38
+ _chunkNQIFUZL4js.Context.applyAddons(parallelAddons, subApp, "hono");
39
39
  subApp.post("", async (c) => {
40
40
  const body = await c.req.json();
41
41
  async function errorHandler(e) {
42
- const error = await _chunkSW5IKE5Hjs.Context.filterRecord.default(e);
42
+ const error = await _chunkNQIFUZL4js.Context.filterRecord.default(e);
43
43
  c.status(error.status);
44
44
  return c.json(error);
45
45
  }
46
46
  _chunkJ5CFUN4Vjs.__name.call(void 0, errorHandler, "errorHandler");
47
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkSW5IKE5Hjs.BadRequestException)("data format should be an array"));
47
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkNQIFUZL4js.BadRequestException)("data format should be an array"));
48
48
  try {
49
49
  return Promise.all(body.map((item, i) => {
50
50
  return new Promise(async (resolve) => {
51
51
  const { tag, func } = item;
52
52
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
53
- if (!metaMap.has(tag)) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`module "${tag}" doesn't exist`)));
53
+ if (!metaMap.has(tag)) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`module "${tag}" doesn't exist`)));
54
54
  const meta2 = metaMap.get(tag)[func];
55
- if (!meta2) return resolve(await _chunkSW5IKE5Hjs.Context.filterRecord.default(new (0, _chunkSW5IKE5Hjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
55
+ if (!meta2) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
56
56
  const { data: { params } } = meta2;
57
- const aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
57
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
58
58
  globalFilter,
59
59
  globalGuards,
60
60
  globalPipe
@@ -62,6 +62,7 @@ function bind(router, data, opts = {}) {
62
62
  const contextData = {
63
63
  type: "hono",
64
64
  parallel: true,
65
+ category: "http",
65
66
  context: c,
66
67
  index: i,
67
68
  meta: meta2,
@@ -69,7 +70,7 @@ function bind(router, data, opts = {}) {
69
70
  tag,
70
71
  func,
71
72
  app: router,
72
- ..._chunkSW5IKE5Hjs.argToReq.call(void 0, params, item.args, c.req.header()),
73
+ ..._chunkNQIFUZL4js.argToReq.call(void 0, params, item.args, c.req.header()),
73
74
  getCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => _cookie.getCookie.call(void 0, c, key), "getCookie"),
74
75
  delCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => _cookie.deleteCookie.call(void 0, c, key), "delCookie"),
75
76
  setCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key, value, opts2) => _cookie.setCookie.call(void 0, c, key, value, opts2), "setCookie"),
@@ -81,7 +82,7 @@ function bind(router, data, opts = {}) {
81
82
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => c.req.raw, "getRequest"),
82
83
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => c.res, "getResponse")
83
84
  };
84
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
85
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
85
86
  context.run(aop, resolve, resolve);
86
87
  });
87
88
  })).then((ret) => {
@@ -101,18 +102,19 @@ function bind(router, data, opts = {}) {
101
102
  const needBody = params.some((item) => item.type === "body");
102
103
  let aop;
103
104
  if (!dynamic) {
104
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
105
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
105
106
  globalFilter,
106
107
  globalGuards,
107
108
  globalPipe
108
109
  });
109
110
  }
110
111
  const subApp = new (0, _hono.Hono)();
111
- _chunkSW5IKE5Hjs.Context.applyAddons(addons, subApp, "hono");
112
+ _chunkNQIFUZL4js.Context.applyAddons(addons, subApp, "hono");
112
113
  subApp[http.type](http.route, async (c) => {
113
114
  debug(`invoke method "${func}" in module "${tag}"`);
114
115
  const contextData = {
115
116
  type: "hono",
117
+ category: "http",
116
118
  context: c,
117
119
  meta: meta2,
118
120
  moduleMap,
@@ -134,12 +136,12 @@ function bind(router, data, opts = {}) {
134
136
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => c.req.raw, "getRequest"),
135
137
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => c.res, "getResponse")
136
138
  };
137
- const context = new (0, _chunkSW5IKE5Hjs.Context)(contextData);
139
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
138
140
  if (http.headers) {
139
141
  for (const name in http.headers) c.header(name, http.headers[name]);
140
142
  }
141
143
  if (dynamic) {
142
- aop = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
144
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
143
145
  globalFilter,
144
146
  globalGuards,
145
147
  globalPipe