diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 2732e390d..771ebd469 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -62,6 +62,7 @@ jobs: - name: NPM setup run: npm ci + working-directory: crates/bitwarden-wasm-internal/npm - name: Install rust uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable diff --git a/Cargo.lock b/Cargo.lock index 7cdf324b5..481cb9a9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,6 +390,7 @@ dependencies = [ "bitwarden-api-identity", "bitwarden-crypto", "bitwarden-error", + "bitwarden-uuid", "chrono", "getrandom 0.2.16", "log", @@ -403,7 +404,7 @@ dependencies = [ "serde_json", "serde_qs", "serde_repr", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tsify-next", "uniffi", @@ -442,7 +443,7 @@ dependencies = [ "sha1", "sha2", "subtle", - "thiserror 1.0.69", + "thiserror 2.0.12", "tsify-next", "typenum", "uniffi", @@ -476,7 +477,7 @@ dependencies = [ "quote", "serde", "syn", - "thiserror 1.0.69", + "thiserror 2.0.12", "tsify-next", "wasm-bindgen", ] @@ -498,7 +499,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", "tsify-next", "uniffi", "uuid", @@ -524,7 +525,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", "uniffi", "uuid", ] @@ -542,7 +543,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tsify-next", "uniffi", @@ -558,7 +559,7 @@ dependencies = [ "js-sys", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tsify-next", "wasm-bindgen", @@ -576,7 +577,7 @@ dependencies = [ "chrono", "serde", "serde_repr", - "thiserror 1.0.69", + "thiserror 2.0.12", "uniffi", "uuid", "wasm-bindgen", @@ -595,7 +596,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "uuid", "validator", @@ -616,7 +617,7 @@ dependencies = [ "rsa", "serde", "ssh-key", - "thiserror 1.0.69", + "thiserror 2.0.12", "tsify-next", "uniffi", "wasm-bindgen", @@ -633,7 +634,7 @@ dependencies = [ "log", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tsify-next", "wasm-bindgen", @@ -663,11 +664,30 @@ dependencies = [ "oslog", "rustls-platform-verifier", "schemars", - "thiserror 1.0.69", + "thiserror 2.0.12", "uniffi", "uuid", ] +[[package]] +name = "bitwarden-uuid" +version = "1.0.0" +dependencies = [ + "bitwarden-uuid-macro", + "serde", + "serde_json", + "uuid", +] + +[[package]] +name = "bitwarden-uuid-macro" +version = "1.0.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "bitwarden-vault" version = "1.0.0" @@ -688,7 +708,7 @@ dependencies = [ "serde_repr", "sha1", "sha2", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tsify-next", "uniffi", diff --git a/Cargo.toml b/Cargo.toml index 8e973a614..32527d766 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,8 @@ bitwarden-api-identity = { path = "crates/bitwarden-api-identity", version = "=1 bitwarden-cli = { path = "crates/bitwarden-cli", version = "=1.0.0" } bitwarden-core = { path = "crates/bitwarden-core", version = "=1.0.0" } bitwarden-crypto = { path = "crates/bitwarden-crypto", version = "=1.0.0" } +bitwarden-error = { path = "crates/bitwarden-error", version = "=1.0.0" } +bitwarden-error-macro = { path = "crates/bitwarden-error-macro", version = "=1.0.0" } bitwarden-exporters = { path = "crates/bitwarden-exporters", version = "=1.0.0" } bitwarden-fido = { path = "crates/bitwarden-fido", version = "=1.0.0" } bitwarden-generators = { path = "crates/bitwarden-generators", version = "=1.0.0" } @@ -32,9 +34,9 @@ bitwarden-send = { path = "crates/bitwarden-send", version = "=1.0.0" } bitwarden-threading = { path = "crates/bitwarden-threading", version = "=1.0.0" } bitwarden-sm = { path = "bitwarden_license/bitwarden-sm", version = "=1.0.0" } bitwarden-ssh = { path = "crates/bitwarden-ssh", version = "=1.0.0" } +bitwarden-uuid = { path = "crates/bitwarden-uuid", version = "=1.0.0" } +bitwarden-uuid-macro = { path = "crates/bitwarden-uuid-macro", version = "=1.0.0" } bitwarden-vault = { path = "crates/bitwarden-vault", version = "=1.0.0" } -bitwarden-error = { path = "crates/bitwarden-error", version = "=1.0.0" } -bitwarden-error-macro = { path = "crates/bitwarden-error-macro", version = "=1.0.0" } # External crates that are expected to maintain a consistent version across all crates chrono = { version = ">=0.4.26, <0.5", features = [ @@ -42,7 +44,10 @@ chrono = { version = ">=0.4.26, <0.5", features = [ "serde", "std", ], default-features = false } +js-sys = { version = ">=0.3.72, <0.4" } log = ">=0.4.18, <0.5" +proc-macro2 = ">=1.0.89, <2" +quote = ">=1.0.37, <2" reqwest = { version = ">=0.12.5, <0.13", features = [ "json", "multipart", @@ -53,6 +58,7 @@ serde = { version = ">=1.0, <2.0", features = ["derive"] } serde_json = ">=1.0.96, <2.0" serde_qs = ">=0.12.0, <0.16" serde_repr = ">=0.1.12, <0.2" +syn = ">=2.0.87, <3" thiserror = ">=1.0.40, <3" tokio = { version = "1.36.0", features = ["macros"] } tsify-next = { version = ">=0.5.4, <0.6", features = [ @@ -62,7 +68,6 @@ uniffi = "=0.28.3" uuid = { version = ">=1.3.3, <2.0", features = ["serde", "v4", "js"] } validator = { version = ">=0.18.1, <0.20", features = ["derive"] } wasm-bindgen = { version = ">=0.2.91, <0.3", features = ["serde-serialize"] } -js-sys = { version = ">=0.3.72, <0.4" } wasm-bindgen-futures = "0.4.41" wasm-bindgen-test = "0.3.45" diff --git a/crates/bitwarden-core/Cargo.toml b/crates/bitwarden-core/Cargo.toml index 55625b662..a846f6edd 100644 --- a/crates/bitwarden-core/Cargo.toml +++ b/crates/bitwarden-core/Cargo.toml @@ -33,6 +33,7 @@ bitwarden-api-api = { workspace = true } bitwarden-api-identity = { workspace = true } bitwarden-crypto = { workspace = true } bitwarden-error = { workspace = true } +bitwarden-uuid = { workspace = true } chrono = { workspace = true, features = ["std"] } # We don't use this directly (it's used by rand), but we need it here to enable WASM support getrandom = { version = ">=0.2.9, <0.3", features = ["js"] } diff --git a/crates/bitwarden-core/src/ids.rs b/crates/bitwarden-core/src/ids.rs new file mode 100644 index 000000000..e86527044 --- /dev/null +++ b/crates/bitwarden-core/src/ids.rs @@ -0,0 +1,3 @@ +use bitwarden_uuid::uuid; + +uuid!(pub OrganizationId); diff --git a/crates/bitwarden-core/src/lib.rs b/crates/bitwarden-core/src/lib.rs index 3172ca698..18885fa1f 100644 --- a/crates/bitwarden-core/src/lib.rs +++ b/crates/bitwarden-core/src/lib.rs @@ -25,3 +25,6 @@ mod util; pub use bitwarden_crypto::ZeroizingAllocator; pub use client::{Client, ClientSettings, DeviceType}; + +mod ids; +pub use ids::*; diff --git a/crates/bitwarden-error-macro/Cargo.toml b/crates/bitwarden-error-macro/Cargo.toml index b5bf87f14..3e9831abc 100644 --- a/crates/bitwarden-error-macro/Cargo.toml +++ b/crates/bitwarden-error-macro/Cargo.toml @@ -19,9 +19,9 @@ wasm = [] [dependencies] darling = "0.20.10" -proc-macro2 = "1.0.89" -quote = "1.0.37" -syn = "2.0.87" +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true } [lints] workspace = true diff --git a/crates/bitwarden-uniffi/src/vault/ciphers.rs b/crates/bitwarden-uniffi/src/vault/ciphers.rs index 030c05002..e1002da97 100644 --- a/crates/bitwarden-uniffi/src/vault/ciphers.rs +++ b/crates/bitwarden-uniffi/src/vault/ciphers.rs @@ -1,3 +1,4 @@ +use bitwarden_core::OrganizationId; use bitwarden_vault::{Cipher, CipherListView, CipherView, EncryptionContext, Fido2CredentialView}; use uuid::Uuid; @@ -41,7 +42,7 @@ impl CiphersClient { ) -> Result<CipherView> { Ok(self .0 - .move_to_organization(cipher, organization_id) + .move_to_organization(cipher, OrganizationId::new(organization_id)) .map_err(Error::Cipher)?) } } diff --git a/crates/bitwarden-uuid-macro/Cargo.toml b/crates/bitwarden-uuid-macro/Cargo.toml new file mode 100644 index 000000000..927507401 --- /dev/null +++ b/crates/bitwarden-uuid-macro/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "bitwarden-uuid-macro" +description = """ +Internal crate for the bitwarden crate. Do not use. +""" + +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +readme.workspace = true +homepage.workspace = true +repository.workspace = true +license-file.workspace = true +keywords.workspace = true + +[dependencies] +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true } + +[lints] +workspace = true + +[lib] +proc-macro = true diff --git a/crates/bitwarden-uuid-macro/README.md b/crates/bitwarden-uuid-macro/README.md new file mode 100644 index 000000000..2630b5c65 --- /dev/null +++ b/crates/bitwarden-uuid-macro/README.md @@ -0,0 +1,3 @@ +# Bitwarden UUID Macro + +Provides uuid macros for simplifying UUID handling when working with WebAssembly. diff --git a/crates/bitwarden-uuid-macro/src/lib.rs b/crates/bitwarden-uuid-macro/src/lib.rs new file mode 100644 index 000000000..87ebbab47 --- /dev/null +++ b/crates/bitwarden-uuid-macro/src/lib.rs @@ -0,0 +1,75 @@ +#![doc = include_str!("../README.md")] + +use proc_macro::TokenStream; +use quote::quote; +use syn::{ + parse::{Parse, ParseStream}, + parse_macro_input, Ident, Visibility, +}; + +#[proc_macro] +pub fn uuid(input: TokenStream) -> TokenStream { + // Parse input as: vis ident + let input = parse_macro_input!(input as IdTypeInput); + let ident = input.ident; + let vis = input.vis; + let name_str = ident.to_string(); + + let tsify_type = format!("Tagged<Uuid, \"{}\">", name_str); + let doc_string = format!(" NewType wrapper for `{}`", name_str); + + let expanded = quote! { + #[doc = #doc_string] + #[cfg_attr(feature = "wasm", derive(::tsify_next::Tsify), tsify(into_wasm_abi, from_wasm_abi))] + #[derive( + ::serde::Serialize, ::serde::Deserialize, + ::std::cmp::PartialEq, ::std::cmp::Eq, + ::std::clone::Clone, ::std::marker::Copy, ::std::fmt::Debug + )] + #[repr(transparent)] + #vis struct #ident + ( + #[cfg_attr(feature = "wasm", tsify(type = #tsify_type))] + ::uuid::Uuid + ); + + #[cfg(feature = "uniffi")] + uniffi::custom_newtype!(#ident, uuid::Uuid); + + impl #ident { + pub fn new(value: uuid::Uuid) -> Self { + Self(value) + } + } + + impl ::std::str::FromStr for #ident { + type Err = uuid::Error; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + uuid::Uuid::from_str(s).map(Self) + } + } + + impl From<#ident> for ::uuid::Uuid { + fn from(value: #ident) -> Self { + value.0 + } + } + }; + + TokenStream::from(expanded) +} + +// Helper struct to parse "vis ident" +struct IdTypeInput { + vis: Visibility, + ident: Ident, +} + +impl Parse for IdTypeInput { + fn parse(input: ParseStream) -> syn::Result<Self> { + let vis: Visibility = input.parse()?; + let ident: Ident = input.parse()?; + Ok(IdTypeInput { vis, ident }) + } +} diff --git a/crates/bitwarden-uuid/Cargo.toml b/crates/bitwarden-uuid/Cargo.toml new file mode 100644 index 000000000..50e0fe5a1 --- /dev/null +++ b/crates/bitwarden-uuid/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "bitwarden-uuid" +description = """ +Internal crate for the bitwarden crate. Do not use. +""" + +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +readme.workspace = true +homepage.workspace = true +repository.workspace = true +license-file.workspace = true +keywords.workspace = true + +[dependencies] +bitwarden-uuid-macro = { workspace = true } + +[lints] +workspace = true + +[dev-dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +uuid = { workspace = true } diff --git a/crates/bitwarden-uuid/README.md b/crates/bitwarden-uuid/README.md new file mode 100644 index 000000000..8f63ca9d2 --- /dev/null +++ b/crates/bitwarden-uuid/README.md @@ -0,0 +1,3 @@ +# Bitwarden UUID + +Provides UUID macros for simplifying UUID handling when working with WebAssembly. diff --git a/crates/bitwarden-uuid/src/lib.rs b/crates/bitwarden-uuid/src/lib.rs new file mode 100644 index 000000000..870be9095 --- /dev/null +++ b/crates/bitwarden-uuid/src/lib.rs @@ -0,0 +1,3 @@ +#![doc = include_str!("../README.md")] + +pub use bitwarden_uuid_macro::uuid; diff --git a/crates/bitwarden-uuid/tests/uuid.rs b/crates/bitwarden-uuid/tests/uuid.rs new file mode 100644 index 000000000..519829d10 --- /dev/null +++ b/crates/bitwarden-uuid/tests/uuid.rs @@ -0,0 +1,44 @@ +#![allow(unexpected_cfgs)] + +use bitwarden_uuid::uuid; + +uuid!(TestId); + +#[test] +fn test_parse_string() { + use uuid::Uuid; + + let id: TestId = "12345678-1234-5678-1234-567812345678".parse().unwrap(); + let uuid: Uuid = id.into(); + + assert_eq!(uuid.to_string(), "12345678-1234-5678-1234-567812345678"); +} + +#[test] +fn test_new() { + use uuid::Uuid; + + let uuid = Uuid::new_v4(); + let id = TestId::new(uuid); + + assert_eq!(uuid, Into::<Uuid>::into(id)); +} + +#[test] +fn test_serialize() { + let id: TestId = "d4a722ff-ce51-47f1-ba42-c2216f547851".parse().unwrap(); + + let serialized = serde_json::to_string(&id).unwrap(); + + assert_eq!(serialized, "\"d4a722ff-ce51-47f1-ba42-c2216f547851\""); +} + +#[test] +fn test_deserialize() { + let id: TestId = "d4a722ff-ce51-47f1-ba42-c2216f547851".parse().unwrap(); + + let deserialized: TestId = + serde_json::from_str("\"d4a722ff-ce51-47f1-ba42-c2216f547851\"").unwrap(); + + assert_eq!(id, deserialized); +} diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 028a48736..e347302e5 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -1,16 +1,19 @@ -use bitwarden_core::Client; +use bitwarden_core::{Client, OrganizationId}; use bitwarden_crypto::IdentifyKey; -use uuid::Uuid; +#[cfg(feature = "wasm")] +use wasm_bindgen::prelude::*; use super::EncryptionContext; use crate::{ Cipher, CipherError, CipherListView, CipherView, DecryptError, EncryptError, VaultClient, }; +#[cfg_attr(feature = "wasm", wasm_bindgen)] pub struct CiphersClient { pub(crate) client: Client, } +#[cfg_attr(feature = "wasm", wasm_bindgen)] impl CiphersClient { pub fn encrypt(&self, mut cipher_view: CipherView) -> Result<EncryptionContext, EncryptError> { let user_id = self @@ -64,10 +67,10 @@ impl CiphersClient { pub fn move_to_organization( &self, mut cipher_view: CipherView, - organization_id: Uuid, + organization_id: OrganizationId, ) -> Result<CipherView, CipherError> { let key_store = self.client.internal.get_key_store(); - cipher_view.move_to_organization(&mut key_store.context(), organization_id)?; + cipher_view.move_to_organization(&mut key_store.context(), organization_id.into())?; Ok(cipher_view) } diff --git a/crates/bitwarden-vault/src/folder_client.rs b/crates/bitwarden-vault/src/folder_client.rs index 6821f90f0..a238f834b 100644 --- a/crates/bitwarden-vault/src/folder_client.rs +++ b/crates/bitwarden-vault/src/folder_client.rs @@ -1,14 +1,18 @@ use bitwarden_core::Client; +#[cfg(feature = "wasm")] +use wasm_bindgen::prelude::*; use crate::{ error::{DecryptError, EncryptError}, Folder, FolderView, VaultClient, }; +#[cfg_attr(feature = "wasm", wasm_bindgen)] pub struct FoldersClient { pub(crate) client: Client, } +#[cfg_attr(feature = "wasm", wasm_bindgen)] impl FoldersClient { pub fn encrypt(&self, folder_view: FolderView) -> Result<Folder, EncryptError> { let key_store = self.client.internal.get_key_store(); diff --git a/crates/bitwarden-wasm-internal/build.sh b/crates/bitwarden-wasm-internal/build.sh index e2c5c4b74..a22616893 100755 --- a/crates/bitwarden-wasm-internal/build.sh +++ b/crates/bitwarden-wasm-internal/build.sh @@ -41,4 +41,5 @@ wasm2js -Os ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm npx terser ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js # Typecheck the generated TypeScript definitions -npx tsc --noEmit --lib es2015 crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal.d.ts +cd crates/bitwarden-wasm-internal/npm +npx tsc --noEmit --lib es2020 bitwarden_wasm_internal.d.ts diff --git a/crates/bitwarden-wasm-internal/npm/package-lock.json b/crates/bitwarden-wasm-internal/npm/package-lock.json new file mode 100644 index 000000000..5d6e4cbfc --- /dev/null +++ b/crates/bitwarden-wasm-internal/npm/package-lock.json @@ -0,0 +1,45 @@ +{ + "name": "@bitwarden/sdk-internal", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@bitwarden/sdk-internal", + "version": "0.1.0", + "license": "GPL-3.0", + "dependencies": { + "type-fest": "^4.41.0" + }, + "devDependencies": { + "typescript": "5.8.3" + } + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/crates/bitwarden-wasm-internal/npm/package.json b/crates/bitwarden-wasm-internal/npm/package.json index 82d3a879c..25e884098 100644 --- a/crates/bitwarden-wasm-internal/npm/package.json +++ b/crates/bitwarden-wasm-internal/npm/package.json @@ -22,5 +22,11 @@ "scripts": {}, "sideEffects": [ "./bitwarden_wasm_internal.js" - ] + ], + "dependencies": { + "type-fest": "^4.41.0" + }, + "devDependencies": { + "typescript": "5.8.3" + } } diff --git a/crates/bitwarden-wasm-internal/src/custom_types.rs b/crates/bitwarden-wasm-internal/src/custom_types.rs index 8d20bf85d..cae9ead52 100644 --- a/crates/bitwarden-wasm-internal/src/custom_types.rs +++ b/crates/bitwarden-wasm-internal/src/custom_types.rs @@ -2,7 +2,15 @@ /// Everything in the string below is appended to the generated TypeScript definition file. #[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] const TS_CUSTOM_TYPES: &'static str = r#" -export type Uuid = string; + +import { Tagged } from "type-fest"; + +/** + * A string that **MUST** be a valid UUID. + * + * Never create or cast to this type directly, use the `uuid<T>()` function instead. + */ +export type Uuid = unknown; /** * RFC3339 compliant date-time string. diff --git a/crates/bitwarden-wasm-internal/src/lib.rs b/crates/bitwarden-wasm-internal/src/lib.rs index 3c4e909db..0b4b285ed 100644 --- a/crates/bitwarden-wasm-internal/src/lib.rs +++ b/crates/bitwarden-wasm-internal/src/lib.rs @@ -12,4 +12,4 @@ pub use bitwarden_ipc::wasm::*; pub use client::BitwardenClient; pub use crypto::CryptoClient; pub use init::init_sdk; -pub use vault::{folders::FoldersClient, VaultClient}; +pub use vault::VaultClient; diff --git a/crates/bitwarden-wasm-internal/src/vault/ciphers.rs b/crates/bitwarden-wasm-internal/src/vault/ciphers.rs deleted file mode 100644 index 029a9b594..000000000 --- a/crates/bitwarden-wasm-internal/src/vault/ciphers.rs +++ /dev/null @@ -1,86 +0,0 @@ -use bitwarden_vault::{ - Cipher, CipherError, CipherListView, CipherView, DecryptError, EncryptError, EncryptionContext, - Fido2CredentialView, -}; -use wasm_bindgen::prelude::wasm_bindgen; - -#[wasm_bindgen] -pub struct CiphersClient(bitwarden_vault::CiphersClient); - -impl CiphersClient { - pub fn new(client: bitwarden_vault::CiphersClient) -> Self { - Self(client) - } -} - -#[wasm_bindgen] -impl CiphersClient { - /// Encrypt cipher - /// - /// # Arguments - /// - `cipher_view` - The decrypted cipher to encrypt - /// - /// # Returns - /// - `Ok(Cipher)` containing the encrypted cipher - /// - `Err(EncryptError)` if encryption fails - pub fn encrypt(&self, cipher_view: CipherView) -> Result<EncryptionContext, EncryptError> { - self.0.encrypt(cipher_view) - } - - /// Decrypt cipher - /// - /// # Arguments - /// - `cipher` - The encrypted cipher to decrypt - /// - /// # Returns - /// - `Ok(CipherView)` containing the decrypted cipher - /// - `Err(DecryptError)` if decryption fails - pub fn decrypt(&self, cipher: Cipher) -> Result<CipherView, DecryptError> { - self.0.decrypt(cipher) - } - - /// Decrypt list of ciphers - /// - /// # Arguments - /// - `ciphers` - The list of encrypted ciphers to decrypt - /// - /// # Returns - /// - `Ok(Vec<CipherListView>)` containing the decrypted ciphers - /// - `Err(DecryptError)` if decryption fails - pub fn decrypt_list(&self, ciphers: Vec<Cipher>) -> Result<Vec<CipherListView>, DecryptError> { - self.0.decrypt_list(ciphers) - } - - /// Decrypt FIDO2 credentials - /// - /// # Arguments - /// - `cipher_view` - Cipher to encrypt containing the FIDO2 credential - /// - /// # Returns - /// - `Ok(Vec<Fido2CredentialView>)` containing the decrypted FIDO2 credentials - /// - `Err(DecryptError)` if decryption fails - pub fn decrypt_fido2_credentials( - &self, - cipher_view: CipherView, - ) -> Result<Vec<Fido2CredentialView>, DecryptError> { - self.0.decrypt_fido2_credentials(cipher_view) - } - - /// Decrypt key - /// - /// This method is a temporary solution to allow typescript client access to decrypted key - /// values, particularly for FIDO2 credentials. - /// - /// # Arguments - /// - `cipher_view` - Decrypted cipher containing the key - /// - /// # Returns - /// - `Ok(String)` containing the decrypted key - /// - `Err(CipherError)` - pub fn decrypt_fido2_private_key( - &self, - cipher_view: CipherView, - ) -> Result<String, CipherError> { - self.0.decrypt_fido2_private_key(cipher_view) - } -} diff --git a/crates/bitwarden-wasm-internal/src/vault/folders.rs b/crates/bitwarden-wasm-internal/src/vault/folders.rs deleted file mode 100644 index 92900b03d..000000000 --- a/crates/bitwarden-wasm-internal/src/vault/folders.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bitwarden_vault::{DecryptError, Folder, FolderView}; -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub struct FoldersClient(bitwarden_vault::FoldersClient); - -impl FoldersClient { - pub fn new(client: bitwarden_vault::FoldersClient) -> Self { - Self(client) - } -} - -#[wasm_bindgen] -impl FoldersClient { - /// Decrypt folder - pub fn decrypt(&self, folder: Folder) -> Result<FolderView, DecryptError> { - self.0.decrypt(folder) - } -} diff --git a/crates/bitwarden-wasm-internal/src/vault/mod.rs b/crates/bitwarden-wasm-internal/src/vault/mod.rs index d0e4e1180..bbb980cfc 100644 --- a/crates/bitwarden-wasm-internal/src/vault/mod.rs +++ b/crates/bitwarden-wasm-internal/src/vault/mod.rs @@ -1,15 +1,11 @@ pub mod attachments; -pub mod ciphers; -pub mod folders; pub mod totp; use attachments::AttachmentsClient; -use ciphers::CiphersClient; +use bitwarden_vault::{CiphersClient, FoldersClient}; use totp::TotpClient; use wasm_bindgen::prelude::*; -use crate::FoldersClient; - #[wasm_bindgen] pub struct VaultClient(bitwarden_vault::VaultClient); @@ -26,11 +22,11 @@ impl VaultClient { } pub fn ciphers(&self) -> CiphersClient { - CiphersClient::new(self.0.ciphers()) + self.0.ciphers() } pub fn folders(&self) -> FoldersClient { - FoldersClient::new(self.0.folders()) + self.0.folders() } pub fn totp(&self) -> TotpClient { diff --git a/package-lock.json b/package-lock.json index bb245d439..631b50379 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,19 +10,15 @@ "license": "SEE LICENSE IN LICENSE", "devDependencies": { "@openapitools/openapi-generator-cli": "2.20.0", - "prettier": "3.5.3", - "typescript": "5.8.3" + "prettier": "3.5.3" } }, "node_modules/@babel/runtime": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz", - "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", "dev": true, "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, "engines": { "node": ">=6.9.0" } @@ -37,84 +33,6 @@ "node": ">=8" } }, - "node_modules/@nestjs/axios": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.0.tgz", - "integrity": "sha512-1cB+Jyltu/uUPNQrpUimRHEQHrnQrpLzVj6dU3dgn6iDDDdahr10TgHFGTmw5VuJ9GzKZsCLDL78VSwJAs/9JQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@nestjs/common": "^10.0.0 || ^11.0.0", - "axios": "^1.3.1", - "rxjs": "^7.0.0" - } - }, - "node_modules/@nestjs/common": { - "version": "10.4.6", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.6.tgz", - "integrity": "sha512-KkezkZvU9poWaNq4L+lNvx+386hpOxPJkfXBBeSMrcqBOx8kVr36TGN2uYkF4Ta4zNu1KbCjmZbc0rhHSg296g==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "iterare": "1.2.1", - "tslib": "2.7.0", - "uid": "2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nest" - }, - "peerDependencies": { - "class-transformer": "*", - "class-validator": "*", - "reflect-metadata": "^0.1.12 || ^0.2.0", - "rxjs": "^7.1.0" - }, - "peerDependenciesMeta": { - "class-transformer": { - "optional": true - }, - "class-validator": { - "optional": true - } - } - }, - "node_modules/@nestjs/common/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true, - "license": "0BSD", - "peer": true - }, - "node_modules/@nuxt/opencollective": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz", - "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "consola": "^3.2.3" - }, - "bin": { - "opencollective": "bin/opencollective.js" - }, - "engines": { - "node": "^14.18.0 || >=16.10.0", - "npm": ">=5.10.0" - } - }, - "node_modules/@nuxt/opencollective/node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, "node_modules/@nuxtjs/opencollective": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", @@ -172,6 +90,18 @@ "url": "https://opencollective.com/openapi_generator" } }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/axios": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.0.tgz", + "integrity": "sha512-1cB+Jyltu/uUPNQrpUimRHEQHrnQrpLzVj6dU3dgn6iDDDdahr10TgHFGTmw5VuJ9GzKZsCLDL78VSwJAs/9JQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "axios": "^1.3.1", + "rxjs": "^7.0.0" + } + }, "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/common": { "version": "11.0.20", "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.0.20.tgz", @@ -246,14 +176,31 @@ } } }, - "node_modules/@openapitools/openapi-generator-cli/node_modules/path-to-regexp": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", - "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "node_modules/@openapitools/openapi-generator-cli/node_modules/@nuxt/opencollective": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz", + "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==", "dev": true, "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, "engines": { - "node": ">=16" + "node": "^14.18.0 || >=16.10.0", + "npm": ">=5.10.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" } }, "node_modules/@tokenizer/inflate": { @@ -423,6 +370,21 @@ "readable-stream": "^3.4.0" } }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -645,6 +607,23 @@ "node": ">=10.0.0" } }, + "node_modules/concurrently/node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/concurrently/node_modules/rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -681,6 +660,35 @@ "dev": true, "license": "0BSD" }, + "node_modules/concurrently/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/consola": { "version": "2.15.3", "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", @@ -711,27 +719,10 @@ "node": ">= 14" } }, - "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1157,6 +1148,40 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -1447,11 +1472,14 @@ } }, "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "dev": true, - "license": "ISC" + "license": "ISC", + "engines": { + "node": ">=12" + } }, "node_modules/math-intrinsics": { "version": "1.1.0", @@ -1651,31 +1679,14 @@ "node": ">= 14" } }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", "dev": true, - "license": "ISC", + "license": "MIT", "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16" } }, "node_modules/peek-readable": { @@ -1728,16 +1739,6 @@ "node": ">= 14" } }, - "node_modules/proxy-agent/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -1745,21 +1746,6 @@ "dev": true, "license": "MIT" }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/reflect-metadata": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", @@ -1767,13 +1753,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true, - "license": "MIT" - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1864,21 +1843,6 @@ "npm": ">= 3.0.0" } }, - "node_modules/socks": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", - "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ip-address": "^9.0.5", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" - } - }, "node_modules/socks-proxy-agent": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", @@ -1894,6 +1858,21 @@ "node": ">= 14" } }, + "node_modules/socks-proxy-agent/node_modules/socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2062,20 +2041,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/uid": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", @@ -2162,35 +2127,6 @@ "node": ">=8" } }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/yargs-parser": { "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", diff --git a/package.json b/package.json index 7e8c726b8..2fa2d0fd8 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ }, "devDependencies": { "@openapitools/openapi-generator-cli": "2.20.0", - "prettier": "3.5.3", - "typescript": "5.8.3" + "prettier": "3.5.3" } }