phecda-server 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/{chunk-ZWPOWMZP.js → chunk-JTSD2LIG.js} +10 -6
  2. package/dist/{chunk-XKK2SQ7W.js → chunk-OV3UJLGP.js} +20 -6
  3. package/dist/{chunk-E7EAPAGM.mjs → chunk-P3CS65OP.mjs} +20 -6
  4. package/dist/{chunk-AIAO6SV6.mjs → chunk-TQSHE4PZ.mjs} +10 -6
  5. package/dist/{core-DbqWh47p.d.mts → core-B5yKYkMJ.d.mts} +1 -1
  6. package/dist/{core-Rq7BhPHE.d.ts → core-BRuvL6hY.d.ts} +1 -1
  7. package/dist/helper.d.mts +1 -1
  8. package/dist/helper.d.ts +1 -1
  9. package/dist/helper.js +2 -2
  10. package/dist/helper.mjs +1 -1
  11. package/dist/http/elysia/index.d.mts +3 -3
  12. package/dist/http/elysia/index.d.ts +3 -3
  13. package/dist/http/elysia/index.js +17 -17
  14. package/dist/http/elysia/index.mjs +1 -1
  15. package/dist/http/express/index.d.mts +3 -3
  16. package/dist/http/express/index.d.ts +3 -3
  17. package/dist/http/express/index.js +16 -16
  18. package/dist/http/express/index.mjs +1 -1
  19. package/dist/http/fastify/index.d.mts +3 -3
  20. package/dist/http/fastify/index.d.ts +3 -3
  21. package/dist/http/fastify/index.js +16 -16
  22. package/dist/http/fastify/index.mjs +1 -1
  23. package/dist/http/h3/index.d.mts +3 -3
  24. package/dist/http/h3/index.d.ts +3 -3
  25. package/dist/http/h3/index.js +17 -17
  26. package/dist/http/h3/index.mjs +1 -1
  27. package/dist/http/hono/index.d.mts +3 -3
  28. package/dist/http/hono/index.d.ts +3 -3
  29. package/dist/http/hono/index.js +14 -14
  30. package/dist/http/hono/index.mjs +1 -1
  31. package/dist/http/hyper-express/index.d.mts +3 -3
  32. package/dist/http/hyper-express/index.d.ts +3 -3
  33. package/dist/http/hyper-express/index.js +15 -15
  34. package/dist/http/hyper-express/index.mjs +1 -1
  35. package/dist/http/koa/index.d.mts +3 -3
  36. package/dist/http/koa/index.d.ts +3 -3
  37. package/dist/http/koa/index.js +16 -16
  38. package/dist/http/koa/index.mjs +1 -1
  39. package/dist/index.d.mts +27 -9
  40. package/dist/index.d.ts +27 -9
  41. package/dist/index.js +60 -24
  42. package/dist/index.mjs +38 -2
  43. package/dist/{meta-BoS1E-Nz.d.mts → meta-C_eDyXnK.d.mts} +2 -0
  44. package/dist/{meta-BoS1E-Nz.d.ts → meta-C_eDyXnK.d.ts} +2 -0
  45. package/dist/rpc/bullmq/index.d.mts +3 -3
  46. package/dist/rpc/bullmq/index.d.ts +3 -3
  47. package/dist/rpc/bullmq/index.js +6 -6
  48. package/dist/rpc/bullmq/index.mjs +1 -1
  49. package/dist/rpc/electron/index.d.mts +3 -3
  50. package/dist/rpc/electron/index.d.ts +3 -3
  51. package/dist/rpc/electron/index.js +5 -5
  52. package/dist/rpc/electron/index.mjs +1 -1
  53. package/dist/rpc/kafka/index.d.mts +3 -3
  54. package/dist/rpc/kafka/index.d.ts +3 -3
  55. package/dist/rpc/kafka/index.js +6 -6
  56. package/dist/rpc/kafka/index.mjs +1 -1
  57. package/dist/rpc/nats/index.d.mts +3 -3
  58. package/dist/rpc/nats/index.d.ts +3 -3
  59. package/dist/rpc/nats/index.js +6 -6
  60. package/dist/rpc/nats/index.mjs +1 -1
  61. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  62. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  63. package/dist/rpc/rabbitmq/index.js +6 -6
  64. package/dist/rpc/rabbitmq/index.mjs +1 -1
  65. package/dist/rpc/redis/index.d.mts +3 -3
  66. package/dist/rpc/redis/index.d.ts +3 -3
  67. package/dist/rpc/redis/index.js +6 -6
  68. package/dist/rpc/redis/index.mjs +1 -1
  69. package/dist/rpc/ws/index.d.mts +3 -3
  70. package/dist/rpc/ws/index.d.ts +3 -3
  71. package/dist/rpc/ws/index.js +5 -5
  72. package/dist/rpc/ws/index.mjs +1 -1
  73. package/dist/test.d.mts +2 -2
  74. package/dist/test.d.ts +2 -2
  75. package/dist/test.js +2 -2
  76. package/dist/test.mjs +1 -1
  77. package/dist/{types-E-rqlg3-.d.mts → types-7-m2wEkP.d.mts} +1 -1
  78. package/dist/{types-CInz3bD0.d.ts → types-B6aU8oT-.d.ts} +1 -1
  79. package/dist/{types-SCJZFCYt.d.mts → types-BKHBmSQN.d.mts} +1 -1
  80. package/dist/{types-xruyYmyu.d.ts → types-BuvMT1ta.d.ts} +1 -1
  81. package/package.json +2 -2
  82. package/register/export.mjs +5 -1
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-BoS1E-Nz.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-BoS1E-Nz.js';
3
- import { G as Generator } from './core-Rq7BhPHE.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-Rq7BhPHE.js';
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
5
  import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpCtx } from './types-xruyYmyu.js';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-xruyYmyu.js';
