@voxgig/sdkgen 1.2.1 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/bin/voxgig-sdkgen +2 -2
  2. package/dist/action/action.d.ts +2 -1
  3. package/dist/action/action.js +15 -9
  4. package/dist/action/action.js.map +1 -1
  5. package/dist/action/feature.js +6 -3
  6. package/dist/action/feature.js.map +1 -1
  7. package/dist/action/target.d.ts +7 -1
  8. package/dist/action/target.js +13 -6
  9. package/dist/action/target.js.map +1 -1
  10. package/dist/cmp/Changelog.d.ts +2 -0
  11. package/dist/cmp/Changelog.js +30 -0
  12. package/dist/cmp/Changelog.js.map +1 -0
  13. package/dist/cmp/Deploy.d.ts +2 -0
  14. package/dist/cmp/Deploy.js +227 -0
  15. package/dist/cmp/Deploy.js.map +1 -0
  16. package/dist/cmp/FeatureHook.js +5 -6
  17. package/dist/cmp/FeatureHook.js.map +1 -1
  18. package/dist/cmp/License.d.ts +2 -0
  19. package/dist/cmp/License.js +44 -0
  20. package/dist/cmp/License.js.map +1 -0
  21. package/dist/cmp/Readme.js +2 -0
  22. package/dist/cmp/Readme.js.map +1 -1
  23. package/dist/cmp/ReadmeErrors.d.ts +2 -0
  24. package/dist/cmp/ReadmeErrors.js +210 -0
  25. package/dist/cmp/ReadmeErrors.js.map +1 -0
  26. package/dist/cmp/ReadmeExplanation.js +213 -223
  27. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  28. package/dist/cmp/ReadmeModel.js +6 -1
  29. package/dist/cmp/ReadmeModel.js.map +1 -1
  30. package/dist/cmp/ReadmeTop.js +389 -82
  31. package/dist/cmp/ReadmeTop.js.map +1 -1
  32. package/dist/cmp/Security.d.ts +2 -0
  33. package/dist/cmp/Security.js +36 -0
  34. package/dist/cmp/Security.js.map +1 -0
  35. package/dist/helpers/canonType.d.ts +7 -0
  36. package/dist/helpers/canonType.js +74 -0
  37. package/dist/helpers/canonType.js.map +1 -0
  38. package/dist/helpers/collectDeps.d.ts +3 -2
  39. package/dist/helpers/collectDeps.js.map +1 -1
  40. package/dist/helpers/naming.d.ts +3 -0
  41. package/dist/helpers/naming.js +51 -0
  42. package/dist/helpers/naming.js.map +1 -0
  43. package/dist/helpers/opExample.d.ts +13 -0
  44. package/dist/helpers/opExample.js +149 -0
  45. package/dist/helpers/opExample.js.map +1 -0
  46. package/dist/helpers/opShape.d.ts +18 -0
  47. package/dist/helpers/opShape.js +193 -0
  48. package/dist/helpers/opShape.js.map +1 -0
  49. package/dist/helpers/packageMeta.d.ts +27 -0
  50. package/dist/helpers/packageMeta.js +224 -0
  51. package/dist/helpers/packageMeta.js.map +1 -0
  52. package/dist/sdkgen.d.ts +11 -1
  53. package/dist/sdkgen.js +57 -18
  54. package/dist/sdkgen.js.map +1 -1
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/dist/types.d.ts +65 -2
  57. package/dist/types.js.map +1 -1
  58. package/dist/utility.js +20 -11
  59. package/dist/utility.js.map +1 -1
  60. package/model/sdkgen.aontu +137 -0
  61. package/package.json +11 -5
  62. package/project/.sdk/model/target/go-cli.jsonic +47 -0
  63. package/project/.sdk/model/target/go-mcp.jsonic +41 -0
  64. package/project/.sdk/model/target/go.jsonic +9 -3
  65. package/project/.sdk/model/target/js.jsonic +13 -0
  66. package/project/.sdk/model/target/lua.jsonic +13 -0
  67. package/project/.sdk/model/target/php.jsonic +13 -0
  68. package/project/.sdk/model/target/py.jsonic +13 -0
  69. package/project/.sdk/model/target/rb.jsonic +13 -0
  70. package/project/.sdk/model/target/ts.jsonic +13 -0
  71. package/project/.sdk/src/cmp/go/EntityOperation_go.ts +1 -0
  72. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +197 -0
  73. package/project/.sdk/src/cmp/go/Entity_go.ts +2 -1
  74. package/project/.sdk/src/cmp/go/MainEntity_go.ts +6 -0
  75. package/project/.sdk/src/cmp/go/Main_go.ts +23 -3
  76. package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
  77. package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +18 -6
  78. package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +684 -0
  79. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
  80. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +48 -8
  81. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +11 -6
  82. package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +40 -1
  83. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +63 -17
  84. package/project/.sdk/src/cmp/go/ReadmeOptions_go.ts +4 -3
  85. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +124 -115
  86. package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +28 -15
  87. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +33 -9
  88. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +35 -5
  89. package/project/.sdk/src/cmp/go/TestEntity_go.ts +1 -1
  90. package/project/.sdk/src/cmp/go/Test_go.ts +5 -1
  91. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +21 -0
  92. package/project/.sdk/src/cmp/go/fragment/EntityCreateOp.fragment.go +11 -0
  93. package/project/.sdk/src/cmp/go/fragment/EntityListOp.fragment.go +11 -0
  94. package/project/.sdk/src/cmp/go/fragment/EntityLoadOp.fragment.go +11 -0
  95. package/project/.sdk/src/cmp/go/fragment/EntityRemoveOp.fragment.go +11 -0
  96. package/project/.sdk/src/cmp/go/fragment/EntityUpdateOp.fragment.go +11 -0
  97. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +195 -0
  98. package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +106 -0
  99. package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +132 -0
  100. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +184 -0
  101. package/project/.sdk/src/cmp/go-mcp/fragment/main.fragment.go +68 -0
  102. package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +114 -0
  103. package/project/.sdk/src/cmp/js/EntityTypes_js.ts +111 -0
  104. package/project/.sdk/src/cmp/js/MainEntity_js.ts +1 -0
  105. package/project/.sdk/src/cmp/js/Main_js.ts +3 -0
  106. package/project/.sdk/src/cmp/js/Package_js.ts +16 -7
  107. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -7
  108. package/project/.sdk/src/cmp/js/ReadmeExplanation_js.ts +2 -2
  109. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +52 -11
  110. package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +39 -1
  111. package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +50 -18
  112. package/project/.sdk/src/cmp/js/ReadmeOptions_js.ts +4 -3
  113. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +45 -19
  114. package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +24 -13
  115. package/project/.sdk/src/cmp/js/ReadmeTopHowto_js.ts +3 -0
  116. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +28 -12
  117. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +23 -3
  118. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +5 -0
  119. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +5 -0
  120. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +5 -0
  121. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +5 -0
  122. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +5 -0
  123. package/project/.sdk/src/cmp/js/utility_js.ts +57 -0
  124. package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +113 -0
  125. package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +8 -0
  126. package/project/.sdk/src/cmp/lua/Main_lua.ts +4 -0
  127. package/project/.sdk/src/cmp/lua/Package_lua.ts +23 -4
  128. package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +12 -10
  129. package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +293 -0
  130. package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +46 -8
  131. package/project/.sdk/src/cmp/lua/ReadmeInstall_lua.ts +19 -3
  132. package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +38 -1
  133. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +51 -16
  134. package/project/.sdk/src/cmp/lua/ReadmeOptions_lua.ts +4 -3
  135. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +79 -18
  136. package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +25 -20
  137. package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +17 -9
  138. package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +32 -5
  139. package/project/.sdk/src/cmp/lua/Test_lua.ts +4 -0
  140. package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +4 -0
  141. package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +4 -0
  142. package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +4 -0
  143. package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +4 -0
  144. package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +4 -0
  145. package/project/.sdk/src/cmp/php/EntityTypes_php.ts +142 -0
  146. package/project/.sdk/src/cmp/php/MainEntity_php.ts +18 -1
  147. package/project/.sdk/src/cmp/php/Main_php.ts +4 -0
  148. package/project/.sdk/src/cmp/php/Package_php.ts +18 -7
  149. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +15 -11
  150. package/project/.sdk/src/cmp/php/ReadmeExamplesTest_php.ts +401 -0
  151. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +56 -13
  152. package/project/.sdk/src/cmp/php/ReadmeInstall_php.ts +15 -3
  153. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +40 -1
  154. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +26 -8
  155. package/project/.sdk/src/cmp/php/ReadmeOptions_php.ts +4 -3
  156. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +80 -22
  157. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +51 -42
  158. package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +1 -1
  159. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +19 -11
  160. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +41 -11
  161. package/project/.sdk/src/cmp/php/TestDirect_php.ts +9 -9
  162. package/project/.sdk/src/cmp/php/TestEntity_php.ts +6 -12
  163. package/project/.sdk/src/cmp/php/Test_php.ts +4 -0
  164. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +13 -1
  165. package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +10 -1
  166. package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +10 -1
  167. package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +10 -1
  168. package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +10 -1
  169. package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +10 -1
  170. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +22 -14
  171. package/project/.sdk/src/cmp/py/EntityTypes_py.ts +184 -0
  172. package/project/.sdk/src/cmp/py/Entity_py.ts +27 -0
  173. package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -1
  174. package/project/.sdk/src/cmp/py/Main_py.ts +35 -0
  175. package/project/.sdk/src/cmp/py/Package_py.ts +24 -3
  176. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +27 -11
  177. package/project/.sdk/src/cmp/py/ReadmeExamplesTest_py.ts +626 -0
  178. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +53 -14
  179. package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +19 -3
  180. package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +48 -1
  181. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +28 -10
  182. package/project/.sdk/src/cmp/py/ReadmeOptions_py.ts +4 -3
  183. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +73 -24
  184. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +57 -37
  185. package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +1 -1
  186. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +19 -11
  187. package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +30 -5
  188. package/project/.sdk/src/cmp/py/TestDirect_py.ts +7 -9
  189. package/project/.sdk/src/cmp/py/TestEntity_py.ts +6 -14
  190. package/project/.sdk/src/cmp/py/Test_py.ts +4 -0
  191. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +5 -2
  192. package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
  193. package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +5 -1
  194. package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +6 -1
  195. package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +6 -1
  196. package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
  197. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +17 -10
  198. package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +136 -0
  199. package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +1 -0
  200. package/project/.sdk/src/cmp/rb/Main_rb.ts +4 -0
  201. package/project/.sdk/src/cmp/rb/Package_rb.ts +34 -7
  202. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +26 -10
  203. package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +289 -0
  204. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +72 -21
  205. package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +16 -4
  206. package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +40 -1
  207. package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +29 -12
  208. package/project/.sdk/src/cmp/rb/ReadmeOptions_rb.ts +4 -3
  209. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +85 -22
  210. package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +56 -37
  211. package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +1 -1
  212. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +19 -11
  213. package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +43 -11
  214. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +9 -9
  215. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +6 -12
  216. package/project/.sdk/src/cmp/rb/Test_rb.ts +4 -0
  217. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +2 -0
  218. package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +5 -0
  219. package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +20 -2
  220. package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +8 -1
  221. package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +6 -1
  222. package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +5 -0
  223. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +24 -8
  224. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +105 -0
  225. package/project/.sdk/src/cmp/ts/Entity_ts.ts +17 -1
  226. package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +1 -0
  227. package/project/.sdk/src/cmp/ts/Main_ts.ts +6 -0
  228. package/project/.sdk/src/cmp/ts/Package_ts.ts +14 -7
  229. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -7
  230. package/project/.sdk/src/cmp/ts/ReadmeExampleTest_ts.ts +81 -0
  231. package/project/.sdk/src/cmp/ts/ReadmeExamplesTest_ts.ts +446 -0
  232. package/project/.sdk/src/cmp/ts/ReadmeExplanation_ts.ts +2 -2
  233. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +57 -11
  234. package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +19 -6
  235. package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +39 -1
  236. package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +50 -18
  237. package/project/.sdk/src/cmp/ts/ReadmeOptions_ts.ts +4 -3
  238. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +95 -40
  239. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +24 -13
  240. package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +3 -0
  241. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +44 -12
  242. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +23 -3
  243. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +2 -2
  244. package/project/.sdk/src/cmp/ts/Test_ts.ts +5 -0
  245. package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +3 -1
  246. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +10 -5
  247. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +4 -2
  248. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +4 -2
  249. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +4 -2
  250. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +4 -2
  251. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +4 -2
  252. package/project/.sdk/src/cmp/ts/utility_ts.ts +59 -0
  253. package/project/.sdk/tm/go/LICENSE +1 -1
  254. package/project/.sdk/tm/go/Makefile +36 -1
  255. package/project/.sdk/tm/go/VERSION +1 -0
  256. package/project/.sdk/tm/go/core/context.go +12 -7
  257. package/project/.sdk/tm/go-cli/src/feature/README.md +6 -0
  258. package/project/.sdk/tm/go-cli/src/feature/base/.gitkeep +0 -0
  259. package/project/.sdk/tm/go-cli/src/feature/log/.gitkeep +0 -0
  260. package/project/.sdk/tm/go-cli/src/feature/test/.gitkeep +0 -0
  261. package/project/.sdk/tm/go-mcp/src/feature/README.md +6 -0
  262. package/project/.sdk/tm/go-mcp/src/feature/base/.gitkeep +0 -0
  263. package/project/.sdk/tm/go-mcp/src/feature/log/.gitkeep +0 -0
  264. package/project/.sdk/tm/go-mcp/src/feature/test/.gitkeep +0 -0
  265. package/project/.sdk/tm/js/LICENSE +1 -1
  266. package/project/.sdk/tm/js/Makefile +41 -0
  267. package/project/.sdk/tm/lua/LICENSE +1 -1
  268. package/project/.sdk/tm/lua/Makefile +40 -1
  269. package/project/.sdk/tm/lua/core/context.lua +13 -8
  270. package/project/.sdk/tm/php/LICENSE +1 -1
  271. package/project/.sdk/tm/php/Makefile +31 -1
  272. package/project/.sdk/tm/php/VERSION +1 -0
  273. package/project/.sdk/tm/php/core/Context.php +12 -6
  274. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +13 -4
  275. package/project/.sdk/tm/php/utility/Done.php +2 -2
  276. package/project/.sdk/tm/php/utility/MakeError.php +3 -3
  277. package/project/.sdk/tm/py/LICENSE +1 -1
  278. package/project/.sdk/tm/py/Makefile +34 -1
  279. package/project/.sdk/tm/py/core/context.py +12 -7
  280. package/project/.sdk/tm/py/test/test_primary_utility.py +15 -4
  281. package/project/.sdk/tm/py/utility/done.py +3 -1
  282. package/project/.sdk/tm/py/utility/make_error.py +2 -2
  283. package/project/.sdk/tm/rb/LICENSE +1 -1
  284. package/project/.sdk/tm/rb/Makefile +33 -1
  285. package/project/.sdk/tm/rb/core/context.rb +8 -3
  286. package/project/.sdk/tm/rb/test/primary_utility_test.rb +2 -2
  287. package/project/.sdk/tm/rb/utility/done.rb +3 -1
  288. package/project/.sdk/tm/rb/utility/make_error.rb +5 -2
  289. package/project/.sdk/tm/ts/LICENSE +1 -1
  290. package/project/.sdk/tm/ts/Makefile +42 -0
  291. package/project/.sdk/tm/ts/src/Context.ts +8 -3
  292. package/src/action/action.ts +17 -10
  293. package/src/action/feature.ts +8 -6
  294. package/src/action/target.ts +17 -8
  295. package/src/cmp/Changelog.ts +34 -0
  296. package/src/cmp/Deploy.ts +258 -0
  297. package/src/cmp/FeatureHook.ts +6 -8
  298. package/src/cmp/License.ts +49 -0
  299. package/src/cmp/Readme.ts +2 -0
  300. package/src/cmp/ReadmeErrors.ts +257 -0
  301. package/src/cmp/ReadmeExplanation.ts +250 -230
  302. package/src/cmp/ReadmeModel.ts +7 -2
  303. package/src/cmp/ReadmeTop.ts +411 -95
  304. package/src/cmp/Security.ts +41 -0
  305. package/src/helpers/canonType.ts +89 -0
  306. package/src/helpers/collectDeps.ts +5 -3
  307. package/src/helpers/naming.ts +59 -0
  308. package/src/helpers/opExample.ts +170 -0
  309. package/src/helpers/opShape.ts +236 -0
  310. package/src/helpers/packageMeta.ts +236 -0
  311. package/src/sdkgen.ts +87 -20
  312. package/src/tsconfig.json +1 -0
  313. package/src/types.ts +85 -2
  314. package/src/utility.ts +22 -11
  315. package/README.md +0 -2
  316. package/dist/action/lang.d.ts +0 -2
  317. package/dist/action/lang.js +0 -68
  318. package/dist/action/lang.js.map +0 -1
  319. package/dist/cmp/Hook.d.ts +0 -2
  320. package/dist/cmp/Hook.js +0 -10
  321. package/dist/cmp/Hook.js.map +0 -1
  322. package/dist/cmp/Top.d.ts +0 -2
  323. package/dist/cmp/Top.js +0 -23
  324. package/dist/cmp/Top.js.map +0 -1
  325. package/dist/prepare-openapi.d.ts +0 -2
  326. package/dist/prepare-openapi.js +0 -37
  327. package/dist/prepare-openapi.js.map +0 -1
  328. package/model/sdkgen.jsonic +0 -74
  329. package/project/.sdk/tm/go/utility/struct/go.mod +0 -3
