@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
@@ -7,7 +7,7 @@ import {
7
7
  getModelPath,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { csVarName } from './utility_csharp'
10
+ import { csVarName, csListMatch } from './utility_csharp'
11
11
 
12
12
 
13
13
  // Type names come from the shared canonToType 'csharp' column (single source of truth).
@@ -15,6 +15,7 @@ import { csVarName } from './utility_csharp'
15
15
  // A type-correct C# literal for a field's canonical type.
16
16
  function csLit(type: any, placeholder: string = 'example'): string {
17
17
  const k = canonScalarKey(type)
18
+ if ('NULL' === k) return 'null'
18
19
  if ('INTEGER' === k) return '1L'
19
20
  if ('NUMBER' === k) return '1.0'
20
21
  if ('BOOLEAN' === k) return 'true'
@@ -47,8 +48,8 @@ const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string
47
48
  },
48
49
  patch: {
49
50
  sig: 'Patch(reqdata, ctrl = null) -> 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.',
51
+ returns: 'the patched entity',
52
+ 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
53
  },
53
54
  remove: {
54
55
  sig: 'Remove(reqmatch, ctrl = null) -> object?',
@@ -83,6 +84,7 @@ Complete API reference for the ${model.Name} ${target.title} SDK.
83
84
 
84
85
  Content(`\`\`\`csharp
85
86
  using ${model.const.Name}Sdk;
87
+ using Voxgig.Struct;
86
88
 
87
89
  var client = new ${model.const.Name}SDK(options);
88
90
  \`\`\`
@@ -285,8 +287,11 @@ var result = client.${ent.Name}().${opname.charAt(0).toUpperCase() + opname.slic
285
287
  }
286
288
  else if ('list' === opname) {
287
289
  Content(`\`\`\`csharp
288
- var results = client.${ent.Name}().List(null);
289
- Console.WriteLine(results);
290
+ var results = (List<object?>)client.${ent.Name}().List(${csListMatch(ent)})!;
291
+ foreach (var item in results)
292
+ {
293
+ Console.WriteLine(StructUtils.Jsonify(((IEntity)item!).Data()));
294
+ }
290
295
  \`\`\`
291
296
 
292
297
  `)
@@ -7,7 +7,7 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { csVarName } from './utility_csharp'
10
+ import { csVarName, csListMatch } from './utility_csharp'
11
11
 
12
12
 
13
13
  // A type-correct C# literal for a param: numeric/boolean/array/object params
@@ -15,6 +15,7 @@ import { csVarName } from './utility_csharp'
15
15
  // loose object model means all values live in Dictionary<string, object?>.
16
16
  function csLit(type: any, placeholder: string = 'example'): string {
17
17
  const k = canonScalarKey(type)
18
+ if ('NULL' === k) return 'null'
18
19
  if ('INTEGER' === k) return '1L'
19
20
  if ('NUMBER' === k) return '1.0'
20
21
  if ('BOOLEAN' === k) return 'true'
@@ -36,9 +37,12 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
36
37
  ? `new ${model.const.Name}SDK(new Dictionary<string, object?>\n{\n ["apikey"] = Environment.GetEnvironmentVariable("${envName(model)}_APIKEY"),\n})`
37
38
  : `new ${model.const.Name}SDK()`
38
39
 
40
+ const shown = null != exampleEntity &&
41
+ ['list', 'load'].some((op: string) => Object.keys(exampleEntity.op || {}).includes(op))
42
+
39
43
  Content(`\`\`\`csharp
40
44
  using ${model.const.Name}Sdk;
41
-
45
+ ${shown ? 'using Voxgig.Struct;\n' : ''}
42
46
  var client = ${ctor};
43
47
 
44
48
  `)
@@ -52,9 +56,12 @@ var client = ${ctor};
52
56
  const idF = entityIdField(exampleEntity)
53
57
 
54
58
  if (opnames.includes('list')) {
55
- Content(`// List all ${eName.toLowerCase()}s (returns object?, an aggregate list; raises on error)
56
- var ${eVar}List = client.${eName}().List(null);
57
- Console.WriteLine(${eVar}List);
59
+ Content(`// List all ${eName.toLowerCase()}s (a list of entities, one per record, as object?; raises on error)
60
+ var ${eVar}List = (List<object?>)client.${eName}().List(${csListMatch(exampleEntity)})!;
61
+ foreach (var ${eVar}Item in ${eVar}List)
62
+ {
63
+ Console.WriteLine(StructUtils.Jsonify(((IEntity)${eVar}Item!).Data()));
64
+ }
58
65
  `)
59
66
  }
60
67
 
@@ -73,8 +80,8 @@ Console.WriteLine(${eVar}List);
73
80
  : 'null'
74
81
  Content(`
75
82
  // Load a specific ${eName.toLowerCase()} (returns the entity, raises on error)
76
- var ${eVar} = client.${eName}().Load(${loadArg});
77
- Console.WriteLine(${eVar});
83
+ var ${eVar} = (IEntity)client.${eName}().Load(${loadArg})!;
84
+ Console.WriteLine(StructUtils.Jsonify(${eVar}.Data()));
78
85
  `)
79
86
  }
80
87
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, Content, canonKey, canonScalarKey, entityIdField, pickExampleEntity, opRequestShape, requiredItems } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -7,12 +7,13 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { csVarName } from './utility_csharp'
10
+ import { csVarName, csStringLiteral } from './utility_csharp'
11
11
 
12
12
 
13
13
  // A type-correct C# literal for a field's canonical type.
14
14
  function csLit(type: any): string {
15
15
  const k = canonScalarKey(type)
16
+ if ('NULL' === k) return 'null'
16
17
  if ('INTEGER' === k) return '1L'
17
18
  if ('NUMBER' === k) return '1.0'
18
19
  if ('BOOLEAN' === k) return 'true'
@@ -41,16 +42,16 @@ var client = ${model.const.Name}SDK.TestSDK(null, null);
41
42
  const opMethod = primaryOp.charAt(0).toUpperCase() + primaryOp.slice(1)
42
43
  const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
43
44
  let arg = 'null'
44
- if (isMatchOp) {
45
+ if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
45
46
  // Every REQUIRED match key (id first) — the same shape that generates
46
47
  // the op's request type, so the block stays honest.
47
- const items = opRequestShape(exampleEntity, primaryOp).items
48
- .filter((it: any) => !it.optional || it.name === idF)
48
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
49
+ .filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
49
50
  .sort((a: any, b: any) =>
50
51
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
51
52
  arg = 0 < items.length
52
53
  ? `new Dictionary<string, object?> {${items.map((it: any) =>
53
- ` ["${it.name}"] = ${it.name === idF ? '"test01"' : csLit(it.type)}`).join(',')} }`
54
+ ` [${csStringLiteral(it.name)}] = ${isMatchOp && it.name === idF ? '"test01"' : csLit(it.type)}`).join(',')} }`
54
55
  : 'null'
55
56
  } else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
56
57
  const items = opRequestShape(exampleEntity, primaryOp).items
@@ -58,11 +59,18 @@ var client = ${model.const.Name}SDK.TestSDK(null, null);
58
59
  const required = items.filter((it: any) => !it.optional)
59
60
  const chosen = required.length ? required : items.slice(0, 3)
60
61
  arg = `new Dictionary<string, object?> {${chosen.map((it: any) =>
61
- ` ["${it.name}"] = ${csLit(it.type)}`).join(',')} }`
62
+ ` [${csStringLiteral(it.name)}] = ${csLit(it.type)}`).join(',')} }`
62
63
  }
63
- const eVar = csVarName(exampleEntity.name) + ('list' === primaryOp ? 'List' : '')
64
- Content(`var ${eVar} = client.${eName}().${opMethod}(${arg});
65
- Console.WriteLine(${eVar});
64
+ const eVar = csVarName(exampleEntity.name)
65
+ Content('list' === primaryOp
66
+ ? `var ${eVar}List = (List<object?>)client.${eName}().List(${arg})!;
67
+ foreach (var ${eVar}Item in ${eVar}List)
68
+ {
69
+ Console.WriteLine(StructUtils.Jsonify(((IEntity)${eVar}Item!).Data()));
70
+ }
71
+ `
72
+ : `var ${eVar} = (IEntity)client.${eName}().${opMethod}(${arg})!;
73
+ Console.WriteLine(StructUtils.Jsonify(${eVar}.Data()));
66
74
  `)
67
75
  }
