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.
- package/dist/{chunk-RS6H6TEX.js → chunk-5ZZAOOKE.js} +26 -26
- package/dist/{chunk-R73A7HS3.js → chunk-76UDKZOJ.js} +53 -53
- package/dist/{chunk-OUQM7GZH.js → chunk-LLF55NZP.js} +14 -4
- package/dist/{chunk-3OKDXHO7.mjs → chunk-MUUKKO67.mjs} +1 -1
- package/dist/{chunk-SRPCXPAQ.js → chunk-SKGOTR4T.js} +20 -20
- package/dist/{chunk-JRNXLEAU.mjs → chunk-URKOYTBU.mjs} +14 -4
- package/dist/{chunk-US2DTB3Z.mjs → chunk-WST6E6MQ.mjs} +1 -1
- package/dist/{chunk-YDJAOLT2.mjs → chunk-ZHNYWZRL.mjs} +1 -1
- package/dist/helper.d.mts +2 -1
- package/dist/helper.d.ts +2 -1
- package/dist/helper.js +5 -3
- package/dist/helper.mjs +4 -2
- package/dist/http/elysia/index.js +45 -41
- package/dist/http/elysia/index.mjs +10 -6
- package/dist/http/express/index.js +38 -38
- package/dist/http/express/index.mjs +3 -3
- package/dist/http/fastify/index.js +39 -39
- package/dist/http/fastify/index.mjs +4 -4
- package/dist/http/h3/index.js +39 -39
- package/dist/http/h3/index.mjs +3 -3
- package/dist/http/hono/index.js +35 -35
- package/dist/http/hono/index.mjs +3 -3
- package/dist/http/hyper-express/index.js +36 -36
- package/dist/http/hyper-express/index.mjs +3 -3
- package/dist/http/koa/index.js +38 -38
- package/dist/http/koa/index.mjs +3 -3
- package/dist/index.js +44 -44
- package/dist/index.mjs +4 -4
- package/dist/rpc/bullmq/index.js +11 -11
- package/dist/rpc/bullmq/index.mjs +2 -2
- package/dist/rpc/electron/index.js +8 -8
- package/dist/rpc/electron/index.mjs +2 -2
- package/dist/rpc/kafka/index.js +10 -10
- package/dist/rpc/kafka/index.mjs +2 -2
- package/dist/rpc/nats/index.js +11 -11
- package/dist/rpc/nats/index.mjs +2 -2
- package/dist/rpc/rabbitmq/index.js +12 -12
- package/dist/rpc/rabbitmq/index.mjs +2 -2
- package/dist/rpc/redis/index.js +10 -10
- package/dist/rpc/redis/index.mjs +2 -2
- package/dist/rpc/ws/index.js +7 -7
- package/dist/rpc/ws/index.mjs +2 -2
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/package.json +1 -1
package/dist/rpc/nats/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
HMR,
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
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
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
60
|
+
const aop = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
61
61
|
globalFilter,
|
|
62
62
|
globalGuards,
|
|
63
63
|
globalPipe
|
|
64
64
|
});
|
|
65
|
-
const context = new (0,
|
|
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
|
-
|
|
93
|
+
_chunkLLF55NZPjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
94
94
|
subscribeQueues();
|
|
95
|
-
|
|
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
|
-
|
|
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-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
HMR,
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-URKOYTBU.mjs";
|
|
10
10
|
|
|
11
11
|
// src/rpc/rabbitmq/bind.ts
|
|
12
12
|
import Debug from "debug";
|
package/dist/rpc/redis/index.js
CHANGED
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
57
|
+
const aop = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
58
58
|
globalFilter,
|
|
59
59
|
globalGuards,
|
|
60
60
|
globalPipe
|
|
61
61
|
});
|
|
62
|
-
const context = new (0,
|
|
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
|
-
|
|
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
|
-
|
|
99
|
+
_chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
exports.bind = bind;
|
package/dist/rpc/redis/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
HMR,
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-URKOYTBU.mjs";
|
|
10
10
|
|
|
11
11
|
// src/rpc/redis/bind.ts
|
|
12
12
|
import Debug from "debug";
|
package/dist/rpc/ws/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
35
|
+
const aop = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
36
36
|
globalFilter,
|
|
37
37
|
globalGuards,
|
|
38
38
|
globalPipe
|
|
39
39
|
});
|
|
40
|
-
const context = new (0,
|
|
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
|
-
|
|
70
|
+
_chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
exports.bind = bind;
|
package/dist/rpc/ws/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "../../chunk-
|
|
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
|
|
3
|
+
var _chunkSKGOTR4Tjs = require('./chunk-SKGOTR4T.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
62
|
+
_chunkLLF55NZPjs.__name.call(void 0, module, "module");
|
|
63
63
|
return {
|
|
64
64
|
module,
|
|
65
65
|
agent
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkLLF55NZPjs.__name.call(void 0, TestHttp, "TestHttp");
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
package/dist/test.mjs
CHANGED