@voxgig/sdkgen 4.34.1 → 4.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeErrors.js +3 -3
  3. package/dist/cmp/ReadmeErrors.js.map +1 -1
  4. package/dist/cmp/ReadmeExplanation.js +3 -3
  5. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  6. package/dist/cmp/ReadmeQuick.js +3 -1
  7. package/dist/cmp/ReadmeQuick.js.map +1 -1
  8. package/dist/cmp/ReadmeTop.js +9 -8
  9. package/dist/cmp/ReadmeTop.js.map +1 -1
  10. package/dist/helpers/definitionPlan.js +8 -4
  11. package/dist/helpers/definitionPlan.js.map +1 -1
  12. package/dist/helpers/naming.d.ts +2 -1
  13. package/dist/helpers/naming.js +11 -4
  14. package/dist/helpers/naming.js.map +1 -1
  15. package/dist/helpers/opExample.d.ts +16 -2
  16. package/dist/helpers/opExample.js +80 -21
  17. package/dist/helpers/opExample.js.map +1 -1
  18. package/dist/helpers/opShape.d.ts +3 -1
  19. package/dist/helpers/opShape.js +21 -8
  20. package/dist/helpers/opShape.js.map +1 -1
  21. package/dist/sdkgen.d.ts +4 -4
  22. package/dist/sdkgen.js +12 -4
  23. package/dist/sdkgen.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/dist/utility.d.ts +2 -1
  26. package/dist/utility.js +29 -3
  27. package/dist/utility.js.map +1 -1
  28. package/package.json +2 -2
  29. package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +3 -2
  30. package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +7 -3
  31. package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +3 -2
  32. package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -4
  33. package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +3 -2
  34. package/project/.sdk/src/cmp/c/ReadmeTopTest_c.ts +8 -7
  35. package/project/.sdk/src/cmp/c/utility_c.ts +21 -2
  36. package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +4 -1
  37. package/project/.sdk/src/cmp/clojure/ReadmeHowto_clojure.ts +17 -6
  38. package/project/.sdk/src/cmp/clojure/ReadmeModel_clojure.ts +6 -6
  39. package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +13 -8
  40. package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +21 -18
  41. package/project/.sdk/src/cmp/clojure/ReadmeTopQuick_clojure.ts +6 -3
  42. package/project/.sdk/src/cmp/clojure/ReadmeTopTest_clojure.ts +16 -9
  43. package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +4 -4
  44. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +2 -1
  45. package/project/.sdk/src/cmp/clojure/utility_clojure.ts +14 -0
  46. package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +3 -2
  47. package/project/.sdk/src/cmp/cpp/ReadmeHowto_cpp.ts +7 -3
  48. package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +3 -2
  49. package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +6 -5
  50. package/project/.sdk/src/cmp/cpp/ReadmeTopQuick_cpp.ts +3 -2
  51. package/project/.sdk/src/cmp/cpp/ReadmeTopTest_cpp.ts +8 -7
  52. package/project/.sdk/src/cmp/cpp/utility_cpp.ts +13 -0
  53. package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +3 -2
  54. package/project/.sdk/src/cmp/csharp/ReadmeHowto_csharp.ts +20 -8
  55. package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +13 -8
  56. package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +10 -5
  57. package/project/.sdk/src/cmp/csharp/ReadmeTopQuick_csharp.ts +14 -7
  58. package/project/.sdk/src/cmp/csharp/ReadmeTopTest_csharp.ts +18 -10
  59. package/project/.sdk/src/cmp/csharp/utility_csharp.ts +13 -0
  60. package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +4 -4
  61. package/project/.sdk/src/cmp/elixir/ReadmeExplanation_elixir.ts +2 -1
  62. package/project/.sdk/src/cmp/elixir/ReadmeHowto_elixir.ts +13 -6
  63. package/project/.sdk/src/cmp/elixir/ReadmeModel_elixir.ts +5 -5
  64. package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +13 -10
  65. package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +11 -11
  66. package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +8 -6
  67. package/project/.sdk/src/cmp/elixir/ReadmeTopTest_elixir.ts +14 -10
  68. package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +4 -3
  69. package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +4 -3
  70. package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +4 -3
  71. package/project/.sdk/src/cmp/elixir/fragment/EntityPatchOp.fragment.ex +4 -3
  72. package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -3
  73. package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +4 -3
  74. package/project/.sdk/src/cmp/elixir/utility_elixir.ts +12 -0
  75. package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +8 -5
  76. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +3 -1
  77. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +20 -8
  78. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +16 -13
  79. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +14 -13
  80. package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +14 -13
  81. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +10 -8
  82. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +6 -2
  83. package/project/.sdk/src/cmp/go/utility_go.ts +1 -1
  84. package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +8 -19
  85. package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +19 -22
  86. package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +10 -9
  87. package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +24 -28
  88. package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +27 -35
  89. package/project/.sdk/src/cmp/java/ReadmeTopQuick_java.ts +22 -25
  90. package/project/.sdk/src/cmp/java/ReadmeTopTest_java.ts +18 -24
  91. package/project/.sdk/src/cmp/java/utility_java.ts +25 -0
  92. package/project/.sdk/src/cmp/js/EntityOperation_js.ts +3 -1
  93. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +2 -8
  94. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +11 -9
  95. package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +9 -9
  96. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +7 -13
  97. package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +14 -15
  98. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +16 -11
  99. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +11 -7
  100. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +1 -1
  101. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +1 -1
  102. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +1 -1
  103. package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +1 -1
  104. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +1 -1
  105. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +1 -1
  106. package/project/.sdk/src/cmp/js/utility_js.ts +2 -1
  107. package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +3 -2
  108. package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +19 -9
  109. package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +10 -9
  110. package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +14 -9
  111. package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +18 -15
  112. package/project/.sdk/src/cmp/kotlin/ReadmeTopQuick_kotlin.ts +14 -8
  113. package/project/.sdk/src/cmp/kotlin/ReadmeTopTest_kotlin.ts +17 -10
  114. package/project/.sdk/src/cmp/kotlin/utility_kotlin.ts +21 -1
  115. package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +3 -2
  116. package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +7 -4
  117. package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +9 -7
  118. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +13 -13
  119. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +20 -9
  120. package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +9 -8
  121. package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +15 -7
  122. package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +6 -5
  123. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +1 -0
  124. package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +1 -1
  125. package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +1 -1
  126. package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +1 -1
  127. package/project/.sdk/src/cmp/lua/fragment/EntityPatchOp.fragment.lua +1 -1
  128. package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +1 -1
  129. package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +1 -1
  130. package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +3 -2
  131. package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +3 -2
  132. package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +1 -0
  133. package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +5 -3
  134. package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +10 -8
  135. package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -2
  136. package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +3 -2
  137. package/project/.sdk/src/cmp/ocaml/utility_ocaml.ts +13 -1
  138. package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +4 -1
  139. package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +10 -5
  140. package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +6 -6
  141. package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +8 -5
  142. package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +21 -18
  143. package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +6 -3
  144. package/project/.sdk/src/cmp/perl/ReadmeTopTest_perl.ts +11 -8
  145. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +1 -1
  146. package/project/.sdk/src/cmp/perl/fragment/EntityCreateOp.fragment.pm +2 -2
  147. package/project/.sdk/src/cmp/perl/fragment/EntityLoadOp.fragment.pm +2 -2
  148. package/project/.sdk/src/cmp/perl/fragment/EntityPatchOp.fragment.pm +2 -2
  149. package/project/.sdk/src/cmp/perl/fragment/EntityRemoveOp.fragment.pm +1 -1
  150. package/project/.sdk/src/cmp/perl/fragment/EntityUpdateOp.fragment.pm +2 -2
  151. package/project/.sdk/src/cmp/perl/utility_perl.ts +11 -1
  152. package/project/.sdk/src/cmp/php/EntityOperation_php.ts +3 -1
  153. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +4 -3
  154. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +12 -6
  155. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +9 -9
  156. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +3 -2
  157. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +15 -14
  158. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +5 -4
  159. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +13 -7
  160. package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +2 -2
  161. package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +2 -2
  162. package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +2 -2
  163. package/project/.sdk/src/cmp/php/fragment/EntityPatchOp.fragment.php +2 -2
  164. package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +2 -2
  165. package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +2 -2
  166. package/project/.sdk/src/cmp/py/EntityOperation_py.ts +3 -1
  167. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +3 -8
  168. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +9 -9
  169. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +9 -9
  170. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +9 -14
  171. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +23 -30
  172. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +7 -12
  173. package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +8 -7
  174. package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
  175. package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +1 -1
  176. package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +1 -1
  177. package/project/.sdk/src/cmp/py/fragment/EntityPatchOp.fragment.py +1 -1
  178. package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +1 -1
  179. package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
  180. package/project/.sdk/src/cmp/rb/EntityOperation_rb.ts +3 -1
  181. package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +2 -1
  182. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +4 -1
  183. package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +3 -2
  184. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +20 -10
  185. package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +10 -9
  186. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +6 -3
  187. package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +14 -11
  188. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +6 -3
  189. package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +14 -10
  190. package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +2 -1
  191. package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +1 -1
  192. package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +2 -1
  193. package/project/.sdk/src/cmp/rb/fragment/EntityPatchOp.fragment.rb +2 -1
  194. package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +2 -1
  195. package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +2 -1
  196. package/project/.sdk/src/cmp/rb/utility_rb.ts +10 -0
  197. package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +3 -2
  198. package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +6 -2
  199. package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +3 -2
  200. package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -4
  201. package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +3 -2
  202. package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +7 -6
  203. package/project/.sdk/src/cmp/rust/utility_rust.ts +13 -1
  204. package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +5 -2
  205. package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +8 -19
  206. package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +17 -22
  207. package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +10 -9
  208. package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +18 -28
  209. package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +25 -35
  210. package/project/.sdk/src/cmp/scala/ReadmeTopQuick_scala.ts +14 -25
  211. package/project/.sdk/src/cmp/scala/ReadmeTopTest_scala.ts +16 -24
  212. package/project/.sdk/src/cmp/scala/utility_scala.ts +25 -0
  213. package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +1 -1
  214. package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +3 -2
  215. package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +22 -8
  216. package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +10 -9
  217. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +16 -8
  218. package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +20 -15
  219. package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +12 -7
  220. package/project/.sdk/src/cmp/swift/ReadmeTopTest_swift.ts +21 -10
  221. package/project/.sdk/src/cmp/swift/utility_swift.ts +14 -1
  222. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +2 -8
  223. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +11 -9
  224. package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +9 -9
  225. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +7 -13
  226. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +14 -23
  227. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +8 -14
  228. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +29 -14
  229. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +1 -1
  230. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
  231. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +1 -1
  232. package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +1 -1
  233. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +1 -1
  234. package/project/.sdk/src/cmp/ts/utility_ts.ts +2 -1
  235. package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +3 -2
  236. package/project/.sdk/src/cmp/zig/ReadmeHowto_zig.ts +6 -2
  237. package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +4 -3
  238. package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -4
  239. package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +3 -2
  240. package/project/.sdk/src/cmp/zig/ReadmeTopTest_zig.ts +7 -6
  241. package/project/.sdk/src/cmp/zig/utility_zig.ts +13 -0
  242. package/project/.sdk/tm/c/utility/transform_request.c +1 -1
  243. package/project/.sdk/tm/clojure/src/sdk/core.clj +32 -26
  244. package/project/.sdk/tm/clojure/test/sdk/test/concurrency.clj +136 -0
  245. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +3 -1
  246. package/project/.sdk/tm/cpp/core/types.hpp +36 -6
  247. package/project/.sdk/tm/cpp/test/concurrency_test.cpp +348 -0
  248. package/project/.sdk/tm/cpp/utility/pipeline.hpp +42 -25
  249. package/project/.sdk/tm/csharp/core/Context.cs +8 -5
  250. package/project/.sdk/tm/csharp/test/ConcurrencyTest.cs +238 -0
  251. package/project/.sdk/tm/csharp/utility/Clean.cs +12 -10
  252. package/project/.sdk/tm/csharp/utility/TransformRequest.cs +1 -1
  253. package/project/.sdk/tm/elixir/lib/projectname/context.ex +3 -0
  254. package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +2 -1
  255. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +31 -10
  256. package/project/.sdk/tm/elixir/test/concurrency_test.exs +176 -0
  257. package/project/.sdk/tm/go/core/context.go +5 -1
  258. package/project/.sdk/tm/go/test/concurrency_test.go +214 -0
  259. package/project/.sdk/tm/go/utility/transform_request.go +1 -1
  260. package/project/.sdk/tm/java/core/Context.java +6 -3
  261. package/project/.sdk/tm/java/test/ConcurrencyTest.java +221 -0
  262. package/project/.sdk/tm/java/utility/Clean.java +22 -17
  263. package/project/.sdk/tm/java/utility/TransformRequest.java +1 -1
  264. package/project/.sdk/tm/js/src/utility/TransformRequestUtility.js +1 -1
  265. package/project/.sdk/tm/kotlin/core/Context.kt +5 -3
  266. package/project/.sdk/tm/kotlin/test/ConcurrencyTest.kt +193 -0
  267. package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +1 -1
  268. package/project/.sdk/tm/lua/utility/transform_request.lua +1 -1
  269. package/project/.sdk/tm/ocaml/Makefile +21 -8
  270. package/project/.sdk/tm/ocaml/sdk_runtime.ml +27 -12
  271. package/project/.sdk/tm/ocaml/sdk_types.ml +6 -2
  272. package/project/.sdk/tm/ocaml/test/concurrency_test.ml +148 -0
  273. package/project/.sdk/tm/perl/utility/transform_request.pm +1 -1
  274. package/project/.sdk/tm/php/feature/TestFeature.php +9 -9
  275. package/project/.sdk/tm/php/utility/TransformRequest.php +1 -1
  276. package/project/.sdk/tm/py/pkg/core/context.py +2 -2
  277. package/project/.sdk/tm/py/pkg/utility/clean.py +12 -8
  278. package/project/.sdk/tm/py/pkg/utility/transform_request.py +1 -1
  279. package/project/.sdk/tm/py/test/test_concurrency.py +177 -0
  280. package/project/.sdk/tm/rb/core/context.rb +8 -3
  281. package/project/.sdk/tm/rb/test/concurrency_test.rb +160 -0
  282. package/project/.sdk/tm/rb/utility/clean.rb +8 -7
  283. package/project/.sdk/tm/rb/utility/transform_request.rb +1 -1
  284. package/project/.sdk/tm/rust/utility/transform_request.rs +1 -1
  285. package/project/.sdk/tm/scala/Makefile +2 -0
  286. package/project/.sdk/tm/scala/core/Context.scala +6 -4
  287. package/project/.sdk/tm/scala/sdktest/ConcurrencyTest.scala +186 -0
  288. package/project/.sdk/tm/scala/utility/Transform.scala +1 -1
  289. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +2 -0
  290. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +35 -12
  291. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/ConcurrencyTest.swift +214 -0
  292. package/project/.sdk/tm/ts/src/utility/TransformRequestUtility.ts +1 -1
  293. package/project/.sdk/tm/zig/core/utility.zig +1 -1
  294. package/project/.sdk/tm/zig/feature/test.zig +10 -8
  295. package/project/sdkgen-package.json +1 -1
  296. package/src/cmp/ReadmeErrors.ts +5 -5
  297. package/src/cmp/ReadmeExplanation.ts +4 -5
  298. package/src/cmp/ReadmeQuick.ts +3 -1
  299. package/src/cmp/ReadmeTop.ts +10 -12
  300. package/src/helpers/definitionPlan.ts +8 -4
  301. package/src/helpers/naming.ts +12 -4
  302. package/src/helpers/opExample.ts +97 -25
  303. package/src/helpers/opShape.ts +25 -9
  304. package/src/sdkgen.ts +14 -3
  305. package/src/utility.ts +31 -4