9
- import { R as RpcCtx } from './types-CInz3bD0.js';
10
- export { a as RpcServerOptions } from './types-CInz3bD0.js';
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';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
@@ -101,6 +101,7 @@ interface PipeArg {
101
101
  index: number;
102
102
  reflect: any;
103
103
  define: Record<string, any>;
104
+ rawMeta: any;
104
105
  }
105
106
  type GuardType<Ctx extends BaseCtx = any> = (ctx: Ctx, next: () => Promise<any>) => any;
106
107
  type PipeType<Ctx extends BaseCtx = any> = (arg: PipeArg, ctx: Ctx) => Promise<any>;
@@ -169,6 +170,23 @@ declare class OpenAPIGenerator extends Generator {
169
170
  generateCode(meta: Meta[]): string;
170
171
  }
171
172
 
173
+ declare class DocGenerator extends Generator {
174
+ name: string;
175
+ classMap: Record<string, {
176
+ [key: string]: {
177
+ doc: string;
178
+ params: {
179
+ doc: string;
180
+ index: number;
181
+ }[];
182
+ };
183
+ }>;
184
+ constructor(path?: string);
185
+ getContent(): string;
186
+ addMethod(data: ControllerMetaData): void;
187
+ generateCode(meta: Meta[]): string;
188
+ }
189
+
172
190
  declare function BaseParam(data: Record<string, any>): ParameterDecorator;
173
191
  declare function Body(key?: string): ParameterDecorator;
174
192
  declare function Head(key: string): ParameterDecorator;
@@ -329,4 +347,4 @@ declare class PExtension extends ServerBase {
329
347
  constructor(tag?: string);
330
348
  }
331
349
 
332
- export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, 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 };
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 };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7;
2
2
 
3
3
 
4
4
 
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkZWPOWMZPjs = require('./chunk-ZWPOWMZP.js');
9
+ var _chunkJTSD2LIGjs = require('./chunk-JTSD2LIG.js');
10
10
 
11
11
 
12
12
 
@@ -60,7 +60,7 @@ var _chunkDPPDWBYOjs = require('./chunk-DPPDWBYO.js');
60
60
 
61
61
 
62
62
 
63
- var _chunkXKK2SQ7Wjs = require('./chunk-XKK2SQ7W.js');
63
+ var _chunkOV3UJLGPjs = require('./chunk-OV3UJLGP.js');
64
64
 
65
65
 
66
66
 
@@ -102,7 +102,7 @@ var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2)
102
102
  static {
103
103
  _chunk4LLLQOMFjs.__name.call(void 0, this, "ServerBase");
104
104
  }
105
- __init() {this.emitter = exports.emitter = _chunkZWPOWMZPjs.emitter}
105
+ __init() {this.emitter = exports.emitter = _chunkJTSD2LIGjs.emitter}
106
106
  log(msg, level = "log") {
107
107
  _chunk4LLLQOMFjs.log.call(void 0, msg, level, this.tag);
108
108
  }
@@ -138,9 +138,9 @@ var PFilter = class extends ServerBase {
138
138
  constructor(tag) {
139
139
  super();
140
140
  this.key = tag || _phecdacore.getTag.call(void 0, this);
141
- _chunkXKK2SQ7Wjs.addFilter.call(void 0, this.key, this.use.bind(this));
141
+ _chunkOV3UJLGPjs.addFilter.call(void 0, this.key, this.use.bind(this));
142
142
  this.onUnmount(() => {
143
- delete _chunkXKK2SQ7Wjs.Context.filterRecord[this.key];
143
+ delete _chunkOV3UJLGPjs.Context.filterRecord[this.key];
144
144
  });
145
145
  }
146
146
  };
@@ -156,9 +156,9 @@ var PGuard = (_class2 = class extends ServerBase {
156
156
  constructor(tag) {
157
157
  super();_class2.prototype.__init2.call(this);;
158
158
  this.key = tag || _phecdacore.getTag.call(void 0, this);
159
- _chunkXKK2SQ7Wjs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
159
+ _chunkOV3UJLGPjs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
160
160
  this.onUnmount(() => {
161
- delete _chunkXKK2SQ7Wjs.Context.guardRecord[this.key];
161
+ delete _chunkOV3UJLGPjs.Context.guardRecord[this.key];
162
162
  });
163
163
  }
164
164
  }, _class2);
