@voxgig/sdkgen 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +8 -5
- 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 +24 -11
- 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/Config_dart.ts +6 -0
- 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/ReadmeTopQuick_elixir.ts +7 -4
- 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/lean/Test_lean.ts +75 -21
- 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/Test_py.ts +4 -1
- 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/graphql.c +1 -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/core/Utility.kt +2 -0
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
- package/project/.sdk/tm/lean/Makefile +25 -0
- package/project/.sdk/tm/lean/VERSION +1 -1
- package/project/.sdk/tm/lean/src/SdkUtility.lean +11 -9
- package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +5 -2
- 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
|
@@ -231,13 +231,13 @@ def prepareQuery (ctx : Value) : SIO Value := do
|
|
|
231
231
|
if !(isNov v) && !(names.contains k) then sp out k v
|
|
232
232
|
pure out
|
|
233
233
|
|
|
234
|
+
/-- Assemble the path template from `point.parts`. This is `struct.join` with
|
|
235
|
+
the url flag — NOT a plain intercalate: empty segments are dropped (a doubled
|
|
236
|
+
slash changes the URL and 404s on strict routers) and there is no leading
|
|
237
|
+
slash, because makeUrl joins base/prefix/path/suffix with `joinurl`. -/
|
|
234
238
|
def preparePath (ctx : Value) : SIO String := do
|
|
235
239
|
let point ← gp ctx "point"
|
|
236
|
-
|
|
237
|
-
| .list i => do
|
|
238
|
-
let segs := (← listItems i).map vs
|
|
239
|
-
pure ("/" ++ String.intercalate "/" segs.toList)
|
|
240
|
-
| _ => pure ""
|
|
240
|
+
join (← gp point "parts") (sep := .str "/") (url := true)
|
|
241
241
|
|
|
242
242
|
/-- The API definition is authoritative: a POST-only or PATCH-based API
|
|
243
243
|
exposes `update` as POST or PATCH, not the PUT the op name implies. Only
|
|
@@ -396,9 +396,11 @@ def graphqlBody (ctx : Value) : SIO Value := do
|
|
|
396
396
|
match spec with
|
|
397
397
|
| .map _ => do
|
|
398
398
|
let name ← gpS spec "name"
|
|
399
|
-
|
|
399
|
+
-- `from` is a Lean keyword, so the binding cannot take the field's
|
|
400
|
+
-- own name.
|
|
401
|
+
let varFrom ← gpS spec "from"
|
|
400
402
|
if name != "" then
|
|
401
|
-
if
|
|
403
|
+
if varFrom == "" then do
|
|
402
404
|
-- The input object IS the request body. Strip the action
|
|
403
405
|
-- selector, which is an SDK-side point discriminator, not an API
|
|
404
406
|
-- field.
|
|
@@ -409,8 +411,8 @@ def graphqlBody (ctx : Value) : SIO Value := do
|
|
|
409
411
|
else do
|
|
410
412
|
-- Only send variables the caller actually supplied: sending an
|
|
411
413
|
-- explicit null would clear a field on many APIs.
|
|
412
|
-
let v0 ← gp reqsrc
|
|
413
|
-
let v ← if isNullish v0 then gp datasrc
|
|
414
|
+
let v0 ← gp reqsrc varFrom
|
|
415
|
+
let v ← if isNullish v0 then gp datasrc varFrom else pure v0
|
|
414
416
|
if !(isNullish v) then sp variables name v
|
|
415
417
|
| _ => pure ()
|
|
416
418
|
newMap #[("query", ← gp gql "doc"), ("variables", variables)]
|
|
@@ -56,30 +56,42 @@ def onOpts (extra : Array (String × Value)) : SIO Value := do
|
|
|
56
56
|
def bucketOf (client : Value) (name : String) : SIO Value := do
|
|
57
57
|
gp (← gp client "track") name
|
|
58
58
|
|
|
59
|
+
/-- Does the entity declare this op? -/
|
|
60
|
+
def hasOp (e : Value) (opname : String) : SIO Bool := do
|
|
61
|
+
match (← gp (← gp e "op") opname) with
|
|
62
|
+
| .map _ => pure true
|
|
63
|
+
| _ => pure false
|
|
64
|
+
|
|
59
65
|
/-- The first entity that has a `list` op AND generated seed data: the feature
|
|
60
|
-
suite is entity-agnostic, so it discovers its subject from the config.
|
|
61
|
-
|
|
66
|
+
suite is entity-agnostic, so it discovers its subject from the config.
|
|
67
|
+
Returns whether the subject also has `create` — the idempotency check is
|
|
68
|
+
the one case that mutates, and a list-only entity (an API with a read-only
|
|
69
|
+
collection) has no create ENDPOINT, so calling it raises rather than
|
|
70
|
+
exercising the feature. Entities carrying both are preferred, so a model
|
|
71
|
+
that has one keeps the mutating coverage. -/
|
|
72
|
+
def findSubject : SIO (Option (String × Value × Bool)) := do
|
|
62
73
|
let config ← SdkJson.jsonRead SdkConfig.configJson
|
|
63
74
|
let ents ← gp config "entity"
|
|
75
|
+
let mut fallback : Option (String × Value × Bool) := none
|
|
64
76
|
for name in (← keysof ents) do
|
|
65
77
|
let e ← gp ents name
|
|
66
|
-
|
|
67
|
-
| .map _ => pure true
|
|
68
|
-
| _ => pure false)
|
|
69
|
-
if hasList then
|
|
78
|
+
if ← hasOp e "list" then
|
|
70
79
|
let Name := name.capitalize
|
|
71
80
|
let seedPath := "../.sdk/test/entity/" ++ name ++ "/" ++ Name ++ "TestData.json"
|
|
72
81
|
if ← System.FilePath.pathExists seedPath then
|
|
73
82
|
let seed ← SdkJson.jsonRead (← IO.FS.readFile seedPath)
|
|
74
|
-
|
|
75
|
-
|
|
83
|
+
if ← hasOp e "create" then
|
|
84
|
+
return some (name, seed, true)
|
|
85
|
+
if fallback.isNone then
|
|
86
|
+
fallback := some (name, seed, false)
|
|
87
|
+
pure fallback
|
|
76
88
|
|
|
77
89
|
def main : IO UInt32 := do
|
|
78
90
|
let sctx ← mkCtx
|
|
79
91
|
let go : SIO Unit := do
|
|
80
92
|
match (← findSubject) with
|
|
81
93
|
| none => IO.println "skip - no entity with list op and seed data"
|
|
82
|
-
| some (ent, seed) => do
|
|
94
|
+
| some (ent, seed, hasCreate) => do
|
|
83
95
|
let mt ← emptyMap
|
|
84
96
|
|
|
85
97
|
-- log: counts requests
|
|
@@ -141,11 +153,12 @@ def main : IO UInt32 := do
|
|
|
141
153
|
let _ ← SdkRuntime.opList c ent mt mt
|
|
142
154
|
let b0 ← bucketOf c "idempotency"
|
|
143
155
|
check ((← numAt b0 "issued") == 0.0) "idempotency: no key for a read op"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
if hasCreate then
|
|
157
|
+
let d ← newMap #[("name", .str "idem")]
|
|
158
|
+
let _ ← SdkRuntime.opCreate c ent d mt
|
|
159
|
+
let b ← bucketOf c "idempotency"
|
|
160
|
+
check ((← numAt b "issued") == 1.0) "idempotency: issues a key for create"
|
|
161
|
+
check ((← gpS b "last") != "") "idempotency: records the issued key")
|
|
149
162
|
|
|
150
163
|
-- clienttrack: request/session headers and a request count
|
|
151
164
|
(do
|
|
@@ -306,9 +306,12 @@ def main : IO UInt32 := do
|
|
|
306
306
|
-- The remaining corpus sections. They carry no cases in this project's
|
|
307
307
|
-- corpus, but are driven here so any future fixture runs against Lean too.
|
|
308
308
|
|
|
309
|
+
-- clean takes (ctx, val), so the fixture supplies `args`, not `in` —
|
|
310
|
+
-- same shape as param/makeError above.
|
|
309
311
|
runset "clean" (← getSpec primary #["clean", "basic"]) fun entry => do
|
|
310
|
-
let
|
|
311
|
-
|
|
312
|
+
let args ← SdkUtility.gp entry "args"
|
|
313
|
+
let ctx ← mapCtx entry (← argAt args 0) opts config
|
|
314
|
+
pure ((← SdkUtility.clean ctx (← argAt args 1)), none)
|
|
312
315
|
|
|
313
316
|
runset "makeResult" (← getSpec primary #["makeResult", "basic"]) fun entry => do
|
|
314
317
|
pure ((← SdkUtility.makeResult (← entryCtx entry opts config)), none)
|
|
@@ -35,8 +35,8 @@ end
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
function runner.env_override(m)
|
|
38
|
-
local live = runner.getenv("
|
|
39
|
-
local override = runner.getenv("
|
|
38
|
+
local live = runner.getenv("PROJECTENV_TEST_LIVE")
|
|
39
|
+
local override = runner.getenv("PROJECTENV_TEST_OVERRIDE")
|
|
40
40
|
|
|
41
41
|
if live == "TRUE" or override == "TRUE" then
|
|
42
42
|
for key, _ in pairs(m) do
|
|
@@ -56,9 +56,9 @@ function runner.env_override(m)
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
local explain = runner.getenv("
|
|
59
|
+
local explain = runner.getenv("PROJECTENV_TEST_EXPLAIN")
|
|
60
60
|
if explain ~= nil and explain ~= "" then
|
|
61
|
-
m["
|
|
61
|
+
m["PROJECTENV_TEST_EXPLAIN"] = explain
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
return m
|
|
@@ -57,6 +57,10 @@ local function make_error_util(ctx, err)
|
|
|
57
57
|
sdk_err.result = ctx.utility.clean(ctx, result)
|
|
58
58
|
sdk_err.spec = ctx.utility.clean(ctx, spec)
|
|
59
59
|
|
|
60
|
+
-- Promote the HTTP status to the top level, so a consumer can branch on
|
|
61
|
+
-- `err.status` instead of reaching into `err.result`.
|
|
62
|
+
sdk_err.status = result.status or -1
|
|
63
|
+
|
|
60
64
|
if type(err) == "table" and getmetatable(err) == ProjectNameError then
|
|
61
65
|
sdk_err.code = err.code
|
|
62
66
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PROJECTVERSION
|
|
@@ -199,11 +199,20 @@ and entity_obj = {
|
|
|
199
199
|
mutable e_data_get : unit -> value;
|
|
200
200
|
mutable e_match_set : value -> unit;
|
|
201
201
|
mutable e_match_get : unit -> value;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
mutable
|
|
202
|
+
(* Every operation resolves to the ENTITY, not the raw record - e_list to
|
|
203
|
+
* one per record. The record is reached through e_data_get. `value` is a
|
|
204
|
+
* closed data union with no slot for an entity, so the CONTRACT lives in
|
|
205
|
+
* these signatures. See AGENTS.md "Entity operations return ENTITIES". *)
|
|
206
|
+
mutable e_load : value -> value -> entity_obj;
|
|
207
|
+
mutable e_list : value -> value -> entity_obj list;
|
|
208
|
+
mutable e_create : value -> value -> entity_obj;
|
|
209
|
+
mutable e_update : value -> value -> entity_obj;
|
|
210
|
+
mutable e_remove : value -> value -> entity_obj;
|
|
211
|
+
(* e_remove resolves to the entity, marked. The instance KEEPS the data it
|
|
212
|
+
* held - a caller can still read what was deleted - but it is no longer a
|
|
213
|
+
* live record. *)
|
|
214
|
+
mutable e_deleted : bool;
|
|
215
|
+
mutable e_mark_deleted : unit -> unit;
|
|
207
216
|
(* stream action args callopts -> a lazy Seq over result items. *)
|
|
208
217
|
mutable e_stream : string -> value -> value -> value Seq.t;
|
|
209
218
|
}
|
|
@@ -37,8 +37,11 @@ let make_factory (cl : sdk_client) (made : value list ref) : entity_obj =
|
|
|
37
37
|
e_entctx = rootctx; e_make = (fun () -> child ());
|
|
38
38
|
e_data_set = (fun d -> made := !made @ [d]); e_data_get = (fun () -> empty_map ());
|
|
39
39
|
e_match_set = (fun _ -> ()); e_match_get = (fun () -> empty_map ());
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
(* Ops resolve to the ENTITY (see Sdk_types); this fake never runs them. *)
|
|
41
|
+
e_load = (fun _ _ -> failwith "unused"); e_list = (fun _ _ -> []);
|
|
42
|
+
e_create = (fun _ _ -> failwith "unused");
|
|
43
|
+
e_update = (fun _ _ -> failwith "unused"); e_remove = (fun _ _ -> failwith "unused");
|
|
44
|
+
e_deleted = false; e_mark_deleted = (fun () -> ());
|
|
42
45
|
e_stream = (fun _ _ _ -> Seq.empty);
|
|
43
46
|
} in
|
|
44
47
|
child ()
|
|
@@ -44,8 +44,8 @@ sub getenv {
|
|
|
44
44
|
|
|
45
45
|
sub env_override {
|
|
46
46
|
my ($m) = @_;
|
|
47
|
-
my $live = getenv('
|
|
48
|
-
my $override = getenv('
|
|
47
|
+
my $live = getenv('PROJECTENV_TEST_LIVE');
|
|
48
|
+
my $override = getenv('PROJECTENV_TEST_OVERRIDE');
|
|
49
49
|
|
|
50
50
|
if ((defined $live && 'TRUE' eq $live)
|
|
51
51
|
|| (defined $override && 'TRUE' eq $override)) {
|
|
@@ -65,8 +65,8 @@ sub env_override {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
my $explain = getenv('
|
|
69
|
-
$m->{'
|
|
68
|
+
my $explain = getenv('PROJECTENV_TEST_EXPLAIN');
|
|
69
|
+
$m->{'PROJECTENV_TEST_EXPLAIN'} = $explain if defined $explain && '' ne $explain;
|
|
70
70
|
|
|
71
71
|
return $m;
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PROJECTVERSION
|
|
@@ -43,8 +43,8 @@ class ProjectNameTestRunner
|
|
|
43
43
|
|
|
44
44
|
public static function env_override(array $m): array
|
|
45
45
|
{
|
|
46
|
-
$live = self::getenv('
|
|
47
|
-
$override = self::getenv('
|
|
46
|
+
$live = self::getenv('PROJECTENV_TEST_LIVE');
|
|
47
|
+
$override = self::getenv('PROJECTENV_TEST_OVERRIDE');
|
|
48
48
|
|
|
49
49
|
if ($live === 'TRUE' || $override === 'TRUE') {
|
|
50
50
|
foreach (array_keys($m) as $key) {
|
|
@@ -63,9 +63,9 @@ class ProjectNameTestRunner
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
$explain = self::getenv('
|
|
66
|
+
$explain = self::getenv('PROJECTENV_TEST_EXPLAIN');
|
|
67
67
|
if ($explain !== null && $explain !== '') {
|
|
68
|
-
$m['
|
|
68
|
+
$m['PROJECTENV_TEST_EXPLAIN'] = $explain;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return $m;
|
|
@@ -45,6 +45,11 @@ class ProjectNameMakeError
|
|
|
45
45
|
$sdk_err = new ProjectNameError('', $msg, $ctx);
|
|
46
46
|
$sdk_err->result = ($ctx->utility->clean)($ctx, $result);
|
|
47
47
|
$sdk_err->spec = ($ctx->utility->clean)($ctx, $spec);
|
|
48
|
+
|
|
49
|
+
// Promote the HTTP status to the top level, so a consumer can branch
|
|
50
|
+
// on `err->status` / `err->notFound()` rather than reaching into
|
|
51
|
+
// `err->result`.
|
|
52
|
+
$sdk_err->status = null === $result->status ? -1 : (int)$result->status;
|
|
48
53
|
if ($err instanceof ProjectNameError) {
|
|
49
54
|
$sdk_err->sdk_code = $err->sdk_code;
|
|
50
55
|
}
|
|
@@ -53,6 +53,10 @@ def make_error_util(ctx, err):
|
|
|
53
53
|
sdk_err.result = ctx.utility.clean(ctx, result)
|
|
54
54
|
sdk_err.spec = ctx.utility.clean(ctx, spec)
|
|
55
55
|
|
|
56
|
+
# Promote the HTTP status to the top level, so a consumer can branch on
|
|
57
|
+
# `err.status` / `err.not_found` instead of reaching into `err.result`.
|
|
58
|
+
sdk_err.status = -1 if result.status is None else result.status
|
|
59
|
+
|
|
56
60
|
if isinstance(err, ProjectNameError):
|
|
57
61
|
sdk_err.code = err.code
|
|
58
62
|
|
|
@@ -38,8 +38,8 @@ class ProjectNameTestRunner:
|
|
|
38
38
|
|
|
39
39
|
@staticmethod
|
|
40
40
|
def env_override(m):
|
|
41
|
-
live = ProjectNameTestRunner.getenv("
|
|
42
|
-
override = ProjectNameTestRunner.getenv("
|
|
41
|
+
live = ProjectNameTestRunner.getenv("PROJECTENV_TEST_LIVE")
|
|
42
|
+
override = ProjectNameTestRunner.getenv("PROJECTENV_TEST_OVERRIDE")
|
|
43
43
|
|
|
44
44
|
if live == "TRUE" or override == "TRUE":
|
|
45
45
|
for key in list(m.keys()):
|
|
@@ -56,9 +56,9 @@ class ProjectNameTestRunner:
|
|
|
56
56
|
pass
|
|
57
57
|
m[key] = envval
|
|
58
58
|
|
|
59
|
-
explain = ProjectNameTestRunner.getenv("
|
|
59
|
+
explain = ProjectNameTestRunner.getenv("PROJECTENV_TEST_EXPLAIN")
|
|
60
60
|
if explain is not None and explain != "":
|
|
61
|
-
m["
|
|
61
|
+
m["PROJECTENV_TEST_EXPLAIN"] = explain
|
|
62
62
|
|
|
63
63
|
return m
|
|
64
64
|
|
|
@@ -111,6 +111,17 @@ class ProjectNameTestRunner:
|
|
|
111
111
|
return 500
|
|
112
112
|
|
|
113
113
|
@staticmethod
|
|
114
|
+
def entity_data(v):
|
|
115
|
+
"""Extract the data map from an op result.
|
|
116
|
+
|
|
117
|
+
Every entity operation resolves to the ENTITY (see AGENTS.md), so a
|
|
118
|
+
flow test that wants the record takes this hop. A plain dict passes
|
|
119
|
+
through unchanged.
|
|
120
|
+
"""
|
|
121
|
+
if hasattr(v, "data_get") and callable(v.data_get):
|
|
122
|
+
return v.data_get()
|
|
123
|
+
return v
|
|
124
|
+
|
|
114
125
|
def entity_list_to_data(lst):
|
|
115
126
|
out = []
|
|
116
127
|
for item in lst:
|
|
@@ -134,6 +145,10 @@ def env_override(m):
|
|
|
134
145
|
return ProjectNameTestRunner.env_override(m)
|
|
135
146
|
|
|
136
147
|
|
|
148
|
+
def entity_data(v):
|
|
149
|
+
return ProjectNameTestRunner.entity_data(v)
|
|
150
|
+
|
|
151
|
+
|
|
137
152
|
def entity_list_to_data(lst):
|
|
138
153
|
return ProjectNameTestRunner.entity_list_to_data(lst)
|
|
139
154
|
|
|
@@ -23,8 +23,8 @@ module ProjectNameTestRunner
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def self.env_override(m)
|
|
26
|
-
live = getenv("
|
|
27
|
-
override = getenv("
|
|
26
|
+
live = getenv("PROJECTENV_TEST_LIVE")
|
|
27
|
+
override = getenv("PROJECTENV_TEST_OVERRIDE")
|
|
28
28
|
|
|
29
29
|
if live == "TRUE" || override == "TRUE"
|
|
30
30
|
m.each_key do |key|
|
|
@@ -44,8 +44,8 @@ module ProjectNameTestRunner
|
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
explain = getenv("
|
|
48
|
-
m["
|
|
47
|
+
explain = getenv("PROJECTENV_TEST_EXPLAIN")
|
|
48
|
+
m["PROJECTENV_TEST_EXPLAIN"] = explain if explain && !explain.empty?
|
|
49
49
|
|
|
50
50
|
m
|
|
51
51
|
end
|
|
@@ -32,6 +32,10 @@ module ProjectNameUtilities
|
|
|
32
32
|
sdk_err = ProjectNameError.new("", msg, ctx)
|
|
33
33
|
sdk_err.result = ctx.utility.clean.call(ctx, result)
|
|
34
34
|
sdk_err.spec = ctx.utility.clean.call(ctx, spec)
|
|
35
|
+
|
|
36
|
+
# Promote the HTTP status to the top level, so a consumer can branch on
|
|
37
|
+
# `err.status` / `err.not_found?` instead of reaching into `err.result`.
|
|
38
|
+
sdk_err.status = result.status.nil? ? -1 : result.status
|
|
35
39
|
sdk_err.code = err.code if err.is_a?(ProjectNameError)
|
|
36
40
|
|
|
37
41
|
ctx.ctrl.err = sdk_err
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PROJECTVERSION
|
|
@@ -76,16 +76,32 @@ pub trait Entity {
|
|
|
76
76
|
fn make(&self) -> Rc<dyn Entity>;
|
|
77
77
|
fn data(&self, args: Option<&Value>) -> Value;
|
|
78
78
|
fn matchv(&self, args: Option<&Value>) -> Value;
|
|
79
|
+
|
|
80
|
+
/// `remove` resolves to the entity, marked. The instance KEEPS the data
|
|
81
|
+
/// it held — a caller can still read what was deleted — but it is no
|
|
82
|
+
/// longer a live record.
|
|
83
|
+
fn mark_deleted(&self);
|
|
84
|
+
fn deleted(&self) -> bool;
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
/// ProjectNameEntity: the full CRUD contract every generated entity
|
|
82
88
|
/// implements. Ops the API spec doesn't define are runtime-error stubs.
|
|
83
|
-
pub trait ProjectNameEntity: Entity {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
pub trait ProjectNameEntity: Entity + Sized {
|
|
90
|
+
/// Every operation resolves to the ENTITY, not the raw data — `list` to a
|
|
91
|
+
/// vector of them, one per record. The record is reached through
|
|
92
|
+
/// `.data(None)`. See AGENTS.md "Entity operations return ENTITIES".
|
|
93
|
+
///
|
|
94
|
+
/// The receivers are `&Rc<Self>` because the result IS this entity: the
|
|
95
|
+
/// op absorbs `resdata`/`resmatch` into it and hands the handle back.
|
|
96
|
+
/// `Value` cannot carry an entity — it is a closed data union
|
|
97
|
+
/// (Noval|Null|Bool|Num|Str|List|Map|Func|Sentinel) and adding a variant
|
|
98
|
+
/// to a general-purpose struct library to carry SDK objects would be
|
|
99
|
+
/// wrong — so the CONTRACT lives in these signatures instead.
|
|
100
|
+
fn load(self: &Rc<Self>, reqmatch: Value, ctrl: Value) -> Result<Rc<Self>, ProjectNameError>;
|
|
101
|
+
fn list(self: &Rc<Self>, reqmatch: Value, ctrl: Value) -> Result<Vec<Rc<Self>>, ProjectNameError>;
|
|
102
|
+
fn create(self: &Rc<Self>, reqdata: Value, ctrl: Value) -> Result<Rc<Self>, ProjectNameError>;
|
|
103
|
+
fn update(self: &Rc<Self>, reqdata: Value, ctrl: Value) -> Result<Rc<Self>, ProjectNameError>;
|
|
104
|
+
fn remove(self: &Rc<Self>, reqmatch: Value, ctrl: Value) -> Result<Rc<Self>, ProjectNameError>;
|
|
89
105
|
}
|
|
90
106
|
|
|
91
107
|
/// Transport: `(ctx, url, fetchdef) -> transport-shaped response map`.
|
|
@@ -124,12 +124,12 @@ pub fn load_env_local() {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/// env_override (mirrors go): when
|
|
128
|
-
///
|
|
127
|
+
/// env_override (mirrors go): when PROJECTENV_TEST_LIVE or
|
|
128
|
+
/// PROJECTENV_TEST_OVERRIDE is TRUE, environment variables replace the
|
|
129
129
|
/// defaults in `m` (JSON-shaped values are parsed).
|
|
130
130
|
pub fn env_override(m: Value) -> Value {
|
|
131
|
-
let live = std::env::var("
|
|
132
|
-
let over = std::env::var("
|
|
131
|
+
let live = std::env::var("PROJECTENV_TEST_LIVE").unwrap_or_default() == "TRUE";
|
|
132
|
+
let over = std::env::var("PROJECTENV_TEST_OVERRIDE").unwrap_or_default() == "TRUE";
|
|
133
133
|
|
|
134
134
|
if live || over {
|
|
135
135
|
if let Value::Map(mm) = &m {
|
|
@@ -152,9 +152,9 @@ pub fn env_override(m: Value) -> Value {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
if let Ok(explain) = std::env::var("
|
|
155
|
+
if let Ok(explain) = std::env::var("PROJECTENV_TEST_EXPLAIN") {
|
|
156
156
|
if !explain.is_empty() {
|
|
157
|
-
setp(&m, "
|
|
157
|
+
setp(&m, "PROJECTENV_TEST_EXPLAIN", Value::str(explain));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -68,6 +68,12 @@ impl Entity for PlEntity {
|
|
|
68
68
|
}
|
|
69
69
|
Value::Noval
|
|
70
70
|
}
|
|
71
|
+
// Every operation resolves to the entity; `remove` marks it. The fake
|
|
72
|
+
// has to satisfy the same trait the real entities do.
|
|
73
|
+
fn mark_deleted(&self) {}
|
|
74
|
+
fn deleted(&self) -> bool {
|
|
75
|
+
false
|
|
76
|
+
}
|
|
71
77
|
fn matchv(&self, _args: Option<&Value>) -> Value {
|
|
72
78
|
Value::Noval
|
|
73
79
|
}
|
|
@@ -63,6 +63,10 @@ pub fn make_error_util(
|
|
|
63
63
|
sdk_err.result = crate::utility::clean::clean_util(ctx, &result.borrow().to_value());
|
|
64
64
|
sdk_err.spec = crate::utility::clean::clean_util(ctx, &spec_val);
|
|
65
65
|
|
|
66
|
+
// Promote the HTTP status to the top level, so a consumer can branch on
|
|
67
|
+
// `err.status` / `err.not_found()` rather than reaching into `err.result`.
|
|
68
|
+
sdk_err.status = result.borrow().status;
|
|
69
|
+
|
|
66
70
|
ctrl.borrow_mut().err = Some(sdk_err.clone());
|
|
67
71
|
|
|
68
72
|
// Fire PreUnexpected so observability features (metrics, telemetry, audit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PROJECTVERSION
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PROJECTVERSION
|
|
@@ -46,6 +46,10 @@ function makeError(ctx: Context, err?: any) {
|
|
|
46
46
|
err.result = clean(ctx, result)
|
|
47
47
|
err.spec = clean(ctx, spec)
|
|
48
48
|
|
|
49
|
+
// Promote the HTTP status to the top level, so a consumer can branch on
|
|
50
|
+
// `err.status` / `err.notFound` instead of reaching into `err.result`.
|
|
51
|
+
err.status = null == result.status ? -1 : result.status
|
|
52
|
+
|
|
49
53
|
ctx.ctrl.err = err
|
|
50
54
|
|
|
51
55
|
// Fire PreUnexpected so observability features (metrics, telemetry, audit,
|
|
@@ -62,8 +62,8 @@ function makeCtrl(explain: boolean) {
|
|
|
62
62
|
// Overrides configuration values with environment variables if available
|
|
63
63
|
function envOverride(m: Record<string, any>) {
|
|
64
64
|
if (
|
|
65
|
-
'TRUE' === process.env.
|
|
66
|
-
'TRUE' === process.env.
|
|
65
|
+
'TRUE' === process.env.PROJECTENV_TEST_LIVE ||
|
|
66
|
+
'TRUE' === process.env.PROJECTENV_TEST_OVERRIDE
|
|
67
67
|
) {
|
|
68
68
|
Object.entries(m).map(n => {
|
|
69
69
|
let envval = process.env[n[0]]
|
|
@@ -74,7 +74,7 @@ function envOverride(m: Record<string, any>) {
|
|
|
74
74
|
})
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
m.
|
|
77
|
+
m.PROJECTENV_TEST_EXPLAIN = process.env.PROJECTENV_TEST_EXPLAIN || m.PROJECTENV_TEST_EXPLAIN
|
|
78
78
|
|
|
79
79
|
return m
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PROJECTVERSION
|