68
76
 
@@ -6,6 +6,8 @@ import {
6
6
  camelify,
7
7
  each,
8
8
  safeVarName,
9
+ canonScalarKey,
10
+ requiredItems,
9
11
  } from '@voxgig/sdkgen'
10
12
 
11
13
  import {
@@ -202,8 +204,19 @@ function clean(o: any, dropDefaults?: boolean): any {
202
204
  return prune(o, true === dropDefaults)
203
205
  }
204
206
 
207
+ // A list's required route and query parameters, as the match it is called with.
208
+ function csListMatch(entity: any): string {
209
+ const lit = (type: any): string =>
210
+ (({ NULL: 'null', INTEGER: '1L', NUMBER: '1.0', BOOLEAN: 'true', ARRAY: 'new List<object?>()', OBJECT: 'new Dictionary<string, object?>()' }) as any)[canonScalarKey(type)] ?? '"example"'
211
+ const items = requiredItems(entity, 'list')
212
+ return 0 < items.length
213
+ ? `new Dictionary<string, object?> {${items.map((it: any) => ` [${csStringLiteral(it.name)}] = ${lit(it.type)}`).join(',')} }`
214
+ : 'null'
215
+ }
216
+
205
217
 
206
218
  export {
219
+ csListMatch,
207
220
  clean,
208
221
  csPascalName,
209
222
  csStringLiteral,
@@ -7,7 +7,7 @@ import {
7
7
  } from '@voxgig/apidef'
8
8
 
9
9
  // Type names come from the shared canonToType 'elixir' column (single source of truth).
10
- import { elixirLit } from './utility_elixir'
10
+ import { elixirLit, elixirListArgs } from './utility_elixir'
11
11
 
12
12
 
13
13
  // Operation method spelling for the Elixir target: each op is a function on
@@ -120,7 +120,7 @@ takes an entity handle built from the client:
120
120
 
121
121
  \`\`\`elixir
122
122
  ${eVar} = ${Name}.${eCall}(sdk)
123
- record = ${Name}.Entity.${EName}.load(${eVar}, ${loadArg})
123
+ ${eVar} = ${Name}.Entity.${EName}.load(${eVar}, ${loadArg})
124
124
  \`\`\`
125
125
 
126
126
  `)
@@ -131,7 +131,7 @@ record = ${Name}.Entity.${EName}.load(${eVar}, ${loadArg})
131
131
 
132
132
  \`\`\`elixir
133
133
  ${eVar} = ${Name}.${eCall}(sdk)
134
- records = ${Name}.Entity.${EName}.list(${eVar})
134
+ ${eVar}s = ${Name}.Entity.${EName}.list(${eVar}${elixirListArgs(entity, Name)})
135
135
  \`\`\`
136
136
 
137
137
  `)
