@voxgig/sdkgen 4.50.0 → 4.52.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/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/optspec.js +2 -2
- package/dist/helpers/optspec.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aontu +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/audit.aontu +1 -1
- package/project/.sdk/model/feature/cache.aontu +7 -5
- 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/lua.aontu +6 -0
- package/project/.sdk/src/cmp/c/Config_c.ts +3 -134
- package/project/.sdk/src/cmp/c/TestClean_c.ts +26 -11
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +17 -10
- package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +10 -5
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +15 -1
- package/project/.sdk/src/cmp/csharp/TestClean_csharp.ts +9 -0
- 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/elixir/TestClean_elixir.ts +13 -4
- 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/TestClean_go.ts +39 -3
- 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/java/TestClean_java.ts +17 -4
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +21 -0
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +13 -8
- package/project/.sdk/src/cmp/js/TestClean_js.ts +13 -5
- 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/TestClean_kotlin.ts +31 -4
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +19 -0
- package/project/.sdk/src/cmp/lua/TestClean_lua.ts +14 -4
- 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/TestClean_ocaml.ts +20 -5
- package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +36 -21
- package/project/.sdk/src/cmp/perl/TestClean_perl.ts +13 -4
- 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/TestClean_php.ts +10 -3
- 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/TestClean_py.ts +10 -3
- 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/rb/TestClean_rb.ts +11 -4
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +23 -2
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +27 -11
- package/project/.sdk/src/cmp/rust/TestClean_rust.ts +24 -17
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +22 -2
- package/project/.sdk/src/cmp/scala/TestClean_scala.ts +45 -11
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +14 -0
- package/project/.sdk/src/cmp/swift/TestClean_swift.ts +31 -21
- 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/ReadmeHowto_ts.ts +13 -8
- package/project/.sdk/src/cmp/ts/TestClean_ts.ts +13 -5
- 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/TestClean_zig.ts +23 -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/tm/c/core/context.c +1 -0
- package/project/.sdk/tm/c/core/sdk.h +7 -4
- package/project/.sdk/tm/c/feature/cache.c +243 -13
- package/project/.sdk/tm/c/feature/metrics.c +7 -0
- package/project/.sdk/tm/c/feature/paging.c +231 -2
- package/project/.sdk/tm/c/feature/ratelimit.c +5 -9
- package/project/.sdk/tm/c/feature/retry.c +51 -4
- package/project/.sdk/tm/c/feature/secrets.c +27 -38
- package/project/.sdk/tm/c/feature/streaming.c +2 -1
- package/project/.sdk/tm/c/feature/telemetry.c +19 -18
- package/project/.sdk/tm/c/feature/test.c +78 -54
- package/project/.sdk/tm/c/tests/feature_test.c +288 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +2 -0
- package/project/.sdk/tm/c/utility/clean.c +26 -33
- package/project/.sdk/tm/c/utility/make_options.c +89 -17
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +14 -11
- package/project/.sdk/tm/clojure/src/sdk/client.clj +3 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +50 -22
- package/project/.sdk/tm/clojure/src/sdk/features.clj +279 -80
- package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +103 -1
- package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +1 -0
- package/project/.sdk/tm/cpp/Makefile +5 -0
- package/project/.sdk/tm/cpp/core/types.hpp +148 -72
- package/project/.sdk/tm/cpp/feature/audit.hpp +12 -8
- package/project/.sdk/tm/cpp/feature/cache.hpp +188 -9
- package/project/.sdk/tm/cpp/feature/metrics.hpp +19 -0
- package/project/.sdk/tm/cpp/feature/paging.hpp +160 -2
- package/project/.sdk/tm/cpp/feature/ratelimit.hpp +18 -14
- package/project/.sdk/tm/cpp/feature/retry.hpp +46 -5
- package/project/.sdk/tm/cpp/feature/secrets.hpp +12 -0
- 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 +63 -53
- package/project/.sdk/tm/cpp/test/feature_test.cpp +236 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +44 -12
- package/project/.sdk/tm/csharp/core/Context.cs +4 -0
- package/project/.sdk/tm/csharp/feature/AuditFeature.cs +8 -1
- package/project/.sdk/tm/csharp/feature/CacheFeature.cs +126 -12
- package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +23 -0
- package/project/.sdk/tm/csharp/feature/PagingFeature.cs +130 -3
- package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +26 -19
- package/project/.sdk/tm/csharp/feature/RetryFeature.cs +41 -7
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +9 -27
- 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 +55 -67
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +238 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +5 -10
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +7 -1
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +94 -24
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +2 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/cache.ex +146 -30
- package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +13 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +110 -5
- package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +6 -12
- package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +33 -9
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +10 -56
- 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 +52 -48
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +77 -47
- package/project/.sdk/tm/elixir/test/feature_test.exs +198 -0
- package/project/.sdk/tm/go/core/context.go +6 -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/cache_feature.go +131 -4
- package/project/.sdk/tm/go/feature/metrics_feature.go +14 -0
- package/project/.sdk/tm/go/feature/paging_feature.go +108 -2
- package/project/.sdk/tm/go/feature/ratelimit_feature.go +19 -17
- package/project/.sdk/tm/go/feature/retry_feature.go +81 -9
- package/project/.sdk/tm/go/feature/secrets_feature.go +17 -71
- 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 +65 -55
- package/project/.sdk/tm/go/test/feature_corpus_test.go +357 -28
- package/project/.sdk/tm/go/test/feature_test.go +93 -0
- package/project/.sdk/tm/go/utility/clean.go +5 -7
- package/project/.sdk/tm/go/utility/fetcher.go +11 -0
- package/project/.sdk/tm/go/utility/make_options.go +116 -13
- package/project/.sdk/tm/java/core/Context.java +9 -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/CacheFeature.java +123 -17
- package/project/.sdk/tm/java/feature/MetricsFeature.java +31 -0
- package/project/.sdk/tm/java/feature/PagingFeature.java +156 -2
- package/project/.sdk/tm/java/feature/RatelimitFeature.java +15 -13
- package/project/.sdk/tm/java/feature/RetryFeature.java +33 -6
- package/project/.sdk/tm/java/feature/SecretsFeature.java +9 -92
- 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 +50 -63
- package/project/.sdk/tm/java/test/FeatureCorpusTest.java +309 -17
- package/project/.sdk/tm/java/test/FeatureTest.java +60 -0
- package/project/.sdk/tm/java/utility/Clean.java +6 -10
- package/project/.sdk/tm/java/utility/Fetcher.java +5 -1
- package/project/.sdk/tm/java/utility/MakeOptions.java +131 -15
- package/project/.sdk/tm/js/src/Context.js +4 -0
- package/project/.sdk/tm/js/src/feature/cache/CacheFeature.js +118 -11
- package/project/.sdk/tm/js/src/feature/cost/CostFeature.js +3 -2
- package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +9 -4
- package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +103 -5
- package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +5 -9
- package/project/.sdk/tm/js/src/feature/rbac/RbacFeature.js +4 -4
- package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +25 -3
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +16 -6
- 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/feature/validate/ValidateFeature.js +2 -1
- package/project/.sdk/tm/js/src/utility/CleanUtility.js +1 -1
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +61 -12
- package/project/.sdk/tm/js/test/feature/Corpus.test.js +191 -23
- package/project/.sdk/tm/js/test/feature/harness.js +3 -3
- package/project/.sdk/tm/js/test/feature.test.js +14 -1
- package/project/.sdk/tm/js/test/pipeline.test.js +1 -1
- package/project/.sdk/tm/kotlin/core/Context.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/CacheFeature.kt +102 -7
- package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +22 -0
- package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +125 -2
- package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +16 -13
- package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +36 -14
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +10 -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 +45 -48
- package/project/.sdk/tm/kotlin/test/FeatureTest.kt +173 -0
- package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +5 -5
- package/project/.sdk/tm/kotlin/utility/Fetcher.kt +4 -0
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +86 -15
- package/project/.sdk/tm/lua/core/context.lua +6 -0
- package/project/.sdk/tm/lua/feature/cache_feature.lua +212 -15
- 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/paging_feature.lua +143 -2
- package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +5 -9
- package/project/.sdk/tm/lua/feature/retry_feature.lua +43 -5
- package/project/.sdk/tm/lua/feature/secrets_feature.lua +15 -80
- 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 +60 -62
- package/project/.sdk/tm/lua/test/feature_test.lua +181 -3
- package/project/.sdk/tm/lua/utility/clean.lua +6 -9
- package/project/.sdk/tm/lua/utility/fetcher.lua +9 -0
- package/project/.sdk/tm/lua/utility/make_options.lua +60 -18
- package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +21 -6
- package/project/.sdk/tm/ocaml/sdk_features.ml +392 -68
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +47 -21
- package/project/.sdk/tm/ocaml/sdk_types.ml +2 -0
- package/project/.sdk/tm/ocaml/test/t_feature.ml +107 -2
- package/project/.sdk/tm/perl/core/context.pm +3 -0
- package/project/.sdk/tm/perl/feature/audit_feature.pm +4 -7
- package/project/.sdk/tm/perl/feature/cache_feature.pm +111 -15
- 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/paging_feature.pm +139 -2
- package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +5 -11
- package/project/.sdk/tm/perl/feature/retry_feature.pm +22 -4
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +13 -18
- 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 +45 -50
- package/project/.sdk/tm/perl/t/feature.t +68 -2
- package/project/.sdk/tm/perl/t/feature_corpus.t +204 -25
- package/project/.sdk/tm/perl/utility/clean.pm +6 -8
- package/project/.sdk/tm/perl/utility/fetcher.pm +4 -0
- package/project/.sdk/tm/perl/utility/make_options.pm +38 -15
- package/project/.sdk/tm/php/core/Context.php +4 -0
- package/project/.sdk/tm/php/feature/CacheFeature.php +98 -13
- package/project/.sdk/tm/php/feature/MetricsFeature.php +8 -0
- package/project/.sdk/tm/php/feature/PagingFeature.php +128 -1
- package/project/.sdk/tm/php/feature/RatelimitFeature.php +5 -9
- package/project/.sdk/tm/php/feature/RetryFeature.php +27 -3
- package/project/.sdk/tm/php/feature/SecretsFeature.php +18 -15
- 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 +55 -47
- package/project/.sdk/tm/php/test/FeatureCorpusTest.php +262 -17
- package/project/.sdk/tm/php/test/FeatureTest.php +68 -0
- package/project/.sdk/tm/php/utility/Clean.php +3 -10
- package/project/.sdk/tm/php/utility/Fetcher.php +8 -3
- package/project/.sdk/tm/php/utility/MakeOptions.php +45 -20
- package/project/.sdk/tm/py/pkg/core/context.py +4 -0
- package/project/.sdk/tm/py/pkg/feature/cache_feature.py +79 -13
- package/project/.sdk/tm/py/pkg/feature/metrics_feature.py +7 -0
- package/project/.sdk/tm/py/pkg/feature/paging_feature.py +86 -1
- package/project/.sdk/tm/py/pkg/feature/ratelimit_feature.py +13 -16
- package/project/.sdk/tm/py/pkg/feature/retry_feature.py +31 -6
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +15 -66
- 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 +56 -53
- package/project/.sdk/tm/py/pkg/utility/clean.py +4 -10
- package/project/.sdk/tm/py/pkg/utility/make_options.py +77 -30
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +23 -9
- package/project/.sdk/tm/py/test/test_feature.py +61 -1
- package/project/.sdk/tm/py/test/test_feature_corpus.py +197 -17
- 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 +4 -1
- package/project/.sdk/tm/rb/feature/audit_feature.rb +6 -5
- package/project/.sdk/tm/rb/feature/cache_feature.rb +75 -11
- 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/paging_feature.rb +87 -1
- package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +12 -16
- package/project/.sdk/tm/rb/feature/retry_feature.rb +19 -3
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +9 -64
- 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 +42 -49
- package/project/.sdk/tm/rb/test/feature_corpus_test.rb +191 -25
- package/project/.sdk/tm/rb/test/feature_test.rb +75 -1
- package/project/.sdk/tm/rb/utility/clean.rb +6 -7
- package/project/.sdk/tm/rb/utility/fetcher.rb +6 -0
- package/project/.sdk/tm/rb/utility/make_options.rb +37 -16
- package/project/.sdk/tm/rust/core/context.rs +8 -0
- package/project/.sdk/tm/rust/feature/audit.rs +2 -2
- package/project/.sdk/tm/rust/feature/cache.rs +120 -3
- package/project/.sdk/tm/rust/feature/metrics.rs +24 -1
- package/project/.sdk/tm/rust/feature/paging.rs +189 -3
- package/project/.sdk/tm/rust/feature/ratelimit.rs +5 -10
- package/project/.sdk/tm/rust/feature/retry.rs +59 -6
- package/project/.sdk/tm/rust/feature/secrets.rs +36 -98
- package/project/.sdk/tm/rust/feature/streaming.rs +3 -2
- package/project/.sdk/tm/rust/feature/support.rs +4 -0
- package/project/.sdk/tm/rust/feature/telemetry.rs +22 -11
- package/project/.sdk/tm/rust/feature/test.rs +63 -57
- package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +3 -3
- package/project/.sdk/tm/rust/tests/feature_test.rs +274 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +1 -0
- package/project/.sdk/tm/rust/utility/clean.rs +35 -43
- package/project/.sdk/tm/rust/utility/fetcher.rs +6 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +130 -38
- package/project/.sdk/tm/scala/core/Context.scala +4 -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/CacheFeature.scala +117 -11
- package/project/.sdk/tm/scala/feature/MetricsFeature.scala +31 -1
- package/project/.sdk/tm/scala/feature/PagingFeature.scala +122 -2
- package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +14 -11
- package/project/.sdk/tm/scala/feature/RetryFeature.scala +29 -7
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +11 -24
- 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 +44 -44
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +69 -0
- package/project/.sdk/tm/scala/utility/Fetcher.scala +5 -0
- package/project/.sdk/tm/scala/utility/Make.scala +99 -14
- package/project/.sdk/tm/scala/utility/Misc.scala +5 -8
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +3 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +3 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CacheFeature.swift +122 -11
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +20 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +102 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +19 -13
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +40 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/SecretsFeature.swift +9 -13
- 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 +55 -49
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +4 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +56 -17
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +4 -5
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +166 -0
- package/project/.sdk/tm/ts/src/Context.ts +4 -0
- package/project/.sdk/tm/ts/src/feature/cache/CacheFeature.ts +115 -4
- package/project/.sdk/tm/ts/src/feature/cost/CostFeature.ts +3 -2
- package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +6 -1
- package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +103 -5
- package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +5 -9
- package/project/.sdk/tm/ts/src/feature/rbac/RbacFeature.ts +4 -4
- package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +25 -3
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +14 -2
- 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/feature/validate/ValidateFeature.ts +2 -1
- package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +1 -1
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +63 -12
- package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +192 -23
- package/project/.sdk/tm/ts/test/feature/harness.ts +3 -3
- package/project/.sdk/tm/ts/test/feature.test.ts +14 -1
- package/project/.sdk/tm/ts/test/pipeline.test.ts +1 -1
- package/project/.sdk/tm/zig/core/context.zig +5 -0
- package/project/.sdk/tm/zig/core/utility.zig +118 -17
- package/project/.sdk/tm/zig/feature/cache.zig +144 -13
- package/project/.sdk/tm/zig/feature/metrics.zig +19 -0
- package/project/.sdk/tm/zig/feature/paging.zig +172 -4
- package/project/.sdk/tm/zig/feature/ratelimit.zig +5 -11
- package/project/.sdk/tm/zig/feature/retry.zig +41 -3
- package/project/.sdk/tm/zig/feature/secrets.zig +6 -1
- package/project/.sdk/tm/zig/feature/streaming.zig +2 -0
- package/project/.sdk/tm/zig/feature/telemetry.zig +15 -9
- package/project/.sdk/tm/zig/feature/test.zig +56 -40
- package/project/.sdk/tm/zig/test/feature_test.zig +174 -0
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +2 -0
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeExplanation.ts +5 -2
- package/src/cmp/ReadmeFeatures.ts +21 -6
- package/src/helpers/optspec.ts +2 -2
|
@@ -123,15 +123,9 @@ defmodule ProjectName.Feature.Test do
|
|
|
123
123
|
{out, nil}
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
-
defp
|
|
127
|
-
if
|
|
128
|
-
|
|
129
|
-
else
|
|
130
|
-
Enum.find_value([S.getprop(fctx, "match"), S.getprop(fctx, "data")], S.jm([]), fn src ->
|
|
131
|
-
v = if src != nil, do: S.getprop(src, "id"), else: nil
|
|
132
|
-
if v != nil and v != "__UNDEFINED__", do: S.jm(["id", v])
|
|
133
|
-
end)
|
|
134
|
-
end
|
|
126
|
+
defp held?(src, key) do
|
|
127
|
+
v = if src != nil, do: S.getprop(src, key), else: nil
|
|
128
|
+
v != nil and v != "__UNDEFINED__"
|
|
135
129
|
end
|
|
136
130
|
|
|
137
131
|
defp respond_op(f, entity, fctx) do
|
|
@@ -142,7 +136,7 @@ defmodule ProjectName.Feature.Test do
|
|
|
142
136
|
|
|
143
137
|
case opname do
|
|
144
138
|
"load" ->
|
|
145
|
-
args = build_args(f, fctx, op,
|
|
139
|
+
args = build_args(f, fctx, op, S.getprop(fctx, "reqmatch"))
|
|
146
140
|
found = S.select(entmap, args)
|
|
147
141
|
ent = S.getelem(found, 0)
|
|
148
142
|
|
|
@@ -169,28 +163,10 @@ defmodule ProjectName.Feature.Test do
|
|
|
169
163
|
|
|
170
164
|
opn when opn in ["update", "patch"] ->
|
|
171
165
|
reqdata = S.getprop(fctx, "reqdata")
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if S.getprop(reqdata, "id") != nil, do: S.setprop(um, "id", S.getprop(reqdata, "id"))
|
|
177
|
-
alias_map = S.getprop(op, "alias")
|
|
178
|
-
|
|
179
|
-
if alias_map != nil do
|
|
180
|
-
alias_id = S.getprop(alias_map, "id")
|
|
181
|
-
|
|
182
|
-
if alias_id != nil and S.getprop(reqdata, alias_id) != nil do
|
|
183
|
-
S.setprop(um, alias_id, S.getprop(reqdata, alias_id))
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
um
|
|
188
|
-
else
|
|
189
|
-
S.jm([])
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
update_match = if S.size(update_match) == 0, do: resolve_match(fctx, S.jm([])), else: update_match
|
|
193
|
-
args = build_args(f, fctx, op, update_match)
|
|
166
|
+
# `$body` travels on the wire alone; the record is the rest.
|
|
167
|
+
rec = if S.ismap(reqdata), do: S.clone(reqdata), else: S.jm([])
|
|
168
|
+
S.delprop(rec, "$body")
|
|
169
|
+
args = build_args(f, fctx, op, rec)
|
|
194
170
|
found = S.select(entmap, args)
|
|
195
171
|
ent = S.getelem(found, 0)
|
|
196
172
|
|
|
@@ -198,10 +174,7 @@ defmodule ProjectName.Feature.Test do
|
|
|
198
174
|
# update miss: 404, never another record
|
|
199
175
|
respond(fctx, 404, nil, S.jm(["statusText", "Not found"]))
|
|
200
176
|
else
|
|
201
|
-
# `$body` travels on the wire alone; the record is the rest.
|
|
202
177
|
if S.ismap(ent) and S.ismap(reqdata) do
|
|
203
|
-
rec = S.clone(reqdata)
|
|
204
|
-
S.delprop(rec, "$body")
|
|
205
178
|
S.merge(S.jt([ent, rec]))
|
|
206
179
|
end
|
|
207
180
|
|
|
@@ -210,7 +183,7 @@ defmodule ProjectName.Feature.Test do
|
|
|
210
183
|
end
|
|
211
184
|
|
|
212
185
|
"remove" ->
|
|
213
|
-
args = build_args(f, fctx, op,
|
|
186
|
+
args = build_args(f, fctx, op, S.getprop(fctx, "reqmatch"))
|
|
214
187
|
found = S.select(entmap, args)
|
|
215
188
|
ent = S.getelem(found, 0)
|
|
216
189
|
|
|
@@ -312,22 +285,53 @@ defmodule ProjectName.Feature.Test do
|
|
|
312
285
|
qand = S.jt([])
|
|
313
286
|
q = S.jm(["`$AND`", qand])
|
|
314
287
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
288
|
+
idfrom = S.getpath(config, "entity." <> entname <> ".id.from")
|
|
289
|
+
given = if args != nil, do: S.keysof(args), else: []
|
|
290
|
+
|
|
291
|
+
# With no id in the call, the entity's held id (or composite parts) stands in.
|
|
292
|
+
names =
|
|
293
|
+
if held?(args, "id") do
|
|
294
|
+
given
|
|
295
|
+
else
|
|
296
|
+
declared = S.getpath(config, "entity." <> entname <> ".id.parts")
|
|
297
|
+
|
|
298
|
+
parts =
|
|
299
|
+
cond do
|
|
300
|
+
S.islist(declared) -> Enum.map(0..(S.size(declared) - 1)//1, &to_string(S.getelem(declared, &1)))
|
|
301
|
+
opname == "list" -> []
|
|
302
|
+
true -> ["id"]
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
Enum.reduce(parts, given, fn pname, acc ->
|
|
306
|
+
if pname not in acc and (held?(S.getprop(ctx, "match"), pname) or held?(S.getprop(ctx, "data"), pname)),
|
|
307
|
+
do: acc ++ [pname],
|
|
308
|
+
else: acc
|
|
309
|
+
end)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
Enum.each(names, fn key ->
|
|
313
|
+
is_id = key == "id"
|
|
314
|
+
is_reqd = not S.isempty(S.select(reqd_params, key)) or not S.isempty(S.select(reqd_query, key))
|
|
319
315
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
316
|
+
if is_id or is_reqd do
|
|
317
|
+
v = Utility.param(ctx, key)
|
|
318
|
+
ka = if S.getprop(op, "alias") != nil, do: S.getprop(S.getprop(op, "alias"), key), else: nil
|
|
323
319
|
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
qor = S.jt([S.jm([key, v])])
|
|
321
|
+
if is_binary(ka), do: Feature.list_push(qor, S.jm([ka, v]))
|
|
326
322
|
|
|
327
|
-
|
|
323
|
+
# An alternative, never a replacement: a seed keeping the parameter
|
|
324
|
+
# flat is still found.
|
|
325
|
+
kf = if idfrom != nil, do: S.getprop(idfrom, key), else: nil
|
|
326
|
+
|
|
327
|
+
if is_binary(kf) and kf != key do
|
|
328
|
+
nest = kf |> String.split(".") |> Enum.reverse() |> Enum.reduce(v, fn seg, acc -> S.jm([seg, acc]) end)
|
|
329
|
+
Feature.list_push(qor, nest)
|
|
328
330
|
end
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
|
|
332
|
+
Feature.list_push(qand, S.jm(["`$OR`", qor]))
|
|
333
|
+
end
|
|
334
|
+
end)
|
|
331
335
|
|
|
332
336
|
ctrl = S.getprop(ctx, "ctrl")
|
|
333
337
|
explain = if ctrl != nil, do: S.getprop(ctrl, "explain"), else: nil
|
|
@@ -170,8 +170,8 @@ defmodule ProjectName.Utility do
|
|
|
170
170
|
end
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
-
# The
|
|
174
|
-
#
|
|
173
|
+
# The clean registry: a struct node held on the context as `cleancfg`, whose
|
|
174
|
+
# `values` stays MUTABLE after make_options - features register
|
|
175
175
|
# what they resolve later.
|
|
176
176
|
def make_clean_config(cleanopts) do
|
|
177
177
|
o = fn k -> if S.ismap(cleanopts), do: S.getprop(cleanopts, k), else: nil end
|
|
@@ -187,14 +187,13 @@ defmodule ProjectName.Utility do
|
|
|
187
187
|
])
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
# A context without
|
|
191
|
-
# the schema defaults.
|
|
190
|
+
# A context without a registry (make_error accepts a bare one) still masks
|
|
191
|
+
# by the schema defaults.
|
|
192
192
|
defp clean_config(ctx) do
|
|
193
|
-
|
|
194
|
-
derived = if S.ismap(options), do: S.getpath(options, "__derived__.clean"), else: nil
|
|
193
|
+
cfg = if S.ismap(ctx), do: S.getprop(ctx, "cleancfg"), else: nil
|
|
195
194
|
|
|
196
|
-
if S.ismap(
|
|
197
|
-
|
|
195
|
+
if S.ismap(cfg) do
|
|
196
|
+
cfg
|
|
198
197
|
else
|
|
199
198
|
make_clean_config(S.getprop(ProjectName.Schema.optspec(), "clean"))
|
|
200
199
|
end
|
|
@@ -759,6 +758,8 @@ defmodule ProjectName.Utility do
|
|
|
759
758
|
co = S.getprop(config, "options")
|
|
760
759
|
cfgopts = if S.ismap(co), do: co, else: S.jm([])
|
|
761
760
|
|
|
761
|
+
feature_defaults(opts0, S.getprop(config, "feature"))
|
|
762
|
+
|
|
762
763
|
# THE OPTION SPEC IS GENERATED, NOT WRITTEN HERE.
|
|
763
764
|
#
|
|
764
765
|
# `ProjectName.Schema.optspec/0` is built from the model:
|
|
@@ -781,7 +782,7 @@ defmodule ProjectName.Utility do
|
|
|
781
782
|
end)
|
|
782
783
|
|
|
783
784
|
cleancfg = make_clean_config(cleanraw)
|
|
784
|
-
cleanctx = S.jm(["
|
|
785
|
+
cleanctx = S.jm(["cleancfg", cleancfg])
|
|
785
786
|
|
|
786
787
|
clean_add_sensitive(cleanctx, secret_scan(opts0, ["clean"]))
|
|
787
788
|
|
|
@@ -866,52 +867,49 @@ defmodule ProjectName.Utility do
|
|
|
866
867
|
end
|
|
867
868
|
end
|
|
868
869
|
|
|
869
|
-
# Resolve the feature add-order: an explicit list order (above) wins
|
|
870
|
-
#
|
|
871
|
-
#
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
fmap = if S.ismap(fmap), do: fmap, else: S.jm([])
|
|
877
|
-
names = S.keysof(fmap)
|
|
878
|
-
|
|
879
|
-
names =
|
|
880
|
-
if Enum.member?(names, "test") do
|
|
881
|
-
["test" | Enum.reject(names, &(&1 == "test"))]
|
|
882
|
-
else
|
|
883
|
-
names
|
|
884
|
-
end
|
|
870
|
+
# Resolve the feature add-order: an explicit list order (above) wins, and
|
|
871
|
+
# the names it leaves out follow it test-first, then sorted, so the outcome
|
|
872
|
+
# is deterministic and `test` is the base transport of a map.
|
|
873
|
+
given = explicit_order || []
|
|
874
|
+
fmap = S.getprop(opts, "feature")
|
|
875
|
+
fmap = if S.ismap(fmap), do: fmap, else: S.jm([])
|
|
876
|
+
names = Enum.reject(S.keysof(fmap), &(&1 in given))
|
|
885
877
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
if Enum.member?(names, "station") do
|
|
893
|
-
rest = Enum.reject(names, &(&1 == "station"))
|
|
894
|
-
|
|
895
|
-
at =
|
|
896
|
-
case Enum.find_index(rest, &(&1 == "test")) do
|
|
897
|
-
nil -> 0
|
|
898
|
-
ti -> ti + 1
|
|
899
|
-
end
|
|
878
|
+
names =
|
|
879
|
+
if Enum.member?(names, "test") do
|
|
880
|
+
["test" | Enum.reject(names, &(&1 == "test"))]
|
|
881
|
+
else
|
|
882
|
+
names
|
|
883
|
+
end
|
|
900
884
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
885
|
+
# Station special case, mirroring test's: its transport wrap must sit
|
|
886
|
+
# immediately outside the base transport, inside every other transport
|
|
887
|
+
# wrap, so map-form activation hoists it to just after test.
|
|
888
|
+
rest =
|
|
889
|
+
if Enum.member?(names, "station") do
|
|
890
|
+
others = Enum.reject(names, &(&1 == "station"))
|
|
891
|
+
|
|
892
|
+
at =
|
|
893
|
+
case Enum.find_index(others, &(&1 == "test")) do
|
|
894
|
+
nil -> 0
|
|
895
|
+
ti -> ti + 1
|
|
904
896
|
end
|
|
905
897
|
|
|
906
|
-
|
|
907
|
-
|
|
898
|
+
List.insert_at(others, at, "station")
|
|
899
|
+
else
|
|
900
|
+
names
|
|
908
901
|
end
|
|
909
902
|
|
|
910
|
-
|
|
903
|
+
feature_order = given ++ rest
|
|
904
|
+
|
|
905
|
+
derived = S.jm(["featureorder", S.jt(feature_order)])
|
|
911
906
|
S.setprop(opts, "__derived__", derived)
|
|
912
907
|
|
|
908
|
+
# Beside the options, not in them: options_map hands them to callers.
|
|
909
|
+
S.setprop(ctx, "cleancfg", cleancfg)
|
|
910
|
+
|
|
913
911
|
# Again over the merged result: the config's own defaults can carry one.
|
|
914
|
-
clean_add_sensitive(
|
|
912
|
+
clean_add_sensitive(cleanctx, secret_scan(opts, ["clean", "__derived__"]))
|
|
915
913
|
|
|
916
914
|
opts
|
|
917
915
|
end
|
|
@@ -921,6 +919,34 @@ defmodule ProjectName.Utility do
|
|
|
921
919
|
# make every setting of that feature a secret. Entity blocks hold entity
|
|
922
920
|
# settings and seeded records, never a credential, so they are skipped, and
|
|
923
921
|
# so are rbac's rules, keyed by entity and operation names.
|
|
922
|
+
# The model's options for a feature sit beneath the caller's, key by key: a
|
|
923
|
+
# key the caller sets replaces the default whole, so a list is never merged.
|
|
924
|
+
defp feature_defaults(opts, cfgfeature) do
|
|
925
|
+
given = S.getprop(opts, "feature")
|
|
926
|
+
|
|
927
|
+
if S.ismap(cfgfeature) and (given == nil or S.ismap(given)) do
|
|
928
|
+
out = S.jm([])
|
|
929
|
+
if S.ismap(given), do: Enum.each(H.entries(given), fn {k, v} -> S.setprop(out, k, v) end)
|
|
930
|
+
|
|
931
|
+
Enum.each(S.keysof(cfgfeature), fn name ->
|
|
932
|
+
dflt = S.getprop(S.getprop(cfgfeature, name), "options")
|
|
933
|
+
fopts = S.getprop(out, name)
|
|
934
|
+
wanted = if fopts == nil, do: S.getprop(dflt, "active") == true, else: S.ismap(fopts)
|
|
935
|
+
|
|
936
|
+
if S.ismap(dflt) and wanted do
|
|
937
|
+
merged = S.clone(dflt)
|
|
938
|
+
|
|
939
|
+
if S.ismap(fopts),
|
|
940
|
+
do: Enum.each(H.entries(fopts), fn {k, v} -> S.setprop(merged, k, v) end)
|
|
941
|
+
|
|
942
|
+
S.setprop(out, name, merged)
|
|
943
|
+
end
|
|
944
|
+
end)
|
|
945
|
+
|
|
946
|
+
S.setprop(opts, "feature", out)
|
|
947
|
+
end
|
|
948
|
+
end
|
|
949
|
+
|
|
924
950
|
defp secret_scan(opts, names) do
|
|
925
951
|
out = S.jm([])
|
|
926
952
|
|
|
@@ -2780,7 +2806,11 @@ defmodule ProjectName.Utility do
|
|
|
2780
2806
|
# A 3xx rides back as a normal response: follow_redirects decides the
|
|
2781
2807
|
# next request, and a `redirect: "manual"` annotation (set by the station
|
|
2782
2808
|
# feature when a hosts egress policy is active) makes the 3xx the answer.
|
|
2783
|
-
|
|
2809
|
+
# A bound in milliseconds, for a caller beneath the timeout feature.
|
|
2810
|
+
bound = S.getprop(fetchdef, "timeout")
|
|
2811
|
+
httpopts = [autoredirect: false] ++ if is_number(bound) and bound > 0, do: [timeout: trunc(bound)], else: []
|
|
2812
|
+
|
|
2813
|
+
case :httpc.request(method, request, httpopts, body_format: :binary) do
|
|
2784
2814
|
{:ok, {{_v, status, _reason}, resp_headers, resp_body}} ->
|
|
2785
2815
|
rh =
|
|
2786
2816
|
Enum.reduce(resp_headers, S.jm([]), fn {k, v}, acc ->
|
|
@@ -458,6 +458,67 @@ defmodule ProjectName.FeatureTest do
|
|
|
458
458
|
end
|
|
459
459
|
end
|
|
460
460
|
|
|
461
|
+
test "cache keys on the request headers" do
|
|
462
|
+
if has?("cache") do
|
|
463
|
+
{server, calls} = FH.recording_server()
|
|
464
|
+
h = harness([fspec("cache", %{"ttl" => 10000})], %{server: server})
|
|
465
|
+
FH.op(h, %{path: "/w/1", headers: S.jm(["x-tenant", "tenant-a"])})
|
|
466
|
+
FH.op(h, %{path: "/w/1", headers: S.jm(["X-Tenant", "tenant-b"])})
|
|
467
|
+
assert S.size(calls) == 2
|
|
468
|
+
FH.op(h, %{path: "/w/1", headers: S.jm(["x-tenant", "tenant-b"])})
|
|
469
|
+
assert S.size(calls) == 2
|
|
470
|
+
end
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
test "cache drops a write's collection" do
|
|
474
|
+
if has?("cache") do
|
|
475
|
+
{server, calls} = FH.recording_server()
|
|
476
|
+
h = harness([fspec("cache", %{"ttl" => 10000})], %{server: server})
|
|
477
|
+
paths = ["/w/1", "/w", "/w/1/part", "/other/1", "/w/2"]
|
|
478
|
+
Enum.each(paths, fn p -> FH.op(h, %{path: p}) end)
|
|
479
|
+
FH.op(h, %{op: "update", method: "PUT", path: "/w/1"})
|
|
480
|
+
Enum.each(paths, fn p -> FH.op(h, %{path: p}) end)
|
|
481
|
+
assert S.size(calls) == 9
|
|
482
|
+
assert S.getprop(track(h, "_cache"), "hit") == 2
|
|
483
|
+
end
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
test "cache does not store what Cache-Control forbids" do
|
|
487
|
+
if has?("cache") do
|
|
488
|
+
for control <- ["no-store", "private", "No-Cache", "max-age=60, private"] do
|
|
489
|
+
{server, calls} =
|
|
490
|
+
FH.recording_server(fn _n, _fd ->
|
|
491
|
+
{FH.make_response(200, S.jm(["ok", true]), S.jm(["Cache-Control", control])), nil}
|
|
492
|
+
end)
|
|
493
|
+
|
|
494
|
+
h = harness([fspec("cache", %{"ttl" => 10000})], %{server: server})
|
|
495
|
+
FH.op(h, %{path: "/w"})
|
|
496
|
+
FH.op(h, %{path: "/w"})
|
|
497
|
+
assert S.size(calls) == 2, control
|
|
498
|
+
end
|
|
499
|
+
end
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
test "cache caps the ttl by max-age" do
|
|
503
|
+
if has?("cache") do
|
|
504
|
+
clock = FH.make_clock()
|
|
505
|
+
|
|
506
|
+
{server, calls} =
|
|
507
|
+
FH.recording_server(fn _n, _fd ->
|
|
508
|
+
{FH.make_response(200, S.jm(["ok", true]), S.jm(["cache-control", "max-age=1"])), nil}
|
|
509
|
+
end)
|
|
510
|
+
|
|
511
|
+
h = harness([fspec("cache", %{"ttl" => 10000, "now" => FH.clock_now(clock)})], %{server: server})
|
|
512
|
+
FH.op(h, %{path: "/w"})
|
|
513
|
+
FH.clock_advance(clock, 500)
|
|
514
|
+
FH.op(h, %{path: "/w"})
|
|
515
|
+
assert S.size(calls) == 1
|
|
516
|
+
FH.clock_advance(clock, 600)
|
|
517
|
+
FH.op(h, %{path: "/w"})
|
|
518
|
+
assert S.size(calls) == 2
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
461
522
|
# === idempotency ===
|
|
462
523
|
|
|
463
524
|
test "idempotency adds a key to mutating ops" do
|
|
@@ -820,6 +881,124 @@ defmodule ProjectName.FeatureTest do
|
|
|
820
881
|
end
|
|
821
882
|
end
|
|
822
883
|
|
|
884
|
+
# The documented hasMore loop, one request per page.
|
|
885
|
+
defp paging_walk(reply, options \\ %{}) do
|
|
886
|
+
{server, calls} = FH.recording_server(fn n, _fd -> {reply.(n), nil} end)
|
|
887
|
+
h = harness([fspec("paging", options)], %{server: server})
|
|
888
|
+
paging = S.jm([])
|
|
889
|
+
ctrl = S.jm(["paging", paging])
|
|
890
|
+
FH.op(h, %{op: "list", path: "/w", ctrl: ctrl})
|
|
891
|
+
|
|
892
|
+
Enum.reduce_while(1..3, nil, fn _, _ ->
|
|
893
|
+
if S.getprop(paging, "hasMore") == true and S.size(calls) < 4 do
|
|
894
|
+
FH.op(h, %{op: "list", path: "/w", ctrl: ctrl})
|
|
895
|
+
{:cont, nil}
|
|
896
|
+
else
|
|
897
|
+
{:halt, nil}
|
|
898
|
+
end
|
|
899
|
+
end)
|
|
900
|
+
|
|
901
|
+
{for(i <- 0..(S.size(calls) - 1), do: call_url(calls, i)), paging}
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
test "paging body next that is not a URL is sent back as the cursor" do
|
|
905
|
+
if has?("paging") do
|
|
906
|
+
pages = ["c3", "c6", nil]
|
|
907
|
+
{urls, paging} = paging_walk(fn n -> FH.make_response(200, H.deep(%{"next" => Enum.at(pages, n - 1)})) end)
|
|
908
|
+
assert urls == ["http://api.test/w?page=1", "http://api.test/w?cursor=c3", "http://api.test/w?cursor=c6"]
|
|
909
|
+
assert S.getprop(paging, "hasMore") == false
|
|
910
|
+
end
|
|
911
|
+
end
|
|
912
|
+
|
|
913
|
+
test "paging body next URL is the next request" do
|
|
914
|
+
if has?("paging") do
|
|
915
|
+
pages = ["http://api.test/v2/w?cursor=c%2F3&limit=3", "/v2/w?cursor=c6", nil]
|
|
916
|
+
{urls, paging} = paging_walk(fn n -> FH.make_response(200, H.deep(%{"next" => Enum.at(pages, n - 1)})) end)
|
|
917
|
+
|
|
918
|
+
assert urls == [
|
|
919
|
+
"http://api.test/w?page=1",
|
|
920
|
+
"http://api.test/v2/w?cursor=c%2F3&limit=3",
|
|
921
|
+
"http://api.test/v2/w?cursor=c6"
|
|
922
|
+
]
|
|
923
|
+
|
|
924
|
+
assert S.getprop(paging, "hasMore") == false
|
|
925
|
+
end
|
|
926
|
+
end
|
|
927
|
+
|
|
928
|
+
test "paging a query-only Link keeps the path" do
|
|
929
|
+
if has?("paging") do
|
|
930
|
+
links = ["</v1/items?page=2>; rel=\"next\"", "<?page=3>; rel=\"next\""]
|
|
931
|
+
|
|
932
|
+
{urls, _paging} =
|
|
933
|
+
paging_walk(fn n ->
|
|
934
|
+
case Enum.at(links, n - 1) do
|
|
935
|
+
nil -> FH.make_response(200, H.deep([]))
|
|
936
|
+
link -> FH.make_response(200, H.deep([]), H.deep(%{"link" => link}))
|
|
937
|
+
end
|
|
938
|
+
end)
|
|
939
|
+
|
|
940
|
+
assert urls == ["http://api.test/w?page=1", "http://api.test/v1/items?page=2", "http://api.test/v1/items?page=3"]
|
|
941
|
+
end
|
|
942
|
+
end
|
|
943
|
+
|
|
944
|
+
test "paging a path-relative Link resolves against the request" do
|
|
945
|
+
if has?("paging") do
|
|
946
|
+
links = ["</v1/items?page=2>; rel=\"next\"", "<more?page=3>; rel=\"next\""]
|
|
947
|
+
|
|
948
|
+
{urls, _paging} =
|
|
949
|
+
paging_walk(fn n ->
|
|
950
|
+
case Enum.at(links, n - 1) do
|
|
951
|
+
nil -> FH.make_response(200, H.deep([]))
|
|
952
|
+
link -> FH.make_response(200, H.deep([]), H.deep(%{"link" => link}))
|
|
953
|
+
end
|
|
954
|
+
end)
|
|
955
|
+
|
|
956
|
+
assert urls == ["http://api.test/w?page=1", "http://api.test/v1/items?page=2", "http://api.test/v1/more?page=3"]
|
|
957
|
+
end
|
|
958
|
+
end
|
|
959
|
+
|
|
960
|
+
test "paging Link next URL is the next request" do
|
|
961
|
+
if has?("paging") do
|
|
962
|
+
links = ["<http://api.test/w?after=b3>; rel=\"next\"", "</w?after=b6>; rel=\"next\""]
|
|
963
|
+
|
|
964
|
+
{urls, paging} =
|
|
965
|
+
paging_walk(fn n ->
|
|
966
|
+
case Enum.at(links, n - 1) do
|
|
967
|
+
nil -> FH.make_response(200, H.deep([]))
|
|
968
|
+
link -> FH.make_response(200, H.deep([]), H.deep(%{"link" => link}))
|
|
969
|
+
end
|
|
970
|
+
end)
|
|
971
|
+
|
|
972
|
+
assert urls == ["http://api.test/w?page=1", "http://api.test/w?after=b3", "http://api.test/w?after=b6"]
|
|
973
|
+
assert S.getprop(paging, "hasMore") == false
|
|
974
|
+
end
|
|
975
|
+
end
|
|
976
|
+
|
|
977
|
+
test "paging a link to another origin ends the walk" do
|
|
978
|
+
if has?("paging") do
|
|
979
|
+
{urls, paging} =
|
|
980
|
+
paging_walk(fn _n ->
|
|
981
|
+
FH.make_response(200, H.deep([]), H.deep(%{"link" => "<https://elsewhere.test/w?after=b3>; rel=\"next\""}))
|
|
982
|
+
end)
|
|
983
|
+
|
|
984
|
+
assert urls == ["http://api.test/w?page=1"]
|
|
985
|
+
assert S.getprop(paging, "hasMore") == false
|
|
986
|
+
assert S.getprop(paging, "foreign") == "https://elsewhere.test/w?after=b3"
|
|
987
|
+
end
|
|
988
|
+
end
|
|
989
|
+
|
|
990
|
+
test "paging next cursor sends a value starting with a slash as the cursor" do
|
|
991
|
+
if has?("paging") do
|
|
992
|
+
pages = ["/c3", nil]
|
|
993
|
+
|
|
994
|
+
{urls, paging} =
|
|
995
|
+
paging_walk(fn n -> FH.make_response(200, H.deep(%{"next" => Enum.at(pages, n - 1)})) end, %{"next" => "cursor"})
|
|
996
|
+
|
|
997
|
+
assert urls == ["http://api.test/w?page=1", "http://api.test/w?cursor=%2Fc3"]
|
|
998
|
+
assert S.getprop(paging, "hasMore") == false
|
|
999
|
+
end
|
|
1000
|
+
end
|
|
1001
|
+
|
|
823
1002
|
test "paging non-list op is not paged" do
|
|
824
1003
|
if has?("paging") do
|
|
825
1004
|
{server, calls} = FH.recording_server()
|
|
@@ -857,6 +1036,25 @@ defmodule ProjectName.FeatureTest do
|
|
|
857
1036
|
end
|
|
858
1037
|
end
|
|
859
1038
|
|
|
1039
|
+
test "streaming keeps no stream on a failed result" do
|
|
1040
|
+
if has?("streaming") do
|
|
1041
|
+
{server, _calls} = FH.recording_server(fn _n, _fd -> {FH.make_response(503, H.deep([])), nil} end)
|
|
1042
|
+
h = harness([fspec("streaming")], %{server: server})
|
|
1043
|
+
res = FH.op(h, %{op: "list", path: "/w"})
|
|
1044
|
+
assert S.getprop(res.result, "stream") == nil
|
|
1045
|
+
assert S.getprop(res.result, "streaming") == nil
|
|
1046
|
+
end
|
|
1047
|
+
end
|
|
1048
|
+
|
|
1049
|
+
test "streaming an empty list streams nothing" do
|
|
1050
|
+
if has?("streaming") do
|
|
1051
|
+
{server, _calls} = FH.recording_server(fn _n, _fd -> {FH.make_response(200, H.deep([])), nil} end)
|
|
1052
|
+
h = harness([fspec("streaming")], %{server: server})
|
|
1053
|
+
res = FH.op(h, %{op: "list", path: "/w"})
|
|
1054
|
+
assert S.getprop(res.result, "stream").() == []
|
|
1055
|
+
end
|
|
1056
|
+
end
|
|
1057
|
+
|
|
860
1058
|
test "streaming non-list op is not streamed" do
|
|
861
1059
|
if has?("streaming") do
|
|
862
1060
|
h = harness([fspec("streaming")])
|
|
@@ -22,6 +22,7 @@ type Context struct {
|
|
|
22
22
|
Config map[string]any
|
|
23
23
|
Entopts map[string]any
|
|
24
24
|
Options map[string]any
|
|
25
|
+
CleanCfg any // the clean registry, beside the options rather than in them
|
|
25
26
|
Opmap map[string]*Operation
|
|
26
27
|
Opmu *sync.Mutex
|
|
27
28
|
Response *Response
|
|
@@ -131,6 +132,11 @@ func NewContext(ctxmap map[string]any, basectx *Context) *Context {
|
|
|
131
132
|
if ctx.Options == nil && basectx != nil {
|
|
132
133
|
ctx.Options = basectx.Options
|
|
133
134
|
}
|
|
135
|
+
if cc := getCtxProp(ctxmap, "cleancfg"); cc != nil {
|
|
136
|
+
ctx.CleanCfg = cc
|
|
137
|
+
} else if basectx != nil {
|
|
138
|
+
ctx.CleanCfg = basectx.CleanCfg
|
|
139
|
+
}
|
|
134
140
|
|
|
135
141
|
// Entity
|
|
136
142
|
if e := getCtxProp(ctxmap, "entity"); e != nil {
|
|
@@ -38,6 +38,17 @@ func fclean(ctx *core.Context, record map[string]any) map[string]any {
|
|
|
38
38
|
return record
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// A sink's panic or returned error never changes the operation's outcome.
|
|
42
|
+
func fsink(sink any, record map[string]any) {
|
|
43
|
+
defer func() { _ = recover() }()
|
|
44
|
+
switch fn := sink.(type) {
|
|
45
|
+
case func(map[string]any):
|
|
46
|
+
fn(record)
|
|
47
|
+
case func(map[string]any) error:
|
|
48
|
+
_ = fn(record)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
41
52
|
func (f *BaseFeature) GetVersion() string { return f.Version }
|
|
42
53
|
func (f *BaseFeature) GetName() string { return f.Name }
|
|
43
54
|
func (f *BaseFeature) GetActive() bool { return f.Active }
|