@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
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
// VENDORED: @voxgig/omni sdk-20260904-1610-0 (swift/Sources/Omni/Runner.swift)
|
|
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
|
+
// Omni: the shared multi-language test runner (Swift port).
|
|
5
|
+
//
|
|
6
|
+
// Port of the canonical TypeScript implementation
|
|
7
|
+
// (typescript/src/Runner.ts). Behaviour must match, case for case.
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
/// The function under test. Arguments arrive as JSON values; failure is
|
|
12
|
+
/// reported by throwing.
|
|
13
|
+
public typealias Subject = ([Json]) throws -> Json
|
|
14
|
+
|
|
15
|
+
/// A subject that may REPLACE its arguments, which `match.args` can then
|
|
16
|
+
/// assert on. `minor/setpath` is the case in point: eight of its nine entries
|
|
17
|
+
/// assert that the store was rewritten in place, and `merge/integrity` all
|
|
18
|
+
/// six.
|
|
19
|
+
///
|
|
20
|
+
/// `Json` is an enum with value semantics, so a consumer holding a converted
|
|
21
|
+
/// copy has no way to write through the argument list even when its own nodes
|
|
22
|
+
/// are mutable (struct/swift's `VMap` / `VList` are classes). Returning the
|
|
23
|
+
/// arguments alongside the result is the only channel there is.
|
|
24
|
+
///
|
|
25
|
+
/// Separate from `Subject` rather than replacing it: a signature change would
|
|
26
|
+
/// break every consumer for a capability most subjects do not need. omni-rust,
|
|
27
|
+
/// -cpp, -ocaml, -elixir, -haskell, -clojure and -scala carry the same pair.
|
|
28
|
+
public typealias SubjectArgs = ([Json]) throws -> ([Json], Json)
|
|
29
|
+
|
|
30
|
+
/// A test failure (or a malformed spec). Distinct from an error thrown by
|
|
31
|
+
/// the subject under test, which is a candidate for an `err` expectation.
|
|
32
|
+
public struct OmniError: Error, CustomStringConvertible {
|
|
33
|
+
public let message: String
|
|
34
|
+
public let entry: Json
|
|
35
|
+
|
|
36
|
+
public init(_ message: String, _ entry: Json = .absent) {
|
|
37
|
+
self.message = message
|
|
38
|
+
self.entry = entry
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public var description: String { return message }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// The newest spec format version this runner understands. A spec with no
|
|
45
|
+
/// OMNI block is version 0: the original, lenient format, frozen forever.
|
|
46
|
+
/// Version 1 turns on strict entry validation (see checkentry).
|
|
47
|
+
public let SPECVERSION = 1
|
|
48
|
+
|
|
49
|
+
/// Capability strings this runner supports beyond the version baseline. A
|
|
50
|
+
/// spec's OMNI.requires list is checked against this: an unknown
|
|
51
|
+
/// capability refuses the spec loudly at load time, instead of a lagging
|
|
52
|
+
/// port silently mis-running it. (Empty today; future format features
|
|
53
|
+
/// mint a string here.)
|
|
54
|
+
public let CAPABILITIES: [String] = []
|
|
55
|
+
|
|
56
|
+
/// The complete set of fields an entry may carry. Under version 1 anything
|
|
57
|
+
/// else is an error: an unrecognised key is almost always a typo'd
|
|
58
|
+
/// assertion, and a typo'd assertion is a test that silently stopped
|
|
59
|
+
/// testing.
|
|
60
|
+
private let ENTRYFIELDS = ["in", "args", "ctx", "out", "err", "match", "client", "id", "doc"]
|
|
61
|
+
|
|
62
|
+
/// Run-time options for a set of test entries.
|
|
63
|
+
public struct Flags {
|
|
64
|
+
public var null: Bool
|
|
65
|
+
public var name: String?
|
|
66
|
+
|
|
67
|
+
public init(null: Bool = true, name: String? = nil) {
|
|
68
|
+
self.null = null
|
|
69
|
+
self.name = name
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public static func nonull() -> Flags { return Flags(null: false) }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// The host of the system under test. Every hook is optional.
|
|
76
|
+
public final class Provider {
|
|
77
|
+
public var subject: ((String) -> Subject?)?
|
|
78
|
+
public var client: ((Json) -> Provider)?
|
|
79
|
+
public var contextify: ((Json) -> Json)?
|
|
80
|
+
public var inject: ((Json, Json) -> Json)?
|
|
81
|
+
/// Build the `match.err` base from the raised error, REPLACING `errify`.
|
|
82
|
+
/// A library whose errors carry a code can then assert on it with
|
|
83
|
+
/// `match: {err: {code: "x"}}` instead of pattern-matching prose.
|
|
84
|
+
public var errify: ((Error) -> Json)?
|
|
85
|
+
|
|
86
|
+
public init(
|
|
87
|
+
subject: ((String) -> Subject?)? = nil,
|
|
88
|
+
client: ((Json) -> Provider)? = nil,
|
|
89
|
+
contextify: ((Json) -> Json)? = nil,
|
|
90
|
+
inject: ((Json, Json) -> Json)? = nil,
|
|
91
|
+
errify: ((Error) -> Json)? = nil
|
|
92
|
+
) {
|
|
93
|
+
self.subject = subject
|
|
94
|
+
self.client = client
|
|
95
|
+
self.contextify = contextify
|
|
96
|
+
self.inject = inject
|
|
97
|
+
self.errify = errify
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/// Load a spec: a path to a JSON file.
|
|
102
|
+
public func loadspec(_ path: String) throws -> Json {
|
|
103
|
+
return try Json.parsefile(path)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/// Read the spec's format version from its optional top-level OMNI block,
|
|
107
|
+
/// and refuse a spec this runner cannot faithfully run: a version newer
|
|
108
|
+
/// than SPECVERSION, or a required capability not in CAPABILITIES. A
|
|
109
|
+
/// present-but-null OMNI (or OMNI.requires) is malformed - only a
|
|
110
|
+
/// genuinely absent key is legacy.
|
|
111
|
+
public func resolveversion(_ alltests: Json) throws -> Int {
|
|
112
|
+
guard alltests.has("OMNI") else {
|
|
113
|
+
return 0
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
let meta = alltests.get("OMNI")
|
|
117
|
+
|
|
118
|
+
guard meta.ismap, let version = meta.get("version").asnum,
|
|
119
|
+
version == version.rounded(.towardZero)
|
|
120
|
+
else {
|
|
121
|
+
throw OmniError("omni: malformed OMNI version block")
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if 0 > version || Double(SPECVERSION) < version {
|
|
125
|
+
throw OmniError("omni: unsupported spec version: " + numstr(version))
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if meta.has("requires") {
|
|
129
|
+
guard let requireslist = meta.get("requires").aslist else {
|
|
130
|
+
throw OmniError("omni: malformed OMNI requires list")
|
|
131
|
+
}
|
|
132
|
+
for cap in requireslist {
|
|
133
|
+
guard let capstr = cap.asstr, CAPABILITIES.contains(capstr) else {
|
|
134
|
+
throw OmniError("omni: spec requires unsupported capability: " + stringify(cap))
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return Int(version)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// Find `primary.<name>`, then `<name>`, then the whole spec.
|
|
143
|
+
public func resolvespec(_ name: String, _ alltests: Json) -> Json {
|
|
144
|
+
if name.isEmpty {
|
|
145
|
+
return alltests
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
let primary = alltests.get("primary").get(name)
|
|
149
|
+
if !primary.isabsent {
|
|
150
|
+
return primary
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let section = alltests.get(name)
|
|
154
|
+
if !section.isabsent {
|
|
155
|
+
return section
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return alltests
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/// Nulls (and absent values) become NULLMARK. Always a fresh copy.
|
|
162
|
+
public func fixjson(_ val: Json, _ donull: Bool) -> Json {
|
|
163
|
+
if val.isnone {
|
|
164
|
+
// Canonical returns the value UNCHANGED when donull is false
|
|
165
|
+
// (typescript/src/Runner.ts): absent stays absent and null stays null.
|
|
166
|
+
// Answering .null for both collapsed two states the corpus distinguishes,
|
|
167
|
+
// so a subject that correctly returned nothing was compared against null
|
|
168
|
+
// and marked wrong. Same defect the other ports carried (#17, #23, #25,
|
|
169
|
+
// #26, #27, #28).
|
|
170
|
+
return donull ? .str(NULLMARK) : val
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if case .list(let entries) = val {
|
|
174
|
+
return .list(entries.map { fixjson($0, donull) })
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if case .map(let entries) = val {
|
|
178
|
+
var out: [(String, Json)] = []
|
|
179
|
+
for (key, entry) in entries {
|
|
180
|
+
out.append((key, fixjson(entry, donull)))
|
|
181
|
+
}
|
|
182
|
+
return .map(out)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return val
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/// The JSON form of an error: always at least {name,message}. The name is
|
|
189
|
+
/// the thrown error's type name (the canonical runner uses `err.name`), so
|
|
190
|
+
/// a `match:{err:{name:...}}` expectation can see the real error type.
|
|
191
|
+
public func errify(_ err: Error) -> Json {
|
|
192
|
+
return Json.mapOf([("name", .str(errname(err))), ("message", .str(errmessage(err)))])
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/// The name of an error: its Swift type name (e.g. "FibError").
|
|
196
|
+
public func errname(_ err: Error) -> String {
|
|
197
|
+
return String(describing: type(of: err))
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/// The message an `err` expectation matches.
|
|
201
|
+
public func errmessage(_ err: Error) -> String {
|
|
202
|
+
if let omnierr = err as? OmniError {
|
|
203
|
+
return omnierr.message
|
|
204
|
+
}
|
|
205
|
+
return "\(err)"
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/// Match one leaf: /regex/ or case-insensitive substring for strings.
|
|
209
|
+
public func matchval(_ check: Json, _ base: Json) -> Bool {
|
|
210
|
+
if deepequal(check, base) {
|
|
211
|
+
return true
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
var want = check
|
|
215
|
+
if let text = want.asstr, UNDEFMARK == text || NULLMARK == text {
|
|
216
|
+
want = .null
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if want.isnone {
|
|
220
|
+
return base.isnone || NULLMARK == base.asstr
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if let text = want.asstr {
|
|
224
|
+
// An empty want is not a wildcard: it matches only an empty string.
|
|
225
|
+
if text.isEmpty {
|
|
226
|
+
return "" == base.asstr
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
let basestr = stringify(base)
|
|
230
|
+
|
|
231
|
+
if 2 < text.count, text.hasPrefix("/"), text.hasSuffix("/") {
|
|
232
|
+
let pattern = String(text.dropFirst().dropLast())
|
|
233
|
+
guard let regex = try? NSRegularExpression(pattern: pattern) else {
|
|
234
|
+
return false
|
|
235
|
+
}
|
|
236
|
+
let range = NSRange(basestr.startIndex..., in: basestr)
|
|
237
|
+
return nil != regex.firstMatch(in: basestr, range: range)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return basestr.lowercased().contains(text.lowercased())
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return deepequal(want, base)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/// Convert NULLMARK sentinels back into real nulls.
|
|
247
|
+
public func nullmodifier(_ val: Json) -> Json {
|
|
248
|
+
guard let text = val.asstr else {
|
|
249
|
+
return val
|
|
250
|
+
}
|
|
251
|
+
if NULLMARK == text {
|
|
252
|
+
return .null
|
|
253
|
+
}
|
|
254
|
+
return .str(text.replacingOccurrences(of: NULLMARK, with: "null"))
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/// What a runner returns for one named spec section.
|
|
258
|
+
public final class RunPack {
|
|
259
|
+
public let spec: Json
|
|
260
|
+
public let subject: Subject?
|
|
261
|
+
public let client: Provider
|
|
262
|
+
|
|
263
|
+
private let provider: Provider
|
|
264
|
+
private let clients: [String: Provider]
|
|
265
|
+
private let name: String
|
|
266
|
+
private let specversion: Int
|
|
267
|
+
|
|
268
|
+
init(
|
|
269
|
+
spec: Json, subject: Subject?, provider: Provider, clients: [String: Provider], name: String,
|
|
270
|
+
specversion: Int
|
|
271
|
+
) {
|
|
272
|
+
self.spec = spec
|
|
273
|
+
self.subject = subject
|
|
274
|
+
self.client = provider
|
|
275
|
+
self.provider = provider
|
|
276
|
+
self.clients = clients
|
|
277
|
+
self.name = name
|
|
278
|
+
self.specversion = specversion
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/// A named group of the resolved spec.
|
|
282
|
+
public func set(_ setname: String) -> Json {
|
|
283
|
+
return spec.get(setname)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/// Run one set of test entries.
|
|
287
|
+
public func runset(_ testspec: Json, _ testsubject: Subject? = nil) throws {
|
|
288
|
+
try runsetflags(testspec, Flags(), testsubject)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/// Run one set of test entries with flags.
|
|
292
|
+
public func runsetflags(_ testspec: Json, _ flags: Flags, _ testsubject: Subject? = nil) throws {
|
|
293
|
+
try drive(testspec, flags, testsubject, nil)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/// Everything `runsetflags` does, for a subject that may replace its
|
|
297
|
+
/// arguments. See `SubjectArgs`.
|
|
298
|
+
public func runsetflagsargs(_ testspec: Json, _ flags: Flags, _ argsubject: @escaping SubjectArgs)
|
|
299
|
+
throws
|
|
300
|
+
{
|
|
301
|
+
try drive(testspec, flags, nil, argsubject)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
private func drive(
|
|
305
|
+
_ testspec: Json, _ flags: Flags, _ testsubject: Subject?, _ argsubject: SubjectArgs?
|
|
306
|
+
) throws {
|
|
307
|
+
var useflags = flags
|
|
308
|
+
if nil == useflags.name {
|
|
309
|
+
useflags.name = name.isEmpty ? "set" : name
|
|
310
|
+
}
|
|
311
|
+
let label = useflags.name ?? "set"
|
|
312
|
+
|
|
313
|
+
var usesubject: Subject? = nil
|
|
314
|
+
if nil == argsubject {
|
|
315
|
+
guard let found = testsubject ?? subject else {
|
|
316
|
+
throw OmniError("omni: no test subject for: \(label)")
|
|
317
|
+
}
|
|
318
|
+
usesubject = found
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
let testspecmap = fixjson(testspec, useflags.null)
|
|
322
|
+
guard let testset = testspecmap.get("set").aslist else {
|
|
323
|
+
throw OmniError("omni: test spec has no set: \(label)")
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Validate the AUTHORED group (testspec, not testspecmap) - null
|
|
327
|
+
// normalisation above would otherwise rewrite an authored null (e.g.
|
|
328
|
+
// id: null) into a sentinel string and hide it from checkentry.
|
|
329
|
+
if 1 <= specversion {
|
|
330
|
+
try checkset(useflags, testspec, testset)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
for (index, rawentry) in testset.enumerated() {
|
|
334
|
+
var entry = rawentry
|
|
335
|
+
|
|
336
|
+
guard entry.ismap else {
|
|
337
|
+
throw OmniError("omni: \(label)[\(index)]: entry is not a map")
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// An entry with no `out` expects a null (or absent) result.
|
|
341
|
+
if useflags.null && entry.get("out").isnone {
|
|
342
|
+
entry.set("out", .str(NULLMARK))
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
var entrysubject = usesubject
|
|
346
|
+
var entryclient = provider
|
|
347
|
+
|
|
348
|
+
if let clientname = entry.get("client").asstr {
|
|
349
|
+
guard let found = clients[clientname] else {
|
|
350
|
+
throw OmniError("omni: unknown client: \(clientname)", entry)
|
|
351
|
+
}
|
|
352
|
+
entryclient = found
|
|
353
|
+
if nil != entrysubject, let clientsubject = found.subject?(name) {
|
|
354
|
+
entrysubject = clientsubject
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
let args = resolveargs(&entry, entryclient)
|
|
359
|
+
|
|
360
|
+
// An args-subject returns its arguments alongside the result, so
|
|
361
|
+
// `match.args` sees what the subject actually did with them.
|
|
362
|
+
var callargs = args
|
|
363
|
+
var res: Json
|
|
364
|
+
do {
|
|
365
|
+
if let call = argsubject {
|
|
366
|
+
(callargs, res) = try call(args)
|
|
367
|
+
} else if let call = entrysubject {
|
|
368
|
+
res = try call(args)
|
|
369
|
+
} else {
|
|
370
|
+
throw OmniError("omni: no test subject for: \(label)")
|
|
371
|
+
}
|
|
372
|
+
} catch let omnierr as OmniError {
|
|
373
|
+
throw omnierr
|
|
374
|
+
} catch {
|
|
375
|
+
try handleerror(useflags, index, entry, error)
|
|
376
|
+
continue
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
res = fixjson(res, useflags.null)
|
|
380
|
+
entry.set("res", res)
|
|
381
|
+
|
|
382
|
+
try checkresult(useflags, index, entry, callargs, res)
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Build the argument list: `ctx`, `args`, or `in`.
|
|
387
|
+
private func resolveargs(_ entry: inout Json, _ client: Provider) -> [Json] {
|
|
388
|
+
var args: [Json]
|
|
389
|
+
|
|
390
|
+
let hasctx = entry.has("ctx")
|
|
391
|
+
let hasargs = entry.has("args")
|
|
392
|
+
|
|
393
|
+
if hasctx {
|
|
394
|
+
args = [entry.get("ctx")]
|
|
395
|
+
} else if hasargs {
|
|
396
|
+
args = entry.get("args").aslist ?? [entry.get("args")]
|
|
397
|
+
} else {
|
|
398
|
+
args = [entry.get("in")]
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (hasctx || hasargs) && !args.isEmpty && args[0].ismap {
|
|
402
|
+
var first = args[0]
|
|
403
|
+
if let contextify = provider.contextify {
|
|
404
|
+
first = contextify(first)
|
|
405
|
+
}
|
|
406
|
+
// Attach the entry's resolved client (canonical:
|
|
407
|
+
// `first.client = testpack.client`), before first is copied into
|
|
408
|
+
// args[0]/entry.ctx - Json has value semantics, unlike the JS
|
|
409
|
+
// object canonical mutates in place, so the attach must happen
|
|
410
|
+
// before both copies are taken, not after.
|
|
411
|
+
if first.ismap {
|
|
412
|
+
first.set("client", .provider(client))
|
|
413
|
+
}
|
|
414
|
+
args[0] = first
|
|
415
|
+
entry.set("ctx", first)
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return args
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Validate a version-1 group up front, against the AUTHORED entries
|
|
422
|
+
// (testspec, not the null-normalised testset) - see the call site in
|
|
423
|
+
// runsetflags. Absorbs the empty-set check: a group with no entries
|
|
424
|
+
// must say so explicitly (`empty: true`), or it is a mistake, not a
|
|
425
|
+
// deliberate no-op.
|
|
426
|
+
private func checkset(_ flags: Flags, _ testspec: Json, _ normalset: [Json]) throws {
|
|
427
|
+
let origset: [Json]
|
|
428
|
+
if testspec.ismap, let set = testspec.get("set").aslist {
|
|
429
|
+
origset = set
|
|
430
|
+
} else {
|
|
431
|
+
origset = normalset
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
var markedempty = false
|
|
435
|
+
if case .bool(true) = testspec.get("empty") {
|
|
436
|
+
markedempty = true
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if origset.isEmpty && !markedempty {
|
|
440
|
+
throw OmniError("omni: empty test set: \(flags.name ?? "set")")
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
for (index, entry) in origset.enumerated() {
|
|
444
|
+
try checkentry(flags, index, entry)
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Strict entry validation, applied when the spec declares version 1 or
|
|
449
|
+
// later. The lenient format converts each of these mistakes into a
|
|
450
|
+
// silent pass or a dead field; here they fail with the entry named.
|
|
451
|
+
private func checkentry(_ flags: Flags, _ index: Int, _ entry: Json) throws {
|
|
452
|
+
guard case .map(let fields) = entry else {
|
|
453
|
+
throw fail(flags, index, entry, "entry is not a map")
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
for key in fields.map({ $0.0 }).sorted() {
|
|
457
|
+
if !ENTRYFIELDS.contains(key) {
|
|
458
|
+
throw fail(flags, index, entry, "unknown entry field: " + key)
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
var argsources = 0
|
|
463
|
+
for key in ["in", "args", "ctx"] where entry.has(key) {
|
|
464
|
+
argsources += 1
|
|
465
|
+
}
|
|
466
|
+
if 1 < argsources {
|
|
467
|
+
throw fail(flags, index, entry, "entry has more than one of in, args, ctx")
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if !entry.get("err").isnone && entry.has("out") {
|
|
471
|
+
throw fail(flags, index, entry, "entry has both err and out")
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// Presence, not definedness: `id: null` must fail here too, so a
|
|
475
|
+
// strict spec cannot smuggle a non-string id past this check under
|
|
476
|
+
// null-normalisation (checkset validates before fixjson runs).
|
|
477
|
+
if entry.has("id") && !entry.get("id").isstr {
|
|
478
|
+
throw fail(flags, index, entry, "entry id is not a string")
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
private func checkresult(_ flags: Flags, _ index: Int, _ entry: Json, _ args: [Json], _ res: Json)
|
|
483
|
+
throws
|
|
484
|
+
{
|
|
485
|
+
var matched = false
|
|
486
|
+
|
|
487
|
+
let entryerr = entry.get("err")
|
|
488
|
+
if !entryerr.isnone {
|
|
489
|
+
throw fail(
|
|
490
|
+
flags, index, entry, "expected error did not occur", stringify(entryerr), stringify(res))
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
let check = entry.get("match")
|
|
494
|
+
if !check.isnone {
|
|
495
|
+
let base = Json.mapOf([
|
|
496
|
+
("in", entry.get("in")),
|
|
497
|
+
("args", .list(args)),
|
|
498
|
+
("out", entry.get("res")),
|
|
499
|
+
("ctx", entry.get("ctx")),
|
|
500
|
+
])
|
|
501
|
+
try matchcheck(flags, index, entry, check, base)
|
|
502
|
+
matched = true
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
let out = entry.get("out")
|
|
506
|
+
|
|
507
|
+
if deepequal(res, out) {
|
|
508
|
+
return
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// NOTE: a match with no explicit out is a complete check on its own.
|
|
512
|
+
if matched && (out.isnone || NULLMARK == out.asstr) {
|
|
513
|
+
return
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
throw fail(flags, index, entry, "result mismatch", stringify(out), stringify(res))
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/// The error base a `match.err` sees: the provider's own, when it has one.
|
|
520
|
+
private func errbase(_ err: Error) -> Json {
|
|
521
|
+
if let hook = provider.errify {
|
|
522
|
+
return hook(err)
|
|
523
|
+
}
|
|
524
|
+
return Omni.errify(err)
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
private func handleerror(_ flags: Flags, _ index: Int, _ entry: Json, _ err: Error) throws {
|
|
528
|
+
let message = errmessage(err)
|
|
529
|
+
let entryerr = entry.get("err")
|
|
530
|
+
|
|
531
|
+
if !entryerr.isnone {
|
|
532
|
+
var istrue = false
|
|
533
|
+
if case .bool(true) = entryerr {
|
|
534
|
+
istrue = true
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if istrue || matchval(entryerr, .str(message)) {
|
|
538
|
+
let check = entry.get("match")
|
|
539
|
+
if !check.isnone {
|
|
540
|
+
let base = Json.mapOf([
|
|
541
|
+
("in", entry.get("in")),
|
|
542
|
+
("out", entry.get("res")),
|
|
543
|
+
("ctx", entry.get("ctx")),
|
|
544
|
+
("err", errbase(err)),
|
|
545
|
+
])
|
|
546
|
+
try matchcheck(flags, index, entry, check, base)
|
|
547
|
+
}
|
|
548
|
+
return
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
throw fail(flags, index, entry, "error mismatch", stringify(entryerr), message)
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
throw fail(flags, index, entry, "unexpected error", nil, message)
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Check that every leaf of `check` is present, and matches, in `base`.
|
|
558
|
+
private func matchcheck(
|
|
559
|
+
_ flags: Flags, _ index: Int, _ entry: Json, _ check: Json, _ base: Json,
|
|
560
|
+
_ path: [String] = []
|
|
561
|
+
) throws {
|
|
562
|
+
if case .list(let entries) = check {
|
|
563
|
+
for (at, subcheck) in entries.enumerated() {
|
|
564
|
+
try matchcheck(flags, index, entry, subcheck, base, path + [String(at)])
|
|
565
|
+
}
|
|
566
|
+
return
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if case .map(let entries) = check {
|
|
570
|
+
for (key, subcheck) in entries {
|
|
571
|
+
try matchcheck(flags, index, entry, subcheck, base, path + [key])
|
|
572
|
+
}
|
|
573
|
+
return
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
let baseval = getpath(base, path)
|
|
577
|
+
|
|
578
|
+
// The sentinels are tested BEFORE the identity check below. Otherwise
|
|
579
|
+
// a subject returning the literal string "__UNDEF__" satisfies an
|
|
580
|
+
// assertion that the key is absent - two mutually exclusive states
|
|
581
|
+
// passing one check. A sentinel that accepts its own literal is not a
|
|
582
|
+
// sentinel. (NULLMARK still accepts NULLMARK: under the default null
|
|
583
|
+
// flag a real null has already been normalised to it, so the two are
|
|
584
|
+
// genuinely indistinguishable here - that one needs a raw-value
|
|
585
|
+
// escape, not an ordering change.)
|
|
586
|
+
|
|
587
|
+
// Explicitly absent: satisfied only by a genuinely missing key, never
|
|
588
|
+
// by a present null (the distinction the sentinels exist to keep).
|
|
589
|
+
if UNDEFMARK == check.asstr {
|
|
590
|
+
if baseval.isabsent {
|
|
591
|
+
return
|
|
592
|
+
}
|
|
593
|
+
throw fail(
|
|
594
|
+
flags, index, entry, "expected absent at \(matchat(path))",
|
|
595
|
+
"absent", stringify(baseval))
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// Explicitly null: satisfied only by a present null.
|
|
599
|
+
if NULLMARK == check.asstr {
|
|
600
|
+
if baseval.isnull || NULLMARK == baseval.asstr {
|
|
601
|
+
return
|
|
602
|
+
}
|
|
603
|
+
throw fail(
|
|
604
|
+
flags, index, entry, "expected null at \(matchat(path))",
|
|
605
|
+
"null", stringify(baseval))
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// Explicitly present: any present value, including null.
|
|
609
|
+
if EXISTSMARK == check.asstr {
|
|
610
|
+
if !baseval.isabsent {
|
|
611
|
+
return
|
|
612
|
+
}
|
|
613
|
+
throw fail(
|
|
614
|
+
flags, index, entry, "expected present at \(matchat(path))",
|
|
615
|
+
"present", "absent")
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// Identical values match. This sits below the sentinel branches on
|
|
619
|
+
// purpose - see the note above.
|
|
620
|
+
if deepequal(check, baseval) {
|
|
621
|
+
return
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// A concrete expectation never matches a missing key - a match leaf
|
|
625
|
+
// against an absent value must fail, not substring-match "undefined".
|
|
626
|
+
if baseval.isabsent {
|
|
627
|
+
throw fail(
|
|
628
|
+
flags, index, entry, "match failed at \(matchat(path))",
|
|
629
|
+
stringify(check), "absent")
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if matchval(check, baseval) {
|
|
633
|
+
return
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
throw fail(
|
|
637
|
+
flags, index, entry, "match failed at \(matchat(path))",
|
|
638
|
+
stringify(check), stringify(baseval))
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// The location of one match leaf, for failure messages.
|
|
642
|
+
private func matchat(_ path: [String]) -> String {
|
|
643
|
+
return path.isEmpty ? "<root>" : pathify(path)
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// The label of one entry, for failure messages.
|
|
647
|
+
private func entryref(_ flags: Flags, _ index: Int, _ entry: Json) -> String {
|
|
648
|
+
let label = flags.name ?? "set"
|
|
649
|
+
let id = entry.get("id")
|
|
650
|
+
let idpart = id.isabsent ? "" : " (\(stringify(id)))"
|
|
651
|
+
return "\(label)[\(index)]\(idpart)"
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
private func fail(
|
|
655
|
+
_ flags: Flags, _ index: Int, _ entry: Json, _ reason: String,
|
|
656
|
+
_ expected: String? = nil, _ actual: String? = nil
|
|
657
|
+
) -> OmniError {
|
|
658
|
+
var message = "omni: \(entryref(flags, index, entry)): \(reason)"
|
|
659
|
+
|
|
660
|
+
if let expected = expected {
|
|
661
|
+
message += "\n expected: \(expected)"
|
|
662
|
+
}
|
|
663
|
+
if let actual = actual {
|
|
664
|
+
message += "\n actual: \(actual)"
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
var summary: [(String, Json)] = []
|
|
668
|
+
if case .map(let entries) = entry {
|
|
669
|
+
for (key, val) in entries where "res" != key && "thrown" != key && "ctx" != key {
|
|
670
|
+
summary.append((key, val))
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
message += "\n entry: \(stringify(.map(summary)))"
|
|
674
|
+
|
|
675
|
+
return OmniError(message, entry)
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/// A loaded spec plus its provider.
|
|
680
|
+
public final class Runner {
|
|
681
|
+
private let alltests: Json
|
|
682
|
+
private let provider: Provider
|
|
683
|
+
private let specversion: Int
|
|
684
|
+
|
|
685
|
+
/// Resolves the spec's format version immediately - fail fast, before
|
|
686
|
+
/// any group runs, on a version this runner cannot faithfully run.
|
|
687
|
+
public init(_ alltests: Json, _ provider: Provider) throws {
|
|
688
|
+
self.alltests = alltests
|
|
689
|
+
self.provider = provider
|
|
690
|
+
self.specversion = try resolveversion(alltests)
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/// Resolve one named section of the spec.
|
|
694
|
+
public func runner(_ name: String, _ store: Json = .absent) -> RunPack {
|
|
695
|
+
let spec = resolvespec(name, alltests)
|
|
696
|
+
var clients: [String: Provider] = [:]
|
|
697
|
+
|
|
698
|
+
let defclient = spec.get("DEF").get("client")
|
|
699
|
+
|
|
700
|
+
// A spec may define clients that a given test run never references.
|
|
701
|
+
if let entries = defclient.asmap, let clientmaker = provider.client {
|
|
702
|
+
for (clientname, cdef) in entries {
|
|
703
|
+
var copts = cdef.get("test").get("options")
|
|
704
|
+
if copts.isabsent {
|
|
705
|
+
copts = .map([])
|
|
706
|
+
}
|
|
707
|
+
if let inject = provider.inject, store.ismap {
|
|
708
|
+
copts = inject(copts, store)
|
|
709
|
+
}
|
|
710
|
+
clients[clientname] = clientmaker(copts)
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
let subject = name.isEmpty ? nil : provider.subject?(name)
|
|
715
|
+
|
|
716
|
+
return RunPack(
|
|
717
|
+
spec: spec, subject: subject, provider: provider, clients: clients, name: name,
|
|
718
|
+
specversion: specversion)
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/// Make a runner for a spec file path and a provider.
|
|
723
|
+
public func makeRunner(_ path: String, _ provider: Provider = Provider()) throws -> Runner {
|
|
724
|
+
return try Runner(try loadspec(path), provider)
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/// Make a runner for an in-memory spec and a provider.
|
|
728
|
+
public func makeRunner(_ spec: Json, _ provider: Provider = Provider()) throws -> Runner {
|
|
729
|
+
return try Runner(spec, provider)
|
|
730
|
+
}
|