@@ -147,7 +147,7 @@ records = ${Name}.Entity.${EName}.list(${eVar})
147
147
 
148
148
  \`\`\`elixir
149
149
  ${eVar} = ${Name}.${eCall}(sdk)
150
- record = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
150
+ ${eVar} = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
151
151
  `)
152
152
  createItems.map((it: any) => {
153
153
  Content(` "${it.name}" => ${elixirLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
@@ -17,7 +17,8 @@ that every later pipeline stage observes — the immutable-Elixir way to honour
17
17
  the shared-mutable hook contract.
18
18
 
19
19
  Build inputs from native Elixir maps with \`${model.Name}.Helpers.deep/1\`,
20
- and read fields off results with \`Voxgig.Struct.getprop/2\`.
20
+ and read fields off a record, which an entity's \`data_get/1\` returns, with
21
+ \`Voxgig.Struct.getprop/2\`.
21
22
 
22
23
  ### Module structure
23
24
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName, requiredItems } 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 { elixirLit } from './utility_elixir'
10
+ import { elixirLit, elixirString } from './utility_elixir'
11
11
 
12
12
 
13
13
  const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
@@ -27,20 +27,27 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
27
27
  let testArg = 'H.deep(%{})'
28
28
  if (exampleEntity && isMatchOp) {
29
29
  testArg = idF ? `H.deep(%{"${idF}" => "test01"})` : 'H.deep(%{})'
30
+ } else if (exampleEntity && 'list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length) {
31
+ const chosen = requiredItems(exampleEntity, 'list')
32
+ testArg = `H.deep(%{${chosen.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
30
33
  } else if (exampleEntity && ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp)) {
31
34
  const items = opRequestShape(exampleEntity, primaryOp).items
32
35
  .filter((it: any) => it.name !== idF && it.name !== 'id')
33
36
  const required = items.filter((it: any) => !it.optional)
34
37
  const chosen = required.length ? required : items.slice(0, 3)
35
- testArg = `H.deep(%{${chosen.map((it: any) => `"${it.name}" => ${elixirLit(it.type)}`).join(', ')}})`
38
+ testArg = `H.deep(%{${chosen.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
36
39
  }
37
40
 
38
- const resVar = 'list' === primaryOp ? 'records' : 'record'
39
41
  const testModeExample = primaryOp
40
42
  ? `# Entity ops return the entity, and list one per record (raise on error).
41
43
  ${eVar} = ${Name}.${eCall}(sdk)
42
- ${resVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${testArg})
43
- IO.inspect(${resVar})`
44
+ ${'list' === primaryOp
45
+ ? `${eVar}s = ${Name}.Entity.${eName}.list(${eVar}, ${testArg})
46
+ for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
47
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
48
+ end`
49
+ : `${eVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${testArg})
50
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))`}`
44
51
  : `result = ${Name}.direct(sdk, H.deep(%{"path" => "/api/resource", "method" => "GET"}))
45
52
  IO.inspect(result)`
46
53
 
@@ -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` | `(entity, reqmatch, ctrl \\\\ nil) :: map()` | Load a single entity by match criteria, and return it. Raises on error. |',
24
+ load: '| `load` | `(entity, reqmatch, ctrl \\\\ nil) :: entity` | Load a single entity by match criteria, and return it. Raises on error. |',
25
25
  list: '| `list` | `(entity, reqmatch \\\\ nil, ctrl \\\\ nil) :: list()` | List entities matching the criteria, one per record. Raises on error. |',
26
- create: '| `create` | `(entity, reqdata, ctrl \\\\ nil) :: map()` | Create a new entity, and return it. Raises on error. |',
27
- update: '| `update` | `(entity, reqdata, ctrl \\\\ nil) :: map()` | Update an existing entity, and return it. Raises on error. |',
28
- patch: '| `patch` | `(entity, reqdata, ctrl \\\\ nil) :: map()` | Change part of an existing entity, and return it. Raises on error. |',
29
- remove: '| `remove` | `(entity, reqmatch \\\\ nil, ctrl \\\\ nil) :: map()` | Remove an entity, and return it marked as deleted. Raises on error. |',
26
+ create: '| `create` | `(entity, reqdata, ctrl \\\\ nil) :: entity` | Create a new entity, and return it. Raises on error. |',
27
+ update: '| `update` | `(entity, reqdata, ctrl \\\\ nil) :: entity` | Update an existing entity, and return it. Raises on error. |',
28
+ patch: '| `patch` | `(entity, reqdata, ctrl \\\\ nil) :: entity` | Change part of an existing entity, and return it. Raises on error. |',
29
+ remove: '| `remove` | `(entity, reqmatch \\\\ nil, ctrl \\\\ nil) :: entity` | Remove an entity, and return it marked as deleted. Raises on error. |',
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')
@@ -7,7 +7,7 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { elixirLit } from './utility_elixir'
10
+ import { elixirLit, elixirListArgs } from './utility_elixir'
11
11
 
12
12
 
13
13
  const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
@@ -55,14 +55,17 @@ sdk = ${ctor}
55
55
  if (opnames.includes('list')) {
56
56
  Content(`### 2. List ${eName.toLowerCase()} records
57
57
 
58
- \`list/2\` returns a list of entities, one per record, and raises on error;
59
- \`data_get/1\` reads an entity's record.
58
+ \`list/2\` returns a \`Voxgig.Struct\` list of entities, one per record, and
59
+ raises on error; \`Voxgig.Struct.getelem/2\` reads an item, and \`data_get/1\`
60
+ an entity's record.
60
61
 
61
62
  \`\`\`elixir
62
63
  try do
63
64
  ${eVar} = ${Name}.${eCall}(sdk)
64
- records = ${Name}.Entity.${eName}.list(${eVar})
65
- IO.inspect(records)
65
+ ${eVar}s = ${Name}.Entity.${eName}.list(${eVar}${elixirListArgs(exampleEntity, Name)})
66
+ for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
67
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
68
+ end
66
69
  rescue
67
70
  err -> IO.puts("list failed: " <> inspect(err))
68
71
  end
@@ -98,8 +101,8 @@ record.
98
101
  \`\`\`elixir
99
102
  try do
100
103
  ${neVar} = ${Name}.${neCall}(sdk)
101
- record = ${Name}.Entity.${neName}.load(${neVar}, H.deep(%{${neMatch.join(', ')}}))
102
- IO.inspect(record)
104
+ ${neVar} = ${Name}.Entity.${neName}.load(${neVar}, H.deep(%{${neMatch.join(', ')}}))
105
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${neName}.data_get(${neVar})))
103
106
  rescue
104
107
  err -> IO.puts("load failed: " <> inspect(err))
105
108
  end
@@ -126,8 +129,8 @@ record.
126
129
  \`\`\`elixir
127
130
  try do
128
131
  ${eVar} = ${Name}.${eCall}(sdk)
129
- record = ${Name}.Entity.${eName}.load(${eVar}, ${loadArg})
130
- IO.inspect(record)
132
+ ${eVar} = ${Name}.Entity.${eName}.load(${eVar}, ${loadArg})
133
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))
131
134
  rescue
132
135
  err -> IO.puts("load failed: " <> inspect(err))
133
136
  end
@@ -155,7 +158,7 @@ end
155
158
  return it && it.type
156
159
  }
157
160
  const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
158
- ? `Voxgig.Struct.getprop(created, "${dataIdF}")`
161
+ ? `Voxgig.Struct.getprop(${Name}.Entity.${eName}.data_get(created), "${dataIdF}")`
159
162
  : elixirLit(idParamType(opname), 'example_id')
160
163
 
161
164
  if (opnames.includes('create') || opnames.includes('update') || opnames.includes('patch') ||
@@ -8,12 +8,12 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
  // Type names come from the shared canonToType 'elixir' column (single source of truth).
11
- import { elixirLit } from './utility_elixir'
11
+ import { elixirLit, elixirListArgs } from './utility_elixir'
12
12
 
13
13
 
14
14
  const OP_SIGNATURES: Record<string, { sig: string, desc: string }> = {
15
15
  load: {
16
- sig: 'load(entity, reqmatch, ctrl \\\\ nil) :: map()',
16
+ sig: 'load(entity, reqmatch, ctrl \\\\ nil) :: entity',
17
17
  desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data_get/1` reads, and raises on error.',
18
18
  },
19
19
  list: {
@@ -21,19 +21,19 @@ const OP_SIGNATURES: Record<string, { sig: string, desc: string }> = {
21
21
  desc: 'List entities matching the given criteria. The match is optional — call `list(entity)` to list all records. Returns a list of entities, one per record, and raises on error.',
22
22
  },
23
23
  create: {
24
- sig: 'create(entity, reqdata, ctrl \\\\ nil) :: map()',
24
+ sig: 'create(entity, reqdata, ctrl \\\\ nil) :: entity',
25
25
  desc: 'Create a new entity with the given data. Returns the created entity and raises on error.',
26
26
  },
27
27
  update: {
28
- sig: 'update(entity, reqdata, ctrl \\\\ nil) :: map()',
28
+ sig: 'update(entity, reqdata, ctrl \\\\ nil) :: entity',
29
29
  desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and raises on error.',
30
30
  },
31
31
  patch: {
32
- sig: 'patch(entity, reqdata, ctrl \\\\ nil) :: map()',
33
- 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.',
32
+ sig: 'patch(entity, reqdata, ctrl \\\\ nil) :: entity',
33
+ 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.',
34
34
  },
35
35
  remove: {
36
- sig: 'remove(entity, reqmatch, ctrl \\\\ nil) :: map()',
36
+ sig: 'remove(entity, reqmatch, ctrl \\\\ nil) :: entity',
37
37
  desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and raises on error.',
38
38
  },
39
39
  }
@@ -218,14 +218,14 @@ ${info.desc}
218
218
  it.name === idF ? ent.name + '_id' : it.name)}`).join(', ')}})`
