@voxgig/sdkgen 0.35.2 → 0.36.0

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 (385) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/Readme.js +5 -5
  3. package/dist/cmp/Readme.js.map +1 -1
  4. package/dist/cmp/ReadmeEntity.js +74 -24
  5. package/dist/cmp/ReadmeEntity.js.map +1 -1
  6. package/dist/cmp/ReadmeExplanation.d.ts +2 -0
  7. package/dist/cmp/ReadmeExplanation.js +308 -0
  8. package/dist/cmp/ReadmeExplanation.js.map +1 -0
  9. package/dist/cmp/ReadmeHowto.d.ts +2 -0
  10. package/dist/cmp/ReadmeHowto.js +18 -0
  11. package/dist/cmp/ReadmeHowto.js.map +1 -0
  12. package/dist/cmp/ReadmeIntro.js +8 -23
  13. package/dist/cmp/ReadmeIntro.js.map +1 -1
  14. package/dist/cmp/ReadmeModel.js +55 -91
  15. package/dist/cmp/ReadmeModel.js.map +1 -1
  16. package/dist/cmp/ReadmeOptions.js +35 -11
  17. package/dist/cmp/ReadmeOptions.js.map +1 -1
  18. package/dist/cmp/ReadmeQuick.js +4 -1
  19. package/dist/cmp/ReadmeQuick.js.map +1 -1
  20. package/dist/cmp/ReadmeRef.js +1042 -40
  21. package/dist/cmp/ReadmeRef.js.map +1 -1
  22. package/dist/cmp/ReadmeTop.d.ts +2 -0
  23. package/dist/cmp/ReadmeTop.js +171 -0
  24. package/dist/cmp/ReadmeTop.js.map +1 -0
  25. package/dist/sdkgen.d.ts +7 -1
  26. package/dist/sdkgen.js +13 -1
  27. package/dist/sdkgen.js.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +2 -2
  30. package/project/.sdk/model/feature/feature-index.jsonic +5 -0
  31. package/project/.sdk/model/feature/log.jsonic +5 -1
  32. package/project/.sdk/model/feature/test.jsonic +1 -1
  33. package/project/.sdk/model/target/lua.jsonic +23 -0
  34. package/project/.sdk/model/target/php.jsonic +22 -0
  35. package/project/.sdk/model/target/py.jsonic +23 -0
  36. package/project/.sdk/model/target/rb.jsonic +23 -0
  37. package/project/.sdk/src/cmp/go/Main_go.ts +2 -6
  38. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +42 -0
  39. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +112 -0
  40. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +29 -0
  41. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +129 -0
  42. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +163 -0
  43. package/project/.sdk/src/cmp/go/ReadmeTopHowto_go.ts +24 -0
  44. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +67 -0
  45. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +40 -0
  46. package/project/.sdk/src/cmp/go/TestDirect_go.ts +46 -2
  47. package/project/.sdk/src/cmp/go/TestEntity_go.ts +360 -160
  48. package/project/.sdk/src/cmp/go/Test_go.ts +24 -1
  49. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +1 -1
  50. package/project/.sdk/src/cmp/lua/Config_lua.ts +112 -0
  51. package/project/.sdk/src/cmp/lua/EntityOperation_lua.ts +44 -0
  52. package/project/.sdk/src/cmp/lua/Entity_lua.ts +62 -0
  53. package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +23 -0
  54. package/project/.sdk/src/cmp/lua/Main_lua.ts +133 -0
  55. package/project/.sdk/src/cmp/lua/Package_lua.ts +80 -0
  56. package/project/.sdk/src/cmp/lua/ReadmeExplanation_lua.ts +42 -0
  57. package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +100 -0
  58. package/project/.sdk/src/cmp/lua/ReadmeInstall_lua.ts +26 -0
  59. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +129 -0
  60. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +99 -0
  61. package/project/.sdk/src/cmp/lua/ReadmeTopHowto_lua.ts +24 -0
  62. package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +55 -0
  63. package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +38 -0
  64. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +261 -0
  65. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +483 -0
  66. package/project/.sdk/src/cmp/lua/Test_lua.ts +49 -0
  67. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +147 -0
  68. package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +27 -0
  69. package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +24 -0
  70. package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +30 -0
  71. package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +30 -0
  72. package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +30 -0
  73. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +256 -0
  74. package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +26 -0
  75. package/project/.sdk/src/cmp/lua/tsconfig.json +15 -0
  76. package/project/.sdk/src/cmp/lua/utility_lua.ts +84 -0
  77. package/project/.sdk/src/cmp/php/Config_php.ts +107 -0
  78. package/project/.sdk/src/cmp/php/EntityOperation_php.ts +44 -0
  79. package/project/.sdk/src/cmp/php/Entity_php.ts +62 -0
  80. package/project/.sdk/src/cmp/php/MainEntity_php.ts +24 -0
  81. package/project/.sdk/src/cmp/php/Main_php.ts +135 -0
  82. package/project/.sdk/src/cmp/php/Package_php.ts +87 -0
  83. package/project/.sdk/src/cmp/php/ReadmeExplanation_php.ts +42 -0
  84. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +101 -0
  85. package/project/.sdk/src/cmp/php/ReadmeInstall_php.ts +19 -0
  86. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +129 -0
  87. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +100 -0
  88. package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +24 -0
  89. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +56 -0
  90. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +38 -0
  91. package/project/.sdk/src/cmp/php/TestDirect_php.ts +270 -0
  92. package/project/.sdk/src/cmp/php/TestEntity_php.ts +484 -0
  93. package/project/.sdk/src/cmp/php/Test_php.ts +56 -0
  94. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +146 -0
  95. package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +26 -0
  96. package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +23 -0
  97. package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +29 -0
  98. package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +29 -0
  99. package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +29 -0
  100. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +233 -0
  101. package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +24 -0
  102. package/project/.sdk/src/cmp/php/tsconfig.json +15 -0
  103. package/project/.sdk/src/cmp/php/utility_php.ts +85 -0
  104. package/project/.sdk/src/cmp/py/Config_py.ts +93 -0
  105. package/project/.sdk/src/cmp/py/EntityOperation_py.ts +44 -0
  106. package/project/.sdk/src/cmp/py/Entity_py.ts +62 -0
  107. package/project/.sdk/src/cmp/py/MainEntity_py.ts +22 -0
  108. package/project/.sdk/src/cmp/py/Main_py.ts +156 -0
  109. package/project/.sdk/src/cmp/py/Package_py.ts +75 -0
  110. package/project/.sdk/src/cmp/py/ReadmeExplanation_py.ts +41 -0
  111. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +98 -0
  112. package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +25 -0
  113. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +130 -0
  114. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +100 -0
  115. package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +24 -0
  116. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +56 -0
  117. package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +38 -0
  118. package/project/.sdk/src/cmp/py/TestDirect_py.ts +248 -0
  119. package/project/.sdk/src/cmp/py/TestEntity_py.ts +475 -0
  120. package/project/.sdk/src/cmp/py/Test_py.ts +55 -0
  121. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +112 -0
  122. package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +25 -0
  123. package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +22 -0
  124. package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +27 -0
  125. package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +27 -0
  126. package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +27 -0
  127. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +222 -0
  128. package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +16 -0
  129. package/project/.sdk/src/cmp/py/tsconfig.json +15 -0
  130. package/project/.sdk/src/cmp/py/utility_py.ts +84 -0
  131. package/project/.sdk/src/cmp/rb/Config_rb.ts +101 -0
  132. package/project/.sdk/src/cmp/rb/EntityOperation_rb.ts +44 -0
  133. package/project/.sdk/src/cmp/rb/Entity_rb.ts +62 -0
  134. package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +23 -0
  135. package/project/.sdk/src/cmp/rb/Main_rb.ts +130 -0
  136. package/project/.sdk/src/cmp/rb/Package_rb.ts +111 -0
  137. package/project/.sdk/src/cmp/rb/ReadmeExplanation_rb.ts +42 -0
  138. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +98 -0
  139. package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +31 -0
  140. package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +129 -0
  141. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +99 -0
  142. package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +24 -0
  143. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +55 -0
  144. package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +38 -0
  145. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +260 -0
  146. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +476 -0
  147. package/project/.sdk/src/cmp/rb/Test_rb.ts +50 -0
  148. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +116 -0
  149. package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +25 -0
  150. package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +20 -0
  151. package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +26 -0
  152. package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +26 -0
  153. package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +26 -0
  154. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +203 -0
  155. package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +16 -0
  156. package/project/.sdk/src/cmp/rb/tsconfig.json +15 -0
  157. package/project/.sdk/src/cmp/rb/utility_rb.ts +84 -0
  158. package/project/.sdk/src/cmp/ts/ReadmeExplanation_ts.ts +34 -0
  159. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +123 -0
  160. package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +1 -1
  161. package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +159 -0
  162. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +69 -54
  163. package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +25 -0
  164. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +65 -0
  165. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +36 -0
  166. package/project/.sdk/tm/go/feature/log_feature.go +133 -0
  167. package/project/.sdk/tm/go/src/feature/log/.gitkeep +0 -0
  168. package/project/.sdk/tm/lua/LICENSE +22 -0
  169. package/project/.sdk/tm/lua/Makefile +10 -0
  170. package/project/.sdk/tm/lua/core/context.lua +208 -0
  171. package/project/.sdk/tm/lua/core/control.lua +17 -0
  172. package/project/.sdk/tm/lua/core/error.lua +30 -0
  173. package/project/.sdk/tm/lua/core/helpers.lua +30 -0
  174. package/project/.sdk/tm/lua/core/operation.lua +51 -0
  175. package/project/.sdk/tm/lua/core/response.lua +45 -0
  176. package/project/.sdk/tm/lua/core/result.lua +58 -0
  177. package/project/.sdk/tm/lua/core/spec.lua +29 -0
  178. package/project/.sdk/tm/lua/core/utility_type.lua +90 -0
  179. package/project/.sdk/tm/lua/feature/base_feature.lua +35 -0
  180. package/project/.sdk/tm/lua/feature/log_feature.lua +80 -0
  181. package/project/.sdk/tm/lua/feature/test_feature.lua +202 -0
  182. package/project/.sdk/tm/lua/src/feature/README.md +3 -0
  183. package/project/.sdk/tm/lua/src/feature/base/.gitkeep +0 -0
  184. package/project/.sdk/tm/lua/src/feature/log/.gitkeep +0 -0
  185. package/project/.sdk/tm/lua/src/feature/test/.gitkeep +0 -0
  186. package/project/.sdk/tm/lua/test/runner.lua +86 -0
  187. package/project/.sdk/tm/lua/utility/clean.lua +7 -0
  188. package/project/.sdk/tm/lua/utility/done.lua +19 -0
  189. package/project/.sdk/tm/lua/utility/feature_add.lua +8 -0
  190. package/project/.sdk/tm/lua/utility/feature_hook.lua +21 -0
  191. package/project/.sdk/tm/lua/utility/feature_init.lua +24 -0
  192. package/project/.sdk/tm/lua/utility/fetcher.lua +96 -0
  193. package/project/.sdk/tm/lua/utility/make_context.lua +9 -0
  194. package/project/.sdk/tm/lua/utility/make_error.lua +73 -0
  195. package/project/.sdk/tm/lua/utility/make_fetch_def.lua +43 -0
  196. package/project/.sdk/tm/lua/utility/make_options.lua +116 -0
  197. package/project/.sdk/tm/lua/utility/make_point.lua +92 -0
  198. package/project/.sdk/tm/lua/utility/make_request.lua +58 -0
  199. package/project/.sdk/tm/lua/utility/make_response.lua +44 -0
  200. package/project/.sdk/tm/lua/utility/make_result.lua +51 -0
  201. package/project/.sdk/tm/lua/utility/make_spec.lua +72 -0
  202. package/project/.sdk/tm/lua/utility/make_url.lua +46 -0
  203. package/project/.sdk/tm/lua/utility/param.lua +68 -0
  204. package/project/.sdk/tm/lua/utility/prepare_auth.lua +39 -0
  205. package/project/.sdk/tm/lua/utility/prepare_body.lua +14 -0
  206. package/project/.sdk/tm/lua/utility/prepare_headers.lua +20 -0
  207. package/project/.sdk/tm/lua/utility/prepare_method.lua +17 -0
  208. package/project/.sdk/tm/lua/utility/prepare_params.lua +36 -0
  209. package/project/.sdk/tm/lua/utility/prepare_path.lua +19 -0
  210. package/project/.sdk/tm/lua/utility/prepare_query.lua +41 -0
  211. package/project/.sdk/tm/lua/utility/register.lua +71 -0
  212. package/project/.sdk/tm/lua/utility/result_basic.lua +32 -0
  213. package/project/.sdk/tm/lua/utility/result_body.lua +17 -0
  214. package/project/.sdk/tm/lua/utility/result_headers.lua +22 -0
  215. package/project/.sdk/tm/lua/utility/struct/struct.lua +3417 -0
  216. package/project/.sdk/tm/lua/utility/transform_request.lua +31 -0
  217. package/project/.sdk/tm/lua/utility/transform_response.lua +44 -0
  218. package/project/.sdk/tm/php/LICENSE +22 -0
  219. package/project/.sdk/tm/php/Makefile +10 -0
  220. package/project/.sdk/tm/php/core/Context.php +139 -0
  221. package/project/.sdk/tm/php/core/Control.php +18 -0
  222. package/project/.sdk/tm/php/core/Error.php +37 -0
  223. package/project/.sdk/tm/php/core/Helpers.php +25 -0
  224. package/project/.sdk/tm/php/core/Operation.php +36 -0
  225. package/project/.sdk/tm/php/core/Response.php +30 -0
  226. package/project/.sdk/tm/php/core/Result.php +35 -0
  227. package/project/.sdk/tm/php/core/Spec.php +38 -0
  228. package/project/.sdk/tm/php/core/UtilityType.php +89 -0
  229. package/project/.sdk/tm/php/feature/BaseFeature.php +37 -0
  230. package/project/.sdk/tm/php/feature/LogFeature.php +65 -0
  231. package/project/.sdk/tm/php/feature/TestFeature.php +193 -0
  232. package/project/.sdk/tm/php/src/feature/README.md +3 -0
  233. package/project/.sdk/tm/php/src/feature/base/.gitkeep +0 -0
  234. package/project/.sdk/tm/php/src/feature/log/.gitkeep +0 -0
  235. package/project/.sdk/tm/php/src/feature/test/.gitkeep +0 -0
  236. package/project/.sdk/tm/php/test/Runner.php +89 -0
  237. package/project/.sdk/tm/php/utility/Clean.php +12 -0
  238. package/project/.sdk/tm/php/utility/Done.php +26 -0
  239. package/project/.sdk/tm/php/utility/FeatureAdd.php +12 -0
  240. package/project/.sdk/tm/php/utility/FeatureHook.php +23 -0
  241. package/project/.sdk/tm/php/utility/FeatureInit.php +25 -0
  242. package/project/.sdk/tm/php/utility/Fetcher.php +101 -0
  243. package/project/.sdk/tm/php/utility/MakeContext.php +14 -0
  244. package/project/.sdk/tm/php/utility/MakeError.php +59 -0
  245. package/project/.sdk/tm/php/utility/MakeFetchDef.php +36 -0
  246. package/project/.sdk/tm/php/utility/MakeOptions.php +98 -0
  247. package/project/.sdk/tm/php/utility/MakePoint.php +87 -0
  248. package/project/.sdk/tm/php/utility/MakeRequest.php +57 -0
  249. package/project/.sdk/tm/php/utility/MakeResponse.php +43 -0
  250. package/project/.sdk/tm/php/utility/MakeResult.php +50 -0
  251. package/project/.sdk/tm/php/utility/MakeSpec.php +64 -0
  252. package/project/.sdk/tm/php/utility/MakeUrl.php +41 -0
  253. package/project/.sdk/tm/php/utility/Param.php +66 -0
  254. package/project/.sdk/tm/php/utility/PrepareAuth.php +33 -0
  255. package/project/.sdk/tm/php/utility/PrepareBody.php +15 -0
  256. package/project/.sdk/tm/php/utility/PrepareHeaders.php +18 -0
  257. package/project/.sdk/tm/php/utility/PrepareMethod.php +21 -0
  258. package/project/.sdk/tm/php/utility/PrepareParams.php +34 -0
  259. package/project/.sdk/tm/php/utility/PreparePath.php +20 -0
  260. package/project/.sdk/tm/php/utility/PrepareQuery.php +32 -0
  261. package/project/.sdk/tm/php/utility/Register.php +67 -0
  262. package/project/.sdk/tm/php/utility/ResultBasic.php +29 -0
  263. package/project/.sdk/tm/php/utility/ResultBody.php +17 -0
  264. package/project/.sdk/tm/php/utility/ResultHeaders.php +21 -0
  265. package/project/.sdk/tm/php/utility/TransformRequest.php +27 -0
  266. package/project/.sdk/tm/php/utility/TransformResponse.php +42 -0
  267. package/project/.sdk/tm/php/utility/struct/Struct.php +3431 -0
  268. package/project/.sdk/tm/py/Makefile +10 -0
  269. package/project/.sdk/tm/py/core/__init__.py +0 -0
  270. package/project/.sdk/tm/py/core/context.py +199 -0
  271. package/project/.sdk/tm/py/core/control.py +12 -0
  272. package/project/.sdk/tm/py/core/error.py +18 -0
  273. package/project/.sdk/tm/py/core/helpers.py +15 -0
  274. package/project/.sdk/tm/py/core/operation.py +37 -0
  275. package/project/.sdk/tm/py/core/response.py +34 -0
  276. package/project/.sdk/tm/py/core/result.py +44 -0
  277. package/project/.sdk/tm/py/core/spec.py +23 -0
  278. package/project/.sdk/tm/py/core/utility_type.py +82 -0
  279. package/project/.sdk/tm/py/entity/__init__.py +0 -0
  280. package/project/.sdk/tm/py/feature/__init__.py +0 -0
  281. package/project/.sdk/tm/py/feature/base_feature.py +61 -0
  282. package/project/.sdk/tm/py/feature/log_feature.py +84 -0
  283. package/project/.sdk/tm/py/feature/test_feature.py +164 -0
  284. package/project/.sdk/tm/py/src/feature/README.md +3 -0
  285. package/project/.sdk/tm/py/src/feature/base/.gitkeep +0 -0
  286. package/project/.sdk/tm/py/src/feature/log/.gitkeep +0 -0
  287. package/project/.sdk/tm/py/src/feature/test/.gitkeep +0 -0
  288. package/project/.sdk/tm/py/test/__init__.py +0 -0
  289. package/project/.sdk/tm/py/test/runner.py +77 -0
  290. package/project/.sdk/tm/py/utility/__init__.py +0 -0
  291. package/project/.sdk/tm/py/utility/clean.py +5 -0
  292. package/project/.sdk/tm/py/utility/done.py +14 -0
  293. package/project/.sdk/tm/py/utility/feature_add.py +6 -0
  294. package/project/.sdk/tm/py/utility/feature_hook.py +15 -0
  295. package/project/.sdk/tm/py/utility/feature_init.py +18 -0
  296. package/project/.sdk/tm/py/utility/fetcher.py +95 -0
  297. package/project/.sdk/tm/py/utility/make_context.py +7 -0
  298. package/project/.sdk/tm/py/utility/make_error.py +64 -0
  299. package/project/.sdk/tm/py/utility/make_fetch_def.py +37 -0
  300. package/project/.sdk/tm/py/utility/make_options.py +103 -0
  301. package/project/.sdk/tm/py/utility/make_point.py +74 -0
  302. package/project/.sdk/tm/py/utility/make_request.py +52 -0
  303. package/project/.sdk/tm/py/utility/make_response.py +36 -0
  304. package/project/.sdk/tm/py/utility/make_result.py +41 -0
  305. package/project/.sdk/tm/py/utility/make_spec.py +68 -0
  306. package/project/.sdk/tm/py/utility/make_url.py +34 -0
  307. package/project/.sdk/tm/py/utility/param.py +55 -0
  308. package/project/.sdk/tm/py/utility/prepare_auth.py +34 -0
  309. package/project/.sdk/tm/py/utility/prepare_body.py +11 -0
  310. package/project/.sdk/tm/py/utility/prepare_headers.py +17 -0
  311. package/project/.sdk/tm/py/utility/prepare_method.py +15 -0
  312. package/project/.sdk/tm/py/utility/prepare_params.py +28 -0
  313. package/project/.sdk/tm/py/utility/prepare_path.py +16 -0
  314. package/project/.sdk/tm/py/utility/prepare_query.py +33 -0
  315. package/project/.sdk/tm/py/utility/register.py +68 -0
  316. package/project/.sdk/tm/py/utility/result_basic.py +26 -0
  317. package/project/.sdk/tm/py/utility/result_body.py +13 -0
  318. package/project/.sdk/tm/py/utility/result_headers.py +17 -0
  319. package/project/.sdk/tm/py/utility/transform_request.py +27 -0
  320. package/project/.sdk/tm/py/utility/transform_response.py +39 -0
  321. package/project/.sdk/tm/py/utility/voxgig_struct/__init__.py +72 -0
  322. package/project/.sdk/tm/py/utility/voxgig_struct/voxgig_struct.py +2770 -0
  323. package/project/.sdk/tm/rb/Gemfile +4 -0
  324. package/project/.sdk/tm/rb/LICENSE +22 -0
  325. package/project/.sdk/tm/rb/Makefile +10 -0
  326. package/project/.sdk/tm/rb/core/context.rb +105 -0
  327. package/project/.sdk/tm/rb/core/control.rb +11 -0
  328. package/project/.sdk/tm/rb/core/error.rb +24 -0
  329. package/project/.sdk/tm/rb/core/helpers.rb +16 -0
  330. package/project/.sdk/tm/rb/core/operation.rb +26 -0
  331. package/project/.sdk/tm/rb/core/response.rb +20 -0
  332. package/project/.sdk/tm/rb/core/result.rb +23 -0
  333. package/project/.sdk/tm/rb/core/spec.rb +23 -0
  334. package/project/.sdk/tm/rb/core/utility_type.rb +32 -0
  335. package/project/.sdk/tm/rb/feature/base_feature.rb +30 -0
  336. package/project/.sdk/tm/rb/feature/log_feature.rb +50 -0
  337. package/project/.sdk/tm/rb/feature/test_feature.rb +154 -0
  338. package/project/.sdk/tm/rb/src/feature/README.md +3 -0
  339. package/project/.sdk/tm/rb/src/feature/base/.gitkeep +0 -0
  340. package/project/.sdk/tm/rb/src/feature/log/.gitkeep +0 -0
  341. package/project/.sdk/tm/rb/src/feature/test/.gitkeep +0 -0
  342. package/project/.sdk/tm/rb/test/runner.rb +65 -0
  343. package/project/.sdk/tm/rb/utility/clean.rb +4 -0
  344. package/project/.sdk/tm/rb/utility/done.rb +14 -0
  345. package/project/.sdk/tm/rb/utility/feature_add.rb +6 -0
  346. package/project/.sdk/tm/rb/utility/feature_hook.rb +11 -0
  347. package/project/.sdk/tm/rb/utility/feature_init.rb +16 -0
  348. package/project/.sdk/tm/rb/utility/fetcher.rb +67 -0
  349. package/project/.sdk/tm/rb/utility/make_context.rb +7 -0
  350. package/project/.sdk/tm/rb/utility/make_error.rb +44 -0
  351. package/project/.sdk/tm/rb/utility/make_fetch_def.rb +24 -0
  352. package/project/.sdk/tm/rb/utility/make_options.rb +57 -0
  353. package/project/.sdk/tm/rb/utility/make_point.rb +77 -0
  354. package/project/.sdk/tm/rb/utility/make_request.rb +44 -0
  355. package/project/.sdk/tm/rb/utility/make_response.rb +25 -0
  356. package/project/.sdk/tm/rb/utility/make_result.rb +33 -0
  357. package/project/.sdk/tm/rb/utility/make_spec.rb +50 -0
  358. package/project/.sdk/tm/rb/utility/make_url.rb +32 -0
  359. package/project/.sdk/tm/rb/utility/param.rb +48 -0
  360. package/project/.sdk/tm/rb/utility/prepare_auth.rb +26 -0
  361. package/project/.sdk/tm/rb/utility/prepare_body.rb +6 -0
  362. package/project/.sdk/tm/rb/utility/prepare_headers.rb +11 -0
  363. package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -0
  364. package/project/.sdk/tm/rb/utility/prepare_params.rb +25 -0
  365. package/project/.sdk/tm/rb/utility/prepare_path.rb +13 -0
  366. package/project/.sdk/tm/rb/utility/prepare_query.rb +22 -0
  367. package/project/.sdk/tm/rb/utility/register.rb +63 -0
  368. package/project/.sdk/tm/rb/utility/result_basic.rb +23 -0
  369. package/project/.sdk/tm/rb/utility/result_body.rb +11 -0
  370. package/project/.sdk/tm/rb/utility/result_headers.rb +15 -0
  371. package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +2256 -0
  372. package/project/.sdk/tm/rb/utility/transform_request.rb +15 -0
  373. package/project/.sdk/tm/rb/utility/transform_response.rb +23 -0
  374. package/src/cmp/Readme.ts +5 -5
  375. package/src/cmp/ReadmeEntity.ts +77 -25
  376. package/src/cmp/ReadmeExplanation.ts +333 -0
  377. package/src/cmp/ReadmeHowto.ts +28 -0
  378. package/src/cmp/ReadmeIntro.ts +10 -24
  379. package/src/cmp/ReadmeModel.ts +57 -88
  380. package/src/cmp/ReadmeOptions.ts +40 -11
  381. package/src/cmp/ReadmeQuick.ts +4 -1
  382. package/src/cmp/ReadmeRef.ts +1057 -40
  383. package/src/cmp/ReadmeTop.ts +213 -0
  384. package/src/sdkgen.ts +12 -0
  385. package/project/.sdk/tm/go/test/exists_test.go +0 -16
