phecda-server 5.3.1 → 5.3.3

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 (41) hide show
  1. package/dist/{chunk-ODUYOCDF.js → chunk-2HVTWYS2.js} +37 -37
  2. package/dist/{chunk-N4ULJDEQ.js → chunk-3D7AROG2.js} +36 -25
  3. package/dist/{chunk-BZKJ5NBU.mjs → chunk-3IPYLGY2.mjs} +1 -1
  4. package/dist/{chunk-LHLQIQPH.mjs → chunk-ECSI4QBK.mjs} +18 -7
  5. package/dist/{chunk-RVWBJ6LV.js → chunk-GHFSIZUO.js} +2 -10
  6. package/dist/{chunk-QYX5Q7KO.js → chunk-RZ7IXJYQ.js} +60 -60
  7. package/dist/{chunk-ORQAEOSE.mjs → chunk-SXOZVIKW.mjs} +2 -2
  8. package/dist/{chunk-MESZCLSS.mjs → chunk-UXD62LGG.mjs} +2 -10
  9. package/dist/helper.js +3 -3
  10. package/dist/helper.mjs +2 -2
  11. package/dist/index.d.mts +3 -3
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +43 -43
  14. package/dist/index.mjs +6 -6
  15. package/dist/rpc/bullmq/index.js +12 -12
  16. package/dist/rpc/bullmq/index.mjs +2 -2
  17. package/dist/rpc/kafka/index.js +12 -12
  18. package/dist/rpc/kafka/index.mjs +2 -2
  19. package/dist/rpc/nats/index.js +11 -11
  20. package/dist/rpc/nats/index.mjs +2 -2
  21. package/dist/rpc/rabbitmq/index.js +13 -13
  22. package/dist/rpc/rabbitmq/index.mjs +2 -2
  23. package/dist/rpc/redis/index.js +11 -11
  24. package/dist/rpc/redis/index.mjs +2 -2
  25. package/dist/server/elysia/index.js +32 -32
  26. package/dist/server/elysia/index.mjs +3 -3
  27. package/dist/server/express/index.js +30 -30
  28. package/dist/server/express/index.mjs +2 -2
  29. package/dist/server/fastify/index.js +31 -31
  30. package/dist/server/fastify/index.mjs +3 -3
  31. package/dist/server/h3/index.js +30 -30
  32. package/dist/server/h3/index.mjs +2 -2
  33. package/dist/server/hono/index.js +29 -29
  34. package/dist/server/hono/index.mjs +2 -2
  35. package/dist/server/hyper-express/index.js +29 -29
  36. package/dist/server/hyper-express/index.mjs +2 -2
  37. package/dist/server/koa/index.js +30 -30
  38. package/dist/server/koa/index.mjs +2 -2
  39. package/dist/test.js +6 -6
  40. package/dist/test.mjs +2 -2
  41. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkN4ULJDEQjs = require('./chunk-N4ULJDEQ.js');
6
+ var _chunk3D7AROG2js = require('./chunk-3D7AROG2.js');
7
7
 
8
8
 
9
9
 
@@ -29,7 +29,7 @@ var _chunkN4ULJDEQjs = require('./chunk-N4ULJDEQ.js');
29
29
 
30
30
 
31
31
 
32
- var _chunkODUYOCDFjs = require('./chunk-ODUYOCDF.js');
32
+ var _chunk2HVTWYS2js = require('./chunk-2HVTWYS2.js');
33
33
 
34
34
 
35
35
 
@@ -55,7 +55,7 @@ var _chunkODUYOCDFjs = require('./chunk-ODUYOCDF.js');
55
55
 
56
56
 
57
57
 
58
- var _chunkQYX5Q7KOjs = require('./chunk-QYX5Q7KO.js');
58
+ var _chunkRZ7IXJYQjs = require('./chunk-RZ7IXJYQ.js');
59
59
 
60
60
 
61
61
 
@@ -67,13 +67,13 @@ var _chunkQYX5Q7KOjs = require('./chunk-QYX5Q7KO.js');
67
67
 
68
68
 
69
69
 
70
- var _chunkRVWBJ6LVjs = require('./chunk-RVWBJ6LV.js');
70
+ var _chunkGHFSIZUOjs = require('./chunk-GHFSIZUO.js');
71
71
 
72
72
  // src/types.ts
73
73
  var ResponseSymbol = Symbol("response");
74
74
  var CustomResponse = class {
75
75
  static {
76
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "CustomResponse");
76
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "CustomResponse");
77
77
  }
78
78
 
79
79
  };
@@ -86,35 +86,35 @@ function _ts_decorate(decorators, target, key, desc) {
86
86
  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;
87
87
  return c > 3 && r && Object.defineProperty(target, key, r), r;
88
88
  }
89
- _chunkRVWBJ6LVjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
89
+ _chunkGHFSIZUOjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
90
90
  function _ts_metadata(k, v) {
91
91
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
92
92
  }
