phecda-server 8.2.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.
@@ -27,8 +27,9 @@ var Exception = class extends Error {
27
27
 
28
28
 
29
29
 
30
- constructor(message, status = 0, description = "Exception") {
31
- super(message), this.message = message, this.status = status, this.description = description;
30
+
31
+ constructor(message, metadata, status = 0, description = "Exception") {
32
+ super(message), this.message = message, this.metadata = metadata, this.status = status, this.description = description;
32
33
  }
33
34
  get data() {
34
35
  return {
@@ -45,8 +46,8 @@ var UndefinedException = class extends Exception {
45
46
  static {
46
47
  _chunkOUQM7GZHjs.__name.call(void 0, this, "UndefinedException");
47
48
  }
48
- constructor(message) {
49
- super(message, 500, "Undefined error");
49
+ constructor(message, metadata) {
50
+ super(message, metadata, 500, "Undefined error");
50
51
  }
51
52
  };
52
53
 
@@ -55,8 +56,8 @@ var ValidateException = class extends Exception {
55
56
  static {
56
57
  _chunkOUQM7GZHjs.__name.call(void 0, this, "ValidateException");
57
58
  }
58
- constructor(message) {
59
- super(message, 400, "Validate exception");
59
+ constructor(message, metadata) {
60
+ super(message, metadata, 400, "Validate exception");
60
61
  }
61
62
  };
62
63
 
@@ -65,8 +66,8 @@ var ForbiddenException = class extends Exception {
65
66
  static {
66
67
  _chunkOUQM7GZHjs.__name.call(void 0, this, "ForbiddenException");
67
68
  }
68
- constructor(message) {
69
- super(message, 403, "Forbidden resource");
69
+ constructor(message, metadata) {
70
+ super(message, metadata, 403, "Forbidden resource");
70
71
  }
71
72
  };
72
73
 
@@ -75,8 +76,8 @@ var BadRequestException = class extends Exception {
75
76
  static {
76
77
  _chunkOUQM7GZHjs.__name.call(void 0, this, "BadRequestException");
77
78
  }
78
- constructor(message) {
79
- super(message, 400, "Bad Request");
79
+ constructor(message, metadata) {
80
+ super(message, metadata, 400, "Bad Request");
80
81
  }
81
82
  };
82
83
 
@@ -85,8 +86,8 @@ var NotFoundException = class extends Exception {
85
86
  static {
86
87
  _chunkOUQM7GZHjs.__name.call(void 0, this, "NotFoundException");
87
88
  }
88
- constructor(message) {
89
- super(message, 404, "Not Found");
89
+ constructor(message, metadata) {
90
+ super(message, metadata, 404, "Not Found");
90
91
  }
91
92
  };
92
93
 
@@ -95,8 +96,8 @@ var ConflictException = class extends Exception {
95
96
  static {
96
97
  _chunkOUQM7GZHjs.__name.call(void 0, this, "ConflictException");
97
98
  }
98
- constructor(message) {
99
- super(message, 409, "Conflict");
99
+ constructor(message, metadata) {
100
+ super(message, metadata, 409, "Conflict");
100
101
  }
101
102
  };
102
103
 
@@ -105,8 +106,8 @@ var BadGatewayException = class extends Exception {
105
106
  static {
106
107
  _chunkOUQM7GZHjs.__name.call(void 0, this, "BadGatewayException");
107
108
  }
108
- constructor(message) {
109
- super(message, 502, "Bad Gatrway");
109
+ constructor(message, metadata) {
110
+ super(message, metadata, 502, "Bad Gatrway");
110
111
  }
111
112
  };
112
113
 
@@ -115,8 +116,8 @@ var InvalidInputException = class extends Exception {
115
116
  static {
116
117
  _chunkOUQM7GZHjs.__name.call(void 0, this, "InvalidInputException");
117
118
  }
118
- constructor(message) {
119
- super(message, 502, "Invalid Input");
119
+ constructor(message, metadata) {
120
+ super(message, metadata, 502, "Invalid Input");
120
121
  }
121
122
  };
122
123
 
@@ -125,8 +126,8 @@ var UnsupportedMediaTypeException = class extends Exception {
125
126
  static {
126
127
  _chunkOUQM7GZHjs.__name.call(void 0, this, "UnsupportedMediaTypeException");
127
128
  }
128
- constructor(message) {
129
- super(message, 415, "Unsupported Media Type");
129
+ constructor(message, metadata) {
130
+ super(message, metadata, 415, "Unsupported Media Type");
130
131
  }
131
132
  };
132
133
 
@@ -135,8 +136,8 @@ var PayloadLargeException = class extends Exception {
135
136
  static {
136
137
  _chunkOUQM7GZHjs.__name.call(void 0, this, "PayloadLargeException");
137
138
  }
138
- constructor(message) {
139
- super(message, 413, "Payload Too Large");
139
+ constructor(message, metadata) {
140
+ super(message, metadata, 413, "Payload Too Large");
140
141
  }
141
142
  };
142
143
 
@@ -145,8 +146,8 @@ var TimeoutException = class extends Exception {
145
146
  static {
146
147
  _chunkOUQM7GZHjs.__name.call(void 0, this, "TimeoutException");
147
148
  }
148
- constructor(message) {
149
- super(message, 408, "Request Timeout");
149
+ constructor(message, metadata) {
150
+ super(message, metadata, 408, "Request Timeout");
150
151
  }
151
152
  };
152
153
 
@@ -155,8 +156,8 @@ var UnauthorizedException = class extends Exception {
155
156
  static {
156
157
  _chunkOUQM7GZHjs.__name.call(void 0, this, "UnauthorizedException");
157
158
  }
158
- constructor(message) {
159
- super(message, 401, "Unauthorized");
159
+ constructor(message, metadata) {
160
+ super(message, metadata, 401, "Unauthorized");
160
161
  }
161
162
  };
162
163
 
@@ -165,8 +166,8 @@ var ServiceUnavailableException = class extends Exception {
165
166
  static {
166
167
  _chunkOUQM7GZHjs.__name.call(void 0, this, "ServiceUnavailableException");
167
168
  }
168
- constructor(message) {
169
- super(message, 503, "Service Unavailable");
169
+ constructor(message, metadata) {
170
+ super(message, metadata, 503, "Service Unavailable");
170
171
  }
171
172
  };
172
173
 
@@ -175,8 +176,8 @@ var FrameworkException = class extends Exception {
175
176
  static {
176
177
  _chunkOUQM7GZHjs.__name.call(void 0, this, "FrameworkException");
177
178
  }
178
- constructor(message) {
179
- super(`[phecda-server] ${message}`, 500, "Framework Error");
179
+ constructor(message, metadata) {
180
+ super(`[phecda-server] ${message}`, metadata, 500, "Framework Error");
180
181
  }
181
182
  };
182
183
 
@@ -185,8 +186,8 @@ var TimerException = class extends Exception {
185
186
  static {
186
187
  _chunkOUQM7GZHjs.__name.call(void 0, this, "TimerException");
187
188
  }
188
- constructor(message) {
189
- super(message, 0, "Timer Error");
189
+ constructor(message, metadata) {
190
+ super(message, metadata, 0, "Timer Error");
190
191
  }
191
192
  };
192
193
 
@@ -195,8 +196,8 @@ var WorkerException = class extends Exception {
195
196
  static {
196
197
  _chunkOUQM7GZHjs.__name.call(void 0, this, "WorkerException");
197
198
  }
198
- constructor(message) {
199
- super(message, 0, "Worker Error");
199
+ constructor(message, metadata) {
200
+ super(message, metadata, 0, "Worker Error");
200
201
  }
201
202
  };
202
203
 
@@ -25,10 +25,11 @@ var Exception = class extends Error {
25
25
  __name(this, "Exception");
26
26
  }
27
27
  message;
28
+ metadata;
28
29
  status;
29
30
  description;
30
- constructor(message, status = 0, description = "Exception") {
31
- super(message), this.message = message, this.status = status, this.description = description;
31
+ constructor(message, metadata, status = 0, description = "Exception") {
32
+ super(message), this.message = message, this.metadata = metadata, this.status = status, this.description = description;
32
33
  }
33
34
  get data() {
34
35
  return {
@@ -45,8 +46,8 @@ var UndefinedException = class extends Exception {
45
46
  static {
46
47
  __name(this, "UndefinedException");
47
48
  }
48
- constructor(message) {
49
- super(message, 500, "Undefined error");
49
+ constructor(message, metadata) {
50
+ super(message, metadata, 500, "Undefined error");
50
51
  }
51
52
  };
52
53
 
@@ -55,8 +56,8 @@ var ValidateException = class extends Exception {
55
56
  static {
56
57
  __name(this, "ValidateException");
57
58
  }
58
- constructor(message) {
59
- super(message, 400, "Validate exception");
59
+ constructor(message, metadata) {
60
+ super(message, metadata, 400, "Validate exception");
60
61
  }
61
62
  };
62
63
 
@@ -65,8 +66,8 @@ var ForbiddenException = class extends Exception {
65
66
  static {
66
67
  __name(this, "ForbiddenException");
67
68
  }
68
- constructor(message) {
69
- super(message, 403, "Forbidden resource");
69
+ constructor(message, metadata) {
70
+ super(message, metadata, 403, "Forbidden resource");
70
71
  }
71
72
  };
72
73
 
@@ -75,8 +76,8 @@ var BadRequestException = class extends Exception {
75
76
  static {
76
77
  __name(this, "BadRequestException");
77
78
  }
78
- constructor(message) {
79
- super(message, 400, "Bad Request");
79
+ constructor(message, metadata) {
80
+ super(message, metadata, 400, "Bad Request");
80
81
  }
81
82
  };
82
83
 
@@ -85,8 +86,8 @@ var NotFoundException = class extends Exception {
85
86
  static {
86
87
  __name(this, "NotFoundException");
87
88
  }
88
- constructor(message) {
89
- super(message, 404, "Not Found");
89
+ constructor(message, metadata) {
90
+ super(message, metadata, 404, "Not Found");
90
91
  }
91
92
  };
92
93
 
@@ -95,8 +96,8 @@ var ConflictException = class extends Exception {
95
96
  static {
96
97
  __name(this, "ConflictException");
97
98
  }
98
- constructor(message) {
99
- super(message, 409, "Conflict");
99
+ constructor(message, metadata) {
100
+ super(message, metadata, 409, "Conflict");
100
101
  }
101
102
  };
102
103
 
@@ -105,8 +106,8 @@ var BadGatewayException = class extends Exception {
105
106
  static {
106
107
  __name(this, "BadGatewayException");
107
108
  }
108
- constructor(message) {
109
- super(message, 502, "Bad Gatrway");
109
+ constructor(message, metadata) {
110
+ super(message, metadata, 502, "Bad Gatrway");
110
111
  }
111
112
  };
112
113
 
@@ -115,8 +116,8 @@ var InvalidInputException = class extends Exception {
115
116
  static {
116
117
  __name(this, "InvalidInputException");
117
118
  }
118
- constructor(message) {
119
- super(message, 502, "Invalid Input");
119
+ constructor(message, metadata) {
120
+ super(message, metadata, 502, "Invalid Input");
120
121
  }
121
122
  };
122
123
 
@@ -125,8 +126,8 @@ var UnsupportedMediaTypeException = class extends Exception {
125
126
  static {
126
127
  __name(this, "UnsupportedMediaTypeException");
127
128
  }
128
- constructor(message) {
129
- super(message, 415, "Unsupported Media Type");
129
+ constructor(message, metadata) {
130
+ super(message, metadata, 415, "Unsupported Media Type");
130
131
  }
131
132
  };
132
133
 
@@ -135,8 +136,8 @@ var PayloadLargeException = class extends Exception {
135
136
  static {
136
137
  __name(this, "PayloadLargeException");
137
138
  }
138
- constructor(message) {
139
- super(message, 413, "Payload Too Large");
139
+ constructor(message, metadata) {
140
+ super(message, metadata, 413, "Payload Too Large");
140
141
  }
141
142
  };
142
143
 
@@ -145,8 +146,8 @@ var TimeoutException = class extends Exception {
145
146
  static {
146
147
  __name(this, "TimeoutException");
147
148
  }
148
- constructor(message) {
149
- super(message, 408, "Request Timeout");
149
+ constructor(message, metadata) {
150
+ super(message, metadata, 408, "Request Timeout");
150
151
  }
151
152
  };
152
153
 
@@ -155,8 +156,8 @@ var UnauthorizedException = class extends Exception {
155
156
  static {
156
157
  __name(this, "UnauthorizedException");
157
158
  }
158
- constructor(message) {
159
- super(message, 401, "Unauthorized");
159
+ constructor(message, metadata) {
160
+ super(message, metadata, 401, "Unauthorized");
160
161
  }
161
162
  };
162
163
 
@@ -165,8 +166,8 @@ var ServiceUnavailableException = class extends Exception {
165
166
  static {
166
167
  __name(this, "ServiceUnavailableException");
167
168
  }
168
- constructor(message) {
169
- super(message, 503, "Service Unavailable");
169
+ constructor(message, metadata) {
170
+ super(message, metadata, 503, "Service Unavailable");
170
171
  }
171
172
  };
172
173
 
@@ -175,8 +176,8 @@ var FrameworkException = class extends Exception {
175
176
  static {
176
177
  __name(this, "FrameworkException");
177
178
  }
178
- constructor(message) {
179
- super(`[phecda-server] ${message}`, 500, "Framework Error");
179
+ constructor(message, metadata) {
180
+ super(`[phecda-server] ${message}`, metadata, 500, "Framework Error");
180
181
  }
181
182
  };
182
183
 
@@ -185,8 +186,8 @@ var TimerException = class extends Exception {
185
186
  static {
186
187
  __name(this, "TimerException");
187
188
  }
188
- constructor(message) {
189
- super(message, 0, "Timer Error");
189
+ constructor(message, metadata) {
190
+ super(message, metadata, 0, "Timer Error");
190
191
  }
191
192
  };
192
193
 
@@ -195,8 +196,8 @@ var WorkerException = class extends Exception {
195
196
  static {
196
197
  __name(this, "WorkerException");
197
198
  }
198
- constructor(message) {
199
- super(message, 0, "Worker Error");
199
+ constructor(message, metadata) {
200
+ super(message, metadata, 0, "Worker Error");
200
201
  }
201
202
  };
202
203
 
package/dist/helper.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkMPKVT4SQjs = require('./chunk-MPKVT4SQ.js');
8
+ var _chunkR73A7HS3js = require('./chunk-R73A7HS3.js');
9
9
 
10
10
 
11
11
 
@@ -21,4 +21,4 @@ var _chunkOUQM7GZHjs = require('./chunk-OUQM7GZH.js');
21
21
 
22
22
 
23
23
 
24
- exports.HMR = _chunkOUQM7GZHjs.HMR; exports.RELAUNCH = _chunkOUQM7GZHjs.RELAUNCH; exports.RELOAD = _chunkOUQM7GZHjs.RELOAD; exports.createControllerMetaMap = _chunkMPKVT4SQjs.createControllerMetaMap; exports.detectAopDep = _chunkMPKVT4SQjs.detectAopDep; exports.joinUrl = _chunkMPKVT4SQjs.joinUrl; exports.mergeObject = _chunkMPKVT4SQjs.mergeObject; exports.resolveDep = _chunkMPKVT4SQjs.resolveDep; exports.shallowClone = _chunkMPKVT4SQjs.shallowClone;
24
+ exports.HMR = _chunkOUQM7GZHjs.HMR; exports.RELAUNCH = _chunkOUQM7GZHjs.RELAUNCH; exports.RELOAD = _chunkOUQM7GZHjs.RELOAD; exports.createControllerMetaMap = _chunkR73A7HS3js.createControllerMetaMap; exports.detectAopDep = _chunkR73A7HS3js.detectAopDep; exports.joinUrl = _chunkR73A7HS3js.joinUrl; exports.mergeObject = _chunkR73A7HS3js.mergeObject; exports.resolveDep = _chunkR73A7HS3js.resolveDep; exports.shallowClone = _chunkR73A7HS3js.shallowClone;
package/dist/helper.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  mergeObject,
6
6
  resolveDep,
7
7
  shallowClone
8
- } from "./chunk-2P2UICBC.mjs";
8
+ } from "./chunk-US2DTB3Z.mjs";
9
9
  import {
10
10
  HMR,
11
11
  RELAUNCH,
@@ -7,7 +7,7 @@ var _chunkC424F7TVjs = require('../../chunk-C424F7TV.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkMPKVT4SQjs = require('../../chunk-MPKVT4SQ.js');
10
+ var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
11
11
 
12
12
 
13
13
  var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
@@ -19,14 +19,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/elysia");
19
19
  function bind(app, data, opts = {}) {
20
20
  const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
21
21
  const { moduleMap, meta } = data;
22
- const metaMap = _chunkMPKVT4SQjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
+ const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
23
23
  const { controller, http, method, tag } = meta2.data;
24
24
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
25
25
  debug(`register method "${method}" in module "${tag}"`);
26
26
  return true;
27
27
  }
28
28
  });
29
- _chunkMPKVT4SQjs.detectAopDep.call(void 0, meta, {
29
+ _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
30
30
  addons: [
31
31
  ...globalAddons,
32
32
  ...parallelAddons
@@ -35,29 +35,29 @@ function bind(app, data, opts = {}) {
35
35
  });
36
36
  registerRoute();
37
37
  function registerRoute() {
38
- _chunkMPKVT4SQjs.Context.applyAddons(globalAddons, app, "elysia");
38
+ _chunkR73A7HS3js.Context.applyAddons(globalAddons, app, "elysia");
39
39
  if (parallelRoute) {
40
40
  const parallelRouter = new (0, _elysia.Elysia)();
41
- _chunkMPKVT4SQjs.Context.applyAddons(parallelAddons, app, "elysia");
41
+ _chunkR73A7HS3js.Context.applyAddons(parallelAddons, app, "elysia");
42
42
  parallelRouter.post(parallelRoute, async (c) => {
43
43
  const { body } = c;
44
44
  async function errorHandler(e) {
45
- const error = await _chunkMPKVT4SQjs.Context.filterRecord.default(e);
45
+ const error = await _chunkR73A7HS3js.Context.filterRecord.default(e);
46
46
  c.set.status = error.status;
47
47
  return error;
48
48
  }
49
49
  _chunkOUQM7GZHjs.__name.call(void 0, errorHandler, "errorHandler");
50
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkMPKVT4SQjs.BadRequestException)("data format should be an array"));
50
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkR73A7HS3js.BadRequestException)("data format should be an array"));
51
51
  try {
52
52
  return Promise.all(body.map((item, i) => {
53
53
  return new Promise(async (resolve) => {
54
54
  if (!item) return resolve(null);
55
55
  const { tag, method } = item;
56
56
  debug(`(parallel)invoke method "${method}" in module "${tag}"`);
57
- if (!metaMap.has(tag)) return resolve(await _chunkMPKVT4SQjs.Context.filterRecord.default(new (0, _chunkMPKVT4SQjs.BadRequestException)(`module "${tag}" doesn't exist`)));
57
+ if (!metaMap.has(tag)) return resolve(await _chunkR73A7HS3js.Context.filterRecord.default(new (0, _chunkR73A7HS3js.BadRequestException)(`module "${tag}" doesn't exist`)));
58
58
  const meta2 = metaMap.get(tag)[method];
59
- if (!meta2) return resolve(await _chunkMPKVT4SQjs.Context.filterRecord.default(new (0, _chunkMPKVT4SQjs.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
60
- const aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
59
+ if (!meta2) return resolve(await _chunkR73A7HS3js.Context.filterRecord.default(new (0, _chunkR73A7HS3js.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
60
+ const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
61
61
  globalGuards,
62
62
  globalFilter,
63
63
  globalPipe
@@ -88,7 +88,7 @@ function bind(app, data, opts = {}) {
88
88
  throw new Error("elysia can't support getResponse");
89
89
  }, "getResponse")
90
90
  };
91
- const context = new (0, _chunkMPKVT4SQjs.Context)(contextData);
91
+ const context = new (0, _chunkR73A7HS3js.Context)(contextData);
92
92
  context.run(aop, resolve, resolve);
93
93
  });
94
94
  })).then((ret) => {
@@ -110,14 +110,14 @@ function bind(app, data, opts = {}) {
110
110
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
111
111
  let aop;
112
112
  if (!dynamic) {
113
- aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
113
+ aop = _chunkR73A7HS3js.Context.getAop(meta2, {
114
114
  globalFilter,
115
115
  globalGuards,
116
116
  globalPipe
117
117
  });
118
118
  }
119
- _chunkMPKVT4SQjs.Context.applyAddons(addons, subApp, "elysia");
120
- subApp[http.method](_chunkMPKVT4SQjs.joinUrl.call(void 0, http.prefix, http.route), async (c) => {
119
+ _chunkR73A7HS3js.Context.applyAddons(addons, subApp, "elysia");
120
+ subApp[http.method](_chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route), async (c) => {
121
121
  debug(`invoke method "${method}" in module "${tag}"`);
122
122
  const contextData = {
123
123
  type: "elysia",
@@ -149,16 +149,16 @@ function bind(app, data, opts = {}) {
149
149
  }, "getResponse")
150
150
  };
151
151
  if (dynamic) {
152
- aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
152
+ aop = _chunkR73A7HS3js.Context.getAop(meta2, {
153
153
  globalFilter,
154
154
  globalGuards,
155
155
  globalPipe
156
156
  });
157
157
  }
158
- const context = new (0, _chunkMPKVT4SQjs.Context)(contextData);
158
+ const context = new (0, _chunkR73A7HS3js.Context)(contextData);
159
159
  if (http.headers) c.set.headers = http.headers;
160
160
  if (dynamic) {
161
- aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
161
+ aop = _chunkR73A7HS3js.Context.getAop(meta2, {
162
162
  globalFilter,
163
163
  globalGuards,
164
164
  globalPipe
@@ -7,7 +7,7 @@ import {
7
7
  createControllerMetaMap,
8
8
  detectAopDep,
9
9
  joinUrl
10
- } from "../../chunk-2P2UICBC.mjs";
10
+ } from "../../chunk-US2DTB3Z.mjs";
11
11
  import {
12
12
  __name
13
13
  } from "../../chunk-JRNXLEAU.mjs";
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkMPKVT4SQjs = require('../../chunk-MPKVT4SQ.js');
7
+ var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
8
8
 
9
9
 
10
10
 
@@ -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 = _chunkMPKVT4SQjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
21
+ const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
22
  const { controller, http, method, tag } = meta2.data;
23
23
  if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
24
24
  debug(`register method "${method}" in module "${tag}"`);
25
25
  return true;
26
26
  }
27
27
  });
28
- _chunkMPKVT4SQjs.detectAopDep.call(void 0, meta, {
28
+ _chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
29
29
  addons: [
30
30
  ...globalAddons,
31
31
  ...parallelAddons
@@ -38,28 +38,28 @@ function bind(router, data, opts = {}) {
38
38
  registerRoute();
39
39
  });
40
40
  function registerRoute() {
41
- _chunkMPKVT4SQjs.Context.applyAddons(globalAddons, router, "express");
41
+ _chunkR73A7HS3js.Context.applyAddons(globalAddons, router, "express");
42
42
  if (parallelRoute) {
43
43
  const subRouter = _express.Router.call(void 0, );
44
- _chunkMPKVT4SQjs.Context.applyAddons(parallelAddons, subRouter, "express");
44
+ _chunkR73A7HS3js.Context.applyAddons(parallelAddons, subRouter, "express");
45
45
  subRouter.use(async (req, res, next) => {
46
46
  const { body } = req;
47
47
  async function errorHandler(e) {
48
- const error = await _chunkMPKVT4SQjs.Context.filterRecord.default(e);
48
+ const error = await _chunkR73A7HS3js.Context.filterRecord.default(e);
49
49
  return res.status(error.status).json(error);
50
50
  }
51
51
  _chunkOUQM7GZHjs.__name.call(void 0, errorHandler, "errorHandler");
52
- if (!Array.isArray(body)) return errorHandler(new (0, _chunkMPKVT4SQjs.BadRequestException)("data format should be an array"));
52
+ if (!Array.isArray(body)) return errorHandler(new (0, _chunkR73A7HS3js.BadRequestException)("data format should be an array"));
53
53
  try {
54
54
  return Promise.all(body.map((item, i) => {
55
55
  return new Promise(async (resolve) => {
56
56
  if (!item) return resolve(null);
57
57
  const { tag, method } = item;
58
58
  debug(`(parallel)invoke method "${method}" in module "${tag}"`);
59
- if (!metaMap.has(tag)) return resolve(await _chunkMPKVT4SQjs.Context.filterRecord.default(new (0, _chunkMPKVT4SQjs.BadRequestException)(`module "${tag}" doesn't exist`)));
59
+ if (!metaMap.has(tag)) return resolve(await _chunkR73A7HS3js.Context.filterRecord.default(new (0, _chunkR73A7HS3js.BadRequestException)(`module "${tag}" doesn't exist`)));
60
60
  const meta2 = metaMap.get(tag)[method];
61
- if (!meta2) return resolve(await _chunkMPKVT4SQjs.Context.filterRecord.default(new (0, _chunkMPKVT4SQjs.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
62
- const aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
61
+ if (!meta2) return resolve(await _chunkR73A7HS3js.Context.filterRecord.default(new (0, _chunkR73A7HS3js.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
62
+ const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
63
63
  globalFilter,
64
64
  globalGuards,
65
65
  globalPipe
@@ -87,7 +87,7 @@ function bind(router, data, opts = {}) {
87
87
  getRequest: /* @__PURE__ */ _chunkOUQM7GZHjs.__name.call(void 0, () => req, "getRequest"),
88
88
  getResponse: /* @__PURE__ */ _chunkOUQM7GZHjs.__name.call(void 0, () => res, "getResponse")
89
89
  };
90
- const context = new (0, _chunkMPKVT4SQjs.Context)(contextData);
90
+ const context = new (0, _chunkR73A7HS3js.Context)(contextData);
91
91
  context.run(aop, resolve, resolve);
92
92
  });
93
93
  })).then((ret) => {
@@ -106,15 +106,15 @@ function bind(router, data, opts = {}) {
106
106
  if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
107
107
  let aop;
108
108
  if (!dynamic) {
109
- aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
109
+ aop = _chunkR73A7HS3js.Context.getAop(meta2, {
110
110
  globalFilter,
111
111
  globalGuards,
112
112
  globalPipe
113
113
  });
114
114
  }
115
115
  const subRouter = _express.Router.call(void 0, );
116
- _chunkMPKVT4SQjs.Context.applyAddons(addons, subRouter, "express");
117
- subRouter[http.method](_chunkMPKVT4SQjs.joinUrl.call(void 0, http.prefix, http.route), async (req, res, next) => {
116
+ _chunkR73A7HS3js.Context.applyAddons(addons, subRouter, "express");
117
+ subRouter[http.method](_chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route), async (req, res, next) => {
118
118
  debug(`invoke method "${method}" in module "${tag}"`);
119
119
  const contextData = {
120
120
  type: "express",
@@ -142,10 +142,10 @@ function bind(router, data, opts = {}) {
142
142
  getRequest: /* @__PURE__ */ _chunkOUQM7GZHjs.__name.call(void 0, () => req, "getRequest"),
143
143
  getResponse: /* @__PURE__ */ _chunkOUQM7GZHjs.__name.call(void 0, () => res, "getResponse")
144
144
  };
145
- const context = new (0, _chunkMPKVT4SQjs.Context)(contextData);
145
+ const context = new (0, _chunkR73A7HS3js.Context)(contextData);
146
146
  if (http.headers) res.set(http.headers);
147
147
  if (dynamic) {
148
- aop = _chunkMPKVT4SQjs.Context.getAop(meta2, {
148
+ aop = _chunkR73A7HS3js.Context.getAop(meta2, {
149
149
  globalFilter,
150
150
  globalGuards,
151
151
  globalPipe
@@ -4,7 +4,7 @@ import {
4
4
  createControllerMetaMap,
5
5
  detectAopDep,
6
6
  joinUrl
7
- } from "../../chunk-2P2UICBC.mjs";
7
+ } from "../../chunk-US2DTB3Z.mjs";
8
8
  import {
9
9
  HMR,
10
10
  __name