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

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 (86) hide show
  1. package/assets/ps.json +24 -24
  2. package/assets/schema.json +55 -55
  3. package/bin/cli.mjs +31 -18
  4. package/dist/chunk-4LLLQOMF.js +152 -0
  5. package/dist/{chunk-BGXSMOLX.js → chunk-6OQ2SB5W.js} +138 -70
  6. package/dist/{chunk-SW5IKE5H.js → chunk-G7JFKM2M.js} +136 -89
  7. package/dist/{chunk-MBCHNDAY.js → chunk-KCPBITYZ.js} +24 -24
  8. package/dist/{chunk-HMVLXNV3.mjs → chunk-MUI6MTUO.mjs} +1 -1
  9. package/dist/chunk-NQ55PA2X.mjs +152 -0
  10. package/dist/{chunk-5622RBNB.mjs → chunk-YCES6ABN.mjs} +125 -57
  11. package/dist/{chunk-P75VKZJY.mjs → chunk-Z7NAAE4M.mjs} +94 -47
  12. package/dist/{core-BIcUwV18.d.mts → core-CUTbX_IS.d.ts} +5 -3
  13. package/dist/{core-CYwEPfN4.d.ts → core-DIfgUKIU.d.mts} +5 -3
  14. package/dist/helper.d.mts +8 -6
  15. package/dist/helper.d.ts +8 -6
  16. package/dist/helper.js +8 -3
  17. package/dist/helper.mjs +10 -5
  18. package/dist/http/elysia/index.d.mts +4 -4
  19. package/dist/http/elysia/index.d.ts +4 -4
  20. package/dist/http/elysia/index.js +43 -44
  21. package/dist/http/elysia/index.mjs +9 -10
  22. package/dist/http/express/index.d.mts +4 -4
  23. package/dist/http/express/index.d.ts +4 -4
  24. package/dist/http/express/index.js +40 -41
  25. package/dist/http/express/index.mjs +9 -10
  26. package/dist/http/fastify/index.d.mts +4 -4
  27. package/dist/http/fastify/index.d.ts +4 -4
  28. package/dist/http/fastify/index.js +41 -42
  29. package/dist/http/fastify/index.mjs +9 -10
  30. package/dist/http/h3/index.d.mts +4 -4
  31. package/dist/http/h3/index.d.ts +4 -4
  32. package/dist/http/h3/index.js +41 -42
  33. package/dist/http/h3/index.mjs +9 -10
  34. package/dist/http/hono/index.d.mts +4 -4
  35. package/dist/http/hono/index.d.ts +4 -4
  36. package/dist/http/hono/index.js +37 -39
  37. package/dist/http/hono/index.mjs +5 -7
  38. package/dist/http/hyper-express/index.d.mts +4 -4
  39. package/dist/http/hyper-express/index.d.ts +4 -4
  40. package/dist/http/hyper-express/index.js +38 -39
  41. package/dist/http/hyper-express/index.mjs +8 -9
  42. package/dist/http/koa/index.d.mts +4 -4
  43. package/dist/http/koa/index.d.ts +4 -4
  44. package/dist/http/koa/index.js +40 -41
  45. package/dist/http/koa/index.mjs +9 -10
  46. package/dist/index.d.mts +46 -40
  47. package/dist/index.d.ts +46 -40
  48. package/dist/index.js +48 -42
  49. package/dist/index.mjs +21 -15
  50. package/dist/{meta-BXKLFTgG.d.mts → meta-CR-D39hQ.d.mts} +7 -5
  51. package/dist/{meta-BXKLFTgG.d.ts → meta-CR-D39hQ.d.ts} +7 -5
  52. package/dist/rpc/bullmq/index.d.mts +5 -5
  53. package/dist/rpc/bullmq/index.d.ts +5 -5
  54. package/dist/rpc/bullmq/index.js +15 -14
  55. package/dist/rpc/bullmq/index.mjs +4 -3
  56. package/dist/rpc/kafka/index.d.mts +4 -4
  57. package/dist/rpc/kafka/index.d.ts +4 -4
  58. package/dist/rpc/kafka/index.js +15 -14
  59. package/dist/rpc/kafka/index.mjs +3 -2
  60. package/dist/rpc/nats/index.d.mts +4 -4
  61. package/dist/rpc/nats/index.d.ts +4 -4
  62. package/dist/rpc/nats/index.js +14 -13
  63. package/dist/rpc/nats/index.mjs +4 -3
  64. package/dist/rpc/rabbitmq/index.d.mts +4 -4
  65. package/dist/rpc/rabbitmq/index.d.ts +4 -4
  66. package/dist/rpc/rabbitmq/index.js +16 -15
  67. package/dist/rpc/rabbitmq/index.mjs +4 -3
  68. package/dist/rpc/redis/index.d.mts +4 -4
  69. package/dist/rpc/redis/index.d.ts +4 -4
  70. package/dist/rpc/redis/index.js +14 -13
  71. package/dist/rpc/redis/index.mjs +4 -3
  72. package/dist/test.d.mts +3 -3
  73. package/dist/test.d.ts +3 -3
  74. package/dist/test.js +6 -6
  75. package/dist/test.mjs +2 -2
  76. package/dist/{types-h40T3cRG.d.mts → types-BF1TDbFV.d.ts} +4 -3
  77. package/dist/{types-BtbL49Zs.d.mts → types-DYRu0vic.d.ts} +4 -3
  78. package/dist/{types-VFzEM7LL.d.ts → types-DYviSl5B.d.mts} +4 -3
  79. package/dist/{types-m3IEDKjP.d.ts → types-DqH1qA-q.d.mts} +4 -3
  80. package/package.json +8 -5
  81. package/register/export.mjs +30 -0
  82. package/register/index.mjs +50 -40
  83. package/register/loader.mjs +384 -367
  84. package/register/utils.mjs +60 -56
  85. package/dist/chunk-J5CFUN4V.js +0 -73
  86. package/dist/chunk-WHJ5FALK.mjs +0 -73
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkBGXSMOLXjs = require('./chunk-BGXSMOLX.js');
9
+ var _chunk6OQ2SB5Wjs = require('./chunk-6OQ2SB5W.js');
10
10
 