@@ -10,6 +10,7 @@ import {
10
10
  canonKey,
11
11
  canonScalarKey,
12
12
  canonToType,
13
+ requiredItems,
13
14
  } from '@voxgig/sdkgen'
14
15
 
15
16
 
@@ -25,6 +26,7 @@ function elixirType(sentinel: unknown): string {
25
26
 
26
27
  function elixirLit(sentinel: unknown, placeholder: string = 'example'): string {
27
28
  switch (canonScalarKey(sentinel)) {
29
+ case 'NULL': return 'nil'
28
30
  case 'INTEGER':
29
31
  case 'NUMBER': return '1'
30
32
  case 'BOOLEAN': return 'true'
@@ -35,6 +37,15 @@ function elixirLit(sentinel: unknown, placeholder: string = 'example'): string {
35
37
  }
36
38
 
37
39
 
40
+ // A list's required route and query parameters, as the match argument after the entity.
41
+ function elixirListArgs(entity: any, name: string): string {
42
+ const items = requiredItems(entity, 'list')
43
+ return 0 < items.length
44
+ ? `, ${name}.Helpers.deep(%{${items.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
45
+ : ''
46
+ }
47
+
48
+
38
49
  function projectPath(suffix?: string): string {
39
50
  return Path.normalize(Path.join(__dirname, '../../..', suffix ?? ''))
40
51
  }
@@ -137,5 +148,6 @@ export {
137
148
  elixirString,
138
149
  elixirType,
139
150
  elixirLit,
151
+ elixirListArgs,
140
152
  projectPath,
141
153
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, entityIdField, entityOps, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, entityIdField, entityOps, opRequestShape, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -117,7 +117,7 @@ ${eVar}, err := client.${entity.Name}(nil).Load(${loadArg}, nil)
117
117
  if err != nil {
118
118
  panic(err)
119
119
  }
120
- fmt.Println(${eVar}) // the loaded record
120
+ fmt.Println(${eVar}.(sdk.Entity).Data()) // the loaded entity's record
121
121
  \`\`\`
122
122
 
123
123
  `)
@@ -127,11 +127,14 @@ fmt.Println(${eVar}) // the loaded record
127
127
  Content(`#### Example: List
128
128
 
129
129
  \`\`\`go
130
- ${eVar}s, err := client.${entity.Name}(nil).List(nil, nil)
130
+ ${eVar}s, err := client.${entity.Name}(nil).List(${listMatchArg('go', entity)}, nil)
131
131
  if err != nil {
132
132
  panic(err)
133
133
  }
134
- fmt.Println(${eVar}s) // the array of records
134
+ // A []any of entities, one per record.
135
+ for _, item := range ${eVar}s.([]any) {
136
+ fmt.Println(item.(sdk.Entity).Data())
137
+ }
135
138
  \`\`\`
136
139
 
137
140
  `)
@@ -158,7 +161,7 @@ result, err := client.${entity.Name}(nil).Create(map[string]any{
158
161
  if err != nil {
159
162
  panic(err)
160
163
  }
161
- fmt.Println(result)
164
+ fmt.Println(result.(sdk.Entity).Data()) // the created entity's record
162
165
  \`\`\`
163
166
 
164
167
  `)
@@ -14,7 +14,9 @@ The Go SDK uses \`map[string]any\` throughout rather than typed structs.
14
14
  This mirrors the dynamic nature of the API and keeps the SDK
15
15
  flexible \u2014 no code generation is needed when the API schema changes.
16
16
 
17
- Use \`core.ToMapAny()\` to safely cast results and nested data.
17
+ An operation returns the entity, and its \`Data()\` returns the record. Use
18
+ \`core.ToMapAny()\` to safely cast that record, or data nested in it, to
19
+ \`map[string]any\`: it returns \`nil\` for anything else, an entity included.
18
20
 
19
21
  ### Package structure
20
22
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, goModule } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, goModule, requiredItems, litPair } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -12,6 +12,7 @@ import { goVarName } from './utility_go'
12
12
 
13
13
  function goLit(type: any): string {
14
14
  const k = canonScalarKey(type)
15
+ if ('NULL' === k) return 'nil'
15
16
  if ('INTEGER' === k || 'NUMBER' === k) return '1'
16
17
  if ('BOOLEAN' === k) return 'true'
17
18
  if ('ARRAY' === k) return '[]any{}'
@@ -41,32 +42,43 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
41
42
  const idF = exampleEntity ? entityIdField(exampleEntity) : null
42
43
  const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
43
44
  let testArg = 'nil'
44
- if (exampleEntity && isMatchOp) {
45
- const items = opRequestShape(exampleEntity, primaryOp).items
46
- .filter((it: any) => !it.optional || it.name === idF)
45
+ if (exampleEntity && (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length))) {
46
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
47
+ .filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
47
48
  .sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
48
49
  testArg = 0 < items.length
49
- ? `map[string]any{${items.map((it: any) => `"${it.name}": ${it.name === idF ? '"test01"' : goLit(it.type)}`).join(', ')}}`
50
+ ? `map[string]any{${items.map((it: any) => litPair('go', it.name, isMatchOp && it.name === idF ? '"test01"' : goLit(it.type))).join(', ')}}`
50
51
  : 'nil'
51
52
  } else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
52
53
  const items = opRequestShape(exampleEntity, primaryOp).items
53
54
  .filter((it: any) => it.name !== idF && it.name !== 'id')
54
55
  const required = items.filter((it: any) => !it.optional)
55
56
  const chosen = required.length ? required : items.slice(0, 3)
56
- testArg = `map[string]any{${chosen.map((it: any) => `"${it.name}": ${goLit(it.type)}`).join(', ')}}`
57
+ testArg = `map[string]any{${chosen.map((it: any) => litPair('go', it.name, goLit(it.type))).join(', ')}}`
57
58
  }
58
59
 
59
60
  // The op-driven test-mode block, shown only when the SDK has an entity op.
60
61
  // A direct()-only SDK (no ops anywhere) shows a Direct() call instead — never
61
62
  // a fabricated method (`cap(primaryOp)` would also fail on a null op).
62
- const testModeExample = primaryOp
63
+ const testModeExample = 'list' === primaryOp
64
+ ? `${eLower}s, err := client.${eName}(nil).List(
65
+ ${testArg}, nil,
66
+ )
67
+ if err != nil {
68
+ panic(err)
69
+ }
70
+ // A []any of entities, one per mock record.
71
+ for _, item := range ${eLower}s.([]any) {
72
+ fmt.Println(item.(sdk.Entity).Data())
73
+ }`
74
+ : primaryOp
63
75
  ? `${eLower}, err := client.${eName}(nil).${cap(primaryOp)}(
64
76
  ${testArg}, nil,
65
77
  )
66
78
  if err != nil {
67
79
  panic(err)
68
80
  }
69
- fmt.Println(${eLower}) // the returned mock data`
81
+ fmt.Println(${eLower}.(sdk.Entity).Data()) // the entity's mock record`
70
82
  : `result, err := client.Direct(map[string]any{"path": "/api/resource", "method": "GET"})
71
83
  if err != nil {
72
84
  panic(err)
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, isAuthActive, entityIdField, entityPrimaryOp, goModule } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, isAuthActive, entityIdField, entityPrimaryOp, goModule, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -24,12 +24,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
24
24
  entityList.forEach((e: any) => Object.keys(e.op || {})
25
25
  .forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
26
26
  const opRowDefs: Record<string, string> = {
27
- load: '| `Load` | `(reqmatch, ctrl map[string]any) (any, error)` | Load a single entity by match criteria. |',
28
- list: '| `List` | `(reqmatch, ctrl map[string]any) (any, error)` | List entities matching the criteria. |',
29
- create: '| `Create` | `(reqdata, ctrl map[string]any) (any, error)` | Create a new entity. |',
30
- update: '| `Update` | `(reqdata, ctrl map[string]any) (any, error)` | Update an existing entity. |',
31
- patch: '| `Patch` | `(reqdata, ctrl map[string]any) (any, error)` | Change part of an existing entity. |',
32
- remove: '| `Remove` | `(reqmatch, ctrl map[string]any) (any, error)` | Remove an entity. |',
27
+ load: '| `Load` | `(reqmatch, ctrl map[string]any) (any, error)` | Load a single entity by match criteria, and return it. |',
28
+ list: '| `List` | `(reqmatch, ctrl map[string]any) (any, error)` | List entities matching the criteria, one per record. |',
29
+ create: '| `Create` | `(reqdata, ctrl map[string]any) (any, error)` | Create a new entity, and return it. |',
30
+ update: '| `Update` | `(reqdata, ctrl map[string]any) (any, error)` | Update an existing entity, and return it. |',
31
+ patch: '| `Patch` | `(reqdata, ctrl map[string]any) (any, error)` | Change part of an existing entity, and return it. |',
32
+ remove: '| `Remove` | `(reqmatch, ctrl map[string]any) (any, error)` | Remove an entity, and return it marked as deleted. |',
33
33
  }
34
34
  const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
35
35
  .filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
@@ -37,8 +37,8 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
37
37
  const recordOps = ['load', 'create', 'update', 'patch', 'remove'].filter((o) => opUnion.has(o))
38
38
  .map((o) => '`' + o.charAt(0).toUpperCase() + o.slice(1) + '`')
39
39
  const resultRows: string[] = []
40
- if (recordOps.length) resultRows.push('| ' + recordOps.join(' / ') + ' | the entity record (`map[string]any`) |')
41
- if (opUnion.has('list')) resultRows.push('| `List` | a `[]any` of entity records |')
40
+ if (recordOps.length) resultRows.push('| ' + recordOps.join(' / ') + ' | the entity, whose `Data()` reads its record (`map[string]any`) |')
41
+ if (opUnion.has('list')) resultRows.push('| `List` | a `[]any` of entities, one per record |')
42
42
  const resultShapeRows = resultRows.join('\n')
43
43
 
44
44
  const gomodule = goModule(model, target.name)
@@ -62,7 +62,8 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
62
62
  const firstIsMatchOp = 'load' === firstPrimaryOp || 'remove' === firstPrimaryOp
63
63
  const firstOpArg = firstIsMatchOp
64
64
  ? (firstIdF ? `map[string]any{"${firstIdF}": "example_id"}` : 'nil')
65
- : 'map[string]any{/* fields */}'
65
+ : 'list' === firstPrimaryOp ? listMatchArg('go', firstWithOp)
66
+ : 'map[string]any{/* fields */}'
66
67
 
67
68
  const resultCallExample = firstPrimaryOp
68
69
  ? `Check \`err\` first, then use the value directly (or the typed
@@ -71,7 +72,9 @@ slice):
71
72
 
72
73
  ${firstEntityVar}, err := client.${firstEntityName}(nil).${firstPrimaryMethod}(${firstOpArg}, nil)
73
74
  if err != nil { /* handle */ }
74
- // ${firstEntityVar} is the returned record
75
+ // ${'list' === firstPrimaryOp
76
+ ? `${firstEntityVar} is a []any of entities, one per record`
77
+ : `${firstEntityVar} is the entity; ${firstEntityVar}.(sdk.Entity).Data() reads its record`}
75
78
 
76
79
  `
77
80
  : ''
@@ -132,8 +135,8 @@ ${opRows}
132
135
 
133
136
  ### Result shape
134
137
 
135
- Entity operations return \`(value, error)\`. The \`value\` is the
136
- operation's data **directly** — there is no wrapper:
138
+ Entity operations return \`(value, error)\`. The \`value\` is the entity
139
+ itself — there is no wrapper:
137
140
 
138
141
  | Operation | \`value\` |
139
142
  | --- | --- |
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, opRequestShape, entityIdField, entityOps, goModule , serverVariables} from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, opRequestShape, entityIdField, entityOps, goModule, serverVariables, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -80,25 +80,25 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
80
80
  }
81
81
 
82
82
  if (opnames.includes('list')) {
83
- body.push(` // List ${eLower} records — the value is the array of records itself.`)
84
- body.push(` ${eLower}s, err := client.${eName}(nil).List(nil, nil)`)
83
+ body.push(` // List ${eLower} records — the value is a []any of entities, one per record.`)
84
+ body.push(` ${eLower}s, err := client.${eName}(nil).List(${listMatchArg('go', exampleEntity)}, nil)`)
85
85
  body.push(` if err != nil {`)
86
86
  body.push(` panic(err)`)
87
87
  body.push(` }`)
88
88
  body.push(` for _, item := range ${eLower}s.([]any) {`)
89
- body.push(` fmt.Println(item)`)
89
+ body.push(` fmt.Println(item.(sdk.Entity).Data())`)
90
90
  body.push(` }`)
91
91
  body.push(``)
92
92
  usesFmt = true
93
93
  }
94
94
 
95
95
  if (opnames.includes('load')) {
96
- body.push(` // Load a single ${eLower} — the value is the loaded record.`)
96
+ body.push(` // Load a single ${eLower} — the value is the entity; Data() reads its record.`)
97
97
  body.push(` ${eLower}, err := client.${eName}(nil).Load(${matchArg('load')}, nil)`)
98
98
  body.push(` if err != nil {`)
99
99
  body.push(` panic(err)`)
100
100
  body.push(` }`)
101
- body.push(` fmt.Println(${eLower})`)
101
+ body.push(` fmt.Println(${eLower}.(sdk.Entity).Data())`)
102
102
  body.push(``)
103
103
  usesFmt = true
104
104
  }
@@ -109,7 +109,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
109
109
  body.push(` if err != nil {`)
110
110
  body.push(` panic(err)`)
111
111
  body.push(` }`)
112
- body.push(` fmt.Println(created)`)
112
+ body.push(` fmt.Println(created.(sdk.Entity).Data())`)
113
113
  body.push(``)
114
114
  usesFmt = true
115
115
  }
@@ -125,7 +125,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
125
125
  body.push(` if err != nil {`)
126
126
  body.push(` panic(err)`)
127
127
  body.push(` }`)
128
- body.push(` fmt.Println(updated)`)
128
+ body.push(` fmt.Println(updated.(sdk.Entity).Data())`)
129
129
  body.push(``)
130
130
  usesFmt = true
131
131
  }
@@ -139,7 +139,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
139
139
  body.push(` if err != nil {`)
140
140
  body.push(` panic(err)`)
141
141
  body.push(` }`)
142
- body.push(` fmt.Println(patched)`)
142
+ body.push(` fmt.Println(patched.(sdk.Entity).Data())`)
143
143
  body.push(``)
144
144
  usesFmt = true
145
145
  }
