@voxgig/sdkgen 4.8.2 → 4.9.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 +1 -1
- package/dist/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/model/target/zig.aon +9 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/src/cmp/zig/Package_zig.ts +15 -11
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +208 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +150 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +442 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +902 -0
- package/project/.sdk/tm/go/test/omni/util.go +381 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +628 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +76 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +151 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +90 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +475 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +580 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/Makefile +15 -1
- package/project/.sdk/tm/zig/build.zig +23 -5
- package/project/.sdk/tm/zig/core/helpers.zig +52 -11
- package/project/.sdk/tm/zig/core/mem.zig +17 -1
- package/project/.sdk/tm/zig/core/utility.zig +23 -19
- package/project/.sdk/tm/zig/feature/audit.zig +2 -2
- package/project/.sdk/tm/zig/feature/cache.zig +2 -2
- package/project/.sdk/tm/zig/feature/debug.zig +5 -5
- package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
- package/project/.sdk/tm/zig/feature/paging.zig +2 -2
- package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
- package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
- package/project/.sdk/tm/zig/feature/support.zig +3 -3
- package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
- package/project/.sdk/tm/zig/feature/test.zig +10 -5
- package/project/.sdk/tm/zig/test/fh.zig +10 -10
- package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
- package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
- package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
- package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
- package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
- package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
- package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
- package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
package JAVAPACKAGE.sdktest;
|
|
2
2
|
|
|
3
3
|
// Drives the primary utility functions against the shared test.json spec
|
|
4
|
-
// (../.sdk/test/test.json, section "primary")
|
|
4
|
+
// (../.sdk/test/test.json, section "primary") through the VENDORED omni
|
|
5
|
+
// runner (OmniResolver over test/vendor/omni). Mirrors
|
|
5
6
|
// tm/go/test/primary_utility_test.go.
|
|
7
|
+
//
|
|
8
|
+
// Subjects receive omni's native argument list: a ctx entry arrives as
|
|
9
|
+
// args[0], a MAP - OmniResolver.omniCtx builds the typed Context a
|
|
10
|
+
// generated utility takes, and OmniResolver.omniSyncCtx writes the
|
|
11
|
+
// observable ctx state back for `match: {ctx: ...}` assertions.
|
|
6
12
|
|
|
7
13
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
8
14
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
|
@@ -12,24 +18,23 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
12
18
|
import static org.junit.jupiter.api.Assertions.fail;
|
|
13
19
|
|
|
14
20
|
import static JAVAPACKAGE.sdktest.FeatureHarness.fhMap;
|
|
15
|
-
import static JAVAPACKAGE.sdktest.RunnerSupport.getSpec;
|
|
16
|
-
import static JAVAPACKAGE.sdktest.RunnerSupport.loadTestSpec;
|
|
17
|
-
import static JAVAPACKAGE.sdktest.RunnerSupport.makeCtxFromMap;
|
|
18
|
-
import static JAVAPACKAGE.sdktest.RunnerSupport.runset;
|
|
19
21
|
|
|
20
22
|
import java.util.ArrayList;
|
|
21
23
|
import java.util.LinkedHashMap;
|
|
22
24
|
import java.util.List;
|
|
23
25
|
import java.util.Map;
|
|
26
|
+
import java.util.Set;
|
|
24
27
|
import java.util.function.BiFunction;
|
|
25
28
|
|
|
26
29
|
import org.junit.jupiter.api.Test;
|
|
27
30
|
|
|
28
31
|
import JAVAPACKAGE.core.Context;
|
|
32
|
+
import JAVAPACKAGE.core.Entity;
|
|
29
33
|
import JAVAPACKAGE.core.Helpers;
|
|
30
34
|
import JAVAPACKAGE.core.Operation;
|
|
31
35
|
import JAVAPACKAGE.core.ProjectNameSDK;
|
|
32
36
|
import JAVAPACKAGE.core.Result;
|
|
37
|
+
import JAVAPACKAGE.core.SdkError;
|
|
33
38
|
import JAVAPACKAGE.core.Spec;
|
|
34
39
|
import JAVAPACKAGE.core.Utility;
|
|
35
40
|
import JAVAPACKAGE.feature.BaseFeature;
|
|
@@ -37,15 +42,62 @@ import JAVAPACKAGE.feature.BaseFeature;
|
|
|
37
42
|
@SuppressWarnings({"unchecked"})
|
|
38
43
|
public class PrimaryUtilityTest {
|
|
39
44
|
|
|
40
|
-
static
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
static final String TEST_JSON_FILE = "../.sdk/test/test.json";
|
|
46
|
+
|
|
47
|
+
// PENDING sections are the ones deliberately left empty in the shared
|
|
48
|
+
// corpus (.sdk/test/primary/<name>.aon). Everything else MUST contribute
|
|
49
|
+
// cases.
|
|
50
|
+
static final Set<String> PENDING = Set.of(
|
|
51
|
+
"fetcher", "makeFetchDef", "makeResult",
|
|
52
|
+
"featureAdd", "featureHook", "featureInit");
|
|
53
|
+
|
|
54
|
+
// One client + one corpus runner for the whole suite (the go shape).
|
|
55
|
+
private static ProjectNameSDK CLIENT;
|
|
56
|
+
private static Utility UTILITY;
|
|
57
|
+
private static OmniResolver.Run RUN;
|
|
58
|
+
|
|
59
|
+
static synchronized OmniResolver.Run run() {
|
|
60
|
+
if (RUN == null) {
|
|
61
|
+
CLIENT = ProjectNameSDK.testSDK();
|
|
62
|
+
UTILITY = CLIENT.getUtility();
|
|
63
|
+
RUN = OmniResolver.makeRunner(TEST_JSON_FILE, CLIENT).runner("primary", null);
|
|
64
|
+
assertNotNull(RUN.spec, "primary section not found in test.json");
|
|
65
|
+
}
|
|
66
|
+
return RUN;
|
|
45
67
|
}
|
|
46
68
|
|
|
47
69
|
static ProjectNameSDK client() {
|
|
48
|
-
|
|
70
|
+
run();
|
|
71
|
+
return CLIENT;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static Utility utility() {
|
|
75
|
+
run();
|
|
76
|
+
return UTILITY;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Run one corpus section, failing loudly when it would run ZERO cases.
|
|
80
|
+
// A renamed section, a fixture that failed to compile, or an empty set
|
|
81
|
+
// used to report PASS while running zero assertions - the whole point of
|
|
82
|
+
// a shared oracle lost without a single red test. (The guard lives here
|
|
83
|
+
// rather than in the runner, which is vendored verbatim; the shared
|
|
84
|
+
// corpus is a v0 spec, and v0 tolerates an empty set.)
|
|
85
|
+
static void runsection(String name, OmniResolver.Subject subject) {
|
|
86
|
+
OmniResolver.Run run = run();
|
|
87
|
+
Map<String, Object> section = Helpers.toMapAny(run.spec.get(name));
|
|
88
|
+
assertNotNull(section, "test corpus section \"" + name
|
|
89
|
+
+ "\" missing - check the name against .sdk/test/primary/");
|
|
90
|
+
Map<String, Object> basic = Helpers.toMapAny(section.get("basic"));
|
|
91
|
+
Object set = basic == null ? null : basic.get("set");
|
|
92
|
+
if (!(set instanceof List)) {
|
|
93
|
+
fail("test corpus section \"" + name
|
|
94
|
+
+ "\" has no basic.set list - zero cases would run");
|
|
95
|
+
}
|
|
96
|
+
if (((List<Object>) set).isEmpty() && !PENDING.contains(name)) {
|
|
97
|
+
fail("test corpus section \"" + name + "\" is EMPTY - zero cases "
|
|
98
|
+
+ "would run; add cases, or mark the fixture PENDING in .sdk/test/primary/");
|
|
99
|
+
}
|
|
100
|
+
run.runset(basic, subject);
|
|
49
101
|
}
|
|
50
102
|
|
|
51
103
|
// Helper: create basic test context.
|
|
@@ -86,8 +138,7 @@ public class PrimaryUtilityTest {
|
|
|
86
138
|
|
|
87
139
|
@Test
|
|
88
140
|
public void exists() {
|
|
89
|
-
|
|
90
|
-
Utility utility = client.getUtility();
|
|
141
|
+
Utility utility = utility();
|
|
91
142
|
|
|
92
143
|
assertNotNull(utility.clean, "clean");
|
|
93
144
|
assertNotNull(utility.done, "done");
|
|
@@ -123,55 +174,53 @@ public class PrimaryUtilityTest {
|
|
|
123
174
|
@Test
|
|
124
175
|
public void cleanBasic() {
|
|
125
176
|
ProjectNameSDK client = client();
|
|
126
|
-
Utility utility =
|
|
177
|
+
Utility utility = utility();
|
|
127
178
|
Context ctx = makeTestCtx(client, utility, null);
|
|
128
179
|
Object cleaned = utility.clean.apply(ctx, fhMap("key", "secret123", "name", "test"));
|
|
129
180
|
assertNotNull(cleaned, "cleaned should not be null");
|
|
130
181
|
}
|
|
131
182
|
|
|
183
|
+
@Test
|
|
184
|
+
public void cleanCorpus() {
|
|
185
|
+
runsection("clean", (args) -> {
|
|
186
|
+
if (2 != args.length) {
|
|
187
|
+
throw new RuntimeException("clean: expected 2 args, got " + args.length);
|
|
188
|
+
}
|
|
189
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
190
|
+
return utility().clean.apply(ctx, args[1]);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
132
194
|
@Test
|
|
133
195
|
public void doneBasic() {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
138
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
139
|
-
RunnerSupport.fixctx(ctx, client);
|
|
140
|
-
return utility.done.apply(ctx);
|
|
196
|
+
runsection("done", (args) -> {
|
|
197
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
198
|
+
return utility().done.apply(ctx);
|
|
141
199
|
});
|
|
142
200
|
}
|
|
143
201
|
|
|
144
202
|
@Test
|
|
145
203
|
public void makeErrorBasic() {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
List<Object> args = entry.get("args") instanceof List
|
|
150
|
-
? (List<Object>) entry.get("args") : new ArrayList<>();
|
|
151
|
-
if (args.isEmpty()) {
|
|
152
|
-
args.add(new LinkedHashMap<String, Object>());
|
|
204
|
+
runsection("makeError", (args) -> {
|
|
205
|
+
if (0 == args.length) {
|
|
206
|
+
args = new Object[] { new LinkedHashMap<String, Object>() };
|
|
153
207
|
}
|
|
154
208
|
|
|
155
|
-
|
|
156
|
-
if (ctxmap == null) {
|
|
157
|
-
ctxmap = new LinkedHashMap<>();
|
|
158
|
-
}
|
|
159
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
160
|
-
RunnerSupport.fixctx(ctx, client);
|
|
209
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
161
210
|
|
|
162
211
|
RuntimeException err = null;
|
|
163
|
-
if (args.
|
|
164
|
-
err = RunnerSupport.errFromMap(Helpers.toMapAny(args
|
|
212
|
+
if (args.length > 1) {
|
|
213
|
+
err = RunnerSupport.errFromMap(Helpers.toMapAny(args[1]));
|
|
165
214
|
}
|
|
166
215
|
|
|
167
|
-
return utility.makeError.apply(ctx, err);
|
|
216
|
+
return utility().makeError.apply(ctx, err);
|
|
168
217
|
});
|
|
169
218
|
}
|
|
170
219
|
|
|
171
220
|
@Test
|
|
172
221
|
public void makeErrorNoThrow() {
|
|
173
222
|
ProjectNameSDK client = client();
|
|
174
|
-
Utility utility =
|
|
223
|
+
Utility utility = utility();
|
|
175
224
|
Context ctx = makeTestFullCtx(client, utility);
|
|
176
225
|
ctx.ctrl.throwing = false;
|
|
177
226
|
Map<String, Object> resmap = new LinkedHashMap<>();
|
|
@@ -189,7 +238,7 @@ public class PrimaryUtilityTest {
|
|
|
189
238
|
@Test
|
|
190
239
|
public void featureAddBasic() {
|
|
191
240
|
ProjectNameSDK client = client();
|
|
192
|
-
Utility utility =
|
|
241
|
+
Utility utility = utility();
|
|
193
242
|
Context ctx = makeTestCtx(client, utility, null);
|
|
194
243
|
int startLen = client.features.size();
|
|
195
244
|
|
|
@@ -210,7 +259,7 @@ public class PrimaryUtilityTest {
|
|
|
210
259
|
|
|
211
260
|
@Test
|
|
212
261
|
public void featureHookBasic() {
|
|
213
|
-
ProjectNameSDK hookClient =
|
|
262
|
+
ProjectNameSDK hookClient = ProjectNameSDK.testSDK();
|
|
214
263
|
Utility hookUtility = hookClient.getUtility();
|
|
215
264
|
Context ctx = makeTestCtx(hookClient, hookUtility, null);
|
|
216
265
|
|
|
@@ -236,7 +285,7 @@ public class PrimaryUtilityTest {
|
|
|
236
285
|
|
|
237
286
|
@Test
|
|
238
287
|
public void featureInitBasic() {
|
|
239
|
-
ProjectNameSDK initClient =
|
|
288
|
+
ProjectNameSDK initClient = ProjectNameSDK.testSDK();
|
|
240
289
|
Utility initUtility = initClient.getUtility();
|
|
241
290
|
Context ctx = makeTestCtx(initClient, initUtility, null);
|
|
242
291
|
ctx.options.put("feature", fhMap("initfeat", fhMap("active", true)));
|
|
@@ -253,7 +302,7 @@ public class PrimaryUtilityTest {
|
|
|
253
302
|
|
|
254
303
|
@Test
|
|
255
304
|
public void featureInitInactive() {
|
|
256
|
-
ProjectNameSDK initClient =
|
|
305
|
+
ProjectNameSDK initClient = ProjectNameSDK.testSDK();
|
|
257
306
|
Utility initUtility = initClient.getUtility();
|
|
258
307
|
Context ctx = makeTestCtx(initClient, initUtility, null);
|
|
259
308
|
ctx.options.put("feature", fhMap("nofeat", fhMap("active", false)));
|
|
@@ -329,12 +378,10 @@ public class PrimaryUtilityTest {
|
|
|
329
378
|
|
|
330
379
|
@Test
|
|
331
380
|
public void makeContextBasic() {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
runset(getSpec(primary(), "makeContext", "basic"), (entry) -> {
|
|
335
|
-
Map<String, Object> in = Helpers.toMapAny(entry.get("in"));
|
|
381
|
+
runsection("makeContext", (args) -> {
|
|
382
|
+
Map<String, Object> in = Helpers.toMapAny(args[0]);
|
|
336
383
|
if (in != null) {
|
|
337
|
-
Context ctx = utility.makeContext.apply(in, null);
|
|
384
|
+
Context ctx = utility().makeContext.apply(in, null);
|
|
338
385
|
Map<String, Object> out = new LinkedHashMap<>();
|
|
339
386
|
out.put("id", ctx.id);
|
|
340
387
|
if (ctx.op != null) {
|
|
@@ -349,7 +396,7 @@ public class PrimaryUtilityTest {
|
|
|
349
396
|
@Test
|
|
350
397
|
public void makeFetchDefBasic() {
|
|
351
398
|
ProjectNameSDK client = client();
|
|
352
|
-
Utility utility =
|
|
399
|
+
Utility utility = utility();
|
|
353
400
|
Context ctx = makeTestFullCtx(client, utility);
|
|
354
401
|
ctx.spec = new Spec(fhMap(
|
|
355
402
|
"base", "http://localhost:8080",
|
|
@@ -376,7 +423,7 @@ public class PrimaryUtilityTest {
|
|
|
376
423
|
@Test
|
|
377
424
|
public void makeFetchDefWithBody() {
|
|
378
425
|
ProjectNameSDK client = client();
|
|
379
|
-
Utility utility =
|
|
426
|
+
Utility utility = utility();
|
|
380
427
|
Context ctx = makeTestFullCtx(client, utility);
|
|
381
428
|
ctx.spec = new Spec(fhMap(
|
|
382
429
|
"base", "http://localhost:8080",
|
|
@@ -401,43 +448,30 @@ public class PrimaryUtilityTest {
|
|
|
401
448
|
|
|
402
449
|
@Test
|
|
403
450
|
public void makeOptionsBasic() {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
runset(getSpec(primary(), "makeOptions", "basic"), (entry) -> {
|
|
407
|
-
Map<String, Object> in = Helpers.toMapAny(entry.get("in"));
|
|
451
|
+
runsection("makeOptions", (args) -> {
|
|
452
|
+
Map<String, Object> in = Helpers.toMapAny(args[0]);
|
|
408
453
|
Map<String, Object> ctxmap = new LinkedHashMap<>();
|
|
409
454
|
if (in != null) {
|
|
410
455
|
ctxmap.put("options", in.get("options"));
|
|
411
456
|
ctxmap.put("config", in.get("config"));
|
|
412
457
|
}
|
|
413
|
-
Context ctx = utility.makeContext.apply(ctxmap, null);
|
|
414
|
-
ctx.client = client;
|
|
415
|
-
ctx.utility = utility;
|
|
416
|
-
return utility.makeOptions.apply(ctx);
|
|
458
|
+
Context ctx = utility().makeContext.apply(ctxmap, null);
|
|
459
|
+
ctx.client = client();
|
|
460
|
+
ctx.utility = utility();
|
|
461
|
+
return utility().makeOptions.apply(ctx);
|
|
417
462
|
});
|
|
418
463
|
}
|
|
419
464
|
|
|
420
465
|
@Test
|
|
421
466
|
public void makeRequestBasic() {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
// Update entry ctx for match checking.
|
|
432
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
433
|
-
if (entryCtx != null) {
|
|
434
|
-
if (ctx.response != null) {
|
|
435
|
-
entryCtx.put("response", "exists");
|
|
436
|
-
}
|
|
437
|
-
if (ctx.result != null) {
|
|
438
|
-
entryCtx.put("result", "exists");
|
|
439
|
-
}
|
|
440
|
-
}
|
|
467
|
+
runsection("makeRequest", (args) -> {
|
|
468
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
469
|
+
ctx.options = client().optionsMap();
|
|
470
|
+
|
|
471
|
+
utility().makeRequest.apply(ctx);
|
|
472
|
+
|
|
473
|
+
// Expose response/result existence for the match assertions.
|
|
474
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
441
475
|
|
|
442
476
|
return null;
|
|
443
477
|
});
|
|
@@ -445,25 +479,12 @@ public class PrimaryUtilityTest {
|
|
|
445
479
|
|
|
446
480
|
@Test
|
|
447
481
|
public void makeResponseBasic() {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
utility.makeResponse.apply(ctx);
|
|
456
|
-
|
|
457
|
-
// Update entry ctx for match checking with result data.
|
|
458
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
459
|
-
if (entryCtx != null && ctx.result != null) {
|
|
460
|
-
entryCtx.put("result", fhMap(
|
|
461
|
-
"ok", ctx.result.ok,
|
|
462
|
-
"status", ctx.result.status,
|
|
463
|
-
"statusText", ctx.result.statusText,
|
|
464
|
-
"headers", ctx.result.headers,
|
|
465
|
-
"body", ctx.result.body));
|
|
466
|
-
}
|
|
482
|
+
runsection("makeResponse", (args) -> {
|
|
483
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
484
|
+
|
|
485
|
+
utility().makeResponse.apply(ctx);
|
|
486
|
+
|
|
487
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
467
488
|
|
|
468
489
|
return null;
|
|
469
490
|
});
|
|
@@ -472,7 +493,7 @@ public class PrimaryUtilityTest {
|
|
|
472
493
|
@Test
|
|
473
494
|
public void makeResultBasic() {
|
|
474
495
|
ProjectNameSDK client = client();
|
|
475
|
-
Utility utility =
|
|
496
|
+
Utility utility = utility();
|
|
476
497
|
Context ctx = makeTestFullCtx(client, utility);
|
|
477
498
|
ctx.spec = new Spec(fhMap(
|
|
478
499
|
"base", "http://localhost:8080",
|
|
@@ -498,7 +519,7 @@ public class PrimaryUtilityTest {
|
|
|
498
519
|
@Test
|
|
499
520
|
public void makeResultNoSpec() {
|
|
500
521
|
ProjectNameSDK client = client();
|
|
501
|
-
Utility utility =
|
|
522
|
+
Utility utility = utility();
|
|
502
523
|
Context ctx = makeTestFullCtx(client, utility);
|
|
503
524
|
ctx.spec = null;
|
|
504
525
|
ctx.result = new Result(fhMap(
|
|
@@ -517,7 +538,7 @@ public class PrimaryUtilityTest {
|
|
|
517
538
|
@Test
|
|
518
539
|
public void makeResultNoResult() {
|
|
519
540
|
ProjectNameSDK client = client();
|
|
520
|
-
Utility utility =
|
|
541
|
+
Utility utility = utility();
|
|
521
542
|
Context ctx = makeTestFullCtx(client, utility);
|
|
522
543
|
ctx.spec = new Spec(fhMap("step", "start"));
|
|
523
544
|
ctx.result = null;
|
|
@@ -533,75 +554,101 @@ public class PrimaryUtilityTest {
|
|
|
533
554
|
|
|
534
555
|
@Test
|
|
535
556
|
public void makeSpecBasic() {
|
|
536
|
-
Map<String, Object> setupOpts =
|
|
557
|
+
Map<String, Object> setupOpts =
|
|
558
|
+
RunnerSupport.getSpec(run().spec, "makeSpec", "DEF", "setup", "a");
|
|
537
559
|
ProjectNameSDK specClient = ProjectNameSDK.testSDK(null, setupOpts);
|
|
538
560
|
Utility specUtility = specClient.getUtility();
|
|
539
561
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
Context ctx = makeCtxFromMap(ctxmap, specClient, specUtility);
|
|
562
|
+
runsection("makeSpec", (args) -> {
|
|
563
|
+
Context ctx = OmniResolver.omniCtx(args[0], specClient, specUtility);
|
|
543
564
|
ctx.options = specClient.optionsMap();
|
|
544
565
|
|
|
545
566
|
specUtility.makeSpec.apply(ctx);
|
|
546
567
|
|
|
547
|
-
|
|
548
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
549
|
-
if (entryCtx != null && ctx.spec != null) {
|
|
550
|
-
entryCtx.put("spec", fhMap(
|
|
551
|
-
"base", ctx.spec.base,
|
|
552
|
-
"prefix", ctx.spec.prefix,
|
|
553
|
-
"suffix", ctx.spec.suffix,
|
|
554
|
-
"method", ctx.spec.method,
|
|
555
|
-
"params", ctx.spec.params,
|
|
556
|
-
"query", ctx.spec.query,
|
|
557
|
-
"headers", ctx.spec.headers,
|
|
558
|
-
"step", ctx.spec.step));
|
|
559
|
-
}
|
|
568
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
560
569
|
|
|
561
570
|
return null;
|
|
562
571
|
});
|
|
563
572
|
}
|
|
564
573
|
|
|
574
|
+
// A minimal Entity: Context resolves the op through the Entity
|
|
575
|
+
// interface, and a literal {name: ...} map from the fixture is not one -
|
|
576
|
+
// entname would be "" and every lookup would miss, reporting
|
|
577
|
+
// point_no_points for all seven cases. TS reads the same field with
|
|
578
|
+
// getprop and accepts the plain map. (The go peer is plEntity.)
|
|
579
|
+
static final class PlEntity implements Entity {
|
|
580
|
+
private final String name;
|
|
581
|
+
|
|
582
|
+
PlEntity(String name) {
|
|
583
|
+
this.name = name;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
@Override
|
|
587
|
+
public String getName() {
|
|
588
|
+
return name;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
@Override
|
|
592
|
+
public Entity make() {
|
|
593
|
+
return new PlEntity(name);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
@Override
|
|
597
|
+
public Object data(Object... args) {
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
@Override
|
|
602
|
+
public Object match(Object... args) {
|
|
603
|
+
return null;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// Corpus-driven, like go: TS returns the error AS the value; java throws
|
|
608
|
+
// SdkError. The corpus says `match: out: code` for both, so the error is
|
|
609
|
+
// normalised to a map carrying its code here rather than forking the
|
|
610
|
+
// fixture per language.
|
|
565
611
|
@Test
|
|
566
612
|
public void makePointBasic() {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
"
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
"transform", new LinkedHashMap<>());
|
|
581
|
-
ctx.op.points = new ArrayList<>(List.of(point));
|
|
613
|
+
runsection("makePoint", (args) -> {
|
|
614
|
+
Map<String, Object> ctxmap = Helpers.toMapAny(args[0]);
|
|
615
|
+
if (ctxmap == null) {
|
|
616
|
+
ctxmap = new LinkedHashMap<>();
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
Map<String, Object> em = Helpers.toMapAny(ctxmap.get("entity"));
|
|
620
|
+
if (em != null) {
|
|
621
|
+
String name = em.get("name") instanceof String ? (String) em.get("name") : "";
|
|
622
|
+
Map<String, Object> swapped = new LinkedHashMap<>(ctxmap);
|
|
623
|
+
swapped.put("entity", new PlEntity(name));
|
|
624
|
+
ctxmap = swapped;
|
|
625
|
+
}
|
|
582
626
|
|
|
583
|
-
|
|
584
|
-
|
|
627
|
+
Context ctx = OmniResolver.omniCtx(ctxmap, client(), utility());
|
|
628
|
+
try {
|
|
629
|
+
return utility().makePoint.apply(ctx);
|
|
630
|
+
}
|
|
631
|
+
catch (SdkError e) {
|
|
632
|
+
return fhMap("code", e.code);
|
|
633
|
+
}
|
|
634
|
+
});
|
|
585
635
|
}
|
|
586
636
|
|
|
587
637
|
@Test
|
|
588
638
|
public void makeUrlBasic() {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
runset(getSpec(primary(), "makeUrl", "basic"), (entry) -> {
|
|
592
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
593
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
639
|
+
runsection("makeUrl", (args) -> {
|
|
640
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
594
641
|
if (ctx.result == null) {
|
|
595
642
|
ctx.result = new Result(new LinkedHashMap<>());
|
|
596
643
|
}
|
|
597
|
-
return utility.makeUrl.apply(ctx);
|
|
644
|
+
return utility().makeUrl.apply(ctx);
|
|
598
645
|
});
|
|
599
646
|
}
|
|
600
647
|
|
|
601
648
|
@Test
|
|
602
649
|
public void operatorBasic() {
|
|
603
|
-
|
|
604
|
-
Map<String, Object> in = Helpers.toMapAny(
|
|
650
|
+
runsection("operator", (args) -> {
|
|
651
|
+
Map<String, Object> in = Helpers.toMapAny(args[0]);
|
|
605
652
|
Operation op = new Operation(in == null ? new LinkedHashMap<>() : in);
|
|
606
653
|
return fhMap(
|
|
607
654
|
"entity", op.entity,
|
|
@@ -613,41 +660,18 @@ public class PrimaryUtilityTest {
|
|
|
613
660
|
|
|
614
661
|
@Test
|
|
615
662
|
public void paramBasic() {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
runset(getSpec(primary(), "param", "basic"), (entry) -> {
|
|
619
|
-
List<Object> args = entry.get("args") instanceof List
|
|
620
|
-
? (List<Object>) entry.get("args") : new ArrayList<>();
|
|
621
|
-
if (args.size() < 2) {
|
|
663
|
+
runsection("param", (args) -> {
|
|
664
|
+
if (args.length < 2) {
|
|
622
665
|
return null;
|
|
623
666
|
}
|
|
624
667
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
Object result = utility.param.apply(ctx, paramdef);
|
|
633
|
-
|
|
634
|
-
// Copy spec alias back to entry ctx for matching.
|
|
635
|
-
Map<String, Object> matchSpec = Helpers.toMapAny(entry.get("match"));
|
|
636
|
-
if (matchSpec != null) {
|
|
637
|
-
Map<String, Object> ctxMatch = Helpers.toMapAny(matchSpec.get("ctx"));
|
|
638
|
-
if (ctxMatch != null) {
|
|
639
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
640
|
-
if (entryCtx == null) {
|
|
641
|
-
entryCtx = new LinkedHashMap<>();
|
|
642
|
-
entry.put("ctx", entryCtx);
|
|
643
|
-
}
|
|
644
|
-
Map<String, Object> specMatch = Helpers.toMapAny(ctxMatch.get("spec"));
|
|
645
|
-
if (specMatch != null && ctx.spec != null
|
|
646
|
-
&& specMatch.get("alias") instanceof Map) {
|
|
647
|
-
entryCtx.put("spec", fhMap("alias", ctx.spec.alias));
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
668
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
669
|
+
Object paramdef = args[1];
|
|
670
|
+
|
|
671
|
+
Object result = utility().param.apply(ctx, paramdef);
|
|
672
|
+
|
|
673
|
+
// The spec alias mutation is what mark 80 asserts on.
|
|
674
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
651
675
|
|
|
652
676
|
return result;
|
|
653
677
|
});
|
|
@@ -655,22 +679,17 @@ public class PrimaryUtilityTest {
|
|
|
655
679
|
|
|
656
680
|
@Test
|
|
657
681
|
public void prepareAuthBasic() {
|
|
658
|
-
Map<String, Object> setupOpts =
|
|
682
|
+
Map<String, Object> setupOpts =
|
|
683
|
+
RunnerSupport.getSpec(run().spec, "prepareAuth", "DEF", "setup", "a");
|
|
659
684
|
ProjectNameSDK authClient = ProjectNameSDK.testSDK(null, setupOpts);
|
|
660
685
|
Utility authUtility = authClient.getUtility();
|
|
661
686
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
Context ctx = makeCtxFromMap(ctxmap, authClient, authUtility);
|
|
665
|
-
RunnerSupport.fixctx(ctx, authClient);
|
|
687
|
+
runsection("prepareAuth", (args) -> {
|
|
688
|
+
Context ctx = OmniResolver.omniCtx(args[0], authClient, authUtility);
|
|
666
689
|
|
|
667
690
|
authUtility.prepareAuth.apply(ctx);
|
|
668
691
|
|
|
669
|
-
|
|
670
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
671
|
-
if (entryCtx != null && ctx.spec != null) {
|
|
672
|
-
entryCtx.put("spec", fhMap("headers", ctx.spec.headers));
|
|
673
|
-
}
|
|
692
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
674
693
|
|
|
675
694
|
return null;
|
|
676
695
|
});
|
|
@@ -678,83 +697,69 @@ public class PrimaryUtilityTest {
|
|
|
678
697
|
|
|
679
698
|
@Test
|
|
680
699
|
public void prepareBodyBasic() {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
685
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
686
|
-
RunnerSupport.fixctx(ctx, client);
|
|
687
|
-
return utility.prepareBody.apply(ctx);
|
|
700
|
+
runsection("prepareBody", (args) -> {
|
|
701
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
702
|
+
return utility().prepareBody.apply(ctx);
|
|
688
703
|
});
|
|
689
704
|
}
|
|
690
705
|
|
|
691
706
|
@Test
|
|
692
707
|
public void prepareHeadersBasic() {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
697
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
698
|
-
return utility.prepareHeaders.apply(ctx);
|
|
708
|
+
runsection("prepareHeaders", (args) -> {
|
|
709
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
710
|
+
return utility().prepareHeaders.apply(ctx);
|
|
699
711
|
});
|
|
700
712
|
}
|
|
701
713
|
|
|
702
714
|
@Test
|
|
703
715
|
public void prepareMethodBasic() {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
716
|
+
runsection("prepareMethod", (args) -> {
|
|
717
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
718
|
+
// An op the API does not define resolves NO method; ts answers
|
|
719
|
+
// undefined there and java answers null - both are "no value" to
|
|
720
|
+
// the corpus.
|
|
721
|
+
String method = utility().prepareMethod.apply(ctx);
|
|
722
|
+
if (method == null || method.isEmpty()) {
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
725
|
+
return method;
|
|
710
726
|
});
|
|
711
727
|
}
|
|
712
728
|
|
|
713
729
|
@Test
|
|
714
730
|
public void prepareParamsBasic() {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
719
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
720
|
-
return utility.prepareParams.apply(ctx);
|
|
731
|
+
runsection("prepareParams", (args) -> {
|
|
732
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
733
|
+
return utility().prepareParams.apply(ctx);
|
|
721
734
|
});
|
|
722
735
|
}
|
|
723
736
|
|
|
737
|
+
// Was two hand-written cases that had drifted out of the shared corpus
|
|
738
|
+
// (the preparePath fixture shipped as an empty `set: []`). Now driven by
|
|
739
|
+
// the corpus like every other section, so all ports assert the same
|
|
740
|
+
// separator/blank-segment behaviour.
|
|
724
741
|
@Test
|
|
725
742
|
public void preparePathBasic() {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
Utility utility = client.getUtility();
|
|
730
|
-
runset(getSpec(primary(), "preparePath", "basic"), (entry) -> {
|
|
731
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
732
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
733
|
-
return utility.preparePath.apply(ctx);
|
|
743
|
+
runsection("preparePath", (args) -> {
|
|
744
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
745
|
+
return utility().preparePath.apply(ctx);
|
|
734
746
|
});
|
|
735
747
|
}
|
|
736
748
|
|
|
737
749
|
@Test
|
|
738
750
|
public void prepareQueryBasic() {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
743
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
744
|
-
return utility.prepareQuery.apply(ctx);
|
|
751
|
+
runsection("prepareQuery", (args) -> {
|
|
752
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
753
|
+
return utility().prepareQuery.apply(ctx);
|
|
745
754
|
});
|
|
746
755
|
}
|
|
747
756
|
|
|
748
757
|
@Test
|
|
749
758
|
public void resultBasicBasic() {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
runset(getSpec(primary(), "resultBasic", "basic"), (entry) -> {
|
|
753
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
754
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
755
|
-
RunnerSupport.fixctx(ctx, client);
|
|
759
|
+
runsection("resultBasic", (args) -> {
|
|
760
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
756
761
|
|
|
757
|
-
Result result = utility.resultBasic.apply(ctx);
|
|
762
|
+
Result result = utility().resultBasic.apply(ctx);
|
|
758
763
|
|
|
759
764
|
Map<String, Object> out = fhMap(
|
|
760
765
|
"status", result.status,
|
|
@@ -769,18 +774,12 @@ public class PrimaryUtilityTest {
|
|
|
769
774
|
|
|
770
775
|
@Test
|
|
771
776
|
public void resultBodyBasic() {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
runset(getSpec(primary(), "resultBody", "basic"), (entry) -> {
|
|
775
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
776
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
777
|
+
runsection("resultBody", (args) -> {
|
|
778
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
777
779
|
|
|
778
|
-
utility.resultBody.apply(ctx);
|
|
780
|
+
utility().resultBody.apply(ctx);
|
|
779
781
|
|
|
780
|
-
|
|
781
|
-
if (entryCtx != null && ctx.result != null) {
|
|
782
|
-
entryCtx.put("result", fhMap("body", ctx.result.body));
|
|
783
|
-
}
|
|
782
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
784
783
|
|
|
785
784
|
return null;
|
|
786
785
|
});
|
|
@@ -788,18 +787,12 @@ public class PrimaryUtilityTest {
|
|
|
788
787
|
|
|
789
788
|
@Test
|
|
790
789
|
public void resultHeadersBasic() {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
runset(getSpec(primary(), "resultHeaders", "basic"), (entry) -> {
|
|
794
|
-
Map<String, Object> ctxmap = Helpers.toMapAny(entry.get("ctx"));
|
|
795
|
-
Context ctx = makeCtxFromMap(ctxmap, client, utility);
|
|
790
|
+
runsection("resultHeaders", (args) -> {
|
|
791
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
796
792
|
|
|
797
|
-
utility.resultHeaders.apply(ctx);
|
|
793
|
+
utility().resultHeaders.apply(ctx);
|
|
798
794
|
|
|
799
|
-
|
|
800
|
-
if (entryCtx != null && ctx.result != null) {
|
|
801
|
-
entryCtx.put("result", fhMap("headers", ctx.result.headers));
|
|
802
|
-
}
|
|
795
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
803
796
|
|
|
804
797
|
return null;
|
|
805
798
|
});
|
|
@@ -807,22 +800,13 @@ public class PrimaryUtilityTest {
|
|
|
807
800
|
|
|
808
801
|
@Test
|
|
809
802
|
public void transformRequestBasic() {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
// Update entry ctx for match (step changed).
|
|
819
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
820
|
-
if (entryCtx != null && ctx.spec != null) {
|
|
821
|
-
Map<String, Object> specMap = Helpers.toMapAny(entryCtx.get("spec"));
|
|
822
|
-
if (specMap != null) {
|
|
823
|
-
specMap.put("step", ctx.spec.step);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
803
|
+
runsection("transformRequest", (args) -> {
|
|
804
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
805
|
+
|
|
806
|
+
Object result = utility().transformRequest.apply(ctx);
|
|
807
|
+
|
|
808
|
+
// The step advance is what the match assertion reads.
|
|
809
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
826
810
|
|
|
827
811
|
return result;
|
|
828
812
|
});
|
|
@@ -830,22 +814,12 @@ public class PrimaryUtilityTest {
|
|
|
830
814
|
|
|
831
815
|
@Test
|
|
832
816
|
public void transformResponseBasic() {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
Object result = utility.transformResponse.apply(ctx);
|
|
840
|
-
|
|
841
|
-
// Update entry ctx for match (step changed).
|
|
842
|
-
Map<String, Object> entryCtx = Helpers.toMapAny(entry.get("ctx"));
|
|
843
|
-
if (entryCtx != null && ctx.spec != null) {
|
|
844
|
-
Map<String, Object> specMap = Helpers.toMapAny(entryCtx.get("spec"));
|
|
845
|
-
if (specMap != null) {
|
|
846
|
-
specMap.put("step", ctx.spec.step);
|
|
847
|
-
}
|
|
848
|
-
}
|
|
817
|
+
runsection("transformResponse", (args) -> {
|
|
818
|
+
Context ctx = OmniResolver.omniCtx(args[0], client(), utility());
|
|
819
|
+
|
|
820
|
+
Object result = utility().transformResponse.apply(ctx);
|
|
821
|
+
|
|
822
|
+
OmniResolver.omniSyncCtx(args[0], ctx);
|
|
849
823
|
|
|
850
824
|
return result;
|
|
851
825
|
});
|