phecda-server 6.1.0 → 7.0.0-alpha.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.
- package/bin/cli.mjs +160 -157
- package/dist/{chunk-3H3T54IC.mjs → chunk-5622RBNB.mjs} +3 -4
- package/dist/{chunk-NL6QBQAR.js → chunk-BGXSMOLX.js} +20 -21
- package/dist/{chunk-J7B24YSE.mjs → chunk-HMVLXNV3.mjs} +5 -14
- package/dist/{chunk-TVT62GIX.js → chunk-J5CFUN4V.js} +8 -1
- package/dist/{chunk-JDV2XJYE.js → chunk-MBCHNDAY.js} +27 -36
- package/dist/{chunk-2CFYUXPM.mjs → chunk-P75VKZJY.mjs} +101 -137
- package/dist/chunk-SW5IKE5H.js +503 -0
- package/dist/{chunk-G7TD2VB7.mjs → chunk-WHJ5FALK.mjs} +7 -0
- package/dist/{core-P1CsH6jz.d.mts → core-BIcUwV18.d.mts} +1 -1
- package/dist/{core-BlN0Spy9.d.ts → core-CYwEPfN4.d.ts} +1 -1
- package/dist/helper.d.mts +4 -6
- package/dist/helper.d.ts +4 -6
- package/dist/helper.js +3 -3
- package/dist/helper.mjs +2 -2
- package/dist/{server → http}/elysia/index.d.mts +5 -5
- package/dist/{server → http}/elysia/index.d.ts +5 -5
- package/dist/{server → http}/elysia/index.js +80 -62
- package/dist/{server → http}/elysia/index.mjs +50 -32
- package/dist/{server → http}/express/index.d.mts +5 -5
- package/dist/{server → http}/express/index.d.ts +5 -5
- package/dist/{server → http}/express/index.js +71 -55
- package/dist/{server → http}/express/index.mjs +42 -26
- package/dist/{server → http}/fastify/index.d.mts +5 -5
- package/dist/{server → http}/fastify/index.d.ts +5 -5
- package/dist/{server → http}/fastify/index.js +72 -72
- package/dist/{server → http}/fastify/index.mjs +47 -47
- package/dist/{server → http}/h3/index.d.mts +5 -5
- package/dist/{server → http}/h3/index.d.ts +5 -5
- package/dist/http/h3/index.js +160 -0
- package/dist/{server → http}/h3/index.mjs +68 -62
- package/dist/{server → http}/hono/index.d.mts +5 -5
- package/dist/{server → http}/hono/index.d.ts +5 -5
- package/dist/{server → http}/hono/index.js +69 -54
- package/dist/{server → http}/hono/index.mjs +41 -26
- package/dist/{server → http}/hyper-express/index.d.mts +5 -5
- package/dist/{server → http}/hyper-express/index.d.ts +5 -5
- package/dist/{server → http}/hyper-express/index.js +69 -56
- package/dist/{server → http}/hyper-express/index.mjs +41 -28
- package/dist/{server → http}/koa/index.d.mts +5 -5
- package/dist/{server → http}/koa/index.d.ts +5 -5
- package/dist/{server → http}/koa/index.js +71 -55
- package/dist/{server → http}/koa/index.mjs +42 -26
- package/dist/index.d.mts +51 -40
- package/dist/index.d.ts +51 -40
- package/dist/index.js +59 -81
- package/dist/index.mjs +39 -61
- package/dist/{meta-KtfiBIde.d.ts → meta-BXKLFTgG.d.mts} +2 -3
- package/dist/{meta-KtfiBIde.d.mts → meta-BXKLFTgG.d.ts} +2 -3
- package/dist/rpc/bullmq/index.d.mts +6 -6
- package/dist/rpc/bullmq/index.d.ts +6 -6
- package/dist/rpc/bullmq/index.js +24 -24
- package/dist/rpc/bullmq/index.mjs +14 -14
- package/dist/rpc/kafka/index.d.mts +3 -3
- package/dist/rpc/kafka/index.d.ts +3 -3
- package/dist/rpc/kafka/index.js +25 -21
- package/dist/rpc/kafka/index.mjs +15 -11
- package/dist/rpc/nats/index.d.mts +3 -3
- package/dist/rpc/nats/index.d.ts +3 -3
- package/dist/rpc/nats/index.js +22 -21
- package/dist/rpc/nats/index.mjs +13 -12
- package/dist/rpc/rabbitmq/index.d.mts +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +3 -3
- package/dist/rpc/rabbitmq/index.js +23 -22
- package/dist/rpc/rabbitmq/index.mjs +12 -11
- package/dist/rpc/redis/index.d.mts +3 -3
- package/dist/rpc/redis/index.d.ts +3 -3
- package/dist/rpc/redis/index.js +24 -20
- package/dist/rpc/redis/index.mjs +15 -11
- package/dist/test.d.mts +3 -3
- package/dist/test.d.ts +3 -3
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/dist/{types-JVT0mgLD.d.ts → types-BtbL49Zs.d.mts} +2 -1
- package/dist/{types-DIw7B6Up.d.ts → types-VFzEM7LL.d.ts} +5 -5
- package/dist/{types-BvD3B5Ny.d.mts → types-h40T3cRG.d.mts} +5 -5
- package/dist/{types-t9D1fU6G.d.mts → types-m3IEDKjP.d.ts} +2 -1
- package/package.json +23 -23
- package/dist/chunk-DVTBLV6I.js +0 -539
- package/dist/server/h3/index.js +0 -154
package/dist/chunk-DVTBLV6I.js
DELETED
|
@@ -1,539 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkTVT62GIXjs = require('./chunk-TVT62GIX.js');
|
|
9
|
-
|
|
10
|
-
// src/helper.ts
|
|
11
|
-
var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
|
|
12
|
-
|
|
13
|
-
// src/context.ts
|
|
14
|
-
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
15
|
-
|
|
16
|
-
// src/pipe.ts
|
|
17
|
-
var defaultPipe = /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, ({ arg }) => {
|
|
18
|
-
return arg;
|
|
19
|
-
}, "defaultPipe");
|
|
20
|
-
|
|
21
|
-
// src/exception/base.ts
|
|
22
|
-
var Exception = class extends Error {
|
|
23
|
-
static {
|
|
24
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "Exception");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
constructor(message, status = 0, description = "Exception") {
|
|
30
|
-
super(message), this.message = message, this.status = status, this.description = description;
|
|
31
|
-
}
|
|
32
|
-
get data() {
|
|
33
|
-
return {
|
|
34
|
-
message: this.message,
|
|
35
|
-
description: this.description,
|
|
36
|
-
status: this.status,
|
|
37
|
-
[_chunkTVT62GIXjs.ERROR_SYMBOL]: true
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// src/exception/undefine.ts
|
|
43
|
-
var UndefinedException = class extends Exception {
|
|
44
|
-
static {
|
|
45
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "UndefinedException");
|
|
46
|
-
}
|
|
47
|
-
constructor(message) {
|
|
48
|
-
super(message, 500, "Undefined error");
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// src/exception/validate.ts
|
|
53
|
-
var ValidateException = class extends Exception {
|
|
54
|
-
static {
|
|
55
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "ValidateException");
|
|
56
|
-
}
|
|
57
|
-
constructor(message) {
|
|
58
|
-
super(message, 400, "Validate exception");
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// src/exception/forbidden.ts
|
|
63
|
-
var ForbiddenException = class extends Exception {
|
|
64
|
-
static {
|
|
65
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "ForbiddenException");
|
|
66
|
-
}
|
|
67
|
-
constructor(message) {
|
|
68
|
-
super(message, 403, "Forbidden resource");
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// src/exception/bad-request.ts
|
|
73
|
-
var BadRequestException = class extends Exception {
|
|
74
|
-
static {
|
|
75
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "BadRequestException");
|
|
76
|
-
}
|
|
77
|
-
constructor(message) {
|
|
78
|
-
super(message, 400, "Bad Request");
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// src/exception/not-found.ts
|
|
83
|
-
var NotFoundException = class extends Exception {
|
|
84
|
-
static {
|
|
85
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "NotFoundException");
|
|
86
|
-
}
|
|
87
|
-
constructor(message) {
|
|
88
|
-
super(message, 404, "Not Found");
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// src/exception/conflict.ts
|
|
93
|
-
var ConflictException = class extends Exception {
|
|
94
|
-
static {
|
|
95
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "ConflictException");
|
|
96
|
-
}
|
|
97
|
-
constructor(message) {
|
|
98
|
-
super(message, 409, "Conflict");
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// src/exception/bad-gateway.ts
|
|
103
|
-
var BadGatewayException = class extends Exception {
|
|
104
|
-
static {
|
|
105
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "BadGatewayException");
|
|
106
|
-
}
|
|
107
|
-
constructor(message) {
|
|
108
|
-
super(message, 502, "Bad Gatrway");
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// src/exception/invalid-input.ts
|
|
113
|
-
var InvalidInputException = class extends Exception {
|
|
114
|
-
static {
|
|
115
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "InvalidInputException");
|
|
116
|
-
}
|
|
117
|
-
constructor(message) {
|
|
118
|
-
super(message, 502, "Invalid Input");
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// src/exception/media-type.ts
|
|
123
|
-
var UnsupportedMediaTypeException = class extends Exception {
|
|
124
|
-
static {
|
|
125
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "UnsupportedMediaTypeException");
|
|
126
|
-
}
|
|
127
|
-
constructor(message) {
|
|
128
|
-
super(message, 415, "Unsupported Media Type");
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// src/exception/payload-large.ts
|
|
133
|
-
var PayloadLargeException = class extends Exception {
|
|
134
|
-
static {
|
|
135
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "PayloadLargeException");
|
|
136
|
-
}
|
|
137
|
-
constructor(message) {
|
|
138
|
-
super(message, 413, "Payload Too Large");
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// src/exception/timeout.ts
|
|
143
|
-
var TimeoutException = class extends Exception {
|
|
144
|
-
static {
|
|
145
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "TimeoutException");
|
|
146
|
-
}
|
|
147
|
-
constructor(message) {
|
|
148
|
-
super(message, 408, "Request Timeout");
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
// src/exception/unauthorized.ts
|
|
153
|
-
var UnauthorizedException = class extends Exception {
|
|
154
|
-
static {
|
|
155
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "UnauthorizedException");
|
|
156
|
-
}
|
|
157
|
-
constructor(message) {
|
|
158
|
-
super(message, 401, "Unauthorized");
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// src/exception/unavailable-service.ts
|
|
163
|
-
var ServiceUnavailableException = class extends Exception {
|
|
164
|
-
static {
|
|
165
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "ServiceUnavailableException");
|
|
166
|
-
}
|
|
167
|
-
constructor(message) {
|
|
168
|
-
super(message, 503, "Service Unavailable");
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
// src/exception/framework.ts
|
|
173
|
-
var FrameworkException = class extends Exception {
|
|
174
|
-
static {
|
|
175
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "FrameworkException");
|
|
176
|
-
}
|
|
177
|
-
constructor(message) {
|
|
178
|
-
super(`[phecda-server] ${message}`, 500, "Framework Error");
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
// src/exception/timer.ts
|
|
183
|
-
var TimerException = class extends Exception {
|
|
184
|
-
static {
|
|
185
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "TimerException");
|
|
186
|
-
}
|
|
187
|
-
constructor(message) {
|
|
188
|
-
super(message, 0, "Timer Error");
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
// src/exception/worker.ts
|
|
193
|
-
var WorkerException = class extends Exception {
|
|
194
|
-
static {
|
|
195
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "WorkerException");
|
|
196
|
-
}
|
|
197
|
-
constructor(message) {
|
|
198
|
-
super(message, 0, "Worker Error");
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// src/filter.ts
|
|
203
|
-
var defaultFilter = /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (e) => {
|
|
204
|
-
if (!(e instanceof Exception)) {
|
|
205
|
-
_chunkTVT62GIXjs.log.call(void 0, e.message, "error");
|
|
206
|
-
if (_chunkTVT62GIXjs.LOG_LEVEL <= 0) console.error(e.stack);
|
|
207
|
-
e = new UndefinedException(e.message || e);
|
|
208
|
-
} else {
|
|
209
|
-
_chunkTVT62GIXjs.log.call(void 0, `[${e.constructor.name}] ${e.message}`, "error");
|
|
210
|
-
if (_chunkTVT62GIXjs.LOG_LEVEL <= 0) console.error(e.stack);
|
|
211
|
-
}
|
|
212
|
-
return e.data;
|
|
213
|
-
}, "defaultFilter");
|
|
214
|
-
|
|
215
|
-
// src/context.ts
|
|
216
|
-
var debug = _debug2.default.call(void 0, "phecda-server(Context)");
|
|
217
|
-
var Context = (_class = class _Context {
|
|
218
|
-
static {
|
|
219
|
-
_chunkTVT62GIXjs.__name.call(void 0, this, "Context");
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
static __initStatic() {this.filterRecord = {
|
|
225
|
-
default: defaultFilter
|
|
226
|
-
}}
|
|
227
|
-
static __initStatic2() {this.pipeRecord = {
|
|
228
|
-
default: defaultPipe
|
|
229
|
-
}}
|
|
230
|
-
static __initStatic3() {this.guardRecord = {}}
|
|
231
|
-
static __initStatic4() {this.interceptorRecord = {}}
|
|
232
|
-
static __initStatic5() {this.pluginRecord = {}}
|
|
233
|
-
|
|
234
|
-
constructor(data) {
|
|
235
|
-
this.data = data;
|
|
236
|
-
if (_chunkTVT62GIXjs.IS_HMR)
|
|
237
|
-
data._context = this;
|
|
238
|
-
}
|
|
239
|
-
async run(opts, successCb, failCb) {
|
|
240
|
-
const { meta, moduleMap } = this.data;
|
|
241
|
-
const { globalGuards = [], globalFilter, globalInterceptors = [], globalPipe } = opts;
|
|
242
|
-
const { paramsType, data: { guards, interceptors, params, tag, func, ctxs, filter } } = meta;
|
|
243
|
-
try {
|
|
244
|
-
await this.useGuard([
|
|
245
|
-
...globalGuards,
|
|
246
|
-
...guards
|
|
247
|
-
]);
|
|
248
|
-
const i1 = await this.useInterceptor([
|
|
249
|
-
...globalInterceptors,
|
|
250
|
-
...interceptors
|
|
251
|
-
]);
|
|
252
|
-
if (i1 !== void 0) return successCb(i1);
|
|
253
|
-
const args = await this.usePipe(params.map((param) => {
|
|
254
|
-
return {
|
|
255
|
-
arg: resolveDep(this.data[param.type], param.key),
|
|
256
|
-
reflect: paramsType[param.index],
|
|
257
|
-
...param,
|
|
258
|
-
pipe: param.pipe || globalPipe
|
|
259
|
-
};
|
|
260
|
-
}));
|
|
261
|
-
const instance = moduleMap.get(tag);
|
|
262
|
-
if (ctxs) {
|
|
263
|
-
ctxs.forEach((ctx) => instance[ctx] = this.data);
|
|
264
|
-
}
|
|
265
|
-
const returnData = await instance[func](...args);
|
|
266
|
-
const i2 = await this.usePostInterceptor(returnData);
|
|
267
|
-
if (i2 !== void 0) return successCb(i2);
|
|
268
|
-
return successCb(returnData);
|
|
269
|
-
} catch (e) {
|
|
270
|
-
const err = await this.useFilter(e, filter || globalFilter);
|
|
271
|
-
return failCb(err);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
usePipe(args) {
|
|
275
|
-
return Promise.all(args.map((item) => {
|
|
276
|
-
if (item.pipe && !_Context.pipeRecord[item.pipe]) {
|
|
277
|
-
if (_chunkTVT62GIXjs.IS_STRICT) {
|
|
278
|
-
throw new FrameworkException(`can't find pipe named '${item.pipe}'`);
|
|
279
|
-
} else {
|
|
280
|
-
debug(`Can't find pipe named "${item.pipe}" when handling the ${item.index + 1}th argument of the func "${this.data.func}" on module "${this.data.tag}",use default pipe instead`);
|
|
281
|
-
return _Context.pipeRecord.default(item, this.data);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return _Context.pipeRecord[item.pipe || "default"](item, this.data);
|
|
285
|
-
}));
|
|
286
|
-
}
|
|
287
|
-
useFilter(arg, filter = "default") {
|
|
288
|
-
if (!_Context.filterRecord[filter]) {
|
|
289
|
-
if (_chunkTVT62GIXjs.IS_STRICT) {
|
|
290
|
-
throw new FrameworkException(`can't find filter named "${filter}"`);
|
|
291
|
-
} else {
|
|
292
|
-
debug(`Can't find filter named "${filter}" when handling func "${this.data.func}" on module "${this.data.tag}",use default filter instead`);
|
|
293
|
-
return _Context.filterRecord.default(arg, this.data);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
return _Context.filterRecord[filter](arg, this.data);
|
|
297
|
-
}
|
|
298
|
-
async useGuard(guards) {
|
|
299
|
-
for (const guard of new Set(guards)) {
|
|
300
|
-
if (!(guard in _Context.guardRecord)) {
|
|
301
|
-
if (_chunkTVT62GIXjs.IS_STRICT) throw new FrameworkException(`Can't find guard named "${guard}"`);
|
|
302
|
-
else debug(`Can't find guard named "${guard}" when handling func "${this.data.func}" on module "${this.data.tag}",skip it`);
|
|
303
|
-
continue;
|
|
304
|
-
}
|
|
305
|
-
if (!await _Context.guardRecord[guard](this.data)) throw new ForbiddenException(`Guard exception--[${guard}]`);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
async usePostInterceptor(data) {
|
|
309
|
-
for (const cb of this.postInterceptors) {
|
|
310
|
-
const ret = await cb(data);
|
|
311
|
-
if (ret !== void 0) return ret;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
async useInterceptor(interceptors) {
|
|
315
|
-
const cb = [];
|
|
316
|
-
for (const interceptor of new Set(interceptors)) {
|
|
317
|
-
if (!(interceptor in _Context.interceptorRecord)) {
|
|
318
|
-
if (_chunkTVT62GIXjs.IS_STRICT) throw new FrameworkException(`can't find interceptor named "${interceptor}"`);
|
|
319
|
-
else debug(`Can't find interceptor named "${interceptor}" when handling func "${this.data.func}" on module "${this.data.tag}",skip it`);
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
const interceptRet = await _Context.interceptorRecord[interceptor](this.data);
|
|
323
|
-
if (interceptRet !== void 0) {
|
|
324
|
-
if (typeof interceptRet === "function") cb.push(interceptRet);
|
|
325
|
-
else return interceptRet;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
this.postInterceptors = cb;
|
|
329
|
-
}
|
|
330
|
-
static usePlugin(plugins, framework) {
|
|
331
|
-
const ret = [];
|
|
332
|
-
for (const m of new Set(plugins)) {
|
|
333
|
-
if (!(m in _Context.pluginRecord)) {
|
|
334
|
-
if (_chunkTVT62GIXjs.IS_STRICT) throw new FrameworkException(`can't find middleware named '${m}'`);
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
const plugin = _Context.pluginRecord[m](framework);
|
|
338
|
-
plugin && ret.push(plugin);
|
|
339
|
-
}
|
|
340
|
-
return ret;
|
|
341
|
-
}
|
|
342
|
-
}, _class.__initStatic(), _class.__initStatic2(), _class.__initStatic3(), _class.__initStatic4(), _class.__initStatic5(), _class);
|
|
343
|
-
function addPlugin(key, handler) {
|
|
344
|
-
if (Context.pluginRecord[key] && Context.pluginRecord[key] !== handler) _chunkTVT62GIXjs.log.call(void 0, `overwrite Plugin "${String(key)}"`, "warn");
|
|
345
|
-
Context.pluginRecord[key] = handler;
|
|
346
|
-
}
|
|
347
|
-
_chunkTVT62GIXjs.__name.call(void 0, addPlugin, "addPlugin");
|
|
348
|
-
function addPipe(key, handler) {
|
|
349
|
-
if (Context.pipeRecord[key] && Context.pipeRecord[key] !== handler) _chunkTVT62GIXjs.log.call(void 0, `overwrite Pipe "${String(key)}"`, "warn");
|
|
350
|
-
Context.pipeRecord[key] = handler;
|
|
351
|
-
}
|
|
352
|
-
_chunkTVT62GIXjs.__name.call(void 0, addPipe, "addPipe");
|
|
353
|
-
function addFilter(key, handler) {
|
|
354
|
-
if (Context.filterRecord[key] && Context.filterRecord[key] !== handler) _chunkTVT62GIXjs.log.call(void 0, `overwrite Filter "${String(key)}"`, "warn");
|
|
355
|
-
Context.filterRecord[key] = handler;
|
|
356
|
-
}
|
|
357
|
-
_chunkTVT62GIXjs.__name.call(void 0, addFilter, "addFilter");
|
|
358
|
-
function addGuard(key, handler) {
|
|
359
|
-
if (Context.guardRecord[key] && Context.guardRecord[key] !== handler) _chunkTVT62GIXjs.log.call(void 0, `overwrite Guard "${String(key)}"`, "warn");
|
|
360
|
-
Context.guardRecord[key] = handler;
|
|
361
|
-
}
|
|
362
|
-
_chunkTVT62GIXjs.__name.call(void 0, addGuard, "addGuard");
|
|
363
|
-
function addInterceptor(key, handler) {
|
|
364
|
-
if (Context.interceptorRecord[key] && Context.interceptorRecord[key] !== handler) _chunkTVT62GIXjs.log.call(void 0, `overwrite Interceptor "${String(key)}"`, "warn");
|
|
365
|
-
Context.interceptorRecord[key] = handler;
|
|
366
|
-
}
|
|
367
|
-
_chunkTVT62GIXjs.__name.call(void 0, addInterceptor, "addInterceptor");
|
|
368
|
-
|
|
369
|
-
// src/hmr.ts
|
|
370
|
-
function HMR(cb) {
|
|
371
|
-
if (_chunkTVT62GIXjs.IS_HMR) _optionalChain([globalThis, 'access', _ => _.__PS_HMR__, 'optionalAccess', _2 => _2.push, 'call', _3 => _3(cb)]);
|
|
372
|
-
}
|
|
373
|
-
_chunkTVT62GIXjs.__name.call(void 0, HMR, "HMR");
|
|
374
|
-
|
|
375
|
-
// src/server/helper.ts
|
|
376
|
-
function resolveDep(ret, key) {
|
|
377
|
-
if (key) return _optionalChain([ret, 'optionalAccess', _4 => _4[key]]);
|
|
378
|
-
return ret;
|
|
379
|
-
}
|
|
380
|
-
_chunkTVT62GIXjs.__name.call(void 0, resolveDep, "resolveDep");
|
|
381
|
-
function argToReq(params, args, headers) {
|
|
382
|
-
const req = {
|
|
383
|
-
body: {},
|
|
384
|
-
query: {},
|
|
385
|
-
params: {},
|
|
386
|
-
headers
|
|
387
|
-
};
|
|
388
|
-
params.forEach((param) => {
|
|
389
|
-
if (param.key) req[param.type][param.key] = args[param.index];
|
|
390
|
-
else req[param.type] = args[param.index];
|
|
391
|
-
});
|
|
392
|
-
return req;
|
|
393
|
-
}
|
|
394
|
-
_chunkTVT62GIXjs.__name.call(void 0, argToReq, "argToReq");
|
|
395
|
-
|
|
396
|
-
// src/rpc/helper.ts
|
|
397
|
-
var _os = require('os');
|
|
398
|
-
function genClientQueue(key) {
|
|
399
|
-
return `PS-${key ? `${key}-` : ""}${_os.hostname.call(void 0, )}-${process.pid}`;
|
|
400
|
-
}
|
|
401
|
-
_chunkTVT62GIXjs.__name.call(void 0, genClientQueue, "genClientQueue");
|
|
402
|
-
|
|
403
|
-
// src/decorators/helper.ts
|
|
404
|
-
function shallowClone(obj) {
|
|
405
|
-
return {
|
|
406
|
-
...obj
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
_chunkTVT62GIXjs.__name.call(void 0, shallowClone, "shallowClone");
|
|
410
|
-
function mergeObject(...args) {
|
|
411
|
-
return Object.assign({}, ...args);
|
|
412
|
-
}
|
|
413
|
-
_chunkTVT62GIXjs.__name.call(void 0, mergeObject, "mergeObject");
|
|
414
|
-
|
|
415
|
-
// src/helper.ts
|
|
416
|
-
function createControllerMetaMap(meta, filter) {
|
|
417
|
-
const metaMap = /* @__PURE__ */ new Map();
|
|
418
|
-
function handleMeta() {
|
|
419
|
-
metaMap.clear();
|
|
420
|
-
for (const item of meta) {
|
|
421
|
-
const { tag, func } = item.data;
|
|
422
|
-
if (!filter(item)) continue;
|
|
423
|
-
if (metaMap.has(tag)) metaMap.get(tag)[func] = item;
|
|
424
|
-
else metaMap.set(tag, {
|
|
425
|
-
[func]: item
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
_chunkTVT62GIXjs.__name.call(void 0, handleMeta, "handleMeta");
|
|
430
|
-
handleMeta();
|
|
431
|
-
HMR(handleMeta);
|
|
432
|
-
return metaMap;
|
|
433
|
-
}
|
|
434
|
-
_chunkTVT62GIXjs.__name.call(void 0, createControllerMetaMap, "createControllerMetaMap");
|
|
435
|
-
function detectAopDep(meta, { guards, interceptors, plugins } = {}, controller = "http") {
|
|
436
|
-
const pluginSet = /* @__PURE__ */ new Set();
|
|
437
|
-
const guardSet = /* @__PURE__ */ new Set();
|
|
438
|
-
const interceptorSet = /* @__PURE__ */ new Set();
|
|
439
|
-
const pipeSet = /* @__PURE__ */ new Set();
|
|
440
|
-
const filterSet = /* @__PURE__ */ new Set();
|
|
441
|
-
const warningSet = /* @__PURE__ */ new Set();
|
|
442
|
-
function handleMeta() {
|
|
443
|
-
pluginSet.clear();
|
|
444
|
-
guardSet.clear();
|
|
445
|
-
interceptorSet.clear();
|
|
446
|
-
pipeSet.clear();
|
|
447
|
-
filterSet.clear();
|
|
448
|
-
warningSet.clear();
|
|
449
|
-
_optionalChain([plugins, 'optionalAccess', _5 => _5.forEach, 'call', _6 => _6((item) => {
|
|
450
|
-
pluginSet.add(item);
|
|
451
|
-
})]);
|
|
452
|
-
_optionalChain([guards, 'optionalAccess', _7 => _7.forEach, 'call', _8 => _8((item) => {
|
|
453
|
-
guardSet.add(item);
|
|
454
|
-
})]);
|
|
455
|
-
_optionalChain([interceptors, 'optionalAccess', _9 => _9.forEach, 'call', _10 => _10((item) => {
|
|
456
|
-
interceptorSet.add(item);
|
|
457
|
-
})]);
|
|
458
|
-
meta.forEach(({ data }) => {
|
|
459
|
-
if (data.controller !== controller) {
|
|
460
|
-
if (data[controller]) warningSet.add(`Module "${data.tag === data.name ? data.name : `${data.name}(${data.tag})`}" should use ${controller} controller to decorate class or remove ${controller} decorator on method "${data.func}"`);
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
if (data.filter) filterSet.add(data.filter);
|
|
464
|
-
data.interceptors.forEach((i) => interceptorSet.add(i));
|
|
465
|
-
data.guards.forEach((i) => guardSet.add(i));
|
|
466
|
-
data.plugins.forEach((i) => pluginSet.add(i));
|
|
467
|
-
data.params.forEach((i) => {
|
|
468
|
-
if (i.pipe) pipeSet.add(i.pipe);
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
const missPlugins = [
|
|
472
|
-
...pluginSet
|
|
473
|
-
].filter((i) => !Context.pluginRecord[i]);
|
|
474
|
-
const missGuards = [
|
|
475
|
-
...guardSet
|
|
476
|
-
].filter((i) => !Context.guardRecord[i]);
|
|
477
|
-
const missInterceptors = [
|
|
478
|
-
...interceptorSet
|
|
479
|
-
].filter((i) => !Context.interceptorRecord[i]);
|
|
480
|
-
const missPipes = [
|
|
481
|
-
...pipeSet
|
|
482
|
-
].filter((i) => !Context.pipeRecord[i]);
|
|
483
|
-
const missFilters = [
|
|
484
|
-
...filterSet
|
|
485
|
-
].filter((i) => !Context.filterRecord[i]);
|
|
486
|
-
if (missPlugins.length) _chunkTVT62GIXjs.log.call(void 0, `${_picocolors2.default.white(`Plugin [${missPlugins.join(",")}]`)} doesn't exist`, "warn");
|
|
487
|
-
if (missGuards.length) _chunkTVT62GIXjs.log.call(void 0, `${_picocolors2.default.magenta(`Guard [${missGuards.join(",")}]`)} doesn't exist`, "warn");
|
|
488
|
-
if (missInterceptors.length) _chunkTVT62GIXjs.log.call(void 0, `${_picocolors2.default.cyan(`Interceptor [${missInterceptors.join(",")}]`)} doesn't exist`, "warn");
|
|
489
|
-
if (missPipes.length) _chunkTVT62GIXjs.log.call(void 0, `${_picocolors2.default.blue(`Pipe [${missPipes.join(",")}]`)} doesn't exist`, "warn");
|
|
490
|
-
if (missFilters.length) _chunkTVT62GIXjs.log.call(void 0, `${_picocolors2.default.red(`Filter [${missFilters.join(",")}]`)} doesn't exist`, "warn");
|
|
491
|
-
warningSet.forEach((warn) => _chunkTVT62GIXjs.log.call(void 0, warn, "warn"));
|
|
492
|
-
}
|
|
493
|
-
_chunkTVT62GIXjs.__name.call(void 0, handleMeta, "handleMeta");
|
|
494
|
-
handleMeta();
|
|
495
|
-
HMR(handleMeta);
|
|
496
|
-
return {
|
|
497
|
-
pluginSet,
|
|
498
|
-
guardSet,
|
|
499
|
-
interceptorSet,
|
|
500
|
-
pipeSet,
|
|
501
|
-
filterSet
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
_chunkTVT62GIXjs.__name.call(void 0, detectAopDep, "detectAopDep");
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
exports.defaultPipe = defaultPipe; exports.Exception = Exception; exports.UndefinedException = UndefinedException; exports.ValidateException = ValidateException; exports.ForbiddenException = ForbiddenException; exports.BadRequestException = BadRequestException; exports.NotFoundException = NotFoundException; exports.ConflictException = ConflictException; exports.BadGatewayException = BadGatewayException; exports.InvalidInputException = InvalidInputException; exports.UnsupportedMediaTypeException = UnsupportedMediaTypeException; exports.PayloadLargeException = PayloadLargeException; exports.TimeoutException = TimeoutException; exports.UnauthorizedException = UnauthorizedException; exports.ServiceUnavailableException = ServiceUnavailableException; exports.FrameworkException = FrameworkException; exports.TimerException = TimerException; exports.WorkerException = WorkerException; exports.Context = Context; exports.addPlugin = addPlugin; exports.addPipe = addPipe; exports.addFilter = addFilter; exports.addGuard = addGuard; exports.addInterceptor = addInterceptor; exports.HMR = HMR; exports.resolveDep = resolveDep; exports.argToReq = argToReq; exports.genClientQueue = genClientQueue; exports.shallowClone = shallowClone; exports.mergeObject = mergeObject; exports.createControllerMetaMap = createControllerMetaMap; exports.detectAopDep = detectAopDep;
|
package/dist/server/h3/index.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkDVTBLV6Ijs = require('../../chunk-DVTBLV6I.js');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkTVT62GIXjs = require('../../chunk-TVT62GIX.js');
|
|
11
|
-
|
|
12
|
-
// src/server/h3/bind.ts
|
|
13
|
-
var _h3 = require('h3');
|
|
14
|
-
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
15
|
-
var debug = _debug2.default.call(void 0, "phecda-server/h3");
|
|
16
|
-
function bind(router, data, opts = {}) {
|
|
17
|
-
const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
|
|
18
|
-
const { moduleMap, meta } = data;
|
|
19
|
-
const metaMap = _chunkDVTBLV6Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
20
|
-
const { controller, http, func, tag } = meta2.data;
|
|
21
|
-
if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.type])) {
|
|
22
|
-
debug(`register method "${func}" in module "${tag}"`);
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
_chunkDVTBLV6Ijs.detectAopDep.call(void 0, meta, {
|
|
27
|
-
plugins: [
|
|
28
|
-
...globalPlugins,
|
|
29
|
-
...parallelPlugins
|
|
30
|
-
],
|
|
31
|
-
guards: globalGuards,
|
|
32
|
-
interceptors: globalInterceptors
|
|
33
|
-
});
|
|
34
|
-
registerRoute();
|
|
35
|
-
async function registerRoute() {
|
|
36
|
-
if (parallelRoute) {
|
|
37
|
-
router.post(parallelRoute, _h3.eventHandler.call(void 0, {
|
|
38
|
-
onRequest: _chunkDVTBLV6Ijs.Context.usePlugin([
|
|
39
|
-
...globalPlugins,
|
|
40
|
-
...parallelPlugins
|
|
41
|
-
], "h3").map(_h3.defineRequestMiddleware),
|
|
42
|
-
handler: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, async (event) => {
|
|
43
|
-
const body = await _h3.readBody.call(void 0, event, {
|
|
44
|
-
strict: true
|
|
45
|
-
});
|
|
46
|
-
async function errorHandler(e) {
|
|
47
|
-
const error = await _chunkDVTBLV6Ijs.Context.filterRecord.default(e);
|
|
48
|
-
_h3.setResponseStatus.call(void 0, event, error.status);
|
|
49
|
-
return error;
|
|
50
|
-
}
|
|
51
|
-
_chunkTVT62GIXjs.__name.call(void 0, errorHandler, "errorHandler");
|
|
52
|
-
if (!Array.isArray(body)) return errorHandler(new (0, _chunkDVTBLV6Ijs.BadRequestException)("data format should be an array"));
|
|
53
|
-
try {
|
|
54
|
-
return Promise.all(body.map((item, i) => {
|
|
55
|
-
return new Promise(async (resolve) => {
|
|
56
|
-
const { tag, func } = item;
|
|
57
|
-
debug(`(parallel)invoke method "${func}" in module "${tag}"`);
|
|
58
|
-
if (!metaMap.has(tag)) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`module "${tag}" doesn't exist`)));
|
|
59
|
-
const meta2 = metaMap.get(tag)[func];
|
|
60
|
-
if (!meta2) return resolve(await _chunkDVTBLV6Ijs.Context.filterRecord.default(new (0, _chunkDVTBLV6Ijs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
|
|
61
|
-
const { data: { params } } = meta2;
|
|
62
|
-
const contextData = {
|
|
63
|
-
type: "h3",
|
|
64
|
-
index: i,
|
|
65
|
-
event,
|
|
66
|
-
meta: meta2,
|
|
67
|
-
moduleMap,
|
|
68
|
-
tag,
|
|
69
|
-
func,
|
|
70
|
-
parallel: true,
|
|
71
|
-
app: router,
|
|
72
|
-
..._chunkDVTBLV6Ijs.argToReq.call(void 0, params, item.args, _h3.getRequestHeaders.call(void 0, event)),
|
|
73
|
-
getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => _h3.getCookie.call(void 0, event, key), "getCookie"),
|
|
74
|
-
setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2) => _h3.setCookie.call(void 0, event, key, value, opts2), "setCookie"),
|
|
75
|
-
delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => _h3.deleteCookie.call(void 0, event, key), "delCookie"),
|
|
76
|
-
redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url, status) => _h3.sendRedirect.call(void 0, event, url, status), "redirect"),
|
|
77
|
-
setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => _h3.setResponseHeaders.call(void 0, event, headers), "setResHeaders"),
|
|
78
|
-
setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (code) => _h3.setResponseStatus.call(void 0, event, code), "setResStatus"),
|
|
79
|
-
getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => event.node.req, "getRequest"),
|
|
80
|
-
getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => event.node.res, "getResponse")
|
|
81
|
-
};
|
|
82
|
-
const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
|
|
83
|
-
context.run({
|
|
84
|
-
globalGuards,
|
|
85
|
-
globalInterceptors,
|
|
86
|
-
globalFilter,
|
|
87
|
-
globalPipe
|
|
88
|
-
}, resolve, resolve);
|
|
89
|
-
});
|
|
90
|
-
}));
|
|
91
|
-
} catch (e) {
|
|
92
|
-
return errorHandler(e);
|
|
93
|
-
}
|
|
94
|
-
}, "handler")
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
for (const [tag, record] of metaMap) {
|
|
98
|
-
for (const func in record) {
|
|
99
|
-
const meta2 = metaMap.get(tag)[func];
|
|
100
|
-
const { data: { http, params, plugins } } = meta2;
|
|
101
|
-
if (!_optionalChain([http, 'optionalAccess', _2 => _2.type])) continue;
|
|
102
|
-
const needBody = params.some((item) => item.type === "body");
|
|
103
|
-
router[http.type](http.prefix + http.route, _h3.eventHandler.call(void 0, {
|
|
104
|
-
onRequest: _chunkDVTBLV6Ijs.Context.usePlugin([
|
|
105
|
-
...globalPlugins,
|
|
106
|
-
...plugins
|
|
107
|
-
], "h3").map(_h3.defineRequestMiddleware),
|
|
108
|
-
handler: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, async (event) => {
|
|
109
|
-
debug(`invoke method "${func}" in module "${tag}"`);
|
|
110
|
-
const contextData = {
|
|
111
|
-
type: "h3",
|
|
112
|
-
meta: meta2,
|
|
113
|
-
event,
|
|
114
|
-
moduleMap,
|
|
115
|
-
tag,
|
|
116
|
-
func,
|
|
117
|
-
headers: _h3.getRequestHeaders.call(void 0, event),
|
|
118
|
-
params: _h3.getRouterParams.call(void 0, event),
|
|
119
|
-
query: _h3.getQuery.call(void 0, event),
|
|
120
|
-
app: router,
|
|
121
|
-
body: needBody ? await _h3.readBody.call(void 0, event, {
|
|
122
|
-
strict: true
|
|
123
|
-
}) : void 0,
|
|
124
|
-
getCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => _h3.getCookie.call(void 0, event, key), "getCookie"),
|
|
125
|
-
setCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key, value, opts2) => _h3.setCookie.call(void 0, event, key, value, opts2), "setCookie"),
|
|
126
|
-
redirect: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (url) => _h3.sendRedirect.call(void 0, event, url), "redirect"),
|
|
127
|
-
setResHeaders: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (headers) => _h3.setResponseHeaders.call(void 0, event, headers), "setResHeaders"),
|
|
128
|
-
setResStatus: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (code) => _h3.setResponseStatus.call(void 0, event, code), "setResStatus"),
|
|
129
|
-
delCookie: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, (key) => _h3.deleteCookie.call(void 0, event, key), "delCookie"),
|
|
130
|
-
getRequest: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => event.node.req, "getRequest"),
|
|
131
|
-
getResponse: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, () => event.node.res, "getResponse")
|
|
132
|
-
};
|
|
133
|
-
const context = new (0, _chunkDVTBLV6Ijs.Context)(contextData);
|
|
134
|
-
_h3.setHeaders.call(void 0, event, http.headers || {});
|
|
135
|
-
return context.run({
|
|
136
|
-
globalGuards,
|
|
137
|
-
globalInterceptors,
|
|
138
|
-
globalFilter,
|
|
139
|
-
globalPipe
|
|
140
|
-
}, (returnData) => returnData, (err) => {
|
|
141
|
-
_h3.setResponseStatus.call(void 0, event, err.status);
|
|
142
|
-
return err;
|
|
143
|
-
});
|
|
144
|
-
}, "handler")
|
|
145
|
-
}));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
_chunkTVT62GIXjs.__name.call(void 0, registerRoute, "registerRoute");
|
|
150
|
-
}
|
|
151
|
-
_chunkTVT62GIXjs.__name.call(void 0, bind, "bind");
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
exports.bind = bind;
|