diff --git a/Cargo.lock b/Cargo.lock index 60ce340b..05e1cda0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "addr2line" version = "0.25.1" @@ -39,29 +29,15 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "aes-gcm-siv" version = "0.11.1" @@ -77,15 +53,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "aes-kw" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fa2b352dcefb5f7f3a5fb840e02665d311d878955380515e4fd50095dd3d8c" -dependencies = [ - "aes", -] - [[package]] name = "ahash" version = "0.8.12" @@ -109,21 +76,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -243,18 +195,6 @@ dependencies = [ "password-hash", ] -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - [[package]] name = "askama" version = "0.14.0" @@ -297,18 +237,6 @@ dependencies = [ "winnow 0.7.13", ] -[[package]] -name = "ast_node" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fb5864e2f5bf9fd9797b94b2dfd1554d4c3092b535008b27d7e15c86675a2f" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common 1.0.0", - "syn", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -332,19 +260,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-compression" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c1f86859c1af3d514fa19e8323147ff10ea98684e6c7b307912509f50e67b2" -dependencies = [ - "compression-codecs", - "compression-core", - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "async-executor" version = "1.13.3" @@ -421,17 +336,6 @@ dependencies = [ "rustix 1.1.2", ] -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-signal" version = "0.2.13" @@ -477,28 +381,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-task" version = "4.7.1" @@ -541,64 +423,13 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "aws-lc-rs" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5932a7d9d28b0d2ea34c6b3779d35e3dd6f6345317c34e73438c4f1f29144151" -dependencies = [ - "aws-lc-sys", - "untrusted 0.7.1", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1826f2e4cfc2cd19ee53c42fbf68e2f81ec21108e0b7ecf6a71cf062137360fc" -dependencies = [ - "bindgen 0.72.1", - "cc", - "cmake", - "dunce", - "fs_extra", -] - -[[package]] -name = "axum" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" -dependencies = [ - "async-trait", - "axum-core 0.4.5", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "itoa", - "matchit 0.7.3", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower 0.5.2", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b098575ebe77cb6d14fc7f32749631a6e44edbef6b796f89b020e99ba20d425" dependencies = [ - "axum-core 0.5.5", + "axum-core", "bytes", "form_urlencoded", "futures-util", @@ -608,7 +439,7 @@ dependencies = [ "hyper", "hyper-util", "itoa", - "matchit 0.8.4", + "matchit", "memchr", "mime", "multer", @@ -620,32 +451,12 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tower 0.5.2", + "tower", "tower-layer", "tower-service", "tracing", ] -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.5.5" @@ -667,12 +478,12 @@ dependencies = [ [[package]] name = "axum-test" -version = "18.2.1" +version = "18.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d419a2aae56fdf2bca28b274fd3f57dbc5cb8f2143c1c8629c82dbc75992596" +checksum = "c0388808c0617a886601385c0024b9d0162480a763ba371f803d87b775115400" dependencies = [ "anyhow", - "axum 0.8.7", + "axum", "bytes", "bytesize", "cookie", @@ -690,7 +501,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "tokio", - "tower 0.5.2", + "tower", "url", ] @@ -700,53 +511,31 @@ version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ca2639ea8e778162fa734ddd5d77cb2fdf29ec39adb80192693834b6639ea6" dependencies = [ - "axum 0.8.7", + "axum", "futures-core", "futures-util", "http", - "opentelemetry 0.31.0", - "opentelemetry-semantic-conventions 0.31.0", + "opentelemetry", + "opentelemetry-semantic-conventions", "pin-project-lite", - "tower 0.5.2", + "tower", "tracing", "tracing-opentelemetry", "tracing-opentelemetry-instrumentation-sdk", ] -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base32" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022dfe9eb35f19ebbcb51e0b40a5ab759f46ad60cadf7297e0bd085afb50e076" - [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - [[package]] name = "base64ct" version = "1.8.0" @@ -768,44 +557,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -[[package]] -name = "better_scoped_tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd228125315b132eed175bf47619ac79b945b26e56b848ba203ae4ea8603609" -dependencies = [ - "scoped-tls", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -847,18 +598,6 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "blake2" version = "0.10.6" @@ -877,15 +616,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-padding" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" -dependencies = [ - "generic-array", -] - [[package]] name = "blocking" version = "1.6.2" @@ -905,37 +635,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc0b364ead1874514c8c2855ab558056ebfeb775653e7ae45ff72f28f8f3166c" -[[package]] -name = "boxed_error" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d4f95e880cfd28c4ca5a006cf7f6af52b4bcb7b5866f573b2faa126fb7affb" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "brotli" -version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bumpalo" version = "3.19.0" @@ -968,9 +667,9 @@ dependencies = [ [[package]] name = "bytesize" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99fa31e08a43eaa5913ef68d7e01c37a2bdce6ed648168239ad33b7d30a9cd8" +checksum = "00f4369ba008f82b968b1acbe31715ec37bd45236fa0726605a36cc3060ea256" [[package]] name = "camino" @@ -1059,26 +758,6 @@ dependencies = [ "winx", ] -[[package]] -name = "capacity_builder" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f2d24a6dcf0cd402a21b65d35340f3a49ff3475dc5fdac91d22d2733e6641c6" -dependencies = [ - "capacity_builder_macros", - "itoa", -] - -[[package]] -name = "capacity_builder_macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b4a6cae9efc04cc6cbb8faf338d2c497c165c83e74509cf4dbedea948bbf6e5" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "cargo-platform" version = "0.1.9" @@ -1096,7 +775,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.27", + "semver", "serde", "serde_json", ] @@ -1107,29 +786,11 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" -[[package]] -name = "castaway" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" -dependencies = [ - "rustversion", -] - -[[package]] -name = "cbc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" -dependencies = [ - "cipher", -] - [[package]] name = "cc" -version = "1.2.46" +version = "1.2.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97463e1064cb1b1c1384ad0a0b9c8abd0988e2a91f52606c80ef14aadb63e36" +checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07" dependencies = [ "find-msvc-tools", "jobserver", @@ -1243,9 +904,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.52" +version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8120877db0e5c011242f96806ce3c94e0737ab8108532a76a3300a01db2ab8" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" dependencies = [ "clap_builder", "clap_derive", @@ -1253,9 +914,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.52" +version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02576b399397b659c26064fbc92a75fede9d18ffd5f80ca1cd74ddab167016e1" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" dependencies = [ "anstream", "anstyle", @@ -1290,24 +951,6 @@ dependencies = [ "http", ] -[[package]] -name = "clipboard-win" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" -dependencies = [ - "error-code", -] - -[[package]] -name = "cmake" -version = "0.1.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" -dependencies = [ - "cc", -] - [[package]] name = "cobs" version = "0.3.0" @@ -1342,37 +985,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" -[[package]] -name = "compact_str" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "ryu", - "static_assertions", -] - -[[package]] -name = "compression-codecs" -version = "0.4.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "680dc087785c5230f8e8843e2e57ac7c1c90488b6a91b88caa265410568f441b" -dependencies = [ - "brotli", - "compression-core", - "flate2", - "memchr", -] - -[[package]] -name = "compression-core" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9b614a5787ef0c8802a55766480563cb3a93b435898c422ed2a359cf811582" - [[package]] name = "concurrent-queue" version = "2.5.0" @@ -1388,12 +1000,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "cooked-waker" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147be55d677052dabc6b22252d5dd0fd4c29c8c27aa4f2fbef0f94aa003b406f" - [[package]] name = "cookie" version = "0.18.1" @@ -1723,8 +1329,8 @@ dependencies = [ "cpufeatures", "curve25519-dalek-derive", "digest", - "fiat-crypto 0.2.9", - "rustc_version 0.4.1", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] @@ -1744,7 +1350,7 @@ dependencies = [ name = "custom-binary" version = "0.1.0" dependencies = [ - "axum 0.8.7", + "axum", "env_logger", "tokio", "trailbase", @@ -1763,610 +1369,15 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "data-encoding" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" - -[[package]] -name = "data-url" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" - [[package]] name = "debugid" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "serde", "uuid", ] -[[package]] -name = "deno_ast" -version = "0.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24158ccf7def38c00fd253fd1b48c8c6207214078fe499f47168763fa2445bf2" -dependencies = [ - "base64", - "capacity_builder", - "deno_error", - "deno_media_type", - "deno_terminal", - "dprint-swc-ext", - "percent-encoding", - "serde", - "sourcemap", - "swc_atoms", - "swc_common", - "swc_config", - "swc_config_macro", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_codegen_macros", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_transforms_proposal", - "swc_ecma_transforms_react", - "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_eq_ignore_macros", - "swc_macros_common 1.0.0", - "swc_visit", - "swc_visit_macros", - "text_lines", - "thiserror 2.0.17", - "unicode-width 0.2.2", - "url", -] - -[[package]] -name = "deno_console" -version = "0.213.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c53d2fbfe68ff0d39dcbffb869bfa30019da2db5d0efbfb4b3fcc04bd1aed0e" -dependencies = [ - "deno_core", -] - -[[package]] -name = "deno_core" -version = "0.355.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775d2fde80a2ec3116d179703b38346a931bb9626f4a826148d5fe8631cab29f" -dependencies = [ - "anyhow", - "az", - "bincode", - "bit-set", - "bit-vec", - "boxed_error", - "bytes", - "capacity_builder", - "cooked-waker", - "deno_core_icudata", - "deno_error", - "deno_ops", - "deno_path_util", - "deno_unsync", - "futures", - "indexmap 2.12.0", - "libc", - "parking_lot", - "percent-encoding", - "pin-project", - "serde", - "serde_json", - "serde_v8", - "smallvec", - "sourcemap", - "static_assertions", - "thiserror 2.0.17", - "tokio", - "url", - "v8", - "wasm_dep_analyzer", -] - -[[package]] -name = "deno_core_icudata" -version = "0.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4dccb6147bb3f3ba0c7a48e993bfeb999d2c2e47a81badee80e2b370c8d695" - -[[package]] -name = "deno_crypto" -version = "0.227.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f8afd2869b8cefa809e912ba73242485ac69009b6195581eea8a75bc1b89c7" -dependencies = [ - "aes", - "aes-gcm", - "aes-kw", - "aws-lc-rs", - "base64", - "cbc", - "const-oid", - "ctr", - "curve25519-dalek", - "deno_core", - "deno_error", - "deno_web", - "ecdsa", - "ed448-goldilocks", - "elliptic-curve", - "num-traits", - "once_cell", - "p256", - "p384", - "p521", - "rand 0.8.5", - "rsa", - "serde", - "serde_bytes", - "sha1", - "sha2", - "signature", - "spki", - "thiserror 2.0.17", - "tokio", - "uuid", - "x25519-dalek", -] - -[[package]] -name = "deno_error" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde60bd153886964234c5012d3d9caf788287f28d81fb24a884436904101ef10" -dependencies = [ - "deno_error_macro", - "libc", - "serde", - "serde_json", - "tokio", - "url", -] - -[[package]] -name = "deno_error_macro" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "409f265785bd946d3006756955aaf40b0e4deb25752eae6a990afe54a31cfd83" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "deno_features" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73252505f94efc5be0e5c8255b8d2b7e4c1b6361a36c033486ae83d2cddbd37" -dependencies = [ - "deno_core", - "serde", - "serde_json", -] - -[[package]] -name = "deno_fetch" -version = "0.237.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f05820261bcc82d377f79878625d61ac70b58c886345e5b1d68f6b012ae4765" -dependencies = [ - "base64", - "bytes", - "data-url", - "deno_core", - "deno_error", - "deno_fs", - "deno_path_util", - "deno_permissions", - "deno_tls", - "dyn-clone", - "error_reporter", - "h2", - "hickory-resolver", - "http", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-util", - "ipnet", - "percent-encoding", - "rustls-webpki 0.102.8", - "serde", - "serde_json", - "thiserror 2.0.17", - "tokio", - "tokio-rustls 0.26.4", - "tokio-socks", - "tokio-util", - "tokio-vsock", - "tower 0.5.2", - "tower-http", - "tower-service", -] - -[[package]] -name = "deno_fs" -version = "0.123.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b670b3bbceb5aee7e840a4e960e0e0def8f3cf5554f191035b209f38f555638" -dependencies = [ - "async-trait", - "base32", - "boxed_error", - "deno_core", - "deno_error", - "deno_io", - "deno_path_util", - "deno_permissions", - "filetime", - "junction", - "libc", - "nix 0.27.1", - "rand 0.8.5", - "rayon", - "serde", - "thiserror 2.0.17", - "winapi", - "windows-sys 0.59.0", -] - -[[package]] -name = "deno_io" -version = "0.123.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ed7012795555df1a65441c416e1a699d596c8ccf26c346fe6db6d35cd60336" -dependencies = [ - "async-trait", - "deno_core", - "deno_error", - "deno_permissions", - "deno_subprocess_windows", - "filetime", - "fs3", - "libc", - "log", - "nix 0.27.1", - "once_cell", - "os_pipe", - "parking_lot", - "pin-project", - "rand 0.8.5", - "tokio", - "uuid", - "winapi", - "windows-sys 0.59.0", -] - -[[package]] -name = "deno_media_type" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ec0dada9dc5ac4733b4175d36f6a150b7dd68fab46db35cb1ef00dd7366acb" -dependencies = [ - "data-url", - "serde", - "url", -] - -[[package]] -name = "deno_native_certs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bc737e098a45aa5742d51ce694ac7236a1e69fb0d9df8c862e9b4c9583c5f9" -dependencies = [ - "dlopen2", - "dlopen2_derive", - "once_cell", - "rustls-native-certs 0.7.3", - "rustls-pemfile", -] - -[[package]] -name = "deno_net" -version = "0.205.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f5fcbc6f531c0ee8e7be34bc877aef1ed20c94b7d2215929ea176280259fc7a" -dependencies = [ - "deno_core", - "deno_error", - "deno_features", - "deno_permissions", - "deno_signals", - "deno_tls", - "deno_tunnel", - "hickory-proto", - "hickory-resolver", - "log", - "pin-project", - "quinn", - "rustls-tokio-stream", - "serde", - "sha2", - "socket2 0.5.10", - "thiserror 2.0.17", - "tokio", - "tokio-vsock", - "url", - "web-transport-proto", -] - -[[package]] -name = "deno_ops" -version = "0.231.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca530772bbcbc9ad389ad7bcd86623b2ec555f68a2d062d23cc008915cbe781" -dependencies = [ - "indexmap 2.12.0", - "proc-macro-rules", - "proc-macro2", - "quote", - "stringcase", - "strum", - "strum_macros", - "syn", - "thiserror 2.0.17", -] - -[[package]] -name = "deno_os" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2b0b7c124499ae48516464a3636b900cdecd765c7e6e411f813038b3e1c575" -dependencies = [ - "deno_core", - "deno_error", - "deno_path_util", - "deno_permissions", - "deno_signals", - "libc", - "netif", - "ntapi", - "once_cell", - "serde", - "thiserror 2.0.17", - "tokio", - "winapi", -] - -[[package]] -name = "deno_path_util" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe02936964b2910719bd488841f6e884349360113c7abf6f4c6b28ca9cd7a19" -dependencies = [ - "deno_error", - "percent-encoding", - "sys_traits", - "thiserror 2.0.17", - "url", -] - -[[package]] -name = "deno_permissions" -version = "0.72.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e08943b9430d1e78b7ddae254666aadfe5d8b3ee5cb253f1dff872ef5b22f10" -dependencies = [ - "capacity_builder", - "deno_error", - "deno_path_util", - "deno_terminal", - "deno_unsync", - "fqdn", - "ipnetwork 0.20.0", - "libc", - "log", - "nix 0.27.1", - "once_cell", - "parking_lot", - "percent-encoding", - "serde", - "serde_json", - "sys_traits", - "thiserror 2.0.17", - "url", - "which 8.0.0", - "winapi", - "windows-sys 0.59.0", -] - -[[package]] -name = "deno_process" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e378d7a21caef5ac9e6b7e23247dd95c71c702aaae9c73fc8aecced2f330fbf" -dependencies = [ - "deno_core", - "deno_error", - "deno_fs", - "deno_io", - "deno_os", - "deno_path_util", - "deno_permissions", - "deno_signals", - "deno_subprocess_windows", - "libc", - "log", - "memchr", - "nix 0.27.1", - "pin-project-lite", - "rand 0.8.5", - "serde", - "simd-json", - "sys_traits", - "tempfile", - "thiserror 2.0.17", - "tokio", - "winapi", - "windows-sys 0.59.0", -] - -[[package]] -name = "deno_signals" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edcc759556d2d3170bcb5f430c2a3b2ed873211af3c360cc77523ea79b09ffa" -dependencies = [ - "deno_error", - "libc", - "signal-hook", - "thiserror 2.0.17", - "tokio", - "winapi", -] - -[[package]] -name = "deno_subprocess_windows" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a79fb81598d64bd3adc801fae8f9f6930f4a790f50ff0196e0fe20c92fab46" -dependencies = [ - "fastrand", - "futures-channel", - "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "deno_telemetry" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80894b874df0ade53b85fd094ff948d645cfe05b5319761f922391b260b111de" -dependencies = [ - "async-trait", - "deno_core", - "deno_error", - "deno_net", - "deno_signals", - "deno_tls", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-util", - "log", - "once_cell", - "opentelemetry 0.27.1", - "opentelemetry-http 0.27.0", - "opentelemetry-otlp 0.27.0", - "opentelemetry-semantic-conventions 0.27.0", - "opentelemetry_sdk 0.27.1", - "pin-project", - "serde", - "thiserror 2.0.17", - "tokio", - "tokio-vsock", - "tower-service", -] - -[[package]] -name = "deno_terminal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f71c27009e0141dedd315f1dfa3ebb0a6ca4acce7c080fac576ea415a465f6" -dependencies = [ - "once_cell", - "termcolor", -] - -[[package]] -name = "deno_tls" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30245c362adc1e6b74b28c0a4687950c2f0f8729fc62e05f11db29f31d2dd37b" -dependencies = [ - "deno_core", - "deno_error", - "deno_native_certs", - "rustls 0.23.28", - "rustls-pemfile", - "rustls-tokio-stream", - "rustls-webpki 0.102.8", - "serde", - "thiserror 2.0.17", - "tokio", - "webpki-roots 0.26.11", -] - -[[package]] -name = "deno_tunnel" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbe45dacb6e0d2a646b22a12fea81ba2f7128202f9ee91602782b9208da123b9" -dependencies = [ - "pin-project", - "quinn", - "serde", - "serde_json", - "thiserror 2.0.17", - "tokio", - "tracing", -] - -[[package]] -name = "deno_unsync" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6742a724e8becb372a74c650a1aefb8924a5b8107f7d75b3848763ea24b27a87" -dependencies = [ - "futures-util", - "parking_lot", - "tokio", -] - -[[package]] -name = "deno_url" -version = "0.213.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebe63615f18221afbdcf0dd97f128af21529c6a4d012a7b9b4a0223c91359b2" -dependencies = [ - "deno_core", - "deno_error", - "urlpattern", -] - -[[package]] -name = "deno_web" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a863aae15f3dbccb11b3776e9dea399f510a9b1d4dac22a4dcfff96bcff9d7" -dependencies = [ - "async-trait", - "base64-simd", - "bytes", - "deno_core", - "deno_error", - "deno_permissions", - "encoding_rs", - "flate2", - "futures", - "serde", - "thiserror 2.0.17", - "tokio", - "uuid", -] - -[[package]] -name = "deno_webidl" -version = "0.213.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68682e535768112593274795b70f4dee5d31d6d973f4be14d660c0a8954e0abb" -dependencies = [ - "deno_core", -] - [[package]] name = "der" version = "0.7.10" @@ -2387,25 +1398,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derive-io" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cc7f4740088458993d183a200fe56e62378736f94bf0e2dd45807407e7bb94" -dependencies = [ - "derive-io-macros", - "tokio", -] - -[[package]] -name = "derive-io-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d0a1bd7eeab72097740967d03d53db5fbaf8e3c0dd471ebdefa43ce445a20a6" -dependencies = [ - "proc-macro2", -] - [[package]] name = "derive_arbitrary" version = "1.4.2" @@ -2467,50 +1459,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dlopen2" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6" -dependencies = [ - "dlopen2_derive", - "libc", - "once_cell", - "winapi", -] - -[[package]] -name = "dlopen2_derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788160fb30de9cdd857af31c6a2675904b16ece8fc2737b2c7127ba368c9d0f4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dprint-swc-ext" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a09827d6db1a3af25e105553d674ee9019be58fa3d6745c2a2803f8ce8e3eb8" -dependencies = [ - "num-bigint", - "rustc-hash", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "text_lines", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - [[package]] name = "dyn-clone" version = "1.0.20" @@ -2556,18 +1504,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ed448-goldilocks" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06924531e9e90130842b012e447f85bdaf9161bc8a0f8092be8cb70b01ebe092" -dependencies = [ - "fiat-crypto 0.1.20", - "hex", - "subtle", - "zeroize", -] - [[package]] name = "either" version = "1.15.0" @@ -2581,7 +1517,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", - "base64ct", "crypto-bigint", "digest", "ff", @@ -2592,8 +1527,6 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "serde_json", - "serdect", "subtle", "zeroize", ] @@ -2638,24 +1571,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "env_filter" version = "0.1.4" @@ -2714,18 +1629,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "error-code" -version = "3.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" - -[[package]] -name = "error_reporter" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ae425815400e5ed474178a7a22e275a9687086a12ca63ec793ff292d8fdae8" - [[package]] name = "event-listener" version = "2.5.3" @@ -2815,18 +1718,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "fastbloom" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c1ddb9231d8554c2d6bdf4cfaabf0c59251658c68b6c95cd52dd0c513a912a" -dependencies = [ - "getrandom 0.3.4", - "libm", - "rand 0.9.2", - "siphasher 1.0.1", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -2854,30 +1745,12 @@ dependencies = [ "subtle", ] -[[package]] -name = "fiat-crypto" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" - [[package]] name = "fiat-crypto" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" -[[package]] -name = "filetime" -version = "0.2.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.60.2", -] - [[package]] name = "find-msvc-tools" version = "0.1.5" @@ -2901,15 +1774,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "float-cmp" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" -dependencies = [ - "num-traits", -] - [[package]] name = "fluent-uri" version = "0.4.1" @@ -2963,12 +1827,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fqdn" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb540cf7bc4fe6df9d8f7f0c974cfd0dce8ed4e9e8884e73433b503ee78b4e7d" - [[package]] name = "fraction" version = "0.15.3" @@ -2979,17 +1837,6 @@ dependencies = [ "num", ] -[[package]] -name = "from_variant" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" -dependencies = [ - "proc-macro2", - "swc_macros_common 1.0.0", - "syn", -] - [[package]] name = "fs-set-times" version = "0.20.3" @@ -3001,39 +1848,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "fs3" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb17cf6ed704f72485332f6ab65257460c4f9f3083934cf402bf9f5b3b600a90" -dependencies = [ - "libc", - "rustc_version 0.2.3", - "winapi", -] - -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - -[[package]] -name = "fslock" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" version = "0.3.31" @@ -3188,16 +2002,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" -dependencies = [ - "opaque-debug", - "polyval", -] - [[package]] name = "gimli" version = "0.32.3" @@ -3205,7 +2009,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" dependencies = [ "fallible-iterator", - "indexmap 2.12.0", + "indexmap", "stable_deref_trait", ] @@ -3238,15 +2042,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "gzip-header" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2" -dependencies = [ - "crc32fast", -] - [[package]] name = "h2" version = "0.4.12" @@ -3259,7 +2054,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.12.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -3277,22 +2072,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "halfbrown" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" -dependencies = [ - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.5" @@ -3315,9 +2094,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ "allocator-api2", "equivalent", @@ -3345,60 +2124,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hickory-proto" -version = "0.25.0-alpha.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d00147af6310f4392a31680db52a3ed45a2e0f68eb18e8c3fe5537ecc96d9e2" -dependencies = [ - "async-recursion", - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna", - "ipnet", - "once_cell", - "rand 0.9.2", - "serde", - "thiserror 2.0.17", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "hickory-resolver" -version = "0.25.0-alpha.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5762f69ebdbd4ddb2e975cd24690bf21fe6b2604039189c26acddbc427f12887" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto", - "ipconfig", - "moka", - "once_cell", - "parking_lot", - "rand 0.9.2", - "resolv-conf", - "serde", - "smallvec", - "thiserror 2.0.17", - "tokio", - "tracing", -] - [[package]] name = "hkdf" version = "0.12.4" @@ -3417,28 +2142,6 @@ dependencies = [ "digest", ] -[[package]] -name = "home" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "hstr" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85186bc48d3c611ead052cc3f907748e40b63d73a99e4ed34d18063e2baaf1b" -dependencies = [ - "hashbrown 0.14.5", - "new_debug_unreachable", - "once_cell", - "rustc-hash", - "triomphe", -] - [[package]] name = "http" version = "1.3.1" @@ -3529,8 +2232,8 @@ dependencies = [ "http", "hyper", "hyper-util", - "rustls 0.23.28", - "rustls-native-certs 0.8.2", + "rustls 0.23.35", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", @@ -3573,6 +2276,7 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" dependencies = [ + "base64", "bytes", "futures-channel", "futures-core", @@ -3580,12 +2284,16 @@ dependencies = [ "http", "http-body", "hyper", + "ipnet", "libc", + "percent-encoding", "pin-project-lite", - "socket2 0.6.1", + "socket2", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] @@ -3720,30 +2428,14 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "if_chain" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd62e6b5e86ea8eeeb8db1de02880a6abc01a397b2ebb64b5d74ac255318f5cb" - [[package]] name = "indexmap" -version = "1.9.3" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", - "hashbrown 0.16.0", + "hashbrown 0.16.1", "serde", "serde_core", ] @@ -3772,11 +2464,11 @@ version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3405b8beafca487bde01d88e05e6646c4e5c6a3c9830e7b937290ea8f7f5e5d9" dependencies = [ - "opentelemetry 0.31.0", - "opentelemetry-otlp 0.31.0", - "opentelemetry-semantic-conventions 0.31.0", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", "opentelemetry-stdout", - "opentelemetry_sdk 0.31.0", + "opentelemetry_sdk", "thiserror 2.0.17", "tracing", "tracing-opentelemetry", @@ -3789,7 +2481,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "block-padding", "generic-array", ] @@ -3818,33 +2509,12 @@ version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2 0.5.10", - "widestring", - "windows-sys 0.48.0", - "winreg", -] - [[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" -[[package]] -name = "ipnetwork" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" -dependencies = [ - "serde", -] - [[package]] name = "ipnetwork" version = "0.21.1" @@ -3852,15 +2522,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf370abdafd54d13e54a620e8c3e1145f28e46cc9d704bc6d94414559df41763" [[package]] -name = "is-macro" -version = "0.3.7" +name = "iri-string" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", + "memchr", + "serde", ] [[package]] @@ -4007,16 +2675,6 @@ dependencies = [ "simple_asn1", ] -[[package]] -name = "junction" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72bbdfd737a243da3dfc1f99ee8d6e166480f17ab4ac84d7c34aacd73fc7bd16" -dependencies = [ - "scopeguard", - "windows-sys 0.52.0", -] - [[package]] name = "kanal" version = "0.1.1" @@ -4072,8 +2730,8 @@ dependencies = [ "nom 8.0.0", "percent-encoding", "quoted_printable", - "rustls 0.23.28", - "socket2 0.6.1", + "rustls 0.23.35", + "socket2", "tokio", "tokio-rustls 0.26.4", "url", @@ -4120,7 +2778,6 @@ checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags", "libc", - "redox_syscall", ] [[package]] @@ -4129,7 +2786,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" dependencies = [ - "bindgen 0.72.1", + "bindgen", "cc", "pkg-config", "vcpkg", @@ -4201,7 +2858,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax", - "rustc_version 0.4.1", + "rustc_version", "syn", ] @@ -4238,12 +2895,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "matchit" version = "0.8.4" @@ -4256,7 +2907,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a197e44322788858682406c74b0b59bf8d9b4954fe1f224d9a25147f1880bba" dependencies = [ - "ipnetwork 0.21.1", + "ipnetwork", "log", "memchr", "serde", @@ -4269,15 +2920,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" -[[package]] -name = "maybe_path" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c9329bd78af28f0d589085c383e5af47a24fbe070bc282cc7aa54a021c285b" -dependencies = [ - "serde", -] - [[package]] name = "md-5" version = "0.10.6" @@ -4303,15 +2945,6 @@ dependencies = [ "rustix 1.1.2", ] -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "mimalloc" version = "0.1.48" @@ -4388,24 +3021,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "moka" -version = "0.12.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8261cd88c312e0004c1d51baad2980c66528dfdb2bee62003e643a4d8f86b077" -dependencies = [ - "crossbeam-channel", - "crossbeam-epoch", - "crossbeam-utils", - "equivalent", - "parking_lot", - "portable-atomic", - "rustc_version 0.4.1", - "smallvec", - "tagptr", - "uuid", -] - [[package]] name = "multer" version = "3.1.0" @@ -4446,55 +3061,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "netif" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29a01b9f018d6b7b277fef6c79fdbd9bf17bb2d1e298238055cafab49baa5ee" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags", - "cfg-if", - "libc", -] - -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags", - "cfg-if", - "cfg_aliases", - "libc", - "memoffset", -] - [[package]] name = "nom" version = "7.1.3" @@ -4514,15 +3080,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi", -] - [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -4554,8 +3111,6 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", - "rand 0.8.5", - "serde", ] [[package]] @@ -4636,16 +3191,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "oauth2" version = "5.0.0" @@ -4683,7 +3228,7 @@ checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "crc32fast", "hashbrown 0.15.5", - "indexmap 2.12.0", + "indexmap", "memchr", ] @@ -4801,20 +3346,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "opentelemetry" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab70038c28ed37b97d8ed414b6429d343a8bbf44c9f79ec854f3a643029ba6d7" -dependencies = [ - "futures-core", - "futures-sink", - "js-sys", - "pin-project-lite", - "thiserror 1.0.69", - "tracing", -] - [[package]] name = "opentelemetry" version = "0.31.0" @@ -4828,18 +3359,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "opentelemetry-http" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a8a7f5f6ba7c1b286c2fbca0454eaba116f63bbe69ed250b642d36fbb04d80" -dependencies = [ - "async-trait", - "bytes", - "http", - "opentelemetry 0.27.1", -] - [[package]] name = "opentelemetry-http" version = "0.31.0" @@ -4849,31 +3368,10 @@ dependencies = [ "async-trait", "bytes", "http", - "opentelemetry 0.31.0", + "opentelemetry", "reqwest", ] -[[package]] -name = "opentelemetry-otlp" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cf61a1868dacc576bf2b2a1c3e9ab150af7272909e80085c3173384fe11f76" -dependencies = [ - "async-trait", - "futures-core", - "http", - "opentelemetry 0.27.1", - "opentelemetry-http 0.27.0", - "opentelemetry-proto 0.27.0", - "opentelemetry_sdk 0.27.1", - "prost 0.13.5", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tonic 0.12.3", - "tracing", -] - [[package]] name = "opentelemetry-otlp" version = "0.31.0" @@ -4881,29 +3379,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2366db2dca4d2ad033cad11e6ee42844fd727007af5ad04a1730f4cb8163bf" dependencies = [ "http", - "opentelemetry 0.31.0", - "opentelemetry-http 0.31.0", - "opentelemetry-proto 0.31.0", - "opentelemetry_sdk 0.31.0", - "prost 0.14.1", + "opentelemetry", + "opentelemetry-http", + "opentelemetry-proto", + "opentelemetry_sdk", + "prost", "reqwest", "thiserror 2.0.17", "tokio", - "tonic 0.14.2", -] - -[[package]] -name = "opentelemetry-proto" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e05acbfada5ec79023c85368af14abd0b307c015e9064d249b2a950ef459a6" -dependencies = [ - "hex", - "opentelemetry 0.27.1", - "opentelemetry_sdk 0.27.1", - "prost 0.13.5", - "serde", - "tonic 0.12.3", + "tonic", ] [[package]] @@ -4912,19 +3396,13 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7175df06de5eaee9909d4805a3d07e28bb752c34cab57fa9cff549da596b30f" dependencies = [ - "opentelemetry 0.31.0", - "opentelemetry_sdk 0.31.0", - "prost 0.14.1", - "tonic 0.14.2", + "opentelemetry", + "opentelemetry_sdk", + "prost", + "tonic", "tonic-prost", ] -[[package]] -name = "opentelemetry-semantic-conventions" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc1b6902ff63b32ef6c489e8048c5e253e2e4a803ea3ea7e783914536eb15c52" - [[package]] name = "opentelemetry-semantic-conventions" version = "0.31.0" @@ -4938,29 +3416,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc8887887e169414f637b18751487cce4e095be787d23fad13c454e2fb1b3811" dependencies = [ "chrono", - "opentelemetry 0.31.0", - "opentelemetry_sdk 0.31.0", -] - -[[package]] -name = "opentelemetry_sdk" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "231e9d6ceef9b0b2546ddf52335785ce41252bc7474ee8ba05bfad277be13ab8" -dependencies = [ - "async-trait", - "futures-channel", - "futures-executor", - "futures-util", - "glob", - "opentelemetry 0.27.1", - "percent-encoding", - "rand 0.8.5", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", + "opentelemetry", + "opentelemetry_sdk", ] [[package]] @@ -4972,7 +3429,7 @@ dependencies = [ "futures-channel", "futures-executor", "futures-util", - "opentelemetry 0.31.0", + "opentelemetry", "percent-encoding", "rand 0.9.2", "thiserror 2.0.17", @@ -4989,16 +3446,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "os_pipe" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "outref" version = "0.5.2" @@ -5029,39 +3476,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "p521" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" -dependencies = [ - "base16ct", - "ecdsa", - "elliptic-curve", - "primeorder", - "rand_core 0.6.4", - "sha2", -] - -[[package]] -name = "par-core" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" -dependencies = [ - "once_cell", -] - -[[package]] -name = "par-iter" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a" -dependencies = [ - "either", - "par-core", -] - [[package]] name = "parking" version = "2.2.1" @@ -5108,12 +3522,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - [[package]] name = "pem" version = "3.0.6" @@ -5146,7 +3554,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap 2.12.0", + "indexmap", ] [[package]] @@ -5155,7 +3563,6 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ - "phf_macros", "phf_shared", ] @@ -5179,26 +3586,13 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "phf_shared" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher 1.0.1", + "siphasher", "uncased", ] @@ -5406,29 +3800,6 @@ dependencies = [ "elliptic-curve", ] -[[package]] -name = "proc-macro-rules" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c277e4e643ef00c1233393c673f655e3672cf7eb3ba08a00bdd0ea59139b5f" -dependencies = [ - "proc-macro-rules-macros", - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro-rules-macros" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207fffb0fe655d1d47f6af98cc2793405e85929bdbc420d685554ff07be27ac7" -dependencies = [ - "once_cell", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.103" @@ -5438,16 +3809,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" -dependencies = [ - "bytes", - "prost-derive 0.13.5", -] - [[package]] name = "prost" version = "0.14.1" @@ -5455,7 +3816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" dependencies = [ "bytes", - "prost-derive 0.14.1", + "prost-derive", ] [[package]] @@ -5471,26 +3832,13 @@ dependencies = [ "once_cell", "petgraph", "prettyplease", - "prost 0.14.1", + "prost", "prost-types", "regex", "syn", "tempfile", ] -[[package]] -name = "prost-derive" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" -dependencies = [ - "anyhow", - "itertools 0.14.0", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "prost-derive" version = "0.14.1" @@ -5511,7 +3859,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a3ac73ec9a9118131a4594c9d336631a07852220a1d0ae03ee36b04503a063" dependencies = [ "logos", - "prost 0.14.1", + "prost", "prost-reflect-derive", "prost-types", ] @@ -5543,7 +3891,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" dependencies = [ - "prost 0.14.1", + "prost", ] [[package]] @@ -5612,8 +3960,8 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.28", - "socket2 0.6.1", + "rustls 0.23.35", + "socket2", "thiserror 2.0.17", "tokio", "tracing", @@ -5626,15 +3974,13 @@ version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ - "aws-lc-rs", "bytes", - "fastbloom", "getrandom 0.3.4", "lru-slab", "rand 0.9.2", "ring", "rustc-hash", - "rustls 0.23.28", + "rustls 0.23.35", "rustls-pki-types", "slab", "thiserror 2.0.17", @@ -5652,7 +3998,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.1", + "socket2", "tracing", "windows-sys 0.60.2", ] @@ -5678,22 +4024,6 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - [[package]] name = "rand" version = "0.8.5" @@ -5855,7 +4185,7 @@ dependencies = [ "ahash", "fluent-uri", "getrandom 0.3.4", - "hashbrown 0.16.0", + "hashbrown 0.16.1", "parking_lot", "percent-encoding", "serde_json", @@ -5912,9 +4242,9 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" dependencies = [ "base64", "bytes", @@ -5930,37 +4260,34 @@ dependencies = [ "hyper-rustls", "hyper-tls", "hyper-util", - "ipnet", "js-sys", "log", "mime", "mime_guess", "native-tls", - "once_cell", "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.28", - "rustls-native-certs 0.8.2", - "rustls-pemfile", + "rustls 0.23.35", + "rustls-native-certs", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls 0.26.4", "tokio-util", + "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.11", - "windows-registry", + "webpki-roots 1.0.4", ] [[package]] @@ -5972,12 +4299,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "resolv-conf" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3789b30bd25ba102de4beabd95d21ac45b69b1be7d14522bab988c526d6799" - [[package]] name = "rfc6979" version = "0.4.0" @@ -5998,7 +4319,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.16", "libc", - "untrusted 0.9.0", + "untrusted", "windows-sys 0.52.0", ] @@ -6137,22 +4458,13 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.27", + "semver", ] [[package]] @@ -6207,11 +4519,10 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.28" +version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ - "aws-lc-rs", "log", "once_cell", "ring", @@ -6221,19 +4532,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "rustls-pki-types", - "schannel", - "security-framework 2.11.1", -] - [[package]] name = "rustls-native-certs" version = "0.8.2" @@ -6246,15 +4544,6 @@ dependencies = [ "security-framework 3.5.1", ] -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "rustls-pki-types" version = "1.13.0" @@ -6265,19 +4554,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-tokio-stream" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0560d12c0d8c672f849197de91b9ee61f5bf9aa024c97aaeeb112ec2f6c347fd" -dependencies = [ - "derive-io", - "futures", - "rustls 0.23.28", - "socket2 0.5.10", - "tokio", -] - [[package]] name = "rustls-webpki" version = "0.102.8" @@ -6286,7 +4562,7 @@ checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -6295,10 +4571,9 @@ version = "0.103.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ - "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -6307,84 +4582,12 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" -[[package]] -name = "rustyline" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a2d683a4ac90aeef5b1013933f6d977bd37d51ff3f4dad829d4931a7e6be86" -dependencies = [ - "bitflags", - "cfg-if", - "clipboard-win", - "fd-lock", - "home", - "libc", - "log", - "memchr", - "nix 0.27.1", - "radix_trie", - "unicode-segmentation", - "unicode-width 0.1.14", - "utf8parse", - "winapi", -] - -[[package]] -name = "rustyscript" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7022cabe11c65c8a34a3b0e92ca1d55a0add1f873cec4def14c5b82938003d6" -dependencies = [ - "async-trait", - "base64-simd", - "deno_ast", - "deno_console", - "deno_core", - "deno_crypto", - "deno_error", - "deno_features", - "deno_fetch", - "deno_fs", - "deno_io", - "deno_media_type", - "deno_net", - "deno_permissions", - "deno_process", - "deno_telemetry", - "deno_terminal", - "deno_tls", - "deno_url", - "deno_web", - "deno_webidl", - "http", - "hyper-util", - "libc", - "maybe_path", - "nix 0.27.1", - "once_cell", - "paste", - "reqwest", - "rustls 0.23.28", - "rustyline", - "serde", - "thiserror 2.0.17", - "tokio", - "tokio-util", - "winapi", -] - [[package]] name = "ryu" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" -[[package]] -name = "ryu-js" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" - [[package]] name = "same-file" version = "1.0.6" @@ -6428,12 +4631,6 @@ dependencies = [ "syn", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -6450,7 +4647,6 @@ dependencies = [ "der", "generic-array", "pkcs8", - "serdect", "subtle", "zeroize", ] @@ -6497,15 +4693,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16c2f82143577edb4921b71ede051dac62ca3c16084e918bf7b40c96ae10eb33" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.27" @@ -6516,17 +4703,11 @@ dependencies = [ "serde_core", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" -version = "1.0.221" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "341877e04a22458705eb4e131a1508483c877dca2792b3781d4e5d8a6019ec43" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", @@ -6554,18 +4735,18 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.221" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c459bc0a14c840cb403fc14b148620de1e0778c96ecd6e0c8c3cacb6d8d00fe" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.221" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6185cf75117e20e62b1ff867b9518577271e58abe0037c40bb4794969355ab0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -6589,7 +4770,6 @@ version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ - "indexmap 2.12.0", "itoa", "memchr", "ryu", @@ -6650,41 +4830,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_v8" -version = "0.264.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34707712f3815e73e1c8319bba06e5bc105bb65fe812ea2e7279ffb905f6312" -dependencies = [ - "deno_error", - "num-bigint", - "serde", - "smallvec", - "thiserror 2.0.17", - "v8", -] - -[[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.9" @@ -6711,21 +4856,11 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] @@ -6746,27 +4881,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "simd-json" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" -dependencies = [ - "getrandom 0.2.16", - "halfbrown", - "ref-cast", - "serde", - "serde_json", - "simdutf8", - "value-trait", -] - -[[package]] -name = "simdutf8" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" - [[package]] name = "simple_asn1" version = "0.6.3" @@ -6779,12 +4893,6 @@ dependencies = [ "time", ] -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "siphasher" version = "1.0.1" @@ -6821,27 +4929,6 @@ dependencies = [ "serde", ] -[[package]] -name = "smartstring" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" -dependencies = [ - "autocfg", - "static_assertions", - "version_check", -] - -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "socket2" version = "0.6.1" @@ -6852,24 +4939,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "sourcemap" -version = "9.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "spin" version = "0.9.8" @@ -6913,7 +4982,7 @@ dependencies = [ "bitflags", "cc", "fallible-iterator", - "indexmap 2.12.0", + "indexmap", "log", "memchr", "phf", @@ -6947,463 +5016,18 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_enum" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fe66b8ee349846ce2f9557a26b8f1e74843c4a13fb381f9a3d73617a5f956a" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common 1.0.0", - "syn", -] - -[[package]] -name = "stringcase" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72abeda133c49d7bddece6c154728f83eec8172380c80ab7096da9487e20d27c" - [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "swc_allocator" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7eefd2c8b228a8c73056482b2ae4b3a1071fbe07638e3b55ceca8570cc48bb" -dependencies = [ - "allocator-api2", - "bumpalo", - "hashbrown 0.14.5", - "rustc-hash", -] - -[[package]] -name = "swc_atoms" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7077ba879f95406459bc0c81f3141c529b34580bc64d7ab7bd15e7118a0391" -dependencies = [ - "hstr", - "once_cell", - "rustc-hash", - "serde", -] - -[[package]] -name = "swc_common" -version = "9.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56b6f5a8e5affa271b56757a93badee6f44defcd28f3ba106bb2603afe40d3d" -dependencies = [ - "anyhow", - "ast_node", - "better_scoped_tls", - "cfg-if", - "either", - "from_variant", - "new_debug_unreachable", - "num-bigint", - "once_cell", - "rustc-hash", - "serde", - "siphasher 0.3.11", - "sourcemap", - "swc_allocator", - "swc_atoms", - "swc_eq_ignore_macros", - "swc_visit", - "tracing", - "unicode-width 0.1.14", - "url", -] - -[[package]] -name = "swc_config" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01bfcbbdea182bdda93713aeecd997749ae324686bf7944f54d128e56be4ea9" -dependencies = [ - "anyhow", - "indexmap 2.12.0", - "serde", - "serde_json", - "swc_config_macro", -] - -[[package]] -name = "swc_config_macro" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2ebd37ef52a8555c8c9be78b694d64adcb5e3bc16c928f030d82f1d65fac57" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common 1.0.0", - "syn", -] - -[[package]] -name = "swc_ecma_ast" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0613d84468a6bb6d45d13c5a3368b37bd21f3067a089f69adac630dcb462a018" -dependencies = [ - "bitflags", - "is-macro", - "num-bigint", - "once_cell", - "phf", - "rustc-hash", - "scoped-tls", - "serde", - "string_enum", - "swc_atoms", - "swc_common", - "swc_visit", - "unicode-id-start", -] - -[[package]] -name = "swc_ecma_codegen" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01b3de365a86b8f982cc162f257c82f84bda31d61084174a3be37e8ab15c0f4" -dependencies = [ - "ascii", - "compact_str", - "memchr", - "num-bigint", - "once_cell", - "regex", - "rustc-hash", - "serde", - "sourcemap", - "swc_allocator", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen_macros", - "tracing", -] - -[[package]] -name = "swc_ecma_codegen_macros" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99e1931669a67c83e2c2b4375674f6901d1480994a76aa75b23f1389e6c5076" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common 1.0.0", - "syn", -] - -[[package]] -name = "swc_ecma_lexer" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d11c8e71901401b9aae2ece4946eeb7674b14b8301a53768afbbeeb0e48b599" -dependencies = [ - "arrayvec", - "bitflags", - "either", - "new_debug_unreachable", - "num-bigint", - "num-traits", - "phf", - "rustc-hash", - "serde", - "smallvec", - "smartstring", - "stacker", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "tracing", - "typed-arena", -] - -[[package]] -name = "swc_ecma_loader" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb574d660c05f3483c984107452b386e45b95531bdb1253794077edc986f413" -dependencies = [ - "anyhow", - "pathdiff", - "rustc-hash", - "serde", - "swc_atoms", - "swc_common", - "tracing", -] - -[[package]] -name = "swc_ecma_parser" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250786944fbc05f6484eda9213df129ccfe17226ae9ad51b62fce2f72135dbee" -dependencies = [ - "arrayvec", - "bitflags", - "either", - "new_debug_unreachable", - "num-bigint", - "num-traits", - "phf", - "rustc-hash", - "serde", - "smallvec", - "smartstring", - "stacker", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_lexer", - "tracing", - "typed-arena", -] - -[[package]] -name = "swc_ecma_transforms_base" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6856da3da598f4da001b7e4ce225ee8970bc9d5cbaafcaf580190cf0a6031ec5" -dependencies = [ - "better_scoped_tls", - "bitflags", - "indexmap 2.12.0", - "once_cell", - "par-core", - "phf", - "rustc-hash", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", - "tracing", -] - -[[package]] -name = "swc_ecma_transforms_classes" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f84248f82bad599d250bbcd52cb4db6ff6409f48267fd6f001302a2e9716f80" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_macros" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6845dfb88569f3e8cd05901505916a8ebe98be3922f94769ca49f84e8ccec8f7" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common 1.0.0", - "syn", -] - -[[package]] -name = "swc_ecma_transforms_proposal" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193237e318421ef621c2b3958b4db174770c5280ef999f1878f2df93a2837ca6" -dependencies = [ - "either", - "rustc-hash", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_react" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baae39c70229103a72090119887922fc5e32f934f5ca45c0423a5e65dac7e549" -dependencies = [ - "base64", - "dashmap", - "indexmap 2.12.0", - "once_cell", - "rustc-hash", - "serde", - "sha1", - "string_enum", - "swc_allocator", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_typescript" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c65e0b49f7e2a2bd92f1d89c9a404de27232ce00f6a4053f04bda446d50e5c" -dependencies = [ - "once_cell", - "rustc-hash", - "ryu-js", - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_react", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_utils" -version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ed837406d5dbbfbf5792b1dc90964245a0cf659753d4745fe177ffebe8598b9" -dependencies = [ - "indexmap 2.12.0", - "num_cpus", - "once_cell", - "par-core", - "par-iter", - "rustc-hash", - "ryu-js", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", - "tracing", - "unicode-id", -] - -[[package]] -name = "swc_ecma_visit" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249dc9eede1a4ad59a038f9cfd61ce67845bd2c1392ade3586d714e7181f3c1a" -dependencies = [ - "new_debug_unreachable", - "num-bigint", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_visit", - "tracing", -] - -[[package]] -name = "swc_eq_ignore_macros" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "swc_macros_common" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e18fbfe83811ffae2bb23727e45829a0d19c6870bced7c0f545cc99ad248dd" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "swc_macros_common" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "swc_visit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9138b6a36bbe76dd6753c4c0794f7e26480ea757bee499738bedbbb3ae3ec5f3" -dependencies = [ - "either", - "new_debug_unreachable", -] - -[[package]] -name = "swc_visit_macros" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92807d840959f39c60ce8a774a3f83e8193c658068e6d270dbe0a05e40e90b41" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "swc_macros_common 0.3.14", - "syn", -] - [[package]] name = "syn" version = "2.0.110" @@ -7435,29 +5059,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sys_traits" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f74a2c95f72e36fa6bd04a40d15623a9904bab1cc2fa6c6135b09d774a65088" -dependencies = [ - "junction", - "libc", - "sys_traits_macros", - "windows-sys 0.59.0", -] - -[[package]] -name = "sys_traits_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "181f22127402abcf8ee5c83ccd5b408933fec36a6095cf82cda545634692657e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "system-configuration" version = "0.6.1" @@ -7501,12 +5102,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "target-lexicon" version = "0.13.3" @@ -7541,15 +5136,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "text_lines" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd5828de7deaa782e1dd713006ae96b3bee32d3279b79eb67ecf8072c059bcf" -dependencies = [ - "serde", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -7674,10 +5260,9 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.1", + "socket2", "tokio-macros", "windows-sys 0.61.2", ] @@ -7720,19 +5305,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.28", - "tokio", -] - -[[package]] -name = "tokio-socks" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" -dependencies = [ - "either", - "futures-util", - "thiserror 1.0.69", + "rustls 0.23.35", "tokio", ] @@ -7760,19 +5333,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-vsock" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b319ef9394889dab2e1b4f0085b45ba11d0c79dc9d1a9d1afc057d009d0f1c7" -dependencies = [ - "bytes", - "futures", - "libc", - "tokio", - "vsock", -] - [[package]] name = "toml" version = "0.8.23" @@ -7800,7 +5360,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.12.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -7814,36 +5374,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" -[[package]] -name = "tonic" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.7.9", - "base64", - "bytes", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-timeout", - "hyper-util", - "percent-encoding", - "pin-project", - "prost 0.13.5", - "socket2 0.5.10", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic" version = "0.14.2" @@ -7864,7 +5394,7 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-stream", - "tower 0.5.2", + "tower", "tower-layer", "tower-service", "tracing", @@ -7877,28 +5407,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66bd50ad6ce1252d87ef024b3d64fe4c3cf54a86fb9ef4c631fdd0ded7aeaa67" dependencies = [ "bytes", - "prost 0.14.1", - "tonic 0.14.2", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand 0.8.5", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", + "prost", + "tonic", ] [[package]] @@ -7909,7 +5419,7 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", - "indexmap 2.12.0", + "indexmap", "pin-project-lite", "slab", "sync_wrapper", @@ -7926,7 +5436,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151b5a3e3c45df17466454bb74e9ecedecc955269bdedbf4d150dfa393b55a36" dependencies = [ - "axum-core 0.5.5", + "axum-core", "cookie", "futures-util", "http", @@ -7942,7 +5452,6 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "async-compression", "bitflags", "bytes", "futures-core", @@ -7952,12 +5461,14 @@ dependencies = [ "http-body-util", "http-range-header", "httpdate", + "iri-string", "mime", "mime_guess", "percent-encoding", "pin-project-lite", "tokio", "tokio-util", + "tower", "tower-layer", "tower-service", "tracing", @@ -8026,8 +5537,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e6e5658463dd88089aba75c7791e1d3120633b1bfde22478b28f625a9bb1b8e" dependencies = [ "js-sys", - "opentelemetry 0.31.0", - "opentelemetry_sdk 0.31.0", + "opentelemetry", + "opentelemetry_sdk", "rustversion", "smallvec", "thiserror 2.0.17", @@ -8045,8 +5556,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4aea2e5bee9df9d098d951baeccb84e614f12cbc74d01d99fb3ac99a55bf7bf7" dependencies = [ "http", - "opentelemetry 0.31.0", - "opentelemetry-semantic-conventions 0.31.0", + "opentelemetry", + "opentelemetry-semantic-conventions", "tracing", "tracing-opentelemetry", ] @@ -8091,7 +5602,7 @@ dependencies = [ "askama", "async-channel 2.5.0", "async-trait", - "axum 0.8.7", + "axum", "axum-test", "axum-tracing-opentelemetry", "base64", @@ -8108,7 +5619,7 @@ dependencies = [ "http-body-util", "hyper", "hyper-util", - "indexmap 2.12.0", + "indexmap", "indoc", "init-tracing-opentelemetry", "itertools 0.14.0", @@ -8124,7 +5635,7 @@ dependencies = [ "object_store", "parking_lot", "pin-project-lite", - "prost 0.14.1", + "prost", "prost-reflect", "quoted_printable", "rand 0.9.2", @@ -8146,7 +5657,7 @@ dependencies = [ "thiserror 2.0.17", "tokio", "tokio-rustls 0.26.4", - "tower 0.5.2", + "tower", "tower-cookies", "tower-http", "tower-service", @@ -8156,7 +5667,6 @@ dependencies = [ "trailbase-assets", "trailbase-build", "trailbase-extension", - "trailbase-js", "trailbase-qs", "trailbase-refinery", "trailbase-schema", @@ -8175,7 +5685,7 @@ dependencies = [ name = "trailbase-assets" version = "0.2.0" dependencies = [ - "axum 0.8.7", + "axum", "itertools 0.14.0", "log", "rust-embed", @@ -8198,7 +5708,7 @@ dependencies = [ name = "trailbase-cli" version = "0.2.0" dependencies = [ - "axum 0.8.7", + "axum", "bytes", "chrono", "clap", @@ -8268,28 +5778,6 @@ dependencies = [ "validator", ] -[[package]] -name = "trailbase-js" -version = "0.2.0" -dependencies = [ - "bytes", - "futures-util", - "kanal", - "log", - "parking_lot", - "rusqlite", - "rust-embed", - "rustyscript", - "self_cell", - "serde", - "serde_json", - "tokio", - "tracing-subscriber", - "trailbase-build", - "trailbase-schema", - "trailbase-sqlite", -] - [[package]] name = "trailbase-qs" version = "0.1.0" @@ -8312,7 +5800,7 @@ dependencies = [ "log", "regex", "rusqlite", - "siphasher 1.0.1", + "siphasher", "tempfile", "thiserror 2.0.17", "time", @@ -8352,7 +5840,7 @@ dependencies = [ name = "trailbase-sqlean" version = "0.0.3" dependencies = [ - "bindgen 0.72.1", + "bindgen", "cc", "libsqlite3-sys", "rusqlite", @@ -8432,7 +5920,7 @@ dependencies = [ "trailbase-sqlvalue 0.1.0", "trailbase-wasm-common 0.2.0", "url", - "wit-bindgen 0.48.0", + "wit-bindgen 0.48.1", "wstd", ] @@ -8514,10 +6002,6 @@ name = "triomphe" version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd69c5aa8f924c7519d6372789a74eac5b94fb0f8fcf0d4a97eb0bfc3e785f39" -dependencies = [ - "serde", - "stable_deref_trait", -] [[package]] name = "try-lock" @@ -8531,7 +6015,7 @@ version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4994acea2522cd2b3b85c1d9529a55991e3ad5e25cdcd3de9d505972c4379424" dependencies = [ - "indexmap 2.12.0", + "indexmap", "serde_json", "thiserror 2.0.17", "ts-rs-macros", @@ -8550,12 +6034,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - [[package]] name = "typeid" version = "1.0.3" @@ -8601,47 +6079,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - [[package]] name = "unicase" version = "2.8.1" @@ -8654,36 +6091,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" -[[package]] -name = "unicode-id" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ba288e709927c043cbe476718d37be306be53fb1fafecd0dbe36d072be2580" - -[[package]] -name = "unicode-id-start" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b79ad29b5e19de4260020f8919b443b2ef0277d242ce532ec7b7a2cc8b6007" - [[package]] name = "unicode-ident" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unicode-width" version = "0.2.2" @@ -8712,12 +6125,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -8736,18 +6143,6 @@ dependencies = [ "serde", ] -[[package]] -name = "urlpattern" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" -dependencies = [ - "regex", - "serde", - "unic-ucd-ident", - "url", -] - [[package]] name = "utf8_iter" version = "1.0.4" @@ -8766,7 +6161,7 @@ version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fcc29c80c21c31608227e0912b2d7fddba57ad76b606890627ba8ee7964e993" dependencies = [ - "indexmap 2.12.0", + "indexmap", "serde", "serde_json", "utoipa-gen", @@ -8790,7 +6185,7 @@ version = "9.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d047458f1b5b65237c2f6dc6db136945667f40a7668627b3490b9513a3d43a55" dependencies = [ - "axum 0.8.7", + "axum", "base64", "mime_guess", "regex", @@ -8824,22 +6219,6 @@ dependencies = [ "vsimd", ] -[[package]] -name = "v8" -version = "137.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33995a1fee055ff743281cde33a41f0d618ee0bdbe8bdf6859e11864499c2595" -dependencies = [ - "bindgen 0.71.1", - "bitflags", - "fslock", - "gzip-header", - "home", - "miniz_oxide", - "paste", - "which 6.0.3", -] - [[package]] name = "validator" version = "0.20.0" @@ -8863,21 +6242,9 @@ checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "value-bag" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" - -[[package]] -name = "value-trait" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9170e001f458781e92711d2ad666110f153e4e50bfd5cbd02db6547625714187" -dependencies = [ - "float-cmp", - "halfbrown", - "itoa", - "ryu", -] +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" [[package]] name = "vcpkg" @@ -8897,16 +6264,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" -[[package]] -name = "vsock" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2da6e4ac76cd19635dce0f98985378bb62f8044ee2ff80abd2a7334b920ed63" -dependencies = [ - "libc", - "nix 0.30.1", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -9036,7 +6393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee093e1e1ccffa005b9b778f7a10ccfd58e25a20eccad294a1a93168d076befb" dependencies = [ "anyhow", - "indexmap 2.12.0", + "indexmap", "wasm-encoder 0.240.0", "wasmparser 0.240.0", ] @@ -9048,7 +6405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876fe286f2fa416386deedebe8407e6f19e0b5aeaef3d03161e77a15fa80f167" dependencies = [ "anyhow", - "indexmap 2.12.0", + "indexmap", "wasm-encoder 0.241.2", "wasmparser 0.241.2", ] @@ -9075,16 +6432,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wasm_dep_analyzer" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a10e6b67c951a84de7029487e0e0a496860dae49f6699edd279d5ff35b8fbf54" -dependencies = [ - "deno_error", - "thiserror 2.0.17", -] - [[package]] name = "wasmparser" version = "0.239.0" @@ -9093,8 +6440,8 @@ checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0" dependencies = [ "bitflags", "hashbrown 0.15.5", - "indexmap 2.12.0", - "semver 1.0.27", + "indexmap", + "semver", "serde", ] @@ -9106,8 +6453,8 @@ checksum = "b722dcf61e0ea47440b53ff83ccb5df8efec57a69d150e4f24882e4eba7e24a4" dependencies = [ "bitflags", "hashbrown 0.15.5", - "indexmap 2.12.0", - "semver 1.0.27", + "indexmap", + "semver", ] [[package]] @@ -9118,8 +6465,8 @@ checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8" dependencies = [ "bitflags", "hashbrown 0.15.5", - "indexmap 2.12.0", - "semver 1.0.27", + "indexmap", + "semver", ] [[package]] @@ -9150,7 +6497,7 @@ dependencies = [ "fxprof-processed-profile", "gimli", "hashbrown 0.15.5", - "indexmap 2.12.0", + "indexmap", "ittapi", "libc", "log", @@ -9162,7 +6509,7 @@ dependencies = [ "pulley-interpreter", "rayon", "rustix 1.1.2", - "semver 1.0.27", + "semver", "serde", "serde_derive", "serde_json", @@ -9198,12 +6545,12 @@ dependencies = [ "cranelift-bitset", "cranelift-entity", "gimli", - "indexmap 2.12.0", + "indexmap", "log", "object 0.37.3", "postcard", "rustc-demangle", - "semver 1.0.27", + "semver", "serde", "serde_derive", "smallvec", @@ -9388,7 +6735,7 @@ dependencies = [ "anyhow", "bitflags", "heck", - "indexmap 2.12.0", + "indexmap", "wit-parser 0.239.0", ] @@ -9468,7 +6815,7 @@ dependencies = [ "bumpalo", "leb128fmt", "memchr", - "unicode-width 0.2.2", + "unicode-width", "wasm-encoder 0.241.2", ] @@ -9501,18 +6848,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-transport-proto" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "974fa1e325e6cc5327de8887f189a441fcff4f8eedcd31ec87f0ef0cc5283fbc" -dependencies = [ - "bytes", - "http", - "thiserror 2.0.17", - "url", -] - [[package]] name = "webpki-roots" version = "0.26.11" @@ -9531,30 +6866,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "which" -version = "6.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" -dependencies = [ - "either", - "home", - "rustix 0.38.44", - "winsafe", -] - -[[package]] -name = "which" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d" - -[[package]] -name = "widestring" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" - [[package]] name = "winapi" version = "0.3.9" @@ -9615,8 +6926,8 @@ dependencies = [ "windows-implement", "windows-interface", "windows-link", - "windows-result 0.4.1", - "windows-strings 0.5.1", + "windows-result", + "windows-strings", ] [[package]] @@ -9649,22 +6960,13 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -9676,16 +6978,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-strings" version = "0.5.1" @@ -9695,15 +6987,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -9740,21 +7023,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -9788,12 +7056,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -9806,12 +7068,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -9824,12 +7080,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -9854,12 +7104,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -9872,12 +7116,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -9890,12 +7128,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -9908,12 +7140,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -9944,22 +7170,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winsafe" -version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" - [[package]] name = "winx" version = "0.36.4" @@ -9991,12 +7201,12 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c558f2d2929c6367736762d5593bd3276c88efa34945ed642e7bf512712bf163" +checksum = "7f8c2adb5f74ac9395bc3121c99a1254bf9310482c27b13f97167aedb5887138" dependencies = [ "bitflags", - "wit-bindgen-rust-macro 0.48.0", + "wit-bindgen-rust-macro 0.48.1", ] [[package]] @@ -10012,9 +7222,9 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64f7435c8448e456bc6e8f14e27ee4f65926cbdfe72b7bf95badeae2501bacf" +checksum = "9b881a098cae03686d7a0587f8f306f8a58102ad8da8b5599100fbe0e7f5800b" dependencies = [ "anyhow", "heck", @@ -10029,7 +7239,7 @@ checksum = "c6d585319871ca18805056f69ddec7541770fc855820f9944029cb2b75ea108f" dependencies = [ "anyhow", "heck", - "indexmap 2.12.0", + "indexmap", "prettyplease", "syn", "wasm-metadata 0.240.0", @@ -10039,17 +7249,17 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612651c001e0de8bfb7138af5551f80461f25caa627b64d7014a80914cf4f407" +checksum = "69667efa439a453e1d50dac939c6cab6d2c3ac724a9d232b6631dad2472a5b70" dependencies = [ "anyhow", "heck", - "indexmap 2.12.0", + "indexmap", "prettyplease", "syn", "wasm-metadata 0.241.2", - "wit-bindgen-core 0.48.0", + "wit-bindgen-core 0.48.1", "wit-component 0.241.2", ] @@ -10070,17 +7280,17 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c64812d84284d45ce7d7371dc9eb0bcda2f0f747128bd1b4dae1e08217bad3" +checksum = "eae2e22cceb5d105d52326c07e3e67603a861cc7add70fc467f7cc7ec5265017" dependencies = [ "anyhow", "prettyplease", "proc-macro2", "quote", "syn", - "wit-bindgen-core 0.48.0", - "wit-bindgen-rust 0.48.0", + "wit-bindgen-core 0.48.1", + "wit-bindgen-rust 0.48.1", ] [[package]] @@ -10091,7 +7301,7 @@ checksum = "7dc5474b078addc5fe8a72736de8da3acfb3ff324c2491133f8b59594afa1a20" dependencies = [ "anyhow", "bitflags", - "indexmap 2.12.0", + "indexmap", "log", "serde", "serde_derive", @@ -10110,7 +7320,7 @@ checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241" dependencies = [ "anyhow", "bitflags", - "indexmap 2.12.0", + "indexmap", "log", "serde", "serde_derive", @@ -10129,9 +7339,9 @@ checksum = "55c92c939d667b7bf0c6bf2d1f67196529758f99a2a45a3355cc56964fd5315d" dependencies = [ "anyhow", "id-arena", - "indexmap 2.12.0", + "indexmap", "log", - "semver 1.0.27", + "semver", "serde", "serde_derive", "serde_json", @@ -10147,9 +7357,9 @@ checksum = "9875ea3fa272f57cc1fc50f225a7b94021a7878c484b33792bccad0d93223439" dependencies = [ "anyhow", "id-arena", - "indexmap 2.12.0", + "indexmap", "log", - "semver 1.0.27", + "semver", "serde", "serde_derive", "serde_json", @@ -10165,9 +7375,9 @@ checksum = "09ef1c6ad67f35c831abd4039c02894de97034100899614d1c44e2268ad01c91" dependencies = [ "anyhow", "id-arena", - "indexmap 2.12.0", + "indexmap", "log", - "semver 1.0.27", + "semver", "serde", "serde_derive", "serde_json", @@ -10208,27 +7418,6 @@ dependencies = [ "syn", ] -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "x25519-dalek" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" -dependencies = [ - "curve25519-dalek", - "rand_core 0.6.4", - "serde", - "zeroize", -] - [[package]] name = "yansi" version = "1.0.1" @@ -10269,18 +7458,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "43fa6694ed34d6e57407afbccdeecfa268c470a7d2a5b0cf49ce9fcc345afb90" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "c640b22cd9817fae95be82f0d2f90b11f7605f6c319d16705c459b27ac2cbc26" dependencies = [ "proc-macro2", "quote", @@ -10313,20 +7502,6 @@ name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] [[package]] name = "zerotrie" @@ -10370,7 +7545,7 @@ dependencies = [ "arbitrary", "crc32fast", "flate2", - "indexmap 2.12.0", + "indexmap", "memchr", "zopfli", ] @@ -10384,7 +7559,7 @@ dependencies = [ "arbitrary", "crc32fast", "flate2", - "indexmap 2.12.0", + "indexmap", "memchr", "zopfli", ] diff --git a/Cargo.toml b/Cargo.toml index 8010e103..b53017d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ members = [ "crates/client", "crates/core", "crates/extension", - "crates/js-runtime", "crates/qs", "crates/refinery", "crates/schema", @@ -95,7 +94,6 @@ trailbase-assets = { path = "crates/assets", version = "0.2.0" } trailbase-build = { path = "crates/build", version = "0.1.1" } trailbase-client = { path = "crates/client", version = "0.5.0" } trailbase-extension = { path = "crates/extension", version = "0.3.0" } -trailbase-js = { path = "crates/js-runtime", version = "0.2.0" } trailbase-qs = { path = "crates/qs", version = "0.1.0" } trailbase-refinery = { path = "crates/refinery", version = "0.1.0" } trailbase-schema = { path = "crates/schema", version = "0.1.0" } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 11a538e8..a195cd78 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -13,8 +13,6 @@ name = "trail" [features] default = [] -# Conditionally enable "v8" feature of dep:trailbase. -v8 = ["trailbase/v8"] swagger = ["dep:utoipa-swagger-ui"] vendor-ssl = ["dep:openssl"] diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 95e33812..c959ab5f 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -25,7 +25,6 @@ harness = false [features] default = ["wasm"] -v8 = ["dep:trailbase-js"] wasm = ["dep:trailbase-wasm-runtime-host"] otel = ["dep:axum-tracing-opentelemetry", "dep:init-tracing-opentelemetry"] @@ -93,7 +92,6 @@ tracing-subscriber = { workspace = true } trailbase-assets = { workspace = true } trailbase-build = { workspace = true } trailbase-extension = { workspace = true } -trailbase-js = { workspace = true, optional = true } trailbase-qs = { workspace = true } trailbase-refinery = { workspace = true } trailbase-schema = { workspace = true } diff --git a/crates/core/src/app_state.rs b/crates/core/src/app_state.rs index 8e30c221..1d836cf2 100644 --- a/crates/core/src/app_state.rs +++ b/crates/core/src/app_state.rs @@ -48,9 +48,6 @@ struct InternalState { subscription_manager: SubscriptionManager, object_store: Arc, - #[cfg(feature = "v8")] - runtime: crate::js::RuntimeHandle, - /// Actual WASM runtimes. wasm_runtimes: Vec>>, /// WASM runtime builders needed to rebuild above runtimes, e.g. when hot-reloading. @@ -204,8 +201,6 @@ impl AppState { ), connection_metadata, object_store, - #[cfg(feature = "v8")] - runtime: build_js_runtime(args.conn.clone(), args.runtime_threads), wasm_runtimes: build_wasm_runtime() .expect("startup") .into_iter() @@ -400,11 +395,6 @@ impl AppState { .await; } - #[cfg(feature = "v8")] - pub(crate) fn script_runtime(&self) -> crate::js::RuntimeHandle { - return self.state.runtime.clone(); - } - pub(crate) fn wasm_runtimes(&self) -> &[Arc>] { return &self.state.wasm_runtimes; } @@ -641,8 +631,6 @@ pub async fn test_state(options: Option) -> anyhow::Result, -) -> crate::js::RuntimeHandle { - use crate::js::{RuntimeHandle, register_database_functions}; - - let runtime = if let Some(threads) = threads { - RuntimeHandle::singleton_or_init_with_threads(threads) - } else { - RuntimeHandle::singleton() - }; - - if cfg!(test) { - lazy_static::lazy_static! { - static ref START: std::sync::Once = std::sync::Once::new(); - } - START.call_once(|| { - register_database_functions(&runtime, conn); - }); - } else { - register_database_functions(&runtime, conn); - } - - return runtime; -} - fn build_record_api( conn: trailbase_sqlite::Connection, connection_metadata: &ConnectionMetadata, diff --git a/crates/core/src/js/mod.rs b/crates/core/src/js/mod.rs deleted file mode 100644 index a086ef5f..00000000 --- a/crates/core/src/js/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[cfg(feature = "v8")] -pub(crate) mod runtime; - -#[cfg(feature = "v8")] -pub use trailbase_js::runtime::{RuntimeHandle, register_database_functions}; diff --git a/crates/core/src/js/runtime.rs b/crates/core/src/js/runtime.rs deleted file mode 100644 index adcc4626..00000000 --- a/crates/core/src/js/runtime.rs +++ /dev/null @@ -1,385 +0,0 @@ -use axum::Router; -use axum::body::Body; -use axum::extract::{RawPathParams, Request}; -use axum::http::{HeaderName, HeaderValue, request::Parts}; -use axum::http::{StatusCode, header::CONTENT_TYPE}; -use axum::response::{IntoResponse, Response}; -use futures_util::FutureExt; -use log::*; -use serde::Deserialize; -use std::path::PathBuf; -use std::str::FromStr; -use thiserror::Error; -use tokio::sync::oneshot; - -use trailbase_js::runtime::{ - JsUser, LargeRSError, Message, Module, Runtime, RuntimeHandle, - build_call_async_js_function_message, get_arg, -}; - -use crate::AppState; -use crate::auth::user::User; - -type AnyError = Box; - -pub struct DispatchArgs { - pub method: String, - pub route_path: String, - pub uri: String, - pub path_params: Vec<(String, String)>, - pub headers: Vec<(String, String)>, - pub user: Option, - pub body: bytes::Bytes, - - pub reply: oneshot::Sender>>, -} - -#[derive(Deserialize, Default, Debug)] -pub struct JsHttpResponse { - pub headers: Option>, - pub status: Option, - pub body: Option, -} - -#[derive(Debug, Error)] -pub enum JsHttpResponseError { - #[error("Precondition: {0}")] - Precondition(String), - #[error("Internal: {0}")] - Internal(Box), - #[error("Runtime: {0}")] - Runtime(#[from] Box), -} - -impl IntoResponse for JsHttpResponseError { - fn into_response(self) -> Response { - let (status, body): (StatusCode, Option) = match self { - Self::Precondition(err) => (StatusCode::PRECONDITION_FAILED, Some(err.to_string())), - Self::Internal(err) => (StatusCode::INTERNAL_SERVER_ERROR, Some(err.to_string())), - Self::Runtime(err) => (StatusCode::INTERNAL_SERVER_ERROR, Some(err.to_string())), - }; - - if let Some(body) = body { - return Response::builder() - .status(status) - .header(CONTENT_TYPE, "text/plain") - .body(Body::new(body)) - .unwrap_or_default(); - } - - return Response::builder() - .status(status) - .body(Body::empty()) - .unwrap_or_default(); - } -} - -/// Get's called from JS during `addRoute` and installs an axum HTTP handler. -/// -/// The axum HTTP handler will then call back into the registered callback in JS. -fn add_route_to_router( - runtime_handle: RuntimeHandle, - method: String, - route: String, -) -> Result, AnyError> { - let method_uppercase = method.to_uppercase(); - - let route_path = route.clone(); - let handler = move |params: RawPathParams, user: Option, req: Request| async move { - let (parts, body) = req.into_parts(); - - let Ok(body_bytes) = axum::body::to_bytes(body, usize::MAX).await else { - return Err(JsHttpResponseError::Precondition( - "request deserialization failed".to_string(), - )); - }; - let Parts { uri, headers, .. } = parts; - - let path_params: Vec<(String, String)> = params - .iter() - .map(|(k, v)| (k.to_string(), v.to_string())) - .collect(); - let headers: Vec<(String, String)> = headers - .into_iter() - .filter_map(|(key, value)| { - if let Some(key) = key - && let Ok(value) = value.to_str() - { - return Some((key.to_string(), value.to_string())); - } - return None; - }) - .collect(); - - let js_user: Option = user.map(|u| JsUser { - id: u.id, - email: u.email, - csrf: u.csrf_token, - }); - - let (sender, receiver) = oneshot::channel::>>(); - - debug!("dispatch {method} {uri}"); - runtime_handle - .send_to_any_isolate(build_http_dispatch_message(DispatchArgs { - method, - route_path, - uri: uri.to_string(), - path_params, - headers, - user: js_user, - body: body_bytes, - reply: sender, - })) - .await - .map_err(|_err| JsHttpResponseError::Internal("send failed".into()))?; - - let js_response = receiver - .await - .map_err(|_err| JsHttpResponseError::Internal("receive failed".into()))??; - - let mut http_response = Response::builder() - .status(js_response.status.unwrap_or(200)) - .body(Body::from(js_response.body.unwrap_or_default())) - .map_err(|err| JsHttpResponseError::Internal(err.into()))?; - - if let Some(headers) = js_response.headers { - for (key, value) in headers { - http_response.headers_mut().insert( - HeaderName::from_str(key.as_str()) - .map_err(|err| JsHttpResponseError::Internal(err.into()))?, - HeaderValue::from_str(value.as_str()) - .map_err(|err| JsHttpResponseError::Internal(err.into()))?, - ); - } - } - - return Ok(http_response); - }; - - return Ok(Router::::new().route( - &route, - match method_uppercase.as_str() { - "DELETE" => axum::routing::delete(handler), - "GET" => axum::routing::get(handler), - "HEAD" => axum::routing::head(handler), - "OPTIONS" => axum::routing::options(handler), - "PATCH" => axum::routing::patch(handler), - "POST" => axum::routing::post(handler), - "PUT" => axum::routing::put(handler), - "TRACE" => axum::routing::trace(handler), - _ => { - return Err(format!("method: {method_uppercase}").into()); - } - }, - )); -} - -async fn install_routes_and_jobs( - state: &AppState, - module: Module, -) -> Result>, AnyError> { - let runtime_handle = state.script_runtime(); - let jobs = state.jobs(); - - // For all the isolates/worker-threads. - let receivers: Vec<_> = runtime_handle - .state() - .iter() - .enumerate() - .map(async |(index, state)| { - let module = module.clone(); - let runtime_handle = runtime_handle.clone(); - let jobs = jobs.clone(); - - let (router_sender, router_receiver) = kanal::unbounded::>(); - - if let Err(err) = state - .send_privately(Message::Run( - None, - Box::new(move |_m, runtime: &mut Runtime| { - // First install a native callbacks. - // - // Register native callback for building axum router. - let runtime_handle_clone = runtime_handle.clone(); - runtime - .register_function("install_route", move |args: &[serde_json::Value]| { - let method: String = get_arg(args, 0)?; - let route: String = get_arg(args, 1)?; - - let router = add_route_to_router(runtime_handle_clone.clone(), method, route) - .map_err(|err| LargeRSError::Runtime(err.to_string()))?; - - router_sender.send(router).expect("send"); - - return Ok(serde_json::Value::Null); - }) - .expect("Failed to register 'install_route' function"); - - // Register native callback for registering cron jobs. - runtime - .register_function( - "install_job", - move |args: &[serde_json::Value]| -> Result { - let name: String = get_arg(args, 0)?; - let default_spec: String = get_arg(args, 1)?; - let schedule = cron::Schedule::from_str(&default_spec).map_err(|err| { - return LargeRSError::Runtime(err.to_string()); - })?; - - let runtime_handle = runtime_handle.clone(); - let (id_sender, id_receiver) = oneshot::channel::(); - let id_receiver = id_receiver.shared(); - - let Some(job) = jobs.new_job( - None, - name, - schedule, - crate::scheduler::build_callback(move || { - let runtime_handle = runtime_handle.clone(); - let id_receiver = id_receiver.clone(); - - return async move { - let Some(first_isolate) = runtime_handle.state().first() else { - return Err("Missing isolate".into()); - }; - - let (sender, receiver) = - oneshot::channel::, Box>>(); - let id = id_receiver.await?; - first_isolate - .send_privately(build_call_async_js_function_message::>( - None, - "__dispatchCron", - [id], - sender, - )) - .await?; - - match receiver.await? { - Err(err) => debug!("cron failed: {err}"), - Ok(Some(err)) => debug!("cron failed: {err}"), - _ => {} - }; - - Ok::<_, AnyError>(()) - }; - }), - ) else { - return Err(LargeRSError::Runtime("Failed to add job".to_string())); - }; - - if let Err(err) = id_sender.send(job.id as i64) { - return Err(LargeRSError::Runtime(err.to_string())); - } - - job.start(); - - return Ok(job.id.into()); - }, - ) - .expect("Failed to register 'install_job' function"); - - return None; - }), - )) - .await - { - panic!("Failed to comm with v8 rt'{index}': {err}"); - } - - // Then execute the script/module, i.e. statements in the file scope. - if let Err(err) = state.load_module(module).await { - error!("Failed to load module: {err}"); - return None; - } - - // Now all module-level calls to `install_route` should have happened. Let's drain the - // registered routes. Note, we cannot `collect()` since the sender side never hangs up. - let mut installed_routers: Vec> = vec![]; - match router_receiver.drain_into(&mut installed_routers) { - Ok(n) => debug!("Got {n} routers from JS"), - Err(err) => { - error!("Failed to get routers from JS: {err}"); - return None; - } - }; - - let mut merged_router = Router::::new(); - for router in installed_routers { - if router.has_routes() { - merged_router = merged_router.merge(router); - } - } - return Some(merged_router); - }) - .collect(); - - // Await function registration and module loading for all isolates/worker-threads. - let mut receivers = futures_util::future::join_all(receivers).await; - - // Note: We only return the first router assuming that JS route registration is consistent across - // all isolates. - return Ok(receivers.swap_remove(0)); -} - -pub(crate) async fn load_routes_and_jobs_from_js_modules( - state: &AppState, - scripts_dir: PathBuf, -) -> Result>, AnyError> { - let runtime_handle = state.script_runtime(); - if runtime_handle.num_threads() == 0 { - info!("JS threads set to zero. Skipping initialization for JS modules"); - return Ok(None); - } - - let modules = match Module::load_dir(scripts_dir.clone()) { - Ok(modules) => modules, - Err(err) => { - debug!("Skip loading js modules from '{scripts_dir:?}': {err}"); - return Ok(None); - } - }; - - if !modules.is_empty() { - warn!( - "Found JS/TS scripts. The V8 runtime is deprecated and will likely be \ - removed in the next major release. Please migrate to WASM. If you have \ - concerns or encounter any issues, don't hesitate to reach out." - ); - } - - let mut js_router = Router::new(); - for module in modules { - let fname = module.filename().to_owned(); - - if let Some(router) = install_routes_and_jobs(state, module).await? { - js_router = js_router.merge(router); - } else { - debug!("Skipping js module '{fname:?}': no routes"); - } - } - - if js_router.has_routes() { - return Ok(Some(js_router)); - } - - return Ok(None); -} - -pub fn build_http_dispatch_message(args: DispatchArgs) -> Message { - return build_call_async_js_function_message( - None, - "__dispatch", - serde_json::json!([ - args.method, - args.route_path, - args.uri, - args.path_params, - args.headers, - args.user, - args.body - ]), - args.reply, - ); -} diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 0c97e73f..e9e44454 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -17,7 +17,6 @@ mod data_dir; mod email; mod encryption; mod extract; -mod js; mod listing; mod migrations; mod scheduler; diff --git a/crates/core/src/server/init.rs b/crates/core/src/server/init.rs index 9504b742..1d8ad64e 100644 --- a/crates/core/src/server/init.rs +++ b/crates/core/src/server/init.rs @@ -143,10 +143,6 @@ pub async fn init_app_state(args: InitArgs) -> Result<(bool, AppState), InitErro let object_store = build_objectstore(&args.data_dir, config.server.s3_storage_config.as_ref())?; - // Write out the latest .js/.d.ts runtime files. - #[cfg(feature = "v8")] - trailbase_js::runtime::write_js_runtime_files(args.data_dir.root()).await; - let app_state = AppState::new(AppStateArgs { data_dir: args.data_dir.clone(), public_url: args.public_url, diff --git a/crates/core/src/server/mod.rs b/crates/core/src/server/mod.rs index abaf962a..877183db 100644 --- a/crates/core/src/server/mod.rs +++ b/crates/core/src/server/mod.rs @@ -151,17 +151,6 @@ impl Server { let mut custom_routers: Vec> = vec![]; - #[cfg(feature = "v8")] - if let Some(js_router) = crate::js::runtime::load_routes_and_jobs_from_js_modules( - &state, - state.data_dir().root().join("scripts"), - ) - .await - .map_err(|err| InitError::ScriptError(err.to_string()))? - { - custom_routers.push(js_router); - } - for rt in state.wasm_runtimes() { if let Some(wasm_router) = crate::wasm::install_routes_and_jobs(&state, rt.clone()) .await @@ -643,11 +632,6 @@ async fn start_listen( } }; - #[cfg(not(feature = "v8"))] - tokio_rustls::rustls::crypto::ring::default_provider() - .install_default() - .expect("Failed to install TLS provider"); - let server_config = ServerConfig::builder() .with_no_client_auth() .with_single_cert(vec![cert], key) diff --git a/crates/js-runtime/Cargo.toml b/crates/js-runtime/Cargo.toml deleted file mode 100644 index ca76e8b9..00000000 --- a/crates/js-runtime/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "trailbase-js" -version = "0.2.0" -edition = "2024" -license = "OSL-3.0" -description = "JS runtime for the TrailBase framework" -homepage = "https://trailbase.io" -readme = "../README.md" -exclude = [ - "**/node_modules/", - "**/dist/", -] - -[lib] -doctest = false - -[dependencies] -bytes = { version = "1.8.0", features = ["serde"] } -futures-util = { version = "0.3", default-features = false, features = ["alloc"] } -kanal = "0.1.1" -log = { version = "^0.4.21", default-features = false } -parking_lot = { workspace = true } -rusqlite = { workspace = true } -rust-embed = { workspace = true } -rustyscript = { version = "^0.12.0", features = ["web", "fs"] } -self_cell = "1.2.0" -serde = { workspace = true } -serde_json = { workspace = true } -tokio = { workspace = true } -tracing-subscriber = { workspace = true } -trailbase-schema = { workspace = true } -trailbase-sqlite = { workspace = true } - -[build-dependencies] -trailbase-build = { workspace = true } diff --git a/crates/js-runtime/assets/runtime/.gitignore b/crates/js-runtime/assets/runtime/.gitignore deleted file mode 100644 index 849ddff3..00000000 --- a/crates/js-runtime/assets/runtime/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/crates/js-runtime/assets/runtime/eslint.config.mjs b/crates/js-runtime/assets/runtime/eslint.config.mjs deleted file mode 100644 index 6440a3d5..00000000 --- a/crates/js-runtime/assets/runtime/eslint.config.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; - -export default [ - pluginJs.configs.recommended, - ...tseslint.configs.recommended, - { - ignores: ["dist/", "node_modules/"], - }, - { - files: ["src/**/*.{js,mjs,cjs,mts,ts,tsx,jsx}"], - rules: { - // https://typescript-eslint.io/rules/no-explicit-any/ - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-wrapper-object-types": "warn", - "@typescript-eslint/no-namespace": "off", - "no-var": "off", - // http://eslint.org/docs/rules/no-unused-vars - "@typescript-eslint/no-unused-vars": [ - "error", - { - vars: "all", - args: "after-used", - argsIgnorePattern: "^_", - varsIgnorePattern: "^_", - }, - ], - }, - }, -]; diff --git a/crates/js-runtime/assets/runtime/package.json b/crates/js-runtime/assets/runtime/package.json deleted file mode 100644 index 986b55f9..00000000 --- a/crates/js-runtime/assets/runtime/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "trailbase-js-runtime", - "description": "Runtime for JS/TS execution within TrailBase", - "version": "0.1.0", - "license": "OSL-3.0", - "type": "module", - "homepage": "https://trailbase.io", - "scripts": { - "build": "vite build", - "check": "tsc --noEmit --skipLibCheck && eslint && vitest run", - "format": "prettier -w src", - "test": "vitest run" - }, - "devDependencies": { - "@eslint/js": "^9.39.1", - "eslint": "^9.39.1", - "prettier": "^3.6.2", - "typescript": "^5.9.3", - "typescript-eslint": "^8.46.4", - "vite": "^7.2.2", - "vite-plugin-dts": "^4.5.4", - "vitest": "^3.2.4" - } -} diff --git a/crates/js-runtime/assets/runtime/src/deno.ts b/crates/js-runtime/assets/runtime/src/deno.ts deleted file mode 100644 index 952a1cd1..00000000 --- a/crates/js-runtime/assets/runtime/src/deno.ts +++ /dev/null @@ -1,808 +0,0 @@ -declare namespace Deno { - export interface ReadFileOptions { - /** - * An abort signal to allow cancellation of the file read operation. - * If the signal becomes aborted the readFile operation will be stopped - * and the promise returned will be rejected with an AbortError. - */ - signal?: AbortSignal; - } - - export interface WriteFileOptions { - /** If set to `true`, will append to a file instead of overwriting previous - * contents. - * - * @default {false} */ - append?: boolean; - /** Sets the option to allow creating a new file, if one doesn't already - * exist at the specified path. - * - * @default {true} */ - create?: boolean; - /** If set to `true`, no file, directory, or symlink is allowed to exist at - * the target location. When createNew is set to `true`, `create` is ignored. - * - * @default {false} */ - createNew?: boolean; - /** Permissions always applied to file. */ - mode?: number; - /** An abort signal to allow cancellation of the file write operation. - * - * If the signal becomes aborted the write file operation will be stopped - * and the promise returned will be rejected with an {@linkcode AbortError}. - */ - signal?: AbortSignal; - } - - /** - * Options which can be set when using {@linkcode Deno.makeTempDir}, - * {@linkcode Deno.makeTempDirSync}, {@linkcode Deno.makeTempFile}, and - * {@linkcode Deno.makeTempFileSync}. - * - * @category File System */ - export interface MakeTempOptions { - /** Directory where the temporary directory should be created (defaults to - * the env variable `TMPDIR`, or the system's default, usually `/tmp`). - * - * Note that if the passed `dir` is relative, the path returned by - * `makeTempFile()` and `makeTempDir()` will also be relative. Be mindful of - * this when changing working directory. */ - dir?: string; - /** String that should precede the random portion of the temporary - * directory's name. */ - prefix?: string; - /** String that should follow the random portion of the temporary - * directory's name. */ - suffix?: string; - } - - /** - * Options which can be set when using {@linkcode Deno.mkdir} and - * {@linkcode Deno.mkdirSync}. - * - * @category File System */ - export interface MkdirOptions { - /** If set to `true`, means that any intermediate directories will also be - * created (as with the shell command `mkdir -p`). - * - * Intermediate directories are created with the same permissions. - * - * When recursive is set to `true`, succeeds silently (without changing any - * permissions) if a directory already exists at the path, or if the path - * is a symlink to an existing directory. - * - * @default {false} */ - recursive?: boolean; - /** Permissions to use when creating the directory (defaults to `0o777`, - * before the process's umask). - * - * Ignored on Windows. */ - mode?: number; - } - - /** - * Information about a directory entry returned from {@linkcode Deno.readDir} - * and {@linkcode Deno.readDirSync}. - * - * @category File System */ - export interface DirEntry { - /** The file name of the entry. It is just the entity name and does not - * include the full path. */ - name: string; - /** True if this is info for a regular file. Mutually exclusive to - * `DirEntry.isDirectory` and `DirEntry.isSymlink`. */ - isFile: boolean; - /** True if this is info for a regular directory. Mutually exclusive to - * `DirEntry.isFile` and `DirEntry.isSymlink`. */ - isDirectory: boolean; - /** True if this is info for a symlink. Mutually exclusive to - * `DirEntry.isFile` and `DirEntry.isDirectory`. */ - isSymlink: boolean; - } - - /** - * Options which can be set when doing {@linkcode Deno.open} and - * {@linkcode Deno.openSync}. - * - * @category File System */ - export interface OpenOptions { - /** Sets the option for read access. This option, when `true`, means that - * the file should be read-able if opened. - * - * @default {true} */ - read?: boolean; - /** Sets the option for write access. This option, when `true`, means that - * the file should be write-able if opened. If the file already exists, - * any write calls on it will overwrite its contents, by default without - * truncating it. - * - * @default {false} */ - write?: boolean; - /** Sets the option for the append mode. This option, when `true`, means - * that writes will append to a file instead of overwriting previous - * contents. - * - * Note that setting `{ write: true, append: true }` has the same effect as - * setting only `{ append: true }`. - * - * @default {false} */ - append?: boolean; - /** Sets the option for truncating a previous file. If a file is - * successfully opened with this option set it will truncate the file to `0` - * size if it already exists. The file must be opened with write access - * for truncate to work. - * - * @default {false} */ - truncate?: boolean; - /** Sets the option to allow creating a new file, if one doesn't already - * exist at the specified path. Requires write or append access to be - * used. - * - * @default {false} */ - create?: boolean; - /** If set to `true`, no file, directory, or symlink is allowed to exist at - * the target location. Requires write or append access to be used. When - * createNew is set to `true`, create and truncate are ignored. - * - * @default {false} */ - createNew?: boolean; - /** Permissions to use if creating the file (defaults to `0o666`, before - * the process's umask). - * - * Ignored on Windows. */ - mode?: number; - } - - /** - * Options which can be set when using {@linkcode Deno.remove} and - * {@linkcode Deno.removeSync}. - * - * @category File System */ - export interface RemoveOptions { - /** If set to `true`, path will be removed even if it's a non-empty directory. - * - * @default {false} */ - recursive?: boolean; - } - - /** Options that can be used with {@linkcode symlink} and - * {@linkcode symlinkSync}. - * - * @category File System */ - export interface SymlinkOptions { - /** Specify the symbolic link type as file, directory or NTFS junction. This - * option only applies to Windows and is ignored on other operating systems. */ - type: "file" | "dir" | "junction"; - } - - export function writeFile( - path: string | URL, - data: Uint8Array | ReadableStream, - options?: WriteFileOptions, - ): Promise; - - export function writeTextFile( - path: string | URL, - data: string | ReadableStream, - options?: WriteFileOptions, - ): Promise; - - export function readTextFile( - path: string | URL, - options?: ReadFileOptions, - ): Promise; - - export function readFile( - path: string | URL, - options?: ReadFileOptions, - ): Promise; - - export function chmod(path: string | URL, mode: number): Promise; - - export function chown( - path: string | URL, - uid: number | null, - gid: number | null, - ): Promise; - - export function cwd(): string; - - export function makeTempDir(options?: MakeTempOptions): Promise; - - export function makeTempFile(options?: MakeTempOptions): Promise; - - export function mkdir( - path: string | URL, - options?: MkdirOptions, - ): Promise; - - export function chdir(directory: string | URL): void; - - export function copyFile( - fromPath: string | URL, - toPath: string | URL, - ): Promise; - - export function readDir(path: string | URL): AsyncIterable; - - export function readLink(path: string | URL): Promise; - - export function realPath(path: string | URL): Promise; - - export function remove( - path: string | URL, - options?: RemoveOptions, - ): Promise; - - export function rename( - oldpath: string | URL, - newpath: string | URL, - ): Promise; - - export function stat(path: string | URL): Promise; - - export function lstat(path: string | URL): Promise; - - export function truncate(name: string, len?: number): Promise; - - export function open( - path: string | URL, - options?: OpenOptions, - ): Promise; - - export function create(path: string | URL): Promise; - - export function symlink( - oldpath: string | URL, - newpath: string | URL, - options?: SymlinkOptions, - ): Promise; - - export function link(oldpath: string, newpath: string): Promise; - - export function utime( - path: string | URL, - atime: number | Date, - mtime: number | Date, - ): Promise; - - export function umask(mask?: number): number; - - /** Provides information about a file and is returned by - * {@linkcode Deno.stat}, {@linkcode Deno.lstat}, {@linkcode Deno.statSync}, - * and {@linkcode Deno.lstatSync} or from calling `stat()` and `statSync()` - * on an {@linkcode Deno.FsFile} instance. - * - * @category File System - */ - export interface FileInfo { - /** True if this is info for a regular file. Mutually exclusive to - * `FileInfo.isDirectory` and `FileInfo.isSymlink`. */ - isFile: boolean; - /** True if this is info for a regular directory. Mutually exclusive to - * `FileInfo.isFile` and `FileInfo.isSymlink`. */ - isDirectory: boolean; - /** True if this is info for a symlink. Mutually exclusive to - * `FileInfo.isFile` and `FileInfo.isDirectory`. */ - isSymlink: boolean; - /** The size of the file, in bytes. */ - size: number; - /** The last modification time of the file. This corresponds to the `mtime` - * field from `stat` on Linux/Mac OS and `ftLastWriteTime` on Windows. This - * may not be available on all platforms. */ - mtime: Date | null; - /** The last access time of the file. This corresponds to the `atime` - * field from `stat` on Unix and `ftLastAccessTime` on Windows. This may not - * be available on all platforms. */ - atime: Date | null; - /** The creation time of the file. This corresponds to the `birthtime` - * field from `stat` on Mac/BSD and `ftCreationTime` on Windows. This may - * not be available on all platforms. */ - birthtime: Date | null; - /** The last change time of the file. This corresponds to the `ctime` - * field from `stat` on Mac/BSD and `ChangeTime` on Windows. This may - * not be available on all platforms. */ - ctime: Date | null; - /** ID of the device containing the file. */ - dev: number; - /** Inode number. - * - * _Linux/Mac OS only._ */ - ino: number | null; - /** The underlying raw `st_mode` bits that contain the standard Unix - * permissions for this file/directory. - */ - mode: number | null; - /** Number of hard links pointing to this file. - * - * _Linux/Mac OS only._ */ - nlink: number | null; - /** User ID of the owner of this file. - * - * _Linux/Mac OS only._ */ - uid: number | null; - /** Group ID of the owner of this file. - * - * _Linux/Mac OS only._ */ - gid: number | null; - /** Device ID of this file. - * - * _Linux/Mac OS only._ */ - rdev: number | null; - /** Blocksize for filesystem I/O. - * - * _Linux/Mac OS only._ */ - blksize: number | null; - /** Number of blocks allocated to the file, in 512-byte units. - * - * _Linux/Mac OS only._ */ - blocks: number | null; - /** True if this is info for a block device. - * - * _Linux/Mac OS only._ */ - isBlockDevice: boolean | null; - /** True if this is info for a char device. - * - * _Linux/Mac OS only._ */ - isCharDevice: boolean | null; - /** True if this is info for a fifo. - * - * _Linux/Mac OS only._ */ - isFifo: boolean | null; - /** True if this is info for a socket. - * - * _Linux/Mac OS only._ */ - isSocket: boolean | null; - } - - /** - * A enum which defines the seek mode for IO related APIs that support - * seeking. - * - * @category I/O */ - export enum SeekMode { - /* Seek from the start of the file/resource. */ - Start = 0, - /* Seek from the current position within the file/resource. */ - Current = 1, - /* Seek from the end of the current file/resource. */ - End = 2, - } - - /** @category I/O */ - export interface SetRawOptions { - /** - * The `cbreak` option can be used to indicate that characters that - * correspond to a signal should still be generated. When disabling raw - * mode, this option is ignored. This functionality currently only works on - * Linux and Mac OS. - */ - cbreak: boolean; - } - - export class FsFile implements Disposable { - /** A {@linkcode ReadableStream} instance representing to the byte contents - * of the file. This makes it easy to interoperate with other web streams - * based APIs. - * - * ```ts - * using file = await Deno.open("my_file.txt", { read: true }); - * const decoder = new TextDecoder(); - * for await (const chunk of file.readable) { - * console.log(decoder.decode(chunk)); - * } - * ``` - */ - readonly readable: ReadableStream; - /** A {@linkcode WritableStream} instance to write the contents of the - * file. This makes it easy to interoperate with other web streams based - * APIs. - * - * ```ts - * const items = ["hello", "world"]; - * using file = await Deno.open("my_file.txt", { write: true }); - * const encoder = new TextEncoder(); - * const writer = file.writable.getWriter(); - * for (const item of items) { - * await writer.write(encoder.encode(item)); - * } - * ``` - */ - readonly writable: WritableStream; - /** Write the contents of the array buffer (`p`) to the file. - * - * Resolves to the number of bytes written. - * - * **It is not guaranteed that the full buffer will be written in a single - * call.** - * - * ```ts - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world"); - * using file = await Deno.open("/foo/bar.txt", { write: true }); - * const bytesWritten = await file.write(data); // 11 - * ``` - * - * @category I/O - */ - write(p: Uint8Array): Promise; - /** Synchronously write the contents of the array buffer (`p`) to the file. - * - * Returns the number of bytes written. - * - * **It is not guaranteed that the full buffer will be written in a single - * call.** - * - * ```ts - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world"); - * using file = Deno.openSync("/foo/bar.txt", { write: true }); - * const bytesWritten = file.writeSync(data); // 11 - * ``` - */ - writeSync(p: Uint8Array): number; - /** Truncates (or extends) the file to reach the specified `len`. If `len` - * is not specified, then the entire file contents are truncated. - * - * ### Truncate the entire file - * - * ```ts - * using file = await Deno.open("my_file.txt", { write: true }); - * await file.truncate(); - * ``` - * - * ### Truncate part of the file - * - * ```ts - * // if "my_file.txt" contains the text "hello world": - * using file = await Deno.open("my_file.txt", { write: true }); - * await file.truncate(7); - * const buf = new Uint8Array(100); - * await file.read(buf); - * const text = new TextDecoder().decode(buf); // "hello w" - * ``` - */ - truncate(len?: number): Promise; - /** Synchronously truncates (or extends) the file to reach the specified - * `len`. If `len` is not specified, then the entire file contents are - * truncated. - * - * ### Truncate the entire file - * - * ```ts - * using file = Deno.openSync("my_file.txt", { write: true }); - * file.truncateSync(); - * ``` - * - * ### Truncate part of the file - * - * ```ts - * // if "my_file.txt" contains the text "hello world": - * using file = Deno.openSync("my_file.txt", { write: true }); - * file.truncateSync(7); - * const buf = new Uint8Array(100); - * file.readSync(buf); - * const text = new TextDecoder().decode(buf); // "hello w" - * ``` - */ - truncateSync(len?: number): void; - /** Read the file into an array buffer (`p`). - * - * Resolves to either the number of bytes read during the operation or EOF - * (`null`) if there was nothing more to read. - * - * It is possible for a read to successfully return with `0` bytes. This - * does not indicate EOF. - * - * **It is not guaranteed that the full buffer will be read in a single - * call.** - * - * ```ts - * // if "/foo/bar.txt" contains the text "hello world": - * using file = await Deno.open("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const numberOfBytesRead = await file.read(buf); // 11 bytes - * const text = new TextDecoder().decode(buf); // "hello world" - * ``` - */ - read(p: Uint8Array): Promise; - /** Synchronously read from the file into an array buffer (`p`). - * - * Returns either the number of bytes read during the operation or EOF - * (`null`) if there was nothing more to read. - * - * It is possible for a read to successfully return with `0` bytes. This - * does not indicate EOF. - * - * **It is not guaranteed that the full buffer will be read in a single - * call.** - * - * ```ts - * // if "/foo/bar.txt" contains the text "hello world": - * using file = Deno.openSync("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const numberOfBytesRead = file.readSync(buf); // 11 bytes - * const text = new TextDecoder().decode(buf); // "hello world" - * ``` - */ - readSync(p: Uint8Array): number | null; - /** Seek to the given `offset` under mode given by `whence`. The call - * resolves to the new position within the resource (bytes from the start). - * - * ```ts - * // Given the file contains "Hello world" text, which is 11 bytes long: - * using file = await Deno.open( - * "hello.txt", - * { read: true, write: true, truncate: true, create: true }, - * ); - * await file.write(new TextEncoder().encode("Hello world")); - * - * // advance cursor 6 bytes - * const cursorPosition = await file.seek(6, Deno.SeekMode.Start); - * console.log(cursorPosition); // 6 - * const buf = new Uint8Array(100); - * await file.read(buf); - * console.log(new TextDecoder().decode(buf)); // "world" - * ``` - * - * The seek modes work as follows: - * - * ```ts - * // Given the file contains "Hello world" text, which is 11 bytes long: - * const file = await Deno.open( - * "hello.txt", - * { read: true, write: true, truncate: true, create: true }, - * ); - * await file.write(new TextEncoder().encode("Hello world")); - * - * // Seek 6 bytes from the start of the file - * console.log(await file.seek(6, Deno.SeekMode.Start)); // "6" - * // Seek 2 more bytes from the current position - * console.log(await file.seek(2, Deno.SeekMode.Current)); // "8" - * // Seek backwards 2 bytes from the end of the file - * console.log(await file.seek(-2, Deno.SeekMode.End)); // "9" (i.e. 11-2) - * ``` - */ - seek(offset: number | bigint, whence: SeekMode): Promise; - /** Synchronously seek to the given `offset` under mode given by `whence`. - * The new position within the resource (bytes from the start) is returned. - * - * ```ts - * using file = Deno.openSync( - * "hello.txt", - * { read: true, write: true, truncate: true, create: true }, - * ); - * file.writeSync(new TextEncoder().encode("Hello world")); - * - * // advance cursor 6 bytes - * const cursorPosition = file.seekSync(6, Deno.SeekMode.Start); - * console.log(cursorPosition); // 6 - * const buf = new Uint8Array(100); - * file.readSync(buf); - * console.log(new TextDecoder().decode(buf)); // "world" - * ``` - * - * The seek modes work as follows: - * - * ```ts - * // Given the file contains "Hello world" text, which is 11 bytes long: - * using file = Deno.openSync( - * "hello.txt", - * { read: true, write: true, truncate: true, create: true }, - * ); - * file.writeSync(new TextEncoder().encode("Hello world")); - * - * // Seek 6 bytes from the start of the file - * console.log(file.seekSync(6, Deno.SeekMode.Start)); // "6" - * // Seek 2 more bytes from the current position - * console.log(file.seekSync(2, Deno.SeekMode.Current)); // "8" - * // Seek backwards 2 bytes from the end of the file - * console.log(file.seekSync(-2, Deno.SeekMode.End)); // "9" (i.e. 11-2) - * ``` - */ - seekSync(offset: number | bigint, whence: SeekMode): number; - /** Resolves to a {@linkcode Deno.FileInfo} for the file. - * - * ```ts - * import { assert } from "jsr:@std/assert"; - * - * using file = await Deno.open("hello.txt"); - * const fileInfo = await file.stat(); - * assert(fileInfo.isFile); - * ``` - */ - stat(): Promise; - /** Synchronously returns a {@linkcode Deno.FileInfo} for the file. - * - * ```ts - * import { assert } from "jsr:@std/assert"; - * - * using file = Deno.openSync("hello.txt") - * const fileInfo = file.statSync(); - * assert(fileInfo.isFile); - * ``` - */ - statSync(): FileInfo; - /** - * Flushes any pending data and metadata operations of the given file - * stream to disk. - * - * ```ts - * const file = await Deno.open( - * "my_file.txt", - * { read: true, write: true, create: true }, - * ); - * await file.write(new TextEncoder().encode("Hello World")); - * await file.truncate(1); - * await file.sync(); - * console.log(await Deno.readTextFile("my_file.txt")); // H - * ``` - * - * @category I/O - */ - sync(): Promise; - /** - * Synchronously flushes any pending data and metadata operations of the given - * file stream to disk. - * - * ```ts - * const file = Deno.openSync( - * "my_file.txt", - * { read: true, write: true, create: true }, - * ); - * file.writeSync(new TextEncoder().encode("Hello World")); - * file.truncateSync(1); - * file.syncSync(); - * console.log(Deno.readTextFileSync("my_file.txt")); // H - * ``` - * - * @category I/O - */ - syncSync(): void; - /** - * Flushes any pending data operations of the given file stream to disk. - * ```ts - * using file = await Deno.open( - * "my_file.txt", - * { read: true, write: true, create: true }, - * ); - * await file.write(new TextEncoder().encode("Hello World")); - * await file.syncData(); - * console.log(await Deno.readTextFile("my_file.txt")); // Hello World - * ``` - * - * @category I/O - */ - syncData(): Promise; - /** - * Synchronously flushes any pending data operations of the given file stream - * to disk. - * - * ```ts - * using file = Deno.openSync( - * "my_file.txt", - * { read: true, write: true, create: true }, - * ); - * file.writeSync(new TextEncoder().encode("Hello World")); - * file.syncDataSync(); - * console.log(Deno.readTextFileSync("my_file.txt")); // Hello World - * ``` - * - * @category I/O - */ - syncDataSync(): void; - /** - * Changes the access (`atime`) and modification (`mtime`) times of the - * file stream resource. Given times are either in seconds (UNIX epoch - * time) or as `Date` objects. - * - * ```ts - * using file = await Deno.open("file.txt", { create: true, write: true }); - * await file.utime(1556495550, new Date()); - * ``` - * - * @category File System - */ - utime(atime: number | Date, mtime: number | Date): Promise; - /** - * Synchronously changes the access (`atime`) and modification (`mtime`) - * times of the file stream resource. Given times are either in seconds - * (UNIX epoch time) or as `Date` objects. - * - * ```ts - * using file = Deno.openSync("file.txt", { create: true, write: true }); - * file.utime(1556495550, new Date()); - * ``` - * - * @category File System - */ - utimeSync(atime: number | Date, mtime: number | Date): void; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Checks if the file resource is a TTY (terminal). - * - * ```ts - * // This example is system and context specific - * using file = await Deno.open("/dev/tty6"); - * file.isTerminal(); // true - * ``` - */ - isTerminal(): boolean; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Set TTY to be under raw mode or not. In raw mode, characters are read and - * returned as is, without being processed. All special processing of - * characters by the terminal is disabled, including echoing input - * characters. Reading from a TTY device in raw mode is faster than reading - * from a TTY device in canonical mode. - * - * ```ts - * using file = await Deno.open("/dev/tty6"); - * file.setRaw(true, { cbreak: true }); - * ``` - */ - setRaw(mode: boolean, options?: SetRawOptions): void; - /** - * Acquire an advisory file-system lock for the file. - * - * @param [exclusive=false] - */ - lock(exclusive?: boolean): Promise; - /** - * Synchronously acquire an advisory file-system lock synchronously for the file. - * - * @param [exclusive=false] - */ - lockSync(exclusive?: boolean): void; - /** - * Release an advisory file-system lock for the file. - */ - unlock(): Promise; - /** - * Synchronously release an advisory file-system lock for the file. - */ - unlockSync(): void; - /** Close the file. Closing a file when you are finished with it is - * important to avoid leaking resources. - * - * ```ts - * using file = await Deno.open("my_file.txt"); - * // do work with "file" object - * ``` - */ - close(): void; - - [Symbol.dispose](): void; - } -} - -// NOTE: Ideally we'd pull in Deno types from https://github.com/denoland/deno/blob/main/cli/tsc/dts/lib.deno.ns.d.ts but haven't found a good way. -export namespace fs { - export const writeFile = Deno.writeFile; - export const writeTextFile = Deno.writeTextFile; - export const readTextFile = Deno.readTextFile; - export const readFile = Deno.readFile; - export const chmod = Deno.chmod; - export const chown = Deno.chown; - export const cwd = Deno.cwd; - export const makeTempDir = Deno.makeTempDir; - export const makeTempFile = Deno.makeTempFile; - export const mkdir = Deno.mkdir; - export const chdir = Deno.chdir; - export const copyFile = Deno.copyFile; - export const readDir = Deno.readDir; - export const readLink = Deno.readLink; - export const realPath = Deno.realPath; - export const remove = Deno.remove; - export const rename = Deno.rename; - export const stat = Deno.stat; - export const lstat = Deno.lstat; - export const truncate = Deno.truncate; - export const FsFile = Deno.FsFile; - export const open = Deno.open; - export const create = Deno.create; - export const symlink = Deno.symlink; - export const link = Deno.link; - export const utime = Deno.utime; - export const umask = Deno.umask; -} diff --git a/crates/js-runtime/assets/runtime/src/index.ts b/crates/js-runtime/assets/runtime/src/index.ts deleted file mode 100644 index 0a8b8aa8..00000000 --- a/crates/js-runtime/assets/runtime/src/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -export { fs } from "./deno"; - -// Redirect console output to stderr, to keep stdout for request logs. -declare global { - var Deno: { - core: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - print: any; - }; - }; -} -const _logStderr = function (...args: unknown[]) { - globalThis.Deno.core.print(`${args.join(" ")}\n`, /* to stderr = */ true); -}; -globalThis.console.log = _logStderr; -globalThis.console.info = _logStderr; -globalThis.console.debug = _logStderr; - -export { - HttpError, - StatusCodes, - addCronCallback, - addPeriodicCallback, - addRoute, - execute, - htmlHandler, - jsonHandler, - parsePath, - query, - stringHandler, - transaction, - Transaction, -} from "./trailbase"; - -export type { - Blob, - CallbackType, - HeaderMapType, - HtmlResponseType, - JsonRequestType, - JsonResponseType, - MaybeResponse, - Method, - ParsedPath, - PathParamsType, - RequestType, - ResponseType, - StringRequestType, - StringResponseType, - UserType, -} from "./trailbase"; diff --git a/crates/js-runtime/assets/runtime/src/trailbase.ts b/crates/js-runtime/assets/runtime/src/trailbase.ts deleted file mode 100644 index e08b8bcd..00000000 --- a/crates/js-runtime/assets/runtime/src/trailbase.ts +++ /dev/null @@ -1,791 +0,0 @@ -import { decodeFallback, encodeFallback } from "./util"; - -declare global { - function __dispatch( - m: Method, - route: string, - uri: string, - path: [string, string][], - headers: [string, string][], - user: UserType | undefined, - body: Uint8Array, - ): Promise; - - function __dispatchCron(id: number): Promise; - - var rustyscript: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - functions: any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async_functions: any; - }; -} - -export type HeaderMapType = { [key: string]: string }; -export type PathParamsType = { [key: string]: string }; -export type UserType = { - /// Base64 encoded UUIDv7 user id. - id: string; - /// The user's email address. - email: string; - /// The user's CSRF token. - csrf: string; -}; -export type RequestType = { - uri: string; - params: PathParamsType; - headers: HeaderMapType; - user?: UserType; - body?: Uint8Array; -}; -export type ResponseType = { - headers?: [string, string][]; - status?: number; - body?: Uint8Array; -}; -export type MaybeResponse = Promise | T | undefined; -export type CallbackType = (req: RequestType) => MaybeResponse; -export type Method = - | "DELETE" - | "GET" - | "HEAD" - | "OPTIONS" - | "PATCH" - | "POST" - | "PUT" - | "TRACE"; - -/// HTTP status codes. -/// -// source: https://github.com/prettymuchbryce/http-status-codes/blob/master/src/status-codes.ts -export enum StatusCodes { - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1 - /// - /// This interim response indicates that everything so far is OK and that the - /// client should continue with the request or ignore it if it is already - /// finished. - CONTINUE = 100, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2 - /// - /// This code is sent in response to an Upgrade request header by the client, - /// and indicates the protocol the server is switching too. - SWITCHING_PROTOCOLS = 101, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1 - /// - /// This code indicates that the server has received and is processing the - /// request, but no response is available yet. - PROCESSING = 102, - /// Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3 - /// - /// This code indicates to the client that the server is likely to send a - /// final response with the header fields included in the informational - /// response. - EARLY_HINTS = 103, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1 - /// - /// The request has succeeded. The meaning of a success varies depending on the HTTP method: - /// GET: The resource has been fetched and is transmitted in the message body. - /// HEAD: The entity headers are in the message body. - /// POST: The resource describing the result of the action is transmitted in the message body. - /// TRACE: The message body contains the request message as received by the server - OK = 200, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2 - /// - /// The request has succeeded and a new resource has been created as a result - /// of it. This is typically the response sent after a PUT request. - CREATED = 201, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3 - /// - /// The request has been received but not yet acted upon. It is - /// non-committal, meaning that there is no way in HTTP to later send an - /// asynchronous response indicating the outcome of processing the request. It - /// is intended for cases where another process or server handles the request, - /// or for batch processing. - ACCEPTED = 202, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4 - /// - /// This response code means returned meta-information set is not exact set - /// as available from the origin server, but collected from a local or a third - /// party copy. Except this condition, 200 OK response should be preferred - /// instead of this response. - NON_AUTHORITATIVE_INFORMATION = 203, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5 - /// - /// There is no content to send for this request, but the headers may be - /// useful. The user-agent may update its cached headers for this resource with - /// the new ones. - NO_CONTENT = 204, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6 - /// - /// This response code is sent after accomplishing request to tell user agent - /// reset document view which sent this request. - RESET_CONTENT = 205, - /// Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1 - /// - /// This response code is used because of range header sent by the client to - /// separate download into multiple streams. - PARTIAL_CONTENT = 206, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2 - /// - /// A Multi-Status response conveys information about multiple resources in - /// situations where multiple status codes might be appropriate. - MULTI_STATUS = 207, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1 - /// - /// The request has more than one possible responses. User-agent or user - /// should choose one of them. There is no standardized way to choose one of - /// the responses. - MULTIPLE_CHOICES = 300, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2 - /// - /// This response code means that URI of requested resource has been changed. - /// Probably, new URI would be given in the response. - MOVED_PERMANENTLY = 301, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3 - /// - /// This response code means that URI of requested resource has been changed - /// temporarily. New changes in the URI might be made in the future. Therefore, - /// this same URI should be used by the client in future requests. - MOVED_TEMPORARILY = 302, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4 - /// - /// Server sent this response to directing client to get requested resource - /// to another URI with an GET request. - SEE_OTHER = 303, - /// Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1 - /// - /// This is used for caching purposes. It is telling to client that response - /// has not been modified. So, client can continue to use same cached version - /// of response. - NOT_MODIFIED = 304, - /// @deprecated - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6 - /// - /// Was defined in a previous version of the HTTP specification to indicate - /// that a requested response must be accessed by a proxy. It has been - /// deprecated due to security concerns regarding in-band configuration of a - /// proxy. - USE_PROXY = 305, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7 - /// - /// Server sent this response to directing client to get requested resource - /// to another URI with same method that used prior request. This has the same - /// semantic than the 302 Found HTTP response code, with the exception that the - /// user agent must not change the HTTP method used: if a POST was used in the - /// first request, a POST must be used in the second request. - TEMPORARY_REDIRECT = 307, - /// Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3 - /// - /// This means that the resource is now permanently located at another URI, - /// specified by the Location: HTTP Response header. This has the same - /// semantics as the 301 Moved Permanently HTTP response code, with the - /// exception that the user agent must not change the HTTP method used: if a - /// POST was used in the first request, a POST must be used in the second - /// request. - PERMANENT_REDIRECT = 308, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1 - /// - /// This response means that server could not understand the request due to invalid syntax. - BAD_REQUEST = 400, - /// Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1 - /// - /// Although the HTTP standard specifies "unauthorized", semantically this - /// response means "unauthenticated". That is, the client must authenticate - /// itself to get the requested response. - UNAUTHORIZED = 401, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2 - /// - /// This response code is reserved for future use. Initial aim for creating - /// this code was using it for digital payment systems however this is not used - /// currently. - PAYMENT_REQUIRED = 402, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3 - /// - /// The client does not have access rights to the content, i.e. they are - /// unauthorized, so server is rejecting to give proper response. Unlike 401, - /// the client's identity is known to the server. - FORBIDDEN = 403, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4 - /// - /// The server can not find requested resource. In the browser, this means - /// the URL is not recognized. In an API, this can also mean that the endpoint - /// is valid but the resource itself does not exist. Servers may also send this - /// response instead of 403 to hide the existence of a resource from an - /// unauthorized client. This response code is probably the most famous one due - /// to its frequent occurence on the web. - NOT_FOUND = 404, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5 - /// - /// The request method is known by the server but has been disabled and - /// cannot be used. For example, an API may forbid DELETE-ing a resource. The - /// two mandatory methods, GET and HEAD, must never be disabled and should not - /// return this error code. - METHOD_NOT_ALLOWED = 405, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6 - /// - /// This response is sent when the web server, after performing server-driven - /// content negotiation, doesn't find any content following the criteria given - /// by the user agent. - NOT_ACCEPTABLE = 406, - /// Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2 - /// - /// This is similar to 401 but authentication is needed to be done by a proxy. - PROXY_AUTHENTICATION_REQUIRED = 407, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7 - /// - /// This response is sent on an idle connection by some servers, even without - /// any previous request by the client. It means that the server would like to - /// shut down this unused connection. This response is used much more since - /// some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection - /// mechanisms to speed up surfing. Also note that some servers merely shut - /// down the connection without sending this message. - REQUEST_TIMEOUT = 408, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8 - /// - /// This response is sent when a request conflicts with the current state of the server. - CONFLICT = 409, - /// - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9 - /// - /// This response would be sent when the requested content has been - /// permenantly deleted from server, with no forwarding address. Clients are - /// expected to remove their caches and links to the resource. The HTTP - /// specification intends this status code to be used for "limited-time, - /// promotional services". APIs should not feel compelled to indicate resources - /// that have been deleted with this status code. - GONE = 410, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10 - /// - /// The server rejected the request because the Content-Length header field - /// is not defined and the server requires it. - LENGTH_REQUIRED = 411, - /// Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2 - /// - /// The client has indicated preconditions in its headers which the server - /// does not meet. - PRECONDITION_FAILED = 412, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11 - /// - /// Request entity is larger than limits defined by server; the server might - /// close the connection or return an Retry-After header field. - REQUEST_TOO_LONG = 413, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12 - /// - /// The URI requested by the client is longer than the server is willing to interpret. - REQUEST_URI_TOO_LONG = 414, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13 - /// - /// The media format of the requested data is not supported by the server, so - /// the server is rejecting the request. - UNSUPPORTED_MEDIA_TYPE = 415, - /// Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4 - /// - /// The range specified by the Range header field in the request can't be - /// fulfilled; it's possible that the range is outside the size of the target - /// URI's data. - REQUESTED_RANGE_NOT_SATISFIABLE = 416, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14 - /// - /// This response code means the expectation indicated by the Expect request - /// header field can't be met by the server. - EXPECTATION_FAILED = 417, - /// Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2 - /// - /// Any attempt to brew coffee with a teapot should result in the error code - /// "418 I'm a teapot". The resulting entity body MAY be short and stout. - IM_A_TEAPOT = 418, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6 - /// - /// The 507 (Insufficient Storage) status code means the method could not be - /// performed on the resource because the server is unable to store the - /// representation needed to successfully complete the request. This condition - /// is considered to be temporary. If the request which received this status - /// code was the result of a user action, the request MUST NOT be repeated - /// until it is requested by a separate user action. - INSUFFICIENT_SPACE_ON_RESOURCE = 419, - /// @deprecated - /// Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt - /// - /// A deprecated response used by the Spring Framework when a method has failed. - METHOD_FAILURE = 420, - /// Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2 - /// - /// Defined in the specification of HTTP/2 to indicate that a server is not - /// able to produce a response for the combination of scheme and authority that - /// are included in the request URI. - MISDIRECTED_REQUEST = 421, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3 - /// - /// The request was well-formed but was unable to be followed due to semantic errors. - UNPROCESSABLE_ENTITY = 422, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4 - /// - /// The resource that is being accessed is locked. - LOCKED = 423, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5 - /// - /// The request failed due to failure of a previous request. - FAILED_DEPENDENCY = 424, - /// Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15 - /// - /// The server refuses to perform the request using the current protocol but - /// might be willing to do so after the client upgrades to a different - /// protocol. - UPGRADE_REQUIRED = 426, - /// Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3 - /// - /// The origin server requires the request to be conditional. Intended to - /// prevent the 'lost update' problem, where a client GETs a resource's state, - /// modifies it, and PUTs it back to the server, when meanwhile a third party - /// has modified the state on the server, leading to a conflict. - PRECONDITION_REQUIRED = 428, - /// Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4 - /// - /// The user has sent too many requests in a given amount of time ("rate limiting"). - TOO_MANY_REQUESTS = 429, - /// Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5 - /// - /// The server is unwilling to process the request because its header fields - /// are too large. The request MAY be resubmitted after reducing the size of - /// the request header fields. - REQUEST_HEADER_FIELDS_TOO_LARGE = 431, - /// Official Documentation @ https://tools.ietf.org/html/rfc7725 - /// - /// The user-agent requested a resource that cannot legally be provided, such - /// as a web page censored by a government. - UNAVAILABLE_FOR_LEGAL_REASONS = 451, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1 - /// - /// The server encountered an unexpected condition that prevented it from - /// fulfilling the request. - INTERNAL_SERVER_ERROR = 500, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2 - /// - /// The request method is not supported by the server and cannot be handled. - /// The only methods that servers are required to support (and therefore that - /// must not return this code) are GET and HEAD. - NOT_IMPLEMENTED = 501, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3 - /// - /// This error response means that the server, while working as a gateway to - /// get a response needed to handle the request, got an invalid response. - BAD_GATEWAY = 502, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4 - /// - /// The server is not ready to handle the request. Common causes are a server - /// that is down for maintenance or that is overloaded. Note that together with - /// this response, a user-friendly page explaining the problem should be sent. - /// This responses should be used for temporary conditions and the Retry-After: - /// HTTP header should, if possible, contain the estimated time before the - /// recovery of the service. The webmaster must also take care about the - /// caching-related headers that are sent along with this response, as these - /// temporary condition responses should usually not be cached. - SERVICE_UNAVAILABLE = 503, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5 - /// - /// This error response is given when the server is acting as a gateway and - /// cannot get a response in time. - GATEWAY_TIMEOUT = 504, - /// Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6 - /// - /// The HTTP version used in the request is not supported by the server. - HTTP_VERSION_NOT_SUPPORTED = 505, - /// Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6 - /// - /// The server has an internal configuration error: the chosen variant - /// resource is configured to engage in transparent content negotiation itself, - /// and is therefore not a proper end point in the negotiation process. - INSUFFICIENT_STORAGE = 507, - /// Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6 - /// - /// The 511 status code indicates that the client needs to authenticate to - /// gain network access. - NETWORK_AUTHENTICATION_REQUIRED = 511, -} - -export class HttpError extends Error { - readonly statusCode: number; - readonly headers: [string, string][] | undefined; - - constructor( - statusCode: number, - message?: string, - headers?: [string, string][], - ) { - super(message); - this.statusCode = statusCode; - this.headers = headers; - } - - public override toString(): string { - return `HttpError(${this.statusCode}, ${this.message})`; - } - - toResponse(): ResponseType { - const m = this.message; - return { - headers: this.headers, - status: this.statusCode, - body: m !== "" ? encodeFallback(m) : undefined, - }; - } -} - -export type StringRequestType = { - uri: string; - params: PathParamsType; - headers: HeaderMapType; - user?: UserType; - body?: string; -}; -export type StringResponseType = { - headers?: [string, string][]; - status?: number; - body: string; -}; - -export function stringHandler( - f: (req: StringRequestType) => MaybeResponse, -): CallbackType { - return async (req: RequestType): Promise => { - try { - const body = req.body; - const resp: StringResponseType | string | undefined = await f({ - uri: req.uri, - params: req.params, - headers: req.headers, - user: req.user, - body: body && decodeFallback(body), - }); - - if (resp === undefined) { - return undefined; - } - - if (typeof resp === "string") { - return { - status: StatusCodes.OK, - body: encodeFallback(resp), - }; - } - - const respBody = resp.body; - return { - headers: resp.headers, - status: resp.status, - body: respBody ? encodeFallback(respBody) : undefined, - }; - } catch (err) { - if (err instanceof HttpError) { - return err.toResponse(); - } - return { - status: StatusCodes.INTERNAL_SERVER_ERROR, - body: encodeFallback(`Uncaught error: ${err}`), - }; - } - }; -} - -export type HtmlResponseType = { - headers?: [string, string][]; - status?: number; - body: string; -}; - -export function htmlHandler( - f: (req: StringRequestType) => MaybeResponse, -): CallbackType { - return async (req: RequestType): Promise => { - try { - const body = req.body; - const resp: HtmlResponseType | string | undefined = await f({ - uri: req.uri, - params: req.params, - headers: req.headers, - user: req.user, - body: body && decodeFallback(body), - }); - - if (resp === undefined) { - return undefined; - } - - if (typeof resp === "string") { - return { - headers: [["content-type", "text/html"]], - status: StatusCodes.OK, - body: encodeFallback(resp), - }; - } - - const respBody = resp.body; - return { - headers: [["content-type", "text/html"], ...(resp.headers ?? [])], - status: resp.status, - body: respBody ? encodeFallback(respBody) : undefined, - }; - } catch (err) { - if (err instanceof HttpError) { - return err.toResponse(); - } - return { - status: StatusCodes.INTERNAL_SERVER_ERROR, - body: encodeFallback(`Uncaught error: ${err}`), - }; - } - }; -} - -export type JsonRequestType = { - uri: string; - params: PathParamsType; - headers: HeaderMapType; - user?: UserType; - body?: object | string; -}; -export interface JsonResponseType { - headers?: [string, string][]; - status?: number; - body: object; -} - -export function jsonHandler( - f: (req: JsonRequestType) => MaybeResponse, -): CallbackType { - return async (req: RequestType): Promise => { - try { - const body = req.body; - const resp: JsonResponseType | object | undefined = await f({ - uri: req.uri, - params: req.params, - headers: req.headers, - user: req.user, - body: body && decodeFallback(body), - }); - - if (resp === undefined) { - return undefined; - } - - if ("body" in resp) { - const r = resp as JsonResponseType; - const rBody = r.body; - return { - headers: [["content-type", "application/json"], ...(r.headers ?? [])], - status: r.status, - body: rBody ? encodeFallback(JSON.stringify(rBody)) : undefined, - }; - } - - return { - headers: [["content-type", "application/json"]], - status: StatusCodes.OK, - body: encodeFallback(JSON.stringify(resp)), - }; - } catch (err) { - if (err instanceof HttpError) { - return err.toResponse(); - } - return { - headers: [["content-type", "application/json"]], - status: StatusCodes.INTERNAL_SERVER_ERROR, - body: encodeFallback(`Uncaught error: ${err}`), - }; - } - }; -} - -const routerCallbacks = new Map(); - -function isolateId(): number { - return rustyscript.functions.isolate_id(); -} - -export function addRoute( - method: Method, - route: string, - callback: CallbackType, -) { - if (isolateId() === 0) { - rustyscript.functions.install_route(method, route); - console.debug("JS: Added route:", method, route); - } - - routerCallbacks.set(`${method}:${route}`, callback); -} - -export async function dispatch( - method: Method, - route: string, - uri: string, - pathParams: [string, string][], - headers: [string, string][], - user: UserType | undefined, - body: Uint8Array, -): Promise { - const key = `${method}:${route}`; - const cb: CallbackType | undefined = routerCallbacks.get(key); - if (!cb) { - throw Error(`Missing callback: ${key}`); - } - - return ( - (await cb({ - uri, - params: Object.fromEntries(pathParams), - headers: Object.fromEntries(headers), - user: user, - body, - })) ?? { status: StatusCodes.OK } - ); -} - -globalThis.__dispatch = dispatch; - -const cronCallbacks = new Map void | Promise>(); - -/// Installs a Cron job that is registered to be orchestrated from native code. -export function addCronCallback( - name: string, - schedule: string, - cb: () => void | Promise, -) { - const cronRegex = - /^(@(yearly|monthly|weekly|daily|hourly|))|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*)\s*){6,7})$/; - - const matches = cronRegex.test(schedule); - if (!matches) { - throw Error(`Not a valid 6/7-component cron schedule: ${schedule}`); - } - - if (isolateId() === 0) { - const id = rustyscript.functions.install_job(name, schedule); - console.debug(`JS: Added cron job (id=${id}): "${name}"`); - cronCallbacks.set(id, cb); - } -} - -async function dispatchCron(id: number): Promise { - const cb: (() => void | Promise) | undefined = cronCallbacks.get(id); - if (!cb) { - throw Error(`Missing cron callback: ${id}`); - } - - try { - await cb(); - } catch (err) { - return `${err}`; - } -} - -globalThis.__dispatchCron = dispatchCron; - -/// Installs a periodic callback in a single isolate and returns a cleanup function. -export function addPeriodicCallback( - milliseconds: number, - cb: (cancel: () => void) => void, -): () => void { - // Note: right now we run periodic tasks only on the first isolate. This is - // very simple but doesn't use other workers. This has nice properties in - // terms of state management and hopefully work-stealing will alleviate the - // issue, i.e. workers will pick up the slack in terms of incoming requests. - if (isolateId() !== 0) { - return () => {}; - } - - const handle = setInterval(() => { - cb(() => clearInterval(handle)); - }, milliseconds); - - return () => clearInterval(handle); -} - -export type Blob = { - blob: string; -}; - -export type SqlType = number | string | Blob | null; - -/// Queries the SQLite database. -export async function query( - sql: string, - params: SqlType[], -): Promise { - return await rustyscript.async_functions.query(sql, params); -} - -/// Executes given query against the SQLite database. -export async function execute(sql: string, params: SqlType[]): Promise { - return await rustyscript.async_functions.execute(sql, params); -} - -export class Transaction { - finalized: boolean; - - constructor() { - this.finalized = false; - } - - public query(queryStr: string, params: SqlType[]): SqlType[][] { - return rustyscript.functions.transaction_query(queryStr, params); - } - - public execute(queryStr: string, params: SqlType[]): SqlType { - return rustyscript.functions.transaction_execute(queryStr, params); - } - - public commit(): void { - this.finalized = true; - rustyscript.functions.transaction_commit(); - } - - public rollback(): void { - this.finalized = true; - rustyscript.functions.transaction_rollback(); - } -} - -/// Commit a SQLite transaction. -/// -/// NOTE: The API is async while the implementation is not. This is for -/// future-proofing. This means that calling transaction() will block the -/// event-loop until a write-lock on the underlying database connection can be -/// acquired. In most scenarios this should be fine but may become a bottleneck -/// when there's a lot of write congestion. In the future, we should update the -/// implementation to be async. -export async function transaction(f: (tx: Transaction) => T): Promise { - await rustyscript.async_functions.transaction_begin(); - - const tx = new Transaction(); - try { - const r = f(tx); - if (!tx.finalized) { - rustyscript.functions.transaction_rollback(); - } - return r; - } catch (e) { - rustyscript.functions.transaction_rollback(); - throw e; - } -} - -export type ParsedPath = { - path: string; - query: URLSearchParams; -}; - -export function parsePath(path: string): ParsedPath { - const queryIndex = path.indexOf("?"); - if (queryIndex >= 0) { - return { - path: path.slice(0, queryIndex), - query: new URLSearchParams(path.slice(queryIndex + 1)), - }; - } - - return { - path, - query: new URLSearchParams(), - }; -} diff --git a/crates/js-runtime/assets/runtime/src/util.ts b/crates/js-runtime/assets/runtime/src/util.ts deleted file mode 100644 index 39e4f3d7..00000000 --- a/crates/js-runtime/assets/runtime/src/util.ts +++ /dev/null @@ -1,148 +0,0 @@ -/// @param {Uint8Array} bytes -/// @return {string} -/// -/// source: https://github.com/samthor/fast-text-encoding -export function decodeFallback(bytes: Uint8Array): string { - var inputIndex = 0; - - // Create a working buffer for UTF-16 code points, but don't generate one - // which is too large for small input sizes. UTF-8 to UCS-16 conversion is - // going to be at most 1:1, if all code points are ASCII. The other extreme - // is 4-byte UTF-8, which results in two UCS-16 points, but this is still 50% - // fewer entries in the output. - var pendingSize = Math.min(256 * 256, bytes.length + 1); - var pending = new Uint16Array(pendingSize); - var chunks = []; - var pendingIndex = 0; - - for (;;) { - var more = inputIndex < bytes.length; - - // If there's no more data or there'd be no room for two UTF-16 values, - // create a chunk. This isn't done at the end by simply slicing the data - // into equal sized chunks as we might hit a surrogate pair. - if (!more || pendingIndex >= pendingSize - 1) { - // nb. .apply and friends are *really slow*. Low-hanging fruit is to - // expand this to literally pass pending[0], pending[1], ... etc, but - // the output code expands pretty fast in this case. - // These extra vars get compiled out: they're just to make TS happy. - // Turns out you can pass an ArrayLike to .apply(). - var subarray = pending.subarray(0, pendingIndex); - var arraylike = subarray as unknown as number[]; - chunks.push(String.fromCharCode.apply(null, arraylike)); - - if (!more) { - return chunks.join(""); - } - - // Move the buffer forward and create another chunk. - bytes = bytes.subarray(inputIndex); - inputIndex = 0; - pendingIndex = 0; - } - - // The native TextDecoder will generate "REPLACEMENT CHARACTER" where the - // input data is invalid. Here, we blindly parse the data even if it's - // wrong: e.g., if a 3-byte sequence doesn't have two valid continuations. - - var byte1 = bytes[inputIndex++]; - if ((byte1 & 0x80) === 0) { - // 1-byte or null - pending[pendingIndex++] = byte1; - } else if ((byte1 & 0xe0) === 0xc0) { - // 2-byte - var byte2 = bytes[inputIndex++] & 0x3f; - pending[pendingIndex++] = ((byte1 & 0x1f) << 6) | byte2; - } else if ((byte1 & 0xf0) === 0xe0) { - // 3-byte - var byte2 = bytes[inputIndex++] & 0x3f; - var byte3 = bytes[inputIndex++] & 0x3f; - pending[pendingIndex++] = ((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3; - } else if ((byte1 & 0xf8) === 0xf0) { - // 4-byte - var byte2 = bytes[inputIndex++] & 0x3f; - var byte3 = bytes[inputIndex++] & 0x3f; - var byte4 = bytes[inputIndex++] & 0x3f; - - // this can be > 0xffff, so possibly generate surrogates - var codepoint = - ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; - if (codepoint > 0xffff) { - // codepoint &= ~0x10000; - codepoint -= 0x10000; - pending[pendingIndex++] = ((codepoint >>> 10) & 0x3ff) | 0xd800; - codepoint = 0xdc00 | (codepoint & 0x3ff); - } - pending[pendingIndex++] = codepoint; - } else { - // invalid initial byte - } - } -} - -/// @param {string} string -/// @return {Uint8Array} -//// -/// source: https://github.com/samthor/fast-text-encoding -export function encodeFallback(string: string): Uint8Array { - var pos = 0; - var len = string.length; - - var at = 0; // output position - var tlen = Math.max(32, len + (len >>> 1) + 7); // 1.5x size - var target = new Uint8Array((tlen >>> 3) << 3); // ... but at 8 byte offset - - while (pos < len) { - var value = string.charCodeAt(pos++); - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < len) { - var extra = string.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - if (value >= 0xd800 && value <= 0xdbff) { - continue; // drop lone surrogate - } - } - - // expand the buffer if we couldn't write 4 bytes - if (at + 4 > target.length) { - tlen += 8; // minimum extra - tlen *= 1.0 + (pos / string.length) * 2; // take 2x the remaining - tlen = (tlen >>> 3) << 3; // 8 byte offset - - var update = new Uint8Array(tlen); - update.set(target); - target = update; - } - - if ((value & 0xffffff80) === 0) { - // 1-byte - target[at++] = value; // ASCII - continue; - } else if ((value & 0xfffff800) === 0) { - // 2-byte - target[at++] = ((value >>> 6) & 0x1f) | 0xc0; - } else if ((value & 0xffff0000) === 0) { - // 3-byte - target[at++] = ((value >>> 12) & 0x0f) | 0xe0; - target[at++] = ((value >>> 6) & 0x3f) | 0x80; - } else if ((value & 0xffe00000) === 0) { - // 4-byte - target[at++] = ((value >>> 18) & 0x07) | 0xf0; - target[at++] = ((value >>> 12) & 0x3f) | 0x80; - target[at++] = ((value >>> 6) & 0x3f) | 0x80; - } else { - continue; // out of range - } - - target[at++] = (value & 0x3f) | 0x80; - } - - // Use subarray if slice isn't supported (IE11). This will use more memory - // because the original array still exists. - return target.slice ? target.slice(0, at) : target.subarray(0, at); -} diff --git a/crates/js-runtime/assets/runtime/tests/runtime.test.ts b/crates/js-runtime/assets/runtime/tests/runtime.test.ts deleted file mode 100644 index 5cca7856..00000000 --- a/crates/js-runtime/assets/runtime/tests/runtime.test.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { test, expect } from "vitest"; - -import { addPeriodicCallback, parsePath, query, execute, stringHandler, htmlHandler, jsonHandler, addRoute, dispatch, HttpError } from "../src/trailbase"; -import type { Method, RequestType, StringRequestType, CallbackType } from "../src/trailbase"; -import { decodeFallback, encodeFallback } from "../src/util"; - -globalThis.rustyscript = { - async_functions: {}, - functions: { - isolate_id: () => 0, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - install_route: (_method: Method, _route: string) => { }, - }, -}; - -test("periodic callback", async () => { - const promise = new Promise((resolve) => { - let count = 0; - const result: number[] = []; - - addPeriodicCallback(1, (cancel) => { - result.push(count++); - - if (result.length > 2) { - resolve(result); - cancel(); - } - }); - }); - - expect(await promise).toEqual([0, 1, 2]); -}); - -test("binary encode/decode", () => { - const a = `1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+ `; - expect(decodeFallback(encodeFallback(a))).toEqual(a); -}); - -test("parse path", () => { - const parsedPath = parsePath("/p0/p1/p2?a=x&a=y&b=z"); - expect(parsedPath.path).toEqual("/p0/p1/p2"); - const q = parsedPath.query; - expect(q.getAll("a")).toEqual(["x", "y"]); - expect(q.get("b")).toEqual("z"); -}); - -test("db functions", async () => { - type Args = { - query: string; - params: unknown[]; - }; - let queryArgs: Args = { query: "", params: [] }; - let executeArgs: Args = { query: "", params: [] }; - - { - const query = async (query: string, params: unknown[]) => queryArgs = { query, params }; - const execute = async (query: string, params: unknown[]) => executeArgs = { query, params }; - - globalThis.rustyscript = { - ...globalThis.rustyscript, - async_functions: { - query, - execute, - }, - }; - } - - const executeStr = "INSERT INTO table (col) VALUES (?1)"; - await execute(executeStr, ["test"]); - expect(executeArgs.query).toEqual(executeStr); - expect(executeArgs.params).toEqual(["test"]); - - const queryStr = "SELECT * FROM table WHERE col = ?1"; - await query(queryStr, ["test"]); - expect(queryArgs.query).toEqual(queryStr); - expect(queryArgs.params).toEqual(["test"]); -}); - -test("routes functions", async () => { - const promise = new Promise((resolve) => { - addRoute("GET", "/test", stringHandler(async (req: StringRequestType) => { - resolve(req); - return "response"; - })); - }); - - const uri = "http://127.0.0.1"; - dispatch("GET", "/test", uri, [], [], undefined, encodeFallback("test")); - - const result: StringRequestType = await promise; - - expect(result.uri).toEqual(uri); -}); - -test("string handler", async () => { - const req = { - uri: "http://test.gov", - params: {}, - headers: {}, - } satisfies RequestType; - - { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const handler: CallbackType = stringHandler((_req) => "test"); - const response = (await handler(req))!; - expect(decodeFallback(response.body!)).toEqual("test"); - } - - { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const handler: CallbackType = stringHandler((_req) => { - throw new HttpError(418); - }); - expect((await handler(req))!.status).toEqual(418); - } - - { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const handler: CallbackType = htmlHandler((_req) => { - throw new HttpError(418); - }); - expect((await handler(req))!.status).toEqual(418); - } - - { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const handler: CallbackType = jsonHandler((_req) => { - throw new HttpError(418); - }); - expect((await handler(req))!.status).toEqual(418); - } -}); diff --git a/crates/js-runtime/assets/runtime/tsconfig.json b/crates/js-runtime/assets/runtime/tsconfig.json deleted file mode 100644 index 08092143..00000000 --- a/crates/js-runtime/assets/runtime/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "lib": ["esnext", "DOM"], - "target": "es2022", - "module": "es2022", - "declaration": true, - "strict": true, - "strictNullChecks": true, - "forceConsistentCasingInFileNames": true, - "esModuleInterop": false, - "moduleResolution": "bundler", - "outDir": "dist", - "paths": { - "@/*": ["./src/*"] - } - }, - "exclude": [ - "dist/**", - "node_modules/", - "types/**" - ] -} diff --git a/crates/js-runtime/assets/runtime/vite.config.ts b/crates/js-runtime/assets/runtime/vite.config.ts deleted file mode 100644 index 84c11a9f..00000000 --- a/crates/js-runtime/assets/runtime/vite.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from "vite"; - -import dts from 'vite-plugin-dts' - -export default defineConfig({ - plugins: [ - dts({ rollupTypes: true }), - ], - build: { - outDir: "./dist", - minify: false, - lib: { - entry: "./src/index.ts", - name: "runtime", - fileName: "index", - formats: ["es"], - }, - }, -}) diff --git a/crates/js-runtime/build.rs b/crates/js-runtime/build.rs deleted file mode 100644 index 997ccdd0..00000000 --- a/crates/js-runtime/build.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![allow(clippy::needless_return)] - -use std::{io::Result, path::PathBuf}; - -fn main() -> Result<()> { - trailbase_build::init_env_logger(); - - let path = PathBuf::from("assets").join("runtime"); - trailbase_build::rerun_if_changed(path.join("src")); - - trailbase_build::build_js(path)?; - - return Ok(()); -} diff --git a/crates/js-runtime/src/import_provider.rs b/crates/js-runtime/src/import_provider.rs deleted file mode 100644 index 48b3ec29..00000000 --- a/crates/js-runtime/src/import_provider.rs +++ /dev/null @@ -1,55 +0,0 @@ -use rustyscript::deno_core::{ - ModuleSpecifier, RequestedModuleType, ResolutionKind, error::ModuleLoaderError, -}; -use rustyscript::module_loader::ImportProvider as RustyScriptImportProvider; - -use crate::util::cow_to_string; - -#[derive(Default)] -pub struct ImportProvider; - -impl RustyScriptImportProvider for ImportProvider { - fn resolve( - &mut self, - specifier: &ModuleSpecifier, - _referrer: &str, - _kind: ResolutionKind, - ) -> Option> { - log::trace!("resolve: {specifier:?}"); - - // Specifier is just a URL. - match specifier.scheme() { - "file" | "trailbase" => { - return Some(Ok(specifier.clone())); - } - scheme => { - return Some(Err(ModuleLoaderError::uri_error(format!( - "Unsupported schema: '{scheme}'" - )))); - } - }; - } - - fn import( - &mut self, - specifier: &ModuleSpecifier, - _referrer: Option<&ModuleSpecifier>, - _is_dyn_import: bool, - _requested_module_type: RequestedModuleType, - ) -> Option> { - log::trace!("import: {specifier:?}"); - - match specifier.scheme() { - "trailbase" => { - return Some(Ok(cow_to_string( - crate::JsRuntimeAssets::get("index.js") - .expect("Failed to read rt/index.js") - .data, - ))); - } - _ => { - return None; - } - } - } -} diff --git a/crates/js-runtime/src/lib.rs b/crates/js-runtime/src/lib.rs deleted file mode 100644 index 27bbfcba..00000000 --- a/crates/js-runtime/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![forbid(unsafe_code, clippy::unwrap_used)] -#![allow(clippy::needless_return)] -#![warn(clippy::await_holding_lock, clippy::inefficient_to_string)] - -pub mod import_provider; -pub mod runtime; -mod util; - -pub use crate::import_provider::ImportProvider; - -#[derive(rust_embed::RustEmbed, Clone)] -#[folder = "assets/runtime/dist/"] -pub struct JsRuntimeAssets; diff --git a/crates/js-runtime/src/runtime.rs b/crates/js-runtime/src/runtime.rs deleted file mode 100644 index 95775277..00000000 --- a/crates/js-runtime/src/runtime.rs +++ /dev/null @@ -1,1194 +0,0 @@ -use futures_util::future::LocalBoxFuture; -use log::*; -use parking_lot::Mutex; -use rusqlite::Transaction; -use rustyscript::{deno_core::PollEventLoopOptions, init_platform, js_value::Promise}; -use self_cell::{MutBorrow, self_cell}; -use serde::Serialize; -use std::collections::HashSet; -use std::path::Path; -use std::rc::Rc; -use std::sync::OnceLock; -use tokio::sync::oneshot; -use tokio::task::LocalSet; -use tokio::time::Duration; -use trailbase_schema::json::{JsonError, rich_json_to_value, value_to_rich_json}; -use trailbase_sqlite::connection::LockGuard; -use trailbase_sqlite::{Params, Row}; - -use crate::JsRuntimeAssets; -use crate::util::cow_to_string; - -pub use rustyscript::{Error as LargeRSError, Module, ModuleHandle, Runtime}; - -/// Boxed rustyscript error, since error is ~200B. -pub type Error = Box; - -type AnyError = Box; - -#[derive(Serialize)] -pub struct JsUser { - // Base64 encoded user id. - pub id: String, - pub email: String, - pub csrf: String, -} - -pub type CallbackType = - dyn FnOnce(Option<&ModuleHandle>, &mut Runtime) -> Option> + Send; - -pub enum Message { - Run(Option, Box), -} - -pub struct State { - private_sender: kanal::AsyncSender, -} - -impl State { - pub async fn load_module(&self, module: Module) -> Result<(), AnyError> { - let (sender, receiver) = oneshot::channel::>(); - - self - .private_sender - .send(Message::Run( - Some(module), - Box::new(|module_handle, _runtime| { - let _ = match module_handle { - Some(_) => sender.send(Ok(())), - None => sender.send(Err("Failed to load module".into())), - }; - return None; - }), - )) - .await?; - - let _ = receiver.await.map_err(|err| { - error!("Failed to await module loading: {err}"); - return err; - })?; - - return Ok(()); - } - - pub async fn send_privately(&self, msg: Message) -> Result<(), kanal::SendError> { - return self.private_sender.send(msg).await; - } -} - -struct RuntimeState { - n_threads: usize, - - // Thread handle - handle: Option>, - - // Shared sender. - shared_sender: kanal::AsyncSender, - - // Isolate state. - state: Vec, -} - -impl Drop for RuntimeState { - fn drop(&mut self) { - if let Some(handle) = self.handle.take() { - self.state.clear(); - if let Err(err) = handle.join() { - error!("Failed to join main rt thread: {err:?}"); - } - } - } -} - -pub trait Completer { - fn is_ready(&self, runtime: &mut Runtime) -> bool; - fn resolve(self: Box, runtime: &mut Runtime) -> LocalBoxFuture<'_, ()>; -} - -pub struct CompleterImpl { - /// Promise eventually resolved by the JS engine. - pub promise: Promise, - /// Back channel to eventually resolve with the value from the promise above. - pub sender: oneshot::Sender>, -} - -impl Completer for CompleterImpl { - fn is_ready(&self, runtime: &mut Runtime) -> bool { - if self.sender.is_closed() { - return true; - } - return !self.promise.is_pending(runtime); - } - - fn resolve(self: Box, runtime: &mut Runtime) -> LocalBoxFuture<'_, ()> { - let sender = self.sender; - if sender.is_closed() { - return Box::pin(async {}); - } - - let promise = self.promise; - Box::pin(async { - let _ = sender.send(promise.into_future(runtime).await.map_err(Box::new)); - }) - } -} - -impl RuntimeState { - /// Bring up `threads` worker/isolate threads with basic setup. - /// - /// NOTE: functions to install routes and jobs are registered later, we need an AppState first. - fn new_with_threads(threads: Option) -> Self { - let n_threads = match threads { - Some(n) => n, - None => std::thread::available_parallelism().map_or_else( - |err| { - error!("Failed to get number of threads: {err}"); - return 1; - }, - |x| x.get(), - ), - }; - - info!("Starting v8 JavaScript runtime with {n_threads} workers."); - - let (shared_sender, shared_receiver) = kanal::unbounded_async::(); - - let (state, receivers): (Vec, Vec>) = (0..n_threads) - .map(|_index| { - let (private_sender, private_receiver) = kanal::unbounded_async::(); - - return (State { private_sender }, private_receiver); - }) - .unzip(); - - let handle = if n_threads > 0 { - Some(std::thread::spawn(move || { - init_platform(n_threads as u32, true); - - let threads: Vec<_> = receivers - .into_iter() - .enumerate() - .map(|(index, receiver)| { - let shared_receiver = shared_receiver.clone(); - - return std::thread::spawn(move || { - let tokio_runtime = Rc::new( - tokio::runtime::Builder::new_current_thread() - .enable_time() - .enable_io() - .thread_name(format!("v8-runtime-{index}")) - .build() - .expect("startup"), - ); - - let js_runtime = match Self::init_runtime(index, tokio_runtime.clone()) { - Ok(js_runtime) => js_runtime, - Err(err) => { - panic!("Failed to init v8 runtime on thread {index}: {err}"); - } - }; - - event_loop(tokio_runtime, js_runtime, receiver, shared_receiver); - }); - }) - .collect(); - - for (idx, thread) in threads.into_iter().enumerate() { - if let Err(err) = thread.join() { - error!("Failed to join worker: {idx}: {err:?}"); - } - } - })) - } else { - None - }; - - return RuntimeState { - n_threads, - shared_sender, - handle, - state, - }; - } - - fn init_runtime( - index: usize, - tokio_runtime: Rc, - ) -> Result { - let mut runtime = rustyscript::Runtime::with_tokio_runtime( - rustyscript::RuntimeOptions { - import_provider: Some(Box::new(crate::import_provider::ImportProvider)), - schema_whlist: HashSet::from(["trailbase".to_string()]), - ..Default::default() - }, - tokio_runtime, - )?; - - runtime - .register_function("isolate_id", move |_args: &[serde_json::Value]| { - return Ok(serde_json::json!(index)); - }) - .expect("Failed to register 'isolate_id' function"); - - return Ok(runtime); - } -} - -pub fn build_call_sync_js_function_message( - module: Option, - function_name: &'static str, - args: impl serde::ser::Serialize + Send + 'static, - response: oneshot::Sender>, -) -> Message -where - T: serde::de::DeserializeOwned + Send + 'static, -{ - return Message::Run( - module, - Box::new(move |module_handle, runtime: &mut Runtime| { - let _ = response.send( - runtime - .call_function_immediate::(module_handle, function_name, &args) - .map_err(Box::new), - ); - return None; - }), - ); -} - -pub fn build_call_async_js_function_message( - module: Option, - function_name: &'static str, - args: impl serde::ser::Serialize + Send + 'static, - response: oneshot::Sender>, -) -> Message -where - T: serde::de::DeserializeOwned + Send + 'static, -{ - return Message::Run( - module, - Box::new(move |module_handle, runtime: &mut Runtime| { - // NOTE: We cannot use `call_function_async` here because it would require `handle_message` - // to be async and await it, which would prevent new messages from being received until the - // async function completes. This would lead to a deadlock in case of recursive calls to - // the same isolate. - // NOTE: We also cannot push the awaiting to a `LocalSet` local tokio runtime, since it - // uses `rt.block_on` internally, which makes tokio panic. - // - // We haven't found a better way than keeping track of pending futures and resolving them - // ourselves. - // - // Similarly, we await module loading on the event loop hoping that the module load doesn't - // trigger recursive requests, which would block up the event loop. - // To get rid off all async calls that require the event-loop to progress, we could build - // up a module registry before starting the event loop and then refer to modules only by - // handle afterwards :shrug:. - let promise_or = - runtime.call_function_immediate::>(module_handle, function_name, &args); - - return match promise_or { - Ok(promise) => Some(Box::new(CompleterImpl:: { - promise, - sender: response, - })), - Err(err) => { - let _ = response.send(Err(Box::new(err))); - None - } - }; - }), - ); -} - -fn drain_filter(v: &mut Vec, mut f: impl FnMut(&T) -> bool) -> Vec { - let indexes: Vec = v - .iter() - .enumerate() - .filter_map(|(idx, value)| if f(value) { Some(idx) } else { None }) - .collect(); - - return indexes - .into_iter() - .rev() - .map(|index| v.swap_remove(index)) - .collect(); -} - -/// The main event-loop running for every isolate/worker. -fn event_loop( - tokio_runtime: Rc, - mut js_runtime: Runtime, - private_recv: kanal::AsyncReceiver, - shared_recv: kanal::AsyncReceiver, -) { - const MODULE_LOAD_TIMEOUT: Duration = Duration::from_millis(1000); - const DURATION: Option = Some(Duration::from_millis(25)); - const OPTS: PollEventLoopOptions = PollEventLoopOptions { - wait_for_inspector: false, - pump_v8_message_loop: true, - }; - - let local = LocalSet::new(); - - local.spawn_local(async move { - let mut completers: Vec> = vec![]; - - loop { - // In the future, once stabilized, we should use `Vec::drain_filter`. - for completer in drain_filter(&mut completers, |completer| completer.is_ready(&mut js_runtime)) { - completer.resolve(&mut js_runtime).await; - } - - let listen_for_messages = async || { - return tokio::select! { - msg = private_recv.recv() => msg, - msg = shared_recv.recv() => msg, - }.expect("channel closed"); - }; - - // Either pump or wait for a new private or shared message. - tokio::select! { - // Keep pumping while there are still futures (HTTP requests) that need completing. - result = js_runtime.await_event_loop(OPTS, DURATION), if !completers.is_empty() => { - if let Err(err) = result{ - error!("JS event loop: {err}"); - } - }, - msg = listen_for_messages() => { - let completer = match msg { - Message::Run(module, f) => { - if let Some(module) = module { - // Prevent module loads from blocking up the event-loop for ever. This could happen if a - // top-level call triggers a recursive call to the isolate, while event loop is blocked up - // awaiting this very `load_module_async` call. - let module_handle = match tokio::time::timeout(MODULE_LOAD_TIMEOUT, js_runtime.load_module_async(&module)).await { - Ok(Ok(module_handle)) => module_handle, - Ok(Err(err)) => { - error!("Loading JS module failed: {err}"); - continue; - }, - Err(_) => { - error!("Loading JS module timed out"); - continue; - }, - }; - - f(Some(&module_handle), &mut js_runtime) - } else { - f(None, &mut js_runtime) - } - } - }; - - if let Some(completer) = completer { - completers.push(completer); - } - }, - } - } - }); - - tokio_runtime.block_on(local); -} - -// NOTE: Repeated runtime initialization, e.g. in a multi-threaded context, leads to segfaults. -// rustyscript::init_platform is supposed to help with this but we haven't found a way to -// make it work. Thus, we're making the V8 VM a singleton (like Dart's). -fn get_runtime(n_threads: Option) -> &'static RuntimeState { - static SINGLETON: OnceLock = OnceLock::new(); - return SINGLETON.get_or_init(move || RuntimeState::new_with_threads(n_threads)); -} - -#[derive(Clone)] -pub struct RuntimeHandle { - runtime: &'static RuntimeState, -} - -impl RuntimeHandle { - #[allow(clippy::new_without_default)] - pub fn singleton() -> Self { - return Self { - runtime: get_runtime(None), - }; - } - - pub fn singleton_or_init_with_threads(n_threads: usize) -> Self { - return Self { - runtime: get_runtime(Some(n_threads)), - }; - } - - pub fn num_threads(&self) -> usize { - return self.runtime.n_threads; - } - - pub fn state(&self) -> &'static Vec { - return &self.runtime.state; - } - - pub async fn send_to_any_isolate(&self, msg: Message) -> Result<(), kanal::SendError> { - return self.runtime.shared_sender.send(msg).await; - } -} - -self_cell!( - struct OwnedLock { - owner: trailbase_sqlite::Connection, - - #[covariant] - dependent: LockGuard, - } -); - -self_cell!( - struct OwnedTransaction { - owner: MutBorrow, - - #[covariant] - dependent: Transaction, - } -); - -async fn new_transaction( - conn: trailbase_sqlite::Connection, -) -> Result { - for _ in 0..200 { - let Ok(lock) = OwnedLock::try_new(conn.clone(), |owner| { - return owner - .try_write_lock_for(Duration::from_micros(50)) - .ok_or("timeout"); - }) else { - tokio::time::sleep(Duration::from_micros(400)).await; - continue; - }; - - return OwnedTransaction::try_new(MutBorrow::new(lock), |owner| { - return owner - .borrow_mut() - .with_dependent_mut(|_owner, dep| dep.transaction()); - }); - } - - return Err(rusqlite::Error::ToSqlConversionFailure( - "Failed to acquire lock".into(), - )); -} - -pub fn register_database_functions(handle: &RuntimeHandle, conn: trailbase_sqlite::Connection) { - fn error_mapper(err: impl std::error::Error) -> rustyscript::Error { - return rustyscript::Error::Runtime(err.to_string()); - } - - fn register(runtime: &mut Runtime, conn: trailbase_sqlite::Connection) -> Result<(), Error> { - let conn_clone = conn.clone(); - runtime.register_async_function("query", move |args: Vec| { - assert_eq!(args.len(), 2); - - let conn = conn_clone.clone(); - Box::pin(async move { - let query: String = get_arg(&args, 0)?; - let params = json_values_to_sqlite_params(get_arg(&args, 1)?) - .map_err(|err| rustyscript::Error::Runtime(err.to_string()))?; - - let rows = conn - .write_query_rows(query, params) - .await - .map_err(error_mapper)?; - - let values = rows - .iter() - .map(|row| -> Result { - return Ok(serde_json::Value::Array( - row_to_rich_json_array(row) - .map_err(|err| rustyscript::Error::Runtime(err.to_string()))?, - )); - }) - .collect::, _>>() - .map_err(error_mapper)?; - - return Ok(serde_json::Value::Array(values)); - }) - })?; - - let conn_clone = conn.clone(); - runtime.register_async_function("execute", move |args: Vec| { - assert_eq!(args.len(), 2); - let conn = conn_clone.clone(); - Box::pin(async move { - let query: String = get_arg(&args, 0)?; - let params = json_values_to_sqlite_params(get_arg(&args, 1)?) - .map_err(|err| rustyscript::Error::Runtime(err.to_string()))?; - - let rows_affected = conn.execute(query, params).await.map_err(error_mapper)?; - - return Ok(serde_json::Value::Number(rows_affected.into())); - }) - })?; - - let current_transaction: Rc>> = Rc::new(Mutex::new(None)); - let current_transaction_clone = current_transaction.clone(); - runtime.register_async_function("transaction_begin", move |args: Vec| { - assert_eq!(args.len(), 0); - assert!(current_transaction_clone.lock().is_none()); - - let conn = conn.clone(); - let current_transaction = current_transaction_clone.clone(); - return Box::pin(async move { - let tx = new_transaction(conn).await.map_err(error_mapper)?; - - *current_transaction.lock() = Some(tx); - - return Ok(serde_json::Value::Null); - }); - })?; - - let current_transaction_clone = current_transaction.clone(); - runtime.register_function("transaction_query", move |args: &[serde_json::Value]| { - assert_eq!(args.len(), 2); - let query: String = get_arg(args, 0)?; - let params = json_values_to_sqlite_params(get_arg(args, 1)?) - .map_err(|err| rustyscript::Error::Runtime(err.to_string()))?; - - let tx = current_transaction_clone.lock(); - if let Some(tx) = &*tx { - let mut stmt = tx - .borrow_dependent() - .prepare(&query) - .map_err(error_mapper)?; - params.bind(&mut stmt).map_err(error_mapper)?; - - let rows = - trailbase_sqlite::rows::Rows::from_rows(stmt.raw_query()).map_err(error_mapper)?; - - let values = rows - .iter() - .map(|row| -> Result { - return Ok(serde_json::Value::Array( - row_to_rich_json_array(row) - .map_err(|err| rustyscript::Error::Runtime(err.to_string()))?, - )); - }) - .collect::, _>>() - .map_err(error_mapper)?; - - return Ok(serde_json::Value::Array(values)); - } - return Ok(serde_json::Value::Null); - })?; - - let current_transaction_clone = current_transaction.clone(); - runtime.register_function( - "transaction_execute", - move |args: &[serde_json::Value]| { - assert_eq!(args.len(), 2); - let query: String = get_arg(args, 0)?; - let params = json_values_to_sqlite_params(get_arg(args, 1)?) - .map_err(|err| rustyscript::Error::Runtime(err.to_string()))?; - - let tx = current_transaction_clone.lock(); - if let Some(tx) = &*tx { - let mut stmt = tx - .borrow_dependent() - .prepare(&query) - .map_err(error_mapper)?; - params.bind(&mut stmt).map_err(error_mapper)?; - - let rows_affected = stmt.raw_execute().map_err(error_mapper)?; - - return Ok(serde_json::Value::Number(rows_affected.into())); - } - return Ok(serde_json::Value::Null); - }, - )?; - - let current_transaction_clone = current_transaction.clone(); - runtime.register_function("transaction_commit", move |args: &[serde_json::Value]| { - assert_eq!(args.len(), 0); - - let tx = current_transaction_clone.lock().take(); - if let Some(tx) = tx { - // NOTE: this is the same as `tx.commit()` just w/o consuming. - tx.borrow_dependent() - .execute_batch("COMMIT") - .map_err(error_mapper)?; - } - return Ok(serde_json::Value::Null); - })?; - - let current_transaction_clone = current_transaction.clone(); - runtime.register_function( - "transaction_rollback", - move |args: &[serde_json::Value]| { - assert_eq!(args.len(), 0); - - let tx = current_transaction_clone.lock().take(); - if let Some(tx) = tx { - // NOTE: this is the same as `tx.rollback()` just w/o consuming. - tx.borrow_dependent() - .execute_batch("ROLLBACK") - .map_err(error_mapper)?; - } - return Ok(serde_json::Value::Null); - }, - )?; - - return Ok(()); - } - - let states = &handle.runtime.state; - let (sender, receiver) = kanal::bounded(states.len()); - - for state in states { - let conn = conn.clone(); - let sender = sender.clone(); - - state - .private_sender - .as_sync() - .send(Message::Run( - None, - Box::new(move |_, runtime: &mut Runtime| { - register(runtime, conn).expect("startup"); - sender.send(()).expect("startup"); - return None; - }), - )) - .expect("startup"); - } - - for _ in 0..states.len() { - receiver.recv().expect("startup"); - } -} - -fn json_values_to_sqlite_params( - values: Vec, -) -> Result, JsonError> { - return values.into_iter().map(rich_json_to_value).collect(); -} - -pub fn row_to_rich_json_array(row: &Row) -> Result, JsonError> { - return (0..row.column_count()) - .map(|i| -> Result { - let value = row.get_value(i).ok_or(JsonError::ValueNotFound)?; - return value_to_rich_json(value); - }) - .collect(); -} - -// NOTE: We cannot Box the large error, since we're using this in a rustyscript callback. -#[allow(clippy::result_large_err)] -pub fn get_arg(args: &[serde_json::Value], i: usize) -> Result -where - T: serde::de::DeserializeOwned, -{ - let arg = args - .get(i) - .ok_or_else(|| rustyscript::Error::Runtime(format!("Range err {i} > {}", args.len())))?; - - return serde_json::from_value::(arg.clone()) - .map_err(|err| rustyscript::Error::Runtime(err.to_string())); -} - -pub async fn write_js_runtime_files(data_dir: impl AsRef) { - let path = data_dir.as_ref(); - if let Err(err) = tokio::fs::write( - path.join("trailbase.js"), - cow_to_string( - JsRuntimeAssets::get("index.js") - .expect("Failed to read rt/index.js") - .data, - ) - .as_str(), - ) - .await - { - warn!("Failed to write 'trailbase.js': {err}"); - } - - if let Err(err) = tokio::fs::write( - path.join("trailbase.d.ts"), - cow_to_string( - JsRuntimeAssets::get("index.d.ts") - .expect("Failed to read rt/index.d.ts") - .data, - ) - .as_str(), - ) - .await - { - warn!("Failed to write 'trailbase.d.ts': {err}"); - } -} - -#[cfg(test)] -mod tests { - use super::*; - - use rustyscript::Module; - - #[tokio::test] - async fn test_serial_tests() { - // Run on a single thread to make sure that any potential blocking is maximally bad. - let handle = RuntimeHandle::singleton_or_init_with_threads(1); - - // NOTE: needs to run serially since registration of SQLite connection with singleton v8 - // runtime is racy. - test_runtime_apply(&handle).await; - test_runtime_javascript(&handle).await; - test_runtime_javascript_blocking(&handle).await; - test_javascript_query(&handle).await; - test_javascript_execute(&handle).await; - test_javascript_transaction(&handle).await; - } - - async fn test_runtime_apply(handle: &RuntimeHandle) { - let (sender, receiver) = tokio::sync::oneshot::channel::(); - - handle - .runtime - .shared_sender - .send(Message::Run( - None, - Box::new(|_m, _rt| { - sender.send(5).unwrap(); - return None; - }), - )) - .await - .unwrap(); - - assert_eq!(5, receiver.await.unwrap()); - } - - async fn test_runtime_javascript(handle: &RuntimeHandle) { - let module = Module::new( - "module.js", - r#" - export function test_fun() { - return "test0"; - } - "#, - ); - - let (sender, receiver) = oneshot::channel::>(); - handle - .runtime - .shared_sender - .send(build_call_sync_js_function_message::( - Some(module), - "test_fun", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - assert_eq!("test0", receiver.await.unwrap().unwrap()); - } - - async fn test_runtime_javascript_blocking(handle: &RuntimeHandle) { - let (ext_sender, ext_receiver) = kanal::bounded_async::(10); - { - // Register custom functions. - let states = &handle.runtime.state; - let (sender, receiver) = kanal::bounded(states.len()); - - for state in states { - let sender = sender.clone(); - let ext_receiver = ext_receiver.clone(); - - state - .private_sender - .as_sync() - .send(Message::Run( - None, - Box::new(move |_, runtime| { - runtime - .register_async_function("blocked", move |_args: Vec| { - let ext_receiver = ext_receiver.clone(); - return Box::pin(async move { - let _ = ext_receiver.recv().await.unwrap(); - return Ok(serde_json::Value::Null); - }); - }) - .expect("register"); - - sender.send(()).unwrap(); - - return None; - }), - )) - .expect("startup"); - } - - for _ in 0..states.len() { - receiver.recv().expect("startup"); - } - } - - let module = Module::new( - "module.js", - r#" - export function test_fun() { - return "test0"; - } - - export async function blocked_fun() { - await rustyscript.async_functions.blocked(); - return "blocked"; - } - "#, - ); - - let (blocked_sender, blocked_receiver) = oneshot::channel::>(); - handle - .runtime - .shared_sender - .send(build_call_async_js_function_message::( - Some(module.clone()), - "blocked_fun", - Vec::::new(), - blocked_sender, - )) - .await - .unwrap(); - - let (sender, receiver) = oneshot::channel::>(); - handle - .runtime - .shared_sender - .send(build_call_sync_js_function_message::( - Some(module.clone()), - "test_fun", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - assert_eq!("test0", receiver.await.unwrap().unwrap()); - - ext_sender.send(1).await.unwrap(); - assert_eq!("blocked", blocked_receiver.await.unwrap().unwrap()); - } - - async fn test_javascript_query(handle: &RuntimeHandle) { - let conn = trailbase_sqlite::Connection::open_in_memory().unwrap(); - conn - .execute("CREATE TABLE 'table' (v0 TEXT, v1 INTEGER);", ()) - .await - .unwrap(); - conn - .execute( - "INSERT INTO 'table' (v0, v1) VALUES ('0', 0), ('1', 1);", - (), - ) - .await - .unwrap(); - - register_database_functions(&handle, conn); - - let module = Module::new( - "module.ts", - r#" - import { query } from "trailbase:main"; - - export async function test_query(queryStr: string) : Promise { - return await query(queryStr, []); - } - "#, - ); - - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::< - Vec>, - >( - Some(module), - "test_query", - vec![serde_json::json!("SELECT * FROM 'table'")], - sender, - )) - .await - .unwrap(); - - let result = receiver.await.unwrap().unwrap(); - - assert_eq!( - vec![ - vec![ - serde_json::Value::String("0".to_string()), - serde_json::Value::Number(0.into()) - ], - vec![ - serde_json::Value::String("1".to_string()), - serde_json::Value::Number(1.into()) - ], - ], - result - ); - } - - async fn test_javascript_execute(handle: &RuntimeHandle) { - let conn = trailbase_sqlite::Connection::open_in_memory().unwrap(); - conn - .execute_batch( - r#" - CREATE TABLE test (v0 TEXT, v1 INTEGER); - INSERT INTO test (v0, v1) VALUES ('foo', 5), ('bar', 3); - "#, - ) - .await - .unwrap(); - - register_database_functions(&handle, conn.clone()); - - let module = Module::new( - "module.ts", - r#" - import { execute } from "trailbase:main"; - - export async function test_execute(queryStr: string) : Promise { - return await execute(queryStr, []); - } - "#, - ); - - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::( - Some(module), - "test_execute", - vec![serde_json::json!("DELETE FROM test")], - sender, - )) - .await - .unwrap(); - - let result = receiver.await.unwrap().unwrap(); - assert_eq!(2, result); - - let count: i64 = conn - .read_query_row_f("SELECT COUNT(*) FROM test", (), |row| row.get(0)) - .await - .unwrap() - .unwrap(); - assert_eq!(0, count); - } - - async fn test_javascript_transaction(handle: &RuntimeHandle) { - let conn = trailbase_sqlite::Connection::open_in_memory().unwrap(); - conn - .execute_batch( - r#" - CREATE TABLE 'table' ( - v0 TEXT NOT NULL, - v1 INTEGER NOT NULL - ); - INSERT INTO 'table' (v0, v1) VALUES ('foo', 5), ('bar', 3); - "#, - ) - .await - .unwrap(); - - register_database_functions(&handle, conn.clone()); - - { - // Check that the rolled back transaction would delete 2 rows but deletes none. - let module = Module::new( - "module.ts", - r#" - import { transaction, Transaction } from "trailbase:main"; - - export async function test_transaction_rollback() : Promise { - return await transaction((tx: Transaction) => { - const n = tx.execute("DELETE FROM 'table' WHERE TRUE", []); - tx.rollback(); - return n; - }); - } - "#, - ); - - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::( - Some(module), - "test_transaction_rollback", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - let rows_affected = receiver.await.unwrap().unwrap(); - assert_eq!(2, rows_affected); - - let count: i64 = conn - .query_row_f("SELECT COUNT(*) FROM 'table'", (), |row| row.get(0)) - .await - .unwrap() - .unwrap(); - assert_eq!(2, count); - } - - { - // Check that the committed transaction takes effect - let module = Module::new( - "module.ts", - r#" - import { transaction, Transaction } from "trailbase:main"; - - export async function test_transaction_commit() : Promise<[number, number]> { - return await transaction((tx: Transaction) => { - const count = tx.query("SELECT COUNT(*) FROM 'table'", [])[0][0]; - const inserted = tx.execute("INSERT INTO 'table' (v0, v1) VALUES (?1, ?2)", ["baz", "7"]); - tx.commit(); - return [count, inserted]; - }); - } - "#, - ); - - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::>( - Some(module), - "test_transaction_commit", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - let result = receiver.await.unwrap().unwrap(); - assert_eq!(2, result.len()); - assert_eq!(2, result[0]); - assert_eq!(1, result[1]); - - let count: i64 = conn - .query_row_f("SELECT COUNT(*) FROM 'table'", (), |row| row.get(0)) - .await - .unwrap() - .unwrap(); - assert_eq!(3, count); - let v0: String = conn - .query_row_f( - "SELECT v0 FROM 'table' WHERE v1 = ?1", - trailbase_sqlite::params!(7), - |row| row.get(0), - ) - .await - .unwrap() - .unwrap(); - assert_eq!("baz", v0); - } - - { - // Check that the throwing an exception or not explicitly calling commit()/rollback() doesn't - // block the writer indefinitely. - let module = Module::new( - "module.ts", - r#" - import { transaction, Transaction } from "trailbase:main"; - - export async function test_transaction_exception() { - return await transaction((tx: Transaction) => { - throw "SOMETHING"; - }); - } - - export async function test_transaction_no_commit() : Promise { - return await transaction((tx: Transaction) : number => { - const count = tx.query("SELECT COUNT(*) FROM 'table'", [])[0][0]; - - // Uncommitted edit: - tx.execute("INSERT INTO 'table' (v0, v1) VALUES (?1, ?2)", ["baz", "7"]); - - return count; - }); - } - - export function get_constant() : number { - return 5; - } - "#, - ); - - let (sender_id, receiver_id) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_sync_js_function_message::( - Some(module.clone()), - "get_constant", - Vec::::new(), - sender_id, - )) - .await - .unwrap(); - - assert!(receiver_id.await.unwrap().unwrap() == 5); - - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::( - Some(module.clone()), - "test_transaction_exception", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - let resp = receiver.await.unwrap(); - assert!(resp.is_err(), "{resp:?}"); - - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::( - Some(module.clone()), - "test_transaction_no_commit", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - assert_eq!(3, receiver.await.unwrap().unwrap()); - - // Acquire a lock. This would block for ever if it was still held by the transactions above. - let guard = conn.write_lock(); - - // Holding the above lock will block further transaction. Make sure the isolate can still - // make progress. - let (sender, receiver) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_async_js_function_message::( - Some(module.clone()), - "test_transaction_no_commit", - Vec::::new(), - sender, - )) - .await - .unwrap(); - - let (sender_id, receiver_id) = oneshot::channel(); - handle - .send_to_any_isolate(build_call_sync_js_function_message::( - Some(module.clone()), - "get_constant", - Vec::::new(), - sender_id, - )) - .await - .unwrap(); - - assert_eq!(5, receiver_id.await.unwrap().unwrap()); - - // Drop the lock. - let _ = drop(guard); - - assert_eq!(3, receiver.await.unwrap().unwrap()); - } - } -} diff --git a/crates/js-runtime/src/util.rs b/crates/js-runtime/src/util.rs deleted file mode 100644 index 0e1fa24f..00000000 --- a/crates/js-runtime/src/util.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::borrow::Cow; - -pub(crate) fn cow_to_string(cow: Cow<'static, [u8]>) -> String { - match cow { - Cow::Borrowed(x) => String::from_utf8_lossy(x).to_string(), - Cow::Owned(x) => String::from_utf8_lossy(&x).to_string(), - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2985782e..6171699c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -382,33 +382,6 @@ importers: specifier: ^8.46.4 version: 8.46.4(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3) - crates/js-runtime/assets/runtime: - devDependencies: - '@eslint/js': - specifier: ^9.39.1 - version: 9.39.1 - eslint: - specifier: ^9.39.1 - version: 9.39.1(jiti@2.6.1) - prettier: - specifier: ^3.6.2 - version: 3.6.2 - typescript: - specifier: ^5.9.3 - version: 5.9.3 - typescript-eslint: - specifier: ^8.46.4 - version: 8.46.4(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3) - vite: - specifier: ^7.2.2 - version: 7.2.2(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.1) - vite-plugin-dts: - specifier: ^4.5.4 - version: 4.5.4(@types/node@24.10.1)(rollup@4.53.2)(typescript@5.9.3)(vite@7.2.2(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.1)) - vitest: - specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@15.11.7)(jiti@2.6.1)(jsdom@27.2.0)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.1) - docs: dependencies: '@astrojs/check': @@ -3128,8 +3101,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001755: - resolution: {integrity: sha512-44V+Jm6ctPj7R52Na4TLi3Zri4dWUljJd+RDm+j8LtNCc/ihLCT+X1TzoOAkRETEWqjuLnh9581Tl80FvK7jVA==} + caniuse-lite@1.0.30001754: + resolution: {integrity: sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==} case-anything@2.1.13: resolution: {integrity: sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==} @@ -3386,8 +3359,8 @@ packages: resolution: {integrity: sha512-OytmFH+13/QXONJcC75QNdMtKpceNk3u8ThBjyyYjkEcy/ekBwR1mMAuNvi3gdBPW3N5TlCzQ0WZw8H0lN/bDw==} engines: {node: '>=20'} - csstype@3.2.3: - resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + csstype@3.2.0: + resolution: {integrity: sha512-si++xzRAY9iPp60roQiFta7OFbhrgvcthrhlNAGeQptSY25uJjkfUV8OArC3KLocB8JT8ohz+qgxWCmz8RhjIg==} csv-parse@5.6.0: resolution: {integrity: sha512-l3nz3euub2QMg5ouu5U09Ew9Wf6/wQ8I++ch1loQ0ljmzhmfZYrH9fflS22i/PQEvsPvxCwxgz5q7UB8K1JO4Q==} @@ -3524,8 +3497,8 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.254: - resolution: {integrity: sha512-DcUsWpVhv9svsKRxnSCZ86SjD+sp32SGidNB37KpqXJncp1mfUgKbHvBomE89WJDbfVKw1mdv5+ikrvd43r+Bg==} + electron-to-chromium@1.5.252: + resolution: {integrity: sha512-53uTpjtRgS7gjIxZ4qCgFdNO2q+wJt/Z8+xAvxbCqXPJrY6h7ighUkadQmNMXH96crtpa6gPFNP7BF4UBGDuaA==} emmet@2.4.11: resolution: {integrity: sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ==} @@ -3840,8 +3813,8 @@ packages: fontkit@2.0.4: resolution: {integrity: sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==} - form-data@4.0.5: - resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} + form-data@4.0.4: + resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} engines: {node: '>= 6'} forwarded@0.2.0: @@ -4152,8 +4125,8 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - inline-style-parser@0.2.7: - resolution: {integrity: sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==} + inline-style-parser@0.2.6: + resolution: {integrity: sha512-gtGXVaBdl5mAes3rPcMedEBm12ibjt1kDMFfheul1wUAOVEJW60voNdMVzVkfLN06O7ZaD/rxhfKgtlgtTbMjg==} ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} @@ -4262,8 +4235,8 @@ packages: jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - jose@6.1.2: - resolution: {integrity: sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ==} + jose@6.1.1: + resolution: {integrity: sha512-GWSqjfOPf4cWOkBzw5THBjtGPhXKqYnfRBzh4Ni+ArTrQQ9unvmsA3oFLqaYKoKe5sjWmGu5wVKg9Ft1i+LQfg==} js-base64@3.7.8: resolution: {integrity: sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==} @@ -5487,8 +5460,8 @@ packages: deprecated: 'SECURITY: Multiple vulnerabilities fixed in 8.0.1 (XML injection, path traversal, command injection, protocol injection). Upgrade immediately: npm install sitemap@8.0.1' hasBin: true - smol-toml@1.5.2: - resolution: {integrity: sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==} + smol-toml@1.5.0: + resolution: {integrity: sha512-Jjsa8LZ+DyLbZ7gVi9d18bS8oxq0PQrTlVDfvYXgh7gxLwbW9QWgvakHD+hBLUtr5NahfStd8LQLGSPchaEJ8Q==} engines: {node: '>= 18'} solid-devtools@0.30.1: @@ -5645,11 +5618,11 @@ packages: style-mod@4.1.3: resolution: {integrity: sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==} - style-to-js@1.1.21: - resolution: {integrity: sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==} + style-to-js@1.1.19: + resolution: {integrity: sha512-Ev+SgeqiNGT1ufsXyVC5RrJRXdrkRJ1Gol9Qw7Pb72YCKJXrBvP0ckZhBeVSrw2m06DJpei2528uIpjMb4TsoQ==} - style-to-object@1.0.14: - resolution: {integrity: sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==} + style-to-object@1.0.12: + resolution: {integrity: sha512-ddJqYnoT4t97QvN2C95bCgt+m7AAgXjVnkk/jxAfmp7EAB8nnqqZYEbMd3em7/vEomDb2LAQKAy1RFfv41mdNw==} suf-log@2.5.3: resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==} @@ -5755,11 +5728,11 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tldts-core@7.0.18: - resolution: {integrity: sha512-jqJC13oP4FFAahv4JT/0WTDrCF9Okv7lpKtOZUGPLiAnNbACcSg8Y8T+Z9xthOmRBqi/Sob4yi0TE0miRCvF7Q==} + tldts-core@7.0.17: + resolution: {integrity: sha512-DieYoGrP78PWKsrXr8MZwtQ7GLCUeLxihtjC1jZsW1DnvSMdKPitJSe8OSYDM2u5H6g3kWJZpePqkp43TfLh0g==} - tldts@7.0.18: - resolution: {integrity: sha512-lCcgTAgMxQ1JKOWrVGo6E69Ukbnx4Gc1wiYLRf6J5NN4HRYJtCby1rPF8rkQ4a6qqoFBK5dvjJ1zJ0F7VfDSvw==} + tldts@7.0.17: + resolution: {integrity: sha512-Y1KQBgDd/NUc+LfOtKS6mNsC9CCaH+m2P1RoIZy7RAPo3C3/t8X45+zgut31cRZtZ3xKPjfn3TkGTrctC2TQIQ==} hasBin: true to-regex-range@5.0.1: @@ -6629,7 +6602,7 @@ snapshots: remark-rehype: 11.1.2 remark-smartypants: 3.0.2 shiki: 3.15.0 - smol-toml: 1.5.2 + smol-toml: 1.5.0 unified: 11.0.5 unist-util-remove-position: 5.0.0 unist-util-visit: 5.0.0 @@ -8381,7 +8354,7 @@ snapshots: '@types/react@19.2.5': dependencies: - csstype: 3.2.3 + csstype: 3.2.0 '@types/sax@1.2.7': dependencies: @@ -8930,7 +8903,7 @@ snapshots: rehype: 13.0.2 semver: 7.7.3 shiki: 3.15.0 - smol-toml: 1.5.2 + smol-toml: 1.5.0 tinyexec: 1.0.2 tinyglobby: 0.2.15 tsconfck: 3.1.6(typescript@4.9.4) @@ -9031,7 +9004,7 @@ snapshots: rehype: 13.0.2 semver: 7.7.3 shiki: 3.15.0 - smol-toml: 1.5.2 + smol-toml: 1.5.0 tinyexec: 1.0.2 tinyglobby: 0.2.15 tsconfck: 3.1.6(typescript@5.9.3) @@ -9095,7 +9068,7 @@ snapshots: autoprefixer@10.4.22(postcss@8.5.6): dependencies: browserslist: 4.28.0 - caniuse-lite: 1.0.30001755 + caniuse-lite: 1.0.30001754 fraction.js: 5.3.4 normalize-range: 0.1.2 picocolors: 1.1.1 @@ -9105,7 +9078,7 @@ snapshots: axios@1.13.2: dependencies: follow-redirects: 1.15.11 - form-data: 4.0.5 + form-data: 4.0.4 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug @@ -9205,8 +9178,8 @@ snapshots: browserslist@4.28.0: dependencies: baseline-browser-mapping: 2.8.28 - caniuse-lite: 1.0.30001755 - electron-to-chromium: 1.5.254 + caniuse-lite: 1.0.30001754 + electron-to-chromium: 1.5.252 node-releases: 2.0.27 update-browserslist-db: 1.1.4(browserslist@4.28.0) @@ -9237,7 +9210,7 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001755: {} + caniuse-lite@1.0.30001754: {} case-anything@2.1.13: {} @@ -9507,7 +9480,7 @@ snapshots: '@csstools/css-syntax-patches-for-csstree': 1.0.16 css-tree: 3.1.0 - csstype@3.2.3: {} + csstype@3.2.0: {} csv-parse@5.6.0: {} @@ -9610,7 +9583,7 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.254: {} + electron-to-chromium@1.5.252: {} emmet@2.4.11: dependencies: @@ -9766,7 +9739,7 @@ snapshots: is-html: 2.0.0 kebab-case: 1.0.2 known-css-properties: 0.30.0 - style-to-object: 1.0.14 + style-to-object: 1.0.12 typescript: 4.9.4 transitivePeerDependencies: - supports-color @@ -9779,7 +9752,7 @@ snapshots: is-html: 2.0.0 kebab-case: 1.0.2 known-css-properties: 0.30.0 - style-to-object: 1.0.14 + style-to-object: 1.0.12 typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -10059,7 +10032,7 @@ snapshots: unicode-properties: 1.4.1 unicode-trie: 2.0.0 - form-data@4.0.5: + form-data@4.0.4: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 @@ -10313,7 +10286,7 @@ snapshots: mdast-util-mdxjs-esm: 2.0.1 property-information: 7.1.0 space-separated-tokens: 2.0.2 - style-to-js: 1.1.21 + style-to-js: 1.1.19 unist-util-position: 5.0.0 zwitch: 2.0.4 transitivePeerDependencies: @@ -10347,7 +10320,7 @@ snapshots: mdast-util-mdxjs-esm: 2.0.1 property-information: 7.1.0 space-separated-tokens: 2.0.2 - style-to-js: 1.1.21 + style-to-js: 1.1.19 unist-util-position: 5.0.0 vfile-message: 4.0.3 transitivePeerDependencies: @@ -10492,7 +10465,7 @@ snapshots: inherits@2.0.4: {} - inline-style-parser@0.2.7: {} + inline-style-parser@0.2.6: {} ipaddr.js@1.9.1: {} @@ -10565,7 +10538,7 @@ snapshots: jju@1.4.0: {} - jose@6.1.2: {} + jose@6.1.1: {} js-base64@3.7.8: {} @@ -11361,7 +11334,7 @@ snapshots: cors: 2.8.5 express: 5.1.0 is-plain-obj: 4.1.0 - jose: 6.1.2 + jose: 6.1.1 transitivePeerDependencies: - supports-color @@ -12180,7 +12153,7 @@ snapshots: arg: 5.0.2 sax: 1.4.3 - smol-toml@1.5.2: {} + smol-toml@1.5.0: {} solid-devtools@0.30.1(solid-js@1.9.10)(vite@6.4.1(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.1)): dependencies: @@ -12230,7 +12203,7 @@ snapshots: solid-js@1.9.10: dependencies: - csstype: 3.2.3 + csstype: 3.2.0 seroval: 1.3.2 seroval-plugins: 1.3.3(seroval@1.3.2) @@ -12369,13 +12342,13 @@ snapshots: style-mod@4.1.3: {} - style-to-js@1.1.21: + style-to-js@1.1.19: dependencies: - style-to-object: 1.0.14 + style-to-object: 1.0.12 - style-to-object@1.0.14: + style-to-object@1.0.12: dependencies: - inline-style-parser: 0.2.7 + inline-style-parser: 0.2.6 suf-log@2.5.3: dependencies: @@ -12473,11 +12446,11 @@ snapshots: tinyspy@4.0.4: {} - tldts-core@7.0.18: {} + tldts-core@7.0.17: {} - tldts@7.0.18: + tldts@7.0.17: dependencies: - tldts-core: 7.0.18 + tldts-core: 7.0.17 to-regex-range@5.0.1: dependencies: @@ -12489,7 +12462,7 @@ snapshots: tough-cookie@6.0.0: dependencies: - tldts: 7.0.18 + tldts: 7.0.17 tr46@0.0.3: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e4bb4815..0daad516 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,7 +3,6 @@ packages: - 'crates/assets/js/admin' - 'crates/assets/js/client' - 'crates/auth-ui/ui' - - 'crates/js-runtime/assets/runtime' - 'docs' - 'docs/examples/record_api_ts' - 'examples/blog/web'