@@ -0,0 +1,15 @@
1
+ # ProjectName SDK utility: transform_request
2
+ require_relative 'struct/voxgig_struct'
3
+ require_relative '../core/helpers'
4
+ module ProjectNameUtilities
5
+ TransformRequest = ->(ctx) {
6
+ spec = ctx.spec
7
+ point = ctx.point
8
+ spec.step = "reqform" if spec
9
+ transform = ProjectNameHelpers.to_map(VoxgigStruct.getprop(point, "transform"))
10
+ return ctx.reqdata unless transform
11
+ reqform = VoxgigStruct.getprop(transform, "req")
12
+ return ctx.reqdata unless reqform
13
+ VoxgigStruct.transform({ "reqdata" => ctx.reqdata }, reqform)
14
+ }
15
+ end
@@ -0,0 +1,23 @@
1
+ # ProjectName SDK utility: transform_response
2
+ require_relative 'struct/voxgig_struct'
3
+ require_relative '../core/helpers'
4
+ module ProjectNameUtilities
5
+ TransformResponse = ->(ctx) {
6
+ spec = ctx.spec
7
+ result = ctx.result
8
+ point = ctx.point
9
+ spec.step = "resform" if spec
10
+ return nil if result.nil? || !result.ok
11
+ transform = ProjectNameHelpers.to_map(VoxgigStruct.getprop(point, "transform"))
12
+ return nil unless transform
13
+ resform = VoxgigStruct.getprop(transform, "res")
14
+ return nil unless resform
15
+ resdata = VoxgigStruct.transform({
16
+ "ok" => result.ok, "status" => result.status, "statusText" => result.status_text,
17
+ "headers" => result.headers, "body" => result.body, "err" => result.err,
18
+ "resdata" => result.resdata, "resmatch" => result.resmatch,
19
+ }, resform)
20
+ result.resdata = resdata
21
+ resdata
22
+ }
23
+ end
package/src/cmp/Readme.ts CHANGED
@@ -8,6 +8,8 @@ import { ReadmeQuick } from './ReadmeQuick'
8
8
  import { ReadmeModel } from './ReadmeModel'
9
9
  import { ReadmeOptions } from './ReadmeOptions'
10
10
  import { ReadmeEntity } from './ReadmeEntity'
11
+ import { ReadmeHowto } from './ReadmeHowto'
12
+ import { ReadmeExplanation } from './ReadmeExplanation'
11
13
  import { ReadmeRef } from './ReadmeRef'
12
14
 
13
15
 
@@ -17,19 +19,17 @@ const Readme = cmp(function Readme(props: any) {
17
19
 
18
20
  File({ name: 'README.md' }, () => {
19
21
 
20
- Content(`
21
- # ${model.Name} ${target.title} SDK
22
- `)
23
- // Sections
24
22
  ReadmeIntro({ target })
25
23
  ReadmeInstall({ target })
26
24
  ReadmeQuick({ target })
25
+ ReadmeHowto({ target })
27
26
  ReadmeModel({ target })
28
27
  ReadmeOptions({ target })
29
28
  ReadmeEntity({ target })
29
+ ReadmeExplanation({ target })
30
30
 
31
31
  Content(`
32
- ## Reference
32
+ ## Full Reference
33
33
 
34
34
  See [REFERENCE.md](REFERENCE.md) for complete API reference
35
35
  documentation including all method signatures, entity field schemas,
@@ -7,22 +7,25 @@ import {
7
7
  } from '../types'
8
8
 
9
9
 
10
- const OP_DESC: Record<string, { method: string, desc: string }> = {
11
- load: { method: 'load(match)', desc: 'Load a single entity by match criteria.' },
12
- list: { method: 'list(match)', desc: 'List entities matching the criteria.' },
13
- create: { method: 'create(data)', desc: 'Create a new entity with the given data.' },
14
- update: { method: 'update(data)', desc: 'Update an existing entity.' },
15
- remove: { method: 'remove(match)', desc: 'Remove the matching entity.' },
10
+ const OP_DESC: Record<string, { method: string, goMethod: string, desc: string }> = {
11
+ load: { method: 'load(match)', goMethod: 'Load(match, ctrl)', desc: 'Load a single entity by match criteria.' },
12
+ list: { method: 'list(match)', goMethod: 'List(match, ctrl)', desc: 'List entities matching the criteria.' },
13
+ create: { method: 'create(data)', goMethod: 'Create(data, ctrl)', desc: 'Create a new entity with the given data.' },
14
+ update: { method: 'update(data)', goMethod: 'Update(data, ctrl)', desc: 'Update an existing entity.' },
15
+ remove: { method: 'remove(match)', goMethod: 'Remove(match, ctrl)', desc: 'Remove the matching entity.' },
16
16
  }
17
17
 
18
18
 
19
19
  const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
20
- const { ctx$: { model } } = props
20
+ const { target } = props
21
+ const { model } = props.ctx$
21
22
 
22
23
  const entity = getModelPath(model, `main.${KIT}.entity`)
24
+ const isGo = target.name === 'go'
25
+ const lang = isGo ? 'go' : 'ts'
23
26
 
24
27
  const publishedEntities = each(entity)
25
- .filter((entity: any) => entity.publish)
28
+ .filter((entity: any) => entity.active !== false)
26
29
 
27
30
  if (0 === publishedEntities.length) {
28
31
  return
@@ -36,7 +39,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
36
39
 
37
40
  publishedEntities.map((entity: any) => {
38
41
  const opnames = Object.keys(entity.op || {})
39
- const fields = entity.field || []
42
+ const fields = entity.fields || []
40
43
 
41
44
  Content(`
42
45
  ### ${entity.Name}
@@ -49,9 +52,16 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
49
52
  `)
50
53
  }
51
54
 
52
- Content(`Create an instance: \`const ${entity.name} = client.${entity.Name}()\`
55
+ if (isGo) {
56
+ Content(`Create an instance: \`${entity.name} := client.${entity.Name}(nil)\`
53
57
 
54
58
  `)
59
+ }
60
+ else {
61
+ Content(`Create an instance: \`const ${entity.name} = client.${entity.Name}()\`
62
+
63
+ `)
64
+ }
55
65
 
56
66
  // Operations table
57
67
  if (opnames.length > 0) {
@@ -63,7 +73,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
63
73
  opnames.map((opname: string) => {
64
74
  const info = OP_DESC[opname]
65
75
  if (info) {
66
- Content(`| \`${info.method}\` | ${info.desc} |
76
+ const method = isGo ? info.goMethod : info.method
77
+ Content(`| \`${method}\` | ${info.desc} |
67
78
  `)
68
79
  }
69
80
  })
@@ -91,42 +102,83 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
91
102
  }
92
103
 
93
104
  // Example usage
94
- if (opnames.includes('load')) {
95
- Content(`#### Example: Load
105
+ if (isGo) {
106
+ if (opnames.includes('load')) {
107
+ Content(`#### Example: Load
108
+
109
+ \`\`\`go
110
+ result, err := client.${entity.Name}(nil).Load(map[string]any{"id": "${entity.name}_id"}, nil)
111
+ \`\`\`
112
+
113
+ `)
114
+ }
115
+
116
+ if (opnames.includes('list')) {
117
+ Content(`#### Example: List
118
+
119
+ \`\`\`go
120
+ results, err := client.${entity.Name}(nil).List(nil, nil)
121
+ \`\`\`
122
+
123
+ `)
124
+ }
125
+
126
+ if (opnames.includes('create')) {
127
+ Content(`#### Example: Create
128
+
129
+ \`\`\`go
130
+ result, err := client.${entity.Name}(nil).Create(map[string]any{
131
+ `)
132
+ each(fields, (field: any) => {
133
+ if ('id' !== field.name && field.req) {
134
+ Content(` "${field.name}": /* ${field.type || 'value'} */,
135
+ `)
136
+ }
137
+ })
138
+ Content(`}, nil)
139
+ \`\`\`
140
+
141
+ `)
142
+ }
143
+ }
144
+ else {
145
+ if (opnames.includes('load')) {
146
+ Content(`#### Example: Load
96
147
 
97
148
  \`\`\`ts
98
149
  const ${entity.name} = await client.${entity.Name}().load({ id: '${entity.name}_id' })
99
150
  \`\`\`
100
151
 
101
152
  `)
102
- }
153
+ }
103
154
 
104
- if (opnames.includes('list')) {
105
- Content(`#### Example: List
155
+ if (opnames.includes('list')) {
156
+ Content(`#### Example: List
106
157
 
107
158
  \`\`\`ts
108
159
  const ${entity.name}s = await client.${entity.Name}().list()
109
160
  \`\`\`
110
161
 
111
162
  `)
112
- }
163
+ }
113
164
 
114
- if (opnames.includes('create')) {
115
- Content(`#### Example: Create
165
+ if (opnames.includes('create')) {
166
+ Content(`#### Example: Create
116
167
 
117
168
  \`\`\`ts
118
169
  const ${entity.name} = await client.${entity.Name}().create({
119
170
  `)
120
- each(fields, (field: any) => {
121
- if ('id' !== field.name && field.req) {
122
- Content(` ${field.name}: /* ${field.type || 'value'} */,
171
+ each(fields, (field: any) => {
172
+ if ('id' !== field.name && field.req) {
173
+ Content(` ${field.name}: /* ${field.type || 'value'} */,
123
174
  `)
124
- }
125
- })
126
- Content(`})
175
+ }
176
+ })
177
+ Content(`})
127
178
  \`\`\`
128
179
 
129
180
  `)
181
+ }
130
182
  }
131
183
 
132
184
  })
@@ -0,0 +1,333 @@
1
+
2
+ import { cmp, each, names, Content } from 'jostraca'
3
+
4
+ import {
5
+ KIT,
6
+ getModelPath
7
+ } from '../types'
8
+
9
+ import { requirePath } from '../utility'
10
+
11
+
12
+ const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
13
+ const { target, ctx$ } = props
14
+ const { model } = ctx$
15
+
16
+ const feature = getModelPath(model, `main.${KIT}.feature`)
17
+
18
+ Content(`
19
+ ## Explanation
20
+
21
+ ### The operation pipeline
22
+
23
+ Every entity operation (load, list, create, update, remove) follows a
24
+ six-stage pipeline. Each stage fires a feature hook before executing:
25
+
26
+ \`\`\`
27
+ PrePoint \u2192 PreSpec \u2192 PreRequest \u2192 PreResponse \u2192 PreResult \u2192 PreDone
28
+ \`\`\`
29
+
30
+ - **PrePoint**: Resolves which API endpoint to call based on the
31
+ operation name and entity configuration.
32
+ - **PreSpec**: Builds the HTTP spec \u2014 URL, method, headers, body \u2014
33
+ from the resolved point and the caller's parameters.
34
+ - **PreRequest**: Sends the HTTP request. Features can intercept here
35
+ to replace the transport (as TestFeature does with mocks).
36
+ - **PreResponse**: Parses the raw HTTP response.
37
+ - **PreResult**: Extracts the business data from the parsed response.
38
+ - **PreDone**: Final stage before returning to the caller. Entity
39
+ state (match, data) is updated here.
40
+
41
+ `)
42
+
43
+ // Target-specific error description
44
+ if (target.name === 'py') {
45
+ Content(`If any stage returns an error, the pipeline short-circuits and the
46
+ error is returned to the caller as the second element in the return tuple.
47
+
48
+ `)
49
+ }
50
+ else if (target.name === 'php') {
51
+ Content(`If any stage returns an error, the pipeline short-circuits and the
52
+ error is returned to the caller as the second element in the return array.
53
+
54
+ `)
55
+ }
56
+ else if (target.name === 'rb') {
57
+ Content(`If any stage returns an error, the pipeline short-circuits and the
58
+ error is returned to the caller as a second return value.
59
+
60
+ `)
61
+ }
62
+ else if (target.name === 'lua') {
63
+ Content(`If any stage returns an error, the pipeline short-circuits and the
64
+ error is returned to the caller as a second return value.
65
+
66
+ `)
67
+ }
68
+ else if (target.name === 'go') {
69
+ Content(`If any stage returns an error, the pipeline short-circuits and the
70
+ error is returned to the caller. An unexpected panic triggers the
71
+ \`PreUnexpected\` hook.
72
+
73
+ `)
74
+ }
75
+ else {
76
+ Content(`If any stage returns an error, the pipeline short-circuits and the
77
+ error is returned to the caller.
78
+
79
+ An unexpected exception triggers the \`PreUnexpected\` hook before
80
+ propagating.
81
+
82
+ `)
83
+ }
84
+
85
+
86
+ // Features and hooks
87
+ Content(`### Features and hooks
88
+
89
+ `)
90
+
91
+ if (target.name === 'py') {
92
+ Content(`Features are the extension mechanism. A feature is a Python class
93
+ with hook methods named after pipeline stages (e.g. \`PrePoint\`,
94
+ \`PreSpec\`). Each method receives the context.
95
+
96
+ `)
97
+ }
98
+ else if (target.name === 'php') {
99
+ Content(`Features are the extension mechanism. A feature is a PHP class
100
+ with hook methods named after pipeline stages (e.g. \`PrePoint\`,
101
+ \`PreSpec\`). Each method receives the context.
102
+
103
+ `)
104
+ }
105
+ else if (target.name === 'rb') {
106
+ Content(`Features are the extension mechanism. A feature is a Ruby class
107
+ with hook methods named after pipeline stages (e.g. \`PrePoint\`,
108
+ \`PreSpec\`). Each method receives the context.
109
+
110
+ `)
111
+ }
112
+ else if (target.name === 'lua') {
113
+ Content(`Features are the extension mechanism. A feature is a Lua table
114
+ with hook methods named after pipeline stages (e.g. \`PrePoint\`,
115
+ \`PreSpec\`). Each method receives the context.
116
+
117
+ `)
118
+ }
119
+ else if (target.name === 'go') {
120
+ Content(`Features are the extension mechanism. A feature implements the
121
+ \`Feature\` interface and provides hooks \u2014 functions keyed by pipeline
122
+ stage names.
123
+
124
+ `)
125
+ }
126
+ else {
127
+ Content(`Features are the extension mechanism. A feature is an object with a
128
+ \`hooks\` map. Each hook key is a pipeline stage name, and the value is
129
+ a function that receives the context.
130
+
131
+ `)
132
+ }
133
+
134
+ Content(`The SDK ships with built-in features:
135
+
136
+ `)
137
+ each(feature, (feat: any) => {
138
+ if (!feat.active) return
139
+ if (!feat.Name) names(feat, feat.name)
140
+ const purpose = feat.title || feat.Name || feat.name
141
+ Content(`- **${feat.Name}Feature**: ${purpose}
142
+ `)
143
+ })
144
+
145
+ Content(`
146
+ Features are initialized in order. Hooks fire in the order features
147
+ were added, so later features can override earlier ones.
148
+
149
+ `)
150
+
151
+
152
+ // Target-specific explanation
153
+ const ReadmeExplanation_sdk =
154
+ requirePath(ctx$, `./cmp/${target.name}/ReadmeExplanation_${target.name}`, { ignore: true })
155
+
156
+ if (ReadmeExplanation_sdk) {
157
+ ReadmeExplanation_sdk['ReadmeExplanation']({ target })
158
+ }
159
+
160
+
161
+ // Entity state
162
+ Content(`### Entity state
163
+
164
+ `)
165
+
166
+ if (target.name === 'py') {
167
+ Content(`Entity instances are stateful. After a successful \`load\`, the entity
168
+ stores the returned data and match criteria internally.
169
+
170
+ \`\`\`python
171
+ moon = client.Moon()
172
+ moon.load({"planet_id": "earth", "id": "luna"})
173
+
174
+ # moon.data_get() now returns the loaded moon data
175
+ # moon.match_get() returns the last match criteria
176
+ \`\`\`
177
+
178
+ Call \`make()\` to create a fresh instance with the same configuration
179
+ but no stored state.
180
+
181
+ `)
182
+ }
183
+ else if (target.name === 'php') {
184
+ Content(`Entity instances are stateful. After a successful \`load\`, the entity
185
+ stores the returned data and match criteria internally.
186
+
187
+ \`\`\`php
188
+ $moon = $client->Moon();
189
+ [$result, $err] = $moon->load(["planet_id" => "earth", "id" => "luna"]);
190
+
191
+ // $moon->dataGet() now returns the loaded moon data
192
+ // $moon->matchGet() returns the last match criteria
193
+ \`\`\`
194
+
195
+ Call \`make()\` to create a fresh instance with the same configuration
196
+ but no stored state.
197
+
198
+ `)
199
+ }
200
+ else if (target.name === 'rb') {
201
+ Content(`Entity instances are stateful. After a successful \`load\`, the entity
202
+ stores the returned data and match criteria internally.
203
+
204
+ \`\`\`ruby
205
+ moon = client.Moon
206
+ moon.load({ "planet_id" => "earth", "id" => "luna" })
207
+
208
+ # moon.data_get now returns the loaded moon data
209
+ # moon.match_get returns the last match criteria
210
+ \`\`\`
211
+
212
+ Call \`make\` to create a fresh instance with the same configuration
213
+ but no stored state.
214
+
215
+ `)
216
+ }
217
+ else if (target.name === 'lua') {
218
+ Content(`Entity instances are stateful. After a successful \`load\`, the entity
219
+ stores the returned data and match criteria internally.
220
+
221
+ \`\`\`lua
222
+ local moon = client:Moon(nil)
223
+ moon:load({ planet_id = "earth", id = "luna" }, nil)
224
+
225
+ -- moon:data_get() now returns the loaded moon data
226
+ -- moon:match_get() returns the last match criteria
227
+ \`\`\`
228
+
229
+ Call \`make()\` to create a fresh instance with the same configuration
230
+ but no stored state.
231
+
232
+ `)
233
+ }
234
+ else if (target.name === 'go') {
235
+ Content(`Entity instances are stateful. After a successful \`Load\`, the entity
236
+ stores the returned data and match criteria internally.
237
+
238
+ \`\`\`go
239
+ moon := client.Moon(nil)
240
+ moon.Load(map[string]any{"planet_id": "earth", "id": "luna"}, nil)
241
+
242
+ // moon.Data() now returns the loaded moon data
243
+ // moon.Match() returns the last match criteria
244
+ \`\`\`
245
+
246
+ Call \`Make()\` to create a fresh instance with the same configuration
247
+ but no stored state.
248
+
249
+ `)
250
+ }
251
+ else {
252
+ Content(`Entity instances are stateful. After a successful \`load\`, the entity
253
+ stores the returned data and match criteria internally. Subsequent
254
+ calls on the same instance can rely on this state.
255
+
256
+ \`\`\`ts
257
+ const moon = client.Moon()
258
+ await moon.load({ planet_id: 'earth', id: 'luna' })
259
+
260
+ // moon.data() now returns the loaded moon data
261
+ // moon.match() returns { planet_id: 'earth', id: 'luna' }
262
+ \`\`\`
263
+
264
+ Call \`make()\` to create a fresh instance with the same configuration
265
+ but no stored state.
266
+
267
+ `)
268
+ }
269
+
270
+
271
+ // Direct vs entity access
272
+ Content(`### Direct vs entity access
273
+
274
+ The entity interface handles URL construction, parameter placement,
275
+ and response parsing automatically. Use it for standard CRUD operations.
276
+
277
+ `)
278
+
279
+ if (target.name === 'py') {
280
+ Content(`\`direct()\` gives full control over the HTTP request. Use it for
281
+ non-standard endpoints, bulk operations, or any path not modelled as
282
+ an entity. \`prepare()\` builds the request without sending it \u2014 useful
283
+ for debugging or custom transport.
284
+
285
+ `)
286
+ }
287
+ else if (target.name === 'php') {
288
+ Content(`\`direct()\` gives full control over the HTTP request. Use it for
289
+ non-standard endpoints, bulk operations, or any path not modelled as
290
+ an entity. \`prepare()\` builds the request without sending it \u2014 useful
291
+ for debugging or custom transport.
292
+
293
+ `)
294
+ }
295
+ else if (target.name === 'rb') {
296
+ Content(`\`direct\` gives full control over the HTTP request. Use it for
297
+ non-standard endpoints, bulk operations, or any path not modelled as
298
+ an entity. \`prepare\` builds the request without sending it \u2014 useful
299
+ for debugging or custom transport.
300
+
301
+ `)
302
+ }
303
+ else if (target.name === 'lua') {
304
+ Content(`\`direct()\` gives full control over the HTTP request. Use it for
305
+ non-standard endpoints, bulk operations, or any path not modelled as
306
+ an entity. \`prepare()\` builds the request without sending it \u2014 useful
307
+ for debugging or custom transport.
308
+
309
+ `)
310
+ }
311
+ else if (target.name === 'go') {
312
+ Content(`\`Direct()\` gives full control over the HTTP request. Use it for
313
+ non-standard endpoints, bulk operations, or any path not modelled as
314
+ an entity. \`Prepare()\` builds the request without sending it \u2014 useful
315
+ for debugging or custom transport.
316
+
317
+ `)
318
+ }
319
+ else {
320
+ Content(`The \`direct\` method gives full control over the HTTP request. Use it
321
+ for non-standard endpoints, bulk operations, or any path not modelled
322
+ as an entity. The \`prepare\` method is useful for debugging \u2014 it
323
+ shows exactly what \`direct\` would send.
324
+
325
+ `)
326
+ }
327
+
328
+ })
329
+
330
+
331
+ export {
332
+ ReadmeExplanation
333
+ }
@@ -0,0 +1,28 @@
1
+
2
+ import { cmp, Content } from 'jostraca'
3
+
4
+ import { requirePath } from '../utility'
5
+
6
+
7
+ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
8
+ const { target, ctx$ } = props
9
+
10
+ Content(`
11
+ ## How-to guides
12
+
13
+ `)
14
+
15
+ const ReadmeHowto_sdk =
16
+ requirePath(ctx$, `./cmp/${target.name}/ReadmeHowto_${target.name}`, { ignore: true })
17
+
18
+ if (ReadmeHowto_sdk) {
19
+ ReadmeHowto_sdk['ReadmeHowto']({ target })
20
+ }
21
+ })
22
+
23
+
24
+
25
+
26
+ export {
27
+ ReadmeHowto
28
+ }
@@ -7,38 +7,24 @@ import {
7
7
  } from '../types'
