@voxgig/sdkgen 1.3.8 → 1.3.10
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 +62 -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 +55 -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 +53 -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 +48 -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 +50 -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/TestEntity_ts.ts +8 -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,1833 @@
|
|
|
1
|
+
// Copyright (c) 2025-2026 Voxgig Ltd. MIT LICENSE.
|
|
2
|
+
//
|
|
3
|
+
// Voxgig Struct — Scala port.
|
|
4
|
+
//
|
|
5
|
+
// A faithful port of the canonical TypeScript implementation
|
|
6
|
+
// (typescript/src/StructUtility.ts). Like TypeScript (and the Rust / OCaml
|
|
7
|
+
// ports), Scala keeps `undefined` (Noval) and JSON `null` (VNull) distinct, so
|
|
8
|
+
// this port mirrors the canonical TS logic directly. Nodes are mutable and
|
|
9
|
+
// reference-stable: lists are `ArrayBuffer[Value]`, maps are an insertion-
|
|
10
|
+
// ordered `LinkedHashMap[String, Value]`. The only regex used is the JVM
|
|
11
|
+
// standard `java.util.regex`; there are no third-party runtime dependencies.
|
|
12
|
+
|
|
13
|
+
package voxgig
|
|
14
|
+
|
|
15
|
+
import scala.collection.mutable.{ArrayBuffer, LinkedHashMap}
|
|
16
|
+
|
|
17
|
+
object struct {
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Value model
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
sealed trait Value
|
|
24
|
+
case object Noval extends Value // TS undefined — absent
|
|
25
|
+
case object VNull extends Value // JSON null
|
|
26
|
+
final case class VBool(b: Boolean) extends Value
|
|
27
|
+
final case class VNum(n: Double) extends Value
|
|
28
|
+
final case class VStr(s: String) extends Value
|
|
29
|
+
final case class VList(buf: ArrayBuffer[Value]) extends Value
|
|
30
|
+
final case class VMap(map: LinkedHashMap[String, Value]) extends Value
|
|
31
|
+
final case class VFunc(f: Injector) extends Value
|
|
32
|
+
final case class VSentinel(tag: String) extends Value
|
|
33
|
+
|
|
34
|
+
type Injector = (Inj, Value, String, Value) => Value
|
|
35
|
+
type Modify = (Value, Value, Value, Inj) => Unit
|
|
36
|
+
type WalkFn = (Value, Value, Value, Value) => Value
|
|
37
|
+
|
|
38
|
+
final class Inj {
|
|
39
|
+
var mode: Int = M_VAL
|
|
40
|
+
var full: Boolean = false
|
|
41
|
+
var keyi: Int = 0
|
|
42
|
+
var keys: Value = mkList(Seq(VStr(S_DTOP)))
|
|
43
|
+
var key: Value = VStr(S_DTOP)
|
|
44
|
+
var ival: Value = Noval
|
|
45
|
+
var parent: Value = Noval
|
|
46
|
+
var path: Value = mkList(Seq(VStr(S_DTOP)))
|
|
47
|
+
var nodes: Value = mkList(Seq())
|
|
48
|
+
var handler: Injector = injectHandler
|
|
49
|
+
var errs: Value = mkList(Seq())
|
|
50
|
+
var meta: Value = emptyMap()
|
|
51
|
+
var dparent: Value = Noval
|
|
52
|
+
var dpath: Value = mkList(Seq(VStr(S_DTOP)))
|
|
53
|
+
var base: Value = VStr(S_DTOP)
|
|
54
|
+
var modify: Option[Modify] = None
|
|
55
|
+
var prior: Option[Inj] = None
|
|
56
|
+
var extra: Value = Noval
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
final class InjDef {
|
|
60
|
+
var dMeta: Value = Noval
|
|
61
|
+
var dExtra: Value = Noval
|
|
62
|
+
var dErrs: Value = Noval
|
|
63
|
+
var dModify: Option[Modify] = None
|
|
64
|
+
var dHandler: Option[Injector] = None
|
|
65
|
+
var dBase: Value = Noval
|
|
66
|
+
var dParent: Value = Noval
|
|
67
|
+
var dPath: Value = Noval
|
|
68
|
+
var dKey: Value = Noval
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
sealed trait InjArg
|
|
72
|
+
case object INone extends InjArg
|
|
73
|
+
final case class IInj(inj: Inj) extends InjArg
|
|
74
|
+
final case class IDef(d: InjDef) extends InjArg
|
|
75
|
+
|
|
76
|
+
final case class StructError(msg: String) extends RuntimeException(msg)
|
|
77
|
+
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
// Constants
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
val M_KEYPRE = 1
|
|
83
|
+
val M_KEYPOST = 2
|
|
84
|
+
val M_VAL = 4
|
|
85
|
+
|
|
86
|
+
val S_DKEY = "$KEY"
|
|
87
|
+
val S_BANNO = "`$ANNO`"
|
|
88
|
+
val S_DTOP = "$TOP"
|
|
89
|
+
val S_DERRS = "$ERRS"
|
|
90
|
+
val S_DSPEC = "$SPEC"
|
|
91
|
+
val S_BEXACT = "`$EXACT`"
|
|
92
|
+
val S_BVAL = "`$VAL`"
|
|
93
|
+
val S_BKEY = "`$KEY`"
|
|
94
|
+
val S_BOPEN = "`$OPEN`"
|
|
95
|
+
|
|
96
|
+
val S_MT = ""
|
|
97
|
+
val S_BT = "`"
|
|
98
|
+
val S_DS = "$"
|
|
99
|
+
val S_DT = "."
|
|
100
|
+
val S_CN = ":"
|
|
101
|
+
val S_KEY = "KEY"
|
|
102
|
+
val S_VIZ = ": "
|
|
103
|
+
|
|
104
|
+
val S_string = "string"
|
|
105
|
+
val S_object = "object"
|
|
106
|
+
val S_list = "list"
|
|
107
|
+
val S_map = "map"
|
|
108
|
+
val S_nil = "nil"
|
|
109
|
+
val S_null = "null"
|
|
110
|
+
|
|
111
|
+
val T_any = (1 << 31) - 1
|
|
112
|
+
val T_noval = 1 << 30
|
|
113
|
+
val T_boolean = 1 << 29
|
|
114
|
+
val T_decimal = 1 << 28
|
|
115
|
+
val T_integer = 1 << 27
|
|
116
|
+
val T_number = 1 << 26
|
|
117
|
+
val T_string = 1 << 25
|
|
118
|
+
val T_function = 1 << 24
|
|
119
|
+
val T_null = 1 << 22
|
|
120
|
+
val T_list = 1 << 14
|
|
121
|
+
val T_map = 1 << 13
|
|
122
|
+
val T_instance = 1 << 12
|
|
123
|
+
val T_scalar = 1 << 7
|
|
124
|
+
val T_node = 1 << 6
|
|
125
|
+
|
|
126
|
+
val TYPENAME = Array(
|
|
127
|
+
"any", "nil", "boolean", "decimal", "integer", "number", "string", "function",
|
|
128
|
+
"symbol", "null", "", "", "", "", "", "", "", "list", "map", "instance",
|
|
129
|
+
"", "", "", "", "scalar", "node")
|
|
130
|
+
|
|
131
|
+
val SKIP: Value = VSentinel("skip")
|
|
132
|
+
val DELETE: Value = VSentinel("delete")
|
|
133
|
+
|
|
134
|
+
val MAXDEPTH = 32
|
|
135
|
+
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
// Constructors / tiny helpers
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
|
|
140
|
+
def mkList(xs: Seq[Value]): Value = VList(ArrayBuffer.from(xs))
|
|
141
|
+
def emptyList(): Value = VList(ArrayBuffer.empty[Value])
|
|
142
|
+
def emptyMap(): Value = VMap(LinkedHashMap.empty[String, Value])
|
|
143
|
+
def mkMap(pairs: Seq[(String, Value)]): Value = {
|
|
144
|
+
val m = LinkedHashMap.empty[String, Value]
|
|
145
|
+
pairs.foreach { case (k, v) => m.put(k, v) }
|
|
146
|
+
VMap(m)
|
|
147
|
+
}
|
|
148
|
+
def vint(i: Int): Value = VNum(i.toDouble)
|
|
149
|
+
|
|
150
|
+
def isNoval(v: Value): Boolean = v == Noval
|
|
151
|
+
def isNullish(v: Value): Boolean = v == Noval || v == VNull
|
|
152
|
+
def isSkip(v: Value): Boolean = v == VSentinel("skip")
|
|
153
|
+
def isDelete(v: Value): Boolean = v == VSentinel("delete")
|
|
154
|
+
|
|
155
|
+
def isIntegerF(n: Double): Boolean = !n.isNaN && !n.isInfinite && n == Math.floor(n)
|
|
156
|
+
|
|
157
|
+
def numToString(n: Double): String = {
|
|
158
|
+
if (n.isNaN) "NaN"
|
|
159
|
+
else if (isIntegerF(n) && Math.abs(n) < 1e16) n.toLong.toString
|
|
160
|
+
else n.toString
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
def jsString(v: Value): String = v match {
|
|
164
|
+
case Noval => "undefined"
|
|
165
|
+
case VNull => "null"
|
|
166
|
+
case VBool(b) => if (b) "true" else "false"
|
|
167
|
+
case VNum(n) => numToString(n)
|
|
168
|
+
case VStr(s) => s
|
|
169
|
+
case VList(b) => b.map(x => x match { case Noval | VNull => ""; case _ => jsString(x) }).mkString(",")
|
|
170
|
+
case VMap(_) => "[object Object]"
|
|
171
|
+
case VFunc(_) => "function"
|
|
172
|
+
case VSentinel(t) => t
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
def clz32(x0: Int): Int = if (x0 == 0) 32 else Integer.numberOfLeadingZeros(x0)
|
|
176
|
+
|
|
177
|
+
// ordered map ops on the underlying LinkedHashMap
|
|
178
|
+
def omapGet(m: LinkedHashMap[String, Value], k: String): Option[Value] = m.get(k)
|
|
179
|
+
def omapHas(m: LinkedHashMap[String, Value], k: String): Boolean = m.contains(k)
|
|
180
|
+
def omapKeys(m: LinkedHashMap[String, Value]): Seq[String] = m.keysIterator.toSeq
|
|
181
|
+
def omapLen(m: LinkedHashMap[String, Value]): Int = m.size
|
|
182
|
+
def omapSet(m: LinkedHashMap[String, Value], k: String, v: Value): Unit = m.put(k, v)
|
|
183
|
+
def omapDel(m: LinkedHashMap[String, Value], k: String): Unit = m.remove(k)
|
|
184
|
+
|
|
185
|
+
// ---------------------------------------------------------------------------
|
|
186
|
+
// Minor utilities
|
|
187
|
+
// ---------------------------------------------------------------------------
|
|
188
|
+
|
|
189
|
+
def isnode(v: Value): Boolean = v match { case VMap(_) | VList(_) => true; case _ => false }
|
|
190
|
+
def ismap(v: Value): Boolean = v match { case VMap(_) => true; case _ => false }
|
|
191
|
+
def islist(v: Value): Boolean = v match { case VList(_) => true; case _ => false }
|
|
192
|
+
def isfunc(v: Value): Boolean = v match { case VFunc(_) => true; case _ => false }
|
|
193
|
+
|
|
194
|
+
def iskey(k: Value): Boolean = k match {
|
|
195
|
+
case VStr(s) => s.nonEmpty
|
|
196
|
+
case VNum(_) => true
|
|
197
|
+
case _ => false
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
def isempty(v: Value): Boolean =
|
|
201
|
+
isNullish(v) || v == VStr("") || (v match {
|
|
202
|
+
case VList(b) => b.isEmpty
|
|
203
|
+
case VMap(m) => m.isEmpty
|
|
204
|
+
case _ => false
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
def getdef(v: Value, alt: Value): Value = if (isNoval(v)) alt else v
|
|
208
|
+
|
|
209
|
+
def typify(v: Value): Int = v match {
|
|
210
|
+
case Noval => T_noval
|
|
211
|
+
case VNull => T_scalar | T_null
|
|
212
|
+
case VBool(_) => T_scalar | T_boolean
|
|
213
|
+
case VNum(n) =>
|
|
214
|
+
if (n.isNaN) T_noval
|
|
215
|
+
else if (isIntegerF(n)) T_scalar | T_number | T_integer
|
|
216
|
+
else T_scalar | T_number | T_decimal
|
|
217
|
+
case VStr(_) => T_scalar | T_string
|
|
218
|
+
case VFunc(_) => T_scalar | T_function
|
|
219
|
+
case VList(_) => T_node | T_list
|
|
220
|
+
case VMap(_) => T_node | T_map
|
|
221
|
+
case VSentinel(_) => T_node | T_map
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
def typename(t: Int): String = {
|
|
225
|
+
val i = clz32(t)
|
|
226
|
+
if (i >= 0 && i < TYPENAME.length) TYPENAME(i) else TYPENAME(0)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
def size(v: Value): Int = v match {
|
|
230
|
+
case VList(b) => b.length
|
|
231
|
+
case VMap(m) => m.size
|
|
232
|
+
case VStr(s) => s.length
|
|
233
|
+
case VBool(b) => if (b) 1 else 0
|
|
234
|
+
case VNum(n) => Math.floor(n).toInt
|
|
235
|
+
case _ => 0
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
def strkey(key: Value = Noval): String = key match {
|
|
239
|
+
case Noval => S_MT
|
|
240
|
+
case VStr(s) => s
|
|
241
|
+
case VBool(_) => S_MT
|
|
242
|
+
case VNum(n) => if (isIntegerF(n)) numToString(n) else numToString(Math.floor(n))
|
|
243
|
+
case _ => S_MT
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
def keysof(v: Value): Seq[String] = v match {
|
|
247
|
+
case VMap(m) => omapKeys(m).sorted
|
|
248
|
+
case VList(b) => b.indices.map(_.toString)
|
|
249
|
+
case _ => Seq.empty
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
private def isIntKey(s: String): Boolean =
|
|
253
|
+
s.nonEmpty && s.forall(c => (c >= '0' && c <= '9') || c == '-')
|
|
254
|
+
|
|
255
|
+
private def listIndex(b: ArrayBuffer[Value], key: Value): Value = {
|
|
256
|
+
val ks = key match { case VStr(s) => s; case VNum(n) => numToString(n); case _ => "" }
|
|
257
|
+
try {
|
|
258
|
+
val i = ks.toInt
|
|
259
|
+
if (i >= 0 && i < b.length) b(i) else Noval
|
|
260
|
+
} catch { case _: NumberFormatException => Noval }
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
def getprop(v: Value, key: Value, alt: Value = Noval): Value = {
|
|
264
|
+
if (isNoval(v) || isNoval(key)) alt
|
|
265
|
+
else {
|
|
266
|
+
val out = v match {
|
|
267
|
+
case VMap(m) => omapGet(m, jsString(key)).getOrElse(Noval)
|
|
268
|
+
case VList(b) => listIndex(b, key)
|
|
269
|
+
case _ => Noval
|
|
270
|
+
}
|
|
271
|
+
if (isNullish(out)) alt else out
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Raw lookup that preserves stored VNull (Group B), like TS _lookup.
|
|
276
|
+
def lookup_(v: Value, key: Value): Value = {
|
|
277
|
+
if (isNoval(v) || isNoval(key)) Noval
|
|
278
|
+
else v match {
|
|
279
|
+
case VMap(m) => omapGet(m, jsString(key)).getOrElse(Noval)
|
|
280
|
+
case VList(b) => listIndex(b, key)
|
|
281
|
+
case _ => Noval
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
def haskey(v: Value, key: Value): Boolean = !isNullish(getprop(v, key))
|
|
286
|
+
|
|
287
|
+
// dummy inj for the (corpus-unreached) getelem function-alt path
|
|
288
|
+
private lazy val dummyInj: Inj = { val i = new Inj; i.parent = mkMap(Seq((S_DTOP, Noval))); i }
|
|
289
|
+
|
|
290
|
+
def getelem(v: Value, key: Value, alt: Value = Noval): Value = {
|
|
291
|
+
if (isNoval(v) || isNoval(key)) alt
|
|
292
|
+
else {
|
|
293
|
+
var out: Value = Noval
|
|
294
|
+
v match {
|
|
295
|
+
case VList(b) =>
|
|
296
|
+
val ks = key match { case VStr(s) => s; case VNum(n) => numToString(n); case _ => "" }
|
|
297
|
+
if (isIntKey(ks)) {
|
|
298
|
+
val len = b.length
|
|
299
|
+
val nk0 = ks.toInt
|
|
300
|
+
val nk = if (nk0 < 0) len + nk0 else nk0
|
|
301
|
+
if (nk >= 0 && nk < len) out = b(nk)
|
|
302
|
+
}
|
|
303
|
+
case _ =>
|
|
304
|
+
}
|
|
305
|
+
if (isNullish(out)) (alt match {
|
|
306
|
+
case VFunc(f) => f(dummyInj, Noval, "", Noval)
|
|
307
|
+
case _ => alt
|
|
308
|
+
})
|
|
309
|
+
else out
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private def getpropRaw(v: Value, k: String): Value = v match {
|
|
314
|
+
case VMap(m) => omapGet(m, k).getOrElse(Noval)
|
|
315
|
+
case VList(b) => try b(k.toInt) catch { case _: Throwable => Noval }
|
|
316
|
+
case _ => Noval
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
def itemsPairs(v: Value): Seq[(String, Value)] =
|
|
320
|
+
if (!isnode(v)) Seq.empty else keysof(v).map(k => (k, getpropRaw(v, k)))
|
|
321
|
+
|
|
322
|
+
def itemsV(v: Value, f: ((String, Value)) => Value): Value =
|
|
323
|
+
mkList(itemsPairs(v).map(f))
|
|
324
|
+
|
|
325
|
+
def items(v: Value): Value =
|
|
326
|
+
mkList(itemsPairs(v).map { case (k, x) => mkList(Seq(VStr(k), x)) })
|
|
327
|
+
|
|
328
|
+
def flatten(l: Value, depth: Int = 1): Value =
|
|
329
|
+
if (!islist(l)) l
|
|
330
|
+
else {
|
|
331
|
+
val out = ArrayBuffer.empty[Value]
|
|
332
|
+
l match {
|
|
333
|
+
case VList(b) => b.foreach { item =>
|
|
334
|
+
if (islist(item) && depth > 0) flatten(item, depth - 1) match {
|
|
335
|
+
case VList(b2) => b2.foreach(out.append)
|
|
336
|
+
case _ =>
|
|
337
|
+
}
|
|
338
|
+
else out.append(item)
|
|
339
|
+
}
|
|
340
|
+
case _ =>
|
|
341
|
+
}
|
|
342
|
+
VList(out)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
def filter(v: Value, check: ((String, Value)) => Boolean): Value = {
|
|
346
|
+
val out = ArrayBuffer.empty[Value]
|
|
347
|
+
itemsPairs(v).foreach { case (k, x) => if (check((k, x))) out.append(x) }
|
|
348
|
+
VList(out)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
def setprop(parent: Value, key: Value, v: Value): Value = {
|
|
352
|
+
if (iskey(key)) parent match {
|
|
353
|
+
case VMap(m) => omapSet(m, jsString(key), v)
|
|
354
|
+
case VList(b) =>
|
|
355
|
+
val ks = key match { case VStr(s) => s; case VNum(n) => numToString(Math.floor(n)); case _ => "" }
|
|
356
|
+
try {
|
|
357
|
+
val ki = ks.toInt
|
|
358
|
+
val len = b.length
|
|
359
|
+
if (ki >= 0) {
|
|
360
|
+
val k2 = if (ki > len) len else ki
|
|
361
|
+
if (k2 >= len) b.append(v) else b(k2) = v
|
|
362
|
+
} else b.insert(0, v)
|
|
363
|
+
} catch { case _: NumberFormatException => }
|
|
364
|
+
case _ =>
|
|
365
|
+
}
|
|
366
|
+
parent
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
def delprop(parent: Value, key: Value): Value = {
|
|
370
|
+
if (iskey(key)) parent match {
|
|
371
|
+
case VMap(m) => omapDel(m, jsString(key))
|
|
372
|
+
case VList(b) =>
|
|
373
|
+
val ks = key match { case VStr(s) => s; case VNum(n) => numToString(Math.floor(n)); case _ => "" }
|
|
374
|
+
try {
|
|
375
|
+
val ki = ks.toInt
|
|
376
|
+
if (ki >= 0 && ki < b.length) b.remove(ki)
|
|
377
|
+
} catch { case _: NumberFormatException => }
|
|
378
|
+
case _ =>
|
|
379
|
+
}
|
|
380
|
+
parent
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
def clone(v: Value): Value = v match {
|
|
384
|
+
case VList(b) => VList(b.map(clone))
|
|
385
|
+
case VMap(m) =>
|
|
386
|
+
val nm = LinkedHashMap.empty[String, Value]
|
|
387
|
+
m.foreach { case (k, x) => nm.put(k, clone(x)) }
|
|
388
|
+
VMap(nm)
|
|
389
|
+
case _ => v
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
def slice(v: Value, start: Value = Noval, stop: Value = Noval, mutate: Boolean = false): Value = v match {
|
|
393
|
+
case VNum(n) =>
|
|
394
|
+
val lo = start match { case VNum(s) => s; case _ => Double.NegativeInfinity }
|
|
395
|
+
val hi = stop match { case VNum(e) => e - 1.0; case _ => Double.PositiveInfinity }
|
|
396
|
+
VNum(Math.max(lo, Math.min(n, hi)))
|
|
397
|
+
case VList(_) | VStr(_) =>
|
|
398
|
+
val vlen = size(v)
|
|
399
|
+
val start2 = (start, stop) match { case (Noval, x) if !isNoval(x) => VNum(0.0); case _ => start }
|
|
400
|
+
start2 match {
|
|
401
|
+
case VNum(sf) =>
|
|
402
|
+
val s0 = sf.toInt
|
|
403
|
+
var s = s0
|
|
404
|
+
var e = 0
|
|
405
|
+
if (s0 < 0) { s = 0; e = { val ee = vlen + s0; if (ee < 0) 0 else ee } }
|
|
406
|
+
else stop match {
|
|
407
|
+
case VNum(ef) =>
|
|
408
|
+
val e0 = ef.toInt
|
|
409
|
+
if (e0 < 0) { e = { val ee = vlen + e0; if (ee < 0) 0 else ee } }
|
|
410
|
+
else if (vlen < e0) e = vlen
|
|
411
|
+
else e = e0
|
|
412
|
+
case _ => e = vlen
|
|
413
|
+
}
|
|
414
|
+
if (vlen < s) s = vlen
|
|
415
|
+
if (s > -1 && s <= e && e <= vlen) v match {
|
|
416
|
+
case VList(b) =>
|
|
417
|
+
if (mutate) { val sub = b.slice(s, e); b.clear(); b ++= sub; v }
|
|
418
|
+
else VList(b.slice(s, e))
|
|
419
|
+
case VStr(str) => VStr(str.substring(s, e))
|
|
420
|
+
case _ => v
|
|
421
|
+
} else v match {
|
|
422
|
+
case VList(b) => if (mutate) { b.clear(); v } else emptyList()
|
|
423
|
+
case VStr(_) => VStr(S_MT)
|
|
424
|
+
case _ => v
|
|
425
|
+
}
|
|
426
|
+
case _ => v
|
|
427
|
+
}
|
|
428
|
+
case _ => v
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// ---------------------------------------------------------------------------
|
|
432
|
+
// Regex (uniform re_* API over java.util.regex)
|
|
433
|
+
// ---------------------------------------------------------------------------
|
|
434
|
+
|
|
435
|
+
private def reStr(p: Value): String = p match { case VStr(s) => s; case _ => jsString(p) }
|
|
436
|
+
|
|
437
|
+
def re_compile(p: Value, flags: Value = Noval): Value = p match { case VStr(_) => p; case _ => VStr(jsString(p)) }
|
|
438
|
+
def re_test(p: Value, input: Value): Value =
|
|
439
|
+
VBool(java.util.regex.Pattern.compile(reStr(p)).matcher(reStr(input)).find())
|
|
440
|
+
def re_find(p: Value, input: Value): Value = {
|
|
441
|
+
val m = java.util.regex.Pattern.compile(reStr(p)).matcher(reStr(input))
|
|
442
|
+
if (m.find()) {
|
|
443
|
+
val buf = ArrayBuffer[Value](VStr(m.group(0)))
|
|
444
|
+
for (i <- 1 to m.groupCount()) buf.append(VStr(Option(m.group(i)).getOrElse("")))
|
|
445
|
+
VList(buf)
|
|
446
|
+
} else VNull
|
|
447
|
+
}
|
|
448
|
+
def re_find_all(p: Value, input: Value): Value = {
|
|
449
|
+
val m = java.util.regex.Pattern.compile(reStr(p)).matcher(reStr(input))
|
|
450
|
+
val out = ArrayBuffer.empty[Value]
|
|
451
|
+
while (m.find()) {
|
|
452
|
+
val buf = ArrayBuffer[Value](VStr(m.group(0)))
|
|
453
|
+
for (i <- 1 to m.groupCount()) buf.append(VStr(Option(m.group(i)).getOrElse("")))
|
|
454
|
+
out.append(VList(buf))
|
|
455
|
+
}
|
|
456
|
+
VList(out)
|
|
457
|
+
}
|
|
458
|
+
def re_replace(p: Value, input: Value, repl: Value): Value = input
|
|
459
|
+
def re_escape(s: Value): Value = escre(s)
|
|
460
|
+
|
|
461
|
+
def escre(s: Value): Value = {
|
|
462
|
+
val str = s match { case VStr(x) => x; case Noval => S_MT; case _ => jsString(s) }
|
|
463
|
+
val b = new StringBuilder
|
|
464
|
+
str.foreach { c =>
|
|
465
|
+
c match {
|
|
466
|
+
case '.' | '*' | '+' | '?' | '^' | '$' | '{' | '}' | '(' | ')' | '|' | '[' | ']' | '\\' => b.append('\\')
|
|
467
|
+
case _ =>
|
|
468
|
+
}
|
|
469
|
+
b.append(c)
|
|
470
|
+
}
|
|
471
|
+
VStr(b.toString)
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
def escurl(s: Value): Value = {
|
|
475
|
+
val str = s match { case VStr(x) => x; case Noval => S_MT; case _ => jsString(s) }
|
|
476
|
+
val b = new StringBuilder
|
|
477
|
+
str.getBytes("UTF-8").foreach { bt =>
|
|
478
|
+
val c = (bt & 0xff).toChar
|
|
479
|
+
val unreserved = (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
|
|
480
|
+
c == '-' || c == '_' || c == '.' || c == '!' || c == '~' || c == '*' || c == '\'' || c == '(' || c == ')'
|
|
481
|
+
if (unreserved) b.append(c) else b.append("%%%02X".format(bt & 0xff))
|
|
482
|
+
}
|
|
483
|
+
VStr(b.toString)
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// ---------------------------------------------------------------------------
|
|
487
|
+
// JSON-ish serialization / stringify / jsonify
|
|
488
|
+
// ---------------------------------------------------------------------------
|
|
489
|
+
|
|
490
|
+
private def escJson(s: String, b: StringBuilder): Unit = {
|
|
491
|
+
b.append('"')
|
|
492
|
+
s.foreach {
|
|
493
|
+
case '"' => b.append("\\\"")
|
|
494
|
+
case '\\' => b.append("\\\\")
|
|
495
|
+
case '\n' => b.append("\\n")
|
|
496
|
+
case '\r' => b.append("\\r")
|
|
497
|
+
case '\t' => b.append("\\t")
|
|
498
|
+
case c if c < 32 => b.append("\\u%04x".format(c.toInt))
|
|
499
|
+
case c => b.append(c)
|
|
500
|
+
}
|
|
501
|
+
b.append('"')
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
def jsonEncode(v: Value, sort: Boolean = false, indent: Int = -1): String = {
|
|
505
|
+
val b = new StringBuilder
|
|
506
|
+
def enc(v: Value, level: Int): Unit = v match {
|
|
507
|
+
case Noval | VNull => b.append("null")
|
|
508
|
+
case VBool(x) => b.append(if (x) "true" else "false")
|
|
509
|
+
case VNum(n) => b.append(numToString(n))
|
|
510
|
+
case VStr(s) => escJson(s, b)
|
|
511
|
+
case VFunc(_) | VSentinel(_) => b.append("null")
|
|
512
|
+
case VList(buf) =>
|
|
513
|
+
if (buf.isEmpty) b.append("[]")
|
|
514
|
+
else if (indent >= 0) {
|
|
515
|
+
val pad = " " * (indent * (level + 1)); val cpad = " " * (indent * level)
|
|
516
|
+
b.append("[\n")
|
|
517
|
+
buf.zipWithIndex.foreach { case (x, i) => if (i > 0) b.append(",\n"); b.append(pad); enc(x, level + 1) }
|
|
518
|
+
b.append("\n"); b.append(cpad); b.append(']')
|
|
519
|
+
} else {
|
|
520
|
+
b.append('[')
|
|
521
|
+
buf.zipWithIndex.foreach { case (x, i) => if (i > 0) b.append(','); enc(x, level + 1) }
|
|
522
|
+
b.append(']')
|
|
523
|
+
}
|
|
524
|
+
case VMap(m) =>
|
|
525
|
+
val ks0 = m.keysIterator.toSeq
|
|
526
|
+
val ks = if (sort) ks0.sorted else ks0
|
|
527
|
+
if (ks.isEmpty) b.append("{}")
|
|
528
|
+
else if (indent >= 0) {
|
|
529
|
+
val pad = " " * (indent * (level + 1)); val cpad = " " * (indent * level)
|
|
530
|
+
b.append("{\n")
|
|
531
|
+
ks.zipWithIndex.foreach { case (k, i) =>
|
|
532
|
+
if (i > 0) b.append(",\n"); b.append(pad); escJson(k, b); b.append(": "); enc(m(k), level + 1)
|
|
533
|
+
}
|
|
534
|
+
b.append("\n"); b.append(cpad); b.append('}')
|
|
535
|
+
} else {
|
|
536
|
+
b.append('{')
|
|
537
|
+
ks.zipWithIndex.foreach { case (k, i) =>
|
|
538
|
+
if (i > 0) b.append(','); escJson(k, b); b.append(':'); enc(m(k), level + 1)
|
|
539
|
+
}
|
|
540
|
+
b.append('}')
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
enc(v, 0); b.toString
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
private def hasCycle(v: Value): Boolean = {
|
|
547
|
+
val seen = ArrayBuffer.empty[AnyRef]
|
|
548
|
+
def go(v: Value): Boolean = v match {
|
|
549
|
+
case VList(b) => if (seen.exists(_ eq b)) true else { seen.append(b); b.exists(go) }
|
|
550
|
+
case VMap(m) => if (seen.exists(_ eq m)) true else { seen.append(m); m.valuesIterator.exists(go) }
|
|
551
|
+
case _ => false
|
|
552
|
+
}
|
|
553
|
+
go(v)
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
def stringify(v: Value, maxlen: Value = Noval, pretty: Boolean = false): String = v match {
|
|
557
|
+
case Noval => if (pretty) "<>" else S_MT
|
|
558
|
+
case _ =>
|
|
559
|
+
var valstr = v match {
|
|
560
|
+
case VStr(s) => s
|
|
561
|
+
case _ =>
|
|
562
|
+
if (hasCycle(v)) "__STRINGIFY_FAILED__"
|
|
563
|
+
else try jsonEncode(v, sort = true).replace("\"", "") catch { case _: Throwable => "__STRINGIFY_FAILED__" }
|
|
564
|
+
}
|
|
565
|
+
maxlen match {
|
|
566
|
+
case VNum(m) if m > -1.0 =>
|
|
567
|
+
val mm = m.toInt; val l = valstr.length
|
|
568
|
+
if (mm < l) valstr = valstr.substring(0, Math.max(0, mm - 3)) + "..."
|
|
569
|
+
case _ =>
|
|
570
|
+
}
|
|
571
|
+
if (pretty) {
|
|
572
|
+
val colors = Array(81, 118, 213, 39, 208, 201, 45, 190, 129, 51, 160, 121, 226, 33, 207, 69)
|
|
573
|
+
val c = colors.map(n => s"[38;5;${n}m")
|
|
574
|
+
val r = "[0m"
|
|
575
|
+
var d = 0; var o = c(0); val t = new StringBuilder; t.append(c(0))
|
|
576
|
+
valstr.foreach { ch =>
|
|
577
|
+
if (ch == '{' || ch == '[') { d += 1; o = c(d % c.length); t.append(o); t.append(ch) }
|
|
578
|
+
else if (ch == '}' || ch == ']') { t.append(o); t.append(ch); d -= 1; o = c(((d % c.length) + c.length) % c.length) }
|
|
579
|
+
else { t.append(o); t.append(ch) }
|
|
580
|
+
}
|
|
581
|
+
t.append(r); t.toString
|
|
582
|
+
} else valstr
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
def jsonify(v: Value, flags: Value = Noval): String = v match {
|
|
586
|
+
case Noval => S_null
|
|
587
|
+
case _ =>
|
|
588
|
+
val indent = getprop(flags, VStr("indent"), VNum(2.0)) match { case VNum(n) => n.toInt; case _ => 2 }
|
|
589
|
+
try {
|
|
590
|
+
val str = if (indent > 0) jsonEncode(v, indent = indent) else jsonEncode(v)
|
|
591
|
+
val offset = getprop(flags, VStr("offset"), VNum(0.0)) match { case VNum(n) => n.toInt; case _ => 0 }
|
|
592
|
+
if (offset > 0) {
|
|
593
|
+
val lines = str.split("\n", -1).toSeq
|
|
594
|
+
if (lines.nonEmpty) "{\n" + lines.tail.map(l => (" " * offset) + l).mkString("\n") else str
|
|
595
|
+
} else str
|
|
596
|
+
} catch { case _: Throwable => S_null }
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
def pad(s: Value, padding: Value = Noval, padchar: Value = Noval): String = {
|
|
600
|
+
val str = s match { case VStr(x) => x; case VNull => "null"; case _ => stringify(s) }
|
|
601
|
+
val p = padding match { case VNum(n) => n.toInt; case _ => 44 }
|
|
602
|
+
val pc = padchar match { case VStr(x) => (x + " ").substring(0, 1); case _ => " " }
|
|
603
|
+
if (p > -1) { val n = p - str.length; if (n > 0) str + (pc * n) else str }
|
|
604
|
+
else { val n = (-p) - str.length; if (n > 0) (pc * n) + str else str }
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// ---------------------------------------------------------------------------
|
|
608
|
+
// join / pathify / replace
|
|
609
|
+
// ---------------------------------------------------------------------------
|
|
610
|
+
|
|
611
|
+
def join(arr: Value, sep: Value = Noval, url: Boolean = false): String = {
|
|
612
|
+
if (!islist(arr)) S_MT
|
|
613
|
+
else {
|
|
614
|
+
val sepdef = sep match { case Noval | VNull => ","; case VStr(s) => s; case _ => jsString(sep) }
|
|
615
|
+
val single = sepdef.length == 1
|
|
616
|
+
val sc = if (single) sepdef.charAt(0) else ' '
|
|
617
|
+
val itemsL = arr match { case VList(b) => b.toSeq; case _ => Seq.empty }
|
|
618
|
+
val sarr = itemsL.length
|
|
619
|
+
def stripTrailing(s: String) = { var i = s.length; while (i > 0 && s.charAt(i - 1) == sc) i -= 1; s.substring(0, i) }
|
|
620
|
+
def stripLeading(s: String) = { var i = 0; while (i < s.length && s.charAt(i) == sc) i += 1; s.substring(i) }
|
|
621
|
+
def collapse(s: String) = {
|
|
622
|
+
val b = new StringBuilder; var i = 0; val n = s.length
|
|
623
|
+
while (i < n) {
|
|
624
|
+
if (s.charAt(i) != sc) { b.append(s.charAt(i)); i += 1 }
|
|
625
|
+
else {
|
|
626
|
+
var j = i; while (j < n && s.charAt(j) == sc) j += 1
|
|
627
|
+
val beforeNon = i > 0 && s.charAt(i - 1) != sc
|
|
628
|
+
val afterNon = j < n
|
|
629
|
+
if (beforeNon && afterNon) b.append(sc) else b.append(s.substring(i, j))
|
|
630
|
+
i = j
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
b.toString
|
|
634
|
+
}
|
|
635
|
+
val out = ArrayBuffer.empty[String]
|
|
636
|
+
itemsL.zipWithIndex.foreach {
|
|
637
|
+
case (VStr(s0), idx) if s0 != S_MT =>
|
|
638
|
+
val s = if (single) {
|
|
639
|
+
if (url && idx == 0) stripTrailing(s0)
|
|
640
|
+
else {
|
|
641
|
+
var x = if (idx > 0) stripLeading(s0) else s0
|
|
642
|
+
x = if (idx < sarr - 1 || !url) stripTrailing(x) else x
|
|
643
|
+
collapse(x)
|
|
644
|
+
}
|
|
645
|
+
} else s0
|
|
646
|
+
if (s != S_MT) out.append(s)
|
|
647
|
+
case _ =>
|
|
648
|
+
}
|
|
649
|
+
out.mkString(sepdef)
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
def joinurl(arr: Value): String = join(arr, VStr("/"), url = true)
|
|
654
|
+
|
|
655
|
+
def replace(s: Value, from: Value, to: Value): String = {
|
|
656
|
+
val ts = typify(s)
|
|
657
|
+
val rs = if ((T_string & ts) == 0) stringify(s)
|
|
658
|
+
else if (((T_noval | T_null) & ts) > 0) S_MT
|
|
659
|
+
else stringify(s)
|
|
660
|
+
val toS = to match { case VStr(x) => x; case _ => jsString(to) }
|
|
661
|
+
from match {
|
|
662
|
+
case VStr(f) if f.nonEmpty => rs.replace(f, toS)
|
|
663
|
+
case _ => rs
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
def pathify(v: Value, startin: Value = Noval, endin: Value = Noval, absent: Boolean = false): String = {
|
|
668
|
+
val path: Option[Seq[Value]] =
|
|
669
|
+
if (islist(v)) Some(v match { case VList(b) => b.toSeq; case _ => Seq.empty })
|
|
670
|
+
else if (iskey(v)) Some(Seq(v))
|
|
671
|
+
else None
|
|
672
|
+
val start = startin match { case VNum(n) => if (n > -1.0) n.toInt else 0; case _ => 0 }
|
|
673
|
+
val endn = endin match { case VNum(n) => if (n > -1.0) n.toInt else 0; case _ => 0 }
|
|
674
|
+
val pathstr: Option[String] = path match {
|
|
675
|
+
case Some(p) if start >= 0 =>
|
|
676
|
+
val len = p.length
|
|
677
|
+
val e = Math.max(0, len - endn)
|
|
678
|
+
val s = Math.min(start, len)
|
|
679
|
+
val sub = if (s <= e) p.slice(s, e) else Seq.empty
|
|
680
|
+
if (sub.isEmpty) Some("<root>")
|
|
681
|
+
else {
|
|
682
|
+
val fp = sub.filter(iskey)
|
|
683
|
+
val mapped = fp.map {
|
|
684
|
+
case VNum(n) => numToString(Math.floor(n))
|
|
685
|
+
case pp => jsString(pp).replace(".", S_MT)
|
|
686
|
+
}
|
|
687
|
+
Some(mapped.mkString("."))
|
|
688
|
+
}
|
|
689
|
+
case _ => None
|
|
690
|
+
}
|
|
691
|
+
pathstr match {
|
|
692
|
+
case Some(s) => s
|
|
693
|
+
case None => "<unknown-path" + (if (absent) S_MT else S_CN + stringify(v, VNum(47.0))) + ">"
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// ---------------------------------------------------------------------------
|
|
698
|
+
// walk / merge
|
|
699
|
+
// ---------------------------------------------------------------------------
|
|
700
|
+
|
|
701
|
+
def walk(v: Value, before: Option[WalkFn] = None, after: Option[WalkFn] = None,
|
|
702
|
+
maxdepth: Value = Noval, key: Value = Noval, parent: Value = Noval, path: Value = null): Value = {
|
|
703
|
+
val p = if (path == null) emptyList() else path
|
|
704
|
+
val depth = size(p)
|
|
705
|
+
var out = before match { case Some(f) => f(key, v, parent, p); case None => v }
|
|
706
|
+
val mdv = maxdepth match { case VNum(n) if n >= 0 => n.toInt; case _ => MAXDEPTH }
|
|
707
|
+
if (mdv == 0 || (mdv > 0 && mdv <= depth)) out
|
|
708
|
+
else {
|
|
709
|
+
if (isnode(out)) {
|
|
710
|
+
val prefix = p match { case VList(b) => b.toSeq; case _ => Seq.empty }
|
|
711
|
+
itemsPairs(out).foreach { case (ckey, child) =>
|
|
712
|
+
val childpath = mkList(prefix :+ VStr(ckey))
|
|
713
|
+
val result = walk(child, before, after, VNum(mdv.toDouble), VStr(ckey), out, childpath)
|
|
714
|
+
out match {
|
|
715
|
+
case VMap(m) => m.put(ckey, result)
|
|
716
|
+
case VList(b) => b(ckey.toInt) = result
|
|
717
|
+
case _ =>
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
after match { case Some(f) => f(key, out, parent, p); case None => out }
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
def merge(objs: Value, maxdepth: Value = Noval): Value = {
|
|
726
|
+
val md = maxdepth match { case VNum(n) => if (n < 0) 0 else n.toInt; case _ => MAXDEPTH }
|
|
727
|
+
if (!islist(objs)) objs
|
|
728
|
+
else {
|
|
729
|
+
val l = objs match { case VList(b) => b; case _ => ArrayBuffer.empty[Value] }
|
|
730
|
+
val lenlist = l.length
|
|
731
|
+
if (lenlist == 0) Noval
|
|
732
|
+
else if (lenlist == 1) l(0)
|
|
733
|
+
else {
|
|
734
|
+
var out = getprop(objs, VNum(0.0), emptyMap())
|
|
735
|
+
for (oi <- 1 until lenlist) {
|
|
736
|
+
val obj = l(oi)
|
|
737
|
+
if (!isnode(obj)) out = obj
|
|
738
|
+
else {
|
|
739
|
+
val cur = ArrayBuffer[Value](out)
|
|
740
|
+
val dst = ArrayBuffer[Value](out)
|
|
741
|
+
def grow(a: ArrayBuffer[Value], n: Int): Unit = while (a.length <= n) a.append(Noval)
|
|
742
|
+
val before: WalkFn = (key, v, _parent, path) => {
|
|
743
|
+
val pi = size(path)
|
|
744
|
+
if (md <= pi) {
|
|
745
|
+
grow(cur, pi); cur(pi) = v
|
|
746
|
+
if (pi > 0) setprop(cur(pi - 1), key, v)
|
|
747
|
+
Noval
|
|
748
|
+
} else if (!isnode(v)) {
|
|
749
|
+
grow(cur, pi); cur(pi) = v; v
|
|
750
|
+
} else {
|
|
751
|
+
grow(dst, pi); grow(cur, pi)
|
|
752
|
+
dst(pi) = if (pi > 0) getprop(dst(pi - 1), key) else dst(pi)
|
|
753
|
+
val tval = dst(pi)
|
|
754
|
+
if (isNullish(tval)) { cur(pi) = if (islist(v)) emptyList() else emptyMap(); v }
|
|
755
|
+
else if ((islist(v) && islist(tval)) || (ismap(v) && ismap(tval))) { cur(pi) = tval; v }
|
|
756
|
+
else { cur(pi) = v; Noval }
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
val after: WalkFn = (key, _v, _parent, path) => {
|
|
760
|
+
val ci = size(path)
|
|
761
|
+
if (ci < 1) (if (cur.nonEmpty) cur(0) else _v)
|
|
762
|
+
else {
|
|
763
|
+
val target = if (ci - 1 < cur.length) cur(ci - 1) else Noval
|
|
764
|
+
val value = if (ci < cur.length) cur(ci) else Noval
|
|
765
|
+
setprop(target, key, value); value
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
out = walk(obj, Some(before), Some(after))
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
if (md == 0) {
|
|
772
|
+
val o = getprop(objs, VNum((lenlist - 1).toDouble))
|
|
773
|
+
out = if (islist(o)) emptyList() else if (ismap(o)) emptyMap() else o
|
|
774
|
+
}
|
|
775
|
+
out
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// ---------------------------------------------------------------------------
|
|
781
|
+
// getpath / setpath
|
|
782
|
+
// ---------------------------------------------------------------------------
|
|
783
|
+
|
|
784
|
+
private def iaBase(ia: InjArg): Value = ia match { case IInj(i) => i.base; case IDef(d) => d.dBase; case INone => Noval }
|
|
785
|
+
private def iaDparent(ia: InjArg): Value = ia match { case IInj(i) => i.dparent; case IDef(d) => d.dParent; case INone => Noval }
|
|
786
|
+
private def iaMeta(ia: InjArg): Value = ia match { case IInj(i) => i.meta; case IDef(d) => d.dMeta; case INone => Noval }
|
|
787
|
+
private def iaKey(ia: InjArg): Value = ia match { case IInj(i) => i.key; case IDef(d) => d.dKey; case INone => Noval }
|
|
788
|
+
private def iaDpath(ia: InjArg): Value = ia match { case IInj(i) => i.dpath; case IDef(d) => d.dPath; case INone => Noval }
|
|
789
|
+
private def iaHandler(ia: InjArg): Option[Injector] = ia match { case IInj(i) => Some(i.handler); case IDef(d) => d.dHandler; case INone => None }
|
|
790
|
+
private def iaIsSome(ia: InjArg): Boolean = ia != INone
|
|
791
|
+
|
|
792
|
+
private def startsWith(s: String, pre: String): Boolean = s.startsWith(pre)
|
|
793
|
+
private def replaceAll(s: String, find: String, repl: String): String = if (find.isEmpty) s else s.replace(find, repl)
|
|
794
|
+
|
|
795
|
+
// R_META_PATH = ^([^$]+)\$([=~])(.+)$
|
|
796
|
+
private def metaPathMatch(s: String): Option[(String, String, String)] = {
|
|
797
|
+
val i = s.indexOf('$')
|
|
798
|
+
if (i > 0 && i + 1 < s.length && (s.charAt(i + 1) == '=' || s.charAt(i + 1) == '~') && i + 2 <= s.length - 1)
|
|
799
|
+
Some((s.substring(0, i), s.charAt(i + 1).toString, s.substring(i + 2)))
|
|
800
|
+
else None
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
def getpath(store: Value, path: Value, inj: InjArg = INone): Value = {
|
|
804
|
+
val pa: Option[Array[Value]] = path match {
|
|
805
|
+
case VList(b) => Some(b.toArray)
|
|
806
|
+
case VStr(s) => Some(s.split("\\.", -1).map(x => VStr(x)).toArray)
|
|
807
|
+
case VNum(n) => Some(Array(VStr(strkey(VNum(n)))))
|
|
808
|
+
case _ => None
|
|
809
|
+
}
|
|
810
|
+
pa match {
|
|
811
|
+
case None => Noval
|
|
812
|
+
case Some(parts) =>
|
|
813
|
+
val base = iaBase(inj)
|
|
814
|
+
val dparent = iaDparent(inj)
|
|
815
|
+
val injMeta = iaMeta(inj)
|
|
816
|
+
val injKey = iaKey(inj)
|
|
817
|
+
val dpath = iaDpath(inj)
|
|
818
|
+
val src = if (iskey(base)) getprop(store, base, store) else store
|
|
819
|
+
val numparts = parts.length
|
|
820
|
+
var v: Value = store
|
|
821
|
+
def arrGet(i: Int): Value = if (i >= 0 && i < parts.length) parts(i) else Noval
|
|
822
|
+
if (isNoval(path) || isNoval(store) || (numparts == 1 && parts(0) == VStr(S_MT)) || numparts == 0) {
|
|
823
|
+
v = src
|
|
824
|
+
} else {
|
|
825
|
+
if (numparts == 1) v = getprop(store, parts(0))
|
|
826
|
+
if (!isfunc(v)) {
|
|
827
|
+
v = src
|
|
828
|
+
parts(0) match {
|
|
829
|
+
case VStr(s0) =>
|
|
830
|
+
metaPathMatch(s0) match {
|
|
831
|
+
case Some((g1, _, g3)) if !isNoval(injMeta) && iaIsSome(inj) =>
|
|
832
|
+
v = getprop(injMeta, VStr(g1)); parts(0) = VStr(g3)
|
|
833
|
+
case _ =>
|
|
834
|
+
}
|
|
835
|
+
case _ =>
|
|
836
|
+
}
|
|
837
|
+
var pi = 0
|
|
838
|
+
var continue = true
|
|
839
|
+
while (continue && !isNoval(v) && pi < numparts) {
|
|
840
|
+
val raw = parts(pi)
|
|
841
|
+
val part0: Value = raw match {
|
|
842
|
+
case VStr(s) if iaIsSome(inj) && s == S_DKEY => if (!isNoval(injKey)) injKey else raw
|
|
843
|
+
case VStr(s) if startsWith(s, "$GET:") =>
|
|
844
|
+
VStr(stringify(getpath(src, slice(VStr(s), VNum(5.0), VNum(-1.0)), INone)))
|
|
845
|
+
case VStr(s) if startsWith(s, "$REF:") =>
|
|
846
|
+
VStr(stringify(getpath(getprop(store, VStr(S_DSPEC)), slice(VStr(s), VNum(5.0), VNum(-1.0)), INone)))
|
|
847
|
+
case VStr(s) if iaIsSome(inj) && startsWith(s, "$META:") =>
|
|
848
|
+
VStr(stringify(getpath(injMeta, slice(VStr(s), VNum(6.0), VNum(-1.0)), INone)))
|
|
849
|
+
case _ => raw
|
|
850
|
+
}
|
|
851
|
+
val part: Value = part0 match {
|
|
852
|
+
case VStr(s) => VStr(replaceAll(s, "$$", "$"))
|
|
853
|
+
case _ => VStr(strkey(part0))
|
|
854
|
+
}
|
|
855
|
+
if (part == VStr(S_MT)) {
|
|
856
|
+
var ascends = 0
|
|
857
|
+
while (arrGet(pi + 1) == VStr(S_MT)) { ascends += 1; pi += 1 }
|
|
858
|
+
if (iaIsSome(inj) && ascends > 0) {
|
|
859
|
+
if (pi == numparts - 1) ascends -= 1
|
|
860
|
+
if (ascends == 0) { v = dparent }
|
|
861
|
+
else {
|
|
862
|
+
val tail = parts.slice(pi + 1, numparts).toSeq
|
|
863
|
+
val fullpath = flatten(mkList(Seq(slice(dpath, VNum((-ascends).toDouble)), mkList(tail))))
|
|
864
|
+
v = if (ascends <= size(dpath)) getpath(store, fullpath, INone) else Noval
|
|
865
|
+
continue = false
|
|
866
|
+
}
|
|
867
|
+
} else { v = dparent }
|
|
868
|
+
} else v = getprop(v, part)
|
|
869
|
+
if (continue) pi += 1
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
iaHandler(inj) match {
|
|
874
|
+
case Some(h) if iaIsSome(inj) =>
|
|
875
|
+
val refp = pathify(path)
|
|
876
|
+
inj match {
|
|
877
|
+
case IInj(i) => v = h(i, v, refp, store)
|
|
878
|
+
case _ => v = h(dummyInj, v, refp, store)
|
|
879
|
+
}
|
|
880
|
+
case _ =>
|
|
881
|
+
}
|
|
882
|
+
v
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
def setpath(store: Value, path: Value, v: Value, inj: InjArg = INone): Value = {
|
|
887
|
+
val ptype = typify(path)
|
|
888
|
+
val parts: Value =
|
|
889
|
+
if ((T_list & ptype) > 0) (path match { case VList(b) => mkList(b.toSeq); case _ => emptyList() })
|
|
890
|
+
else if ((T_string & ptype) > 0) (path match { case VStr(s) => mkList(s.split("\\.", -1).map(x => VStr(x)).toSeq); case _ => emptyList() })
|
|
891
|
+
else if ((T_number & ptype) > 0) mkList(Seq(path))
|
|
892
|
+
else Noval
|
|
893
|
+
if (isNoval(parts)) Noval
|
|
894
|
+
else {
|
|
895
|
+
val base = inj match { case INone => Noval; case _ => iaBase(inj) }
|
|
896
|
+
val numparts = size(parts)
|
|
897
|
+
var parent = if (iskey(base)) getprop(store, base, store) else store
|
|
898
|
+
for (pi <- 0 until numparts - 1) {
|
|
899
|
+
val pkey = getelem(parts, VNum(pi.toDouble))
|
|
900
|
+
var np = getprop(parent, pkey)
|
|
901
|
+
if (!isnode(np)) {
|
|
902
|
+
val nextpart = getelem(parts, VNum((pi + 1).toDouble))
|
|
903
|
+
np = if ((T_number & typify(nextpart)) > 0) emptyList() else emptyMap()
|
|
904
|
+
setprop(parent, pkey, np)
|
|
905
|
+
}
|
|
906
|
+
parent = np
|
|
907
|
+
}
|
|
908
|
+
if (isDelete(v)) delprop(parent, getelem(parts, VNum(-1.0)))
|
|
909
|
+
else setprop(parent, getelem(parts, VNum(-1.0)), v)
|
|
910
|
+
parent
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// ---------------------------------------------------------------------------
|
|
915
|
+
// backtick-string helpers
|
|
916
|
+
// ---------------------------------------------------------------------------
|
|
917
|
+
|
|
918
|
+
// R_INJECTION_FULL: whole string is one backtick injection -> captured ref.
|
|
919
|
+
private def injectionFull(s: String): Option[String] = {
|
|
920
|
+
val n = s.length
|
|
921
|
+
if (n >= 2 && s.charAt(0) == '`' && s.charAt(n - 1) == '`') {
|
|
922
|
+
val inner = s.substring(1, n - 1)
|
|
923
|
+
if (inner.indexOf('`') >= 0) None
|
|
924
|
+
else {
|
|
925
|
+
val isDollarUpper = inner.length > 1 && inner.charAt(0) == '$' && {
|
|
926
|
+
var j = 1; while (j < inner.length && inner.charAt(j) >= 'A' && inner.charAt(j) <= 'Z') j += 1
|
|
927
|
+
val lettersEnd = j
|
|
928
|
+
lettersEnd > 1 && {
|
|
929
|
+
var k = lettersEnd; while (k < inner.length && inner.charAt(k) >= '0' && inner.charAt(k) <= '9') k += 1
|
|
930
|
+
k == inner.length
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (isDollarUpper) {
|
|
934
|
+
var j = 1; while (j < inner.length && inner.charAt(j) >= 'A' && inner.charAt(j) <= 'Z') j += 1
|
|
935
|
+
Some(inner.substring(0, j))
|
|
936
|
+
} else Some(inner)
|
|
937
|
+
}
|
|
938
|
+
} else None
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
private def injectionPartialReplace(s: String, f: String => String): String = {
|
|
942
|
+
val n = s.length; val b = new StringBuilder; var i = 0
|
|
943
|
+
while (i < n) {
|
|
944
|
+
if (s.charAt(i) == '`') {
|
|
945
|
+
val j = s.indexOf('`', i + 1)
|
|
946
|
+
if (j >= 0) { b.append(f(s.substring(i + 1, j))); i = j + 1 }
|
|
947
|
+
else { b.append(s.charAt(i)); i += 1 }
|
|
948
|
+
} else { b.append(s.charAt(i)); i += 1 }
|
|
949
|
+
}
|
|
950
|
+
b.toString
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
private def replaceTransformNames(s: String): String = {
|
|
954
|
+
val n = s.length; val b = new StringBuilder; var i = 0
|
|
955
|
+
while (i < n) {
|
|
956
|
+
if (s.charAt(i) == '`' && i + 1 < n && s.charAt(i + 1) == '$') {
|
|
957
|
+
var j = i + 2; while (j < n && s.charAt(j) >= 'A' && s.charAt(j) <= 'Z') j += 1
|
|
958
|
+
if (j < n && s.charAt(j) == '`' && j > i + 2) {
|
|
959
|
+
b.append(s.substring(i + 2, j).toLowerCase); i = j + 1
|
|
960
|
+
} else { b.append(s.charAt(i)); i += 1 }
|
|
961
|
+
} else { b.append(s.charAt(i)); i += 1 }
|
|
962
|
+
}
|
|
963
|
+
b.toString
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// ---------------------------------------------------------------------------
|
|
967
|
+
// Injection methods
|
|
968
|
+
// ---------------------------------------------------------------------------
|
|
969
|
+
|
|
970
|
+
private def newInj(v: Value, parent: Value): Inj = {
|
|
971
|
+
val i = new Inj
|
|
972
|
+
i.mode = M_VAL; i.full = false; i.keyi = 0
|
|
973
|
+
i.keys = mkList(Seq(VStr(S_DTOP))); i.key = VStr(S_DTOP); i.ival = v; i.parent = parent
|
|
974
|
+
i.path = mkList(Seq(VStr(S_DTOP))); i.nodes = mkList(Seq(parent)); i.handler = injectHandler
|
|
975
|
+
i.errs = emptyList(); i.meta = emptyMap(); i.dparent = Noval; i.dpath = mkList(Seq(VStr(S_DTOP)))
|
|
976
|
+
i.base = VStr(S_DTOP); i.modify = None; i.prior = None; i.extra = Noval
|
|
977
|
+
i
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
private def injDescend(inj: Inj): Value = {
|
|
981
|
+
inj.meta match {
|
|
982
|
+
case VMap(m) =>
|
|
983
|
+
val d = m.get("__d") match { case Some(VNum(n)) => n; case _ => 0.0 }
|
|
984
|
+
m.put("__d", VNum(d + 1.0))
|
|
985
|
+
case _ =>
|
|
986
|
+
}
|
|
987
|
+
val parentkey = getelem(inj.path, VNum(-2.0))
|
|
988
|
+
if (isNoval(inj.dparent)) {
|
|
989
|
+
if (size(inj.dpath) > 1) inj.dpath = inj.dpath match { case VList(b) => mkList(b.toSeq :+ parentkey); case _ => inj.dpath }
|
|
990
|
+
} else if (!isNoval(parentkey)) {
|
|
991
|
+
inj.dparent = getprop(inj.dparent, parentkey)
|
|
992
|
+
val lastpart = getelem(inj.dpath, VNum(-1.0))
|
|
993
|
+
if (lastpart == VStr("$:" + jsString(parentkey))) inj.dpath = slice(inj.dpath, VNum(-1.0))
|
|
994
|
+
else inj.dpath = inj.dpath match { case VList(b) => mkList(b.toSeq :+ parentkey); case _ => inj.dpath }
|
|
995
|
+
}
|
|
996
|
+
inj.dparent
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
private def injChild(inj: Inj, keyi: Int, keys: Value): Inj = {
|
|
1000
|
+
val key = strkey(getelem(keys, VNum(keyi.toDouble)))
|
|
1001
|
+
val v = inj.ival
|
|
1002
|
+
val c = new Inj
|
|
1003
|
+
c.mode = inj.mode; c.full = inj.full; c.keyi = keyi; c.keys = keys; c.key = VStr(key)
|
|
1004
|
+
c.ival = getprop(v, VStr(key)); c.parent = v
|
|
1005
|
+
c.path = inj.path match { case VList(b) => mkList(b.toSeq :+ VStr(key)); case _ => mkList(Seq(VStr(key))) }
|
|
1006
|
+
c.nodes = inj.nodes match { case VList(b) => mkList(b.toSeq :+ v); case _ => mkList(Seq(v)) }
|
|
1007
|
+
c.handler = inj.handler; c.errs = inj.errs; c.meta = inj.meta; c.base = inj.base
|
|
1008
|
+
c.modify = inj.modify; c.prior = Some(inj)
|
|
1009
|
+
c.dpath = inj.dpath match { case VList(b) => mkList(b.toSeq); case _ => inj.dpath }
|
|
1010
|
+
c.dparent = inj.dparent; c.extra = inj.extra
|
|
1011
|
+
c
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
private def injSetval(inj: Inj, v: Value, ancestor: Int = 1): Value = {
|
|
1015
|
+
val (target, key) =
|
|
1016
|
+
if (ancestor < 2) (inj.parent, inj.key)
|
|
1017
|
+
else (getelem(inj.nodes, VNum((-ancestor).toDouble)), getelem(inj.path, VNum((-ancestor).toDouble)))
|
|
1018
|
+
if (isNoval(v)) delprop(target, key) else setprop(target, key, v)
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// ---------------------------------------------------------------------------
|
|
1022
|
+
// inject
|
|
1023
|
+
// ---------------------------------------------------------------------------
|
|
1024
|
+
|
|
1025
|
+
def inject(v: Value, store: Value, inj: InjArg = INone): Value = {
|
|
1026
|
+
val state: Inj = inj match {
|
|
1027
|
+
case IInj(i) => i
|
|
1028
|
+
case _ =>
|
|
1029
|
+
val parent = mkMap(Seq((S_DTOP, v)))
|
|
1030
|
+
val i = newInj(v, parent)
|
|
1031
|
+
i.dparent = store
|
|
1032
|
+
i.errs = getprop(store, VStr(S_DERRS), emptyList())
|
|
1033
|
+
i.meta match { case VMap(m) => m.put("__d", VNum(0.0)); case _ => }
|
|
1034
|
+
inj match {
|
|
1035
|
+
case IDef(d) =>
|
|
1036
|
+
d.dModify match { case Some(_) => i.modify = d.dModify; case None => }
|
|
1037
|
+
if (!isNoval(d.dExtra)) i.extra = d.dExtra
|
|
1038
|
+
if (!isNoval(d.dMeta)) i.meta = d.dMeta
|
|
1039
|
+
d.dHandler match { case Some(h) => i.handler = h; case None => }
|
|
1040
|
+
case _ =>
|
|
1041
|
+
}
|
|
1042
|
+
i
|
|
1043
|
+
}
|
|
1044
|
+
injDescend(state)
|
|
1045
|
+
|
|
1046
|
+
val rv: Value =
|
|
1047
|
+
if (isnode(v)) {
|
|
1048
|
+
var nodekeys: Seq[String] = v match {
|
|
1049
|
+
case VMap(m) =>
|
|
1050
|
+
val ks = m.keysIterator.toSeq
|
|
1051
|
+
val normal = ks.filter(k => k.indexOf('$') < 0).sorted
|
|
1052
|
+
val trans = ks.filter(k => k.indexOf('$') >= 0).sorted
|
|
1053
|
+
normal ++ trans
|
|
1054
|
+
case VList(b) => b.indices.map(_.toString)
|
|
1055
|
+
case _ => Seq.empty
|
|
1056
|
+
}
|
|
1057
|
+
var nki = 0
|
|
1058
|
+
while (nki < nodekeys.length) {
|
|
1059
|
+
val childinj = injChild(state, nki, mkList(nodekeys.map(s => VStr(s))))
|
|
1060
|
+
val nodekey = childinj.key
|
|
1061
|
+
childinj.mode = M_KEYPRE
|
|
1062
|
+
val prekey = injectstr(jsString(nodekey), store, Some(childinj))
|
|
1063
|
+
nodekeys = (childinj.keys match { case VList(b) => b.toSeq; case _ => Seq.empty }).map(jsString)
|
|
1064
|
+
if (!isNoval(prekey)) {
|
|
1065
|
+
childinj.ival = getprop(v, prekey)
|
|
1066
|
+
childinj.mode = M_VAL
|
|
1067
|
+
inject(childinj.ival, store, IInj(childinj))
|
|
1068
|
+
nodekeys = (childinj.keys match { case VList(b) => b.toSeq; case _ => Seq.empty }).map(jsString)
|
|
1069
|
+
childinj.mode = M_KEYPOST
|
|
1070
|
+
injectstr(jsString(nodekey), store, Some(childinj))
|
|
1071
|
+
nodekeys = (childinj.keys match { case VList(b) => b.toSeq; case _ => Seq.empty }).map(jsString)
|
|
1072
|
+
}
|
|
1073
|
+
nki = childinj.keyi + 1
|
|
1074
|
+
}
|
|
1075
|
+
v
|
|
1076
|
+
} else v match {
|
|
1077
|
+
case VStr(_) =>
|
|
1078
|
+
state.mode = M_VAL
|
|
1079
|
+
val nv = injectstr(jsString(v), store, Some(state))
|
|
1080
|
+
if (!isSkip(nv)) injSetval(state, nv)
|
|
1081
|
+
nv
|
|
1082
|
+
case _ => v
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
state.modify match {
|
|
1086
|
+
case Some(f) if !isSkip(rv) =>
|
|
1087
|
+
val mkey = state.key; val mparent = state.parent; val mval = getprop(mparent, mkey)
|
|
1088
|
+
f(mval, mkey, mparent, state)
|
|
1089
|
+
case _ =>
|
|
1090
|
+
}
|
|
1091
|
+
state.ival = rv
|
|
1092
|
+
lookup_(state.parent, VStr(S_DTOP))
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
private def injectHandler(inj: Inj, v: Value, refstr: String, store: Value): Value = {
|
|
1096
|
+
val iscmd = isfunc(v) && (refstr == "" || startsWith(refstr, S_DS))
|
|
1097
|
+
if (iscmd) v match { case VFunc(f) => f(inj, v, refstr, store); case _ => v }
|
|
1098
|
+
else if (inj.mode == M_VAL && inj.full) { injSetval(inj, v); v }
|
|
1099
|
+
else v
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
private def injectstr(v: String, store: Value, injOpt: Option[Inj]): Value = {
|
|
1103
|
+
if (v == S_MT) VStr(S_MT)
|
|
1104
|
+
else injectionFull(v) match {
|
|
1105
|
+
case Some(pathref0) =>
|
|
1106
|
+
injOpt.foreach(_.full = true)
|
|
1107
|
+
val pathref = if (pathref0.length > 3) replaceAll(replaceAll(pathref0, "$BT", S_BT), "$DS", S_DS) else pathref0
|
|
1108
|
+
val ia = injOpt match { case Some(i) => IInj(i); case None => INone }
|
|
1109
|
+
getpath(store, VStr(pathref), ia)
|
|
1110
|
+
case None =>
|
|
1111
|
+
val out = injectionPartialReplace(v, ref0 => {
|
|
1112
|
+
val refp = if (ref0.length > 3) replaceAll(replaceAll(ref0, "$BT", S_BT), "$DS", S_DS) else ref0
|
|
1113
|
+
injOpt.foreach(_.full = false)
|
|
1114
|
+
val ia = injOpt match { case Some(i) => IInj(i); case None => INone }
|
|
1115
|
+
getpath(store, VStr(refp), ia) match {
|
|
1116
|
+
case Noval => S_MT
|
|
1117
|
+
case VStr(s) => if (s == "__NULL__") "null" else s
|
|
1118
|
+
case VFunc(_) => S_MT
|
|
1119
|
+
case found => try jsonEncode(found) catch { case _: Throwable => stringify(found) }
|
|
1120
|
+
}
|
|
1121
|
+
})
|
|
1122
|
+
injOpt match {
|
|
1123
|
+
case Some(i) => i.full = true; i.handler(i, VStr(out), v, store)
|
|
1124
|
+
case None => VStr(out)
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// ---------------------------------------------------------------------------
|
|
1130
|
+
// transform commands
|
|
1131
|
+
// ---------------------------------------------------------------------------
|
|
1132
|
+
|
|
1133
|
+
private val transformDelete: Injector = (inj, _v, _r, _s) => { delprop(inj.parent, inj.key); Noval }
|
|
1134
|
+
|
|
1135
|
+
private val transformCopy: Injector = (inj, _v, _r, _s) => {
|
|
1136
|
+
if (inj.mode == M_KEYPRE || inj.mode == M_KEYPOST) inj.key
|
|
1137
|
+
else { val out = lookup_(inj.dparent, inj.key); injSetval(inj, out); out }
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
private val transformKey: Injector = (inj, _v, _r, _s) => {
|
|
1141
|
+
if (inj.mode != M_VAL) Noval
|
|
1142
|
+
else {
|
|
1143
|
+
val keyspec = lookup_(inj.parent, VStr(S_BKEY))
|
|
1144
|
+
if (!isNoval(keyspec)) { delprop(inj.parent, VStr(S_BKEY)); getprop(inj.dparent, keyspec) }
|
|
1145
|
+
else {
|
|
1146
|
+
val anno = lookup_(inj.parent, VStr(S_BANNO))
|
|
1147
|
+
val fromanno = lookup_(anno, VStr(S_KEY))
|
|
1148
|
+
if (!isNoval(fromanno)) fromanno else getelem(inj.path, VNum(-2.0))
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
private val transformAnno: Injector = (inj, _v, _r, _s) => { delprop(inj.parent, VStr(S_BANNO)); Noval }
|
|
1154
|
+
|
|
1155
|
+
private val transformMerge: Injector = (inj, _v, _r, _s) => {
|
|
1156
|
+
if (inj.mode == M_KEYPRE) inj.key
|
|
1157
|
+
else if (inj.mode == M_KEYPOST) {
|
|
1158
|
+
val args0 = getprop(inj.parent, inj.key)
|
|
1159
|
+
val args = if (islist(args0)) args0 else mkList(Seq(args0))
|
|
1160
|
+
injSetval(inj, Noval)
|
|
1161
|
+
val mergelist = flatten(mkList(Seq(mkList(Seq(inj.parent)), args, mkList(Seq(clone(inj.parent))))))
|
|
1162
|
+
merge(mergelist)
|
|
1163
|
+
inj.key
|
|
1164
|
+
} else Noval
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
private val transformEach: Injector = (inj, _v, _r, store) => {
|
|
1168
|
+
if (islist(inj.keys)) slice(inj.keys, VNum(0.0), VNum(1.0), mutate = true)
|
|
1169
|
+
if (inj.mode != M_VAL) Noval
|
|
1170
|
+
else {
|
|
1171
|
+
val parent = inj.parent
|
|
1172
|
+
val srcpath = if (size(parent) > 1) getelem(parent, VNum(1.0)) else Noval
|
|
1173
|
+
val childTm = if (size(parent) > 2) clone(getelem(parent, VNum(2.0))) else Noval
|
|
1174
|
+
val srcstore = getprop(store, inj.base, store)
|
|
1175
|
+
val src = getpath(srcstore, srcpath, IInj(inj))
|
|
1176
|
+
val tkey = getelem(inj.path, VNum(-2.0))
|
|
1177
|
+
val nodes = inj.nodes
|
|
1178
|
+
val target = { val t = getelem(nodes, VNum(-2.0)); if (isNullish(t)) getelem(nodes, VNum(-1.0)) else t }
|
|
1179
|
+
val tval = ArrayBuffer.empty[Value]
|
|
1180
|
+
var rval: Value = emptyList()
|
|
1181
|
+
if (isnode(src)) {
|
|
1182
|
+
src match {
|
|
1183
|
+
case VList(b) => b.foreach(_ => tval.append(clone(childTm)))
|
|
1184
|
+
case VMap(m) => m.foreach { case (k, _) =>
|
|
1185
|
+
val cc = clone(childTm)
|
|
1186
|
+
if (ismap(cc)) setprop(cc, VStr(S_BANNO), mkMap(Seq((S_KEY, VStr(k)))))
|
|
1187
|
+
tval.append(cc)
|
|
1188
|
+
}
|
|
1189
|
+
case _ =>
|
|
1190
|
+
}
|
|
1191
|
+
val tvalv = VList(tval)
|
|
1192
|
+
val tcurrent = src match { case VMap(m) => mkList(m.valuesIterator.toSeq); case VList(b) => mkList(b.toSeq); case _ => src }
|
|
1193
|
+
if (tval.nonEmpty) {
|
|
1194
|
+
val path = inj.path
|
|
1195
|
+
val ckey = getelem(path, VNum(-2.0))
|
|
1196
|
+
val plist = path match { case VList(b) => b.toSeq; case _ => Seq.empty }
|
|
1197
|
+
val tpath = mkList(if (plist.isEmpty) Seq.empty else plist.take(plist.length - 1))
|
|
1198
|
+
val dpath = ArrayBuffer[Value](VStr(S_DTOP))
|
|
1199
|
+
srcpath match { case VStr(sp) if sp != S_MT => sp.split("\\.", -1).foreach(p => if (p != S_MT) dpath.append(VStr(p))); case _ => }
|
|
1200
|
+
if (!isNoval(ckey)) dpath.append(VStr("$:" + jsString(ckey)))
|
|
1201
|
+
var tcur: Value = mkMap(Seq((jsString(ckey), tcurrent)))
|
|
1202
|
+
if (size(tpath) > 1) {
|
|
1203
|
+
val pkey = getelem(path, VNum(-3.0), VStr(S_DTOP))
|
|
1204
|
+
dpath.append(VStr("$:" + jsString(pkey)))
|
|
1205
|
+
tcur = mkMap(Seq((jsString(pkey), tcur)))
|
|
1206
|
+
}
|
|
1207
|
+
val tinj = injChild(inj, 0, if (!isNoval(ckey)) mkList(Seq(ckey)) else emptyList())
|
|
1208
|
+
tinj.path = tpath
|
|
1209
|
+
val nlist = nodes match { case VList(b) => b.toSeq; case _ => Seq.empty }
|
|
1210
|
+
tinj.nodes = mkList(if (nlist.isEmpty) Seq.empty else nlist.take(nlist.length - 1))
|
|
1211
|
+
tinj.parent = if (size(tinj.nodes) > 0) getelem(tinj.nodes, VNum(-1.0)) else Noval
|
|
1212
|
+
if (!isNoval(ckey) && !isNoval(tinj.parent)) setprop(tinj.parent, ckey, tvalv)
|
|
1213
|
+
tinj.ival = tvalv
|
|
1214
|
+
tinj.dpath = VList(dpath)
|
|
1215
|
+
tinj.dparent = tcur
|
|
1216
|
+
inject(tvalv, store, IInj(tinj))
|
|
1217
|
+
rval = tinj.ival
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
setprop(target, tkey, rval)
|
|
1221
|
+
if (islist(rval) && size(rval) > 0) getelem(rval, VNum(0.0)) else Noval
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
private val transformPack: Injector = (inj, _v, _r, store) => {
|
|
1226
|
+
if (inj.mode != M_KEYPRE || !(inj.key match { case VStr(_) => true; case _ => false })) Noval
|
|
1227
|
+
else {
|
|
1228
|
+
val parent = inj.parent; val path = inj.path; val nodes = inj.nodes
|
|
1229
|
+
val argsVal = getprop(parent, inj.key)
|
|
1230
|
+
if (!islist(argsVal) || size(argsVal) < 2) Noval
|
|
1231
|
+
else {
|
|
1232
|
+
val srcpath = getelem(argsVal, VNum(0.0))
|
|
1233
|
+
val origchildspec = getelem(argsVal, VNum(1.0))
|
|
1234
|
+
val tkey = getelem(path, VNum(-2.0))
|
|
1235
|
+
val pathsize = size(path)
|
|
1236
|
+
val target = { val t = getelem(nodes, VNum((pathsize - 2).toDouble)); if (isNullish(t)) getelem(nodes, VNum((pathsize - 1).toDouble)) else t }
|
|
1237
|
+
val srcstore = getprop(store, inj.base, store)
|
|
1238
|
+
val src0 = getpath(srcstore, srcpath, IInj(inj))
|
|
1239
|
+
val src =
|
|
1240
|
+
if (!islist(src0)) {
|
|
1241
|
+
if (ismap(src0)) mkList(itemsPairs(src0).map { case (k, node) =>
|
|
1242
|
+
setprop(node, VStr(S_BANNO), mkMap(Seq((S_KEY, VStr(k))))); node
|
|
1243
|
+
})
|
|
1244
|
+
else Noval
|
|
1245
|
+
} else src0
|
|
1246
|
+
if (isNoval(src)) Noval
|
|
1247
|
+
else {
|
|
1248
|
+
val keypath = getprop(origchildspec, VStr(S_BKEY))
|
|
1249
|
+
val childspec = delprop(origchildspec, VStr(S_BKEY))
|
|
1250
|
+
val child = getprop(childspec, VStr(S_BVAL), childspec)
|
|
1251
|
+
val tval = emptyMap()
|
|
1252
|
+
itemsPairs(src).foreach { case (srckey, srcnode) =>
|
|
1253
|
+
val k =
|
|
1254
|
+
if (isNoval(keypath)) VStr(srckey)
|
|
1255
|
+
else keypath match {
|
|
1256
|
+
case VStr(kp) if startsWith(kp, S_BT) =>
|
|
1257
|
+
inject(VStr(kp), merge(mkList(Seq(emptyMap(), store, mkMap(Seq((S_DTOP, srcnode))))), VNum(1.0)))
|
|
1258
|
+
case _ => getpath(srcnode, keypath, IInj(inj))
|
|
1259
|
+
}
|
|
1260
|
+
val tchild = clone(child)
|
|
1261
|
+
setprop(tval, k, tchild)
|
|
1262
|
+
val anno = getprop(srcnode, VStr(S_BANNO))
|
|
1263
|
+
if (isNoval(anno)) delprop(tchild, VStr(S_BANNO)) else setprop(tchild, VStr(S_BANNO), anno)
|
|
1264
|
+
}
|
|
1265
|
+
var rval: Value = emptyMap()
|
|
1266
|
+
if (!isempty(tval)) {
|
|
1267
|
+
val tsrc = emptyMap()
|
|
1268
|
+
val srcSeq = src match { case VList(b) => b.toSeq; case _ => Seq.empty }
|
|
1269
|
+
srcSeq.zipWithIndex.foreach { case (node, i) =>
|
|
1270
|
+
val kn =
|
|
1271
|
+
if (isNoval(keypath)) vint(i)
|
|
1272
|
+
else keypath match {
|
|
1273
|
+
case VStr(kp) if startsWith(kp, S_BT) =>
|
|
1274
|
+
inject(VStr(kp), merge(mkList(Seq(emptyMap(), store, mkMap(Seq((S_DTOP, node))))), VNum(1.0)))
|
|
1275
|
+
case _ => getpath(node, keypath, IInj(inj))
|
|
1276
|
+
}
|
|
1277
|
+
setprop(tsrc, kn, node)
|
|
1278
|
+
}
|
|
1279
|
+
val tpath = slice(inj.path, VNum(-1.0))
|
|
1280
|
+
val ckey = getelem(inj.path, VNum(-2.0))
|
|
1281
|
+
val dpath = ArrayBuffer[Value](VStr(S_DTOP))
|
|
1282
|
+
srcpath match { case VStr(sp) => sp.split("\\.", -1).foreach(p => if (p != S_MT) dpath.append(VStr(p))); case _ => }
|
|
1283
|
+
dpath.append(VStr("$:" + jsString(ckey)))
|
|
1284
|
+
var tcur: Value = mkMap(Seq((jsString(ckey), tsrc)))
|
|
1285
|
+
if (size(tpath) > 1) {
|
|
1286
|
+
val pkey = getelem(inj.path, VNum(-3.0), VStr(S_DTOP))
|
|
1287
|
+
dpath.append(VStr("$:" + jsString(pkey)))
|
|
1288
|
+
tcur = mkMap(Seq((jsString(pkey), tcur)))
|
|
1289
|
+
}
|
|
1290
|
+
val tinj = injChild(inj, 0, mkList(Seq(ckey)))
|
|
1291
|
+
tinj.path = tpath
|
|
1292
|
+
tinj.nodes = slice(inj.nodes, VNum(-1.0))
|
|
1293
|
+
tinj.parent = getelem(tinj.nodes, VNum(-1.0))
|
|
1294
|
+
tinj.ival = tval
|
|
1295
|
+
tinj.dpath = VList(dpath)
|
|
1296
|
+
tinj.dparent = tcur
|
|
1297
|
+
inject(tval, store, IInj(tinj))
|
|
1298
|
+
rval = tinj.ival
|
|
1299
|
+
}
|
|
1300
|
+
setprop(target, tkey, rval)
|
|
1301
|
+
Noval
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
private val transformRef: Injector = (inj, v, _r, store) => {
|
|
1308
|
+
if (inj.mode != M_VAL) Noval
|
|
1309
|
+
else {
|
|
1310
|
+
val nodes = inj.nodes
|
|
1311
|
+
val refpath = lookup_(inj.parent, VNum(1.0))
|
|
1312
|
+
inj.keyi = size(inj.keys)
|
|
1313
|
+
getprop(store, VStr(S_DSPEC)) match {
|
|
1314
|
+
case VFunc(f) =>
|
|
1315
|
+
val spec = f(inj, Noval, "", Noval)
|
|
1316
|
+
val refv = getpath(spec, refpath, INone)
|
|
1317
|
+
var hasSub = false
|
|
1318
|
+
if (isnode(refv)) walk(refv, before = Some((_k, v2, _p, _path) => { if (v2 == VStr("`$REF`")) hasSub = true; v2 }))
|
|
1319
|
+
val tref = clone(refv)
|
|
1320
|
+
val cpath = slice(inj.path, VNum(0.0), VNum((size(inj.path) - 3).toDouble))
|
|
1321
|
+
val tpath = slice(inj.path, VNum(0.0), VNum((size(inj.path) - 1).toDouble))
|
|
1322
|
+
val tcur = getpath(store, cpath, INone)
|
|
1323
|
+
val tval = getpath(store, tpath, INone)
|
|
1324
|
+
var rval: Value = Noval
|
|
1325
|
+
if (!isNoval(refv) && (!hasSub || !isNoval(tval))) {
|
|
1326
|
+
val cs = injChild(inj, 0, mkList(Seq(getelem(tpath, VNum(-1.0)))))
|
|
1327
|
+
cs.path = tpath
|
|
1328
|
+
cs.nodes = slice(inj.nodes, VNum(0.0), VNum((size(inj.nodes) - 1).toDouble))
|
|
1329
|
+
cs.parent = getelem(nodes, VNum(-2.0))
|
|
1330
|
+
cs.ival = tref
|
|
1331
|
+
cs.dparent = tcur
|
|
1332
|
+
inject(tref, store, IInj(cs))
|
|
1333
|
+
rval = cs.ival
|
|
1334
|
+
}
|
|
1335
|
+
injSetval(inj, rval, 2)
|
|
1336
|
+
inj.prior match {
|
|
1337
|
+
case Some(p) if islist(inj.parent) => p.keyi = p.keyi - 1
|
|
1338
|
+
case _ =>
|
|
1339
|
+
}
|
|
1340
|
+
v
|
|
1341
|
+
case _ => Noval
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
private def jsstr(v: Value): String = v match {
|
|
1347
|
+
case VNull => "null"; case VBool(b) => if (b) "true" else "false"; case _ => jsString(v)
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
private val formatterTbl: Seq[(String, (Value, Value) => Value)] = Seq(
|
|
1351
|
+
"identity" -> ((_k, v) => v),
|
|
1352
|
+
"upper" -> ((_k, v) => if (isnode(v)) v else VStr(jsstr(v).toUpperCase)),
|
|
1353
|
+
"lower" -> ((_k, v) => if (isnode(v)) v else VStr(jsstr(v).toLowerCase)),
|
|
1354
|
+
"string" -> ((_k, v) => if (isnode(v)) v else VStr(jsstr(v))),
|
|
1355
|
+
"number" -> ((_k, v) => if (isnode(v)) v else { val n = try jsstr(v).toDouble catch { case _: Throwable => 0.0 }; VNum(if (n.isNaN) 0.0 else n) }),
|
|
1356
|
+
"integer" -> ((_k, v) => if (isnode(v)) v else { val n = try jsstr(v).toDouble catch { case _: Throwable => 0.0 }; VNum((if (n.isNaN) 0.0 else n).toInt.toDouble) }),
|
|
1357
|
+
"concat" -> ((k, v) => if (isNoval(k) && islist(v)) VStr(join(itemsV(v, { case (_, x) => if (isnode(x)) VStr(S_MT) else VStr(jsstr(x)) }), VStr(S_MT))) else v)
|
|
1358
|
+
)
|
|
1359
|
+
|
|
1360
|
+
def checkPlacement(modes: Int, ijname: String, parentTypes: Int, inj: Inj): Boolean = {
|
|
1361
|
+
val modenum = inj.mode
|
|
1362
|
+
if ((modes & modenum) == 0) {
|
|
1363
|
+
val allowed = Seq(M_KEYPRE, M_KEYPOST, M_VAL).filter(m => (modes & m) != 0)
|
|
1364
|
+
val placements = allowed.map(m => if (m == M_VAL) "value" else "key").mkString(",")
|
|
1365
|
+
val cur = if (modenum == M_VAL) "value" else "key"
|
|
1366
|
+
setprop(inj.errs, VNum(size(inj.errs).toDouble), VStr(s"$$$ijname: invalid placement as $cur, expected: $placements."))
|
|
1367
|
+
false
|
|
1368
|
+
} else if (!isempty(VNum(parentTypes.toDouble))) {
|
|
1369
|
+
val ptype = typify(inj.parent)
|
|
1370
|
+
if ((parentTypes & ptype) == 0) {
|
|
1371
|
+
setprop(inj.errs, VNum(size(inj.errs).toDouble), VStr(s"$$$ijname: invalid placement in parent ${typename(ptype)}, expected: ${typename(parentTypes)}."))
|
|
1372
|
+
false
|
|
1373
|
+
} else true
|
|
1374
|
+
} else true
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
def injectorArgs(argTypes: Seq[Int], args: Value): Value = {
|
|
1378
|
+
val numargs = argTypes.length
|
|
1379
|
+
val found = ArrayBuffer.fill[Value](1 + numargs)(Noval)
|
|
1380
|
+
var stop = false
|
|
1381
|
+
var argi = 0
|
|
1382
|
+
while (argi < numargs && !stop) {
|
|
1383
|
+
val arg = getelem(args, VNum(argi.toDouble))
|
|
1384
|
+
val argType = typify(arg)
|
|
1385
|
+
if ((argTypes(argi) & argType) == 0) {
|
|
1386
|
+
found(0) = VStr(s"invalid argument: ${stringify(arg, VNum(22.0))} (${typename(argType)} at position ${1 + argi}) is not of type: ${typename(argTypes(argi))}.")
|
|
1387
|
+
stop = true
|
|
1388
|
+
} else { found(1 + argi) = arg; argi += 1 }
|
|
1389
|
+
}
|
|
1390
|
+
VList(found)
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
def injectChild(child: Value, store: Value, inj: Inj): Inj = {
|
|
1394
|
+
var cinj = inj
|
|
1395
|
+
inj.prior match {
|
|
1396
|
+
case Some(prior) =>
|
|
1397
|
+
prior.prior match {
|
|
1398
|
+
case Some(pprior) =>
|
|
1399
|
+
val c = injChild(pprior, prior.keyi, prior.keys); c.ival = child
|
|
1400
|
+
setprop(c.parent, prior.key, child); cinj = c
|
|
1401
|
+
case None =>
|
|
1402
|
+
val c = injChild(prior, inj.keyi, inj.keys); c.ival = child
|
|
1403
|
+
setprop(c.parent, inj.key, child); cinj = c
|
|
1404
|
+
}
|
|
1405
|
+
case None =>
|
|
1406
|
+
}
|
|
1407
|
+
inject(child, store, IInj(cinj))
|
|
1408
|
+
cinj
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
private val transformFormat: Injector = (inj, _v, _r, store) => {
|
|
1412
|
+
slice(inj.keys, VNum(0.0), VNum(1.0), mutate = true)
|
|
1413
|
+
if (inj.mode != M_VAL) Noval
|
|
1414
|
+
else {
|
|
1415
|
+
val name = lookup_(inj.parent, VNum(1.0))
|
|
1416
|
+
val child = lookup_(inj.parent, VNum(2.0))
|
|
1417
|
+
val tkey = getelem(inj.path, VNum(-2.0))
|
|
1418
|
+
val target = { val t = getelem(inj.nodes, VNum(-2.0)); if (isNullish(t)) getelem(inj.nodes, VNum(-1.0)) else t }
|
|
1419
|
+
val cinj = injectChild(child, store, inj)
|
|
1420
|
+
val resolved = cinj.ival
|
|
1421
|
+
val formatter: Option[(Value, Value) => Value] =
|
|
1422
|
+
if ((T_function & typify(name)) > 0) Some((k, v) => name match { case VFunc(f) => f(dummyInj, v, jsString(k), Noval); case _ => v })
|
|
1423
|
+
else formatterTbl.find(_._1 == jsString(name)).map(_._2)
|
|
1424
|
+
formatter match {
|
|
1425
|
+
case None => setprop(inj.errs, VNum(size(inj.errs).toDouble), VStr(s"$$FORMAT: unknown format: ${jsString(name)}.")); Noval
|
|
1426
|
+
case Some(f) =>
|
|
1427
|
+
val out = walk(resolved, before = Some((k, v, _p, _path) => f(k, v)))
|
|
1428
|
+
setprop(target, tkey, out); out
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
private val transformApply: Injector = (inj, _v, _r, store) => {
|
|
1434
|
+
if (!checkPlacement(M_VAL, "APPLY", T_list, inj)) Noval
|
|
1435
|
+
else {
|
|
1436
|
+
val res = injectorArgs(Seq(T_function, T_any), slice(inj.parent, VNum(1.0)))
|
|
1437
|
+
val err = getelem(res, VNum(0.0))
|
|
1438
|
+
val applyFn = getelem(res, VNum(1.0))
|
|
1439
|
+
val child = if (size(res) > 2) getelem(res, VNum(2.0)) else Noval
|
|
1440
|
+
if (!isNoval(err)) { setprop(inj.errs, VNum(size(inj.errs).toDouble), VStr("$APPLY: " + jsString(err))); Noval }
|
|
1441
|
+
else {
|
|
1442
|
+
val tkey = getelem(inj.path, VNum(-2.0))
|
|
1443
|
+
val target = { val t = getelem(inj.nodes, VNum(-2.0)); if (isNullish(t)) getelem(inj.nodes, VNum(-1.0)) else t }
|
|
1444
|
+
val cinj = injectChild(child, store, inj)
|
|
1445
|
+
val resolved = cinj.ival
|
|
1446
|
+
val out = applyFn match { case VFunc(f) => f(cinj, resolved, "", store); case _ => Noval }
|
|
1447
|
+
setprop(target, tkey, out); out
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
def transform(data: Value, spec0: Value, inj: InjArg = INone): Value = {
|
|
1453
|
+
val origspec = spec0
|
|
1454
|
+
val spec = clone(spec0)
|
|
1455
|
+
val extra = inj match { case IDef(d) => d.dExtra; case _ => Noval }
|
|
1456
|
+
val collect = inj match { case IDef(d) => !isNoval(d.dErrs); case _ => false }
|
|
1457
|
+
val errs = inj match { case IDef(d) if collect => d.dErrs; case _ => emptyList() }
|
|
1458
|
+
val extraTransforms = emptyMap()
|
|
1459
|
+
val extraData = emptyMap()
|
|
1460
|
+
if (!isNoval(extra)) itemsPairs(extra).foreach { case (k, v) =>
|
|
1461
|
+
if (startsWith(k, S_DS)) setprop(extraTransforms, VStr(k), v) else setprop(extraData, VStr(k), v)
|
|
1462
|
+
}
|
|
1463
|
+
val dataClone = merge(mkList(Seq(if (isempty(extraData)) Noval else clone(extraData), clone(data))))
|
|
1464
|
+
val store = emptyMap()
|
|
1465
|
+
def put(k: String, v: Value): Unit = setprop(store, VStr(k), v)
|
|
1466
|
+
put(S_DTOP, dataClone)
|
|
1467
|
+
put(S_DSPEC, VFunc((_, _, _, _) => origspec))
|
|
1468
|
+
put("$BT", VFunc((_, _, _, _) => VStr(S_BT)))
|
|
1469
|
+
put("$DS", VFunc((_, _, _, _) => VStr(S_DS)))
|
|
1470
|
+
put("$WHEN", VFunc((_, _, _, _) => VStr("1970-01-01T00:00:00.000Z")))
|
|
1471
|
+
put("$DELETE", VFunc(transformDelete))
|
|
1472
|
+
put("$COPY", VFunc(transformCopy))
|
|
1473
|
+
put("$KEY", VFunc(transformKey))
|
|
1474
|
+
put("$ANNO", VFunc(transformAnno))
|
|
1475
|
+
put("$MERGE", VFunc(transformMerge))
|
|
1476
|
+
put("$EACH", VFunc(transformEach))
|
|
1477
|
+
put("$PACK", VFunc(transformPack))
|
|
1478
|
+
put("$REF", VFunc(transformRef))
|
|
1479
|
+
put("$FORMAT", VFunc(transformFormat))
|
|
1480
|
+
put("$APPLY", VFunc(transformApply))
|
|
1481
|
+
itemsPairs(extraTransforms).foreach { case (k, v) => put(k, v) }
|
|
1482
|
+
put(S_DERRS, errs)
|
|
1483
|
+
val idef = new InjDef
|
|
1484
|
+
idef.dErrs = errs
|
|
1485
|
+
inj match {
|
|
1486
|
+
case IDef(d) => idef.dMeta = d.dMeta; idef.dModify = d.dModify; idef.dHandler = d.dHandler; idef.dBase = d.dBase
|
|
1487
|
+
case _ =>
|
|
1488
|
+
}
|
|
1489
|
+
val out = inject(spec, store, IDef(idef))
|
|
1490
|
+
if (size(errs) > 0 && !collect) throw StructError(join(errs, VStr(" | ")))
|
|
1491
|
+
out
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
// ---------------------------------------------------------------------------
|
|
1495
|
+
// validate
|
|
1496
|
+
// ---------------------------------------------------------------------------
|
|
1497
|
+
|
|
1498
|
+
private def invalidTypeMsg(path: Value, needtype: String, vt: Int, v: Value, whence: String): String = {
|
|
1499
|
+
val vs = if (isNullish(v)) "no value" else stringify(v)
|
|
1500
|
+
"Expected " +
|
|
1501
|
+
(if (size(path) > 1) "field " + pathify(path, VNum(1.0)) + " to be " else "") +
|
|
1502
|
+
needtype + ", but found " +
|
|
1503
|
+
(if (!isNullish(v)) typename(vt) + S_VIZ else "") + vs + "."
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
private def pushErr(inj: Inj, msg: String): Unit = setprop(inj.errs, VNum(size(inj.errs).toDouble), VStr(msg))
|
|
1507
|
+
|
|
1508
|
+
private val validateString: Injector = (inj, _v, _r, _s) => {
|
|
1509
|
+
val out = lookup_(inj.dparent, inj.key)
|
|
1510
|
+
val t = typify(out)
|
|
1511
|
+
if ((T_string & t) == 0) { pushErr(inj, invalidTypeMsg(inj.path, S_string, t, out, "V1010")); Noval }
|
|
1512
|
+
else if (out == VStr(S_MT)) { pushErr(inj, "Empty string at " + pathify(inj.path, VNum(1.0))); Noval }
|
|
1513
|
+
else out
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
private val validateType: Injector = (inj, _v, refstr, _s) => {
|
|
1517
|
+
val tname = if (refstr.length > 1) refstr.substring(1).toLowerCase else "any"
|
|
1518
|
+
val idx = TYPENAME.indexOf(tname)
|
|
1519
|
+
val typev0 = if (idx >= 0) 1 << (31 - idx) else 0
|
|
1520
|
+
val typev = if (tname == S_nil) typev0 | T_null else typev0
|
|
1521
|
+
val out = lookup_(inj.dparent, inj.key)
|
|
1522
|
+
val t = typify(out)
|
|
1523
|
+
if ((t & typev) == 0) { pushErr(inj, invalidTypeMsg(inj.path, tname, t, out, "V1001")); Noval }
|
|
1524
|
+
else out
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
private val validateAny: Injector = (inj, _v, _r, _s) => lookup_(inj.dparent, inj.key)
|
|
1528
|
+
|
|
1529
|
+
private val validateChild: Injector = (inj, _v, _r, _s) => {
|
|
1530
|
+
val parent = inj.parent; val key = inj.key; val path = inj.path; val keys = inj.keys
|
|
1531
|
+
if (inj.mode == M_KEYPRE) {
|
|
1532
|
+
val childtm = getprop(parent, key)
|
|
1533
|
+
val pkey = getelem(path, VNum(-2.0))
|
|
1534
|
+
val tval = getprop(inj.dparent, pkey)
|
|
1535
|
+
if (isNoval(tval)) {
|
|
1536
|
+
keysof(emptyMap()).foreach { ckey => setprop(parent, VStr(ckey), clone(childtm)); setprop(keys, VNum(size(keys).toDouble), VStr(ckey)) }
|
|
1537
|
+
delprop(parent, key); Noval
|
|
1538
|
+
} else if (!ismap(tval)) {
|
|
1539
|
+
pushErr(inj, invalidTypeMsg(slice(path, VNum(0.0), VNum((size(path) - 1).toDouble)), S_object, typify(tval), tval, "V0220")); Noval
|
|
1540
|
+
} else {
|
|
1541
|
+
keysof(tval).foreach { ckey => setprop(parent, VStr(ckey), clone(childtm)); setprop(keys, VNum(size(keys).toDouble), VStr(ckey)) }
|
|
1542
|
+
delprop(parent, key); Noval
|
|
1543
|
+
}
|
|
1544
|
+
} else if (inj.mode == M_VAL) {
|
|
1545
|
+
val childtm = getprop(parent, VNum(1.0))
|
|
1546
|
+
if (!islist(parent)) { pushErr(inj, "Invalid $CHILD as value"); Noval }
|
|
1547
|
+
else if (isNoval(inj.dparent)) { parent match { case VList(b) => b.clear(); case _ => }; Noval }
|
|
1548
|
+
else if (!islist(inj.dparent)) {
|
|
1549
|
+
pushErr(inj, invalidTypeMsg(slice(path, VNum(0.0), VNum((size(path) - 1).toDouble)), S_list, typify(inj.dparent), inj.dparent, "V0230"))
|
|
1550
|
+
inj.keyi = size(parent); inj.dparent
|
|
1551
|
+
} else {
|
|
1552
|
+
itemsPairs(inj.dparent).foreach { case (k, _) => setprop(parent, VStr(k), clone(childtm)) }
|
|
1553
|
+
parent match { case VList(b) => val n = size(inj.dparent); if (b.length > n) b.remove(n, b.length - n); case _ => }
|
|
1554
|
+
inj.keyi = 0
|
|
1555
|
+
getprop(inj.dparent, VNum(0.0))
|
|
1556
|
+
}
|
|
1557
|
+
} else Noval
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
private val validateOne: Injector = (inj, _v, _r, store) => {
|
|
1561
|
+
if (inj.mode == M_VAL) {
|
|
1562
|
+
val parent = inj.parent
|
|
1563
|
+
if (!islist(parent) || inj.keyi != 0) { pushErr(inj, "The $ONE validator at field " + pathify(inj.path, VNum(1.0), VNum(1.0)) + " must be the first element of an array."); Noval }
|
|
1564
|
+
else {
|
|
1565
|
+
inj.keyi = size(inj.keys)
|
|
1566
|
+
injSetval(inj, inj.dparent, 2)
|
|
1567
|
+
inj.path = slice(inj.path, VNum(0.0), VNum((size(inj.path) - 1).toDouble))
|
|
1568
|
+
inj.key = getelem(inj.path, VNum(-1.0))
|
|
1569
|
+
val tvals = slice(parent, VNum(1.0))
|
|
1570
|
+
if (size(tvals) == 0) { pushErr(inj, "The $ONE validator at field " + pathify(inj.path, VNum(1.0), VNum(1.0)) + " must have at least one argument."); Noval }
|
|
1571
|
+
else {
|
|
1572
|
+
var matched = false
|
|
1573
|
+
(tvals match { case VList(b) => b.toSeq; case _ => Seq.empty }).foreach { tval =>
|
|
1574
|
+
if (!matched) {
|
|
1575
|
+
val terrs = emptyList()
|
|
1576
|
+
val vstore = merge(mkList(Seq(emptyMap(), store)), VNum(1.0))
|
|
1577
|
+
setprop(vstore, VStr(S_DTOP), inj.dparent)
|
|
1578
|
+
val d = new InjDef; d.dExtra = vstore; d.dErrs = terrs; d.dMeta = inj.meta
|
|
1579
|
+
val vcurrent = validate(inj.dparent, tval, IDef(d))
|
|
1580
|
+
injSetval(inj, vcurrent, -2)
|
|
1581
|
+
if (size(terrs) == 0) matched = true
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
if (!matched) {
|
|
1585
|
+
val valdesc = replaceTransformNames(itemsPairs(tvals).map { case (_, x) => stringify(x) }.mkString(", "))
|
|
1586
|
+
pushErr(inj, invalidTypeMsg(inj.path, (if (size(tvals) > 1) "one of " else "") + valdesc, typify(inj.dparent), inj.dparent, "V0210"))
|
|
1587
|
+
}
|
|
1588
|
+
Noval
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
} else Noval
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
private val validateExact: Injector = (inj, _v, _r, _s) => {
|
|
1595
|
+
if (inj.mode == M_VAL) {
|
|
1596
|
+
val parent = inj.parent
|
|
1597
|
+
if (!islist(parent) || inj.keyi != 0) { pushErr(inj, "The $EXACT validator at field " + pathify(inj.path, VNum(1.0), VNum(1.0)) + " must be the first element of an array."); Noval }
|
|
1598
|
+
else {
|
|
1599
|
+
inj.keyi = size(inj.keys)
|
|
1600
|
+
injSetval(inj, inj.dparent, 2)
|
|
1601
|
+
inj.path = slice(inj.path, VNum(0.0), VNum((size(inj.path) - 1).toDouble))
|
|
1602
|
+
inj.key = getelem(inj.path, VNum(-1.0))
|
|
1603
|
+
val tvals = slice(parent, VNum(1.0))
|
|
1604
|
+
if (size(tvals) == 0) { pushErr(inj, "The $EXACT validator at field " + pathify(inj.path, VNum(1.0), VNum(1.0)) + " must have at least one argument."); Noval }
|
|
1605
|
+
else {
|
|
1606
|
+
var matched = false
|
|
1607
|
+
(tvals match { case VList(b) => b.toSeq; case _ => Seq.empty }).foreach { tval => if (!matched && veq(tval, inj.dparent)) matched = true }
|
|
1608
|
+
if (!matched) {
|
|
1609
|
+
val valdesc = replaceTransformNames(itemsPairs(tvals).map { case (_, x) => stringify(x) }.mkString(", "))
|
|
1610
|
+
pushErr(inj, invalidTypeMsg(inj.path, (if (size(inj.path) > 1) "" else "value ") + "exactly equal to " + (if (size(tvals) == 1) "" else "one of ") + valdesc, typify(inj.dparent), inj.dparent, "V0110"))
|
|
1611
|
+
}
|
|
1612
|
+
Noval
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
} else { delprop(inj.parent, inj.key); Noval }
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
def veq(a: Value, b: Value): Boolean = (a, b) match {
|
|
1619
|
+
case (Noval, Noval) => true
|
|
1620
|
+
case (VNull, VNull) => true
|
|
1621
|
+
case (VBool(x), VBool(y)) => x == y
|
|
1622
|
+
case (VNum(x), VNum(y)) => x == y
|
|
1623
|
+
case (VStr(x), VStr(y)) => x == y
|
|
1624
|
+
case (VSentinel(x), VSentinel(y)) => x == y
|
|
1625
|
+
case (VList(x), VList(y)) => x.length == y.length && x.indices.forall(i => veq(x(i), y(i)))
|
|
1626
|
+
case (VMap(x), VMap(y)) =>
|
|
1627
|
+
x.size == y.size && x.forall { case (k, v) => y.get(k) match { case Some(w) => veq(v, w); case None => false } }
|
|
1628
|
+
case _ => false
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
private val validation: Modify = (pval, key, parent, inj) => {
|
|
1632
|
+
if (!isSkip(pval)) {
|
|
1633
|
+
val exact = getprop(inj.meta, VStr(S_BEXACT), VBool(false))
|
|
1634
|
+
val cval = getprop(inj.dparent, key)
|
|
1635
|
+
val exactB = exact match { case VBool(true) => true; case _ => false }
|
|
1636
|
+
if (!(!exactB && isNoval(cval))) {
|
|
1637
|
+
val ptype = typify(pval)
|
|
1638
|
+
if (!((T_string & ptype) > 0 && jsString(pval).indexOf('$') >= 0)) {
|
|
1639
|
+
val ctype = typify(cval)
|
|
1640
|
+
if (ptype != ctype && !isNoval(pval)) pushErr(inj, invalidTypeMsg(inj.path, typename(ptype), ctype, cval, "V0010"))
|
|
1641
|
+
else if (ismap(cval)) {
|
|
1642
|
+
if (!ismap(pval)) pushErr(inj, invalidTypeMsg(inj.path, typename(ptype), ctype, cval, "V0020"))
|
|
1643
|
+
else {
|
|
1644
|
+
val ckeys = keysof(cval)
|
|
1645
|
+
val pkeys = keysof(pval)
|
|
1646
|
+
if (pkeys.nonEmpty && !(getprop(pval, VStr(S_BOPEN)) == VBool(true))) {
|
|
1647
|
+
val badkeys = ckeys.filter(ck => isNoval(lookup_(pval, VStr(ck))))
|
|
1648
|
+
if (badkeys.nonEmpty) pushErr(inj, "Unexpected keys at field " + pathify(inj.path, VNum(1.0)) + S_VIZ + badkeys.mkString(", "))
|
|
1649
|
+
} else {
|
|
1650
|
+
merge(mkList(Seq(pval, cval)))
|
|
1651
|
+
if (isnode(pval)) delprop(pval, VStr(S_BOPEN))
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
} else if (islist(cval)) {
|
|
1655
|
+
if (!islist(pval)) pushErr(inj, invalidTypeMsg(inj.path, typename(ptype), ctype, cval, "V0030"))
|
|
1656
|
+
} else if (exactB) {
|
|
1657
|
+
if (!veq(cval, pval)) {
|
|
1658
|
+
val pathmsg = if (size(inj.path) > 1) "at field " + pathify(inj.path, VNum(1.0)) + ": " else ""
|
|
1659
|
+
pushErr(inj, "Value " + pathmsg + jsString(cval) + " should equal " + jsString(pval) + ".")
|
|
1660
|
+
}
|
|
1661
|
+
} else setprop(parent, key, cval)
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
private def validateHandler(inj: Inj, v: Value, refstr: String, store: Value): Value = {
|
|
1668
|
+
metaPathMatch(refstr) match {
|
|
1669
|
+
case Some((_, g2, _)) =>
|
|
1670
|
+
if (g2 == "=") injSetval(inj, mkList(Seq(VStr(S_BEXACT), v))) else injSetval(inj, v)
|
|
1671
|
+
inj.keyi = -1; SKIP
|
|
1672
|
+
case None => injectHandler(inj, v, refstr, store)
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
def validate(data: Value, spec: Value, inj: InjArg = INone): Value = {
|
|
1677
|
+
val extra = inj match { case IDef(d) => d.dExtra; case _ => Noval }
|
|
1678
|
+
val collect = inj match { case IDef(d) => !isNoval(d.dErrs); case _ => false }
|
|
1679
|
+
val errs = inj match { case IDef(d) if collect => d.dErrs; case _ => emptyList() }
|
|
1680
|
+
val base = emptyMap()
|
|
1681
|
+
def put(k: String, v: Value): Unit = setprop(base, VStr(k), v)
|
|
1682
|
+
Seq("$DELETE", "$COPY", "$KEY", "$META", "$MERGE", "$EACH", "$PACK").foreach(k => put(k, VNull))
|
|
1683
|
+
put("$STRING", VFunc(validateString))
|
|
1684
|
+
Seq("$NUMBER", "$INTEGER", "$DECIMAL", "$BOOLEAN", "$NULL", "$NIL", "$MAP", "$LIST", "$FUNCTION", "$INSTANCE").foreach(k => put(k, VFunc(validateType)))
|
|
1685
|
+
put("$ANY", VFunc(validateAny))
|
|
1686
|
+
put("$CHILD", VFunc(validateChild))
|
|
1687
|
+
put("$ONE", VFunc(validateOne))
|
|
1688
|
+
put("$EXACT", VFunc(validateExact))
|
|
1689
|
+
val store = merge(mkList(Seq(base, if (isNoval(extra)) emptyMap() else extra, mkMap(Seq((S_DERRS, errs))))), VNum(1.0))
|
|
1690
|
+
val meta = inj match { case IDef(d) if !isNoval(d.dMeta) => d.dMeta; case _ => emptyMap() }
|
|
1691
|
+
setprop(meta, VStr(S_BEXACT), getprop(meta, VStr(S_BEXACT), VBool(false)))
|
|
1692
|
+
val idef = new InjDef
|
|
1693
|
+
idef.dMeta = meta; idef.dExtra = store; idef.dModify = Some(validation); idef.dHandler = Some(validateHandler); idef.dErrs = errs
|
|
1694
|
+
val out = transform(data, spec, IDef(idef))
|
|
1695
|
+
if (size(errs) > 0 && !collect) throw StructError(join(errs, VStr(" | ")))
|
|
1696
|
+
out
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
// ---------------------------------------------------------------------------
|
|
1700
|
+
// select
|
|
1701
|
+
// ---------------------------------------------------------------------------
|
|
1702
|
+
|
|
1703
|
+
private val selectAnd: Injector = (inj, _v, _r, store) => {
|
|
1704
|
+
if (inj.mode == M_KEYPRE) {
|
|
1705
|
+
val terms = getprop(inj.parent, inj.key)
|
|
1706
|
+
val ppath = slice(inj.path, VNum(-1.0))
|
|
1707
|
+
val point = getpath(store, ppath, INone)
|
|
1708
|
+
val vstore = merge(mkList(Seq(emptyMap(), store)), VNum(1.0))
|
|
1709
|
+
setprop(vstore, VStr(S_DTOP), point)
|
|
1710
|
+
itemsPairs(terms).foreach { case (_, term) =>
|
|
1711
|
+
val terrs = emptyList()
|
|
1712
|
+
val d = new InjDef; d.dExtra = vstore; d.dErrs = terrs; d.dMeta = inj.meta
|
|
1713
|
+
validate(point, term, IDef(d))
|
|
1714
|
+
if (size(terrs) != 0) pushErr(inj, "AND:" + pathify(ppath) + "⨯" + stringify(point) + " fail:" + stringify(terms))
|
|
1715
|
+
}
|
|
1716
|
+
val gkey = getelem(inj.path, VNum(-2.0)); val gp = getelem(inj.nodes, VNum(-2.0))
|
|
1717
|
+
setprop(gp, gkey, point)
|
|
1718
|
+
}
|
|
1719
|
+
Noval
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
private val selectOr: Injector = (inj, _v, _r, store) => {
|
|
1723
|
+
if (inj.mode == M_KEYPRE) {
|
|
1724
|
+
val terms = getprop(inj.parent, inj.key)
|
|
1725
|
+
val ppath = slice(inj.path, VNum(-1.0))
|
|
1726
|
+
val point = getpath(store, ppath, INone)
|
|
1727
|
+
val vstore = merge(mkList(Seq(emptyMap(), store)), VNum(1.0))
|
|
1728
|
+
setprop(vstore, VStr(S_DTOP), point)
|
|
1729
|
+
var done = false
|
|
1730
|
+
itemsPairs(terms).foreach { case (_, term) =>
|
|
1731
|
+
if (!done) {
|
|
1732
|
+
val terrs = emptyList()
|
|
1733
|
+
val d = new InjDef; d.dExtra = vstore; d.dErrs = terrs; d.dMeta = inj.meta
|
|
1734
|
+
validate(point, term, IDef(d))
|
|
1735
|
+
if (size(terrs) == 0) {
|
|
1736
|
+
val gkey = getelem(inj.path, VNum(-2.0)); val gp = getelem(inj.nodes, VNum(-2.0))
|
|
1737
|
+
setprop(gp, gkey, point); done = true
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
if (!done) pushErr(inj, "OR:" + pathify(ppath) + "⨯" + stringify(point) + " fail:" + stringify(terms))
|
|
1742
|
+
}
|
|
1743
|
+
Noval
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
private val selectNot: Injector = (inj, _v, _r, store) => {
|
|
1747
|
+
if (inj.mode == M_KEYPRE) {
|
|
1748
|
+
val term = getprop(inj.parent, inj.key)
|
|
1749
|
+
val ppath = slice(inj.path, VNum(-1.0))
|
|
1750
|
+
val point = getpath(store, ppath, INone)
|
|
1751
|
+
val vstore = merge(mkList(Seq(emptyMap(), store)), VNum(1.0))
|
|
1752
|
+
setprop(vstore, VStr(S_DTOP), point)
|
|
1753
|
+
val terrs = emptyList()
|
|
1754
|
+
val d = new InjDef; d.dExtra = vstore; d.dErrs = terrs; d.dMeta = inj.meta
|
|
1755
|
+
validate(point, term, IDef(d))
|
|
1756
|
+
if (size(terrs) == 0) pushErr(inj, "NOT:" + pathify(ppath) + "⨯" + stringify(point) + " fail:" + stringify(term))
|
|
1757
|
+
val gkey = getelem(inj.path, VNum(-2.0)); val gp = getelem(inj.nodes, VNum(-2.0))
|
|
1758
|
+
setprop(gp, gkey, point)
|
|
1759
|
+
}
|
|
1760
|
+
Noval
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
private def numCmp(a: Value, b: Value, op: String): Boolean = (a, b) match {
|
|
1764
|
+
case (VNum(x), VNum(y)) => op match { case "gt" => x > y; case "lt" => x < y; case "gte" => x >= y; case "lte" => x <= y; case _ => false }
|
|
1765
|
+
case _ => false
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
private val selectCmp: Injector = (inj, _v, refstr, store) => {
|
|
1769
|
+
if (inj.mode == M_KEYPRE) {
|
|
1770
|
+
val term = getprop(inj.parent, inj.key)
|
|
1771
|
+
val gkey = getelem(inj.path, VNum(-2.0))
|
|
1772
|
+
val ppath = slice(inj.path, VNum(-1.0))
|
|
1773
|
+
val point = getpath(store, ppath, INone)
|
|
1774
|
+
val pass =
|
|
1775
|
+
if (refstr == "$GT") numCmp(point, term, "gt")
|
|
1776
|
+
else if (refstr == "$LT") numCmp(point, term, "lt")
|
|
1777
|
+
else if (refstr == "$GTE") numCmp(point, term, "gte")
|
|
1778
|
+
else if (refstr == "$LTE") numCmp(point, term, "lte")
|
|
1779
|
+
else if (refstr == "$LIKE") (term match { case VStr(t) => java.util.regex.Pattern.compile(t).matcher(stringify(point)).find(); case _ => false })
|
|
1780
|
+
else false
|
|
1781
|
+
if (pass) { val gp = getelem(inj.nodes, VNum(-2.0)); setprop(gp, gkey, point) }
|
|
1782
|
+
else pushErr(inj, "CMP: " + pathify(ppath) + "⨯" + stringify(point) + " fail:" + refstr + " " + stringify(term))
|
|
1783
|
+
}
|
|
1784
|
+
Noval
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
def select(children0: Value, query: Value): Value = {
|
|
1788
|
+
if (!isnode(children0)) emptyList()
|
|
1789
|
+
else {
|
|
1790
|
+
val children =
|
|
1791
|
+
if (ismap(children0)) mkList(itemsPairs(children0).map { case (k, n) => setprop(n, VStr(S_DKEY), VStr(k)); n })
|
|
1792
|
+
else mkList((children0 match { case VList(b) => b.toSeq; case _ => Seq.empty }).zipWithIndex.map { case (n, i) => if (ismap(n)) { setprop(n, VStr(S_DKEY), vint(i)); n } else n })
|
|
1793
|
+
val results = emptyList()
|
|
1794
|
+
val extra = emptyMap()
|
|
1795
|
+
Seq(("$AND", selectAnd), ("$OR", selectOr), ("$NOT", selectNot), ("$GT", selectCmp), ("$LT", selectCmp), ("$GTE", selectCmp), ("$LTE", selectCmp), ("$LIKE", selectCmp))
|
|
1796
|
+
.foreach { case (k, f) => setprop(extra, VStr(k), VFunc(f)) }
|
|
1797
|
+
val q = clone(query)
|
|
1798
|
+
walk(q, before = Some((_k, v, _p, _path) => { if (ismap(v)) setprop(v, VStr(S_BOPEN), getprop(v, VStr(S_BOPEN), VBool(true))); v }))
|
|
1799
|
+
(children match { case VList(b) => b.toSeq; case _ => Seq.empty }).foreach { child =>
|
|
1800
|
+
val errs = emptyList()
|
|
1801
|
+
val d = new InjDef
|
|
1802
|
+
d.dErrs = errs
|
|
1803
|
+
d.dMeta = { val m = emptyMap(); setprop(m, VStr(S_BEXACT), VBool(true)); m }
|
|
1804
|
+
d.dExtra = extra
|
|
1805
|
+
validate(child, clone(q), IDef(d))
|
|
1806
|
+
if (size(errs) == 0) setprop(results, VNum(size(results).toDouble), child)
|
|
1807
|
+
}
|
|
1808
|
+
results
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
// ---------------------------------------------------------------------------
|
|
1813
|
+
// builders
|
|
1814
|
+
// ---------------------------------------------------------------------------
|
|
1815
|
+
|
|
1816
|
+
def jm(kv: Value*): Value = {
|
|
1817
|
+
val m = LinkedHashMap.empty[String, Value]
|
|
1818
|
+
val arr = kv.toArray
|
|
1819
|
+
val n = arr.length
|
|
1820
|
+
var i = 0
|
|
1821
|
+
while (i < n) {
|
|
1822
|
+
val k0 = arr(i)
|
|
1823
|
+
val k = k0 match { case VNull => "null"; case VStr(s) => s; case _ => stringify(k0) }
|
|
1824
|
+
m.put(k, if (i + 1 < n) arr(i + 1) else VNull)
|
|
1825
|
+
i += 2
|
|
1826
|
+
}
|
|
1827
|
+
VMap(m)
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
def jt(v: Value*): Value = mkList(v)
|
|
1831
|
+
|
|
1832
|
+
def tn(t: Int): String = typename(t)
|
|
1833
|
+
}
|