phecda-server 7.0.0-alpha.11 → 7.0.0-alpha.12

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 (72) hide show
  1. package/dist/{chunk-G7JFKM2M.js → chunk-IJFIY6QN.js} +1 -9
  2. package/dist/{chunk-Z7NAAE4M.mjs → chunk-VX4BZEL7.mjs} +0 -8
  3. package/dist/{core-CUTbX_IS.d.ts → core-CDzIy2g0.d.ts} +1 -1
  4. package/dist/{core-DIfgUKIU.d.mts → core-jUg1HvYT.d.mts} +1 -1
  5. package/dist/helper.d.mts +2 -4
  6. package/dist/helper.d.ts +2 -4
  7. package/dist/helper.js +2 -4
  8. package/dist/helper.mjs +1 -3
  9. package/dist/http/elysia/index.d.mts +3 -3
  10. package/dist/http/elysia/index.d.ts +3 -3
  11. package/dist/http/elysia/index.js +18 -17
  12. package/dist/http/elysia/index.mjs +2 -1
  13. package/dist/http/express/index.d.mts +3 -3
  14. package/dist/http/express/index.d.ts +3 -3
  15. package/dist/http/express/index.js +17 -16
  16. package/dist/http/express/index.mjs +2 -1
  17. package/dist/http/fastify/index.d.mts +3 -3
  18. package/dist/http/fastify/index.d.ts +3 -3
  19. package/dist/http/fastify/index.js +17 -16
  20. package/dist/http/fastify/index.mjs +2 -1
  21. package/dist/http/h3/index.d.mts +3 -3
  22. package/dist/http/h3/index.d.ts +3 -3
  23. package/dist/http/h3/index.js +18 -17
  24. package/dist/http/h3/index.mjs +2 -1
  25. package/dist/http/hono/index.d.mts +3 -3
  26. package/dist/http/hono/index.d.ts +3 -3
  27. package/dist/http/hono/index.js +15 -14
  28. package/dist/http/hono/index.mjs +2 -1
  29. package/dist/http/hyper-express/index.d.mts +3 -3
  30. package/dist/http/hyper-express/index.d.ts +3 -3
  31. package/dist/http/hyper-express/index.js +16 -15
  32. package/dist/http/hyper-express/index.mjs +2 -1
  33. package/dist/http/koa/index.d.mts +3 -3
  34. package/dist/http/koa/index.d.ts +3 -3
  35. package/dist/http/koa/index.js +17 -16
  36. package/dist/http/koa/index.mjs +2 -1
  37. package/dist/index.d.mts +8 -8
  38. package/dist/index.d.ts +8 -8
  39. package/dist/index.js +19 -19
  40. package/dist/index.mjs +1 -1
  41. package/dist/{meta-CR-D39hQ.d.mts → meta-xvg6V7pH.d.mts} +2 -19
  42. package/dist/{meta-CR-D39hQ.d.ts → meta-xvg6V7pH.d.ts} +2 -19
  43. package/dist/rpc/bullmq/index.d.mts +4 -6
  44. package/dist/rpc/bullmq/index.d.ts +4 -6
  45. package/dist/rpc/bullmq/index.js +7 -75
  46. package/dist/rpc/bullmq/index.mjs +3 -71
  47. package/dist/rpc/kafka/index.d.mts +4 -9
  48. package/dist/rpc/kafka/index.d.ts +4 -9
  49. package/dist/rpc/kafka/index.js +7 -86
  50. package/dist/rpc/kafka/index.mjs +3 -82
  51. package/dist/rpc/nats/index.d.mts +4 -6
  52. package/dist/rpc/nats/index.d.ts +4 -6
  53. package/dist/rpc/nats/index.js +7 -67
  54. package/dist/rpc/nats/index.mjs +2 -62
  55. package/dist/rpc/rabbitmq/index.d.mts +4 -6
  56. package/dist/rpc/rabbitmq/index.d.ts +4 -6
  57. package/dist/rpc/rabbitmq/index.js +7 -73
  58. package/dist/rpc/rabbitmq/index.mjs +3 -69
  59. package/dist/rpc/redis/index.d.mts +4 -9
  60. package/dist/rpc/redis/index.d.ts +4 -9
  61. package/dist/rpc/redis/index.js +7 -74
  62. package/dist/rpc/redis/index.mjs +3 -70
  63. package/dist/test.d.mts +7 -3
  64. package/dist/test.d.ts +7 -3
  65. package/dist/types-6qaaUIKZ.d.mts +14 -0
  66. package/dist/{types-BF1TDbFV.d.ts → types-B-1OL-3P.d.ts} +1 -1
  67. package/dist/types-BtXOT5rI.d.ts +14 -0
  68. package/dist/{types-DYviSl5B.d.mts → types-Ctd6pLNE.d.mts} +1 -1
  69. package/package.json +1 -1
  70. package/register/loader.mjs +0 -9
  71. package/dist/types-DYRu0vic.d.ts +0 -19
  72. package/dist/types-DqH1qA-q.d.mts +0 -19
