@nestia/core 3.10.0 → 3.11.0-dev.20240812
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/lib/decorators/DynamicModule.d.ts +1 -1
- package/lib/decorators/DynamicModule.js +2 -2
- package/lib/decorators/DynamicModule.js.map +1 -1
- package/lib/decorators/EncryptedModule.d.ts +1 -1
- package/lib/decorators/EncryptedModule.js +2 -2
- package/lib/decorators/EncryptedModule.js.map +1 -1
- package/lib/decorators/TypedException.d.ts +46 -0
- package/lib/decorators/TypedException.js +5 -6
- package/lib/decorators/TypedException.js.map +1 -1
- package/lib/decorators/internal/load_controller.js +2 -2
- package/lib/decorators/internal/load_controller.js.map +1 -1
- package/lib/transformers/FileTransformer.js.map +1 -1
- package/lib/transformers/MethodTransformer.js +1 -3
- package/lib/transformers/MethodTransformer.js.map +1 -1
- package/lib/transformers/WebSocketRouteTransformer.js.map +1 -1
- package/lib/utils/SourceFinder.js +1 -0
- package/lib/utils/SourceFinder.js.map +1 -1
- package/package.json +6 -6
- package/src/decorators/DynamicModule.ts +5 -1
- package/src/decorators/EncryptedModule.ts +5 -1
- package/src/decorators/TypedException.ts +62 -24
- package/src/decorators/internal/load_controller.ts +2 -1
- package/src/transformers/FileTransformer.ts +1 -1
- package/src/transformers/MethodTransformer.ts +4 -3
- package/src/transformers/WebSocketRouteTransformer.ts +1 -1
- package/src/utils/SourceFinder.ts +1 -0
- package/lib/programmers/TypedExceptionProgrammer.d.ts +0 -5
- package/lib/programmers/TypedExceptionProgrammer.js +0 -65
- package/lib/programmers/TypedExceptionProgrammer.js.map +0 -1
- package/lib/transformers/TypedExceptionTransformer.d.ts +0 -5
- package/lib/transformers/TypedExceptionTransformer.js +0 -35
- package/lib/transformers/TypedExceptionTransformer.js.map +0 -1
- package/src/programmers/TypedExceptionProgrammer.ts +0 -71
- package/src/transformers/TypedExceptionTransformer.ts +0 -44
|
@@ -22,5 +22,5 @@ export declare namespace DynamicModule {
|
|
|
22
22
|
function mount(path: string | string[] | {
|
|
23
23
|
include: string[];
|
|
24
24
|
exclude?: string[];
|
|
25
|
-
}, metadata?: Omit<ModuleMetadata, "controllers"
|
|
25
|
+
}, metadata?: Omit<ModuleMetadata, "controllers">, isTsNode?: boolean): Promise<object>;
|
|
26
26
|
}
|
|
@@ -40,9 +40,9 @@ var DynamicModule;
|
|
|
40
40
|
* @returns module instance
|
|
41
41
|
*/
|
|
42
42
|
function mount(path_1) {
|
|
43
|
-
return __awaiter(this, arguments, void 0, function* (path, metadata = {}) {
|
|
43
|
+
return __awaiter(this, arguments, void 0, function* (path, metadata = {}, isTsNode) {
|
|
44
44
|
// LOAD CONTROLLERS
|
|
45
|
-
const controllers = yield (0, load_controller_1.load_controllers)(path);
|
|
45
|
+
const controllers = yield (0, load_controller_1.load_controllers)(path, isTsNode);
|
|
46
46
|
// RETURN WITH DECORATING
|
|
47
47
|
let NestiaModule = class NestiaModule {
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicModule.js","sourceRoot":"","sources":["../../src/decorators/DynamicModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AAIxC,gEAA8D;AAE9D;;;;;;;GAOG;AACH,IAAiB,aAAa,
|
|
1
|
+
{"version":3,"file":"DynamicModule.js","sourceRoot":"","sources":["../../src/decorators/DynamicModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AAIxC,gEAA8D;AAE9D;;;;;;;GAOG;AACH,IAAiB,aAAa,CA4B7B;AA5BD,WAAiB,aAAa;IAC5B;;;;;;;;;;OAUG;IACH,SAAsB,KAAK;6DACzB,IAAmE,EACnE,WAAgD,EAAE,EAClD,QAAkB;YAElB,mBAAmB;YACnB,MAAM,WAAW,GAAsB,MAAM,IAAA,kCAAgB,EAC3D,IAAI,EACJ,QAAQ,CACT,CAAC;YAEF,yBAAyB;YAEzB,IAAM,YAAY,GAAlB,MAAM,YAAY;aAAG,CAAA;YAAf,YAAY;gBADjB,IAAA,eAAM,kCAAM,QAAQ,KAAE,WAAW,IAAG;eAC/B,YAAY,CAAG;YACrB,OAAO,YAAY,CAAC;QACtB,CAAC;KAAA;IAfqB,mBAAK,QAe1B,CAAA;AACH,CAAC,EA5BgB,aAAa,6BAAb,aAAa,QA4B7B"}
|
|
@@ -48,5 +48,5 @@ export declare namespace EncryptedModule {
|
|
|
48
48
|
function dynamic(path: string | string[] | {
|
|
49
49
|
include: string[];
|
|
50
50
|
exclude?: string[];
|
|
51
|
-
}, password: IEncryptionPassword | IEncryptionPassword.Closure, options?: Omit<Parameters<typeof Module>[0], "controllers"
|
|
51
|
+
}, password: IEncryptionPassword | IEncryptionPassword.Closure, options?: Omit<Parameters<typeof Module>[0], "controllers">, isTsNode?: boolean): Promise<object>;
|
|
52
52
|
}
|
|
@@ -70,9 +70,9 @@ function EncryptedModule(metadata, password) {
|
|
|
70
70
|
* @returns Class decorated module instance
|
|
71
71
|
*/
|
|
72
72
|
function dynamic(path_1, password_1) {
|
|
73
|
-
return __awaiter(this, arguments, void 0, function* (path, password, options = {}) {
|
|
73
|
+
return __awaiter(this, arguments, void 0, function* (path, password, options = {}, isTsNode) {
|
|
74
74
|
// LOAD CONTROLLERS
|
|
75
|
-
const controllers = yield (0, load_controller_1.load_controllers)(path);
|
|
75
|
+
const controllers = yield (0, load_controller_1.load_controllers)(path, isTsNode);
|
|
76
76
|
// RETURNS WITH DECORATING
|
|
77
77
|
let NestiaModule = class NestiaModule {
|
|
78
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EncryptedModule.js","sourceRoot":"","sources":["../../src/decorators/EncryptedModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqCA,0CAQC;AA5CD,2CAAwC;AAGxC,oEAAuE;AACvE,gEAA8D;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,eAAe,CAC7B,Q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,CAAC;KAAA;IAnBqB,uBAAO,UAmB5B,CAAA;AACH,CAAC,EAlCgB,eAAe,+BAAf,eAAe,QAkC/B;AAED;;GAEG;AACH,MAAM,OAAO,GACX,CAAC,QAAqC,EAAE,EAAE,CAC1C,CAAC,MAAW,EAAQ,EAAE;IACpB,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QACxB,KAAK,MAAM,GAAG,IAAI,OAAO;YACvB,IAAI,OAAO,GAAG,KAAK,UAAU;gBAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;IAE1D,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC5B,KAAK,MAAM,CAAC,IAAI,WAAW;YACzB,IAAI,OAAO,CAAC,KAAK,UAAU;gBACzB,OAAO,CAAC,cAAc,CAAC,2CAAuB,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC"}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* > You must configure the generic argument `T`
|
|
3
|
+
*
|
|
4
|
+
* Exception decorator.
|
|
5
|
+
*
|
|
6
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
7
|
+
* which could be occured in the method.
|
|
8
|
+
*
|
|
9
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
10
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
11
|
+
* the SDK library generation yet, but will be used in the future.
|
|
12
|
+
*
|
|
13
|
+
* @param props Properties for the exception
|
|
14
|
+
* @returns Method decorator
|
|
15
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
16
|
+
*/
|
|
17
|
+
export declare function TypedException(props: TypedException.IProps<unknown>): never;
|
|
1
18
|
/**
|
|
2
19
|
* > You must configure the generic argument `T`
|
|
3
20
|
*
|
|
@@ -14,9 +31,28 @@
|
|
|
14
31
|
* @param description Description about the exception
|
|
15
32
|
* @returns Method decorator
|
|
16
33
|
*
|
|
34
|
+
* @deprecated Use {@link TypedException.IProps} typed function instead.
|
|
35
|
+
* This typed function is deprecated and will be removed in the next major update.
|
|
17
36
|
* @author Jeongho Nam - https://github.com/samchon
|
|
18
37
|
*/
|
|
19
38
|
export declare function TypedException(status: number | "2XX" | "3XX" | "4XX" | "5XX", description?: string | undefined): never;
|
|
39
|
+
/**
|
|
40
|
+
* Exception decorator.
|
|
41
|
+
*
|
|
42
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
43
|
+
* which could be occured in the method.
|
|
44
|
+
*
|
|
45
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
46
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
47
|
+
* the SDK library generation yet, but will be used in the future.
|
|
48
|
+
*
|
|
49
|
+
* @template T Type of the exception
|
|
50
|
+
* @param props Properties for the exception
|
|
51
|
+
* @returns Method decorator
|
|
52
|
+
*
|
|
53
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
54
|
+
*/
|
|
55
|
+
export declare function TypedException<T>(props: TypedException.IProps<T>): MethodDecorator;
|
|
20
56
|
/**
|
|
21
57
|
* Exception decorator.
|
|
22
58
|
*
|
|
@@ -32,6 +68,16 @@ export declare function TypedException(status: number | "2XX" | "3XX" | "4XX" |
|
|
|
32
68
|
* @param description Description about the exception
|
|
33
69
|
* @returns Method decorator
|
|
34
70
|
*
|
|
71
|
+
* @deprecated Use {@link TypedException.IProps} typed function instead.
|
|
72
|
+
* This typed function is deprecated and will be removed in the next major update.
|
|
35
73
|
* @author Jeongho Nam - https://github.com/samchon
|
|
36
74
|
*/
|
|
37
75
|
export declare function TypedException<T>(status: number | "2XX" | "3XX" | "4XX" | "5XX", description?: string | undefined): MethodDecorator;
|
|
76
|
+
export declare namespace TypedException {
|
|
77
|
+
interface IProps<T> {
|
|
78
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
79
|
+
description?: string | undefined;
|
|
80
|
+
example?: T;
|
|
81
|
+
examples?: Record<string, T>;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -4,7 +4,10 @@ exports.TypedException = TypedException;
|
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
function TypedException(
|
|
7
|
+
function TypedException(...args) {
|
|
8
|
+
const props = typeof args[0] === "object"
|
|
9
|
+
? args[0]
|
|
10
|
+
: { status: args[0], description: args[1] };
|
|
8
11
|
return function TypedException(target, propertyKey, descriptor) {
|
|
9
12
|
const array = (() => {
|
|
10
13
|
const oldbie = Reflect.getMetadata("nestia/TypedException", target[propertyKey]);
|
|
@@ -14,11 +17,7 @@ function TypedException(status, description, type) {
|
|
|
14
17
|
Reflect.defineMetadata("nestia/TypedException", newbie, target[propertyKey]);
|
|
15
18
|
return newbie;
|
|
16
19
|
})();
|
|
17
|
-
array.push(
|
|
18
|
-
status,
|
|
19
|
-
description,
|
|
20
|
-
type: type,
|
|
21
|
-
});
|
|
20
|
+
array.push(props);
|
|
22
21
|
return descriptor;
|
|
23
22
|
};
|
|
24
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypedException.js","sourceRoot":"","sources":["../../src/decorators/TypedException.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"TypedException.js","sourceRoot":"","sources":["../../src/decorators/TypedException.ts"],"names":[],"mappings":";;AA0FA,wCA6BC;AAhCD;;GAEG;AACH,SAAgB,cAAc,CAAI,GAAG,IAAW;IAC9C,MAAM,KAAK,GACT,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;QACzB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACT,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,OAAO,SAAS,cAAc,CAC5B,MAAkB,EAClB,WAA4B,EAC5B,UAAwC;QAExC,MAAM,KAAK,GAAiC,CAAC,GAAG,EAAE;YAChD,MAAM,MAAM,GACV,OAAO,CAAC,WAAW,CACjB,uBAAuB,EACtB,MAAc,CAAC,WAAW,CAAC,CAC7B,CAAC;YACJ,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,MAAM,CAAC;YAExC,MAAM,MAAM,GAAiC,EAAE,CAAC;YAChD,OAAO,CAAC,cAAc,CACpB,uBAAuB,EACvB,MAAM,EACL,MAAc,CAAC,WAAW,CAAC,CAC7B,CAAC;YACF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,EAAE,CAAC;QACL,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -41,7 +41,7 @@ const SourceFinder_1 = require("../../utils/SourceFinder");
|
|
|
41
41
|
/**
|
|
42
42
|
* @internal
|
|
43
43
|
*/
|
|
44
|
-
const load_controllers = (path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
const load_controllers = (path, isTsNode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
45
|
var _a;
|
|
46
46
|
const sources = yield SourceFinder_1.SourceFinder.find({
|
|
47
47
|
include: Array.isArray(path)
|
|
@@ -52,7 +52,7 @@ const load_controllers = (path) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
52
52
|
exclude: typeof path === "object" && !Array.isArray(path)
|
|
53
53
|
? (_a = path.exclude) !== null && _a !== void 0 ? _a : []
|
|
54
54
|
: [],
|
|
55
|
-
filter: EXTENSION === "ts"
|
|
55
|
+
filter: isTsNode === true || EXTENSION === "ts"
|
|
56
56
|
? (file) => file.substring(file.length - 3) === ".ts" &&
|
|
57
57
|
file.substring(file.length - 5) !== ".d.ts"
|
|
58
58
|
: (flle) => flle.substring(flle.length - 3) === ".js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load_controller.js","sourceRoot":"","sources":["../../../src/decorators/internal/load_controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAwC;AAGxC,2DAAwD;AAExD;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAC9B,IAAmE,
|
|
1
|
+
{"version":3,"file":"load_controller.js","sourceRoot":"","sources":["../../../src/decorators/internal/load_controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAwC;AAGxC,2DAAwD;AAExD;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAC9B,IAAmE,EACnE,QAAkB,EACU,EAAE;;IAC9B,MAAM,OAAO,GAAa,MAAM,2BAAY,CAAC,IAAI,CAAC;QAChD,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAC1B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ;gBACxB,CAAC,CAAC,IAAI,CAAC,OAAO;gBACd,CAAC,CAAC,CAAC,IAAI,CAAC;QACZ,OAAO,EACL,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAC9C,CAAC,CAAC,MAAA,IAAI,CAAC,OAAO,mCAAI,EAAE;YACpB,CAAC,CAAC,EAAE;QACR,MAAM,EACJ,QAAQ,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI;YACrC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK;gBACzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,OAAO;YAC/C,CAAC,CAAC,CAAC,IAAI,EAAE,EA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ACV,OAAO,IACP,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EACzB,OAAO,CACR,CAAC;IAEV,MAAM,YAAY,GAChB,CAAC,OAAgC,EAAE,EAAE,CACrC,CAAC,OAAiC,EAAE,EAAE,CACtC,CAAC,IAAmB,EAAE,EAAE,CACxB,CAAC,IAAa,EAAW,EAAE;;QACzB,OAAA,oBAAE,CAAC,cAAc,CACf,MAAA,kBAAkB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,mCAAI,IAAI,EAC/C,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EACtD,OAAO,CACR,CAAA;KAAA,CAAC;IAEN,MAAM,kBAAkB,GACtB,CAAC,OAAgC,EAAE,EAAE,CACrC,CAAC,IAAmB,EAAE,EAAE,CACxB,CAAC,IAAa,EAAkB,EAAE;;;QAChC,IAAI,CAAC;YACH,OAAO,iCAAe,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,gCAAgC;YAChC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC;gBAAE,MAAM,GAAG,CAAC;YAExC,+CAA+C;YAC/C,YAAC,IAAY,EAAC,MAAM,uCAAN,MAAM,GAAK,IAAI,EAAC;YAE9B,oBAAoB;YACpB,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"FileTransformer.js","sourceRoot":"","sources":["../../src/transformers/FileTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAI5B,uDAAoD;AAEpD,IAAiB,eAAe,CAoD/B;AApDD,WAAiB,eAAe;IACjB,yBAAS,GACpB,CAAC,OAAiD,EAAE,EAAE,CACtD,CAAC,OAAiC,EAAE,EAAE,CACtC,CAAC,IAAmB,EAAiB,EAAE,CACrC,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rC,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,IAAI,EAAE,IAAI,GAAG,CAAC,IAAI,GAAU;aAC7B,CAAC,CAAC;YACH,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACN,CAAC,EApDgB,eAAe,+BAAf,eAAe,QAoD/B;AAED,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA6B,EAAE,CACnE,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,kBAAkB;IAC7C,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MethodTransformer = void 0;
|
|
7
7
|
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
-
const TypedExceptionTransformer_1 = require("./TypedExceptionTransformer");
|
|
9
8
|
const TypedRouteTransformer_1 = require("./TypedRouteTransformer");
|
|
10
9
|
const WebSocketRouteTransformer_1 = require("./WebSocketRouteTransformer");
|
|
11
10
|
var MethodTransformer;
|
|
@@ -22,10 +21,9 @@ var MethodTransformer;
|
|
|
22
21
|
if (escaped === undefined)
|
|
23
22
|
return method;
|
|
24
23
|
const operator = (decorator) => {
|
|
25
|
-
decorator = TypedExceptionTransformer_1.TypedExceptionTransformer.transform(project)(decorator);
|
|
26
24
|
decorator =
|
|
27
25
|
TypedRouteTransformer_1.TypedRouteTransformer.transform(project)(escaped)(decorator);
|
|
28
|
-
WebSocketRouteTransformer_1.WebSocketRouteTransformer.validate(project)(decorator, method);
|
|
26
|
+
decorator = WebSocketRouteTransformer_1.WebSocketRouteTransformer.validate(project)(decorator, method);
|
|
29
27
|
return decorator;
|
|
30
28
|
};
|
|
31
29
|
if (typescript_1.default.getDecorators !== undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MethodTransformer.js","sourceRoot":"","sources":["../../src/transformers/MethodTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAG5B,
|
|
1
|
+
{"version":3,"file":"MethodTransformer.js","sourceRoot":"","sources":["../../src/transformers/MethodTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAG5B,mEAAgE;AAChE,2EAAwE;AAExE,IAAiB,iBAAiB,CAuDjC;AAvDD,WAAiB,iBAAiB;IACnB,2BAAS,GACpB,CAAC,OAAgC,EAAE,EAAE,CACrC,CAAC,MAA4B,EAAwB,EAAE;QACrD,MAAM,UAAU,GAAwC,oBAAE,CAAC,aAAa;YACtE,CAAC,CAAC,oBAAE,CAAC,aAAa,CAAC,MAAM,CAAC;YAC1B,CAAC,CAAE,MAAc,CAAC,UAAU,CAAC;QAC/B,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA;YAAE,OAAO,MAAM,CAAC;QAEvC,MAAM,SAAS,GACb,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,QAAQ,GACZ,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;QACnE,MAAM,OAAO,GACX,QAAQ,IAAI,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE1D,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;QAEzC,MAAM,QAAQ,GAAG,CAAC,SAAuB,EAAgB,EAAE;YACzD,SAAS;gBACP,6CAAqB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;YAC/D,SAAS,GAAG,qDAAyB,CA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AAC;AACN,CAAC,EAtFgB,yBAAyB,yCAAzB,yBAAyB,QAsFzC;AAED,MAAM,SAAS,GAAG,CAAC,SAAuB,EAAE,EAAE;IAC5C,IAAI,CAAC,SAAS,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,QAAQ,GAAW,cAAI,CAAC,OAAO,CACnC,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAC/C,CAAC;IACF,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CACxB,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,qBAAqB,CACtB,CAAC"}
|
|
@@ -28,6 +28,7 @@ var SourceFinder;
|
|
|
28
28
|
});
|
|
29
29
|
const emplace = (filter) => (input) => (closure) => __awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
for (const pattern of input) {
|
|
31
|
+
console.log(path_1.default.resolve(pattern));
|
|
31
32
|
for (const file of yield _Glob(path_1.default.resolve(pattern))) {
|
|
32
33
|
const stats = yield fs_1.default.promises.stat(file);
|
|
33
34
|
if (stats.isDirectory() === true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceFinder.js","sourceRoot":"","sources":["../../src/utils/SourceFinder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAExB,IAAiB,YAAY,
|
|
1
|
+
{"version":3,"file":"SourceFinder.js","sourceRoot":"","sources":["../../src/utils/SourceFinder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAExB,IAAiB,YAAY,CA+C5B;AA/CD,WAAiB,YAAY;IACd,iBAAI,GAAG,CAAO,KAAa,EAAqB,EAAE;;QAC7D,MAAM,IAAI,GAAgB,IAA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812",
|
|
4
4
|
"description": "Super-fast validation decorators of NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rimraf lib && tsc",
|
|
14
|
-
"dev": "
|
|
14
|
+
"dev": "tsc -p tsconfig.test.json --watch",
|
|
15
15
|
"eslint": "eslint ./**/*.ts",
|
|
16
16
|
"eslint:fix": "eslint ./**/*.ts --fix",
|
|
17
17
|
"prepare": "ts-patch install && typia patch"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://nestia.io",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@nestia/fetcher": "^3.
|
|
39
|
+
"@nestia/fetcher": "^3.11.0-dev.20240812",
|
|
40
40
|
"@nestjs/common": ">=7.0.1",
|
|
41
41
|
"@nestjs/core": ">=7.0.1",
|
|
42
42
|
"@samchon/openapi": "^0.4.3",
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
"reflect-metadata": ">=0.1.12",
|
|
50
50
|
"rxjs": ">=6.0.3",
|
|
51
51
|
"tgrid": "^1.0.0",
|
|
52
|
-
"typia": "^6.
|
|
52
|
+
"typia": "^6.8.0-dev.20240812",
|
|
53
53
|
"ws": "^7.5.3"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@nestia/fetcher": ">=3.
|
|
56
|
+
"@nestia/fetcher": ">=3.11.0-dev.20240812",
|
|
57
57
|
"@nestjs/common": ">=7.0.1",
|
|
58
58
|
"@nestjs/core": ">=7.0.1",
|
|
59
59
|
"reflect-metadata": ">=0.1.12",
|
|
60
60
|
"rxjs": ">=6.0.3",
|
|
61
|
-
"typia": ">=6.
|
|
61
|
+
"typia": ">=6.8.0-dev.20240812 <7.0.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@fastify/multipart": "^8.1.0",
|
|
@@ -27,9 +27,13 @@ export namespace DynamicModule {
|
|
|
27
27
|
export async function mount(
|
|
28
28
|
path: string | string[] | { include: string[]; exclude?: string[] },
|
|
29
29
|
metadata: Omit<ModuleMetadata, "controllers"> = {},
|
|
30
|
+
isTsNode?: boolean,
|
|
30
31
|
): Promise<object> {
|
|
31
32
|
// LOAD CONTROLLERS
|
|
32
|
-
const controllers: Creator<object>[] = await load_controllers(
|
|
33
|
+
const controllers: Creator<object>[] = await load_controllers(
|
|
34
|
+
path,
|
|
35
|
+
isTsNode,
|
|
36
|
+
);
|
|
33
37
|
|
|
34
38
|
// RETURN WITH DECORATING
|
|
35
39
|
@Module({ ...metadata, controllers })
|
|
@@ -63,9 +63,13 @@ export namespace EncryptedModule {
|
|
|
63
63
|
path: string | string[] | { include: string[]; exclude?: string[] },
|
|
64
64
|
password: IEncryptionPassword | IEncryptionPassword.Closure,
|
|
65
65
|
options: Omit<Parameters<typeof Module>[0], "controllers"> = {},
|
|
66
|
+
isTsNode?: boolean,
|
|
66
67
|
): Promise<object> {
|
|
67
68
|
// LOAD CONTROLLERS
|
|
68
|
-
const controllers: Creator<object>[] = await load_controllers(
|
|
69
|
+
const controllers: Creator<object>[] = await load_controllers(
|
|
70
|
+
path,
|
|
71
|
+
isTsNode,
|
|
72
|
+
);
|
|
69
73
|
|
|
70
74
|
// RETURNS WITH DECORATING
|
|
71
75
|
@EncryptedModule(
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* > You must configure the generic argument `T`
|
|
3
|
+
*
|
|
4
|
+
* Exception decorator.
|
|
5
|
+
*
|
|
6
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
7
|
+
* which could be occured in the method.
|
|
8
|
+
*
|
|
9
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
10
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
11
|
+
* the SDK library generation yet, but will be used in the future.
|
|
12
|
+
*
|
|
13
|
+
* @param props Properties for the exception
|
|
14
|
+
* @returns Method decorator
|
|
15
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
16
|
+
*/
|
|
17
|
+
export function TypedException(props: TypedException.IProps<unknown>): never;
|
|
18
|
+
|
|
1
19
|
/**
|
|
2
20
|
* > You must configure the generic argument `T`
|
|
3
21
|
*
|
|
@@ -14,6 +32,8 @@
|
|
|
14
32
|
* @param description Description about the exception
|
|
15
33
|
* @returns Method decorator
|
|
16
34
|
*
|
|
35
|
+
* @deprecated Use {@link TypedException.IProps} typed function instead.
|
|
36
|
+
* This typed function is deprecated and will be removed in the next major update.
|
|
17
37
|
* @author Jeongho Nam - https://github.com/samchon
|
|
18
38
|
*/
|
|
19
39
|
export function TypedException(
|
|
@@ -21,6 +41,26 @@ export function TypedException(
|
|
|
21
41
|
description?: string | undefined,
|
|
22
42
|
): never;
|
|
23
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Exception decorator.
|
|
46
|
+
*
|
|
47
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
48
|
+
* which could be occured in the method.
|
|
49
|
+
*
|
|
50
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
51
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
52
|
+
* the SDK library generation yet, but will be used in the future.
|
|
53
|
+
*
|
|
54
|
+
* @template T Type of the exception
|
|
55
|
+
* @param props Properties for the exception
|
|
56
|
+
* @returns Method decorator
|
|
57
|
+
*
|
|
58
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
59
|
+
*/
|
|
60
|
+
export function TypedException<T>(
|
|
61
|
+
props: TypedException.IProps<T>,
|
|
62
|
+
): MethodDecorator;
|
|
63
|
+
|
|
24
64
|
/**
|
|
25
65
|
* Exception decorator.
|
|
26
66
|
*
|
|
@@ -36,6 +76,8 @@ export function TypedException(
|
|
|
36
76
|
* @param description Description about the exception
|
|
37
77
|
* @returns Method decorator
|
|
38
78
|
*
|
|
79
|
+
* @deprecated Use {@link TypedException.IProps} typed function instead.
|
|
80
|
+
* This typed function is deprecated and will be removed in the next major update.
|
|
39
81
|
* @author Jeongho Nam - https://github.com/samchon
|
|
40
82
|
*/
|
|
41
83
|
export function TypedException<T>(
|
|
@@ -46,24 +88,25 @@ export function TypedException<T>(
|
|
|
46
88
|
/**
|
|
47
89
|
* @internal
|
|
48
90
|
*/
|
|
49
|
-
export function TypedException<T>(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
91
|
+
export function TypedException<T>(...args: any[]): MethodDecorator {
|
|
92
|
+
const props: TypedException.IProps<T> =
|
|
93
|
+
typeof args[0] === "object"
|
|
94
|
+
? args[0]
|
|
95
|
+
: { status: args[0], description: args[1] };
|
|
54
96
|
return function TypedException(
|
|
55
97
|
target: Object | T,
|
|
56
98
|
propertyKey: string | symbol,
|
|
57
99
|
descriptor: TypedPropertyDescriptor<any>,
|
|
58
100
|
) {
|
|
59
|
-
const array: IProps[] = (() => {
|
|
60
|
-
const oldbie: IProps[] | undefined =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
101
|
+
const array: TypedException.IProps<any>[] = (() => {
|
|
102
|
+
const oldbie: TypedException.IProps<any>[] | undefined =
|
|
103
|
+
Reflect.getMetadata(
|
|
104
|
+
"nestia/TypedException",
|
|
105
|
+
(target as any)[propertyKey],
|
|
106
|
+
);
|
|
64
107
|
if (oldbie !== undefined) return oldbie;
|
|
65
108
|
|
|
66
|
-
const newbie: IProps[] = [];
|
|
109
|
+
const newbie: TypedException.IProps<any>[] = [];
|
|
67
110
|
Reflect.defineMetadata(
|
|
68
111
|
"nestia/TypedException",
|
|
69
112
|
newbie,
|
|
@@ -71,20 +114,15 @@ export function TypedException<T>(
|
|
|
71
114
|
);
|
|
72
115
|
return newbie;
|
|
73
116
|
})();
|
|
74
|
-
array.push(
|
|
75
|
-
status,
|
|
76
|
-
description,
|
|
77
|
-
type: type!,
|
|
78
|
-
});
|
|
117
|
+
array.push(props);
|
|
79
118
|
return descriptor;
|
|
80
119
|
};
|
|
81
120
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
type: string;
|
|
121
|
+
export namespace TypedException {
|
|
122
|
+
export interface IProps<T> {
|
|
123
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
example?: T;
|
|
126
|
+
examples?: Record<string, T>;
|
|
127
|
+
}
|
|
90
128
|
}
|
|
@@ -8,6 +8,7 @@ import { SourceFinder } from "../../utils/SourceFinder";
|
|
|
8
8
|
*/
|
|
9
9
|
export const load_controllers = async (
|
|
10
10
|
path: string | string[] | { include: string[]; exclude?: string[] },
|
|
11
|
+
isTsNode?: boolean,
|
|
11
12
|
): Promise<Creator<object>[]> => {
|
|
12
13
|
const sources: string[] = await SourceFinder.find({
|
|
13
14
|
include: Array.isArray(path)
|
|
@@ -20,7 +21,7 @@ export const load_controllers = async (
|
|
|
20
21
|
? path.exclude ?? []
|
|
21
22
|
: [],
|
|
22
23
|
filter:
|
|
23
|
-
EXTENSION === "ts"
|
|
24
|
+
isTsNode === true || EXTENSION === "ts"
|
|
24
25
|
? (file) =>
|
|
25
26
|
file.substring(file.length - 3) === ".ts" &&
|
|
26
27
|
file.substring(file.length - 5) !== ".d.ts"
|
|
@@ -46,7 +46,7 @@ export namespace FileTransformer {
|
|
|
46
46
|
(node as any).parent ??= file;
|
|
47
47
|
|
|
48
48
|
// REPORT DIAGNOSTIC
|
|
49
|
-
const diagnostic = ts.createDiagnosticForNode(node, {
|
|
49
|
+
const diagnostic = (ts as any).createDiagnosticForNode(node, {
|
|
50
50
|
key: exp.code,
|
|
51
51
|
category: ts.DiagnosticCategory.Error,
|
|
52
52
|
message: exp.message,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
3
|
import { INestiaTransformProject } from "../options/INestiaTransformProject";
|
|
4
|
-
import { TypedExceptionTransformer } from "./TypedExceptionTransformer";
|
|
5
4
|
import { TypedRouteTransformer } from "./TypedRouteTransformer";
|
|
6
5
|
import { WebSocketRouteTransformer } from "./WebSocketRouteTransformer";
|
|
7
6
|
|
|
@@ -24,10 +23,12 @@ export namespace MethodTransformer {
|
|
|
24
23
|
if (escaped === undefined) return method;
|
|
25
24
|
|
|
26
25
|
const operator = (decorator: ts.Decorator): ts.Decorator => {
|
|
27
|
-
decorator = TypedExceptionTransformer.transform(project)(decorator);
|
|
28
26
|
decorator =
|
|
29
27
|
TypedRouteTransformer.transform(project)(escaped)(decorator);
|
|
30
|
-
WebSocketRouteTransformer.validate(project)(
|
|
28
|
+
decorator = WebSocketRouteTransformer.validate(project)(
|
|
29
|
+
decorator,
|
|
30
|
+
method,
|
|
31
|
+
);
|
|
31
32
|
return decorator;
|
|
32
33
|
};
|
|
33
34
|
if (ts.getDecorators !== undefined)
|
|
@@ -20,7 +20,7 @@ export namespace WebSocketRouteTransformer {
|
|
|
20
20
|
|
|
21
21
|
const report = (node: ts.Node, message: string) => {
|
|
22
22
|
errors.push(
|
|
23
|
-
ts.createDiagnosticForNode(node, {
|
|
23
|
+
(ts as any).createDiagnosticForNode(node, {
|
|
24
24
|
category: ts.DiagnosticCategory.Error,
|
|
25
25
|
key: "nestia.core.WebSocketRoute",
|
|
26
26
|
code: "(nestia.core.WebSocketRoute)" as any,
|
|
@@ -18,6 +18,7 @@ export namespace SourceFinder {
|
|
|
18
18
|
(input: string[]) =>
|
|
19
19
|
async (closure: (location: string) => void): Promise<void> => {
|
|
20
20
|
for (const pattern of input) {
|
|
21
|
+
console.log(path.resolve(pattern));
|
|
21
22
|
for (const file of await _Glob(path.resolve(pattern))) {
|
|
22
23
|
const stats: fs.Stats = await fs.promises.stat(file);
|
|
23
24
|
if (stats.isDirectory() === true)
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { INestiaTransformProject } from "../options/INestiaTransformProject";
|
|
3
|
-
export declare namespace TypedExceptionProgrammer {
|
|
4
|
-
const generate: ({ checker }: INestiaTransformProject) => (expression: ts.CallExpression) => ts.CallExpression;
|
|
5
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TypedExceptionProgrammer = void 0;
|
|
7
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
-
const JsonMetadataFactory_1 = require("typia/lib/factories/JsonMetadataFactory");
|
|
9
|
-
const TypeFactory_1 = require("typia/lib/factories/TypeFactory");
|
|
10
|
-
const TransformerError_1 = require("typia/lib/transformers/TransformerError");
|
|
11
|
-
var TypedExceptionProgrammer;
|
|
12
|
-
(function (TypedExceptionProgrammer) {
|
|
13
|
-
TypedExceptionProgrammer.generate = ({ checker }) => (expression) => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
16
|
-
if (!((_a = expression.typeArguments) === null || _a === void 0 ? void 0 : _a[0]))
|
|
17
|
-
throw TransformerError_1.TransformerError.from("nestia.core.TypedException")([
|
|
18
|
-
{
|
|
19
|
-
name: "uknown",
|
|
20
|
-
messages: [NOT_SPECIFIED],
|
|
21
|
-
explore: {
|
|
22
|
-
top: true,
|
|
23
|
-
object: null,
|
|
24
|
-
property: null,
|
|
25
|
-
nested: null,
|
|
26
|
-
escaped: false,
|
|
27
|
-
aliased: false,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
]);
|
|
31
|
-
// CHECK DUPLICATED TRNASFORMATION
|
|
32
|
-
else if (expression.arguments.length === 3)
|
|
33
|
-
return expression;
|
|
34
|
-
// GET TYPE INFO
|
|
35
|
-
const node = expression.typeArguments[0];
|
|
36
|
-
const type = checker.getTypeFromTypeNode(node);
|
|
37
|
-
// VALIDATE TYPE
|
|
38
|
-
if (type.isTypeParameter())
|
|
39
|
-
throw TransformerError_1.TransformerError.from("nestia.core.TypedException")([
|
|
40
|
-
{
|
|
41
|
-
name: TypeFactory_1.TypeFactory.getFullName(checker)(type),
|
|
42
|
-
messages: [NO_GENERIC_ARGUMENT],
|
|
43
|
-
explore: {
|
|
44
|
-
top: true,
|
|
45
|
-
object: null,
|
|
46
|
-
property: null,
|
|
47
|
-
nested: null,
|
|
48
|
-
escaped: false,
|
|
49
|
-
aliased: false,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
]);
|
|
53
|
-
JsonMetadataFactory_1.JsonMetadataFactory.analyze("@nestia.core.TypedException")(checker)(type);
|
|
54
|
-
// DO TRANSFORM
|
|
55
|
-
const name = TypeFactory_1.TypeFactory.getFullName(checker)(type);
|
|
56
|
-
return typescript_1.default.factory.updateCallExpression(expression, expression.expression, expression.typeArguments, [
|
|
57
|
-
expression.arguments[0],
|
|
58
|
-
(_b = expression.arguments[1]) !== null && _b !== void 0 ? _b : typescript_1.default.factory.createIdentifier("undefined"),
|
|
59
|
-
typescript_1.default.factory.createStringLiteral(name),
|
|
60
|
-
]);
|
|
61
|
-
};
|
|
62
|
-
})(TypedExceptionProgrammer || (exports.TypedExceptionProgrammer = TypedExceptionProgrammer = {}));
|
|
63
|
-
const NOT_SPECIFIED = "Error on @nestia.core.TypedException(): generic argument is not specified.";
|
|
64
|
-
const NO_GENERIC_ARGUMENT = "Error on @nestia.core.TypedException(): non-specified generic argument.";
|
|
65
|
-
//# sourceMappingURL=TypedExceptionProgrammer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedExceptionProgrammer.js","sourceRoot":"","sources":["../../src/programmers/TypedExceptionProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,iFAA8E;AAC9E,iEAA8D;AAC9D,8EAA2E;AA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ACL,yCAAmB,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;QAE1E,eAAe;QACf,MAAM,IAAI,GAAW,yBAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CACpC,UAAU,EACV,UAAU,CAAC,UAAU,EACrB,UAAU,CAAC,aAAa,EACxB;YACE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;YACvB,MAAA,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,mCAAI,oBAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC;YACnE,oBAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC;SACrC,CACF,CAAC;IACJ,CAAC,CAAC;AACN,CAAC,EA1DgB,wBAAwB,wCAAxB,wBAAwB,QA0DxC;AAED,MAAM,aAAa,GACjB,4EAA4E,CAAC;AAC/E,MAAM,mBAAmB,GACvB,yEAAyE,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TypedExceptionTransformer = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
9
|
-
const TypedExceptionProgrammer_1 = require("../programmers/TypedExceptionProgrammer");
|
|
10
|
-
var TypedExceptionTransformer;
|
|
11
|
-
(function (TypedExceptionTransformer) {
|
|
12
|
-
TypedExceptionTransformer.transform = (project) => (decorator) => {
|
|
13
|
-
if (!typescript_1.default.isCallExpression(decorator.expression))
|
|
14
|
-
return decorator;
|
|
15
|
-
// CHECK SIGNATURE
|
|
16
|
-
const signature = project.checker.getResolvedSignature(decorator.expression);
|
|
17
|
-
if (!signature || !signature.declaration)
|
|
18
|
-
return decorator;
|
|
19
|
-
// CHECK TO BE TRANSFORMED
|
|
20
|
-
const done = (() => {
|
|
21
|
-
// CHECK FILENAME
|
|
22
|
-
const location = path_1.default.resolve(signature.declaration.getSourceFile().fileName);
|
|
23
|
-
if (location.indexOf(LIB_PATH) === -1)
|
|
24
|
-
return false;
|
|
25
|
-
// CHECK DUPLICATED
|
|
26
|
-
return decorator.expression.arguments.length !== 3;
|
|
27
|
-
})();
|
|
28
|
-
if (done === false)
|
|
29
|
-
return decorator;
|
|
30
|
-
// DO TRANSFORM
|
|
31
|
-
return typescript_1.default.factory.createDecorator(TypedExceptionProgrammer_1.TypedExceptionProgrammer.generate(project)(decorator.expression));
|
|
32
|
-
};
|
|
33
|
-
})(TypedExceptionTransformer || (exports.TypedExceptionTransformer = TypedExceptionTransformer = {}));
|
|
34
|
-
const LIB_PATH = path_1.default.join("@nestia", "core", "lib", "decorators", `TypedException.d.ts`);
|
|
35
|
-
//# sourceMappingURL=TypedExceptionTransformer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedExceptionTransformer.js","sourceRoot":"","sources":["../../src/transformers/TypedExceptionTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4DAA4B;AAG5B,sFAAmF;AAEnF,IAAiB,yBAAyB,CA6BzC;AA7BD,WAAiB,yBAAyB;IAC3B,mCAAS,GACpB,CAAC,OAAgC,EAAE,EAAE,CACrC,CAAC,SAAuB,EAAgB,EAAE;QACxC,IAAI,CAAC,oBAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC;YAAE,OAAO,SAAS,CAAC;QAEjE,kBAAkB;QAClB,MAAM,SAAS,GACb,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QAE3D,0BAA0B;QAC1B,MAAM,IAAI,GAAY,CAAC,GAAG,EAAE;YAC1B,iBAAiB;YACjB,MAAM,QAAQ,GAAW,cAAI,CAAC,OAAO,CACnC,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAC/C,CAAC;YACF,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAAE,OAAO,KAAK,CAAC;YAEpD,mBAAmB;YACnB,OAAO,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;QACrD,CAAC,CAAC,EAAE,CAAC;QACL,IAAI,IAAI,KAAK,KAAK;YAAE,OAAO,SAAS,CAAC;QAErC,eAAe;QACf,OAAO,oBAAE,CAAC,OAAO,CAAC,eAAe,CAC/B,mDAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CACjE,CAAC;IACJ,CAAC,CAAC;AACN,CAAC,EA7BgB,yBAAyB,yCAAzB,yBAAyB,QA6BzC;AAED,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CACxB,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,qBAAqB,CACtB,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { JsonMetadataFactory } from "typia/lib/factories/JsonMetadataFactory";
|
|
3
|
-
import { TypeFactory } from "typia/lib/factories/TypeFactory";
|
|
4
|
-
import { TransformerError } from "typia/lib/transformers/TransformerError";
|
|
5
|
-
|
|
6
|
-
import { INestiaTransformProject } from "../options/INestiaTransformProject";
|
|
7
|
-
|
|
8
|
-
export namespace TypedExceptionProgrammer {
|
|
9
|
-
export const generate =
|
|
10
|
-
({ checker }: INestiaTransformProject) =>
|
|
11
|
-
(expression: ts.CallExpression): ts.CallExpression => {
|
|
12
|
-
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
13
|
-
if (!expression.typeArguments?.[0])
|
|
14
|
-
throw TransformerError.from("nestia.core.TypedException")([
|
|
15
|
-
{
|
|
16
|
-
name: "uknown",
|
|
17
|
-
messages: [NOT_SPECIFIED],
|
|
18
|
-
explore: {
|
|
19
|
-
top: true,
|
|
20
|
-
object: null,
|
|
21
|
-
property: null,
|
|
22
|
-
nested: null,
|
|
23
|
-
escaped: false,
|
|
24
|
-
aliased: false,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
]);
|
|
28
|
-
// CHECK DUPLICATED TRNASFORMATION
|
|
29
|
-
else if (expression.arguments.length === 3) return expression;
|
|
30
|
-
|
|
31
|
-
// GET TYPE INFO
|
|
32
|
-
const node: ts.TypeNode = expression.typeArguments[0];
|
|
33
|
-
const type: ts.Type = checker.getTypeFromTypeNode(node);
|
|
34
|
-
|
|
35
|
-
// VALIDATE TYPE
|
|
36
|
-
if (type.isTypeParameter())
|
|
37
|
-
throw TransformerError.from("nestia.core.TypedException")([
|
|
38
|
-
{
|
|
39
|
-
name: TypeFactory.getFullName(checker)(type),
|
|
40
|
-
messages: [NO_GENERIC_ARGUMENT],
|
|
41
|
-
explore: {
|
|
42
|
-
top: true,
|
|
43
|
-
object: null,
|
|
44
|
-
property: null,
|
|
45
|
-
nested: null,
|
|
46
|
-
escaped: false,
|
|
47
|
-
aliased: false,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
]);
|
|
51
|
-
JsonMetadataFactory.analyze("@nestia.core.TypedException")(checker)(type);
|
|
52
|
-
|
|
53
|
-
// DO TRANSFORM
|
|
54
|
-
const name: string = TypeFactory.getFullName(checker)(type);
|
|
55
|
-
return ts.factory.updateCallExpression(
|
|
56
|
-
expression,
|
|
57
|
-
expression.expression,
|
|
58
|
-
expression.typeArguments,
|
|
59
|
-
[
|
|
60
|
-
expression.arguments[0],
|
|
61
|
-
expression.arguments[1] ?? ts.factory.createIdentifier("undefined"),
|
|
62
|
-
ts.factory.createStringLiteral(name),
|
|
63
|
-
],
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const NOT_SPECIFIED =
|
|
69
|
-
"Error on @nestia.core.TypedException(): generic argument is not specified.";
|
|
70
|
-
const NO_GENERIC_ARGUMENT =
|
|
71
|
-
"Error on @nestia.core.TypedException(): non-specified generic argument.";
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import ts from "typescript";
|
|
3
|
-
|
|
4
|
-
import { INestiaTransformProject } from "../options/INestiaTransformProject";
|
|
5
|
-
import { TypedExceptionProgrammer } from "../programmers/TypedExceptionProgrammer";
|
|
6
|
-
|
|
7
|
-
export namespace TypedExceptionTransformer {
|
|
8
|
-
export const transform =
|
|
9
|
-
(project: INestiaTransformProject) =>
|
|
10
|
-
(decorator: ts.Decorator): ts.Decorator => {
|
|
11
|
-
if (!ts.isCallExpression(decorator.expression)) return decorator;
|
|
12
|
-
|
|
13
|
-
// CHECK SIGNATURE
|
|
14
|
-
const signature: ts.Signature | undefined =
|
|
15
|
-
project.checker.getResolvedSignature(decorator.expression);
|
|
16
|
-
if (!signature || !signature.declaration) return decorator;
|
|
17
|
-
|
|
18
|
-
// CHECK TO BE TRANSFORMED
|
|
19
|
-
const done: boolean = (() => {
|
|
20
|
-
// CHECK FILENAME
|
|
21
|
-
const location: string = path.resolve(
|
|
22
|
-
signature.declaration.getSourceFile().fileName,
|
|
23
|
-
);
|
|
24
|
-
if (location.indexOf(LIB_PATH) === -1) return false;
|
|
25
|
-
|
|
26
|
-
// CHECK DUPLICATED
|
|
27
|
-
return decorator.expression.arguments.length !== 3;
|
|
28
|
-
})();
|
|
29
|
-
if (done === false) return decorator;
|
|
30
|
-
|
|
31
|
-
// DO TRANSFORM
|
|
32
|
-
return ts.factory.createDecorator(
|
|
33
|
-
TypedExceptionProgrammer.generate(project)(decorator.expression),
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const LIB_PATH = path.join(
|
|
39
|
-
"@nestia",
|
|
40
|
-
"core",
|
|
41
|
-
"lib",
|
|
42
|
-
"decorators",
|
|
43
|
-
`TypedException.d.ts`,
|
|
44
|
-
);
|