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.
Files changed (71) hide show
  1. package/bin/cli.mjs +7 -7
  2. package/dist/{chunk-V7EI76QQ.mjs → chunk-3FHZB3Z5.mjs} +1 -1
  3. package/dist/{chunk-GSPBHZBH.js → chunk-NQIFUZL4.js} +1 -1
  4. package/dist/{core-CYwEPfN4.d.ts → core-C1kHRqU9.d.ts} +1 -1
  5. package/dist/{core-BIcUwV18.d.mts → core-CSiaRU7r.d.mts} +1 -1
  6. package/dist/helper.d.mts +1 -1
  7. package/dist/helper.d.ts +1 -1
  8. package/dist/helper.js +2 -2
  9. package/dist/helper.mjs +1 -1
  10. package/dist/http/elysia/index.d.mts +3 -3
  11. package/dist/http/elysia/index.d.ts +3 -3
  12. package/dist/http/elysia/index.js +19 -17
  13. package/dist/http/elysia/index.mjs +3 -1
  14. package/dist/http/express/index.d.mts +3 -3
  15. package/dist/http/express/index.d.ts +3 -3
  16. package/dist/http/express/index.js +19 -17
  17. package/dist/http/express/index.mjs +3 -1
  18. package/dist/http/fastify/index.d.mts +3 -3
  19. package/dist/http/fastify/index.d.ts +3 -3
  20. package/dist/http/fastify/index.js +18 -16
  21. package/dist/http/fastify/index.mjs +3 -1
  22. package/dist/http/h3/index.d.mts +3 -3
  23. package/dist/http/h3/index.d.ts +3 -3
  24. package/dist/http/h3/index.js +18 -16
  25. package/dist/http/h3/index.mjs +3 -1
  26. package/dist/http/hono/index.d.mts +3 -3
  27. package/dist/http/hono/index.d.ts +3 -3
  28. package/dist/http/hono/index.js +17 -15
  29. package/dist/http/hono/index.mjs +3 -1
  30. package/dist/http/hyper-express/index.d.mts +3 -3
  31. package/dist/http/hyper-express/index.d.ts +3 -3
  32. package/dist/http/hyper-express/index.js +17 -15
  33. package/dist/http/hyper-express/index.mjs +3 -1
  34. package/dist/http/koa/index.d.mts +3 -3
  35. package/dist/http/koa/index.d.ts +3 -3
  36. package/dist/http/koa/index.js +19 -17
  37. package/dist/http/koa/index.mjs +3 -1
  38. package/dist/index.d.mts +8 -8
  39. package/dist/index.d.ts +8 -8
  40. package/dist/index.js +19 -19
  41. package/dist/index.mjs +2 -2
  42. package/dist/{meta-BXKLFTgG.d.mts → meta-D1M85Hef.d.mts} +1 -0
  43. package/dist/{meta-BXKLFTgG.d.ts → meta-D1M85Hef.d.ts} +1 -0
  44. package/dist/rpc/bullmq/index.d.mts +3 -3
  45. package/dist/rpc/bullmq/index.d.ts +3 -3
  46. package/dist/rpc/bullmq/index.js +9 -8
  47. package/dist/rpc/bullmq/index.mjs +2 -1
  48. package/dist/rpc/kafka/index.d.mts +3 -3
  49. package/dist/rpc/kafka/index.d.ts +3 -3
  50. package/dist/rpc/kafka/index.js +8 -7
  51. package/dist/rpc/kafka/index.mjs +2 -1
  52. package/dist/rpc/nats/index.d.mts +3 -3
  53. package/dist/rpc/nats/index.d.ts +3 -3
  54. package/dist/rpc/nats/index.js +8 -7
  55. package/dist/rpc/nats/index.mjs +2 -1
  56. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  57. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  58. package/dist/rpc/rabbitmq/index.js +9 -8
  59. package/dist/rpc/rabbitmq/index.mjs +2 -1
  60. package/dist/rpc/redis/index.d.mts +3 -3
  61. package/dist/rpc/redis/index.d.ts +3 -3
  62. package/dist/rpc/redis/index.js +9 -8
  63. package/dist/rpc/redis/index.mjs +2 -1
  64. package/dist/test.d.mts +3 -3
  65. package/dist/test.d.ts +3 -3
  66. package/dist/{types-BtbL49Zs.d.mts → types-C9Remkup.d.ts} +2 -1
  67. package/dist/{types-m3IEDKjP.d.ts → types-JMhFVp-Z.d.mts} +2 -1
  68. package/dist/{types-VFzEM7LL.d.ts → types-ee1FBodH.d.ts} +2 -1
  69. package/dist/{types-h40T3cRG.d.mts → types-wbHHC93P.d.mts} +2 -1
  70. package/package.json +1 -1
  71. package/register/loader.mjs +1 -1
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkGSPBHZBHjs = require('../../chunk-GSPBHZBH.js');
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 = _chunkGSPBHZBHjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
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
- _chunkGSPBHZBHjs.detectAopDep.call(void 0, meta, {
27
+ _chunkNQIFUZL4js.detectAopDep.call(void 0, meta, {
28
28
  addons: globalAddons,
29
29
  guards: globalGuards
30
30
  }, "rpc");
31
- _chunkGSPBHZBHjs.Context.applyAddons(globalAddons, nc, "nats");
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 = _chunkGSPBHZBHjs.Context.getAop(meta2, {
59
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
60
60
  globalFilter,
61
61
  globalGuards,
62
62
  globalPipe
63
63
  });
64
- const context = new (0, _chunkGSPBHZBHjs.Context)({
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
- _chunkGSPBHZBHjs.HMR.call(void 0, async () => {
93
+ _chunkNQIFUZL4js.HMR.call(void 0, async () => {
93
94
  for (const i in subscriptionMap) subscriptionMap[i].unsubscribe();
94
95
  await subscribeQueues();
95
96
  });
@@ -3,7 +3,7 @@ import {
3
3
  HMR,
4
4
  createControllerMetaMap,
5
5
  detectAopDep
6
- } from "../../chunk-V7EI76QQ.mjs";
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-BIcUwV18.mjs';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-BtbL49Zs.mjs';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.mjs';
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-CYwEPfN4.js';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-m3IEDKjP.js';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.js';
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 _chunkGSPBHZBHjs = require('../../chunk-GSPBHZBH.js');
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 = _chunkGSPBHZBHjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
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
- _chunkGSPBHZBHjs.detectAopDep.call(void 0, meta, {
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
- _chunkGSPBHZBHjs.Context.applyAddons(globalAddons, ch, "rabbitmq");
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 = _chunkGSPBHZBHjs.Context.getAop(meta2, {
61
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
62
62
  globalFilter,
63
63
  globalGuards,
64
64
  globalPipe
65
65
  });
66
- const context = new (0, _chunkGSPBHZBHjs.Context)({
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
- _chunkGSPBHZBHjs.HMR.call(void 0, async () => {
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 = _chunkGSPBHZBHjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
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-V7EI76QQ.mjs";
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-BIcUwV18.mjs';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-BtbL49Zs.mjs';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.mjs';
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-CYwEPfN4.js';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-m3IEDKjP.js';
4
- import { T as ToClientMap } from '../../meta-BXKLFTgG.js';
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 {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkGSPBHZBHjs = require('../../chunk-GSPBHZBH.js');
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 = _chunkGSPBHZBHjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
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
- _chunkGSPBHZBHjs.detectAopDep.call(void 0, meta, {
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
- _chunkGSPBHZBHjs.Context.applyAddons(globalAddons, {
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 = _chunkGSPBHZBHjs.Context.getAop(meta2, {
58
+ const aop = _chunkNQIFUZL4js.Context.getAop(meta2, {
59
59
  globalFilter,
60
60
  globalGuards,
61
61
  globalPipe
62
62
  });
63
- const context = new (0, _chunkGSPBHZBHjs.Context)({
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
- _chunkGSPBHZBHjs.HMR.call(void 0, async () => {
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 = _chunkGSPBHZBHjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
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](), {
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  genClientQueue
7
- } from "../../chunk-V7EI76QQ.mjs";
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-BIcUwV18.mjs';
6
- import { P as PickFunc } from './meta-BXKLFTgG.mjs';
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, "type" | "query" | "key" | "use" | "on" | "set" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "pfx" | "cert"> & {
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-CYwEPfN4.js';
6
- import { P as PickFunc } from './meta-BXKLFTgG.js';
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, "type" | "query" | "key" | "use" | "on" | "set" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "pfx" | "cert"> & {
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-BXKLFTgG.mjs';
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-BXKLFTgG.js';
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-BXKLFTgG.js';
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-BXKLFTgG.mjs';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-server",
3
- "version": "7.0.0-alpha.1",
3
+ "version": "7.0.0-alpha.2",
4
4
  "description": "server framework that provide IOC/type-reuse/http&rpc-adaptor",
5
5
  "author": "fgsreally",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@ if (isLowVersion)
40
40
 
41
41
  let config
42
42
 
43
- const workdir = process.env.PS_WORKDIR || process.cwd()
43
+ const workdir = process.cwd()
44
44
 
45
45
  const configPath = resolvePath(
46
46
  workdir,