@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
|
@@ -43,6 +43,18 @@ class ProjectNameEntityBase {
|
|
|
43
43
|
featureHook(entctx, 'PostConstructEntity');
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// Every operation resolves to the entity; `remove` additionally marks
|
|
47
|
+
// it. The instance KEEPS the data it held — a caller can still read what
|
|
48
|
+
// was deleted — but it is no longer a live record. See AGENTS.md.
|
|
49
|
+
bool _deleted = false;
|
|
50
|
+
|
|
51
|
+
void markDeleted() {
|
|
52
|
+
_deleted = true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
bool deleted() => _deleted;
|
|
56
|
+
|
|
57
|
+
|
|
46
58
|
dynamic entopts() {
|
|
47
59
|
return utility.struct.merge([{}, entoptsMap]);
|
|
48
60
|
}
|
|
@@ -235,7 +247,12 @@ class ProjectNameEntityBase {
|
|
|
235
247
|
if (d is Map) {
|
|
236
248
|
d.forEach((k, v) => out[k.toString()] = v);
|
|
237
249
|
}
|
|
238
|
-
|
|
250
|
+
// The marker is NAMESPACED. It used to be `entity$` — a short, generic
|
|
251
|
+
// name, and the `$`-suffix convention is not unique to sdkgen. Seneca uses
|
|
252
|
+
// `entity$` on its own entities to hold the canon, so an SDK record fed
|
|
253
|
+
// into `entize` silently overwrote it and produced entities claiming a
|
|
254
|
+
// canon that does not exist: no error, just wrong entities.
|
|
255
|
+
out[r'voxgig$entity'] = Name;
|
|
239
256
|
return out;
|
|
240
257
|
}
|
|
241
258
|
|
|
@@ -72,7 +72,15 @@
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
final out = done(ctx);
|
|
76
|
+
|
|
77
|
+
// An operation resolves to the ENTITY, not the raw data — the record
|
|
78
|
+
// has just been absorbed into this instance and is reached through
|
|
79
|
+
// data(). `done` still runs: it completes the pipeline and raises on
|
|
80
|
+
// failure, and when throwing is disabled it hands back the error
|
|
81
|
+
// payload, which passes through unchanged. See AGENTS.md "Entity
|
|
82
|
+
// operations return ENTITIES".
|
|
83
|
+
return (null != ctx.result && true == ctx.result.ok) ? this : out;
|
|
76
84
|
} catch (err) {
|
|
77
85
|
// #PreUnexpected-Hook
|
|
78
86
|
|
|
@@ -76,7 +76,15 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
final out = done(ctx);
|
|
80
|
+
|
|
81
|
+
// An operation resolves to the ENTITY, not the raw data — the record
|
|
82
|
+
// has just been absorbed into this instance and is reached through
|
|
83
|
+
// data(). `done` still runs: it completes the pipeline and raises on
|
|
84
|
+
// failure, and when throwing is disabled it hands back the error
|
|
85
|
+
// payload, which passes through unchanged. See AGENTS.md "Entity
|
|
86
|
+
// operations return ENTITIES".
|
|
87
|
+
return (null != ctx.result && true == ctx.result.ok) ? this : out;
|
|
80
88
|
} catch (err) {
|
|
81
89
|
// #PreUnexpected-Hook
|
|
82
90
|
|
|
@@ -76,7 +76,21 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
final out = done(ctx);
|
|
80
|
+
|
|
81
|
+
// An operation resolves to the ENTITY, not the raw data — the record
|
|
82
|
+
// has just been absorbed into this instance and is reached through
|
|
83
|
+
// data(). `done` still runs: it completes the pipeline and raises on
|
|
84
|
+
// failure, and when throwing is disabled it hands back the error
|
|
85
|
+
// payload, which passes through unchanged. See AGENTS.md "Entity
|
|
86
|
+
// operations return ENTITIES".
|
|
87
|
+
if (null != ctx.result && true == ctx.result.ok) {
|
|
88
|
+
// A removed entity keeps its data but is no longer a live record.
|
|
89
|
+
markDeleted();
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return out;
|
|
80
94
|
} catch (err) {
|
|
81
95
|
// #PreUnexpected-Hook
|
|
82
96
|
|
|
@@ -76,7 +76,15 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
final out = done(ctx);
|
|
80
|
+
|
|
81
|
+
// An operation resolves to the ENTITY, not the raw data — the record
|
|
82
|
+
// has just been absorbed into this instance and is reached through
|
|
83
|
+
// data(). `done` still runs: it completes the pipeline and raises on
|
|
84
|
+
// failure, and when throwing is disabled it hands back the error
|
|
85
|
+
// payload, which passes through unchanged. See AGENTS.md "Entity
|
|
86
|
+
// operations return ENTITIES".
|
|
87
|
+
return (null != ctx.result && true == ctx.result.ok) ? this : out;
|
|
80
88
|
} catch (err) {
|
|
81
89
|
// #PreUnexpected-Hook
|
|
82
90
|
|
|
@@ -11,6 +11,14 @@ class ProjectNameError extends Error {
|
|
|
11
11
|
dynamic result;
|
|
12
12
|
dynamic spec;
|
|
13
13
|
|
|
14
|
+
// HTTP status of the response that caused this error, or -1 when the
|
|
15
|
+
// request never got one. PROMOTED to the top level: it used to be
|
|
16
|
+
// reachable only at `err.result['status']`, so every consumer coupled
|
|
17
|
+
// itself to the internal shape of `result`.
|
|
18
|
+
int status = -1;
|
|
19
|
+
|
|
20
|
+
bool get notFound => 404 == status;
|
|
21
|
+
|
|
14
22
|
ProjectNameError(this.code, this.message, [this.ctx]);
|
|
15
23
|
|
|
16
24
|
@override
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
cmp,
|
|
6
6
|
pkgDescription,
|
|
7
7
|
repoInfo,
|
|
8
|
+
packageVersion,
|
|
8
9
|
} from '@voxgig/sdkgen'
|
|
9
10
|
|
|
10
11
|
|
|
@@ -17,6 +18,7 @@ import type {
|
|
|
17
18
|
// third-party runtime deps, so the SDK ships with none either.
|
|
18
19
|
const Package = cmp(async function Package(props: any) {
|
|
19
20
|
const ctx$ = props.ctx$
|
|
21
|
+
const target = props.target
|
|
20
22
|
const model: Model = ctx$.model
|
|
21
23
|
|
|
22
24
|
const Name = model.const.Name
|
|
@@ -32,7 +34,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
32
34
|
def project do
|
|
33
35
|
[
|
|
34
36
|
app: :${app},
|
|
35
|
-
version: "
|
|
37
|
+
version: "${packageVersion(model, target.name)}",
|
|
36
38
|
elixir: "~> 1.14",
|
|
37
39
|
description: ${JSON.stringify(pkgDescription(model, 'elixir'))},
|
|
38
40
|
elixirc_paths: elixirc_paths(Mix.env()),
|
|
@@ -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
|
|
|
5
5
|
const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
|
|
@@ -16,7 +16,7 @@ const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
|
|
|
16
16
|
\`\`\`elixir
|
|
17
17
|
def deps do
|
|
18
18
|
[
|
|
19
|
-
{:${app}, "~>
|
|
19
|
+
{:${app}, "~> ${packageVersion(model, target.name)}"}
|
|
20
20
|
]
|
|
21
21
|
end
|
|
22
22
|
\`\`\`
|
|
@@ -70,8 +70,15 @@ defmodule ${Name}.${EName}EntityTest do
|
|
|
70
70
|
test "should list records" do
|
|
71
71
|
sdk = mk_sdk()
|
|
72
72
|
ent = ${Name}.${ename}(sdk)
|
|
73
|
+
# The op resolves to one ENTITY per record; the record is reached with
|
|
74
|
+
# data_get. See AGENTS.md "Entity operations return ENTITIES".
|
|
73
75
|
result = ${Name}.Entity.${EName}.list(ent, S.jm([]))
|
|
74
76
|
assert S.islist(result)
|
|
77
|
+
if S.size(result) > 0 do
|
|
78
|
+
Enum.each(0..(S.size(result) - 1), fn i ->
|
|
79
|
+
assert S.ismap(${Name}.EntityBase.data_get(S.getelem(result, i)))
|
|
80
|
+
end)
|
|
81
|
+
end
|
|
75
82
|
end
|
|
76
83
|
`)
|
|
77
84
|
}
|
|
@@ -84,7 +91,8 @@ defmodule ${Name}.${EName}EntityTest do
|
|
|
84
91
|
if id != nil do
|
|
85
92
|
sdk = mk_sdk()
|
|
86
93
|
ent = ${Name}.${ename}(sdk)
|
|
87
|
-
|
|
94
|
+
loaded = ${Name}.Entity.${EName}.load(ent, S.jm(["id", id]))
|
|
95
|
+
rec = ${Name}.EntityBase.data_get(loaded)
|
|
88
96
|
assert S.ismap(rec)
|
|
89
97
|
assert S.getprop(rec, "id") == id
|
|
90
98
|
end
|
|
@@ -97,7 +105,8 @@ defmodule ${Name}.${EName}EntityTest do
|
|
|
97
105
|
test "should create then read back" do
|
|
98
106
|
sdk = ${Name}.test(S.jm(["entity", S.jm(["${ename}", S.jm([])])]))
|
|
99
107
|
ent = ${Name}.${ename}(sdk)
|
|
100
|
-
|
|
108
|
+
created = ${Name}.Entity.${EName}.create(ent, S.jm(["name", "test-create"]))
|
|
109
|
+
made = ${Name}.EntityBase.data_get(created)
|
|
101
110
|
assert S.ismap(made)
|
|
102
111
|
assert S.getprop(made, "id") != nil
|
|
103
112
|
end
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
Pipeline.run_op(ctx, post_done)
|
|
33
|
+
out = Pipeline.run_op(ctx, post_done)
|
|
34
|
+
ent = EntityBase.op_return(ent, ctx, out)
|
|
35
|
+
# A removed entity keeps its data but is no longer a live record.
|
|
36
|
+
if ent == out, do: out, else: EntityBase.mark_deleted(ent)
|
|
34
37
|
end
|
|
35
38
|
|
|
36
39
|
# EJECT-END
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
import {
|
|
30
30
|
cmp, each,
|
|
31
|
-
File, Content, Folder,
|
|
31
|
+
File, Content, Folder, goModule
|
|
32
32
|
} from '@voxgig/sdkgen'
|
|
33
33
|
|
|
34
34
|
import { canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions , deriveEntityNames } from '@voxgig/sdkgen'
|
|
@@ -165,6 +165,10 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
165
165
|
const { target } = props
|
|
166
166
|
const { model, log } = props.ctx$
|
|
167
167
|
|
|
168
|
+
// This file is GENERATED, not templated, so the GOMODULE placeholder is
|
|
169
|
+
// never substituted for it — the module path has to be interpolated.
|
|
170
|
+
const gomodule = goModule(model, 'go')
|
|
171
|
+
|
|
168
172
|
// only_active:false — getModelPath DROPS active:false entries by default,
|
|
169
173
|
// but the consumer scaffold (create-sdkgen Root.ts) iterates the RAW entity
|
|
170
174
|
// collection, so inactive entities still get generated entity code that
|
|
@@ -196,7 +200,11 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
196
200
|
// @voxgig/apidef VALID_CANON). Do not edit by hand.
|
|
197
201
|
package entity
|
|
198
202
|
|
|
199
|
-
import
|
|
203
|
+
import (
|
|
204
|
+
"encoding/json"
|
|
205
|
+
|
|
206
|
+
"${gomodule}/core"
|
|
207
|
+
)
|
|
200
208
|
|
|
201
209
|
`)
|
|
202
210
|
|
|
@@ -262,12 +270,26 @@ func asMap(v any) map[string]any {
|
|
|
262
270
|
return out
|
|
263
271
|
}
|
|
264
272
|
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
//
|
|
268
|
-
//
|
|
273
|
+
// entityData unwraps an entity to its data map.
|
|
274
|
+
//
|
|
275
|
+
// Operations resolve to the ENTITY, not the raw data (see AGENTS.md), and an
|
|
276
|
+
// entity's fields are UNEXPORTED — marshalling one directly yields \`{}\`, so
|
|
277
|
+
// every typed accessor would silently hand back a zero-valued struct. The
|
|
278
|
+
// typed boundary therefore takes the data hop first.
|
|
279
|
+
func entityData(v any) any {
|
|
280
|
+
if ent, ok := v.(core.Entity); ok {
|
|
281
|
+
return ent.Data()
|
|
282
|
+
}
|
|
283
|
+
return v
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// typedFrom decodes a runtime value (an entity, or the map[string]any the op
|
|
287
|
+
// pipeline produced) into a typed model T via a JSON round-trip. On any error
|
|
288
|
+
// it returns the zero value of T; the op's own (value, error) tuple carries
|
|
289
|
+
// the real error.
|
|
269
290
|
func typedFrom[T any](v any) T {
|
|
270
291
|
var out T
|
|
292
|
+
v = entityData(v)
|
|
271
293
|
if v == nil {
|
|
272
294
|
return out
|
|
273
295
|
}
|
|
@@ -279,13 +301,21 @@ func typedFrom[T any](v any) T {
|
|
|
279
301
|
return out
|
|
280
302
|
}
|
|
281
303
|
|
|
282
|
-
// typedSliceFrom decodes a runtime list value
|
|
283
|
-
//
|
|
304
|
+
// typedSliceFrom decodes a runtime list value into a typed slice []T via a
|
|
305
|
+
// JSON round-trip, for list ops. \`list\` resolves to a slice of ENTITY
|
|
306
|
+
// instances, so each element takes the data hop.
|
|
284
307
|
func typedSliceFrom[T any](v any) []T {
|
|
285
308
|
var out []T
|
|
286
309
|
if v == nil {
|
|
287
310
|
return out
|
|
288
311
|
}
|
|
312
|
+
if list, ok := v.([]any); ok {
|
|
313
|
+
unwrapped := make([]any, 0, len(list))
|
|
314
|
+
for _, item := range list {
|
|
315
|
+
unwrapped = append(unwrapped, entityData(item))
|
|
316
|
+
}
|
|
317
|
+
v = unwrapped
|
|
318
|
+
}
|
|
289
319
|
b, err := json.Marshal(v)
|
|
290
320
|
if err != nil {
|
|
291
321
|
return out
|
|
@@ -4,7 +4,7 @@ import * as Path from 'node:path'
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, each, camelify, names,
|
|
6
6
|
File, Content, Folder, Fragment, Line, FeatureHook, Slot,
|
|
7
|
-
entityClassName, entityCollection,
|
|
7
|
+
entityClassName, entityCollection, goModule
|
|
8
8
|
} from '@voxgig/sdkgen'
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -21,7 +21,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
21
21
|
|
|
22
22
|
// Module name: concatenated lowercase
|
|
23
23
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
24
|
-
const gomodule =
|
|
24
|
+
const gomodule = goModule(model, 'go')
|
|
25
25
|
|
|
26
26
|
// Collision-free entity CLASS name (see entityClassName): normally
|
|
27
27
|
// `<Name>Entity`, but disambiguated (e.g. `<Name>EntityClient`) when it would
|
|
@@ -4,7 +4,7 @@ import * as Path from 'node:path'
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, each, names, cmap,
|
|
6
6
|
List, File, Content, Copy, Folder, Fragment, Line, FeatureHook,
|
|
7
|
-
entityClassName, entityCollection,
|
|
7
|
+
entityClassName, entityCollection, goModule, goPackageIdent
|
|
8
8
|
} from '@voxgig/sdkgen'
|
|
9
9
|
|
|
10
10
|
|
|
@@ -37,11 +37,10 @@ const Main = cmp(async function Main(props: any) {
|
|
|
37
37
|
|
|
38
38
|
// Go module path == the repo path on GitHub (org from model.origin),
|
|
39
39
|
// e.g. github.com/voxgig-sdk/<slug>-sdk. Used in go.mod and every import.
|
|
40
|
-
const gomodule =
|
|
40
|
+
const gomodule = goModule(model, 'go')
|
|
41
41
|
// The root package name must be a plain Go identifier (can't be a path),
|
|
42
|
-
// so it stays
|
|
43
|
-
const gopackage = (model
|
|
44
|
-
model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
42
|
+
// so it stays a concatenated-lowercase form (e.g. voxgigdogsdk).
|
|
43
|
+
const gopackage = goPackageIdent(model, 'go')
|
|
45
44
|
|
|
46
45
|
Package({ target })
|
|
47
46
|
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Content,
|
|
4
4
|
File,
|
|
5
5
|
cmp,
|
|
6
|
-
collectDeps,
|
|
6
|
+
collectDeps, goModule, goVersion
|
|
7
7
|
} from '@voxgig/sdkgen'
|
|
8
8
|
|
|
9
9
|
|
|
@@ -18,14 +18,17 @@ const Package = cmp(async function Package(props: any) {
|
|
|
18
18
|
|
|
19
19
|
const model: Model = ctx$.model
|
|
20
20
|
|
|
21
|
-
// Module
|
|
22
|
-
//
|
|
23
|
-
|
|
21
|
+
// Module path and language version both come from the model — see
|
|
22
|
+
// goModule / goVersion. Neither is derivable from the slug alone: the repo
|
|
23
|
+
// may not be named `<slug>-sdk`, and the hardcoded `go 1.20` this used to
|
|
24
|
+
// emit could not compile sdkgen's own `log` feature (it imports log/slog,
|
|
25
|
+
// which needs 1.21).
|
|
26
|
+
const gomodule = goModule(model, 'go')
|
|
24
27
|
|
|
25
28
|
File({ name: 'go.mod' }, () => {
|
|
26
29
|
Content(`module ${gomodule}
|
|
27
30
|
|
|
28
|
-
go
|
|
31
|
+
go ${goVersion(model, target.name)}
|
|
29
32
|
|
|
30
33
|
`)
|
|
31
34
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, goModule } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
|
|
6
6
|
const { target, ctx$: { model } } = props
|
|
7
7
|
|
|
8
8
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
9
|
-
const gomodule =
|
|
9
|
+
const gomodule = goModule(model, 'go')
|
|
10
10
|
|
|
11
11
|
Content(`### Data as maps
|
|
12
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, canonKey, entityIdField, pickExampleEntity, opRequestShape, goModule } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -29,7 +29,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
29
29
|
const { target, ctx$: { model } } = props
|
|
30
30
|
|
|
31
31
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
32
|
-
const gomodule =
|
|
32
|
+
const gomodule = goModule(model, 'go')
|
|
33
33
|
|
|
34
34
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
35
35
|
// Pick an entity with a real op (prefer a read op) — never fabricate a
|
|
@@ -8,7 +8,9 @@ const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
|
|
|
8
8
|
|
|
9
9
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
10
10
|
const gomodule = packageName(model, 'go')
|
|
11
|
-
|
|
11
|
+
// `repo` is the directory a `git clone` of this project creates — not
|
|
12
|
+
// `<slug>-sdk`, which is only the DEFAULT repo name.
|
|
13
|
+
const { releasesUrl, repo } = repoInfo(model)
|
|
12
14
|
|
|
13
15
|
Content(`\`\`\`bash
|
|
14
16
|
go get ${gomodule}@latest
|
|
@@ -22,7 +24,7 @@ project and add a \`replace\` directive pointing at the checked-out
|
|
|
22
24
|
\`go/\` directory:
|
|
23
25
|
|
|
24
26
|
\`\`\`bash
|
|
25
|
-
go mod edit -replace ${gomodule}=../${
|
|
27
|
+
go mod edit -replace ${gomodule}=../${repo}/go
|
|
26
28
|
\`\`\`
|
|
27
29
|
|
|
28
30
|
`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, each, Content, isAuthActive, entityIdField, entityPrimaryOp } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, each, Content, isAuthActive, entityIdField, entityPrimaryOp, goModule } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -44,7 +44,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
44
44
|
const resultShapeRows = resultRows.join('\n')
|
|
45
45
|
|
|
46
46
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
47
|
-
const gomodule =
|
|
47
|
+
const gomodule = goModule(model, 'go')
|
|
48
48
|
|
|
49
49
|
const apikeyOptionRow = isAuthActive(model)
|
|
50
50
|
? '| `"apikey"` | `string` | API key for authentication. |\n'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, opRequestShape, entityIdField, entityOps } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, opRequestShape, entityIdField, entityOps, goModule } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -20,7 +20,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
20
20
|
|
|
21
21
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
22
22
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
23
|
-
const gomodule =
|
|
23
|
+
const gomodule = goModule(model, 'go')
|
|
24
24
|
|
|
25
25
|
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
26
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, isAuthActive, envName, entityIdField, entityOps, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, isAuthActive, envName, entityIdField, entityOps, opRequestShape, goModule } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -15,7 +15,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
15
15
|
|
|
16
16
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
17
17
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
18
|
-
const gomodule =
|
|
18
|
+
const gomodule = goModule(model, 'go')
|
|
19
19
|
|
|
20
20
|
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
21
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, canonKey, entityIdField, pickExampleEntity, opRequestShape } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, canonKey, entityIdField, pickExampleEntity, opRequestShape, goModule } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -28,7 +28,7 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
28
28
|
|
|
29
29
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
30
30
|
// Go module path == repo path on GitHub (org from model.origin).
|
|
31
|
-
const gomodule =
|
|
31
|
+
const gomodule = goModule(model, 'go')
|
|
32
32
|
|
|
33
33
|
// Pick an entity with a real op (prefer a read op) — never fabricate a
|
|
34
34
|
// `load` on an op-less entity like Cloudsmith's `Abort`.
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
File,
|
|
12
12
|
cmp,
|
|
13
13
|
snakify,
|
|
14
|
-
isAuthActive,
|
|
14
|
+
isAuthActive, envName, envToken, liveStrict
|
|
15
15
|
} from '@voxgig/sdkgen'
|
|
16
16
|
|
|
17
17
|
|
|
@@ -65,7 +65,11 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
65
65
|
const entity: ModelEntity = props.entity
|
|
66
66
|
const gomodule = props.gomodule
|
|
67
67
|
|
|
68
|
-
const PROJECTNAME =
|
|
68
|
+
const PROJECTNAME = envName(model)
|
|
69
|
+
|
|
70
|
+
// Does a live run ASSERT, or merely observe? See helpers/testPolicy.
|
|
71
|
+
// t.Skipf passes; t.Fatalf does not.
|
|
72
|
+
const liveFail = liveStrict(model, target.name) ? 'Fatalf' : 'Skipf'
|
|
69
73
|
|
|
70
74
|
const authActive = isAuthActive(model)
|
|
71
75
|
const apikeyEnvEntry = authActive
|
|
@@ -146,7 +150,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
146
150
|
: ''
|
|
147
151
|
|
|
148
152
|
// Build the ENTID env var name for this entity
|
|
149
|
-
const entidEnvVar = `${PROJECTNAME}_TEST_${
|
|
153
|
+
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
150
154
|
|
|
151
155
|
File({ name: entity.name + '_direct_test.' + target.ext }, () => {
|
|
152
156
|
|
|
@@ -254,18 +258,19 @@ ${listSkipBlock} client := setup.client
|
|
|
254
258
|
}
|
|
255
259
|
|
|
256
260
|
Content(` if setup.live {
|
|
257
|
-
// Live
|
|
258
|
-
//
|
|
259
|
-
//
|
|
261
|
+
// Live-mode leniency is a model decision
|
|
262
|
+
// (main.kit.test.live.strict): synthetic IDs 4xx constantly
|
|
263
|
+
// against an arbitrary public API, so the default SKIPS here.
|
|
264
|
+
// A project that owns its test server sets strict and FAILS.
|
|
260
265
|
if err != nil {
|
|
261
|
-
t
|
|
266
|
+
t.${liveFail}("list call failed (likely synthetic IDs against live API): %v", err)
|
|
262
267
|
}
|
|
263
268
|
if result["ok"] != true {
|
|
264
|
-
t
|
|
269
|
+
t.${liveFail}("list call not ok (likely synthetic IDs against live API): %v", result)
|
|
265
270
|
}
|
|
266
271
|
status := core.ToInt(result["status"])
|
|
267
272
|
if status < 200 || status >= 300 {
|
|
268
|
-
t
|
|
273
|
+
t.${liveFail}("expected 2xx status, got %v", result["status"])
|
|
269
274
|
}
|
|
270
275
|
} else {
|
|
271
276
|
if err != nil {
|
|
@@ -413,10 +418,10 @@ ${loadSkipBlock} client := setup.client
|
|
|
413
418
|
"params": listParams,
|
|
414
419
|
})
|
|
415
420
|
if listErr != nil {
|
|
416
|
-
t
|
|
421
|
+
t.${liveFail}("list call failed (likely synthetic IDs against live API): %v", listErr)
|
|
417
422
|
}
|
|
418
423
|
if listResult["ok"] != true {
|
|
419
|
-
t
|
|
424
|
+
t.${liveFail}("list call not ok (likely synthetic IDs against live API): %v", listResult)
|
|
420
425
|
}
|
|
421
426
|
|
|
422
427
|
// Get first entity ID from list
|
|
@@ -468,16 +473,17 @@ ${loadSkipBlock} client := setup.client
|
|
|
468
473
|
if setup.live {
|
|
469
474
|
// Live mode is lenient: synthetic IDs frequently 4xx. Skip
|
|
470
475
|
// rather than fail when the load endpoint isn't reachable with
|
|
471
|
-
// the IDs we can construct from setup.idmap
|
|
476
|
+
// the IDs we can construct from setup.idmap — unless the model
|
|
477
|
+
// sets main.kit.test.live.strict.
|
|
472
478
|
if err != nil {
|
|
473
|
-
t
|
|
479
|
+
t.${liveFail}("load call failed (likely synthetic IDs against live API): %v", err)
|
|
474
480
|
}
|
|
475
481
|
if result["ok"] != true {
|
|
476
|
-
t
|
|
482
|
+
t.${liveFail}("load call not ok (likely synthetic IDs against live API): %v", result)
|
|
477
483
|
}
|
|
478
484
|
status := core.ToInt(result["status"])
|
|
479
485
|
if status < 200 || status >= 300 {
|
|
480
|
-
t
|
|
486
|
+
t.${liveFail}("expected 2xx status, got %v", result["status"])
|
|
481
487
|
}
|
|
482
488
|
} else {
|
|
483
489
|
if err != nil {
|