@nestia/sdk 14.0.0 → 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 (391) hide show
  1. package/README.md +1 -1
  2. package/assets/bundle/distribute/build-sdk.cjs +28 -0
  3. package/assets/bundle/distribute/package.json +7 -3
  4. package/assets/bundle/distribute/tsconfig.json +15 -105
  5. package/lib/INestiaConfig.d.ts +74 -34
  6. package/lib/NestiaSdkApplication.d.ts +60 -0
  7. package/lib/NestiaSdkApplication.js +121 -32
  8. package/lib/NestiaSdkApplication.js.map +1 -1
  9. package/lib/NestiaSwaggerComposer.d.ts +21 -0
  10. package/lib/NestiaSwaggerComposer.js +32 -13
  11. package/lib/NestiaSwaggerComposer.js.map +1 -1
  12. package/lib/analyses/AccessorAnalyzer.d.ts +26 -0
  13. package/lib/analyses/AccessorAnalyzer.js +26 -0
  14. package/lib/analyses/AccessorAnalyzer.js.map +1 -1
  15. package/lib/analyses/ConfigAnalyzer.d.ts +41 -0
  16. package/lib/analyses/ConfigAnalyzer.js +52 -77
  17. package/lib/analyses/ConfigAnalyzer.js.map +1 -1
  18. package/lib/analyses/ImportAnalyzer.d.ts +25 -0
  19. package/lib/analyses/ImportAnalyzer.js +25 -0
  20. package/lib/analyses/ImportAnalyzer.js.map +1 -1
  21. package/lib/analyses/ParameterNameAnalyzer.d.ts +44 -0
  22. package/lib/analyses/ParameterNameAnalyzer.js +63 -0
  23. package/lib/analyses/ParameterNameAnalyzer.js.map +1 -0
  24. package/lib/analyses/PathAnalyzer.d.ts +93 -1
  25. package/lib/analyses/PathAnalyzer.js +160 -23
  26. package/lib/analyses/PathAnalyzer.js.map +1 -1
  27. package/lib/analyses/ReflectControllerAnalyzer.d.ts +32 -0
  28. package/lib/analyses/ReflectControllerAnalyzer.js +24 -1
  29. package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
  30. package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +29 -0
  31. package/lib/analyses/ReflectHttpOperationAnalyzer.js +35 -24
  32. package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
  33. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +31 -0
  34. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +21 -0
  35. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
  36. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +31 -0
  37. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +143 -23
  38. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
  39. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +32 -0
  40. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +27 -2
  41. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
  42. package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +29 -0
  43. package/lib/analyses/ReflectMcpOperationAnalyzer.js +35 -11
  44. package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -1
  45. package/lib/analyses/ReflectMetadataAnalyzer.d.ts +47 -0
  46. package/lib/analyses/ReflectMetadataAnalyzer.js +47 -0
  47. package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
  48. package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +29 -0
  49. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +27 -5
  50. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
  51. package/lib/analyses/SecurityAnalyzer.d.ts +25 -0
  52. package/lib/analyses/SecurityAnalyzer.js +39 -19
  53. package/lib/analyses/SecurityAnalyzer.js.map +1 -1
  54. package/lib/analyses/SwaggerExampleAnalyzer.d.ts +31 -0
  55. package/lib/analyses/SwaggerExampleAnalyzer.js +36 -0
  56. package/lib/analyses/SwaggerExampleAnalyzer.js.map +1 -0
  57. package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +41 -3
  58. package/lib/analyses/TypedHttpRouteAnalyzer.js +196 -172
  59. package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
  60. package/lib/analyses/TypedMcpRouteAnalyzer.d.ts +29 -0
  61. package/lib/analyses/TypedMcpRouteAnalyzer.js +152 -20
  62. package/lib/analyses/TypedMcpRouteAnalyzer.js.map +1 -1
  63. package/lib/analyses/TypedWebSocketRouteAnalyzer.d.ts +19 -0
  64. package/lib/analyses/TypedWebSocketRouteAnalyzer.js +20 -1
  65. package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
  66. package/lib/decorators/OperationMetadata.d.ts +6 -0
  67. package/lib/decorators/OperationMetadata.js +6 -0
  68. package/lib/decorators/OperationMetadata.js.map +1 -1
  69. package/lib/executable/internal/CommandParser.d.ts +19 -0
  70. package/lib/executable/internal/CommandParser.js +19 -0
  71. package/lib/executable/internal/CommandParser.js.map +1 -1
  72. package/lib/executable/internal/NestiaConfigLoader.d.ts +56 -0
  73. package/lib/executable/internal/NestiaConfigLoader.js +48 -42
  74. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  75. package/lib/executable/internal/NestiaSdkCommand.d.ts +60 -0
  76. package/lib/executable/internal/NestiaSdkCommand.js +95 -3
  77. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  78. package/lib/executable/internal/NestiaSdkWatcher.d.ts +81 -0
  79. package/lib/executable/internal/NestiaSdkWatcher.js +125 -41
  80. package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -1
  81. package/lib/executable/internal/NestiaSwaggerWatch.d.ts +80 -0
  82. package/lib/executable/internal/NestiaSwaggerWatch.js +308 -0
  83. package/lib/executable/internal/NestiaSwaggerWatch.js.map +1 -0
  84. package/lib/executable/sdk.js +16 -1
  85. package/lib/executable/sdk.js.map +1 -1
  86. package/lib/factories/ExpressionFactory.d.ts +18 -0
  87. package/lib/factories/ExpressionFactory.js +21 -2
  88. package/lib/factories/ExpressionFactory.js.map +1 -1
  89. package/lib/factories/IdentifierFactory.d.ts +24 -0
  90. package/lib/factories/IdentifierFactory.js +24 -0
  91. package/lib/factories/IdentifierFactory.js.map +1 -1
  92. package/lib/factories/LiteralFactory.d.ts +22 -4
  93. package/lib/factories/LiteralFactory.js +33 -11
  94. package/lib/factories/LiteralFactory.js.map +1 -1
  95. package/lib/factories/StatementFactory.d.ts +28 -1
  96. package/lib/factories/StatementFactory.js +28 -1
  97. package/lib/factories/StatementFactory.js.map +1 -1
  98. package/lib/factories/TypeFactory.d.ts +24 -0
  99. package/lib/factories/TypeFactory.js +15 -0
  100. package/lib/factories/TypeFactory.js.map +1 -1
  101. package/lib/generates/CloneGenerator.d.ts +22 -0
  102. package/lib/generates/CloneGenerator.js +26 -5
  103. package/lib/generates/CloneGenerator.js.map +1 -1
  104. package/lib/generates/E2eGenerator.d.ts +19 -0
  105. package/lib/generates/E2eGenerator.js +19 -0
  106. package/lib/generates/E2eGenerator.js.map +1 -1
  107. package/lib/generates/SdkGenerator.d.ts +38 -0
  108. package/lib/generates/SdkGenerator.js +43 -5
  109. package/lib/generates/SdkGenerator.js.map +1 -1
  110. package/lib/generates/SwaggerGenerator.d.ts +36 -6
  111. package/lib/generates/SwaggerGenerator.js +190 -40
  112. package/lib/generates/SwaggerGenerator.js.map +1 -1
  113. package/lib/generates/internal/E2eFileProgrammer.d.ts +19 -0
  114. package/lib/generates/internal/E2eFileProgrammer.js +20 -1
  115. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  116. package/lib/generates/internal/FilePrinter.d.ts +57 -0
  117. package/lib/generates/internal/FilePrinter.js +74 -0
  118. package/lib/generates/internal/FilePrinter.js.map +1 -1
  119. package/lib/generates/internal/ImportDictionary.d.ts +93 -1
  120. package/lib/generates/internal/ImportDictionary.js +103 -2
  121. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  122. package/lib/generates/internal/SdkAliasCollection.d.ts +121 -1
  123. package/lib/generates/internal/SdkAliasCollection.js +132 -11
  124. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  125. package/lib/generates/internal/SdkDistributionComposer.d.ts +19 -0
  126. package/lib/generates/internal/SdkDistributionComposer.js +149 -52
  127. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  128. package/lib/generates/internal/SdkFileProgrammer.d.ts +18 -0
  129. package/lib/generates/internal/SdkFileProgrammer.js +101 -12
  130. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  131. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +29 -0
  132. package/lib/generates/internal/SdkHttpCloneProgrammer.js +33 -0
  133. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  134. package/lib/generates/internal/SdkHttpCloneReferencer.d.ts +19 -0
  135. package/lib/generates/internal/SdkHttpCloneReferencer.js +78 -25
  136. package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
  137. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +19 -0
  138. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +40 -23
  139. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  140. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +19 -0
  141. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +46 -34
  142. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  143. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +142 -1
  144. package/lib/generates/internal/SdkHttpParameterProgrammer.js +175 -6
  145. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  146. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +20 -0
  147. package/lib/generates/internal/SdkHttpRouteProgrammer.js +36 -32
  148. package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
  149. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +38 -0
  150. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +66 -18
  151. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  152. package/lib/generates/internal/SdkImportWizard.d.ts +63 -0
  153. package/lib/generates/internal/SdkImportWizard.js +63 -0
  154. package/lib/generates/internal/SdkImportWizard.js.map +1 -1
  155. package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +17 -2
  156. package/lib/generates/internal/SdkMcpRouteProgrammer.js +72 -24
  157. package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
  158. package/lib/generates/internal/SdkPathTemplate.d.ts +36 -0
  159. package/lib/generates/internal/SdkPathTemplate.js +65 -0
  160. package/lib/generates/internal/SdkPathTemplate.js.map +1 -0
  161. package/lib/generates/internal/SdkRouteDirectory.d.ts +10 -0
  162. package/lib/generates/internal/SdkRouteDirectory.js +10 -0
  163. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  164. package/lib/generates/internal/SdkTypeProgrammer.d.ts +54 -1
  165. package/lib/generates/internal/SdkTypeProgrammer.js +111 -27
  166. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  167. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +53 -1
  168. package/lib/generates/internal/SdkTypeTagProgrammer.js +407 -67
  169. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  170. package/lib/generates/internal/SdkWebSocketCloneProgrammer.d.ts +40 -0
  171. package/lib/generates/internal/SdkWebSocketCloneProgrammer.js +149 -142
  172. package/lib/generates/internal/SdkWebSocketCloneProgrammer.js.map +1 -1
  173. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +19 -0
  174. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +46 -36
  175. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  176. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +114 -1
  177. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +120 -5
  178. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  179. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +18 -0
  180. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +75 -33
  181. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  182. package/lib/generates/internal/SwaggerDescriptionComposer.d.ts +42 -0
  183. package/lib/generates/internal/SwaggerDescriptionComposer.js +44 -1
  184. package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
  185. package/lib/generates/internal/SwaggerOperationComposer.d.ts +18 -0
  186. package/lib/generates/internal/SwaggerOperationComposer.js +37 -8
  187. package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
  188. package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +40 -1
  189. package/lib/generates/internal/SwaggerOperationParameterComposer.js +230 -25
  190. package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
  191. package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +21 -0
  192. package/lib/generates/internal/SwaggerOperationResponseComposer.js +58 -7
  193. package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
  194. package/lib/internal/legacy.d.ts +342 -31
  195. package/lib/internal/legacy.js +207 -31
  196. package/lib/internal/legacy.js.map +1 -1
  197. package/lib/structures/INestiaProject.d.ts +10 -0
  198. package/lib/structures/INestiaSdkInput.d.ts +30 -0
  199. package/lib/structures/IOperationMetadata.d.ts +77 -0
  200. package/lib/structures/IReflectController.d.ts +10 -0
  201. package/lib/structures/IReflectHttpOperation.d.ts +10 -0
  202. package/lib/structures/IReflectHttpOperationException.d.ts +13 -2
  203. package/lib/structures/IReflectHttpOperationParameter.d.ts +55 -3
  204. package/lib/structures/IReflectHttpOperationSuccess.d.ts +15 -3
  205. package/lib/structures/IReflectImport.d.ts +10 -0
  206. package/lib/structures/IReflectMcpOperation.d.ts +19 -0
  207. package/lib/structures/IReflectMcpOperationParameter.d.ts +9 -0
  208. package/lib/structures/IReflectOperationError.d.ts +28 -0
  209. package/lib/structures/IReflectOperationError.js +22 -2
  210. package/lib/structures/IReflectOperationError.js.map +1 -1
  211. package/lib/structures/IReflectType.d.ts +9 -0
  212. package/lib/structures/IReflectWebSocketOperation.d.ts +10 -0
  213. package/lib/structures/IReflectWebSocketOperationParameter.d.ts +55 -0
  214. package/lib/structures/ITypedApplication.d.ts +10 -0
  215. package/lib/structures/ITypedHttpRoute.d.ts +18 -0
  216. package/lib/structures/ITypedHttpRouteException.d.ts +13 -1
  217. package/lib/structures/ITypedHttpRouteParameter.d.ts +48 -1
  218. package/lib/structures/ITypedHttpRouteSuccess.d.ts +13 -1
  219. package/lib/structures/ITypedMcpRoute.d.ts +11 -0
  220. package/lib/structures/ITypedWebSocketRoute.d.ts +18 -0
  221. package/lib/transform.d.ts +6 -0
  222. package/lib/transform.js +6 -0
  223. package/lib/transform.js.map +1 -1
  224. package/lib/utils/ArrayUtil.d.ts +31 -1
  225. package/lib/utils/ArrayUtil.js +32 -11
  226. package/lib/utils/ArrayUtil.js.map +1 -1
  227. package/lib/utils/EmittedJavaScriptPatcher.d.ts +20 -0
  228. package/lib/utils/EmittedJavaScriptPatcher.js +65 -46
  229. package/lib/utils/EmittedJavaScriptPatcher.js.map +1 -1
  230. package/lib/utils/FileRetriever.d.ts +29 -0
  231. package/lib/utils/FileRetriever.js +29 -0
  232. package/lib/utils/FileRetriever.js.map +1 -1
  233. package/lib/utils/HttpResponseContentTypeUtil.d.ts +41 -0
  234. package/lib/utils/HttpResponseContentTypeUtil.js +31 -0
  235. package/lib/utils/HttpResponseContentTypeUtil.js.map +1 -1
  236. package/lib/utils/MapUtil.d.ts +64 -1
  237. package/lib/utils/MapUtil.js +24 -3
  238. package/lib/utils/MapUtil.js.map +1 -1
  239. package/lib/utils/PathUtil.d.ts +31 -0
  240. package/lib/utils/PathUtil.js +38 -0
  241. package/lib/utils/PathUtil.js.map +1 -1
  242. package/lib/utils/SdkBundlePath.d.ts +2 -0
  243. package/lib/utils/SdkBundlePath.js +10 -0
  244. package/lib/utils/SdkBundlePath.js.map +1 -0
  245. package/lib/utils/SdkInputFilter.d.ts +31 -0
  246. package/lib/utils/SdkInputFilter.js +115 -0
  247. package/lib/utils/SdkInputFilter.js.map +1 -0
  248. package/lib/utils/SourceFinder.d.ts +45 -0
  249. package/lib/utils/SourceFinder.js +74 -16
  250. package/lib/utils/SourceFinder.js.map +1 -1
  251. package/lib/utils/StringUtil.d.ts +77 -2
  252. package/lib/utils/StringUtil.js +166 -4
  253. package/lib/utils/StringUtil.js.map +1 -1
  254. package/lib/utils/TemporaryDirectory.d.ts +60 -0
  255. package/lib/utils/TemporaryDirectory.js +112 -0
  256. package/lib/utils/TemporaryDirectory.js.map +1 -0
  257. package/lib/utils/TsConfigReader.d.ts +42 -0
  258. package/lib/utils/TsConfigReader.js +98 -14
  259. package/lib/utils/TsConfigReader.js.map +1 -1
  260. package/lib/utils/TtscExecutor.d.ts +23 -1
  261. package/lib/utils/TtscExecutor.js +22 -0
  262. package/lib/utils/TtscExecutor.js.map +1 -1
  263. package/lib/utils/VersioningStrategy.d.ts +39 -2
  264. package/lib/utils/VersioningStrategy.js +46 -13
  265. package/lib/utils/VersioningStrategy.js.map +1 -1
  266. package/lib/validators/TextPlainValidator.d.ts +19 -0
  267. package/lib/validators/TextPlainValidator.js +19 -0
  268. package/lib/validators/TextPlainValidator.js.map +1 -1
  269. package/native/go.mod +1 -1
  270. package/native/go.sum +2 -2
  271. package/native/sdk/register.go +12 -2
  272. package/native/sdk/sdk_http_rules.go +210 -0
  273. package/native/sdk/sdk_metadata_json.go +79 -4
  274. package/native/sdk/sdk_transform.go +1157 -414
  275. package/package.json +8 -6
  276. package/src/INestiaConfig.ts +74 -34
  277. package/src/NestiaSdkApplication.ts +129 -41
  278. package/src/NestiaSwaggerComposer.ts +32 -14
  279. package/src/analyses/AccessorAnalyzer.ts +26 -0
  280. package/src/analyses/ConfigAnalyzer.ts +52 -90
  281. package/src/analyses/ImportAnalyzer.ts +25 -0
  282. package/src/analyses/ParameterNameAnalyzer.ts +75 -0
  283. package/src/analyses/PathAnalyzer.ts +167 -23
  284. package/src/analyses/ReflectControllerAnalyzer.ts +34 -1
  285. package/src/analyses/ReflectHttpOperationAnalyzer.ts +36 -14
  286. package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +31 -0
  287. package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +153 -39
  288. package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +38 -7
  289. package/src/analyses/ReflectMcpOperationAnalyzer.ts +38 -3
  290. package/src/analyses/ReflectMetadataAnalyzer.ts +47 -0
  291. package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +40 -7
  292. package/src/analyses/SecurityAnalyzer.ts +45 -20
  293. package/src/analyses/SwaggerExampleAnalyzer.ts +39 -0
  294. package/src/analyses/TypedHttpRouteAnalyzer.ts +263 -198
  295. package/src/analyses/TypedMcpRouteAnalyzer.ts +180 -20
  296. package/src/analyses/TypedWebSocketRouteAnalyzer.ts +20 -0
  297. package/src/decorators/OperationMetadata.ts +6 -0
  298. package/src/executable/internal/CommandParser.ts +19 -0
  299. package/src/executable/internal/NestiaConfigLoader.ts +66 -50
  300. package/src/executable/internal/NestiaSdkCommand.ts +96 -3
  301. package/src/executable/internal/NestiaSdkWatcher.ts +172 -44
  302. package/src/executable/internal/NestiaSwaggerWatch.ts +359 -0
  303. package/src/executable/sdk.ts +24 -1
  304. package/src/factories/ExpressionFactory.ts +23 -2
  305. package/src/factories/IdentifierFactory.ts +24 -0
  306. package/src/factories/LiteralFactory.ts +51 -13
  307. package/src/factories/StatementFactory.ts +28 -1
  308. package/src/factories/TypeFactory.ts +24 -0
  309. package/src/generates/CloneGenerator.ts +26 -5
  310. package/src/generates/E2eGenerator.ts +19 -0
  311. package/src/generates/SdkGenerator.ts +43 -12
  312. package/src/generates/SwaggerGenerator.ts +229 -46
  313. package/src/generates/internal/E2eFileProgrammer.ts +20 -0
  314. package/src/generates/internal/FilePrinter.ts +71 -0
  315. package/src/generates/internal/ImportDictionary.ts +120 -2
  316. package/src/generates/internal/SdkAliasCollection.ts +144 -15
  317. package/src/generates/internal/SdkDistributionComposer.ts +181 -56
  318. package/src/generates/internal/SdkFileProgrammer.ts +126 -16
  319. package/src/generates/internal/SdkHttpCloneProgrammer.ts +55 -0
  320. package/src/generates/internal/SdkHttpCloneReferencer.ts +97 -23
  321. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +47 -30
  322. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +53 -64
  323. package/src/generates/internal/SdkHttpParameterProgrammer.ts +295 -13
  324. package/src/generates/internal/SdkHttpRouteProgrammer.ts +37 -31
  325. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +122 -18
  326. package/src/generates/internal/SdkImportWizard.ts +63 -0
  327. package/src/generates/internal/SdkMcpRouteProgrammer.ts +150 -33
  328. package/src/generates/internal/SdkPathTemplate.ts +88 -0
  329. package/src/generates/internal/SdkRouteDirectory.ts +10 -0
  330. package/src/generates/internal/SdkTypeProgrammer.ts +137 -36
  331. package/src/generates/internal/SdkTypeTagProgrammer.ts +536 -78
  332. package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +185 -142
  333. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +62 -68
  334. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +205 -5
  335. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +89 -48
  336. package/src/generates/internal/SwaggerDescriptionComposer.ts +47 -1
  337. package/src/generates/internal/SwaggerOperationComposer.ts +38 -6
  338. package/src/generates/internal/SwaggerOperationParameterComposer.ts +318 -36
  339. package/src/generates/internal/SwaggerOperationResponseComposer.ts +74 -11
  340. package/src/internal/legacy-augmentation.d.ts +16 -0
  341. package/src/internal/legacy.ts +407 -49
  342. package/src/structures/INestiaProject.ts +10 -0
  343. package/src/structures/INestiaSdkInput.ts +30 -0
  344. package/src/structures/IOperationMetadata.ts +83 -0
  345. package/src/structures/IReflectController.ts +10 -0
  346. package/src/structures/IReflectHttpOperation.ts +10 -0
  347. package/src/structures/IReflectHttpOperationException.ts +17 -2
  348. package/src/structures/IReflectHttpOperationParameter.ts +56 -2
  349. package/src/structures/IReflectHttpOperationSuccess.ts +19 -3
  350. package/src/structures/IReflectImport.ts +10 -0
  351. package/src/structures/IReflectMcpOperation.ts +19 -0
  352. package/src/structures/IReflectMcpOperationParameter.ts +9 -0
  353. package/src/structures/IReflectOperationError.ts +31 -2
  354. package/src/structures/IReflectType.ts +9 -0
  355. package/src/structures/IReflectWebSocketOperation.ts +10 -0
  356. package/src/structures/IReflectWebSocketOperationParameter.ts +55 -0
  357. package/src/structures/ITypedApplication.ts +10 -0
  358. package/src/structures/ITypedHttpRoute.ts +18 -0
  359. package/src/structures/ITypedHttpRouteException.ts +14 -1
  360. package/src/structures/ITypedHttpRouteParameter.ts +48 -1
  361. package/src/structures/ITypedHttpRouteSuccess.ts +14 -1
  362. package/src/structures/ITypedMcpRoute.ts +12 -0
  363. package/src/structures/ITypedWebSocketRoute.ts +18 -0
  364. package/src/transform.ts +6 -0
  365. package/src/utils/ArrayUtil.ts +32 -13
  366. package/src/utils/EmittedJavaScriptPatcher.ts +70 -47
  367. package/src/utils/FileRetriever.ts +29 -0
  368. package/src/utils/HttpResponseContentTypeUtil.ts +41 -0
  369. package/src/utils/MapUtil.ts +68 -3
  370. package/src/utils/PathUtil.ts +38 -0
  371. package/src/utils/SdkBundlePath.ts +11 -0
  372. package/src/utils/SdkInputFilter.ts +108 -0
  373. package/src/utils/SourceFinder.ts +76 -18
  374. package/src/utils/StringUtil.ts +182 -5
  375. package/src/utils/TemporaryDirectory.ts +108 -0
  376. package/src/utils/TsConfigReader.ts +124 -26
  377. package/src/utils/TtscExecutor.ts +23 -1
  378. package/src/utils/VersioningStrategy.ts +51 -16
  379. package/src/validators/TextPlainValidator.ts +19 -0
  380. package/lib/generates/internal/SwaggerReadonlyArrayEmender.d.ts +0 -9
  381. package/lib/generates/internal/SwaggerReadonlyArrayEmender.js +0 -178
  382. package/lib/generates/internal/SwaggerReadonlyArrayEmender.js.map +0 -1
  383. package/lib/validators/HttpHeadersValidator.d.ts +0 -11
  384. package/lib/validators/HttpHeadersValidator.js +0 -15
  385. package/lib/validators/HttpHeadersValidator.js.map +0 -1
  386. package/lib/validators/HttpQueryValidator.d.ts +0 -10
  387. package/lib/validators/HttpQueryValidator.js +0 -14
  388. package/lib/validators/HttpQueryValidator.js.map +0 -1
  389. package/src/generates/internal/SwaggerReadonlyArrayEmender.ts +0 -264
  390. package/src/validators/HttpHeadersValidator.ts +0 -12
  391. package/src/validators/HttpQueryValidator.ts +0 -11
