phecda-server 7.0.0-alpha.6 → 7.0.0-alpha.8

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 (79) hide show
  1. package/bin/cli.mjs +10 -1
  2. package/dist/{chunk-JF4YU32E.js → chunk-7EMAZGYO.js} +86 -56
  3. package/dist/{chunk-ICI5KUDX.mjs → chunk-7NWDKK7D.mjs} +1 -1
  4. package/dist/{chunk-HTY3H33L.mjs → chunk-B45BN7LY.mjs} +4 -4
  5. package/dist/{chunk-UKRQVTEY.js → chunk-BBNJVYVX.js} +24 -24
  6. package/dist/{chunk-WYI2F7LD.js → chunk-QJIAXSLZ.js} +19 -19
  7. package/dist/{chunk-3C7Z3IJN.mjs → chunk-SGMQZRP6.mjs} +39 -9
  8. package/dist/{chunk-62FBZWGW.js → chunk-VSGYTGHY.js} +24 -3
  9. package/dist/{chunk-KSDE5G57.mjs → chunk-YKP4ODZA.mjs} +24 -3
  10. package/dist/{core-CzElxZoF.d.ts → core-BGEsBtTG.d.ts} +1 -1
  11. package/dist/{core-DU7gQKSk.d.mts → core-BcKywWLd.d.mts} +1 -1
  12. package/dist/helper.d.mts +3 -2
  13. package/dist/helper.d.ts +3 -2
  14. package/dist/helper.js +5 -3
  15. package/dist/helper.mjs +4 -2
  16. package/dist/http/elysia/index.d.mts +4 -4
  17. package/dist/http/elysia/index.d.ts +4 -4
  18. package/dist/http/elysia/index.js +42 -41
  19. package/dist/http/elysia/index.mjs +6 -5
  20. package/dist/http/express/index.d.mts +4 -4
  21. package/dist/http/express/index.d.ts +4 -4
  22. package/dist/http/express/index.js +39 -38
  23. package/dist/http/express/index.mjs +5 -4
  24. package/dist/http/fastify/index.d.mts +4 -4
  25. package/dist/http/fastify/index.d.ts +4 -4
  26. package/dist/http/fastify/index.js +40 -39
  27. package/dist/http/fastify/index.mjs +6 -5
  28. package/dist/http/h3/index.d.mts +4 -4
  29. package/dist/http/h3/index.d.ts +4 -4
  30. package/dist/http/h3/index.js +40 -39
  31. package/dist/http/h3/index.mjs +6 -5
  32. package/dist/http/hono/index.d.mts +4 -4
  33. package/dist/http/hono/index.d.ts +4 -4
  34. package/dist/http/hono/index.js +35 -35
  35. package/dist/http/hono/index.mjs +2 -2
  36. package/dist/http/hyper-express/index.d.mts +4 -4
  37. package/dist/http/hyper-express/index.d.ts +4 -4
  38. package/dist/http/hyper-express/index.js +37 -36
  39. package/dist/http/hyper-express/index.mjs +5 -4
  40. package/dist/http/koa/index.d.mts +4 -4
  41. package/dist/http/koa/index.d.ts +4 -4
  42. package/dist/http/koa/index.js +39 -38
  43. package/dist/http/koa/index.mjs +5 -4
  44. package/dist/index.d.mts +38 -36
  45. package/dist/index.d.ts +38 -36
  46. package/dist/index.js +44 -43
  47. package/dist/index.mjs +16 -15
  48. package/dist/{meta-BTnLXuCa.d.ts → meta-B_HW7cWh.d.mts} +3 -3
  49. package/dist/{meta-BTnLXuCa.d.mts → meta-B_HW7cWh.d.ts} +3 -3
  50. package/dist/rpc/bullmq/index.d.mts +5 -5
  51. package/dist/rpc/bullmq/index.d.ts +5 -5
  52. package/dist/rpc/bullmq/index.js +14 -14
  53. package/dist/rpc/bullmq/index.mjs +2 -2
  54. package/dist/rpc/kafka/index.d.mts +4 -4
  55. package/dist/rpc/kafka/index.d.ts +4 -4
  56. package/dist/rpc/kafka/index.js +14 -14
  57. package/dist/rpc/kafka/index.mjs +2 -2
  58. package/dist/rpc/nats/index.d.mts +4 -4
  59. package/dist/rpc/nats/index.d.ts +4 -4
  60. package/dist/rpc/nats/index.js +13 -13
  61. package/dist/rpc/nats/index.mjs +2 -2
  62. package/dist/rpc/rabbitmq/index.d.mts +4 -4
  63. package/dist/rpc/rabbitmq/index.d.ts +4 -4
  64. package/dist/rpc/rabbitmq/index.js +15 -15
  65. package/dist/rpc/rabbitmq/index.mjs +2 -2
  66. package/dist/rpc/redis/index.d.mts +4 -4
  67. package/dist/rpc/redis/index.d.ts +4 -4
  68. package/dist/rpc/redis/index.js +13 -13
  69. package/dist/rpc/redis/index.mjs +2 -2
  70. package/dist/test.d.mts +3 -3
  71. package/dist/test.d.ts +3 -3
  72. package/dist/test.js +6 -6
  73. package/dist/test.mjs +2 -2
  74. package/dist/{types--E-OCZhC.d.ts → types-C2SQ9U9V.d.mts} +3 -3
  75. package/dist/{types-CbfaGkPA.d.ts → types-CYF0vha6.d.ts} +3 -3
  76. package/dist/{types-BYqBeqrs.d.mts → types-DEQb_e59.d.mts} +3 -3
  77. package/dist/{types-BxlzVoRv.d.mts → types-PFPIQWVF.d.ts} +3 -3
  78. package/package.json +3 -2
  79. package/register/loader.mjs +2 -2
