@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 { swiftVarName } from './utility_swift'
10
+ import { swiftVarName, swiftListMatch } from './utility_swift'
11
11
 
12
12
 
13
13
  // Type names come from the shared canonToType 'swift' column (single source of truth).
@@ -15,6 +15,7 @@ import { swiftVarName } from './utility_swift'
15
15
  // A type-correct Swift `Value` literal for a field's canonical type.
16
16
  function swiftLit(type: any, placeholder: string = 'example'): string {
17
17
  const k = canonScalarKey(type)
18
+ if ('NULL' === k) return '.null'
18
19
  if ('INTEGER' === k) return '.int(1)'
19
20
  if ('NUMBER' === k) return '.double(1.0)'
20
21
  if ('BOOLEAN' === k) return '.bool(true)'
@@ -27,33 +28,33 @@ function swiftLit(type: any, placeholder: string = 'example'): string {
27
28
  const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
28
29
  load: {
29
30
  sig: 'load(reqmatch, ctrl) throws -> Value',
30
- returns: 'the entity data',
31
- desc: 'Load a single entity matching the given criteria. Returns the entity data and throws on error.',
31
+ returns: 'the entity',
32
+ desc: 'Load a single entity matching the given criteria. Returns the entity, whose record `data()` reads, as a native `Value` that `asNative as? Entity` unwraps, and throws on error.',
32
33
  },
33
34
  list: {
34
35
  sig: 'list(reqmatch, ctrl) throws -> Value',
35
- returns: 'a Value list of entities',
36
- desc: 'List entities matching the given criteria. The match is optional — call `list(nil, nil)` to list all records. Returns a Value list and throws on error.',
36
+ returns: 'a `Value` list of entities, one per record',
37
+ desc: 'List entities matching the given criteria. The match is optional — call `list(nil, nil)` to list all records. Returns a `Value` list of entities, one per record, and throws on error.',
37
38
  },
38
39
  create: {
39
40
  sig: 'create(reqdata, ctrl) throws -> Value',
40
- returns: 'the created entity data',
41
- desc: 'Create a new entity with the given data. Returns the created entity data and throws on error.',
41
+ returns: 'the created entity',
42
+ desc: 'Create a new entity with the given data. Returns the created entity and throws on error.',
42
43
  },
43
44
  update: {
44
45
  sig: 'update(reqdata, ctrl) throws -> Value',
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 throws on error.',
46
+ returns: 'the updated entity',
47
+ desc: 'Update an existing entity. The data must include the entity `id`. Returns the updated entity and throws on error.',
47
48
  },
48
49
  patch: {
49
50
  sig: 'patch(reqdata, ctrl) throws -> Value',
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 throws 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 throws on error.',
52
53
  },
53
54
  remove: {
54
55
  sig: 'remove(reqmatch, ctrl) throws -> Value',
55
- returns: 'the removed entity data',
56
- desc: 'Remove the entity matching the given criteria. Throws on error.',
56
+ returns: 'the removed entity',
57
+ desc: 'Remove the entity matching the given criteria. Returns the entity, marked as deleted, and throws on error.',
57
58
  },
58
59
  }
59
60
 
@@ -284,8 +285,12 @@ let result = try client.${accessor}().${opname}(${arg}, nil)
284
285
  }