93
- _chunkRVWBJ6LVjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
93
+ _chunkGHFSIZUOjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
94
94
  var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
95
95
  static {
96
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "ServerBase");
96
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "ServerBase");
97
97
  }
98
- __init() {this.emitter = exports.emitter = _chunkN4ULJDEQjs.emitter}
98
+ __init() {this.emitter = exports.emitter = _chunk3D7AROG2js.emitter}
99
99
  }, _class);
100
100
  var HttpBase = class extends ServerBase {
101
101
  static {
102
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "HttpBase");
102
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "HttpBase");
103
103
  }
104
104
 
105
105
  };
106
106
  _ts_decorate([
107
- _chunkODUYOCDFjs.Ctx,
107
+ _chunk2HVTWYS2js.Ctx,
108
108
  _ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
109
109
  ], HttpBase.prototype, "context", void 0);
110
110
  var RpcBase = class extends ServerBase {
111
111
  static {
112
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "RpcBase");
112
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "RpcBase");
113
113
  }
114
114
 
115
115
  };
116
116
  _ts_decorate([
117
- _chunkODUYOCDFjs.Ctx,
117
+ _chunk2HVTWYS2js.Ctx,
118
118
  _ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
119
119
  ], RpcBase.prototype, "context", void 0);
120
120
 
@@ -122,15 +122,15 @@ _ts_decorate([
122
122
 
123
123
  var PFilter = class extends ServerBase {
124
124
  static {
125
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PFilter");
125
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PFilter");
126
126
  }
127
127
 
128
128
  constructor(tag) {
129
129
  super();
130
130
  this.key = tag || _phecdacore.getTag.call(void 0, this);
131
- _chunkQYX5Q7KOjs.addFilter.call(void 0, this.key, this.use.bind(this));
131
+ _chunkRZ7IXJYQjs.addFilter.call(void 0, this.key, this.use.bind(this));
132
132
  this.onUnmount(() => {
133
- delete _chunkQYX5Q7KOjs.Context.filterRecord[this.key];
133
+ delete _chunkRZ7IXJYQjs.Context.filterRecord[this.key];
134
134
  });
135
135
  }
136
136
  };
@@ -139,15 +139,15 @@ var PFilter = class extends ServerBase {
139
139
 
140
140
  var PGuard = class extends ServerBase {
141
141
  static {
142
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PGuard");
142
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PGuard");
143
143
  }
144
144
 
145
145
  constructor(tag) {
146
146
  super();
147
147
  this.key = tag || _phecdacore.getTag.call(void 0, this);
148
- _chunkQYX5Q7KOjs.addGuard.call(void 0, this.key, this.use.bind(this));
148
+ _chunkRZ7IXJYQjs.addGuard.call(void 0, this.key, this.use.bind(this));
149
149
  this.onUnmount(() => {
150
- delete _chunkQYX5Q7KOjs.Context.guardRecord[this.key];
150
+ delete _chunkRZ7IXJYQjs.Context.guardRecord[this.key];
151
151
  });
152
152
  }
153
153
  };
@@ -156,16 +156,16 @@ var PGuard = class extends ServerBase {
156
156
 
157
157
  var PInterceptor = class extends ServerBase {
158
158
  static {
159
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PInterceptor");
159
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PInterceptor");
160
160
  }
161
161
 
162
162
  constructor(tag) {
163
163
  super();
164
164
  this.key = tag || _phecdacore.getTag.call(void 0, this);
165
165
  this.onUnmount(() => {
166
- delete _chunkQYX5Q7KOjs.Context.interceptorRecord[this.key];
166
+ delete _chunkRZ7IXJYQjs.Context.interceptorRecord[this.key];
167
167
  });
168
- _chunkQYX5Q7KOjs.addInterceptor.call(void 0, this.key, this.use.bind(this));
168
+ _chunkRZ7IXJYQjs.addInterceptor.call(void 0, this.key, this.use.bind(this));
169
169
  }
170
170
  };
171
171
 
@@ -173,15 +173,15 @@ var PInterceptor = class extends ServerBase {
173
173
 
174
174
  var PPipe = class extends ServerBase {
175
175
  static {
176
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PPipe");
176
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PPipe");
177
177
  }
178
178
 
179
179
  constructor(tag) {
180
180
  super();
181
181
  this.key = tag || _phecdacore.getTag.call(void 0, this);
182
- _chunkQYX5Q7KOjs.addPipe.call(void 0, this.key, this.use.bind(this));
182
+ _chunkRZ7IXJYQjs.addPipe.call(void 0, this.key, this.use.bind(this));
183
183
  this.onUnmount(() => {
184
- delete _chunkQYX5Q7KOjs.Context.pipeRecord[this.key];
184
+ delete _chunkRZ7IXJYQjs.Context.pipeRecord[this.key];
185
185
  });
186
186
  }
187
187
  };
@@ -190,15 +190,15 @@ var PPipe = class extends ServerBase {
190
190
 
191
191
  var PPlugin = class extends ServerBase {
192
192
  static {
193
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PPlugin");
193
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PPlugin");
194
194
  }
195
195
 
196
196
  constructor(tag) {
197
197
  super();
198
198
  this.key = tag || _phecdacore.getTag.call(void 0, this);
199
- _chunkQYX5Q7KOjs.addPlugin.call(void 0, this.key, this.use.bind(this));
199
+ _chunkRZ7IXJYQjs.addPlugin.call(void 0, this.key, this.use.bind(this));
200
200
  this.onUnmount(() => {
201
- delete _chunkQYX5Q7KOjs.Context.pluginRecord[this.key];
201
+ delete _chunkRZ7IXJYQjs.Context.pluginRecord[this.key];
202
202
  });
203
203
  }
204
204
  };
@@ -207,40 +207,40 @@ var PPlugin = class extends ServerBase {
207
207
 
208
208
  var PExtension = class extends ServerBase {
209
209
  static {
210
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PExtension");
210
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PExtension");
211
211
  }
212
212
 
213
213
  constructor(tag) {
214
214
  super();
215
215
  const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
216
216
  if (this.pipe) {
217
- _chunkQYX5Q7KOjs.addPipe.call(void 0, key, this.pipe.bind(this));
217
+ _chunkRZ7IXJYQjs.addPipe.call(void 0, key, this.pipe.bind(this));
218
218
  this.onUnmount(() => {
219
- delete _chunkQYX5Q7KOjs.Context.pipeRecord[key];
219
+ delete _chunkRZ7IXJYQjs.Context.pipeRecord[key];
220
220
  });
221
221
  }
222
222
  if (this.plugin) {
223
- _chunkQYX5Q7KOjs.addPlugin.call(void 0, key, this.plugin.bind(this));
223
+ _chunkRZ7IXJYQjs.addPlugin.call(void 0, key, this.plugin.bind(this));
224
224
  this.onUnmount(() => {
225
- delete _chunkQYX5Q7KOjs.Context.pluginRecord[key];
225
+ delete _chunkRZ7IXJYQjs.Context.pluginRecord[key];
226
226
  });
227
227
  }
228
228
  if (this.intercept) {
229
- _chunkQYX5Q7KOjs.addInterceptor.call(void 0, key, this.intercept.bind(this));
229
+ _chunkRZ7IXJYQjs.addInterceptor.call(void 0, key, this.intercept.bind(this));
230
230
  this.onUnmount(() => {
231
- delete _chunkQYX5Q7KOjs.Context.interceptorRecord[key];
231
+ delete _chunkRZ7IXJYQjs.Context.interceptorRecord[key];
232
232
  });
233
233
  }
234
234
  if (this.guard) {
235
- _chunkQYX5Q7KOjs.addGuard.call(void 0, key, this.guard.bind(this));
235
+ _chunkRZ7IXJYQjs.addGuard.call(void 0, key, this.guard.bind(this));
236
236
  this.onUnmount(() => {
237
- delete _chunkQYX5Q7KOjs.Context.guardRecord[key];
237
+ delete _chunkRZ7IXJYQjs.Context.guardRecord[key];
238
238
  });
239
239
  }
240
240
  if (this.filter) {
241
- _chunkQYX5Q7KOjs.addFilter.call(void 0, key, this.filter.bind(this));
241
+ _chunkRZ7IXJYQjs.addFilter.call(void 0, key, this.filter.bind(this));
242
242
  this.onUnmount(() => {
243
- delete _chunkQYX5Q7KOjs.Context.filterRecord[key];
243
+ delete _chunkRZ7IXJYQjs.Context.filterRecord[key];
244
244
  });
245
245
  }
246
246
  }
@@ -250,7 +250,7 @@ var PExtension = class extends ServerBase {
250
250
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
251
251
  var Generator = class {
252
252
  static {
253
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "Generator");
253
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "Generator");
254
254
  }
255
255
 
256
256
  constructor(path) {
@@ -267,7 +267,7 @@ var Generator = class {
267
267
  // src/generator/rpc.ts
268
268
  var RPCGenerator = (_class2 = class extends Generator {constructor(...args3) { super(...args3); _class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this); }
269
269
  static {
270
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "RPCGenerator");
270
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "RPCGenerator");
271
271
  }
272
272
  __init2() {this.name = "RPC"}
273
273
  __init3() {this.classMap = {}}
@@ -303,7 +303,7 @@ var RPCGenerator = (_class2 = class extends Generator {constructor(...args3) { s
303
303
  // src/generator/http.ts
304
304
  var HTTPGenerator = (_class3 = class extends Generator {constructor(...args4) { super(...args4); _class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this); }
305
305
  static {
306
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "HTTPGenerator");
306
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "HTTPGenerator");
307
307
  }
308
308
  __init4() {this.name = "HTTP"}
309
309
  __init5() {this.classMap = {}}
@@ -418,4 +418,4 @@ return ret
418
418
 
419
419
 
420
420
 
421
- exports.Arg = _chunkODUYOCDFjs.Arg; exports.BadGatewayException = _chunkQYX5Q7KOjs.BadGatewayException; exports.BadRequestException = _chunkQYX5Q7KOjs.BadRequestException; exports.BaseParam = _chunkODUYOCDFjs.BaseParam; exports.Body = _chunkODUYOCDFjs.Body; exports.ConflictException = _chunkQYX5Q7KOjs.ConflictException; exports.Context = _chunkQYX5Q7KOjs.Context; exports.Controller = _chunkODUYOCDFjs.Controller; exports.Ctx = _chunkODUYOCDFjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkODUYOCDFjs.Define; exports.Delete = _chunkODUYOCDFjs.Delete; exports.ERROR_SYMBOL = _chunkRVWBJ6LVjs.ERROR_SYMBOL; exports.Event = _chunkODUYOCDFjs.Event; exports.Exception = _chunkQYX5Q7KOjs.Exception; exports.Factory = _chunkN4ULJDEQjs.Factory; exports.Filter = _chunkODUYOCDFjs.Filter; exports.ForbiddenException = _chunkQYX5Q7KOjs.ForbiddenException; exports.FrameworkException = _chunkQYX5Q7KOjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkODUYOCDFjs.Get; exports.Guard = _chunkODUYOCDFjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkODUYOCDFjs.Head; exports.Header = _chunkODUYOCDFjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkRVWBJ6LVjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkRVWBJ6LVjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkRVWBJ6LVjs.IS_STRICT; exports.Interceptor = _chunkODUYOCDFjs.Interceptor; exports.InvalidInputException = _chunkQYX5Q7KOjs.InvalidInputException; exports.LOG_LEVEL = _chunkRVWBJ6LVjs.LOG_LEVEL; exports.Meta = _chunkN4ULJDEQjs.Meta; exports.Mix = _chunkRVWBJ6LVjs.Mix; exports.NotFoundException = _chunkQYX5Q7KOjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkRVWBJ6LVjs.PS_EXIT_CODE; exports.Param = _chunkODUYOCDFjs.Param; exports.Patch = _chunkODUYOCDFjs.Patch; exports.PayloadLargeException = _chunkQYX5Q7KOjs.PayloadLargeException; exports.Pipe = _chunkODUYOCDFjs.Pipe; exports.Plugin = _chunkODUYOCDFjs.Plugin; exports.Post = _chunkODUYOCDFjs.Post; exports.Put = _chunkODUYOCDFjs.Put; exports.Query = _chunkODUYOCDFjs.Query; exports.Queue = _chunkODUYOCDFjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkODUYOCDFjs.Route; exports.Rpc = _chunkODUYOCDFjs.Rpc; exports.RpcBase = RpcBase; exports.ServerBase = ServerBase; exports.ServiceUnavailableException = _chunkQYX5Q7KOjs.ServiceUnavailableException; exports.TimeoutException = _chunkQYX5Q7KOjs.TimeoutException; exports.TimerException = _chunkQYX5Q7KOjs.TimerException; exports.UnauthorizedException = _chunkQYX5Q7KOjs.UnauthorizedException; exports.UndefinedException = _chunkQYX5Q7KOjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkQYX5Q7KOjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkQYX5Q7KOjs.ValidateException; exports.WorkerException = _chunkQYX5Q7KOjs.WorkerException; exports.addFilter = _chunkQYX5Q7KOjs.addFilter; exports.addGuard = _chunkQYX5Q7KOjs.addGuard; exports.addInterceptor = _chunkQYX5Q7KOjs.addInterceptor; exports.addPipe = _chunkQYX5Q7KOjs.addPipe; exports.addPlugin = _chunkQYX5Q7KOjs.addPlugin; exports.createPhecda = _chunkN4ULJDEQjs.createPhecda; exports.defaultPipe = _chunkQYX5Q7KOjs.defaultPipe; exports.emitter = _chunkN4ULJDEQjs.emitter; exports.log = _chunkRVWBJ6LVjs.log; exports.setLogger = _chunkRVWBJ6LVjs.setLogger;
421
+ exports.Arg = _chunk2HVTWYS2js.Arg; exports.BadGatewayException = _chunkRZ7IXJYQjs.BadGatewayException; exports.BadRequestException = _chunkRZ7IXJYQjs.BadRequestException; exports.BaseParam = _chunk2HVTWYS2js.BaseParam; exports.Body = _chunk2HVTWYS2js.Body; exports.ConflictException = _chunkRZ7IXJYQjs.ConflictException; exports.Context = _chunkRZ7IXJYQjs.Context; exports.Controller = _chunk2HVTWYS2js.Controller; exports.Ctx = _chunk2HVTWYS2js.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunk2HVTWYS2js.Define; exports.Delete = _chunk2HVTWYS2js.Delete; exports.ERROR_SYMBOL = _chunkGHFSIZUOjs.ERROR_SYMBOL; exports.Event = _chunk2HVTWYS2js.Event; exports.Exception = _chunkRZ7IXJYQjs.Exception; exports.Factory = _chunk3D7AROG2js.Factory; exports.Filter = _chunk2HVTWYS2js.Filter; exports.ForbiddenException = _chunkRZ7IXJYQjs.ForbiddenException; exports.FrameworkException = _chunkRZ7IXJYQjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunk2HVTWYS2js.Get; exports.Guard = _chunk2HVTWYS2js.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunk2HVTWYS2js.Head; exports.Header = _chunk2HVTWYS2js.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkGHFSIZUOjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkGHFSIZUOjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkGHFSIZUOjs.IS_STRICT; exports.Interceptor = _chunk2HVTWYS2js.Interceptor; exports.InvalidInputException = _chunkRZ7IXJYQjs.InvalidInputException; exports.LOG_LEVEL = _chunkGHFSIZUOjs.LOG_LEVEL; exports.Meta = _chunk3D7AROG2js.Meta; exports.Mixin = _chunkGHFSIZUOjs.Mixin; exports.NotFoundException = _chunkRZ7IXJYQjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkGHFSIZUOjs.PS_EXIT_CODE; exports.Param = _chunk2HVTWYS2js.Param; exports.Patch = _chunk2HVTWYS2js.Patch; exports.PayloadLargeException = _chunkRZ7IXJYQjs.PayloadLargeException; exports.Pipe = _chunk2HVTWYS2js.Pipe; exports.Plugin = _chunk2HVTWYS2js.Plugin; exports.Post = _chunk2HVTWYS2js.Post; exports.Put = _chunk2HVTWYS2js.Put; exports.Query = _chunk2HVTWYS2js.Query; exports.Queue = _chunk2HVTWYS2js.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunk2HVTWYS2js.Route; exports.Rpc = _chunk2HVTWYS2js.Rpc; exports.RpcBase = RpcBase; exports.ServerBase = ServerBase; exports.ServiceUnavailableException = _chunkRZ7IXJYQjs.ServiceUnavailableException; exports.TimeoutException = _chunkRZ7IXJYQjs.TimeoutException; exports.TimerException = _chunkRZ7IXJYQjs.TimerException; exports.UnauthorizedException = _chunkRZ7IXJYQjs.UnauthorizedException; exports.UndefinedException = _chunkRZ7IXJYQjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkRZ7IXJYQjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkRZ7IXJYQjs.ValidateException; exports.WorkerException = _chunkRZ7IXJYQjs.WorkerException; exports.addFilter = _chunkRZ7IXJYQjs.addFilter; exports.addGuard = _chunkRZ7IXJYQjs.addGuard; exports.addInterceptor = _chunkRZ7IXJYQjs.addInterceptor; exports.addPipe = _chunkRZ7IXJYQjs.addPipe; exports.addPlugin = _chunkRZ7IXJYQjs.addPlugin; exports.createPhecda = _chunk3D7AROG2js.createPhecda; exports.defaultPipe = _chunkRZ7IXJYQjs.defaultPipe; exports.emitter = _chunk3D7AROG2js.emitter; exports.log = _chunkGHFSIZUOjs.log; exports.setLogger = _chunkGHFSIZUOjs.setLogger;
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Meta,
4
4
  createPhecda,
5
5
  emitter
6
- } from "./chunk-LHLQIQPH.mjs";
6
+ } from "./chunk-ECSI4QBK.mjs";
7
7
  import {
8
8
  Arg,
9
9
  BaseParam,
@@ -29,7 +29,7 @@ import {
29
29
  Queue,
30
30
  Route,
31
31
  Rpc
32
- } from "./chunk-ORQAEOSE.mjs";
32
+ } from "./chunk-SXOZVIKW.mjs";
33
33
  import {
34
34
  BadGatewayException,
35
35
  BadRequestException,
@@ -55,19 +55,19 @@ import {
55
55
  addPipe,
56
56
  addPlugin,
57
57
  defaultPipe
58
- } from "./chunk-BZKJ5NBU.mjs";
58
+ } from "./chunk-3IPYLGY2.mjs";
59
59
  import {
60
60
  ERROR_SYMBOL,
61
61
  IS_HMR,
62
62
  IS_ONLY_GENERATE,
63
63
  IS_STRICT,
64
64
  LOG_LEVEL,
65
- Mix,
65
+ Mixin,
66
66
  PS_EXIT_CODE,
67
67
  __name,
68
68
  log,
69
69
  setLogger
70
- } from "./chunk-MESZCLSS.mjs";
70
+ } from "./chunk-UXD62LGG.mjs";
71
71
 
72
72
  // src/types.ts
73
73
  var ResponseSymbol = Symbol("response");
@@ -377,7 +377,7 @@ export {
377
377
  InvalidInputException,
378
378
  LOG_LEVEL,
379
379
  Meta,
380
- Mix,
380
+ Mixin,
381
381
  NotFoundException,
382
382
  PExtension,
383
383
  PFilter,
@@ -4,10 +4,10 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkQYX5Q7KOjs = require('../../chunk-QYX5Q7KO.js');
7
+ var _chunkRZ7IXJYQjs = require('../../chunk-RZ7IXJYQ.js');
8
8
 
9
9
 
10
- var _chunkRVWBJ6LVjs = require('../../chunk-RVWBJ6LV.js');
10
+ var _chunkGHFSIZUOjs = require('../../chunk-GHFSIZUO.js');
11
11
 
12
12
  // src/rpc/bullmq/bind.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 = _chunkQYX5Q7KOjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkRZ7IXJYQjs.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
- _chunkQYX5Q7KOjs.detectAopDep.call(void 0, meta, {
28
+ _chunkRZ7IXJYQjs.detectAopDep.call(void 0, meta, {
29
29
  guards: globalGuards,
30
30
  interceptors: globalInterceptors
31
31
  }, "rpc");
@@ -44,7 +44,7 @@ async function create({ moduleMap, meta }, opts = {}) {
44
44
  }
45
45
  }
46
46
  }
47
- _chunkRVWBJ6LVjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
47
+ _chunkGHFSIZUOjs.__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,7 +53,7 @@ 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 context = new (0, _chunkQYX5Q7KOjs.Context)({
56
+ const context = new (0, _chunkRZ7IXJYQjs.Context)({
57
57
  type: "bullmq",
58
58
  moduleMap,
59
59
  meta: meta2,
@@ -85,9 +85,9 @@ async function create({ moduleMap, meta }, opts = {}) {
85
85
  }
86
86
  });
87
87
  }
88
- _chunkRVWBJ6LVjs.__name.call(void 0, handleRequest, "handleRequest");
88
+ _chunkGHFSIZUOjs.__name.call(void 0, handleRequest, "handleRequest");
89
89
  subscribeQueues();
90
- _chunkQYX5Q7KOjs.HMR.call(void 0, async () => {
90
+ _chunkRZ7IXJYQjs.HMR.call(void 0, async () => {
91
91
  for (const i in workerMap) await workerMap[i].close(true);
92
92
  for (const i in queueMap) await queueMap[i].close();
93
93
  await subscribeQueues();
@@ -97,7 +97,7 @@ async function create({ moduleMap, meta }, opts = {}) {
97
97
  queueMap
98
98
  };
99
99
  }
100
- _chunkRVWBJ6LVjs.__name.call(void 0, create, "create");
100
+ _chunkGHFSIZUOjs.__name.call(void 0, create, "create");
101
101
 
102
102
  // src/rpc/bullmq/client.ts
103
103
  var _events = require('events');
@@ -108,7 +108,7 @@ async function createClient(controllers, opts = {}) {
108
108
  const { max, workerOpts, queueOpts, timeout, key } = opts;
109
109
  const ret = {};
110
110
  const emitter = new (0, _events.EventEmitter)();
111
- const clientQueue = _chunkQYX5Q7KOjs.genClientQueue.call(void 0, key);
111
+ const clientQueue = _chunkRZ7IXJYQjs.genClientQueue.call(void 0, key);
112
112
  const queueMap = {};
113
113
  new (0, _bullmq.Worker)(clientQueue, async (job) => {
114
114
  const { data, id, error } = job.data;
@@ -153,7 +153,7 @@ async function createClient(controllers, opts = {}) {
153
153
  if (error) reject(data);
154
154
  else resolve(data);
155
155
  }
156
- _chunkRVWBJ6LVjs.__name.call(void 0, listener, "listener");
156
+ _chunkGHFSIZUOjs.__name.call(void 0, listener, "listener");
157
157
  eventCount++;
158
158
  emitter.once(id, listener);
159
159
  });
@@ -163,7 +163,7 @@ async function createClient(controllers, opts = {}) {
163
163
  }
164
164
  return ret;
165
165
  }
166
- _chunkRVWBJ6LVjs.__name.call(void 0, createClient, "createClient");
166
+ _chunkGHFSIZUOjs.__name.call(void 0, createClient, "createClient");
167
167
 
168
168
 
169
169
 
@@ -4,10 +4,10 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  genClientQueue
7
- } from "../../chunk-BZKJ5NBU.mjs";
7
+ } from "../../chunk-3IPYLGY2.mjs";
8
8
  import {
9
9
  __name
10
- } from "../../chunk-MESZCLSS.mjs";
10
+ } from "../../chunk-UXD62LGG.mjs";
11
11
 
12
12
  // src/rpc/bullmq/bind.ts
13
13
  import { Queue, Worker } from "bullmq";
@@ -3,10 +3,10 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkQYX5Q7KOjs = require('../../chunk-QYX5Q7KO.js');
6
+ var _chunkRZ7IXJYQjs = require('../../chunk-RZ7IXJYQ.js');
7
7
 
8
8
 
9
- var _chunkRVWBJ6LVjs = require('../../chunk-RVWBJ6LV.js');
9
+ var _chunkGHFSIZUOjs = require('../../chunk-GHFSIZUO.js');
10
10
 
11
11
  // src/rpc/kafka/bind.ts
12
12
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
@@ -14,14 +14,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/kafka");
14
14
  async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
15
15
  const { globalGuards, globalInterceptors, globalFilter, globalPipe } = opts;
16
16
  const existQueue = /* @__PURE__ */ new Set();
17
- const metaMap = _chunkQYX5Q7KOjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
+ const metaMap = _chunkRZ7IXJYQjs.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
- _chunkQYX5Q7KOjs.detectAopDep.call(void 0, meta, {
24
+ _chunkRZ7IXJYQjs.detectAopDep.call(void 0, meta, {
25
25
  guards: globalGuards,
26
26
  interceptors: globalInterceptors
27
27
  }, "rpc");
@@ -43,10 +43,10 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
43
43
  }
44
44
  }
45
45
  }
46
- _chunkRVWBJ6LVjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
46
+ _chunkGHFSIZUOjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
47
47
  await subscribeQueues();
48
48
  await consumer.run({
49
- eachMessage: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, async ({ message, partition, topic, heartbeat, pause }) => {
49
+ eachMessage: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, async ({ message, partition, topic, heartbeat, pause }) => {
50
50
  if (!existQueue.has(topic)) return;
51
51
  const data = JSON.parse(message.value.toString());
52
52
  const { tag, func, id, queue: clientQueue, _ps, args } = data;
@@ -55,7 +55,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
55
55
  const meta2 = metaMap.get(tag)[func];
56
56
  const { data: { rpc } } = meta2;
57
57
  const isEvent = rpc.isEvent;
58
- const context = new (0, _chunkQYX5Q7KOjs.Context)({
58
+ const context = new (0, _chunkRZ7IXJYQjs.Context)({
59
59
  type: "kafka",
60
60
  moduleMap,
61
61
  meta: meta2,
@@ -108,7 +108,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
108
108
  }, "eachMessage")
109
109
  });
110
110
  }
111
- _chunkRVWBJ6LVjs.__name.call(void 0, bind, "bind");
111
+ _chunkGHFSIZUOjs.__name.call(void 0, bind, "bind");
112
112
 
113
113
  // src/rpc/kafka/client.ts
114
114
  var _events = require('events');
@@ -117,7 +117,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
117
117
  let eventCount = 1;
118
118
  const ret = {};
119
119
  const emitter = new (0, _events.EventEmitter)();
120
- const clientQueue = _chunkQYX5Q7KOjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
120
+ const clientQueue = _chunkRZ7IXJYQjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
121
121
  await consumer.subscribe({
122
122
  topic: clientQueue,
123
123
  fromBeginning: true
@@ -167,7 +167,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
167
167
  if (error) reject(data);
168
168
  else resolve(data);
169
169
  }
170
- _chunkRVWBJ6LVjs.__name.call(void 0, listener, "listener");
170
+ _chunkGHFSIZUOjs.__name.call(void 0, listener, "listener");
171
171
  eventCount++;
172
172
  emitter.once(id, listener);
173
173
  });
@@ -176,7 +176,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
176
176
  });
177
177
  }
178
178
  await consumer.run({
179
- eachMessage: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, async ({ message, topic }) => {
179
+ eachMessage: /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, async ({ message, topic }) => {
180
180
  if (clientQueue === topic && message.value) {
181
181
  const { data, id, error } = JSON.parse(message.value.toString());
182
182
  emitter.emit(id, data, error);
@@ -185,7 +185,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
185
185
  });
186
186
  return ret;
187
187
  }
188
- _chunkRVWBJ6LVjs.__name.call(void 0, createClient, "createClient");
188
+ _chunkGHFSIZUOjs.__name.call(void 0, createClient, "createClient");
189
189
 
190
190
 
191
191
 
@@ -3,10 +3,10 @@ import {
3
3
  createControllerMetaMap,
4
4
  detectAopDep,
5
5
  genClientQueue
6
- } from "../../chunk-BZKJ5NBU.mjs";
6
+ } from "../../chunk-3IPYLGY2.mjs";
7
7
  import {
8
8
  __name
9
- } from "../../chunk-MESZCLSS.mjs";
9
+ } from "../../chunk-UXD62LGG.mjs";
10
10
 
11
11
  // src/rpc/kafka/bind.ts
12
12
  import Debug from "debug";
@@ -3,10 +3,10 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkQYX5Q7KOjs = require('../../chunk-QYX5Q7KO.js');
6
+ var _chunkRZ7IXJYQjs = require('../../chunk-RZ7IXJYQ.js');
7
7
 
8
8
 
9
- var _chunkRVWBJ6LVjs = require('../../chunk-RVWBJ6LV.js');
9
+ var _chunkGHFSIZUOjs = require('../../chunk-GHFSIZUO.js');
10
10
 
11
11
  // src/rpc/nats/bind.ts
12
12
  var _nats = require('nats');
@@ -17,14 +17,14 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
17
17
  const sc = _nats.StringCodec.call(void 0, );
18
18
  const subscriptionMap = {};
19
19
  const existQueue = /* @__PURE__ */ new Set();
20
- const metaMap = _chunkQYX5Q7KOjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const metaMap = _chunkRZ7IXJYQjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
21
  const { controller, rpc, func, tag } = meta2.data;
22
22
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _2 => _2.queue]) !== void 0) {
23
23
  debug(`register method "${func}" in module "${tag}"`);
24
24
  return true;
25
25
  }
26
26
  });
27
- _chunkQYX5Q7KOjs.detectAopDep.call(void 0, meta, {
27
+ _chunkRZ7IXJYQjs.detectAopDep.call(void 0, meta, {
28
28
  guards: globalGuards,
29
29
  interceptors: globalInterceptors
30
30
  }, "rpc");
@@ -46,7 +46,7 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
46
46
  }
47
47
  }
48
48
  }
49
- _chunkRVWBJ6LVjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
49
+ _chunkGHFSIZUOjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
50
50
  async function handleRequest(_, msg) {
51
51
  const data = JSON.parse(sc.decode(msg.data));
52
52
  const { tag, func, id, _ps, args } = data;
@@ -55,7 +55,7 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
55
55
  const meta2 = metaMap.get(tag)[func];
56
56
  const { data: { rpc: { isEvent } = {} } } = meta2;
57
57
  if (isEvent) msg.respond("{}");
58
- const context = new (0, _chunkQYX5Q7KOjs.Context)({
58
+ const context = new (0, _chunkRZ7IXJYQjs.Context)({
59
59
  type: "nats",
60
60
  moduleMap,
61
61
  meta: meta2,
@@ -86,14 +86,14 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
86
86
  })));
87
87
  });
88
88
  }