@@ -150,7 +150,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
150
150
  body.push(` if err != nil {`)
151
151
  body.push(` panic(err)`)
152
152
  body.push(` }`)
153
- body.push(` fmt.Println(removed)`)
153
+ body.push(` fmt.Println(removed.(sdk.Entity).Data())`)
154
154
  body.push(``)
155
155
  usesFmt = true
156
156
  }
@@ -185,9 +185,10 @@ func main() {
185
185
  Content(`### Quickstart
186
186
 
187
187
  A complete program: create a client, then call the entity operations.
188
- Each operation returns \`(value, error)\` — the value is the data itself
189
- (there is no \`{ok, data}\` wrapper), so check \`err\` and use the value
190
- directly.
188
+ Each operation returns \`(value, error)\` — the value is the entity, and for
189
+ \`List\` a \`[]any\` of entities, one per record (there is no \`{ok, data}\`
190
+ wrapper), so check \`err\` and read a record through the entity's
191
+ \`Data()\`.
191
192
 
192
193
  \`\`\`go
193
194
  ${program}
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, entityOps, opRequestShape , targetFeatures, bodyNote } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, entityOps, opRequestShape, targetFeatures, bodyNote, listMatchArg } from '@voxgig/sdkgen'
3
3
  import { ReadmeRefFeatures } from '@voxgig/sdkgen'
4
4
 
5
5
  import {
@@ -14,33 +14,32 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
14
14
  load: {
15
15
  sig: 'Load(reqmatch, ctrl map[string]any) (any, error)',
16
16
  returns: '(any, error)',
17
- desc: 'Load a single entity matching the given criteria.',
17
+ desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `Data()` reads; `err` is non-nil on failure.',
18
18
  },
19
19
  list: {
20
20
  sig: 'List(reqmatch, ctrl map[string]any) (any, error)',
21
21
  returns: '(any, error)',
22
- desc: 'List entities matching the given criteria. Returns an array.',
22
+ desc: 'List entities matching the given criteria. Returns a `[]any` of entities, one per record; `err` is non-nil on failure.',
23
23
  },
24
24
  create: {
25
25
  sig: 'Create(reqdata, ctrl map[string]any) (any, error)',
26
26
  returns: '(any, error)',
27
- desc: 'Create a new entity with the given data.',
27
+ desc: 'Create a new entity with the given data. Returns the created entity; `err` is non-nil on failure.',
28
28
  },
29
29
  update: {
30
30
  sig: 'Update(reqdata, ctrl map[string]any) (any, error)',
31
31
  returns: '(any, error)',
32
- desc: 'Update an existing entity. The data must include the entity `id`.',
32
+ desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity; `err` is non-nil on failure.',
33
33
  },
34
34
  patch: {
35
35
  sig: 'Patch(reqdata, ctrl map[string]any) (any, error)',
36
36
  returns: '(any, error)',
37
- desc: 'Change part of an existing entity: only the fields given are sent. ' +
38
- 'The data must include the entity `id`.',
37
+ desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity; `err` is non-nil on failure.',
39
38
  },
40
39
  remove: {
41
40
  sig: 'Remove(reqmatch, ctrl map[string]any) (any, error)',
42
41
  returns: '(any, error)',
43
- desc: 'Remove the entity matching the given criteria.',
42
+ desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted; `err` is non-nil on failure.',
44
43
  },
45
44
  }
46
45
 
@@ -278,18 +277,20 @@ result, err := client.${ent.Name}(nil).${goOpName}(${arg}, nil)
278
277
  if err != nil {
279
278
  panic(err)
280
279
  }
281
- fmt.Println(result)
280
+ fmt.Println(result.(sdk.Entity).Data())
282
281
  \`\`\`
283
282
 
284
283
  `)
285
284
  }
