phecda-server 7.0.0-alpha.1 → 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 (71) hide show
  1. package/bin/cli.mjs +7 -7
  2. package/dist/{chunk-V7EI76QQ.mjs → chunk-3FHZB3Z5.mjs} +1 -1
  3. package/dist/{chunk-GSPBHZBH.js → chunk-NQIFUZL4.js} +1 -1
  4. package/dist/{core-CYwEPfN4.d.ts → core-C1kHRqU9.d.ts} +1 -1
  5. package/dist/{core-BIcUwV18.d.mts → core-CSiaRU7r.d.mts} +1 -1
  6. package/dist/helper.d.mts +1 -1
  7. package/dist/helper.d.ts +1 -1
  8. package/dist/helper.js +2 -2
  9. package/dist/helper.mjs +1 -1
  10. package/dist/http/elysia/index.d.mts +3 -3
  11. package/dist/http/elysia/index.d.ts +3 -3
  12. package/dist/http/elysia/index.js +19 -17
  13. package/dist/http/elysia/index.mjs +3 -1
  14. package/dist/http/express/index.d.mts +3 -3
  15. package/dist/http/express/index.d.ts +3 -3
  16. package/dist/http/express/index.js +19 -17
  17. package/dist/http/express/index.mjs +3 -1
  18. package/dist/http/fastify/index.d.mts +3 -3
  19. package/dist/http/fastify/index.d.ts +3 -3
  20. package/dist/http/fastify/index.js +18 -16
  21. package/dist/http/fastify/index.mjs +3 -1
  22. package/dist/http/h3/index.d.mts +3 -3
  23. package/dist/http/h3/index.d.ts +3 -3
  24. package/dist/http/h3/index.js +18 -16
  25. package/dist/http/h3/index.mjs +3 -1
  26. package/dist/http/hono/index.d.mts +3 -3
  27. package/dist/http/hono/index.d.ts +3 -3
  28. package/dist/http/hono/index.js +17 -15
  29. package/dist/http/hono/index.mjs +3 -1
  30. package/dist/http/hyper-express/index.d.mts +3 -3
  31. package/dist/http/hyper-express/index.d.ts +3 -3
  32. package/dist/http/hyper-express/index.js +17 -15
  33. package/dist/http/hyper-express/index.mjs +3 -1
  34. package/dist/http/koa/index.d.mts +3 -3
  35. package/dist/http/koa/index.d.ts +3 -3
  36. package/dist/http/koa/index.js +19 -17
  37. package/dist/http/koa/index.mjs +3 -1
  38. package/dist/index.d.mts +8 -8
  39. package/dist/index.d.ts +8 -8
  40. package/dist/index.js +19 -19
  41. package/dist/index.mjs +2 -2
  42. package/dist/{meta-BXKLFTgG.d.mts → meta-D1M85Hef.d.mts} +1 -0
  43. package/dist/{meta-BXKLFTgG.d.ts → meta-D1M85Hef.d.ts} +1 -0
  44. package/dist/rpc/bullmq/index.d.mts +3 -3
  45. package/dist/rpc/bullmq/index.d.ts +3 -3
  46. package/dist/rpc/bullmq/index.js +9 -8
  47. package/dist/rpc/bullmq/index.mjs +2 -1
  48. package/dist/rpc/kafka/index.d.mts +3 -3
  49. package/dist/rpc/kafka/index.d.ts +3 -3
  50. package/dist/rpc/kafka/index.js +8 -7
  51. package/dist/rpc/kafka/index.mjs +2 -1
  52. package/dist/rpc/nats/index.d.mts +3 -3
  53. package/dist/rpc/nats/index.d.ts +3 -3
  54. package/dist/rpc/nats/index.js +8 -7
  55. package/dist/rpc/nats/index.mjs +2 -1
  56. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  57. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  58. package/dist/rpc/rabbitmq/index.js +9 -8
  59. package/dist/rpc/rabbitmq/index.mjs +2 -1
  60. package/dist/rpc/redis/index.d.mts +3 -3
  61. package/dist/rpc/redis/index.d.ts +3 -3
  62. package/dist/rpc/redis/index.js +9 -8
  63. package/dist/rpc/redis/index.mjs +2 -1
  64. package/dist/test.d.mts +3 -3
  65. package/dist/test.d.ts +3 -3
  66. package/dist/{types-BtbL49Zs.d.mts → types-C9Remkup.d.ts} +2 -1
  67. package/dist/{types-m3IEDKjP.d.ts → types-JMhFVp-Z.d.mts} +2 -1
  68. package/dist/{types-VFzEM7LL.d.ts → types-ee1FBodH.d.ts} +2 -1
  69. package/dist/{types-h40T3cRG.d.mts → types-wbHHC93P.d.mts} +2 -1
  70. package/package.json +1 -1
  71. package/register/loader.mjs +1 -1
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkGSPBHZBHjs = require('../../chunk-GSPBHZBH.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 = _chunkGSPBHZBHjs.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
- _chunkGSPBHZBHjs.detectAopDep.call(void 0, meta, {
28
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -34,35 +34,36 @@ function bind(router, data, opts = {}) {
34
34
  });
35
35
  registerRoute();
36
36
  function registerRoute() {
37
- _chunkGSPBHZBHjs.Context.applyAddons(globalAddons, router, "koa");
37
+ _chunkNQIFUZL4js.Context.applyAddons(globalAddons, router, "koa");
38
38
  if (parallelRoute) {
39
39
  const subRouter = new (0, _router2.default)();
40
- _chunkGSPBHZBHjs.Context.applyAddons(parallelAddons, subRouter, "koa");
40
+ _chunkNQIFUZL4js.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 _chunkGSPBHZBHjs.Context.filterRecord.default(e);
44
+ const error = await _chunkNQIFUZL4js.Context.filterRecord.default(e);
45
45
  ctx.status = error.status;
46
46
  ctx.body = error;
47
47
  }
48
48
  _chunkJ5CFUN4Vjs.__name.call(void 0, errorHandler, "errorHandler");
49
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkGSPBHZBHjs.BadRequestException)("data format should be an array"));
49
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkNQIFUZL4js.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
  const { tag, func } = item;
54
54
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
55
- if (!metaMap.has(tag)) return resolve(await _chunkGSPBHZBHjs.Context.filterRecord.default(new (0, _chunkGSPBHZBHjs.BadRequestException)(`module "${tag}" doesn't exist`)));
55
+ if (!metaMap.has(tag)) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`module "${tag}" doesn't exist`)));
56
56
  const meta2 = metaMap.get(tag)[func];
