phecda-server 8.1.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/bin/cli.mjs +17 -2
  2. package/dist/{chunk-UYZSUBX4.js → chunk-C424F7TV.js} +27 -27
  3. package/dist/{chunk-NQ55PA2X.mjs → chunk-JRNXLEAU.mjs} +2 -2
  4. package/dist/{chunk-FI5756JX.mjs → chunk-LYLSA56Y.mjs} +1 -1
  5. package/dist/{chunk-4LLLQOMF.js → chunk-OUQM7GZH.js} +2 -2
  6. package/dist/{chunk-HKN3AAB2.js → chunk-R73A7HS3.js} +90 -88
  7. package/dist/{chunk-OLNN4U3O.js → chunk-SRPCXPAQ.js} +20 -20
  8. package/dist/{chunk-BLLRB5DQ.mjs → chunk-US2DTB3Z.mjs} +37 -35
  9. package/dist/{chunk-PFPOEZHH.mjs → chunk-YDJAOLT2.mjs} +1 -1
  10. package/dist/helper.js +3 -3
  11. package/dist/helper.mjs +2 -2
  12. package/dist/http/elysia/index.d.mts +3 -3
  13. package/dist/http/elysia/index.d.ts +3 -3
  14. package/dist/http/elysia/index.js +40 -40
  15. package/dist/http/elysia/index.mjs +3 -3
  16. package/dist/http/express/index.js +37 -37
  17. package/dist/http/express/index.mjs +2 -2
  18. package/dist/http/fastify/index.js +38 -38
  19. package/dist/http/fastify/index.mjs +3 -3
  20. package/dist/http/h3/index.js +38 -38
  21. package/dist/http/h3/index.mjs +2 -2
  22. package/dist/http/hono/index.js +34 -34
  23. package/dist/http/hono/index.mjs +2 -2
  24. package/dist/http/hyper-express/index.js +35 -35
  25. package/dist/http/hyper-express/index.mjs +2 -2
  26. package/dist/http/koa/index.js +37 -37
  27. package/dist/http/koa/index.mjs +2 -2
  28. package/dist/index.d.mts +21 -18
  29. package/dist/index.d.ts +21 -18
  30. package/dist/index.js +46 -44
  31. package/dist/index.mjs +6 -4
  32. package/dist/rpc/bullmq/index.js +11 -11
  33. package/dist/rpc/bullmq/index.mjs +2 -2
  34. package/dist/rpc/electron/index.js +8 -8
  35. package/dist/rpc/electron/index.mjs +2 -2
  36. package/dist/rpc/kafka/index.js +10 -10
  37. package/dist/rpc/kafka/index.mjs +2 -2
  38. package/dist/rpc/nats/index.js +11 -11
  39. package/dist/rpc/nats/index.mjs +2 -2
  40. package/dist/rpc/rabbitmq/index.js +12 -12
  41. package/dist/rpc/rabbitmq/index.mjs +2 -2
  42. package/dist/rpc/redis/index.js +10 -10
  43. package/dist/rpc/redis/index.mjs +2 -2
  44. package/dist/rpc/ws/index.js +7 -7
  45. package/dist/rpc/ws/index.mjs +2 -2
  46. package/dist/test.js +6 -6
  47. package/dist/test.mjs +2 -2
  48. package/package.json +31 -31
  49. package/register/utils.mjs +1 -10
  50. package/register/export.mjs +0 -39
package/dist/index.d.ts CHANGED
@@ -13,9 +13,10 @@ import 'node:http';
13
13
 
