use crate::NetworkMode;
use crate::config::{FetchPolicy, NpmConfig};
use std::collections::BTreeMap;
use std::sync::Mutex;
mod access;
mod body;
mod cache;
mod dist_tags;
mod endpoints;
mod http;
mod lifecycle;
mod packument;
mod parse;
mod request;
mod tarball;
#[cfg(test)]
mod retry_tests;
#[cfg(test)]
mod seed_tests;
#[cfg(test)]
mod slow_tarball_tests;
pub use cache::CachedPackumentLookup;
use dist_tags::*;
pub use endpoints::PackageSearchResult;
pub(crate) use http::probe_client_builder;
use http::*;
use parse::{parse_full_response, parse_full_response_seed};
const PACKUMENT_ACCEPT: &str =
"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*";
const PACKUMENT_FULL_ACCEPT: &str = "application/json; q=1.0, */*";
const AUDIT_BODY_CAP: u64 = 256 << 20;
pub struct RegistryClient {
http: reqwest::Client,
http_by_uri: BTreeMap<String, reqwest::Client>,
http_by_uri_scope: BTreeMap<String, BTreeMap<String, reqwest::Client>>,
http_tarball: reqwest::Client,
token_helper_cache: Mutex<BTreeMap<String, Option<String>>>,
auth_token_by_url: Mutex<BTreeMap<String, Option<String>>>,
packument_in_flight:
Mutex<aube_util::collections::FxMap<String, std::sync::Arc<tokio::sync::Mutex<()>>>>,
config: NpmConfig,
network_mode: NetworkMode,
fetch_policy: FetchPolicy,
}