8
8
 
9
9
 
10
+ const TARGET_INTRO: Record<string, string> = {
11
+ ts: 'Provides a type-safe,\nentity-oriented interface with full async/await support.',
12
+ go: 'Provides an entity-oriented interface\nusing standard Go conventions \u2014 no generics required, data flows as\n`map[string]any`.',
13
+ js: 'Provides an entity-oriented\ninterface with full async/await support.',
14
+ }
15
+
16
+
10
17
  const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
11
18
  const { target } = props
12
19
  const { model } = props.ctx$
13
20
 
14
21
  const desc = model.main.def.desc || ''
15
- const entity = getModelPath(model, `main.${KIT}.entity`)
16
-
17
- const entityNames = Object.values(entity)
18
- .filter((e: any) => e.publish)
19
- .map((e: any) => `\`${e.Name}\``)
20
-
21
- Content(`
22
- ## Introduction
23
22
 
24
- ${desc}
25
- `)
26
-
27
- if (entityNames.length > 0) {
28
- Content(`
29
- This SDK provides an entity-oriented interface for the ${model.Name} API.
30
- The following entities are available: ${entityNames.join(', ')}.
31
-
32
- `)
33
- }
23
+ const targetIntro = TARGET_INTRO[target.name] || 'Provides an entity-oriented interface.'
34
24
 
35
- Content(`
36
- ### Features
25
+ Content(`# ${model.Name} ${target.title} SDK
37
26
 
38
- - Entity-based API: work with business objects directly.
39
- - Type safe: full TypeScript definitions included.
40
- - Direct HTTP access: call any API endpoint using \`client.direct()\`.
41
- - Testable: built-in test mode with mock support.
27
+ The ${target.title} SDK for the ${model.Name} API. ${targetIntro}
42
28
 
43
29
  `)
44
30