@nestia/migrate 0.5.1 → 0.6.1

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 (103) hide show
  1. package/lib/{NestiaMigrateApplication.d.ts → MigrateApplication.d.ts} +1 -1
  2. package/lib/{NestiaMigrateApplication.js → MigrateApplication.js} +38 -32
  3. package/lib/MigrateApplication.js.map +1 -0
  4. package/lib/analyzers/ControllerAnalyzer.d.ts +5 -0
  5. package/lib/{programmers/ControllerProgrammer.js → analyzers/ControllerAnalyzer.js} +8 -32
  6. package/lib/analyzers/ControllerAnalyzer.js.map +1 -0
  7. package/lib/analyzers/MethodAnalyzer.d.ts +9 -0
  8. package/lib/{programmers/RouteProgrammer.js → analyzers/MethodAnalyzer.js} +30 -134
  9. package/lib/analyzers/MethodAnalyzer.js.map +1 -0
  10. package/lib/analyzers/MigrateAnalyzer.d.ts +4 -0
  11. package/lib/analyzers/MigrateAnalyzer.js +12 -0
  12. package/lib/analyzers/MigrateAnalyzer.js.map +1 -0
  13. package/lib/analyzers/RouteAnalyzer.d.ts +0 -0
  14. package/lib/analyzers/RouteAnalyzer.js +2 -0
  15. package/lib/analyzers/RouteAnalyzer.js.map +1 -0
  16. package/lib/archivers/FileArchiver.js.map +1 -1
  17. package/lib/bundles/TEMPLATE.js +10 -10
  18. package/lib/bundles/TEMPLATE.js.map +1 -1
  19. package/lib/executable/bundle.js.map +1 -1
  20. package/lib/executable/migrate.js +7 -7
  21. package/lib/executable/migrate.js.map +1 -1
  22. package/lib/module.d.ts +1 -1
  23. package/lib/module.js +1 -1
  24. package/lib/module.js.map +1 -1
  25. package/lib/programmers/DtoProgrammer.d.ts +8 -4
  26. package/lib/programmers/DtoProgrammer.js +36 -77
  27. package/lib/programmers/DtoProgrammer.js.map +1 -1
  28. package/lib/programmers/ImportProgrammer.d.ts +5 -5
  29. package/lib/programmers/ImportProgrammer.js +27 -19
  30. package/lib/programmers/ImportProgrammer.js.map +1 -1
  31. package/lib/programmers/{ControllerProgrammer.d.ts → NestControllerProgrammer.d.ts} +3 -4
  32. package/lib/programmers/NestControllerProgrammer.js +30 -0
  33. package/lib/programmers/NestControllerProgrammer.js.map +1 -0
  34. package/lib/programmers/NestMethodProgrammer.d.ts +7 -0
  35. package/lib/programmers/NestMethodProgrammer.js +103 -0
  36. package/lib/programmers/NestMethodProgrammer.js.map +1 -0
  37. package/lib/programmers/NestModuleProgrammer.d.ts +5 -0
  38. package/lib/programmers/NestModuleProgrammer.js +29 -0
  39. package/lib/programmers/NestModuleProgrammer.js.map +1 -0
  40. package/lib/programmers/NestProgrammer.d.ts +5 -0
  41. package/lib/programmers/NestProgrammer.js +60 -0
  42. package/lib/programmers/NestProgrammer.js.map +1 -0
  43. package/lib/programmers/SchemaProgrammer.d.ts +2 -1
  44. package/lib/programmers/SchemaProgrammer.js +122 -189
  45. package/lib/programmers/SchemaProgrammer.js.map +1 -1
  46. package/lib/structures/IMigrateProgram.d.ts +2 -2
  47. package/lib/structures/ISwaggerInfo.d.ts +3 -3
  48. package/lib/utils/FilePrinter.d.ts +9 -0
  49. package/lib/utils/FilePrinter.js +25 -0
  50. package/lib/utils/FilePrinter.js.map +1 -0
  51. package/lib/utils/JsonTypeChecker.d.ts +3 -1
  52. package/lib/utils/JsonTypeChecker.js +31 -18
  53. package/lib/utils/JsonTypeChecker.js.map +1 -1
  54. package/lib/utils/MapUtil.js.map +1 -1
  55. package/lib/utils/SetupWizard.js.map +1 -1
  56. package/lib/utils/StringUtil.js.map +1 -1
  57. package/package.json +8 -6
  58. package/src/MigrateApplication.ts +73 -0
  59. package/src/analyzers/ControllerAnalyzer.ts +107 -0
  60. package/src/analyzers/MethodAnalyzer.ts +315 -0
  61. package/src/analyzers/MigrateAnalyzer.ts +9 -0
  62. package/src/analyzers/RouteAnalyzer.ts +0 -0
  63. package/src/archivers/FileArchiver.ts +35 -38
  64. package/src/bundles/TEMPLATE.ts +10 -10
  65. package/src/executable/bundle.ts +72 -78
  66. package/src/executable/migrate.ts +59 -60
  67. package/src/index.ts +4 -4
  68. package/src/module.ts +4 -4
  69. package/src/programmers/DtoProgrammer.ts +74 -118
  70. package/src/programmers/ImportProgrammer.ts +98 -60
  71. package/src/programmers/NestControllerProgrammer.ts +47 -0
  72. package/src/programmers/NestMethodProgrammer.ts +211 -0
  73. package/src/programmers/NestModuleProgrammer.ts +62 -0
  74. package/src/programmers/NestProgrammer.ts +74 -0
  75. package/src/programmers/SchemaProgrammer.ts +247 -339
  76. package/src/structures/IMigrateController.ts +8 -8
  77. package/src/structures/IMigrateDto.ts +8 -8
  78. package/src/structures/IMigrateFile.ts +5 -5
  79. package/src/structures/IMigrateProgram.ts +7 -7
  80. package/src/structures/IMigrateRoute.ts +36 -36
  81. package/src/structures/IMigrateSchema.ts +4 -4
  82. package/src/structures/ISwaggeSchema.ts +82 -82
  83. package/src/structures/ISwagger.ts +20 -20
  84. package/src/structures/ISwaggerComponents.ts +7 -7
  85. package/src/structures/ISwaggerInfo.ts +57 -57
  86. package/src/structures/ISwaggerRoute.ts +52 -52
  87. package/src/structures/ISwaggerSecurity.ts +47 -47
  88. package/src/utils/FilePrinter.ts +36 -0
  89. package/src/utils/JsonTypeChecker.ts +67 -52
  90. package/src/utils/MapUtil.ts +13 -13
  91. package/src/utils/SetupWizard.ts +15 -15
  92. package/src/utils/StringUtil.ts +51 -51
  93. package/lib/NestiaMigrateApplication.js.map +0 -1
  94. package/lib/programmers/ControllerProgrammer.js.map +0 -1
  95. package/lib/programmers/MigrateProgrammer.d.ts +0 -8
  96. package/lib/programmers/MigrateProgrammer.js +0 -48
  97. package/lib/programmers/MigrateProgrammer.js.map +0 -1
  98. package/lib/programmers/RouteProgrammer.d.ts +0 -13
  99. package/lib/programmers/RouteProgrammer.js.map +0 -1
  100. package/src/NestiaMigrateApplication.ts +0 -73
  101. package/src/programmers/ControllerProgrammer.ts +0 -157
  102. package/src/programmers/MigrateProgrammer.ts +0 -62
  103. package/src/programmers/RouteProgrammer.ts +0 -506