@@ -173,9 +173,9 @@ var PPipe = class extends ServerBase {
173
173
  constructor(tag) {
174
174
  super();
175
175
  this.key = tag || _phecdacore.getTag.call(void 0, this);
176
- _chunkXKK2SQ7Wjs.addPipe.call(void 0, this.key, this.use.bind(this));
176
+ _chunkOV3UJLGPjs.addPipe.call(void 0, this.key, this.use.bind(this));
177
177
  this.onUnmount(() => {
178
- delete _chunkXKK2SQ7Wjs.Context.pipeRecord[this.key];
178
+ delete _chunkOV3UJLGPjs.Context.pipeRecord[this.key];
179
179
  });
180
180
  }
181
181
  };
@@ -191,9 +191,9 @@ var PAddon = (_class3 = class extends ServerBase {
191
191
  constructor(tag) {
192
192
  super();_class3.prototype.__init3.call(this);;
193
193
  this.key = tag || _phecdacore.getTag.call(void 0, this);
194
- _chunkXKK2SQ7Wjs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
194
+ _chunkOV3UJLGPjs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
195
195
  this.onUnmount(() => {
196
- delete _chunkXKK2SQ7Wjs.Context.addonRecord[this.key];
196
+ delete _chunkOV3UJLGPjs.Context.addonRecord[this.key];
197
197
  });
198
198
  }
199
199
  }, _class3);
@@ -211,27 +211,27 @@ var PExtension = class extends ServerBase {
211
211
  super();
212
212
  const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
213
213
  if (this.pipe) {
214
- _chunkXKK2SQ7Wjs.addPipe.call(void 0, key, this.pipe.bind(this));
214
+ _chunkOV3UJLGPjs.addPipe.call(void 0, key, this.pipe.bind(this));
215
215
  this.onUnmount(() => {
216
- delete _chunkXKK2SQ7Wjs.Context.pipeRecord[key];
216
+ delete _chunkOV3UJLGPjs.Context.pipeRecord[key];
217
217
  });
218
218
  }
219
219
  if (this.addon) {
220
- _chunkXKK2SQ7Wjs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
220
+ _chunkOV3UJLGPjs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
221
221
  this.onUnmount(() => {
222
- delete _chunkXKK2SQ7Wjs.Context.addonRecord[key];
222
+ delete _chunkOV3UJLGPjs.Context.addonRecord[key];
223
223
  });
224
224
  }
225
225
  if (this.guard) {
226
- _chunkXKK2SQ7Wjs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
226
+ _chunkOV3UJLGPjs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
227
227
  this.onUnmount(() => {
228
- delete _chunkXKK2SQ7Wjs.Context.guardRecord[key];
228
+ delete _chunkOV3UJLGPjs.Context.guardRecord[key];
229
229
  });
230
230
  }
231
231
  if (this.filter) {
232
- _chunkXKK2SQ7Wjs.addFilter.call(void 0, key, this.filter.bind(this));
232
+ _chunkOV3UJLGPjs.addFilter.call(void 0, key, this.filter.bind(this));
233
233
  this.onUnmount(() => {
234
- delete _chunkXKK2SQ7Wjs.Context.filterRecord[key];
234
+ delete _chunkOV3UJLGPjs.Context.filterRecord[key];
235
235
  });
236
236
  }
237
237
  }
