@voxgig/sdkgen 4.51.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 +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/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/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +2 -1
- 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 +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/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 +9 -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/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 +9 -4
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +19 -0
- package/project/.sdk/src/cmp/lua/TestClean_lua.ts +2 -1
- 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 +2 -1
- package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +36 -21
- package/project/.sdk/src/cmp/perl/TestClean_perl.ts +1 -1
- 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/fragment/Entity.fragment.php +33 -4
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
- 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 +1 -1
- 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 +14 -17
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +22 -2
- 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/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/ReadmeHowto_ts.ts +13 -8
- 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 +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/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/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 +184 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +2 -0
- package/project/.sdk/tm/c/utility/make_options.c +80 -9
- package/project/.sdk/tm/clojure/src/sdk/core.clj +31 -11
- package/project/.sdk/tm/clojure/src/sdk/features.clj +198 -70
- package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +70 -1
- package/project/.sdk/tm/cpp/core/types.hpp +137 -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/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/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 +137 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +35 -5
- package/project/.sdk/tm/csharp/feature/AuditFeature.cs +8 -1
- 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/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 +162 -0
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +89 -12
- 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/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 +59 -35
- package/project/.sdk/tm/elixir/test/feature_test.exs +137 -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/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/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 +209 -28
- package/project/.sdk/tm/go/test/feature_test.go +32 -0
- package/project/.sdk/tm/go/utility/make_options.go +111 -6
- 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/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/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 +170 -17
- package/project/.sdk/tm/java/utility/MakeOptions.java +128 -14
- 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/MakeOptionsUtility.js +55 -6
- package/project/.sdk/tm/js/test/feature/Corpus.test.js +95 -25
- package/project/.sdk/tm/js/test/feature.test.js +14 -1
- 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/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/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 +114 -0
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +83 -14
- 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/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 +100 -3
- package/project/.sdk/tm/lua/utility/make_options.lua +55 -13
- package/project/.sdk/tm/ocaml/sdk_features.ml +286 -60
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +34 -11
- package/project/.sdk/tm/ocaml/test/t_feature.ml +72 -1
- 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/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 +2 -2
- package/project/.sdk/tm/perl/t/feature_corpus.t +126 -23
- package/project/.sdk/tm/perl/utility/make_options.pm +33 -10
- 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/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 +151 -16
- package/project/.sdk/tm/php/utility/MakeOptions.php +40 -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/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/make_options.py +68 -20
- package/project/.sdk/tm/py/test/test_feature.py +11 -1
- package/project/.sdk/tm/py/test/test_feature_corpus.py +111 -16
- 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/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/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 +108 -24
- package/project/.sdk/tm/rb/test/feature_test.rb +1 -1
- package/project/.sdk/tm/rb/utility/make_options.rb +32 -11
- 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/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/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_test.rs +174 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +1 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +122 -27
- 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/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/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 +41 -0
- package/project/.sdk/tm/scala/utility/Make.scala +96 -13
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +3 -2
- 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/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/MakeOptions.swift +51 -13
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +111 -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/MakeOptionsUtility.ts +57 -6
- package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +95 -25
- package/project/.sdk/tm/ts/test/feature.test.ts +14 -1
- package/project/.sdk/tm/zig/core/utility.zig +107 -8
- 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/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 +109 -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
package/model/sdkgen.aontu
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ main: kit: feature: cache: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
# time-to-live in milliseconds; a response's Cache-Control max-age caps it
|
|
16
16
|
ttl: 5000
|
|
17
17
|
# maximum cached entries in this client's store (oldest evicted)
|
|
@@ -11,7 +11,7 @@ main: kit: feature: metrics: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -26,4 +26,6 @@ main: kit: feature: metrics: {
|
|
|
26
26
|
main: kit: feature: metrics: config: optspec: {
|
|
27
27
|
# injected clock, for deterministic durations
|
|
28
28
|
now: '`$FUNCTION`'
|
|
29
|
+
# receives a copy of the counters after each operation
|
|
30
|
+
sink: '`$FUNCTION`'
|
|
29
31
|
}
|
|
@@ -11,12 +11,15 @@ main: kit: feature: paging: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
pageParam: 'page'
|
|
16
16
|
limitParam: 'limit'
|
|
17
17
|
cursorParam: 'cursor'
|
|
18
18
|
startPage: 1
|
|
19
19
|
|
|
20
|
+
# how a body `next` is read: 'auto', 'cursor' or 'url'
|
|
21
|
+
next: 'auto'
|
|
22
|
+
|
|
20
23
|
# GraphQL (relay) list ops paginate through operation variables
|
|
21
24
|
# rather than query parameters. These name the variables to bind;
|
|
22
25
|
# the cursor/hasMore response paths come from the model's per-op
|
|
@@ -11,11 +11,9 @@ main: kit: feature: ratelimit: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
# tokens per second
|
|
16
16
|
rate: 5
|
|
17
|
-
# bucket capacity (defaults to `rate` when unset)
|
|
18
|
-
burst: 5
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -25,6 +23,8 @@ main: kit: feature: ratelimit: {
|
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
main: kit: feature: ratelimit: config: optspec: {
|
|
26
|
+
# bucket capacity; `rate` when unset
|
|
27
|
+
burst: '`$NUMBER`'
|
|
28
28
|
# injected clock
|
|
29
29
|
now: '`$FUNCTION`'
|
|
30
30
|
# injected delay, so a test need not really wait
|
|
@@ -907,7 +907,7 @@ main: kit: feature: secrets: {
|
|
|
907
907
|
|
|
908
908
|
config: {
|
|
909
909
|
options: {
|
|
910
|
-
active: false
|
|
910
|
+
active: *false | boolean
|
|
911
911
|
|
|
912
912
|
# The sekreto provider chain, in first-hit order. Each entry is a
|
|
913
913
|
# sekreto ProviderSpec ({ kind, name, ... }) or a provider object.
|
|
@@ -11,7 +11,7 @@ main: kit: feature: telemetry: {
|
|
|
11
11
|
|
|
12
12
|
config: {
|
|
13
13
|
options: {
|
|
14
|
-
active: false
|
|
14
|
+
active: *false | boolean
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -29,7 +29,7 @@ main: kit: feature: telemetry: config: optspec: {
|
|
|
29
29
|
exporter: '`$FUNCTION`'
|
|
30
30
|
# extra headers merged into the propagated context
|
|
31
31
|
headers: '`$MAP`'
|
|
32
|
-
# supplies trace and span ids
|
|
32
|
+
# supplies trace and span ids in place of random W3C ones
|
|
33
33
|
idgen: '`$FUNCTION`'
|
|
34
34
|
# injected clock
|
|
35
35
|
now: '`$FUNCTION`'
|
|
@@ -839,18 +839,16 @@ int main(void) {
|
|
|
839
839
|
// out whichever name prepare_auth placed.
|
|
840
840
|
drive(make_sdk_with(SC_OK, NULL, NULL, cmap(1, "name", v_str("zzcred"))), op, NULL);
|
|
841
841
|
|
|
842
|
-
// A credential mistyped as a map
|
|
843
|
-
//
|
|
844
|
-
|
|
845
|
-
${Name}SDK*
|
|
842
|
+
// A credential mistyped as a map is rejected by validation, whose message
|
|
843
|
+
// quotes the value it rejected.
|
|
844
|
+
PNError* rejected = NULL;
|
|
845
|
+
${Name}SDK* refused = ${ident}_sdk_new(offline(cmap(2,
|
|
846
846
|
"apikey", cmap(1, "value", v_str(CANARY_APIKEY)),
|
|
847
|
+
"clean", cmap(1, "values", v_str(CANARY_VALUE)))), &rejected);
|
|
848
|
+
CHECK(NULL == refused && NULL != rejected, "a credential mistyped as a map should be rejected");
|
|
849
|
+
if (rejected) push_error("rejected", rejected);
|
|
850
|
+
${Name}SDK* mistyped = ${ident}_sdk_new(offline(cmap(1,
|
|
847
851
|
"clean", cmap(1, "values", v_str(CANARY_VALUE)))), NULL);
|
|
848
|
-
{
|
|
849
|
-
char quoted[256];
|
|
850
|
-
snprintf(quoted, sizeof(quoted), "apikey: expected string, got {\\"value\\":\\"%s\\"}",
|
|
851
|
-
CANARY_APIKEY);
|
|
852
|
-
push("mistyped:quoted", clean_str(sdk_get_root_ctx(mistyped), quoted));
|
|
853
|
-
}
|
|
854
852
|
|
|
855
853
|
// An error a feature hook raises, quoting the request, with explain on.
|
|
856
854
|
Feature* thrower = (Feature*)calloc(1, sizeof(CaptureFeature));
|
|
@@ -1047,13 +1045,16 @@ int main(void) {
|
|
|
1047
1045
|
// name and id, is not read at all, and nor are rbac's rules, keyed by entity
|
|
1048
1046
|
// and operation names.
|
|
1049
1047
|
{
|
|
1048
|
+
voxgig_value* providers = v_list();
|
|
1049
|
+
voxgig_list_push(voxgig_as_list(providers),
|
|
1050
|
+
cmap(2, "name", v_str("static"), "token", v_str("ZZTOKEN-feat456")));
|
|
1050
1051
|
${Name}SDK* featured = ${ident}_sdk_new(offline(cmap(3,
|
|
1051
1052
|
"apikey", v_str(CANARY_APIKEY),
|
|
1052
1053
|
"feature", cmap(3,
|
|
1053
1054
|
"secrets", cmap(3,
|
|
1054
1055
|
"active", v_bool(false),
|
|
1055
1056
|
"name", v_str("ZZNAME-feat123"),
|
|
1056
|
-
"
|
|
1057
|
+
"providers", providers),
|
|
1057
1058
|
"rbac", cmap(2,
|
|
1058
1059
|
"active", v_bool(false),
|
|
1059
1060
|
"rules", cmap(1, "zztoken.load", v_str("PLAINRULE-k7j5h3g1"))),
|
|
@@ -72,6 +72,13 @@ Entity* entyvar_entity_new(ProjectNameSDK* client, voxgig_value* entopts) {
|
|
|
72
72
|
return (Entity*)self;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// A failed step leaves through make_error, then PreDone, which it skipped.
|
|
76
|
+
static voxgig_value* entyvar_failed(Context* ctx, PNError* e, PNError** err) {
|
|
77
|
+
voxgig_value* out = make_error_util(ctx, e, err);
|
|
78
|
+
feature_hook_util(ctx, "PreDone");
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
|
|
75
82
|
// Pipeline: make_point -> make_spec -> make_request -> make_response ->
|
|
76
83
|
// make_result -> post_done -> done. Feature hooks fire between stages.
|
|
77
84
|
static voxgig_value* entyvar_run_op(entyvar_entity* self, Context* ctx,
|
|
@@ -83,31 +90,31 @@ static voxgig_value* entyvar_run_op(entyvar_entity* self, Context* ctx,
|
|
|
83
90
|
// #PrePoint-Hook
|
|
84
91
|
|
|
85
92
|
voxgig_value* point = make_point_util(ctx, &e);
|
|
86
|
-
if (e) return
|
|
93
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
87
94
|
ctx_out_set_point_val(ctx, point);
|
|
88
95
|
|
|
89
96
|
// #PreSpec-Hook
|
|
90
97
|
|
|
91
98
|
Spec* spec = make_spec_util(ctx, &e);
|
|
92
|
-
if (e) return
|
|
99
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
93
100
|
ctx->out_spec = spec;
|
|
94
101
|
|
|
95
102
|
// #PreRequest-Hook
|
|
96
103
|
|
|
97
104
|
Response* resp = make_request_util(ctx, &e);
|
|
98
|
-
if (e) return
|
|
105
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
99
106
|
ctx->out_request = resp;
|
|
100
107
|
|
|
101
108
|
// #PreResponse-Hook
|
|
102
109
|
|
|
103
110
|
Response* resp2 = make_response_util(ctx, &e);
|
|
104
|
-
if (e) return
|
|
111
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
105
112
|
ctx->out_response = resp2;
|
|
106
113
|
|
|
107
114
|
// #PreResult-Hook
|
|
108
115
|
|
|
109
116
|
SdkResult* result = make_result_util(ctx, &e);
|
|
110
|
-
if (e) return
|
|
117
|
+
if (e) return entyvar_failed(ctx, e, err);
|
|
111
118
|
ctx->out_result = result;
|
|
112
119
|
|
|
113
120
|
// #PreDone-Hook
|
|
@@ -176,27 +183,27 @@ voxgig_value* entyvar_stream(Entity* e, const char* action, voxgig_value* args,
|
|
|
176
183
|
|
|
177
184
|
feature_hook_util(ctx, "PrePoint");
|
|
178
185
|
voxgig_value* point = make_point_util(ctx, &pe);
|
|
179
|
-
if (pe) return entyvar_stream_items(
|
|
186
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
180
187
|
ctx_out_set_point_val(ctx, point);
|
|
181
188
|
|
|
182
189
|
feature_hook_util(ctx, "PreSpec");
|
|
183
190
|
Spec* spec = make_spec_util(ctx, &pe);
|
|
184
|
-
if (pe) return entyvar_stream_items(
|
|
191
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
185
192
|
ctx->out_spec = spec;
|
|
186
193
|
|
|
187
194
|
feature_hook_util(ctx, "PreRequest");
|
|
188
195
|
Response* resp = make_request_util(ctx, &pe);
|
|
189
|
-
if (pe) return entyvar_stream_items(
|
|
196
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
190
197
|
ctx->out_request = resp;
|
|
191
198
|
|
|
192
199
|
feature_hook_util(ctx, "PreResponse");
|
|
193
200
|
Response* resp2 = make_response_util(ctx, &pe);
|
|
194
|
-
if (pe) return entyvar_stream_items(
|
|
201
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
195
202
|
ctx->out_response = resp2;
|
|
196
203
|
|
|
197
204
|
feature_hook_util(ctx, "PreResult");
|
|
198
205
|
SdkResult* result = make_result_util(ctx, &pe);
|
|
199
|
-
if (pe) return entyvar_stream_items(
|
|
206
|
+
if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
|
|
200
207
|
ctx->out_result = result;
|
|
201
208
|
|
|
202
209
|
feature_hook_util(ctx, "PreDone");
|
|
@@ -91,7 +91,19 @@
|
|
|
91
91
|
(when-not (= false (core/oget (core/oget ctx :ctrl) :throw))
|
|
92
92
|
(throw cleaned)))))
|
|
93
93
|
|
|
94
|
+
(defn- late-done
|
|
95
|
+
"PreDone on an exit that left before it. What the hook throws leaves
|
|
96
|
+
cleaned, in place of the error already on its way out."
|
|
97
|
+
[ctx]
|
|
98
|
+
(try
|
|
99
|
+
(core/feature-hook ctx "PreDone")
|
|
100
|
+
(catch Throwable hookerr
|
|
101
|
+
(let [cleaned (core/clean-throwable ctx hookerr)]
|
|
102
|
+
(when-not (= false (core/oget (core/oget ctx :ctrl) :throw))
|
|
103
|
+
(throw cleaned))))))
|
|
104
|
+
|
|
94
105
|
(defn- run-op [ctx post-done]
|
|
106
|
+
(let [predone (volatile! false)]
|
|
95
107
|
(try
|
|
96
108
|
; #PrePoint-Hook
|
|
97
109
|
(let [[point err] ((core/uget ctx :make-point) ctx)]
|
|
@@ -123,11 +135,16 @@
|
|
|
123
135
|
(if err
|
|
124
136
|
((core/uget ctx :make-error) ctx err)
|
|
125
137
|
(do
|
|
138
|
+
(vreset! predone true)
|
|
126
139
|
; #PreDone-Hook
|
|
127
140
|
(post-done)
|
|
128
141
|
((core/uget ctx :done) ctx))))))))))))))))
|
|
129
142
|
(catch Throwable operr
|
|
130
|
-
(unexpected ctx operr))
|
|
143
|
+
(unexpected ctx operr))
|
|
144
|
+
;; A refusal, a failed step or a throw left before PreDone.
|
|
145
|
+
(finally
|
|
146
|
+
(when-not @predone
|
|
147
|
+
(late-done ctx))))))
|
|
131
148
|
|
|
132
149
|
;; Streaming operation. Runs `action` (an op name, e.g. "list") through the
|
|
133
150
|
;; full pipeline and returns a LAZY SEQUENCE of result items, so incremental
|
|
@@ -894,7 +894,8 @@ static void a_feature_name_is_read_as_a_name() {
|
|
|
894
894
|
{"apikey", Value(CANARY_APIKEY)},
|
|
895
895
|
{"feature", vmap({
|
|
896
896
|
{"secrets", vmap({
|
|
897
|
-
{"active", Value(false)}, {"name", Value("ZZNAME-feat123")},
|
|
897
|
+
{"active", Value(false)}, {"name", Value("ZZNAME-feat123")},
|
|
898
|
+
{"providers", vlist({vmap({{"name", Value("static")}, {"token", Value("ZZTOKEN-feat456")}})})},
|
|
898
899
|
})},
|
|
899
900
|
{"rbac", vmap({
|
|
900
901
|
{"active", Value(false)}, {"rules", vmap({{"zztoken.load", Value("PLAINRULE-k7j5h3g1")}})},
|
|
@@ -124,14 +124,41 @@ public abstract class ProjectNameEntityBase : IEntity
|
|
|
124
124
|
|
|
125
125
|
protected object? RunOp(Context ctx, Action postDone)
|
|
126
126
|
{
|
|
127
|
+
var predone = false;
|
|
127
128
|
try
|
|
128
129
|
{
|
|
129
|
-
return RunPipeline(ctx, postDone);
|
|
130
|
+
return RunPipeline(ctx, postDone, ref predone);
|
|
130
131
|
}
|
|
131
132
|
catch (Exception err) when (!ReferenceEquals(err, ctx.Ctrl.Err))
|
|
132
133
|
{
|
|
133
134
|
return Unexpected(ctx, err);
|
|
134
135
|
}
|
|
136
|
+
finally
|
|
137
|
+
{
|
|
138
|
+
// A refusal, a failed step or a throw left before PreDone.
|
|
139
|
+
if (!predone)
|
|
140
|
+
{
|
|
141
|
+
LateDone(ctx);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// PreDone on an exit that left before it. What the hook throws leaves
|
|
147
|
+
// cleaned, in place of the error already on its way out.
|
|
148
|
+
private void LateDone(Context ctx)
|
|
149
|
+
{
|
|
150
|
+
try
|
|
151
|
+
{
|
|
152
|
+
utility.FeatureHook(ctx, "PreDone");
|
|
153
|
+
}
|
|
154
|
+
catch (Exception err) when (ctx.Ctrl.Throw != false)
|
|
155
|
+
{
|
|
156
|
+
var cause = Unwrapped(err);
|
|
157
|
+
throw utility.Clean(ctx, cause) as Exception ?? cause;
|
|
158
|
+
}
|
|
159
|
+
catch (Exception)
|
|
160
|
+
{
|
|
161
|
+
}
|
|
135
162
|
}
|
|
136
163
|
|
|
137
164
|
// The catch path. A hook's exception never passed through MakeError, and
|
|
@@ -154,7 +181,7 @@ public abstract class ProjectNameEntityBase : IEntity
|
|
|
154
181
|
private static Exception Unwrapped(Exception err) =>
|
|
155
182
|
err is TargetInvocationException { InnerException: { } inner } ? inner : err;
|
|
156
183
|
|
|
157
|
-
private object? RunPipeline(Context ctx, Action postDone)
|
|
184
|
+
private object? RunPipeline(Context ctx, Action postDone, ref bool predone)
|
|
158
185
|
{
|
|
159
186
|
// #PrePoint-Hook
|
|
160
187
|
|
|
@@ -216,6 +243,7 @@ public abstract class ProjectNameEntityBase : IEntity
|
|
|
216
243
|
return utility.MakeError(ctx, err);
|
|
217
244
|
}
|
|
218
245
|
|
|
246
|
+
predone = true;
|
|
219
247
|
// #PreDone-Hook
|
|
220
248
|
|
|
221
249
|
postDone();
|
|
@@ -61,27 +61,46 @@ public class ProjectNameSDK
|
|
|
61
61
|
var featureOrder = global::Voxgig.Struct.StructUtils.GetPath(_options,
|
|
62
62
|
global::Voxgig.Struct.StructUtils.Jt("__derived__", "featureorder")) as List<object?>
|
|
63
63
|
?? new List<object?>();
|
|
64
|
+
bool Active(string fname)
|
|
65
|
+
{
|
|
66
|
+
var fopts = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(featureOpts, fname));
|
|
67
|
+
return fopts != null && fopts.TryGetValue("active", out var active) && active is bool ab && ab;
|
|
68
|
+
}
|
|
69
|
+
var extend = (global::Voxgig.Struct.StructUtils.GetProp(_options, "extend") as List<object?>)
|
|
70
|
+
?.OfType<BaseFeature>().ToList() ?? new List<BaseFeature>();
|
|
71
|
+
var placed = new List<BaseFeature>();
|
|
64
72
|
foreach (var fnameObj in featureOrder)
|
|
65
73
|
{
|
|
66
74
|
var fname = fnameObj as string ?? "";
|
|
67
|
-
|
|
68
|
-
if (fopts != null &&
|
|
69
|
-
fopts.TryGetValue("active", out var active) &&
|
|
70
|
-
active is bool ab && ab)
|
|
75
|
+
if (!Active(fname))
|
|
71
76
|
{
|
|
72
|
-
|
|
77
|
+
continue;
|
|
73
78
|
}
|
|
79
|
+
var gen = global::ProjectNameSdk.SdkConfig.MakeFeature(fname);
|
|
80
|
+
// An active name with no generated class is legal when an
|
|
81
|
+
// extend-supplied instance carries that name (station's adopt
|
|
82
|
+
// path): the instance takes the slot the order gives its name.
|
|
83
|
+
var carried = gen.GetName() == fname ? null : extend.FirstOrDefault(f => f.GetName() == fname);
|
|
84
|
+
if (carried != null)
|
|
85
|
+
{
|
|
86
|
+
placed.Add(carried);
|
|
87
|
+
_utility.FeatureAdd(_rootctx, carried);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
_utility.FeatureAdd(_rootctx, gen);
|
|
74
91
|
}
|
|
75
92
|
|
|
76
|
-
//
|
|
77
|
-
|
|
93
|
+
// An extend feature is active by its option, else by its own flag.
|
|
94
|
+
bool ExtActive(BaseFeature feat)
|
|
95
|
+
{
|
|
96
|
+
var fopts = global::ProjectNameSdk.Helpers.ToMapAny(global::Voxgig.Struct.StructUtils.GetProp(featureOpts, feat.GetName()));
|
|
97
|
+
return fopts != null && fopts.TryGetValue("active", out var fa) && fa is bool fab ? fab : feat.GetActive();
|
|
98
|
+
}
|
|
99
|
+
foreach (var feat in extend)
|
|
78
100
|
{
|
|
79
|
-
|
|
101
|
+
if (!placed.Any(p => ReferenceEquals(p, feat)) && ExtActive(feat))
|
|
80
102
|
{
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
_utility.FeatureAdd(_rootctx, feat);
|
|
84
|
-
}
|
|
103
|
+
_utility.FeatureAdd(_rootctx, feat);
|
|
85
104
|
}
|
|
86
105
|
}
|
|
87
106
|
|
|
@@ -713,7 +713,8 @@ ${candidates(Name, entity, model)}
|
|
|
713
713
|
"apikey", @canary.apikey,
|
|
714
714
|
"feature",
|
|
715
715
|
S.jm([
|
|
716
|
-
"secrets", S.jm(["active", false, "name", "ZZNAME-feat123",
|
|
716
|
+
"secrets", S.jm(["active", false, "name", "ZZNAME-feat123",
|
|
717
|
+
"providers", [S.jm(["name", "static", "token", "ZZTOKEN-feat456"])]]),
|
|
717
718
|
"rbac", S.jm(["active", false, "rules", S.jm(["zztoken.load", "PLAINRULE-k7j5h3g1"])]),
|
|
718
719
|
"test", S.jm(["active", false, "entity", record])
|
|
719
720
|
]),
|
|
@@ -50,26 +50,62 @@ defmodule ProjectName do
|
|
|
50
50
|
feature_opts = H.or_(H.to_map(S.getprop(opts, "feature")), S.jm([]))
|
|
51
51
|
feature_order = S.getpath(opts, "__derived__.featureorder")
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
fom = H.to_map(S.getprop(feature_opts, fname))
|
|
57
|
-
|
|
58
|
-
if fom != nil and S.getprop(fom, "active") == true do
|
|
59
|
-
Utility.feature_add(rootctx, ProjectName.Features.make_feature(fname))
|
|
60
|
-
end
|
|
61
|
-
end)
|
|
53
|
+
active = fn fname ->
|
|
54
|
+
fom = H.to_map(S.getprop(feature_opts, fname))
|
|
55
|
+
fom != nil and S.getprop(fom, "active") == true
|
|
62
56
|
end
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
given = S.getprop(opts, "extend")
|
|
59
|
+
|
|
60
|
+
extend =
|
|
61
|
+
if S.islist(given) and S.size(given) > 0,
|
|
62
|
+
do: Enum.filter(Enum.map(0..(S.size(given) - 1), &S.getelem(given, &1)), &S.ismap/1),
|
|
63
|
+
else: []
|
|
64
|
+
|
|
65
|
+
placed =
|
|
66
|
+
if S.islist(feature_order) and S.size(feature_order) > 0 do
|
|
67
|
+
Enum.flat_map(0..(S.size(feature_order) - 1), fn i ->
|
|
68
|
+
fname = S.getelem(feature_order, i)
|
|
69
|
+
|
|
70
|
+
if active.(fname) do
|
|
71
|
+
gen = ProjectName.Features.make_feature(fname)
|
|
72
|
+
|
|
73
|
+
# An active name with no generated class is legal when an
|
|
74
|
+
# extend-supplied instance carries that name (station's adopt
|
|
75
|
+
# path): the instance takes the slot the order gives its name.
|
|
76
|
+
carried =
|
|
77
|
+
if S.getprop(gen, "name") != fname,
|
|
78
|
+
do: Enum.find(extend, fn fx -> S.getprop(fx, "name") == fname end)
|
|
79
|
+
|
|
80
|
+
if carried != nil do
|
|
81
|
+
Utility.feature_add(rootctx, carried)
|
|
82
|
+
[carried]
|
|
83
|
+
else
|
|
84
|
+
Utility.feature_add(rootctx, gen)
|
|
85
|
+
[]
|
|
86
|
+
end
|
|
87
|
+
else
|
|
88
|
+
[]
|
|
89
|
+
end
|
|
90
|
+
end)
|
|
91
|
+
else
|
|
92
|
+
[]
|
|
93
|
+
end
|
|
65
94
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
95
|
+
# An extend feature is active by its option, else by its own flag.
|
|
96
|
+
ext_active = fn fx ->
|
|
97
|
+
fom = H.to_map(S.getprop(feature_opts, S.getprop(fx, "name")))
|
|
98
|
+
fa = if fom != nil, do: S.getprop(fom, "active")
|
|
99
|
+
|
|
100
|
+
if is_boolean(fa), do: fa, else: S.getprop(fx, "active") == true
|
|
71
101
|
end
|
|
72
102
|
|
|
103
|
+
Enum.each(extend, fn fx ->
|
|
104
|
+
unless Enum.any?(placed, &(&1 === fx)) or not ext_active.(fx) do
|
|
105
|
+
Utility.feature_add(rootctx, fx)
|
|
106
|
+
end
|
|
107
|
+
end)
|
|
108
|
+
|
|
73
109
|
Enum.each(S.getprop(client, "features"), fn fe -> Utility.feature_init(rootctx, fe) end)
|
|
74
110
|
Utility.feature_hook(rootctx, "PostConstruct")
|
|
75
111
|
|