@nestia/sdk 2.4.2 → 2.4.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.
Files changed (111) hide show
  1. package/lib/NestiaSdkApplication.js +2 -6
  2. package/lib/NestiaSdkApplication.js.map +1 -1
  3. package/lib/analyses/AccessorAnalyzer.js.map +1 -1
  4. package/lib/analyses/ConfigAnalyzer.js +4 -8
  5. package/lib/analyses/ConfigAnalyzer.js.map +1 -1
  6. package/lib/analyses/ControllerAnalyzer.js +6 -8
  7. package/lib/analyses/ControllerAnalyzer.js.map +1 -1
  8. package/lib/analyses/ExceptionAnalyzer.js.map +1 -1
  9. package/lib/analyses/GenericAnalyzer.js +1 -2
  10. package/lib/analyses/GenericAnalyzer.js.map +1 -1
  11. package/lib/analyses/ImportAnalyzer.js +4 -4
  12. package/lib/analyses/ImportAnalyzer.js.map +1 -1
  13. package/lib/analyses/PathAnalyzer.js.map +1 -1
  14. package/lib/analyses/ReflectAnalyzer.js +7 -8
  15. package/lib/analyses/ReflectAnalyzer.js.map +1 -1
  16. package/lib/analyses/SecurityAnalyzer.js.map +1 -1
  17. package/lib/executable/internal/CommandParser.js.map +1 -1
  18. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  19. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  20. package/lib/executable/sdk.js +11 -11
  21. package/lib/executable/sdk.js.map +1 -1
  22. package/lib/generates/E2eGenerator.js.map +1 -1
  23. package/lib/generates/SdkGenerator.js.map +1 -1
  24. package/lib/generates/SwaggerGenerator.js +5 -11
  25. package/lib/generates/SwaggerGenerator.js.map +1 -1
  26. package/lib/generates/internal/E2eFileProgrammer.js +2 -8
  27. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  28. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  29. package/lib/generates/internal/SdkDtoGenerator.js +3 -9
  30. package/lib/generates/internal/SdkDtoGenerator.js.map +1 -1
  31. package/lib/generates/internal/SdkFileProgrammer.js +4 -4
  32. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  33. package/lib/generates/internal/SdkFunctionProgrammer.js +12 -20
  34. package/lib/generates/internal/SdkFunctionProgrammer.js.map +1 -1
  35. package/lib/generates/internal/SdkImportWizard.js.map +1 -1
  36. package/lib/generates/internal/SdkRouteDirectory.js +1 -3
  37. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  38. package/lib/generates/internal/SdkSimulationProgrammer.js +5 -7
  39. package/lib/generates/internal/SdkSimulationProgrammer.js.map +1 -1
  40. package/lib/generates/internal/SdkTypeDefiner.js +2 -5
  41. package/lib/generates/internal/SdkTypeDefiner.js.map +1 -1
  42. package/lib/generates/internal/SwaggerSchemaGenerator.js +29 -44
  43. package/lib/generates/internal/SwaggerSchemaGenerator.js.map +1 -1
  44. package/lib/generates/internal/SwaggerSchemaValidator.js +3 -9
  45. package/lib/generates/internal/SwaggerSchemaValidator.js.map +1 -1
  46. package/lib/structures/MethodType.js +1 -7
  47. package/lib/structures/MethodType.js.map +1 -1
  48. package/lib/structures/TypeEntry.js.map +1 -1
  49. package/lib/utils/ArrayUtil.js.map +1 -1
  50. package/lib/utils/FileRetriever.js.map +1 -1
  51. package/lib/utils/ImportDictionary.js +1 -4
  52. package/lib/utils/ImportDictionary.js.map +1 -1
  53. package/lib/utils/MapUtil.js.map +1 -1
  54. package/lib/utils/PathUtil.js.map +1 -1
  55. package/lib/utils/SourceFinder.js.map +1 -1
  56. package/package.json +4 -7
  57. package/src/INestiaConfig.ts +234 -234
  58. package/src/NestiaSdkApplication.ts +253 -268
  59. package/src/analyses/AccessorAnalyzer.ts +60 -60
  60. package/src/analyses/ConfigAnalyzer.ts +147 -164
  61. package/src/analyses/ControllerAnalyzer.ts +379 -399
  62. package/src/analyses/ExceptionAnalyzer.ts +115 -124
  63. package/src/analyses/GenericAnalyzer.ts +51 -57
  64. package/src/analyses/ImportAnalyzer.ts +138 -159
  65. package/src/analyses/PathAnalyzer.ts +98 -100
  66. package/src/analyses/ReflectAnalyzer.ts +425 -433
  67. package/src/analyses/SecurityAnalyzer.ts +20 -20
  68. package/src/executable/internal/CommandParser.ts +15 -15
  69. package/src/executable/internal/NestiaConfigLoader.ts +67 -68
  70. package/src/executable/internal/NestiaSdkCommand.ts +60 -64
  71. package/src/executable/sdk.ts +73 -73
  72. package/src/generates/E2eGenerator.ts +64 -67
  73. package/src/generates/SdkGenerator.ts +96 -100
  74. package/src/generates/SwaggerGenerator.ts +372 -410
  75. package/src/generates/internal/E2eFileProgrammer.ts +123 -129
  76. package/src/generates/internal/SdkDistributionComposer.ts +91 -91
  77. package/src/generates/internal/SdkDtoGenerator.ts +424 -450
  78. package/src/generates/internal/SdkFileProgrammer.ts +106 -111
  79. package/src/generates/internal/SdkFunctionProgrammer.ts +466 -501
  80. package/src/generates/internal/SdkImportWizard.ts +55 -55
  81. package/src/generates/internal/SdkRouteDirectory.ts +17 -19
  82. package/src/generates/internal/SdkSimulationProgrammer.ts +133 -142
  83. package/src/generates/internal/SdkTypeDefiner.ts +119 -124
  84. package/src/generates/internal/SwaggerSchemaGenerator.ts +382 -401
  85. package/src/generates/internal/SwaggerSchemaValidator.ts +198 -210
  86. package/src/index.ts +4 -4
  87. package/src/module.ts +2 -2
  88. package/src/structures/IController.ts +79 -81
  89. package/src/structures/IErrorReport.ts +6 -6
  90. package/src/structures/INestiaProject.ts +13 -13
  91. package/src/structures/INormalizedInput.ts +20 -20
  92. package/src/structures/IRoute.ts +40 -41
  93. package/src/structures/ISwagger.ts +91 -91
  94. package/src/structures/ISwaggerComponents.ts +29 -29
  95. package/src/structures/ISwaggerError.ts +8 -8
  96. package/src/structures/ISwaggerInfo.ts +80 -80
  97. package/src/structures/ISwaggerLazyProperty.ts +7 -7
  98. package/src/structures/ISwaggerLazySchema.ts +7 -7
  99. package/src/structures/ISwaggerRoute.ts +51 -51
  100. package/src/structures/ISwaggerSecurityScheme.ts +65 -65
  101. package/src/structures/ITypeTuple.ts +6 -6
  102. package/src/structures/MethodType.ts +5 -11
  103. package/src/structures/ParamCategory.ts +1 -1
  104. package/src/structures/TypeEntry.ts +22 -22
  105. package/src/utils/ArrayUtil.ts +26 -26
  106. package/src/utils/FileRetriever.ts +22 -22
  107. package/src/utils/ImportDictionary.ts +125 -128
  108. package/src/utils/MapUtil.ts +14 -14
  109. package/src/utils/PathUtil.ts +10 -10
  110. package/src/utils/SourceFinder.ts +66 -70
  111. package/src/utils/StripEnums.ts +5 -10