286
285
  else if ('list' === opname) {
287
286
  Content(`\`\`\`go
288
- results, err := client.${ent.Name}(nil).List(nil, nil)
287
+ results, err := client.${ent.Name}(nil).List(${listMatchArg('go', ent)}, nil)
289
288
  if err != nil {
290
289
  panic(err)
291
290
  }
292
- fmt.Println(results)
291
+ for _, item := range results.([]any) {
292
+ fmt.Println(item.(sdk.Entity).Data())
293
+ }
293
294
  \`\`\`
294
295
 
295
296
  `)
@@ -313,7 +314,7 @@ result, err := client.${ent.Name}(nil).Create(map[string]any{
313
314
  if err != nil {
314
315
  panic(err)
315
316
  }
316
- fmt.Println(result)
317
+ fmt.Println(result.(sdk.Entity).Data())
317
318
  \`\`\`
318
319
 
319
320
  `)
@@ -336,7 +337,7 @@ ${updateLines} // ${'patch' === opname ? 'Only the fields to change' : 'Field
336
337
  if err != nil {
337
338
  panic(err)
338
339
  }
339
- fmt.Println(result)
340
+ fmt.Println(result.(sdk.Entity).Data())
340
341
  \`\`\`
341
342
 
342
343
  `)
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, entityIdField, entityOps, opRequestShape, goModule , serverVariables} from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, entityIdField, entityOps, opRequestShape, goModule, serverVariables, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -51,12 +51,14 @@ client := ${ctor}
51
51
  let hasCall = false
