@nestia/sdk 11.2.1 → 12.0.0-dev.20260521.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 (277) hide show
  1. package/assets/bundle/distribute/package.json +1 -1
  2. package/lib/NestiaSdkApplication.js +5 -4
  3. package/lib/NestiaSdkApplication.js.map +1 -1
  4. package/lib/NestiaSwaggerComposer.js +2 -2
  5. package/lib/NestiaSwaggerComposer.js.map +1 -1
  6. package/lib/analyses/AccessorAnalyzer.js.map +1 -1
  7. package/lib/analyses/ConfigAnalyzer.js +133 -7
  8. package/lib/analyses/ConfigAnalyzer.js.map +1 -1
  9. package/lib/analyses/ImportAnalyzer.d.ts +9 -2
  10. package/lib/analyses/ImportAnalyzer.js +13 -50
  11. package/lib/analyses/ImportAnalyzer.js.map +1 -1
  12. package/lib/analyses/PathAnalyzer.js.map +1 -1
  13. package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
  14. package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +1 -1
  15. package/lib/analyses/ReflectHttpOperationAnalyzer.js +5 -4
  16. package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
  17. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +1 -1
  18. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +22 -5
  19. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
  20. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +1 -1
  21. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +8 -8
  22. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
  23. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +1 -1
  24. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +15 -15
  25. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
  26. package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
  27. package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +1 -1
  28. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +1 -1
  29. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
  30. package/lib/analyses/SecurityAnalyzer.js.map +1 -1
  31. package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +2 -1
  32. package/lib/analyses/TypedHttpRouteAnalyzer.js +296 -39
  33. package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
  34. package/lib/analyses/TypedWebSocketRouteAnalyzer.js +1 -4
  35. package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
  36. package/lib/decorators/OperationMetadata.d.ts +12 -2
  37. package/lib/decorators/OperationMetadata.js +14 -1
  38. package/lib/decorators/OperationMetadata.js.map +1 -1
  39. package/lib/executable/internal/CommandParser.js.map +1 -1
  40. package/lib/executable/internal/NestiaConfigLoader.d.ts +6 -2
  41. package/lib/executable/internal/NestiaConfigLoader.js +285 -793
  42. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  43. package/lib/executable/internal/NestiaSdkCommand.js +6 -4
  44. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  45. package/lib/executable/sdk.js +17 -5
  46. package/lib/executable/sdk.js.map +1 -1
  47. package/lib/generates/CloneGenerator.js +2 -2
  48. package/lib/generates/CloneGenerator.js.map +1 -1
  49. package/lib/generates/E2eGenerator.js.map +1 -1
  50. package/lib/generates/SdkGenerator.js +6 -9
  51. package/lib/generates/SdkGenerator.js.map +1 -1
  52. package/lib/generates/SwaggerGenerator.js +20 -107
  53. package/lib/generates/SwaggerGenerator.js.map +1 -1
  54. package/lib/generates/internal/E2eFileProgrammer.js +44 -28
  55. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  56. package/lib/generates/internal/FilePrinter.d.ts +4 -4
  57. package/lib/generates/internal/FilePrinter.js +25 -16
  58. package/lib/generates/internal/FilePrinter.js.map +1 -1
  59. package/lib/generates/internal/ImportDictionary.d.ts +2 -2
  60. package/lib/generates/internal/ImportDictionary.js +7 -5
  61. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  62. package/lib/generates/internal/SdkAliasCollection.d.ts +11 -11
  63. package/lib/generates/internal/SdkAliasCollection.js +27 -31
  64. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  65. package/lib/generates/internal/SdkDistributionComposer.js +15 -70
  66. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  67. package/lib/generates/internal/SdkFileProgrammer.js +2 -2
  68. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  69. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +2 -2
  70. package/lib/generates/internal/SdkHttpCloneProgrammer.js +6 -12
  71. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  72. package/lib/generates/internal/SdkHttpCloneReferencer.js +2 -1
  73. package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
  74. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +2 -2
  75. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +73 -77
  76. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  77. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +2 -2
  78. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +64 -66
  79. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  80. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +4 -10
  81. package/lib/generates/internal/SdkHttpParameterProgrammer.js +15 -22
  82. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  83. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +2 -2
  84. package/lib/generates/internal/SdkHttpRouteProgrammer.js +18 -20
  85. package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
  86. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +3 -3
  87. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +47 -49
  88. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  89. package/lib/generates/internal/SdkImportWizard.js.map +1 -1
  90. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  91. package/lib/generates/internal/SdkTypeProgrammer.d.ts +4 -4
  92. package/lib/generates/internal/SdkTypeProgrammer.js +66 -67
  93. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  94. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +1 -2
  95. package/lib/generates/internal/SdkTypeTagProgrammer.js +29 -11
  96. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  97. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +2 -2
  98. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +55 -55
  99. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  100. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +3 -3
  101. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +9 -12
  102. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  103. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +2 -2
  104. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +43 -45
  105. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  106. package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
  107. package/lib/generates/internal/SwaggerOperationComposer.d.ts +1 -1
  108. package/lib/generates/internal/SwaggerOperationComposer.js +5 -4
  109. package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
  110. package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +0 -3
  111. package/lib/generates/internal/SwaggerOperationParameterComposer.js +19 -20
  112. package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
  113. package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +1 -1
  114. package/lib/generates/internal/SwaggerOperationResponseComposer.js +4 -3
  115. package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
  116. package/lib/index.js.map +1 -1
  117. package/lib/internal/legacy.d.ts +180 -0
  118. package/lib/internal/legacy.js +361 -0
  119. package/lib/internal/legacy.js.map +1 -0
  120. package/lib/structures/INestiaProject.d.ts +0 -2
  121. package/lib/{transformers → structures}/IOperationMetadata.d.ts +2 -7
  122. package/lib/structures/IOperationMetadata.js.map +1 -0
  123. package/lib/structures/IReflectHttpOperationException.d.ts +1 -1
  124. package/lib/structures/IReflectHttpOperationParameter.d.ts +1 -1
  125. package/lib/structures/IReflectHttpOperationSuccess.d.ts +1 -1
  126. package/lib/structures/IReflectOperationError.d.ts +1 -1
  127. package/lib/structures/IReflectOperationError.js.map +1 -1
  128. package/lib/structures/IReflectWebSocketOperation.d.ts +2 -2
  129. package/lib/structures/ITypedApplication.d.ts +1 -1
  130. package/lib/structures/ITypedHttpRouteException.d.ts +1 -1
  131. package/lib/structures/ITypedHttpRouteParameter.d.ts +1 -1
  132. package/lib/structures/ITypedHttpRouteSuccess.d.ts +1 -1
  133. package/lib/structures/ITypedWebSocketRoute.d.ts +2 -2
  134. package/lib/transform.d.ts +16 -3
  135. package/lib/transform.js +47 -5
  136. package/lib/transform.js.map +1 -1
  137. package/lib/utils/ArrayUtil.js.map +1 -1
  138. package/lib/utils/FileRetriever.js.map +1 -1
  139. package/lib/utils/MapUtil.js.map +1 -1
  140. package/lib/utils/PathUtil.js.map +1 -1
  141. package/lib/utils/SourceFinder.js.map +1 -1
  142. package/lib/utils/StringUtil.js.map +1 -1
  143. package/lib/utils/TsConfigReader.d.ts +7 -0
  144. package/lib/utils/TsConfigReader.js +102 -0
  145. package/lib/utils/TsConfigReader.js.map +1 -0
  146. package/lib/utils/TtscExecutor.d.ts +8 -0
  147. package/lib/utils/TtscExecutor.js +58 -0
  148. package/lib/utils/TtscExecutor.js.map +1 -0
  149. package/lib/utils/VersioningStrategy.js.map +1 -1
  150. package/lib/validators/HttpHeadersValidator.d.ts +8 -5
  151. package/lib/validators/HttpHeadersValidator.js +7 -26
  152. package/lib/validators/HttpHeadersValidator.js.map +1 -1
  153. package/lib/validators/HttpQueryValidator.d.ts +8 -5
  154. package/lib/validators/HttpQueryValidator.js +7 -26
  155. package/lib/validators/HttpQueryValidator.js.map +1 -1
  156. package/lib/{transformers → validators}/TextPlainValidator.d.ts +1 -1
  157. package/lib/{transformers → validators}/TextPlainValidator.js +2 -1
  158. package/lib/validators/TextPlainValidator.js.map +1 -0
  159. package/native/go.mod +52 -0
  160. package/native/go.sum +54 -0
  161. package/native/sdk/register.go +130 -0
  162. package/native/sdk/sdk.go +17 -0
  163. package/native/sdk/sdk_metadata_json.go +327 -0
  164. package/native/sdk/sdk_transform.go +1542 -0
  165. package/package.json +19 -19
  166. package/src/NestiaSdkApplication.ts +9 -5
  167. package/src/NestiaSwaggerComposer.ts +2 -3
  168. package/src/analyses/ConfigAnalyzer.ts +175 -1
  169. package/src/analyses/ImportAnalyzer.ts +15 -49
  170. package/src/analyses/ReflectControllerAnalyzer.ts +1 -1
  171. package/src/analyses/ReflectHttpOperationAnalyzer.ts +1 -1
  172. package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +24 -6
  173. package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +3 -3
  174. package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +14 -10
  175. package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +2 -2
  176. package/src/analyses/TypedHttpRouteAnalyzer.ts +354 -22
  177. package/src/decorators/OperationMetadata.ts +17 -3
  178. package/src/executable/internal/NestiaConfigLoader.ts +419 -53
  179. package/src/executable/internal/NestiaSdkCommand.ts +9 -10
  180. package/src/executable/sdk.ts +15 -4
  181. package/src/generates/CloneGenerator.ts +10 -10
  182. package/src/generates/SwaggerGenerator.ts +28 -9
  183. package/src/generates/internal/E2eFileProgrammer.ts +80 -43
  184. package/src/generates/internal/FilePrinter.ts +38 -37
  185. package/src/generates/internal/ImportDictionary.ts +18 -16
  186. package/src/generates/internal/SdkAliasCollection.ts +41 -40
  187. package/src/generates/internal/SdkDistributionComposer.ts +21 -8
  188. package/src/generates/internal/SdkFileProgrammer.ts +7 -5
  189. package/src/generates/internal/SdkHttpCloneProgrammer.ts +10 -10
  190. package/src/generates/internal/SdkHttpCloneReferencer.ts +6 -6
  191. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +101 -78
  192. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +153 -145
  193. package/src/generates/internal/SdkHttpParameterProgrammer.ts +20 -33
  194. package/src/generates/internal/SdkHttpRouteProgrammer.ts +2 -2
  195. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +88 -86
  196. package/src/generates/internal/SdkTypeProgrammer.ts +93 -99
  197. package/src/generates/internal/SdkTypeTagProgrammer.ts +12 -12
  198. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +128 -118
  199. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +15 -13
  200. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +133 -112
  201. package/src/generates/internal/SwaggerOperationComposer.ts +1 -1
  202. package/src/generates/internal/SwaggerOperationParameterComposer.ts +10 -9
  203. package/src/generates/internal/SwaggerOperationResponseComposer.ts +1 -1
  204. package/src/internal/legacy.ts +492 -0
  205. package/src/structures/INestiaProject.ts +0 -3
  206. package/src/{transformers → structures}/IOperationMetadata.ts +2 -7
  207. package/src/structures/IReflectHttpOperationException.ts +1 -1
  208. package/src/structures/IReflectHttpOperationParameter.ts +1 -1
  209. package/src/structures/IReflectHttpOperationSuccess.ts +1 -1
  210. package/src/structures/IReflectOperationError.ts +1 -1
  211. package/src/structures/IReflectWebSocketOperation.ts +2 -2
  212. package/src/structures/ITypedApplication.ts +1 -1
  213. package/src/structures/ITypedHttpRouteException.ts +1 -1
  214. package/src/structures/ITypedHttpRouteParameter.ts +1 -1
  215. package/src/structures/ITypedHttpRouteSuccess.ts +1 -1
  216. package/src/structures/ITypedWebSocketRoute.ts +2 -2
  217. package/src/transform.ts +57 -7
  218. package/src/utils/TsConfigReader.ts +108 -0
  219. package/src/utils/TtscExecutor.ts +63 -0
  220. package/src/validators/HttpHeadersValidator.ts +8 -37
  221. package/src/validators/HttpQueryValidator.ts +8 -37
  222. package/src/{transformers → validators}/TextPlainValidator.ts +2 -2
  223. package/lib/analyses/DtoAnalyzer.d.ts +0 -21
  224. package/lib/analyses/DtoAnalyzer.js +0 -219
  225. package/lib/analyses/DtoAnalyzer.js.map +0 -1
  226. package/lib/analyses/ExceptionAnalyzer.d.ts +0 -0
  227. package/lib/analyses/ExceptionAnalyzer.js +0 -2
  228. package/lib/analyses/ExceptionAnalyzer.js.map +0 -1
  229. package/lib/analyses/GenericAnalyzer.d.ts +0 -4
  230. package/lib/analyses/GenericAnalyzer.js +0 -42
  231. package/lib/analyses/GenericAnalyzer.js.map +0 -1
  232. package/lib/structures/IReflectApplication.d.ts +0 -6
  233. package/lib/structures/IReflectApplication.js +0 -3
  234. package/lib/structures/IReflectApplication.js.map +0 -1
  235. package/lib/structures/MethodType.d.ts +0 -4
  236. package/lib/structures/MethodType.js +0 -8
  237. package/lib/structures/MethodType.js.map +0 -1
  238. package/lib/structures/ParamCategory.d.ts +0 -1
  239. package/lib/structures/ParamCategory.js +0 -3
  240. package/lib/structures/ParamCategory.js.map +0 -1
  241. package/lib/structures/TypeEntry.d.ts +0 -9
  242. package/lib/structures/TypeEntry.js +0 -21
  243. package/lib/structures/TypeEntry.js.map +0 -1
  244. package/lib/transformers/IOperationMetadata.js.map +0 -1
  245. package/lib/transformers/ISdkOperationTransformerContext.d.ts +0 -7
  246. package/lib/transformers/ISdkOperationTransformerContext.js +0 -3
  247. package/lib/transformers/ISdkOperationTransformerContext.js.map +0 -1
  248. package/lib/transformers/SdkOperationProgrammer.d.ts +0 -15
  249. package/lib/transformers/SdkOperationProgrammer.js +0 -186
  250. package/lib/transformers/SdkOperationProgrammer.js.map +0 -1
  251. package/lib/transformers/SdkOperationTransformer.d.ts +0 -4
  252. package/lib/transformers/SdkOperationTransformer.js +0 -128
  253. package/lib/transformers/SdkOperationTransformer.js.map +0 -1
  254. package/lib/transformers/TextPlainValidator.js.map +0 -1
  255. package/lib/utils/MetadataUtil.d.ts +0 -4
  256. package/lib/utils/MetadataUtil.js +0 -34
  257. package/lib/utils/MetadataUtil.js.map +0 -1
  258. package/lib/utils/StripEnums.d.ts +0 -3
  259. package/lib/utils/StripEnums.js +0 -3
  260. package/lib/utils/StripEnums.js.map +0 -1
  261. package/lib/utils/TypeLiteralExpression.d.ts +0 -0
  262. package/lib/utils/TypeLiteralExpression.js +0 -2
  263. package/lib/utils/TypeLiteralExpression.js.map +0 -1
  264. package/src/analyses/DtoAnalyzer.ts +0 -260
  265. package/src/analyses/ExceptionAnalyzer.ts +0 -154
  266. package/src/analyses/GenericAnalyzer.ts +0 -49
  267. package/src/structures/IReflectApplication.ts +0 -8
  268. package/src/structures/MethodType.ts +0 -5
  269. package/src/structures/ParamCategory.ts +0 -1
  270. package/src/structures/TypeEntry.ts +0 -22
  271. package/src/transformers/ISdkOperationTransformerContext.ts +0 -8
  272. package/src/transformers/SdkOperationProgrammer.ts +0 -240
  273. package/src/transformers/SdkOperationTransformer.ts +0 -248
  274. package/src/utils/MetadataUtil.ts +0 -26
  275. package/src/utils/StripEnums.ts +0 -5
  276. package/src/utils/TypeLiteralExpression.ts +0 -0
  277. /package/lib/{transformers → structures}/IOperationMetadata.js +0 -0
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -46,784 +13,309 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
46
13
  };