@@ -386,13 +386,6 @@ function resolveDep(ret, key) {
386
386
  }
387
387
  _chunk4LLLQOMFjs.__name.call(void 0, resolveDep, "resolveDep");
388
388
 
389
- // src/rpc/helper.ts
390
- var _os = require('os');
391
- function genClientQueue(key) {
392
- return `PS-${key ? `${key}-` : ""}${_os.hostname.call(void 0, )}-${process.pid}`;
393
- }
394
- _chunk4LLLQOMFjs.__name.call(void 0, genClientQueue, "genClientQueue");
395
-
396
389
  // src/decorators/helper.ts
397
390
  function shallowClone(obj) {
398
391
  return {
@@ -546,5 +539,4 @@ _chunk4LLLQOMFjs.__name.call(void 0, joinUrl, "joinUrl");
546
539
 
547
540
 
548
541
 
549
-
550
- exports.defaultPipe = defaultPipe; exports.Exception = Exception; exports.UndefinedException = UndefinedException; exports.ValidateException = ValidateException; exports.ForbiddenException = ForbiddenException; exports.BadRequestException = BadRequestException; exports.NotFoundException = NotFoundException; exports.ConflictException = ConflictException; exports.BadGatewayException = BadGatewayException; exports.InvalidInputException = InvalidInputException; exports.UnsupportedMediaTypeException = UnsupportedMediaTypeException; exports.PayloadLargeException = PayloadLargeException; exports.TimeoutException = TimeoutException; exports.UnauthorizedException = UnauthorizedException; exports.ServiceUnavailableException = ServiceUnavailableException; exports.FrameworkException = FrameworkException; exports.TimerException = TimerException; exports.WorkerException = WorkerException; exports.Context = Context; exports.addPipe = addPipe; exports.addFilter = addFilter; exports.addGuard = addGuard; exports.addAddon = addAddon; exports.resolveDep = resolveDep; exports.genClientQueue = genClientQueue; exports.shallowClone = shallowClone; exports.mergeObject = mergeObject; exports.createControllerMetaMap = createControllerMetaMap; exports.detectAopDep = detectAopDep; exports.joinUrl = joinUrl;
542
+ exports.defaultPipe = defaultPipe; exports.Exception = Exception; exports.UndefinedException = UndefinedException; exports.ValidateException = ValidateException; exports.ForbiddenException = ForbiddenException; exports.BadRequestException = BadRequestException; exports.NotFoundException = NotFoundException; exports.ConflictException = ConflictException; exports.BadGatewayException = BadGatewayException; exports.InvalidInputException = InvalidInputException; exports.UnsupportedMediaTypeException = UnsupportedMediaTypeException; exports.PayloadLargeException = PayloadLargeException; exports.TimeoutException = TimeoutException; exports.UnauthorizedException = UnauthorizedException; exports.ServiceUnavailableException = ServiceUnavailableException; exports.FrameworkException = FrameworkException; exports.TimerException = TimerException; exports.WorkerException = WorkerException; exports.Context = Context; exports.addPipe = addPipe; exports.addFilter = addFilter; exports.addGuard = addGuard; exports.addAddon = addAddon; exports.resolveDep = resolveDep; exports.shallowClone = shallowClone; exports.mergeObject = mergeObject; exports.createControllerMetaMap = createControllerMetaMap; exports.detectAopDep = detectAopDep; exports.joinUrl = joinUrl;
@@ -386,13 +386,6 @@ function resolveDep(ret, key) {
386
386
  }
387
387
  __name(resolveDep, "resolveDep");
388
388
 
389
- // src/rpc/helper.ts
390
- import { hostname } from "os";
391
- function genClientQueue(key) {
392
- return `PS-${key ? `${key}-` : ""}${hostname()}-${process.pid}`;
393
- }
394
- __name(genClientQueue, "genClientQueue");
395
-
396
389
  // src/decorators/helper.ts
397
390
  function shallowClone(obj) {
398
391
  return {
@@ -541,7 +534,6 @@ export {
541
534
  addGuard,
542
535
  addAddon,
543
536
  resolveDep,
544
- genClientQueue,
545
537
  shallowClone,
546
538
  mergeObject,
547
539
  createControllerMetaMap,
@@ -1,5 +1,5 @@
1
1
  import { Construct } from 'phecda-core';
2
- import { b as MetaData, M as Meta, E as Emitter } from './meta-CR-D39hQ.js';
2
+ import { b as MetaData, M as Meta, E as Emitter } from './meta-xvg6V7pH.js';
3
3
 
4
4
  declare abstract class Generator {
5
5
  private _path;
@@ -1,5 +1,5 @@
1
1
  import { Construct } from 'phecda-core';
2
- import { b as MetaData, M as Meta, E as Emitter } from './meta-CR-D39hQ.mjs';
2
+ import { b as MetaData, M as Meta, E as Emitter } from './meta-xvg6V7pH.mjs';
3
3
 
4
4
  declare abstract class Generator {
5
5
  private _path;
package/dist/helper.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Meta, C as ControllerMeta } from './meta-CR-D39hQ.mjs';
1
+ import { M as Meta, C as ControllerMeta } from './meta-xvg6V7pH.mjs';
2
2
  import { Construct } from 'phecda-core';
3
3
 
4
4
  declare function HMR(cb: (oldModels: Construct[], newModels: Construct[]) => any): void;
@@ -7,8 +7,6 @@ declare function RELAUNCH(): void;
7
7
 
8
8
  declare function resolveDep(ret: any, key: string): any;
9
9
 
10
- declare function genClientQueue(key?: string): string;
11
-
12
10
  declare function shallowClone(obj: any): any;
13
11
  declare function mergeObject(...args: any[]): any;
14
12
 
@@ -24,4 +22,4 @@ declare function detectAopDep(meta: Meta[], { guards, addons }?: {
24
22
  } | undefined;
25
23
  declare function joinUrl(base: string, ...paths: string[]): string;
26
24
 
27
- export { HMR, RELAUNCH, RELOAD, createControllerMetaMap, detectAopDep, genClientQueue, joinUrl, mergeObject, resolveDep, shallowClone };
25
+ export { HMR, RELAUNCH, RELOAD, createControllerMetaMap, detectAopDep, joinUrl, mergeObject, resolveDep, shallowClone };
package/dist/helper.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Meta, C as ControllerMeta } from './meta-CR-D39hQ.js';
1
+ import { M as Meta, C as ControllerMeta } from './meta-xvg6V7pH.js';
2
2
  import { Construct } from 'phecda-core';
3
3
 
4
4
  declare function HMR(cb: (oldModels: Construct[], newModels: Construct[]) => any): void;
@@ -7,8 +7,6 @@ declare function RELAUNCH(): void;
7
7
 
8
8
  declare function resolveDep(ret: any, key: string): any;
9
9
 
10
- declare function genClientQueue(key?: string): string;
11
-
12
10
  declare function shallowClone(obj: any): any;
13
11
  declare function mergeObject(...args: any[]): any;
14
12
 
@@ -24,4 +22,4 @@ declare function detectAopDep(meta: Meta[], { guards, addons }?: {
24
22
  } | undefined;
25
23
  declare function joinUrl(base: string, ...paths: string[]): string;
26
24
 
27
- export { HMR, RELAUNCH, RELOAD, createControllerMetaMap, detectAopDep, genClientQueue, joinUrl, mergeObject, resolveDep, shallowClone };
25
+ export { HMR, RELAUNCH, RELOAD, createControllerMetaMap, detectAopDep, joinUrl, mergeObject, resolveDep, shallowClone };
package/dist/helper.js CHANGED
@@ -5,8 +5,7 @@
5
5
 
6
6
 
7
7
 
8
-
9
- var _chunkG7JFKM2Mjs = require('./chunk-G7JFKM2M.js');
8
+ var _chunkIJFIY6QNjs = require('./chunk-IJFIY6QN.js');
10
9
 
11
10
 
12
11
 
@@ -22,5 +21,4 @@ var _chunk4LLLQOMFjs = require('./chunk-4LLLQOMF.js');
22
21
 
23
22
 
24
23
 
25
-
26
- exports.HMR = _chunk4LLLQOMFjs.HMR; exports.RELAUNCH = _chunk4LLLQOMFjs.RELAUNCH; exports.RELOAD = _chunk4LLLQOMFjs.RELOAD; exports.createControllerMetaMap = _chunkG7JFKM2Mjs.createControllerMetaMap; exports.detectAopDep = _chunkG7JFKM2Mjs.detectAopDep; exports.genClientQueue = _chunkG7JFKM2Mjs.genClientQueue; exports.joinUrl = _chunkG7JFKM2Mjs.joinUrl; exports.mergeObject = _chunkG7JFKM2Mjs.mergeObject; exports.resolveDep = _chunkG7JFKM2Mjs.resolveDep; exports.shallowClone = _chunkG7JFKM2Mjs.shallowClone;
24
+ exports.HMR = _chunk4LLLQOMFjs.HMR; exports.RELAUNCH = _chunk4LLLQOMFjs.RELAUNCH; exports.RELOAD = _chunk4LLLQOMFjs.RELOAD; exports.createControllerMetaMap = _chunkIJFIY6QNjs.createControllerMetaMap; exports.detectAopDep = _chunkIJFIY6QNjs.detectAopDep; exports.joinUrl = _chunkIJFIY6QNjs.joinUrl; exports.mergeObject = _chunkIJFIY6QNjs.mergeObject; exports.resolveDep = _chunkIJFIY6QNjs.resolveDep; exports.shallowClone = _chunkIJFIY6QNjs.shallowClone;
package/dist/helper.mjs CHANGED
@@ -1,12 +1,11 @@
1
1
  import {
2
2
  createControllerMetaMap,
3
3
  detectAopDep,
4
- genClientQueue,
5
4
  joinUrl,
6
5
  mergeObject,
7
6
  resolveDep,
8
7
  shallowClone
9
- } from "./chunk-Z7NAAE4M.mjs";
8
+ } from "./chunk-VX4BZEL7.mjs";
10
9
  import {
11
10
  HMR,
12
11
  RELAUNCH,
@@ -18,7 +17,6 @@ export {
18
17
  RELOAD,
19
18
  createControllerMetaMap,
20
19
  detectAopDep,
21
- genClientQueue,
22
20
  joinUrl,
23
21
  mergeObject,
24
22
  resolveDep,
@@ -1,9 +1,9 @@
1
1
  import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
2
2
  import { BaseMacro } from 'elysia/dist/types';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-DYviSl5B.mjs';
4
- import { F as Factory } from '../../core-DIfgUKIU.mjs';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Ctd6pLNE.mjs';
4
+ import { F as Factory } from '../../core-jUg1HvYT.mjs';
5
5
  import 'node:http';
6
- import '../../meta-CR-D39hQ.mjs';
6
+ import '../../meta-xvg6V7pH.mjs';
7
7
  import 'phecda-core';
8
8
 
9
9
  interface ElysiaCtx extends HttpCtx {
@@ -1,9 +1,9 @@
1
1
  import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
2
2
  import { BaseMacro } from 'elysia/dist/types';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-BF1TDbFV.js';
4
- import { F as Factory } from '../../core-CUTbX_IS.js';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-B-1OL-3P.js';
4
+ import { F as Factory } from '../../core-CDzIy2g0.js';
5
5
  import 'node:http';
6
- import '../../meta-CR-D39hQ.js';
6
+ import '../../meta-xvg6V7pH.js';
7
7
  import 'phecda-core';
8
8
 
9
9
  interface ElysiaCtx extends HttpCtx {
@@ -7,7 +7,7 @@ var _chunkKCPBITYZjs = require('../../chunk-KCPBITYZ.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkG7JFKM2Mjs = require('../../chunk-G7JFKM2M.js');
10
+ var _chunkIJFIY6QNjs = require('../../chunk-IJFIY6QN.js');
11
11
 
12
12
 
13
13
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -19,14 +19,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/elysia");
19
19
  function bind(app, data, opts = {}) {
20
20
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
21
21
  const { moduleMap, meta } = data;
22
- const metaMap = _chunkG7JFKM2Mjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
+ const metaMap = _chunkIJFIY6QNjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
23
23
  const { controller, http, func, tag } = meta2.data;
24
24
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
25
25
  debug(`register method "${func}" in module "${tag}"`);
26
26
  return true;
27
27
  }
28
28
  });
29
- _chunkG7JFKM2Mjs.detectAopDep.call(void 0, meta, {
29
+ _chunkIJFIY6QNjs.detectAopDep.call(void 0, meta, {
30
30
  addons: [
31
31
  ...globalAddons,
32
32
  ...parallelAddons
@@ -35,28 +35,29 @@ function bind(app, data, opts = {}) {
35
35
  });
36
36
  registerRoute();
37
37
  function registerRoute() {
38
- _chunkG7JFKM2Mjs.Context.applyAddons(globalAddons, app, "elysia");
38
+ _chunkIJFIY6QNjs.Context.applyAddons(globalAddons, app, "elysia");
39
39
  if (parallelRoute) {
40
40
  const parallelRouter = new (0, _elysia.Elysia)();
41
- _chunkG7JFKM2Mjs.Context.applyAddons(parallelAddons, app, "elysia");
41
+ _chunkIJFIY6QNjs.Context.applyAddons(parallelAddons, app, "elysia");
42
42
  parallelRouter.post(parallelRoute, async (c) => {
43
43
  const { body } = c;
44
44
  async function errorHandler(e) {
45
- const error = await _chunkG7JFKM2Mjs.Context.filterRecord.default(e);
45
+ const error = await _chunkIJFIY6QNjs.Context.filterRecord.default(e);
46
46
  c.set.status = error.status;
47
47
  return error;
48
48
  }
49
49
  _chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
50
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkG7JFKM2Mjs.BadRequestException)("data format should be an array"));
50
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkIJFIY6QNjs.BadRequestException)("data format should be an array"));
51
51
  try {
52
52
  return Promise.all(body.map((item, i) => {
53
53
  return new Promise(async (resolve) => {
54
+ if (!item) return resolve(null);
54
55
  const { tag, func } = item;
55
56
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
56
- if (!metaMap.has(tag)) return resolve(await _chunkG7JFKM2Mjs.Context.filterRecord.default(new (0, _chunkG7JFKM2Mjs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
+ if (!metaMap.has(tag)) return resolve(await _chunkIJFIY6QNjs.Context.filterRecord.default(new (0, _chunkIJFIY6QNjs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
58
  const meta2 = metaMap.get(tag)[func];
58
- if (!meta2) return resolve(await _chunkG7JFKM2Mjs.Context.filterRecord.default(new (0, _chunkG7JFKM2Mjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
59
- const aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
59
+ if (!meta2) return resolve(await _chunkIJFIY6QNjs.Context.filterRecord.default(new (0, _chunkIJFIY6QNjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
60
+ const aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
60
61
  globalGuards,
61
62
  globalFilter,
62
63
  globalPipe
@@ -87,7 +88,7 @@ function bind(app, data, opts = {}) {
87
88
  throw new Error("elysia can't support getResponse");
88
89
  }, "getResponse")
89
90
  };
90
- const context = new (0, _chunkG7JFKM2Mjs.Context)(contextData);
91
+ const context = new (0, _chunkIJFIY6QNjs.Context)(contextData);
91
92
  context.run(aop, resolve, resolve);
92
93
  });
93
94
  })).then((ret) => {
@@ -109,14 +110,14 @@ function bind(app, data, opts = {}) {
109
110
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
110
111
  let aop;
111
112
  if (!dynamic) {
112
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
113
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
113
114
  globalFilter,
114
115
  globalGuards,
115
116
  globalPipe
116
117
  });
117
118
  }
118
- _chunkG7JFKM2Mjs.Context.applyAddons(addons, subApp, "elysia");
119
- subApp[http.type](_chunkG7JFKM2Mjs.joinUrl.call(void 0, http.prefix, http.route), async (c) => {
119
+ _chunkIJFIY6QNjs.Context.applyAddons(addons, subApp, "elysia");
120
+ subApp[http.type](_chunkIJFIY6QNjs.joinUrl.call(void 0, http.prefix, http.route), async (c) => {
120
121
  debug(`invoke method "${func}" in module "${tag}"`);
121
122
  const contextData = {
122
123
  type: "elysia",
@@ -148,16 +149,16 @@ function bind(app, data, opts = {}) {
148
149
  }, "getResponse")
149
150
  };
150
151
  if (dynamic) {
151
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
152
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
152
153
  globalFilter,
153
154
  globalGuards,
154
155
  globalPipe
155
156
  });
156
157
  }
157
- const context = new (0, _chunkG7JFKM2Mjs.Context)(contextData);
158
+ const context = new (0, _chunkIJFIY6QNjs.Context)(contextData);
158
159
  if (http.headers) c.set.headers = http.headers;
159
160
  if (dynamic) {
160
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
161
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
161
162
  globalFilter,
162
163
  globalGuards,
163
164
  globalPipe
@@ -7,7 +7,7 @@ import {
7
7
  createControllerMetaMap,
8
8
  detectAopDep,
9
9
  joinUrl
10
- } from "../../chunk-Z7NAAE4M.mjs";
10
+ } from "../../chunk-VX4BZEL7.mjs";
11
11
  import {
12
12
  __name
13
13
  } from "../../chunk-NQ55PA2X.mjs";
@@ -51,6 +51,7 @@ function bind(app, data, opts = {}) {
51
51
  try {
52
52
  return Promise.all(body.map((item, i) => {
53
53
  return new Promise(async (resolve) => {
54
+ if (!item) return resolve(null);
54
55
  const { tag, func } = item;
55
56
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
56
57
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
@@ -1,8 +1,8 @@
1
1
  import { Request, Response, Router, RequestHandler } from 'express';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-DYviSl5B.mjs';
3
- import { F as Factory } from '../../core-DIfgUKIU.mjs';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Ctd6pLNE.mjs';
3
+ import { F as Factory } from '../../core-jUg1HvYT.mjs';
4
4
  import 'node:http';
5
- import '../../meta-CR-D39hQ.mjs';
5
+ import '../../meta-xvg6V7pH.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface ExpressCtx extends HttpCtx {
@@ -1,8 +1,8 @@
1
1
  import { Request, Response, Router, RequestHandler } from 'express';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-BF1TDbFV.js';
3
- import { F as Factory } from '../../core-CUTbX_IS.js';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-B-1OL-3P.js';
3
+ import { F as Factory } from '../../core-CDzIy2g0.js';
4
4
  import 'node:http';
5
- import '../../meta-CR-D39hQ.js';
5
+ import '../../meta-xvg6V7pH.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface ExpressCtx extends HttpCtx {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkG7JFKM2Mjs = require('../../chunk-G7JFKM2M.js');
7
+ var _chunkIJFIY6QNjs = require('../../chunk-IJFIY6QN.js');
8
8
 
9
9
 
10
10
 
@@ -18,14 +18,14 @@ function bind(router, data, opts = {}) {
18
18
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
19
19
  const { moduleMap, meta } = data;
20
20
  const originStack = router.stack.slice(0, router.stack.length);
21
- const metaMap = _chunkG7JFKM2Mjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkIJFIY6QNjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, http, func, tag } = meta2.data;
23
23
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
24
24
  debug(`register method "${func}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkG7JFKM2Mjs.detectAopDep.call(void 0, meta, {
28
+ _chunkIJFIY6QNjs.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -38,27 +38,28 @@ function bind(router, data, opts = {}) {
38
38
  registerRoute();
39
39
  });
40
40
  function registerRoute() {
41
- _chunkG7JFKM2Mjs.Context.applyAddons(globalAddons, router, "express");
41
+ _chunkIJFIY6QNjs.Context.applyAddons(globalAddons, router, "express");
42
42
  if (parallelRoute) {
43
43
  const subRouter = _express.Router.call(void 0, );
44
- _chunkG7JFKM2Mjs.Context.applyAddons(parallelAddons, subRouter, "express");
44
+ _chunkIJFIY6QNjs.Context.applyAddons(parallelAddons, subRouter, "express");
45
45
  subRouter.use(async (req, res, next) => {
46
46
  const { body } = req;
47
47
  async function errorHandler(e) {
48
- const error = await _chunkG7JFKM2Mjs.Context.filterRecord.default(e);
48
+ const error = await _chunkIJFIY6QNjs.Context.filterRecord.default(e);
49
49
  return res.status(error.status).json(error);
50
50
  }
51
51
  _chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
52
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkG7JFKM2Mjs.BadRequestException)("data format should be an array"));
52
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkIJFIY6QNjs.BadRequestException)("data format should be an array"));
53
53
  try {
54
54
  return Promise.all(body.map((item, i) => {
55
55
  return new Promise(async (resolve) => {
56
+ if (!item) return resolve(null);
56
57
  const { tag, func } = item;
57
58
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
58
- if (!metaMap.has(tag)) return resolve(await _chunkG7JFKM2Mjs.Context.filterRecord.default(new (0, _chunkG7JFKM2Mjs.BadRequestException)(`module "${tag}" doesn't exist`)));
59
+ if (!metaMap.has(tag)) return resolve(await _chunkIJFIY6QNjs.Context.filterRecord.default(new (0, _chunkIJFIY6QNjs.BadRequestException)(`module "${tag}" doesn't exist`)));
59
60
  const meta2 = metaMap.get(tag)[func];
60
- if (!meta2) return resolve(await _chunkG7JFKM2Mjs.Context.filterRecord.default(new (0, _chunkG7JFKM2Mjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
61
- const aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
61
+ if (!meta2) return resolve(await _chunkIJFIY6QNjs.Context.filterRecord.default(new (0, _chunkIJFIY6QNjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
62
+ const aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
62
63
  globalFilter,
63
64
  globalGuards,
64
65
  globalPipe
@@ -86,7 +87,7 @@ function bind(router, data, opts = {}) {
86
87
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => req, "getRequest"),
87
88
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => res, "getResponse")
88
89
  };
89
- const context = new (0, _chunkG7JFKM2Mjs.Context)(contextData);
90
+ const context = new (0, _chunkIJFIY6QNjs.Context)(contextData);
90
91
  context.run(aop, resolve, resolve);
91
92
  });
92
93
  })).then((ret) => {
@@ -105,15 +106,15 @@ function bind(router, data, opts = {}) {
105
106
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
106
107
  let aop;
107
108
  if (!dynamic) {
108
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
109
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
109
110
  globalFilter,
110
111
  globalGuards,
111
112
  globalPipe
112
113
  });
113
114
  }
114
115
  const subRouter = _express.Router.call(void 0, );
115
- _chunkG7JFKM2Mjs.Context.applyAddons(addons, subRouter, "express");
116
- subRouter[http.type](_chunkG7JFKM2Mjs.joinUrl.call(void 0, http.prefix, http.route), async (req, res, next) => {
116
+ _chunkIJFIY6QNjs.Context.applyAddons(addons, subRouter, "express");
117
+ subRouter[http.type](_chunkIJFIY6QNjs.joinUrl.call(void 0, http.prefix, http.route), async (req, res, next) => {
117
118
  debug(`invoke method "${func}" in module "${tag}"`);
118
119
  const contextData = {
119
120
  type: "express",
@@ -141,10 +142,10 @@ function bind(router, data, opts = {}) {
141
142
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => req, "getRequest"),
142
143
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => res, "getResponse")
143
144
  };
144
- const context = new (0, _chunkG7JFKM2Mjs.Context)(contextData);
145
+ const context = new (0, _chunkIJFIY6QNjs.Context)(contextData);
145
146
  if (http.headers) res.set(http.headers);
146
147
  if (dynamic) {
147
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
148
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
148
149
  globalFilter,
149
150
  globalGuards,
150
151
  globalPipe
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  joinUrl
7
- } from "../../chunk-Z7NAAE4M.mjs";
7
+ } from "../../chunk-VX4BZEL7.mjs";
8
8
  import {
9
9
  HMR,
10
10
  __name
@@ -53,6 +53,7 @@ function bind(router, data, opts = {}) {
53
53
  try {
54
54
  return Promise.all(body.map((item, i) => {
55
55
  return new Promise(async (resolve) => {
56
+ if (!item) return resolve(null);
56
57
  const { tag, func } = item;
57
58
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
58
59
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
@@ -1,8 +1,8 @@
1
1
  import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-DYviSl5B.mjs';
3
- import { F as Factory } from '../../core-DIfgUKIU.mjs';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Ctd6pLNE.mjs';
3
+ import { F as Factory } from '../../core-jUg1HvYT.mjs';
4
4
  import 'node:http';
5
- import '../../meta-CR-D39hQ.mjs';
5
+ import '../../meta-xvg6V7pH.mjs';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface FastifyCtx extends HttpCtx {
@@ -1,8 +1,8 @@
1
1
  import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
2
- import { H as HttpCtx, a as HttpOptions } from '../../types-BF1TDbFV.js';
3
- import { F as Factory } from '../../core-CUTbX_IS.js';
2
+ import { H as HttpCtx, a as HttpOptions } from '../../types-B-1OL-3P.js';
3
+ import { F as Factory } from '../../core-CDzIy2g0.js';
4
4
  import 'node:http';
5
- import '../../meta-CR-D39hQ.js';
5
+ import '../../meta-xvg6V7pH.js';
6
6
  import 'phecda-core';
7
7
 
8
8
  interface FastifyCtx extends HttpCtx {
@@ -7,7 +7,7 @@ var _chunkKCPBITYZjs = require('../../chunk-KCPBITYZ.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkG7JFKM2Mjs = require('../../chunk-G7JFKM2M.js');
10
+ var _chunkIJFIY6QNjs = require('../../chunk-IJFIY6QN.js');
11
11
 
12
12
 
13
13
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -18,14 +18,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/fastify");
18
18
  function bind(fastify, data, opts = {}) {
19
19
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, fastifyOpts, dynamic = false } = opts;
20
20
  const { moduleMap, meta } = data;
21
- const metaMap = _chunkG7JFKM2Mjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkIJFIY6QNjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, http, func, tag } = meta2.data;
23
23
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _2 => _2.type])) {
24
24
  debug(`register method "${func}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkG7JFKM2Mjs.detectAopDep.call(void 0, meta, {
28
+ _chunkIJFIY6QNjs.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -33,27 +33,28 @@ function bind(fastify, data, opts = {}) {
33
33
  guards: globalGuards
34
34
  });
35
35
  fastify.register(async (fastify2, _, done) => {
36
- _chunkG7JFKM2Mjs.Context.applyAddons(globalAddons, fastify2, "fastify");
36
+ _chunkIJFIY6QNjs.Context.applyAddons(globalAddons, fastify2, "fastify");
37
37
  if (parallelRoute) {
38
38
  fastify2.register(async (fastify3, _opts, done2) => {
39
- _chunkG7JFKM2Mjs.Context.applyAddons(parallelAddons, fastify3, "fastify");
39
+ _chunkIJFIY6QNjs.Context.applyAddons(parallelAddons, fastify3, "fastify");
40
40
  fastify3.post(parallelRoute, async (req, res) => {
41
41
  const { body } = req;
42
42
  async function errorHandler(e) {
43
- const error = await _chunkG7JFKM2Mjs.Context.filterRecord.default(e);
43
+ const error = await _chunkIJFIY6QNjs.Context.filterRecord.default(e);
44
44
  return res.status(error.status).send(error);
45
45
  }
46
46
  _chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
47
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkG7JFKM2Mjs.BadRequestException)("data format should be an array"));
47
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkIJFIY6QNjs.BadRequestException)("data format should be an array"));
48
48
  try {
49
49
  return Promise.all(body.map((item, i) => {
50
50
  return new Promise(async (resolve) => {
51
+ if (!item) return resolve(null);
51
52
  const { tag, func } = item;
52
53
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
53
- if (!metaMap.has(tag)) return resolve(await _chunkG7JFKM2Mjs.Context.filterRecord.default(new (0, _chunkG7JFKM2Mjs.BadRequestException)(`module "${tag}" doesn't exist`)));
54
+ if (!metaMap.has(tag)) return resolve(await _chunkIJFIY6QNjs.Context.filterRecord.default(new (0, _chunkIJFIY6QNjs.BadRequestException)(`module "${tag}" doesn't exist`)));
54
55
  const meta2 = metaMap.get(tag)[func];
55
- if (!meta2) return resolve(await _chunkG7JFKM2Mjs.Context.filterRecord.default(new (0, _chunkG7JFKM2Mjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
56
- const aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
56
+ if (!meta2) return resolve(await _chunkIJFIY6QNjs.Context.filterRecord.default(new (0, _chunkIJFIY6QNjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
57
+ const aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
57
58
  globalFilter,
58
59
  globalGuards,
59
60
  globalPipe
@@ -81,7 +82,7 @@ function bind(fastify, data, opts = {}) {
81
82
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => req.raw, "getRequest"),
82
83
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => res.raw, "getResponse")
83
84
  };
84
- const context = new (0, _chunkG7JFKM2Mjs.Context)(contextData);
85
+ const context = new (0, _chunkIJFIY6QNjs.Context)(contextData);
85
86
  context.run(aop, resolve, resolve);
86
87
  });
87
88
  })).then((ret) => {
@@ -100,16 +101,16 @@ function bind(fastify, data, opts = {}) {
100
101
  const { data: { addons, define, http } } = meta2;
101
102
  if (!_optionalChain([http, 'optionalAccess', _3 => _3.type])) continue;
102
103
  fastify2.register(async (fastify3, _opts, done2) => {
103
- _chunkG7JFKM2Mjs.Context.applyAddons(addons, fastify3, "fastify");
104
+ _chunkIJFIY6QNjs.Context.applyAddons(addons, fastify3, "fastify");
104
105
  let aop;
105
106
  if (!dynamic) {
106
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
107
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
107
108
  globalFilter,
108
109
  globalGuards,
109
110
  globalPipe
110
111
  });
111
112
  }
112
- fastify3[http.type](_chunkG7JFKM2Mjs.joinUrl.call(void 0, http.prefix, http.route), _optionalChain([define, 'optionalAccess', _4 => _4.fastify]) || {}, async (req, res) => {
113
+ fastify3[http.type](_chunkIJFIY6QNjs.joinUrl.call(void 0, http.prefix, http.route), _optionalChain([define, 'optionalAccess', _4 => _4.fastify]) || {}, async (req, res) => {
113
114
  debug(`invoke method "${func}" in module "${tag}"`);
114
115
  const contextData = {
115
116
  type: "fastify",
@@ -139,10 +140,10 @@ function bind(fastify, data, opts = {}) {
139
140
  getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => req.raw, "getRequest"),
140
141
  getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => res.raw, "getResponse")
141
142
  };
142
- const context = new (0, _chunkG7JFKM2Mjs.Context)(contextData);
143
+ const context = new (0, _chunkIJFIY6QNjs.Context)(contextData);
143
144
  if (http.headers) res.headers(http.headers);
144
145
  if (dynamic) {
145
- aop = _chunkG7JFKM2Mjs.Context.getAop(meta2, {
146
+ aop = _chunkIJFIY6QNjs.Context.getAop(meta2, {
146
147
  globalFilter,
147
148
  globalGuards,
148
149
  globalPipe
@@ -7,7 +7,7 @@ import {
7
7
  createControllerMetaMap,
8
8
  detectAopDep,
9
9
  joinUrl
10
- } from "../../chunk-Z7NAAE4M.mjs";
10
+ } from "../../chunk-VX4BZEL7.mjs";
11
11
  import {
12
12
  __name
13
13
  } from "../../chunk-NQ55PA2X.mjs";
@@ -48,6 +48,7 @@ function bind(fastify, data, opts = {}) {
48
48
  try {
49
49
  return Promise.all(body.map((item, i) => {
50
50
  return new Promise(async (resolve) => {
51
+ if (!item) return resolve(null);
51
52
  const { tag, func } = item;
52
53
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
53
54
  if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
@@ -1,8 +1,8 @@
1
1
  import { H3Event, Router, _RequestMiddleware } from 'h3';
2
- import { F as Factory } from '../../core-DIfgUKIU.mjs';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-DYviSl5B.mjs';
2
+ import { F as Factory } from '../../core-jUg1HvYT.mjs';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-Ctd6pLNE.mjs';
4
4
  import 'phecda-core';
5
- import '../../meta-CR-D39hQ.mjs';
5
+ import '../../meta-xvg6V7pH.mjs';
6
6
  import 'node:http';
7
7
 
8
8
  interface H3Ctx extends HttpCtx {
@@ -1,8 +1,8 @@
1
1
  import { H3Event, Router, _RequestMiddleware } from 'h3';
2
- import { F as Factory } from '../../core-CUTbX_IS.js';
3
- import { H as HttpCtx, a as HttpOptions } from '../../types-BF1TDbFV.js';
2
+ import { F as Factory } from '../../core-CDzIy2g0.js';
3
+ import { H as HttpCtx, a as HttpOptions } from '../../types-B-1OL-3P.js';
4
4
  import 'phecda-core';
5
- import '../../meta-CR-D39hQ.js';
5
+ import '../../meta-xvg6V7pH.js';
6
6
  import 'node:http';
7
7
 
8
8
  interface H3Ctx extends HttpCtx {