11
11
 
12
12
 
@@ -31,7 +31,7 @@ var _chunkBGXSMOLXjs = require('./chunk-BGXSMOLX.js');
31
31
 
32
32
 
33
33
 
34
- var _chunkMBCHNDAYjs = require('./chunk-MBCHNDAY.js');
34
+ var _chunkKCPBITYZjs = require('./chunk-KCPBITYZ.js');
35
35
 
36
36
 
37
37
 
@@ -56,8 +56,8 @@ var _chunkMBCHNDAYjs = require('./chunk-MBCHNDAY.js');
56
56
 
57
57
 
58
58
 
59
- var _chunkSW5IKE5Hjs = require('./chunk-SW5IKE5H.js');
60
59
 
60
+ var _chunkG7JFKM2Mjs = require('./chunk-G7JFKM2M.js');
61
61
 
62
62
 
63
63
 
@@ -70,13 +70,15 @@ var _chunkSW5IKE5Hjs = require('./chunk-SW5IKE5H.js');
70
70
 
71
71
 
72
72
 
73
- var _chunkJ5CFUN4Vjs = require('./chunk-J5CFUN4V.js');
73
+
74
+
75
+ var _chunk4LLLQOMFjs = require('./chunk-4LLLQOMF.js');
74
76
 
75
77
  // src/types.ts
76
78
  var ResponseSymbol = Symbol("response");
77
79
  var CustomResponse = class {
78
80
  static {
79
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "CustomResponse");
81
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "CustomResponse");
80
82
  }
81
83
 
82
84
  };
@@ -89,51 +91,54 @@ function _ts_decorate(decorators, target, key, desc) {
89
91
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
90
92
  return c > 3 && r && Object.defineProperty(target, key, r), r;
91
93
  }
92
- _chunkJ5CFUN4Vjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
94
+ _chunk4LLLQOMFjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
93
95
  function _ts_metadata(k, v) {
94
96
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
95
97
  }
96
- _chunkJ5CFUN4Vjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
98
+ _chunk4LLLQOMFjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
97
99
  var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
98
100
  static {
99
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "ServerBase");
101
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "ServerBase");
102
+ }
103
+ __init() {this.emitter = exports.emitter = _chunk6OQ2SB5Wjs.emitter}
104
+ log(msg, level = "log") {
105
+ _chunk4LLLQOMFjs.log.call(void 0, msg, level, this.tag);
100
106
  }
101
- __init() {this.emitter = exports.emitter = _chunkBGXSMOLXjs.emitter}
102
107
  }, _class);
103
108
  var HttpBase = class extends ServerBase {
104
109
  static {
105
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "HttpBase");
110
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "HttpBase");
106
111
  }
107
112
 
108
113
  };
109
114
  _ts_decorate([
110
- _chunkMBCHNDAYjs.Ctx,
111
- _ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
115
+ _chunkKCPBITYZjs.Ctx,
116
+ _ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
112
117
  ], HttpBase.prototype, "context", void 0);
113
118
  var RpcBase = class extends ServerBase {
114
119
  static {
115
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "RpcBase");
120
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "RpcBase");
116
121
  }
117
122
 
118
123
  };
119
124
  _ts_decorate([
120
- _chunkMBCHNDAYjs.Ctx,
121
- _ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
125
+ _chunkKCPBITYZjs.Ctx,
126
+ _ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
122
127
  ], RpcBase.prototype, "context", void 0);
123
128
 
124
129
  // src/modules/filter.ts
125
130
 
126
131
  var PFilter = class extends ServerBase {
127
132
  static {
128
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "PFilter");
133
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "PFilter");
129
134
  }
130
135
 
