@voxgig/sdkgen 2.0.1 → 3.0.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 (394) hide show
  1. package/bin/voxgig-sdkgen +22 -2
  2. package/dist/action/doctor.d.ts +14 -0
  3. package/dist/action/doctor.js +296 -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/Feature.js +2 -1
  13. package/dist/cmp/Feature.js.map +1 -1
  14. package/dist/cmp/Main.js +5 -1
  15. package/dist/cmp/Main.js.map +1 -1
  16. package/dist/cmp/ReadmeExplanation.js +1 -1
  17. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  18. package/dist/cmp/ReadmeTop.js +16 -6
  19. package/dist/cmp/ReadmeTop.js.map +1 -1
  20. package/dist/cmp/Registered.d.ts +7 -0
  21. package/dist/cmp/Registered.js +70 -0
  22. package/dist/cmp/Registered.js.map +1 -0
  23. package/dist/cmp/Test.js +3 -1
  24. package/dist/cmp/Test.js.map +1 -1
  25. package/dist/helpers/dryrun.d.ts +10 -0
  26. package/dist/helpers/dryrun.js +35 -0
  27. package/dist/helpers/dryrun.js.map +1 -0
  28. package/dist/helpers/featureSource.d.ts +13 -0
  29. package/dist/helpers/featureSource.js +156 -0
  30. package/dist/helpers/featureSource.js.map +1 -0
  31. package/dist/helpers/naming.d.ts +9 -1
  32. package/dist/helpers/naming.js +66 -2
  33. package/dist/helpers/naming.js.map +1 -1
  34. package/dist/helpers/opExample.js +23 -3
  35. package/dist/helpers/opExample.js.map +1 -1
  36. package/dist/helpers/opShape.d.ts +11 -1
  37. package/dist/helpers/opShape.js +51 -0
  38. package/dist/helpers/opShape.js.map +1 -1
  39. package/dist/helpers/packageMeta.d.ts +8 -1
  40. package/dist/helpers/packageMeta.js +141 -10
  41. package/dist/helpers/packageMeta.js.map +1 -1
  42. package/dist/helpers/stdrep.d.ts +3 -0
  43. package/dist/helpers/stdrep.js +47 -0
  44. package/dist/helpers/stdrep.js.map +1 -0
  45. package/dist/helpers/testPolicy.d.ts +2 -0
  46. package/dist/helpers/testPolicy.js +46 -0
  47. package/dist/helpers/testPolicy.js.map +1 -0
  48. package/dist/sdkgen.d.ts +15 -6
  49. package/dist/sdkgen.js +45 -4
  50. package/dist/sdkgen.js.map +1 -1
  51. package/dist/tsconfig.tsbuildinfo +1 -1
  52. package/model/sdkgen.aontu +125 -0
  53. package/package.json +8 -5
  54. package/project/.sdk/model/target/c.aontu +28 -3
  55. package/project/.sdk/model/target/clojure.aontu +24 -3
  56. package/project/.sdk/model/target/cpp.aontu +25 -3
  57. package/project/.sdk/model/target/csharp.aontu +25 -3
  58. package/project/.sdk/model/target/dart.aontu +15 -3
  59. package/project/.sdk/model/target/elixir.aontu +15 -3
  60. package/project/.sdk/model/target/go-cli.aontu +17 -1
  61. package/project/.sdk/model/target/go-mcp.aontu +17 -1
  62. package/project/.sdk/model/target/go.aontu +14 -4
  63. package/project/.sdk/model/target/haskell.aontu +24 -3
  64. package/project/.sdk/model/target/java.aontu +26 -3
  65. package/project/.sdk/model/target/js.aontu +15 -3
  66. package/project/.sdk/model/target/kotlin.aontu +26 -3
  67. package/project/.sdk/model/target/lean.aontu +25 -3
  68. package/project/.sdk/model/target/lua.aontu +15 -3
  69. package/project/.sdk/model/target/ocaml.aontu +24 -3
  70. package/project/.sdk/model/target/perl.aontu +15 -3
  71. package/project/.sdk/model/target/php.aontu +15 -3
  72. package/project/.sdk/model/target/py-data.aontu +16 -3
  73. package/project/.sdk/model/target/py.aontu +15 -3
  74. package/project/.sdk/model/target/rb.aontu +15 -3
  75. package/project/.sdk/model/target/rust.aontu +25 -3
  76. package/project/.sdk/model/target/scala.aontu +25 -3
  77. package/project/.sdk/model/target/swift.aontu +25 -3
  78. package/project/.sdk/model/target/ts.aontu +15 -3
  79. package/project/.sdk/model/target/zig.aontu +26 -3
  80. package/project/.sdk/src/cmp/c/Config_c.ts +10 -11
  81. package/project/.sdk/src/cmp/c/Entity_c.ts +5 -1
  82. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +23 -5
  83. package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +9 -2
  84. package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +19 -2
  85. package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +9 -2
  86. package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +12 -2
  87. package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +9 -2
  88. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -0
  89. package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +6 -3
  90. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
  91. package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +2 -2
  92. package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +2 -2
  93. package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +12 -8
  94. package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +2 -2
  95. package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +5 -1
  96. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +24 -11
  97. package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +8 -2
  98. package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +18 -2
  99. package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +8 -2
  100. package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +11 -2
  101. package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +8 -2
  102. package/project/.sdk/src/cmp/csharp/Package_csharp.ts +2 -1
  103. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
  104. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +6 -6
  105. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +38 -1
  106. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +42 -33
  107. package/project/.sdk/src/cmp/dart/Config_dart.ts +6 -0
  108. package/project/.sdk/src/cmp/dart/Package_dart.ts +2 -1
  109. package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +13 -2
  110. package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +2 -1
  111. package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +3 -3
  112. package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +1 -1
  113. package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +17 -6
  114. package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +13 -2
  115. package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +13 -2
  116. package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +3 -3
  117. package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +8 -8
  118. package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +18 -1
  119. package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +9 -1
  120. package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +9 -1
  121. package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +15 -1
  122. package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +9 -1
  123. package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +8 -0
  124. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
  125. package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +2 -2
  126. package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +7 -4
  127. package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +11 -2
  128. package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +2 -1
  129. package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +1 -0
  130. package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +2 -1
  131. package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -1
  132. package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +2 -1
  133. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +38 -8
  134. package/project/.sdk/src/cmp/go/Entity_go.ts +2 -2
  135. package/project/.sdk/src/cmp/go/Main_go.ts +4 -5
  136. package/project/.sdk/src/cmp/go/Package_go.ts +8 -5
  137. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +2 -2
  138. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
  139. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +4 -2
  140. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +2 -2
  141. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +2 -2
  142. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +2 -2
  143. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
  144. package/project/.sdk/src/cmp/go/TestDirect_go.ts +21 -15
  145. package/project/.sdk/src/cmp/go/TestEntity_go.ts +9 -9
  146. package/project/.sdk/src/cmp/go/Test_go.ts +2 -2
  147. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -1
  148. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +4 -4
  149. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +4 -4
  150. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +2 -1
  151. package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +10 -5
  152. package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +10 -8
  153. package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +14 -10
  154. package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +21 -18
  155. package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +4 -4
  156. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +23 -11
  157. package/project/.sdk/src/cmp/java/Package_java.ts +2 -1
  158. package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -1
  159. package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +2 -2
  160. package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +1 -1
  161. package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +3 -3
  162. package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
  163. package/project/.sdk/src/cmp/java/TestEntity_java.ts +6 -6
  164. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +34 -1
  165. package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +12 -0
  166. package/project/.sdk/src/cmp/js/Main_js.ts +4 -1
  167. package/project/.sdk/src/cmp/js/Package_js.ts +7 -1
  168. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -2
  169. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -1
  170. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +13 -2
  171. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +13 -2
  172. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -1
  173. package/project/.sdk/src/cmp/js/TestDirect_js.ts +3 -3
  174. package/project/.sdk/src/cmp/js/TestEntity_js.ts +8 -8
  175. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +22 -1
  176. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +9 -1
  177. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +9 -1
  178. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +15 -1
  179. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +9 -1
  180. package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +13 -0
  181. package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +2 -1
  182. package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -1
  183. package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +2 -2
  184. package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +1 -1
  185. package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +3 -3
  186. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
  187. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +6 -6
  188. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +32 -1
  189. package/project/.sdk/src/cmp/lean/Package_lean.ts +3 -1
  190. package/project/.sdk/src/cmp/lean/Test_lean.ts +75 -21
  191. package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +9 -4
  192. package/project/.sdk/src/cmp/lua/Package_lua.ts +4 -3
  193. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +11 -3
  194. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
  195. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
  196. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +9 -9
  197. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +37 -1
  198. package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +12 -0
  199. package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +30 -3
  200. package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +11 -5
  201. package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +3 -1
  202. package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +10 -5
  203. package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +6 -2
  204. package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +10 -8
  205. package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +14 -13
  206. package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +20 -18
  207. package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -4
  208. package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +8 -2
  209. package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +8 -5
  210. package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -1
  211. package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +1 -1
  212. package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +3 -3
  213. package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +1 -1
  214. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
  215. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +6 -6
  216. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +36 -1
  217. package/project/.sdk/src/cmp/php/MainEntity_php.ts +21 -16
  218. package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
  219. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +6 -6
  220. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +4 -3
  221. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -2
  222. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
  223. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +12 -12
  224. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +6 -6
  225. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +4 -4
  226. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
  227. package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
  228. package/project/.sdk/src/cmp/php/TestEntity_php.ts +17 -15
  229. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +20 -1
  230. package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +11 -0
  231. package/project/.sdk/src/cmp/py/Package_py.ts +4 -3
  232. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +13 -2
  233. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -1
  234. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
  235. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +17 -6
  236. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +14 -3
  237. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +13 -2
  238. package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
  239. package/project/.sdk/src/cmp/py/TestEntity_py.ts +9 -9
  240. package/project/.sdk/src/cmp/py/Test_py.ts +4 -1
  241. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +29 -1
  242. package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +11 -0
  243. package/project/.sdk/src/cmp/py-data/Main_py-data.ts +2 -1
  244. package/project/.sdk/src/cmp/rb/Package_rb.ts +4 -3
  245. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +1 -1
  246. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -1
  247. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +5 -5
  248. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
  249. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
  250. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +9 -9
  251. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +31 -1
  252. package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +10 -1
  253. package/project/.sdk/src/cmp/rust/Entity_rust.ts +5 -1
  254. package/project/.sdk/src/cmp/rust/Main_rust.ts +21 -0
  255. package/project/.sdk/src/cmp/rust/Package_rust.ts +2 -1
  256. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
  257. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +12 -12
  258. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +18 -0
  259. package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +8 -2
  260. package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +20 -3
  261. package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +8 -2
  262. package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +10 -2
  263. package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +8 -2
  264. package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +10 -0
  265. package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -1
  266. package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +3 -3
  267. package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +1 -1
  268. package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +3 -3
  269. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +3 -3
  270. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +27 -1
  271. package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -1
  272. package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +3 -3
  273. package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +1 -1
  274. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +3 -3
  275. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +34 -1
  276. package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +9 -1
  277. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +18 -1
  278. package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +5 -2
  279. package/project/.sdk/src/cmp/ts/Main_ts.ts +4 -1
  280. package/project/.sdk/src/cmp/ts/Package_ts.ts +10 -1
  281. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -2
  282. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -1
  283. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +21 -6
  284. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +52 -2
  285. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +14 -3
  286. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +34 -2
  287. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +64 -43
  288. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +8 -8
  289. package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +2 -2
  290. package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -2
  291. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +25 -1
  292. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +10 -2
  293. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
  294. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +10 -2
  295. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +27 -3
  296. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +10 -2
  297. package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +15 -0
  298. package/project/.sdk/src/cmp/zig/Entity_zig.ts +5 -1
  299. package/project/.sdk/src/cmp/zig/Package_zig.ts +3 -1
  300. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +39 -0
  301. package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +2 -2
  302. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -2
  303. package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +2 -2
  304. package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +5 -2
  305. package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +2 -2
  306. package/project/.sdk/tm/c/VERSION +1 -1
  307. package/project/.sdk/tm/c/core/helpers.c +1 -0
  308. package/project/.sdk/tm/c/core/sdk.h +22 -6
  309. package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
  310. package/project/.sdk/tm/c/tests/primary_utility_test.c +4 -1
  311. package/project/.sdk/tm/c/utility/graphql.c +1 -1
  312. package/project/.sdk/tm/c/utility/make_url.c +1 -0
  313. package/project/.sdk/tm/c/utility/param.c +1 -0
  314. package/project/.sdk/tm/clojure/VERSION +1 -1
  315. package/project/.sdk/tm/cpp/VERSION +1 -1
  316. package/project/.sdk/tm/cpp/core/types.hpp +33 -8
  317. package/project/.sdk/tm/cpp/test/pipeline_test.cpp +5 -0
  318. package/project/.sdk/tm/cpp/test/runner_support.hpp +4 -4
  319. package/project/.sdk/tm/csharp/VERSION +1 -1
  320. package/project/.sdk/tm/csharp/core/Types.cs +6 -0
  321. package/project/.sdk/tm/csharp/test/FeatureHarness.cs +396 -0
  322. package/project/.sdk/tm/csharp/test/FeatureTest.cs +7 -385
  323. package/project/.sdk/tm/csharp/test/Runner.cs +4 -4
  324. package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +4 -0
  325. package/project/.sdk/tm/dart/test/utility.dart +4 -4
  326. package/project/.sdk/tm/elixir/VERSION +1 -1
  327. package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +26 -0
  328. package/project/.sdk/tm/go/VERSION +1 -1
  329. package/project/.sdk/tm/go/core/types.go +6 -0
  330. package/project/.sdk/tm/go/test/feature_harness_test.go +361 -0
  331. package/project/.sdk/tm/go/test/feature_test.go +7 -350
  332. package/project/.sdk/tm/go/test/pipeline_test.go +6 -0
  333. package/project/.sdk/tm/go/test/runner_test.go +16 -4
  334. package/project/.sdk/tm/haskell/VERSION +1 -1
  335. package/project/.sdk/tm/haskell/src/SdkFeatures.hs +28 -5
  336. package/project/.sdk/tm/haskell/src/SdkTypes.hs +14 -5
  337. package/project/.sdk/tm/java/VERSION +1 -1
  338. package/project/.sdk/tm/java/test/RunnerSupport.java +4 -4
  339. package/project/.sdk/tm/java/utility/MakeError.java +4 -0
  340. package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +4 -0
  341. package/project/.sdk/tm/js/test/utility.js +3 -3
  342. package/project/.sdk/tm/kotlin/VERSION +1 -1
  343. package/project/.sdk/tm/kotlin/core/Utility.kt +2 -0
  344. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
  345. package/project/.sdk/tm/lean/Makefile +25 -0
  346. package/project/.sdk/tm/lean/VERSION +1 -1
  347. package/project/.sdk/tm/lean/src/SdkUtility.lean +11 -9
  348. package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
  349. package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +5 -2
  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/swift/VERSION +1 -1
  370. package/project/.sdk/tm/ts/src/tsconfig.json +1 -0
  371. package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +4 -0
  372. package/project/.sdk/tm/ts/test/tsconfig.json +1 -0
  373. package/project/.sdk/tm/ts/test/utility.ts +3 -3
  374. package/project/.sdk/tm/zig/VERSION +1 -1
  375. package/src/action/doctor.ts +410 -0
  376. package/src/action/feature.ts +54 -16
  377. package/src/action/target.ts +174 -25
  378. package/src/cmp/Entity.ts +7 -0
  379. package/src/cmp/Feature.ts +3 -1
  380. package/src/cmp/Main.ts +7 -1
  381. package/src/cmp/ReadmeExplanation.ts +2 -2
  382. package/src/cmp/ReadmeTop.ts +22 -9
  383. package/src/cmp/Registered.ts +100 -0
  384. package/src/cmp/Test.ts +4 -1
  385. package/src/helpers/dryrun.ts +57 -0
  386. package/src/helpers/featureSource.ts +208 -0
  387. package/src/helpers/naming.ts +73 -2
  388. package/src/helpers/opExample.ts +19 -2
  389. package/src/helpers/opShape.ts +65 -0
  390. package/src/helpers/packageMeta.ts +163 -10
  391. package/src/helpers/stdrep.ts +56 -0
  392. package/src/helpers/testPolicy.ts +52 -0
  393. package/src/sdkgen.ts +70 -4
  394. package/project/.sdk/tm/rust/feature/mod.rs +0 -24
