@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,377 @@
|
|
|
1
|
+
# ProjectName SDK corpus test runner: the vendored @voxgig/omni engine driven
|
|
2
|
+
# through its NATIVE API (`Voxgig.Omni.Runner.make_runner/2`), presented to the
|
|
3
|
+
# corpus suites in the runner shape they already use (`:spec`, `:runset`,
|
|
4
|
+
# `:runsetflags`, `:client`). No compatibility shim is vendored: the adapter
|
|
5
|
+
# below IS the whole bridge, per language, per the vendor-tag rollout
|
|
6
|
+
# (docs/design/vendor-tag-rollout.md, Decision 4). It is the Elixir peer of
|
|
7
|
+
# tm/lua/test/omni.lua, tm/rb/test/omni.rb, tm/clojure/test/sdk/test/omni.clj
|
|
8
|
+
# and tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift.
|
|
9
|
+
#
|
|
10
|
+
# Five local decisions, each load-bearing:
|
|
11
|
+
#
|
|
12
|
+
# 1. TWO VALUE MODELS, converted at the subject boundary. omni's Elixir port
|
|
13
|
+
# speaks IMMUTABLE native data - `ismap` is `is_map/1` minus structs,
|
|
14
|
+
# `islist` is `is_list/1`, absence is the `:"$omni_absent"` atom. The SDK
|
|
15
|
+
# and its vendored struct speak a MUTABLE ETS HEAP, because struct's
|
|
16
|
+
# contract is that a utility MUTATES the node it is given: a node there is
|
|
17
|
+
# a tagged handle - `{:vmap, id}` / `{:vlist, id}` - which is a TUPLE, so
|
|
18
|
+
# omni's own predicates read every SDK node as an opaque leaf and its
|
|
19
|
+
# walkers never descend into one. Neither model recognises the other, so
|
|
20
|
+
# `wrapsubject` converts every argument on the way in (`tostruct`) and the
|
|
21
|
+
# result on the way out (`toomni`).
|
|
22
|
+
#
|
|
23
|
+
# 2. ARGUMENT WRITEBACK VIA `runsetflags_args`. 13 struct entries assert an
|
|
24
|
+
# IN-PLACE rewrite of the argument - `minor/setpath` in all 7 and
|
|
25
|
+
# `merge/integrity` in all 6. The subject mutates the HEAP COPY that
|
|
26
|
+
# decision 1 built, which the immutable list omni holds can never see. The
|
|
27
|
+
# port carries a second entry point for exactly this (`runsetflags_args`:
|
|
28
|
+
# the subject returns `{args, result}` and `checkresult` builds the `args`
|
|
29
|
+
# base from what came back), so every subject goes through it and hands its
|
|
30
|
+
# post-call arguments back. omni-rust, omni-cpp, omni-ocaml and omni-swift
|
|
31
|
+
# use the same channel for the same reason.
|
|
32
|
+
#
|
|
33
|
+
# 3. `match: {ctx: ...}` IS RETARGETED ONTO `match: {args: {"0": ...}}`.
|
|
34
|
+
# Nine primary entries assert on context state the utility WROTE, and
|
|
35
|
+
# `checkresult` reads that base from `entry.ctx` - which `resolveargs`
|
|
36
|
+
# froze BEFORE the subject ran. In a mutable-object port the frozen
|
|
37
|
+
# reference and the live context are the same thing; on the BEAM they are
|
|
38
|
+
# two values, so every such assertion would read the pre-call state. omni's
|
|
39
|
+
# own args channel (decision 2) is the post-call view, and args[0] IS the
|
|
40
|
+
# ctx of a ctx entry - omni itself sets `args = [entry.ctx]` - so moving
|
|
41
|
+
# the assertion from `ctx` to `args.0` reads the SAME map, post-call, and
|
|
42
|
+
# preserves every leaf. `retargetctx/1` does that rewrite on the spec
|
|
43
|
+
# handed to the engine; nothing is dropped, weakened or skipped. This is
|
|
44
|
+
# the Swift port's decision 3, for the identical value-semantics reason;
|
|
45
|
+
# the upstream fix is for `run_entry` to re-point `entry["ctx"]` at the
|
|
46
|
+
# returned `callargs` head, filed as a follow-up rather than worked around
|
|
47
|
+
# by editing a vendored file.
|
|
48
|
+
#
|
|
49
|
+
# 4. NO-VALUE ARITY. An entry carrying none of `in`/`args`/`ctx` must reach
|
|
50
|
+
# the subject as NO value, not as one null: the corpus has both
|
|
51
|
+
# `{in: null, out: <T_null>}` and `{out: <T_noval>}`, and a port that
|
|
52
|
+
# collapses them silently passes one of the two. omni models the absence
|
|
53
|
+
# as its ABSENT sentinel; `trimabsent/1` drops trailing absents so the
|
|
54
|
+
# subject receives an EMPTY argument list, which is what the corpus
|
|
55
|
+
# subjects already branch on (`typify()` answers T_noval where
|
|
56
|
+
# `typify(nil)` answers T_null, and `stringify/0` and `pathify/0` carry the
|
|
57
|
+
# same no-arg arity).
|
|
58
|
+
#
|
|
59
|
+
# 5. NIL ON THE WAY OUT IS ABSENT. Elixir has one `nil` where the canonical
|
|
60
|
+
# port has `undefined` and `null`, so a subject that returns NOTHING and
|
|
61
|
+
# one that returns JSON null are indistinguishable here (the struct port
|
|
62
|
+
# says so in its own header: "the canonical `undefined` and JSON `null` are
|
|
63
|
+
# both `nil`"). Only the `{null: false}` groups can tell, and there the
|
|
64
|
+
# corpus is lopsided: reading a top-level `nil` as ABSENT costs 4 entries
|
|
65
|
+
# (named and guarded in struct_corpus_test.exs), reading it as null costs
|
|
66
|
+
# 43. So a TOP-LEVEL nil result becomes ABSENT; a nil stored INSIDE a
|
|
67
|
+
# returned node stays a JSON null, because struct's `setprop` genuinely
|
|
68
|
+
# stores it and `keysof` genuinely reports the key.
|
|
69
|
+
#
|
|
70
|
+
# The live SDK crosses both converters BY REFERENCE: a struct heap handle is a
|
|
71
|
+
# tuple and the provider carries `@livekey`, so neither is ever rebuilt as
|
|
72
|
+
# corpus data and no cyclic SDK object is ever walked.
|
|
73
|
+
|
|
74
|
+
defmodule ProjectName.Omni do
|
|
75
|
+
alias Voxgig.Omni.Runner
|
|
76
|
+
alias Voxgig.Omni.Util, as: U
|
|
77
|
+
alias Voxgig.Struct, as: S
|
|
78
|
+
|
|
79
|
+
# Marks the provider map as a LIVE object rather than corpus data, so
|
|
80
|
+
# `tostruct` hands it across by reference instead of rebuilding it as a
|
|
81
|
+
# struct node (which would leave every `ctx.client` reader with a heap map
|
|
82
|
+
# that answers nothing).
|
|
83
|
+
@livekey :__omni_live__
|
|
84
|
+
@counter :__omni_cases__
|
|
85
|
+
|
|
86
|
+
# --- omni's own vocabulary, re-exported ----------------------------------
|
|
87
|
+
#
|
|
88
|
+
# The corpus suites and the smoke test never reach into the vendored
|
|
89
|
+
# namespaces themselves.
|
|
90
|
+
|
|
91
|
+
def nullmark, do: U.nullmark()
|
|
92
|
+
def undefmark, do: U.undefmark()
|
|
93
|
+
def existsmark, do: U.existsmark()
|
|
94
|
+
def absent, do: U.absent()
|
|
95
|
+
|
|
96
|
+
def omnierror?(%Voxgig.Omni.OmniError{}), do: true
|
|
97
|
+
def omnierror?(_), do: false
|
|
98
|
+
|
|
99
|
+
def stringify(val), do: U.stringify(val)
|
|
100
|
+
def deepequal(a, b), do: U.deepequal(a, b)
|
|
101
|
+
|
|
102
|
+
# --- executed-case tally -------------------------------------------------
|
|
103
|
+
#
|
|
104
|
+
# omni raises on the first failure rather than tallying, so a suite that
|
|
105
|
+
# passes proves nothing about HOW MUCH ran. Every subject invocation is
|
|
106
|
+
# counted here and the suites assert a floor, which is what catches a
|
|
107
|
+
# renamed corpus section or a spec that compiled to an empty set.
|
|
108
|
+
|
|
109
|
+
def reset_cases, do: Process.put(@counter, 0)
|
|
110
|
+
def cases, do: Process.get(@counter, 0)
|
|
111
|
+
defp tally, do: Process.put(@counter, Process.get(@counter, 0) + 1)
|
|
112
|
+
|
|
113
|
+
# --- decision 1: omni's model -> the SDK's -------------------------------
|
|
114
|
+
|
|
115
|
+
@doc "Convert one omni value into the SDK's struct model."
|
|
116
|
+
def tostruct(val) do
|
|
117
|
+
cond do
|
|
118
|
+
U.isabsent(val) ->
|
|
119
|
+
nil
|
|
120
|
+
|
|
121
|
+
live?(val) ->
|
|
122
|
+
val
|
|
123
|
+
|
|
124
|
+
is_map(val) and not is_struct(val) ->
|
|
125
|
+
S.jm(Enum.flat_map(val, fn {key, sub} -> [to_string(key), tostruct(sub)] end))
|
|
126
|
+
|
|
127
|
+
is_list(val) ->
|
|
128
|
+
S.jt(Enum.map(val, &tostruct/1))
|
|
129
|
+
|
|
130
|
+
true ->
|
|
131
|
+
val
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
defp live?(val), do: is_map(val) and not is_struct(val) and Map.has_key?(val, @livekey)
|
|
136
|
+
|
|
137
|
+
# --- decision 1/5: the SDK's model -> omni's -----------------------------
|
|
138
|
+
|
|
139
|
+
@doc """
|
|
140
|
+
Convert one SDK value into omni's model.
|
|
141
|
+
|
|
142
|
+
`top` distinguishes the RESULT position from a position inside a returned
|
|
143
|
+
node: only a top-level nil becomes ABSENT (decision 5).
|
|
144
|
+
"""
|
|
145
|
+
def toomni(val), do: toomni(val, [], true)
|
|
146
|
+
def toomni(val, top) when is_boolean(top), do: toomni(val, [], top)
|
|
147
|
+
|
|
148
|
+
defp toomni(val, seen, top) do
|
|
149
|
+
cond do
|
|
150
|
+
val == S.noarg() ->
|
|
151
|
+
U.absent()
|
|
152
|
+
|
|
153
|
+
is_nil(val) ->
|
|
154
|
+
if top, do: U.absent(), else: nil
|
|
155
|
+
|
|
156
|
+
S.ismap(val) ->
|
|
157
|
+
if seen?(seen, val) do
|
|
158
|
+
nil
|
|
159
|
+
else
|
|
160
|
+
inner = [val | seen]
|
|
161
|
+
|
|
162
|
+
Enum.reduce(S.keysof(val), %{}, fn key, acc ->
|
|
163
|
+
Map.put(acc, to_string(key), toomni(S.getprop(val, key), inner, false))
|
|
164
|
+
end)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
S.islist(val) ->
|
|
168
|
+
if seen?(seen, val) do
|
|
169
|
+
nil
|
|
170
|
+
else
|
|
171
|
+
inner = [val | seen]
|
|
172
|
+
n = S.size(val)
|
|
173
|
+
|
|
174
|
+
if n == 0 do
|
|
175
|
+
[]
|
|
176
|
+
else
|
|
177
|
+
Enum.map(0..(n - 1), fn i -> toomni(S.getelem(val, i), inner, false) end)
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
true ->
|
|
182
|
+
val
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# A heap handle is reference-stable, so identity is the cycle test. Cyclic
|
|
187
|
+
# reaches are SDK bookkeeping (client -> root ctx -> client), never corpus
|
|
188
|
+
# data; a repeat becomes nil rather than looping forever.
|
|
189
|
+
defp seen?(seen, val), do: Enum.any?(seen, fn s -> s === val end)
|
|
190
|
+
|
|
191
|
+
# --- decision 4: no-value arity ------------------------------------------
|
|
192
|
+
|
|
193
|
+
defp trimabsent(args) do
|
|
194
|
+
args |> Enum.reverse() |> Enum.drop_while(&U.isabsent/1) |> Enum.reverse()
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# --- decision 2: the subject boundary ------------------------------------
|
|
198
|
+
|
|
199
|
+
# Anything that is not a one-argument function is NOT a subject: the SDK's
|
|
200
|
+
# utility map carries plain values too (`struct` answers the module itself),
|
|
201
|
+
# and omni asks the provider for a subject named after the SECTION.
|
|
202
|
+
defp wrapsubject(subject) when not is_function(subject, 1), do: nil
|
|
203
|
+
|
|
204
|
+
defp wrapsubject(subject) do
|
|
205
|
+
fn args ->
|
|
206
|
+
tally()
|
|
207
|
+
sargs = args |> trimabsent() |> Enum.map(&tostruct/1)
|
|
208
|
+
res = subject.(sargs)
|
|
209
|
+
# The arguments go back in NON-top position: an argument that was a
|
|
210
|
+
# JSON null is still a JSON null, it is only the RESULT slot that
|
|
211
|
+
# decision 5 reads as absence.
|
|
212
|
+
{Enum.map(sargs, fn a -> toomni(a, false) end), toomni(res)}
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# --- decision 3: retarget a ctx assertion onto the args channel ----------
|
|
217
|
+
|
|
218
|
+
defp retargetctx(testspec) do
|
|
219
|
+
set = U.get(testspec, "set")
|
|
220
|
+
|
|
221
|
+
if U.ismap(testspec) and U.islist(set) do
|
|
222
|
+
Map.put(testspec, "set", Enum.map(set, &retargetentry/1))
|
|
223
|
+
else
|
|
224
|
+
testspec
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
defp retargetentry(entry) do
|
|
229
|
+
check = U.get(entry, "match")
|
|
230
|
+
|
|
231
|
+
retarget? =
|
|
232
|
+
U.ismap(entry) and U.ismap(check) and Map.has_key?(check, "ctx") and
|
|
233
|
+
not Map.has_key?(check, "args") and
|
|
234
|
+
(Map.has_key?(entry, "ctx") or Map.has_key?(entry, "args"))
|
|
235
|
+
|
|
236
|
+
if retarget? do
|
|
237
|
+
moved =
|
|
238
|
+
check
|
|
239
|
+
|> Map.delete("ctx")
|
|
240
|
+
|> Map.put("args", %{"0" => Map.get(check, "ctx")})
|
|
241
|
+
|
|
242
|
+
Map.put(entry, "match", moved)
|
|
243
|
+
else
|
|
244
|
+
entry
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# --- flags ---------------------------------------------------------------
|
|
249
|
+
#
|
|
250
|
+
# The vendored runner reads `:null` and `:name` as ATOMS; a suite may spell
|
|
251
|
+
# either. Translate rather than make every call site remember.
|
|
252
|
+
|
|
253
|
+
defp normflags(nil), do: %{}
|
|
254
|
+
|
|
255
|
+
defp normflags(flags) when is_map(flags) do
|
|
256
|
+
Map.new(flags, fn
|
|
257
|
+
{key, val} when is_binary(key) -> {String.to_atom(key), val}
|
|
258
|
+
{key, val} -> {key, val}
|
|
259
|
+
end)
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
defp normflags(_), do: %{}
|
|
263
|
+
|
|
264
|
+
# --- the provider --------------------------------------------------------
|
|
265
|
+
#
|
|
266
|
+
# omni reads a provider as a map of hooks; the SDK it wraps rides along
|
|
267
|
+
# under `:sdk`, which is where a corpus subject reaches the live client
|
|
268
|
+
# (omni stamps the provider onto every ctx/args map entry as "client").
|
|
269
|
+
|
|
270
|
+
defp sdkprovider(client) do
|
|
271
|
+
utility = ProjectName.get_utility(client)
|
|
272
|
+
|
|
273
|
+
%{
|
|
274
|
+
@livekey => true,
|
|
275
|
+
sdk: client,
|
|
276
|
+
utility: utility,
|
|
277
|
+
# Subjects are handed in per-set by the corpus suites; a by-name lookup
|
|
278
|
+
# is answered from the utility for anything that asks.
|
|
279
|
+
subject: fn name -> wrapsubject(lookup(utility, name)) end,
|
|
280
|
+
# A DEF.client entry becomes another SDK instance, rewrapped with the
|
|
281
|
+
# same shape rather than a bare hook map.
|
|
282
|
+
client: fn options -> sdkprovider(ProjectName.test(nil, tostruct(options))) end,
|
|
283
|
+
# Client options may reference the runner store.
|
|
284
|
+
inject: fn options, store ->
|
|
285
|
+
toomni(S.inject(tostruct(options), tostruct(store)), false)
|
|
286
|
+
end,
|
|
287
|
+
errify: &errify/1
|
|
288
|
+
}
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Read `name` off the SDK's utility: the corpus spells subjects in
|
|
292
|
+
# camelCase, the Elixir utility registers them in snake_case.
|
|
293
|
+
defp lookup(utility, name) when is_binary(name) do
|
|
294
|
+
found = S.getprop(utility, name)
|
|
295
|
+
if found == nil, do: S.getprop(utility, snake(name)), else: found
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
defp lookup(_utility, _name), do: nil
|
|
299
|
+
|
|
300
|
+
defp snake(name) do
|
|
301
|
+
name
|
|
302
|
+
|> String.replace(~r/([A-Z])/, "_\\1")
|
|
303
|
+
|> String.downcase()
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# The JSON form of an error, with the SDK error's `code` carried along -
|
|
307
|
+
# the stock {name,message} shape drops it, and `match: {err: {code}}` is
|
|
308
|
+
# how a refusal is asserted by kind rather than by message text. The ctx
|
|
309
|
+
# an SDK error carries is NOT mirrored: it reaches the client, which
|
|
310
|
+
# reaches the root ctx, which reaches the client again.
|
|
311
|
+
def errify(%ProjectName.Error{} = err) do
|
|
312
|
+
%{"name" => "Error", "message" => Exception.message(err), "code" => err.code || ""}
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
def errify(err) when is_exception(err) do
|
|
316
|
+
%{"name" => err.__struct__ |> Module.split() |> List.last(), "message" => Exception.message(err)}
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
def errify(err), do: %{"name" => "Error", "message" => to_string(err)}
|
|
320
|
+
|
|
321
|
+
# --- the runner ----------------------------------------------------------
|
|
322
|
+
|
|
323
|
+
@doc """
|
|
324
|
+
The corpus runner, in the shape the suites use.
|
|
325
|
+
|
|
326
|
+
`specref` is a path to the shared corpus JSON (relative paths resolve
|
|
327
|
+
against the current working directory, as the suites' `../.sdk/...`
|
|
328
|
+
constant assumes) or an already-parsed spec in omni's value model, which
|
|
329
|
+
keeps the smoke test free of fixture files.
|
|
330
|
+
|
|
331
|
+
Returns a function of the section name producing a map with `:spec`,
|
|
332
|
+
`:runset`, `:runsetflags`, `:client` and `:sdk`.
|
|
333
|
+
"""
|
|
334
|
+
def make_runner(specref, client) do
|
|
335
|
+
specref =
|
|
336
|
+
if is_binary(specref) and not String.starts_with?(specref, "/") do
|
|
337
|
+
Path.expand(specref, File.cwd!())
|
|
338
|
+
else
|
|
339
|
+
specref
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
provider = sdkprovider(client)
|
|
343
|
+
runner = Runner.make_runner(specref, provider)
|
|
344
|
+
|
|
345
|
+
fn name ->
|
|
346
|
+
runpack = runner.(name, %{})
|
|
347
|
+
omniargs = runpack.runsetflags_args
|
|
348
|
+
|
|
349
|
+
runsetflags = fn testspec, flags, subject ->
|
|
350
|
+
omniargs.(retargetctx(testspec), normflags(flags), wrapsubject(subject))
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
%{
|
|
354
|
+
spec: runpack.spec,
|
|
355
|
+
client: provider,
|
|
356
|
+
sdk: client,
|
|
357
|
+
runsetflags: runsetflags,
|
|
358
|
+
runset: fn testspec, subject -> runsetflags.(testspec, %{}, subject) end
|
|
359
|
+
}
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
@doc """
|
|
364
|
+
Convert NULLMARK sentinels back into real nulls.
|
|
365
|
+
|
|
366
|
+
NOT a delegation to omni's `nullmodifier/1`, deliberately: omni's RETURNS
|
|
367
|
+
the replacement, while struct's `inject` passes this as its `modify` hook
|
|
368
|
+
and expects it to WRITE `parent[key]` in place.
|
|
369
|
+
"""
|
|
370
|
+
def null_modifier(val, key, parent, _inj) do
|
|
371
|
+
cond do
|
|
372
|
+
val == U.nullmark() -> S.setprop(parent, key, nil)
|
|
373
|
+
is_binary(val) -> S.setprop(parent, key, String.replace(val, U.nullmark(), "null"))
|
|
374
|
+
true -> :ok
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# VENDORED: @voxgig/omni sdk-20260907-0029-0 (elixir/lib/json.ex)
|
|
2
|
+
# Source: https://github.com/voxgig/omni @ 274708cc2d12b21707d975543953f845f8444be0 [tag: sdk-20260907-0029-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# The omni JSON parser.
|
|
5
|
+
#
|
|
6
|
+
# The omni runner must be able to test *any* library, and must add no
|
|
7
|
+
# third-party dependencies, so it carries its own JSON parsing rather than
|
|
8
|
+
# borrowing Jason, Poison or the system under test. (Elixir gained a built
|
|
9
|
+
# in JSON module only in 1.18; omni supports older releases too.)
|
|
10
|
+
#
|
|
11
|
+
# Parses into native Elixir values: maps with string keys, lists, binaries,
|
|
12
|
+
# floats, booleans and nil.
|
|
13
|
+
|
|
14
|
+
defmodule Voxgig.Omni.Json do
|
|
15
|
+
@moduledoc "Minimal JSON parser for the omni test runner."
|
|
16
|
+
|
|
17
|
+
@doc "Parse JSON text into native Elixir values."
|
|
18
|
+
def parse(text) do
|
|
19
|
+
{value, rest} = parse_value(skipws(text))
|
|
20
|
+
|
|
21
|
+
case skipws(rest) do
|
|
22
|
+
"" -> value
|
|
23
|
+
trailing -> raise "omni: trailing JSON content: #{String.slice(trailing, 0, 20)}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
defp skipws(<<ch, rest::binary>>) when ch in [?\s, ?\t, ?\n, ?\r], do: skipws(rest)
|
|
28
|
+
defp skipws(text), do: text
|
|
29
|
+
|
|
30
|
+
defp parse_value("{" <> rest), do: parse_map(skipws(rest), %{})
|
|
31
|
+
defp parse_value("[" <> rest), do: parse_list(skipws(rest), [])
|
|
32
|
+
defp parse_value("\"" <> rest), do: parse_string(rest, [])
|
|
33
|
+
defp parse_value("true" <> rest), do: {true, rest}
|
|
34
|
+
defp parse_value("false" <> rest), do: {false, rest}
|
|
35
|
+
defp parse_value("null" <> rest), do: {nil, rest}
|
|
36
|
+
defp parse_value(""), do: raise("omni: unexpected end of JSON")
|
|
37
|
+
defp parse_value(text), do: parse_number(text)
|
|
38
|
+
|
|
39
|
+
defp parse_map("}" <> rest, out), do: {out, rest}
|
|
40
|
+
|
|
41
|
+
defp parse_map(text, out) do
|
|
42
|
+
{key, rest} =
|
|
43
|
+
case skipws(text) do
|
|
44
|
+
"\"" <> keytext -> parse_string(keytext, [])
|
|
45
|
+
other -> raise "omni: expected string key: #{String.slice(other, 0, 20)}"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
rest =
|
|
49
|
+
case skipws(rest) do
|
|
50
|
+
":" <> after_colon -> after_colon
|
|
51
|
+
other -> raise "omni: expected ':': #{String.slice(other, 0, 20)}"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
{value, rest} = parse_value(skipws(rest))
|
|
55
|
+
out = Map.put(out, key, value)
|
|
56
|
+
|
|
57
|
+
case skipws(rest) do
|
|
58
|
+
"," <> more -> parse_map(skipws(more), out)
|
|
59
|
+
"}" <> more -> {out, more}
|
|
60
|
+
other -> raise "omni: expected ',' or '}': #{String.slice(other, 0, 20)}"
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
defp parse_list("]" <> rest, out), do: {Enum.reverse(out), rest}
|
|
65
|
+
|
|
66
|
+
defp parse_list(text, out) do
|
|
67
|
+
{value, rest} = parse_value(skipws(text))
|
|
68
|
+
out = [value | out]
|
|
69
|
+
|
|
70
|
+
case skipws(rest) do
|
|
71
|
+
"," <> more -> parse_list(skipws(more), out)
|
|
72
|
+
"]" <> more -> {Enum.reverse(out), more}
|
|
73
|
+
other -> raise "omni: expected ',' or ']': #{String.slice(other, 0, 20)}"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
defp parse_string("\"" <> rest, out), do: {out |> Enum.reverse() |> IO.iodata_to_binary(), rest}
|
|
78
|
+
|
|
79
|
+
defp parse_string("\\u" <> rest, out) do
|
|
80
|
+
<<hex::binary-size(4), more::binary>> = rest
|
|
81
|
+
{code, ""} = Integer.parse(hex, 16)
|
|
82
|
+
parse_string(more, [<<code::utf8>> | out])
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
defp parse_string("\\" <> <<escape, rest::binary>>, out) do
|
|
86
|
+
char =
|
|
87
|
+
case escape do
|
|
88
|
+
?" -> "\""
|
|
89
|
+
?\\ -> "\\"
|
|
90
|
+
?/ -> "/"
|
|
91
|
+
?b -> "\b"
|
|
92
|
+
?f -> "\f"
|
|
93
|
+
?n -> "\n"
|
|
94
|
+
?r -> "\r"
|
|
95
|
+
?t -> "\t"
|
|
96
|
+
other -> raise "omni: bad JSON escape [#{<<other>>}]"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
parse_string(rest, [char | out])
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
defp parse_string(<<ch::utf8, rest::binary>>, out),
|
|
103
|
+
do: parse_string(rest, [<<ch::utf8>> | out])
|
|
104
|
+
|
|
105
|
+
defp parse_string("", _out), do: raise("omni: unterminated JSON string")
|
|
106
|
+
|
|
107
|
+
defp parse_number(text) do
|
|
108
|
+
{span, rest} = take_number(text, [])
|
|
109
|
+
span = span |> Enum.reverse() |> IO.iodata_to_binary()
|
|
110
|
+
|
|
111
|
+
case Float.parse(span) do
|
|
112
|
+
{value, ""} -> {value, rest}
|
|
113
|
+
_ -> raise "omni: bad JSON number [#{span}]"
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
defp take_number(<<ch, rest::binary>>, out)
|
|
118
|
+
when ch in ?0..?9 or ch in [?-, ?+, ?., ?e, ?E],
|
|
119
|
+
do: take_number(rest, [<<ch>> | out])
|
|
120
|
+
|
|
121
|
+
defp take_number(text, out), do: {out, text}
|
|
122
|
+
end
|