14
14
  declare class Exception extends Error {
15
15
  message: string;
16
+ metadata?: any | undefined;
16
17
  status: number;
17
18
  description: string;
18
- constructor(message: string, status?: number, description?: string);
19
+ constructor(message: string, metadata?: any | undefined, status?: number, description?: string);
19
20
  get data(): {
20
21
  message: string;
21
22
  description: string;
@@ -25,67 +26,67 @@ declare class Exception extends Error {
25
26
  }
26
27
 
27
28
  declare class UndefinedException extends Exception {
28
- constructor(message: string);
29
+ constructor(message: string, metadata?: any);
29
30
  }
30
31
 
31
32
  declare class ValidateException extends Exception {
32
- constructor(message: string);
33
+ constructor(message: string, metadata?: any);
33
34
  }
34
35
 
35
36
  declare class ForbiddenException extends Exception {
36
- constructor(message: string);
37
+ constructor(message: string, metadata?: any);
37
38
  }
38
39
 
39
40
  declare class BadRequestException extends Exception {
40
- constructor(message: string);
41
+ constructor(message: string, metadata?: any);
41
42
  }
42
43
 
43
44
  declare class NotFoundException extends Exception {
44
- constructor(message: string);
45
+ constructor(message: string, metadata?: any);
45
46
  }
46
47
 
47
48
  declare class ConflictException extends Exception {
48
- constructor(message: string);
49
+ constructor(message: string, metadata?: any);
49
50
  }
50
51
 
51
52
  declare class BadGatewayException extends Exception {
52
- constructor(message: string);
53
+ constructor(message: string, metadata?: any);
53
54
  }
54
55
 
55
56
  declare class InvalidInputException extends Exception {
56
- constructor(message: string);
57
+ constructor(message: string, metadata?: any);
57
58
  }
58
59
 
59
60
  declare class UnsupportedMediaTypeException extends Exception {
60
- constructor(message: string);
61
+ constructor(message: string, metadata?: any);
61
62
  }
62
63
 
63
64
  declare class PayloadLargeException extends Exception {
64
- constructor(message: string);
65
+ constructor(message: string, metadata?: any);
65
66
  }
66
67
 
67
68
  declare class TimeoutException extends Exception {
68
- constructor(message: string);
69
+ constructor(message: string, metadata?: any);
69
70
  }
70
71
 
71
72
  declare class UnauthorizedException extends Exception {
72
- constructor(message: string);
73
+ constructor(message: string, metadata?: any);
73
74
  }
74
75
 
75
76
  declare class ServiceUnavailableException extends Exception {
76
- constructor(message: string);
77
+ constructor(message: string, metadata?: any);
77
78
  }
78
79
 
79
80
  declare class FrameworkException extends Exception {
80
- constructor(message: string);
81
+ constructor(message: string, metadata?: any);
81
82
  }
82
83
 
83
84
  declare class TimerException extends Exception {
84
- constructor(message: string);
85
+ constructor(message: string, metadata?: any);
85
86
  }
86
87
 
87
88
  declare class WorkerException extends Exception {
88
- constructor(message: string);
89
+ constructor(message: string, metadata?: any);
89
90
  }
90
91
 
91
92
  interface AOP {
@@ -354,4 +355,6 @@ declare class PExtension extends ServerBase {
354
355
  constructor(tag?: string);
355
356
  }
356
357
 
357
- export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, GraphGenerator, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
358
+ declare const defaultFilter: FilterType;
359
+
360
+ export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, GraphGenerator, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultFilter, defaultPipe, getLogger, log, runMiddleware, setLogger };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkOLNN4U3Ojs = require('./chunk-OLNN4U3O.js');
9
+ var _chunkSRPCXPAQjs = require('./chunk-SRPCXPAQ.js');
10
10
 
11
11
 
12
12
 
@@ -34,7 +34,7 @@ var _chunkOLNN4U3Ojs = require('./chunk-OLNN4U3O.js');
34
34
 
35
35
 
36
36
 
37
- var _chunkUYZSUBX4js = require('./chunk-UYZSUBX4.js');
37
+ var _chunkC424F7TVjs = require('./chunk-C424F7TV.js');
38
38
 
39
39
 
40
40
 
@@ -60,8 +60,8 @@ var _chunkUYZSUBX4js = require('./chunk-UYZSUBX4.js');
60
60
 
61
61
 
62
62
 
63
- var _chunkHKN3AAB2js = require('./chunk-HKN3AAB2.js');
64
63
 
64
+ var _chunkR73A7HS3js = require('./chunk-R73A7HS3.js');
65
65
 
66
66
 
67
67
 
@@ -75,12 +75,13 @@ var _chunkHKN3AAB2js = require('./chunk-HKN3AAB2.js');
75
75
 
76
76
 
77
77
 
78
- var _chunk4LLLQOMFjs = require('./chunk-4LLLQOMF.js');
78
+
79
+ var _chunkOUQM7GZHjs = require('./chunk-OUQM7GZH.js');
79
80
 
80
81
  // src/types.ts
81
82
  var CustomResponse = class {
82
83
  static {
83
- _chunk4LLLQOMFjs.__name.call(void 0, this, "CustomResponse");
84
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "CustomResponse");
84
85
  }
85
86
 
86
87
  };
@@ -93,38 +94,38 @@ function _ts_decorate(decorators, target, key, desc) {
93
94
  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;
94
95
  return c > 3 && r && Object.defineProperty(target, key, r), r;
95
96
  }
96
- _chunk4LLLQOMFjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
97
+ _chunkOUQM7GZHjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
97
98
  function _ts_metadata(k, v) {
98
99
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
99
100
  }
100
- _chunk4LLLQOMFjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
101
+ _chunkOUQM7GZHjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
101
102
  var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
102
103
  static {
103
- _chunk4LLLQOMFjs.__name.call(void 0, this, "ServerBase");
104
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "ServerBase");
104
105
  }
105
- __init() {this.emitter = exports.emitter = _chunkOLNN4U3Ojs.emitter}
106
+ __init() {this.emitter = exports.emitter = _chunkSRPCXPAQjs.emitter}
106
107
  log(msg, level = "log") {
107
- _chunk4LLLQOMFjs.log.call(void 0, msg, level, this.tag);
108
+ _chunkOUQM7GZHjs.log.call(void 0, msg, level, this.tag);
108
109
  }
109
110
  }, _class);