52
52
 
53
53
  if (opnames.includes('list')) {
54
- Content(`// List all ${eName.toLowerCase()}s
55
- ${eVar}s, err := client.${eName}(nil).List(nil, nil)
54
+ Content(`// List all ${eName.toLowerCase()}s (one entity per record; err is non-nil on failure)
55
+ ${eVar}s, err := client.${eName}(nil).List(${listMatchArg('go', exampleEntity)}, nil)
56
56
  if err != nil {
57
57
  panic(err)
58
58
  }
59
- fmt.Println(${eVar}s)
59
+ for _, ${eVar} := range ${eVar}s.([]any) {
60
+ fmt.Println(${eVar}.(sdk.Entity).Data())
61
+ }
60
62
  `)
61
63
  hasCall = true
62
64
  }
@@ -87,14 +89,14 @@ fmt.Println(${eVar}s)
87
89
  it.name === neIdF ? 'example_id' : 'example_' + it.name)}`)
88
90
 
89
91
  Content(`
90
- // Load a specific ${neName.toLowerCase()}
92
+ // Load a specific ${neName.toLowerCase()} (returns the entity; err is non-nil on failure)
91
93
  ${neVar}, err := client.${neName}(nil).Load(
92
94
  map[string]any{${neMatchPairs.join(', ')}}, nil,
93
95
  )
94
96
  if err != nil {
95
97
  panic(err)
96
98
  }
97
- fmt.Println(${neVar})
99
+ fmt.Println(${neVar}.(sdk.Entity).Data())
98
100
  `)
99
101
  hasCall = true
100
102
  }