285
286
  else if ('list' === opname) {
286
287
  Content(`\`\`\`swift
287
- let results = try client.${accessor}().list(nil, nil)
288
- print(results)
288
+ let results = try client.${accessor}().list(${swiftListMatch(ent)}, nil)
289
+ for item in results.asList?.items ?? [] {
290
+ if let entity = item.asNative as? Entity {
291
+ print(entity.data())
292
+ }
293
+ }
289
294
  \`\`\`
290
295
 
291
296
  `)
@@ -7,7 +7,7 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
- import { swiftVarName } from './utility_swift'
10
+ import { swiftVarName, swiftListMatch } from './utility_swift'
11
11
 
12
12
 
13
13
  // A type-correct Swift `Value` literal for a param: numeric/boolean/array/
@@ -15,6 +15,7 @@ import { swiftVarName } from './utility_swift'
15
15
  // The SDK's loose object model means every value is a `Value` inside a `VMap`.
16
16
  function swiftLit(type: any, placeholder: string = 'example'): string {
17
17
  const k = canonScalarKey(type)
18
+ if ('NULL' === k) return '.null'
18
19
  if ('INTEGER' === k) return '.int(1)'
19
20
  if ('NUMBER' === k) return '.double(1.0)'
20
21
  if ('BOOLEAN' === k) return '.bool(true)'
@@ -65,10 +66,12 @@ let client = ${SDK}(options)
65
66
  const idF = entityIdField(exampleEntity)
66
67
 
67
68
  if (opnames.includes('list')) {
68
- Content(`// List all ${eNameLower}s (returns a Value list, throws on error)
69
- let ${eVar}List = try client.${eName}().list(nil, nil)
70
- for ${eVar} in ${eVar}List.asList?.items ?? [] {
71
- print(${eVar})
69
+ Content(`// List all ${eNameLower}s (a Value list of entities, one per record; throws on error)
70
+ let ${eVar}List = try client.${eName}().list(${swiftListMatch(exampleEntity)}, nil)
71
+ for ${eVar}Item in ${eVar}List.asList?.items ?? [] {
72
+ if let ${eVar}Entity = ${eVar}Item.asNative as? Entity {
73
+ print(${eVar}Entity.data())
74
+ }
72
75
  }
73
76
  `)
74
77
  }
@@ -87,9 +90,11 @@ for ${eVar} in ${eVar}List.asList?.items ?? [] {
87
90
  it.name === idF ? 'example_id' : 'example_' + it.name)})`).join(', ')}])`
88
91
  : 'nil'
89
92
  Content(`
90
- // Load a specific ${eNameLower} (returns the record, throws on error)
93
+ // Load a specific ${eNameLower} (returns the entity, throws on error)
91
94
  let ${eVar} = try client.${eName}().load(${loadArg}, nil)
92
- print(${eVar})
95
+ if let ${eVar}Entity = ${eVar}.asNative as? Entity {
96
+ print(${eVar}Entity.data())
97
+ }
93
98
  `)
94
99
  }
95
100
  }
@@ -1,17 +1,18 @@
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,
6
6
  getModelPath,
7
7
  } from '@voxgig/apidef'
8
8
 
9
- import { swiftVarName } from './utility_swift'
9
+ import { swiftVarName, swiftString } from './utility_swift'
10
10
 
11
11
 
12
12
  // A type-correct Swift `Value` literal for a field's canonical type.
13
13
  function swiftLit(type: any): string {
14
14
  const k = canonScalarKey(type)
15
+ if ('NULL' === k) return '.null'
15
16
  if ('INTEGER' === k) return '.int(1)'
16
17
  if ('NUMBER' === k) return '.double(1.0)'
17
18
  if ('BOOLEAN' === k) return '.bool(true)'
@@ -41,16 +42,16 @@ let client = ${SDK}.testSDK(nil, nil)
41
42
  const idF = entityIdField(exampleEntity)
42
43
  const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
43
44
  let arg = 'nil'
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
  ? `VMap([${items.map((it: any) =>
53
- `("${it.name}", ${it.name === idF ? '.string("test01")' : swiftLit(it.type)})`).join(', ')}])`
54
+ `(${swiftString(it.name)}, ${isMatchOp && it.name === idF ? '.string("test01")' : swiftLit(it.type)})`).join(', ')}])`
54
55
  : 'nil'
55
56
  } else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
56
57
  const items = opRequestShape(exampleEntity, primaryOp).items
@@ -58,11 +59,21 @@ let client = ${SDK}.testSDK(nil, nil)
58
59
  const required = items.filter((it: any) => !it.optional)
59
60
  const chosen = required.length ? required : items.slice(0, 3)
