@nestia/sdk 14.0.1 → 14.0.2

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 (377) hide show
  1. package/assets/bundle/distribute/build-sdk.cjs +28 -0
  2. package/assets/bundle/distribute/package.json +6 -2
  3. package/lib/INestiaConfig.d.ts +55 -24
  4. package/lib/NestiaSdkApplication.d.ts +60 -0
  5. package/lib/NestiaSdkApplication.js +63 -5
  6. package/lib/NestiaSdkApplication.js.map +1 -1
  7. package/lib/NestiaSwaggerComposer.d.ts +21 -0
  8. package/lib/NestiaSwaggerComposer.js +21 -3
  9. package/lib/NestiaSwaggerComposer.js.map +1 -1
  10. package/lib/analyses/AccessorAnalyzer.d.ts +26 -0
  11. package/lib/analyses/AccessorAnalyzer.js +26 -0
  12. package/lib/analyses/AccessorAnalyzer.js.map +1 -1
  13. package/lib/analyses/ConfigAnalyzer.d.ts +41 -0
  14. package/lib/analyses/ConfigAnalyzer.js +48 -73
  15. package/lib/analyses/ConfigAnalyzer.js.map +1 -1
  16. package/lib/analyses/ImportAnalyzer.d.ts +25 -0
  17. package/lib/analyses/ImportAnalyzer.js +25 -0
  18. package/lib/analyses/ImportAnalyzer.js.map +1 -1
  19. package/lib/analyses/ParameterNameAnalyzer.d.ts +24 -0
  20. package/lib/analyses/ParameterNameAnalyzer.js +15 -0
  21. package/lib/analyses/ParameterNameAnalyzer.js.map +1 -1
  22. package/lib/analyses/PathAnalyzer.d.ts +63 -1
  23. package/lib/analyses/PathAnalyzer.js +54 -9
  24. package/lib/analyses/PathAnalyzer.js.map +1 -1
  25. package/lib/analyses/ReflectControllerAnalyzer.d.ts +32 -0
  26. package/lib/analyses/ReflectControllerAnalyzer.js +22 -0
  27. package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
  28. package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +29 -0
  29. package/lib/analyses/ReflectHttpOperationAnalyzer.js +28 -17
  30. package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
  31. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +31 -0
  32. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +21 -0
  33. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
  34. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +31 -0
  35. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +21 -0
  36. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
  37. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +32 -0
  38. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +22 -0
  39. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
  40. package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +29 -0
  41. package/lib/analyses/ReflectMcpOperationAnalyzer.js +30 -9
  42. package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -1
  43. package/lib/analyses/ReflectMetadataAnalyzer.d.ts +47 -0
  44. package/lib/analyses/ReflectMetadataAnalyzer.js +47 -0
  45. package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
  46. package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +29 -0
  47. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +21 -2
  48. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
  49. package/lib/analyses/SecurityAnalyzer.d.ts +15 -0
  50. package/lib/analyses/SecurityAnalyzer.js +15 -0
  51. package/lib/analyses/SecurityAnalyzer.js.map +1 -1
  52. package/lib/analyses/SwaggerExampleAnalyzer.d.ts +16 -0
  53. package/lib/analyses/SwaggerExampleAnalyzer.js +16 -0
  54. package/lib/analyses/SwaggerExampleAnalyzer.js.map +1 -1
  55. package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +41 -3
  56. package/lib/analyses/TypedHttpRouteAnalyzer.js +172 -157
  57. package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
  58. package/lib/analyses/TypedMcpRouteAnalyzer.d.ts +29 -0
  59. package/lib/analyses/TypedMcpRouteAnalyzer.js +152 -20
  60. package/lib/analyses/TypedMcpRouteAnalyzer.js.map +1 -1
  61. package/lib/analyses/TypedWebSocketRouteAnalyzer.d.ts +19 -0
  62. package/lib/analyses/TypedWebSocketRouteAnalyzer.js +19 -0
  63. package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
  64. package/lib/decorators/OperationMetadata.d.ts +6 -0
  65. package/lib/decorators/OperationMetadata.js +6 -0
  66. package/lib/decorators/OperationMetadata.js.map +1 -1
  67. package/lib/executable/internal/CommandParser.d.ts +19 -0
  68. package/lib/executable/internal/CommandParser.js +19 -0
  69. package/lib/executable/internal/CommandParser.js.map +1 -1
  70. package/lib/executable/internal/NestiaConfigLoader.d.ts +56 -0
  71. package/lib/executable/internal/NestiaConfigLoader.js +48 -42
  72. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  73. package/lib/executable/internal/NestiaSdkCommand.d.ts +60 -0
  74. package/lib/executable/internal/NestiaSdkCommand.js +95 -3
  75. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  76. package/lib/executable/internal/NestiaSdkWatcher.d.ts +81 -0
  77. package/lib/executable/internal/NestiaSdkWatcher.js +122 -38
  78. package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -1
  79. package/lib/executable/internal/NestiaSwaggerWatch.d.ts +80 -0
  80. package/lib/executable/internal/NestiaSwaggerWatch.js +308 -0
  81. package/lib/executable/internal/NestiaSwaggerWatch.js.map +1 -0
  82. package/lib/factories/ExpressionFactory.d.ts +17 -2
  83. package/lib/factories/ExpressionFactory.js +17 -2
  84. package/lib/factories/ExpressionFactory.js.map +1 -1
  85. package/lib/factories/IdentifierFactory.d.ts +24 -0
  86. package/lib/factories/IdentifierFactory.js +24 -0
  87. package/lib/factories/IdentifierFactory.js.map +1 -1
  88. package/lib/factories/LiteralFactory.d.ts +22 -4
  89. package/lib/factories/LiteralFactory.js +30 -10
  90. package/lib/factories/LiteralFactory.js.map +1 -1
  91. package/lib/factories/StatementFactory.d.ts +28 -1
  92. package/lib/factories/StatementFactory.js +28 -1
  93. package/lib/factories/StatementFactory.js.map +1 -1
  94. package/lib/factories/TypeFactory.d.ts +24 -0
  95. package/lib/factories/TypeFactory.js +15 -0
  96. package/lib/factories/TypeFactory.js.map +1 -1
  97. package/lib/generates/CloneGenerator.d.ts +22 -0
  98. package/lib/generates/CloneGenerator.js +26 -5
  99. package/lib/generates/CloneGenerator.js.map +1 -1
  100. package/lib/generates/E2eGenerator.d.ts +19 -0
  101. package/lib/generates/E2eGenerator.js +19 -0
  102. package/lib/generates/E2eGenerator.js.map +1 -1
  103. package/lib/generates/SdkGenerator.d.ts +38 -0
  104. package/lib/generates/SdkGenerator.js +40 -2
  105. package/lib/generates/SdkGenerator.js.map +1 -1
  106. package/lib/generates/SwaggerGenerator.d.ts +36 -6
  107. package/lib/generates/SwaggerGenerator.js +55 -13
  108. package/lib/generates/SwaggerGenerator.js.map +1 -1
  109. package/lib/generates/internal/E2eFileProgrammer.d.ts +19 -0
  110. package/lib/generates/internal/E2eFileProgrammer.js +20 -1
  111. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  112. package/lib/generates/internal/FilePrinter.d.ts +43 -0
  113. package/lib/generates/internal/FilePrinter.js +43 -0
  114. package/lib/generates/internal/FilePrinter.js.map +1 -1
  115. package/lib/generates/internal/ImportDictionary.d.ts +92 -2
  116. package/lib/generates/internal/ImportDictionary.js +91 -3
  117. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  118. package/lib/generates/internal/SdkAliasCollection.d.ts +119 -0
  119. package/lib/generates/internal/SdkAliasCollection.js +124 -7
  120. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  121. package/lib/generates/internal/SdkDistributionComposer.d.ts +19 -0
  122. package/lib/generates/internal/SdkDistributionComposer.js +98 -59
  123. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  124. package/lib/generates/internal/SdkFileProgrammer.d.ts +18 -0
  125. package/lib/generates/internal/SdkFileProgrammer.js +18 -0
  126. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  127. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +29 -0
  128. package/lib/generates/internal/SdkHttpCloneProgrammer.js +33 -0
  129. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  130. package/lib/generates/internal/SdkHttpCloneReferencer.d.ts +19 -0
  131. package/lib/generates/internal/SdkHttpCloneReferencer.js +78 -25
  132. package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
  133. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +19 -0
  134. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +19 -0
  135. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  136. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +19 -0
  137. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +19 -0
  138. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  139. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +104 -2
  140. package/lib/generates/internal/SdkHttpParameterProgrammer.js +70 -0
  141. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  142. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +20 -0
  143. package/lib/generates/internal/SdkHttpRouteProgrammer.js +20 -0
  144. package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
  145. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +38 -0
  146. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +49 -5
  147. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  148. package/lib/generates/internal/SdkImportWizard.d.ts +63 -0
  149. package/lib/generates/internal/SdkImportWizard.js +63 -0
  150. package/lib/generates/internal/SdkImportWizard.js.map +1 -1
  151. package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +17 -2
  152. package/lib/generates/internal/SdkMcpRouteProgrammer.js +33 -13
  153. package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
  154. package/lib/generates/internal/SdkPathTemplate.d.ts +15 -0
  155. package/lib/generates/internal/SdkPathTemplate.js +15 -0
  156. package/lib/generates/internal/SdkPathTemplate.js.map +1 -1
  157. package/lib/generates/internal/SdkRouteDirectory.d.ts +10 -0
  158. package/lib/generates/internal/SdkRouteDirectory.js +10 -0
  159. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  160. package/lib/generates/internal/SdkTypeProgrammer.d.ts +54 -1
  161. package/lib/generates/internal/SdkTypeProgrammer.js +96 -12
  162. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  163. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +36 -3
  164. package/lib/generates/internal/SdkTypeTagProgrammer.js +28 -7
  165. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  166. package/lib/generates/internal/SdkWebSocketCloneProgrammer.d.ts +40 -0
  167. package/lib/generates/internal/SdkWebSocketCloneProgrammer.js +149 -142
  168. package/lib/generates/internal/SdkWebSocketCloneProgrammer.js.map +1 -1
  169. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +19 -0
  170. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +19 -0
  171. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  172. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +81 -2
  173. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +48 -0
  174. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  175. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +18 -0
  176. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +18 -0
  177. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  178. package/lib/generates/internal/SwaggerDescriptionComposer.d.ts +42 -0
  179. package/lib/generates/internal/SwaggerDescriptionComposer.js +44 -1
  180. package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
  181. package/lib/generates/internal/SwaggerOperationComposer.d.ts +18 -0
  182. package/lib/generates/internal/SwaggerOperationComposer.js +18 -0
  183. package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
  184. package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +39 -0
  185. package/lib/generates/internal/SwaggerOperationParameterComposer.js +31 -8
  186. package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
  187. package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +19 -0
  188. package/lib/generates/internal/SwaggerOperationResponseComposer.js +19 -0
  189. package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
  190. package/lib/internal/legacy.d.ts +296 -16
  191. package/lib/internal/legacy.js +127 -10
  192. package/lib/internal/legacy.js.map +1 -1
  193. package/lib/structures/INestiaProject.d.ts +10 -0
  194. package/lib/structures/INestiaSdkInput.d.ts +30 -0
  195. package/lib/structures/IOperationMetadata.d.ts +55 -0
  196. package/lib/structures/IReflectController.d.ts +10 -0
  197. package/lib/structures/IReflectHttpOperation.d.ts +10 -0
  198. package/lib/structures/IReflectHttpOperationException.d.ts +10 -0
  199. package/lib/structures/IReflectHttpOperationParameter.d.ts +47 -0
  200. package/lib/structures/IReflectHttpOperationSuccess.d.ts +11 -0
  201. package/lib/structures/IReflectImport.d.ts +10 -0
  202. package/lib/structures/IReflectMcpOperation.d.ts +19 -0
  203. package/lib/structures/IReflectMcpOperationParameter.d.ts +9 -0
  204. package/lib/structures/IReflectOperationError.d.ts +28 -0
  205. package/lib/structures/IReflectOperationError.js +22 -2
  206. package/lib/structures/IReflectOperationError.js.map +1 -1
  207. package/lib/structures/IReflectType.d.ts +9 -0
  208. package/lib/structures/IReflectWebSocketOperation.d.ts +10 -0
  209. package/lib/structures/IReflectWebSocketOperationParameter.d.ts +55 -0
  210. package/lib/structures/ITypedApplication.d.ts +10 -0
  211. package/lib/structures/ITypedHttpRoute.d.ts +10 -0
  212. package/lib/structures/ITypedHttpRouteException.d.ts +10 -0
  213. package/lib/structures/ITypedHttpRouteParameter.d.ts +45 -0
  214. package/lib/structures/ITypedHttpRouteSuccess.d.ts +10 -0
  215. package/lib/structures/ITypedMcpRoute.d.ts +11 -0
  216. package/lib/structures/ITypedWebSocketRoute.d.ts +10 -0
  217. package/lib/transform.d.ts +6 -0
  218. package/lib/transform.js +6 -0
  219. package/lib/transform.js.map +1 -1
  220. package/lib/utils/ArrayUtil.d.ts +31 -1
  221. package/lib/utils/ArrayUtil.js +32 -11
  222. package/lib/utils/ArrayUtil.js.map +1 -1
  223. package/lib/utils/EmittedJavaScriptPatcher.d.ts +20 -0
  224. package/lib/utils/EmittedJavaScriptPatcher.js +65 -46
  225. package/lib/utils/EmittedJavaScriptPatcher.js.map +1 -1
  226. package/lib/utils/FileRetriever.d.ts +29 -0
  227. package/lib/utils/FileRetriever.js +29 -0
  228. package/lib/utils/FileRetriever.js.map +1 -1
  229. package/lib/utils/HttpResponseContentTypeUtil.d.ts +41 -0
  230. package/lib/utils/HttpResponseContentTypeUtil.js +31 -0
  231. package/lib/utils/HttpResponseContentTypeUtil.js.map +1 -1
  232. package/lib/utils/MapUtil.d.ts +64 -1
  233. package/lib/utils/MapUtil.js +24 -3
  234. package/lib/utils/MapUtil.js.map +1 -1
  235. package/lib/utils/PathUtil.d.ts +31 -0
  236. package/lib/utils/PathUtil.js +38 -0
  237. package/lib/utils/PathUtil.js.map +1 -1
  238. package/lib/utils/SdkBundlePath.d.ts +2 -0
  239. package/lib/utils/SdkBundlePath.js +10 -0
  240. package/lib/utils/SdkBundlePath.js.map +1 -0
  241. package/lib/utils/SdkInputFilter.d.ts +31 -0
  242. package/lib/utils/SdkInputFilter.js +115 -0
  243. package/lib/utils/SdkInputFilter.js.map +1 -0
  244. package/lib/utils/SourceFinder.d.ts +35 -0
  245. package/lib/utils/SourceFinder.js +47 -12
  246. package/lib/utils/SourceFinder.js.map +1 -1
  247. package/lib/utils/StringUtil.d.ts +77 -2
  248. package/lib/utils/StringUtil.js +166 -4
  249. package/lib/utils/StringUtil.js.map +1 -1
  250. package/lib/utils/TemporaryDirectory.d.ts +60 -0
  251. package/lib/utils/TemporaryDirectory.js +112 -0
  252. package/lib/utils/TemporaryDirectory.js.map +1 -0
  253. package/lib/utils/TsConfigReader.d.ts +42 -0
  254. package/lib/utils/TsConfigReader.js +98 -14
  255. package/lib/utils/TsConfigReader.js.map +1 -1
  256. package/lib/utils/TtscExecutor.d.ts +23 -1
  257. package/lib/utils/TtscExecutor.js +22 -0
  258. package/lib/utils/TtscExecutor.js.map +1 -1
  259. package/lib/utils/VersioningStrategy.d.ts +26 -1
  260. package/lib/utils/VersioningStrategy.js +30 -9
  261. package/lib/utils/VersioningStrategy.js.map +1 -1
  262. package/lib/validators/TextPlainValidator.d.ts +19 -0
  263. package/lib/validators/TextPlainValidator.js +19 -0
  264. package/lib/validators/TextPlainValidator.js.map +1 -1
  265. package/native/go.mod +1 -1
  266. package/native/go.sum +2 -2
  267. package/native/sdk/register.go +12 -2
  268. package/native/sdk/sdk_metadata_json.go +6 -1
  269. package/native/sdk/sdk_transform.go +388 -397
  270. package/package.json +7 -5
  271. package/src/INestiaConfig.ts +55 -24
  272. package/src/NestiaSdkApplication.ts +66 -7
  273. package/src/NestiaSwaggerComposer.ts +21 -6
  274. package/src/analyses/AccessorAnalyzer.ts +26 -0
  275. package/src/analyses/ConfigAnalyzer.ts +49 -87
  276. package/src/analyses/ImportAnalyzer.ts +25 -0
  277. package/src/analyses/ParameterNameAnalyzer.ts +24 -0
  278. package/src/analyses/PathAnalyzer.ts +63 -11
  279. package/src/analyses/ReflectControllerAnalyzer.ts +32 -0
  280. package/src/analyses/ReflectHttpOperationAnalyzer.ts +32 -10
  281. package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +31 -0
  282. package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +31 -0
  283. package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +32 -0
  284. package/src/analyses/ReflectMcpOperationAnalyzer.ts +32 -1
  285. package/src/analyses/ReflectMetadataAnalyzer.ts +47 -0
  286. package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +33 -4
  287. package/src/analyses/SecurityAnalyzer.ts +15 -0
  288. package/src/analyses/SwaggerExampleAnalyzer.ts +16 -0
  289. package/src/analyses/TypedHttpRouteAnalyzer.ts +240 -184
  290. package/src/analyses/TypedMcpRouteAnalyzer.ts +180 -20
  291. package/src/analyses/TypedWebSocketRouteAnalyzer.ts +19 -0
  292. package/src/decorators/OperationMetadata.ts +6 -0
  293. package/src/executable/internal/CommandParser.ts +19 -0
  294. package/src/executable/internal/NestiaConfigLoader.ts +66 -50
  295. package/src/executable/internal/NestiaSdkCommand.ts +96 -3
  296. package/src/executable/internal/NestiaSdkWatcher.ts +169 -41
  297. package/src/executable/internal/NestiaSwaggerWatch.ts +359 -0
  298. package/src/factories/ExpressionFactory.ts +17 -2
  299. package/src/factories/IdentifierFactory.ts +24 -0
  300. package/src/factories/LiteralFactory.ts +44 -11
  301. package/src/factories/StatementFactory.ts +28 -1
  302. package/src/factories/TypeFactory.ts +24 -0
  303. package/src/generates/CloneGenerator.ts +26 -5
  304. package/src/generates/E2eGenerator.ts +19 -0
  305. package/src/generates/SdkGenerator.ts +40 -9
  306. package/src/generates/SwaggerGenerator.ts +56 -14
  307. package/src/generates/internal/E2eFileProgrammer.ts +20 -0
  308. package/src/generates/internal/FilePrinter.ts +43 -0
  309. package/src/generates/internal/ImportDictionary.ts +110 -3
  310. package/src/generates/internal/SdkAliasCollection.ts +133 -11
  311. package/src/generates/internal/SdkDistributionComposer.ts +117 -66
  312. package/src/generates/internal/SdkFileProgrammer.ts +18 -0
  313. package/src/generates/internal/SdkHttpCloneProgrammer.ts +55 -0
  314. package/src/generates/internal/SdkHttpCloneReferencer.ts +97 -23
  315. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +19 -0
  316. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +19 -0
  317. package/src/generates/internal/SdkHttpParameterProgrammer.ts +104 -2
  318. package/src/generates/internal/SdkHttpRouteProgrammer.ts +20 -0
  319. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +72 -5
  320. package/src/generates/internal/SdkImportWizard.ts +63 -0
  321. package/src/generates/internal/SdkMcpRouteProgrammer.ts +38 -18
  322. package/src/generates/internal/SdkPathTemplate.ts +15 -0
  323. package/src/generates/internal/SdkRouteDirectory.ts +10 -0
  324. package/src/generates/internal/SdkTypeProgrammer.ts +118 -14
  325. package/src/generates/internal/SdkTypeTagProgrammer.ts +37 -7
  326. package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +185 -142
  327. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +19 -0
  328. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +81 -2
  329. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +18 -0
  330. package/src/generates/internal/SwaggerDescriptionComposer.ts +47 -1
  331. package/src/generates/internal/SwaggerOperationComposer.ts +18 -0
  332. package/src/generates/internal/SwaggerOperationParameterComposer.ts +41 -8
  333. package/src/generates/internal/SwaggerOperationResponseComposer.ts +19 -0
  334. package/src/internal/legacy-augmentation.d.ts +16 -0
  335. package/src/internal/legacy.ts +296 -26
  336. package/src/structures/INestiaProject.ts +10 -0
  337. package/src/structures/INestiaSdkInput.ts +30 -0
  338. package/src/structures/IOperationMetadata.ts +55 -0
  339. package/src/structures/IReflectController.ts +10 -0
  340. package/src/structures/IReflectHttpOperation.ts +10 -0
  341. package/src/structures/IReflectHttpOperationException.ts +10 -0
  342. package/src/structures/IReflectHttpOperationParameter.ts +47 -0
  343. package/src/structures/IReflectHttpOperationSuccess.ts +11 -0
  344. package/src/structures/IReflectImport.ts +10 -0
  345. package/src/structures/IReflectMcpOperation.ts +19 -0
  346. package/src/structures/IReflectMcpOperationParameter.ts +9 -0
  347. package/src/structures/IReflectOperationError.ts +31 -2
  348. package/src/structures/IReflectType.ts +9 -0
  349. package/src/structures/IReflectWebSocketOperation.ts +10 -0
  350. package/src/structures/IReflectWebSocketOperationParameter.ts +55 -0
  351. package/src/structures/ITypedApplication.ts +10 -0
  352. package/src/structures/ITypedHttpRoute.ts +10 -0
  353. package/src/structures/ITypedHttpRouteException.ts +10 -0
  354. package/src/structures/ITypedHttpRouteParameter.ts +45 -0
  355. package/src/structures/ITypedHttpRouteSuccess.ts +10 -0
  356. package/src/structures/ITypedMcpRoute.ts +12 -0
  357. package/src/structures/ITypedWebSocketRoute.ts +10 -0
  358. package/src/transform.ts +6 -0
  359. package/src/utils/ArrayUtil.ts +32 -13
  360. package/src/utils/EmittedJavaScriptPatcher.ts +70 -47
  361. package/src/utils/FileRetriever.ts +29 -0
  362. package/src/utils/HttpResponseContentTypeUtil.ts +41 -0
  363. package/src/utils/MapUtil.ts +68 -3
  364. package/src/utils/PathUtil.ts +38 -0
  365. package/src/utils/SdkBundlePath.ts +11 -0
  366. package/src/utils/SdkInputFilter.ts +108 -0
  367. package/src/utils/SourceFinder.ts +51 -14
  368. package/src/utils/StringUtil.ts +182 -5
  369. package/src/utils/TemporaryDirectory.ts +108 -0
  370. package/src/utils/TsConfigReader.ts +124 -26
  371. package/src/utils/TtscExecutor.ts +23 -1
  372. package/src/utils/VersioningStrategy.ts +33 -13
  373. package/src/validators/TextPlainValidator.ts +19 -0
  374. package/lib/generates/internal/SwaggerReadonlyArrayEmender.d.ts +0 -9
  375. package/lib/generates/internal/SwaggerReadonlyArrayEmender.js +0 -178
  376. package/lib/generates/internal/SwaggerReadonlyArrayEmender.js.map +0 -1
  377. package/src/generates/internal/SwaggerReadonlyArrayEmender.ts +0 -264