@@ -49,9 +49,9 @@ let () =
49
49
  const idF = entityIdField(exampleEntity)
50
50
 
51
51
  if (opnames.includes('list')) {
52
- Content(` (* List all ${fn} records (returns a List value; raises on error) *)
52
+ Content(` (* List all ${fn} records (one ENTITY per record; raises on error) *)
53
53
  let ${fn}s = (Sdk_client.${fn} client Noval).e_list (empty_map ()) Noval in
54
- (match ${fn}s with List items -> List.iter (fun r -> print_endline (stringify r)) !items | _ -> ());
54
+ List.iter (fun e -> print_endline (stringify (e.e_data_get ()))) ${fn}s;
55
55
  `)
56
56
  }
57
57
 
@@ -68,9 +68,9 @@ let () =
68
68
  `("${it.name}", ${ocamlLit(it.type,
69
69
  it.name === idF ? 'example_id' : 'example_' + it.name)})`).join('; ')}]`
70
70
  : 'Noval'
71
- Content(` (* Load a specific ${fn} (returns the record; raises on error) *)
71
+ Content(` (* Load a specific ${fn} (returns the ENTITY; raises on error) *)
72
72
  let ${fn} = (Sdk_client.${fn} client Noval).e_load (${loadArg}) Noval in
73
- print_endline (stringify ${fn})
73
+ print_endline (stringify (${fn}.e_data_get ()))
74
74
  `)
75
75
  }
76
76
  }
@@ -63,8 +63,14 @@ let () =
63
63
  const chosen = required.length ? required : items.slice(0, 3)
64
64
  arg = `(jo [${chosen.map((it: any) => `("${it.name}", ${ocamlLit(it.type)})`).join('; ')}])`
65
65
  }
66
- Content(` let result = (Sdk_client.${fn} client Noval).${field} ${arg} Noval in
67
- print_endline (stringify result)
66
+ // The op resolves to the ENTITY (list: one per record); the record is
67
+ // reached with e_data_get.
68
+ Content('list' === primaryOp
69
+ ? ` let results = (Sdk_client.${fn} client Noval).${field} ${arg} Noval in
70
+ List.iter (fun e -> print_endline (stringify (e.e_data_get ()))) results
71
+ `
72
+ : ` let result = (Sdk_client.${fn} client Noval).${field} ${arg} Noval in
73
+ print_endline (stringify (result.e_data_get ()))
68
74
  `)
69
75
  }
70
76
 
@@ -53,17 +53,20 @@ let () =
53
53
  ignore ent;
54
54
  `)
55
55
  if (hasList) {
56
- Content(` let listed = ent.e_list (empty_map ()) Noval in
57
- check "list is a list" (islist listed);
58
- check_int "list size" (size listed) 1;
56
+ Content(` (* The op resolves to one ENTITY per record; the record is reached
57
+ with e_data_get. See AGENTS.md "Entity operations return ENTITIES". *)
58
+ let listed = ent.e_list (empty_map ()) Noval in
59
+ check_int "list size" (List.length listed) 1;
60
+ List.iter (fun en -> check "list entry data is a map" (ismap (en.e_data_get ()))) listed;
59
61
  `)
60
62
  }
61
63
  if (hasLoad) {
62
64
  Content(` let loaded = ent.e_load (jo [("id", Str "${ocamlString(id)}")]) Noval in
63
- check "load is a map" (ismap loaded);
65
+ let loaded_data = loaded.e_data_get () in
66
+ check "load data is a map" (ismap loaded_data);
64
67
  `)
65
68
  if (hasId) {
66
- Content(` check_vstr "load id" (getp loaded "id") "${ocamlString(id)}";
69
+ Content(` check_vstr "load id" (getp loaded_data "id") "${ocamlString(id)}";
67
70
  `)
68
71
  }
69
72
  }
@@ -46,7 +46,8 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
46
46
  // The op-driven test-mode line, shown only when the SDK has an entity op.
47
47
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
48
48
  const testModeExample = primaryOp
49
- ? `# Entity ops return the bare record and die on error.
49
+ ? `# Entity ops return the ENTITY and dies on error;
50
+ // call data_get for the record.
50
51
  my $${eVar} = $client->${eName}->${primaryOp}(${testArg});
51
52
  # $${eVar} contains the mock response record`
52
53
  : `my $result = $client->direct({ 'path' => '/api/resource', 'method' => 'GET' });
@@ -93,7 +93,7 @@ ${opRows}
93
93
 
94
94
  ### Result shape
95
95
 
96
- Entity operations return the bare result data (a \`hashref\` for single-entity
96
+ Entity operations return the ENTITY (call data_get for the record) (a \`hashref\` for single-entity
97
97
  ops, an \`arrayref\` for \`list\`) and die on error. Wrap calls in
98
98
  \`eval { ... }\` and inspect \`$@\` to handle failures.
99
99
 
@@ -106,7 +106,7 @@ else {
106
106
  Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
107
107
 
108
108
  ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
109
- \`load()\` returns the bare record (a \`hashref\`) and dies on error.
109
+ \`load()\` returns the ENTITY — call data_get for the record and dies on error.
110
110
 
111
111
  \`\`\`perl
112
112
  my $${neVar} = eval { $client->${neName}->load({ ${neMatch.join(', ')} }) };
@@ -133,7 +133,7 @@ else {
133
133
 
134
134
  Content(`### 3. Load ${article} ${eName.toLowerCase()}
135
135
 
136
- \`load()\` returns the bare record (a \`hashref\`) and dies on error.
136
+ \`load()\` returns the ENTITY — call data_get for the record and dies on error.
137
137
 
138
138
  \`\`\`perl
139
139
  my $${eVar} = eval { $client->${eName}->load(${loadArg}) };
@@ -178,7 +178,7 @@ else {
178
178
  \`\`\`perl
179
179
  `)
180
180
  if (opnames.includes('create')) {
181
- Content(`# Create — returns the bare created record (a hashref)
181
+ Content(`# Create — returns the ENTITY (call data_get for the record)
182
182
  my $created = $client->${eName}->create({ ${examplePairs('create').join(', ')} });
183
183
 
184
184
  `)
@@ -73,7 +73,7 @@ for my $${eVar} (@$${eVar}s) {
73
73
  it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')} }`
74
74
  : ''
75
75
  Content(`
76
- # Load a specific ${eName.toLowerCase()} (returns the bare record; dies on error)
76
+ # Load a specific ${eName.toLowerCase()} (returns the ENTITY; call data_get for the record; dies on error)
77
77
  my $${eVar} = $client->${eName}->load(${loadArg});
78
78
  print "$${eVar}->{id}\\n";
79
79
  `)
@@ -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
 
@@ -70,7 +70,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
70
70
  const entity: ModelEntity = props.entity
71
71
 
72
72
  const N = model.const.Name
73
- const PROJECTNAME = nom(model, 'Name').toUpperCase().replace(/[^A-Z_]/g, '_')
73
+ const PROJECTNAME = envName(model)
74
74
 
75
75
  const authActive = isAuthActive(model)
76
76
  const apikeyEnvEntry = authActive
@@ -132,7 +132,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
132
132
  ? loadParams.map((p: any) => ` $params->{'${p.name}'} = ${perlScalar(p.example)};`).join('\n')
133
133
  : ''
134
134
 
135
- const entidEnvVar = `${PROJECTNAME}_TEST_${nom(entity, 'NAME').replace(/[^A-Z_]/g, '_')}_ENTID`
135
+ const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
136
136
 
137
137
  File({ name: entity.name + '_direct.t' }, () => {
138
138
 
@@ -17,7 +17,7 @@ import {
17
17
  each,
18
18
  buildIdNames,
19
19
  getMatchEntries,
20
- isAuthActive,
20
+ isAuthActive, envName, envToken
21
21
  } from '@voxgig/sdkgen'
22
22
 
23
23
 
@@ -48,8 +48,8 @@ const TestEntity = cmp(function TestEntity(props: any) {
48
48
  }
49
49
 
50
50
  const N = model.const.Name
51
- const PROJUPPER = nom(model.const, 'Name').toUpperCase().replace(/[^A-Z_]/g, '_')
52
- const ENTUPPER = entity.name.toUpperCase().replace(/[^A-Z_]/g, '_')
51
+ const PROJUPPER = envName(model)
52
+ const ENTUPPER = envToken(entity.name)
53
53
  const ENTIDVAR = `${PROJUPPER}_TEST_${ENTUPPER}_ENTID`
54
54
 
55
55
  const authActive = isAuthActive(model)
@@ -263,7 +263,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
263
263
 
264
264
  Content(`
265
265
  $V{${datavar}_result} = $V{${entvar}}->create($V{${datavar}}, undef);
266
- $V{${datavar}} = ${N}Helpers::to_map($V{${datavar}_result});
266
+ $V{${datavar}} = ${N}Helpers::to_map(ref($V{${datavar}_result}) && $V{${datavar}_result}->can('data_get') ? $V{${datavar}_result}->data_get : $V{${datavar}_result});
267
267
  ok(defined $V{${datavar}}, '${entity.name} create: data');
268
268
  `)
269
269
  if (null != ctx.entity.id) {
@@ -395,7 +395,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
395
395
 
396
396
  Content(`
397
397
  $V{${resdatavar}_result} = $V{${entvar}}->update($V{${datavar}_up}, undef);
398
- $V{${resdatavar}} = ${N}Helpers::to_map($V{${resdatavar}_result});
398
+ $V{${resdatavar}} = ${N}Helpers::to_map(ref($V{${resdatavar}_result}) && $V{${resdatavar}_result}->can('data_get') ? $V{${resdatavar}_result}->data_get : $V{${resdatavar}_result});
399
399
  ok(defined $V{${resdatavar}}, '${entity.name} update: data');
400
400
  `)
401
401
  if (hasEntIdU) {
@@ -460,7 +460,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
460
460
  'id' => $V{${srcdatavar}}{id},
461
461
  };
462
462
  $V{${datavar}_loaded} = $V{${entvar}}->load($V{${matchvar}}, undef);
463
- $V{${datavar}_load_result} = ${N}Helpers::to_map($V{${datavar}_loaded});
463
+ $V{${datavar}_load_result} = ${N}Helpers::to_map(ref($V{${datavar}_loaded}) && $V{${datavar}_loaded}->can('data_get') ? $V{${datavar}_loaded}->data_get : $V{${datavar}_loaded});
464
464
  ok(defined $V{${datavar}_load_result}, '${entity.name} load: data');
465
465
  is($V{${datavar}_load_result}{id}, $V{${srcdatavar}}{id}, '${entity.name} load: id');
466
466
  `)
@@ -33,6 +33,7 @@ sub new {
33
33
  _utility => $client->get_utility,
34
34
  _entopts => $entopts,
35
35
  _data => {},
36
+ _deleted => 0,
36
37
  _match => {},
37
38
  }, $class;
38
39
 
@@ -57,6 +58,22 @@ sub make {
57
58
  return EntyClass->new($self->{_client}, $opts);
58
59
  }
59
60
 
61
+ # Every operation resolves to the entity; `remove` additionally marks
62
+ # it. The instance KEEPS the data it held — a caller can still read what
63
+ # was deleted — but it is no longer a live record. See AGENTS.md.
64
+ sub mark_deleted {
65
+ my ($self) = @_;
66
+ $self->{_deleted} = 1;
67
+ return $self;
68
+ }
69
+
70
+
71
+ sub deleted {
72
+ my ($self) = @_;
73
+ return $self->{_deleted} ? 1 : 0;
74
+ }
75
+
76
+
60
77
  sub data_set {
61
78
  my ($self, $args) = @_;
62
79
  if ($args) {
@@ -222,7 +239,25 @@ sub _run_op {
222
239
 
223
240
  $post_done->();
224
241
 
225
- $utility->{done}->($ctx);
242
+ my $out = $utility->{done}->($ctx);
243
+
244
+ # An operation resolves to the ENTITY, not the raw data. Entities are
245
+ # stateful: post_done has just absorbed resdata/resmatch into this
246
+ # instance, and the caller reaches the record through data(). Two
247
+ # structural exceptions: `list` resolves to the ARRAY of entity
248
+ # instances make_result built, and a failed op with throwing disabled
249
+ # hands back the error payload unchanged. `remove` additionally marks
250
+ # the entity deleted; it KEEPS its data, so a caller can still read
251
+ # what was removed. See AGENTS.md "Entity operations return ENTITIES".
252
+ my $opname = $ctx->{op} ? $ctx->{op}{name} : undef;
253
+
254
+ if ($ctx->{result} && $ctx->{result}{ok}
255
+ && (!defined $opname || $opname ne 'list')) {
256
+ $self->mark_deleted if defined $opname && $opname eq 'remove';
257
+ return $self;
258
+ }
259
+
260
+ $out;
226
261
  };
227
262
  if (my $operr = $@) {
228
263
  # #PreUnexpected-Hook
@@ -1,6 +1,9 @@
1
1
 
2
2
 
3
- import { cmp, Content, entityClassName, entityCollection } from '@voxgig/sdkgen'
3
+ import {
4
+ cmp, Content, entityClassName, entityCollection,
5
+ phpEntityAccessor, entityCacheField,
6
+ } from '@voxgig/sdkgen'
4
7
 
5
8
  import {
6
9
  KIT,
@@ -8,12 +11,6 @@ import {
8
11
  } from '@voxgig/apidef'
9
12
 
10
13
 
11
- // Reserved PHP method names on the SDK class that an entity accessor must
12
- // not collide with. PHP method names are case-insensitive at declaration
13
- // time, so an entity literally named 'test' would collide with the static
14
- // `test()` test-mode constructor. Mangle to `<Name>_` in that case.
15
- const PHP_RESERVED_LOWER = new Set(['test'])
16
-
17
14
  const MainEntity = cmp(async function MainEntity(props: any) {
18
15
  const { entity } = props
19
16
  const { model } = props.ctx$
@@ -28,24 +25,32 @@ const MainEntity = cmp(async function MainEntity(props: any) {
28
25
  // a convenience — we declare it ONCE under the PascalCase name. An entity
29
26
  // literally named 'test' would collide (case-insensitively) with the static
30
27
  // `test()` test-mode constructor, so mangle to `<Name>_` in that case.
31
- const accessor = PHP_RESERVED_LOWER.has(entity.name.toLowerCase())
32
- ? entity.Name + '_'
33
- : entity.Name
28
+ const accessor = phpEntityAccessor(entity.Name)
29
+
30
+ // The backing field is mangled independently of the accessor: the two are
31
+ // compared against different member sets, and an entity can collide with
32
+ // one without colliding with the other.
33
+ const field = entityCacheField(entity.name)
34
34
 
35
35
  Content(`
36
- private $_${entity.name} = null;
36
+ private $_${field} = null;
37
37
 
38
- // Canonical facade: $client->${accessor}()->list() / ->load(["id" => ...]).
38
+ // Canonical facade: $client->${accessor}()->list() / ->load(["id" => ...]).${
39
+ accessor === entity.Name
40
+ ? `
39
41
  // PHP method names are case-insensitive, so lowercase $client->${entity.name}()
40
- // resolves here too.
42
+ // resolves here too.`
43
+ : `
44
+ // Renamed from ${entity.Name}: that name is already taken by an SDK class
45
+ // member, and a duplicate declaration is a fatal PHP parse error.`}
41
46
  public function ${accessor}($data = null)
42
47
  {
43
48
  require_once __DIR__ . '/entity/${entity.name}_entity.php';
44
49
  if ($data === null) {
45
- if ($this->_${entity.name} === null) {
46
- $this->_${entity.name} = new ${cls}($this, null);
50
+ if ($this->_${field} === null) {
51
+ $this->_${field} = new ${cls}($this, null);
47
52
  }
48
- return $this->_${entity.name};
53
+ return $this->_${field};
49
54
  }
50
55
  return new ${cls}($this, $data);
51
56
  }
@@ -6,7 +6,7 @@ import {
6
6
  collectDeps,
7
7
  pkgDescription,
8
8
  keywords,
9
- repoInfo,
9
+ repoInfo, packageName
10
10
  } from '@voxgig/sdkgen'
11
11
 
12
12
 
@@ -32,7 +32,7 @@ const Package = cmp(async function Package(props: any) {
32
32
  // Generate composer.json
33
33
  File({ name: 'composer.json' }, () => {
34
34
  Content(`{
35
- "name": "${ns}/${pkgBase}",
35
+ "name": "${packageName(model, 'php')}",
36
36
  "description": "${pkgDescription(model, 'php')}",
37
37
  "type": "library",
38
38
  "keywords": [${kw}],
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -68,7 +68,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
68
68
  `)
69
69
  }
70
70
 
71
- Content(`Create an instance: \`$${entity.name} = $client->${entity.Name}();\`
71
+ Content(`Create an instance: \`$${entity.name} = $client->${phpEntityAccessor(entity.Name)}();\`
72
72
 
73
73
  `)
74
74
 
@@ -123,8 +123,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
123
123
  Content(`#### Example: Load
124
124
 
125
125
  \`\`\`php
126
- // load() returns the bare ${entity.Name} record (throws on error).
127
- $${entity.name} = $client->${entity.Name}()->load(${loadArg});
126
+ // load() returns the ENTITY — call data_get() for the ${entity.Name} record (throws on error).
127
+ $${entity.name} = $client->${phpEntityAccessor(entity.Name)}()->load(${loadArg});
128
128
  \`\`\`
129
129
 
130
130
  `)
@@ -135,7 +135,7 @@ $${entity.name} = $client->${entity.Name}()->load(${loadArg});
135
135
 
136
136
  \`\`\`php
137
137
  // list() returns an array of ${entity.Name} records (throws on error).
138
- $${entity.name}s = $client->${entity.Name}()->list();
138
+ $${entity.name}s = $client->${phpEntityAccessor(entity.Name)}()->list();
139
139
  \`\`\`
140
140
 
141
141
  `)
@@ -150,7 +150,7 @@ $${entity.name}s = $client->${entity.Name}()->list();
150
150
  Content(`#### Example: Create
151
151
 
152
152
  \`\`\`php
153
- $${entity.name} = $client->${entity.Name}()->create([
153
+ $${entity.name} = $client->${phpEntityAccessor(entity.Name)}()->create([
154
154
  `)
155
155
  createItems.map((it: any) => {
156
156
  Content(` "${it.name}" => null, // ${canonToType(it.type, target.name)}
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
2
+ import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, pickExampleEntity, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import { KIT, getModelPath, nom } from '@voxgig/apidef'
5
5
 
@@ -51,8 +51,9 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
51
51
  // The op-driven test-mode line, shown only when the SDK has an entity op.
52
52
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
53
53
  const testModeExample = primaryOp
54
- ? `// Entity ops return the bare mock record (throws on error).
55
- $${eName.toLowerCase()} = $client->${eName}()->${primaryOp}(${testCallArg});
54
+ ? `// Entity ops return the ENTITY (throws on error);
55
+ // call data_get() for the mock record.
56
+ $${eName.toLowerCase()} = $client->${phpEntityAccessor(eName)}()->${primaryOp}(${testCallArg});
56
57
  print_r($${eName.toLowerCase()});`
57
58
  : `$result = $client->direct(["path" => "/api/resource", "method" => "GET"]);
58
59
  print_r($result);`
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content } from '@voxgig/sdkgen'
2
+ import { cmp, Content, phpEntityAccessor } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -34,7 +34,7 @@ const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
34
34
  const opList = (opnames.length > 0 ? opnames : ['list', 'load']).join('`/`')
35
35
 
36
36
  const semantic = eName
37
- ? `The SDK exposes the API as capitalised, semantic **Entities** — for example \`$client->${eName}()\` — with named operations (\`${opList}\`) instead of raw URL paths and query strings. Working with resources and verbs keeps call sites self-describing and reduces cognitive load.
37
+ ? `The SDK exposes the API as capitalised, semantic **Entities** — for example \`$client->${phpEntityAccessor(eName)}()\` — with named operations (\`${opList}\`) instead of raw URL paths and query strings. Working with resources and verbs keeps call sites self-describing and reduces cognitive load.
38
38
 
39
39
  `
40
40
  : ''
@@ -93,7 +93,7 @@ ${opRows}
93
93
 
94
94
  ### Result shape
95
95
 
96
- Entity operations return the bare result data (an \`array\` for single-entity
96
+ Entity operations return the ENTITY (call data_get() for the record) (an \`array\` for single-entity
97
97
  ops, a \`list\` for \`list\`) and throw on error. Wrap calls in
98
98
  \`try\`/\`catch\` to handle failures.
99
99
 
@@ -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