@@ -15,24 +15,76 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.TsConfigReader = void 0;
16
16
  const fs_1 = __importDefault(require("fs"));
17
17
  const path_1 = __importDefault(require("path"));
18
+ /**
19
+ * Reads a tsconfig with its `extends` chain without the compiler API.
20
+ *
21
+ * Later bases override earlier bases, including shared ancestors. Circular
22
+ * inheritance rejects rather than returning a partial configuration.
23
+ *
24
+ * @evidence contracts/common.md#principled-implementation The file is read as JSON with comments and trailing commas removed, each base is resolved and merged before the file itself, active ancestors reject cycles, and the relative `typeRoots` of each file are resolved against that file's own directory, as the compiler resolves them, before the merge forgets where they came from.
25
+ * @evidence contracts/common.md#clear-and-simple-design One public function with private parsing and resolution helpers.
26
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It reads the files the compiler reads.
27
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
28
+ * @evidence contracts/portability.md#os-neutral-implementation Files are read as UTF-8 through `fs`, a leading byte order mark is dropped, relative bases and `typeRoots` are resolved with `path.resolve` against the directory of the file that names them, and package bases go through Node module resolution from that directory. Resolved native path spellings key the per-read cache and active-ancestor set. Relative bases and option paths retain the directory of the requested config rather than being rebased onto a symlink target.
29
+ * efficient algorithms: Each distinct resolved configuration is parsed and merged once per read. Every extends edge contributes its already-merged options in declared order; work scales with input bytes, edges and the option records being combined rather than repeated traversal of shared ancestry.
30
+ * reuse equivalent work: A read owns a cache of completed results keyed by resolved config pathname. It shares the same base across branches only within that read, and a later read observes edits rather than retaining stale configuration state.
31
+ * bound retention and release resources: The active-ancestor set and completed-config map belong to one read. Active entries leave in finally, and the map is released when the returned read promise settles; no process-wide cache or open file handle survives.
32
+ */
18
33
  var TsConfigReader;