@@ -10,12 +10,24 @@ const isVariableName = (str) => VARIABLE_REGEX.test(str);
10
10
  /**
11
11
  * Identifier and member-access helpers. The surface kept here is the subset
12
12
  * nestia generators actually call (`identifier`, `access`, `parameter`).
13
+ *
14
+ * @evidence contracts/common.md#principled-implementation The functions choose an identifier or a string literal by the syntax of the name, so any string can be a key.
15
+ * @evidence contracts/common.md#clear-and-simple-design Three functions.
16
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The identifier test is inlined and conservative.
17
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
18
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation IdentifierFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
13
19
  */
14
20
  var IdentifierFactory;
15
21
  (function (IdentifierFactory) {
16
22
  /**
17
23
  * Build an identifier or string literal depending on whether `name` is a
18
24
  * valid JavaScript identifier.
25
+ *
26
+ * @evidence contracts/common.md#principled-implementation The name is tested against the identifier grammar, and a valid name outside the conservative pattern becomes an equivalent quoted key.
27
+ * @evidence contracts/common.md#clear-and-simple-design One conditional.
28
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The test applies to every name.
29
+ * @evidence contracts/common.md#meaningful-documentation The comment states the two results.
30
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation IdentifierFactory.identifier constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
19
31
  */
20
32
  IdentifierFactory.identifier = (name) => isVariableName(name)
21
33
  ? factory_1.factory.createIdentifier(name)
@@ -23,6 +35,12 @@ var IdentifierFactory;
23
35
  /**
24
36
  * Member access on `input` by `key`. Falls back to element access when the
25
37
  * key is not a valid identifier.
38
+ *
39
+ * @evidence contracts/common.md#principled-implementation The key becomes a property when it is an identifier and an element access otherwise.
40
+ * @evidence contracts/common.md#clear-and-simple-design One function delegating the naming rule.
41
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It never concatenates source text.
42
+ * @evidence contracts/common.md#meaningful-documentation The comment states the forms.
43
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation IdentifierFactory.access constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
26
44
  */
27
45
  IdentifierFactory.access = (input, key, chain) => {
28
46
  const postfix = IdentifierFactory.identifier(key);
@@ -37,6 +55,12 @@ var IdentifierFactory;
37
55
  /**
38
56
  * Parameter declaration with default `any` type when the caller omits one.
39
57
  * Passing a `QuestionToken` as `init` marks the parameter optional.
58
+ *
59
+ * @evidence contracts/common.md#principled-implementation The question token becomes the optional marker and any other initializer is passed through.
60
+ * @evidence contracts/common.md#clear-and-simple-design One function.
61
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the declaration grammar.
62
+ * @evidence contracts/common.md#meaningful-documentation The comment states the optional marker.
63
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation IdentifierFactory.parameter constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
40
64
  */
41
65
  IdentifierFactory.parameter = (name, type, init) => {
42
66
  const isQuestionToken = !!init &&
@@ -1 +1 @@
1
- {"version":3,"file":"IdentifierFactory.js","sourceRoot":"","sources":["../../src/factories/IdentifierFactory.ts"],"names":[],"mappings":";;;AAAA,2CASuB;AAEvB,+CAA4C;AAE5C,yEAAyE;AACzE,yEAAyE;AACzE,MAAM,cAAc,GAAG,4BAA4B,CAAC;AACpD,MAAM,cAAc,GAAG,CAAC,GAAW,EAAW,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1E;;;GAGG;AACH,IAAiB,iBAAiB,CA6DjC;AA7DD,WAAiB,iBAAiB;IAChC;;;OAGG;IACU,4BAAU,GAAG,CAAC,IAAY,EAA8B,EAAE,CACrE,cAAc,CAAC,IAAI,CAAC;QAClB,CAAC,CAAC,iBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAChC,CAAC,CAAC,iBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAExC;;;OAGG;IACU,wBAAM,GAAG,CACpB,KAAiB,EACjB,GAAW,EACX,KAAe,EACH,EAAE;QACd,MAAM,OAAO,GAAG,4BAAU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,IAAyB,EACzB,IAAe,EACf,IAAyB,EACH,EAAE;QACxB,MAAM,eAAe,GACnB,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,KAAK,OAAO;YACpB,IAAc,CAAC,KAAK,KAAK,oBAAU,CAAC,aAAa,CAAC;QACrD,OAAO,iBAAO,CAAC,0BAA0B,CACvC,SAAS,EACT,SAAS,EACT,IAAI,EACJ,eAAe;YACb,CAAC,CAAC,iBAAO,CAAC,WAAW,CAAC,oBAAU,CAAC,aAAa,CAAC;YAC/C,CAAC,CAAC,SAAS,EACb,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAClC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,IAA+B,CAC/D,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EA/EgB,iBAAiB,aAAjB,iBAAiB,GAAjB,iBAAiB,QA+EjC"}
@@ -1,9 +1,27 @@
1
1
  import { type Expression } from "@ttsc/factory";
2
2
  /**
3
- * Recursive value-to-AST-literal builder. Hands back already-AST inputs
4
- * unchanged (so callers can mix factory output with raw JS values inside the
5
- * same object/array), and emits the appropriate literal node otherwise.
3
+ * Recursive value-to-AST-literal builder. Arrow-function, call-expression and
4
+ * identifier nodes pass through only when the caller explicitly requests
5
+ * expression preservation. Ordinary values may contain the same `kind` names.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation The namespace maps values to literal nodes by type.
8
+ * @evidence contracts/common.md#clear-and-simple-design One function and two helpers.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is by type.
10
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
11
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation LiteralFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
6
12
  */
7
13
  export declare namespace LiteralFactory {
8
- const write: (input: any) => Expression;
14
+ /**
15
+ * Builds the expression of a value; arrow function, call, and identifier
16
+ * nodes pass through when `preserveExpressions` is true. Functions become
17
+ * `undefined`; other unsupported types throw, and object properties whose
18
+ * values are undefined are omitted.
19
+ *
20
+ * @evidence contracts/common.md#principled-implementation The value is dispatched by type in a fixed order and containers are written element by element.
21
+ * @evidence contracts/common.md#clear-and-simple-design One function.
22
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The dispatch is general.
23
+ * @evidence contracts/common.md#meaningful-documentation The comment states the mapping.
24
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation LiteralFactory.write constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
25
+ */
26
+ const write: (input: any, preserveExpressions?: boolean) => Expression;
9
27
  }
@@ -13,21 +13,41 @@ const isNode = (value) => typeof value === "object" &&
13
13
  value !== null &&
14
14
  typeof value.kind === "string";
15
15
  /**
16
- * Recursive value-to-AST-literal builder. Hands back already-AST inputs
17
- * unchanged (so callers can mix factory output with raw JS values inside the
18
- * same object/array), and emits the appropriate literal node otherwise.
16
+ * Recursive value-to-AST-literal builder. Arrow-function, call-expression and
17
+ * identifier nodes pass through only when the caller explicitly requests
18
+ * expression preservation. Ordinary values may contain the same `kind` names.
19
+ *
20
+ * @evidence contracts/common.md#principled-implementation The namespace maps values to literal nodes by type.
21
+ * @evidence contracts/common.md#clear-and-simple-design One function and two helpers.
22
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is by type.
23
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
24
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation LiteralFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
19
25
  */
20
26
  var LiteralFactory;
21
27
  (function (LiteralFactory) {
22
- LiteralFactory.write = (input) => {
28
+ /**
29
+ * Builds the expression of a value; arrow function, call, and identifier
30
+ * nodes pass through when `preserveExpressions` is true. Functions become
31
+ * `undefined`; other unsupported types throw, and object properties whose
32
+ * values are undefined are omitted.
33
+ *
34
+ * @evidence contracts/common.md#principled-implementation The value is dispatched by type in a fixed order and containers are written element by element.
35
+ * @evidence contracts/common.md#clear-and-simple-design One function.
36
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The dispatch is general.
37
+ * @evidence contracts/common.md#meaningful-documentation The comment states the mapping.
38
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation LiteralFactory.write constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
39
+ */
40
+ LiteralFactory.write = (input, preserveExpressions = false) => {
23
41
  if (input === null)
24
42
  return factory_1.factory.createNull();
25
- if (isNode(input) && PASSTHROUGH_KINDS.has(input.kind))
43
+ if (preserveExpressions &&
44
+ isNode(input) &&
45
+ PASSTHROUGH_KINDS.has(input.kind))
26
46
  return input;
27
47
  if (Array.isArray(input))
28
- return writeArray(input);
48
+ return writeArray(input, preserveExpressions);
29
49
  if (typeof input === "object")
30
- return writeObject(input);
50
+ return writeObject(input, preserveExpressions);
31
51
  if (typeof input === "boolean")
32
52
  return input ? factory_1.factory.createTrue() : factory_1.factory.createFalse();
33
53
  if (typeof input === "number")
@@ -42,9 +62,9 @@ var LiteralFactory;
42
62
  return factory_1.factory.createIdentifier("undefined");
43
63
  throw new TypeError("LiteralFactory.write: unsupported input type.");
44
64
  };
45
- const writeObject = (obj) => factory_1.factory.createObjectLiteralExpression(Object.entries(obj)
65
+ const writeObject = (obj, preserveExpressions) => factory_1.factory.createObjectLiteralExpression(Object.entries(obj)
46
66
  .filter(([, value]) => value !== undefined)
47
- .map(([key, value]) => factory_1.factory.createPropertyAssignment(IdentifierFactory_1.IdentifierFactory.identifier(key), LiteralFactory.write(value))), true);
48
- const writeArray = (array) => factory_1.factory.createArrayLiteralExpression(array.map(LiteralFactory.write), true);
67
+ .map(([key, value]) => factory_1.factory.createPropertyAssignment(IdentifierFactory_1.IdentifierFactory.identifier(key), LiteralFactory.write(value, preserveExpressions))), true);
68
+ const writeArray = (array, preserveExpressions) => factory_1.factory.createArrayLiteralExpression(array.map((value) => LiteralFactory.write(value, preserveExpressions)), true);
49
69
  })(LiteralFactory || (exports.LiteralFactory = LiteralFactory = {}));
50
70
  //# sourceMappingURL=LiteralFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LiteralFactory.js","sourceRoot":"","sources":["../../src/factories/LiteralFactory.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AAErE,2DAAwD;AACxD,2DAAwD;AAExD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS;IACxC,eAAe;IACf,gBAAgB;IAChB,YAAY;CACb,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,CAAC,KAAc,EAAuB,EAAE,CACrD,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ,CAAC;AAEzD;;;;GAIG;AACH,IAAiB,cAAc,CAqC9B;AArCD,WAAiB,cAAc;IAChB,oBAAK,GAAG,CAAC,KAAU,EAAc,EAAE;QAC9C,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,iBAAO,CAAC,UAAU,EAAE,CAAC;QAChD,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACrE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,WAAW,CAAC,KAAe,CAAC,CAAC;QACnE,IAAI,OAAO,KAAK,KAAK,SAAS;YAC5B,OAAO,KAAK,CAAC,CAAC,CAAC,iBAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,iBAAO,CAAC,WAAW,EAAE,CAAC;QAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,qCAAiB,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c,aAAd,cAAc,GAAd,cAAc,QAgE9B"}
@@ -1,11 +1,38 @@
1
1
  import { type Expression, type TypeNode, type VariableStatement } from "@ttsc/factory";
2
- /** Variable-statement helpers. `constant` emits `const`, `mut` emits `let`. */
2
+ /**
3
+ * Variable-statement helpers. `constant` emits `const`, `mut` emits `let`.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation The namespace builds `let` and `const` statements.
6
+ * @evidence contracts/common.md#clear-and-simple-design Two functions, one for let and one for const.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It only builds nodes.
8
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
9
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation StatementFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
10
+ */
3
11
  export declare namespace StatementFactory {
12
+ /**
13
+ * Builds a `let` statement; without a type and an initializer it is typed
14
+ * `any`.
15
+ *
16
+ * @evidence contracts/common.md#principled-implementation A declaration without either would be implicitly any, so the type is stated.
17
+ * @evidence contracts/common.md#clear-and-simple-design One expression.
18
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the grammar.
19
+ * @evidence contracts/common.md#meaningful-documentation The comment states the default type.
20
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation StatementFactory.mut constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
21
+ */
4
22
  const mut: (props: {
5
23
  name: string;
6
24
  type?: TypeNode | undefined;
7
25
  initializer?: Expression | undefined;
8
26
  }) => VariableStatement;
27
+ /**
28
+ * Builds a `const` statement from a name, a type, and a value.
29
+ *
30
+ * @evidence contracts/common.md#principled-implementation The declaration list carries the const flag and the given parts.
31
+ * @evidence contracts/common.md#clear-and-simple-design One expression.
32
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the grammar.
33
+ * @evidence contracts/common.md#meaningful-documentation The comment states its inputs.
34
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation StatementFactory.constant constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
35
+ */
9
36
  const constant: (props: {
10
37
  name: string;
11
38
  type?: TypeNode | undefined;
@@ -3,9 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatementFactory = void 0;
4
4
  const factory_1 = require("@ttsc/factory");
5
5
  const TypeFactory_1 = require("./TypeFactory");
6
- /** Variable-statement helpers. `constant` emits `const`, `mut` emits `let`. */
6
+ /**
7
+ * Variable-statement helpers. `constant` emits `const`, `mut` emits `let`.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation The namespace builds `let` and `const` statements.
10
+ * @evidence contracts/common.md#clear-and-simple-design Two functions, one for let and one for const.
11
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It only builds nodes.
12
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
13
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation StatementFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
14
+ */
7
15
  var StatementFactory;
8
16
  (function (StatementFactory) {
17
+ /**
18
+ * Builds a `let` statement; without a type and an initializer it is typed
19
+ * `any`.
20
+ *
21
+ * @evidence contracts/common.md#principled-implementation A declaration without either would be implicitly any, so the type is stated.
22
+ * @evidence contracts/common.md#clear-and-simple-design One expression.
23
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the grammar.
24
+ * @evidence contracts/common.md#meaningful-documentation The comment states the default type.
25
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation StatementFactory.mut constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
26
+ */
9
27
  StatementFactory.mut = (props) => factory_1.factory.createVariableStatement(undefined, factory_1.factory.createVariableDeclarationList([
10
28
  factory_1.factory.createVariableDeclaration(props.name, undefined, props.type !== undefined
11
29
  ? props.type
@@ -13,6 +31,15 @@ var StatementFactory;
13
31
  ? TypeFactory_1.TypeFactory.keyword("any")
14
32
  : undefined, props.initializer),
15
33
  ], factory_1.NodeFlags.Let));
34
+ /**
35
+ * Builds a `const` statement from a name, a type, and a value.
36
+ *
37
+ * @evidence contracts/common.md#principled-implementation The declaration list carries the const flag and the given parts.
38
+ * @evidence contracts/common.md#clear-and-simple-design One expression.
39
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the grammar.
40
+ * @evidence contracts/common.md#meaningful-documentation The comment states its inputs.
41
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation StatementFactory.constant constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
42
+ */
16
43
  StatementFactory.constant = (props) => factory_1.factory.createVariableStatement(undefined, factory_1.factory.createVariableDeclarationList([
17
44
  factory_1.factory.createVariableDeclaration(props.name, undefined, props.type, props.value),
18
45
  ], factory_1.NodeFlags.Const));
@@ -1 +1 @@
1
- {"version":3,"file":"StatementFactory.js","sourceRoot":"","sources":["../../src/factories/StatementFactory.ts"],"names":[],"mappings":";;;AAAA,2CAMuB;AAEvB,+CAA4C;AAE5C,+EAA+E;AAC/E,IAAiB,gBAAgB,CA4ChC;AA5CD,WAAiB,gBAAgB;IAClB,oBAAG,GAAG,CAAC,KAInB,EAAqB,EAAE,CACtB,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,iBAAO,CAAC,6BAA6B,CACnC;QACE,iBAAO,CAAC,yBAAyB,CAC/B,KAAK,CAAC,IAAI,EACV,SAAS,EACT,KAAK,CAAC,IAAI,KAAK,SAAS;YACtB,CAAC,CAAC,KAAK,CAAC,IAAI;YACZ,CAAC,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS;gBAC/B,CAAC,CAAC,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC5B,CAAC,CAAC,SAAS,EACf,KAAK,CAAC,WAAW,CAClB;KACF,EACD,mBAAS,CAAC,GAAG,CACd,CACF,CAAC;IAES,yBAAQ,GAAG,CAAC,KAIxB,EAAqB,EAAE,CACtB,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,iBAAO,CAAC,6BAA6B,CACnC;QACE,iBAAO,CAAC,yBAAyB,CAC/B,KAAK,CAAC,IAAI,EACV,SAAS,EACT,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,KAAK,CACZ;KACF,EACD,mBAAS,CAAC,KAAK,CAChB,CACF,CAAC;AACN,CAAC,EA5CgB,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QA4ChC"}
1
+ {"version":3,"file":"StatementFactory.js","sourceRoot":"","sources":["../../src/factories/StatementFactory.ts"],"names":[],"mappings":";;;AAAA,2CAMuB;AAEvB,+CAA4C;AAE5C;;;;;;;;GAQG;AACH,IAAiB,gBAAgB,CA+DhC;AA/DD,WAAiB,gBAAgB;IAC/B;;;;;;;;;OASG;IACU,oBAAG,GAAG,CAAC,KAInB,EAAqB,EAAE,CACtB,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,iBAAO,CAAC,6BAA6B,CACnC;QACE,iBAAO,CAAC,yBAAyB,CAC/B,KAAK,CAAC,IAAI,EACV,SAAS,EACT,KAAK,CAAC,IAAI,KAAK,SAAS;YACtB,CAAC,CAAC,KAAK,CAAC,IAAI;YACZ,CAAC,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS;gBAC/B,CAAC,CAAC,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC5B,CAAC,CAAC,SAAS,EACf,KAAK,CAAC,WAAW,CAClB;KACF,EACD,mBAAS,CAAC,GAAG,CACd,CACF,CAAC;IAEJ;;;;;;;;OAQG;IACU,yBAAQ,GAAG,CAAC,KAIxB,EAAqB,EAAE,CACtB,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,iBAAO,CAAC,6BAA6B,CACnC;QACE,iBAAO,CAAC,yBAAyB,CAC/B,KAAK,CAAC,IAAI,EACV,SAAS,EACT,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,KAAK,CACZ;KACF,EACD,mBAAS,CAAC,KAAK,CAChB,CACF,CAAC;AACN,CAAC,EA/DgB,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QA+DhC"}
@@ -5,6 +5,12 @@ import { type KeywordTypeNode, SyntaxKind } from "@ttsc/factory";
5
5
  * Wraps {@link factory.createKeywordTypeNode} with a name-based interface so
6
6
  * generator code reads as `TypeFactory.keyword("any")` instead of selecting the
7
7
  * `SyntaxKind.AnyKeyword` token by hand.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation The namespace maps names to the keyword syntax kinds.
10
+ * @evidence contracts/common.md#clear-and-simple-design One table, one type, and one function.
11
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It only builds nodes.
12
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
13
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TypeFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
8
14
  */
9
15
  export declare namespace TypeFactory {
10
16
  const KEYWORDS: {
@@ -18,7 +24,25 @@ export declare namespace TypeFactory {
18
24
  readonly never: SyntaxKind.NeverKeyword;
19
25
  readonly undefined: SyntaxKind.UndefinedKeyword;
20
26
  };
27
+ /**
28
+ * The names of the supported keyword types.
29
+ *
30
+ * @evidence contracts/common.md#principled-implementation The type is the key set of the table, so a keyword is one table entry.
31
+ * @evidence contracts/common.md#clear-and-simple-design One derived type.
32
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
33
+ * @evidence contracts/common.md#meaningful-documentation The comment names the set.
34
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TypeFactory.Keyword is the key union of the syntax-kind table and defines no native path conversion or process boundary.
35
+ */
21
36
  export type Keyword = keyof typeof KEYWORDS;
37
+ /**
38
+ * Builds the keyword type node of a name.
39
+ *
40
+ * @evidence contracts/common.md#principled-implementation The name is looked up in the table.
41
+ * @evidence contracts/common.md#clear-and-simple-design One lookup.
42
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the grammar.
43
+ * @evidence contracts/common.md#meaningful-documentation The comment states its input.
44
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TypeFactory.keyword constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
45
+ */
22
46
  export const keyword: (type: Keyword) => KeywordTypeNode;
23
47
  export {};
24
48
  }
@@ -8,6 +8,12 @@ const factory_1 = require("@ttsc/factory");
8
8
  * Wraps {@link factory.createKeywordTypeNode} with a name-based interface so
9
9
  * generator code reads as `TypeFactory.keyword("any")` instead of selecting the
10
10
  * `SyntaxKind.AnyKeyword` token by hand.
11
+ *
12
+ * @evidence contracts/common.md#principled-implementation The namespace maps names to the keyword syntax kinds.
13
+ * @evidence contracts/common.md#clear-and-simple-design One table, one type, and one function.
14
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It only builds nodes.
15
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
16
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TypeFactory constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
11
17
  */
12
18
  var TypeFactory;
13
19
  (function (TypeFactory) {
@@ -22,6 +28,15 @@ var TypeFactory;
22
28
  never: factory_1.SyntaxKind.NeverKeyword,
23
29
  undefined: factory_1.SyntaxKind.UndefinedKeyword,
24
30
  };
31
+ /**
32
+ * Builds the keyword type node of a name.
33
+ *
34
+ * @evidence contracts/common.md#principled-implementation The name is looked up in the table.
35
+ * @evidence contracts/common.md#clear-and-simple-design One lookup.
36
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the grammar.
37
+ * @evidence contracts/common.md#meaningful-documentation The comment states its input.
38
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TypeFactory.keyword constructs TypeScript syntax nodes; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
39
+ */
25
40
  TypeFactory.keyword = (type) => factory_1.factory.createKeywordTypeNode(KEYWORDS[type]);
26
41
  })(TypeFactory || (exports.TypeFactory = TypeFactory = {}));
27
42
  //# sourceMappingURL=TypeFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeFactory.js","sourceRoot":"","sources":["../../src/factories/TypeFactory.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAE1E;;;;;;GAMG;AACH,IAAiB,WAAW,CAiB3B;AAjBD,WAAiB,WAAW;IAC1B,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,oBAAU,CAAC,WAAW;QAC5B,GAAG,EAAE,oBAAU,CAAC,UAAU;QAC1B,OAAO,EAAE,oBAAU,CAAC,cAAc;QAClC,OAAO,EAAE,oBAAU,CAAC,cAAc;QAClC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,KAAK,EAAE,oBAAU,CAAC,YAAY;QAC9B,SAAS,EAAE,oBAAU,CAAC,gBAAgB;KAC9B,CAAC;IAIE,mBAAO,GAAG,CAAC,IAAa,EAAmB,EAAE,CACxD,iBAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC,EAjBgB,WAAW,aAAX,WAAW,GAAX,WAAW,QAiB3B"}
1
+ {"version":3,"file":"TypeFactory.js","sourceRoot":"","sources":["../../src/factories/TypeFactory.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAE1E;;;;;;;;;;;;GAYG;AACH,IAAiB,WAAW,CAmC3B;AAnCD,WAAiB,WAAW;IAC1B,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,oBAAU,CAAC,WAAW;QAC5B,GAAG,EAAE,oBAAU,CAAC,UAAU;QAC1B,OAAO,EAAE,oBAAU,CAAC,cAAc;QAClC,OAAO,EAAE,oBAAU,CAAC,cAAc;QAClC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,KAAK,EAAE,oBAAU,CAAC,YAAY;QAC9B,SAAS,EAAE,oBAAU,CAAC,gBAAgB;KAC9B,CAAC;IAaX;;;;;;;;OAQG;IACU,mBAAO,GAAG,CAAC,IAAa,EAAmB,EAAE,CACxD,iBAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC,EAnCgB,WAAW,aAAX,WAAW,GAAX,WAAW,QAmC3B"}
@@ -1,4 +1,26 @@
1
1
  import { ITypedApplication } from "../structures/ITypedApplication";
2
+ /**
3
+ * Writes the DTO declarations of the SDK: the `structures` files that the
4
+ * functions import when `clone` is on.
5
+ *
6
+ * @evidence contracts/common.md#principled-implementation The namespace composes the declarations from the analyzed types, rewrites the routes to reference them, and prints one file per top-level module.
7
+ * @evidence contracts/common.md#clear-and-simple-design One public function with two private helpers.
8
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Every declaration goes through the shared printer, and no type is special-cased.
9
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
10
+ * @evidence contracts/portability.md#os-neutral-implementation The writer passes native output locations to Node fs and FilePrinter; module specifiers are produced separately by ImportDictionary. The structures suffix uses forward slashes, which Node accepts on Windows and POSIX, without treating spelling as canonical file identity.
11
+ */
2
12
  export declare namespace CloneGenerator {
13
+ /**
14
+ * Writes the `structures` directory of the SDK output.
15
+ *
16
+ * Structural route references are updated even when every JSON DTO is inline
17
+ * and no structure file is needed. WebSocket source cloning stays separate.
18
+ *
19
+ * @evidence contracts/common.md#principled-implementation HTTP and MCP JSON declarations share the analyzed collection; WebSocket sources are copied separately. Route references are updated even for inline-only graphs, then named modules are written sequentially so a failure stops at the first file.
20
+ * @evidence contracts/common.md#clear-and-simple-design One function over the two programmers, the referencer, and the file writer.
21
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The directory is created recursively and its failure is not swallowed.
22
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
23
+ * @evidence contracts/portability.md#os-neutral-implementation Node mkdir creates the output structures directory and FilePrinter writes generated declarations; WebSocket source lookup and copying remain delegated to its source-cloning owner. Filesystem errors propagate rather than being translated into platform-specific shell commands.
24
+ */
3
25
  const write: (app: ITypedApplication) => Promise<void>;
4
26
  }
@@ -20,18 +20,39 @@ const ImportDictionary_1 = require("./internal/ImportDictionary");
20
20
  const SdkHttpCloneProgrammer_1 = require("./internal/SdkHttpCloneProgrammer");
21
21
  const SdkHttpCloneReferencer_1 = require("./internal/SdkHttpCloneReferencer");
22
22
  const SdkWebSocketCloneProgrammer_1 = require("./internal/SdkWebSocketCloneProgrammer");
23
+ /**
24
+ * Writes the DTO declarations of the SDK: the `structures` files that the
25
+ * functions import when `clone` is on.
26
+ *
27
+ * @evidence contracts/common.md#principled-implementation The namespace composes the declarations from the analyzed types, rewrites the routes to reference them, and prints one file per top-level module.
28
+ * @evidence contracts/common.md#clear-and-simple-design One public function with two private helpers.
29
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Every declaration goes through the shared printer, and no type is special-cased.
30
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
31
+ * @evidence contracts/portability.md#os-neutral-implementation The writer passes native output locations to Node fs and FilePrinter; module specifiers are produced separately by ImportDictionary. The structures suffix uses forward slashes, which Node accepts on Windows and POSIX, without treating spelling as canonical file identity.
32
+ */
23
33
  var CloneGenerator;
24
34
  (function (CloneGenerator) {
35
+ /**
36
+ * Writes the `structures` directory of the SDK output.
37
+ *
38
+ * Structural route references are updated even when every JSON DTO is inline
39
+ * and no structure file is needed. WebSocket source cloning stays separate.
40
+ *
41
+ * @evidence contracts/common.md#principled-implementation HTTP and MCP JSON declarations share the analyzed collection; WebSocket sources are copied separately. Route references are updated even for inline-only graphs, then named modules are written sequentially so a failure stops at the first file.
42
+ * @evidence contracts/common.md#clear-and-simple-design One function over the two programmers, the referencer, and the file writer.
43
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The directory is created recursively and its failure is not swallowed.
44
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
45
+ * @evidence contracts/portability.md#os-neutral-implementation Node mkdir creates the output structures directory and FilePrinter writes generated declarations; WebSocket source lookup and copying remain delegated to its source-cloning owner. Filesystem errors propagate rather than being translated into platform-specific shell commands.
46
+ */
25
47
  CloneGenerator.write = (app) => __awaiter(this, void 0, void 0, function* () {
26
48
  const dict = SdkHttpCloneProgrammer_1.SdkHttpCloneProgrammer.write(app);
27
49
  const websocket = yield SdkWebSocketCloneProgrammer_1.SdkWebSocketCloneProgrammer.write(app);
50
+ SdkHttpCloneReferencer_1.SdkHttpCloneReferencer.replace(app, websocket);
28
51
  if (dict.size === 0 && websocket.size === 0)
29
52
  return;
30
- SdkHttpCloneReferencer_1.SdkHttpCloneReferencer.replace(app, websocket);
31
- try {
32
- yield fs_1.default.promises.mkdir(`${app.project.config.output}/structures`);
33
- }
34
- catch (_a) { }
53
+ yield fs_1.default.promises.mkdir(`${app.project.config.output}/structures`, {
54
+ recursive: true,
55
+ });
35
56
  for (const [key, value] of dict)
36
57
  yield writeDtoFile(app.project)(key, value);
37
58
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CloneGenerator.js","sourceRoot":"","sources":["../../src/generates/CloneGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAMuB;AACvB,4CAAoB;AAIpB,wDAAqD;AACrD,kEAA+D;AAC/D,8EAA2E;AAC3E,8EAA2E;AAC3E,wFAAqF;AAErF,IAAiB,cAAc,CAwD9B;AAxDD,WAAiB,cAAc;IAChB,oBAAK,GAAG,CAAO,GAAsB,EAAiB,EAAE;QACnE,MAAM,IAAI,GACR,+CAAsB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,SAAS,GAAgB,MAAM,yDAA2B,CAAC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AC,yBAAW,CAAC,KAAK,EAAE,CAAC,CAAC;gBAClD,GAAG,UAAU;aACd;SACF,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;IAEJ,MAAM,OAAO,GACX,CAAC,QAA0B,EAAE,EAAE,CAC/B,CAAC,MAAsC,EAAU,EAAE;QACjD,MAAM,MAAM,GAAW,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,UAAU,KAAK,IAAI;YAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QACzE,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAW,EAAE,CAAC;YAC5B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAC1C,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7C,MAAM,CAAC,IAAI,CACT,iBAAO,CAAC,uBAAuB,CAC7B,CAAC,iBAAO,CAAC,cAAc,CAAC,oBAAU,CAAC,aAAa,CAAC,CAAC,EAClD,iBAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,EACrC,iBAAO,CAAC,iBAAiB,CAAC,QAAuB,CAAC,EAClD,mBAAS,CAAC,SAAS,CACpB,CACF,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,EAnEgB,cAAc,aAAd,cAAc,GAAd,cAAc,QAmE9B"}
@@ -1,4 +1,23 @@
1
1
  import { ITypedApplication } from "../structures/ITypedApplication";
2
+ /**
3
+ * Writes the e2e test functions of the SDK.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation The namespace creates the output directories and writes one test file per HTTP route.
6
+ * @evidence contracts/common.md#clear-and-simple-design One public function and one directory helper.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Only HTTP routes have a test, and no route is skipped by name.
8
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
9
+ * @evidence contracts/portability.md#os-neutral-implementation The output root is resolved with Node path.resolve, descendants use path.join and recursive fs.mkdir creates them. SDK import paths are passed to E2eFileProgrammer independently from native directory paths.
10
+ */
2
11
  export declare namespace E2eGenerator {
12
+ /**
13
+ * Writes one test function per HTTP route under `features/api/automated` of
14
+ * the e2e output directory, creating the directories as needed.
15
+ *
16
+ * @evidence contracts/common.md#principled-implementation The directories are created recursively, so an existing tree is reused, and each route's file is written in sequence.
17
+ * @evidence contracts/common.md#clear-and-simple-design One loop over the routes.
18
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts WebSocket and MCP routes are not tests of the HTTP SDK and are left out by protocol.
19
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
20
+ * @evidence contracts/portability.md#os-neutral-implementation Native output and SDK roots use path.resolve and path.join before mkdir or file generation. No shell or filesystem case assumption participates; the generated HTTP route names have already passed accessor analysis.
21
+ */
3
22
  const generate: (app: ITypedApplication) => Promise<void>;
4
23
  }
@@ -16,8 +16,27 @@ exports.E2eGenerator = void 0;
16
16
  const fs_1 = __importDefault(require("fs"));
17
17
  const path_1 = __importDefault(require("path"));
18
18
  const E2eFileProgrammer_1 = require("./internal/E2eFileProgrammer");
19
+ /**
20
+ * Writes the e2e test functions of the SDK.
21
+ *
22
+ * @evidence contracts/common.md#principled-implementation The namespace creates the output directories and writes one test file per HTTP route.
23
+ * @evidence contracts/common.md#clear-and-simple-design One public function and one directory helper.
24
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Only HTTP routes have a test, and no route is skipped by name.
25
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
26
+ * @evidence contracts/portability.md#os-neutral-implementation The output root is resolved with Node path.resolve, descendants use path.join and recursive fs.mkdir creates them. SDK import paths are passed to E2eFileProgrammer independently from native directory paths.
27
+ */
19
28
  var E2eGenerator;
20
29
  (function (E2eGenerator) {
30
+ /**
31
+ * Writes one test function per HTTP route under `features/api/automated` of
32
+ * the e2e output directory, creating the directories as needed.
33
+ *
34
+ * @evidence contracts/common.md#principled-implementation The directories are created recursively, so an existing tree is reused, and each route's file is written in sequence.
35
+ * @evidence contracts/common.md#clear-and-simple-design One loop over the routes.
36
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts WebSocket and MCP routes are not tests of the HTTP SDK and are left out by protocol.
37
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
38
+ * @evidence contracts/portability.md#os-neutral-implementation Native output and SDK roots use path.resolve and path.join before mkdir or file generation. No shell or filesystem case assumption participates; the generated HTTP route names have already passed accessor analysis.
39
+ */
21
40
  E2eGenerator.generate = (app) => __awaiter(this, void 0, void 0, function* () {
22
41
  console.log("Generating E2E Test Functions");
23
42
  // PREPARE DIRECTORIES
@@ -1 +1 @@
1
- {"version":3,"file":"E2eGenerator.js","sourceRoot":"","sources":["../../src/generates/E2eGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,oEAAiE;AAEjE,IAAiB,YAAY,CAmB5B;AAnBD,WAAiB,YAAY;IACd,qBAAQ,GAAG,CAAO,GAAsB,EAAiB,EAAE;QACtE,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAE7C,sBAAsB;QACtB,MAAM,MAAM,GAAW,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAI,CAAC,CAAC;QAC7D,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;QAC3C,MAAM,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;QAClD,MAAM,KAAK,CAAC,cAAI,CAAC,IAAI,CAA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AM,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;QAC3C,MAAM,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;QAClD,MAAM,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;QAE/D,2BAA2B;QAC3B,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM;YAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM;gBAC3B,MAAM,qCAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;oBAC5C,GAAG,EAAE,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAO,CAAC;oBAC7C,OAAO,EAAE,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC;iBAC3D,CAAC,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAA,CAAC;AACJ,CAAC,EA7BgB,YAAY,aAAZ,YAAY,GAAZ,YAAY,QA6B5B;AAED,MAAM,KAAK,GAAG,CAAO,QAAgB,EAAiB,EAAE;IACtD,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzD,CAAC,CAAA,CAAC"}
@@ -1,7 +1,39 @@
1
1
  import { IReflectOperationError } from "../structures/IReflectOperationError";
2
2
  import { ITypedApplication } from "../structures/ITypedApplication";
3
+ /**
4
+ * Generates the SDK library and validates the analyzed routes it needs.
5
+ *
6
+ * @evidence contracts/common.md#principled-implementation The namespace bundles the static files, writes the DTOs and the functions, composes the distribution package, and reports the errors the generation would meet.
7
+ * @evidence contracts/common.md#clear-and-simple-design Two public functions, one public constant, and the private validators.
8
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Validation and generation share the same route model.
9
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
10
+ * @evidence contracts/portability.md#os-neutral-implementation Static bundle enumeration and output creation use Node fs; declaration/module path conversion and distribution process launching are delegated to ImportDictionary and SdkDistributionComposer. Existing file spelling is checked by the filesystem rather than an OS-name case rule.
11
+ */
3
12
  export declare namespace SdkGenerator {
13
+ /**
14
+ * Writes the SDK into the configured output directory: the bundled files, the
15
+ * DTOs when `clone` is on, the functions, and the distribution package when
16
+ * `distribute` is set.
17
+ *
18
+ * @evidence contracts/common.md#principled-implementation The steps run in dependency order, the bundle first and the distribution last. An absent output option throws before writing; a configured directory that does not exist is created recursively.
19
+ * @evidence contracts/common.md#clear-and-simple-design One function that delegates each step.
20
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The steps are sequential and each awaits the previous one.
21
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
22
+ * @evidence contracts/portability.md#os-neutral-implementation Node mkdir and the bundle writer accept the configured native output path; subsequent file and process boundaries belong to their delegated writers. Configuration omission is distinct from a missing on-disk directory.
23
+ */
4
24
  const generate: (app: ITypedApplication) => Promise<void>;
25
+ /**
26
+ * Returns the errors of routes that cannot become an SDK: MCP tools with
27
+ * duplicate names or accessors, and, without `clone`, HTTP routes whose
28
+ * parameter or return types are implicit, plus implicit exception types when
29
+ * propagation is enabled.
30
+ *
31
+ * @evidence contracts/common.md#principled-implementation The MCP checks always apply, and the implicit return check applies only where the SDK would have to name the type, because `clone` writes it as a declaration instead.
32
+ * @evidence contracts/common.md#clear-and-simple-design One function over three checks.
33
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The list is collected, not thrown, so one run reports every error.
34
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
35
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Validation judges analyzed route types and names and performs no native filesystem or process operation.
36
+ */
5
37
  const validate: (app: ITypedApplication) => IReflectOperationError[];
6
38
  /**
7
39
  * Emplace the static bundle files (`index.ts`, `module.ts`, ...) into the SDK
@@ -10,6 +42,12 @@ export declare namespace SdkGenerator {
10
42
  * Files the user already has are never touched, so that hand-written
11
43
  * customizations (e.g. extra re-exports in `module.ts`) survive regeneration.
12
44
  * Only missing files are filled in from the bundle.
45
+ *
46
+ * @evidence contracts/common.md#principled-implementation A file that the user has customized is never overwritten, and only files that are missing are filled in from the bundle.
47
+ * @evidence contracts/common.md#clear-and-simple-design One loop with two guards.
48
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The existing target is checked before the write.
49
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
50
+ * @evidence contracts/portability.md#os-neutral-implementation fs.readdir/stat enumerate the installed bundle and fs.existsSync checks each target under the filesystem's own policy before writing UTF-8. Forward slash suffixes are accepted by Node on supported native platforms; concurrent generation into the same output is not an exclusive ownership guarantee.
13
51
  */
14
52
  const bundle: (output: string) => Promise<void>;
15
53
  const BUNDLE_PATH: string;