@nestia/migrate 0.11.3 → 0.11.5

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.
Files changed (55) hide show
  1. package/lib/analyzers/MigrateMethodAnalyzer.js +1 -1
  2. package/lib/analyzers/MigrateMethodAnalyzer.js.map +1 -1
  3. package/lib/bundles/NEST_TEMPLATE.js +5 -5
  4. package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
  5. package/lib/bundles/SDK_TEMPLATE.js +1 -1
  6. package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
  7. package/lib/utils/openapi-down-convert/converter.js +2 -2
  8. package/package.json +75 -75
  9. package/src/MigrateApplication.ts +81 -81
  10. package/src/analyzers/MigrateAnalyzer.ts +9 -9
  11. package/src/analyzers/MigrateControllerAnalyzer.ts +135 -135
  12. package/src/analyzers/MigrateMethodAnalyzer.ts +439 -437
  13. package/src/archivers/MigrateFileArchiver.ts +38 -38
  14. package/src/bundles/NEST_TEMPLATE.ts +5 -5
  15. package/src/bundles/SDK_TEMPLATE.ts +1 -1
  16. package/src/executable/bundle.ts +110 -110
  17. package/src/internal/MigrateCommander.ts +70 -70
  18. package/src/internal/MigrateInquirer.ts +86 -86
  19. package/src/module.ts +14 -14
  20. package/src/programmers/MigrateApiFileProgrammer.ts +53 -53
  21. package/src/programmers/MigrateApiFunctionProgrammer.ts +199 -199
  22. package/src/programmers/MigrateApiNamespaceProgrammer.ts +431 -431
  23. package/src/programmers/MigrateApiProgrammer.ts +170 -170
  24. package/src/programmers/MigrateApiSimulatationProgrammer.ts +327 -327
  25. package/src/programmers/MigrateApiStartProgrammer.ts +194 -194
  26. package/src/programmers/MigrateDtoProgrammer.ts +78 -78
  27. package/src/programmers/MigrateE2eFileProgrammer.ts +117 -117
  28. package/src/programmers/MigrateE2eProgrammer.ts +36 -36
  29. package/src/programmers/MigrateImportProgrammer.ts +121 -121
  30. package/src/programmers/MigrateNestControllerProgrammer.ts +50 -50
  31. package/src/programmers/MigrateNestMethodProgrammer.ts +250 -250
  32. package/src/programmers/MigrateNestModuleProgrammer.ts +63 -63
  33. package/src/programmers/MigrateNestProgrammer.ts +74 -74
  34. package/src/programmers/MigrateSchemaProgrammer.ts +267 -267
  35. package/src/structures/IMigrateDto.ts +8 -8
  36. package/src/structures/IMigrateProgram.ts +27 -27
  37. package/src/structures/IMigrateRoute.ts +51 -51
  38. package/src/structures/ISwagger.ts +23 -23
  39. package/src/structures/ISwaggerComponents.ts +14 -14
  40. package/src/structures/ISwaggerRoute.ts +20 -20
  41. package/src/structures/ISwaggerRouteBodyContent.ts +15 -15
  42. package/src/structures/ISwaggerRouteParameter.ts +14 -14
  43. package/src/structures/ISwaggerRouteRequestBody.ts +12 -12
  44. package/src/structures/ISwaggerRouteResponse.ts +11 -11
  45. package/src/structures/ISwaggerSchema.ts +90 -90
  46. package/src/structures/ISwaggerSecurityScheme.ts +47 -47
  47. package/src/structures/ISwaggerV20.ts +10 -10
  48. package/src/structures/ISwaggerV31.ts +10 -10
  49. package/src/utils/FilePrinter.ts +36 -36
  50. package/src/utils/OpenApiConverter.ts +19 -19
  51. package/src/utils/StringUtil.ts +60 -60
  52. package/src/utils/SwaggerComponentsExplorer.ts +43 -43
  53. package/src/utils/SwaggerTypeChecker.ts +67 -67
  54. package/src/utils/openapi-down-convert/RefVisitor.ts +139 -139
  55. package/src/utils/openapi-down-convert/converter.ts +527 -527