@@ -4,29 +4,29 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkJF4YU32Ejs = require('../../chunk-JF4YU32E.js');
7
+ var _chunk7EMAZGYOjs = require('../../chunk-7EMAZGYO.js');
8
8
 
9
9
 
10
- var _chunk62FBZWGWjs = require('../../chunk-62FBZWGW.js');
10
+ var _chunkVSGYTGHYjs = require('../../chunk-VSGYTGHY.js');
11
11
 
12
12
  // src/rpc/rabbitmq/bind.ts
13
13
  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 = _chunkJF4YU32Ejs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
+ const metaMap = _chunk7EMAZGYOjs.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
- _chunkJF4YU32Ejs.detectAopDep.call(void 0, meta, {
24
+ _chunk7EMAZGYOjs.detectAopDep.call(void 0, meta, {
25
25
  guards: globalGuards,
26
26
  addons: globalAddons
27
27
  }, "rpc");
28
28
  const existQueue = /* @__PURE__ */ new Set();
29
- _chunkJF4YU32Ejs.Context.applyAddons(globalAddons, ch, "rabbitmq");
29
+ _chunk7EMAZGYOjs.Context.applyAddons(globalAddons, ch, "rabbitmq");
30
30
  async function subscribeQueues() {
31
31
  existQueue.clear();
32
32
  for (const [tag, record] of metaMap) {
@@ -45,12 +45,12 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
45
45
  }
46
46
  }
47
47
  }
48
- _chunk62FBZWGWjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
48
+ _chunkVSGYTGHYjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
49
49
  async function handleRequest(msg) {
50
50
  function send(queue, data) {
51
51
  ch.sendToQueue(queue, Buffer.from(JSON.stringify(data)));
52
52
  }
53
- _chunk62FBZWGWjs.__name.call(void 0, send, "send");
53
+ _chunkVSGYTGHYjs.__name.call(void 0, send, "send");
54
54
  if (msg) {
55
55
  const data = JSON.parse(msg.content.toString());
56
56
  const { tag, func, id, queue: clientQueue, _ps, args } = data;
@@ -58,12 +58,12 @@ 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 = _chunkJF4YU32Ejs.Context.getAop(meta2, {
61
+ const aop = _chunk7EMAZGYOjs.Context.getAop(meta2, {
62
62
  globalFilter,
63
63
  globalGuards,
64
64
  globalPipe
65
65
  });
66
- const context = new (0, _chunkJF4YU32Ejs.Context)({
66
+ const context = new (0, _chunk7EMAZGYOjs.Context)({
67
67
  type: "rabbitmq",
68
68
  category: "rpc",
69
69
  moduleMap,
@@ -91,14 +91,14 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
91
91
  });
92
92
  }
93
93
  }
94
- _chunk62FBZWGWjs.__name.call(void 0, handleRequest, "handleRequest");
94
+ _chunkVSGYTGHYjs.__name.call(void 0, handleRequest, "handleRequest");
95
95
  subscribeQueues();
96
- _chunkJF4YU32Ejs.HMR.call(void 0, async () => {
96
+ _chunk7EMAZGYOjs.HMR.call(void 0, async () => {
97
97
  for (const queue of existQueue) await ch.deleteQueue(queue);
98
98
  await subscribeQueues();
99
99
  });
100
100
  }
101
- _chunk62FBZWGWjs.__name.call(void 0, bind, "bind");
101
+ _chunkVSGYTGHYjs.__name.call(void 0, bind, "bind");
102
102
 
103
103
  // src/rpc/rabbitmq/client.ts
104
104
  var _events = require('events');
@@ -107,7 +107,7 @@ async function createClient(ch, controllers, opts) {
107
107
  let eventCount = 0;
108
108
  const ret = {};
109
109
  const emitter = new (0, _events.EventEmitter)();
110
- const clientQueue = _chunkJF4YU32Ejs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
110
+ const clientQueue = _chunk7EMAZGYOjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
111
111
  await ch.assertQueue(clientQueue);
112
112
  ch.consume(clientQueue, (msg) => {
113
113
  if (!msg) return;
@@ -152,7 +152,7 @@ async function createClient(ch, controllers, opts) {
152
152
  if (error) reject(data);
153
153
  else resolve(data);
154
154
  }
155
- _chunk62FBZWGWjs.__name.call(void 0, listener, "listener");
155
+ _chunkVSGYTGHYjs.__name.call(void 0, listener, "listener");
156
156
  eventCount++;
157
157
  emitter.once(id, listener);
158
158
  });
@@ -162,7 +162,7 @@ async function createClient(ch, controllers, opts) {
162
162
  }
163
163
  return ret;
164
164
  }
165
- _chunk62FBZWGWjs.__name.call(void 0, createClient, "createClient");
165
+ _chunkVSGYTGHYjs.__name.call(void 0, createClient, "createClient");
166
166
 
167
167
 
168
168
 
@@ -4,10 +4,10 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  genClientQueue
7
- } from "../../chunk-3C7Z3IJN.mjs";
7
+ } from "../../chunk-SGMQZRP6.mjs";
8
8
  import {
9
9
  __name
10
- } from "../../chunk-KSDE5G57.mjs";
10
+ } from "../../chunk-YKP4ODZA.mjs";
11
11
 
12
12
  // src/rpc/rabbitmq/bind.ts
13
13
  import Debug from "debug";
@@ -1,10 +1,10 @@
1
1
  import Redis from 'ioredis';
2
- import { F as Factory } from '../../core-DU7gQKSk.mjs';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-BYqBeqrs.mjs';
4
- import { T as ToClientMap } from '../../meta-BTnLXuCa.mjs';
2
+ import { F as Factory } from '../../core-BcKywWLd.mjs';
3
+ import { R as RpcCtx, a as RpcServerOptions, b as RpcClientOptions } from '../../types-DEQb_e59.mjs';
4
+ import { T as ToClientMap } from '../../meta-B_HW7cWh.mjs';
5
5
  import 'phecda-core';
6
6
 
7
- interface RedisCtx extends RpcContext {
7
+ interface RedisCtx extends RpcCtx {
8
8
  type: 'redis';
9
9
  redis: Redis;
10
10
  msg: string;
@@ -1,10 +1,10 @@
1
1
  import Redis from 'ioredis';
2
- import { F as Factory } from '../../core-CzElxZoF.js';
3
- import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-CbfaGkPA.js';
4
- import { T as ToClientMap } from '../../meta-BTnLXuCa.js';
2
+ import { F as Factory } from '../../core-BGEsBtTG.js';
3
+ import { R as RpcCtx, a as RpcServerOptions, b as RpcClientOptions } from '../../types-CYF0vha6.js';
4
+ import { T as ToClientMap } from '../../meta-B_HW7cWh.js';
5
5
  import 'phecda-core';
6
6
 
7
- interface RedisCtx extends RpcContext {
7
+ interface RedisCtx extends RpcCtx {
8
8
  type: 'redis';
9
9
  redis: Redis;
10
10
  msg: string;
@@ -4,29 +4,29 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkJF4YU32Ejs = require('../../chunk-JF4YU32E.js');
7
+ var _chunk7EMAZGYOjs = require('../../chunk-7EMAZGYO.js');
8
8
 
9
9
 
10
- var _chunk62FBZWGWjs = require('../../chunk-62FBZWGW.js');
10
+ var _chunkVSGYTGHYjs = require('../../chunk-VSGYTGHY.js');
11
11
 
12
12
  // src/rpc/redis/bind.ts
13
13
  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 = _chunkJF4YU32Ejs.createControllerMetaMap.call(void 0, meta, (meta2) => {
17
+ const metaMap = _chunk7EMAZGYOjs.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
- _chunkJF4YU32Ejs.detectAopDep.call(void 0, meta, {
24
+ _chunk7EMAZGYOjs.detectAopDep.call(void 0, meta, {
25
25
  guards: globalGuards,
26
26
  addons: globalAddons
27
27
  }, "rpc");
28
28
  const existQueue = /* @__PURE__ */ new Set();
29
- _chunkJF4YU32Ejs.Context.applyAddons(globalAddons, {
29
+ _chunk7EMAZGYOjs.Context.applyAddons(globalAddons, {
30
30
  pub,
31
31
  sub
32
32
  }, "redis");
@@ -45,7 +45,7 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
45
45
  }
46
46
  }
47
47
  }
48
- _chunk62FBZWGWjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
48
+ _chunkVSGYTGHYjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
49
49
  sub.on("message", async (channel, msg) => {
50
50
  if (!existQueue.has(channel)) return;
51
51
  if (msg) {
@@ -55,12 +55,12 @@ 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 = _chunkJF4YU32Ejs.Context.getAop(meta2, {
58
+ const aop = _chunk7EMAZGYOjs.Context.getAop(meta2, {
59
59
  globalFilter,
60
60
  globalGuards,
61
61
  globalPipe
62
62
  });
63
- const context = new (0, _chunkJF4YU32Ejs.Context)({
63
+ const context = new (0, _chunk7EMAZGYOjs.Context)({
64
64
  type: "redis",
65
65
  category: "rpc",
66
66
  moduleMap,
@@ -92,12 +92,12 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
92
92
  }
93
93
  });
94
94
  subscribeQueues();
95
- _chunkJF4YU32Ejs.HMR.call(void 0, async () => {
95
+ _chunk7EMAZGYOjs.HMR.call(void 0, async () => {
96
96
  for (const queue of existQueue) await sub.unsubscribe(queue);
97
97
  subscribeQueues();
98
98
  });
99
99
  }
100
- _chunk62FBZWGWjs.__name.call(void 0, bind, "bind");
100
+ _chunkVSGYTGHYjs.__name.call(void 0, bind, "bind");
101
101
 
102
102
  // src/rpc/redis/client.ts
103
103
  var _events = require('events'); var _events2 = _interopRequireDefault(_events);
@@ -106,7 +106,7 @@ async function createClient({ pub, sub }, controllers, opts) {
106
106
  let eventId = 1;
107
107
  let eventCount = 0;
108
108
  const emitter = new (0, _events2.default)();
109
- const clientQueue = _chunkJF4YU32Ejs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
109
+ const clientQueue = _chunk7EMAZGYOjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
110
110
  await sub.subscribe(clientQueue);
111
111
  for (const i in controllers) {
112
112
  ret[i] = new Proxy(new controllers[i](), {
@@ -146,7 +146,7 @@ async function createClient({ pub, sub }, controllers, opts) {
146
146
  if (error) reject(data);
147
147
  else resolve(data);
148
148
  }
149
- _chunk62FBZWGWjs.__name.call(void 0, listener, "listener");
149
+ _chunkVSGYTGHYjs.__name.call(void 0, listener, "listener");
150
150
  eventCount++;
151
151
  emitter.once(id, listener);
152
152
  });
@@ -162,7 +162,7 @@ async function createClient({ pub, sub }, controllers, opts) {
162
162
  });
163
163
  return ret;
164
164
  }
165
- _chunk62FBZWGWjs.__name.call(void 0, createClient, "createClient");
165
+ _chunkVSGYTGHYjs.__name.call(void 0, createClient, "createClient");
166
166
 
167
167
 
168
168
 
@@ -4,10 +4,10 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  genClientQueue
7
- } from "../../chunk-3C7Z3IJN.mjs";
7
+ } from "../../chunk-SGMQZRP6.mjs";
8
8
  import {
9
9
  __name
10
- } from "../../chunk-KSDE5G57.mjs";
10
+ } from "../../chunk-YKP4ODZA.mjs";
11
11
 
12
12
  // src/rpc/redis/bind.ts
13
13
  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-DU7gQKSk.mjs';
6
- import { P as PickFunc } from './meta-BTnLXuCa.mjs';
5
+ import { F as Factory } from './core-BcKywWLd.mjs';
6
+ import { P as PickFunc } from './meta-B_HW7cWh.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, "use" | "on" | "set" | "query" | "type" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "key" | "pfx" | "cert"> & {
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"> & {
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-CzElxZoF.js';
6
- import { P as PickFunc } from './meta-BTnLXuCa.js';
5
+ import { F as Factory } from './core-BGEsBtTG.js';
6
+ import { P as PickFunc } from './meta-B_HW7cWh.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, "use" | "on" | "set" | "query" | "type" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "key" | "pfx" | "cert"> & {
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"> & {
15
15
  module: <T extends Construct>(Module: T) => SuperTestRequest<PickFunc<InstanceType<T>>>;
16
16
  }>;
17
17
 
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 _chunkWYI2F7LDjs = require('./chunk-WYI2F7LD.js');
3
+ var _chunkQJIAXSLZjs = require('./chunk-QJIAXSLZ.js');
4
4
 
5
5
 
6
- var _chunk62FBZWGWjs = require('./chunk-62FBZWGW.js');
6
+ var _chunkVSGYTGHYjs = require('./chunk-VSGYTGHY.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 _chunkWYI2F7LDjs.Factory.call(void 0, Modules);
11
+ const { moduleMap, modelMap } = await _chunkQJIAXSLZjs.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
- _chunk62FBZWGWjs.__name.call(void 0, TestFactory, "TestFactory");
22
+ _chunkVSGYTGHYjs.__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,11 +59,11 @@ async function TestHttp(app, { moduleMap, meta }, isAgent = true) {
59
59
  }
60
60
  });
61
61
  }
62
- _chunk62FBZWGWjs.__name.call(void 0, module, "module");
62
+ _chunkVSGYTGHYjs.__name.call(void 0, module, "module");
63
63
  Agent.module = module;
64
64
  return Agent;
65
65
  }
66
- _chunk62FBZWGWjs.__name.call(void 0, TestHttp, "TestHttp");
66
+ _chunkVSGYTGHYjs.__name.call(void 0, TestHttp, "TestHttp");
67
67
 
68
68
 
69
69
 
package/dist/test.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Factory
3
- } from "./chunk-HTY3H33L.mjs";
3
+ } from "./chunk-B45BN7LY.mjs";
4
4
  import {
5
5
  __name
6
- } from "./chunk-KSDE5G57.mjs";
6
+ } from "./chunk-YKP4ODZA.mjs";
7
7
 
8
8
  // src/test.ts
9
9
  import { getTag } from "phecda-core";
@@ -1,5 +1,5 @@
1
1
  import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
2
- import { D as DefaultOptions, B as BaseContext } from './meta-BTnLXuCa.js';
2
+ import { B as BaseCtx, D as DefaultOptions } from './meta-B_HW7cWh.mjs';
3
3
 
4
4
  interface HttpOptions extends DefaultOptions {
5
5
  /**
@@ -15,7 +15,7 @@ interface HttpOptions extends DefaultOptions {
15
15
  */
16
16
  dynamic?: boolean;
17
17
  }
18
- interface HttpContext extends BaseContext {
18
+ interface HttpCtx extends BaseCtx {
19
19
  parallel?: true;
20
20
  index?: number;
21
21
  query: Record<string, any>;
@@ -45,4 +45,4 @@ interface CookieSerializeOptions {
45
45
  partitioned?: boolean;
46
46
  }
47
47
 
48
- export type { CookieSerializeOptions as C, HttpContext as H, HttpOptions as a };
48
+ export type { CookieSerializeOptions as C, HttpCtx as H, HttpOptions as a };
@@ -1,4 +1,4 @@
1
- import { D as DefaultOptions, B as BaseContext } from './meta-BTnLXuCa.js';
1
+ import { B as BaseCtx, D as DefaultOptions } from './meta-B_HW7cWh.js';
2
2
 
3
3
  interface RpcServerOptions extends DefaultOptions {
4
4
  defaultQueue?: string;
@@ -8,7 +8,7 @@ interface RpcClientOptions {
8
8
  timeout?: number;
9
9
  max?: number;
10
10
  }
11
- interface RpcContext extends BaseContext {
11
+ interface RpcCtx extends BaseCtx {
12
12
  args: any[];
13
13
  id: string;
14
14
  queue: string;
@@ -16,4 +16,4 @@ interface RpcContext extends BaseContext {
16
16
  category: 'rpc';
17
17
  }
18
18
 
19
- export type { RpcContext as R, RpcServerOptions as a, RpcClientOptions as b };
19
+ export type { RpcCtx as R, RpcServerOptions as a, RpcClientOptions as b };
@@ -1,4 +1,4 @@
1
- import { D as DefaultOptions, B as BaseContext } from './meta-BTnLXuCa.mjs';
1
+ import { B as BaseCtx, D as DefaultOptions } from './meta-B_HW7cWh.mjs';
2
2
 
3
3
  interface RpcServerOptions extends DefaultOptions {
4
4
  defaultQueue?: string;
@@ -8,7 +8,7 @@ interface RpcClientOptions {
8
8
  timeout?: number;
9
9
  max?: number;
10
10
  }
11
- interface RpcContext extends BaseContext {
11
+ interface RpcCtx extends BaseCtx {
12
12
  args: any[];
13
13
  id: string;
14
14
  queue: string;
@@ -16,4 +16,4 @@ interface RpcContext extends BaseContext {
16
16
  category: 'rpc';
17
17
  }
18
18
 
19
- export type { RpcContext as R, RpcServerOptions as a, RpcClientOptions as b };
19
+ export type { RpcCtx 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-BTnLXuCa.mjs';
2
+ import { B as BaseCtx, D as DefaultOptions } from './meta-B_HW7cWh.js';
3
3
 
4
4
  interface HttpOptions extends DefaultOptions {
5
5
  /**
@@ -15,7 +15,7 @@ interface HttpOptions extends DefaultOptions {
15
15
  */
16
16
  dynamic?: boolean;
17
17
  }
18
- interface HttpContext extends BaseContext {
18
+ interface HttpCtx extends BaseCtx {
19
19
  parallel?: true;
20
20
  index?: number;
21
21
  query: Record<string, any>;
@@ -45,4 +45,4 @@ interface CookieSerializeOptions {
45
45
  partitioned?: boolean;
46
46
  }
47
47
 
48
- export type { CookieSerializeOptions as C, HttpContext as H, HttpOptions as a };
48
+ export type { CookieSerializeOptions as C, HttpCtx as H, HttpOptions as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-server",
3
- "version": "7.0.0-alpha.6",
3
+ "version": "7.0.0-alpha.8",
4
4
  "description": "server framework that provide IOC/type-reuse/http&rpc-adaptor",
5
5
  "author": "fgsreally",
6
6
  "license": "MIT",
@@ -129,7 +129,8 @@
129
129
  }
130
130
  },
131
131
  "bin": {
132
- "phecda": "bin/cli.mjs"
132
+ "phecda": "bin/cli.mjs",
133
+ "phecda-server": "bin/cli.mjs"
133
134
  },
134
135
  "files": [
135
136
  "dist",
@@ -12,7 +12,7 @@ import { createRequire } from 'module'
12
12
  import { existsSync } from 'fs'
13
13
  import ts from 'typescript'
14
14
  import chokidar from 'chokidar'
15
- import { log } from '../dist/index.mjs'
15
+ import { IS_DEV, log } from '../dist/index.mjs'
16
16
  import { compile, genUnImportRet, handleClassTypes, slash } from './utils.mjs'
17
17
 
18
18
  let port
@@ -279,7 +279,7 @@ export const load = async (url, context, nextLoad) => {
279
279
  // }),
280
280
  // )
281
281
 
282
- if (!process.env.PS_HMR_BAN) {
282
+ if (IS_DEV && !process.env.PS_HMR_BAN) {
283
283
  chokidar.watch(fileURLToPath(url), { persistent: true }).on(
284
284
  'change',
285
285
  debounce(() => {