@@ -1,210 +1,198 @@
1
- import { MetadataFactory } from "typia/lib/factories/MetadataFactory";
2
- import { Metadata } from "typia/lib/schemas/metadata/Metadata";
3
- import { MetadataArray } from "typia/lib/schemas/metadata/MetadataArray";
4
-
5
- export namespace SwaggerSchemaValidator {
6
- export const path = (meta: Metadata): string[] => {
7
- const errors: string[] = [];
8
- const insert = (msg: string) => errors.push(msg);
9
-
10
- if (meta.any) insert("do not allow any type");
11
- if (meta.isRequired() === false)
12
- insert("do not allow undefindable type");
13
-
14
- const atomics = CoreMetadataUtil.atomics(meta);
15
- const expected: number =
16
- meta.atomics.length +
17
- meta.templates.length +
18
- meta.constants
19
- .map((c) => c.values.length)
20
- .reduce((a, b) => a + b, 0);
21
- if (meta.size() !== expected || atomics.size === 0)
22
- insert("only atomic or constant types are allowed");
23
- if (atomics.size > 1) insert("do not allow union type");
24
-
25
- return errors;
26
- };
27
-
28
- export const query = (
29
- meta: Metadata,
30
- explore: MetadataFactory.IExplore,
31
- ): string[] => {
32
- const errors: string[] = [];
33
- const insert = (msg: string) => errors.push(msg);
34
-
35
- if (explore.top === true) {
36
- // TOP MUST BE ONLY OBJECT
37
- if (meta.objects.length !== 1 || meta.bucket() !== 1)
38
- insert("only one object type is allowed.");
39
- if (meta.nullable === true)
40
- insert("query parameters cannot be null.");
41
- if (meta.isRequired() === false)
42
- insert("query parameters cannot be undefined.");
43
- } else if (
44
- explore.nested !== null &&
45
- explore.nested instanceof MetadataArray
46
- ) {
47
- const atomics = CoreMetadataUtil.atomics(meta);
48
- const expected: number =
49
- meta.atomics.length +
50
- meta.templates.length +
51
- meta.constants
52
- .map((c) => c.values.length)
53
- .reduce((a, b) => a + b, 0);
54
- if (atomics.size > 1) insert("union type is not allowed in array.");
55
- if (meta.nullable) insert("nullable type is not allowed in array.");
56
- if (meta.isRequired() === false)
57
- insert("optional type is not allowed in array.");
58
- if (meta.size() !== expected)
59
- insert("only atomic or constant types are allowed in array.");
60
- } else if (explore.object && explore.property !== null) {
61
- //----
62
- // COMMON
63
- //----
64
- // PROPERTY MUST BE SOLE
65
- if (typeof explore.property === "object")
66
- insert("dynamic property is not allowed.");
67
- // DO NOT ALLOW TUPLE TYPE
68
- if (meta.tuples.length) insert("tuple type is not allowed.");
69
- // DO NOT ALLOW UNION TYPE
70
- if (CoreMetadataUtil.isUnion(meta))
71
- insert("union type is not allowed.");
72
- // DO NOT ALLOW NESTED OBJECT
73
- if (
74
- meta.objects.length ||
75
- meta.sets.length ||
76
- meta.maps.length ||
77
- meta.natives.length
78
- )
79
- insert("nested object type is not allowed.");
80
-
81
- //----
82
- // ARRAY CASES
83
- //----
84
- const isArray: boolean =
85
- meta.arrays.length > 1 || meta.tuples.length > 1;
86
- // ARRAY TYPE MUST BE REQUIRED
87
- if (isArray && meta.isRequired() === false)
88
- insert("optional type is not allowed when array.");
89
- // SET-COOKIE MUST BE ARRAY
90
- if (explore.property === "set-cookie" && !isArray)
91
- insert("set-cookie property must be array.");
92
- }
93
- return errors;
94
- };
95
-
96
- export const headers = (
97
- meta: Metadata,
98
- explore: MetadataFactory.IExplore,
99
- ): string[] => {
100
- const errors: string[] = [];
101
- const insert = (msg: string) => errors.push(msg);
102
-
103
- if (explore.top === true) {
104
- // TOP MUST BE ONLY OBJECT
105
- if (meta.objects.length !== 1 || meta.bucket() !== 1)
106
- insert("only one object type is allowed.");
107
- if (meta.nullable === true) insert("headers cannot be null.");
108
- if (meta.isRequired() === false) insert("headers cannot be null.");
109
- } else if (
110
- explore.nested !== null &&
111
- explore.nested instanceof MetadataArray
112
- ) {
113
- const atomics = CoreMetadataUtil.atomics(meta);
114
- const expected: number =
115
- meta.atomics.length +
116
- meta.templates.length +
117
- meta.constants
118
- .map((c) => c.values.length)
119
- .reduce((a, b) => a + b, 0);
120
- if (atomics.size > 1) insert("union type is not allowed in array.");
121
- if (meta.nullable) insert("nullable type is not allowed in array.");
122
- if (meta.isRequired() === false)
123
- insert("optional type is not allowed.");
124
- if (meta.size() !== expected)
125
- insert("only atomic or constant types are allowed in array.");
126
- } else if (explore.object && explore.property !== null) {
127
- //----
128
- // COMMON
129
- //----
130
- // PROPERTY MUST BE SOLE
131
- if (typeof explore.property === "object")
132
- insert("dynamic property is not allowed.");
133
- // DO NOT ALLOW TUPLE TYPE
134
- if (meta.tuples.length) insert("tuple type is not allowed.");
135
- // DO NOT ALLOW UNION TYPE
136
- if (CoreMetadataUtil.isUnion(meta))
137
- insert("union type is not allowed.");
138
- // DO NOT ALLOW NESTED OBJECT
139
- if (
140
- meta.objects.length ||
141
- meta.sets.length ||
142
- meta.maps.length ||
143
- meta.natives.length
144
- )
145
- insert("nested object type is not allowed.");
146
- // DO NOT ALLOW NULLABLE
147
- if (meta.nullable) insert("nullable type is not allowed.");
148
-
149
- //----
150
- // ARRAY CASES
151
- //----
152
- const isArray: boolean = meta.arrays.length > 1;
153
- // ARRAY TYPE MUST BE REQUIRED
154
- if (isArray && meta.isRequired() === false)
155
- insert("optional type is not allowed when array.");
156
- // SET-COOKIE MUST BE ARRAY
157
- if (explore.property === "set-cookie" && !isArray)
158
- insert("set-cookie property must be array.");
159
- // MUST BE SINGULAR CASE
160
- if (
161
- typeof explore.property === "string" &&
162
- SINGULAR.has(explore.property) &&
163
- isArray
164
- )
165
- insert("property cannot be array.");
166
- }
167
- return errors;
168
- };
169
- }
170
-
171
- namespace CoreMetadataUtil {
172
- export const atomics = (
173
- meta: Metadata,
174
- ): Set<"boolean" | "bigint" | "number" | "string"> =>
175
- new Set([
176
- ...meta.atomics.map((a) => a.type),
177
- ...meta.constants.map((c) => c.type),
178
- ...(meta.templates.length ? (["string"] as const) : []),
179
- ]);
180
-
181
- export const isUnion = (meta: Metadata): boolean =>
182
- atomics(meta).size +
183
- meta.arrays.length +
184
- meta.tuples.length +
185
- meta.natives.length +
186
- meta.maps.length +
187
- meta.objects.length >
188
- 1;
189
- }
190
-
191
- const SINGULAR: Set<string> = new Set([
192
- "age",
193
- "authorization",
194
- "content-length",
195
- "content-type",
196
- "etag",
197
- "expires",
198
- "from",
199
- "host",
200
- "if-modified-since",
201
- "if-unmodified-since",
202
- "last-modified",
203
- "location",
204
- "max-forwards",
205
- "proxy-authorization",
206
- "referer",
207
- "retry-after",
208
- "server",
209
- "user-agent",
210
- ]);
1
+ import { MetadataFactory } from "typia/lib/factories/MetadataFactory";
2
+ import { Metadata } from "typia/lib/schemas/metadata/Metadata";
3
+ import { MetadataArray } from "typia/lib/schemas/metadata/MetadataArray";
4
+
5
+ export namespace SwaggerSchemaValidator {
6
+ export const path = (meta: Metadata): string[] => {
7
+ const errors: string[] = [];
8
+ const insert = (msg: string) => errors.push(msg);
9
+
10
+ if (meta.any) insert("do not allow any type");
11
+ if (meta.isRequired() === false) insert("do not allow undefindable type");
12
+
13
+ const atomics = CoreMetadataUtil.atomics(meta);
14
+ const expected: number =
15
+ meta.atomics.length +
16
+ meta.templates.length +
17
+ meta.constants.map((c) => c.values.length).reduce((a, b) => a + b, 0);
18
+ if (meta.size() !== expected || atomics.size === 0)
19
+ insert("only atomic or constant types are allowed");
20
+ if (atomics.size > 1) insert("do not allow union type");
21
+
22
+ return errors;
23
+ };
24
+
25
+ export const query = (
26
+ meta: Metadata,
27
+ explore: MetadataFactory.IExplore,
28
+ ): string[] => {
29
+ const errors: string[] = [];
30
+ const insert = (msg: string) => errors.push(msg);
31
+
32
+ if (explore.top === true) {
33
+ // TOP MUST BE ONLY OBJECT
34
+ if (meta.objects.length !== 1 || meta.bucket() !== 1)
35
+ insert("only one object type is allowed.");
36
+ if (meta.nullable === true) insert("query parameters cannot be null.");
37
+ if (meta.isRequired() === false)
38
+ insert("query parameters cannot be undefined.");
39
+ } else if (
40
+ explore.nested !== null &&
41
+ explore.nested instanceof MetadataArray
42
+ ) {
43
+ const atomics = CoreMetadataUtil.atomics(meta);
44
+ const expected: number =
45
+ meta.atomics.length +
46
+ meta.templates.length +
47
+ meta.constants.map((c) => c.values.length).reduce((a, b) => a + b, 0);
48
+ if (atomics.size > 1) insert("union type is not allowed in array.");
49
+ if (meta.nullable) insert("nullable type is not allowed in array.");
50
+ if (meta.isRequired() === false)
51
+ insert("optional type is not allowed in array.");
52
+ if (meta.size() !== expected)
53
+ insert("only atomic or constant types are allowed in array.");
54
+ } else if (explore.object && explore.property !== null) {
55
+ //----
56
+ // COMMON
57
+ //----
58
+ // PROPERTY MUST BE SOLE
59
+ if (typeof explore.property === "object")
60
+ insert("dynamic property is not allowed.");
61
+ // DO NOT ALLOW TUPLE TYPE
62
+ if (meta.tuples.length) insert("tuple type is not allowed.");
63
+ // DO NOT ALLOW UNION TYPE
64
+ if (CoreMetadataUtil.isUnion(meta)) insert("union type is not allowed.");
65
+ // DO NOT ALLOW NESTED OBJECT
66
+ if (
67
+ meta.objects.length ||
68
+ meta.sets.length ||
69
+ meta.maps.length ||
70
+ meta.natives.length
71
+ )
72
+ insert("nested object type is not allowed.");
73
+
74
+ //----
75
+ // ARRAY CASES
76
+ //----
77
+ const isArray: boolean = meta.arrays.length > 1 || meta.tuples.length > 1;
78
+ // ARRAY TYPE MUST BE REQUIRED
79
+ if (isArray && meta.isRequired() === false)
80
+ insert("optional type is not allowed when array.");
81
+ // SET-COOKIE MUST BE ARRAY
82
+ if (explore.property === "set-cookie" && !isArray)
83
+ insert("set-cookie property must be array.");
84
+ }
85
+ return errors;
86
+ };
87
+
88
+ export const headers = (
89
+ meta: Metadata,
90
+ explore: MetadataFactory.IExplore,
91
+ ): string[] => {
92
+ const errors: string[] = [];
93
+ const insert = (msg: string) => errors.push(msg);
94
+
95
+ if (explore.top === true) {
96
+ // TOP MUST BE ONLY OBJECT
97
+ if (meta.objects.length !== 1 || meta.bucket() !== 1)
98
+ insert("only one object type is allowed.");
99
+ if (meta.nullable === true) insert("headers cannot be null.");
100
+ if (meta.isRequired() === false) insert("headers cannot be null.");
101
+ } else if (
102
+ explore.nested !== null &&
103
+ explore.nested instanceof MetadataArray
104
+ ) {
105
+ const atomics = CoreMetadataUtil.atomics(meta);
106
+ const expected: number =
107
+ meta.atomics.length +
108
+ meta.templates.length +
109
+ meta.constants.map((c) => c.values.length).reduce((a, b) => a + b, 0);
110
+ if (atomics.size > 1) insert("union type is not allowed in array.");
111
+ if (meta.nullable) insert("nullable type is not allowed in array.");
112
+ if (meta.isRequired() === false) insert("optional type is not allowed.");
113
+ if (meta.size() !== expected)
114
+ insert("only atomic or constant types are allowed in array.");
115
+ } else if (explore.object && explore.property !== null) {
116
+ //----
117
+ // COMMON
118
+ //----
119
+ // PROPERTY MUST BE SOLE
120
+ if (typeof explore.property === "object")
121
+ insert("dynamic property is not allowed.");
122
+ // DO NOT ALLOW TUPLE TYPE
123
+ if (meta.tuples.length) insert("tuple type is not allowed.");
124
+ // DO NOT ALLOW UNION TYPE
125
+ if (CoreMetadataUtil.isUnion(meta)) insert("union type is not allowed.");
126
+ // DO NOT ALLOW NESTED OBJECT
127
+ if (
128
+ meta.objects.length ||
129
+ meta.sets.length ||
130
+ meta.maps.length ||
131
+ meta.natives.length
132
+ )
133
+ insert("nested object type is not allowed.");
134
+ // DO NOT ALLOW NULLABLE
135
+ if (meta.nullable) insert("nullable type is not allowed.");
136
+
137
+ //----
138
+ // ARRAY CASES
139
+ //----
140
+ const isArray: boolean = meta.arrays.length > 1;
141
+ // ARRAY TYPE MUST BE REQUIRED
142
+ if (isArray && meta.isRequired() === false)
143
+ insert("optional type is not allowed when array.");
144
+ // SET-COOKIE MUST BE ARRAY
145
+ if (explore.property === "set-cookie" && !isArray)
146
+ insert("set-cookie property must be array.");
147
+ // MUST BE SINGULAR CASE
148
+ if (
149
+ typeof explore.property === "string" &&
150
+ SINGULAR.has(explore.property) &&
151
+ isArray
152
+ )
153
+ insert("property cannot be array.");
154
+ }
155
+ return errors;
156
+ };
157
+ }
158
+
159
+ namespace CoreMetadataUtil {
160
+ export const atomics = (
161
+ meta: Metadata,
162
+ ): Set<"boolean" | "bigint" | "number" | "string"> =>
163
+ new Set([
164
+ ...meta.atomics.map((a) => a.type),
165
+ ...meta.constants.map((c) => c.type),
166
+ ...(meta.templates.length ? (["string"] as const) : []),
167
+ ]);
168
+
169
+ export const isUnion = (meta: Metadata): boolean =>
170
+ atomics(meta).size +
171
+ meta.arrays.length +
172
+ meta.tuples.length +
173
+ meta.natives.length +
174
+ meta.maps.length +
175
+ meta.objects.length >
176
+ 1;
177
+ }
178
+
179
+ const SINGULAR: Set<string> = new Set([
180
+ "age",
181
+ "authorization",
182
+ "content-length",
183
+ "content-type",
184
+ "etag",
185
+ "expires",
186
+ "from",
187
+ "host",
188
+ "if-modified-since",
189
+ "if-unmodified-since",
190
+ "last-modified",
191
+ "location",
192
+ "max-forwards",
193
+ "proxy-authorization",
194
+ "referer",
195
+ "retry-after",
196
+ "server",
197
+ "user-agent",
198
+ ]);
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as nestia from "./module";
2
-
3
- export * from "./module";
4
- export default nestia;
1
+ import * as nestia from "./module";
2
+
3
+ export * from "./module";
4
+ export default nestia;
package/src/module.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./INestiaConfig";
2
- export * from "./NestiaSdkApplication";
1
+ export * from "./INestiaConfig";
2
+ export * from "./NestiaSdkApplication";
@@ -3,91 +3,89 @@ import type { VERSION_NEUTRAL, VersionValue } from "@nestjs/common/interfaces";
3
3
  import type { ParamCategory } from "./ParamCategory";
