@voxgig/sdkgen 2.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/bin/voxgig-sdkgen +22 -2
  2. package/dist/action/doctor.d.ts +14 -0
  3. package/dist/action/doctor.js +351 -0
  4. package/dist/action/doctor.js.map +1 -0
  5. package/dist/action/feature.js +48 -9
  6. package/dist/action/feature.js.map +1 -1
  7. package/dist/action/target.d.ts +6 -1
  8. package/dist/action/target.js +134 -22
  9. package/dist/action/target.js.map +1 -1
  10. package/dist/cmp/Entity.js +5 -0
  11. package/dist/cmp/Entity.js.map +1 -1
  12. package/dist/cmp/ExternalTarget.d.ts +2 -0
  13. package/dist/cmp/ExternalTarget.js +104 -0
  14. package/dist/cmp/ExternalTarget.js.map +1 -0
  15. package/dist/cmp/Feature.js +2 -1
  16. package/dist/cmp/Feature.js.map +1 -1
  17. package/dist/cmp/Main.js +5 -1
  18. package/dist/cmp/Main.js.map +1 -1
  19. package/dist/cmp/ReadmeExplanation.js +1 -1
  20. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  21. package/dist/cmp/ReadmeTop.js +16 -6
  22. package/dist/cmp/ReadmeTop.js.map +1 -1
  23. package/dist/cmp/Registered.d.ts +7 -0
  24. package/dist/cmp/Registered.js +70 -0
  25. package/dist/cmp/Registered.js.map +1 -0
  26. package/dist/cmp/Test.js +3 -1
  27. package/dist/cmp/Test.js.map +1 -1
  28. package/dist/helpers/dryrun.d.ts +10 -0
  29. package/dist/helpers/dryrun.js +35 -0
  30. package/dist/helpers/dryrun.js.map +1 -0
  31. package/dist/helpers/featureSource.d.ts +13 -0
  32. package/dist/helpers/featureSource.js +156 -0
  33. package/dist/helpers/featureSource.js.map +1 -0
  34. package/dist/helpers/naming.d.ts +9 -1
  35. package/dist/helpers/naming.js +66 -2
  36. package/dist/helpers/naming.js.map +1 -1
  37. package/dist/helpers/opExample.js +23 -3
  38. package/dist/helpers/opExample.js.map +1 -1
  39. package/dist/helpers/opShape.d.ts +11 -1
  40. package/dist/helpers/opShape.js +51 -0
  41. package/dist/helpers/opShape.js.map +1 -1
  42. package/dist/helpers/packageMeta.d.ts +16 -1
  43. package/dist/helpers/packageMeta.js +181 -10
  44. package/dist/helpers/packageMeta.js.map +1 -1
  45. package/dist/helpers/stdrep.d.ts +3 -0
  46. package/dist/helpers/stdrep.js +47 -0
  47. package/dist/helpers/stdrep.js.map +1 -0
  48. package/dist/helpers/testPolicy.d.ts +2 -0
  49. package/dist/helpers/testPolicy.js +46 -0
  50. package/dist/helpers/testPolicy.js.map +1 -0
  51. package/dist/sdkgen.d.ts +15 -6
  52. package/dist/sdkgen.js +273 -5
  53. package/dist/sdkgen.js.map +1 -1
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/dist/types.d.ts +12 -0
  56. package/dist/utility.js +10 -1
  57. package/dist/utility.js.map +1 -1
  58. package/model/sdkgen.aontu +245 -0
  59. package/package.json +5 -3
  60. package/project/.sdk/model/target/c.aontu +28 -3
  61. package/project/.sdk/model/target/clojure.aontu +24 -3
  62. package/project/.sdk/model/target/cpp.aontu +25 -3
  63. package/project/.sdk/model/target/csharp.aontu +25 -3
  64. package/project/.sdk/model/target/dart.aontu +15 -3
  65. package/project/.sdk/model/target/elixir.aontu +15 -3
  66. package/project/.sdk/model/target/go-cli.aontu +16 -1
  67. package/project/.sdk/model/target/go-mcp.aontu +16 -1
  68. package/project/.sdk/model/target/go.aontu +14 -4
  69. package/project/.sdk/model/target/haskell.aontu +24 -3
  70. package/project/.sdk/model/target/java.aontu +25 -3
  71. package/project/.sdk/model/target/js.aontu +15 -3
  72. package/project/.sdk/model/target/kotlin.aontu +25 -3
  73. package/project/.sdk/model/target/lean.aontu +24 -3
  74. package/project/.sdk/model/target/lua.aontu +15 -3
  75. package/project/.sdk/model/target/ocaml.aontu +24 -3
  76. package/project/.sdk/model/target/perl.aontu +15 -3
  77. package/project/.sdk/model/target/php.aontu +15 -3
  78. package/project/.sdk/model/target/py-data.aontu +15 -3
  79. package/project/.sdk/model/target/py.aontu +15 -3
  80. package/project/.sdk/model/target/rb.aontu +15 -3
  81. package/project/.sdk/model/target/rust.aontu +25 -3
  82. package/project/.sdk/model/target/scala.aontu +24 -3
  83. package/project/.sdk/model/target/seneca-provider.aontu +118 -0
  84. package/project/.sdk/model/target/swift.aontu +25 -3
  85. package/project/.sdk/model/target/ts.aontu +15 -3
  86. package/project/.sdk/model/target/zig.aontu +25 -3
  87. package/project/.sdk/src/cmp/c/Config_c.ts +10 -11
  88. package/project/.sdk/src/cmp/c/Entity_c.ts +5 -1
  89. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +23 -5
  90. package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +9 -2
  91. package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +19 -2
  92. package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +9 -2
  93. package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +12 -2
  94. package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +9 -2
  95. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -0
  96. package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +6 -3
  97. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
  98. package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +2 -2
  99. package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +2 -2
  100. package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +12 -8
  101. package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +2 -2
  102. package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +5 -1
  103. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +12 -9
  104. package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +8 -2
  105. package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +18 -2
  106. package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +8 -2
  107. package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +11 -2
  108. package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +8 -2
  109. package/project/.sdk/src/cmp/csharp/Package_csharp.ts +2 -1
  110. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
  111. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +6 -6
  112. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +38 -1
  113. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +42 -33
  114. package/project/.sdk/src/cmp/dart/Package_dart.ts +2 -1
  115. package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +13 -2
  116. package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +2 -1
  117. package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +3 -3
  118. package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +1 -1
  119. package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +17 -6
  120. package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +13 -2
  121. package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +13 -2
  122. package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +3 -3
  123. package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +8 -8
  124. package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +18 -1
  125. package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +9 -1
  126. package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +9 -1
  127. package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +15 -1
  128. package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +9 -1
  129. package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +8 -0
  130. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
  131. package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +2 -2
  132. package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +11 -2
  133. package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +2 -1
  134. package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +1 -0
  135. package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +2 -1
  136. package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -1
  137. package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +2 -1
  138. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +38 -8
  139. package/project/.sdk/src/cmp/go/Entity_go.ts +2 -2
  140. package/project/.sdk/src/cmp/go/Main_go.ts +4 -5
  141. package/project/.sdk/src/cmp/go/Package_go.ts +8 -5
  142. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +2 -2
  143. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
  144. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +4 -2
  145. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +2 -2
  146. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +2 -2
  147. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +2 -2
  148. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
  149. package/project/.sdk/src/cmp/go/TestDirect_go.ts +21 -15
  150. package/project/.sdk/src/cmp/go/TestEntity_go.ts +9 -9
  151. package/project/.sdk/src/cmp/go/Test_go.ts +2 -2
  152. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -1
  153. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +4 -4
  154. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +4 -4
  155. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +2 -1
  156. package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +10 -5
  157. package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +10 -8
  158. package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +14 -10
  159. package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +21 -18
  160. package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +4 -4
  161. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +23 -11
  162. package/project/.sdk/src/cmp/java/Package_java.ts +2 -1
  163. package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -1
  164. package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +2 -2
  165. package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +1 -1
  166. package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +3 -3
  167. package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
  168. package/project/.sdk/src/cmp/java/TestEntity_java.ts +6 -6
  169. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +34 -1
  170. package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +12 -0
  171. package/project/.sdk/src/cmp/js/Main_js.ts +4 -1
  172. package/project/.sdk/src/cmp/js/Package_js.ts +7 -1
  173. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -2
  174. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -1
  175. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +13 -2
  176. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +13 -2
  177. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -1
  178. package/project/.sdk/src/cmp/js/TestDirect_js.ts +3 -3
  179. package/project/.sdk/src/cmp/js/TestEntity_js.ts +8 -8
  180. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +22 -1
  181. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +9 -1
  182. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +9 -1
  183. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +15 -1
  184. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +9 -1
  185. package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +13 -0
  186. package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +2 -1
  187. package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -1
  188. package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +2 -2
  189. package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +1 -1
  190. package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +3 -3
  191. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
  192. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +6 -6
  193. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +32 -1
  194. package/project/.sdk/src/cmp/lean/Package_lean.ts +3 -1
  195. package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +9 -4
  196. package/project/.sdk/src/cmp/lua/Package_lua.ts +4 -3
  197. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +11 -3
  198. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
  199. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
  200. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +9 -9
  201. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +37 -1
  202. package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +12 -0
  203. package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +30 -3
  204. package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +11 -5
  205. package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +3 -1
  206. package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +10 -5
  207. package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +6 -2
  208. package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +10 -8
  209. package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +14 -13
  210. package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +20 -18
  211. package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -4
  212. package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +8 -2
  213. package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +8 -5
  214. package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -1
  215. package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +1 -1
  216. package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +3 -3
  217. package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +1 -1
  218. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
  219. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +6 -6
  220. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +36 -1
  221. package/project/.sdk/src/cmp/php/MainEntity_php.ts +21 -16
  222. package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
  223. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +6 -6
  224. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +4 -3
  225. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -2
  226. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
  227. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +12 -12
  228. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +6 -6
  229. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +4 -4
  230. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
  231. package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
  232. package/project/.sdk/src/cmp/php/TestEntity_php.ts +17 -15
  233. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +20 -1
  234. package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +11 -0
  235. package/project/.sdk/src/cmp/py/Package_py.ts +4 -3
  236. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +13 -2
  237. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -1
  238. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
  239. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +17 -6
  240. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +14 -3
  241. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +13 -2
  242. package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
  243. package/project/.sdk/src/cmp/py/TestEntity_py.ts +9 -9
  244. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +29 -1
  245. package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +11 -0
  246. package/project/.sdk/src/cmp/py-data/Main_py-data.ts +2 -1
  247. package/project/.sdk/src/cmp/rb/Package_rb.ts +4 -3
  248. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +1 -1
  249. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -1
  250. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +5 -5
  251. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
  252. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
  253. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +9 -9
  254. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +31 -1
  255. package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +10 -1
  256. package/project/.sdk/src/cmp/rust/Entity_rust.ts +5 -1
  257. package/project/.sdk/src/cmp/rust/Main_rust.ts +21 -0
  258. package/project/.sdk/src/cmp/rust/Package_rust.ts +2 -1
  259. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
  260. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +12 -12
  261. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +18 -0
  262. package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +8 -2
  263. package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +20 -3
  264. package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +8 -2
  265. package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +10 -2
  266. package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +8 -2
  267. package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +10 -0
  268. package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -1
  269. package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +3 -3
  270. package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +1 -1
  271. package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +3 -3
  272. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +3 -3
  273. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +27 -1
  274. package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +3915 -0
  275. package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +960 -0
  276. package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -1
  277. package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +3 -3
  278. package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +1 -1
  279. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +3 -3
  280. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +34 -1
  281. package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +9 -1
  282. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +18 -1
  283. package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +5 -2
  284. package/project/.sdk/src/cmp/ts/Main_ts.ts +4 -1
  285. package/project/.sdk/src/cmp/ts/Package_ts.ts +10 -1
  286. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -2
  287. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -1
  288. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +21 -6
  289. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +52 -2
  290. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +14 -3
  291. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +34 -2
  292. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +64 -43
  293. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +8 -8
  294. package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +2 -2
  295. package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -2
  296. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +25 -1
  297. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +10 -2
  298. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
  299. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +10 -2
  300. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +27 -3
  301. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +10 -2
  302. package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +15 -0
  303. package/project/.sdk/src/cmp/zig/Entity_zig.ts +5 -1
  304. package/project/.sdk/src/cmp/zig/Package_zig.ts +3 -1
  305. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +39 -0
  306. package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +2 -2
  307. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -2
  308. package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +2 -2
  309. package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +5 -2
  310. package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +2 -2
  311. package/project/.sdk/tm/c/VERSION +1 -1
  312. package/project/.sdk/tm/c/core/helpers.c +1 -0
  313. package/project/.sdk/tm/c/core/sdk.h +22 -6
  314. package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
  315. package/project/.sdk/tm/c/tests/primary_utility_test.c +4 -1
  316. package/project/.sdk/tm/c/utility/make_url.c +1 -0
  317. package/project/.sdk/tm/c/utility/param.c +1 -0
  318. package/project/.sdk/tm/clojure/VERSION +1 -1
  319. package/project/.sdk/tm/cpp/VERSION +1 -1
  320. package/project/.sdk/tm/cpp/core/types.hpp +33 -8
  321. package/project/.sdk/tm/cpp/test/pipeline_test.cpp +5 -0
  322. package/project/.sdk/tm/cpp/test/runner_support.hpp +4 -4
  323. package/project/.sdk/tm/csharp/VERSION +1 -1
  324. package/project/.sdk/tm/csharp/core/Types.cs +6 -0
  325. package/project/.sdk/tm/csharp/test/FeatureHarness.cs +396 -0
  326. package/project/.sdk/tm/csharp/test/FeatureTest.cs +7 -385
  327. package/project/.sdk/tm/csharp/test/Runner.cs +4 -4
  328. package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +4 -0
  329. package/project/.sdk/tm/dart/test/utility.dart +4 -4
  330. package/project/.sdk/tm/elixir/VERSION +1 -1
  331. package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +26 -0
  332. package/project/.sdk/tm/go/VERSION +1 -1
  333. package/project/.sdk/tm/go/core/types.go +6 -0
  334. package/project/.sdk/tm/go/test/feature_harness_test.go +361 -0
  335. package/project/.sdk/tm/go/test/feature_test.go +7 -350
  336. package/project/.sdk/tm/go/test/pipeline_test.go +6 -0
  337. package/project/.sdk/tm/go/test/runner_test.go +16 -4
  338. package/project/.sdk/tm/haskell/VERSION +1 -1
  339. package/project/.sdk/tm/haskell/src/SdkFeatures.hs +28 -5
  340. package/project/.sdk/tm/haskell/src/SdkTypes.hs +14 -5
  341. package/project/.sdk/tm/java/VERSION +1 -1
  342. package/project/.sdk/tm/java/test/RunnerSupport.java +4 -4
  343. package/project/.sdk/tm/java/utility/MakeError.java +4 -0
  344. package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +4 -0
  345. package/project/.sdk/tm/js/test/utility.js +3 -3
  346. package/project/.sdk/tm/kotlin/VERSION +1 -1
  347. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
  348. package/project/.sdk/tm/lean/VERSION +1 -1
  349. package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
  350. package/project/.sdk/tm/lua/test/runner.lua +4 -4
  351. package/project/.sdk/tm/lua/utility/make_error.lua +4 -0
  352. package/project/.sdk/tm/ocaml/VERSION +1 -1
  353. package/project/.sdk/tm/ocaml/sdk_types.ml +14 -5
  354. package/project/.sdk/tm/ocaml/test/t_pipeline.ml +5 -2
  355. package/project/.sdk/tm/perl/t/runner.pm +4 -4
  356. package/project/.sdk/tm/php/VERSION +1 -1
  357. package/project/.sdk/tm/php/test/Runner.php +4 -4
  358. package/project/.sdk/tm/php/utility/MakeError.php +5 -0
  359. package/project/.sdk/tm/py/pkg/utility/make_error.py +4 -0
  360. package/project/.sdk/tm/py/test/runner.py +19 -4
  361. package/project/.sdk/tm/rb/test/runner.rb +4 -4
  362. package/project/.sdk/tm/rb/utility/make_error.rb +4 -0
  363. package/project/.sdk/tm/rust/VERSION +1 -1
  364. package/project/.sdk/tm/rust/core/types.rs +22 -6
  365. package/project/.sdk/tm/rust/tests/common/mod.rs +6 -6
  366. package/project/.sdk/tm/rust/tests/pipeline_test.rs +6 -0
  367. package/project/.sdk/tm/rust/utility/make_error.rs +4 -0
  368. package/project/.sdk/tm/scala/VERSION +1 -1
  369. package/project/.sdk/tm/seneca-provider/CODE_OF_CONDUCT.md +132 -0
  370. package/project/.sdk/tm/seneca-provider/LICENSE +21 -0
  371. package/project/.sdk/tm/seneca-provider/Makefile +15 -0
  372. package/project/.sdk/tm/seneca-provider/src/tsconfig.json +18 -0
  373. package/project/.sdk/tm/seneca-provider/test/tsconfig.json +16 -0
  374. package/project/.sdk/tm/seneca-provider/tsfmt.json +3 -0
  375. package/project/.sdk/tm/swift/VERSION +1 -1
  376. package/project/.sdk/tm/ts/src/tsconfig.json +1 -0
  377. package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +4 -0
  378. package/project/.sdk/tm/ts/test/tsconfig.json +1 -0
  379. package/project/.sdk/tm/ts/test/utility.ts +3 -3
  380. package/project/.sdk/tm/zig/VERSION +1 -1
  381. package/src/action/doctor.ts +475 -0
  382. package/src/action/feature.ts +54 -16
  383. package/src/action/target.ts +174 -25
  384. package/src/cmp/Entity.ts +7 -0
  385. package/src/cmp/ExternalTarget.ts +125 -0
  386. package/src/cmp/Feature.ts +3 -1
  387. package/src/cmp/Main.ts +7 -1
  388. package/src/cmp/ReadmeExplanation.ts +2 -2
  389. package/src/cmp/ReadmeTop.ts +22 -9
  390. package/src/cmp/Registered.ts +100 -0
  391. package/src/cmp/Test.ts +4 -1
  392. package/src/helpers/dryrun.ts +57 -0
  393. package/src/helpers/featureSource.ts +208 -0
  394. package/src/helpers/naming.ts +73 -2
  395. package/src/helpers/opExample.ts +19 -2
  396. package/src/helpers/opShape.ts +65 -0
  397. package/src/helpers/packageMeta.ts +211 -10
  398. package/src/helpers/stdrep.ts +56 -0
  399. package/src/helpers/testPolicy.ts +52 -0
  400. package/src/sdkgen.ts +350 -5
  401. package/src/types.ts +24 -1
  402. package/src/utility.ts +10 -1
  403. package/project/.sdk/tm/rust/feature/mod.rs +0 -24
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityDataIdField, entityOps } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityDataIdField, entityOps, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -82,7 +82,7 @@ $client = ${ctor};
82
82
  \`\`\`php
83
83
  try {
84
84
  // list() returns an array of ${eName} records — iterate directly.
85
- $${eName.toLowerCase()}s = $client->${eName}()->list();
85
+ $${eName.toLowerCase()}s = $client->${phpEntityAccessor(eName)}()->list();
86
86
  foreach ($${eName.toLowerCase()}s as $item) {
87
87
  echo ${itemPrint} . "\\n";
88
88
  }
@@ -120,8 +120,8 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
120
120
 
121
121
  \`\`\`php
122
122
  try {
123
- // load() returns the bare ${neName} record (throws on error).
124
- $${neVar} = $client->${neName}()->load([${neMatch.join(', ')}]);
123
+ // load() returns the ENTITY — call data_get() for the ${neName} record (throws on error).
124
+ $${neVar} = $client->${phpEntityAccessor(neName)}()->load([${neMatch.join(', ')}]);
125
125
  print_r($${neVar});
126
126
  } catch (\\Throwable $err) {
127
127
  echo "Error: " . $err->getMessage();
@@ -148,8 +148,8 @@ try {
148
148
 
149
149
  \`\`\`php
150
150
  try {
151
- // load() returns the bare ${eName} record (throws on error).
152
- $${eName.toLowerCase()} = $client->${eName}()->load(${loadArg});
151
+ // load() returns the ENTITY — call data_get() for the ${eName} record (throws on error).
152
+ $${eName.toLowerCase()} = $client->${phpEntityAccessor(eName)}()->load(${loadArg});
153
153
  print_r($${eName.toLowerCase()});
154
154
  } catch (\\Throwable $err) {
155
155
  echo "Error: " . $err->getMessage();
@@ -187,7 +187,7 @@ try {
187
187
  return it && it.type
188
188
  }
189
189
  const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
190
- ? `$created["${dataIdF}"]`
190
+ ? `$created->data_get()["${dataIdF}"]`
191
191
  : phpLit(idParamType(opname), 'example_id')
192
192
 
193
193
  if (opnames.includes('create') || opnames.includes('update') || opnames.includes('remove')) {
@@ -196,16 +196,16 @@ try {
196
196
  \`\`\`php
197
197
  `)