@@ -1,51 +1,51 @@
1
- import { ISwaggerSchema } from "./ISwaggerSchema";
2
-
3
- export interface IMigrateRoute {
4
- name: string;
5
- originalPath: string;
6
- path: string;
7
- method: string;
8
- accessor: string[];
9
- parameters: IMigrateRoute.IParameter[];
10
- headers: IMigrateRoute.IHeaders | null;
11
- query: IMigrateRoute.IQuery | null;
12
- body: IMigrateRoute.IBody | null;
13
- success: IMigrateRoute.IBody | null;
14
- exceptions: Record<string, IMigrateRoute.IException>;
15
- comment: () => string;
16
- tags: string[];
17
- deprecated: boolean;
18
- }
19
- export namespace IMigrateRoute {
20
- export interface IParameter {
21
- name: string;
22
- key: string;
23
- schema: ISwaggerSchema;
24
- description?: string;
25
- }
26
- export interface IHeaders {
27
- name: string;
28
- key: string;
29
- schema: ISwaggerSchema;
30
- }
31
- export interface IQuery {
32
- name: string;
33
- key: string;
34
- schema: ISwaggerSchema;
35
- }
36
- export interface IBody {
37
- name: string;
38
- key: string;
39
- type:
40
- | "text/plain"
41
- | "application/json"
42
- | "application/x-www-form-urlencoded"
43
- | "multipart/form-data";
44
- schema: ISwaggerSchema;
45
- "x-nestia-encrypted"?: boolean;
46
- }
47
- export interface IException {
48
- description?: string;
49
- schema: ISwaggerSchema;
50
- }
51
- }
1
+ import { ISwaggerSchema } from "./ISwaggerSchema";
2
+
3
+ export interface IMigrateRoute {
4
+ name: string;
5
+ originalPath: string;
6
+ path: string;
7
+ method: string;
8
+ accessor: string[];
9
+ parameters: IMigrateRoute.IParameter[];
10
+ headers: IMigrateRoute.IHeaders | null;
11
+ query: IMigrateRoute.IQuery | null;
12
+ body: IMigrateRoute.IBody | null;
13
+ success: IMigrateRoute.IBody | null;
14
+ exceptions: Record<string, IMigrateRoute.IException>;
15
+ comment: () => string;
16
+ tags: string[];
17
+ deprecated: boolean;
18
+ }
19
+ export namespace IMigrateRoute {
20
+ export interface IParameter {
21
+ name: string;
22
+ key: string;
23
+ schema: ISwaggerSchema;
24
+ description?: string;
25
+ }
26
+ export interface IHeaders {
27
+ name: string;
28
+ key: string;
29
+ schema: ISwaggerSchema;
30
+ }
31
+ export interface IQuery {
32
+ name: string;
33
+ key: string;
34
+ schema: ISwaggerSchema;
35
+ }
36
+ export interface IBody {
37
+ name: string;
38
+ key: string;
39
+ type:
40
+ | "text/plain"
41
+ | "application/json"
42
+ | "application/x-www-form-urlencoded"
43
+ | "multipart/form-data";
44
+ schema: ISwaggerSchema;
45
+ "x-nestia-encrypted"?: boolean;
46
+ }
47
+ export interface IException {
48
+ description?: string;
49
+ schema: ISwaggerSchema;
50
+ }
51
+ }
@@ -1,23 +1,23 @@
1
- import { ISwaggerComponents } from "./ISwaggerComponents";
2
- import { ISwaggerInfo } from "./ISwaggerInfo";
3
- import { ISwaggerRoute } from "./ISwaggerRoute";
4
-
5
- export interface ISwagger {
6
- openapi: `3.0.${number}`;
7
- info: ISwaggerInfo;
8
- servers: ISwagger.IServer[];
9
-
10
- components: ISwaggerComponents;
11
- paths: Record<string, ISwagger.IPath>;
12
- security?: Record<string, string[]>[];
13
- }
14
- export namespace ISwagger {
15
- export interface IServer {
16
- url: string;
17
- description?: string;
18
- }
19
- export type IPath = Record<
20
- "get" | "post" | "patch" | "put" | "delete",
21
- ISwaggerRoute | undefined
22
- >;
23
- }
1
+ import { ISwaggerComponents } from "./ISwaggerComponents";
2
+ import { ISwaggerInfo } from "./ISwaggerInfo";
3
+ import { ISwaggerRoute } from "./ISwaggerRoute";
4
+
5
+ export interface ISwagger {
6
+ openapi: `3.0.${number}`;
7
+ info: ISwaggerInfo;
8
+ servers: ISwagger.IServer[];
9
+
10
+ components: ISwaggerComponents;
11
+ paths: Record<string, ISwagger.IPath>;
12
+ security?: Record<string, string[]>[];
13
+ }
14
+ export namespace ISwagger {
15
+ export interface IServer {
16
+ url: string;
17
+ description?: string;
18
+ }
19
+ export type IPath = Record<
20
+ "get" | "post" | "patch" | "put" | "delete",
21
+ ISwaggerRoute | undefined
22
+ >;
23
+ }
@@ -1,14 +1,14 @@
1
- import { ISwaggerRouteParameter } from "./ISwaggerRouteParameter";
2
- import { ISwaggerRouteRequestBody } from "./ISwaggerRouteRequestBody";
3
- import { ISwaggerRouteResponse } from "./ISwaggerRouteResponse";
4
- import { ISwaggerSchema } from "./ISwaggerSchema";
5
- import { ISwaggerSecurityScheme } from "./ISwaggerSecurityScheme";
6
-
7
- export interface ISwaggerComponents {
8
- parameters?: Record<string, ISwaggerRouteParameter>;
9
- requestBodies?: Record<string, ISwaggerRouteRequestBody>;
10
- responses?: Record<string, ISwaggerRouteResponse>;
11
- schemas?: Record<string, ISwaggerSchema>;
12
- securitySchemes?: Record<string, ISwaggerSecurityScheme>;
13
- "x-nestia-namespace"?: string;
14
- }
1
+ import { ISwaggerRouteParameter } from "./ISwaggerRouteParameter";
2
+ import { ISwaggerRouteRequestBody } from "./ISwaggerRouteRequestBody";
3
+ import { ISwaggerRouteResponse } from "./ISwaggerRouteResponse";
4
+ import { ISwaggerSchema } from "./ISwaggerSchema";
5
+ import { ISwaggerSecurityScheme } from "./ISwaggerSecurityScheme";
6
+
7
+ export interface ISwaggerComponents {
8
+ parameters?: Record<string, ISwaggerRouteParameter>;
9
+ requestBodies?: Record<string, ISwaggerRouteRequestBody>;
10
+ responses?: Record<string, ISwaggerRouteResponse>;
11
+ schemas?: Record<string, ISwaggerSchema>;
12
+ securitySchemes?: Record<string, ISwaggerSecurityScheme>;
13
+ "x-nestia-namespace"?: string;
14
+ }
@@ -1,20 +1,20 @@
1
- import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
2
-
3
- import { ISwaggerRouteParameter } from "./ISwaggerRouteParameter";
4
- import { ISwaggerRouteRequestBody } from "./ISwaggerRouteRequestBody";
5
- import { ISwaggerRouteResponse } from "./ISwaggerRouteResponse";
6
-
7
- export interface ISwaggerRoute {
8
- parameters?: (ISwaggerRouteParameter | ISwaggerRouteParameter.IReference)[];
9
- requestBody?: ISwaggerRouteRequestBody;
10
- responses?: Record<
11
- string,
12
- ISwaggerRouteResponse | ISwaggerRouteResponse.IReference
13
- >;
14
- summary?: string;
15
- description?: string;
16
- deprecated?: boolean;
17
- security?: Record<string, string[]>[];
18
- tags?: string[];
19
- "x-nestia-jsDocTags"?: IJsDocTagInfo[];
20
- }
1
+ import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
2
+
3
+ import { ISwaggerRouteParameter } from "./ISwaggerRouteParameter";
4
+ import { ISwaggerRouteRequestBody } from "./ISwaggerRouteRequestBody";
5
+ import { ISwaggerRouteResponse } from "./ISwaggerRouteResponse";
6
+
7
+ export interface ISwaggerRoute {
8
+ parameters?: (ISwaggerRouteParameter | ISwaggerRouteParameter.IReference)[];
9
+ requestBody?: ISwaggerRouteRequestBody;
10
+ responses?: Record<
11
+ string,
12
+ ISwaggerRouteResponse | ISwaggerRouteResponse.IReference
13
+ >;
14
+ summary?: string;
15
+ description?: string;
16
+ deprecated?: boolean;
17
+ security?: Record<string, string[]>[];
18
+ tags?: string[];
19
+ "x-nestia-jsDocTags"?: IJsDocTagInfo[];
20
+ }
@@ -1,15 +1,15 @@
1
- import { ISwaggerSchema } from "./ISwaggerSchema";
2
-
3
- export interface ISwaggerRouteBodyContent {
4
- "text/plain"?: ISwaggerRouteBodyContent.IMediaType;
5
- "application/json"?: ISwaggerRouteBodyContent.IMediaType;
6
- "application/x-www-form-urlencoded"?: ISwaggerRouteBodyContent.IMediaType;
7
- "multipart/form-data"?: ISwaggerRouteBodyContent.IMediaType;
8
- "*/*"?: ISwaggerRouteBodyContent.IMediaType;
9
- }
10
- export namespace ISwaggerRouteBodyContent {
11
- export interface IMediaType {
12
- schema?: ISwaggerSchema;
13
- "x-nestia-encrypted"?: boolean;
14
- }
15
- }
1
+ import { ISwaggerSchema } from "./ISwaggerSchema";
2
+
3
+ export interface ISwaggerRouteBodyContent {
4
+ "text/plain"?: ISwaggerRouteBodyContent.IMediaType;
5
+ "application/json"?: ISwaggerRouteBodyContent.IMediaType;
6
+ "application/x-www-form-urlencoded"?: ISwaggerRouteBodyContent.IMediaType;
7
+ "multipart/form-data"?: ISwaggerRouteBodyContent.IMediaType;
8
+ "*/*"?: ISwaggerRouteBodyContent.IMediaType;
9
+ }
10
+ export namespace ISwaggerRouteBodyContent {
11
+ export interface IMediaType {
12
+ schema?: ISwaggerSchema;
13
+ "x-nestia-encrypted"?: boolean;
14
+ }
15
+ }
@@ -1,14 +1,14 @@
1
- import { ISwaggerSchema } from "./ISwaggerSchema";
2
-
3
- export interface ISwaggerRouteParameter {
4
- name?: string;
5
- in: "path" | "query" | "header" | "cookie";
6
- schema: ISwaggerSchema;
7
- required?: boolean;
8
- description?: string;
9
- }
10
- export namespace ISwaggerRouteParameter {
11
- export interface IReference {
12
- $ref: `#/components/parameters/${string}`;
13
- }
14
- }
1
+ import { ISwaggerSchema } from "./ISwaggerSchema";
2
+
3
+ export interface ISwaggerRouteParameter {
4
+ name?: string;
5
+ in: "path" | "query" | "header" | "cookie";
6
+ schema: ISwaggerSchema;
7
+ required?: boolean;
8
+ description?: string;
9
+ }
10
+ export namespace ISwaggerRouteParameter {
11
+ export interface IReference {
12
+ $ref: `#/components/parameters/${string}`;
13
+ }
14
+ }
@@ -1,12 +1,12 @@
1
- import { ISwaggerRouteBodyContent } from "./ISwaggerRouteBodyContent";
2
-
3
- export interface ISwaggerRouteRequestBody {
4
- description?: string;
5
- required?: boolean;
6
- content?: ISwaggerRouteBodyContent;
7
- }
8
- export namespace ISwaggerRouteRequestBody {
9
- export interface IReference {
10
- $ref: `#/components/requestBodies/${string}`;
11
- }
12
- }
1
+ import { ISwaggerRouteBodyContent } from "./ISwaggerRouteBodyContent";
2
+
3
+ export interface ISwaggerRouteRequestBody {
4
+ description?: string;
5
+ required?: boolean;
6
+ content?: ISwaggerRouteBodyContent;
7
+ }
8
+ export namespace ISwaggerRouteRequestBody {
9
+ export interface IReference {
10
+ $ref: `#/components/requestBodies/${string}`;
11
+ }
12
+ }
@@ -1,11 +1,11 @@
1
- import { ISwaggerRouteBodyContent } from "./ISwaggerRouteBodyContent";
2
-
3
- export interface ISwaggerRouteResponse {
4
- description?: string;
5
- content?: ISwaggerRouteBodyContent;
6
- }
7
- export namespace ISwaggerRouteResponse {
8
- export interface IReference {
9
- $ref: `#/components/responses/${string}`;
10
- }
11
- }
1
+ import { ISwaggerRouteBodyContent } from "./ISwaggerRouteBodyContent";
2
+
3
+ export interface ISwaggerRouteResponse {
4
+ description?: string;
5
+ content?: ISwaggerRouteBodyContent;
6
+ }
7
+ export namespace ISwaggerRouteResponse {
8
+ export interface IReference {
9
+ $ref: `#/components/responses/${string}`;
10
+ }
11
+ }
@@ -1,90 +1,90 @@
1
- export type ISwaggerSchema =
2
- | ISwaggerSchema.IUnknown
3
- | ISwaggerSchema.INullOnly
4
- | ISwaggerSchema.IAnyOf
5
- | ISwaggerSchema.IOneOf
6
- | ISwaggerSchema.IBoolean
7
- | ISwaggerSchema.IInteger
8
- | ISwaggerSchema.INumber
9
- | ISwaggerSchema.IString
10
- | ISwaggerSchema.IArray
11
- | ISwaggerSchema.IObject
12
- | ISwaggerSchema.IReference;
13
- export namespace ISwaggerSchema {
14
- export interface IUnknown extends IAttribute {
15
- type?: undefined;
16
- }
17
- export interface INullOnly extends IAttribute {
18
- type: "null";
19
- }
20
-
21
- export interface IAnyOf extends IAttribute {
22
- anyOf: ISwaggerSchema[];
23
- }
24
- export interface IOneOf extends IAttribute {
25
- oneOf: ISwaggerSchema[];
26
- }
27
-
28
- export interface IBoolean extends ISignificant<"boolean"> {
29
- default?: boolean;
30
- enum?: boolean[];
31
- }
32
- export interface IInteger extends ISignificant<"integer"> {
33
- /** @type int */ default?: number;
34
- /** @type int */ enum?: number[];
35
- /** @type int */ minimum?: number;
36
- /** @type int */ maximum?: number;
37
- /** @type int */ exclusiveMinimum?: boolean;
38
- /** @type int */ exclusiveMaximum?: boolean;
39
- /** @type uint */ multipleOf?: number;
40
- }
41
- export interface INumber extends ISignificant<"number"> {
42
- default?: number;
43
- enum?: number[];
44
- minimum?: number;
45
- maximum?: number;
46
- exclusiveMinimum?: boolean;
47
- exclusiveMaximum?: boolean;
48
- multipleOf?: number;
49
- }
50
- export interface IString extends ISignificant<"string"> {
51
- default?: string;
52
- enum?: string[];
53
- format?: string;
54
- pattern?: string;
55
- /** @type uint */ minLength?: number;
56
- /** @type uint */ maxLength?: number;
57
- }
58
-
59
- export interface IArray extends ISignificant<"array"> {
60
- items: ISwaggerSchema;
61
- /** @type uint */ minItems?: number;
62
- /** @type uint */ maxItems?: number;
63
- "x-typia-tuple"?: ITuple;
64
- }
65
- export interface ITuple extends ISignificant<"array"> {
66
- items: ISwaggerSchema[];
67
- }
68
- export interface IObject extends ISignificant<"object"> {
69
- properties?: Record<string, ISwaggerSchema>;
70
- required?: string[];
71
- additionalProperties?: ISwaggerSchema | boolean;
72
- "x-typia-patternProperties"?: Record<string, ISwaggerSchema>;
73
- }
74
-
75
- export interface IReference extends IAttribute {
76
- $ref: string;
77
- }
78
-
79
- interface ISignificant<Type extends string> extends IAttribute {
80
- type: Type;
81
- nullable?: boolean;
82
- }
83
- interface IAttribute {
84
- title?: string;
85
- description?: string;
86
- deprecated?: boolean;
87
- "x-typia-optional"?: boolean;
88
- "x-typia-rest"?: boolean;
89
- }
90
- }
1
+ export type ISwaggerSchema =
2
+ | ISwaggerSchema.IUnknown
3
+ | ISwaggerSchema.INullOnly
4
+ | ISwaggerSchema.IAnyOf
5
+ | ISwaggerSchema.IOneOf
6
+ | ISwaggerSchema.IBoolean
7
+ | ISwaggerSchema.IInteger
8
+ | ISwaggerSchema.INumber
9
+ | ISwaggerSchema.IString
10
+ | ISwaggerSchema.IArray
11
+ | ISwaggerSchema.IObject
12
+ | ISwaggerSchema.IReference;
13
+ export namespace ISwaggerSchema {
14
+ export interface IUnknown extends IAttribute {
15
+ type?: undefined;
16
+ }
17
+ export interface INullOnly extends IAttribute {
18
+ type: "null";
19
+ }
20
+
21
+ export interface IAnyOf extends IAttribute {
22
+ anyOf: ISwaggerSchema[];
23
+ }
24
+ export interface IOneOf extends IAttribute {
25
+ oneOf: ISwaggerSchema[];
26
+ }
27
+
28
+ export interface IBoolean extends ISignificant<"boolean"> {
29
+ default?: boolean;
30
+ enum?: boolean[];
31
+ }
32
+ export interface IInteger extends ISignificant<"integer"> {
33
+ /** @type int */ default?: number;
34
+ /** @type int */ enum?: number[];
35
+ /** @type int */ minimum?: number;
36
+ /** @type int */ maximum?: number;
37
+ /** @type int */ exclusiveMinimum?: boolean;
38
+ /** @type int */ exclusiveMaximum?: boolean;
39
+ /** @type uint */ multipleOf?: number;
40
+ }
41
+ export interface INumber extends ISignificant<"number"> {
42
+ default?: number;
43
+ enum?: number[];
44
+ minimum?: number;
45
+ maximum?: number;
46
+ exclusiveMinimum?: boolean;
47
+ exclusiveMaximum?: boolean;
48
+ multipleOf?: number;
49
+ }
50
+ export interface IString extends ISignificant<"string"> {
51
+ default?: string;
52
+ enum?: string[];
53
+ format?: string;
54
+ pattern?: string;
55
+ /** @type uint */ minLength?: number;
56
+ /** @type uint */ maxLength?: number;
57
+ }
58
+
59
+ export interface IArray extends ISignificant<"array"> {
60
+ items: ISwaggerSchema;
61
+ /** @type uint */ minItems?: number;
62
+ /** @type uint */ maxItems?: number;
63
+ "x-typia-tuple"?: ITuple;
64
+ }
65
+ export interface ITuple extends ISignificant<"array"> {
66
+ items: ISwaggerSchema[];
67
+ }
68
+ export interface IObject extends ISignificant<"object"> {
69
+ properties?: Record<string, ISwaggerSchema>;
70
+ required?: string[];
71
+ additionalProperties?: ISwaggerSchema | boolean;
72
+ "x-typia-patternProperties"?: Record<string, ISwaggerSchema>;
73
+ }
74
+
75
+ export interface IReference extends IAttribute {
76
+ $ref: string;
77
+ }
78
+
79
+ interface ISignificant<Type extends string> extends IAttribute {
80
+ type: Type;
81
+ nullable?: boolean;
82
+ }
83
+ interface IAttribute {
84
+ title?: string;
85
+ description?: string;
86
+ deprecated?: boolean;
87
+ "x-typia-optional"?: boolean;
88
+ "x-typia-rest"?: boolean;
89
+ }
90
+ }
@@ -1,47 +1,47 @@
1
- export type ISwaggerSecurityScheme =
2
- | ISwaggerSecurityScheme.IHttpBasic
3
- | ISwaggerSecurityScheme.IHttpBearer
4
- | ISwaggerSecurityScheme.IApiKey
5
- | ISwaggerSecurityScheme.IOpenId
6
- | ISwaggerSecurityScheme.IOAuth2;
7
- export namespace ISwaggerSecurityScheme {
8
- export interface IHttpBasic {
9
- type: "http";
10
- scheme: "basic";
11
- }
12
- export interface IHttpBearer {
13
- type: "http";
14
- scheme: "bearer";
15
- bearerFormat?: string;
16
- }
17
- export interface IApiKey {
18
- type: "apiKey";
19
- in?: "header" | "query" | "cookie";
20
- name?: string;
21
- }
22
-
23
- export interface IOpenId {
24
- type: "openIdConnect";
25
- openIdConnectUrl: string;
26
- }
27
-
28
- export interface IOAuth2 {
29
- type: "oauth2";
30
- flows: IOAuth2.IFlowSet;
31
- description?: string;
32
- }
33
- export namespace IOAuth2 {
34
- export interface IFlowSet {
35
- authorizationCode?: IFlow;
36
- implicit?: Omit<IFlow, "tokenUrl">;
37
- password?: Omit<IFlow, "authorizationUrl">;
38
- clientCredentials?: Omit<IFlow, "authorizationUrl">;
39
- }
40
- export interface IFlow {
41
- authorizationUrl: string;
42
- tokenUrl?: string;
43
- refreshUrl?: string;
44
- scopes?: Record<string, string>;
45
- }
46
- }
47
- }
1
+ export type ISwaggerSecurityScheme =
2
+ | ISwaggerSecurityScheme.IHttpBasic
3
+ | ISwaggerSecurityScheme.IHttpBearer
4
+ | ISwaggerSecurityScheme.IApiKey
5
+ | ISwaggerSecurityScheme.IOpenId
6
+ | ISwaggerSecurityScheme.IOAuth2;
7
+ export namespace ISwaggerSecurityScheme {
8
+ export interface IHttpBasic {
9
+ type: "http";
10
+ scheme: "basic";
11
+ }
12
+ export interface IHttpBearer {
13
+ type: "http";
14
+ scheme: "bearer";
15
+ bearerFormat?: string;
16
+ }
17
+ export interface IApiKey {
18
+ type: "apiKey";
19
+ in?: "header" | "query" | "cookie";
20
+ name?: string;
21
+ }
22
+
23
+ export interface IOpenId {
24
+ type: "openIdConnect";
25
+ openIdConnectUrl: string;
26
+ }
27
+
28
+ export interface IOAuth2 {
29
+ type: "oauth2";
30
+ flows: IOAuth2.IFlowSet;
31
+ description?: string;
32
+ }
33
+ export namespace IOAuth2 {
34
+ export interface IFlowSet {
35
+ authorizationCode?: IFlow;
36
+ implicit?: Omit<IFlow, "tokenUrl">;
37
+ password?: Omit<IFlow, "authorizationUrl">;
38
+ clientCredentials?: Omit<IFlow, "authorizationUrl">;
39
+ }
40
+ export interface IFlow {
41
+ authorizationUrl: string;
42
+ tokenUrl?: string;
43
+ refreshUrl?: string;
44
+ scopes?: Record<string, string>;
45
+ }
46
+ }
47
+ }
@@ -1,10 +1,10 @@
1
- import { OpenAPIV2 } from "openapi-types";
2
-
3
- export interface ISwaggerV20
4
- extends Omit<OpenAPIV2.Document, "swagger">,
5
- ISwaggerV20.IVersion {}
6
- export namespace ISwaggerV20 {
7
- export interface IVersion {
8
- swagger: "2.0";
9
- }
10
- }
1
+ import { OpenAPIV2 } from "openapi-types";
2
+
3
+ export interface ISwaggerV20
4
+ extends Omit<OpenAPIV2.Document, "swagger">,
5
+ ISwaggerV20.IVersion {}
6
+ export namespace ISwaggerV20 {
7
+ export interface IVersion {
8
+ swagger: "2.0";
9
+ }
10
+ }
@@ -1,10 +1,10 @@
1
- import { OpenAPIV3_1 } from "openapi-types";
2
-
3
- export interface ISwaggerV31 extends Omit<OpenAPIV3_1.Document, "openapi"> {
4
- openapi: `3.1.${number}`;
5
- }
6
- export namespace ISwaggerV31 {
7
- export interface IVersion {
8
- openapi: `3.1.${number}`;
9
- }
10
- }
1
+ import { OpenAPIV3_1 } from "openapi-types";
2
+
3
+ export interface ISwaggerV31 extends Omit<OpenAPIV3_1.Document, "openapi"> {
4
+ openapi: `3.1.${number}`;
5
+ }
6
+ export namespace ISwaggerV31 {
7
+ export interface IVersion {
8
+ openapi: `3.1.${number}`;
9
+ }
10
+ }