219
219
  : `${Name}.Helpers.deep(%{})`
220
220
  Content(`\`\`\`elixir
221
- record = ${Name}.Entity.${EName}.${opname}(${eVar}, ${arg})
221
+ ${eVar} = ${Name}.Entity.${EName}.${opname}(${eVar}, ${arg})
222
222
  \`\`\`
223
223
 
224
224
  `)
225
225
  }
226
226
  else if ('list' === opname) {
227
227
  Content(`\`\`\`elixir
228
- records = ${Name}.Entity.${EName}.list(${eVar})
228
+ ${eVar}s = ${Name}.Entity.${EName}.list(${eVar}${elixirListArgs(ent, Name)})
229
229
  \`\`\`
230
230
 
231
231
  `)
@@ -234,7 +234,7 @@ records = ${Name}.Entity.${EName}.list(${eVar})
234
234
  const createItems = opRequestShape(ent, 'create').items
235
235
  .filter((it: any) => !it.optional)
236
236
  Content(`\`\`\`elixir
237
- record = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
237
+ ${eVar} = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
238
238
  `)
239
239
  createItems.map((it: any) => {
240
240
  Content(` "${it.name}" => ${elixirLit(it.type, 'example_' + it.name)}, # ${canonToType(it.type, target.name)}
@@ -254,7 +254,7 @@ record = ${Name}.Entity.${EName}.create(${eVar}, ${Name}.Helpers.deep(%{
254
254
  ` "${it.name}" => ${elixirLit(it.type,
255
255
  it.name === idF ? ent.name + '_id' : it.name)},\n`).join('')
256
256
  Content(`\`\`\`elixir
257
- record = ${Name}.Entity.${EName}.${opname}(${eVar}, ${Name}.Helpers.deep(%{
257
+ ${eVar} = ${Name}.Entity.${EName}.${opname}(${eVar}, ${Name}.Helpers.deep(%{
258
258
  ${updateLines} # ${'patch' === opname ? 'Only the fields to change' : 'Fields to update'}
259
259
  }))
260
260
  \`\`\`
@@ -7,7 +7,7 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { elixirLit } from './utility_elixir'
10
+ import { elixirLit, elixirListArgs } from './utility_elixir'
11
11
 
12
12
 
13
13
  const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
@@ -42,9 +42,11 @@ sdk = ${ctor}
42
42
 
43
43
  if (opnames.includes('list')) {
44
44
  Content(`
45
- # List all ${eName.toLowerCase()} records (raises on error)
46
- records = ${Name}.Entity.${eName}.list(${eVar})
47
- IO.inspect(records)
45
+ # List all ${eName.toLowerCase()}s (a list of entities, one per record; raises on error)
46
+ ${eVar}s = ${Name}.Entity.${eName}.list(${eVar}${elixirListArgs(exampleEntity, Name)})
47
+ for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
48
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
49
+ end
48
50
  `)
49
51
  }
50
52
 
@@ -66,8 +68,8 @@ IO.inspect(records)
66
68
  : eVar
67
69
  Content(`
68
70
  # Load a specific ${eName.toLowerCase()} (returns the entity, raises on error)
69
- record = ${Name}.Entity.${eName}.load(${loadArgs})
70
- IO.inspect(record)
71
+ ${eVar} = ${Name}.Entity.${eName}.load(${loadArgs})
72
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))
71
73
  `)
72
74
  }
73
75
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName } from '@voxgig/sdkgen'
2
+ import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, elixirAccessor, entityCollection, exampleVarName, requiredItems } 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 { elixirLit } from './utility_elixir'
10
+ import { elixirLit, elixirString } from './utility_elixir'
11
11
 
12
12
 
13
13
  const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
@@ -33,28 +33,32 @@ sdk = ${Name}.test()
33
33
  const idF = entityIdField(exampleEntity)
34
34
  const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
35
35
  let arg = ''
36
- if (isMatchOp) {
37
- const items = opRequestShape(exampleEntity, primaryOp).items
38
- .filter((it: any) => !it.optional || it.name === idF)
36
+ if (isMatchOp || ('list' === primaryOp && 0 < requiredItems(exampleEntity, 'list').length)) {
37
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
38
+ .filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
39
39
  .sort((a: any, b: any) =>
40
40
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
41
41
  arg = 0 < items.length
42
42
  ? `H.deep(%{${items.map((it: any) =>
43
- `"${it.name}" => ${it.name === idF ? '"test01"' : elixirLit(it.type)}`).join(', ')}})`
43
+ `${elixirString(it.name)} => ${isMatchOp && it.name === idF ? '"test01"' : elixirLit(it.type)}`).join(', ')}})`
44
44
  : 'H.deep(%{})'
45
45
  } else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
46
46
  const items = opRequestShape(exampleEntity, primaryOp).items
47
47
  .filter((it: any) => it.name !== idF && it.name !== 'id')
48
48
  const required = items.filter((it: any) => !it.optional)
49
49
  const chosen = required.length ? required : items.slice(0, 3)
50
- arg = `H.deep(%{${chosen.map((it: any) => `"${it.name}" => ${elixirLit(it.type)}`).join(', ')}})`
50
+ arg = `H.deep(%{${chosen.map((it: any) => `${elixirString(it.name)} => ${elixirLit(it.type)}`).join(', ')}})`
51
51
  } else {
52
52
  arg = 'H.deep(%{})'
53
53
  }