198
198
  if (opnames.includes('create')) {
199
- Content(`// create() returns the bare created ${eName} record.
200
- $created = $client->${eName}()->create([${examplePairs('create').join(', ')}]);
199
+ Content(`// create() returns the ENTITY — call data_get() for the created ${eName} record.
200
+ $created = $client->${phpEntityAccessor(eName)}()->create([${examplePairs('create').join(', ')}]);
201
201
 
202
202
  `)
203
203
  }
204
204
  if (opnames.includes('update')) {
205
205
  const updatePairs = (idF ? [`"${idF}" => ${idValueFor('update')}`] : []).concat(examplePairs('update'))
206
206
  const fromCreated = null != dataIdF && opnames.includes('create')
207
- Content(`// Update${fromCreated ? ` — index the bare record directly ($created["${dataIdF}"]).` : ''}
208
- $client->${eName}()->update([${updatePairs.join(', ')}]);
207
+ Content(`// Update${fromCreated ? ` — index the record via data_get() ($created->data_get()["${dataIdF}"]).` : ''}
208
+ $client->${phpEntityAccessor(eName)}()->update([${updatePairs.join(', ')}]);
209
209
 
210
210
  `)
211
211
  }
@@ -220,7 +220,7 @@ $client->${eName}()->update([${updatePairs.join(', ')}]);
220
220
  ? `"${it.name}" => ${idValueFor('remove')}`
221
221
  : `"${it.name}" => ${phpLit(it.type, 'example_' + it.name)}`)