57
- if (!meta2) return resolve(await _chunkGSPBHZBHjs.Context.filterRecord.default(new (0, _chunkGSPBHZBHjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
57
+ if (!meta2) return resolve(await _chunkNQIFUZL4js.Context.filterRecord.default(new (0, _chunkNQIFUZL4js.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
58
58
  const { data: { params } } = meta2;
59
- const aop = _chunkGSPBHZBHjs.Context.getAop(meta2, {
59
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
60
60
  globalGuards,
61
61
  globalFilter,
62
62
  globalPipe
63
63
  });
64
64
  const contextData = {
65
65
  type: "koa",
66
+ category: "http",
66
67
  index: i,
67
68
  ctx,
68
69
  meta: meta2,
@@ -70,7 +71,7 @@ function bind(router, data, opts = {}) {
70
71
  parallel: true,
71
72
  next,
72
73
  app: router,
73
- ..._chunkGSPBHZBHjs.argToReq.call(void 0, params, item.args, ctx.headers),
74
+ ..._chunkNQIFUZL4js.argToReq.call(void 0, params, item.args, ctx.headers),
74
75
  tag,
75
76
  func,
76
77
  getCookie: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
@@ -84,7 +85,7 @@ function bind(router, data, opts = {}) {
84
85
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => ctx.req, "getRequest"),
85
86
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => ctx.res, "getResponse")
86
87
  };
87
- const context = new (0, _chunkGSPBHZBHjs.Context)(contextData);
88
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
88
89
  context.run(aop, resolve, resolve);
89
90
  });
90
91
  })).then((ret) => {
@@ -103,14 +104,14 @@ function bind(router, data, opts = {}) {
103
104
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
104
105
  let aop;
105
106
  if (!dynamic) {
106
- aop = _chunkGSPBHZBHjs.Context.getAop(meta2, {
107
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
107
108
  globalFilter,
108
109
  globalGuards,
109
110
  globalPipe
110
111
  });
111
112
  }
112
113
  const subRouter = new (0, _router2.default)();
113
- _chunkGSPBHZBHjs.Context.applyAddons(addons, subRouter, "koa");
114
+ _chunkNQIFUZL4js.Context.applyAddons(addons, subRouter, "koa");
114
115
  router[http.type](http.prefix + http.route, async (ctx, next) => {
115
116
  debug(`invoke method "${func}" in module "${tag}"`);
116
117
  const contextData = {
@@ -123,6 +124,7 @@ function bind(router, data, opts = {}) {
123
124
  func,
124
125
  query: ctx.query,
125
126
  params: ctx.params,
127
+ category: "http",
126
128
  body: ctx.request.body,
127
129
  headers: ctx.headers,
128
130
  next,
@@ -137,10 +139,10 @@ function bind(router, data, opts = {}) {
137
139
  getRequest: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => ctx.req, "getRequest"),
138
140
  getResponse: /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, () => ctx.res, "getResponse")
139
141
  };
140
- const context = new (0, _chunkGSPBHZBHjs.Context)(contextData);
142
+ const context = new (0, _chunkNQIFUZL4js.Context)(contextData);
141
143
  if (http.headers) ctx.set(http.headers);
142
144
  if (dynamic) {
143
- aop = _chunkGSPBHZBHjs.Context.getAop(meta2, {
145
+ aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
144
146
  globalFilter,
145
147
  globalGuards,
146
148
  globalPipe
@@ -160,7 +162,7 @@ function bind(router, data, opts = {}) {
160
162
  }
161
163
  }
162
164
  _chunkJ5CFUN4Vjs.__name.call(void 0, registerRoute, "registerRoute");
163
- _chunkGSPBHZBHjs.HMR.call(void 0, async () => {
165
+ _chunkNQIFUZL4js.HMR.call(void 0, async () => {
164
166
  router.stack = originStack;
165
167
  registerRoute();
166
168
  });
@@ -5,7 +5,7 @@ import {
5
5
  argToReq,
6
6
  createControllerMetaMap,
7
7
  detectAopDep
8
- } from "../../chunk-V7EI76QQ.mjs";
8
+ } from "../../chunk-3FHZB3Z5.mjs";
9
9
  import {
10
10
  __name
11
11
  } from "../../chunk-WHJ5FALK.mjs";
@@ -63,6 +63,7 @@ function bind(router, data, opts = {}) {
63
63
  });
64
64
  const contextData = {
65
65
  type: "koa",
66
+ category: "http",
66
67
  index: i,
67
68
  ctx,
68
69
  meta: meta2,
@@ -123,6 +124,7 @@ function bind(router, data, opts = {}) {
123
124
  func,
124
125
  query: ctx.query,
125
126
  params: ctx.params,
127
+ category: "http",
126
128
  body: ctx.request.body,
127
129
  headers: ctx.headers,
128
130
  next,
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-BXKLFTgG.mjs';
2
- export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-BXKLFTgG.mjs';
3
- import { G as Generator } from './core-BIcUwV18.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-BIcUwV18.mjs';
1
+ import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-D1M85Hef.mjs';
2
+ export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-D1M85Hef.mjs';
3
+ import { G as Generator } from './core-CSiaRU7r.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-CSiaRU7r.mjs';
5
5
  import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpContext } from './types-h40T3cRG.mjs';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-h40T3cRG.mjs';
9
- import { R as RpcContext } from './types-BtbL49Zs.mjs';
10
- export { b as RpcClientOptions, a as RpcServerOptions } from './types-BtbL49Zs.mjs';
7
+ import { H as HttpContext } from './types-wbHHC93P.mjs';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-wbHHC93P.mjs';
9
+ import { R as RpcContext } from './types-JMhFVp-Z.mjs';
10
+ export { b as RpcClientOptions, a as RpcServerOptions } from './types-JMhFVp-Z.mjs';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-BXKLFTgG.js';
2
- export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-BXKLFTgG.js';
3
- import { G as Generator } from './core-CYwEPfN4.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-CYwEPfN4.js';
1
+ import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-D1M85Hef.js';
2
+ export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-D1M85Hef.js';
3
+ import { G as Generator } from './core-C1kHRqU9.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-C1kHRqU9.js';
5
5
  import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpContext } from './types-VFzEM7LL.js';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-VFzEM7LL.js';
9
- import { R as RpcContext } from './types-m3IEDKjP.js';
10
- export { b as RpcClientOptions, a as RpcServerOptions } from './types-m3IEDKjP.js';
7
+ import { H as HttpContext } from './types-ee1FBodH.js';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-ee1FBodH.js';
9
+ import { R as RpcContext } from './types-C9Remkup.js';
10
+ export { b as RpcClientOptions, a as RpcServerOptions } from './types-C9Remkup.js';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@ var _chunkMBCHNDAYjs = require('./chunk-MBCHNDAY.js');
56
56
 
57
57
 
58
58
 
59
- var _chunkGSPBHZBHjs = require('./chunk-GSPBHZBH.js');
59
+ var _chunkNQIFUZL4js = require('./chunk-NQIFUZL4.js');
60
60
 
61
61
 
62
62
 
@@ -131,9 +131,9 @@ var PFilter = class extends ServerBase {
131
131
  constructor(tag) {
132
132
  super();
133
133
  this.key = tag || _phecdacore.getTag.call(void 0, this);
134
- _chunkGSPBHZBHjs.addFilter.call(void 0, this.key, this.use.bind(this));
134
+ _chunkNQIFUZL4js.addFilter.call(void 0, this.key, this.use.bind(this));
135
135
  this.onUnmount(() => {
136
- delete _chunkGSPBHZBHjs.Context.filterRecord[this.key];
136
+ delete _chunkNQIFUZL4js.Context.filterRecord[this.key];
137
137
  });
138
138
  }
139
139
  };
@@ -149,9 +149,9 @@ var PGuard = (_class2 = class extends ServerBase {
149
149
  constructor(tag) {
150
150
  super();_class2.prototype.__init2.call(this);;
151
151
  this.key = tag || _phecdacore.getTag.call(void 0, this);
152
- _chunkGSPBHZBHjs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
152
+ _chunkNQIFUZL4js.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
153
153
  this.onUnmount(() => {
154
- delete _chunkGSPBHZBHjs.Context.guardRecord[this.key];
154
+ delete _chunkNQIFUZL4js.Context.guardRecord[this.key];
155
155
  });
156
156
  }
157
157
  }, _class2);
@@ -166,9 +166,9 @@ var PPipe = class extends ServerBase {
166
166
  constructor(tag) {
167
167
  super();
168
168
  this.key = tag || _phecdacore.getTag.call(void 0, this);
169
- _chunkGSPBHZBHjs.addPipe.call(void 0, this.key, this.use.bind(this));
169
+ _chunkNQIFUZL4js.addPipe.call(void 0, this.key, this.use.bind(this));
170
170
  this.onUnmount(() => {
171
- delete _chunkGSPBHZBHjs.Context.pipeRecord[this.key];
171
+ delete _chunkNQIFUZL4js.Context.pipeRecord[this.key];
172
172
  });
173
173
  }
174
174
  };
@@ -184,9 +184,9 @@ var PAddon = (_class3 = class extends ServerBase {
184
184
  constructor(tag) {
185
185
  super();_class3.prototype.__init3.call(this);;
186
186
  this.key = tag || _phecdacore.getTag.call(void 0, this);
187
- _chunkGSPBHZBHjs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
187
+ _chunkNQIFUZL4js.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
188
188
  this.onUnmount(() => {
189
- delete _chunkGSPBHZBHjs.Context.addonRecord[this.key];
189
+ delete _chunkNQIFUZL4js.Context.addonRecord[this.key];
190
190
  });
191
191
  }
192
192
  }, _class3);
@@ -204,27 +204,27 @@ var PExtension = class extends ServerBase {
204
204
  super();
205
205
  const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
206
206
  if (this.pipe) {
207
- _chunkGSPBHZBHjs.addPipe.call(void 0, key, this.pipe.bind(this));
207
+ _chunkNQIFUZL4js.addPipe.call(void 0, key, this.pipe.bind(this));
208
208
  this.onUnmount(() => {
209
- delete _chunkGSPBHZBHjs.Context.pipeRecord[key];
209
+ delete _chunkNQIFUZL4js.Context.pipeRecord[key];
210
210
  });
211
211
  }
212
212
  if (this.addon) {
213
- _chunkGSPBHZBHjs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
213
+ _chunkNQIFUZL4js.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
214
214
  this.onUnmount(() => {
215
- delete _chunkGSPBHZBHjs.Context.addonRecord[key];
215
+ delete _chunkNQIFUZL4js.Context.addonRecord[key];
216
216
  });
217
217
  }
218
218
  if (this.guard) {
219
- _chunkGSPBHZBHjs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
219
+ _chunkNQIFUZL4js.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
220
220
  this.onUnmount(() => {
221
- delete _chunkGSPBHZBHjs.Context.guardRecord[key];
221
+ delete _chunkNQIFUZL4js.Context.guardRecord[key];
222
222
  });
223
223
  }
224
224
  if (this.filter) {
225
- _chunkGSPBHZBHjs.addFilter.call(void 0, key, this.filter.bind(this));
225
+ _chunkNQIFUZL4js.addFilter.call(void 0, key, this.filter.bind(this));
226
226
  this.onUnmount(() => {
227
- delete _chunkGSPBHZBHjs.Context.filterRecord[key];
227
+ delete _chunkNQIFUZL4js.Context.filterRecord[key];
228
228
  });
229
229
  }
230
230
  }
@@ -308,7 +308,7 @@ var HTTPGenerator = (_class5 = class extends Generator {constructor(...args4) {
308
308
  if (!this.classMap[name]) this.classMap[name] = {};
309
309
  this.classMap[name][func] = `
310
310
  ${func}(...args){
311
- const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}",args}
311
+ const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}"}
312
312
 
313
313
  ${params.reduce((p, c, i) => `${p}ret.${c.type}${c.key ? `['${c.key}']` : ""}=args[${i}]
314
314
  ${c.type === "params" ? `ret.url=ret.url.replace('{{${c.key}}}',args[${i}])` : ""}
@@ -404,4 +404,4 @@ return ret
404
404
 
405
405
 
406
406
 
407
- exports.Addon = _chunkMBCHNDAYjs.Addon; exports.Arg = _chunkMBCHNDAYjs.Arg; exports.BadGatewayException = _chunkGSPBHZBHjs.BadGatewayException; exports.BadRequestException = _chunkGSPBHZBHjs.BadRequestException; exports.BaseParam = _chunkMBCHNDAYjs.BaseParam; exports.Body = _chunkMBCHNDAYjs.Body; exports.ConflictException = _chunkGSPBHZBHjs.ConflictException; exports.Context = _chunkGSPBHZBHjs.Context; exports.Controller = _chunkMBCHNDAYjs.Controller; exports.Ctx = _chunkMBCHNDAYjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkMBCHNDAYjs.Define; exports.Delete = _chunkMBCHNDAYjs.Delete; exports.ERROR_SYMBOL = _chunkJ5CFUN4Vjs.ERROR_SYMBOL; exports.Exception = _chunkGSPBHZBHjs.Exception; exports.Factory = _chunk7YQ57BQSjs.Factory; exports.Filter = _chunkMBCHNDAYjs.Filter; exports.ForbiddenException = _chunkGSPBHZBHjs.ForbiddenException; exports.FrameworkException = _chunkGSPBHZBHjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkMBCHNDAYjs.Get; exports.Guard = _chunkMBCHNDAYjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkMBCHNDAYjs.Head; exports.Header = _chunkMBCHNDAYjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkJ5CFUN4Vjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkJ5CFUN4Vjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkJ5CFUN4Vjs.IS_STRICT; exports.InvalidInputException = _chunkGSPBHZBHjs.InvalidInputException; exports.LOG_LEVEL = _chunkJ5CFUN4Vjs.LOG_LEVEL; exports.Meta = _chunk7YQ57BQSjs.Meta; exports.Mixin = _chunkJ5CFUN4Vjs.Mixin; exports.NotFoundException = _chunkGSPBHZBHjs.NotFoundException; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunkJ5CFUN4Vjs.PS_EXIT_CODE; exports.Param = _chunkMBCHNDAYjs.Param; exports.Patch = _chunkMBCHNDAYjs.Patch; exports.PayloadLargeException = _chunkGSPBHZBHjs.PayloadLargeException; exports.Pipe = _chunkMBCHNDAYjs.Pipe; exports.Post = _chunkMBCHNDAYjs.Post; exports.Put = _chunkMBCHNDAYjs.Put; exports.Query = _chunkMBCHNDAYjs.Query; exports.Queue = _chunkMBCHNDAYjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkMBCHNDAYjs.Route; exports.Rpc = _chunkMBCHNDAYjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkMBCHNDAYjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunk7YQ57BQSjs.ServerPhecda; exports.ServiceUnavailableException = _chunkGSPBHZBHjs.ServiceUnavailableException; exports.TimeoutException = _chunkGSPBHZBHjs.TimeoutException; exports.TimerException = _chunkGSPBHZBHjs.TimerException; exports.UnauthorizedException = _chunkGSPBHZBHjs.UnauthorizedException; exports.UndefinedException = _chunkGSPBHZBHjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkGSPBHZBHjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkGSPBHZBHjs.ValidateException; exports.WorkerException = _chunkGSPBHZBHjs.WorkerException; exports.addAddon = _chunkGSPBHZBHjs.addAddon; exports.addFilter = _chunkGSPBHZBHjs.addFilter; exports.addGuard = _chunkGSPBHZBHjs.addGuard; exports.addPipe = _chunkGSPBHZBHjs.addPipe; exports.defaultPipe = _chunkGSPBHZBHjs.defaultPipe; exports.defaultServerInject = _chunk7YQ57BQSjs.defaultServerInject; exports.emitter = _chunk7YQ57BQSjs.emitter; exports.getLogger = _chunkJ5CFUN4Vjs.getLogger; exports.log = _chunkJ5CFUN4Vjs.log; exports.phecdaNamespace = _chunk7YQ57BQSjs.phecdaNamespace; exports.runMiddleware = _chunkJ5CFUN4Vjs.runMiddleware; exports.setLogger = _chunkJ5CFUN4Vjs.setLogger; exports.useS = _chunk7YQ57BQSjs.useS;
407
+ exports.Addon = _chunkMBCHNDAYjs.Addon; exports.Arg = _chunkMBCHNDAYjs.Arg; exports.BadGatewayException = _chunkNQIFUZL4js.BadGatewayException; exports.BadRequestException = _chunkNQIFUZL4js.BadRequestException; exports.BaseParam = _chunkMBCHNDAYjs.BaseParam; exports.Body = _chunkMBCHNDAYjs.Body; exports.ConflictException = _chunkNQIFUZL4js.ConflictException; exports.Context = _chunkNQIFUZL4js.Context; exports.Controller = _chunkMBCHNDAYjs.Controller; exports.Ctx = _chunkMBCHNDAYjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkMBCHNDAYjs.Define; exports.Delete = _chunkMBCHNDAYjs.Delete; exports.ERROR_SYMBOL = _chunkJ5CFUN4Vjs.ERROR_SYMBOL; exports.Exception = _chunkNQIFUZL4js.Exception; exports.Factory = _chunk7YQ57BQSjs.Factory; exports.Filter = _chunkMBCHNDAYjs.Filter; exports.ForbiddenException = _chunkNQIFUZL4js.ForbiddenException; exports.FrameworkException = _chunkNQIFUZL4js.FrameworkException; exports.Generator = Generator; exports.Get = _chunkMBCHNDAYjs.Get; exports.Guard = _chunkMBCHNDAYjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkMBCHNDAYjs.Head; exports.Header = _chunkMBCHNDAYjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkJ5CFUN4Vjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkJ5CFUN4Vjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkJ5CFUN4Vjs.IS_STRICT; exports.InvalidInputException = _chunkNQIFUZL4js.InvalidInputException; exports.LOG_LEVEL = _chunkJ5CFUN4Vjs.LOG_LEVEL; exports.Meta = _chunk7YQ57BQSjs.Meta; exports.Mixin = _chunkJ5CFUN4Vjs.Mixin; exports.NotFoundException = _chunkNQIFUZL4js.NotFoundException; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunkJ5CFUN4Vjs.PS_EXIT_CODE; exports.Param = _chunkMBCHNDAYjs.Param; exports.Patch = _chunkMBCHNDAYjs.Patch; exports.PayloadLargeException = _chunkNQIFUZL4js.PayloadLargeException; exports.Pipe = _chunkMBCHNDAYjs.Pipe; exports.Post = _chunkMBCHNDAYjs.Post; exports.Put = _chunkMBCHNDAYjs.Put; exports.Query = _chunkMBCHNDAYjs.Query; exports.Queue = _chunkMBCHNDAYjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkMBCHNDAYjs.Route; exports.Rpc = _chunkMBCHNDAYjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkMBCHNDAYjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunk7YQ57BQSjs.ServerPhecda; exports.ServiceUnavailableException = _chunkNQIFUZL4js.ServiceUnavailableException; exports.TimeoutException = _chunkNQIFUZL4js.TimeoutException; exports.TimerException = _chunkNQIFUZL4js.TimerException; exports.UnauthorizedException = _chunkNQIFUZL4js.UnauthorizedException; exports.UndefinedException = _chunkNQIFUZL4js.UndefinedException; exports.UnsupportedMediaTypeException = _chunkNQIFUZL4js.UnsupportedMediaTypeException; exports.ValidateException = _chunkNQIFUZL4js.ValidateException; exports.WorkerException = _chunkNQIFUZL4js.WorkerException; exports.addAddon = _chunkNQIFUZL4js.addAddon; exports.addFilter = _chunkNQIFUZL4js.addFilter; exports.addGuard = _chunkNQIFUZL4js.addGuard; exports.addPipe = _chunkNQIFUZL4js.addPipe; exports.defaultPipe = _chunkNQIFUZL4js.defaultPipe; exports.defaultServerInject = _chunk7YQ57BQSjs.defaultServerInject; exports.emitter = _chunk7YQ57BQSjs.emitter; exports.getLogger = _chunkJ5CFUN4Vjs.getLogger; exports.log = _chunkJ5CFUN4Vjs.log; exports.phecdaNamespace = _chunk7YQ57BQSjs.phecdaNamespace; exports.runMiddleware = _chunkJ5CFUN4Vjs.runMiddleware; exports.setLogger = _chunkJ5CFUN4Vjs.setLogger; exports.useS = _chunk7YQ57BQSjs.useS;
package/dist/index.mjs CHANGED
@@ -56,7 +56,7 @@ import {
56
56
  addGuard,
57
57
  addPipe,
58
58
  defaultPipe
59
- } from "./chunk-V7EI76QQ.mjs";
59
+ } from "./chunk-3FHZB3Z5.mjs";
60
60
  import {
61
61
  ERROR_SYMBOL,
62
62
  IS_HMR,
@@ -308,7 +308,7 @@ var HTTPGenerator = class extends Generator {
308
308
  if (!this.classMap[name]) this.classMap[name] = {};
309
309
  this.classMap[name][func] = `
310
310
  ${func}(...args){
311
- const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}",args}
311
+ const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}"}
312
312
 
313
313
  ${params.reduce((p, c, i) => `${p}ret.${c.type}${c.key ? `['${c.key}']` : ""}=args[${i}]
314
314
  ${c.type === "params" ? `ret.url=ret.url.replace('{{${c.key}}}',args[${i}])` : ""}
@@ -37,6 +37,7 @@ interface BaseContext {
37
37
  type: string;
38
38
  tag: string;
39
39
  func: string;
40
+ category: string;
40
41
  [key: string]: any;
41
42
  }
42
43
  interface DefaultOptions {
@@ -37,6 +37,7 @@ interface BaseContext {
37
37
  type: string;
38
38
  tag: string;
39
39
  func: string;
40
+ category: string;
40
41
  [key: string]: any;
41
42
  }
42
43
  interface DefaultOptions {
@@ -1,7 +1,7 @@
1
1
  import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
2
- import { F as Factory } from '../../core-BIcUwV18.mjs';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-BtbL49Zs.mjs';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.mjs';
2
+ import { F as Factory } from '../../core-CSiaRU7r.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JMhFVp-Z.mjs';
4
+ import { T as ToClientMap } from '../../meta-D1M85Hef.mjs';
5
5
  import 'phecda-core';
6
6
 
7
7
  interface BullmqCtx extends RpcContext {
@@ -1,7 +1,7 @@
1
1
  import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
2
- import { F as Factory } from '../../core-CYwEPfN4.js';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-m3IEDKjP.js';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.js';
2
+ import { F as Factory } from '../../core-C1kHRqU9.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-C9Remkup.js';
4
+ import { T as ToClientMap } from '../../meta-D1M85Hef.js';
5
5
  import 'phecda-core';
6
6
 
7
7
  interface BullmqCtx extends RpcContext {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkGSPBHZBHjs = require('../../chunk-GSPBHZBH.js');
7
+ var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
8
8
 
9
9
 
10
10
  var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
@@ -18,14 +18,14 @@ async function create({ moduleMap, meta }, opts = {}) {
18
18
  const workerMap = {};
19
19
  const queueMap = {};
20
20
  const existQueue = /* @__PURE__ */ new Set();
21
- const metaMap = _chunkGSPBHZBHjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, rpc, func, tag } = meta2.data;
23
23
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
24
24
  debug(`register method "${func}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkGSPBHZBHjs.detectAopDep.call(void 0, meta, {
28
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
29
29
  guards: globalGuards
30
30
  }, "rpc");
31
31
  async function subscribeQueues() {
@@ -39,7 +39,7 @@ async function create({ moduleMap, meta }, opts = {}) {
39
39
  if (existQueue.has(queue)) continue;
40
40
  existQueue.add(queue);
41
41
  workerMap[queue] = new (0, _bullmq.Worker)(queue, handleRequest, workerOpts);
42
- _chunkGSPBHZBHjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
42
+ _chunkNQIFUZL4js.Context.applyAddons(addons, workerMap[queue], "bullmq");
43
43
  }
44
44
  }
45
45
  }
@@ -53,13 +53,14 @@ async function create({ moduleMap, meta }, opts = {}) {
53
53
  const meta2 = metaMap.get(tag)[func];
54
54
  const { data: { rpc: { isEvent } = {} } } = meta2;
55
55
  if (!isEvent && !(clientQueue in queueMap)) queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
56
- const aop = _chunkGSPBHZBHjs.Context.getAop(meta2, {
56
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
57
57
  globalFilter,
58
58
  globalGuards,
59
59
  globalPipe
60
60
  });
61
- const context = new (0, _chunkGSPBHZBHjs.Context)({
61
+ const context = new (0, _chunkNQIFUZL4js.Context)({
62
62
  type: "bullmq",
63
+ category: "rpc",
63
64
  moduleMap,
64
65
  meta: meta2,
65
66
  tag,
@@ -87,7 +88,7 @@ async function create({ moduleMap, meta }, opts = {}) {
87
88
  }
88
89
  _chunkJ5CFUN4Vjs.__name.call(void 0, handleRequest, "handleRequest");
89
90
  subscribeQueues();
90
- _chunkGSPBHZBHjs.HMR.call(void 0, async () => {
91
+ _chunkNQIFUZL4js.HMR.call(void 0, async () => {
91
92
  for (const i in workerMap) await workerMap[i].close(true);
92
93
  for (const i in queueMap) await queueMap[i].close();
93
94
  await subscribeQueues();
@@ -108,7 +109,7 @@ async function createClient(controllers, opts = {}) {
108
109
  const { max, workerOpts, queueOpts, timeout, key } = opts;
109
110
  const ret = {};
110
111
  const emitter = new (0, _events.EventEmitter)();
111
- const clientQueue = _chunkGSPBHZBHjs.genClientQueue.call(void 0, key);
112
+ const clientQueue = _chunkNQIFUZL4js.genClientQueue.call(void 0, key);
112
113
  const queueMap = {};
113
114
  new (0, _bullmq.Worker)(clientQueue, async (job) => {
114
115
  const { data, id, error } = job.data;
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  genClientQueue
7
- } from "../../chunk-V7EI76QQ.mjs";
7
+ } from "../../chunk-3FHZB3Z5.mjs";
8
8
  import {
9
9
  __name
10
10
  } from "../../chunk-WHJ5FALK.mjs";
@@ -60,6 +60,7 @@ async function create({ moduleMap, meta }, opts = {}) {
60
60
  });
61
61
  const context = new Context({
62
62
  type: "bullmq",
63
+ category: "rpc",
63
64
  moduleMap,
64
65
  meta: meta2,
65
66
  tag,
@@ -1,7 +1,7 @@
1
1
  import { Consumer, Producer } from 'kafkajs';
2
- import { F as Factory } from '../../core-BIcUwV18.mjs';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-BtbL49Zs.mjs';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.mjs';
2
+ import { F as Factory } from '../../core-CSiaRU7r.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JMhFVp-Z.mjs';
4
+ import { T as ToClientMap } from '../../meta-D1M85Hef.mjs';
5
5
  import 'phecda-core';
6
6
 
7
7
  interface KafkaCtx extends RpcContext {
@@ -1,7 +1,7 @@
1
1
  import { Consumer, Producer } from 'kafkajs';
2
- import { F as Factory } from '../../core-CYwEPfN4.js';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-m3IEDKjP.js';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.js';
2
+ import { F as Factory } from '../../core-C1kHRqU9.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-C9Remkup.js';
4
+ import { T as ToClientMap } from '../../meta-D1M85Hef.js';
5
5
  import 'phecda-core';
6
6
 
7
7
  interface KafkaCtx extends RpcContext {
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkGSPBHZBHjs = require('../../chunk-GSPBHZBH.js');
6
+ var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
7
7
 
8
8
 
9
9
  var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
@@ -14,18 +14,18 @@ var debug = _debug2.default.call(void 0, "phecda-server/kafka");
14
14
  async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
15
15
  const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
16
16
  const existQueue = /* @__PURE__ */ new Set();
17
- const metaMap = _chunkGSPBHZBHjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
+ const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
18
18
  const { controller, rpc, func, tag } = meta2.data;
19
19
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
20
20
  debug(`register method "${func}" in module "${tag}"`);
21
21
  return true;
22
22
  }
23
23
  });
24
- _chunkGSPBHZBHjs.detectAopDep.call(void 0, meta, {
24
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
25
25
  guards: globalGuards,
26
26
  addons: globalAddons
27
27
  }, "rpc");
28
- _chunkGSPBHZBHjs.Context.applyAddons(globalAddons, {
28
+ _chunkNQIFUZL4js.Context.applyAddons(globalAddons, {
29
29
  consumer,
30
30
  producer
31
31
  }, "kafka");
@@ -59,13 +59,14 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
59
59
  const meta2 = metaMap.get(tag)[func];
60
60
  const { data: { rpc } } = meta2;
61
61
  const isEvent = rpc.isEvent;
62
- const aop = _chunkGSPBHZBHjs.Context.getAop(meta2, {
62
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
63
63
  globalFilter,
64
64
  globalGuards,
65
65
  globalPipe
66
66
  });
67
- const context = new (0, _chunkGSPBHZBHjs.Context)({
67
+ const context = new (0, _chunkNQIFUZL4js.Context)({
68
68
  type: "kafka",
69
+ category: "rpc",
69
70
  moduleMap,
70
71
  meta: meta2,
71
72
  args,
@@ -121,7 +122,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
121
122
  let eventCount = 1;
122
123
  const ret = {};
123
124
  const emitter = new (0, _events.EventEmitter)();
124
- const clientQueue = _chunkGSPBHZBHjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
125
+ const clientQueue = _chunkNQIFUZL4js.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
125
126
  await consumer.subscribe({
126
127
  topic: clientQueue,
127
128
  fromBeginning: true
@@ -3,7 +3,7 @@ import {
3
3
  createControllerMetaMap,
4
4
  detectAopDep,
5
5
  genClientQueue
6
- } from "../../chunk-V7EI76QQ.mjs";
6
+ } from "../../chunk-3FHZB3Z5.mjs";
7
7
  import {
8
8
  __name
9
9
  } from "../../chunk-WHJ5FALK.mjs";
@@ -66,6 +66,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
66
66
  });
67
67
  const context = new Context({
68
68
  type: "kafka",
69
+ category: "rpc",
69
70
  moduleMap,
70
71
  meta: meta2,
71
72
  args,
@@ -1,7 +1,7 @@
1
1
  import { NatsConnection } from 'nats';
2
- import { F as Factory } from '../../core-BIcUwV18.mjs';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-BtbL49Zs.mjs';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.mjs';
2
+ import { F as Factory } from '../../core-CSiaRU7r.mjs';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JMhFVp-Z.mjs';
4
+ import { T as ToClientMap } from '../../meta-D1M85Hef.mjs';
5
5
  import 'phecda-core';
6
6
 
7
7
  interface NatsCtx extends RpcContext {
@@ -1,7 +1,7 @@
1
1
  import { NatsConnection } from 'nats';
2
- import { F as Factory } from '../../core-CYwEPfN4.js';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-m3IEDKjP.js';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.js';
2
+ import { F as Factory } from '../../core-C1kHRqU9.js';
3
+ import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-C9Remkup.js';
4
+ import { T as ToClientMap } from '../../meta-D1M85Hef.js';
5
5
  import 'phecda-core';
6
6
 
7
7
  interface NatsCtx extends RpcContext {