131
136
  constructor(tag) {
132
137
  super();
133
138
  this.key = tag || _phecdacore.getTag.call(void 0, this);
134
- _chunkSW5IKE5Hjs.addFilter.call(void 0, this.key, this.use.bind(this));
139
+ _chunkG7JFKM2Mjs.addFilter.call(void 0, this.key, this.use.bind(this));
135
140
  this.onUnmount(() => {
136
- delete _chunkSW5IKE5Hjs.Context.filterRecord[this.key];
141
+ delete _chunkG7JFKM2Mjs.Context.filterRecord[this.key];
137
142
  });
138
143
  }
139
144
  };
@@ -142,16 +147,16 @@ var PFilter = class extends ServerBase {
142
147
 
143
148
  var PGuard = (_class2 = class extends ServerBase {
144
149
  static {
145
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "PGuard");
150
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "PGuard");
146
151
  }
147
152
 
148
153
  __init2() {this.priority = 0}
149
154
  constructor(tag) {
150
155
  super();_class2.prototype.__init2.call(this);;
151
156
  this.key = tag || _phecdacore.getTag.call(void 0, this);
152
- _chunkSW5IKE5Hjs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
157
+ _chunkG7JFKM2Mjs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
153
158
  this.onUnmount(() => {
154
- delete _chunkSW5IKE5Hjs.Context.guardRecord[this.key];
159
+ delete _chunkG7JFKM2Mjs.Context.guardRecord[this.key];
155
160
  });
156
161
  }
157
162
  }, _class2);
@@ -160,15 +165,15 @@ var PGuard = (_class2 = class extends ServerBase {
160
165
 
161
166
  var PPipe = class extends ServerBase {
162
167
  static {
163
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "PPipe");
168
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "PPipe");
164
169
  }
165
170
 
166
171
  constructor(tag) {
167
172
  super();
168
173
  this.key = tag || _phecdacore.getTag.call(void 0, this);
169
- _chunkSW5IKE5Hjs.addPipe.call(void 0, this.key, this.use.bind(this));
174
+ _chunkG7JFKM2Mjs.addPipe.call(void 0, this.key, this.use.bind(this));
170
175
  this.onUnmount(() => {
171
- delete _chunkSW5IKE5Hjs.Context.pipeRecord[this.key];
176
+ delete _chunkG7JFKM2Mjs.Context.pipeRecord[this.key];
172
177
  });
173
178
  }
174
179
  };
@@ -177,16 +182,16 @@ var PPipe = class extends ServerBase {
177
182
 
178
183
  var PAddon = (_class3 = class extends ServerBase {
179
184
  static {
180
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "PAddon");
185
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "PAddon");
181
186
  }
182
187
 
183
188
  __init3() {this.priority = 0}
184
189
  constructor(tag) {
185
190
  super();_class3.prototype.__init3.call(this);;
186
191
  this.key = tag || _phecdacore.getTag.call(void 0, this);
187
- _chunkSW5IKE5Hjs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
192
+ _chunkG7JFKM2Mjs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
188
193
  this.onUnmount(() => {
189
- delete _chunkSW5IKE5Hjs.Context.addonRecord[this.key];
194
+ delete _chunkG7JFKM2Mjs.Context.addonRecord[this.key];
190
195
  });
191
196
  }
192
197
  }, _class3);
