@voxgig/sdkgen 4.51.0 → 4.53.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/check.js +15 -0
- package/dist/action/check.js.map +1 -1
- package/dist/action/doctor.js +1 -1
- package/dist/action/doctor.js.map +1 -1
- package/dist/action/resolve.js +13 -3
- package/dist/action/resolve.js.map +1 -1
- package/dist/cmp/Deploy.js +19 -7
- package/dist/cmp/Deploy.js.map +1 -1
- package/dist/cmp/License.d.ts +3 -1
- package/dist/cmp/License.js +6 -1
- package/dist/cmp/License.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +5 -2
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeFeatures.js +20 -6
- package/dist/cmp/ReadmeFeatures.js.map +1 -1
- package/dist/helpers/clientOptions.js +1 -0
- package/dist/helpers/clientOptions.js.map +1 -1
- package/dist/helpers/definitionPlan.js +2 -2
- package/dist/helpers/definitionPlan.js.map +1 -1
- package/dist/helpers/doccheck.d.ts +9 -2
- package/dist/helpers/doccheck.js +20 -9
- package/dist/helpers/doccheck.js.map +1 -1
- package/dist/helpers/modelcheck.d.ts +7 -2
- package/dist/helpers/modelcheck.js +51 -0
- package/dist/helpers/modelcheck.js.map +1 -1
- package/dist/helpers/naming.js +1 -1
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opShape.js +9 -3
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/optspec.js +2 -2
- package/dist/helpers/optspec.js.map +1 -1
- package/dist/helpers/packageMeta.js +5 -7
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/helpers/targetrun.d.ts +22 -0
- package/dist/helpers/targetrun.js +180 -0
- package/dist/helpers/targetrun.js.map +1 -0
- package/dist/helpers/testPolicy.d.ts +2 -1
- package/dist/helpers/testPolicy.js +13 -2
- package/dist/helpers/testPolicy.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -3
- package/dist/sdkgen.js +34 -13
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.d.ts +2 -1
- package/dist/utility.js +20 -0
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +7 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/audit.aontu +1 -1
- package/project/.sdk/model/feature/cache.aontu +1 -1
- package/project/.sdk/model/feature/clienttrack.aontu +1 -1
- package/project/.sdk/model/feature/cost.aontu +1 -1
- package/project/.sdk/model/feature/debug.aontu +1 -1
- package/project/.sdk/model/feature/idempotency.aontu +1 -1
- package/project/.sdk/model/feature/log.aontu +1 -1
- package/project/.sdk/model/feature/metrics.aontu +3 -1
- package/project/.sdk/model/feature/netsim.aontu +1 -1
- package/project/.sdk/model/feature/paging.aontu +4 -1
- package/project/.sdk/model/feature/proxy.aontu +1 -1
- package/project/.sdk/model/feature/ratelimit.aontu +3 -3
- package/project/.sdk/model/feature/rbac.aontu +1 -1
- package/project/.sdk/model/feature/retry.aontu +1 -1
- package/project/.sdk/model/feature/secrets.aontu +1 -1
- package/project/.sdk/model/feature/streaming.aontu +1 -1
- package/project/.sdk/model/feature/telemetry.aontu +2 -2
- package/project/.sdk/model/feature/test.aontu +1 -1
- package/project/.sdk/model/feature/timeout.aontu +1 -1
- package/project/.sdk/model/feature/validate.aontu +1 -1
- package/project/.sdk/model/target/go-mcp.aontu +1 -1
- package/project/.sdk/model/target/py-data.aontu +1 -1
- package/project/.sdk/model/target/py.aontu +0 -5
- package/project/.sdk/model/target/rust.aontu +5 -0
- package/project/.sdk/src/cmp/c/Main_c.ts +3 -1
- package/project/.sdk/src/cmp/c/PrepareAuth_c.ts +40 -2
- package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +10 -5
- package/project/.sdk/src/cmp/c/TestClean_c.ts +12 -11
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +17 -10
- package/project/.sdk/src/cmp/clojure/Main_clojure.ts +3 -1
- package/project/.sdk/src/cmp/clojure/PrepareAuth_clojure.ts +15 -2
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +3 -1
- package/project/.sdk/src/cmp/cpp/PrepareAuth_cpp.ts +12 -2
- package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +2 -1
- package/project/.sdk/src/cmp/csharp/Main_csharp.ts +3 -1
- package/project/.sdk/src/cmp/csharp/PrepareAuth_csharp.ts +19 -0
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +4 -3
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +30 -2
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +31 -12
- package/project/.sdk/src/cmp/csharp/fragment/SdkError.fragment.cs +9 -0
- package/project/.sdk/src/cmp/elixir/Main_elixir.ts +3 -1
- package/project/.sdk/src/cmp/elixir/PrepareAuth_elixir.ts +28 -4
- package/project/.sdk/src/cmp/elixir/TestClean_elixir.ts +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +51 -15
- package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +17 -0
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +2 -1
- package/project/.sdk/src/cmp/go/Main_go.ts +3 -1
- package/project/.sdk/src/cmp/go/PrepareAuth_go.ts +17 -1
- package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +11 -6
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +4 -6
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -2
- package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +42 -14
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +45 -15
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +46 -11
- package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +9 -0
- package/project/.sdk/src/cmp/java/Main_java.ts +3 -1
- package/project/.sdk/src/cmp/java/PrepareAuth_java.ts +17 -1
- package/project/.sdk/src/cmp/java/TestClean_java.ts +10 -5
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +4 -3
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +21 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +2 -0
- package/project/.sdk/src/cmp/js/PrepareAuth_js.ts +22 -2
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +13 -8
- package/project/.sdk/src/cmp/js/TestClean_js.ts +4 -2
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +4 -7
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +26 -2
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +8 -0
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +12 -5
- package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +3 -1
- package/project/.sdk/src/cmp/kotlin/PrepareAuth_kotlin.ts +11 -0
- package/project/.sdk/src/cmp/kotlin/TestClean_kotlin.ts +10 -5
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +4 -3
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +19 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +2 -1
- package/project/.sdk/src/cmp/lua/PrepareAuth_lua.ts +18 -2
- package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +12 -3
- package/project/.sdk/src/cmp/lua/TestClean_lua.ts +2 -1
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -2
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +42 -5
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +44 -10
- package/project/.sdk/src/cmp/lua/utility_lua.ts +2 -1
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +3 -1
- package/project/.sdk/src/cmp/ocaml/PrepareAuth_ocaml.ts +24 -0
- package/project/.sdk/src/cmp/ocaml/TestClean_ocaml.ts +2 -1
- package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +36 -21
- package/project/.sdk/src/cmp/perl/Main_perl.ts +2 -1
- package/project/.sdk/src/cmp/perl/PrepareAuth_perl.ts +12 -2
- package/project/.sdk/src/cmp/perl/ReadmeExamplesTest_perl.ts +8 -2
- package/project/.sdk/src/cmp/perl/TestClean_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -2
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +21 -0
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +31 -12
- package/project/.sdk/src/cmp/php/Main_php.ts +3 -1
- package/project/.sdk/src/cmp/php/PrepareAuth_php.ts +28 -2
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeExamplesTest_php.ts +12 -3
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +1 -1
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -2
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +33 -4
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
- package/project/.sdk/src/cmp/py/Main_py.ts +2 -1
- package/project/.sdk/src/cmp/py/Package_py.ts +6 -2
- package/project/.sdk/src/cmp/py/PrepareAuth_py.ts +12 -0
- package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +4 -0
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -2
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +25 -2
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +26 -12
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +4 -3
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +13 -10
- package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/Main_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/PrepareAuth_rb.ts +23 -10
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +14 -8
- package/project/.sdk/src/cmp/rb/ReadmeExplanation_rb.ts +5 -0
- package/project/.sdk/src/cmp/rb/TestClean_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -2
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +276 -253
- package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityPatchOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +1 -1
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +56 -40
- package/project/.sdk/src/cmp/rust/Main_rust.ts +3 -1
- package/project/.sdk/src/cmp/rust/PrepareAuth_rust.ts +19 -1
- package/project/.sdk/src/cmp/rust/TestClean_rust.ts +14 -17
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -2
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +22 -2
- package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +16 -1
- package/project/.sdk/src/cmp/scala/Main_scala.ts +3 -0
- package/project/.sdk/src/cmp/scala/PrepareAuth_scala.ts +14 -0
- package/project/.sdk/src/cmp/scala/TestClean_scala.ts +11 -11
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +14 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +3 -1
- package/project/.sdk/src/cmp/swift/PrepareAuth_swift.ts +13 -0
- package/project/.sdk/src/cmp/swift/TestClean_swift.ts +11 -11
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +9 -0
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +24 -10
- package/project/.sdk/src/cmp/ts/Main_ts.ts +2 -0
- package/project/.sdk/src/cmp/ts/PrepareAuth_ts.ts +20 -1
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +13 -8
- package/project/.sdk/src/cmp/ts/TestClean_ts.ts +4 -2
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +4 -7
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +26 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +8 -0
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +12 -5
- package/project/.sdk/src/cmp/zig/Main_zig.ts +3 -0
- package/project/.sdk/src/cmp/zig/PrepareAuth_zig.ts +23 -0
- package/project/.sdk/src/cmp/zig/TestClean_zig.ts +11 -11
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +17 -10
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +41 -6
- package/project/.sdk/src/cmp/zig/fragment/Root.fragment.zig +2 -0
- package/project/.sdk/tm/c/core/context.c +4 -0
- package/project/.sdk/tm/c/core/control.c +19 -0
- package/project/.sdk/tm/c/core/result.c +3 -0
- package/project/.sdk/tm/c/core/sdk.h +17 -0
- package/project/.sdk/tm/c/feature/metrics.c +7 -0
- package/project/.sdk/tm/c/feature/netsim.c +20 -5
- package/project/.sdk/tm/c/feature/paging.c +231 -2
- package/project/.sdk/tm/c/feature/ratelimit.c +12 -15
- package/project/.sdk/tm/c/feature/retry.c +56 -6
- package/project/.sdk/tm/c/feature/streaming.c +2 -1
- package/project/.sdk/tm/c/feature/support.c +17 -0
- package/project/.sdk/tm/c/feature/telemetry.c +19 -18
- package/project/.sdk/tm/c/feature/test.c +94 -58
- package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
- package/project/.sdk/tm/c/tests/feature_test.c +253 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +2 -0
- package/project/.sdk/tm/c/utility/clean.c +6 -3
- package/project/.sdk/tm/c/utility/http.c +20 -9
- package/project/.sdk/tm/c/utility/make_fetch_def.c +3 -0
- package/project/.sdk/tm/c/utility/make_options.c +80 -9
- package/project/.sdk/tm/c/utility/make_point.c +43 -0
- package/project/.sdk/tm/c/utility/make_request.c +14 -1
- package/project/.sdk/tm/c/utility/make_spec.c +32 -0
- package/project/.sdk/tm/c/utility/media.c +31 -0
- package/project/.sdk/tm/c/utility/result_body.c +3 -0
- package/project/.sdk/tm/c/utility/tls/none.c +2 -2
- package/project/.sdk/tm/c/utility/tls/openssl.c +29 -4
- package/project/.sdk/tm/c/utility/tls/tls.h +4 -2
- package/project/.sdk/tm/clojure/src/sdk/core.clj +194 -31
- package/project/.sdk/tm/clojure/src/sdk/features.clj +237 -86
- package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +102 -1
- package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +1 -1
- package/project/.sdk/tm/cpp/core/types.hpp +171 -68
- package/project/.sdk/tm/cpp/feature/audit.hpp +6 -1
- package/project/.sdk/tm/cpp/feature/metrics.hpp +19 -0
- package/project/.sdk/tm/cpp/feature/netsim.hpp +9 -8
- package/project/.sdk/tm/cpp/feature/options.hpp +22 -0
- package/project/.sdk/tm/cpp/feature/paging.hpp +160 -2
- package/project/.sdk/tm/cpp/feature/ratelimit.hpp +15 -16
- package/project/.sdk/tm/cpp/feature/retry.hpp +52 -10
- package/project/.sdk/tm/cpp/feature/streaming.hpp +2 -1
- package/project/.sdk/tm/cpp/feature/telemetry.hpp +17 -10
- package/project/.sdk/tm/cpp/feature/test.hpp +71 -60
- package/project/.sdk/tm/cpp/feature/timeout.hpp +19 -1
- package/project/.sdk/tm/cpp/test/feature_test.cpp +207 -0
- package/project/.sdk/tm/cpp/test/harness.hpp +1 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +136 -7
- package/project/.sdk/tm/csharp/core/Context.cs +8 -0
- package/project/.sdk/tm/csharp/core/Control.cs +6 -0
- package/project/.sdk/tm/csharp/core/Result.cs +3 -0
- package/project/.sdk/tm/csharp/feature/AuditFeature.cs +8 -1
- package/project/.sdk/tm/csharp/feature/FeatureOptions.cs +37 -0
- package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +23 -0
- package/project/.sdk/tm/csharp/feature/NetsimFeature.cs +8 -9
- package/project/.sdk/tm/csharp/feature/PagingFeature.cs +130 -3
- package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +22 -21
- package/project/.sdk/tm/csharp/feature/RetryFeature.cs +46 -13
- package/project/.sdk/tm/csharp/feature/StreamingFeature.cs +2 -1
- package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +11 -9
- package/project/.sdk/tm/csharp/feature/TestFeature.cs +62 -75
- package/project/.sdk/tm/csharp/feature/TimeoutFeature.cs +8 -2
- package/project/.sdk/tm/csharp/test/FeatureHarness.cs +4 -0
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +230 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +1 -1
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +101 -15
- package/project/.sdk/tm/csharp/utility/MakeError.cs +8 -1
- package/project/.sdk/tm/csharp/utility/MakeFetchDef.cs +5 -0
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +133 -12
- package/project/.sdk/tm/csharp/utility/MakePoint.cs +24 -0
- package/project/.sdk/tm/csharp/utility/MakeRequest.cs +11 -1
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +18 -0
- package/project/.sdk/tm/csharp/utility/Media.cs +29 -0
- package/project/.sdk/tm/csharp/utility/ResultBody.cs +4 -0
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +4 -0
- package/project/.sdk/tm/elixir/lib/projectname/core.ex +6 -1
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +13 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/netsim.ex +13 -6
- package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +110 -5
- package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +11 -18
- package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +39 -12
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +7 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/streaming.ex +2 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +7 -7
- package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +59 -58
- package/project/.sdk/tm/elixir/lib/projectname/feature.ex +36 -0
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +366 -46
- package/project/.sdk/tm/elixir/test/feature_test.exs +183 -0
- package/project/.sdk/tm/elixir/test/support/feature_harness.ex +2 -0
- package/project/.sdk/tm/go/core/context.go +7 -0
- package/project/.sdk/tm/go/core/control.go +6 -0
- package/project/.sdk/tm/go/core/error.go +6 -0
- package/project/.sdk/tm/go/core/result.go +2 -0
- package/project/.sdk/tm/go/feature/audit_feature.go +1 -3
- package/project/.sdk/tm/go/feature/base_feature.go +11 -0
- package/project/.sdk/tm/go/feature/feature_options.go +39 -0
- package/project/.sdk/tm/go/feature/metrics_feature.go +14 -0
- package/project/.sdk/tm/go/feature/netsim_feature.go +17 -10
- package/project/.sdk/tm/go/feature/paging_feature.go +108 -2
- package/project/.sdk/tm/go/feature/ratelimit_feature.go +22 -19
- package/project/.sdk/tm/go/feature/retry_feature.go +83 -15
- package/project/.sdk/tm/go/feature/streaming_feature.go +2 -1
- package/project/.sdk/tm/go/feature/telemetry_feature.go +18 -11
- package/project/.sdk/tm/go/feature/test_feature.go +79 -64
- package/project/.sdk/tm/go/feature/timeout_feature.go +24 -3
- package/project/.sdk/tm/go/test/feature_corpus_test.go +247 -28
- package/project/.sdk/tm/go/test/feature_test.go +32 -0
- package/project/.sdk/tm/go/utility/clean.go +6 -2
- package/project/.sdk/tm/go/utility/fetcher.go +151 -12
- package/project/.sdk/tm/go/utility/make_error.go +8 -0
- package/project/.sdk/tm/go/utility/make_fetch_def.go +4 -0
- package/project/.sdk/tm/go/utility/make_options.go +111 -6
- package/project/.sdk/tm/go/utility/make_point.go +40 -4
- package/project/.sdk/tm/go/utility/make_request.go +21 -3
- package/project/.sdk/tm/go/utility/make_spec.go +24 -0
- package/project/.sdk/tm/go/utility/media.go +28 -0
- package/project/.sdk/tm/go/utility/register.go +22 -2
- package/project/.sdk/tm/go/utility/result_body.go +5 -0
- package/project/.sdk/tm/java/core/Context.java +8 -0
- package/project/.sdk/tm/java/core/Control.java +9 -0
- package/project/.sdk/tm/java/core/Result.java +4 -0
- package/project/.sdk/tm/java/core/SdkClient.java +43 -14
- package/project/.sdk/tm/java/feature/AuditFeature.java +5 -1
- package/project/.sdk/tm/java/feature/FeatureOptions.java +44 -0
- package/project/.sdk/tm/java/feature/MetricsFeature.java +31 -0
- package/project/.sdk/tm/java/feature/NetsimFeature.java +8 -9
- package/project/.sdk/tm/java/feature/PagingFeature.java +156 -2
- package/project/.sdk/tm/java/feature/RatelimitFeature.java +12 -15
- package/project/.sdk/tm/java/feature/RetryFeature.java +38 -12
- package/project/.sdk/tm/java/feature/StreamingFeature.java +2 -1
- package/project/.sdk/tm/java/feature/TelemetryFeature.java +17 -9
- package/project/.sdk/tm/java/feature/TestFeature.java +57 -71
- package/project/.sdk/tm/java/feature/TimeoutFeature.java +27 -1
- package/project/.sdk/tm/java/test/FeatureCorpusTest.java +215 -17
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +1 -1
- package/project/.sdk/tm/java/utility/CallerFetchError.java +41 -0
- package/project/.sdk/tm/java/utility/Clean.java +2 -1
- package/project/.sdk/tm/java/utility/Fetcher.java +145 -7
- package/project/.sdk/tm/java/utility/MakeError.java +5 -0
- package/project/.sdk/tm/java/utility/MakeFetchDef.java +3 -0
- package/project/.sdk/tm/java/utility/MakeOptions.java +128 -14
- package/project/.sdk/tm/java/utility/MakePoint.java +24 -0
- package/project/.sdk/tm/java/utility/MakeRequest.java +9 -1
- package/project/.sdk/tm/java/utility/MakeSpec.java +13 -0
- package/project/.sdk/tm/java/utility/Media.java +31 -0
- package/project/.sdk/tm/java/utility/Register.java +4 -1
- package/project/.sdk/tm/java/utility/ResultBody.java +3 -0
- package/project/.sdk/tm/js/src/Control.js +1 -0
- package/project/.sdk/tm/js/src/Response.js +16 -5
- package/project/.sdk/tm/js/src/Result.js +1 -0
- package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +8 -3
- package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +99 -1
- package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +5 -9
- package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +25 -3
- package/project/.sdk/tm/js/src/feature/streaming/StreamingFeature.js +2 -1
- package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +11 -6
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +38 -1
- package/project/.sdk/tm/js/src/utility/CleanUtility.js +1 -1
- package/project/.sdk/tm/js/src/utility/FetcherUtility.js +156 -4
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +55 -6
- package/project/.sdk/tm/js/src/utility/MakePointUtility.js +25 -2
- package/project/.sdk/tm/js/src/utility/MakeSpecUtility.js +15 -0
- package/project/.sdk/tm/js/src/utility/MediaUtility.js +18 -0
- package/project/.sdk/tm/js/src/utility/ResultBodyUtility.js +17 -0
- package/project/.sdk/tm/js/test/feature/Corpus.test.js +122 -26
- package/project/.sdk/tm/js/test/feature.test.js +14 -1
- package/project/.sdk/tm/js/test/live-runner.js +14 -4
- package/project/.sdk/tm/kotlin/core/Context.kt +5 -0
- package/project/.sdk/tm/kotlin/core/Control.kt +7 -0
- package/project/.sdk/tm/kotlin/core/Result.kt +3 -0
- package/project/.sdk/tm/kotlin/core/SdkClient.kt +23 -10
- package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +5 -1
- package/project/.sdk/tm/kotlin/feature/FeatureOptions.kt +39 -0
- package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +22 -0
- package/project/.sdk/tm/kotlin/feature/NetsimFeature.kt +8 -9
- package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +125 -2
- package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +13 -15
- package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +41 -20
- package/project/.sdk/tm/kotlin/feature/StreamingFeature.kt +4 -0
- package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +12 -10
- package/project/.sdk/tm/kotlin/feature/TestFeature.kt +52 -56
- package/project/.sdk/tm/kotlin/feature/TimeoutFeature.kt +25 -1
- package/project/.sdk/tm/kotlin/test/FeatureHarness.kt +1 -0
- package/project/.sdk/tm/kotlin/test/FeatureTest.kt +172 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +1 -1
- package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +2 -1
- package/project/.sdk/tm/kotlin/utility/Fetcher.kt +117 -8
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +109 -15
- package/project/.sdk/tm/kotlin/utility/MakePoint.kt +22 -0
- package/project/.sdk/tm/kotlin/utility/MakeReqRes.kt +8 -1
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +11 -0
- package/project/.sdk/tm/kotlin/utility/Media.kt +20 -0
- package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +1 -0
- package/project/.sdk/tm/lua/core/context.lua +6 -0
- package/project/.sdk/tm/lua/core/control.lua +9 -0
- package/project/.sdk/tm/lua/core/result.lua +2 -0
- package/project/.sdk/tm/lua/feature/base_feature.lua +24 -0
- package/project/.sdk/tm/lua/feature/debug_feature.lua +2 -3
- package/project/.sdk/tm/lua/feature/metrics_feature.lua +5 -0
- package/project/.sdk/tm/lua/feature/netsim_feature.lua +17 -17
- package/project/.sdk/tm/lua/feature/paging_feature.lua +143 -2
- package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +13 -25
- package/project/.sdk/tm/lua/feature/retry_feature.lua +50 -18
- package/project/.sdk/tm/lua/feature/streaming_feature.lua +2 -1
- package/project/.sdk/tm/lua/feature/telemetry_feature.lua +18 -7
- package/project/.sdk/tm/lua/feature/test_feature.lua +74 -77
- package/project/.sdk/tm/lua/test/feature_test.lua +147 -3
- package/project/.sdk/tm/lua/utility/clean.lua +2 -1
- package/project/.sdk/tm/lua/utility/fetcher.lua +8 -3
- package/project/.sdk/tm/lua/utility/make_fetch_def.lua +4 -0
- package/project/.sdk/tm/lua/utility/make_options.lua +55 -13
- package/project/.sdk/tm/lua/utility/make_point.lua +24 -0
- package/project/.sdk/tm/lua/utility/make_request.lua +13 -2
- package/project/.sdk/tm/lua/utility/make_spec.lua +21 -0
- package/project/.sdk/tm/lua/utility/media.lua +33 -0
- package/project/.sdk/tm/lua/utility/result_body.lua +3 -0
- package/project/.sdk/tm/lua/utility/tls.lua +66 -4
- package/project/.sdk/tm/ocaml/sdk_features.ml +320 -77
- package/project/.sdk/tm/ocaml/sdk_helpers.ml +3 -0
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +100 -16
- package/project/.sdk/tm/ocaml/sdk_types.ml +4 -0
- package/project/.sdk/tm/ocaml/test/harness.ml +1 -0
- package/project/.sdk/tm/ocaml/test/t_feature.ml +100 -1
- package/project/.sdk/tm/perl/core/context.pm +3 -0
- package/project/.sdk/tm/perl/core/control.pm +4 -0
- package/project/.sdk/tm/perl/core/helpers.pm +26 -0
- package/project/.sdk/tm/perl/core/result.pm +2 -0
- package/project/.sdk/tm/perl/feature/debug_feature.pm +2 -2
- package/project/.sdk/tm/perl/feature/metrics_feature.pm +5 -0
- package/project/.sdk/tm/perl/feature/netsim_feature.pm +12 -15
- package/project/.sdk/tm/perl/feature/paging_feature.pm +139 -2
- package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +11 -25
- package/project/.sdk/tm/perl/feature/retry_feature.pm +27 -16
- package/project/.sdk/tm/perl/feature/streaming_feature.pm +2 -0
- package/project/.sdk/tm/perl/feature/telemetry_feature.pm +17 -8
- package/project/.sdk/tm/perl/feature/test_feature.pm +55 -62
- package/project/.sdk/tm/perl/feature/timeout_feature.pm +5 -3
- package/project/.sdk/tm/perl/t/feature.t +2 -2
- package/project/.sdk/tm/perl/t/feature_corpus.t +147 -23
- package/project/.sdk/tm/perl/utility/clean.pm +2 -1
- package/project/.sdk/tm/perl/utility/fetcher.pm +66 -2
- package/project/.sdk/tm/perl/utility/make_fetch_def.pm +1 -0
- package/project/.sdk/tm/perl/utility/make_options.pm +33 -10
- package/project/.sdk/tm/perl/utility/make_point.pm +20 -0
- package/project/.sdk/tm/perl/utility/make_request.pm +10 -2
- package/project/.sdk/tm/perl/utility/make_spec.pm +17 -0
- package/project/.sdk/tm/perl/utility/media.pm +25 -0
- package/project/.sdk/tm/perl/utility/result_body.pm +3 -0
- package/project/.sdk/tm/php/core/Context.php +6 -0
- package/project/.sdk/tm/php/core/Control.php +12 -0
- package/project/.sdk/tm/php/core/Result.php +4 -0
- package/project/.sdk/tm/php/feature/BaseFeature.php +31 -0
- package/project/.sdk/tm/php/feature/MetricsFeature.php +8 -0
- package/project/.sdk/tm/php/feature/NetsimFeature.php +17 -15
- package/project/.sdk/tm/php/feature/PagingFeature.php +128 -1
- package/project/.sdk/tm/php/feature/RatelimitFeature.php +13 -23
- package/project/.sdk/tm/php/feature/RetryFeature.php +31 -13
- package/project/.sdk/tm/php/feature/StreamingFeature.php +2 -1
- package/project/.sdk/tm/php/feature/TelemetryFeature.php +10 -7
- package/project/.sdk/tm/php/feature/TestFeature.php +69 -61
- package/project/.sdk/tm/php/test/FeatureCorpusTest.php +175 -16
- package/project/.sdk/tm/php/test/FeatureTest.php +3 -1
- package/project/.sdk/tm/php/test/StructUtilityTest.php +5 -0
- package/project/.sdk/tm/php/utility/Clean.php +2 -1
- package/project/.sdk/tm/php/utility/Fetcher.php +111 -5
- package/project/.sdk/tm/php/utility/MakeFetchDef.php +3 -0
- package/project/.sdk/tm/php/utility/MakeOptions.php +40 -13
- package/project/.sdk/tm/php/utility/MakePoint.php +23 -0
- package/project/.sdk/tm/php/utility/MakeRequest.php +11 -2
- package/project/.sdk/tm/php/utility/MakeSpec.php +21 -0
- package/project/.sdk/tm/php/utility/Media.php +28 -0
- package/project/.sdk/tm/php/utility/ResultBody.php +3 -0
- package/project/.sdk/tm/py/pkg/core/context.py +4 -0
- package/project/.sdk/tm/py/pkg/core/control.py +9 -0
- package/project/.sdk/tm/py/pkg/core/result.py +2 -0
- package/project/.sdk/tm/py/pkg/feature/base_feature.py +23 -0
- package/project/.sdk/tm/py/pkg/feature/metrics_feature.py +7 -0
- package/project/.sdk/tm/py/pkg/feature/netsim_feature.py +13 -14
- package/project/.sdk/tm/py/pkg/feature/paging_feature.py +86 -1
- package/project/.sdk/tm/py/pkg/feature/ratelimit_feature.py +20 -27
- package/project/.sdk/tm/py/pkg/feature/retry_feature.py +39 -16
- package/project/.sdk/tm/py/pkg/feature/streaming_feature.py +2 -1
- package/project/.sdk/tm/py/pkg/feature/telemetry_feature.py +10 -6
- package/project/.sdk/tm/py/pkg/feature/test_feature.py +67 -66
- package/project/.sdk/tm/py/pkg/utility/clean.py +2 -1
- package/project/.sdk/tm/py/pkg/utility/fetcher.py +451 -95
- package/project/.sdk/tm/py/pkg/utility/make_fetch_def.py +3 -0
- package/project/.sdk/tm/py/pkg/utility/make_options.py +68 -20
- package/project/.sdk/tm/py/pkg/utility/make_point.py +24 -3
- package/project/.sdk/tm/py/pkg/utility/make_request.py +11 -2
- package/project/.sdk/tm/py/pkg/utility/make_spec.py +16 -0
- package/project/.sdk/tm/py/pkg/utility/media.py +25 -0
- package/project/.sdk/tm/py/pkg/utility/requests_fetch.py +93 -0
- package/project/.sdk/tm/py/pkg/utility/result_body.py +2 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +1 -24
- package/project/.sdk/tm/py/test/test_feature.py +11 -1
- package/project/.sdk/tm/py/test/test_feature_corpus.py +134 -16
- package/project/.sdk/tm/py/test/test_primary_utility.py +242 -48
- package/project/.sdk/tm/py-data/pkg/fetch.py +6 -3
- package/project/.sdk/tm/py-data/test/test_fetch.py +7 -4
- package/project/.sdk/tm/rb/core/context.rb +5 -3
- package/project/.sdk/tm/rb/core/control.rb +9 -1
- package/project/.sdk/tm/rb/core/operation.rb +5 -5
- package/project/.sdk/tm/rb/core/response.rb +7 -7
- package/project/.sdk/tm/rb/core/result.rb +11 -9
- package/project/.sdk/tm/rb/feature/base_feature.rb +22 -0
- package/project/.sdk/tm/rb/feature/cost_feature.rb +1 -1
- package/project/.sdk/tm/rb/feature/debug_feature.rb +2 -2
- package/project/.sdk/tm/rb/feature/metrics_feature.rb +8 -0
- package/project/.sdk/tm/rb/feature/netsim_feature.rb +7 -13
- package/project/.sdk/tm/rb/feature/paging_feature.rb +94 -8
- package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +17 -27
- package/project/.sdk/tm/rb/feature/retry_feature.rb +24 -13
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +4 -4
- package/project/.sdk/tm/rb/feature/streaming_feature.rb +2 -1
- package/project/.sdk/tm/rb/feature/telemetry_feature.rb +11 -6
- package/project/.sdk/tm/rb/feature/test_feature.rb +80 -94
- package/project/.sdk/tm/rb/feature/validate_feature.rb +2 -2
- package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +1 -1
- package/project/.sdk/tm/rb/test/feature_corpus_test.rb +128 -24
- package/project/.sdk/tm/rb/test/feature_test.rb +3 -3
- package/project/.sdk/tm/rb/test/omni.rb +7 -7
- package/project/.sdk/tm/rb/test/pipeline_test.rb +1 -1
- package/project/.sdk/tm/rb/test/runner.rb +1 -1
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +120 -120
- package/project/.sdk/tm/rb/utility/clean.rb +6 -4
- package/project/.sdk/tm/rb/utility/feature_init.rb +2 -2
- package/project/.sdk/tm/rb/utility/fetcher.rb +52 -7
- package/project/.sdk/tm/rb/utility/graphql.rb +13 -13
- package/project/.sdk/tm/rb/utility/make_fetch_def.rb +1 -0
- package/project/.sdk/tm/rb/utility/make_options.rb +43 -22
- package/project/.sdk/tm/rb/utility/make_point.rb +38 -20
- package/project/.sdk/tm/rb/utility/make_request.rb +11 -2
- package/project/.sdk/tm/rb/utility/make_spec.rb +23 -6
- package/project/.sdk/tm/rb/utility/make_url.rb +6 -6
- package/project/.sdk/tm/rb/utility/media.rb +30 -11
- package/project/.sdk/tm/rb/utility/param.rb +18 -18
- package/project/.sdk/tm/rb/utility/prepare_body.rb +6 -6
- package/project/.sdk/tm/rb/utility/prepare_headers.rb +8 -8
- package/project/.sdk/tm/rb/utility/prepare_method.rb +1 -1
- package/project/.sdk/tm/rb/utility/prepare_params.rb +3 -3
- package/project/.sdk/tm/rb/utility/prepare_path.rb +2 -2
- package/project/.sdk/tm/rb/utility/prepare_query.rb +12 -12
- package/project/.sdk/tm/rb/utility/result_body.rb +1 -0
- package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +31 -31
- package/project/.sdk/tm/rb/utility/transform_request.rb +5 -5
- package/project/.sdk/tm/rb/utility/transform_response.rb +3 -3
- package/project/.sdk/tm/rust/core/context.rs +6 -0
- package/project/.sdk/tm/rust/core/control.rs +11 -0
- package/project/.sdk/tm/rust/core/helpers.rs +4 -0
- package/project/.sdk/tm/rust/core/result.rs +9 -0
- package/project/.sdk/tm/rust/feature/audit.rs +2 -2
- package/project/.sdk/tm/rust/feature/metrics.rs +24 -1
- package/project/.sdk/tm/rust/feature/netsim.rs +11 -6
- package/project/.sdk/tm/rust/feature/paging.rs +189 -3
- package/project/.sdk/tm/rust/feature/ratelimit.rs +11 -16
- package/project/.sdk/tm/rust/feature/retry.rs +62 -9
- package/project/.sdk/tm/rust/feature/streaming.rs +3 -2
- package/project/.sdk/tm/rust/feature/support.rs +36 -1
- package/project/.sdk/tm/rust/feature/telemetry.rs +22 -11
- package/project/.sdk/tm/rust/feature/test.rs +73 -62
- package/project/.sdk/tm/rust/tests/common/mod.rs +6 -0
- package/project/.sdk/tm/rust/tests/feature_test.rs +257 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +1 -0
- package/project/.sdk/tm/rust/utility/fetcher.rs +164 -17
- package/project/.sdk/tm/rust/utility/make_error.rs +10 -0
- package/project/.sdk/tm/rust/utility/make_fetch_def.rs +7 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +122 -27
- package/project/.sdk/tm/rust/utility/make_point.rs +37 -0
- package/project/.sdk/tm/rust/utility/make_request.rs +13 -1
- package/project/.sdk/tm/rust/utility/make_spec.rs +27 -0
- package/project/.sdk/tm/rust/utility/media.rs +20 -0
- package/project/.sdk/tm/rust/utility/result_body.rs +3 -0
- package/project/.sdk/tm/scala/core/Context.scala +2 -0
- package/project/.sdk/tm/scala/core/Control.scala +7 -0
- package/project/.sdk/tm/scala/core/Result.scala +3 -0
- package/project/.sdk/tm/scala/core/SdkClient.scala +45 -11
- package/project/.sdk/tm/scala/feature/AuditFeature.scala +6 -1
- package/project/.sdk/tm/scala/feature/FeatureOptions.scala +30 -0
- package/project/.sdk/tm/scala/feature/MetricsFeature.scala +31 -1
- package/project/.sdk/tm/scala/feature/NetsimFeature.scala +9 -8
- package/project/.sdk/tm/scala/feature/PagingFeature.scala +122 -2
- package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +16 -13
- package/project/.sdk/tm/scala/feature/RetryFeature.scala +35 -12
- package/project/.sdk/tm/scala/feature/StreamingFeature.scala +2 -1
- package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +12 -10
- package/project/.sdk/tm/scala/feature/TestFeature.scala +52 -51
- package/project/.sdk/tm/scala/feature/TimeoutFeature.scala +19 -1
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +72 -2
- package/project/.sdk/tm/scala/utility/Fetcher.scala +99 -8
- package/project/.sdk/tm/scala/utility/Make.scala +163 -16
- package/project/.sdk/tm/scala/utility/MakeSpec.scala +14 -0
- package/project/.sdk/tm/scala/utility/Media.scala +27 -0
- package/project/.sdk/tm/scala/utility/Misc.scala +2 -1
- package/project/.sdk/tm/scala/utility/Results.scala +3 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +2 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Control.swift +7 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Result.swift +3 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +3 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/FeatureOptions.swift +32 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +20 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/NetsimFeature.swift +8 -9
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +102 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +16 -15
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +45 -11
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/StreamingFeature.swift +2 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +11 -9
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +63 -56
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TimeoutFeature.swift +21 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +149 -4
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +42 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +51 -13
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Media.swift +17 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +2 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +165 -0
- package/project/.sdk/tm/ts/src/Control.ts +3 -0
- package/project/.sdk/tm/ts/src/Response.ts +17 -5
- package/project/.sdk/tm/ts/src/Result.ts +3 -0
- package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +5 -0
- package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +99 -1
- package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +5 -9
- package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +25 -3
- package/project/.sdk/tm/ts/src/feature/streaming/StreamingFeature.ts +2 -1
- package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +11 -6
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +8 -7
- package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +1 -1
- package/project/.sdk/tm/ts/src/utility/FetcherUtility.ts +156 -4
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +57 -6
- package/project/.sdk/tm/ts/src/utility/MakePointUtility.ts +24 -2
- package/project/.sdk/tm/ts/src/utility/MakeSpecUtility.ts +15 -0
- package/project/.sdk/tm/ts/src/utility/MediaUtility.ts +18 -0
- package/project/.sdk/tm/ts/src/utility/ResultBodyUtility.ts +17 -0
- package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +122 -26
- package/project/.sdk/tm/ts/test/feature.test.ts +14 -1
- package/project/.sdk/tm/ts/test/live-runner.ts +15 -4
- package/project/.sdk/tm/zig/core/context.zig +2 -0
- package/project/.sdk/tm/zig/core/control.zig +27 -0
- package/project/.sdk/tm/zig/core/result.zig +4 -0
- package/project/.sdk/tm/zig/core/utility.zig +185 -10
- package/project/.sdk/tm/zig/feature/metrics.zig +19 -0
- package/project/.sdk/tm/zig/feature/netsim.zig +5 -5
- package/project/.sdk/tm/zig/feature/paging.zig +172 -4
- package/project/.sdk/tm/zig/feature/ratelimit.zig +8 -14
- package/project/.sdk/tm/zig/feature/retry.zig +45 -7
- package/project/.sdk/tm/zig/feature/streaming.zig +2 -0
- package/project/.sdk/tm/zig/feature/support.zig +24 -0
- package/project/.sdk/tm/zig/feature/telemetry.zig +15 -9
- package/project/.sdk/tm/zig/feature/test.zig +60 -44
- package/project/.sdk/tm/zig/test/feature_test.zig +171 -0
- package/project/.sdk/tm/zig/test/fh.zig +1 -0
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +2 -0
- package/project/sdkgen-package.json +1 -1
- package/src/action/check.ts +20 -0
- package/src/action/doctor.ts +1 -1
- package/src/action/resolve.ts +15 -3
- package/src/cmp/Deploy.ts +22 -7
- package/src/cmp/License.ts +7 -0
- package/src/cmp/ReadmeExplanation.ts +5 -2
- package/src/cmp/ReadmeFeatures.ts +21 -6
- package/src/helpers/clientOptions.ts +1 -0
- package/src/helpers/definitionPlan.ts +3 -3
- package/src/helpers/doccheck.ts +34 -11
- package/src/helpers/modelcheck.ts +67 -0
- package/src/helpers/naming.ts +1 -1
- package/src/helpers/opShape.ts +12 -3
- package/src/helpers/optspec.ts +2 -2
- package/src/helpers/packageMeta.ts +5 -7
- package/src/helpers/targetrun.ts +214 -0
- package/src/helpers/testPolicy.ts +14 -4
- package/src/sdkgen.ts +33 -11
- package/src/utility.ts +24 -0
|
@@ -147,27 +147,8 @@ function TestFeature:init(ctx, options)
|
|
|
147
147
|
entmap = {}
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
-
-- For single-entity ops (load, remove) with an empty explicit match, fall
|
|
151
|
-
-- back to the id the entity client already knows from a prior create/load
|
|
152
|
-
-- (in fctx.match / fctx.data). Mirrors the TS mock where param() resolves
|
|
153
|
-
-- the id from that accumulated state.
|
|
154
|
-
local function resolve_match(explicit)
|
|
155
|
-
if type(explicit) == "table" and next(explicit) ~= nil then
|
|
156
|
-
return explicit
|
|
157
|
-
end
|
|
158
|
-
local function id_of(src)
|
|
159
|
-
if src == nil then return nil end
|
|
160
|
-
local v = vs.getprop(src, "id")
|
|
161
|
-
if v ~= nil and v ~= "__UNDEFINED__" then return v end
|
|
162
|
-
return nil
|
|
163
|
-
end
|
|
164
|
-
local v = id_of(fctx.match) or id_of(fctx.data)
|
|
165
|
-
if v ~= nil then return { id = v } end
|
|
166
|
-
return {}
|
|
167
|
-
end
|
|
168
|
-
|
|
169
150
|
if op.name == "load" then
|
|
170
|
-
local args = test_self:build_args(fctx, op,
|
|
151
|
+
local args = test_self:build_args(fctx, op, fctx.reqmatch)
|
|
171
152
|
local found = vs.select(entmap, args)
|
|
172
153
|
local ent = vs.getelem(found, 0)
|
|
173
154
|
if ent == nil then
|
|
@@ -192,26 +173,7 @@ function TestFeature:init(ctx, options)
|
|
|
192
173
|
return respond(200, out, nil)
|
|
193
174
|
|
|
194
175
|
elseif op.name == "update" or op.name == "patch" then
|
|
195
|
-
|
|
196
|
-
-- contains the new field values, which would otherwise cause select
|
|
197
|
-
-- to filter out the entity we want to update. When reqdata has no id,
|
|
198
|
-
-- fall back to the id the entity client carries from a prior
|
|
199
|
-
-- create/load (in fctx.match / fctx.data), mirroring the TS mock
|
|
200
|
-
-- where param(ctx,'id') resolves from accumulated state.
|
|
201
|
-
local update_match = {}
|
|
202
|
-
if type(fctx.reqdata) == "table" then
|
|
203
|
-
if fctx.reqdata["id"] ~= nil then update_match["id"] = fctx.reqdata["id"] end
|
|
204
|
-
if op.alias_map ~= nil then
|
|
205
|
-
local alias_id = vs.getprop(op.alias_map, "id")
|
|
206
|
-
if alias_id ~= nil and fctx.reqdata[alias_id] ~= nil then
|
|
207
|
-
update_match[alias_id] = fctx.reqdata[alias_id]
|
|
208
|
-
end
|
|
209
|
-
end
|
|
210
|
-
end
|
|
211
|
-
if next(update_match) == nil then
|
|
212
|
-
update_match = resolve_match({})
|
|
213
|
-
end
|
|
214
|
-
local args = test_self:build_args(fctx, op, update_match)
|
|
176
|
+
local args = test_self:build_args(fctx, op, record(fctx.reqdata))
|
|
215
177
|
local found = vs.select(entmap, args)
|
|
216
178
|
local ent = vs.getelem(found, 0)
|
|
217
179
|
if ent == nil then
|
|
@@ -226,7 +188,7 @@ function TestFeature:init(ctx, options)
|
|
|
226
188
|
return respond(200, out, nil)
|
|
227
189
|
|
|
228
190
|
elseif op.name == "remove" then
|
|
229
|
-
local args = test_self:build_args(fctx, op,
|
|
191
|
+
local args = test_self:build_args(fctx, op, fctx.reqmatch)
|
|
230
192
|
local found = vs.select(entmap, args)
|
|
231
193
|
local ent = vs.getelem(found, 0)
|
|
232
194
|
-- Remove only the first matched entity. If nothing matches,
|
|
@@ -307,17 +269,8 @@ function TestFeature:make_netsim(net, inner)
|
|
|
307
269
|
return min + math.floor((max - min) / 2)
|
|
308
270
|
end
|
|
309
271
|
|
|
310
|
-
local function sleep(ms)
|
|
311
|
-
|
|
312
|
-
return
|
|
313
|
-
end
|
|
314
|
-
if type(net["sleep"]) == "function" then
|
|
315
|
-
net["sleep"](ms)
|
|
316
|
-
return
|
|
317
|
-
end
|
|
318
|
-
-- Portable stdlib-only wait: spin on the CPU clock.
|
|
319
|
-
local target = os.clock() + (ms / 1000)
|
|
320
|
-
while os.clock() < target do end
|
|
272
|
+
local function sleep(ms, fetchdef)
|
|
273
|
+
return test_self:_wait(ms, net["sleep"], fetchdef)
|
|
321
274
|
end
|
|
322
275
|
|
|
323
276
|
return function(fctx, fullurl, fetchdef)
|
|
@@ -325,19 +278,25 @@ function TestFeature:make_netsim(net, inner)
|
|
|
325
278
|
local call = test_self._netcalls
|
|
326
279
|
|
|
327
280
|
if net["offline"] == true then
|
|
328
|
-
sleep(pick_latency())
|
|
281
|
+
if sleep(pick_latency(), fetchdef) then
|
|
282
|
+
return nil, test_self:_aborted(fctx)
|
|
283
|
+
end
|
|
329
284
|
return nil, fctx:make_error("netsim_offline",
|
|
330
285
|
'Simulated network offline (URL was: "' .. fullurl .. '")')
|
|
331
286
|
end
|
|
332
287
|
|
|
333
288
|
if call <= math.floor(tonumber(net["errorTimes"]) or 0) then
|
|
334
|
-
sleep(pick_latency())
|
|
289
|
+
if sleep(pick_latency(), fetchdef) then
|
|
290
|
+
return nil, test_self:_aborted(fctx)
|
|
291
|
+
end
|
|
335
292
|
return nil, fctx:make_error("netsim_conn",
|
|
336
293
|
"Simulated connection error (call " .. call .. ")")
|
|
337
294
|
end
|
|
338
295
|
|
|
339
296
|
if call <= math.floor(tonumber(net["failTimes"]) or 0) then
|
|
340
|
-
sleep(pick_latency())
|
|
297
|
+
if sleep(pick_latency(), fetchdef) then
|
|
298
|
+
return nil, test_self:_aborted(fctx)
|
|
299
|
+
end
|
|
341
300
|
local status = net["failStatus"] == nil and 503 or net["failStatus"]
|
|
342
301
|
return {
|
|
343
302
|
status = status,
|
|
@@ -348,7 +307,9 @@ function TestFeature:make_netsim(net, inner)
|
|
|
348
307
|
}, nil
|
|
349
308
|
end
|
|
350
309
|
|
|
351
|
-
sleep(pick_latency())
|
|
310
|
+
if sleep(pick_latency(), fetchdef) then
|
|
311
|
+
return nil, test_self:_aborted(fctx)
|
|
312
|
+
end
|
|
352
313
|
return inner(fctx, fullurl, fetchdef)
|
|
353
314
|
end
|
|
354
315
|
end
|
|
@@ -382,6 +343,12 @@ local function pick_point(points)
|
|
|
382
343
|
return point
|
|
383
344
|
end
|
|
384
345
|
|
|
346
|
+
local function held(src, key)
|
|
347
|
+
if src == nil then return false end
|
|
348
|
+
local v = vs.getprop(src, key)
|
|
349
|
+
return v ~= nil and v ~= "__UNDEFINED__"
|
|
350
|
+
end
|
|
351
|
+
|
|
385
352
|
function TestFeature:build_args(ctx, op, args)
|
|
386
353
|
local opname = op.name
|
|
387
354
|
|
|
@@ -400,29 +367,59 @@ function TestFeature:build_args(ctx, op, args)
|
|
|
400
367
|
local qand = {}
|
|
401
368
|
local q = { ["`$AND`"] = qand }
|
|
402
369
|
|
|
370
|
+
local ename = ctx.entity:get_name()
|
|
371
|
+
local idfrom = vs.getpath(ctx.config, "entity." .. ename .. ".id.from")
|
|
372
|
+
|
|
373
|
+
local names = {}
|
|
403
374
|
if args ~= nil then
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
375
|
+
for _, key in ipairs(vs.keysof(args) or {}) do table.insert(names, key) end
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
-- With no id in the call, the entity's held id (or composite parts) stands in.
|
|
379
|
+
if not held(args, "id") then
|
|
380
|
+
local parts = vs.getpath(ctx.config, "entity." .. ename .. ".id.parts")
|
|
381
|
+
if not vs.islist(parts) then
|
|
382
|
+
parts = (opname == "list") and {} or { "id" }
|
|
383
|
+
end
|
|
384
|
+
for _, part in ipairs(parts) do
|
|
385
|
+
local pname = tostring(part)
|
|
386
|
+
local seen = false
|
|
387
|
+
for _, n in ipairs(names) do seen = seen or n == pname end
|
|
388
|
+
if not seen and (held(ctx.match, pname) or held(ctx.data, pname)) then
|
|
389
|
+
table.insert(names, pname)
|
|
390
|
+
end
|
|
391
|
+
end
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
for _, key in ipairs(names) do
|
|
395
|
+
local is_id = (key == "id")
|
|
396
|
+
local is_reqd = not vs.isempty(vs.select(reqd_from_params, key))
|
|
397
|
+
or not vs.isempty(vs.select(reqd_from_query, key))
|
|
398
|
+
|
|
399
|
+
if is_id or is_reqd then
|
|
400
|
+
local v = ctx.utility.param(ctx, key)
|
|
401
|
+
local ka = nil
|
|
402
|
+
if op.alias ~= nil then
|
|
403
|
+
ka = vs.getprop(op.alias, key)
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
local qor = { { [key] = v } }
|
|
407
|
+
if ka ~= nil and type(ka) == "string" then
|
|
408
|
+
table.insert(qor, { [ka] = v })
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
-- An alternative, never a replacement: a seed keeping the parameter
|
|
412
|
+
-- flat is still found.
|
|
413
|
+
local kf = idfrom ~= nil and vs.getprop(idfrom, key) or nil
|
|
414
|
+
if type(kf) == "string" and kf ~= key then
|
|
415
|
+
local segs = {}
|
|
416
|
+
for seg in string.gmatch(kf, "[^.]+") do table.insert(segs, seg) end
|
|
417
|
+
local nest = v
|
|
418
|
+
for i = #segs, 1, -1 do nest = { [segs[i]] = nest } end
|
|
419
|
+
table.insert(qor, nest)
|
|
425
420
|
end
|
|
421
|
+
|
|
422
|
+
table.insert(qand, { ["`$OR`"] = qor })
|
|
426
423
|
end
|
|
427
424
|
end
|
|
428
425
|
|
|
@@ -315,6 +315,7 @@ local function make_client(spec)
|
|
|
315
315
|
method = ctx.spec.method,
|
|
316
316
|
headers = ctx.spec.headers,
|
|
317
317
|
body = ctx.spec.body,
|
|
318
|
+
signal = ctx.ctrl.signal,
|
|
318
319
|
}
|
|
319
320
|
response, rerr = utility.fetcher(ctx, fetchdef.url, fetchdef)
|
|
320
321
|
end
|
|
@@ -556,6 +557,52 @@ describe("feature", function()
|
|
|
556
557
|
-- Lua transports are synchronous: the timeout feature applies a
|
|
557
558
|
-- wall-clock deadline after the attempt rather than racing it, so the
|
|
558
559
|
-- shared virtual clock stands in for elapsed transport time.
|
|
560
|
+
-- A signal answering true soon after the call starts ends each wait at once,
|
|
561
|
+
-- and the call fails as request_aborted. The waits spin on os.clock, so the
|
|
562
|
+
-- signal does.
|
|
563
|
+
describe("cancel", function()
|
|
564
|
+
|
|
565
|
+
local function cancelling()
|
|
566
|
+
local finish = os.clock() + 0.05
|
|
567
|
+
return { signal = function() return os.clock() >= finish end }
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
local function assert_aborted(res, started)
|
|
571
|
+
assert.is_false(res.ok)
|
|
572
|
+
assert.are.equal("request_aborted", res.error.code)
|
|
573
|
+
assert.is_true(os.clock() - started < 5)
|
|
574
|
+
end
|
|
575
|
+
|
|
576
|
+
if has_feature("retry") then it("a cancel ends the retry backoff", function()
|
|
577
|
+
local rec = recording_server(function() return make_response(503) end)
|
|
578
|
+
local h = make_client({ features = {
|
|
579
|
+
{ name = "retry", options = {
|
|
580
|
+
retries = 3, minDelay = 20000, maxDelay = 20000, jitter = false } },
|
|
581
|
+
}, server = rec.server })
|
|
582
|
+
local started = os.clock()
|
|
583
|
+
assert_aborted(h.op({ op = "load", ctrl = cancelling() }), started)
|
|
584
|
+
assert.are.equal(1, #rec.calls)
|
|
585
|
+
end) end
|
|
586
|
+
|
|
587
|
+
if has_feature("netsim") then it("a cancel ends the netsim latency", function()
|
|
588
|
+
local h = make_client({ features = {
|
|
589
|
+
{ name = "netsim", options = { latency = 20000 } },
|
|
590
|
+
} })
|
|
591
|
+
local started = os.clock()
|
|
592
|
+
assert_aborted(h.op({ op = "load", ctrl = cancelling() }), started)
|
|
593
|
+
end) end
|
|
594
|
+
|
|
595
|
+
if has_feature("ratelimit") then it("a cancel ends the ratelimit wait", function()
|
|
596
|
+
local h = make_client({ features = {
|
|
597
|
+
{ name = "ratelimit", options = { rate = 0.05, burst = 1 } },
|
|
598
|
+
} })
|
|
599
|
+
assert.is_true(h.op({ op = "load" }).ok)
|
|
600
|
+
local started = os.clock()
|
|
601
|
+
assert_aborted(h.op({ op = "load", ctrl = cancelling() }), started)
|
|
602
|
+
end) end
|
|
603
|
+
|
|
604
|
+
end)
|
|
605
|
+
|
|
559
606
|
if has_feature("timeout") then describe("timeout", function()
|
|
560
607
|
|
|
561
608
|
if has_feature("netsim") then it("a slow request times out", function()
|
|
@@ -990,7 +1037,11 @@ describe("feature", function()
|
|
|
990
1037
|
it("default id generation and no exporter", function()
|
|
991
1038
|
local h = make_client({ features = { { name = "telemetry" } } })
|
|
992
1039
|
h.op({ op = "load" })
|
|
993
|
-
|
|
1040
|
+
local span = h.client._telemetry.spans[1]
|
|
1041
|
+
assert.is_truthy(string.match(span.traceId, "^" .. string.rep("[0-9a-f]", 32) .. "$"))
|
|
1042
|
+
assert.is_truthy(string.match(span.traceId, "[^0]"))
|
|
1043
|
+
assert.is_truthy(string.match(span.spanId, "^" .. string.rep("[0-9a-f]", 16) .. "$"))
|
|
1044
|
+
assert.is_truthy(string.match(span.spanId, "[^0]"))
|
|
994
1045
|
end)
|
|
995
1046
|
|
|
996
1047
|
it("injected idgen + clock", function()
|
|
@@ -1017,11 +1068,11 @@ describe("feature", function()
|
|
|
1017
1068
|
-- debug -----------------------------------------------------------------
|
|
1018
1069
|
if has_feature("debug") then describe("debug", function()
|
|
1019
1070
|
|
|
1020
|
-
it("captures a redacted trace and honours
|
|
1071
|
+
it("captures a redacted trace and honours onEntry + max", function()
|
|
1021
1072
|
local seen = {}
|
|
1022
1073
|
local h = make_client({ features = {
|
|
1023
1074
|
{ name = "debug", options = {
|
|
1024
|
-
max = 1,
|
|
1075
|
+
max = 1, onEntry = function(e) table.insert(seen, e) end } },
|
|
1025
1076
|
} })
|
|
1026
1077
|
h.op({ op = "load", headers = { authorization = "Bearer secret" } })
|
|
1027
1078
|
h.op({ op = "list" })
|
|
@@ -1229,6 +1280,82 @@ describe("feature", function()
|
|
|
1229
1280
|
assert.is_true(res.result.paging.hasMore)
|
|
1230
1281
|
end)
|
|
1231
1282
|
|
|
1283
|
+
-- The documented hasMore loop, one request per page.
|
|
1284
|
+
local function walk(reply, options)
|
|
1285
|
+
local rec = recording_server(reply)
|
|
1286
|
+
local h = make_client({ features = { { name = "paging", options = options } }, server = rec.server })
|
|
1287
|
+
local paging = {}
|
|
1288
|
+
local ctrl = { paging = paging }
|
|
1289
|
+
h.op({ op = "list", path = "/w", ctrl = ctrl })
|
|
1290
|
+
while paging.hasMore == true and #rec.calls < 4 do
|
|
1291
|
+
h.op({ op = "list", path = "/w", ctrl = ctrl })
|
|
1292
|
+
end
|
|
1293
|
+
local urls = {}
|
|
1294
|
+
for i, call in ipairs(rec.calls) do urls[i] = call.url end
|
|
1295
|
+
return urls, paging
|
|
1296
|
+
end
|
|
1297
|
+
|
|
1298
|
+
it("a body next that is not a URL is sent back as the cursor", function()
|
|
1299
|
+
local pages = { "c3", "c6" }
|
|
1300
|
+
local urls, paging = walk(function(n) return make_response(200, { next = pages[n] }) end)
|
|
1301
|
+
assert.are.same({ "http://api.test/w?page=1", "http://api.test/w?cursor=c3",
|
|
1302
|
+
"http://api.test/w?cursor=c6" }, urls)
|
|
1303
|
+
assert.is_false(paging.hasMore)
|
|
1304
|
+
end)
|
|
1305
|
+
|
|
1306
|
+
it("a body next URL is the next request", function()
|
|
1307
|
+
local pages = { "http://api.test/v2/w?cursor=c%2F3&limit=3", "/v2/w?cursor=c6" }
|
|
1308
|
+
local urls, paging = walk(function(n) return make_response(200, { next = pages[n] }) end)
|
|
1309
|
+
assert.are.same({ "http://api.test/w?page=1", "http://api.test/v2/w?cursor=c%2F3&limit=3",
|
|
1310
|
+
"http://api.test/v2/w?cursor=c6" }, urls)
|
|
1311
|
+
assert.is_false(paging.hasMore)
|
|
1312
|
+
end)
|
|
1313
|
+
|
|
1314
|
+
it("a Link next URL is the next request", function()
|
|
1315
|
+
local links = { '<http://api.test/w?after=b3>; rel="next"', '</w?after=b6>; rel="next"' }
|
|
1316
|
+
local urls, paging = walk(function(n)
|
|
1317
|
+
return make_response(200, {}, links[n] and { link = links[n] } or nil)
|
|
1318
|
+
end)
|
|
1319
|
+
assert.are.same({ "http://api.test/w?page=1", "http://api.test/w?after=b3",
|
|
1320
|
+
"http://api.test/w?after=b6" }, urls)
|
|
1321
|
+
assert.is_false(paging.hasMore)
|
|
1322
|
+
end)
|
|
1323
|
+
|
|
1324
|
+
it("a query-only Link keeps the path", function()
|
|
1325
|
+
local links = { '</v1/items?page=2>; rel="next"', '<?page=3>; rel="next"' }
|
|
1326
|
+
local urls = walk(function(n)
|
|
1327
|
+
return make_response(200, {}, links[n] and { link = links[n] } or nil)
|
|
1328
|
+
end)
|
|
1329
|
+
assert.are.same({ "http://api.test/w?page=1", "http://api.test/v1/items?page=2",
|
|
1330
|
+
"http://api.test/v1/items?page=3" }, urls)
|
|
1331
|
+
end)
|
|
1332
|
+
|
|
1333
|
+
it("a path-relative Link resolves against the request", function()
|
|
1334
|
+
local links = { '</v1/items?page=2>; rel="next"', '<more?page=3>; rel="next"' }
|
|
1335
|
+
local urls = walk(function(n)
|
|
1336
|
+
return make_response(200, {}, links[n] and { link = links[n] } or nil)
|
|
1337
|
+
end)
|
|
1338
|
+
assert.are.same({ "http://api.test/w?page=1", "http://api.test/v1/items?page=2",
|
|
1339
|
+
"http://api.test/v1/more?page=3" }, urls)
|
|
1340
|
+
end)
|
|
1341
|
+
|
|
1342
|
+
it("a link to another origin ends the walk", function()
|
|
1343
|
+
local urls, paging = walk(function()
|
|
1344
|
+
return make_response(200, {}, { link = '<https://elsewhere.test/w?after=b3>; rel="next"' })
|
|
1345
|
+
end)
|
|
1346
|
+
assert.are.same({ "http://api.test/w?page=1" }, urls)
|
|
1347
|
+
assert.is_false(paging.hasMore)
|
|
1348
|
+
assert.are.equal("https://elsewhere.test/w?after=b3", paging.foreign)
|
|
1349
|
+
end)
|
|
1350
|
+
|
|
1351
|
+
it("next cursor sends a value starting with a slash as the cursor", function()
|
|
1352
|
+
local pages = { "/c3" }
|
|
1353
|
+
local urls, paging = walk(function(n) return make_response(200, { next = pages[n] }) end,
|
|
1354
|
+
{ next = "cursor" })
|
|
1355
|
+
assert.are.same({ "http://api.test/w?page=1", "http://api.test/w?cursor=%2Fc3" }, urls)
|
|
1356
|
+
assert.is_false(paging.hasMore)
|
|
1357
|
+
end)
|
|
1358
|
+
|
|
1232
1359
|
it("non-list op is not paged", function()
|
|
1233
1360
|
local rec = recording_server()
|
|
1234
1361
|
local h = make_client({ features = {
|
|
@@ -1285,6 +1412,23 @@ describe("feature", function()
|
|
|
1285
1412
|
assert.are.same({ { 1, 2 }, { 3, 4 }, { 5 } }, batches)
|
|
1286
1413
|
end)
|
|
1287
1414
|
|
|
1415
|
+
it("a failed result keeps no stream", function()
|
|
1416
|
+
local rec = recording_server(function() return make_response(503, {}) end)
|
|
1417
|
+
local h = make_client({ features = { { name = "streaming" } }, server = rec.server })
|
|
1418
|
+
local res = h.op({ op = "list", path = "/w" })
|
|
1419
|
+
assert.is_nil(res.result.stream)
|
|
1420
|
+
assert.is_nil(res.result.streaming)
|
|
1421
|
+
end)
|
|
1422
|
+
|
|
1423
|
+
it("an empty list streams nothing", function()
|
|
1424
|
+
local rec = recording_server(function() return make_response(200, {}) end)
|
|
1425
|
+
local h = make_client({ features = { { name = "streaming" } }, server = rec.server })
|
|
1426
|
+
local res = h.op({ op = "list", path = "/w" })
|
|
1427
|
+
local seen = {}
|
|
1428
|
+
for item in res.result.stream() do table.insert(seen, item) end
|
|
1429
|
+
assert.are.same({}, seen)
|
|
1430
|
+
end)
|
|
1431
|
+
|
|
1288
1432
|
it("non-list op is not streamed", function()
|
|
1289
1433
|
local h = make_client({ features = { { name = "streaming" } } })
|
|
1290
1434
|
local res = h.op({ op = "load" })
|
|
@@ -322,7 +322,8 @@ local function binary_bodies(ctx, cfg)
|
|
|
322
322
|
if type(response) == "table" then
|
|
323
323
|
local ctype = media.header_value(response.headers, "content-type")
|
|
324
324
|
if media.is_binary_response(ctx.point, ctype) then
|
|
325
|
-
|
|
325
|
+
local text = type(ctx.result) == "table" and ctx.result.text or nil
|
|
326
|
+
add(ctype ~= "" and ctype or nil, false, response.body, text)
|
|
326
327
|
end
|
|
327
328
|
end
|
|
328
329
|
|
|
@@ -226,7 +226,7 @@ local function decode_body(body, encoding)
|
|
|
226
226
|
return inflate_raw(body, 1)
|
|
227
227
|
end
|
|
228
228
|
|
|
229
|
-
local function send_once(fullurl, fetchdef)
|
|
229
|
+
local function send_once(fullurl, fetchdef, trust)
|
|
230
230
|
-- Use LuaSocket or similar for real HTTP requests.
|
|
231
231
|
-- This is the default live implementation.
|
|
232
232
|
local http_ok, http = pcall(require, "socket.http")
|
|
@@ -262,7 +262,7 @@ local function send_once(fullurl, fetchdef)
|
|
|
262
262
|
end
|
|
263
263
|
|
|
264
264
|
-- An https connection is verified before any byte of the request is sent.
|
|
265
|
-
local create, refused = tls.create(fullurl)
|
|
265
|
+
local create, refused = tls.create(fullurl, trust)
|
|
266
266
|
if refused ~= nil then
|
|
267
267
|
return nil, refused
|
|
268
268
|
end
|
|
@@ -363,6 +363,11 @@ end
|
|
|
363
363
|
-- or where a body would go to another origin, the 3xx is the answer. Another
|
|
364
364
|
-- origin is not sent the credentials.
|
|
365
365
|
local function default_http_fetch(ctx, fullurl, fetchdef)
|
|
366
|
+
local trust, untrusted = tls.trust(type(ctx) == "table" and ctx.client ~= nil
|
|
367
|
+
and ctx.client:options_map() or {})
|
|
368
|
+
if untrusted ~= nil then
|
|
369
|
+
return nil, untrusted
|
|
370
|
+
end
|
|
366
371
|
local method = string.upper(tostring(fetchdef["method"] or "GET"))
|
|
367
372
|
local follow = (method == "GET" or method == "HEAD") and fetchdef["redirect"] ~= "manual"
|
|
368
373
|
local url = fullurl
|
|
@@ -372,7 +377,7 @@ local function default_http_fetch(ctx, fullurl, fetchdef)
|
|
|
372
377
|
if refused then
|
|
373
378
|
return nil, refused
|
|
374
379
|
end
|
|
375
|
-
local res, err = send_once(url, fetchdef)
|
|
380
|
+
local res, err = send_once(url, fetchdef, trust)
|
|
376
381
|
local location = res ~= nil and res.headers ~= nil and res.headers["location"] or nil
|
|
377
382
|
if not follow or type(location) ~= "string" or hops >= REDIRECT_MAX
|
|
378
383
|
or not REDIRECT_STATUS[res.status] then
|
|
@@ -29,6 +29,10 @@ local function make_fetch_def_util(ctx)
|
|
|
29
29
|
headers = spec.headers,
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
if ctx.ctrl ~= nil and type(ctx.ctrl.signal) == "function" then
|
|
33
|
+
fetchdef["signal"] = ctx.ctrl.signal
|
|
34
|
+
end
|
|
35
|
+
|
|
32
36
|
if spec.body ~= nil then
|
|
33
37
|
fetchdef["body"] = media.request_body(ctx.point, spec.body)
|
|
34
38
|
end
|
|
@@ -123,6 +123,37 @@ local function validated_entity_defaults(cfgentity, spec)
|
|
|
123
123
|
return entity_defaults
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
+
-- The model's options for a feature sit beneath the caller's, key by key: a
|
|
127
|
+
-- key the caller sets replaces the default whole, so a list is never merged.
|
|
128
|
+
local function feature_defaults(cfgfeature, feature)
|
|
129
|
+
if feature ~= nil and type(feature) ~= "table" then
|
|
130
|
+
return nil
|
|
131
|
+
end
|
|
132
|
+
local out = {}
|
|
133
|
+
for k, v in pairs(feature or {}) do
|
|
134
|
+
out[k] = v
|
|
135
|
+
end
|
|
136
|
+
local changed = false
|
|
137
|
+
for name, fdef in pairs(type(cfgfeature) == "table" and cfgfeature or {}) do
|
|
138
|
+
local dflt = type(fdef) == "table" and fdef["options"] or nil
|
|
139
|
+
local given = out[name]
|
|
140
|
+
if type(dflt) == "table" and (given ~= nil or dflt["active"] == true)
|
|
141
|
+
and (given == nil or type(given) == "table") then
|
|
142
|
+
local merged = vs.clone(dflt)
|
|
143
|
+
for k, v in pairs(given or {}) do
|
|
144
|
+
merged[k] = v
|
|
145
|
+
end
|
|
146
|
+
out[name] = merged
|
|
147
|
+
changed = true
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
if not changed then
|
|
151
|
+
return nil
|
|
152
|
+
end
|
|
153
|
+
return out
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
|
|
126
157
|
local function make_options_util(ctx)
|
|
127
158
|
local options = ctx.options or {}
|
|
128
159
|
|
|
@@ -213,6 +244,11 @@ local function make_options_util(ctx)
|
|
|
213
244
|
opts.feature = fmap
|
|
214
245
|
end
|
|
215
246
|
|
|
247
|
+
local fdefaults = feature_defaults(config["feature"], opts.feature)
|
|
248
|
+
if fdefaults ~= nil then
|
|
249
|
+
opts.feature = fdefaults
|
|
250
|
+
end
|
|
251
|
+
|
|
216
252
|
-- THE OPTION SPEC IS GENERATED, NOT WRITTEN HERE.
|
|
217
253
|
--
|
|
218
254
|
-- `schema.OPTSPEC` is built from the model: `main.kit.optspec` for
|
|
@@ -345,15 +381,19 @@ local function make_options_util(ctx)
|
|
|
345
381
|
opts["extend"] = extend
|
|
346
382
|
end
|
|
347
383
|
|
|
348
|
-
-- Resolve the feature add-order: an explicit list order (above) wins
|
|
349
|
-
--
|
|
350
|
-
--
|
|
351
|
-
|
|
384
|
+
-- Resolve the feature add-order: an explicit list order (above) wins, and
|
|
385
|
+
-- the names it leaves out follow it test-first, then sorted, so the outcome
|
|
386
|
+
-- is deterministic and `test` is the base transport of a map.
|
|
387
|
+
do
|
|
352
388
|
local fmap = opts.feature
|
|
389
|
+
local given = {}
|
|
390
|
+
for _, n in ipairs(featureorder) do
|
|
391
|
+
given[n] = true
|
|
392
|
+
end
|
|
353
393
|
local names = {}
|
|
354
394
|
if type(fmap) == "table" then
|
|
355
395
|
for k, _ in pairs(fmap) do
|
|
356
|
-
if type(k) == "string" then
|
|
396
|
+
if type(k) == "string" and not given[k] then
|
|
357
397
|
table.insert(names, k)
|
|
358
398
|
end
|
|
359
399
|
end
|
|
@@ -365,15 +405,14 @@ local function make_options_util(ctx)
|
|
|
365
405
|
has_test = true
|
|
366
406
|
end
|
|
367
407
|
end
|
|
408
|
+
local rest = names
|
|
368
409
|
if has_test then
|
|
369
|
-
|
|
410
|
+
rest = { "test" }
|
|
370
411
|
for _, n in ipairs(names) do
|
|
371
412
|
if n ~= "test" then
|
|
372
|
-
table.insert(
|
|
413
|
+
table.insert(rest, n)
|
|
373
414
|
end
|
|
374
415
|
end
|
|
375
|
-
else
|
|
376
|
-
featureorder = names
|
|
377
416
|
end
|
|
378
417
|
-- Station special case, mirroring test's: its transport wrap must
|
|
379
418
|
-- sit immediately outside the base transport (inside every other
|
|
@@ -382,22 +421,25 @@ local function make_options_util(ctx)
|
|
|
382
421
|
-- sorted default would init station last and wrap OUTSIDE the
|
|
383
422
|
-- recording features, turning its wire-truth events into fiction.
|
|
384
423
|
local si = nil
|
|
385
|
-
for i, n in ipairs(
|
|
424
|
+
for i, n in ipairs(rest) do
|
|
386
425
|
if n == "station" then
|
|
387
426
|
si = i
|
|
388
427
|
break
|
|
389
428
|
end
|
|
390
429
|
end
|
|
391
430
|
if si ~= nil then
|
|
392
|
-
table.remove(
|
|
431
|
+
table.remove(rest, si)
|
|
393
432
|
local ti = 0
|
|
394
|
-
for i, n in ipairs(
|
|
433
|
+
for i, n in ipairs(rest) do
|
|
395
434
|
if n == "test" then
|
|
396
435
|
ti = i
|
|
397
436
|
break
|
|
398
437
|
end
|
|
399
438
|
end
|
|
400
|
-
table.insert(
|
|
439
|
+
table.insert(rest, ti + 1, "station")
|
|
440
|
+
end
|
|
441
|
+
for _, n in ipairs(rest) do
|
|
442
|
+
table.insert(featureorder, n)
|
|
401
443
|
end
|
|
402
444
|
end
|
|
403
445
|
|
|
@@ -160,6 +160,30 @@ local function make_point_util(ctx)
|
|
|
160
160
|
if reqselector ~= nil then
|
|
161
161
|
unmatched_action = vs.getprop(reqselector, "$action")
|
|
162
162
|
end
|
|
163
|
+
local acting = {}
|
|
164
|
+
for _, cand in ipairs(unmatched_action ~= nil and op.points or {}) do
|
|
165
|
+
if unmatched_action == vs.getprop(vs.getprop(cand, "select"), "$action") then
|
|
166
|
+
acting[#acting + 1] = cand
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
if #acting > 0 then
|
|
170
|
+
local missing, seen = {}, {}
|
|
171
|
+
for _, cand in ipairs(acting) do
|
|
172
|
+
local exist = vs.getprop(vs.getprop(cand, "select"), "exist")
|
|
173
|
+
for _, ek in ipairs(type(exist) == "table" and exist or {}) do
|
|
174
|
+
local key = tostring(ek)
|
|
175
|
+
if vs.getprop(reqselector, key) == nil and vs.getprop(selector, key) == nil
|
|
176
|
+
and not seen[key] then
|
|
177
|
+
seen[key] = true
|
|
178
|
+
missing[#missing + 1] = key
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
return nil, ctx:make_error("point_no_match",
|
|
183
|
+
'Operation "' .. op.name .. '" action "' .. vs.stringify(unmatched_action) ..
|
|
184
|
+
'" has no endpoint whose required fields are all given (missing: ' ..
|
|
185
|
+
table.concat(missing, ", ") .. ').')
|
|
186
|
+
end
|
|
163
187
|
if unmatched_action ~= nil then
|
|
164
188
|
return nil, ctx:make_error("point_action_invalid",
|
|
165
189
|
'Operation "' .. op.name ..
|
|
@@ -35,9 +35,20 @@ local function make_request_util(ctx)
|
|
|
35
35
|
spec.step = "prerequest"
|
|
36
36
|
|
|
37
37
|
local url = fetchdef["url"] or ""
|
|
38
|
-
local
|
|
38
|
+
local Control = require("core.control")
|
|
39
|
+
local signal = ctx.ctrl and ctx.ctrl.signal
|
|
40
|
+
local fetched, fetch_err
|
|
41
|
+
if Control.cancelled(signal) then
|
|
42
|
+
fetch_err = true
|
|
43
|
+
else
|
|
44
|
+
fetched, fetch_err = utility.fetcher(ctx, url, fetchdef)
|
|
45
|
+
end
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
-- The transport runs to its end: a request whose signal cancelled
|
|
48
|
+
-- meanwhile is cancelled, whatever the transport returned for it.
|
|
49
|
+
if Control.cancelled(signal) then
|
|
50
|
+
response.err = ctx:make_error("request_aborted", "request aborted")
|
|
51
|
+
elseif fetch_err ~= nil then
|
|
41
52
|
response.err = fetch_err
|
|
42
53
|
elseif fetched == nil then
|
|
43
54
|
response = Response.new({
|