@nestia/sdk 1.6.4-dev.20230817 → 1.6.4-dev.20230817-3
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/analyses/ExceptionAnalyzer.d.ts +1 -1
- package/lib/generates/SwaggerGenerator.js +4 -4
- package/lib/structures/IController.d.ts +2 -2
- package/lib/structures/IRoute.d.ts +1 -1
- package/package.json +3 -3
- package/src/analyses/ExceptionAnalyzer.ts +3 -3
- package/src/analyses/ReflectAnalyzer.ts +2 -2
- package/src/generates/SwaggerGenerator.ts +4 -4
- package/src/structures/IController.ts +2 -2
- package/src/structures/IRoute.ts +1 -1
|
@@ -4,5 +4,5 @@ import { IRoute } from "../structures/IRoute";
|
|
|
4
4
|
import { GenericAnalyzer } from "./GenericAnalyzer";
|
|
5
5
|
import { ImportAnalyzer } from "./ImportAnalyzer";
|
|
6
6
|
export declare namespace ExceptionAnalyzer {
|
|
7
|
-
const analyze: (checker: ts.TypeChecker) => (genericDict: GenericAnalyzer.Dictionary, importDict: ImportAnalyzer.Dictionary) => (func: IController.IFunction) => (declaration: ts.MethodDeclaration) => Record<number | "
|
|
7
|
+
const analyze: (checker: ts.TypeChecker) => (genericDict: GenericAnalyzer.Dictionary, importDict: ImportAnalyzer.Dictionary) => (func: IController.IFunction) => (declaration: ts.MethodDeclaration) => Record<number | "2XX" | "3XX" | "4XX" | "5XX", IRoute.IOutput>;
|
|
8
8
|
}
|
|
@@ -643,10 +643,10 @@ var SwaggerGenerator;
|
|
|
643
643
|
const elements = text.split(" ").map((str) => str.trim());
|
|
644
644
|
const status = elements[0];
|
|
645
645
|
if (isNaN(Number(status)) &&
|
|
646
|
-
status !== "
|
|
647
|
-
status !== "
|
|
648
|
-
status !== "
|
|
649
|
-
status !== "
|
|
646
|
+
status !== "2XX" &&
|
|
647
|
+
status !== "3XX" &&
|
|
648
|
+
status !== "4XX" &&
|
|
649
|
+
status !== "5XX")
|
|
650
650
|
continue;
|
|
651
651
|
const description = elements.length === 1 ? undefined : elements.slice(1).join(" ");
|
|
652
652
|
const oldbie = output[status];
|
|
@@ -17,7 +17,7 @@ export declare namespace IController {
|
|
|
17
17
|
type?: string;
|
|
18
18
|
contentType: "application/json" | "text/plain";
|
|
19
19
|
security: Record<string, string[]>[];
|
|
20
|
-
exceptions: Record<number | "
|
|
20
|
+
exceptions: Record<number | "2XX" | "3XX" | "4XX" | "5XX", IController.IException>;
|
|
21
21
|
}
|
|
22
22
|
type IParameter = ICommonParameter | IQueryParameter | IHeadersParameter | IBodyParameter | IPathParameter;
|
|
23
23
|
interface ICommonParameter {
|
|
@@ -63,7 +63,7 @@ export declare namespace IController {
|
|
|
63
63
|
}
|
|
64
64
|
interface IException {
|
|
65
65
|
type: string;
|
|
66
|
-
status: number | "
|
|
66
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
67
67
|
description: string | undefined;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -24,7 +24,7 @@ export interface IRoute {
|
|
|
24
24
|
source: string;
|
|
25
25
|
}>;
|
|
26
26
|
security: Record<string, string[]>[];
|
|
27
|
-
exceptions: Record<number | "
|
|
27
|
+
exceptions: Record<number | "2XX" | "3XX" | "4XX" | "5XX", IRoute.IOutput>;
|
|
28
28
|
}
|
|
29
29
|
export declare namespace IRoute {
|
|
30
30
|
type IParameter = IController.IParameter & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/sdk",
|
|
3
|
-
"version": "1.6.4-dev.20230817",
|
|
3
|
+
"version": "1.6.4-dev.20230817-3",
|
|
4
4
|
"description": "Nestia SDK and Swagger generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://nestia.io",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@nestia/fetcher": "^1.6.4-dev.20230817",
|
|
38
|
+
"@nestia/fetcher": "^1.6.4-dev.20230817-3",
|
|
39
39
|
"cli": "^1.0.1",
|
|
40
40
|
"glob": "^7.2.0",
|
|
41
41
|
"path-to-regexp": "^6.2.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typia": "^4.2.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@nestia/fetcher": ">= 1.6.4-dev.20230817",
|
|
50
|
+
"@nestia/fetcher": ">= 1.6.4-dev.20230817-3",
|
|
51
51
|
"@nestjs/common": ">= 7.0.1",
|
|
52
52
|
"@nestjs/core": ">= 7.0.1",
|
|
53
53
|
"reflect-metadata": ">= 0.1.12",
|
|
@@ -17,9 +17,9 @@ export namespace ExceptionAnalyzer {
|
|
|
17
17
|
(func: IController.IFunction) =>
|
|
18
18
|
(
|
|
19
19
|
declaration: ts.MethodDeclaration,
|
|
20
|
-
): Record<number | "
|
|
20
|
+
): Record<number | "2XX" | "3XX" | "4XX" | "5XX", IRoute.IOutput> => {
|
|
21
21
|
const output: Record<
|
|
22
|
-
number | "
|
|
22
|
+
number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
23
23
|
IRoute.IOutput
|
|
24
24
|
> = {} as any;
|
|
25
25
|
for (const decorator of declaration.modifiers ?? [])
|
|
@@ -39,7 +39,7 @@ export namespace ExceptionAnalyzer {
|
|
|
39
39
|
(func: IController.IFunction) =>
|
|
40
40
|
(
|
|
41
41
|
output: Record<
|
|
42
|
-
number | "
|
|
42
|
+
number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
43
43
|
IRoute.IOutput
|
|
44
44
|
>,
|
|
45
45
|
) =>
|
|
@@ -134,13 +134,13 @@ export namespace ReflectAnalyzer {
|
|
|
134
134
|
|
|
135
135
|
function _Get_exceptions(
|
|
136
136
|
value: any,
|
|
137
|
-
): Record<number | "
|
|
137
|
+
): Record<number | "2XX" | "3XX" | "4XX" | "5XX", IController.IException> {
|
|
138
138
|
const entire: IController.IException[] | undefined =
|
|
139
139
|
Reflect.getMetadata("swagger/TypedException", value);
|
|
140
140
|
return Object.fromEntries(
|
|
141
141
|
(entire ?? []).map((exp) => [exp.status, exp]),
|
|
142
142
|
) as Record<
|
|
143
|
-
number | "
|
|
143
|
+
number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
144
144
|
IController.IException
|
|
145
145
|
>;
|
|
146
146
|
}
|
|
@@ -600,10 +600,10 @@ export namespace SwaggerGenerator {
|
|
|
600
600
|
const status: string = elements[0];
|
|
601
601
|
if (
|
|
602
602
|
isNaN(Number(status)) &&
|
|
603
|
-
status !== "
|
|
604
|
-
status !== "
|
|
605
|
-
status !== "
|
|
606
|
-
status !== "
|
|
603
|
+
status !== "2XX" &&
|
|
604
|
+
status !== "3XX" &&
|
|
605
|
+
status !== "4XX" &&
|
|
606
|
+
status !== "5XX"
|
|
607
607
|
)
|
|
608
608
|
continue;
|
|
609
609
|
|
|
@@ -20,7 +20,7 @@ export namespace IController {
|
|
|
20
20
|
contentType: "application/json" | "text/plain";
|
|
21
21
|
security: Record<string, string[]>[];
|
|
22
22
|
exceptions: Record<
|
|
23
|
-
number | "
|
|
23
|
+
number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
24
24
|
IController.IException
|
|
25
25
|
>;
|
|
26
26
|
}
|
|
@@ -75,7 +75,7 @@ export namespace IController {
|
|
|
75
75
|
|
|
76
76
|
export interface IException {
|
|
77
77
|
type: string;
|
|
78
|
-
status: number | "
|
|
78
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
79
79
|
description: string | undefined;
|
|
80
80
|
}
|
|
81
81
|
}
|
package/src/structures/IRoute.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface IRoute {
|
|
|
24
24
|
| { type: "assigner"; source: string }
|
|
25
25
|
>;
|
|
26
26
|
security: Record<string, string[]>[];
|
|
27
|
-
exceptions: Record<number | "
|
|
27
|
+
exceptions: Record<number | "2XX" | "3XX" | "4XX" | "5XX", IRoute.IOutput>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export namespace IRoute {
|