phecda-server 5.0.0-alpha.10 → 5.0.0-alpha.12
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/dist/{chunk-CLW7EYYD.js → chunk-27WMBKFH.js} +30 -23
- package/dist/{chunk-WB437JJ2.mjs → chunk-DJO45NRZ.mjs} +17 -3
- package/dist/{chunk-ALJSRZ4Z.js → chunk-GWLM5DEJ.js} +17 -3
- package/dist/{chunk-EP4EN3MM.mjs → chunk-HQ5RLYMA.mjs} +1 -1
- package/dist/{chunk-ZV4O77YM.js → chunk-KOWUK5OV.js} +65 -61
- package/dist/{chunk-DBYLTVRY.mjs → chunk-L5SFPHG6.mjs} +25 -21
- package/dist/{chunk-GY5KXMJJ.js → chunk-SSZS3GSQ.js} +2 -2
- package/dist/{chunk-BXJSLR46.mjs → chunk-UXPHQ7OT.mjs} +9 -2
- package/dist/{core-fe0991cd.d.ts → core-295348b7.d.ts} +3 -1
- package/dist/index.d.ts +14 -12
- package/dist/index.js +66 -62
- package/dist/index.mjs +20 -16
- package/dist/rpc/kafka/index.d.ts +1 -1
- package/dist/rpc/kafka/index.js +9 -9
- package/dist/rpc/kafka/index.mjs +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +1 -1
- package/dist/rpc/rabbitmq/index.js +9 -9
- package/dist/rpc/rabbitmq/index.mjs +3 -3
- package/dist/rpc/redis/index.d.ts +1 -1
- package/dist/rpc/redis/index.js +9 -9
- package/dist/rpc/redis/index.mjs +3 -3
- package/dist/server/express/index.d.ts +1 -1
- package/dist/server/express/index.js +24 -24
- package/dist/server/express/index.mjs +4 -4
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/fastify/index.js +22 -22
- package/dist/server/fastify/index.mjs +4 -4
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/h3/index.js +21 -21
- package/dist/server/h3/index.mjs +4 -4
- package/dist/server/koa/index.d.ts +1 -1
- package/dist/server/koa/index.js +24 -24
- package/dist/server/koa/index.mjs +4 -4
- package/dist/test.d.ts +1 -1
- package/dist/test.js +5 -5
- package/dist/test.mjs +2 -2
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__name,
|
|
6
6
|
__publicField,
|
|
7
7
|
log
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DJO45NRZ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/exception/base.ts
|
|
11
11
|
var Exception = class extends Error {
|
|
@@ -169,16 +169,12 @@ import pc from "picocolors";
|
|
|
169
169
|
// src/filter.ts
|
|
170
170
|
var defaultFilter = /* @__PURE__ */ __name((e) => {
|
|
171
171
|
if (!(e instanceof Exception)) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
console.error(e.stack);
|
|
175
|
-
}
|
|
172
|
+
log(e.message, "error");
|
|
173
|
+
console.error(e.stack);
|
|
176
174
|
e = new UndefinedException(e.message || e);
|
|
177
175
|
} else {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
console.error(e.stack);
|
|
181
|
-
}
|
|
176
|
+
log(`[${e.constructor.name}] ${e.message}`, "error");
|
|
177
|
+
console.error(e.stack);
|
|
182
178
|
}
|
|
183
179
|
return e.data;
|
|
184
180
|
}, "defaultFilter");
|
|
@@ -272,12 +268,12 @@ var _Context = class {
|
|
|
272
268
|
static usePlugin(plugins) {
|
|
273
269
|
const ret = [];
|
|
274
270
|
for (const m of plugins) {
|
|
275
|
-
if (!(m in _Context.
|
|
271
|
+
if (!(m in _Context.addonRecord)) {
|
|
276
272
|
if (IS_STRICT)
|
|
277
273
|
throw new FrameworkException(`can't find middleware named '${m}'`);
|
|
278
274
|
continue;
|
|
279
275
|
}
|
|
280
|
-
ret.push(_Context.
|
|
276
|
+
ret.push(_Context.addonRecord[m]);
|
|
281
277
|
}
|
|
282
278
|
return ret;
|
|
283
279
|
}
|
|
@@ -292,30 +288,38 @@ __publicField(Context, "pipeRecord", {
|
|
|
292
288
|
});
|
|
293
289
|
__publicField(Context, "guardRecord", {});
|
|
294
290
|
__publicField(Context, "interceptorRecord", {});
|
|
295
|
-
__publicField(Context, "
|
|
296
|
-
function
|
|
297
|
-
Context.
|
|
291
|
+
__publicField(Context, "addonRecord", {});
|
|
292
|
+
function addAddon(key, handler) {
|
|
293
|
+
if (Context.addonRecord[key] && Context.addonRecord[key] !== handler)
|
|
294
|
+
log(`overwrite Addon "${key}"`, "warn");
|
|
295
|
+
Context.addonRecord[key] = handler;
|
|
298
296
|
}
|
|
299
|
-
__name(
|
|
300
|
-
function addPipe(key,
|
|
301
|
-
Context.pipeRecord[key]
|
|
297
|
+
__name(addAddon, "addAddon");
|
|
298
|
+
function addPipe(key, handler) {
|
|
299
|
+
if (Context.pipeRecord[key] && Context.pipeRecord[key] !== handler)
|
|
300
|
+
log(`overwrite Pipe "${key}"`, "warn");
|
|
301
|
+
Context.pipeRecord[key] = handler;
|
|
302
302
|
}
|
|
303
303
|
__name(addPipe, "addPipe");
|
|
304
304
|
function addFilter(key, handler) {
|
|
305
|
+
if (Context.filterRecord[key] && Context.filterRecord[key] !== handler)
|
|
306
|
+
log(`overwrite Filter "${key}"`, "warn");
|
|
305
307
|
Context.filterRecord[key] = handler;
|
|
306
308
|
}
|
|
307
309
|
__name(addFilter, "addFilter");
|
|
308
310
|
function addGuard(key, handler) {
|
|
311
|
+
if (Context.guardRecord[key] && Context.guardRecord[key] !== handler)
|
|
312
|
+
log(`overwrite Guard "${key}"`, "warn");
|
|
309
313
|
Context.guardRecord[key] = handler;
|
|
310
314
|
}
|
|
311
315
|
__name(addGuard, "addGuard");
|
|
312
316
|
function addInterceptor(key, handler) {
|
|
317
|
+
if (Context.interceptorRecord[key] && Context.interceptorRecord[key] !== handler)
|
|
318
|
+
log(`overwrite Interceptor "${key}"`, "warn");
|
|
313
319
|
Context.interceptorRecord[key] = handler;
|
|
314
320
|
}
|
|
315
321
|
__name(addInterceptor, "addInterceptor");
|
|
316
322
|
function isAopDepInject(meta, { guards, interceptors, plugins } = {}) {
|
|
317
|
-
if (!IS_DEV)
|
|
318
|
-
return;
|
|
319
323
|
const pluginSet = new Set(plugins);
|
|
320
324
|
const guardSet = new Set(guards);
|
|
321
325
|
const interceptorSet = new Set(interceptors);
|
|
@@ -334,7 +338,7 @@ function isAopDepInject(meta, { guards, interceptors, plugins } = {}) {
|
|
|
334
338
|
});
|
|
335
339
|
const missPlugins = [
|
|
336
340
|
...pluginSet
|
|
337
|
-
].filter((i) => !Context.
|
|
341
|
+
].filter((i) => !Context.addonRecord[i]);
|
|
338
342
|
const missGuards = [
|
|
339
343
|
...guardSet
|
|
340
344
|
].filter((i) => !Context.guardRecord[i]);
|
|
@@ -379,7 +383,7 @@ export {
|
|
|
379
383
|
FrameworkException,
|
|
380
384
|
guardRecord,
|
|
381
385
|
Context,
|
|
382
|
-
|
|
386
|
+
addAddon,
|
|
383
387
|
addPipe,
|
|
384
388
|
addFilter,
|
|
385
389
|
addGuard,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGWLM5DEJjs = require('./chunk-GWLM5DEJ.js');
|
|
4
4
|
|
|
5
5
|
// src/helper.ts
|
|
6
6
|
function resolveDep(ret, key) {
|
|
@@ -8,7 +8,7 @@ function resolveDep(ret, key) {
|
|
|
8
8
|
return _optionalChain([ret, 'optionalAccess', _ => _[key]]);
|
|
9
9
|
return ret;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
_chunkGWLM5DEJjs.__name.call(void 0, resolveDep, "resolveDep");
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
UNMOUNT_SYMBOL,
|
|
4
4
|
__name,
|
|
5
5
|
log
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DJO45NRZ.mjs";
|
|
7
7
|
|
|
8
8
|
// src/meta.ts
|
|
9
9
|
var Meta = class {
|
|
@@ -151,6 +151,12 @@ async function Factory(Modules, opts = {}) {
|
|
|
151
151
|
return instance;
|
|
152
152
|
}
|
|
153
153
|
__name(del, "del");
|
|
154
|
+
async function destroy() {
|
|
155
|
+
debug("destroy all");
|
|
156
|
+
for (const [tag] of moduleMap)
|
|
157
|
+
await del(tag);
|
|
158
|
+
}
|
|
159
|
+
__name(destroy, "destroy");
|
|
154
160
|
async function add(Module) {
|
|
155
161
|
const tag = Module.prototype?.__TAG__ || Module.name;
|
|
156
162
|
const oldInstance = await del(tag);
|
|
@@ -247,7 +253,8 @@ async function Factory(Modules, opts = {}) {
|
|
|
247
253
|
meta,
|
|
248
254
|
constructorMap,
|
|
249
255
|
add,
|
|
250
|
-
del
|
|
256
|
+
del,
|
|
257
|
+
destroy
|
|
251
258
|
};
|
|
252
259
|
}
|
|
253
260
|
__name(Factory, "Factory");
|
|
@@ -20,6 +20,7 @@ declare const META_SYMBOL = "__PS_META__";
|
|
|
20
20
|
declare const APP_SYMBOL = "__PS__";
|
|
21
21
|
declare const IS_DEV: boolean;
|
|
22
22
|
declare const IS_STRICT: boolean;
|
|
23
|
+
declare const IS_LOG_BAN: boolean;
|
|
23
24
|
declare const ERROR_SYMBOL = "__PS_ERROR__";
|
|
24
25
|
declare const PS_FILE_RE: RegExp;
|
|
25
26
|
declare const PS_IMPORT_RE: RegExp;
|
|
@@ -118,6 +119,7 @@ declare function Factory(Modules: (new (...args: any) => any)[], opts?: {
|
|
|
118
119
|
constructorMap: Map<any, any>;
|
|
119
120
|
add: (Module: Construct) => Promise<void>;
|
|
120
121
|
del: (tag: string) => Promise<any>;
|
|
122
|
+
destroy: () => Promise<void>;
|
|
121
123
|
}>;
|
|
122
124
|
|
|
123
|
-
export { APP_SYMBOL as A, Exception as E, Factory as F, Injectable as I, Meta as M, P, RequestType as R, ToControllerMap as T, UNMOUNT_SYMBOL as U, Emitter as a, PickKeysByValue as b, PickFunc as c, MERGE_SYMBOL as d, emitter as e, MODULE_SYMBOL as f, META_SYMBOL as g, IS_DEV as h, IS_STRICT as i,
|
|
125
|
+
export { APP_SYMBOL as A, Exception as E, Factory as F, Injectable as I, Meta as M, P, RequestType as R, ToControllerMap as T, UNMOUNT_SYMBOL as U, Emitter as a, PickKeysByValue as b, PickFunc as c, MERGE_SYMBOL as d, emitter as e, MODULE_SYMBOL as f, META_SYMBOL as g, IS_DEV as h, IS_STRICT as i, IS_LOG_BAN as j, ERROR_SYMBOL as k, PS_FILE_RE as l, PS_IMPORT_RE as m };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { E as Exception, P, M as Meta, U as UNMOUNT_SYMBOL } from './core-
|
|
2
|
-
export { A as APP_SYMBOL,
|
|
1
|
+
import { E as Exception, P, M as Meta, U as UNMOUNT_SYMBOL } from './core-295348b7.js';
|
|
2
|
+
export { A as APP_SYMBOL, k as ERROR_SYMBOL, a as Emitter, F as Factory, h as IS_DEV, j as IS_LOG_BAN, i as IS_STRICT, I as Injectable, d as MERGE_SYMBOL, g as META_SYMBOL, f as MODULE_SYMBOL, l as PS_FILE_RE, m as PS_IMPORT_RE, c as PickFunc, b as PickKeysByValue, R as RequestType, T as ToControllerMap, e as emitter } from './core-295348b7.js';
|
|
3
|
+
import { Construct } from 'phecda-core';
|
|
3
4
|
export * from 'phecda-core';
|
|
4
5
|
|
|
5
6
|
declare class Histroy {
|
|
@@ -74,7 +75,7 @@ declare class Context<Data extends P.BaseContext> {
|
|
|
74
75
|
static pipeRecord: Record<string, P.Pipe>;
|
|
75
76
|
static guardRecord: Record<string, P.Guard>;
|
|
76
77
|
static interceptorRecord: Record<string, P.Interceptor>;
|
|
77
|
-
static
|
|
78
|
+
static addonRecord: Record<string, any>;
|
|
78
79
|
postInterceptors: Function[];
|
|
79
80
|
constructor(data: Data);
|
|
80
81
|
usePipe(args: {
|
|
@@ -92,8 +93,8 @@ declare class Context<Data extends P.BaseContext> {
|
|
|
92
93
|
useInterceptor(interceptors: string[]): Promise<any>;
|
|
93
94
|
static usePlugin(plugins: string[]): any[];
|
|
94
95
|
}
|
|
95
|
-
declare function
|
|
96
|
-
declare function addPipe<C extends P.BaseContext>(key: string,
|
|
96
|
+
declare function addAddon<T>(key: string, handler: T): void;
|
|
97
|
+
declare function addPipe<C extends P.BaseContext>(key: string, handler: P.Pipe<C>): void;
|
|
97
98
|
declare function addFilter<C extends P.BaseContext>(key: string, handler: P.Filter<C>): void;
|
|
98
99
|
declare function addGuard<C extends P.BaseContext>(key: string, handler: P.Guard<C>): void;
|
|
99
100
|
declare function addInterceptor<C extends P.BaseContext>(key: string, handler: P.Interceptor<C>): void;
|
|
@@ -112,11 +113,11 @@ declare function Param(key: string): any;
|
|
|
112
113
|
declare function Arg(): any;
|
|
113
114
|
|
|
114
115
|
declare function Route(route: string, type?: string): any;
|
|
115
|
-
declare function Get(route
|
|
116
|
-
declare function Post(route
|
|
117
|
-
declare function Put(route
|
|
118
|
-
declare function Patch(route
|
|
119
|
-
declare function Delete(route
|
|
116
|
+
declare function Get(route?: string): any;
|
|
117
|
+
declare function Post(route?: string): any;
|
|
118
|
+
declare function Put(route?: string): any;
|
|
119
|
+
declare function Patch(route?: string): any;
|
|
120
|
+
declare function Delete(route?: string): any;
|
|
120
121
|
declare function Controller(route?: string): any;
|
|
121
122
|
declare function Rpc(...types: ('rabbitmq' | 'redis' | 'kafka' | string)[]): (target: any, key?: PropertyKey) => void;
|
|
122
123
|
declare function Event(isEvent?: boolean): (target: any, key?: PropertyKey) => void;
|
|
@@ -187,7 +188,7 @@ interface PExtension<C extends P.BaseContext = any, E extends Exception = Except
|
|
|
187
188
|
reflect: any;
|
|
188
189
|
}, ctx: C): any;
|
|
189
190
|
filter(error: Error | E, ctx?: C): P.Error;
|
|
190
|
-
|
|
191
|
+
addon(...args: any): void;
|
|
191
192
|
}
|
|
192
193
|
declare class PExtension extends Dev {
|
|
193
194
|
readonly key: string;
|
|
@@ -201,5 +202,6 @@ declare function generateHTTPCode(meta: P.MetaData[]): string;
|
|
|
201
202
|
declare function log(msg: string, level?: 'error' | 'info' | 'warn'): void;
|
|
202
203
|
declare function getConfig<C = any>(key: string, defaultConf?: C): C;
|
|
203
204
|
declare function setConfig<C = any>(key: string, conf: C, force?: boolean): void;
|
|
205
|
+
declare function Mix<C1 extends Construct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
|
|
204
206
|
|
|
205
|
-
export { Arg, BadGatewayException, BadRequestException, BaseParam, Body, ConflictException, Context, Controller, Define, Delete, Dev, Event, Exception, Filter, ForbiddenException, FrameworkException, Get, Guard, Head, Header, Interceptor, InvalidInputException, Meta, NotFoundException, P, PAddon, PExtension, PFilter, PGuard, PInterceptor, PPipe, Param, Patch, PayloadLargeException, Pipe, Plugin, Post, Put, Query, Route, Rpc, ServiceUnavailableException, TimeoutException, UNMOUNT_SYMBOL, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, addFilter, addGuard, addInterceptor, addPipe,
|
|
207
|
+
export { Arg, BadGatewayException, BadRequestException, BaseParam, Body, ConflictException, Context, Controller, Define, Delete, Dev, Event, Exception, Filter, ForbiddenException, FrameworkException, Get, Guard, Head, Header, Interceptor, InvalidInputException, Meta, Mix, NotFoundException, P, PAddon, PExtension, PFilter, PGuard, PInterceptor, PPipe, Param, Patch, PayloadLargeException, Pipe, Plugin, Post, Put, Query, Route, Rpc, ServiceUnavailableException, TimeoutException, UNMOUNT_SYMBOL, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, addAddon, addFilter, addGuard, addInterceptor, addPipe, defaultPipe, generateHTTPCode, generateRPCCode, getConfig, guardRecord, isAopDepInject, log, resolveDep, setConfig };
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk27WMBKFHjs = require('./chunk-27WMBKFH.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkSSZS3GSQjs = require('./chunk-SSZS3GSQ.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -34,7 +34,7 @@ var _chunkGY5KXMJJjs = require('./chunk-GY5KXMJJ.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkKOWUK5OVjs = require('./chunk-KOWUK5OV.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -50,7 +50,9 @@ var _chunkZV4O77YMjs = require('./chunk-ZV4O77YM.js');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var _chunkGWLM5DEJjs = require('./chunk-GWLM5DEJ.js');
|
|
54
56
|
|
|
55
57
|
// src/decorators/index.ts
|
|
56
58
|
var _phecdacore = require('phecda-core'); _createStarExport(_phecdacore);
|
|
@@ -78,7 +80,7 @@ function BaseParam(type, key) {
|
|
|
78
80
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
79
81
|
};
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
_chunkGWLM5DEJjs.__name.call(void 0, BaseParam, "BaseParam");
|
|
82
84
|
function Pipe(key, opts) {
|
|
83
85
|
return (target, k, index) => {
|
|
84
86
|
_phecdacore.setVar.call(void 0, target, k);
|
|
@@ -100,27 +102,27 @@ function Pipe(key, opts) {
|
|
|
100
102
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
101
103
|
};
|
|
102
104
|
}
|
|
103
|
-
|
|
105
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Pipe, "Pipe");
|
|
104
106
|
function Body(key = "") {
|
|
105
107
|
return BaseParam("body", key);
|
|
106
108
|
}
|
|
107
|
-
|
|
109
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Body, "Body");
|
|
108
110
|
function Head(key) {
|
|
109
111
|
return BaseParam("headers", key.toLowerCase());
|
|
110
112
|
}
|
|
111
|
-
|
|
113
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Head, "Head");
|
|
112
114
|
function Query(key = "") {
|
|
113
115
|
return BaseParam("query", key);
|
|
114
116
|
}
|
|
115
|
-
|
|
117
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Query, "Query");
|
|
116
118
|
function Param(key) {
|
|
117
119
|
return BaseParam("params", key);
|
|
118
120
|
}
|
|
119
|
-
|
|
121
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Param, "Param");
|
|
120
122
|
function Arg() {
|
|
121
123
|
return BaseParam("params", "");
|
|
122
124
|
}
|
|
123
|
-
|
|
125
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Arg, "Arg");
|
|
124
126
|
|
|
125
127
|
// src/decorators/route.ts
|
|
126
128
|
|
|
@@ -138,31 +140,31 @@ function Route(route, type) {
|
|
|
138
140
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
139
141
|
};
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
function Get(route) {
|
|
143
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Route, "Route");
|
|
144
|
+
function Get(route = "") {
|
|
143
145
|
return Route(route, "get");
|
|
144
146
|
}
|
|
145
|
-
|
|
146
|
-
function Post(route) {
|
|
147
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Get, "Get");
|
|
148
|
+
function Post(route = "") {
|
|
147
149
|
return Route(route, "post");
|
|
148
150
|
}
|
|
149
|
-
|
|
150
|
-
function Put(route) {
|
|
151
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Post, "Post");
|
|
152
|
+
function Put(route = "") {
|
|
151
153
|
return Route(route, "put");
|
|
152
154
|
}
|
|
153
|
-
|
|
154
|
-
function Patch(route) {
|
|
155
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Put, "Put");
|
|
156
|
+
function Patch(route = "") {
|
|
155
157
|
return Route(route, "patch");
|
|
156
158
|
}
|
|
157
|
-
|
|
158
|
-
function Delete(route) {
|
|
159
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Patch, "Patch");
|
|
160
|
+
function Delete(route = "") {
|
|
159
161
|
return Route(route, "delete");
|
|
160
162
|
}
|
|
161
|
-
|
|
163
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Delete, "Delete");
|
|
162
164
|
function Controller(route = "") {
|
|
163
165
|
return Route(route);
|
|
164
166
|
}
|
|
165
|
-
|
|
167
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Controller, "Controller");
|
|
166
168
|
function Rpc(...types) {
|
|
167
169
|
return (target, key) => {
|
|
168
170
|
if (!key)
|
|
@@ -176,7 +178,7 @@ function Rpc(...types) {
|
|
|
176
178
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
177
179
|
};
|
|
178
180
|
}
|
|
179
|
-
|
|
181
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Rpc, "Rpc");
|
|
180
182
|
function Event(isEvent = true) {
|
|
181
183
|
return (target, key) => {
|
|
182
184
|
if (!key)
|
|
@@ -190,7 +192,7 @@ function Event(isEvent = true) {
|
|
|
190
192
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
191
193
|
};
|
|
192
194
|
}
|
|
193
|
-
|
|
195
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Event, "Event");
|
|
194
196
|
|
|
195
197
|
// src/decorators/aop.ts
|
|
196
198
|
|
|
@@ -207,7 +209,7 @@ function Guard(...guards) {
|
|
|
207
209
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
|
|
212
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Guard, "Guard");
|
|
211
213
|
function Plugin(...plugins) {
|
|
212
214
|
return (target, key) => {
|
|
213
215
|
if (!key)
|
|
@@ -221,7 +223,7 @@ function Plugin(...plugins) {
|
|
|
221
223
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
222
224
|
};
|
|
223
225
|
}
|
|
224
|
-
|
|
226
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Plugin, "Plugin");
|
|
225
227
|
function Interceptor(...interceptors) {
|
|
226
228
|
return (target, key) => {
|
|
227
229
|
if (!key)
|
|
@@ -235,7 +237,7 @@ function Interceptor(...interceptors) {
|
|
|
235
237
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
236
238
|
};
|
|
237
239
|
}
|
|
238
|
-
|
|
240
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Interceptor, "Interceptor");
|
|
239
241
|
function Filter(filter) {
|
|
240
242
|
return (target, key) => {
|
|
241
243
|
if (!key)
|
|
@@ -247,7 +249,7 @@ function Filter(filter) {
|
|
|
247
249
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
248
250
|
};
|
|
249
251
|
}
|
|
250
|
-
|
|
252
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Filter, "Filter");
|
|
251
253
|
|
|
252
254
|
// src/decorators/index.ts
|
|
253
255
|
function Header(name, value) {
|
|
@@ -260,7 +262,7 @@ function Header(name, value) {
|
|
|
260
262
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
261
263
|
};
|
|
262
264
|
}
|
|
263
|
-
|
|
265
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Header, "Header");
|
|
264
266
|
function Define(key, value) {
|
|
265
267
|
return (target, k) => {
|
|
266
268
|
if (!k) {
|
|
@@ -275,7 +277,7 @@ function Define(key, value) {
|
|
|
275
277
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
276
278
|
};
|
|
277
279
|
}
|
|
278
|
-
|
|
280
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Define, "Define");
|
|
279
281
|
|
|
280
282
|
// src/index.ts
|
|
281
283
|
|
|
@@ -292,10 +294,10 @@ var __decorate = function(decorators, target, key, desc) {
|
|
|
292
294
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
293
295
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
294
296
|
};
|
|
295
|
-
var Dev = /* @__PURE__ */
|
|
296
|
-
__init() {this[
|
|
297
|
+
var Dev = /* @__PURE__ */ _chunkGWLM5DEJjs.__name.call(void 0, (_class =class Dev2 {constructor() { _class.prototype.__init.call(this); }
|
|
298
|
+
__init() {this[_chunkGWLM5DEJjs.UNMOUNT_SYMBOL] = []}
|
|
297
299
|
onUnmount(cb) {
|
|
298
|
-
this[
|
|
300
|
+
this[_chunkGWLM5DEJjs.UNMOUNT_SYMBOL].push(cb);
|
|
299
301
|
}
|
|
300
302
|
}, _class), "Dev");
|
|
301
303
|
Dev = exports.Dev = __decorate([
|
|
@@ -309,13 +311,13 @@ var PFilter = class extends Dev {
|
|
|
309
311
|
constructor(tag) {
|
|
310
312
|
super();
|
|
311
313
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
312
|
-
|
|
314
|
+
_chunkKOWUK5OVjs.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
313
315
|
this.onUnmount(() => {
|
|
314
|
-
delete
|
|
316
|
+
delete _chunkKOWUK5OVjs.Context.filterRecord[this.key];
|
|
315
317
|
});
|
|
316
318
|
}
|
|
317
319
|
};
|
|
318
|
-
|
|
320
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PFilter, "PFilter");
|
|
319
321
|
|
|
320
322
|
// src/modules/guard.ts
|
|
321
323
|
|
|
@@ -324,13 +326,13 @@ var PGuard = class extends Dev {
|
|
|
324
326
|
constructor(tag) {
|
|
325
327
|
super();
|
|
326
328
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
327
|
-
|
|
329
|
+
_chunkKOWUK5OVjs.addGuard.call(void 0, this.key, this.use.bind(this));
|
|
328
330
|
this.onUnmount(() => {
|
|
329
|
-
delete
|
|
331
|
+
delete _chunkKOWUK5OVjs.Context.guardRecord[this.key];
|
|
330
332
|
});
|
|
331
333
|
}
|
|
332
334
|
};
|
|
333
|
-
|
|
335
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PGuard, "PGuard");
|
|
334
336
|
|
|
335
337
|
// src/modules/interceptor.ts
|
|
336
338
|
|
|
@@ -340,12 +342,12 @@ var PInterceptor = class extends Dev {
|
|
|
340
342
|
super();
|
|
341
343
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
342
344
|
this.onUnmount(() => {
|
|
343
|
-
delete
|
|
345
|
+
delete _chunkKOWUK5OVjs.Context.interceptorRecord[this.key];
|
|
344
346
|
});
|
|
345
|
-
|
|
347
|
+
_chunkKOWUK5OVjs.addInterceptor.call(void 0, this.key, this.use.bind(this));
|
|
346
348
|
}
|
|
347
349
|
};
|
|
348
|
-
|
|
350
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PInterceptor, "PInterceptor");
|
|
349
351
|
|
|
350
352
|
// src/modules/pipe.ts
|
|
351
353
|
|
|
@@ -354,13 +356,13 @@ var PPipe = class extends Dev {
|
|
|
354
356
|
constructor(tag) {
|
|
355
357
|
super();
|
|
356
358
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
357
|
-
|
|
359
|
+
_chunkKOWUK5OVjs.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
358
360
|
this.onUnmount(() => {
|
|
359
|
-
delete
|
|
361
|
+
delete _chunkKOWUK5OVjs.Context.pipeRecord[this.key];
|
|
360
362
|
});
|
|
361
363
|
}
|
|
362
364
|
};
|
|
363
|
-
|
|
365
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PPipe, "PPipe");
|
|
364
366
|
|
|
365
367
|
// src/modules/addon.ts
|
|
366
368
|
|
|
@@ -369,13 +371,13 @@ var PAddon = class extends Dev {
|
|
|
369
371
|
constructor(tag) {
|
|
370
372
|
super();
|
|
371
373
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
372
|
-
|
|
374
|
+
_chunkKOWUK5OVjs.addAddon.call(void 0, this.key, this.use.bind(this));
|
|
373
375
|
this.onUnmount(() => {
|
|
374
|
-
delete
|
|
376
|
+
delete _chunkKOWUK5OVjs.Context.addonRecord[this.key];
|
|
375
377
|
});
|
|
376
378
|
}
|
|
377
379
|
};
|
|
378
|
-
|
|
380
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PAddon, "PAddon");
|
|
379
381
|
|
|
380
382
|
// src/modules/extension.ts
|
|
381
383
|
|
|
@@ -385,38 +387,40 @@ var PExtension = class extends Dev {
|
|
|
385
387
|
super();
|
|
386
388
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
387
389
|
if (this.pipe) {
|
|
388
|
-
|
|
390
|
+
_chunkKOWUK5OVjs.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
389
391
|
this.onUnmount(() => {
|
|
390
|
-
delete
|
|
392
|
+
delete _chunkKOWUK5OVjs.Context.pipeRecord[key];
|
|
391
393
|
});
|
|
392
394
|
}
|
|
393
|
-
if (this.
|
|
394
|
-
|
|
395
|
+
if (this.addon) {
|
|
396
|
+
_chunkKOWUK5OVjs.addAddon.call(void 0, key, this.addon.bind(this));
|
|
395
397
|
this.onUnmount(() => {
|
|
396
|
-
delete
|
|
398
|
+
delete _chunkKOWUK5OVjs.Context.addonRecord[key];
|
|
397
399
|
});
|
|
398
400
|
}
|
|
399
401
|
if (this.intercept) {
|
|
400
|
-
|
|
402
|
+
_chunkKOWUK5OVjs.addInterceptor.call(void 0, key, this.intercept.bind(this));
|
|
401
403
|
this.onUnmount(() => {
|
|
402
|
-
delete
|
|
404
|
+
delete _chunkKOWUK5OVjs.Context.interceptorRecord[key];
|
|
403
405
|
});
|
|
404
406
|
}
|
|
405
407
|
if (this.guard) {
|
|
406
|
-
|
|
408
|
+
_chunkKOWUK5OVjs.addGuard.call(void 0, key, this.guard.bind(this));
|
|
407
409
|
this.onUnmount(() => {
|
|
408
|
-
delete
|
|
410
|
+
delete _chunkKOWUK5OVjs.Context.guardRecord[key];
|
|
409
411
|
});
|
|
410
412
|
}
|
|
411
413
|
if (this.filter) {
|
|
412
|
-
|
|
414
|
+
_chunkKOWUK5OVjs.addFilter.call(void 0, key, this.filter.bind(this));
|
|
413
415
|
this.onUnmount(() => {
|
|
414
|
-
delete
|
|
416
|
+
delete _chunkKOWUK5OVjs.Context.filterRecord[key];
|
|
415
417
|
});
|
|
416
418
|
}
|
|
417
419
|
}
|
|
418
420
|
};
|
|
419
|
-
|
|
421
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PExtension, "PExtension");
|
|
422
|
+
|
|
423
|
+
|
|
420
424
|
|
|
421
425
|
|
|
422
426
|
|
|
@@ -491,4 +495,4 @@ _chunkALJSRZ4Zjs.__name.call(void 0, PExtension, "PExtension");
|
|
|
491
495
|
|
|
492
496
|
|
|
493
497
|
|
|
494
|
-
exports.APP_SYMBOL =
|
|
498
|
+
exports.APP_SYMBOL = _chunkGWLM5DEJjs.APP_SYMBOL; exports.Arg = Arg; exports.BadGatewayException = _chunkKOWUK5OVjs.BadGatewayException; exports.BadRequestException = _chunkKOWUK5OVjs.BadRequestException; exports.BaseParam = BaseParam; exports.Body = Body; exports.ConflictException = _chunkKOWUK5OVjs.ConflictException; exports.Context = _chunkKOWUK5OVjs.Context; exports.Controller = Controller; exports.Define = Define; exports.Delete = Delete; exports.Dev = Dev; exports.ERROR_SYMBOL = _chunkGWLM5DEJjs.ERROR_SYMBOL; exports.Event = Event; exports.Exception = _chunkKOWUK5OVjs.Exception; exports.Factory = _chunk27WMBKFHjs.Factory; exports.Filter = Filter; exports.ForbiddenException = _chunkKOWUK5OVjs.ForbiddenException; exports.FrameworkException = _chunkKOWUK5OVjs.FrameworkException; exports.Get = Get; exports.Guard = Guard; exports.Head = Head; exports.Header = Header; exports.IS_DEV = _chunkGWLM5DEJjs.IS_DEV; exports.IS_LOG_BAN = _chunkGWLM5DEJjs.IS_LOG_BAN; exports.IS_STRICT = _chunkGWLM5DEJjs.IS_STRICT; exports.Injectable = _chunk27WMBKFHjs.Injectable; exports.Interceptor = Interceptor; exports.InvalidInputException = _chunkKOWUK5OVjs.InvalidInputException; exports.MERGE_SYMBOL = _chunkGWLM5DEJjs.MERGE_SYMBOL; exports.META_SYMBOL = _chunkGWLM5DEJjs.META_SYMBOL; exports.MODULE_SYMBOL = _chunkGWLM5DEJjs.MODULE_SYMBOL; exports.Meta = _chunk27WMBKFHjs.Meta; exports.Mix = _chunkGWLM5DEJjs.Mix; exports.NotFoundException = _chunkKOWUK5OVjs.NotFoundException; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PS_FILE_RE = _chunkGWLM5DEJjs.PS_FILE_RE; exports.PS_IMPORT_RE = _chunkGWLM5DEJjs.PS_IMPORT_RE; exports.Param = Param; exports.Patch = Patch; exports.PayloadLargeException = _chunkKOWUK5OVjs.PayloadLargeException; exports.Pipe = Pipe; exports.Plugin = Plugin; exports.Post = Post; exports.Put = Put; exports.Query = Query; exports.Route = Route; exports.Rpc = Rpc; exports.ServiceUnavailableException = _chunkKOWUK5OVjs.ServiceUnavailableException; exports.TimeoutException = _chunkKOWUK5OVjs.TimeoutException; exports.UNMOUNT_SYMBOL = _chunkGWLM5DEJjs.UNMOUNT_SYMBOL; exports.UnauthorizedException = _chunkKOWUK5OVjs.UnauthorizedException; exports.UndefinedException = _chunkKOWUK5OVjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkKOWUK5OVjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkKOWUK5OVjs.ValidateException; exports.addAddon = _chunkKOWUK5OVjs.addAddon; exports.addFilter = _chunkKOWUK5OVjs.addFilter; exports.addGuard = _chunkKOWUK5OVjs.addGuard; exports.addInterceptor = _chunkKOWUK5OVjs.addInterceptor; exports.addPipe = _chunkKOWUK5OVjs.addPipe; exports.defaultPipe = _chunkKOWUK5OVjs.defaultPipe; exports.emitter = _chunk27WMBKFHjs.emitter; exports.generateHTTPCode = _chunk27WMBKFHjs.generateHTTPCode; exports.generateRPCCode = _chunk27WMBKFHjs.generateRPCCode; exports.getConfig = _chunkGWLM5DEJjs.getConfig; exports.guardRecord = _chunkKOWUK5OVjs.guardRecord; exports.isAopDepInject = _chunkKOWUK5OVjs.isAopDepInject; exports.log = _chunkGWLM5DEJjs.log; exports.resolveDep = _chunkSSZS3GSQjs.resolveDep; exports.setConfig = _chunkGWLM5DEJjs.setConfig;
|