60
61
  arg = `VMap([${chosen.map((it: any) =>
61
- `("${it.name}", ${swiftLit(it.type)})`).join(', ')}])`
62
+ `(${swiftString(it.name)}, ${swiftLit(it.type)})`).join(', ')}])`
63
+ }
64
+ const eVar = swiftVarName(exampleEntity.name)
65
+ Content('list' === primaryOp
66
+ ? `let ${eVar}List = try client.${eName}().list(${arg}, nil)
67
+ for ${eVar}Item in ${eVar}List.asList?.items ?? [] {
68
+ if let ${eVar}Entity = ${eVar}Item.asNative as? Entity {
69
+ print(${eVar}Entity.data())
62
70
  }
63
- const eVar = swiftVarName(exampleEntity.name) + ('list' === primaryOp ? 'List' : '')
64
- Content(`let ${eVar} = try client.${eName}().${primaryOp}(${arg}, nil)
65
- print(${eVar})
71
+ }
72
+ `
73
+ : `let ${eVar} = try client.${eName}().${primaryOp}(${arg}, nil)
74
+ if let ${eVar}Entity = ${eVar}.asNative as? Entity {
75
+ print(${eVar}Entity.data())
76
+ }
66
77
  `)
67
78
  }
68
79
 
@@ -4,6 +4,8 @@ import * as Path from 'node:path'
4
4
  import {
5
5
  camelify,
6
6
  targetFeatures,
7
+ canonScalarKey,
8
+ requiredItems,
7
9
  } from '@voxgig/sdkgen'
8
10
 
