@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, isAuthActive, envName, canonKey, opRequestShape, entityIdField, entityDataIdField, entityOps, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -8,6 +8,17 @@ import {
|
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
// A `list()` on a NESTED entity needs its parent path params. The
|
|
12
|
+
// quickstart used to emit `client.Moon().list()` for an entity at
|
|
13
|
+
// `/planet/{planet_id}/moon`, which 404s against a live server from a
|
|
14
|
+
// half-built URL — indistinguishable from "no such record". The model
|
|
15
|
+
// already marks those params `reqd: true`; matchArg renders exactly them.
|
|
16
|
+
function listMatchArg(ent: any): string {
|
|
17
|
+
const idF = entityIdField(ent)
|
|
18
|
+
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
11
22
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
12
23
|
const { target, ctx$: { model } } = props
|
|
13
24
|
|
|
@@ -78,7 +89,7 @@ error — iterate it directly.
|
|
|
78
89
|
|
|
79
90
|
\`\`\`python
|
|
80
91
|
try:
|
|
81
|
-
${eVar}s = client.${eName}().list()
|
|
92
|
+
${eVar}s = client.${eName}().list(${listMatchArg(exampleEntity)})
|
|
82
93
|
for ${eVar} in ${eVar}s:
|
|
83
94
|
print(${eVar})
|
|
84
95
|
except Exception as err:
|
|
@@ -111,7 +122,7 @@ except Exception as err:
|
|
|
111
122
|
Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
|
|
112
123
|
|
|
113
124
|
${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
114
|
-
\`load()\` returns the
|
|
125
|
+
\`load()\` returns the ENTITY — call data_get() for the record — and raises on error.
|
|
115
126
|
|
|
116
127
|
\`\`\`python
|
|
117
128
|
try:
|
|
@@ -139,7 +150,7 @@ except Exception as err:
|
|
|
139
150
|
|
|
140
151
|
Content(`### 3. Load ${article} ${eName.toLowerCase()}
|
|
141
152
|
|
|
142
|
-
\`load()\` returns the
|
|
153
|
+
\`load()\` returns the ENTITY — call data_get() for the record — and raises on error.
|
|
143
154
|
|
|
144
155
|
\`\`\`python
|
|
145
156
|
try:
|
|
@@ -180,7 +191,7 @@ except Exception as err:
|
|
|
180
191
|
return it && it.type
|
|
181
192
|
}
|
|
182
193
|
const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
|
|
183
|
-
? `created["${dataIdF}"]`
|
|
194
|
+
? `created.data_get()["${dataIdF}"]`
|
|
184
195
|
: pyLit(idParamType(opname), 'example_id')
|
|
185
196
|
|
|
186
197
|
if (opnames.includes('create') || opnames.includes('update') || opnames.includes('remove')) {
|
|
@@ -189,7 +200,7 @@ except Exception as err:
|
|
|
189
200
|
\`\`\`python
|
|
190
201
|
`)
|
|
191
202
|
if (opnames.includes('create')) {
|
|
192
|
-
Content(`# Create — returns the
|
|
203
|
+
Content(`# Create — returns the ENTITY (call data_get() for the record)
|
|
193
204
|
created = client.${eName}().create({${examplePairs('create').join(', ')}})
|
|
194
205
|
|
|
195
206
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -20,6 +20,17 @@ function pyLit(type: any, placeholder: string = 'example'): string {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
// A `list()` on a NESTED entity needs its parent path params. The
|
|
24
|
+
// quickstart used to emit `client.Moon().list()` for an entity at
|
|
25
|
+
// `/planet/{planet_id}/moon`, which 404s against a live server from a
|
|
26
|
+
// half-built URL — indistinguishable from "no such record". The model
|
|
27
|
+
// already marks those params `reqd: true`; matchArg renders exactly them.
|
|
28
|
+
function listMatchArg(ent: any): string {
|
|
29
|
+
const idF = entityIdField(ent)
|
|
30
|
+
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
23
34
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
24
35
|
load: {
|
|
25
36
|
sig: 'load(reqmatch, ctrl=None) -> dict',
|
|
@@ -253,7 +264,7 @@ ${info.desc}
|
|
|
253
264
|
|
|
254
265
|
`)
|
|
255
266
|
|
|
256
|
-
// Show example. Entity ops return the
|
|
267
|
+
// Show example. Entity ops return the ENTITY and raise on
|
|
257
268
|
// error; direct() is the only method that returns a result dict.
|
|
258
269
|
if ('load' === opname || 'remove' === opname) {
|
|
259
270
|
// The id key plus every REQUIRED match key (parent path params
|
|
@@ -276,7 +287,7 @@ result = client.${ent.Name}().${opname}(${arg})
|
|
|
276
287
|
}
|
|
277
288
|
else if ('list' === opname) {
|
|
278
289
|
Content(`\`\`\`python
|
|
279
|
-
results = client.${ent.Name}().list()
|
|
290
|
+
results = client.${ent.Name}().list(${listMatchArg(ent)})
|
|
280
291
|
for ${eVar} in results:
|
|
281
292
|
print(${eVar})
|
|
282
293
|
\`\`\`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -22,6 +22,17 @@ function pyLit(type: any, placeholder: string = 'example'): string {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
// A `list()` on a NESTED entity needs its parent path params. The
|
|
26
|
+
// quickstart used to emit `client.Moon().list()` for an entity at
|
|
27
|
+
// `/planet/{planet_id}/moon`, which 404s against a live server from a
|
|
28
|
+
// half-built URL — indistinguishable from "no such record". The model
|
|
29
|
+
// already marks those params `reqd: true`; matchArg renders exactly them.
|
|
30
|
+
function listMatchArg(ent: any): string {
|
|
31
|
+
const idF = entityIdField(ent)
|
|
32
|
+
return matchArg('py', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
25
36
|
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
26
37
|
const { target, ctx$: { model } } = props
|
|
27
38
|
|
|
@@ -56,7 +67,7 @@ client = ${ctor}
|
|
|
56
67
|
|
|
57
68
|
if (opnames.includes('list')) {
|
|
58
69
|
Content(`# List all ${eName.toLowerCase()}s (returns a list, raises on error)
|
|
59
|
-
${eVar}s = client.${eName}().list()
|
|
70
|
+
${eVar}s = client.${eName}().list(${listMatchArg(exampleEntity)})
|
|
60
71
|
for ${eVar} in ${eVar}s:
|
|
61
72
|
print(${eVar})
|
|
62
73
|
`)
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
File,
|
|
12
12
|
cmp,
|
|
13
13
|
snakify,
|
|
14
|
-
isAuthActive,
|
|
14
|
+
isAuthActive, envName, envToken
|
|
15
15
|
} from '@voxgig/sdkgen'
|
|
16
16
|
|
|
17
17
|
|
|
@@ -60,7 +60,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
60
60
|
const target = props.target
|
|
61
61
|
const entity: ModelEntity = props.entity
|
|
62
62
|
|
|
63
|
-
const PROJECTNAME =
|
|
63
|
+
const PROJECTNAME = envName(model)
|
|
64
64
|
|
|
65
65
|
const authActive = isAuthActive(model)
|
|
66
66
|
const apikeyEnvEntry = authActive
|
|
@@ -128,7 +128,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
128
128
|
? loadParams.map((p: any) => ` params["${p.name}"] = ${JSON.stringify(p.example)}`).join('\n')
|
|
129
129
|
: ''
|
|
130
130
|
|
|
131
|
-
const entidEnvVar = `${PROJECTNAME}_TEST_${
|
|
131
|
+
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
132
132
|
|
|
133
133
|
File({ name: 'test_' + entity.name + '_direct.' + target.ext }, () => {
|
|
134
134
|
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
buildIdNames,
|
|
25
25
|
getMatchEntries,
|
|
26
26
|
isAuthActive,
|
|
27
|
-
entityDataIdField,
|
|
27
|
+
entityDataIdField, envName, envToken
|
|
28
28
|
} from '@voxgig/sdkgen'
|
|
29
29
|
|
|
30
30
|
|
|
@@ -56,7 +56,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
56
56
|
return
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const PROJUPPER =
|
|
59
|
+
const PROJUPPER = envName(model)
|
|
60
60
|
|
|
61
61
|
const authActive = isAuthActive(model)
|
|
62
62
|
const apikeyEnvEntry = authActive
|
|
@@ -158,7 +158,7 @@ ${hasList ? `
|
|
|
158
158
|
# without an *_ENTID env override, those IDs hit the live API and 4xx.
|
|
159
159
|
if setup.get("synthetic_only"):
|
|
160
160
|
pytest.skip("live entity test uses synthetic IDs from fixture — "
|
|
161
|
-
"set ${PROJUPPER}_TEST_${entity.name
|
|
161
|
+
"set ${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID JSON to run live")
|
|
162
162
|
client = setup["client"]
|
|
163
163
|
|
|
164
164
|
`)
|
|
@@ -229,17 +229,17 @@ def _${entity.name}_basic_setup(extra):
|
|
|
229
229
|
# mode is on without a real override, the basic test runs against synthetic
|
|
230
230
|
# IDs from the fixture and 4xx's. We surface this so the test can skip.
|
|
231
231
|
_entid_env_raw = os.environ.get(
|
|
232
|
-
"${PROJUPPER}_TEST_${entity.name
|
|
232
|
+
"${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID")
|
|
233
233
|
_idmap_overridden = _entid_env_raw is not None and _entid_env_raw.strip().startswith("{")
|
|
234
234
|
|
|
235
235
|
env = runner.env_override({
|
|
236
|
-
"${PROJUPPER}_TEST_${entity.name
|
|
236
|
+
"${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID": idmap,
|
|
237
237
|
"${PROJUPPER}_TEST_LIVE": "FALSE",
|
|
238
238
|
"${PROJUPPER}_TEST_EXPLAIN": "FALSE",${apikeyEnvEntry}
|
|
239
239
|
})
|
|
240
240
|
|
|
241
241
|
idmap_resolved = helpers.to_map(
|
|
242
|
-
env.get("${PROJUPPER}_TEST_${entity.name
|
|
242
|
+
env.get("${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID"))
|
|
243
243
|
if idmap_resolved is None:
|
|
244
244
|
idmap_resolved = helpers.to_map(idmap)
|
|
245
245
|
`)
|
|
@@ -321,7 +321,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
321
321
|
const hasEntIdC = null != ctx.entity.id
|
|
322
322
|
|
|
323
323
|
Content(`
|
|
324
|
-
${datavar} = helpers.to_map(${entvar}.create(${datavar}, None))
|
|
324
|
+
${datavar} = helpers.to_map(runner.entity_data(${entvar}.create(${datavar}, None)))
|
|
325
325
|
assert ${datavar} is not None
|
|
326
326
|
`)
|
|
327
327
|
if (hasEntIdC) {
|
|
@@ -454,7 +454,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
Content(`
|
|
457
|
-
${resdatavar} = helpers.to_map(${entvar}.update(${datavar}_up, None))
|
|
457
|
+
${resdatavar} = helpers.to_map(runner.entity_data(${entvar}.update(${datavar}_up, None)))
|
|
458
458
|
assert ${resdatavar} is not None
|
|
459
459
|
`)
|
|
460
460
|
if (hasEntIdU) {
|
|
@@ -518,7 +518,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
518
518
|
"id": ${srcdatavar}["id"],
|
|
519
519
|
}
|
|
520
520
|
${datavar}_loaded = ${entvar}.load(${matchvar}, None)
|
|
521
|
-
${datavar}_load_result = helpers.to_map(${datavar}_loaded)
|
|
521
|
+
${datavar}_load_result = helpers.to_map(runner.entity_data(${datavar}_loaded))
|
|
522
522
|
assert ${datavar}_load_result is not None
|
|
523
523
|
assert ${datavar}_load_result["id"] == ${srcdatavar}["id"]
|
|
524
524
|
`)
|
|
@@ -24,6 +24,7 @@ class EntyClass:
|
|
|
24
24
|
self._utility = client.get_utility()
|
|
25
25
|
self._entopts = entopts
|
|
26
26
|
self._data = {}
|
|
27
|
+
self._deleted = False
|
|
27
28
|
self._match = {}
|
|
28
29
|
|
|
29
30
|
self._entctx = self._utility.make_context({
|
|
@@ -36,6 +37,16 @@ class EntyClass:
|
|
|
36
37
|
def get_name(self):
|
|
37
38
|
return self._name
|
|
38
39
|
|
|
40
|
+
# Every operation resolves to the entity; `remove` additionally marks
|
|
41
|
+
# it. The instance KEEPS the data it held — a caller can still read what
|
|
42
|
+
# was deleted — but it is no longer a live record. See AGENTS.md.
|
|
43
|
+
def mark_deleted(self):
|
|
44
|
+
self._deleted = True
|
|
45
|
+
|
|
46
|
+
def deleted(self):
|
|
47
|
+
return True is self._deleted
|
|
48
|
+
|
|
49
|
+
|
|
39
50
|
def make(self):
|
|
40
51
|
opts = {}
|
|
41
52
|
for k, v in self._entopts.items():
|
|
@@ -214,7 +225,24 @@ class EntyClass:
|
|
|
214
225
|
|
|
215
226
|
post_done()
|
|
216
227
|
|
|
217
|
-
|
|
228
|
+
out = utility.done(ctx)
|
|
229
|
+
|
|
230
|
+
# An operation resolves to the ENTITY, not the raw data. Entities are
|
|
231
|
+
# stateful: post_done has just absorbed resdata/resmatch into this
|
|
232
|
+
# instance, and the caller reaches the record through data(). Two
|
|
233
|
+
# structural exceptions: `list` resolves to the ARRAY of entity
|
|
234
|
+
# instances make_result built, and a failed op with throwing disabled
|
|
235
|
+
# hands back the error payload unchanged. `remove` additionally marks
|
|
236
|
+
# the entity deleted; it KEEPS its data, so a caller can still read
|
|
237
|
+
# what was removed. See AGENTS.md "Entity operations return ENTITIES".
|
|
238
|
+
opname = None if ctx.op is None else ctx.op.name
|
|
239
|
+
|
|
240
|
+
if ctx.result is not None and ctx.result.ok and opname != "list":
|
|
241
|
+
if opname == "remove":
|
|
242
|
+
self.mark_deleted()
|
|
243
|
+
return self
|
|
244
|
+
|
|
245
|
+
return out
|
|
218
246
|
|
|
219
247
|
except Exception:
|
|
220
248
|
# #PreUnexpected-Hook
|
|
@@ -7,8 +7,19 @@ class ProjectNameError(Exception):
|
|
|
7
7
|
self.code = code
|
|
8
8
|
self.msg = msg
|
|
9
9
|
self.sdk = "ProjectName"
|
|
10
|
+
|
|
11
|
+
# HTTP status of the response that caused this error, or -1 when the
|
|
12
|
+
# request never got one. PROMOTED to the top level: it used to be
|
|
13
|
+
# reachable only at `err.result.status`, so every consumer coupled
|
|
14
|
+
# itself to the internal shape of `result`.
|
|
15
|
+
self.status = -1
|
|
16
|
+
|
|
10
17
|
super().__init__(self.error())
|
|
11
18
|
|
|
19
|
+
@property
|
|
20
|
+
def not_found(self):
|
|
21
|
+
return 404 == self.status
|
|
22
|
+
|
|
12
23
|
def error(self):
|
|
13
24
|
return self.sdk + ": " + self.code + ": " + self.msg
|
|
14
25
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
collectDeps, pkgDescription, keywords, repoInfo, envName, apiName,
|
|
7
7
|
packageName, registryState, serverVariables,
|
|
8
8
|
SdkGenError,
|
|
9
|
+
packageVersion,
|
|
9
10
|
} from '@voxgig/sdkgen'
|
|
10
11
|
|
|
11
12
|
import {
|
|
@@ -147,7 +148,7 @@ build-backend = "setuptools.build_meta"
|
|
|
147
148
|
|
|
148
149
|
[project]
|
|
149
150
|
name = "${distName}"
|
|
150
|
-
version = "
|
|
151
|
+
version = "${packageVersion(model, target.name)}"
|
|
151
152
|
description = "${pkgDescription(model, 'py-data')}"
|
|
152
153
|
readme = "README.md"
|
|
153
154
|
license = "MIT"
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
cmp,
|
|
6
6
|
collectDeps,
|
|
7
7
|
pkgDescription,
|
|
8
|
-
repoInfo,
|
|
8
|
+
repoInfo, packageName,
|
|
9
|
+
packageVersion
|
|
9
10
|
} from '@voxgig/sdkgen'
|
|
10
11
|
|
|
11
12
|
|
|
@@ -25,7 +26,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
25
26
|
// path (`${model.name}_sdk`) is unchanged.
|
|
26
27
|
const ns = model.origin || 'voxgig-sdk'
|
|
27
28
|
const pkgBase = ns.endsWith('-sdk') ? model.name : `${model.name}-sdk`
|
|
28
|
-
const gemName =
|
|
29
|
+
const gemName = packageName(model, 'rb')
|
|
29
30
|
const { repoUrl, issuesUrl, changelogUrl } = repoInfo(model)
|
|
30
31
|
|
|
31
32
|
const versionOf = (d: { version: string; source: 'feature' | 'target' }) =>
|
|
@@ -56,7 +57,7 @@ gemspec
|
|
|
56
57
|
|
|
57
58
|
Content(`Gem::Specification.new do |spec|
|
|
58
59
|
spec.name = "${gemName}"
|
|
59
|
-
spec.version = "
|
|
60
|
+
spec.version = "${packageVersion(model, target.name)}"
|
|
60
61
|
spec.authors = ["Voxgig"]
|
|
61
62
|
spec.summary = "${pkgDescription(model, 'rb')}"
|
|
62
63
|
spec.description = "${pkgDescription(model, 'rb')}"
|
|
@@ -126,7 +126,7 @@ const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
|
126
126
|
Content(`#### Example: Load
|
|
127
127
|
|
|
128
128
|
\`\`\`ruby
|
|
129
|
-
# load returns the
|
|
129
|
+
# load returns the ENTITY — call data_get for the ${entity.Name} record (raises on error).
|
|
130
130
|
${eVar} = client.${entity.Name}.load(${loadArg})
|
|
131
131
|
\`\`\`
|
|
132
132
|
|
|
@@ -65,7 +65,8 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
65
65
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
66
66
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
67
67
|
const testModeExample = primaryOp
|
|
68
|
-
? `# Entity ops return the
|
|
68
|
+
? `# Entity ops return the ENTITY (raises on error);
|
|
69
|
+
// call data_get for the mock record.
|
|
69
70
|
${eVar} = client.${eName}.${primaryOp}(${testCallArg})
|
|
70
71
|
puts ${eVar}`
|
|
71
72
|
: `result = client.direct({ "path" => "/api/resource", "method" => "GET" })
|
|
@@ -125,7 +125,7 @@ ${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
|
125
125
|
|
|
126
126
|
\`\`\`ruby
|
|
127
127
|
begin
|
|
128
|
-
# load returns the
|
|
128
|
+
# load returns the ENTITY — call data_get for the ${neName} record (raises on error).
|
|
129
129
|
${neVar} = client.${neName}.load({ ${neMatch.join(', ')} })
|
|
130
130
|
puts ${neVar}
|
|
131
131
|
rescue => err
|
|
@@ -153,7 +153,7 @@ end
|
|
|
153
153
|
|
|
154
154
|
\`\`\`ruby
|
|
155
155
|
begin
|
|
156
|
-
# load returns the
|
|
156
|
+
# load returns the ENTITY — call data_get for the ${eName} record (raises on error).
|
|
157
157
|
${eVar} = client.${eName}.load(${loadArg})
|
|
158
158
|
puts ${eVar}
|
|
159
159
|
rescue => err
|
|
@@ -193,7 +193,7 @@ end
|
|
|
193
193
|
return it && it.type
|
|
194
194
|
}
|
|
195
195
|
const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
|
|
196
|
-
? `created["${dataIdF}"]`
|
|
196
|
+
? `created.data_get["${dataIdF}"]`
|
|
197
197
|
: rbLit(idParamType(opname), 'example_id')
|
|
198
198
|
|
|
199
199
|
if (opnames.includes('create') || opnames.includes('update') || opnames.includes('remove')) {
|
|
@@ -202,7 +202,7 @@ end
|
|
|
202
202
|
\`\`\`ruby
|
|
203
203
|
`)
|
|
204
204
|
if (opnames.includes('create')) {
|
|
205
|
-
Content(`# create returns the
|
|
205
|
+
Content(`# create returns the ENTITY — call data_get for the created ${eName} record.
|
|
206
206
|
created = client.${eName}.create({ ${examplePairs('create').join(', ')} })
|
|
207
207
|
|
|
208
208
|
`)
|
|
@@ -210,7 +210,7 @@ created = client.${eName}.create({ ${examplePairs('create').join(', ')} })
|
|
|
210
210
|
if (opnames.includes('update')) {
|
|
211
211
|
const updatePairs = (idF ? [`"${idF}" => ${idValueFor('update')}`] : []).concat(examplePairs('update'))
|
|
212
212
|
const fromCreated = null != dataIdF && opnames.includes('create')
|
|
213
|
-
Content(`# Update${fromCreated ? ` — index the
|
|
213
|
+
Content(`# Update${fromCreated ? ` — index the record via data_get (created.data_get["${dataIdF}"]).` : ''}
|
|
214
214
|
client.${eName}.update({ ${updatePairs.join(', ')} })
|
|
215
215
|
|
|
216
216
|
`)
|
|
@@ -75,7 +75,7 @@ puts ${eVar}s
|
|
|
75
75
|
it.name === idF ? 'example_id' : 'example_' + it.name)}`).join(', ')} }`
|
|
76
76
|
: ''
|
|
77
77
|
Content(`
|
|
78
|
-
# Load a specific ${eName.toLowerCase()} (returns the
|
|
78
|
+
# Load a specific ${eName.toLowerCase()} (returns the ENTITY; call data_get for the record)
|
|
79
79
|
${eVar} = client.${eName}.load(${loadArg})
|
|
80
80
|
puts ${eVar}
|
|
81
81
|
`)
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
File,
|
|
12
12
|
cmp,
|
|
13
13
|
snakify,
|
|
14
|
-
isAuthActive,
|
|
14
|
+
isAuthActive, envName, envToken
|
|
15
15
|
} from '@voxgig/sdkgen'
|
|
16
16
|
|
|
17
17
|
|
|
@@ -60,7 +60,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
60
60
|
const target = props.target
|
|
61
61
|
const entity: ModelEntity = props.entity
|
|
62
62
|
|
|
63
|
-
const PROJECTNAME =
|
|
63
|
+
const PROJECTNAME = envName(model)
|
|
64
64
|
|
|
65
65
|
const authActive = isAuthActive(model)
|
|
66
66
|
const apikeyEnvEntry = authActive
|
|
@@ -125,7 +125,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
125
125
|
? loadParams.map((p: any) => ` params["${p.name}"] = ${JSON.stringify(p.example)}`).join('\n')
|
|
126
126
|
: ''
|
|
127
127
|
|
|
128
|
-
const entidEnvVar = `${PROJECTNAME}_TEST_${
|
|
128
|
+
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
129
129
|
|
|
130
130
|
File({ name: entity.name + '_direct_test.' + target.ext }, () => {
|
|
131
131
|
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
buildIdNames,
|
|
25
25
|
getMatchEntries,
|
|
26
26
|
isAuthActive,
|
|
27
|
-
entityDataIdField,
|
|
27
|
+
entityDataIdField, envName, envToken
|
|
28
28
|
} from '@voxgig/sdkgen'
|
|
29
29
|
|
|
30
30
|
|
|
@@ -58,7 +58,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
58
58
|
return
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
const PROJUPPER =
|
|
61
|
+
const PROJUPPER = envName(model)
|
|
62
62
|
|
|
63
63
|
const authActive = isAuthActive(model)
|
|
64
64
|
const apikeyEnvEntry = authActive
|
|
@@ -146,7 +146,7 @@ ${hasList ? `
|
|
|
146
146
|
# The basic flow consumes synthetic IDs from the fixture. In live mode
|
|
147
147
|
# without an *_ENTID env override, those IDs hit the live API and 4xx.
|
|
148
148
|
if setup[:synthetic_only]
|
|
149
|
-
skip "live entity test uses synthetic IDs from fixture — set ${PROJUPPER}_TEST_${entity.name
|
|
149
|
+
skip "live entity test uses synthetic IDs from fixture — set ${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID JSON to run live"
|
|
150
150
|
return
|
|
151
151
|
end
|
|
152
152
|
client = setup[:client]
|
|
@@ -221,17 +221,17 @@ end
|
|
|
221
221
|
Content(` # Detect ENTID env override before envOverride consumes it. When live
|
|
222
222
|
# mode is on without a real override, the basic test runs against synthetic
|
|
223
223
|
# IDs from the fixture and 4xx's. Surface this so the test can skip.
|
|
224
|
-
entid_env_raw = ENV["${PROJUPPER}_TEST_${entity.name
|
|
224
|
+
entid_env_raw = ENV["${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID"]
|
|
225
225
|
idmap_overridden = !entid_env_raw.nil? && entid_env_raw.strip.start_with?("{")
|
|
226
226
|
|
|
227
227
|
env = Runner.env_override({
|
|
228
|
-
"${PROJUPPER}_TEST_${entity.name
|
|
228
|
+
"${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID" => idmap,
|
|
229
229
|
"${PROJUPPER}_TEST_LIVE" => "FALSE",
|
|
230
230
|
"${PROJUPPER}_TEST_EXPLAIN" => "FALSE",${apikeyEnvEntry}
|
|
231
231
|
})
|
|
232
232
|
|
|
233
233
|
idmap_resolved = Helpers.to_map(
|
|
234
|
-
env["${PROJUPPER}_TEST_${entity.name
|
|
234
|
+
env["${PROJUPPER}_TEST_${envToken(entity.name)}_ENTID"])
|
|
235
235
|
if idmap_resolved.nil?
|
|
236
236
|
idmap_resolved = Helpers.to_map(idmap)
|
|
237
237
|
end
|
|
@@ -316,7 +316,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
316
316
|
|
|
317
317
|
Content(`
|
|
318
318
|
${datavar}_result = ${entvar}.create(${datavar}, nil)
|
|
319
|
-
${datavar} = Helpers.to_map(${datavar}_result)
|
|
319
|
+
${datavar} = Helpers.to_map(${datavar}_result.respond_to?(:data_get) ? ${datavar}_result.data_get : ${datavar}_result)
|
|
320
320
|
assert !${datavar}.nil?
|
|
321
321
|
`)
|
|
322
322
|
if (null != ctx.entity.id) {
|
|
@@ -450,7 +450,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
450
450
|
|
|
451
451
|
Content(`
|
|
452
452
|
${resdatavar}_result = ${entvar}.update(${datavar}_up, nil)
|
|
453
|
-
${resdatavar} = Helpers.to_map(${resdatavar}_result)
|
|
453
|
+
${resdatavar} = Helpers.to_map(${resdatavar}_result.respond_to?(:data_get) ? ${resdatavar}_result.data_get : ${resdatavar}_result)
|
|
454
454
|
assert !${resdatavar}.nil?
|
|
455
455
|
`)
|
|
456
456
|
if (hasEntIdU) {
|
|
@@ -515,7 +515,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
515
515
|
"id" => ${srcdatavar}["id"],
|
|
516
516
|
}
|
|
517
517
|
${datavar}_loaded = ${entvar}.load(${matchvar}, nil)
|
|
518
|
-
${datavar}_load_result = Helpers.to_map(${datavar}_loaded)
|
|
518
|
+
${datavar}_load_result = Helpers.to_map(${datavar}_loaded.respond_to?(:data_get) ? ${datavar}_loaded.data_get : ${datavar}_loaded)
|
|
519
519
|
assert !${datavar}_load_result.nil?
|
|
520
520
|
assert_equal ${datavar}_load_result["id"], ${srcdatavar}["id"]
|
|
521
521
|
`)
|
|
@@ -19,6 +19,7 @@ class EntyClass
|
|
|
19
19
|
@_utility = client.get_utility
|
|
20
20
|
@_entopts = entopts
|
|
21
21
|
@_data = {}
|
|
22
|
+
@_deleted = false
|
|
22
23
|
@_match = {}
|
|
23
24
|
|
|
24
25
|
@_entctx = @_utility.make_context.call({
|
|
@@ -33,6 +34,18 @@ class EntyClass
|
|
|
33
34
|
@_name
|
|
34
35
|
end
|
|
35
36
|
|
|
37
|
+
# Every operation resolves to the entity; `remove` additionally marks
|
|
38
|
+
# it. The instance KEEPS the data it held — a caller can still read what
|
|
39
|
+
# was deleted — but it is no longer a live record. See AGENTS.md.
|
|
40
|
+
def mark_deleted
|
|
41
|
+
@_deleted = true
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def deleted
|
|
45
|
+
true == @_deleted
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
|
|
36
49
|
def make
|
|
37
50
|
opts = @_entopts.dup
|
|
38
51
|
EntyClass.new(@_client, opts)
|
|
@@ -207,7 +220,24 @@ class EntyClass
|
|
|
207
220
|
|
|
208
221
|
post_done.call
|
|
209
222
|
|
|
210
|
-
utility.done.call(ctx)
|
|
223
|
+
out = utility.done.call(ctx)
|
|
224
|
+
|
|
225
|
+
# An operation resolves to the ENTITY, not the raw data. Entities are
|
|
226
|
+
# stateful: post_done has just absorbed resdata/resmatch into this
|
|
227
|
+
# instance, and the caller reaches the record through data(). Two
|
|
228
|
+
# structural exceptions: `list` resolves to the ARRAY of entity
|
|
229
|
+
# instances make_result built, and a failed op with throwing disabled
|
|
230
|
+
# hands back the error payload unchanged. `remove` additionally marks
|
|
231
|
+
# the entity deleted; it KEEPS its data, so a caller can still read
|
|
232
|
+
# what was removed. See AGENTS.md "Entity operations return ENTITIES".
|
|
233
|
+
opname = ctx.op&.name
|
|
234
|
+
|
|
235
|
+
if ctx.result && ctx.result.ok && opname != "list"
|
|
236
|
+
mark_deleted if opname == "remove"
|
|
237
|
+
return self
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
out
|
|
211
241
|
rescue StandardError => operr
|
|
212
242
|
# #PreUnexpected-Hook
|
|
213
243
|
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
# ProjectName SDK error
|
|
2
2
|
|
|
3
3
|
class ProjectNameError < StandardError
|
|
4
|
-
|
|
4
|
+
# `status` is the HTTP status of the response that caused this error, or
|
|
5
|
+
# -1 when the request never got one. PROMOTED to the top level: it used to
|
|
6
|
+
# be reachable only at `err.result.status`, so every consumer coupled
|
|
7
|
+
# itself to the internal shape of `result`.
|
|
8
|
+
attr_accessor :code, :msg, :sdk, :status
|
|
5
9
|
|
|
6
10
|
def initialize(code = "", msg = "")
|
|
7
11
|
super(msg)
|
|
8
12
|
@code = code
|
|
9
13
|
@msg = msg
|
|
10
14
|
@sdk = "ProjectName"
|
|
15
|
+
@status = -1
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def not_found?
|
|
19
|
+
404 == @status
|
|
11
20
|
end
|
|
12
21
|
|
|
13
22
|
def error
|
|
@@ -53,7 +53,11 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
53
53
|
({ indent }: any) => {
|
|
54
54
|
const arg = ('create' === opname || 'update' === opname) ?
|
|
55
55
|
'reqdata' : 'reqmatch'
|
|
56
|
-
|
|
56
|
+
// The stub mirrors the real signature: ops resolve to the
|
|
57
|
+
// ENTITY (`list` to a vector of them), so an unsupported op
|
|
58
|
+
// has to declare the same return type to satisfy the trait.
|
|
59
|
+
const ret = 'list' === opname ? 'Vec<Rc<Self>>' : 'Rc<Self>'
|
|
60
|
+
Content({ indent }, `fn ${opname}(self: &Rc<Self>, _${arg}: Value, _ctrl: Value) -> Result<${ret}, ${model.const.Name}Error> {
|
|
57
61
|
Err(crate::core::helpers::unsupported_op("${opname}", &self.name))
|
|
58
62
|
}
|
|
59
63
|
`)
|
|
@@ -35,6 +35,7 @@ const Main = cmp(async function Main(props: any) {
|
|
|
35
35
|
const { model } = props.ctx$
|
|
36
36
|
|
|
37
37
|
const entity: ModelEntity = getModelPath(model, `main.${KIT}.entity`)
|
|
38
|
+
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
38
39
|
|
|
39
40
|
// The rust crate identifier (RUSTCRATE placeholder), e.g. solar_sdk —
|
|
40
41
|
// used in every `use <crate>::...` path in the test templates.
|
|
@@ -85,6 +86,26 @@ const Main = cmp(async function Main(props: any) {
|
|
|
85
86
|
SdkError({ target })
|
|
86
87
|
})
|
|
87
88
|
|
|
89
|
+
// feature/mod.rs — the feature module index.
|
|
90
|
+
//
|
|
91
|
+
// GENERATED, not templated: rust needs every module declared, and
|
|
92
|
+
// `target add` only copies source for the features the model selects. A
|
|
93
|
+
// static index listing all eighteen shipped features stops the crate from
|
|
94
|
+
// compiling the moment the set is trimmed.
|
|
95
|
+
Folder({ name: 'feature' }, () => {
|
|
96
|
+
File({ name: 'mod.' + target.ext }, () => {
|
|
97
|
+
Content(`// ${model.const.Name} SDK feature modules (mirrors tm/go/feature).
|
|
98
|
+
// Each feature is a Feature trait object registered on the client;
|
|
99
|
+
// \`support\` carries the shared option readers (go feature_options.go).
|
|
100
|
+
|
|
101
|
+
pub mod support;
|
|
102
|
+
|
|
103
|
+
pub mod base;
|
|
104
|
+
`)
|
|
105
|
+
each(feature, (feat: any) => Content(`pub mod ${feat.name};\n`))
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
88
109
|
// entity/mod.rs — the entity module index.
|
|
89
110
|
EntityBase({ target })
|
|
90
111
|
|