phecda-server 8.4.1 → 8.5.0

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 (45) hide show
  1. package/dist/{chunk-RS6H6TEX.js → chunk-5ZZAOOKE.js} +26 -26
  2. package/dist/{chunk-R73A7HS3.js → chunk-76UDKZOJ.js} +53 -53
  3. package/dist/{chunk-OUQM7GZH.js → chunk-LLF55NZP.js} +14 -4
  4. package/dist/{chunk-3OKDXHO7.mjs → chunk-MUUKKO67.mjs} +1 -1
  5. package/dist/{chunk-SRPCXPAQ.js → chunk-SKGOTR4T.js} +20 -20
  6. package/dist/{chunk-JRNXLEAU.mjs → chunk-URKOYTBU.mjs} +14 -4
  7. package/dist/{chunk-US2DTB3Z.mjs → chunk-WST6E6MQ.mjs} +1 -1
  8. package/dist/{chunk-YDJAOLT2.mjs → chunk-ZHNYWZRL.mjs} +1 -1
  9. package/dist/helper.d.mts +2 -1
  10. package/dist/helper.d.ts +2 -1
  11. package/dist/helper.js +5 -3
  12. package/dist/helper.mjs +4 -2
  13. package/dist/http/elysia/index.js +45 -41
  14. package/dist/http/elysia/index.mjs +10 -6
  15. package/dist/http/express/index.js +38 -38
  16. package/dist/http/express/index.mjs +3 -3
  17. package/dist/http/fastify/index.js +39 -39
  18. package/dist/http/fastify/index.mjs +4 -4
  19. package/dist/http/h3/index.js +39 -39
  20. package/dist/http/h3/index.mjs +3 -3
  21. package/dist/http/hono/index.js +35 -35
  22. package/dist/http/hono/index.mjs +3 -3
  23. package/dist/http/hyper-express/index.js +36 -36
  24. package/dist/http/hyper-express/index.mjs +3 -3
  25. package/dist/http/koa/index.js +38 -38
  26. package/dist/http/koa/index.mjs +3 -3
  27. package/dist/index.js +44 -44
  28. package/dist/index.mjs +4 -4
  29. package/dist/rpc/bullmq/index.js +11 -11
  30. package/dist/rpc/bullmq/index.mjs +2 -2
  31. package/dist/rpc/electron/index.js +8 -8
  32. package/dist/rpc/electron/index.mjs +2 -2
  33. package/dist/rpc/kafka/index.js +10 -10
  34. package/dist/rpc/kafka/index.mjs +2 -2
  35. package/dist/rpc/nats/index.js +11 -11
  36. package/dist/rpc/nats/index.mjs +2 -2
  37. package/dist/rpc/rabbitmq/index.js +12 -12
  38. package/dist/rpc/rabbitmq/index.mjs +2 -2
  39. package/dist/rpc/redis/index.js +10 -10
  40. package/dist/rpc/redis/index.mjs +2 -2
  41. package/dist/rpc/ws/index.js +7 -7
  42. package/dist/rpc/ws/index.mjs +2 -2
  43. package/dist/test.js +6 -6
  44. package/dist/test.mjs +2 -2
  45. package/package.json +1 -1
@@ -2,11 +2,11 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-US2DTB3Z.mjs";
5
+ } from "../../chunk-WST6E6MQ.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
9
- } from "../../chunk-JRNXLEAU.mjs";
9
+ } from "../../chunk-URKOYTBU.mjs";
10
10
 
11
11
  // src/rpc/nats/bind.ts
12
12
  import { StringCodec } from "nats";
@@ -2,30 +2,30 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
5
+ var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
6
6
 
7
7
 
8
8
 
9
- var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
9
+ var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
10
10
 
11
11
  // src/rpc/rabbitmq/bind.ts
12
12
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
13
13
  var debug = _debug2.default.call(void 0, "phecda-server/rabbitmq");
