@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
@@ -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) -> Object` | Load a single entity by match criteria. Raises on error. |',
28
- list: '| `list` | `(reqmatch, ctrl) -> Object` | List entities matching the criteria (an aggregate list). Raises on error. |',
29
- create: '| `create` | `(reqdata, ctrl) -> Object` | Create a new entity. Raises on error. |',
30
- update: '| `update` | `(reqdata, ctrl) -> Object` | Update an existing entity. Raises on error. |',
31
- patch: '| `patch` | `(reqdata, ctrl) -> Object` | Change part of an existing entity. Raises on error. |',
32
- remove: '| `remove` | `(reqmatch, ctrl) -> Object` | Remove an entity. Raises on error. |',
27
+ load: '| `load` | `(reqmatch, ctrl) -> Object` | Load a single entity by match criteria, and return it. Raises on error. |',
28
+ list: '| `list` | `(reqmatch, ctrl) -> Object` | List entities matching the criteria, one per record. Raises on error. |',
29
+ create: '| `create` | `(reqdata, ctrl) -> Object` | Create a new entity, and return it. Raises on error. |',
30
+ update: '| `update` | `(reqdata, ctrl) -> Object` | Update an existing entity, and return it. Raises on error. |',
31
+ patch: '| `patch` | `(reqdata, ctrl) -> Object` | Change part of an existing entity, and return it. Raises on error. |',
32
+ remove: '| `remove` | `(reqmatch, ctrl) -> Object` | Remove an entity, and return it marked as deleted. Raises on error. |',
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')
@@ -94,9 +94,10 @@ ${opRows}
94
94
 
95
95
  ### Result shape
96
96
 
97
- Entity operations return the ENTITY (call data() for the record) (a \`Map\` for single-entity
98
- ops, an aggregate \`List\` for \`list\`) as \`Object\` and raise on error. Wrap
99
- calls in \`try\`/\`catch\` to handle failures.
97
+ Entity operations return the entity, and \`list\` a list of entities, one per
98
+ record, as \`Object\`; an entity is an \`SdkEntity\`, whose \`data()\` reads its
99
+ record. They raise on error, so wrap calls in \`try\`/\`catch\` to handle
100
+ failures.
100
101
 
101
102
  The \`direct()\` escape hatch never raises — it returns a result
102
103
  \`Map<String, Object>\` you branch on via \`result.get("ok")\`:
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, opRequestShape, entityIdField, entityOps , serverVariables} from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityOps , serverVariables, javaMapOf } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -7,7 +7,7 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { javaVarName, javaPackage } from './utility_java'
10
+ import { javaVarName, javaPackage, javaListMatch, javaLit } from './utility_java'
11
11
 
12
12
 
13
13
  const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
@@ -44,23 +44,14 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
44
44
  'options.put("server", server);\n'
45
45
 
46
46
 
47
- // A type-correct Java literal for a param — the loose object model means
48
- // all values live in a Map<String, Object>.
49
- const javaLit = (type: any, placeholder: string = 'example'): string => {
50
- const k = canonScalarKey(type)
51
- if ('INTEGER' === k) return '1L'
52
- if ('NUMBER' === k) return '1.0'
53
- if ('BOOLEAN' === k) return 'true'
54
- if ('ARRAY' === k) return 'List.of()'
55
- if ('OBJECT' === k) return 'Map.of()'
56
- return `"${placeholder}"`
57
- }
58
-
59
47
  if (authActive) {
60
48
  Content(`### 1. Create a client
61
49
 
62
50
  \`\`\`java
51
+ import java.util.List;
52
+ import java.util.Map;
63
53
  import ${javaPackage(model)}.core.${SDK};
54
+ import ${javaPackage(model)}.core.SdkEntity;
64
55
 
65
56
  Map<String, Object> options = new java.util.LinkedHashMap<>();
66
57
  options.put("apikey", System.getenv("${envName(model)}_APIKEY"));
@@ -73,7 +64,10 @@ ${javaServerLines}${SDK} client = new ${SDK}(options);
73
64
  Content(`### 1. Create a client