47
14
  Object.defineProperty(exports, "__esModule", { value: true });
48
15
  exports.NestiaConfigLoader = void 0;
49
- const __typia_transform__assertGuard = __importStar(require("typia/lib/internal/_assertGuard"));
50
- const __typia_transform__isFormatEmail = __importStar(require("typia/lib/internal/_isFormatEmail"));
51
- const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString"));
52
16
  const core_1 = require("@nestia/core");
53
17
  const fs_1 = __importDefault(require("fs"));
54
18
  const path_1 = __importDefault(require("path"));
55
- const ts_node_1 = require("ts-node");
56
- const tsconfck_1 = require("tsconfck");
57
- const typescript_1 = __importDefault(require("typescript"));
58
- const typia_1 = __importDefault(require("typia"));
19
+ const url_1 = require("url");
20
+ const TsConfigReader_1 = require("../../utils/TsConfigReader");
21
+ const TtscExecutor_1 = require("../../utils/TtscExecutor");
59
22
  var NestiaConfigLoader;
60
23
  (function (NestiaConfigLoader) {
61
24
  NestiaConfigLoader.compilerOptions = (project) => __awaiter(this, void 0, void 0, function* () {
62
- const configFileName = typescript_1.default.findConfigFile(process.cwd(), typescript_1.default.sys.fileExists, project);
25
+ const configFileName = findConfigFile(process.cwd(), project);
63
26
  if (!configFileName)
64
27
  throw new Error(`unable to find "${project}" file.`);
65
- const { tsconfig } = yield (0, tsconfck_1.parse)(configFileName);
66
- const configFileText = JSON.stringify(tsconfig);
67
- const { config } = typescript_1.default.parseConfigFileTextToJson(configFileName, configFileText);
68
- return typescript_1.default.parseJsonConfigFileContent(config, typescript_1.default.sys, path_1.default.dirname(configFileName));
28
+ const tsconfig = yield TsConfigReader_1.TsConfigReader.read(configFileName);
29
+ return {
30
+ raw: {
31
+ compilerOptions: typeof (tsconfig === null || tsconfig === void 0 ? void 0 : tsconfig.compilerOptions) === "object"
32
+ ? tsconfig.compilerOptions
33
+ : {},
34
+ },
35
+ };
69
36
  });
70
37
  NestiaConfigLoader.configurations = (file, compilerOptions) => __awaiter(this, void 0, void 0, function* () {
71
- var _a, _b, _c;
72
38
  if (fs_1.default.existsSync(path_1.default.resolve(file)) === false)
73
39
  throw new Error(`Unable to find "${file}" file.`);
74
- (0, core_1.doNotThrowTransformError)(true);
75
- const setup = (() => { const _io0 = input => true; const _ao0 = (input, _path, _exceptionable = true) => true; const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
76
- if (false === __is(input)) {
77
- _errorFactory = errorFactory;
78
- ((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
79
- method: "typia\n .assert",
80
- path: _path + "",
81
- expected: "Array<object>",
82
- value: input
83
- }, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(true, {
84
- method: "typia\n .assert",
85
- path: _path + "[" + _index2 + "]",
86
- expected: "object",
87
- value: elem
88
- }, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
89
- method: "typia\n .assert",
90
- path: _path + "[" + _index2 + "]",
91
- expected: "object",
92
- value: elem
93
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
94
- method: "typia\n .assert",
95
- path: _path + "",
96
- expected: "Array<object>",
97
- value: input
98
- }, _errorFactory))(input, "$input", true);
99
- }
100
- return input;
101
- }; })()((_a = compilerOptions.plugins) !== null && _a !== void 0 ? _a : []).some((x) => x.transform === "@nestia/sdk/lib/transform");
102
- const plugins = [
103
- ...((_b = compilerOptions.plugins) !== null && _b !== void 0 ? _b : []),
104
- ...(setup ? [] : [{ transform: "@nestia/sdk/lib/transform" }]),
105
- ];
106
- const hasPathAliases = Object.keys((_c = compilerOptions.paths) !== null && _c !== void 0 ? _c : {}).length > 0;
107
- if (!process[Symbol.for("ts-node.register.instance")])
108
- (0, ts_node_1.register)({
109
- emit: false,
110
- compilerOptions: Object.assign(Object.assign({}, compilerOptions), { plugins }),
111
- require: (compilerOptions.baseUrl || hasPathAliases)
112
- ? ["tsconfig-paths/register"]
113
- : undefined,
114
- });
115
- const loaded = yield Promise.resolve(`${path_1.default.resolve(file)}`).then(s => __importStar(require(s)));
116
- const instance = typeof (loaded === null || loaded === void 0 ? void 0 : loaded.default) === "object" && loaded.default !== null
117
- ? loaded.default
118
- : loaded;
40
+ (0, core_1.doNotThrowTransformError)(false);
41
+ if (compilerOptions.plugins !== undefined)
42
+ assertPlugins(file, compilerOptions.plugins);
43
+ const configFile = yield materializeConfiguration({
44
+ file,
45
+ compilerOptions,
46
+ });
47
+ const loaded = yield loadMaterializedModule(configFile);
48
+ const instance = extractConfiguration(file, loaded);
119
49
  const configurations = Array.isArray(instance)
120
50
  ? instance
121
51
  : [instance];
52
+ return assertConfigurations(file, configurations);
53
+ });
54
+ const MATERIALIZED_ROOTS = new Set();
55
+ let CLEANUP_REGISTERED = false;
56
+ const materializeConfiguration = (props) => __awaiter(this, void 0, void 0, function* () {
57
+ var _a, _b;
58
+ const configFile = path_1.default.resolve(props.file);
59
+ const project = (_a = process.env.NESTIA_PROJECT) !== null && _a !== void 0 ? _a : "tsconfig.json";
60
+ const projectFile = findConfigFile(process.cwd(), project);
61
+ if (projectFile === undefined)
62
+ throw new Error(`unable to find "${project}" file.`);
63
+ const projectRoot = path_1.default.dirname(path_1.default.resolve(projectFile));
64
+ const wrapperRoot = fs_1.default.mkdtempSync(path_1.default.join(ensureMaterializedRoot(projectRoot), "tsconfig-"));
65
+ const outputRoot = fs_1.default.mkdtempSync(path_1.default.join(ensureMaterializedRoot(projectRoot), "run-"));
66
+ const wrapperFile = path_1.default.join(wrapperRoot, "tsconfig.json");
67
+ const wrapperConfig = {
68
+ extends: projectFile,
69
+ compilerOptions: Object.assign(Object.assign({ noEmit: false, noUnusedLocals: false, noUnusedParameters: false }, nodeAmbientCompilerOptions(projectRoot, props.compilerOptions)), { outDir: outputRoot, plugins: materializePlugins(props.compilerOptions.plugins), rootDir: projectRoot }),
70
+ include: [configFile],
71
+ exclude: [path_1.default.join(projectRoot, "src", "test", "**", "*")],
72
+ };
73
+ fs_1.default.writeFileSync(wrapperFile, JSON.stringify(wrapperConfig, null, 2), "utf8");
122
74
  try {
123
- return (() => { const _io0 = input => null !== input.input && undefined !== input.input && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && _io1(input.input))) && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && _io2(input.swagger)) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.keyword || "boolean" === typeof input.keyword) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json); const _io1 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem)); const _io2 = input => "string" === typeof input.output && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi || "3.2" === input.openapi) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.additional || "boolean" === typeof input.additional) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && _io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && _io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && _io9(input.security)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "object" === typeof elem && null !== elem && _io21(elem))) && (undefined === input.decompose || "boolean" === typeof input.decompose); const _io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && _io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && _io5(input.license)) && (undefined === input.version || "string" === typeof input.version); const _io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.email || "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email)); const _io5 = input => "string" === typeof input.name && (undefined === input.identifier || "string" === typeof input.identifier) && (undefined === input.url || "string" === typeof input.url); const _io6 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && _io7(input.variables)); const _io7 = input => Object.keys(input).every(key => {
124
- const value = input[key];
125
- if (undefined === value)
126
- return true;
127
- return "object" === typeof value && null !== value && _io8(value);
128
- }); const _io8 = input => "string" === typeof input["default"] && (undefined === input["enum"] || Array.isArray(input["enum"]) && input["enum"].every(elem => "string" === typeof elem)) && (undefined === input.description || "string" === typeof input.description); const _io9 = input => Object.keys(input).every(key => {
129
- const value = input[key];
130
- if (undefined === value)
131
- return true;
132
- return "object" === typeof value && null !== value && _iu0(value);
133
- }); const _io10 = input => "apiKey" === input.type && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && (undefined === input.name || "string" === typeof input.name) && (undefined === input.description || "string" === typeof input.description); const _io11 = input => "http" === input.type && "basic" === input.scheme && (undefined === input.description || "string" === typeof input.description); const _io12 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat) && (undefined === input.description || "string" === typeof input.description); const _io13 = input => "oauth2" === input.type && ("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) && _io14(input.flows)) && (undefined === input.oauth2MetadataUrl || "string" === typeof input.oauth2MetadataUrl) && (undefined === input.description || "string" === typeof input.description); const _io14 = input => (undefined === input.authorizationCode || "object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) && _io15(input.authorizationCode)) && (undefined === input.implicit || "object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) && _io17(input.implicit)) && (undefined === input.password || "object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) && _io18(input.password)) && (undefined === input.clientCredentials || "object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) && _io18(input.clientCredentials)) && (undefined === input.deviceAuthorization || "object" === typeof input.deviceAuthorization && null !== input.deviceAuthorization && _io19(input.deviceAuthorization)); const _io15 = input => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && _io16(input.scopes)); const _io16 = input => Object.keys(input).every(key => {
134
- const value = input[key];
135
- if (undefined === value)
136
- return true;
137
- return "string" === typeof value;
138
- }); const _io17 = input => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && _io16(input.scopes)); const _io18 = input => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && _io16(input.scopes)); const _io19 = input => "string" === typeof input.deviceAuthorizationUrl && "string" === typeof input.tokenUrl && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && _io16(input.scopes)); const _io20 = input => "openIdConnect" === input.type && "string" === typeof input.openIdConnectUrl && (undefined === input.description || "string" === typeof input.description); const _io21 = input => "string" === typeof input.name && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.parent || "string" === typeof input.parent) && (undefined === input.kind || "string" === typeof input.kind); const _iu0 = input => (() => {
139
- if ("apiKey" === input.type)
140
- return _io10(input);
141
- else if ("basic" === input.scheme)
142
- return _io11(input);
143
- else if ("bearer" === input.scheme)
144
- return _io12(input);
145
- else if ("oauth2" === input.type)
146
- return _io13(input);
147
- else if ("openIdConnect" === input.type)
148
- return _io20(input);
149
- else
150
- return false;
151
- })(); const _ao0 = (input, _path, _exceptionable = true) => (null !== input.input || __typia_transform__assertGuard._assertGuard(_exceptionable, {
152
- method: "typia.assert",
153
- path: _path + ".input",
154
- expected: "(Array<string> | INestiaConfig.IInput | string)",
155
- value: input.input
156
- }, _errorFactory)) && (undefined !== input.input || __typia_transform__assertGuard._assertGuard(_exceptionable, {
157
- method: "typia.assert",
158
- path: _path + ".input",
159
- expected: "(Array<string> | INestiaConfig.IInput | string)",
160
- value: input.input
161
- }, _errorFactory)) && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every((elem, _index9) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
162
- method: "typia.assert",
163
- path: _path + ".input[" + _index9 + "]",
164
- expected: "string",
165
- value: elem
166
- }, _errorFactory)) || "object" === typeof input.input && null !== input.input && _ao1(input.input, _path + ".input", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
167
- method: "typia.assert",
168
- path: _path + ".input",
169
- expected: "(Array<string> | INestiaConfig.IInput | string)",
170
- value: input.input
171
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
172
- method: "typia.assert",
173
- path: _path + ".input",
174
- expected: "(Array<string> | INestiaConfig.IInput | string)",
175
- value: input.input
176
- }, _errorFactory)) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || __typia_transform__assertGuard._assertGuard(_exceptionable, {
177
- method: "typia.assert",
178
- path: _path + ".swagger",
179
- expected: "(INestiaConfig.ISwaggerConfig | undefined)",
180
- value: input.swagger
181
- }, _errorFactory)) && _ao2(input.swagger, _path + ".swagger", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
182
- method: "typia.assert",
183
- path: _path + ".swagger",
184
- expected: "(INestiaConfig.ISwaggerConfig | undefined)",
185
- value: input.swagger
186
- }, _errorFactory)) && (undefined === input.output || "string" === typeof input.output || __typia_transform__assertGuard._assertGuard(_exceptionable, {
187
- method: "typia.assert",
188
- path: _path + ".output",
189
- expected: "(string | undefined)",
190
- value: input.output
191
- }, _errorFactory)) && (undefined === input.distribute || "string" === typeof input.distribute || __typia_transform__assertGuard._assertGuard(_exceptionable, {
192
- method: "typia.assert",
193
- path: _path + ".distribute",
194
- expected: "(string | undefined)",
195
- value: input.distribute
196
- }, _errorFactory)) && (undefined === input.keyword || "boolean" === typeof input.keyword || __typia_transform__assertGuard._assertGuard(_exceptionable, {
197
- method: "typia.assert",
198
- path: _path + ".keyword",
199
- expected: "(boolean | undefined)",
200
- value: input.keyword
201
- }, _errorFactory)) && (undefined === input.simulate || "boolean" === typeof input.simulate || __typia_transform__assertGuard._assertGuard(_exceptionable, {
202
- method: "typia.assert",
203
- path: _path + ".simulate",
204
- expected: "(boolean | undefined)",
205
- value: input.simulate
206
- }, _errorFactory)) && (undefined === input.e2e || "string" === typeof input.e2e || __typia_transform__assertGuard._assertGuard(_exceptionable, {
207
- method: "typia.assert",
208
- path: _path + ".e2e",
209
- expected: "(string | undefined)",
210
- value: input.e2e
211
- }, _errorFactory)) && (undefined === input.propagate || "boolean" === typeof input.propagate || __typia_transform__assertGuard._assertGuard(_exceptionable, {
212
- method: "typia.assert",
213
- path: _path + ".propagate",
214
- expected: "(boolean | undefined)",
215
- value: input.propagate
216
- }, _errorFactory)) && (undefined === input.clone || "boolean" === typeof input.clone || __typia_transform__assertGuard._assertGuard(_exceptionable, {
217
- method: "typia.assert",
218
- path: _path + ".clone",
219
- expected: "(boolean | undefined)",
220
- value: input.clone
221
- }, _errorFactory)) && (undefined === input.primitive || "boolean" === typeof input.primitive || __typia_transform__assertGuard._assertGuard(_exceptionable, {
222
- method: "typia.assert",
223
- path: _path + ".primitive",
224
- expected: "(boolean | undefined)",
225
- value: input.primitive
226
- }, _errorFactory)) && (undefined === input.assert || "boolean" === typeof input.assert || __typia_transform__assertGuard._assertGuard(_exceptionable, {
227
- method: "typia.assert",
228
- path: _path + ".assert",
229
- expected: "(boolean | undefined)",
230
- value: input.assert
231
- }, _errorFactory)) && (undefined === input.json || "boolean" === typeof input.json || __typia_transform__assertGuard._assertGuard(_exceptionable, {
232
- method: "typia.assert",
233
- path: _path + ".json",
234
- expected: "(boolean | undefined)",
235
- value: input.json
236
- }, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
237
- method: "typia.assert",
238
- path: _path + ".include",
239
- expected: "Array<string>",
240
- value: input.include
241
- }, _errorFactory)) && input.include.every((elem, _index10) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
242
- method: "typia.assert",
243
- path: _path + ".include[" + _index10 + "]",
244
- expected: "string",
245
- value: elem
246
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
247
- method: "typia.assert",
248
- path: _path + ".include",
249
- expected: "Array<string>",
250
- value: input.include
251
- }, _errorFactory)) && (undefined === input.exclude || (Array.isArray(input.exclude) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
252
- method: "typia.assert",
253
- path: _path + ".exclude",
254
- expected: "(Array<string> | undefined)",
255
- value: input.exclude
256
- }, _errorFactory)) && input.exclude.every((elem, _index11) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
257
- method: "typia.assert",
258
- path: _path + ".exclude[" + _index11 + "]",
259
- expected: "string",
260
- value: elem
261
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
262
- method: "typia.assert",
263
- path: _path + ".exclude",
264
- expected: "(Array<string> | undefined)",
265
- value: input.exclude
266
- }, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || __typia_transform__assertGuard._assertGuard(_exceptionable, {
267
- method: "typia.assert",
268
- path: _path + ".output",
269
- expected: "string",
270
- value: input.output
271
- }, _errorFactory)) && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi || "3.2" === input.openapi || __typia_transform__assertGuard._assertGuard(_exceptionable, {
272
- method: "typia.assert",
273
- path: _path + ".openapi",
274
- expected: "(\"2.0\" | \"3.0\" | \"3.1\" | \"3.2\" | undefined)",
275
- value: input.openapi
276
- }, _errorFactory)) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || __typia_transform__assertGuard._assertGuard(_exceptionable, {
277
- method: "typia.assert",
278
- path: _path + ".beautify",
279
- expected: "(boolean | number | undefined)",
280
- value: input.beautify
281
- }, _errorFactory)) && (undefined === input.additional || "boolean" === typeof input.additional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
282
- method: "typia.assert",
283
- path: _path + ".additional",
284
- expected: "(boolean | undefined)",
285
- value: input.additional
286
- }, _errorFactory)) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
287
- method: "typia.assert",
288
- path: _path + ".info",
289
- expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
290
- value: input.info
291
- }, _errorFactory)) && _ao3(input.info, _path + ".info", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
292
- method: "typia.assert",
293
- path: _path + ".info",
294
- expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
295
- value: input.info
296
- }, _errorFactory)) && (undefined === input.servers || (Array.isArray(input.servers) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
297
- method: "typia.assert",
298
- path: _path + ".servers",
299
- expected: "(Array<OpenApi.IServer> | undefined)",
300
- value: input.servers
301
- }, _errorFactory)) && input.servers.every((elem, _index12) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
302
- method: "typia.assert",
303
- path: _path + ".servers[" + _index12 + "]",
304
- expected: "OpenApi.IServer",
305
- value: elem
306
- }, _errorFactory)) && _ao6(elem, _path + ".servers[" + _index12 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
307
- method: "typia.assert",
308
- path: _path + ".servers[" + _index12 + "]",
309
- expected: "OpenApi.IServer",
310
- value: elem
311
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
312
- method: "typia.assert",
313
- path: _path + ".servers",
314
- expected: "(Array<OpenApi.IServer> | undefined)",
315
- value: input.servers
316
- }, _errorFactory)) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
317
- method: "typia.assert",
318
- path: _path + ".security",
319
- expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
320
- value: input.security
321
- }, _errorFactory)) && _ao9(input.security, _path + ".security", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
322
- method: "typia.assert",
323
- path: _path + ".security",
324
- expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
325
- value: input.security
326
- }, _errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
327
- method: "typia.assert",
328
- path: _path + ".tags",
329
- expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
330
- value: input.tags
331
- }, _errorFactory)) && input.tags.every((elem, _index13) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
332
- method: "typia.assert",
333
- path: _path + ".tags[" + _index13 + "]",
334
- expected: "OpenApi.IDocument.ITag",
335
- value: elem
336
- }, _errorFactory)) && _ao21(elem, _path + ".tags[" + _index13 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
337
- method: "typia.assert",
338
- path: _path + ".tags[" + _index13 + "]",
339
- expected: "OpenApi.IDocument.ITag",
340
- value: elem
341
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
342
- method: "typia.assert",
343
- path: _path + ".tags",
344
- expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
345
- value: input.tags
346
- }, _errorFactory)) && (undefined === input.decompose || "boolean" === typeof input.decompose || __typia_transform__assertGuard._assertGuard(_exceptionable, {
347
- method: "typia.assert",
348
- path: _path + ".decompose",
349
- expected: "(boolean | undefined)",
350
- value: input.decompose
351
- }, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || __typia_transform__assertGuard._assertGuard(_exceptionable, {
352
- method: "typia.assert",
353
- path: _path + ".title",
354
- expected: "(string | undefined)",
355
- value: input.title
356
- }, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __typia_transform__assertGuard._assertGuard(_exceptionable, {
357
- method: "typia.assert",
358
- path: _path + ".summary",
359
- expected: "(string | undefined)",
360
- value: input.summary
361
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
362
- method: "typia.assert",
363
- path: _path + ".description",
364
- expected: "(string | undefined)",
365
- value: input.description
366
- }, _errorFactory)) && (undefined === input.termsOfService || "string" === typeof input.termsOfService || __typia_transform__assertGuard._assertGuard(_exceptionable, {
367
- method: "typia.assert",
368
- path: _path + ".termsOfService",
369
- expected: "(string | undefined)",
370
- value: input.termsOfService
371
- }, _errorFactory)) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
372
- method: "typia.assert",
373
- path: _path + ".contact",
374
- expected: "(OpenApi.IDocument.IContact | undefined)",
375
- value: input.contact
376
- }, _errorFactory)) && _ao4(input.contact, _path + ".contact", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
377
- method: "typia.assert",
378
- path: _path + ".contact",
379
- expected: "(OpenApi.IDocument.IContact | undefined)",
380
- value: input.contact
381
- }, _errorFactory)) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || __typia_transform__assertGuard._assertGuard(_exceptionable, {
382
- method: "typia.assert",
383
- path: _path + ".license",
384
- expected: "(OpenApi.IDocument.ILicense | undefined)",
385
- value: input.license
386
- }, _errorFactory)) && _ao5(input.license, _path + ".license", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
387
- method: "typia.assert",
388
- path: _path + ".license",
389
- expected: "(OpenApi.IDocument.ILicense | undefined)",
390
- value: input.license
391
- }, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __typia_transform__assertGuard._assertGuard(_exceptionable, {
392
- method: "typia.assert",
393
- path: _path + ".version",
394
- expected: "(string | undefined)",
395
- value: input.version
396
- }, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
397
- method: "typia.assert",
398
- path: _path + ".name",
399
- expected: "(string | undefined)",
400
- value: input.name
401
- }, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
402
- method: "typia.assert",
403
- path: _path + ".url",
404
- expected: "(string | undefined)",
405
- value: input.url
406
- }, _errorFactory)) && (undefined === input.email || "string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
407
- method: "typia.assert",
408
- path: _path + ".email",
409
- expected: "string & Format<\"email\">",
410
- value: input.email
411
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
412
- method: "typia.assert",
413
- path: _path + ".email",
414
- expected: "((string & Format<\"email\">) | undefined)",
415
- value: input.email
416
- }, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
417
- method: "typia.assert",
418
- path: _path + ".name",
419
- expected: "string",
420
- value: input.name
421
- }, _errorFactory)) && (undefined === input.identifier || "string" === typeof input.identifier || __typia_transform__assertGuard._assertGuard(_exceptionable, {
422
- method: "typia.assert",
423
- path: _path + ".identifier",
424
- expected: "(string | undefined)",
425
- value: input.identifier
426
- }, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
427
- method: "typia.assert",
428
- path: _path + ".url",
429
- expected: "(string | undefined)",
430
- value: input.url
431
- }, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
432
- method: "typia.assert",
433
- path: _path + ".url",
434
- expected: "string",
435
- value: input.url
436
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
437
- method: "typia.assert",
438
- path: _path + ".description",
439
- expected: "(string | undefined)",
440
- value: input.description
441
- }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
442
- method: "typia.assert",
443
- path: _path + ".variables",
444
- expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
445
- value: input.variables
446
- }, _errorFactory)) && _ao7(input.variables, _path + ".variables", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
447
- method: "typia.assert",
448
- path: _path + ".variables",
449
- expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
450
- value: input.variables
451
- }, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
452
- const value = input[key];
453
- if (undefined === value)
454
- return true;
455
- return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
456
- method: "typia.assert",
457
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
458
- expected: "OpenApi.IServer.IVariable",
459
- value: value
460
- }, _errorFactory)) && _ao8(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
461
- method: "typia.assert",
462
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
463
- expected: "OpenApi.IServer.IVariable",
464
- value: value
465
- }, _errorFactory);
466
- }); const _ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input["default"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
467
- method: "typia.assert",
468
- path: _path + "[\"default\"]",
469
- expected: "string",
470
- value: input["default"]
471
- }, _errorFactory)) && (undefined === input["enum"] || (Array.isArray(input["enum"]) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
472
- method: "typia.assert",
473
- path: _path + "[\"enum\"]",
474
- expected: "(Array<string> | undefined)",
475
- value: input["enum"]
476
- }, _errorFactory)) && input["enum"].every((elem, _index14) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
477
- method: "typia.assert",
478
- path: _path + "[\"enum\"][" + _index14 + "]",
479
- expected: "string",
480
- value: elem
481
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
482
- method: "typia.assert",
483
- path: _path + "[\"enum\"]",
484
- expected: "(Array<string> | undefined)",
485
- value: input["enum"]
486
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
487
- method: "typia.assert",
488
- path: _path + ".description",
489
- expected: "(string | undefined)",
490
- value: input.description
491
- }, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
492
- const value = input[key];
493
- if (undefined === value)
494
- return true;
495
- return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
496
- method: "typia.assert",
497
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
498
- expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
499
- value: value
500
- }, _errorFactory)) && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
501
- method: "typia.assert",
502
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
503
- expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
504
- value: value
505
- }, _errorFactory);
506
- }); const _ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
507
- method: "typia.assert",
508
- path: _path + ".type",
509
- expected: "\"apiKey\"",
510
- value: input.type
511
- }, _errorFactory)) && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
512
- method: "typia.assert",
513
- path: _path + "[\"in\"]",
514
- expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
515
- value: input["in"]
516
- }, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
517
- method: "typia.assert",
518
- path: _path + ".name",
519
- expected: "(string | undefined)",
520
- value: input.name
521
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
522
- method: "typia.assert",
523
- path: _path + ".description",
524
- expected: "(string | undefined)",
525
- value: input.description
526
- }, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => ("http" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
527
- method: "typia.assert",
528
- path: _path + ".type",
529
- expected: "\"http\"",
530
- value: input.type
531
- }, _errorFactory)) && ("basic" === input.scheme || __typia_transform__assertGuard._assertGuard(_exceptionable, {
532
- method: "typia.assert",
533
- path: _path + ".scheme",
534
- expected: "\"basic\"",
535
- value: input.scheme
536
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
537
- method: "typia.assert",
538
- path: _path + ".description",
539
- expected: "(string | undefined)",
540
- value: input.description
541
- }, _errorFactory)); const _ao12 = (input, _path, _exceptionable = true) => ("http" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
542
- method: "typia.assert",
543
- path: _path + ".type",
544
- expected: "\"http\"",
545
- value: input.type
546
- }, _errorFactory)) && ("bearer" === input.scheme || __typia_transform__assertGuard._assertGuard(_exceptionable, {
547
- method: "typia.assert",
548
- path: _path + ".scheme",
549
- expected: "\"bearer\"",
550
- value: input.scheme
551
- }, _errorFactory)) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || __typia_transform__assertGuard._assertGuard(_exceptionable, {
552
- method: "typia.assert",
553
- path: _path + ".bearerFormat",
554
- expected: "(string | undefined)",
555
- value: input.bearerFormat
556
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
557
- method: "typia.assert",
558
- path: _path + ".description",
559
- expected: "(string | undefined)",
560
- value: input.description
561
- }, _errorFactory)); const _ao13 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
562
- method: "typia.assert",
563
- path: _path + ".type",
564
- expected: "\"oauth2\"",
565
- value: input.type
566
- }, _errorFactory)) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
567
- method: "typia.assert",
568
- path: _path + ".flows",
569
- expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
570
- value: input.flows
571
- }, _errorFactory)) && _ao14(input.flows, _path + ".flows", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
572
- method: "typia.assert",
573
- path: _path + ".flows",
574
- expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
575
- value: input.flows
576
- }, _errorFactory)) && (undefined === input.oauth2MetadataUrl || "string" === typeof input.oauth2MetadataUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
577
- method: "typia.assert",
578
- path: _path + ".oauth2MetadataUrl",
579
- expected: "(string | undefined)",
580
- value: input.oauth2MetadataUrl
581
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
582
- method: "typia.assert",
583
- path: _path + ".description",
584
- expected: "(string | undefined)",
585
- value: input.description
586
- }, _errorFactory)); const _ao14 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
587
- method: "typia.assert",
588
- path: _path + ".authorizationCode",
589
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
590
- value: input.authorizationCode
591
- }, _errorFactory)) && _ao15(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
592
- method: "typia.assert",
593
- path: _path + ".authorizationCode",
594
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
595
- value: input.authorizationCode
596
- }, _errorFactory)) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
597
- method: "typia.assert",
598
- path: _path + ".implicit",
599
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
600
- value: input.implicit
601
- }, _errorFactory)) && _ao17(input.implicit, _path + ".implicit", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
602
- method: "typia.assert",
603
- path: _path + ".implicit",
604
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
605
- value: input.implicit
606
- }, _errorFactory)) && (undefined === input.password || ("object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
607
- method: "typia.assert",
608
- path: _path + ".password",
609
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
610
- value: input.password
611
- }, _errorFactory)) && _ao18(input.password, _path + ".password", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
612
- method: "typia.assert",
613
- path: _path + ".password",
614
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
615
- value: input.password
616
- }, _errorFactory)) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
617
- method: "typia.assert",
618
- path: _path + ".clientCredentials",
619
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
620
- value: input.clientCredentials
621
- }, _errorFactory)) && _ao18(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
622
- method: "typia.assert",
623
- path: _path + ".clientCredentials",
624
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
625
- value: input.clientCredentials
626
- }, _errorFactory)) && (undefined === input.deviceAuthorization || ("object" === typeof input.deviceAuthorization && null !== input.deviceAuthorization || __typia_transform__assertGuard._assertGuard(_exceptionable, {
627
- method: "typia.assert",
628
- path: _path + ".deviceAuthorization",
629
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IDeviceFlow | undefined)",
630
- value: input.deviceAuthorization
631
- }, _errorFactory)) && _ao19(input.deviceAuthorization, _path + ".deviceAuthorization", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
632
- method: "typia.assert",
633
- path: _path + ".deviceAuthorization",
634
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IDeviceFlow | undefined)",
635
- value: input.deviceAuthorization
636
- }, _errorFactory)); const _ao15 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
637
- method: "typia.assert",
638
- path: _path + ".authorizationUrl",
639
- expected: "(string | undefined)",
640
- value: input.authorizationUrl
641
- }, _errorFactory)) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
642
- method: "typia.assert",
643
- path: _path + ".tokenUrl",
644
- expected: "(string | undefined)",
645
- value: input.tokenUrl
646
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
647
- method: "typia.assert",
648
- path: _path + ".refreshUrl",
649
- expected: "(string | undefined)",
650
- value: input.refreshUrl
651
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
652
- method: "typia.assert",
653
- path: _path + ".scopes",
654
- expected: "(Record<string, string> | undefined)",
655
- value: input.scopes
656
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
657
- method: "typia.assert",
658
- path: _path + ".scopes",
659
- expected: "(Record<string, string> | undefined)",
660
- value: input.scopes
661
- }, _errorFactory)); const _ao16 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
662
- const value = input[key];
663
- if (undefined === value)
664
- return true;
665
- return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
666
- method: "typia.assert",
667
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
668
- expected: "string",
669
- value: value
670
- }, _errorFactory);
671
- }); const _ao17 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
672
- method: "typia.assert",
673
- path: _path + ".authorizationUrl",
674
- expected: "(string | undefined)",
675
- value: input.authorizationUrl
676
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
677
- method: "typia.assert",
678
- path: _path + ".refreshUrl",
679
- expected: "(string | undefined)",
680
- value: input.refreshUrl
681
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
682
- method: "typia.assert",
683
- path: _path + ".scopes",
684
- expected: "(Record<string, string> | undefined)",
685
- value: input.scopes
686
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
687
- method: "typia.assert",
688
- path: _path + ".scopes",
689
- expected: "(Record<string, string> | undefined)",
690
- value: input.scopes
691
- }, _errorFactory)); const _ao18 = (input, _path, _exceptionable = true) => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
692
- method: "typia.assert",
693
- path: _path + ".tokenUrl",
694
- expected: "(string | undefined)",
695
- value: input.tokenUrl
696
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
697
- method: "typia.assert",
698
- path: _path + ".refreshUrl",
699
- expected: "(string | undefined)",
700
- value: input.refreshUrl
701
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
702
- method: "typia.assert",
703
- path: _path + ".scopes",
704
- expected: "(Record<string, string> | undefined)",
705
- value: input.scopes
706
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
707
- method: "typia.assert",
708
- path: _path + ".scopes",
709
- expected: "(Record<string, string> | undefined)",
710
- value: input.scopes
711
- }, _errorFactory)); const _ao19 = (input, _path, _exceptionable = true) => ("string" === typeof input.deviceAuthorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
712
- method: "typia.assert",
713
- path: _path + ".deviceAuthorizationUrl",
714
- expected: "string",
715
- value: input.deviceAuthorizationUrl
716
- }, _errorFactory)) && ("string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
717
- method: "typia.assert",
718
- path: _path + ".tokenUrl",
719
- expected: "string",
720
- value: input.tokenUrl
721
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
722
- method: "typia.assert",
723
- path: _path + ".refreshUrl",
724
- expected: "(string | undefined)",
725
- value: input.refreshUrl
726
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
727
- method: "typia.assert",
728
- path: _path + ".scopes",
729
- expected: "(Record<string, string> | undefined)",
730
- value: input.scopes
731
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
732
- method: "typia.assert",
733
- path: _path + ".scopes",
734
- expected: "(Record<string, string> | undefined)",
735
- value: input.scopes
736
- }, _errorFactory)); const _ao20 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
737
- method: "typia.assert",
738
- path: _path + ".type",
739
- expected: "\"openIdConnect\"",
740
- value: input.type
741
- }, _errorFactory)) && ("string" === typeof input.openIdConnectUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
742
- method: "typia.assert",
743
- path: _path + ".openIdConnectUrl",
744
- expected: "string",
745
- value: input.openIdConnectUrl
746
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
747
- method: "typia.assert",
748
- path: _path + ".description",
749
- expected: "(string | undefined)",
750
- value: input.description
751
- }, _errorFactory)); const _ao21 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
752
- method: "typia.assert",
753
- path: _path + ".name",
754
- expected: "string",
755
- value: input.name
756
- }, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __typia_transform__assertGuard._assertGuard(_exceptionable, {
757
- method: "typia.assert",
758
- path: _path + ".summary",
759
- expected: "(string | undefined)",
760
- value: input.summary
761
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
762
- method: "typia.assert",
763
- path: _path + ".description",
764
- expected: "(string | undefined)",
765
- value: input.description
766
- }, _errorFactory)) && (undefined === input.parent || "string" === typeof input.parent || __typia_transform__assertGuard._assertGuard(_exceptionable, {
767
- method: "typia.assert",
768
- path: _path + ".parent",
769
- expected: "(string | undefined)",
770
- value: input.parent
771
- }, _errorFactory)) && (undefined === input.kind || "string" === typeof input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
772
- method: "typia.assert",
773
- path: _path + ".kind",
774
- expected: "(string | undefined)",
775
- value: input.kind
776
- }, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
777
- if ("apiKey" === input.type)
778
- return _ao10(input, _path, true && _exceptionable);
779
- else if ("basic" === input.scheme)
780
- return _ao11(input, _path, true && _exceptionable);
781
- else if ("bearer" === input.scheme)
782
- return _ao12(input, _path, true && _exceptionable);
783
- else if ("oauth2" === input.type)
784
- return _ao13(input, _path, true && _exceptionable);
785
- else if ("openIdConnect" === input.type)
786
- return _ao20(input, _path, true && _exceptionable);
787
- else
788
- return __typia_transform__assertGuard._assertGuard(_exceptionable, {
789
- method: "typia.assert",
790
- path: _path,
791
- expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
792
- value: input
793
- }, _errorFactory);
794
- })(); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
795
- if (false === __is(input)) {
796
- _errorFactory = errorFactory;
797
- ((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
798
- method: "typia.assert",
799
- path: _path + "",
800
- expected: "Array<INestiaConfig>",
801
- value: input
802
- }, _errorFactory)) && input.every((elem, _index8) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
803
- method: "typia.assert",
804
- path: _path + "[" + _index8 + "]",
805
- expected: "INestiaConfig",
806
- value: elem
807
- }, _errorFactory)) && _ao0(elem, _path + "[" + _index8 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
808
- method: "typia.assert",
809
- path: _path + "[" + _index8 + "]",
810
- expected: "INestiaConfig",
811
- value: elem
812
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
813
- method: "typia.assert",
814
- path: _path + "",
815
- expected: "Array<INestiaConfig>",
816
- value: input
817
- }, _errorFactory))(input, "$input", true);
818
- }
819
- return input;
820
- }; })()(configurations);
75
+ TtscExecutor_1.TtscExecutor.run({
76
+ cwd: projectRoot,
77
+ project: wrapperFile,
78
+ });
79
+ }
80
+ catch (error) {
81
+ const stderr = readChildOutput(error, "stderr");
82
+ const stdout = readChildOutput(error, "stdout");
83
+ const detail = stderr || stdout;
84
+ const cause = error instanceof Error ? error : new Error(String(error));
85
+ const status = (_b = cause.status) !== null && _b !== void 0 ? _b : cause.code;
86
+ throw new Error(detail
87
+ ? `failed to compile "${props.file}" through ttsc:\n${detail}`
88
+ : `failed to compile "${props.file}" through ttsc (exit code ${status !== null && status !== void 0 ? status : "unknown"}). Run \`npx ttsc -p ${projectFile}\` to see the underlying diagnostics.`, { cause });
89
+ }
90
+ finally {
91
+ fs_1.default.rmSync(wrapperRoot, { force: true, recursive: true });
92
+ }
93
+ const configKey = emittedJavaScriptKey(projectRoot, configFile);
94
+ const next = path_1.default.join(outputRoot, configKey);
95
+ if (fs_1.default.existsSync(next) === false)
96
+ throw new Error(`failed to materialize "${props.file}" through ttsc native transform.`);
97
+ return next;
98
+ });
99
+ const ensureMaterializedRoot = (projectRoot) => {
100
+ const root = path_1.default.join(projectRoot, "node_modules", ".nestia", "config-loader");
101
+ fs_1.default.mkdirSync(root, { recursive: true });
102
+ MATERIALIZED_ROOTS.add(root);
103
+ if (CLEANUP_REGISTERED === false) {
104
+ CLEANUP_REGISTERED = true;
105
+ const sweep = () => {
106
+ for (const location of MATERIALIZED_ROOTS)
107
+ fs_1.default.rmSync(location, { force: true, recursive: true });
108
+ };
109
+ process.once("exit", sweep);
110
+ // process.once("exit", …) does not fire on SIGINT/SIGTERM. Without
111
+ // these handlers a Ctrl-C during codegen leaves `run-*` and
112
+ // `tsconfig-*` mkdtempSync directories behind under
113
+ // node_modules/.nestia/config-loader/ until a subsequent clean exit.
114
+ // The module-level CLEANUP_REGISTERED flag above guards against
115
+ // re-entrancy within this module; we deliberately do NOT gate on
116
+ // `process.listenerCount(signal) > 0` because the parallel sweep in
117
+ // `ConfigAnalyzer.ensureRuntimeCleanup` (or any user-app SIGINT
118
+ // handler) could register first, and that gate would skip our
119
+ // registration — leaving MATERIALIZED_ROOTS unswept on Ctrl-C.
120
+ // Windows note: `process.kill(pid, "SIGINT")` calls TerminateProcess
121
+ // rather than re-raising; whichever module registers FIRST runs its
122
+ // sweep, the second is skipped, RUNTIME/MATERIALIZED cleanup is
123
+ // best-effort on Windows. SIGHUP is a no-op for most common code
124
+ // paths on Windows (Node fires it on console-close and exits within
125
+ // seconds).
126
+ const onSignal = (signal) => {
127
+ sweep();
128
+ process.kill(process.pid, signal);
129
+ };
130
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
131
+ process.once(signal, onSignal);
132
+ }
133
+ }
134
+ return root;
135
+ };
136
+ const emittedJavaScriptKey = (projectRoot, file) => {
137
+ const relative = path_1.default.relative(projectRoot, file);
138
+ const extension = path_1.default.extname(relative).toLowerCase();
139
+ const emitted = extension === ".mts" ? ".mjs" : extension === ".cts" ? ".cjs" : ".js";
140
+ return path_1.default
141
+ .join(path_1.default.dirname(relative), `${path_1.default.basename(relative, extension)}${emitted}`)
142
+ .split(path_1.default.sep)
143
+ .join(path_1.default.posix.sep);
144
+ };
145
+ const nodeAmbientCompilerOptions = (projectRoot, compilerOptions) => {
146
+ const typeRoots = uniqueStrings([
147
+ ...asStringArray(compilerOptions.typeRoots),
148
+ ...resolveNodeTypeRoots(projectRoot),
149
+ ]);
150
+ const types = uniqueStrings([
151
+ "node",
152
+ ...asStringArray(compilerOptions.types).filter((value) => value !== "*"),
153
+ ]);
154
+ return Object.assign(Object.assign({}, (typeRoots.length !== 0 ? { typeRoots } : {})), { types });
155
+ };
156
+ const resolveNodeTypeRoots = (projectRoot) => {
157
+ const roots = [];
158
+ for (const base of [projectRoot, process.cwd(), __dirname])
159
+ try {
160
+ const location = require.resolve("@types/node/package.json", {
161
+ paths: [base],
162
+ });
163
+ roots.push(path_1.default.dirname(path_1.default.dirname(location)));
164
+ }
165
+ catch (_a) {
166
+ continue;
167
+ }
168
+ return roots;
169
+ };
170
+ const asStringArray = (input) => Array.isArray(input)
171
+ ? input.filter((elem) => typeof elem === "string")
172
+ : [];
173
+ const uniqueStrings = (input) => [...new Set(input)];
174
+ const materializePlugins = (input) => {
175
+ const plugins = Array.isArray(input)
176
+ ? input
177
+ .filter((p) => typeof p === "object" && p !== null)
178
+ .map((p) => (Object.assign({}, p)))
179
+ : [];
180
+ const typia = plugins.find((p) => isTransform(p, "typia"));
181
+ const sdk = plugins.find((p) => isTransform(p, "@nestia/sdk"));
182
+ const core = plugins.find((p) => isTransform(p, "@nestia/core"));
183
+ return [
184
+ Object.assign(Object.assign({}, (typia !== null && typia !== void 0 ? typia : {})), { transform: "typia/lib/transform", enabled: false }),
185
+ normalizePlugin(Object.assign(Object.assign({}, (sdk !== null && sdk !== void 0 ? sdk : {})), { transform: "@nestia/sdk/lib/transform" })),
186
+ normalizePlugin(Object.assign(Object.assign({}, (core !== null && core !== void 0 ? core : {})), { transform: "@nestia/core/native/transform.cjs" })),
187
+ ];
188
+ };
189
+ const normalizePlugin = (plugin) => {
190
+ const output = Object.assign({}, plugin);
191
+ if (output.enabled === false)
192
+ delete output.enabled;
193
+ return output;
194
+ };
195
+ const isTransform = (plugin, name) => typeof plugin.transform === "string" && plugin.transform.includes(name);
196
+ const findConfigFile = (cwd, project) => {
197
+ const candidate = path_1.default.isAbsolute(project)
198
+ ? project
199
+ : path_1.default.resolve(cwd, project);
200
+ if (fs_1.default.existsSync(candidate))
201
+ return candidate;
202
+ if (path_1.default.isAbsolute(project) || project.includes(path_1.default.sep))
203
+ return undefined;
204
+ let current = path_1.default.resolve(cwd);
205
+ while (true) {
206
+ const next = path_1.default.join(current, project);
207
+ if (fs_1.default.existsSync(next))
208
+ return next;
209
+ const parent = path_1.default.dirname(current);
210
+ if (parent === current)
211
+ return undefined;
212
+ current = parent;
821
213
  }
822
- catch (exp) {
823
- if ((() => { const _io0 = input => "string" === typeof input.method && (undefined === input.path || "string" === typeof input.path) && "string" === typeof input.expected && true && (undefined === input.description || "string" === typeof input.description) && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack) && true; return input => "object" === typeof input && null !== input && _io0(input); })()(exp))
824
- exp.message = `invalid "${file}" data.`;
825
- throw exp;
214
+ };
215
+ const extractConfiguration = (file, loaded) => {
216
+ const candidates = [];
217
+ const collect = (value) => {
218
+ if (isObject(value)) {
219
+ candidates.push(value.default);
220
+ candidates.push(value.NESTIA_CONFIG);
221
+ if (isObject(value.default)) {
222
+ candidates.push(value.default.default);
223
+ candidates.push(value.default.NESTIA_CONFIG);
224
+ }
225
+ }
226
+ candidates.push(value);
227
+ };
228
+ collect(loaded);
229
+ const matched = candidates.find((value) => Array.isArray(value) ||
230
+ (isObject(value) && Object.hasOwn(value, "input")));
231
+ if (matched === undefined)
232
+ throw new Error(`invalid "${file}" data: configuration must be exported.`);
233
+ return matched;
234
+ };
235
+ const loadMaterializedModule = (file) => __awaiter(this, void 0, void 0, function* () {
236
+ if (file.endsWith(".mjs")) {
237
+ const dynamicImport = new Function("specifier", "return import(specifier)");
238
+ return dynamicImport((0, url_1.pathToFileURL)(file).href);
826
239
  }
240
+ return require(file);
827
241
  });
