@voxgig/sdkgen 2.0.2 → 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.
- package/bin/voxgig-sdkgen +22 -2
- package/dist/action/doctor.d.ts +14 -0
- package/dist/action/doctor.js +296 -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/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 +8 -1
- package/dist/helpers/packageMeta.js +141 -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 +45 -4
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aontu +125 -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 +17 -1
- package/project/.sdk/model/target/go-mcp.aontu +17 -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 +26 -3
- package/project/.sdk/model/target/js.aontu +15 -3
- package/project/.sdk/model/target/kotlin.aontu +26 -3
- package/project/.sdk/model/target/lean.aontu +25 -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 +16 -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 +25 -3
- 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 +26 -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/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/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 +410 -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/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 +163 -10
- package/src/helpers/stdrep.ts +56 -0
- package/src/helpers/testPolicy.ts +52 -0
- package/src/sdkgen.ts +70 -4
- package/project/.sdk/tm/rust/feature/mod.rs +0 -24
|
@@ -24,11 +24,23 @@ main: kit: feature: &: target: rb: deps: &: {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
# Publication: rubygems registry (declared, publish pending — git-tag only).
|
|
27
|
+
#
|
|
28
|
+
# `target add <t>` OVERWRITES this file, so a project must never set its
|
|
29
|
+
# publication values here — voxgig-solardemo-sdk lost its pinned npm package
|
|
30
|
+
# name exactly that way. Set them in the project's own model
|
|
31
|
+
# (`model/sdk.aontu`), where they survive a resync.
|
|
32
|
+
#
|
|
33
|
+
# For that to work this file must LEAVE THOSE KEYS UNSET: in aontu a concrete
|
|
34
|
+
# value does not yield to another concrete value, it CONFLICTS, and two
|
|
35
|
+
# defaults conflict too. The schema (@voxgig/sdkgen/model/sdkgen.aontu)
|
|
36
|
+
# already defaults `tag.active`, `registry.state`, `registry.active` and
|
|
37
|
+
# `registry.package`, so a project's concrete value wins over the default and
|
|
38
|
+
# repeating them here would only take that away.
|
|
39
|
+
#
|
|
40
|
+
# What remains below is per-target registry IDENTITY, which is not a project
|
|
41
|
+
# choice and stays concrete.
|
|
27
42
|
main: kit: target: rb: publish: {
|
|
28
|
-
tag: { active: true }
|
|
29
43
|
registry: {
|
|
30
|
-
state: 'pending'
|
|
31
|
-
active: false
|
|
32
44
|
name: 'rubygems'
|
|
33
45
|
url: 'https://rubygems.org'
|
|
34
46
|
vault: { recipe: 'gem', alias: 'gem' }
|
|
@@ -25,13 +25,35 @@ main: kit: feature: &: target: rust: deps: &: {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
# Publication: crates.io registry (declared, publish pending — git-tag only).
|
|
28
|
+
#
|
|
29
|
+
# `target add <t>` OVERWRITES this file, so a project must never set its
|
|
30
|
+
# publication values here — voxgig-solardemo-sdk lost its pinned npm package
|
|
31
|
+
# name exactly that way. Set them in the project's own model
|
|
32
|
+
# (`model/sdk.aontu`), where they survive a resync.
|
|
33
|
+
#
|
|
34
|
+
# For that to work this file must LEAVE THOSE KEYS UNSET: in aontu a concrete
|
|
35
|
+
# value does not yield to another concrete value, it CONFLICTS, and two
|
|
36
|
+
# defaults conflict too. The schema (@voxgig/sdkgen/model/sdkgen.aontu)
|
|
37
|
+
# already defaults `tag.active`, `registry.state`, `registry.active` and
|
|
38
|
+
# `registry.package`, so a project's concrete value wins over the default and
|
|
39
|
+
# repeating them here would only take that away.
|
|
40
|
+
#
|
|
41
|
+
# What remains below is per-target registry IDENTITY, which is not a project
|
|
42
|
+
# choice and stays concrete.
|
|
28
43
|
main: kit: target: rust: publish: {
|
|
29
|
-
tag: { active: true }
|
|
30
44
|
registry: {
|
|
31
|
-
state: 'pending'
|
|
32
|
-
active: false
|
|
33
45
|
name: 'crates.io'
|
|
34
46
|
url: 'https://crates.io'
|
|
35
47
|
vault: { alias: 'cratesio', env: 'CARGO_REGISTRY_TOKEN' }
|
|
36
48
|
}
|
|
37
49
|
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# Feature source may be trimmed to the model's selection. The one template
|
|
53
|
+
# needing the COMPLETE set is the cross-feature test suite, which `use`s
|
|
54
|
+
# every feature module — so it is dropped alongside the features it
|
|
55
|
+
# exercises whenever the set is trimmed.
|
|
56
|
+
main: kit: target: rust: feature: {
|
|
57
|
+
trim: true
|
|
58
|
+
fullset: ['tests/feature_test.rs']
|
|
59
|
+
}
|
|
@@ -25,13 +25,35 @@ main: kit: feature: &: target: scala: deps: &: {
|
|
|
25
25
|
|
|
26
26
|
# Publication: tag-only for now (tag scala/vX.Y.Z) — Maven Central
|
|
27
27
|
# publication via the Sonatype Central Portal is declared but pending.
|
|
28
|
+
# Publication.
|
|
29
|
+
#
|
|
30
|
+
# `target add <t>` OVERWRITES this file, so a project must never set its
|
|
31
|
+
# publication values here — voxgig-solardemo-sdk lost its pinned npm package
|
|
32
|
+
# name exactly that way. Set them in the project's own model
|
|
33
|
+
# (`model/sdk.aontu`), where they survive a resync.
|
|
34
|
+
#
|
|
35
|
+
# For that to work this file must LEAVE THOSE KEYS UNSET: in aontu a concrete
|
|
36
|
+
# value does not yield to another concrete value, it CONFLICTS, and two
|
|
37
|
+
# defaults conflict too. The schema (@voxgig/sdkgen/model/sdkgen.aontu)
|
|
38
|
+
# already defaults `tag.active`, `registry.state`, `registry.active` and
|
|
39
|
+
# `registry.package`, so a project's concrete value wins over the default and
|
|
40
|
+
# repeating them here would only take that away.
|
|
41
|
+
#
|
|
42
|
+
# What remains below is per-target registry IDENTITY, which is not a project
|
|
43
|
+
# choice and stays concrete.
|
|
28
44
|
main: kit: target: scala: publish: {
|
|
29
|
-
tag: { active: true }
|
|
30
45
|
registry: {
|
|
31
|
-
state: 'pending'
|
|
32
|
-
active: false
|
|
33
46
|
name: 'maven-central'
|
|
34
47
|
url: 'https://central.sonatype.com'
|
|
35
48
|
vault: { recipe: 'maven', alias: 'central' }
|
|
36
49
|
}
|
|
37
50
|
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# Feature source is NOT trimmed to the model's selection here: the cross-
|
|
54
|
+
# feature tests live inside sdktest/SdkTestMain.scala, the single test
|
|
55
|
+
# entry point, so they cannot be dropped without losing every other test
|
|
56
|
+
# too. Trimming stays off until that suite is split per feature.
|
|
57
|
+
main: kit: target: scala: feature: {
|
|
58
|
+
trim: false
|
|
59
|
+
}
|
|
@@ -23,13 +23,35 @@ main: kit: feature: &: target: swift: deps: &: {
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
# Publication: SwiftPM registry is git-tag only (publish pending).
|
|
26
|
+
#
|
|
27
|
+
# `target add <t>` OVERWRITES this file, so a project must never set its
|
|
28
|
+
# publication values here — voxgig-solardemo-sdk lost its pinned npm package
|
|
29
|
+
# name exactly that way. Set them in the project's own model
|
|
30
|
+
# (`model/sdk.aontu`), where they survive a resync.
|
|
31
|
+
#
|
|
32
|
+
# For that to work this file must LEAVE THOSE KEYS UNSET: in aontu a concrete
|
|
33
|
+
# value does not yield to another concrete value, it CONFLICTS, and two
|
|
34
|
+
# defaults conflict too. The schema (@voxgig/sdkgen/model/sdkgen.aontu)
|
|
35
|
+
# already defaults `tag.active`, `registry.state`, `registry.active` and
|
|
36
|
+
# `registry.package`, so a project's concrete value wins over the default and
|
|
37
|
+
# repeating them here would only take that away.
|
|
38
|
+
#
|
|
39
|
+
# What remains below is per-target registry IDENTITY, which is not a project
|
|
40
|
+
# choice and stays concrete.
|
|
26
41
|
main: kit: target: swift: publish: {
|
|
27
|
-
tag: { active: true }
|
|
28
42
|
registry: {
|
|
29
|
-
state: 'pending'
|
|
30
|
-
active: false
|
|
31
43
|
name: 'swiftpm'
|
|
32
44
|
url: 'https://swift.org/package-manager'
|
|
33
45
|
vault: { alias: 'swiftpm', env: 'SWIFTPM_TOKEN' }
|
|
34
46
|
}
|
|
35
47
|
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# Feature source may be trimmed to the model's selection. The one template
|
|
51
|
+
# needing the COMPLETE set is the cross-feature test suite, which
|
|
52
|
+
# constructs every *Feature type — so it is dropped alongside the
|
|
53
|
+
# features it exercises whenever the set is trimmed.
|
|
54
|
+
main: kit: target: swift: feature: {
|
|
55
|
+
trim: true
|
|
56
|
+
fullset: ['Tests/ProjectNameSDKTests/FeatureTest.swift']
|
|
57
|
+
}
|
|
@@ -27,11 +27,23 @@ main: kit: feature: &: target: ts: deps: &: {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
# Publication: npm registry (declared, publish pending — git-tag only).
|
|
30
|
+
#
|
|
31
|
+
# `target add <t>` OVERWRITES this file, so a project must never set its
|
|
32
|
+
# publication values here — voxgig-solardemo-sdk lost its pinned npm package
|
|
33
|
+
# name exactly that way. Set them in the project's own model
|
|
34
|
+
# (`model/sdk.aontu`), where they survive a resync.
|
|
35
|
+
#
|
|
36
|
+
# For that to work this file must LEAVE THOSE KEYS UNSET: in aontu a concrete
|
|
37
|
+
# value does not yield to another concrete value, it CONFLICTS, and two
|
|
38
|
+
# defaults conflict too. The schema (@voxgig/sdkgen/model/sdkgen.aontu)
|
|
39
|
+
# already defaults `tag.active`, `registry.state`, `registry.active` and
|
|
40
|
+
# `registry.package`, so a project's concrete value wins over the default and
|
|
41
|
+
# repeating them here would only take that away.
|
|
42
|
+
#
|
|
43
|
+
# What remains below is per-target registry IDENTITY, which is not a project
|
|
44
|
+
# choice and stays concrete.
|
|
30
45
|
main: kit: target: ts: publish: {
|
|
31
|
-
tag: { active: true }
|
|
32
46
|
registry: {
|
|
33
|
-
state: 'pending'
|
|
34
|
-
active: false
|
|
35
47
|
name: 'npm'
|
|
36
48
|
url: 'https://registry.npmjs.org'
|
|
37
49
|
vault: { recipe: 'npm', alias: 'npm' }
|
|
@@ -25,13 +25,36 @@ main: kit: feature: &: target: zig: deps: &: {
|
|
|
25
25
|
# routes deploy-zig to the root tag-push recipe. WITHOUT it, Deploy.ts falls
|
|
26
26
|
# through to `make -C zig publish` — but zig's Makefile has no `publish` target,
|
|
27
27
|
# so the deploy fails. Mirror c.aontu exactly.
|
|
28
|
+
# Publication.
|
|
29
|
+
#
|
|
30
|
+
# `target add <t>` OVERWRITES this file, so a project must never set its
|
|
31
|
+
# publication values here — voxgig-solardemo-sdk lost its pinned npm package
|
|
32
|
+
# name exactly that way. Set them in the project's own model
|
|
33
|
+
# (`model/sdk.aontu`), where they survive a resync.
|
|
34
|
+
#
|
|
35
|
+
# For that to work this file must LEAVE THOSE KEYS UNSET: in aontu a concrete
|
|
36
|
+
# value does not yield to another concrete value, it CONFLICTS, and two
|
|
37
|
+
# defaults conflict too. The schema (@voxgig/sdkgen/model/sdkgen.aontu)
|
|
38
|
+
# already defaults `tag.active`, `registry.state`, `registry.active` and
|
|
39
|
+
# `registry.package`, so a project's concrete value wins over the default and
|
|
40
|
+
# repeating them here would only take that away.
|
|
41
|
+
#
|
|
42
|
+
# What remains below is per-target registry IDENTITY, which is not a project
|
|
43
|
+
# choice and stays concrete.
|
|
28
44
|
main: kit: target: zig: publish: {
|
|
29
|
-
tag: { active: true }
|
|
30
45
|
registry: {
|
|
31
|
-
state: 'pending'
|
|
32
|
-
active: false
|
|
33
46
|
name: 'none'
|
|
34
47
|
url: ''
|
|
35
48
|
vault: { alias: 'none', env: 'NONE' }
|
|
36
49
|
}
|
|
37
50
|
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# Feature source is NOT trimmed to the model's selection here: root.zig
|
|
54
|
+
# re-exports every feature type with @import("feature/<name>.zig"), and
|
|
55
|
+
# build.zig names test/feature_test.zig explicitly, so a trimmed tree
|
|
56
|
+
# fails to build. Trimming stays off until root.zig's feature exports are
|
|
57
|
+
# driven from the model.
|
|
58
|
+
main: kit: target: zig: feature: {
|
|
59
|
+
trim: false
|
|
60
|
+
}
|
|
@@ -90,17 +90,16 @@ voxgig_value* make_config(void) {
|
|
|
90
90
|
Feature* make_feature(const char* name) {
|
|
91
91
|
`)
|
|
92
92
|
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const featureNames = new Set<string>(SHIPPED_FEATURES)
|
|
93
|
+
// Dispatch to the features the MODEL declares, and only those.
|
|
94
|
+
//
|
|
95
|
+
// This used to merge in a hardcoded list of every feature the C target
|
|
96
|
+
// ships, on the reasoning that the runtime templates
|
|
97
|
+
// (tm/c/feature/*.c) are always present. `target add` now trims feature
|
|
98
|
+
// source to the model's selection, so that reasoning is false: a
|
|
99
|
+
// reference to `feature_timeout_new` for an undeclared feature is an
|
|
100
|
+
// unresolved symbol at LINK time — the whole test suite fails to link,
|
|
101
|
+
// which is how this was found. Sorted for byte-stability.
|
|
102
|
+
const featureNames = new Set<string>()
|
|
104
103
|
each(feature, (f: any) => {
|
|
105
104
|
if (f.name && f.name !== 'base') featureNames.add(f.name)
|
|
106
105
|
})
|
|
@@ -46,7 +46,11 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
46
46
|
(a['#' + camelify(opname) + 'Op'] =
|
|
47
47
|
!opnames.includes(opname) ?
|
|
48
48
|
({ indent }: any) => {
|
|
49
|
-
|
|
49
|
+
// The stub mirrors the real signature: ops resolve to the
|
|
50
|
+
// ENTITY (`list` to a NULL-terminated array of them), so an
|
|
51
|
+
// unsupported op declares the same return type as the vtable.
|
|
52
|
+
const ret = 'list' === opname ? 'Entity**' : 'Entity*'
|
|
53
|
+
Content({ indent }, `static ${ret} ${evar}_${opname}(Entity* e, voxgig_value* reqarg, voxgig_value* ctrl, PNError** err) {
|
|
50
54
|
(void)e; (void)reqarg; (void)ctrl;
|
|
51
55
|
*err = unsupported_op("${opname}", "${entity.name}");
|
|
52
56
|
return NULL;
|
|
@@ -14,6 +14,8 @@ typedef struct entyvar_entity {
|
|
|
14
14
|
voxgig_value* data; // Map
|
|
15
15
|
voxgig_value* mtch; // Map
|
|
16
16
|
Context* entctx;
|
|
17
|
+
// Set once a successful `remove` resolves on this instance.
|
|
18
|
+
bool deleted;
|
|
17
19
|
} entyvar_entity;
|
|
18
20
|
|
|
19
21
|
typedef void (*entyvar_postdone_fn)(entyvar_entity* self, Context* ctx);
|
|
@@ -24,11 +26,14 @@ static const char* entyvar_get_name(Entity* e);
|
|
|
24
26
|
static Entity* entyvar_make(Entity* e);
|
|
25
27
|
static voxgig_value* entyvar_data(Entity* e, voxgig_value* args);
|
|
26
28
|
static voxgig_value* entyvar_matchv(Entity* e, voxgig_value* args);
|
|
27
|
-
|
|
28
|
-
static
|
|
29
|
-
static
|
|
30
|
-
static
|
|
31
|
-
static
|
|
29
|
+
// Ops resolve to the ENTITY (`list` to a NULL-terminated array of them).
|
|
30
|
+
static Entity* entyvar_load(Entity* e, voxgig_value* reqmatch, voxgig_value* ctrl, PNError** err);
|
|
31
|
+
static Entity** entyvar_list(Entity* e, voxgig_value* reqmatch, voxgig_value* ctrl, PNError** err);
|
|
32
|
+
static Entity* entyvar_create(Entity* e, voxgig_value* reqdata, voxgig_value* ctrl, PNError** err);
|
|
33
|
+
static Entity* entyvar_update(Entity* e, voxgig_value* reqdata, voxgig_value* ctrl, PNError** err);
|
|
34
|
+
static Entity* entyvar_remove(Entity* e, voxgig_value* reqmatch, voxgig_value* ctrl, PNError** err);
|
|
35
|
+
static void entyvar_mark_deleted(Entity* e);
|
|
36
|
+
static bool entyvar_deleted(Entity* e);
|
|
32
37
|
|
|
33
38
|
static Context* entyvar_ent_ctx(entyvar_entity* self) {
|
|
34
39
|
return self->entctx;
|
|
@@ -252,11 +257,24 @@ static voxgig_value* entyvar_matchv(Entity* e, voxgig_value* args) {
|
|
|
252
257
|
|
|
253
258
|
// #RemoveOp
|
|
254
259
|
|
|
260
|
+
// `remove` resolves to the entity, marked. The instance KEEPS the data it
|
|
261
|
+
// held - a caller can still read what was deleted - but it is no longer a
|
|
262
|
+
// live record.
|
|
263
|
+
static void entyvar_mark_deleted(Entity* e) {
|
|
264
|
+
((entyvar_entity*)e)->deleted = true;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
static bool entyvar_deleted(Entity* e) {
|
|
268
|
+
return ((entyvar_entity*)e)->deleted;
|
|
269
|
+
}
|
|
270
|
+
|
|
255
271
|
static const EntityVT entyvar_VT = {
|
|
256
272
|
entyvar_get_name,
|
|
257
273
|
entyvar_make,
|
|
258
274
|
entyvar_data,
|
|
259
275
|
entyvar_matchv,
|
|
276
|
+
entyvar_mark_deleted,
|
|
277
|
+
entyvar_deleted,
|
|
260
278
|
entyvar_load,
|
|
261
279
|
entyvar_list,
|
|
262
280
|
entyvar_create,
|
|
@@ -11,7 +11,7 @@ static void entyvar_create_postdone(entyvar_entity* self, Context* ctx) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
static
|
|
14
|
+
static Entity* entyvar_create(Entity* e, voxgig_value* reqdata, voxgig_value* ctrl, PNError** err) {
|
|
15
15
|
entyvar_entity* self = (entyvar_entity*)e;
|
|
16
16
|
CtxSpec cs;
|
|
17
17
|
memset(&cs, 0, sizeof(cs));
|
|
@@ -21,7 +21,14 @@ static voxgig_value* entyvar_create(Entity* e, voxgig_value* reqdata, voxgig_val
|
|
|
21
21
|
cs.data = self->data;
|
|
22
22
|
cs.reqdata = reqdata;
|
|
23
23
|
Context* ctx = make_context_util(cs, entyvar_ent_ctx(self));
|
|
24
|
-
|
|
24
|
+
entyvar_run_op(self, ctx, entyvar_create_postdone, err);
|
|
25
|
+
if (*err) return NULL;
|
|
26
|
+
|
|
27
|
+
// The operation resolves to THIS entity: run_op has just absorbed the
|
|
28
|
+
// result into it, and the caller reaches the record through vt->data.
|
|
29
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
30
|
+
|
|
31
|
+
return e;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
// EJECT-END
|
|
@@ -8,7 +8,7 @@ static void entyvar_list_postdone(entyvar_entity* self, Context* ctx) {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
static
|
|
11
|
+
static Entity** entyvar_list(Entity* e, voxgig_value* reqmatch, voxgig_value* ctrl, PNError** err) {
|
|
12
12
|
entyvar_entity* self = (entyvar_entity*)e;
|
|
13
13
|
CtxSpec cs;
|
|
14
14
|
memset(&cs, 0, sizeof(cs));
|
|
@@ -18,7 +18,24 @@ static voxgig_value* entyvar_list(Entity* e, voxgig_value* reqmatch, voxgig_valu
|
|
|
18
18
|
cs.data = self->data;
|
|
19
19
|
cs.reqmatch = reqmatch;
|
|
20
20
|
Context* ctx = make_context_util(cs, entyvar_ent_ctx(self));
|
|
21
|
-
|
|
21
|
+
voxgig_value* out = entyvar_run_op(self, ctx, entyvar_list_postdone, err);
|
|
22
|
+
if (*err) return NULL;
|
|
23
|
+
|
|
24
|
+
// `list` resolves to one ENTITY per record. make_result cannot build them
|
|
25
|
+
// here - it works in voxgig_value, which has no slot for an entity - so the
|
|
26
|
+
// op does, mirroring what the dynamic targets get from make_result. The
|
|
27
|
+
// array is NULL-terminated.
|
|
28
|
+
size_t n = voxgig_is_list(out) ? voxgig_as_list(out)->len : 0;
|
|
29
|
+
Entity** items = (Entity**)calloc(n + 1, sizeof(Entity*));
|
|
30
|
+
for (size_t i = 0; i < n; i++) {
|
|
31
|
+
voxgig_value* entry = voxgig_as_list(out)->items[i];
|
|
32
|
+
Entity* ent = e->vt->make(e);
|
|
33
|
+
if (voxgig_is_map(entry)) ent->vt->data(ent, entry);
|
|
34
|
+
items[i] = ent;
|
|
35
|
+
}
|
|
36
|
+
items[n] = NULL;
|
|
37
|
+
|
|
38
|
+
return items;
|
|
22
39
|
}
|
|
23
40
|
|
|
24
41
|
// EJECT-END
|
|
@@ -13,7 +13,7 @@ static void entyvar_load_postdone(entyvar_entity* self, Context* ctx) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
static
|
|
16
|
+
static Entity* entyvar_load(Entity* e, voxgig_value* reqmatch, voxgig_value* ctrl, PNError** err) {
|
|
17
17
|
entyvar_entity* self = (entyvar_entity*)e;
|
|
18
18
|
CtxSpec cs;
|
|
19
19
|
memset(&cs, 0, sizeof(cs));
|
|
@@ -23,7 +23,14 @@ static voxgig_value* entyvar_load(Entity* e, voxgig_value* reqmatch, voxgig_valu
|
|
|
23
23
|
cs.data = self->data;
|
|
24
24
|
cs.reqmatch = reqmatch;
|
|
25
25
|
Context* ctx = make_context_util(cs, entyvar_ent_ctx(self));
|
|
26
|
-
|
|
26
|
+
entyvar_run_op(self, ctx, entyvar_load_postdone, err);
|
|
27
|
+
if (*err) return NULL;
|
|
28
|
+
|
|
29
|
+
// The operation resolves to THIS entity: run_op has just absorbed the
|
|
30
|
+
// result into it, and the caller reaches the record through vt->data.
|
|
31
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
32
|
+
|
|
33
|
+
return e;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
// EJECT-END
|
|
@@ -13,7 +13,7 @@ static void entyvar_remove_postdone(entyvar_entity* self, Context* ctx) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
static
|
|
16
|
+
static Entity* entyvar_remove(Entity* e, voxgig_value* reqmatch, voxgig_value* ctrl, PNError** err) {
|
|
17
17
|
entyvar_entity* self = (entyvar_entity*)e;
|
|
18
18
|
CtxSpec cs;
|
|
19
19
|
memset(&cs, 0, sizeof(cs));
|
|
@@ -23,7 +23,17 @@ static voxgig_value* entyvar_remove(Entity* e, voxgig_value* reqmatch, voxgig_va
|
|
|
23
23
|
cs.data = self->data;
|
|
24
24
|
cs.reqmatch = reqmatch;
|
|
25
25
|
Context* ctx = make_context_util(cs, entyvar_ent_ctx(self));
|
|
26
|
-
|
|
26
|
+
entyvar_run_op(self, ctx, entyvar_remove_postdone, err);
|
|
27
|
+
if (*err) return NULL;
|
|
28
|
+
|
|
29
|
+
// The operation resolves to THIS entity: run_op has just absorbed the
|
|
30
|
+
// result into it, and the caller reaches the record through vt->data.
|
|
31
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
32
|
+
|
|
33
|
+
// A removed entity keeps its data but is no longer a live record.
|
|
34
|
+
self->deleted = true;
|
|
35
|
+
|
|
36
|
+
return e;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
// EJECT-END
|
|
@@ -13,7 +13,7 @@ static void entyvar_update_postdone(entyvar_entity* self, Context* ctx) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
static
|
|
16
|
+
static Entity* entyvar_update(Entity* e, voxgig_value* reqdata, voxgig_value* ctrl, PNError** err) {
|
|
17
17
|
entyvar_entity* self = (entyvar_entity*)e;
|
|
18
18
|
CtxSpec cs;
|
|
19
19
|
memset(&cs, 0, sizeof(cs));
|
|
@@ -23,7 +23,14 @@ static voxgig_value* entyvar_update(Entity* e, voxgig_value* reqdata, voxgig_val
|
|
|
23
23
|
cs.data = self->data;
|
|
24
24
|
cs.reqdata = reqdata;
|
|
25
25
|
Context* ctx = make_context_util(cs, entyvar_ent_ctx(self));
|
|
26
|
-
|
|
26
|
+
entyvar_run_op(self, ctx, entyvar_update_postdone, err);
|
|
27
|
+
if (*err) return NULL;
|
|
28
|
+
|
|
29
|
+
// The operation resolves to THIS entity: run_op has just absorbed the
|
|
30
|
+
// result into it, and the caller reaches the record through vt->data.
|
|
31
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
32
|
+
|
|
33
|
+
return e;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
// EJECT-END
|
|
@@ -29,13 +29,16 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
29
29
|
ent (api/${e.name} sdk nil)]
|
|
30
30
|
`)
|
|
31
31
|
if (hasCreate) {
|
|
32
|
-
Content(` (let [res (e-${e.name}/create ent (vs/jm "name" "smoke") nil)
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
Content(` (let [res (e-${e.name}/create ent (vs/jm "name" "smoke") nil)
|
|
33
|
+
rec (if (map? res) ((:data-get res)) res)]
|
|
34
|
+
;; create resolves to the ENTITY; the record is data-get.
|
|
35
|
+
(t/is-true (vs/ismap rec) "create resolves to an entity carrying a record")
|
|
36
|
+
(t/is-true (some? (vs/getprop rec "id")) "created record has an id"))
|
|
35
37
|
`)
|
|
36
38
|
}
|
|
37
39
|
if (hasList) {
|
|
38
40
|
Content(` (let [items (e-${e.name}/list ent (vs/jm) nil)]
|
|
41
|
+
;; list resolves to one entity per record.
|
|
39
42
|
(t/is-true (sequential? items) "list returns a sequential collection"))
|
|
40
43
|
`)
|
|
41
44
|
}
|
|
@@ -34,9 +34,11 @@
|
|
|
34
34
|
utility (core/get-utility client)
|
|
35
35
|
data (atom (vs/jm))
|
|
36
36
|
match (atom (vs/jm))
|
|
37
|
+
;; Set once a successful `remove` resolves on this instance.
|
|
38
|
+
deleted (atom false)
|
|
37
39
|
entctx (core/make-context (vs/jm "entopts" entopts) (core/client-root-ctx client))
|
|
38
40
|
ent {:_name "entityname" :_client client :_utility utility :_entopts entopts
|
|
39
|
-
:_data data :_match match :_entctx entctx
|
|
41
|
+
:_data data :_match match :_deleted deleted :_entctx entctx
|
|
40
42
|
:get-name (fn [] "entityname")
|
|
41
43
|
:make (fn [] (new-entity client (vs/clone entopts)))}
|
|
42
44
|
ent (assoc ent
|
|
@@ -56,6 +58,21 @@
|
|
|
56
58
|
;; when throwing is disabled). The hook marker lines below are rewritten to
|
|
57
59
|
;; (core/feature-hook ctx "<Stage>") by the component's hook regex — a `;`
|
|
58
60
|
;; comment form, since jostraca's built-in tag replacement only matches `//`.
|
|
61
|
+
;; Every operation resolves to the ENTITY, not the raw data — the record is
|
|
62
|
+
;; reached through data-get. run-op returns the terminal result value, so the
|
|
63
|
+
;; op hands that back only when the pipeline FAILED; on success it hands back
|
|
64
|
+
;; the entity. See AGENTS.md "Entity operations return ENTITIES".
|
|
65
|
+
(defn- op-return [ent ctx out]
|
|
66
|
+
(let [result (core/oget ctx :result)]
|
|
67
|
+
(if (and result (true? (core/oget result :ok))) ent out)))
|
|
68
|
+
|
|
69
|
+
;; `remove` resolves to the entity, marked. The instance KEEPS the data it
|
|
70
|
+
;; held — a caller can still read what was deleted — but it is no longer a
|
|
71
|
+
;; live record.
|
|
72
|
+
(defn mark-deleted [ent] (reset! (:_deleted ent) true) ent)
|
|
73
|
+
|
|
74
|
+
(defn deleted [ent] (true? (deref (:_deleted ent))))
|
|
75
|
+
|
|
59
76
|
(defn- run-op [ctx post-done]
|
|
60
77
|
(try
|
|
61
78
|
; #PrePoint-Hook
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
(vs/jm "opname" "create" "ctrl" ctrl
|
|
6
6
|
"match" (deref (:_match ent)) "data" (deref (:_data ent)) "reqdata" reqdata)
|
|
7
7
|
(:_entctx ent))]
|
|
8
|
-
(run-op ctx
|
|
8
|
+
(op-return ent ctx (run-op ctx
|
|
9
9
|
(fn []
|
|
10
10
|
(when-let [result (core/oget ctx :result)]
|
|
11
11
|
(when (core/oget result :resdata)
|
|
12
12
|
(reset! (:_data ent)
|
|
13
|
-
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm))))))))))
|
|
13
|
+
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm)))))))))))
|
|
14
14
|
; EJECT-END
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
(vs/jm "opname" "load" "ctrl" ctrl
|
|
6
6
|
"match" (deref (:_match ent)) "data" (deref (:_data ent)) "reqmatch" reqmatch)
|
|
7
7
|
(:_entctx ent))]
|
|
8
|
-
(run-op ctx
|
|
8
|
+
(op-return ent ctx (run-op ctx
|
|
9
9
|
(fn []
|
|
10
10
|
(when-let [result (core/oget ctx :result)]
|
|
11
11
|
(when (core/oget result :resmatch) (reset! (:_match ent) (core/oget result :resmatch)))
|
|
12
12
|
(when (core/oget result :resdata)
|
|
13
13
|
(reset! (:_data ent)
|
|
14
|
-
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm))))))))))
|
|
14
|
+
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm)))))))))))
|
|
15
15
|
; EJECT-END
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
; EJECT-START
|
|
2
2
|
;; Remove an EntityName matching the criteria (reqmatch: id/query fields).
|
|
3
|
+
;; Resolves to THIS entity, marked as deleted (see AGENTS.md). The instance
|
|
4
|
+
;; keeps the data it held, so a caller can still read what was removed.
|
|
3
5
|
(defn remove [ent reqmatch ctrl]
|
|
4
6
|
(let [ctx (core/make-context
|
|
5
7
|
(vs/jm "opname" "remove" "ctrl" ctrl
|
|
6
8
|
"match" (deref (:_match ent)) "data" (deref (:_data ent)) "reqmatch" reqmatch)
|
|
7
|
-
(:_entctx ent))
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
(:_entctx ent))
|
|
10
|
+
out (op-return ent ctx
|
|
11
|
+
(run-op ctx
|
|
12
|
+
(fn []
|
|
13
|
+
(when-let [result (core/oget ctx :result)]
|
|
14
|
+
(when (core/oget result :resmatch) (reset! (:_match ent) (core/oget result :resmatch)))
|
|
15
|
+
(when (core/oget result :resdata)
|
|
16
|
+
(reset! (:_data ent)
|
|
17
|
+
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm)))))))))]
|
|
18
|
+
(if (= out ent) (mark-deleted ent) out)))
|
|
15
19
|
; EJECT-END
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
(vs/jm "opname" "update" "ctrl" ctrl
|
|
6
6
|
"match" (deref (:_match ent)) "data" (deref (:_data ent)) "reqdata" reqdata)
|
|
7
7
|
(:_entctx ent))]
|
|
8
|
-
(run-op ctx
|
|
8
|
+
(op-return ent ctx (run-op ctx
|
|
9
9
|
(fn []
|
|
10
10
|
(when-let [result (core/oget ctx :result)]
|
|
11
11
|
(when (core/oget result :resmatch) (reset! (:_match ent) (core/oget result :resmatch)))
|
|
12
12
|
(when (core/oget result :resdata)
|
|
13
13
|
(reset! (:_data ent)
|
|
14
|
-
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm))))))))))
|
|
14
|
+
(let [m (core/to-map (vs/clone (core/oget result :resdata)))] (if m m (vs/jm)))))))))))
|
|
15
15
|
; EJECT-END
|
|
@@ -45,7 +45,11 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
45
45
|
({ indent }: any) => {
|
|
46
46
|
const arg = ('create' === opname || 'update' === opname) ?
|
|
47
47
|
'reqdata' : 'reqmatch'
|
|
48
|
-
|
|
48
|
+
// The stub mirrors the real signature: ops resolve to the
|
|
49
|
+
// ENTITY (`list` to a vector of them), so an unsupported op
|
|
50
|
+
// has to declare the same return type to satisfy SdkEntity.
|
|
51
|
+
const ret = 'list' === opname ? 'std::vector<SdkEntityPtr>' : 'SdkEntityPtr'
|
|
52
|
+
Content({ indent }, `${ret} ${opname}(const Value& ${arg}, const Value& ctrl) override {
|
|
49
53
|
(void)${arg}; (void)ctrl;
|
|
50
54
|
throw Helpers::unsupportedOp("${opname}", this->name_);
|
|
51
55
|
}
|