phecda-server 8.0.0 → 8.0.1

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkYJ3QHGTCjs = require('../../chunk-YJ3QHGTC.js');
5
+ var _chunkLD7YMHIEjs = require('../../chunk-LD7YMHIE.js');
6
6
 
7
7
 
8
8
 
@@ -17,18 +17,18 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
17
17
  const sc = _nats.StringCodec.call(void 0, );
18
18
  const subscriptionMap = {};
19
19
  const existQueue = /* @__PURE__ */ new Set();
20
- const metaMap = _chunkYJ3QHGTCjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const metaMap = _chunkLD7YMHIEjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
21
  const { controller, rpc, method, tag } = meta2.data;
22
22
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _2 => _2.queue]) !== void 0) {
23
23
  debug(`register method "${method}" in module "${tag}"`);
24
24
  return true;
25
25
  }
26
26
  });
27
- _chunkYJ3QHGTCjs.detectAopDep.call(void 0, meta, {
27
+ _chunkLD7YMHIEjs.detectAopDep.call(void 0, meta, {
28
28
  addons: globalAddons,
29
29
  guards: globalGuards
30
30
  }, "rpc");
31
- _chunkYJ3QHGTCjs.Context.applyAddons(globalAddons, nc, "nats");
31
+ _chunkLD7YMHIEjs.Context.applyAddons(globalAddons, nc, "nats");
32
32
  async function subscribeQueues() {
33
33
  existQueue.clear();
34
34
  for (const [tag, record] of metaMap) {
@@ -56,12 +56,12 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
56
56
  const meta2 = metaMap.get(tag)[method];
57
57
  const { data: { rpc: { isEvent } = {} } } = meta2;
58
58
  if (isEvent) msg.respond("{}");
59
- const aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
59
+ const aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
60
60
  globalFilter,
61
61
  globalGuards,
62
62
  globalPipe
63
63
  });
64
- const context = new (0, _chunkYJ3QHGTCjs.Context)({
64
+ const context = new (0, _chunkLD7YMHIEjs.Context)({
65
65
  type: "nats",
66
66
  category: "rpc",
67
67
  moduleMap,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-VAHCYYCB.mjs";
5
+ } from "../../chunk-G5IH3TP7.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkYJ3QHGTCjs = require('../../chunk-YJ3QHGTC.js');
5
+ var _chunkLD7YMHIEjs = require('../../chunk-LD7YMHIE.js');
6
6
 
7
7
 
8
8
 
@@ -13,19 +13,19 @@ 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 = _chunkYJ3QHGTCjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunkLD7YMHIEjs.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
- _chunkYJ3QHGTCjs.detectAopDep.call(void 0, meta, {
23
+ _chunkLD7YMHIEjs.detectAopDep.call(void 0, meta, {
24
24
  guards: globalGuards,
25
25
  addons: globalAddons
26
26
  }, "rpc");
27
27
  const existQueue = /* @__PURE__ */ new Set();
28
- _chunkYJ3QHGTCjs.Context.applyAddons(globalAddons, ch, "rabbitmq");
28
+ _chunkLD7YMHIEjs.Context.applyAddons(globalAddons, ch, "rabbitmq");
29
29
  async function subscribeQueues() {
30
30
  existQueue.clear();
31
31
  for (const [tag, record] of metaMap) {
@@ -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 = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
60
+ const aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
61
61
  globalFilter,
62
62
  globalGuards,
63
63
  globalPipe
64
64
  });
65
- const context = new (0, _chunkYJ3QHGTCjs.Context)({
65
+ const context = new (0, _chunkLD7YMHIEjs.Context)({
66
66
  type: "rabbitmq",
67
67
  category: "rpc",
68
68
  moduleMap,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-VAHCYYCB.mjs";
5
+ } from "../../chunk-G5IH3TP7.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkYJ3QHGTCjs = require('../../chunk-YJ3QHGTC.js');
5
+ var _chunkLD7YMHIEjs = require('../../chunk-LD7YMHIE.js');
6
6
 
7
7
 
8
8
 
@@ -13,19 +13,19 @@ 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 = _chunkYJ3QHGTCjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunkLD7YMHIEjs.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
- _chunkYJ3QHGTCjs.detectAopDep.call(void 0, meta, {
23
+ _chunkLD7YMHIEjs.detectAopDep.call(void 0, meta, {
24
24
  guards: globalGuards,
25
25
  addons: globalAddons
26
26
  }, "rpc");
27
27
  const existQueue = /* @__PURE__ */ new Set();
28
- _chunkYJ3QHGTCjs.Context.applyAddons(globalAddons, {
28
+ _chunkLD7YMHIEjs.Context.applyAddons(globalAddons, {
29
29
  pub,
30
30
  sub
31
31
  }, "redis");
@@ -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 = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
57
+ const aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
58
58
  globalFilter,
59
59
  globalGuards,
60
60
  globalPipe
61
61
  });
62
- const context = new (0, _chunkYJ3QHGTCjs.Context)({
62
+ const context = new (0, _chunkLD7YMHIEjs.Context)({
63
63
  type: "redis",
64
64
  category: "rpc",
65
65
  moduleMap,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-VAHCYYCB.mjs";
5
+ } from "../../chunk-G5IH3TP7.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkYJ3QHGTCjs = require('../../chunk-YJ3QHGTC.js');
5
+ var _chunkLD7YMHIEjs = require('../../chunk-LD7YMHIE.js');
6
6
 
7
7
 
8
8
  var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
@@ -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 = _chunkYJ3QHGTCjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
+ const metaMap = _chunkLD7YMHIEjs.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
- _chunkYJ3QHGTCjs.detectAopDep.call(void 0, meta, {
23
+ _chunkLD7YMHIEjs.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 = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
35
+ const aop = _chunkLD7YMHIEjs.Context.getAop(meta2, {
36
36
  globalFilter,
37
37
  globalGuards,
38
38
  globalPipe
39
39
  });
40
- const context = new (0, _chunkYJ3QHGTCjs.Context)({
40
+ const context = new (0, _chunkLD7YMHIEjs.Context)({
41
41
  type: "ws",
42
42
  category: "rpc",
43
43
  meta: meta2,
@@ -2,7 +2,7 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-VAHCYYCB.mjs";
5
+ } from "../../chunk-G5IH3TP7.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "../../chunk-NQ55PA2X.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-server",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "server framework that provide IOC/type-reuse/http&rpc-adaptor",
5
5
  "author": "fgsreally",
6
6
  "license": "MIT",
@@ -158,7 +158,7 @@
158
158
  "fs-extra": "^11.2.0",
159
159
  "picocolors": "^1.0.0",
160
160
  "ts-mixer": "^6.0.4",
161
- "phecda-core": "5.0.0"
161
+ "phecda-core": "5.0.1"
162
162
  },
163
163
  "devDependencies": {
164
164
  "@koa/router": "^12.0.1",
@@ -40,7 +40,6 @@ export async function genUnImportRet(opts) {
40
40
  .concat(opts.presets || []),
41
41
  })
42
42
  } catch (e) {
43
- console.error(e)
44
43
  return false
45
44
  }
46
45
  }