74
65
 
75
66
  \`\`\`java
67
+ import java.util.List;
68
+ import java.util.Map;
76
69
  import ${javaPackage(model)}.core.${SDK};
70
+ import ${javaPackage(model)}.core.SdkEntity;
77
71
 
78
72
  ${'' === javaServerLines
79
73
  ? `${SDK} client = new ${SDK}();`
@@ -96,13 +90,15 @@ ${'' === javaServerLines
96
90
  if (opnames.includes('list')) {
97
91
  Content(`### 2. List ${eName.toLowerCase()} records
98
92
 
99
- \`list(null, null)\` returns an aggregate list of records (as \`Object\`, an
100
- aggregate list) and raises on error.
93
+ \`list(null, null)\` returns a list of entities, one per record (as \`Object\`),
94
+ and raises on error; an entity's \`data()\` reads its record.
101
95
 
102
96
  \`\`\`java
103
97
  try {
104
- Object ${eVar}List = client.${accessor}(null).list(null, null);
105
- System.out.println(${eVar}List);
98
+ List<?> ${eVar}List = (List<?>) client.${accessor}(null).list(${javaListMatch(exampleEntity)}, null);
99
+ for (Object ${eVar}Item : ${eVar}List) {
100
+ System.out.println(((SdkEntity) ${eVar}Item).data());
101
+ }
106
102
  }
107
103
  catch (RuntimeException err) {
108
104
  System.out.println("list failed: " + err.getMessage());
@@ -139,8 +135,8 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
139
135
 
140
136
  \`\`\`java
141
137
  try {
142
- Object ${neVar} = client.${neAccessor}(null).load(Map.of(${neMatch.join(', ')}), null);
143
- System.out.println(${neVar});
138
+ SdkEntity ${neVar} = (SdkEntity) client.${neAccessor}(null).load(${javaMapOf(neMatch)}, null);
139
+ System.out.println(${neVar}.data());
144
140
  }
145
141
  catch (RuntimeException err) {
146
142
  System.out.println("load failed: " + err.getMessage());
@@ -155,9 +151,9 @@ catch (RuntimeException err) {
155
151
  .sort((a: any, b: any) =>
156
152
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
157
153
  const loadArg = 0 < loadRequired.length
158
- ? `Map.of(${loadRequired.map((it: any) =>
154
+ ? javaMapOf(loadRequired.map((it: any) =>
159
155
  `"${it.name}", ${javaLit(it.type,
160
- it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')})`
156
+ it.name === idF ? 'example_id' : 'example_' + it.name)}`))
161
157
  : 'null'
162
158
 
163
159
  Content(`### 3. Load ${article} ${eName.toLowerCase()}
@@ -166,8 +162,8 @@ catch (RuntimeException err) {
166
162
 
167
163
  \`\`\`java
168
164
  try {
169
- Object ${eVar} = client.${accessor}(null).load(${loadArg}, null);
170
- System.out.println(${eVar});
165
+ SdkEntity ${eVar} = (SdkEntity) client.${accessor}(null).load(${loadArg}, null);
166
+ System.out.println(${eVar}.data());
171
167
  }
172
168
  catch (RuntimeException err) {
173
169
  System.out.println("load failed: " + err.getMessage());
@@ -204,7 +200,7 @@ catch (RuntimeException err) {
204
200
  `)
205
201
  if (opnames.includes('create')) {
206
202
  Content(`// Create — returns the ENTITY (call data() for the record)
207
- Object created = client.${accessor}(null).create(Map.of(${examplePairs('create').join(', ')}), null);
203
+ Object created = client.${accessor}(null).create(${javaMapOf(examplePairs('create'))}, null);
208
204
 
209
205
  `)
210
206
  }
@@ -212,7 +208,7 @@ Object created = client.${accessor}(null).create(Map.of(${examplePairs('create')
212
208
  const updatePairs = (idF ? [`"${idF}", ${javaLit(idParamType('update'), 'example_id')}`] : [])
213
209
  .concat(examplePairs('update'))
214
210
  Content(`// Update — supply the id in the match/data
215
- client.${accessor}(null).update(Map.of(${updatePairs.join(', ')}), null);
211
+ client.${accessor}(null).update(${javaMapOf(updatePairs)}, null);
216
212
 
217
213
  `)
218
214
  }
@@ -220,7 +216,7 @@ client.${accessor}(null).update(Map.of(${updatePairs.join(', ')}), null);
220
216
  const patchPairs = (idF ? [`"${idF}", ${javaLit(idParamType('patch'), 'example_id')}`] : [])
221
217
  .concat(examplePairs('patch'))
222
218
  Content(`// Patch — sends only the fields given
223
- client.${accessor}(null).patch(Map.of(${patchPairs.join(', ')}), null);
219
+ client.${accessor}(null).patch(${javaMapOf(patchPairs)}, null);
224
220
 
225
221
  `)
226
222
  }
@@ -233,7 +229,7 @@ client.${accessor}(null).patch(Map.of(${patchPairs.join(', ')}), null);
233
229
  ? `"${it.name}", ${javaLit(idParamType('remove'), 'example_id')}`
234
230
  : `"${it.name}", ${javaLit(it.type, 'example_' + it.name)}`)
235
231
  Content(`// Remove
236
- client.${accessor}(null).remove(${removePairs.length ? `Map.of(${removePairs.join(', ')})` : 'null'}, null);
232
+ client.${accessor}(null).remove(${removePairs.length ? javaMapOf(removePairs) : 'null'}, null);
237
233
  `)
238
234
  }
239
235
  Content(`\`\`\`
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape , targetFeatures, opNeedsAction, bodyNote } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape , targetFeatures, opNeedsAction, bodyNote, javaMap, javaMapOf } from '@voxgig/sdkgen'
3
3
  import { ReadmeRefFeatures } from '@voxgig/sdkgen'
4
4
 
5
5
  import {
@@ -7,53 +7,41 @@ import {
7
7
  getModelPath,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { javaVarName } from './utility_java'
10
+ import { javaVarName, javaListMatch, javaLit } from './utility_java'
11
11
 
12
12
 
13
13
  // Type names come from the shared canonToType 'java' column (single source of truth).
14
14
 
15
- // A type-correct Java literal for a field's canonical type.
16
- function javaLit(type: any, placeholder: string = 'example'): string {
17
- const k = canonScalarKey(type)
18
- if ('INTEGER' === k) return '1L'
19
- if ('NUMBER' === k) return '1.0'
20
- if ('BOOLEAN' === k) return 'true'
21
- if ('ARRAY' === k) return 'List.of()'
22
- if ('OBJECT' === k) return 'Map.of()'
23
- return `"${placeholder}"`
24
- }
25
-
26
-
27
15
  const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
28
16
  load: {
29
17
  sig: 'load(reqmatch, ctrl) -> Object',
30
- returns: 'the entity data',
31
- desc: 'Load a single entity matching the given criteria. Returns the entity data and raises on error.',
18
+ returns: 'the entity',
19
+ desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data()` reads, and raises on error.',
32
20
  },
33
21
  list: {
34
22
  sig: 'list(reqmatch, ctrl) -> Object',
35
- returns: 'an aggregate list of entities',
36
- desc: 'List entities matching the given criteria. The match is optional — call `list(null, null)` to list all records. Returns an aggregate list and raises on error.',
23
+ returns: 'a list of entities, one per record',
24
+ desc: 'List entities matching the given criteria. The match is optional — call `list(null, null)` to list all records. Returns a list of entities, one per record, and raises on error.',
37
25
  },
38
26
  create: {
39
27
  sig: 'create(reqdata, ctrl) -> Object',
40
- returns: 'the created entity data',
41
- desc: 'Create a new entity with the given data. Returns the created entity data and raises on error.',
28
+ returns: 'the created entity',
29
+ desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
42
30
  },
43
31
  update: {
44
32
  sig: 'update(reqdata, ctrl) -> Object',
45
- returns: 'the updated entity data',
46
- desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity data and raises on error.',
33
+ returns: 'the updated entity',
34
+ desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
47
35
  },
48
36
  patch: {
49
37
  sig: 'patch(reqdata, ctrl) -> Object',
50
- returns: 'the patched entity data',
51
- desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity data and raises on error.',
38
+ returns: 'the patched entity',
39
+ desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Returns the patched entity and raises on error.',
52
40
  },
53
41
  remove: {
54
42
  sig: 'remove(reqmatch, ctrl) -> Object',
55
- returns: 'the removed entity data',
56
- desc: 'Remove the entity matching the given criteria. Raises on error.',
43
+ returns: 'the removed entity',
44
+ desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
57
45
  },
58
46
  }
59
47
 
@@ -273,9 +261,9 @@ ${info.desc}
273
261
  .sort((a: any, b: any) =>
274
262
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
275
263
  const arg = 0 < matchItems.length
276
- ? `Map.of(${matchItems.map((it: any) =>
264
+ ? javaMapOf(matchItems.map((it: any) =>
277
265
  `"${it.name}", ${javaLit(it.type,
278
- it.name === idF ? ent.name + '_id' : it.name)}`).join(', ')})`
266
+ it.name === idF ? ent.name + '_id' : it.name)}`))
279
267
  : 'null'
280
268
  Content(`\`\`\`java
281
269
  Object result = client.${accessor}(null).${opname}(${arg}, null);
@@ -285,8 +273,10 @@ Object result = client.${accessor}(null).${opname}(${arg}, null);
285
273
  }
286
274
  else if ('list' === opname) {
287
275
  Content(`\`\`\`java
288
- Object results = client.${accessor}(null).list(null, null);
289
- System.out.println(results);
276
+ List<?> results = (List<?>) client.${accessor}(null).list(${javaListMatch(ent)}, null);
277
+ for (Object item : results) {
278
+ System.out.println(((SdkEntity) item).data());
279
+ }
290
280
  \`\`\`
291
281
 
292
282
  `)