@@ -8,47 +8,322 @@ import {
8
8
 
9
9
  import { requirePath } from '../utility'
10
10
 
11
+ import { entityPrimaryOp, entityIdField, opRequestShape } from '../helpers/opShape'
12
+ import { canonKey } from '../helpers/canonType'
13
+ import { safeVarName } from '../helpers/naming'
14
+
15
+ import {
16
+ installCommand as pkgInstall,
17
+ packageName,
18
+ registryState,
19
+ vendorCommand,
20
+ apiName,
21
+ nonAffiliation,
22
+ repoInfo,
23
+ SECURITY_EMAIL,
24
+ } from '../helpers/packageMeta'
25
+
26
+
27
+ const SDKGEN_REPO = 'https://github.com/voxgig/sdkgen'
28
+
29
+
30
+ // A type-correct TS example literal for a model field, keyed off its canonical
31
+ // type sentinel — mirrors the per-language `exampleValue`, but inline because
32
+ // this neutral component renders the intro `ts` block directly.
33
+ function tsExampleLiteral(type: any): string {
34
+ const k = canonKey(type)
35
+ if ('INTEGER' === k || 'NUMBER' === k) return '1'
36
+ if ('BOOLEAN' === k) return 'true'
37
+ if ('ARRAY' === k) return '[]'
38
+ if ('OBJECT' === k) return '{}'
39
+ return `'example'`
40
+ }
41
+
42
+
43
+ // Per-language install commands rendered in the top-level "Try it"
44
+ // section. The per-language `ReadmeInstall_<lang>.ts` templates exist
45
+ // but emit extra prose ("Or install from source: ..."); for the
46
+ // landing-page README we want a single copy-paste line per language.
47
+ function installCommand(target: any, model: any): string {
48
+ // Delegate to the single source of truth so the README install command can
49
+ // never drift from the real published package name (see helpers/packageMeta).
50
+ return pkgInstall(model, target.name)
51
+ }
52
+
53
+
54
+ // Pick the language we lead the README with — first entry from the
55
+ // docs-ordered SDK targets. Returns undefined if there are no targets.
56
+ function pickLeadTarget(sdkTargets: any[]): any | undefined {
57
+ return sdkTargets[0]
58
+ }
59
+
11
60
 
12
61
  const ReadmeTop = cmp(function ReadmeTop(props: any) {
13
62
  const { ctx$ } = props
14
63
  const { model } = ctx$
15
64
 
16
- const desc = model.main.def.desc || ''
65
+ // Ensure the Name/NAME case variants exist (apidef usually sets these,
66
+ // but guard so the header never renders "undefined SDK"). Entity/feature
67
+ // names are guarded the same way below.
68
+ if (model.name && !model.Name) names(model, model.name)
69
+
70
+ const info = (model.main && model.main[KIT] && model.main[KIT].info) || {}
71
+ const def = (model.main && model.main.def) || {}
72
+
73
+ // Plain-text title — prefer the OpenAPI `info.title` when it's
74
+ // recognisably the product name (e.g. "Aare.guru API"), fall back
75
+ // to the normalised SDK Name.
76
+ const productName = info.title || `${model.Name} API`
77
+
78
+ const tagline = info.tagline
79
+ || def.tagline
80
+ || `${productName} client, generated from the OpenAPI spec.`
81
+
82
+ const aboutMd = info.about_md || ''
83
+ const licenseMd = info.license_md || ''
84
+ const licenseShort = info.license_short || ''
85
+ const homepage = info.homepage || ''
86
+ const docsUrl = info.docs_url || ''
87
+ const entityDesc = info.entity_desc || {}
88
+
17
89
  const entity = getModelPath(model, `main.${KIT}.entity`)
18
90
  const target = getModelPath(model, `main.${KIT}.target`)
19
91
  const feature = getModelPath(model, `main.${KIT}.feature`)
20
92
 
21
- // Ensure names are computed on entities and features
22
93
  each(entity, (ent: any) => { if (!ent.Name) names(ent, ent.name) })
23
94
  each(feature, (feat: any) => { if (!feat.Name) names(feat, feat.name) })
24
95
 
25
96
  const activeEntities = each(entity).filter((e: any) => e.active !== false)
26
- const activeTargets = each(target)
97
+ const activeTargets = each(target).filter((t: any) => t.active !== false)
98
+
99
+ const hasCli = activeTargets.some((t: any) => t.name === 'go-cli')
100
+ const hasMcp = activeTargets.some((t: any) => t.name === 'go-mcp')
101
+ const hasJsLike = activeTargets.some((t: any) => t.name === 'ts' || t.name === 'js')
102
+
103
+ // Canonical docs order from main.kit.config.docs_order (with a
104
+ // schema-supplied default of ['ts','py','php','go','rb','lua']).
105
+ // Targets present but not listed get appended in spec-defined order,
106
+ // so adding a new target never silently disappears from the docs.
107
+ const docsOrder: string[] = (getModelPath(model, `main.${KIT}.config.docs_order`,
108
+ { only_active: false, required: false }) as any) || []
109
+
110
+ const sdkTargets = activeTargets
111
+ .filter((t: any) => t.name !== 'go-cli' && t.name !== 'go-mcp')
112
+ .slice()
113
+ .sort((a: any, b: any) => {
114
+ const ai = docsOrder.indexOf(a.name)
115
+ const bi = docsOrder.indexOf(b.name)
116
+ const av = ai === -1 ? docsOrder.length : ai
117
+ const bv = bi === -1 ? docsOrder.length : bi
118
+ return av - bv
119
+ })
120
+
121
+ const langList = sdkTargets.map((t: any) => t.title).join(', ')
122
+ const leadTarget = pickLeadTarget(sdkTargets)
27
123
 
28
124
  File({ name: 'README.md' }, () => {
29
125
 
126
+ // 1. H1 + one-line value prop + unofficial / non-affiliation disclosure
30
127
  Content(`# ${model.Name} SDK
31
128
 
32
- ${desc}
129
+ ${tagline}
130
+
131
+ ${nonAffiliation(model)}
33
132
 
34
133
  `)
35
134
 
36
- // Target links
37
- if (activeTargets.length > 0) {
38
- Content(`Available for `)
39
- const links = activeTargets.map((t: any) =>
40
- `[${t.title}](${t.name}/)`
41
- )
42
- Content(`${links.join(' and ')}.
135
+ // Positioning line, only when we actually have multiple SDK targets.
136
+ if (sdkTargets.length > 1) {
137
+ const surfaces = []
138
+ surfaces.push(`${langList} SDKs`)
139
+ if (hasCli) surfaces.push('a CLI')
140
+ if (hasJsLike) surfaces.push('an interactive REPL')
141
+ if (hasMcp) surfaces.push('an MCP server for AI agents')
142
+ const surfaceList = surfaces.length > 1
143
+ ? surfaces.slice(0, -1).join(', ') + ', and ' + surfaces[surfaces.length - 1]
144
+ : surfaces[0]
145
+ Content(`> ${surfaceList} — all generated from one OpenAPI spec by [@voxgig/sdkgen](${SDKGEN_REPO}).
43
146
 
44
147
  `)
45
148
  }
46
149
 
150
+ // 2. About / what the API is
151
+ if (aboutMd) {
152
+ Content(`## About ${productName}
47
153
 
48
- // Entities section
154
+ ${aboutMd.trim()}
155
+
156
+ `)
157
+ } else if (def.desc) {
158
+ Content(`${def.desc}
159
+
160
+ `)
161
+ }
162
+
163
+ // 2b. Entities-first framing: the API surface is a small set of semantic,
164
+ // Capitalised entities — NOT raw URL paths/queries — which is the core
165
+ // mental model the SDK is built around (model-driven; lists real entities).
49
166
  if (activeEntities.length > 0) {
167
+ const entNames = activeEntities.map((e: any) => e.Name)
168
+ const entList = entNames.length > 1
169
+ ? entNames.slice(0, -1).join(', ') + ' and ' + entNames[entNames.length - 1]
170
+ : entNames[0]
171
+ const exEnt = activeEntities[0]
172
+ const ex = exEnt.Name
173
+ const exLower = safeVarName(ex.toLowerCase(), 'ts')
174
+ // The example call uses the entity's PRIMARY op — an op it actually
175
+ // exposes (prefer list -> the array, then load -> the record, else a
176
+ // create with its required fields). A create-only entity therefore never
177
+ // shows a phantom .list()/.load() that would not compile. If it exposes
178
+ // only remove (or nothing), the op line is omitted entirely.
179
+ const primaryOp = entityPrimaryOp(exEnt)
180
+ let exCall = ''
181
+ if ('list' === primaryOp) {
182
+ exCall = `const items = await client.${ex}().list()`
183
+ } else if ('load' === primaryOp) {
184
+ exCall = `const ${exLower} = await client.${ex}().load()`
185
+ } else if ('create' === primaryOp || 'update' === primaryOp) {
186
+ const exIdF = entityIdField(exEnt)
187
+ const shapeItems = opRequestShape(exEnt, primaryOp).items
188
+ .filter((it: any) => it.name !== exIdF && it.name !== 'id')
189
+ const required = shapeItems.filter((it: any) => !it.optional)
190
+ // ALL required fields must appear or the literal is not assignable to
191
+ // the typed CreateData/UpdateData; cap only the optional fallback.
192
+ const chosen = required.length ? required : shapeItems.slice(0, 3)
193
+ const bodyLines = chosen.map((it: any) => ` ${it.name}: ${tsExampleLiteral(it.type)},`)
194
+ const body = bodyLines.length ? `\n${bodyLines.join('\n')}\n` : ''
195
+ exCall = `const ${exLower} = await client.${ex}().${primaryOp}({${body}})`
196
+ }
197
+ // Model-driven op list — only the operations the entities actually expose
198
+ // (advice may be list+load only; never claim create/update/remove exist).
199
+ const CANON_OPS = ['list', 'load', 'create', 'update', 'remove']
200
+ const opSet = new Set<string>()
201
+ activeEntities.forEach((e: any) => Object.keys(e.op || {})
202
+ .forEach((o: string) => { if ((e.op as any)[o] && (e.op as any)[o].active !== false) opSet.add(o) }))
203
+ const opNames = CANON_OPS.filter((o) => opSet.has(o)).concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
204
+ const opList = (opNames.length ? opNames : ['list', 'load']).map((o) => '`' + o + '`').join(', ')
205
+ Content(`## Entities, not endpoints
206
+
207
+ This SDK exposes the API as a small set of **semantic entities** — ${entList} — that you
208
+ call directly, instead of assembling URL paths and query strings. Entities are
209
+ **Capitalised** to mark them as the primary surface, each with the operations they
210
+ support (${opList}):
211
+
212
+ \`\`\`ts
213
+ const client = new ${model.Name}SDK()${exCall ? '\n' + exCall : ''}
214
+ \`\`\`
215
+
216
+ Thinking in entities keeps the mental model small — for people and AI agents alike —
217
+ rather than reasoning about raw HTTP routes and query parameters.
218
+
219
+ `)
220
+ }
221
+
222
+ // 3. Packages — real published package name + install command per
223
+ // ecosystem. A package that is NOT yet live on its registry (the fleet
224
+ // default: 'pending') must NOT advertise a `npm install ...` that 404s —
225
+ // its Install cell links to the git-tag releases page instead. The go
226
+ // family resolves from the tag directly (`go get <mod>@latest`).
227
+ if (sdkTargets.length > 0) {
228
+ const { releasesUrl } = repoInfo(model)
229
+ Content(`## Packages
230
+
231
+ | Language | Package | Install |
232
+ | --- | --- | --- |
233
+ `)
234
+ sdkTargets.forEach((tgt: any) => {
235
+ const state = registryState(model, tgt.name)
236
+ let cell: string
237
+ if ('active' === state) {
238
+ const cmd = installCommand(tgt, model)
239
+ if (!cmd) return
240
+ cell = '`' + cmd + '`'
241
+ } else if ('tag' === state) {
242
+ // Tag-only port (go): the vendor command IS the real install.
243
+ cell = '`' + vendorCommand(model, tgt.name) + '`'
244
+ } else {
245
+ // pending / inactive: point at the git tag, never a 404 command.
246
+ cell = `publish pending — [install from git tag](${releasesUrl})`
247
+ }
248
+ Content(`| ${tgt.title} | \`${packageName(model, tgt.name)}\` | ${cell} |
249
+ `)
250
+ })
251
+ Content(`
252
+ `)
253
+ }
254
+
255
+ // 4. Quickstart in the lead language
256
+ if (leadTarget) {
257
+ Content(`## Quickstart
258
+
259
+ ### ${leadTarget.title}
260
+
261
+ `)
262
+ const LeadQuick =
263
+ requirePath(ctx$, `./cmp/${leadTarget.name}/ReadmeTopQuick_${leadTarget.name}`, { ignore: true })
264
+ if (LeadQuick) {
265
+ LeadQuick['ReadmeTopQuick']({ target: leadTarget })
266
+ }
267
+ Content(`
268
+ See the [${leadTarget.title} README](${leadTarget.name}/README.md) for the full guide.
269
+
270
+ `)
271
+ }
272
+
273
+ // 5. Surface table
274
+ if (sdkTargets.length > 0 || hasCli || hasMcp) {
275
+ Content(`## Surfaces
276
+
277
+ | Surface | Path |
278
+ | --- | --- |
279
+ `)
280
+ if (sdkTargets.length > 0) {
281
+ const paths = sdkTargets.map((t: any) => `\`${t.name}/\``).join(' ')
282
+ Content(`| **SDK** (${langList}) | ${paths} |
283
+ `)
284
+ }
285
+ if (hasCli) {
286
+ Content(`| **CLI** | \`go-cli/\` |
287
+ `)
288
+ }
289
+ if (hasMcp) {
290
+ Content(`| **MCP server** | \`go-mcp/\` |
291
+ `)
292
+ }
50
293
  Content(`
51
- ## Entities
294
+ `)
295
+ }
296
+
297
+ // 6. MCP / agent usage — only if MCP target is enabled
298
+ if (hasMcp) {
299
+ Content(`## Use it from an AI agent (MCP)
300
+
301
+ The generated MCP server exposes every operation in this SDK as an
302
+ [MCP](https://modelcontextprotocol.io) tool that Claude, Cursor or Cline
303
+ can call directly. Build and register it:
304
+
305
+ \`\`\`bash
306
+ cd go-mcp && go build -o ${model.name}-mcp .
307
+ \`\`\`
308
+
309
+ Then add it to your agent's MCP config (Claude Desktop, Cursor, etc.):
310
+
311
+ \`\`\`json
312
+ {
313
+ "mcpServers": {
314
+ "${model.name}": {
315
+ "command": "/abs/path/to/${model.name}-mcp"
316
+ }
317
+ }
318
+ }
319
+ \`\`\`
320
+
321
+ `)
322
+ }
323
+
324
+ // 7. Entities table
325
+ if (activeEntities.length > 0) {
326
+ Content(`## Entities
52
327
 
53
328
  The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.length + ' entities'}:
54
329
 
@@ -57,8 +332,11 @@ The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.le
57
332
  `)
58
333
 
59
334
  activeEntities.map((ent: any) => {
60
- const entdesc = ent.short || ''
61
335
  const ops = ent.op || {}
336
+ const opNames = Object.keys(ops).filter((o: string) => (ops as any)[o]?.active !== false)
337
+ // Never emit a blank description cell: fall back to an ops-derived line.
338
+ const entdesc = entityDesc[ent.name] || ent.short || ent.desc ||
339
+ `The ${ent.Name} entity${opNames.length ? ' (' + opNames.join(', ') + ')' : ''}.`
62
340
  const points = each(ops).map((op: any) =>
63
341
  op.points ? each(op.points) : []
64
342
  ).flat()
@@ -69,140 +347,178 @@ The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.le
69
347
  `)
70
348
  })
71
349
 
350
+ const opUnion = new Set<string>()
351
+ activeEntities.forEach((e: any) => Object.keys(e.op || {})
352
+ .forEach((o: string) => { if ((e.op as any)[o]?.active !== false) opUnion.add(o) }))
353
+ const opAvail = ['load', 'list', 'create', 'update', 'remove'].filter((o) => opUnion.has(o))
354
+ const opBold = (opAvail.length ? opAvail : ['load', 'list']).map((o) => '**' + o + '**').join(', ')
72
355
  Content(`
73
- Each entity supports the following operations where available: **load**, **list**, **create**,
74
- **update**, and **remove**.
356
+ The operations available across these entities are ${opBold} see each entity's
357
+ own list above for exactly which it supports.
75
358
 
76
359
  `)
77
360
  }
78
361
 
362
+ // 8. Quickstart in the other languages (lead is already covered above)
363
+ const otherTargets = sdkTargets.filter((t: any) => leadTarget && t.name !== leadTarget.name)
364
+ if (otherTargets.length > 0) {
365
+ Content(`## Quickstart in other languages
79
366
 
80
- // Architecture section
81
- Content(`
82
- ## Architecture
83
-
84
- ### Entity-operation model
85
-
86
- Every SDK call follows the same pipeline:
87
-
88
- 1. **Point** — resolve the API endpoint from the operation definition.
89
- 2. **Spec** — build the HTTP specification (URL, method, headers, body).
90
- 3. **Request** — send the HTTP request.
91
- 4. **Response** — receive and parse the response.
92
- 5. **Result** — extract the result data for the caller.
367
+ `)
368
+ otherTargets.forEach((tgt: any) => {
369
+ const Quick =
370
+ requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopQuick_${tgt.name}`, { ignore: true })
371
+ if (Quick) {
372
+ Content(`### ${tgt.title}
93
373
 
94
- At each stage a feature hook fires (e.g. \`PrePoint\`, \`PreSpec\`,
95
- \`PreRequest\`), allowing features to inspect or modify the pipeline.
374
+ `)
375
+ Quick['ReadmeTopQuick']({ target: tgt })
376
+ Content(`
377
+ `)
378
+ }
379
+ })
380
+ }
96
381
 
97
- ### Features
382
+ // 9. Testing — keep, but slim
383
+ if (sdkTargets.length > 0) {
384
+ Content(`## Unit testing in offline mode
98
385
 
99
- Features are hook-based middleware that extend SDK behaviour.
386
+ Every SDK ships a test mode that swaps the HTTP transport for an
387
+ in-memory mock, so unit tests run offline.
100
388
 
101
- | Feature | Purpose |
102
- | --- | --- |
103
389
  `)
390
+ sdkTargets.forEach((tgt: any) => {
391
+ const Test =
392
+ requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopTest_${tgt.name}`, { ignore: true })
393
+ if (Test) {
394
+ Content(`### ${tgt.title}
104
395
 
105
- each(feature, (feat: any) => {
106
- if (!feat.active) return
107
- const purpose = feat.title || feat.Name || feat.name
108
- Content(`| **${feat.Name || feat.name}Feature** | ${purpose} |
109
396
  `)
110
- })
111
-
112
- Content(`
113
- You can add custom features by passing them in the \`extend\` option at
114
- construction time.
397
+ Test['ReadmeTopTest']({ target: tgt })
398
+ Content(`
399
+ `)
400
+ }
401
+ })
402
+ }
115
403
 
116
- ### Direct and Prepare
404
+ // 10. Direct and prepare — a common everyday task (the low-level
405
+ // escape hatch for endpoints the entity model doesn't cover).
406
+ Content(`## Direct and prepare
117
407
 
118
- For endpoints not covered by the entity model, use the low-level methods:
408
+ For endpoints the entity model doesn't cover, use the low-level methods:
119
409
 
120
410
  - **\`direct(fetchargs)\`** — build and send an HTTP request in one step.
121
411
  - **\`prepare(fetchargs)\`** — build the request without sending it.
122
412
 
123
- Both accept a map with \`path\`, \`method\`, \`params\`, \`query\`, \`headers\`,
124
- and \`body\`.
413
+ Both accept a map with \`path\`, \`method\`, \`params\`, \`query\`,
414
+ \`headers\`, and \`body\`. See the [How-to guides](#how-to-guides) below.
125
415
 
126
416
  `)
127
417
 
418
+ // 11. How-to guides — keep, useful for the engineer reader
419
+ Content(`## How-to guides
128
420
 
129
- // Quick start section with examples from each target
130
- Content(`
131
- ## Quick start
132
-
133
- `)
134
-
135
- activeTargets.map((tgt: any) => {
136
- const ReadmeTopQuick_sdk =
137
- requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopQuick_${tgt.name}`, { ignore: true })
421
+ ### Make a direct API call
138
422
 
139
- if (ReadmeTopQuick_sdk) {
140
- Content(`### ${tgt.title}
423
+ When the entity interface does not cover an endpoint, use \`direct\`:
141
424
 
142
425
  `)
143
- ReadmeTopQuick_sdk['ReadmeTopQuick']({ target: tgt })
144
- Content(`
145
- `)
426
+
427
+ sdkTargets.forEach((tgt: any) => {
428
+ const Howto =
429
+ requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopHowto_${tgt.name}`, { ignore: true })
430
+ if (Howto) {
431
+ Howto['ReadmeTopHowto']({ target: tgt })
146
432
  }
147
433
  })
148
434
 
435
+ // 11b. Advanced — the pipeline model and feature hooks are internal
436
+ // machinery: useful when extending the SDK, but not part of everyday
437
+ // use, so they live below the task-focused sections above.
438
+ Content(`## Advanced
149
439
 
150
- // Testing section
151
- Content(`
152
- ## Testing
440
+ > Everyday use only needs the sections above. This explains the internals
441
+ > behind every call — relevant when writing custom features.
153
442
 
154
- Both SDKs provide a test mode that replaces the HTTP transport with an
155
- in-memory mock, so tests run without a network connection.
443
+ Every SDK call runs the same five-stage pipeline:
156
444
 
157
- `)
445
+ 1. **Point** — resolve the API endpoint from the operation definition.
446
+ 2. **Spec** — build the HTTP specification (URL, method, headers, body).
447
+ 3. **Request** — send the HTTP request.
448
+ 4. **Response** — receive and parse the response.
449
+ 5. **Result** — extract the result data for the caller.
158
450
 
159
- activeTargets.map((tgt: any) => {
160
- const ReadmeTopTest_sdk =
161
- requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopTest_${tgt.name}`, { ignore: true })
451
+ A feature hook fires at each stage (e.g. \`PrePoint\`, \`PreSpec\`,
452
+ \`PreRequest\`), so features can inspect or modify the pipeline without
453
+ forking the SDK.
162
454
 
163
- if (ReadmeTopTest_sdk) {
164
- Content(`### ${tgt.title}
455
+ ### Features
165
456
 
166
457
  `)
167
- ReadmeTopTest_sdk['ReadmeTopTest']({ target: tgt })
168
- Content(`
458
+
459
+ Content(`| Feature | Purpose |
460
+ | --- | --- |
461
+ `)
462
+ each(feature, (feat: any) => {
463
+ if (!feat.active) return
464
+ const purpose = feat.title || feat.Name || feat.name
465
+ Content(`| **${feat.Name || feat.name}Feature** | ${purpose} |
169
466
  `)
170
- }
171
467
  })
172
468
 
173
-
174
- // How-to guides
175
469
  Content(`
176
- ## How-to guides
470
+ Pass custom features via the \`extend\` option at construction time.
177
471
 
178
- ### Make a direct API call
472
+ `)
179
473
 
180
- When the entity interface does not cover an endpoint, use \`direct\`:
474
+ // 12. Per-language docs links
475
+ if (sdkTargets.length > 0) {
476
+ Content(`## Per-language documentation
181
477
 
182
478
  `)
479
+ sdkTargets.forEach((tgt: any) => {
480
+ Content(`- [${tgt.title}](${tgt.name}/README.md)
481
+ `)
482
+ })
483
+ Content(`
484
+ `)
485
+ }
183
486
 
184
- activeTargets.map((tgt: any) => {
185
- const ReadmeTopHowto_sdk =
186
- requirePath(ctx$, `./cmp/${tgt.name}/ReadmeTopHowto_${tgt.name}`, { ignore: true })
487
+ // 13. Upstream API — contact/servers from the OpenAPI info block
488
+ const upstreamUrl = (info.contact && info.contact.url)
489
+ || (info.servers && info.servers[0] && info.servers[0].url)
490
+ || homepage
491
+ if (upstreamUrl || docsUrl) {
492
+ Content(`## Upstream API
187
493
 
188
- if (ReadmeTopHowto_sdk) {
189
- ReadmeTopHowto_sdk['ReadmeTopHowto']({ target: tgt })
494
+ This SDK is generated from the upstream OpenAPI specification. It is an
495
+ unofficial client and is not affiliated with the API provider.
496
+
497
+ `)
498
+ if (upstreamUrl) {
499
+ Content(`- Upstream API: [${upstreamUrl}](${upstreamUrl})
500
+ `)
190
501
  }
191
- })
502
+ if (docsUrl && docsUrl !== upstreamUrl) {
503
+ Content(`- Documentation: [${docsUrl}](${docsUrl})
504
+ `)
505
+ }
506
+ Content(`
507
+ `)
508
+ }
192
509
 
510
+ // 13b. Security
511
+ Content(`## Security
193
512
 
194
- // Language-specific links
195
- Content(`
196
- ## Language-specific documentation
513
+ Please report security issues to ${SECURITY_EMAIL}. See [SECURITY.md](SECURITY.md).
514
+ Do not open public issues for suspected vulnerabilities.
197
515
 
198
516
  `)
199
517
 
200
- activeTargets.map((tgt: any) => {
201
- Content(`- [${tgt.title} SDK](${tgt.name}/README.md)
202
- `)
203
- })
518
+ // 14. Provenance footer
519
+ Content(`---
204
520
 
205
- Content(`
521
+ Generated from the ${productName} OpenAPI spec by [@voxgig/sdkgen](${SDKGEN_REPO}).
206
522
  `)
207
523
  })
208
524
  })
@@ -0,0 +1,41 @@
1
+ import { cmp, Content, File } from 'jostraca'
2
+
3
+ import { SECURITY_EMAIL, apiName, repoInfo } from '../helpers/packageMeta'
4
+
5
+
6
+ // Root SECURITY.md: a responsible-disclosure policy pointing at the Voxgig
7
+ // security contact, with the generated / unofficial disclosure inline.
8
+ const Security = cmp(function Security(props: any) {
9
+ const { ctx$ } = props
10
+ const { model } = ctx$
11
+
12
+ const { issuesUrl } = repoInfo(model)
13
+
14
+ File({ name: 'SECURITY.md' }, () => {
15
+ Content(`# Security Policy
16
+
17
+ ## Reporting a vulnerability
18
+
19
+ Please report security issues to ${SECURITY_EMAIL}.
20
+
21
+ Do not open public GitHub issues for suspected vulnerabilities. We aim to
22
+ acknowledge reports within 3 business days.
23
+
24
+ For non-security bugs, use the issue tracker: ${issuesUrl}
25
+
26
+ ## Scope
27
+
28
+ This policy applies to the generated Voxgig SDK packages published from this
29
+ repository (npm, PyPI, Packagist, RubyGems, LuaRocks, and the Go module).
30
+
31
+ This is an unofficial SDK for the ${apiName(model)} public API, generated by
32
+ Voxgig. It is not affiliated with, endorsed by, or sponsored by the upstream
33
+ API provider.
34
+ `)
35
+ })
36
+ })
37
+
38
+
39
+ export {
40
+ Security
41
+ }