@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
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# The corpus test runner: vendored voxgig_omni driven through its NATIVE
|
|
2
|
+
# API (`makeRunner(specref, provider)`), presented to the corpus tests in
|
|
3
|
+
# the struct-runner shape they already use (`R["spec"]`, `R["runset"]`,
|
|
4
|
+
# `R["runsetflags"]`, `R["client"]`). No compat shim is vendored: the
|
|
5
|
+
# adapter below IS the whole bridge, per language, per the vendor-tag
|
|
6
|
+
# rollout (docs/design/vendor-tag-rollout.md, Decision 4). It is the
|
|
7
|
+
# python peer of tm/ts/test/omni.ts.
|
|
8
|
+
#
|
|
9
|
+
# Four local decisions, all required:
|
|
10
|
+
#
|
|
11
|
+
# 1. SPEC PATH. omni's own spec resolution expects the caller to hand it a
|
|
12
|
+
# usable path. A relative path is absolutized against THIS module's
|
|
13
|
+
# directory (test/), so the existing '../../.sdk/test/test.json'
|
|
14
|
+
# constant keeps working verbatim wherever the suite is run from.
|
|
15
|
+
#
|
|
16
|
+
# 2. PROVIDER DELEGATION. Corpus-driven contexts get `ctx.client` set to
|
|
17
|
+
# the runner's provider (omni overwrites it on any ctx/args map entry).
|
|
18
|
+
# A five-hook provider object HIDES the live SDK from the generated
|
|
19
|
+
# utilities that reach through it - prepare_auth via
|
|
20
|
+
# client.options_map(), fetcher via client.mode, feature_add appending
|
|
21
|
+
# to client.features. So the provider here is a READ-THROUGH view of
|
|
22
|
+
# the live SDK instance: a dict subclass holding the omni hooks whose
|
|
23
|
+
# attribute access falls through to the SDK, the python spelling of
|
|
24
|
+
# ts's prototype delegation. (Upstream omni#56 tracks giving the stock
|
|
25
|
+
# provider the same shape.)
|
|
26
|
+
#
|
|
27
|
+
# 3. ZERO-ARGUMENT ENTRIES. Entries with no `in`, `args` or `ctx` mean
|
|
28
|
+
# "call the subject with NO argument". omni's generic rule is
|
|
29
|
+
# `args = [clone(entry.in)]`, which passes one None where python must
|
|
30
|
+
# pass nothing - typify() is 1073741824 where typify(None) is 4194432.
|
|
31
|
+
# `zeroargs` below ports the correction from upstream omni's python
|
|
32
|
+
# compat shim (voxgig/omni python compat/struct.py), rewriting those
|
|
33
|
+
# entries to an explicit empty `args` in memory, for this port only.
|
|
34
|
+
#
|
|
35
|
+
# 4. MATCH-VISIBLE CONTEXTS. The SDK's context is a CLASS INSTANCE, not
|
|
36
|
+
# the plain map ts contexts are, and omni's `match` walks the entry's
|
|
37
|
+
# ctx with map access - against a bare instance every `match: {ctx:
|
|
38
|
+
# ...}` assertion would read ABSENT. `CtxView` wraps the live context
|
|
39
|
+
# as a dict subclass whose map face mirrors the instance's attributes
|
|
40
|
+
# (snake_case attributes answering to the corpus's camelCase keys), so
|
|
41
|
+
# omni's clone-at-match-time takes a faithful snapshot of the
|
|
42
|
+
# POST-EXECUTION context while subjects keep ordinary attribute access
|
|
43
|
+
# to the live object.
|
|
44
|
+
|
|
45
|
+
import os
|
|
46
|
+
|
|
47
|
+
from projectname_sdk.core.spec import ProjectNameSpec
|
|
48
|
+
from projectname_sdk.core.result import ProjectNameResult
|
|
49
|
+
from projectname_sdk.core.response import ProjectNameResponse
|
|
50
|
+
from projectname_sdk.core.error import ProjectNameError
|
|
51
|
+
from projectname_sdk.utility.voxgig_struct import voxgig_struct as vs
|
|
52
|
+
|
|
53
|
+
from test.voxgig_omni import (
|
|
54
|
+
EXISTSMARK,
|
|
55
|
+
NULLMARK,
|
|
56
|
+
UNDEFMARK,
|
|
57
|
+
OmniError,
|
|
58
|
+
islist,
|
|
59
|
+
ismap,
|
|
60
|
+
nullmodifier,
|
|
61
|
+
)
|
|
62
|
+
from test.voxgig_omni import makeRunner as omni_make_runner
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
_TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# Attribute names the map face of a context view does not mirror. Both
|
|
69
|
+
# reach the client, and the client's root context reaches the client
|
|
70
|
+
# again - a cycle omni's guardless clone would follow forever. Subjects
|
|
71
|
+
# still reach both through the attribute face; the corpus never matches
|
|
72
|
+
# on either.
|
|
73
|
+
_CTX_HIDE = ('client', 'utility')
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _camel(name):
|
|
77
|
+
"""`status_text` -> `statusText`: the corpus speaks camelCase, the SDK
|
|
78
|
+
is snake_case, and the map face is the corpus-facing side."""
|
|
79
|
+
parts = name.split('_')
|
|
80
|
+
return parts[0] + ''.join(p[:1].upper() + p[1:] for p in parts[1:])
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _is_plain(val):
|
|
84
|
+
return val is None or isinstance(
|
|
85
|
+
val, (str, int, float, bool, dict, list, tuple))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ObjView(dict):
|
|
89
|
+
"""A live map view of one python object, for omni's match phase.
|
|
90
|
+
|
|
91
|
+
dict-SUBCLASS, because omni's ismap() is an isinstance check and its
|
|
92
|
+
clone() materialises maps via items(): cloning a view yields a plain
|
|
93
|
+
deep snapshot of the object's public attributes at that moment -
|
|
94
|
+
match runs after the subject, so the snapshot carries the mutations
|
|
95
|
+
the corpus asserts on. Attribute access (and assignment) falls
|
|
96
|
+
through to the live object, so test subjects use the view exactly as
|
|
97
|
+
they would the object itself.
|
|
98
|
+
|
|
99
|
+
None-valued attributes are OMITTED from the map face: python's "not
|
|
100
|
+
set" is None where ts's is undefined, and mirroring None as a present
|
|
101
|
+
key would let `__EXISTS__` accept an unset field.
|
|
102
|
+
|
|
103
|
+
`seen` carries the wrapping ancestry so a cyclic reach (result.err
|
|
104
|
+
holding the ctx that holds the result) terminates: a repeated object
|
|
105
|
+
stays unwrapped, which match reads as ABSENT - no corpus case
|
|
106
|
+
matches into a cycle.
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
def __init__(self, target, seen=None):
|
|
110
|
+
super().__init__()
|
|
111
|
+
object.__setattr__(self, '_target', target)
|
|
112
|
+
object.__setattr__(self, '_seen', seen or frozenset())
|
|
113
|
+
|
|
114
|
+
# --- attribute face: the live object ---
|
|
115
|
+
|
|
116
|
+
def __getattr__(self, name):
|
|
117
|
+
return getattr(object.__getattribute__(self, '_target'), name)
|
|
118
|
+
|
|
119
|
+
def __setattr__(self, name, val):
|
|
120
|
+
setattr(object.__getattribute__(self, '_target'), name, val)
|
|
121
|
+
|
|
122
|
+
# --- map face: what omni walks ---
|
|
123
|
+
|
|
124
|
+
def _names(self):
|
|
125
|
+
target = object.__getattribute__(self, '_target')
|
|
126
|
+
return [n for n in vars(target)
|
|
127
|
+
if not n.startswith('_') and n not in _CTX_HIDE
|
|
128
|
+
and getattr(target, n, None) is not None]
|
|
129
|
+
|
|
130
|
+
def _wrapped(self, name):
|
|
131
|
+
target = object.__getattribute__(self, '_target')
|
|
132
|
+
seen = object.__getattribute__(self, '_seen')
|
|
133
|
+
val = getattr(target, name)
|
|
134
|
+
# A view held INSIDE the object graph (an error that captured the
|
|
135
|
+
# ctx it was raised with holds the view the subject received) must
|
|
136
|
+
# continue THIS traversal's ancestry, not restart its own - a
|
|
137
|
+
# restarted chain never terminates on the cycle it re-enters.
|
|
138
|
+
if isinstance(val, ObjView):
|
|
139
|
+
tgt = object.__getattribute__(val, '_target')
|
|
140
|
+
if id(tgt) in seen:
|
|
141
|
+
return tgt
|
|
142
|
+
return ObjView(tgt, seen | {id(target)})
|
|
143
|
+
if _is_plain(val) or callable(val) or id(val) in seen:
|
|
144
|
+
return val
|
|
145
|
+
return ObjView(val, seen | {id(target)})
|
|
146
|
+
|
|
147
|
+
def _attrname(self, key):
|
|
148
|
+
target = object.__getattribute__(self, '_target')
|
|
149
|
+
key = str(key)
|
|
150
|
+
if hasattr(target, key):
|
|
151
|
+
return key
|
|
152
|
+
snake = ''.join(
|
|
153
|
+
'_' + c.lower() if c.isupper() else c for c in key)
|
|
154
|
+
return snake if hasattr(target, snake) else None
|
|
155
|
+
|
|
156
|
+
def keys(self):
|
|
157
|
+
return [_camel(n) for n in self._names()]
|
|
158
|
+
|
|
159
|
+
def items(self):
|
|
160
|
+
return [(_camel(n), self._wrapped(n)) for n in self._names()]
|
|
161
|
+
|
|
162
|
+
def values(self):
|
|
163
|
+
return [self._wrapped(n) for n in self._names()]
|
|
164
|
+
|
|
165
|
+
def __iter__(self):
|
|
166
|
+
return iter(self.keys())
|
|
167
|
+
|
|
168
|
+
def __len__(self):
|
|
169
|
+
return len(self._names())
|
|
170
|
+
|
|
171
|
+
def __contains__(self, key):
|
|
172
|
+
return self._attrname(key) is not None
|
|
173
|
+
|
|
174
|
+
def __getitem__(self, key):
|
|
175
|
+
name = self._attrname(key)
|
|
176
|
+
if name is None:
|
|
177
|
+
raise KeyError(key)
|
|
178
|
+
return self._wrapped(name)
|
|
179
|
+
|
|
180
|
+
def __setitem__(self, key, val):
|
|
181
|
+
# omni's runner writes `first['client'] = testpack['client']` into
|
|
182
|
+
# a ctx/args entry's first argument - route it to the live object,
|
|
183
|
+
# which is where prepare_auth and friends will read it back.
|
|
184
|
+
setattr(object.__getattribute__(self, '_target'), str(key), val)
|
|
185
|
+
|
|
186
|
+
def get(self, key, default=None):
|
|
187
|
+
name = self._attrname(key)
|
|
188
|
+
return default if name is None else self._wrapped(name)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class SdkProvider(dict):
|
|
192
|
+
"""An omni provider that is also the live SDK.
|
|
193
|
+
|
|
194
|
+
omni reads a provider as a mapping (`provider.get('subject')`), while
|
|
195
|
+
corpus code reaches through the runpack's client as an SDK
|
|
196
|
+
(`client._utility`, `client.options_map()`). The dict half holds the
|
|
197
|
+
hooks; everything else resolves against the live SDK instance, and
|
|
198
|
+
attribute assignment lands on it too.
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
def __getattr__(self, name):
|
|
202
|
+
try:
|
|
203
|
+
return self[name]
|
|
204
|
+
except KeyError:
|
|
205
|
+
pass
|
|
206
|
+
try:
|
|
207
|
+
return getattr(self['sdk'], name)
|
|
208
|
+
except KeyError:
|
|
209
|
+
raise AttributeError(name) from None
|
|
210
|
+
|
|
211
|
+
def __setattr__(self, name, val):
|
|
212
|
+
setattr(self['sdk'], name, val)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def _snake(name):
|
|
216
|
+
"""`makeContext` -> `make_context`: corpus subject names are
|
|
217
|
+
camelCase, the SDK utility is snake_case."""
|
|
218
|
+
return ''.join('_' + c.lower() if c.isupper() else c for c in name)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def _enrich(ctxmap, ctx):
|
|
222
|
+
"""The sdkgen corpus writes contexts as pure JSON, and the python
|
|
223
|
+
context constructor only adopts spec/result/response given as
|
|
224
|
+
INSTANCES - so the JSON forms are materialised here, exactly as the
|
|
225
|
+
retired inline runner's _make_ctx_from_map did."""
|
|
226
|
+
|
|
227
|
+
spec_map = ctxmap.get('spec')
|
|
228
|
+
if isinstance(spec_map, dict):
|
|
229
|
+
ctx.spec = ProjectNameSpec(spec_map)
|
|
230
|
+
|
|
231
|
+
res_map = ctxmap.get('result')
|
|
232
|
+
if isinstance(res_map, dict):
|
|
233
|
+
ctx.result = ProjectNameResult(res_map)
|
|
234
|
+
err_map = res_map.get('err')
|
|
235
|
+
if isinstance(err_map, dict):
|
|
236
|
+
msg = err_map.get('message', '')
|
|
237
|
+
if msg != '':
|
|
238
|
+
ctx.result.err = ProjectNameError('', msg)
|
|
239
|
+
|
|
240
|
+
resp_map = ctxmap.get('response')
|
|
241
|
+
if isinstance(resp_map, dict):
|
|
242
|
+
ctx.response = ProjectNameResponse(resp_map)
|
|
243
|
+
body = resp_map.get('body')
|
|
244
|
+
if body is not None:
|
|
245
|
+
body_copy = body
|
|
246
|
+
ctx.response.json_func = lambda: body_copy
|
|
247
|
+
headers = resp_map.get('headers')
|
|
248
|
+
if isinstance(headers, dict):
|
|
249
|
+
ctx.response.headers = {
|
|
250
|
+
k.lower(): v for k, v in headers.items()}
|
|
251
|
+
|
|
252
|
+
return ctx
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class _EntityRef:
|
|
256
|
+
"""The corpus spells an entity as `{"name": ...}`; resolve_op wants
|
|
257
|
+
an object with get_name(). Nothing else is read from it."""
|
|
258
|
+
|
|
259
|
+
def __init__(self, name):
|
|
260
|
+
self._name = name
|
|
261
|
+
|
|
262
|
+
def get_name(self):
|
|
263
|
+
return self._name
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _sdkhooks(sdk):
|
|
267
|
+
"""The omni hooks for an SDK subject - what upstream's compat shim
|
|
268
|
+
called structprovider, inlined here because this resolver is the one
|
|
269
|
+
consumer."""
|
|
270
|
+
|
|
271
|
+
utility = sdk._utility
|
|
272
|
+
struct_utils = vs.StructUtility()
|
|
273
|
+
|
|
274
|
+
# `client.utility().struct` is how the struct corpus suite reaches the
|
|
275
|
+
# struct utilities (mirrors ts). The python utility object does not
|
|
276
|
+
# carry them natively, so the resolver attaches a StructUtility once.
|
|
277
|
+
if getattr(utility, 'struct', None) is None:
|
|
278
|
+
utility.struct = struct_utils
|
|
279
|
+
|
|
280
|
+
def subject(name):
|
|
281
|
+
# A subject resolves from the utility (camelCase or the python
|
|
282
|
+
# spelling), or from the struct utilities.
|
|
283
|
+
found = getattr(utility, name, None)
|
|
284
|
+
if found is None:
|
|
285
|
+
found = getattr(utility, _snake(name), None)
|
|
286
|
+
if found is None:
|
|
287
|
+
found = getattr(struct_utils, name, None)
|
|
288
|
+
return found
|
|
289
|
+
|
|
290
|
+
def client(options):
|
|
291
|
+
# A DEF.client entry becomes another SDK instance - rewrapped
|
|
292
|
+
# with the same delegating shape, not a plain hook object.
|
|
293
|
+
return _sdkprovider(type(sdk).test(None, options))
|
|
294
|
+
|
|
295
|
+
def contextify(val):
|
|
296
|
+
# The SDK supplies its own context wrapper; the corpus JSON is
|
|
297
|
+
# materialised into it, and the result is served through the
|
|
298
|
+
# match-visible view (decision 4 above).
|
|
299
|
+
ctxmap = dict(val) if isinstance(val, dict) else {}
|
|
300
|
+
ent = ctxmap.get('entity')
|
|
301
|
+
if isinstance(ent, dict) and isinstance(ent.get('name'), str):
|
|
302
|
+
ctxmap['entity'] = _EntityRef(ent['name'])
|
|
303
|
+
ctx = utility.make_context(ctxmap, None)
|
|
304
|
+
_enrich(ctxmap, ctx)
|
|
305
|
+
ctx.utility = utility
|
|
306
|
+
if ctx.options is None:
|
|
307
|
+
ctx.options = sdk.options_map()
|
|
308
|
+
return CtxView(ctx)
|
|
309
|
+
|
|
310
|
+
def inject(options, store):
|
|
311
|
+
injector = getattr(struct_utils, 'inject', None)
|
|
312
|
+
if callable(injector):
|
|
313
|
+
return injector(options, store)
|
|
314
|
+
return options
|
|
315
|
+
|
|
316
|
+
return {
|
|
317
|
+
'subject': subject,
|
|
318
|
+
'client': client,
|
|
319
|
+
'contextify': contextify,
|
|
320
|
+
'inject': inject,
|
|
321
|
+
'utility': lambda: sdk._utility,
|
|
322
|
+
'tester': lambda options=None: type(sdk).test(None, options),
|
|
323
|
+
'sdk': sdk,
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
# The context view is just an ObjView rooted at a context; named so call
|
|
328
|
+
# sites read as what they hold.
|
|
329
|
+
CtxView = ObjView
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
def _sdkprovider(sdk):
|
|
333
|
+
return SdkProvider(_sdkhooks(sdk))
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def zeroargs(testspec):
|
|
337
|
+
"""Restore python's zero-argument reading for entries carrying none of
|
|
338
|
+
`in`, `args`, `ctx` (see decision 3 above; ported from upstream omni's
|
|
339
|
+
python compat shim). Rewritten in memory, for this port only - an
|
|
340
|
+
authored `args: []` on disk would break the fixed-arity ports."""
|
|
341
|
+
if not isinstance(testspec, dict) or not islist(testspec.get('set')):
|
|
342
|
+
return testspec
|
|
343
|
+
|
|
344
|
+
entries = testspec['set']
|
|
345
|
+
if not any(
|
|
346
|
+
isinstance(e, dict) and not ({'in', 'args', 'ctx'} & set(e.keys()))
|
|
347
|
+
for e in entries
|
|
348
|
+
):
|
|
349
|
+
return testspec
|
|
350
|
+
|
|
351
|
+
patched = []
|
|
352
|
+
for entry in entries:
|
|
353
|
+
if isinstance(entry, dict) and not (
|
|
354
|
+
{'in', 'args', 'ctx'} & set(entry.keys())):
|
|
355
|
+
entry = dict(entry)
|
|
356
|
+
entry['args'] = []
|
|
357
|
+
patched.append(entry)
|
|
358
|
+
|
|
359
|
+
testspec = dict(testspec)
|
|
360
|
+
testspec['set'] = patched
|
|
361
|
+
return testspec
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def makeRunner(testfile, client):
|
|
365
|
+
"""struct's makeRunner(testfile, client) signature, backed by vendored
|
|
366
|
+
omni. Also accepts an already-parsed spec object (omni's own
|
|
367
|
+
capability), which keeps smoke tests free of fixture files."""
|
|
368
|
+
if not isinstance(testfile, str):
|
|
369
|
+
specref = testfile
|
|
370
|
+
elif os.path.isabs(testfile):
|
|
371
|
+
specref = testfile
|
|
372
|
+
else:
|
|
373
|
+
specref = os.path.join(_TEST_DIR, testfile)
|
|
374
|
+
|
|
375
|
+
provider = _sdkprovider(client)
|
|
376
|
+
runner = omni_make_runner(specref, provider)
|
|
377
|
+
|
|
378
|
+
def structrunner(name=None, store=None):
|
|
379
|
+
runpack = runner(name, store)
|
|
380
|
+
|
|
381
|
+
omni_runset = runpack['runset']
|
|
382
|
+
omni_runsetflags = runpack['runsetflags']
|
|
383
|
+
|
|
384
|
+
def runset(testspec, testsubject=None):
|
|
385
|
+
return omni_runset(zeroargs(testspec), testsubject)
|
|
386
|
+
|
|
387
|
+
def runsetflags(testspec, flags=None, testsubject=None):
|
|
388
|
+
return omni_runsetflags(zeroargs(testspec), flags, testsubject)
|
|
389
|
+
|
|
390
|
+
return {
|
|
391
|
+
'spec': runpack['spec'],
|
|
392
|
+
'runset': runset,
|
|
393
|
+
'runsetflags': runsetflags,
|
|
394
|
+
'subject': runpack['subject'],
|
|
395
|
+
'client': provider,
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return structrunner
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
# struct's flag-modifier name, served from native omni.
|
|
402
|
+
nullModifier = nullmodifier
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
__all__ = [
|
|
406
|
+
'EXISTSMARK',
|
|
407
|
+
'NULLMARK',
|
|
408
|
+
'UNDEFMARK',
|
|
409
|
+
'OmniError',
|
|
410
|
+
'CtxView',
|
|
411
|
+
'SdkProvider',
|
|
412
|
+
'makeRunner',
|
|
413
|
+
'nullModifier',
|
|
414
|
+
'zeroargs',
|
|
415
|
+
]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Smoke tests for the vendored omni runner itself: a runner that cannot
|
|
2
|
+
# FAIL a bad entry would turn every corpus suite vacuously green, so pin
|
|
3
|
+
# the failure paths, not just the happy one. (Python peer of ts's
|
|
4
|
+
# test/omni.test.ts.)
|
|
5
|
+
|
|
6
|
+
import unittest
|
|
7
|
+
|
|
8
|
+
from projectname_sdk import ProjectNameSDK
|
|
9
|
+
|
|
10
|
+
from test.omni import OmniError, makeRunner
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# A minimal in-memory spec: no fixture file, no OMNI block (lenient v0,
|
|
14
|
+
# like the shared corpus).
|
|
15
|
+
SPEC = {
|
|
16
|
+
'primary': {
|
|
17
|
+
'smoke': {
|
|
18
|
+
'basic': {
|
|
19
|
+
'set': [
|
|
20
|
+
{'in': 1, 'out': 2},
|
|
21
|
+
{'in': 41, 'out': 42},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
'bad': {
|
|
25
|
+
'set': [
|
|
26
|
+
{'in': 1, 'out': 999},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
'err': {
|
|
30
|
+
'set': [
|
|
31
|
+
{'in': 0, 'err': 'zero refused'},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def inc(n):
|
|
40
|
+
if 0 == n:
|
|
41
|
+
raise ValueError('smoke: zero refused')
|
|
42
|
+
return n + 1
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class TestOmniSmoke(unittest.TestCase):
|
|
46
|
+
|
|
47
|
+
def _pack(self):
|
|
48
|
+
runner = makeRunner(SPEC, ProjectNameSDK.test(None, None))
|
|
49
|
+
return runner('smoke')
|
|
50
|
+
|
|
51
|
+
def test_runset_passes_a_correct_subject(self):
|
|
52
|
+
R = self._pack()
|
|
53
|
+
R['runset'](R['spec']['basic'], inc)
|
|
54
|
+
|
|
55
|
+
def test_runset_fails_a_wrong_result_with_omnierror(self):
|
|
56
|
+
R = self._pack()
|
|
57
|
+
with self.assertRaises(OmniError) as caught:
|
|
58
|
+
R['runset'](R['spec']['bad'], inc)
|
|
59
|
+
self.assertIn('result mismatch', str(caught.exception))
|
|
60
|
+
|
|
61
|
+
def test_expected_error_matched_and_missing_error_fails(self):
|
|
62
|
+
R = self._pack()
|
|
63
|
+
|
|
64
|
+
# The expected error occurs: passes.
|
|
65
|
+
R['runset'](R['spec']['err'], inc)
|
|
66
|
+
|
|
67
|
+
# The expected error does NOT occur: must fail.
|
|
68
|
+
with self.assertRaises(OmniError) as caught:
|
|
69
|
+
R['runset'](R['spec']['err'], lambda n: n)
|
|
70
|
+
self.assertIn('expected error did not occur', str(caught.exception))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
if __name__ == '__main__':
|
|
74
|
+
unittest.main()
|