@@ -1,7 +1,7 @@
1
- import { IMigrateController } from "./IMigrateController";
2
- import { IMigrateDto } from "./IMigrateDto";
3
-
4
- export interface IMigrateProgram {
5
- controllers: IMigrateController[];
6
- structures: IMigrateDto[];
7
- }
1
+ import { IMigrateController } from "./IMigrateController";
2
+ import { ISwagger } from "./ISwagger";
3
+
4
+ export interface IMigrateProgram {
5
+ controllers: IMigrateController[];
6
+ swagger: ISwagger;
7
+ }
@@ -1,36 +1,36 @@
1
- import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
2
-
3
- import { ISwaggerSchema } from "./ISwaggeSchema";
4
-
5
- export interface IMigrateRoute {
6
- name: string;
7
- path: string;
8
- method: string;
9
- parameters: IMigrateRoute.IParameter[];
10
- headers: ISwaggerSchema | null;
11
- query: ISwaggerSchema | null;
12
- body: IMigrateRoute.IBody | null;
13
- success: IMigrateRoute.IBody | null;
14
- exceptions: Record<string, IMigrateRoute.IException>;
15
- description?: string;
16
- "x-nestia-jsDocTags"?: IJsDocTagInfo[];
17
- }
18
- export namespace IMigrateRoute {
19
- export interface IParameter {
20
- key: string;
21
- schema: ISwaggerSchema;
22
- description?: string;
23
- }
24
- export interface IBody {
25
- type:
26
- | "text/plain"
27
- | "application/json"
28
- | "application/x-www-form-urlencoded";
29
- schema: ISwaggerSchema;
30
- "x-nestia-encrypted"?: boolean;
31
- }
32
- export interface IException {
33
- description?: string;
34
- schema: ISwaggerSchema;
35
- }
36
- }
1
+ import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
2
+
3
+ import { ISwaggerSchema } from "./ISwaggeSchema";
4
+
5
+ export interface IMigrateRoute {
6
+ name: string;
7
+ path: string;
8
+ method: string;
9
+ parameters: IMigrateRoute.IParameter[];
10
+ headers: ISwaggerSchema | null;
11
+ query: ISwaggerSchema | null;
12
+ body: IMigrateRoute.IBody | null;
13
+ success: IMigrateRoute.IBody | null;
14
+ exceptions: Record<string, IMigrateRoute.IException>;
15
+ description?: string;
16
+ "x-nestia-jsDocTags"?: IJsDocTagInfo[];
17
+ }
18
+ export namespace IMigrateRoute {
19
+ export interface IParameter {
20
+ key: string;
21
+ schema: ISwaggerSchema;
22
+ description?: string;
23
+ }
24
+ export interface IBody {
25
+ type:
26
+ | "text/plain"
27
+ | "application/json"
28
+ | "application/x-www-form-urlencoded";
29
+ schema: ISwaggerSchema;
30
+ "x-nestia-encrypted"?: boolean;
31
+ }
32
+ export interface IException {
33
+ description?: string;
34
+ schema: ISwaggerSchema;
35
+ }
36
+ }
@@ -1,4 +1,4 @@
1
- export interface IMigrateSchema {
2
- name: string;
3
- children: IMigrateSchema[];
4
- }
1
+ export interface IMigrateSchema {
2
+ name: string;
3
+ children: IMigrateSchema[];
4
+ }
@@ -1,90 +1,90 @@
1
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;
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
13
  export namespace ISwaggerSchema {
14
- export interface IUnknown extends IAttribute {
15
- type?: undefined;
16
- }
17
- export interface INullOnly extends IAttribute {
18
- type: "null";
19
- }
14
+ export interface IUnknown extends IAttribute {
15
+ type?: undefined;
16
+ }
17
+ export interface INullOnly extends IAttribute {
18
+ type: "null";
19
+ }
20
20
 
21
- export interface IAnyOf extends IAttribute {
22
- anyOf: ISwaggerSchema[];
23
- }
24
- export interface IOneOf extends IAttribute {
25
- oneOf: ISwaggerSchema[];
26
- }
21
+ export interface IAnyOf extends IAttribute {
22
+ anyOf: ISwaggerSchema[];
23
+ }
24
+ export interface IOneOf extends IAttribute {
25
+ oneOf: ISwaggerSchema[];
26
+ }
27
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
- }
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
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
- }
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
74
 
