@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.
- package/bin/voxgig-sdkgen +22 -2
- package/dist/action/doctor.d.ts +14 -0
- package/dist/action/doctor.js +351 -0
- package/dist/action/doctor.js.map +1 -0
- package/dist/action/feature.js +48 -9
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +6 -1
- package/dist/action/target.js +134 -22
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Entity.js +5 -0
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/ExternalTarget.d.ts +2 -0
- package/dist/cmp/ExternalTarget.js +104 -0
- package/dist/cmp/ExternalTarget.js.map +1 -0
- package/dist/cmp/Feature.js +2 -1
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/Main.js +5 -1
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +1 -1
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +16 -6
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/Registered.d.ts +7 -0
- package/dist/cmp/Registered.js +70 -0
- package/dist/cmp/Registered.js.map +1 -0
- package/dist/cmp/Test.js +3 -1
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/dryrun.d.ts +10 -0
- package/dist/helpers/dryrun.js +35 -0
- package/dist/helpers/dryrun.js.map +1 -0
- package/dist/helpers/featureSource.d.ts +13 -0
- package/dist/helpers/featureSource.js +156 -0
- package/dist/helpers/featureSource.js.map +1 -0
- package/dist/helpers/naming.d.ts +9 -1
- package/dist/helpers/naming.js +66 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.js +23 -3
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +11 -1
- package/dist/helpers/opShape.js +51 -0
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/packageMeta.d.ts +16 -1
- package/dist/helpers/packageMeta.js +181 -10
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/helpers/stdrep.d.ts +3 -0
- package/dist/helpers/stdrep.js +47 -0
- package/dist/helpers/stdrep.js.map +1 -0
- package/dist/helpers/testPolicy.d.ts +2 -0
- package/dist/helpers/testPolicy.js +46 -0
- package/dist/helpers/testPolicy.js.map +1 -0
- package/dist/sdkgen.d.ts +15 -6
- package/dist/sdkgen.js +273 -5
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/utility.js +10 -1
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +245 -0
- package/package.json +5 -3
- package/project/.sdk/model/target/c.aontu +28 -3
- package/project/.sdk/model/target/clojure.aontu +24 -3
- package/project/.sdk/model/target/cpp.aontu +25 -3
- package/project/.sdk/model/target/csharp.aontu +25 -3
- package/project/.sdk/model/target/dart.aontu +15 -3
- package/project/.sdk/model/target/elixir.aontu +15 -3
- package/project/.sdk/model/target/go-cli.aontu +16 -1
- package/project/.sdk/model/target/go-mcp.aontu +16 -1
- package/project/.sdk/model/target/go.aontu +14 -4
- package/project/.sdk/model/target/haskell.aontu +24 -3
- package/project/.sdk/model/target/java.aontu +25 -3
- package/project/.sdk/model/target/js.aontu +15 -3
- package/project/.sdk/model/target/kotlin.aontu +25 -3
- package/project/.sdk/model/target/lean.aontu +24 -3
- package/project/.sdk/model/target/lua.aontu +15 -3
- package/project/.sdk/model/target/ocaml.aontu +24 -3
- package/project/.sdk/model/target/perl.aontu +15 -3
- package/project/.sdk/model/target/php.aontu +15 -3
- package/project/.sdk/model/target/py-data.aontu +15 -3
- package/project/.sdk/model/target/py.aontu +15 -3
- package/project/.sdk/model/target/rb.aontu +15 -3
- package/project/.sdk/model/target/rust.aontu +25 -3
- package/project/.sdk/model/target/scala.aontu +24 -3
- package/project/.sdk/model/target/seneca-provider.aontu +118 -0
- package/project/.sdk/model/target/swift.aontu +25 -3
- package/project/.sdk/model/target/ts.aontu +15 -3
- package/project/.sdk/model/target/zig.aontu +25 -3
- package/project/.sdk/src/cmp/c/Config_c.ts +10 -11
- package/project/.sdk/src/cmp/c/Entity_c.ts +5 -1
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +23 -5
- package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +19 -2
- package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +12 -2
- package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -0
- package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +6 -3
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +12 -8
- package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +5 -1
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +12 -9
- package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +18 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +11 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +2 -1
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +6 -6
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +38 -1
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +42 -33
- package/project/.sdk/src/cmp/dart/Package_dart.ts +2 -1
- package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +2 -1
- package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +1 -1
- package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +17 -6
- package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +8 -8
- package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +18 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +15 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +8 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
- package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +2 -2
- package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +11 -2
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +1 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +38 -8
- package/project/.sdk/src/cmp/go/Entity_go.ts +2 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +4 -5
- package/project/.sdk/src/cmp/go/Package_go.ts +8 -5
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +4 -2
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +21 -15
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +9 -9
- package/project/.sdk/src/cmp/go/Test_go.ts +2 -2
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -1
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +4 -4
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +4 -4
- package/project/.sdk/src/cmp/haskell/Package_haskell.ts +2 -1
- package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +10 -5
- package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +10 -8
- package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +14 -10
- package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +21 -18
- package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +4 -4
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +23 -11
- package/project/.sdk/src/cmp/java/Package_java.ts +2 -1
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -1
- package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +2 -2
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +3 -3
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
- package/project/.sdk/src/cmp/java/TestEntity_java.ts +6 -6
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +34 -1
- package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +12 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +4 -1
- package/project/.sdk/src/cmp/js/Package_js.ts +7 -1
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -1
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -1
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +3 -3
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +8 -8
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +22 -1
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +15 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +13 -0
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +2 -2
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +6 -6
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +32 -1
- package/project/.sdk/src/cmp/lean/Package_lean.ts +3 -1
- package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +9 -4
- package/project/.sdk/src/cmp/lua/Package_lua.ts +4 -3
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +11 -3
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +9 -9
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +37 -1
- package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +12 -0
- package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +30 -3
- package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +11 -5
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +3 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +10 -5
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +6 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +10 -8
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +14 -13
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +20 -18
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -4
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +8 -2
- package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +8 -5
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -1
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +6 -6
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +36 -1
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +21 -16
- package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +6 -6
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +12 -12
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +6 -6
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +4 -4
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +17 -15
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +20 -1
- package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +11 -0
- package/project/.sdk/src/cmp/py/Package_py.ts +4 -3
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +13 -2
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -1
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +17 -6
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +14 -3
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +13 -2
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +9 -9
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +29 -1
- package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +11 -0
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +2 -1
- package/project/.sdk/src/cmp/rb/Package_rb.ts +4 -3
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +5 -5
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +9 -9
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +31 -1
- package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +10 -1
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +5 -1
- package/project/.sdk/src/cmp/rust/Main_rust.ts +21 -0
- package/project/.sdk/src/cmp/rust/Package_rust.ts +2 -1
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +12 -12
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +18 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +20 -3
- package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +10 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +10 -0
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -1
- package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +1 -1
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +27 -1
- package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +3915 -0
- package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +960 -0
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -1
- package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +34 -1
- package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +9 -1
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +18 -1
- package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +5 -2
- package/project/.sdk/src/cmp/ts/Main_ts.ts +4 -1
- package/project/.sdk/src/cmp/ts/Package_ts.ts +10 -1
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -2
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -1
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +21 -6
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +52 -2
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +14 -3
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +34 -2
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +64 -43
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +8 -8
- package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +2 -2
- package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +25 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +27 -3
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +15 -0
- package/project/.sdk/src/cmp/zig/Entity_zig.ts +5 -1
- package/project/.sdk/src/cmp/zig/Package_zig.ts +3 -1
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +39 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +2 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +2 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +5 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +2 -2
- package/project/.sdk/tm/c/VERSION +1 -1
- package/project/.sdk/tm/c/core/helpers.c +1 -0
- package/project/.sdk/tm/c/core/sdk.h +22 -6
- package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +4 -1
- package/project/.sdk/tm/c/utility/make_url.c +1 -0
- package/project/.sdk/tm/c/utility/param.c +1 -0
- package/project/.sdk/tm/clojure/VERSION +1 -1
- package/project/.sdk/tm/cpp/VERSION +1 -1
- package/project/.sdk/tm/cpp/core/types.hpp +33 -8
- package/project/.sdk/tm/cpp/test/pipeline_test.cpp +5 -0
- package/project/.sdk/tm/cpp/test/runner_support.hpp +4 -4
- package/project/.sdk/tm/csharp/VERSION +1 -1
- package/project/.sdk/tm/csharp/core/Types.cs +6 -0
- package/project/.sdk/tm/csharp/test/FeatureHarness.cs +396 -0
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +7 -385
- package/project/.sdk/tm/csharp/test/Runner.cs +4 -4
- package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +4 -0
- package/project/.sdk/tm/dart/test/utility.dart +4 -4
- package/project/.sdk/tm/elixir/VERSION +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +26 -0
- package/project/.sdk/tm/go/VERSION +1 -1
- package/project/.sdk/tm/go/core/types.go +6 -0
- package/project/.sdk/tm/go/test/feature_harness_test.go +361 -0
- package/project/.sdk/tm/go/test/feature_test.go +7 -350
- package/project/.sdk/tm/go/test/pipeline_test.go +6 -0
- package/project/.sdk/tm/go/test/runner_test.go +16 -4
- package/project/.sdk/tm/haskell/VERSION +1 -1
- package/project/.sdk/tm/haskell/src/SdkFeatures.hs +28 -5
- package/project/.sdk/tm/haskell/src/SdkTypes.hs +14 -5
- package/project/.sdk/tm/java/VERSION +1 -1
- package/project/.sdk/tm/java/test/RunnerSupport.java +4 -4
- package/project/.sdk/tm/java/utility/MakeError.java +4 -0
- package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +4 -0
- package/project/.sdk/tm/js/test/utility.js +3 -3
- package/project/.sdk/tm/kotlin/VERSION +1 -1
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
- package/project/.sdk/tm/lean/VERSION +1 -1
- package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
- package/project/.sdk/tm/lua/test/runner.lua +4 -4
- package/project/.sdk/tm/lua/utility/make_error.lua +4 -0
- package/project/.sdk/tm/ocaml/VERSION +1 -1
- package/project/.sdk/tm/ocaml/sdk_types.ml +14 -5
- package/project/.sdk/tm/ocaml/test/t_pipeline.ml +5 -2
- package/project/.sdk/tm/perl/t/runner.pm +4 -4
- package/project/.sdk/tm/php/VERSION +1 -1
- package/project/.sdk/tm/php/test/Runner.php +4 -4
- package/project/.sdk/tm/php/utility/MakeError.php +5 -0
- package/project/.sdk/tm/py/pkg/utility/make_error.py +4 -0
- package/project/.sdk/tm/py/test/runner.py +19 -4
- package/project/.sdk/tm/rb/test/runner.rb +4 -4
- package/project/.sdk/tm/rb/utility/make_error.rb +4 -0
- package/project/.sdk/tm/rust/VERSION +1 -1
- package/project/.sdk/tm/rust/core/types.rs +22 -6
- package/project/.sdk/tm/rust/tests/common/mod.rs +6 -6
- package/project/.sdk/tm/rust/tests/pipeline_test.rs +6 -0
- package/project/.sdk/tm/rust/utility/make_error.rs +4 -0
- package/project/.sdk/tm/scala/VERSION +1 -1
- package/project/.sdk/tm/seneca-provider/CODE_OF_CONDUCT.md +132 -0
- package/project/.sdk/tm/seneca-provider/LICENSE +21 -0
- package/project/.sdk/tm/seneca-provider/Makefile +15 -0
- package/project/.sdk/tm/seneca-provider/src/tsconfig.json +18 -0
- package/project/.sdk/tm/seneca-provider/test/tsconfig.json +16 -0
- package/project/.sdk/tm/seneca-provider/tsfmt.json +3 -0
- package/project/.sdk/tm/swift/VERSION +1 -1
- package/project/.sdk/tm/ts/src/tsconfig.json +1 -0
- package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +4 -0
- package/project/.sdk/tm/ts/test/tsconfig.json +1 -0
- package/project/.sdk/tm/ts/test/utility.ts +3 -3
- package/project/.sdk/tm/zig/VERSION +1 -1
- package/src/action/doctor.ts +475 -0
- package/src/action/feature.ts +54 -16
- package/src/action/target.ts +174 -25
- package/src/cmp/Entity.ts +7 -0
- package/src/cmp/ExternalTarget.ts +125 -0
- package/src/cmp/Feature.ts +3 -1
- package/src/cmp/Main.ts +7 -1
- package/src/cmp/ReadmeExplanation.ts +2 -2
- package/src/cmp/ReadmeTop.ts +22 -9
- package/src/cmp/Registered.ts +100 -0
- package/src/cmp/Test.ts +4 -1
- package/src/helpers/dryrun.ts +57 -0
- package/src/helpers/featureSource.ts +208 -0
- package/src/helpers/naming.ts +73 -2
- package/src/helpers/opExample.ts +19 -2
- package/src/helpers/opShape.ts +65 -0
- package/src/helpers/packageMeta.ts +211 -10
- package/src/helpers/stdrep.ts +56 -0
- package/src/helpers/testPolicy.ts +52 -0
- package/src/sdkgen.ts +350 -5
- package/src/types.ts +24 -1
- package/src/utility.ts +10 -1
- package/project/.sdk/tm/rust/feature/mod.rs +0 -24
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
buildIdNames,
|
|
25
25
|
getMatchEntries,
|
|
26
26
|
isAuthActive,
|
|
27
|
-
entityDataIdField,
|
|
27
|
+
entityDataIdField, envName, envToken
|
|
28
28
|
} from '@voxgig/sdkgen'
|
|
29
29
|
|
|
30
30
|
|
|
@@ -67,7 +67,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
67
67
|
return
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const PROJUPPER =
|
|
70
|
+
const PROJUPPER = envName(model)
|
|
71
71
|
|
|
72
72
|
const authActive = isAuthActive(model)
|
|
73
73
|
const apikeyEnvEntry = authActive
|
|
@@ -194,7 +194,7 @@ ${hasList ? `
|
|
|
194
194
|
// The basic flow consumes synthetic IDs from the fixture. In live mode
|
|
195
195
|
// without an *_ENTID env override, those IDs hit the live API and 4xx.
|
|
196
196
|
if setup.syntheticOnly {
|
|
197
|
-
t.Skip("live entity test uses synthetic IDs from fixture — set ${PROJUPPER}_TEST_${entity.name
|
|
197
|
+
t.Skip("live entity test uses synthetic IDs from fixture — set ${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID JSON to run live")
|
|
198
198
|
return
|
|
199
199
|
}
|
|
200
200
|
${allSteps.length > 0 ? '\t\tclient := setup.client\n\n' : ''}`)
|
|
@@ -281,16 +281,16 @@ ${allSteps.length > 0 ? '\t\tclient := setup.client\n\n' : ''}`)
|
|
|
281
281
|
// Detect ENTID env override before envOverride consumes it. When live
|
|
282
282
|
// mode is on without a real override, the basic test runs against synthetic
|
|
283
283
|
// IDs from the fixture and 4xx's. Surface this so the test can skip.
|
|
284
|
-
entidEnvRaw := os.Getenv("${PROJUPPER}_TEST_${entity.name
|
|
284
|
+
entidEnvRaw := os.Getenv("${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID")
|
|
285
285
|
idmapOverridden := entidEnvRaw != "" && strings.HasPrefix(strings.TrimSpace(entidEnvRaw), "{")
|
|
286
286
|
|
|
287
287
|
env := envOverride(map[string]any{
|
|
288
|
-
"${PROJUPPER}_TEST_${entity.name
|
|
288
|
+
"${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID": idmap,
|
|
289
289
|
"${PROJUPPER}_TEST_LIVE": "FALSE",
|
|
290
290
|
"${PROJUPPER}_TEST_EXPLAIN": "FALSE",${apikeyEnvEntry}
|
|
291
291
|
})
|
|
292
292
|
|
|
293
|
-
idmapResolved := core.ToMapAny(env["${PROJUPPER}_TEST_${entity.name
|
|
293
|
+
idmapResolved := core.ToMapAny(env["${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID"])
|
|
294
294
|
if idmapResolved == nil {
|
|
295
295
|
idmapResolved = core.ToMapAny(idmap)
|
|
296
296
|
}
|
|
@@ -381,7 +381,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
381
381
|
if err != nil {
|
|
382
382
|
t.Fatalf("create failed: %v", err)
|
|
383
383
|
}
|
|
384
|
-
${datavar} = core.ToMapAny(${datavar}Result)
|
|
384
|
+
${datavar} = core.ToMapAny(entityData(${datavar}Result))
|
|
385
385
|
if ${datavar} == nil {
|
|
386
386
|
t.Fatal("expected create result to be a map")
|
|
387
387
|
}
|
|
@@ -546,7 +546,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
546
546
|
if err != nil {
|
|
547
547
|
t.Fatalf("update failed: %v", err)
|
|
548
548
|
}
|
|
549
|
-
${resdatavar} := core.ToMapAny(${resdatavar}Result)
|
|
549
|
+
${resdatavar} := core.ToMapAny(entityData(${resdatavar}Result))
|
|
550
550
|
if ${resdatavar} == nil {
|
|
551
551
|
t.Fatal("expected update result to be a map")
|
|
552
552
|
}
|
|
@@ -621,7 +621,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
621
621
|
if err != nil {
|
|
622
622
|
t.Fatalf("load failed: %v", err)
|
|
623
623
|
}
|
|
624
|
-
${datavar}LoadResult := core.ToMapAny(${datavar}Loaded)
|
|
624
|
+
${datavar}LoadResult := core.ToMapAny(entityData(${datavar}Loaded))
|
|
625
625
|
if ${datavar}LoadResult == nil {
|
|
626
626
|
t.Fatal("expected load result to be a map")
|
|
627
627
|
}
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
ModelEntity
|
|
9
9
|
} from '@voxgig/apidef'
|
|
10
10
|
|
|
11
|
-
import { cmp, each, Folder, File, Content } from '@voxgig/sdkgen'
|
|
11
|
+
import { cmp, each, Folder, File, Content, goModule } from '@voxgig/sdkgen'
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
import { TestEntity } from './TestEntity_go'
|
|
@@ -22,7 +22,7 @@ const Test = cmp(function Test(props: any) {
|
|
|
22
22
|
|
|
23
23
|
// Module name: concatenated lowercase
|
|
24
24
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
25
|
-
const gomodule =
|
|
25
|
+
const gomodule = goModule(model, 'go')
|
|
26
26
|
|
|
27
27
|
Folder({ name: 'test' }, () => {
|
|
28
28
|
|
|
@@ -14,6 +14,7 @@ type EntyClass struct {
|
|
|
14
14
|
data map[string]any
|
|
15
15
|
match map[string]any
|
|
16
16
|
entctx *core.Context
|
|
17
|
+
deleted bool
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
func NewEntyClass(client *core.ProjectNameSDK, entopts map[string]any) *EntyClass {
|
|
@@ -49,6 +50,21 @@ func NewEntyClass(client *core.ProjectNameSDK, entopts map[string]any) *EntyClas
|
|
|
49
50
|
|
|
50
51
|
func (e *EntyClass) GetName() string { return e.name }
|
|
51
52
|
|
|
53
|
+
// Deleted marks this instance as removed. `Remove` resolves to the entity
|
|
54
|
+
// like every other operation, and the instance KEEPS the data it held — a
|
|
55
|
+
// caller can still read what was deleted — but it is no longer a live
|
|
56
|
+
// record. See AGENTS.md "Entity operations return ENTITIES".
|
|
57
|
+
func (e *EntyClass) MarkDeleted() {
|
|
58
|
+
e.deleted = true
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
// Deleted reports whether a successful Remove has resolved on this instance.
|
|
63
|
+
func (e *EntyClass) Deleted() bool {
|
|
64
|
+
return e.deleted
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
52
68
|
func (e *EntyClass) Make() core.Entity {
|
|
53
69
|
opts := map[string]any{}
|
|
54
70
|
for k, v := range e.entopts {
|
|
@@ -296,5 +312,30 @@ func (e *EntyClass) runOp(ctx *core.Context, postDone func()) (any, error) {
|
|
|
296
312
|
|
|
297
313
|
postDone()
|
|
298
314
|
|
|
299
|
-
|
|
315
|
+
out, doneErr := utility.Done(ctx)
|
|
316
|
+
if doneErr != nil {
|
|
317
|
+
return out, doneErr
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// An operation resolves to the ENTITY, not the raw data. Entities are
|
|
321
|
+
// stateful: post_done has just absorbed resdata/resmatch into this
|
|
322
|
+
// instance, and the caller reaches the record through data(). Two
|
|
323
|
+
// structural exceptions: `list` resolves to the ARRAY of entity
|
|
324
|
+
// instances make_result built, and a failed op with throwing disabled
|
|
325
|
+
// hands back the error payload unchanged. `remove` additionally marks
|
|
326
|
+
// the entity deleted; it KEEPS its data, so a caller can still read
|
|
327
|
+
// what was removed. See AGENTS.md "Entity operations return ENTITIES".
|
|
328
|
+
opname := ""
|
|
329
|
+
if ctx.Op != nil {
|
|
330
|
+
opname = ctx.Op.Name
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if ctx.Result != nil && ctx.Result.Ok && opname != "list" {
|
|
334
|
+
if opname == "remove" {
|
|
335
|
+
e.MarkDeleted()
|
|
336
|
+
}
|
|
337
|
+
return e, nil
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return out, nil
|
|
300
341
|
}
|
|
@@ -3,7 +3,7 @@ import * as Path from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, each, deriveEntityNames,
|
|
6
|
-
File, Content, Fragment, Slot,
|
|
6
|
+
File, Content, Fragment, Slot, goModule, goVersion
|
|
7
7
|
} from '@voxgig/sdkgen'
|
|
8
8
|
|
|
9
9
|
import type {
|
|
@@ -50,8 +50,8 @@ const Main = cmp(function Main(props: any) {
|
|
|
50
50
|
const { model } = props.ctx$
|
|
51
51
|
|
|
52
52
|
const org = model.origin || 'voxgig-sdk'
|
|
53
|
-
const sdkModule =
|
|
54
|
-
const cliModule =
|
|
53
|
+
const sdkModule = goModule(model, 'go')
|
|
54
|
+
const cliModule = goModule(model, 'go-cli')
|
|
55
55
|
|
|
56
56
|
const entityMap: any = getModelPath(model, `main.${KIT}.entity`)
|
|
57
57
|
// Derive each entity's PascalCase `Name` here rather than relying on another
|
|
@@ -369,7 +369,7 @@ this repo, or upstream at
|
|
|
369
369
|
// (go 1.24.7) — keep in step with BORU_ENG_VERSION.
|
|
370
370
|
File({ name: 'go.mod' }, () => Content(`module ${cliModule}
|
|
371
371
|
|
|
372
|
-
go 1.24.7
|
|
372
|
+
go ${goVersion(model, 'go-cli', '1.24.7')}
|
|
373
373
|
|
|
374
374
|
require ${sdkModule} v0.0.0
|
|
375
375
|
require github.com/boru-lang/boru/eng/go ${BORU_ENG_VERSION}
|
|
@@ -3,7 +3,7 @@ import * as Path from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, each, deriveEntityNames,
|
|
6
|
-
File, Content, Fragment, Slot,
|
|
6
|
+
File, Content, Fragment, Slot, goModule, goVersion
|
|
7
7
|
} from '@voxgig/sdkgen'
|
|
8
8
|
|
|
9
9
|
import type {
|
|
@@ -50,8 +50,8 @@ const Main = cmp(function Main(props: any) {
|
|
|
50
50
|
const { model } = props.ctx$
|
|
51
51
|
|
|
52
52
|
const org = model.origin || 'voxgig-sdk'
|
|
53
|
-
const sdkModule =
|
|
54
|
-
const mcpModule =
|
|
53
|
+
const sdkModule = goModule(model, 'go')
|
|
54
|
+
const mcpModule = goModule(model, 'go-mcp')
|
|
55
55
|
|
|
56
56
|
const entityMap: any = getModelPath(model, `main.${KIT}.entity`)
|
|
57
57
|
// Derive each entity's PascalCase `Name` here rather than relying on another
|
|
@@ -319,7 +319,7 @@ this repo, or upstream at
|
|
|
319
319
|
// the public proxy. The MCP Go SDK requires go >= 1.25.
|
|
320
320
|
File({ name: 'go.mod' }, () => Content(`module ${mcpModule}
|
|
321
321
|
|
|
322
|
-
go 1.25.0
|
|
322
|
+
go ${goVersion(model, 'go-mcp', '1.25.0')}
|
|
323
323
|
|
|
324
324
|
require ${sdkModule} v0.0.0
|
|
325
325
|
require github.com/modelcontextprotocol/go-sdk ${MCP_GO_SDK_VERSION}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
Content,
|
|
3
3
|
File,
|
|
4
4
|
cmp,
|
|
5
|
+
packageVersion,
|
|
5
6
|
} from '@voxgig/sdkgen'
|
|
6
7
|
|
|
7
8
|
|
|
@@ -28,7 +29,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
28
29
|
File({ name: pkgName(model) + '.cabal' }, () => {
|
|
29
30
|
Content(`cabal-version: 2.4
|
|
30
31
|
name: ${pkgName(model)}
|
|
31
|
-
version:
|
|
32
|
+
version: ${packageVersion(model, target.name)}
|
|
32
33
|
synopsis: ${model.const.Name} SDK for Haskell (generated by @voxgig/sdkgen)
|
|
33
34
|
license: MIT
|
|
34
35
|
build-type: Simple
|
|
@@ -33,11 +33,11 @@ function hsType(type: any): string {
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
const OP_DESC: Record<string, { method: string, desc: string }> = {
|
|
36
|
-
load: { method: 'eLoad ent match ctrl', desc: 'Load a single entity by match criteria.' },
|
|
37
|
-
list: { method: 'eList ent match ctrl', desc: 'List entities, optionally matching the given criteria.' },
|
|
38
|
-
create: { method: 'eCreate ent data ctrl', desc: 'Create a new entity with the given data.' },
|
|
39
|
-
update: { method: 'eUpdate ent data ctrl', desc: 'Update an existing entity.' },
|
|
40
|
-
remove: { method: 'eRemove ent match ctrl', desc: 'Remove the matching entity.' },
|
|
36
|
+
load: { method: 'eLoad ent match ctrl', desc: 'Load a single entity by match criteria. Resolves to the entity.' },
|
|
37
|
+
list: { method: 'eList ent match ctrl', desc: 'List entities, optionally matching the given criteria. Resolves to one entity per record.' },
|
|
38
|
+
create: { method: 'eCreate ent data ctrl', desc: 'Create a new entity with the given data. Resolves to the entity.' },
|
|
39
|
+
update: { method: 'eUpdate ent data ctrl', desc: 'Update an existing entity. Resolves to the entity.' },
|
|
40
|
+
remove: { method: 'eRemove ent match ctrl', desc: 'Remove the matching entity. Resolves to the entity, marked deleted.' },
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
|
|
@@ -133,6 +133,8 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
133
133
|
match <- jo ${loadArg}
|
|
134
134
|
ctrl <- emptyMap
|
|
135
135
|
${eFn} <- Sdk.eLoad ent match ctrl
|
|
136
|
+
-- The op resolves to the ENTITY; the record is inside it.
|
|
137
|
+
${eFn}Data <- Sdk.eDataGet ${eFn}
|
|
136
138
|
\`\`\`
|
|
137
139
|
|
|
138
140
|
`)
|
|
@@ -145,7 +147,9 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
145
147
|
ent <- Sdk.${eFn} sdk VNoval
|
|
146
148
|
match <- emptyMap
|
|
147
149
|
ctrl <- emptyMap
|
|
150
|
+
-- One ENTITY per record.
|
|
148
151
|
${eFn}s <- Sdk.eList ent match ctrl
|
|
152
|
+
${eFn}Datas <- mapM Sdk.eDataGet ${eFn}s
|
|
149
153
|
\`\`\`
|
|
150
154
|
|
|
151
155
|
`)
|
|
@@ -168,6 +172,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
168
172
|
Content(`]
|
|
169
173
|
ctrl <- emptyMap
|
|
170
174
|
${eFn} <- Sdk.eCreate ent d ctrl
|
|
175
|
+
${eFn}Data <- Sdk.eDataGet ${eFn}
|
|
171
176
|
\`\`\`
|
|
172
177
|
|
|
173
178
|
`)
|
|
@@ -21,11 +21,11 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
21
21
|
entityList.forEach((e: any) => Object.keys(e.op || {})
|
|
22
22
|
.forEach((o: string) => { if (e.op[o] && e.op[o].active !== false) opUnion.add(o) }))
|
|
23
23
|
const opRowDefs: Record<string, string> = {
|
|
24
|
-
load: '| `eLoad` | `Value -> Value -> IO
|
|
25
|
-
list: '| `eList` | `Value -> Value -> IO
|
|
26
|
-
create: '| `eCreate` | `Value -> Value -> IO
|
|
27
|
-
update: '| `eUpdate` | `Value -> Value -> IO
|
|
28
|
-
remove: '| `eRemove` | `Value -> Value -> IO
|
|
24
|
+
load: '| `eLoad` | `Value -> Value -> IO Entity` | Load a single entity by match criteria. Resolves to the entity. Raises on error. |',
|
|
25
|
+
list: '| `eList` | `Value -> Value -> IO [Entity]` | List entities matching the criteria. Resolves to one entity per record. Raises on error. |',
|
|
26
|
+
create: '| `eCreate` | `Value -> Value -> IO Entity` | Create a new entity. Resolves to the entity. Raises on error. |',
|
|
27
|
+
update: '| `eUpdate` | `Value -> Value -> IO Entity` | Update an existing entity. Resolves to the entity. Raises on error. |',
|
|
28
|
+
remove: '| `eRemove` | `Value -> Value -> IO Entity` | Remove an entity. Resolves to the entity, marked deleted. Raises on error. |',
|
|
29
29
|
}
|
|
30
30
|
const opRows = ['load', 'list', 'create', 'update', 'remove']
|
|
31
31
|
.filter((o) => opUnion.has(o)).map((o) => opRowDefs[o]).join('\n')
|
|
@@ -103,9 +103,11 @@ ${opRows}
|
|
|
103
103
|
|
|
104
104
|
### Result shape
|
|
105
105
|
|
|
106
|
-
Entity operations
|
|
107
|
-
|
|
108
|
-
\`
|
|
106
|
+
Entity operations resolve to the ENTITY, not the raw record \u2014 \`eList\` to
|
|
107
|
+
one entity per record \u2014 and raise on error. The record is reached through
|
|
108
|
+
\`eDataGet\`, which returns the entity's data container. \`eRemove\` resolves to
|
|
109
|
+
the entity marked deleted (\`eDeleted\`); it keeps the data it held. Wrap calls
|
|
110
|
+
in \`Control.Exception.try\` to handle failures.
|
|
109
111
|
|
|
110
112
|
The \`direct\` escape hatch never raises — it returns a result \`Value\`
|
|
111
113
|
you branch on via its \`ok\` field (read with \`getp result "ok"\`):
|
|
@@ -90,14 +90,15 @@ to recover from failures.
|
|
|
90
90
|
if (opnames.includes('list')) {
|
|
91
91
|
Content(`### 2. List ${eName.toLowerCase()} records
|
|
92
92
|
|
|
93
|
-
\`eList ent match ctrl\`
|
|
93
|
+
\`eList ent match ctrl\` resolves to one ENTITY per record and raises on
|
|
94
|
+
error. Read a record with \`eDataGet\`.
|
|
94
95
|
|
|
95
96
|
\`\`\`haskell
|
|
96
97
|
ent <- Sdk.${eFn} sdk VNoval
|
|
97
98
|
match <- emptyMap
|
|
98
99
|
ctrl <- emptyMap
|
|
99
100
|
${eFn}s <- Sdk.eList ent match ctrl
|
|
100
|
-
print ${eFn}s
|
|
101
|
+
mapM_ (\\en -> print =<< Sdk.eDataGet en) ${eFn}s
|
|
101
102
|
\`\`\`
|
|
102
103
|
|
|
103
104
|
`)
|
|
@@ -123,14 +124,15 @@ to recover from failures.
|
|
|
123
124
|
Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
|
|
124
125
|
|
|
125
126
|
${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
126
|
-
\`eLoad\`
|
|
127
|
+
\`eLoad\` resolves to the ENTITY and raises on error; \`eDataGet\` gives the
|
|
128
|
+
record.
|
|
127
129
|
|
|
128
130
|
\`\`\`haskell
|
|
129
131
|
${neFn}Ent <- Sdk.${neFn} sdk VNoval
|
|
130
132
|
m <- jo [${neMatch.join(', ')}]
|
|
131
133
|
ctrl2 <- emptyMap
|
|
132
134
|
${neFn} <- Sdk.eLoad ${neFn}Ent m ctrl2
|
|
133
|
-
print ${neFn}
|
|
135
|
+
print =<< Sdk.eDataGet ${neFn}
|
|
134
136
|
\`\`\`
|
|
135
137
|
|
|
136
138
|
`)
|
|
@@ -148,14 +150,15 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
148
150
|
|
|
149
151
|
Content(`### 3. Load ${article} ${eName.toLowerCase()}
|
|
150
152
|
|
|
151
|
-
\`eLoad ent match ctrl\`
|
|
153
|
+
\`eLoad ent match ctrl\` resolves to the ENTITY and raises on error;
|
|
154
|
+
\`eDataGet\` gives the record.
|
|
152
155
|
|
|
153
156
|
\`\`\`haskell
|
|
154
157
|
ent2 <- Sdk.${eFn} sdk VNoval
|
|
155
158
|
m <- jo ${loadArg}
|
|
156
159
|
ctrl2 <- emptyMap
|
|
157
160
|
${eFn} <- Sdk.eLoad ent2 m ctrl2
|
|
158
|
-
print ${eFn}
|
|
161
|
+
print =<< Sdk.eDataGet ${eFn}
|
|
159
162
|
\`\`\`
|
|
160
163
|
|
|
161
164
|
`)
|
|
@@ -192,7 +195,7 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
192
195
|
d <- jo [${examplePairs('create').join(', ')}]
|
|
193
196
|
cctrl <- emptyMap
|
|
194
197
|
created <- Sdk.eCreate createEnt d cctrl
|
|
195
|
-
print created
|
|
198
|
+
print =<< Sdk.eDataGet created
|
|
196
199
|
\`\`\`
|
|
197
200
|
|
|
198
201
|
`)
|
|
@@ -204,7 +207,7 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
204
207
|
upd <- jo [${updatePairs.join(', ')}]
|
|
205
208
|
uctrl <- emptyMap
|
|
206
209
|
updated <- Sdk.eUpdate updateEnt upd uctrl
|
|
207
|
-
print updated
|
|
210
|
+
print =<< Sdk.eDataGet updated
|
|
208
211
|
\`\`\`
|
|
209
212
|
|
|
210
213
|
`)
|
|
@@ -221,8 +224,9 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
221
224
|
removeEnt <- Sdk.${eFn} sdk VNoval
|
|
222
225
|
rm <- jo [${removePairs.length ? removePairs.join(', ') : ''}]
|
|
223
226
|
rctrl <- emptyMap
|
|
224
|
-
|
|
225
|
-
|
|
227
|
+
-- Resolves to the entity, marked deleted; it keeps the data it held.
|
|
228
|
+
removed <- Sdk.eRemove removeEnt rm rctrl
|
|
229
|
+
print =<< readIORef (Sdk.eDeleted removed)
|
|
226
230
|
\`\`\`
|
|
227
231
|
|
|
228
232
|
`)
|
|
@@ -33,29 +33,29 @@ function hsType(type: any): string {
|
|
|
33
33
|
|
|
34
34
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
35
35
|
load: {
|
|
36
|
-
sig: 'eLoad ent match ctrl :: IO
|
|
37
|
-
returns: 'the entity
|
|
38
|
-
desc: 'Load a single entity matching the given criteria.
|
|
36
|
+
sig: 'eLoad ent match ctrl :: IO Entity',
|
|
37
|
+
returns: 'the entity',
|
|
38
|
+
desc: 'Load a single entity matching the given criteria. Resolves to the ENTITY (read the record with `eDataGet`) and raises on error.',
|
|
39
39
|
},
|
|
40
40
|
list: {
|
|
41
|
-
sig: 'eList ent match ctrl :: IO
|
|
42
|
-
returns: '
|
|
43
|
-
desc: 'List entities matching the given criteria. The match is optional
|
|
41
|
+
sig: 'eList ent match ctrl :: IO [Entity]',
|
|
42
|
+
returns: 'one entity per record',
|
|
43
|
+
desc: 'List entities matching the given criteria. The match is optional \u2014 pass an empty map to list all records. Resolves to one ENTITY per record and raises on error.',
|
|
44
44
|
},
|
|
45
45
|
create: {
|
|
46
|
-
sig: 'eCreate ent data ctrl :: IO
|
|
47
|
-
returns: 'the created entity
|
|
48
|
-
desc: 'Create a new entity with the given data.
|
|
46
|
+
sig: 'eCreate ent data ctrl :: IO Entity',
|
|
47
|
+
returns: 'the created entity',
|
|
48
|
+
desc: 'Create a new entity with the given data. Resolves to the ENTITY (read the record with `eDataGet`) and raises on error.',
|
|
49
49
|
},
|
|
50
50
|
update: {
|
|
51
|
-
sig: 'eUpdate ent data ctrl :: IO
|
|
52
|
-
returns: 'the updated entity
|
|
53
|
-
desc: 'Update an existing entity. The data must include the entity `id`.
|
|
51
|
+
sig: 'eUpdate ent data ctrl :: IO Entity',
|
|
52
|
+
returns: 'the updated entity',
|
|
53
|
+
desc: 'Update an existing entity. The data must include the entity `id`. Resolves to the ENTITY (read the record with `eDataGet`) and raises on error.',
|
|
54
54
|
},
|
|
55
55
|
remove: {
|
|
56
|
-
sig: 'eRemove ent match ctrl :: IO
|
|
57
|
-
returns: 'the removed entity
|
|
58
|
-
desc: 'Remove the entity matching the given criteria. Raises on error.',
|
|
56
|
+
sig: 'eRemove ent match ctrl :: IO Entity',
|
|
57
|
+
returns: 'the removed entity',
|
|
58
|
+
desc: 'Remove the entity matching the given criteria. Resolves to the ENTITY, marked deleted (`eDeleted`); it keeps the data it held. Raises on error.',
|
|
59
59
|
},
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -278,7 +278,8 @@ ${info.desc}
|
|
|
278
278
|
ent <- Sdk.${eFn} sdk VNoval
|
|
279
279
|
match <- emptyMap
|
|
280
280
|
ctrl <- emptyMap
|
|
281
|
-
results <- Sdk.eList ent match ctrl
|
|
281
|
+
results <- Sdk.eList ent match ctrl -- one ENTITY per record
|
|
282
|
+
datas <- mapM Sdk.eDataGet results
|
|
282
283
|
\`\`\`
|
|
283
284
|
|
|
284
285
|
`)
|
|
@@ -297,7 +298,8 @@ ${info.desc}
|
|
|
297
298
|
})
|
|
298
299
|
Content(`]
|
|
299
300
|
ctrl <- emptyMap
|
|
300
|
-
result <- Sdk.eCreate ent d ctrl
|
|
301
|
+
result <- Sdk.eCreate ent d ctrl -- the ENTITY
|
|
302
|
+
d2 <- Sdk.eDataGet result
|
|
301
303
|
\`\`\`
|
|
302
304
|
|
|
303
305
|
`)
|
|
@@ -318,7 +320,8 @@ ${info.desc}
|
|
|
318
320
|
[${updateLines}
|
|
319
321
|
] -- fields to update
|
|
320
322
|
ctrl <- emptyMap
|
|
321
|
-
result <- Sdk.eUpdate ent d ctrl
|
|
323
|
+
result <- Sdk.eUpdate ent d ctrl -- the ENTITY
|
|
324
|
+
d2 <- Sdk.eDataGet result
|
|
322
325
|
\`\`\`
|
|
323
326
|
|
|
324
327
|
`)
|
|
@@ -63,12 +63,12 @@ main = do
|
|
|
63
63
|
|
|
64
64
|
if (opnames.includes('list')) {
|
|
65
65
|
Content(`
|
|
66
|
-
-- List all ${eName.toLowerCase()}s (
|
|
66
|
+
-- List all ${eName.toLowerCase()}s (one ENTITY per record, raises on error)
|
|
67
67
|
ent <- Sdk.${eFn} sdk VNoval
|
|
68
68
|
match <- emptyMap
|
|
69
69
|
ctrl <- emptyMap
|
|
70
70
|
${eFn}s <- Sdk.eList ent match ctrl
|
|
71
|
-
print ${eFn}s
|
|
71
|
+
mapM_ (\\en -> print =<< Sdk.eDataGet en) ${eFn}s
|
|
72
72
|
`)
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -83,12 +83,12 @@ main = do
|
|
|
83
83
|
it.name === idF ? 'example_id' : 'example_' + it.name)})`).join(', ')}]`
|
|
84
84
|
: '[]'
|
|
85
85
|
Content(`
|
|
86
|
-
-- Load a specific ${eName.toLowerCase()} (returns the
|
|
86
|
+
-- Load a specific ${eName.toLowerCase()} (returns the ENTITY, raises on error)
|
|
87
87
|
ent2 <- Sdk.${eFn} sdk VNoval
|
|
88
88
|
m <- jo ${loadArg}
|
|
89
89
|
ctrl2 <- emptyMap
|
|
90
90
|
${eFn} <- Sdk.eLoad ent2 m ctrl2
|
|
91
|
-
print ${eFn}
|
|
91
|
+
print =<< Sdk.eDataGet ${eFn}
|
|
92
92
|
`)
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -81,7 +81,10 @@ ${basicFn} c = do
|
|
|
81
81
|
ent <- C.${fn} sdk VNoval
|
|
82
82
|
em1 <- emptyMap; em2 <- emptyMap
|
|
83
83
|
lst <- eList ent em1 em2
|
|
84
|
-
|
|
84
|
+
-- \`list\` resolves to one ENTITY per record; the record is reached
|
|
85
|
+
-- through eDataGet. See AGENTS.md "Entity operations return ENTITIES".
|
|
86
|
+
ok <- mapM (\\en -> ismap <$> eDataGet en) lst
|
|
87
|
+
pure (all id ok)
|
|
85
88
|
`
|
|
86
89
|
}
|
|
87
90
|
if (hasLoad) {
|
|
@@ -95,8 +98,9 @@ ${basicFn} c = do
|
|
|
95
98
|
(id0 : _) -> do
|
|
96
99
|
m <- jo [("id", VStr id0)]; ctrl <- emptyMap
|
|
97
100
|
loaded <- eLoad ent m ctrl
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
ld <- eDataGet loaded
|
|
102
|
+
lid <- getp ld "id"
|
|
103
|
+
pure (ismap ld && vstring lid == id0)
|
|
100
104
|
`
|
|
101
105
|
}
|
|
102
106
|
if (hasCreate) {
|
|
@@ -106,8 +110,9 @@ ${basicFn} c = do
|
|
|
106
110
|
d <- newRefData fixture "${e.name}"
|
|
107
111
|
ctrl <- emptyMap
|
|
108
112
|
created <- eCreate ent d ctrl
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
cd <- eDataGet created
|
|
114
|
+
cid <- getp cd "id"
|
|
115
|
+
pure (ismap cd && not (isNoval cid))
|
|
111
116
|
`
|
|
112
117
|
}
|
|
113
118
|
if (hasCreate && hasUpdate) {
|
|
@@ -117,12 +122,14 @@ ${basicFn} c = do
|
|
|
117
122
|
d <- newRefData fixture "${e.name}"
|
|
118
123
|
ctrl <- emptyMap
|
|
119
124
|
created <- eCreate ent d ctrl
|
|
120
|
-
|
|
125
|
+
cd <- eDataGet created
|
|
126
|
+
cid <- getp cd "id"
|
|
121
127
|
upd <- jo [("id", cid), ("${updField}", VStr "UpdatedMark")]
|
|
122
128
|
ctrl2 <- emptyMap
|
|
123
129
|
updated <- eUpdate ent upd ctrl2
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
ud <- eDataGet updated
|
|
131
|
+
uv <- getp ud "${updField}"
|
|
132
|
+
pure (ismap ud && vstring uv == "UpdatedMark")
|
|
126
133
|
`
|
|
127
134
|
}
|
|
128
135
|
if (hasCreate && hasRemove) {
|
|
@@ -132,10 +139,15 @@ ${basicFn} c = do
|
|
|
132
139
|
d <- newRefData fixture "${e.name}"
|
|
133
140
|
ctrl <- emptyMap
|
|
134
141
|
created <- eCreate ent d ctrl
|
|
135
|
-
|
|
142
|
+
cd <- eDataGet created
|
|
143
|
+
cid <- getp cd "id"
|
|
136
144
|
rm <- jo [("id", cid)]; ctrl2 <- emptyMap
|
|
137
|
-
|
|
138
|
-
|
|
145
|
+
-- \`remove\` resolves to the entity, marked. It KEEPS the data it held.
|
|
146
|
+
removed <- eRemove ent rm ctrl2
|
|
147
|
+
gone <- readIORef (eDeleted removed)
|
|
148
|
+
rd <- eDataGet removed
|
|
149
|
+
rid <- getp rd "id"
|
|
150
|
+
pure (gone && vstring rid == vstring cid)
|
|
139
151
|
`
|
|
140
152
|
}
|
|
141
153
|
// An op-less entity (no list/load/create — e.g. a bare path entity)
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
File,
|
|
5
5
|
cmp,
|
|
6
6
|
collectDeps,
|
|
7
|
+
packageVersion,
|
|
7
8
|
} from '@voxgig/sdkgen'
|
|
8
9
|
|
|
9
10
|
|
|
@@ -51,7 +52,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
51
52
|
|
|
52
53
|
<groupId>${groupId}</groupId>
|
|
53
54
|
<artifactId>${artifactId}</artifactId>
|
|
54
|
-
<version
|
|
55
|
+
<version>${packageVersion(model, target.name)}</version>
|
|
55
56
|
<name>${model.const.Name} SDK</name>
|
|
56
57
|
<description>${model.const.Name} client SDK for Java (generated by @voxgig/sdkgen).</description>
|
|
57
58
|
|
|
@@ -51,7 +51,8 @@ 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
|
|
54
|
+
? `// Entity ops return the ENTITY and raises on error;
|
|
55
|
+
// call data() for the record.
|
|
55
56
|
Object ${eVar} = client.${accessor}(null).${primaryOp}(${testArg}, null);
|
|
56
57
|
// ${eVar} holds the mock response record
|
|
57
58
|
System.out.println(${eVar});`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isPublished, repoInfo } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isPublished, repoInfo, packageVersion } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import { mavenGroupId } from './utility_java'
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
|
|
|
18
18
|
<dependency>
|
|
19
19
|
<groupId>${groupId}</groupId>
|
|
20
20
|
<artifactId>${artifactId}</artifactId>
|
|
21
|
-
<version
|
|
21
|
+
<version>${packageVersion(model, target.name)}</version>
|
|
22
22
|
</dependency>
|
|
23
23
|
\`\`\`
|
|
24
24
|
|
|
@@ -93,7 +93,7 @@ ${opRows}
|
|
|
93
93
|
|
|
94
94
|
### Result shape
|
|
95
95
|
|
|
96
|
-
Entity operations return the
|
|
96
|
+
Entity operations return the ENTITY (call data() for the record) (a \`Map\` for single-entity
|
|
97
97
|
ops, an aggregate \`List\` for \`list\`) as \`Object\` and raise on error. Wrap
|
|
98
98
|
calls in \`try\`/\`catch\` to handle failures.
|
|
99
99
|
|
|
@@ -123,7 +123,7 @@ catch (RuntimeException err) {
|
|
|
123
123
|
Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
|
|
124
124
|
|
|
125
125
|
${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
126
|
-
\`load()\` returns the
|
|
126
|
+
\`load()\` returns the ENTITY — call data() for the record — and raises on error.
|
|
127
127
|
|
|
128
128
|
\`\`\`java
|
|
129
129
|
try {
|
|
@@ -151,7 +151,7 @@ catch (RuntimeException err) {
|
|
|
151
151
|
|
|
152
152
|
Content(`### 3. Load ${article} ${eName.toLowerCase()}
|
|
153
153
|
|
|
154
|
-
\`load()\` returns the
|
|
154
|
+
\`load()\` returns the ENTITY — call data() for the record — and raises on error.
|
|
155
155
|
|
|
156
156
|
\`\`\`java
|
|
157
157
|
try {
|
|
@@ -191,7 +191,7 @@ catch (RuntimeException err) {
|
|
|
191
191
|
\`\`\`java
|
|
192
192
|
`)
|
|
193
193
|
if (opnames.includes('create')) {
|
|
194
|
-
Content(`// Create — returns the
|
|
194
|
+
Content(`// Create — returns the ENTITY (call data() for the record)
|
|
195
195
|
Object created = client.${accessor}(null).create(Map.of(${examplePairs('create').join(', ')}), null);
|
|
196
196
|
|
|
197
197
|
`)
|