54
- const resVar = 'list' === primaryOp ? 'records' : 'record'
55
54
  Content(`${eVar} = ${Name}.${eCall}(sdk)
56
- ${resVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${arg})
57
- IO.inspect(${resVar})
55
+ ${'list' === primaryOp
56
+ ? `${eVar}s = ${Name}.Entity.${eName}.list(${eVar}, ${arg})
57
+ for i <- 0..(Voxgig.Struct.size(${eVar}s) - 1)//1 do
58
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(Voxgig.Struct.getelem(${eVar}s, i))))
59
+ end`
60
+ : `${eVar} = ${Name}.Entity.${eName}.${primaryOp}(${eVar}, ${arg})
61
+ IO.puts(Voxgig.Struct.jsonify(${Name}.Entity.${eName}.data_get(${eVar})))`}
58
62
  `)
59
63
  }
60
64
 
@@ -1,8 +1,9 @@
1
1
  # EJECT-START
2
2
 
3
- # Returns the created entityname entity map (ProjectName.Types.entityname/0)
4
- # on success; pipeline errors surface as the error value built by
5
- # Utility.make_error (shape is utility-configurable), hence term().
3
+ # Returns the created entityname entity, whose data_get/1 reads its record
4
+ # (ProjectName.Types.entityname/0), on success; pipeline errors surface as
5
+ # the error value built by Utility.make_error (shape is
6
+ # utility-configurable), hence term().
6
7
  @spec create(map(), ProjectName.Types.entityname_create_data() | nil, map() | nil) :: term()
