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

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 (81) hide show
  1. package/dist/{chunk-MMG73S64.mjs → chunk-3C7Z3IJN.mjs} +1 -1
  2. package/dist/chunk-62FBZWGW.js +106 -0
  3. package/dist/{chunk-A53KNKY4.mjs → chunk-HTY3H33L.mjs} +33 -3
  4. package/dist/{chunk-KUGFI6SC.mjs → chunk-ICI5KUDX.mjs} +1 -1
  5. package/dist/{chunk-6EBEME3I.js → chunk-JF4YU32E.js} +51 -51
  6. package/dist/chunk-KSDE5G57.mjs +106 -0
  7. package/dist/{chunk-QCOBXM7F.js → chunk-UKRQVTEY.js} +24 -24
  8. package/dist/{chunk-PKSWGQLW.js → chunk-WYI2F7LD.js} +50 -20
  9. package/dist/{core-C1kHRqU9.d.ts → core-CzElxZoF.d.ts} +2 -1
  10. package/dist/{core-CSiaRU7r.d.mts → core-DU7gQKSk.d.mts} +2 -1
  11. package/dist/helper.d.mts +1 -1
  12. package/dist/helper.d.ts +1 -1
  13. package/dist/helper.js +3 -3
  14. package/dist/helper.mjs +2 -2
  15. package/dist/http/elysia/index.d.mts +3 -3
  16. package/dist/http/elysia/index.d.ts +3 -3
  17. package/dist/http/elysia/index.js +40 -40
  18. package/dist/http/elysia/index.mjs +3 -3
  19. package/dist/http/express/index.d.mts +3 -3
  20. package/dist/http/express/index.d.ts +3 -3
  21. package/dist/http/express/index.js +37 -37
  22. package/dist/http/express/index.mjs +2 -2
  23. package/dist/http/fastify/index.d.mts +3 -3
  24. package/dist/http/fastify/index.d.ts +3 -3
  25. package/dist/http/fastify/index.js +38 -38
  26. package/dist/http/fastify/index.mjs +3 -3
  27. package/dist/http/h3/index.d.mts +3 -3
  28. package/dist/http/h3/index.d.ts +3 -3
  29. package/dist/http/h3/index.js +37 -37
  30. package/dist/http/h3/index.mjs +2 -2
  31. package/dist/http/hono/index.d.mts +3 -3
  32. package/dist/http/hono/index.d.ts +3 -3
  33. package/dist/http/hono/index.js +35 -35
  34. package/dist/http/hono/index.mjs +2 -2
  35. package/dist/http/hyper-express/index.d.mts +3 -3
  36. package/dist/http/hyper-express/index.d.ts +3 -3
  37. package/dist/http/hyper-express/index.js +35 -35
  38. package/dist/http/hyper-express/index.mjs +2 -2
  39. package/dist/http/koa/index.d.mts +3 -3
  40. package/dist/http/koa/index.d.ts +3 -3
  41. package/dist/http/koa/index.js +37 -37
  42. package/dist/http/koa/index.mjs +2 -2
  43. package/dist/index.d.mts +19 -15
  44. package/dist/index.d.ts +19 -15
  45. package/dist/index.js +43 -38
  46. package/dist/index.mjs +9 -4
  47. package/dist/{meta-D1M85Hef.d.ts → meta-BTnLXuCa.d.mts} +2 -1
  48. package/dist/{meta-D1M85Hef.d.mts → meta-BTnLXuCa.d.ts} +2 -1
  49. package/dist/rpc/bullmq/index.d.mts +3 -3
  50. package/dist/rpc/bullmq/index.d.ts +3 -3
  51. package/dist/rpc/bullmq/index.js +14 -14
  52. package/dist/rpc/bullmq/index.mjs +2 -2
  53. package/dist/rpc/kafka/index.d.mts +3 -3
  54. package/dist/rpc/kafka/index.d.ts +3 -3
  55. package/dist/rpc/kafka/index.js +14 -14
  56. package/dist/rpc/kafka/index.mjs +2 -2
  57. package/dist/rpc/nats/index.d.mts +3 -3
  58. package/dist/rpc/nats/index.d.ts +3 -3
  59. package/dist/rpc/nats/index.js +13 -13
  60. package/dist/rpc/nats/index.mjs +2 -2
  61. package/dist/rpc/rabbitmq/index.d.mts +3 -3
  62. package/dist/rpc/rabbitmq/index.d.ts +3 -3
  63. package/dist/rpc/rabbitmq/index.js +15 -15
  64. package/dist/rpc/rabbitmq/index.mjs +2 -2
  65. package/dist/rpc/redis/index.d.mts +3 -3
  66. package/dist/rpc/redis/index.d.ts +3 -3
  67. package/dist/rpc/redis/index.js +13 -13
  68. package/dist/rpc/redis/index.mjs +2 -2
  69. package/dist/test.d.mts +3 -3
  70. package/dist/test.d.ts +3 -3
  71. package/dist/test.js +6 -6
  72. package/dist/test.mjs +2 -2
  73. package/dist/{types-ee1FBodH.d.ts → types--E-OCZhC.d.ts} +1 -1
  74. package/dist/{types-JMhFVp-Z.d.mts → types-BYqBeqrs.d.mts} +1 -1
  75. package/dist/{types-wbHHC93P.d.mts → types-BxlzVoRv.d.mts} +1 -1
  76. package/dist/{types-C9Remkup.d.ts → types-CbfaGkPA.d.ts} +1 -1
  77. package/package.json +1 -1
  78. package/register/loader.mjs +2 -1
  79. package/register/utils.mjs +56 -56
  80. package/dist/chunk-QD3QR3NW.mjs +0 -73
  81. package/dist/chunk-RQSQRZL4.js +0 -73
@@ -5,10 +5,10 @@
5
5
 
6
6
 
7
7
 
8
- var _chunk6EBEME3Ijs = require('../../chunk-6EBEME3I.js');
8
+ var _chunkJF4YU32Ejs = require('../../chunk-JF4YU32E.js');
9
9
 