14
14
  async function bind(ch, { moduleMap, meta }, opts = {}) {
15
15
  const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
16
- const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunk76UDKZOJjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
17
  const { controller, rpc, method, tag } = meta2.data;
18
18
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
19
19
  debug(`register method "${method}" in module "${tag}"`);
20
20
  return true;
21
21
  }
22
22
  });
23
- _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
23
+ _chunk76UDKZOJjs.detectAopDep.call(void 0, meta, {
24
24
  guards: globalGuards,
25
25
  addons: globalAddons
26
26
  }, "rpc");
27
27
  const existQueue = /* @__PURE__ */ new Set();
28
- _chunkR73A7HS3js.Context.applyAddons(globalAddons, ch, "rabbitmq");
28
+ _chunk76UDKZOJjs.Context.applyAddons(globalAddons, ch, "rabbitmq");
29
29
  async function subscribeQueues() {
30
30
  existQueue.clear();
31
31
  for (const [tag, record] of metaMap) {
@@ -44,12 +44,12 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
44
44
  }
45
45
  }
46
46
  }
47
- _chunkOUQM7GZHjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
47
+ _chunkLLF55NZPjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
48
48
  async function handleRequest(msg) {
49
49
  function send(queue, data) {
50
50
  ch.sendToQueue(queue, Buffer.from(JSON.stringify(data)));
51
51
  }
52
- _chunkOUQM7GZHjs.__name.call(void 0, send, "send");
52
+ _chunkLLF55NZPjs.__name.call(void 0, send, "send");
53
53
  if (msg) {
54
54
  const data = JSON.parse(msg.content.toString());
55
55
  const { tag, method, id, queue: clientQueue, _ps, args } = data;
@@ -57,12 +57,12 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
57
57
  debug(`invoke method "${method}" in module "${tag}"`);
58
58
  const meta2 = metaMap.get(tag)[method];
59
59
  const { data: { rpc: { isEvent } = {} } } = meta2;
60
- const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
60
+ const aop = _chunk76UDKZOJjs.Context.getAop(meta2, {
61
61
  globalFilter,
62
62
  globalGuards,
63
63
  globalPipe
64
64
  });
65
- const context = new (0, _chunkR73A7HS3js.Context)({
65
+ const context = new (0, _chunk76UDKZOJjs.Context)({
66
66
  type: "rabbitmq",
67
67
  category: "rpc",
68
68
  moduleMap,
@@ -90,14 +90,14 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
90
90
  });
91
91
  }
92
92
  }
93
- _chunkOUQM7GZHjs.__name.call(void 0, handleRequest, "handleRequest");
93
+ _chunkLLF55NZPjs.__name.call(void 0, handleRequest, "handleRequest");
94
94
  subscribeQueues();
95
- _chunkOUQM7GZHjs.HMR.call(void 0, async () => {
95
+ _chunkLLF55NZPjs.HMR.call(void 0, async () => {
96
96
  for (const queue of existQueue) await ch.deleteQueue(queue);
97
97
  await subscribeQueues();
98
98
  });
99
99
  }
100
- _chunkOUQM7GZHjs.__name.call(void 0, bind, "bind");
100
+ _chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
101
101
 
102
102
 
103
103
  exports.bind = bind;
@@ -2,11 +2,11 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-US2DTB3Z.mjs";
5
+ } from "../../chunk-WST6E6MQ.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
9
- } from "../../chunk-JRNXLEAU.mjs";
9
+ } from "../../chunk-URKOYTBU.mjs";
10
10
 
11
11
  // src/rpc/rabbitmq/bind.ts
12
12
  import Debug from "debug";
@@ -2,30 +2,30 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
5
+ var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
6
6
 
7
7
 
8
8
 
9
- var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
9
+ var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
10
10
 
11
11
  // src/rpc/redis/bind.ts
12
12
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
13
13
  var debug = _debug2.default.call(void 0, "phecda-server/redis");
14
14
  function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
15
15
  const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
16
- const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunk76UDKZOJjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
17
  const { controller, rpc, method, tag } = meta2.data;
