@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
@@ -4,6 +4,9 @@ import {
4
4
  File,
5
5
  cmp,
6
6
  collectDeps,
7
+ pkgDescription,
8
+ keywords,
9
+ repoInfo,
7
10
  } from '@voxgig/sdkgen'
8
11
 
9
12
 
@@ -24,23 +27,39 @@ const Package = cmp(async function Package(props: any) {
24
27
  const ns = model.origin || 'voxgig-sdk'
25
28
  const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
26
29
  const rockName = `${ns}-${pkgBase}`
30
+ const { repoUrl, issuesUrl } = repoInfo(model)
31
+ const labels = keywords(model).map((k) => `"${k}"`).join(', ')
32
+
33
+ // Single source for the version so the rockspec version and the source.tag
34
+ // (which `make publish` pushes as lua/v<rockVersion>) can never drift apart.
35
+ const rockVersion = '0.0.1'
27
36
 
28
37
  File({ name: model.name + '.rockspec' }, () => {
29
38
  Content(`package = "${rockName}"
30
- version = "0.0-1"
39
+ version = "${rockVersion}-1"
31
40
  source = {
32
- url = "git://github.com/${ns}/${model.name}-sdk.git"
41
+ -- git+https (GitHub dropped git:// in 2022); pin the install to the release
42
+ -- tag pushed by \`make publish\`, and point at the lua/ subdir of the monorepo.
43
+ url = "git+https://github.com/${ns}/${model.name}-sdk.git",
44
+ tag = "lua/v${rockVersion}",
45
+ dir = "${model.name}-sdk/lua"
33
46
  }
34
47
  description = {
35
- summary = "${model.const.Name} SDK for Lua",
36
- license = "MIT"
48
+ summary = "${pkgDescription(model, 'lua')}",
49
+ homepage = "${repoUrl}",
50
+ issues_url = "${issuesUrl}",
51
+ license = "MIT",
52
+ labels = { ${labels} }
37
53
  }
38
54
  dependencies = {
39
55
  "lua >= 5.3",
40
56
  "dkjson >= 2.5",
41
57
  `)
42
58
 
59
+ const seen = new Set<string>(['lua', 'dkjson'])
43
60
  for (const d of collectDeps(model, target.name, target.deps)) {
61
+ if (seen.has(d.name)) continue
62
+ seen.add(d.name)
44
63
  const v = d.source === 'target' ? (d.version || '0.0') : d.version
45
64
  Content(` "${d.name} >= ${v}",
46
65
  `)
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, entityIdField } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -41,6 +41,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
41
41
  publishedEntities.map((entity: any) => {
42
42
  const opnames = Object.keys(entity.op || {})
43
43
  const fields = entity.fields || []
44
+ // Model-driven id key: null when this entity has no id-like field.
45
+ const idF = entityIdField(entity)
44
46
 
45
47
  Content(`
46
48
  ### ${entity.Name}
@@ -53,7 +55,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
53
55
  `)
54
56
  }
55
57
 
56
- Content(`Create an instance: \`const ${entity.name} = client.${entity.Name}()\`
58
+ Content(`Create an instance: \`local ${entity.name} = client:${entity.Name}(nil)\`
57
59
 
58
60
  `)
59
61
 
@@ -84,7 +86,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
84
86
 
85
87
  each(fields, (field: any) => {
86
88
  const desc = field.short || ''
87
- Content(`| \`${field.name}\` | \`${field.type || 'any'}\` | ${desc} |
89
+ Content(`| \`${field.name}\` | \`${canonToType(field.type, target.name)}\` | ${desc} |
88
90
  `)
89
91
  })
90
92
 
@@ -95,8 +97,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
95
97
  if (opnames.includes('load')) {
96
98
  Content(`#### Example: Load
97
99
 
98
- \`\`\`ts
99
- const ${entity.name} = await client.${entity.Name}().load({ id: '${entity.name}_id' })
100
+ \`\`\`lua
101
+ local ${entity.name}, err = client:${entity.Name}():load(${idF ? `{ ${idF} = "${entity.name}_id" }` : ''})
100
102
  \`\`\`
101
103
 
102
104
  `)
@@ -105,8 +107,8 @@ const ${entity.name} = await client.${entity.Name}().load({ id: '${entity.name}_
105
107
  if (opnames.includes('list')) {
106
108
  Content(`#### Example: List
107
109
 
108
- \`\`\`ts
109
- const ${entity.name}s = await client.${entity.Name}().list()
110
+ \`\`\`lua
111
+ local ${entity.name}s, err = client:${entity.Name}():list()
110
112
  \`\`\`
111
113
 
112
114
  `)
@@ -115,12 +117,12 @@ const ${entity.name}s = await client.${entity.Name}().list()
115
117
  if (opnames.includes('create')) {
116
118
  Content(`#### Example: Create
117
119
 
118
- \`\`\`ts
119
- const ${entity.name} = await client.${entity.Name}().create({
120
+ \`\`\`lua
121
+ local ${entity.name}, err = client:${entity.Name}():create({
120
122
  `)
121
123
  each(fields, (field: any) => {
122
124
  if ('id' !== field.name && field.req) {
123
- Content(` ${field.name}: /* ${field.type || 'value'} */,
125
+ Content(` ${field.name} = nil, -- ${canonToType(field.type, target.name)}
124
126
  `)
125
127
  }
126
128
  })
@@ -0,0 +1,293 @@
1
+ import { cmp, Content, File } from '@voxgig/sdkgen'
2
+
3
+ import {
4
+ KIT,
5
+ getModelPath,
6
+ } from '@voxgig/apidef'
7
+
8
+
9
+ // Emits lua/test/readme_examples_test.lua — a busted spec that is a
10
+ // COMPLETENESS GATE over every ```lua block in ALL THREE docs that ship
11
+ // lua examples:
12
+ // - the root README.md (top-level, multi-language quick start)
13
+ // - the per-language lua/README.md
14
+ // - the per-language lua/REFERENCE.md
15
+ //
16
+ // For every ```lua block, tagged by (source doc, index):
17
+ // 1. Syntax: it must compile with Lua's load() — catches malformed
18
+ // example code (missing end, bad token, ...).
19
+ // 2. Offline run: every RUNNABLE block (one that builds a client via
20
+ // sdk.new/sdk.test or references `client`) is EXECUTED with the mock
21
+ // transport (no network). Each client constructor is rewritten to the
22
+ // seeded test-mode form, and fragments that only use `client` get a
23
+ // seeded test client injected. A call to a method that does not exist
24
+ // — e.g. a lowercase entity accessor after the API capitalised it to
25
+ // client:Entity() — raises "call a nil value" and FAILS the test.
26
+ // Entity operations return a (value, err) tuple, so a seeded-fixture
27
+ // miss surfaces as a tolerated (nil, err) not-found domain error.
28
+ // 3. Completeness: every block is partitioned into {executed, illustration}
29
+ // and total == executed + illustration is asserted per doc. A block that
30
+ // is neither runnable nor a NARROW explicit illustration (a comment-only
31
+ // / --[[ ]] placeholder) is a silently-untested example and FAILS the
32
+ // gate — "illustration" is never a catch-all.
33
+ const ReadmeExamplesTest = cmp(function ReadmeExamplesTest(props: any) {
34
+ const { ctx$: { model } } = props
35
+
36
+ // Every active entity, keyed by its model name, is seeded with a `test01`
37
+ // fixture whose id is `test01` — so a load({ id = "test01" }) in a doc
38
+ // resolves offline. Bracket-string keys keep the literal valid for any
39
+ // entity name.
40
+ const entity = getModelPath(model, `main.${KIT}.entity`) || {}
41
+ const entnames = Object.values(entity)
42
+ .filter((e: any) => e && e.active !== false)
43
+ .map((e: any) => e.name)
44
+
45
+ const seedEntries = entnames
46
+ .map((n: string) => `["${n}"] = { ["test01"] = { id = "test01" } }`)
47
+ .join(', ')
48
+ const seedLiteral = `{ entity = { ${seedEntries} } }`
49
+
50
+ File({ name: 'readme_examples_test.lua' }, () => {
51
+ Content(`-- README lua example snippets check. Generated by @voxgig/sdkgen.
52
+ --
53
+ -- COMPLETENESS GATE over every \`\`\`lua block in all three docs that ship
54
+ -- lua examples: the root README.md, the lua/README.md, and the
55
+ -- lua/REFERENCE.md. For every block:
56
+ -- 1. Syntax: each block must compile with Lua's load().
57
+ -- 2. Offline run: every runnable block (one that builds a client or
58
+ -- references \`client\`) is EXECUTED with the mock transport (no
59
+ -- network). Each client constructor is rewritten to the seeded
60
+ -- test-mode form, and fragments that only use \`client\` get a seeded
61
+ -- test client injected. A call to a method that does not exist raises
62
+ -- "call a nil value" and FAILS the test. A seeded-fixture miss surfaces
63
+ -- as a tolerated (nil, err) not-found domain error, not a raised error.
64
+ -- 3. Completeness: total == executed + illustration per doc. A block that
65
+ -- is neither runnable nor an explicit comment-only placeholder FAILS
66
+ -- the gate, so no runnable example can be silently skipped.
67
+
68
+ local SDK_MODULE = "${model.name}_sdk"
69
+
70
+ -- A test-mode client seeded with a fixture for every entity. The constructor
71
+ -- of each runnable snippet is rewritten to this form so the offline mock has
72
+ -- data to return.
73
+ local TEST_SEED = '${seedLiteral}'
74
+ local TEST_CTOR = "sdk.test(" .. TEST_SEED .. ")"
75
+
76
+ local function script_dir()
77
+ local src = debug.getinfo(1, "S").source
78
+ local path = src:sub(1, 1) == "@" and src:sub(2) or src
79
+ return path:match("^(.*)[/\\\\][^/\\\\]*$") or "."
80
+ end
81
+
82
+ -- Read a doc by its path relative to this test file's directory (which is
83
+ -- <repo>/lua/test). The root README is two levels up; the lua docs are one.
84
+ local function read_doc(relpath)
85
+ local dir = script_dir()
86
+ local candidates = {
87
+ dir .. "/" .. relpath,
88
+ relpath,
89
+ }
90
+ for _, p in ipairs(candidates) do
91
+ local f = io.open(p, "r")
92
+ if f then
93
+ local data = f:read("*a")
94
+ f:close()
95
+ return data, p
96
+ end
97
+ end
98
+ return nil
99
+ end
100
+
101
+ local function trim(s)
102
+ return (s:gsub("^%s+", ""):gsub("%s+$", ""))
103
+ end
104
+
105
+ local function extract_blocks(md, lang)
106
+ local blocks = {}
107
+ local open = "\`\`\`" .. lang
108
+ local in_block = false
109
+ local cur = {}
110
+ for line in (md .. "\\n"):gmatch("([^\\n]*)\\n") do
111
+ local t = trim(line)
112
+ if not in_block then
113
+ if t == open then
114
+ in_block = true
115
+ cur = {}
116
+ end
117
+ else
118
+ if t == "\`\`\`" then
119
+ table.insert(blocks, table.concat(cur, "\\n"))
120
+ in_block = false
121
+ else
122
+ table.insert(cur, line)
123
+ end
124
+ end
125
+ end
126
+ return blocks
127
+ end
128
+
129
+ -- A block is runnable if it builds a client (sdk.new / sdk.test) or uses one
130
+ -- (references \`client\`). These are the blocks we EXECUTE offline.
131
+ local function is_runnable(block)
132
+ return block:find("sdk%s*%.%s*new") ~= nil
133
+ or block:find("sdk%s*%.%s*test") ~= nil
134
+ or block:find("client") ~= nil
135
+ end
136
+
137
+ -- NARROW illustration class:
138
+ -- - a comment-only block (nothing remains after stripping lua comments), or
139
+ -- - a --[[ ]] value-slot placeholder template (e.g. field = --[[ type ]]):
140
+ -- the placeholder stands in for a value, so the block does not parse.
141
+ -- Everything else must be runnable and is executed; a non-runnable,
142
+ -- non-illustration block is a silently-untested example and fails the
143
+ -- completeness gate.
144
+ local function is_illustration(block)
145
+ local stripped = block:gsub("%-%-%[%[.-%]%]", "") -- block comments
146
+ stripped = stripped:gsub("%-%-[^\\n]*", "") -- line comments
147
+ if trim(stripped) == "" then
148
+ return true
149
+ end
150
+ if block:find("%-%-%[%[") and load(block) == nil then
151
+ return true
152
+ end
153
+ return false
154
+ end
155
+
156
+ -- Transform a README block into an executable offline snippet: rewrite any
157
+ -- client constructor to the seeded test-mode form, inject a seeded client for
158
+ -- bare fragments, and ensure \`sdk\` is in scope.
159
+ local function make_runnable(block)
160
+ local src = block
161
+
162
+ local constructs = block:find("sdk%s*%.%s*new") ~= nil
163
+ or block:find("sdk%s*%.%s*test") ~= nil
164
+
165
+ if constructs then
166
+ -- %b() matches a balanced ( ... ) argument list, so nested tables/parens
167
+ -- in the original constructor call are replaced wholesale.
168
+ src = src:gsub("sdk%s*%.%s*new%s*%b()", function() return TEST_CTOR end)
169
+ src = src:gsub("sdk%s*%.%s*test%s*%b()", function() return TEST_CTOR end)
170
+ end
171
+
172
+ local prelude = {}
173
+ if not src:find("require%s*%(") then
174
+ table.insert(prelude, 'local sdk = require("' .. SDK_MODULE .. '")')
175
+ end
176
+ if not constructs and src:find("client") then
177
+ table.insert(prelude, "local client = " .. TEST_CTOR)
178
+ end
179
+
180
+ if #prelude > 0 then
181
+ src = table.concat(prelude, "\\n") .. "\\n" .. src
182
+ end
183
+ return src
184
+ end
185
+
186
+ -- All three docs are checked identically. relpath is resolved against this
187
+ -- test file's directory (<repo>/lua/test).
188
+ local DOCS = {
189
+ { label = "root README", relpath = "../../README.md" },
190
+ { label = "lua/README", relpath = "../README.md" },
191
+ { label = "lua/REFERENCE", relpath = "../REFERENCE.md" },
192
+ }
193
+
194
+ for _, doc in ipairs(DOCS) do
195
+ describe("lua doc examples (" .. doc.label .. ")", function()
196
+ local md = read_doc(doc.relpath)
197
+
198
+ it(doc.label .. " is present", function()
199
+ assert.is_not_nil(md, "could not read " .. doc.label ..
200
+ " (" .. doc.relpath .. ")")
201
+ end)
202
+
203
+ if not md then
204
+ return
205
+ end
206
+
207
+ local blocks = extract_blocks(md, "lua")
208
+
209
+ it(doc.label .. " has lua example blocks", function()
210
+ assert.is_true(#blocks > 0, "no lua code blocks found in " .. doc.label)
211
+ end)
212
+
213
+ it(doc.label .. ": every lua block is syntactically valid", function()
214
+ for i, block in ipairs(blocks) do
215
+ -- Illustration placeholders (--[[ type ]] templates) intentionally do
216
+ -- not parse; every other block must.
217
+ if not is_illustration(block) then
218
+ local chunk, err = load(block, "=" .. doc.label .. "-lua-" .. i)
219
+ assert.is_not_nil(chunk,
220
+ doc.label .. " lua block #" .. i .. " has a syntax error: " ..
221
+ tostring(err) .. "\\n----\\n" .. block .. "\\n----")
222
+ end
223
+ end
224
+ end)
225
+
226
+ it(doc.label .. ": every runnable lua block runs offline in test mode",
227
+ function()
228
+ local ran = 0
229
+ for i, block in ipairs(blocks) do
230
+ if is_runnable(block) and not is_illustration(block) then
231
+ local src = make_runnable(block)
232
+ local chunk, err = load(src, "=" .. doc.label .. "-run-" .. i)
233
+ assert.is_not_nil(chunk,
234
+ doc.label .. " runnable block #" .. i .. " failed to compile: " ..
235
+ tostring(err) .. "\\n----\\n" .. src .. "\\n----")
236
+ local ok, e = pcall(chunk)
237
+ if not ok then
238
+ local msg = tostring(e)
239
+ -- A nil accessor / missing method / bad index is a real doc bug:
240
+ -- the documented call does not exist.
241
+ if msg:find("nil value") or msg:find("attempt to call")
242
+ or msg:find("attempt to index") then
243
+ assert.is_true(false,
244
+ doc.label .. " runnable block #" .. i .. " hit a runtime " ..
245
+ "error (missing method / nil call): " .. msg ..
246
+ "\\n----\\n" .. src .. "\\n----")
247
+ end
248
+ -- Other runtime errors (a seeded-fixture miss surfaces as a
249
+ -- tolerated not-found domain error, e.g. "request: 404") are
250
+ -- expected offline and tolerated.
251
+ end
252
+ ran = ran + 1
253
+ end
254
+ end
255
+ assert.is_true(ran > 0,
256
+ "expected at least one runnable lua block in " .. doc.label)
257
+ end)
258
+
259
+ it(doc.label .. ": every lua block is executed or an explicit " ..
260
+ "illustration (completeness)", function()
261
+ local executed, illustration = 0, 0
262
+ local unclassified = {}
263
+ for i, block in ipairs(blocks) do
264
+ if is_illustration(block) then
265
+ illustration = illustration + 1
266
+ elseif is_runnable(block) then
267
+ executed = executed + 1
268
+ else
269
+ table.insert(unclassified, i)
270
+ end
271
+ end
272
+ assert.is_true(#unclassified == 0,
273
+ doc.label .. " has lua block(s) that are neither runnable nor a " ..
274
+ "recognized illustration and would be silently untested: #" ..
275
+ table.concat(unclassified, ", #"))
276
+ assert.are.equal(#blocks, executed + illustration,
277
+ doc.label .. " completeness: total " .. #blocks ..
278
+ " != executed " .. executed .. " + illustration " .. illustration)
279
+ print(string.format(
280
+ "[readme-lua] %s: total=%d executed=%d illustration=%d",
281
+ doc.label, #blocks, executed, illustration))
282
+ end)
283
+ end)
284
+ end
285
+ `)
286
+ })
287
+
288
+ })
289
+
290
+
291
+ export {
292
+ ReadmeExamplesTest
293
+ }
@@ -1,12 +1,52 @@
1
1
 
2
- import { cmp, Content, isAuthActive } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, entityPrimaryOp, opRequestShape } from '@voxgig/sdkgen'
3
+
4
+ import {
5
+ KIT,
6
+ getModelPath,
7
+ nom,
8
+ } from '@voxgig/apidef'
9
+
10
+
11
+ // A type-correct Lua literal for a field's canonical type.
12
+ function luaLit(type: any): string {
13
+ const k = canonKey(type)
14
+ if ('INTEGER' === k || 'NUMBER' === k) return '1'
15
+ if ('BOOLEAN' === k) return 'true'
16
+ if ('ARRAY' === k || 'OBJECT' === k) return '{}'
17
+ return '"example"'
18
+ }
19
+
20
+ function luaKey(name: string): string {
21
+ return /^[A-Za-z_]\w*$/.test(name) ? name : `["${name}"]`
22
+ }
3
23
 
4
24
 
5
25
  const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
6
26
  const { target, ctx$: { model } } = props
7
27
 
28
+ const entity = getModelPath(model, `main.${KIT}.entity`)
29
+ const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
30
+ const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
31
+ // Model-driven id key: null when the entity has no id-like field.
32
+ const idF = exampleEntity ? entityIdField(exampleEntity) : null
33
+ // Drive the test-mode example off the entity's PRIMARY op — never a hardcoded
34
+ // `load` a create-only entity lacks.
35
+ const primaryOp = exampleEntity ? (entityPrimaryOp(exampleEntity) || 'load') : 'load'
36
+ const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
37
+ let testCallArg = ''
38
+ if (exampleEntity && isMatchOp) {
39
+ testCallArg = idF ? `{ ${idF} = "test01" }` : ''
40
+ } else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp)) {
41
+ const items = opRequestShape(exampleEntity, primaryOp).items
42
+ .filter((it: any) => it.name !== idF && it.name !== 'id')
43
+ const required = items.filter((it: any) => !it.optional)
44
+ const chosen = required.length ? required : items.slice(0, 3)
45
+ testCallArg = `{ ${chosen.map((it: any) => `${luaKey(it.name)} = ${luaLit(it.type)}`).join(', ')} }`
46
+ }
47
+
8
48
  const apikeyEnvLine = isAuthActive(model)
9
- ? `\n${model.NAME}_APIKEY=<your-key>`
49
+ ? `\n${envName(model)}_APIKEY=<your-key>`
10
50
  : ''
11
51
 
12
52
  Content(`### Make a direct HTTP request
@@ -47,12 +87,10 @@ print(fetchdef["headers"])
47
87
  Create a mock client for unit testing — no server required:
48
88
 
49
89
  \`\`\`lua
50
- local client = sdk.test(nil, nil)
90
+ local client = sdk.test()
51
91
 
52
- local result, err = client:${model.const.Name}(nil):load(
53
- { id = "test01" }, nil
54
- )
55
- -- result contains mock response data
92
+ local result, err = client:${eName}():${primaryOp}(${testCallArg})
93
+ -- result is the returned data; err is set on failure
56
94
  \`\`\`
57
95
 
58
96
  ### Use a custom fetch function
@@ -84,7 +122,7 @@ local client = sdk.new({
84
122
  Create a \`.env.local\` file at the project root:
85
123
 
86
124
  \`\`\`
87
- ${model.NAME}_TEST_LIVE=TRUE${apikeyEnvLine}
125
+ ${envName(model)}_TEST_LIVE=TRUE${apikeyEnvLine}
88
126
  \`\`\`
89
127
 
90
128
  Then run:
@@ -1,13 +1,14 @@
1
1
 
2
- import { cmp, Content } from '@voxgig/sdkgen'
2
+ import { cmp, Content, installCommand, isPublished, repoInfo } from '@voxgig/sdkgen'
3
3
 
4
4
 
5
5
  const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
6
6
  const { target, ctx$ } = props
7
7
  const { model } = ctx$
8
8
 
9
- Content(`\`\`\`bash
10
- luarocks install ${model.name}-sdk
9
+ if (isPublished(model, target.name)) {
10
+ Content(`\`\`\`bash
11
+ ${installCommand(model, target.name)}
11
12
  \`\`\`
12
13
 
13
14
  If the module is not yet published, add the source directory to
@@ -17,6 +18,21 @@ your \`LUA_PATH\`:
17
18
  export LUA_PATH="path/to/lua/?.lua;path/to/lua/?/init.lua;;"
18
19
  \`\`\`
19
20
 
21
+ `)
22
+ return
23
+ }
24
+
25
+ // Publish pending: not yet on LuaRocks. Install from the git release tag,
26
+ // or add the source directory to LUA_PATH.
27
+ const { releasesUrl } = repoInfo(model)
28
+ Content(`This package is not yet published to LuaRocks. Install it from the
29
+ GitHub release tag (\`${target.name}/vX.Y.Z\`, see [Releases](${releasesUrl})),
30
+ or add the source directory to your \`LUA_PATH\`:
31
+
32
+ \`\`\`bash
33
+ export LUA_PATH="path/to/lua/?.lua;path/to/lua/?/init.lua;;"
34
+ \`\`\`
35
+
20
36
  `)
21
37
  })
22
38
 
@@ -1,13 +1,50 @@
1
1
 
2
2
  import { cmp, Content } from '@voxgig/sdkgen'
3
3
 
4
+ import {
5
+ KIT,
6
+ getModelPath,
7
+ nom,
8
+ } from '@voxgig/apidef'
9
+
4
10
 
5
11
  const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
6
12
  const { target, ctx$: { model } } = props
13
+ const info = (model.main && model.main.kit && model.main.kit.info) || {}
14
+ const tagline = info.tagline || ''
15
+
16
+ // Derive a real entity accessor from the model for the semantic-entity
17
+ // note (fall back to a generic name if the model has no entities).
18
+ const entity = getModelPath(model, `main.${KIT}.entity`) || {}
19
+ const exampleEntity = Object.values(entity).find((e: any) => e && e.active !== false) as any
20
+ const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
21
+
22
+ // Model-driven op list — only the operations the active entities actually
23
+ // expose (a read-only entity has just list+load); never claim
24
+ // create/update/remove exist when no entity has them.
25
+ const CANON_OPS = ['list', 'load', 'create', 'update', 'remove']
26
+ const opSet = new Set<string>()
27
+ Object.values(entity || {}).forEach((e: any) => {
28
+ if (!e || e.active === false) return
29
+ Object.keys(e.op || {}).forEach((o: string) => {
30
+ if (e.op[o] && e.op[o].active !== false) opSet.add(o)
31
+ })
32
+ })
33
+ const opNames = CANON_OPS.filter((o) => opSet.has(o))
34
+ .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
35
+ const opList = (opNames.length ? opNames : ['list', 'load'])
36
+ .map((o) => '`' + o + '`').join(', ')
7
37
 
8
38
  Content(`# ${model.Name} ${target.title} SDK
9
39
 
10
- The ${target.title} SDK for the ${model.Name} API. Provides an entity-oriented interface using Lua conventions.
40
+ ${tagline}
41
+
42
+ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using Lua conventions.
43
+
44
+ It exposes the API as capitalised, semantic **Entities** — e.g. \`client:${eName}()\` — each with the same small set of operations (${opList}) instead of raw URL paths and query strings. You call meaning, not endpoints, which keeps the cognitive load low.
45
+
46
+ > Other languages, the CLI, and MCP server live alongside this one — see
47
+ > the [top-level README](../README.md).
11
48
 
12
49
  `)
13
50
  })