@voxgig/sdkgen 4.8.2 → 4.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/omni sdk-20260904-1610-0 (lua/src/runner.lua)
|
|
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 (Lua port).
|
|
5
|
+
--
|
|
6
|
+
-- Port of the canonical TypeScript implementation
|
|
7
|
+
-- (typescript/src/Runner.ts). Behaviour must match, case for case.
|
|
8
|
+
|
|
9
|
+
-- Sibling modules are required RELATIVE to this one, so omni's `src/` never
|
|
10
|
+
-- has to be on a consumer's package.path. omni's own harness requires bare
|
|
11
|
+
-- names (`require('util')`) and gets an empty prefix; the struct compat shim
|
|
12
|
+
-- requires `src.util` and gets `src.`, which then finds `src.json`.
|
|
13
|
+
--
|
|
14
|
+
-- A bare `require('json')` here would force a consumer to add omni's `src/`
|
|
15
|
+
-- to package.path -- and that shadows the consumer's OWN modules of the same
|
|
16
|
+
-- name. It bit exactly that way: omni ships `src/regex.lua`, struct/lua ships
|
|
17
|
+
-- `src/regex.lua`, and struct's regex silently became omni's.
|
|
18
|
+
local _prefix = (...):match('^(.*%.)[^.]*$') or ''
|
|
19
|
+
|
|
20
|
+
local regex = require(_prefix .. 'regex')
|
|
21
|
+
local u = require(_prefix .. 'util')
|
|
22
|
+
|
|
23
|
+
local M = {}
|
|
24
|
+
|
|
25
|
+
M.NULLMARK = u.NULLMARK
|
|
26
|
+
M.UNDEFMARK = u.UNDEFMARK
|
|
27
|
+
M.EXISTSMARK = u.EXISTSMARK
|
|
28
|
+
M.NULL = u.NULL
|
|
29
|
+
M.ABSENT = u.ABSENT
|
|
30
|
+
|
|
31
|
+
-- The newest spec format version this runner understands. A spec with no
|
|
32
|
+
-- OMNI block is version 0: the original, lenient format, frozen forever.
|
|
33
|
+
-- Version 1 turns on strict entry validation (see checkentry).
|
|
34
|
+
M.SPECVERSION = 1
|
|
35
|
+
|
|
36
|
+
-- Capability strings this runner supports beyond the version baseline. A
|
|
37
|
+
-- spec's OMNI.requires list is checked against this: an unknown capability
|
|
38
|
+
-- refuses the spec loudly at load time, instead of a lagging port silently
|
|
39
|
+
-- mis-running it. (Empty today; future format features mint a string here.)
|
|
40
|
+
M.CAPABILITIES = {}
|
|
41
|
+
|
|
42
|
+
-- The complete set of fields an entry may carry. Under version 1 anything
|
|
43
|
+
-- else is an error: an unrecognised key is almost always a typo'd
|
|
44
|
+
-- assertion, and a typo'd assertion is a test that silently stopped
|
|
45
|
+
-- testing.
|
|
46
|
+
local ENTRYFIELDS = { 'in', 'args', 'ctx', 'out', 'err', 'match', 'client', 'id', 'doc' }
|
|
47
|
+
|
|
48
|
+
-- Linear membership check (Lua has no Array#includes).
|
|
49
|
+
local function contains(list, value)
|
|
50
|
+
for _, item in ipairs(list) do
|
|
51
|
+
if item == value then
|
|
52
|
+
return true
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
return false
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
-- A test failure (or a malformed spec). Raised as a table, so that errors
|
|
59
|
+
-- raised by the subject under test (plain strings) stay distinguishable.
|
|
60
|
+
local OMNIMT = { __tostring = function(err) return err.message end }
|
|
61
|
+
|
|
62
|
+
function M.OmniError(message, entry)
|
|
63
|
+
return setmetatable({ omni = true, message = message, entry = entry }, OMNIMT)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
function M.isomnierror(err)
|
|
67
|
+
return 'table' == type(err) and true == err.omni
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
--- The message an `err` expectation matches.
|
|
71
|
+
function M.errmessage(err)
|
|
72
|
+
if M.isomnierror(err) then
|
|
73
|
+
return err.message
|
|
74
|
+
end
|
|
75
|
+
if 'table' == type(err) and nil ~= err.message then
|
|
76
|
+
return tostring(err.message)
|
|
77
|
+
end
|
|
78
|
+
return tostring(err)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
--- Load a spec: a path to a JSON file.
|
|
82
|
+
function M.loadspec(path)
|
|
83
|
+
local handle = io.open(path, 'r')
|
|
84
|
+
if nil == handle then
|
|
85
|
+
error(M.OmniError('omni: cannot read spec: ' .. path))
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
local text = handle:read('a')
|
|
89
|
+
handle:close()
|
|
90
|
+
|
|
91
|
+
return u.parse(text)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
--- Find `primary.<name>`, then `<name>`, then the whole spec.
|
|
95
|
+
function M.resolvespec(name, alltests)
|
|
96
|
+
if nil == name or '' == name then
|
|
97
|
+
return alltests
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
local primary = u.get(u.get(alltests, 'primary'), name)
|
|
101
|
+
if not u.isabsent(primary) then
|
|
102
|
+
return primary
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
local section = u.get(alltests, name)
|
|
106
|
+
if not u.isabsent(section) then
|
|
107
|
+
return section
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
return alltests
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
-- Read the spec's format version from its optional top-level OMNI block,
|
|
114
|
+
-- and refuse a spec this runner cannot faithfully run: a version newer
|
|
115
|
+
-- than SPECVERSION, or a required capability not in CAPABILITIES.
|
|
116
|
+
local function resolveversion(alltests)
|
|
117
|
+
local meta = u.ABSENT
|
|
118
|
+
if u.ismap(alltests) then
|
|
119
|
+
meta = u.get(alltests, 'OMNI')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if u.isabsent(meta) then
|
|
123
|
+
return 0
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
local version = u.ABSENT
|
|
127
|
+
if u.ismap(meta) then
|
|
128
|
+
version = u.get(meta, 'version')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if not u.ismap(meta) or not u.isnum(version) or 0 ~= (version % 1) then
|
|
132
|
+
error(M.OmniError('omni: malformed OMNI version block'))
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if 0 > version or M.SPECVERSION < version then
|
|
136
|
+
error(M.OmniError('omni: unsupported spec version: ' .. u.stringify(version)))
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
local requires = u.get(meta, 'requires')
|
|
140
|
+
if not u.isabsent(requires) then
|
|
141
|
+
if not u.islist(requires) then
|
|
142
|
+
error(M.OmniError('omni: malformed OMNI requires list'))
|
|
143
|
+
end
|
|
144
|
+
for _, cap in ipairs(requires) do
|
|
145
|
+
if not u.isstr(cap) or not contains(M.CAPABILITIES, cap) then
|
|
146
|
+
error(M.OmniError('omni: spec requires unsupported capability: ' .. u.stringify(cap)))
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
return version
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
--- Nulls (and absent values) become NULLMARK. Always a fresh copy.
|
|
155
|
+
function M.fixjson(val, donull)
|
|
156
|
+
if u.isnone(val) then
|
|
157
|
+
if donull then
|
|
158
|
+
return u.NULLMARK
|
|
159
|
+
end
|
|
160
|
+
-- Canonical returns the value UNCHANGED here (Runner.ts: `return donull ?
|
|
161
|
+
-- NULLMARK : val`), which keeps undefined distinct from null. Returning
|
|
162
|
+
-- u.NULL instead asserted "this is a JSON null" about an ABSENT value, so
|
|
163
|
+
-- a subject that returned nothing could never match an entry with no
|
|
164
|
+
-- `out`: deepequal requires both sides absent, and NULL is not absent.
|
|
165
|
+
-- A raw Lua nil normalises to ABSENT because a nil cannot sit in a table.
|
|
166
|
+
if nil == val then
|
|
167
|
+
return u.ABSENT
|
|
168
|
+
end
|
|
169
|
+
return val
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if u.islist(val) then
|
|
173
|
+
local out = u.list({})
|
|
174
|
+
for index, entry in ipairs(val) do
|
|
175
|
+
out[index] = M.fixjson(entry, donull)
|
|
176
|
+
end
|
|
177
|
+
return out
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if u.ismap(val) then
|
|
181
|
+
local out = u.map({})
|
|
182
|
+
for key, entry in pairs(val) do
|
|
183
|
+
rawset(out, key, M.fixjson(entry, donull))
|
|
184
|
+
end
|
|
185
|
+
return out
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
return val
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
--- The JSON form of an error: always at least {name,message}.
|
|
192
|
+
function M.errify(err)
|
|
193
|
+
return u.map({ name = 'Error', message = M.errmessage(err) })
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
--- The error base a `match.err` sees: the provider's own, when it has one.
|
|
197
|
+
-- A library whose errors carry a `code` reaches `match: {err: {code}}`
|
|
198
|
+
-- through `Provider.errify`, which REPLACES `errify` rather than adding
|
|
199
|
+
-- to it.
|
|
200
|
+
function M.errbase(err, provider)
|
|
201
|
+
local hook = nil ~= provider and provider.errify or nil
|
|
202
|
+
if nil ~= hook then
|
|
203
|
+
return hook(err)
|
|
204
|
+
end
|
|
205
|
+
return M.errify(err)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
--- Match one leaf: /regex/ or case-insensitive substring for strings.
|
|
209
|
+
function M.matchval(check, base)
|
|
210
|
+
if u.deepequal(check, base) then
|
|
211
|
+
return true
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
local want = check
|
|
215
|
+
|
|
216
|
+
if u.isnone(want) then
|
|
217
|
+
return u.isnone(base) or u.NULLMARK == base
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if u.isstr(want) then
|
|
221
|
+
-- An empty want would substring-match anything: reject it.
|
|
222
|
+
if '' == want then
|
|
223
|
+
return false
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
local basestr = u.stringify(base)
|
|
227
|
+
|
|
228
|
+
if 2 < #want and '/' == want:sub(1, 1) and '/' == want:sub(-1) then
|
|
229
|
+
return regex.find(want:sub(2, #want - 1), basestr)
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
return nil ~= basestr:lower():find(want:lower(), 1, true)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
return u.deepequal(want, base)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
--- Convert NULLMARK sentinels back into real nulls.
|
|
239
|
+
function M.nullmodifier(val)
|
|
240
|
+
if u.NULLMARK == val then
|
|
241
|
+
return u.NULL
|
|
242
|
+
end
|
|
243
|
+
if u.isstr(val) then
|
|
244
|
+
return (val:gsub(u.NULLMARK, 'null'))
|
|
245
|
+
end
|
|
246
|
+
return val
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
-- The spec-defined part of an entry (drop runner bookkeeping).
|
|
250
|
+
local function entrysummary(entry)
|
|
251
|
+
if not u.ismap(entry) then
|
|
252
|
+
return entry
|
|
253
|
+
end
|
|
254
|
+
local out = u.map({})
|
|
255
|
+
for key, value in pairs(entry) do
|
|
256
|
+
if 'res' ~= key and 'thrown' ~= key and 'ctx' ~= key then
|
|
257
|
+
rawset(out, key, value)
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
return out
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
-- The label of one entry, for failure messages.
|
|
264
|
+
local function entryref(label, index, entry)
|
|
265
|
+
local id = u.get(entry, 'id')
|
|
266
|
+
local idpart = u.isabsent(id) and '' or (' (' .. u.stringify(id) .. ')')
|
|
267
|
+
return label .. '[' .. index .. ']' .. idpart
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
local function fail(label, index, entry, reason, expected, actual)
|
|
271
|
+
local msg = 'omni: ' .. entryref(label, index, entry) .. ': ' .. reason
|
|
272
|
+
|
|
273
|
+
if nil ~= expected then
|
|
274
|
+
msg = msg .. '\n expected: ' .. expected
|
|
275
|
+
end
|
|
276
|
+
if nil ~= actual then
|
|
277
|
+
msg = msg .. '\n actual: ' .. actual
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
msg = msg .. '\n entry: ' .. u.stringify(entrysummary(entry))
|
|
281
|
+
|
|
282
|
+
return M.OmniError(msg, entry)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
-- Strict entry validation, applied when the spec declares version 1 or
|
|
286
|
+
-- later. The lenient format converts each of these mistakes into a silent
|
|
287
|
+
-- pass or a dead field; here they fail with the entry named.
|
|
288
|
+
local function checkentry(label, index, entry)
|
|
289
|
+
if not u.ismap(entry) then
|
|
290
|
+
error(fail(label, index, entry, 'entry is not a map'))
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
for key in pairs(entry) do
|
|
294
|
+
if not contains(ENTRYFIELDS, key) then
|
|
295
|
+
error(fail(label, index, entry, 'unknown entry field: ' .. key))
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
local argsources = 0
|
|
300
|
+
for _, key in ipairs({ 'in', 'args', 'ctx' }) do
|
|
301
|
+
if u.has(entry, key) then
|
|
302
|
+
argsources = argsources + 1
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
if 1 < argsources then
|
|
306
|
+
error(fail(label, index, entry, 'entry has more than one of in, args, ctx'))
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
if not u.isnone(u.get(entry, 'err')) and u.has(entry, 'out') then
|
|
310
|
+
error(fail(label, index, entry, 'entry has both err and out'))
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
if u.has(entry, 'id') and not u.isstr(u.get(entry, 'id')) then
|
|
314
|
+
error(fail(label, index, entry, 'entry id is not a string'))
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
-- Validate a version-1 group up front, against the AUTHORED entries -
|
|
319
|
+
-- null-normalisation would otherwise rewrite an authored null (e.g.
|
|
320
|
+
-- id: null) into a sentinel string and hide it from validation. A
|
|
321
|
+
-- malformed spec is a spec error, not a test result, so it fails before
|
|
322
|
+
-- any subject runs.
|
|
323
|
+
local function checkset(label, testspec, normalset)
|
|
324
|
+
local origset = normalset
|
|
325
|
+
if u.ismap(testspec) and u.islist(u.get(testspec, 'set')) then
|
|
326
|
+
origset = u.get(testspec, 'set')
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
local empty = u.ABSENT
|
|
330
|
+
if u.ismap(testspec) then
|
|
331
|
+
empty = u.get(testspec, 'empty')
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
if 0 == #origset and true ~= empty then
|
|
335
|
+
error(M.OmniError('omni: empty test set: ' .. label))
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
for at, entry in ipairs(origset) do
|
|
339
|
+
checkentry(label, at - 1, entry)
|
|
340
|
+
end
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
-- Check that every leaf of `check` is present, and matches, in `base`.
|
|
344
|
+
local function matchcheck(label, index, entry, check, base, path)
|
|
345
|
+
path = path or {}
|
|
346
|
+
|
|
347
|
+
local where = 0 == #path and '<root>' or u.pathify(path)
|
|
348
|
+
|
|
349
|
+
if u.islist(check) then
|
|
350
|
+
for at, subcheck in ipairs(check) do
|
|
351
|
+
local childpath = { table.unpack(path) }
|
|
352
|
+
childpath[#childpath + 1] = tostring(at - 1)
|
|
353
|
+
matchcheck(label, index, entry, subcheck, base, childpath)
|
|
354
|
+
end
|
|
355
|
+
return
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
if u.ismap(check) then
|
|
359
|
+
for key, subcheck in pairs(check) do
|
|
360
|
+
local childpath = { table.unpack(path) }
|
|
361
|
+
childpath[#childpath + 1] = key
|
|
362
|
+
matchcheck(label, index, entry, subcheck, base, childpath)
|
|
363
|
+
end
|
|
364
|
+
return
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
local baseval = u.getpath(base, path)
|
|
368
|
+
|
|
369
|
+
-- The sentinels are tested BEFORE the identity check below. Otherwise a
|
|
370
|
+
-- subject returning the literal string "__UNDEF__" satisfies an assertion
|
|
371
|
+
-- that the key is absent - two mutually exclusive states passing one
|
|
372
|
+
-- check. A sentinel that accepts its own literal is not a sentinel.
|
|
373
|
+
-- (NULLMARK still accepts NULLMARK: under the default null flag a real
|
|
374
|
+
-- null has already been normalised to it, so the two are genuinely
|
|
375
|
+
-- indistinguishable here - that one needs a raw-value escape, not an
|
|
376
|
+
-- ordering change.)
|
|
377
|
+
|
|
378
|
+
-- Explicitly absent: satisfied only by a genuinely missing key, never by
|
|
379
|
+
-- a present null (the distinction the sentinels exist to keep).
|
|
380
|
+
if u.UNDEFMARK == check then
|
|
381
|
+
if u.isabsent(baseval) then
|
|
382
|
+
return
|
|
383
|
+
end
|
|
384
|
+
error(fail(label, index, entry, 'expected absent at ' .. where,
|
|
385
|
+
'absent', u.stringify(baseval)))
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
-- Explicitly null: satisfied only by a present null.
|
|
389
|
+
if u.NULLMARK == check then
|
|
390
|
+
if u.isnull(baseval) or u.NULLMARK == baseval then
|
|
391
|
+
return
|
|
392
|
+
end
|
|
393
|
+
error(fail(label, index, entry, 'expected null at ' .. where,
|
|
394
|
+
'null', u.stringify(baseval)))
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
-- Explicitly present: any present value, including null.
|
|
398
|
+
if u.EXISTSMARK == check then
|
|
399
|
+
if not u.isabsent(baseval) then
|
|
400
|
+
return
|
|
401
|
+
end
|
|
402
|
+
error(fail(label, index, entry, 'expected present at ' .. where,
|
|
403
|
+
'present', 'absent'))
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
-- Identical values match. This sits below the sentinel branches on
|
|
407
|
+
-- purpose - see the note above.
|
|
408
|
+
if u.deepequal(check, baseval) then
|
|
409
|
+
return
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
-- A concrete expectation never matches a missing key - a match leaf
|
|
413
|
+
-- against an absent value must fail, not substring-match "undefined".
|
|
414
|
+
if u.isabsent(baseval) then
|
|
415
|
+
error(fail(label, index, entry, 'match failed at ' .. where,
|
|
416
|
+
u.stringify(check), 'absent'))
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
if not M.matchval(check, baseval) then
|
|
420
|
+
error(fail(label, index, entry, 'match failed at ' .. where,
|
|
421
|
+
u.stringify(check), u.stringify(baseval)))
|
|
422
|
+
end
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
M.match = matchcheck
|
|
426
|
+
|
|
427
|
+
local function checkresult(label, index, entry, args, res)
|
|
428
|
+
local matched = false
|
|
429
|
+
|
|
430
|
+
local entryerr = u.get(entry, 'err')
|
|
431
|
+
if not u.isnone(entryerr) then
|
|
432
|
+
error(fail(label, index, entry, 'expected error did not occur',
|
|
433
|
+
u.stringify(entryerr), u.stringify(res)))
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
local check = u.get(entry, 'match')
|
|
437
|
+
if not u.isnone(check) then
|
|
438
|
+
local base = u.map({
|
|
439
|
+
['in'] = u.get(entry, 'in'),
|
|
440
|
+
args = u.list(args),
|
|
441
|
+
out = u.get(entry, 'res'),
|
|
442
|
+
ctx = u.get(entry, 'ctx'),
|
|
443
|
+
})
|
|
444
|
+
matchcheck(label, index, entry, check, base)
|
|
445
|
+
matched = true
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
local out = u.get(entry, 'out')
|
|
449
|
+
|
|
450
|
+
if u.deepequal(res, out) then
|
|
451
|
+
return
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
-- NOTE: a match with no explicit out is a complete check on its own.
|
|
455
|
+
if matched and (u.isnone(out) or u.NULLMARK == out) then
|
|
456
|
+
return
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
error(fail(label, index, entry, 'result mismatch', u.stringify(out), u.stringify(res)))
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
local function handleerror(label, index, entry, err, provider)
|
|
463
|
+
local entryerr = u.get(entry, 'err')
|
|
464
|
+
|
|
465
|
+
if not u.isnone(entryerr) then
|
|
466
|
+
if true == entryerr or M.matchval(entryerr, M.errmessage(err)) then
|
|
467
|
+
local check = u.get(entry, 'match')
|
|
468
|
+
if not u.isnone(check) then
|
|
469
|
+
local base = u.map({
|
|
470
|
+
['in'] = u.get(entry, 'in'),
|
|
471
|
+
out = u.get(entry, 'res'),
|
|
472
|
+
ctx = u.get(entry, 'ctx'),
|
|
473
|
+
err = M.errbase(err, provider),
|
|
474
|
+
})
|
|
475
|
+
matchcheck(label, index, entry, check, base)
|
|
476
|
+
end
|
|
477
|
+
return
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
error(fail(label, index, entry, 'error mismatch',
|
|
481
|
+
u.stringify(entryerr), M.errmessage(err)))
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
error(fail(label, index, entry, 'unexpected error', nil, M.errmessage(err)))
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
-- Build the argument list: `ctx`, `args`, or `in`. `client` is the
|
|
488
|
+
-- provider that owns this entry's subject (the root provider, unless
|
|
489
|
+
-- `entry.client` names a DEF.client override) - the runner attaches it to
|
|
490
|
+
-- a contextified map argument, so a subject can reach the provider that
|
|
491
|
+
-- owns it.
|
|
492
|
+
local function resolveargs(entry, client, provider)
|
|
493
|
+
local args
|
|
494
|
+
|
|
495
|
+
local hasctx = u.has(entry, 'ctx')
|
|
496
|
+
local hasargs = u.has(entry, 'args')
|
|
497
|
+
|
|
498
|
+
if hasctx then
|
|
499
|
+
args = { u.get(entry, 'ctx') }
|
|
500
|
+
elseif hasargs then
|
|
501
|
+
local raw = u.get(entry, 'args')
|
|
502
|
+
args = {}
|
|
503
|
+
for index, value in ipairs(raw) do
|
|
504
|
+
args[index] = value
|
|
505
|
+
end
|
|
506
|
+
else
|
|
507
|
+
args = { u.clone(u.get(entry, 'in')) }
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
if (hasctx or hasargs) and u.ismap(args[1]) then
|
|
511
|
+
local first = u.clone(args[1])
|
|
512
|
+
if nil ~= provider.contextify then
|
|
513
|
+
first = provider.contextify(first)
|
|
514
|
+
end
|
|
515
|
+
args[1] = first
|
|
516
|
+
rawset(entry, 'ctx', first)
|
|
517
|
+
if u.ismap(first) then
|
|
518
|
+
rawset(first, 'client', client)
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
return args
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
--- Make a runner for a spec file path (or spec value) and a provider.
|
|
526
|
+
function M.makeRunner(specref, provider)
|
|
527
|
+
local alltests = u.isstr(specref) and M.loadspec(specref) or specref
|
|
528
|
+
local specversion = resolveversion(alltests)
|
|
529
|
+
local useprovider = provider or {}
|
|
530
|
+
|
|
531
|
+
return function(name, store)
|
|
532
|
+
local spec = M.resolvespec(name, alltests)
|
|
533
|
+
local clients = {}
|
|
534
|
+
|
|
535
|
+
local defclient = u.get(u.get(spec, 'DEF'), 'client')
|
|
536
|
+
|
|
537
|
+
-- A spec may define clients that a given test run never references.
|
|
538
|
+
if u.ismap(defclient) and nil ~= useprovider.client then
|
|
539
|
+
for clientname, cdef in pairs(defclient) do
|
|
540
|
+
local copts = u.get(u.get(cdef, 'test'), 'options')
|
|
541
|
+
if u.isabsent(copts) then
|
|
542
|
+
copts = u.map({})
|
|
543
|
+
end
|
|
544
|
+
if nil ~= useprovider.inject and u.ismap(store) then
|
|
545
|
+
copts = useprovider.inject(copts, store)
|
|
546
|
+
end
|
|
547
|
+
clients[clientname] = useprovider.client(copts)
|
|
548
|
+
end
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
local subject = nil
|
|
552
|
+
if nil ~= useprovider.subject and nil ~= name then
|
|
553
|
+
subject = useprovider.subject(name)
|
|
554
|
+
end
|
|
555
|
+
|
|
556
|
+
local runpack = {
|
|
557
|
+
spec = spec,
|
|
558
|
+
subject = subject,
|
|
559
|
+
client = useprovider,
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
runpack.set = function(setname)
|
|
563
|
+
return u.get(spec, setname)
|
|
564
|
+
end
|
|
565
|
+
|
|
566
|
+
runpack.runsetflags = function(testspec, flags, testsubject)
|
|
567
|
+
flags = flags or {}
|
|
568
|
+
local donull = nil == flags.null and true or (true == flags.null)
|
|
569
|
+
local label = flags.name or ((nil == name or '' == name) and 'set' or name)
|
|
570
|
+
|
|
571
|
+
local usesubject = testsubject or subject
|
|
572
|
+
if nil == usesubject then
|
|
573
|
+
error(M.OmniError('omni: no test subject for: ' .. label))
|
|
574
|
+
end
|
|
575
|
+
|
|
576
|
+
local testspecmap = M.fixjson(testspec, donull)
|
|
577
|
+
local testset = u.get(testspecmap, 'set')
|
|
578
|
+
|
|
579
|
+
if not u.islist(testset) then
|
|
580
|
+
error(M.OmniError('omni: test spec has no set: ' .. label))
|
|
581
|
+
end
|
|
582
|
+
|
|
583
|
+
if 1 <= specversion then
|
|
584
|
+
checkset(label, testspec, testset)
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
for at, entry in ipairs(testset) do
|
|
588
|
+
local index = at - 1
|
|
589
|
+
|
|
590
|
+
if not u.ismap(entry) then
|
|
591
|
+
error(M.OmniError('omni: ' .. label .. '[' .. index .. ']: entry is not a map'))
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
-- An entry with no `out` expects a null (or absent) result.
|
|
595
|
+
if donull and u.isnone(u.get(entry, 'out')) then
|
|
596
|
+
rawset(entry, 'out', u.NULLMARK)
|
|
597
|
+
end
|
|
598
|
+
|
|
599
|
+
local entrysubject = usesubject
|
|
600
|
+
local entryclient = useprovider
|
|
601
|
+
local clientname = u.get(entry, 'client')
|
|
602
|
+
|
|
603
|
+
if u.isstr(clientname) then
|
|
604
|
+
local client = clients[clientname]
|
|
605
|
+
if nil == client then
|
|
606
|
+
error(M.OmniError('omni: unknown client: ' .. clientname, entry))
|
|
607
|
+
end
|
|
608
|
+
entryclient = client
|
|
609
|
+
if nil ~= client.subject then
|
|
610
|
+
local clientsubject = client.subject(name)
|
|
611
|
+
if nil ~= clientsubject then
|
|
612
|
+
entrysubject = clientsubject
|
|
613
|
+
end
|
|
614
|
+
end
|
|
615
|
+
end
|
|
616
|
+
|
|
617
|
+
local args = resolveargs(entry, entryclient, useprovider)
|
|
618
|
+
|
|
619
|
+
local ok, result = pcall(entrysubject, table.unpack(args))
|
|
620
|
+
|
|
621
|
+
if ok then
|
|
622
|
+
local res = M.fixjson(result, donull)
|
|
623
|
+
rawset(entry, 'res', res)
|
|
624
|
+
checkresult(label, index, entry, args, res)
|
|
625
|
+
elseif M.isomnierror(result) then
|
|
626
|
+
error(result)
|
|
627
|
+
else
|
|
628
|
+
handleerror(label, index, entry, result, useprovider)
|
|
629
|
+
end
|
|
630
|
+
end
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
runpack.runset = function(testspec, testsubject)
|
|
634
|
+
return runpack.runsetflags(testspec, {}, testsubject)
|
|
635
|
+
end
|
|
636
|
+
|
|
637
|
+
return runpack
|
|
638
|
+
end
|
|
639
|
+
end
|
|
640
|
+
|
|
641
|
+
return M
|