@@ -110,12 +112,12 @@ fmt.Println(${neVar})
110
112
  `"${it.name}": ${exampleValue(exampleEntity, exampleEntity.op && exampleEntity.op.load, it.name,
111
113
  it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')}}`
112
114
  : 'nil'
113
- Content(`// Load ${eName.toLowerCase()} data
115
+ Content(`// Load a specific ${eName.toLowerCase()} (returns the entity; err is non-nil on failure)
114
116
  ${eVar}, err := client.${eName}(nil).Load(${loadArg}, nil)
115
117
  if err != nil {
116
118
  panic(err)
117
119
  }
118
- fmt.Println(${eVar})
120
+ fmt.Println(${eVar}.(sdk.Entity).Data())
119
121
  `)
120
122
  hasCall = true
121
123
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, goModule } from '@voxgig/sdkgen'
2
+ import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, goModule, requiredItems, litPair } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -11,6 +11,7 @@ import {
11
11
  // A type-correct Go literal for a field's canonical type.
12
12
  function goLit(type: any): string {
13
13
  const k = canonScalarKey(type)
14
+ if ('NULL' === k) return 'nil'
14
15
  if ('INTEGER' === k || 'NUMBER' === k) return '1'
15
16
  if ('BOOLEAN' === k) return 'true'
16
17
  if ('ARRAY' === k) return '[]any{}'
@@ -45,12 +46,15 @@ client := sdk.Test()
45
46
  let arg = 'nil'
46
47
  if (isMatchOp) {
47
48
  arg = idF ? `map[string]any{"${idF}": "test01"}` : 'nil'
49
+ } else if ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
50
+ const chosen = requiredItems(exampleEntity, 'list')
51
+ arg = `map[string]any{${chosen.map((it: any) => litPair('go', it.name, goLit(it.type))).join(', ')}}`
48
52
  } else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
49
53
  const items = opRequestShape(exampleEntity, primaryOp).items
50
54
  .filter((it: any) => it.name !== idF && it.name !== 'id')
51
55
  const required = items.filter((it: any) => !it.optional)
52
56
  const chosen = required.length ? required : items.slice(0, 3)
53
- arg = `map[string]any{${chosen.map((it: any) => `"${it.name}": ${goLit(it.type)}`).join(', ')}}`
57
+ arg = `map[string]any{${chosen.map((it: any) => litPair('go', it.name, goLit(it.type))).join(', ')}}`
54
58
  }
55
59
  Content(`result, err := client.${eName}(nil).${cap(primaryOp)}(
56
60
  ${arg}, nil,
@@ -68,7 +68,7 @@ function exampleValue(entity: any, op: any, paramName: string, placeholder: stri
68
68
  if ('NULL' === key) {
69
69
  return 'nil'
70
70
  }
71
- return `"${placeholder}"`
71
+ return formatGoString(placeholder)
72
72
  }
73
73
 
74
74
 
@@ -1,28 +1,16 @@
1
1
 
2
- import { cmp, each, Content, canonToType, canonKey, canonScalarKey, entityIdField, opRequestShape, opNeedsAction } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, opNeedsAction, javaMap, javaMapOf } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
6
6
  getModelPath,
7
7
  } from '@voxgig/apidef'