@@ -195,7 +200,7 @@ var PAddon = (_class3 = class extends ServerBase {
195
200
 
196
201
  var PExtension = class extends ServerBase {
197
202
  static {
198
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "PExtension");
203
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "PExtension");
199
204
  }
200
205
 
201
206
 
@@ -204,27 +209,27 @@ var PExtension = class extends ServerBase {
204
209
  super();
205
210
  const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
206
211
  if (this.pipe) {
207
- _chunkSW5IKE5Hjs.addPipe.call(void 0, key, this.pipe.bind(this));
212
+ _chunkG7JFKM2Mjs.addPipe.call(void 0, key, this.pipe.bind(this));
208
213
  this.onUnmount(() => {
209
- delete _chunkSW5IKE5Hjs.Context.pipeRecord[key];
214
+ delete _chunkG7JFKM2Mjs.Context.pipeRecord[key];
210
215
  });
211
216
  }
212
217
  if (this.addon) {
213
- _chunkSW5IKE5Hjs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
218
+ _chunkG7JFKM2Mjs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
214
219
  this.onUnmount(() => {
215
- delete _chunkSW5IKE5Hjs.Context.addonRecord[key];
220
+ delete _chunkG7JFKM2Mjs.Context.addonRecord[key];
216
221
  });
217
222
  }
218
223
  if (this.guard) {
219
- _chunkSW5IKE5Hjs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
224
+ _chunkG7JFKM2Mjs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
220
225
  this.onUnmount(() => {
221
- delete _chunkSW5IKE5Hjs.Context.guardRecord[key];
226
+ delete _chunkG7JFKM2Mjs.Context.guardRecord[key];
222
227
  });
223
228
  }
224
229
  if (this.filter) {
225
- _chunkSW5IKE5Hjs.addFilter.call(void 0, key, this.filter.bind(this));
230
+ _chunkG7JFKM2Mjs.addFilter.call(void 0, key, this.filter.bind(this));
226
231
  this.onUnmount(() => {
227
- delete _chunkSW5IKE5Hjs.Context.filterRecord[key];
232
+ delete _chunkG7JFKM2Mjs.Context.filterRecord[key];
228
233
  });
229
234
  }
230
235
  }
@@ -234,7 +239,7 @@ var PExtension = class extends ServerBase {
234
239
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
235
240
  var Generator = class {
236
241
  static {
237
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "Generator");
242
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "Generator");
238
243
  }
239
244
 
240
245
  constructor(path) {
@@ -251,7 +256,7 @@ var Generator = class {
251
256
  // src/generator/rpc.ts
252
257
  var RPCGenerator = (_class4 = class extends Generator {constructor(...args3) { super(...args3); _class4.prototype.__init4.call(this);_class4.prototype.__init5.call(this); }
253
258
  static {
254
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "RPCGenerator");
259
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "RPCGenerator");
255
260
  }
256
261
  __init4() {this.name = "RPC"}
257
262
  __init5() {this.classMap = {}}
@@ -287,7 +292,7 @@ var RPCGenerator = (_class4 = class extends Generator {constructor(...args3) { s
287
292
  // src/generator/http.ts
288
293
  var HTTPGenerator = (_class5 = class extends Generator {constructor(...args4) { super(...args4); _class5.prototype.__init6.call(this);_class5.prototype.__init7.call(this); }
289
294
  static {
290
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "HTTPGenerator");
295
+ _chunk4LLLQOMFjs.__name.call(void 0, this, "HTTPGenerator");
291
296
  }
292
297
  __init6() {this.name = "HTTP"}
293
298
  __init7() {this.classMap = {}}
@@ -304,11 +309,11 @@ var HTTPGenerator = (_class5 = class extends Generator {constructor(...args4) {
304
309
  addMethod(args) {
305
310
  const { http, name, func, params, tag } = args;
306
311
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) return;
307
- const url = http.prefix + http.route.replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
312
+ const url = _chunkG7JFKM2Mjs.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
308
313
  if (!this.classMap[name]) this.classMap[name] = {};
309
314
  this.classMap[name][func] = `
310
315
  ${func}(...args){
311
- const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}",args}
316
+ const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}"}
312
317
 
313
318
  ${params.reduce((p, c, i) => `${p}ret.${c.type}${c.key ? `['${c.key}']` : ""}=args[${i}]
314
319
  ${c.type === "params" ? `ret.url=ret.url.replace('{{${c.key}}}',args[${i}])` : ""}
@@ -404,4 +409,5 @@ return ret
404
409
 
405
410
 
406
411
 
407
- exports.Addon = _chunkMBCHNDAYjs.Addon; exports.Arg = _chunkMBCHNDAYjs.Arg; exports.BadGatewayException = _chunkSW5IKE5Hjs.BadGatewayException; exports.BadRequestException = _chunkSW5IKE5Hjs.BadRequestException; exports.BaseParam = _chunkMBCHNDAYjs.BaseParam; exports.Body = _chunkMBCHNDAYjs.Body; exports.ConflictException = _chunkSW5IKE5Hjs.ConflictException; exports.Context = _chunkSW5IKE5Hjs.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 = _chunkSW5IKE5Hjs.Exception; exports.Factory = _chunkBGXSMOLXjs.Factory; exports.Filter = _chunkMBCHNDAYjs.Filter; exports.ForbiddenException = _chunkSW5IKE5Hjs.ForbiddenException; exports.FrameworkException = _chunkSW5IKE5Hjs.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 = _chunkSW5IKE5Hjs.InvalidInputException; exports.LOG_LEVEL = _chunkJ5CFUN4Vjs.LOG_LEVEL; exports.Meta = _chunkBGXSMOLXjs.Meta; exports.Mixin = _chunkJ5CFUN4Vjs.Mixin; exports.NotFoundException = _chunkSW5IKE5Hjs.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 = _chunkSW5IKE5Hjs.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 = _chunkBGXSMOLXjs.ServerPhecda; exports.ServiceUnavailableException = _chunkSW5IKE5Hjs.ServiceUnavailableException; exports.TimeoutException = _chunkSW5IKE5Hjs.TimeoutException; exports.TimerException = _chunkSW5IKE5Hjs.TimerException; exports.UnauthorizedException = _chunkSW5IKE5Hjs.UnauthorizedException; exports.UndefinedException = _chunkSW5IKE5Hjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkSW5IKE5Hjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkSW5IKE5Hjs.ValidateException; exports.WorkerException = _chunkSW5IKE5Hjs.WorkerException; exports.addAddon = _chunkSW5IKE5Hjs.addAddon; exports.addFilter = _chunkSW5IKE5Hjs.addFilter; exports.addGuard = _chunkSW5IKE5Hjs.addGuard; exports.addPipe = _chunkSW5IKE5Hjs.addPipe; exports.defaultPipe = _chunkSW5IKE5Hjs.defaultPipe; exports.defaultServerInject = _chunkBGXSMOLXjs.defaultServerInject; exports.emitter = _chunkBGXSMOLXjs.emitter; exports.getLogger = _chunkJ5CFUN4Vjs.getLogger; exports.log = _chunkJ5CFUN4Vjs.log; exports.phecdaNamespace = _chunkBGXSMOLXjs.phecdaNamespace; exports.runMiddleware = _chunkJ5CFUN4Vjs.runMiddleware; exports.setLogger = _chunkJ5CFUN4Vjs.setLogger; exports.useS = _chunkBGXSMOLXjs.useS;
412
+
413
+ exports.Addon = _chunkKCPBITYZjs.Addon; exports.Arg = _chunkKCPBITYZjs.Arg; exports.BadGatewayException = _chunkG7JFKM2Mjs.BadGatewayException; exports.BadRequestException = _chunkG7JFKM2Mjs.BadRequestException; exports.BaseParam = _chunkKCPBITYZjs.BaseParam; exports.Body = _chunkKCPBITYZjs.Body; exports.ConflictException = _chunkG7JFKM2Mjs.ConflictException; exports.Context = _chunkG7JFKM2Mjs.Context; exports.Controller = _chunkKCPBITYZjs.Controller; exports.Ctx = _chunkKCPBITYZjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkKCPBITYZjs.Define; exports.Delete = _chunkKCPBITYZjs.Delete; exports.ERROR_SYMBOL = _chunk4LLLQOMFjs.ERROR_SYMBOL; exports.Exception = _chunkG7JFKM2Mjs.Exception; exports.Factory = _chunk6OQ2SB5Wjs.Factory; exports.Filter = _chunkKCPBITYZjs.Filter; exports.ForbiddenException = _chunkG7JFKM2Mjs.ForbiddenException; exports.FrameworkException = _chunkG7JFKM2Mjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkKCPBITYZjs.Get; exports.Guard = _chunkKCPBITYZjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkKCPBITYZjs.Head; exports.Header = _chunkKCPBITYZjs.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 = _chunkG7JFKM2Mjs.InvalidInputException; exports.LOG_LEVEL = _chunk4LLLQOMFjs.LOG_LEVEL; exports.Meta = _chunk6OQ2SB5Wjs.Meta; exports.Mixin = _chunk4LLLQOMFjs.Mixin; exports.NotFoundException = _chunkG7JFKM2Mjs.NotFoundException; 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 = _chunkKCPBITYZjs.Param; exports.Patch = _chunkKCPBITYZjs.Patch; exports.PayloadLargeException = _chunkG7JFKM2Mjs.PayloadLargeException; exports.Pipe = _chunkKCPBITYZjs.Pipe; exports.Post = _chunkKCPBITYZjs.Post; exports.Put = _chunkKCPBITYZjs.Put; exports.Query = _chunkKCPBITYZjs.Query; exports.Queue = _chunkKCPBITYZjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkKCPBITYZjs.Route; exports.Rpc = _chunkKCPBITYZjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkKCPBITYZjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunk6OQ2SB5Wjs.ServerPhecda; exports.ServiceUnavailableException = _chunkG7JFKM2Mjs.ServiceUnavailableException; exports.TimeoutException = _chunkG7JFKM2Mjs.TimeoutException; exports.TimerException = _chunkG7JFKM2Mjs.TimerException; exports.UnauthorizedException = _chunkG7JFKM2Mjs.UnauthorizedException; exports.UndefinedException = _chunkG7JFKM2Mjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkG7JFKM2Mjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkG7JFKM2Mjs.ValidateException; exports.WorkerException = _chunkG7JFKM2Mjs.WorkerException; exports.addAddon = _chunkG7JFKM2Mjs.addAddon; exports.addFilter = _chunkG7JFKM2Mjs.addFilter; exports.addGuard = _chunkG7JFKM2Mjs.addGuard; exports.addPipe = _chunkG7JFKM2Mjs.addPipe; exports.defaultPipe = _chunkG7JFKM2Mjs.defaultPipe; exports.defaultServerInject = _chunk6OQ2SB5Wjs.defaultServerInject; exports.emitter = _chunk6OQ2SB5Wjs.emitter; exports.getLogger = _chunk4LLLQOMFjs.getLogger; exports.log = _chunk4LLLQOMFjs.log; exports.phecdaNamespace = _chunk6OQ2SB5Wjs.phecdaNamespace; exports.runMiddleware = _chunk4LLLQOMFjs.runMiddleware; exports.setLogger = _chunk4LLLQOMFjs.setLogger; exports.useS = _chunk6OQ2SB5Wjs.useS;
package/dist/index.mjs CHANGED
@@ -6,14 +6,14 @@ import {
6
6
  emitter,
7
7
  phecdaNamespace,
8
8
  useS
9
- } from "./chunk-5622RBNB.mjs";
9
+ } from "./chunk-YCES6ABN.mjs";
10
10
  import {
11
11
  Addon,
12
12
  Arg,
13
13
  BaseParam,
14
14
  Body,
15
15
  Controller,
16
- Ctx,
16
+ Ctx as Ctx2,
17
17
  Define,
18
18
  Delete,
19
19
  Filter,
@@ -31,7 +31,7 @@ import {
31
31
  Route,
32
32
  Rpc,
33
33
  Search
34
- } from "./chunk-HMVLXNV3.mjs";
34
+ } from "./chunk-MUI6MTUO.mjs";
35
35
  import {
36
36
  BadGatewayException,
37
37
  BadRequestException,
@@ -55,12 +55,14 @@ import {
55
55
  addFilter,
56
56
  addGuard,
57
57
  addPipe,
58
- defaultPipe
59
- } from "./chunk-P75VKZJY.mjs";
58
+ defaultPipe,
59
+ joinUrl
60
+ } from "./chunk-Z7NAAE4M.mjs";
60
61
  import {
61
62
  ERROR_SYMBOL,
62
- IS_HMR,
63
+ IS_DEV,
63
64
  IS_ONLY_GENERATE,
65
+ IS_PURE,
64
66
  IS_STRICT,
65
67
  LOG_LEVEL,
66
68
  Mixin,
@@ -70,7 +72,7 @@ import {
70
72
  log,
71
73
  runMiddleware,
72
74
  setLogger
73
- } from "./chunk-WHJ5FALK.mjs";
75
+ } from "./chunk-NQ55PA2X.mjs";
74
76
 
75
77
  // src/types.ts
76
78
  var ResponseSymbol = Symbol("response");
@@ -99,6 +101,9 @@ var ServerBase = class extends Base {
99
101
  __name(this, "ServerBase");
100
102
  }
101
103
  emitter = emitter;
104
+ log(msg, level = "log") {
105
+ log(msg, level, this.tag);
106
+ }
102
107
  };
103
108
  var HttpBase = class extends ServerBase {
104
109
  static {
@@ -107,8 +112,8 @@ var HttpBase = class extends ServerBase {
107
112
  context;
108
113
  };
109
114
  _ts_decorate([
110
- Ctx,
111
- _ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
115
+ Ctx2,
116
+ _ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
112
117
  ], HttpBase.prototype, "context", void 0);
113
118
  var RpcBase = class extends ServerBase {
114
119
  static {
@@ -117,8 +122,8 @@ var RpcBase = class extends ServerBase {
117
122
  context;
118
123
  };
119
124
  _ts_decorate([
120
- Ctx,
121
- _ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
125
+ Ctx2,
126
+ _ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
122
127
  ], RpcBase.prototype, "context", void 0);
123
128
 
124
129
  // src/modules/filter.ts
@@ -304,11 +309,11 @@ var HTTPGenerator = class extends Generator {
304
309
  addMethod(args) {
305
310
  const { http, name, func, params, tag } = args;
306
311
  if (!http?.type) return;
307
- const url = http.prefix + http.route.replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
312
+ const url = joinUrl(http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
308
313
  if (!this.classMap[name]) this.classMap[name] = {};
309
314
  this.classMap[name][func] = `
310
315
  ${func}(...args){
311
- const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}",args}
316
+ const ret={tag:"${tag}",func:"${func}",body:{},headers:{},query:{},params:{},method:"${http.type}",url:"${url}"}
312
317
 
313
318
  ${params.reduce((p, c, i) => `${p}ret.${c.type}${c.key ? `['${c.key}']` : ""}=args[${i}]
314
319
  ${c.type === "params" ? `ret.url=ret.url.replace('{{${c.key}}}',args[${i}])` : ""}
@@ -337,7 +342,7 @@ export {
337
342
  ConflictException,
338
343
  Context,
339
344
  Controller,
340
- Ctx,
345
+ Ctx2 as Ctx,
341
346
  CustomResponse,
342
347
  Define,
343
348
  Delete,
@@ -354,8 +359,9 @@ export {
354
359
  Head,
355
360
  Header,
356
361
  HttpBase,
357
- IS_HMR,
362
+ IS_DEV,
358
363
  IS_ONLY_GENERATE,
364
+ IS_PURE,
359
365
  IS_STRICT,
360
366
  InvalidInputException,
361
367
  LOG_LEVEL,
@@ -1,13 +1,14 @@
1
1
  import { Events, Construct } from 'phecda-core';
2
2
 
3
3
  declare const ERROR_SYMBOL = "__PS_ERROR__";
4
- declare const IS_HMR: boolean;
4
+ declare const IS_DEV: boolean;
5
5
  declare const IS_ONLY_GENERATE: boolean;
6
6
  declare const IS_STRICT: boolean;
7
+ declare const IS_PURE: boolean;
7
8
  declare const LOG_LEVEL: number;
8
9
  declare enum PS_EXIT_CODE {
9
- RELAUNCH = 2,
10
- CODE = 4
10
+ RELAUNCH = 4171,
11
+ EXIT = 4172
11
12
  }
12
13
 
13
14
  interface Emitter {
@@ -31,12 +32,13 @@ type ToClientInstance<Instance extends Record<string, any>> = ParseInstance<Pick
31
32
  type ToClientFn<Func extends AnyFunction> = (...p: Parameters<Func>) => Promise<BaseReturn<ReturnType<Func>>>;
32
33
  type PickFunc<Instance> = Pick<Instance, PickFuncKeys<Instance>>;
33
34
  type OmitFunction<Instance> = Omit<Instance, PickFuncKeys<Instance>>;
34
- interface BaseContext {
35
+ interface BaseCtx {
35
36
  meta: ControllerMeta;
36
37
  moduleMap: Record<string, any>;
37
38
  type: string;
38
39
  tag: string;
39
40
  func: string;
41
+ category: string;
40
42
  [key: string]: any;
41
43
  }
42
44
  interface DefaultOptions {
@@ -103,4 +105,4 @@ interface ControllerMeta extends Meta {
103
105
  data: ControllerMetaData;
104
106
  }
105
107
 
106
- export { type BaseContext as B, type ControllerMetaData as C, type DefaultOptions as D, type Emitter as E, IS_HMR as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMeta as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, PS_EXIT_CODE as m };
108
+ export { type BaseCtx as B, type ControllerMeta as C, type DefaultOptions as D, type Emitter as E, IS_DEV as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMetaData as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, IS_PURE as m, PS_EXIT_CODE as n };
@@ -1,13 +1,14 @@
1
1
  import { Events, Construct } from 'phecda-core';
2
2
 
3
3
  declare const ERROR_SYMBOL = "__PS_ERROR__";
4
- declare const IS_HMR: boolean;
4
+ declare const IS_DEV: boolean;
5
5
  declare const IS_ONLY_GENERATE: boolean;
6
6
  declare const IS_STRICT: boolean;
7
+ declare const IS_PURE: boolean;
7
8
  declare const LOG_LEVEL: number;
8
9
  declare enum PS_EXIT_CODE {
9
- RELAUNCH = 2,
10
- CODE = 4
10
+ RELAUNCH = 4171,
11
+ EXIT = 4172
11
12
  }
12
13
 
13
14
  interface Emitter {
@@ -31,12 +32,13 @@ type ToClientInstance<Instance extends Record<string, any>> = ParseInstance<Pick
31
32
  type ToClientFn<Func extends AnyFunction> = (...p: Parameters<Func>) => Promise<BaseReturn<ReturnType<Func>>>;
32
33
  type PickFunc<Instance> = Pick<Instance, PickFuncKeys<Instance>>;
33
34
  type OmitFunction<Instance> = Omit<Instance, PickFuncKeys<Instance>>;
34
- interface BaseContext {
35
+ interface BaseCtx {
35
36
  meta: ControllerMeta;
36
37
  moduleMap: Record<string, any>;
37
38
  type: string;
38
39
  tag: string;
39
40
  func: string;
41
+ category: string;
40
42
  [key: string]: any;
41
43
  }
42
44
  interface DefaultOptions {
@@ -103,4 +105,4 @@ interface ControllerMeta extends Meta {
103
105
  data: ControllerMetaData;
104
106
  }
105
107
 
106
- export { type BaseContext as B, type ControllerMetaData as C, type DefaultOptions as D, type Emitter as E, IS_HMR as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMeta as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, PS_EXIT_CODE as m };
108
+ export { type BaseCtx as B, type ControllerMeta as C, type DefaultOptions as D, type Emitter as E, IS_DEV as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMetaData as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, IS_PURE as m, PS_EXIT_CODE as n };
@@ -1,10 +1,10 @@
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-DIfgUKIU.mjs';
3
+ import { R as RpcCtx, a as RpcServerOptions, b as RpcClientOptions } from '../../types-DqH1qA-q.mjs';
4
+ import { T as ToClientMap } from '../../meta-CR-D39hQ.mjs';
5
5
  import 'phecda-core';
6
6
 
7
- interface BullmqCtx extends RpcContext {
7
+ interface BullmqCtx extends RpcCtx {
8
8
  type: 'bullmq';
9
9
  }
10
10
  type BullmqOptions = Omit<RpcServerOptions, 'globalAddons'> & {
@@ -13,7 +13,7 @@ type BullmqOptions = Omit<RpcServerOptions, 'globalAddons'> & {
13
13
  };
14
14
  declare function create({ moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts?: BullmqOptions): Promise<{
15
15
  workerMap: Record<string, Worker<any, any, string>>;
16
- queueMap: Record<string, Queue<any, any, string>>;
16
+ queueMap: Record<string, Queue<any, any, string, any, any, string>>;
17
17
  }>;
18
18
 
19
19
  declare function createClient<S extends Record<string, any>>(controllers: S, opts?: RpcClientOptions & BullmqOptions): Promise<ToClientMap<S>>;
@@ -1,10 +1,10 @@
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-CUTbX_IS.js';
3
+ import { R as RpcCtx, a as RpcServerOptions, b as RpcClientOptions } from '../../types-DYRu0vic.js';
4
+ import { T as ToClientMap } from '../../meta-CR-D39hQ.js';
5
5
  import 'phecda-core';
6
6
 
7
- interface BullmqCtx extends RpcContext {
7
+ interface BullmqCtx extends RpcCtx {
8
8
  type: 'bullmq';
9
9
  }
10
10
  type BullmqOptions = Omit<RpcServerOptions, 'globalAddons'> & {
@@ -13,7 +13,7 @@ type BullmqOptions = Omit<RpcServerOptions, 'globalAddons'> & {
13
13
  };
14
14
  declare function create({ moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts?: BullmqOptions): Promise<{
15
15
  workerMap: Record<string, Worker<any, any, string>>;
16
- queueMap: Record<string, Queue<any, any, string>>;
16
+ queueMap: Record<string, Queue<any, any, string, any, any, string>>;
17
17
  }>;
18
18
 
19
19
  declare function createClient<S extends Record<string, any>>(controllers: S, opts?: RpcClientOptions & BullmqOptions): Promise<ToClientMap<S>>;
@@ -3,11 +3,11 @@
3
3
 
4
4
 
5
5
 
6
+ var _chunkG7JFKM2Mjs = require('../../chunk-G7JFKM2M.js');
6
7
 
7
- var _chunkSW5IKE5Hjs = require('../../chunk-SW5IKE5H.js');
8
8
 
9
9
 
10
- var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
10
+ var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
11
11
 
12
12
  // src/rpc/bullmq/create.ts
13
13
  var _bullmq = require('bullmq');
@@ -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 = _chunkSW5IKE5Hjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkG7JFKM2Mjs.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
- _chunkSW5IKE5Hjs.detectAopDep.call(void 0, meta, {
28
+ _chunkG7JFKM2Mjs.detectAopDep.call(void 0, meta, {
29
29
  guards: globalGuards
30
30
  }, "rpc");
31
31
  async function subscribeQueues() {
@@ -39,12 +39,12 @@ 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
- _chunkSW5IKE5Hjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
42
+ _chunkG7JFKM2Mjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
43
43
  }
44
44
  }
45
45
  }
46
46
  }
47
- _chunkJ5CFUN4Vjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
47
+ _chunk4LLLQOMFjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
48
48
  async function handleRequest(job) {
49
49
  const { data } = job;
50
50
  const { tag, func, args, id, queue: clientQueue, _ps } = data;
@@ -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 = _chunkSW5IKE5Hjs.Context.getAop(meta2, {
56
+ const aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
57
57
  globalFilter,
58
58
  globalGuards,
59
59
  globalPipe
60
60
  });
61
- const context = new (0, _chunkSW5IKE5Hjs.Context)({
61
+ const context = new (0, _chunkG7JFKM2Mjs.Context)({
62
62
  type: "bullmq",
63
+ category: "rpc",
63
64
  moduleMap,
64
65
  meta: meta2,
65
66
  tag,
@@ -85,9 +86,9 @@ async function create({ moduleMap, meta }, opts = {}) {
85
86
  }
86
87
  });
87
88
  }
88
- _chunkJ5CFUN4Vjs.__name.call(void 0, handleRequest, "handleRequest");
89
+ _chunk4LLLQOMFjs.__name.call(void 0, handleRequest, "handleRequest");
89
90
  subscribeQueues();
90
- _chunkSW5IKE5Hjs.HMR.call(void 0, async () => {
91
+ _chunk4LLLQOMFjs.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();
@@ -97,7 +98,7 @@ async function create({ moduleMap, meta }, opts = {}) {
97
98
  queueMap
98
99
  };
99
100
  }
100
- _chunkJ5CFUN4Vjs.__name.call(void 0, create, "create");
101
+ _chunk4LLLQOMFjs.__name.call(void 0, create, "create");
101
102
 
102
103
  // src/rpc/bullmq/client.ts
103
104
  var _events = require('events');
@@ -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 = _chunkSW5IKE5Hjs.genClientQueue.call(void 0, key);
112
+ const clientQueue = _chunkG7JFKM2Mjs.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;
@@ -153,7 +154,7 @@ async function createClient(controllers, opts = {}) {
153
154
  if (error) reject(data);
154
155
  else resolve(data);
155
156
  }
156
- _chunkJ5CFUN4Vjs.__name.call(void 0, listener, "listener");
157
+ _chunk4LLLQOMFjs.__name.call(void 0, listener, "listener");
157
158
  eventCount++;
158
159
  emitter.once(id, listener);
159
160
  });
@@ -163,7 +164,7 @@ async function createClient(controllers, opts = {}) {
163
164
  }
164
165
  return ret;
165
166
  }
166
- _chunkJ5CFUN4Vjs.__name.call(void 0, createClient, "createClient");
167
+ _chunk4LLLQOMFjs.__name.call(void 0, createClient, "createClient");
167
168
 
168
169
 
169
170
 
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Context,
3
- HMR,
4
3
  createControllerMetaMap,
5
4
  detectAopDep,
6
5
  genClientQueue
7
- } from "../../chunk-P75VKZJY.mjs";
6
+ } from "../../chunk-Z7NAAE4M.mjs";
8
7
  import {
8
+ HMR,
9
9
  __name
10
- } from "../../chunk-WHJ5FALK.mjs";
10
+ } from "../../chunk-NQ55PA2X.mjs";
11
11
 
12
12
  // src/rpc/bullmq/create.ts
13
13
  import { Queue, Worker } from "bullmq";
@@ -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,