@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,139 @@
|
|
|
1
|
+
// VENDORED: @voxgig/omni sdk-20260904-1610-0 (kotlin/src/Util.kt)
|
|
2
|
+
// Source: https://github.com/voxgig/omni @ 8c3e1b573a8d35796f7fc45e3226b977023cabf7 [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// Omni internal JSON utilities.
|
|
5
|
+
//
|
|
6
|
+
// Self-contained by design: the omni runner must be able to test *any*
|
|
7
|
+
// library, including libraries that provide these same operations.
|
|
8
|
+
|
|
9
|
+
package voxgig.omni
|
|
10
|
+
|
|
11
|
+
import kotlin.math.abs
|
|
12
|
+
import kotlin.math.truncate
|
|
13
|
+
|
|
14
|
+
const val NULLMARK = "__NULL__" // Value is JSON null.
|
|
15
|
+
const val UNDEFMARK = "__UNDEF__" // Value is not present.
|
|
16
|
+
const val EXISTSMARK = "__EXISTS__" // Value exists (not undefined).
|
|
17
|
+
|
|
18
|
+
/** Deep copy a JSON value. */
|
|
19
|
+
fun clone(val_: Json): Json = when (val_) {
|
|
20
|
+
is Json.JList -> Json.JList(val_.value.map { clone(it) }.toMutableList())
|
|
21
|
+
is Json.JMap -> {
|
|
22
|
+
val out = LinkedHashMap<String, Json>()
|
|
23
|
+
for ((key, entry) in val_.value) {
|
|
24
|
+
out[key] = clone(entry)
|
|
25
|
+
}
|
|
26
|
+
Json.JMap(out)
|
|
27
|
+
}
|
|
28
|
+
else -> val_
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Read a value by path. Returns Absent when any step is missing. */
|
|
32
|
+
fun getpath(val_: Json, path: List<String>): Json {
|
|
33
|
+
var current = val_
|
|
34
|
+
|
|
35
|
+
for (part in path) {
|
|
36
|
+
current = when (current) {
|
|
37
|
+
is Json.JList -> {
|
|
38
|
+
val index = part.toIntOrNull()
|
|
39
|
+
if (null == index || 0 > index || index >= current.value.size) {
|
|
40
|
+
return Json.Absent
|
|
41
|
+
}
|
|
42
|
+
current.value[index]
|
|
43
|
+
}
|
|
44
|
+
is Json.JMap -> current.value[part] ?: return Json.Absent
|
|
45
|
+
else -> return Json.Absent
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return current
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Depth-first walk: children first, then the containing node. */
|
|
53
|
+
fun walk(val_: Json, apply: (Json, List<String>) -> Json, path: List<String> = listOf()): Json {
|
|
54
|
+
val next = when (val_) {
|
|
55
|
+
is Json.JList -> Json.JList(
|
|
56
|
+
val_.value.mapIndexed { index, entry -> walk(entry, apply, path + "$index") }.toMutableList()
|
|
57
|
+
)
|
|
58
|
+
is Json.JMap -> {
|
|
59
|
+
val out = LinkedHashMap<String, Json>()
|
|
60
|
+
for ((key, entry) in val_.value) {
|
|
61
|
+
out[key] = walk(entry, apply, path + key)
|
|
62
|
+
}
|
|
63
|
+
Json.JMap(out)
|
|
64
|
+
}
|
|
65
|
+
else -> val_
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return apply(next, path)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Deep structural equality: numbers by value, bools never numbers. */
|
|
72
|
+
fun deepequal(a: Json, b: Json): Boolean = when {
|
|
73
|
+
a is Json.Absent && b is Json.Absent -> true
|
|
74
|
+
a is Json.Null && b is Json.Null -> true
|
|
75
|
+
a is Json.Bool && b is Json.Bool -> a.value == b.value
|
|
76
|
+
a is Json.Num && b is Json.Num -> a.value == b.value || (a.value.isNaN() && b.value.isNaN())
|
|
77
|
+
a is Json.Str && b is Json.Str -> a.value == b.value
|
|
78
|
+
a is Json.JList && b is Json.JList ->
|
|
79
|
+
a.value.size == b.value.size &&
|
|
80
|
+
a.value.indices.all { deepequal(a.value[it], b.value[it]) }
|
|
81
|
+
a is Json.JMap && b is Json.JMap ->
|
|
82
|
+
a.value.size == b.value.size &&
|
|
83
|
+
a.value.all { (key, entry) ->
|
|
84
|
+
b.value.containsKey(key) && deepequal(entry, b.value[key]!!)
|
|
85
|
+
}
|
|
86
|
+
else -> false
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Render a number the same way in every port: 5.0 prints as 5. */
|
|
90
|
+
fun numstr(val_: Double): String {
|
|
91
|
+
if (val_.isNaN() || val_.isInfinite()) {
|
|
92
|
+
return "null"
|
|
93
|
+
}
|
|
94
|
+
if (val_ == truncate(val_) && abs(val_) < 9007199254740992.0) {
|
|
95
|
+
return val_.toLong().toString()
|
|
96
|
+
}
|
|
97
|
+
return val_.toString()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Render a string as a JSON string literal. */
|
|
101
|
+
fun quote(val_: String): String {
|
|
102
|
+
val out = StringBuilder("\"")
|
|
103
|
+
|
|
104
|
+
for (ch in val_) {
|
|
105
|
+
when (ch) {
|
|
106
|
+
'"' -> out.append("\\\"")
|
|
107
|
+
'\\' -> out.append("\\\\")
|
|
108
|
+
'\n' -> out.append("\\n")
|
|
109
|
+
'\r' -> out.append("\\r")
|
|
110
|
+
'\t' -> out.append("\\t")
|
|
111
|
+
else ->
|
|
112
|
+
if (0x20 > ch.code) {
|
|
113
|
+
out.append("\\u%04x".format(ch.code))
|
|
114
|
+
} else {
|
|
115
|
+
out.append(ch)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return out.append('"').toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Compact JSON text with map keys sorted, identical in every port. */
|
|
124
|
+
fun jsonstr(val_: Json): String = when (val_) {
|
|
125
|
+
is Json.Absent -> "undefined"
|
|
126
|
+
is Json.Null -> "null"
|
|
127
|
+
is Json.Bool -> if (val_.value) "true" else "false"
|
|
128
|
+
is Json.Num -> numstr(val_.value)
|
|
129
|
+
is Json.Str -> quote(val_.value)
|
|
130
|
+
is Json.JList -> "[" + val_.value.joinToString(",") { jsonstr(it) } + "]"
|
|
131
|
+
is Json.JMap ->
|
|
132
|
+
"{" + val_.value.keys.sorted().joinToString(",") { quote(it) + ":" + jsonstr(val_.value[it]!!) } + "}"
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Strings verbatim, everything else as compact JSON. */
|
|
136
|
+
fun stringify(val_: Json): String = (val_ as? Json.Str)?.value ?: jsonstr(val_)
|
|
137
|
+
|
|
138
|
+
/** Render a path as a dotted string. */
|
|
139
|
+
fun pathify(path: List<String>): String = path.joinToString(".")
|
|
@@ -34,17 +34,20 @@ fun makeSpec(ctx: Context): Spec {
|
|
|
34
34
|
val spec = Spec(specmap)
|
|
35
35
|
ctx.spec = spec
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// null-safe: an op outside the convention resolves NO method (see
|
|
38
|
+
// prepareMethod), which the allow list can never contain.
|
|
39
|
+
val method = utility.prepareMethod(ctx)
|
|
38
40
|
|
|
39
41
|
val allowMethodRaw = Struct.getpath(options, listOf("allow", "method"))
|
|
40
42
|
val allowMethod = if (allowMethodRaw is String) allowMethodRaw else ""
|
|
41
|
-
if (!allowMethod.contains(
|
|
43
|
+
if (method == null || "" == method || !allowMethod.contains(method)) {
|
|
42
44
|
throw ctx.makeError(
|
|
43
45
|
"spec_method_allow",
|
|
44
|
-
"Method \"" +
|
|
46
|
+
"Method \"" + (method ?: "") +
|
|
45
47
|
"\" not allowed by SDK option allow.method value: \"" + allowMethod + "\"",
|
|
46
48
|
)
|
|
47
49
|
}
|
|
50
|
+
spec.method = method
|
|
48
51
|
|
|
49
52
|
spec.params = utility.prepareParams(ctx)
|
|
50
53
|
spec.query = utility.prepareQuery(ctx)
|
|
@@ -141,7 +141,7 @@ fun prepareHeaders(ctx: Context): MutableMap<String, Any?> {
|
|
|
141
141
|
return out ?: linkedMapOf()
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
fun prepareMethod(ctx: Context): String {
|
|
144
|
+
fun prepareMethod(ctx: Context): String? {
|
|
145
145
|
val opname = ctx.op.name
|
|
146
146
|
|
|
147
147
|
// The API definition is authoritative: a POST-only or PATCH-based API
|
|
@@ -152,11 +152,11 @@ fun prepareMethod(ctx: Context): String {
|
|
|
152
152
|
return pm.uppercase()
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return
|
|
155
|
+
// No default: an op name outside the convention resolves to NO method,
|
|
156
|
+
// exactly as the ts reference (`methodMap[key]` is undefined there).
|
|
157
|
+
// The silent-pass engine hid a stray "GET" fallback here; the shared
|
|
158
|
+
// corpus (prepareMethod, opname "bad" -> null) pins it now.
|
|
159
|
+
return METHOD_MAP[opname]
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
@Suppress("UNCHECKED_CAST")
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// VENDORED: @voxgig/struct 0.1.1 (kotlin/src/main/kotlin/voxgig/struct/Struct.kt)
|
|
2
|
+
// Source: https://github.com/voxgig/struct @ 2caf7f448f265144c18dd6fab6ba270a7f3bca07 [tag: sdk-20260904-1610-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
1
4
|
package KOTLINPACKAGE.utility.struct
|
|
2
5
|
|
|
3
6
|
import java.net.URLEncoder
|
|
@@ -2218,8 +2221,21 @@ object Struct {
|
|
|
2218
2221
|
val pl = inj.parent as MutableList<Any?>
|
|
2219
2222
|
for (i in dpl.indices) setprop(pl, i, clone(childtm))
|
|
2220
2223
|
while (pl.size > dpl.size) pl.removeAt(pl.size - 1)
|
|
2221
|
-
|
|
2222
|
-
|
|
2224
|
+
|
|
2225
|
+
// NOTE: modifying inj! This extends the child value loop in inject
|
|
2226
|
+
// to cover every cloned child.
|
|
2227
|
+
for (ckeyI in size(inj.keys) until size(pl)) {
|
|
2228
|
+
inj.keys.add(strkey(ckeyI))
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
// Restart the child value loop at the first element (the loop
|
|
2232
|
+
// increments keyI on resume) so that the first element is also
|
|
2233
|
+
// validated against the child template.
|
|
2234
|
+
inj.keyI = -1
|
|
2235
|
+
|
|
2236
|
+
// SKIP leaves the cloned child template in place at the first
|
|
2237
|
+
// element so the resumed loop can validate it.
|
|
2238
|
+
SKIP
|
|
2223
2239
|
}
|
|
2224
2240
|
else -> UNDEF
|
|
2225
2241
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
.PHONY: test build lint clean corpus
|
|
1
|
+
.PHONY: test build lint clean corpus smoke
|
|
2
2
|
|
|
3
3
|
# Build every lean_lib and lean_exe declared in lakefile.toml.
|
|
4
4
|
build:
|
|
5
5
|
lake build
|
|
6
6
|
|
|
7
|
-
# Run the
|
|
8
|
-
# and
|
|
9
|
-
#
|
|
10
|
-
#
|
|
7
|
+
# Run the five generated test executables. `omnismoke` proves the VENDORED
|
|
8
|
+
# @voxgig/omni engine itself is alive (and can still FAIL), `runner` drives
|
|
9
|
+
# the SDK pipeline and the generated entity/direct tests, `feature` the
|
|
10
|
+
# feature suite, `primary` the shared primary-utility corpus, and
|
|
11
|
+
# `structcorpus` the vendored voxgig/struct corpus. Any one exiting non-zero
|
|
12
|
+
# fails the target. The smoke test runs FIRST: a corpus suite that went green
|
|
13
|
+
# on a broken engine would prove nothing.
|
|
11
14
|
test:
|
|
15
|
+
lake exe omnismoke
|
|
12
16
|
lake exe runner
|
|
13
17
|
lake exe feature
|
|
14
18
|
lake exe primary
|
|
@@ -17,6 +21,9 @@ test:
|
|
|
17
21
|
corpus:
|
|
18
22
|
lake exe structcorpus
|
|
19
23
|
|
|
24
|
+
smoke:
|
|
25
|
+
lake exe omnismoke
|
|
26
|
+
|
|
20
27
|
# "Lint": a clean build means the code type-checks.
|
|
21
28
|
lint:
|
|
22
29
|
lake build
|
|
@@ -71,12 +71,25 @@ def isErrV (v : Value) : SIO Bool := do
|
|
|
71
71
|
-- Operation naming
|
|
72
72
|
-- ---------------------------------------------------------------------------
|
|
73
73
|
|
|
74
|
+
/-- The op-name convention, used only when the API definition names no
|
|
75
|
+
method for the point.
|
|
76
|
+
|
|
77
|
+
NO CATCH-ALL GET. The ts reference returns `methodMap[key]`, which is
|
|
78
|
+
undefined for an op the map does not name — the request is then rejected
|
|
79
|
+
rather than silently issued. A `| _ => "GET"` here turned every
|
|
80
|
+
unrecognised op into a GET, which is both a divergence from the corpus
|
|
81
|
+
(`primary/prepareMethod` case 6, opname "bad", expects no method) and the
|
|
82
|
+
more dangerous of the two behaviours: a mistyped or unsupported op quietly
|
|
83
|
+
fetched. "" is Lean's spelling of the same "no value"; the seven other
|
|
84
|
+
targets that carried this bug answer it identically. -/
|
|
74
85
|
def opMethodOf : String → String
|
|
75
86
|
| "create" => "POST"
|
|
76
87
|
| "update" => "PUT"
|
|
88
|
+
| "load" => "GET"
|
|
89
|
+
| "list" => "GET"
|
|
77
90
|
| "remove" => "DELETE"
|
|
78
91
|
| "patch" => "PATCH"
|
|
79
|
-
| _ => "
|
|
92
|
+
| _ => ""
|
|
80
93
|
|
|
81
94
|
def opInputOf : String → String
|
|
82
95
|
| "create" => "data"
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/- The corpus test runner: the VENDORED @voxgig/omni port (test/vendor/omni/
|
|
2
|
+
Omni.lean) driven through its NATIVE API (`Omni.makeRunnerSpec` /
|
|
3
|
+
`RunPack.runsetflagsargs`), presented to the corpus suites in the shape
|
|
4
|
+
they already use (`runspec`, `getset`, `runset`, `runsetArgs`, `report`).
|
|
5
|
+
|
|
6
|
+
No compat shim is vendored: the adapter below IS the whole bridge, per
|
|
7
|
+
language, per the vendor-tag rollout (docs/design/vendor-tag-rollout.md,
|
|
8
|
+
Decision 4). It is the Lean peer of tm/ocaml/test/omni_resolver.ml and
|
|
9
|
+
tm/java/test/OmniResolver.java — omni's provider is closure-based, so
|
|
10
|
+
nothing in omni ever has to name this SDK's types.
|
|
11
|
+
|
|
12
|
+
The engine used to live FUSED inside the two corpus suites: each carried
|
|
13
|
+
its own JSON reader, fixJson, deep equality, matchval/doMatch,
|
|
14
|
+
resolveArgs, checkResult, handleError and runSet. Both were rewritten in
|
|
15
|
+
place onto this file, so both KEEP THEIR NAMES and no emitted call site
|
|
16
|
+
needed churn — which is why nothing is listed as `superseded` for this
|
|
17
|
+
target.
|
|
18
|
+
|
|
19
|
+
Lean-specific decisions, each load-bearing:
|
|
20
|
+
|
|
21
|
+
1. omni IS PURE, THIS SDK IS NOT. omni's `Subject` is
|
|
22
|
+
`List Val → Except String Val`, a pure function; this SDK's struct port
|
|
23
|
+
keeps its nodes in a heap threaded through `SIO` (a `ReaderT Ctx IO`),
|
|
24
|
+
because Lean has no mutable value semantics. The subject callback is the
|
|
25
|
+
one place the two meet, so it runs the action with `unsafeIO` — the
|
|
26
|
+
escape hatch Lean provides for exactly this, and the same bridge
|
|
27
|
+
voxgig/struct's own Lean corpus runner uses. TEST CODE ONLY: nothing
|
|
28
|
+
under src/ names `runsio`.
|
|
29
|
+
|
|
30
|
+
2. TWO VALUE MODELS, ONE CONVERSION PAIR. `Omni.Val` (`Option Lean.Json`)
|
|
31
|
+
and `VoxgigStruct.Value` are different types, so every crossing is an
|
|
32
|
+
explicit `tostruct` / `toomni`. omni's `none` (ABSENT) becomes this
|
|
33
|
+
port's `.noval` and `Json.null` becomes `.null`, which keeps the two
|
|
34
|
+
no-value states the corpus distinguishes apart — and is why Lean needs
|
|
35
|
+
neither go's `novalargs` spec rewrite nor lua/php's compat shim for the
|
|
36
|
+
corpus's ZERO-ARGUMENT entries. An entry with no `in`/`args`/`ctx`
|
|
37
|
+
reaches the subject as one `Omni.Val` of `none`, which becomes exactly
|
|
38
|
+
this port's own no-value, so `typify` answers T_NOVAL where a null
|
|
39
|
+
would answer T_NULL.
|
|
40
|
+
|
|
41
|
+
3. ARGUMENTS ARE WRITTEN BACK. `Omni.SubjectArgs` is the channel omni
|
|
42
|
+
provides for a subject that MUTATES its arguments, which
|
|
43
|
+
`match: {args: ...}` then asserts on — `struct/minor/setpath` (7
|
|
44
|
+
entries here) and `struct/merge/integrity` (6) turn on it. Decision 2
|
|
45
|
+
hands the subject a CONVERTED COPY on this SDK's heap, and `Lean.Json`
|
|
46
|
+
is immutable, so every subject here runs through `runsetflagsargs` and
|
|
47
|
+
the wrapper converts the (possibly mutated) values back into omni's
|
|
48
|
+
own list after the call. A dynamic port's shim gets this free from
|
|
49
|
+
shared object identity; Lean cannot.
|
|
50
|
+
|
|
51
|
+
4. `match: {ctx: ...}` IS RETARGETED ONTO `match: {args: {"0": ...}}`.
|
|
52
|
+
A VALUE-SEMANTICS consequence, not a choice. omni's `drive` stores the
|
|
53
|
+
contextified first argument as `entry.ctx` AND as `args[0]` — two
|
|
54
|
+
copies of an immutable value — and `checkresult` reads `entry.ctx` for
|
|
55
|
+
the ctx base. A subject's post-call writes (decision 3) can never reach
|
|
56
|
+
that copy, and NINE `primary` entries assert exactly the post-call
|
|
57
|
+
state (makeRequest, makeResponse, makeSpec, param, prepareAuth,
|
|
58
|
+
resultBody, resultHeaders, transformRequest, transformResponse).
|
|
59
|
+
`args[0]` IS the ctx of a ctx entry (omni itself sets
|
|
60
|
+
`args = [entry.ctx]`), and the runner reads that list back after an
|
|
61
|
+
args-subject call — so moving the assertion from `ctx` to `args.0`
|
|
62
|
+
reads the SAME map, post-call, and preserves every leaf: nothing is
|
|
63
|
+
dropped, weakened or skipped. `retargetctx` below does that rewrite on
|
|
64
|
+
the spec handed to the engine. OCaml, Rust and Swift face the identical
|
|
65
|
+
problem and answer it identically; the upstream fix is for the port's
|
|
66
|
+
`drive` to re-point `entry.ctx` at the returned `args[0]`, the way JS
|
|
67
|
+
object identity does implicitly — a follow-up, never a hand-edit of a
|
|
68
|
+
vendored file.
|
|
69
|
+
|
|
70
|
+
5. KEY ORDER. omni's Lean port models a map as `Lean.Json.obj`, whose
|
|
71
|
+
container is key-SORTED (the vendored file says so itself), while this
|
|
72
|
+
SDK's `Value` map is insertion-ordered. Every map in the shipped corpus
|
|
73
|
+
is key-sorted, so the round trip is order-preserving in practice — and
|
|
74
|
+
`Omni.deepequal` compares maps order-independently in any case. A
|
|
75
|
+
corpus that ever ships an unsorted map would need the upstream fix
|
|
76
|
+
(omni's own value model), never a hand-edit here.
|
|
77
|
+
|
|
78
|
+
6. FAILURES ARE ACCUMULATED, NOT RAISED. omni stops a group at its first
|
|
79
|
+
bad entry and returns the message; the corpus suites report the whole
|
|
80
|
+
corpus in one run. `drive` records the message and carries on, so one
|
|
81
|
+
run still names every broken GROUP. A group that is ABSENT from the
|
|
82
|
+
corpus, or present with an empty set, is recorded in `skipped` and
|
|
83
|
+
printed by `report` — named out loud, never a silent vacuous pass. -/
|
|
84
|
+
|
|
85
|
+
import VoxgigStruct
|
|
86
|
+
import Omni
|
|
87
|
+
|
|
88
|
+
open VoxgigStruct
|
|
89
|
+
|
|
90
|
+
namespace OmniResolver
|
|
91
|
+
|
|
92
|
+
-- ---------------- the sentinels, under the corpus's own names ----------
|
|
93
|
+
|
|
94
|
+
def nullmark : String := Omni.nullmark
|
|
95
|
+
def undefmark : String := Omni.undefmark
|
|
96
|
+
def existsmark : String := Omni.existsmark
|
|
97
|
+
|
|
98
|
+
-- ---------------- decision 1: the SIO <-> pure bridge ------------------
|
|
99
|
+
|
|
100
|
+
unsafe def runsioImpl {α : Type} [Inhabited α] (ctx : Ctx) (act : SIO α)
|
|
101
|
+
: Except String α :=
|
|
102
|
+
match unsafeIO (act.run ctx) with
|
|
103
|
+
| .ok value => .ok value
|
|
104
|
+
| .error err => .error err.toString
|
|
105
|
+
|
|
106
|
+
@[implemented_by runsioImpl]
|
|
107
|
+
opaque runsio {α : Type} [Inhabited α] (ctx : Ctx) (act : SIO α) : Except String α
|
|
108
|
+
|
|
109
|
+
-- ---------------- decision 2: the value models -------------------------
|
|
110
|
+
|
|
111
|
+
/-- omni's model -> this SDK's. Nodes are built through `newList` /
|
|
112
|
+
`emptyMap`, so what a subject receives is a real heap node it may rewrite in
|
|
113
|
+
place (decision 3). -/
|
|
114
|
+
partial def tostruct (value : Omni.Val) : SIO Value := do
|
|
115
|
+
match value with
|
|
116
|
+
| none => pure .noval
|
|
117
|
+
| some .null => pure .null
|
|
118
|
+
| some (.bool flag) => pure (.bool flag)
|
|
119
|
+
| some (.num entry) => pure (.num entry.toFloat)
|
|
120
|
+
| some (.str text) => pure (.str text)
|
|
121
|
+
| some (.arr entries) => do
|
|
122
|
+
let mut out : Array Value := #[]
|
|
123
|
+
for entry in entries do
|
|
124
|
+
out := out.push (← tostruct (some entry))
|
|
125
|
+
newList out
|
|
126
|
+
| some (.obj kvs) => do
|
|
127
|
+
let m ← emptyMap
|
|
128
|
+
for kv in kvs.toArray do
|
|
129
|
+
let _ ← setprop m (.str kv.1) (← tostruct (some kv.2))
|
|
130
|
+
pure m
|
|
131
|
+
|
|
132
|
+
/-- This SDK's model -> omni's. A function or a sentinel has no JSON form and
|
|
133
|
+
omni only ever stringifies one, so it becomes its own rendering rather than
|
|
134
|
+
silently collapsing to null — an unexpected one then FAILS visibly instead of
|
|
135
|
+
vanishing. -/
|
|
136
|
+
partial def toomni (value : Value) : SIO Omni.Val := do
|
|
137
|
+
match value with
|
|
138
|
+
| .noval => pure none
|
|
139
|
+
| .null => pure (some Lean.Json.null)
|
|
140
|
+
| .bool flag => pure (some (Lean.Json.bool flag))
|
|
141
|
+
| .num n => pure (some (
|
|
142
|
+
-- Whole values keep their integer spelling; anything else goes through
|
|
143
|
+
-- the float constructor, which is the only lossless route Lean offers.
|
|
144
|
+
if n == n.floor && n.abs < 9007199254740992.0 then
|
|
145
|
+
Lean.Json.num (Lean.JsonNumber.fromInt (Int.ofNat n.abs.toUInt64.toNat
|
|
146
|
+
|> fun m => if n < 0.0 then -m else m))
|
|
147
|
+
else
|
|
148
|
+
match Lean.JsonNumber.fromFloat? n with
|
|
149
|
+
| .inr number => Lean.Json.num number
|
|
150
|
+
| .inl _ => Lean.Json.null))
|
|
151
|
+
| .str text => pure (some (Lean.Json.str text))
|
|
152
|
+
| .list id => do
|
|
153
|
+
let mut out : Array Lean.Json := #[]
|
|
154
|
+
for item in (← listItems id) do
|
|
155
|
+
out := out.push ((← toomni item).getD Lean.Json.null)
|
|
156
|
+
pure (some (Lean.Json.arr out))
|
|
157
|
+
| .map id => do
|
|
158
|
+
let mut out : List (String × Lean.Json) := []
|
|
159
|
+
for (k, v) in (← mapEntries id) do
|
|
160
|
+
out := (k, (← toomni v).getD Lean.Json.null) :: out
|
|
161
|
+
pure (some (Lean.Json.mkObj out.reverse))
|
|
162
|
+
| .func _ => pure (some (Lean.Json.str "[Function]"))
|
|
163
|
+
| .sentinel tag => pure (some (Lean.Json.str ("`$" ++ tag ++ "`")))
|
|
164
|
+
|
|
165
|
+
/-- Order-independent deep equality, through omni's own rule so a suite's
|
|
166
|
+
hand-written comparison matches the way every group is checked. -/
|
|
167
|
+
def eqv (a b : Value) : SIO Bool := do
|
|
168
|
+
pure (Omni.deepequal (← toomni a) (← toomni b))
|
|
169
|
+
|
|
170
|
+
-- ---------------- value helpers (re-homed from the fused runners) ------
|
|
171
|
+
|
|
172
|
+
/-- Raw property read: a stored `null` is preserved, an absent key answers
|
|
173
|
+
`.noval`. NOT `SdkUtility.gp`, which collapses the two. -/
|
|
174
|
+
def getp (value : Value) (key : String) : SIO Value := do
|
|
175
|
+
match value with
|
|
176
|
+
| .map id => pure ((omapGet (← mapEntries id) key).getD .noval)
|
|
177
|
+
| _ => pure .noval
|
|
178
|
+
|
|
179
|
+
def hasp (value : Value) (key : String) : SIO Bool := do
|
|
180
|
+
match value with
|
|
181
|
+
| .map id => pure (omapHas (← mapEntries id) key)
|
|
182
|
+
| _ => pure false
|
|
183
|
+
|
|
184
|
+
def omapV (pairs : List (String × Value)) : SIO Value := do
|
|
185
|
+
let m ← emptyMap
|
|
186
|
+
for (key, value) in pairs do
|
|
187
|
+
let _ ← setprop m (.str key) value
|
|
188
|
+
pure m
|
|
189
|
+
|
|
190
|
+
/-- One of omni's arguments, absent answering `.noval`. -/
|
|
191
|
+
def arg (args : Array Value) (index : Nat) : Value := args[index]?.getD .noval
|
|
192
|
+
|
|
193
|
+
-- ---------------- the run ----------------------------------------------
|
|
194
|
+
|
|
195
|
+
/-- One corpus run: the engine's pack, plus the accumulated tally
|
|
196
|
+
(decision 6). The counters are `IO.Ref`s because a Lean structure is
|
|
197
|
+
immutable and every suite drives dozens of groups in sequence. -/
|
|
198
|
+
structure Run where
|
|
199
|
+
pack : Omni.RunPack
|
|
200
|
+
pass : IO.Ref Nat
|
|
201
|
+
groups : IO.Ref Nat
|
|
202
|
+
failures : IO.Ref (Array String)
|
|
203
|
+
skipped : IO.Ref (Array String)
|
|
204
|
+
|
|
205
|
+
/-- Every provider hook is optional and this SDK needs none of them: subjects
|
|
206
|
+
are passed explicitly per group (so `subject` is unused), no suite builds a
|
|
207
|
+
client from a corpus `DEF.client` block (so `client` is unused), contexts stay
|
|
208
|
+
maps across the runner (decision 4, so `contextify` is unused), and no corpus
|
|
209
|
+
entry asserts on an error CODE, so omni's own {name,message} errify is exactly
|
|
210
|
+
right. -/
|
|
211
|
+
def provider : Omni.Provider := Omni.emptyProvider
|
|
212
|
+
|
|
213
|
+
def makeRunSpec (alltests : Lean.Json) (name : String) : IO Run := do
|
|
214
|
+
let pack ← match Omni.makeRunnerSpec alltests provider name with
|
|
215
|
+
| .ok pack => pure pack
|
|
216
|
+
| .error message => throw (IO.userError message)
|
|
217
|
+
let pass ← IO.mkRef 0
|
|
218
|
+
let groups ← IO.mkRef 0
|
|
219
|
+
let failures ← IO.mkRef (#[] : Array String)
|
|
220
|
+
let skipped ← IO.mkRef (#[] : Array String)
|
|
221
|
+
pure { pack, pass, groups, failures, skipped }
|
|
222
|
+
|
|
223
|
+
def makeRun (testfile : String) (name : String) : IO Run := do
|
|
224
|
+
makeRunSpec (← Omni.loadspec testfile) name
|
|
225
|
+
|
|
226
|
+
/-- Where the shared corpus lives: the first command-line argument, else
|
|
227
|
+
$SDK_TEST_SPEC, else the usual relative positions. The first candidate is the
|
|
228
|
+
fallback so a missing file is reported by name. -/
|
|
229
|
+
def specCandidates : Array String :=
|
|
230
|
+
#["../.sdk/test/test.json", ".sdk/test/test.json", "test/test.json"]
|
|
231
|
+
|
|
232
|
+
def resolveSpecPath (argv : List String) : IO String := do
|
|
233
|
+
match argv.head? with
|
|
234
|
+
| some given => pure given
|
|
235
|
+
| none =>
|
|
236
|
+
match (← IO.getEnv "SDK_TEST_SPEC") with
|
|
237
|
+
| some given => pure given
|
|
238
|
+
| none => do
|
|
239
|
+
for candidate in specCandidates do
|
|
240
|
+
if ← System.FilePath.pathExists candidate then
|
|
241
|
+
return candidate
|
|
242
|
+
pure specCandidates[0]!
|
|
243
|
+
|
|
244
|
+
/-- The resolved section of the spec (omni's `primary.<name>`, then `<name>`,
|
|
245
|
+
then the whole spec). -/
|
|
246
|
+
def runspec (r : Run) : Lean.Json := r.pack.spec
|
|
247
|
+
|
|
248
|
+
/-- A named group, by a path of keys from the resolved section. -/
|
|
249
|
+
def getset (r : Run) (keys : List String) : Omni.Val :=
|
|
250
|
+
keys.foldl (fun acc key => Omni.jget acc key) (some r.pack.spec)
|
|
251
|
+
|
|
252
|
+
/-- A corpus group authored as ONE `{in, out}` pair rather than a set —
|
|
253
|
+
`merge/basic`, `inject/basic`, `transform/basic`, `walk/log`. Wrapped into a
|
|
254
|
+
one-entry set so it runs through the SAME engine as everything else instead of
|
|
255
|
+
a bespoke code path beside it. `out` selects a sub-path of the authored `out`
|
|
256
|
+
(walk/log asserts only on `out.after`). -/
|
|
257
|
+
def single (node : Omni.Val) (out : List String := []) : Omni.Val :=
|
|
258
|
+
let expected := out.foldl (fun acc key => Omni.jget acc key) (Omni.jget node "out")
|
|
259
|
+
some (Omni.jmap [("set", Omni.jlist [
|
|
260
|
+
Omni.jmap [("in", (Omni.jget node "in").getD Lean.Json.null),
|
|
261
|
+
("out", expected.getD Lean.Json.null)]])])
|
|
262
|
+
|
|
263
|
+
-- ---------------- decision 4: retarget match.ctx -----------------------
|
|
264
|
+
|
|
265
|
+
def retargetctx (testspec : Lean.Json) : Lean.Json :=
|
|
266
|
+
match Omni.aslist (Omni.jget (some testspec) "set") with
|
|
267
|
+
| none => testspec
|
|
268
|
+
| some entries =>
|
|
269
|
+
let rewrite (raw : Lean.Json) : Lean.Json :=
|
|
270
|
+
let check := Omni.jget (some raw) "match"
|
|
271
|
+
if Omni.ismap (some raw) && Omni.ismap check && Omni.jhas check "ctx"
|
|
272
|
+
&& !Omni.jhas check "args"
|
|
273
|
+
&& (Omni.jhas (some raw) "ctx" || Omni.jhas (some raw) "args") then
|
|
274
|
+
-- Drop the original leaf: it would read the stale pre-call copy omni
|
|
275
|
+
-- keeps in `entry.ctx`.
|
|
276
|
+
let kept := ((Omni.asmap check).getD []).filter (fun kv => kv.1 != "ctx")
|
|
277
|
+
let leaf := (Omni.jget check "ctx").getD Lean.Json.null
|
|
278
|
+
Omni.jset raw "match"
|
|
279
|
+
(Omni.jmap (kept ++ [("args", Omni.jmap [("0", leaf)])]))
|
|
280
|
+
else raw
|
|
281
|
+
Omni.jset testspec "set" (Lean.Json.arr (entries.map rewrite))
|
|
282
|
+
|
|
283
|
+
-- ---------------- driving one group ------------------------------------
|
|
284
|
+
|
|
285
|
+
def entrycount (node : Omni.Val) : Int :=
|
|
286
|
+
match Omni.aslist (Omni.jget node "set") with
|
|
287
|
+
| some entries => (entries.size : Int)
|
|
288
|
+
| none => -1
|
|
289
|
+
|
|
290
|
+
def oneline (text : String) : String :=
|
|
291
|
+
String.intercalate " | " (text.splitOn "\n")
|
|
292
|
+
|
|
293
|
+
def drive (r : Run) (nullflag : Bool) (label : String) (node : Omni.Val)
|
|
294
|
+
(call : Omni.SubjectArgs) : IO Unit := do
|
|
295
|
+
let count := entrycount node
|
|
296
|
+
if count <= 0 then
|
|
297
|
+
-- Absent, malformed, or empty. NAMED, never silent: a group that stopped
|
|
298
|
+
-- running is the failure mode the vendored engine exists to prevent.
|
|
299
|
+
let why :=
|
|
300
|
+
if Omni.isabsent node then "absent from corpus"
|
|
301
|
+
else if count == 0 then "empty set" else "no set"
|
|
302
|
+
r.skipped.modify (·.push s!"{label} ({why})")
|
|
303
|
+
else do
|
|
304
|
+
r.groups.modify (· + 1)
|
|
305
|
+
match r.pack.runsetflagsargs (retargetctx (node.getD Lean.Json.null))
|
|
306
|
+
{ null := nullflag, name := some label } call with
|
|
307
|
+
| .ok () => r.pass.modify (· + count.toNat)
|
|
308
|
+
| .error message => r.failures.modify (·.push (oneline message))
|
|
309
|
+
|
|
310
|
+
/-- The subject wrapper: convert in, call, convert the (possibly mutated)
|
|
311
|
+
arguments and the result back out (decisions 1, 2 and 3). -/
|
|
312
|
+
def wrapArgs (ctx : Ctx) (subject : Array Value → SIO Value) : Omni.SubjectArgs :=
|
|
313
|
+
fun cells =>
|
|
314
|
+
runsio ctx (do
|
|
315
|
+
let mut vals : Array Value := #[]
|
|
316
|
+
for cell in cells do
|
|
317
|
+
vals := vals.push (← tostruct cell)
|
|
318
|
+
let res ← subject vals
|
|
319
|
+
let mut back : Array Omni.Val := #[]
|
|
320
|
+
for value in vals do
|
|
321
|
+
back := back.push (← toomni value)
|
|
322
|
+
pure (back.toList, ← toomni res))
|
|
323
|
+
|
|
324
|
+
/-- Run one group whose subject takes omni's whole argument list. This is the
|
|
325
|
+
shape the `primary` suite needs: a `ctx` entry arrives as `args[0]`, a MAP,
|
|
326
|
+
which the call site turns into a live context and writes the observable state
|
|
327
|
+
back into (decisions 3 and 4). -/
|
|
328
|
+
def runsetArgs (r : Run) (label : String) (node : Omni.Val)
|
|
329
|
+
(subject : Array Value → SIO Value) (nullflag : Bool := true) : SIO Unit := do
|
|
330
|
+
drive r nullflag label node (wrapArgs (← read) subject)
|
|
331
|
+
|
|
332
|
+
/-- Run one group whose subject takes the entry's single argument. -/
|
|
333
|
+
def runset (r : Run) (label : String) (node : Omni.Val)
|
|
334
|
+
(subject : Value → SIO Value) (nullflag : Bool := true) : SIO Unit :=
|
|
335
|
+
runsetArgs r label node (fun vals => subject (arg vals 0)) nullflag
|
|
336
|
+
|
|
337
|
+
-- ---------------- reporting --------------------------------------------
|
|
338
|
+
|
|
339
|
+
def report (r : Run) (heading : String) : IO UInt32 := do
|
|
340
|
+
for message in (← r.failures.get) do
|
|
341
|
+
IO.println ("FAIL " ++ message)
|
|
342
|
+
for note in (← r.skipped.get) do
|
|
343
|
+
IO.println ("SKIP " ++ note)
|
|
344
|
+
let passed ← r.pass.get
|
|
345
|
+
let grouped ← r.groups.get
|
|
346
|
+
let failed := (← r.failures.get).size
|
|
347
|
+
let skips := (← r.skipped.get).size
|
|
348
|
+
IO.println ""
|
|
349
|
+
IO.println s!"{heading}PASS {passed} FAIL {failed}"
|
|
350
|
+
IO.println s!"{heading}GROUPS {grouped} SKIPPED {skips}"
|
|
351
|
+
-- A run that executes nothing is not a pass.
|
|
352
|
+
if passed == 0 then do
|
|
353
|
+
IO.println (heading ++ "the corpus executed no cases")
|
|
354
|
+
return 1
|
|
355
|
+
if 0 < failed then return 1
|
|
356
|
+
return 0
|
|
357
|
+
|
|
358
|
+
end OmniResolver
|