phecda-server 7.0.0-alpha.1 → 7.0.0-alpha.2
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 +7 -7
- package/dist/{chunk-V7EI76QQ.mjs → chunk-3FHZB3Z5.mjs} +1 -1
- package/dist/{chunk-GSPBHZBH.js → chunk-NQIFUZL4.js} +1 -1
- package/dist/{core-CYwEPfN4.d.ts → core-C1kHRqU9.d.ts} +1 -1
- package/dist/{core-BIcUwV18.d.mts → core-CSiaRU7r.d.mts} +1 -1
- package/dist/helper.d.mts +1 -1
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +2 -2
- package/dist/helper.mjs +1 -1
- package/dist/http/elysia/index.d.mts +3 -3
- package/dist/http/elysia/index.d.ts +3 -3
- package/dist/http/elysia/index.js +19 -17
- package/dist/http/elysia/index.mjs +3 -1
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +19 -17
- package/dist/http/express/index.mjs +3 -1
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +18 -16
- package/dist/http/fastify/index.mjs +3 -1
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +18 -16
- package/dist/http/h3/index.mjs +3 -1
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +17 -15
- package/dist/http/hono/index.mjs +3 -1
- 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 +17 -15
- package/dist/http/hyper-express/index.mjs +3 -1
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +19 -17
- package/dist/http/koa/index.mjs +3 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +19 -19
- package/dist/index.mjs +2 -2
- package/dist/{meta-BXKLFTgG.d.mts → meta-D1M85Hef.d.mts} +1 -0
- package/dist/{meta-BXKLFTgG.d.ts → meta-D1M85Hef.d.ts} +1 -0
- package/dist/rpc/bullmq/index.d.mts +3 -3
- package/dist/rpc/bullmq/index.d.ts +3 -3
- package/dist/rpc/bullmq/index.js +9 -8
- package/dist/rpc/bullmq/index.mjs +2 -1
- package/dist/rpc/kafka/index.d.mts +3 -3
- package/dist/rpc/kafka/index.d.ts +3 -3
- package/dist/rpc/kafka/index.js +8 -7
- package/dist/rpc/kafka/index.mjs +2 -1
- package/dist/rpc/nats/index.d.mts +3 -3
- package/dist/rpc/nats/index.d.ts +3 -3
- package/dist/rpc/nats/index.js +8 -7
- package/dist/rpc/nats/index.mjs +2 -1
- package/dist/rpc/rabbitmq/index.d.mts +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +3 -3
- package/dist/rpc/rabbitmq/index.js +9 -8
- package/dist/rpc/rabbitmq/index.mjs +2 -1
- package/dist/rpc/redis/index.d.mts +3 -3
- package/dist/rpc/redis/index.d.ts +3 -3
- package/dist/rpc/redis/index.js +9 -8
- package/dist/rpc/redis/index.mjs +2 -1
- package/dist/test.d.mts +3 -3
- package/dist/test.d.ts +3 -3
- package/dist/{types-BtbL49Zs.d.mts → types-C9Remkup.d.ts} +2 -1
- package/dist/{types-m3IEDKjP.d.ts → types-JMhFVp-Z.d.mts} +2 -1
- package/dist/{types-VFzEM7LL.d.ts → types-ee1FBodH.d.ts} +2 -1
- package/dist/{types-h40T3cRG.d.mts → types-wbHHC93P.d.mts} +2 -1
- package/package.json +1 -1
- package/register/loader.mjs +1 -1
package/dist/rpc/nats/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
|
|
@@ -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 =
|
|
20
|
+
const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
21
21
|
const { controller, rpc, func, tag } = meta2.data;
|
|
22
22
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _2 => _2.queue]) !== void 0) {
|
|
23
23
|
debug(`register method "${func}" in module "${tag}"`);
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
_chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
|
|
28
28
|
addons: globalAddons,
|
|
29
29
|
guards: globalGuards
|
|
30
30
|
}, "rpc");
|
|
31
|
-
|
|
31
|
+
_chunkNQIFUZL4js.Context.applyAddons(globalAddons, nc, "nats");
|
|
32
32
|
async function subscribeQueues() {
|
|
33
33
|
existQueue.clear();
|
|
34
34
|
for (const [tag, record] of metaMap) {
|
|
@@ -56,13 +56,14 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
56
56
|
const meta2 = metaMap.get(tag)[func];
|
|
57
57
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
58
58
|
if (isEvent) msg.respond("{}");
|
|
59
|
-
const aop =
|
|
59
|
+
const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
|
|
60
60
|
globalFilter,
|
|
61
61
|
globalGuards,
|
|
62
62
|
globalPipe
|
|
63
63
|
});
|
|
64
|
-
const context = new (0,
|
|
64
|
+
const context = new (0, _chunkNQIFUZL4js.Context)({
|
|
65
65
|
type: "nats",
|
|
66
|
+
category: "rpc",
|
|
66
67
|
moduleMap,
|
|
67
68
|
meta: meta2,
|
|
68
69
|
tag,
|
|
@@ -89,7 +90,7 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
89
90
|
}
|
|
90
91
|
_chunkJ5CFUN4Vjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
91
92
|
subscribeQueues();
|
|
92
|
-
|
|
93
|
+
_chunkNQIFUZL4js.HMR.call(void 0, async () => {
|
|
93
94
|
for (const i in subscriptionMap) subscriptionMap[i].unsubscribe();
|
|
94
95
|
await subscribeQueues();
|
|
95
96
|
});
|
package/dist/rpc/nats/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
HMR,
|
|
4
4
|
createControllerMetaMap,
|
|
5
5
|
detectAopDep
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-3FHZB3Z5.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "../../chunk-WHJ5FALK.mjs";
|
|
@@ -63,6 +63,7 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
63
63
|
});
|
|
64
64
|
const context = new Context({
|
|
65
65
|
type: "nats",
|
|
66
|
+
category: "rpc",
|
|
66
67
|
moduleMap,
|
|
67
68
|
meta: meta2,
|
|
68
69
|
tag,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-
|
|
4
|
-
import { T as ToClientMap } from '../../meta-
|
|
2
|
+
import { F as Factory } from '../../core-CSiaRU7r.mjs';
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JMhFVp-Z.mjs';
|
|
4
|
+
import { T as ToClientMap } from '../../meta-D1M85Hef.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
7
7
|
interface RabbitmqCtx extends RpcContext {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-
|
|
4
|
-
import { T as ToClientMap } from '../../meta-
|
|
2
|
+
import { F as Factory } from '../../core-C1kHRqU9.js';
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-C9Remkup.js';
|
|
4
|
+
import { T as ToClientMap } from '../../meta-D1M85Hef.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
7
7
|
interface RabbitmqCtx extends RpcContext {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
|
|
@@ -14,19 +14,19 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
|
14
14
|
var debug = _debug2.default.call(void 0, "phecda-server/rabbitmq");
|
|
15
15
|
async function bind(ch, { moduleMap, meta }, opts = {}) {
|
|
16
16
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
|
|
17
|
-
const metaMap =
|
|
17
|
+
const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
18
18
|
const { controller, rpc, func, tag } = meta2.data;
|
|
19
19
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
20
20
|
debug(`register method "${func}" in module "${tag}"`);
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
_chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
|
|
25
25
|
guards: globalGuards,
|
|
26
26
|
addons: globalAddons
|
|
27
27
|
}, "rpc");
|
|
28
28
|
const existQueue = /* @__PURE__ */ new Set();
|
|
29
|
-
|
|
29
|
+
_chunkNQIFUZL4js.Context.applyAddons(globalAddons, ch, "rabbitmq");
|
|
30
30
|
async function subscribeQueues() {
|
|
31
31
|
existQueue.clear();
|
|
32
32
|
for (const [tag, record] of metaMap) {
|
|
@@ -58,13 +58,14 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
|
|
|
58
58
|
debug(`invoke method "${func}" in module "${tag}"`);
|
|
59
59
|
const meta2 = metaMap.get(tag)[func];
|
|
60
60
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
61
|
-
const aop =
|
|
61
|
+
const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
|
|
62
62
|
globalFilter,
|
|
63
63
|
globalGuards,
|
|
64
64
|
globalPipe
|
|
65
65
|
});
|
|
66
|
-
const context = new (0,
|
|
66
|
+
const context = new (0, _chunkNQIFUZL4js.Context)({
|
|
67
67
|
type: "rabbitmq",
|
|
68
|
+
category: "rpc",
|
|
68
69
|
moduleMap,
|
|
69
70
|
meta: meta2,
|
|
70
71
|
tag,
|
|
@@ -92,7 +93,7 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
|
|
|
92
93
|
}
|
|
93
94
|
_chunkJ5CFUN4Vjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
94
95
|
subscribeQueues();
|
|
95
|
-
|
|
96
|
+
_chunkNQIFUZL4js.HMR.call(void 0, async () => {
|
|
96
97
|
for (const queue of existQueue) await ch.deleteQueue(queue);
|
|
97
98
|
await subscribeQueues();
|
|
98
99
|
});
|
|
@@ -106,7 +107,7 @@ async function createClient(ch, controllers, opts) {
|
|
|
106
107
|
let eventCount = 0;
|
|
107
108
|
const ret = {};
|
|
108
109
|
const emitter = new (0, _events.EventEmitter)();
|
|
109
|
-
const clientQueue =
|
|
110
|
+
const clientQueue = _chunkNQIFUZL4js.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
|
|
110
111
|
await ch.assertQueue(clientQueue);
|
|
111
112
|
ch.consume(clientQueue, (msg) => {
|
|
112
113
|
if (!msg) return;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createControllerMetaMap,
|
|
5
5
|
detectAopDep,
|
|
6
6
|
genClientQueue
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-3FHZB3Z5.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
10
|
} from "../../chunk-WHJ5FALK.mjs";
|
|
@@ -65,6 +65,7 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
|
|
|
65
65
|
});
|
|
66
66
|
const context = new Context({
|
|
67
67
|
type: "rabbitmq",
|
|
68
|
+
category: "rpc",
|
|
68
69
|
moduleMap,
|
|
69
70
|
meta: meta2,
|
|
70
71
|
tag,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-
|
|
4
|
-
import { T as ToClientMap } from '../../meta-
|
|
2
|
+
import { F as Factory } from '../../core-CSiaRU7r.mjs';
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JMhFVp-Z.mjs';
|
|
4
|
+
import { T as ToClientMap } from '../../meta-D1M85Hef.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
7
7
|
interface RedisCtx extends RpcContext {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-
|
|
4
|
-
import { T as ToClientMap } from '../../meta-
|
|
2
|
+
import { F as Factory } from '../../core-C1kHRqU9.js';
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-C9Remkup.js';
|
|
4
|
+
import { T as ToClientMap } from '../../meta-D1M85Hef.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
7
7
|
interface RedisCtx extends RpcContext {
|
package/dist/rpc/redis/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkNQIFUZL4js = require('../../chunk-NQIFUZL4.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkJ5CFUN4Vjs = require('../../chunk-J5CFUN4V.js');
|
|
@@ -14,19 +14,19 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
|
14
14
|
var debug = _debug2.default.call(void 0, "phecda-server/redis");
|
|
15
15
|
function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
|
|
16
16
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
|
|
17
|
-
const metaMap =
|
|
17
|
+
const metaMap = _chunkNQIFUZL4js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
18
18
|
const { controller, rpc, func, tag } = meta2.data;
|
|
19
19
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
20
20
|
debug(`register method "${func}" in module "${tag}"`);
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
_chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
|
|
25
25
|
guards: globalGuards,
|
|
26
26
|
addons: globalAddons
|
|
27
27
|
}, "rpc");
|
|
28
28
|
const existQueue = /* @__PURE__ */ new Set();
|
|
29
|
-
|
|
29
|
+
_chunkNQIFUZL4js.Context.applyAddons(globalAddons, {
|
|
30
30
|
pub,
|
|
31
31
|
sub
|
|
32
32
|
}, "redis");
|
|
@@ -55,13 +55,14 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
|
|
|
55
55
|
if (_ps !== 1) return;
|
|
56
56
|
const meta2 = metaMap.get(tag)[func];
|
|
57
57
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
58
|
-
const aop =
|
|
58
|
+
const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
|
|
59
59
|
globalFilter,
|
|
60
60
|
globalGuards,
|
|
61
61
|
globalPipe
|
|
62
62
|
});
|
|
63
|
-
const context = new (0,
|
|
63
|
+
const context = new (0, _chunkNQIFUZL4js.Context)({
|
|
64
64
|
type: "redis",
|
|
65
|
+
category: "rpc",
|
|
65
66
|
moduleMap,
|
|
66
67
|
redis: sub,
|
|
67
68
|
meta: meta2,
|
|
@@ -91,7 +92,7 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
|
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
94
|
subscribeQueues();
|
|
94
|
-
|
|
95
|
+
_chunkNQIFUZL4js.HMR.call(void 0, async () => {
|
|
95
96
|
for (const queue of existQueue) await sub.unsubscribe(queue);
|
|
96
97
|
subscribeQueues();
|
|
97
98
|
});
|
|
@@ -105,7 +106,7 @@ async function createClient({ pub, sub }, controllers, opts) {
|
|
|
105
106
|
let eventId = 1;
|
|
106
107
|
let eventCount = 0;
|
|
107
108
|
const emitter = new (0, _events2.default)();
|
|
108
|
-
const clientQueue =
|
|
109
|
+
const clientQueue = _chunkNQIFUZL4js.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
|
|
109
110
|
await sub.subscribe(clientQueue);
|
|
110
111
|
for (const i in controllers) {
|
|
111
112
|
ret[i] = new Proxy(new controllers[i](), {
|
package/dist/rpc/redis/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createControllerMetaMap,
|
|
5
5
|
detectAopDep,
|
|
6
6
|
genClientQueue
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-3FHZB3Z5.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
10
|
} from "../../chunk-WHJ5FALK.mjs";
|
|
@@ -62,6 +62,7 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
|
|
|
62
62
|
});
|
|
63
63
|
const context = new Context({
|
|
64
64
|
type: "redis",
|
|
65
|
+
category: "rpc",
|
|
65
66
|
moduleMap,
|
|
66
67
|
redis: sub,
|
|
67
68
|
meta: meta2,
|
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 { P as PickFunc } from './meta-
|
|
5
|
+
import { F as Factory } from './core-CSiaRU7r.mjs';
|
|
6
|
+
import { P as PickFunc } from './meta-D1M85Hef.mjs';
|
|
7
7
|
|
|
8
8
|
declare function TestFactory<T extends Construct[]>(...Modules: T): Promise<{
|
|
9
9
|
get<C extends T[number]>(Model: C): InstanceType<C>;
|
|
@@ -11,7 +11,7 @@ declare function TestFactory<T extends Construct[]>(...Modules: T): Promise<{
|
|
|
11
11
|
type SuperTestRequest<T> = {
|
|
12
12
|
[K in keyof T]: T[K] extends (...args: infer R) => any ? (...args: R) => Test : never;
|
|
13
13
|
};
|
|
14
|
-
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "
|
|
14
|
+
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "use" | "on" | "set" | "query" | "type" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "key" | "pfx" | "cert"> & {
|
|
15
15
|
module: <T extends Construct>(Module: T) => SuperTestRequest<PickFunc<InstanceType<T>>>;
|
|
16
16
|
}>;
|
|
17
17
|
|
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 { P as PickFunc } from './meta-
|
|
5
|
+
import { F as Factory } from './core-C1kHRqU9.js';
|
|
6
|
+
import { P as PickFunc } from './meta-D1M85Hef.js';
|
|
7
7
|
|
|
8
8
|
declare function TestFactory<T extends Construct[]>(...Modules: T): Promise<{
|
|
9
9
|
get<C extends T[number]>(Model: C): InstanceType<C>;
|
|
@@ -11,7 +11,7 @@ declare function TestFactory<T extends Construct[]>(...Modules: T): Promise<{
|
|
|
11
11
|
type SuperTestRequest<T> = {
|
|
12
12
|
[K in keyof T]: T[K] extends (...args: infer R) => any ? (...args: R) => Test : never;
|
|
13
13
|
};
|
|
14
|
-
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "
|
|
14
|
+
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "use" | "on" | "set" | "query" | "type" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "key" | "pfx" | "cert"> & {
|
|
15
15
|
module: <T extends Construct>(Module: T) => SuperTestRequest<PickFunc<InstanceType<T>>>;
|
|
16
16
|
}>;
|
|
17
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultOptions, B as BaseContext } from './meta-
|
|
1
|
+
import { D as DefaultOptions, B as BaseContext } from './meta-D1M85Hef.js';
|
|
2
2
|
|
|
3
3
|
interface RpcServerOptions extends DefaultOptions {
|
|
4
4
|
defaultQueue?: string;
|
|
@@ -13,6 +13,7 @@ interface RpcContext extends BaseContext {
|
|
|
13
13
|
id: string;
|
|
14
14
|
queue: string;
|
|
15
15
|
isEvent?: boolean;
|
|
16
|
+
category: 'rpc';
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export type { RpcContext as R, RpcServerOptions as a, RpcClientOptions as b };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultOptions, B as BaseContext } from './meta-
|
|
1
|
+
import { D as DefaultOptions, B as BaseContext } from './meta-D1M85Hef.mjs';
|
|
2
2
|
|
|
3
3
|
interface RpcServerOptions extends DefaultOptions {
|
|
4
4
|
defaultQueue?: string;
|
|
@@ -13,6 +13,7 @@ interface RpcContext extends BaseContext {
|
|
|
13
13
|
id: string;
|
|
14
14
|
queue: string;
|
|
15
15
|
isEvent?: boolean;
|
|
16
|
+
category: 'rpc';
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export type { RpcContext as R, RpcServerOptions as a, RpcClientOptions as b };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
import { D as DefaultOptions, B as BaseContext } from './meta-
|
|
2
|
+
import { D as DefaultOptions, B as BaseContext } from './meta-D1M85Hef.js';
|
|
3
3
|
|
|
4
4
|
interface HttpOptions extends DefaultOptions {
|
|
5
5
|
/**
|
|
@@ -22,6 +22,7 @@ interface HttpContext extends BaseContext {
|
|
|
22
22
|
params: Record<string, string>;
|
|
23
23
|
body: Record<string, any>;
|
|
24
24
|
headers: IncomingHttpHeaders;
|
|
25
|
+
category: 'http';
|
|
25
26
|
redirect: (url: string, status?: number) => void;
|
|
26
27
|
getCookie(key: string): string | undefined;
|
|
27
28
|
setCookie(key: string, value: string, opts?: CookieSerializeOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
import { D as DefaultOptions, B as BaseContext } from './meta-
|
|
2
|
+
import { D as DefaultOptions, B as BaseContext } from './meta-D1M85Hef.mjs';
|
|
3
3
|
|
|
4
4
|
interface HttpOptions extends DefaultOptions {
|
|
5
5
|
/**
|
|
@@ -22,6 +22,7 @@ interface HttpContext extends BaseContext {
|
|
|
22
22
|
params: Record<string, string>;
|
|
23
23
|
body: Record<string, any>;
|
|
24
24
|
headers: IncomingHttpHeaders;
|
|
25
|
+
category: 'http';
|
|
25
26
|
redirect: (url: string, status?: number) => void;
|
|
26
27
|
getCookie(key: string): string | undefined;
|
|
27
28
|
setCookie(key: string, value: string, opts?: CookieSerializeOptions): void;
|
package/package.json
CHANGED