phecda-server 7.0.0-alpha.1 → 7.0.0-alpha.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 (80) hide show
  1. package/assets/ps.json +1 -1
  2. package/bin/cli.mjs +8 -7
  3. package/dist/{chunk-GSPBHZBH.js → chunk-6EBEME3I.js} +52 -52
  4. package/dist/{chunk-XYVMNY2X.mjs → chunk-A53KNKY4.mjs} +1 -1
  5. package/dist/{chunk-HMVLXNV3.mjs → chunk-KUGFI6SC.mjs} +1 -1
  6. package/dist/{chunk-V7EI76QQ.mjs → chunk-MMG73S64.mjs} +2 -2
  7. package/dist/{chunk-7YQ57BQS.js → chunk-PKSWGQLW.js} +18 -18
  8. package/dist/{chunk-MBCHNDAY.js → chunk-QCOBXM7F.js} +24 -24
  9. package/dist/{chunk-WHJ5FALK.mjs → chunk-QD3QR3NW.mjs} +3 -3
  10. package/dist/{chunk-J5CFUN4V.js → chunk-RQSQRZL4.js} +3 -3
  11. package/dist/{core-CYwEPfN4.d.ts → core-C1kHRqU9.d.ts} +1 -1
  12. package/dist/{core-BIcUwV18.d.mts → core-CSiaRU7r.d.mts} +1 -1
  13. package/dist/helper.d.mts +1 -1
  14. package/dist/helper.d.ts +1 -1
  15. package/dist/helper.js +3 -3
  16. package/dist/helper.mjs +2 -2
  17. package/dist/http/elysia/index.d.mts +3 -3
  18. package/dist/http/elysia/index.d.ts +3 -3
  19. package/dist/http/elysia/index.js +42 -40
  20. package/dist/http/elysia/index.mjs +5 -3
  21. package/dist/http/express/index.d.mts +3 -3
  22. package/dist/http/express/index.d.ts +3 -3
  23. package/dist/http/express/index.js +39 -37
  24. package/dist/http/express/index.mjs +4 -2
  25. package/dist/http/fastify/index.d.mts +3 -3
  26. package/dist/http/fastify/index.d.ts +3 -3
  27. package/dist/http/fastify/index.js +40 -38
  28. package/dist/http/fastify/index.mjs +5 -3
  29. package/dist/http/h3/index.d.mts +3 -3
  30. package/dist/http/h3/index.d.ts +3 -3
  31. package/dist/http/h3/index.js +39 -37
  32. package/dist/http/h3/index.mjs +4 -2
  33. package/dist/http/hono/index.d.mts +3 -3
  34. package/dist/http/hono/index.d.ts +3 -3
  35. package/dist/http/hono/index.js +37 -35
  36. package/dist/http/hono/index.mjs +4 -2
  37. package/dist/http/hyper-express/index.d.mts +3 -3
  38. package/dist/http/hyper-express/index.d.ts +3 -3
  39. package/dist/http/hyper-express/index.js +37 -35
  40. package/dist/http/hyper-express/index.mjs +4 -2
  41. package/dist/http/koa/index.d.mts +3 -3
  42. package/dist/http/koa/index.d.ts +3 -3
  43. package/dist/http/koa/index.js +39 -37
  44. package/dist/http/koa/index.mjs +4 -2
  45. package/dist/index.d.mts +8 -8
  46. package/dist/index.d.ts +8 -8
  47. package/dist/index.js +39 -39
  48. package/dist/index.mjs +5 -5
  49. package/dist/{meta-BXKLFTgG.d.mts → meta-D1M85Hef.d.mts} +1 -0
  50. package/dist/{meta-BXKLFTgG.d.ts → meta-D1M85Hef.d.ts} +1 -0
  51. package/dist/rpc/bullmq/index.d.mts +3 -3
  52. package/dist/rpc/bullmq/index.d.ts +3 -3
  53. package/dist/rpc/bullmq/index.js +15 -14
  54. package/dist/rpc/bullmq/index.mjs +3 -2
  55. package/dist/rpc/kafka/index.d.mts +3 -3
  56. package/dist/rpc/kafka/index.d.ts +3 -3
  57. package/dist/rpc/kafka/index.js +15 -14
  58. package/dist/rpc/kafka/index.mjs +3 -2
  59. package/dist/rpc/nats/index.d.mts +3 -3
  60. package/dist/rpc/nats/index.d.ts +3 -3
  61. package/dist/rpc/nats/index.js +14 -13
  62. package/dist/rpc/nats/index.mjs +3 -2
  63. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  64. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  65. package/dist/rpc/rabbitmq/index.js +16 -15
  66. package/dist/rpc/rabbitmq/index.mjs +3 -2
  67. package/dist/rpc/redis/index.d.mts +3 -3
  68. package/dist/rpc/redis/index.d.ts +3 -3
  69. package/dist/rpc/redis/index.js +14 -13
  70. package/dist/rpc/redis/index.mjs +3 -2
  71. package/dist/test.d.mts +2 -2
  72. package/dist/test.d.ts +2 -2
  73. package/dist/test.js +6 -6
  74. package/dist/test.mjs +2 -2
  75. package/dist/{types-BtbL49Zs.d.mts → types-C9Remkup.d.ts} +2 -1
  76. package/dist/{types-m3IEDKjP.d.ts → types-JMhFVp-Z.d.mts} +2 -1
  77. package/dist/{types-h40T3cRG.d.mts → types-ee1FBodH.d.ts} +2 -1
  78. package/dist/{types-VFzEM7LL.d.ts → types-wbHHC93P.d.mts} +2 -1
  79. package/package.json +1 -1
  80. package/register/loader.mjs +2 -2
