@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
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
package sdktest
|
|
2
|
+
|
|
3
|
+
// Offline feature-test harness: a faithful miniature of the real operation
|
|
4
|
+
// pipeline (same hook order and short-circuit rules as the generated
|
|
5
|
+
// Entity*Op code) driven against a configurable mock transport, with no
|
|
6
|
+
// live server and no API-specific fixtures.
|
|
7
|
+
//
|
|
8
|
+
// SEPARATE FROM feature_test.go ON PURPOSE. `target add` drops the
|
|
9
|
+
// cross-feature suite when a project trims its feature set (it constructs
|
|
10
|
+
// every shipped feature by name), but pipeline_test.go and friends use
|
|
11
|
+
// these fh* helpers too — leaving them in feature_test.go took the whole
|
|
12
|
+
// test package down with it.
|
|
13
|
+
|
|
14
|
+
import (
|
|
15
|
+
"fmt"
|
|
16
|
+
neturl "net/url"
|
|
17
|
+
"sort"
|
|
18
|
+
"strings"
|
|
19
|
+
"testing"
|
|
20
|
+
|
|
21
|
+
sdk "GOMODULE"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// --- harness ----------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
// fhHasFeature is true when this SDK was generated with the named feature.
|
|
27
|
+
func fhHasFeature(name string) bool {
|
|
28
|
+
config := sdk.MakeConfig()
|
|
29
|
+
fm, _ := config["feature"].(map[string]any)
|
|
30
|
+
return fm != nil && fm[name] != nil
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
func fhSkipWithout(t *testing.T, names ...string) {
|
|
34
|
+
t.Helper()
|
|
35
|
+
for _, name := range names {
|
|
36
|
+
if !fhHasFeature(name) {
|
|
37
|
+
t.Skip("feature not present in this SDK: " + name)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// fhClock is a deterministic virtual clock: now() advances only when
|
|
43
|
+
// sleep(ms) is called, so timing-based features can be asserted without
|
|
44
|
+
// real delays.
|
|
45
|
+
type fhClock struct {
|
|
46
|
+
t int64
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
func (c *fhClock) now() int64 { return c.t }
|
|
50
|
+
func (c *fhClock) sleep(ms int) { c.t += int64(ms) }
|
|
51
|
+
func (c *fhClock) advance(ms int) { c.t += int64(ms) }
|
|
52
|
+
|
|
53
|
+
// fhResponse builds a transport-shaped response the pipeline understands.
|
|
54
|
+
func fhResponse(status int, data any, headers map[string]any) map[string]any {
|
|
55
|
+
h := map[string]any{}
|
|
56
|
+
for k, v := range headers {
|
|
57
|
+
h[strings.ToLower(k)] = v
|
|
58
|
+
}
|
|
59
|
+
statusText := "OK"
|
|
60
|
+
if status >= 400 {
|
|
61
|
+
statusText = "ERR"
|
|
62
|
+
}
|
|
63
|
+
return map[string]any{
|
|
64
|
+
"status": status,
|
|
65
|
+
"statusText": statusText,
|
|
66
|
+
"body": "not-used",
|
|
67
|
+
"json": (func() any)(func() any { return data }),
|
|
68
|
+
"headers": h,
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// fhRecorder is a mock transport recording every call, replying via an
|
|
73
|
+
// optional reply func (default: 200 with a call counter).
|
|
74
|
+
type fhRecorder struct {
|
|
75
|
+
calls []map[string]any
|
|
76
|
+
reply func(n int, fetchdef map[string]any) (any, error)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
func (r *fhRecorder) fetch(ctx *sdk.Context, url string, fetchdef map[string]any) (any, error) {
|
|
80
|
+
r.calls = append(r.calls, map[string]any{"url": url, "fetchdef": fetchdef})
|
|
81
|
+
if r.reply != nil {
|
|
82
|
+
return r.reply(len(r.calls), fetchdef)
|
|
83
|
+
}
|
|
84
|
+
return fhResponse(200, map[string]any{"ok": true, "n": len(r.calls)}, nil), nil
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
func (r *fhRecorder) headers(i int) map[string]any {
|
|
88
|
+
fetchdef, _ := r.calls[i]["fetchdef"].(map[string]any)
|
|
89
|
+
headers, _ := fetchdef["headers"].(map[string]any)
|
|
90
|
+
return headers
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
func (r *fhRecorder) fetchdef(i int) map[string]any {
|
|
94
|
+
fetchdef, _ := r.calls[i]["fetchdef"].(map[string]any)
|
|
95
|
+
return fetchdef
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
func (r *fhRecorder) url(i int) string {
|
|
99
|
+
url, _ := r.calls[i]["url"].(string)
|
|
100
|
+
return url
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// fhFeature pairs a feature instance with its init options.
|
|
104
|
+
type fhFeature struct {
|
|
105
|
+
f sdk.Feature
|
|
106
|
+
options map[string]any
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
func fhF(f sdk.Feature, options map[string]any) fhFeature {
|
|
110
|
+
return fhFeature{f: f, options: options}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// fhHarness wires features (in init order) to a mock transport and a mini
|
|
114
|
+
// operation pipeline.
|
|
115
|
+
type fhHarness struct {
|
|
116
|
+
client *sdk.ProjectNameSDK
|
|
117
|
+
utility *sdk.Utility
|
|
118
|
+
rootctx *sdk.Context
|
|
119
|
+
base string
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// fhMake constructs the harness: a real (test-mode) client, an isolated
|
|
123
|
+
// utility whose fetcher is the mock server, and the requested features
|
|
124
|
+
// initialised against it. Fires PostConstruct once wiring is complete.
|
|
125
|
+
func fhMake(server sdk.FetcherFunc, features ...fhFeature) *fhHarness {
|
|
126
|
+
client := sdk.TestSDK(nil, nil)
|
|
127
|
+
client.Features = []sdk.Feature{}
|
|
128
|
+
|
|
129
|
+
utility := client.GetUtility()
|
|
130
|
+
if server == nil {
|
|
131
|
+
rec := &fhRecorder{}
|
|
132
|
+
server = rec.fetch
|
|
133
|
+
}
|
|
134
|
+
utility.Fetcher = server
|
|
135
|
+
|
|
136
|
+
rootctx := utility.MakeContext(map[string]any{
|
|
137
|
+
"client": client,
|
|
138
|
+
"utility": utility,
|
|
139
|
+
}, client.GetRootCtx())
|
|
140
|
+
|
|
141
|
+
for _, fs := range features {
|
|
142
|
+
fopts := map[string]any{"active": true}
|
|
143
|
+
for k, v := range fs.options {
|
|
144
|
+
fopts[k] = v
|
|
145
|
+
}
|
|
146
|
+
fs.f.Init(rootctx, fopts)
|
|
147
|
+
client.Features = append(client.Features, fs.f)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
utility.FeatureHook(rootctx, "PostConstruct")
|
|
151
|
+
|
|
152
|
+
return &fhHarness{
|
|
153
|
+
client: client,
|
|
154
|
+
utility: utility,
|
|
155
|
+
rootctx: rootctx,
|
|
156
|
+
base: "http://api.test",
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
type fhOpSpec struct {
|
|
161
|
+
entity string
|
|
162
|
+
op string
|
|
163
|
+
method string
|
|
164
|
+
path string
|
|
165
|
+
query map[string]any
|
|
166
|
+
headers map[string]any
|
|
167
|
+
body any
|
|
168
|
+
ctrl map[string]any
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
type fhOpResult struct {
|
|
172
|
+
ok bool
|
|
173
|
+
data any
|
|
174
|
+
err error
|
|
175
|
+
result *sdk.Result
|
|
176
|
+
ctx *sdk.Context
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
func fhDefaultMethod(op string) string {
|
|
180
|
+
switch op {
|
|
181
|
+
case "create":
|
|
182
|
+
return "POST"
|
|
183
|
+
case "update":
|
|
184
|
+
return "PATCH"
|
|
185
|
+
case "remove":
|
|
186
|
+
return "DELETE"
|
|
187
|
+
}
|
|
188
|
+
return "GET"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
func fhBuildUrl(spec *sdk.Spec) string {
|
|
192
|
+
var keys []string
|
|
193
|
+
for k, v := range spec.Query {
|
|
194
|
+
if v != nil {
|
|
195
|
+
keys = append(keys, k)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
sort.Strings(keys)
|
|
199
|
+
qs := ""
|
|
200
|
+
for _, k := range keys {
|
|
201
|
+
if qs != "" {
|
|
202
|
+
qs += "&"
|
|
203
|
+
}
|
|
204
|
+
qs += neturl.QueryEscape(k) + "=" + neturl.QueryEscape(fmt.Sprintf("%v", spec.Query[k]))
|
|
205
|
+
}
|
|
206
|
+
url := spec.Base + spec.Path
|
|
207
|
+
if qs != "" {
|
|
208
|
+
url += "?" + qs
|
|
209
|
+
}
|
|
210
|
+
return url
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// op runs one operation through the mini pipeline (mirrors the generated
|
|
214
|
+
// Entity*Op fragment: hook, short-circuit, make*, hook, ...).
|
|
215
|
+
func (h *fhHarness) op(o fhOpSpec) fhOpResult {
|
|
216
|
+
entity := o.entity
|
|
217
|
+
if entity == "" {
|
|
218
|
+
entity = "widget"
|
|
219
|
+
}
|
|
220
|
+
opname := o.op
|
|
221
|
+
if opname == "" {
|
|
222
|
+
opname = "load"
|
|
223
|
+
}
|
|
224
|
+
method := o.method
|
|
225
|
+
if method == "" {
|
|
226
|
+
method = fhDefaultMethod(opname)
|
|
227
|
+
}
|
|
228
|
+
ctrl := o.ctrl
|
|
229
|
+
if ctrl == nil {
|
|
230
|
+
ctrl = map[string]any{}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
ctx := h.utility.MakeContext(map[string]any{
|
|
234
|
+
"opname": opname,
|
|
235
|
+
"ctrl": ctrl,
|
|
236
|
+
}, h.rootctx)
|
|
237
|
+
ctx.Op = sdk.NewOperation(map[string]any{"entity": entity, "name": opname})
|
|
238
|
+
|
|
239
|
+
h.utility.FeatureHook(ctx, "PostConstructEntity")
|
|
240
|
+
|
|
241
|
+
h.utility.FeatureHook(ctx, "PrePoint")
|
|
242
|
+
if err, ok := ctx.Out["point"].(error); ok {
|
|
243
|
+
return h.fail(ctx, err)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
h.utility.FeatureHook(ctx, "PreSpec")
|
|
247
|
+
path := o.path
|
|
248
|
+
if path == "" {
|
|
249
|
+
path = "/" + entity
|
|
250
|
+
}
|
|
251
|
+
headers := map[string]any{}
|
|
252
|
+
for k, v := range o.headers {
|
|
253
|
+
headers[k] = v
|
|
254
|
+
}
|
|
255
|
+
query := map[string]any{}
|
|
256
|
+
for k, v := range o.query {
|
|
257
|
+
query[k] = v
|
|
258
|
+
}
|
|
259
|
+
ctx.Spec = sdk.NewSpec(map[string]any{
|
|
260
|
+
"method": method,
|
|
261
|
+
"base": h.base,
|
|
262
|
+
"path": path,
|
|
263
|
+
"headers": headers,
|
|
264
|
+
"query": query,
|
|
265
|
+
"step": "start",
|
|
266
|
+
})
|
|
267
|
+
if o.body != nil {
|
|
268
|
+
ctx.Spec.Body = o.body
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
h.utility.FeatureHook(ctx, "PreRequest")
|
|
272
|
+
ctx.Spec.Url = fhBuildUrl(ctx.Spec)
|
|
273
|
+
|
|
274
|
+
fetchdef := map[string]any{
|
|
275
|
+
"url": ctx.Spec.Url,
|
|
276
|
+
"method": ctx.Spec.Method,
|
|
277
|
+
"headers": ctx.Spec.Headers,
|
|
278
|
+
}
|
|
279
|
+
if ctx.Spec.Body != nil {
|
|
280
|
+
fetchdef["body"] = ctx.Spec.Body
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
var response any
|
|
284
|
+
var fetchErr error
|
|
285
|
+
if ctx.Out["request"] != nil {
|
|
286
|
+
response = ctx.Out["request"]
|
|
287
|
+
} else {
|
|
288
|
+
response, fetchErr = h.utility.Fetcher(ctx, ctx.Spec.Url, fetchdef)
|
|
289
|
+
}
|
|
290
|
+
if rm, ok := response.(map[string]any); ok {
|
|
291
|
+
ctx.Response = sdk.NewResponse(rm)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
h.utility.FeatureHook(ctx, "PreResponse")
|
|
295
|
+
fhPopulateResult(ctx, response, fetchErr)
|
|
296
|
+
h.utility.FeatureHook(ctx, "PreResult")
|
|
297
|
+
h.utility.FeatureHook(ctx, "PreDone")
|
|
298
|
+
|
|
299
|
+
if ctx.Result != nil && ctx.Result.Ok {
|
|
300
|
+
return fhOpResult{ok: true, data: ctx.Result.Resdata, result: ctx.Result, ctx: ctx}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
var err error
|
|
304
|
+
if ctx.Result != nil && ctx.Result.Err != nil {
|
|
305
|
+
err = ctx.Result.Err
|
|
306
|
+
} else {
|
|
307
|
+
err = ctx.MakeError("op_failed", "operation failed")
|
|
308
|
+
}
|
|
309
|
+
return h.fail(ctx, err)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
func (h *fhHarness) fail(ctx *sdk.Context, err error) fhOpResult {
|
|
313
|
+
ctx.Ctrl.Err = err
|
|
314
|
+
h.utility.FeatureHook(ctx, "PreUnexpected")
|
|
315
|
+
return fhOpResult{ok: false, err: err, result: ctx.Result, ctx: ctx}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
func fhPopulateResult(ctx *sdk.Context, response any, fetchErr error) {
|
|
319
|
+
result := sdk.NewResult(map[string]any{})
|
|
320
|
+
ctx.Result = result
|
|
321
|
+
|
|
322
|
+
if fetchErr != nil {
|
|
323
|
+
result.Err = fetchErr
|
|
324
|
+
return
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
rm, ok := response.(map[string]any)
|
|
328
|
+
if !ok || rm == nil {
|
|
329
|
+
result.Err = ctx.MakeError("request_no_response", "response: undefined")
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
resp := sdk.NewResponse(rm)
|
|
334
|
+
result.Status = resp.Status
|
|
335
|
+
result.StatusText = resp.StatusText
|
|
336
|
+
if hm, ok := resp.Headers.(map[string]any); ok {
|
|
337
|
+
result.Headers = hm
|
|
338
|
+
}
|
|
339
|
+
if resp.JsonFunc != nil {
|
|
340
|
+
result.Body = resp.JsonFunc()
|
|
341
|
+
}
|
|
342
|
+
result.Resdata = result.Body
|
|
343
|
+
|
|
344
|
+
if result.Status >= 400 {
|
|
345
|
+
result.Err = ctx.MakeError("request_status",
|
|
346
|
+
fmt.Sprintf("request: %d: %s", result.Status, result.StatusText))
|
|
347
|
+
} else if resp.Err != nil {
|
|
348
|
+
result.Err = resp.Err
|
|
349
|
+
}
|
|
350
|
+
if result.Err == nil {
|
|
351
|
+
result.Ok = true
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// fhErrCode extracts the SDK error code, "" otherwise.
|
|
356
|
+
func fhErrCode(err error) string {
|
|
357
|
+
if se, ok := err.(*sdk.ProjectNameError); ok {
|
|
358
|
+
return se.Code
|
|
359
|
+
}
|
|
360
|
+
return ""
|
|
361
|
+
}
|