@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
|
@@ -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
|
}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
cmp,
|
|
17
17
|
each,
|
|
18
18
|
buildIdNames,
|
|
19
|
-
getMatchEntries,
|
|
19
|
+
getMatchEntries, envName, envToken
|
|
20
20
|
} from '@voxgig/sdkgen'
|
|
21
21
|
|
|
22
22
|
|
|
@@ -43,7 +43,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
43
43
|
const entity: ModelEntity = props.entity
|
|
44
44
|
|
|
45
45
|
const ProjectName = model.const.Name
|
|
46
|
-
const PROJUPPER =
|
|
46
|
+
const PROJUPPER = envName(model)
|
|
47
47
|
|
|
48
48
|
const basicflow: ModelEntityFlow | undefined =
|
|
49
49
|
getModelPath(model, `main.${KIT}.flow.Basic${nom(entity, 'Name')}Flow`)
|
|
@@ -111,12 +111,12 @@ static ${entity.Name}Setup ${evar}_basic_setup(const Value& extra) {
|
|
|
111
111
|
if (!idmap.is_map()) idmap = vmap();
|
|
112
112
|
|
|
113
113
|
Value env = env_override(vmap({
|
|
114
|
-
{"${PROJUPPER}_TEST_${
|
|
114
|
+
{"${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID", idmap},
|
|
115
115
|
{"${PROJUPPER}_TEST_LIVE", Value("FALSE")},
|
|
116
116
|
{"${PROJUPPER}_TEST_EXPLAIN", Value("FALSE")}
|
|
117
117
|
}));
|
|
118
118
|
|
|
119
|
-
Value idmap_resolved = Helpers::toMapAny(getp(env, "${PROJUPPER}_TEST_${
|
|
119
|
+
Value idmap_resolved = Helpers::toMapAny(getp(env, "${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID"));
|
|
120
120
|
if (!idmap_resolved.is_map()) idmap_resolved = idmap;
|
|
121
121
|
`)
|
|
122
122
|
|
|
@@ -264,7 +264,7 @@ const generateCreate: OpGen = (ctx, step: any, index) => {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
Content(` {
|
|
267
|
-
Value ${datavar}_result = ${entvar}->create(Struct::clone(${datavar}), Value::undef());
|
|
267
|
+
Value ${datavar}_result = ${entvar}->create(Struct::clone(${datavar}), Value::undef())->data();
|
|
268
268
|
${datavar} = Helpers::toMapAny(${datavar}_result);
|
|
269
269
|
if (!${datavar}.is_map()) ${datavar} = vmap();
|
|
270
270
|
ASSERT_TRUE(${datavar}.is_map(), "expected create result to be a map");
|
|
@@ -302,7 +302,10 @@ const generateList: OpGen = (ctx, step: any, index) => {
|
|
|
302
302
|
Content(` setp(${matchvar}, "${key}", getp(setup.idmap, "${val}"));
|
|
303
303
|
`)
|
|
304
304
|
}
|
|
305
|
-
Content(`
|
|
305
|
+
Content(` auto ${listvar}_ents = ${entvar}->list(Struct::clone(${matchvar}), Value::undef());
|
|
306
|
+
// list resolves to one ENTITY per record; the flow asserts on the records.
|
|
307
|
+
Value ${listvar} = vlist();
|
|
308
|
+
for (const auto& e : ${listvar}_ents) { ${listvar}.as_list()->push_back(e->data()); }
|
|
306
309
|
ASSERT_TRUE(${listvar}.is_list(), "expected list result to be an array");
|
|
307
310
|
`)
|
|
308
311
|
|
|
@@ -378,7 +381,7 @@ const generateUpdate: OpGen = (ctx, step: any, index) => {
|
|
|
378
381
|
}
|
|
379
382
|
}
|
|
380
383
|
}
|
|
381
|
-
Content(` Value ${resdatavar}_result = ${entvar}->update(Struct::clone(${datavar}_up), Value::undef());
|
|
384
|
+
Content(` Value ${resdatavar}_result = ${entvar}->update(Struct::clone(${datavar}_up), Value::undef())->data();
|
|
382
385
|
Value ${resdatavar} = Helpers::toMapAny(${resdatavar}_result);
|
|
383
386
|
if (!${resdatavar}.is_map()) ${resdatavar} = vmap();
|
|
384
387
|
ASSERT_TRUE(${resdatavar}.is_map(), "expected update result to be a map");
|
|
@@ -415,14 +418,14 @@ const generateLoad: OpGen = (ctx, step: any, index) => {
|
|
|
415
418
|
}
|
|
416
419
|
if (hasEntId) {
|
|
417
420
|
Content(` Value ${matchvar} = vmap({{"id", getp(${srcdatavar}, "id")}});
|
|
418
|
-
Value ${datavar}_loaded = ${entvar}->load(Struct::clone(${matchvar}), Value::undef());
|
|
421
|
+
Value ${datavar}_loaded = ${entvar}->load(Struct::clone(${matchvar}), Value::undef())->data();
|
|
419
422
|
Value ${datavar}_load_result = Helpers::toMapAny(${datavar}_loaded);
|
|
420
423
|
ASSERT_TRUE(${datavar}_load_result.is_map(), "expected load result to be a map");
|
|
421
424
|
ASSERT_EQ_VAL(getp(${datavar}_load_result, "id"), getp(${srcdatavar}, "id"), "expected load result id to match");
|
|
422
425
|
`)
|
|
423
426
|
} else {
|
|
424
427
|
Content(` Value ${matchvar} = vmap();
|
|
425
|
-
Value ${datavar}_loaded = ${entvar}->load(${matchvar}, Value::undef());
|
|
428
|
+
Value ${datavar}_loaded = ${entvar}->load(${matchvar}, Value::undef())->data();
|
|
426
429
|
ASSERT_TRUE(!${datavar}_loaded.is_undef(), "expected load result to be non-nil");
|
|
427
430
|
`)
|
|
428
431
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// EJECT-START
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SdkEntityPtr create(const Value& reqdata, const Value& ctrl) override {
|
|
4
4
|
CtxSpec cs;
|
|
5
5
|
cs.setOpname("create");
|
|
6
6
|
cs.ctrlMap = ctrl.is_map() ? ctrl : vmap();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
cs.reqdata = reqdata.is_map() ? reqdata : vmap();
|
|
10
10
|
CtxPtr ctx = this->utility->makeContext(cs, this->entctx);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
runOp(ctx, [this, ctx]() {
|
|
13
13
|
if (ctx->result) {
|
|
14
14
|
if (!is_nullish(ctx->result->resdata)) {
|
|
15
15
|
Value d = Helpers::toMapAny(Struct::clone(ctx->result->resdata));
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
+
|
|
21
|
+
// The operation resolves to THIS entity: runOp has just absorbed the
|
|
22
|
+
// result into it, and the caller reaches the record through data().
|
|
23
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
24
|
+
|
|
25
|
+
return this->self();
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
// EJECT-END
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// EJECT-START
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
std::vector<SdkEntityPtr> list(const Value& reqmatch, const Value& ctrl) override {
|
|
4
4
|
CtxSpec cs;
|
|
5
5
|
cs.setOpname("list");
|
|
6
6
|
cs.ctrlMap = ctrl.is_map() ? ctrl : vmap();
|
|
@@ -9,13 +9,29 @@
|
|
|
9
9
|
cs.reqmatch = reqmatch.is_map() ? reqmatch : vmap();
|
|
10
10
|
CtxPtr ctx = this->utility->makeContext(cs, this->entctx);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Value out = runOp(ctx, [this, ctx]() {
|
|
13
13
|
if (ctx->result) {
|
|
14
14
|
if (ctx->result->resmatch.is_map()) {
|
|
15
15
|
this->match_ = ctx->result->resmatch;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
|
|
20
|
+
// `list` resolves to one ENTITY per record. makeResult cannot build them
|
|
21
|
+
// here - it works in Value, which has no slot for an entity - so the op
|
|
22
|
+
// does, mirroring what the dynamic targets get from makeResult.
|
|
23
|
+
std::vector<SdkEntityPtr> items;
|
|
24
|
+
if (out.is_list()) {
|
|
25
|
+
for (const auto& entry : *out.as_list()) {
|
|
26
|
+
SdkEntityPtr ent = std::static_pointer_cast<SdkEntity>(this->make());
|
|
27
|
+
if (entry.is_map()) {
|
|
28
|
+
ent->data(entry);
|
|
29
|
+
}
|
|
30
|
+
items.push_back(ent);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return items;
|
|
19
35
|
}
|
|
20
36
|
|
|
21
37
|
// EJECT-END
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// EJECT-START
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SdkEntityPtr load(const Value& reqmatch, const Value& ctrl) override {
|
|
4
4
|
CtxSpec cs;
|
|
5
5
|
cs.setOpname("load");
|
|
6
6
|
cs.ctrlMap = ctrl.is_map() ? ctrl : vmap();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
cs.reqmatch = reqmatch.is_map() ? reqmatch : vmap();
|
|
10
10
|
CtxPtr ctx = this->utility->makeContext(cs, this->entctx);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
runOp(ctx, [this, ctx]() {
|
|
13
13
|
if (ctx->result) {
|
|
14
14
|
if (ctx->result->resmatch.is_map()) {
|
|
15
15
|
this->match_ = ctx->result->resmatch;
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
// The operation resolves to THIS entity: runOp has just absorbed the
|
|
25
|
+
// result into it, and the caller reaches the record through data().
|
|
26
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
27
|
+
|
|
28
|
+
return this->self();
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
// EJECT-END
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// EJECT-START
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SdkEntityPtr remove(const Value& reqmatch, const Value& ctrl) override {
|
|
4
4
|
CtxSpec cs;
|
|
5
5
|
cs.setOpname("remove");
|
|
6
6
|
cs.ctrlMap = ctrl.is_map() ? ctrl : vmap();
|
|
@@ -9,13 +9,22 @@
|
|
|
9
9
|
cs.reqmatch = reqmatch.is_map() ? reqmatch : vmap();
|
|
10
10
|
CtxPtr ctx = this->utility->makeContext(cs, this->entctx);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
runOp(ctx, [this, ctx]() {
|
|
13
13
|
if (ctx->result) {
|
|
14
14
|
if (ctx->result->resmatch.is_map()) {
|
|
15
15
|
this->match_ = ctx->result->resmatch;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
|
|
20
|
+
// The operation resolves to THIS entity: runOp has just absorbed the
|
|
21
|
+
// result into it, and the caller reaches the record through data().
|
|
22
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
23
|
+
|
|
24
|
+
// A removed entity keeps its data but is no longer a live record.
|
|
25
|
+
this->markDeleted();
|
|
26
|
+
|
|
27
|
+
return this->self();
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
// EJECT-END
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// EJECT-START
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SdkEntityPtr update(const Value& reqdata, const Value& ctrl) override {
|
|
4
4
|
CtxSpec cs;
|
|
5
5
|
cs.setOpname("update");
|
|
6
6
|
cs.ctrlMap = ctrl.is_map() ? ctrl : vmap();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
cs.reqdata = reqdata.is_map() ? reqdata : vmap();
|
|
10
10
|
CtxPtr ctx = this->utility->makeContext(cs, this->entctx);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
runOp(ctx, [this, ctx]() {
|
|
13
13
|
if (ctx->result) {
|
|
14
14
|
if (!is_nullish(ctx->result->resdata)) {
|
|
15
15
|
Value d = Helpers::toMapAny(Struct::clone(ctx->result->resdata));
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
+
|
|
21
|
+
// The operation resolves to THIS entity: runOp has just absorbed the
|
|
22
|
+
// result into it, and the caller reaches the record through data().
|
|
23
|
+
// See AGENTS.md "Entity operations return ENTITIES".
|
|
24
|
+
|
|
25
|
+
return this->self();
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
// EJECT-END
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
collectDeps,
|
|
8
8
|
pkgDescription,
|
|
9
9
|
repoInfo,
|
|
10
|
+
packageVersion,
|
|
10
11
|
} from '@voxgig/sdkgen'
|
|
11
12
|
|
|
12
13
|
|
|
@@ -56,7 +57,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
56
57
|
<NoWarn>$(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8625;CS1591</NoWarn>
|
|
57
58
|
|
|
58
59
|
<!-- NuGet package metadata (publication pending; see Makefile). -->
|
|
59
|
-
<Version
|
|
60
|
+
<Version>${packageVersion(model, target.name)}</Version>
|
|
60
61
|
<PackageId>${Name}.Sdk</PackageId>
|
|
61
62
|
<Authors>Voxgig</Authors>
|
|
62
63
|
<Description>${pkgDescription(model, 'csharp')}</Description>
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
File,
|
|
12
12
|
cmp,
|
|
13
13
|
snakify,
|
|
14
|
-
isAuthActive,
|
|
14
|
+
isAuthActive, envName, envToken
|
|
15
15
|
} from '@voxgig/sdkgen'
|
|
16
16
|
|
|
17
17
|
import { formatCsValue } from './utility_csharp'
|
|
@@ -62,8 +62,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
62
62
|
const entity: ModelEntity = props.entity
|
|
63
63
|
|
|
64
64
|
const Name = model.const.Name
|
|
65
|
-
const PROJECTNAME =
|
|
66
|
-
const ENTUPPER =
|
|
65
|
+
const PROJECTNAME = envName(model)
|
|
66
|
+
const ENTUPPER = envToken(entity.name)
|
|
67
67
|
|
|
68
68
|
const authActive = isAuthActive(model)
|
|
69
69
|
const apikeyEnvEntry = authActive
|