110
111
  var HttpBase = class extends ServerBase {
111
112
  static {
112
- _chunk4LLLQOMFjs.__name.call(void 0, this, "HttpBase");
113
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "HttpBase");
113
114
  }
114
115
 
115
116
  };
116
117
  _ts_decorate([
117
- _chunkUYZSUBX4js.Ctx,
118
+ _chunkC424F7TVjs.Ctx,
118
119
  _ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
119
120
  ], HttpBase.prototype, "context", void 0);
120
121
  var RpcBase = class extends ServerBase {
121
122
  static {
122
- _chunk4LLLQOMFjs.__name.call(void 0, this, "RpcBase");
123
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "RpcBase");
123
124
  }
124
125
 
125
126
  };
126
127
  _ts_decorate([
127
- _chunkUYZSUBX4js.Ctx,
128
+ _chunkC424F7TVjs.Ctx,
128
129
  _ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
129
130
  ], RpcBase.prototype, "context", void 0);
130
131
 
@@ -132,15 +133,15 @@ _ts_decorate([
132
133
 
133
134
  var PFilter = class extends ServerBase {
134
135
  static {
135
- _chunk4LLLQOMFjs.__name.call(void 0, this, "PFilter");
136
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "PFilter");
136
137
  }
137
138
 
138
139
  constructor(tag) {
139
140
  super();
140
141
  this.key = tag || _phecdacore.getTag.call(void 0, this);
141
- _chunkHKN3AAB2js.addFilter.call(void 0, this.key, this.use.bind(this));
142
+ _chunkR73A7HS3js.addFilter.call(void 0, this.key, this.use.bind(this));
142
143
  this.onUnmount(() => {
143
- delete _chunkHKN3AAB2js.Context.filterRecord[this.key];
144
+ delete _chunkR73A7HS3js.Context.filterRecord[this.key];
144
145
  });
145
146
  }
146
147
  };
@@ -149,16 +150,16 @@ var PFilter = class extends ServerBase {
149
150
 
150
151
  var PGuard = (_class2 = class extends ServerBase {
151
152
  static {
152
- _chunk4LLLQOMFjs.__name.call(void 0, this, "PGuard");
153
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "PGuard");
153
154
  }
154
155
 
155
156
  __init2() {this.priority = 0}
156
157
  constructor(tag) {
157
158
  super();_class2.prototype.__init2.call(this);;
158
159
  this.key = tag || _phecdacore.getTag.call(void 0, this);
159
- _chunkHKN3AAB2js.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
160
+ _chunkR73A7HS3js.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
160
161
  this.onUnmount(() => {
161
- delete _chunkHKN3AAB2js.Context.guardRecord[this.key];
162
+ delete _chunkR73A7HS3js.Context.guardRecord[this.key];
162
163
  });
163
164
  }
164
165
  }, _class2);
@@ -167,15 +168,15 @@ var PGuard = (_class2 = class extends ServerBase {
167
168
 
168
169
  var PPipe = class extends ServerBase {
169
170
  static {
170
- _chunk4LLLQOMFjs.__name.call(void 0, this, "PPipe");
171
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "PPipe");
171
172
  }
172
173
 
173
174
  constructor(tag) {
174
175
  super();
175
176
  this.key = tag || _phecdacore.getTag.call(void 0, this);
176
- _chunkHKN3AAB2js.addPipe.call(void 0, this.key, this.use.bind(this));
177
+ _chunkR73A7HS3js.addPipe.call(void 0, this.key, this.use.bind(this));
177
178
  this.onUnmount(() => {
178
- delete _chunkHKN3AAB2js.Context.pipeRecord[this.key];
179
+ delete _chunkR73A7HS3js.Context.pipeRecord[this.key];
179
180
  });
180
181
  }
181
182
  };
@@ -184,16 +185,16 @@ var PPipe = class extends ServerBase {
184
185
 
185
186
  var PAddon = (_class3 = class extends ServerBase {
186
187
  static {
187
- _chunk4LLLQOMFjs.__name.call(void 0, this, "PAddon");
188
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "PAddon");
188
189
  }
189
190
 
190
191
  __init3() {this.priority = 0}
191
192
  constructor(tag) {
192
193
  super();_class3.prototype.__init3.call(this);;
193
194
  this.key = tag || _phecdacore.getTag.call(void 0, this);
194
- _chunkHKN3AAB2js.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
195
+ _chunkR73A7HS3js.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
195
196
  this.onUnmount(() => {
196
- delete _chunkHKN3AAB2js.Context.addonRecord[this.key];
197
+ delete _chunkR73A7HS3js.Context.addonRecord[this.key];
197
198
  });
198
199
  }
199
200
  }, _class3);
@@ -202,7 +203,7 @@ var PAddon = (_class3 = class extends ServerBase {
202
203
 
203
204
  var PExtension = class extends ServerBase {
204
205
  static {
205
- _chunk4LLLQOMFjs.__name.call(void 0, this, "PExtension");
206
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "PExtension");
206
207
  }
207
208
 
208
209
 
@@ -211,27 +212,27 @@ var PExtension = class extends ServerBase {
211
212
  super();
212
213
  const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
213
214
  if (this.pipe) {
214
- _chunkHKN3AAB2js.addPipe.call(void 0, key, this.pipe.bind(this));
215
+ _chunkR73A7HS3js.addPipe.call(void 0, key, this.pipe.bind(this));
215
216
  this.onUnmount(() => {
216
- delete _chunkHKN3AAB2js.Context.pipeRecord[key];
217
+ delete _chunkR73A7HS3js.Context.pipeRecord[key];
217
218
  });
218
219
  }
219
220
  if (this.addon) {
220
- _chunkHKN3AAB2js.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
221
+ _chunkR73A7HS3js.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
221
222
  this.onUnmount(() => {
222
- delete _chunkHKN3AAB2js.Context.addonRecord[key];
223
+ delete _chunkR73A7HS3js.Context.addonRecord[key];
223
224
  });
224
225
  }
225
226
  if (this.guard) {
226
- _chunkHKN3AAB2js.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
227
+ _chunkR73A7HS3js.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
227
228
  this.onUnmount(() => {
228
- delete _chunkHKN3AAB2js.Context.guardRecord[key];
229
+ delete _chunkR73A7HS3js.Context.guardRecord[key];
229
230
  });
230
231
  }
231
232
  if (this.filter) {
232
- _chunkHKN3AAB2js.addFilter.call(void 0, key, this.filter.bind(this));
233
+ _chunkR73A7HS3js.addFilter.call(void 0, key, this.filter.bind(this));
233
234
  this.onUnmount(() => {
234
- delete _chunkHKN3AAB2js.Context.filterRecord[key];
235
+ delete _chunkR73A7HS3js.Context.filterRecord[key];
235
236
  });
236
237
  }
237
238
  }
@@ -241,7 +242,7 @@ var PExtension = class extends ServerBase {
241
242
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
242
243
  var Generator = (_class4 = class {
243
244
  static {
244
- _chunk4LLLQOMFjs.__name.call(void 0, this, "Generator");
245
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "Generator");
245
246
  }
246
247
 
247
248
  constructor(path) {;_class4.prototype.__init4.call(this);
@@ -259,7 +260,7 @@ var Generator = (_class4 = class {
259
260
  // src/generator/rpc.ts
260
261
  var RPCGenerator = (_class5 = class extends Generator {constructor(...args3) { super(...args3); _class5.prototype.__init5.call(this);_class5.prototype.__init6.call(this); }
261
262
  static {
262
- _chunk4LLLQOMFjs.__name.call(void 0, this, "RPCGenerator");
263
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "RPCGenerator");
263
264
  }
264
265
  __init5() {this.name = "RPC"}
265
266
  __init6() {this.classMap = {}}
@@ -295,7 +296,7 @@ var RPCGenerator = (_class5 = class extends Generator {constructor(...args3) { s
295
296
  // src/generator/http.ts
296
297
  var HTTPGenerator = (_class6 = class extends Generator {constructor(...args4) { super(...args4); _class6.prototype.__init7.call(this);_class6.prototype.__init8.call(this); }
297
298
  static {
298
- _chunk4LLLQOMFjs.__name.call(void 0, this, "HTTPGenerator");
299
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "HTTPGenerator");
299
300
  }
300
301
  __init7() {this.name = "HTTP"}
301
302
  __init8() {this.classMap = {}}
@@ -312,7 +313,7 @@ var HTTPGenerator = (_class6 = class extends Generator {constructor(...args4) {
312
313
  addMethod(args) {
313
314
  const { http, name, method, params, tag } = args;
314
315
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) return;
315
- const url = _chunkHKN3AAB2js.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
316
+ const url = _chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
316
317
  if (!this.classMap[name]) this.classMap[name] = {};
317
318
  this.classMap[name][method] = `
318
319
  ${method}(...args){
@@ -338,7 +339,7 @@ return ret
338
339
 
339
340
  var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5) { super(...args5); _class7.prototype.__init9.call(this);_class7.prototype.__init10.call(this);_class7.prototype.__init11.call(this); }
340
341
  static {
341
- _chunk4LLLQOMFjs.__name.call(void 0, this, "OpenAPIGenerator");
342
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "OpenAPIGenerator");
342
343
  }
343
344
  __init9() {this.ext = ".json"}
344
345
  __init10() {this.name = "OpenAPI"}
@@ -359,7 +360,7 @@ var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5)
359
360
  if (!_optionalChain([http, 'optionalAccess', _3 => _3.method])) return;
360
361
  const config = _phecdacore.getMergedMeta.call(void 0, model, method).openapi;
361
362
  if (!config) return;
362
- const path = _chunkHKN3AAB2js.joinUrl.call(void 0, http.prefix, http.route);
363
+ const path = _chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route);
363
364
  if (!this.paths[path]) this.paths[path] = {};
364
365
  this.paths[path][http.method] = {
365
366
  summary: config.summary,
@@ -384,7 +385,7 @@ var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5)
384
385
  // src/generator/doc.ts
385
386
  var DocGenerator = (_class8 = class extends Generator {
386
387
  static {
387
- _chunk4LLLQOMFjs.__name.call(void 0, this, "DocGenerator");
388
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "DocGenerator");
388
389
  }
389
390
  __init12() {this.name = "DOC"}
390
391
  __init13() {this.classMap = {}}
@@ -420,7 +421,7 @@ var DocGenerator = (_class8 = class extends Generator {
420
421
 
421
422
  var GraphGenerator = (_class9 = class extends Generator {constructor(...args6) { super(...args6); _class9.prototype.__init14.call(this);_class9.prototype.__init15.call(this); }
422
423
  static {
423
- _chunk4LLLQOMFjs.__name.call(void 0, this, "GraphGenerator");
424
+ _chunkOUQM7GZHjs.__name.call(void 0, this, "GraphGenerator");
424
425
  }
425
426
  __init14() {this.ext = ".mmd"}
426
427
  __init15() {this.name = "Graph"}
@@ -538,4 +539,5 @@ var GraphGenerator = (_class9 = class extends Generator {constructor(...args6) {
538
539
 
539
540
 
540
541
 
541
- exports.Addon = _chunkUYZSUBX4js.Addon; exports.ApiDoc = _chunkUYZSUBX4js.ApiDoc; exports.Arg = _chunkUYZSUBX4js.Arg; exports.BadGatewayException = _chunkHKN3AAB2js.BadGatewayException; exports.BadRequestException = _chunkHKN3AAB2js.BadRequestException; exports.BaseParam = _chunkUYZSUBX4js.BaseParam; exports.Body = _chunkUYZSUBX4js.Body; exports.ConflictException = _chunkHKN3AAB2js.ConflictException; exports.Context = _chunkHKN3AAB2js.Context; exports.Controller = _chunkUYZSUBX4js.Controller; exports.Ctx = _chunkUYZSUBX4js.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkUYZSUBX4js.Define; exports.Delete = _chunkUYZSUBX4js.Delete; exports.DocGenerator = DocGenerator; exports.ERROR_SYMBOL = _chunk4LLLQOMFjs.ERROR_SYMBOL; exports.Exception = _chunkHKN3AAB2js.Exception; exports.Factory = _chunkOLNN4U3Ojs.Factory; exports.Filter = _chunkUYZSUBX4js.Filter; exports.ForbiddenException = _chunkHKN3AAB2js.ForbiddenException; exports.FrameworkException = _chunkHKN3AAB2js.FrameworkException; exports.Generator = Generator; exports.Get = _chunkUYZSUBX4js.Get; exports.GraphGenerator = GraphGenerator; exports.Guard = _chunkUYZSUBX4js.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkUYZSUBX4js.Head; exports.Header = _chunkUYZSUBX4js.Header; exports.HttpBase = HttpBase; exports.IS_DEV = _chunk4LLLQOMFjs.IS_DEV; exports.IS_ONLY_GENERATE = _chunk4LLLQOMFjs.IS_ONLY_GENERATE; exports.IS_PURE = _chunk4LLLQOMFjs.IS_PURE; exports.IS_STRICT = _chunk4LLLQOMFjs.IS_STRICT; exports.InvalidInputException = _chunkHKN3AAB2js.InvalidInputException; exports.LOG_LEVEL = _chunk4LLLQOMFjs.LOG_LEVEL; exports.ManyFiles = _chunkUYZSUBX4js.ManyFiles; exports.Meta = _chunkOLNN4U3Ojs.Meta; exports.Mixin = _chunk4LLLQOMFjs.Mixin; exports.NotFoundException = _chunkHKN3AAB2js.NotFoundException; exports.OneFile = _chunkUYZSUBX4js.OneFile; exports.OpenAPIGenerator = OpenAPIGenerator; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunk4LLLQOMFjs.PS_EXIT_CODE; exports.Param = _chunkUYZSUBX4js.Param; exports.Patch = _chunkUYZSUBX4js.Patch; exports.PayloadLargeException = _chunkHKN3AAB2js.PayloadLargeException; exports.Pipe = _chunkUYZSUBX4js.Pipe; exports.Post = _chunkUYZSUBX4js.Post; exports.Put = _chunkUYZSUBX4js.Put; exports.Query = _chunkUYZSUBX4js.Query; exports.Queue = _chunkUYZSUBX4js.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkUYZSUBX4js.Route; exports.Rpc = _chunkUYZSUBX4js.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkUYZSUBX4js.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkOLNN4U3Ojs.ServerPhecda; exports.ServiceUnavailableException = _chunkHKN3AAB2js.ServiceUnavailableException; exports.TimeoutException = _chunkHKN3AAB2js.TimeoutException; exports.TimerException = _chunkHKN3AAB2js.TimerException; exports.UnauthorizedException = _chunkHKN3AAB2js.UnauthorizedException; exports.UndefinedException = _chunkHKN3AAB2js.UndefinedException; exports.UnsupportedMediaTypeException = _chunkHKN3AAB2js.UnsupportedMediaTypeException; exports.ValidateException = _chunkHKN3AAB2js.ValidateException; exports.WorkerException = _chunkHKN3AAB2js.WorkerException; exports.addAddon = _chunkHKN3AAB2js.addAddon; exports.addFilter = _chunkHKN3AAB2js.addFilter; exports.addGuard = _chunkHKN3AAB2js.addGuard; exports.addPipe = _chunkHKN3AAB2js.addPipe; exports.defaultPipe = _chunkHKN3AAB2js.defaultPipe; exports.defaultServerInject = _chunkOLNN4U3Ojs.defaultServerInject; exports.emitter = _chunkOLNN4U3Ojs.emitter; exports.getLogger = _chunk4LLLQOMFjs.getLogger; exports.log = _chunk4LLLQOMFjs.log; exports.phecdaNamespace = _chunkOLNN4U3Ojs.phecdaNamespace; exports.runMiddleware = _chunk4LLLQOMFjs.runMiddleware; exports.setLogger = _chunk4LLLQOMFjs.setLogger; exports.useS = _chunkOLNN4U3Ojs.useS;
542
+
543
+ exports.Addon = _chunkC424F7TVjs.Addon; exports.ApiDoc = _chunkC424F7TVjs.ApiDoc; exports.Arg = _chunkC424F7TVjs.Arg; exports.BadGatewayException = _chunkR73A7HS3js.BadGatewayException; exports.BadRequestException = _chunkR73A7HS3js.BadRequestException; exports.BaseParam = _chunkC424F7TVjs.BaseParam; exports.Body = _chunkC424F7TVjs.Body; exports.ConflictException = _chunkR73A7HS3js.ConflictException; exports.Context = _chunkR73A7HS3js.Context; exports.Controller = _chunkC424F7TVjs.Controller; exports.Ctx = _chunkC424F7TVjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkC424F7TVjs.Define; exports.Delete = _chunkC424F7TVjs.Delete; exports.DocGenerator = DocGenerator; exports.ERROR_SYMBOL = _chunkOUQM7GZHjs.ERROR_SYMBOL; exports.Exception = _chunkR73A7HS3js.Exception; exports.Factory = _chunkSRPCXPAQjs.Factory; exports.Filter = _chunkC424F7TVjs.Filter; exports.ForbiddenException = _chunkR73A7HS3js.ForbiddenException; exports.FrameworkException = _chunkR73A7HS3js.FrameworkException; exports.Generator = Generator; exports.Get = _chunkC424F7TVjs.Get; exports.GraphGenerator = GraphGenerator; exports.Guard = _chunkC424F7TVjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkC424F7TVjs.Head; exports.Header = _chunkC424F7TVjs.Header; exports.HttpBase = HttpBase; exports.IS_DEV = _chunkOUQM7GZHjs.IS_DEV; exports.IS_ONLY_GENERATE = _chunkOUQM7GZHjs.IS_ONLY_GENERATE; exports.IS_PURE = _chunkOUQM7GZHjs.IS_PURE; exports.IS_STRICT = _chunkOUQM7GZHjs.IS_STRICT; exports.InvalidInputException = _chunkR73A7HS3js.InvalidInputException; exports.LOG_LEVEL = _chunkOUQM7GZHjs.LOG_LEVEL; exports.ManyFiles = _chunkC424F7TVjs.ManyFiles; exports.Meta = _chunkSRPCXPAQjs.Meta; exports.Mixin = _chunkOUQM7GZHjs.Mixin; exports.NotFoundException = _chunkR73A7HS3js.NotFoundException; exports.OneFile = _chunkC424F7TVjs.OneFile; exports.OpenAPIGenerator = OpenAPIGenerator; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunkOUQM7GZHjs.PS_EXIT_CODE; exports.Param = _chunkC424F7TVjs.Param; exports.Patch = _chunkC424F7TVjs.Patch; exports.PayloadLargeException = _chunkR73A7HS3js.PayloadLargeException; exports.Pipe = _chunkC424F7TVjs.Pipe; exports.Post = _chunkC424F7TVjs.Post; exports.Put = _chunkC424F7TVjs.Put; exports.Query = _chunkC424F7TVjs.Query; exports.Queue = _chunkC424F7TVjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkC424F7TVjs.Route; exports.Rpc = _chunkC424F7TVjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkC424F7TVjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkSRPCXPAQjs.ServerPhecda; exports.ServiceUnavailableException = _chunkR73A7HS3js.ServiceUnavailableException; exports.TimeoutException = _chunkR73A7HS3js.TimeoutException; exports.TimerException = _chunkR73A7HS3js.TimerException; exports.UnauthorizedException = _chunkR73A7HS3js.UnauthorizedException; exports.UndefinedException = _chunkR73A7HS3js.UndefinedException; exports.UnsupportedMediaTypeException = _chunkR73A7HS3js.UnsupportedMediaTypeException; exports.ValidateException = _chunkR73A7HS3js.ValidateException; exports.WorkerException = _chunkR73A7HS3js.WorkerException; exports.addAddon = _chunkR73A7HS3js.addAddon; exports.addFilter = _chunkR73A7HS3js.addFilter; exports.addGuard = _chunkR73A7HS3js.addGuard; exports.addPipe = _chunkR73A7HS3js.addPipe; exports.defaultFilter = _chunkR73A7HS3js.defaultFilter; exports.defaultPipe = _chunkR73A7HS3js.defaultPipe; exports.defaultServerInject = _chunkSRPCXPAQjs.defaultServerInject; exports.emitter = _chunkSRPCXPAQjs.emitter; exports.getLogger = _chunkOUQM7GZHjs.getLogger; exports.log = _chunkOUQM7GZHjs.log; exports.phecdaNamespace = _chunkSRPCXPAQjs.phecdaNamespace; exports.runMiddleware = _chunkOUQM7GZHjs.runMiddleware; exports.setLogger = _chunkOUQM7GZHjs.setLogger; exports.useS = _chunkSRPCXPAQjs.useS;
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  emitter,
7
7
  phecdaNamespace,
8
8
  useS
9
- } from "./chunk-PFPOEZHH.mjs";
9
+ } from "./chunk-YDJAOLT2.mjs";
10
10
  import {
11
11
  Addon,
12
12
  ApiDoc,
@@ -34,7 +34,7 @@ import {
34
34
  Route,
35
35
  Rpc,
36
36
  Search
37
- } from "./chunk-FI5756JX.mjs";
37
+ } from "./chunk-LYLSA56Y.mjs";
38
38
  import {
39
39
  BadGatewayException,
40
40
  BadRequestException,
@@ -58,9 +58,10 @@ import {
58
58
  addFilter,
59
59
  addGuard,
60
60
  addPipe,
61
+ defaultFilter,
61
62
  defaultPipe,
62
63
  joinUrl
63
- } from "./chunk-BLLRB5DQ.mjs";
64
+ } from "./chunk-US2DTB3Z.mjs";
64
65
  import {
65
66
  ERROR_SYMBOL,
66
67
  IS_DEV,
@@ -75,7 +76,7 @@ import {
75
76
  log,
76
77
  runMiddleware,
77
78
  setLogger
78
- } from "./chunk-NQ55PA2X.mjs";
79
+ } from "./chunk-JRNXLEAU.mjs";
79
80
 
80
81
  // src/types.ts
81
82
  var CustomResponse = class {
@@ -529,6 +530,7 @@ export {
529
530
  addFilter,
530
531
  addGuard,
531
532
  addPipe,
533
+ defaultFilter,
532
534
  defaultPipe,
533
535
  defaultServerInject,
534
536
  emitter,
@@ -2,11 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkHKN3AAB2js = require('../../chunk-HKN3AAB2.js');
5
+ var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
6
6
 
7
7
 
8
8
 
9
- var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
9
+ var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
10
10
 
11
11
  // src/rpc/bullmq/create.ts
12
12
  var _bullmq = require('bullmq');
@@ -17,14 +17,14 @@ async function create({ moduleMap, meta }, opts = {}) {
17
17
  const workerMap = {};
18
18
  const queueMap = {};
19
19
  const existQueue = /* @__PURE__ */ new Set();
20
- const metaMap = _chunkHKN3AAB2js.createControllerMetaMap.call(void 0, meta, (meta2) => {
20
+ const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
21
  const { controller, rpc, method, tag } = meta2.data;
22
22
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
23
23
  debug(`register method "${method}" in module "${tag}"`);
24
24
  return true;
25
25
  }
26
26
  });
27
- _chunkHKN3AAB2js.detectAopDep.call(void 0, meta, {
27
+ _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
28
28
  guards: globalGuards
29
29
  }, "rpc");
30
30
  async function subscribeQueues() {
@@ -38,12 +38,12 @@ async function create({ moduleMap, meta }, opts = {}) {
38
38
  if (existQueue.has(queue)) continue;
39
39
  existQueue.add(queue);
40
40
  workerMap[queue] = new (0, _bullmq.Worker)(queue, handleRequest, workerOpts);
41
- _chunkHKN3AAB2js.Context.applyAddons(addons, workerMap[queue], "bullmq");
41
+ _chunkR73A7HS3js.Context.applyAddons(addons, workerMap[queue], "bullmq");
42
42
  }
43
43
  }
44
44
  }
45
45
  }
46
- _chunk4LLLQOMFjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
46
+ _chunkOUQM7GZHjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
47
47
  async function handleRequest(job) {
48
48
  const { data } = job;
49
49
  const { tag, method, args, id, queue: clientQueue, _ps } = data;
@@ -52,12 +52,12 @@ async function create({ moduleMap, meta }, opts = {}) {
52
52
  const meta2 = metaMap.get(tag)[method];
53
53
  const { data: { rpc: { isEvent } = {} } } = meta2;
54
54
  if (!isEvent && !(clientQueue in queueMap)) queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
55
- const aop = _chunkHKN3AAB2js.Context.getAop(meta2, {
55
+ const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
56
56
  globalFilter,
57
57
  globalGuards,
58
58
  globalPipe
59
59
  });
60
- const context = new (0, _chunkHKN3AAB2js.Context)({
60
+ const context = new (0, _chunkR73A7HS3js.Context)({
61
61
  type: "bullmq",
62
62
  category: "rpc",
63
63
  moduleMap,
@@ -85,9 +85,9 @@ async function create({ moduleMap, meta }, opts = {}) {
85
85
  }
86
86
  });
87
87
  }
88
- _chunk4LLLQOMFjs.__name.call(void 0, handleRequest, "handleRequest");
88
+ _chunkOUQM7GZHjs.__name.call(void 0, handleRequest, "handleRequest");
89
89
  subscribeQueues();
90
- _chunk4LLLQOMFjs.HMR.call(void 0, async () => {
90
+ _chunkOUQM7GZHjs.HMR.call(void 0, async () => {
91
91
  for (const i in workerMap) await workerMap[i].close(true);
92
92
  for (const i in queueMap) await queueMap[i].close();
93
93
  await subscribeQueues();
@@ -97,7 +97,7 @@ async function create({ moduleMap, meta }, opts = {}) {
97
97
  queueMap
98
98
  };
99
99
  }
100
- _chunk4LLLQOMFjs.__name.call(void 0, create, "create");
100
+ _chunkOUQM7GZHjs.__name.call(void 0, create, "create");
101
101
 
102
102
 
103
103
  exports.create = create;
@@ -2,11 +2,11 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-BLLRB5DQ.mjs";
5
+ } from "../../chunk-US2DTB3Z.mjs";
6
6
  import {
7
7
  HMR,
8
8
  __name
9
- } from "../../chunk-NQ55PA2X.mjs";
9
+ } from "../../chunk-JRNXLEAU.mjs";
10
10
 
11
11
  // src/rpc/bullmq/create.ts
12
12
  import { Queue, Worker } from "bullmq";
@@ -2,24 +2,24 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkHKN3AAB2js = require('../../chunk-HKN3AAB2.js');
5
+ var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
6
6
 
7
7
 
8
- var _chunk4LLLQOMFjs = require('../../chunk-4LLLQOMF.js');
8
+ var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
9
9
 
10
10
  // src/rpc/electron/bind.ts
11
11
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
12
12
  var debug = _debug2.default.call(void 0, "phecda-server/electron");
13
13
  function bind(IPC, { moduleMap, meta }, opts = {}) {
14
14
  const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts;
15
- const metaMap = _chunkHKN3AAB2js.createControllerMetaMap.call(void 0, meta, (meta2) => {
15
+ const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
16
16
  const { controller, rpc, method, tag } = meta2.data;
17
17
  if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
18
18
  debug(`register method "${method}" in module "${tag}"`);
19
19
  return true;
20
20
  }
21
21
  });
22
- _chunkHKN3AAB2js.detectAopDep.call(void 0, meta, {
22
+ _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
23
23
  guards: globalGuards,
24
24
  addons: globalAddons
25
25
  }, "rpc");
@@ -31,12 +31,12 @@ function bind(IPC, { moduleMap, meta }, opts = {}) {
31
31
  if (_ps !== 1) return;
32
32
  const meta2 = metaMap.get(tag)[method];
33
33
  const { data: { rpc: { isEvent } = {} } } = meta2;
34
- const aop = _chunkHKN3AAB2js.Context.getAop(meta2, {
34
+ const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
35
35
  globalFilter,
36
36
  globalGuards,
37
37
  globalPipe
38
38
  });
39
- const context = new (0, _chunkHKN3AAB2js.Context)({
39
+ const context = new (0, _chunkR73A7HS3js.Context)({
40
40
  type: "electron",
41
41
  category: "rpc",
42
42
  moduleMap,
@@ -64,9 +64,9 @@ function bind(IPC, { moduleMap, meta }, opts = {}) {
64
64
  }
65
65
  });
66
66
  }
67
- _chunk4LLLQOMFjs.__name.call(void 0, callback, "callback");
67
+ _chunkOUQM7GZHjs.__name.call(void 0, callback, "callback");
68
68
  }
69
- _chunk4LLLQOMFjs.__name.call(void 0, bind, "bind");
69
+ _chunkOUQM7GZHjs.__name.call(void 0, bind, "bind");
70
70
 
71
71
 
72
72
  exports.bind = bind;
@@ -2,10 +2,10 @@ import {
2
2
  Context,
3
3
  createControllerMetaMap,
4
4
  detectAopDep
5
- } from "../../chunk-BLLRB5DQ.mjs";
5
+ } from "../../chunk-US2DTB3Z.mjs";
6
6
  import {
7
7
  __name
8
- } from "../../chunk-NQ55PA2X.mjs";
8
+ } from "../../chunk-JRNXLEAU.mjs";
9
9
 
10
10
  // src/rpc/electron/bind.ts
11
11
  import Debug from "debug";