From ea22fe90b5d469f067152f295e0ca76b2dcabe23 Mon Sep 17 00:00:00 2001 From: Bas Zalmstra Date: Fri, 28 Feb 2025 15:49:25 +0100 Subject: [PATCH] feat(js): compile `rattler_solve` and `rattler_repodata_gateway` (#1108) --- .cargo/config.toml | 6 +- .github/workflows/js-bindings.yml | 7 +- .github/workflows/rust-compile.yml | 2 +- Cargo.lock | 103 +- Cargo.toml | 8 +- crates/rattler_cache/Cargo.toml | 4 +- crates/rattler_cache/src/lib.rs | 5 + .../src/authentication_middleware.rs | 6 +- .../src/mirror_middleware.rs | 16 +- .../rattler_networking/src/oci_middleware.rs | 3 +- crates/rattler_package_streaming/Cargo.toml | 11 +- crates/rattler_package_streaming/src/write.rs | 4 + crates/rattler_repodata_gateway/Cargo.toml | 28 +- .../rattler_repodata_gateway/src/fetch/mod.rs | 1604 +-------- .../src/fetch/no_cache.rs | 323 ++ .../src/fetch/with_cache.rs | 1571 +++++++++ .../src/gateway/builder.rs | 20 +- .../src/gateway/error.rs | 37 +- .../src/gateway/local_subdir.rs | 68 +- .../src/gateway/mod.rs | 10 +- .../src/gateway/query.rs | 119 +- .../src/gateway/remote_subdir/mod.rs | 30 + .../tokio.rs} | 148 +- .../src/gateway/remote_subdir/wasm.rs | 61 + .../src/gateway/sharded_subdir/mod.rs | 304 +- .../sharded_subdir/{ => tokio}/index.rs | 21 +- .../src/gateway/sharded_subdir/tokio/mod.rs | 262 ++ .../src/gateway/sharded_subdir/wasm/index.rs | 70 + .../src/gateway/sharded_subdir/wasm/mod.rs | 159 + .../src/gateway/subdir.rs | 63 +- .../src/gateway/subdir_builder.rs | 28 +- crates/rattler_repodata_gateway/src/lib.rs | 2 +- .../rattler_repodata_gateway/src/reporter.rs | 1 + .../src/sparse/mod.rs | 121 +- .../src/utils/body.rs | 1 + .../src/utils/encoding.rs | 2 +- .../rattler_repodata_gateway/src/utils/mod.rs | 13 +- crates/rattler_solve/Cargo.toml | 4 +- crates/rattler_solve/benches/bench.rs | 2 +- crates/rattler_solve/benches/sorting_bench.rs | 2 +- crates/rattler_solve/tests/backends.rs | 6 +- crates/rattler_solve/tests/sorting.rs | 2 +- js-rattler/.cargo/config.toml | 4 + js-rattler/Cargo.lock | 2781 +++++++++++++-- js-rattler/Cargo.toml | 10 +- js-rattler/crate/error.rs | 23 +- js-rattler/crate/lib.rs | 1 + js-rattler/crate/solve.rs | 83 + js-rattler/package-lock.json | 2973 ++++------------- js-rattler/package.json | 6 + js-rattler/src/index.ts | 1 + js-rattler/src/solve.test.ts | 21 + js-rattler/src/solve.ts | 1 + js-rattler/tests/wasm.rs | 23 + py-rattler/Cargo.lock | 705 ++-- py-rattler/src/repo_data/sparse.rs | 2 +- 56 files changed, 6850 insertions(+), 5041 deletions(-) create mode 100644 crates/rattler_repodata_gateway/src/fetch/no_cache.rs create mode 100644 crates/rattler_repodata_gateway/src/fetch/with_cache.rs create mode 100644 crates/rattler_repodata_gateway/src/gateway/remote_subdir/mod.rs rename crates/rattler_repodata_gateway/src/gateway/{remote_subdir.rs => remote_subdir/tokio.rs} (63%) create mode 100644 crates/rattler_repodata_gateway/src/gateway/remote_subdir/wasm.rs rename crates/rattler_repodata_gateway/src/gateway/sharded_subdir/{ => tokio}/index.rs (97%) create mode 100644 crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/mod.rs create mode 100644 crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/index.rs create mode 100644 crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/mod.rs create mode 100644 js-rattler/crate/solve.rs create mode 100644 js-rattler/src/solve.test.ts create mode 100644 js-rattler/src/solve.ts create mode 100644 js-rattler/tests/wasm.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 29d762df1..b756cd431 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -75,4 +75,8 @@ rustflags = [ "-Wfuture_incompatible", "-Wnonstandard_style", "-Wrust_2018_idioms", -] \ No newline at end of file +] + +[target.'wasm32-unknown-unknown'] +# See https://docs.rs/getrandom/latest/getrandom/#webassembly-support +rustflags = ["--cfg", 'getrandom_backend="wasm_js"'] \ No newline at end of file diff --git a/.github/workflows/js-bindings.yml b/.github/workflows/js-bindings.yml index bd96703bd..de468cb0b 100644 --- a/.github/workflows/js-bindings.yml +++ b/.github/workflows/js-bindings.yml @@ -24,6 +24,11 @@ concurrency: permissions: contents: read +env: + RUST_LOG: info + RUST_BACKTRACE: 1 + RUSTFLAGS: "-D warnings --cfg getrandom_backend=\"wasm_js\"" + jobs: format_lint_test: name: Format, Lint and Test the JS bindings @@ -58,7 +63,7 @@ jobs: working-directory: js-rattler - run: npm run fmt:check working-directory: js-rattler - - run: npm run build --if-present + - run: npm run build working-directory: js-rattler - run: npm test working-directory: js-rattler diff --git a/.github/workflows/rust-compile.yml b/.github/workflows/rust-compile.yml index 92f6979fb..7de99ba78 100644 --- a/.github/workflows/rust-compile.yml +++ b/.github/workflows/rust-compile.yml @@ -22,7 +22,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: "-D warnings" CARGO_TERM_COLOR: always - DEFAULT_FEATURES: indicatif,tokio,serde,wasm,reqwest,sparse,gateway,resolvo,libsolv_c,s3 + DEFAULT_FEATURES: indicatif,tokio,serde,reqwest,sparse,gateway,resolvo,libsolv_c,s3 jobs: check-rustdoc-links: diff --git a/Cargo.lock b/Cargo.lock index a133b85e2..5915dd13c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,12 +50,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aliasable" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" - [[package]] name = "allocator-api2" version = "0.2.21" @@ -984,21 +978,20 @@ dependencies = [ [[package]] name = "bzip2" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b89e7c29231c673a61a46e722602bcd138298f6b9e81e71119693534585f5c" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", ] [[package]] name = "bzip2-sys" -version = "0.1.12+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] @@ -1157,7 +1150,7 @@ version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -1687,7 +1680,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -2294,12 +2287,6 @@ dependencies = [ "foldhash", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -3514,30 +3501,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "ouroboros" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59" -dependencies = [ - "aliasable", - "ouroboros_macro", - "static_assertions", -] - -[[package]] -name = "ouroboros_macro" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn", -] - [[package]] name = "outref" version = "0.5.2" @@ -3941,19 +3904,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", - "yansi", -] - [[package]] name = "purl" version = "0.1.5" @@ -4539,6 +4489,7 @@ dependencies = [ "blake2", "bytes", "cache_control", + "cfg-if", "chrono", "dashmap", "dirs", @@ -4556,22 +4507,20 @@ dependencies = [ "itertools 0.14.0", "json-patch", "libc", - "md-5", "memmap2", - "ouroboros", "parking_lot 0.12.3", "pin-project-lite", "rattler_cache", "rattler_conda_types", "rattler_digest", "rattler_networking", - "rattler_package_streaming", "rattler_redaction", "reqwest", "reqwest-middleware", "retry-policies", "rmp-serde", "rstest", + "self_cell", "serde", "serde_json", "serde_with", @@ -4586,6 +4535,7 @@ dependencies = [ "tracing", "tracing-test", "url", + "wasmtimer", "windows-sys 0.59.0", "zstd", ] @@ -5328,6 +5278,12 @@ dependencies = [ "libc", ] +[[package]] +name = "self_cell" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" + [[package]] name = "semver" version = "1.0.25" @@ -5673,7 +5629,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -6506,6 +6462,13 @@ dependencies = [ "wit-bindgen-rt", ] +[[package]] +name = "wasm-bin" +version = "0.1.0" +dependencies = [ + "rattler_solve", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -6605,6 +6568,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.12.3", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.77" @@ -7155,12 +7132,6 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" - [[package]] name = "yoke" version = "0.7.5" diff --git a/Cargo.toml b/Cargo.toml index 04273bed6..60cdb2b41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ base64 = "0.22.1" bindgen = "0.71.1" blake2 = "0.10.6" bytes = "1.10.0" -bzip2 = "0.5.1" +bzip2 = "0.5.2" cache_control = "0.2.0" cfg-if = "1.0" chrono = { version = "0.4.40", default-features = false, features = [ @@ -96,7 +96,6 @@ itertools = "0.14.0" json-patch = "3.0.1" keyring = "3.6.1" lazy-regex = "3.4.1" -lazy_static = "1.5.0" libc = { version = "0.2" } libloading = "0.8.6" libz-sys = { version = "1.1.21", default-features = false } @@ -108,7 +107,6 @@ nom = "7.1.3" num_cpus = "1.16.0" opendal = { version = "0.51.2", default-features = false } once_cell = "1.20.3" -ouroboros = "0.18.5" parking_lot = "0.12.3" pathdiff = "0.2.3" pep440_rs = { version = "0.7.3" } @@ -123,7 +121,7 @@ rayon = "1.10.0" reflink-copy = "0.1.23" regex = "1.11.1" reqwest = { version = "0.12.12", default-features = false } -reqwest-middleware = "0.4.0" +reqwest-middleware = "0.4.1" reqwest-retry = "0.7.0" resolvo = { version = "0.8.6" } retry-policies = { version = "0.4.0", default-features = false } @@ -131,6 +129,7 @@ rmp-serde = { version = "1.3.0" } rstest = { version = "0.24.0" } rstest_reuse = "0.7.0" simd-json = { version = "0.14.3", features = ["serde_impl"] } +self_cell = "1.1.0" serde = { version = "1.0.218" } serde_json = { version = "1.0.139" } serde_repr = "0.1" @@ -171,6 +170,7 @@ url = { version = "2.5.4" } unicode-normalization = "0.1.24" uuid = { version = "1.13.1", default-features = false } walkdir = "2.5.0" +wasmtimer = "0.4.1" which = "7.0.2" windows-sys = { version = "0.59.0", default-features = false } winver = { version = "1.0.0" } diff --git a/crates/rattler_cache/Cargo.toml b/crates/rattler_cache/Cargo.toml index 410791672..b178d5941 100644 --- a/crates/rattler_cache/Cargo.toml +++ b/crates/rattler_cache/Cargo.toml @@ -10,11 +10,14 @@ edition.workspace = true readme.workspace = true [dependencies] + +[target.'cfg(not( target_arch = "wasm32" ))'.dependencies] anyhow.workspace = true dashmap.workspace = true dirs.workspace = true futures.workspace = true fs-err.workspace = true +fs4 = { workspace = true, features = ["fs-err3-tokio", "tokio"] } fxhash.workspace = true itertools.workspace = true parking_lot.workspace = true @@ -30,7 +33,6 @@ url.workspace = true thiserror.workspace = true reqwest-middleware.workspace = true digest.workspace = true -fs4 = { workspace = true, features = ["fs-err3-tokio", "tokio"] } simple_spawn_blocking = { version = "1.1.0", path = "../simple_spawn_blocking", features = ["tokio"] } rayon = { workspace = true } serde_json = { workspace = true } diff --git a/crates/rattler_cache/src/lib.rs b/crates/rattler_cache/src/lib.rs index 1f932e301..c1d4b9876 100644 --- a/crates/rattler_cache/src/lib.rs +++ b/crates/rattler_cache/src/lib.rs @@ -1,8 +1,12 @@ +#[cfg(not(target_arch = "wasm32"))] use std::path::PathBuf; +#[cfg(not(target_arch = "wasm32"))] pub mod package_cache; +#[cfg(not(target_arch = "wasm32"))] pub mod run_exports_cache; +#[cfg(not(target_arch = "wasm32"))] pub mod validation; mod consts; @@ -11,6 +15,7 @@ pub use consts::{PACKAGE_CACHE_DIR, REPODATA_CACHE_DIR, RUN_EXPORTS_CACHE_DIR}; /// Determines the default cache directory for rattler. /// It first checks the environment variable `RATTLER_CACHE_DIR`. /// If not set, it falls back to the standard cache directory provided by `dirs::cache_dir()/rattler/cache`. +#[cfg(not(target_arch = "wasm32"))] pub fn default_cache_dir() -> anyhow::Result { std::env::var("RATTLER_CACHE_DIR") .map(PathBuf::from) diff --git a/crates/rattler_networking/src/authentication_middleware.rs b/crates/rattler_networking/src/authentication_middleware.rs index 517f8b3e2..8c27adefb 100644 --- a/crates/rattler_networking/src/authentication_middleware.rs +++ b/crates/rattler_networking/src/authentication_middleware.rs @@ -1,7 +1,6 @@ //! `reqwest` middleware that authenticates requests with data from the `AuthenticationStorage` use crate::authentication_storage::AuthenticationStorageError; use crate::{Authentication, AuthenticationStorage}; -use async_trait::async_trait; use base64::prelude::BASE64_STANDARD; use base64::Engine; use reqwest::{Request, Response}; @@ -16,7 +15,8 @@ pub struct AuthenticationMiddleware { auth_storage: AuthenticationStorage, } -#[async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] impl Middleware for AuthenticationMiddleware { async fn handle( &self, @@ -148,7 +148,7 @@ mod tests { pub captured_tx: tokio::sync::mpsc::Sender, } - #[async_trait] + #[async_trait::async_trait] impl Middleware for CaptureAbortMiddleware { async fn handle( &self, diff --git a/crates/rattler_networking/src/mirror_middleware.rs b/crates/rattler_networking/src/mirror_middleware.rs index 5075a261f..ede83c9cf 100644 --- a/crates/rattler_networking/src/mirror_middleware.rs +++ b/crates/rattler_networking/src/mirror_middleware.rs @@ -4,9 +4,9 @@ use std::{ sync::atomic::{self, AtomicUsize}, }; -use http::{Extensions, StatusCode}; +use http::Extensions; use itertools::Itertools; -use reqwest::{Request, Response, ResponseBuilderExt}; +use reqwest::{Request, Response}; use reqwest_middleware::{Middleware, Next, Result}; use url::Url; @@ -97,7 +97,8 @@ fn select_mirror(mirrors: &[MirrorState]) -> Option<&MirrorState> { Some(&mirrors[min_failures_index]) } -#[async_trait::async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] impl Middleware for MirrorMiddleware { async fn handle( &self, @@ -160,16 +161,23 @@ impl Middleware for MirrorMiddleware { } } +#[cfg(not(target_arch = "wasm32"))] pub(crate) fn create_404_response(url: &Url, body: &str) -> Response { + use reqwest::ResponseBuilderExt; Response::from( http::response::Builder::new() - .status(StatusCode::NOT_FOUND) + .status(http::StatusCode::NOT_FOUND) .url(url.clone()) .body(body.to_string()) .unwrap(), ) } +#[cfg(target_arch = "wasm32")] +pub(crate) fn create_404_response(_url: &Url, _body: &str) -> Response { + todo!("This is not implemented in reqwest, we need to contribute that.") +} + #[cfg(test)] mod test { use std::{future::IntoFuture, net::SocketAddr}; diff --git a/crates/rattler_networking/src/oci_middleware.rs b/crates/rattler_networking/src/oci_middleware.rs index 5326a26d5..aebd9ed0f 100644 --- a/crates/rattler_networking/src/oci_middleware.rs +++ b/crates/rattler_networking/src/oci_middleware.rs @@ -241,7 +241,8 @@ struct Manifest { annotations: Option>, } -#[async_trait::async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] impl Middleware for OciMiddleware { async fn handle( &self, diff --git a/crates/rattler_package_streaming/Cargo.toml b/crates/rattler_package_streaming/Cargo.toml index 270d5ed01..e4adaa525 100644 --- a/crates/rattler_package_streaming/Cargo.toml +++ b/crates/rattler_package_streaming/Cargo.toml @@ -25,25 +25,26 @@ rattler_redaction = { version = "0.1.7", path = "../rattler_redaction", features ], default-features = false } reqwest = { workspace = true, features = ["stream"], optional = true } reqwest-middleware = { workspace = true, optional = true } -simple_spawn_blocking = { version = "1.1.0", path = "../simple_spawn_blocking", features = [ - "tokio", -] } +simple_spawn_blocking = { version = "1.1.0", path = "../simple_spawn_blocking", features = ["tokio"] } serde_json = { workspace = true } tar = { workspace = true } tempfile = { workspace = true } thiserror = { workspace = true } -tokio = { workspace = true, features = ["fs"] } +tokio = { workspace = true, features = [] } tokio-util = { workspace = true, features = ["io-util"] } tracing = { workspace = true } url = { workspace = true } zip = { workspace = true, features = ["deflate", "time"] } + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +num_cpus = { workspace = true } +tokio = { workspace = true, features = ["fs"] } zstd = { workspace = true, features = ["zstdmt"] } [features] default = ["native-tls"] native-tls = ["rattler_networking/native-tls", "rattler_redaction/native-tls"] rustls-tls = ["rattler_networking/rustls-tls", "rattler_redaction/rustls-tls"] -wasm = ["zstd/wasm"] reqwest = ["dep:reqwest-middleware", "dep:reqwest"] [dev-dependencies] diff --git a/crates/rattler_package_streaming/src/write.rs b/crates/rattler_package_streaming/src/write.rs index 73cb151dc..c46a4a597 100644 --- a/crates/rattler_package_streaming/src/write.rs +++ b/crates/rattler_package_streaming/src/write.rs @@ -241,7 +241,11 @@ fn write_zst_archive( let tar_file = File::open(&tar_path)?; let compression_level = compression_level.to_zstd_level()?; let mut zst_encoder = zstd::Encoder::new(writer, compression_level)?; + #[cfg(not(target_arch = "wasm32"))] zst_encoder.multithread(num_threads.unwrap_or_else(|| num_cpus::get() as u32))?; + // mark as "used" to avoid "unused" warning + #[cfg(target_arch = "wasm32")] + let _ = num_threads; progress_bar_wrapper.reset_position(); if let Ok(tar_total_size) = tar_file.metadata().map(|v| v.len()) { diff --git a/crates/rattler_repodata_gateway/Cargo.toml b/crates/rattler_repodata_gateway/Cargo.toml index 48c172f91..07921fb6b 100644 --- a/crates/rattler_repodata_gateway/Cargo.toml +++ b/crates/rattler_repodata_gateway/Cargo.toml @@ -11,9 +11,9 @@ license.workspace = true readme.workspace = true [dependencies] -fs-err = { workspace = true} +cfg-if = { workspace = true } +fs-err = { workspace = true } anyhow = { workspace = true } -async-fd-lock = { workspace = true } async-compression = { workspace = true, features = ["gzip", "tokio", "bzip2", "zstd"] } async-trait = { workspace = true, optional = true } blake2 = { workspace = true } @@ -31,9 +31,7 @@ humansize = { workspace = true } humantime = { workspace = true } itertools = { workspace = true, optional = true } json-patch = { workspace = true } -md-5 = { workspace = true } -memmap2 = { workspace = true, optional = true } -ouroboros = { workspace = true, optional = true } +self_cell = { workspace = true, optional = true } parking_lot = { workspace = true, optional = true } pin-project-lite = { workspace = true } rattler_conda_types = { path = "../rattler_conda_types", version = "0.31.2", default-features = false, optional = true } @@ -46,10 +44,10 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } serde_with = { workspace = true } superslice = { workspace = true, optional = true } -simple_spawn_blocking = { path = "../simple_spawn_blocking", version = "1.1", features = ["tokio"] } + tempfile = { workspace = true } thiserror = { workspace = true } -tokio = { workspace = true, features = ["rt", "io-util", "macros"] } +tokio = { workspace = true } tokio-util = { workspace = true, features = ["codec", "io"] } tracing = { workspace = true } url = { workspace = true, features = ["serde"] } @@ -64,6 +62,17 @@ libc = { workspace = true } [target.'cfg(windows)'.dependencies] windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_IO"] } +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +async-fd-lock = { workspace = true } +simple_spawn_blocking = { path = "../simple_spawn_blocking", version = "1.1", features = ["tokio"] } +tokio = { workspace = true, features = ["rt", "io-util"] } + +[target.'cfg(target_arch = "wasm32")'.dependencies] +wasmtimer = { workspace = true } + +[target.'cfg(any(unix, windows))'.dependencies] +memmap2 = { workspace = true, optional = true } + [dev-dependencies] assert_matches = { workspace = true } axum = { workspace = true, features = ["tokio"] } @@ -71,10 +80,9 @@ fslock = { workspace = true } hex-literal = { workspace = true } insta = { workspace = true, features = ["yaml"] } rattler_conda_types = { path = "../rattler_conda_types", default-features = false } -rattler_package_streaming = { path = "../rattler_package_streaming", default-features = false, features = ["reqwest"] } rstest = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread"] } -tools = { path="../tools" } +tools = { path = "../tools" } tower-http = { workspace = true, features = ["fs", "compression-gzip", "trace"] } tracing-test = { workspace = true } @@ -82,7 +90,7 @@ tracing-test = { workspace = true } default = ['native-tls'] native-tls = ['reqwest/native-tls', 'reqwest/native-tls-alpn'] rustls-tls = ['reqwest/rustls-tls'] -sparse = ["rattler_conda_types", "memmap2", "ouroboros", "superslice", "itertools", "serde_json/raw_value"] +sparse = ["rattler_conda_types", "memmap2", "self_cell", "superslice", "itertools", "serde_json/raw_value"] gateway = ["sparse", "http", "http-cache-semantics", "parking_lot", "async-trait"] [package.metadata.docs.rs] diff --git a/crates/rattler_repodata_gateway/src/fetch/mod.rs b/crates/rattler_repodata_gateway/src/fetch/mod.rs index 43bda98fa..5e2997b29 100644 --- a/crates/rattler_repodata_gateway/src/fetch/mod.rs +++ b/crates/rattler_repodata_gateway/src/fetch/mod.rs @@ -1,40 +1,20 @@ //! This module provides functionality to download and cache `repodata.json` //! from a remote location. -use std::{ - io::ErrorKind, - path::{Path, PathBuf}, - sync::Arc, - time::{Duration, SystemTime}, -}; - -use cache::{CacheHeaders, Expiring, RepoDataState}; -use cache_control::{Cachability, CacheControl}; -use fs_err::tokio as tokio_fs; -use futures::{future::ready, FutureExt, TryStreamExt}; -use humansize::{SizeFormatter, DECIMAL}; -use rattler_digest::{compute_file_digest, Blake2b256, HashingWriter}; -use rattler_networking::retry_policies::default_retry_policy; +use cfg_if::cfg_if; use rattler_redaction::Redact; -use reqwest::{ - header::{HeaderMap, HeaderValue}, - Response, StatusCode, -}; -use retry_policies::{RetryDecision, RetryPolicy}; -use tempfile::NamedTempFile; -use tokio_util::io::StreamReader; -use tracing::{instrument, Level}; use url::Url; -// use fs-err for better error reporting -use crate::{ - reporter::ResponseReporterExt, - utils::{AsyncEncoding, Encoding, LockedFile}, - Reporter, -}; +pub mod no_cache; -mod cache; -pub mod jlap; +cfg_if! { + if #[cfg(not(target_arch = "wasm32"))] { + mod cache; + mod with_cache; + pub mod jlap; + pub use with_cache::*; + } +} /// `RepoData` could not be found for given channel and platform #[derive(Debug, thiserror::Error)] @@ -103,6 +83,7 @@ impl From for RepoDataNotFoundError { } } +#[cfg(not(target_arch = "wasm32"))] impl From for FetchRepoDataError { fn from(err: tokio::task::JoinError) -> Self { // Rethrow any panic @@ -115,24 +96,6 @@ impl From for FetchRepoDataError { } } -/// Defines how to use the repodata cache. -#[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] -pub enum CacheAction { - /// Use the cache if its up to date or fetch from the URL if there is no - /// valid cached value. - #[default] - CacheOrFetch, - - /// Only use the cache, but error out if the cache is not up to date - UseCacheOnly, - - /// Only use the cache, ignore whether or not it is up to date. - ForceCacheOnly, - - /// Do not use the cache even if there is an up to date entry. - NoCache, -} - /// Defines which type of repodata.json file to download. Usually you want to /// use the [`Variant::AfterPatches`] variant because that reflects the repodata /// with any patches applied. @@ -173,1539 +136,20 @@ impl Variant { } } -/// Additional knobs that allow you to tweak the behavior of -/// [`fetch_repo_data`]. -#[derive(Clone)] -pub struct FetchRepoDataOptions { - /// How to use the cache. By default it will cache and reuse downloaded - /// repodata.json (if the server allows it). - pub cache_action: CacheAction, - - /// Determines which variant to download. See [`Variant`] for more - /// information. - pub variant: Variant, - - /// When enabled repodata can be fetched incrementally using JLAP - pub jlap_enabled: bool, - - /// When enabled, the zstd variant will be used if available - pub zstd_enabled: bool, - - /// When enabled, the bz2 variant will be used if available - pub bz2_enabled: bool, - - /// Retry policy to use when streaming the response is interrupted. If this - /// is `None` the default retry policy is used. - pub retry_policy: Option>, -} - -impl Default for FetchRepoDataOptions { - fn default() -> Self { - Self { - cache_action: CacheAction::default(), - variant: Variant::default(), - jlap_enabled: true, - zstd_enabled: true, - bz2_enabled: true, - retry_policy: None, - } - } -} - -/// The result of [`fetch_repo_data`]. -#[derive(Debug)] -pub struct CachedRepoData { - /// A lockfile that guards access to any of the repodata.json file or its - /// cache. - pub lock_file: LockedFile, - - /// The path to the uncompressed repodata.json file. - pub repo_data_json_path: PathBuf, - - /// The cache data. - pub cache_state: RepoDataState, - - /// How the cache was used for this request. - pub cache_result: CacheResult, -} - -/// Indicates whether or not the repodata.json cache was up-to-date or not. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum CacheResult { - /// The cache was hit, the data on disk was already valid. - CacheHit, - - /// The cache was hit, we did have to check with the server, but no data was - /// downloaded. - CacheHitAfterFetch, - - /// The cache was present but it was outdated. - CacheOutdated, - - /// There was no cache available - CacheNotPresent, -} - -/// handle file:/// urls -async fn repodata_from_file( - subdir_url: Url, - out_path: PathBuf, - cache_state_path: PathBuf, - lock_file: LockedFile, -) -> Result { - // copy file from subdir_url to out_path - if let Err(e) = tokio_fs::copy(&subdir_url.to_file_path().unwrap(), &out_path).await { - return if e.kind() == ErrorKind::NotFound { - Err(FetchRepoDataError::NotFound( - RepoDataNotFoundError::FileSystemError(e), - )) - } else { - Err(FetchRepoDataError::IoError(e)) - }; - } - - // create a dummy cache state - let new_cache_state = RepoDataState { - url: subdir_url.clone(), - cache_size: tokio_fs::metadata(&out_path) - .await - .map_err(FetchRepoDataError::IoError)? - .len(), - cache_headers: CacheHeaders { - etag: None, - last_modified: None, - cache_control: None, - }, - cache_last_modified: SystemTime::now(), - blake2_hash: None, - blake2_hash_nominal: None, - has_zst: None, - has_bz2: None, - has_jlap: None, - jlap: None, - }; - - // write the cache state - let new_cache_state = tokio::task::spawn_blocking(move || { - new_cache_state - .to_path(&cache_state_path) - .map(|_| new_cache_state) - .map_err(FetchRepoDataError::FailedToWriteCacheState) - }) - .await??; - - Ok(CachedRepoData { - lock_file, - repo_data_json_path: out_path.clone(), - cache_state: new_cache_state, - cache_result: CacheResult::CacheHit, - }) -} - -/// Fetch the repodata.json file for the given subdirectory. The result is -/// cached on disk using the HTTP cache headers returned from the server. -/// -/// The successful result of this function also returns a lockfile which ensures -/// that both the state and the repodata that is pointed to remain in sync. -/// However, not releasing the lockfile (by dropping it) could block other -/// threads and processes, it is therefore advisable to release it as quickly as -/// possible. -/// -/// This method implements several different methods to download the -/// repodata.json file from the remote: -/// -/// * If a `repodata.json.zst` file is available in the same directory that file -/// is downloaded and decompressed. -/// * If a `repodata.json.bz2` file is available in the same directory that file -/// is downloaded and decompressed. -/// * Otherwise the regular `repodata.json` file is downloaded. -/// -/// The checks to see if a `.zst` and/or `.bz2` file exist are performed by -/// doing a HEAD request to the respective URLs. The result of these are cached. -#[instrument(err(level = Level::INFO), skip_all, fields(subdir_url, cache_path = % cache_path.display()))] -pub async fn fetch_repo_data( - subdir_url: Url, - client: reqwest_middleware::ClientWithMiddleware, - cache_path: PathBuf, - options: FetchRepoDataOptions, - reporter: Option>, -) -> Result { - let subdir_url = normalize_subdir_url(subdir_url); - - // Compute the cache key from the url - let cache_key = crate::utils::url_to_cache_filename( - &subdir_url - .join(options.variant.file_name()) - .expect("file name is valid"), - ); - let repo_data_json_path = cache_path.join(format!("{cache_key}.json")); - let cache_state_path = cache_path.join(format!("{cache_key}.info.json")); - - // Lock all files that have to do with that cache key - let lock_file_path = cache_path.join(format!("{}.lock", &cache_key)); - let lock_file = - tokio::task::spawn_blocking(move || LockedFile::open_rw(lock_file_path, "repodata cache")) - .await? - .map_err(FetchRepoDataError::FailedToAcquireLock)?; - - let cache_action = if subdir_url.scheme() == "file" { - // If we are dealing with a local file, we can skip the cache entirely. - return repodata_from_file( - subdir_url.join(options.variant.file_name()).unwrap(), - repo_data_json_path, - cache_state_path, - lock_file, - ) - .await; - } else { - options.cache_action - }; - - // Validate the current state of the cache - let cache_state = if cache_action == CacheAction::NoCache { - None - } else { - let owned_subdir_url = subdir_url.clone(); - let owned_cache_path = cache_path.clone(); - let owned_cache_key = cache_key.clone(); - let cache_state = tokio::task::spawn_blocking(move || { - validate_cached_state(&owned_cache_path, &owned_subdir_url, &owned_cache_key) - }) - .await?; - match (cache_state, options.cache_action) { - (ValidatedCacheState::UpToDate(cache_state), _) - | (ValidatedCacheState::OutOfDate(cache_state), CacheAction::ForceCacheOnly) => { - // Cache is up to date or we dont care about whether or not its up to date, - // so just immediately return what we have. - return Ok(CachedRepoData { - lock_file, - repo_data_json_path, - cache_state, - cache_result: CacheResult::CacheHit, - }); - } - (ValidatedCacheState::OutOfDate(_), CacheAction::UseCacheOnly) - | ( - ValidatedCacheState::Mismatched(_) | ValidatedCacheState::InvalidOrMissing, - CacheAction::UseCacheOnly | CacheAction::ForceCacheOnly, - ) => { - // The cache is out of date but we also cant fetch new data - // OR, The cache doesn't match the repodata.json that is on disk. This means the - // cache is not usable. - // OR, No cache available at all, and we cant refresh the data. - return Err(FetchRepoDataError::NoCacheAvailable); - } - ( - ValidatedCacheState::OutOfDate(cache_state) - | ValidatedCacheState::Mismatched(cache_state), - _, - ) => { - // The cache is out of date but we can still refresh the data - // OR, The cache doesn't match the data that is on disk. but it might contain - // some other interesting cached data as well... - Some(cache_state) - } - (ValidatedCacheState::InvalidOrMissing, _) => { - // No cache available but we can update it! - None - } - } - }; - - // Determine the availability of variants based on the cache or by querying the - // remote. - let variant_availability = check_variant_availability( - &client, - &subdir_url, - cache_state.as_ref(), - options.variant.file_name(), - &options, - ) - .await; - - // Now that the caches have been refreshed determine whether or not we can use - // one of the variants. We don't check the expiration here since we just - // refreshed it. - let has_zst = options.zstd_enabled && variant_availability.has_zst(); - let has_bz2 = options.bz2_enabled && variant_availability.has_bz2(); - let has_jlap = options.jlap_enabled && variant_availability.has_jlap(); - - // We first attempt to make a JLAP request; if it fails for any reason, we - // continue on with a normal request. - let jlap_state = if has_jlap && cache_state.is_some() { - let repo_data_state = cache_state.as_ref().unwrap(); - match jlap::patch_repo_data( - &client, - subdir_url.clone(), - repo_data_state.clone(), - &repo_data_json_path, - reporter.clone(), - ) - .await - { - Ok((state, disk_hash)) => { - tracing::info!("fetched JLAP patches successfully"); - let cache_state = RepoDataState { - blake2_hash: Some(disk_hash), - blake2_hash_nominal: Some(state.footer.latest), - has_zst: variant_availability.has_zst, - has_bz2: variant_availability.has_bz2, - has_jlap: variant_availability.has_jlap, - jlap: Some(state), - ..cache_state.expect("we must have had a cache, otherwise we wouldn't know the previous state of the cache") - }; - - let cache_state = tokio::task::spawn_blocking(move || { - cache_state - .to_path(&cache_state_path) - .map(|_| cache_state) - .map_err(FetchRepoDataError::FailedToWriteCacheState) - }) - .await??; - - return Ok(CachedRepoData { - lock_file, - repo_data_json_path, - cache_state, - cache_result: CacheResult::CacheOutdated, - }); - } - Err(error) => { - tracing::warn!("Error during JLAP request: {}", error); - None - } - } - } else { - None - }; - - // Determine which variant to download - let repo_data_url = if has_zst { - subdir_url - .join(&format!("{}.zst", options.variant.file_name())) - .unwrap() - } else if has_bz2 { - subdir_url - .join(&format!("{}.bz2", options.variant.file_name())) - .unwrap() - } else { - subdir_url.join(options.variant.file_name()).unwrap() - }; - - // Construct the HTTP request - tracing::debug!("fetching '{}'", &repo_data_url); - let request_builder = client.get(repo_data_url.clone()); - - let mut headers = HeaderMap::default(); - - // We can handle g-zip encoding which is often used. We could also set this - // option on the client, but that will disable all download progress - // messages by `reqwest` because the gzipped data is decoded on the fly and - // the size of the decompressed body is unknown. However, we don't really - // care about the decompressed size but rather we'd like to know the number - // of raw bytes that are actually downloaded. - // - // To do this we manually set the request header to accept gzip encoding and we - // use the [`AsyncEncoding`] trait to perform the decoding on the fly. - headers.insert( - reqwest::header::ACCEPT_ENCODING, - HeaderValue::from_static("gzip"), - ); - - // Add previous cache headers if we have them - if let Some(cache_headers) = cache_state.as_ref().map(|state| &state.cache_headers) { - cache_headers.add_to_request(&mut headers); - } - // Send the request and wait for a reply - let download_reporter = reporter - .as_deref() - .map(|r| (r, r.on_download_start(&repo_data_url))); - - let (client, request) = request_builder.headers(headers).build_split(); - let request = request.expect("must have a valid request at this point"); - let default_retry_behavior = default_retry_policy(); - let retry_behavior = options - .retry_policy - .as_deref() - .unwrap_or(&default_retry_behavior); - let mut retry_count = 0; - let (temp_file, blake2_hash, response_url, cache_headers) = loop { - let request_start_time = SystemTime::now(); - let response = match client.execute(request.try_clone().unwrap()).await { - Ok(response) if response.status() == StatusCode::NOT_FOUND => { - return Err(FetchRepoDataError::NotFound(RepoDataNotFoundError::from( - response.error_for_status().unwrap_err(), - ))); - } - Ok(response) => response.error_for_status()?, - Err(e) => { - return Err(FetchRepoDataError::from(e)); - } - }; - - // If the content didn't change, simply return whatever we have on disk. - if response.status() == StatusCode::NOT_MODIFIED { - tracing::debug!("repodata was unmodified"); - - // Update the cache on disk with any new findings. - let cache_state = RepoDataState { - url: repo_data_url, - has_zst: variant_availability.has_zst, - has_bz2: variant_availability.has_bz2, - has_jlap: variant_availability.has_jlap, - jlap: jlap_state, - ..cache_state.expect("we must have had a cache, otherwise we wouldn't know the previous state of the cache") - }; - - let cache_state = tokio::task::spawn_blocking(move || { - cache_state - .to_path(&cache_state_path) - .map(|_| cache_state) - .map_err(FetchRepoDataError::FailedToWriteCacheState) - }) - .await??; - - return Ok(CachedRepoData { - lock_file, - repo_data_json_path, - cache_state, - cache_result: CacheResult::CacheHitAfterFetch, - }); - } - - // Get cache headers from the response - let cache_headers = CacheHeaders::from(&response); - - // Stream the content to a temporary file - let response_url = response.url().clone(); - let stream_result = stream_and_decode_to_file( - repo_data_url.clone(), - response, - if has_zst { - Encoding::Zst - } else if has_bz2 { - Encoding::Bz2 - } else { - Encoding::Passthrough - }, - &cache_path, - download_reporter, - ) - .await; - - match stream_result { - Ok((file, hash)) => break (file, hash, response_url, cache_headers), - Err(FetchRepoDataError::FailedToDownload(url, err)) => { - let execute_after = - match retry_behavior.should_retry(request_start_time, retry_count) { - RetryDecision::Retry { execute_after } => execute_after, - RetryDecision::DoNotRetry => { - return Err(FetchRepoDataError::FailedToDownload(url, err)) - } - }; - let duration = execute_after - .duration_since(SystemTime::now()) - .unwrap_or(Duration::ZERO); - - // Wait for a second to let the remote service restore itself. This increases - // the chance of success. - tracing::warn!( - "failed to download repodata from {}: {}. Retry #{}, Sleeping {:?} until the next attempt...", - &url, - err, - retry_count, - duration - ); - tokio::time::sleep(duration).await; - } - Err(e) => return Err(e), - } - - retry_count += 1; - }; - - if let Some((reporter, index)) = download_reporter { - reporter.on_download_complete(&response_url, index); - } - - // Persist the file to its final destination - let repo_data_destination_path = repo_data_json_path.clone(); - let repo_data_json_metadata = tokio::task::spawn_blocking(move || { - let file = temp_file - .persist(repo_data_destination_path) - .map_err(FetchRepoDataError::FailedToPersistTemporaryFile)?; - - // Determine the last modified date and size of the repodata.json file. We store - // these values in the cache to link the cache to the corresponding - // repodata.json file. - file.metadata() - .map_err(FetchRepoDataError::FailedToGetMetadata) - }) - .await??; - - // Update the cache on disk. - let had_cache = cache_state.is_some(); - let new_cache_state = RepoDataState { - url: repo_data_url, - cache_headers, - cache_last_modified: repo_data_json_metadata - .modified() - .map_err(FetchRepoDataError::FailedToGetMetadata)?, - cache_size: repo_data_json_metadata.len(), - blake2_hash: Some(blake2_hash), - blake2_hash_nominal: Some(blake2_hash), - has_zst: variant_availability.has_zst, - has_bz2: variant_availability.has_bz2, - has_jlap: variant_availability.has_jlap, - jlap: jlap_state, - }; - - let new_cache_state = tokio::task::spawn_blocking(move || { - new_cache_state - .to_path(&cache_state_path) - .map(|_| new_cache_state) - .map_err(FetchRepoDataError::FailedToWriteCacheState) - }) - .await??; - - Ok(CachedRepoData { - lock_file, - repo_data_json_path, - cache_state: new_cache_state, - cache_result: if had_cache { - CacheResult::CacheOutdated - } else { - CacheResult::CacheNotPresent - }, - }) -} - -/// Streams and decodes the response to a new temporary file in the given -/// directory. While writing to disk it also computes the BLAKE2 hash of the -/// file. -#[instrument(skip_all)] -async fn stream_and_decode_to_file( - url: Url, - response: Response, - content_encoding: Encoding, - temp_dir: &Path, - reporter: Option<(&dyn Reporter, usize)>, -) -> Result<(NamedTempFile, blake2::digest::Output), FetchRepoDataError> { - // Determine the encoding of the response - let transfer_encoding = Encoding::from(&response); - - // Convert the response into a byte stream - let mut total_bytes = 0; - let bytes_stream = response - .byte_stream_with_progress(reporter) - .inspect_ok(|bytes| { - total_bytes += bytes.len(); - }) - .map_err(|e| std::io::Error::new(ErrorKind::Other, e)); - - // Create a new stream from the byte stream that decodes the bytes using the - // transfer encoding on the fly. - let decoded_byte_stream = StreamReader::new(bytes_stream).decode(transfer_encoding); - - // Create yet another stream that decodes the bytes yet again but this time - // using the content encoding. - let mut decoded_repo_data_json_bytes = - tokio::io::BufReader::new(decoded_byte_stream).decode(content_encoding); - - tracing::trace!( - "decoding repodata (content: {:?}, transfer: {:?})", - content_encoding, - transfer_encoding - ); - - // Construct a temporary file - let temp_file = - NamedTempFile::new_in(temp_dir).map_err(FetchRepoDataError::FailedToCreateTemporaryFile)?; - - // Clone the file handle and create a hashing writer so we can compute a hash - // while the content is being written to disk. - let file = tokio_fs::File::from_std(fs_err::File::from_parts( - temp_file - .as_file() - .try_clone() - .map_err(FetchRepoDataError::IoError)?, - temp_file.path(), - )); - let mut hashing_file_writer = HashingWriter::<_, Blake2b256>::new(file); - - // Decode, hash and write the data to the file. - let bytes = tokio::io::copy(&mut decoded_repo_data_json_bytes, &mut hashing_file_writer) - .await - .map_err(|e| FetchRepoDataError::FailedToDownload(url.redact(), e))?; - - // Finalize the hash - let (_, hash) = hashing_file_writer.finalize(); - - tracing::debug!( - "downloaded {}, decoded that into {}, BLAKE2 hash: {:x}", - SizeFormatter::new(total_bytes, DECIMAL), - SizeFormatter::new(bytes, DECIMAL), - hash - ); - - Ok((temp_file, hash)) -} - -/// Describes the availability of certain `repodata.json`. -#[derive(Debug)] -pub struct VariantAvailability { - has_zst: Option>, - has_bz2: Option>, - has_jlap: Option>, -} - -impl VariantAvailability { - /// Returns true if there is a Zst variant available, regardless of when it - /// was checked - pub fn has_zst(&self) -> bool { - self.has_zst.as_ref().is_some_and(|state| state.value) - } - - /// Returns true if there is a Bz2 variant available, regardless of when it - /// was checked - pub fn has_bz2(&self) -> bool { - self.has_bz2.as_ref().is_some_and(|state| state.value) - } - - /// Returns true if there is a JLAP variant available, regardless of when it - /// was checked - pub fn has_jlap(&self) -> bool { - self.has_jlap.as_ref().is_some_and(|state| state.value) - } -} - -/// Determine the availability of `repodata.json` variants (like a `.zst` or -/// `.bz2`) by checking a cache or the internet. -pub async fn check_variant_availability( - client: &reqwest_middleware::ClientWithMiddleware, - subdir_url: &Url, - cache_state: Option<&RepoDataState>, - filename: &str, - options: &FetchRepoDataOptions, -) -> VariantAvailability { - // Determine from the cache which variant are available. This is currently - // cached for a maximum of 14 days. - let expiration_duration = chrono::TimeDelta::try_days(14).expect("14 days is a valid duration"); - let has_zst = if options.zstd_enabled { - cache_state - .and_then(|state| state.has_zst.as_ref()) - .and_then(|value| value.value(expiration_duration)) - .copied() - } else { - Some(false) - }; - let has_bz2 = if options.bz2_enabled { - cache_state - .and_then(|state| state.has_bz2.as_ref()) - .and_then(|value| value.value(expiration_duration)) - .copied() - } else { - Some(false) - }; - let has_jlap = if options.jlap_enabled { - cache_state - .and_then(|state| state.has_jlap.as_ref()) - .and_then(|value| value.value(expiration_duration)) - .copied() - } else { - Some(false) - }; - - // Create a future to possibly refresh the zst state. - let zst_repodata_url = subdir_url.join(&format!("{filename}.zst")).unwrap(); - let bz2_repodata_url = subdir_url.join(&format!("{filename}.bz2")).unwrap(); - let jlap_repodata_url = subdir_url.join(jlap::JLAP_FILE_NAME).unwrap(); - - let zst_future = match has_zst { - Some(_) => { - // The last cached value was valid, so we simply copy that - ready(cache_state.and_then(|state| state.has_zst.clone())).left_future() - } - None => async { - Some(Expiring { - value: check_valid_download_target(&zst_repodata_url, client).await, - last_checked: chrono::Utc::now(), - }) - } - .right_future(), - }; - - // Create a future to determine if bz2 is available. We only check this if we - // dont already know that zst is available because if that's available we're - // going to use that anyway. - let bz2_future = if has_zst == Some(true) { - // If we already know that zst is available we simply copy the availability - // value from the last time we checked. - ready(cache_state.and_then(|state| state.has_zst.clone())).right_future() - } else { - // If the zst variant might not be available we need to check whether bz2 is - // available. - async { - match has_bz2 { - Some(_) => { - // The last cached value was value so we simply copy that. - cache_state.and_then(|state| state.has_bz2.clone()) - } - None => Some(Expiring { - value: check_valid_download_target(&bz2_repodata_url, client).await, - last_checked: chrono::Utc::now(), - }), - } - } - .left_future() - }; - - let jlap_future = match has_jlap { - Some(_) => { - // The last cached value is valid, so we simply copy that - ready(cache_state.and_then(|state| state.has_jlap.clone())).left_future() - } - None => async { - Some(Expiring { - value: check_valid_download_target(&jlap_repodata_url, client).await, - last_checked: chrono::Utc::now(), - }) - } - .right_future(), - }; - - // Await all futures so they happen concurrently. Note that a request might not - // actually happen if the cache is still valid. - let (has_zst, has_bz2, has_jlap) = futures::join!(zst_future, bz2_future, jlap_future); - - VariantAvailability { - has_zst, - has_bz2, - has_jlap, - } -} - -/// Performs a HEAD request on the given URL to see if it is available. -async fn check_valid_download_target( - url: &Url, - client: &reqwest_middleware::ClientWithMiddleware, -) -> bool { - tracing::debug!("checking availability of '{url}'"); - - if url.scheme() == "file" { - // If the url is a file url we can simply check if the file exists. - let path = url.to_file_path().unwrap(); - let exists = tokio_fs::metadata(path).await.is_ok(); - tracing::debug!( - "'{url}' seems to be {}", - if exists { "available" } else { "unavailable" } - ); - exists - } else { - // Otherwise, perform a HEAD request to determine whether the url seems valid. - match client.head(url.clone()).send().await { - Ok(response) => { - if response.status().is_success() { - tracing::debug!("'{url}' seems to be available"); - true - } else { - tracing::debug!("'{url}' seems to be unavailable"); - false - } - } - Err(e) => { - tracing::warn!( - "failed to perform HEAD request on '{url}': {e}. Assuming its unavailable.." - ); - false - } - } - } -} - -// Ensures that the URL contains a trailing slash. This is important for the -// [`Url::join`] function. -fn normalize_subdir_url(url: Url) -> Url { - let mut path = url.path(); - path = path.trim_end_matches('/'); - let mut url = url.clone(); - url.set_path(&format!("{path}/")); - url -} - -/// A value returned from [`validate_cached_state`] which indicates the state of -/// a repodata.json cache. -#[derive(Debug)] -enum ValidatedCacheState { - /// There is no cache, the cache could not be parsed, or the cache does not - /// reference the same request. We can completely ignore any cached - /// data. - InvalidOrMissing, - - /// The cache does not match the repodata.json file that is on disk. This - /// usually indicates that the repodata.json was modified without - /// updating the cache. - Mismatched(RepoDataState), - - /// The cache could be read and corresponds to the repodata.json file that - /// is on disk but the cached data is (partially) out of date. - OutOfDate(RepoDataState), - - /// The cache is up to date. - UpToDate(RepoDataState), -} - -/// Tries to determine if the cache state for the repodata.json for the given -/// `subdir_url` is considered to be up-to-date. -/// -/// This functions reads multiple files from the `cache_path`, it is left up to -/// the user to ensure that these files stay synchronized during the execution -/// of this function. -fn validate_cached_state( - cache_path: &Path, - subdir_url: &Url, - cache_key: &str, -) -> ValidatedCacheState { - let repo_data_json_path = cache_path.join(format!("{cache_key}.json")); - let cache_state_path = cache_path.join(format!("{cache_key}.info.json")); - - // Check if we have cached repodata.json file - let json_metadata = match std::fs::metadata(&repo_data_json_path) { - Err(e) if e.kind() == ErrorKind::NotFound => return ValidatedCacheState::InvalidOrMissing, - Err(e) => { - tracing::warn!( - "failed to get metadata of repodata.json file '{}': {e}. Ignoring cached files...", - repo_data_json_path.display() - ); - return ValidatedCacheState::InvalidOrMissing; - } - Ok(metadata) => metadata, - }; - - // Try to read the repodata state cache - let cache_state = match RepoDataState::from_path(&cache_state_path) { - Err(e) if e.kind() == ErrorKind::NotFound => { - // Ignore, the cache just doesnt exist - tracing::debug!("repodata cache state is missing. Ignoring cached files..."); - return ValidatedCacheState::InvalidOrMissing; - } - Err(e) => { - // An error occurred while reading the cached state. - tracing::warn!( - "invalid repodata cache state '{}': {e}. Ignoring cached files...", - cache_state_path.display() - ); - return ValidatedCacheState::InvalidOrMissing; - } - Ok(state) => state, - }; - - // Do the URLs match? - let cached_subdir_url = if cache_state.url.path().ends_with('/') { - cache_state.url.clone() - } else { - let path = cache_state.url.path(); - let (subdir_path, _) = path.rsplit_once('/').unwrap_or(("", path)); - let mut url = cache_state.url.clone(); - url.set_path(&format!("{subdir_path}/")); - url - }; - if &cached_subdir_url != subdir_url { - tracing::warn!( - "cache state refers to a different repodata.json url. Ignoring cached files..." - ); - return ValidatedCacheState::InvalidOrMissing; - } - - // Determine last modified date of the repodata.json file. - let cache_last_modified = match json_metadata.modified() { - Err(_) => { - tracing::warn!("could not determine last modified date of repodata.json file. Ignoring cached files..."); - return ValidatedCacheState::Mismatched(cache_state); - } - Ok(last_modified) => last_modified, - }; - - // Make sure that the repodata state cache refers to the repodata that exists on - // disk. - // - // Check the blake hash of the repodata.json file if we have a similar hash in - // the state. - if let Some(cached_hash) = cache_state.blake2_hash.as_ref() { - match compute_file_digest::(&repo_data_json_path) { - Err(e) => { - tracing::warn!( - "could not compute BLAKE2 hash of repodata.json file: {e}. Ignoring cached files..." - ); - return ValidatedCacheState::Mismatched(cache_state); - } - Ok(hash) => { - if &hash != cached_hash { - tracing::warn!( - "BLAKE2 hash of repodata.json does not match cache state. Ignoring cached files..." - ); - return ValidatedCacheState::InvalidOrMissing; - } - } - } - } else { - // The state cache records the size and last modified date of the original file. - // If those do not match, the repodata.json file has been modified. - if json_metadata.len() != cache_state.cache_size - || Some(cache_last_modified) != json_metadata.modified().ok() - { - tracing::warn!("repodata cache state mismatches the existing repodatajson file. Ignoring cached files..."); - return ValidatedCacheState::Mismatched(cache_state); - } - } - - // Determine the age of the cache - let cache_age = match SystemTime::now().duration_since(cache_last_modified) { - Ok(duration) => duration, - Err(e) => { - tracing::warn!("failed to determine cache age: {e}. Ignoring cached files..."); - return ValidatedCacheState::Mismatched(cache_state); - } - }; - - // Parse the cache control header, and determine if the cache is out of date or - // not. - if let Some(cache_control) = cache_state.cache_headers.cache_control.as_deref() { - match CacheControl::from_value(cache_control) { - None => { - tracing::warn!( - "could not parse cache_control from repodata cache state. Ignoring cached files..." - ); - return ValidatedCacheState::Mismatched(cache_state); - } - Some(CacheControl { - cachability: Some(Cachability::Public), - max_age: Some(duration), - .. - }) => { - if cache_age > duration { - tracing::debug!( - "Cache is {} old but can at most be {} old. Assuming out of date...", - humantime::format_duration(cache_age), - humantime::format_duration(duration), - ); - return ValidatedCacheState::OutOfDate(cache_state); - } - } - Some(_) => { - tracing::debug!( - "Unsupported cache-control value '{}'. Assuming out of date...", - cache_control - ); - return ValidatedCacheState::OutOfDate(cache_state); - } - } - } else { - tracing::warn!( - "previous cache state does not contain cache_control header. Assuming out of date..." - ); - return ValidatedCacheState::OutOfDate(cache_state); - } - - // Well then! If we get here, it means the cache must be up to date! - ValidatedCacheState::UpToDate(cache_state) -} - -#[cfg(test)] -mod test { - use std::{ - future::IntoFuture, - net::SocketAddr, - path::{Path, PathBuf}, - sync::{ - atomic::{AtomicUsize, Ordering}, - Arc, - }, - }; - - use assert_matches::assert_matches; - use axum::{ - body::Body, - extract::State, - http::{Request, StatusCode}, - middleware, - middleware::Next, - response::{IntoResponse, Response}, - routing::get, - Router, - }; - use bytes::Bytes; - use fs_err::tokio as tokio_fs; - use futures::{stream, StreamExt}; - use hex_literal::hex; - use rattler_networking::AuthenticationMiddleware; - use reqwest::Client; - use reqwest_middleware::{ClientBuilder, ClientWithMiddleware}; - use tempfile::TempDir; - use tokio::{io::AsyncWriteExt, sync::Mutex}; - use tokio_util::io::ReaderStream; - use url::Url; - - use super::{fetch_repo_data, CacheResult, CachedRepoData, FetchRepoDataOptions}; - use crate::{ - fetch::{FetchRepoDataError, RepoDataNotFoundError}, - utils::{simple_channel_server::SimpleChannelServer, Encoding}, - Reporter, - }; - - async fn write_encoded( - mut input: &[u8], - destination: &Path, - encoding: Encoding, - ) -> Result<(), std::io::Error> { - // Open the file for writing - let mut file = tokio_fs::File::create(destination).await.unwrap(); - - match encoding { - Encoding::Passthrough => { - tokio::io::copy(&mut input, &mut file).await?; - } - Encoding::GZip => { - let mut encoder = async_compression::tokio::write::GzipEncoder::new(file); - tokio::io::copy(&mut input, &mut encoder).await?; - encoder.shutdown().await?; - } - Encoding::Bz2 => { - let mut encoder = async_compression::tokio::write::BzEncoder::new(file); - tokio::io::copy(&mut input, &mut encoder).await?; - encoder.shutdown().await?; - } - Encoding::Zst => { - let mut encoder = async_compression::tokio::write::ZstdEncoder::new(file); - tokio::io::copy(&mut input, &mut encoder).await?; - encoder.shutdown().await?; - } - } - - Ok(()) - } - - #[test] - pub fn test_normalize_url() { - assert_eq!( - super::normalize_subdir_url(Url::parse("http://localhost/channels/empty").unwrap()), - Url::parse("http://localhost/channels/empty/").unwrap(), - ); - assert_eq!( - super::normalize_subdir_url(Url::parse("http://localhost/channels/empty/").unwrap()), - Url::parse("http://localhost/channels/empty/").unwrap(), - ); - } - - const FAKE_REPO_DATA: &str = r#"{ - "packages.conda": { - "asttokens-2.2.1-pyhd8ed1ab_0.conda": { - "arch": null, - "build": "pyhd8ed1ab_0", - "build_number": 0, - "build_string": "pyhd8ed1ab_0", - "constrains": [], - "depends": [ - "python >=3.5", - "six" - ], - "fn": "asttokens-2.2.1-pyhd8ed1ab_0.conda", - "license": "Apache-2.0", - "license_family": "Apache", - "md5": "bf7f54dd0f25c3f06ecb82a07341841a", - "name": "asttokens", - "noarch": "python", - "platform": null, - "sha256": "7ed530efddd47a96c11197906b4008405b90e3bc2f4e0df722a36e0e6103fd9c", - "size": 27831, - "subdir": "noarch", - "timestamp": 1670264089059, - "track_features": "", - "url": "https://conda.anaconda.org/conda-forge/noarch/asttokens-2.2.1-pyhd8ed1ab_0.conda", - "version": "2.2.1" - } - } - } - "#; - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_fetch_repo_data() { - // Create a directory with some repodata. - let subdir_path = TempDir::new().unwrap(); - std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the data from the channel with an empty cache. - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_eq!( - result.cache_state.blake2_hash.unwrap()[..], - hex!("a1861e448e4a62b88dce47c95351bfbe7fc22451a73f89a09d782492540e0675")[..] - ); - assert_eq!( - std::fs::read_to_string(result.repo_data_json_path).unwrap(), - FAKE_REPO_DATA - ); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_cache_works() { - // Create a directory with some repodata. - let subdir_path = TempDir::new().unwrap(); - std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the data from the channel with an empty cache. - let cache_dir = TempDir::new().unwrap(); - let CachedRepoData { cache_result, .. } = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.path().to_owned(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_matches!(cache_result, CacheResult::CacheNotPresent); - - // Download the data from the channel with a filled cache. - let CachedRepoData { cache_result, .. } = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.path().to_owned(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_matches!( - cache_result, - CacheResult::CacheHit | CacheResult::CacheHitAfterFetch - ); - - // I know this is terrible but without the sleep rust is too blazingly fast and - // the server doesnt think the file was actually updated.. This is - // because the time send by the server has seconds precision. - tokio::time::sleep(std::time::Duration::from_millis(1500)).await; - - // Update the original repodata.json file - std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); - - // Download the data from the channel with a filled cache. - let CachedRepoData { cache_result, .. } = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_matches!(cache_result, CacheResult::CacheOutdated); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_zst_works() { - let subdir_path = TempDir::new().unwrap(); - write_encoded( - FAKE_REPO_DATA.as_bytes(), - &subdir_path.path().join("repodata.json.zst"), - Encoding::Zst, - ) - .await - .unwrap(); - - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the data from the channel with an empty cache. - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_eq!( - std::fs::read_to_string(result.repo_data_json_path).unwrap(), - FAKE_REPO_DATA - ); - assert_matches!( - result.cache_state.has_zst, Some(super::Expiring { - value, .. - }) if value - ); - assert_matches!( - result.cache_state.has_bz2, Some(super::Expiring { - value, .. - }) if !value - ); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_bz2_works() { - let subdir_path = TempDir::new().unwrap(); - write_encoded( - FAKE_REPO_DATA.as_bytes(), - &subdir_path.path().join("repodata.json.bz2"), - Encoding::Bz2, - ) - .await - .unwrap(); - - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the data from the channel with an empty cache. - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_eq!( - std::fs::read_to_string(result.repo_data_json_path).unwrap(), - FAKE_REPO_DATA - ); - assert_matches!( - result.cache_state.has_zst, Some(super::Expiring { - value, .. - }) if !value - ); - assert_matches!( - result.cache_state.has_bz2, Some(super::Expiring { - value, .. - }) if value - ); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_zst_is_preferred() { - let subdir_path = TempDir::new().unwrap(); - write_encoded( - FAKE_REPO_DATA.as_bytes(), - &subdir_path.path().join("repodata.json.bz2"), - Encoding::Bz2, - ) - .await - .unwrap(); - write_encoded( - FAKE_REPO_DATA.as_bytes(), - &subdir_path.path().join("repodata.json.zst"), - Encoding::Zst, - ) - .await - .unwrap(); - - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the data from the channel with an empty cache. - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_eq!( - std::fs::read_to_string(result.repo_data_json_path).unwrap(), - FAKE_REPO_DATA - ); - assert!(result.cache_state.url.path().ends_with("repodata.json.zst")); - assert_matches!( - result.cache_state.has_zst, Some(super::Expiring { - value, .. - }) if value - ); - assert_matches!( - result.cache_state.has_bz2, Some(super::Expiring { - value, .. - }) if value - ); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_gzip_transfer_encoding() { - // Create a directory with some repodata. - let subdir_path = TempDir::new().unwrap(); - write_encoded( - FAKE_REPO_DATA.as_ref(), - &subdir_path.path().join("repodata.json.gz"), - Encoding::GZip, - ) - .await - .unwrap(); - - // The server is configured in such a way that if file `a` is requested but a - // file called `a.gz` is available it will stream the `a.gz` file and - // report that its a `gzip` encoded stream. - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the data from the channel - let cache_dir = TempDir::new().unwrap(); - - let client = Client::builder().no_gzip().build().unwrap(); - let authenticated_client = reqwest_middleware::ClientBuilder::new(client) - .with_arc(Arc::new( - AuthenticationMiddleware::from_env_and_defaults().unwrap(), - )) - .build(); - - let result = fetch_repo_data( - server.url(), - authenticated_client, - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await - .unwrap(); - - assert_eq!( - std::fs::read_to_string(result.repo_data_json_path).unwrap(), - FAKE_REPO_DATA - ); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_progress() { - // Create a directory with some repodata. - let subdir_path = TempDir::new().unwrap(); - std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); - let server = SimpleChannelServer::new(subdir_path.path()).await; - - struct BasicReporter { - last_download_progress: AtomicUsize, - } - - impl Reporter for BasicReporter { - fn on_download_progress( - &self, - _url: &Url, - _index: usize, - bytes_downloaded: usize, - total_bytes: Option, - ) { - self.last_download_progress - .store(bytes_downloaded, Ordering::SeqCst); - assert_eq!(total_bytes, Some(1110)); - } - } - - let reporter = Arc::new(BasicReporter { - last_download_progress: AtomicUsize::new(0), - }); - - // Download the data from the channel with an empty cache. - let cache_dir = TempDir::new().unwrap(); - let _result = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - Some(reporter.clone()), - ) - .await - .unwrap(); - - assert_eq!(reporter.last_download_progress.load(Ordering::SeqCst), 1110); - } - - #[tracing_test::traced_test] - #[tokio::test] - pub async fn test_repodata_not_found() { - // Create a directory with some repodata. - let subdir_path = TempDir::new().unwrap(); - // Don't add repodata to the channel. - - // Download the "data" from the local filebased channel. - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - Url::parse(format!("file://{}", subdir_path.path().to_str().unwrap()).as_str()) - .unwrap(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await; - - assert!(result.is_err()); - assert!(matches!( - result, - Err(FetchRepoDataError::NotFound( - RepoDataNotFoundError::FileSystemError(_) - )) - )); - - // Start a server to test the http error - let server = SimpleChannelServer::new(subdir_path.path()).await; - - // Download the "data" from the channel. - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - server.url(), - ClientWithMiddleware::from(Client::new()), - cache_dir.into_path(), - FetchRepoDataOptions::default(), - None, - ) - .await; - - assert!(result.is_err()); - assert!(matches!( - result, - Err(FetchRepoDataError::NotFound( - RepoDataNotFoundError::HttpError(_) - )) - )); - } - - #[tracing_test::traced_test] - #[tokio::test] - async fn test_flaky_package_cache() { - fn get_test_data_dir() -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../test-data") - } - - async fn redirect_to_prefix( - axum::extract::Path((file,)): axum::extract::Path<(String,)>, - ) -> impl IntoResponse { - let path = get_test_data_dir() - .join("channels/pytorch/linux-64/") - .join(file); - if !path.exists() { - return Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::empty()) - .unwrap(); - } - let file = tokio::fs::File::open(path).await.unwrap(); - let body = Body::from_stream(ReaderStream::new(file)); - Response::builder() - .status(StatusCode::OK) - .body(body) - .unwrap() - } - - /// A helper middleware function that fails the first two requests. - #[allow(clippy::type_complexity)] - async fn fail_with_half_package( - State((count, bytes)): State<(Arc>, Arc>)>, - req: Request, - next: Next, - ) -> Result { - let count = { - let mut count = count.lock().await; - *count += 1; - *count - }; - - println!("Running middleware for request #{count} for {}", req.uri()); - let response = next.run(req).await; - - if count < 2 { - println!("Cutting response body in half"); - let body = response.into_body(); - let mut body = body.into_data_stream(); - let mut buffer = Vec::new(); - while let Some(Ok(chunk)) = body.next().await { - buffer.extend(chunk); - } - - let byte_count = *bytes.lock().await; - let bytes = buffer.into_iter().take(byte_count).collect::>(); - // Create a stream that ends prematurely - let stream = stream::iter(vec![ - Ok(bytes.into_iter().collect::()), - Err(std::io::Error::new( - std::io::ErrorKind::Other, - "premature close", - )), - // The stream ends after sending partial data, simulating a premature close - ]); - let body = Body::from_stream(stream); - return Ok(Response::new(body)); - } - - Ok(response) - } - - let request_count = Arc::new(Mutex::new(0)); - let router = Router::new() - .route("/{file}", get(redirect_to_prefix)) - .layer(middleware::from_fn_with_state( - (request_count.clone(), Arc::new(Mutex::new(1024 * 1024))), - fail_with_half_package, - )); - - // Construct the server that will listen on localhost but with a *random port*. - // The random port is very important because it enables creating - // multiple instances at the same time. We need this to be able to run - // tests in parallel. - let addr = SocketAddr::new([127, 0, 0, 1].into(), 0); - let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); - let addr = listener.local_addr().unwrap(); - - let service = router.into_make_service(); - tokio::spawn(axum::serve(listener, service).into_future()); - - let server_url = Url::parse(&format!("http://localhost:{}", addr.port())).unwrap(); - - let client = ClientBuilder::new(Client::default()).build(); +/// Defines how to use the repodata cache. +#[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] +pub enum CacheAction { + /// Use the cache if its up to date or fetch from the URL if there is no + /// valid cached value. + #[default] + CacheOrFetch, - let cache_dir = TempDir::new().unwrap(); - let result = fetch_repo_data( - server_url, - client, - cache_dir.path().into(), - FetchRepoDataOptions { - bz2_enabled: false, - zstd_enabled: false, - jlap_enabled: false, - ..FetchRepoDataOptions::default() - }, - None, - ) - .await; + /// Only use the cache, but error out if the cache is not up to date + UseCacheOnly, - // Unwrap the result because at this point we should have a valid result. - result.unwrap(); + /// Only use the cache, ignore whether or not it is up to date. + ForceCacheOnly, - assert_eq!( - *request_count.lock().await, - 2, - "there must have been exactly two requests" - ); - } + /// Do not use the cache even if there is an up to date entry. + NoCache, } diff --git a/crates/rattler_repodata_gateway/src/fetch/no_cache.rs b/crates/rattler_repodata_gateway/src/fetch/no_cache.rs new file mode 100644 index 000000000..1f83f02e5 --- /dev/null +++ b/crates/rattler_repodata_gateway/src/fetch/no_cache.rs @@ -0,0 +1,323 @@ +//! Provides methods to download repodata from a given channel URL but does not +//! perform any form of caching. + +use bytes::Bytes; +use futures::TryStreamExt; +use rattler_networking::retry_policies::default_retry_policy; +use rattler_redaction::Redact; +use reqwest::{ + header::{HeaderMap, HeaderValue}, + Request, Response, StatusCode, +}; +use retry_policies::{RetryDecision, RetryPolicy}; +use std::{io::ErrorKind, sync::Arc}; +use tokio::io::AsyncReadExt; +use tokio_util::io::StreamReader; +use tracing::{instrument, Level}; +use url::Url; + +#[cfg(target_arch = "wasm32")] +use wasmtimer::std::SystemTime; + +#[cfg(not(target_arch = "wasm32"))] +use std::time::SystemTime; + +use crate::{ + fetch::{FetchRepoDataError, RepoDataNotFoundError, Variant}, + reporter::ResponseReporterExt, + utils::{AsyncEncoding, Encoding}, + Reporter, +}; + +/// Additional knobs that allow you to tweak the behavior of +/// [`fetch_repo_data`]. +#[derive(Clone)] +pub struct FetchRepoDataOptions { + /// Determines which variant to download. See [`Variant`] for more + /// information. + pub variant: Variant, + + /// When enabled, the zstd variant will be used if available + pub zstd_enabled: bool, + + /// When enabled, the bz2 variant will be used if available + pub bz2_enabled: bool, + + /// Retry policy to use when streaming the response is interrupted. If this + /// is `None` the default retry policy is used. + pub retry_policy: Option>, +} + +impl Default for FetchRepoDataOptions { + fn default() -> Self { + Self { + variant: Variant::default(), + zstd_enabled: true, + bz2_enabled: true, + retry_policy: None, + } + } +} + +#[derive(Debug, Copy, Clone)] +enum Compression { + Zst, + Bz2, + None, +} + +impl From for Encoding { + fn from(value: Compression) -> Self { + match value { + Compression::Zst => Encoding::Zst, + Compression::Bz2 => Encoding::Bz2, + Compression::None => Encoding::Passthrough, + } + } +} + +/// Try to execute a request for a certain kind of repodata with a given +/// compression. +async fn execute_request( + subdir_url: Url, + variant: Variant, + method: Compression, + client: reqwest_middleware::ClientWithMiddleware, +) -> Result<(Request, Response, SystemTime), reqwest_middleware::Error> { + // Determine the URL of the repodata file based on the compression and the + // variant + let file_name = variant.file_name(); + let repo_data_url = match method { + Compression::Zst => subdir_url.join(&format!("{file_name}.zst")), + Compression::Bz2 => subdir_url.join(&format!("{file_name}.bz2")), + Compression::None => subdir_url.join(variant.file_name()), + } + .expect("must be valid url at this point"); + + // Construct a request + let request_builder = client.get(repo_data_url.clone()); + + let mut headers = HeaderMap::default(); + + // We can handle g-zip encoding which is often used. We could also set this + // option on the client, but that will disable all download progress + // messages by `reqwest` because the gzipped data is decoded on the fly and + // the size of the decompressed body is unknown. However, we don't really + // care about the decompressed size but rather we'd like to know the number + // of raw bytes that are actually downloaded. + // + // To do this we manually set the request header to accept gzip encoding and we + // use the [`AsyncEncoding`] trait to perform the decoding on the fly. + headers.insert( + reqwest::header::ACCEPT_ENCODING, + HeaderValue::from_static("gzip"), + ); + + let request = request_builder + .headers(headers) + .build() + .expect("must have a valid request at this point"); + + let request_start_time = SystemTime::now(); + let response = client + .execute(request.try_clone().expect("cloning request cannot fail")) + .await?; + + Ok((request, response, request_start_time)) +} + +/// Execute a request with the best compression method available. Returns the +/// request and the response. +async fn execute_with_best_compression( + subdir_url: &Url, + options: &FetchRepoDataOptions, + client: reqwest_middleware::ClientWithMiddleware, +) -> Result<(Request, Response, SystemTime, Compression), FetchRepoDataError> { + // Try with supported compression methods. + for compression in [ + options.zstd_enabled.then_some(Compression::Zst), + options.bz2_enabled.then_some(Compression::Bz2), + ] + .into_iter() + .flatten() + { + let (request, response, request_time) = execute_request( + subdir_url.clone(), + options.variant, + compression, + client.clone(), + ) + .await?; + if response.status() == StatusCode::NOT_FOUND { + continue; + } + return Ok(( + request, + response.error_for_status()?, + request_time, + compression, + )); + } + + // If none of the compressed variants are available, try the uncompressed one. + let (request, response, request_time) = execute_request( + subdir_url.clone(), + options.variant, + Compression::None, + client.clone(), + ) + .await?; + if response.status() == StatusCode::NOT_FOUND { + Err(FetchRepoDataError::NotFound( + RepoDataNotFoundError::HttpError(response.error_for_status().unwrap_err()), + )) + } else { + Ok(( + request, + response.error_for_status()?, + request_time, + Compression::None, + )) + } +} + +/// Fetch the repodata.json file for the given subdirectory. +/// +/// The successful result of this function returns the bytes of the uncompressed +/// repodata.json. +/// +/// This method implements several different methods to download the +/// repodata.json file from the remote: +/// +/// * If a `repodata.json.zst` file is available in the same directory that file +/// is downloaded and decompressed. +/// * If a `repodata.json.bz2` file is available in the same directory that file +/// is downloaded and decompressed. +/// * Otherwise the regular `repodata.json` file is downloaded. +/// +/// Nothing is cached by this function. + +#[instrument(err(level = Level::INFO), skip_all, fields(subdir_url))] +pub async fn fetch_repo_data( + subdir_url: Url, + client: reqwest_middleware::ClientWithMiddleware, + options: FetchRepoDataOptions, + reporter: Option>, +) -> Result { + // Try to download the repodata with the best compression method available. + let (request, response, request_time, compression) = + execute_with_best_compression(&subdir_url, &options, client.clone()).await?; + + // Notify that a request has started + let repo_data_url = request.url().clone(); + let download_reporter = reporter + .as_deref() + .map(|r| (r, r.on_download_start(&repo_data_url))); + + // Construct a retry behavior + let default_retry_behavior = default_retry_policy(); + let retry_behavior = options + .retry_policy + .as_deref() + .unwrap_or(&default_retry_behavior); + + let mut retry_count = 0; + let mut response = Some(response); + let (bytes, response_url) = loop { + // Either execute the request and get the response or use the response from a + // previous execution. + let (response, request_start_time) = match response.take() { + None => { + let start_time = SystemTime::now(); + let response = client + .execute(request.try_clone().expect("cloning request cannot fail")) + .await? + .error_for_status()?; + (response, start_time) + } + Some(response) => (response, request_time), + }; + + // Stream the response the bytes and decode them on the fly. + let (download_url, stream_error) = + match stream_response_body(response, compression, download_reporter).await { + Ok(bytes) => break (bytes, repo_data_url), + Err(FetchRepoDataError::FailedToDownload(url, err)) => (url, err), + Err(e) => { + return Err(e); + } + }; + + let since_epoch = request_start_time.elapsed().unwrap(); + + // Check if we can retry + let execute_after = match retry_behavior.should_retry( + std::time::SystemTime::UNIX_EPOCH + .checked_add(since_epoch) + .unwrap(), + retry_count, + ) { + RetryDecision::Retry { execute_after } => SystemTime::UNIX_EPOCH + .checked_add(execute_after.elapsed().unwrap()) + .unwrap(), + RetryDecision::DoNotRetry => { + return Err(FetchRepoDataError::FailedToDownload( + download_url, + stream_error, + )) + } + }; + + // Determine how long to sleep for + let sleep_duration = execute_after + .duration_since(SystemTime::now()) + .unwrap_or_default(); + + #[cfg(not(target_arch = "wasm32"))] + tokio::time::sleep(sleep_duration).await; + #[cfg(target_arch = "wasm32")] + wasmtimer::tokio::sleep(sleep_duration).await; + + retry_count += 1; + }; + + if let Some((reporter, index)) = download_reporter { + reporter.on_download_complete(&response_url, index); + } + + Ok(bytes) +} + +async fn stream_response_body( + response: Response, + compression: Compression, + reporter: Option<(&dyn Reporter, usize)>, +) -> Result { + let response_url = response.url().clone().redact(); + let encoding = Encoding::from(&response); + + let mut total_bytes = 0; + let bytes_stream = response + .byte_stream_with_progress(reporter) + .inspect_ok(|bytes| { + total_bytes += bytes.len(); + }) + .map_err(|e| std::io::Error::new(ErrorKind::Interrupted, e)); + + // Create a new stream from the byte stream that decodes the bytes using the + // transfer encoding on the fly. + let decoded_byte_stream = StreamReader::new(bytes_stream).decode(encoding); + + // Create yet another stream that decodes the bytes yet again but this time + // using the content encoding. + let mut decoded_repo_data_json_bytes = + tokio::io::BufReader::new(decoded_byte_stream).decode(compression.into()); + + let mut bytes = Vec::new(); + decoded_repo_data_json_bytes + .read_to_end(&mut bytes) + .await + .map_err(|e| FetchRepoDataError::FailedToDownload(response_url, e))?; + + Ok(Bytes::from(bytes)) +} diff --git a/crates/rattler_repodata_gateway/src/fetch/with_cache.rs b/crates/rattler_repodata_gateway/src/fetch/with_cache.rs new file mode 100644 index 000000000..154e40b78 --- /dev/null +++ b/crates/rattler_repodata_gateway/src/fetch/with_cache.rs @@ -0,0 +1,1571 @@ +use std::{ + io::ErrorKind, + path::{Path, PathBuf}, + sync::Arc, + time::{Duration, SystemTime}, +}; + +use cache_control::{Cachability, CacheControl}; +use futures::{future::ready, FutureExt, TryStreamExt}; +use humansize::{SizeFormatter, DECIMAL}; +use rattler_digest::{compute_file_digest, Blake2b256, HashingWriter}; +use rattler_networking::retry_policies::default_retry_policy; +use rattler_redaction::Redact; +use reqwest::{ + header::{HeaderMap, HeaderValue}, + Response, StatusCode, +}; +use retry_policies::{RetryDecision, RetryPolicy}; +use tempfile::NamedTempFile; +use tokio_util::io::StreamReader; +use tracing::{instrument, Level}; +use url::Url; + +use crate::{ + fetch::{ + cache::{CacheHeaders, Expiring, RepoDataState}, + jlap, CacheAction, FetchRepoDataError, RepoDataNotFoundError, Variant, + }, + reporter::ResponseReporterExt, + utils::{AsyncEncoding, Encoding, LockedFile}, + Reporter, +}; + +/// Additional knobs that allow you to tweak the behavior of +/// [`fetch_repo_data`]. +#[derive(Clone)] +pub struct FetchRepoDataOptions { + /// How to use the cache. By default it will cache and reuse downloaded + /// repodata.json (if the server allows it). + pub cache_action: CacheAction, + + /// Determines which variant to download. See [`Variant`] for more + /// information. + pub variant: Variant, + + /// When enabled repodata can be fetched incrementally using JLAP + pub jlap_enabled: bool, + + /// When enabled, the zstd variant will be used if available + pub zstd_enabled: bool, + + /// When enabled, the bz2 variant will be used if available + pub bz2_enabled: bool, + + /// Retry policy to use when streaming the response is interrupted. If this + /// is `None` the default retry policy is used. + pub retry_policy: Option>, +} + +impl Default for FetchRepoDataOptions { + fn default() -> Self { + Self { + cache_action: CacheAction::default(), + variant: Variant::default(), + jlap_enabled: true, + zstd_enabled: true, + bz2_enabled: true, + retry_policy: None, + } + } +} + +/// The result of [`fetch_repo_data`]. +#[derive(Debug)] +pub struct CachedRepoData { + /// A lockfile that guards access to any of the repodata.json file or its + /// cache. + pub lock_file: LockedFile, + + /// The path to the uncompressed repodata.json file. + pub repo_data_json_path: PathBuf, + + /// The cache data. + pub cache_state: RepoDataState, + + /// How the cache was used for this request. + pub cache_result: CacheResult, +} + +/// Indicates whether or not the repodata.json cache was up-to-date or not. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CacheResult { + /// The cache was hit, the data on disk was already valid. + CacheHit, + + /// The cache was hit, we did have to check with the server, but no data was + /// downloaded. + CacheHitAfterFetch, + + /// The cache was present but it was outdated. + CacheOutdated, + + /// There was no cache available + CacheNotPresent, +} + +/// handle file:/// urls +async fn repodata_from_file( + subdir_url: Url, + out_path: PathBuf, + cache_state_path: PathBuf, + lock_file: LockedFile, +) -> Result { + // copy file from subdir_url to out_path + if let Err(e) = fs_err::tokio::copy(&subdir_url.to_file_path().unwrap(), &out_path).await { + return if e.kind() == ErrorKind::NotFound { + Err(FetchRepoDataError::NotFound( + RepoDataNotFoundError::FileSystemError(e), + )) + } else { + Err(FetchRepoDataError::IoError(e)) + }; + } + + // create a dummy cache state + let new_cache_state = RepoDataState { + url: subdir_url.clone(), + cache_size: fs_err::tokio::metadata(&out_path) + .await + .map_err(FetchRepoDataError::IoError)? + .len(), + cache_headers: CacheHeaders { + etag: None, + last_modified: None, + cache_control: None, + }, + cache_last_modified: SystemTime::now(), + blake2_hash: None, + blake2_hash_nominal: None, + has_zst: None, + has_bz2: None, + has_jlap: None, + jlap: None, + }; + + // write the cache state + let new_cache_state = tokio::task::spawn_blocking(move || { + new_cache_state + .to_path(&cache_state_path) + .map(|_| new_cache_state) + .map_err(FetchRepoDataError::FailedToWriteCacheState) + }) + .await??; + + Ok(CachedRepoData { + lock_file, + repo_data_json_path: out_path.clone(), + cache_state: new_cache_state, + cache_result: CacheResult::CacheHit, + }) +} + +/// Fetch the repodata.json file for the given subdirectory. The result is +/// cached on disk using the HTTP cache headers returned from the server. +/// +/// The successful result of this function also returns a lockfile which ensures +/// that both the state and the repodata that is pointed to remain in sync. +/// However, not releasing the lockfile (by dropping it) could block other +/// threads and processes, it is therefore advisable to release it as quickly as +/// possible. +/// +/// This method implements several different methods to download the +/// repodata.json file from the remote: +/// +/// * If a `repodata.json.zst` file is available in the same directory that file +/// is downloaded and decompressed. +/// * If a `repodata.json.bz2` file is available in the same directory that file +/// is downloaded and decompressed. +/// * Otherwise the regular `repodata.json` file is downloaded. +/// +/// The checks to see if a `.zst` and/or `.bz2` file exist are performed by +/// doing a HEAD request to the respective URLs. The result of these are cached. +#[instrument(err(level = Level::INFO), skip_all, fields(subdir_url, cache_path = % cache_path.display()))] +pub async fn fetch_repo_data( + subdir_url: Url, + client: reqwest_middleware::ClientWithMiddleware, + cache_path: PathBuf, + options: FetchRepoDataOptions, + reporter: Option>, +) -> Result { + let subdir_url = normalize_subdir_url(subdir_url); + + // Compute the cache key from the url + let cache_key = crate::utils::url_to_cache_filename( + &subdir_url + .join(options.variant.file_name()) + .expect("file name is valid"), + ); + let repo_data_json_path = cache_path.join(format!("{cache_key}.json")); + let cache_state_path = cache_path.join(format!("{cache_key}.info.json")); + + // Lock all files that have to do with that cache key + let lock_file_path = cache_path.join(format!("{}.lock", &cache_key)); + let lock_file = + tokio::task::spawn_blocking(move || LockedFile::open_rw(lock_file_path, "repodata cache")) + .await? + .map_err(FetchRepoDataError::FailedToAcquireLock)?; + + let cache_action = if subdir_url.scheme() == "file" { + // If we are dealing with a local file, we can skip the cache entirely. + return repodata_from_file( + subdir_url.join(options.variant.file_name()).unwrap(), + repo_data_json_path, + cache_state_path, + lock_file, + ) + .await; + } else { + options.cache_action + }; + + // Validate the current state of the cache + let cache_state = if cache_action == CacheAction::NoCache { + None + } else { + let owned_subdir_url = subdir_url.clone(); + let owned_cache_path = cache_path.clone(); + let owned_cache_key = cache_key.clone(); + let cache_state = tokio::task::spawn_blocking(move || { + validate_cached_state(&owned_cache_path, &owned_subdir_url, &owned_cache_key) + }) + .await?; + match (cache_state, options.cache_action) { + (ValidatedCacheState::UpToDate(cache_state), _) + | (ValidatedCacheState::OutOfDate(cache_state), CacheAction::ForceCacheOnly) => { + // Cache is up to date or we dont care about whether or not its up to date, + // so just immediately return what we have. + return Ok(CachedRepoData { + lock_file, + repo_data_json_path, + cache_state, + cache_result: CacheResult::CacheHit, + }); + } + (ValidatedCacheState::OutOfDate(_), CacheAction::UseCacheOnly) + | ( + ValidatedCacheState::Mismatched(_) | ValidatedCacheState::InvalidOrMissing, + CacheAction::UseCacheOnly | CacheAction::ForceCacheOnly, + ) => { + // The cache is out of date but we also cant fetch new data + // OR, The cache doesn't match the repodata.json that is on disk. This means the + // cache is not usable. + // OR, No cache available at all, and we cant refresh the data. + return Err(FetchRepoDataError::NoCacheAvailable); + } + ( + ValidatedCacheState::OutOfDate(cache_state) + | ValidatedCacheState::Mismatched(cache_state), + _, + ) => { + // The cache is out of date but we can still refresh the data + // OR, The cache doesn't match the data that is on disk. but it might contain + // some other interesting cached data as well... + Some(cache_state) + } + (ValidatedCacheState::InvalidOrMissing, _) => { + // No cache available but we can update it! + None + } + } + }; + + // Determine the availability of variants based on the cache or by querying the + // remote. + let variant_availability = check_variant_availability( + &client, + &subdir_url, + cache_state.as_ref(), + options.variant.file_name(), + &options, + ) + .await; + + // Now that the caches have been refreshed determine whether or not we can use + // one of the variants. We don't check the expiration here since we just + // refreshed it. + let has_zst = options.zstd_enabled && variant_availability.has_zst(); + let has_bz2 = options.bz2_enabled && variant_availability.has_bz2(); + let has_jlap = options.jlap_enabled && variant_availability.has_jlap(); + + // We first attempt to make a JLAP request; if it fails for any reason, we + // continue on with a normal request. + let jlap_state = if has_jlap && cache_state.is_some() { + let repo_data_state = cache_state.as_ref().unwrap(); + match jlap::patch_repo_data( + &client, + subdir_url.clone(), + repo_data_state.clone(), + &repo_data_json_path, + reporter.clone(), + ) + .await + { + Ok((state, disk_hash)) => { + tracing::info!("fetched JLAP patches successfully"); + let cache_state = RepoDataState { + blake2_hash: Some(disk_hash), + blake2_hash_nominal: Some(state.footer.latest), + has_zst: variant_availability.has_zst, + has_bz2: variant_availability.has_bz2, + has_jlap: variant_availability.has_jlap, + jlap: Some(state), + ..cache_state.expect("we must have had a cache, otherwise we wouldn't know the previous state of the cache") + }; + + let cache_state = tokio::task::spawn_blocking(move || { + cache_state + .to_path(&cache_state_path) + .map(|_| cache_state) + .map_err(FetchRepoDataError::FailedToWriteCacheState) + }) + .await??; + + return Ok(CachedRepoData { + lock_file, + repo_data_json_path, + cache_state, + cache_result: CacheResult::CacheOutdated, + }); + } + Err(error) => { + tracing::warn!("Error during JLAP request: {}", error); + None + } + } + } else { + None + }; + + // Determine which variant to download + let repo_data_url = if has_zst { + subdir_url + .join(&format!("{}.zst", options.variant.file_name())) + .unwrap() + } else if has_bz2 { + subdir_url + .join(&format!("{}.bz2", options.variant.file_name())) + .unwrap() + } else { + subdir_url.join(options.variant.file_name()).unwrap() + }; + + // Construct the HTTP request + tracing::debug!("fetching '{}'", &repo_data_url); + let request_builder = client.get(repo_data_url.clone()); + + let mut headers = HeaderMap::default(); + + // We can handle g-zip encoding which is often used. We could also set this + // option on the client, but that will disable all download progress + // messages by `reqwest` because the gzipped data is decoded on the fly and + // the size of the decompressed body is unknown. However, we don't really + // care about the decompressed size but rather we'd like to know the number + // of raw bytes that are actually downloaded. + // + // To do this we manually set the request header to accept gzip encoding and we + // use the [`AsyncEncoding`] trait to perform the decoding on the fly. + headers.insert( + reqwest::header::ACCEPT_ENCODING, + HeaderValue::from_static("gzip"), + ); + + // Add previous cache headers if we have them + if let Some(cache_headers) = cache_state.as_ref().map(|state| &state.cache_headers) { + cache_headers.add_to_request(&mut headers); + } + // Send the request and wait for a reply + let download_reporter = reporter + .as_deref() + .map(|r| (r, r.on_download_start(&repo_data_url))); + + let (client, request) = request_builder.headers(headers).build_split(); + let request = request.expect("must have a valid request at this point"); + let default_retry_behavior = default_retry_policy(); + let retry_behavior = options + .retry_policy + .as_deref() + .unwrap_or(&default_retry_behavior); + let mut retry_count = 0; + let (temp_file, blake2_hash, response_url, cache_headers) = loop { + let request_start_time = SystemTime::now(); + let response = match client.execute(request.try_clone().unwrap()).await { + Ok(response) if response.status() == StatusCode::NOT_FOUND => { + return Err(FetchRepoDataError::NotFound(RepoDataNotFoundError::from( + response.error_for_status().unwrap_err(), + ))); + } + Ok(response) => response.error_for_status()?, + Err(e) => { + return Err(FetchRepoDataError::from(e)); + } + }; + + // If the content didn't change, simply return whatever we have on disk. + if response.status() == StatusCode::NOT_MODIFIED { + tracing::debug!("repodata was unmodified"); + + // Update the cache on disk with any new findings. + let cache_state = RepoDataState { + url: repo_data_url, + has_zst: variant_availability.has_zst, + has_bz2: variant_availability.has_bz2, + has_jlap: variant_availability.has_jlap, + jlap: jlap_state, + ..cache_state.expect("we must have had a cache, otherwise we wouldn't know the previous state of the cache") + }; + + let cache_state = tokio::task::spawn_blocking(move || { + cache_state + .to_path(&cache_state_path) + .map(|_| cache_state) + .map_err(FetchRepoDataError::FailedToWriteCacheState) + }) + .await??; + + return Ok(CachedRepoData { + lock_file, + repo_data_json_path, + cache_state, + cache_result: CacheResult::CacheHitAfterFetch, + }); + } + + // Get cache headers from the response + let cache_headers = CacheHeaders::from(&response); + + // Stream the content to a temporary file + let response_url = response.url().clone(); + let stream_result = stream_and_decode_to_file( + repo_data_url.clone(), + response, + if has_zst { + Encoding::Zst + } else if has_bz2 { + Encoding::Bz2 + } else { + Encoding::Passthrough + }, + &cache_path, + download_reporter, + ) + .await; + + match stream_result { + Ok((file, hash)) => break (file, hash, response_url, cache_headers), + Err(FetchRepoDataError::FailedToDownload(url, err)) => { + let execute_after = + match retry_behavior.should_retry(request_start_time, retry_count) { + RetryDecision::Retry { execute_after } => execute_after, + RetryDecision::DoNotRetry => { + return Err(FetchRepoDataError::FailedToDownload(url, err)) + } + }; + let duration = execute_after + .duration_since(SystemTime::now()) + .unwrap_or(Duration::ZERO); + + // Wait for a second to let the remote service restore itself. This increases + // the chance of success. + tracing::warn!( + "failed to download repodata from {}: {}. Retry #{}, Sleeping {:?} until the next attempt...", + &url, + err, + retry_count, + duration + ); + tokio::time::sleep(duration).await; + } + Err(e) => return Err(e), + } + + retry_count += 1; + }; + + if let Some((reporter, index)) = download_reporter { + reporter.on_download_complete(&response_url, index); + } + + // Persist the file to its final destination + let repo_data_destination_path = repo_data_json_path.clone(); + let repo_data_json_metadata = tokio::task::spawn_blocking(move || { + let file = temp_file + .persist(repo_data_destination_path) + .map_err(FetchRepoDataError::FailedToPersistTemporaryFile)?; + + // Determine the last modified date and size of the repodata.json file. We store + // these values in the cache to link the cache to the corresponding + // repodata.json file. + file.metadata() + .map_err(FetchRepoDataError::FailedToGetMetadata) + }) + .await??; + + // Update the cache on disk. + let had_cache = cache_state.is_some(); + let new_cache_state = RepoDataState { + url: repo_data_url, + cache_headers, + cache_last_modified: repo_data_json_metadata + .modified() + .map_err(FetchRepoDataError::FailedToGetMetadata)?, + cache_size: repo_data_json_metadata.len(), + blake2_hash: Some(blake2_hash), + blake2_hash_nominal: Some(blake2_hash), + has_zst: variant_availability.has_zst, + has_bz2: variant_availability.has_bz2, + has_jlap: variant_availability.has_jlap, + jlap: jlap_state, + }; + + let new_cache_state = tokio::task::spawn_blocking(move || { + new_cache_state + .to_path(&cache_state_path) + .map(|_| new_cache_state) + .map_err(FetchRepoDataError::FailedToWriteCacheState) + }) + .await??; + + Ok(CachedRepoData { + lock_file, + repo_data_json_path, + cache_state: new_cache_state, + cache_result: if had_cache { + CacheResult::CacheOutdated + } else { + CacheResult::CacheNotPresent + }, + }) +} + +/// Streams and decodes the response to a new temporary file in the given +/// directory. While writing to disk it also computes the BLAKE2 hash of the +/// file. +#[instrument(skip_all)] +async fn stream_and_decode_to_file( + url: Url, + response: Response, + content_encoding: Encoding, + temp_dir: &Path, + reporter: Option<(&dyn Reporter, usize)>, +) -> Result<(NamedTempFile, blake2::digest::Output), FetchRepoDataError> { + // Determine the encoding of the response + let transfer_encoding = Encoding::from(&response); + + // Convert the response into a byte stream + let mut total_bytes = 0; + let bytes_stream = response + .byte_stream_with_progress(reporter) + .inspect_ok(|bytes| { + total_bytes += bytes.len(); + }) + .map_err(|e| std::io::Error::new(ErrorKind::Other, e)); + + // Create a new stream from the byte stream that decodes the bytes using the + // transfer encoding on the fly. + let decoded_byte_stream = StreamReader::new(bytes_stream).decode(transfer_encoding); + + // Create yet another stream that decodes the bytes yet again but this time + // using the content encoding. + let mut decoded_repo_data_json_bytes = + tokio::io::BufReader::new(decoded_byte_stream).decode(content_encoding); + + tracing::trace!( + "decoding repodata (content: {:?}, transfer: {:?})", + content_encoding, + transfer_encoding + ); + + // Construct a temporary file + let temp_file = + NamedTempFile::new_in(temp_dir).map_err(FetchRepoDataError::FailedToCreateTemporaryFile)?; + + // Clone the file handle and create a hashing writer so we can compute a hash + // while the content is being written to disk. + let file = fs_err::tokio::File::from_std(fs_err::File::from_parts( + temp_file + .as_file() + .try_clone() + .map_err(FetchRepoDataError::IoError)?, + temp_file.path(), + )); + let mut hashing_file_writer = HashingWriter::<_, Blake2b256>::new(file); + + // Decode, hash and write the data to the file. + let bytes = tokio::io::copy(&mut decoded_repo_data_json_bytes, &mut hashing_file_writer) + .await + .map_err(|e| FetchRepoDataError::FailedToDownload(url.redact(), e))?; + + // Finalize the hash + let (_, hash) = hashing_file_writer.finalize(); + + tracing::debug!( + "downloaded {}, decoded that into {}, BLAKE2 hash: {:x}", + SizeFormatter::new(total_bytes, DECIMAL), + SizeFormatter::new(bytes, DECIMAL), + hash + ); + + Ok((temp_file, hash)) +} + +/// Describes the availability of certain `repodata.json`. +#[derive(Debug)] +pub struct VariantAvailability { + has_zst: Option>, + has_bz2: Option>, + has_jlap: Option>, +} + +impl VariantAvailability { + /// Returns true if there is a Zst variant available, regardless of when it + /// was checked + pub fn has_zst(&self) -> bool { + self.has_zst.as_ref().is_some_and(|state| state.value) + } + + /// Returns true if there is a Bz2 variant available, regardless of when it + /// was checked + pub fn has_bz2(&self) -> bool { + self.has_bz2.as_ref().is_some_and(|state| state.value) + } + + /// Returns true if there is a JLAP variant available, regardless of when it + /// was checked + pub fn has_jlap(&self) -> bool { + self.has_jlap.as_ref().is_some_and(|state| state.value) + } +} + +/// Determine the availability of `repodata.json` variants (like a `.zst` or +/// `.bz2`) by checking a cache or the internet. +pub async fn check_variant_availability( + client: &reqwest_middleware::ClientWithMiddleware, + subdir_url: &Url, + cache_state: Option<&RepoDataState>, + filename: &str, + options: &FetchRepoDataOptions, +) -> VariantAvailability { + // Determine from the cache which variant are available. This is currently + // cached for a maximum of 14 days. + let expiration_duration = chrono::TimeDelta::try_days(14).expect("14 days is a valid duration"); + let has_zst = if options.zstd_enabled { + cache_state + .and_then(|state| state.has_zst.as_ref()) + .and_then(|value| value.value(expiration_duration)) + .copied() + } else { + Some(false) + }; + let has_bz2 = if options.bz2_enabled { + cache_state + .and_then(|state| state.has_bz2.as_ref()) + .and_then(|value| value.value(expiration_duration)) + .copied() + } else { + Some(false) + }; + let has_jlap = if options.jlap_enabled { + cache_state + .and_then(|state| state.has_jlap.as_ref()) + .and_then(|value| value.value(expiration_duration)) + .copied() + } else { + Some(false) + }; + + // Create a future to possibly refresh the zst state. + let zst_repodata_url = subdir_url.join(&format!("{filename}.zst")).unwrap(); + let bz2_repodata_url = subdir_url.join(&format!("{filename}.bz2")).unwrap(); + let jlap_repodata_url = subdir_url.join(jlap::JLAP_FILE_NAME).unwrap(); + + let zst_future = match has_zst { + Some(_) => { + // The last cached value was valid, so we simply copy that + ready(cache_state.and_then(|state| state.has_zst.clone())).left_future() + } + None => async { + Some(Expiring { + value: check_valid_download_target(&zst_repodata_url, client).await, + last_checked: chrono::Utc::now(), + }) + } + .right_future(), + }; + + // Create a future to determine if bz2 is available. We only check this if we + // dont already know that zst is available because if that's available we're + // going to use that anyway. + let bz2_future = if has_zst == Some(true) { + // If we already know that zst is available we simply copy the availability + // value from the last time we checked. + ready(cache_state.and_then(|state| state.has_zst.clone())).right_future() + } else { + // If the zst variant might not be available we need to check whether bz2 is + // available. + async { + match has_bz2 { + Some(_) => { + // The last cached value was value so we simply copy that. + cache_state.and_then(|state| state.has_bz2.clone()) + } + None => Some(Expiring { + value: check_valid_download_target(&bz2_repodata_url, client).await, + last_checked: chrono::Utc::now(), + }), + } + } + .left_future() + }; + + let jlap_future = match has_jlap { + Some(_) => { + // The last cached value is valid, so we simply copy that + ready(cache_state.and_then(|state| state.has_jlap.clone())).left_future() + } + None => async { + Some(Expiring { + value: check_valid_download_target(&jlap_repodata_url, client).await, + last_checked: chrono::Utc::now(), + }) + } + .right_future(), + }; + + // Await all futures so they happen concurrently. Note that a request might not + // actually happen if the cache is still valid. + let (has_zst, has_bz2, has_jlap) = futures::join!(zst_future, bz2_future, jlap_future); + + VariantAvailability { + has_zst, + has_bz2, + has_jlap, + } +} + +/// Performs a HEAD request on the given URL to see if it is available. +async fn check_valid_download_target( + url: &Url, + client: &reqwest_middleware::ClientWithMiddleware, +) -> bool { + tracing::debug!("checking availability of '{url}'"); + + if url.scheme() == "file" { + // If the url is a file url we can simply check if the file exists. + let path = url.to_file_path().unwrap(); + let exists = fs_err::tokio::metadata(path).await.is_ok(); + tracing::debug!( + "'{url}' seems to be {}", + if exists { "available" } else { "unavailable" } + ); + exists + } else { + // Otherwise, perform a HEAD request to determine whether the url seems valid. + match client.head(url.clone()).send().await { + Ok(response) => { + if response.status().is_success() { + tracing::debug!("'{url}' seems to be available"); + true + } else { + tracing::debug!("'{url}' seems to be unavailable"); + false + } + } + Err(e) => { + tracing::warn!( + "failed to perform HEAD request on '{url}': {e}. Assuming its unavailable.." + ); + false + } + } + } +} + +// Ensures that the URL contains a trailing slash. This is important for the +// [`Url::join`] function. +fn normalize_subdir_url(url: Url) -> Url { + let mut path = url.path(); + path = path.trim_end_matches('/'); + let mut url = url.clone(); + url.set_path(&format!("{path}/")); + url +} + +/// A value returned from [`validate_cached_state`] which indicates the state of +/// a repodata.json cache. +#[derive(Debug)] +enum ValidatedCacheState { + /// There is no cache, the cache could not be parsed, or the cache does not + /// reference the same request. We can completely ignore any cached + /// data. + InvalidOrMissing, + + /// The cache does not match the repodata.json file that is on disk. This + /// usually indicates that the repodata.json was modified without + /// updating the cache. + Mismatched(RepoDataState), + + /// The cache could be read and corresponds to the repodata.json file that + /// is on disk but the cached data is (partially) out of date. + OutOfDate(RepoDataState), + + /// The cache is up to date. + UpToDate(RepoDataState), +} + +/// Tries to determine if the cache state for the repodata.json for the given +/// `subdir_url` is considered to be up-to-date. +/// +/// This functions reads multiple files from the `cache_path`, it is left up to +/// the user to ensure that these files stay synchronized during the execution +/// of this function. +fn validate_cached_state( + cache_path: &Path, + subdir_url: &Url, + cache_key: &str, +) -> ValidatedCacheState { + let repo_data_json_path = cache_path.join(format!("{cache_key}.json")); + let cache_state_path = cache_path.join(format!("{cache_key}.info.json")); + + // Check if we have cached repodata.json file + let json_metadata = match std::fs::metadata(&repo_data_json_path) { + Err(e) if e.kind() == ErrorKind::NotFound => return ValidatedCacheState::InvalidOrMissing, + Err(e) => { + tracing::warn!( + "failed to get metadata of repodata.json file '{}': {e}. Ignoring cached files...", + repo_data_json_path.display() + ); + return ValidatedCacheState::InvalidOrMissing; + } + Ok(metadata) => metadata, + }; + + // Try to read the repodata state cache + let cache_state = match RepoDataState::from_path(&cache_state_path) { + Err(e) if e.kind() == ErrorKind::NotFound => { + // Ignore, the cache just doesnt exist + tracing::debug!("repodata cache state is missing. Ignoring cached files..."); + return ValidatedCacheState::InvalidOrMissing; + } + Err(e) => { + // An error occurred while reading the cached state. + tracing::warn!( + "invalid repodata cache state '{}': {e}. Ignoring cached files...", + cache_state_path.display() + ); + return ValidatedCacheState::InvalidOrMissing; + } + Ok(state) => state, + }; + + // Do the URLs match? + let cached_subdir_url = if cache_state.url.path().ends_with('/') { + cache_state.url.clone() + } else { + let path = cache_state.url.path(); + let (subdir_path, _) = path.rsplit_once('/').unwrap_or(("", path)); + let mut url = cache_state.url.clone(); + url.set_path(&format!("{subdir_path}/")); + url + }; + if &cached_subdir_url != subdir_url { + tracing::warn!( + "cache state refers to a different repodata.json url. Ignoring cached files..." + ); + return ValidatedCacheState::InvalidOrMissing; + } + + // Determine last modified date of the repodata.json file. + let cache_last_modified = match json_metadata.modified() { + Err(_) => { + tracing::warn!("could not determine last modified date of repodata.json file. Ignoring cached files..."); + return ValidatedCacheState::Mismatched(cache_state); + } + Ok(last_modified) => last_modified, + }; + + // Make sure that the repodata state cache refers to the repodata that exists on + // disk. + // + // Check the blake hash of the repodata.json file if we have a similar hash in + // the state. + if let Some(cached_hash) = cache_state.blake2_hash.as_ref() { + match compute_file_digest::(&repo_data_json_path) { + Err(e) => { + tracing::warn!( + "could not compute BLAKE2 hash of repodata.json file: {e}. Ignoring cached files..." + ); + return ValidatedCacheState::Mismatched(cache_state); + } + Ok(hash) => { + if &hash != cached_hash { + tracing::warn!( + "BLAKE2 hash of repodata.json does not match cache state. Ignoring cached files..." + ); + return ValidatedCacheState::InvalidOrMissing; + } + } + } + } else { + // The state cache records the size and last modified date of the original file. + // If those do not match, the repodata.json file has been modified. + if json_metadata.len() != cache_state.cache_size + || Some(cache_last_modified) != json_metadata.modified().ok() + { + tracing::warn!("repodata cache state mismatches the existing repodatajson file. Ignoring cached files..."); + return ValidatedCacheState::Mismatched(cache_state); + } + } + + // Determine the age of the cache + let cache_age = match SystemTime::now().duration_since(cache_last_modified) { + Ok(duration) => duration, + Err(e) => { + tracing::warn!("failed to determine cache age: {e}. Ignoring cached files..."); + return ValidatedCacheState::Mismatched(cache_state); + } + }; + + // Parse the cache control header, and determine if the cache is out of date or + // not. + if let Some(cache_control) = cache_state.cache_headers.cache_control.as_deref() { + match CacheControl::from_value(cache_control) { + None => { + tracing::warn!( + "could not parse cache_control from repodata cache state. Ignoring cached files..." + ); + return ValidatedCacheState::Mismatched(cache_state); + } + Some(CacheControl { + cachability: Some(Cachability::Public), + max_age: Some(duration), + .. + }) => { + if cache_age > duration { + tracing::debug!( + "Cache is {} old but can at most be {} old. Assuming out of date...", + humantime::format_duration(cache_age), + humantime::format_duration(duration), + ); + return ValidatedCacheState::OutOfDate(cache_state); + } + } + Some(_) => { + tracing::debug!( + "Unsupported cache-control value '{}'. Assuming out of date...", + cache_control + ); + return ValidatedCacheState::OutOfDate(cache_state); + } + } + } else { + tracing::warn!( + "previous cache state does not contain cache_control header. Assuming out of date..." + ); + return ValidatedCacheState::OutOfDate(cache_state); + } + + // Well then! If we get here, it means the cache must be up to date! + ValidatedCacheState::UpToDate(cache_state) +} + +#[cfg(test)] +mod test { + use std::{ + future::IntoFuture, + net::SocketAddr, + path::{Path, PathBuf}, + sync::{ + atomic::{AtomicUsize, Ordering}, + Arc, + }, + }; + + use assert_matches::assert_matches; + use axum::{ + body::Body, + extract::State, + http::{Request, StatusCode}, + middleware, + middleware::Next, + response::{IntoResponse, Response}, + routing::get, + Router, + }; + use bytes::Bytes; + use fs_err::tokio as tokio_fs; + use futures::{stream, StreamExt}; + use hex_literal::hex; + use rattler_networking::AuthenticationMiddleware; + use reqwest::Client; + use reqwest_middleware::{ClientBuilder, ClientWithMiddleware}; + use tempfile::TempDir; + use tokio::{io::AsyncWriteExt, sync::Mutex}; + use tokio_util::io::ReaderStream; + use url::Url; + + use crate::{ + fetch::{ + with_cache::{fetch_repo_data, CacheResult, CachedRepoData, FetchRepoDataOptions}, + FetchRepoDataError, RepoDataNotFoundError, + }, + utils::{simple_channel_server::SimpleChannelServer, Encoding}, + Reporter, + }; + + async fn write_encoded( + mut input: &[u8], + destination: &Path, + encoding: Encoding, + ) -> Result<(), std::io::Error> { + // Open the file for writing + let mut file = tokio_fs::File::create(destination).await.unwrap(); + + match encoding { + Encoding::Passthrough => { + tokio::io::copy(&mut input, &mut file).await?; + } + Encoding::GZip => { + let mut encoder = async_compression::tokio::write::GzipEncoder::new(file); + tokio::io::copy(&mut input, &mut encoder).await?; + encoder.shutdown().await?; + } + Encoding::Bz2 => { + let mut encoder = async_compression::tokio::write::BzEncoder::new(file); + tokio::io::copy(&mut input, &mut encoder).await?; + encoder.shutdown().await?; + } + Encoding::Zst => { + let mut encoder = async_compression::tokio::write::ZstdEncoder::new(file); + tokio::io::copy(&mut input, &mut encoder).await?; + encoder.shutdown().await?; + } + } + + Ok(()) + } + + #[test] + pub fn test_normalize_url() { + assert_eq!( + super::normalize_subdir_url(Url::parse("http://localhost/channels/empty").unwrap()), + Url::parse("http://localhost/channels/empty/").unwrap(), + ); + assert_eq!( + super::normalize_subdir_url(Url::parse("http://localhost/channels/empty/").unwrap()), + Url::parse("http://localhost/channels/empty/").unwrap(), + ); + } + + const FAKE_REPO_DATA: &str = r#"{ + "packages.conda": { + "asttokens-2.2.1-pyhd8ed1ab_0.conda": { + "arch": null, + "build": "pyhd8ed1ab_0", + "build_number": 0, + "build_string": "pyhd8ed1ab_0", + "constrains": [], + "depends": [ + "python >=3.5", + "six" + ], + "fn": "asttokens-2.2.1-pyhd8ed1ab_0.conda", + "license": "Apache-2.0", + "license_family": "Apache", + "md5": "bf7f54dd0f25c3f06ecb82a07341841a", + "name": "asttokens", + "noarch": "python", + "platform": null, + "sha256": "7ed530efddd47a96c11197906b4008405b90e3bc2f4e0df722a36e0e6103fd9c", + "size": 27831, + "subdir": "noarch", + "timestamp": 1670264089059, + "track_features": "", + "url": "https://conda.anaconda.org/conda-forge/noarch/asttokens-2.2.1-pyhd8ed1ab_0.conda", + "version": "2.2.1" + } + } + } + "#; + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_fetch_repo_data() { + // Create a directory with some repodata. + let subdir_path = TempDir::new().unwrap(); + std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the data from the channel with an empty cache. + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_eq!( + result.cache_state.blake2_hash.unwrap()[..], + hex!("a1861e448e4a62b88dce47c95351bfbe7fc22451a73f89a09d782492540e0675")[..] + ); + assert_eq!( + std::fs::read_to_string(result.repo_data_json_path).unwrap(), + FAKE_REPO_DATA + ); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_cache_works() { + // Create a directory with some repodata. + let subdir_path = TempDir::new().unwrap(); + std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the data from the channel with an empty cache. + let cache_dir = TempDir::new().unwrap(); + let CachedRepoData { cache_result, .. } = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.path().to_owned(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_matches!(cache_result, CacheResult::CacheNotPresent); + + // Download the data from the channel with a filled cache. + let CachedRepoData { cache_result, .. } = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.path().to_owned(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_matches!( + cache_result, + CacheResult::CacheHit | CacheResult::CacheHitAfterFetch + ); + + // I know this is terrible but without the sleep rust is too blazingly fast and + // the server doesnt think the file was actually updated.. This is + // because the time send by the server has seconds precision. + tokio::time::sleep(std::time::Duration::from_millis(1500)).await; + + // Update the original repodata.json file + std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); + + // Download the data from the channel with a filled cache. + let CachedRepoData { cache_result, .. } = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_matches!(cache_result, CacheResult::CacheOutdated); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_zst_works() { + let subdir_path = TempDir::new().unwrap(); + write_encoded( + FAKE_REPO_DATA.as_bytes(), + &subdir_path.path().join("repodata.json.zst"), + Encoding::Zst, + ) + .await + .unwrap(); + + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the data from the channel with an empty cache. + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_eq!( + std::fs::read_to_string(result.repo_data_json_path).unwrap(), + FAKE_REPO_DATA + ); + assert_matches!( + result.cache_state.has_zst, Some(super::Expiring { + value, .. + }) if value + ); + assert_matches!( + result.cache_state.has_bz2, Some(super::Expiring { + value, .. + }) if !value + ); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_bz2_works() { + let subdir_path = TempDir::new().unwrap(); + write_encoded( + FAKE_REPO_DATA.as_bytes(), + &subdir_path.path().join("repodata.json.bz2"), + Encoding::Bz2, + ) + .await + .unwrap(); + + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the data from the channel with an empty cache. + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_eq!( + std::fs::read_to_string(result.repo_data_json_path).unwrap(), + FAKE_REPO_DATA + ); + assert_matches!( + result.cache_state.has_zst, Some(super::Expiring { + value, .. + }) if !value + ); + assert_matches!( + result.cache_state.has_bz2, Some(super::Expiring { + value, .. + }) if value + ); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_zst_is_preferred() { + let subdir_path = TempDir::new().unwrap(); + write_encoded( + FAKE_REPO_DATA.as_bytes(), + &subdir_path.path().join("repodata.json.bz2"), + Encoding::Bz2, + ) + .await + .unwrap(); + write_encoded( + FAKE_REPO_DATA.as_bytes(), + &subdir_path.path().join("repodata.json.zst"), + Encoding::Zst, + ) + .await + .unwrap(); + + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the data from the channel with an empty cache. + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_eq!( + std::fs::read_to_string(result.repo_data_json_path).unwrap(), + FAKE_REPO_DATA + ); + assert!(result.cache_state.url.path().ends_with("repodata.json.zst")); + assert_matches!( + result.cache_state.has_zst, Some(super::Expiring { + value, .. + }) if value + ); + assert_matches!( + result.cache_state.has_bz2, Some(super::Expiring { + value, .. + }) if value + ); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_gzip_transfer_encoding() { + // Create a directory with some repodata. + let subdir_path = TempDir::new().unwrap(); + write_encoded( + FAKE_REPO_DATA.as_ref(), + &subdir_path.path().join("repodata.json.gz"), + Encoding::GZip, + ) + .await + .unwrap(); + + // The server is configured in such a way that if file `a` is requested but a + // file called `a.gz` is available it will stream the `a.gz` file and + // report that its a `gzip` encoded stream. + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the data from the channel + let cache_dir = TempDir::new().unwrap(); + + let client = Client::builder().no_gzip().build().unwrap(); + let authenticated_client = reqwest_middleware::ClientBuilder::new(client) + .with_arc(Arc::new( + AuthenticationMiddleware::from_env_and_defaults().unwrap(), + )) + .build(); + + let result = fetch_repo_data( + server.url(), + authenticated_client, + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await + .unwrap(); + + assert_eq!( + std::fs::read_to_string(result.repo_data_json_path).unwrap(), + FAKE_REPO_DATA + ); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_progress() { + // Create a directory with some repodata. + let subdir_path = TempDir::new().unwrap(); + std::fs::write(subdir_path.path().join("repodata.json"), FAKE_REPO_DATA).unwrap(); + let server = SimpleChannelServer::new(subdir_path.path()).await; + + struct BasicReporter { + last_download_progress: AtomicUsize, + } + + impl Reporter for BasicReporter { + fn on_download_progress( + &self, + _url: &Url, + _index: usize, + bytes_downloaded: usize, + total_bytes: Option, + ) { + self.last_download_progress + .store(bytes_downloaded, Ordering::SeqCst); + assert_eq!(total_bytes, Some(1110)); + } + } + + let reporter = Arc::new(BasicReporter { + last_download_progress: AtomicUsize::new(0), + }); + + // Download the data from the channel with an empty cache. + let cache_dir = TempDir::new().unwrap(); + let _result = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + Some(reporter.clone()), + ) + .await + .unwrap(); + + assert_eq!(reporter.last_download_progress.load(Ordering::SeqCst), 1110); + } + + #[tracing_test::traced_test] + #[tokio::test] + pub async fn test_repodata_not_found() { + // Create a directory with some repodata. + let subdir_path = TempDir::new().unwrap(); + // Don't add repodata to the channel. + + // Download the "data" from the local filebased channel. + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + Url::parse(format!("file://{}", subdir_path.path().to_str().unwrap()).as_str()) + .unwrap(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await; + + assert!(result.is_err()); + assert!(matches!( + result, + Err(FetchRepoDataError::NotFound( + RepoDataNotFoundError::FileSystemError(_) + )) + )); + + // Start a server to test the http error + let server = SimpleChannelServer::new(subdir_path.path()).await; + + // Download the "data" from the channel. + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + server.url(), + ClientWithMiddleware::from(Client::new()), + cache_dir.into_path(), + FetchRepoDataOptions::default(), + None, + ) + .await; + + assert!(result.is_err()); + assert!(matches!( + result, + Err(FetchRepoDataError::NotFound( + RepoDataNotFoundError::HttpError(_) + )) + )); + } + + #[tracing_test::traced_test] + #[tokio::test] + async fn test_flaky_package_cache() { + fn get_test_data_dir() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../test-data") + } + + async fn redirect_to_prefix( + axum::extract::Path((file,)): axum::extract::Path<(String,)>, + ) -> impl IntoResponse { + let path = get_test_data_dir() + .join("channels/pytorch/linux-64/") + .join(file); + if !path.exists() { + return Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::empty()) + .unwrap(); + } + let file = tokio::fs::File::open(path).await.unwrap(); + let body = Body::from_stream(ReaderStream::new(file)); + Response::builder() + .status(StatusCode::OK) + .body(body) + .unwrap() + } + + /// A helper middleware function that fails the first two requests. + #[allow(clippy::type_complexity)] + async fn fail_with_half_package( + State((count, bytes)): State<(Arc>, Arc>)>, + req: Request, + next: Next, + ) -> Result { + let count = { + let mut count = count.lock().await; + *count += 1; + *count + }; + + println!("Running middleware for request #{count} for {}", req.uri()); + let response = next.run(req).await; + + if count < 2 { + println!("Cutting response body in half"); + let body = response.into_body(); + let mut body = body.into_data_stream(); + let mut buffer = Vec::new(); + while let Some(Ok(chunk)) = body.next().await { + buffer.extend(chunk); + } + + let byte_count = *bytes.lock().await; + let bytes = buffer.into_iter().take(byte_count).collect::>(); + // Create a stream that ends prematurely + let stream = stream::iter(vec![ + Ok(bytes.into_iter().collect::()), + Err(std::io::Error::new( + std::io::ErrorKind::Other, + "premature close", + )), + // The stream ends after sending partial data, simulating a premature close + ]); + let body = Body::from_stream(stream); + return Ok(Response::new(body)); + } + + Ok(response) + } + + let request_count = Arc::new(Mutex::new(0)); + let router = Router::new() + .route("/{file}", get(redirect_to_prefix)) + .layer(middleware::from_fn_with_state( + (request_count.clone(), Arc::new(Mutex::new(1024 * 1024))), + fail_with_half_package, + )); + + // Construct the server that will listen on localhost but with a *random port*. + // The random port is very important because it enables creating + // multiple instances at the same time. We need this to be able to run + // tests in parallel. + let addr = SocketAddr::new([127, 0, 0, 1].into(), 0); + let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); + let addr = listener.local_addr().unwrap(); + + let service = router.into_make_service(); + tokio::spawn(axum::serve(listener, service).into_future()); + + let server_url = Url::parse(&format!("http://localhost:{}", addr.port())).unwrap(); + + let client = ClientBuilder::new(Client::default()).build(); + + let cache_dir = TempDir::new().unwrap(); + let result = fetch_repo_data( + server_url, + client, + cache_dir.path().into(), + FetchRepoDataOptions { + bz2_enabled: false, + zstd_enabled: false, + jlap_enabled: false, + ..FetchRepoDataOptions::default() + }, + None, + ) + .await; + + // Unwrap the result because at this point we should have a valid result. + result.unwrap(); + + assert_eq!( + *request_count.lock().await, + 2, + "there must have been exactly two requests" + ); + } +} diff --git a/crates/rattler_repodata_gateway/src/gateway/builder.rs b/crates/rattler_repodata_gateway/src/gateway/builder.rs index c2c572450..496896aa9 100644 --- a/crates/rattler_repodata_gateway/src/gateway/builder.rs +++ b/crates/rattler_repodata_gateway/src/gateway/builder.rs @@ -1,10 +1,10 @@ use crate::gateway::GatewayInner; use crate::{ChannelConfig, Gateway}; use dashmap::DashMap; +#[cfg(not(target_arch = "wasm32"))] use rattler_cache::package_cache::PackageCache; use reqwest::Client; use reqwest_middleware::ClientWithMiddleware; -use std::path::PathBuf; use std::sync::Arc; /// A builder for constructing a [`Gateway`]. @@ -12,7 +12,9 @@ use std::sync::Arc; pub struct GatewayBuilder { channel_config: ChannelConfig, client: Option, - cache: Option, + #[cfg(not(target_arch = "wasm32"))] + cache: Option, + #[cfg(not(target_arch = "wasm32"))] package_cache: Option, max_concurrent_requests: Option, } @@ -50,25 +52,29 @@ impl GatewayBuilder { } /// Set the directory to use for caching repodata. + #[cfg(not(target_arch = "wasm32"))] #[must_use] - pub fn with_cache_dir(mut self, cache: impl Into) -> Self { + pub fn with_cache_dir(mut self, cache: impl Into) -> Self { self.set_cache_dir(cache); self } /// Add package cache to the builder to store packages. + #[cfg(not(target_arch = "wasm32"))] pub fn with_package_cache(mut self, package_cache: PackageCache) -> Self { self.set_package_cache(package_cache); self } /// Set the directory to use for caching repodata. - pub fn set_cache_dir(&mut self, cache: impl Into) -> &mut Self { + #[cfg(not(target_arch = "wasm32"))] + pub fn set_cache_dir(&mut self, cache: impl Into) -> &mut Self { self.cache = Some(cache.into()); self } /// Set the directory to use for caching packages. + #[cfg(not(target_arch = "wasm32"))] pub fn set_package_cache(&mut self, package_cache: PackageCache) -> &mut Self { self.package_cache = Some(package_cache); self @@ -93,12 +99,14 @@ impl GatewayBuilder { .client .unwrap_or_else(|| ClientWithMiddleware::from(Client::new())); + #[cfg(not(target_arch = "wasm32"))] let cache = self.cache.unwrap_or_else(|| { dirs::cache_dir() - .unwrap_or_else(|| PathBuf::from(".")) + .unwrap_or_else(|| std::path::PathBuf::from(".")) .join("rattler/cache") }); + #[cfg(not(target_arch = "wasm32"))] let package_cache = self.package_cache.unwrap_or(PackageCache::new( cache.join(rattler_cache::PACKAGE_CACHE_DIR), )); @@ -109,7 +117,9 @@ impl GatewayBuilder { subdirs: DashMap::default(), client, channel_config: self.channel_config, + #[cfg(not(target_arch = "wasm32"))] cache, + #[cfg(not(target_arch = "wasm32"))] package_cache, concurrent_requests_semaphore: Arc::new(tokio::sync::Semaphore::new( max_concurrent_requests, diff --git a/crates/rattler_repodata_gateway/src/gateway/error.rs b/crates/rattler_repodata_gateway/src/gateway/error.rs index 1b14d0b7f..6e7deaf29 100644 --- a/crates/rattler_repodata_gateway/src/gateway/error.rs +++ b/crates/rattler_repodata_gateway/src/gateway/error.rs @@ -1,14 +1,17 @@ -use crate::fetch; -use crate::fetch::{FetchRepoDataError, RepoDataNotFoundError}; -use crate::gateway::direct_url_query::DirectUrlQueryError; +use std::{ + fmt::{Display, Formatter}, + io, +}; + use rattler_conda_types::{Channel, InvalidPackageNameError, MatchSpec}; use rattler_redaction::Redact; -use reqwest_middleware::Error; -use simple_spawn_blocking::Cancelled; -use std::fmt::{Display, Formatter}; -use std::io; use thiserror::Error; +use crate::{ + fetch, + fetch::{FetchRepoDataError, RepoDataNotFoundError}, +}; + #[derive(Debug, Error)] #[allow(missing_docs)] pub enum GatewayError { @@ -31,13 +34,17 @@ pub enum GatewayError { Generic(String), #[error(transparent)] - SubdirNotFoundError(#[from] SubdirNotFoundError), + SubdirNotFoundError(#[from] Box), #[error("the operation was cancelled")] Cancelled, + #[cfg(not(target_arch = "wasm32"))] #[error("the direct url query failed for {0}")] - DirectUrlQueryError(String, #[source] DirectUrlQueryError), + DirectUrlQueryError( + String, + #[source] super::direct_url_query::DirectUrlQueryError, + ), #[error("the match spec '{0}' does not specify a name")] MatchSpecWithoutName(Box), @@ -50,10 +57,14 @@ pub enum GatewayError { #[error("{0}")] CacheError(String), + + #[error("direct url queries are not supported ({0})")] + DirectUrlQueryNotSupported(String), } -impl From for GatewayError { - fn from(_: Cancelled) -> Self { +#[cfg(not(target_arch = "wasm32"))] +impl From for GatewayError { + fn from(_: simple_spawn_blocking::Cancelled) -> Self { GatewayError::Cancelled } } @@ -61,8 +72,8 @@ impl From for GatewayError { impl From for GatewayError { fn from(value: reqwest_middleware::Error) -> Self { match value { - Error::Reqwest(err) => err.into(), - Error::Middleware(err) => GatewayError::ReqwestMiddlewareError(err), + reqwest_middleware::Error::Reqwest(err) => err.into(), + reqwest_middleware::Error::Middleware(err) => GatewayError::ReqwestMiddlewareError(err), } } } diff --git a/crates/rattler_repodata_gateway/src/gateway/local_subdir.rs b/crates/rattler_repodata_gateway/src/gateway/local_subdir.rs index 1583f5a40..9fcb4fe44 100644 --- a/crates/rattler_repodata_gateway/src/gateway/local_subdir.rs +++ b/crates/rattler_repodata_gateway/src/gateway/local_subdir.rs @@ -1,44 +1,60 @@ -use crate::gateway::error::SubdirNotFoundError; -use crate::gateway::subdir::SubdirClient; -use crate::gateway::GatewayError; -use crate::sparse::SparseRepoData; -use crate::Reporter; +use std::{path::Path, sync::Arc}; + use rattler_conda_types::{Channel, PackageName, RepoDataRecord}; -use simple_spawn_blocking::tokio::run_blocking_task; -use std::path::Path; -use std::sync::Arc; -/// A client that can be used to fetch repodata for a specific subdirectory from a local directory. +use crate::{ + gateway::{error::SubdirNotFoundError, subdir::SubdirClient, GatewayError}, + sparse::SparseRepoData, + Reporter, +}; + +/// A client that can be used to fetch repodata for a specific subdirectory from +/// a local directory. /// -/// Use the [`LocalSubdirClient::from_directory`] function to create a new instance of this client. +/// Use the [`LocalSubdirClient::from_directory`] function to create a new +/// instance of this client. pub struct LocalSubdirClient { sparse: Arc, } impl LocalSubdirClient { - pub async fn from_channel_subdir( + pub fn from_file( repodata_path: &Path, channel: Channel, subdir: &str, ) -> Result { let repodata_path = repodata_path.to_path_buf(); let subdir = subdir.to_string(); - let sparse = run_blocking_task(move || { - SparseRepoData::new(channel.clone(), subdir.clone(), &repodata_path, None).map_err( - |err| { + let sparse = + SparseRepoData::from_file(channel.clone(), subdir.clone(), &repodata_path, None) + .map_err(|err| { if err.kind() == std::io::ErrorKind::NotFound { - GatewayError::SubdirNotFoundError(SubdirNotFoundError { + GatewayError::SubdirNotFoundError(Box::new(SubdirNotFoundError { channel: channel.clone(), subdir: subdir.clone(), source: err.into(), - }) + })) } else { GatewayError::IoError("failed to parse repodata.json".to_string(), err) } - }, - ) + })?; + + Ok(Self { + sparse: Arc::new(sparse), }) - .await?; + } + + #[cfg(target_arch = "wasm32")] + pub fn from_bytes( + bytes: bytes::Bytes, + channel: Channel, + subdir: &str, + ) -> Result { + let subdir = subdir.to_string(); + let sparse = SparseRepoData::from_bytes(channel.clone(), subdir.clone(), bytes, None) + .map_err(|err| { + GatewayError::IoError("failed to parse repodata.json".to_string(), err.into()) + })?; Ok(Self { sparse: Arc::new(sparse), @@ -46,7 +62,8 @@ impl LocalSubdirClient { } } -#[async_trait::async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] impl SubdirClient for LocalSubdirClient { async fn fetch_package_records( &self, @@ -55,14 +72,19 @@ impl SubdirClient for LocalSubdirClient { ) -> Result, GatewayError> { let sparse_repodata = self.sparse.clone(); let name = name.clone(); - run_blocking_task(move || match sparse_repodata.load_records(&name) { + + let load_records = move || match sparse_repodata.load_records(&name) { Ok(records) => Ok(records.into()), Err(err) => Err(GatewayError::IoError( "failed to extract repodata records from sparse repodata".to_string(), err, )), - }) - .await + }; + + #[cfg(target_arch = "wasm32")] + return load_records(); + #[cfg(not(target_arch = "wasm32"))] + simple_spawn_blocking::tokio::run_blocking_task(load_records).await } fn package_names(&self) -> Vec { diff --git a/crates/rattler_repodata_gateway/src/gateway/mod.rs b/crates/rattler_repodata_gateway/src/gateway/mod.rs index 6d6777e0d..1fd9a50e4 100644 --- a/crates/rattler_repodata_gateway/src/gateway/mod.rs +++ b/crates/rattler_repodata_gateway/src/gateway/mod.rs @@ -1,6 +1,7 @@ mod barrier_cell; mod builder; mod channel_config; +#[cfg(not(target_arch = "wasm32"))] mod direct_url_query; mod error; mod local_subdir; @@ -13,7 +14,6 @@ mod subdir_builder; use std::{ collections::HashSet, - path::PathBuf, sync::{Arc, Weak}, }; @@ -23,6 +23,7 @@ pub use channel_config::{ChannelConfig, SourceConfig}; use dashmap::{mapref::entry::Entry, DashMap}; pub use error::GatewayError; pub use query::{NamesQuery, RepoDataQuery}; +#[cfg(not(target_arch = "wasm32"))] use rattler_cache::package_cache::PackageCache; use rattler_conda_types::{Channel, MatchSpec, Platform}; pub use repo_data::RepoData; @@ -158,9 +159,11 @@ struct GatewayInner { channel_config: ChannelConfig, /// The directory to store any cache - cache: PathBuf, + #[cfg(not(target_arch = "wasm32"))] + cache: std::path::PathBuf, /// The package cache, stored to reuse memory cache + #[cfg(not(target_arch = "wasm32"))] package_cache: PackageCache, /// A semaphore to limit the number of concurrent requests. @@ -308,8 +311,8 @@ mod test { use rstest::rstest; use url::Url; + use crate::fetch::CacheAction; use crate::{ - fetch::CacheAction, gateway::Gateway, utils::{simple_channel_server::SimpleChannelServer, test::fetch_repo_data}, GatewayError, RepoData, Reporter, SourceConfig, SubdirSelection, @@ -369,6 +372,7 @@ mod test { } #[tokio::test] + #[cfg(not(target_arch = "wasm32"))] async fn test_direct_url_spec_from_gateway() { let gateway = Gateway::builder() .with_package_cache(PackageCache::new( diff --git a/crates/rattler_repodata_gateway/src/gateway/query.rs b/crates/rattler_repodata_gateway/src/gateway/query.rs index 254d72056..0df2fb384 100644 --- a/crates/rattler_repodata_gateway/src/gateway/query.rs +++ b/crates/rattler_repodata_gateway/src/gateway/query.rs @@ -1,6 +1,6 @@ use std::{ collections::{HashMap, HashSet}, - future::IntoFuture, + future::{Future, IntoFuture}, sync::Arc, }; @@ -9,7 +9,7 @@ use itertools::Itertools; use rattler_conda_types::{Channel, MatchSpec, Matches, PackageName, Platform}; use super::{subdir::Subdir, BarrierCell, GatewayError, GatewayInner, RepoData}; -use crate::{gateway::direct_url_query::DirectUrlQuery, Reporter}; +use crate::Reporter; /// Represents a query to execute with a [`Gateway`]. /// @@ -171,37 +171,45 @@ impl RepoDataQuery { let mut pending_records = FuturesUnordered::new(); // Push the direct url queries to the pending_records. - for (spec, url, name) in direct_url_specs { - let gateway = self.gateway.clone(); - pending_records.push( - async move { - let query = DirectUrlQuery::new( - url.clone(), - gateway.package_cache.clone(), - gateway.client.clone(), - spec.sha256, + cfg_if::cfg_if! { + if #[cfg(target_arch = "wasm32")] { + if let Some((_,first_url,_)) = direct_url_specs.into_iter().next() { + // Direct url queries are not supported in wasm. + return Err(GatewayError::DirectUrlQueryNotSupported(first_url.to_string())); + } + } else { + for (spec, url, name) in direct_url_specs { + let gateway = self.gateway.clone(); + pending_records.push( + box_future(async move { + let query = super::direct_url_query::DirectUrlQuery::new( + url.clone(), + gateway.package_cache.clone(), + gateway.client.clone(), + spec.sha256, + ); + + let record = query + .execute() + .await + .map_err(|e| GatewayError::DirectUrlQueryError(url.to_string(), e))?; + + // Check if record actually has the same name + if let Some(record) = record.first() { + if record.package_record.name != name { + // Using as_source to get the closest to the retrieved input. + return Err(GatewayError::UrlRecordNameMismatch( + record.package_record.name.as_source().to_string(), + name.as_source().to_string(), + )); + } + } + // Push the direct url in the first subdir result for channel priority logic. + Ok((0, SourceSpecs::Input(vec![spec]), record)) + }), ); - - let record = query - .execute() - .await - .map_err(|e| GatewayError::DirectUrlQueryError(url.to_string(), e))?; - - // Check if record actually has the same name - if let Some(record) = record.first() { - if record.package_record.name != name { - // Using as_source to get the closest to the retrieved input. - return Err(GatewayError::UrlRecordNameMismatch( - record.package_record.name.as_source().to_string(), - name.as_source().to_string(), - )); - } - } - // Push the direct url in the first subdir result for channel priority logic. - Ok((0, SourceSpecs::Input(vec![spec]), record)) } - .boxed(), - ); + } } let len = subdirs.len() + direct_url_offset; @@ -216,22 +224,19 @@ impl RepoDataQuery { let specs = specs.clone(); let package_name = package_name.clone(); let reporter = self.reporter.clone(); - pending_records.push( - async move { - let barrier_cell = subdir.clone(); - let subdir = barrier_cell.wait().await; - match subdir.as_ref() { - Subdir::Found(subdir) => subdir - .get_or_fetch_package_records(&package_name, reporter) - .await - .map(|records| (subdir_idx, specs, records)), - Subdir::NotFound => { - Ok((subdir_idx + direct_url_offset, specs, Arc::from(vec![]))) - } + pending_records.push(box_future(async move { + let barrier_cell = subdir.clone(); + let subdir = barrier_cell.wait().await; + match subdir.as_ref() { + Subdir::Found(subdir) => subdir + .get_or_fetch_package_records(&package_name, reporter) + .await + .map(|records| (subdir_idx, specs, records)), + Subdir::NotFound => { + Ok((subdir_idx + direct_url_offset, specs, Arc::from(vec![]))) } } - .boxed(), - ); + })); } } @@ -306,12 +311,28 @@ impl RepoDataQuery { } } +#[cfg(target_arch = "wasm32")] +type BoxFuture = futures::future::LocalBoxFuture<'static, T>; + +#[cfg(target_arch = "wasm32")] +fn box_future + 'static>(future: F) -> BoxFuture { + future.boxed_local() +} + +#[cfg(not(target_arch = "wasm32"))] +type BoxFuture = futures::future::BoxFuture<'static, T>; + +#[cfg(not(target_arch = "wasm32"))] +fn box_future + Send + 'static>(future: F) -> BoxFuture { + future.boxed() +} + impl IntoFuture for RepoDataQuery { type Output = Result, GatewayError>; - type IntoFuture = futures::future::BoxFuture<'static, Self::Output>; + type IntoFuture = BoxFuture; fn into_future(self) -> Self::IntoFuture { - self.execute().boxed() + box_future(self.execute()) } } @@ -406,10 +427,10 @@ impl NamesQuery { impl IntoFuture for NamesQuery { type Output = Result, GatewayError>; - type IntoFuture = futures::future::BoxFuture<'static, Self::Output>; + type IntoFuture = BoxFuture; fn into_future(self) -> Self::IntoFuture { - self.execute().boxed() + box_future(self.execute()) } } diff --git a/crates/rattler_repodata_gateway/src/gateway/remote_subdir/mod.rs b/crates/rattler_repodata_gateway/src/gateway/remote_subdir/mod.rs new file mode 100644 index 000000000..e9dd71b45 --- /dev/null +++ b/crates/rattler_repodata_gateway/src/gateway/remote_subdir/mod.rs @@ -0,0 +1,30 @@ +use crate::gateway::subdir::SubdirClient; +use crate::{GatewayError, Reporter}; +use rattler_conda_types::{PackageName, RepoDataRecord}; +use std::sync::Arc; + +cfg_if::cfg_if! { + if #[cfg(target_arch = "wasm32")] { + mod wasm; + pub use wasm::RemoteSubdirClient; + } else { + mod tokio; + pub use tokio::RemoteSubdirClient; + } +} + +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] +impl SubdirClient for RemoteSubdirClient { + async fn fetch_package_records( + &self, + name: &PackageName, + reporter: Option<&dyn Reporter>, + ) -> Result, GatewayError> { + self.sparse.fetch_package_records(name, reporter).await + } + + fn package_names(&self) -> Vec { + self.sparse.package_names() + } +} diff --git a/crates/rattler_repodata_gateway/src/gateway/remote_subdir.rs b/crates/rattler_repodata_gateway/src/gateway/remote_subdir/tokio.rs similarity index 63% rename from crates/rattler_repodata_gateway/src/gateway/remote_subdir.rs rename to crates/rattler_repodata_gateway/src/gateway/remote_subdir/tokio.rs index a4fe10e2e..9f9c62c5f 100644 --- a/crates/rattler_repodata_gateway/src/gateway/remote_subdir.rs +++ b/crates/rattler_repodata_gateway/src/gateway/remote_subdir/tokio.rs @@ -1,80 +1,68 @@ -use std::{path::PathBuf, sync::Arc}; - -use rattler_conda_types::{Channel, PackageName, Platform, RepoDataRecord}; -use reqwest_middleware::ClientWithMiddleware; - -use super::{local_subdir::LocalSubdirClient, GatewayError, SourceConfig}; -use crate::{ - fetch::{fetch_repo_data, FetchRepoDataError, FetchRepoDataOptions}, - gateway::{error::SubdirNotFoundError, subdir::SubdirClient}, - Reporter, -}; - -pub struct RemoteSubdirClient { - sparse: LocalSubdirClient, -} - -impl RemoteSubdirClient { - pub async fn new( - channel: Channel, - platform: Platform, - client: ClientWithMiddleware, - cache_dir: PathBuf, - source_config: SourceConfig, - reporter: Option>, - ) -> Result { - let subdir_url = channel.platform_url(platform); - - // Fetch the repodata from the remote server - let repodata = fetch_repo_data( - subdir_url, - client, - cache_dir, - FetchRepoDataOptions { - cache_action: source_config.cache_action, - jlap_enabled: source_config.jlap_enabled, - zstd_enabled: source_config.zstd_enabled, - bz2_enabled: source_config.bz2_enabled, - ..FetchRepoDataOptions::default() - }, - reporter, - ) - .await - .map_err(|e| match e { - FetchRepoDataError::NotFound(e) => { - GatewayError::SubdirNotFoundError(SubdirNotFoundError { - channel: channel.clone(), - subdir: platform.to_string(), - source: e.into(), - }) - } - e => GatewayError::FetchRepoDataError(e), - })?; - - // Create a new sparse repodata client that can be used to read records from the - // repodata. - let sparse = LocalSubdirClient::from_channel_subdir( - &repodata.repo_data_json_path, - channel.clone(), - platform.as_str(), - ) - .await?; - - Ok(Self { sparse }) - } -} - -#[async_trait::async_trait] -impl SubdirClient for RemoteSubdirClient { - async fn fetch_package_records( - &self, - name: &PackageName, - reporter: Option<&dyn Reporter>, - ) -> Result, GatewayError> { - self.sparse.fetch_package_records(name, reporter).await - } - - fn package_names(&self) -> Vec { - self.sparse.package_names() - } -} +use std::{path::PathBuf, sync::Arc}; + +use rattler_conda_types::{Channel, Platform}; +use reqwest_middleware::ClientWithMiddleware; + +use crate::{ + fetch::{fetch_repo_data, FetchRepoDataError, FetchRepoDataOptions}, + gateway::{ + error::SubdirNotFoundError, local_subdir::LocalSubdirClient, GatewayError, SourceConfig, + }, + Reporter, +}; + +pub struct RemoteSubdirClient { + pub(super) sparse: LocalSubdirClient, +} + +impl RemoteSubdirClient { + pub async fn new( + channel: Channel, + platform: Platform, + client: ClientWithMiddleware, + cache_dir: PathBuf, + source_config: SourceConfig, + reporter: Option>, + ) -> Result { + let subdir_url = channel.platform_url(platform); + + // Fetch the repodata from the remote server + let repodata = fetch_repo_data( + subdir_url, + client, + cache_dir, + FetchRepoDataOptions { + cache_action: source_config.cache_action, + jlap_enabled: source_config.jlap_enabled, + zstd_enabled: source_config.zstd_enabled, + bz2_enabled: source_config.bz2_enabled, + ..FetchRepoDataOptions::default() + }, + reporter, + ) + .await + .map_err(|e| match e { + FetchRepoDataError::NotFound(e) => { + GatewayError::SubdirNotFoundError(Box::new(SubdirNotFoundError { + channel: channel.clone(), + subdir: platform.to_string(), + source: e.into(), + })) + } + e => GatewayError::FetchRepoDataError(e), + })?; + + // Create a new sparse repodata client that can be used to read records from the + // repodata. + let sparse = simple_spawn_blocking::tokio::run_blocking_task(move || { + LocalSubdirClient::from_file( + &repodata.repo_data_json_path, + channel.clone(), + platform.as_str(), + ) + }) + .await?; + + Ok(Self { sparse }) + } +} diff --git a/crates/rattler_repodata_gateway/src/gateway/remote_subdir/wasm.rs b/crates/rattler_repodata_gateway/src/gateway/remote_subdir/wasm.rs new file mode 100644 index 000000000..034d54a4c --- /dev/null +++ b/crates/rattler_repodata_gateway/src/gateway/remote_subdir/wasm.rs @@ -0,0 +1,61 @@ +use std::sync::Arc; + +use rattler_conda_types::{Channel, Platform}; +use reqwest_middleware::ClientWithMiddleware; + +use crate::{ + fetch::{ + no_cache::{fetch_repo_data, FetchRepoDataOptions}, + FetchRepoDataError, + }, + gateway::{ + error::SubdirNotFoundError, local_subdir::LocalSubdirClient, GatewayError, SourceConfig, + }, + Reporter, +}; + +pub struct RemoteSubdirClient { + pub(super) sparse: LocalSubdirClient, +} + +impl RemoteSubdirClient { + pub async fn new( + channel: Channel, + platform: Platform, + client: ClientWithMiddleware, + source_config: SourceConfig, + reporter: Option>, + ) -> Result { + let subdir_url = channel.platform_url(platform); + + // Fetch the repodata from the remote server + let repodata_bytes = fetch_repo_data( + subdir_url, + client, + FetchRepoDataOptions { + zstd_enabled: source_config.zstd_enabled, + bz2_enabled: source_config.bz2_enabled, + ..FetchRepoDataOptions::default() + }, + reporter, + ) + .await + .map_err(|e| match e { + FetchRepoDataError::NotFound(e) => { + GatewayError::SubdirNotFoundError(Box::new(SubdirNotFoundError { + channel: channel.clone(), + subdir: platform.to_string(), + source: e.into(), + })) + } + e => GatewayError::FetchRepoDataError(e), + })?; + + // Create a new sparse repodata client that can be used to read records from the + // repodata. + let sparse = + LocalSubdirClient::from_bytes(repodata_bytes, channel.clone(), platform.as_str())?; + + Ok(Self { sparse }) + } +} diff --git a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/mod.rs b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/mod.rs index a5a2d5d6f..b25d6d4a1 100644 --- a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/mod.rs +++ b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/mod.rs @@ -1,277 +1,50 @@ -use std::{borrow::Cow, io::Write, path::PathBuf, sync::Arc}; +use std::borrow::Cow; -use crate::{ - fetch::{CacheAction, FetchRepoDataError}, - gateway::{error::SubdirNotFoundError, subdir::SubdirClient}, - reporter::ResponseReporterExt, - GatewayError, Reporter, -}; -use fs_err::tokio as tokio_fs; -use http::{header::CACHE_CONTROL, HeaderValue, StatusCode}; -use rattler_conda_types::{ - Channel, ChannelUrl, PackageName, RepoDataRecord, Shard, ShardedRepodata, -}; +use cfg_if::cfg_if; +use rattler_conda_types::{ChannelUrl, RepoDataRecord, Shard}; use rattler_redaction::Redact; -use reqwest_middleware::ClientWithMiddleware; -use simple_spawn_blocking::tokio::run_blocking_task; use url::Url; -mod index; +use crate::{fetch::FetchRepoDataError, GatewayError}; -pub struct ShardedSubdir { - channel: Channel, - client: ClientWithMiddleware, - shards_base_url: Url, - package_base_url: Url, - sharded_repodata: ShardedRepodata, - cache_dir: PathBuf, - cache_action: CacheAction, - concurrent_requests_semaphore: Arc, -} - -impl ShardedSubdir { - pub async fn new( - channel: Channel, - subdir: String, - client: ClientWithMiddleware, - cache_dir: PathBuf, - cache_action: CacheAction, - concurrent_requests_semaphore: Arc, - reporter: Option<&dyn Reporter>, - ) -> Result { - // Construct the base url for the shards (e.g. `/`). - let index_base_url = channel - .base_url - .url() - .join(&format!("{subdir}/")) - .expect("invalid subdir url"); - - // Fetch the shard index - let sharded_repodata = index::fetch_index( - client.clone(), - &index_base_url, - &cache_dir, - cache_action, - concurrent_requests_semaphore.clone(), - reporter, - ) - .await - .map_err(|e| match e { - GatewayError::ReqwestError(e) if e.status() == Some(StatusCode::NOT_FOUND) => { - GatewayError::SubdirNotFoundError(SubdirNotFoundError { - channel: channel.clone(), - subdir, - source: e.into(), - }) - } - e => e, - })?; - - // Convert the URLs - let shards_base_url = Url::options() - .base_url(Some(&index_base_url)) - .parse(&sharded_repodata.info.shards_base_url) - .map_err(|_e| { - GatewayError::Generic(format!( - "shard index contains invalid `shards_base_url`: {}", - &sharded_repodata.info.shards_base_url - )) - })?; - let package_base_url = Url::options() - .base_url(Some(&index_base_url)) - .parse(&sharded_repodata.info.base_url) - .map_err(|_e| { - GatewayError::Generic(format!( - "shard index contains invalid `base_url`: {}", - &sharded_repodata.info.base_url - )) - })?; - - // Determine the cache directory and make sure it exists. - let cache_dir = cache_dir.join("shards-v1"); - tokio_fs::create_dir_all(&cache_dir) - .await - .map_err(FetchRepoDataError::IoError)?; - - Ok(Self { - channel, - client, - shards_base_url: add_trailing_slash(&shards_base_url).into_owned(), - package_base_url: add_trailing_slash(&package_base_url).into_owned(), - sharded_repodata, - cache_dir, - cache_action, - concurrent_requests_semaphore, - }) +cfg_if! { + if #[cfg(target_arch = "wasm32")] { + mod wasm; + pub use wasm::ShardedSubdir; + } else { + mod tokio; + pub use tokio::ShardedSubdir; } } -#[async_trait::async_trait] -impl SubdirClient for ShardedSubdir { - async fn fetch_package_records( - &self, - name: &PackageName, - reporter: Option<&dyn Reporter>, - ) -> Result, GatewayError> { - // Find the shard that contains the package - let Some(shard) = self.sharded_repodata.shards.get(name.as_normalized()) else { - return Ok(vec![].into()); - }; - - // Check if we already have the shard in the cache. - let shard_cache_path = self.cache_dir.join(format!("{shard:x}.msgpack")); - - // Read the cached shard - if self.cache_action != CacheAction::NoCache { - match tokio_fs::read(&shard_cache_path).await { - Ok(cached_bytes) => { - // Decode the cached shard - return parse_records( - cached_bytes, - self.channel.base_url.clone(), - self.package_base_url.clone(), - ) - .await - .map(Arc::from); - } - Err(err) if err.kind() == std::io::ErrorKind::NotFound => { - // The file is missing from the cache, we need to download - // it. - } - Err(err) => return Err(FetchRepoDataError::IoError(err).into()), - } - } - - if matches!( - self.cache_action, - CacheAction::UseCacheOnly | CacheAction::ForceCacheOnly - ) { - return Err(GatewayError::CacheError(format!( - "the shard for package '{}' is not in the cache", - name.as_source() - ))); - } - - // Download the shard - let shard_url = self - .shards_base_url - .join(&format!("{shard:x}.msgpack.zst")) - .expect("invalid shard url"); - - let shard_request = self - .client - .get(shard_url.clone()) - .header(CACHE_CONTROL, HeaderValue::from_static("no-store")) - .build() - .expect("failed to build shard request"); - - let shard_bytes = { - let _permit = self.concurrent_requests_semaphore.acquire(); - let reporter = reporter.map(|r| (r, r.on_download_start(&shard_url))); - let shard_response = self - .client - .execute(shard_request) - .await - .and_then(|r| r.error_for_status().map_err(Into::into)) - .map_err(FetchRepoDataError::from)?; - - let bytes = shard_response - .bytes_with_progress(reporter) - .await - .map_err(FetchRepoDataError::from)?; - - if let Some((reporter, index)) = reporter { - reporter.on_download_complete(&shard_url, index); - } - - bytes - }; - - let shard_bytes = decode_zst_bytes_async(shard_bytes).await?; - - // Create a future to write the cached bytes to disk - let write_to_cache_fut = write_shard_to_cache(shard_cache_path, shard_bytes.clone()); - - // Create a future to parse the records from the shard - let parse_records_fut = parse_records( - shard_bytes, - self.channel.base_url.clone(), - self.package_base_url.clone(), - ); - - // Await both futures concurrently. - let (_, records) = tokio::try_join!(write_to_cache_fut, parse_records_fut)?; - - Ok(records.into()) - } - - fn package_names(&self) -> Vec { - self.sharded_repodata.shards.keys().cloned().collect() +/// Returns the URL with a trailing slash if it doesn't already have one. +fn add_trailing_slash(url: &Url) -> Cow<'_, Url> { + let path = url.path(); + if path.ends_with('/') { + Cow::Borrowed(url) + } else { + let mut url = url.clone(); + url.set_path(&format!("{path}/")); + Cow::Owned(url) } } -/// Atomically writes the shard bytes to the cache. -async fn write_shard_to_cache( - shard_cache_path: PathBuf, - shard_bytes: Vec, -) -> Result<(), GatewayError> { - run_blocking_task(move || { - let shard_cache_parent_path = shard_cache_path - .parent() - .expect("file path must have a parent"); - let mut temp_file = tempfile::Builder::new() - .tempfile_in( - shard_cache_path - .parent() - .expect("file path must have a parent"), - ) - .map_err(|e| { - GatewayError::IoError( - format!( - "failed to create temporary file to write shard in {}", - shard_cache_parent_path.display() - ), - e, - ) - })?; - temp_file.write_all(&shard_bytes).map_err(|e| { - GatewayError::IoError( - format!( - "failed to write shard to temporary file in {}", - shard_cache_parent_path.display() - ), - e, - ) - })?; - match temp_file.persist(&shard_cache_path) { - Ok(_) => Ok(()), - Err(e) => { - if shard_cache_path.is_file() { - // The file already exists, we can ignore the error. - Ok(()) - } else { - Err(GatewayError::IoError( - format!("failed to persist shard to {}", shard_cache_path.display()), - e.error, - )) - } - } - } - }) - .await -} - async fn decode_zst_bytes_async + Send + 'static>( bytes: R, ) -> Result, GatewayError> { - run_blocking_task(move || match zstd::decode_all(bytes.as_ref()) { + let decode = move || match zstd::decode_all(bytes.as_ref()) { Ok(decoded) => Ok(decoded), Err(err) => Err(GatewayError::IoError( "failed to decode zstd shard".to_string(), err, )), - }) - .await + }; + + #[cfg(target_arch = "wasm32")] + return decode(); + + #[cfg(not(target_arch = "wasm32"))] + simple_spawn_blocking::tokio::run_blocking_task(decode).await } async fn parse_records + Send + 'static>( @@ -279,7 +52,7 @@ async fn parse_records + Send + 'static>( channel_base_url: ChannelUrl, base_url: Url, ) -> Result, GatewayError> { - run_blocking_task(move || { + let parse = move || { // let shard = // serde_json::from_slice::(bytes.as_ref()). // map_err(std::io::Error::from)?; @@ -299,18 +72,11 @@ async fn parse_records + Send + 'static>( file_name, }) .collect()) - }) - .await -} + }; -/// Returns the URL with a trailing slash if it doesn't already have one. -fn add_trailing_slash(url: &Url) -> Cow<'_, Url> { - let path = url.path(); - if path.ends_with('/') { - Cow::Borrowed(url) - } else { - let mut url = url.clone(); - url.set_path(&format!("{path}/")); - Cow::Owned(url) - } + #[cfg(target_arch = "wasm32")] + return parse(); + + #[cfg(not(target_arch = "wasm32"))] + simple_spawn_blocking::tokio::run_blocking_task(parse).await } diff --git a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/index.rs b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/index.rs similarity index 97% rename from crates/rattler_repodata_gateway/src/gateway/sharded_subdir/index.rs rename to crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/index.rs index 799810cb4..333c260b5 100644 --- a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/index.rs +++ b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/index.rs @@ -17,13 +17,9 @@ use tokio::{ use url::Url; use super::ShardedRepodata; -use crate::{ - fetch::CacheAction, reporter::ResponseReporterExt, utils::url_to_cache_filename, GatewayError, - Reporter, -}; - -/// Magic number that identifies the cache file format. -const MAGIC_NUMBER: &[u8] = b"SHARD-CACHE-V1"; +use crate::fetch::CacheAction; +use crate::gateway::sharded_subdir::decode_zst_bytes_async; +use crate::{reporter::ResponseReporterExt, utils::url_to_cache_filename, GatewayError, Reporter}; const REPODATA_SHARDS_FILENAME: &str = "repodata_shards.msgpack.zst"; @@ -54,7 +50,7 @@ pub async fn fetch_index( } // Decompress the bytes - let decoded_bytes = Bytes::from(super::decode_zst_bytes_async(bytes).await?); + let decoded_bytes = Bytes::from(decode_zst_bytes_async(bytes).await?); // Write the cache to disk if the policy allows it. let cache_fut = @@ -267,8 +263,11 @@ pub async fn fetch_index( .await } +/// Magic number that identifies the cache file format. +const MAGIC_NUMBER: &[u8] = b"SHARD-CACHE-V1"; + /// Writes the shard index cache to disk. -async fn write_shard_index_cache( +pub async fn write_shard_index_cache( cache_file: &mut File, policy: CachePolicy, decoded_bytes: Bytes, @@ -298,7 +297,7 @@ async fn write_shard_index_cache( } /// Read the shard index from a reader and deserialize it. -async fn read_shard_index_from_reader( +pub async fn read_shard_index_from_reader( reader: &mut BufReader, ) -> Result { // Read the file to memory @@ -353,7 +352,7 @@ async fn read_cached_index( /// A helper struct to make it easier to construct something that implements /// [`RequestLike`]. -struct SimpleRequest { +pub struct SimpleRequest { uri: Uri, method: Method, headers: HeaderMap, diff --git a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/mod.rs b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/mod.rs new file mode 100644 index 000000000..481878ffa --- /dev/null +++ b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/tokio/mod.rs @@ -0,0 +1,262 @@ +mod index; + +use std::{io::Write, path::PathBuf, sync::Arc}; + +use fs_err::tokio as tokio_fs; +use http::{header::CACHE_CONTROL, HeaderValue, StatusCode}; +use rattler_conda_types::{Channel, PackageName, RepoDataRecord, ShardedRepodata}; +use reqwest_middleware::ClientWithMiddleware; +use simple_spawn_blocking::tokio::run_blocking_task; +use url::Url; + +use super::{add_trailing_slash, decode_zst_bytes_async, parse_records}; +use crate::fetch::CacheAction; +use crate::{ + fetch::FetchRepoDataError, + gateway::{error::SubdirNotFoundError, subdir::SubdirClient}, + reporter::ResponseReporterExt, + GatewayError, Reporter, +}; + +pub struct ShardedSubdir { + channel: Channel, + client: ClientWithMiddleware, + shards_base_url: Url, + package_base_url: Url, + sharded_repodata: ShardedRepodata, + concurrent_requests_semaphore: Arc, + cache_dir: PathBuf, + cache_action: CacheAction, +} + +impl ShardedSubdir { + pub async fn new( + channel: Channel, + subdir: String, + client: ClientWithMiddleware, + cache_dir: PathBuf, + cache_action: CacheAction, + concurrent_requests_semaphore: Arc, + reporter: Option<&dyn Reporter>, + ) -> Result { + // Construct the base url for the shards (e.g. `/`). + let index_base_url = channel + .base_url + .url() + .join(&format!("{subdir}/")) + .expect("invalid subdir url"); + + // Fetch the shard index + let sharded_repodata = index::fetch_index( + client.clone(), + &index_base_url, + &cache_dir, + cache_action, + concurrent_requests_semaphore.clone(), + reporter, + ) + .await + .map_err(|e| match e { + GatewayError::ReqwestError(e) if e.status() == Some(StatusCode::NOT_FOUND) => { + GatewayError::SubdirNotFoundError(Box::new(SubdirNotFoundError { + channel: channel.clone(), + subdir, + source: e.into(), + })) + } + e => e, + })?; + + // Convert the URLs + let shards_base_url = Url::options() + .base_url(Some(&index_base_url)) + .parse(&sharded_repodata.info.shards_base_url) + .map_err(|_e| { + GatewayError::Generic(format!( + "shard index contains invalid `shards_base_url`: {}", + &sharded_repodata.info.shards_base_url + )) + })?; + let package_base_url = Url::options() + .base_url(Some(&index_base_url)) + .parse(&sharded_repodata.info.base_url) + .map_err(|_e| { + GatewayError::Generic(format!( + "shard index contains invalid `base_url`: {}", + &sharded_repodata.info.base_url + )) + })?; + + // Determine the cache directory and make sure it exists. + let cache_dir = cache_dir.join("shards-v1"); + tokio_fs::create_dir_all(&cache_dir) + .await + .map_err(FetchRepoDataError::IoError)?; + + Ok(Self { + channel, + client, + shards_base_url: add_trailing_slash(&shards_base_url).into_owned(), + package_base_url: add_trailing_slash(&package_base_url).into_owned(), + sharded_repodata, + cache_dir, + cache_action, + concurrent_requests_semaphore, + }) + } +} + +#[async_trait::async_trait] +impl SubdirClient for ShardedSubdir { + async fn fetch_package_records( + &self, + name: &PackageName, + reporter: Option<&dyn Reporter>, + ) -> Result, GatewayError> { + // Find the shard that contains the package + let Some(shard) = self.sharded_repodata.shards.get(name.as_normalized()) else { + return Ok(vec![].into()); + }; + + // Check if we already have the shard in the cache. + let shard_cache_path = self.cache_dir.join(format!("{shard:x}.msgpack")); + + // Read the cached shard + if self.cache_action != CacheAction::NoCache { + match tokio_fs::read(&shard_cache_path).await { + Ok(cached_bytes) => { + // Decode the cached shard + return parse_records( + cached_bytes, + self.channel.base_url.clone(), + self.package_base_url.clone(), + ) + .await + .map(Arc::from); + } + Err(err) if err.kind() == std::io::ErrorKind::NotFound => { + // The file is missing from the cache, we need to download + // it. + } + Err(err) => return Err(FetchRepoDataError::IoError(err).into()), + } + } + + if matches!( + self.cache_action, + CacheAction::UseCacheOnly | CacheAction::ForceCacheOnly + ) { + return Err(GatewayError::CacheError(format!( + "the shard for package '{}' is not in the cache", + name.as_source() + ))); + } + + // Download the shard + let shard_url = self + .shards_base_url + .join(&format!("{shard:x}.msgpack.zst")) + .expect("invalid shard url"); + + let shard_request = self + .client + .get(shard_url.clone()) + .header(CACHE_CONTROL, HeaderValue::from_static("no-store")) + .build() + .expect("failed to build shard request"); + + let shard_bytes = { + let _permit = self.concurrent_requests_semaphore.acquire(); + let reporter = reporter.map(|r| (r, r.on_download_start(&shard_url))); + let shard_response = self + .client + .execute(shard_request) + .await + .and_then(|r| r.error_for_status().map_err(Into::into)) + .map_err(FetchRepoDataError::from)?; + + let bytes = shard_response + .bytes_with_progress(reporter) + .await + .map_err(FetchRepoDataError::from)?; + + if let Some((reporter, index)) = reporter { + reporter.on_download_complete(&shard_url, index); + } + + bytes + }; + + let shard_bytes = decode_zst_bytes_async(shard_bytes).await?; + + // Create a future to write the cached bytes to disk + let write_to_cache_fut = write_shard_to_cache(shard_cache_path, shard_bytes.clone()); + + // Create a future to parse the records from the shard + let parse_records_fut = parse_records( + shard_bytes, + self.channel.base_url.clone(), + self.package_base_url.clone(), + ); + + // Await both futures concurrently. + let (_, records) = tokio::try_join!(write_to_cache_fut, parse_records_fut)?; + + Ok(records.into()) + } + + fn package_names(&self) -> Vec { + self.sharded_repodata.shards.keys().cloned().collect() + } +} + +/// Atomically writes the shard bytes to the cache. +async fn write_shard_to_cache( + shard_cache_path: PathBuf, + shard_bytes: Vec, +) -> Result<(), GatewayError> { + run_blocking_task(move || { + let shard_cache_parent_path = shard_cache_path + .parent() + .expect("file path must have a parent"); + let mut temp_file = tempfile::Builder::new() + .tempfile_in( + shard_cache_path + .parent() + .expect("file path must have a parent"), + ) + .map_err(|e| { + GatewayError::IoError( + format!( + "failed to create temporary file to write shard in {}", + shard_cache_parent_path.display() + ), + e, + ) + })?; + temp_file.write_all(&shard_bytes).map_err(|e| { + GatewayError::IoError( + format!( + "failed to write shard to temporary file in {}", + shard_cache_parent_path.display() + ), + e, + ) + })?; + match temp_file.persist(&shard_cache_path) { + Ok(_) => Ok(()), + Err(e) => { + if shard_cache_path.is_file() { + // The file already exists, we can ignore the error. + Ok(()) + } else { + Err(GatewayError::IoError( + format!("failed to persist shard to {}", shard_cache_path.display()), + e.error, + )) + } + } + } + }) + .await +} diff --git a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/index.rs b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/index.rs new file mode 100644 index 000000000..e201a7bdd --- /dev/null +++ b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/index.rs @@ -0,0 +1,70 @@ +use std::sync::Arc; + +use bytes::Bytes; +use reqwest_middleware::ClientWithMiddleware; +use url::Url; + +use super::ShardedRepodata; +use crate::{ + gateway::sharded_subdir::decode_zst_bytes_async, reporter::ResponseReporterExt, GatewayError, + Reporter, +}; + +const REPODATA_SHARDS_FILENAME: &str = "repodata_shards.msgpack.zst"; + +// Fetches the shard index from the url or read it from the cache. +pub async fn fetch_index( + client: ClientWithMiddleware, + channel_base_url: &Url, + concurrent_requests_semaphore: Arc, + reporter: Option<&dyn Reporter>, +) -> Result { + // Determine the actual URL to use for the request + let shards_url = channel_base_url + .join(REPODATA_SHARDS_FILENAME) + .expect("invalid shard base url"); + + // Construct the actual request that we will send + let request = client + .get(shards_url.clone()) + .build() + .expect("failed to build request for shard index"); + + // Acquire a permit to do a request + let _request_permit = concurrent_requests_semaphore.acquire().await; + + // Do a fresh requests + let reporter = reporter.map(|r| (r, r.on_download_start(&shards_url))); + let response = client + .execute( + request + .try_clone() + .expect("failed to clone initial request"), + ) + .await?; + + let response = response.error_for_status()?; + + // Read the bytes of the response + let response_url = response.url().clone(); + let bytes = response.bytes_with_progress(reporter).await?; + + if let Some((reporter, index)) = reporter { + reporter.on_download_complete(&response_url, index); + } + + // Decompress the bytes + let decoded_bytes = Bytes::from(decode_zst_bytes_async(bytes).await?); + + // Parse the bytes + let sharded_index = rmp_serde::from_slice(&decoded_bytes) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string())) + .map_err(|e| { + GatewayError::IoError( + format!("failed to parse shard index from {response_url}"), + e, + ) + })?; + + Ok(sharded_index) +} diff --git a/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/mod.rs b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/mod.rs new file mode 100644 index 000000000..60e7f0d08 --- /dev/null +++ b/crates/rattler_repodata_gateway/src/gateway/sharded_subdir/wasm/mod.rs @@ -0,0 +1,159 @@ +use std::sync::Arc; + +use http::StatusCode; +use rattler_conda_types::{Channel, PackageName, RepoDataRecord, ShardedRepodata}; +use reqwest_middleware::ClientWithMiddleware; +use url::Url; + +use super::add_trailing_slash; + +mod index; + +use crate::{ + fetch::FetchRepoDataError, + gateway::{ + error::SubdirNotFoundError, + sharded_subdir::{decode_zst_bytes_async, parse_records}, + subdir::SubdirClient, + }, + reporter::ResponseReporterExt, + GatewayError, Reporter, +}; + +pub struct ShardedSubdir { + channel: Channel, + client: ClientWithMiddleware, + shards_base_url: Url, + package_base_url: Url, + sharded_repodata: ShardedRepodata, + concurrent_requests_semaphore: Arc, +} + +impl ShardedSubdir { + pub async fn new( + channel: Channel, + subdir: String, + client: ClientWithMiddleware, + concurrent_requests_semaphore: Arc, + reporter: Option<&dyn Reporter>, + ) -> Result { + // Construct the base url for the shards (e.g. `/`). + let index_base_url = channel + .base_url + .url() + .join(&format!("{subdir}/")) + .expect("invalid subdir url"); + + // Fetch the shard index + let sharded_repodata = index::fetch_index( + client.clone(), + &index_base_url, + concurrent_requests_semaphore.clone(), + reporter, + ) + .await + .map_err(|e| match e { + GatewayError::ReqwestError(e) if e.status() == Some(StatusCode::NOT_FOUND) => { + GatewayError::SubdirNotFoundError(Box::new(SubdirNotFoundError { + channel: channel.clone(), + subdir, + source: e.into(), + })) + } + e => e, + })?; + + // Convert the URLs + let shards_base_url = Url::options() + .base_url(Some(&index_base_url)) + .parse(&sharded_repodata.info.shards_base_url) + .map_err(|_e| { + GatewayError::Generic(format!( + "shard index contains invalid `shards_base_url`: {}", + &sharded_repodata.info.shards_base_url + )) + })?; + let package_base_url = Url::options() + .base_url(Some(&index_base_url)) + .parse(&sharded_repodata.info.base_url) + .map_err(|_e| { + GatewayError::Generic(format!( + "shard index contains invalid `base_url`: {}", + &sharded_repodata.info.base_url + )) + })?; + + Ok(Self { + channel, + client, + shards_base_url: add_trailing_slash(&shards_base_url).into_owned(), + package_base_url: add_trailing_slash(&package_base_url).into_owned(), + sharded_repodata, + concurrent_requests_semaphore, + }) + } +} + +#[async_trait::async_trait(?Send)] +impl SubdirClient for ShardedSubdir { + async fn fetch_package_records( + &self, + name: &PackageName, + reporter: Option<&dyn Reporter>, + ) -> Result, GatewayError> { + // Find the shard that contains the package + let Some(shard) = self.sharded_repodata.shards.get(name.as_normalized()) else { + return Ok(vec![].into()); + }; + + // Download the shard + let shard_url = self + .shards_base_url + .join(&format!("{shard:x}.msgpack.zst")) + .expect("invalid shard url"); + + let shard_request = self + .client + .get(shard_url.clone()) + .build() + .expect("failed to build shard request"); + + let shard_bytes = { + let _permit = self.concurrent_requests_semaphore.acquire(); + let reporter = reporter.map(|r| (r, r.on_download_start(&shard_url))); + let shard_response = self + .client + .execute(shard_request) + .await + .and_then(|r| r.error_for_status().map_err(Into::into)) + .map_err(FetchRepoDataError::from)?; + + let bytes = shard_response + .bytes_with_progress(reporter) + .await + .map_err(FetchRepoDataError::from)?; + + if let Some((reporter, index)) = reporter { + reporter.on_download_complete(&shard_url, index); + } + + bytes + }; + + let shard_bytes = decode_zst_bytes_async(shard_bytes).await?; + + // Create a future to parse the records from the shard + let records = parse_records( + shard_bytes, + self.channel.base_url.clone(), + self.package_base_url.clone(), + ) + .await?; + + Ok(records.into()) + } + + fn package_names(&self) -> Vec { + self.sharded_repodata.shards.keys().cloned().collect() + } +} diff --git a/crates/rattler_repodata_gateway/src/gateway/subdir.rs b/crates/rattler_repodata_gateway/src/gateway/subdir.rs index b29f74f33..612a04708 100644 --- a/crates/rattler_repodata_gateway/src/gateway/subdir.rs +++ b/crates/rattler_repodata_gateway/src/gateway/subdir.rs @@ -1,11 +1,11 @@ -use super::GatewayError; -use crate::gateway::PendingOrFetched; -use crate::Reporter; -use dashmap::mapref::entry::Entry; -use dashmap::DashMap; -use rattler_conda_types::{PackageName, RepoDataRecord}; use std::sync::Arc; -use tokio::{sync::broadcast, task::JoinError}; + +use dashmap::{mapref::entry::Entry, DashMap}; +use rattler_conda_types::{PackageName, RepoDataRecord}; +use tokio::sync::broadcast; + +use super::GatewayError; +use crate::{gateway::PendingOrFetched, Reporter}; pub enum Subdir { /// The subdirectory is missing from the channel, it is considered empty. @@ -25,7 +25,8 @@ impl Subdir { } } -/// Fetches and caches repodata records by package name for a specific subdirectory of a channel. +/// Fetches and caches repodata records by package name for a specific +/// subdirectory of a channel. pub struct SubdirData { /// The client to use to fetch repodata. client: Arc, @@ -107,40 +108,28 @@ impl SubdirData { } }; - // At this point we have exclusive write access to this specific entry. All other tasks - // will find a pending entry and will wait for the records to become available. + // At this point we have exclusive write access to this specific entry. All + // other tasks will find a pending entry and will wait for the records + // to become available. // - // Let's start by fetching the records. If an error occurs we immediately return the error. - // This will drop the sender and all other waiting tasks will receive an error. - let records = match tokio::spawn({ - let client = self.client.clone(); - let name = name.clone(); - async move { - client - .fetch_package_records(&name, reporter.as_deref()) - .await - } - }) - .await - .map_err(JoinError::try_into_panic) + // Let's start by fetching the records. If an error occurs we immediately return + // the error. This will drop the sender and all other waiting tasks will + // receive an error. + let records = match self + .client + .fetch_package_records(name, reporter.as_deref()) + .await { - Ok(Ok(records)) => records, - Ok(Err(err)) => return Err(err), - Err(Ok(panic)) => std::panic::resume_unwind(panic), - Err(Err(_)) => { - return Err(GatewayError::IoError( - "fetching records was cancelled".to_string(), - std::io::ErrorKind::Interrupted.into(), - )); - } + Ok(records) => records, + Err(err) => return Err(err), }; // Store the fetched files in the entry. self.records .insert(name.clone(), PendingOrFetched::Fetched(records.clone())); - // Send the records to all waiting tasks. We don't care if there are no receivers so we - // drop the error. + // Send the records to all waiting tasks. We don't care if there are no + // receivers so we drop the error. let _ = sender.send(records.clone()); Ok(records) @@ -152,9 +141,11 @@ impl SubdirData { } /// A client that can be used to fetch repodata for a specific subdirectory. -#[async_trait::async_trait] +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] pub trait SubdirClient: Send + Sync { - /// Fetches all repodata records for the package with the given name in a channel subdirectory. + /// Fetches all repodata records for the package with the given name in a + /// channel subdirectory. async fn fetch_package_records( &self, name: &PackageName, diff --git a/crates/rattler_repodata_gateway/src/gateway/subdir_builder.rs b/crates/rattler_repodata_gateway/src/gateway/subdir_builder.rs index 85a9a3e18..016c73c64 100644 --- a/crates/rattler_repodata_gateway/src/gateway/subdir_builder.rs +++ b/crates/rattler_repodata_gateway/src/gateway/subdir_builder.rs @@ -102,11 +102,11 @@ impl<'g> SubdirBuilder<'g> { Ok(Subdir::NotFound) } Err(GatewayError::FetchRepoDataError(FetchRepoDataError::NotFound(err))) => { - Err(SubdirNotFoundError { + Err(Box::new(SubdirNotFoundError { subdir: self.platform.to_string(), channel: self.channel.clone(), source: err.into(), - } + }) .into()) } Err(err) => Err(err), @@ -121,6 +121,7 @@ impl<'g> SubdirBuilder<'g> { self.channel.clone(), self.platform, self.gateway.client.clone(), + #[cfg(not(target_arch = "wasm32"))] self.gateway.cache.clone(), source_config.clone(), self.reporter.clone(), @@ -131,14 +132,16 @@ impl<'g> SubdirBuilder<'g> { async fn build_sharded( &self, - source_config: &SourceConfig, + _source_config: &SourceConfig, ) -> Result { let client = sharded_subdir::ShardedSubdir::new( self.channel.clone(), self.platform.to_string(), self.gateway.client.clone(), + #[cfg(not(target_arch = "wasm32"))] self.gateway.cache.clone(), - source_config.cache_action, + #[cfg(not(target_arch = "wasm32"))] + _source_config.cache_action, self.gateway.concurrent_requests_semaphore.clone(), self.reporter.as_deref(), ) @@ -148,12 +151,17 @@ impl<'g> SubdirBuilder<'g> { } async fn build_local(&self, path: &Path) -> Result { - let client = LocalSubdirClient::from_channel_subdir( - &path.join("repodata.json"), - self.channel.clone(), - self.platform.as_str(), - ) - .await?; + let channel = self.channel.clone(); + let platform = self.platform; + let path = path.join("repodata.json"); + let build_client = + move || LocalSubdirClient::from_file(&path, channel.clone(), platform.as_str()); + + #[cfg(target_arch = "wasm32")] + let client = build_client()?; + #[cfg(not(target_arch = "wasm32"))] + let client = simple_spawn_blocking::tokio::run_blocking_task(build_client).await?; + Ok(SubdirData::from_client(client)) } } diff --git a/crates/rattler_repodata_gateway/src/lib.rs b/crates/rattler_repodata_gateway/src/lib.rs index 87be23295..130f185a2 100644 --- a/crates/rattler_repodata_gateway/src/lib.rs +++ b/crates/rattler_repodata_gateway/src/lib.rs @@ -26,7 +26,7 @@ //! using the [`fetch::fetch_repo_data`] function: //! //! ```no_run -//! use std::{path::PathBuf, default::Default}; +//! use std::{default::Default, path::PathBuf}; //! use reqwest::Client; //! use reqwest_middleware::ClientWithMiddleware; //! use url::Url; diff --git a/crates/rattler_repodata_gateway/src/reporter.rs b/crates/rattler_repodata_gateway/src/reporter.rs index 6a8c8ccdd..9796d0516 100644 --- a/crates/rattler_repodata_gateway/src/reporter.rs +++ b/crates/rattler_repodata_gateway/src/reporter.rs @@ -62,6 +62,7 @@ pub trait Reporter: Send + Sync { fn on_jlap_completed(&self, _index: usize) {} } +#[allow(dead_code)] pub(crate) trait ResponseReporterExt { /// Converts a response into a stream of bytes, notifying a reporter of the progress. fn byte_stream_with_progress( diff --git a/crates/rattler_repodata_gateway/src/sparse/mod.rs b/crates/rattler_repodata_gateway/src/sparse/mod.rs index b7e69473d..38c28bffc 100644 --- a/crates/rattler_repodata_gateway/src/sparse/mod.rs +++ b/crates/rattler_repodata_gateway/src/sparse/mod.rs @@ -12,7 +12,6 @@ use std::{ use bytes::Bytes; use fs_err as fs; -use futures::{stream, StreamExt, TryFutureExt, TryStreamExt}; use itertools::Itertools; use rattler_conda_types::{ compute_package_url, Channel, ChannelInfo, PackageName, PackageRecord, RepoDataRecord, @@ -47,6 +46,7 @@ pub struct SparseRepoData { enum SparseRepoDataInner { /// The repo data is stored as a memory mapped file + #[cfg(any(unix, windows))] Memmapped(MemmappedSparseRepoDataInner), /// The repo data is stored as `Bytes` Bytes(BytesSparseRepoDataInner), @@ -55,50 +55,53 @@ enum SparseRepoDataInner { impl SparseRepoDataInner { fn borrow_repo_data(&self) -> &LazyRepoData<'_> { match self { - SparseRepoDataInner::Memmapped(inner) => inner.borrow_repo_data(), - SparseRepoDataInner::Bytes(inner) => inner.borrow_repo_data(), + #[cfg(any(unix, windows))] + SparseRepoDataInner::Memmapped(inner) => inner.borrow_dependent(), + SparseRepoDataInner::Bytes(inner) => inner.borrow_dependent(), } } } -/// A struct that holds a memory map of a `repodata.json` file and also a -/// self-referential field which indexes the data in the memory map with a -/// sparsely parsed json struct. See [`LazyRepoData`]. -#[ouroboros::self_referencing] -struct MemmappedSparseRepoDataInner { - /// Memory map of the `repodata.json` file - memory_map: memmap2::Mmap, - - /// Sparsely parsed json content of the memory map. This data struct holds - /// references into the memory map so we have to use ouroboros to make - /// this legal. - #[borrows(memory_map)] - #[covariant] - repo_data: LazyRepoData<'this>, -} - -/// A struct that holds a reference to the bytes of a `repodata.json` file and -/// also a self-referential field which indexes the data in the `bytes` with a -/// sparsely parsed json struct. See [`LazyRepoData`]. -#[ouroboros::self_referencing] -struct BytesSparseRepoDataInner { - /// Bytes of the `repodata.json` file - bytes: Bytes, - - /// Sparsely parsed json content of the file's bytes. This data struct holds - /// references into the bytes so we have to use ouroboros to make this - /// legal. - #[borrows(bytes)] - #[covariant] - repo_data: LazyRepoData<'this>, -} +// A struct that holds a memory map of a `repodata.json` file and also a +// self-referential field which indexes the data in the memory map with a +// sparsely parsed json struct. See [`LazyRepoData`]. +#[cfg(any(unix, windows))] +self_cell::self_cell!( + struct MemmappedSparseRepoDataInner { + // Memory map of the `repodata.json` file + owner: memmap2::Mmap, + + // Sparsely parsed json content of the memory map. This data struct holds + // references into the memory map so we have to use ouroboros to make + // this legal. + #[covariant] + dependent: LazyRepoData, + } +); + +// A struct that holds a reference to the bytes of a `repodata.json` file and +// also a self-referential field which indexes the data in the `bytes` with a +// sparsely parsed json struct. See [`LazyRepoData`]. +self_cell::self_cell!( + struct BytesSparseRepoDataInner { + // Bytes of the `repodata.json` file + owner: Bytes, + + // Sparsely parsed json content of the file's bytes. This data struct holds + // references into the bytes so we have to use ouroboros to make this + // legal. + #[covariant] + dependent: LazyRepoData, + } +); impl SparseRepoData { /// Construct an instance of self from a file on disk and a [`Channel`]. /// /// The `patch_function` can be used to patch the package record after it /// has been parsed (e.g. to add `pip` to `python`). - pub fn new( + #[cfg(any(unix, windows))] + pub fn from_file( channel: Channel, subdir: impl Into, path: impl AsRef, @@ -107,19 +110,36 @@ impl SparseRepoData { let file = fs::File::open(path.as_ref().to_owned())?; let memory_map = unsafe { memmap2::Mmap::map(&file) }?; Ok(SparseRepoData { - inner: SparseRepoDataInner::Memmapped( - MemmappedSparseRepoDataInnerTryBuilder { - memory_map, - repo_data_builder: |memory_map| serde_json::from_slice(memory_map.as_ref()), - } - .try_build()?, - ), + inner: SparseRepoDataInner::Memmapped(MemmappedSparseRepoDataInner::try_new( + memory_map, + |memory_map| serde_json::from_slice(memory_map.as_ref()), + )?), subdir: subdir.into(), channel, patch_record_fn: patch_function, }) } + /// Construct an instance of self from a file on disk and a [`Channel`]. + /// + /// The `patch_function` can be used to patch the package record after it + /// has been parsed (e.g. to add `pip` to `python`). + #[cfg(not(any(windows, unix)))] + pub fn from_file( + channel: Channel, + subdir: impl Into, + path: impl AsRef, + patch_function: Option, + ) -> Result { + let bytes = fs::read(path)?; + Ok(Self::from_bytes( + channel, + subdir, + bytes.into(), + patch_function, + )?) + } + /// Construct an instance of self from a bytes and a [`Channel`]. /// /// The `patch_function` can be used to patch the package record after it @@ -131,13 +151,9 @@ impl SparseRepoData { patch_function: Option, ) -> Result { Ok(Self { - inner: SparseRepoDataInner::Bytes( - BytesSparseRepoDataInnerTryBuilder { - bytes, - repo_data_builder: |bytes| serde_json::from_slice(bytes), - } - .try_build()?, - ), + inner: SparseRepoDataInner::Bytes(BytesSparseRepoDataInner::try_new(bytes, |bytes| { + serde_json::from_slice(bytes) + })?), channel, subdir: subdir.into(), patch_record_fn: patch_function, @@ -336,19 +352,22 @@ fn parse_records<'i>( /// (and their dependencies). Records for the specified packages are loaded from /// the repodata files. The `patch_record_fn` is applied to each record after it /// has been parsed and can mutate the record after it has been loaded. +#[cfg(any(unix, windows))] pub async fn load_repo_data_recursively( repo_data_paths: impl IntoIterator, impl AsRef)>, package_names: impl IntoIterator, patch_function: Option, ) -> Result>, io::Error> { + use futures::{StreamExt, TryFutureExt, TryStreamExt}; + // Open the different files and memory map them to get access to their bytes. Do // this in parallel. - let lazy_repo_data = stream::iter(repo_data_paths) + let lazy_repo_data = futures::stream::iter(repo_data_paths) .map(|(channel, subdir, path)| { let path = path.as_ref().to_path_buf(); let subdir = subdir.into(); tokio::task::spawn_blocking(move || { - SparseRepoData::new(channel, subdir, path, patch_function) + SparseRepoData::from_file(channel, subdir, path, patch_function) }) .unwrap_or_else(|r| match r.try_into_panic() { Ok(panic) => std::panic::resume_unwind(panic), diff --git a/crates/rattler_repodata_gateway/src/utils/body.rs b/crates/rattler_repodata_gateway/src/utils/body.rs index b94545b06..2d26baff0 100644 --- a/crates/rattler_repodata_gateway/src/utils/body.rs +++ b/crates/rattler_repodata_gateway/src/utils/body.rs @@ -11,6 +11,7 @@ use std::{ /// A helper trait to convert a stream of bytes coming from a request body into /// another type. +#[allow(dead_code)] pub trait BodyStreamExt: Sized { /// Reads the contents of a body stream as bytes. fn bytes(self) -> BytesCollect; diff --git a/crates/rattler_repodata_gateway/src/utils/encoding.rs b/crates/rattler_repodata_gateway/src/utils/encoding.rs index 4156bacd1..2a9decda7 100644 --- a/crates/rattler_repodata_gateway/src/utils/encoding.rs +++ b/crates/rattler_repodata_gateway/src/utils/encoding.rs @@ -4,7 +4,7 @@ use std::task::{Context, Poll}; use tokio::io::{AsyncBufRead, AsyncRead, ReadBuf}; /// Describes the encoding of a stream -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum Encoding { Passthrough, GZip, diff --git a/crates/rattler_repodata_gateway/src/utils/mod.rs b/crates/rattler_repodata_gateway/src/utils/mod.rs index 447c141e1..8a2c3abb5 100644 --- a/crates/rattler_repodata_gateway/src/utils/mod.rs +++ b/crates/rattler_repodata_gateway/src/utils/mod.rs @@ -1,9 +1,5 @@ -use std::fmt::Write; - -use ::url::Url; pub use body::BodyStreamExt; pub use encoding::{AsyncEncoding, Encoding}; -pub use flock::LockedFile; mod encoding; @@ -11,10 +7,17 @@ mod encoding; pub(crate) mod simple_channel_server; mod body; +#[cfg(not(target_arch = "wasm32"))] mod flock; +#[cfg(not(target_arch = "wasm32"))] +pub use flock::LockedFile; + /// Convert a URL to a cache filename -pub(crate) fn url_to_cache_filename(url: &Url) -> String { +#[cfg(not(target_arch = "wasm32"))] +pub(crate) fn url_to_cache_filename(url: &::url::Url) -> String { + use std::fmt::Write; + // Start Rant: // This function mimics behavior from Mamba which itself mimics this behavior // from Conda. However, I find this function absolutely ridiculous, it diff --git a/crates/rattler_solve/Cargo.toml b/crates/rattler_solve/Cargo.toml index c1c6b062c..49acfe12d 100644 --- a/crates/rattler_solve/Cargo.toml +++ b/crates/rattler_solve/Cargo.toml @@ -24,14 +24,14 @@ rattler_libsolv_c = { path = "../rattler_libsolv_c", version = "1.1.2", default- resolvo = { workspace = true, optional = true } futures = { workspace = true, optional = true } serde = { workspace = true, optional = true } -indexmap = { workspace = true} +indexmap = { workspace = true } [dev-dependencies] criterion = { workspace = true } insta = { workspace = true, features = ["yaml"] } once_cell = { workspace = true } rattler_repodata_gateway = { path = "../rattler_repodata_gateway", default-features = false, features = [ - "sparse", + "sparse" ] } rstest = { workspace = true } serde_json = { workspace = true } diff --git a/crates/rattler_solve/benches/bench.rs b/crates/rattler_solve/benches/bench.rs index 824336ecf..500159bd6 100644 --- a/crates/rattler_solve/benches/bench.rs +++ b/crates/rattler_solve/benches/bench.rs @@ -21,7 +21,7 @@ fn conda_json_path_noarch() -> String { } fn read_sparse_repodata(path: &str) -> SparseRepoData { - SparseRepoData::new( + SparseRepoData::from_file( Channel::from_str( "dummy", &ChannelConfig::default_with_root_dir(std::env::current_dir().unwrap()), diff --git a/crates/rattler_solve/benches/sorting_bench.rs b/crates/rattler_solve/benches/sorting_bench.rs index 5b99bd9aa..da3e74a30 100644 --- a/crates/rattler_solve/benches/sorting_bench.rs +++ b/crates/rattler_solve/benches/sorting_bench.rs @@ -67,7 +67,7 @@ fn criterion_benchmark(c: &mut Criterion) { let repodata_json_path = channel_path.join("linux-64").join("repodata.json"); let channel = Channel::from_directory(&channel_path); - let sparse_repo_data = SparseRepoData::new(channel, "linux-64", repodata_json_path, None) + let sparse_repo_data = SparseRepoData::from_file(channel, "linux-64", repodata_json_path, None) .expect("failed to load sparse repodata"); bench_sort(c, &sparse_repo_data, "pytorch"); diff --git a/crates/rattler_solve/tests/backends.rs b/crates/rattler_solve/tests/backends.rs index d453901fc..d87022d29 100644 --- a/crates/rattler_solve/tests/backends.rs +++ b/crates/rattler_solve/tests/backends.rs @@ -74,7 +74,7 @@ fn read_repodata(path: &str) -> Vec { } fn read_sparse_repodata(path: &str) -> SparseRepoData { - SparseRepoData::new( + SparseRepoData::from_file( Channel::from_str("dummy", &channel_config()).unwrap(), "dummy".to_string(), path, @@ -185,7 +185,7 @@ fn read_real_world_repo_data() -> &'static Vec { fn read_pytorch_sparse_repo_data() -> &'static SparseRepoData { static REPO_DATA: Lazy = Lazy::new(|| { let pytorch = pytorch_json_path(); - SparseRepoData::new( + SparseRepoData::from_file( Channel::from_str("pytorch", &channel_config()).unwrap(), "pytorch".to_string(), pytorch, @@ -200,7 +200,7 @@ fn read_pytorch_sparse_repo_data() -> &'static SparseRepoData { fn read_conda_forge_sparse_repo_data() -> &'static SparseRepoData { static REPO_DATA: Lazy = Lazy::new(|| { let conda_forge = conda_json_path(); - SparseRepoData::new( + SparseRepoData::from_file( Channel::from_str("conda-forge", &channel_config()).unwrap(), "conda-forge".to_string(), conda_forge, diff --git a/crates/rattler_solve/tests/sorting.rs b/crates/rattler_solve/tests/sorting.rs index da903472a..0c2b1a85e 100644 --- a/crates/rattler_solve/tests/sorting.rs +++ b/crates/rattler_solve/tests/sorting.rs @@ -21,7 +21,7 @@ fn load_repodata(package_name: &PackageName) -> Vec> { let repodata_json_path = channel_path.join("linux-64").join("repodata.json"); let channel = Channel::from_directory(&channel_path); - let sparse_repo_data = SparseRepoData::new(channel, "linux-64", repodata_json_path, None) + let sparse_repo_data = SparseRepoData::from_file(channel, "linux-64", repodata_json_path, None) .expect("failed to load sparse repodata"); SparseRepoData::load_records_recursive(&[sparse_repo_data], [package_name.clone()], None) diff --git a/js-rattler/.cargo/config.toml b/js-rattler/.cargo/config.toml index f4e8c002f..aa003a60c 100644 --- a/js-rattler/.cargo/config.toml +++ b/js-rattler/.cargo/config.toml @@ -1,2 +1,6 @@ [build] target = "wasm32-unknown-unknown" + +[target.'wasm32-unknown-unknown'] +# See https://docs.rs/getrandom/latest/getrandom/#webassembly-support +rustflags = ["--cfg", 'getrandom_backend="wasm_js"'] \ No newline at end of file diff --git a/js-rattler/Cargo.lock b/js-rattler/Cargo.lock index 43dbe79b2..a47c0f73c 100644 --- a/js-rattler/Cargo.lock +++ b/js-rattler/Cargo.lock @@ -2,6 +2,32 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -9,6 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if 1.0.0", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -25,9 +52,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -44,12 +71,222 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-compression" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310c9bcae737a48ef5cdee3174184e6d548b292739ede61a1f955ef76a738861" +dependencies = [ + "bzip2", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "zstd", + "zstd-safe", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fd-lock" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7569377d7062165f6f7834d9cb3051974a2d141433cc201c2f94c149e993cccf" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "pin-project", + "rustix", + "thiserror 1.0.69", + "tokio", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "rustix", + "tracing", +] + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if 1.0.0", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + [[package]] name = "base64" version = "0.22.1" @@ -58,9 +295,21 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "bitvec" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] [[package]] name = "blake2" @@ -80,11 +329,33 @@ 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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byteorder" @@ -92,12 +363,55 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" + +[[package]] +name = "bzip2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" +dependencies = [ + "bzip2-sys", + "libbz2-rs-sys", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.13+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "cache_control" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf2a5fb3207c12b5d208ebc145f967fea5cac41a021c37417ccc31ba40f39ee" + +[[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.1" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -113,6 +427,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.40" @@ -126,6 +446,25 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -136,6 +475,26 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -144,13 +503,22 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -221,6 +589,49 @@ dependencies = [ "syn", ] +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "dbus" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] + +[[package]] +name = "dbus-secret-service" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42a16374481d92aed73ae45b1f120207d8e71d24fb89f357fadbd8f946fd84b" +dependencies = [ + "aes", + "block-padding", + "cbc", + "dbus", + "futures-util", + "hkdf", + "num", + "once_cell", + "rand", + "sha2", +] + [[package]] name = "deranged" version = "0.3.11" @@ -231,6 +642,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.7" @@ -260,7 +682,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -276,24 +698,60 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] -name = "equivalent" -version = "1.0.1" +name = "elsa" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2343daaeabe09879d4ea058bb4f1e63da3fc07dadc6634e01bda1b3d6a9d9d2b" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "endi" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] -name = "erased-serde" -version = "0.4.5" +name = "enumflags2" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ + "enumflags2_derive", "serde", - "typeid", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", ] [[package]] @@ -303,7 +761,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", ] [[package]] @@ -323,6 +802,34 @@ dependencies = [ "url", ] +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "flate2" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "float-cmp" version = "0.10.0" @@ -338,6 +845,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -354,6 +876,127 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f89bda4c2a21204059a977ed3bfe746677dfd137b83c339e702b0ac91d482aa" dependencies = [ "autocfg", + "tokio", +] + +[[package]] +name = "fs4" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c29c30684418547d476f0b48e84f4821639119c483b1eccd566c8cd0cd05f521" +dependencies = [ + "fs-err", + "rustix", + "tokio", + "windows-sys 0.52.0", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] @@ -396,17 +1039,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi 0.13.3+wasi-0.2.2", + "wasm-bindgen", "windows-targets", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.7.1", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "halfbrown" version = "0.2.5" @@ -435,9 +1105,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -445,11 +1115,196 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "http-cache-semantics" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92baf25cf0b8c9246baecf3a444546360a97b569168fdf92563ee6a47829920c" +dependencies = [ + "http", + "http-serde", + "reqwest", + "serde", + "time", +] + +[[package]] +name = "http-serde" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f056c8559e3757392c8d091e796416e4649d8e49e88b8d76df6c002f05027fd" +dependencies = [ + "http", + "serde", +] + +[[package]] +name = "httparse" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] [[package]] name = "iana-time-zone" @@ -637,10 +1492,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", "serde", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + [[package]] name = "itertools" version = "0.14.0" @@ -652,18 +1523,31 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.13" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] [[package]] name = "js-rattler" version = "0.1.1" dependencies = [ + "bzip2", "console_error_panic_hook", "rattler_conda_types", + "rattler_repodata_gateway", + "rattler_solve", "thiserror 2.0.11", "wasm-bindgen", + "wasm-bindgen-futures", "wasm-bindgen-test", "wee_alloc", ] @@ -679,16 +1563,54 @@ dependencies = [ ] [[package]] -name = "lazy-regex" -version = "3.4.1" +name = "json-patch" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" dependencies = [ - "lazy-regex-proc_macros", - "once_cell", - "regex", -] - + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyring" +version = "3.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f8fe839464d4e4b37d756d7e910063696af79a7e877282cb1825e4ec5f10833" +dependencies = [ + "byteorder", + "dbus-secret-service", + "log", + "secret-service", + "security-framework 2.11.1", + "security-framework 3.2.0", + "windows-sys 0.59.0", + "zbus", +] + +[[package]] +name = "lazy-regex" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + [[package]] name = "lazy-regex-proc_macros" version = "3.4.1" @@ -701,12 +1623,33 @@ dependencies = [ "syn", ] +[[package]] +name = "libbz2-rs-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864a00c8d019e36216b69c2c4ce50b83b7bd966add3cf5ba554ec44f8bebcf5" + [[package]] name = "libc" version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +[[package]] +name = "libdbus-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + [[package]] name = "libredox" version = "0.1.3" @@ -715,6 +1658,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags", "libc", + "redox_syscall", ] [[package]] @@ -725,15 +1669,31 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.22" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "md-5" @@ -751,12 +1711,36 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "memory_units" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "minicov" version = "0.3.7" @@ -773,6 +1757,62 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework 2.11.1", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "netrc-rs" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2970fbbc8c785e8246234a7bd004ed66cd1ed1a35ec73669a92545e419b836" + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "cfg_aliases", + "libc", + "memoffset", +] + [[package]] name = "nom" version = "7.1.3" @@ -783,12 +1823,76 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -798,11 +1902,74 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "openssl" +version = "0.10.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] name = "option-ext" @@ -810,17 +1977,72 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "petgraph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +dependencies = [ + "fixedbitset", + "indexmap 2.7.1", +] + [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -828,9 +2050,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -838,9 +2060,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -852,65 +2074,211 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", "unicase", ] [[package]] -name = "pin-project-lite" -version = "0.2.15" +name = "pin-project" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +dependencies = [ + "pin-project-internal", +] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "pin-project-internal" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "proc-macro2" -version = "1.0.93" +name = "pin-project-lite" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -dependencies = [ - "unicode-ident", -] +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] -name = "purl" -version = "0.1.5" +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f112b0e2a9bca03924c39166775b74fec9a831f7d4d8fa539dee0e565f403a0e" -dependencies = [ - "hex", - "percent-encoding", - "phf", - "serde", - "smartstring", - "thiserror 1.0.69", - "unicase", -] +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "quote" -version = "1.0.38" +name = "piper" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ - "proc-macro2", + "atomic-waker", + "fastrand", + "futures-io", ] [[package]] -name = "rand" +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if 1.0.0", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "purl" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f112b0e2a9bca03924c39166775b74fec9a831f7d4d8fa539dee0e565f403a0e" +dependencies = [ + "hex", + "percent-encoding", + "phf", + "serde", + "smartstring", + "thiserror 1.0.69", + "unicase", +] + +[[package]] +name = "quinn" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.11", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +dependencies = [ + "bytes", + "getrandom 0.2.15", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.11", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", "rand_core", ] @@ -919,10 +2287,43 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rattler_cache" +version = "0.3.12" +dependencies = [ + "anyhow", + "dashmap", + "digest", + "dirs", + "fs-err", + "fs4", + "futures", + "fxhash", + "itertools", + "parking_lot", + "rattler_conda_types", + "rattler_digest", + "rattler_networking", + "rattler_package_streaming", + "rayon", + "reqwest", + "reqwest-middleware", + "serde_json", + "simple_spawn_blocking", + "tempfile", + "thiserror 2.0.11", + "tokio", + "tracing", + "url", +] [[package]] name = "rattler_conda_types" -version = "0.31.1" +version = "0.31.2" dependencies = [ "chrono", "dirs", @@ -958,147 +2359,554 @@ dependencies = [ ] [[package]] -name = "rattler_digest" -version = "1.0.6" +name = "rattler_digest" +version = "1.0.7" +dependencies = [ + "blake2", + "digest", + "generic-array", + "hex", + "md-5", + "serde", + "serde_with", + "sha2", + "tokio", +] + +[[package]] +name = "rattler_macros" +version = "1.0.6" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "rattler_networking" +version = "0.22.7" +dependencies = [ + "anyhow", + "async-trait", + "base64", + "dirs", + "fs-err", + "getrandom 0.3.1", + "http", + "itertools", + "keyring", + "netrc-rs", + "reqwest", + "reqwest-middleware", + "retry-policies", + "serde", + "serde_json", + "tempfile", + "thiserror 2.0.11", + "tracing", + "url", +] + +[[package]] +name = "rattler_package_streaming" +version = "0.22.31" +dependencies = [ + "bzip2", + "chrono", + "fs-err", + "futures-util", + "num_cpus", + "rattler_conda_types", + "rattler_digest", + "rattler_networking", + "rattler_redaction", + "reqwest", + "reqwest-middleware", + "serde_json", + "simple_spawn_blocking", + "tar", + "tempfile", + "thiserror 2.0.11", + "tokio", + "tokio-util", + "tracing", + "url", + "zip", + "zstd", +] + +[[package]] +name = "rattler_redaction" +version = "0.1.7" +dependencies = [ + "reqwest", + "reqwest-middleware", + "url", +] + +[[package]] +name = "rattler_repodata_gateway" +version = "0.21.40" +dependencies = [ + "anyhow", + "async-compression", + "async-fd-lock", + "async-trait", + "blake2", + "bytes", + "cache_control", + "cfg-if 1.0.0", + "chrono", + "dashmap", + "dirs", + "file_url", + "fs-err", + "futures", + "hex", + "http", + "http-cache-semantics", + "humansize", + "humantime", + "itertools", + "json-patch", + "libc", + "memmap2", + "parking_lot", + "pin-project-lite", + "rattler_cache", + "rattler_conda_types", + "rattler_digest", + "rattler_networking", + "rattler_redaction", + "reqwest", + "reqwest-middleware", + "retry-policies", + "rmp-serde", + "self_cell", + "serde", + "serde_json", + "serde_with", + "simple_spawn_blocking", + "superslice", + "tempfile", + "thiserror 2.0.11", + "tokio", + "tokio-util", + "tracing", + "url", + "wasmtimer", + "windows-sys 0.59.0", + "zstd", +] + +[[package]] +name = "rattler_solve" +version = "1.3.11" +dependencies = [ + "chrono", + "futures", + "indexmap 2.7.1", + "itertools", + "rattler_conda_types", + "rattler_digest", + "resolvo", + "tempfile", + "thiserror 2.0.11", + "tracing", + "url", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.11", +] + +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-native-certs", + "rustls-pemfile", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tokio-util", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", + "windows-registry", +] + +[[package]] +name = "reqwest-middleware" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e8975513bd9a7a43aad01030e79b3498e05db14e9d945df6483e8cf9b8c4c4" +dependencies = [ + "anyhow", + "async-trait", + "http", + "reqwest", + "serde", + "thiserror 1.0.69", + "tower-service", +] + +[[package]] +name = "resolvo" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5314eb4b865d39acd1b3cd05eb91b87031bb49fd1278a1bdf8d6680f1389ec29" +dependencies = [ + "ahash", + "bitvec", + "elsa", + "event-listener", + "futures", + "indexmap 2.7.1", + "itertools", + "petgraph", + "tracing", +] + +[[package]] +name = "retry-policies" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5875471e6cab2871bc150ecb8c727db5113c9338cc3354dc5ee3425b6aa40a1c" +dependencies = [ + "rand", +] + +[[package]] +name = "ring" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ - "blake2", - "digest", - "generic-array", - "hex", - "md-5", - "serde", - "serde_with", - "sha2", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] -name = "rattler_macros" -version = "1.0.6" +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ - "quote", - "syn", + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.2.0", ] [[package]] -name = "rattler_redaction" -version = "0.1.7" +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "url", + "rustls-pki-types", ] [[package]] -name = "rayon" -version = "1.10.0" +name = "rustls-pki-types" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" dependencies = [ - "either", - "rayon-core", + "web-time", ] [[package]] -name = "rayon-core" -version = "1.12.1" +name = "rustls-webpki" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] -name = "redox_users" -version = "0.5.0" +name = "rustversion" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 2.0.11", -] +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] -name = "ref-cast" -version = "1.0.23" +name = "ryu" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" -dependencies = [ - "ref-cast-impl", -] +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] -name = "ref-cast-impl" -version = "1.0.23" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "proc-macro2", - "quote", - "syn", + "winapi-util", ] [[package]] -name = "regex" -version = "1.11.1" +name = "schannel" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "windows-sys 0.59.0", ] [[package]] -name = "regex-automata" -version = "0.4.9" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "regex-syntax" -version = "0.8.5" +name = "secret-service" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "e4d35ad99a181be0a60ffcbe85d680d98f87bdc4d7644ade319b87076b9dbfd4" +dependencies = [ + "aes", + "cbc", + "futures-util", + "generic-array", + "hkdf", + "num", + "once_cell", + "rand", + "serde", + "sha2", + "zbus", +] [[package]] -name = "rustix" -version = "0.38.44" +name = "security-framework" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags", - "errno", + "core-foundation 0.9.4", + "core-foundation-sys", "libc", - "linux-raw-sys", - "windows-sys", + "security-framework-sys", ] [[package]] -name = "rustversion" -version = "1.0.18" +name = "security-framework" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags", + "core-foundation 0.10.0", + "core-foundation-sys", + "libc", + "security-framework-sys", +] [[package]] -name = "ryu" -version = "1.0.18" +name = "security-framework-sys" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] -name = "same-file" -version = "1.0.6" +name = "self_cell" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] +checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" [[package]] name = "serde" @@ -1154,6 +2962,18 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_with" version = "3.12.0" @@ -1197,6 +3017,17 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.8" @@ -1214,6 +3045,21 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simd-json" version = "0.14.3" @@ -1235,11 +3081,27 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +[[package]] +name = "simple_spawn_blocking" +version = "1.1.0" +dependencies = [ + "tokio", +] + [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" @@ -1261,6 +3123,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1307,6 +3179,12 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "superslice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" + [[package]] name = "syn" version = "2.0.98" @@ -1318,6 +3196,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -1329,6 +3216,23 @@ dependencies = [ "syn", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "tempfile" version = "3.17.1" @@ -1340,7 +3244,7 @@ dependencies = [ "getrandom 0.3.1", "once_cell", "rustix", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -1353,19 +3257,113 @@ dependencies = [ ] [[package]] -name = "thiserror" -version = "2.0.11" +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ - "thiserror-impl 2.0.11", + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", ] [[package]] -name = "thiserror-impl" -version = "1.0.69" +name = "tokio-macros" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", @@ -1373,57 +3371,82 @@ dependencies = [ ] [[package]] -name = "thiserror-impl" -version = "2.0.11" +name = "tokio-native-tls" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "native-tls", + "tokio", ] [[package]] -name = "time" -version = "0.3.36" +name = "tokio-rustls" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", + "rustls", + "tokio", ] [[package]] -name = "time-core" -version = "0.1.2" +name = "tokio-util" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] [[package]] -name = "time-macros" -version = "0.2.18" +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "num-conv", - "time-core", + "indexmap 2.7.1", + "toml_datetime", + "winnow", ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tower" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ - "displaydoc", - "zerovec", + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", ] +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.41" @@ -1455,6 +3478,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "typed-path" version = "0.10.0" @@ -1469,21 +3498,32 @@ checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "uds_windows" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unsafe-libyaml" @@ -1491,6 +3531,12 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.4" @@ -1527,6 +3573,12 @@ dependencies = [ "ryu", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -1543,6 +3595,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1653,6 +3714,33 @@ dependencies = [ "syn", ] +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.77" @@ -1663,6 +3751,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "wee_alloc" version = "0.4.5" @@ -1697,7 +3804,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -1721,6 +3828,45 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.59.0" @@ -1794,6 +3940,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen-rt" version = "0.33.0" @@ -1815,11 +3970,41 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xattr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -1829,9 +4014,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", @@ -1839,12 +4024,75 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zbus" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] @@ -1861,18 +4109,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -1880,6 +4128,12 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + [[package]] name = "zerovec" version = "0.10.4" @@ -1901,3 +4155,100 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zip" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b280484c454e74e5fff658bbf7df8fdbe7a07c6b2de4a53def232c15ef138f3a" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap 2.7.1", + "memchr", + "thiserror 2.0.11", + "time", + "zopfli", +] + +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", +] + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.14+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "zvariant" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/js-rattler/Cargo.toml b/js-rattler/Cargo.toml index ad56a3b1d..cb9829fe7 100644 --- a/js-rattler/Cargo.toml +++ b/js-rattler/Cargo.toml @@ -14,6 +14,7 @@ default = ["console_error_panic_hook"] [dependencies] wasm-bindgen = "0.2.95" +wasm-bindgen-futures = "0.4.50" # The `console_error_panic_hook` crate provides better debugging of panics by # logging them with `console.error`. This is great for development, but requires @@ -31,12 +32,19 @@ wee_alloc = { version = "0.4.5", optional = true } thiserror = "2.0.3" rattler_conda_types = { path = "../crates/rattler_conda_types" } +rattler_repodata_gateway = { path = "../crates/rattler_repodata_gateway", features = ["gateway"] } +rattler_solve = { path = "../crates/rattler_solve", default-features = false, features = ["resolvo"] } + +# By adding the `libbz2-rs-sys` feature we ensure that bzip2 is using the rust +# implementation. This is important because the C implementation is not +# compatible with wasm. +bzip2 = { version = "0.5.1", features = ["libbz2-rs-sys"] } [dev-dependencies] wasm-bindgen-test = "0.3.45" [profile.release] -# Tell `rustc` to optimize for small code size. +## Tell `rustc` to optimize for small code size. opt-level = "s" lto = true diff --git a/js-rattler/crate/error.rs b/js-rattler/crate/error.rs index 03bcb5ee7..bd3f86e49 100644 --- a/js-rattler/crate/error.rs +++ b/js-rattler/crate/error.rs @@ -1,5 +1,10 @@ use rattler_conda_types::version_spec::ParseVersionSpecError; -use rattler_conda_types::{ParseVersionError, VersionBumpError, VersionExtendError}; +use rattler_conda_types::{ + ParseChannelError, ParseMatchSpecError, ParsePlatformError, ParseVersionError, + VersionBumpError, VersionExtendError, +}; +use rattler_repodata_gateway::GatewayError; +use rattler_solve::SolveError; use thiserror::Error; use wasm_bindgen::JsValue; @@ -11,9 +16,18 @@ pub enum JsError { VersionExtendError(#[from] VersionExtendError), #[error(transparent)] VersionBumpError(#[from] VersionBumpError), - #[error(transparent)] ParseVersionSpecError(#[from] ParseVersionSpecError), + #[error(transparent)] + ParseChannel(#[from] ParseChannelError), + #[error(transparent)] + ParsePlatform(#[from] ParsePlatformError), + #[error(transparent)] + ParseMatchSpec(#[from] ParseMatchSpecError), + #[error(transparent)] + GatewayError(#[from] GatewayError), + #[error(transparent)] + SolveError(#[from] SolveError), } pub type JsResult = Result; @@ -25,6 +39,11 @@ impl From for JsValue { JsError::VersionExtendError(error) => JsValue::from_str(&error.to_string()), JsError::VersionBumpError(error) => JsValue::from_str(&error.to_string()), JsError::ParseVersionSpecError(error) => JsValue::from_str(&error.to_string()), + JsError::ParseChannel(error) => JsValue::from_str(&error.to_string()), + JsError::ParsePlatform(error) => JsValue::from_str(&error.to_string()), + JsError::ParseMatchSpec(error) => JsValue::from_str(&error.to_string()), + JsError::GatewayError(error) => JsValue::from_str(&error.to_string()), + JsError::SolveError(error) => JsValue::from_str(&error.to_string()), } } } diff --git a/js-rattler/crate/lib.rs b/js-rattler/crate/lib.rs index 35751e644..32826b6f8 100644 --- a/js-rattler/crate/lib.rs +++ b/js-rattler/crate/lib.rs @@ -1,4 +1,5 @@ mod error; +pub mod solve; mod utils; mod version; mod version_spec; diff --git a/js-rattler/crate/solve.rs b/js-rattler/crate/solve.rs new file mode 100644 index 000000000..6fab8cf8c --- /dev/null +++ b/js-rattler/crate/solve.rs @@ -0,0 +1,83 @@ +use std::{path::PathBuf, str::FromStr}; + +use rattler_conda_types::{Channel, ChannelConfig, MatchSpec, ParseStrictness::Lenient, Platform}; +use rattler_repodata_gateway::{Gateway, SourceConfig}; +use rattler_solve::{SolverImpl, SolverTask}; +use wasm_bindgen::prelude::*; + +use crate::error::JsError; + +/// A package that has been solved by the solver. +/// @public +#[wasm_bindgen(getter_with_clone)] +pub struct SolvedPackage { + pub url: String, + pub package_name: String, + pub build_number: u64, + pub repo_name: Option, + pub filename: String, + pub version: String, +} + +/// Solve a set of specs with the given channels and platforms. +/// @public +#[wasm_bindgen] +pub async fn simple_solve( + specs: Vec, + channels: Vec, + platforms: Vec, +) -> Result, JsError> { + // TODO: Dont hardcode + let channel_config = ChannelConfig::default_with_root_dir(PathBuf::from("")); + + // Convert types + let specs = specs + .into_iter() + .map(|s| MatchSpec::from_str(&s, Lenient)) + .collect::, _>>()?; + let channels = channels + .into_iter() + .map(|s| Channel::from_str(&s, &channel_config)) + .collect::, _>>()?; + let platforms = platforms + .into_iter() + .map(|p| Platform::from_str(&p)) + .collect::, _>>()?; + + // Fetch the repodata + let gateway = Gateway::builder() + .with_channel_config(rattler_repodata_gateway::ChannelConfig { + default: SourceConfig { + sharded_enabled: true, + ..SourceConfig::default() + }, + ..rattler_repodata_gateway::ChannelConfig::default() + }) + .finish(); + let repodata = gateway + .query(channels, platforms, specs.iter().cloned()) + .recursive(true) + .execute() + .await?; + + // Solve + let task = SolverTask { + specs, + ..repodata.iter().collect::>() + }; + let solved = rattler_solve::resolvo::Solver.solve(task)?; + + // Convert to JS types + Ok(solved + .records + .into_iter() + .map(|r| SolvedPackage { + url: r.url.to_string(), + package_name: r.package_record.name.as_source().to_string(), + build_number: r.package_record.build_number, + repo_name: r.channel, + filename: r.file_name, + version: r.package_record.version.to_string(), + }) + .collect()) +} diff --git a/js-rattler/package-lock.json b/js-rattler/package-lock.json index bc1fa52ca..416517f85 100644 --- a/js-rattler/package-lock.json +++ b/js-rattler/package-lock.json @@ -8,6 +8,9 @@ "name": "@baszalmstra/rattler", "version": "0.1.3", "license": "BSD-3-Clause", + "dependencies": { + "tslib": "^2.8.1" + }, "devDependencies": { "@jest/globals": "^29.7.0", "@microsoft/api-extractor": "^7.50.0", @@ -58,9 +61,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", - "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", "dev": true, "license": "MIT", "engines": { @@ -68,22 +71,22 @@ } }, "node_modules/@babel/core": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.9.tgz", + "integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.0", - "@babel/generator": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.0", - "@babel/parser": "^7.26.0", - "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", + "@babel/helpers": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.9", + "@babel/types": "^7.26.9", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -109,14 +112,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz", + "integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -126,13 +129,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", - "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.9", + "@babel/compat-data": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", @@ -185,9 +188,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", - "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", "dev": true, "license": "MIT", "engines": { @@ -225,27 +228,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz", + "integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz", + "integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.9" }, "bin": { "parser": "bin/babel-parser.js" @@ -494,32 +497,32 @@ } }, "node_modules/@babel/template": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz", + "integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -528,9 +531,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz", + "integrity": "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==", "dev": true, "license": "MIT", "dependencies": { @@ -617,72 +620,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/console/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/console/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/console/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/console/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jest/console/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/core": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", @@ -731,72 +668,6 @@ } } }, - "node_modules/@jest/core/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/core/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jest/core/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/environment": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", @@ -918,104 +789,6 @@ } } }, - "node_modules/@jest/reporters/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/reporters/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/reporters/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jest/reporters/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/@jest/reporters/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -1103,166 +876,34 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/transform/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/transform/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/transform/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/transform/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jest/transform/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/types/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jest/types/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -1343,55 +984,6 @@ "@rushstack/node-core-library": "5.11.0" } }, - "node_modules/@microsoft/api-extractor/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@microsoft/api-extractor/node_modules/minimatch": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", - "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@microsoft/api-extractor/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@microsoft/api-extractor/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, "node_modules/@microsoft/tsdoc": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.1.tgz", @@ -1412,23 +1004,6 @@ "resolve": "~1.22.2" } }, - "node_modules/@microsoft/tsdoc-config/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/@rollup/plugin-commonjs": { "version": "28.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", @@ -1456,34 +1031,6 @@ } } }, - "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rollup/plugin-esm-shim": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@rollup/plugin-esm-shim/-/plugin-esm-shim-0.1.8.tgz", @@ -1602,19 +1149,6 @@ } } }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.34.8", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", @@ -1923,91 +1457,40 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@rushstack/node-core-library/node_modules/ajv-draft-04": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", - "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "node_modules/@rushstack/rig-package": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.3.tgz", + "integrity": "sha512-olzSSjYrvCNxUFZowevC3uz8gvKr3WTpHQ7BkpjtRpA3wK+T0ybep/SRUMfr195gBzJm5gaXw0ZMgjIyHqJUow==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve": "~1.22.1", + "strip-json-comments": "~3.1.1" + } + }, + "node_modules/@rushstack/terminal": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.15.0.tgz", + "integrity": "sha512-vXQPRQ+vJJn4GVqxkwRe+UGgzNxdV8xuJZY2zem46Y0p3tlahucH9/hPmLGj2i9dQnUBFiRnoM9/KW7PYw8F4Q==", "dev": true, "license": "MIT", + "dependencies": { + "@rushstack/node-core-library": "5.11.0", + "supports-color": "~8.1.1" + }, "peerDependencies": { - "ajv": "^8.5.0" + "@types/node": "*" }, "peerDependenciesMeta": { - "ajv": { + "@types/node": { "optional": true } } }, - "node_modules/@rushstack/node-core-library/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@rushstack/node-core-library/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@rushstack/node-core-library/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, - "node_modules/@rushstack/rig-package": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.3.tgz", - "integrity": "sha512-olzSSjYrvCNxUFZowevC3uz8gvKr3WTpHQ7BkpjtRpA3wK+T0ybep/SRUMfr195gBzJm5gaXw0ZMgjIyHqJUow==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve": "~1.22.1", - "strip-json-comments": "~3.1.1" - } - }, - "node_modules/@rushstack/terminal": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.15.0.tgz", - "integrity": "sha512-vXQPRQ+vJJn4GVqxkwRe+UGgzNxdV8xuJZY2zem46Y0p3tlahucH9/hPmLGj2i9dQnUBFiRnoM9/KW7PYw8F4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rushstack/node-core-library": "5.11.0", - "supports-color": "~8.1.1" - }, - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@rushstack/ts-command-line": { - "version": "4.23.5", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.5.tgz", - "integrity": "sha512-jg70HfoK44KfSP3MTiL5rxsZH7X1ktX3cZs9Sl8eDu1/LxJSbPsh0MOFRC710lIuYYSgxWjI5AjbCBAl7u3RxA==", + "node_modules/@rushstack/ts-command-line": { + "version": "4.23.5", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.5.tgz", + "integrity": "sha512-jg70HfoK44KfSP3MTiL5rxsZH7X1ktX3cZs9Sl8eDu1/LxJSbPsh0MOFRC710lIuYYSgxWjI5AjbCBAl7u3RxA==", "dev": true, "license": "MIT", "dependencies": { @@ -2189,20 +1672,20 @@ } }, "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { - "version": "22.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", - "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", + "version": "22.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.5.tgz", + "integrity": "sha512-+lTU0PxZXn0Dr1NBtC7Y8cR21AJr87dLLU953CWA6pMxxv/UDc7jYAY90upcrie1nRcD6XNG5HOYEDtgW5TxAg==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "node_modules/@types/resolve": { @@ -2270,22 +1753,37 @@ } }, "node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", + "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ajv-formats": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", @@ -2330,6 +1828,22 @@ "node": ">=8" } }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -2344,6 +1858,19 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2400,72 +1927,6 @@ "@babel/core": "^7.8.0" } }, - "node_modules/babel-jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/babel-jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/babel-jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/babel-jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/babel-jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -2592,23 +2053,6 @@ "node": ">=10" } }, - "node_modules/binary-install/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/binary-searching": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/binary-searching/-/binary-searching-2.0.5.tgz", @@ -2641,9 +2085,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "dev": true, "funding": [ { @@ -2661,9 +2105,9 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.1" }, "bin": { @@ -2724,9 +2168,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001680", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", - "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", + "version": "1.0.30001701", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001701.tgz", + "integrity": "sha512-faRs/AW3jA9nTwmJBSO1PQ6L/EOgsB5HMQQq4iCu5zhPgVVgO/pZRHlmatwijZKetFw8/Pr4q6dEN8sJuq8qTw==", "dev": true, "funding": [ { @@ -2744,6 +2188,36 @@ ], "license": "CC-BY-4.0" }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -2792,9 +2266,9 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz", - "integrity": "sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", "dev": true, "license": "MIT" }, @@ -2831,6 +2305,26 @@ "dev": true, "license": "MIT" }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, "node_modules/comment-parser": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", @@ -2891,91 +2385,25 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/create-jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/create-jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/create-jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/create-jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/create-jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" }, "engines": { "node": ">=10.14", @@ -2999,9 +2427,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -3126,9 +2554,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.63", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.63.tgz", - "integrity": "sha512-ddeXKuY9BHo/mw145axlyWjlJ1UBt4WK3AlvkT7W2AbqfRQoacVoRUCF6wL3uIx/8wT9oLKXzI+rFqHHscByaA==", + "version": "1.5.107", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.107.tgz", + "integrity": "sha512-dJr1o6yCntRkXElnhsHh1bAV19bo/hKyFf7tCcWgpXbuFIF0Lakjgqv5LRfSDaNzAII8Fnxg2tqgHkgCvxdbxw==", "dev": true, "license": "ISC" }, @@ -3172,6 +2600,16 @@ "node": ">=6" } }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -3257,23 +2695,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -3284,6 +2705,21 @@ "bser": "2.1.1" } }, + "node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -3510,6 +2946,19 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -3644,9 +3093,9 @@ "license": "MIT" }, "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dev": true, "license": "MIT", "dependencies": { @@ -3829,70 +3278,17 @@ "node": ">=10" } }, - "node_modules/jake/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jake/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jake/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jake/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jake/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jake/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "has-flag": "^4.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=8" + "node": "*" } }, "node_modules/jest": { @@ -3937,22 +3333,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-changed-files/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/jest-circus": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", @@ -3985,192 +3365,44 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-circus/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-circus/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "bin": { + "jest": "bin/jest.js" }, "engines": { - "node": ">=10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/jest-circus/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-circus/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-circus/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-circus/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/jest-cli/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-cli/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-cli/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-cli/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-cli/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4213,1268 +3445,430 @@ } } }, - "node_modules/jest-config/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-config/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "detect-newline": "^3.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-config/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=7.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-config/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-config/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "optionalDependencies": { + "fsevents": "^2.3.2" } }, - "node_modules/jest-diff/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-diff/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-diff/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-diff/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-docblock": { + "node_modules/jest-matcher-utils": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "license": "MIT", "dependencies": { - "detect-newline": "^3.0.0" + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each": { + "node_modules/jest-message-util": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "license": "MIT", "dependencies": { + "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "engines": { - "node": ">=10" + "node": ">=6" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" + "peerDependencies": { + "jest-resolve": "*" }, - "engines": { - "node": ">=7.0.0" + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } } }, - "node_modules/jest-each/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-each/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-environment-node": { + "node_modules/jest-resolve": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-haste-map": { + "node_modules/jest-runner": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "license": "MIT", "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", + "chalk": "^4.0.0", + "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" } }, - "node_modules/jest-haste-map/node_modules/jest-worker": { + "node_modules/jest-runtime": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, "license": "MIT", "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "slash": "^3.0.0", + "strip-bom": "^4.0.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-leak-detector": { + "node_modules/jest-snapshot": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "license": "MIT", "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-matcher-utils": { + "node_modules/jest-util": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "license": "MIT", "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-matcher-utils/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-message-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-message-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } - } - }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-resolve/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-resolve/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-resolve/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-resolve/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-runner/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-runner/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-runner/node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/jest-runner/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-runtime/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-runtime/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-runtime/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-runtime/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-snapshot/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "leven": "^3.1.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-validate/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-validate/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-validate/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-validate/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-watcher/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-util/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=8.6" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/jest-watcher/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-watcher/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" }, "engines": { - "node": ">=7.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-watcher/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-watcher/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jju": { @@ -5506,9 +3900,9 @@ } }, "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { @@ -5712,9 +4106,9 @@ "license": "MIT" }, "node_modules/micromark": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.1.tgz", - "integrity": "sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", "dev": true, "funding": [ { @@ -5748,9 +4142,9 @@ } }, "node_modules/micromark-core-commonmark": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz", - "integrity": "sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", "dev": true, "funding": [ { @@ -6118,9 +4512,9 @@ } }, "node_modules/micromark-util-subtokenize": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.3.tgz", - "integrity": "sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, "funding": [ { @@ -6158,9 +4552,9 @@ "license": "MIT" }, "node_modules/micromark-util-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.1.tgz", - "integrity": "sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true, "funding": [ { @@ -6188,6 +4582,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -6199,9 +4606,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", "dev": true, "license": "ISC", "dependencies": { @@ -6313,9 +4720,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT" }, @@ -6369,16 +4776,16 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "license": "MIT", "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6397,6 +4804,22 @@ "node": ">=8" } }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -6478,13 +4901,13 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -6668,19 +5091,22 @@ } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "dev": true, "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6709,15 +5135,32 @@ } }, "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", "dev": true, "license": "MIT", "engines": { "node": ">=10" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rollup": { "version": "4.34.8", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", @@ -6758,11 +5201,14 @@ } }, "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" }, @@ -6770,6 +5216,26 @@ "node": ">=10" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -6862,6 +5328,17 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -6882,16 +5359,6 @@ "node": ">=10" } }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -7115,6 +5582,19 @@ } } }, + "node_modules/ts-jest/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -7163,10 +5643,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD", - "optional": true, - "peer": true + "license": "0BSD" }, "node_modules/type-detect": { "version": "4.0.8", @@ -7213,9 +5690,9 @@ "license": "MIT" }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, "license": "MIT" }, @@ -7244,9 +5721,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "dev": true, "funding": [ { @@ -7265,7 +5742,7 @@ "license": "MIT", "dependencies": { "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -7364,42 +5841,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/js-rattler/package.json b/js-rattler/package.json index 03cc9b76f..aa097922a 100644 --- a/js-rattler/package.json +++ b/js-rattler/package.json @@ -24,12 +24,17 @@ } }, "scripts": { + "fix:types": "shx sed -i '^.*LIBBZ2_RS_SYS.*$' '' pkg/js_rattler_bg.wasm.d.ts pkg/js_rattler.d.ts", "build:wasm": "wasm-pack build --mode normal --release", + "build:wasm:debug": "wasm-pack build --mode normal --debug", + "postbuild:wasm": "npm run fix:types", + "postbuild:wasm:debug": "npm run fix:types", "build:esm": "npm run build:wasm -- --target web && rollup -c rollup.config.esm.mjs", "build:cjs": "npm run build:wasm -- --target nodejs && rollup -c rollup.config.cjs.mjs", "build:types": "tsc && api-extractor run --verbose", "build": "shx rm -rf dist pkg types && npm run build:esm && npm run build:cjs && shx cp pkg/js_rattler_bg.wasm ./dist/ && npm run build:types", "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", + "test:debug": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", "fmt": "prettier --write .", "fmt:check": "prettier --check ." }, @@ -49,6 +54,7 @@ "shx": "^0.3.4", "ts-jest": "^29.2.5", "ts-node": "^10.9.2", + "tslib": "^2.8.1", "typescript": "^5.6.3", "wasm-pack": "^0.13.1" } diff --git a/js-rattler/src/index.ts b/js-rattler/src/index.ts index bc30bb28f..29f95e84b 100644 --- a/js-rattler/src/index.ts +++ b/js-rattler/src/index.ts @@ -1,3 +1,4 @@ export { ParseStrictness } from "../pkg/"; export * from "./Version"; export * from "./VersionSpec"; +export * from "./solve"; diff --git a/js-rattler/src/solve.test.ts b/js-rattler/src/solve.test.ts new file mode 100644 index 000000000..6937096d9 --- /dev/null +++ b/js-rattler/src/solve.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "@jest/globals"; +import { simple_solve } from "./solve"; + +describe("solving", () => { + it("python should yield three packages", () => { + return simple_solve( + ["python"], + [ + "https://prefix.dev/emscripten-forge-dev", + "https://prefix.dev/conda-forge", + ], + ["emscripten-wasm32", "noarch"], + ).then((result) => + expect(result.map((pkg) => pkg.url).sort()).toStrictEqual([ + "https://prefix.dev/emscripten-forge-dev/emscripten-wasm32/python-3.13.1-h_dd8ba0c_4_cp313.conda", + "https://prefix.dev/emscripten-forge-dev/emscripten-wasm32/python_abi-3.13.1-0_cp313.tar.bz2", + "https://prefix.dev/emscripten-forge-dev/noarch/emscripten-abi-3.1.73-h267e887_6.tar.bz2", + ]), + ); + }); +}); diff --git a/js-rattler/src/solve.ts b/js-rattler/src/solve.ts new file mode 100644 index 000000000..69976fac0 --- /dev/null +++ b/js-rattler/src/solve.ts @@ -0,0 +1 @@ +export { simple_solve, SolvedPackage } from "../pkg"; diff --git a/js-rattler/tests/wasm.rs b/js-rattler/tests/wasm.rs new file mode 100644 index 000000000..a50633330 --- /dev/null +++ b/js-rattler/tests/wasm.rs @@ -0,0 +1,23 @@ +use wasm_bindgen_test::*; + +#[wasm_bindgen_test] +async fn pass() { + js_rattler::solve::simple_solve( + ["python"].into_iter().map(str::to_string).collect(), + [ + "https://repo.prefix.dev/emscripten-forge-dev", + "https://repo.prefix.dev/conda-forge", + ] + .into_iter() + .map(str::to_string) + .collect(), + ["emscripten-wasm32", "noarch"] + .into_iter() + .map(str::to_string) + .collect(), + ) + .await + .unwrap(); +} + +wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); diff --git a/py-rattler/Cargo.lock b/py-rattler/Cargo.lock index 13d3cb66d..61166892c 100644 --- a/py-rattler/Cargo.lock +++ b/py-rattler/Cargo.lock @@ -50,17 +50,11 @@ dependencies = [ "memchr", ] -[[package]] -name = "aliasable" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" - [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -135,9 +129,9 @@ checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -158,9 +152,9 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ "event-listener", "event-listener-strategy", @@ -182,9 +176,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06575e6a9673580f52661c92107baabffbf41e2141373441cbcdc47cb733003c" +checksum = "310c9bcae737a48ef5cdee3174184e6d548b292739ede61a1f955ef76a738861" dependencies = [ "bzip2", "flate2", @@ -219,7 +213,7 @@ dependencies = [ "cfg-if", "pin-project", "rustix", - "thiserror 1.0.67", + "thiserror 1.0.69", "tokio", "windows-sys 0.52.0", ] @@ -237,9 +231,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if", @@ -779,9 +773,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -837,15 +831,18 @@ dependencies = [ [[package]] name = "boxcar" -version = "0.2.6" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba19c552ee63cb6646b75e1166d1bdb8a6d34a6d19e319dec88c8adadff2db3" +checksum = "225450ee9328e1e828319b48a89726cffc1b0ad26fd9211ad435de9fa376acae" +dependencies = [ + "loom", +] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytecount" @@ -877,21 +874,20 @@ dependencies = [ [[package]] name = "bzip2" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b89e7c29231c673a61a46e722602bcd138298f6b9e81e71119693534585f5c" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", ] [[package]] name = "bzip2-sys" -version = "0.1.12+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] @@ -943,9 +939,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.34" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -1028,7 +1024,7 @@ version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -1128,9 +1124,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1198,9 +1194,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -1340,9 +1336,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", @@ -1416,9 +1412,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "elliptic-curve" @@ -1442,9 +1438,9 @@ dependencies = [ [[package]] name = "elsa" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98e71ae4df57d214182a2e5cb90230c0192c6ddfcaa05c36453d46a54713e10" +checksum = "2343daaeabe09879d4ea058bb4f1e63da3fc07dadc6634e01bda1b3d6a9d9d2b" dependencies = [ "stable_deref_trait", ] @@ -1476,7 +1472,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -1496,9 +1492,9 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", "serde", @@ -1506,9 +1502,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", @@ -1523,9 +1519,9 @@ checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "erased-serde" @@ -1569,9 +1565,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ "event-listener", "pin-project-lite", @@ -1624,9 +1620,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.0.34" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "miniz_oxide", @@ -1755,9 +1751,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -1816,6 +1812,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.58.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1893,7 +1902,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 1.0.67", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -1902,12 +1911,12 @@ dependencies = [ [[package]] name = "google-cloud-metadata" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f945a208886a13d07636f38fb978da371d0abc3e34bad338124b9f8c135a8f" +checksum = "d901aeb453fd80e51d64df4ee005014f6cf39f2d736dd64f7239c132d9d39a6a" dependencies = [ "reqwest", - "thiserror 1.0.67", + "thiserror 1.0.69", "tokio", ] @@ -1952,9 +1961,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ "atomic-waker", "bytes", @@ -1997,21 +2006,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", "foldhash", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -2059,11 +2062,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2147,9 +2150,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -2198,14 +2201,14 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", + "h2 0.4.8", "http 1.2.0", "http-body 1.0.1", "httparse", @@ -2234,19 +2237,19 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http 1.2.0", - "hyper 1.5.0", + "hyper 1.6.0", "hyper-util", - "rustls 0.23.16", + "rustls 0.23.23", "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.1", "tower-service", "webpki-roots", ] @@ -2259,7 +2262,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.0", + "hyper 1.6.0", "hyper-util", "native-tls", "tokio", @@ -2278,7 +2281,7 @@ dependencies = [ "futures-util", "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.6.0", "pin-project-lite", "socket2", "tokio", @@ -2472,7 +2475,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -2497,9 +2500,9 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inout" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ "block-padding", "generic-array", @@ -2507,15 +2510,18 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.15" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" +checksum = "54b12ebb6799019b044deaf431eadfe23245b259bba5a2c0796acec3943a3cdb" +dependencies = [ + "rustversion", +] [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is_terminal_polyfill" @@ -2552,9 +2558,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" @@ -2584,7 +2590,7 @@ dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror 1.0.67", + "thiserror 1.0.69", ] [[package]] @@ -2599,11 +2605,11 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "9.3.0" +version = "9.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "js-sys", "pem", "ring", @@ -2623,7 +2629,7 @@ dependencies = [ "log", "secret-service", "security-framework 2.11.1", - "security-framework 3.0.0", + "security-framework 3.2.0", "windows-sys 0.59.0", "zbus", ] @@ -2710,15 +2716,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -2738,9 +2744,22 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.22" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] [[package]] name = "lru" @@ -2748,7 +2767,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] @@ -2808,20 +2827,19 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", @@ -2829,9 +2847,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -2873,6 +2891,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num" version = "0.4.3" @@ -2970,9 +2998,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3040,15 +3068,15 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.4.2+3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" dependencies = [ "cc", ] @@ -3102,34 +3130,16 @@ dependencies = [ ] [[package]] -name = "ouroboros" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59" -dependencies = [ - "aliasable", - "ouroboros_macro", - "static_assertions", -] - -[[package]] -name = "ouroboros_macro" -version = "0.18.5" +name = "outref" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn", -] +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] -name = "outref" -version = "0.5.1" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p256" @@ -3179,9 +3189,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem" -version = "3.0.4" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" dependencies = [ "base64 0.22.1", "serde", @@ -3215,7 +3225,7 @@ dependencies = [ "rustc-hash", "serde", "smallvec", - "thiserror 1.0.67", + "thiserror 1.0.69", "unicode-width", "url", "urlencoding", @@ -3240,9 +3250,9 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -3250,9 +3260,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand 0.8.5", @@ -3260,9 +3270,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -3274,9 +3284,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", "unicase", @@ -3284,18 +3294,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" dependencies = [ "proc-macro2", "quote", @@ -3356,9 +3366,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", @@ -3371,9 +3381,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "powerfmt" @@ -3401,26 +3411,13 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", - "yansi", -] - [[package]] name = "pulldown-cmark" version = "0.9.6" @@ -3443,7 +3440,7 @@ dependencies = [ "phf", "serde", "smartstring", - "thiserror 1.0.67", + "thiserror 1.0.69", "unicase", ] @@ -3560,7 +3557,7 @@ version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "pyo3-build-config", "quote", @@ -3607,44 +3604,47 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.16", + "rustls 0.23.23", "socket2", - "thiserror 1.0.67", + "thiserror 2.0.11", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom 0.2.15", "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.23.16", + "rustls 0.23.23", + "rustls-pki-types", "slab", - "thiserror 1.0.67", + "thiserror 2.0.11", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.6" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ "cfg_aliases", "libc", @@ -3688,7 +3688,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.2", - "zerocopy 0.8.20", + "zerocopy 0.8.21", ] [[package]] @@ -3727,12 +3727,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.20", + "zerocopy 0.8.21", ] [[package]] name = "rattler" -version = "0.32.2" +version = "0.32.3" dependencies = [ "anyhow", "console", @@ -3773,7 +3773,7 @@ dependencies = [ [[package]] name = "rattler_cache" -version = "0.3.11" +version = "0.3.12" dependencies = [ "anyhow", "dashmap", @@ -3803,7 +3803,7 @@ dependencies = [ [[package]] name = "rattler_conda_types" -version = "0.31.1" +version = "0.31.2" dependencies = [ "chrono", "dirs", @@ -3840,7 +3840,7 @@ dependencies = [ [[package]] name = "rattler_digest" -version = "1.0.6" +version = "1.0.7" dependencies = [ "blake2", "digest", @@ -3855,9 +3855,10 @@ dependencies = [ [[package]] name = "rattler_index" -version = "0.21.0" +version = "0.21.1" dependencies = [ "anyhow", + "bytes", "clap", "clap-verbosity-flag", "console", @@ -3880,7 +3881,7 @@ dependencies = [ [[package]] name = "rattler_lock" -version = "0.22.45" +version = "0.22.46" dependencies = [ "chrono", "file_url", @@ -3911,7 +3912,7 @@ dependencies = [ [[package]] name = "rattler_menuinst" -version = "0.2.0" +version = "0.2.1" dependencies = [ "chrono", "configparser", @@ -3939,7 +3940,7 @@ dependencies = [ [[package]] name = "rattler_networking" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -3968,7 +3969,7 @@ dependencies = [ [[package]] name = "rattler_package_streaming" -version = "0.22.30" +version = "0.22.31" dependencies = [ "bzip2", "chrono", @@ -4005,7 +4006,7 @@ dependencies = [ [[package]] name = "rattler_repodata_gateway" -version = "0.21.39" +version = "0.21.40" dependencies = [ "anyhow", "async-compression", @@ -4014,6 +4015,7 @@ dependencies = [ "blake2", "bytes", "cache_control", + "cfg-if", "chrono", "dashmap", "dirs", @@ -4028,9 +4030,7 @@ dependencies = [ "itertools 0.14.0", "json-patch", "libc", - "md-5", "memmap2", - "ouroboros", "parking_lot", "pin-project-lite", "rattler_cache", @@ -4042,6 +4042,7 @@ dependencies = [ "reqwest-middleware", "retry-policies", "rmp-serde", + "self_cell", "serde", "serde_json", "serde_with", @@ -4053,13 +4054,14 @@ dependencies = [ "tokio-util", "tracing", "url", + "wasmtimer", "windows-sys 0.59.0", "zstd", ] [[package]] name = "rattler_shell" -version = "0.22.21" +version = "0.22.22" dependencies = [ "enum_dispatch", "fs-err", @@ -4075,7 +4077,7 @@ dependencies = [ [[package]] name = "rattler_solve" -version = "1.3.10" +version = "1.3.11" dependencies = [ "chrono", "futures", @@ -4092,7 +4094,7 @@ dependencies = [ [[package]] name = "rattler_virtual_packages" -version = "2.0.5" +version = "2.0.6" dependencies = [ "archspec", "libloading", @@ -4129,9 +4131,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ "bitflags", ] @@ -4187,7 +4189,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -4202,9 +4204,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -4269,12 +4271,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.6", + "h2 0.4.8", "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", - "hyper-rustls 0.27.3", + "hyper 1.6.0", + "hyper-rustls 0.27.5", "hyper-tls", "hyper-util", "ipnet", @@ -4286,7 +4288,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.16", + "rustls 0.23.23", "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -4297,7 +4299,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.1", "tokio-util", "tower", "tower-service", @@ -4321,7 +4323,7 @@ dependencies = [ "http 1.2.0", "reqwest", "serde", - "thiserror 1.0.67", + "thiserror 1.0.69", "tower-service", ] @@ -4364,15 +4366,14 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" dependencies = [ "cc", "cfg-if", "getrandom 0.2.15", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] @@ -4418,9 +4419,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -4433,9 +4434,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags", "errno", @@ -4458,9 +4459,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "once_cell", "ring", @@ -4491,7 +4492,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.0.0", + "security-framework 3.2.0", ] [[package]] @@ -4514,9 +4515,12 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -4541,15 +4545,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "same-file" @@ -4562,13 +4566,19 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] +[[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" @@ -4633,9 +4643,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d0283c0a4a22a0f1b0e4edca251aa20b92fc96eaa09b84bec052f9415e9d71" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags", "core-foundation 0.10.0", @@ -4646,19 +4656,25 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", ] +[[package]] +name = "self_cell" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" + [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] @@ -4868,13 +4884,13 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint", "num-traits", - "thiserror 1.0.67", + "thiserror 2.0.11", "time", ] @@ -4887,9 +4903,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "skeptic" @@ -4937,20 +4953,14 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.6.0" @@ -4994,7 +5004,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -5026,9 +5036,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] @@ -5054,7 +5064,7 @@ dependencies = [ "byteorder", "enum-as-inner", "libc", - "thiserror 1.0.67", + "thiserror 1.0.69", "walkdir", ] @@ -5118,11 +5128,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.67", + "thiserror-impl 1.0.69", ] [[package]] @@ -5136,9 +5146,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b607164372e89797d78b8e23a6d67d5d1038c1c65efd52e1389ef8b77caba2a6" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -5168,9 +5178,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -5189,9 +5199,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -5218,9 +5228,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -5282,12 +5292,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.16", - "rustls-pki-types", + "rustls 0.23.23", "tokio", ] @@ -5312,9 +5321,9 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap 2.7.1", "toml_datetime", @@ -5380,6 +5389,17 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-subscriber" version = "0.3.19" @@ -5387,12 +5407,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", + "smallvec", "thread_local", "tracing", "tracing-core", + "tracing-log", ] [[package]] @@ -5421,9 +5444,9 @@ checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "uds_windows" @@ -5438,15 +5461,15 @@ dependencies = [ [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-normalization" @@ -5641,12 +5664,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] @@ -5696,11 +5720,25 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -5718,9 +5756,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ "rustls-pki-types", ] @@ -5777,6 +5815,16 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.60.0" @@ -5808,14 +5856,27 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" dependencies = [ - "windows-implement", - "windows-interface", + "windows-implement 0.59.0", + "windows-interface 0.59.0", "windows-link", "windows-result 0.3.1", "windows-strings 0.3.1", @@ -5831,6 +5892,17 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-implement" version = "0.59.0" @@ -5842,6 +5914,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.59.0" @@ -6069,9 +6152,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] @@ -6123,9 +6206,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", "linux-raw-sys", @@ -6148,17 +6231,11 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" - [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -6168,9 +6245,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", @@ -6252,11 +6329,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" +checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478" dependencies = [ - "zerocopy-derive 0.8.20", + "zerocopy-derive 0.8.21", ] [[package]] @@ -6272,9 +6349,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" +checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2" dependencies = [ "proc-macro2", "quote", @@ -6283,18 +6360,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -6373,18 +6450,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.1" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.14+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" dependencies = [ "cc", "pkg-config", diff --git a/py-rattler/src/repo_data/sparse.rs b/py-rattler/src/repo_data/sparse.rs index b1fc0b56a..0936f3086 100644 --- a/py-rattler/src/repo_data/sparse.rs +++ b/py-rattler/src/repo_data/sparse.rs @@ -33,7 +33,7 @@ impl<'a> From<&'a PySparseRepoData> for &'a SparseRepoData { impl PySparseRepoData { #[new] pub fn new(channel: PyChannel, subdir: String, path: PathBuf) -> PyResult { - Ok(SparseRepoData::new(channel.into(), subdir, path, None)?.into()) + Ok(SparseRepoData::from_file(channel.into(), subdir, path, None)?.into()) } pub fn package_names(&self) -> Vec {