7
8
  def create(ent, reqdata, ctrl \\ nil) do
8
9
  ctx =
@@ -1,8 +1,9 @@
1
1
  # EJECT-START
2
2
 
3
- # Returns a list of entityname entity maps (ProjectName.Types.entityname/0)
4
- # on success; pipeline errors surface as the error value built by
5
- # Utility.make_error (shape is utility-configurable), hence term().
3
+ # Returns a list of entityname entities, one per record, whose data_get/1
4
+ # reads each record (ProjectName.Types.entityname/0), on success; pipeline
5
+ # errors surface as the error value built by Utility.make_error (shape is
6
+ # utility-configurable), hence term().
6
7
  @spec list(map(), ProjectName.Types.entityname_list_match() | nil, map() | nil) :: term()
7
8
  def list(ent, reqmatch \\ nil, ctrl \\ nil) do
8
9
  reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
@@ -1,8 +1,9 @@
1
1
  # EJECT-START
2
2
 
3
- # Returns the entityname entity map (ProjectName.Types.entityname/0) on
4
- # success; pipeline errors surface as the error value built by
5
- # Utility.make_error (shape is utility-configurable), hence term().
3
+ # Returns the entityname entity, whose data_get/1 reads its record
4
+ # (ProjectName.Types.entityname/0), on success; pipeline errors surface as
5
+ # the error value built by Utility.make_error (shape is
6
+ # utility-configurable), hence term().
6
7
  @spec load(map(), ProjectName.Types.entityname_load_match() | nil, map() | nil) :: term()
