@nestia/sdk 11.2.0 → 12.0.0-dev.20260520.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 (270) 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 +1 -1
  37. package/lib/decorators/OperationMetadata.js.map +1 -1
  38. package/lib/executable/internal/CommandParser.js.map +1 -1
  39. package/lib/executable/internal/NestiaConfigLoader.d.ts +6 -2
  40. package/lib/executable/internal/NestiaConfigLoader.js +285 -792
  41. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  42. package/lib/executable/internal/NestiaSdkCommand.js +6 -4
  43. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  44. package/lib/executable/sdk.js +17 -5
  45. package/lib/executable/sdk.js.map +1 -1
  46. package/lib/generates/CloneGenerator.js +2 -2
  47. package/lib/generates/CloneGenerator.js.map +1 -1
  48. package/lib/generates/E2eGenerator.js.map +1 -1
  49. package/lib/generates/SdkGenerator.js +6 -9
  50. package/lib/generates/SdkGenerator.js.map +1 -1
  51. package/lib/generates/SwaggerGenerator.js +20 -107
  52. package/lib/generates/SwaggerGenerator.js.map +1 -1
  53. package/lib/generates/internal/E2eFileProgrammer.js +44 -28
  54. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  55. package/lib/generates/internal/FilePrinter.d.ts +4 -4
  56. package/lib/generates/internal/FilePrinter.js +25 -16
  57. package/lib/generates/internal/FilePrinter.js.map +1 -1
  58. package/lib/generates/internal/ImportDictionary.d.ts +2 -2
  59. package/lib/generates/internal/ImportDictionary.js +7 -5
  60. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  61. package/lib/generates/internal/SdkAliasCollection.d.ts +11 -11
  62. package/lib/generates/internal/SdkAliasCollection.js +27 -31
  63. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  64. package/lib/generates/internal/SdkDistributionComposer.js +15 -70
  65. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  66. package/lib/generates/internal/SdkFileProgrammer.js +2 -2
  67. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  68. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +2 -2
  69. package/lib/generates/internal/SdkHttpCloneProgrammer.js +6 -12
  70. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  71. package/lib/generates/internal/SdkHttpCloneReferencer.js +2 -1
  72. package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
  73. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +2 -2
  74. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +73 -77
  75. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  76. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +2 -2
  77. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +64 -66
  78. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  79. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +4 -10
  80. package/lib/generates/internal/SdkHttpParameterProgrammer.js +15 -22
  81. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  82. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +2 -2
  83. package/lib/generates/internal/SdkHttpRouteProgrammer.js +18 -20
  84. package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
  85. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +3 -3
  86. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +47 -49
  87. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  88. package/lib/generates/internal/SdkImportWizard.js.map +1 -1
  89. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  90. package/lib/generates/internal/SdkTypeProgrammer.d.ts +4 -4
  91. package/lib/generates/internal/SdkTypeProgrammer.js +66 -67
  92. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  93. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +1 -2
  94. package/lib/generates/internal/SdkTypeTagProgrammer.js +29 -11
  95. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  96. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +2 -2
  97. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +55 -55
  98. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  99. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +3 -3
  100. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +9 -12
  101. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  102. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +2 -2
  103. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +43 -45
  104. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  105. package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
  106. package/lib/generates/internal/SwaggerOperationComposer.d.ts +1 -1
  107. package/lib/generates/internal/SwaggerOperationComposer.js +5 -4
  108. package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
  109. package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +0 -3
  110. package/lib/generates/internal/SwaggerOperationParameterComposer.js +19 -20
  111. package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
  112. package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +1 -1
  113. package/lib/generates/internal/SwaggerOperationResponseComposer.js +4 -3
  114. package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
  115. package/lib/index.js.map +1 -1
  116. package/lib/internal/legacy.d.ts +180 -0
  117. package/lib/internal/legacy.js +361 -0
  118. package/lib/internal/legacy.js.map +1 -0
  119. package/lib/structures/INestiaProject.d.ts +0 -2
  120. package/lib/{transformers → structures}/IOperationMetadata.d.ts +2 -7
  121. package/lib/structures/IOperationMetadata.js.map +1 -0
  122. package/lib/structures/IReflectHttpOperationException.d.ts +1 -1
  123. package/lib/structures/IReflectHttpOperationParameter.d.ts +1 -1
  124. package/lib/structures/IReflectHttpOperationSuccess.d.ts +1 -1
  125. package/lib/structures/IReflectOperationError.d.ts +1 -1
  126. package/lib/structures/IReflectOperationError.js.map +1 -1
  127. package/lib/structures/IReflectWebSocketOperation.d.ts +2 -2
  128. package/lib/structures/ITypedApplication.d.ts +1 -1
  129. package/lib/structures/ITypedHttpRouteException.d.ts +1 -1
  130. package/lib/structures/ITypedHttpRouteParameter.d.ts +1 -1
  131. package/lib/structures/ITypedHttpRouteSuccess.d.ts +1 -1
  132. package/lib/structures/ITypedWebSocketRoute.d.ts +2 -2
  133. package/lib/transform.d.ts +9 -3
  134. package/lib/transform.js +47 -5
  135. package/lib/transform.js.map +1 -1
  136. package/lib/utils/ArrayUtil.js.map +1 -1
  137. package/lib/utils/FileRetriever.js.map +1 -1
  138. package/lib/utils/MapUtil.js.map +1 -1
  139. package/lib/utils/PathUtil.js.map +1 -1
  140. package/lib/utils/SourceFinder.js.map +1 -1
  141. package/lib/utils/StringUtil.js.map +1 -1
  142. package/lib/utils/TsConfigReader.d.ts +7 -0
  143. package/lib/utils/TsConfigReader.js +102 -0
  144. package/lib/utils/TsConfigReader.js.map +1 -0
  145. package/lib/utils/TtscExecutor.d.ts +8 -0
  146. package/lib/utils/TtscExecutor.js +58 -0
  147. package/lib/utils/TtscExecutor.js.map +1 -0
  148. package/lib/utils/VersioningStrategy.js.map +1 -1
  149. package/lib/validators/HttpHeadersValidator.d.ts +8 -5
  150. package/lib/validators/HttpHeadersValidator.js +7 -26
  151. package/lib/validators/HttpHeadersValidator.js.map +1 -1
  152. package/lib/validators/HttpQueryValidator.d.ts +8 -5
  153. package/lib/validators/HttpQueryValidator.js +7 -26
  154. package/lib/validators/HttpQueryValidator.js.map +1 -1
  155. package/lib/{transformers → validators}/TextPlainValidator.d.ts +1 -1
  156. package/lib/{transformers → validators}/TextPlainValidator.js +2 -1
  157. package/lib/validators/TextPlainValidator.js.map +1 -0
  158. package/package.json +21 -19
  159. package/src/NestiaSdkApplication.ts +9 -5
  160. package/src/NestiaSwaggerComposer.ts +2 -3
  161. package/src/analyses/ConfigAnalyzer.ts +175 -1
  162. package/src/analyses/ImportAnalyzer.ts +15 -49
  163. package/src/analyses/ReflectControllerAnalyzer.ts +1 -1
  164. package/src/analyses/ReflectHttpOperationAnalyzer.ts +1 -1
  165. package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +24 -6
  166. package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +3 -3
  167. package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +14 -10
  168. package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +2 -2
  169. package/src/analyses/TypedHttpRouteAnalyzer.ts +354 -22
  170. package/src/decorators/OperationMetadata.ts +1 -1
  171. package/src/executable/internal/NestiaConfigLoader.ts +419 -52
  172. package/src/executable/internal/NestiaSdkCommand.ts +9 -10
  173. package/src/executable/sdk.ts +15 -4
  174. package/src/generates/CloneGenerator.ts +10 -10
  175. package/src/generates/SwaggerGenerator.ts +28 -9
  176. package/src/generates/internal/E2eFileProgrammer.ts +80 -43
  177. package/src/generates/internal/FilePrinter.ts +38 -37
  178. package/src/generates/internal/ImportDictionary.ts +18 -16
  179. package/src/generates/internal/SdkAliasCollection.ts +41 -40
  180. package/src/generates/internal/SdkDistributionComposer.ts +21 -8
  181. package/src/generates/internal/SdkFileProgrammer.ts +7 -5
  182. package/src/generates/internal/SdkHttpCloneProgrammer.ts +10 -10
  183. package/src/generates/internal/SdkHttpCloneReferencer.ts +6 -6
  184. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +101 -78
  185. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +153 -145
  186. package/src/generates/internal/SdkHttpParameterProgrammer.ts +20 -33
  187. package/src/generates/internal/SdkHttpRouteProgrammer.ts +2 -2
  188. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +88 -86
  189. package/src/generates/internal/SdkTypeProgrammer.ts +93 -99
  190. package/src/generates/internal/SdkTypeTagProgrammer.ts +12 -12
  191. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +128 -118
  192. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +15 -13
  193. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +133 -112
  194. package/src/generates/internal/SwaggerOperationComposer.ts +1 -1
  195. package/src/generates/internal/SwaggerOperationParameterComposer.ts +10 -9
  196. package/src/generates/internal/SwaggerOperationResponseComposer.ts +1 -1
  197. package/src/internal/legacy.ts +492 -0
  198. package/src/structures/INestiaProject.ts +0 -3
  199. package/src/{transformers → structures}/IOperationMetadata.ts +2 -7
  200. package/src/structures/IReflectHttpOperationException.ts +1 -1
  201. package/src/structures/IReflectHttpOperationParameter.ts +1 -1
  202. package/src/structures/IReflectHttpOperationSuccess.ts +1 -1
  203. package/src/structures/IReflectOperationError.ts +1 -1
  204. package/src/structures/IReflectWebSocketOperation.ts +2 -2
  205. package/src/structures/ITypedApplication.ts +1 -1
  206. package/src/structures/ITypedHttpRouteException.ts +1 -1
  207. package/src/structures/ITypedHttpRouteParameter.ts +1 -1
  208. package/src/structures/ITypedHttpRouteSuccess.ts +1 -1
  209. package/src/structures/ITypedWebSocketRoute.ts +2 -2
  210. package/src/transform.ts +68 -7
  211. package/src/utils/TsConfigReader.ts +108 -0
  212. package/src/utils/TtscExecutor.ts +63 -0
  213. package/src/validators/HttpHeadersValidator.ts +8 -37
  214. package/src/validators/HttpQueryValidator.ts +8 -37
  215. package/src/{transformers → validators}/TextPlainValidator.ts +2 -2
  216. package/lib/analyses/DtoAnalyzer.d.ts +0 -21
  217. package/lib/analyses/DtoAnalyzer.js +0 -219
  218. package/lib/analyses/DtoAnalyzer.js.map +0 -1
  219. package/lib/analyses/ExceptionAnalyzer.d.ts +0 -0
  220. package/lib/analyses/ExceptionAnalyzer.js +0 -2
  221. package/lib/analyses/ExceptionAnalyzer.js.map +0 -1
  222. package/lib/analyses/GenericAnalyzer.d.ts +0 -4
  223. package/lib/analyses/GenericAnalyzer.js +0 -42
  224. package/lib/analyses/GenericAnalyzer.js.map +0 -1
  225. package/lib/structures/IReflectApplication.d.ts +0 -6
  226. package/lib/structures/IReflectApplication.js +0 -3
  227. package/lib/structures/IReflectApplication.js.map +0 -1
  228. package/lib/structures/MethodType.d.ts +0 -4
  229. package/lib/structures/MethodType.js +0 -8
  230. package/lib/structures/MethodType.js.map +0 -1
  231. package/lib/structures/ParamCategory.d.ts +0 -1
  232. package/lib/structures/ParamCategory.js +0 -3
  233. package/lib/structures/ParamCategory.js.map +0 -1
  234. package/lib/structures/TypeEntry.d.ts +0 -9
  235. package/lib/structures/TypeEntry.js +0 -21
  236. package/lib/structures/TypeEntry.js.map +0 -1
  237. package/lib/transformers/IOperationMetadata.js.map +0 -1
  238. package/lib/transformers/ISdkOperationTransformerContext.d.ts +0 -7
  239. package/lib/transformers/ISdkOperationTransformerContext.js +0 -3
  240. package/lib/transformers/ISdkOperationTransformerContext.js.map +0 -1
  241. package/lib/transformers/SdkOperationProgrammer.d.ts +0 -15
  242. package/lib/transformers/SdkOperationProgrammer.js +0 -186
  243. package/lib/transformers/SdkOperationProgrammer.js.map +0 -1
  244. package/lib/transformers/SdkOperationTransformer.d.ts +0 -4
  245. package/lib/transformers/SdkOperationTransformer.js +0 -128
  246. package/lib/transformers/SdkOperationTransformer.js.map +0 -1
  247. package/lib/transformers/TextPlainValidator.js.map +0 -1
  248. package/lib/utils/MetadataUtil.d.ts +0 -4
  249. package/lib/utils/MetadataUtil.js +0 -34
  250. package/lib/utils/MetadataUtil.js.map +0 -1
  251. package/lib/utils/StripEnums.d.ts +0 -3
  252. package/lib/utils/StripEnums.js +0 -3
  253. package/lib/utils/StripEnums.js.map +0 -1
  254. package/lib/utils/TypeLiteralExpression.d.ts +0 -0
  255. package/lib/utils/TypeLiteralExpression.js +0 -2
  256. package/lib/utils/TypeLiteralExpression.js.map +0 -1
  257. package/src/analyses/DtoAnalyzer.ts +0 -260
  258. package/src/analyses/ExceptionAnalyzer.ts +0 -154
  259. package/src/analyses/GenericAnalyzer.ts +0 -49
  260. package/src/structures/IReflectApplication.ts +0 -8
  261. package/src/structures/MethodType.ts +0 -5
  262. package/src/structures/ParamCategory.ts +0 -1
  263. package/src/structures/TypeEntry.ts +0 -22
  264. package/src/transformers/ISdkOperationTransformerContext.ts +0 -8
  265. package/src/transformers/SdkOperationProgrammer.ts +0 -240
  266. package/src/transformers/SdkOperationTransformer.ts +0 -248
  267. package/src/utils/MetadataUtil.ts +0 -26
  268. package/src/utils/StripEnums.ts +0 -5
  269. package/src/utils/TypeLiteralExpression.ts +0 -0
  270. /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,783 +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;
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
- if (!process[Symbol.for("ts-node.register.instance")])
107
- (0, ts_node_1.register)({
108
- emit: false,
109
- compilerOptions: Object.assign(Object.assign({}, compilerOptions), { plugins }),
110
- require: compilerOptions.baseUrl
111
- ? ["tsconfig-paths/register"]
112
- : undefined,
113
- });
114
- const loaded = yield Promise.resolve(`${path_1.default.resolve(file)}`).then(s => __importStar(require(s)));
115
- const instance = typeof (loaded === null || loaded === void 0 ? void 0 : loaded.default) === "object" && loaded.default !== null
116
- ? loaded.default
117
- : 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);
118
49
  const configurations = Array.isArray(instance)