10
10
 
11
- var _chunkRQSQRZL4js = require('../../chunk-RQSQRZL4.js');
11
+ var _chunk62FBZWGWjs = require('../../chunk-62FBZWGW.js');
12
12
 
13
13
  // src/http/koa/bind.ts
14
14
  var _router = require('@koa/router'); var _router2 = _interopRequireDefault(_router);
@@ -18,14 +18,14 @@ function bind(router, data, opts = {}) {
18
18
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
19
19
  const { moduleMap, meta } = data;
20
20
  const originStack = router.stack.slice(0, router.stack.length);
21
- const metaMap = _chunk6EBEME3Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkJF4YU32Ejs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, http, func, tag } = meta2.data;
23
23
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
24
24
  debug(`register method "${func}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunk6EBEME3Ijs.detectAopDep.call(void 0, meta, {
28
+ _chunkJF4YU32Ejs.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -34,29 +34,29 @@ function bind(router, data, opts = {}) {
34
34
  });
35
35
  registerRoute();
36
36
  function registerRoute() {
37
- _chunk6EBEME3Ijs.Context.applyAddons(globalAddons, router, "koa");
37
+ _chunkJF4YU32Ejs.Context.applyAddons(globalAddons, router, "koa");
38
38
  if (parallelRoute) {
39
39
  const subRouter = new (0, _router2.default)();
40
- _chunk6EBEME3Ijs.Context.applyAddons(parallelAddons, subRouter, "koa");
40
+ _chunkJF4YU32Ejs.Context.applyAddons(parallelAddons, subRouter, "koa");
41
41
  subRouter.post(parallelRoute, async (ctx, next) => {
42
42
  const { body } = ctx.request;
43
43
  async function errorHandler(e) {
44
- const error = await _chunk6EBEME3Ijs.Context.filterRecord.default(e);
44
+ const error = await _chunkJF4YU32Ejs.Context.filterRecord.default(e);
45
45
  ctx.status = error.status;
46
46
  ctx.body = error;
47
47
  }
48
- _chunkRQSQRZL4js.__name.call(void 0, errorHandler, "errorHandler");
49
- if (!Array.isArray(body)) return errorHandler(new (0, _chunk6EBEME3Ijs.BadRequestException)("data format should be an array"));
48
+ _chunk62FBZWGWjs.__name.call(void 0, errorHandler, "errorHandler");
49
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkJF4YU32Ejs.BadRequestException)("data format should be an array"));
50
50
  try {
51
51
  return Promise.all(body.map((item, i) => {
52
52
  return new Promise(async (resolve) => {
53
53
  const { tag, func } = item;
54
54
  debug(`(parallel)invoke method "${func}" in module "${tag}"`);
55
- if (!metaMap.has(tag)) return resolve(await _chunk6EBEME3Ijs.Context.filterRecord.default(new (0, _chunk6EBEME3Ijs.BadRequestException)(`module "${tag}" doesn't exist`)));
55
+ if (!metaMap.has(tag)) return resolve(await _chunkJF4YU32Ejs.Context.filterRecord.default(new (0, _chunkJF4YU32Ejs.BadRequestException)(`module "${tag}" doesn't exist`)));
56
56
  const meta2 = metaMap.get(tag)[func];
57
- if (!meta2) return resolve(await _chunk6EBEME3Ijs.Context.filterRecord.default(new (0, _chunk6EBEME3Ijs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
57
+ if (!meta2) return resolve(await _chunkJF4YU32Ejs.Context.filterRecord.default(new (0, _chunkJF4YU32Ejs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
58
58
  const { data: { params } } = meta2;
59
- const aop = _chunk6EBEME3Ijs.Context.getAop(meta2, {
59
+ const aop = _chunkJF4YU32Ejs.Context.getAop(meta2, {
60
60
  globalGuards,
61
61
  globalFilter,
62
62
  globalPipe
@@ -71,21 +71,21 @@ function bind(router, data, opts = {}) {
71
71
  parallel: true,
72
72
  next,
73
73
  app: router,
74
- ..._chunk6EBEME3Ijs.argToReq.call(void 0, params, item.args, ctx.headers),
74
+ ..._chunkJF4YU32Ejs.argToReq.call(void 0, params, item.args, ctx.headers),
75
75
  tag,
76
76
  func,
77
- getCookie: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
78
- setCookie: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
79
- delCookie: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (key) => ctx.cookies.set(key, "", {
77
+ getCookie: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
78
+ setCookie: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
79
+ delCookie: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (key) => ctx.cookies.set(key, "", {
80
80
  expires: /* @__PURE__ */ new Date(0)
81
81
  }), "delCookie"),
82
- redirect: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (url) => ctx.redirect(url), "redirect"),
83
- setResHeaders: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (headers) => ctx.set(headers), "setResHeaders"),
84
- setResStatus: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (status) => ctx.status = status, "setResStatus"),
85
- getRequest: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, () => ctx.req, "getRequest"),
86
- getResponse: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, () => ctx.res, "getResponse")
82
+ redirect: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (url) => ctx.redirect(url), "redirect"),
83
+ setResHeaders: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (headers) => ctx.set(headers), "setResHeaders"),
84
+ setResStatus: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (status) => ctx.status = status, "setResStatus"),
85
+ getRequest: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, () => ctx.req, "getRequest"),
86
+ getResponse: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, () => ctx.res, "getResponse")
87
87
  };
88
- const context = new (0, _chunk6EBEME3Ijs.Context)(contextData);
88
+ const context = new (0, _chunkJF4YU32Ejs.Context)(contextData);
89
89
  context.run(aop, resolve, resolve);
90
90
  });