18
18
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
19
19
  debug(`register method "${method}" in module "${tag}"`);
20
20
  return true;
21
21
  }
22
22
  });
23
- _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
23
+ _chunk76UDKZOJjs.detectAopDep.call(void 0, meta, {
24
24
  guards: globalGuards,
25
25
  addons: globalAddons
26
26
  }, "rpc");
27
27
  const existQueue = /* @__PURE__ */ new Set();
28
- _chunkR73A7HS3js.Context.applyAddons(globalAddons, {
28
+ _chunk76UDKZOJjs.Context.applyAddons(globalAddons, {
29
29
  pub,
30
30
  sub
31
31
  }, "redis");
@@ -44,7 +44,7 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
44
44
  }
45
45
  }
46
46
  }
47
- _chunkOUQM7GZHjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
47
+ _chunkLLF55NZPjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
48
48
  sub.on("message", async (channel, msg) => {
49
49
  if (!existQueue.has(channel)) return;
50
50
  if (msg) {
@@ -54,12 +54,12 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
54
54
  if (_ps !== 1) return;
55
55
  const meta2 = metaMap.get(tag)[method];
56
56
  const { data: { rpc: { isEvent } = {} } } = meta2;
57
- const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
57
+ const aop = _chunk76UDKZOJjs.Context.getAop(meta2, {
58
58
  globalFilter,
59
59
  globalGuards,
60
60
  globalPipe
61
61
  });
62
- const context = new (0, _chunkR73A7HS3js.Context)({
62
+ const context = new (0, _chunk76UDKZOJjs.Context)({
63
63
  type: "redis",
64
64
  category: "rpc",
65
65
  moduleMap,
@@ -91,12 +91,12 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
91
91
  }
92
92
  });
93
93
  subscribeQueues();
94
- _chunkOUQM7GZHjs.HMR.call(void 0, async () => {
94
+ _chunkLLF55NZPjs.HMR.call(void 0, async () => {
95
95
  for (const queue of existQueue) await sub.unsubscribe(queue);
96
96
  subscribeQueues();
97
97
  });
98
98
  }
99
- _chunkOUQM7GZHjs.__name.call(void 0, bind, "bind");
99
+ _chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
100
100
 
101
101
 
102
102
  exports.bind = bind;
@@ -2,11 +2,11 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-US2DTB3Z.mjs";
5
+ } from "../../chunk-WST6E6MQ.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
9
- } from "../../chunk-JRNXLEAU.mjs";
9
+ } from "../../chunk-URKOYTBU.mjs";
10
10
 
11
11
  // src/rpc/redis/bind.ts
12
12
  import Debug from "debug";
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
5
+ var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
6
6
 
7
7
 
8
- var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
8
+ var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
9
9
 
10
10
  // src/rpc/ws/bind.ts
11
11
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
@@ -13,14 +13,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/ws");
13
13
  function bind(wss, data, opts = {}) {
14
14
  const { globalGuards, globalAddons, globalFilter, globalPipe } = opts;
15
15
  const { moduleMap, meta } = data;
16
- const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunk76UDKZOJjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
17
  const { controller, rpc, method, tag } = meta2.data;
18
18
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
19
19
  debug(`register method "${method}" in module "${tag}"`);
20
20
  return true;
21
21
  }
22
22
  });
23
- _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
23
+ _chunk76UDKZOJjs.detectAopDep.call(void 0, meta, {
24
24
  guards: globalGuards,
25
25
  addons: globalAddons
26
26
  }, "rpc");