242
+ const assertPlugins = (file, input) => {
243
+ if (Array.isArray(input) &&
244
+ input.every((elem) => typeof elem === "object" && elem !== null))
245
+ return input;
246
+ throw new Error(`invalid "${file}" data: compilerOptions.plugins must be an array.`);
247
+ };
248
+ const assertConfigurations = (file, input) => {
249
+ input.forEach((config, index) => assertConfig(file, config, index));
250
+ return input;
251
+ };
252
+ const assertConfig = (file, input, index) => {
253
+ if (isObject(input) === false)
254
+ throw new Error(`invalid "${file}" data: configuration #${index} must be an object.`);
255
+ const config = input;
256
+ if (isInput(config.input) === false)
257
+ throw new Error(`invalid "${file}" data: configuration #${index}.input is invalid.`);
258
+ for (const [key, value] of [
259
+ ["output", config.output],
260
+ ["distribute", config.distribute],
261
+ ["e2e", config.e2e],
262
+ ])
263
+ if (value !== undefined && typeof value !== "string")
264
+ throw new Error(`invalid "${file}" data: configuration #${index}.${key} must be a string.`);
265
+ for (const [key, value] of [
266
+ ["keyword", config.keyword],
267
+ ["simulate", config.simulate],
268
+ ["propagate", config.propagate],
269
+ ["clone", config.clone],
270
+ ["primitive", config.primitive],
271
+ ["assert", config.assert],
272
+ ["json", config.json],
273
+ ])
274
+ if (value !== undefined && typeof value !== "boolean")
275
+ throw new Error(`invalid "${file}" data: configuration #${index}.${key} must be a boolean.`);
276
+ if (config.swagger !== undefined && isSwagger(config.swagger) === false)
277
+ throw new Error(`invalid "${file}" data: configuration #${index}.swagger is invalid.`);
278
+ };
279
+ const isInput = (input) => {
280
+ if (typeof input === "string" ||
281
+ typeof input === "function" ||
282
+ isStringArray(input))
283
+ return true;
284
+ if (isObject(input) === false)
285
+ return false;
286
+ return (isStringArray(input.include) &&
287
+ (input.exclude === undefined || isStringArray(input.exclude)));
288
+ };
289
+ const isSwagger = (input) => {
290
+ if (isObject(input) === false)
291
+ return false;
292
+ return (typeof input.output === "string" &&
293
+ (input.openapi === undefined ||
294
+ ["2.0", "3.0", "3.1", "3.2"].includes(input.openapi)) &&
295
+ (input.beautify === undefined ||
296
+ typeof input.beautify === "boolean" ||
297
+ typeof input.beautify === "number") &&
298
+ (input.additional === undefined ||
299
+ typeof input.additional === "boolean") &&
300
+ (input.decompose === undefined || typeof input.decompose === "boolean") &&
301
+ (input.operationId === undefined ||
302
+ typeof input.operationId === "function"));
303
+ };
304
+ const isObject = (input) => typeof input === "object" &&
305
+ input !== null &&
306
+ Array.isArray(input) === false;
307
+ const isStringArray = (input) => Array.isArray(input) && input.every((elem) => typeof elem === "string");
308
+ const readChildOutput = (error, key) => {
309
+ if (!error || typeof error !== "object" || !(key in error))
310
+ return "";
311
+ const value = error[key];
312
+ if (value === null || value === undefined)
313
+ return "";
314
+ if (typeof value === "string")
315
+ return value.trim();
316
+ if (Buffer.isBuffer(value))
317
+ return value.toString("utf8").trim();
318
+ return "";
319
+ };
828
320
  })(NestiaConfigLoader || (exports.NestiaConfigLoader = NestiaConfigLoader = {}));
829
321
  //# sourceMappingURL=NestiaConfigLoader.js.map