@voxgig/sdkgen 2.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +22 -2
- package/dist/action/doctor.d.ts +14 -0
- package/dist/action/doctor.js +351 -0
- package/dist/action/doctor.js.map +1 -0
- package/dist/action/feature.js +48 -9
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +6 -1
- package/dist/action/target.js +134 -22
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Entity.js +5 -0
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/ExternalTarget.d.ts +2 -0
- package/dist/cmp/ExternalTarget.js +104 -0
- package/dist/cmp/ExternalTarget.js.map +1 -0
- package/dist/cmp/Feature.js +2 -1
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/Main.js +5 -1
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +1 -1
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +16 -6
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/Registered.d.ts +7 -0
- package/dist/cmp/Registered.js +70 -0
- package/dist/cmp/Registered.js.map +1 -0
- package/dist/cmp/Test.js +3 -1
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/dryrun.d.ts +10 -0
- package/dist/helpers/dryrun.js +35 -0
- package/dist/helpers/dryrun.js.map +1 -0
- package/dist/helpers/featureSource.d.ts +13 -0
- package/dist/helpers/featureSource.js +156 -0
- package/dist/helpers/featureSource.js.map +1 -0
- package/dist/helpers/naming.d.ts +9 -1
- package/dist/helpers/naming.js +66 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.js +23 -3
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +11 -1
- package/dist/helpers/opShape.js +51 -0
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/packageMeta.d.ts +16 -1
- package/dist/helpers/packageMeta.js +181 -10
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/helpers/stdrep.d.ts +3 -0
- package/dist/helpers/stdrep.js +47 -0
- package/dist/helpers/stdrep.js.map +1 -0
- package/dist/helpers/testPolicy.d.ts +2 -0
- package/dist/helpers/testPolicy.js +46 -0
- package/dist/helpers/testPolicy.js.map +1 -0
- package/dist/sdkgen.d.ts +15 -6
- package/dist/sdkgen.js +273 -5
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/utility.js +10 -1
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +245 -0
- package/package.json +5 -3
- package/project/.sdk/model/target/c.aontu +28 -3
- package/project/.sdk/model/target/clojure.aontu +24 -3
- package/project/.sdk/model/target/cpp.aontu +25 -3
- package/project/.sdk/model/target/csharp.aontu +25 -3
- package/project/.sdk/model/target/dart.aontu +15 -3
- package/project/.sdk/model/target/elixir.aontu +15 -3
- package/project/.sdk/model/target/go-cli.aontu +16 -1
- package/project/.sdk/model/target/go-mcp.aontu +16 -1
- package/project/.sdk/model/target/go.aontu +14 -4
- package/project/.sdk/model/target/haskell.aontu +24 -3
- package/project/.sdk/model/target/java.aontu +25 -3
- package/project/.sdk/model/target/js.aontu +15 -3
- package/project/.sdk/model/target/kotlin.aontu +25 -3
- package/project/.sdk/model/target/lean.aontu +24 -3
- package/project/.sdk/model/target/lua.aontu +15 -3
- package/project/.sdk/model/target/ocaml.aontu +24 -3
- package/project/.sdk/model/target/perl.aontu +15 -3
- package/project/.sdk/model/target/php.aontu +15 -3
- package/project/.sdk/model/target/py-data.aontu +15 -3
- package/project/.sdk/model/target/py.aontu +15 -3
- package/project/.sdk/model/target/rb.aontu +15 -3
- package/project/.sdk/model/target/rust.aontu +25 -3
- package/project/.sdk/model/target/scala.aontu +24 -3
- package/project/.sdk/model/target/seneca-provider.aontu +118 -0
- package/project/.sdk/model/target/swift.aontu +25 -3
- package/project/.sdk/model/target/ts.aontu +15 -3
- package/project/.sdk/model/target/zig.aontu +25 -3
- package/project/.sdk/src/cmp/c/Config_c.ts +10 -11
- package/project/.sdk/src/cmp/c/Entity_c.ts +5 -1
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +23 -5
- package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +19 -2
- package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +12 -2
- package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -0
- package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +6 -3
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +12 -8
- package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +5 -1
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +12 -9
- package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +18 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +11 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +2 -1
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +6 -6
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +38 -1
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +42 -33
- package/project/.sdk/src/cmp/dart/Package_dart.ts +2 -1
- package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +2 -1
- package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +1 -1
- package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +17 -6
- package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +8 -8
- package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +18 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +15 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +8 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
- package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +2 -2
- package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +11 -2
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +1 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +38 -8
- package/project/.sdk/src/cmp/go/Entity_go.ts +2 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +4 -5
- package/project/.sdk/src/cmp/go/Package_go.ts +8 -5
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +4 -2
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +21 -15
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +9 -9
- package/project/.sdk/src/cmp/go/Test_go.ts +2 -2
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -1
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +4 -4
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +4 -4
- package/project/.sdk/src/cmp/haskell/Package_haskell.ts +2 -1
- package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +10 -5
- package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +10 -8
- package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +14 -10
- package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +21 -18
- package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +4 -4
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +23 -11
- package/project/.sdk/src/cmp/java/Package_java.ts +2 -1
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -1
- package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +2 -2
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +3 -3
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
- package/project/.sdk/src/cmp/java/TestEntity_java.ts +6 -6
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +34 -1
- package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +12 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +4 -1
- package/project/.sdk/src/cmp/js/Package_js.ts +7 -1
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -1
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -1
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +3 -3
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +8 -8
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +22 -1
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +15 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +13 -0
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +2 -2
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +6 -6
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +32 -1
- package/project/.sdk/src/cmp/lean/Package_lean.ts +3 -1
- package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +9 -4
- package/project/.sdk/src/cmp/lua/Package_lua.ts +4 -3
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +11 -3
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +9 -9
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +37 -1
- package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +12 -0
- package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +30 -3
- package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +11 -5
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +3 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +10 -5
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +6 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +10 -8
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +14 -13
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +20 -18
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -4
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +8 -2
- package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +8 -5
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -1
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +6 -6
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +36 -1
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +21 -16
- package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +6 -6
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +12 -12
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +6 -6
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +4 -4
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +17 -15
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +20 -1
- package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +11 -0
- package/project/.sdk/src/cmp/py/Package_py.ts +4 -3
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +13 -2
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -1
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +17 -6
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +14 -3
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +13 -2
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +9 -9
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +29 -1
- package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +11 -0
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +2 -1
- package/project/.sdk/src/cmp/rb/Package_rb.ts +4 -3
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +5 -5
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +9 -9
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +31 -1
- package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +10 -1
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +5 -1
- package/project/.sdk/src/cmp/rust/Main_rust.ts +21 -0
- package/project/.sdk/src/cmp/rust/Package_rust.ts +2 -1
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +12 -12
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +18 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +20 -3
- package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +10 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +10 -0
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -1
- package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +1 -1
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +27 -1
- package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +3915 -0
- package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +960 -0
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -1
- package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +34 -1
- package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +9 -1
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +18 -1
- package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +5 -2
- package/project/.sdk/src/cmp/ts/Main_ts.ts +4 -1
- package/project/.sdk/src/cmp/ts/Package_ts.ts +10 -1
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -2
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -1
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +21 -6
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +52 -2
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +14 -3
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +34 -2
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +64 -43
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +8 -8
- package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +2 -2
- package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +25 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +27 -3
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +15 -0
- package/project/.sdk/src/cmp/zig/Entity_zig.ts +5 -1
- package/project/.sdk/src/cmp/zig/Package_zig.ts +3 -1
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +39 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +2 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +2 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +5 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +2 -2
- package/project/.sdk/tm/c/VERSION +1 -1
- package/project/.sdk/tm/c/core/helpers.c +1 -0
- package/project/.sdk/tm/c/core/sdk.h +22 -6
- package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +4 -1
- package/project/.sdk/tm/c/utility/make_url.c +1 -0
- package/project/.sdk/tm/c/utility/param.c +1 -0
- package/project/.sdk/tm/clojure/VERSION +1 -1
- package/project/.sdk/tm/cpp/VERSION +1 -1
- package/project/.sdk/tm/cpp/core/types.hpp +33 -8
- package/project/.sdk/tm/cpp/test/pipeline_test.cpp +5 -0
- package/project/.sdk/tm/cpp/test/runner_support.hpp +4 -4
- package/project/.sdk/tm/csharp/VERSION +1 -1
- package/project/.sdk/tm/csharp/core/Types.cs +6 -0
- package/project/.sdk/tm/csharp/test/FeatureHarness.cs +396 -0
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +7 -385
- package/project/.sdk/tm/csharp/test/Runner.cs +4 -4
- package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +4 -0
- package/project/.sdk/tm/dart/test/utility.dart +4 -4
- package/project/.sdk/tm/elixir/VERSION +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +26 -0
- package/project/.sdk/tm/go/VERSION +1 -1
- package/project/.sdk/tm/go/core/types.go +6 -0
- package/project/.sdk/tm/go/test/feature_harness_test.go +361 -0
- package/project/.sdk/tm/go/test/feature_test.go +7 -350
- package/project/.sdk/tm/go/test/pipeline_test.go +6 -0
- package/project/.sdk/tm/go/test/runner_test.go +16 -4
- package/project/.sdk/tm/haskell/VERSION +1 -1
- package/project/.sdk/tm/haskell/src/SdkFeatures.hs +28 -5
- package/project/.sdk/tm/haskell/src/SdkTypes.hs +14 -5
- package/project/.sdk/tm/java/VERSION +1 -1
- package/project/.sdk/tm/java/test/RunnerSupport.java +4 -4
- package/project/.sdk/tm/java/utility/MakeError.java +4 -0
- package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +4 -0
- package/project/.sdk/tm/js/test/utility.js +3 -3
- package/project/.sdk/tm/kotlin/VERSION +1 -1
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
- package/project/.sdk/tm/lean/VERSION +1 -1
- package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
- package/project/.sdk/tm/lua/test/runner.lua +4 -4
- package/project/.sdk/tm/lua/utility/make_error.lua +4 -0
- package/project/.sdk/tm/ocaml/VERSION +1 -1
- package/project/.sdk/tm/ocaml/sdk_types.ml +14 -5
- package/project/.sdk/tm/ocaml/test/t_pipeline.ml +5 -2
- package/project/.sdk/tm/perl/t/runner.pm +4 -4
- package/project/.sdk/tm/php/VERSION +1 -1
- package/project/.sdk/tm/php/test/Runner.php +4 -4
- package/project/.sdk/tm/php/utility/MakeError.php +5 -0
- package/project/.sdk/tm/py/pkg/utility/make_error.py +4 -0
- package/project/.sdk/tm/py/test/runner.py +19 -4
- package/project/.sdk/tm/rb/test/runner.rb +4 -4
- package/project/.sdk/tm/rb/utility/make_error.rb +4 -0
- package/project/.sdk/tm/rust/VERSION +1 -1
- package/project/.sdk/tm/rust/core/types.rs +22 -6
- package/project/.sdk/tm/rust/tests/common/mod.rs +6 -6
- package/project/.sdk/tm/rust/tests/pipeline_test.rs +6 -0
- package/project/.sdk/tm/rust/utility/make_error.rs +4 -0
- package/project/.sdk/tm/scala/VERSION +1 -1
- package/project/.sdk/tm/seneca-provider/CODE_OF_CONDUCT.md +132 -0
- package/project/.sdk/tm/seneca-provider/LICENSE +21 -0
- package/project/.sdk/tm/seneca-provider/Makefile +15 -0
- package/project/.sdk/tm/seneca-provider/src/tsconfig.json +18 -0
- package/project/.sdk/tm/seneca-provider/test/tsconfig.json +16 -0
- package/project/.sdk/tm/seneca-provider/tsfmt.json +3 -0
- package/project/.sdk/tm/swift/VERSION +1 -1
- package/project/.sdk/tm/ts/src/tsconfig.json +1 -0
- package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +4 -0
- package/project/.sdk/tm/ts/test/tsconfig.json +1 -0
- package/project/.sdk/tm/ts/test/utility.ts +3 -3
- package/project/.sdk/tm/zig/VERSION +1 -1
- package/src/action/doctor.ts +475 -0
- package/src/action/feature.ts +54 -16
- package/src/action/target.ts +174 -25
- package/src/cmp/Entity.ts +7 -0
- package/src/cmp/ExternalTarget.ts +125 -0
- package/src/cmp/Feature.ts +3 -1
- package/src/cmp/Main.ts +7 -1
- package/src/cmp/ReadmeExplanation.ts +2 -2
- package/src/cmp/ReadmeTop.ts +22 -9
- package/src/cmp/Registered.ts +100 -0
- package/src/cmp/Test.ts +4 -1
- package/src/helpers/dryrun.ts +57 -0
- package/src/helpers/featureSource.ts +208 -0
- package/src/helpers/naming.ts +73 -2
- package/src/helpers/opExample.ts +19 -2
- package/src/helpers/opShape.ts +65 -0
- package/src/helpers/packageMeta.ts +211 -10
- package/src/helpers/stdrep.ts +56 -0
- package/src/helpers/testPolicy.ts +52 -0
- package/src/sdkgen.ts +350 -5
- package/src/types.ts +24 -1
- package/src/utility.ts +10 -1
- package/project/.sdk/tm/rust/feature/mod.rs +0 -24
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
each,
|
|
18
18
|
buildIdNames,
|
|
19
19
|
getMatchEntries,
|
|
20
|
-
isAuthActive,
|
|
20
|
+
isAuthActive, envName, envToken
|
|
21
21
|
} from '@voxgig/sdkgen'
|
|
22
22
|
|
|
23
23
|
|
|
@@ -54,8 +54,8 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const Name = model.const.Name
|
|
57
|
-
const PROJUPPER =
|
|
58
|
-
const ENTUPPER = entity.name
|
|
57
|
+
const PROJUPPER = envName(model)
|
|
58
|
+
const ENTUPPER = envToken(entity.name)
|
|
59
59
|
|
|
60
60
|
const authActive = isAuthActive(model)
|
|
61
61
|
const apikeyEnvEntry = authActive
|
|
@@ -358,7 +358,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
358
358
|
|
|
359
359
|
Content(`
|
|
360
360
|
var ${datavar}Result = ${entvar}.Create(${datavar}, null);
|
|
361
|
-
${datavar} = Helpers.ToMapAny(${datavar}Result);
|
|
361
|
+
${datavar} = Helpers.ToMapAny(${datavar}Result is IEntity ce ? ce.Data() : ${datavar}Result);
|
|
362
362
|
Assert.True(${datavar} != null, "expected create result to be a map");
|
|
363
363
|
`)
|
|
364
364
|
if (null != ctx.entity.id) {
|
|
@@ -500,7 +500,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
500
500
|
|
|
501
501
|
Content(`
|
|
502
502
|
var ${resdatavar}Result = ${entvar}.Update(${datavar}Up, null);
|
|
503
|
-
var ${resdatavar} = Helpers.ToMapAny(${resdatavar}Result);
|
|
503
|
+
var ${resdatavar} = Helpers.ToMapAny(${resdatavar}Result is IEntity ue ? ue.Data() : ${resdatavar}Result);
|
|
504
504
|
Assert.True(${resdatavar} != null, "expected update result to be a map");
|
|
505
505
|
`)
|
|
506
506
|
if (hasEntIdU) {
|
|
@@ -569,7 +569,7 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
569
569
|
["id"] = ${srcdatavar}!["id"],
|
|
570
570
|
};
|
|
571
571
|
var ${datavar}Loaded = ${entvar}.Load(${matchvar}, null);
|
|
572
|
-
var ${datavar}LoadResult = Helpers.ToMapAny(${datavar}Loaded);
|
|
572
|
+
var ${datavar}LoadResult = Helpers.ToMapAny(${datavar}Loaded is IEntity le ? le.Data() : ${datavar}Loaded);
|
|
573
573
|
Assert.True(${datavar}LoadResult != null, "expected load result to be a map");
|
|
574
574
|
Assert.True(StructRunner.DeepEqual(${datavar}LoadResult!["id"], ${srcdatavar}["id"]),
|
|
575
575
|
"expected load result id to match");
|
|
@@ -19,6 +19,22 @@ public abstract class ProjectNameEntityBase : IEntity
|
|
|
19
19
|
protected Dictionary<string, object?> match = new();
|
|
20
20
|
protected Context entctx;
|
|
21
21
|
|
|
22
|
+
// Every operation resolves to the entity; `remove` additionally marks
|
|
23
|
+
// it. The instance KEEPS the data it held — a caller can still read what
|
|
24
|
+
// was deleted — but it is no longer a live record. See AGENTS.md.
|
|
25
|
+
private bool _deleted = false;
|
|
26
|
+
|
|
27
|
+
public void MarkDeleted()
|
|
28
|
+
{
|
|
29
|
+
this._deleted = true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public bool Deleted()
|
|
33
|
+
{
|
|
34
|
+
return this._deleted;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
22
38
|
protected ProjectNameEntityBase(ProjectNameSDK client,
|
|
23
39
|
Dictionary<string, object?>? entopts, string name)
|
|
24
40
|
{
|
|
@@ -167,7 +183,28 @@ public abstract class ProjectNameEntityBase : IEntity
|
|
|
167
183
|
|
|
168
184
|
postDone();
|
|
169
185
|
|
|
170
|
-
|
|
186
|
+
var outv = utility.Done(ctx);
|
|
187
|
+
|
|
188
|
+
// An operation resolves to the ENTITY, not the raw data. Entities are
|
|
189
|
+
// stateful: postDone has just absorbed Resdata/Resmatch into this
|
|
190
|
+
// instance, and the caller reaches the record through Data(). Two
|
|
191
|
+
// structural exceptions: `list` resolves to the ARRAY of entity
|
|
192
|
+
// instances MakeResult built, and a failed op with throwing disabled
|
|
193
|
+
// hands back the error payload unchanged. `remove` additionally marks
|
|
194
|
+
// the entity deleted; it KEEPS its data, so a caller can still read
|
|
195
|
+
// what was removed. See AGENTS.md "Entity operations return ENTITIES".
|
|
196
|
+
var opname = ctx.Op?.Name;
|
|
197
|
+
|
|
198
|
+
if (ctx.Result != null && ctx.Result.Ok && "list" != opname)
|
|
199
|
+
{
|
|
200
|
+
if ("remove" == opname)
|
|
201
|
+
{
|
|
202
|
+
this.MarkDeleted();
|
|
203
|
+
}
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return outv;
|
|
171
208
|
}
|
|
172
209
|
|
|
173
210
|
// Streaming operations. Runs `action` through the full pipeline and returns
|
|
@@ -8,6 +8,15 @@ namespace ProjectNameSdk;
|
|
|
8
8
|
|
|
9
9
|
public class ProjectNameSDK
|
|
10
10
|
{
|
|
11
|
+
// NOTE: type references in EXPRESSION position are `global::`-qualified
|
|
12
|
+
// throughout this class. Entity accessors are PascalCase methods declared
|
|
13
|
+
// on it (see MainEntity_csharp), so an entity named `utility` declares
|
|
14
|
+
// `Utility(...)` here and C# then resolves the simple name `Utility` in an
|
|
15
|
+
// expression to the METHOD, not the type: "'X.Utility(...)' is a method,
|
|
16
|
+
// which is not valid in the given context". Qualifying makes the class
|
|
17
|
+
// immune to that whatever the API names its entities. Type POSITIONS
|
|
18
|
+
// (field and return types) are unaffected and stay unqualified.
|
|
19
|
+
|
|
11
20
|
public string Mode = "live";
|
|
12
21
|
private Dictionary<string, object?> _options;
|
|
13
22
|
private readonly Utility _utility;
|
|
@@ -18,7 +27,7 @@ public class ProjectNameSDK
|
|
|
18
27
|
{
|
|
19
28
|
_utility = new Utility();
|
|
20
29
|
|
|
21
|
-
var config = SdkConfig.MakeConfig();
|
|
30
|
+
var config = global::ProjectNameSdk.SdkConfig.MakeConfig();
|
|
22
31
|
|
|
23
32
|
_rootctx = _utility.MakeContext(new Dictionary<string, object?>
|
|
24
33
|
{
|
|
@@ -31,8 +40,8 @@ public class ProjectNameSDK
|
|
|
31
40
|
|
|
32
41
|
_options = _utility.MakeOptions(_rootctx);
|
|
33
42
|
|
|
34
|
-
if (Equals(StructUtils.GetPath(_options,
|
|
35
|
-
StructUtils.Jt("feature", "test", "active")), true))
|
|
43
|
+
if (Equals(global::Voxgig.Struct.StructUtils.GetPath(_options,
|
|
44
|
+
global::Voxgig.Struct.StructUtils.Jt("feature", "test", "active")), true))
|
|
36
45
|
{
|
|
37
46
|
Mode = "test";
|
|
38
47
|
}
|
|
@@ -45,25 +54,25 @@ public class ProjectNameSDK
|
|
|
45
54
|
// features (retry/cache/netsim/proxy/ratelimit) wrap whatever is
|
|
46
55
|
// current, so `test` must be added before them to sit at the base of
|
|
47
56
|
// the chain.
|
|
48
|
-
var featureOpts = Helpers.ToMapAny(StructUtils.GetProp(_options, "feature"))
|
|
57
|
+
var featureOpts = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(_options, "feature"))
|
|
49
58
|
?? new Dictionary<string, object?>();
|
|
50
|
-
var featureOrder = StructUtils.GetPath(_options,
|
|
51
|
-
StructUtils.Jt("__derived__", "featureorder")) as List<object?>
|
|
59
|
+
var featureOrder = global::Voxgig.Struct.StructUtils.GetPath(_options,
|
|
60
|
+
global::Voxgig.Struct.StructUtils.Jt("__derived__", "featureorder")) as List<object?>
|
|
52
61
|
?? new List<object?>();
|
|
53
62
|
foreach (var fnameObj in featureOrder)
|
|
54
63
|
{
|
|
55
64
|
var fname = fnameObj as string ?? "";
|
|
56
|
-
var fopts = Helpers.ToMapAny(StructUtils.GetProp(featureOpts, fname));
|
|
65
|
+
var fopts = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(featureOpts, fname));
|
|
57
66
|
if (fopts != null &&
|
|
58
67
|
fopts.TryGetValue("active", out var active) &&
|
|
59
68
|
active is bool ab && ab)
|
|
60
69
|
{
|
|
61
|
-
_utility.FeatureAdd(_rootctx, SdkConfig.MakeFeature(fname));
|
|
70
|
+
_utility.FeatureAdd(_rootctx, global::ProjectNameSdk.SdkConfig.MakeFeature(fname));
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
// Add extension features.
|
|
66
|
-
if (StructUtils.GetProp(_options, "extend") is List<object?> extList)
|
|
75
|
+
if (global::Voxgig.Struct.StructUtils.GetProp(_options, "extend") is List<object?> extList)
|
|
67
76
|
{
|
|
68
77
|
foreach (var f in extList)
|
|
69
78
|
{
|
|
@@ -85,13 +94,13 @@ public class ProjectNameSDK
|
|
|
85
94
|
|
|
86
95
|
public Dictionary<string, object?> OptionsMap()
|
|
87
96
|
{
|
|
88
|
-
return StructUtils.Clone(_options) as Dictionary<string, object?>
|
|
97
|
+
return global::Voxgig.Struct.StructUtils.Clone(_options) as Dictionary<string, object?>
|
|
89
98
|
?? new Dictionary<string, object?>();
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
public Utility GetUtility()
|
|
93
102
|
{
|
|
94
|
-
return Utility.Copy(_utility);
|
|
103
|
+
return global::ProjectNameSdk.Utility.Copy(_utility);
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
public Context GetRootCtx()
|
|
@@ -105,7 +114,7 @@ public class ProjectNameSDK
|
|
|
105
114
|
|
|
106
115
|
fetchargs ??= new Dictionary<string, object?>();
|
|
107
116
|
|
|
108
|
-
var ctrl = Helpers.ToMapAny(StructUtils.GetProp(fetchargs, "ctrl"))
|
|
117
|
+
var ctrl = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "ctrl"))
|
|
109
118
|
?? new Dictionary<string, object?>();
|
|
110
119
|
|
|
111
120
|
var ctx = utility.MakeContext(new Dictionary<string, object?>
|
|
@@ -116,23 +125,23 @@ public class ProjectNameSDK
|
|
|
116
125
|
|
|
117
126
|
var options = _options;
|
|
118
127
|
|
|
119
|
-
var path = StructUtils.GetProp(fetchargs, "path") as string ?? "";
|
|
120
|
-
var method = StructUtils.GetProp(fetchargs, "method") as string ?? "";
|
|
128
|
+
var path = global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "path") as string ?? "";
|
|
129
|
+
var method = global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "method") as string ?? "";
|
|
121
130
|
if (method == "")
|
|
122
131
|
{
|
|
123
132
|
method = "GET";
|
|
124
133
|
}
|
|
125
134
|
|
|
126
|
-
var pathParams = Helpers.ToMapAny(StructUtils.GetProp(fetchargs, "params"))
|
|
135
|
+
var pathParams = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "params"))
|
|
127
136
|
?? new Dictionary<string, object?>();
|
|
128
|
-
var query = Helpers.ToMapAny(StructUtils.GetProp(fetchargs, "query"))
|
|
137
|
+
var query = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "query"))
|
|
129
138
|
?? new Dictionary<string, object?>();
|
|
130
139
|
|
|
131
140
|
var headers = utility.PrepareHeaders(ctx);
|
|
132
141
|
|
|
133
|
-
var basev = StructUtils.GetProp(options, "base") as string ?? "";
|
|
134
|
-
var prefix = StructUtils.GetProp(options, "prefix") as string ?? "";
|
|
135
|
-
var suffix = StructUtils.GetProp(options, "suffix") as string ?? "";
|
|
142
|
+
var basev = global::Voxgig.Struct.StructUtils.GetProp(options, "base") as string ?? "";
|
|
143
|
+
var prefix = global::Voxgig.Struct.StructUtils.GetProp(options, "prefix") as string ?? "";
|
|
144
|
+
var suffix = global::Voxgig.Struct.StructUtils.GetProp(options, "suffix") as string ?? "";
|
|
136
145
|
|
|
137
146
|
ctx.Spec = new Spec(new Dictionary<string, object?>
|
|
138
147
|
{
|
|
@@ -144,12 +153,12 @@ public class ProjectNameSDK
|
|
|
144
153
|
["params"] = pathParams,
|
|
145
154
|
["query"] = query,
|
|
146
155
|
["headers"] = headers,
|
|
147
|
-
["body"] = StructUtils.GetProp(fetchargs, "body"),
|
|
156
|
+
["body"] = global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "body"),
|
|
148
157
|
["step"] = "start",
|
|
149
158
|
});
|
|
150
159
|
|
|
151
160
|
// Merge user-provided headers.
|
|
152
|
-
if (StructUtils.GetProp(fetchargs, "headers") is Dictionary<string, object?> uhm)
|
|
161
|
+
if (global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "headers") is Dictionary<string, object?> uhm)
|
|
153
162
|
{
|
|
154
163
|
foreach (var kv in uhm)
|
|
155
164
|
{
|
|
@@ -178,13 +187,13 @@ public class ProjectNameSDK
|
|
|
178
187
|
// Is this raw-access op permitted by the SDK's allow.op option?
|
|
179
188
|
private bool OpAllowed(string op)
|
|
180
189
|
{
|
|
181
|
-
return StructUtils.GetPath(_options, StructUtils.Jt("allow", "op"))
|
|
190
|
+
return global::Voxgig.Struct.StructUtils.GetPath(_options, global::Voxgig.Struct.StructUtils.Jt("allow", "op"))
|
|
182
191
|
is string allow && allow.Contains(op);
|
|
183
192
|
}
|
|
184
193
|
|
|
185
194
|
private Dictionary<string, object?> OpDenied(string op)
|
|
186
195
|
{
|
|
187
|
-
var allow = StructUtils.GetPath(_options, StructUtils.Jt("allow", "op"))
|
|
196
|
+
var allow = global::Voxgig.Struct.StructUtils.GetPath(_options, global::Voxgig.Struct.StructUtils.Jt("allow", "op"))
|
|
188
197
|
as string ?? "";
|
|
189
198
|
return new Dictionary<string, object?>
|
|
190
199
|
{
|
|
@@ -219,7 +228,7 @@ public class ProjectNameSDK
|
|
|
219
228
|
|
|
220
229
|
fetchargs ??= new Dictionary<string, object?>();
|
|
221
230
|
|
|
222
|
-
var ctrl = Helpers.ToMapAny(StructUtils.GetProp(fetchargs, "ctrl"))
|
|
231
|
+
var ctrl = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(fetchargs, "ctrl"))
|
|
223
232
|
?? new Dictionary<string, object?>();
|
|
224
233
|
|
|
225
234
|
var ctx = utility.MakeContext(new Dictionary<string, object?>
|
|
@@ -255,8 +264,8 @@ public class ProjectNameSDK
|
|
|
255
264
|
|
|
256
265
|
if (fetched is Dictionary<string, object?> fm)
|
|
257
266
|
{
|
|
258
|
-
var status = Helpers.ToInt(StructUtils.GetProp(fm, "status"));
|
|
259
|
-
var headers = StructUtils.GetProp(fm, "headers");
|
|
267
|
+
var status = global::ProjectNameSdk.Helpers.ToInt(global::Voxgig.Struct.StructUtils.GetProp(fm, "status"));
|
|
268
|
+
var headers = global::Voxgig.Struct.StructUtils.GetProp(fm, "headers");
|
|
260
269
|
|
|
261
270
|
// No-body responses (204, 304) and explicit zero content-length
|
|
262
271
|
// must skip JSON parsing - calling json() on an empty body errors.
|
|
@@ -264,12 +273,12 @@ public class ProjectNameSDK
|
|
|
264
273
|
if (headers is Dictionary<string, object?> hm &&
|
|
265
274
|
hm.TryGetValue("content-length", out var cl) && cl != null)
|
|
266
275
|
{
|
|
267
|
-
contentLength = StructUtils.Stringify(cl);
|
|
276
|
+
contentLength = global::Voxgig.Struct.StructUtils.Stringify(cl);
|
|
268
277
|
}
|
|
269
278
|
var noBody = status == 204 || status == 304 || contentLength == "0";
|
|
270
279
|
|
|
271
280
|
object? jsonData = null;
|
|
272
|
-
if (!noBody && StructUtils.GetProp(fm, "json") is Func<object?> jf)
|
|
281
|
+
if (!noBody && global::Voxgig.Struct.StructUtils.GetProp(fm, "json") is Func<object?> jf)
|
|
273
282
|
{
|
|
274
283
|
// jf() returns null on parse error in our fetcher.
|
|
275
284
|
jsonData = jf();
|
|
@@ -333,12 +342,12 @@ public class ProjectNameSDK
|
|
|
333
342
|
// ok:false with no err — so returning early on status would discard
|
|
334
343
|
// the server's own diagnostics, which are the only useful part of
|
|
335
344
|
// that response.
|
|
336
|
-
var errors = StructUtils.GetPath(res, StructUtils.Jt("data", "errors"))
|
|
345
|
+
var errors = global::Voxgig.Struct.StructUtils.GetPath(res, global::Voxgig.Struct.StructUtils.Jt("data", "errors"))
|
|
337
346
|
as List<object?>;
|
|
338
347
|
|
|
339
348
|
if (null != errors && 0 < errors.Count)
|
|
340
349
|
{
|
|
341
|
-
var msg = StructUtils.GetProp(errors[0], "message") as string;
|
|
350
|
+
var msg = global::Voxgig.Struct.StructUtils.GetProp(errors[0], "message") as string;
|
|
342
351
|
if (string.IsNullOrEmpty(msg))
|
|
343
352
|
{
|
|
344
353
|
msg = "graphql error";
|
|
@@ -356,14 +365,14 @@ public class ProjectNameSDK
|
|
|
356
365
|
public static ProjectNameSDK TestSDK(Dictionary<string, object?>? testopts,
|
|
357
366
|
Dictionary<string, object?>? sdkopts)
|
|
358
367
|
{
|
|
359
|
-
sdkopts = StructUtils.Clone(sdkopts ?? new Dictionary<string, object?>())
|
|
368
|
+
sdkopts = global::Voxgig.Struct.StructUtils.Clone(sdkopts ?? new Dictionary<string, object?>())
|
|
360
369
|
as Dictionary<string, object?> ?? new Dictionary<string, object?>();
|
|
361
370
|
|
|
362
|
-
testopts = StructUtils.Clone(testopts ?? new Dictionary<string, object?>())
|
|
371
|
+
testopts = global::Voxgig.Struct.StructUtils.Clone(testopts ?? new Dictionary<string, object?>())
|
|
363
372
|
as Dictionary<string, object?> ?? new Dictionary<string, object?>();
|
|
364
373
|
testopts["active"] = true;
|
|
365
374
|
|
|
366
|
-
StructUtils.SetPath(sdkopts, StructUtils.Jt("feature", "test"), testopts);
|
|
375
|
+
global::Voxgig.Struct.StructUtils.SetPath(sdkopts, global::Voxgig.Struct.StructUtils.Jt("feature", "test"), testopts);
|
|
367
376
|
|
|
368
377
|
var sdk = new ProjectNameSDK(sdkopts)
|
|
369
378
|
{
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
pkgDescription,
|
|
8
8
|
keywords,
|
|
9
9
|
repoInfo,
|
|
10
|
+
packageVersion,
|
|
10
11
|
} from '@voxgig/sdkgen'
|
|
11
12
|
|
|
12
13
|
|
|
@@ -39,7 +40,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
39
40
|
Content(`name: ${dartPackageName(model)}
|
|
40
41
|
description: >-
|
|
41
42
|
${pkgDescription(model, target.name)}
|
|
42
|
-
version:
|
|
43
|
+
version: ${packageVersion(model, target.name)}
|
|
43
44
|
homepage: ${repoUrl}
|
|
44
45
|
repository: ${repoUrl}
|
|
45
46
|
issue_tracker: ${issuesUrl}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, canonToType, canonKey, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -22,6 +22,17 @@ function dartLit(type: any, placeholder: string = 'example'): string {
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
// Op method spellings + descriptions (language-agnostic wording).
|
|
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('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
25
36
|
const OP_DESC: Record<string, { method: string, desc: string }> = {
|
|
26
37
|
load: { method: 'load(match)', desc: 'Load a single entity by match criteria.' },
|
|
27
38
|
list: { method: 'list()', desc: 'List entities, optionally matching the given criteria.' },
|
|
@@ -132,7 +143,7 @@ final ${eVar} = await client.${entity.Name}().load(${loadArg});
|
|
|
132
143
|
Content(`#### Example: List
|
|
133
144
|
|
|
134
145
|
\`\`\`dart
|
|
135
|
-
final ${eVar}s = await client.${entity.Name}().list();
|
|
146
|
+
final ${eVar}s = await client.${entity.Name}().list(${listMatchArg(entity)});
|
|
136
147
|
\`\`\`
|
|
137
148
|
|
|
138
149
|
`)
|
|
@@ -46,7 +46,8 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
46
46
|
// The op-driven test-mode line, shown only when the SDK has an entity op.
|
|
47
47
|
// A direct()-only SDK (no ops anywhere) shows a direct() call instead.
|
|
48
48
|
const testModeExample = primaryOp
|
|
49
|
-
? `// Entity ops return the
|
|
49
|
+
? `// Entity ops return the ENTITY and throws on error;
|
|
50
|
+
// call data() for the record.
|
|
50
51
|
final ${eVar} = await client.${eName}().${primaryOp}(${testArg});
|
|
51
52
|
// ${eVar} contains the mock response record
|
|
52
53
|
print(${eVar});`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isPublished, repoInfo } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isPublished, repoInfo, packageVersion } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import { dartPackageName } from './Package_dart'
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ Or add it to your \`pubspec.yaml\`:
|
|
|
19
19
|
|
|
20
20
|
\`\`\`yaml
|
|
21
21
|
dependencies:
|
|
22
|
-
${pkg}:
|
|
22
|
+
${pkg}: ^${packageVersion(model, target.name)}
|
|
23
23
|
\`\`\`
|
|
24
24
|
|
|
25
25
|
`)
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
git:
|
|
40
40
|
url: ${repoUrl}
|
|
41
41
|
path: ${target.name}
|
|
42
|
-
ref: ${target.name}/
|
|
42
|
+
ref: ${target.name}/v${packageVersion(model, target.name)}
|
|
43
43
|
\`\`\`
|
|
44
44
|
|
|
45
45
|
Or depend on a local source checkout:
|
|
@@ -94,7 +94,7 @@ ${opRows}
|
|
|
94
94
|
|
|
95
95
|
### Result shape
|
|
96
96
|
|
|
97
|
-
Entity operations return the
|
|
97
|
+
Entity operations return the ENTITY (call data() for the record) (a \`Map\` for single-entity
|
|
98
98
|
ops, a \`List\` of entity instances for \`list\`) and throw on error. Wrap calls
|
|
99
99
|
in \`try\`/\`catch\` to handle failures.
|
|
100
100
|
|
|
@@ -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,
|
|
@@ -10,6 +10,17 @@ import {
|
|
|
10
10
|
import { dartPackageName } from './Package_dart'
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
// A `list()` on a NESTED entity needs its parent path params. The
|
|
14
|
+
// quickstart used to emit `client.Moon().list()` for an entity at
|
|
15
|
+
// `/planet/{planet_id}/moon`, which 404s against a live server from a
|
|
16
|
+
// half-built URL — indistinguishable from "no such record". The model
|
|
17
|
+
// already marks those params `reqd: true`; matchArg renders exactly them.
|
|
18
|
+
function listMatchArg(ent: any): string {
|
|
19
|
+
const idF = entityIdField(ent)
|
|
20
|
+
return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
13
24
|
const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
14
25
|
const { target, ctx$: { model } } = props
|
|
15
26
|
|
|
@@ -74,7 +85,7 @@ it and read each record's data via \`.data()\`.
|
|
|
74
85
|
|
|
75
86
|
\`\`\`dart
|
|
76
87
|
try {
|
|
77
|
-
final ${eVar}s = await client.${eName}().list();
|
|
88
|
+
final ${eVar}s = await client.${eName}().list(${listMatchArg(exampleEntity)});
|
|
78
89
|
for (final item in ${eVar}s) {
|
|
79
90
|
print(item.data());
|
|
80
91
|
}
|
|
@@ -108,7 +119,7 @@ try {
|
|
|
108
119
|
Content(`### 3. Load ${neArticle} ${neName.toLowerCase()}
|
|
109
120
|
|
|
110
121
|
${neName} is nested under ${parentName}, so provide the \`${parentParam}\`.
|
|
111
|
-
\`load()\` returns the
|
|
122
|
+
\`load()\` returns the ENTITY — call data() for the record — and throws on error.
|
|
112
123
|
|
|
113
124
|
\`\`\`dart
|
|
114
125
|
try {
|
|
@@ -135,7 +146,7 @@ try {
|
|
|
135
146
|
|
|
136
147
|
Content(`### 3. Load ${article} ${eName.toLowerCase()}
|
|
137
148
|
|
|
138
|
-
\`load()\` returns the
|
|
149
|
+
\`load()\` returns the ENTITY — call data() for the record — and throws on error.
|
|
139
150
|
|
|
140
151
|
\`\`\`dart
|
|
141
152
|
try {
|
|
@@ -167,7 +178,7 @@ try {
|
|
|
167
178
|
return it && it.type
|
|
168
179
|
}
|
|
169
180
|
const idValueFor = (opname: string): string => (null != dataIdF && opnames.includes('create'))
|
|
170
|
-
? `created['${dataIdF}']`
|
|
181
|
+
? `created.data()['${dataIdF}']`
|
|
171
182
|
: dartLit(idParamType(opname), 'example_id')
|
|
172
183
|
|
|
173
184
|
if (opnames.includes('create') || opnames.includes('update') || opnames.includes('remove')) {
|
|
@@ -176,7 +187,7 @@ try {
|
|
|
176
187
|
\`\`\`dart
|
|
177
188
|
`)
|
|
178
189
|
if (opnames.includes('create')) {
|
|
179
|
-
Content(`// Create — returns the
|
|
190
|
+
Content(`// Create — returns the ENTITY (call data() for the record)
|
|
180
191
|
final created = await client.${eName}().create({${examplePairs('create').join(', ')}});
|
|
181
192
|
|
|
182
193
|
`)
|
|
@@ -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,
|
|
@@ -23,6 +23,17 @@ function dartLit(type: any, placeholder: string = 'example'): string {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
// A `list()` on a NESTED entity needs its parent path params. The
|
|
27
|
+
// quickstart used to emit `client.Moon().list()` for an entity at
|
|
28
|
+
// `/planet/{planet_id}/moon`, which 404s against a live server from a
|
|
29
|
+
// half-built URL — indistinguishable from "no such record". The model
|
|
30
|
+
// already marks those params `reqd: true`; matchArg renders exactly them.
|
|
31
|
+
function listMatchArg(ent: any): string {
|
|
32
|
+
const idF = entityIdField(ent)
|
|
33
|
+
return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
26
37
|
const OP_SIGNATURES: Record<string, { sig: string, returns: string, desc: string }> = {
|
|
27
38
|
load: {
|
|
28
39
|
sig: 'load(reqmatch, [ctrl]) -> Future<dynamic>',
|
|
@@ -268,7 +279,7 @@ final result = await client.${ent.Name}().${opname}(${arg});
|
|
|
268
279
|
}
|
|
269
280
|
else if ('list' === opname) {
|
|
270
281
|
Content(`\`\`\`dart
|
|
271
|
-
final results = await client.${ent.Name}().list();
|
|
282
|
+
final results = await client.${ent.Name}().list(${listMatchArg(ent)});
|
|
272
283
|
for (final ${eVar} in results) {
|
|
273
284
|
print(${eVar}.data());
|
|
274
285
|
}
|
|
@@ -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,
|
|
@@ -23,6 +23,17 @@ function dartLit(type: any, placeholder: string = 'example'): string {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
// A `list()` on a NESTED entity needs its parent path params. The
|
|
27
|
+
// quickstart used to emit `client.Moon().list()` for an entity at
|
|
28
|
+
// `/planet/{planet_id}/moon`, which 404s against a live server from a
|
|
29
|
+
// half-built URL — indistinguishable from "no such record". The model
|
|
30
|
+
// already marks those params `reqd: true`; matchArg renders exactly them.
|
|
31
|
+
function listMatchArg(ent: any): string {
|
|
32
|
+
const idF = entityIdField(ent)
|
|
33
|
+
return matchArg('ts', ent, 'list', idF, idLiteral(ent, 'list', idF))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
26
37
|
const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
27
38
|
const { target, ctx$: { model } } = props
|
|
28
39
|
|
|
@@ -55,7 +66,7 @@ Future<void> main() async {
|
|
|
55
66
|
|
|
56
67
|
if (opnames.includes('list')) {
|
|
57
68
|
Content(` // List all ${eName.toLowerCase()}s (returns a list of entities, throws on error)
|
|
58
|
-
final ${eVar}s = await client.${eName}().list();
|
|
69
|
+
final ${eVar}s = await client.${eName}().list(${listMatchArg(exampleEntity)});
|
|
59
70
|
for (final item in ${eVar}s) {
|
|
60
71
|
print(item.data());
|
|
61
72
|
}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
Slot,
|
|
17
17
|
cmp,
|
|
18
18
|
snakify,
|
|
19
|
-
isAuthActive,
|
|
19
|
+
isAuthActive, envName, envToken
|
|
20
20
|
} from '@voxgig/sdkgen'
|
|
21
21
|
|
|
22
22
|
|
|
@@ -35,8 +35,8 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
35
35
|
|
|
36
36
|
const ff = projectPath('src/cmp/dart/fragment/')
|
|
37
37
|
|
|
38
|
-
const PROJECTNAME =
|
|
39
|
-
const entidEnvVar = `${PROJECTNAME}_TEST_${
|
|
38
|
+
const PROJECTNAME = envName(model)
|
|
39
|
+
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
40
40
|
|
|
41
41
|
const authActive = isAuthActive(model)
|
|
42
42
|
const apikeyEnvEntry = authActive
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
Slot,
|
|
24
24
|
cmp,
|
|
25
25
|
each,
|
|
26
|
-
isAuthActive,
|
|
26
|
+
isAuthActive, envName, envToken
|
|
27
27
|
} from '@voxgig/sdkgen'
|
|
28
28
|
|
|
29
29
|
|
|
@@ -50,8 +50,8 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
50
50
|
|
|
51
51
|
const entity: ModelEntity = props.entity
|
|
52
52
|
|
|
53
|
-
const PROJENVNAME =
|
|
54
|
-
const ENTENVNAME =
|
|
53
|
+
const PROJENVNAME = envName(model)
|
|
54
|
+
const ENTENVNAME = envToken(entity.name)
|
|
55
55
|
const authActive = isAuthActive(model)
|
|
56
56
|
const apikeyEnvEntry = authActive
|
|
57
57
|
? `\n '${PROJENVNAME}_APIKEY': 'NONE',`
|
|
@@ -333,7 +333,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
333
333
|
const hasEntIdC = null != entity.id
|
|
334
334
|
|
|
335
335
|
Content(`
|
|
336
|
-
${datavar} = await ${entvar}.create(${datavar});
|
|
336
|
+
${datavar} = (await ${entvar}.create(${datavar})).data();
|
|
337
337
|
`)
|
|
338
338
|
if (hasEntIdC) {
|
|
339
339
|
Content(` ok(null != ${datavar}['id']);
|
|
@@ -373,7 +373,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
373
373
|
})
|
|
374
374
|
|
|
375
375
|
Content(`
|
|
376
|
-
final ${listvar} = await ${entvar}.list(${matchvar});
|
|
376
|
+
final ${listvar} = (await ${entvar}.list(${matchvar})).map((e) => e.data()).toList();
|
|
377
377
|
`)
|
|
378
378
|
const allSteps = flow.step
|
|
379
379
|
for (let vI = 0; vI < step.valid.length; vI++) {
|
|
@@ -460,7 +460,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
460
460
|
}
|
|
461
461
|
|
|
462
462
|
Content(`
|
|
463
|
-
final ${resdatavar} = await ${entvar}.update(${updvar});
|
|
463
|
+
final ${resdatavar} = (await ${entvar}.update(${updvar})).data();
|
|
464
464
|
`)
|
|
465
465
|
if (hasEntIdU) {
|
|
466
466
|
Content(` ok(${resdatavar}['id'] == ${updvar}['id']);
|
|
@@ -550,13 +550,13 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
550
550
|
if (hasEntId) {
|
|
551
551
|
Content(` final ${matchvar} = <String, dynamic>{};
|
|
552
552
|
${matchvar}['id'] = ${srcdatavar}['id'];
|
|
553
|
-
final ${datavar} = await ${entvar}.load(${matchvar});
|
|
553
|
+
final ${datavar} = (await ${entvar}.load(${matchvar})).data();
|
|
554
554
|
ok(${datavar}['id'] == ${srcdatavar}['id']);
|
|
555
555
|
`)
|
|
556
556
|
}
|
|
557
557
|
else {
|
|
558
558
|
Content(` final ${matchvar} = <String, dynamic>{};
|
|
559
|
-
final ${datavar} = await ${entvar}.load(${matchvar});
|
|
559
|
+
final ${datavar} = (await ${entvar}.load(${matchvar})).data();
|
|
560
560
|
ok(null != ${datavar});
|
|
561
561
|
`)
|
|
562
562
|
}
|