75
- export interface IReference extends IAttribute {
76
- $ref: string;
77
- }
75
+ export interface IReference extends IAttribute {
76
+ $ref: string;
77
+ }
78
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
- }
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
90
  }
@@ -1,20 +1,20 @@
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<string, ISwaggerRoute>;
20
- }
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<string, ISwaggerRoute>;
20
+ }
@@ -1,7 +1,7 @@
1
- import { ISwaggerSchema } from "./ISwaggeSchema";
2
- import { ISwaggerSecurity } from "./ISwaggerSecurity";
3
-
4
- export interface ISwaggerComponents {
5
- schemas?: Record<string, ISwaggerSchema>;
6
- securitySchemes?: Record<string, ISwaggerSecurity>;
7
- }
1
+ import { ISwaggerSchema } from "./ISwaggeSchema";
2
+ import { ISwaggerSecurity } from "./ISwaggerSecurity";
3
+
4
+ export interface ISwaggerComponents {
5
+ schemas?: Record<string, ISwaggerSchema>;
6
+ securitySchemes?: Record<string, ISwaggerSecurity>;
7
+ }
@@ -4,77 +4,77 @@
4
4
  * @author Samchon
5
5
  */
6
6
  export interface ISwaggerInfo {
7
- /**
8
- * The title of the API.
9
- */
10
- title: string;
7
+ /**
8
+ * The title of the API.
9
+ */
10
+ title: string;
11
11
 
12
- /**
13
- * A short description of the API.
14
- */
15
- description?: string;
12
+ /**
13
+ * A short description of the API.
14
+ */
15
+ description?: string;
16
16
 
17
- /**
18
- * A URL to the Terms of Service for the API.
19
- *
20
- * @format url
21
- */
22
- termsOfService?: string;
17
+ /**
18
+ * A URL to the Terms of Service for the API.
19
+ *
20
+ * @format uri
21
+ */
22
+ termsOfService?: string;
23
+
24
+ /**
25
+ * The contact information for the exposed API.
26
+ */
27
+ contact?: ISwaggerInfo.IContact;
23
28
 
29
+ /**
30
+ * The license information for the exposed API.
31
+ */
32
+ license?: ISwaggerInfo.ILicense;
33
+
34
+ /**
35
+ * Version of the API.
36
+ */
37
+ version: string;
38
+ }
39
+ export namespace ISwaggerInfo {
40
+ /**
41
+ * Contact information for the exposed API.
42
+ */
43
+ export interface IContact {
24
44
  /**
25
- * The contact information for the exposed API.
45
+ * The identifying name of the contact person/organization.
26
46
  */
27
- contact?: ISwaggerInfo.IContact;
47
+ name?: string;
28
48
 
29
49
  /**
30
- * The license information for the exposed API.
50
+ * The URL pointing to the contact information.
51
+ *
52
+ * @format uri
31
53
  */
32
- license?: ISwaggerInfo.ILicense;
54
+ url?: string;
33
55
 
34
56
  /**
35
- * Version of the API.
57
+ * The email address of the contact person/organization.
58
+ *
59
+ * @format email
36
60
  */
37
- version: string;
38
- }
39
- export namespace ISwaggerInfo {
61
+ email?: string;
62
+ }
63
+
64
+ /**
65
+ * License information for the exposed API.
66
+ */
67
+ export interface ILicense {
40
68
  /**
41
- * Contact information for the exposed API.
69
+ * The license name used for the API.
42
70
  */
43
- export interface IContact {
44
- /**
45
- * The identifying name of the contact person/organization.
46
- */
47
- name?: string;
48
-
49
- /**
50
- * The URL pointing to the contact information.
51
- *
52
- * @format url
53
- */
54
- url?: string;
55
-
56
- /**
57
- * The email address of the contact person/organization.
58
- *
59
- * @format email
60
- */
61
- email?: string;
62
- }
71
+ name: string;
63
72
 
64
73
  /**
65
- * License information for the exposed API.
74
+ * A URL to the license used for the API.
75
+ *
76
+ * @format uri
66
77
  */
67
- export interface ILicense {
68
- /**
69
- * The license name used for the API.
70
- */
71
- name: string;
72
-
73
- /**
74
- * A URL to the license used for the API.
75
- *
76
- * @format url
77
- */
78
- url?: string;
79
- }
78
+ url?: string;
79
+ }
80
80
  }
