@voxgig/sdkgen 1.3.8 → 1.3.9
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/package.json +1 -1
- package/project/.sdk/model/feature/audit.aontu +22 -0
- package/project/.sdk/model/feature/cache.aontu +23 -0
- package/project/.sdk/model/feature/clienttrack.aontu +20 -0
- package/project/.sdk/model/feature/debug.aontu +25 -0
- package/project/.sdk/model/feature/feature-index.aontu +20 -1
- package/project/.sdk/model/feature/idempotency.aontu +21 -0
- package/project/.sdk/model/feature/metrics.aontu +20 -0
- package/project/.sdk/model/feature/netsim.aontu +36 -0
- package/project/.sdk/model/feature/paging.aontu +23 -0
- package/project/.sdk/model/feature/proxy.aontu +23 -0
- package/project/.sdk/model/feature/ratelimit.aontu +21 -0
- package/project/.sdk/model/feature/rbac.aontu +24 -0
- package/project/.sdk/model/feature/retry.aontu +23 -0
- package/project/.sdk/model/feature/streaming.aontu +22 -0
- package/project/.sdk/model/feature/telemetry.aontu +21 -0
- package/project/.sdk/model/feature/timeout.aontu +18 -0
- package/project/.sdk/model/target/c.aontu +37 -0
- package/project/.sdk/model/target/clojure.aontu +36 -0
- package/project/.sdk/model/target/cpp.aontu +35 -0
- package/project/.sdk/model/target/csharp.aontu +35 -0
- package/project/.sdk/model/target/dart.aontu +34 -0
- package/project/.sdk/model/target/elixir.aontu +33 -0
- package/project/.sdk/model/target/haskell.aontu +47 -0
- package/project/.sdk/model/target/java.aontu +37 -0
- package/project/.sdk/model/target/kotlin.aontu +37 -0
- package/project/.sdk/model/target/ocaml.aontu +36 -0
- package/project/.sdk/model/target/perl.aontu +37 -0
- package/project/.sdk/model/target/rust.aontu +37 -0
- package/project/.sdk/model/target/scala.aontu +37 -0
- package/project/.sdk/model/target/swift.aontu +35 -0
- package/project/.sdk/model/target/zig.aontu +27 -0
- package/project/.sdk/src/cmp/c/Config_c.ts +109 -0
- package/project/.sdk/src/cmp/c/EntityBase_c.ts +61 -0
- package/project/.sdk/src/cmp/c/EntityOperation_c.ts +41 -0
- package/project/.sdk/src/cmp/c/Entity_c.ts +85 -0
- package/project/.sdk/src/cmp/c/Gitignore_c.ts +29 -0
- package/project/.sdk/src/cmp/c/MainEntity_c.ts +31 -0
- package/project/.sdk/src/cmp/c/Main_c.ts +83 -0
- package/project/.sdk/src/cmp/c/Package_c.ts +17 -0
- package/project/.sdk/src/cmp/c/TestDirect_c.ts +227 -0
- package/project/.sdk/src/cmp/c/TestEntity_c.ts +82 -0
- package/project/.sdk/src/cmp/c/Test_c.ts +51 -0
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +265 -0
- package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +27 -0
- package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +24 -0
- package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +29 -0
- package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +29 -0
- package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +29 -0
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +220 -0
- package/project/.sdk/src/cmp/c/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/c/utility_c.ts +102 -0
- package/project/.sdk/src/cmp/clojure/Config_clojure.ts +94 -0
- package/project/.sdk/src/cmp/clojure/EntityOperation_clojure.ts +35 -0
- package/project/.sdk/src/cmp/clojure/Entity_clojure.ts +77 -0
- package/project/.sdk/src/cmp/clojure/Gitignore_clojure.ts +28 -0
- package/project/.sdk/src/cmp/clojure/MainEntity_clojure.ts +21 -0
- package/project/.sdk/src/cmp/clojure/Main_clojure.ts +88 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +41 -0
- package/project/.sdk/src/cmp/clojure/Test_clojure.ts +120 -0
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +158 -0
- package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +14 -0
- package/project/.sdk/src/cmp/clojure/fragment/EntityListOp.fragment.clj +17 -0
- package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +15 -0
- package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +15 -0
- package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +15 -0
- package/project/.sdk/src/cmp/clojure/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/clojure/utility_clojure.ts +82 -0
- package/project/.sdk/src/cmp/cpp/Config_cpp.ts +136 -0
- package/project/.sdk/src/cmp/cpp/EntityBase_cpp.ts +51 -0
- package/project/.sdk/src/cmp/cpp/EntityOperation_cpp.ts +37 -0
- package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +78 -0
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +27 -0
- package/project/.sdk/src/cmp/cpp/MainEntity_cpp.ts +35 -0
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +84 -0
- package/project/.sdk/src/cmp/cpp/Package_cpp.ts +17 -0
- package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +258 -0
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +454 -0
- package/project/.sdk/src/cmp/cpp/Test_cpp.ts +36 -0
- package/project/.sdk/src/cmp/cpp/fragment/Entity.fragment.cpp +40 -0
- package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +22 -0
- package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +21 -0
- package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +25 -0
- package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +21 -0
- package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +22 -0
- package/project/.sdk/src/cmp/cpp/fragment/Main.fragment.cpp +43 -0
- package/project/.sdk/src/cmp/cpp/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/cpp/utility_cpp.ts +83 -0
- package/project/.sdk/src/cmp/csharp/Config_csharp.ts +134 -0
- package/project/.sdk/src/cmp/csharp/EntityBase_csharp.ts +39 -0
- package/project/.sdk/src/cmp/csharp/EntityOperation_csharp.ts +41 -0
- package/project/.sdk/src/cmp/csharp/Entity_csharp.ts +85 -0
- package/project/.sdk/src/cmp/csharp/Gitignore_csharp.ts +38 -0
- package/project/.sdk/src/cmp/csharp/MainEntity_csharp.ts +36 -0
- package/project/.sdk/src/cmp/csharp/Main_csharp.ts +91 -0
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +101 -0
- package/project/.sdk/src/cmp/csharp/SdkError_csharp.ts +42 -0
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +560 -0
- package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +618 -0
- package/project/.sdk/src/cmp/csharp/Test_csharp.ts +38 -0
- package/project/.sdk/src/cmp/csharp/fragment/Entity.fragment.cs +28 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +268 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityCreateOp.fragment.cs +37 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityListOp.fragment.cs +35 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityLoadOp.fragment.cs +41 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityRemoveOp.fragment.cs +41 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityUpdateOp.fragment.cs +41 -0
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +278 -0
- package/project/.sdk/src/cmp/csharp/fragment/SdkError.fragment.cs +21 -0
- package/project/.sdk/src/cmp/csharp/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/csharp/utility_csharp.ts +143 -0
- package/project/.sdk/src/cmp/dart/Config_dart.ts +99 -0
- package/project/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
- package/project/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
- package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +190 -0
- package/project/.sdk/src/cmp/dart/Entity_dart.ts +79 -0
- package/project/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
- package/project/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
- package/project/.sdk/src/cmp/dart/Main_dart.ts +105 -0
- package/project/.sdk/src/cmp/dart/Package_dart.ts +81 -0
- package/project/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +498 -0
- package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +552 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +105 -0
- package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +48 -0
- package/project/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
- package/project/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +31 -0
- package/project/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +67 -0
- package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +285 -0
- package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +90 -0
- package/project/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
- package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +94 -0
- package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +94 -0
- package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +94 -0
- package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +240 -0
- package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +18 -0
- package/project/.sdk/src/cmp/dart/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/dart/utility_dart.ts +86 -0
- package/project/.sdk/src/cmp/elixir/Config_elixir.ts +101 -0
- package/project/.sdk/src/cmp/elixir/EntityOperation_elixir.ts +27 -0
- package/project/.sdk/src/cmp/elixir/Entity_elixir.ts +54 -0
- package/project/.sdk/src/cmp/elixir/Gitignore_elixir.ts +28 -0
- package/project/.sdk/src/cmp/elixir/MainEntity_elixir.ts +26 -0
- package/project/.sdk/src/cmp/elixir/Main_elixir.ts +124 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +64 -0
- package/project/.sdk/src/cmp/elixir/TestDirect_elixir.ts +95 -0
- package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +115 -0
- package/project/.sdk/src/cmp/elixir/Test_elixir.ts +47 -0
- package/project/.sdk/src/cmp/elixir/fragment/Entity.fragment.ex +37 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +28 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +30 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +32 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +32 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +30 -0
- package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +218 -0
- package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +62 -0
- package/project/.sdk/src/cmp/elixir/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/elixir/utility_elixir.ts +85 -0
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +54 -0
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +133 -0
- package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +14 -8
- package/project/.sdk/src/cmp/haskell/Config_haskell.ts +115 -0
- package/project/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
- package/project/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
- package/project/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
- package/project/.sdk/src/cmp/haskell/Package_haskell.ts +58 -0
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +263 -0
- package/project/.sdk/src/cmp/haskell/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/haskell/utility_haskell.ts +105 -0
- package/project/.sdk/src/cmp/java/Config_java.ts +138 -0
- package/project/.sdk/src/cmp/java/EntityBase_java.ts +50 -0
- package/project/.sdk/src/cmp/java/EntityOperation_java.ts +48 -0
- package/project/.sdk/src/cmp/java/Entity_java.ts +95 -0
- package/project/.sdk/src/cmp/java/Gitignore_java.ts +37 -0
- package/project/.sdk/src/cmp/java/MainEntity_java.ts +41 -0
- package/project/.sdk/src/cmp/java/Main_java.ts +100 -0
- package/project/.sdk/src/cmp/java/Package_java.ts +126 -0
- package/project/.sdk/src/cmp/java/SdkError_java.ts +49 -0
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +509 -0
- package/project/.sdk/src/cmp/java/TestEntity_java.ts +599 -0
- package/project/.sdk/src/cmp/java/Test_java.ts +42 -0
- package/project/.sdk/src/cmp/java/fragment/Entity.fragment.java +35 -0
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +235 -0
- package/project/.sdk/src/cmp/java/fragment/EntityCreateOp.fragment.java +42 -0
- package/project/.sdk/src/cmp/java/fragment/EntityListOp.fragment.java +39 -0
- package/project/.sdk/src/cmp/java/fragment/EntityLoadOp.fragment.java +45 -0
- package/project/.sdk/src/cmp/java/fragment/EntityRemoveOp.fragment.java +45 -0
- package/project/.sdk/src/cmp/java/fragment/EntityUpdateOp.fragment.java +45 -0
- package/project/.sdk/src/cmp/java/fragment/Main.fragment.java +34 -0
- package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +27 -0
- package/project/.sdk/src/cmp/java/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/java/utility_java.ts +102 -0
- package/project/.sdk/src/cmp/js/Config_js.ts +4 -2
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +1 -0
- package/project/.sdk/src/cmp/js/fragment/Entity.test.fragment.js +32 -1
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +81 -0
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +10 -5
- package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +128 -0
- package/project/.sdk/src/cmp/kotlin/EntityBase_kotlin.ts +50 -0
- package/project/.sdk/src/cmp/kotlin/EntityOperation_kotlin.ts +48 -0
- package/project/.sdk/src/cmp/kotlin/Entity_kotlin.ts +93 -0
- package/project/.sdk/src/cmp/kotlin/Gitignore_kotlin.ts +41 -0
- package/project/.sdk/src/cmp/kotlin/MainEntity_kotlin.ts +40 -0
- package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +94 -0
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +110 -0
- package/project/.sdk/src/cmp/kotlin/SdkError_kotlin.ts +48 -0
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +479 -0
- package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +567 -0
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +42 -0
- package/project/.sdk/src/cmp/kotlin/fragment/Entity.fragment.kt +28 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +195 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityCreateOp.fragment.kt +37 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityListOp.fragment.kt +34 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityLoadOp.fragment.kt +40 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityRemoveOp.fragment.kt +40 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityUpdateOp.fragment.kt +40 -0
- package/project/.sdk/src/cmp/kotlin/fragment/Main.fragment.kt +28 -0
- package/project/.sdk/src/cmp/kotlin/fragment/SdkError.fragment.kt +24 -0
- package/project/.sdk/src/cmp/kotlin/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/kotlin/utility_kotlin.ts +101 -0
- package/project/.sdk/src/cmp/lua/Entity_lua.ts +7 -9
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +47 -0
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +137 -0
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +9 -6
- package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +114 -0
- package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +63 -0
- package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +152 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +37 -0
- package/project/.sdk/src/cmp/ocaml/MainEntity_ocaml.ts +28 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +111 -0
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +47 -0
- package/project/.sdk/src/cmp/ocaml/SdkError_ocaml.ts +42 -0
- package/project/.sdk/src/cmp/ocaml/TestDirect_ocaml.ts +47 -0
- package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +130 -0
- package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +35 -0
- package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +32 -0
- package/project/.sdk/src/cmp/ocaml/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/ocaml/utility_ocaml.ts +129 -0
- package/project/.sdk/src/cmp/perl/Config_perl.ts +127 -0
- package/project/.sdk/src/cmp/perl/EntityOperation_perl.ts +42 -0
- package/project/.sdk/src/cmp/perl/Entity_perl.ts +84 -0
- package/project/.sdk/src/cmp/perl/Gitignore_perl.ts +32 -0
- package/project/.sdk/src/cmp/perl/MainEntity_perl.ts +34 -0
- package/project/.sdk/src/cmp/perl/Main_perl.ts +140 -0
- package/project/.sdk/src/cmp/perl/Package_perl.ts +63 -0
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +433 -0
- package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +515 -0
- package/project/.sdk/src/cmp/perl/Test_perl.ts +54 -0
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +235 -0
- package/project/.sdk/src/cmp/perl/fragment/EntityCreateOp.fragment.pm +31 -0
- package/project/.sdk/src/cmp/perl/fragment/EntityListOp.fragment.pm +43 -0
- package/project/.sdk/src/cmp/perl/fragment/EntityLoadOp.fragment.pm +34 -0
- package/project/.sdk/src/cmp/perl/fragment/EntityRemoveOp.fragment.pm +32 -0
- package/project/.sdk/src/cmp/perl/fragment/EntityUpdateOp.fragment.pm +32 -0
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +263 -0
- package/project/.sdk/src/cmp/perl/fragment/SdkError.fragment.pm +27 -0
- package/project/.sdk/src/cmp/perl/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/perl/utility_perl.ts +30 -0
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +45 -0
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +124 -0
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
- package/project/.sdk/src/cmp/py/Entity_py.ts +8 -9
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +40 -0
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +135 -28
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +9 -6
- package/project/.sdk/src/cmp/rb/Entity_rb.ts +8 -9
- package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +4 -1
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +42 -0
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +122 -23
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +9 -6
- package/project/.sdk/src/cmp/rust/Config_rust.ts +118 -0
- package/project/.sdk/src/cmp/rust/EntityBase_rust.ts +59 -0
- package/project/.sdk/src/cmp/rust/EntityOperation_rust.ts +44 -0
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +94 -0
- package/project/.sdk/src/cmp/rust/Gitignore_rust.ts +29 -0
- package/project/.sdk/src/cmp/rust/MainEntity_rust.ts +37 -0
- package/project/.sdk/src/cmp/rust/Main_rust.ts +146 -0
- package/project/.sdk/src/cmp/rust/Package_rust.ts +80 -0
- package/project/.sdk/src/cmp/rust/SdkError_rust.ts +42 -0
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +448 -0
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +635 -0
- package/project/.sdk/src/cmp/rust/Test_rust.ts +51 -0
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +288 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +29 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +26 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +35 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +35 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +35 -0
- package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +296 -0
- package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +34 -0
- package/project/.sdk/src/cmp/rust/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/rust/utility_rust.ts +104 -0
- package/project/.sdk/src/cmp/scala/Config_scala.ts +126 -0
- package/project/.sdk/src/cmp/scala/EntityBase_scala.ts +50 -0
- package/project/.sdk/src/cmp/scala/EntityOperation_scala.ts +46 -0
- package/project/.sdk/src/cmp/scala/Entity_scala.ts +87 -0
- package/project/.sdk/src/cmp/scala/Gitignore_scala.ts +31 -0
- package/project/.sdk/src/cmp/scala/MainEntity_scala.ts +40 -0
- package/project/.sdk/src/cmp/scala/Main_scala.ts +93 -0
- package/project/.sdk/src/cmp/scala/Package_scala.ts +22 -0
- package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +233 -0
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +397 -0
- package/project/.sdk/src/cmp/scala/Test_scala.ts +93 -0
- package/project/.sdk/src/cmp/scala/fragment/Entity.fragment.scala +24 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +169 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityCreateOp.fragment.scala +32 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityListOp.fragment.scala +28 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityLoadOp.fragment.scala +33 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityRemoveOp.fragment.scala +33 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityUpdateOp.fragment.scala +33 -0
- package/project/.sdk/src/cmp/scala/fragment/Main.fragment.scala +27 -0
- package/project/.sdk/src/cmp/scala/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/scala/utility_scala.ts +99 -0
- package/project/.sdk/src/cmp/swift/Config_swift.ts +127 -0
- package/project/.sdk/src/cmp/swift/EntityBase_swift.ts +38 -0
- package/project/.sdk/src/cmp/swift/EntityOperation_swift.ts +39 -0
- package/project/.sdk/src/cmp/swift/Entity_swift.ts +86 -0
- package/project/.sdk/src/cmp/swift/Gitignore_swift.ts +32 -0
- package/project/.sdk/src/cmp/swift/MainEntity_swift.ts +35 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +94 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +66 -0
- package/project/.sdk/src/cmp/swift/SdkError_swift.ts +41 -0
- package/project/.sdk/src/cmp/swift/TestDirect_swift.ts +84 -0
- package/project/.sdk/src/cmp/swift/TestEntity_swift.ts +84 -0
- package/project/.sdk/src/cmp/swift/Test_swift.ts +39 -0
- package/project/.sdk/src/cmp/swift/fragment/Entity.fragment.swift +23 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +202 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityCreateOp.fragment.swift +23 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityListOp.fragment.swift +21 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityLoadOp.fragment.swift +24 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityRemoveOp.fragment.swift +24 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityUpdateOp.fragment.swift +24 -0
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +211 -0
- package/project/.sdk/src/cmp/swift/fragment/SdkError.fragment.swift +22 -0
- package/project/.sdk/src/cmp/swift/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/swift/utility_swift.ts +76 -0
- package/project/.sdk/src/cmp/ts/Config_ts.ts +4 -2
- package/project/.sdk/src/cmp/ts/Package_ts.ts +12 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +81 -0
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +10 -5
- package/project/.sdk/src/cmp/zig/Config_zig.ts +113 -0
- package/project/.sdk/src/cmp/zig/EntityOperation_zig.ts +39 -0
- package/project/.sdk/src/cmp/zig/Entity_zig.ts +89 -0
- package/project/.sdk/src/cmp/zig/Gitignore_zig.ts +27 -0
- package/project/.sdk/src/cmp/zig/MainEntity_zig.ts +38 -0
- package/project/.sdk/src/cmp/zig/Main_zig.ts +78 -0
- package/project/.sdk/src/cmp/zig/Test_zig.ts +114 -0
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +278 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +24 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +26 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +26 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +26 -0
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +258 -0
- package/project/.sdk/src/cmp/zig/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/zig/utility_zig.ts +95 -0
- package/project/.sdk/tm/c/LICENSE +22 -0
- package/project/.sdk/tm/c/Makefile +50 -0
- package/project/.sdk/tm/c/VERSION +1 -0
- package/project/.sdk/tm/c/core/context.c +145 -0
- package/project/.sdk/tm/c/core/control.c +19 -0
- package/project/.sdk/tm/c/core/error.c +24 -0
- package/project/.sdk/tm/c/core/helpers.c +228 -0
- package/project/.sdk/tm/c/core/operation.c +34 -0
- package/project/.sdk/tm/c/core/point.c +49 -0
- package/project/.sdk/tm/c/core/response.c +29 -0
- package/project/.sdk/tm/c/core/result.c +60 -0
- package/project/.sdk/tm/c/core/sdk.h +514 -0
- package/project/.sdk/tm/c/core/spec.c +94 -0
- package/project/.sdk/tm/c/core/utility.c +74 -0
- package/project/.sdk/tm/c/feature/audit.c +134 -0
- package/project/.sdk/tm/c/feature/base.c +40 -0
- package/project/.sdk/tm/c/feature/cache.c +262 -0
- package/project/.sdk/tm/c/feature/clienttrack.c +144 -0
- package/project/.sdk/tm/c/feature/debug.c +230 -0
- package/project/.sdk/tm/c/feature/idempotency.c +164 -0
- package/project/.sdk/tm/c/feature/log.c +79 -0
- package/project/.sdk/tm/c/feature/metrics.c +177 -0
- package/project/.sdk/tm/c/feature/netsim.c +211 -0
- package/project/.sdk/tm/c/feature/paging.c +223 -0
- package/project/.sdk/tm/c/feature/proxy.c +249 -0
- package/project/.sdk/tm/c/feature/ratelimit.c +124 -0
- package/project/.sdk/tm/c/feature/rbac.c +167 -0
- package/project/.sdk/tm/c/feature/retry.c +164 -0
- package/project/.sdk/tm/c/feature/streaming.c +147 -0
- package/project/.sdk/tm/c/feature/support.c +115 -0
- package/project/.sdk/tm/c/feature/telemetry.c +205 -0
- package/project/.sdk/tm/c/feature/test.c +385 -0
- package/project/.sdk/tm/c/feature/timeout.c +106 -0
- package/project/.sdk/tm/c/src/feature/README.md +1 -0
- package/project/.sdk/tm/c/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/c/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/c/tests/ctest.h +58 -0
- package/project/.sdk/tm/c/tests/feature_harness.h +441 -0
- package/project/.sdk/tm/c/tests/feature_test.c +1210 -0
- package/project/.sdk/tm/c/tests/pipeline_test.c +561 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +573 -0
- package/project/.sdk/tm/c/tests/runner.h +274 -0
- package/project/.sdk/tm/c/tests/sdk_pipeline_test.c +89 -0
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +939 -0
- package/project/.sdk/tm/c/utility/clean.c +20 -0
- package/project/.sdk/tm/c/utility/done.c +26 -0
- package/project/.sdk/tm/c/utility/feature_add.c +42 -0
- package/project/.sdk/tm/c/utility/feature_hook.c +22 -0
- package/project/.sdk/tm/c/utility/feature_init.c +22 -0
- package/project/.sdk/tm/c/utility/fetcher.c +78 -0
- package/project/.sdk/tm/c/utility/jsonparse.c +11 -0
- package/project/.sdk/tm/c/utility/make_context.c +7 -0
- package/project/.sdk/tm/c/utility/make_error.c +66 -0
- package/project/.sdk/tm/c/utility/make_fetch_def.c +43 -0
- package/project/.sdk/tm/c/utility/make_options.c +179 -0
- package/project/.sdk/tm/c/utility/make_point.c +109 -0
- package/project/.sdk/tm/c/utility/make_request.c +62 -0
- package/project/.sdk/tm/c/utility/make_response.c +45 -0
- package/project/.sdk/tm/c/utility/make_result.c +61 -0
- package/project/.sdk/tm/c/utility/make_spec.c +60 -0
- package/project/.sdk/tm/c/utility/make_url.c +88 -0
- package/project/.sdk/tm/c/utility/param.c +58 -0
- package/project/.sdk/tm/c/utility/prepare_auth.c +65 -0
- package/project/.sdk/tm/c/utility/prepare_body.c +12 -0
- package/project/.sdk/tm/c/utility/prepare_headers.c +13 -0
- package/project/.sdk/tm/c/utility/prepare_method.c +16 -0
- package/project/.sdk/tm/c/utility/prepare_params.c +30 -0
- package/project/.sdk/tm/c/utility/prepare_path.c +17 -0
- package/project/.sdk/tm/c/utility/prepare_query.c +37 -0
- package/project/.sdk/tm/c/utility/result_basic.c +43 -0
- package/project/.sdk/tm/c/utility/result_body.c +17 -0
- package/project/.sdk/tm/c/utility/result_headers.c +17 -0
- package/project/.sdk/tm/c/utility/struct/inject.c +703 -0
- package/project/.sdk/tm/c/utility/struct/re_util.c +221 -0
- package/project/.sdk/tm/c/utility/struct/regex.c +1103 -0
- package/project/.sdk/tm/c/utility/struct/regex.h +84 -0
- package/project/.sdk/tm/c/utility/struct/transform.c +2224 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +1971 -0
- package/project/.sdk/tm/c/utility/struct/value.c +640 -0
- package/project/.sdk/tm/c/utility/struct/value.h +273 -0
- package/project/.sdk/tm/c/utility/struct/value_io.c +366 -0
- package/project/.sdk/tm/c/utility/struct/value_io.h +31 -0
- package/project/.sdk/tm/c/utility/struct/voxgig_struct.h +216 -0
- package/project/.sdk/tm/c/utility/transform_request.c +21 -0
- package/project/.sdk/tm/c/utility/transform_response.c +36 -0
- package/project/.sdk/tm/clojure/LICENSE +22 -0
- package/project/.sdk/tm/clojure/Makefile +15 -0
- package/project/.sdk/tm/clojure/VERSION +1 -0
- package/project/.sdk/tm/clojure/src/feature/README.md +1 -0
- package/project/.sdk/tm/clojure/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/sdk/client.clj +119 -0
- package/project/.sdk/tm/clojure/src/sdk/core.clj +901 -0
- package/project/.sdk/tm/clojure/src/sdk/features.clj +1027 -0
- package/project/.sdk/tm/clojure/src/voxgig/struct.clj +1734 -0
- package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +596 -0
- package/project/.sdk/tm/clojure/test/sdk/test/netsim.clj +42 -0
- package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +314 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +52 -0
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +337 -0
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +39 -0
- package/project/.sdk/tm/clojure/test/sdk/testutil.clj +35 -0
- package/project/.sdk/tm/cpp/LICENSE +22 -0
- package/project/.sdk/tm/cpp/Makefile +36 -0
- package/project/.sdk/tm/cpp/VERSION +1 -0
- package/project/.sdk/tm/cpp/core/sdk.hpp +16 -0
- package/project/.sdk/tm/cpp/core/struct.hpp +225 -0
- package/project/.sdk/tm/cpp/core/types.hpp +1105 -0
- package/project/.sdk/tm/cpp/feature/audit.hpp +107 -0
- package/project/.sdk/tm/cpp/feature/base.hpp +34 -0
- package/project/.sdk/tm/cpp/feature/cache.hpp +189 -0
- package/project/.sdk/tm/cpp/feature/clienttrack.hpp +105 -0
- package/project/.sdk/tm/cpp/feature/debug.hpp +157 -0
- package/project/.sdk/tm/cpp/feature/idempotency.hpp +119 -0
- package/project/.sdk/tm/cpp/feature/log.hpp +90 -0
- package/project/.sdk/tm/cpp/feature/metrics.hpp +103 -0
- package/project/.sdk/tm/cpp/feature/netsim.hpp +152 -0
- package/project/.sdk/tm/cpp/feature/options.hpp +156 -0
- package/project/.sdk/tm/cpp/feature/paging.hpp +156 -0
- package/project/.sdk/tm/cpp/feature/proxy.hpp +145 -0
- package/project/.sdk/tm/cpp/feature/ratelimit.hpp +87 -0
- package/project/.sdk/tm/cpp/feature/rbac.hpp +108 -0
- package/project/.sdk/tm/cpp/feature/retry.hpp +130 -0
- package/project/.sdk/tm/cpp/feature/streaming.hpp +98 -0
- package/project/.sdk/tm/cpp/feature/telemetry.hpp +139 -0
- package/project/.sdk/tm/cpp/feature/test.hpp +289 -0
- package/project/.sdk/tm/cpp/feature/timeout.hpp +88 -0
- package/project/.sdk/tm/cpp/src/feature/README.md +1 -0
- package/project/.sdk/tm/cpp/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/test/custom_utility_test.cpp +57 -0
- package/project/.sdk/tm/cpp/test/exists_test.cpp +16 -0
- package/project/.sdk/tm/cpp/test/feature_test.cpp +911 -0
- package/project/.sdk/tm/cpp/test/harness.hpp +344 -0
- package/project/.sdk/tm/cpp/test/netsim_test.cpp +48 -0
- package/project/.sdk/tm/cpp/test/pipeline_test.cpp +526 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +841 -0
- package/project/.sdk/tm/cpp/test/runner_support.hpp +437 -0
- package/project/.sdk/tm/cpp/test/sdk-test-control.json +19 -0
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +494 -0
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +314 -0
- package/project/.sdk/tm/cpp/test/testlib.hpp +82 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +1054 -0
- package/project/.sdk/tm/cpp/utility/voxgigstruct/value.hpp +525 -0
- package/project/.sdk/tm/cpp/utility/voxgigstruct/value_io.hpp +315 -0
- package/project/.sdk/tm/cpp/utility/voxgigstruct/voxgig_struct.hpp +3379 -0
- package/project/.sdk/tm/csharp/LICENSE +22 -0
- package/project/.sdk/tm/csharp/Makefile +43 -0
- package/project/.sdk/tm/csharp/VERSION +1 -0
- package/project/.sdk/tm/csharp/core/Context.cs +257 -0
- package/project/.sdk/tm/csharp/core/Control.cs +17 -0
- package/project/.sdk/tm/csharp/core/Helpers.cs +61 -0
- package/project/.sdk/tm/csharp/core/Operation.cs +51 -0
- package/project/.sdk/tm/csharp/core/Point.cs +68 -0
- package/project/.sdk/tm/csharp/core/Response.cs +45 -0
- package/project/.sdk/tm/csharp/core/Result.cs +63 -0
- package/project/.sdk/tm/csharp/core/Spec.cs +81 -0
- package/project/.sdk/tm/csharp/core/Types.cs +21 -0
- package/project/.sdk/tm/csharp/core/Utility.cs +88 -0
- package/project/.sdk/tm/csharp/feature/AuditFeature.cs +116 -0
- package/project/.sdk/tm/csharp/feature/BaseFeature.cs +39 -0
- package/project/.sdk/tm/csharp/feature/CacheFeature.cs +186 -0
- package/project/.sdk/tm/csharp/feature/ClienttrackFeature.cs +103 -0
- package/project/.sdk/tm/csharp/feature/DebugFeature.cs +157 -0
- package/project/.sdk/tm/csharp/feature/FeatureOptions.cs +197 -0
- package/project/.sdk/tm/csharp/feature/IdempotencyFeature.cs +97 -0
- package/project/.sdk/tm/csharp/feature/LogFeature.cs +109 -0
- package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +117 -0
- package/project/.sdk/tm/csharp/feature/NetsimFeature.cs +200 -0
- package/project/.sdk/tm/csharp/feature/PagingFeature.cs +187 -0
- package/project/.sdk/tm/csharp/feature/ProxyFeature.cs +138 -0
- package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +89 -0
- package/project/.sdk/tm/csharp/feature/RbacFeature.cs +124 -0
- package/project/.sdk/tm/csharp/feature/RetryFeature.cs +174 -0
- package/project/.sdk/tm/csharp/feature/StreamingFeature.cs +93 -0
- package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +145 -0
- package/project/.sdk/tm/csharp/feature/TestFeature.cs +368 -0
- package/project/.sdk/tm/csharp/feature/TimeoutFeature.cs +69 -0
- package/project/.sdk/tm/csharp/src/feature/README.md +1 -0
- package/project/.sdk/tm/csharp/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/test/CustomUtilityTest.cs +51 -0
- package/project/.sdk/tm/csharp/test/ExistsTest.cs +17 -0
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +1653 -0
- package/project/.sdk/tm/csharp/test/NetsimTest.cs +67 -0
- package/project/.sdk/tm/csharp/test/PipelineTest.cs +605 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +957 -0
- package/project/.sdk/tm/csharp/test/Runner.cs +626 -0
- package/project/.sdk/tm/csharp/test/StructRunner.cs +276 -0
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +1273 -0
- package/project/.sdk/tm/csharp/test/sdk-test-control.json +19 -0
- package/project/.sdk/tm/csharp/utility/Clean.cs +11 -0
- package/project/.sdk/tm/csharp/utility/Done.cs +28 -0
- package/project/.sdk/tm/csharp/utility/FeatureAdd.cs +54 -0
- package/project/.sdk/tm/csharp/utility/FeatureHook.cs +35 -0
- package/project/.sdk/tm/csharp/utility/FeatureInit.cs +28 -0
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +181 -0
- package/project/.sdk/tm/csharp/utility/MakeContext.cs +11 -0
- package/project/.sdk/tm/csharp/utility/MakeError.cs +69 -0
- package/project/.sdk/tm/csharp/utility/MakeFetchDef.cs +38 -0
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +203 -0
- package/project/.sdk/tm/csharp/utility/MakePoint.cs +127 -0
- package/project/.sdk/tm/csharp/utility/MakeRequest.cs +87 -0
- package/project/.sdk/tm/csharp/utility/MakeResponse.cs +55 -0
- package/project/.sdk/tm/csharp/utility/MakeResult.cs +64 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +64 -0
- package/project/.sdk/tm/csharp/utility/MakeUrl.cs +54 -0
- package/project/.sdk/tm/csharp/utility/Param.cs +67 -0
- package/project/.sdk/tm/csharp/utility/PrepareAuth.cs +54 -0
- package/project/.sdk/tm/csharp/utility/PrepareBody.cs +19 -0
- package/project/.sdk/tm/csharp/utility/PrepareHeaders.cs +22 -0
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +22 -0
- package/project/.sdk/tm/csharp/utility/PrepareParams.cs +38 -0
- package/project/.sdk/tm/csharp/utility/PreparePath.cs +18 -0
- package/project/.sdk/tm/csharp/utility/PrepareQuery.cs +40 -0
- package/project/.sdk/tm/csharp/utility/Register.cs +41 -0
- package/project/.sdk/tm/csharp/utility/ResultBasic.cs +39 -0
- package/project/.sdk/tm/csharp/utility/ResultBody.cs +22 -0
- package/project/.sdk/tm/csharp/utility/ResultHeaders.cs +26 -0
- package/project/.sdk/tm/csharp/utility/TransformRequest.cs +39 -0
- package/project/.sdk/tm/csharp/utility/TransformResponse.cs +53 -0
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +3582 -0
- package/project/.sdk/tm/dart/LICENSE +22 -0
- package/project/.sdk/tm/dart/Makefile +50 -0
- package/project/.sdk/tm/dart/lib/Context.dart +150 -0
- package/project/.sdk/tm/dart/lib/Control.dart +15 -0
- package/project/.sdk/tm/dart/lib/Operation.dart +31 -0
- package/project/.sdk/tm/dart/lib/Point.dart +43 -0
- package/project/.sdk/tm/dart/lib/Response.dart +32 -0
- package/project/.sdk/tm/dart/lib/Result.dart +39 -0
- package/project/.sdk/tm/dart/lib/Spec.dart +49 -0
- package/project/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
- package/project/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
- package/project/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
- package/project/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
- package/project/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
- package/project/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
- package/project/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
- package/project/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
- package/project/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
- package/project/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +145 -0
- package/project/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
- package/project/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
- package/project/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
- package/project/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
- package/project/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
- package/project/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
- package/project/.sdk/tm/dart/lib/feature/test/TestFeature.dart +270 -0
- package/project/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
- package/project/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
- package/project/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
- package/project/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
- package/project/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
- package/project/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
- package/project/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
- package/project/.sdk/tm/dart/lib/utility/FetcherUtility.dart +95 -0
- package/project/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
- package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +67 -0
- package/project/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
- package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +147 -0
- package/project/.sdk/tm/dart/lib/utility/MakePointUtility.dart +84 -0
- package/project/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +63 -0
- package/project/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +54 -0
- package/project/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
- package/project/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +61 -0
- package/project/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
- package/project/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
- package/project/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
- package/project/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
- package/project/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
- package/project/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +15 -0
- package/project/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
- package/project/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
- package/project/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
- package/project/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
- package/project/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
- package/project/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
- package/project/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
- package/project/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
- package/project/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
- package/project/.sdk/tm/dart/lib/utility/Utility.dart +230 -0
- package/project/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2456 -0
- package/project/.sdk/tm/dart/src/feature/README.md +3 -0
- package/project/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/dart/test/custom_test.dart +65 -0
- package/project/.sdk/tm/dart/test/exists_test.dart +12 -0
- package/project/.sdk/tm/dart/test/feature/harness.dart +329 -0
- package/project/.sdk/tm/dart/test/feature_test.dart +1139 -0
- package/project/.sdk/tm/dart/test/harness.dart +153 -0
- package/project/.sdk/tm/dart/test/netsim_test.dart +48 -0
- package/project/.sdk/tm/dart/test/pipeline_test.dart +608 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +411 -0
- package/project/.sdk/tm/dart/test/runner.dart +406 -0
- package/project/.sdk/tm/dart/test/sdk-test-control.json +19 -0
- package/project/.sdk/tm/dart/test/struct_corpus.dart +531 -0
- package/project/.sdk/tm/dart/test/struct_test.dart +41 -0
- package/project/.sdk/tm/dart/test/utility.dart +159 -0
- package/project/.sdk/tm/elixir/LICENSE +21 -0
- package/project/.sdk/tm/elixir/Makefile +15 -0
- package/project/.sdk/tm/elixir/VERSION +1 -0
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +138 -0
- package/project/.sdk/tm/elixir/lib/projectname/core.ex +125 -0
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +155 -0
- package/project/.sdk/tm/elixir/lib/projectname/error.ex +16 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/audit.ex +125 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/cache.ex +170 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/clienttrack.ex +136 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/debug.ex +232 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/idempotency.ex +107 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/log.ex +62 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +130 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/netsim.ex +213 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +191 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/proxy.ex +142 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +81 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/rbac.ex +139 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +150 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/streaming.ex +107 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +172 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +285 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/timeout.ex +64 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature.ex +90 -0
- package/project/.sdk/tm/elixir/lib/projectname/helpers.ex +66 -0
- package/project/.sdk/tm/elixir/lib/projectname/json.ex +115 -0
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +1257 -0
- package/project/.sdk/tm/elixir/lib/utility/struct/voxgig_struct.ex +2615 -0
- package/project/.sdk/tm/elixir/src/feature/README.md +3 -0
- package/project/.sdk/tm/elixir/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/test/feature_test.exs +879 -0
- package/project/.sdk/tm/elixir/test/netsim_test.exs +58 -0
- package/project/.sdk/tm/elixir/test/pipeline_test.exs +558 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +133 -0
- package/project/.sdk/tm/elixir/test/stream_test.exs +119 -0
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +18 -0
- package/project/.sdk/tm/elixir/test/support/feature_harness.ex +346 -0
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +677 -0
- package/project/.sdk/tm/elixir/test/test_helper.exs +1 -0
- package/project/.sdk/tm/go/core/context.go +10 -0
- package/project/.sdk/tm/go/core/control.go +2 -0
- package/project/.sdk/tm/go/core/result.go +6 -0
- package/project/.sdk/tm/go/core/types.go +1 -0
- package/project/.sdk/tm/go/feature/audit_feature.go +110 -0
- package/project/.sdk/tm/go/feature/base_feature.go +8 -0
- package/project/.sdk/tm/go/feature/cache_feature.go +171 -0
- package/project/.sdk/tm/go/feature/clienttrack_feature.go +100 -0
- package/project/.sdk/tm/go/feature/debug_feature.go +159 -0
- package/project/.sdk/tm/go/feature/feature_options.go +204 -0
- package/project/.sdk/tm/go/feature/idempotency_feature.go +115 -0
- package/project/.sdk/tm/go/feature/metrics_feature.go +112 -0
- package/project/.sdk/tm/go/feature/netsim_feature.go +184 -0
- package/project/.sdk/tm/go/feature/paging_feature.go +173 -0
- package/project/.sdk/tm/go/feature/proxy_feature.go +121 -0
- package/project/.sdk/tm/go/feature/ratelimit_feature.go +88 -0
- package/project/.sdk/tm/go/feature/rbac_feature.go +126 -0
- package/project/.sdk/tm/go/feature/retry_feature.go +165 -0
- package/project/.sdk/tm/go/feature/streaming_feature.go +119 -0
- package/project/.sdk/tm/go/feature/telemetry_feature.go +142 -0
- package/project/.sdk/tm/go/feature/test_feature.go +78 -3
- package/project/.sdk/tm/go/feature/timeout_feature.go +88 -0
- package/project/.sdk/tm/go/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature_test.go +1465 -0
- package/project/.sdk/tm/go/test/netsim_test.go +70 -0
- package/project/.sdk/tm/go/test/pipeline_test.go +571 -0
- package/project/.sdk/tm/go/utility/feature_add.go +38 -0
- package/project/.sdk/tm/go/utility/fetcher.go +13 -1
- package/project/.sdk/tm/go/utility/make_error.go +8 -0
- package/project/.sdk/tm/go/utility/make_options.go +62 -0
- package/project/.sdk/tm/go/utility/make_point.go +6 -0
- package/project/.sdk/tm/go-cli/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/go-cli/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/go-mcp/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/LICENSE +21 -0
- package/project/.sdk/tm/haskell/Makefile +22 -0
- package/project/.sdk/tm/haskell/VERSION +1 -0
- package/project/.sdk/tm/haskell/src/SdkFeatures.hs +1278 -0
- package/project/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
- package/project/.sdk/tm/haskell/src/SdkRuntime.hs +1007 -0
- package/project/.sdk/tm/haskell/src/SdkTypes.hs +186 -0
- package/project/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
- package/project/.sdk/tm/haskell/src/Vregex.hs +237 -0
- package/project/.sdk/tm/haskell/src/feature/README.md +5 -0
- package/project/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/haskell/test/Harness.hs +276 -0
- package/project/.sdk/tm/haskell/test/Runner.hs +47 -0
- package/project/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
- package/project/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
- package/project/.sdk/tm/haskell/test/TFeature.hs +794 -0
- package/project/.sdk/tm/haskell/test/TNetsim.hs +50 -0
- package/project/.sdk/tm/haskell/test/TPipeline.hs +334 -0
- package/project/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
- package/project/.sdk/tm/haskell/test/TestJson.hs +107 -0
- package/project/.sdk/tm/haskell/test/Testutil.hs +59 -0
- package/project/.sdk/tm/java/LICENSE +22 -0
- package/project/.sdk/tm/java/Makefile +44 -0
- package/project/.sdk/tm/java/VERSION +1 -0
- package/project/.sdk/tm/java/core/Context.java +269 -0
- package/project/.sdk/tm/java/core/Control.java +23 -0
- package/project/.sdk/tm/java/core/Entity.java +13 -0
- package/project/.sdk/tm/java/core/Feature.java +45 -0
- package/project/.sdk/tm/java/core/FeaturePlacement.java +13 -0
- package/project/.sdk/tm/java/core/Helpers.java +50 -0
- package/project/.sdk/tm/java/core/Operation.java +47 -0
- package/project/.sdk/tm/java/core/Point.java +90 -0
- package/project/.sdk/tm/java/core/Response.java +48 -0
- package/project/.sdk/tm/java/core/Result.java +64 -0
- package/project/.sdk/tm/java/core/SdkClient.java +280 -0
- package/project/.sdk/tm/java/core/SdkEntity.java +28 -0
- package/project/.sdk/tm/java/core/Spec.java +84 -0
- package/project/.sdk/tm/java/core/Utility.java +128 -0
- package/project/.sdk/tm/java/feature/AuditFeature.java +113 -0
- package/project/.sdk/tm/java/feature/BaseFeature.java +91 -0
- package/project/.sdk/tm/java/feature/CacheFeature.java +184 -0
- package/project/.sdk/tm/java/feature/ClienttrackFeature.java +103 -0
- package/project/.sdk/tm/java/feature/DebugFeature.java +163 -0
- package/project/.sdk/tm/java/feature/FeatureOptions.java +204 -0
- package/project/.sdk/tm/java/feature/IdempotencyFeature.java +115 -0
- package/project/.sdk/tm/java/feature/LogFeature.java +143 -0
- package/project/.sdk/tm/java/feature/MetricsFeature.java +115 -0
- package/project/.sdk/tm/java/feature/NetsimFeature.java +181 -0
- package/project/.sdk/tm/java/feature/PagingFeature.java +178 -0
- package/project/.sdk/tm/java/feature/ProxyFeature.java +122 -0
- package/project/.sdk/tm/java/feature/RatelimitFeature.java +83 -0
- package/project/.sdk/tm/java/feature/RbacFeature.java +132 -0
- package/project/.sdk/tm/java/feature/RetryFeature.java +156 -0
- package/project/.sdk/tm/java/feature/StreamingFeature.java +110 -0
- package/project/.sdk/tm/java/feature/TelemetryFeature.java +146 -0
- package/project/.sdk/tm/java/feature/TestFeature.java +333 -0
- package/project/.sdk/tm/java/feature/TimeoutFeature.java +89 -0
- package/project/.sdk/tm/java/src/feature/README.md +1 -0
- package/project/.sdk/tm/java/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/java/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/java/test/CustomUtilityTest.java +59 -0
- package/project/.sdk/tm/java/test/ExistsTest.java +16 -0
- package/project/.sdk/tm/java/test/FeatureHarness.java +448 -0
- package/project/.sdk/tm/java/test/FeatureTest.java +1018 -0
- package/project/.sdk/tm/java/test/NetsimTest.java +59 -0
- package/project/.sdk/tm/java/test/PipelineTest.java +618 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +864 -0
- package/project/.sdk/tm/java/test/RunnerSupport.java +545 -0
- package/project/.sdk/tm/java/test/StructCorpusTest.java +351 -0
- package/project/.sdk/tm/java/test/StructRunner.java +281 -0
- package/project/.sdk/tm/java/test/sdk-test-control.json +19 -0
- package/project/.sdk/tm/java/utility/Clean.java +12 -0
- package/project/.sdk/tm/java/utility/Done.java +29 -0
- package/project/.sdk/tm/java/utility/FeatureAdd.java +59 -0
- package/project/.sdk/tm/java/utility/FeatureHookUtil.java +72 -0
- package/project/.sdk/tm/java/utility/FeatureInit.java +35 -0
- package/project/.sdk/tm/java/utility/Fetcher.java +170 -0
- package/project/.sdk/tm/java/utility/Json.java +268 -0
- package/project/.sdk/tm/java/utility/MakeContext.java +14 -0
- package/project/.sdk/tm/java/utility/MakeError.java +81 -0
- package/project/.sdk/tm/java/utility/MakeFetchDef.java +48 -0
- package/project/.sdk/tm/java/utility/MakeOptions.java +168 -0
- package/project/.sdk/tm/java/utility/MakePoint.java +118 -0
- package/project/.sdk/tm/java/utility/MakeRequest.java +83 -0
- package/project/.sdk/tm/java/utility/MakeResponse.java +54 -0
- package/project/.sdk/tm/java/utility/MakeResult.java +68 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +69 -0
- package/project/.sdk/tm/java/utility/MakeUrl.java +67 -0
- package/project/.sdk/tm/java/utility/Param.java +74 -0
- package/project/.sdk/tm/java/utility/PrepareAuth.java +66 -0
- package/project/.sdk/tm/java/utility/PrepareBody.java +16 -0
- package/project/.sdk/tm/java/utility/PrepareHeaders.java +28 -0
- package/project/.sdk/tm/java/utility/PrepareMethod.java +28 -0
- package/project/.sdk/tm/java/utility/PrepareParams.java +50 -0
- package/project/.sdk/tm/java/utility/PreparePath.java +26 -0
- package/project/.sdk/tm/java/utility/PrepareQuery.java +54 -0
- package/project/.sdk/tm/java/utility/Register.java +41 -0
- package/project/.sdk/tm/java/utility/ResultBasic.java +36 -0
- package/project/.sdk/tm/java/utility/ResultBody.java +23 -0
- package/project/.sdk/tm/java/utility/ResultHeaders.java +36 -0
- package/project/.sdk/tm/java/utility/TransformRequest.java +35 -0
- package/project/.sdk/tm/java/utility/TransformResponse.java +52 -0
- package/project/.sdk/tm/java/utility/struct/Struct.java +3550 -0
- package/project/.sdk/tm/js/src/feature/audit/AuditFeature.js +96 -0
- package/project/.sdk/tm/js/src/feature/cache/CacheFeature.js +150 -0
- package/project/.sdk/tm/js/src/feature/clienttrack/ClienttrackFeature.js +104 -0
- package/project/.sdk/tm/js/src/feature/debug/DebugFeature.js +132 -0
- package/project/.sdk/tm/js/src/feature/idempotency/IdempotencyFeature.js +95 -0
- package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +102 -0
- package/project/.sdk/tm/js/src/feature/netsim/NetsimFeature.js +187 -0
- package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +139 -0
- package/project/.sdk/tm/js/src/feature/proxy/ProxyFeature.js +110 -0
- package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +106 -0
- package/project/.sdk/tm/js/src/feature/rbac/RbacFeature.js +102 -0
- package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +158 -0
- package/project/.sdk/tm/js/src/feature/streaming/StreamingFeature.js +96 -0
- package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +128 -0
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +58 -1
- package/project/.sdk/tm/js/src/feature/timeout/TimeoutFeature.js +101 -0
- package/project/.sdk/tm/js/src/utility/FeatureHookUtility.js +4 -1
- package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +9 -0
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +31 -1
- package/project/.sdk/tm/js/test/feature/harness.js +275 -0
- package/project/.sdk/tm/js/test/feature.test.js +772 -0
- package/project/.sdk/tm/js/test/netsim.test.js +43 -0
- package/project/.sdk/tm/js/test/pipeline.test.js +382 -0
- package/project/.sdk/tm/kotlin/LICENSE +22 -0
- package/project/.sdk/tm/kotlin/Makefile +43 -0
- package/project/.sdk/tm/kotlin/VERSION +1 -0
- package/project/.sdk/tm/kotlin/core/Context.kt +247 -0
- package/project/.sdk/tm/kotlin/core/Control.kt +21 -0
- package/project/.sdk/tm/kotlin/core/Helpers.kt +49 -0
- package/project/.sdk/tm/kotlin/core/Interfaces.kt +88 -0
- package/project/.sdk/tm/kotlin/core/Operation.kt +43 -0
- package/project/.sdk/tm/kotlin/core/Point.kt +83 -0
- package/project/.sdk/tm/kotlin/core/Response.kt +43 -0
- package/project/.sdk/tm/kotlin/core/Result.kt +61 -0
- package/project/.sdk/tm/kotlin/core/SdkClient.kt +266 -0
- package/project/.sdk/tm/kotlin/core/Spec.kt +76 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +93 -0
- package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +96 -0
- package/project/.sdk/tm/kotlin/feature/BaseFeature.kt +57 -0
- package/project/.sdk/tm/kotlin/feature/CacheFeature.kt +167 -0
- package/project/.sdk/tm/kotlin/feature/ClienttrackFeature.kt +84 -0
- package/project/.sdk/tm/kotlin/feature/DebugFeature.kt +141 -0
- package/project/.sdk/tm/kotlin/feature/FeatureOptions.kt +191 -0
- package/project/.sdk/tm/kotlin/feature/IdempotencyFeature.kt +98 -0
- package/project/.sdk/tm/kotlin/feature/LogFeature.kt +92 -0
- package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +96 -0
- package/project/.sdk/tm/kotlin/feature/NetsimFeature.kt +162 -0
- package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +143 -0
- package/project/.sdk/tm/kotlin/feature/ProxyFeature.kt +109 -0
- package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +77 -0
- package/project/.sdk/tm/kotlin/feature/RbacFeature.kt +100 -0
- package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +140 -0
- package/project/.sdk/tm/kotlin/feature/StreamingFeature.kt +90 -0
- package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +118 -0
- package/project/.sdk/tm/kotlin/feature/TestFeature.kt +306 -0
- package/project/.sdk/tm/kotlin/feature/TimeoutFeature.kt +74 -0
- package/project/.sdk/tm/kotlin/src/feature/README.md +1 -0
- package/project/.sdk/tm/kotlin/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/test/CustomUtilityTest.kt +51 -0
- package/project/.sdk/tm/kotlin/test/ExistsTest.kt +15 -0
- package/project/.sdk/tm/kotlin/test/FeatureHarness.kt +380 -0
- package/project/.sdk/tm/kotlin/test/FeatureTest.kt +924 -0
- package/project/.sdk/tm/kotlin/test/NetsimTest.kt +50 -0
- package/project/.sdk/tm/kotlin/test/PipelineTest.kt +556 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +829 -0
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +477 -0
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +297 -0
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +177 -0
- package/project/.sdk/tm/kotlin/test/sdk-test-control.json +19 -0
- package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +96 -0
- package/project/.sdk/tm/kotlin/utility/FeatureUtil.kt +121 -0
- package/project/.sdk/tm/kotlin/utility/Fetcher.kt +156 -0
- package/project/.sdk/tm/kotlin/utility/Json.kt +237 -0
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +152 -0
- package/project/.sdk/tm/kotlin/utility/MakePoint.kt +108 -0
- package/project/.sdk/tm/kotlin/utility/MakeReqRes.kt +152 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +142 -0
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +236 -0
- package/project/.sdk/tm/kotlin/utility/Register.kt +39 -0
- package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +109 -0
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +2697 -0
- package/project/.sdk/tm/lua/feature/audit_feature.lua +132 -0
- package/project/.sdk/tm/lua/feature/cache_feature.lua +188 -0
- package/project/.sdk/tm/lua/feature/clienttrack_feature.lua +127 -0
- package/project/.sdk/tm/lua/feature/debug_feature.lua +194 -0
- package/project/.sdk/tm/lua/feature/idempotency_feature.lua +127 -0
- package/project/.sdk/tm/lua/feature/metrics_feature.lua +135 -0
- package/project/.sdk/tm/lua/feature/netsim_feature.lua +205 -0
- package/project/.sdk/tm/lua/feature/paging_feature.lua +180 -0
- package/project/.sdk/tm/lua/feature/proxy_feature.lua +147 -0
- package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +120 -0
- package/project/.sdk/tm/lua/feature/rbac_feature.lua +141 -0
- package/project/.sdk/tm/lua/feature/retry_feature.lua +188 -0
- package/project/.sdk/tm/lua/feature/streaming_feature.lua +143 -0
- package/project/.sdk/tm/lua/feature/telemetry_feature.lua +159 -0
- package/project/.sdk/tm/lua/feature/test_feature.lua +85 -1
- package/project/.sdk/tm/lua/feature/timeout_feature.lua +94 -0
- package/project/.sdk/tm/lua/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/lua/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/lua/test/feature_test.lua +1244 -0
- package/project/.sdk/tm/lua/test/netsim_test.lua +61 -0
- package/project/.sdk/tm/lua/test/pipeline_test.lua +613 -0
- package/project/.sdk/tm/lua/utility/feature_add.lua +28 -1
- package/project/.sdk/tm/lua/utility/make_error.lua +9 -0
- package/project/.sdk/tm/lua/utility/make_options.lua +58 -0
- package/project/.sdk/tm/lua/utility/make_point.lua +8 -1
- package/project/.sdk/tm/ocaml/LICENSE +21 -0
- package/project/.sdk/tm/ocaml/Makefile +58 -0
- package/project/.sdk/tm/ocaml/VERSION +1 -0
- package/project/.sdk/tm/ocaml/sdk_features.ml +1127 -0
- package/project/.sdk/tm/ocaml/sdk_helpers.ml +110 -0
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +942 -0
- package/project/.sdk/tm/ocaml/sdk_types.ml +259 -0
- package/project/.sdk/tm/ocaml/src/feature/README.md +1 -0
- package/project/.sdk/tm/ocaml/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/test/custom_utility.ml +30 -0
- package/project/.sdk/tm/ocaml/test/harness.ml +198 -0
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +487 -0
- package/project/.sdk/tm/ocaml/test/t_feature.ml +533 -0
- package/project/.sdk/tm/ocaml/test/t_main.ml +5 -0
- package/project/.sdk/tm/ocaml/test/t_pipeline.ml +354 -0
- package/project/.sdk/tm/ocaml/test/testutil.ml +57 -0
- package/project/.sdk/tm/ocaml/utility/voxgig_struct.ml +1858 -0
- package/project/.sdk/tm/ocaml/utility/vregex.ml +254 -0
- package/project/.sdk/tm/perl/LICENSE +22 -0
- package/project/.sdk/tm/perl/Makefile +57 -0
- package/project/.sdk/tm/perl/core/context.pm +138 -0
- package/project/.sdk/tm/perl/core/control.pm +22 -0
- package/project/.sdk/tm/perl/core/error.pm +30 -0
- package/project/.sdk/tm/perl/core/helpers.pm +142 -0
- package/project/.sdk/tm/perl/core/operation.pm +47 -0
- package/project/.sdk/tm/perl/core/response.pm +40 -0
- package/project/.sdk/tm/perl/core/result.pm +45 -0
- package/project/.sdk/tm/perl/core/spec.pm +33 -0
- package/project/.sdk/tm/perl/core/utility_type.pm +32 -0
- package/project/.sdk/tm/perl/feature/audit_feature.pm +128 -0
- package/project/.sdk/tm/perl/feature/base_feature.pm +41 -0
- package/project/.sdk/tm/perl/feature/cache_feature.pm +168 -0
- package/project/.sdk/tm/perl/feature/clienttrack_feature.pm +126 -0
- package/project/.sdk/tm/perl/feature/debug_feature.pm +168 -0
- package/project/.sdk/tm/perl/feature/idempotency_feature.pm +104 -0
- package/project/.sdk/tm/perl/feature/log_feature.pm +77 -0
- package/project/.sdk/tm/perl/feature/metrics_feature.pm +124 -0
- package/project/.sdk/tm/perl/feature/netsim_feature.pm +215 -0
- package/project/.sdk/tm/perl/feature/paging_feature.pm +158 -0
- package/project/.sdk/tm/perl/feature/proxy_feature.pm +128 -0
- package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +126 -0
- package/project/.sdk/tm/perl/feature/rbac_feature.pm +124 -0
- package/project/.sdk/tm/perl/feature/retry_feature.pm +153 -0
- package/project/.sdk/tm/perl/feature/streaming_feature.pm +112 -0
- package/project/.sdk/tm/perl/feature/telemetry_feature.pm +155 -0
- package/project/.sdk/tm/perl/feature/test_feature.pm +314 -0
- package/project/.sdk/tm/perl/feature/timeout_feature.pm +110 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +2897 -0
- package/project/.sdk/tm/perl/src/feature/README.md +3 -0
- package/project/.sdk/tm/perl/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/perl/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/perl/t/feature.t +1054 -0
- package/project/.sdk/tm/perl/t/netsim.t +55 -0
- package/project/.sdk/tm/perl/t/pipeline.t +632 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +1023 -0
- package/project/.sdk/tm/perl/t/runner.pm +140 -0
- package/project/.sdk/tm/perl/t/sdk-test-control.json +19 -0
- package/project/.sdk/tm/perl/t/stream.t +132 -0
- package/project/.sdk/tm/perl/t/struct_runner.pm +275 -0
- package/project/.sdk/tm/perl/t/struct_utility.t +438 -0
- package/project/.sdk/tm/perl/utility/clean.pm +15 -0
- package/project/.sdk/tm/perl/utility/done.pm +34 -0
- package/project/.sdk/tm/perl/utility/feature_add.pm +47 -0
- package/project/.sdk/tm/perl/utility/feature_hook.pm +25 -0
- package/project/.sdk/tm/perl/utility/feature_init.pm +33 -0
- package/project/.sdk/tm/perl/utility/fetcher.pm +112 -0
- package/project/.sdk/tm/perl/utility/make_context.pm +22 -0
- package/project/.sdk/tm/perl/utility/make_error.pm +74 -0
- package/project/.sdk/tm/perl/utility/make_fetch_def.pm +46 -0
- package/project/.sdk/tm/perl/utility/make_options.pm +123 -0
- package/project/.sdk/tm/perl/utility/make_point.pm +104 -0
- package/project/.sdk/tm/perl/utility/make_request.pm +66 -0
- package/project/.sdk/tm/perl/utility/make_response.pm +38 -0
- package/project/.sdk/tm/perl/utility/make_result.pm +53 -0
- package/project/.sdk/tm/perl/utility/make_spec.pm +71 -0
- package/project/.sdk/tm/perl/utility/make_url.pm +63 -0
- package/project/.sdk/tm/perl/utility/param.pm +65 -0
- package/project/.sdk/tm/perl/utility/prepare_auth.pm +56 -0
- package/project/.sdk/tm/perl/utility/prepare_body.pm +17 -0
- package/project/.sdk/tm/perl/utility/prepare_headers.pm +27 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +25 -0
- package/project/.sdk/tm/perl/utility/prepare_params.pm +41 -0
- package/project/.sdk/tm/perl/utility/prepare_path.pm +29 -0
- package/project/.sdk/tm/perl/utility/prepare_query.pm +40 -0
- package/project/.sdk/tm/perl/utility/register.pm +53 -0
- package/project/.sdk/tm/perl/utility/result_basic.pm +38 -0
- package/project/.sdk/tm/perl/utility/result_body.pm +28 -0
- package/project/.sdk/tm/perl/utility/result_headers.pm +32 -0
- package/project/.sdk/tm/perl/utility/transform_request.pm +30 -0
- package/project/.sdk/tm/perl/utility/transform_response.pm +43 -0
- package/project/.sdk/tm/php/core/Result.php +10 -0
- package/project/.sdk/tm/php/feature/AuditFeature.php +125 -0
- package/project/.sdk/tm/php/feature/BaseFeature.php +6 -0
- package/project/.sdk/tm/php/feature/CacheFeature.php +158 -0
- package/project/.sdk/tm/php/feature/ClienttrackFeature.php +126 -0
- package/project/.sdk/tm/php/feature/DebugFeature.php +167 -0
- package/project/.sdk/tm/php/feature/IdempotencyFeature.php +102 -0
- package/project/.sdk/tm/php/feature/MetricsFeature.php +122 -0
- package/project/.sdk/tm/php/feature/NetsimFeature.php +190 -0
- package/project/.sdk/tm/php/feature/PagingFeature.php +153 -0
- package/project/.sdk/tm/php/feature/ProxyFeature.php +136 -0
- package/project/.sdk/tm/php/feature/RatelimitFeature.php +116 -0
- package/project/.sdk/tm/php/feature/RbacFeature.php +133 -0
- package/project/.sdk/tm/php/feature/RetryFeature.php +159 -0
- package/project/.sdk/tm/php/feature/StreamingFeature.php +107 -0
- package/project/.sdk/tm/php/feature/TelemetryFeature.php +156 -0
- package/project/.sdk/tm/php/feature/TestFeature.php +80 -1
- package/project/.sdk/tm/php/feature/TimeoutFeature.php +95 -0
- package/project/.sdk/tm/php/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/php/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/php/test/FeatureTest.php +1259 -0
- package/project/.sdk/tm/php/test/NetsimTest.php +53 -0
- package/project/.sdk/tm/php/test/PipelineTest.php +674 -0
- package/project/.sdk/tm/php/utility/FeatureAdd.php +32 -1
- package/project/.sdk/tm/php/utility/MakeError.php +9 -0
- package/project/.sdk/tm/php/utility/MakeOptions.php +46 -0
- package/project/.sdk/tm/php/utility/MakePoint.php +7 -0
- package/project/.sdk/tm/py/core/context.py +4 -0
- package/project/.sdk/tm/py/core/control.py +3 -0
- package/project/.sdk/tm/py/feature/audit_feature.py +98 -0
- package/project/.sdk/tm/py/feature/cache_feature.py +138 -0
- package/project/.sdk/tm/py/feature/clienttrack_feature.py +97 -0
- package/project/.sdk/tm/py/feature/debug_feature.py +134 -0
- package/project/.sdk/tm/py/feature/idempotency_feature.py +89 -0
- package/project/.sdk/tm/py/feature/metrics_feature.py +93 -0
- package/project/.sdk/tm/py/feature/netsim_feature.py +170 -0
- package/project/.sdk/tm/py/feature/paging_feature.py +134 -0
- package/project/.sdk/tm/py/feature/proxy_feature.py +104 -0
- package/project/.sdk/tm/py/feature/ratelimit_feature.py +98 -0
- package/project/.sdk/tm/py/feature/rbac_feature.py +102 -0
- package/project/.sdk/tm/py/feature/retry_feature.py +142 -0
- package/project/.sdk/tm/py/feature/streaming_feature.py +84 -0
- package/project/.sdk/tm/py/feature/telemetry_feature.py +128 -0
- package/project/.sdk/tm/py/feature/test_feature.py +70 -1
- package/project/.sdk/tm/py/feature/timeout_feature.py +78 -0
- package/project/.sdk/tm/py/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/py/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature_harness.py +336 -0
- package/project/.sdk/tm/py/test/test_feature.py +807 -0
- package/project/.sdk/tm/py/test/test_netsim.py +52 -0
- package/project/.sdk/tm/py/test/test_pipeline.py +606 -0
- package/project/.sdk/tm/py/utility/feature_add.py +25 -1
- package/project/.sdk/tm/py/utility/make_error.py +8 -0
- package/project/.sdk/tm/py/utility/make_options.py +32 -0
- package/project/.sdk/tm/py/utility/make_point.py +8 -2
- package/project/.sdk/tm/py/utility/make_request.py +6 -2
- package/project/.sdk/tm/py/utility/make_response.py +6 -2
- package/project/.sdk/tm/py/utility/make_result.py +6 -2
- package/project/.sdk/tm/py/utility/make_spec.py +6 -2
- package/project/.sdk/tm/rb/core/context.rb +2 -0
- package/project/.sdk/tm/rb/core/control.rb +5 -1
- package/project/.sdk/tm/rb/core/result.rb +2 -1
- package/project/.sdk/tm/rb/feature/audit_feature.rb +103 -0
- package/project/.sdk/tm/rb/feature/base_feature.rb +5 -0
- package/project/.sdk/tm/rb/feature/cache_feature.rb +133 -0
- package/project/.sdk/tm/rb/feature/clienttrack_feature.rb +91 -0
- package/project/.sdk/tm/rb/feature/debug_feature.rb +138 -0
- package/project/.sdk/tm/rb/feature/idempotency_feature.rb +78 -0
- package/project/.sdk/tm/rb/feature/metrics_feature.rb +91 -0
- package/project/.sdk/tm/rb/feature/netsim_feature.rb +167 -0
- package/project/.sdk/tm/rb/feature/paging_feature.rb +120 -0
- package/project/.sdk/tm/rb/feature/proxy_feature.rb +93 -0
- package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +95 -0
- package/project/.sdk/tm/rb/feature/rbac_feature.rb +96 -0
- package/project/.sdk/tm/rb/feature/retry_feature.rb +116 -0
- package/project/.sdk/tm/rb/feature/streaming_feature.rb +85 -0
- package/project/.sdk/tm/rb/feature/telemetry_feature.rb +122 -0
- package/project/.sdk/tm/rb/feature/test_feature.rb +65 -1
- package/project/.sdk/tm/rb/feature/timeout_feature.rb +74 -0
- package/project/.sdk/tm/rb/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/rb/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/rb/test/feature_test.rb +1031 -0
- package/project/.sdk/tm/rb/test/netsim_test.rb +48 -0
- package/project/.sdk/tm/rb/test/pipeline_test.rb +584 -0
- package/project/.sdk/tm/rb/utility/feature_add.rb +28 -1
- package/project/.sdk/tm/rb/utility/make_error.rb +8 -0
- package/project/.sdk/tm/rb/utility/make_options.rb +35 -0
- package/project/.sdk/tm/rb/utility/make_point.rb +7 -1
- package/project/.sdk/tm/rust/LICENSE +22 -0
- package/project/.sdk/tm/rust/Makefile +41 -0
- package/project/.sdk/tm/rust/VERSION +1 -0
- package/project/.sdk/tm/rust/core/context.rs +320 -0
- package/project/.sdk/tm/rust/core/control.rs +37 -0
- package/project/.sdk/tm/rust/core/helpers.rs +168 -0
- package/project/.sdk/tm/rust/core/mod.rs +18 -0
- package/project/.sdk/tm/rust/core/operation.rs +35 -0
- package/project/.sdk/tm/rust/core/point.rs +68 -0
- package/project/.sdk/tm/rust/core/response.rs +38 -0
- package/project/.sdk/tm/rust/core/result.rs +90 -0
- package/project/.sdk/tm/rust/core/spec.rs +109 -0
- package/project/.sdk/tm/rust/core/types.rs +105 -0
- package/project/.sdk/tm/rust/core/utility_type.rs +184 -0
- package/project/.sdk/tm/rust/feature/audit.rs +138 -0
- package/project/.sdk/tm/rust/feature/base.rs +49 -0
- package/project/.sdk/tm/rust/feature/cache.rs +198 -0
- package/project/.sdk/tm/rust/feature/clienttrack.rs +154 -0
- package/project/.sdk/tm/rust/feature/debug.rs +188 -0
- package/project/.sdk/tm/rust/feature/idempotency.rs +139 -0
- package/project/.sdk/tm/rust/feature/log.rs +114 -0
- package/project/.sdk/tm/rust/feature/metrics.rs +136 -0
- package/project/.sdk/tm/rust/feature/mod.rs +24 -0
- package/project/.sdk/tm/rust/feature/netsim.rs +233 -0
- package/project/.sdk/tm/rust/feature/paging.rs +209 -0
- package/project/.sdk/tm/rust/feature/proxy.rs +165 -0
- package/project/.sdk/tm/rust/feature/ratelimit.rs +116 -0
- package/project/.sdk/tm/rust/feature/rbac.rs +152 -0
- package/project/.sdk/tm/rust/feature/retry.rs +190 -0
- package/project/.sdk/tm/rust/feature/streaming.rs +124 -0
- package/project/.sdk/tm/rust/feature/support.rs +145 -0
- package/project/.sdk/tm/rust/feature/telemetry.rs +185 -0
- package/project/.sdk/tm/rust/feature/test.rs +397 -0
- package/project/.sdk/tm/rust/feature/timeout.rs +103 -0
- package/project/.sdk/tm/rust/src/feature/README.md +1 -0
- package/project/.sdk/tm/rust/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/rust/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/rust/tests/common/mod.rs +969 -0
- package/project/.sdk/tm/rust/tests/custom_utility_test.rs +69 -0
- package/project/.sdk/tm/rust/tests/feature_test.rs +1864 -0
- package/project/.sdk/tm/rust/tests/netsim_test.rs +78 -0
- package/project/.sdk/tm/rust/tests/pipeline_test.rs +699 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +999 -0
- package/project/.sdk/tm/rust/tests/sdk-test-control.json +19 -0
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +424 -0
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +733 -0
- package/project/.sdk/tm/rust/utility/clean.rs +13 -0
- package/project/.sdk/tm/rust/utility/done.rs +31 -0
- package/project/.sdk/tm/rust/utility/feature_add.rs +46 -0
- package/project/.sdk/tm/rust/utility/feature_hook.rs +18 -0
- package/project/.sdk/tm/rust/utility/feature_init.rs +26 -0
- package/project/.sdk/tm/rust/utility/fetcher.rs +142 -0
- package/project/.sdk/tm/rust/utility/jsonparse.rs +211 -0
- package/project/.sdk/tm/rust/utility/make_context.rs +7 -0
- package/project/.sdk/tm/rust/utility/make_error.rs +79 -0
- package/project/.sdk/tm/rust/utility/make_fetch_def.rs +42 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +175 -0
- package/project/.sdk/tm/rust/utility/make_point.rs +116 -0
- package/project/.sdk/tm/rust/utility/make_request.rs +73 -0
- package/project/.sdk/tm/rust/utility/make_response.rs +56 -0
- package/project/.sdk/tm/rust/utility/make_result.rs +64 -0
- package/project/.sdk/tm/rust/utility/make_spec.rs +70 -0
- package/project/.sdk/tm/rust/utility/make_url.rs +83 -0
- package/project/.sdk/tm/rust/utility/mod.rs +36 -0
- package/project/.sdk/tm/rust/utility/param.rs +67 -0
- package/project/.sdk/tm/rust/utility/prepare_auth.rs +65 -0
- package/project/.sdk/tm/rust/utility/prepare_body.rs +14 -0
- package/project/.sdk/tm/rust/utility/prepare_headers.rs +23 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +18 -0
- package/project/.sdk/tm/rust/utility/prepare_params.rs +33 -0
- package/project/.sdk/tm/rust/utility/prepare_path.rs +17 -0
- package/project/.sdk/tm/rust/utility/prepare_query.rs +47 -0
- package/project/.sdk/tm/rust/utility/result_basic.rs +35 -0
- package/project/.sdk/tm/rust/utility/result_body.rs +26 -0
- package/project/.sdk/tm/rust/utility/result_headers.rs +24 -0
- package/project/.sdk/tm/rust/utility/transform_request.rs +31 -0
- package/project/.sdk/tm/rust/utility/transform_response.rs +55 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/consts.rs +122 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/major.rs +2688 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/mini.rs +1081 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/mod.rs +70 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/ordered_map.rs +159 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/re.rs +1229 -0
- package/project/.sdk/tm/rust/utility/voxgigstruct/value.rs +372 -0
- package/project/.sdk/tm/scala/LICENSE +22 -0
- package/project/.sdk/tm/scala/Makefile +24 -0
- package/project/.sdk/tm/scala/VERSION +1 -0
- package/project/.sdk/tm/scala/core/Context.scala +160 -0
- package/project/.sdk/tm/scala/core/Contracts.scala +76 -0
- package/project/.sdk/tm/scala/core/Control.scala +23 -0
- package/project/.sdk/tm/scala/core/Helpers.scala +38 -0
- package/project/.sdk/tm/scala/core/Operation.scala +37 -0
- package/project/.sdk/tm/scala/core/Point.scala +44 -0
- package/project/.sdk/tm/scala/core/Response.scala +37 -0
- package/project/.sdk/tm/scala/core/Result.scala +42 -0
- package/project/.sdk/tm/scala/core/SdkClient.scala +220 -0
- package/project/.sdk/tm/scala/core/SdkError.scala +15 -0
- package/project/.sdk/tm/scala/core/Spec.scala +39 -0
- package/project/.sdk/tm/scala/core/Types.scala +31 -0
- package/project/.sdk/tm/scala/core/Utility.scala +85 -0
- package/project/.sdk/tm/scala/feature/AuditFeature.scala +101 -0
- package/project/.sdk/tm/scala/feature/BaseFeature.scala +21 -0
- package/project/.sdk/tm/scala/feature/CacheFeature.scala +181 -0
- package/project/.sdk/tm/scala/feature/ClienttrackFeature.scala +93 -0
- package/project/.sdk/tm/scala/feature/DebugFeature.scala +149 -0
- package/project/.sdk/tm/scala/feature/FeatureOptions.scala +111 -0
- package/project/.sdk/tm/scala/feature/IdempotencyFeature.scala +106 -0
- package/project/.sdk/tm/scala/feature/LogFeature.scala +64 -0
- package/project/.sdk/tm/scala/feature/MetricsFeature.scala +105 -0
- package/project/.sdk/tm/scala/feature/NetsimFeature.scala +134 -0
- package/project/.sdk/tm/scala/feature/PagingFeature.scala +170 -0
- package/project/.sdk/tm/scala/feature/ProxyFeature.scala +113 -0
- package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +58 -0
- package/project/.sdk/tm/scala/feature/RbacFeature.scala +90 -0
- package/project/.sdk/tm/scala/feature/RetryFeature.scala +104 -0
- package/project/.sdk/tm/scala/feature/StreamingFeature.scala +98 -0
- package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +129 -0
- package/project/.sdk/tm/scala/feature/TestFeature.scala +253 -0
- package/project/.sdk/tm/scala/feature/TimeoutFeature.scala +57 -0
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +766 -0
- package/project/.sdk/tm/scala/sdktest/SdkTestSupport.scala +93 -0
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/sdk-test-control.json +19 -0
- package/project/.sdk/tm/scala/src/feature/README.md +1 -0
- package/project/.sdk/tm/scala/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/scala/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/scala/utility/FeatureUtils.scala +68 -0
- package/project/.sdk/tm/scala/utility/Fetcher.scala +129 -0
- package/project/.sdk/tm/scala/utility/Json.java +268 -0
- package/project/.sdk/tm/scala/utility/Make.scala +463 -0
- package/project/.sdk/tm/scala/utility/MakeSpec.scala +49 -0
- package/project/.sdk/tm/scala/utility/Misc.scala +68 -0
- package/project/.sdk/tm/scala/utility/Prepare.scala +142 -0
- package/project/.sdk/tm/scala/utility/Register.scala +38 -0
- package/project/.sdk/tm/scala/utility/Results.scala +63 -0
- package/project/.sdk/tm/scala/utility/StructUtility.scala +29 -0
- package/project/.sdk/tm/scala/utility/Transform.scala +52 -0
- package/project/.sdk/tm/scala/utility/struct/Struct.java +3550 -0
- package/project/.sdk/tm/scala/utility/struct/voxgig_struct.scala +1833 -0
- package/project/.sdk/tm/swift/LICENSE +22 -0
- package/project/.sdk/tm/swift/Makefile +41 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +113 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +260 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +111 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/JSON.swift +327 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Merge.swift +55 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +601 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/OrderedDictionary.swift +79 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Path.swift +157 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Select.swift +259 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Transform.swift +462 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +378 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Value.swift +184 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Walk.swift +44 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +161 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Control.swift +20 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Operation.swift +27 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Point.swift +37 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Response.swift +29 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Result.swift +41 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Spec.swift +36 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Support.swift +98 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Types.swift +25 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Utility.swift +81 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +99 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/BaseFeature.swift +60 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CacheFeature.swift +164 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ClienttrackFeature.swift +95 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/DebugFeature.swift +126 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/FeatureOptions.swift +96 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/IdempotencyFeature.swift +80 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/LogFeature.swift +69 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +103 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/NetsimFeature.swift +177 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +154 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ProxyFeature.swift +122 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +79 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RbacFeature.swift +103 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +150 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/StreamingFeature.swift +82 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +119 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +257 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TimeoutFeature.swift +83 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Feature.swift +56 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +107 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +321 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeError.swift +56 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +151 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +157 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Register.swift +40 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/CustomUtilityTest.swift +44 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/ExistsTest.swift +12 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +1049 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/NetsimTest.swift +50 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PipelineTest.swift +398 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +750 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +237 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +523 -0
- package/project/.sdk/tm/swift/VERSION +1 -0
- package/project/.sdk/tm/swift/src/feature/README.md +6 -0
- package/project/.sdk/tm/swift/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/swift/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/ts/Makefile +6 -1
- package/project/.sdk/tm/ts/src/feature/audit/AuditFeature.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/cache/CacheFeature.ts +152 -0
- package/project/.sdk/tm/ts/src/feature/clienttrack/ClienttrackFeature.ts +106 -0
- package/project/.sdk/tm/ts/src/feature/debug/DebugFeature.ts +134 -0
- package/project/.sdk/tm/ts/src/feature/idempotency/IdempotencyFeature.ts +97 -0
- package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +104 -0
- package/project/.sdk/tm/ts/src/feature/netsim/NetsimFeature.ts +189 -0
- package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +141 -0
- package/project/.sdk/tm/ts/src/feature/proxy/ProxyFeature.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +108 -0
- package/project/.sdk/tm/ts/src/feature/rbac/RbacFeature.ts +104 -0
- package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +160 -0
- package/project/.sdk/tm/ts/src/feature/streaming/StreamingFeature.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +130 -0
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +58 -1
- package/project/.sdk/tm/ts/src/feature/timeout/TimeoutFeature.ts +103 -0
- package/project/.sdk/tm/ts/src/utility/FeatureHookUtility.ts +4 -1
- package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +9 -0
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +31 -1
- package/project/.sdk/tm/ts/test/feature/harness.ts +293 -0
- package/project/.sdk/tm/ts/test/feature.test.ts +772 -0
- package/project/.sdk/tm/ts/test/netsim.test.ts +43 -0
- package/project/.sdk/tm/ts/test/pipeline.test.ts +382 -0
- package/project/.sdk/tm/zig/LICENSE +21 -0
- package/project/.sdk/tm/zig/Makefile +31 -0
- package/project/.sdk/tm/zig/VERSION +1 -0
- package/project/.sdk/tm/zig/build.zig +58 -0
- package/project/.sdk/tm/zig/build.zig.zon +11 -0
- package/project/.sdk/tm/zig/core/context.zig +258 -0
- package/project/.sdk/tm/zig/core/control.zig +26 -0
- package/project/.sdk/tm/zig/core/error.zig +28 -0
- package/project/.sdk/tm/zig/core/helpers.zig +326 -0
- package/project/.sdk/tm/zig/core/mem.zig +20 -0
- package/project/.sdk/tm/zig/core/operation.zig +34 -0
- package/project/.sdk/tm/zig/core/point.zig +63 -0
- package/project/.sdk/tm/zig/core/response.zig +32 -0
- package/project/.sdk/tm/zig/core/result.zig +73 -0
- package/project/.sdk/tm/zig/core/spec.zig +68 -0
- package/project/.sdk/tm/zig/core/types.zig +101 -0
- package/project/.sdk/tm/zig/core/utility.zig +1115 -0
- package/project/.sdk/tm/zig/feature/audit.zig +131 -0
- package/project/.sdk/tm/zig/feature/base.zig +52 -0
- package/project/.sdk/tm/zig/feature/cache.zig +216 -0
- package/project/.sdk/tm/zig/feature/clienttrack.zig +129 -0
- package/project/.sdk/tm/zig/feature/debug.zig +191 -0
- package/project/.sdk/tm/zig/feature/idempotency.zig +121 -0
- package/project/.sdk/tm/zig/feature/log.zig +93 -0
- package/project/.sdk/tm/zig/feature/metrics.zig +145 -0
- package/project/.sdk/tm/zig/feature/netsim.zig +186 -0
- package/project/.sdk/tm/zig/feature/paging.zig +201 -0
- package/project/.sdk/tm/zig/feature/proxy.zig +180 -0
- package/project/.sdk/tm/zig/feature/ratelimit.zig +123 -0
- package/project/.sdk/tm/zig/feature/rbac.zig +126 -0
- package/project/.sdk/tm/zig/feature/retry.zig +167 -0
- package/project/.sdk/tm/zig/feature/streaming.zig +127 -0
- package/project/.sdk/tm/zig/feature/support.zig +128 -0
- package/project/.sdk/tm/zig/feature/telemetry.zig +165 -0
- package/project/.sdk/tm/zig/feature/test.zig +315 -0
- package/project/.sdk/tm/zig/feature/timeout.zig +105 -0
- package/project/.sdk/tm/zig/root.zig +74 -0
- package/project/.sdk/tm/zig/src/feature/README.md +1 -0
- package/project/.sdk/tm/zig/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/zig/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/zig/test/feature_test.zig +1045 -0
- package/project/.sdk/tm/zig/test/fh.zig +531 -0
- package/project/.sdk/tm/zig/test/gotcha_test.zig +230 -0
- package/project/.sdk/tm/zig/test/pipeline_test.zig +493 -0
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +346 -0
- package/project/.sdk/tm/zig/test/struct_corpus.zig +1145 -0
- package/project/.sdk/tm/zig/test/struct_runner.zig +226 -0
- package/project/.sdk/tm/zig/utility/jsonparse.zig +13 -0
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +779 -0
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +4400 -0
|
@@ -0,0 +1,1278 @@
|
|
|
1
|
+
-- ProjectName SDK features + API-agnostic client helpers.
|
|
2
|
+
--
|
|
3
|
+
-- The 18 pipeline features (base/test/log + the 15 enterprise features) and
|
|
4
|
+
-- the transport they wrap, plus make_client_base / direct / prepare / test and
|
|
5
|
+
-- the generic (config-driven) entity constructor. Each feature is built by an
|
|
6
|
+
-- IO constructor that allocates IORefs for its mutable state and returns a
|
|
7
|
+
-- `Feature` whose init/hook closures observe and mutate the shared pipeline
|
|
8
|
+
-- state. Transport-wrapping features re-bind the mutable `uFetcher` cell so
|
|
9
|
+
-- later inits sit outermost.
|
|
10
|
+
|
|
11
|
+
module SdkFeatures where
|
|
12
|
+
|
|
13
|
+
import Control.Concurrent (threadDelay)
|
|
14
|
+
import Control.Exception (throwIO, try)
|
|
15
|
+
import Control.Monad (forM_, when)
|
|
16
|
+
import Data.Bits ((.&.))
|
|
17
|
+
import Data.IORef
|
|
18
|
+
import Data.Maybe (isJust, isNothing)
|
|
19
|
+
import Data.Time.Clock.POSIX (getPOSIXTime)
|
|
20
|
+
import System.Environment (lookupEnv)
|
|
21
|
+
|
|
22
|
+
import VoxgigStruct
|
|
23
|
+
( Value (..), InjArg (..), emptyList, emptyMap, mkList
|
|
24
|
+
, getprop, setprop, delprop, getelem, keysof, listItems
|
|
25
|
+
, clone, merge, transform, select, size, isempty, ismap, isNoval, isNullish
|
|
26
|
+
, vint, setpath, walk )
|
|
27
|
+
import SdkTypes
|
|
28
|
+
import SdkHelpers
|
|
29
|
+
import SdkRuntime
|
|
30
|
+
|
|
31
|
+
-- ------------------------------------------------------------------
|
|
32
|
+
-- clock / option readers
|
|
33
|
+
-- ------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
defaultNowMs :: IO Double
|
|
36
|
+
defaultNowMs = (* 1000) . realToFrac <$> getPOSIXTime
|
|
37
|
+
|
|
38
|
+
realSleep :: Double -> IO ()
|
|
39
|
+
realSleep ms = when (ms > 0) (threadDelay (round (ms * 1000)))
|
|
40
|
+
|
|
41
|
+
optNum :: Value -> String -> Double -> IO Double
|
|
42
|
+
optNum opts k d = do v <- getp opts k; pure (case v of VNum n -> n; _ -> d)
|
|
43
|
+
|
|
44
|
+
optInt :: Value -> String -> Int -> IO Int
|
|
45
|
+
optInt opts k d = do v <- getp opts k; pure (case v of VNum n -> truncate n; _ -> d)
|
|
46
|
+
|
|
47
|
+
optStr :: Value -> String -> String -> IO String
|
|
48
|
+
optStr = getStrD
|
|
49
|
+
|
|
50
|
+
optActive :: Value -> IO Bool
|
|
51
|
+
optActive opts = isTrueV <$> getp opts "active"
|
|
52
|
+
|
|
53
|
+
optStrList :: Value -> String -> [String] -> IO [String]
|
|
54
|
+
optStrList opts k d = do
|
|
55
|
+
v <- getp opts k
|
|
56
|
+
case v of { VList _ -> do { its <- listItems v; pure [s | VStr s <- its] }; _ -> pure d }
|
|
57
|
+
|
|
58
|
+
nowOf :: Value -> IO Double
|
|
59
|
+
nowOf opts = do
|
|
60
|
+
v <- getp opts "now"
|
|
61
|
+
case v of
|
|
62
|
+
VFunc _ -> do r <- callVfn v VNoval; pure (case r of VNum n -> n; _ -> 0)
|
|
63
|
+
_ -> defaultNowMs
|
|
64
|
+
|
|
65
|
+
sleepOf :: Value -> Double -> IO ()
|
|
66
|
+
sleepOf opts ms = when (ms > 0) $ do
|
|
67
|
+
v <- getp opts "sleep"
|
|
68
|
+
case v of VFunc _ -> () <$ callVfn v (VNum ms); _ -> realSleep ms
|
|
69
|
+
|
|
70
|
+
toOptsMap :: Value -> IO Value
|
|
71
|
+
toOptsMap opts = case toMap opts of VMap _ -> pure opts; _ -> emptyMap
|
|
72
|
+
|
|
73
|
+
-- ------------------------------------------------------------------
|
|
74
|
+
-- small helpers
|
|
75
|
+
-- ------------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
endsWith :: String -> String -> Bool
|
|
78
|
+
endsWith s suf = length s >= length suf && drop (length s - length suf) s == suf
|
|
79
|
+
|
|
80
|
+
stripLeadDot :: String -> String
|
|
81
|
+
stripLeadDot ('.' : r) = r
|
|
82
|
+
stripLeadDot s = s
|
|
83
|
+
|
|
84
|
+
urlHost :: String -> String
|
|
85
|
+
urlHost url = case findScheme 0 of
|
|
86
|
+
Just start -> takeWhile (\c -> c /= '/' && c /= ':') (drop start url)
|
|
87
|
+
Nothing -> url
|
|
88
|
+
where
|
|
89
|
+
n = length url
|
|
90
|
+
findScheme i
|
|
91
|
+
| i + 3 > n = Nothing
|
|
92
|
+
| take 3 (drop i url) == "://" = Just (i + 3)
|
|
93
|
+
| otherwise = findScheme (i + 1)
|
|
94
|
+
|
|
95
|
+
featureBase :: IO (IORef Bool, IORef Value)
|
|
96
|
+
featureBase = do active <- newIORef True; fopts <- newIORef VNoval; pure (active, fopts)
|
|
97
|
+
|
|
98
|
+
-- ------------------------------------------------------------------
|
|
99
|
+
-- base / log
|
|
100
|
+
-- ------------------------------------------------------------------
|
|
101
|
+
|
|
102
|
+
baseFeature :: IO Feature
|
|
103
|
+
baseFeature = do
|
|
104
|
+
(active, fopts) <- featureBase
|
|
105
|
+
pure Feature { fName = "base", fVersion = "0.0.1", fActive = active, fOptions = fopts
|
|
106
|
+
, fInit = \_ _ -> pure (), fHook = \_ _ -> pure () }
|
|
107
|
+
|
|
108
|
+
logFeature :: IO Feature
|
|
109
|
+
logFeature = do
|
|
110
|
+
(active, fopts) <- featureBase
|
|
111
|
+
let initFn _ opts = do a <- optActive opts; writeIORef active a
|
|
112
|
+
pure Feature { fName = "log", fVersion = "0.0.1", fActive = active, fOptions = fopts
|
|
113
|
+
, fInit = initFn, fHook = \_ _ -> pure () }
|
|
114
|
+
|
|
115
|
+
-- ------------------------------------------------------------------
|
|
116
|
+
-- retry
|
|
117
|
+
-- ------------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
retryFeature :: IO Feature
|
|
120
|
+
retryFeature = do
|
|
121
|
+
(active, fopts) <- featureBase
|
|
122
|
+
options <- newIORef =<< emptyMap
|
|
123
|
+
let statuses = do
|
|
124
|
+
opts <- readIORef options; v <- getp opts "statuses"
|
|
125
|
+
case v of { VList _ -> do { its <- listItems v; pure [truncate n | VNum n <- its] }; _ -> pure [408, 425, 429, 500, 502, 503, 504] }
|
|
126
|
+
retryAfterOf resV = case resV of
|
|
127
|
+
VMap _ -> do
|
|
128
|
+
h <- getp resV "headers"
|
|
129
|
+
case h of
|
|
130
|
+
VMap _ -> do
|
|
131
|
+
ra <- headerCI h "retry-after"
|
|
132
|
+
case ra of
|
|
133
|
+
VNoval -> pure Nothing; VNull -> pure Nothing
|
|
134
|
+
_ -> case reads (vstring ra) :: [(Double, String)] of { [(x, _)] -> pure (Just (x * 1000)); _ -> pure Nothing }
|
|
135
|
+
_ -> pure Nothing
|
|
136
|
+
_ -> pure Nothing
|
|
137
|
+
retryable resV merr =
|
|
138
|
+
if isJust merr then pure True
|
|
139
|
+
else if isNoval resV then pure True
|
|
140
|
+
else case resV of { VMap _ -> do { st <- getp resV "status"; sts <- statuses; pure (case st of { VNum n -> truncate n `elem` sts; _ -> False }) }; _ -> pure False }
|
|
141
|
+
backoff resV attempt = do
|
|
142
|
+
opts <- readIORef options
|
|
143
|
+
minDelay <- optNum opts "minDelay" 50; maxDelay <- optNum opts "maxDelay" 2000; factor <- optNum opts "factor" 2
|
|
144
|
+
ra <- retryAfterOf resV
|
|
145
|
+
case ra of
|
|
146
|
+
Just r -> pure (min maxDelay r)
|
|
147
|
+
Nothing -> do
|
|
148
|
+
let base = minDelay * (factor ^^ attempt)
|
|
149
|
+
jv <- getp opts "jitter"
|
|
150
|
+
jitter <- case jv of VBool False -> pure 0; _ -> do j <- randInt (max 1 (round minDelay)); pure (fromIntegral j)
|
|
151
|
+
pure (min maxDelay (base + jitter))
|
|
152
|
+
track ctx = do cl <- cc ctx; bucket <- trackBucket cl "retry" (do rs <- emptyList; jo [("attempts", VNum 0), ("retries", rs)]); bumpNum bucket "attempts" 1
|
|
153
|
+
withRetry ctx url fd inner = do
|
|
154
|
+
opts <- readIORef options
|
|
155
|
+
retries <- optInt opts "retries" 2
|
|
156
|
+
let loop attempt = do
|
|
157
|
+
(r, e) <- inner ctx url fd
|
|
158
|
+
ret <- retryable r e
|
|
159
|
+
if not ret || attempt >= retries then pure (r, e)
|
|
160
|
+
else do w <- backoff r attempt; track ctx; sleepOf opts w; loop (attempt + 1)
|
|
161
|
+
loop 0
|
|
162
|
+
initFn ctx opts = do
|
|
163
|
+
om <- toOptsMap opts; writeIORef options om
|
|
164
|
+
a <- optActive opts; writeIORef active a
|
|
165
|
+
when a $ do u <- cu ctx; inner <- readIORef (uFetcher u); writeIORef (uFetcher u) (\c ur f -> withRetry c ur f inner)
|
|
166
|
+
pure Feature { fName = "retry", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
167
|
+
|
|
168
|
+
-- ------------------------------------------------------------------
|
|
169
|
+
-- timeout
|
|
170
|
+
-- ------------------------------------------------------------------
|
|
171
|
+
|
|
172
|
+
timeoutFeature :: IO Feature
|
|
173
|
+
timeoutFeature = do
|
|
174
|
+
(active, fopts) <- featureBase
|
|
175
|
+
options <- newIORef =<< emptyMap
|
|
176
|
+
let track ctx ms = do cl <- cc ctx; bucket <- trackBucket cl "timeout" (jo [("count", VNum 0), ("ms", VNum ms)]); bumpNum bucket "count" 1
|
|
177
|
+
withTimeout ctx url fd inner = do
|
|
178
|
+
opts <- readIORef options
|
|
179
|
+
ms <- optNum opts "ms" 30000
|
|
180
|
+
if ms <= 0 then inner ctx url fd
|
|
181
|
+
else do
|
|
182
|
+
fdC <- clone fd
|
|
183
|
+
fd2 <- case fdC of VMap _ -> pure fdC; _ -> emptyMap
|
|
184
|
+
setp fd2 "timeout" (VNum (ms / 1000))
|
|
185
|
+
start <- nowOf opts
|
|
186
|
+
(res, err) <- inner ctx url fd2
|
|
187
|
+
now <- nowOf opts
|
|
188
|
+
let elapsed = now - start
|
|
189
|
+
if elapsed > ms
|
|
190
|
+
then do track ctx ms; e <- mkErr "timeout" ("Request exceeded timeout of " ++ show (truncate ms :: Int) ++ "ms"); pure (VNoval, Just e)
|
|
191
|
+
else pure (res, err)
|
|
192
|
+
initFn ctx opts = do
|
|
193
|
+
om <- toOptsMap opts; writeIORef options om
|
|
194
|
+
a <- optActive opts; writeIORef active a
|
|
195
|
+
when a $ do u <- cu ctx; inner <- readIORef (uFetcher u); writeIORef (uFetcher u) (\c ur f -> withTimeout c ur f inner)
|
|
196
|
+
pure Feature { fName = "timeout", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
197
|
+
|
|
198
|
+
-- ------------------------------------------------------------------
|
|
199
|
+
-- ratelimit
|
|
200
|
+
-- ------------------------------------------------------------------
|
|
201
|
+
|
|
202
|
+
ratelimitFeature :: IO Feature
|
|
203
|
+
ratelimitFeature = do
|
|
204
|
+
(active, fopts) <- featureBase
|
|
205
|
+
options <- newIORef =<< emptyMap
|
|
206
|
+
tokens <- newIORef (0 :: Double)
|
|
207
|
+
lastR <- newIORef (0 :: Double)
|
|
208
|
+
let rateOf = do opts <- readIORef options; v <- getp opts "rate"; pure (case v of VNum n | n /= 0 -> n; _ -> 5)
|
|
209
|
+
burstOf = do opts <- readIORef options; v <- getp opts "burst"; case v of VNum n -> pure n; _ -> rateOf
|
|
210
|
+
track ctx wait = do cl <- cc ctx; bucket <- trackBucket cl "ratelimit" (jo [("throttled", VNum 0), ("waitMs", VNum 0)]); bumpNum bucket "throttled" 1; bumpNum bucket "waitMs" wait
|
|
211
|
+
acquire ctx = do
|
|
212
|
+
opts <- readIORef options
|
|
213
|
+
r <- rateOf; b <- burstOf
|
|
214
|
+
now <- nowOf opts
|
|
215
|
+
lst <- readIORef lastR
|
|
216
|
+
let elapsed = now - lst
|
|
217
|
+
writeIORef lastR now
|
|
218
|
+
tk <- readIORef tokens
|
|
219
|
+
let tk' = min b (tk + (elapsed / 1000) * r)
|
|
220
|
+
if tk' >= 1 then writeIORef tokens (tk' - 1)
|
|
221
|
+
else do
|
|
222
|
+
let needed = 1 - tk'
|
|
223
|
+
waitMs = fromIntegral (ceiling ((needed / r) * 1000) :: Int)
|
|
224
|
+
track ctx waitMs; sleepOf opts waitMs
|
|
225
|
+
now2 <- nowOf opts; writeIORef lastR now2; writeIORef tokens 0
|
|
226
|
+
initFn ctx opts = do
|
|
227
|
+
om <- toOptsMap opts; writeIORef options om
|
|
228
|
+
a <- optActive opts; writeIORef active a
|
|
229
|
+
when a $ do
|
|
230
|
+
b <- burstOf; writeIORef tokens b
|
|
231
|
+
n0 <- nowOf =<< readIORef options; writeIORef lastR n0
|
|
232
|
+
u <- cu ctx; inner <- readIORef (uFetcher u); writeIORef (uFetcher u) (\c ur f -> do acquire c; inner c ur f)
|
|
233
|
+
pure Feature { fName = "ratelimit", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
234
|
+
|
|
235
|
+
-- ------------------------------------------------------------------
|
|
236
|
+
-- cache
|
|
237
|
+
-- ------------------------------------------------------------------
|
|
238
|
+
|
|
239
|
+
cacheFeature :: IO Feature
|
|
240
|
+
cacheFeature = do
|
|
241
|
+
(active, fopts) <- featureBase
|
|
242
|
+
options <- newIORef =<< emptyMap
|
|
243
|
+
store <- newIORef ([] :: [(String, Value)])
|
|
244
|
+
let track ctx kind = do cl <- cc ctx; bucket <- trackBucket cl "cache" (jo [("hit", VNum 0), ("miss", VNum 0), ("bypass", VNum 0)]); bumpNum bucket kind 1
|
|
245
|
+
cacheable res = case res of { VMap _ -> do { st <- getp res "status"; pure (case st of { VNum n -> n >= 200 && n < 300; _ -> False }) }; _ -> pure False }
|
|
246
|
+
snapshot res = do
|
|
247
|
+
jv <- getp res "json"
|
|
248
|
+
d <- case jv of VFunc _ -> callJson jv; _ -> pure VNoval
|
|
249
|
+
headers <- emptyMap
|
|
250
|
+
h <- getp res "headers"
|
|
251
|
+
case h of { VMap _ -> do { ks <- keysof h; forM_ ks $ \k -> do { vv <- getp h k; setp headers (lower k) vv } }; _ -> pure () }
|
|
252
|
+
st <- getp res "status"; stt <- getp res "statusText"
|
|
253
|
+
jo [("status", st), ("statusText", stt), ("data", d), ("headers", headers)]
|
|
254
|
+
replay snap = do
|
|
255
|
+
d <- getp snap "data"; st <- getp snap "status"; stt <- getp snap "statusText"
|
|
256
|
+
h <- getp snap "headers"; hC <- clone h; h2 <- case hC of VMap _ -> pure hC; _ -> emptyMap
|
|
257
|
+
jo [("status", st), ("statusText", stt), ("body", VStr "not-used"), ("json", jsonThunk d), ("headers", h2)]
|
|
258
|
+
evict = do opts <- readIORef options; mx <- optInt opts "max" 256; let go = do s <- readIORef store; when (length s >= mx) (case s of (_ : tl) -> writeIORef store tl >> go; [] -> pure ()) in go
|
|
259
|
+
through ctx url fd inner = do
|
|
260
|
+
opts <- readIORef options
|
|
261
|
+
meth <- (\v -> case v of VStr s -> upper s; _ -> "GET") <$> getp fd "method"
|
|
262
|
+
methods <- map upper <$> optStrList opts "methods" ["GET"]
|
|
263
|
+
if meth `notElem` methods then inner ctx url fd
|
|
264
|
+
else do
|
|
265
|
+
let key = meth ++ " " ++ url
|
|
266
|
+
now <- nowOf opts
|
|
267
|
+
s <- readIORef store
|
|
268
|
+
case lookup key s of
|
|
269
|
+
Just hit -> do
|
|
270
|
+
exp0 <- getp hit "expiry"
|
|
271
|
+
let fresh = case exp0 of { VNum e -> e > now; _ -> False }
|
|
272
|
+
if fresh then do track ctx "hit"; snp <- getp hit "snapshot"; rp <- replay snp; pure (rp, Nothing)
|
|
273
|
+
else doMiss ctx url fd inner opts key now
|
|
274
|
+
Nothing -> doMiss ctx url fd inner opts key now
|
|
275
|
+
doMiss ctx url fd inner opts key now = do
|
|
276
|
+
(res, err) <- inner ctx url fd
|
|
277
|
+
ok <- cacheable res
|
|
278
|
+
if isNothing err && ok
|
|
279
|
+
then do
|
|
280
|
+
snp <- snapshot res
|
|
281
|
+
ttl <- optNum opts "ttl" 5000
|
|
282
|
+
evict
|
|
283
|
+
entry <- jo [("expiry", VNum (now + ttl)), ("snapshot", snp)]
|
|
284
|
+
modifyIORef store (\st -> filter ((/= key) . fst) st ++ [(key, entry)])
|
|
285
|
+
track ctx "miss"
|
|
286
|
+
rp <- replay snp; pure (rp, Nothing)
|
|
287
|
+
else do track ctx "bypass"; pure (res, err)
|
|
288
|
+
initFn ctx opts = do
|
|
289
|
+
om <- toOptsMap opts; writeIORef options om
|
|
290
|
+
a <- optActive opts; writeIORef active a
|
|
291
|
+
when a $ do writeIORef store []; u <- cu ctx; inner <- readIORef (uFetcher u); writeIORef (uFetcher u) (\c ur f -> through c ur f inner)
|
|
292
|
+
pure Feature { fName = "cache", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
293
|
+
|
|
294
|
+
-- ------------------------------------------------------------------
|
|
295
|
+
-- idempotency
|
|
296
|
+
-- ------------------------------------------------------------------
|
|
297
|
+
|
|
298
|
+
idempotencyFeature :: IO Feature
|
|
299
|
+
idempotencyFeature = do
|
|
300
|
+
(active, fopts) <- featureBase
|
|
301
|
+
options <- newIORef =<< emptyMap
|
|
302
|
+
let genkey = do opts <- readIORef options; v <- getp opts "keygen"; case v of VFunc _ -> vstring <$> callVfn v VNoval; _ -> randId16
|
|
303
|
+
mutating ctx = do
|
|
304
|
+
opts <- readIORef options
|
|
305
|
+
methods <- map upper <$> optStrList opts "methods" ["POST", "PUT", "PATCH", "DELETE"]
|
|
306
|
+
specV <- readIORef (cSpec ctx)
|
|
307
|
+
meth <- case specV of VMap _ -> upper <$> getStrD specV "method" ""; _ -> pure ""
|
|
308
|
+
if meth /= "" && meth `elem` methods then pure True
|
|
309
|
+
else do op <- readIORef (cOp ctx); ops <- optStrList opts "ops" ["create", "update", "remove"]; pure (opName op `elem` ops)
|
|
310
|
+
hookFn name ctx = do
|
|
311
|
+
a <- readIORef active
|
|
312
|
+
when (name == "PreRequest" && a) $ do
|
|
313
|
+
specV <- readIORef (cSpec ctx)
|
|
314
|
+
case specV of
|
|
315
|
+
VMap _ -> do
|
|
316
|
+
mut <- mutating ctx
|
|
317
|
+
when mut $ do
|
|
318
|
+
opts <- readIORef options
|
|
319
|
+
header <- optStr opts "header" "Idempotency-Key"
|
|
320
|
+
hdrs <- getp specV "headers"
|
|
321
|
+
existing <- headerCI hdrs header
|
|
322
|
+
when (isNoval existing) $ do
|
|
323
|
+
key <- genkey
|
|
324
|
+
setp hdrs header (VStr key)
|
|
325
|
+
cl <- cc ctx
|
|
326
|
+
bucket <- trackBucket cl "idempotency" (jo [("issued", VNum 0), ("last", VNoval)])
|
|
327
|
+
bumpNum bucket "issued" 1; setp bucket "last" (VStr key)
|
|
328
|
+
_ -> pure ()
|
|
329
|
+
initFn _ opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a
|
|
330
|
+
pure Feature { fName = "idempotency", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
331
|
+
|
|
332
|
+
-- ------------------------------------------------------------------
|
|
333
|
+
-- rbac (PrePoint short-circuit)
|
|
334
|
+
-- ------------------------------------------------------------------
|
|
335
|
+
|
|
336
|
+
rbacFeature :: IO Feature
|
|
337
|
+
rbacFeature = do
|
|
338
|
+
(active, fopts) <- featureBase
|
|
339
|
+
options <- newIORef =<< emptyMap
|
|
340
|
+
perms <- newIORef ([] :: [String])
|
|
341
|
+
let track ctx required allowed = do
|
|
342
|
+
cl <- cc ctx
|
|
343
|
+
bucket <- trackBucket cl "rbac" (jo [("allowed", VNum 0), ("denied", VNum 0), ("last", VNoval)])
|
|
344
|
+
bumpNum bucket (if allowed then "allowed" else "denied") 1
|
|
345
|
+
op <- readIORef (cOp ctx)
|
|
346
|
+
lastM <- jo [("required", VStr required), ("allowed", VBool allowed), ("op", VStr (opName op))]
|
|
347
|
+
setp bucket "last" lastM
|
|
348
|
+
requiredOf ctx = do
|
|
349
|
+
opts <- readIORef options
|
|
350
|
+
rulesV <- getp opts "rules"
|
|
351
|
+
let rules = case rulesV of { VMap _ -> rulesV; _ -> VNoval }
|
|
352
|
+
ment <- readIORef (cEntity ctx); op <- readIORef (cOp ctx)
|
|
353
|
+
let entity = case ment of Just e -> eName e; Nothing -> if opEntity op /= "" then opEntity op else ""
|
|
354
|
+
opname = opName op
|
|
355
|
+
ruleFor k = do v <- getp rules k; pure (case v of VNoval -> Nothing; VNull -> Nothing; _ -> Just (vstring v))
|
|
356
|
+
r1 <- ruleFor (entity ++ "." ++ opname)
|
|
357
|
+
case r1 of
|
|
358
|
+
Just v -> pure (Just v)
|
|
359
|
+
Nothing -> do r2 <- ruleFor opname; case r2 of Just v -> pure (Just v); Nothing -> ruleFor "*"
|
|
360
|
+
reject ctx req = do
|
|
361
|
+
track ctx req False
|
|
362
|
+
op <- readIORef (cOp ctx)
|
|
363
|
+
let opname = if opName op /= "" && opName op /= "_" then opName op else "?"
|
|
364
|
+
e <- mkErr "rbac_denied" ("Permission \"" ++ req ++ "\" required for operation \"" ++ opname ++ "\"")
|
|
365
|
+
out <- readIORef (cOut ctx); setp out "point" e
|
|
366
|
+
hookFn name ctx = do
|
|
367
|
+
a <- readIORef active
|
|
368
|
+
when (name == "PrePoint" && a) $ do
|
|
369
|
+
mreq <- requiredOf ctx
|
|
370
|
+
case mreq of
|
|
371
|
+
Nothing -> do opts <- readIORef options; d <- getp opts "deny"; when (isTrueV d) (reject ctx "<default-deny>")
|
|
372
|
+
Just req -> do ps <- readIORef perms; if "*" `elem` ps || req `elem` ps then track ctx req True else reject ctx req
|
|
373
|
+
initFn _ opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a; pl <- optStrList om "permissions" []; writeIORef perms pl
|
|
374
|
+
pure Feature { fName = "rbac", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
375
|
+
|
|
376
|
+
-- ------------------------------------------------------------------
|
|
377
|
+
-- metrics
|
|
378
|
+
-- ------------------------------------------------------------------
|
|
379
|
+
|
|
380
|
+
metricsFeature :: IO Feature
|
|
381
|
+
metricsFeature = do
|
|
382
|
+
(active, fopts) <- featureBase
|
|
383
|
+
options <- newIORef =<< emptyMap
|
|
384
|
+
let metrics ctx = do cl <- cc ctx; trackBucket cl "metrics" (do tot <- jo [("count", VNum 0), ("ok", VNum 0), ("err", VNum 0), ("totalMs", VNum 0), ("maxMs", VNum 0)]; ops <- emptyMap; jo [("total", tot), ("ops", ops)])
|
|
385
|
+
bump b ok dur = do bumpNum b "count" 1; bumpNum b (if ok then "ok" else "err") 1; bumpNum b "totalMs" dur; mx <- getp b "maxMs"; let { m = case mx of { VNum n -> n; _ -> 0 } }; when (dur > m) (setp b "maxMs" (VNum dur))
|
|
386
|
+
record ctx ok = do
|
|
387
|
+
startV <- scratchGet ctx "metrics_start"
|
|
388
|
+
case startV of
|
|
389
|
+
VNum start -> do
|
|
390
|
+
scratchDel ctx "metrics_start"
|
|
391
|
+
opts <- readIORef options; now <- nowOf opts
|
|
392
|
+
let dur = max 0 (now - start)
|
|
393
|
+
m <- metrics ctx; op <- readIORef (cOp ctx)
|
|
394
|
+
let key = opEntity op ++ "." ++ opName op
|
|
395
|
+
ops <- getp m "ops"; opbV <- getp ops key
|
|
396
|
+
opb <- case opbV of VMap _ -> pure opbV; _ -> do b <- jo [("count", VNum 0), ("ok", VNum 0), ("err", VNum 0), ("totalMs", VNum 0), ("maxMs", VNum 0)]; setp ops key b; pure b
|
|
397
|
+
tot <- getp m "total"; bump tot ok dur; bump opb ok dur
|
|
398
|
+
_ -> pure ()
|
|
399
|
+
hookFn name ctx = do
|
|
400
|
+
a <- readIORef active
|
|
401
|
+
when a $ case name of
|
|
402
|
+
"PrePoint" -> do opts <- readIORef options; now <- nowOf opts; scratchSet ctx "metrics_start" (VNum now)
|
|
403
|
+
"PreDone" -> do ok <- resultOk ctx; record ctx ok
|
|
404
|
+
"PreUnexpected" -> record ctx False
|
|
405
|
+
_ -> pure ()
|
|
406
|
+
initFn ctx opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a; _ <- metrics ctx; pure ()
|
|
407
|
+
pure Feature { fName = "metrics", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
408
|
+
|
|
409
|
+
resultOk :: Context -> IO Bool
|
|
410
|
+
resultOk ctx = do
|
|
411
|
+
rv <- readIORef (cResult ctx)
|
|
412
|
+
case rv of
|
|
413
|
+
VMap _ -> do ok <- getp rv "ok"; err <- getp rv "err"; isE <- isErr err; pure (isTrueV ok && not isE)
|
|
414
|
+
_ -> pure False
|
|
415
|
+
|
|
416
|
+
-- ------------------------------------------------------------------
|
|
417
|
+
-- telemetry
|
|
418
|
+
-- ------------------------------------------------------------------
|
|
419
|
+
|
|
420
|
+
telemetryFeature :: IO Feature
|
|
421
|
+
telemetryFeature = do
|
|
422
|
+
(active, fopts) <- featureBase
|
|
423
|
+
options <- newIORef =<< emptyMap
|
|
424
|
+
seqR <- newIORef (0 :: Int)
|
|
425
|
+
let telemetry ctx = do cl <- cc ctx; trackBucket cl "telemetry" (do sp <- emptyList; jo [("spans", sp), ("active", VNum 0)])
|
|
426
|
+
genId kind = do
|
|
427
|
+
opts <- readIORef options; v <- getp opts "idgen"
|
|
428
|
+
case v of
|
|
429
|
+
VFunc _ -> vstring <$> callVfn v (VStr kind)
|
|
430
|
+
_ -> do modifyIORef seqR (+ 1); s <- readIORef seqR; let { n = pad4 s; padded = n ++ replicate (max 0 (16 - length n)) '0' }; pure ((if kind == "trace" then "t" else "s") ++ padded)
|
|
431
|
+
close ctx ok = do
|
|
432
|
+
spanV <- scratchGet ctx "telemetry_span"
|
|
433
|
+
case spanV of
|
|
434
|
+
VMap _ -> do
|
|
435
|
+
scratchDel ctx "telemetry_span"
|
|
436
|
+
opts <- readIORef options; end <- nowOf opts
|
|
437
|
+
setp spanV "end" (VNum end)
|
|
438
|
+
start <- getp spanV "start"; let s = case start of { VNum n -> n; _ -> 0 }
|
|
439
|
+
setp spanV "durationMs" (VNum (max 0 (end - s)))
|
|
440
|
+
setp spanV "ok" (VBool ok)
|
|
441
|
+
t <- telemetry ctx; bumpNum t "active" (-1)
|
|
442
|
+
spans <- getp t "spans"; appendList spans spanV
|
|
443
|
+
expv <- getp opts "exporter"; case expv of VFunc _ -> () <$ callVfn expv spanV; _ -> pure ()
|
|
444
|
+
_ -> pure ()
|
|
445
|
+
hookFn name ctx = do
|
|
446
|
+
a <- readIORef active
|
|
447
|
+
when a $ case name of
|
|
448
|
+
"PrePoint" -> do
|
|
449
|
+
op <- readIORef (cOp ctx)
|
|
450
|
+
let entity = if opEntity op /= "" then opEntity op else "_"
|
|
451
|
+
opname = if opName op /= "" then opName op else "_"
|
|
452
|
+
tid <- genId "trace"; sid <- genId "span"; opts <- readIORef options; now <- nowOf opts
|
|
453
|
+
span0 <- jo [("traceId", VStr tid), ("spanId", VStr sid), ("name", VStr (entity ++ "." ++ opname)), ("start", VNum now), ("end", VNoval), ("durationMs", VNoval), ("ok", VNoval)]
|
|
454
|
+
scratchSet ctx "telemetry_span" span0
|
|
455
|
+
t <- telemetry ctx; bumpNum t "active" 1
|
|
456
|
+
"PreRequest" -> do
|
|
457
|
+
spanV <- scratchGet ctx "telemetry_span"; specV <- readIORef (cSpec ctx)
|
|
458
|
+
case (spanV, specV) of
|
|
459
|
+
(VMap _, VMap _) -> do
|
|
460
|
+
opts <- readIORef options; hopt <- getp opts "headers"; let hget k d = case hopt of { VMap _ -> getStrD hopt k d; _ -> pure d }
|
|
461
|
+
hdrs <- getp specV "headers"
|
|
462
|
+
th <- hget "trace" "X-Trace-Id"; tid <- getp spanV "traceId"; setp hdrs th tid
|
|
463
|
+
sh <- hget "span" "X-Span-Id"; sid <- getp spanV "spanId"; setp hdrs sh sid
|
|
464
|
+
ph <- hget "parent" "traceparent"; setp hdrs ph (VStr ("00-" ++ vstring tid ++ "-" ++ vstring sid ++ "-01"))
|
|
465
|
+
_ -> pure ()
|
|
466
|
+
"PreDone" -> do ok <- resultOk ctx; close ctx ok
|
|
467
|
+
"PreUnexpected" -> close ctx False
|
|
468
|
+
_ -> pure ()
|
|
469
|
+
initFn ctx opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a; writeIORef seqR 0; _ <- telemetry ctx; pure ()
|
|
470
|
+
pure Feature { fName = "telemetry", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
471
|
+
|
|
472
|
+
pad4 :: Int -> String
|
|
473
|
+
pad4 n = let s = showHexLower n in replicate (max 0 (4 - length s)) '0' ++ s
|
|
474
|
+
|
|
475
|
+
showHexLower :: Int -> String
|
|
476
|
+
showHexLower 0 = "0"
|
|
477
|
+
showHexLower n = go n ""
|
|
478
|
+
where go 0 acc = acc
|
|
479
|
+
go x acc = go (x `div` 16) (hexDigit (x `mod` 16) : acc)
|
|
480
|
+
hexDigit d = "0123456789abcdef" !! d
|
|
481
|
+
|
|
482
|
+
appendList :: Value -> Value -> IO ()
|
|
483
|
+
appendList lst v = do its <- listItems lst; new <- mkList (its ++ [v]); case lst of VList r -> writeIORef r =<< listItems new; _ -> pure ()
|
|
484
|
+
|
|
485
|
+
-- ------------------------------------------------------------------
|
|
486
|
+
-- debug
|
|
487
|
+
-- ------------------------------------------------------------------
|
|
488
|
+
|
|
489
|
+
debugFeature :: IO Feature
|
|
490
|
+
debugFeature = do
|
|
491
|
+
(active, fopts) <- featureBase
|
|
492
|
+
options <- newIORef =<< emptyMap
|
|
493
|
+
let debug ctx = do cl <- cc ctx; trackBucket cl "debug" (do es <- emptyList; jo [("entries", es)])
|
|
494
|
+
redact headers = case headers of
|
|
495
|
+
VMap _ -> do
|
|
496
|
+
opts <- readIORef options
|
|
497
|
+
patterns <- optStrList opts "redact" ["authorization", "cookie", "set-cookie", "api-key", "apikey", "x-api-key", "idempotency-key"]
|
|
498
|
+
out <- emptyMap; ks <- keysof headers
|
|
499
|
+
forM_ ks $ \k -> if lower k `elem` patterns then setp out k (VStr "<redacted>") else do v <- getp headers k; setp out k v
|
|
500
|
+
pure out
|
|
501
|
+
_ -> emptyMap
|
|
502
|
+
finish ctx ok = do
|
|
503
|
+
entryV <- scratchGet ctx "debug_entry"
|
|
504
|
+
case entryV of
|
|
505
|
+
VMap _ -> do
|
|
506
|
+
scratchDel ctx "debug_entry"
|
|
507
|
+
opts <- readIORef options
|
|
508
|
+
rv <- readIORef (cResult ctx); rok <- case rv of VMap _ -> isTrueV <$> getp rv "ok"; _ -> pure True
|
|
509
|
+
setp entryV "ok" (VBool (ok && rok))
|
|
510
|
+
now <- nowOf opts; start <- getp entryV "start"; let s = case start of { VNum n -> n; _ -> 0 }
|
|
511
|
+
setp entryV "durationMs" (VNum (max 0 (now - s)))
|
|
512
|
+
st <- getp entryV "status"
|
|
513
|
+
case st of VNoval -> case rv of { VMap _ -> do { rs <- getp rv "status"; setp entryV "status" rs }; _ -> pure () }; _ -> pure ()
|
|
514
|
+
d <- debug ctx; buf <- getp d "entries"; appendList buf entryV
|
|
515
|
+
mx <- optInt opts "max" 100
|
|
516
|
+
trimList buf mx
|
|
517
|
+
oe <- getp opts "onEntry"; case oe of VFunc _ -> () <$ callVfn oe entryV; _ -> pure ()
|
|
518
|
+
_ -> pure ()
|
|
519
|
+
hookFn name ctx = do
|
|
520
|
+
a <- readIORef active
|
|
521
|
+
when a $ case name of
|
|
522
|
+
"PreRequest" -> do
|
|
523
|
+
op <- readIORef (cOp ctx)
|
|
524
|
+
let opname = (if opEntity op /= "" then opEntity op else "_") ++ "." ++ (if opName op /= "" then opName op else "_")
|
|
525
|
+
specV <- readIORef (cSpec ctx)
|
|
526
|
+
opts <- readIORef options; now <- nowOf opts
|
|
527
|
+
(methodV, urlV, hdrs) <- case specV of
|
|
528
|
+
VMap _ -> do m <- getp specV "method"; u0 <- getStrD specV "url" ""; p0 <- getStrD specV "path" ""; h <- getp specV "headers"; pure (m, VStr (if u0 /= "" then u0 else p0), h)
|
|
529
|
+
_ -> pure (VNoval, VNoval, VNoval)
|
|
530
|
+
rh <- redact hdrs
|
|
531
|
+
entry <- jo [("op", VStr opname), ("method", methodV), ("url", urlV), ("headers", rh), ("start", VNum now), ("status", VNoval), ("ok", VNoval), ("durationMs", VNoval), ("error", VNoval)]
|
|
532
|
+
scratchSet ctx "debug_entry" entry
|
|
533
|
+
"PreResponse" -> do
|
|
534
|
+
entryV <- scratchGet ctx "debug_entry"
|
|
535
|
+
case entryV of
|
|
536
|
+
VMap _ -> do
|
|
537
|
+
respV <- readIORef (cResponse ctx)
|
|
538
|
+
case respV of VMap _ -> do { rs <- getp respV "status"; setp entryV "status" rs }; _ -> pure ()
|
|
539
|
+
u0 <- getp entryV "url"
|
|
540
|
+
case u0 of
|
|
541
|
+
VNoval -> setUrlFromSpec ctx entryV
|
|
542
|
+
VStr "" -> setUrlFromSpec ctx entryV
|
|
543
|
+
_ -> pure ()
|
|
544
|
+
_ -> pure ()
|
|
545
|
+
"PreDone" -> finish ctx True
|
|
546
|
+
"PreUnexpected" -> do
|
|
547
|
+
entryV <- scratchGet ctx "debug_entry"
|
|
548
|
+
case entryV of
|
|
549
|
+
VMap _ -> do ctrl <- readIORef (cCtrl ctx); err <- getp ctrl "err"; isE <- isErr err; when isE (do m <- errMsg err; setp entryV "error" (VStr m))
|
|
550
|
+
_ -> pure ()
|
|
551
|
+
finish ctx False
|
|
552
|
+
_ -> pure ()
|
|
553
|
+
setUrlFromSpec ctx entryV = do specV <- readIORef (cSpec ctx); case specV of { VMap _ -> do { u <- getStrD specV "url" ""; when (u /= "") (setp entryV "url" (VStr u)) }; _ -> pure () }
|
|
554
|
+
initFn ctx opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a; _ <- debug ctx; pure ()
|
|
555
|
+
pure Feature { fName = "debug", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
556
|
+
|
|
557
|
+
trimList :: Value -> Int -> IO ()
|
|
558
|
+
trimList lst mx = do
|
|
559
|
+
its <- listItems lst
|
|
560
|
+
when (length its > mx) $ case lst of VList r -> writeIORef r (drop (length its - mx) its); _ -> pure ()
|
|
561
|
+
|
|
562
|
+
-- ------------------------------------------------------------------
|
|
563
|
+
-- audit
|
|
564
|
+
-- ------------------------------------------------------------------
|
|
565
|
+
|
|
566
|
+
auditFeature :: IO Feature
|
|
567
|
+
auditFeature = do
|
|
568
|
+
(active, fopts) <- featureBase
|
|
569
|
+
options <- newIORef =<< emptyMap
|
|
570
|
+
seqR <- newIORef (0 :: Int)
|
|
571
|
+
let audit ctx = do cl <- cc ctx; trackBucket cl "audit" (do rs <- emptyList; jo [("records", rs)])
|
|
572
|
+
emit ctx outcome = do
|
|
573
|
+
seenV <- scratchGet ctx "audit_seen"
|
|
574
|
+
case seenV of
|
|
575
|
+
VBool True -> pure ()
|
|
576
|
+
_ -> do
|
|
577
|
+
scratchSet ctx "audit_seen" (VBool True)
|
|
578
|
+
modifyIORef seqR (+ 1); sq <- readIORef seqR
|
|
579
|
+
opts <- readIORef options
|
|
580
|
+
ctrl <- readIORef (cCtrl ctx); ac <- getp ctrl "actor"
|
|
581
|
+
actor <- case ac of
|
|
582
|
+
VNoval -> do a2 <- getp opts "actor"; case a2 of VNoval -> pure (VStr "anonymous"); VNull -> pure (VStr "anonymous"); _ -> pure a2
|
|
583
|
+
VNull -> do a2 <- getp opts "actor"; case a2 of VNoval -> pure (VStr "anonymous"); VNull -> pure (VStr "anonymous"); _ -> pure a2
|
|
584
|
+
_ -> pure ac
|
|
585
|
+
now <- nowOf opts; op <- readIORef (cOp ctx)
|
|
586
|
+
rv <- readIORef (cResult ctx); statusV <- case rv of VMap _ -> getp rv "status"; _ -> pure VNoval
|
|
587
|
+
record <- jo [ ("seq", vint sq), ("ts", VNum now), ("actor", actor)
|
|
588
|
+
, ("entity", VStr (if opEntity op /= "" then opEntity op else "_"))
|
|
589
|
+
, ("op", VStr (if opName op /= "" then opName op else "_"))
|
|
590
|
+
, ("outcome", VStr outcome), ("status", statusV), ("correlationId", VStr (cId ctx)) ]
|
|
591
|
+
a <- audit ctx; recs <- getp a "records"; appendList recs record
|
|
592
|
+
mx <- optInt opts "max" 1000; trimList recs mx
|
|
593
|
+
sink <- getp opts "sink"; case sink of VFunc _ -> () <$ callVfn sink record; _ -> pure ()
|
|
594
|
+
hookFn name ctx = do
|
|
595
|
+
a <- readIORef active
|
|
596
|
+
when a $ case name of
|
|
597
|
+
"PreDone" -> do ok <- resultOk ctx; emit ctx (if ok then "ok" else "error")
|
|
598
|
+
"PreUnexpected" -> emit ctx "error"
|
|
599
|
+
_ -> pure ()
|
|
600
|
+
initFn ctx opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a; writeIORef seqR 0; _ <- audit ctx; pure ()
|
|
601
|
+
pure Feature { fName = "audit", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
602
|
+
|
|
603
|
+
-- ------------------------------------------------------------------
|
|
604
|
+
-- clienttrack
|
|
605
|
+
-- ------------------------------------------------------------------
|
|
606
|
+
|
|
607
|
+
clienttrackFeature :: IO Feature
|
|
608
|
+
clienttrackFeature = do
|
|
609
|
+
(active, fopts) <- featureBase
|
|
610
|
+
options <- newIORef =<< emptyMap
|
|
611
|
+
session <- newIORef ""
|
|
612
|
+
requests <- newIORef (0 :: Int)
|
|
613
|
+
let nameOf = do opts <- readIORef options; nm <- optStr opts "clientName" "ProjectName-SDK"; ver <- optStr opts "clientVersion" "0.0.1"; pure (nm ++ "/" ++ ver)
|
|
614
|
+
genId kind = do
|
|
615
|
+
opts <- readIORef options; v <- getp opts "idgen"
|
|
616
|
+
case v of VFunc _ -> vstring <$> callVfn v (VStr kind); _ -> do { r <- randId16; let { s = take 1 kind ++ "-" ++ r }; pure (take 20 s) }
|
|
617
|
+
setNC headers hname val = do e <- headerCI headers hname; when (isNoval e) (setp headers hname (VStr val))
|
|
618
|
+
hookFn name ctx = do
|
|
619
|
+
a <- readIORef active
|
|
620
|
+
when a $ case name of
|
|
621
|
+
"PostConstruct" -> do
|
|
622
|
+
opts <- readIORef options; sid <- getStrD opts "sessionId" ""
|
|
623
|
+
s <- if sid /= "" then pure sid else genId "session"
|
|
624
|
+
writeIORef session s
|
|
625
|
+
cl <- cc ctx; nm <- nameOf; tk <- jo [("session", VStr s), ("requests", VNum 0), ("clientName", VStr nm)]; trackSet cl "clienttrack" tk
|
|
626
|
+
"PreRequest" -> do
|
|
627
|
+
specV <- readIORef (cSpec ctx)
|
|
628
|
+
case specV of
|
|
629
|
+
VMap _ -> do
|
|
630
|
+
s0 <- readIORef session
|
|
631
|
+
s <- if s0 == "" then do opts <- readIORef options; sid <- getStrD opts "sessionId" ""; s' <- if sid /= "" then pure sid else genId "session"; writeIORef session s'; pure s' else pure s0
|
|
632
|
+
opts <- readIORef options; hopt <- getp opts "headers"; let hget k d = case hopt of { VMap _ -> getStrD hopt k d; _ -> pure d }
|
|
633
|
+
modifyIORef requests (+ 1); reqCount <- readIORef requests
|
|
634
|
+
rid <- genId "request"; nm <- nameOf
|
|
635
|
+
hdrs <- getp specV "headers"
|
|
636
|
+
agentH <- hget "agent" "User-Agent"; setNC hdrs agentH nm
|
|
637
|
+
clientH <- hget "client" "X-Client-Id"; setNC hdrs clientH s
|
|
638
|
+
reqH <- hget "request" "X-Request-Id"; setp hdrs reqH (VStr rid)
|
|
639
|
+
cl <- cc ctx
|
|
640
|
+
bucket <- trackBucket cl "clienttrack" (jo [("session", VStr s), ("requests", VNum 0), ("clientName", VStr nm)])
|
|
641
|
+
setp bucket "requests" (vint reqCount); setp bucket "lastRequestId" (VStr rid)
|
|
642
|
+
_ -> pure ()
|
|
643
|
+
_ -> pure ()
|
|
644
|
+
initFn _ opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a; writeIORef requests 0
|
|
645
|
+
pure Feature { fName = "clienttrack", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
646
|
+
|
|
647
|
+
-- ------------------------------------------------------------------
|
|
648
|
+
-- paging
|
|
649
|
+
-- ------------------------------------------------------------------
|
|
650
|
+
|
|
651
|
+
pagingFeature :: IO Feature
|
|
652
|
+
pagingFeature = do
|
|
653
|
+
(active, fopts) <- featureBase
|
|
654
|
+
options <- newIORef =<< emptyMap
|
|
655
|
+
let isList ctx = do opts <- readIORef options; ops <- optStrList opts "ops" ["list"]; op <- readIORef (cOp ctx); pure (opName op `elem` ops)
|
|
656
|
+
numOf v = case v of VNoval -> VNoval; VNull -> VNoval; _ -> case reads (strip (vstring v)) :: [(Double, String)] of { [(x, "")] -> VNum x; _ -> VNoval }
|
|
657
|
+
extractNext link = case (elemIndex '<' link, elemIndex '>' link) of
|
|
658
|
+
(Just i, Just j) | j > i ->
|
|
659
|
+
let inner = take (j - i - 1) (drop (i + 1) link)
|
|
660
|
+
rest = lower (drop (j + 1) link)
|
|
661
|
+
in if substrContains rest "rel" && substrContains rest "next" then Just inner else Nothing
|
|
662
|
+
_ -> Nothing
|
|
663
|
+
hookFn name ctx = do
|
|
664
|
+
a <- readIORef active; il <- isList ctx
|
|
665
|
+
when (a && il) $ case name of
|
|
666
|
+
"PreRequest" -> do
|
|
667
|
+
specV <- readIORef (cSpec ctx)
|
|
668
|
+
case specV of
|
|
669
|
+
VMap _ -> do
|
|
670
|
+
qv <- getp specV "query"
|
|
671
|
+
q <- case qv of VMap _ -> pure qv; _ -> do m <- emptyMap; setp specV "query" m; pure m
|
|
672
|
+
opts <- readIORef options
|
|
673
|
+
pageParam <- optStr opts "pageParam" "page"; limitParam <- optStr opts "limitParam" "limit"; cursorParam <- optStr opts "cursorParam" "cursor"
|
|
674
|
+
ctrl <- readIORef (cCtrl ctx); pgv <- getp ctrl "paging"; let paging = case pgv of { VMap _ -> pgv; _ -> VNoval }
|
|
675
|
+
cur <- case paging of VMap _ -> getp paging "cursor"; _ -> pure VNoval
|
|
676
|
+
case cur of
|
|
677
|
+
VNoval -> do
|
|
678
|
+
pv <- getp q pageParam
|
|
679
|
+
case pv of
|
|
680
|
+
VNoval -> do
|
|
681
|
+
pgPage <- case paging of VMap _ -> getp paging "page"; _ -> pure VNoval
|
|
682
|
+
page <- case pgPage of { VNoval -> do { sp <- getp opts "startPage"; pure (case sp of { VNum n -> VNum n; _ -> VNum 1 }) }; VNull -> do { sp <- getp opts "startPage"; pure (case sp of { VNum n -> VNum n; _ -> VNum 1 }) }; p -> pure p }
|
|
683
|
+
setp q pageParam page
|
|
684
|
+
_ -> pure ()
|
|
685
|
+
VNull -> do
|
|
686
|
+
pv <- getp q pageParam
|
|
687
|
+
case pv of
|
|
688
|
+
VNoval -> do sp <- getp opts "startPage"; setp q pageParam (case sp of VNum n -> VNum n; _ -> VNum 1)
|
|
689
|
+
_ -> pure ()
|
|
690
|
+
c -> setp q cursorParam c
|
|
691
|
+
lim <- getp opts "limit"
|
|
692
|
+
case lim of VNoval -> pure (); VNull -> pure (); _ -> do lv <- getp q limitParam; case lv of VNoval -> setp q limitParam lim; _ -> pure ()
|
|
693
|
+
_ -> pure ()
|
|
694
|
+
"PreResult" -> do
|
|
695
|
+
rv <- readIORef (cResult ctx)
|
|
696
|
+
case rv of
|
|
697
|
+
VMap _ -> do
|
|
698
|
+
hv <- getp rv "headers"; let headers = case hv of { VMap _ -> hv; _ -> VNoval }
|
|
699
|
+
headersM <- case headers of VMap _ -> pure headers; _ -> emptyMap
|
|
700
|
+
body <- getp rv "body"
|
|
701
|
+
xpage <- numOf <$> headerCI headersM "x-page"
|
|
702
|
+
xtot <- numOf <$> headerCI headersM "x-total-count"
|
|
703
|
+
xnext <- numOf <$> headerCI headersM "x-next-page"
|
|
704
|
+
paging <- jo [("page", xpage), ("totalCount", xtot), ("nextPage", xnext), ("next", VNoval), ("cursor", VNoval), ("hasMore", VBool False)]
|
|
705
|
+
lnk <- headerCI headersM "link"
|
|
706
|
+
case lnk of VNoval -> pure (); VNull -> pure (); _ -> case extractNext (vstring lnk) of Just nx -> setp paging "next" (VStr nx); Nothing -> pure ()
|
|
707
|
+
case body of
|
|
708
|
+
VMap _ -> do
|
|
709
|
+
bn <- getp body "next"; case bn of VNoval -> pure (); VNull -> pure (); _ -> do cn <- getp paging "next"; when (isNullish cn) (setp paging "next" bn)
|
|
710
|
+
bc <- getp body "cursor"; case bc of VNoval -> pure (); VNull -> pure (); _ -> setp paging "cursor" bc
|
|
711
|
+
bnc <- getp body "nextCursor"; case bnc of VNoval -> pure (); VNull -> pure (); _ -> setp paging "cursor" bnc
|
|
712
|
+
bhm <- getp body "hasMore"; case bhm of VBool bb -> setp paging "hasMore" (VBool bb); _ -> pure ()
|
|
713
|
+
_ -> pure ()
|
|
714
|
+
hmV <- getp paging "hasMore"; nx <- getp paging "next"; cu2 <- getp paging "cursor"; np <- getp paging "nextPage"
|
|
715
|
+
let hm = isTrueV hmV || not (isNullish nx) || not (isNullish cu2) || not (isNullish np)
|
|
716
|
+
setp paging "hasMore" (VBool hm)
|
|
717
|
+
setp rv "paging" paging
|
|
718
|
+
cl <- cc ctx; lastM <- jo [("last", paging)]; trackSet cl "paging" lastM
|
|
719
|
+
_ -> pure ()
|
|
720
|
+
_ -> pure ()
|
|
721
|
+
initFn _ opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a
|
|
722
|
+
pure Feature { fName = "paging", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
723
|
+
|
|
724
|
+
elemIndex :: Eq a => a -> [a] -> Maybe Int
|
|
725
|
+
elemIndex x = go 0 where go _ [] = Nothing; go i (y : ys) = if x == y then Just i else go (i + 1) ys
|
|
726
|
+
|
|
727
|
+
-- ------------------------------------------------------------------
|
|
728
|
+
-- streaming
|
|
729
|
+
-- ------------------------------------------------------------------
|
|
730
|
+
|
|
731
|
+
streamingFeature :: IO Feature
|
|
732
|
+
streamingFeature = do
|
|
733
|
+
(active, fopts) <- featureBase
|
|
734
|
+
options <- newIORef =<< emptyMap
|
|
735
|
+
let streamable ctx = do opts <- readIORef options; ops <- optStrList opts "ops" ["list"]; op <- readIORef (cOp ctx); pure (opName op `elem` ops)
|
|
736
|
+
iterate_ result = do
|
|
737
|
+
opts <- readIORef options
|
|
738
|
+
chunkDelay <- optNum opts "chunkDelay" 0
|
|
739
|
+
chunkSize <- optInt opts "chunkSize" 0
|
|
740
|
+
resdata <- getp result "resdata"
|
|
741
|
+
items0 <- case resdata of VList _ -> listItems resdata; _ -> pure []
|
|
742
|
+
if chunkSize > 0
|
|
743
|
+
then do
|
|
744
|
+
let go [] = pure []
|
|
745
|
+
go xs = do { let { (h, t) = splitAt chunkSize xs }; when (chunkDelay > 0) (sleepOf opts chunkDelay); hl <- mkList h; rest <- go t; pure (hl : rest) }
|
|
746
|
+
go items0
|
|
747
|
+
else mapM (\item -> do when (chunkDelay > 0) (sleepOf opts chunkDelay); pure item) items0
|
|
748
|
+
hookFn name ctx = do
|
|
749
|
+
a <- readIORef active; s <- streamable ctx
|
|
750
|
+
when (name == "PreResult" && a && s) $ do
|
|
751
|
+
rv <- readIORef (cResult ctx)
|
|
752
|
+
case rv of
|
|
753
|
+
VMap _ -> do
|
|
754
|
+
setp rv "streaming" (VBool True)
|
|
755
|
+
let streamFn = VFunc (\_ _ _ _ -> do items0 <- iterate_ rv; mkList items0)
|
|
756
|
+
setp rv "stream" streamFn
|
|
757
|
+
cl <- cc ctx; bucket <- trackBucket cl "streaming" (jo [("opened", VNum 0)]); bumpNum bucket "opened" 1
|
|
758
|
+
_ -> pure ()
|
|
759
|
+
initFn _ opts = do om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a
|
|
760
|
+
pure Feature { fName = "streaming", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = hookFn }
|
|
761
|
+
|
|
762
|
+
-- ------------------------------------------------------------------
|
|
763
|
+
-- proxy
|
|
764
|
+
-- ------------------------------------------------------------------
|
|
765
|
+
|
|
766
|
+
proxyFeature :: IO Feature
|
|
767
|
+
proxyFeature = do
|
|
768
|
+
(active, fopts) <- featureBase
|
|
769
|
+
options <- newIORef =<< emptyMap
|
|
770
|
+
purl <- newIORef VNoval
|
|
771
|
+
noproxy <- newIORef ([] :: [String])
|
|
772
|
+
let track ctx = do cl <- cc ctx; pv <- readIORef purl; bucket <- trackBucket cl "proxy" (jo [("routed", VNum 0), ("url", pv)]); bumpNum bucket "routed" 1
|
|
773
|
+
bypass url = do np <- readIORef noproxy; if null np then pure False else do { let { host = urlHost url }; pure (any (\p -> p == "*" || host == p || endsWith host ("." ++ stripLeadDot p)) np) }
|
|
774
|
+
route ctx url fd = do
|
|
775
|
+
pv <- readIORef purl
|
|
776
|
+
byp <- bypass url
|
|
777
|
+
if isNullish pv || byp then pure fd
|
|
778
|
+
else do
|
|
779
|
+
fdC <- clone fd; out <- case fdC of VMap _ -> pure fdC; _ -> emptyMap
|
|
780
|
+
setp out "proxy" pv
|
|
781
|
+
proxies <- jo [("http", pv), ("https", pv)]; setp out "proxies" proxies
|
|
782
|
+
opts <- readIORef options; agent <- getp opts "agent"
|
|
783
|
+
case agent of { VFunc _ -> do { argsL <- ja [pv, VStr url]; made <- callVfn agent argsL; setp out "dispatcher" made; setp out "agent" made }; _ -> pure () }
|
|
784
|
+
track ctx; pure out
|
|
785
|
+
initFn ctx opts = do
|
|
786
|
+
om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a
|
|
787
|
+
when a $ do
|
|
788
|
+
pv <- getp om "url"; writeIORef purl pv
|
|
789
|
+
npV <- getp om "noProxy"
|
|
790
|
+
npList0 <- case npV of
|
|
791
|
+
VList _ -> do its <- listItems npV; pure [s | VStr s <- its]
|
|
792
|
+
VStr s -> pure (filter (/= "") (map strip (splitOnChar ',' s)))
|
|
793
|
+
_ -> pure []
|
|
794
|
+
npListRef <- newIORef npList0
|
|
795
|
+
fromEnv <- getp om "fromEnv"
|
|
796
|
+
when (isTrueV fromEnv) $ do
|
|
797
|
+
pcur <- readIORef purl
|
|
798
|
+
when (isNullish pcur) $ do
|
|
799
|
+
mv <- firstEnv ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"]
|
|
800
|
+
case mv of Just v -> writeIORef purl (VStr v); Nothing -> pure ()
|
|
801
|
+
npc <- readIORef npListRef
|
|
802
|
+
when (null npc) $ do
|
|
803
|
+
mv <- firstEnv ["NO_PROXY", "no_proxy"]
|
|
804
|
+
case mv of Just v -> writeIORef npListRef (filter (/= "") (map strip (splitOnChar ',' v))); Nothing -> pure ()
|
|
805
|
+
npFinal <- readIORef npListRef; writeIORef noproxy npFinal
|
|
806
|
+
u <- cu ctx; inner <- readIORef (uFetcher u); writeIORef (uFetcher u) (\c ur f -> do f2 <- route c ur f; inner c ur f2)
|
|
807
|
+
pure Feature { fName = "proxy", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
808
|
+
|
|
809
|
+
firstEnv :: [String] -> IO (Maybe String)
|
|
810
|
+
firstEnv [] = pure Nothing
|
|
811
|
+
firstEnv (k : ks) = do mv <- lookupEnv k; case mv of Just v | v /= "" -> pure (Just v); _ -> firstEnv ks
|
|
812
|
+
|
|
813
|
+
-- ------------------------------------------------------------------
|
|
814
|
+
-- netsim (feature)
|
|
815
|
+
-- ------------------------------------------------------------------
|
|
816
|
+
|
|
817
|
+
netsimFeature :: IO Feature
|
|
818
|
+
netsimFeature = do
|
|
819
|
+
(active, fopts) <- featureBase
|
|
820
|
+
options <- newIORef =<< emptyMap
|
|
821
|
+
calls <- newIORef (0 :: Int)
|
|
822
|
+
seedR <- newIORef (1 :: Int)
|
|
823
|
+
let randD = do { s <- readIORef seedR; let { s' = (s * 1103515245 + 12345) .&. 0x7fffffff }; writeIORef seedR s'; pure (fromIntegral s' / fromIntegral (0x7fffffff :: Int)) }
|
|
824
|
+
pickLatency = do
|
|
825
|
+
opts <- readIORef options; lat <- getp opts "latency"
|
|
826
|
+
case lat of
|
|
827
|
+
VNoval -> pure 0; VNull -> pure 0
|
|
828
|
+
VNum n -> pure (if n < 0 then 0 else n)
|
|
829
|
+
VMap _ -> do { mn <- optInt lat "min" 0; mxv <- getp lat "max"; let { mx = case mxv of { VNum k -> truncate k; _ -> mn } }; if mx <= mn then pure (fromIntegral mn) else do { r <- randD; pure (fromIntegral (mn + truncate (r * fromIntegral (mx - mn)))) } }
|
|
830
|
+
_ -> pure 0
|
|
831
|
+
track ctx applied = do
|
|
832
|
+
cl <- cc ctx
|
|
833
|
+
bucket <- trackBucket cl "netsim" (do ap <- emptyList; jo [("calls", VNum 0), ("applied", ap)])
|
|
834
|
+
bumpNum bucket "calls" 1; ap <- getp bucket "applied"; appendList ap applied
|
|
835
|
+
ctrl <- readIORef (cCtrl ctx); explain <- getp ctrl "explain"; case explain of VMap _ -> setp explain "netsim" bucket; _ -> pure ()
|
|
836
|
+
respond status dat extra = do
|
|
837
|
+
out <- jo [("status", vint status), ("statusText", VStr "OK"), ("json", jsonThunk dat), ("body", VStr "not-used")]
|
|
838
|
+
case extra of { VMap _ -> do { ks <- keysof extra; forM_ ks $ \k -> do { v <- getp extra k; setp out k v } }; _ -> pure () }
|
|
839
|
+
hv <- getp out "headers"; let headers = case hv of { VMap _ -> hv; _ -> VNoval }
|
|
840
|
+
headersM <- case headers of VMap _ -> pure headers; _ -> emptyMap
|
|
841
|
+
lowerM <- emptyMap; hks <- keysof headersM; forM_ hks $ \k -> do v <- getp headersM k; setp lowerM (lower k) v
|
|
842
|
+
setp out "headers" lowerM
|
|
843
|
+
pure (out, Nothing)
|
|
844
|
+
simulate ctx url fd inner = do
|
|
845
|
+
opts <- readIORef options
|
|
846
|
+
modifyIORef calls (+ 1); call <- readIORef calls
|
|
847
|
+
applied <- emptyMap
|
|
848
|
+
off <- getp opts "offline"
|
|
849
|
+
if isTrueV off
|
|
850
|
+
then do lat <- pickLatency; sleepOf opts lat; setp applied "offline" (VBool True); track ctx applied; e <- mkErr "netsim_offline" ("Simulated network offline (URL was: \"" ++ url ++ "\")"); pure (VNoval, Just e)
|
|
851
|
+
else do
|
|
852
|
+
errTimes <- optInt opts "errorTimes" 0
|
|
853
|
+
if call <= errTimes
|
|
854
|
+
then do lat <- pickLatency; sleepOf opts lat; setp applied "error" (VBool True); track ctx applied; e <- mkErr "netsim_conn" ("Simulated connection error (call " ++ show call ++ ")"); pure (VNoval, Just e)
|
|
855
|
+
else do
|
|
856
|
+
rlTimes <- optInt opts "rateLimitTimes" 0
|
|
857
|
+
if call <= rlTimes
|
|
858
|
+
then do
|
|
859
|
+
lat <- pickLatency; sleepOf opts lat; setp applied "rateLimited" (VBool True); track ctx applied
|
|
860
|
+
ra <- getp opts "retryAfter"; let raN = case ra of { VNum n -> truncate n :: Int; _ -> 0 }
|
|
861
|
+
hdrs <- jo [("retry-after", VStr (show raN))]; extra <- jo [("statusText", VStr "Too Many Requests"), ("headers", hdrs)]
|
|
862
|
+
respond 429 VNoval extra
|
|
863
|
+
else do
|
|
864
|
+
failStatusV <- getp opts "failStatus"; let failStatus = case failStatusV of { VNum n -> truncate n :: Int; _ -> 503 }
|
|
865
|
+
failEvery <- optInt opts "failEvery" 0
|
|
866
|
+
failRate <- optNum opts "failRate" 0
|
|
867
|
+
failTimes <- optInt opts "failTimes" 0
|
|
868
|
+
r <- randD
|
|
869
|
+
let failByCount = call <= failTimes
|
|
870
|
+
failByEvery = failEvery > 0 && call `mod` failEvery == 0
|
|
871
|
+
failByRate = failRate > 0 && r < failRate
|
|
872
|
+
if failByCount || failByEvery || failByRate
|
|
873
|
+
then do lat <- pickLatency; sleepOf opts lat; setp applied "failStatus" (vint failStatus); track ctx applied; extra <- jo [("statusText", VStr "Simulated Failure")]; respond failStatus VNoval extra
|
|
874
|
+
else do lat <- pickLatency; setp applied "latency" (VNum lat); track ctx applied; sleepOf opts lat; inner ctx url fd
|
|
875
|
+
initFn ctx opts = do
|
|
876
|
+
om <- toOptsMap opts; writeIORef options om; a <- optActive opts; writeIORef active a
|
|
877
|
+
sd <- getp om "seed"; writeIORef seedR (case sd of VNum n | truncate n /= (0 :: Int) -> truncate n; _ -> 1)
|
|
878
|
+
when a $ do u <- cu ctx; inner <- readIORef (uFetcher u); writeIORef (uFetcher u) (\c ur f -> simulate c ur f inner)
|
|
879
|
+
pure Feature { fName = "netsim", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
880
|
+
|
|
881
|
+
-- ------------------------------------------------------------------
|
|
882
|
+
-- test feature (in-memory mock transport + optional net simulation)
|
|
883
|
+
-- ------------------------------------------------------------------
|
|
884
|
+
|
|
885
|
+
testFeature :: IO Feature
|
|
886
|
+
testFeature = do
|
|
887
|
+
(active, fopts) <- featureBase
|
|
888
|
+
let respondM status dat extra = do
|
|
889
|
+
out <- jo [("status", vint status), ("statusText", VStr "OK"), ("json", jsonThunk dat), ("body", VStr "not-used")]
|
|
890
|
+
case extra of { Just e@(VMap _) -> do { ks <- keysof e; forM_ ks $ \k -> do { v <- getp e k; setp out k v } }; _ -> pure () }
|
|
891
|
+
pure (out, Nothing)
|
|
892
|
+
buildArgs fctx op args = do
|
|
893
|
+
let opname = opName op
|
|
894
|
+
ment <- readIORef (cEntity fctx); let entname = maybe "_" eName ment
|
|
895
|
+
cfg <- readIORef (cConfig fctx)
|
|
896
|
+
points <- getpathS cfg ("entity." ++ entname ++ ".op." ++ opname ++ ".points")
|
|
897
|
+
point <- getelem points (VNum (-1))
|
|
898
|
+
paramsPath <- getpathS point "args.params"
|
|
899
|
+
reqdTrue <- jo [("reqd", VBool True)]
|
|
900
|
+
reqdParams <- select paramsPath reqdTrue
|
|
901
|
+
eachSpec <- ja [VStr "`$EACH`", VStr "", VStr "`$KEY.name`"]
|
|
902
|
+
reqd <- transform INone reqdParams eachSpec
|
|
903
|
+
qandRef <- newIORef []
|
|
904
|
+
case args of
|
|
905
|
+
VMap _ -> do
|
|
906
|
+
ks <- keysof args
|
|
907
|
+
forM_ ks $ \key -> do
|
|
908
|
+
let isId = key == "id"
|
|
909
|
+
sel <- select reqd (VStr key); emptySel <- isempty sel; let isReqd = not emptySel
|
|
910
|
+
when (isId || isReqd) $ do
|
|
911
|
+
u <- cu fctx; pfn <- readIORef (uParam u); v <- pfn fctx (VStr key)
|
|
912
|
+
kaV <- case opAlias op of VMap _ -> getp (opAlias op) key; _ -> pure VNoval
|
|
913
|
+
orItem1 <- jo [(key, v)]
|
|
914
|
+
orList <- case kaV of { VStr s -> do { o2 <- jo [(s, v)]; ja [orItem1, o2] }; _ -> ja [orItem1] }
|
|
915
|
+
orMap <- jo [("`$OR`", orList)]
|
|
916
|
+
modifyIORef qandRef (++ [orMap])
|
|
917
|
+
_ -> pure ()
|
|
918
|
+
qand <- readIORef qandRef; qandL <- ja qand
|
|
919
|
+
q <- jo [("`$AND`", qandL)]
|
|
920
|
+
ctrl <- readIORef (cCtrl fctx); explain <- getp ctrl "explain"
|
|
921
|
+
case explain of { VMap _ -> do { tq <- jo [("query", q)]; setp explain "test" tq }; _ -> pure () }
|
|
922
|
+
pure q
|
|
923
|
+
resolveMatch fctx explicit = do
|
|
924
|
+
sz <- case explicit of VMap _ -> size explicit; _ -> pure 0
|
|
925
|
+
let isMapNonEmpty = case explicit of { VMap _ -> sz > 0; _ -> False }
|
|
926
|
+
if isMapNonEmpty then pure explicit
|
|
927
|
+
else do
|
|
928
|
+
mv <- readIORef (cMatch fctx); r1 <- trySrc mv
|
|
929
|
+
case r1 of
|
|
930
|
+
Just v -> jo [("id", v)]
|
|
931
|
+
Nothing -> do dv <- readIORef (cData fctx); r2 <- trySrc dv; case r2 of Just v -> jo [("id", v)]; Nothing -> emptyMap
|
|
932
|
+
trySrc src = case src of
|
|
933
|
+
VMap _ -> do i <- getp src "id"; pure (case i of VNoval -> Nothing; VStr "__UNDEFINED__" -> Nothing; v -> Just v)
|
|
934
|
+
_ -> pure Nothing
|
|
935
|
+
makeMock entity = \fctx _url _fd -> do
|
|
936
|
+
op <- readIORef (cOp fctx)
|
|
937
|
+
entmapV <- getp entity (opEntity op); entmap <- case entmapV of VMap _ -> pure entmapV; _ -> emptyMap
|
|
938
|
+
case opName op of
|
|
939
|
+
"load" -> do
|
|
940
|
+
rm <- readIORef (cReqmatch fctx); m <- resolveMatch fctx rm
|
|
941
|
+
args <- buildArgs fctx op m; found <- select entmap args; ent <- getelem found (VNum 0)
|
|
942
|
+
if isNullish ent then respondM 404 VNoval . Just =<< jo [("statusText", VStr "Not found")]
|
|
943
|
+
else do delp ent "$KEY"; c <- clone ent; respondM 200 c Nothing
|
|
944
|
+
"list" -> do
|
|
945
|
+
rm <- readIORef (cReqmatch fctx)
|
|
946
|
+
args <- buildArgs fctx op rm; found <- select entmap args
|
|
947
|
+
if isNullish found then respondM 404 VNoval . Just =<< jo [("statusText", VStr "Not found")]
|
|
948
|
+
else do { case found of { VList _ -> do { its <- listItems found; forM_ its (\i -> delp i "$KEY") }; _ -> pure () }; c <- clone found; respondM 200 c Nothing }
|
|
949
|
+
"update" -> do
|
|
950
|
+
rd <- readIORef (cReqdata fctx)
|
|
951
|
+
um0 <- emptyMap
|
|
952
|
+
case rd of VMap _ -> do { i <- getp rd "id"; case i of VNoval -> pure (); v -> setp um0 "id" v }; _ -> pure ()
|
|
953
|
+
umSz <- size um0
|
|
954
|
+
um <- if umSz > 0 then pure um0 else do em <- emptyMap; resolveMatch fctx em
|
|
955
|
+
args <- buildArgs fctx op um; found <- select entmap args; ent0 <- getelem found (VNum 0)
|
|
956
|
+
ent <- if isNullish ent0 then entFallback entmap else pure ent0
|
|
957
|
+
if isNullish ent then respondM 404 VNoval . Just =<< jo [("statusText", VStr "Not found")]
|
|
958
|
+
else do
|
|
959
|
+
case ent of { VMap _ -> case rd of { VMap _ -> do { ks <- keysof rd; forM_ ks (\k -> do { v <- getp rd k; setp ent k v }) }; _ -> pure () }; _ -> pure () }
|
|
960
|
+
delp ent "$KEY"; c <- clone ent; respondM 200 c Nothing
|
|
961
|
+
"remove" -> do
|
|
962
|
+
rm <- readIORef (cReqmatch fctx); m <- resolveMatch fctx rm
|
|
963
|
+
args <- buildArgs fctx op m; found <- select entmap args; ent <- getelem found (VNum 0)
|
|
964
|
+
case ent of VMap _ -> do { eid <- getp ent "id"; () <$ delprop entmap eid }; _ -> pure ()
|
|
965
|
+
respondM 200 VNoval Nothing
|
|
966
|
+
"create" -> do
|
|
967
|
+
rd <- readIORef (cReqdata fctx)
|
|
968
|
+
_ <- buildArgs fctx op rd
|
|
969
|
+
u <- cu fctx; pfn <- readIORef (uParam u); eidV <- pfn fctx (VStr "id")
|
|
970
|
+
eid <- if isNullish eidV then VStr <$> randId16 else pure eidV
|
|
971
|
+
ent <- clone rd
|
|
972
|
+
case ent of
|
|
973
|
+
VMap _ -> do { setp ent "id" eid; case eid of { VStr s -> setp entmap s ent; _ -> pure () }; delp ent "$KEY"; c <- clone ent; respondM 200 c Nothing }
|
|
974
|
+
_ -> respondM 200 ent Nothing
|
|
975
|
+
_ -> respondM 404 VNoval . Just =<< jo [("statusText", VStr "Unknown operation")]
|
|
976
|
+
makeNetsim net inner = do
|
|
977
|
+
netcalls <- newIORef (0 :: Int)
|
|
978
|
+
let pickLat = do
|
|
979
|
+
lat <- getp net "latency"
|
|
980
|
+
case lat of
|
|
981
|
+
VNoval -> pure 0; VNull -> pure 0
|
|
982
|
+
VNum n -> pure (if n < 0 then 0 else n)
|
|
983
|
+
VMap _ -> do { mn <- optInt lat "min" 0; mxv <- getp lat "max"; let { mx = case mxv of { VNum k -> truncate k; _ -> mn } }; pure (if mx <= mn then fromIntegral mn else fromIntegral (mn + ((mx - mn) `div` 2))) }
|
|
984
|
+
_ -> pure 0
|
|
985
|
+
sleepN ms = when (ms > 0) $ do s <- getp net "sleep"; case s of VFunc _ -> () <$ callVfn s (VNum ms); _ -> realSleep ms
|
|
986
|
+
pure $ \fctx url fd -> do
|
|
987
|
+
modifyIORef netcalls (+ 1); call <- readIORef netcalls
|
|
988
|
+
off <- getp net "offline"
|
|
989
|
+
if isTrueV off then do lat <- pickLat; sleepN lat; e <- mkErr "netsim_offline" ("Simulated network offline (URL was: \"" ++ url ++ "\")"); pure (VNoval, Just e)
|
|
990
|
+
else do
|
|
991
|
+
errTimes <- optInt net "errorTimes" 0
|
|
992
|
+
if call <= errTimes then do lat <- pickLat; sleepN lat; e <- mkErr "netsim_conn" ("Simulated connection error (call " ++ show call ++ ")"); pure (VNoval, Just e)
|
|
993
|
+
else do
|
|
994
|
+
failTimes <- optInt net "failTimes" 0
|
|
995
|
+
if call <= failTimes then do lat <- pickLat; sleepN lat; failStatusV <- getp net "failStatus"; let { fs = case failStatusV of { VNum n -> truncate n :: Int; _ -> 503 } }; hdrs <- emptyMap; out <- jo [("status", vint fs), ("statusText", VStr "Simulated Failure"), ("body", VStr "not-used"), ("json", jsonThunk VNoval), ("headers", hdrs)]; pure (out, Nothing)
|
|
996
|
+
else do lat <- pickLat; sleepN lat; inner fctx url fd
|
|
997
|
+
initFn ctx opts = do
|
|
998
|
+
entityV <- getp opts "entity"; entity <- case entityV of VMap _ -> pure entityV; _ -> emptyMap
|
|
999
|
+
cl <- cc ctx; writeIORef (clMode cl) "test"
|
|
1000
|
+
let walkFn key v _parent path = do d <- size path; when (d == 2 && ismap v && not (isNullish key)) (setp v "id" key); pure v
|
|
1001
|
+
_ <- walk (Just walkFn) Nothing VNoval entity
|
|
1002
|
+
let mock = makeMock entity
|
|
1003
|
+
u <- cu ctx
|
|
1004
|
+
net <- getp opts "net"
|
|
1005
|
+
case net of VMap _ -> do { ns <- makeNetsim net mock; writeIORef (uFetcher u) ns }; _ -> writeIORef (uFetcher u) mock
|
|
1006
|
+
pure Feature { fName = "test", fVersion = "0.0.1", fActive = active, fOptions = fopts, fInit = initFn, fHook = \_ _ -> pure () }
|
|
1007
|
+
|
|
1008
|
+
entFallback :: Value -> IO Value
|
|
1009
|
+
entFallback entmap = do ks <- keysof entmap; go ks
|
|
1010
|
+
where go [] = pure VNoval
|
|
1011
|
+
go (k : rest) = do v <- getp entmap k; case v of VMap _ -> pure v; _ -> go rest
|
|
1012
|
+
|
|
1013
|
+
-- ------------------------------------------------------------------
|
|
1014
|
+
-- client construction + direct + prepare + test
|
|
1015
|
+
-- ------------------------------------------------------------------
|
|
1016
|
+
|
|
1017
|
+
makeClientBase :: Value -> (String -> IO Feature) -> Value -> IO Client
|
|
1018
|
+
makeClientBase config makeFeature options = do
|
|
1019
|
+
utility <- newUtility
|
|
1020
|
+
modeR <- newIORef "live"; featsR <- newIORef []; optsR <- newIORef VNoval; rootR <- newIORef Nothing; trackR <- newIORef =<< emptyMap
|
|
1021
|
+
let client = Client { clMode = modeR, clFeatures = featsR, clOptions = optsR, clUtility = utility, clRootctx = rootR, clTrack = trackR, clConfig = config, clMakeFeature = makeFeature }
|
|
1022
|
+
rootopts <- case options of VNoval -> emptyMap; _ -> pure options
|
|
1023
|
+
sh <- emptyMap
|
|
1024
|
+
rootctx <- makeContextImpl (defaultCtxSpec { csClient = Just client, csUtility = Just utility, csConfig = Just config, csOptions = Just rootopts, csShared = Just sh }) Nothing
|
|
1025
|
+
writeIORef rootR (Just rootctx)
|
|
1026
|
+
opts <- makeOptionsUtil rootctx
|
|
1027
|
+
writeIORef optsR opts
|
|
1028
|
+
ta <- getpathS opts "feature.test.active"
|
|
1029
|
+
when (isTrueV ta) (writeIORef modeR "test")
|
|
1030
|
+
writeIORef (cOptions rootctx) opts
|
|
1031
|
+
-- Add features in the resolved order (makeOptions records an explicit array
|
|
1032
|
+
-- order, else defaults to test-first). Ordering matters: the `test` feature
|
|
1033
|
+
-- installs the base mock transport and the transport features
|
|
1034
|
+
-- (retry/cache/netsim/proxy/ratelimit) wrap whatever is current, so `test`
|
|
1035
|
+
-- must be added before them to sit at the base of the wrapper chain.
|
|
1036
|
+
featureOpts <- do fmV <- toMap <$> getp opts "feature"; case fmV of VMap _ -> pure fmV; _ -> emptyMap
|
|
1037
|
+
orderV <- getpathS opts "__derived__.featureorder"
|
|
1038
|
+
order <- case orderV of VList ref -> readIORef ref; _ -> pure []
|
|
1039
|
+
forM_ order $ \fnameV -> case fnameV of
|
|
1040
|
+
VStr fname -> do
|
|
1041
|
+
foptsV <- toMap <$> getp featureOpts fname
|
|
1042
|
+
case foptsV of
|
|
1043
|
+
VMap _ -> do a <- getp foptsV "active"; when (isTrueV a) $ do ftr <- makeFeature fname; featureAddUtil rootctx ftr
|
|
1044
|
+
_ -> pure ()
|
|
1045
|
+
_ -> pure ()
|
|
1046
|
+
feats <- readIORef featsR
|
|
1047
|
+
forM_ feats (featureInitUtil rootctx)
|
|
1048
|
+
featureHookUtil rootctx "PostConstruct"
|
|
1049
|
+
pure client
|
|
1050
|
+
|
|
1051
|
+
prepare :: Client -> Value -> IO Value
|
|
1052
|
+
prepare client fetchargs = do
|
|
1053
|
+
let u = clUtility client
|
|
1054
|
+
fa <- case fetchargs of VNoval -> emptyMap; _ -> pure fetchargs
|
|
1055
|
+
ctrlV <- toMap <$> getp fa "ctrl"
|
|
1056
|
+
ctrl <- case ctrlV of VMap _ -> pure ctrlV; _ -> emptyMap
|
|
1057
|
+
root <- readIORef (clRootctx client)
|
|
1058
|
+
ctx <- makeContextImpl (defaultCtxSpec { csOpname = Just "prepare", csCtrl = Just ctrl }) root
|
|
1059
|
+
options <- readIORef (clOptions client)
|
|
1060
|
+
path <- getStrD fa "path" ""
|
|
1061
|
+
method <- getStrD fa "method" "GET"
|
|
1062
|
+
paramsV <- toMap <$> getp fa "params"; params <- case paramsV of VMap _ -> pure paramsV; _ -> emptyMap
|
|
1063
|
+
queryV <- toMap <$> getp fa "query"; query <- case queryV of VMap _ -> pure queryV; _ -> emptyMap
|
|
1064
|
+
headers <- prepareHeadersUtil ctx
|
|
1065
|
+
base <- getStrD options "base" ""; prefix <- getStrD options "prefix" ""; suffix <- getStrD options "suffix" ""
|
|
1066
|
+
body <- getp fa "body"
|
|
1067
|
+
specm <- jo [("base", VStr base), ("prefix", VStr prefix), ("suffix", VStr suffix), ("path", VStr path), ("method", VStr method), ("params", params), ("query", query), ("headers", headers), ("body", body), ("step", VStr "start")]
|
|
1068
|
+
sp <- newSpec specm
|
|
1069
|
+
writeIORef (cSpec ctx) sp
|
|
1070
|
+
uh <- getp fa "headers"
|
|
1071
|
+
case uh of VMap _ -> do { spH <- getp sp "headers"; ks <- keysof uh; forM_ ks (\k -> do { v <- getp uh k; setp spH k v }) }; _ -> pure ()
|
|
1072
|
+
(_, merr) <- prepareAuthUtil ctx
|
|
1073
|
+
case merr of Just e -> throwIO (SdkException e); Nothing -> pure ()
|
|
1074
|
+
(fd, merr2) <- makeFetchDefUtil ctx
|
|
1075
|
+
case merr2 of Just e -> throwIO (SdkException e); Nothing -> pure fd
|
|
1076
|
+
|
|
1077
|
+
direct :: Client -> Value -> IO Value
|
|
1078
|
+
direct client fetchargs = do
|
|
1079
|
+
let u = clUtility client
|
|
1080
|
+
fa <- case fetchargs of VNoval -> emptyMap; _ -> pure fetchargs
|
|
1081
|
+
res <- try (prepare client fa) :: IO (Either SdkException Value)
|
|
1082
|
+
case res of
|
|
1083
|
+
Left (SdkException e) -> do ev <- errToValue e; jo [("ok", VBool False), ("err", ev)]
|
|
1084
|
+
Right fetchdef -> do
|
|
1085
|
+
ctrlV <- toMap <$> getp fa "ctrl"; ctrl <- case ctrlV of VMap _ -> pure ctrlV; _ -> emptyMap
|
|
1086
|
+
root <- readIORef (clRootctx client)
|
|
1087
|
+
ctx <- makeContextImpl (defaultCtxSpec { csOpname = Just "direct", csCtrl = Just ctrl }) root
|
|
1088
|
+
url <- getStrD fetchdef "url" ""
|
|
1089
|
+
fetcher <- readIORef (uFetcher u)
|
|
1090
|
+
(fetched, ferr) <- fetcher ctx url fetchdef
|
|
1091
|
+
case ferr of
|
|
1092
|
+
Just fe -> do ev <- errToValue fe; jo [("ok", VBool False), ("err", ev)]
|
|
1093
|
+
Nothing ->
|
|
1094
|
+
if isNoval fetched || isNullV fetched
|
|
1095
|
+
then do e <- mkErr "direct_no_response" "response: undefined"; ev <- errToValue e; jo [("ok", VBool False), ("err", ev)]
|
|
1096
|
+
else case fetched of
|
|
1097
|
+
VMap _ -> do
|
|
1098
|
+
st <- getp fetched "status"; let status = toInt st
|
|
1099
|
+
headersV <- getp fetched "headers"; headers <- case headersV of VMap _ -> pure headersV; _ -> emptyMap
|
|
1100
|
+
clv <- getp headers "content-length"; let cl = case clv of { VStr s -> s; VNum n -> show (truncate n :: Int); _ -> "" }
|
|
1101
|
+
let noBody = status == 204 || status == 304 || cl == "0"
|
|
1102
|
+
jsonData <- if noBody then pure VNoval else do jf <- getp fetched "json"; case jf of VFunc _ -> callJson jf; _ -> pure VNoval
|
|
1103
|
+
jo [("ok", VBool (status >= 200 && status < 300)), ("status", vint status), ("headers", headers), ("data", jsonData)]
|
|
1104
|
+
_ -> do e <- mkErr "direct_invalid" "invalid response type"; ev <- errToValue e; jo [("ok", VBool False), ("err", ev)]
|
|
1105
|
+
|
|
1106
|
+
sdkTest :: Value -> (String -> IO Feature) -> Value -> Value -> IO Client
|
|
1107
|
+
sdkTest config makeFeature testopts sdkopts = do
|
|
1108
|
+
so0 <- case sdkopts of VNoval -> emptyMap; _ -> pure sdkopts
|
|
1109
|
+
soC <- clone so0; sdkopts' <- case soC of VMap _ -> pure soC; _ -> emptyMap
|
|
1110
|
+
to0 <- case testopts of VNoval -> emptyMap; _ -> pure testopts
|
|
1111
|
+
toC <- clone to0; testopts' <- case toC of VMap _ -> pure toC; _ -> emptyMap
|
|
1112
|
+
setp testopts' "active" (VBool True)
|
|
1113
|
+
p <- ja [VStr "feature", VStr "test"]
|
|
1114
|
+
_ <- setpath sdkopts' p testopts'
|
|
1115
|
+
sdk <- makeClientBase config makeFeature sdkopts'
|
|
1116
|
+
writeIORef (clMode sdk) "test"
|
|
1117
|
+
pure sdk
|
|
1118
|
+
|
|
1119
|
+
-- ------------------------------------------------------------------
|
|
1120
|
+
-- generic entity (config-driven)
|
|
1121
|
+
-- ------------------------------------------------------------------
|
|
1122
|
+
|
|
1123
|
+
runOpPipeline :: Context -> IO () -> IO Value
|
|
1124
|
+
runOpPipeline ctx postDone = do
|
|
1125
|
+
let fh n = featureHookUtil ctx n
|
|
1126
|
+
setOut k v = do out <- readIORef (cOut ctx); setp out k v
|
|
1127
|
+
fh "PrePoint"
|
|
1128
|
+
(point, e1) <- makePointUtil ctx
|
|
1129
|
+
case e1 of
|
|
1130
|
+
Just e -> makeErrorUtil ctx (Just e)
|
|
1131
|
+
Nothing -> do
|
|
1132
|
+
setOut "point" point
|
|
1133
|
+
fh "PreSpec"
|
|
1134
|
+
(spec, e2) <- makeSpecUtil ctx
|
|
1135
|
+
case e2 of
|
|
1136
|
+
Just e -> makeErrorUtil ctx (Just e)
|
|
1137
|
+
Nothing -> do
|
|
1138
|
+
setOut "spec" spec
|
|
1139
|
+
fh "PreRequest"
|
|
1140
|
+
(resp, e3) <- makeRequestUtil ctx
|
|
1141
|
+
case e3 of
|
|
1142
|
+
Just e -> makeErrorUtil ctx (Just e)
|
|
1143
|
+
Nothing -> do
|
|
1144
|
+
setOut "request" resp
|
|
1145
|
+
fh "PreResponse"
|
|
1146
|
+
(resp2, e4) <- makeResponseUtil ctx
|
|
1147
|
+
case e4 of
|
|
1148
|
+
Just e -> makeErrorUtil ctx (Just e)
|
|
1149
|
+
Nothing -> do
|
|
1150
|
+
setOut "response" resp2
|
|
1151
|
+
fh "PreResult"
|
|
1152
|
+
(result, e5) <- makeResultUtil ctx
|
|
1153
|
+
case e5 of
|
|
1154
|
+
Just e -> makeErrorUtil ctx (Just e)
|
|
1155
|
+
Nothing -> do
|
|
1156
|
+
setOut "result" result
|
|
1157
|
+
fh "PreDone"
|
|
1158
|
+
postDone
|
|
1159
|
+
doneUtil ctx
|
|
1160
|
+
|
|
1161
|
+
-- Truncate a materialised stream when the signal fn returns true (checked
|
|
1162
|
+
-- before each element, mirroring an async iterator's per-yield cancellation).
|
|
1163
|
+
streamTakeUntil :: Value -> [Value] -> IO [Value]
|
|
1164
|
+
streamTakeUntil _ [] = pure []
|
|
1165
|
+
streamTakeUntil sig (x : xs) = do
|
|
1166
|
+
r <- callVfn sig VNoval
|
|
1167
|
+
if isTrueV r then pure [] else do rest <- streamTakeUntil sig xs; pure (x : rest)
|
|
1168
|
+
|
|
1169
|
+
makeEntity :: Client -> String -> Value -> IO Entity
|
|
1170
|
+
makeEntity client name entopts = do
|
|
1171
|
+
entopts' <- case entopts of VMap _ -> pure entopts; _ -> emptyMap
|
|
1172
|
+
a <- getBool entopts' "active"
|
|
1173
|
+
case a of Just False -> pure (); _ -> setp entopts' "active" (VBool True)
|
|
1174
|
+
utility <- copyUtility (clUtility client)
|
|
1175
|
+
dataR <- newIORef =<< emptyMap
|
|
1176
|
+
matchR <- newIORef =<< emptyMap
|
|
1177
|
+
entctxR <- newIORef Nothing
|
|
1178
|
+
let entCtx = do m <- readIORef entctxR; case m of Just c -> pure c; Nothing -> error "entity context not initialised"
|
|
1179
|
+
setDataFrom rv = do
|
|
1180
|
+
resdata <- getp rv "resdata"
|
|
1181
|
+
when (not (isNoval resdata) && not (isNullV resdata)) $ do { c <- clone resdata; m <- case toMap c of { VMap _ -> pure c; _ -> emptyMap }; writeIORef dataR m }
|
|
1182
|
+
setMatchFrom rv = do resmatch <- getp rv "resmatch"; case resmatch of VMap _ -> writeIORef matchR resmatch; _ -> pure ()
|
|
1183
|
+
mkOp opname inputKind reqval ctrl postDone = do
|
|
1184
|
+
ec <- entCtx
|
|
1185
|
+
mv <- readIORef matchR; dv <- readIORef dataR
|
|
1186
|
+
mC <- clone mv; dC <- clone dv
|
|
1187
|
+
ctrlM <- case toMap ctrl of VMap _ -> pure ctrl; _ -> emptyMap
|
|
1188
|
+
let base = defaultCtxSpec { csOpname = Just opname, csCtrl = Just ctrlM, csMatch = Just mC, csData = Just dC }
|
|
1189
|
+
cspec = if inputKind == "data" then base { csReqdata = Just reqval } else base { csReqmatch = Just reqval }
|
|
1190
|
+
ctx <- makeContextImpl cspec (Just ec)
|
|
1191
|
+
runOpPipeline ctx (postDone ctx)
|
|
1192
|
+
postLoad ctx = do rv <- readIORef (cResult ctx); case rv of VMap _ -> do { setMatchFrom rv; setDataFrom rv }; _ -> pure ()
|
|
1193
|
+
postList ctx = do rv <- readIORef (cResult ctx); case rv of VMap _ -> setMatchFrom rv; _ -> pure ()
|
|
1194
|
+
postCreate ctx = do rv <- readIORef (cResult ctx); case rv of VMap _ -> setDataFrom rv; _ -> pure ()
|
|
1195
|
+
postUpdate = postLoad
|
|
1196
|
+
postRemove = postLoad
|
|
1197
|
+
let ent = Entity
|
|
1198
|
+
{ eName = name, eClient = client, eUtility = utility, eEntopts = entopts'
|
|
1199
|
+
, eData = dataR, eMatch = matchR, eEntctx = entctxR
|
|
1200
|
+
, eMake = do o <- clone entopts'; makeEntity client name o
|
|
1201
|
+
, eDataSet = \d -> writeIORef dataR d
|
|
1202
|
+
, eDataGet = readIORef dataR
|
|
1203
|
+
, eLoad = \rm ctrl -> mkOp "load" "match" rm ctrl postLoad
|
|
1204
|
+
, eList = \rm ctrl -> mkOp "list" "match" rm ctrl postList
|
|
1205
|
+
, eCreate = \rd ctrl -> mkOp "create" "data" rd ctrl postCreate
|
|
1206
|
+
, eUpdate = \rd ctrl -> mkOp "update" "data" rd ctrl postUpdate
|
|
1207
|
+
, eRemove = \rm ctrl -> mkOp "remove" "match" rm ctrl postRemove
|
|
1208
|
+
-- Streaming operation. Runs `action` through the full pipeline and
|
|
1209
|
+
-- returns a lazy list of result items, so the streaming feature's
|
|
1210
|
+
-- incremental output is reachable (a normal op call materialises the
|
|
1211
|
+
-- whole result). When the streaming feature is active the result
|
|
1212
|
+
-- carries a stream closure and this yields from it (honouring
|
|
1213
|
+
-- chunkSize); otherwise it falls back to the materialised items, so
|
|
1214
|
+
-- stream always yields. callopts: ctrl (per-call pipeline control),
|
|
1215
|
+
-- body (an enumerable/list payload attached to the request for
|
|
1216
|
+
-- outbound streaming), signal (a 0-arity fn -> Bool; stop when true).
|
|
1217
|
+
, eStream = \action args callopts -> do
|
|
1218
|
+
ec <- entCtx
|
|
1219
|
+
coV <- case toMap callopts of VMap _ -> pure callopts; _ -> emptyMap
|
|
1220
|
+
ctrlV <- getp coV "ctrl"
|
|
1221
|
+
ctrl <- case toMap ctrlV of VMap _ -> pure ctrlV; _ -> emptyMap
|
|
1222
|
+
setp ctrl "stream" coV
|
|
1223
|
+
mv <- readIORef matchR; dv <- readIORef dataR
|
|
1224
|
+
mC <- clone mv; dC <- clone dv
|
|
1225
|
+
reqmatch <- case toMap args of VMap _ -> pure args; _ -> emptyMap
|
|
1226
|
+
let cspec = defaultCtxSpec { csOpname = Just action, csCtrl = Just ctrl, csMatch = Just mC, csData = Just dC, csReqmatch = Just reqmatch }
|
|
1227
|
+
ctx <- makeContextImpl cspec (Just ec)
|
|
1228
|
+
body <- getp coV "body"
|
|
1229
|
+
when (not (isNoval body) && not (isNullV body)) $ do
|
|
1230
|
+
rdV <- readIORef (cReqdata ctx)
|
|
1231
|
+
rd <- case rdV of VMap _ -> pure rdV; _ -> emptyMap
|
|
1232
|
+
setp rd "body$" body
|
|
1233
|
+
writeIORef (cReqdata ctx) rd
|
|
1234
|
+
_ <- runOpPipeline ctx (pure ())
|
|
1235
|
+
rv <- readIORef (cResult ctx)
|
|
1236
|
+
raw <- case rv of
|
|
1237
|
+
VMap _ -> do
|
|
1238
|
+
sf <- getp rv "stream"
|
|
1239
|
+
case sf of
|
|
1240
|
+
VFunc _ -> do r <- callVfn sf VNoval; case r of VList _ -> listItems r; _ -> pure []
|
|
1241
|
+
_ -> do resdata <- getp rv "resdata"; case resdata of VList _ -> listItems resdata; VNoval -> pure []; v -> pure [v]
|
|
1242
|
+
_ -> pure []
|
|
1243
|
+
sig <- getp coV "signal"
|
|
1244
|
+
case sig of
|
|
1245
|
+
VFunc _ -> streamTakeUntil sig raw
|
|
1246
|
+
_ -> pure raw
|
|
1247
|
+
}
|
|
1248
|
+
root <- readIORef (clRootctx client)
|
|
1249
|
+
entctx <- makeContextImpl (defaultCtxSpec { csEntity = Just ent, csEntopts = Just entopts' }) root
|
|
1250
|
+
featureHookUtil entctx "PostConstructEntity"
|
|
1251
|
+
writeIORef entctxR (Just entctx)
|
|
1252
|
+
pure ent
|
|
1253
|
+
|
|
1254
|
+
-- public entity data/match accessors (fire hooks)
|
|
1255
|
+
entityData :: Entity -> Maybe Value -> IO Value
|
|
1256
|
+
entityData ent margs = do
|
|
1257
|
+
case margs of
|
|
1258
|
+
Just arg | not (isNoval arg) && not (isNullV arg) -> do
|
|
1259
|
+
c <- clone arg; m <- case toMap c of { VMap _ -> pure c; _ -> emptyMap }
|
|
1260
|
+
writeIORef (eData ent) m
|
|
1261
|
+
ec <- entCtxOf ent; featureHookUtil ec "SetData"
|
|
1262
|
+
_ -> pure ()
|
|
1263
|
+
ec <- entCtxOf ent; featureHookUtil ec "GetData"
|
|
1264
|
+
d <- readIORef (eData ent); clone d
|
|
1265
|
+
|
|
1266
|
+
entityMatch :: Entity -> Maybe Value -> IO Value
|
|
1267
|
+
entityMatch ent margs = do
|
|
1268
|
+
case margs of
|
|
1269
|
+
Just arg | not (isNoval arg) && not (isNullV arg) -> do
|
|
1270
|
+
c <- clone arg; m <- case toMap c of { VMap _ -> pure c; _ -> emptyMap }
|
|
1271
|
+
writeIORef (eMatch ent) m
|
|
1272
|
+
ec <- entCtxOf ent; featureHookUtil ec "SetMatch"
|
|
1273
|
+
_ -> pure ()
|
|
1274
|
+
ec <- entCtxOf ent; featureHookUtil ec "GetMatch"
|
|
1275
|
+
m <- readIORef (eMatch ent); clone m
|
|
1276
|
+
|
|
1277
|
+
entCtxOf :: Entity -> IO Context
|
|
1278
|
+
entCtxOf ent = do m <- readIORef (eEntctx ent); case m of Just c -> pure c; Nothing -> error "entity context not initialised"
|