19
34
  (function (TsConfigReader) {
20
- TsConfigReader.read = (file) => __awaiter(this, void 0, void 0, function* () { return merge(file, new Set()); });
21
- const merge = (file, visited) => __awaiter(this, void 0, void 0, function* () {
35
+ /**
36
+ * Returns the merged tsconfig of a file: bases first, later files override
37
+ * earlier ones, and compiler options are merged by key. The `typeRoots` of a
38
+ * file are returned absolute, resolved against the directory of the file that
39
+ * wrote them.
40
+ *
41
+ * @evidence contracts/common.md#principled-implementation Relative bases are resolved from the file's directory and package bases through module resolution, a base that cannot be found is skipped, and completed base configurations are reused by resolved pathname, and only a revisit to an active ancestor is a rejected cycle. A shared base contributes its full inherited values to every branch, so later extends entries override earlier ones even in a diamond.
42
+ * @evidence contracts/common.md#clear-and-simple-design One function delegating the merge.
43
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The comment stripper and the trailing-comma remover are one-pass scanners that track strings, so a slash or a comma inside a string value is kept; the files are read as the compiler reads them, apart from the stated limit that only `typeRoots` is rebased and the other path-valued options keep their written form.
44
+ * @evidence contracts/common.md#meaningful-documentation The comment states the merge order.
45
+ * @evidence contracts/portability.md#os-neutral-implementation The `typeRoots` of the result are absolute native paths, but every other path-valued option keeps its written form relative to the directory of the file that wrote it, so a caller must not read such an option as relative to its own directory.
46
+ * efficient algorithms: One per-read completed map avoids re-reading and recursively merging shared ancestors, while each direct base's option record is combined in order to preserve last-base precedence.
47
+ * reuse equivalent work: Completed ancestors share their parsed and merged values within this request. Each call starts fresh state because files can change between generations.
48
+ * bound retention and release resources: The call allocates its own ancestor set and result map and retains neither globally. Each recursive active entry is removed in finally, including parse and resolution failures.
49
+ */
50
+ TsConfigReader.read = (file) => __awaiter(this, void 0, void 0, function* () { return merge(file, new Set(), new Map()); });
51
+ const merge = (file, active, completed) => __awaiter(this, void 0, void 0, function* () {
22
52
  const location = path_1.default.resolve(file);
23
- if (visited.has(location))
24
- return {};
25
- visited.add(location);
26
- const current = parse(yield fs_1.default.promises.readFile(location, "utf8"));
27
- const bases = [];
28
- for (const parent of asArray(current.extends)) {
29
- const next = resolveExtends(parent, path_1.default.dirname(location));
30
- if (next !== null)
31
- bases.push(yield merge(next, visited));
53
+ if (active.has(location))
54
+ throw new Error(`Circular tsconfig extends: ${location}`);
55
+ const cached = completed.get(location);
56
+ if (cached !== undefined)
57
+ return cached;
58
+ active.add(location);
59
+ try {
60
+ const current = rebase(parse(yield fs_1.default.promises.readFile(location, "utf8")), path_1.default.dirname(location));
61
+ const bases = [];
62
+ for (const parent of asArray(current.extends)) {
63
+ const next = resolveExtends(parent, path_1.default.dirname(location));
64
+ if (next !== null)
65
+ bases.push(yield merge(next, active, completed));
66
+ }
67
+ const result = [...bases, current].reduce((acc, elem) => { var _a, _b; return (Object.assign(Object.assign(Object.assign({}, acc), elem), { compilerOptions: Object.assign(Object.assign({}, ((_a = acc.compilerOptions) !== null && _a !== void 0 ? _a : {})), ((_b = elem.compilerOptions) !== null && _b !== void 0 ? _b : {})) })); }, {});
68
+ completed.set(location, result);
69
+ return result;
70
+ }
71
+ finally {
72
+ active.delete(location);
32
73
  }
33
- return [...bases, current].reduce((acc, elem) => { var _a, _b; return (Object.assign(Object.assign(Object.assign({}, acc), elem), { compilerOptions: Object.assign(Object.assign({}, ((_a = acc.compilerOptions) !== null && _a !== void 0 ? _a : {})), ((_b = elem.compilerOptions) !== null && _b !== void 0 ? _b : {})) })); }, {});
34
74
  });
35
- const parse = (text) => JSON.parse(stripTrailingCommas(stripJsonComments(text)));
75
+ // The compiler reads a relative path of a config against the directory of the
76
+ // file that wrote it, and the merged result no longer says which file that
77
+ // was, so `typeRoots`, the one path-valued option a caller forwards to another
78
+ // project, is made absolute here.
79
+ const rebase = (config, directory) => {
80
+ var _a;
81
+ const typeRoots = (_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.typeRoots;
82
+ if (Array.isArray(typeRoots) === false)
83
+ return config;
84
+ return Object.assign(Object.assign({}, config), { compilerOptions: Object.assign(Object.assign({}, config.compilerOptions), { typeRoots: typeRoots.map((root) => typeof root === "string" ? path_1.default.resolve(directory, root) : root) }) });
85
+ };
86
+ // A byte order mark, which editors on some platforms write, is no JSON.
87
+ const parse = (text) => JSON.parse(stripTrailingCommas(stripJsonComments(text.charCodeAt(0) === 0xfeff ? text.slice(1) : text)));
36
88
  const asArray = (value) => value === undefined ? [] : Array.isArray(value) ? value : [value];
37
89
  const resolveExtends = (specifier, cwd) => {
38
90
  const candidates = (base) => {
@@ -99,6 +151,38 @@ var TsConfigReader;
99
151
  }
100
152
  return output;
101
153
  };
102
- const stripTrailingCommas = (input) => input.replace(/,\s*([}\]])/g, "$1");
154
+ // a comma followed, past whitespace, by a closing brace or bracket, outside
155
+ // every string, so that the text of a value is never changed
156
+ const stripTrailingCommas = (input) => {
157
+ let output = "";
158
+ let string = false;
159
+ let escaped = false;
160
+ for (let i = 0; i < input.length; ++i) {
161
+ const ch = input[i];
162
+ if (string !== false) {
163
+ output += ch;
164
+ if (escaped)
165
+ escaped = false;
166
+ else if (ch === "\\")
167
+ escaped = true;
168
+ else if (ch === string)
169
+ string = false;
170
+ }
171
+ else if (ch === '"' || ch === "'") {
172
+ string = ch;
173
+ output += ch;
174
+ }
175
+ else if (ch === ",") {
176
+ let next = i + 1;
177
+ while (next < input.length && /\s/.test(input[next]))
178
+ ++next;
179
+ if (input[next] !== "}" && input[next] !== "]")
180
+ output += ch;
181
+ }
182
+ else
183
+ output += ch;
184
+ }
185
+ return output;
186
+ };
103
187
  })(TsConfigReader || (exports.TsConfigReader = TsConfigReader = {}));
104
188
  //# sourceMappingURL=TsConfigReader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TsConfigReader.js","sourceRoot":"","sources":["../../src/utils/TsConfigReader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB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AG,KAAK,CAAC,CAAC,CAAE,CAAC;YACrB,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,MAAM,IAAI,EAAE,CAAC;gBACb,IAAI,OAAO;oBAAE,OAAO,GAAG,KAAK,CAAC;qBACxB,IAAI,EAAE,KAAK,IAAI;oBAAE,OAAO,GAAG,IAAI,CAAC;qBAChC,IAAI,EAAE,KAAK,MAAM;oBAAE,MAAM,GAAG,KAAK,CAAC;YACzC,CAAC;iBAAM,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBACpC,MAAM,GAAG,EAAE,CAAC;gBACZ,MAAM,IAAI,EAAE,CAAC;YACf,CAAC;iBAAM,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBACtB,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;gBACjB,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAE,CAAC;oBAAE,EAAE,IAAI,CAAC;gBAC9D,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG;oBAAE,MAAM,IAAI,EAAE,CAAC;YAC/D,CAAC;;gBAAM,MAAM,IAAI,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,EAnMgB,cAAc,aAAd,cAAc,GAAd,cAAc,QAmM9B"}
@@ -1,9 +1,31 @@
1
1
  import cp from "child_process";
2
+ /**
3
+ * Runs the `ttsc` compiler of the project.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation The binary is found from the project's own `ttsc` package, with the SDK's dependency as a fallback, and is run with the current Node.
6
+ * @evidence contracts/common.md#clear-and-simple-design One function and a resolution cache.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The binary comes from the package manifest, not a fixed path.
8
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
9
+ * @evidence contracts/portability.md#os-neutral-implementation The compiler runs as a child of the current Node executable (`process.execPath`) on the JavaScript entry that the package manifest's `bin` names, found through Node module resolution from the project directory, so no platform shim (`.cmd`, `.ps1` or shell script) and no `PATH` lookup is involved. Arguments are an array, never a command line, and the entry path is joined with `path.join` and checked with `existsSync`.
10
+ */
2
11
  export declare namespace TtscExecutor {
12
+ /**
13
+ * Compiles a project with `ttsc` and returns captured output, or null when
14
+ * the selected stdio does not pipe standard output.
15
+ *
16
+ * The cache directory of the environment is passed on, and a non-zero exit
17
+ * throws.
18
+ *
19
+ * @evidence contracts/common.md#principled-implementation The command is run with an argument array and the current Node executable, so no shell or platform shim is involved.
20
+ * @evidence contracts/common.md#clear-and-simple-design One function.
21
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The environment is extended, not replaced.
22
+ * @evidence contracts/common.md#meaningful-documentation The comment states the arguments and the failure.
23
+ * @evidence contracts/portability.md#os-neutral-implementation The working directory and the environment are explicit. Standard output is piped by default with a 64 MiB buffer; callers may select another stdio mode. A non-zero exit surfaces as Node's process error carrying `status` and available captured output.
24
+ */
3
25
  const run: (props: {
4
26
  cwd: string;
5
27
  env?: NodeJS.ProcessEnv;
6
28
  project: string;
7
29
  stdio?: cp.StdioOptions;
8
- }) => Buffer;
30
+ }) => Buffer | null;
9
31
  }