8
8
 
9
- import { javaVarName } from './utility_java'
9
+ import { javaVarName, javaListMatch, javaLit } from './utility_java'
10
10
 
11
11
 
12
12
  // Type names come from the shared canonToType 'java' column (single source of truth).
13
13
 
14
- // A type-correct, JSON-serialisable Java literal for a field's canonical type.
15
- function javaLit(type: any, placeholder: string = 'example'): string {
16
- const k = canonScalarKey(type)
17
- if ('INTEGER' === k) return '1L'
18
- if ('NUMBER' === k) return '1.0'
19
- if ('BOOLEAN' === k) return 'true'
20
- if ('ARRAY' === k) return 'List.of()'
21
- if ('OBJECT' === k) return 'Map.of()'
22
- return `"${placeholder}"`
23
- }
24
-
25
-
26
14
  // Operation method spelling for Java: camelCase methods over the loose object
27
15
  // model. The op descriptions are language-agnostic.
28
16
  const OP_DESC: Record<string, { method: string, desc: string }> = {
@@ -124,9 +112,9 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
124
112
  .sort((a: any, b: any) =>
125
113
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
126
114
  const loadArg = 0 < loadItems.length
127
- ? `Map.of(${loadItems.map((it: any) =>
115
+ ? javaMapOf(loadItems.map((it: any) =>
128
116
  `"${it.name}", ${javaLit(it.type,
129
- it.name === idF ? entity.name + '_id' : it.name)}`).join(', ')})`
117
+ it.name === idF ? entity.name + '_id' : it.name)}`))
130
118
  : 'null'
131
119
  Content(`#### Example: Load