91
91
  })).then((ret) => {
@@ -104,14 +104,14 @@ function bind(router, data, opts = {}) {
104
104
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
105
105
  let aop;
106
106
  if (!dynamic) {
107
- aop = _chunk6EBEME3Ijs.Context.getAop(meta2, {
107
+ aop = _chunkJF4YU32Ejs.Context.getAop(meta2, {
108
108
  globalFilter,
109
109
  globalGuards,
110
110
  globalPipe
111
111
  });
112
112
  }
113
113
  const subRouter = new (0, _router2.default)();
114
- _chunk6EBEME3Ijs.Context.applyAddons(addons, subRouter, "koa");
114
+ _chunkJF4YU32Ejs.Context.applyAddons(addons, subRouter, "koa");
115
115
  router[http.type](http.prefix + http.route, async (ctx, next) => {
116
116
  debug(`invoke method "${func}" in module "${tag}"`);
117
117
  const contextData = {
@@ -128,21 +128,21 @@ function bind(router, data, opts = {}) {
128
128
  body: ctx.request.body,
129
129
  headers: ctx.headers,
130
130
  next,
131
- getCookie: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
132
- setCookie: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
133
- delCookie: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (key) => ctx.cookies.set(key, "", {
131
+ getCookie: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
132
+ setCookie: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
133
+ delCookie: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (key) => ctx.cookies.set(key, "", {
134
134
  expires: /* @__PURE__ */ new Date(0)
135
135
  }), "delCookie"),
136
- redirect: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (url) => ctx.redirect(url), "redirect"),
137
- setResHeaders: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (headers) => ctx.set(headers), "setResHeaders"),
138
- setResStatus: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, (status) => ctx.status = status, "setResStatus"),
139
- getRequest: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, () => ctx.req, "getRequest"),
140
- getResponse: /* @__PURE__ */ _chunkRQSQRZL4js.__name.call(void 0, () => ctx.res, "getResponse")
136
+ redirect: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (url) => ctx.redirect(url), "redirect"),
137
+ setResHeaders: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (headers) => ctx.set(headers), "setResHeaders"),
138
+ setResStatus: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, (status) => ctx.status = status, "setResStatus"),
139
+ getRequest: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, () => ctx.req, "getRequest"),
140
+ getResponse: /* @__PURE__ */ _chunk62FBZWGWjs.__name.call(void 0, () => ctx.res, "getResponse")
141
141
  };
142
- const context = new (0, _chunk6EBEME3Ijs.Context)(contextData);
142
+ const context = new (0, _chunkJF4YU32Ejs.Context)(contextData);
143
143
  if (http.headers) ctx.set(http.headers);
144
144
  if (dynamic) {
145
- aop = _chunk6EBEME3Ijs.Context.getAop(meta2, {
145
+ aop = _chunkJF4YU32Ejs.Context.getAop(meta2, {
146
146
  globalFilter,
147
147
  globalGuards,
148
148
  globalPipe
@@ -161,13 +161,13 @@ function bind(router, data, opts = {}) {
161
161
  }
162
162
  }
163
163
  }
164
- _chunkRQSQRZL4js.__name.call(void 0, registerRoute, "registerRoute");
165
- _chunk6EBEME3Ijs.HMR.call(void 0, async () => {
164
+ _chunk62FBZWGWjs.__name.call(void 0, registerRoute, "registerRoute");
165
+ _chunkJF4YU32Ejs.HMR.call(void 0, async () => {
166
166
  router.stack = originStack;
167
167
  registerRoute();
168
168
  });
169
169
  }
170
- _chunkRQSQRZL4js.__name.call(void 0, bind, "bind");
170
+ _chunk62FBZWGWjs.__name.call(void 0, bind, "bind");
171
171
 
172
172
 
173
173
  exports.bind = bind;
@@ -5,10 +5,10 @@ import {
5
5
  argToReq,
6
6
  createControllerMetaMap,
7
7
  detectAopDep
8
- } from "../../chunk-MMG73S64.mjs";
8
+ } from "../../chunk-3C7Z3IJN.mjs";
9
9
  import {
10
10
  __name
11
- } from "../../chunk-QD3QR3NW.mjs";
11
+ } from "../../chunk-KSDE5G57.mjs";
12
12
 
13
13
  // src/http/koa/bind.ts
14
14
  import Router from "@koa/router";
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-D1M85Hef.mjs';
2
- export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-D1M85Hef.mjs';
3
- import { G as Generator } from './core-CSiaRU7r.mjs';
4
- export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-CSiaRU7r.mjs';
1
+ import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-BTnLXuCa.mjs';
2
+ export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, m as IS_READY, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, n as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-BTnLXuCa.mjs';
3
+ import { G as Generator } from './core-DU7gQKSk.mjs';
4
+ export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-DU7gQKSk.mjs';
5
5
  import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpContext } from './types-wbHHC93P.mjs';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-wbHHC93P.mjs';
9
- import { R as RpcContext } from './types-JMhFVp-Z.mjs';
10
- export { b as RpcClientOptions, a as RpcServerOptions } from './types-JMhFVp-Z.mjs';
7
+ import { H as HttpContext } from './types-BxlzVoRv.mjs';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types-BxlzVoRv.mjs';
9
+ import { R as RpcContext } from './types-BYqBeqrs.mjs';
10
+ export { b as RpcClientOptions, a as RpcServerOptions } from './types-BYqBeqrs.mjs';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
@@ -190,8 +190,18 @@ declare function Define(key: string, value: any): any;
190
190
 
191
191
  declare const defaultPipe: PipeType;
192
192
 
193
+ type LogLevel = 'error' | 'info' | 'warn' | 'log' | 'debug';
194
+ interface Logger {
195
+ log(msg: string, level: LogLevel, ctx?: string): void;
196
+ }
197
+ declare function setLogger(logger: Logger): void;
198
+ declare function getLogger(): Logger;
199
+ declare function log(msg: string, level?: LogLevel, ctx?: any): void;
200
+ declare function runMiddleware(ctx: HttpContext, middleware: (req: any, res: any, next?: any) => any): Promise<unknown>;
201
+
193
202
  declare class ServerBase extends Base {
194
203
  emitter: Emitter;
204
+ log(msg: string, level: LogLevel): void;
195
205
  }
196
206
  declare class HttpBase extends ServerBase {
197
207
  context: HttpContext;
@@ -253,10 +263,4 @@ declare class PExtension extends ServerBase {
253
263
  constructor(tag?: string);
254
264
  }
255
265
 
256
- type LogLevel = 'error' | 'info' | 'warn' | 'log' | 'debug';
257
- declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): void;
258
- declare function getLogger(): Record<LogLevel, (msg: string) => void>;
259
- declare function log(msg: string, level?: LogLevel): void;
260
- declare function runMiddleware(ctx: HttpContext, middleware: (req: any, res: any, next?: any) => any): Promise<unknown>;
261
-
262
- export { type AOP, Addon, Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, InvalidInputException, MetaData, NotFoundException, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
266
+ export { type AOP, Addon, Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, InvalidInputException, type LogLevel, type Logger, MetaData, NotFoundException, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-D1M85Hef.js';
2
- export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-D1M85Hef.js';
3
- import { G as Generator } from './core-C1kHRqU9.js';
4
- export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-C1kHRqU9.js';
1
+ import { B as BaseContext, a as ControllerMeta, D as DefaultOptions, C as ControllerMetaData, b as MetaData, E as Emitter, c as BaseError } from './meta-BTnLXuCa.js';
2
+ export { g as BaseRequestType, f as BaseReturn, h as CustomResponse, j as ERROR_SYMBOL, i as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, m as IS_READY, l as IS_STRICT, L as LOG_LEVEL, M as Meta, O as OmitFunction, n as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, e as ToClientFn, d as ToClientInstance, T as ToClientMap } from './meta-BTnLXuCa.js';
3
+ import { G as Generator } from './core-CzElxZoF.js';
4
+ export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-CzElxZoF.js';
5
5
  import { Base } from 'phecda-core';
6
6
  export * from 'phecda-core';
7
- import { H as HttpContext } from './types-ee1FBodH.js';
8
- export { C as CookieSerializeOptions, a as HttpOptions } from './types-ee1FBodH.js';
9
- import { R as RpcContext } from './types-C9Remkup.js';
10
- export { b as RpcClientOptions, a as RpcServerOptions } from './types-C9Remkup.js';
7
+ import { H as HttpContext } from './types--E-OCZhC.js';
8
+ export { C as CookieSerializeOptions, a as HttpOptions } from './types--E-OCZhC.js';
9
+ import { R as RpcContext } from './types-CbfaGkPA.js';
10
+ export { b as RpcClientOptions, a as RpcServerOptions } from './types-CbfaGkPA.js';
11
11
  export { Mixin } from 'ts-mixer';
12
12
  import 'node:http';
13
13
 
@@ -190,8 +190,18 @@ declare function Define(key: string, value: any): any;
190
190
 
191
191
  declare const defaultPipe: PipeType;
192
192
 
193
+ type LogLevel = 'error' | 'info' | 'warn' | 'log' | 'debug';
194
+ interface Logger {
195
+ log(msg: string, level: LogLevel, ctx?: string): void;
196
+ }
197
+ declare function setLogger(logger: Logger): void;
198
+ declare function getLogger(): Logger;
199
+ declare function log(msg: string, level?: LogLevel, ctx?: any): void;
200
+ declare function runMiddleware(ctx: HttpContext, middleware: (req: any, res: any, next?: any) => any): Promise<unknown>;
201
+
193
202
  declare class ServerBase extends Base {
194
203
  emitter: Emitter;
204
+ log(msg: string, level: LogLevel): void;
195
205
  }
196
206
  declare class HttpBase extends ServerBase {
197
207
  context: HttpContext;
@@ -253,10 +263,4 @@ declare class PExtension extends ServerBase {
253
263
  constructor(tag?: string);
254
264
  }
255
265
 
256
- type LogLevel = 'error' | 'info' | 'warn' | 'log' | 'debug';
257
- declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): void;
258
- declare function getLogger(): Record<LogLevel, (msg: string) => void>;
259
- declare function log(msg: string, level?: LogLevel): void;
260
- declare function runMiddleware(ctx: HttpContext, middleware: (req: any, res: any, next?: any) => any): Promise<unknown>;
261
-
262
- export { type AOP, Addon, Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, InvalidInputException, MetaData, NotFoundException, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
266
+ export { type AOP, Addon, Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, InvalidInputException, type LogLevel, type Logger, MetaData, NotFoundException, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkPKSWGQLWjs = require('./chunk-PKSWGQLW.js');
9
+ var _chunkWYI2F7LDjs = require('./chunk-WYI2F7LD.js');
10
10
 
11
11
 
12
12
 
@@ -31,7 +31,7 @@ var _chunkPKSWGQLWjs = require('./chunk-PKSWGQLW.js');
31
31
 
32
32
 
33
33
 
34
- var _chunkQCOBXM7Fjs = require('./chunk-QCOBXM7F.js');
34
+ var _chunkUKRQVTEYjs = require('./chunk-UKRQVTEY.js');
35
35
 
36
36
 
37
37
 
@@ -56,7 +56,7 @@ var _chunkQCOBXM7Fjs = require('./chunk-QCOBXM7F.js');
56
56
 
57
57
 
58
58
 
59
- var _chunk6EBEME3Ijs = require('./chunk-6EBEME3I.js');
59
+ var _chunkJF4YU32Ejs = require('./chunk-JF4YU32E.js');
60
60
 
61
61
 
62
62
 
@@ -70,13 +70,14 @@ var _chunk6EBEME3Ijs = require('./chunk-6EBEME3I.js');
70
70
 
71
71
 
72
72
 
73
- var _chunkRQSQRZL4js = require('./chunk-RQSQRZL4.js');
73
+
74
+ var _chunk62FBZWGWjs = require('./chunk-62FBZWGW.js');
74
75
 
75
76
  // src/types.ts
76
77
  var ResponseSymbol = Symbol("response");
77
78
  var CustomResponse = class {
78
79
  static {
79
- _chunkRQSQRZL4js.__name.call(void 0, this, "CustomResponse");
80
+ _chunk62FBZWGWjs.__name.call(void 0, this, "CustomResponse");
80
81
  }
81
82
 
82
83
  };
@@ -89,35 +90,38 @@ function _ts_decorate(decorators, target, key, desc) {
89
90
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
90
91
  return c > 3 && r && Object.defineProperty(target, key, r), r;
91
92
  }
92
- _chunkRQSQRZL4js.__name.call(void 0, _ts_decorate, "_ts_decorate");
93
+ _chunk62FBZWGWjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
93
94
  function _ts_metadata(k, v) {
94
95
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
95
96
  }
96
- _chunkRQSQRZL4js.__name.call(void 0, _ts_metadata, "_ts_metadata");
97
+ _chunk62FBZWGWjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
97
98
  var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
98
99
  static {
99
- _chunkRQSQRZL4js.__name.call(void 0, this, "ServerBase");
100
+ _chunk62FBZWGWjs.__name.call(void 0, this, "ServerBase");
101
+ }
102
+ __init() {this.emitter = exports.emitter = _chunkWYI2F7LDjs.emitter}
103
+ log(msg, level) {
104
+ _chunk62FBZWGWjs.log.call(void 0, msg, level, this.tag);
100
105
  }
101
- __init() {this.emitter = exports.emitter = _chunkPKSWGQLWjs.emitter}
102
106
  }, _class);
103
107
  var HttpBase = class extends ServerBase {
104
108
  static {
105
- _chunkRQSQRZL4js.__name.call(void 0, this, "HttpBase");
109
+ _chunk62FBZWGWjs.__name.call(void 0, this, "HttpBase");
106
110
  }
107
111
 
108
112
  };
109
113
  _ts_decorate([
110
- _chunkQCOBXM7Fjs.Ctx,
114
+ _chunkUKRQVTEYjs.Ctx,
111
115
  _ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
112
116
  ], HttpBase.prototype, "context", void 0);
113
117
  var RpcBase = class extends ServerBase {
114
118
  static {
115
- _chunkRQSQRZL4js.__name.call(void 0, this, "RpcBase");
119
+ _chunk62FBZWGWjs.__name.call(void 0, this, "RpcBase");
116
120
  }
117
121
 
118
122
  };
119
123
  _ts_decorate([
120
- _chunkQCOBXM7Fjs.Ctx,
124
+ _chunkUKRQVTEYjs.Ctx,
121
125
  _ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
122
126
  ], RpcBase.prototype, "context", void 0);
123
127
 
@@ -125,15 +129,15 @@ _ts_decorate([
125
129
 
126
130
  var PFilter = class extends ServerBase {
127
131
  static {
128
- _chunkRQSQRZL4js.__name.call(void 0, this, "PFilter");
132
+ _chunk62FBZWGWjs.__name.call(void 0, this, "PFilter");
129
133
  }
130
134
 
131
135
  constructor(tag) {
132
136
  super();
133
137
  this.key = tag || _phecdacore.getTag.call(void 0, this);
134
- _chunk6EBEME3Ijs.addFilter.call(void 0, this.key, this.use.bind(this));
138
+ _chunkJF4YU32Ejs.addFilter.call(void 0, this.key, this.use.bind(this));
135
139
  this.onUnmount(() => {
136
- delete _chunk6EBEME3Ijs.Context.filterRecord[this.key];
140
+ delete _chunkJF4YU32Ejs.Context.filterRecord[this.key];
137
141
  });
138
142
  }
139
143
  };
@@ -142,16 +146,16 @@ var PFilter = class extends ServerBase {
142
146
 
143
147
  var PGuard = (_class2 = class extends ServerBase {
144
148
  static {
145
- _chunkRQSQRZL4js.__name.call(void 0, this, "PGuard");
149
+ _chunk62FBZWGWjs.__name.call(void 0, this, "PGuard");
146
150
  }
147
151
 
148
152
  __init2() {this.priority = 0}
149
153
  constructor(tag) {
150
154
  super();_class2.prototype.__init2.call(this);;
151
155
  this.key = tag || _phecdacore.getTag.call(void 0, this);
152
- _chunk6EBEME3Ijs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
156
+ _chunkJF4YU32Ejs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
153
157
  this.onUnmount(() => {
154
- delete _chunk6EBEME3Ijs.Context.guardRecord[this.key];
158
+ delete _chunkJF4YU32Ejs.Context.guardRecord[this.key];
155
159
  });
156
160
  }
157
161
  }, _class2);
@@ -160,15 +164,15 @@ var PGuard = (_class2 = class extends ServerBase {
160
164
 
161
165
  var PPipe = class extends ServerBase {
162
166
  static {
163
- _chunkRQSQRZL4js.__name.call(void 0, this, "PPipe");
167
+ _chunk62FBZWGWjs.__name.call(void 0, this, "PPipe");
164
168
  }
165
169
 
166
170
  constructor(tag) {
167
171
  super();
168
172
  this.key = tag || _phecdacore.getTag.call(void 0, this);
169
- _chunk6EBEME3Ijs.addPipe.call(void 0, this.key, this.use.bind(this));
173
+ _chunkJF4YU32Ejs.addPipe.call(void 0, this.key, this.use.bind(this));
170
174
  this.onUnmount(() => {
171
- delete _chunk6EBEME3Ijs.Context.pipeRecord[this.key];
175
+ delete _chunkJF4YU32Ejs.Context.pipeRecord[this.key];
172
176
  });
173
177
  }
174
178
  };
@@ -177,16 +181,16 @@ var PPipe = class extends ServerBase {
177
181
 
178
182
  var PAddon = (_class3 = class extends ServerBase {
179
183
  static {
180
- _chunkRQSQRZL4js.__name.call(void 0, this, "PAddon");
184
+ _chunk62FBZWGWjs.__name.call(void 0, this, "PAddon");
181
185
  }
182
186
 
183
187
  __init3() {this.priority = 0}
184
188
  constructor(tag) {
185
189
  super();_class3.prototype.__init3.call(this);;
186
190
  this.key = tag || _phecdacore.getTag.call(void 0, this);
187
- _chunk6EBEME3Ijs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
191
+ _chunkJF4YU32Ejs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
188
192
  this.onUnmount(() => {
189
- delete _chunk6EBEME3Ijs.Context.addonRecord[this.key];
193
+ delete _chunkJF4YU32Ejs.Context.addonRecord[this.key];
190
194
  });
191
195
  }
192
196
  }, _class3);
@@ -195,7 +199,7 @@ var PAddon = (_class3 = class extends ServerBase {
195
199
 
196
200
  var PExtension = class extends ServerBase {
197
201
  static {
198
- _chunkRQSQRZL4js.__name.call(void 0, this, "PExtension");
202
+ _chunk62FBZWGWjs.__name.call(void 0, this, "PExtension");
199
203
  }
200
204
 
201
205
 
@@ -204,27 +208,27 @@ var PExtension = class extends ServerBase {
204
208
  super();
205
209
  const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
206
210
  if (this.pipe) {
207
- _chunk6EBEME3Ijs.addPipe.call(void 0, key, this.pipe.bind(this));
211
+ _chunkJF4YU32Ejs.addPipe.call(void 0, key, this.pipe.bind(this));
208
212
  this.onUnmount(() => {
209
- delete _chunk6EBEME3Ijs.Context.pipeRecord[key];
213
+ delete _chunkJF4YU32Ejs.Context.pipeRecord[key];
210
214
  });
211
215
  }
212
216
  if (this.addon) {
213
- _chunk6EBEME3Ijs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
217
+ _chunkJF4YU32Ejs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
214
218
  this.onUnmount(() => {
215
- delete _chunk6EBEME3Ijs.Context.addonRecord[key];
219
+ delete _chunkJF4YU32Ejs.Context.addonRecord[key];
216
220
  });
217
221
  }
218
222
  if (this.guard) {
219
- _chunk6EBEME3Ijs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
223
+ _chunkJF4YU32Ejs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
220
224
  this.onUnmount(() => {
221
- delete _chunk6EBEME3Ijs.Context.guardRecord[key];
225
+ delete _chunkJF4YU32Ejs.Context.guardRecord[key];
222
226
  });
223
227
  }
224
228
  if (this.filter) {
225
- _chunk6EBEME3Ijs.addFilter.call(void 0, key, this.filter.bind(this));
229
+ _chunkJF4YU32Ejs.addFilter.call(void 0, key, this.filter.bind(this));
226
230
  this.onUnmount(() => {
227
- delete _chunk6EBEME3Ijs.Context.filterRecord[key];
231
+ delete _chunkJF4YU32Ejs.Context.filterRecord[key];
228
232
  });
229
233
  }
230
234
  }
@@ -234,7 +238,7 @@ var PExtension = class extends ServerBase {
234
238
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
235
239
  var Generator = class {
236
240
  static {
237
- _chunkRQSQRZL4js.__name.call(void 0, this, "Generator");
241
+ _chunk62FBZWGWjs.__name.call(void 0, this, "Generator");
238
242
  }
239
243
 
240
244
  constructor(path) {
@@ -251,7 +255,7 @@ var Generator = class {
251
255
  // src/generator/rpc.ts
252
256
  var RPCGenerator = (_class4 = class extends Generator {constructor(...args3) { super(...args3); _class4.prototype.__init4.call(this);_class4.prototype.__init5.call(this); }
253
257
  static {
254
- _chunkRQSQRZL4js.__name.call(void 0, this, "RPCGenerator");
258
+ _chunk62FBZWGWjs.__name.call(void 0, this, "RPCGenerator");
255
259
  }
256
260
  __init4() {this.name = "RPC"}
257
261
  __init5() {this.classMap = {}}
@@ -287,7 +291,7 @@ var RPCGenerator = (_class4 = class extends Generator {constructor(...args3) { s
287
291
  // src/generator/http.ts
288
292
  var HTTPGenerator = (_class5 = class extends Generator {constructor(...args4) { super(...args4); _class5.prototype.__init6.call(this);_class5.prototype.__init7.call(this); }
289
293
  static {
290
- _chunkRQSQRZL4js.__name.call(void 0, this, "HTTPGenerator");
294
+ _chunk62FBZWGWjs.__name.call(void 0, this, "HTTPGenerator");
291
295
  }
292
296
  __init6() {this.name = "HTTP"}
293
297
  __init7() {this.classMap = {}}
@@ -404,4 +408,5 @@ return ret
404
408
 
405
409
 
406
410
 
407
- exports.Addon = _chunkQCOBXM7Fjs.Addon; exports.Arg = _chunkQCOBXM7Fjs.Arg; exports.BadGatewayException = _chunk6EBEME3Ijs.BadGatewayException; exports.BadRequestException = _chunk6EBEME3Ijs.BadRequestException; exports.BaseParam = _chunkQCOBXM7Fjs.BaseParam; exports.Body = _chunkQCOBXM7Fjs.Body; exports.ConflictException = _chunk6EBEME3Ijs.ConflictException; exports.Context = _chunk6EBEME3Ijs.Context; exports.Controller = _chunkQCOBXM7Fjs.Controller; exports.Ctx = _chunkQCOBXM7Fjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkQCOBXM7Fjs.Define; exports.Delete = _chunkQCOBXM7Fjs.Delete; exports.ERROR_SYMBOL = _chunkRQSQRZL4js.ERROR_SYMBOL; exports.Exception = _chunk6EBEME3Ijs.Exception; exports.Factory = _chunkPKSWGQLWjs.Factory; exports.Filter = _chunkQCOBXM7Fjs.Filter; exports.ForbiddenException = _chunk6EBEME3Ijs.ForbiddenException; exports.FrameworkException = _chunk6EBEME3Ijs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkQCOBXM7Fjs.Get; exports.Guard = _chunkQCOBXM7Fjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkQCOBXM7Fjs.Head; exports.Header = _chunkQCOBXM7Fjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkRQSQRZL4js.IS_HMR; exports.IS_ONLY_GENERATE = _chunkRQSQRZL4js.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkRQSQRZL4js.IS_STRICT; exports.InvalidInputException = _chunk6EBEME3Ijs.InvalidInputException; exports.LOG_LEVEL = _chunkRQSQRZL4js.LOG_LEVEL; exports.Meta = _chunkPKSWGQLWjs.Meta; exports.Mixin = _chunkRQSQRZL4js.Mixin; exports.NotFoundException = _chunk6EBEME3Ijs.NotFoundException; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunkRQSQRZL4js.PS_EXIT_CODE; exports.Param = _chunkQCOBXM7Fjs.Param; exports.Patch = _chunkQCOBXM7Fjs.Patch; exports.PayloadLargeException = _chunk6EBEME3Ijs.PayloadLargeException; exports.Pipe = _chunkQCOBXM7Fjs.Pipe; exports.Post = _chunkQCOBXM7Fjs.Post; exports.Put = _chunkQCOBXM7Fjs.Put; exports.Query = _chunkQCOBXM7Fjs.Query; exports.Queue = _chunkQCOBXM7Fjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkQCOBXM7Fjs.Route; exports.Rpc = _chunkQCOBXM7Fjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkQCOBXM7Fjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkPKSWGQLWjs.ServerPhecda; exports.ServiceUnavailableException = _chunk6EBEME3Ijs.ServiceUnavailableException; exports.TimeoutException = _chunk6EBEME3Ijs.TimeoutException; exports.TimerException = _chunk6EBEME3Ijs.TimerException; exports.UnauthorizedException = _chunk6EBEME3Ijs.UnauthorizedException; exports.UndefinedException = _chunk6EBEME3Ijs.UndefinedException; exports.UnsupportedMediaTypeException = _chunk6EBEME3Ijs.UnsupportedMediaTypeException; exports.ValidateException = _chunk6EBEME3Ijs.ValidateException; exports.WorkerException = _chunk6EBEME3Ijs.WorkerException; exports.addAddon = _chunk6EBEME3Ijs.addAddon; exports.addFilter = _chunk6EBEME3Ijs.addFilter; exports.addGuard = _chunk6EBEME3Ijs.addGuard; exports.addPipe = _chunk6EBEME3Ijs.addPipe; exports.defaultPipe = _chunk6EBEME3Ijs.defaultPipe; exports.defaultServerInject = _chunkPKSWGQLWjs.defaultServerInject; exports.emitter = _chunkPKSWGQLWjs.emitter; exports.getLogger = _chunkRQSQRZL4js.getLogger; exports.log = _chunkRQSQRZL4js.log; exports.phecdaNamespace = _chunkPKSWGQLWjs.phecdaNamespace; exports.runMiddleware = _chunkRQSQRZL4js.runMiddleware; exports.setLogger = _chunkRQSQRZL4js.setLogger; exports.useS = _chunkPKSWGQLWjs.useS;
411
+
412
+ exports.Addon = _chunkUKRQVTEYjs.Addon; exports.Arg = _chunkUKRQVTEYjs.Arg; exports.BadGatewayException = _chunkJF4YU32Ejs.BadGatewayException; exports.BadRequestException = _chunkJF4YU32Ejs.BadRequestException; exports.BaseParam = _chunkUKRQVTEYjs.BaseParam; exports.Body = _chunkUKRQVTEYjs.Body; exports.ConflictException = _chunkJF4YU32Ejs.ConflictException; exports.Context = _chunkJF4YU32Ejs.Context; exports.Controller = _chunkUKRQVTEYjs.Controller; exports.Ctx = _chunkUKRQVTEYjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkUKRQVTEYjs.Define; exports.Delete = _chunkUKRQVTEYjs.Delete; exports.ERROR_SYMBOL = _chunk62FBZWGWjs.ERROR_SYMBOL; exports.Exception = _chunkJF4YU32Ejs.Exception; exports.Factory = _chunkWYI2F7LDjs.Factory; exports.Filter = _chunkUKRQVTEYjs.Filter; exports.ForbiddenException = _chunkJF4YU32Ejs.ForbiddenException; exports.FrameworkException = _chunkJF4YU32Ejs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkUKRQVTEYjs.Get; exports.Guard = _chunkUKRQVTEYjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkUKRQVTEYjs.Head; exports.Header = _chunkUKRQVTEYjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunk62FBZWGWjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunk62FBZWGWjs.IS_ONLY_GENERATE; exports.IS_READY = _chunk62FBZWGWjs.IS_READY; exports.IS_STRICT = _chunk62FBZWGWjs.IS_STRICT; exports.InvalidInputException = _chunkJF4YU32Ejs.InvalidInputException; exports.LOG_LEVEL = _chunk62FBZWGWjs.LOG_LEVEL; exports.Meta = _chunkWYI2F7LDjs.Meta; exports.Mixin = _chunk62FBZWGWjs.Mixin; exports.NotFoundException = _chunkJF4YU32Ejs.NotFoundException; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunk62FBZWGWjs.PS_EXIT_CODE; exports.Param = _chunkUKRQVTEYjs.Param; exports.Patch = _chunkUKRQVTEYjs.Patch; exports.PayloadLargeException = _chunkJF4YU32Ejs.PayloadLargeException; exports.Pipe = _chunkUKRQVTEYjs.Pipe; exports.Post = _chunkUKRQVTEYjs.Post; exports.Put = _chunkUKRQVTEYjs.Put; exports.Query = _chunkUKRQVTEYjs.Query; exports.Queue = _chunkUKRQVTEYjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkUKRQVTEYjs.Route; exports.Rpc = _chunkUKRQVTEYjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkUKRQVTEYjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkWYI2F7LDjs.ServerPhecda; exports.ServiceUnavailableException = _chunkJF4YU32Ejs.ServiceUnavailableException; exports.TimeoutException = _chunkJF4YU32Ejs.TimeoutException; exports.TimerException = _chunkJF4YU32Ejs.TimerException; exports.UnauthorizedException = _chunkJF4YU32Ejs.UnauthorizedException; exports.UndefinedException = _chunkJF4YU32Ejs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkJF4YU32Ejs.UnsupportedMediaTypeException; exports.ValidateException = _chunkJF4YU32Ejs.ValidateException; exports.WorkerException = _chunkJF4YU32Ejs.WorkerException; exports.addAddon = _chunkJF4YU32Ejs.addAddon; exports.addFilter = _chunkJF4YU32Ejs.addFilter; exports.addGuard = _chunkJF4YU32Ejs.addGuard; exports.addPipe = _chunkJF4YU32Ejs.addPipe; exports.defaultPipe = _chunkJF4YU32Ejs.defaultPipe; exports.defaultServerInject = _chunkWYI2F7LDjs.defaultServerInject; exports.emitter = _chunkWYI2F7LDjs.emitter; exports.getLogger = _chunk62FBZWGWjs.getLogger; exports.log = _chunk62FBZWGWjs.log; exports.phecdaNamespace = _chunkWYI2F7LDjs.phecdaNamespace; exports.runMiddleware = _chunk62FBZWGWjs.runMiddleware; exports.setLogger = _chunk62FBZWGWjs.setLogger; exports.useS = _chunkWYI2F7LDjs.useS;
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  emitter,
7
7
  phecdaNamespace,
8
8
  useS
9
- } from "./chunk-A53KNKY4.mjs";
9
+ } from "./chunk-HTY3H33L.mjs";
10
10
  import {
11
11
  Addon,
12
12
  Arg,
@@ -31,7 +31,7 @@ import {
31
31
  Route,
32
32
  Rpc,
33
33
  Search
34
- } from "./chunk-KUGFI6SC.mjs";
34
+ } from "./chunk-ICI5KUDX.mjs";
35
35
  import {
36
36
  BadGatewayException,
37
37
  BadRequestException,
@@ -56,11 +56,12 @@ import {
56
56
  addGuard,
57
57
  addPipe,
58
58
  defaultPipe
59
- } from "./chunk-MMG73S64.mjs";
59
+ } from "./chunk-3C7Z3IJN.mjs";
60
60
  import {
61
61
  ERROR_SYMBOL,
62
62
  IS_HMR,
63
63
  IS_ONLY_GENERATE,
64
+ IS_READY,
64
65
  IS_STRICT,
65
66
  LOG_LEVEL,
66
67
  Mixin,
@@ -70,7 +71,7 @@ import {
70
71
  log,
71
72
  runMiddleware,
72
73
  setLogger
73
- } from "./chunk-QD3QR3NW.mjs";
74
+ } from "./chunk-KSDE5G57.mjs";
74
75
 
75
76
  // src/types.ts
76
77
  var ResponseSymbol = Symbol("response");
@@ -99,6 +100,9 @@ var ServerBase = class extends Base {
99
100
  __name(this, "ServerBase");
100
101
  }
101
102
  emitter = emitter;
103
+ log(msg, level) {
104
+ log(msg, level, this.tag);
105
+ }
102
106
  };
103
107
  var HttpBase = class extends ServerBase {
104
108
  static {
@@ -356,6 +360,7 @@ export {
356
360
  HttpBase,
357
361
  IS_HMR,
358
362
  IS_ONLY_GENERATE,
363
+ IS_READY,
359
364
  IS_STRICT,
360
365
  InvalidInputException,
361
366
  LOG_LEVEL,
@@ -5,6 +5,7 @@ declare const IS_HMR: boolean;
5
5
  declare const IS_ONLY_GENERATE: boolean;
6
6
  declare const IS_STRICT: boolean;
7
7
  declare const LOG_LEVEL: number;
8
+ declare const IS_READY: unique symbol;
8
9
  declare enum PS_EXIT_CODE {
9
10
  RELAUNCH = 2,
10
11
  CODE = 4
@@ -104,4 +105,4 @@ interface ControllerMeta extends Meta {
104
105
  data: ControllerMetaData;
105
106
  }
106
107
 
107
- export { type BaseContext as B, type ControllerMetaData as C, type DefaultOptions as D, type Emitter as E, IS_HMR as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMeta as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, PS_EXIT_CODE as m };
108
+ export { type BaseContext as B, type ControllerMetaData as C, type DefaultOptions as D, type Emitter as E, IS_HMR as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMeta as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, IS_READY as m, PS_EXIT_CODE as n };
@@ -5,6 +5,7 @@ declare const IS_HMR: boolean;
5
5
  declare const IS_ONLY_GENERATE: boolean;
6
6
  declare const IS_STRICT: boolean;
7
7
  declare const LOG_LEVEL: number;
8
+ declare const IS_READY: unique symbol;
8
9
  declare enum PS_EXIT_CODE {
9
10
  RELAUNCH = 2,
10
11
  CODE = 4
@@ -104,4 +105,4 @@ interface ControllerMeta extends Meta {
104
105
  data: ControllerMetaData;
105
106
  }
106
107
 
107
- export { type BaseContext as B, type ControllerMetaData as C, type DefaultOptions as D, type Emitter as E, IS_HMR as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMeta as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, PS_EXIT_CODE as m };
108
+ export { type BaseContext as B, type ControllerMetaData as C, type DefaultOptions as D, type Emitter as E, IS_HMR as I, LOG_LEVEL as L, Meta as M, type OmitFunction as O, type PickFunc as P, type ServiceMetaData as S, type ToClientMap as T, type ControllerMeta as a, type MetaData as b, type BaseError as c, type ToClientInstance as d, type ToClientFn as e, type BaseReturn as f, type BaseRequestType as g, CustomResponse as h, type ExtractResponse as i, ERROR_SYMBOL as j, IS_ONLY_GENERATE as k, IS_STRICT as l, IS_READY as m, PS_EXIT_CODE as n };