phecda-server 5.0.0-alpha.11 → 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-ANH53I6B.js → chunk-27WMBKFH.js} +23 -23
- package/dist/{chunk-KGMDCF26.mjs → chunk-DJO45NRZ.mjs} +6 -2
- package/dist/{chunk-C36XJ7D3.js → chunk-GWLM5DEJ.js} +7 -3
- package/dist/{chunk-MZBE4NIO.mjs → chunk-HQ5RLYMA.mjs} +1 -1
- package/dist/{chunk-P5LJBZPN.js → chunk-KOWUK5OV.js} +65 -61
- package/dist/{chunk-JJG37LHY.mjs → chunk-L5SFPHG6.mjs} +25 -21
- package/dist/{chunk-2AI7ID6X.js → chunk-SSZS3GSQ.js} +2 -2
- package/dist/{chunk-KKTRNKCF.mjs → chunk-UXPHQ7OT.mjs} +1 -1
- package/dist/{core-39d78b79.d.ts → core-295348b7.d.ts} +2 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +64 -62
- package/dist/index.mjs +18 -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
|
|
|
@@ -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;
|
|
@@ -121,4 +122,4 @@ declare function Factory(Modules: (new (...args: any) => any)[], opts?: {
|
|
|
121
122
|
destroy: () => Promise<void>;
|
|
122
123
|
}>;
|
|
123
124
|
|
|
124
|
-
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,5 @@
|
|
|
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
3
|
import { Construct } from 'phecda-core';
|
|
4
4
|
export * from 'phecda-core';
|
|
5
5
|
|
|
@@ -75,7 +75,7 @@ declare class Context<Data extends P.BaseContext> {
|
|
|
75
75
|
static pipeRecord: Record<string, P.Pipe>;
|
|
76
76
|
static guardRecord: Record<string, P.Guard>;
|
|
77
77
|
static interceptorRecord: Record<string, P.Interceptor>;
|
|
78
|
-
static
|
|
78
|
+
static addonRecord: Record<string, any>;
|
|
79
79
|
postInterceptors: Function[];
|
|
80
80
|
constructor(data: Data);
|
|
81
81
|
usePipe(args: {
|
|
@@ -93,8 +93,8 @@ declare class Context<Data extends P.BaseContext> {
|
|
|
93
93
|
useInterceptor(interceptors: string[]): Promise<any>;
|
|
94
94
|
static usePlugin(plugins: string[]): any[];
|
|
95
95
|
}
|
|
96
|
-
declare function
|
|
97
|
-
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;
|
|
98
98
|
declare function addFilter<C extends P.BaseContext>(key: string, handler: P.Filter<C>): void;
|
|
99
99
|
declare function addGuard<C extends P.BaseContext>(key: string, handler: P.Guard<C>): void;
|
|
100
100
|
declare function addInterceptor<C extends P.BaseContext>(key: string, handler: P.Interceptor<C>): void;
|
|
@@ -113,11 +113,11 @@ declare function Param(key: string): any;
|
|
|
113
113
|
declare function Arg(): any;
|
|
114
114
|
|
|
115
115
|
declare function Route(route: string, type?: string): any;
|
|
116
|
-
declare function Get(route
|
|
117
|
-
declare function Post(route
|
|
118
|
-
declare function Put(route
|
|
119
|
-
declare function Patch(route
|
|
120
|
-
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;
|
|
121
121
|
declare function Controller(route?: string): any;
|
|
122
122
|
declare function Rpc(...types: ('rabbitmq' | 'redis' | 'kafka' | string)[]): (target: any, key?: PropertyKey) => void;
|
|
123
123
|
declare function Event(isEvent?: boolean): (target: any, key?: PropertyKey) => void;
|
|
@@ -188,7 +188,7 @@ interface PExtension<C extends P.BaseContext = any, E extends Exception = Except
|
|
|
188
188
|
reflect: any;
|
|
189
189
|
}, ctx: C): any;
|
|
190
190
|
filter(error: Error | E, ctx?: C): P.Error;
|
|
191
|
-
|
|
191
|
+
addon(...args: any): void;
|
|
192
192
|
}
|
|
193
193
|
declare class PExtension extends Dev {
|
|
194
194
|
readonly key: string;
|
|
@@ -204,4 +204,4 @@ declare function getConfig<C = any>(key: string, defaultConf?: C): C;
|
|
|
204
204
|
declare function setConfig<C = any>(key: string, conf: C, force?: boolean): void;
|
|
205
205
|
declare function Mix<C1 extends Construct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
|
|
206
206
|
|
|
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, 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 _chunk2AI7ID6Xjs = require('./chunk-2AI7ID6X.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkKOWUK5OVjs = require('./chunk-KOWUK5OV.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -51,7 +51,8 @@ var _chunkP5LJBZPNjs = require('./chunk-P5LJBZPN.js');
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
var _chunkGWLM5DEJjs = require('./chunk-GWLM5DEJ.js');
|
|
55
56
|
|
|
56
57
|
// src/decorators/index.ts
|
|
57
58
|
var _phecdacore = require('phecda-core'); _createStarExport(_phecdacore);
|
|
@@ -79,7 +80,7 @@ function BaseParam(type, key) {
|
|
|
79
80
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
_chunkGWLM5DEJjs.__name.call(void 0, BaseParam, "BaseParam");
|
|
83
84
|
function Pipe(key, opts) {
|
|
84
85
|
return (target, k, index) => {
|
|
85
86
|
_phecdacore.setVar.call(void 0, target, k);
|
|
@@ -101,27 +102,27 @@ function Pipe(key, opts) {
|
|
|
101
102
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Pipe, "Pipe");
|
|
105
106
|
function Body(key = "") {
|
|
106
107
|
return BaseParam("body", key);
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Body, "Body");
|
|
109
110
|
function Head(key) {
|
|
110
111
|
return BaseParam("headers", key.toLowerCase());
|
|
111
112
|
}
|
|
112
|
-
|
|
113
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Head, "Head");
|
|
113
114
|
function Query(key = "") {
|
|
114
115
|
return BaseParam("query", key);
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Query, "Query");
|
|
117
118
|
function Param(key) {
|
|
118
119
|
return BaseParam("params", key);
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Param, "Param");
|
|
121
122
|
function Arg() {
|
|
122
123
|
return BaseParam("params", "");
|
|
123
124
|
}
|
|
124
|
-
|
|
125
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Arg, "Arg");
|
|
125
126
|
|
|
126
127
|
// src/decorators/route.ts
|
|
127
128
|
|
|
@@ -139,31 +140,31 @@ function Route(route, type) {
|
|
|
139
140
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
-
function Get(route) {
|
|
143
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Route, "Route");
|
|
144
|
+
function Get(route = "") {
|
|
144
145
|
return Route(route, "get");
|
|
145
146
|
}
|
|
146
|
-
|
|
147
|
-
function Post(route) {
|
|
147
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Get, "Get");
|
|
148
|
+
function Post(route = "") {
|
|
148
149
|
return Route(route, "post");
|
|
149
150
|
}
|
|
150
|
-
|
|
151
|
-
function Put(route) {
|
|
151
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Post, "Post");
|
|
152
|
+
function Put(route = "") {
|
|
152
153
|
return Route(route, "put");
|
|
153
154
|
}
|
|
154
|
-
|
|
155
|
-
function Patch(route) {
|
|
155
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Put, "Put");
|
|
156
|
+
function Patch(route = "") {
|
|
156
157
|
return Route(route, "patch");
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
-
function Delete(route) {
|
|
159
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Patch, "Patch");
|
|
160
|
+
function Delete(route = "") {
|
|
160
161
|
return Route(route, "delete");
|
|
161
162
|
}
|
|
162
|
-
|
|
163
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Delete, "Delete");
|
|
163
164
|
function Controller(route = "") {
|
|
164
165
|
return Route(route);
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Controller, "Controller");
|
|
167
168
|
function Rpc(...types) {
|
|
168
169
|
return (target, key) => {
|
|
169
170
|
if (!key)
|
|
@@ -177,7 +178,7 @@ function Rpc(...types) {
|
|
|
177
178
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
|
-
|
|
181
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Rpc, "Rpc");
|
|
181
182
|
function Event(isEvent = true) {
|
|
182
183
|
return (target, key) => {
|
|
183
184
|
if (!key)
|
|
@@ -191,7 +192,7 @@ function Event(isEvent = true) {
|
|
|
191
192
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
192
193
|
};
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Event, "Event");
|
|
195
196
|
|
|
196
197
|
// src/decorators/aop.ts
|
|
197
198
|
|
|
@@ -208,7 +209,7 @@ function Guard(...guards) {
|
|
|
208
209
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
209
210
|
};
|
|
210
211
|
}
|
|
211
|
-
|
|
212
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Guard, "Guard");
|
|
212
213
|
function Plugin(...plugins) {
|
|
213
214
|
return (target, key) => {
|
|
214
215
|
if (!key)
|
|
@@ -222,7 +223,7 @@ function Plugin(...plugins) {
|
|
|
222
223
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
223
224
|
};
|
|
224
225
|
}
|
|
225
|
-
|
|
226
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Plugin, "Plugin");
|
|
226
227
|
function Interceptor(...interceptors) {
|
|
227
228
|
return (target, key) => {
|
|
228
229
|
if (!key)
|
|
@@ -236,7 +237,7 @@ function Interceptor(...interceptors) {
|
|
|
236
237
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
237
238
|
};
|
|
238
239
|
}
|
|
239
|
-
|
|
240
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Interceptor, "Interceptor");
|
|
240
241
|
function Filter(filter) {
|
|
241
242
|
return (target, key) => {
|
|
242
243
|
if (!key)
|
|
@@ -248,7 +249,7 @@ function Filter(filter) {
|
|
|
248
249
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
249
250
|
};
|
|
250
251
|
}
|
|
251
|
-
|
|
252
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Filter, "Filter");
|
|
252
253
|
|
|
253
254
|
// src/decorators/index.ts
|
|
254
255
|
function Header(name, value) {
|
|
@@ -261,7 +262,7 @@ function Header(name, value) {
|
|
|
261
262
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
262
263
|
};
|
|
263
264
|
}
|
|
264
|
-
|
|
265
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Header, "Header");
|
|
265
266
|
function Define(key, value) {
|
|
266
267
|
return (target, k) => {
|
|
267
268
|
if (!k) {
|
|
@@ -276,7 +277,7 @@ function Define(key, value) {
|
|
|
276
277
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
277
278
|
};
|
|
278
279
|
}
|
|
279
|
-
|
|
280
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Define, "Define");
|
|
280
281
|
|
|
281
282
|
// src/index.ts
|
|
282
283
|
|
|
@@ -293,10 +294,10 @@ var __decorate = function(decorators, target, key, desc) {
|
|
|
293
294
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
294
295
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
295
296
|
};
|
|
296
|
-
var Dev = /* @__PURE__ */
|
|
297
|
-
__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] = []}
|
|
298
299
|
onUnmount(cb) {
|
|
299
|
-
this[
|
|
300
|
+
this[_chunkGWLM5DEJjs.UNMOUNT_SYMBOL].push(cb);
|
|
300
301
|
}
|
|
301
302
|
}, _class), "Dev");
|
|
302
303
|
Dev = exports.Dev = __decorate([
|
|
@@ -310,13 +311,13 @@ var PFilter = class extends Dev {
|
|
|
310
311
|
constructor(tag) {
|
|
311
312
|
super();
|
|
312
313
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
313
|
-
|
|
314
|
+
_chunkKOWUK5OVjs.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
314
315
|
this.onUnmount(() => {
|
|
315
|
-
delete
|
|
316
|
+
delete _chunkKOWUK5OVjs.Context.filterRecord[this.key];
|
|
316
317
|
});
|
|
317
318
|
}
|
|
318
319
|
};
|
|
319
|
-
|
|
320
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PFilter, "PFilter");
|
|
320
321
|
|
|
321
322
|
// src/modules/guard.ts
|
|
322
323
|
|
|
@@ -325,13 +326,13 @@ var PGuard = class extends Dev {
|
|
|
325
326
|
constructor(tag) {
|
|
326
327
|
super();
|
|
327
328
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
328
|
-
|
|
329
|
+
_chunkKOWUK5OVjs.addGuard.call(void 0, this.key, this.use.bind(this));
|
|
329
330
|
this.onUnmount(() => {
|
|
330
|
-
delete
|
|
331
|
+
delete _chunkKOWUK5OVjs.Context.guardRecord[this.key];
|
|
331
332
|
});
|
|
332
333
|
}
|
|
333
334
|
};
|
|
334
|
-
|
|
335
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PGuard, "PGuard");
|
|
335
336
|
|
|
336
337
|
// src/modules/interceptor.ts
|
|
337
338
|
|
|
@@ -341,12 +342,12 @@ var PInterceptor = class extends Dev {
|
|
|
341
342
|
super();
|
|
342
343
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
343
344
|
this.onUnmount(() => {
|
|
344
|
-
delete
|
|
345
|
+
delete _chunkKOWUK5OVjs.Context.interceptorRecord[this.key];
|
|
345
346
|
});
|
|
346
|
-
|
|
347
|
+
_chunkKOWUK5OVjs.addInterceptor.call(void 0, this.key, this.use.bind(this));
|
|
347
348
|
}
|
|
348
349
|
};
|
|
349
|
-
|
|
350
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PInterceptor, "PInterceptor");
|
|
350
351
|
|
|
351
352
|
// src/modules/pipe.ts
|
|
352
353
|
|
|
@@ -355,13 +356,13 @@ var PPipe = class extends Dev {
|
|
|
355
356
|
constructor(tag) {
|
|
356
357
|
super();
|
|
357
358
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
358
|
-
|
|
359
|
+
_chunkKOWUK5OVjs.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
359
360
|
this.onUnmount(() => {
|
|
360
|
-
delete
|
|
361
|
+
delete _chunkKOWUK5OVjs.Context.pipeRecord[this.key];
|
|
361
362
|
});
|
|
362
363
|
}
|
|
363
364
|
};
|
|
364
|
-
|
|
365
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PPipe, "PPipe");
|
|
365
366
|
|
|
366
367
|
// src/modules/addon.ts
|
|
367
368
|
|
|
@@ -370,13 +371,13 @@ var PAddon = class extends Dev {
|
|
|
370
371
|
constructor(tag) {
|
|
371
372
|
super();
|
|
372
373
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
373
|
-
|
|
374
|
+
_chunkKOWUK5OVjs.addAddon.call(void 0, this.key, this.use.bind(this));
|
|
374
375
|
this.onUnmount(() => {
|
|
375
|
-
delete
|
|
376
|
+
delete _chunkKOWUK5OVjs.Context.addonRecord[this.key];
|
|
376
377
|
});
|
|
377
378
|
}
|
|
378
379
|
};
|
|
379
|
-
|
|
380
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PAddon, "PAddon");
|
|
380
381
|
|
|
381
382
|
// src/modules/extension.ts
|
|
382
383
|
|
|
@@ -386,38 +387,39 @@ var PExtension = class extends Dev {
|
|
|
386
387
|
super();
|
|
387
388
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
388
389
|
if (this.pipe) {
|
|
389
|
-
|
|
390
|
+
_chunkKOWUK5OVjs.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
390
391
|
this.onUnmount(() => {
|
|
391
|
-
delete
|
|
392
|
+
delete _chunkKOWUK5OVjs.Context.pipeRecord[key];
|
|
392
393
|
});
|
|
393
394
|
}
|
|
394
|
-
if (this.
|
|
395
|
-
|
|
395
|
+
if (this.addon) {
|
|
396
|
+
_chunkKOWUK5OVjs.addAddon.call(void 0, key, this.addon.bind(this));
|
|
396
397
|
this.onUnmount(() => {
|
|
397
|
-
delete
|
|
398
|
+
delete _chunkKOWUK5OVjs.Context.addonRecord[key];
|
|
398
399
|
});
|
|
399
400
|
}
|
|
400
401
|
if (this.intercept) {
|
|
401
|
-
|
|
402
|
+
_chunkKOWUK5OVjs.addInterceptor.call(void 0, key, this.intercept.bind(this));
|
|
402
403
|
this.onUnmount(() => {
|
|
403
|
-
delete
|
|
404
|
+
delete _chunkKOWUK5OVjs.Context.interceptorRecord[key];
|
|
404
405
|
});
|
|
405
406
|
}
|
|
406
407
|
if (this.guard) {
|
|
407
|
-
|
|
408
|
+
_chunkKOWUK5OVjs.addGuard.call(void 0, key, this.guard.bind(this));
|
|
408
409
|
this.onUnmount(() => {
|
|
409
|
-
delete
|
|
410
|
+
delete _chunkKOWUK5OVjs.Context.guardRecord[key];
|
|
410
411
|
});
|
|
411
412
|
}
|
|
412
413
|
if (this.filter) {
|
|
413
|
-
|
|
414
|
+
_chunkKOWUK5OVjs.addFilter.call(void 0, key, this.filter.bind(this));
|
|
414
415
|
this.onUnmount(() => {
|
|
415
|
-
delete
|
|
416
|
+
delete _chunkKOWUK5OVjs.Context.filterRecord[key];
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
419
|
}
|
|
419
420
|
};
|
|
420
|
-
|
|
421
|
+
_chunkGWLM5DEJjs.__name.call(void 0, PExtension, "PExtension");
|
|
422
|
+
|
|
421
423
|
|
|
422
424
|
|
|
423
425
|
|
|
@@ -493,4 +495,4 @@ _chunkC36XJ7D3js.__name.call(void 0, PExtension, "PExtension");
|
|
|
493
495
|
|
|
494
496
|
|
|
495
497
|
|
|
496
|
-
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;
|