@voxgig/sdkgen 4.8.2 → 4.8.3
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/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/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 +209 -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 +151 -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 +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -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 +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -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 +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -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 +74 -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 +152 -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 +92 -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 +455 -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 +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -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/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- 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
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// Primary utility test suite - drives every utility on the client utility
|
|
2
|
-
// object
|
|
3
|
-
//
|
|
2
|
+
// object against the shared corpus in ../../.sdk/test/test.json ("primary"
|
|
3
|
+
// section) through the VENDORED omni runner (OmniResolver over
|
|
4
|
+
// test/vendor/omni), plus direct checks. C# twin of
|
|
4
5
|
// tm/go/test/primary_utility_test.go.
|
|
6
|
+
//
|
|
7
|
+
// Subjects receive omni's native argument list: a ctx entry arrives as
|
|
8
|
+
// args[0], a MAP - OmniResolver.OmniCtx builds the typed Context a
|
|
9
|
+
// generated utility takes, and OmniResolver.OmniSyncCtx writes the
|
|
10
|
+
// observable ctx state back for `match: {ctx: ...}` assertions.
|
|
5
11
|
|
|
6
12
|
using Xunit;
|
|
7
13
|
|
|
@@ -34,21 +40,79 @@ internal class TestInitFeature : BaseFeature
|
|
|
34
40
|
|
|
35
41
|
public class PrimaryUtilityTest
|
|
36
42
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
// PENDING sections are the ones deliberately left empty in the shared
|
|
44
|
+
// corpus (.sdk/test/primary/<name>.aon). Everything else MUST
|
|
45
|
+
// contribute cases.
|
|
46
|
+
private static readonly HashSet<string> Pending = new()
|
|
47
|
+
{
|
|
48
|
+
"fetcher", "makeFetchDef", "makeResult",
|
|
49
|
+
"featureAdd", "featureHook", "featureInit",
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// One client + one corpus runner for the whole suite (the go shape).
|
|
53
|
+
private static ProjectNameSDK? CLIENT;
|
|
54
|
+
private static Utility? UTILITY;
|
|
55
|
+
private static OmniResolver.Run? RUN;
|
|
56
|
+
private static readonly object RunLock = new();
|
|
57
|
+
|
|
58
|
+
private static OmniResolver.Run Run()
|
|
59
|
+
{
|
|
60
|
+
lock (RunLock)
|
|
61
|
+
{
|
|
62
|
+
if (RUN == null)
|
|
63
|
+
{
|
|
64
|
+
CLIENT = ProjectNameSDK.TestSDK(null, null);
|
|
65
|
+
UTILITY = CLIENT.GetUtility();
|
|
66
|
+
RUN = OmniResolver.MakeRunner(StructRunner.TestJsonPath(), CLIENT)("primary");
|
|
67
|
+
Assert.True(0 < RUN.Spec.Count,
|
|
68
|
+
"primary section not found in test.json");
|
|
69
|
+
}
|
|
70
|
+
return RUN;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
40
73
|
|
|
41
|
-
|
|
74
|
+
private static ProjectNameSDK GetClient()
|
|
42
75
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
76
|
+
Run();
|
|
77
|
+
return CLIENT!;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private static Utility GetUtil()
|
|
81
|
+
{
|
|
82
|
+
Run();
|
|
83
|
+
return UTILITY!;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Run one corpus section, failing loudly when it would run ZERO cases.
|
|
87
|
+
// A renamed section, a fixture that failed to compile, or an empty set
|
|
88
|
+
// used to report PASS while running zero assertions - the whole point
|
|
89
|
+
// of a shared oracle lost without a single red test. (The guard lives
|
|
90
|
+
// here rather than in the runner, which is vendored verbatim; the
|
|
91
|
+
// shared corpus is a v0 spec, and v0 tolerates an empty set.)
|
|
92
|
+
private static void runsection(string name, OmniResolver.Subject subject)
|
|
93
|
+
{
|
|
94
|
+
var run = Run();
|
|
95
|
+
var section = run.Spec.TryGetValue(name, out var s)
|
|
96
|
+
? s as Dictionary<string, object?> : null;
|
|
97
|
+
Assert.True(null != section, "test corpus section \"" + name +
|
|
98
|
+
"\" missing - check the name against .sdk/test/primary/");
|
|
99
|
+
var basic = section!.TryGetValue("basic", out var b)
|
|
100
|
+
? b as Dictionary<string, object?> : null;
|
|
101
|
+
var set = basic != null && basic.TryGetValue("set", out var sv)
|
|
102
|
+
? sv as List<object?> : null;
|
|
103
|
+
Assert.True(null != set, "test corpus section \"" + name +
|
|
104
|
+
"\" has no basic.set list - zero cases would run");
|
|
105
|
+
if (0 == set!.Count && !Pending.Contains(name))
|
|
106
|
+
{
|
|
107
|
+
Assert.Fail("test corpus section \"" + name + "\" is EMPTY - " +
|
|
108
|
+
"zero cases would run; add cases, or mark the fixture " +
|
|
109
|
+
"PENDING in .sdk/test/primary/");
|
|
110
|
+
}
|
|
111
|
+
run.RunSet(basic, subject);
|
|
48
112
|
}
|
|
49
113
|
|
|
50
114
|
// Helper: create basic test context.
|
|
51
|
-
private Context MakeTestCtx(ProjectNameSDK client, Utility utility,
|
|
115
|
+
private static Context MakeTestCtx(ProjectNameSDK client, Utility utility,
|
|
52
116
|
Dictionary<string, object?>? overrides)
|
|
53
117
|
{
|
|
54
118
|
var ctxmap = new Dictionary<string, object?>
|
|
@@ -68,7 +132,7 @@ public class PrimaryUtilityTest
|
|
|
68
132
|
}
|
|
69
133
|
|
|
70
134
|
// Helper: create full test context with point and match.
|
|
71
|
-
private Context MakeTestFullCtx(ProjectNameSDK client, Utility utility)
|
|
135
|
+
private static Context MakeTestFullCtx(ProjectNameSDK client, Utility utility)
|
|
72
136
|
{
|
|
73
137
|
var ctx = MakeTestCtx(client, utility, null);
|
|
74
138
|
ctx.Point = new Dictionary<string, object?>
|
|
@@ -99,95 +163,98 @@ public class PrimaryUtilityTest
|
|
|
99
163
|
[Fact]
|
|
100
164
|
public void Exists()
|
|
101
165
|
{
|
|
102
|
-
|
|
103
|
-
Assert.NotNull(
|
|
104
|
-
Assert.NotNull(
|
|
105
|
-
Assert.NotNull(
|
|
106
|
-
Assert.NotNull(
|
|
107
|
-
Assert.NotNull(
|
|
108
|
-
Assert.NotNull(
|
|
109
|
-
Assert.NotNull(
|
|
110
|
-
Assert.NotNull(
|
|
111
|
-
Assert.NotNull(
|
|
112
|
-
Assert.NotNull(
|
|
113
|
-
Assert.NotNull(
|
|
114
|
-
Assert.NotNull(
|
|
115
|
-
Assert.NotNull(
|
|
116
|
-
Assert.NotNull(
|
|
117
|
-
Assert.NotNull(
|
|
118
|
-
Assert.NotNull(
|
|
119
|
-
Assert.NotNull(
|
|
120
|
-
Assert.NotNull(
|
|
121
|
-
Assert.NotNull(
|
|
122
|
-
Assert.NotNull(
|
|
123
|
-
Assert.NotNull(
|
|
124
|
-
Assert.NotNull(
|
|
125
|
-
Assert.NotNull(
|
|
126
|
-
Assert.NotNull(
|
|
127
|
-
Assert.NotNull(
|
|
128
|
-
Assert.NotNull(
|
|
129
|
-
Assert.NotNull(
|
|
130
|
-
Assert.NotNull(
|
|
166
|
+
var utility = GetUtil();
|
|
167
|
+
Assert.NotNull(utility.Clean);
|
|
168
|
+
Assert.NotNull(utility.Done);
|
|
169
|
+
Assert.NotNull(utility.MakeError);
|
|
170
|
+
Assert.NotNull(utility.FeatureAdd);
|
|
171
|
+
Assert.NotNull(utility.FeatureHook);
|
|
172
|
+
Assert.NotNull(utility.FeatureInit);
|
|
173
|
+
Assert.NotNull(utility.Fetcher);
|
|
174
|
+
Assert.NotNull(utility.MakeFetchDef);
|
|
175
|
+
Assert.NotNull(utility.MakeContext);
|
|
176
|
+
Assert.NotNull(utility.MakeOptions);
|
|
177
|
+
Assert.NotNull(utility.MakeRequest);
|
|
178
|
+
Assert.NotNull(utility.MakeResponse);
|
|
179
|
+
Assert.NotNull(utility.MakeResult);
|
|
180
|
+
Assert.NotNull(utility.MakePoint);
|
|
181
|
+
Assert.NotNull(utility.MakeSpec);
|
|
182
|
+
Assert.NotNull(utility.MakeUrl);
|
|
183
|
+
Assert.NotNull(utility.Param);
|
|
184
|
+
Assert.NotNull(utility.PrepareAuth);
|
|
185
|
+
Assert.NotNull(utility.PrepareBody);
|
|
186
|
+
Assert.NotNull(utility.PrepareHeaders);
|
|
187
|
+
Assert.NotNull(utility.PrepareMethod);
|
|
188
|
+
Assert.NotNull(utility.PrepareParams);
|
|
189
|
+
Assert.NotNull(utility.PreparePath);
|
|
190
|
+
Assert.NotNull(utility.PrepareQuery);
|
|
191
|
+
Assert.NotNull(utility.ResultBasic);
|
|
192
|
+
Assert.NotNull(utility.ResultBody);
|
|
193
|
+
Assert.NotNull(utility.ResultHeaders);
|
|
194
|
+
Assert.NotNull(utility.TransformRequest);
|
|
195
|
+
Assert.NotNull(utility.TransformResponse);
|
|
131
196
|
}
|
|
132
197
|
|
|
133
198
|
[Fact]
|
|
134
199
|
public void CleanBasic()
|
|
135
200
|
{
|
|
136
|
-
var ctx = MakeTestCtx(
|
|
201
|
+
var ctx = MakeTestCtx(GetClient(), GetUtil(), null);
|
|
137
202
|
var val = new Dictionary<string, object?>
|
|
138
203
|
{
|
|
139
204
|
["key"] = "secret123",
|
|
140
205
|
["name"] = "test",
|
|
141
206
|
};
|
|
142
|
-
var cleaned =
|
|
207
|
+
var cleaned = GetUtil().Clean(ctx, val);
|
|
143
208
|
Assert.NotNull(cleaned);
|
|
144
209
|
}
|
|
145
210
|
|
|
211
|
+
[Fact]
|
|
212
|
+
public void CleanCorpus()
|
|
213
|
+
{
|
|
214
|
+
runsection("clean", args =>
|
|
215
|
+
{
|
|
216
|
+
if (2 != args.Length)
|
|
217
|
+
{
|
|
218
|
+
throw new InvalidOperationException(
|
|
219
|
+
"clean: expected 2 args, got " + args.Length);
|
|
220
|
+
}
|
|
221
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
222
|
+
return GetUtil().Clean(ctx, args[1]);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
146
226
|
[Fact]
|
|
147
227
|
public void DoneBasic()
|
|
148
228
|
{
|
|
149
|
-
|
|
229
|
+
runsection("done", args =>
|
|
150
230
|
{
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
154
|
-
TestRunner.FixCtx(ctx, _client);
|
|
155
|
-
return _utility.Done(ctx);
|
|
231
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
232
|
+
return GetUtil().Done(ctx);
|
|
156
233
|
});
|
|
157
234
|
}
|
|
158
235
|
|
|
159
236
|
[Fact]
|
|
160
237
|
public void MakeErrorBasic()
|
|
161
238
|
{
|
|
162
|
-
|
|
239
|
+
runsection("makeError", args =>
|
|
163
240
|
{
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
args ??= new List<object?> { new Dictionary<string, object?>() };
|
|
167
|
-
if (args.Count == 0)
|
|
168
|
-
{
|
|
169
|
-
args = new List<object?> { new Dictionary<string, object?>() };
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
var ctxmap = args[0] as Dictionary<string, object?>
|
|
173
|
-
?? new Dictionary<string, object?>();
|
|
174
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
175
|
-
TestRunner.FixCtx(ctx, _client);
|
|
241
|
+
var ctxarg = 0 < args.Length ? args[0] : null;
|
|
242
|
+
var ctx = OmniResolver.OmniCtx(ctxarg, GetClient(), GetUtil());
|
|
176
243
|
|
|
177
244
|
Exception? err = null;
|
|
178
|
-
if (args.
|
|
245
|
+
if (1 < args.Length && args[1] is Dictionary<string, object?> errMap)
|
|
179
246
|
{
|
|
180
247
|
err = TestRunner.ErrFromMap(errMap);
|
|
181
248
|
}
|
|
182
249
|
|
|
183
|
-
return
|
|
250
|
+
return GetUtil().MakeError(ctx, err);
|
|
184
251
|
});
|
|
185
252
|
}
|
|
186
253
|
|
|
187
254
|
[Fact]
|
|
188
255
|
public void MakeErrorNoThrow()
|
|
189
256
|
{
|
|
190
|
-
var ctx = MakeTestFullCtx(
|
|
257
|
+
var ctx = MakeTestFullCtx(GetClient(), GetUtil());
|
|
191
258
|
ctx.Ctrl.Throw = false;
|
|
192
259
|
ctx.Result = new Result(new Dictionary<string, object?>
|
|
193
260
|
{
|
|
@@ -195,7 +262,7 @@ public class PrimaryUtilityTest
|
|
|
195
262
|
["resdata"] = new Dictionary<string, object?> { ["id"] = "safe01" },
|
|
196
263
|
});
|
|
197
264
|
|
|
198
|
-
var result =
|
|
265
|
+
var result = GetUtil().MakeError(ctx, ctx.MakeError("test_code", "test message"));
|
|
199
266
|
var om = result as Dictionary<string, object?>;
|
|
200
267
|
Assert.True(om != null && Equals(om["id"], "safe01"),
|
|
201
268
|
$"expected id=safe01, got {result}");
|
|
@@ -204,13 +271,14 @@ public class PrimaryUtilityTest
|
|
|
204
271
|
[Fact]
|
|
205
272
|
public void FeatureAddBasic()
|
|
206
273
|
{
|
|
207
|
-
var
|
|
208
|
-
var
|
|
274
|
+
var client = GetClient();
|
|
275
|
+
var ctx = MakeTestCtx(client, GetUtil(), null);
|
|
276
|
+
var startLen = client.Features.Count;
|
|
209
277
|
|
|
210
278
|
var feature = new BaseFeature();
|
|
211
|
-
|
|
279
|
+
GetUtil().FeatureAdd(ctx, feature);
|
|
212
280
|
|
|
213
|
-
Assert.Equal(startLen + 1,
|
|
281
|
+
Assert.Equal(startLen + 1, client.Features.Count);
|
|
214
282
|
}
|
|
215
283
|
|
|
216
284
|
[Fact]
|
|
@@ -278,8 +346,12 @@ public class PrimaryUtilityTest
|
|
|
278
346
|
public void FetcherLive()
|
|
279
347
|
{
|
|
280
348
|
var calls = new List<Dictionary<string, object?>>();
|
|
349
|
+
// Concrete base: a live construction must satisfy any server
|
|
350
|
+
// variables a templated base URL declares; a literal base
|
|
351
|
+
// sidesteps the requirement.
|
|
281
352
|
var liveClient = new ProjectNameSDK(new Dictionary<string, object?>
|
|
282
353
|
{
|
|
354
|
+
["base"] = "http://localhost:8080",
|
|
283
355
|
["system"] = new Dictionary<string, object?>
|
|
284
356
|
{
|
|
285
357
|
["fetch"] = (Func<string, Dictionary<string, object?>, Dictionary<string, object?>>)
|
|
@@ -320,9 +392,10 @@ public class PrimaryUtilityTest
|
|
|
320
392
|
public void FetcherBlockedTestMode()
|
|
321
393
|
{
|
|
322
394
|
// Create a live SDK then set mode to test (not using TestSDK, which
|
|
323
|
-
// installs the test feature).
|
|
395
|
+
// installs the test feature). Concrete base: see FetcherLive.
|
|
324
396
|
var blockedClient = new ProjectNameSDK(new Dictionary<string, object?>
|
|
325
397
|
{
|
|
398
|
+
["base"] = "http://localhost:8080",
|
|
326
399
|
["system"] = new Dictionary<string, object?>
|
|
327
400
|
{
|
|
328
401
|
["fetch"] = (Func<string, Dictionary<string, object?>, Dictionary<string, object?>>)
|
|
@@ -352,12 +425,11 @@ public class PrimaryUtilityTest
|
|
|
352
425
|
[Fact]
|
|
353
426
|
public void MakeContextBasic()
|
|
354
427
|
{
|
|
355
|
-
|
|
428
|
+
runsection("makeContext", args =>
|
|
356
429
|
{
|
|
357
|
-
if (
|
|
358
|
-
inRaw is Dictionary<string, object?> inMap)
|
|
430
|
+
if (args[0] is Dictionary<string, object?> inMap)
|
|
359
431
|
{
|
|
360
|
-
var ctx =
|
|
432
|
+
var ctx = GetUtil().MakeContext(inMap, null);
|
|
361
433
|
var result = new Dictionary<string, object?>
|
|
362
434
|
{
|
|
363
435
|
["id"] = ctx.Id,
|
|
@@ -379,7 +451,7 @@ public class PrimaryUtilityTest
|
|
|
379
451
|
[Fact]
|
|
380
452
|
public void MakeFetchDefBasic()
|
|
381
453
|
{
|
|
382
|
-
var ctx = MakeTestFullCtx(
|
|
454
|
+
var ctx = MakeTestFullCtx(GetClient(), GetUtil());
|
|
383
455
|
ctx.Spec = new Spec(new Dictionary<string, object?>
|
|
384
456
|
{
|
|
385
457
|
["base"] = "http://localhost:8080",
|
|
@@ -397,7 +469,7 @@ public class PrimaryUtilityTest
|
|
|
397
469
|
});
|
|
398
470
|
ctx.Result = new Result(new Dictionary<string, object?>());
|
|
399
471
|
|
|
400
|
-
var fetchdef =
|
|
472
|
+
var fetchdef = GetUtil().MakeFetchDef(ctx);
|
|
401
473
|
Assert.Equal("GET", fetchdef["method"]);
|
|
402
474
|
var url = fetchdef["url"] as string ?? "";
|
|
403
475
|
Assert.Contains("/api/items/item01", url);
|
|
@@ -410,7 +482,7 @@ public class PrimaryUtilityTest
|
|
|
410
482
|
[Fact]
|
|
411
483
|
public void MakeFetchDefWithBody()
|
|
412
484
|
{
|
|
413
|
-
var ctx = MakeTestFullCtx(
|
|
485
|
+
var ctx = MakeTestFullCtx(GetClient(), GetUtil());
|
|
414
486
|
ctx.Spec = new Spec(new Dictionary<string, object?>
|
|
415
487
|
{
|
|
416
488
|
["base"] = "http://localhost:8080",
|
|
@@ -426,7 +498,7 @@ public class PrimaryUtilityTest
|
|
|
426
498
|
});
|
|
427
499
|
ctx.Result = new Result(new Dictionary<string, object?>());
|
|
428
500
|
|
|
429
|
-
var fetchdef =
|
|
501
|
+
var fetchdef = GetUtil().MakeFetchDef(ctx);
|
|
430
502
|
Assert.Equal("POST", fetchdef["method"]);
|
|
431
503
|
var bodyStr = Assert.IsType<string>(fetchdef["body"]);
|
|
432
504
|
Assert.Contains("\"name\"", bodyStr);
|
|
@@ -435,46 +507,34 @@ public class PrimaryUtilityTest
|
|
|
435
507
|
[Fact]
|
|
436
508
|
public void MakeOptionsBasic()
|
|
437
509
|
{
|
|
438
|
-
|
|
510
|
+
runsection("makeOptions", args =>
|
|
439
511
|
{
|
|
440
|
-
var inMap =
|
|
441
|
-
|
|
442
|
-
inMap
|
|
443
|
-
var ctx = _utility.MakeContext(new Dictionary<string, object?>
|
|
512
|
+
var inMap = args[0] as Dictionary<string, object?>;
|
|
513
|
+
var ctxmap = new Dictionary<string, object?>();
|
|
514
|
+
if (inMap != null)
|
|
444
515
|
{
|
|
445
|
-
["options"] = inMap.TryGetValue("options", out var o) ? o : null
|
|
446
|
-
["config"] = inMap.TryGetValue("config", out var c) ? c : null
|
|
447
|
-
}
|
|
448
|
-
ctx
|
|
449
|
-
ctx.
|
|
450
|
-
|
|
516
|
+
ctxmap["options"] = inMap.TryGetValue("options", out var o) ? o : null;
|
|
517
|
+
ctxmap["config"] = inMap.TryGetValue("config", out var c) ? c : null;
|
|
518
|
+
}
|
|
519
|
+
var ctx = GetUtil().MakeContext(ctxmap, null);
|
|
520
|
+
ctx.Client = GetClient();
|
|
521
|
+
ctx.Utility = GetUtil();
|
|
522
|
+
return GetUtil().MakeOptions(ctx);
|
|
451
523
|
});
|
|
452
524
|
}
|
|
453
525
|
|
|
454
526
|
[Fact]
|
|
455
527
|
public void MakeRequestBasic()
|
|
456
528
|
{
|
|
457
|
-
|
|
529
|
+
runsection("makeRequest", args =>
|
|
458
530
|
{
|
|
459
|
-
var
|
|
460
|
-
|
|
461
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
462
|
-
ctx.Options = _client.OptionsMap();
|
|
531
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
532
|
+
ctx.Options = GetClient().OptionsMap();
|
|
463
533
|
|
|
464
|
-
|
|
534
|
+
GetUtil().MakeRequest(ctx);
|
|
465
535
|
|
|
466
|
-
//
|
|
467
|
-
|
|
468
|
-
{
|
|
469
|
-
if (ctx.Response != null)
|
|
470
|
-
{
|
|
471
|
-
ctxmap["response"] = "exists";
|
|
472
|
-
}
|
|
473
|
-
if (ctx.Result != null)
|
|
474
|
-
{
|
|
475
|
-
ctxmap["result"] = "exists";
|
|
476
|
-
}
|
|
477
|
-
}
|
|
536
|
+
// Expose response/result existence for the match assertions.
|
|
537
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
478
538
|
|
|
479
539
|
return null;
|
|
480
540
|
});
|
|
@@ -483,27 +543,13 @@ public class PrimaryUtilityTest
|
|
|
483
543
|
[Fact]
|
|
484
544
|
public void MakeResponseBasic()
|
|
485
545
|
{
|
|
486
|
-
|
|
546
|
+
runsection("makeResponse", args =>
|
|
487
547
|
{
|
|
488
|
-
var
|
|
489
|
-
? c as Dictionary<string, object?> : null;
|
|
490
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
491
|
-
TestRunner.FixCtx(ctx, _client);
|
|
548
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
492
549
|
|
|
493
|
-
|
|
550
|
+
GetUtil().MakeResponse(ctx);
|
|
494
551
|
|
|
495
|
-
|
|
496
|
-
if (ctxmap != null && ctx.Result != null)
|
|
497
|
-
{
|
|
498
|
-
ctxmap["result"] = new Dictionary<string, object?>
|
|
499
|
-
{
|
|
500
|
-
["ok"] = ctx.Result.Ok,
|
|
501
|
-
["status"] = ctx.Result.Status,
|
|
502
|
-
["statusText"] = ctx.Result.StatusText,
|
|
503
|
-
["headers"] = ctx.Result.Headers,
|
|
504
|
-
["body"] = ctx.Result.Body,
|
|
505
|
-
};
|
|
506
|
-
}
|
|
552
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
507
553
|
|
|
508
554
|
return null;
|
|
509
555
|
});
|
|
@@ -512,7 +558,7 @@ public class PrimaryUtilityTest
|
|
|
512
558
|
[Fact]
|
|
513
559
|
public void MakeResultBasic()
|
|
514
560
|
{
|
|
515
|
-
var ctx = MakeTestFullCtx(
|
|
561
|
+
var ctx = MakeTestFullCtx(GetClient(), GetUtil());
|
|
516
562
|
ctx.Spec = new Spec(new Dictionary<string, object?>
|
|
517
563
|
{
|
|
518
564
|
["base"] = "http://localhost:8080",
|
|
@@ -538,14 +584,14 @@ public class PrimaryUtilityTest
|
|
|
538
584
|
},
|
|
539
585
|
});
|
|
540
586
|
|
|
541
|
-
var result =
|
|
587
|
+
var result = GetUtil().MakeResult(ctx);
|
|
542
588
|
Assert.Equal(200, result.Status);
|
|
543
589
|
}
|
|
544
590
|
|
|
545
591
|
[Fact]
|
|
546
592
|
public void MakeResultNoSpec()
|
|
547
593
|
{
|
|
548
|
-
var ctx = MakeTestFullCtx(
|
|
594
|
+
var ctx = MakeTestFullCtx(GetClient(), GetUtil());
|
|
549
595
|
ctx.Spec = null;
|
|
550
596
|
ctx.Result = new Result(new Dictionary<string, object?>
|
|
551
597
|
{
|
|
@@ -555,98 +601,118 @@ public class PrimaryUtilityTest
|
|
|
555
601
|
["headers"] = new Dictionary<string, object?>(),
|
|
556
602
|
});
|
|
557
603
|
|
|
558
|
-
Assert.ThrowsAny<Exception>(() =>
|
|
604
|
+
Assert.ThrowsAny<Exception>(() => GetUtil().MakeResult(ctx));
|
|
559
605
|
}
|
|
560
606
|
|
|
561
607
|
[Fact]
|
|
562
608
|
public void MakeResultNoResult()
|
|
563
609
|
{
|
|
564
|
-
var ctx = MakeTestFullCtx(
|
|
610
|
+
var ctx = MakeTestFullCtx(GetClient(), GetUtil());
|
|
565
611
|
ctx.Spec = new Spec(new Dictionary<string, object?> { ["step"] = "start" });
|
|
566
612
|
ctx.Result = null;
|
|
567
613
|
|
|
568
|
-
Assert.ThrowsAny<Exception>(() =>
|
|
614
|
+
Assert.ThrowsAny<Exception>(() => GetUtil().MakeResult(ctx));
|
|
569
615
|
}
|
|
570
616
|
|
|
571
617
|
[Fact]
|
|
572
618
|
public void MakeSpecBasic()
|
|
573
619
|
{
|
|
574
|
-
var setupOpts = TestRunner.GetSpec(
|
|
620
|
+
var setupOpts = TestRunner.GetSpec(Run().Spec, "makeSpec", "DEF", "setup", "a");
|
|
575
621
|
var specClient = ProjectNameSDK.TestSDK(null, setupOpts);
|
|
576
622
|
var specUtility = specClient.GetUtility();
|
|
577
623
|
|
|
578
|
-
|
|
624
|
+
runsection("makeSpec", args =>
|
|
579
625
|
{
|
|
580
|
-
var
|
|
581
|
-
? c as Dictionary<string, object?> : null;
|
|
582
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, specClient, specUtility);
|
|
626
|
+
var ctx = OmniResolver.OmniCtx(args[0], specClient, specUtility);
|
|
583
627
|
ctx.Options = specClient.OptionsMap();
|
|
584
628
|
|
|
585
|
-
|
|
629
|
+
specUtility.MakeSpec(ctx);
|
|
586
630
|
|
|
587
|
-
|
|
588
|
-
if (ctxmap != null && ctx.Spec != null)
|
|
589
|
-
{
|
|
590
|
-
ctxmap["spec"] = new Dictionary<string, object?>
|
|
591
|
-
{
|
|
592
|
-
["base"] = ctx.Spec.Base,
|
|
593
|
-
["prefix"] = ctx.Spec.Prefix,
|
|
594
|
-
["suffix"] = ctx.Spec.Suffix,
|
|
595
|
-
["method"] = ctx.Spec.Method,
|
|
596
|
-
["params"] = ctx.Spec.Params,
|
|
597
|
-
["query"] = ctx.Spec.Query,
|
|
598
|
-
["headers"] = ctx.Spec.Headers,
|
|
599
|
-
["step"] = ctx.Spec.Step,
|
|
600
|
-
};
|
|
601
|
-
}
|
|
631
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
602
632
|
|
|
603
633
|
return null;
|
|
604
634
|
});
|
|
605
635
|
}
|
|
606
636
|
|
|
637
|
+
// A minimal IEntity: Context resolves the op through the entity
|
|
638
|
+
// interface, and a literal {name: ...} map from the fixture is not one
|
|
639
|
+
// - entname would be "" and every lookup would miss, reporting
|
|
640
|
+
// point_no_points for all cases. TS reads the same field with getprop
|
|
641
|
+
// and accepts the plain map. (The go peer is plEntity.)
|
|
642
|
+
private sealed class PlEntity : IEntity
|
|
643
|
+
{
|
|
644
|
+
private readonly string name;
|
|
645
|
+
|
|
646
|
+
public PlEntity(string name)
|
|
647
|
+
{
|
|
648
|
+
this.name = name;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
public string GetName() => name;
|
|
652
|
+
|
|
653
|
+
public IEntity Make() => new PlEntity(name);
|
|
654
|
+
|
|
655
|
+
public object? Data(object? data = null) => null;
|
|
656
|
+
|
|
657
|
+
public object? Match(object? match = null) => null;
|
|
658
|
+
|
|
659
|
+
public void MarkDeleted() { }
|
|
660
|
+
|
|
661
|
+
public bool Deleted() => false;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// Corpus-driven, like go: TS returns the error AS the value; C# throws
|
|
665
|
+
// ProjectNameError. The corpus says `match: out: code` for both, so
|
|
666
|
+
// the error is normalised to a map carrying its code here rather than
|
|
667
|
+
// forking the fixture per language.
|
|
607
668
|
[Fact]
|
|
608
669
|
public void MakePointBasic()
|
|
609
670
|
{
|
|
610
|
-
|
|
611
|
-
var point = new Dictionary<string, object?>
|
|
671
|
+
runsection("makePoint", args =>
|
|
612
672
|
{
|
|
613
|
-
[
|
|
614
|
-
|
|
673
|
+
var ctxmap = args[0] as Dictionary<string, object?>
|
|
674
|
+
?? new Dictionary<string, object?>();
|
|
675
|
+
|
|
676
|
+
if (ctxmap.TryGetValue("entity", out var em) &&
|
|
677
|
+
em is Dictionary<string, object?> entityMap)
|
|
615
678
|
{
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
};
|
|
624
|
-
ctx.Op!.Points = new List<Dictionary<string, object?>> { point };
|
|
679
|
+
var name = entityMap.TryGetValue("name", out var n)
|
|
680
|
+
? n as string ?? "" : "";
|
|
681
|
+
ctxmap = new Dictionary<string, object?>(ctxmap)
|
|
682
|
+
{
|
|
683
|
+
["entity"] = new PlEntity(name),
|
|
684
|
+
};
|
|
685
|
+
}
|
|
625
686
|
|
|
626
|
-
|
|
627
|
-
|
|
687
|
+
var ctx = OmniResolver.OmniCtx(ctxmap, GetClient(), GetUtil());
|
|
688
|
+
try
|
|
689
|
+
{
|
|
690
|
+
return GetUtil().MakePoint(ctx);
|
|
691
|
+
}
|
|
692
|
+
catch (ProjectNameError e)
|
|
693
|
+
{
|
|
694
|
+
return new Dictionary<string, object?> { ["code"] = e.Code };
|
|
695
|
+
}
|
|
696
|
+
});
|
|
628
697
|
}
|
|
629
698
|
|
|
630
699
|
[Fact]
|
|
631
700
|
public void MakeUrlBasic()
|
|
632
701
|
{
|
|
633
|
-
|
|
702
|
+
runsection("makeUrl", args =>
|
|
634
703
|
{
|
|
635
|
-
var
|
|
636
|
-
? c as Dictionary<string, object?> : null;
|
|
637
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
704
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
638
705
|
ctx.Result ??= new Result(new Dictionary<string, object?>());
|
|
639
|
-
return
|
|
706
|
+
return GetUtil().MakeUrl(ctx);
|
|
640
707
|
});
|
|
641
708
|
}
|
|
642
709
|
|
|
643
710
|
[Fact]
|
|
644
711
|
public void OperatorBasic()
|
|
645
712
|
{
|
|
646
|
-
|
|
713
|
+
runsection("operator", args =>
|
|
647
714
|
{
|
|
648
|
-
var inMap =
|
|
649
|
-
? i as Dictionary<string, object?> : null;
|
|
715
|
+
var inMap = args[0] as Dictionary<string, object?>;
|
|
650
716
|
var op = new Operation(inMap ?? new Dictionary<string, object?>());
|
|
651
717
|
return new Dictionary<string, object?>
|
|
652
718
|
{
|
|
@@ -661,51 +727,20 @@ public class PrimaryUtilityTest
|
|
|
661
727
|
[Fact]
|
|
662
728
|
public void ParamBasic()
|
|
663
729
|
{
|
|
664
|
-
|
|
730
|
+
runsection("param", args =>
|
|
665
731
|
{
|
|
666
|
-
|
|
667
|
-
? a as List<object?> : null;
|
|
668
|
-
if (args == null || args.Count < 2)
|
|
732
|
+
if (args.Length < 2)
|
|
669
733
|
{
|
|
670
734
|
return null;
|
|
671
735
|
}
|
|
672
736
|
|
|
673
|
-
var
|
|
674
|
-
?? new Dictionary<string, object?>();
|
|
675
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
737
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
676
738
|
var paramdef = args[1];
|
|
677
739
|
|
|
678
|
-
var result =
|
|
679
|
-
|
|
680
|
-
//
|
|
681
|
-
|
|
682
|
-
msRaw is Dictionary<string, object?> matchSpec &&
|
|
683
|
-
matchSpec.TryGetValue("ctx", out var cmRaw) &&
|
|
684
|
-
cmRaw is Dictionary<string, object?> ctxMatch &&
|
|
685
|
-
ctxMatch.TryGetValue("spec", out var smRaw) &&
|
|
686
|
-
smRaw is Dictionary<string, object?> specMatch &&
|
|
687
|
-
specMatch.ContainsKey("alias") &&
|
|
688
|
-
ctx.Spec != null)
|
|
689
|
-
{
|
|
690
|
-
if (entry.TryGetValue("ctx", out var ec) &&
|
|
691
|
-
ec is Dictionary<string, object?> entryCtx)
|
|
692
|
-
{
|
|
693
|
-
entryCtx["spec"] = new Dictionary<string, object?>
|
|
694
|
-
{
|
|
695
|
-
["alias"] = ctx.Spec.Alias,
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
else
|
|
699
|
-
{
|
|
700
|
-
entry["ctx"] = new Dictionary<string, object?>
|
|
701
|
-
{
|
|
702
|
-
["spec"] = new Dictionary<string, object?>
|
|
703
|
-
{
|
|
704
|
-
["alias"] = ctx.Spec.Alias,
|
|
705
|
-
},
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
}
|
|
740
|
+
var result = GetUtil().Param(ctx, paramdef);
|
|
741
|
+
|
|
742
|
+
// The spec alias mutation is what the match assertions read.
|
|
743
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
709
744
|
|
|
710
745
|
return result;
|
|
711
746
|
});
|
|
@@ -714,27 +749,17 @@ public class PrimaryUtilityTest
|
|
|
714
749
|
[Fact]
|
|
715
750
|
public void PrepareAuthBasic()
|
|
716
751
|
{
|
|
717
|
-
var setupOpts = TestRunner.GetSpec(
|
|
752
|
+
var setupOpts = TestRunner.GetSpec(Run().Spec, "prepareAuth", "DEF", "setup", "a");
|
|
718
753
|
var authClient = ProjectNameSDK.TestSDK(null, setupOpts);
|
|
719
754
|
var authUtility = authClient.GetUtility();
|
|
720
755
|
|
|
721
|
-
|
|
756
|
+
runsection("prepareAuth", args =>
|
|
722
757
|
{
|
|
723
|
-
var
|
|
724
|
-
? c as Dictionary<string, object?> : null;
|
|
725
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, authClient, authUtility);
|
|
726
|
-
TestRunner.FixCtx(ctx, authClient);
|
|
758
|
+
var ctx = OmniResolver.OmniCtx(args[0], authClient, authUtility);
|
|
727
759
|
|
|
728
|
-
|
|
760
|
+
authUtility.PrepareAuth(ctx);
|
|
729
761
|
|
|
730
|
-
|
|
731
|
-
if (ctxmap != null && ctx.Spec != null)
|
|
732
|
-
{
|
|
733
|
-
ctxmap["spec"] = new Dictionary<string, object?>
|
|
734
|
-
{
|
|
735
|
-
["headers"] = ctx.Spec.Headers,
|
|
736
|
-
};
|
|
737
|
-
}
|
|
762
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
738
763
|
|
|
739
764
|
return null;
|
|
740
765
|
});
|
|
@@ -743,91 +768,79 @@ public class PrimaryUtilityTest
|
|
|
743
768
|
[Fact]
|
|
744
769
|
public void PrepareBodyBasic()
|
|
745
770
|
{
|
|
746
|
-
|
|
771
|
+
runsection("prepareBody", args =>
|
|
747
772
|
{
|
|
748
|
-
var
|
|
749
|
-
|
|
750
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
751
|
-
TestRunner.FixCtx(ctx, _client);
|
|
752
|
-
return _utility.PrepareBody(ctx);
|
|
773
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
774
|
+
return GetUtil().PrepareBody(ctx);
|
|
753
775
|
});
|
|
754
776
|
}
|
|
755
777
|
|
|
756
778
|
[Fact]
|
|
757
779
|
public void PrepareHeadersBasic()
|
|
758
780
|
{
|
|
759
|
-
|
|
781
|
+
runsection("prepareHeaders", args =>
|
|
760
782
|
{
|
|
761
|
-
var
|
|
762
|
-
|
|
763
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
764
|
-
return _utility.PrepareHeaders(ctx);
|
|
783
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
784
|
+
return GetUtil().PrepareHeaders(ctx);
|
|
765
785
|
});
|
|
766
786
|
}
|
|
767
787
|
|
|
768
788
|
[Fact]
|
|
769
789
|
public void PrepareMethodBasic()
|
|
770
790
|
{
|
|
771
|
-
|
|
791
|
+
runsection("prepareMethod", args =>
|
|
772
792
|
{
|
|
773
|
-
var
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
793
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
794
|
+
// An op the API does not define resolves NO method; ts answers
|
|
795
|
+
// undefined there and C# answers null - both are "no value" to
|
|
796
|
+
// the corpus.
|
|
797
|
+
var method = GetUtil().PrepareMethod(ctx);
|
|
798
|
+
return string.IsNullOrEmpty(method) ? null : method;
|
|
777
799
|
});
|
|
778
800
|
}
|
|
779
801
|
|
|
780
802
|
[Fact]
|
|
781
803
|
public void PrepareParamsBasic()
|
|
782
804
|
{
|
|
783
|
-
|
|
805
|
+
runsection("prepareParams", args =>
|
|
784
806
|
{
|
|
785
|
-
var
|
|
786
|
-
|
|
787
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
788
|
-
return _utility.PrepareParams(ctx);
|
|
807
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
808
|
+
return GetUtil().PrepareParams(ctx);
|
|
789
809
|
});
|
|
790
810
|
}
|
|
791
811
|
|
|
792
812
|
// Was two hand-written cases that had drifted out of the shared corpus
|
|
793
|
-
// (the preparePath fixture shipped as an empty `set: []`). Now driven
|
|
794
|
-
// the corpus like every other section, so all ports assert the same
|
|
813
|
+
// (the preparePath fixture shipped as an empty `set: []`). Now driven
|
|
814
|
+
// by the corpus like every other section, so all ports assert the same
|
|
795
815
|
// separator / blank-segment behaviour.
|
|
796
816
|
[Fact]
|
|
797
817
|
public void PreparePathBasic()
|
|
798
818
|
{
|
|
799
|
-
|
|
819
|
+
runsection("preparePath", args =>
|
|
800
820
|
{
|
|
801
|
-
var
|
|
802
|
-
|
|
803
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
804
|
-
return _utility.PreparePath(ctx);
|
|
821
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
822
|
+
return GetUtil().PreparePath(ctx);
|
|
805
823
|
});
|
|
806
824
|
}
|
|
807
825
|
|
|
808
826
|
[Fact]
|
|
809
827
|
public void PrepareQueryBasic()
|
|
810
828
|
{
|
|
811
|
-
|
|
829
|
+
runsection("prepareQuery", args =>
|
|
812
830
|
{
|
|
813
|
-
var
|
|
814
|
-
|
|
815
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
816
|
-
return _utility.PrepareQuery(ctx);
|
|
831
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
832
|
+
return GetUtil().PrepareQuery(ctx);
|
|
817
833
|
});
|
|
818
834
|
}
|
|
819
835
|
|
|
820
836
|
[Fact]
|
|
821
837
|
public void ResultBasicBasic()
|
|
822
838
|
{
|
|
823
|
-
|
|
839
|
+
runsection("resultBasic", args =>
|
|
824
840
|
{
|
|
825
|
-
var
|
|
826
|
-
? c as Dictionary<string, object?> : null;
|
|
827
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
828
|
-
TestRunner.FixCtx(ctx, _client);
|
|
841
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
829
842
|
|
|
830
|
-
var result =
|
|
843
|
+
var result = GetUtil().ResultBasic(ctx);
|
|
831
844
|
|
|
832
845
|
var res = new Dictionary<string, object?>
|
|
833
846
|
{
|
|
@@ -849,21 +862,13 @@ public class PrimaryUtilityTest
|
|
|
849
862
|
[Fact]
|
|
850
863
|
public void ResultBodyBasic()
|
|
851
864
|
{
|
|
852
|
-
|
|
865
|
+
runsection("resultBody", args =>
|
|
853
866
|
{
|
|
854
|
-
var
|
|
855
|
-
? c as Dictionary<string, object?> : null;
|
|
856
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
867
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
857
868
|
|
|
858
|
-
|
|
869
|
+
GetUtil().ResultBody(ctx);
|
|
859
870
|
|
|
860
|
-
|
|
861
|
-
{
|
|
862
|
-
ctxmap["result"] = new Dictionary<string, object?>
|
|
863
|
-
{
|
|
864
|
-
["body"] = ctx.Result.Body,
|
|
865
|
-
};
|
|
866
|
-
}
|
|
871
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
867
872
|
|
|
868
873
|
return null;
|
|
869
874
|
});
|
|
@@ -872,21 +877,13 @@ public class PrimaryUtilityTest
|
|
|
872
877
|
[Fact]
|
|
873
878
|
public void ResultHeadersBasic()
|
|
874
879
|
{
|
|
875
|
-
|
|
880
|
+
runsection("resultHeaders", args =>
|
|
876
881
|
{
|
|
877
|
-
var
|
|
878
|
-
? c as Dictionary<string, object?> : null;
|
|
879
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
882
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
880
883
|
|
|
881
|
-
|
|
884
|
+
GetUtil().ResultHeaders(ctx);
|
|
882
885
|
|
|
883
|
-
|
|
884
|
-
{
|
|
885
|
-
ctxmap["result"] = new Dictionary<string, object?>
|
|
886
|
-
{
|
|
887
|
-
["headers"] = ctx.Result.Headers,
|
|
888
|
-
};
|
|
889
|
-
}
|
|
886
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
890
887
|
|
|
891
888
|
return null;
|
|
892
889
|
});
|
|
@@ -895,21 +892,14 @@ public class PrimaryUtilityTest
|
|
|
895
892
|
[Fact]
|
|
896
893
|
public void TransformRequestBasic()
|
|
897
894
|
{
|
|
898
|
-
|
|
895
|
+
runsection("transformRequest", args =>
|
|
899
896
|
{
|
|
900
|
-
var
|
|
901
|
-
? c as Dictionary<string, object?> : null;
|
|
902
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
897
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
903
898
|
|
|
904
|
-
var result =
|
|
899
|
+
var result = GetUtil().TransformRequest(ctx);
|
|
905
900
|
|
|
906
|
-
//
|
|
907
|
-
|
|
908
|
-
ctxmap.TryGetValue("spec", out var smRaw) &&
|
|
909
|
-
smRaw is Dictionary<string, object?> specMap)
|
|
910
|
-
{
|
|
911
|
-
specMap["step"] = ctx.Spec.Step;
|
|
912
|
-
}
|
|
901
|
+
// The step advance is what the match assertion reads.
|
|
902
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
913
903
|
|
|
914
904
|
return result;
|
|
915
905
|
});
|
|
@@ -918,20 +908,13 @@ public class PrimaryUtilityTest
|
|
|
918
908
|
[Fact]
|
|
919
909
|
public void TransformResponseBasic()
|
|
920
910
|
{
|
|
921
|
-
|
|
911
|
+
runsection("transformResponse", args =>
|
|
922
912
|
{
|
|
923
|
-
var
|
|
924
|
-
? c as Dictionary<string, object?> : null;
|
|
925
|
-
var ctx = TestRunner.MakeCtxFromMap(ctxmap, _client, _utility);
|
|
913
|
+
var ctx = OmniResolver.OmniCtx(args[0], GetClient(), GetUtil());
|
|
926
914
|
|
|
927
|
-
var result =
|
|
915
|
+
var result = GetUtil().TransformResponse(ctx);
|
|
928
916
|
|
|
929
|
-
|
|
930
|
-
ctxmap.TryGetValue("spec", out var smRaw) &&
|
|
931
|
-
smRaw is Dictionary<string, object?> specMap)
|
|
932
|
-
{
|
|
933
|
-
specMap["step"] = ctx.Spec.Step;
|
|
934
|
-
}
|
|
917
|
+
OmniResolver.OmniSyncCtx(args[0], ctx);
|
|
935
918
|
|
|
936
919
|
return result;
|
|
937
920
|
});
|