package/assets/ps.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "unimport": {
16
16
  "dirs": ["."],
17
17
  "dirsScanOptions": {
18
- "filePatterns": ["*.{service,controller,module,rpc,edge,guard,extension,pipe,filter,addon}.ts"]
18
+ "filePatterns": ["*.{service,controller,module,rpc,solo,guard,extension,pipe,filter,addon}.ts"]
19
19
  }
20
20
  },
21
21
  "virtualFile": {},
package/bin/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import { fork } from 'child_process'
3
3
  import { createRequire } from 'module'
4
4
  import { fileURLToPath } from 'url'
5
5
 
6
- import { dirname, join, resolve } from 'path'
6
+ import { dirname, resolve } from 'path'
7
7
  import pc from 'picocolors'
8
8
  import cac from 'cac'
9
9
  import fse from 'fs-extra'
@@ -85,11 +85,11 @@ cli
85
85
  default: 'tsconfig.json',
86
86
  })
87
87
  .action(async (root, options) => {
88
- if (!root)
89
- root = ''
88
+ if (root)
89
+ process.chdir(root)
90
90
 
91
- const tsconfigPath = join(root, options.tsconfig)
92
- const psconfigPath = join(root, options.config)
91
+ const tsconfigPath = options.tsconfig
92
+ const psconfigPath = options.config
93
93
 
94
94
  if (!fse.existsSync(tsconfigPath)) {
95
95
  log(`create ${tsconfigPath}`)
@@ -116,7 +116,7 @@ cli
116
116
  .alias('run')
117
117
  .action((file, root, options) => {
118
118
  if (root)
119
- process.env.PS_WORKDIR = root
119
+ process.chdir(root)
120
120
  process.env.PS_CONFIG_FILE = options.config
121
121
 
122
122
  log('process start!')
@@ -124,6 +124,7 @@ cli
124
124
  startChild(file, options['--'])
125
125
  console.log(`${pc.green('->')} press ${pc.green('e')} to exit`)
126
126
  console.log(`${pc.green('->')} press ${pc.green('r')} to relaunch`)
127
+ console.log(`${pc.green('->')} press ${pc.green('c')} to clear terminal`)
127
128
 
128
129
  process.stdin.on('data', async (data) => {
129
130
  const input = data.toString().trim().toLocaleLowerCase()
@@ -154,7 +155,7 @@ cli
154
155
  .allowUnknownOptions()
155
156
  .action((file, root, options) => {
156
157
  if (root)
157
- process.env.PS_WORKDIR = root
158
+ process.chdir(root)
158
159
  process.env.PS_GENERATE = 'true'
159
160
  process.env.PS_CONFIG_FILE = options.config
160
161
  startChild(file, options['--'])
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkJ5CFUN4Vjs = require('./chunk-J5CFUN4V.js');
8
+ var _chunkRQSQRZL4js = require('./chunk-RQSQRZL4.js');
9
9
 
10
10
  // src/helper.ts
11
11
  var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
@@ -15,14 +15,14 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
15
15
 
16
16
 
17
17
  // src/pipe.ts
18
- var defaultPipe = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, ({ arg }) => {
18
+ var defaultPipe = /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, ({ arg }) => {
19
19
  return arg;
20
20
  }, "defaultPipe");
21
21
 
22
22
  // src/exception/base.ts
23
23
  var Exception = class extends Error {
24
24
  static {
25
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "Exception");
25
+ _chunkRQSQRZL4js.__name.call(void 0, this, "Exception");
26
26
  }
27
27
 
28
28
 
@@ -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
- [_chunkJ5CFUN4Vjs.ERROR_SYMBOL]: true
38
+ [_chunkRQSQRZL4js.ERROR_SYMBOL]: true
39
39
  };
40
40
  }
41
41
  };
@@ -43,7 +43,7 @@ var Exception = class extends Error {
43
43
  // src/exception/undefine.ts
44
44
  var UndefinedException = class extends Exception {
45
45
  static {
46
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "UndefinedException");
46
+ _chunkRQSQRZL4js.__name.call(void 0, this, "UndefinedException");
47
47
  }
48
48
  constructor(message) {
49
49
  super(message, 500, "Undefined error");
@@ -53,7 +53,7 @@ var UndefinedException = class extends Exception {
53
53
  // src/exception/validate.ts
54
54
  var ValidateException = class extends Exception {
55
55
  static {
56
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "ValidateException");
56
+ _chunkRQSQRZL4js.__name.call(void 0, this, "ValidateException");
57
57
  }
58
58
  constructor(message) {
59
59
  super(message, 400, "Validate exception");
@@ -63,7 +63,7 @@ var ValidateException = class extends Exception {
63
63
  // src/exception/forbidden.ts
64
64
  var ForbiddenException = class extends Exception {
65
65
  static {
66
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "ForbiddenException");
66
+ _chunkRQSQRZL4js.__name.call(void 0, this, "ForbiddenException");
67
67
  }
68
68
  constructor(message) {
69
69
  super(message, 403, "Forbidden resource");
@@ -73,7 +73,7 @@ var ForbiddenException = class extends Exception {
73
73
  // src/exception/bad-request.ts
74
74
  var BadRequestException = class extends Exception {
75
75
  static {
76
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "BadRequestException");
76
+ _chunkRQSQRZL4js.__name.call(void 0, this, "BadRequestException");
77
77
  }
78
78
  constructor(message) {
79
79
  super(message, 400, "Bad Request");
@@ -83,7 +83,7 @@ var BadRequestException = class extends Exception {
83
83
  // src/exception/not-found.ts
84
84
  var NotFoundException = class extends Exception {
85
85
  static {
86
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "NotFoundException");
86
+ _chunkRQSQRZL4js.__name.call(void 0, this, "NotFoundException");
87
87
  }
88
88
  constructor(message) {
89
89
  super(message, 404, "Not Found");
@@ -93,7 +93,7 @@ var NotFoundException = class extends Exception {
93
93
  // src/exception/conflict.ts
94
94
  var ConflictException = class extends Exception {
95
95
  static {
96
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "ConflictException");
96
+ _chunkRQSQRZL4js.__name.call(void 0, this, "ConflictException");
97
97
  }
98
98
  constructor(message) {
99
99
  super(message, 409, "Conflict");
@@ -103,7 +103,7 @@ var ConflictException = class extends Exception {
103
103
  // src/exception/bad-gateway.ts
104
104
  var BadGatewayException = class extends Exception {
105
105
  static {
106
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "BadGatewayException");
106
+ _chunkRQSQRZL4js.__name.call(void 0, this, "BadGatewayException");
107
107
  }
108
108
  constructor(message) {
109
109
  super(message, 502, "Bad Gatrway");
@@ -113,7 +113,7 @@ var BadGatewayException = class extends Exception {
113
113
  // src/exception/invalid-input.ts
114
114
  var InvalidInputException = class extends Exception {
115
115
  static {
116
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "InvalidInputException");
116
+ _chunkRQSQRZL4js.__name.call(void 0, this, "InvalidInputException");
117
117
  }
118
118
  constructor(message) {
119
119
  super(message, 502, "Invalid Input");
@@ -123,7 +123,7 @@ var InvalidInputException = class extends Exception {
123
123
  // src/exception/media-type.ts
124
124
  var UnsupportedMediaTypeException = class extends Exception {
125
125
  static {
126
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "UnsupportedMediaTypeException");
126
+ _chunkRQSQRZL4js.__name.call(void 0, this, "UnsupportedMediaTypeException");
127
127
  }
128
128
  constructor(message) {
129
129
  super(message, 415, "Unsupported Media Type");
@@ -133,7 +133,7 @@ var UnsupportedMediaTypeException = class extends Exception {
133
133
  // src/exception/payload-large.ts
134
134
  var PayloadLargeException = class extends Exception {
135
135
  static {
136
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "PayloadLargeException");
136
+ _chunkRQSQRZL4js.__name.call(void 0, this, "PayloadLargeException");
137
137
  }
138
138
  constructor(message) {
139
139
  super(message, 413, "Payload Too Large");
@@ -143,7 +143,7 @@ var PayloadLargeException = class extends Exception {
143
143
  // src/exception/timeout.ts
144
144
  var TimeoutException = class extends Exception {
145
145
  static {
146
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "TimeoutException");
146
+ _chunkRQSQRZL4js.__name.call(void 0, this, "TimeoutException");
147
147
  }
148
148
  constructor(message) {
149
149
  super(message, 408, "Request Timeout");
@@ -153,7 +153,7 @@ var TimeoutException = class extends Exception {
153
153
  // src/exception/unauthorized.ts
154
154
  var UnauthorizedException = class extends Exception {
155
155
  static {
156
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "UnauthorizedException");
156
+ _chunkRQSQRZL4js.__name.call(void 0, this, "UnauthorizedException");
157
157
  }
158
158
  constructor(message) {
159
159
  super(message, 401, "Unauthorized");
@@ -163,7 +163,7 @@ var UnauthorizedException = class extends Exception {
163
163
  // src/exception/unavailable-service.ts
164
164
  var ServiceUnavailableException = class extends Exception {
165
165
  static {
166
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "ServiceUnavailableException");
166
+ _chunkRQSQRZL4js.__name.call(void 0, this, "ServiceUnavailableException");
167
167
  }
168
168
  constructor(message) {
169
169
  super(message, 503, "Service Unavailable");
@@ -173,7 +173,7 @@ var ServiceUnavailableException = class extends Exception {
173
173
  // src/exception/framework.ts
174
174
  var FrameworkException = class extends Exception {
175
175
  static {
176
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "FrameworkException");
176
+ _chunkRQSQRZL4js.__name.call(void 0, this, "FrameworkException");
177
177
  }
178
178
  constructor(message) {
179
179
  super(`[phecda-server] ${message}`, 500, "Framework Error");
@@ -183,7 +183,7 @@ var FrameworkException = class extends Exception {
183
183
  // src/exception/timer.ts
184
184
  var TimerException = class extends Exception {
185
185
  static {
186
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "TimerException");
186
+ _chunkRQSQRZL4js.__name.call(void 0, this, "TimerException");
187
187
  }
188
188
  constructor(message) {
189
189
  super(message, 0, "Timer Error");
@@ -193,7 +193,7 @@ var TimerException = class extends Exception {
193
193
  // src/exception/worker.ts
194
194
  var WorkerException = class extends Exception {
195
195
  static {
196
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "WorkerException");
196
+ _chunkRQSQRZL4js.__name.call(void 0, this, "WorkerException");
197
197
  }
198
198
  constructor(message) {
199
199
  super(message, 0, "Worker Error");
@@ -201,14 +201,14 @@ var WorkerException = class extends Exception {
201
201
  };
202
202
 
203
203
  // src/filter.ts
204
- var defaultFilter = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (e) => {
204
+ var defaultFilter = /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (e) => {
205
205
  if (!(e instanceof Exception)) {
206
- _chunkJ5CFUN4Vjs.log.call(void 0, e.message, "error");
207
- if (_chunkJ5CFUN4Vjs.LOG_LEVEL <= 0) console.error(e.stack);
206
+ _chunkRQSQRZL4js.log.call(void 0, e.message, "error");
207
+ if (_chunkRQSQRZL4js.LOG_LEVEL <= 0) console.error(e.stack);
208
208
  e = new UndefinedException(e.message || e);
209
209
  } else {
210
- _chunkJ5CFUN4Vjs.log.call(void 0, `[${e.constructor.name}] ${e.message}`, "error");
211
- if (_chunkJ5CFUN4Vjs.LOG_LEVEL <= 0) console.error(e.stack);
210
+ _chunkRQSQRZL4js.log.call(void 0, `[${e.constructor.name}] ${e.message}`, "error");
211
+ if (_chunkRQSQRZL4js.LOG_LEVEL <= 0) console.error(e.stack);
212
212
  }
213
213
  return e.data;
214
214
  }, "defaultFilter");
@@ -217,7 +217,7 @@ var defaultFilter = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (e) =>
217
217
  var debug = _debug2.default.call(void 0, "phecda-server(Context)");
218
218
  var Context = (_class = class _Context {
219
219
  static {
220
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "Context");
220
+ _chunkRQSQRZL4js.__name.call(void 0, this, "Context");
221
221
  }
222
222
 
223
223
 
@@ -232,7 +232,7 @@ var Context = (_class = class _Context {
232
232
  static __initStatic4() {this.addonRecord = {}}
233
233
  constructor(data) {
234
234
  this.data = data;
235
- if (_chunkJ5CFUN4Vjs.IS_HMR)
235
+ if (_chunkRQSQRZL4js.IS_HMR)
236
236
  data._context = this;
237
237
  }
238
238
  static getAop(meta, opts) {
@@ -264,7 +264,7 @@ ${_picocolors2.default.red(`Filter ${filter2}[${filter2 || "default"}]`)}`);
264
264
  const { paramsType, data: { ctxs, tag, params, func } } = meta;
265
265
  try {
266
266
  let res;
267
- const nextHandler = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (index) => {
267
+ const nextHandler = /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (index) => {
268
268
  return async () => {
269
269
  if (index === guards.length) {
270
270
  const instance = moduleMap.get(tag);
@@ -288,7 +288,7 @@ ${_picocolors2.default.red(`Filter ${filter2}[${filter2 || "default"}]`)}`);
288
288
  return res;
289
289
  });
290
290
  }
291
- _chunkJ5CFUN4Vjs.__name.call(void 0, next, "next");
291
+ _chunkRQSQRZL4js.__name.call(void 0, next, "next");
292
292
  const ret = await guards[index](this.data, next);
293
293
  if (ret !== void 0) {
294
294
  res = ret;
@@ -333,12 +333,12 @@ function addPipe(key, pipe) {
333
333
  if (Context.pipeRecord[key] && Context.pipeRecord[key] !== pipe) debug(`overwrite Pipe "${String(key)}"`, "warn");
334
334
  Context.pipeRecord[key] = pipe;
335
335
  }
336
- _chunkJ5CFUN4Vjs.__name.call(void 0, addPipe, "addPipe");
336
+ _chunkRQSQRZL4js.__name.call(void 0, addPipe, "addPipe");
337
337
  function addFilter(key, filter) {
338
338
  if (Context.filterRecord[key] && Context.filterRecord[key] !== filter) debug(`overwrite Filter "${String(key)}"`, "warn");
339
339
  Context.filterRecord[key] = filter;
340
340
  }
341
- _chunkJ5CFUN4Vjs.__name.call(void 0, addFilter, "addFilter");
341
+ _chunkRQSQRZL4js.__name.call(void 0, addFilter, "addFilter");
342
342
  function addGuard(key, guard, priority = 0) {
343
343
  if (Context.guardRecord[key] && Context.guardRecord[key].value !== guard) debug(`overwrite Guard "${String(key)}"`, "warn");
344
344
  Context.guardRecord[key] = {
@@ -346,7 +346,7 @@ function addGuard(key, guard, priority = 0) {
346
346
  priority
347
347
  };
348
348
  }
349
- _chunkJ5CFUN4Vjs.__name.call(void 0, addGuard, "addGuard");
349
+ _chunkRQSQRZL4js.__name.call(void 0, addGuard, "addGuard");
350
350
  function addAddon(key, addon, priority = 0) {
351
351
  if (Context.addonRecord[key] && Context.addonRecord[key].value !== addon) debug(`overwrite Addon "${String(key)}"`, "warn");
352
352
  Context.addonRecord[key] = {
@@ -354,20 +354,20 @@ function addAddon(key, addon, priority = 0) {
354
354
  priority
355
355
  };
356
356
  }
357
- _chunkJ5CFUN4Vjs.__name.call(void 0, addAddon, "addAddon");
357
+ _chunkRQSQRZL4js.__name.call(void 0, addAddon, "addAddon");
358
358
 
359
359
  // src/hmr.ts
360
360
  function HMR(cb) {
361
- if (_chunkJ5CFUN4Vjs.IS_HMR) _optionalChain([globalThis, 'access', _ => _.__PS_HMR__, 'optionalAccess', _2 => _2.push, 'call', _3 => _3(cb)]);
361
+ if (_chunkRQSQRZL4js.IS_HMR) _optionalChain([globalThis, 'access', _ => _.__PS_HMR__, 'optionalAccess', _2 => _2.push, 'call', _3 => _3(cb)]);
362
362
  }
363
- _chunkJ5CFUN4Vjs.__name.call(void 0, HMR, "HMR");
363
+ _chunkRQSQRZL4js.__name.call(void 0, HMR, "HMR");
364
364
 
365
365
  // src/http/helper.ts
366
366
  function resolveDep(ret, key) {
367
367
  if (key) return _optionalChain([ret, 'optionalAccess', _4 => _4[key]]);
368
368
  return ret;
369
369
  }
370
- _chunkJ5CFUN4Vjs.__name.call(void 0, resolveDep, "resolveDep");
370
+ _chunkRQSQRZL4js.__name.call(void 0, resolveDep, "resolveDep");
371
371
  function argToReq(params, args, headers) {
372
372
  const req = {
373
373
  body: {},
@@ -381,14 +381,14 @@ function argToReq(params, args, headers) {
381
381
  });
382
382
  return req;
383
383
  }
384
- _chunkJ5CFUN4Vjs.__name.call(void 0, argToReq, "argToReq");
384
+ _chunkRQSQRZL4js.__name.call(void 0, argToReq, "argToReq");
385
385
 
386
386
  // src/rpc/helper.ts
387
387
  var _os = require('os');
388
388
  function genClientQueue(key) {
389
389
  return `PS-${key ? `${key}-` : ""}${_os.hostname.call(void 0, )}-${process.pid}`;
390
390
  }
391
- _chunkJ5CFUN4Vjs.__name.call(void 0, genClientQueue, "genClientQueue");
391
+ _chunkRQSQRZL4js.__name.call(void 0, genClientQueue, "genClientQueue");
392
392
 
393
393
  // src/decorators/helper.ts
394
394
  function shallowClone(obj) {
@@ -396,11 +396,11 @@ function shallowClone(obj) {
396
396
  ...obj
397
397
  };
398
398
  }
399
- _chunkJ5CFUN4Vjs.__name.call(void 0, shallowClone, "shallowClone");
399
+ _chunkRQSQRZL4js.__name.call(void 0, shallowClone, "shallowClone");
400
400
  function mergeObject(...args) {
401
401
  return Object.assign({}, ...args);
402
402
  }
403
- _chunkJ5CFUN4Vjs.__name.call(void 0, mergeObject, "mergeObject");
403
+ _chunkRQSQRZL4js.__name.call(void 0, mergeObject, "mergeObject");
404
404
 
405
405
  // src/helper.ts
406
406
  function createControllerMetaMap(meta, filter) {
@@ -416,12 +416,12 @@ function createControllerMetaMap(meta, filter) {
416
416
  });
417
417
  }
418
418
  }
419
- _chunkJ5CFUN4Vjs.__name.call(void 0, handleMeta, "handleMeta");
419
+ _chunkRQSQRZL4js.__name.call(void 0, handleMeta, "handleMeta");
420
420
  handleMeta();
421
421
  HMR(handleMeta);
422
422
  return metaMap;
423
423
  }
424
- _chunkJ5CFUN4Vjs.__name.call(void 0, createControllerMetaMap, "createControllerMetaMap");
424
+ _chunkRQSQRZL4js.__name.call(void 0, createControllerMetaMap, "createControllerMetaMap");
425
425
  function detectAopDep(meta, { guards, addons } = {}, controller = "http") {
426
426
  const addonSet = /* @__PURE__ */ new Set();
427
427
  const guardSet = /* @__PURE__ */ new Set();
@@ -442,7 +442,7 @@ function detectAopDep(meta, { guards, addons } = {}, controller = "http") {
442
442
  })]);
443
443
  meta.forEach(({ data }) => {
444
444
  if (data.controller !== controller) {
445
- if (data[controller]) warningSet.add(`Should use ${controller} controller to decorate class "${data.name}" or method "${data.func}"`);
445
+ if (data[controller]) warningSet.add(`Should use ${controller} controller to decorate class "${data.name}"`);
446
446
  return;
447
447
  }
448
448
  if (data.filter) filterSet.add(data.filter);
@@ -465,29 +465,29 @@ function detectAopDep(meta, { guards, addons } = {}, controller = "http") {
465
465
  ...filterSet
466
466
  ].filter((i) => !Context.filterRecord[i]);
467
467
  function exit() {
468
- if (_chunkJ5CFUN4Vjs.IS_STRICT) process.exit(5);
468
+ if (_chunkRQSQRZL4js.IS_STRICT) process.exit(5);
469
469
  }
470
- _chunkJ5CFUN4Vjs.__name.call(void 0, exit, "exit");
470
+ _chunkRQSQRZL4js.__name.call(void 0, exit, "exit");
471
471
  if (missAddons.length) {
472
- _chunkJ5CFUN4Vjs.log.call(void 0, `${_picocolors2.default.white(`Addon [${missAddons.join(",")}]`)} doesn't exist`, "warn");
472
+ _chunkRQSQRZL4js.log.call(void 0, `${_picocolors2.default.white(`Addon [${missAddons.join(",")}]`)} doesn't exist`, "warn");
473
473
  exit();
474
474
  }
475
475
  if (missGuards.length) {
476
- _chunkJ5CFUN4Vjs.log.call(void 0, `${_picocolors2.default.magenta(`Guard [${missGuards.join(",")}]`)} doesn't exist`, "warn");
476
+ _chunkRQSQRZL4js.log.call(void 0, `${_picocolors2.default.magenta(`Guard [${missGuards.join(",")}]`)} doesn't exist`, "warn");
477
477
  exit();
478
478
  }
479
479
  if (missPipes.length) {
480
- _chunkJ5CFUN4Vjs.log.call(void 0, `${_picocolors2.default.blue(`Pipe [${missPipes.join(",")}]`)} doesn't exist`, "warn");
480
+ _chunkRQSQRZL4js.log.call(void 0, `${_picocolors2.default.blue(`Pipe [${missPipes.join(",")}]`)} doesn't exist`, "warn");
481
481
  exit();
482
482
  }
483
483
  if (missFilters.length) {
484
- _chunkJ5CFUN4Vjs.log.call(void 0, `${_picocolors2.default.red(`Filter [${missFilters.join(",")}]`)} doesn't exist`, "warn");
484
+ _chunkRQSQRZL4js.log.call(void 0, `${_picocolors2.default.red(`Filter [${missFilters.join(",")}]`)} doesn't exist`, "warn");
485
485
  exit();
486
486
  }
487
- warningSet.forEach((warn) => _chunkJ5CFUN4Vjs.log.call(void 0, warn, "warn"));
487
+ warningSet.forEach((warn) => _chunkRQSQRZL4js.log.call(void 0, warn, "warn"));
488
488
  if (warningSet.size) exit();
489
489
  }
490
- _chunkJ5CFUN4Vjs.__name.call(void 0, handleMeta, "handleMeta");
490
+ _chunkRQSQRZL4js.__name.call(void 0, handleMeta, "handleMeta");
491
491
  handleMeta();
492
492
  HMR(handleMeta);
493
493
  return {
@@ -497,7 +497,7 @@ function detectAopDep(meta, { guards, addons } = {}, controller = "http") {
497
497
  filterSet
498
498
  };
499
499
  }
500
- _chunkJ5CFUN4Vjs.__name.call(void 0, detectAopDep, "detectAopDep");
500
+ _chunkRQSQRZL4js.__name.call(void 0, detectAopDep, "detectAopDep");
501
501
 
502
502
 
503
503
 
@@ -3,7 +3,7 @@ import {
3
3
  IS_ONLY_GENERATE,
4
4
  __name,
5
5
  log
6
- } from "./chunk-WHJ5FALK.mjs";
6
+ } from "./chunk-QD3QR3NW.mjs";
7
7
 
8
8
  // src/meta.ts
9
9
  var Meta = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __name
3
- } from "./chunk-WHJ5FALK.mjs";
3
+ } from "./chunk-QD3QR3NW.mjs";
4
4
 
5
5
  // src/decorators/param.ts
6
6
  import { setMeta } from "phecda-core";
@@ -5,7 +5,7 @@ import {
5
5
  LOG_LEVEL,
6
6
  __name,
7
7
  log
8
- } from "./chunk-WHJ5FALK.mjs";
8
+ } from "./chunk-QD3QR3NW.mjs";
9
9
 
10
10
  // src/helper.ts
11
11
  import pc2 from "picocolors";
@@ -442,7 +442,7 @@ function detectAopDep(meta, { guards, addons } = {}, controller = "http") {
442
442
  });
443
443
  meta.forEach(({ data }) => {
444
444
  if (data.controller !== controller) {
445
- if (data[controller]) warningSet.add(`Should use ${controller} controller to decorate class "${data.name}" or method "${data.func}"`);
445
+ if (data[controller]) warningSet.add(`Should use ${controller} controller to decorate class "${data.name}"`);
446
446
  return;
447
447
  }
448
448
  if (data.filter) filterSet.add(data.filter);
@@ -3,12 +3,12 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkJ5CFUN4Vjs = require('./chunk-J5CFUN4V.js');
6
+ var _chunkRQSQRZL4js = require('./chunk-RQSQRZL4.js');
7
7
 
8
8
  // src/meta.ts
9
9
  var Meta = class {
10
10
  static {
11
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "Meta");
11
+ _chunkRQSQRZL4js.__name.call(void 0, this, "Meta");
12
12
  }
13
13
 
14
14
 
@@ -37,11 +37,11 @@ function defaultServerInject() {
37
37
  });
38
38
  }
39
39
  }
40
- _chunkJ5CFUN4Vjs.__name.call(void 0, defaultServerInject, "defaultServerInject");
40
+ _chunkRQSQRZL4js.__name.call(void 0, defaultServerInject, "defaultServerInject");
41
41
  var phecdaNamespace = /* @__PURE__ */ new Map();
42
42
  var ServerPhecda = (_class = class {
43
43
  static {
44
- _chunkJ5CFUN4Vjs.__name.call(void 0, this, "ServerPhecda");
44
+ _chunkRQSQRZL4js.__name.call(void 0, this, "ServerPhecda");
45
45
  }
46
46
  __init() {this.moduleMap = /* @__PURE__ */ new Map()}
47
47
  __init2() {this.meta = []}
@@ -53,7 +53,7 @@ var ServerPhecda = (_class = class {
53
53
 
54
54
  constructor(options) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);
55
55
  defaultServerInject();
56
- const { namespace = "default", parseModule = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (module) => module, "parseModule"), parseMeta = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, (meta) => meta, "parseMeta"), generators = [] } = options;
56
+ const { namespace = "default", parseModule = /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (module) => module, "parseModule"), parseMeta = /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (meta) => meta, "parseMeta"), generators = [] } = options;
57
57
  phecdaNamespace.set(namespace, this);
58
58
  this.parseMeta = parseMeta;
59
59
  this.parseModule = parseModule;
@@ -61,8 +61,8 @@ var ServerPhecda = (_class = class {
61
61
  }
62
62
  async start(models) {
63
63
  for (const model of models) await this.buildDepModule(model);
64
- const generateCode = /* @__PURE__ */ _chunkJ5CFUN4Vjs.__name.call(void 0, async () => {
65
- if (_chunkJ5CFUN4Vjs.IS_HMR) {
64
+ const generateCode = /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, async () => {
65
+ if (_chunkRQSQRZL4js.IS_HMR) {
66
66
  return Promise.all(this.generators.map((generator) => {
67
67
  debug(`generate "${generator.name}" code to ${generator.path}`);
68
68
  return generator.output(this.meta);
@@ -70,9 +70,9 @@ var ServerPhecda = (_class = class {
70
70
  }
71
71
  }, "generateCode");
72
72
  generateCode().then(() => {
73
- if (_chunkJ5CFUN4Vjs.IS_ONLY_GENERATE) process.exit(4);
73
+ if (_chunkRQSQRZL4js.IS_ONLY_GENERATE) process.exit(4);
74
74
  });
75
- if (_chunkJ5CFUN4Vjs.IS_HMR) {
75
+ if (_chunkRQSQRZL4js.IS_HMR) {
76
76
  if (!globalThis.__PS_HMR__) globalThis.__PS_HMR__ = [];
77
77
  _optionalChain([globalThis, 'access', _2 => _2.__PS_HMR__, 'optionalAccess', _3 => _3.push, 'call', _4 => _4(async (files) => {
78
78
  debug("reload files ");
@@ -128,8 +128,8 @@ var ServerPhecda = (_class = class {
128
128
  if (!module) throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Model}`);
129
129
  if (this.modelMap.get(module) !== Model && !this.modelSet.has(Model)) {
130
130
  this.modelSet.add(Model);
131
- if (module instanceof Model) _chunkJ5CFUN4Vjs.log.call(void 0, `Module taged ${String(tag)} has been overridden`);
132
- else _chunkJ5CFUN4Vjs.log.call(void 0, `Synonym module: Module taged "${String(tag)}" has been loaded before, so phecda-server won't load Module "${Model.name}"`, "warn");
131
+ if (module instanceof Model) _chunkRQSQRZL4js.log.call(void 0, `Module taged ${String(tag)} has been overridden`);
132
+ else _chunkRQSQRZL4js.log.call(void 0, `Synonym module: Module taged "${String(tag)}" has been loaded before, so phecda-server won't load Module "${Model.name}"`, "warn");
133
133
  }
134
134
  return {
135
135
  module,
@@ -152,7 +152,7 @@ var ServerPhecda = (_class = class {
152
152
  }
153
153
  this.meta.push(...getMetaFromInstance(module, tag, Model.name).map(this.parseMeta).filter((item) => !!item));
154
154
  debug(`init module "${String(tag)}"`);
155
- if (!_chunkJ5CFUN4Vjs.IS_ONLY_GENERATE) await _phecdacore.invokeInit.call(void 0, module);
155
+ if (!_chunkRQSQRZL4js.IS_ONLY_GENERATE) await _phecdacore.invokeInit.call(void 0, module);
156
156
  debug(`add module "${String(tag)}"`);
157
157
  this.moduleMap.set(tag, module);
158
158
  this.modelMap.set(module, Model);
@@ -175,7 +175,7 @@ async function Factory(models, opts = {}) {
175
175
  await phecda.start(models);
176
176
  return phecda;
177
177
  }
178
- _chunkJ5CFUN4Vjs.__name.call(void 0, Factory, "Factory");
178
+ _chunkRQSQRZL4js.__name.call(void 0, Factory, "Factory");
179
179
  function useS(nsOrModel, namespace) {
180
180
  if (!nsOrModel) {
181
181
  namespace = "default";
@@ -188,7 +188,7 @@ function useS(nsOrModel, namespace) {
188
188
  if (nsOrModel && typeof nsOrModel !== "string") return serverPhecda.get(nsOrModel);
189
189
  else return serverPhecda;
190
190
  }
191
- _chunkJ5CFUN4Vjs.__name.call(void 0, useS, "useS");
191
+ _chunkRQSQRZL4js.__name.call(void 0, useS, "useS");
192
192
  function getMetaFromInstance(instance, tag, name) {
193
193
  const propertyKeys = _phecdacore.getMetaKey.call(void 0, instance).filter((item) => typeof item === "string");
194
194
  const baseMeta = _phecdacore.getMergedMeta.call(void 0, instance, void 0);
@@ -202,7 +202,7 @@ function getMetaFromInstance(instance, tag, name) {
202
202
  func: i
203
203
  };
204
204
  if (baseMeta.controller) {
205
- if (typeof tag !== "string") _chunkJ5CFUN4Vjs.log.call(void 0, `can't use Tag with ${typeof tag} on controller "${instance.constructor.name}",instead with "${tag = String(tag)}"`, "error");
205
+ if (typeof tag !== "string") _chunkRQSQRZL4js.log.call(void 0, `can't use Tag with ${typeof tag} on controller "${instance.constructor.name}",instead with "${tag = String(tag)}"`, "error");
206
206
  metaData.controller = baseMeta.controller;
207
207
  metaData[baseMeta.controller] = {
208
208
  ...baseMeta[baseMeta.controller],
@@ -240,7 +240,7 @@ function getMetaFromInstance(instance, tag, name) {
240
240
  return new Meta(deepFreeze(metaData), getParamTypes(instance, i) || []);
241
241
  });
242
242
  }
243
- _chunkJ5CFUN4Vjs.__name.call(void 0, getMetaFromInstance, "getMetaFromInstance");
243
+ _chunkRQSQRZL4js.__name.call(void 0, getMetaFromInstance, "getMetaFromInstance");
244
244
  function deepFreeze(object) {
245
245
  Object.freeze(object);
246
246
  Object.getOwnPropertyNames(object).forEach((prop) => {
@@ -248,11 +248,11 @@ function deepFreeze(object) {
248
248
  });
249
249
  return object;
250
250
  }
251
- _chunkJ5CFUN4Vjs.__name.call(void 0, deepFreeze, "deepFreeze");
251
+ _chunkRQSQRZL4js.__name.call(void 0, deepFreeze, "deepFreeze");
252
252
  function getParamTypes(Model, key) {
253
253
  return Reflect.getMetadata("design:paramtypes", Model, key);
254
254
  }
255
- _chunkJ5CFUN4Vjs.__name.call(void 0, getParamTypes, "getParamTypes");
255
+ _chunkRQSQRZL4js.__name.call(void 0, getParamTypes, "getParamTypes");
256
256
 
257
257
 
258
258