@nestia/sdk 2.6.2 → 2.6.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/ControllerAnalyzer.js +3 -3
- package/lib/analyses/ControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.d.ts +1 -2
- package/lib/analyses/ImportAnalyzer.js +2 -2
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectAnalyzer.js +2 -2
- package/lib/analyses/ReflectAnalyzer.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +4 -4
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.js +6 -8
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/structures/TypeEntry.js +2 -2
- package/lib/structures/TypeEntry.js.map +1 -1
- package/package.json +4 -4
- package/src/INestiaConfig.ts +248 -248
- package/src/NestiaSdkApplication.ts +255 -255
- package/src/analyses/ControllerAnalyzer.ts +402 -402
- package/src/analyses/ExceptionAnalyzer.ts +148 -148
- package/src/analyses/ImportAnalyzer.ts +1 -2
- package/src/analyses/ReflectAnalyzer.ts +463 -463
- package/src/analyses/SecurityAnalyzer.ts +24 -24
- package/src/generates/CloneGenerator.ts +62 -62
- package/src/generates/E2eGenerator.ts +66 -66
- package/src/generates/SdkGenerator.ts +84 -84
- package/src/generates/SwaggerGenerator.ts +446 -446
- package/src/generates/internal/E2eFileProgrammer.ts +182 -182
- package/src/generates/internal/FilePrinter.ts +53 -53
- package/src/generates/internal/ImportDictionary.ts +147 -149
- package/src/generates/internal/SdkAliasCollection.ts +152 -152
- package/src/generates/internal/SdkCloneProgrammer.ts +155 -155
- package/src/generates/internal/SdkFileProgrammer.ts +115 -115
- package/src/generates/internal/SdkFunctionProgrammer.ts +298 -298
- package/src/generates/internal/SdkImportWizard.ts +55 -55
- package/src/generates/internal/SdkNamespaceProgrammer.ts +510 -510
- package/src/generates/internal/SdkRouteProgrammer.ts +83 -83
- package/src/generates/internal/SdkSimulationProgrammer.ts +365 -365
- package/src/generates/internal/SdkTypeProgrammer.ts +385 -385
- package/src/generates/internal/SwaggerSchemaGenerator.ts +438 -438
- package/src/structures/IController.ts +94 -94
- package/src/structures/IRoute.ts +53 -53
- package/src/structures/ISwagger.ts +91 -91
- package/src/structures/ISwaggerRoute.ts +54 -54
- package/src/structures/ISwaggerSecurityScheme.ts +65 -65
- package/src/structures/ParamCategory.ts +1 -1
- package/src/structures/TypeEntry.ts +1 -1
- package/src/utils/StringUtil.ts +6 -6
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security scheme of Swagger Documents.
|
|
3
|
-
*
|
|
4
|
-
* `ISwaggerSecurityScheme` is a data structure representing content of
|
|
5
|
-
* `securitySchemes` in `swagger.json` file. It is composed with 5 types of security
|
|
6
|
-
* schemes as an union type like below.
|
|
7
|
-
*
|
|
8
|
-
* @reference https://swagger.io/specification/#security-scheme-object
|
|
9
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
10
|
-
*/
|
|
11
|
-
export type ISwaggerSecurityScheme =
|
|
12
|
-
| ISwaggerSecurityScheme.IHttpBasic
|
|
13
|
-
| ISwaggerSecurityScheme.IHttpBearer
|
|
14
|
-
| ISwaggerSecurityScheme.IApiKey
|
|
15
|
-
| ISwaggerSecurityScheme.IOpenId
|
|
16
|
-
| ISwaggerSecurityScheme.IOAuth2;
|
|
17
|
-
export namespace ISwaggerSecurityScheme {
|
|
18
|
-
export interface IHttpBasic {
|
|
19
|
-
type: "http";
|
|
20
|
-
scheme: "basic";
|
|
21
|
-
}
|
|
22
|
-
export interface IHttpBearer {
|
|
23
|
-
type: "http";
|
|
24
|
-
scheme: "bearer";
|
|
25
|
-
bearerFormat?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface IApiKey {
|
|
28
|
-
type: "apiKey";
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @default header
|
|
32
|
-
*/
|
|
33
|
-
in?: "header" | "query" | "cookie";
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @default Authorization
|
|
37
|
-
*/
|
|
38
|
-
name?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IOpenId {
|
|
42
|
-
type: "openIdConnect";
|
|
43
|
-
openIdConnectUrl: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface IOAuth2 {
|
|
47
|
-
type: "oauth2";
|
|
48
|
-
flows: IOAuth2.IFlowSet;
|
|
49
|
-
description?: string;
|
|
50
|
-
}
|
|
51
|
-
export namespace IOAuth2 {
|
|
52
|
-
export interface IFlowSet {
|
|
53
|
-
authorizationCode?: IFlow;
|
|
54
|
-
implicit?: Omit<IFlow, "tokenUrl">;
|
|
55
|
-
password?: Omit<IFlow, "authorizationUrl">;
|
|
56
|
-
clientCredentials?: Omit<IFlow, "authorizationUrl">;
|
|
57
|
-
}
|
|
58
|
-
export interface IFlow {
|
|
59
|
-
authorizationUrl: string;
|
|
60
|
-
tokenUrl?: string;
|
|
61
|
-
refreshUrl?: string;
|
|
62
|
-
scopes?: Record<string, string>;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Security scheme of Swagger Documents.
|
|
3
|
+
*
|
|
4
|
+
* `ISwaggerSecurityScheme` is a data structure representing content of
|
|
5
|
+
* `securitySchemes` in `swagger.json` file. It is composed with 5 types of security
|
|
6
|
+
* schemes as an union type like below.
|
|
7
|
+
*
|
|
8
|
+
* @reference https://swagger.io/specification/#security-scheme-object
|
|
9
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
10
|
+
*/
|
|
11
|
+
export type ISwaggerSecurityScheme =
|
|
12
|
+
| ISwaggerSecurityScheme.IHttpBasic
|
|
13
|
+
| ISwaggerSecurityScheme.IHttpBearer
|
|
14
|
+
| ISwaggerSecurityScheme.IApiKey
|
|
15
|
+
| ISwaggerSecurityScheme.IOpenId
|
|
16
|
+
| ISwaggerSecurityScheme.IOAuth2;
|
|
17
|
+
export namespace ISwaggerSecurityScheme {
|
|
18
|
+
export interface IHttpBasic {
|
|
19
|
+
type: "http";
|
|
20
|
+
scheme: "basic";
|
|
21
|
+
}
|
|
22
|
+
export interface IHttpBearer {
|
|
23
|
+
type: "http";
|
|
24
|
+
scheme: "bearer";
|
|
25
|
+
bearerFormat?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IApiKey {
|
|
28
|
+
type: "apiKey";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @default header
|
|
32
|
+
*/
|
|
33
|
+
in?: "header" | "query" | "cookie";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @default Authorization
|
|
37
|
+
*/
|
|
38
|
+
name?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IOpenId {
|
|
42
|
+
type: "openIdConnect";
|
|
43
|
+
openIdConnectUrl: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IOAuth2 {
|
|
47
|
+
type: "oauth2";
|
|
48
|
+
flows: IOAuth2.IFlowSet;
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
export namespace IOAuth2 {
|
|
52
|
+
export interface IFlowSet {
|
|
53
|
+
authorizationCode?: IFlow;
|
|
54
|
+
implicit?: Omit<IFlow, "tokenUrl">;
|
|
55
|
+
password?: Omit<IFlow, "authorizationUrl">;
|
|
56
|
+
clientCredentials?: Omit<IFlow, "authorizationUrl">;
|
|
57
|
+
}
|
|
58
|
+
export interface IFlow {
|
|
59
|
+
authorizationUrl: string;
|
|
60
|
+
tokenUrl?: string;
|
|
61
|
+
refreshUrl?: string;
|
|
62
|
+
scopes?: Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type ParamCategory = "param" | "query" | "body" | "rawBody" | "headers";
|
|
1
|
+
export type ParamCategory = "param" | "query" | "body" | "rawBody" | "headers";
|
package/src/utils/StringUtil.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export namespace StringUtil {
|
|
2
|
-
export const escapeDuplicate =
|
|
3
|
-
(keep: string[]) =>
|
|
4
|
-
(change: string): string =>
|
|
5
|
-
keep.includes(change) ? escapeDuplicate(keep)(`_${change}`) : change;
|
|
6
|
-
}
|
|
1
|
+
export namespace StringUtil {
|
|
2
|
+
export const escapeDuplicate =
|
|
3
|
+
(keep: string[]) =>
|
|
4
|
+
(change: string): string =>
|
|
5
|
+
keep.includes(change) ? escapeDuplicate(keep)(`_${change}`) : change;
|
|
6
|
+
}
|