132
120
 
@@ -141,7 +129,7 @@ Object ${eVar} = client.${accessor}(null).load(${loadArg}, null);
141
129
  Content(`#### Example: List
142
130
 
143
131
  \`\`\`java
144
- Object ${eVar}List = client.${accessor}(null).list(null, null);
132
+ Object ${eVar}List = client.${accessor}(null).list(${javaListMatch(entity)}, null);
145
133
  \`\`\`
146
134
 
147
135
  `)
@@ -153,14 +141,15 @@ Object ${eVar}List = client.${accessor}(null).list(null, null);
153
141
  // required id and parent keys like page_id — with a real literal.
154
142
  const createItems = opRequestShape(entity, 'create').items
155
143
  .filter((it: any) => !it.optional)
144
+ const createMap = javaMap(createItems.length)
156
145
  Content(`#### Example: Create
157
146
 
158
147
  \`\`\`java
159
- Object ${eVar} = client.${accessor}(null).create(Map.of(
148
+ Object ${eVar} = client.${accessor}(null).create(${createMap.open}
160
149
  `)
161
150
  createItems.map((it: any, i: number) => {
162
151
  const comma = i < createItems.length - 1 ? ',' : ''
163
- Content(` "${it.name}", ${javaLit(it.type, 'example_' + it.name)}${comma} // ${canonToType(it.type, target.name)}
152
+ Content(` ${createMap.pair(`"${it.name}", ${javaLit(it.type, 'example_' + it.name)}`)}${comma} // ${canonToType(it.type, target.name)}
164
153
  `)
165
154
  })
166
155
  Content(`), null);
@@ -1,24 +1,12 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems, javaMapOf } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
6
6
  getModelPath,
7
7
  } from '@voxgig/apidef'
8
8
 
9
- import { javaVarName } from './utility_java'
10
-
11
-
12
- // A type-correct Java literal for a field's canonical type.
13
- function javaLit(type: any): string {
14
- const k = canonScalarKey(type)
15
- if ('INTEGER' === k) return '1L'
16
- if ('NUMBER' === k) return '1.0'
17
- if ('BOOLEAN' === k) return 'true'
18
- if ('ARRAY' === k) return 'List.of()'
19
- if ('OBJECT' === k) return 'Map.of()'
20
- return '"example"'
21
- }
9
+ import { javaVarName, javaLit } from './utility_java'
22
10
 
23
11
 
24
12
  const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
@@ -39,23 +27,32 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
39
27
  let testArg = 'null'
40
28
  if (exampleEntity && isMatchOp) {
41
29
  testArg = idF ? `Map.of("${idF}", "test01")` : 'null'
30
+ } else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
31
+ const chosen = requiredItems(exampleEntity, 'list')
32
+ testArg = javaMapOf(chosen.map((it: any) =>
33
+ `${JSON.stringify(it.name)}, ${javaLit(it.type)}`))
42
34
  } else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
43
35
  const items = opRequestShape(exampleEntity, primaryOp).items
44
36
  .filter((it: any) => it.name !== idF && it.name !== 'id')
45
37
  const required = items.filter((it: any) => !it.optional)
46
38
  const chosen = required.length ? required : items.slice(0, 3)
47
- testArg = `Map.of(${chosen.map((it: any) =>
48
- `"${it.name}", ${javaLit(it.type)}`).join(', ')})`
39
+ testArg = javaMapOf(chosen.map((it: any) =>
40
+ `${JSON.stringify(it.name)}, ${javaLit(it.type)}`))
49
41
  }
50
42
 
51
43
  // The op-driven test-mode line, shown only when the SDK has an entity op.
52
44
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
53
- const testModeExample = primaryOp
54
- ? `// Entity ops return the ENTITY and raises on error;
55
- // call data() for the record.
56
- Object ${eVar} = client.${accessor}(null).${primaryOp}(${testArg}, null);
57
- // ${eVar} holds the mock response record
58
- System.out.println(${eVar});`
45
+ const testModeExample = 'list' === primaryOp
46
+ ? `// list returns a list of entities, one per mock record; it raises on error.
47
+ List<?> ${eVar}List = (List<?>) client.${accessor}(null).list(${testArg}, null);
48
+ for (Object ${eVar}Item : ${eVar}List) {
49
+ System.out.println(((SdkEntity) ${eVar}Item).data());
50
+ }`
51
+ : primaryOp
52
+ ? `// Entity ops return the entity; they raise on error.
53
+ SdkEntity ${eVar} = (SdkEntity) client.${accessor}(null).${primaryOp}(${testArg}, null);
54
+ // data() reads the entity's mock record
55
+ System.out.println(${eVar}.data());`
59
56
  : `Map<String, Object> result = client.direct(Map.of(
60
57
  "path", "/api/resource",
61
58
  "method", "GET"));