@@ -311,7 +311,7 @@ var HTTPGenerator = (_class5 = class extends Generator {constructor(...args4) {
311
311
  addMethod(args) {
312
312
  const { http, name, func, params, tag } = args;
313
313
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) return;
314
- const url = _chunkXKK2SQ7Wjs.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
314
+ const url = _chunkOV3UJLGPjs.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
315
315
  if (!this.classMap[name]) this.classMap[name] = {};
316
316
  this.classMap[name][func] = `
317
317
  ${func}(...args){
@@ -354,9 +354,9 @@ var OpenAPIGenerator = (_class6 = class extends Generator {constructor(...args5)
354
354
  addMethod(args) {
355
355
  const { http, tag, func } = args;
356
356
  if (!_optionalChain([http, 'optionalAccess', _3 => _3.type])) return;
357
- const path = _chunkXKK2SQ7Wjs.joinUrl.call(void 0, http.prefix, http.route);
357
+ const path = _chunkOV3UJLGPjs.joinUrl.call(void 0, http.prefix, http.route);
358
358
  if (!this.paths[path]) this.paths[path] = {};
359
- const config = _phecdacore.getMergedMeta.call(void 0, _chunkZWPOWMZPjs.useS.call(void 0, ).getModel(tag), func).openapi;
359
+ const config = _phecdacore.getMergedMeta.call(void 0, _chunkJTSD2LIGjs.useS.call(void 0, ).getModel(tag), func).openapi;
360
360
  this.paths[path][http.type] = {
361
361
  summary: config.summary,
362
362
  description: config.description,
@@ -377,6 +377,41 @@ var OpenAPIGenerator = (_class6 = class extends Generator {constructor(...args5)
377
377
  }
378
378
  }, _class6);
379
379
 
380
+ // src/generator/doc.ts
381
+ var DocGenerator = (_class7 = class extends Generator {
382
+ static {
383
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "DocGenerator");
384
+ }
385
+ __init10() {this.name = "DOC"}
386
+ __init11() {this.classMap = {}}
387
+ constructor(path) {
388
+ super(path || ".ps/doc.json");_class7.prototype.__init10.call(this);_class7.prototype.__init11.call(this);;
389
+ }
390
+ getContent() {
391
+ return JSON.stringify(this.classMap);
392
+ }
393
+ addMethod(data) {
394
+ const { name, func } = data;
395
+ if (!data.rawMeta.doc) return;
396
+ if (!this.classMap[name]) this.classMap[name] = {};
397
+ this.classMap[name][func] = {
398
+ doc: data.rawMeta.doc,
399
+ params: data.params.filter((item) => item.rawMeta.doc).map((item) => {
400
+ return {
401
+ doc: item.rawMeta.doc,
402
+ index: item.index
403
+ };
404
+ })
405
+ };
406
+ }
407
+ generateCode(meta) {
408
+ meta.forEach(({ data }) => {
409
+ if (data.controller) this.addMethod(data);
410
+ });
411
+ return this.getContent();
412
+ }
413
+ }, _class7);
414
+
380
415
  // src/index.ts
381
416
 
382
417
 
@@ -461,4 +496,5 @@ var OpenAPIGenerator = (_class6 = class extends Generator {constructor(...args5)
461
496
 
462
497
 
463
498
 
464
- exports.Addon = _chunkDPPDWBYOjs.Addon; exports.ApiDoc = _chunkDPPDWBYOjs.ApiDoc; exports.Arg = _chunkDPPDWBYOjs.Arg; exports.BadGatewayException = _chunkXKK2SQ7Wjs.BadGatewayException; exports.BadRequestException = _chunkXKK2SQ7Wjs.BadRequestException; exports.BaseParam = _chunkDPPDWBYOjs.BaseParam; exports.Body = _chunkDPPDWBYOjs.Body; exports.ConflictException = _chunkXKK2SQ7Wjs.ConflictException; exports.Context = _chunkXKK2SQ7Wjs.Context; exports.Controller = _chunkDPPDWBYOjs.Controller; exports.Ctx = _chunkDPPDWBYOjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkDPPDWBYOjs.Define; exports.Delete = _chunkDPPDWBYOjs.Delete; exports.ERROR_SYMBOL = _chunk4LLLQOMFjs.ERROR_SYMBOL; exports.Exception = _chunkXKK2SQ7Wjs.Exception; exports.Factory = _chunkZWPOWMZPjs.Factory; exports.Filter = _chunkDPPDWBYOjs.Filter; exports.ForbiddenException = _chunkXKK2SQ7Wjs.ForbiddenException; exports.FrameworkException = _chunkXKK2SQ7Wjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkDPPDWBYOjs.Get; exports.Guard = _chunkDPPDWBYOjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkDPPDWBYOjs.Head; exports.Header = _chunkDPPDWBYOjs.Header; exports.HttpBase = HttpBase; exports.IS_DEV = _chunk4LLLQOMFjs.IS_DEV; exports.IS_ONLY_GENERATE = _chunk4LLLQOMFjs.IS_ONLY_GENERATE; exports.IS_PURE = _chunk4LLLQOMFjs.IS_PURE; exports.IS_STRICT = _chunk4LLLQOMFjs.IS_STRICT; exports.InvalidInputException = _chunkXKK2SQ7Wjs.InvalidInputException; exports.LOG_LEVEL = _chunk4LLLQOMFjs.LOG_LEVEL; exports.ManyFiles = _chunkDPPDWBYOjs.ManyFiles; exports.Meta = _chunkZWPOWMZPjs.Meta; exports.Mixin = _chunk4LLLQOMFjs.Mixin; exports.NotFoundException = _chunkXKK2SQ7Wjs.NotFoundException; exports.OneFile = _chunkDPPDWBYOjs.OneFile; exports.OpenAPIGenerator = OpenAPIGenerator; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunk4LLLQOMFjs.PS_EXIT_CODE; exports.Param = _chunkDPPDWBYOjs.Param; exports.Patch = _chunkDPPDWBYOjs.Patch; exports.PayloadLargeException = _chunkXKK2SQ7Wjs.PayloadLargeException; exports.Pipe = _chunkDPPDWBYOjs.Pipe; exports.Post = _chunkDPPDWBYOjs.Post; exports.Put = _chunkDPPDWBYOjs.Put; exports.Query = _chunkDPPDWBYOjs.Query; exports.Queue = _chunkDPPDWBYOjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkDPPDWBYOjs.Route; exports.Rpc = _chunkDPPDWBYOjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkDPPDWBYOjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkZWPOWMZPjs.ServerPhecda; exports.ServiceUnavailableException = _chunkXKK2SQ7Wjs.ServiceUnavailableException; exports.TimeoutException = _chunkXKK2SQ7Wjs.TimeoutException; exports.TimerException = _chunkXKK2SQ7Wjs.TimerException; exports.UnauthorizedException = _chunkXKK2SQ7Wjs.UnauthorizedException; exports.UndefinedException = _chunkXKK2SQ7Wjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkXKK2SQ7Wjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkXKK2SQ7Wjs.ValidateException; exports.WorkerException = _chunkXKK2SQ7Wjs.WorkerException; exports.addAddon = _chunkXKK2SQ7Wjs.addAddon; exports.addFilter = _chunkXKK2SQ7Wjs.addFilter; exports.addGuard = _chunkXKK2SQ7Wjs.addGuard; exports.addPipe = _chunkXKK2SQ7Wjs.addPipe; exports.defaultPipe = _chunkXKK2SQ7Wjs.defaultPipe; exports.defaultServerInject = _chunkZWPOWMZPjs.defaultServerInject; exports.emitter = _chunkZWPOWMZPjs.emitter; exports.getLogger = _chunk4LLLQOMFjs.getLogger; exports.log = _chunk4LLLQOMFjs.log; exports.phecdaNamespace = _chunkZWPOWMZPjs.phecdaNamespace; exports.runMiddleware = _chunk4LLLQOMFjs.runMiddleware; exports.setLogger = _chunk4LLLQOMFjs.setLogger; exports.useS = _chunkZWPOWMZPjs.useS;
499
+
500
+ exports.Addon = _chunkDPPDWBYOjs.Addon; exports.ApiDoc = _chunkDPPDWBYOjs.ApiDoc; exports.Arg = _chunkDPPDWBYOjs.Arg; exports.BadGatewayException = _chunkOV3UJLGPjs.BadGatewayException; exports.BadRequestException = _chunkOV3UJLGPjs.BadRequestException; exports.BaseParam = _chunkDPPDWBYOjs.BaseParam; exports.Body = _chunkDPPDWBYOjs.Body; exports.ConflictException = _chunkOV3UJLGPjs.ConflictException; exports.Context = _chunkOV3UJLGPjs.Context; exports.Controller = _chunkDPPDWBYOjs.Controller; exports.Ctx = _chunkDPPDWBYOjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkDPPDWBYOjs.Define; exports.Delete = _chunkDPPDWBYOjs.Delete; exports.DocGenerator = DocGenerator; exports.ERROR_SYMBOL = _chunk4LLLQOMFjs.ERROR_SYMBOL; exports.Exception = _chunkOV3UJLGPjs.Exception; exports.Factory = _chunkJTSD2LIGjs.Factory; exports.Filter = _chunkDPPDWBYOjs.Filter; exports.ForbiddenException = _chunkOV3UJLGPjs.ForbiddenException; exports.FrameworkException = _chunkOV3UJLGPjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkDPPDWBYOjs.Get; exports.Guard = _chunkDPPDWBYOjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkDPPDWBYOjs.Head; exports.Header = _chunkDPPDWBYOjs.Header; exports.HttpBase = HttpBase; exports.IS_DEV = _chunk4LLLQOMFjs.IS_DEV; exports.IS_ONLY_GENERATE = _chunk4LLLQOMFjs.IS_ONLY_GENERATE; exports.IS_PURE = _chunk4LLLQOMFjs.IS_PURE; exports.IS_STRICT = _chunk4LLLQOMFjs.IS_STRICT; exports.InvalidInputException = _chunkOV3UJLGPjs.InvalidInputException; exports.LOG_LEVEL = _chunk4LLLQOMFjs.LOG_LEVEL; exports.ManyFiles = _chunkDPPDWBYOjs.ManyFiles; exports.Meta = _chunkJTSD2LIGjs.Meta; exports.Mixin = _chunk4LLLQOMFjs.Mixin; exports.NotFoundException = _chunkOV3UJLGPjs.NotFoundException; exports.OneFile = _chunkDPPDWBYOjs.OneFile; exports.OpenAPIGenerator = OpenAPIGenerator; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunk4LLLQOMFjs.PS_EXIT_CODE; exports.Param = _chunkDPPDWBYOjs.Param; exports.Patch = _chunkDPPDWBYOjs.Patch; exports.PayloadLargeException = _chunkOV3UJLGPjs.PayloadLargeException; exports.Pipe = _chunkDPPDWBYOjs.Pipe; exports.Post = _chunkDPPDWBYOjs.Post; exports.Put = _chunkDPPDWBYOjs.Put; exports.Query = _chunkDPPDWBYOjs.Query; exports.Queue = _chunkDPPDWBYOjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkDPPDWBYOjs.Route; exports.Rpc = _chunkDPPDWBYOjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkDPPDWBYOjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkJTSD2LIGjs.ServerPhecda; exports.ServiceUnavailableException = _chunkOV3UJLGPjs.ServiceUnavailableException; exports.TimeoutException = _chunkOV3UJLGPjs.TimeoutException; exports.TimerException = _chunkOV3UJLGPjs.TimerException; exports.UnauthorizedException = _chunkOV3UJLGPjs.UnauthorizedException; exports.UndefinedException = _chunkOV3UJLGPjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkOV3UJLGPjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkOV3UJLGPjs.ValidateException; exports.WorkerException = _chunkOV3UJLGPjs.WorkerException; exports.addAddon = _chunkOV3UJLGPjs.addAddon; exports.addFilter = _chunkOV3UJLGPjs.addFilter; exports.addGuard = _chunkOV3UJLGPjs.addGuard; exports.addPipe = _chunkOV3UJLGPjs.addPipe; exports.defaultPipe = _chunkOV3UJLGPjs.defaultPipe; exports.defaultServerInject = _chunkJTSD2LIGjs.defaultServerInject; exports.emitter = _chunkJTSD2LIGjs.emitter; exports.getLogger = _chunk4LLLQOMFjs.getLogger; exports.log = _chunk4LLLQOMFjs.log; exports.phecdaNamespace = _chunkJTSD2LIGjs.phecdaNamespace; exports.runMiddleware = _chunk4LLLQOMFjs.runMiddleware; exports.setLogger = _chunk4LLLQOMFjs.setLogger; exports.useS = _chunkJTSD2LIGjs.useS;
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  emitter,
7
7
  phecdaNamespace,
8
8
  useS
9
- } from "./chunk-AIAO6SV6.mjs";
9
+ } from "./chunk-TQSHE4PZ.mjs";
10
10
  import {
11
11
  Addon,
12
12
  ApiDoc,
@@ -60,7 +60,7 @@ import {
60
60
  addPipe,
61
61
  defaultPipe,
62
62
  joinUrl
63
- } from "./chunk-E7EAPAGM.mjs";
63
+ } from "./chunk-P3CS65OP.mjs";
64
64
  import {
65
65
  ERROR_SYMBOL,
66
66
  IS_DEV,
@@ -377,6 +377,41 @@ var OpenAPIGenerator = class extends Generator {
377
377
  }
378
378
  };
379
379
 
380
+ // src/generator/doc.ts
381
+ var DocGenerator = class extends Generator {
382
+ static {
383
+ __name(this, "DocGenerator");
384
+ }
385
+ name = "DOC";
386
+ classMap = {};
387
+ constructor(path) {
388
+ super(path || ".ps/doc.json");
389
+ }
390
+ getContent() {
391
+ return JSON.stringify(this.classMap);
392
+ }
393
+ addMethod(data) {
394
+ const { name, func } = data;
395
+ if (!data.rawMeta.doc) return;
396
+ if (!this.classMap[name]) this.classMap[name] = {};
397
+ this.classMap[name][func] = {
398
+ doc: data.rawMeta.doc,
399
+ params: data.params.filter((item) => item.rawMeta.doc).map((item) => {
400
+ return {
401
+ doc: item.rawMeta.doc,
402
+ index: item.index
403
+ };
404
+ })
405
+ };
406
+ }
407
+ generateCode(meta) {
408
+ meta.forEach(({ data }) => {
409
+ if (data.controller) this.addMethod(data);
410
+ });
411
+ return this.getContent();
412
+ }
413
+ };
414
+
380
415
  // src/index.ts
381
416
  export * from "phecda-core";
382
417
  export {
@@ -394,6 +429,7 @@ export {
394
429
  CustomResponse,
395
430
  Define,
396
431
  Delete,
432
+ DocGenerator,
397
433
  ERROR_SYMBOL,
398
434
  Exception,
399
435
  Factory,
@@ -50,6 +50,7 @@ interface ServiceMetaData {
50
50
  name: string;
51
51
  tag: string;
52
52
  define?: any;
53
+ rawMeta: any;
53
54
  [key: string]: any;
54
55
  }
55
56
  interface ControllerMetaData extends ServiceMetaData {
@@ -71,6 +72,7 @@ interface ControllerMetaData extends ServiceMetaData {
71
72
  key: string;
72
73
  pipe?: string;
73
74
  define: Record<string, any>;
75
+ rawMeta: any;
74
76
  }[];
75
77
  guards: string[];
76
78
  pipe?: string;
@@ -50,6 +50,7 @@ interface ServiceMetaData {
50
50
  name: string;
51
51
  tag: string;
52
52
  define?: any;
53
+ rawMeta: any;
53
54
  [key: string]: any;
54
55
  }
55
56
  interface ControllerMetaData extends ServiceMetaData {
@@ -71,6 +72,7 @@ interface ControllerMetaData extends ServiceMetaData {
71
72
  key: string;
72
73
  pipe?: string;
73
74
  define: Record<string, any>;
75
+ rawMeta: any;
74
76
  }[];
75
77
  guards: string[];
76
78
  pipe?: string;
@@ -1,8 +1,8 @@
1
1
  import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
2
- import { F as Factory } from '../../core-DbqWh47p.mjs';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
2
+ import { F as Factory } from '../../core-B5yKYkMJ.mjs';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-7-m2wEkP.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.mjs';
5
+ import '../../meta-C_eDyXnK.mjs';
6
6
 
7
7
  interface BullmqCtx extends RpcCtx {
8
8
  type: 'bullmq';
@@ -1,8 +1,8 @@
1
1
  import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
2
- import { F as Factory } from '../../core-Rq7BhPHE.js';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-CInz3bD0.js';
2
+ import { F as Factory } from '../../core-BRuvL6hY.js';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-B6aU8oT-.js';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.js';
5
+ import '../../meta-C_eDyXnK.js';
6
6
 
7
7
  interface BullmqCtx extends RpcCtx {
8
8
  type: 'bullmq';
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkXKK2SQ7Wjs = require('../../chunk-XKK2SQ7W.js');
5
+ var _chunkOV3UJLGPjs = require('../../chunk-OV3UJLGP.js');
6
6
 
7
7
 
8
8
 
@@ -17,14 +17,14 @@ async function create({ moduleMap, meta }, opts = {}) {
17
17
  const workerMap = {};
18
18
  const queueMap = {};
19
19
  const existQueue = /* @__PURE__ */ new Set();
20
- const metaMap = _chunkXKK2SQ7Wjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const metaMap = _chunkOV3UJLGPjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
21
  const { controller, rpc, func, tag } = meta2.data;
22
22
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
23
23
  debug(`register method "${func}" in module "${tag}"`);
24
24
  return true;
25
25
  }
26
26
  });
27
- _chunkXKK2SQ7Wjs.detectAopDep.call(void 0, meta, {
27
+ _chunkOV3UJLGPjs.detectAopDep.call(void 0, meta, {
28
28
  guards: globalGuards
29
29
  }, "rpc");
30
30
  async function subscribeQueues() {
@@ -38,7 +38,7 @@ async function create({ moduleMap, meta }, opts = {}) {
38
38
  if (existQueue.has(queue)) continue;
39
39
  existQueue.add(queue);
40
40
  workerMap[queue] = new (0, _bullmq.Worker)(queue, handleRequest, workerOpts);
41
- _chunkXKK2SQ7Wjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
41
+ _chunkOV3UJLGPjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
42
42
  }
43
43
  }
44
44
  }
@@ -52,12 +52,12 @@ async function create({ moduleMap, meta }, opts = {}) {
52
52
  const meta2 = metaMap.get(tag)[func];
53
53
  const { data: { rpc: { isEvent } = {} } } = meta2;
54
54
  if (!isEvent && !(clientQueue in queueMap)) queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
55
- const aop = _chunkXKK2SQ7Wjs.Context.getAop(meta2, {
55
+ const aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
56
56
  globalFilter,
57
57
  globalGuards,
58
58
  globalPipe
59
59
  });
60
- const context = new (0, _chunkXKK2SQ7Wjs.Context)({
60
+ const context = new (0, _chunkOV3UJLGPjs.Context)({
61
61
  type: "bullmq",
62
62
  category: "rpc",
63
63
  moduleMap,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-E7EAPAGM.mjs";
5
+ } from "../../chunk-P3CS65OP.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
@@ -1,8 +1,8 @@
1
1
  import Electron from 'electron';
2
- import { F as Factory } from '../../core-DbqWh47p.mjs';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
2
+ import { F as Factory } from '../../core-B5yKYkMJ.mjs';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-7-m2wEkP.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.mjs';
5
+ import '../../meta-C_eDyXnK.mjs';
6
6
 
7
7
  interface ElectronCtx extends RpcCtx {
8
8
  type: 'electron';
@@ -1,8 +1,8 @@
1
1
  import Electron from 'electron';
2
- import { F as Factory } from '../../core-Rq7BhPHE.js';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-CInz3bD0.js';
2
+ import { F as Factory } from '../../core-BRuvL6hY.js';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-B6aU8oT-.js';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.js';
5
+ import '../../meta-C_eDyXnK.js';
6
6
 
7
7
  interface ElectronCtx extends RpcCtx {
8
8
  type: 'electron';
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkXKK2SQ7Wjs = require('../../chunk-XKK2SQ7W.js');
5
+ var _chunkOV3UJLGPjs = require('../../chunk-OV3UJLGP.js');
6
6
 
7
7
 
8
8
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -12,14 +12,14 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
12
12
  var debug = _debug2.default.call(void 0, "phecda-server/electron");
13
13
  function bind(IPC, { moduleMap, meta }, opts = {}) {
14
14
  const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts;
15
- const metaMap = _chunkXKK2SQ7Wjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
15
+ const metaMap = _chunkOV3UJLGPjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
16
  const { controller, rpc, func, tag } = meta2.data;
17
17
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
18
18
  debug(`register method "${func}" in module "${tag}"`);
19
19
  return true;
20
20
  }
21
21
  });
22
- _chunkXKK2SQ7Wjs.detectAopDep.call(void 0, meta, {
22
+ _chunkOV3UJLGPjs.detectAopDep.call(void 0, meta, {
23
23
  guards: globalGuards,
24
24
  addons: globalAddons
25
25
  }, "rpc");
@@ -31,12 +31,12 @@ function bind(IPC, { moduleMap, meta }, opts = {}) {
31
31
  if (_ps !== 1) return;
32
32
  const meta2 = metaMap.get(tag)[func];
33
33
  const { data: { rpc: { isEvent } = {} } } = meta2;
34
- const aop = _chunkXKK2SQ7Wjs.Context.getAop(meta2, {
34
+ const aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
35
35
  globalFilter,
36
36
  globalGuards,
37
37
  globalPipe
38
38
  });
39
- const context = new (0, _chunkXKK2SQ7Wjs.Context)({
39
+ const context = new (0, _chunkOV3UJLGPjs.Context)({
40
40
  type: "electron",
41
41
  category: "rpc",
42
42
  moduleMap,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-E7EAPAGM.mjs";
5
+ } from "../../chunk-P3CS65OP.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "../../chunk-NQ55PA2X.mjs";
@@ -1,8 +1,8 @@
1
1
  import { Consumer, Producer } from 'kafkajs';
2
- import { F as Factory } from '../../core-DbqWh47p.mjs';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
2
+ import { F as Factory } from '../../core-B5yKYkMJ.mjs';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-7-m2wEkP.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.mjs';
5
+ import '../../meta-C_eDyXnK.mjs';
6
6
 
7
7
  interface KafkaCtx extends RpcCtx {
8
8
  type: 'kafka';
@@ -1,8 +1,8 @@
1
1
  import { Consumer, Producer } from 'kafkajs';
2
- import { F as Factory } from '../../core-Rq7BhPHE.js';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-CInz3bD0.js';
2
+ import { F as Factory } from '../../core-BRuvL6hY.js';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-B6aU8oT-.js';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.js';
5
+ import '../../meta-C_eDyXnK.js';
6
6
 
7
7
  interface KafkaCtx extends RpcCtx {
8
8
  type: 'kafka';
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkXKK2SQ7Wjs = require('../../chunk-XKK2SQ7W.js');
5
+ var _chunkOV3UJLGPjs = require('../../chunk-OV3UJLGP.js');
6
6
 
7
7
 
8
8
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -13,18 +13,18 @@ var debug = _debug2.default.call(void 0, "phecda-server/kafka");
13
13
  async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
14
14
  const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
15
15
  const existQueue = /* @__PURE__ */ new Set();
16
- const metaMap = _chunkXKK2SQ7Wjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunkOV3UJLGPjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
17
  const { controller, rpc, func, tag } = meta2.data;
18
18
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
19
19
  debug(`register method "${func}" in module "${tag}"`);
20
20
  return true;
21
21
  }
22
22
  });
23
- _chunkXKK2SQ7Wjs.detectAopDep.call(void 0, meta, {
23
+ _chunkOV3UJLGPjs.detectAopDep.call(void 0, meta, {
24
24
  guards: globalGuards,
25
25
  addons: globalAddons
26
26
  }, "rpc");
27
- _chunkXKK2SQ7Wjs.Context.applyAddons(globalAddons, {
27
+ _chunkOV3UJLGPjs.Context.applyAddons(globalAddons, {
28
28
  consumer,
29
29
  producer
30
30
  }, "kafka");
@@ -58,12 +58,12 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
58
58
  const meta2 = metaMap.get(tag)[func];
59
59
  const { data: { rpc } } = meta2;
60
60
  const isEvent = rpc.isEvent;
61
- const aop = _chunkXKK2SQ7Wjs.Context.getAop(meta2, {
61
+ const aop = _chunkOV3UJLGPjs.Context.getAop(meta2, {
62
62
  globalFilter,
63
63
  globalGuards,
64
64
  globalPipe
65
65
  });
66
- const context = new (0, _chunkXKK2SQ7Wjs.Context)({
66
+ const context = new (0, _chunkOV3UJLGPjs.Context)({
67
67
  type: "kafka",
68
68
  category: "rpc",
69
69
  moduleMap,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-E7EAPAGM.mjs";
5
+ } from "../../chunk-P3CS65OP.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "../../chunk-NQ55PA2X.mjs";
@@ -1,8 +1,8 @@
1
1
  import { NatsConnection } from 'nats';
2
- import { F as Factory } from '../../core-DbqWh47p.mjs';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
2
+ import { F as Factory } from '../../core-B5yKYkMJ.mjs';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-7-m2wEkP.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.mjs';
5
+ import '../../meta-C_eDyXnK.mjs';
6
6
 
7
7
  interface NatsCtx extends RpcCtx {
8
8
  type: 'nats';
@@ -1,8 +1,8 @@
1
1
  import { NatsConnection } from 'nats';
2
- import { F as Factory } from '../../core-Rq7BhPHE.js';
3
- import { R as RpcCtx, a as RpcServerOptions } from '../../types-CInz3bD0.js';
2
+ import { F as Factory } from '../../core-BRuvL6hY.js';
3
+ import { R as RpcCtx, a as RpcServerOptions } from '../../types-B6aU8oT-.js';
4
4
  import 'phecda-core';
5
- import '../../meta-BoS1E-Nz.js';
5
+ import '../../meta-C_eDyXnK.js';
6
6
 
7
7
  interface NatsCtx extends RpcCtx {
8
8
  type: 'nats';