@voxgig/sdkgen 4.8.1 → 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 +2 -2
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
package KOTLINPACKAGE.sdktest
|
|
2
2
|
|
|
3
|
-
// Shared test-runner
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Shared test-runner SUPPORT (vendor-tag rollout): env overrides, the
|
|
4
|
+
// sdk-test-control.json skip machinery, live pacing, the
|
|
5
|
+
// ../.sdk/test/test.json spec loader, ctx/entity conversion helpers, and
|
|
6
|
+
// the canon comparison helper the feature tests use. The corpus ENGINE
|
|
7
|
+
// that used to live beside them (runset/matchDeep/matchString) is
|
|
8
|
+
// retired: both corpora now run on the vendored omni runner through
|
|
9
|
+
// OmniResolver.kt. The object name is unchanged so the emitted
|
|
10
|
+
// TestEntity/TestDirect call sites (RunnerSupport.skipReason,
|
|
11
|
+
// RunnerSupport.envOverride, ...) need no churn.
|
|
6
12
|
|
|
7
13
|
import java.nio.file.Files
|
|
8
14
|
import java.nio.file.Paths
|
|
@@ -19,7 +25,6 @@ import KOTLINPACKAGE.core.SdkError
|
|
|
19
25
|
import KOTLINPACKAGE.core.Spec
|
|
20
26
|
import KOTLINPACKAGE.core.Utility
|
|
21
27
|
import KOTLINPACKAGE.utility.Json
|
|
22
|
-
import KOTLINPACKAGE.utility.struct.Struct
|
|
23
28
|
|
|
24
29
|
@Suppress("UNCHECKED_CAST")
|
|
25
30
|
object RunnerSupport {
|
|
@@ -184,118 +189,6 @@ object RunnerSupport {
|
|
|
184
189
|
return Helpers.toMapAny(cur)
|
|
185
190
|
}
|
|
186
191
|
|
|
187
|
-
fun interface RunSubject {
|
|
188
|
-
fun run(entry: MutableMap<String, Any?>): Any?
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// runset drives a test.json entry set against a subject.
|
|
192
|
-
fun runset(testspec: Map<String, Any?>?, subject: RunSubject) {
|
|
193
|
-
if (testspec == null || testspec["set"] !is List<*>) {
|
|
194
|
-
return
|
|
195
|
-
}
|
|
196
|
-
val set = testspec["set"] as List<Any?>
|
|
197
|
-
|
|
198
|
-
val failures = mutableListOf<String>()
|
|
199
|
-
|
|
200
|
-
for (i in set.indices) {
|
|
201
|
-
val entry = Helpers.toMapAny(set[i]) ?: continue
|
|
202
|
-
|
|
203
|
-
val mark = if (entry["mark"] == null) "" else " (mark=" + entry["mark"] + ")"
|
|
204
|
-
|
|
205
|
-
var result: Any? = null
|
|
206
|
-
var err: Exception? = null
|
|
207
|
-
try {
|
|
208
|
-
result = subject.run(entry)
|
|
209
|
-
} catch (e: Exception) {
|
|
210
|
-
err = e
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
val expectedErr = entry["err"]
|
|
214
|
-
|
|
215
|
-
if (err != null) {
|
|
216
|
-
if (expectedErr != null) {
|
|
217
|
-
val errMsg = err.message ?: err.toString()
|
|
218
|
-
if (expectedErr is String && !matchString(expectedErr, errMsg)) {
|
|
219
|
-
failures.add("entry $i$mark: error mismatch: got \"$errMsg\", want contains \"$expectedErr\"")
|
|
220
|
-
}
|
|
221
|
-
val matchSpec = Helpers.toMapAny(entry["match"])
|
|
222
|
-
if (matchSpec != null) {
|
|
223
|
-
val resultMap = linkedMapOf<String, Any?>()
|
|
224
|
-
resultMap["in"] = entry["in"]
|
|
225
|
-
resultMap["out"] = jsonNormalize(result)
|
|
226
|
-
val errRec = linkedMapOf<String, Any?>()
|
|
227
|
-
errRec["message"] = errMsg
|
|
228
|
-
resultMap["err"] = errRec
|
|
229
|
-
matchDeep(failures, i, mark, matchSpec, resultMap, "")
|
|
230
|
-
}
|
|
231
|
-
continue
|
|
232
|
-
}
|
|
233
|
-
failures.add("entry $i$mark: unexpected error: $err")
|
|
234
|
-
continue
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (expectedErr != null) {
|
|
238
|
-
failures.add("entry $i$mark: expected error containing \"$expectedErr\" but got result: ${jsonStr(result)}")
|
|
239
|
-
continue
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
var matched = false
|
|
243
|
-
val matchSpec = Helpers.toMapAny(entry["match"])
|
|
244
|
-
if (matchSpec != null) {
|
|
245
|
-
val resultMap = linkedMapOf<String, Any?>()
|
|
246
|
-
resultMap["in"] = entry["in"]
|
|
247
|
-
resultMap["out"] = jsonNormalize(result)
|
|
248
|
-
if (entry["args"] != null) {
|
|
249
|
-
resultMap["args"] = entry["args"]
|
|
250
|
-
} else if (entry["in"] != null) {
|
|
251
|
-
val args = mutableListOf<Any?>()
|
|
252
|
-
args.add(entry["in"])
|
|
253
|
-
resultMap["args"] = args
|
|
254
|
-
}
|
|
255
|
-
if (entry["ctx"] != null) {
|
|
256
|
-
resultMap["ctx"] = entry["ctx"]
|
|
257
|
-
}
|
|
258
|
-
matchDeep(failures, i, mark, matchSpec, resultMap, "")
|
|
259
|
-
matched = true
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
val expectedOut = entry["out"]
|
|
263
|
-
if (expectedOut == null && matched) {
|
|
264
|
-
continue
|
|
265
|
-
}
|
|
266
|
-
if (expectedOut != null) {
|
|
267
|
-
val normResult = jsonNormalize(result)
|
|
268
|
-
val normExpected = jsonNormalize(expectedOut)
|
|
269
|
-
if (canon(normResult) != canon(normExpected)) {
|
|
270
|
-
failures.add("entry $i$mark: output mismatch:\n got: ${jsonStr(normResult)}\n want: ${jsonStr(normExpected)}")
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (failures.isNotEmpty()) {
|
|
276
|
-
throw AssertionError(failures.joinToString("\n"))
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
fun jsonNormalize(v: Any?): Any? {
|
|
281
|
-
if (v == null) {
|
|
282
|
-
return null
|
|
283
|
-
}
|
|
284
|
-
return try {
|
|
285
|
-
Json.parse(Struct.jsonify(v))
|
|
286
|
-
} catch (e: RuntimeException) {
|
|
287
|
-
v
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
fun jsonStr(v: Any?): String {
|
|
292
|
-
return try {
|
|
293
|
-
Struct.jsonify(v)
|
|
294
|
-
} catch (e: RuntimeException) {
|
|
295
|
-
v.toString()
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
192
|
fun canon(v: Any?): Any? {
|
|
300
193
|
if (v == null) {
|
|
301
194
|
return null
|
|
@@ -327,68 +220,6 @@ object RunnerSupport {
|
|
|
327
220
|
return v.toString()
|
|
328
221
|
}
|
|
329
222
|
|
|
330
|
-
fun matchDeep(failures: MutableList<String>, entryIdx: Int, mark: String, check: Any?, base: Any?, path: String) {
|
|
331
|
-
if (check == null) {
|
|
332
|
-
return
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
if (check is Map<*, *>) {
|
|
336
|
-
for (e in (check as Map<String, Any?>).entries) {
|
|
337
|
-
val childPath = "$path.${e.key}"
|
|
338
|
-
val baseVal = if (base is Map<*, *>) (base as Map<String, Any?>)[e.key] else null
|
|
339
|
-
matchDeep(failures, entryIdx, mark, e.value, baseVal, childPath)
|
|
340
|
-
}
|
|
341
|
-
} else if (check is List<*>) {
|
|
342
|
-
for (i in check.indices) {
|
|
343
|
-
val childPath = "$path[$i]"
|
|
344
|
-
var baseVal: Any? = null
|
|
345
|
-
if (base is List<*> && i < base.size) {
|
|
346
|
-
baseVal = base[i]
|
|
347
|
-
}
|
|
348
|
-
matchDeep(failures, entryIdx, mark, check[i], baseVal, childPath)
|
|
349
|
-
}
|
|
350
|
-
} else {
|
|
351
|
-
if ("__EXISTS__" == check) {
|
|
352
|
-
if (base == null) {
|
|
353
|
-
failures.add("entry $entryIdx$mark: match $path: expected value to exist but got null")
|
|
354
|
-
}
|
|
355
|
-
return
|
|
356
|
-
}
|
|
357
|
-
if ("__UNDEF__" == check) {
|
|
358
|
-
if (base != null) {
|
|
359
|
-
failures.add("entry $entryIdx$mark: match $path: expected null but got $base")
|
|
360
|
-
}
|
|
361
|
-
return
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
val normCheck = jsonNormalize(check)
|
|
365
|
-
val normBase = jsonNormalize(base)
|
|
366
|
-
|
|
367
|
-
if (canon(normCheck) != canon(normBase)) {
|
|
368
|
-
if (check is String && "" != check) {
|
|
369
|
-
val baseStr = Struct.stringify(base)
|
|
370
|
-
if (matchString(check, baseStr)) {
|
|
371
|
-
return
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
failures.add("entry $entryIdx$mark: match $path: got ${jsonStr(normBase)}, want ${jsonStr(normCheck)}")
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// matchString checks if val matches pattern. If pattern is /regex/, use
|
|
380
|
-
// regex; otherwise do case-insensitive contains.
|
|
381
|
-
fun matchString(pattern: String, v: String): Boolean {
|
|
382
|
-
if (pattern.length >= 2 && pattern.startsWith("/") && pattern.endsWith("/")) {
|
|
383
|
-
return try {
|
|
384
|
-
Regex(pattern.substring(1, pattern.length - 1)).containsMatchIn(v)
|
|
385
|
-
} catch (e: RuntimeException) {
|
|
386
|
-
false
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
return v.lowercase().contains(pattern.lowercase())
|
|
390
|
-
}
|
|
391
|
-
|
|
392
223
|
// makeCtxFromMap creates a Context from a JSON test entry's ctx or args map.
|
|
393
224
|
fun makeCtxFromMap(ctxmapIn: MutableMap<String, Any?>?, client: ProjectNameSDK?, utility: Utility?): Context {
|
|
394
225
|
val ctxmap = ctxmapIn ?: linkedMapOf()
|
|
@@ -1,20 +1,56 @@
|
|
|
1
1
|
package KOTLINPACKAGE.sdktest
|
|
2
2
|
|
|
3
|
-
// Drives the shared struct corpus (../.sdk/test/test.json, root key
|
|
4
|
-
// against the vendored Kotlin struct utility
|
|
5
|
-
//
|
|
3
|
+
// Drives the shared struct corpus (../.sdk/test/test.json, root key
|
|
4
|
+
// "struct") against the vendored Kotlin struct utility THROUGH the vendored
|
|
5
|
+
// omni runner (OmniResolver over test/vendor/omni) - the engine half of the
|
|
6
|
+
// retired StructRunner. Mirrors tm/java/test/StructCorpusTest.java and the
|
|
7
|
+
// go target's struct_utility_test.go coverage. A missing category or
|
|
8
|
+
// section FAILS (the old runner skipped it silently - a renamed fixture
|
|
9
|
+
// reported PASS while running zero assertions); a failing entry throws
|
|
10
|
+
// OmniError with the entry named.
|
|
6
11
|
|
|
7
|
-
import org.junit.jupiter.api.
|
|
12
|
+
import org.junit.jupiter.api.Assertions.assertNotNull
|
|
13
|
+
import org.junit.jupiter.api.Assertions.assertTrue
|
|
14
|
+
import org.junit.jupiter.api.Assumptions
|
|
8
15
|
import org.junit.jupiter.api.DynamicTest
|
|
16
|
+
import org.junit.jupiter.api.Test
|
|
9
17
|
import org.junit.jupiter.api.TestFactory
|
|
10
|
-
|
|
18
|
+
|
|
11
19
|
import java.util.function.Function
|
|
12
20
|
|
|
21
|
+
import voxgig.omni.Flags
|
|
22
|
+
|
|
23
|
+
import KOTLINPACKAGE.core.Helpers
|
|
24
|
+
import KOTLINPACKAGE.core.ProjectNameSDK
|
|
13
25
|
import KOTLINPACKAGE.utility.struct.Struct
|
|
14
26
|
|
|
15
27
|
@Suppress("UNCHECKED_CAST")
|
|
16
28
|
class StructCorpusTest {
|
|
17
29
|
|
|
30
|
+
companion object {
|
|
31
|
+
const val TEST_JSON_FILE = "../.sdk/test/test.json"
|
|
32
|
+
|
|
33
|
+
private var RUN: OmniResolver.Run? = null
|
|
34
|
+
|
|
35
|
+
@Synchronized
|
|
36
|
+
fun structRun(): OmniResolver.Run {
|
|
37
|
+
var r = RUN
|
|
38
|
+
if (null == r) {
|
|
39
|
+
r = OmniResolver
|
|
40
|
+
.makeRunner(TEST_JSON_FILE, ProjectNameSDK.testSDK())
|
|
41
|
+
.runner("struct", linkedMapOf<String, Any?>())
|
|
42
|
+
assertNotNull(r.spec, "struct section not found in test.json")
|
|
43
|
+
RUN = r
|
|
44
|
+
}
|
|
45
|
+
return r
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** A subject in the struct-corpus shape: one argument in, one value out. */
|
|
50
|
+
fun interface StructSubject {
|
|
51
|
+
fun apply(input: Any?): Any?
|
|
52
|
+
}
|
|
53
|
+
|
|
18
54
|
private fun getp(input: Any?, key: String): Any? =
|
|
19
55
|
if (input is Map<*, *>) (input as Map<String, Any?>)[key] else null
|
|
20
56
|
|
|
@@ -199,9 +235,12 @@ class StructCorpusTest {
|
|
|
199
235
|
}
|
|
200
236
|
|
|
201
237
|
// ===== inject =====
|
|
238
|
+
// inject.string passes the null modifier so a resolved JSON null
|
|
239
|
+
// (encoded by the runner as "__NULL__") renders as a real null / the
|
|
240
|
+
// literal text "null" (was StructRunner.NULL_MODIFIER).
|
|
202
241
|
add(tests, "inject", "string", true) {
|
|
203
242
|
val inj = Struct.Injection(null, null)
|
|
204
|
-
inj.modify =
|
|
243
|
+
inj.modify = NULL_MODIFIER
|
|
205
244
|
Struct.inject(getp(it, "val"), getp(it, "store"), inj)
|
|
206
245
|
}
|
|
207
246
|
add(tests, "inject", "deep", true) { Struct.inject(getp(it, "val"), getp(it, "store")) }
|
|
@@ -252,46 +291,96 @@ class StructCorpusTest {
|
|
|
252
291
|
return tests
|
|
253
292
|
}
|
|
254
293
|
|
|
294
|
+
// The struct.nullsem section: does a PRESENT key holding a JSON null read
|
|
295
|
+
// as "no value"? Opt-in per target (create-sdkgen ships it; an older
|
|
296
|
+
// project corpus may predate it - the abort below says so OUT LOUD, as a
|
|
297
|
+
// skipped test, rather than passing vacuously). The vendored kotlin
|
|
298
|
+
// struct answers the canonical way on every question, list form included
|
|
299
|
+
// (measured; see docs/design/vendor-tag-rollout.md). All lanes run
|
|
300
|
+
// {null: false}: without the flag the runner rewrites every null to
|
|
301
|
+
// '__NULL__' and the section asserts nothing about null at all.
|
|
302
|
+
@Test
|
|
303
|
+
fun nullsem() {
|
|
304
|
+
val run = structRun()
|
|
305
|
+
val nullsem = Helpers.toMapAny(run.spec["nullsem"])
|
|
306
|
+
if (nullsem == null) {
|
|
307
|
+
Assumptions.abort<Any>(
|
|
308
|
+
"corpus predates struct.nullsem - refresh .sdk/test/struct from create-sdkgen",
|
|
309
|
+
)
|
|
310
|
+
return
|
|
311
|
+
}
|
|
312
|
+
val flags = Flags(nulls = false)
|
|
313
|
+
|
|
314
|
+
run.runsetflags(nullsem["getprop"], flags) { args ->
|
|
315
|
+
val input = args.getOrNull(0)
|
|
316
|
+
val alt = getpDef(input, "alt", Struct.UNDEF)
|
|
317
|
+
if (alt === Struct.UNDEF) {
|
|
318
|
+
Struct.getprop(getp(input, "val"), getp(input, "key"))
|
|
319
|
+
} else {
|
|
320
|
+
Struct.getprop(getp(input, "val"), getp(input, "key"), alt)
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
run.runsetflags(nullsem["getelem"], flags) { args ->
|
|
325
|
+
val input = args.getOrNull(0)
|
|
326
|
+
val alt = getpDef(input, "alt", Struct.UNDEF)
|
|
327
|
+
if (alt === Struct.UNDEF) {
|
|
328
|
+
Struct.getelem(getp(input, "val"), getp(input, "key"))
|
|
329
|
+
} else {
|
|
330
|
+
Struct.getelem(getp(input, "val"), getp(input, "key"), alt)
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
run.runsetflags(nullsem["getpath"], flags) { args ->
|
|
335
|
+
Struct.getpath(getp(args.getOrNull(0), "store"), getp(args.getOrNull(0), "path"))
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
run.runsetflags(nullsem["haskey"], flags) { args ->
|
|
339
|
+
Struct.haskey(getp(args.getOrNull(0), "src"), getp(args.getOrNull(0), "key"))
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
run.runsetflags(nullsem["keysof"], flags) { args ->
|
|
343
|
+
Struct.keysof(args.getOrNull(0))
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
255
347
|
private fun add(
|
|
256
348
|
tests: MutableList<DynamicTest>,
|
|
257
349
|
category: String,
|
|
258
350
|
name: String,
|
|
259
351
|
nullFlag: Boolean,
|
|
260
|
-
subject:
|
|
352
|
+
subject: StructSubject,
|
|
261
353
|
) {
|
|
262
354
|
tests.add(
|
|
263
355
|
DynamicTest.dynamicTest("$category-$name") {
|
|
264
|
-
val
|
|
265
|
-
val
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
)
|
|
356
|
+
val run = structRun()
|
|
357
|
+
val cat = Helpers.toMapAny(run.spec[category])
|
|
358
|
+
assertNotNull(cat, "struct corpus category missing: $category - check .sdk/test/struct/")
|
|
359
|
+
val spec = Helpers.toMapAny(cat!![name])
|
|
360
|
+
assertNotNull(spec, "struct corpus section missing: $category.$name - check .sdk/test/struct/")
|
|
361
|
+
val set = spec!!["set"]
|
|
362
|
+
assertTrue(
|
|
363
|
+
set is List<*> && set.isNotEmpty(),
|
|
364
|
+
"struct corpus section is EMPTY: $category.$name - zero cases would run",
|
|
365
|
+
)
|
|
366
|
+
run.runsetflags(spec, Flags(nulls = nullFlag, name = "$category.$name")) { args ->
|
|
367
|
+
subject.apply(if (args.isNotEmpty()) args[0] else Struct.UNDEF)
|
|
272
368
|
}
|
|
273
369
|
},
|
|
274
370
|
)
|
|
275
371
|
}
|
|
276
372
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
for ((key, r) in SCOREBOARD) {
|
|
288
|
-
banner.append(String.format(" %-30s %4d / %4d%n", key, r.passed, r.total))
|
|
289
|
-
totalP += r.passed
|
|
290
|
-
totalT += r.total
|
|
373
|
+
private val NULL_MODIFIER = Struct.Modify { value, key, parent, _, _ ->
|
|
374
|
+
if (value is String) {
|
|
375
|
+
val repl: Any? = when {
|
|
376
|
+
value == OmniResolver.NULLMARK -> null
|
|
377
|
+
value.contains(OmniResolver.NULLMARK) -> value.replace(OmniResolver.NULLMARK, "null")
|
|
378
|
+
else -> return@Modify
|
|
379
|
+
}
|
|
380
|
+
when {
|
|
381
|
+
parent is MutableMap<*, *> && key != null -> (parent as MutableMap<String, Any?>)[key.toString()] = repl
|
|
382
|
+
parent is MutableList<*> && key is Number -> (parent as MutableList<Any?>)[key.toInt()] = repl
|
|
291
383
|
}
|
|
292
|
-
banner.append(String.format(" %-30s %4d / %4d%n", "TOTAL", totalP, totalT))
|
|
293
|
-
banner.append("============================================\n")
|
|
294
|
-
println(banner)
|
|
295
384
|
}
|
|
296
385
|
}
|
|
297
386
|
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
// VENDORED: @voxgig/omni sdk-20260904-1610-0 (kotlin/src/Json.kt)
|
|
2
|
+
// Source: https://github.com/voxgig/omni @ 8c3e1b573a8d35796f7fc45e3226b977023cabf7 [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// The omni JSON value model, with a small in-tree 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 support rather than
|
|
8
|
+
// borrowing kotlinx.serialization, Gson or the system under test.
|
|
9
|
+
|
|
10
|
+
package voxgig.omni
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A JSON value. `Absent` is the marker for "no value at all", as distinct
|
|
14
|
+
* from `Null`.
|
|
15
|
+
*/
|
|
16
|
+
sealed class Json {
|
|
17
|
+
object Absent : Json()
|
|
18
|
+
|
|
19
|
+
object Null : Json()
|
|
20
|
+
|
|
21
|
+
data class Bool(val value: Boolean) : Json()
|
|
22
|
+
|
|
23
|
+
data class Num(val value: Double) : Json()
|
|
24
|
+
|
|
25
|
+
data class Str(val value: String) : Json()
|
|
26
|
+
|
|
27
|
+
data class JList(val value: MutableList<Json>) : Json()
|
|
28
|
+
|
|
29
|
+
data class JMap(val value: LinkedHashMap<String, Json>) : Json()
|
|
30
|
+
|
|
31
|
+
val ismap: Boolean get() = this is JMap
|
|
32
|
+
val islist: Boolean get() = this is JList
|
|
33
|
+
val isnode: Boolean get() = ismap || islist
|
|
34
|
+
val isabsent: Boolean get() = this is Absent
|
|
35
|
+
val isnull: Boolean get() = this is Null
|
|
36
|
+
val isnone: Boolean get() = isabsent || isnull
|
|
37
|
+
val isnum: Boolean get() = this is Num
|
|
38
|
+
val isstr: Boolean get() = this is Str
|
|
39
|
+
val isbool: Boolean get() = this is Bool
|
|
40
|
+
|
|
41
|
+
val asnum: Double? get() = (this as? Num)?.value
|
|
42
|
+
val asstr: String? get() = (this as? Str)?.value
|
|
43
|
+
val aslist: MutableList<Json>? get() = (this as? JList)?.value
|
|
44
|
+
val asmap: LinkedHashMap<String, Json>? get() = (this as? JMap)?.value
|
|
45
|
+
|
|
46
|
+
/** Read a map entry. Returns Absent when missing. */
|
|
47
|
+
fun get(key: String): Json = (this as? JMap)?.value?.get(key) ?: Absent
|
|
48
|
+
|
|
49
|
+
/** Is a map key present at all (even with a null value)? */
|
|
50
|
+
fun has(key: String): Boolean = (this as? JMap)?.value?.containsKey(key) ?: false
|
|
51
|
+
|
|
52
|
+
/** Set a map entry (no-op for non-maps). */
|
|
53
|
+
fun set(key: String, entry: Json) {
|
|
54
|
+
(this as? JMap)?.value?.put(key, entry)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fun push(entry: Json) {
|
|
58
|
+
(this as? JList)?.value?.add(entry)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
companion object {
|
|
62
|
+
fun list(vararg entries: Json): Json = JList(entries.toMutableList())
|
|
63
|
+
|
|
64
|
+
fun map(vararg entries: Pair<String, Json>): Json {
|
|
65
|
+
val out = LinkedHashMap<String, Json>()
|
|
66
|
+
for ((key, value) in entries) {
|
|
67
|
+
out[key] = value
|
|
68
|
+
}
|
|
69
|
+
return JMap(out)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
fun num(value: Number): Json = Num(value.toDouble())
|
|
73
|
+
|
|
74
|
+
fun str(value: String): Json = Str(value)
|
|
75
|
+
|
|
76
|
+
/** Parse JSON text into the omni value model. */
|
|
77
|
+
fun parse(text: String): Json {
|
|
78
|
+
val parser = Parser(text)
|
|
79
|
+
parser.skipws()
|
|
80
|
+
val val_ = parser.value()
|
|
81
|
+
parser.skipws()
|
|
82
|
+
if (!parser.done()) {
|
|
83
|
+
throw OmniError("omni: trailing JSON content at ${parser.pos}")
|
|
84
|
+
}
|
|
85
|
+
return val_
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private class Parser(val text: String) {
|
|
90
|
+
var pos = 0
|
|
91
|
+
|
|
92
|
+
fun done(): Boolean = pos >= text.length
|
|
93
|
+
|
|
94
|
+
fun skipws() {
|
|
95
|
+
while (pos < text.length) {
|
|
96
|
+
val ch = text[pos]
|
|
97
|
+
if (' ' == ch || '\t' == ch || '\n' == ch || '\r' == ch) {
|
|
98
|
+
pos++
|
|
99
|
+
} else {
|
|
100
|
+
break
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
fun value(): Json {
|
|
106
|
+
if (done()) {
|
|
107
|
+
throw OmniError("omni: unexpected end of JSON")
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return when (text[pos]) {
|
|
111
|
+
'{' -> map()
|
|
112
|
+
'[' -> list()
|
|
113
|
+
'"' -> Str(str())
|
|
114
|
+
't' -> { word("true"); Bool(true) }
|
|
115
|
+
'f' -> { word("false"); Bool(false) }
|
|
116
|
+
'n' -> { word("null"); Null }
|
|
117
|
+
else -> num()
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
fun word(want: String) {
|
|
122
|
+
if (!text.startsWith(want, pos)) {
|
|
123
|
+
throw OmniError("omni: bad JSON literal at $pos")
|
|
124
|
+
}
|
|
125
|
+
pos += want.length
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
fun map(): Json {
|
|
129
|
+
val out = LinkedHashMap<String, Json>()
|
|
130
|
+
pos++ // {
|
|
131
|
+
|
|
132
|
+
skipws()
|
|
133
|
+
if (!done() && '}' == text[pos]) {
|
|
134
|
+
pos++
|
|
135
|
+
return JMap(out)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
while (true) {
|
|
139
|
+
skipws()
|
|
140
|
+
val key = str()
|
|
141
|
+
skipws()
|
|
142
|
+
|
|
143
|
+
if (done() || ':' != text[pos]) {
|
|
144
|
+
throw OmniError("omni: expected ':' at $pos")
|
|
145
|
+
}
|
|
146
|
+
pos++
|
|
147
|
+
|
|
148
|
+
skipws()
|
|
149
|
+
out[key] = value()
|
|
150
|
+
skipws()
|
|
151
|
+
|
|
152
|
+
if (done()) {
|
|
153
|
+
throw OmniError("omni: unterminated JSON object")
|
|
154
|
+
}
|
|
155
|
+
if (',' == text[pos]) {
|
|
156
|
+
pos++
|
|
157
|
+
continue
|
|
158
|
+
}
|
|
159
|
+
if ('}' == text[pos]) {
|
|
160
|
+
pos++
|
|
161
|
+
return JMap(out)
|
|
162
|
+
}
|
|
163
|
+
throw OmniError("omni: expected ',' or '}' at $pos")
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
fun list(): Json {
|
|
168
|
+
val out = mutableListOf<Json>()
|
|
169
|
+
pos++ // [
|
|
170
|
+
|
|
171
|
+
skipws()
|
|
172
|
+
if (!done() && ']' == text[pos]) {
|
|
173
|
+
pos++
|
|
174
|
+
return JList(out)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
while (true) {
|
|
178
|
+
skipws()
|
|
179
|
+
out.add(value())
|
|
180
|
+
skipws()
|
|
181
|
+
|
|
182
|
+
if (done()) {
|
|
183
|
+
throw OmniError("omni: unterminated JSON array")
|
|
184
|
+
}
|
|
185
|
+
if (',' == text[pos]) {
|
|
186
|
+
pos++
|
|
187
|
+
continue
|
|
188
|
+
}
|
|
189
|
+
if (']' == text[pos]) {
|
|
190
|
+
pos++
|
|
191
|
+
return JList(out)
|
|
192
|
+
}
|
|
193
|
+
throw OmniError("omni: expected ',' or ']' at $pos")
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
fun str(): String {
|
|
198
|
+
if (done() || '"' != text[pos]) {
|
|
199
|
+
throw OmniError("omni: expected string at $pos")
|
|
200
|
+
}
|
|
201
|
+
pos++
|
|
202
|
+
|
|
203
|
+
val out = StringBuilder()
|
|
204
|
+
|
|
205
|
+
while (pos < text.length) {
|
|
206
|
+
val ch = text[pos++]
|
|
207
|
+
|
|
208
|
+
if ('"' == ch) {
|
|
209
|
+
return out.toString()
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if ('\\' != ch) {
|
|
213
|
+
out.append(ch)
|
|
214
|
+
continue
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (done()) {
|
|
218
|
+
break
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
when (val escape = text[pos++]) {
|
|
222
|
+
'"' -> out.append('"')
|
|
223
|
+
'\\' -> out.append('\\')
|
|
224
|
+
'/' -> out.append('/')
|
|
225
|
+
'b' -> out.append('\b')
|
|
226
|
+
'f' -> out.append('')
|
|
227
|
+
'n' -> out.append('\n')
|
|
228
|
+
'r' -> out.append('\r')
|
|
229
|
+
't' -> out.append('\t')
|
|
230
|
+
'u' -> {
|
|
231
|
+
if (pos + 4 > text.length) {
|
|
232
|
+
throw OmniError("omni: bad JSON unicode escape")
|
|
233
|
+
}
|
|
234
|
+
out.append(text.substring(pos, pos + 4).toInt(16).toChar())
|
|
235
|
+
pos += 4
|
|
236
|
+
}
|
|
237
|
+
else -> throw OmniError("omni: bad JSON escape [$escape] at $pos")
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
throw OmniError("omni: unterminated JSON string")
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
fun num(): Json {
|
|
245
|
+
val start = pos
|
|
246
|
+
|
|
247
|
+
if (pos < text.length && ('-' == text[pos] || '+' == text[pos])) {
|
|
248
|
+
pos++
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
while (pos < text.length) {
|
|
252
|
+
val ch = text[pos]
|
|
253
|
+
if (ch.isDigit() || '.' == ch || 'e' == ch || 'E' == ch || '-' == ch || '+' == ch) {
|
|
254
|
+
pos++
|
|
255
|
+
} else {
|
|
256
|
+
break
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
val span = text.substring(start, pos)
|
|
261
|
+
return Num(span.toDoubleOrNull() ?: throw OmniError("omni: bad JSON number [$span] at $start"))
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|