9
11
  import {
@@ -18,7 +20,7 @@ function projectPath(suffix?: string): string {
18
20
 
19
21
 
20
22
  function swiftVarName(name: string): string {
21
- const pascal = camelify(name)
23
+ const pascal = camelify(name.replace(/[^\p{L}\p{N}_]/gu, '_'))
22
24
  const lower = pascal.charAt(0).toLowerCase() + pascal.slice(1)
23
25
  if (SWIFT_RESERVED.has(lower)) {
24
26
  return lower + '_'
@@ -115,8 +117,19 @@ function swiftSecretsActive(model: any, target: any): boolean {
115
117
  return null != targetFeatures(model, target)['secrets']
116
118
  }
117
119
 
120
+ // A list's required route and query parameters, as the match it is called with.
121
+ function swiftListMatch(entity: any): string {
122
+ const lit = (type: any): string =>
123
+ (({ NULL: '.null', INTEGER: '.int(1)', NUMBER: '.double(1.0)', BOOLEAN: '.bool(true)', ARRAY: '.list([])', OBJECT: '.map(VMap())' }) as any)[canonScalarKey(type)] ?? '.string("example")'
124
+ const items = requiredItems(entity, 'list')
125
+ return 0 < items.length
126
+ ? `VMap([${items.map((it: any) => `(${swiftString(it.name)}, ${lit(it.type)})`).join(', ')}])`
127
+ : 'nil'
128
+ }
129
+
118
130
 
119
131
  export {
132
+ swiftListMatch,
120
133
  clean,
121
134
  projectPath,
122
135
  swiftPascalName,
@@ -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_ts'
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('ts', entity)})
133
127
  \`\`\`
134
128
 
135
129
  `)
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, isHttpBasicAuth, envName, entityIdField, entityDataIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, isHttpBasicAuth, envName, entityIdField, entityDataIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey, requiredItems } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -28,13 +28,12 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
28
28
 
29
29
  const primaryArg = (idPlaceholder: string): string => {
30
30
  if (!exampleEntity || !primaryOp) return ''
31
- if ('list' === primaryOp) return ''
32
- if (isMatchOp) {
31
+ if (isMatchOp || 'list' === primaryOp) {
33
32
  // Every REQUIRED match key (id first), not just idF — a composite-match
34
33
  // entity (e.g. Umbrella's FlatPermission, database_id + id) needs them all
35
34
  // to satisfy the typed <Name>LoadMatch. Mirrors ReadmeTopTest.
36
- const items = opRequestShape(exampleEntity, primaryOp).items
37
- .filter((it: any) => !it.optional || it.name === idF)
35
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
36
+ .filter((it: any) => !it.optional || it.name === idF) : requiredItems(exampleEntity, 'list'))
38
37
  .sort((a: any, b: any) => (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
39
38
  if (0 === items.length) return ''
40
39
  const pairs = items.map((it: any) =>
@@ -60,11 +59,14 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
60
59
 
61
60
  // The op-driven example lines, shown only when the SDK has an entity op.
62
61
  // A direct()-only SDK (no ops anywhere) shows a direct() test call instead.
63
- const testModeExample = primaryOp
62
+ const testModeExample = 'list' === primaryOp
63
+ ? `const ${eVar}s = await client.${eName}().list(${testCallArg})
64
+ // ${eVar}s is an array of ${eName} entities, one per mock record
65
+ console.log(${eVar}s.map((${eVar}) => ${eVar}.data()))`
66
+ : primaryOp
64
67
  ? `const ${eVar} = await client.${eName}().${primaryOp}(${testCallArg})
65
- // ${eVar} is the entity, populated with mock response data
66
- // — call ${eVar}.data() for the record itself
67
- console.log(${eVar})`
68
+ // ${eVar} is the ${eName} entity; .data() reads its mock record
69
+ console.log(${eVar}.data())`
68
70
  : `const result = await client.direct({ path: '/api/resource', method: 'GET' })
69
71
  console.log(result)`
70
72
  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')
@@ -44,7 +44,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
44
44
  retBullets.push('- `list` resolves to an **array** of entity objects (iterate it directly;\n there is no `.data` and no `.ok`).')
45
45
  }
46
46
  if (opUnion.has('remove')) {
47
- retBullets.push('- `remove` resolves to `void`.')
47
+ retBullets.push('- `remove` resolves to the entity, marked as deleted.')
48
48
  }
49
49
  const returnBullets = retBullets.join('\n')
50
50
 
@@ -134,8 +134,8 @@ ${opRows}
134
134
 
135
135
  #### Return values
136
136
 
137
- Entity operations resolve to the entity data directly — there is no
138
- result envelope:
137
+ Entity operations resolve to the entity itself — there is no result
138
+ envelope, and an entity's \`data()\` reads its record:
139
139
 
140
140
  ${returnBullets}
141
141
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, isAuthActive, isHttpBasicAuth, packageName, envName, serverVariables, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, jsKey, matchArg, idLiteral } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, isAuthActive, isHttpBasicAuth, packageName, envName, serverVariables, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, jsKey, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -10,12 +10,6 @@ import {
10
10
  import { exampleValue } from './utility_ts'
11
11
 
12
12
 
13
- function listMatchArg(ent: any): string {
14
- const idF = entityIdField(ent)
15
- return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
16
- }
17
-
18
-
19
13
  const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
20
14
  const { target, ctx$: { model } } = props
21
15
 
@@ -80,10 +74,10 @@ resolves to entities, not raw records. Iterate them directly, and call
80
74
  \`.data()\` on one for the record it holds:
81
75
 
82
76
  \`\`\`ts
83
- const ${eVar}s = await client.${eName}().list(${listMatchArg(exampleEntity)})
77
+ const ${eVar}s = await client.${eName}().list(${listMatchArg('ts', exampleEntity)})
84
78
 
85
79
  for (const ${eVar} of ${eVar}s) {
86
- console.log(${eVar})
80
+ console.log(${eVar}.data())
87
81
  }
88
82
  \`\`\`
89
83
 
@@ -111,14 +105,14 @@ for (const ${eVar} of ${eVar}s) {
111
105
  Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
112
106
 
113
107
  ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
114
- \`load()\` returns the entity directly and throws on failure:
108
+ \`load()\` returns the entity and throws on failure; \`.data()\` reads its record:
115
109
 
116
110
  \`\`\`ts
117
111
  try {
118
112
  const ${neVar} = await client.${neName}().load({
119
113
  ${neMatchLines.join('\n')}
120
114
  })
121
- console.log(${neVar})
115
+ console.log(${neVar}.data())
122
116
  } catch (err) {
123
117
  console.error('load failed:', err)
124
118
  }
@@ -139,12 +133,12 @@ ${neMatchLines.join('\n')}
139
133
 
140
134
  Content(`### 3. Load ${article} ${eName.toLowerCase()}
141
135
 
142
- \`load()\` returns the entity directly and throws on failure:
136
+ \`load()\` returns the entity and throws on failure; \`.data()\` reads its record:
143
137
 
144
138
  \`\`\`ts
145
139
  try {
146
140
  const ${eVar} = await client.${eName}().load(${loadArg})
147
- console.log(${eVar})
141
+ console.log(${eVar}.data())
148
142
  } catch (err) {
149
143
  console.error('load failed:', err)
150
144
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, File, isAuthActive, isHttpBasicAuth, entityIdField, entityActions, opRequestShape, safeVarName, exampleVarName, jsKey, matchArg, idLiteral, targetFeatures, opNeedsAction, bodyNote } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, File, isAuthActive, isHttpBasicAuth, entityIdField, entityActions, opRequestShape, safeVarName, exampleVarName, jsKey, targetFeatures, opNeedsAction, bodyNote, listMatchArg } from '@voxgig/sdkgen'
3
3
  import { ReadmeRefFeatures } from '@voxgig/sdkgen'
4
4
 
5
5
  import {
@@ -10,43 +10,36 @@ import {
10
10
  import { exampleValue } from './utility_ts'
11
11
 
12
12
 
13
- function listMatchArg(ent: any): string {
14
- const idF = entityIdField(ent)
15
- return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
16
- }
17
-
18
-
19
13
  const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
20
14
  load: {
21
15
  sig: 'load(match: object, ctrl?: object)',
22
- returns: 'Promise<object>',
23
- desc: 'Load a single entity matching the given criteria.',
16
+ returns: 'Promise<Entity>',
17
+ desc: 'Load a single entity matching the given criteria. Resolves to the entity, whose record `data()` reads.',
24
18
  },
25
19
  list: {
26
20
  sig: 'list(match: object, ctrl?: object)',
27
- returns: 'Promise<object[]>',
28
- desc: 'List entities matching the given criteria. Returns an array.',
21
+ returns: 'Promise<Entity[]>',
22
+ desc: 'List entities matching the given criteria. Resolves to an array of entities, one per record.',
29
23
  },
30
24
  create: {
31
25
  sig: 'create(data: object, ctrl?: object)',
32
- returns: 'Promise<object>',
33
- desc: 'Create a new entity with the given data.',
26
+ returns: 'Promise<Entity>',
27
+ desc: 'Create a new entity with the given data. Resolves to the created entity.',
34
28
  },
35
29
  update: {
36
30
  sig: 'update(data: object, ctrl?: object)',
37
- returns: 'Promise<object>',
38
- desc: 'Update an existing entity. The data must include the entity `id`.',
31
+ returns: 'Promise<Entity>',
32
+ desc: 'Update an existing entity. The data must include the entity `id`. Resolves to the updated entity.',
39
33
  },
40
34
  patch: {
41
35
  sig: 'patch(data: object, ctrl?: object)',
42
- returns: 'Promise<object>',
43
- desc: 'Change part of an existing entity: only the fields given are sent. ' +
44
- 'The data must include the entity `id`.',
36
+ returns: 'Promise<Entity>',
37
+ desc: 'Change part of an existing entity: only the fields given are sent. The data must include the entity `id`. Resolves to the patched entity.',
45
38
  },
46
39
  remove: {
47
40
  sig: 'remove(match: object, ctrl?: object)',
48
- returns: 'Promise<void>',
49
- desc: 'Remove the entity matching the given criteria.',
41
+ returns: 'Promise<Entity>',
42
+ desc: 'Remove the entity matching the given criteria. Resolves to the entity, marked as deleted.',
50
43
  },
51
44
  }
52
45
 
@@ -349,7 +342,7 @@ const result = await client.${ent.Name}().${opname}(${arg})
349
342
  }
350
343
  else if ('list' === opname) {
351
344
  Content(`\`\`\`ts
352
- const results = await client.${ent.Name}().${opname}(${listMatchArg(ent)})
345
+ const results = await client.${ent.Name}().${opname}(${listMatchArg('ts', ent)})
353
346
  \`\`\`
354
347
 
355
348
  `)
@@ -476,8 +469,6 @@ const client = new ${model.Name}SDK({
476
469
  })
477
470
 
478
471
 
479
-
480
-
481
472
  export {
482
473
  ReadmeRef
483
474
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, isHttpBasicAuth, packageName, envName, entityIdField, entityOps, opRequestShape, safeVarName, exampleVarName, jsKey, matchArg, idLiteral , serverVariables} from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, isHttpBasicAuth, packageName, envName, entityIdField, entityOps, opRequestShape, safeVarName, exampleVarName, jsKey, serverVariables, listMatchArg } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -10,12 +10,6 @@ import {
10
10
  import { exampleValue } from './utility_ts'
11
11
 
12
12
 
13
- function listMatchArg(ent: any): string {
14
- const idF = entityIdField(ent)
15
- return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
16
- }
17
-
18
-
19
13
  const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
20
14
  const { target, ctx$: { model } } = props
21
15
 
@@ -57,10 +51,10 @@ const client = ${ctor}
57
51
  let hasCall = false
58
52
 
59
53
  if (opnames.includes('list')) {
60
- Content(`// List all ${eName.toLowerCase()}s (returns ${eName}Entity[] — .data() for the record)
61
- const ${eVar}s = await client.${eName}().list(${listMatchArg(exampleEntity)})
54
+ Content(`// List all ${eName.toLowerCase()}s (returns ${eName}Entity[], one entity per record)
55
+ const ${eVar}s = await client.${eName}().list(${listMatchArg('ts', exampleEntity)})
62
56
  for (const ${eVar} of ${eVar}s) {
63
- console.log(${eVar})
57
+ console.log(${eVar}.data())
64
58
  }
65
59
  `)
66
60
  hasCall = true
@@ -92,19 +86,19 @@ for (const ${eVar} of ${eVar}s) {
92
86
  it.name === neIdF ? 'example_id' : 'example_' + it.name)},`)
93
87
 
94
88
  Content(`
95
- // Load a specific ${neName.toLowerCase()} (returns a ${neName})
89
+ // Load a specific ${neName.toLowerCase()} (returns the entity, ${/^[aeiou]/i.test(neName) ? 'an' : 'a'} ${neName}Entity)
96
90
  const ${neVar} = await client.${neName}().load({
97
91
  ${neMatchLines.join('\n')}
98
92
  })
99
- console.log(${neVar})
93
+ console.log(${neVar}.data())
100
94
  `)
101
95
  hasCall = true
102
96
  }
103
97
 
104
98
  if (!hasCall && opnames.includes('load')) {
105
- Content(`// Load ${eName.toLowerCase()} data (returns a ${eName})
99
+ Content(`// Load a specific ${eName.toLowerCase()} (returns the entity, ${/^[aeiou]/i.test(eName) ? 'an' : 'a'} ${eName}Entity)
106
100
  const ${eVar} = await client.${eName}().load()
107
- console.log(${eVar})
101
+ console.log(${eVar}.data())
108
102
  `)
109
103
  hasCall = true
110
104
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, safeVarName, exampleVarName, jsKey } from '@voxgig/sdkgen'
2
+ import { cmp, Content, entityIdField, pickExampleEntity, opRequestShape, requiredItems, safeVarName, exampleVarName, jsKey } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -25,11 +25,22 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
25
25
  .slice(0, 3) : []
26
26
 
27
27
  const seedId = 'test01'
28
+ const idF = exampleEntity ? entityIdField(exampleEntity) : null
29
+ const isIdField = (it: any) => it.name === idF || it.name === 'id'
30
+
31
+ // A list matches its required parameters against the record, so the seed
32
+ // carries the values the call below sends, and an id is the record's key.
33
+ const listItems = 'list' === primaryOp ? requiredItems(exampleEntity, 'list') : []
34
+ const listed = (it: any) => listItems.some((li: any) => li.name === it.name)
35
+ const listLit = (it: any): string => exampleValue(exampleEntity, exampleEntity.op.list,
36
+ it.name, isIdField(it) ? seedId : 'example_' + it.name)
37
+
28
38
  const seedBody = [
29
39
  `${jsKey('id')}: '${seedId}'`,
30
- ...seedFields
40
+ ...[...seedFields, ...listItems.filter((it: any) =>
41
+ !seedFields.some((sf: any) => sf.name === it.name))]
31
42
  .filter((it: any) => 'id' !== it.name)
32
- .map((it: any) => `${jsKey(it.name)}: ${exampleValue(
43
+ .map((it: any) => `${jsKey(it.name)}: ${listed(it) ? listLit(it) : exampleValue(
33
44
  exampleEntity, exampleEntity.op && exampleEntity.op.create, it.name,
34
45
  'example_' + it.name)}`),
35
46
  ].join(', ')
@@ -52,22 +63,23 @@ const client = ${model.const.Name}SDK.test({
52
63
  const eVar = exampleVarName(eName.toLowerCase(), 'ts') +
53
64
  ('list' === primaryOp ? 's' : '')
54
65
  const primaryOpDef = exampleEntity.op && exampleEntity.op[primaryOp]
55
- const idF = entityIdField(exampleEntity)
56
66
  let arg = ''
57
- if ('load' === primaryOp || 'remove' === primaryOp) {
67
+ const isMatchOp = 'load' === primaryOp || 'remove' === primaryOp
68
+ if (isMatchOp || 'list' === primaryOp) {
58
69
  // Every REQUIRED match key (id first) — the same shape that generates
59
70
  // the op's Match type, so the block type-checks.
60
- const items = opRequestShape(exampleEntity, primaryOp).items
61
- .filter((it: any) => !it.optional || it.name === idF)
71
+ const items = (isMatchOp ? opRequestShape(exampleEntity, primaryOp).items
72
+ .filter((it: any) => !it.optional || it.name === idF) : [...listItems])
62
73
  .sort((a: any, b: any) =>
63
74
  (a.name === idF ? 0 : 1) - (b.name === idF ? 0 : 1))
75
+ const lit = (it: any): string => isMatchOp
76
+ ? exampleValue(exampleEntity, primaryOpDef, it.name,
77
+ it.name === idF ? 'test01' : 'example_' + it.name)
78
+ : listLit(it)
64
79
  arg = 0 < items.length
65
- ? `{ ${items.map((it: any) =>
66
- `${jsKey(it.name)}: ${exampleValue(exampleEntity, primaryOpDef, it.name,
67
- it.name === idF ? 'test01' : 'example_' + it.name)}`).join(', ')} }`
80
+ ? `{ ${items.map((it: any) => `${jsKey(it.name)}: ${lit(it)}`).join(', ')} }`
68
81
  : ''
69
82
  } else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
70
- const isIdField = (it: any) => it.name === idF || it.name === 'id'
71
83
  const items = opRequestShape(exampleEntity, primaryOp).items
72
84
  .filter((it: any) => !isIdField(it) || !it.optional)
73
85
  const required = items.filter((it: any) => !it.optional)
@@ -78,10 +90,13 @@ const client = ${model.const.Name}SDK.test({
78
90
  `${jsKey(it.name)}: ${exampleValue(exampleEntity, primaryOpDef, it.name,
79
91
  isIdField(it) ? seedId : 'example_' + it.name)}`).join(', ')} }`
80
92
  }
93
+ const one = exampleVarName(eName.toLowerCase(), 'ts')
81
94
  Content(`const ${eVar} = await client.${eName}().${primaryOp}(${arg})
82
- // ${eVar} is ${'list' === primaryOp ? `an array of ${eName} entities` : `the ${eName} entity`}, populated with mock data
83
- // — call ${eVar}${'list' === primaryOp ? '[0]' : ''}.data() for the record itself
84
- console.log(${eVar})
95
+ ${'list' === primaryOp
96
+ ? `// ${eVar} is an array of ${eName} entities, one per mock record
97
+ console.log(${eVar}.map((${one}) => ${one}.data()))`
98
+ : `// ${eVar} is the ${eName} entity; .data() reads its mock record
99
+ console.log(${eVar}.data())`}
85
100
  `)
86
101
  }
87
102
 
@@ -105,7 +105,7 @@ class EntityOperation {
105
105
  }
106
106
  else {
107
107
  // Off-happy-path (throw disabled): typed as any so the method's
108
- // Promise<EntityName> return stays clean under strict null checks.
108
+ // Promise<EntyClass> return stays clean under strict null checks.
109
109
  return undefined as any
110
110
  }
111
111
  }
@@ -104,7 +104,7 @@ class EntityOperation {
104
104
  }
105
105
  else {
106
106
  // Off-happy-path (throw disabled): typed as any so the method's
107
- // Promise<EntityName[]> return stays clean under strict null checks.
107
+ // Promise<EntyClass[]> return stays clean under strict null checks.
108
108
  return undefined as any
109
109
  }
110
110
  }