7
8
  def load(ent, reqmatch \\ nil, ctrl \\ nil) do
8
9
  reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
@@ -1,8 +1,9 @@
1
1
  # EJECT-START
2
2
 
3
- # Returns the patched entityname entity map (ProjectName.Types.entityname/0)
4
- # on success; pipeline errors surface as the error value built by
5
- # Utility.make_error (shape is utility-configurable), hence term().
3
+ # Returns the patched entityname entity, whose data_get/1 reads its record
4
+ # (ProjectName.Types.entityname/0), on success; pipeline errors surface as
5
+ # the error value built by Utility.make_error (shape is
6
+ # utility-configurable), hence term().
6
7
  @spec patch(map(), ProjectName.Types.entityname_patch_data() | nil, map() | nil) :: term()
7
8
  def patch(ent, reqdata, ctrl \\ nil) do
8
9
  ctx =
@@ -1,8 +1,9 @@
1
1
  # EJECT-START
2
2
 
3
- # Returns the removed entityname entity map (ProjectName.Types.entityname/0)
4
- # on success; pipeline errors surface as the error value built by
5
- # Utility.make_error (shape is utility-configurable), hence term().
3
+ # Returns the removed entityname entity, marked as deleted, whose data_get/1
4
+ # reads the record it held (ProjectName.Types.entityname/0), on success;
5
+ # pipeline errors surface as the error value built by Utility.make_error
6
+ # (shape is utility-configurable), hence term().
6
7
  @spec remove(map(), ProjectName.Types.entityname_remove_match() | nil, map() | nil) :: term()
7
8
  def remove(ent, reqmatch \\ nil, ctrl \\ nil) do
8
9
  reqmatch = if reqmatch == nil, do: S.jm([]), else: reqmatch
@@ -1,8 +1,9 @@
1
1
  # EJECT-START
2
2
 
3
- # Returns the updated entityname entity map (ProjectName.Types.entityname/0)
4
- # on success; pipeline errors surface as the error value built by
5
- # Utility.make_error (shape is utility-configurable), hence term().
3
+ # Returns the updated entityname entity, whose data_get/1 reads its record
4
+ # (ProjectName.Types.entityname/0), on success; pipeline errors surface as
5
+ # the error value built by Utility.make_error (shape is
6
+ # utility-configurable), hence term().
6
7
  @spec update(map(), ProjectName.Types.entityname_update_data() | nil, map() | nil) :: term()
7
8
  def update(ent, reqdata, ctrl \\ nil) do
8
9
  ctx =