@@ -294,12 +284,13 @@ System.out.println(results);
294
284
  else if ('create' === opname) {
295
285
  const createItems = opRequestShape(ent, 'create').items
296
286
  .filter((it: any) => !it.optional)
287
+ const createMap = javaMap(createItems.length)
297
288
  Content(`\`\`\`java
298
- Object result = client.${accessor}(null).create(Map.of(
289
+ Object result = client.${accessor}(null).create(${createMap.open}
299
290
  `)
300
291
  createItems.map((it: any, i: number) => {
301
292
  const comma = i < createItems.length - 1 ? ',' : ''
302
- Content(` "${it.name}", ${javaLit(it.type, 'example_' + it.name)}${comma} // ${canonToType(it.type, target.name)}
293
+ Content(` ${createMap.pair(`"${it.name}", ${javaLit(it.type, 'example_' + it.name)}`)}${comma} // ${canonToType(it.type, target.name)}
303
294
  `)
304
295
  })
305
296
  Content(`), null);
@@ -312,13 +303,14 @@ Object result = client.${accessor}(null).create(Map.of(
312
303
  .filter((it: any) => !it.optional || it.name === idF)
313
304
  .sort((a: any, b: any) =>
314
305
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
306
+ const updateMap = javaMap(updateItems.length)
315
307
  const updateLines = updateItems.map((it: any, i: number) => {
316
308
  const comma = i < updateItems.length - 1 ? ',' : ''
317
- return ` "${it.name}", ${javaLit(it.type,
318
- it.name === idF ? ent.name + '_id' : it.name)}${comma}\n`
309
+ return ` ${updateMap.pair(`"${it.name}", ${javaLit(it.type,
310
+ it.name === idF ? ent.name + '_id' : it.name)}`)}${comma}\n`
319
311
  }).join('')
320
312
  Content(`\`\`\`java
321
- Object result = client.${accessor}(null).${opname}(Map.of(
313
+ Object result = client.${accessor}(null).${opname}(${updateMap.open}
322
314
  ${updateLines}), null);
323
315
  \`\`\`
324
316
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, canonScalarKey, entityIdField, opRequestShape , serverVariables} from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape , serverVariables, javaMapOf } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -7,21 +7,7 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { javaVarName, javaPackage } from './utility_java'
11
-
12
-
13
- // A type-correct Java literal for a param: numeric/boolean/array/object params
14
- // render a typed literal; strings render the quoted placeholder. The SDK's
15
- // loose object model means all values live in Map<String, Object>.
16
- function javaLit(type: any, placeholder: string = 'example'): string {
17
- const k = canonScalarKey(type)
18
- if ('INTEGER' === k) return '1L'
19
- if ('NUMBER' === k) return '1.0'
20
- if ('BOOLEAN' === k) return 'true'
21
- if ('ARRAY' === k) return 'List.of()'
22
- if ('OBJECT' === k) return 'Map.of()'
23
- return `"${placeholder}"`
24
- }
10
+ import { javaVarName, javaPackage, javaListMatch, javaLit } from './utility_java'
25
11
 
26
12
 
27
13
  const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
@@ -47,8 +33,17 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
47
33
  'options.put("server", server);\n'
48
34
 
49
35
 
36
+ const shown = null == exampleEntity ? [] :
37
+ ['list', 'load'].filter((op: string) => Object.keys(exampleEntity.op || {}).includes(op))
38
+ const imports = [
39
+ ...(shown.includes('list') ? ['java.util.List'] : []),
40
+ ...(authActive || '' !== javaServerLines || shown.includes('load') ? ['java.util.Map'] : []),
41
+ `${javaPackage(model)}.core.${SDK}`,
42
+ ...(0 < shown.length ? [`${javaPackage(model)}.core.SdkEntity`] : []),
43
+ ]
44
+
50
45
  Content(`\`\`\`java
51
- import ${javaPackage(model)}.core.${SDK};
46
+ ${imports.map((i: string) => 'import ' + i + ';').join('\n')}
52
47
 
53
48
  `)
54
49
 
@@ -75,9 +70,11 @@ ${javaServerLines}${SDK} client = new ${SDK}(options);
75
70
  const idF = entityIdField(exampleEntity)
76
71
 
77
72
  if (opnames.includes('list')) {
78
- Content(`// List all ${eNameLower}s (returns Object, an aggregate list; raises on error)
79
- Object ${eVar}List = client.${accessor}(null).list(null, null);
80
- System.out.println(${eVar}List);
73
+ Content(`// List all ${eNameLower}s (a list of entities, one per record; raises on error)
74
+ List<?> ${eVar}List = (List<?>) client.${accessor}(null).list(${javaListMatch(exampleEntity)}, null);
75
+ for (Object ${eVar}Item : ${eVar}List) {
76
+ System.out.println(((SdkEntity) ${eVar}Item).data());
77
+ }
81
78
  `)
82
79
  }
83
80
 
@@ -87,14 +84,14 @@ System.out.println(${eVar}List);
87
84
  .sort((a: any, b: any) =>
88
85
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
89
86
  const loadArg = 0 < loadItems.length
90
- ? `Map.of(${loadItems.map((it: any) =>
87
+ ? javaMapOf(loadItems.map((it: any) =>
91
88
  `"${it.name}", ${javaLit(it.type,
92
- it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')})`
89
+ it.name === idF ? 'example_id' : 'example_' + it.name)}`))
93
90
  : 'null'
94
91
  Content(`
95
- // Load a specific ${eNameLower} (returns the record, raises on error)
96
- Object ${eVar} = client.${accessor}(null).load(${loadArg}, null);
97
- System.out.println(${eVar});
92
+ // Load a specific ${eNameLower} (returns the entity, raises on error)
93
+ SdkEntity ${eVar} = (SdkEntity) client.${accessor}(null).load(${loadArg}, null);
94
+ System.out.println(${eVar}.data());
98
95
  `)
99
96
  }
100
97
  }
@@ -1,24 +1,12 @@
1
1
 
2
- import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, Content, 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 ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
@@ -40,29 +28,35 @@ ${SDK} client = ${SDK}.testSDK(null, null);
40
28
  const idF = entityIdField(exampleEntity)
41
29
  const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
42
30
  let arg = 'null'
43
- if (isMatchOp) {
31
+ if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
44
32
  // Every REQUIRED match key (id first) — the same shape that generates
45
33
  // the op's request type, so the block stays honest.
46
- const items = opRequestShape(exampleEntity, primaryOp).items
47
- .filter((it: any) => !it.optional || it.name === idF)
34
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
35
+ .filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
48
36
  .sort((a: any, b: any) =>
49
37
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
50
38
  arg = 0 < items.length
51
- ? `Map.of(${items.map((it: any) =>
52
- `"${it.name}", ${it.name === idF ? '"test01"' : javaLit(it.type)}`).join(', ')})`
39
+ ? javaMapOf(items.map((it: any) =>
40
+ `${JSON.stringify(it.name)}, ${isMatchOp && it.name === idF ? '"test01"' : javaLit(it.type)}`))
53
41
  : 'null'
54
42
  } else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
55
43
  const items = opRequestShape(exampleEntity, primaryOp).items
56
44
  .filter((it: any) => it.name !== idF && it.name !== 'id')
57
45
  const required = items.filter((it: any) => !it.optional)
58
46
  const chosen = required.length ? required : items.slice(0, 3)
59
- arg = `Map.of(${chosen.map((it: any) =>
60
- `"${it.name}", ${javaLit(it.type)}`).join(', ')})`
47
+ arg = javaMapOf(chosen.map((it: any) =>
48
+ `${JSON.stringify(it.name)}, ${javaLit(it.type)}`))
61
49
  }
62
- const eVar = javaVarName(exampleEntity.name) + ('list' === primaryOp ? 'List' : '')
50
+ const eVar = javaVarName(exampleEntity.name)
63
51
  const accessor = javaVarName(exampleEntity.name)
64
- Content(`Object ${eVar} = client.${accessor}(null).${primaryOp}(${arg}, null);
65
- System.out.println(${eVar});
52
+ Content('list' === primaryOp
53
+ ? `List<?> ${eVar}List = (List<?>) client.${accessor}(null).list(${arg}, null);
54
+ for (Object ${eVar}Item : ${eVar}List) {
55
+ System.out.println(((SdkEntity) ${eVar}Item).data());
56
+ }
57
+ `
58
+ : `SdkEntity ${eVar} = (SdkEntity) client.${accessor}(null).${primaryOp}(${arg}, null);
59
+ System.out.println(${eVar}.data());
66
60
  `)
67
61
  }
68
62
 
@@ -4,6 +4,9 @@ import * as Path from 'node:path'
4
4
 
5
5
  import {
6
6
  camelify,
7
+ canonScalarKey,
8
+ requiredItems,
9
+ javaMapOf,
7
10
  } from '@voxgig/sdkgen'
8
11
 
9
12
  import {
@@ -109,8 +112,30 @@ function jsonAppendLines(value: any, bufname: string): string {
109
112
  .join('')
110
113
  }
111
114
 
115
+ // Map.of and Map.entry reject a null value, so NULL keeps the placeholder.
116
+ function javaLit(type: any, placeholder: string = 'example'): string {
117
+ const k = canonScalarKey(type)
118
+ if ('INTEGER' === k) return '1L'
119
+ if ('NUMBER' === k) return '1.0'
120
+ if ('BOOLEAN' === k) return 'true'
121
+ if ('ARRAY' === k) return 'List.of()'
122
+ if ('OBJECT' === k) return 'Map.of()'
123
+ return `"${placeholder}"`
124
+ }
125
+
126
+
127
+ // A list's required parameters as its match.
128
+ function javaListMatch(entity: any): string {
129
+ const items = requiredItems(entity, 'list')
130
+ return 0 < items.length
131
+ ? javaMapOf(items.map((it: any) => `${JSON.stringify(it.name)}, ${javaLit(it.type)}`))
132
+ : 'null'
133
+ }
134
+
112
135
 
113
136
  export {
137
+ javaLit,
138
+ javaListMatch,
114
139
  cleanModel,
115
140
  javaPackage,
116
141
  javaVarName,
@@ -1,7 +1,8 @@
1
1
 
2
2
  import {
3
3
  cmp, camelify,
4
- Content, Fragment
4
+ Content, Fragment,
5
+ entityClassName, entityCollection,
5
6
  } from '@voxgig/sdkgen'
6
7
 
7
8
 
@@ -32,6 +33,7 @@ const EntityOperation = cmp(function Operation(props: any) {
32
33
  SdkName: model.const.Name,
33
34
  EntityName: entity.Name,
34
35
  entityname: entity.name,
36
+ EntyClass: entityClassName(entity, entityCollection(model)),
35
37
  "['POINTS']": formatJson(entop.points, { margin: 6 }).trim(),
36
38
  '#Feature-Hook': ({ name, indent }: any) =>
37
39
  Content({ indent }, `
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, entityIdField, opRequestShape, safeVarName, exampleVarName, jsKey, matchArg, idLiteral, opNeedsAction } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, entityIdField, opRequestShape, safeVarName, exampleVarName, jsKey, opNeedsAction, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -9,12 +9,6 @@ import {
9
9
  import { exampleValue } from './utility_js'
10
10
 
11
11
 
12
- function listMatchArg(ent: any): string {
13
- const idF = entityIdField(ent)
14
- return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
15
- }
16
-
17
-
18
12
  const OP_DESC: Record<string, { method: string, desc: string }> = {
19
13
  load: { method: 'load(match)', desc: 'Load a single entity by match criteria.' },
20
14
  list: { method: 'list(match)', desc: 'List entities matching the criteria.' },
@@ -129,7 +123,7 @@ const ${eVar} = await client.${entity.Name}().load(${loadArg})
129
123
  Content(`#### Example: List
130
124
 
131
125
  \`\`\`ts
132
- const ${eVar}s = await client.${entity.Name}().list(${listMatchArg(entity)})
126
+ const ${eVar}s = await client.${entity.Name}().list(${listMatchArg('js', entity)})
133
127
  \`\`\`
134
128
 
135
129
  `)
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, entityIdField, entityDataIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, entityIdField, entityDataIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey, requiredItems } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -30,10 +30,9 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
30
30
 
31
31
  const primaryArg = (idPlaceholder: string): string => {
32
32
  if (!exampleEntity || !primaryOp) return ''
33
- if ('list' === primaryOp) return ''
34
- if (isMatchOp) {
35
- const items = opRequestShape(exampleEntity, primaryOp).items
36
- .filter((it: any) => !it.optional || it.name === idF)
33
+ if (isMatchOp || 'list' === primaryOp) {
34
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
35
+ .filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
37
36
  .sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
38
37
  if (0 === items.length) return ''
39
38
  const pairs = items.map((it: any) =>
@@ -58,11 +57,14 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
58
57
  // The op-driven example lines, shown only when the SDK has an entity op.
59
58
  // A direct()-only SDK (no ops anywhere) shows a direct() test call instead
60
59
  // and omits the stateful section (there is no op to retain state across).
61
- const testModeExample = primaryOp
60
+ const testModeExample = 'list' === primaryOp
61
+ ? `const ${eVar}s = await client.${eName}().list(${testCallArg})
62
+ // ${eVar}s is an array of ${eName} entities, one per mock record
63
+ console.log(${eVar}s.map((${eVar}) => ${eVar}.data()))`
64
+ : primaryOp
62
65
  ? `const ${eVar} = await client.${eName}().${primaryOp}(${testCallArg})
63
- // ${eVar} is the entity, populated with mock response data
64
- // — call ${eVar}.data() for the record itself
65
- console.log(${eVar})`
66
+ // ${eVar} is the ${eName} entity; .data() reads its mock record
67
+ console.log(${eVar}.data())`
66
68
  : `const result = await client.direct({ path: '/api/resource', method: 'GET' })
67
69
  console.log(result)`
68
70
  const stateSection = primaryOp
@@ -21,12 +21,12 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
21
21
  entityList.forEach((e: any) => Object.keys(e.op || {})
22
22
  .forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
23
23
  const opRowDefs: Record<string, string> = {
24
- load: '| `load` | `load(reqmatch?, ctrl?): Promise<Entity>` | Load a single entity by match criteria. |',
25
- list: '| `list` | `list(reqmatch?, ctrl?): Promise<Entity[]>` | List entities matching the criteria. |',
26
- create: '| `create` | `create(reqdata?, ctrl?): Promise<Entity>` | Create a new entity. |',
27
- update: '| `update` | `update(reqdata?, ctrl?): Promise<Entity>` | Update an existing entity. |',
28
- patch: '| `patch` | `patch(reqdata?, ctrl?): Promise<Entity>` | Change part of an existing entity. |',
29
- remove: '| `remove` | `remove(reqmatch?, ctrl?): Promise<void>` | Remove an entity. |',
24
+ load: '| `load` | `load(reqmatch?, ctrl?): Promise<Entity>` | Load a single entity by match criteria, and return it. |',
25
+ list: '| `list` | `list(reqmatch?, ctrl?): Promise<Entity[]>` | List entities matching the criteria, one per record. |',
26
+ create: '| `create` | `create(reqdata?, ctrl?): Promise<Entity>` | Create a new entity, and return it. |',
27
+ update: '| `update` | `update(reqdata?, ctrl?): Promise<Entity>` | Update an existing entity, and return it. |',
28
+ patch: '| `patch` | `patch(reqdata?, ctrl?): Promise<Entity>` | Change part of an existing entity, and return it. |',
29
+ remove: '| `remove` | `remove(reqmatch?, ctrl?): Promise<Entity>` | Remove an entity, and return it marked as deleted. |',
30
30
  }
31
31
  const opRows = ['load', 'list', 'create', 'update', 'patch', 'remove']
32
32
  .filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
@@ -47,7 +47,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
47
47
  retBullets.push('- `list` resolves to an **array** of entity objects (iterate it directly;\n there is no `.data` and no `.ok`).')
48
48
  }
49
49
  if (opUnion.has('remove')) {
50
- retBullets.push('- `remove` resolves to `undefined`.')
50
+ retBullets.push('- `remove` resolves to the entity, marked as deleted.')
51
51
  }
52
52
  const returnBullets = retBullets.join('\n')
53
53
 
@@ -112,8 +112,8 @@ ${opRows}
112
112
 
113
113
  #### Return values
114
114
 
115
- Entity operations resolve to the entity data directly — there is no
116
- result envelope:
115
+ Entity operations resolve to the entity itself — there is no result
116
+ envelope, and an entity's \`data()\` reads its record:
117
117
 
118
118
  ${returnBullets}
119
119