phecda-server 8.6.0 → 8.7.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/bin/cli.mjs +1 -9
- package/dist/{chunk-XOWAQGBO.js → chunk-CCK6KDM3.js} +59 -65
- package/dist/{chunk-LLF55NZP.js → chunk-IBVPZSZJ.js} +6 -6
- package/dist/{chunk-URKOYTBU.mjs → chunk-ITDH2YDL.mjs} +6 -6
- package/dist/{chunk-5ZZAOOKE.js → chunk-KVWT2QTL.js} +26 -26
- package/dist/{chunk-LQFHZGVJ.mjs → chunk-LNL3MVTR.mjs} +2 -8
- package/dist/{chunk-ZHNYWZRL.mjs → chunk-T5F6Q2CZ.mjs} +1 -1
- package/dist/{chunk-MUUKKO67.mjs → chunk-UK3RDUEP.mjs} +1 -1
- package/dist/{chunk-SKGOTR4T.js → chunk-UP64TNWR.js} +20 -20
- package/dist/{core-BiS3xJKx.d.ts → core-Bd2ynlyb.d.ts} +1 -1
- package/dist/{core-BYxcQ8kf.d.mts → core-nqk9d66O.d.mts} +1 -1
- package/dist/helper.d.mts +1 -1
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +3 -3
- package/dist/helper.mjs +2 -2
- package/dist/http/elysia/index.d.mts +3 -3
- package/dist/http/elysia/index.d.ts +3 -3
- package/dist/http/elysia/index.js +40 -40
- package/dist/http/elysia/index.mjs +3 -3
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +37 -37
- package/dist/http/express/index.mjs +2 -2
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +38 -38
- package/dist/http/fastify/index.mjs +3 -3
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +38 -38
- package/dist/http/h3/index.mjs +2 -2
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +34 -34
- package/dist/http/hono/index.mjs +2 -2
- package/dist/http/hyper-express/index.d.mts +3 -3
- package/dist/http/hyper-express/index.d.ts +3 -3
- package/dist/http/hyper-express/index.js +35 -35
- package/dist/http/hyper-express/index.mjs +2 -2
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +37 -37
- package/dist/http/koa/index.mjs +2 -2
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +54 -54
- package/dist/index.mjs +14 -14
- package/dist/{meta-Csp1xcSR.d.mts → meta-ZbvaS7xK.d.mts} +2 -2
- package/dist/{meta-Csp1xcSR.d.ts → meta-ZbvaS7xK.d.ts} +2 -2
- package/dist/rpc/bullmq/index.d.mts +3 -3
- package/dist/rpc/bullmq/index.d.ts +3 -3
- package/dist/rpc/bullmq/index.js +11 -11
- package/dist/rpc/bullmq/index.mjs +2 -2
- package/dist/rpc/electron/index.d.mts +3 -3
- package/dist/rpc/electron/index.d.ts +3 -3
- package/dist/rpc/electron/index.js +8 -8
- package/dist/rpc/electron/index.mjs +2 -2
- package/dist/rpc/kafka/index.d.mts +3 -3
- package/dist/rpc/kafka/index.d.ts +3 -3
- package/dist/rpc/kafka/index.js +10 -10
- package/dist/rpc/kafka/index.mjs +2 -2
- package/dist/rpc/nats/index.d.mts +3 -3
- package/dist/rpc/nats/index.d.ts +3 -3
- package/dist/rpc/nats/index.js +11 -11
- package/dist/rpc/nats/index.mjs +2 -2
- package/dist/rpc/rabbitmq/index.d.mts +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +3 -3
- package/dist/rpc/rabbitmq/index.js +12 -12
- package/dist/rpc/rabbitmq/index.mjs +2 -2
- package/dist/rpc/redis/index.d.mts +3 -3
- package/dist/rpc/redis/index.d.ts +3 -3
- package/dist/rpc/redis/index.js +10 -10
- package/dist/rpc/redis/index.mjs +2 -2
- package/dist/rpc/web-ext/index.d.mts +3 -3
- package/dist/rpc/web-ext/index.d.ts +3 -3
- package/dist/rpc/web-ext/index.js +8 -8
- package/dist/rpc/web-ext/index.mjs +2 -2
- package/dist/rpc/ws/index.d.mts +3 -3
- package/dist/rpc/ws/index.d.ts +3 -3
- package/dist/rpc/ws/index.js +7 -7
- package/dist/rpc/ws/index.mjs +2 -2
- package/dist/test.d.mts +2 -2
- package/dist/test.d.ts +2 -2
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/dist/{types-Bs64nYvd.d.ts → types-B4zY7i87.d.ts} +1 -1
- package/dist/{types-CjVwVyJT.d.mts → types-BfcBZVua.d.mts} +1 -1
- package/dist/{types-DExQe0qk.d.ts → types-CHWgzilt.d.ts} +1 -1
- package/dist/{types-DSlyrmns.d.mts → types-f_hV_rCD.d.mts} +1 -1
- package/package.json +1 -1
- package/register/index.mjs +2 -0
- package/register/loader.mjs +3 -3
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-LNL3MVTR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
HMR,
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-ITDH2YDL.mjs";
|
|
10
10
|
|
|
11
11
|
// src/rpc/rabbitmq/bind.ts
|
|
12
12
|
import Debug from "debug";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-nqk9d66O.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-f_hV_rCD.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-ZbvaS7xK.mjs';
|
|
6
6
|
|
|
7
7
|
interface RedisCtx extends RpcCtx {
|
|
8
8
|
type: 'redis';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-Bd2ynlyb.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CHWgzilt.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-ZbvaS7xK.js';
|
|
6
6
|
|
|
7
7
|
interface RedisCtx extends RpcCtx {
|
|
8
8
|
type: 'redis';
|
package/dist/rpc/redis/index.js
CHANGED
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkCCK6KDM3js = require('../../chunk-CCK6KDM3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkIBVPZSZJjs = require('../../chunk-IBVPZSZJ.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 = _chunkCCK6KDM3js.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
|
+
_chunkCCK6KDM3js.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
|
+
_chunkCCK6KDM3js.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
|
+
_chunkIBVPZSZJjs.__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 = _chunkCCK6KDM3js.Context.getAop(meta2, {
|
|
58
58
|
globalFilter,
|
|
59
59
|
globalGuards,
|
|
60
60
|
globalPipe
|
|
61
61
|
});
|
|
62
|
-
const context = new (0,
|
|
62
|
+
const context = new (0, _chunkCCK6KDM3js.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
|
+
_chunkIBVPZSZJjs.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
|
+
_chunkIBVPZSZJjs.__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-LNL3MVTR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
HMR,
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-ITDH2YDL.mjs";
|
|
10
10
|
|
|
11
11
|
// src/rpc/redis/bind.ts
|
|
12
12
|
import Debug from "debug";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as Factory } from '../../core-
|
|
2
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
1
|
+
import { F as Factory } from '../../core-nqk9d66O.mjs';
|
|
2
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-f_hV_rCD.mjs';
|
|
3
3
|
import 'phecda-core';
|
|
4
|
-
import '../../meta-
|
|
4
|
+
import '../../meta-ZbvaS7xK.mjs';
|
|
5
5
|
|
|
6
6
|
interface WebExtCtx extends RpcCtx {
|
|
7
7
|
type: 'browser-extension';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as Factory } from '../../core-
|
|
2
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
1
|
+
import { F as Factory } from '../../core-Bd2ynlyb.js';
|
|
2
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CHWgzilt.js';
|
|
3
3
|
import 'phecda-core';
|
|
4
|
-
import '../../meta-
|
|
4
|
+
import '../../meta-ZbvaS7xK.js';
|
|
5
5
|
|
|
6
6
|
interface WebExtCtx extends RpcCtx {
|
|
7
7
|
type: 'browser-extension';
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkCCK6KDM3js = require('../../chunk-CCK6KDM3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkIBVPZSZJjs = require('../../chunk-IBVPZSZJ.js');
|
|
9
9
|
|
|
10
10
|
// src/rpc/web-ext/bind.ts
|
|
11
11
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
12
12
|
var debug = _debug2.default.call(void 0, "phecda-server/electron");
|
|
13
13
|
function bind({ moduleMap, meta }, opts = {}) {
|
|
14
14
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts;
|
|
15
|
-
const metaMap =
|
|
15
|
+
const metaMap = _chunkCCK6KDM3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
16
16
|
const { controller, rpc, method, tag } = meta2.data;
|
|
17
17
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
18
18
|
debug(`register method "${method}" in module "${tag}"`);
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
_chunkCCK6KDM3js.detectAopDep.call(void 0, meta, {
|
|
23
23
|
guards: globalGuards,
|
|
24
24
|
addons: globalAddons
|
|
25
25
|
}, "rpc");
|
|
@@ -30,12 +30,12 @@ function bind({ moduleMap, meta }, opts = {}) {
|
|
|
30
30
|
if (_ps !== 1) return;
|
|
31
31
|
const meta2 = metaMap.get(tag)[method];
|
|
32
32
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
33
|
-
const aop =
|
|
33
|
+
const aop = _chunkCCK6KDM3js.Context.getAop(meta2, {
|
|
34
34
|
globalFilter,
|
|
35
35
|
globalGuards,
|
|
36
36
|
globalPipe
|
|
37
37
|
});
|
|
38
|
-
const context = new (0,
|
|
38
|
+
const context = new (0, _chunkCCK6KDM3js.Context)({
|
|
39
39
|
type: "browser-extension",
|
|
40
40
|
category: "rpc",
|
|
41
41
|
moduleMap,
|
|
@@ -63,9 +63,9 @@ function bind({ moduleMap, meta }, opts = {}) {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
_chunkIBVPZSZJjs.__name.call(void 0, callback, "callback");
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkIBVPZSZJjs.__name.call(void 0, bind, "bind");
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
exports.bind = bind;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-LNL3MVTR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-ITDH2YDL.mjs";
|
|
9
9
|
|
|
10
10
|
// src/rpc/web-ext/bind.ts
|
|
11
11
|
import Debug from "debug";
|
package/dist/rpc/ws/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import WS from 'ws';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-nqk9d66O.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-f_hV_rCD.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-ZbvaS7xK.mjs';
|
|
6
6
|
|
|
7
7
|
interface WsCtx extends RpcCtx {
|
|
8
8
|
type: 'ws';
|
package/dist/rpc/ws/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import WS from 'ws';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-Bd2ynlyb.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CHWgzilt.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-ZbvaS7xK.js';
|
|
6
6
|
|
|
7
7
|
interface WsCtx extends RpcCtx {
|
|
8
8
|
type: 'ws';
|
package/dist/rpc/ws/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkCCK6KDM3js = require('../../chunk-CCK6KDM3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkIBVPZSZJjs = require('../../chunk-IBVPZSZJ.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 = _chunkCCK6KDM3js.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
|
+
_chunkCCK6KDM3js.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 = _chunkCCK6KDM3js.Context.getAop(meta2, {
|
|
36
36
|
globalFilter,
|
|
37
37
|
globalGuards,
|
|
38
38
|
globalPipe
|
|
39
39
|
});
|
|
40
|
-
const context = new (0,
|
|
40
|
+
const context = new (0, _chunkCCK6KDM3js.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
|
+
_chunkIBVPZSZJjs.__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-LNL3MVTR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-ITDH2YDL.mjs";
|
|
9
9
|
|
|
10
10
|
// src/rpc/ws/bind.ts
|
|
11
11
|
import Debug from "debug";
|
package/dist/test.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import * as supertest from 'supertest';
|
|
|
2
2
|
import { Test } from 'supertest';
|
|
3
3
|
import { Server } from 'node:http';
|
|
4
4
|
import { Construct } from 'phecda-core';
|
|
5
|
-
import { F as Factory } from './core-
|
|
6
|
-
import { d as CustomResponse } from './meta-
|
|
5
|
+
import { F as Factory } from './core-nqk9d66O.mjs';
|
|
6
|
+
import { d as CustomResponse } from './meta-ZbvaS7xK.mjs';
|
|
7
7
|
|
|
8
8
|
type PickFuncKeys<Type> = {
|
|
9
9
|
[Key in keyof Type]: Type[Key] extends (...args: any) => any ? (ReturnType<Type[Key]> extends CustomResponse<any> ? never : Key) : never;
|
package/dist/test.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as supertest from 'supertest';
|
|
|
2
2
|
import { Test } from 'supertest';
|
|
3
3
|
import { Server } from 'node:http';
|
|
4
4
|
import { Construct } from 'phecda-core';
|
|
5
|
-
import { F as Factory } from './core-
|
|
6
|
-
import { d as CustomResponse } from './meta-
|
|
5
|
+
import { F as Factory } from './core-Bd2ynlyb.js';
|
|
6
|
+
import { d as CustomResponse } from './meta-ZbvaS7xK.js';
|
|
7
7
|
|
|
8
8
|
type PickFuncKeys<Type> = {
|
|
9
9
|
[Key in keyof Type]: Type[Key] extends (...args: any) => any ? (ReturnType<Type[Key]> extends CustomResponse<any> ? never : Key) : never;
|
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 _chunkUP64TNWRjs = require('./chunk-UP64TNWR.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkIBVPZSZJjs = require('./chunk-IBVPZSZJ.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 _chunkUP64TNWRjs.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
|
+
_chunkIBVPZSZJjs.__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
|
+
_chunkIBVPZSZJjs.__name.call(void 0, module, "module");
|
|
63
63
|
return {
|
|
64
64
|
module,
|
|
65
65
|
agent
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkIBVPZSZJjs.__name.call(void 0, TestHttp, "TestHttp");
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
package/dist/test.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
import { B as BaseCtx, D as DefaultOptions } from './meta-
|
|
2
|
+
import { B as BaseCtx, D as DefaultOptions } from './meta-ZbvaS7xK.js';
|
|
3
3
|
|
|
4
4
|
interface HttpOptions extends DefaultOptions {
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
import { B as BaseCtx, D as DefaultOptions } from './meta-
|
|
2
|
+
import { B as BaseCtx, D as DefaultOptions } from './meta-ZbvaS7xK.mjs';
|
|
3
3
|
|
|
4
4
|
interface HttpOptions extends DefaultOptions {
|
|
5
5
|
/**
|
package/package.json
CHANGED
package/register/index.mjs
CHANGED
package/register/loader.mjs
CHANGED
|
@@ -18,7 +18,7 @@ const require = createRequire(
|
|
|
18
18
|
const debug = Debug('phecda-server/loader')
|
|
19
19
|
|
|
20
20
|
const isLowVersion = parseFloat(process.version.slice(1)) < 18.19
|
|
21
|
-
const
|
|
21
|
+
const IS_WATCH_MODE = !process.env.PS_BAN_WATCH
|
|
22
22
|
let port
|
|
23
23
|
let config
|
|
24
24
|
const workdir = process.cwd()
|
|
@@ -89,7 +89,7 @@ export async function initialize(data) {
|
|
|
89
89
|
if (typeof loader.resolve === 'function')
|
|
90
90
|
customResolve = loader.resolve
|
|
91
91
|
}
|
|
92
|
-
if (
|
|
92
|
+
if (IS_WATCH_MODE) {
|
|
93
93
|
chokidar.watch(configPath, { persistent: true }).on('change', () => {
|
|
94
94
|
port.postMessage(
|
|
95
95
|
JSON.stringify({
|
|
@@ -236,7 +236,7 @@ export const load = async (url, context, nextLoad) => {
|
|
|
236
236
|
) {
|
|
237
237
|
watchFiles.add(url)
|
|
238
238
|
|
|
239
|
-
if (
|
|
239
|
+
if (IS_WATCH_MODE && mode !== 'not-hmr') {
|
|
240
240
|
if (isModuleFileUrl(url)) {
|
|
241
241
|
port.postMessage(
|
|
242
242
|
JSON.stringify({
|