@voxgig/sdkgen 4.8.2 → 4.9.0
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/model/target/zig.aon +9 -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/src/cmp/zig/Package_zig.ts +15 -11
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -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 +208 -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 +150 -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 +442 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -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 +902 -0
- package/project/.sdk/tm/go/test/omni/util.go +381 -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 +628 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -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 +76 -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 +151 -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 +90 -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 +475 -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 +580 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -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/Makefile +15 -1
- package/project/.sdk/tm/zig/build.zig +23 -5
- package/project/.sdk/tm/zig/core/helpers.zig +52 -11
- package/project/.sdk/tm/zig/core/mem.zig +17 -1
- package/project/.sdk/tm/zig/core/utility.zig +23 -19
- package/project/.sdk/tm/zig/feature/audit.zig +2 -2
- package/project/.sdk/tm/zig/feature/cache.zig +2 -2
- package/project/.sdk/tm/zig/feature/debug.zig +5 -5
- package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
- package/project/.sdk/tm/zig/feature/paging.zig +2 -2
- package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
- package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
- package/project/.sdk/tm/zig/feature/support.zig +3 -3
- package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
- package/project/.sdk/tm/zig/feature/test.zig +10 -5
- package/project/.sdk/tm/zig/test/fh.zig +10 -10
- package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
- package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
- package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
- package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
- package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
- package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
- package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
- 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
- package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// VENDORED: @voxgig/omni 0.1.
|
|
2
|
-
// Source: https://github.com/voxgig/omni @
|
|
1
|
+
// VENDORED: @voxgig/omni 0.1.4 (typescript/src/index.ts)
|
|
2
|
+
// Source: https://github.com/voxgig/omni @ 274708cc2d12b21707d975543953f845f8444be0 [tag: sdk-20260907-0029-0]
|
|
3
3
|
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
4
|
// @voxgig/omni - shared multi-language test runner.
|
|
5
5
|
|
|
@@ -9,6 +9,16 @@ build:
|
|
|
9
9
|
# filter the output: if "N/N tests passed" with N==total, treat as success.
|
|
10
10
|
# `--summary all` is required so the count is printed.
|
|
11
11
|
#
|
|
12
|
+
# THE SUMMARY IS PARSED IN TWO SPELLINGS. Older toolchains wrote the test
|
|
13
|
+
# tally as "217/223 tests passed; 6 skipped"; 0.16 writes the annotations as
|
|
14
|
+
# a parenthesised list instead - "217/223 tests passed (6 skipped)", and
|
|
15
|
+
# "(6 skipped, 1 crashed)" when something did go wrong. Reading only the
|
|
16
|
+
# semicolon form off 0.16 finds no skip count at all, so "passed + skipped"
|
|
17
|
+
# falls short of "total" and the tolerance refuses a run that was in fact
|
|
18
|
+
# clean - failing precisely when the teardown crash it exists for happens.
|
|
19
|
+
# Both spellings are accepted below, and any "failed"/"crashed"/"timed out"
|
|
20
|
+
# in that same annotation is a real failure, never a teardown crash.
|
|
21
|
+
#
|
|
12
22
|
# A TEST THAT DID NOT COMPILE IS NOT IN THE TALLY. The tolerance above is for a
|
|
13
23
|
# crash AFTER the tests ran, and it must never cover a build that failed: a
|
|
14
24
|
# compile error means those test binaries never ran, so they never reach
|
|
@@ -32,11 +42,15 @@ test:
|
|
|
32
42
|
echo "zig: compilation errors — not a teardown crash"; \
|
|
33
43
|
exit 1; \
|
|
34
44
|
fi; \
|
|
35
|
-
summary=$$(echo "$$out" | grep -oE '[0-9]+/[0-9]+ tests passed(; [0-9]+ skipped)?' | tail -1); \
|
|
45
|
+
summary=$$(echo "$$out" | grep -oE '[0-9]+/[0-9]+ tests passed( \([^)]*\))?(; [0-9]+ skipped)?' | tail -1); \
|
|
36
46
|
passed=$$(echo "$$summary" | sed -E 's#([0-9]+)/([0-9]+).*#\1#'); \
|
|
37
47
|
total=$$(echo "$$summary" | sed -E 's#([0-9]+)/([0-9]+).*#\2#'); \
|
|
38
48
|
skipped=$$(echo "$$summary" | grep -oE '[0-9]+ skipped' | grep -oE '[0-9]+'); \
|
|
39
49
|
[ -n "$$skipped" ] || skipped=0; \
|
|
50
|
+
if echo "$$summary" | grep -qE '[0-9]+ (failed|crashed|timed out)'; then \
|
|
51
|
+
echo "zig: $$summary — tests failed, so this is not a teardown crash"; \
|
|
52
|
+
exit 1; \
|
|
53
|
+
fi; \
|
|
40
54
|
if [ -n "$$passed" ] && [ "$$total" -gt 0 ] && [ $$((passed + skipped)) -eq "$$total" ]; then \
|
|
41
55
|
exit 0; \
|
|
42
56
|
fi; \
|
|
@@ -8,6 +8,10 @@ const std = @import("std");
|
|
|
8
8
|
// exposed as the "voxgig-struct" module so the corpus runner can import it,
|
|
9
9
|
// and the whole SDK is exposed as the "sdk" module (root: root.zig).
|
|
10
10
|
//
|
|
11
|
+
// TOOLCHAIN: zig 0.16. A test artifact takes a `root_module` rather than a
|
|
12
|
+
// `root_source_file`, so each test file gets its own module built here with
|
|
13
|
+
// the struct and sdk modules already imported.
|
|
14
|
+
//
|
|
11
15
|
// The Zig test framework can crash with signal 11 during cleanup *after* all
|
|
12
16
|
// tests pass, due to *MapRef/*ListRef cross-references in arena teardown. The
|
|
13
17
|
// Makefile filters the output: "N/N tests passed" with N==total is success.
|
|
@@ -22,6 +26,17 @@ pub fn build(b: *std.Build) void {
|
|
|
22
26
|
.optimize = optimize,
|
|
23
27
|
});
|
|
24
28
|
|
|
29
|
+
// The vendored @voxgig/omni port: the corpus test ENGINE, driven by
|
|
30
|
+
// test/omniresolver.zig. A MODULE, not a path import, for two reasons:
|
|
31
|
+
// omni.zig reaches its own regex.zig by path, so the pair must belong to
|
|
32
|
+
// exactly one module; and `@import("omni")` cannot then be confused with
|
|
33
|
+
// the resolver that adapts it.
|
|
34
|
+
const omni_mod = b.addModule("omni", .{
|
|
35
|
+
.root_source_file = b.path("test/vendor/omni/omni.zig"),
|
|
36
|
+
.target = target,
|
|
37
|
+
.optimize = optimize,
|
|
38
|
+
});
|
|
39
|
+
|
|
25
40
|
// The SDK module (root re-exports the public surface).
|
|
26
41
|
const sdk_mod = b.addModule("sdk", .{
|
|
27
42
|
.root_source_file = b.path("root.zig"),
|
|
@@ -32,7 +47,7 @@ pub fn build(b: *std.Build) void {
|
|
|
32
47
|
|
|
33
48
|
const test_step = b.step("test", "Run all tests");
|
|
34
49
|
|
|
35
|
-
// Every test file: gets
|
|
50
|
+
// Every test file: gets the struct, sdk and omni modules.
|
|
36
51
|
const test_files = [_][]const u8{
|
|
37
52
|
"test/struct_corpus.zig",
|
|
38
53
|
"test/generated_test.zig",
|
|
@@ -40,17 +55,20 @@ pub fn build(b: *std.Build) void {
|
|
|
40
55
|
"test/feature_test.zig",
|
|
41
56
|
"test/primary_utility_test.zig",
|
|
42
57
|
"test/gotcha_test.zig",
|
|
58
|
+
"test/omnismoke_test.zig",
|
|
43
59
|
};
|
|
44
60
|
|
|
45
61
|
for (test_files) |tf| {
|
|
46
|
-
|
|
47
|
-
const t = b.addTest(.{
|
|
62
|
+
const test_mod = b.createModule(.{
|
|
48
63
|
.root_source_file = b.path(tf),
|
|
49
64
|
.target = target,
|
|
50
65
|
.optimize = optimize,
|
|
51
66
|
});
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
test_mod.addImport("voxgig-struct", struct_mod);
|
|
68
|
+
test_mod.addImport("sdk", sdk_mod);
|
|
69
|
+
test_mod.addImport("omni", omni_mod);
|
|
70
|
+
|
|
71
|
+
const t = b.addTest(.{ .root_module = test_mod });
|
|
54
72
|
const run_t = b.addRunArtifact(t);
|
|
55
73
|
run_t.has_side_effects = true;
|
|
56
74
|
test_step.dependOn(&run_t.step);
|
|
@@ -19,6 +19,12 @@ pub fn A() Allocator {
|
|
|
19
19
|
return mem.a();
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// The SDK's process-global Io (0.16 routes clocks/sleep/env/file IO through
|
|
23
|
+
// one). See core/mem.zig for why it is global rather than a parameter.
|
|
24
|
+
pub fn IO() std.Io {
|
|
25
|
+
return mem.io();
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
// ---- constructors ------------------------------------------------------
|
|
23
29
|
|
|
24
30
|
pub fn vstr(s: []const u8) Value {
|
|
@@ -249,33 +255,33 @@ pub fn veq(x: Value, y: Value) bool {
|
|
|
249
255
|
// ---- key / item vectors (test feature convenience) ---------------------
|
|
250
256
|
|
|
251
257
|
pub fn keysof_vec(v: Value) [][]const u8 {
|
|
252
|
-
var out
|
|
258
|
+
var out: std.ArrayList([]const u8) = .empty;
|
|
253
259
|
if (v == .object) {
|
|
254
260
|
var it = v.object.iterator();
|
|
255
|
-
while (it.next()) |kv| out.append(kv.key_ptr.*) catch {};
|
|
261
|
+
while (it.next()) |kv| out.append(A(), kv.key_ptr.*) catch {};
|
|
256
262
|
}
|
|
257
|
-
return out.toOwnedSlice() catch &.{};
|
|
263
|
+
return out.toOwnedSlice(A()) catch &.{};
|
|
258
264
|
}
|
|
259
265
|
|
|
260
266
|
pub const KVpair = struct { k: []const u8, v: Value };
|
|
261
267
|
|
|
262
268
|
pub fn items_vec(v: Value) []KVpair {
|
|
263
|
-
var out
|
|
269
|
+
var out: std.ArrayList(KVpair) = .empty;
|
|
264
270
|
if (v == .object) {
|
|
265
271
|
var it = v.object.iterator();
|
|
266
|
-
while (it.next()) |kv| out.append(.{ .k = kv.key_ptr.*, .v = kv.value_ptr.* }) catch {};
|
|
272
|
+
while (it.next()) |kv| out.append(A(), .{ .k = kv.key_ptr.*, .v = kv.value_ptr.* }) catch {};
|
|
267
273
|
}
|
|
268
|
-
return out.toOwnedSlice() catch &.{};
|
|
274
|
+
return out.toOwnedSlice(A()) catch &.{};
|
|
269
275
|
}
|
|
270
276
|
|
|
271
277
|
// ---- clocks / rng ------------------------------------------------------
|
|
272
278
|
|
|
273
279
|
pub fn now_ms() i64 {
|
|
274
|
-
return std.
|
|
280
|
+
return std.Io.Clock.real.now(IO()).toMilliseconds();
|
|
275
281
|
}
|
|
276
282
|
|
|
277
283
|
pub fn sleep_ms(ms: i64) void {
|
|
278
|
-
if (ms > 0)
|
|
284
|
+
if (ms > 0) IO().sleep(.fromMilliseconds(ms), .awake) catch {};
|
|
279
285
|
}
|
|
280
286
|
|
|
281
287
|
var rand_seed: i64 = 123456789;
|
|
@@ -290,15 +296,50 @@ pub fn rand_int(n: i64) i64 {
|
|
|
290
296
|
|
|
291
297
|
pub const CallFn = *const fn (ctx: *anyopaque, allocator: Allocator, arg: Value) anyerror!Value;
|
|
292
298
|
|
|
299
|
+
// An SDK callable — an injected transport, clock, sleeper, id generator, a
|
|
300
|
+
// custom utility, or a response body thunk — carries a captured context
|
|
301
|
+
// pointer, because every one of them is created at run time over run-time
|
|
302
|
+
// state. Zig has no closures, so the context travels beside the function.
|
|
303
|
+
//
|
|
304
|
+
// The struct port's `JsonFunc` is a bare `*const fn (Allocator) anyerror!Value`
|
|
305
|
+
// with no context slot, so the BOX is what lives in the `.function` slot,
|
|
306
|
+
// pointer-cast to fit. That is the same arrangement the SDK has always had:
|
|
307
|
+
// the slot held `*const Callable` before too, and the type it is declared with
|
|
308
|
+
// upstream is the only thing that changed. Every struct operation the SDK puts
|
|
309
|
+
// callables through — clone, merge, validate, stringify, typify — treats the
|
|
310
|
+
// slot as an opaque pointer and is unaffected.
|
|
311
|
+
//
|
|
312
|
+
// The one thing that must not happen is struct CALLING the slot as code. It
|
|
313
|
+
// does that in exactly three places: a `getprop` whose `alt` is a function, a
|
|
314
|
+
// single-segment `getpath` whose one part names a function held directly in
|
|
315
|
+
// the store, and a `$`-prefixed validate command that is not built in and
|
|
316
|
+
// resolves to a function in the store. The SDK reaches none of them — its
|
|
317
|
+
// `getprop` alts are never functions, `h.getpath` is never called with a
|
|
318
|
+
// one-segment path, and the validate store only ever holds `$TOP`/`$DTOP`-style
|
|
319
|
+
// keys, all of which are built in. SDK code invokes its own callables through
|
|
320
|
+
// `call_vfn`, never by letting struct resolve them.
|
|
321
|
+
//
|
|
322
|
+
// That was measured, not just reasoned: instrumenting all three sites in a
|
|
323
|
+
// throwaway copy of the vendored file and running the whole suite records ONE
|
|
324
|
+
// invocation, and it is the struct corpus's own `$FOO` handler — a real
|
|
325
|
+
// context-free JsonFunc, which is what those sites are for.
|
|
326
|
+
pub const Callable = struct {
|
|
327
|
+
ctx: *anyopaque,
|
|
328
|
+
call: CallFn,
|
|
329
|
+
};
|
|
330
|
+
|
|
293
331
|
pub fn callable(ctx_ptr: *anyopaque, f: CallFn) Value {
|
|
294
|
-
const c = A().create(
|
|
332
|
+
const c = A().create(Callable) catch unreachable;
|
|
295
333
|
c.* = .{ .ctx = ctx_ptr, .call = f };
|
|
296
|
-
return .{ .function = c };
|
|
334
|
+
return .{ .function = @ptrCast(@alignCast(c)) };
|
|
297
335
|
}
|
|
298
336
|
|
|
299
337
|
pub fn call_vfn(f: Value, arg: Value) Value {
|
|
300
338
|
return switch (f) {
|
|
301
|
-
.function => |
|
|
339
|
+
.function => |fp| blk: {
|
|
340
|
+
const c: *const Callable = @ptrCast(@alignCast(fp));
|
|
341
|
+
break :blk c.call(c.ctx, A(), arg) catch vnull();
|
|
342
|
+
},
|
|
302
343
|
else => vnull(),
|
|
303
344
|
};
|
|
304
345
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Process-global arena allocator for the SDK data model.
|
|
1
|
+
// Process-global arena allocator and Io for the SDK data model.
|
|
2
2
|
//
|
|
3
3
|
// The SDK data model is the vendored voxgig struct Value (reference-stable
|
|
4
4
|
// *MapRef / *ListRef nodes). Rust leans on a global allocator + Rc; Zig has
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
// close to the Rust original and sidesteps the test allocator's leak checks
|
|
8
8
|
// for SDK/struct data (tests still use testing.allocator for their own
|
|
9
9
|
// bookkeeping). Mirrors struct/zig's per-run arena approach.
|
|
10
|
+
//
|
|
11
|
+
// Zig 0.16 routes clocks, sleeping, the environment and file IO through an
|
|
12
|
+
// `std.Io` instance rather than free functions on `std.time` / `std.process` /
|
|
13
|
+
// `std.fs`. An SDK cannot demand one from its caller without changing every
|
|
14
|
+
// public signature, so — exactly as with the arena — one process-global
|
|
15
|
+
// instance is used. `Io.Threaded.global_single_threaded` is the statically
|
|
16
|
+
// initialised singleton std itself falls back to; it needs no allocator and no
|
|
17
|
+
// deinit, and the startup code fills in its environment block.
|
|
10
18
|
|
|
11
19
|
const std = @import("std");
|
|
12
20
|
|
|
@@ -18,3 +26,11 @@ pub fn a() std.mem.Allocator {
|
|
|
18
26
|
}
|
|
19
27
|
return arena.?.allocator();
|
|
20
28
|
}
|
|
29
|
+
|
|
30
|
+
pub fn threaded() *std.Io.Threaded {
|
|
31
|
+
return std.Io.Threaded.global_single_threaded;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
pub fn io() std.Io {
|
|
35
|
+
return threaded().io();
|
|
36
|
+
}
|
|
@@ -252,11 +252,11 @@ pub fn feature_add_util(ctx: *Context, f: Feature) void {
|
|
|
252
252
|
while (i < feats.items.len) : (i += 1) {
|
|
253
253
|
const nm = feats.items[i].name();
|
|
254
254
|
if (before.len != 0 and std.mem.eql(u8, before, nm)) {
|
|
255
|
-
feats.insert(i, f) catch {};
|
|
255
|
+
feats.insert(h.A(), i, f) catch {};
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
if (after.len != 0 and std.mem.eql(u8, after, nm)) {
|
|
259
|
-
feats.insert(i + 1, f) catch {};
|
|
259
|
+
feats.insert(h.A(), i + 1, f) catch {};
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
if (replace.len != 0 and std.mem.eql(u8, replace, nm)) {
|
|
@@ -266,14 +266,14 @@ pub fn feature_add_util(ctx: *Context, f: Feature) void {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
client.features.append(f) catch {};
|
|
269
|
+
client.features.append(h.A(), f) catch {};
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
pub fn feature_hook_util(ctx: *Context, name: []const u8) void {
|
|
273
273
|
const client = ctx.client orelse return;
|
|
274
274
|
// Snapshot so a hook that mutates the feature set is safe to iterate.
|
|
275
|
-
var snap
|
|
276
|
-
for (client.features.items) |f| snap.append(f) catch {};
|
|
275
|
+
var snap: std.ArrayList(Feature) = .empty;
|
|
276
|
+
for (client.features.items) |f| snap.append(h.A(), f) catch {};
|
|
277
277
|
for (snap.items) |f| f.dispatch(name, ctx);
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -441,11 +441,11 @@ pub fn make_options_util(ctx: *Context) Value {
|
|
|
441
441
|
else => "SDK",
|
|
442
442
|
};
|
|
443
443
|
|
|
444
|
-
var out
|
|
444
|
+
var out: std.ArrayList(u8) = .empty;
|
|
445
445
|
var i: usize = 0;
|
|
446
446
|
while (i < base.len) {
|
|
447
447
|
if ('{' != base[i]) {
|
|
448
|
-
out.append(base[i]) catch {};
|
|
448
|
+
out.append(h.A(), base[i]) catch {};
|
|
449
449
|
i += 1;
|
|
450
450
|
continue;
|
|
451
451
|
}
|
|
@@ -454,7 +454,7 @@ pub fn make_options_util(ctx: *Context) Value {
|
|
|
454
454
|
j += 1;
|
|
455
455
|
}
|
|
456
456
|
if (j >= base.len or '}' != base[j] or j == i + 1) {
|
|
457
|
-
out.append(base[i]) catch {};
|
|
457
|
+
out.append(h.A(), base[i]) catch {};
|
|
458
458
|
i += 1;
|
|
459
459
|
continue;
|
|
460
460
|
}
|
|
@@ -465,8 +465,8 @@ pub fn make_options_util(ctx: *Context) Value {
|
|
|
465
465
|
};
|
|
466
466
|
if (0 == val.len) {
|
|
467
467
|
if (testmode) {
|
|
468
|
-
out.appendSlice("test-") catch {};
|
|
469
|
-
out.appendSlice(name) catch {};
|
|
468
|
+
out.appendSlice(h.A(), "test-") catch {};
|
|
469
|
+
out.appendSlice(h.A(), name) catch {};
|
|
470
470
|
} else {
|
|
471
471
|
std.debug.panic(
|
|
472
472
|
"{s}: the server variable '{s}' is required: the API " ++
|
|
@@ -476,11 +476,11 @@ pub fn make_options_util(ctx: *Context) Value {
|
|
|
476
476
|
);
|
|
477
477
|
}
|
|
478
478
|
} else {
|
|
479
|
-
out.appendSlice(val) catch {};
|
|
479
|
+
out.appendSlice(h.A(), val) catch {};
|
|
480
480
|
}
|
|
481
481
|
i = j + 1;
|
|
482
482
|
}
|
|
483
|
-
h.setp(opts, "base", h.vstr(out.toOwnedSlice() catch base));
|
|
483
|
+
h.setp(opts, "base", h.vstr(out.toOwnedSlice(h.A()) catch base));
|
|
484
484
|
}
|
|
485
485
|
},
|
|
486
486
|
else => {},
|
|
@@ -502,11 +502,11 @@ pub fn make_options_util(ctx: *Context) Value {
|
|
|
502
502
|
else => "key,token,id",
|
|
503
503
|
};
|
|
504
504
|
|
|
505
|
-
var parts
|
|
505
|
+
var parts: std.ArrayList([]const u8) = .empty;
|
|
506
506
|
var it = std.mem.splitScalar(u8, clean_keys, ',');
|
|
507
507
|
while (it.next()) |p| {
|
|
508
508
|
const t = std.mem.trim(u8, p, " \t");
|
|
509
|
-
if (t.len != 0) parts.append(h.esc_re(t)) catch {};
|
|
509
|
+
if (t.len != 0) parts.append(h.A(), h.esc_re(t)) catch {};
|
|
510
510
|
}
|
|
511
511
|
const keyre = std.mem.join(h.A(), "|", parts.items) catch "";
|
|
512
512
|
|
|
@@ -516,9 +516,9 @@ pub fn make_options_util(ctx: *Context) Value {
|
|
|
516
516
|
if (feature_order.array.data.items.len == 0) {
|
|
517
517
|
const fmapv = h.getp(opts, "feature");
|
|
518
518
|
if (fmapv == .object) {
|
|
519
|
-
var names
|
|
519
|
+
var names: std.ArrayList([]const u8) = .empty;
|
|
520
520
|
var nit = fmapv.object.iterator();
|
|
521
|
-
while (nit.next()) |kv| names.append(kv.key_ptr.*) catch {};
|
|
521
|
+
while (nit.next()) |kv| names.append(h.A(), kv.key_ptr.*) catch {};
|
|
522
522
|
std.mem.sort([]const u8, names.items, {}, mo_str_less);
|
|
523
523
|
var has_test = false;
|
|
524
524
|
for (names.items) |nm| {
|
|
@@ -1059,7 +1059,7 @@ pub fn prepare_headers_util(ctx: *Context) Value {
|
|
|
1059
1059
|
if (h.is_noval(headers)) return h.omap();
|
|
1060
1060
|
|
|
1061
1061
|
return switch (h.clone(headers)) {
|
|
1062
|
-
.object =>
|
|
1062
|
+
.object => h.clone(headers),
|
|
1063
1063
|
else => h.omap(),
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
@@ -1420,7 +1420,10 @@ pub fn transform_request_util(ctx: *Context) Value {
|
|
|
1420
1420
|
if (h.is_noval(reqform)) return ctx.reqdata;
|
|
1421
1421
|
|
|
1422
1422
|
const store = h.jo(&.{.{ "reqdata", ctx.reqdata }});
|
|
1423
|
-
|
|
1423
|
+
// transform now reports collected injection errors beside the value; .out
|
|
1424
|
+
// is what it used to return on its own, errors or not.
|
|
1425
|
+
const tres = vs.transform(h.A(), store, reqform) catch return ctx.reqdata;
|
|
1426
|
+
return tres.out;
|
|
1424
1427
|
}
|
|
1425
1428
|
|
|
1426
1429
|
pub fn transform_response_util(ctx: *Context) Value {
|
|
@@ -1449,7 +1452,8 @@ pub fn transform_response_util(ctx: *Context) Value {
|
|
|
1449
1452
|
.{ "resmatch", res.resmatch },
|
|
1450
1453
|
});
|
|
1451
1454
|
|
|
1452
|
-
const
|
|
1455
|
+
const tres = vs.transform(h.A(), store, resform) catch return h.vnull();
|
|
1456
|
+
const resdata = tres.out;
|
|
1453
1457
|
res.resdata = resdata;
|
|
1454
1458
|
return resdata;
|
|
1455
1459
|
}
|
|
@@ -32,7 +32,7 @@ pub const AuditFeature = struct {
|
|
|
32
32
|
|
|
33
33
|
pub fn make() Feature {
|
|
34
34
|
const self = h.A().create(AuditFeature) catch unreachable;
|
|
35
|
-
self.* = .{ .records =
|
|
35
|
+
self.* = .{ .records = .empty };
|
|
36
36
|
return .{ .ptr = @ptrCast(self), .vtable = &vtable };
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -73,7 +73,7 @@ pub const AuditFeature = struct {
|
|
|
73
73
|
h.setp(record, "correlationId", h.vstr(ctx.id));
|
|
74
74
|
if (ctx.result) |r| h.setp(record, "status", h.vnum(r.status));
|
|
75
75
|
|
|
76
|
-
self.records.append(record) catch {};
|
|
76
|
+
self.records.append(h.A(), record) catch {};
|
|
77
77
|
const max: usize = @intCast(@max(sup.fopt_int(self.options, "max", 1000), 0));
|
|
78
78
|
while (self.records.items.len > max) {
|
|
79
79
|
_ = self.records.orderedRemove(0);
|
|
@@ -53,7 +53,7 @@ pub const CacheFeature = struct {
|
|
|
53
53
|
const track = h.A().create(CacheTrack) catch unreachable;
|
|
54
54
|
track.* = .{
|
|
55
55
|
.store = std.StringHashMap(CacheEntry).init(h.A()),
|
|
56
|
-
.order =
|
|
56
|
+
.order = .empty,
|
|
57
57
|
};
|
|
58
58
|
self.* = .{ .track = track };
|
|
59
59
|
return .{ .ptr = @ptrCast(self), .vtable = &vtable };
|
|
@@ -152,7 +152,7 @@ fn through(track: *CacheTrack, options: Value, ctx: *Context, url: []const u8, f
|
|
|
152
152
|
const ttl = sup.fopt_int(options, "ttl", 5000);
|
|
153
153
|
evict(track, options);
|
|
154
154
|
track.store.put(key, .{ .expiry = now + ttl, .snapshot = snap }) catch {};
|
|
155
|
-
track.order.append(key) catch {};
|
|
155
|
+
track.order.append(h.A(), key) catch {};
|
|
156
156
|
track.miss += 1;
|
|
157
157
|
return replay(snap);
|
|
158
158
|
}
|
|
@@ -38,7 +38,7 @@ pub const DebugFeature = struct {
|
|
|
38
38
|
|
|
39
39
|
pub fn make() Feature {
|
|
40
40
|
const self = h.A().create(DebugFeature) catch unreachable;
|
|
41
|
-
self.* = .{ .entries =
|
|
41
|
+
self.* = .{ .entries = .empty };
|
|
42
42
|
return .{ .ptr = @ptrCast(self), .vtable = &vtable };
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -49,9 +49,9 @@ pub const DebugFeature = struct {
|
|
|
49
49
|
fn redact(self: *DebugFeature, headers: Value) Value {
|
|
50
50
|
const out = h.omap();
|
|
51
51
|
const patterns: [][]const u8 = sup.fopt_str_list(self.options, "redact") orelse blk: {
|
|
52
|
-
var l
|
|
53
|
-
for (DEBUG_DEFAULT_REDACT) |p| l.append(p) catch {};
|
|
54
|
-
break :blk l.toOwnedSlice() catch &.{};
|
|
52
|
+
var l: std.ArrayList([]const u8) = .empty;
|
|
53
|
+
for (DEBUG_DEFAULT_REDACT) |p| l.append(h.A(), p) catch {};
|
|
54
|
+
break :blk l.toOwnedSlice(h.A()) catch &.{};
|
|
55
55
|
};
|
|
56
56
|
if (headers == .object) {
|
|
57
57
|
var it = headers.object.iterator();
|
|
@@ -92,7 +92,7 @@ pub const DebugFeature = struct {
|
|
|
92
92
|
if (ctx.result) |r| h.setp(entry, "status", h.vnum(r.status));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
self.entries.append(entry) catch {};
|
|
95
|
+
self.entries.append(h.A(), entry) catch {};
|
|
96
96
|
const max: usize = @intCast(@max(sup.fopt_int(self.options, "max", 100), 0));
|
|
97
97
|
while (self.entries.items.len > max) {
|
|
98
98
|
_ = self.entries.orderedRemove(0);
|
|
@@ -33,7 +33,7 @@ pub const NetsimFeature = struct {
|
|
|
33
33
|
pub fn make() Feature {
|
|
34
34
|
const self = h.A().create(NetsimFeature) catch unreachable;
|
|
35
35
|
const track = h.A().create(NetsimTrack) catch unreachable;
|
|
36
|
-
track.* = .{ .applied =
|
|
36
|
+
track.* = .{ .applied = .empty };
|
|
37
37
|
self.* = .{ .track = track };
|
|
38
38
|
return .{ .ptr = @ptrCast(self), .vtable = &vtable };
|
|
39
39
|
}
|
|
@@ -110,7 +110,7 @@ fn pick_latency(track: *NetsimTrack, options: Value) i64 {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
fn track_applied(track: *NetsimTrack, ctx: *Context, applied: Value) void {
|
|
113
|
-
track.applied.append(applied) catch {};
|
|
113
|
+
track.applied.append(h.A(), applied) catch {};
|
|
114
114
|
const calls = track.calls;
|
|
115
115
|
const applied_list = h.olist();
|
|
116
116
|
for (track.applied.items) |a| applied_list.array.append(a) catch {};
|
|
@@ -284,8 +284,8 @@ pub const PagingFeature = struct {
|
|
|
284
284
|
// would send the caller back for a page that does not exist, forever.
|
|
285
285
|
if (!explicit_more and (h.get_bool(paging, "hasMore") orelse false) != true and
|
|
286
286
|
(!h.is_noval(h.getp(paging, "next")) or
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
!h.is_noval(h.getp(paging, "cursor")) or
|
|
288
|
+
!h.is_noval(h.getp(paging, "nextPage"))))
|
|
289
289
|
{
|
|
290
290
|
h.setp(paging, "hasMore", h.vbool(true));
|
|
291
291
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
const std = @import("std");
|
|
11
11
|
const h = @import("../core/helpers.zig");
|
|
12
|
+
const mem = @import("../core/mem.zig");
|
|
12
13
|
const err = @import("../core/error.zig");
|
|
13
14
|
const types = @import("../core/types.zig");
|
|
14
15
|
const sup = @import("support.zig");
|
|
@@ -65,22 +66,22 @@ pub const ProxyFeature = struct {
|
|
|
65
66
|
if (no_proxy_opt == null) {
|
|
66
67
|
const np = first_env(&.{ "NO_PROXY", "no_proxy" });
|
|
67
68
|
if (np.len != 0) {
|
|
68
|
-
var list
|
|
69
|
+
var list: std.ArrayList([]const u8) = .empty;
|
|
69
70
|
var it = std.mem.splitScalar(u8, np, ',');
|
|
70
|
-
while (it.next()) |s| list.append(s) catch {};
|
|
71
|
-
no_proxy_opt = list.toOwnedSlice() catch null;
|
|
71
|
+
while (it.next()) |s| list.append(h.A(), s) catch {};
|
|
72
|
+
no_proxy_opt = list.toOwnedSlice(h.A()) catch null;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
var np_list
|
|
77
|
+
var np_list: std.ArrayList([]const u8) = .empty;
|
|
77
78
|
if (no_proxy_opt) |arr| {
|
|
78
79
|
for (arr) |s| {
|
|
79
80
|
const trimmed = std.mem.trim(u8, s, " \t\r\n");
|
|
80
|
-
if (trimmed.len != 0) np_list.append(trimmed) catch {};
|
|
81
|
+
if (trimmed.len != 0) np_list.append(h.A(), trimmed) catch {};
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
const no_proxy: []const []const u8 = np_list.toOwnedSlice() catch &.{};
|
|
84
|
+
const no_proxy: []const []const u8 = np_list.toOwnedSlice(h.A()) catch &.{};
|
|
84
85
|
|
|
85
86
|
self.track.url = url;
|
|
86
87
|
self.track.no_proxy = no_proxy;
|
|
@@ -120,9 +121,15 @@ fn wrapCall(p: *anyopaque, ctx: *Context, url: []const u8, fetchdef: Value) err.
|
|
|
120
121
|
return w.inner.invoke(ctx, url, routed);
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
// Zig 0.16 has no free-standing environment lookup: the block the process was
|
|
125
|
+
// started with is owned by an Io implementation, and library code is expected
|
|
126
|
+
// to be handed one. The SDK's Io is the process-global singleton (core/mem.zig),
|
|
127
|
+
// and the startup code fills its environment block in, so that is where a
|
|
128
|
+
// `fromEnv` proxy config reads HTTP(S)_PROXY / NO_PROXY from.
|
|
123
129
|
fn first_env(names: []const []const u8) []const u8 {
|
|
130
|
+
const environ = mem.threaded().environ.process_environ;
|
|
124
131
|
for (names) |name| {
|
|
125
|
-
if (
|
|
132
|
+
if (environ.getAlloc(h.A(), name)) |v| {
|
|
126
133
|
if (v.len != 0) return v;
|
|
127
134
|
} else |_| {}
|
|
128
135
|
}
|
|
@@ -150,7 +157,7 @@ fn bypass(no_proxy: []const []const u8, url: []const u8) bool {
|
|
|
150
157
|
const host = host_of(url);
|
|
151
158
|
for (no_proxy) |np| {
|
|
152
159
|
if (std.mem.eql(u8, np, "*")) return true;
|
|
153
|
-
const np_trim = std.mem.
|
|
160
|
+
const np_trim = std.mem.trimStart(u8, np, ".");
|
|
154
161
|
if (std.mem.eql(u8, host, np)) return true;
|
|
155
162
|
const suffix = std.fmt.allocPrint(h.A(), ".{s}", .{np_trim}) catch continue;
|
|
156
163
|
if (std.mem.endsWith(u8, host, suffix)) return true;
|
|
@@ -105,7 +105,7 @@ fn iterate(options: Value, resdata: Value) []Value {
|
|
|
105
105
|
|
|
106
106
|
const items: []const Value = if (resdata == .array) resdata.array.data.items else &[_]Value{};
|
|
107
107
|
|
|
108
|
-
var out
|
|
108
|
+
var out: std.ArrayList(Value) = .empty;
|
|
109
109
|
|
|
110
110
|
if (chunk_size > 0) {
|
|
111
111
|
const cs: usize = @intCast(chunk_size);
|
|
@@ -113,15 +113,15 @@ fn iterate(options: Value, resdata: Value) []Value {
|
|
|
113
113
|
while (i < items.len) {
|
|
114
114
|
if (chunk_delay > 0) sup.fopt_sleep(options, chunk_delay);
|
|
115
115
|
const end = @min(i + cs, items.len);
|
|
116
|
-
out.append(h.ja(items[i..end])) catch {};
|
|
116
|
+
out.append(h.A(), h.ja(items[i..end])) catch {};
|
|
117
117
|
i = end;
|
|
118
118
|
}
|
|
119
|
-
return out.toOwnedSlice() catch &.{};
|
|
119
|
+
return out.toOwnedSlice(h.A()) catch &.{};
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
for (items) |item| {
|
|
123
123
|
if (chunk_delay > 0) sup.fopt_sleep(options, chunk_delay);
|
|
124
|
-
out.append(item) catch {};
|
|
124
|
+
out.append(h.A(), item) catch {};
|
|
125
125
|
}
|
|
126
|
-
return out.toOwnedSlice() catch &.{};
|
|
126
|
+
return out.toOwnedSlice(h.A()) catch &.{};
|
|
127
127
|
}
|
|
@@ -56,11 +56,11 @@ pub fn fopt_list(options: Value, key: []const u8) Value {
|
|
|
56
56
|
pub fn fopt_str_list(options: Value, key: []const u8) ?[][]const u8 {
|
|
57
57
|
const l = h.getp(options, key);
|
|
58
58
|
if (l != .array) return null;
|
|
59
|
-
var out
|
|
59
|
+
var out: std.ArrayList([]const u8) = .empty;
|
|
60
60
|
for (l.array.data.items) |v| {
|
|
61
|
-
if (v == .string) out.append(v.string) catch {};
|
|
61
|
+
if (v == .string) out.append(h.A(), v.string) catch {};
|
|
62
62
|
}
|
|
63
|
-
return out.toOwnedSlice() catch &.{};
|
|
63
|
+
return out.toOwnedSlice(h.A()) catch &.{};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// The injectable sleep (option "sleep": a function taking ms), defaulting to
|
|
@@ -33,7 +33,7 @@ pub const TelemetryFeature = struct {
|
|
|
33
33
|
|
|
34
34
|
pub fn make() Feature {
|
|
35
35
|
const self = h.A().create(TelemetryFeature) catch unreachable;
|
|
36
|
-
self.* = .{ .spans =
|
|
36
|
+
self.* = .{ .spans = .empty };
|
|
37
37
|
return .{ .ptr = @ptrCast(self), .vtable = &vtable };
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -49,9 +49,9 @@ pub const TelemetryFeature = struct {
|
|
|
49
49
|
}
|
|
50
50
|
// Deterministic-ish sequential id; unique within a client instance.
|
|
51
51
|
self.seq += 1;
|
|
52
|
-
var buf
|
|
53
|
-
buf.
|
|
54
|
-
while (buf.items.len < 16) buf.append('0') catch {};
|
|
52
|
+
var buf: std.ArrayList(u8) = .empty;
|
|
53
|
+
buf.print(h.A(), "{x:0>4}", .{@as(u64, @intCast(self.seq))}) catch {};
|
|
54
|
+
while (buf.items.len < 16) buf.append(h.A(), '0') catch {};
|
|
55
55
|
const prefix: []const u8 = if (std.mem.eql(u8, kind, "trace")) "t" else "s";
|
|
56
56
|
return std.fmt.allocPrint(h.A(), "{s}{s}", .{ prefix, buf.items }) catch "";
|
|
57
57
|
}
|
|
@@ -73,7 +73,7 @@ pub const TelemetryFeature = struct {
|
|
|
73
73
|
h.setp(span, "ok", h.vbool(ok));
|
|
74
74
|
|
|
75
75
|
self.active_spans -= 1;
|
|
76
|
-
self.spans.append(span) catch {};
|
|
76
|
+
self.spans.append(h.A(), span) catch {};
|
|
77
77
|
|
|
78
78
|
const exporter = h.getp(self.options, "exporter");
|
|
79
79
|
if (exporter == .function) {
|
|
@@ -153,11 +153,16 @@ fn build_args(ctx: *Context, args: Value) Value {
|
|
|
153
153
|
|
|
154
154
|
const params_path = h.getpath(&.{ "args", "params" }, point);
|
|
155
155
|
const reqd_params = vs.select(h.A(), params_path, h.jo(&.{.{ "reqd", h.vbool(true) }})) catch h.olist();
|
|
156
|
-
const reqd =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
h.
|
|
160
|
-
|
|
156
|
+
const reqd = blk: {
|
|
157
|
+
// transform now reports collected injection errors beside the value;
|
|
158
|
+
// .out is what it used to return on its own, errors or not.
|
|
159
|
+
const tres = vs.transform(h.A(), reqd_params, h.ja(&.{
|
|
160
|
+
h.vstr("`$EACH`"),
|
|
161
|
+
h.vstr(""),
|
|
162
|
+
h.vstr("`$KEY.name`"),
|
|
163
|
+
})) catch break :blk h.olist();
|
|
164
|
+
break :blk tres.out;
|
|
165
|
+
};
|
|
161
166
|
|
|
162
167
|
const qand = h.olist();
|
|
163
168
|
const q = h.jo(&.{.{ "`$AND`", qand }});
|