phecda-server 7.1.4 → 8.0.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 (84) hide show
  1. package/dist/{chunk-MKRHYZCL.mjs → chunk-FI5756JX.mjs} +2 -2
  2. package/dist/{chunk-YRS4ECPT.js → chunk-OLNN4U3O.js} +12 -8
  3. package/dist/{chunk-5MAGRSEM.mjs → chunk-PFPOEZHH.mjs} +12 -8
  4. package/dist/{chunk-DPPDWBYO.js → chunk-UYZSUBX4.js} +2 -2
  5. package/dist/{chunk-P3CS65OP.mjs → chunk-VAHCYYCB.mjs} +32 -17
  6. package/dist/{chunk-OV3UJLGP.js → chunk-YJ3QHGTC.js} +32 -17
  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
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  joinUrl
7
- } from "../../chunk-P3CS65OP.mjs";
7
+ } from "../../chunk-VAHCYYCB.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
  });
@@ -47,11 +47,11 @@ function bind(router, data, opts = {}) {
47
47
  return Promise.all(body.map((item, i) => {
48
48
  return new Promise(async (resolve) => {
49
49
  if (!item) return resolve(null);
50
- const { tag, func } = item;
51
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
50
+ const { tag, method } = item;
51
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
52
52
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
53
- const meta2 = metaMap.get(tag)[func];
54
- if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
53
+ const meta2 = metaMap.get(tag)[method];
54
+ if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
55
55
  const aop = Context.getAop(meta2, {
56
56
  globalFilter,
57
57
  globalGuards,
@@ -91,10 +91,10 @@ function bind(router, data, opts = {}) {
91
91
  router.use(subRouter);
92
92
  }
93
93
  for (const [tag, record] of metaMap) {
94
- for (const func in record) {
95
- const meta2 = metaMap.get(tag)[func];
94
+ for (const method in record) {
95
+ const meta2 = metaMap.get(tag)[method];
96
96
  const { data: { params, addons, http } } = meta2;
97
- if (!http?.type) continue;
97
+ if (!http?.method) continue;
98
98
  const needBody = params.some((item) => item.type === "body");
99
99
  let aop;
100
100
  if (!dynamic) {
@@ -106,8 +106,8 @@ function bind(router, data, opts = {}) {
106
106
  }
107
107
  const subRouter = new Router();
108
108
  Context.applyAddons(addons, subRouter, "hyper-express");
109
- subRouter[http.type](joinUrl(http.prefix, http.route), async (req, res, next) => {
110
- debug(`invoke method "${func}" in module "${tag}"`);
109
+ subRouter[http.method](joinUrl(http.prefix, http.route), async (req, res, next) => {
110
+ debug(`invoke method "${method}" in module "${tag}"`);
111
111
  const contextData = {
112
112
  type: "hyper-express",
113
113
  category: "http",
@@ -116,7 +116,7 @@ function bind(router, data, opts = {}) {
116
116
  response: res,
117
117
  moduleMap,
118
118
  tag,
119
- func,
119
+ method,
120
120
  query: req.query_parameters,
121
121
  body: needBody ? await req.json({}) : void 0,
122
122
  app: router,
@@ -1,9 +1,9 @@
1
1
  import Router, { RouterParamContext } from '@koa/router';
2
2
  import { DefaultContext, DefaultState } from 'koa';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-BKHBmSQN.mjs';
4
- import { F as Factory } from '../../core-B5yKYkMJ.mjs';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-DtiHAXQB.mjs';
4
+ import { F as Factory } from '../../core-D1YYphEn.mjs';
5
5
  import 'node:http';
6
- import '../../meta-C_eDyXnK.mjs';
6
+ import '../../meta-DNF6Fl27.mjs';
7
7
  import 'phecda-core';
8
8
 
9
9
  interface KoaCtx extends HttpCtx {
@@ -1,9 +1,9 @@
1
1
  import Router, { RouterParamContext } from '@koa/router';
2
2
  import { DefaultContext, DefaultState } from 'koa';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-BuvMT1ta.js';
4
- import { F as Factory } from '../../core-BRuvL6hY.js';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Cosv4nol.js';
4
+ import { F as Factory } from '../../core-BTSHIAyB.js';
5
5
  import 'node:http';
6
- import '../../meta-C_eDyXnK.js';
6
+ import '../../meta-DNF6Fl27.js';
7
7
  import 'phecda-core';
8
8
 
9
9
  interface KoaCtx extends HttpCtx {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkOV3UJLGPjs = require('../../chunk-OV3UJLGP.js');
7
+ var _chunkYJ3QHGTCjs = require('../../chunk-YJ3QHGTC.js');
8
8
 
9
9
 
10
10
 
@@ -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 = _chunkOV3UJLGPjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
- const { controller, http, func, tag } = meta2.data;
23
- if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
24
- debug(`register method "${func}" in module "${tag}"`);
21
+ const metaMap = _chunkYJ3QHGTCjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
+ const { controller, http, method, tag } = meta2.data;
23
+ if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
24
+ debug(`register method "${method}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkOV3UJLGPjs.detectAopDep.call(void 0, meta, {
28
+ _chunkYJ3QHGTCjs.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -34,29 +34,29 @@ function bind(router, data, opts = {}) {
34
34
  });
35
35
  registerRoute();
36
36
  function registerRoute() {
37
- _chunkOV3UJLGPjs.Context.applyAddons(globalAddons, router, "koa");
37
+ _chunkYJ3QHGTCjs.Context.applyAddons(globalAddons, router, "koa");
38
38
  if (parallelRoute) {
39
39
  const subRouter = new (0, _router2.default)();
40
- _chunkOV3UJLGPjs.Context.applyAddons(parallelAddons, subRouter, "koa");
40
+ _chunkYJ3QHGTCjs.Context.applyAddons(parallelAddons, subRouter, "koa");
41
41
  subRouter.post(parallelRoute, async (ctx, next) => {
42
42
  const { body } = ctx.request;
43
43
  async function errorHandler(e) {
44
- const error = await _chunkOV3UJLGPjs.Context.filterRecord.default(e);
44
+ const error = await _chunkYJ3QHGTCjs.Context.filterRecord.default(e);
45
45
  ctx.status = error.status;
46
46
  ctx.body = error;
47
47
  }
48
48
  _chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
49
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkOV3UJLGPjs.BadRequestException)("data format should be an array"));
49
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkYJ3QHGTCjs.BadRequestException)("data format should be an array"));
50
50
  try {
51
51
  return Promise.all(body.map((item, i) => {
52
52
  return new Promise(async (resolve) => {
53
53
  if (!item) return resolve(null);
54
- const { tag, func } = item;
55
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
56
- if (!metaMap.has(tag)) return resolve(await _chunkOV3UJLGPjs.Context.filterRecord.default(new (0, _chunkOV3UJLGPjs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
- const meta2 = metaMap.get(tag)[func];
58
- if (!meta2) return resolve(await _chunkOV3UJLGPjs.Context.filterRecord.default(new (0, _chunkOV3UJLGPjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
59
- const aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
54
+ const { tag, method } = item;
55
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
56
+ if (!metaMap.has(tag)) return resolve(await _chunkYJ3QHGTCjs.Context.filterRecord.default(new (0, _chunkYJ3QHGTCjs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
+ const meta2 = metaMap.get(tag)[method];
58
+ if (!meta2) return resolve(await _chunkYJ3QHGTCjs.Context.filterRecord.default(new (0, _chunkYJ3QHGTCjs.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
59
+ const aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
60
60
  globalGuards,
61
61
  globalFilter,
62
62
  globalPipe
@@ -83,7 +83,7 @@ function bind(router, data, opts = {}) {
83
83
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.req, "getRequest"),
84
84
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.res, "getResponse")
85
85
  };
86
- const context = new (0, _chunkOV3UJLGPjs.Context)(contextData);
86
+ const context = new (0, _chunkYJ3QHGTCjs.Context)(contextData);
87
87
  context.run(aop, resolve, resolve);
88
88
  });
89
89
  })).then((ret) => {
@@ -96,22 +96,22 @@ function bind(router, data, opts = {}) {
96
96
  router.use(subRouter.routes()).use(subRouter.allowedMethods());
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, http } } = meta2;
102
- if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
102
+ if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
103
103
  let aop;
104
104
  if (!dynamic) {
105
- aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
105
+ aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
106
106
  globalFilter,
107
107
  globalGuards,
108
108
  globalPipe
109
109
  });
110
110
  }
111
111
  const subRouter = new (0, _router2.default)();
112
- _chunkOV3UJLGPjs.Context.applyAddons(addons, subRouter, "koa");
113
- router[http.type](_chunkOV3UJLGPjs.joinUrl.call(void 0, http.prefix, http.route), async (ctx, next) => {
114
- debug(`invoke method "${func}" in module "${tag}"`);
112
+ _chunkYJ3QHGTCjs.Context.applyAddons(addons, subRouter, "koa");
113
+ router[http.method](_chunkYJ3QHGTCjs.joinUrl.call(void 0, http.prefix, http.route), async (ctx, next) => {
114
+ debug(`invoke method "${method}" in module "${tag}"`);
115
115
  const contextData = {
116
116
  type: "koa",
117
117
  app: router,
@@ -119,7 +119,7 @@ function bind(router, data, opts = {}) {
119
119
  meta: meta2,
120
120
  moduleMap,
121
121
  tag,
122
- func,
122
+ method,
123
123
  query: ctx.query,
124
124
  params: ctx.params,
125
125
  category: "http",
@@ -137,10 +137,10 @@ function bind(router, data, opts = {}) {
137
137
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.req, "getRequest"),
138
138
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.res, "getResponse")
139
139
  };
140
- const context = new (0, _chunkOV3UJLGPjs.Context)(contextData);
140
+ const context = new (0, _chunkYJ3QHGTCjs.Context)(contextData);
141
141
  if (http.headers) ctx.set(http.headers);
142
142
  if (dynamic) {
143
- aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
143
+ aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
144
144
  globalFilter,
145
145
  globalGuards,
146
146
  globalPipe
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  joinUrl
7
- } from "../../chunk-P3CS65OP.mjs";
7
+ } from "../../chunk-VAHCYYCB.mjs";
8
8
  import {
9
9
  HMR,
10
10
  __name
@@ -19,9 +19,9 @@ function bind(router, data, opts = {}) {
19
19
  const { moduleMap, meta } = data;
20
20
  const originStack = router.stack.slice(0, router.stack.length);
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
  });
@@ -51,11 +51,11 @@ function bind(router, data, opts = {}) {
51
51
  return Promise.all(body.map((item, i) => {
52
52
  return new Promise(async (resolve) => {
53
53
  if (!item) return resolve(null);
54
- const { tag, func } = item;
55
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
54
+ const { tag, method } = item;
55
+ debug(`(parallel)invoke method "${method}" in module "${tag}"`);
56
56
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
57
- const meta2 = metaMap.get(tag)[func];
58
- if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
57
+ const meta2 = metaMap.get(tag)[method];
58
+ if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
59
59
  const aop = Context.getAop(meta2, {
60
60
  globalGuards,
61
61
  globalFilter,
@@ -96,10 +96,10 @@ function bind(router, data, opts = {}) {
96
96
  router.use(subRouter.routes()).use(subRouter.allowedMethods());
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, http } } = meta2;
102
- if (!http?.type) continue;
102
+ if (!http?.method) continue;
103
103
  let aop;
104
104
  if (!dynamic) {
105
105
  aop = Context.getAop(meta2, {
@@ -110,8 +110,8 @@ function bind(router, data, opts = {}) {
110
110
  }
111
111
  const subRouter = new Router();
112
112
  Context.applyAddons(addons, subRouter, "koa");
113
- router[http.type](joinUrl(http.prefix, http.route), async (ctx, next) => {
114
- debug(`invoke method "${func}" in module "${tag}"`);
113
+ router[http.method](joinUrl(http.prefix, http.route), async (ctx, next) => {
114
+ debug(`invoke method "${method}" in module "${tag}"`);
115
115
  const contextData = {
116
116
  type: "koa",
117
117
  app: router,
@@ -119,7 +119,7 @@ function bind(router, data, opts = {}) {
119
119
  meta: meta2,
120
120
  moduleMap,
121
121
  tag,
122
- func,
122
+ method,
123
123
  query: ctx.query,
124
124
  params: ctx.params,
125
125
  category: "http",
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-C_eDyXnK.mjs';
2
- export { d as BaseRequestType, C as CustomResponse, g as ERROR_SYMBOL, e as ExtractResponse, I as IS_DEV, h as IS_ONLY_GENERATE, j as IS_PURE, i as IS_STRICT, L as LOG_LEVEL, f as MetaData, P as PS_EXIT_CODE, S as ServiceMetaData } from './meta-C_eDyXnK.mjs';
3
- import { G as Generator } from './core-B5yKYkMJ.mjs';
4
- export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-B5yKYkMJ.mjs';
5
- import { Base } from 'phecda-core';
1
+ import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-DNF6Fl27.mjs';
2
+ export { d as BaseRequestMethod, C as CustomResponse, g as ERROR_SYMBOL, e as ExtractResponse, I as IS_DEV, h as IS_ONLY_GENERATE, j as IS_PURE, i as IS_STRICT, L as LOG_LEVEL, f as MetaData, P as PS_EXIT_CODE, S as ServiceMetaData } from './meta-DNF6Fl27.mjs';
3
+ import { G as Generator } from './core-D1YYphEn.mjs';
4
+ export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-D1YYphEn.mjs';
5
+ import { Construct, Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpCtx } from './types-BKHBmSQN.mjs';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-BKHBmSQN.mjs';
9
- import { R as RpcCtx } from './types-7-m2wEkP.mjs';
10
- export { a as RpcServerOptions } from './types-7-m2wEkP.mjs';
7
+ import { H as HttpCtx } from './types-DtiHAXQB.mjs';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-DtiHAXQB.mjs';
9
+ import { R as RpcCtx } from './types-BOZ8yE2L.mjs';
10
+ export { a as RpcServerOptions } from './types-BOZ8yE2L.mjs';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
@@ -101,7 +101,7 @@ interface PipeArg {
101
101
  index: number;
102
102
  reflect: any;
103
103
  define: Record<string, any>;
104
- rawMeta: any;
104
+ meta: any;
105
105
  }
106
106
  type GuardType<Ctx extends BaseCtx = any> = (ctx: Ctx, next: () => Promise<any>) => any;
107
107
  type PipeType<Ctx extends BaseCtx = any> = (arg: PipeArg, ctx: Ctx) => Promise<any>;
@@ -163,10 +163,11 @@ declare class HTTPGenerator extends Generator {
163
163
  }
164
164
 
165
165
  declare class OpenAPIGenerator extends Generator {
166
+ ext: string;
166
167
  name: string;
167
168
  paths: Record<string, any>;
168
169
  getContent(): string;
169
- addMethod(args: ControllerMetaData): void;
170
+ addMethod(args: ControllerMetaData, model: Construct): void;
170
171
  generateCode(meta: Meta[]): string;
171
172
  }
172
173
 
@@ -187,6 +188,12 @@ declare class DocGenerator extends Generator {
187
188
  generateCode(meta: Meta[]): string;
188
189
  }
189
190
 
191
+ declare class GraphGenerator extends Generator {
192
+ ext: string;
193
+ name: string;
194
+ generateCode(meta: Meta[]): string;
195
+ }
196
+
190
197
  declare function BaseParam(data: Record<string, any>): ParameterDecorator;
191
198
  declare function Body(key?: string): ParameterDecorator;
192
199
  declare function Head(key: string): ParameterDecorator;
@@ -201,7 +208,7 @@ declare function Addon(...addons: string[]): (target: any, property?: PropertyKe
201
208
  declare function Filter(filter: string): (target: any, property?: PropertyKey) => void;
202
209
  declare function Pipe(pipe?: string): (target: any, property?: any, index?: any) => void;
203
210
 
204
- declare function Route(route: string, type: string): MethodDecorator;
211
+ declare function Route(route: string, method: string): MethodDecorator;
205
212
  declare function Header(headers: Record<string, string>): MethodDecorator;
206
213
  declare function Get(route?: string): MethodDecorator;
207
214
  declare function Post(route?: string): MethodDecorator;
@@ -347,4 +354,4 @@ declare class PExtension extends ServerBase {
347
354
  constructor(tag?: string);
348
355
  }
349
356
 
350
- export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
357
+ export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, GraphGenerator, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-C_eDyXnK.js';
2
- export { d as BaseRequestType, C as CustomResponse, g as ERROR_SYMBOL, e as ExtractResponse, I as IS_DEV, h as IS_ONLY_GENERATE, j as IS_PURE, i as IS_STRICT, L as LOG_LEVEL, f as MetaData, P as PS_EXIT_CODE, S as ServiceMetaData } from './meta-C_eDyXnK.js';
3
- import { G as Generator } from './core-BRuvL6hY.js';
4
- export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-BRuvL6hY.js';
5
- import { Base } from 'phecda-core';
1
+ import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-DNF6Fl27.js';
2
+ export { d as BaseRequestMethod, C as CustomResponse, g as ERROR_SYMBOL, e as ExtractResponse, I as IS_DEV, h as IS_ONLY_GENERATE, j as IS_PURE, i as IS_STRICT, L as LOG_LEVEL, f as MetaData, P as PS_EXIT_CODE, S as ServiceMetaData } from './meta-DNF6Fl27.js';
3
+ import { G as Generator } from './core-BTSHIAyB.js';
4
+ export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-BTSHIAyB.js';
5
+ import { Construct, Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpCtx } from './types-BuvMT1ta.js';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-BuvMT1ta.js';
9
- import { R as RpcCtx } from './types-B6aU8oT-.js';
10
- export { a as RpcServerOptions } from './types-B6aU8oT-.js';
7
+ import { H as HttpCtx } from './types-Cosv4nol.js';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-Cosv4nol.js';
9
+ import { R as RpcCtx } from './types-YJ55P7A_.js';
10
+ export { a as RpcServerOptions } from './types-YJ55P7A_.js';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
@@ -101,7 +101,7 @@ interface PipeArg {
101
101
  index: number;
102
102
  reflect: any;
103
103
  define: Record<string, any>;
104
- rawMeta: any;
104
+ meta: any;
105
105
  }
106
106
  type GuardType<Ctx extends BaseCtx = any> = (ctx: Ctx, next: () => Promise<any>) => any;
107
107
  type PipeType<Ctx extends BaseCtx = any> = (arg: PipeArg, ctx: Ctx) => Promise<any>;
@@ -163,10 +163,11 @@ declare class HTTPGenerator extends Generator {
163
163
  }
164
164
 
165
165
  declare class OpenAPIGenerator extends Generator {
166
+ ext: string;
166
167
  name: string;
167
168
  paths: Record<string, any>;
168
169
  getContent(): string;
169
- addMethod(args: ControllerMetaData): void;
170
+ addMethod(args: ControllerMetaData, model: Construct): void;
170
171
  generateCode(meta: Meta[]): string;
171
172
  }
172
173
 
@@ -187,6 +188,12 @@ declare class DocGenerator extends Generator {
187
188
  generateCode(meta: Meta[]): string;
188
189
  }
189
190
 
191
+ declare class GraphGenerator extends Generator {
192
+ ext: string;
193
+ name: string;
194
+ generateCode(meta: Meta[]): string;
195
+ }
196
+
190
197
  declare function BaseParam(data: Record<string, any>): ParameterDecorator;
191
198
  declare function Body(key?: string): ParameterDecorator;
192
199
  declare function Head(key: string): ParameterDecorator;
@@ -201,7 +208,7 @@ declare function Addon(...addons: string[]): (target: any, property?: PropertyKe
201
208
  declare function Filter(filter: string): (target: any, property?: PropertyKey) => void;
202
209
  declare function Pipe(pipe?: string): (target: any, property?: any, index?: any) => void;
203
210
 
204
- declare function Route(route: string, type: string): MethodDecorator;
211
+ declare function Route(route: string, method: string): MethodDecorator;
205
212
  declare function Header(headers: Record<string, string>): MethodDecorator;
206
213
  declare function Get(route?: string): MethodDecorator;
207
214
  declare function Post(route?: string): MethodDecorator;
@@ -347,4 +354,4 @@ declare class PExtension extends ServerBase {
347
354
  constructor(tag?: string);
348
355
  }
349
356
 
350
- export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
357
+ export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, GraphGenerator, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };