@pangza/core 0.0.0-stage → 1.0.1
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/README.md +2 -2
- package/dist/Application/callbackArgs.d.ts +12 -0
- package/dist/Application/callbackArgs.d.ts.map +1 -0
- package/dist/Application/callbackArgs.js +106 -0
- package/dist/Application/callbackArgs.js.map +1 -0
- package/dist/Application/decorators.d.ts +82 -0
- package/dist/Application/decorators.d.ts.map +1 -0
- package/dist/Application/decorators.js +235 -0
- package/dist/Application/decorators.js.map +1 -0
- package/dist/Application/index.d.ts +155 -0
- package/dist/Application/index.d.ts.map +1 -0
- package/dist/Application/index.js +719 -0
- package/dist/Application/index.js.map +1 -0
- package/dist/Application/interceptors.d.ts +50 -0
- package/dist/Application/interceptors.d.ts.map +1 -0
- package/dist/Application/interceptors.js +58 -0
- package/dist/Application/interceptors.js.map +1 -0
- package/dist/Application/lifecycle.d.ts +17 -0
- package/dist/Application/lifecycle.d.ts.map +1 -0
- package/dist/Application/lifecycle.js +107 -0
- package/dist/Application/lifecycle.js.map +1 -0
- package/dist/Application/metadata.d.ts +46 -0
- package/dist/Application/metadata.d.ts.map +1 -0
- package/dist/Application/metadata.js +242 -0
- package/dist/Application/metadata.js.map +1 -0
- package/dist/Application/processGuards.d.ts +7 -0
- package/dist/Application/processGuards.d.ts.map +1 -0
- package/dist/Application/processGuards.js +23 -0
- package/dist/Application/processGuards.js.map +1 -0
- package/dist/Application/types.d.ts +103 -0
- package/dist/Application/types.d.ts.map +1 -0
- package/dist/Application/types.js +14 -0
- package/dist/Application/types.js.map +1 -0
- package/dist/Application/warmup.d.ts +6 -0
- package/dist/Application/warmup.d.ts.map +1 -0
- package/dist/Application/warmup.js +48 -0
- package/dist/Application/warmup.js.map +1 -0
- package/dist/Exception/decorators.d.ts +19 -0
- package/dist/Exception/decorators.d.ts.map +1 -0
- package/dist/Exception/decorators.js +55 -0
- package/dist/Exception/decorators.js.map +1 -0
- package/dist/Exception/handler.d.ts +7 -0
- package/dist/Exception/handler.d.ts.map +1 -0
- package/dist/Exception/handler.js +120 -0
- package/dist/Exception/handler.js.map +1 -0
- package/dist/Exception/index.d.ts +20 -0
- package/dist/Exception/index.d.ts.map +1 -0
- package/dist/Exception/index.js +45 -0
- package/dist/Exception/index.js.map +1 -0
- package/dist/Exception/registry.d.ts +13 -0
- package/dist/Exception/registry.d.ts.map +1 -0
- package/dist/Exception/registry.js +70 -0
- package/dist/Exception/registry.js.map +1 -0
- package/dist/Exception/types.d.ts +37 -0
- package/dist/Exception/types.d.ts.map +1 -0
- package/dist/Exception/types.js +16 -0
- package/dist/Exception/types.js.map +1 -0
- package/dist/Json/ObjectMapper.d.ts +25 -0
- package/dist/Json/ObjectMapper.d.ts.map +1 -0
- package/dist/Json/ObjectMapper.js +198 -0
- package/dist/Json/ObjectMapper.js.map +1 -0
- package/dist/Json/beanKeys.d.ts +3 -0
- package/dist/Json/beanKeys.d.ts.map +1 -0
- package/dist/Json/beanKeys.js +34 -0
- package/dist/Json/beanKeys.js.map +1 -0
- package/dist/Json/convert.d.ts +39 -0
- package/dist/Json/convert.d.ts.map +1 -0
- package/dist/Json/convert.js +104 -0
- package/dist/Json/convert.js.map +1 -0
- package/dist/Json/decorators.d.ts +37 -0
- package/dist/Json/decorators.d.ts.map +1 -0
- package/dist/Json/decorators.js +106 -0
- package/dist/Json/decorators.js.map +1 -0
- package/dist/Json/index.d.ts +17 -0
- package/dist/Json/index.d.ts.map +1 -0
- package/dist/Json/index.js +43 -0
- package/dist/Json/index.js.map +1 -0
- package/dist/Json/types.d.ts +48 -0
- package/dist/Json/types.d.ts.map +1 -0
- package/dist/Json/types.js +18 -0
- package/dist/Json/types.js.map +1 -0
- package/dist/Logger/index.d.ts +41 -0
- package/dist/Logger/index.d.ts.map +1 -0
- package/dist/Logger/index.js +179 -0
- package/dist/Logger/index.js.map +1 -0
- package/dist/Logger/types.d.ts +23 -0
- package/dist/Logger/types.d.ts.map +1 -0
- package/dist/Logger/types.js +3 -0
- package/dist/Logger/types.js.map +1 -0
- package/dist/Service/BaseService.d.ts +22 -0
- package/dist/Service/BaseService.d.ts.map +1 -0
- package/dist/Service/BaseService.js +50 -0
- package/dist/Service/BaseService.js.map +1 -0
- package/dist/Service/MapperType.d.ts +22 -0
- package/dist/Service/MapperType.d.ts.map +1 -0
- package/dist/Service/MapperType.js +50 -0
- package/dist/Service/MapperType.js.map +1 -0
- package/dist/Service/bean.d.ts +50 -0
- package/dist/Service/bean.d.ts.map +1 -0
- package/dist/Service/bean.js +99 -0
- package/dist/Service/bean.js.map +1 -0
- package/dist/Service/container.d.ts +52 -0
- package/dist/Service/container.d.ts.map +1 -0
- package/dist/Service/container.js +109 -0
- package/dist/Service/container.js.map +1 -0
- package/dist/Service/decorators.d.ts +65 -0
- package/dist/Service/decorators.d.ts.map +1 -0
- package/dist/Service/decorators.js +226 -0
- package/dist/Service/decorators.js.map +1 -0
- package/dist/Service/index.d.ts +10 -0
- package/dist/Service/index.d.ts.map +1 -0
- package/dist/Service/index.js +22 -0
- package/dist/Service/index.js.map +1 -0
- package/dist/Service/types.d.ts +24 -0
- package/dist/Service/types.d.ts.map +1 -0
- package/dist/Service/types.js +19 -0
- package/dist/Service/types.js.map +1 -0
- package/dist/Validate/decorators.d.ts +36 -0
- package/dist/Validate/decorators.d.ts.map +1 -0
- package/dist/Validate/decorators.js +95 -0
- package/dist/Validate/decorators.js.map +1 -0
- package/dist/Validate/engine.d.ts +20 -0
- package/dist/Validate/engine.d.ts.map +1 -0
- package/dist/Validate/engine.js +94 -0
- package/dist/Validate/engine.js.map +1 -0
- package/dist/Validate/index.d.ts +6 -0
- package/dist/Validate/index.d.ts.map +1 -0
- package/dist/Validate/index.js +28 -0
- package/dist/Validate/index.js.map +1 -0
- package/dist/Validate/rules.d.ts +20 -0
- package/dist/Validate/rules.d.ts.map +1 -0
- package/dist/Validate/rules.js +129 -0
- package/dist/Validate/rules.js.map +1 -0
- package/dist/Validate/types.d.ts +28 -0
- package/dist/Validate/types.d.ts.map +1 -0
- package/dist/Validate/types.js +18 -0
- package/dist/Validate/types.js.map +1 -0
- package/dist/config/ConditionOnProperty.d.ts +36 -0
- package/dist/config/ConditionOnProperty.d.ts.map +1 -0
- package/dist/config/ConditionOnProperty.js +96 -0
- package/dist/config/ConditionOnProperty.js.map +1 -0
- package/dist/config/index.d.ts +137 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +368 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/moduleFlags.d.ts +13 -0
- package/dist/moduleFlags.d.ts.map +1 -0
- package/dist/moduleFlags.js +30 -0
- package/dist/moduleFlags.js.map +1 -0
- package/dist/optional.d.ts +6 -0
- package/dist/optional.d.ts.map +1 -0
- package/dist/optional.js +23 -0
- package/dist/optional.js.map +1 -0
- package/dist/types/enums.d.ts +11 -0
- package/dist/types/enums.d.ts.map +1 -0
- package/dist/types/enums.js +15 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/case.d.ts +10 -0
- package/dist/utils/case.d.ts.map +1 -0
- package/dist/utils/case.js +36 -0
- package/dist/utils/case.js.map +1 -0
- package/dist/utils/entity/PageResult/index.d.ts +23 -0
- package/dist/utils/entity/PageResult/index.d.ts.map +1 -0
- package/dist/utils/entity/PageResult/index.js +16 -0
- package/dist/utils/entity/PageResult/index.js.map +1 -0
- package/dist/utils/entity/ResponseData/index.d.ts +11 -0
- package/dist/utils/entity/ResponseData/index.d.ts.map +1 -0
- package/dist/utils/entity/ResponseData/index.js +25 -0
- package/dist/utils/entity/ResponseData/index.js.map +1 -0
- package/dist/utils/id.d.ts +6 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +19 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +53 -4
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pangza/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Application / IoC / Logger / config / Json / Validate / Exception
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Request, Response } from "express";
|
|
2
|
+
import type { RouteOption } from "./types";
|
|
3
|
+
/** 普通接口:按 @Request* 注入;未标注形参默认 req */
|
|
4
|
+
export declare function resolveCallbackArgs(req: Request, option?: RouteOption, arity?: number): unknown[];
|
|
5
|
+
/**
|
|
6
|
+
* flux / raw:支持 @RequestBody 等注入,同时保证能拿到 res。
|
|
7
|
+
* - 无参数装饰器:固定 (req, res)
|
|
8
|
+
* - 有装饰器:已标注的按来源注入;未标注的按顺序补 req / res
|
|
9
|
+
* (1 个未标注 → res;多个 → 第一个 req,其余 res)
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveRawCallbackArgs(req: Request, res: Response, option?: RouteOption, arity?: number): unknown[];
|
|
12
|
+
//# sourceMappingURL=callbackArgs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbackArgs.d.ts","sourceRoot":"","sources":["../../src/Application/callbackArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,sCAAsC;AACtC,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,SAAI,GACR,OAAO,EAAE,CAcX;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,SAAI,GACR,OAAO,EAAE,CA4BX"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveCallbackArgs = resolveCallbackArgs;
|
|
4
|
+
exports.resolveRawCallbackArgs = resolveRawCallbackArgs;
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
/** 普通接口:按 @Request* 注入;未标注形参默认 req */
|
|
7
|
+
function resolveCallbackArgs(req, option, arity = 1) {
|
|
8
|
+
const metas = option?.params;
|
|
9
|
+
if (metas && metas.length > 0) {
|
|
10
|
+
const maxIndex = Math.max(arity - 1, ...metas.map((m) => m.index));
|
|
11
|
+
const args = new Array(maxIndex + 1);
|
|
12
|
+
for (let i = 0; i <= maxIndex; i++) {
|
|
13
|
+
args[i] = req;
|
|
14
|
+
}
|
|
15
|
+
for (const meta of metas) {
|
|
16
|
+
args[meta.index] = resolveParamInject(req, meta);
|
|
17
|
+
}
|
|
18
|
+
return args;
|
|
19
|
+
}
|
|
20
|
+
return [resolveCallbackArg(req, option)];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* flux / raw:支持 @RequestBody 等注入,同时保证能拿到 res。
|
|
24
|
+
* - 无参数装饰器:固定 (req, res)
|
|
25
|
+
* - 有装饰器:已标注的按来源注入;未标注的按顺序补 req / res
|
|
26
|
+
* (1 个未标注 → res;多个 → 第一个 req,其余 res)
|
|
27
|
+
*/
|
|
28
|
+
function resolveRawCallbackArgs(req, res, option, arity = 2) {
|
|
29
|
+
const metas = option?.params;
|
|
30
|
+
if (!metas || metas.length === 0) {
|
|
31
|
+
return [req, res];
|
|
32
|
+
}
|
|
33
|
+
const maxIndex = Math.max(arity - 1, ...metas.map((m) => m.index));
|
|
34
|
+
const args = new Array(maxIndex + 1);
|
|
35
|
+
const decorated = new Set(metas.map((m) => m.index));
|
|
36
|
+
for (const meta of metas) {
|
|
37
|
+
args[meta.index] = resolveParamInject(req, meta);
|
|
38
|
+
}
|
|
39
|
+
const undecorated = [];
|
|
40
|
+
for (let i = 0; i <= maxIndex; i++) {
|
|
41
|
+
if (!decorated.has(i))
|
|
42
|
+
undecorated.push(i);
|
|
43
|
+
}
|
|
44
|
+
if (undecorated.length === 0) {
|
|
45
|
+
args.push(res);
|
|
46
|
+
}
|
|
47
|
+
else if (undecorated.length === 1) {
|
|
48
|
+
args[undecorated[0]] = res;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
args[undecorated[0]] = req;
|
|
52
|
+
for (let i = 1; i < undecorated.length; i++) {
|
|
53
|
+
args[undecorated[i]] = res;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return args;
|
|
57
|
+
}
|
|
58
|
+
function resolveParamInject(req, meta) {
|
|
59
|
+
switch (meta.source) {
|
|
60
|
+
case "body":
|
|
61
|
+
return req.body ?? {};
|
|
62
|
+
case "query":
|
|
63
|
+
return req.query ?? {};
|
|
64
|
+
case "header":
|
|
65
|
+
return req.headers ?? {};
|
|
66
|
+
case "cookie":
|
|
67
|
+
return req.cookies ?? {};
|
|
68
|
+
case "path": {
|
|
69
|
+
const values = Object.values(req.params ?? {});
|
|
70
|
+
if (meta.pathIndex !== undefined) {
|
|
71
|
+
return values[meta.pathIndex];
|
|
72
|
+
}
|
|
73
|
+
if (values.length <= 1)
|
|
74
|
+
return values[0];
|
|
75
|
+
return values;
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
return req;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** 无参数装饰器时,按 paramType 解析单个入参;未配置则传 req */
|
|
82
|
+
function resolveCallbackArg(req, option) {
|
|
83
|
+
const type = option?.paramType;
|
|
84
|
+
if (!type)
|
|
85
|
+
return req;
|
|
86
|
+
switch (type) {
|
|
87
|
+
case types_1.ParamType.BODY:
|
|
88
|
+
return req.body ?? {};
|
|
89
|
+
case types_1.ParamType.QUERY:
|
|
90
|
+
return req.query ?? {};
|
|
91
|
+
case types_1.ParamType.HEADER:
|
|
92
|
+
return req.headers ?? {};
|
|
93
|
+
case types_1.ParamType.COOKIE:
|
|
94
|
+
return req.cookies ?? {};
|
|
95
|
+
case types_1.ParamType.PATH:
|
|
96
|
+
case types_1.ParamType.PARAMS: {
|
|
97
|
+
const values = Object.values(req.params ?? {});
|
|
98
|
+
if (values.length <= 1)
|
|
99
|
+
return values[0];
|
|
100
|
+
return values;
|
|
101
|
+
}
|
|
102
|
+
default:
|
|
103
|
+
return req;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=callbackArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbackArgs.js","sourceRoot":"","sources":["../../src/Application/callbackArgs.ts"],"names":[],"mappings":";;AAKA,kDAkBC;AAQD,wDAiCC;AA9DD,mCAAoC;AAEpC,sCAAsC;AACtC,SAAgB,mBAAmB,CACjC,GAAY,EACZ,MAAoB,EACpB,KAAK,GAAG,CAAC;IAET,MAAM,KAAK,GAAG,MAAM,EAAE,MAAM,CAAC;IAC7B,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACnE,MAAM,IAAI,GAAc,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QAChD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAChB,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,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AAM,IAAI,CAAC;gBAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;YACzC,OAAO,MAAM,CAAC;QAChB,CAAC;QACD;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC;AAED,2CAA2C;AAC3C,SAAS,kBAAkB,CAAC,GAAY,EAAE,MAAoB;IAC5D,MAAM,IAAI,GAAG,MAAM,EAAE,SAAS,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,CAAC;IAEtB,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,iBAAS,CAAC,IAAI;YACjB,OAAO,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QACxB,KAAK,iBAAS,CAAC,KAAK;YAClB,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QACzB,KAAK,iBAAS,CAAC,MAAM;YACnB,OAAO,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAC3B,KAAK,iBAAS,CAAC,MAAM;YACnB,OAAQ,GAAuC,CAAC,OAAO,IAAI,EAAE,CAAC;QAChE,KAAK,iBAAS,CAAC,IAAI,CAAC;QACpB,KAAK,iBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YACtB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YAC/C,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;gBAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;YACzC,OAAO,MAAM,CAAC;QAChB,CAAC;QACD;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import type { RouteOption } from "./types";
|
|
3
|
+
import type { AuthCheckMode } from "@pangza/auth";
|
|
4
|
+
import type { LogRecordOption } from "@pangza/log";
|
|
5
|
+
/** 标记该类为 Controller(供扫描识别) */
|
|
6
|
+
export declare const CONTROLLER_TYPE: unique symbol;
|
|
7
|
+
/**
|
|
8
|
+
* 类装饰器:标记 Controller,并可设置统一路径前缀。
|
|
9
|
+
* 类被加载时自动注册其中的 HTTP 路由(无需必须放在 business/controller)。
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* @Controller('/api/user')
|
|
13
|
+
* class UserController { ... }
|
|
14
|
+
*/
|
|
15
|
+
export declare function Controller(prefix?: string): ClassDecorator;
|
|
16
|
+
export declare function isControllerClass(ctor: Function): boolean;
|
|
17
|
+
/** 方法装饰器:注册 GET 接口(对齐 Spring @GetMapping) */
|
|
18
|
+
export declare const GetMapping: (path?: string, option?: RouteOption) => MethodDecorator;
|
|
19
|
+
/** 方法装饰器:注册 POST 接口(对齐 Spring @PostMapping) */
|
|
20
|
+
export declare const PostMapping: (path?: string, option?: RouteOption) => MethodDecorator;
|
|
21
|
+
/** 方法装饰器:注册 PUT 接口(对齐 Spring @PutMapping) */
|
|
22
|
+
export declare const PutMapping: (path?: string, option?: RouteOption) => MethodDecorator;
|
|
23
|
+
/** 方法装饰器:注册 DELETE 接口(对齐 Spring @DeleteMapping) */
|
|
24
|
+
export declare const DeleteMapping: (path?: string, option?: RouteOption) => MethodDecorator;
|
|
25
|
+
export declare function AuthCheckLogin(): MethodDecorator;
|
|
26
|
+
export declare function AuthCheckRole(roles: string[], option?: {
|
|
27
|
+
mode?: AuthCheckMode;
|
|
28
|
+
}): MethodDecorator;
|
|
29
|
+
export declare function AuthCheckPermission(permissions: string[], option?: {
|
|
30
|
+
mode?: AuthCheckMode;
|
|
31
|
+
}): MethodDecorator;
|
|
32
|
+
export declare function AuthIgnore(): MethodDecorator;
|
|
33
|
+
/**
|
|
34
|
+
* 操作日志装饰器(需 Application.registry(Log()))。
|
|
35
|
+
* @example @Log({ title: '系统登录', business: BusinessType.LOGIN })
|
|
36
|
+
*/
|
|
37
|
+
export declare function Log(option?: LogRecordOption): MethodDecorator;
|
|
38
|
+
/**
|
|
39
|
+
* 标记接口返回 SSE(Server-Sent Events)。
|
|
40
|
+
* 框架自动写好 event-stream 头;可用 @RequestBody 等注入参数,未标注形参接收 res。
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* @PostMapping('/stream')
|
|
44
|
+
* @Flux()
|
|
45
|
+
* async stream(@RequestBody() body: any, res: Response) {
|
|
46
|
+
* res.write(`data: ${JSON.stringify(body)}\\n\\n`);
|
|
47
|
+
* res.end();
|
|
48
|
+
* }
|
|
49
|
+
*/
|
|
50
|
+
export declare function Flux(): MethodDecorator;
|
|
51
|
+
/** 注入 req.body;无参数装饰器时整段仍传 request */
|
|
52
|
+
export declare function RequestBody(): ParameterDecorator;
|
|
53
|
+
/** 注入 req.query */
|
|
54
|
+
export declare function RequestQuery(): ParameterDecorator;
|
|
55
|
+
/**
|
|
56
|
+
* 注入路径参数。
|
|
57
|
+
* - `@RequestPath()`:一个路径参数时直接传值,多个时传值数组
|
|
58
|
+
* - `@RequestPath(0)`:按顺序取第 n 个路径参数
|
|
59
|
+
*/
|
|
60
|
+
export declare function RequestPath(index?: number): ParameterDecorator;
|
|
61
|
+
/** 注入请求头 req.headers */
|
|
62
|
+
export declare function RequestHeader(): ParameterDecorator;
|
|
63
|
+
/** 注入 req.cookies(需自行挂 cookie 解析中间件) */
|
|
64
|
+
export declare function RequestCookie(): ParameterDecorator;
|
|
65
|
+
/**
|
|
66
|
+
* 属性注入:从合并后的 application*.yaml 按路径取值。
|
|
67
|
+
* 支持 `server.port`、`${server.port}`、`${server.port:3990}`;
|
|
68
|
+
* 第二参数为未配置时的默认值(优先于占位符内默认)。
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* @Value("server.port")
|
|
72
|
+
* private port!: number;
|
|
73
|
+
*
|
|
74
|
+
* @Value("${upload.path:upload}")
|
|
75
|
+
* private uploadPath!: string;
|
|
76
|
+
*
|
|
77
|
+
* @Value("redis.host", "127.0.0.1")
|
|
78
|
+
* private redisHost!: string;
|
|
79
|
+
*/
|
|
80
|
+
export declare function Value(expression: string, defaultValue?: unknown): PropertyDecorator;
|
|
81
|
+
export { getControllerPrefix, getControllerRoutes, joinRoutePath, } from "./metadata";
|
|
82
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/Application/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgBnD,8BAA8B;AAC9B,eAAO,MAAM,eAAe,eAAuC,CAAC;AAEpE;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,SAAK,GAAG,cAAc,CAWtD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAgBD,6CAA6C;AAC7C,eAAO,MAAM,UAAU,2BAdO,WAAW,KAAG,eAcQ,CAAC;AAErD,+CAA+C;AAC/C,eAAO,MAAM,WAAW,2BAjBM,WAAW,KAAG,eAiBU,CAAC;AAEvD,6CAA6C;AAC7C,eAAO,MAAM,UAAU,2BApBO,WAAW,KAAG,eAoBQ,CAAC;AAErD,mDAAmD;AACnD,eAAO,MAAM,aAAa,2BAvBI,WAAW,KAAG,eAuBc,CAAC;AAE3D,wBAAgB,cAAc,IAAI,eAAe,CAIhD;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,GAChC,eAAe,CAOjB;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,GAChC,eAAe,CAOjB;AAED,wBAAgB,UAAU,IAAI,eAAe,CAM5C;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,MAAM,GAAE,eAAoB,GAAG,eAAe,CAIjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,IAAI,eAAe,CAItC;AAED,sCAAsC;AACtC,wBAAgB,WAAW,IAAI,kBAAkB,CAQhD;AAED,mBAAmB;AACnB,wBAAgB,YAAY,IAAI,kBAAkB,CAQjD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAS9D;AAED,wBAAwB;AACxB,wBAAgB,aAAa,IAAI,kBAAkB,CAQlD;AAED,wCAAwC;AACxC,wBAAgB,aAAa,IAAI,kBAAkB,CAQlD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,OAAO,GACrB,iBAAiB,CAuCnB;AAED,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.joinRoutePath = exports.getControllerRoutes = exports.getControllerPrefix = exports.DeleteMapping = exports.PutMapping = exports.PostMapping = exports.GetMapping = exports.CONTROLLER_TYPE = void 0;
|
|
4
|
+
exports.Controller = Controller;
|
|
5
|
+
exports.isControllerClass = isControllerClass;
|
|
6
|
+
exports.AuthCheckLogin = AuthCheckLogin;
|
|
7
|
+
exports.AuthCheckRole = AuthCheckRole;
|
|
8
|
+
exports.AuthCheckPermission = AuthCheckPermission;
|
|
9
|
+
exports.AuthIgnore = AuthIgnore;
|
|
10
|
+
exports.Log = Log;
|
|
11
|
+
exports.Flux = Flux;
|
|
12
|
+
exports.RequestBody = RequestBody;
|
|
13
|
+
exports.RequestQuery = RequestQuery;
|
|
14
|
+
exports.RequestPath = RequestPath;
|
|
15
|
+
exports.RequestHeader = RequestHeader;
|
|
16
|
+
exports.RequestCookie = RequestCookie;
|
|
17
|
+
exports.Value = Value;
|
|
18
|
+
require("reflect-metadata");
|
|
19
|
+
const config_1 = require("../config");
|
|
20
|
+
const metadata_1 = require("./metadata");
|
|
21
|
+
/** 标记该类为 Controller(供扫描识别) */
|
|
22
|
+
exports.CONTROLLER_TYPE = Symbol.for("pangza.controller.type");
|
|
23
|
+
/**
|
|
24
|
+
* 类装饰器:标记 Controller,并可设置统一路径前缀。
|
|
25
|
+
* 类被加载时自动注册其中的 HTTP 路由(无需必须放在 business/controller)。
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* @Controller('/api/user')
|
|
29
|
+
* class UserController { ... }
|
|
30
|
+
*/
|
|
31
|
+
function Controller(prefix = "") {
|
|
32
|
+
return (ctor) => {
|
|
33
|
+
const Ctor = ctor;
|
|
34
|
+
(0, metadata_1.setControllerPrefix)(Ctor, prefix);
|
|
35
|
+
Reflect.defineMetadata(exports.CONTROLLER_TYPE, true, Ctor);
|
|
36
|
+
// 延迟加载,避免 decorators ↔ Application 循环依赖
|
|
37
|
+
const { default: Application } = require("./index");
|
|
38
|
+
Application.registerController(Ctor);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function isControllerClass(ctor) {
|
|
42
|
+
return !!Reflect.getMetadata(exports.CONTROLLER_TYPE, ctor);
|
|
43
|
+
}
|
|
44
|
+
function createHttpDecorator(method) {
|
|
45
|
+
return (path = "", option) => {
|
|
46
|
+
return (target, propertyKey) => {
|
|
47
|
+
const ctor = target.constructor;
|
|
48
|
+
(0, metadata_1.addControllerRoute)(ctor, {
|
|
49
|
+
method,
|
|
50
|
+
path,
|
|
51
|
+
handlerName: String(propertyKey),
|
|
52
|
+
option,
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** 方法装饰器:注册 GET 接口(对齐 Spring @GetMapping) */
|
|
58
|
+
exports.GetMapping = createHttpDecorator("GET");
|
|
59
|
+
/** 方法装饰器:注册 POST 接口(对齐 Spring @PostMapping) */
|
|
60
|
+
exports.PostMapping = createHttpDecorator("POST");
|
|
61
|
+
/** 方法装饰器:注册 PUT 接口(对齐 Spring @PutMapping) */
|
|
62
|
+
exports.PutMapping = createHttpDecorator("PUT");
|
|
63
|
+
/** 方法装饰器:注册 DELETE 接口(对齐 Spring @DeleteMapping) */
|
|
64
|
+
exports.DeleteMapping = createHttpDecorator("DELETE");
|
|
65
|
+
function AuthCheckLogin() {
|
|
66
|
+
return (target, propertyKey) => {
|
|
67
|
+
(0, metadata_1.mergeMethodAuth)(target.constructor, String(propertyKey), {});
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function AuthCheckRole(roles, option) {
|
|
71
|
+
return (target, propertyKey) => {
|
|
72
|
+
(0, metadata_1.mergeMethodAuth)(target.constructor, String(propertyKey), {
|
|
73
|
+
roles,
|
|
74
|
+
roleMode: option?.mode,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function AuthCheckPermission(permissions, option) {
|
|
79
|
+
return (target, propertyKey) => {
|
|
80
|
+
(0, metadata_1.mergeMethodAuth)(target.constructor, String(propertyKey), {
|
|
81
|
+
permissions,
|
|
82
|
+
permissionMode: option?.mode,
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function AuthIgnore() {
|
|
87
|
+
return (target, propertyKey) => {
|
|
88
|
+
(0, metadata_1.mergeMethodAuth)(target.constructor, String(propertyKey), {
|
|
89
|
+
ignore: true,
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 操作日志装饰器(需 Application.registry(Log()))。
|
|
95
|
+
* @example @Log({ title: '系统登录', business: BusinessType.LOGIN })
|
|
96
|
+
*/
|
|
97
|
+
function Log(option = {}) {
|
|
98
|
+
return (target, propertyKey) => {
|
|
99
|
+
(0, metadata_1.mergeMethodLog)(target.constructor, String(propertyKey), option);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 标记接口返回 SSE(Server-Sent Events)。
|
|
104
|
+
* 框架自动写好 event-stream 头;可用 @RequestBody 等注入参数,未标注形参接收 res。
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* @PostMapping('/stream')
|
|
108
|
+
* @Flux()
|
|
109
|
+
* async stream(@RequestBody() body: any, res: Response) {
|
|
110
|
+
* res.write(`data: ${JSON.stringify(body)}\\n\\n`);
|
|
111
|
+
* res.end();
|
|
112
|
+
* }
|
|
113
|
+
*/
|
|
114
|
+
function Flux() {
|
|
115
|
+
return (target, propertyKey) => {
|
|
116
|
+
(0, metadata_1.mergeMethodFlux)(target.constructor, String(propertyKey), true);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** 注入 req.body;无参数装饰器时整段仍传 request */
|
|
120
|
+
function RequestBody() {
|
|
121
|
+
return (target, propertyKey, parameterIndex) => {
|
|
122
|
+
if (propertyKey === undefined)
|
|
123
|
+
return;
|
|
124
|
+
(0, metadata_1.addMethodParam)(target.constructor, String(propertyKey), {
|
|
125
|
+
index: parameterIndex,
|
|
126
|
+
source: "body",
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/** 注入 req.query */
|
|
131
|
+
function RequestQuery() {
|
|
132
|
+
return (target, propertyKey, parameterIndex) => {
|
|
133
|
+
if (propertyKey === undefined)
|
|
134
|
+
return;
|
|
135
|
+
(0, metadata_1.addMethodParam)(target.constructor, String(propertyKey), {
|
|
136
|
+
index: parameterIndex,
|
|
137
|
+
source: "query",
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 注入路径参数。
|
|
143
|
+
* - `@RequestPath()`:一个路径参数时直接传值,多个时传值数组
|
|
144
|
+
* - `@RequestPath(0)`:按顺序取第 n 个路径参数
|
|
145
|
+
*/
|
|
146
|
+
function RequestPath(index) {
|
|
147
|
+
return (target, propertyKey, parameterIndex) => {
|
|
148
|
+
if (propertyKey === undefined)
|
|
149
|
+
return;
|
|
150
|
+
(0, metadata_1.addMethodParam)(target.constructor, String(propertyKey), {
|
|
151
|
+
index: parameterIndex,
|
|
152
|
+
source: "path",
|
|
153
|
+
pathIndex: index,
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** 注入请求头 req.headers */
|
|
158
|
+
function RequestHeader() {
|
|
159
|
+
return (target, propertyKey, parameterIndex) => {
|
|
160
|
+
if (propertyKey === undefined)
|
|
161
|
+
return;
|
|
162
|
+
(0, metadata_1.addMethodParam)(target.constructor, String(propertyKey), {
|
|
163
|
+
index: parameterIndex,
|
|
164
|
+
source: "header",
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/** 注入 req.cookies(需自行挂 cookie 解析中间件) */
|
|
169
|
+
function RequestCookie() {
|
|
170
|
+
return (target, propertyKey, parameterIndex) => {
|
|
171
|
+
if (propertyKey === undefined)
|
|
172
|
+
return;
|
|
173
|
+
(0, metadata_1.addMethodParam)(target.constructor, String(propertyKey), {
|
|
174
|
+
index: parameterIndex,
|
|
175
|
+
source: "cookie",
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 属性注入:从合并后的 application*.yaml 按路径取值。
|
|
181
|
+
* 支持 `server.port`、`${server.port}`、`${server.port:3990}`;
|
|
182
|
+
* 第二参数为未配置时的默认值(优先于占位符内默认)。
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* @Value("server.port")
|
|
186
|
+
* private port!: number;
|
|
187
|
+
*
|
|
188
|
+
* @Value("${upload.path:upload}")
|
|
189
|
+
* private uploadPath!: string;
|
|
190
|
+
*
|
|
191
|
+
* @Value("redis.host", "127.0.0.1")
|
|
192
|
+
* private redisHost!: string;
|
|
193
|
+
*/
|
|
194
|
+
function Value(expression, defaultValue) {
|
|
195
|
+
return (target, propertyKey) => {
|
|
196
|
+
if (!expression?.trim()) {
|
|
197
|
+
throw new Error(`@Value 表达式不能为空,属性: ${String(propertyKey)}`);
|
|
198
|
+
}
|
|
199
|
+
const { path, defaultText } = (0, config_1.parseValueExpression)(expression);
|
|
200
|
+
if (!path) {
|
|
201
|
+
throw new Error(`@Value 路径无效: ${expression}`);
|
|
202
|
+
}
|
|
203
|
+
const fallback = defaultValue !== undefined
|
|
204
|
+
? defaultValue
|
|
205
|
+
: defaultText !== undefined
|
|
206
|
+
? (0, config_1.coerceConfigScalar)(defaultText)
|
|
207
|
+
: undefined;
|
|
208
|
+
const key = String(propertyKey);
|
|
209
|
+
Object.defineProperty(target, key, {
|
|
210
|
+
get() {
|
|
211
|
+
const own = Object.prototype.hasOwnProperty.call(this, key)
|
|
212
|
+
? this[key]
|
|
213
|
+
: undefined;
|
|
214
|
+
if (own !== undefined)
|
|
215
|
+
return own;
|
|
216
|
+
return (0, config_1.getConfigValue)(path, fallback);
|
|
217
|
+
},
|
|
218
|
+
set(value) {
|
|
219
|
+
Object.defineProperty(this, key, {
|
|
220
|
+
value,
|
|
221
|
+
writable: true,
|
|
222
|
+
enumerable: true,
|
|
223
|
+
configurable: true,
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
enumerable: true,
|
|
227
|
+
configurable: true,
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
var metadata_2 = require("./metadata");
|
|
232
|
+
Object.defineProperty(exports, "getControllerPrefix", { enumerable: true, get: function () { return metadata_2.getControllerPrefix; } });
|
|
233
|
+
Object.defineProperty(exports, "getControllerRoutes", { enumerable: true, get: function () { return metadata_2.getControllerRoutes; } });
|
|
234
|
+
Object.defineProperty(exports, "joinRoutePath", { enumerable: true, get: function () { return metadata_2.joinRoutePath; } });
|
|
235
|
+
//# sourceMappingURL=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1
|
+
import express from 'express';
|
|
2
|
+
import type { RouteOption } from './types';
|
|
3
|
+
import { ParamType } from './types';
|
|
4
|
+
import { type RequestInterceptor, type ResponseInterceptor } from './interceptors';
|
|
5
|
+
export declare function applicationStart(): import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse>;
|
|
6
|
+
declare class Application {
|
|
7
|
+
private static routerMounted;
|
|
8
|
+
private static controllersLoaded;
|
|
9
|
+
/** 是否已通过 registry 注册 Auth 中间件 */
|
|
10
|
+
private static authRegistered;
|
|
11
|
+
/** 是否已通过 registry 注册 Log 中间件 */
|
|
12
|
+
private static logRegistered;
|
|
13
|
+
/** 是否已 registry EnableRedis(或 Auth 绑定了 redis) */
|
|
14
|
+
private static redisRegistered;
|
|
15
|
+
/** 是否已 registry EnableOrm */
|
|
16
|
+
private static ormRegistered;
|
|
17
|
+
/** 已注册过的 Controller,防止重复挂路由 */
|
|
18
|
+
private static registeredControllers;
|
|
19
|
+
/** 已 require 过的模块文件 */
|
|
20
|
+
private static loadedFiles;
|
|
21
|
+
/**
|
|
22
|
+
* 自定义扫描根目录(绝对路径)。
|
|
23
|
+
* 未调用 scan() 时默认扫描 src/business。
|
|
24
|
+
*/
|
|
25
|
+
private static scanRoots;
|
|
26
|
+
static getApp(): express.Express;
|
|
27
|
+
/** 是否已注册 Auth 模块 */
|
|
28
|
+
static hasAuth(): boolean;
|
|
29
|
+
/** 是否已注册 Log 模块 */
|
|
30
|
+
static hasLog(): boolean;
|
|
31
|
+
/** 是否已启用 Redis(预热 / 连接校验) */
|
|
32
|
+
static hasRedis(): boolean;
|
|
33
|
+
/** 是否已启用 ORM(预热 / 连接校验) */
|
|
34
|
+
static hasOrm(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 请求前拦截器(鉴权/限流之后、Controller 之前)。
|
|
37
|
+
* @example
|
|
38
|
+
* Application.addRequestInterceptor(async ({ req }) => {
|
|
39
|
+
* console.log(req.method, req.path);
|
|
40
|
+
* });
|
|
41
|
+
*/
|
|
42
|
+
static addRequestInterceptor(fn: RequestInterceptor): typeof Application;
|
|
43
|
+
/**
|
|
44
|
+
* 响应前拦截器(Controller 之后、写出之前)。
|
|
45
|
+
* 设 `ctx.wrap = false` 可跳过 ResponseData;或自行 `res.json` 后设 `ctx.handled = true`。
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* Application.addResponseInterceptor(async (ctx) => {
|
|
49
|
+
* ctx.wrap = false;
|
|
50
|
+
* return { code: 0, result: ctx.data };
|
|
51
|
+
* });
|
|
52
|
+
*/
|
|
53
|
+
static addResponseInterceptor(fn: ResponseInterceptor): typeof Application;
|
|
54
|
+
/** 清空全部请求/响应拦截器 */
|
|
55
|
+
static clearInterceptors(): typeof Application;
|
|
56
|
+
/**
|
|
57
|
+
* 追加模块扫描目录(可多次调用)。
|
|
58
|
+
* 目录内带 @Controller 的类会被自动注册进路由。
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* Application
|
|
62
|
+
* .scan('src/business')
|
|
63
|
+
* .scan('src/modules', 'src/plugins')
|
|
64
|
+
* .registry(...).start();
|
|
65
|
+
*/
|
|
66
|
+
static scan(...dirs: Array<string | string[]>): typeof Application;
|
|
67
|
+
/**
|
|
68
|
+
* 挂载静态资源。
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // URL 与磁盘目录同名(相对 cwd)
|
|
72
|
+
* Application.static("public")
|
|
73
|
+
* Application.static(["public", "assets"])
|
|
74
|
+
*
|
|
75
|
+
* // 指定 URL 前缀 → 磁盘目录
|
|
76
|
+
* Application.static("/files", "upload")
|
|
77
|
+
* Application.static({ "/files": "upload", "/static": "public" })
|
|
78
|
+
*
|
|
79
|
+
* // 也可用 yaml:upload.path + upload.urlPrefix,再
|
|
80
|
+
* // app.use(UPLOAD_URL_PREFIX, express.static(UPLOAD_PATH))
|
|
81
|
+
*/
|
|
82
|
+
static static(urlOrMap: string | string[] | Record<string, string>, rootDir?: string): typeof Application;
|
|
83
|
+
/** 当前扫描根目录(只读) */
|
|
84
|
+
static getScanRoots(): string[];
|
|
85
|
+
/**
|
|
86
|
+
* 启动服务:
|
|
87
|
+
* 自动 loadControllers → routes → listen
|
|
88
|
+
* 使用者通常只需 registry(...).start()
|
|
89
|
+
*/
|
|
90
|
+
static start(): typeof Application;
|
|
91
|
+
static registry(param: any): typeof Application;
|
|
92
|
+
/** 路由统一挂一次,放在所有中间件之后 */
|
|
93
|
+
static routes(): typeof Application;
|
|
94
|
+
/**
|
|
95
|
+
* 注册装饰器 Controller:读取元数据并挂到现有 GET/POST/...
|
|
96
|
+
* 同一类只会注册一次(@Controller 触发 + 扫描 require 安全)。
|
|
97
|
+
*/
|
|
98
|
+
static registerController(Ctor: new () => object): typeof Application;
|
|
99
|
+
/**
|
|
100
|
+
* 扫描并加载模块文件。
|
|
101
|
+
* - 未 scan 时默认:src/business
|
|
102
|
+
* - 可 Application.scan('src/modules') 自定义多个根目录
|
|
103
|
+
* - 优先按 entity → mapper → service → controller → advice 顺序加载,
|
|
104
|
+
* 再递归加载根下其余文件(兼容自定义目录结构)。
|
|
105
|
+
* - 凡被 @Controller 标记的类,加载时自动注入路由。
|
|
106
|
+
*
|
|
107
|
+
* @param dir 仅加载该目录(绝对或相对 cwd)
|
|
108
|
+
*/
|
|
109
|
+
static loadControllers(dir?: string): typeof Application;
|
|
110
|
+
/** 加载单个扫描根:分层目录优先,再兜底全量递归(跳过已加载的 phase 目录) */
|
|
111
|
+
private static loadScanRoot;
|
|
112
|
+
private static loadModuleFiles;
|
|
113
|
+
/**
|
|
114
|
+
* 路由鉴权优先级:
|
|
115
|
+
* 1. 未注册 Auth → 直接放行(最高)
|
|
116
|
+
* 2. Auth 全局 ignore → 放行
|
|
117
|
+
* 3. 接口 option.auth.ignore → 放行
|
|
118
|
+
* 4. 校验登录
|
|
119
|
+
* 5. 角色 / 权限按 mode 校验(默认 OR,可在装饰器或 Auth.checkMode 覆盖)
|
|
120
|
+
* - 只配一类:按该类的 mode
|
|
121
|
+
* - 两类都是 OR:角色或权限命中任一即过
|
|
122
|
+
* - 其它:两类都要通过(各类内部仍按自己的 mode)
|
|
123
|
+
*/
|
|
124
|
+
private static applyRouteAuth;
|
|
125
|
+
/** 空列表视为未配置(ok=true 且 empty)。OR 命中任一;AND 必须全部命中。 */
|
|
126
|
+
private static matchAuthList;
|
|
127
|
+
/**
|
|
128
|
+
* 路由响应发送后异步写操作日志:
|
|
129
|
+
* - 不 await,不阻塞主业务与 HTTP 响应
|
|
130
|
+
* - setImmediate 再丢到下一事件循环,进一步与请求链路解耦
|
|
131
|
+
* - 写入失败只打日志,不影响已返回的业务结果
|
|
132
|
+
*/
|
|
133
|
+
private static scheduleOperationLog;
|
|
134
|
+
/** 限流 + 防重复提交(在鉴权之后、业务之前) */
|
|
135
|
+
private static applyRouteGuards;
|
|
136
|
+
/** SSE 默认头:Content-Type / 禁缓存 / 长连接 / 关 nginx 缓冲 */
|
|
137
|
+
private static prepareFluxResponse;
|
|
138
|
+
private static mountRoute;
|
|
139
|
+
static GET<T>(path: string, callback: (...args: any[]) => T | Promise<T>, option?: RouteOption): typeof Application;
|
|
140
|
+
static POST<T>(path: string, callback: (...args: any[]) => T | Promise<T>, option?: RouteOption): typeof Application;
|
|
141
|
+
static PUT<T>(path: string, callback: (...args: any[]) => T | Promise<T>, option?: RouteOption): typeof Application;
|
|
142
|
+
static DELETE<T>(path: string, callback: (...args: any[]) => T | Promise<T>, option?: RouteOption): typeof Application;
|
|
143
|
+
}
|
|
144
|
+
export { Application };
|
|
145
|
+
export default Application;
|
|
146
|
+
export { ParamType };
|
|
147
|
+
export type { RouteOption, ApplicationInit, ApplicationDestroy } from './types';
|
|
148
|
+
export type { RequestInterceptor, ResponseInterceptor, RequestInterceptorContext, ResponseInterceptorContext, } from './interceptors';
|
|
149
|
+
export { runApplicationInits, runApplicationDestroys, hookProcessDestroy, isApplicationInit, isApplicationDestroy, } from './lifecycle';
|
|
150
|
+
export { Controller, GetMapping, PostMapping, PutMapping, DeleteMapping, AuthCheckLogin, AuthCheckRole, AuthCheckPermission, AuthIgnore, Log, Flux, RequestBody, RequestQuery, RequestPath, RequestHeader, RequestCookie, Value, } from "./decorators";
|
|
151
|
+
export { getLogger, logger, configureLogger } from "../Logger";
|
|
152
|
+
export { JsonFormat, JsonInclude, JsonIncludeType, JsonProperty, ObjectMapper, convert, copyProperties, pick, } from "../Json";
|
|
153
|
+
export { ControllerAdvice, ExceptionHandler, BizException, registerHandler, } from "../Exception";
|
|
154
|
+
export { Validate, NotNull, Min, Max, Email, Phone, Custom, validateHandler, ValidationError, } from "../Validate";
|
|
155
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Application/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAqC,MAAM,SAAS,CAAC;AA0B5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQpC,OAAO,EAMH,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAC3B,MAAM,gBAAgB,CAAC;AA+BxB,wBAAgB,gBAAgB,sHAY/B;AA8CD,cAAM,WAAW;IACb,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;IACzC,iCAAiC;IACjC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAS;IACtC,gCAAgC;IAChC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,iDAAiD;IACjD,OAAO,CAAC,MAAM,CAAC,eAAe,CAAS;IACvC,6BAA6B;IAC7B,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,+BAA+B;IAC/B,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA2B;IAC/D,uBAAuB;IACvB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAq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