89
- _chunkRVWBJ6LVjs.__name.call(void 0, handleRequest, "handleRequest");
89
+ _chunkGHFSIZUOjs.__name.call(void 0, handleRequest, "handleRequest");
90
90
  subscribeQueues();
91
- _chunkQYX5Q7KOjs.HMR.call(void 0, async () => {
91
+ _chunkRZ7IXJYQjs.HMR.call(void 0, async () => {
92
92
  for (const i in subscriptionMap) subscriptionMap[i].unsubscribe();
93
93
  await subscribeQueues();
94
94
  });
95
95
  }
96
- _chunkRVWBJ6LVjs.__name.call(void 0, bind, "bind");
96
+ _chunkGHFSIZUOjs.__name.call(void 0, bind, "bind");
97
97
 
98
98
  // src/rpc/nats/client.ts
99
99
 
@@ -143,7 +143,7 @@ async function createClient(nc, controllers, opts) {
143
143
  if (error) reject(data);
144
144
  else resolve(data);
145
145
  }
146
- _chunkRVWBJ6LVjs.__name.call(void 0, handler, "handler");
146
+ _chunkGHFSIZUOjs.__name.call(void 0, handler, "handler");
147
147
  eventCount++;
148
148
  });
149
149
  };
@@ -152,7 +152,7 @@ async function createClient(nc, controllers, opts) {
152
152
  }
153
153
  return ret;
154
154
  }
155
- _chunkRVWBJ6LVjs.__name.call(void 0, createClient, "createClient");
155
+ _chunkGHFSIZUOjs.__name.call(void 0, createClient, "createClient");
156
156
 
157
157
 
158
158
 
@@ -3,10 +3,10 @@ import {
3
3
  HMR,
4
4
  createControllerMetaMap,
5
5
  detectAopDep
6
- } from "../../chunk-BZKJ5NBU.mjs";
6
+ } from "../../chunk-3IPYLGY2.mjs";
7
7
  import {
8
8
  __name
9
- } from "../../chunk-MESZCLSS.mjs";
9
+ } from "../../chunk-UXD62LGG.mjs";
10
10
 
11
11
  // src/rpc/nats/bind.ts
12
12
  import { StringCodec } from "nats";