From 9bf00d1c4d1002c70e729eae880dd464ead08dad Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Thu, 4 Sep 2025 19:42:22 +0200 Subject: [PATCH 1/5] feat: clone bitwarden-wasm-internal --- Cargo.lock | 10 + .../bit-bitwarden-wasm-internal/Cargo.toml | 26 +++ .../bit-bitwarden-wasm-internal/README.md | 31 +++ .../bit-bitwarden-wasm-internal/build.rs | 55 ++++++ .../bit-bitwarden-wasm-internal/build.sh | 45 +++++ .../npm/.gitignore | 9 + .../bit-bitwarden-wasm-internal/npm/LICENSE | 182 ++++++++++++++++++ .../bit-bitwarden-wasm-internal/npm/README.md | 3 + .../bit-bitwarden-wasm-internal/npm/index.js | 8 + .../npm/package-lock.json | 45 +++++ .../npm/package.json | 32 +++ .../bit-bitwarden-wasm-internal/src/client.rs | 26 +++ .../bit-bitwarden-wasm-internal/src/lib.rs | 5 + 13 files changed, 477 insertions(+) create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/README.md create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/build.rs create mode 100755 bitwarden_license/bit-bitwarden-wasm-internal/build.sh create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/npm/LICENSE create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/npm/README.md create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/npm/index.js create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/npm/package-lock.json create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 41439a0d7..f58737390 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,6 +290,16 @@ dependencies = [ "sha2", ] +[[package]] +name = "bit-bitwarden-wasm-internal" +version = "0.1.0" +dependencies = [ + "serde", + "tsify", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "bit-set" version = "0.5.3" diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml b/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml new file mode 100644 index 000000000..852aa1885 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "bit-bitwarden-wasm-internal" +version = "0.1.0" +publish = false + +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 + +[lib] +crate-type = ["cdylib"] + +[dependencies] +serde = { workspace = true } +tsify = { workspace = true } +# When upgrading wasm-bindgen, make sure to update the version in the workflows! +wasm-bindgen = { version = "=0.2.100", features = ["serde-serialize"] } +wasm-bindgen-futures = "0.4.41" + +[lints] +workspace = true diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/README.md b/bitwarden_license/bit-bitwarden-wasm-internal/README.md new file mode 100644 index 000000000..e4727ed38 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/README.md @@ -0,0 +1,31 @@ +# bitwarden-wasm-internal + +**Note:** This is only for internal use. Bitwarden will not provide any support for this crate. + +Bitwarden WASM internal exposes WebAssembly bindings for the Bitwarden SDK. This crate should +contain no logic but rather only handle WASM unique conversions and bindings. Business logic +**MUST** be placed in the relevant feature crates. + +## Getting Started + +### Requirements + +- `wasm32-unknown-unknown` rust target. +- `wasm-bindgen-cli` installed. +- `binaryen` installed for `wasm-opt` and `wasm2js`. + +```bash +rustup target add wasm32-unknown-unknown +cargo install -f wasm-bindgen-cli +brew install binaryen +``` + +### Building + +```bash +# dev +./build.sh + +# release +./build.sh -r +``` diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/build.rs b/bitwarden_license/bit-bitwarden-wasm-internal/build.rs new file mode 100644 index 000000000..6c8616517 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/build.rs @@ -0,0 +1,55 @@ +#![allow(missing_docs)] + +use std::{env, process::Command}; + +fn main() { + // Use the SDK_VERSION environment variable if it is set (e.g. by CI) or get it from Git + let sdk_version = env::var("SDK_VERSION") + .or_else(|_| version_from_git_info()) + .unwrap_or("unknown".to_string()); + + println!("cargo:rustc-env=SDK_VERSION={sdk_version}"); + println!("cargo:rustc-env=CARGO_PKG_VERSION={sdk_version}"); +} + +fn run(args: &[&str]) -> Result { + use std::io::Error; + let out = Command::new(args[0]).args(&args[1..]).output()?; + if !out.status.success() { + return Err(Error::other("Command not successful")); + } + Ok(String::from_utf8(out.stdout) + .map_err(Error::other)? + .trim() + .to_string()) +} + +/// This method reads info from Git, namely tags, branch, and revision +/// To access these values, use: +/// - `env!("GIT_EXACT_TAG")` +/// - `env!("GIT_BRANCH")` +/// - `env!("GIT_REV")` +fn version_from_git_info() -> Result { + // The exact tag for the current commit, can be empty when + // the current commit doesn't have an associated tag + let exact_tag = run(&["git", "describe", "--abbrev=0", "--tags", "--exact-match"]).ok(); + if let Some(ref exact) = exact_tag { + println!("cargo:rustc-env=GIT_EXACT_TAG={exact}"); + } + + // The current branch name + let branch = run(&["git", "rev-parse", "--abbrev-ref", "HEAD"])?; + println!("cargo:rustc-env=GIT_BRANCH={branch}"); + + // The current git commit hash + let rev = run(&["git", "rev-parse", "HEAD"])?; + let rev_short = rev.get(..8).unwrap_or_default(); + println!("cargo:rustc-env=GIT_REV={rev_short}"); + + // Combined version + if let Some(exact) = exact_tag { + Ok(exact) + } else { + Ok(format!("{branch} ({rev_short})")) + } +} diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/build.sh b/bitwarden_license/bit-bitwarden-wasm-internal/build.sh new file mode 100755 index 000000000..f7bdadb7f --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/build.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -eo pipefail + +cd "$(dirname "$0")" + +# Move to the root of the repository +cd ../../ + +# Write VERSION file +git rev-parse HEAD > ./bitwarden_license/bit-bitwarden-wasm-internal/npm/VERSION + +if [ "$1" != "-r" ]; then + echo "Building in debug mode" + RELEASE_FLAG="" + BUILD_FOLDER="debug" +else + echo "Building in release mode" + RELEASE_FLAG="--release" + BUILD_FOLDER="release" +fi + +# Build with MVP CPU target, two reasons: +# 1. It is required for wasm2js support +# 2. While webpack supports it, it has some compatibility issues that lead to strange results +# Note that this requirest build-std which is an unstable feature, +# this normally requires a nightly build, but we can also use the +# RUSTC_BOOTSTRAP hack to use the same stable version as the normal build +RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bit-bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG} +wasm-bindgen --target bundler --out-dir bitwarden_license/bit-bitwarden-wasm-internal/npm ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bit_bitwarden_wasm_internal.wasm +wasm-bindgen --target nodejs --out-dir bitwarden_license/bit-bitwarden-wasm-internal/npm/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bit_bitwarden_wasm_internal.wasm + +# Format +npx prettier --write ./bitwarden_license/bit-bitwarden-wasm-internal/npm + +# Optimize size +wasm-opt -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm +wasm-opt -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/node/bit_bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/node/bit_bitwarden_wasm_internal_bg.wasm + +# Transpile to JS +wasm2js -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm.js +npx terser ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm.js -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm.js + +# Typecheck the generated TypeScript definitions +cd bitwarden_license/bit-bitwarden-wasm-internal/npm +npx tsc --noEmit --lib es2020,dom bit_bitwarden_wasm_internal.d.ts diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore b/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore new file mode 100644 index 000000000..6555fa1af --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore @@ -0,0 +1,9 @@ +**/snippets/**/*.js +bit_bitwarden_wasm_internal_bg.js +bit_bitwarden_wasm_internal_bg.wasm +bit_bitwarden_wasm_internal_bg.wasm.d.ts +bit_bitwarden_wasm_internal_bg.wasm.js +bit_bitwarden_wasm_internal_bg.mvp.wasm +bit_bitwarden_wasm_internal.d.ts +bit_bitwarden_wasm_internal.js +VERSION diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/LICENSE b/bitwarden_license/bit-bitwarden-wasm-internal/npm/LICENSE new file mode 100644 index 000000000..699d89f25 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/LICENSE @@ -0,0 +1,182 @@ +BITWARDEN LICENSE AGREEMENT +Version 1, 4 September 2020 + +PLEASE CAREFULLY READ THIS BITWARDEN LICENSE AGREEMENT ("AGREEMENT"). THIS +AGREEMENT CONSTITUTES A LEGALLY BINDING AGREEMENT BETWEEN YOU AND BITWARDEN, +INC. ("BITWARDEN") AND GOVERNS YOUR USE OF THE COMMERCIAL MODULES (DEFINED +BELOW). BY COPYING OR USING THE COMMERCIAL MODULES, YOU AGREE TO THIS AGREEMENT. +IF YOU DO NOT AGREE WITH THIS AGREEMENT, YOU MAY NOT COPY OR USE THE COMMERCIAL +MODULES. IF YOU ARE COPYING OR USING THE COMMERCIAL MODULES ON BEHALF OF A LEGAL +ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE AUTHORITY TO AGREE TO THIS +AGREEMENT ON BEHALF OF SUCH ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, DO NOT +COPY OR USE THE COMMERCIAL MODULES IN ANY MANNER. + +This Agreement is entered into by and between Bitwarden and you, or the legal +entity on behalf of whom you are acting (as applicable, "You" or "Your"). + +1. DEFINITIONS + +"Bitwarden Software" means the Bitwarden client software, libraries, and +Commercial Modules. + +"Commercial Modules" means the modules designed to work with and enhance the +Bitwarden Software to which this Agreement is linked, referenced, or appended. + +2. LICENSES, RESTRICTIONS AND THIRD PARTY CODE + +2.1 Commercial Module License. Subject to Your compliance with this Agreement, +Bitwarden hereby grants to You a limited, non-exclusive, non-transferable, +royalty-free license to use the Commercial Modules for the sole purposes of +internal development and internal testing, and only in a non-production +environment. + +2.2 Reservation of Rights. As between Bitwarden and You, Bitwarden owns all +right, title and interest in and to the Bitwarden Software, and except as +expressly set forth in Sections 2.1, no other license to the Bitwarden Software +is granted to You under this Agreement, by implication, estoppel, or otherwise. + +2.3 Restrictions. You agree not to: (i) except as expressly permitted in +Section 2.1, sell, rent, lease, distribute, sublicense, loan or otherwise +transfer the Commercial Modules to any third party; (ii) alter or remove any +trademarks, service mark, and logo included with the Commercial Modules, or +(iii) use the Commercial Modules to create a competing product or service. +Bitwarden is not obligated to provide maintenance and support services for the +Bitwarden Software licensed under this Agreement. + +2.4 Third Party Software. The Commercial Modules may contain or be provided +with third party open source libraries, components, utilities and other open +source software (collectively, "Open Source Software"). Notwithstanding anything +to the contrary herein, use of the Open Source Software will be subject to the +license terms and conditions applicable to such Open Source Software. To the +extent any condition of this Agreement conflicts with any license to the Open +Source Software, the Open Source Software license will govern with respect to +such Open Source Software only. + +2.5 This Agreement does not grant any rights in the trademarks, service marks, or +logos of any Contributor (except as may be necessary to comply with the notice +requirements in Section 2.3), and use of any Bitwarden trademarks must comply with +Bitwarden Trademark Guidelines +. + +3. TERMINATION + +3.1 Termination. This Agreement will automatically terminate upon notice from +Bitwarden, which notice may be by email or posting in the location where the +Commercial Modules are made available. + +3.2 Effect of Termination. Upon any termination of this Agreement, for any +reason, You will promptly cease use of the Commercial Modules and destroy any +copies thereof. For the avoidance of doubt, termination of this Agreement will +not affect Your right to Bitwarden Software, other than the Commercial Modules, +made available pursuant to an Open Source Software license. + +3.3 Survival. Sections 1, 2.2 -2.4, 3.2, 3.3, 4, and 5 will survive any +termination of this Agreement. + +4. DISCLAIMER AND LIMITATION OF LIABILITY + +4.1 Disclaimer of Warranties. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE +LAW, THE BITWARDEN SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED REGARDING OR RELATING TO THE BITWARDEN SOFTWARE, INCLUDING +ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +TITLE, AND NON-INFRINGEMENT. FURTHER, BITWARDEN DOES NOT WARRANT RESULTS OF USE +OR THAT THE BITWARDEN SOFTWARE WILL BE ERROR FREE OR THAT THE USE OF THE +BITWARDEN SOFTWARE WILL BE UNINTERRUPTED. + +4.2 Limitation of Liability. IN NO EVENT WILL BITWARDEN OR ITS LICENSORS BE +LIABLE TO YOU OR ANY THIRD PARTY UNDER THIS AGREEMENT FOR (I) ANY AMOUNTS IN +EXCESS OF US $25 OR (II) FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF +ANY KIND, INCLUDING FOR ANY LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, +LOSS OF DATA, COST OF SUBSTITUTE GOODS OR SERVICES, WHETHER ALLEGED AS A BREACH +OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, EVEN IF BITWARDEN HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +5. MISCELLANEOUS + +5.1 Assignment. You may not assign or otherwise transfer this Agreement or any +rights or obligations hereunder, in whole or in part, whether by operation of +law or otherwise, to any third party without Bitwarden's prior written consent. +Any purported transfer, assignment or delegation without such prior written +consent will be null and void and of no force or effect. Bitwarden may assign +this Agreement to any successor to its business or assets to which this +Agreement relates, whether by merger, sale of assets, sale of stock, +reorganization or otherwise. Subject to this Section 5.1, this Agreement will be +binding upon and inure to the benefit of the parties hereto, and their +respective successors and permitted assigns. + +5.2 Entire Agreement; Modification; Waiver. This Agreement represents the +entire agreement between the parties, and supersedes all prior agreements and +understandings, written or oral, with respect to the matters covered by this +Agreement, and is not intended to confer upon any third party any rights or +remedies hereunder. You acknowledge that You have not entered in this Agreement +based on any representations other than those contained herein. No modification +of or amendment to this Agreement, nor any waiver of any rights under this +Agreement, will be effective unless in writing and signed by both parties. The +waiver of one breach or default or any delay in exercising any rights will not +constitute a waiver of any subsequent breach or default. + +5.3 Governing Law. This Agreement will in all respects be governed by the laws +of the State of California without reference to its principles of conflicts of +laws. The parties hereby agree that all disputes arising out of this Agreement +will be subject to the exclusive jurisdiction of and venue in the federal and +state courts within Los Angeles County, California. You hereby consent to the +personal and exclusive jurisdiction and venue of these courts. The parties +hereby disclaim and exclude the application hereto of the United Nations +Convention on Contracts for the International Sale of Goods. + +5.4 Severability. If any provision of this Agreement is held invalid or +unenforceable under applicable law by a court of competent jurisdiction, it will +be replaced with the valid provision that most closely reflects the intent of +the parties and the remaining provisions of the Agreement will remain in full +force and effect. + +5.5 Relationship of the Parties. Nothing in this Agreement is to be construed +as creating an agency, partnership, or joint venture relationship between the +parties hereto. Neither party will have any right or authority to assume or +create any obligations or to make any representations or warranties on behalf of +any other party, whether express or implied, or to bind the other party in any +respect whatsoever. + +5.6 Notices. All notices permitted or required under this Agreement will be in +writing and will be deemed to have been given when delivered in person +(including by overnight courier), or three (3) business days after being mailed +by first class, registered or certified mail, postage prepaid, to the address of +the party specified in this Agreement or such other address as either party may +specify in writing. + +5.7 U.S. Government Restricted Rights. If Commercial Modules is being licensed +by the U.S. Government, the Commercial Modules is deemed to be "commercial +computer software" and "commercial computer documentation" developed exclusively +at private expense, and (a) if acquired by or on behalf of a civilian agency, +will be subject solely to the terms of this computer software license as +specified in 48 C.F.R. 12.212 of the Federal Acquisition Regulations and its +successors; and (b) if acquired by or on behalf of units of the Department of +Defense ("DOD") will be subject to the terms of this commercial computer +software license as specified in 48 C.F.R. 227.7202-2, DOD FAR Supplement and +its successors. + +5.8 Injunctive Relief. A breach or threatened breach by You of Section 2 may +cause irreparable harm for which damages at law may not provide adequate relief, +and therefore Bitwarden will be entitled to seek injunctive relief in any +applicable jurisdiction without being required to post a bond. + +5.9 Export Law Assurances. You understand that the Commercial Modules is +subject to export control laws and regulations. You may not download or +otherwise export or re-export the Commercial Modules or any underlying +information or technology except in full compliance with all applicable laws and +regulations, in particular, but without limitation, United States export control +laws. None of the Commercial Modules or any underlying information or technology +may be downloaded or otherwise exported or re- exported: (a) into (or to a +national or resident of) any country to which the United States has embargoed +goods; or (b) to anyone on the U.S. Treasury Department's list of specially +designated nationals or the U.S. Commerce Department's list of prohibited +countries or debarred or denied persons or entities. You hereby agree to the +foregoing and represents and warrants that You are not located in, under control +of, or a national or resident of any such country or on any such list. + +5.10 Construction. The titles and section headings used in this Agreement are +for ease of reference only and will not be used in the interpretation or +construction of this Agreement. No rule of construction resolving any ambiguity +in favor of the non-drafting party will be applied hereto. The word "including", +when used herein, is illustrative rather than exclusive and means "including, +without limitation." diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/README.md b/bitwarden_license/bit-bitwarden-wasm-internal/npm/README.md new file mode 100644 index 000000000..9391aa071 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/README.md @@ -0,0 +1,3 @@ +# @bitwarden/sdk-internal + +**Note:** This is only for internal use. Bitwarden will not provide any support for this package. diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/index.js b/bitwarden_license/bit-bitwarden-wasm-internal/npm/index.js new file mode 100644 index 000000000..7f95352a6 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/index.js @@ -0,0 +1,8 @@ +import { __wbg_set_wasm } from "./bit_bitwarden_wasm_internal_bg.js"; + +// In order to support a fallback strategy for web we need to conditionally load the wasm file +export function init(wasm) { + __wbg_set_wasm(wasm); +} + +export * from "./bit_bitwarden_wasm_internal_bg.js"; diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/package-lock.json b/bitwarden_license/bit-bitwarden-wasm-internal/npm/package-lock.json new file mode 100644 index 000000000..901b9b1c8 --- /dev/null +++ b/bitwarden_license/bit-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.9.2" + } + }, + "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.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json b/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json new file mode 100644 index 000000000..7f9ce2d4c --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json @@ -0,0 +1,32 @@ +{ + "name": "@bitwarden/bit-sdk-internal", + "version": "0.1.0", + "license": "BITWARDEN LICENSE AGREEMENT", + "files": [ + "bit_bitwarden_wasm_internal_bg.js", + "bit_bitwarden_wasm_internal_bg.wasm.d.ts", + "bit_bitwarden_wasm_internal_bg.wasm.js", + "bit_bitwarden_wasm_internal_bg.wasm", + "bit_bitwarden_wasm_internal.d.ts", + "bit_bitwarden_wasm_internal.js", + "index.js", + "node/bit_bitwarden_wasm_internal_bg.wasm.d.ts", + "node/bit_bitwarden_wasm_internal_bg.wasm", + "node/bit_bitwarden_wasm_internal.d.ts", + "node/bit_bitwarden_wasm_internal.js", + "VERSION" + ], + "main": "node/bit_bitwarden_wasm_internal.js", + "module": "index.js", + "types": "bit_bitwarden_wasm_internal.d.ts", + "scripts": {}, + "sideEffects": [ + "./bit_bitwarden_wasm_internal.js" + ], + "dependencies": { + "type-fest": "^4.41.0" + }, + "devDependencies": { + "typescript": "5.9.2" + } +} diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs b/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs new file mode 100644 index 000000000..ce65f47d4 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs @@ -0,0 +1,26 @@ +use wasm_bindgen::prelude::*; + +#[allow(missing_docs)] +#[wasm_bindgen] +pub struct CommercialBitwardenClient(); +// pub struct CommercialBitwardenClient(pub(crate) Client); + +#[wasm_bindgen] +impl CommercialBitwardenClient { + #[allow(missing_docs)] + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self() + // Self(Client::new()) + } + + /// Test method, echoes back the input + pub fn echo(&self, msg: String) -> String { + msg + } + + #[allow(missing_docs)] + pub fn version(&self) -> String { + format!("COMMERCIAL-{}", env!("SDK_VERSION")) + } +} diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs b/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs new file mode 100644 index 000000000..e29c70877 --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs @@ -0,0 +1,5 @@ +#![doc = include_str!("../README.md")] + +mod client; + +pub use client::CommercialBitwardenClient; From f189a91e37bf7d4d9f6c546613b95327ead099be Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Thu, 4 Sep 2025 20:23:04 +0200 Subject: [PATCH 2/5] feat: re-export OSS client --- Cargo.lock | 2 ++ Cargo.toml | 1 + .../bit-bitwarden-wasm-internal/Cargo.toml | 2 ++ .../bit-bitwarden-wasm-internal/src/client.rs | 18 +++++++--- .../src/custom_types.rs | 33 +++++++++++++++++++ .../bit-bitwarden-wasm-internal/src/lib.rs | 2 ++ crates/bitwarden-wasm-internal/Cargo.toml | 2 +- crates/bitwarden-wasm-internal/src/client.rs | 9 +++++ .../src/custom_types.rs | 2 +- crates/bitwarden-wasm-internal/src/lib.rs | 1 + .../src/platform/token_provider.rs | 5 ++- 11 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 bitwarden_license/bit-bitwarden-wasm-internal/src/custom_types.rs diff --git a/Cargo.lock b/Cargo.lock index f58737390..646250081 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -294,6 +294,8 @@ dependencies = [ name = "bit-bitwarden-wasm-internal" version = "0.1.0" dependencies = [ + "bitwarden-core", + "bitwarden-wasm-internal", "serde", "tsify", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 827edd519..70f3589ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ bitwarden-uniffi-error = { path = "crates/bitwarden-uniffi-error", version = "=1 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-wasm-internal = { path = "crates/bitwarden-wasm-internal", version = "=0.1.0" } # External crates that are expected to maintain a consistent version across all crates async-trait = ">=0.1.80, <0.2" diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml b/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml index 852aa1885..5175a066c 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml +++ b/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml @@ -16,6 +16,8 @@ keywords.workspace = true crate-type = ["cdylib"] [dependencies] +bitwarden-core = { workspace = true } +bitwarden-wasm-internal = { workspace = true } serde = { workspace = true } tsify = { workspace = true } # When upgrading wasm-bindgen, make sure to update the version in the workflows! diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs b/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs index ce65f47d4..da0f5a401 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs +++ b/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs @@ -1,17 +1,25 @@ +use std::sync::Arc; + +use bitwarden_core::{Client, ClientSettings}; +use bitwarden_wasm_internal::{JsTokenProvider, WasmClientManagedTokens}; use wasm_bindgen::prelude::*; #[allow(missing_docs)] #[wasm_bindgen] -pub struct CommercialBitwardenClient(); -// pub struct CommercialBitwardenClient(pub(crate) Client); +pub struct CommercialBitwardenClient(Client); #[wasm_bindgen] impl CommercialBitwardenClient { #[allow(missing_docs)] #[wasm_bindgen(constructor)] - pub fn new() -> Self { - Self() - // Self(Client::new()) + pub fn new(token_provider: JsTokenProvider, settings: Option) -> Self { + let tokens = Arc::new(WasmClientManagedTokens::new(token_provider)); + Self(Client::new_with_client_tokens(settings, tokens)) + } + + /// Returns the underlying OSS client. + pub fn oss_client(&self) -> bitwarden_wasm_internal::BitwardenClient { + bitwarden_wasm_internal::BitwardenClient::new_with_existing_client(self.0.clone()) } /// Test method, echoes back the input diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/src/custom_types.rs b/bitwarden_license/bit-bitwarden-wasm-internal/src/custom_types.rs new file mode 100644 index 000000000..783d7052d --- /dev/null +++ b/bitwarden_license/bit-bitwarden-wasm-internal/src/custom_types.rs @@ -0,0 +1,33 @@ +/// This file contains custom TypeScript for types defined by external crates. +/// Everything in the string below is appended to the generated TypeScript definition file. +#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] +pub const TS_CUSTOM_TYPES: &'static str = r#" + +import { Tagged } from "type-fest"; + +/** + * A string that **MUST** be a valid UUID. + * + * Never create or cast to this type directly, use the `uuid()` function instead. + */ +export type Uuid = unknown; + +/** + * RFC3339 compliant date-time string. + * @typeParam T - Not used in JavaScript. + */ +export type DateTime = string; + +/** + * UTC date-time string. Not used in JavaScript. + */ +export type Utc = unknown; + +/** + * An integer that is known not to equal zero. + */ +export type NonZeroU32 = number; + +// TODO: FIX +export type Repository = any; +"#; diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs b/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs index e29c70877..dc8824738 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs +++ b/bitwarden_license/bit-bitwarden-wasm-internal/src/lib.rs @@ -1,5 +1,7 @@ #![doc = include_str!("../README.md")] mod client; +mod custom_types; +pub use bitwarden_wasm_internal::*; pub use client::CommercialBitwardenClient; diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index 9a2965750..5c5c716dc 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -13,7 +13,7 @@ license-file.workspace = true keywords.workspace = true [lib] -crate-type = ["cdylib"] +crate-type = ["cdylib", "lib"] [dependencies] async-trait = { workspace = true } diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 7d5d0444e..853ad0da8 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -18,6 +18,15 @@ use crate::platform::{ #[wasm_bindgen] pub struct BitwardenClient(pub(crate) Client); +impl BitwardenClient { + /// Create a new BitwardenClient from an existing Client. + /// + /// Used when wrapping an existing OSS client in a CommercialBitwardenClient. + pub fn new_with_existing_client(client: Client) -> Self { + Self(client) + } +} + #[wasm_bindgen] impl BitwardenClient { #[allow(missing_docs)] diff --git a/crates/bitwarden-wasm-internal/src/custom_types.rs b/crates/bitwarden-wasm-internal/src/custom_types.rs index cae9ead52..fba7729bd 100644 --- a/crates/bitwarden-wasm-internal/src/custom_types.rs +++ b/crates/bitwarden-wasm-internal/src/custom_types.rs @@ -1,7 +1,7 @@ /// This file contains custom TypeScript for types defined by external crates. /// 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#" +pub const TS_CUSTOM_TYPES: &'static str = r#" import { Tagged } from "type-fest"; diff --git a/crates/bitwarden-wasm-internal/src/lib.rs b/crates/bitwarden-wasm-internal/src/lib.rs index 253ec8ffd..2fdcda295 100644 --- a/crates/bitwarden-wasm-internal/src/lib.rs +++ b/crates/bitwarden-wasm-internal/src/lib.rs @@ -10,3 +10,4 @@ mod ssh; pub use bitwarden_ipc::wasm::*; pub use client::BitwardenClient; pub use init::init_sdk; +pub use platform::token_provider::*; diff --git a/crates/bitwarden-wasm-internal/src/platform/token_provider.rs b/crates/bitwarden-wasm-internal/src/platform/token_provider.rs index 814af0f5b..8e7358c93 100644 --- a/crates/bitwarden-wasm-internal/src/platform/token_provider.rs +++ b/crates/bitwarden-wasm-internal/src/platform/token_provider.rs @@ -1,3 +1,5 @@ +#![allow(missing_docs)] + use bitwarden_core::client::internal::ClientManagedTokens; use bitwarden_threading::ThreadBoundRunner; use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; @@ -19,9 +21,10 @@ extern "C" { } /// Thread-bound runner for JavaScript token provider -pub(crate) struct WasmClientManagedTokens(ThreadBoundRunner); +pub struct WasmClientManagedTokens(ThreadBoundRunner); impl WasmClientManagedTokens { + /// Creates a new instance of `WasmClientManagedTokens`. pub fn new(js_provider: JsTokenProvider) -> Self { Self(ThreadBoundRunner::new(js_provider)) } From 0b0d1a6d9ac87f03fdfc12b9b664e519c1981427 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Thu, 4 Sep 2025 20:44:06 +0200 Subject: [PATCH 3/5] feat: allow creation using existing OSS client --- .../bit-bitwarden-wasm-internal/src/client.rs | 31 ++++++++++++------- crates/bitwarden-wasm-internal/src/client.rs | 2 +- crates/bitwarden-wasm-internal/src/lib.rs | 1 - .../src/platform/token_provider.rs | 4 +-- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs b/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs index da0f5a401..b5c83708d 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs +++ b/bitwarden_license/bit-bitwarden-wasm-internal/src/client.rs @@ -1,7 +1,5 @@ -use std::sync::Arc; - -use bitwarden_core::{Client, ClientSettings}; -use bitwarden_wasm_internal::{JsTokenProvider, WasmClientManagedTokens}; +use bitwarden_core::Client; +use bitwarden_wasm_internal::BitwardenClient; use wasm_bindgen::prelude::*; #[allow(missing_docs)] @@ -12,14 +10,8 @@ pub struct CommercialBitwardenClient(Client); impl CommercialBitwardenClient { #[allow(missing_docs)] #[wasm_bindgen(constructor)] - pub fn new(token_provider: JsTokenProvider, settings: Option) -> Self { - let tokens = Arc::new(WasmClientManagedTokens::new(token_provider)); - Self(Client::new_with_client_tokens(settings, tokens)) - } - - /// Returns the underlying OSS client. - pub fn oss_client(&self) -> bitwarden_wasm_internal::BitwardenClient { - bitwarden_wasm_internal::BitwardenClient::new_with_existing_client(self.0.clone()) + pub fn new(client: BitwardenClient) -> Self { + Self(client.0.clone()) } /// Test method, echoes back the input @@ -27,8 +19,23 @@ impl CommercialBitwardenClient { msg } + #[allow(missing_docs)] + pub fn vault(&self) -> BitVaultClient { + BitVaultClient::new(self.0.clone()) + } + #[allow(missing_docs)] pub fn version(&self) -> String { format!("COMMERCIAL-{}", env!("SDK_VERSION")) } } + +#[wasm_bindgen] +#[allow(unused)] +pub struct BitVaultClient(Client); + +impl BitVaultClient { + pub fn new(client: Client) -> Self { + Self(client.clone()) + } +} diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 853ad0da8..9158c6433 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -16,7 +16,7 @@ use crate::platform::{ #[allow(missing_docs)] #[wasm_bindgen] -pub struct BitwardenClient(pub(crate) Client); +pub struct BitwardenClient(#[wasm_bindgen(skip)] pub Client); impl BitwardenClient { /// Create a new BitwardenClient from an existing Client. diff --git a/crates/bitwarden-wasm-internal/src/lib.rs b/crates/bitwarden-wasm-internal/src/lib.rs index 2fdcda295..253ec8ffd 100644 --- a/crates/bitwarden-wasm-internal/src/lib.rs +++ b/crates/bitwarden-wasm-internal/src/lib.rs @@ -10,4 +10,3 @@ mod ssh; pub use bitwarden_ipc::wasm::*; pub use client::BitwardenClient; pub use init::init_sdk; -pub use platform::token_provider::*; diff --git a/crates/bitwarden-wasm-internal/src/platform/token_provider.rs b/crates/bitwarden-wasm-internal/src/platform/token_provider.rs index 8e7358c93..660820ce6 100644 --- a/crates/bitwarden-wasm-internal/src/platform/token_provider.rs +++ b/crates/bitwarden-wasm-internal/src/platform/token_provider.rs @@ -1,5 +1,3 @@ -#![allow(missing_docs)] - use bitwarden_core::client::internal::ClientManagedTokens; use bitwarden_threading::ThreadBoundRunner; use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; @@ -21,7 +19,7 @@ extern "C" { } /// Thread-bound runner for JavaScript token provider -pub struct WasmClientManagedTokens(ThreadBoundRunner); +pub(crate) struct WasmClientManagedTokens(ThreadBoundRunner); impl WasmClientManagedTokens { /// Creates a new instance of `WasmClientManagedTokens`. From 4065a1fc47f57ac3034662937e3862d7dcd5d08b Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Fri, 5 Sep 2025 16:09:57 +0200 Subject: [PATCH 4/5] feat: rename to make it a drop-in replacement for the OSS version --- .../bit-bitwarden-wasm-internal/Cargo.toml | 2 ++ .../bit-bitwarden-wasm-internal/build.sh | 14 +++++++------- .../bit-bitwarden-wasm-internal/npm/.gitignore | 14 +++++++------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml b/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml index 5175a066c..3e0c119bf 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml +++ b/bitwarden_license/bit-bitwarden-wasm-internal/Cargo.toml @@ -13,6 +13,8 @@ license-file.workspace = true keywords.workspace = true [lib] +# TODO: implement this in another way, this causes a warning about collisions with the OSS lib +name = "bitwarden_wasm_internal" crate-type = ["cdylib"] [dependencies] diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/build.sh b/bitwarden_license/bit-bitwarden-wasm-internal/build.sh index f7bdadb7f..9bf7f53c6 100755 --- a/bitwarden_license/bit-bitwarden-wasm-internal/build.sh +++ b/bitwarden_license/bit-bitwarden-wasm-internal/build.sh @@ -26,20 +26,20 @@ fi # this normally requires a nightly build, but we can also use the # RUSTC_BOOTSTRAP hack to use the same stable version as the normal build RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bit-bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG} -wasm-bindgen --target bundler --out-dir bitwarden_license/bit-bitwarden-wasm-internal/npm ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bit_bitwarden_wasm_internal.wasm -wasm-bindgen --target nodejs --out-dir bitwarden_license/bit-bitwarden-wasm-internal/npm/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bit_bitwarden_wasm_internal.wasm +wasm-bindgen --target bundler --out-name bitwarden_wasm_internal --out-dir bitwarden_license/bit-bitwarden-wasm-internal/npm ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm +wasm-bindgen --target nodejs --out-name bitwarden_wasm_internal --out-dir bitwarden_license/bit-bitwarden-wasm-internal/npm/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm # Format npx prettier --write ./bitwarden_license/bit-bitwarden-wasm-internal/npm # Optimize size -wasm-opt -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm -wasm-opt -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/node/bit_bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/node/bit_bitwarden_wasm_internal_bg.wasm +wasm-opt -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm +wasm-opt -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/node/bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/node/bitwarden_wasm_internal_bg.wasm # Transpile to JS -wasm2js -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm.js -npx terser ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm.js -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bit_bitwarden_wasm_internal_bg.wasm.js +wasm2js -Os ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js +npx terser ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js -o ./bitwarden_license/bit-bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js # Typecheck the generated TypeScript definitions cd bitwarden_license/bit-bitwarden-wasm-internal/npm -npx tsc --noEmit --lib es2020,dom bit_bitwarden_wasm_internal.d.ts +npx tsc --noEmit --lib es2020,dom bitwarden_wasm_internal.d.ts diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore b/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore index 6555fa1af..6262ecc8b 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/.gitignore @@ -1,9 +1,9 @@ **/snippets/**/*.js -bit_bitwarden_wasm_internal_bg.js -bit_bitwarden_wasm_internal_bg.wasm -bit_bitwarden_wasm_internal_bg.wasm.d.ts -bit_bitwarden_wasm_internal_bg.wasm.js -bit_bitwarden_wasm_internal_bg.mvp.wasm -bit_bitwarden_wasm_internal.d.ts -bit_bitwarden_wasm_internal.js +bitwarden_wasm_internal_bg.js +bitwarden_wasm_internal_bg.wasm +bitwarden_wasm_internal_bg.wasm.d.ts +bitwarden_wasm_internal_bg.wasm.js +bitwarden_wasm_internal_bg.mvp.wasm +bitwarden_wasm_internal.d.ts +bitwarden_wasm_internal.js VERSION From 411aed6f5677c09aedc0df20a37a005c1c05d693 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Fri, 5 Sep 2025 16:33:34 +0200 Subject: [PATCH 5/5] fix: woops, forgot to rename some files --- .../npm/package.json | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json b/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json index 7f9ce2d4c..c662cb306 100644 --- a/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json +++ b/bitwarden_license/bit-bitwarden-wasm-internal/npm/package.json @@ -3,25 +3,25 @@ "version": "0.1.0", "license": "BITWARDEN LICENSE AGREEMENT", "files": [ - "bit_bitwarden_wasm_internal_bg.js", - "bit_bitwarden_wasm_internal_bg.wasm.d.ts", - "bit_bitwarden_wasm_internal_bg.wasm.js", - "bit_bitwarden_wasm_internal_bg.wasm", - "bit_bitwarden_wasm_internal.d.ts", - "bit_bitwarden_wasm_internal.js", + "bitwarden_wasm_internal_bg.js", + "bitwarden_wasm_internal_bg.wasm.d.ts", + "bitwarden_wasm_internal_bg.wasm.js", + "bitwarden_wasm_internal_bg.wasm", + "bitwarden_wasm_internal.d.ts", + "bitwarden_wasm_internal.js", "index.js", - "node/bit_bitwarden_wasm_internal_bg.wasm.d.ts", - "node/bit_bitwarden_wasm_internal_bg.wasm", - "node/bit_bitwarden_wasm_internal.d.ts", - "node/bit_bitwarden_wasm_internal.js", + "node/bitwarden_wasm_internal_bg.wasm.d.ts", + "node/bitwarden_wasm_internal_bg.wasm", + "node/bitwarden_wasm_internal.d.ts", + "node/bitwarden_wasm_internal.js", "VERSION" ], - "main": "node/bit_bitwarden_wasm_internal.js", + "main": "node/bitwarden_wasm_internal.js", "module": "index.js", - "types": "bit_bitwarden_wasm_internal.d.ts", + "types": "bitwarden_wasm_internal.d.ts", "scripts": {}, "sideEffects": [ - "./bit_bitwarden_wasm_internal.js" + "./bitwarden_wasm_internal.js" ], "dependencies": { "type-fest": "^4.41.0"