4
4
 
5
5
  export interface IController {
6
- file: string;
6
+ file: string;
7
+ name: string;
8
+ prefixes: string[];
9
+ paths: string[];
10
+ versions:
11
+ | Array<Exclude<VersionValue, Array<string | typeof VERSION_NEUTRAL>>>
12
+ | undefined;
13
+ functions: IController.IFunction[];
14
+ security: Record<string, string[]>[];
15
+ swaggerTgas: string[];
16
+ }
17
+
18
+ export namespace IController {
19
+ export interface IFunction {
7
20
  name: string;
8
- prefixes: string[];
21
+ method: string;
9
22
  paths: string[];
10
23
  versions:
11
- | Array<Exclude<VersionValue, Array<string | typeof VERSION_NEUTRAL>>>
12
- | undefined;
13
- functions: IController.IFunction[];
24
+ | Array<Exclude<VersionValue, Array<string | typeof VERSION_NEUTRAL>>>
25
+ | undefined;
26
+ encrypted: boolean;
27
+ parameters: IParameter[];
28
+ status?: number;
29
+ type?: string;
30
+ contentType: "application/json" | "text/plain";
14
31
  security: Record<string, string[]>[];
15
- swaggerTgas: string[];
16
- }
17
-
18
- export namespace IController {
19
- export interface IFunction {
20
- name: string;
21
- method: string;
22
- paths: string[];
23
- versions:
24
- | Array<
25
- Exclude<VersionValue, Array<string | typeof VERSION_NEUTRAL>>
26
- >
27
- | undefined;
28
- encrypted: boolean;
29
- parameters: IParameter[];
30
- status?: number;
31
- type?: string;
32
- contentType: "application/json" | "text/plain";
33
- security: Record<string, string[]>[];
34
- exceptions: Record<
35
- number | "2XX" | "3XX" | "4XX" | "5XX",
36
- IController.IException
37
- >;
38
- swaggerTags: string[];
39
- }
32
+ exceptions: Record<
33
+ number | "2XX" | "3XX" | "4XX" | "5XX",
34
+ IController.IException
35
+ >;
36
+ swaggerTags: string[];
37
+ }
40
38
 
41
- export type IParameter =
42
- | ICommonParameter
43
- | IQueryParameter
44
- | IHeadersParameter
45
- | IBodyParameter
46
- | IPathParameter;
47
- export interface ICommonParameter {
48
- custom: false;
49
- category: ParamCategory;
50
- index: number;
51
- name: string;
52
- field: string | undefined;
53
- }
54
- export interface IHeadersParameter {
55
- custom: true;
56
- category: "headers";
57
- index: number;
58
- name: string;
59
- field: string | undefined;
60
- }
61
- export interface IQueryParameter {
62
- custom: true;
63
- category: "query";
64
- index: number;
65
- name: string;
66
- field: string | undefined;
67
- }
68
- export interface IBodyParameter {
69
- custom: true;
70
- category: "body";
71
- index: number;
72
- name: string;
73
- field: string | undefined;
74
- encrypted: boolean;
75
- contentType:
76
- | "application/json"
77
- | "application/x-www-form-urlencoded"
78
- | "text/plain";
79
- }
80
- export interface IPathParameter {
81
- custom: true;
82
- category: "param";
83
- index: number;
84
- name: string;
85
- field: string | undefined;
86
- }
39
+ export type IParameter =
40
+ | ICommonParameter
41
+ | IQueryParameter
42
+ | IHeadersParameter
43
+ | IBodyParameter
44
+ | IPathParameter;
45
+ export interface ICommonParameter {
46
+ custom: false;
47
+ category: ParamCategory;
48
+ index: number;
49
+ name: string;
50
+ field: string | undefined;
51
+ }
52
+ export interface IHeadersParameter {
53
+ custom: true;
54
+ category: "headers";
55
+ index: number;
56
+ name: string;
57
+ field: string | undefined;
58
+ }
59
+ export interface IQueryParameter {
60
+ custom: true;
61
+ category: "query";
62
+ index: number;
63
+ name: string;
64
+ field: string | undefined;
65
+ }
66
+ export interface IBodyParameter {
67
+ custom: true;
68
+ category: "body";
69
+ index: number;
70
+ name: string;
71
+ field: string | undefined;
72
+ encrypted: boolean;
73
+ contentType:
74
+ | "application/json"
75
+ | "application/x-www-form-urlencoded"
76
+ | "text/plain";
77
+ }
78
+ export interface IPathParameter {
79
+ custom: true;
80
+ category: "param";
81
+ index: number;
82
+ name: string;
83
+ field: string | undefined;
84
+ }
87
85
 
88
- export interface IException {
89
- type: string;
90
- status: number | "2XX" | "3XX" | "4XX" | "5XX";
91
- description: string | undefined;
92
- }
86
+ export interface IException {
87
+ type: string;
88
+ status: number | "2XX" | "3XX" | "4XX" | "5XX";
89
+ description: string | undefined;
90
+ }
93
91
  }
