Skip to content

Commit 6a31cf6

Browse files
authored
[PM-27530] Rename BitwardenClient to PasswordManagerClient (#571)
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Jira description: We renamed BitwardenClient to be PasswordManagerClient internally in the SDK, but the ones we exposed through FFI are still just called Client/BitwardenClient for backwards compatibility. For consistency against our documentation, we shouldt rename and expose deprecated type aliases with the old name temporarily. ## 🚨 Breaking Changes Breaks places where `BitwardenClient` is used as a value (e.g. `new BitwardenClient` or `typeof BitwardenClient`). Fixes can be found here: bitwarden/clients#17578 ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent f118570 commit 6a31cf6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

crates/bitwarden-wasm-internal/src/client.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,33 @@ use std::{fmt::Display, sync::Arc};
33

44
use bitwarden_core::ClientSettings;
55
use bitwarden_error::bitwarden_error;
6-
use bitwarden_pm::{PasswordManagerClient, clients::*};
6+
use bitwarden_pm::{PasswordManagerClient as InnerPasswordManagerClient, clients::*};
77
use wasm_bindgen::prelude::*;
88

99
use crate::platform::{
1010
PlatformClient,
1111
token_provider::{JsTokenProvider, WasmClientManagedTokens},
1212
};
1313

14+
#[wasm_bindgen(typescript_custom_section)]
15+
const TOKEN_CUSTOM_TS_TYPE: &'static str = r#"
16+
/**
17+
* @deprecated Use PasswordManagerClient instead
18+
*/
19+
export type BitwardenClient = PasswordManagerClient;
20+
"#;
21+
1422
/// The main entry point for the Bitwarden SDK in WebAssembly environments
1523
#[wasm_bindgen]
16-
pub struct BitwardenClient(pub(crate) PasswordManagerClient);
24+
pub struct PasswordManagerClient(pub(crate) InnerPasswordManagerClient);
1725

1826
#[wasm_bindgen]
19-
impl BitwardenClient {
27+
impl PasswordManagerClient {
2028
/// Initialize a new instance of the SDK client
2129
#[wasm_bindgen(constructor)]
2230
pub fn new(token_provider: JsTokenProvider, settings: Option<ClientSettings>) -> Self {
2331
let tokens = Arc::new(WasmClientManagedTokens::new(token_provider));
24-
Self(PasswordManagerClient::new_with_client_tokens(
32+
Self(InnerPasswordManagerClient::new_with_client_tokens(
2533
settings, tokens,
2634
))
2735
}

crates/bitwarden-wasm-internal/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ mod pure_crypto;
88
mod ssh;
99

1010
pub use bitwarden_ipc::wasm::*;
11-
pub use client::BitwardenClient;
11+
pub use client::PasswordManagerClient;
1212
pub use init::init_sdk;

0 commit comments

Comments
 (0)