@@ -1,52 +1,52 @@
1
- import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
2
-
3
- import { ISwaggerSchema } from "./ISwaggeSchema";
4
-
5
- export interface ISwaggerRoute {
6
- parameters?: ISwaggerRoute.IParameter[];
7
- requestBody?: ISwaggerRoute.IRequestBody;
8
- responses?: ISwaggerRoute.IResponseBody;
9
- summary?: string;
10
- description?: string;
11
- deprecated?: boolean;
12
- security?: Record<string, string[]>[];
13
- tags?: string[];
14
- "x-nestia-jsDocTags"?: IJsDocTagInfo[];
15
- }
16
- export namespace ISwaggerRoute {
17
- export interface IParameter {
18
- name?: string;
19
- in: "path" | "query" | "header" | "cookie";
20
- schema: ISwaggerSchema;
21
- required?: boolean;
22
- description?: string;
23
- }
24
- export interface IRequestBody {
25
- description?: string;
26
- content: IContent;
27
- required?: boolean;
28
- "x-nestia-encrypted"?: boolean;
29
- }
30
- export type IResponseBody = Record<
31
- string,
32
- {
33
- description?: string;
34
- content?: IContent;
35
- "x-nestia-encrypted"?: boolean;
36
- }
37
- >;
38
- export interface IContent {
39
- "text/plain"?: {
40
- schema: ISwaggerSchema;
41
- };
42
- "application/json"?: {
43
- schema: ISwaggerSchema;
44
- };
45
- "application/x-www-form-urlencoded"?: {
46
- schema: ISwaggerSchema;
47
- };
48
- "*/*"?: {
49
- schema: ISwaggerSchema;
50
- };
51
- }
52
- }
1
+ import { IJsDocTagInfo } from "typia/lib/schemas/metadata/IJsDocTagInfo";
2
+
3
+ import { ISwaggerSchema } from "./ISwaggeSchema";
4
+
5
+ export interface ISwaggerRoute {
6
+ parameters?: ISwaggerRoute.IParameter[];
7
+ requestBody?: ISwaggerRoute.IRequestBody;
8
+ responses?: ISwaggerRoute.IResponseBody;
9
+ summary?: string;
10
+ description?: string;
11
+ deprecated?: boolean;
12
+ security?: Record<string, string[]>[];
13
+ tags?: string[];
14
+ "x-nestia-jsDocTags"?: IJsDocTagInfo[];
15
+ }
16
+ export namespace ISwaggerRoute {
17
+ export interface IParameter {
18
+ name?: string;
19
+ in: "path" | "query" | "header" | "cookie";
20
+ schema: ISwaggerSchema;
21
+ required?: boolean;
22
+ description?: string;
23
+ }
24
+ export interface IRequestBody {
25
+ description?: string;
26
+ content: IContent;
27
+ required?: boolean;
28
+ "x-nestia-encrypted"?: boolean;
29
+ }
30
+ export type IResponseBody = Record<
31
+ string,
32
+ {
33
+ description?: string;
34
+ content?: IContent;
35
+ "x-nestia-encrypted"?: boolean;
36
+ }
37
+ >;
38
+ export interface IContent {
39
+ "text/plain"?: {
40
+ schema: ISwaggerSchema;
41
+ };
42
+ "application/json"?: {
43
+ schema: ISwaggerSchema;
44
+ };
45
+ "application/x-www-form-urlencoded"?: {
46
+ schema: ISwaggerSchema;
47
+ };
48
+ "*/*"?: {
49
+ schema: ISwaggerSchema;
50
+ };
51
+ }
52
+ }
@@ -1,47 +1,47 @@
1
- export type ISwaggerSecurity =
2
- | ISwaggerSecurity.IHttpBasic
3
- | ISwaggerSecurity.IHttpBearer
4
- | ISwaggerSecurity.IApiKey
5
- | ISwaggerSecurity.IOpenId
6
- | ISwaggerSecurity.IOAuth2;
7
- export namespace ISwaggerSecurity {
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 ISwaggerSecurity =
2
+ | ISwaggerSecurity.IHttpBasic
3
+ | ISwaggerSecurity.IHttpBearer
4
+ | ISwaggerSecurity.IApiKey
5
+ | ISwaggerSecurity.IOpenId
6
+ | ISwaggerSecurity.IOAuth2;
7
+ export namespace ISwaggerSecurity {
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
+ }