119
50
  ? instance
120
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");
121
74
  try {
122
- 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 => {
123
- const value = input[key];
124
- if (undefined === value)
125
- return true;
126
- return "object" === typeof value && null !== value && _io8(value);
127
- }); 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 => {
128
- const value = input[key];
129
- if (undefined === value)
130
- return true;
131
- return "object" === typeof value && null !== value && _iu0(value);
132
- }); 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 => {
133
- const value = input[key];
134
- if (undefined === value)
135
- return true;
136
- return "string" === typeof value;
137
- }); 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 => (() => {
138
- if ("apiKey" === input.type)
139
- return _io10(input);
140
- else if ("basic" === input.scheme)
141
- return _io11(input);
142
- else if ("bearer" === input.scheme)
143
- return _io12(input);
144
- else if ("oauth2" === input.type)
145
- return _io13(input);
146
- else if ("openIdConnect" === input.type)
147
- return _io20(input);
148
- else
149
- return false;
150
- })(); const _ao0 = (input, _path, _exceptionable = true) => (null !== input.input || __typia_transform__assertGuard._assertGuard(_exceptionable, {
151
- method: "typia.assert",
152
- path: _path + ".input",
153
- expected: "(Array<string> | INestiaConfig.IInput | string)",
154
- value: input.input
155
- }, _errorFactory)) && (undefined !== input.input || __typia_transform__assertGuard._assertGuard(_exceptionable, {
156
- method: "typia.assert",
157
- path: _path + ".input",
158
- expected: "(Array<string> | INestiaConfig.IInput | string)",
159
- value: input.input
160
- }, _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, {
161
- method: "typia.assert",
162
- path: _path + ".input[" + _index9 + "]",
163
- expected: "string",
164
- value: elem
165
- }, _errorFactory)) || "object" === typeof input.input && null !== input.input && _ao1(input.input, _path + ".input", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
166
- method: "typia.assert",
167
- path: _path + ".input",
168
- expected: "(Array<string> | INestiaConfig.IInput | string)",
169
- value: input.input
170
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
171
- method: "typia.assert",
172
- path: _path + ".input",
173
- expected: "(Array<string> | INestiaConfig.IInput | string)",
174
- value: input.input
175
- }, _errorFactory)) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || __typia_transform__assertGuard._assertGuard(_exceptionable, {
176
- method: "typia.assert",
177
- path: _path + ".swagger",
178
- expected: "(INestiaConfig.ISwaggerConfig | undefined)",
179
- value: input.swagger
180
- }, _errorFactory)) && _ao2(input.swagger, _path + ".swagger", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
181
- method: "typia.assert",
182
- path: _path + ".swagger",
183
- expected: "(INestiaConfig.ISwaggerConfig | undefined)",
184
- value: input.swagger
185
- }, _errorFactory)) && (undefined === input.output || "string" === typeof input.output || __typia_transform__assertGuard._assertGuard(_exceptionable, {
186
- method: "typia.assert",
187
- path: _path + ".output",
188
- expected: "(string | undefined)",
189
- value: input.output
190
- }, _errorFactory)) && (undefined === input.distribute || "string" === typeof input.distribute || __typia_transform__assertGuard._assertGuard(_exceptionable, {
191
- method: "typia.assert",
192
- path: _path + ".distribute",
193
- expected: "(string | undefined)",
194
- value: input.distribute
195
- }, _errorFactory)) && (undefined === input.keyword || "boolean" === typeof input.keyword || __typia_transform__assertGuard._assertGuard(_exceptionable, {
196
- method: "typia.assert",
197
- path: _path + ".keyword",
198
- expected: "(boolean | undefined)",
199
- value: input.keyword
200
- }, _errorFactory)) && (undefined === input.simulate || "boolean" === typeof input.simulate || __typia_transform__assertGuard._assertGuard(_exceptionable, {
201
- method: "typia.assert",
202
- path: _path + ".simulate",
203
- expected: "(boolean | undefined)",
204
- value: input.simulate
205
- }, _errorFactory)) && (undefined === input.e2e || "string" === typeof input.e2e || __typia_transform__assertGuard._assertGuard(_exceptionable, {
206
- method: "typia.assert",
207
- path: _path + ".e2e",
208
- expected: "(string | undefined)",
209
- value: input.e2e
210
- }, _errorFactory)) && (undefined === input.propagate || "boolean" === typeof input.propagate || __typia_transform__assertGuard._assertGuard(_exceptionable, {
211
- method: "typia.assert",
212
- path: _path + ".propagate",
213
- expected: "(boolean | undefined)",
214
- value: input.propagate
215
- }, _errorFactory)) && (undefined === input.clone || "boolean" === typeof input.clone || __typia_transform__assertGuard._assertGuard(_exceptionable, {
216
- method: "typia.assert",
217
- path: _path + ".clone",
218
- expected: "(boolean | undefined)",
219
- value: input.clone
220
- }, _errorFactory)) && (undefined === input.primitive || "boolean" === typeof input.primitive || __typia_transform__assertGuard._assertGuard(_exceptionable, {
221
- method: "typia.assert",
222
- path: _path + ".primitive",
223
- expected: "(boolean | undefined)",
224
- value: input.primitive
225
- }, _errorFactory)) && (undefined === input.assert || "boolean" === typeof input.assert || __typia_transform__assertGuard._assertGuard(_exceptionable, {
226
- method: "typia.assert",
227
- path: _path + ".assert",
228
- expected: "(boolean | undefined)",
229
- value: input.assert
230
- }, _errorFactory)) && (undefined === input.json || "boolean" === typeof input.json || __typia_transform__assertGuard._assertGuard(_exceptionable, {
231
- method: "typia.assert",
232
- path: _path + ".json",
233
- expected: "(boolean | undefined)",
234
- value: input.json
235
- }, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
236
- method: "typia.assert",
237
- path: _path + ".include",
238
- expected: "Array<string>",
239
- value: input.include
240
- }, _errorFactory)) && input.include.every((elem, _index10) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
241
- method: "typia.assert",
242
- path: _path + ".include[" + _index10 + "]",
243
- expected: "string",
244
- value: elem
245
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
246
- method: "typia.assert",
247
- path: _path + ".include",
248
- expected: "Array<string>",
249
- value: input.include
250
- }, _errorFactory)) && (undefined === input.exclude || (Array.isArray(input.exclude) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
251
- method: "typia.assert",
252
- path: _path + ".exclude",
253
- expected: "(Array<string> | undefined)",
254
- value: input.exclude
255
- }, _errorFactory)) && input.exclude.every((elem, _index11) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
256
- method: "typia.assert",
257
- path: _path + ".exclude[" + _index11 + "]",
258
- expected: "string",
259
- value: elem
260
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
261
- method: "typia.assert",
262
- path: _path + ".exclude",
263
- expected: "(Array<string> | undefined)",
264
- value: input.exclude
265
- }, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || __typia_transform__assertGuard._assertGuard(_exceptionable, {
266
- method: "typia.assert",
267
- path: _path + ".output",
268
- expected: "string",
269
- value: input.output
270
- }, _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, {
271
- method: "typia.assert",
272
- path: _path + ".openapi",
273
- expected: "(\"2.0\" | \"3.0\" | \"3.1\" | \"3.2\" | undefined)",
274
- value: input.openapi
275
- }, _errorFactory)) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || __typia_transform__assertGuard._assertGuard(_exceptionable, {
276
- method: "typia.assert",
277
- path: _path + ".beautify",
278
- expected: "(boolean | number | undefined)",
279
- value: input.beautify
280
- }, _errorFactory)) && (undefined === input.additional || "boolean" === typeof input.additional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
281
- method: "typia.assert",
282
- path: _path + ".additional",
283
- expected: "(boolean | undefined)",
284
- value: input.additional
285
- }, _errorFactory)) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
286
- method: "typia.assert",
287
- path: _path + ".info",
288
- expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
289
- value: input.info
290
- }, _errorFactory)) && _ao3(input.info, _path + ".info", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
291
- method: "typia.assert",
292
- path: _path + ".info",
293
- expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
294
- value: input.info
295
- }, _errorFactory)) && (undefined === input.servers || (Array.isArray(input.servers) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
296
- method: "typia.assert",
297
- path: _path + ".servers",
298
- expected: "(Array<OpenApi.IServer> | undefined)",
299
- value: input.servers
300
- }, _errorFactory)) && input.servers.every((elem, _index12) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
301
- method: "typia.assert",
302
- path: _path + ".servers[" + _index12 + "]",
303
- expected: "OpenApi.IServer",
304
- value: elem
305
- }, _errorFactory)) && _ao6(elem, _path + ".servers[" + _index12 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
306
- method: "typia.assert",
307
- path: _path + ".servers[" + _index12 + "]",
308
- expected: "OpenApi.IServer",
309
- value: elem
310
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
311
- method: "typia.assert",
312
- path: _path + ".servers",
313
- expected: "(Array<OpenApi.IServer> | undefined)",
314
- value: input.servers
315
- }, _errorFactory)) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
316
- method: "typia.assert",
317
- path: _path + ".security",
318
- expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
319
- value: input.security
320
- }, _errorFactory)) && _ao9(input.security, _path + ".security", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
321
- method: "typia.assert",
322
- path: _path + ".security",
323
- expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
324
- value: input.security
325
- }, _errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
326
- method: "typia.assert",
327
- path: _path + ".tags",
328
- expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
329
- value: input.tags
330
- }, _errorFactory)) && input.tags.every((elem, _index13) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
331
- method: "typia.assert",
332
- path: _path + ".tags[" + _index13 + "]",
333
- expected: "OpenApi.IDocument.ITag",
334
- value: elem
335
- }, _errorFactory)) && _ao21(elem, _path + ".tags[" + _index13 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
336
- method: "typia.assert",
337
- path: _path + ".tags[" + _index13 + "]",
338
- expected: "OpenApi.IDocument.ITag",
339
- value: elem
340
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
341
- method: "typia.assert",
342
- path: _path + ".tags",
343
- expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
344
- value: input.tags
345
- }, _errorFactory)) && (undefined === input.decompose || "boolean" === typeof input.decompose || __typia_transform__assertGuard._assertGuard(_exceptionable, {
346
- method: "typia.assert",
347
- path: _path + ".decompose",
348
- expected: "(boolean | undefined)",
349
- value: input.decompose
350
- }, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || __typia_transform__assertGuard._assertGuard(_exceptionable, {
351
- method: "typia.assert",
352
- path: _path + ".title",
353
- expected: "(string | undefined)",
354
- value: input.title
355
- }, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __typia_transform__assertGuard._assertGuard(_exceptionable, {
356
- method: "typia.assert",
357
- path: _path + ".summary",
358
- expected: "(string | undefined)",
359
- value: input.summary
360
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
361
- method: "typia.assert",
362
- path: _path + ".description",
363
- expected: "(string | undefined)",
364
- value: input.description
365
- }, _errorFactory)) && (undefined === input.termsOfService || "string" === typeof input.termsOfService || __typia_transform__assertGuard._assertGuard(_exceptionable, {
366
- method: "typia.assert",
367
- path: _path + ".termsOfService",
368
- expected: "(string | undefined)",
369
- value: input.termsOfService
370
- }, _errorFactory)) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
371
- method: "typia.assert",
372
- path: _path + ".contact",
373
- expected: "(OpenApi.IDocument.IContact | undefined)",
374
- value: input.contact
375
- }, _errorFactory)) && _ao4(input.contact, _path + ".contact", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
376
- method: "typia.assert",
377
- path: _path + ".contact",
378
- expected: "(OpenApi.IDocument.IContact | undefined)",
379
- value: input.contact
380
- }, _errorFactory)) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || __typia_transform__assertGuard._assertGuard(_exceptionable, {
381
- method: "typia.assert",
382
- path: _path + ".license",
383
- expected: "(OpenApi.IDocument.ILicense | undefined)",
384
- value: input.license
385
- }, _errorFactory)) && _ao5(input.license, _path + ".license", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
386
- method: "typia.assert",
387
- path: _path + ".license",
388
- expected: "(OpenApi.IDocument.ILicense | undefined)",
389
- value: input.license
390
- }, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __typia_transform__assertGuard._assertGuard(_exceptionable, {
391
- method: "typia.assert",
392
- path: _path + ".version",
393
- expected: "(string | undefined)",
394
- value: input.version
395
- }, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
396
- method: "typia.assert",
397
- path: _path + ".name",
398
- expected: "(string | undefined)",
399
- value: input.name
400
- }, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
401
- method: "typia.assert",
402
- path: _path + ".url",
403
- expected: "(string | undefined)",
404
- value: input.url
405
- }, _errorFactory)) && (undefined === input.email || "string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
406
- method: "typia.assert",
407
- path: _path + ".email",
408
- expected: "string & Format<\"email\">",
409
- value: input.email
410
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
411
- method: "typia.assert",
412
- path: _path + ".email",
413
- expected: "((string & Format<\"email\">) | undefined)",
414
- value: input.email
415
- }, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
416
- method: "typia.assert",
417
- path: _path + ".name",
418
- expected: "string",
419
- value: input.name
420
- }, _errorFactory)) && (undefined === input.identifier || "string" === typeof input.identifier || __typia_transform__assertGuard._assertGuard(_exceptionable, {
421
- method: "typia.assert",
422
- path: _path + ".identifier",
423
- expected: "(string | undefined)",
424
- value: input.identifier
425
- }, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
426
- method: "typia.assert",
427
- path: _path + ".url",
428
- expected: "(string | undefined)",
429
- value: input.url
430
- }, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
431
- method: "typia.assert",
432
- path: _path + ".url",
433
- expected: "string",
434
- value: input.url
435
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
436
- method: "typia.assert",
437
- path: _path + ".description",
438
- expected: "(string | undefined)",
439
- value: input.description
440
- }, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
441
- method: "typia.assert",
442
- path: _path + ".variables",
443
- expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
444
- value: input.variables
445
- }, _errorFactory)) && _ao7(input.variables, _path + ".variables", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
446
- method: "typia.assert",
447
- path: _path + ".variables",
448
- expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
449
- value: input.variables
450
- }, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
451
- const value = input[key];
452
- if (undefined === value)
453
- return true;
454
- return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
455
- method: "typia.assert",
456
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
457
- expected: "OpenApi.IServer.IVariable",
458
- value: value
459
- }, _errorFactory)) && _ao8(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
460
- method: "typia.assert",
461
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
462
- expected: "OpenApi.IServer.IVariable",
463
- value: value
464
- }, _errorFactory);
465
- }); const _ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input["default"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
466
- method: "typia.assert",
467
- path: _path + "[\"default\"]",
468
- expected: "string",
469
- value: input["default"]
470
- }, _errorFactory)) && (undefined === input["enum"] || (Array.isArray(input["enum"]) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
471
- method: "typia.assert",
472
- path: _path + "[\"enum\"]",
473
- expected: "(Array<string> | undefined)",
474
- value: input["enum"]
475
- }, _errorFactory)) && input["enum"].every((elem, _index14) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
476
- method: "typia.assert",
477
- path: _path + "[\"enum\"][" + _index14 + "]",
478
- expected: "string",
479
- value: elem
480
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
481
- method: "typia.assert",
482
- path: _path + "[\"enum\"]",
483
- expected: "(Array<string> | undefined)",
484
- value: input["enum"]
485
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
486
- method: "typia.assert",
487
- path: _path + ".description",
488
- expected: "(string | undefined)",
489
- value: input.description
490
- }, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
491
- const value = input[key];
492
- if (undefined === value)
493
- return true;
494
- return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
495
- method: "typia.assert",
496
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
497
- expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
498
- value: value
499
- }, _errorFactory)) && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
500
- method: "typia.assert",
501
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
502
- expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
503
- value: value
504
- }, _errorFactory);
505
- }); const _ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
506
- method: "typia.assert",
507
- path: _path + ".type",
508
- expected: "\"apiKey\"",
509
- value: input.type
510
- }, _errorFactory)) && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
511
- method: "typia.assert",
512
- path: _path + "[\"in\"]",
513
- expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
514
- value: input["in"]
515
- }, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
516
- method: "typia.assert",
517
- path: _path + ".name",
518
- expected: "(string | undefined)",
519
- value: input.name
520
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
521
- method: "typia.assert",
522
- path: _path + ".description",
523
- expected: "(string | undefined)",
524
- value: input.description
525
- }, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => ("http" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
526
- method: "typia.assert",
527
- path: _path + ".type",
528
- expected: "\"http\"",
529
- value: input.type
530
- }, _errorFactory)) && ("basic" === input.scheme || __typia_transform__assertGuard._assertGuard(_exceptionable, {
531
- method: "typia.assert",
532
- path: _path + ".scheme",
533
- expected: "\"basic\"",
534
- value: input.scheme
535
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
536
- method: "typia.assert",
537
- path: _path + ".description",
538
- expected: "(string | undefined)",
539
- value: input.description
540
- }, _errorFactory)); const _ao12 = (input, _path, _exceptionable = true) => ("http" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
541
- method: "typia.assert",
542
- path: _path + ".type",
543
- expected: "\"http\"",
544
- value: input.type
545
- }, _errorFactory)) && ("bearer" === input.scheme || __typia_transform__assertGuard._assertGuard(_exceptionable, {
546
- method: "typia.assert",
547
- path: _path + ".scheme",
548
- expected: "\"bearer\"",
549
- value: input.scheme
550
- }, _errorFactory)) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || __typia_transform__assertGuard._assertGuard(_exceptionable, {
551
- method: "typia.assert",
552
- path: _path + ".bearerFormat",
553
- expected: "(string | undefined)",
554
- value: input.bearerFormat
555
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
556
- method: "typia.assert",
557
- path: _path + ".description",
558
- expected: "(string | undefined)",
559
- value: input.description
560
- }, _errorFactory)); const _ao13 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
561
- method: "typia.assert",
562
- path: _path + ".type",
563
- expected: "\"oauth2\"",
564
- value: input.type
565
- }, _errorFactory)) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
566
- method: "typia.assert",
567
- path: _path + ".flows",
568
- expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
569
- value: input.flows
570
- }, _errorFactory)) && _ao14(input.flows, _path + ".flows", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
571
- method: "typia.assert",
572
- path: _path + ".flows",
573
- expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
574
- value: input.flows
575
- }, _errorFactory)) && (undefined === input.oauth2MetadataUrl || "string" === typeof input.oauth2MetadataUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
576
- method: "typia.assert",
577
- path: _path + ".oauth2MetadataUrl",
578
- expected: "(string | undefined)",
579
- value: input.oauth2MetadataUrl
580
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
581
- method: "typia.assert",
582
- path: _path + ".description",
583
- expected: "(string | undefined)",
584
- value: input.description
585
- }, _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, {
586
- method: "typia.assert",
587
- path: _path + ".authorizationCode",
588
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
589
- value: input.authorizationCode
590
- }, _errorFactory)) && _ao15(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
591
- method: "typia.assert",
592
- path: _path + ".authorizationCode",
593
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
594
- value: input.authorizationCode
595
- }, _errorFactory)) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
596
- method: "typia.assert",
597
- path: _path + ".implicit",
598
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
599
- value: input.implicit
600
- }, _errorFactory)) && _ao17(input.implicit, _path + ".implicit", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
601
- method: "typia.assert",
602
- path: _path + ".implicit",
603
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
604
- value: input.implicit
605
- }, _errorFactory)) && (undefined === input.password || ("object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
606
- method: "typia.assert",
607
- path: _path + ".password",
608
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
609
- value: input.password
610
- }, _errorFactory)) && _ao18(input.password, _path + ".password", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
611
- method: "typia.assert",
612
- path: _path + ".password",
613
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
614
- value: input.password
615
- }, _errorFactory)) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
616
- method: "typia.assert",
617
- path: _path + ".clientCredentials",
618
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
619
- value: input.clientCredentials
620
- }, _errorFactory)) && _ao18(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
621
- method: "typia.assert",
622
- path: _path + ".clientCredentials",
623
- expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
624
- value: input.clientCredentials
625
- }, _errorFactory)) && (undefined === input.deviceAuthorization || ("object" === typeof input.deviceAuthorization && null !== input.deviceAuthorization || __typia_transform__assertGuard._assertGuard(_exceptionable, {
626
- method: "typia.assert",
627
- path: _path + ".deviceAuthorization",
628
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IDeviceFlow | undefined)",
629
- value: input.deviceAuthorization
630
- }, _errorFactory)) && _ao19(input.deviceAuthorization, _path + ".deviceAuthorization", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
631
- method: "typia.assert",
632
- path: _path + ".deviceAuthorization",
633
- expected: "(OpenApi.ISecurityScheme.IOAuth2.IDeviceFlow | undefined)",
634
- value: input.deviceAuthorization
635
- }, _errorFactory)); const _ao15 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
636
- method: "typia.assert",
637
- path: _path + ".authorizationUrl",
638
- expected: "(string | undefined)",
639
- value: input.authorizationUrl
640
- }, _errorFactory)) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
641
- method: "typia.assert",
642
- path: _path + ".tokenUrl",
643
- expected: "(string | undefined)",
644
- value: input.tokenUrl
645
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
646
- method: "typia.assert",
647
- path: _path + ".refreshUrl",
648
- expected: "(string | undefined)",
649
- value: input.refreshUrl
650
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
651
- method: "typia.assert",
652
- path: _path + ".scopes",
653
- expected: "(Record<string, string> | undefined)",
654
- value: input.scopes
655
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
656
- method: "typia.assert",
657
- path: _path + ".scopes",
658
- expected: "(Record<string, string> | undefined)",
659
- value: input.scopes
660
- }, _errorFactory)); const _ao16 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
661
- const value = input[key];
662
- if (undefined === value)
663
- return true;
664
- return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
665
- method: "typia.assert",
666
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
667
- expected: "string",
668
- value: value
669
- }, _errorFactory);
670
- }); const _ao17 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
671
- method: "typia.assert",
672
- path: _path + ".authorizationUrl",
673
- expected: "(string | undefined)",
674
- value: input.authorizationUrl
675
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
676
- method: "typia.assert",
677
- path: _path + ".refreshUrl",
678
- expected: "(string | undefined)",
679
- value: input.refreshUrl
680
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
681
- method: "typia.assert",
682
- path: _path + ".scopes",
683
- expected: "(Record<string, string> | undefined)",
684
- value: input.scopes
685
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
686
- method: "typia.assert",
687
- path: _path + ".scopes",
688
- expected: "(Record<string, string> | undefined)",
689
- value: input.scopes
690
- }, _errorFactory)); const _ao18 = (input, _path, _exceptionable = true) => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
691
- method: "typia.assert",
692
- path: _path + ".tokenUrl",
693
- expected: "(string | undefined)",
694
- value: input.tokenUrl
695
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
696
- method: "typia.assert",
697
- path: _path + ".refreshUrl",
698
- expected: "(string | undefined)",
699
- value: input.refreshUrl
700
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
701
- method: "typia.assert",
702
- path: _path + ".scopes",
703
- expected: "(Record<string, string> | undefined)",
704
- value: input.scopes
705
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
706
- method: "typia.assert",
707
- path: _path + ".scopes",
708
- expected: "(Record<string, string> | undefined)",
709
- value: input.scopes
710
- }, _errorFactory)); const _ao19 = (input, _path, _exceptionable = true) => ("string" === typeof input.deviceAuthorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
711
- method: "typia.assert",
712
- path: _path + ".deviceAuthorizationUrl",
713
- expected: "string",
714
- value: input.deviceAuthorizationUrl
715
- }, _errorFactory)) && ("string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
716
- method: "typia.assert",
717
- path: _path + ".tokenUrl",
718
- expected: "string",
719
- value: input.tokenUrl
720
- }, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
721
- method: "typia.assert",
722
- path: _path + ".refreshUrl",
723
- expected: "(string | undefined)",
724
- value: input.refreshUrl
725
- }, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
726
- method: "typia.assert",
727
- path: _path + ".scopes",
728
- expected: "(Record<string, string> | undefined)",
729
- value: input.scopes
730
- }, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
731
- method: "typia.assert",
732
- path: _path + ".scopes",
733
- expected: "(Record<string, string> | undefined)",
734
- value: input.scopes
735
- }, _errorFactory)); const _ao20 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
736
- method: "typia.assert",
737
- path: _path + ".type",
738
- expected: "\"openIdConnect\"",
739
- value: input.type
740
- }, _errorFactory)) && ("string" === typeof input.openIdConnectUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
741
- method: "typia.assert",
742
- path: _path + ".openIdConnectUrl",
743
- expected: "string",
744
- value: input.openIdConnectUrl
745
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
746
- method: "typia.assert",
747
- path: _path + ".description",
748
- expected: "(string | undefined)",
749
- value: input.description
750
- }, _errorFactory)); const _ao21 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
751
- method: "typia.assert",
752
- path: _path + ".name",
753
- expected: "string",
754
- value: input.name
755
- }, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __typia_transform__assertGuard._assertGuard(_exceptionable, {
756
- method: "typia.assert",
757
- path: _path + ".summary",
758
- expected: "(string | undefined)",
759
- value: input.summary
760
- }, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
761
- method: "typia.assert",
762
- path: _path + ".description",
763
- expected: "(string | undefined)",
764
- value: input.description
765
- }, _errorFactory)) && (undefined === input.parent || "string" === typeof input.parent || __typia_transform__assertGuard._assertGuard(_exceptionable, {
766
- method: "typia.assert",
767
- path: _path + ".parent",
768
- expected: "(string | undefined)",
769
- value: input.parent
770
- }, _errorFactory)) && (undefined === input.kind || "string" === typeof input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
771
- method: "typia.assert",
772
- path: _path + ".kind",
773
- expected: "(string | undefined)",
774
- value: input.kind
775
- }, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
776
- if ("apiKey" === input.type)
777
- return _ao10(input, _path, true && _exceptionable);
778
- else if ("basic" === input.scheme)
779
- return _ao11(input, _path, true && _exceptionable);
780
- else if ("bearer" === input.scheme)
781
- return _ao12(input, _path, true && _exceptionable);
782
- else if ("oauth2" === input.type)
783
- return _ao13(input, _path, true && _exceptionable);
784
- else if ("openIdConnect" === input.type)
785
- return _ao20(input, _path, true && _exceptionable);
786
- else
787
- return __typia_transform__assertGuard._assertGuard(_exceptionable, {
788
- method: "typia.assert",
789
- path: _path,
790
- expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
791
- value: input
792
- }, _errorFactory);
793
- })(); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
794
- if (false === __is(input)) {
795
- _errorFactory = errorFactory;
796
- ((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
797
- method: "typia.assert",
798
- path: _path + "",
799
- expected: "Array<INestiaConfig>",
800
- value: input
801
- }, _errorFactory)) && input.every((elem, _index8) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
802
- method: "typia.assert",
803
- path: _path + "[" + _index8 + "]",
804
- expected: "INestiaConfig",
805
- value: elem
806
- }, _errorFactory)) && _ao0(elem, _path + "[" + _index8 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
807
- method: "typia.assert",
808
- path: _path + "[" + _index8 + "]",
809
- expected: "INestiaConfig",
810
- value: elem
811
- }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
812
- method: "typia.assert",
813
- path: _path + "",
814
- expected: "Array<INestiaConfig>",
815
- value: input
816
- }, _errorFactory))(input, "$input", true);
817
- }
818
- return input;
819
- }; })()(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;
820
213
  }
821
- catch (exp) {
822
- 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))
823
- exp.message = `invalid "${file}" data.`;
824
- 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);
825
239
  }
240
+ return require(file);
826
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
+ };
827
320
  })(NestiaConfigLoader || (exports.NestiaConfigLoader = NestiaConfigLoader = {}));
828
321
  //# sourceMappingURL=NestiaConfigLoader.js.map