@nestia/core 1.6.4-dev.20230816 → 1.6.4-dev.20230817
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.
|
@@ -1,3 +1,39 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* > You must configure the generic argument `T`
|
|
4
|
+
*
|
|
5
|
+
* Exception decorator.
|
|
6
|
+
*
|
|
7
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
8
|
+
* which could be occured in the method.
|
|
9
|
+
*
|
|
10
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
11
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
12
|
+
* the SDK library generation yet, but will be used in the future.
|
|
13
|
+
*
|
|
14
|
+
* @param status Status number or pattern like "2xx", "3xx", "4xx", "5xx"
|
|
15
|
+
* @param description Description about the exception
|
|
16
|
+
* @returns Method decorator
|
|
17
|
+
*
|
|
18
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
21
|
+
export declare function TypedException(status: number | "2xx" | "3xx" | "4xx" | "5xx", description?: string | undefined): never;
|
|
22
|
+
/**
|
|
23
|
+
* Exception decorator.
|
|
24
|
+
*
|
|
25
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
26
|
+
* which could be occured in the method.
|
|
27
|
+
*
|
|
28
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
29
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
30
|
+
* the SDK library generation yet, but will be used in the future.
|
|
31
|
+
*
|
|
32
|
+
* @template T Type of the exception
|
|
33
|
+
* @param status Status number or pattern like "2xx", "3xx", "4xx", "5xx"
|
|
34
|
+
* @param description Description about the exception
|
|
35
|
+
* @returns Method decorator
|
|
36
|
+
*
|
|
37
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
38
|
+
*/
|
|
39
|
+
export declare function TypedException<T extends object>(status: number | "2xx" | "3xx" | "4xx" | "5xx", description?: string | undefined): MethodDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypedException.js","sourceRoot":"","sources":["../../src/decorators/TypedException.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;
|
|
1
|
+
{"version":3,"file":"TypedException.js","sourceRoot":"","sources":["../../src/decorators/TypedException.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAgD1B;;GAEG;AACH,SAAgB,cAAc,CAC1B,MAA8C,EAC9C,WAAgC,EAChC,IAAyB;IAEzB,OAAO,SAAS,cAAc,CAC1B,MAAkB,EAClB,WAA4B,EAC5B,UAAwC;QAExC,IAAM,KAAK,GAAa,CAAC;YACrB,IAAM,MAAM,GAAyB,OAAO,CAAC,WAAW,CACpD,wBAAwB,EACvB,MAAc,CAAC,WAAW,CAAC,CAC/B,CAAC;YACF,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,MAAM,CAAC;YAExC,IAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,OAAO,CAAC,cAAc,CAClB,wBAAwB,EACxB,MAAM,EACL,MAAc,CAAC,WAAW,CAAC,CAC/B,CAAC;YACF,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,EAAE,CAAC;QACL,KAAK,CAAC,IAAI,CAAC;YACP,MAAM,QAAA;YACN,WAAW,aAAA;YACX,IAAI,EAAE,IAAK;SACd,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC;AAhCD,wCAgCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/core",
|
|
3
|
-
"version": "1.6.4-dev.
|
|
3
|
+
"version": "1.6.4-dev.20230817",
|
|
4
4
|
"description": "Super-fast validation decorators of NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://nestia.io",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nestia/fetcher": "^1.6.4-dev.
|
|
37
|
+
"@nestia/fetcher": "^1.6.4-dev.20230817",
|
|
38
38
|
"@nestjs/common": ">= 7.0.1",
|
|
39
39
|
"@nestjs/core": ">= 7.0.1",
|
|
40
40
|
"@nestjs/platform-express": ">= 7.0.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typia": "^4.2.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@nestia/fetcher": ">= 1.6.4-dev.
|
|
50
|
+
"@nestia/fetcher": ">= 1.6.4-dev.20230817",
|
|
51
51
|
"@nestjs/common": ">= 7.0.1",
|
|
52
52
|
"@nestjs/core": ">= 7.0.1",
|
|
53
53
|
"@nestjs/platform-express": ">= 7.0.1",
|
|
@@ -1,25 +1,61 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* > You must configure the generic argument `T`
|
|
5
|
+
*
|
|
6
|
+
* Exception decorator.
|
|
7
|
+
*
|
|
8
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
9
|
+
* which could be occured in the method.
|
|
10
|
+
*
|
|
11
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
12
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
13
|
+
* the SDK library generation yet, but will be used in the future.
|
|
14
|
+
*
|
|
15
|
+
* @param status Status number or pattern like "2xx", "3xx", "4xx", "5xx"
|
|
16
|
+
* @param description Description about the exception
|
|
17
|
+
* @returns Method decorator
|
|
18
|
+
*
|
|
19
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
3
22
|
export function TypedException(
|
|
4
|
-
status: number,
|
|
23
|
+
status: number | "2xx" | "3xx" | "4xx" | "5xx",
|
|
5
24
|
description?: string | undefined,
|
|
6
25
|
): never;
|
|
7
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Exception decorator.
|
|
29
|
+
*
|
|
30
|
+
* `TypedException` is a decorator function describing HTTP exception and its type
|
|
31
|
+
* which could be occured in the method.
|
|
32
|
+
*
|
|
33
|
+
* For reference, this decorator function does not affect to the method's behavior,
|
|
34
|
+
* but only affects to the swagger documents generation. Also, it does not affect to
|
|
35
|
+
* the SDK library generation yet, but will be used in the future.
|
|
36
|
+
*
|
|
37
|
+
* @template T Type of the exception
|
|
38
|
+
* @param status Status number or pattern like "2xx", "3xx", "4xx", "5xx"
|
|
39
|
+
* @param description Description about the exception
|
|
40
|
+
* @returns Method decorator
|
|
41
|
+
*
|
|
42
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
43
|
+
*/
|
|
8
44
|
export function TypedException<T extends object>(
|
|
9
|
-
status: number,
|
|
45
|
+
status: number | "2xx" | "3xx" | "4xx" | "5xx",
|
|
10
46
|
description?: string | undefined,
|
|
11
47
|
): MethodDecorator;
|
|
12
48
|
|
|
13
49
|
/**
|
|
14
50
|
* @internal
|
|
15
51
|
*/
|
|
16
|
-
export function TypedException(
|
|
17
|
-
status: number,
|
|
52
|
+
export function TypedException<T extends object>(
|
|
53
|
+
status: number | "2xx" | "3xx" | "4xx" | "5xx",
|
|
18
54
|
description?: string | undefined,
|
|
19
55
|
type?: string | undefined,
|
|
20
56
|
): MethodDecorator {
|
|
21
57
|
return function TypedException(
|
|
22
|
-
target: Object,
|
|
58
|
+
target: Object | T,
|
|
23
59
|
propertyKey: string | symbol,
|
|
24
60
|
descriptor: TypedPropertyDescriptor<any>,
|
|
25
61
|
) {
|
|
@@ -48,7 +84,7 @@ export function TypedException(
|
|
|
48
84
|
}
|
|
49
85
|
|
|
50
86
|
interface IProps {
|
|
51
|
-
status: number;
|
|
87
|
+
status: number | "2xx" | "3xx" | "4xx" | "5xx";
|
|
52
88
|
description?: string | undefined;
|
|
53
89
|
type: string;
|
|
54
90
|
}
|