@@ -7,8 +7,30 @@ exports.TtscExecutor = void 0;
7
7
  const child_process_1 = __importDefault(require("child_process"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
+ /**
11
+ * Runs the `ttsc` compiler of the project.
12
+ *
13
+ * @evidence contracts/common.md#principled-implementation The binary is found from the project's own `ttsc` package, with the SDK's dependency as a fallback, and is run with the current Node.
14
+ * @evidence contracts/common.md#clear-and-simple-design One function and a resolution cache.
15
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The binary comes from the package manifest, not a fixed path.
16
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
17
+ * @evidence contracts/portability.md#os-neutral-implementation The compiler runs as a child of the current Node executable (`process.execPath`) on the JavaScript entry that the package manifest's `bin` names, found through Node module resolution from the project directory, so no platform shim (`.cmd`, `.ps1` or shell script) and no `PATH` lookup is involved. Arguments are an array, never a command line, and the entry path is joined with `path.join` and checked with `existsSync`.
18
+ */
10
19
  var TtscExecutor;
11
20
  (function (TtscExecutor) {
21
+ /**
22
+ * Compiles a project with `ttsc` and returns captured output, or null when
23
+ * the selected stdio does not pipe standard output.
24
+ *
25
+ * The cache directory of the environment is passed on, and a non-zero exit
26
+ * throws.
27
+ *
28
+ * @evidence contracts/common.md#principled-implementation The command is run with an argument array and the current Node executable, so no shell or platform shim is involved.
29
+ * @evidence contracts/common.md#clear-and-simple-design One function.
30
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The environment is extended, not replaced.
31
+ * @evidence contracts/common.md#meaningful-documentation The comment states the arguments and the failure.
32
+ * @evidence contracts/portability.md#os-neutral-implementation The working directory and the environment are explicit. Standard output is piped by default with a 64 MiB buffer; callers may select another stdio mode. A non-zero exit surfaces as Node's process error carrying `status` and available captured output.
33
+ */
12
34
  TtscExecutor.run = (props) => {
13
35
  var _a;
14
36
  const args = [bin(props.cwd), "-p", props.project];
@@ -1 +1 @@
1
- {"version":3,"file":"TtscExecutor.js","sourceRoot":"","sources":["../../src/utils/TtscExecutor.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AAExB,IAAiB,YAAY,CA+D5B;AA/DD,WAAiB,YAAY;IACd,gBAAG,GAAG,CAAC,KAKnB,EAAU,EAAE;;QACX,MAAM,IAAI,GAAa,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS;YAC1C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,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;YAC3B,MAAM,IAAI,GACR,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI;gBAC/C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;gBAClC,CAAC,CAAC,QAAQ,CAAC;YACf,MAAM,IAAI,KAAK,CACb,sDAAsD;gBACpD,0BAA0B,IAAI,IAAI;gBAClC,6CAA6C,CAChD,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAW,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACxD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,+BAA+B,QAAQ,KAAK;gBAC1C,6CAA6C,CAChD,CAAC;QACJ,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC,EA5EgB,YAAY,aAAZ,YAAY,GAAZ,YAAY,QA4E5B"}
@@ -1,6 +1,43 @@
1
1
  import { VERSION_NEUTRAL, VersionValue } from "@nestjs/common/interfaces";
2
2
  import { INestiaProject } from "../structures/INestiaProject";
3
+ /**
4
+ * Resolves the URI versions of a controller method as NestJS does.
5
+ *
6
+ * @evidence contracts/common.md#principled-implementation The namespace turns version metadata and the default version into path segments.
7
+ * @evidence contracts/common.md#clear-and-simple-design Two functions.
8
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
9
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
10
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
11
+ */
3
12
  export declare namespace VersioningStrategy {
4
- const cast: (value: VersionValue | undefined) => Array<string | typeof VERSION_NEUTRAL>;
5
- const merge: (project: Omit<INestiaProject, "config">) => (values: Array<string | typeof VERSION_NEUTRAL>) => string[];
13
+ /**
14
+ * Casts version metadata to a list: absence stays absent and a single value
15
+ * is a one-element list.
16
+ *
17
+ * @evidence contracts/common.md#principled-implementation A single version becomes a list while absence stays distinct from an explicit empty list, which registers no paths rather than inheriting other versions.
18
+ * @evidence contracts/common.md#clear-and-simple-design One conditional.
19
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It adds nothing.
20
+ * @evidence contracts/common.md#meaningful-documentation The comment states the cases.
21
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.cast maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
22
+ */
23
+ const cast: (value: VersionValue | undefined) => Array<string | typeof VERSION_NEUTRAL> | undefined;
24
+ /**
25
+ * Version path segments of a route, resolved as NestJS resolves them: the
26
+ * method's versions, else the controller's, else the default version, and no
27
+ * version at all is the unversioned path.
28
+ *
29
+ * The controller's and the method's versions were joined, so a method
30
+ * overriding its controller's version was also described at the controller's,
31
+ * and a route with no version and no default got no path at all (#1735).
32
+ *
33
+ * @evidence contracts/common.md#principled-implementation The first present method, controller or default list wins, including an empty list that registers no paths. Duplicates are removed, neutral and absent versions have no segment, and with versioning off the only segment is empty.
34
+ * @evidence contracts/common.md#clear-and-simple-design One curried function.
35
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
36
+ * @evidence contracts/common.md#meaningful-documentation The comment states the precedence.
37
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.merge maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
38
+ */
39
+ const merge: (project: Omit<INestiaProject, "config">) => (props: {
40
+ controller: Array<string | typeof VERSION_NEUTRAL> | undefined;
41
+ method: Array<string | typeof VERSION_NEUTRAL> | undefined;
42
+ }) => string[];
6
43
  }
@@ -1,22 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VersioningStrategy = void 0;
4
+ /**
5
+ * Resolves the URI versions of a controller method as NestJS does.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation The namespace turns version metadata and the default version into path segments.
8
+ * @evidence contracts/common.md#clear-and-simple-design Two functions.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
10
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
11
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
12
+ */
4
13
  var VersioningStrategy;
5
14
  (function (VersioningStrategy) {
6
- VersioningStrategy.cast = (value) => value === undefined ? [] : Array.isArray(value) ? value : [value];
7
- VersioningStrategy.merge = (project) => (values) => {
8
- var _a;
9
- if (project.input.versioning === undefined)
15
+ /**
16
+ * Casts version metadata to a list: absence stays absent and a single value
17
+ * is a one-element list.
18
+ *
19
+ * @evidence contracts/common.md#principled-implementation A single version becomes a list while absence stays distinct from an explicit empty list, which registers no paths rather than inheriting other versions.
20
+ * @evidence contracts/common.md#clear-and-simple-design One conditional.
21
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It adds nothing.
22
+ * @evidence contracts/common.md#meaningful-documentation The comment states the cases.
23
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.cast maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
24
+ */
25
+ VersioningStrategy.cast = (value) => value === undefined ? undefined : Array.isArray(value) ? value : [value];
26
+ /**
27
+ * Version path segments of a route, resolved as NestJS resolves them: the
28
+ * method's versions, else the controller's, else the default version, and no
29
+ * version at all is the unversioned path.
30
+ *
31
+ * The controller's and the method's versions were joined, so a method
32
+ * overriding its controller's version was also described at the controller's,
33
+ * and a route with no version and no default got no path at all (#1735).
34
+ *
35
+ * @evidence contracts/common.md#principled-implementation The first present method, controller or default list wins, including an empty list that registers no paths. Duplicates are removed, neutral and absent versions have no segment, and with versioning off the only segment is empty.
36
+ * @evidence contracts/common.md#clear-and-simple-design One curried function.
37
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
38
+ * @evidence contracts/common.md#meaningful-documentation The comment states the precedence.
39
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.merge maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
40
+ */
41
+ VersioningStrategy.merge = (project) => (props) => {
42
+ var _a, _b;
43
+ const versioning = project.input.versioning;
44
+ if (versioning === undefined)
10
45
  return [""];
11
- const set = new Set(values);
12
- const array = set.size === 0
13
- ? VersioningStrategy.cast((_a = project.input.versioning) === null || _a === void 0 ? void 0 : _a.defaultVersion)
14
- : Array.from(set);
15
- return !!(array === null || array === void 0 ? void 0 : array.length)
16
- ? array.map((x) => typeof x === "symbol"
17
- ? ""
18
- : `${project.input.versioning.prefix}${x}`)
19
- : [];
46
+ const chosen = (_b = (_a = props.method) !== null && _a !== void 0 ? _a : props.controller) !== null && _b !== void 0 ? _b : VersioningStrategy.cast(versioning.defaultVersion);
47
+ if (chosen === undefined)
48
+ return [""];
49
+ const unique = [
50
+ ...new Set(chosen),
51
+ ];
52
+ return unique.map((x) => typeof x === "symbol" ? "" : `${versioning.prefix}${x}`);
20
53
  };
21
54
  })(VersioningStrategy || (exports.VersioningStrategy = VersioningStrategy = {}));
22
55
  //# sourceMappingURL=VersioningStrategy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VersioningStrategy.js","sourceRoot":"","sources":["../../src/utils/VersioningStrategy.ts"],"names":[],"mappings":";;;AAIA,IAAiB,kBAAkB,CAuBlC;AAvBD,WAAiB,kBAAkB;IACpB,uBAAI,GAAG,CAClB,KAA+B,EACS,EAAE,CAC1C,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAEvD,wBAAK,GAChB,CAA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U,wBAAK,GAChB,CAAC,OAAuC,EAAE,EAAE,CAC5C,CAAC,KAGA,EAAY,EAAE;;QACb,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;QAC5C,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1C,MAAM,MAAM,eACV,KAAK,CAAC,MAAM,mCAAI,KAAK,CAAC,UAAU,mCAAI,uBAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QACtE,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,MAAM,GAA2C;YACrD,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC;SACnB,CAAC;QACF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACtB,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CACxD,CAAC;IACJ,CAAC,CAAC;AACN,CAAC,EAjDgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QAiDlC"}
@@ -1,5 +1,24 @@
1
1
  import { MetadataSchema } from "../internal/legacy";
2
+ /**
3
+ * Validates that a type can be a `text/plain` body or response.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation A plain text body is a string, so the type may hold only string forms.
6
+ * @evidence contracts/common.md#clear-and-simple-design One function.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The rule follows the content type.
8
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
9
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
10
+ */
2
11
  export declare namespace TextPlainValidator {
12
+ /**
13
+ * Returns an error message unless every member of the metadata is a string, a
14
+ * string constant, a string template, or the native String.
15
+ *
16
+ * @evidence contracts/common.md#principled-implementation The number of string forms is counted and compared with the size of the metadata, so any other form makes the counts differ, and an empty type is also refused.
17
+ * @evidence contracts/common.md#clear-and-simple-design One function.
18
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The count is exact and no type is special-cased.
19
+ * @evidence contracts/common.md#meaningful-documentation The comment states the accepted forms.
20
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator.validate checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
21
+ */
3
22
  const validate: (props: {
4
23
  metadata: MetadataSchema;
5
24
  }) => string[];
@@ -2,8 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TextPlainValidator = void 0;
4
4
  const legacy_1 = require("../internal/legacy");
5
+ /**
6
+ * Validates that a type can be a `text/plain` body or response.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation A plain text body is a string, so the type may hold only string forms.
9
+ * @evidence contracts/common.md#clear-and-simple-design One function.
10
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The rule follows the content type.
11
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
12
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
13
+ */
5
14
  var TextPlainValidator;
6
15
  (function (TextPlainValidator) {
16
+ /**
17
+ * Returns an error message unless every member of the metadata is a string, a
18
+ * string constant, a string template, or the native String.
19
+ *
20
+ * @evidence contracts/common.md#principled-implementation The number of string forms is counted and compared with the size of the metadata, so any other form makes the counts differ, and an empty type is also refused.
21
+ * @evidence contracts/common.md#clear-and-simple-design One function.
22
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The count is exact and no type is special-cased.
23
+ * @evidence contracts/common.md#meaningful-documentation The comment states the accepted forms.
24
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator.validate checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
25
+ */
7
26
  TextPlainValidator.validate = (props) => {
8
27
  const expected = props.metadata.atomics.filter((a) => a.type === "string").length +
9
28
  props.metadata.constants
@@ -1 +1 @@
1
- {"version":3,"file":"TextPlainValidator.js","sourceRoot":"","sources":["../../src/validators/TextPlainValidator.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAE5D,IAAiB,kBAAkB,CAclC;AAdD,WAAiB,kBAAkB;IACpB,2BAAQ,GAAG,CAAC,KAAmC,EAAY,EAAE;QACxE,MAAM,QAAQ,GACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM;YAChE,KAAK,CAAC,QAAQ,CAAC,SAAS;iBACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;iBAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC7B,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM;YAC/B,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;QACnE,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ;YACrE,OAAO,CAAC,+DAA+D,CAAC,CAAC;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,EAdgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QAclC"}
1
+ {"version":3,"file":"TextPlainValidator.js","sourceRoot":"","sources":["../../src/validators/TextPlainValidator.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAE5D;;;;;;;;GAQG;AACH,IAAiB,kBAAkB,CAwBlC;AAxBD,WAAiB,kBAAkB;IACjC;;;;;;;;;OASG;IACU,2BAAQ,GAAG,CAAC,KAAmC,EAAY,EAAE;QACxE,MAAM,QAAQ,GACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM;YAChE,KAAK,CAAC,QAAQ,CAAC,SAAS;iBACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;iBAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC7B,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM;YAC/B,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;QACnE,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ;YACrE,OAAO,CAAC,+DAA+D,CAAC,CAAC;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,EAxBgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QAwBlC"}
package/native/go.mod CHANGED
@@ -9,7 +9,7 @@ require (
9
9
  github.com/microsoft/typescript-go/shim/scanner v0.0.0
10
10
  github.com/samchon/nestia/packages/core/native v0.0.0
11
11
  github.com/samchon/ttsc/packages/ttsc v0.0.0
12
- github.com/samchon/typia/packages/typia/native v0.0.0-20260818045905-f692fd63a846
12
+ github.com/samchon/typia/packages/typia/native v0.0.0-20260926142025-755176823ba3
13
13
  )
14
14
 
15
15
  require (
package/native/go.sum CHANGED
@@ -38,8 +38,8 @@ github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20260820075544-3
38
38
  github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20260820075544-3fe6b732f888/go.mod h1:XS3LhXkn5xadyRe3tW+9+suW/7gh7dPdL43Q+s/lUDo=
39
39
  github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20260820075544-3fe6b732f888 h1:ihiKD2OhuYc7Dngxw3uFYbVoiA/xuPwwQoUakB59E40=
40
40
  github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20260820075544-3fe6b732f888/go.mod h1:otX+qw8aZLNCoBmCwMAn53Nw0RQTPzSoId3DxmE67So=
41
- github.com/samchon/typia/packages/typia/native v0.0.0-20260818045905-f692fd63a846 h1:x9xL0zn2AqPf19lTp8dNal+Ia3cIu0uYnyXlY4mo3QI=
42
- github.com/samchon/typia/packages/typia/native v0.0.0-20260818045905-f692fd63a846/go.mod h1:pUTSG5IZxw8Hohle//RsDXnE+8ZhAus7mPDKFqzvZnk=
41
+ github.com/samchon/typia/packages/typia/native v0.0.0-20260926142025-755176823ba3 h1:XtRIf6wvDuSHLsphMXiB3lm6p0/2sxHMfc6FMjI5LLA=
42
+ github.com/samchon/typia/packages/typia/native v0.0.0-20260926142025-755176823ba3/go.mod h1:pUTSG5IZxw8Hohle//RsDXnE+8ZhAus7mPDKFqzvZnk=
43
43
  github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
44
44
  github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
45
45
  github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
@@ -90,6 +90,15 @@ func (linkedPlugin) ApplyProgram(prog *driver.Program, _ driver.PluginContext) e
90
90
  // alongside the typia and core transforms, exactly as the typia build command
91
91
  // wires `nativetransform.Transform`. A site-collection failure is returned as
92
92
  // diagnostics; the returned transform is nil when there are no sites.
93
+ //
94
+ // @evidence contracts/common.md#principled-implementation Decorated class-method sites are collected once for the program, and the returned transform maps each original method to its synthetic counterpart so the decorator lands on the printed node; collection failures return diagnostics and no sites return nil. Private reflection helpers use TypeReference/TypeQuery roles and checker aliases for authored imports, declaration sources for free types, and IsLibFile for actual libraries; locally bound TypeParameter symbols have no module import identity. Async aliases use the checker-resolved payload and TypeToTypeNode to apply generic defaults and substitutions after shared declaration-based Promise/Observable classification; type operators retain valid source or projected syntax and parenthesized operands preserve generic arguments. Only fixed language keywords are excluded by spelling. Readonly array and tuple schema markers follow actual checker numeric-index immutability and tuple target flags; substituted object properties, ordered schema dictionaries, nested and inferred types retain those facts without classifying authored alias names. Metadata nulls use the explicit upstream JSON null marker, so authored strings remain strings without encoded-text substitution. The shared private tag serializer omits a schema member when upstream analysis supplies nil for an absent or undefined optional schema, while preserving explicit empty objects and null instance leaves inside populated schema objects.
95
+ // @evidence contracts/common.md#clear-and-simple-design Site collection and one per-file closure share file grouping and the module specifier. Private import reflection centralizes reference traversal, authored binding selection and declaration fallback so the reflected type forms use one policy. Checker-generated alias payload nodes carry identifier symbols separately because they have no authored source span; the public printer supplies their text. All raw tag matrices share one serialization boundary, keeping optional tag representation separate from JSON Schema baking.
96
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts The shared module specifier binds one generated alias without controller special cases. Import decisions use semantic AST roles, checker bindings and actual library identity rather than regex matches in literals, built-in-name whitelists or fixture/path spelling. Alias projection uses the supported checker and printer APIs without reparsing or mutating foreign behavior. Optional-schema omission depends on the analyzed nil value, never tag names, fixture paths or a TypeScript-writer compensation; invalid top-level null and scalar schemas remain upstream analyzer errors.
97
+ // @evidence contracts/common.md#meaningful-documentation The public comment explains injected metadata, original-to-synthetic mapping and nil/diagnostic results. Private helper comments explain reference roles, shadowable library names, declaration fallback, annotation-local binders, checker projection and type-operator syntax; these details remain documented at their implementation owners. The private tag serializer explains why absence cannot become JSON null and why empty objects and nested null content stay intact.
98
+ // @evidence contracts/portability.md#os-neutral-implementation File grouping converts both collected paths and emitted source names through filepath.ToSlash; it preserves the compiler's filename identity without guessing volume case policy. The contributor receives an existing compiler program and launches no shell. Declaration-package ownership uses the shared SourceFilePackageName ancestor walk through that program's filesystem, retaining its overlay observations and native filepath operations.
99
+ // @evidence contracts/performance.md#efficient-algorithms Site analysis visits the program once; grouping costs O(S) for S sites plus filename lengths. Each participating emitted file is traversed once to index original method identities, followed by O(Sf) injections for its sites. The method index avoids a separate AST traversal for every route.
100
+ // @evidence contracts/performance.md#reuse-equivalent-work The returned closure shares the collected metadata and file grouping across file emissions of this program. A new EmitTransform invocation recollects against its supplied program; these AST identities cannot safely be reused for another compilation.
101
+ // @evidence contracts/performance.md#bound-retention-and-release-resources The closure retains the site's AST nodes and metadata strings for its compiler emission lifetime. Each per-file method index becomes unreachable after that file returns; there are no process-global program caches, file handles or background tasks in this operation.
93
102
  func EmitTransform(prog *driver.Program) (driver.PluginTransform, []transform.Diagnostic) {
94
103
  sites, diagnostics := collectNestiaSDKSites(prog)
95
104
  if len(diagnostics) > 0 {
@@ -181,8 +190,9 @@ func synthesized(node *shimast.Node) *shimast.Node {
181
190
 
182
191
  // injectOperationMetadataDecorator prepends a synthesized
183
192
  // `@__OperationMetadata.OperationMetadata("<json>")` decorator to a controller
184
- // method. Every site is a method that already carries `@nestia/core`
185
- // decorators, so its modifier list is non-nil and can be mutated in place.
193
+ // method. Site collection visits decorated class methods, including methods
194
+ // outside Nest controllers; their existing modifier lists carry the decorators
195
+ // and can be extended in place. Runtime controller analysis selects routes.
186
196
  func injectOperationMetadataDecorator(
187
197
  factory *shimast.NodeFactory,
188
198
  method *shimast.Node,