222
222
  Content(`// Remove
223
- $client->${eName}()->remove(${removePairs.length ? `[${removePairs.join(', ')}]` : ''});
223
+ $client->${phpEntityAccessor(eName)}()->remove(${removePairs.length ? `[${removePairs.join(', ')}]` : ''});
224
224
  `)
225
225
  }
226
226
  Content(`\`\`\`
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -186,7 +186,7 @@ Prepare a fetch definition without sending the request. Returns the
186
186
  }
187
187
 
188
188
  Content(`\`\`\`php
189
- $${ent.name} = $client->${ent.Name}();
189
+ $${ent.name} = $client->${phpEntityAccessor(ent.Name)}();
190
190
  \`\`\`
191
191
 
192
192
  `)
@@ -270,14 +270,14 @@ ${info.desc}
270
270
  it.name === idF ? ent.name + '_id' : it.name)}`).join(', ')}]`
271
271
  : ''
272
272
  Content(`\`\`\`php
273
- $result = $client->${ent.Name}()->${opname}(${arg});
273
+ $result = $client->${phpEntityAccessor(ent.Name)}()->${opname}(${arg});
274
274
  \`\`\`
275
275
 
276
276
  `)
277
277
  }
278
278
  else if ('list' === opname) {
279
279
  Content(`\`\`\`php
280
- $results = $client->${ent.Name}()->list();
280
+ $results = $client->${phpEntityAccessor(ent.Name)}()->list();
281
281
  \`\`\`
282
282
 
283
283
  `)
@@ -289,7 +289,7 @@ $results = $client->${ent.Name}()->list();
289
289
  const createItems = opRequestShape(ent, 'create').items
290
290
  .filter((it: any) => !it.optional)
291
291
  Content(`\`\`\`php
292
- $result = $client->${ent.Name}()->create([
292
+ $result = $client->${phpEntityAccessor(ent.Name)}()->create([
293
293
  `)
294
294
  createItems.map((it: any) => {
295
295
  Content(` "${it.name}" => null, // ${canonToType(it.type, target.name)}
@@ -311,7 +311,7 @@ $result = $client->${ent.Name}()->create([
311
311
  ` "${it.name}" => ${phpLit(it.type,
312
312
  it.name === idF ? ent.name + '_id' : it.name)},\n`).join('')
313
313
  Content(`\`\`\`php
314
- $result = $client->${ent.Name}()->update([
314
+ $result = $client->${phpEntityAccessor(ent.Name)}()->update([
315
315
  ${updateLines} // Fields to update
316
316
  ]);
317
317
  \`\`\`
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -51,7 +51,7 @@ $client = ${ctor};
51
51
 
52
52
  if (opnames.includes('list')) {
53
53
  Content(`// List all ${eName.toLowerCase()}s (returns an array; throws on error)
54
- $${eName.toLowerCase()}s = $client->${eName}()->list();
54
+ $${eName.toLowerCase()}s = $client->${phpEntityAccessor(eName)}()->list();
55
55
  print_r($${eName.toLowerCase()}s);
56
56
  `)
57
57
  hasCall = true
@@ -71,8 +71,8 @@ print_r($${eName.toLowerCase()}s);
71
71
  it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')}]`
72
72
  : ''
73
73
  Content(`
74
- // Load a specific ${eName.toLowerCase()} (returns the bare record; throws on error)
75
- $${eName.toLowerCase()} = $client->${eName}()->load(${loadArg});
74
+ // Load a specific ${eName.toLowerCase()} (returns the ENTITY; call data_get() for the record; throws on error)
75
+ $${eName.toLowerCase()} = $client->${phpEntityAccessor(eName)}()->load(${loadArg});
76
76
  print_r($${eName.toLowerCase()});
77
77
  `)
78
78
  hasCall = true
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, canonKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, Content, canonKey, entityIdField, pickExampleEntity, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -60,7 +60,7 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
60
60
  $client = ${model.const.Name}SDK::test([
61
61
  "entity" => ["${ename}" => ["test01" => ${recBody}]],
62
62
  ]);
63
- $${eVar} = $client->${eName}()->${primaryOp}(${callArg});
63
+ $${eVar} = $client->${phpEntityAccessor(eName)}()->${primaryOp}(${callArg});
64
64
  \`\`\`
65
65
  `)
66
66
  } else {
@@ -11,7 +11,7 @@ import {
11
11
  File,
12
12
  cmp,
13
13
  snakify,
14
- isAuthActive,
14
+ isAuthActive, envName, envToken
15
15
  } from '@voxgig/sdkgen'
16
16
 
17
17
 
@@ -60,7 +60,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
60
60
  const target = props.target
61
61
  const entity: ModelEntity = props.entity
62
62
 
63
- const PROJECTNAME = nom(model, 'Name').toUpperCase().replace(/[^A-Z_]/g, '_')
63
+ const PROJECTNAME = envName(model)
64
64
 
65
65
  const authActive = isAuthActive(model)
66
66
  const apikeyEnvEntry = authActive
@@ -125,7 +125,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
125
125
  ? loadParams.map((p: any) => ` $params["${p.name}"] = ${JSON.stringify(p.example)};`).join('\n')
126
126
  : ''
127
127
 
128
- const entidEnvVar = `${PROJECTNAME}_TEST_${nom(entity, 'NAME').replace(/[^A-Z_]/g, '_')}_ENTID`
128
+ const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
129
129
 
130
130
  File({ name: entity.Name + 'DirectTest.' + target.ext }, () => {
131
131
 
@@ -24,7 +24,8 @@ import {
24
24
  buildIdNames,
25
25
  getMatchEntries,
26
26
  isAuthActive,
27
- entityDataIdField,
27
+ entityDataIdField, envName, envToken,
28
+ phpEntityAccessor,
28
29
  } from '@voxgig/sdkgen'
29
30
 
30
31
 
@@ -61,15 +62,16 @@ const TestEntity = cmp(function TestEntity(props: any) {
61
62
  return
62
63
  }
63
64
 
64
- // PHP method names are case-insensitive an entity literally named 'test'
65
- // collides with the static `test()` test-mode constructor on the SDK class.
66
- // Mirror the mangling done in MainEntity_php.ts.
65
+ // The accessor may be mangled to avoid colliding with an SDK class member.
66
+ // This used to carry its own copy of the rule, which only knew about `test`
67
+ // so an entity named `graph_ql` emitted `$client->GraphQl(null)` here,
68
+ // which PHP resolves (case-insensitively) to the SDK's own
69
+ // `graphql(string $query)` and fails with "Argument #1 must be of type
70
+ // string, null given". One helper, one answer.
67
71
  const entName = nom(entity, 'Name')
68
- const accessor = 'test' === entName.toLowerCase()
69
- ? entName + '_'
70
- : entName
72
+ const accessor = phpEntityAccessor(entName)
71
73
 
72
- const PROJUPPER = nom(model.const, 'Name').toUpperCase().replace(/[^A-Z_]/g, '_')
74
+ const PROJUPPER = envName(model)
73
75
 
74
76
  const authActive = isAuthActive(model)
75
77
  const apikeyEnvEntry = authActive
@@ -167,7 +169,7 @@ ${hasList ? `
167
169
  // The basic flow consumes synthetic IDs from the fixture. In live mode
168
170
  // without an *_ENTID env override, those IDs hit the live API and 4xx.
169
171
  if (!empty($setup["synthetic_only"])) {
170
- $this->markTestSkipped("live entity test uses synthetic IDs from fixture — set ${PROJUPPER}_TEST_${entity.name.toUpperCase().replace(/[^A-Z_]/g, '_')}_ENTID JSON to run live");
172
+ $this->markTestSkipped("live entity test uses synthetic IDs from fixture — set ${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID JSON to run live");
171
173
  return;
172
174
  }
173
175
  $client = $setup["client"];
@@ -238,17 +240,17 @@ ${hasList ? `
238
240
  Content(` // Detect ENTID env override before envOverride consumes it. When live
239
241
  // mode is on without a real override, the basic test runs against synthetic
240
242
  // IDs from the fixture and 4xx's. Surface this so the test can skip.
241
- $entid_env_raw = getenv("${PROJUPPER}_TEST_${entity.name.toUpperCase().replace(/[^A-Z_]/g, '_')}_ENTID");
243
+ $entid_env_raw = getenv("${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID");
242
244
  $idmap_overridden = $entid_env_raw !== false && str_starts_with(trim($entid_env_raw), "{");
243
245
 
244
246
  $env = Runner::env_override([
245
- "${PROJUPPER}_TEST_${entity.name.toUpperCase().replace(/[^A-Z_]/g, '_')}_ENTID" => $idmap,
247
+ "${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID" => $idmap,
246
248
  "${PROJUPPER}_TEST_LIVE" => "FALSE",
247
249
  "${PROJUPPER}_TEST_EXPLAIN" => "FALSE",${apikeyEnvEntry}
248
250
  ]);
249
251
 
250
252
  $idmap_resolved = Helpers::to_map(
251
- $env["${PROJUPPER}_TEST_${entity.name.toUpperCase().replace(/[^A-Z_]/g, '_')}_ENTID"]);
253
+ $env["${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID"]);
252
254
  if ($idmap_resolved === null) {
253
255
  $idmap_resolved = Helpers::to_map($idmap);
254
256
  }
@@ -333,7 +335,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
333
335
 
334
336
  Content(`
335
337
  $${datavar}_result = $${entvar}->create($${datavar}, null);
336
- $${datavar} = Helpers::to_map($${datavar}_result);
338
+ $${datavar} = Helpers::to_map(is_object($${datavar}_result) && method_exists($${datavar}_result, 'data_get') ? $${datavar}_result->data_get() : $${datavar}_result);
337
339
  $this->assertNotNull($${datavar});
338
340
  `)
339
341
  if (null != ctx.entity.id) {
@@ -467,7 +469,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
467
469
 
468
470
  Content(`
469
471
  $${resdatavar}_result = $${entvar}->update($${datavar}_up, null);
470
- $${resdatavar} = Helpers::to_map($${resdatavar}_result);
472
+ $${resdatavar} = Helpers::to_map(is_object($${resdatavar}_result) && method_exists($${resdatavar}_result, 'data_get') ? $${resdatavar}_result->data_get() : $${resdatavar}_result);
471
473
  $this->assertNotNull($${resdatavar});
472
474
  `)
473
475
  if (hasEntIdU) {
@@ -532,7 +534,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
532
534
  "id" => $${srcdatavar}["id"],
533
535
  ];
534
536
  $${datavar}_loaded = $${entvar}->load($${matchvar}, null);
535
- $${datavar}_load_result = Helpers::to_map($${datavar}_loaded);
537
+ $${datavar}_load_result = Helpers::to_map(is_object($${datavar}_loaded) && method_exists($${datavar}_loaded, 'data_get') ? $${datavar}_loaded->data_get() : $${datavar}_loaded);
536
538
  $this->assertNotNull($${datavar}_load_result);
537
539
  $this->assertEquals($${datavar}_load_result["id"], $${srcdatavar}["id"]);
538
540
  `)
@@ -277,6 +277,25 @@ class EntyClass
277
277
 
278
278
  $post_done();
279
279
 
280
- return ($utility->done)($ctx);
280
+ $out = ($utility->done)($ctx);
281
+
282
+ // An operation resolves to the ENTITY, not the raw data. Entities are
283
+ // stateful: post_done has just absorbed resdata/resmatch into this
284
+ // instance, and the caller reaches the record through data(). Two
285
+ // structural exceptions: `list` resolves to the ARRAY of entity
286
+ // instances make_result built, and a failed op with throwing disabled
287
+ // hands back the error payload unchanged. `remove` additionally marks
288
+ // the entity deleted; it KEEPS its data, so a caller can still read
289
+ // what was removed. See AGENTS.md "Entity operations return ENTITIES".
290
+ $opname = $ctx->op === null ? null : $ctx->op->name;
291
+
292
+ if ($ctx->result !== null && $ctx->result->ok && $opname !== 'list') {
293
+ if ($opname === 'remove') {
294
+ $this->markDeleted();
295
+ }
296
+ return $this;
297
+ }
298
+
299
+ return $out;
281
300
  }
282
301
  }
@@ -9,6 +9,12 @@ class ProjectNameError extends \Exception
9
9
  public string $msg;
10
10
  public string $sdk;
11
11
 
12
+ // HTTP status of the response that caused this error, or -1 when the
13
+ // request never got one. PROMOTED to the top level: it used to be
14
+ // reachable only at `err->result->status`, so every consumer coupled
15
+ // itself to the internal shape of `result`.
16
+ public int $status = -1;
17
+
12
18
  public function __construct(string $code = "", string $msg = "")
13
19
  {
14
20
  parent::__construct($msg);
@@ -17,6 +23,11 @@ class ProjectNameError extends \Exception
17
23
  $this->sdk = "ProjectName";
18
24
  }
19
25
 
26
+ public function notFound(): bool
27
+ {
28
+ return 404 === $this->status;
29
+ }
30
+
20
31
  public function error(): string
21
32
  {
22
33
  return "{$this->sdk}: {$this->code}: {$this->msg}";
@@ -6,7 +6,8 @@ import {
6
6
  collectDeps,
7
7
  pkgDescription,
8
8
  keywords,
9
- repoInfo,
9
+ repoInfo, packageName,
10
+ packageVersion
10
11
  } from '@voxgig/sdkgen'
11
12
 
12
13
 
@@ -26,7 +27,7 @@ const Package = cmp(async function Package(props: any) {
26
27
  // package (the `${model.name}_sdk/` dir) is unchanged.
27
28
  const ns = model.origin || 'voxgig-sdk'
28
29
  const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
29
- const distName = `${ns}-${pkgBase}`
30
+ const distName = packageName(model, 'py')
30
31
  const { repoUrl, issuesUrl } = repoInfo(model)
31
32
  const kw = keywords(model).map((k) => `"${k}"`).join(', ')
32
33
 
@@ -37,7 +38,7 @@ build-backend = "setuptools.build_meta"
37
38
 
38
39
  [project]
39
40
  name = "${distName}"
40
- version = "0.0.1"
41
+ version = "${packageVersion(model, target.name)}"
41
42
  description = "${pkgDescription(model, 'py')}"
42
43
  readme = "README.md"
43
44
  license = "MIT"
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -25,6 +25,17 @@ function pyLit(type: any, placeholder: string = 'example'): string {
25
25
  // Operation method spelling differs between Go and other languages — Go
26
26
  // uses PascalCase methods with explicit ctrl arg, others use lowercase
27
27
  // methods with optional ctrl. The op descriptions are language-agnostic.
28
+ // A `list()` on a NESTED entity needs its parent path params. The
29
+ // quickstart used to emit `client.Moon().list()` for an entity at
30
+ // `/planet/{planet_id}/moon`, which 404s against a live server from a
31
+ // half-built URL — indistinguishable from "no such record". The model
32
+ // already marks those params `reqd: true`; matchArg renders exactly them.
33
+ function listMatchArg(ent: any): string {
34
+ const idF = entityIdField(ent)
35
+ return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
36
+ }
37
+
38
+
28
39
  const OP_DESC: Record<string, { method: string, desc: string }> = {
29
40
  load: { method: 'load(match)', desc: 'Load a single entity by match criteria.' },
30
41
  list: { method: 'list()', desc: 'List entities, optionally matching the given criteria.' },
@@ -138,7 +149,7 @@ ${eVar} = client.${entity.Name}().load(${loadArg})
138
149
  Content(`#### Example: List
139
150
 
140
151
  \`\`\`python
141
- ${eVar}s = client.${entity.Name}().list()
152
+ ${eVar}s = client.${entity.Name}().list(${listMatchArg(entity)})
142
153
  \`\`\`
143
154
 
144
155
  `)
@@ -54,7 +54,8 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
54
54
  // The op-driven test-mode line, shown only when the SDK has an entity op.
55
55
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
56
56
  const testModeExample = primaryOp
57
- ? `# Entity ops return the bare record and raise on error.
57
+ ? `# Entity ops return the ENTITY and raises on error;
58
+ // call data_get() for the record.
58
59
  ${eVar} = client.${eName}().${primaryOp}(${testArg})
59
60
  # ${eVar} contains the mock response record`
60
61
  : `result = client.direct({"path": "/api/resource", "method": "GET"})
@@ -94,7 +94,7 @@ ${opRows}
94
94
 
95
95
  ### Result shape
96
96
 
97
- Entity operations return the bare result data (a \`dict\` for single-entity
97
+ Entity operations return the ENTITY (call data_get() for the record) (a \`dict\` for single-entity
98
98
  ops, a \`list\` for \`list\`) and raise on error. Wrap calls in
99
99
  \`try\`/\`except\` to handle failures.
100
100
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -8,6 +8,17 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
 
11
+ // A `list()` on a NESTED entity needs its parent path params. The
12
+ // quickstart used to emit `client.Moon().list()` for an entity at
13
+ // `/planet/{planet_id}/moon`, which 404s against a live server from a
14
+ // half-built URL — indistinguishable from "no such record". The model
15
+ // already marks those params `reqd: true`; matchArg renders exactly them.
16
+ function listMatchArg(ent: any): string {
17
+ const idF = entityIdField(ent)
18
+ return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
19
+ }
20
+
21
+
11
22
  const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
12
23
  const { target, ctx$: { model } } = props
13
24
 
@@ -78,7 +89,7 @@ error — iterate it directly.
78
89
 
79
90
  \`\`\`python
80
91
  try:
81
- ${eVar}s = client.${eName}().list()
92
+ ${eVar}s = client.${eName}().list(${listMatchArg(exampleEntity)})
82
93
  for ${eVar} in ${eVar}s:
83
94
  print(${eVar})
84
95
  except Exception as err:
@@ -111,7 +122,7 @@ except Exception as err:
111
122
  Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
112
123
 
113
124
  ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
114
- \`load()\` returns the bare record (a \`dict\`) and raises on error.
125
+ \`load()\` returns the ENTITY call data_get() for the record — and raises on error.
115
126
 
116
127
  \`\`\`python
117
128
  try:
@@ -139,7 +150,7 @@ except Exception as err:
139
150
 
140
151
  Content(`### 3. Load ${article} ${eName.toLowerCase()}
141
152
 
142
- \`load()\` returns the bare record (a \`dict\`) and raises on error.
153
+ \`load()\` returns the ENTITY call data_get() for the record — and raises on error.
143
154
 
144
155
  \`\`\`python
145
156
  try:
@@ -180,7 +191,7 @@ except Exception as err:
180
191
  return it && it.type
181
192
  }
182
193
  const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
183
- ? `created["${dataIdF}"]`
194
+ ? `created.data_get()["${dataIdF}"]`
184
195
  : pyLit(idParamType(opname), 'example_id')
185
196
 
186
197
  if (opnames.includes('create') || opnames.includes('update') || opnames.includes('remove')) {
@@ -189,7 +200,7 @@ except Exception as err:
189
200
  \`\`\`python
190
201
  `)
191
202
  if (opnames.includes('create')) {
192
- Content(`# Create — returns the bare created record (a dict)
203
+ Content(`# Create — returns the ENTITY (call data_get() for the record)
193
204
  created = client.${eName}().create({${examplePairs('create').join(', ')}})
194
205
 
195
206
  `)
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -20,6 +20,17 @@ function pyLit(type: any, placeholder: string = 'example'): string {
20
20
  }
21
21
 
22
22
 
23
+ // A `list()` on a NESTED entity needs its parent path params. The
24
+ // quickstart used to emit `client.Moon().list()` for an entity at
25
+ // `/planet/{planet_id}/moon`, which 404s against a live server from a
26
+ // half-built URL — indistinguishable from "no such record". The model
27
+ // already marks those params `reqd: true`; matchArg renders exactly them.
28
+ function listMatchArg(ent: any): string {
29
+ const idF = entityIdField(ent)
30
+ return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
31
+ }
32
+
33
+
23
34
  const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
24
35
  load: {
25
36
  sig: 'load(reqmatch, ctrl=None) -> dict',
@@ -253,7 +264,7 @@ ${info.desc}
253
264
 
254
265
  `)
255
266
 
256
- // Show example. Entity ops return the bare result and raise on
267
+ // Show example. Entity ops return the ENTITY and raise on
257
268
  // error; direct() is the only method that returns a result dict.
258
269
  if ('load' === opname || 'remove' === opname) {
259
270
  // The id key plus every REQUIRED match key (parent path params
@@ -276,7 +287,7 @@ result = client.${ent.Name}().${opname}(${arg})
276
287
  }
277
288
  else if ('list' === opname) {
278
289
  Content(`\`\`\`python
279
- results = client.${ent.Name}().list()
290
+ results = client.${ent.Name}().list(${listMatchArg(ent)})
280
291
  for ${eVar} in results:
281
292
  print(${eVar})
282
293
  \`\`\`
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -22,6 +22,17 @@ function pyLit(type: any, placeholder: string = 'example'): string {
22
22
  }
23
23
 
24
24
 
25
+ // A `list()` on a NESTED entity needs its parent path params. The
26
+ // quickstart used to emit `client.Moon().list()` for an entity at
27
+ // `/planet/{planet_id}/moon`, which 404s against a live server from a
28
+ // half-built URL — indistinguishable from "no such record". The model
29
+ // already marks those params `reqd: true`; matchArg renders exactly them.
30
+ function listMatchArg(ent: any): string {
31
+ const idF = entityIdField(ent)
32
+ return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
33
+ }
34
+
35
+
25
36
  const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
26
37
  const { target, ctx$: { model } } = props
27
38
 
@@ -56,7 +67,7 @@ client = ${ctor}
56
67
 
57
68
  if (opnames.includes('list')) {
58
69
  Content(`# List all ${eName.toLowerCase()}s (returns a list, raises on error)
59
- ${eVar}s = client.${eName}().list()
70
+ ${eVar}s = client.${eName}().list(${listMatchArg(exampleEntity)})
60
71
  for ${eVar} in ${eVar}s:
61
72
  print(${eVar})
62
73
  `)
@@ -11,7 +11,7 @@ import {
11
11
  File,
12
12
  cmp,
13
13
  snakify,
14
- isAuthActive,
14
+ isAuthActive, envName, envToken
15
15
  } from '@voxgig/sdkgen'
16
16
 
17
17
 
@@ -60,7 +60,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
60
60
  const target = props.target
61
61
  const entity: ModelEntity = props.entity
62
62
 
63
- const PROJECTNAME = nom(model, 'Name').toUpperCase().replace(/[^A-Z_]/g, '_')
63
+ const PROJECTNAME = envName(model)
64
64
 
65
65
  const authActive = isAuthActive(model)
66
66
  const apikeyEnvEntry = authActive
@@ -128,7 +128,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
128
128
  ? loadParams.map((p: any) => ` params["${p.name}"] = ${JSON.stringify(p.example)}`).join('\n')
129
129
  : ''
130
130
 
131
- const entidEnvVar = `${PROJECTNAME}_TEST_${nom(entity, 'NAME').replace(/[^A-Z_]/g, '_')}_ENTID`
131
+ const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
132
132
 
133
133
  File({ name: 'test_' + entity.name + '_direct.' + target.ext }, () => {
134
134