@@ -1,6 +1,6 @@
1
- export interface IErrorReport {
2
- file: string;
3
- controller: string;
4
- function: string | null;
5
- message: string;
6
- }
1
+ export interface IErrorReport {
2
+ file: string;
3
+ controller: string;
4
+ function: string | null;
5
+ message: string;
6
+ }
@@ -1,13 +1,13 @@
1
- import ts from "typescript";
2
-
3
- import { INestiaConfig } from "../INestiaConfig";
4
- import { IErrorReport } from "./IErrorReport";
5
- import { INormalizedInput } from "./INormalizedInput";
6
-
7
- export interface INestiaProject {
8
- config: INestiaConfig;
9
- input: INormalizedInput;
10
- checker: ts.TypeChecker;
11
- errors: IErrorReport[];
12
- warnings: IErrorReport[];
13
- }
1
+ import ts from "typescript";
2
+
3
+ import { INestiaConfig } from "../INestiaConfig";
4
+ import { IErrorReport } from "./IErrorReport";
5
+ import { INormalizedInput } from "./INormalizedInput";
6
+
7
+ export interface INestiaProject {
8
+ config: INestiaConfig;
9
+ input: INormalizedInput;
10
+ checker: ts.TypeChecker;
11
+ errors: IErrorReport[];
12
+ warnings: IErrorReport[];
13
+ }