@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
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
# The corpus test runner: vendored voxgig_omni driven through its NATIVE
|
|
2
|
+
# API (`make_runner(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
|
+
# ruby peer of tm/ts/test/omni.ts and tm/py/test/omni.py.
|
|
8
|
+
#
|
|
9
|
+
# Four local decisions, all required:
|
|
10
|
+
#
|
|
11
|
+
# 1. SPEC PATH. omni's own spec resolution expects the caller to hand it
|
|
12
|
+
# a usable path. A relative path is absolutized against THIS file'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 entry). A
|
|
18
|
+
# 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 via
|
|
21
|
+
# client.features. So the provider here is a READ-THROUGH view of the
|
|
22
|
+
# live SDK instance: a Hash subclass holding the omni hooks whose
|
|
23
|
+
# method calls fall through to the SDK - the ruby spelling of ts's
|
|
24
|
+
# prototype delegation. (Upstream omni#56 tracks giving the stock
|
|
25
|
+
# provider the same shape.)
|
|
26
|
+
#
|
|
27
|
+
# 3. UNDEF-ARGUMENT ENTRIES. Entries with no `in`, `args` or `ctx` mean
|
|
28
|
+
# "call the subject the way this port always has". omni's generic rule
|
|
29
|
+
# is `args = [clone(entry.in)]`, one nil - but ruby's retired struct
|
|
30
|
+
# runner passed `[VoxgigStruct::UNDEF]`, the port's own absence
|
|
31
|
+
# sentinel, and subjects like pathify branch on it. `undefargs` below
|
|
32
|
+
# ports the correction from upstream omni's ruby compat shim
|
|
33
|
+
# (voxgig/omni ruby compat/struct.rb), rewriting those entries to an
|
|
34
|
+
# explicit `args` of one sentinel - in memory, for this port only.
|
|
35
|
+
# `wrapsubject` is the same shim's other half: a subject RESULT of
|
|
36
|
+
# UNDEF (getelem's default alt) is translated to omni's ABSENT so the
|
|
37
|
+
# two absence models never meet.
|
|
38
|
+
#
|
|
39
|
+
# 4. MATCH-VISIBLE CONTEXTS. The SDK's context is a CLASS INSTANCE, not
|
|
40
|
+
# the plain map ts contexts are, and omni's `match` walks the entry's
|
|
41
|
+
# ctx with map access - against a bare instance every `match: {ctx:
|
|
42
|
+
# ...}` assertion would read ABSENT. `ObjView` wraps the live context
|
|
43
|
+
# as a Hash subclass whose map face mirrors the instance's attributes
|
|
44
|
+
# (snake_case attributes answering to the corpus's camelCase keys), so
|
|
45
|
+
# omni's clone-at-match-time takes a faithful snapshot of the
|
|
46
|
+
# POST-EXECUTION context while subjects keep ordinary method access to
|
|
47
|
+
# the live object.
|
|
48
|
+
#
|
|
49
|
+
# THE VENDORED RUBY PORT LACKS THE omni#54 RUNNER FIXES the TypeScript
|
|
50
|
+
# port has at this tag (upstream voxgig/omni#64 landed them for js/go/py
|
|
51
|
+
# only). Vendored files are resynced, never edited, so each gap is
|
|
52
|
+
# covered HERE instead:
|
|
53
|
+
#
|
|
54
|
+
# a. `match()` clones its base and the vendored clone()/jsonstr() have no
|
|
55
|
+
# cycle guard. Ruby's live cycles all pass through objects, not plain
|
|
56
|
+
# Hashes, so the raw objects are inert to both walks - the exposure is
|
|
57
|
+
# the map-face views this resolver introduces. ObjView therefore
|
|
58
|
+
# HIDES the cycle edges (`client`/`utility` on every view, `ctx` on
|
|
59
|
+
# error views - runner/SDK bookkeeping the corpus never asserts on)
|
|
60
|
+
# and carries its wrapping ancestry, so a repeated object stays
|
|
61
|
+
# unwrapped and every clone/jsonstr walk terminates.
|
|
62
|
+
#
|
|
63
|
+
# b. `errify`/`errmessage` collapse non-Exception throwables. Ruby can
|
|
64
|
+
# only raise Exceptions, so that gap cannot fire here; the provider
|
|
65
|
+
# still declares its own `errify` so `match: {err: {code: ...}}` can
|
|
66
|
+
# see an SDK error's code, which the stock {name,message} shape drops.
|
|
67
|
+
|
|
68
|
+
require 'json'
|
|
69
|
+
|
|
70
|
+
require_relative 'vendor/omni/voxgig_omni'
|
|
71
|
+
|
|
72
|
+
module ProjectNameOmni
|
|
73
|
+
TEST_DIR = File.expand_path(__dir__)
|
|
74
|
+
|
|
75
|
+
NULLMARK = VoxgigOmni::NULLMARK
|
|
76
|
+
UNDEFMARK = VoxgigOmni::UNDEFMARK
|
|
77
|
+
EXISTSMARK = VoxgigOmni::EXISTSMARK
|
|
78
|
+
ABSENT = VoxgigOmni::ABSENT
|
|
79
|
+
OmniError = VoxgigOmni::OmniError
|
|
80
|
+
|
|
81
|
+
# Attribute names the map face of a view does not mirror. client and
|
|
82
|
+
# utility both reach the SDK, whose root context reaches the client
|
|
83
|
+
# again - the cycle omni's guardless clone would follow forever; an
|
|
84
|
+
# error's ctx is the same cycle one hop in (generated make_error
|
|
85
|
+
# attaches the live context to every error it raises). Subjects still
|
|
86
|
+
# reach all three through the method face; the corpus never asserts on
|
|
87
|
+
# any of them.
|
|
88
|
+
VIEW_HIDE = %w[client utility].freeze
|
|
89
|
+
VIEW_HIDE_ERR = %w[client utility ctx].freeze
|
|
90
|
+
|
|
91
|
+
# Ruby cannot name an attribute `alias`, so the Spec object spells it
|
|
92
|
+
# `alias_map` - but the corpus speaks the wire name.
|
|
93
|
+
VIEW_ALIAS = { 'alias' => 'alias_map' }.freeze
|
|
94
|
+
VIEW_ALIAS_BACK = { 'alias_map' => 'alias' }.freeze
|
|
95
|
+
|
|
96
|
+
module_function
|
|
97
|
+
|
|
98
|
+
def camelize(name)
|
|
99
|
+
return VIEW_ALIAS_BACK[name] if VIEW_ALIAS_BACK.key?(name)
|
|
100
|
+
|
|
101
|
+
parts = name.split('_')
|
|
102
|
+
parts[0] + parts[1..].map { |p| p.empty? ? p : p[0].upcase + p[1..] }.join
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def underscore(name)
|
|
106
|
+
name.gsub(/([A-Z])/) { '_' + Regexp.last_match(1).downcase }
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def plainval?(val)
|
|
110
|
+
val.nil? || val.is_a?(::String) || val.is_a?(::Numeric) ||
|
|
111
|
+
val.is_a?(::TrueClass) || val.is_a?(::FalseClass) ||
|
|
112
|
+
val.is_a?(::Symbol) || val.is_a?(::Hash) || val.is_a?(::Array) ||
|
|
113
|
+
val.is_a?(::Proc) || val.is_a?(::Method) || val.equal?(ABSENT)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# A live map view of one object, for omni's match phase.
|
|
117
|
+
#
|
|
118
|
+
# Hash SUBCLASS, because omni's ismap() is an is_a?(Hash) check and its
|
|
119
|
+
# clone() materialises maps via each: cloning a view yields a plain
|
|
120
|
+
# deep snapshot of the object's attributes at that moment - match runs
|
|
121
|
+
# after the subject, so the snapshot carries the mutations the corpus
|
|
122
|
+
# asserts on. Method calls (and assignment) fall through to the live
|
|
123
|
+
# object, so test subjects use the view exactly as they would the
|
|
124
|
+
# object itself.
|
|
125
|
+
#
|
|
126
|
+
# nil-valued attributes are OMITTED from the map face: ruby's "not set"
|
|
127
|
+
# is nil where ts's is undefined, and mirroring nil as a present key
|
|
128
|
+
# would let `__EXISTS__` accept an unset field.
|
|
129
|
+
#
|
|
130
|
+
# `seen` carries the wrapping ancestry so a cyclic reach terminates: a
|
|
131
|
+
# repeated object stays unwrapped, which match reads as ABSENT - no
|
|
132
|
+
# corpus case matches into a cycle.
|
|
133
|
+
class ObjView < ::Hash
|
|
134
|
+
def initialize(target, seen = nil)
|
|
135
|
+
super()
|
|
136
|
+
@view_target = target
|
|
137
|
+
@view_seen = seen || {}.freeze
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def view_target
|
|
141
|
+
@view_target
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# --- method face: the live object ---
|
|
145
|
+
|
|
146
|
+
def method_missing(name, *args, &blk)
|
|
147
|
+
t = @view_target
|
|
148
|
+
return t.send(name, *args, &blk) if t.respond_to?(name)
|
|
149
|
+
|
|
150
|
+
super
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def respond_to_missing?(name, include_private = false)
|
|
154
|
+
@view_target.respond_to?(name, include_private) || super
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# --- map face: what omni walks ---
|
|
158
|
+
|
|
159
|
+
def view_names
|
|
160
|
+
t = @view_target
|
|
161
|
+
hide = t.is_a?(::Exception) ? VIEW_HIDE_ERR : VIEW_HIDE
|
|
162
|
+
t.instance_variables.map { |iv| iv.to_s[1..] }
|
|
163
|
+
.reject { |n| n.start_with?('_') || hide.include?(n) }
|
|
164
|
+
.reject { |n| t.instance_variable_get("@#{n}").nil? }
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def view_wrap(name)
|
|
168
|
+
t = @view_target
|
|
169
|
+
seen = @view_seen
|
|
170
|
+
val = t.instance_variable_get("@#{name}")
|
|
171
|
+
|
|
172
|
+
# A view held INSIDE the object graph must continue THIS
|
|
173
|
+
# traversal's ancestry, not restart its own - a restarted chain
|
|
174
|
+
# never terminates on the cycle it re-enters.
|
|
175
|
+
if val.is_a?(ObjView)
|
|
176
|
+
tgt = val.view_target
|
|
177
|
+
return tgt if seen.key?(tgt.object_id)
|
|
178
|
+
|
|
179
|
+
return ObjView.new(tgt, seen.merge(t.object_id => true).freeze)
|
|
180
|
+
end
|
|
181
|
+
return val if ProjectNameOmni.plainval?(val) || seen.key?(val.object_id)
|
|
182
|
+
|
|
183
|
+
ObjView.new(val, seen.merge(t.object_id => true).freeze)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
def view_attrname(key)
|
|
187
|
+
t = @view_target
|
|
188
|
+
key = key.to_s
|
|
189
|
+
name = VIEW_ALIAS[key] || key
|
|
190
|
+
return name if t.instance_variable_defined?("@#{name}")
|
|
191
|
+
|
|
192
|
+
snake = ProjectNameOmni.underscore(name)
|
|
193
|
+
return snake if t.instance_variable_defined?("@#{snake}")
|
|
194
|
+
|
|
195
|
+
nil
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def keys
|
|
199
|
+
out = view_names.map { |n| ProjectNameOmni.camelize(n) }
|
|
200
|
+
out << 'message' if @view_target.is_a?(::Exception) && !out.include?('message')
|
|
201
|
+
out
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def each
|
|
205
|
+
keys.each { |k| yield [k, self[k]] }
|
|
206
|
+
self
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
def length
|
|
210
|
+
keys.length
|
|
211
|
+
end
|
|
212
|
+
alias size length
|
|
213
|
+
|
|
214
|
+
def empty?
|
|
215
|
+
keys.empty?
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def key?(key)
|
|
219
|
+
return true if 'message' == key.to_s && @view_target.is_a?(::Exception)
|
|
220
|
+
|
|
221
|
+
!view_attrname(key).nil?
|
|
222
|
+
end
|
|
223
|
+
alias has_key? key?
|
|
224
|
+
alias include? key?
|
|
225
|
+
alias member? key?
|
|
226
|
+
|
|
227
|
+
def [](key)
|
|
228
|
+
t = @view_target
|
|
229
|
+
return t.message if 'message' == key.to_s && t.is_a?(::Exception) &&
|
|
230
|
+
!t.instance_variable_defined?('@message')
|
|
231
|
+
|
|
232
|
+
name = view_attrname(key)
|
|
233
|
+
name.nil? ? nil : view_wrap(name)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
def []=(key, val)
|
|
237
|
+
# omni's runner writes `first['client'] = testpack[:client]` into a
|
|
238
|
+
# ctx entry's first argument - route it to the live object, which
|
|
239
|
+
# is where prepare_auth and friends will read it back.
|
|
240
|
+
t = @view_target
|
|
241
|
+
name = view_attrname(key) || ProjectNameOmni.underscore(key.to_s)
|
|
242
|
+
setter = "#{name}="
|
|
243
|
+
if t.respond_to?(setter)
|
|
244
|
+
t.send(setter, val)
|
|
245
|
+
else
|
|
246
|
+
t.instance_variable_set("@#{name}", val)
|
|
247
|
+
end
|
|
248
|
+
val
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
def to_s
|
|
252
|
+
"#<ObjView #{@view_target.class}>"
|
|
253
|
+
end
|
|
254
|
+
alias inspect to_s
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# An omni provider that is also the live SDK.
|
|
258
|
+
#
|
|
259
|
+
# omni reads a provider as a mapping (`provider[:subject]`), while
|
|
260
|
+
# corpus code reaches through the runpack's client as an SDK
|
|
261
|
+
# (`client.options_map`, `client.features`). The Hash half holds the
|
|
262
|
+
# hooks; every other method resolves against the live SDK instance,
|
|
263
|
+
# and attribute assignment lands on it too.
|
|
264
|
+
class SdkProvider < ::Hash
|
|
265
|
+
def method_missing(name, *args, &blk)
|
|
266
|
+
sdk = self[:sdk]
|
|
267
|
+
return sdk.send(name, *args, &blk) if !sdk.nil? && sdk.respond_to?(name)
|
|
268
|
+
|
|
269
|
+
super
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def respond_to_missing?(name, include_private = false)
|
|
273
|
+
sdk = self[:sdk]
|
|
274
|
+
(!sdk.nil? && sdk.respond_to?(name, include_private)) || super
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# The corpus spells an entity as `{"name" => ...}`; resolve_op wants an
|
|
279
|
+
# object with get_name. Nothing else is read from it.
|
|
280
|
+
class EntityRef
|
|
281
|
+
def initialize(name)
|
|
282
|
+
@name = name
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def get_name
|
|
286
|
+
@name
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# The sdkgen corpus writes contexts as pure JSON, and the ruby context
|
|
291
|
+
# constructor only adopts spec/result/response given as INSTANCES - so
|
|
292
|
+
# the JSON forms are materialised here, exactly as the retired inline
|
|
293
|
+
# runner's make_ctx_from_map did.
|
|
294
|
+
def enrich(ctxmap, ctx)
|
|
295
|
+
spec_map = ctxmap['spec']
|
|
296
|
+
ctx.spec = ProjectNameSpec.new(spec_map) if spec_map.is_a?(::Hash)
|
|
297
|
+
|
|
298
|
+
res_map = ctxmap['result']
|
|
299
|
+
if res_map.is_a?(::Hash)
|
|
300
|
+
ctx.result = ProjectNameResult.new(res_map)
|
|
301
|
+
err_map = res_map['err']
|
|
302
|
+
if err_map.is_a?(::Hash) && err_map['message'].is_a?(::String) &&
|
|
303
|
+
!err_map['message'].empty?
|
|
304
|
+
ctx.result.err = ProjectNameError.new('', err_map['message'])
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
resp_map = ctxmap['response']
|
|
309
|
+
if resp_map.is_a?(::Hash)
|
|
310
|
+
ctx.response = ProjectNameResponse.new(resp_map)
|
|
311
|
+
unless resp_map['body'].nil?
|
|
312
|
+
body_copy = resp_map['body']
|
|
313
|
+
ctx.response.json_func = -> { body_copy }
|
|
314
|
+
end
|
|
315
|
+
headers = resp_map['headers']
|
|
316
|
+
if headers.is_a?(::Hash)
|
|
317
|
+
lower = {}
|
|
318
|
+
headers.each { |k, v| lower[k.downcase] = v }
|
|
319
|
+
ctx.response.headers = lower
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
ctx
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# The omni hooks for an SDK subject - what upstream's compat shim
|
|
327
|
+
# called structprovider, inlined here because this resolver is the one
|
|
328
|
+
# consumer.
|
|
329
|
+
def sdkhooks(sdk)
|
|
330
|
+
utility = sdk.get_utility
|
|
331
|
+
|
|
332
|
+
subject = lambda do |name|
|
|
333
|
+
# A subject resolves from the utility (the corpus's camelCase name
|
|
334
|
+
# in ruby's snake_case spelling), or from the struct utilities.
|
|
335
|
+
snake = underscore(name.to_s)
|
|
336
|
+
found = utility.respond_to?(snake) ? utility.send(snake) : nil
|
|
337
|
+
if found.nil? && VoxgigStruct.respond_to?(name)
|
|
338
|
+
found = VoxgigStruct.method(name)
|
|
339
|
+
end
|
|
340
|
+
wrapsubject(found)
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
client = lambda do |options|
|
|
344
|
+
# A DEF.client entry becomes another SDK instance - rewrapped with
|
|
345
|
+
# the same delegating shape, not a plain hook object.
|
|
346
|
+
sdkprovider(sdk.class.test(nil, options))
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
contextify = lambda do |val|
|
|
350
|
+
ctxmap = val.is_a?(::Hash) ? val.dup : {}
|
|
351
|
+
ent = ctxmap['entity']
|
|
352
|
+
if ent.is_a?(::Hash) && ent['name'].is_a?(::String)
|
|
353
|
+
ctxmap['entity'] = EntityRef.new(ent['name'])
|
|
354
|
+
end
|
|
355
|
+
ctx = utility.make_context.call(ctxmap, nil)
|
|
356
|
+
enrich(ctxmap, ctx)
|
|
357
|
+
ctx.utility = utility
|
|
358
|
+
ctx.options = sdk.options_map if ctx.options.nil?
|
|
359
|
+
ObjView.new(ctx)
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
inject = lambda do |options, store|
|
|
363
|
+
VoxgigStruct.respond_to?(:inject) ?
|
|
364
|
+
VoxgigStruct.inject(options, store) : options
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
errify = ->(err) { ProjectNameOmni.errify(err) }
|
|
368
|
+
|
|
369
|
+
{
|
|
370
|
+
subject: subject,
|
|
371
|
+
client: client,
|
|
372
|
+
contextify: contextify,
|
|
373
|
+
inject: inject,
|
|
374
|
+
errify: errify,
|
|
375
|
+
sdk: sdk,
|
|
376
|
+
}
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# The JSON form of an error, with the error's own attributes carried
|
|
380
|
+
# along - the ruby peer of the vendored python port's errify, which the
|
|
381
|
+
# vendored ruby runner lacks (it keeps only {name,message}, dropping
|
|
382
|
+
# the `code` the corpus asserts refusals by). Used as the provider's
|
|
383
|
+
# errify hook (match.err), and by subjects that answer WITH an error
|
|
384
|
+
# value (makePoint).
|
|
385
|
+
def errify(err)
|
|
386
|
+
return { 'name' => 'Error', 'message' => err.to_s } unless err.is_a?(::Exception)
|
|
387
|
+
|
|
388
|
+
out = {}
|
|
389
|
+
err.instance_variables.each do |iv|
|
|
390
|
+
name = iv.to_s[1..]
|
|
391
|
+
next if name.start_with?('_') || VIEW_HIDE_ERR.include?(name)
|
|
392
|
+
|
|
393
|
+
val = err.instance_variable_get(iv)
|
|
394
|
+
out[name] = val unless val.nil?
|
|
395
|
+
end
|
|
396
|
+
out['name'] = err.class.name
|
|
397
|
+
out['message'] = err.message
|
|
398
|
+
out
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
def sdkprovider(sdk)
|
|
402
|
+
provider = SdkProvider.new
|
|
403
|
+
sdkhooks(sdk).each { |k, v| provider[k] = v }
|
|
404
|
+
provider
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
# Replace struct's absence sentinel with omni's, at any depth (from
|
|
408
|
+
# upstream omni's ruby compat shim).
|
|
409
|
+
def absentify(val)
|
|
410
|
+
return ABSENT if val.equal?(VoxgigStruct::UNDEF)
|
|
411
|
+
return val.map { |entry| absentify(entry) } if val.is_a?(::Array)
|
|
412
|
+
|
|
413
|
+
if val.instance_of?(::Hash)
|
|
414
|
+
out = {}
|
|
415
|
+
val.each { |key, subval| out[key] = absentify(subval) }
|
|
416
|
+
return out
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
val
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
# A subject whose result speaks omni's absence model.
|
|
423
|
+
def wrapsubject(subject)
|
|
424
|
+
return subject if subject.nil? || !subject.respond_to?(:call)
|
|
425
|
+
|
|
426
|
+
->(*args) { absentify(subject.call(*args)) }
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# Restore ruby's UNDEF-argument reading for entries carrying none of
|
|
430
|
+
# `in`, `args`, `ctx` (see decision 3 above). Rewritten in memory, for
|
|
431
|
+
# this port only - the corpus on disk is untouched.
|
|
432
|
+
ARGKEYS = %w[in args ctx].freeze
|
|
433
|
+
|
|
434
|
+
def noargs?(entry)
|
|
435
|
+
entry.is_a?(::Hash) && (entry.keys & ARGKEYS).empty?
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
def undefargs(testspec)
|
|
439
|
+
return testspec unless testspec.is_a?(::Hash) && testspec['set'].is_a?(::Array)
|
|
440
|
+
return testspec unless testspec['set'].any? { |entry| noargs?(entry) }
|
|
441
|
+
|
|
442
|
+
patched = testspec['set'].map do |entry|
|
|
443
|
+
if noargs?(entry)
|
|
444
|
+
entry = entry.dup
|
|
445
|
+
entry['args'] = [VoxgigStruct::UNDEF]
|
|
446
|
+
end
|
|
447
|
+
entry
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
out = testspec.dup
|
|
451
|
+
out['set'] = patched
|
|
452
|
+
out
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
# The suites write flags with string keys (`{ 'null' => false }`); the
|
|
456
|
+
# vendored runner reads them as symbols. Translate (from the upstream
|
|
457
|
+
# compat shim).
|
|
458
|
+
def normflags(flags)
|
|
459
|
+
return {} if flags.nil?
|
|
460
|
+
return flags unless flags.is_a?(::Hash)
|
|
461
|
+
|
|
462
|
+
out = {}
|
|
463
|
+
flags.each { |key, val| out[key.is_a?(::String) ? key.to_sym : key] = val }
|
|
464
|
+
out
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
# struct's make_runner(testfile, client) signature, backed by vendored
|
|
468
|
+
# omni. Also accepts an already-parsed spec object (omni's own
|
|
469
|
+
# capability), which keeps smoke tests free of fixture files.
|
|
470
|
+
def make_runner(testfile, client)
|
|
471
|
+
specref =
|
|
472
|
+
if testfile.is_a?(::String) && !File.absolute_path?(testfile)
|
|
473
|
+
File.join(TEST_DIR, testfile)
|
|
474
|
+
else
|
|
475
|
+
testfile
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
provider = sdkprovider(client)
|
|
479
|
+
runner = VoxgigOmni.make_runner(specref, provider)
|
|
480
|
+
|
|
481
|
+
lambda do |name = nil, store = nil|
|
|
482
|
+
runpack = runner.call(name, store.nil? ? {} : store)
|
|
483
|
+
|
|
484
|
+
omniflags = runpack[:runsetflags]
|
|
485
|
+
runsetflags = lambda do |testspec, flags = nil, testsubject = nil|
|
|
486
|
+
omniflags.call(undefargs(testspec), normflags(flags),
|
|
487
|
+
wrapsubject(testsubject))
|
|
488
|
+
end
|
|
489
|
+
runset = ->(testspec, testsubject = nil) { runsetflags.call(testspec, {}, testsubject) }
|
|
490
|
+
|
|
491
|
+
{
|
|
492
|
+
spec: runpack[:spec],
|
|
493
|
+
runset: runset,
|
|
494
|
+
runsetflags: runsetflags,
|
|
495
|
+
subject: runpack[:subject],
|
|
496
|
+
client: provider,
|
|
497
|
+
}
|
|
498
|
+
end
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
# Convert NULLMARK sentinels back into real nulls.
|
|
502
|
+
def null_modifier(val, key, parent, *rest)
|
|
503
|
+
VoxgigOmni::Runner.nullmodifier(val, key, parent, *rest)
|
|
504
|
+
end
|
|
505
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
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. (Ruby peer of ts's
|
|
4
|
+
# test/omni.test.ts and py's test_omni_smoke.py.)
|
|
5
|
+
|
|
6
|
+
require "minitest/autorun"
|
|
7
|
+
require_relative "../ProjectName_sdk"
|
|
8
|
+
require_relative "omni"
|
|
9
|
+
|
|
10
|
+
class OmniSmokeTest < Minitest::Test
|
|
11
|
+
# A minimal in-memory spec: no fixture file, no OMNI block (lenient v0,
|
|
12
|
+
# like the shared corpus).
|
|
13
|
+
SMOKE_SPEC = {
|
|
14
|
+
"primary" => {
|
|
15
|
+
"smoke" => {
|
|
16
|
+
"basic" => {
|
|
17
|
+
"set" => [
|
|
18
|
+
{ "in" => 1, "out" => 2 },
|
|
19
|
+
{ "in" => 41, "out" => 42 },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
"bad" => {
|
|
23
|
+
"set" => [
|
|
24
|
+
{ "in" => 1, "out" => 999 },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
"err" => {
|
|
28
|
+
"set" => [
|
|
29
|
+
{ "in" => 0, "err" => "zero refused" },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}.freeze
|
|
35
|
+
|
|
36
|
+
INC = lambda do |n|
|
|
37
|
+
raise "smoke: zero refused" if 0 == n
|
|
38
|
+
|
|
39
|
+
n + 1
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def smoke_pack
|
|
43
|
+
runner = ProjectNameOmni.make_runner(SMOKE_SPEC, ProjectNameSDK.test(nil, nil))
|
|
44
|
+
runner.call("smoke")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def test_runset_passes_a_correct_subject
|
|
48
|
+
pack = smoke_pack
|
|
49
|
+
pack[:runset].call(pack[:spec]["basic"], INC)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def test_runset_fails_a_wrong_result_with_omnierror
|
|
53
|
+
pack = smoke_pack
|
|
54
|
+
caught = assert_raises(ProjectNameOmni::OmniError) do
|
|
55
|
+
pack[:runset].call(pack[:spec]["bad"], INC)
|
|
56
|
+
end
|
|
57
|
+
assert_includes caught.message, "result mismatch"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def test_expected_error_matched_and_missing_error_fails
|
|
61
|
+
pack = smoke_pack
|
|
62
|
+
|
|
63
|
+
# The expected error occurs: passes.
|
|
64
|
+
pack[:runset].call(pack[:spec]["err"], INC)
|
|
65
|
+
|
|
66
|
+
# The expected error does NOT occur: must fail.
|
|
67
|
+
caught = assert_raises(ProjectNameOmni::OmniError) do
|
|
68
|
+
pack[:runset].call(pack[:spec]["err"], ->(n) { n })
|
|
69
|
+
end
|
|
70
|
+
assert_includes caught.message, "expected error did not occur"
|
|
71
|
+
end
|
|
72
|
+
end
|