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
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkRVWBJ6LVjs = require('./chunk-RVWBJ6LV.js');
8
+ var _chunkGHFSIZUOjs = require('./chunk-GHFSIZUO.js');
9
9
 
10
10
  // src/helper.ts
11
11
  var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
@@ -19,7 +19,7 @@ var _phecdacore = require('phecda-core');
19
19
  // src/exception/base.ts
20
20
  var Exception = class extends Error {
21
21
  static {
22
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "Exception");
22
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "Exception");
23
23
  }
24
24
 
25
25
 
@@ -35,7 +35,7 @@ var Exception = class extends Error {
35
35
  message: this.message,
36
36
  description: this.description,
37
37
  status: this.status,
38
- [_chunkRVWBJ6LVjs.ERROR_SYMBOL]: true
38
+ [_chunkGHFSIZUOjs.ERROR_SYMBOL]: true
39
39
  };
40
40
  }
41
41
  };
@@ -43,7 +43,7 @@ var Exception = class extends Error {
43
43
  // src/exception/validate.ts
44
44
  var ValidateException = class extends Exception {
45
45
  static {
46
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "ValidateException");
46
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "ValidateException");
47
47
  }
48
48
  constructor(message) {
49
49
  super(message, 400, "Validate exception");
@@ -51,7 +51,7 @@ var ValidateException = class extends Exception {
51
51
  };
52
52
 
53
53
  // src/pipe.ts
54
- var defaultPipe = /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, ({ arg, reflect, index }) => {
54
+ var defaultPipe = /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, ({ arg, reflect, index }) => {
55
55
  if (_phecdacore.isPhecda.call(void 0, reflect)) {
56
56
  const instance = _phecdacore.plainToClass.call(void 0, reflect, arg);
57
57
  const err = _phecdacore.transformInstance.call(void 0, instance);
@@ -73,7 +73,7 @@ var defaultPipe = /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, ({ arg, r
73
73
  // src/exception/undefine.ts
74
74
  var UndefinedException = class extends Exception {
75
75
  static {
76
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "UndefinedException");
76
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "UndefinedException");
77
77
  }
78
78
  constructor(message) {
79
79
  super(message, 500, "Undefined error");
@@ -83,7 +83,7 @@ var UndefinedException = class extends Exception {
83
83
  // src/exception/forbidden.ts
84
84
  var ForbiddenException = class extends Exception {
85
85
  static {
86
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "ForbiddenException");
86
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "ForbiddenException");
87
87
  }
88
88
  constructor(message) {
89
89
  super(message, 403, "Forbidden resource");
@@ -93,7 +93,7 @@ var ForbiddenException = class extends Exception {
93
93
  // src/exception/bad-request.ts
94
94
  var BadRequestException = class extends Exception {
95
95
  static {
96
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "BadRequestException");
96
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "BadRequestException");
97
97
  }
98
98
  constructor(message) {
99
99
  super(message, 400, "Bad Request");
@@ -103,7 +103,7 @@ var BadRequestException = class extends Exception {
103
103
  // src/exception/not-found.ts
104
104
  var NotFoundException = class extends Exception {
105
105
  static {
106
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "NotFoundException");
106
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "NotFoundException");
107
107
  }
108
108
  constructor(message) {
109
109
  super(message, 404, "Not Found");
@@ -113,7 +113,7 @@ var NotFoundException = class extends Exception {
113
113
  // src/exception/conflict.ts
114
114
  var ConflictException = class extends Exception {
115
115
  static {
116
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "ConflictException");
116
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "ConflictException");
117
117
  }
118
118
  constructor(message) {
119
119
  super(message, 409, "Conflict");
@@ -123,7 +123,7 @@ var ConflictException = class extends Exception {
123
123
  // src/exception/bad-gateway.ts
124
124
  var BadGatewayException = class extends Exception {
125
125
  static {
126
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "BadGatewayException");
126
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "BadGatewayException");
127
127
  }
128
128
  constructor(message) {
129
129
  super(message, 502, "Bad Gatrway");
@@ -133,7 +133,7 @@ var BadGatewayException = class extends Exception {
133
133
  // src/exception/invalid-input.ts
134
134
  var InvalidInputException = class extends Exception {
135
135
  static {
136
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "InvalidInputException");
136
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "InvalidInputException");
137
137
  }
138
138
  constructor(message) {
139
139
  super(message, 502, "Invalid Input");
@@ -143,7 +143,7 @@ var InvalidInputException = class extends Exception {
143
143
  // src/exception/media-type.ts
144
144
  var UnsupportedMediaTypeException = class extends Exception {
145
145
  static {
146
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "UnsupportedMediaTypeException");
146
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "UnsupportedMediaTypeException");
147
147
  }
148
148
  constructor(message) {
149
149
  super(message, 415, "Unsupported Media Type");
@@ -153,7 +153,7 @@ var UnsupportedMediaTypeException = class extends Exception {
153
153
  // src/exception/payload-large.ts
154
154
  var PayloadLargeException = class extends Exception {
155
155
  static {
156
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "PayloadLargeException");
156
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "PayloadLargeException");
157
157
  }
158
158
  constructor(message) {
159
159
  super(message, 413, "Payload Too Large");
@@ -163,7 +163,7 @@ var PayloadLargeException = class extends Exception {
163
163
  // src/exception/timeout.ts
164
164
  var TimeoutException = class extends Exception {
165
165
  static {
166
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "TimeoutException");
166
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "TimeoutException");
167
167
  }
168
168
  constructor(message) {
169
169
  super(message, 408, "Request Timeout");
@@ -173,7 +173,7 @@ var TimeoutException = class extends Exception {
173
173
  // src/exception/unauthorized.ts
174
174
  var UnauthorizedException = class extends Exception {
175
175
  static {
176
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "UnauthorizedException");
176
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "UnauthorizedException");
177
177
  }
178
178
  constructor(message) {
179
179
  super(message, 401, "Unauthorized");
@@ -183,7 +183,7 @@ var UnauthorizedException = class extends Exception {
183
183
  // src/exception/unavailable-service.ts
184
184
  var ServiceUnavailableException = class extends Exception {
185
185
  static {
186
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "ServiceUnavailableException");
186
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "ServiceUnavailableException");
187
187
  }
188
188
  constructor(message) {
189
189
  super(message, 503, "Service Unavailable");
@@ -193,7 +193,7 @@ var ServiceUnavailableException = class extends Exception {
193
193
  // src/exception/framework.ts
194
194
  var FrameworkException = class extends Exception {
195
195
  static {
196
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "FrameworkException");
196
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "FrameworkException");
197
197
  }
198
198
  constructor(message) {
199
199
  super(`[phecda-server] ${message}`, 500, "Framework Error");
@@ -203,7 +203,7 @@ var FrameworkException = class extends Exception {
203
203
  // src/exception/timer.ts
204
204
  var TimerException = class extends Exception {
205
205
  static {
206
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "TimerException");
206
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "TimerException");
207
207
  }
208
208
  constructor(message) {
209
209
  super(message, 0, "Timer Error");
@@ -213,7 +213,7 @@ var TimerException = class extends Exception {
213
213
  // src/exception/worker.ts
214
214
  var WorkerException = class extends Exception {
215
215
  static {
216
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "WorkerException");
216
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "WorkerException");
217
217
  }
218
218
  constructor(message) {
219
219
  super(message, 0, "Worker Error");
@@ -221,14 +221,14 @@ var WorkerException = class extends Exception {
221
221
  };
222
222
 
223
223
  // src/filter.ts
224
- var defaultFilter = /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (e) => {
224
+ var defaultFilter = /* @__PURE__ */ _chunkGHFSIZUOjs.__name.call(void 0, (e) => {
225
225
  if (!(e instanceof Exception)) {
226
- _chunkRVWBJ6LVjs.log.call(void 0, e.message, "error");
227
- if (_chunkRVWBJ6LVjs.LOG_LEVEL <= 0) console.error(e.stack);
226
+ _chunkGHFSIZUOjs.log.call(void 0, e.message, "error");
227
+ if (_chunkGHFSIZUOjs.LOG_LEVEL <= 0) console.error(e.stack);
228
228
  e = new UndefinedException(e.message || e);
229
229
  } else {
230
- _chunkRVWBJ6LVjs.log.call(void 0, `[${e.constructor.name}] ${e.message}`, "error");
231
- if (_chunkRVWBJ6LVjs.LOG_LEVEL <= 0) console.error(e.stack);
230
+ _chunkGHFSIZUOjs.log.call(void 0, `[${e.constructor.name}] ${e.message}`, "error");
231
+ if (_chunkGHFSIZUOjs.LOG_LEVEL <= 0) console.error(e.stack);
232
232
  }
233
233
  return e.data;
234
234
  }, "defaultFilter");
@@ -237,7 +237,7 @@ var defaultFilter = /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (e) =>
237
237
  var debug = _debug2.default.call(void 0, "phecda-server(Context)");
238
238
  var Context = (_class = class _Context {
239
239
  static {
240
- _chunkRVWBJ6LVjs.__name.call(void 0, this, "Context");
240
+ _chunkGHFSIZUOjs.__name.call(void 0, this, "Context");
241
241
  }
242
242
 
243
243
 
@@ -254,7 +254,7 @@ var Context = (_class = class _Context {
254
254
 
255
255
  constructor(data) {
256
256
  this.data = data;
257
- if (_chunkRVWBJ6LVjs.IS_HMR)
257
+ if (_chunkGHFSIZUOjs.IS_HMR)
258
258
  data._context = this;
259
259
  }
260
260
  async run(opts, successCb, failCb) {
@@ -295,7 +295,7 @@ var Context = (_class = class _Context {
295
295
  usePipe(args) {
296
296
  return Promise.all(args.map((item) => {
297
297
  if (item.pipe && !_Context.pipeRecord[item.pipe]) {
298
- if (_chunkRVWBJ6LVjs.IS_STRICT) {
298
+ if (_chunkGHFSIZUOjs.IS_STRICT) {
299
299
  throw new FrameworkException(`can't find pipe named '${item.pipe}'`);
300
300
  } else {
301
301
  debug(`Can't find pipe named "${item.pipe}" when handling the ${item.index + 1}th argument of the func "${this.data.func}" on module "${this.data.tag}",use default pipe instead`);
@@ -307,7 +307,7 @@ var Context = (_class = class _Context {
307
307
  }
308
308
  useFilter(arg, filter = "default") {
309
309
  if (!_Context.filterRecord[filter]) {
310
- if (_chunkRVWBJ6LVjs.IS_STRICT) {
310
+ if (_chunkGHFSIZUOjs.IS_STRICT) {
311
311
  throw new FrameworkException(`can't find filter named "${filter}"`);
312
312
  } else {
313
313
  debug(`Can't find filter named "${filter}" when handling func "${this.data.func}" on module "${this.data.tag}",use default filter instead`);
@@ -319,7 +319,7 @@ var Context = (_class = class _Context {
319
319
  async useGuard(guards) {
320
320
  for (const guard of new Set(guards)) {
321
321
  if (!(guard in _Context.guardRecord)) {
322
- if (_chunkRVWBJ6LVjs.IS_STRICT) throw new FrameworkException(`Can't find guard named "${guard}"`);
322
+ if (_chunkGHFSIZUOjs.IS_STRICT) throw new FrameworkException(`Can't find guard named "${guard}"`);
323
323
  else debug(`Can't find guard named "${guard}" when handling func "${this.data.func}" on module "${this.data.tag}",skip it`);
324
324
  continue;
325
325
  }
@@ -336,7 +336,7 @@ var Context = (_class = class _Context {
336
336
  const cb = [];
337
337
  for (const interceptor of new Set(interceptors)) {
338
338
  if (!(interceptor in _Context.interceptorRecord)) {
339
- if (_chunkRVWBJ6LVjs.IS_STRICT) throw new FrameworkException(`can't find interceptor named "${interceptor}"`);
339
+ if (_chunkGHFSIZUOjs.IS_STRICT) throw new FrameworkException(`can't find interceptor named "${interceptor}"`);
340
340
  else debug(`Can't find interceptor named "${interceptor}" when handling func "${this.data.func}" on module "${this.data.tag}",skip it`);
341
341
  continue;
342
342
  }
@@ -352,7 +352,7 @@ var Context = (_class = class _Context {
352
352
  const ret = [];
353
353
  for (const m of new Set(plugins)) {
354
354
  if (!(m in _Context.pluginRecord)) {
355
- if (_chunkRVWBJ6LVjs.IS_STRICT) throw new FrameworkException(`can't find middleware named '${m}'`);
355
+ if (_chunkGHFSIZUOjs.IS_STRICT) throw new FrameworkException(`can't find middleware named '${m}'`);
356
356
  continue;
357
357
  }
358
358
  const plugin = _Context.pluginRecord[m](framework);
@@ -362,43 +362,43 @@ var Context = (_class = class _Context {
362
362
  }
363
363
  }, _class.__initStatic(), _class.__initStatic2(), _class.__initStatic3(), _class.__initStatic4(), _class.__initStatic5(), _class);
364
364
  function addPlugin(key, handler) {
365
- if (Context.pluginRecord[key] && Context.pluginRecord[key] !== handler) _chunkRVWBJ6LVjs.log.call(void 0, `overwrite Plugin "${String(key)}"`, "warn");
365
+ if (Context.pluginRecord[key] && Context.pluginRecord[key] !== handler) _chunkGHFSIZUOjs.log.call(void 0, `overwrite Plugin "${String(key)}"`, "warn");
366
366
  Context.pluginRecord[key] = handler;
367
367
  }
368
- _chunkRVWBJ6LVjs.__name.call(void 0, addPlugin, "addPlugin");
368
+ _chunkGHFSIZUOjs.__name.call(void 0, addPlugin, "addPlugin");
369
369
  function addPipe(key, handler) {
370
- if (Context.pipeRecord[key] && Context.pipeRecord[key] !== handler) _chunkRVWBJ6LVjs.log.call(void 0, `overwrite Pipe "${String(key)}"`, "warn");
370
+ if (Context.pipeRecord[key] && Context.pipeRecord[key] !== handler) _chunkGHFSIZUOjs.log.call(void 0, `overwrite Pipe "${String(key)}"`, "warn");
371
371
  Context.pipeRecord[key] = handler;
372
372
  }
373
- _chunkRVWBJ6LVjs.__name.call(void 0, addPipe, "addPipe");
373
+ _chunkGHFSIZUOjs.__name.call(void 0, addPipe, "addPipe");
374
374
  function addFilter(key, handler) {
375
- if (Context.filterRecord[key] && Context.filterRecord[key] !== handler) _chunkRVWBJ6LVjs.log.call(void 0, `overwrite Filter "${String(key)}"`, "warn");
375
+ if (Context.filterRecord[key] && Context.filterRecord[key] !== handler) _chunkGHFSIZUOjs.log.call(void 0, `overwrite Filter "${String(key)}"`, "warn");
376
376
  Context.filterRecord[key] = handler;
377
377
  }
378
- _chunkRVWBJ6LVjs.__name.call(void 0, addFilter, "addFilter");
378
+ _chunkGHFSIZUOjs.__name.call(void 0, addFilter, "addFilter");
379
379
  function addGuard(key, handler) {
380
- if (Context.guardRecord[key] && Context.guardRecord[key] !== handler) _chunkRVWBJ6LVjs.log.call(void 0, `overwrite Guard "${String(key)}"`, "warn");
380
+ if (Context.guardRecord[key] && Context.guardRecord[key] !== handler) _chunkGHFSIZUOjs.log.call(void 0, `overwrite Guard "${String(key)}"`, "warn");
381
381
  Context.guardRecord[key] = handler;
382
382
  }
383
- _chunkRVWBJ6LVjs.__name.call(void 0, addGuard, "addGuard");
383
+ _chunkGHFSIZUOjs.__name.call(void 0, addGuard, "addGuard");
384
384
  function addInterceptor(key, handler) {
385
- if (Context.interceptorRecord[key] && Context.interceptorRecord[key] !== handler) _chunkRVWBJ6LVjs.log.call(void 0, `overwrite Interceptor "${String(key)}"`, "warn");
385
+ if (Context.interceptorRecord[key] && Context.interceptorRecord[key] !== handler) _chunkGHFSIZUOjs.log.call(void 0, `overwrite Interceptor "${String(key)}"`, "warn");
386
386
  Context.interceptorRecord[key] = handler;
387
387
  }
388
- _chunkRVWBJ6LVjs.__name.call(void 0, addInterceptor, "addInterceptor");
388
+ _chunkGHFSIZUOjs.__name.call(void 0, addInterceptor, "addInterceptor");
389
389
 
390
390
  // src/hmr.ts
391
391
  function HMR(cb) {
392
- if (_chunkRVWBJ6LVjs.IS_HMR) _optionalChain([globalThis, 'access', _ => _.__PS_HMR__, 'optionalAccess', _2 => _2.push, 'call', _3 => _3(cb)]);
392
+ if (_chunkGHFSIZUOjs.IS_HMR) _optionalChain([globalThis, 'access', _ => _.__PS_HMR__, 'optionalAccess', _2 => _2.push, 'call', _3 => _3(cb)]);
393
393
  }
394
- _chunkRVWBJ6LVjs.__name.call(void 0, HMR, "HMR");
394
+ _chunkGHFSIZUOjs.__name.call(void 0, HMR, "HMR");
395
395
 
396
396
  // src/server/helper.ts
397
397
  function resolveDep(ret, key) {
398
398
  if (key) return _optionalChain([ret, 'optionalAccess', _4 => _4[key]]);
399
399
  return ret;
400
400
  }
401
- _chunkRVWBJ6LVjs.__name.call(void 0, resolveDep, "resolveDep");
401
+ _chunkGHFSIZUOjs.__name.call(void 0, resolveDep, "resolveDep");
402
402
  function argToReq(params, args, headers) {
403
403
  const req = {
404
404
  body: {},
@@ -412,14 +412,14 @@ function argToReq(params, args, headers) {
412
412
  });
413
413
  return req;
414
414
  }
415
- _chunkRVWBJ6LVjs.__name.call(void 0, argToReq, "argToReq");
415
+ _chunkGHFSIZUOjs.__name.call(void 0, argToReq, "argToReq");
416
416
 
417
417
  // src/rpc/helper.ts
418
418
  var _os = require('os');
419
419
  function genClientQueue(key) {
420
420
  return `PS-${key ? `${key}-` : ""}${_os.hostname.call(void 0, )}-${process.pid}`;
421
421
  }
422
- _chunkRVWBJ6LVjs.__name.call(void 0, genClientQueue, "genClientQueue");
422
+ _chunkGHFSIZUOjs.__name.call(void 0, genClientQueue, "genClientQueue");
423
423
 
424
424
  // src/decorators/helper.ts
425
425
  function shallowClone(obj) {
@@ -427,11 +427,11 @@ function shallowClone(obj) {
427
427
  ...obj
428
428
  };
429
429
  }
430
- _chunkRVWBJ6LVjs.__name.call(void 0, shallowClone, "shallowClone");
430
+ _chunkGHFSIZUOjs.__name.call(void 0, shallowClone, "shallowClone");
431
431
  function mergeObject(...args) {
432
432
  return Object.assign({}, ...args);
433
433
  }
434
- _chunkRVWBJ6LVjs.__name.call(void 0, mergeObject, "mergeObject");
434
+ _chunkGHFSIZUOjs.__name.call(void 0, mergeObject, "mergeObject");
435
435
 
436
436
  // src/helper.ts
437
437
  function createControllerMetaMap(meta, filter) {
@@ -447,12 +447,12 @@ function createControllerMetaMap(meta, filter) {
447
447
  });
448
448
  }
449
449
  }
450
- _chunkRVWBJ6LVjs.__name.call(void 0, handleMeta, "handleMeta");
450
+ _chunkGHFSIZUOjs.__name.call(void 0, handleMeta, "handleMeta");
451
451
  handleMeta();
452
452
  HMR(handleMeta);
453
453
  return metaMap;
454
454
  }
455
- _chunkRVWBJ6LVjs.__name.call(void 0, createControllerMetaMap, "createControllerMetaMap");
455
+ _chunkGHFSIZUOjs.__name.call(void 0, createControllerMetaMap, "createControllerMetaMap");
456
456
  function detectAopDep(meta, { guards, interceptors, plugins } = {}, controller = "http") {
457
457
  const pluginSet = /* @__PURE__ */ new Set();
458
458
  const guardSet = /* @__PURE__ */ new Set();
@@ -504,14 +504,14 @@ function detectAopDep(meta, { guards, interceptors, plugins } = {}, controller =
504
504
  const missFilters = [
505
505
  ...filterSet
506
506
  ].filter((i) => !Context.filterRecord[i]);
507
- if (missPlugins.length) _chunkRVWBJ6LVjs.log.call(void 0, `${_picocolors2.default.white(`Plugin [${missPlugins.join(",")}]`)} doesn't exist`, "warn");
508
- if (missGuards.length) _chunkRVWBJ6LVjs.log.call(void 0, `${_picocolors2.default.magenta(`Guard [${missGuards.join(",")}]`)} doesn't exist`, "warn");
509
- if (missInterceptors.length) _chunkRVWBJ6LVjs.log.call(void 0, `${_picocolors2.default.cyan(`Interceptor [${missInterceptors.join(",")}]`)} doesn't exist`, "warn");
510
- if (missPipes.length) _chunkRVWBJ6LVjs.log.call(void 0, `${_picocolors2.default.blue(`Pipe [${missPipes.join(",")}]`)} doesn't exist`, "warn");
511
- if (missFilters.length) _chunkRVWBJ6LVjs.log.call(void 0, `${_picocolors2.default.red(`Filter [${missFilters.join(",")}]`)} doesn't exist`, "warn");
512
- warningSet.forEach((warn) => _chunkRVWBJ6LVjs.log.call(void 0, warn, "warn"));
513
- }
514
- _chunkRVWBJ6LVjs.__name.call(void 0, handleMeta, "handleMeta");
507
+ if (missPlugins.length) _chunkGHFSIZUOjs.log.call(void 0, `${_picocolors2.default.white(`Plugin [${missPlugins.join(",")}]`)} doesn't exist`, "warn");
508
+ if (missGuards.length) _chunkGHFSIZUOjs.log.call(void 0, `${_picocolors2.default.magenta(`Guard [${missGuards.join(",")}]`)} doesn't exist`, "warn");
509
+ if (missInterceptors.length) _chunkGHFSIZUOjs.log.call(void 0, `${_picocolors2.default.cyan(`Interceptor [${missInterceptors.join(",")}]`)} doesn't exist`, "warn");
510
+ if (missPipes.length) _chunkGHFSIZUOjs.log.call(void 0, `${_picocolors2.default.blue(`Pipe [${missPipes.join(",")}]`)} doesn't exist`, "warn");
511
+ if (missFilters.length) _chunkGHFSIZUOjs.log.call(void 0, `${_picocolors2.default.red(`Filter [${missFilters.join(",")}]`)} doesn't exist`, "warn");
512
+ warningSet.forEach((warn) => _chunkGHFSIZUOjs.log.call(void 0, warn, "warn"));
513
+ }
514
+ _chunkGHFSIZUOjs.__name.call(void 0, handleMeta, "handleMeta");
515
515
  handleMeta();
516
516
  HMR(handleMeta);
517
517
  return {
@@ -522,7 +522,7 @@ function detectAopDep(meta, { guards, interceptors, plugins } = {}, controller =
522
522
  filterSet
523
523
  };
524
524
  }
525
- _chunkRVWBJ6LVjs.__name.call(void 0, detectAopDep, "detectAopDep");
525
+ _chunkGHFSIZUOjs.__name.call(void 0, detectAopDep, "detectAopDep");
526
526
 
527
527
 
528
528
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  mergeObject,
3
3
  shallowClone
4
- } from "./chunk-BZKJ5NBU.mjs";
4
+ } from "./chunk-3IPYLGY2.mjs";
5
5
  import {
6
6
  __name
7
- } from "./chunk-MESZCLSS.mjs";
7
+ } from "./chunk-UXD62LGG.mjs";
8
8
 
9
9
  // src/decorators/param.ts
10
10
  import { getState, setPropertyState } from "phecda-core";
@@ -15,6 +15,7 @@ var PS_EXIT_CODE;
15
15
 
16
16
  // src/utils.ts
17
17
  import pc from "picocolors";
18
+ import { Mixin } from "ts-mixer";
18
19
  var time;
19
20
  var internalLogger = console;
20
21
  function setLogger(logger) {
@@ -42,15 +43,6 @@ function log(msg, level = "log") {
42
43
  internalLogger[level](`${pc.magenta("[phecda-server]")} ${pc.gray(`${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`)} ${pc[color](msg)} ${pc.gray(interval)}`);
43
44
  }
44
45
  __name(log, "log");
45
- function Mix(InternalClass, ExtendClass) {
46
- return class extends InternalClass {
47
- constructor(...args) {
48
- super();
49
- Object.assign(this, new ExtendClass(...args));
50
- }
51
- };
52
- }
53
- __name(Mix, "Mix");
54
46
 
55
47
  export {
56
48
  __name,
@@ -62,5 +54,5 @@ export {
62
54
  PS_EXIT_CODE,
63
55
  setLogger,
64
56
  log,
65
- Mix
57
+ Mixin
66
58
  };
package/dist/helper.js CHANGED
@@ -7,8 +7,8 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkQYX5Q7KOjs = require('./chunk-QYX5Q7KO.js');
11
- require('./chunk-RVWBJ6LV.js');
10
+ var _chunkRZ7IXJYQjs = require('./chunk-RZ7IXJYQ.js');
11
+ require('./chunk-GHFSIZUO.js');
12
12
 
13
13
 
14
14
 
@@ -18,4 +18,4 @@ require('./chunk-RVWBJ6LV.js');
18
18
 
19
19
 
20
20
 
21
- exports.HMR = _chunkQYX5Q7KOjs.HMR; exports.argToReq = _chunkQYX5Q7KOjs.argToReq; exports.createControllerMetaMap = _chunkQYX5Q7KOjs.createControllerMetaMap; exports.detectAopDep = _chunkQYX5Q7KOjs.detectAopDep; exports.genClientQueue = _chunkQYX5Q7KOjs.genClientQueue; exports.mergeObject = _chunkQYX5Q7KOjs.mergeObject; exports.resolveDep = _chunkQYX5Q7KOjs.resolveDep; exports.shallowClone = _chunkQYX5Q7KOjs.shallowClone;
21
+ exports.HMR = _chunkRZ7IXJYQjs.HMR; exports.argToReq = _chunkRZ7IXJYQjs.argToReq; exports.createControllerMetaMap = _chunkRZ7IXJYQjs.createControllerMetaMap; exports.detectAopDep = _chunkRZ7IXJYQjs.detectAopDep; exports.genClientQueue = _chunkRZ7IXJYQjs.genClientQueue; exports.mergeObject = _chunkRZ7IXJYQjs.mergeObject; exports.resolveDep = _chunkRZ7IXJYQjs.resolveDep; exports.shallowClone = _chunkRZ7IXJYQjs.shallowClone;
package/dist/helper.mjs CHANGED
@@ -7,8 +7,8 @@ import {
7
7
  mergeObject,
8
8
  resolveDep,
9
9
  shallowClone
10
- } from "./chunk-BZKJ5NBU.mjs";
11
- import "./chunk-MESZCLSS.mjs";
10
+ } from "./chunk-3IPYLGY2.mjs";
11
+ import "./chunk-UXD62LGG.mjs";
12
12
  export {
13
13
  HMR,
14
14
  argToReq,
package/dist/index.d.mts CHANGED
@@ -2,12 +2,13 @@ import { B as BaseContext, D as DefaultOptions, C as ControllerMetaData, M as Me
2
2
  export { e as BaseRequestType, d as BaseReturn, i as ControllerMeta, f as CustomResponse, j as ERROR_SYMBOL, g as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, h as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, c as ToClientFn, b as ToClientInstance, T as ToClientMap } from './types-BlIBlnVT.mjs';
3
3
  import { G as Generator } from './core-Bc2ENEHX.mjs';
4
4
  export { F as Factory, O as Options, c as createPhecda, e as emitter } from './core-Bc2ENEHX.mjs';
5
- import { Base, Construct, AbConstruct } from 'phecda-core';
5
+ import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
7
  import { H as HttpContext } from './types-Dgxirc9f.mjs';
8
8
  export { C as CookieSerializeOptions, a as HttpOptions } from './types-Dgxirc9f.mjs';
9
9
  import { R as RpcContext } from './types-AgVwUXPC.mjs';
10
10
  export { b as RpcClientOptions, a as RpcServerOptions } from './types-AgVwUXPC.mjs';
11
+ export { Mixin } from 'ts-mixer';
11
12
  import 'node:http';
12
13
 
13
14
  declare class Exception extends Error {
@@ -245,6 +246,5 @@ declare class PExtension extends ServerBase {
245
246
  type LogLevel = 'error' | 'info' | 'warn' | 'log';
246
247
  declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): void;
247
248
  declare function log(msg: string, level?: LogLevel): void;
248
- declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
249
249
 
250
- export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
250
+ export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Interceptor, type InterceptorType, InvalidInputException, MetaData, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
package/dist/index.d.ts CHANGED
@@ -2,12 +2,13 @@ import { B as BaseContext, D as DefaultOptions, C as ControllerMetaData, M as Me
2
2
  export { e as BaseRequestType, d as BaseReturn, i as ControllerMeta, f as CustomResponse, j as ERROR_SYMBOL, g as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, h as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, c as ToClientFn, b as ToClientInstance, T as ToClientMap } from './types-BlIBlnVT.js';
3
3
  import { G as Generator } from './core-dx9E5x2N.js';
4
4
  export { F as Factory, O as Options, c as createPhecda, e as emitter } from './core-dx9E5x2N.js';
5
- import { Base, Construct, AbConstruct } from 'phecda-core';
5
+ import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
7
  import { H as HttpContext } from './types-BCJhmpQh.js';
8
8
  export { C as CookieSerializeOptions, a as HttpOptions } from './types-BCJhmpQh.js';
9
9
  import { R as RpcContext } from './types-B-ZFZajI.js';
10
10
  export { b as RpcClientOptions, a as RpcServerOptions } from './types-B-ZFZajI.js';
11
+ export { Mixin } from 'ts-mixer';
11
12
  import 'node:http';
12
13
 
13
14
  declare class Exception extends Error {
@@ -245,6 +246,5 @@ declare class PExtension extends ServerBase {
245
246
  type LogLevel = 'error' | 'info' | 'warn' | 'log';
246
247
  declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): void;
247
248
  declare function log(msg: string, level?: LogLevel): void;
248
- declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
249
249
 
250
- export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
250
+ export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Interceptor, type InterceptorType, InvalidInputException, MetaData, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };