@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,8 +1,25 @@
|
|
|
1
1
|
#!perl
|
|
2
2
|
# ProjectName SDK primary utility test
|
|
3
3
|
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
4
|
+
# Corpus sections run through the vendored omni runner, via the resolver
|
|
5
|
+
# in t/omni.pm (struct-runner shape over native Voxgig::Omni). The inline
|
|
6
|
+
# corpus engine this file used to carry is retired: omni resolves
|
|
7
|
+
# arguments, applies the null rules, and enforces out/err/match - the
|
|
8
|
+
# subjects below only adapt each utility's calling convention.
|
|
9
|
+
#
|
|
10
|
+
# Three conventions to know when adding a section:
|
|
11
|
+
#
|
|
12
|
+
# - Subjects receive the contextified entry as a map-face VIEW; unwrap the
|
|
13
|
+
# live blessed context with ProjectNameOmni::livectx before calling a
|
|
14
|
+
# utility (utilities call methods on it - `$ctx->make_error`).
|
|
15
|
+
#
|
|
16
|
+
# - Utilities that answer as a (value, err) PAIR go through _unwrap, which
|
|
17
|
+
# dies with the err so omni can match it against `err:` expectations.
|
|
18
|
+
# Utilities that answer bare values (or die) are passed straight in.
|
|
19
|
+
#
|
|
20
|
+
# - `match: {ctx: ...}` assertions read the LIVE context after the subject
|
|
21
|
+
# ran - the resolver's view presents the context object as the map omni
|
|
22
|
+
# walks, camelCase keys included.
|
|
6
23
|
|
|
7
24
|
use strict;
|
|
8
25
|
use warnings;
|
|
@@ -15,23 +32,37 @@ use Cwd ();
|
|
|
15
32
|
|
|
16
33
|
use ProjectNameSDK;
|
|
17
34
|
|
|
35
|
+
require(Cwd::abs_path("$FindBin::Bin/omni.pm"));
|
|
36
|
+
|
|
18
37
|
my $TEST_JSON = Cwd::abs_path("$FindBin::Bin/../../.sdk/test/test.json");
|
|
19
38
|
|
|
20
39
|
unless (defined $TEST_JSON && -e $TEST_JSON) {
|
|
21
40
|
plan skip_all => 'test.json corpus not found';
|
|
22
41
|
}
|
|
23
42
|
|
|
24
|
-
my $
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
my $
|
|
30
|
-
ok(Voxgig::Struct::ismap($PRIMARY), 'primary section found in test.json');
|
|
43
|
+
my $_runner = ProjectNameOmni::make_runner($TEST_JSON, ProjectNameSDK->test(undef, undef));
|
|
44
|
+
my $_run = $_runner->('primary');
|
|
45
|
+
|
|
46
|
+
my $spec = $_run->{spec};
|
|
47
|
+
my $runset = $_run->{runset};
|
|
48
|
+
my $runsetflags = $_run->{runsetflags};
|
|
31
49
|
|
|
32
|
-
|
|
50
|
+
# Under the old inline runner the suite drove the SDK directly; under omni
|
|
51
|
+
# the runpack's client is the provider wrapping it. This suite treats the
|
|
52
|
+
# client as the SDK - so unwrap the real instance (mirrors ts/py).
|
|
53
|
+
my $client = $_run->{client}{sdk};
|
|
33
54
|
my $utility = $client->get_utility;
|
|
34
55
|
|
|
56
|
+
ok(Voxgig::Struct::ismap($spec), 'primary section found in test.json');
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# Sections deliberately left empty in the shared corpus
|
|
60
|
+
# (.sdk/test/primary/<name>.aon carries a PENDING header). Everything else
|
|
61
|
+
# MUST contribute cases.
|
|
62
|
+
my %PENDING = map { $_ => 1 } qw(
|
|
63
|
+
fetcher makeFetchDef makeResult featureAdd featureHook featureInit
|
|
64
|
+
);
|
|
65
|
+
|
|
35
66
|
|
|
36
67
|
# === Helper packages ===
|
|
37
68
|
|
|
@@ -76,170 +107,57 @@ my $utility = $client->get_utility;
|
|
|
76
107
|
|
|
77
108
|
# === Helpers ===
|
|
78
109
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
sub match_string {
|
|
95
|
-
my ($pattern, $val) = @_;
|
|
96
|
-
if (length($pattern) >= 2 && '/' eq substr($pattern, 0, 1)
|
|
97
|
-
&& '/' eq substr($pattern, -1)) {
|
|
98
|
-
my $re = substr($pattern, 1, length($pattern) - 2);
|
|
99
|
-
return ("$val" =~ /$re/) ? 1 : 0;
|
|
100
|
-
}
|
|
101
|
-
return (index(lc "$val", lc $pattern) >= 0) ? 1 : 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
sub match_deep {
|
|
105
|
-
my ($label, $check, $base, $path) = @_;
|
|
106
|
-
return 1 unless defined $check;
|
|
107
|
-
|
|
108
|
-
if (Voxgig::Struct::ismap($check)) {
|
|
109
|
-
for my $key (keys %$check) {
|
|
110
|
-
my $base_val = Voxgig::Struct::ismap($base) ? $base->{$key} : undef;
|
|
111
|
-
return 0 unless match_deep($label, $check->{$key}, $base_val, "$path.$key");
|
|
112
|
-
}
|
|
113
|
-
return 1;
|
|
114
|
-
}
|
|
115
|
-
if (Voxgig::Struct::islist($check)) {
|
|
116
|
-
for my $ci (0 .. $#$check) {
|
|
117
|
-
my $base_val = (Voxgig::Struct::islist($base) && $ci < @$base)
|
|
118
|
-
? $base->[$ci] : undef;
|
|
119
|
-
return 0 unless match_deep($label, $check->[$ci], $base_val, "$path\[$ci\]");
|
|
120
|
-
}
|
|
121
|
-
return 1;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (defined $check && !ref $check && '__EXISTS__' eq $check) {
|
|
125
|
-
return 1 if defined $base;
|
|
126
|
-
fail("$label: match $path: expected value to exist but got undef");
|
|
127
|
-
return 0;
|
|
128
|
-
}
|
|
129
|
-
if (defined $check && !ref $check && '__UNDEF__' eq $check) {
|
|
130
|
-
return 1 if !defined $base;
|
|
131
|
-
fail("$label: match $path: expected undef but got " . canon($base));
|
|
132
|
-
return 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return 1 if canon($check) eq canon($base);
|
|
136
|
-
|
|
137
|
-
if (defined $check && !ref($check) && !Voxgig::Struct::is_jbool($check)
|
|
138
|
-
&& !Voxgig::Struct::is_jnull($check) && '' ne "$check") {
|
|
139
|
-
my $base_str = defined $base ? "$base" : '';
|
|
140
|
-
return 1 if match_string("$check", $base_str);
|
|
110
|
+
# Run one corpus section, failing loudly when it would run ZERO cases. A
|
|
111
|
+
# renamed section or a fixture that compiled to an empty `set` used to
|
|
112
|
+
# pass silently, which defeats the point of a shared oracle. EVERY
|
|
113
|
+
# corpus-backed test goes through here (mirrors ts/py). Each section is
|
|
114
|
+
# one assertion; omni's failure message carries the entry index, the entry
|
|
115
|
+
# and both values.
|
|
116
|
+
sub runsection {
|
|
117
|
+
my ($name, $subject) = @_;
|
|
118
|
+
|
|
119
|
+
my $section = (ref($spec) eq 'HASH') ? $spec->{$name} : undef;
|
|
120
|
+
unless (ref($section) eq 'HASH') {
|
|
121
|
+
fail("corpus section '$name' missing - check the name against .sdk/test/primary/");
|
|
122
|
+
return;
|
|
141
123
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
# Run each entry of a test set through $subject (called with the entry;
|
|
148
|
-
# returns the result and may die). Expected errors are matched by
|
|
149
|
-
# substring / regex; "match" clauses are checked over {in,out,args,ctx}.
|
|
150
|
-
sub runset {
|
|
151
|
-
my ($label, $testspec, $subject) = @_;
|
|
152
|
-
unless ($testspec) {
|
|
153
|
-
pass("$label: no test set");
|
|
124
|
+
my $basic = $section->{basic};
|
|
125
|
+
unless (ref($basic) eq 'HASH' && ref($basic->{set}) eq 'ARRAY') {
|
|
126
|
+
fail("corpus section '$name' has no basic.set list");
|
|
154
127
|
return;
|
|
155
128
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
129
|
+
if (0 == scalar(@{ $basic->{set} }) && !$PENDING{$name}) {
|
|
130
|
+
fail("corpus section '$name' is EMPTY - zero cases would run; add cases, "
|
|
131
|
+
. 'or mark the fixture PENDING in .sdk/test/primary/');
|
|
159
132
|
return;
|
|
160
133
|
}
|
|
161
134
|
|
|
162
|
-
my $
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
next unless Voxgig::Struct::ismap($entry);
|
|
166
|
-
my $mark = defined $entry->{mark} ? " (mark=$entry->{mark})" : '';
|
|
167
|
-
my $elabel = "$label entry $i$mark";
|
|
168
|
-
|
|
169
|
-
my $result = eval { $subject->($entry) };
|
|
135
|
+
my $ok = eval { $runset->($basic, $subject); 1 };
|
|
136
|
+
if ($ok) { pass("$name.basic") }
|
|
137
|
+
else {
|
|
170
138
|
my $err = $@;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if ($err) {
|
|
175
|
-
if (defined $expected_err) {
|
|
176
|
-
my $err_msg = "$err";
|
|
177
|
-
if (!ref $expected_err && !Voxgig::Struct::is_jbool($expected_err)) {
|
|
178
|
-
unless (match_string("$expected_err", $err_msg)) {
|
|
179
|
-
fail("$elabel: error mismatch: got [$err_msg], want contains [$expected_err]");
|
|
180
|
-
next;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
# err: true means any error is acceptable
|
|
184
|
-
if (Voxgig::Struct::ismap($entry->{match})) {
|
|
185
|
-
my $result_map = {
|
|
186
|
-
'in' => $entry->{in},
|
|
187
|
-
'out' => undef,
|
|
188
|
-
'err' => { 'message' => "$err" },
|
|
189
|
-
};
|
|
190
|
-
$result_map->{ctx} = $entry->{ctx} if defined $entry->{ctx};
|
|
191
|
-
next unless match_deep($elabel, $entry->{match}, $result_map, '');
|
|
192
|
-
}
|
|
193
|
-
pass($elabel);
|
|
194
|
-
next;
|
|
195
|
-
}
|
|
196
|
-
fail("$elabel: unexpected error: $err");
|
|
197
|
-
next;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (defined $expected_err) {
|
|
201
|
-
fail("$elabel: expected error containing " . canon($expected_err)
|
|
202
|
-
. ' but got result: ' . canon($result));
|
|
203
|
-
next;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
my $matched = 0;
|
|
207
|
-
if (Voxgig::Struct::ismap($entry->{match})) {
|
|
208
|
-
my $result_map = {
|
|
209
|
-
'in' => $entry->{in},
|
|
210
|
-
'out' => $result,
|
|
211
|
-
};
|
|
212
|
-
if (defined $entry->{args}) {
|
|
213
|
-
$result_map->{args} = $entry->{args};
|
|
214
|
-
}
|
|
215
|
-
elsif (defined $entry->{in}) {
|
|
216
|
-
$result_map->{args} = [$entry->{in}];
|
|
217
|
-
}
|
|
218
|
-
$result_map->{ctx} = $entry->{ctx} if defined $entry->{ctx};
|
|
219
|
-
next unless match_deep($elabel, $entry->{match}, $result_map, '');
|
|
220
|
-
$matched = 1;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
my $has_out = exists $entry->{out}
|
|
224
|
-
&& defined $entry->{out} && !Voxgig::Struct::is_jnull($entry->{out});
|
|
225
|
-
if (!$has_out && $matched) {
|
|
226
|
-
pass($elabel);
|
|
227
|
-
next;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if ($has_out) {
|
|
231
|
-
unless (canon($result) eq canon($entry->{out})) {
|
|
232
|
-
fail("$elabel: output mismatch:\n got: " . canon($result)
|
|
233
|
-
. "\n want: " . canon($entry->{out}));
|
|
234
|
-
next;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
pass($elabel);
|
|
139
|
+
fail("$name.basic");
|
|
140
|
+
diag("$name.basic: $err");
|
|
239
141
|
}
|
|
240
142
|
return;
|
|
241
143
|
}
|
|
242
144
|
|
|
145
|
+
# (value, err) pair convention -> value-or-die, omni's shape.
|
|
146
|
+
sub _unwrap {
|
|
147
|
+
my ($val, $err) = @_;
|
|
148
|
+
die $err if defined $err;
|
|
149
|
+
return $val;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
sub _err_from_map {
|
|
153
|
+
my ($m) = @_;
|
|
154
|
+
return undef unless ref($m) eq 'HASH';
|
|
155
|
+
my $msg = $m->{message};
|
|
156
|
+
return undef unless defined $msg && !ref $msg && '' ne $msg;
|
|
157
|
+
my $code = defined $m->{code} ? $m->{code} : '';
|
|
158
|
+
return ProjectNameError->new($code, $msg);
|
|
159
|
+
}
|
|
160
|
+
|
|
243
161
|
sub make_test_ctx {
|
|
244
162
|
my ($c, $u, $overrides) = @_;
|
|
245
163
|
my $ctxmap = {
|
|
@@ -270,68 +188,15 @@ sub make_test_full_ctx {
|
|
|
270
188
|
return $ctx;
|
|
271
189
|
}
|
|
272
190
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
my $
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
if (!defined $ctx->{options} && $c) {
|
|
284
|
-
$ctx->{options} = $c->options_map;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
# Handle spec from JSON map
|
|
288
|
-
if (Voxgig::Struct::ismap($ctxmap->{spec})) {
|
|
289
|
-
$ctx->{spec} = ProjectNameSpec->new($ctxmap->{spec});
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
# Handle result from JSON map
|
|
293
|
-
if (Voxgig::Struct::ismap($ctxmap->{result})) {
|
|
294
|
-
my $res_map = $ctxmap->{result};
|
|
295
|
-
$ctx->{result} = ProjectNameResult->new($res_map);
|
|
296
|
-
if (Voxgig::Struct::ismap($res_map->{err})
|
|
297
|
-
&& defined $res_map->{err}{message} && !ref $res_map->{err}{message}) {
|
|
298
|
-
$ctx->{result}{err} = ProjectNameError->new('', $res_map->{err}{message});
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
# Handle response from JSON map
|
|
303
|
-
if (Voxgig::Struct::ismap($ctxmap->{response})) {
|
|
304
|
-
my $resp_map = $ctxmap->{response};
|
|
305
|
-
$ctx->{response} = ProjectNameResponse->new($resp_map);
|
|
306
|
-
if (ProjectNameHelpers::rb_truthy($resp_map->{body})) {
|
|
307
|
-
my $body_copy = $resp_map->{body};
|
|
308
|
-
$ctx->{response}{json_func} = sub { $body_copy };
|
|
309
|
-
}
|
|
310
|
-
if (Voxgig::Struct::ismap($resp_map->{headers})) {
|
|
311
|
-
my $lower = {};
|
|
312
|
-
$lower->{lc $_} = $resp_map->{headers}{$_} for keys %{ $resp_map->{headers} };
|
|
313
|
-
$ctx->{response}{headers} = $lower;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return $ctx;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
sub fixctx {
|
|
321
|
-
my ($ctx, $c) = @_;
|
|
322
|
-
if ($ctx && $ctx->{client} && !defined $ctx->{options}) {
|
|
323
|
-
$ctx->{options} = $ctx->{client}->options_map;
|
|
324
|
-
}
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
sub err_from_map {
|
|
329
|
-
my ($m) = @_;
|
|
330
|
-
return undef unless Voxgig::Struct::ismap($m);
|
|
331
|
-
my $msg = $m->{message};
|
|
332
|
-
return undef unless defined $msg && !ref $msg && '' ne $msg;
|
|
333
|
-
my $code = defined $m->{code} ? $m->{code} : '';
|
|
334
|
-
return ProjectNameError->new($code, $msg);
|
|
191
|
+
# DEF blocks are read from the LOADED spec, so clone before the in-place
|
|
192
|
+
# model conversion.
|
|
193
|
+
sub _def_setup {
|
|
194
|
+
my ($name) = @_;
|
|
195
|
+
my $section = (ref($spec) eq 'HASH') ? $spec->{$name} : undef;
|
|
196
|
+
my $setup = (ref($section) eq 'HASH' && ref($section->{DEF}) eq 'HASH'
|
|
197
|
+
&& ref($section->{DEF}{setup}) eq 'HASH') ? $section->{DEF}{setup}{a} : undef;
|
|
198
|
+
return undef unless ref($setup) eq 'HASH';
|
|
199
|
+
return ProjectNameOmni::tostruct(Voxgig::Omni::Util::clone($setup));
|
|
335
200
|
}
|
|
336
201
|
|
|
337
202
|
|
|
@@ -360,30 +225,20 @@ for my $name (qw(
|
|
|
360
225
|
|
|
361
226
|
# === done ===
|
|
362
227
|
|
|
363
|
-
|
|
364
|
-
my ($
|
|
365
|
-
|
|
366
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
367
|
-
fixctx($ctx, $client);
|
|
368
|
-
return $utility->{done}->($ctx);
|
|
228
|
+
runsection('done', sub {
|
|
229
|
+
my ($view) = @_;
|
|
230
|
+
return $utility->{done}->(ProjectNameOmni::livectx($view));
|
|
369
231
|
});
|
|
370
232
|
|
|
371
233
|
|
|
372
234
|
# === makeError ===
|
|
373
235
|
|
|
374
|
-
|
|
375
|
-
my ($
|
|
376
|
-
my $
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
fixctx($ctx, $client);
|
|
381
|
-
|
|
382
|
-
my $err;
|
|
383
|
-
if (@$args > 1 && Voxgig::Struct::ismap($args->[1])) {
|
|
384
|
-
$err = err_from_map($args->[1]);
|
|
385
|
-
}
|
|
386
|
-
|
|
236
|
+
runsection('makeError', sub {
|
|
237
|
+
my ($view, $errmap) = @_;
|
|
238
|
+
my $ctx = ProjectNameOmni::livectx($view);
|
|
239
|
+
my $err = _err_from_map($errmap);
|
|
240
|
+
# make_error dies with the constructed error on the default (throw)
|
|
241
|
+
# path; omni matches it against the entry's err.
|
|
387
242
|
return $utility->{make_error}->($ctx, $err);
|
|
388
243
|
});
|
|
389
244
|
|
|
@@ -469,6 +324,10 @@ runset('makeError.basic', get_spec($PRIMARY, 'makeError', 'basic'), sub {
|
|
|
469
324
|
{
|
|
470
325
|
my $calls = [];
|
|
471
326
|
my $live_client = ProjectNameSDK->new({
|
|
327
|
+
# Concrete base: a live construction must satisfy any server variables
|
|
328
|
+
# a templated base URL declares; a literal base sidesteps the
|
|
329
|
+
# requirement.
|
|
330
|
+
'base' => 'http://localhost:8080',
|
|
472
331
|
'system' => {
|
|
473
332
|
'fetch' => sub {
|
|
474
333
|
my ($url, $fetchdef) = @_;
|
|
@@ -493,6 +352,7 @@ runset('makeError.basic', get_spec($PRIMARY, 'makeError', 'basic'), sub {
|
|
|
493
352
|
|
|
494
353
|
{
|
|
495
354
|
my $blocked_client = ProjectNameSDK->new({
|
|
355
|
+
'base' => 'http://localhost:8080',
|
|
496
356
|
'system' => {
|
|
497
357
|
'fetch' => sub { return ({}, undef) },
|
|
498
358
|
},
|
|
@@ -515,11 +375,10 @@ runset('makeError.basic', get_spec($PRIMARY, 'makeError', 'basic'), sub {
|
|
|
515
375
|
|
|
516
376
|
# === makeContext ===
|
|
517
377
|
|
|
518
|
-
|
|
519
|
-
my ($
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
my $ctx = $utility->{make_context}->($in_val, undef);
|
|
378
|
+
runsection('makeContext', sub {
|
|
379
|
+
my ($vin) = @_;
|
|
380
|
+
return undef unless ref($vin) eq 'HASH';
|
|
381
|
+
my $ctx = $utility->{make_context}->($vin, undef);
|
|
523
382
|
my $out = { 'id' => $ctx->{id} };
|
|
524
383
|
if ($ctx->{op}) {
|
|
525
384
|
$out->{op} = {
|
|
@@ -584,12 +443,12 @@ runset('makeContext.basic', get_spec($PRIMARY, 'makeContext', 'basic'), sub {
|
|
|
584
443
|
|
|
585
444
|
# === makeOptions ===
|
|
586
445
|
|
|
587
|
-
|
|
588
|
-
my ($
|
|
589
|
-
|
|
446
|
+
runsection('makeOptions', sub {
|
|
447
|
+
my ($vin) = @_;
|
|
448
|
+
$vin = {} unless ref($vin) eq 'HASH';
|
|
590
449
|
my $ctx = $utility->{make_context}->({
|
|
591
|
-
'options' => $
|
|
592
|
-
'config' => $
|
|
450
|
+
'options' => $vin->{options},
|
|
451
|
+
'config' => $vin->{config},
|
|
593
452
|
}, undef);
|
|
594
453
|
$ctx->{client} = $client;
|
|
595
454
|
$ctx->{utility} = $utility;
|
|
@@ -599,50 +458,19 @@ runset('makeOptions.basic', get_spec($PRIMARY, 'makeOptions', 'basic'), sub {
|
|
|
599
458
|
|
|
600
459
|
# === makeRequest ===
|
|
601
460
|
|
|
602
|
-
|
|
603
|
-
my ($
|
|
604
|
-
my $
|
|
605
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
461
|
+
runsection('makeRequest', sub {
|
|
462
|
+
my ($view) = @_;
|
|
463
|
+
my $ctx = ProjectNameOmni::livectx($view);
|
|
606
464
|
$ctx->{options} = $client->options_map;
|
|
607
|
-
|
|
608
|
-
my (undef, $err) = $utility->{make_request}->($ctx);
|
|
609
|
-
die $err if $err;
|
|
610
|
-
|
|
611
|
-
# Update entry ctx for match checking
|
|
612
|
-
my $entry_ctx = $entry->{ctx};
|
|
613
|
-
if (Voxgig::Struct::ismap($entry_ctx)) {
|
|
614
|
-
$entry_ctx->{response} = 'exists' if $ctx->{response};
|
|
615
|
-
$entry_ctx->{result} = 'exists' if $ctx->{result};
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
return undef;
|
|
465
|
+
return _unwrap($utility->{make_request}->($ctx));
|
|
619
466
|
});
|
|
620
467
|
|
|
621
468
|
|
|
622
469
|
# === makeResponse ===
|
|
623
470
|
|
|
624
|
-
|
|
625
|
-
my ($
|
|
626
|
-
|
|
627
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
628
|
-
fixctx($ctx, $client);
|
|
629
|
-
|
|
630
|
-
my (undef, $err) = $utility->{make_response}->($ctx);
|
|
631
|
-
die $err if $err;
|
|
632
|
-
|
|
633
|
-
# Update entry ctx for match checking with result data
|
|
634
|
-
my $entry_ctx = $entry->{ctx};
|
|
635
|
-
if (Voxgig::Struct::ismap($entry_ctx) && $ctx->{result}) {
|
|
636
|
-
$entry_ctx->{result} = {
|
|
637
|
-
'ok' => Voxgig::Struct::jbool($ctx->{result}{ok} ? 1 : 0),
|
|
638
|
-
'status' => $ctx->{result}{status},
|
|
639
|
-
'statusText' => $ctx->{result}{status_text},
|
|
640
|
-
'headers' => $ctx->{result}{headers},
|
|
641
|
-
'body' => $ctx->{result}{body},
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
return undef;
|
|
471
|
+
runsection('makeResponse', sub {
|
|
472
|
+
my ($view) = @_;
|
|
473
|
+
return _unwrap($utility->{make_response}->(ProjectNameOmni::livectx($view)));
|
|
646
474
|
});
|
|
647
475
|
|
|
648
476
|
|
|
@@ -696,41 +524,31 @@ runset('makeResponse.basic', get_spec($PRIMARY, 'makeResponse', 'basic'), sub {
|
|
|
696
524
|
# === makeSpec ===
|
|
697
525
|
|
|
698
526
|
{
|
|
699
|
-
my $
|
|
700
|
-
my $spec_client = ProjectNameSDK->test(undef, $setup_opts);
|
|
701
|
-
my $spec_utility = $spec_client->get_utility;
|
|
702
|
-
|
|
703
|
-
runset('makeSpec.basic', get_spec($PRIMARY, 'makeSpec', 'basic'), sub {
|
|
704
|
-
my ($entry) = @_;
|
|
705
|
-
my $ctxmap = $entry->{ctx} || {};
|
|
706
|
-
my $ctx = make_ctx_from_map($ctxmap, $spec_client, $spec_utility);
|
|
707
|
-
$ctx->{options} = $spec_client->options_map;
|
|
527
|
+
my $spec_client = ProjectNameSDK->test(undef, _def_setup('makeSpec'));
|
|
708
528
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
$entry_ctx->{spec} = {
|
|
716
|
-
'base' => $ctx->{spec}{base},
|
|
717
|
-
'prefix' => $ctx->{spec}{prefix},
|
|
718
|
-
'suffix' => $ctx->{spec}{suffix},
|
|
719
|
-
'method' => $ctx->{spec}{method},
|
|
720
|
-
'params' => $ctx->{spec}{params},
|
|
721
|
-
'query' => $ctx->{spec}{query},
|
|
722
|
-
'headers' => $ctx->{spec}{headers},
|
|
723
|
-
'step' => $ctx->{spec}{step},
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
return undef;
|
|
529
|
+
runsection('makeSpec', sub {
|
|
530
|
+
my ($view) = @_;
|
|
531
|
+
my $ctx = ProjectNameOmni::livectx($view);
|
|
532
|
+
$ctx->{client} = $spec_client;
|
|
533
|
+
$ctx->{options} = $spec_client->options_map;
|
|
534
|
+
return _unwrap($utility->{make_spec}->($ctx));
|
|
728
535
|
});
|
|
729
536
|
}
|
|
730
537
|
|
|
731
538
|
|
|
732
539
|
# === makePoint ===
|
|
733
540
|
|
|
541
|
+
# Driven from the corpus like every other section; the single-point
|
|
542
|
+
# sanity case is kept below.
|
|
543
|
+
runsection('makePoint', sub {
|
|
544
|
+
my ($view) = @_;
|
|
545
|
+
my ($point, $err) = $utility->{make_point}->(ProjectNameOmni::livectx($view));
|
|
546
|
+
# The corpus asserts refusals by code (`match: {out: {code: ...}}`), so
|
|
547
|
+
# an error is the RESULT here, flattened to the map the corpus reads.
|
|
548
|
+
return ProjectNameOmni::errify($err) if defined $err;
|
|
549
|
+
return $point;
|
|
550
|
+
});
|
|
551
|
+
|
|
734
552
|
{
|
|
735
553
|
my $ctx = make_test_ctx($client, $utility, undef);
|
|
736
554
|
my $point = {
|
|
@@ -752,23 +570,20 @@ runset('makeResponse.basic', get_spec($PRIMARY, 'makeResponse', 'basic'), sub {
|
|
|
752
570
|
|
|
753
571
|
# === makeUrl ===
|
|
754
572
|
|
|
755
|
-
|
|
756
|
-
my ($
|
|
757
|
-
my $
|
|
758
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
573
|
+
runsection('makeUrl', sub {
|
|
574
|
+
my ($view) = @_;
|
|
575
|
+
my $ctx = ProjectNameOmni::livectx($view);
|
|
759
576
|
$ctx->{result} = ProjectNameResult->new({}) unless $ctx->{result};
|
|
760
|
-
|
|
761
|
-
die $err if $err;
|
|
762
|
-
return $url;
|
|
577
|
+
return _unwrap($utility->{make_url}->($ctx));
|
|
763
578
|
});
|
|
764
579
|
|
|
765
580
|
|
|
766
581
|
# === operator ===
|
|
767
582
|
|
|
768
|
-
|
|
769
|
-
my ($
|
|
770
|
-
|
|
771
|
-
my $op = ProjectNameOperation->new($
|
|
583
|
+
runsection('operator', sub {
|
|
584
|
+
my ($vin) = @_;
|
|
585
|
+
$vin = {} unless ref($vin) eq 'HASH';
|
|
586
|
+
my $op = ProjectNameOperation->new($vin);
|
|
772
587
|
return {
|
|
773
588
|
'entity' => $op->{entity},
|
|
774
589
|
'name' => $op->{name},
|
|
@@ -780,143 +595,79 @@ runset('operator.basic', get_spec($PRIMARY, 'operator', 'basic'), sub {
|
|
|
780
595
|
|
|
781
596
|
# === param ===
|
|
782
597
|
|
|
783
|
-
|
|
784
|
-
my ($
|
|
785
|
-
|
|
786
|
-
return undef if @$args < 2;
|
|
787
|
-
|
|
788
|
-
my $ctxmap = Voxgig::Struct::ismap($args->[0]) ? $args->[0] : {};
|
|
789
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
790
|
-
my $paramdef = $args->[1];
|
|
791
|
-
|
|
792
|
-
my $result = $utility->{param}->($ctx, $paramdef);
|
|
793
|
-
|
|
794
|
-
# Update entry ctx for match
|
|
795
|
-
if (Voxgig::Struct::ismap($entry->{match})) {
|
|
796
|
-
my $ctx_match = $entry->{match}{ctx};
|
|
797
|
-
if (Voxgig::Struct::ismap($ctx_match)) {
|
|
798
|
-
my $entry_ctx = $entry->{ctx};
|
|
799
|
-
if (!defined $entry_ctx) {
|
|
800
|
-
$entry_ctx = {};
|
|
801
|
-
$entry->{ctx} = $entry_ctx;
|
|
802
|
-
}
|
|
803
|
-
my $spec_match = $ctx_match->{spec};
|
|
804
|
-
if (Voxgig::Struct::ismap($spec_match) && $ctx->{spec}) {
|
|
805
|
-
$entry_ctx->{spec} = {} unless $entry_ctx->{spec};
|
|
806
|
-
if ($spec_match->{alias}) {
|
|
807
|
-
$entry_ctx->{spec} = {
|
|
808
|
-
'alias' => $ctx->{spec}{alias},
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
return $result;
|
|
598
|
+
runsection('param', sub {
|
|
599
|
+
my ($view, $paramdef) = @_;
|
|
600
|
+
return $utility->{param}->(ProjectNameOmni::livectx($view), $paramdef);
|
|
816
601
|
});
|
|
817
602
|
|
|
818
603
|
|
|
819
604
|
# === prepareAuth ===
|
|
820
605
|
|
|
821
606
|
{
|
|
822
|
-
my $
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
my $ctx = make_ctx_from_map($ctxmap, $auth_client, $auth_utility);
|
|
830
|
-
fixctx($ctx, $auth_client);
|
|
831
|
-
|
|
832
|
-
my (undef, $err) = $utility->{prepare_auth}->($ctx);
|
|
833
|
-
die $err if $err;
|
|
834
|
-
|
|
835
|
-
# Update entry ctx for match
|
|
836
|
-
my $entry_ctx = $entry->{ctx};
|
|
837
|
-
if (Voxgig::Struct::ismap($entry_ctx) && $ctx->{spec}) {
|
|
838
|
-
$entry_ctx->{spec} = {
|
|
839
|
-
'headers' => $ctx->{spec}{headers},
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
return undef;
|
|
607
|
+
my $auth_client = ProjectNameSDK->test(undef, _def_setup('prepareAuth'));
|
|
608
|
+
|
|
609
|
+
runsection('prepareAuth', sub {
|
|
610
|
+
my ($view) = @_;
|
|
611
|
+
my $ctx = ProjectNameOmni::livectx($view);
|
|
612
|
+
$ctx->{client} = $auth_client;
|
|
613
|
+
return _unwrap($utility->{prepare_auth}->($ctx));
|
|
844
614
|
});
|
|
845
615
|
}
|
|
846
616
|
|
|
847
617
|
|
|
848
618
|
# === prepareBody ===
|
|
849
619
|
|
|
850
|
-
|
|
851
|
-
my ($
|
|
852
|
-
|
|
853
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
854
|
-
fixctx($ctx, $client);
|
|
855
|
-
return $utility->{prepare_body}->($ctx);
|
|
620
|
+
runsection('prepareBody', sub {
|
|
621
|
+
my ($view) = @_;
|
|
622
|
+
return $utility->{prepare_body}->(ProjectNameOmni::livectx($view));
|
|
856
623
|
});
|
|
857
624
|
|
|
858
625
|
|
|
859
626
|
# === prepareHeaders ===
|
|
860
627
|
|
|
861
|
-
|
|
862
|
-
my ($
|
|
863
|
-
|
|
864
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
865
|
-
return $utility->{prepare_headers}->($ctx);
|
|
628
|
+
runsection('prepareHeaders', sub {
|
|
629
|
+
my ($view) = @_;
|
|
630
|
+
return $utility->{prepare_headers}->(ProjectNameOmni::livectx($view));
|
|
866
631
|
});
|
|
867
632
|
|
|
868
633
|
|
|
869
634
|
# === prepareMethod ===
|
|
870
635
|
|
|
871
|
-
|
|
872
|
-
my ($
|
|
873
|
-
|
|
874
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
875
|
-
return $utility->{prepare_method}->($ctx);
|
|
636
|
+
runsection('prepareMethod', sub {
|
|
637
|
+
my ($view) = @_;
|
|
638
|
+
return $utility->{prepare_method}->(ProjectNameOmni::livectx($view));
|
|
876
639
|
});
|
|
877
640
|
|
|
878
641
|
|
|
879
642
|
# === prepareParams ===
|
|
880
643
|
|
|
881
|
-
|
|
882
|
-
my ($
|
|
883
|
-
|
|
884
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
885
|
-
return $utility->{prepare_params}->($ctx);
|
|
644
|
+
runsection('prepareParams', sub {
|
|
645
|
+
my ($view) = @_;
|
|
646
|
+
return $utility->{prepare_params}->(ProjectNameOmni::livectx($view));
|
|
886
647
|
});
|
|
887
648
|
|
|
888
649
|
|
|
889
650
|
# === preparePath ===
|
|
890
651
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
my ($entry) = @_;
|
|
895
|
-
my $ctxmap = $entry->{ctx} || {};
|
|
896
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
897
|
-
return $utility->{prepare_path}->($ctx);
|
|
652
|
+
runsection('preparePath', sub {
|
|
653
|
+
my ($view) = @_;
|
|
654
|
+
return $utility->{prepare_path}->(ProjectNameOmni::livectx($view));
|
|
898
655
|
});
|
|
899
656
|
|
|
900
657
|
|
|
901
658
|
# === prepareQuery ===
|
|
902
659
|
|
|
903
|
-
|
|
904
|
-
my ($
|
|
905
|
-
|
|
906
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
907
|
-
return $utility->{prepare_query}->($ctx);
|
|
660
|
+
runsection('prepareQuery', sub {
|
|
661
|
+
my ($view) = @_;
|
|
662
|
+
return $utility->{prepare_query}->(ProjectNameOmni::livectx($view));
|
|
908
663
|
});
|
|
909
664
|
|
|
910
665
|
|
|
911
666
|
# === resultBasic ===
|
|
912
667
|
|
|
913
|
-
|
|
914
|
-
my ($
|
|
915
|
-
my $
|
|
916
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
917
|
-
fixctx($ctx, $client);
|
|
918
|
-
|
|
919
|
-
my $result = $utility->{result_basic}->($ctx);
|
|
668
|
+
runsection('resultBasic', sub {
|
|
669
|
+
my ($view) = @_;
|
|
670
|
+
my $result = $utility->{result_basic}->(ProjectNameOmni::livectx($view));
|
|
920
671
|
|
|
921
672
|
my $out = {
|
|
922
673
|
'status' => $result->{status},
|
|
@@ -927,88 +678,39 @@ runset('resultBasic.basic', get_spec($PRIMARY, 'resultBasic', 'basic'), sub {
|
|
|
927
678
|
'message' => '' . $result->{err},
|
|
928
679
|
};
|
|
929
680
|
}
|
|
930
|
-
|
|
931
681
|
return $out;
|
|
932
682
|
});
|
|
933
683
|
|
|
934
684
|
|
|
935
685
|
# === resultBody ===
|
|
936
686
|
|
|
937
|
-
|
|
938
|
-
my ($
|
|
939
|
-
|
|
940
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
941
|
-
|
|
942
|
-
$utility->{result_body}->($ctx);
|
|
943
|
-
|
|
944
|
-
my $entry_ctx = $entry->{ctx};
|
|
945
|
-
if (Voxgig::Struct::ismap($entry_ctx) && $ctx->{result}) {
|
|
946
|
-
$entry_ctx->{result} = {
|
|
947
|
-
'body' => $ctx->{result}{body},
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
return undef;
|
|
687
|
+
runsection('resultBody', sub {
|
|
688
|
+
my ($view) = @_;
|
|
689
|
+
return $utility->{result_body}->(ProjectNameOmni::livectx($view));
|
|
952
690
|
});
|
|
953
691
|
|
|
954
692
|
|
|
955
693
|
# === resultHeaders ===
|
|
956
694
|
|
|
957
|
-
|
|
958
|
-
my ($
|
|
959
|
-
|
|
960
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
961
|
-
|
|
962
|
-
$utility->{result_headers}->($ctx);
|
|
963
|
-
|
|
964
|
-
my $entry_ctx = $entry->{ctx};
|
|
965
|
-
if (Voxgig::Struct::ismap($entry_ctx) && $ctx->{result}) {
|
|
966
|
-
$entry_ctx->{result} = {
|
|
967
|
-
'headers' => $ctx->{result}{headers},
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
return undef;
|
|
695
|
+
runsection('resultHeaders', sub {
|
|
696
|
+
my ($view) = @_;
|
|
697
|
+
return $utility->{result_headers}->(ProjectNameOmni::livectx($view));
|
|
972
698
|
});
|
|
973
699
|
|
|
974
700
|
|
|
975
701
|
# === transformRequest ===
|
|
976
702
|
|
|
977
|
-
|
|
978
|
-
my ($
|
|
979
|
-
|
|
980
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
981
|
-
|
|
982
|
-
my $result = $utility->{transform_request}->($ctx);
|
|
983
|
-
|
|
984
|
-
# Update entry ctx for match (step changed)
|
|
985
|
-
my $entry_ctx = $entry->{ctx};
|
|
986
|
-
if (Voxgig::Struct::ismap($entry_ctx) && $ctx->{spec}) {
|
|
987
|
-
my $spec_map = $entry_ctx->{spec};
|
|
988
|
-
$spec_map->{step} = $ctx->{spec}{step} if Voxgig::Struct::ismap($spec_map);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
return $result;
|
|
703
|
+
runsection('transformRequest', sub {
|
|
704
|
+
my ($view) = @_;
|
|
705
|
+
return $utility->{transform_request}->(ProjectNameOmni::livectx($view));
|
|
992
706
|
});
|
|
993
707
|
|
|
994
708
|
|
|
995
709
|
# === transformResponse ===
|
|
996
710
|
|
|
997
|
-
|
|
998
|
-
my ($
|
|
999
|
-
|
|
1000
|
-
my $ctx = make_ctx_from_map($ctxmap, $client, $utility);
|
|
1001
|
-
|
|
1002
|
-
my $result = $utility->{transform_response}->($ctx);
|
|
1003
|
-
|
|
1004
|
-
# Update entry ctx for match (step changed)
|
|
1005
|
-
my $entry_ctx = $entry->{ctx};
|
|
1006
|
-
if (Voxgig::Struct::ismap($entry_ctx) && $ctx->{spec}) {
|
|
1007
|
-
my $spec_map = $entry_ctx->{spec};
|
|
1008
|
-
$spec_map->{step} = $ctx->{spec}{step} if Voxgig::Struct::ismap($spec_map);
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
return $result;
|
|
711
|
+
runsection('transformResponse', sub {
|
|
712
|
+
my ($view) = @_;
|
|
713
|
+
return $utility->{transform_response}->(ProjectNameOmni::livectx($view));
|
|
1012
714
|
});
|
|
1013
715
|
|
|
1014
716
|
done_testing();
|