@@ -32,12 +32,12 @@ function bind(wss, data, opts = {}) {
32
32
  if (_ps !== 1) return;
33
33
  const meta2 = metaMap.get(tag)[method];
34
34
  const { data: { rpc: { isEvent } = {} } } = meta2;
35
- const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
35
+ const aop = _chunk76UDKZOJjs.Context.getAop(meta2, {
36
36
  globalFilter,
37
37
  globalGuards,
38
38
  globalPipe
39
39
  });
40
- const context = new (0, _chunkR73A7HS3js.Context)({
40
+ const context = new (0, _chunk76UDKZOJjs.Context)({
41
41
  type: "ws",
42
42
  category: "rpc",
43
43
  meta: meta2,
@@ -67,7 +67,7 @@ function bind(wss, data, opts = {}) {
67
67
  });
68
68
  });
69
69
  }
70
- _chunkOUQM7GZHjs.__name.call(void 0, bind, "bind");
70
+ _chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
71
71
 
72
72
 
73
73
  exports.bind = bind;
@@ -2,10 +2,10 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-US2DTB3Z.mjs";
5
+ } from "../../chunk-WST6E6MQ.mjs";
6
6
  import {
7
7
  __name
8
- } from "../../chunk-JRNXLEAU.mjs";
8
+ } from "../../chunk-URKOYTBU.mjs";
9
9
 
10
10
  // src/rpc/ws/bind.ts
11
11
  import Debug from "debug";
package/dist/test.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
2
 
3
- var _chunkSRPCXPAQjs = require('./chunk-SRPCXPAQ.js');
3
+ var _chunkSKGOTR4Tjs = require('./chunk-SKGOTR4T.js');
4
4
 
5
5
 
6
- var _chunkOUQM7GZHjs = require('./chunk-OUQM7GZH.js');
6
+ var _chunkLLF55NZPjs = require('./chunk-LLF55NZP.js');
7
7
 
8
8
  // src/test.ts
9
9
  var _phecdacore = require('phecda-core');
10
10
  async function TestFactory(...Modules) {
11
- const { moduleMap, modelMap } = await _chunkSRPCXPAQjs.Factory.call(void 0, Modules);
11
+ const { moduleMap, modelMap } = await _chunkSKGOTR4Tjs.Factory.call(void 0, Modules);
12
12
  return {
13
13
  get(Model) {
14
14
  const tag = _phecdacore.getTag.call(void 0, Model);
@@ -19,7 +19,7 @@ async function TestFactory(...Modules) {
19
19
  }
20
20
  };
21
21
  }
22
- _chunkOUQM7GZHjs.__name.call(void 0, TestFactory, "TestFactory");
22
+ _chunkLLF55NZPjs.__name.call(void 0, TestFactory, "TestFactory");
23
23
  async function TestHttp(app, { moduleMap, meta }, isAgent = true) {
24
24
  const { default: request, agent } = await Promise.resolve().then(() => _interopRequireWildcard(require("supertest")));
25
25
  const Agent = agent(app);
@@ -59,13 +59,13 @@ async function TestHttp(app, { moduleMap, meta }, isAgent = true) {
59
59
  }
60
60
  });
61
61
  }
62
- _chunkOUQM7GZHjs.__name.call(void 0, module, "module");
62
+ _chunkLLF55NZPjs.__name.call(void 0, module, "module");
63
63
  return {
64
64
  module,
65
65
  agent
66
66
  };
67
67
  }
68
- _chunkOUQM7GZHjs.__name.call(void 0, TestHttp, "TestHttp");
68
+ _chunkLLF55NZPjs.__name.call(void 0, TestHttp, "TestHttp");
69
69
 
70
70
 
71
71
 
package/dist/test.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Factory
3
- } from "./chunk-YDJAOLT2.mjs";
3
+ } from "./chunk-ZHNYWZRL.mjs";
4
4
  import {
5
5
  __name
6
- } from "./chunk-JRNXLEAU.mjs";
6
+ } from "./chunk-URKOYTBU.mjs";
7
7
 
8
8
  // src/test.ts
9
9
  import { getTag } from "phecda-core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-server",
3
- "version": "8.4.1",
3
+ "version": "8.5.0",
4
4
  "description": "server framework that provide IOC/type-reuse/http&rpc-adaptor",
5
5
  "author": "fgsreally",
6
6
  "license": "MIT",