@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
|
@@ -1,18 +1,563 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
1
|
+
# ProjectName SDK struct corpus test
|
|
2
|
+
#
|
|
3
|
+
# The struct corpus (.sdk/test/test.json -> "struct") drives the LIVE SDK's
|
|
4
|
+
# vendored struct utilities through the VENDORED @voxgig/omni engine, via the
|
|
5
|
+
# resolver in test/support/omni.ex. The hand-written engine this suite used to
|
|
6
|
+
# call (test/support/struct_corpus.ex - fixJson / eqv / doMatch / runSet /
|
|
7
|
+
# runSingle, transcribed by hand) is retired: omni resolves arguments, applies
|
|
8
|
+
# the null rules and enforces out/err/match, so the subjects below are the
|
|
9
|
+
# whole of what this port contributes. See docs/design/vendor-tag-rollout.md.
|
|
10
|
+
#
|
|
11
|
+
# Every group goes through `runset`/`runsetflags`, so a corpus entry that
|
|
12
|
+
# changes or is added is executed here without anything being edited. omni
|
|
13
|
+
# RAISES on the first failing entry rather than tallying, so the suite also
|
|
14
|
+
# counts the subject invocations and asserts a floor: a renamed section, or a
|
|
15
|
+
# fixture that compiled to an empty `set`, would otherwise pass silently -
|
|
16
|
+
# which is the one failure mode a shared oracle exists to prevent.
|
|
4
17
|
|
|
5
18
|
defmodule ProjectName.StructCorpusTest do
|
|
6
19
|
use ExUnit.Case
|
|
7
20
|
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
alias Voxgig.Struct, as: S
|
|
22
|
+
alias ProjectName.Omni, as: O
|
|
10
23
|
|
|
11
|
-
|
|
12
|
-
|
|
24
|
+
# Groups this port cannot express, dropped ENTRY BY ENTRY rather than by
|
|
25
|
+
# marking a whole group pending and losing the rest of it.
|
|
26
|
+
#
|
|
27
|
+
# Elixir has ONE `nil` where the canonical port has `undefined` and JSON
|
|
28
|
+
# `null` (the vendored struct says so in its own header), so a subject that
|
|
29
|
+
# returns NOTHING and one that returns JSON null are the same value here.
|
|
30
|
+
# Under `{null: true}` the runner normalises both to NULLMARK and the
|
|
31
|
+
# distinction never arises; the `{null: false}` groups are where it bites,
|
|
32
|
+
# and the corpus is lopsided - reading a bare nil as ABSENT (test/support/
|
|
33
|
+
# omni.ex decision 5) costs the four entries below, reading it as null costs
|
|
34
|
+
# 43. Each drop is GUARDED on the entry's exact JSON: corpus indexes are
|
|
35
|
+
# positional, so a corpus that gains or reorders an entry fails loudly here
|
|
36
|
+
# instead of quietly skipping a different one.
|
|
37
|
+
@drops %{
|
|
38
|
+
{"minor", "clone"} => [{5, ~s({"in":null,"out":null})}],
|
|
39
|
+
{"minor", "getprop"} => [
|
|
40
|
+
{50, ~s({"in":{"alt":null,"key":"x","val":{}},"out":null})},
|
|
41
|
+
{51, ~s({"in":{"alt":null,"key":null,"val":{}},"out":null})}
|
|
42
|
+
],
|
|
43
|
+
{"validate", "basic"} => [{13, ~s({"in":{"data":null,"spec":"`$NULL`"},"out":null})}]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
setup_all do
|
|
47
|
+
testfile = Path.join(File.cwd!(), "../.sdk/test/test.json")
|
|
48
|
+
runner = O.make_runner(testfile, ProjectName.test())
|
|
49
|
+
{:ok, run: runner.("struct")}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# --- corpus plumbing -----------------------------------------------------
|
|
53
|
+
|
|
54
|
+
defp group(spec, name, sub) do
|
|
55
|
+
section = Map.get(spec, name)
|
|
56
|
+
|
|
57
|
+
assert is_map(section),
|
|
58
|
+
"corpus section 'struct.#{name}' missing - check the name against .sdk/test/struct/"
|
|
59
|
+
|
|
60
|
+
node = Map.get(section, sub)
|
|
61
|
+
|
|
62
|
+
assert is_map(node) and is_list(Map.get(node, "set")),
|
|
63
|
+
"corpus group 'struct.#{name}.#{sub}' has no set list"
|
|
64
|
+
|
|
65
|
+
assert [] != Map.get(node, "set"),
|
|
66
|
+
"corpus group 'struct.#{name}.#{sub}' is EMPTY - zero cases would run"
|
|
67
|
+
|
|
68
|
+
drop(node, Map.get(@drops, {name, sub}, []))
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
defp drop(node, []), do: node
|
|
72
|
+
|
|
73
|
+
defp drop(node, drops) do
|
|
74
|
+
set = Map.get(node, "set")
|
|
75
|
+
|
|
76
|
+
Enum.each(drops, fn {index, want} ->
|
|
77
|
+
got = O.stringify(Enum.at(set, index))
|
|
78
|
+
|
|
79
|
+
assert got == want,
|
|
80
|
+
"corpus drop guard: entry #{index} is #{got}, expected #{want} - " <>
|
|
81
|
+
"the corpus changed, so re-measure the drop before moving it"
|
|
82
|
+
end)
|
|
83
|
+
|
|
84
|
+
indexes = MapSet.new(Enum.map(drops, fn {index, _} -> index end))
|
|
85
|
+
|
|
86
|
+
kept =
|
|
87
|
+
set
|
|
88
|
+
|> Enum.with_index()
|
|
89
|
+
|> Enum.reject(fn {_entry, index} -> MapSet.member?(indexes, index) end)
|
|
90
|
+
|> Enum.map(fn {entry, _index} -> entry end)
|
|
91
|
+
|
|
92
|
+
Map.put(node, "set", kept)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# A single-node corpus group (`{in, out}` with no `set`) run as a one-entry
|
|
96
|
+
# set, so it goes through the SAME engine as everything else rather than a
|
|
97
|
+
# bespoke comparison.
|
|
98
|
+
defp single(spec, name, sub) do
|
|
99
|
+
node = Map.get(Map.get(spec, name, %{}), sub)
|
|
100
|
+
assert is_map(node) and Map.has_key?(node, "in"), "corpus group 'struct.#{name}.#{sub}' missing"
|
|
101
|
+
%{"set" => [node]}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# --- subject helpers -----------------------------------------------------
|
|
105
|
+
|
|
106
|
+
# The corpus subjects take omni's resolved ARGUMENT LIST; most want its
|
|
107
|
+
# single element, and an entry with no argument at all arrives as `[]`
|
|
108
|
+
# (omni.ex decision 4), which the no-arg subjects below branch on.
|
|
109
|
+
defp arg1(fun), do: fn args -> fun.(if(args == [], do: nil, else: hd(args))) end
|
|
110
|
+
|
|
111
|
+
defp vget(vin, key), do: if(S.ismap(vin), do: S.getprop(vin, key), else: nil)
|
|
112
|
+
defp vhas(vin, key), do: S.ismap(vin) and Enum.member?(S.keysof(vin), key)
|
|
113
|
+
|
|
114
|
+
defp velems(val) do
|
|
115
|
+
if S.islist(val) do
|
|
116
|
+
n = S.size(val)
|
|
117
|
+
if n == 0, do: [], else: Enum.map(0..(n - 1), fn i -> S.getelem(val, i) end)
|
|
118
|
+
else
|
|
119
|
+
[]
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
defp jss(val) do
|
|
124
|
+
cond do
|
|
125
|
+
val == nil -> "null"
|
|
126
|
+
is_binary(val) -> val
|
|
127
|
+
true -> S.stringify(val)
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
defp joinpath(path), do: velems(path) |> Enum.map(&jss/1) |> Enum.join(".")
|
|
132
|
+
|
|
133
|
+
defp grow_list(node, index) do
|
|
134
|
+
if S.size(node) <= index do
|
|
135
|
+
S.setprop(node, S.size(node), nil)
|
|
136
|
+
grow_list(node, index)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
defp walk_copy_subject(vin) do
|
|
141
|
+
cur = S.jt([nil])
|
|
142
|
+
|
|
143
|
+
walkcopy = fn key, val, _parent, path ->
|
|
144
|
+
if key == nil do
|
|
145
|
+
inner =
|
|
146
|
+
S.jt([
|
|
147
|
+
cond do
|
|
148
|
+
S.ismap(val) -> S.jm([])
|
|
149
|
+
S.islist(val) -> S.jt([])
|
|
150
|
+
true -> val
|
|
151
|
+
end
|
|
152
|
+
])
|
|
153
|
+
|
|
154
|
+
S.setprop(cur, 0, inner)
|
|
155
|
+
else
|
|
156
|
+
i = S.size(path)
|
|
157
|
+
|
|
158
|
+
nv =
|
|
159
|
+
if S.isnode(val) do
|
|
160
|
+
c = S.getelem(cur, 0)
|
|
161
|
+
grow_list(c, i)
|
|
162
|
+
nvx = if S.ismap(val), do: S.jm([]), else: S.jt([])
|
|
163
|
+
S.setprop(c, i, nvx)
|
|
164
|
+
nvx
|
|
165
|
+
else
|
|
166
|
+
val
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
S.setprop(S.getelem(S.getelem(cur, 0), i - 1), key, nv)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
val
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
S.walk(vin, before: walkcopy)
|
|
176
|
+
S.getelem(S.getelem(cur, 0), 0)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
defp walk_depth_subject(vin) do
|
|
180
|
+
state = S.jm(["top", nil, "cur", nil])
|
|
181
|
+
|
|
182
|
+
copy = fn key, val, _parent, _path ->
|
|
183
|
+
if key == nil or S.isnode(val) do
|
|
184
|
+
child = if S.islist(val), do: S.jt([]), else: S.jm([])
|
|
185
|
+
|
|
186
|
+
if key == nil do
|
|
187
|
+
S.setprop(state, "top", child)
|
|
188
|
+
S.setprop(state, "cur", child)
|
|
189
|
+
else
|
|
190
|
+
S.setprop(S.getprop(state, "cur"), key, child)
|
|
191
|
+
S.setprop(state, "cur", child)
|
|
192
|
+
end
|
|
193
|
+
else
|
|
194
|
+
S.setprop(S.getprop(state, "cur"), key, val)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
val
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
S.walk(vget(vin, "src"), before: copy, maxdepth: vget(vin, "maxdepth"))
|
|
201
|
+
S.getprop(state, "top")
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
defp walk_log_subject(vin) do
|
|
205
|
+
logline = fn key, val, parent, path ->
|
|
206
|
+
"k=" <>
|
|
207
|
+
(if key == nil, do: S.stringify(), else: S.stringify(key)) <>
|
|
208
|
+
", v=" <>
|
|
209
|
+
S.stringify(val) <>
|
|
210
|
+
", p=" <>
|
|
211
|
+
(if parent == nil, do: S.stringify(), else: S.stringify(parent)) <>
|
|
212
|
+
", t=" <> S.pathify(path)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
collect = fn log ->
|
|
216
|
+
fn key, val, parent, path ->
|
|
217
|
+
S.setprop(log, S.size(log), logline.(key, val, parent, path))
|
|
218
|
+
val
|
|
219
|
+
end
|
|
13
220
|
end
|
|
14
221
|
|
|
15
|
-
|
|
16
|
-
|
|
222
|
+
after_log = S.jt([])
|
|
223
|
+
S.walk(S.clone(vin), after: collect.(after_log))
|
|
224
|
+
|
|
225
|
+
before_log = S.jt([])
|
|
226
|
+
S.walk(S.clone(vin), before: collect.(before_log))
|
|
227
|
+
|
|
228
|
+
both_log = S.jt([])
|
|
229
|
+
S.walk(S.clone(vin), before: collect.(both_log), after: collect.(both_log))
|
|
230
|
+
|
|
231
|
+
S.jm(["after", after_log, "before", before_log, "both", both_log])
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# --- the corpus ----------------------------------------------------------
|
|
235
|
+
|
|
236
|
+
test "the struct corpus runs through the vendored omni engine", %{run: run} do
|
|
237
|
+
O.reset_cases()
|
|
238
|
+
|
|
239
|
+
spec = run.spec
|
|
240
|
+
runset = run.runset
|
|
241
|
+
runsetflags = run.runsetflags
|
|
242
|
+
|
|
243
|
+
nonull = fn name, sub, subject ->
|
|
244
|
+
runsetflags.(group(spec, name, sub), %{null: false, name: "struct.#{name}.#{sub}"}, subject)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
withnull = fn name, sub, subject ->
|
|
248
|
+
runsetflags.(group(spec, name, sub), %{name: "struct.#{name}.#{sub}"}, subject)
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# --- minor ---
|
|
252
|
+
|
|
253
|
+
withnull.("minor", "isnode", arg1(fn v -> S.isnode(v) end))
|
|
254
|
+
withnull.("minor", "ismap", arg1(fn v -> S.ismap(v) end))
|
|
255
|
+
withnull.("minor", "islist", arg1(fn v -> S.islist(v) end))
|
|
256
|
+
nonull.("minor", "iskey", arg1(fn v -> S.iskey(v) end))
|
|
257
|
+
nonull.("minor", "strkey", arg1(fn v -> S.strkey(v) end))
|
|
258
|
+
nonull.("minor", "isempty", arg1(fn v -> S.isempty(v) end))
|
|
259
|
+
withnull.("minor", "isfunc", arg1(fn v -> S.isfunc(v) end))
|
|
260
|
+
nonull.("minor", "clone", arg1(fn v -> S.clone(v) end))
|
|
261
|
+
withnull.("minor", "escre", arg1(fn v -> S.escre(v) end))
|
|
262
|
+
withnull.("minor", "escurl", arg1(fn v -> S.escurl(v) end))
|
|
263
|
+
|
|
264
|
+
nonull.(
|
|
265
|
+
"minor",
|
|
266
|
+
"stringify",
|
|
267
|
+
arg1(fn vin ->
|
|
268
|
+
if vhas(vin, "val"),
|
|
269
|
+
do: S.stringify(vget(vin, "val"), vget(vin, "max")),
|
|
270
|
+
else: S.stringify()
|
|
271
|
+
end)
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
nonull.("minor", "jsonify", arg1(fn vin -> S.jsonify(vget(vin, "val"), vget(vin, "flags")) end))
|
|
275
|
+
|
|
276
|
+
nonull.(
|
|
277
|
+
"minor",
|
|
278
|
+
"getelem",
|
|
279
|
+
arg1(fn vin ->
|
|
280
|
+
alt = vget(vin, "alt")
|
|
281
|
+
|
|
282
|
+
if alt == nil,
|
|
283
|
+
do: S.getelem(vget(vin, "val"), vget(vin, "key")),
|
|
284
|
+
else: S.getelem(vget(vin, "val"), vget(vin, "key"), alt)
|
|
285
|
+
end)
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
withnull.("minor", "delprop", arg1(fn vin -> S.delprop(vget(vin, "parent"), vget(vin, "key")) end))
|
|
289
|
+
nonull.("minor", "size", arg1(fn v -> S.size(v) end))
|
|
290
|
+
|
|
291
|
+
nonull.(
|
|
292
|
+
"minor",
|
|
293
|
+
"slice",
|
|
294
|
+
arg1(fn vin -> S.slice(vget(vin, "val"), vget(vin, "start"), vget(vin, "end")) end)
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
nonull.(
|
|
298
|
+
"minor",
|
|
299
|
+
"pad",
|
|
300
|
+
arg1(fn vin -> S.pad(vget(vin, "val"), vget(vin, "pad"), vget(vin, "char")) end)
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
nonull.(
|
|
304
|
+
"minor",
|
|
305
|
+
"pathify",
|
|
306
|
+
arg1(fn vin ->
|
|
307
|
+
if vhas(vin, "path"),
|
|
308
|
+
do: S.pathify(vget(vin, "path"), vget(vin, "from")),
|
|
309
|
+
else: S.pathify(S.noarg(), vget(vin, "from"))
|
|
310
|
+
end)
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
withnull.("minor", "items", arg1(fn v -> S.items(v) end))
|
|
314
|
+
|
|
315
|
+
nonull.(
|
|
316
|
+
"minor",
|
|
317
|
+
"getprop",
|
|
318
|
+
arg1(fn vin ->
|
|
319
|
+
alt = vget(vin, "alt")
|
|
320
|
+
|
|
321
|
+
if alt == nil,
|
|
322
|
+
do: S.getprop(vget(vin, "val"), vget(vin, "key")),
|
|
323
|
+
else: S.getprop(vget(vin, "val"), vget(vin, "key"), alt)
|
|
324
|
+
end)
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
withnull.(
|
|
328
|
+
"minor",
|
|
329
|
+
"setprop",
|
|
330
|
+
arg1(fn vin -> S.setprop(vget(vin, "parent"), vget(vin, "key"), vget(vin, "val")) end)
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
nonull.("minor", "haskey", arg1(fn vin -> S.haskey(vget(vin, "src"), vget(vin, "key")) end))
|
|
334
|
+
withnull.("minor", "keysof", arg1(fn v -> S.keysof(v) |> S.jt() end))
|
|
335
|
+
|
|
336
|
+
nonull.(
|
|
337
|
+
"minor",
|
|
338
|
+
"join",
|
|
339
|
+
arg1(fn vin -> S.join(vget(vin, "val"), vget(vin, "sep"), vget(vin, "url")) end)
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
nonull.("minor", "typify", fn args ->
|
|
343
|
+
S.typify(if(args == [], do: S.noarg(), else: hd(args)))
|
|
344
|
+
end)
|
|
345
|
+
|
|
346
|
+
nonull.(
|
|
347
|
+
"minor",
|
|
348
|
+
"setpath",
|
|
349
|
+
arg1(fn vin -> S.setpath(vget(vin, "store"), vget(vin, "path"), vget(vin, "val")) end)
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
withnull.(
|
|
353
|
+
"minor",
|
|
354
|
+
"filter",
|
|
355
|
+
arg1(fn vin ->
|
|
356
|
+
check =
|
|
357
|
+
case vget(vin, "check") do
|
|
358
|
+
"gt3" -> fn {_k, x} -> is_number(x) and not is_boolean(x) and x > 3 end
|
|
359
|
+
"lt3" -> fn {_k, x} -> is_number(x) and not is_boolean(x) and x < 3 end
|
|
360
|
+
_ -> fn _ -> false end
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
S.filter(vget(vin, "val"), check)
|
|
364
|
+
end)
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
withnull.(
|
|
368
|
+
"minor",
|
|
369
|
+
"typename",
|
|
370
|
+
arg1(fn v -> S.typename(if(is_number(v) and not is_boolean(v), do: trunc(v), else: 0)) end)
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
withnull.(
|
|
374
|
+
"minor",
|
|
375
|
+
"flatten",
|
|
376
|
+
arg1(fn vin ->
|
|
377
|
+
d = vget(vin, "depth")
|
|
378
|
+
S.flatten(vget(vin, "val"), if(is_number(d), do: trunc(d), else: 1))
|
|
379
|
+
end)
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
# --- walk ---
|
|
383
|
+
|
|
384
|
+
runset.(single(spec, "walk", "log"), arg1(&walk_log_subject/1))
|
|
385
|
+
|
|
386
|
+
withnull.(
|
|
387
|
+
"walk",
|
|
388
|
+
"basic",
|
|
389
|
+
arg1(fn vin ->
|
|
390
|
+
S.walk(vin,
|
|
391
|
+
after: fn _k, v, _p, path -> if is_binary(v), do: v <> "~" <> joinpath(path), else: v end
|
|
392
|
+
)
|
|
393
|
+
end)
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
withnull.("walk", "copy", arg1(&walk_copy_subject/1))
|
|
397
|
+
nonull.("walk", "depth", arg1(&walk_depth_subject/1))
|
|
398
|
+
|
|
399
|
+
# --- merge ---
|
|
400
|
+
|
|
401
|
+
runset.(single(spec, "merge", "basic"), arg1(fn v -> S.merge(S.clone(v)) end))
|
|
402
|
+
withnull.("merge", "cases", arg1(fn v -> S.merge(v) end))
|
|
403
|
+
withnull.("merge", "array", arg1(fn v -> S.merge(v) end))
|
|
404
|
+
withnull.("merge", "integrity", arg1(fn v -> S.merge(v) end))
|
|
405
|
+
withnull.("merge", "depth", arg1(fn vin -> S.merge(vget(vin, "val"), vget(vin, "depth")) end))
|
|
406
|
+
|
|
407
|
+
# --- getpath ---
|
|
408
|
+
|
|
409
|
+
withnull.(
|
|
410
|
+
"getpath",
|
|
411
|
+
"basic",
|
|
412
|
+
arg1(fn vin -> S.getpath(vget(vin, "store"), vget(vin, "path")) end)
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
withnull.(
|
|
416
|
+
"getpath",
|
|
417
|
+
"relative",
|
|
418
|
+
arg1(fn vin ->
|
|
419
|
+
dp = vget(vin, "dpath")
|
|
420
|
+
dpath = if is_binary(dp), do: S.jt(String.split(dp, ".")), else: nil
|
|
421
|
+
injdef = S.jm(["dparent", vget(vin, "dparent"), "dpath", dpath])
|
|
422
|
+
S.getpath(vget(vin, "store"), vget(vin, "path"), injdef)
|
|
423
|
+
end)
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
withnull.(
|
|
427
|
+
"getpath",
|
|
428
|
+
"special",
|
|
429
|
+
arg1(fn vin -> S.getpath(vget(vin, "store"), vget(vin, "path"), vget(vin, "inj")) end)
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
withnull.(
|
|
433
|
+
"getpath",
|
|
434
|
+
"handler",
|
|
435
|
+
arg1(fn vin ->
|
|
436
|
+
store = S.jm(["$TOP", vget(vin, "store"), "$FOO", fn -> "foo" end])
|
|
437
|
+
handler = fn _inj, val, _ref, _st -> if S.isfunc(val), do: val.(), else: val end
|
|
438
|
+
S.getpath(store, vget(vin, "path"), S.jm(["handler", handler]))
|
|
439
|
+
end)
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
# --- inject ---
|
|
443
|
+
|
|
444
|
+
runset.(
|
|
445
|
+
single(spec, "inject", "basic"),
|
|
446
|
+
arg1(fn vin -> S.inject(S.clone(vget(vin, "val")), S.clone(vget(vin, "store"))) end)
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
withnull.(
|
|
450
|
+
"inject",
|
|
451
|
+
"string",
|
|
452
|
+
arg1(fn vin ->
|
|
453
|
+
S.inject(
|
|
454
|
+
vget(vin, "val"),
|
|
455
|
+
vget(vin, "store"),
|
|
456
|
+
S.jm(["modify", &O.null_modifier/4, "extra", vget(vin, "current")])
|
|
457
|
+
)
|
|
458
|
+
end)
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
withnull.("inject", "deep", arg1(fn vin -> S.inject(vget(vin, "val"), vget(vin, "store")) end))
|
|
462
|
+
|
|
463
|
+
# --- transform ---
|
|
464
|
+
|
|
465
|
+
runset.(
|
|
466
|
+
single(spec, "transform", "basic"),
|
|
467
|
+
arg1(fn vin -> S.transform(S.getprop(vin, "data"), S.getprop(vin, "spec")) end)
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
Enum.each(["paths", "cmds", "each", "pack", "ref", "apply"], fn sub ->
|
|
471
|
+
withnull.("transform", sub, arg1(fn vin -> S.transform(vget(vin, "data"), vget(vin, "spec")) end))
|
|
472
|
+
end)
|
|
473
|
+
|
|
474
|
+
withnull.(
|
|
475
|
+
"transform",
|
|
476
|
+
"modify",
|
|
477
|
+
arg1(fn vin ->
|
|
478
|
+
modifier = fn v, key, parent, _inj ->
|
|
479
|
+
if is_binary(v) and key != nil and parent != nil, do: S.setprop(parent, key, "@" <> v)
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
S.transform(
|
|
483
|
+
vget(vin, "data"),
|
|
484
|
+
vget(vin, "spec"),
|
|
485
|
+
S.jm(["modify", modifier, "extra", vget(vin, "store")])
|
|
486
|
+
)
|
|
487
|
+
end)
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
nonull.(
|
|
491
|
+
"transform",
|
|
492
|
+
"format",
|
|
493
|
+
arg1(fn vin -> S.transform(vget(vin, "data"), vget(vin, "spec")) end)
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
# --- validate ---
|
|
497
|
+
|
|
498
|
+
nonull.("validate", "basic", arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec")) end))
|
|
499
|
+
|
|
500
|
+
Enum.each(["child", "one", "exact"], fn sub ->
|
|
501
|
+
withnull.("validate", sub, arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec")) end))
|
|
502
|
+
end)
|
|
503
|
+
|
|
504
|
+
nonull.(
|
|
505
|
+
"validate",
|
|
506
|
+
"invalid",
|
|
507
|
+
arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec")) end)
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
withnull.(
|
|
511
|
+
"validate",
|
|
512
|
+
"special",
|
|
513
|
+
arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec"), vget(vin, "inj")) end)
|
|
514
|
+
)
|
|
515
|
+
|
|
516
|
+
# --- select ---
|
|
517
|
+
|
|
518
|
+
Enum.each(["basic", "operators", "edge", "alts"], fn sub ->
|
|
519
|
+
withnull.("select", sub, arg1(fn vin -> S.select(vget(vin, "obj"), vget(vin, "query")) end))
|
|
520
|
+
end)
|
|
521
|
+
|
|
522
|
+
# --- nullsem ---
|
|
523
|
+
#
|
|
524
|
+
# Does a PRESENT key holding a JSON null read as "no value"? Elixir CAN
|
|
525
|
+
# store one - `setprop` writes nil rather than deleting, and `keysof`
|
|
526
|
+
# reports the key - so unlike the ports that cannot express a stored null
|
|
527
|
+
# at all, this lane asserts something. All lanes are {null: false}: the
|
|
528
|
+
# whole question is what a real null does.
|
|
529
|
+
|
|
530
|
+
nonull.(
|
|
531
|
+
"nullsem",
|
|
532
|
+
"getprop",
|
|
533
|
+
arg1(fn vin ->
|
|
534
|
+
if vhas(vin, "alt"),
|
|
535
|
+
do: S.getprop(vget(vin, "val"), vget(vin, "key"), vget(vin, "alt")),
|
|
536
|
+
else: S.getprop(vget(vin, "val"), vget(vin, "key"))
|
|
537
|
+
end)
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
nonull.(
|
|
541
|
+
"nullsem",
|
|
542
|
+
"getelem",
|
|
543
|
+
arg1(fn vin ->
|
|
544
|
+
if vhas(vin, "alt"),
|
|
545
|
+
do: S.getelem(vget(vin, "val"), vget(vin, "key"), vget(vin, "alt")),
|
|
546
|
+
else: S.getelem(vget(vin, "val"), vget(vin, "key"))
|
|
547
|
+
end)
|
|
548
|
+
)
|
|
549
|
+
|
|
550
|
+
nonull.("nullsem", "getpath", arg1(fn vin -> S.getpath(vget(vin, "store"), vget(vin, "path")) end))
|
|
551
|
+
nonull.("nullsem", "haskey", arg1(fn vin -> S.haskey(vget(vin, "src"), vget(vin, "key")) end))
|
|
552
|
+
nonull.("nullsem", "keysof", arg1(fn v -> S.keysof(v) |> S.jt() end))
|
|
553
|
+
|
|
554
|
+
ran = O.cases()
|
|
555
|
+
IO.puts("\nSTRUCT CORPUS: CASES #{ran} (vendored omni)")
|
|
556
|
+
|
|
557
|
+
# A run that executes nothing is not a pass. The floor is the corpus as
|
|
558
|
+
# measured at the vendoring tag, less the four guarded drops above; it is
|
|
559
|
+
# deliberately a FLOOR, so the corpus can grow without editing this line,
|
|
560
|
+
# and a section that stopped running trips it.
|
|
561
|
+
assert ran >= 1208, "the struct corpus executed only #{ran} cases"
|
|
17
562
|
end
|
|
18
563
|
end
|