Skip to content

Commit

Permalink
Merge branch 'main' into t3chguy/fix-cjs-esm
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jan 13, 2025
2 parents b50c354 + 0073b59 commit 932861a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
- Fix a problem, introduced in v12.0.0, when importing the published package as an ESM module, in which some files could be incorrectly interpreted as CommonJS, leading to syntax errors.
([#189](https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm/pull/189))

**BREAKING CHANGES**
# matrix-sdk-crypto-wasm v13.0.0

- Update matrix-rusk-sdk to `0.9.0`.
- Expose new API `DehydratedDevices.getDehydratedDeviceKey`, `DehydratedDevices.saveDehydratedDeviceKey`
and `DehydratedDevices.deleteDehydratedDeviceKey` to store/load the dehydrated device pickle key.
`DehydratedDevices.keysForUpload` and `DehydratedDevices.rehydrate` now use the `DehydratedDeviceKey` as parameter
instead of a raw UInt8Array.Use `DehydratedDeviceKey::createKeyFromArray` to migrate.
([#179](https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm/pull/179))

**BREAKING CHANGES**

- `DehydratedDevices.keysForUpload` and `DehydratedDevices.rehydrate` now use a `DehydratedDeviceKey` as parameter
instead of a raw `UInt8Array`. Use `DehydratedDeviceKey.createKeyFromArray` to migrate.
([#179](https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm/pull/179))

# matrix-sdk-crypto-wasm v12.1.0

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@matrix-org/matrix-sdk-crypto-wasm",
"version": "12.1.0",
"version": "13.0.0",
"homepage": "https://github.com/matrix-org/matrix-rust-sdk-wasm",
"description": "WebAssembly bindings of the matrix-sdk-crypto encryption library",
"license": "Apache-2.0",
Expand Down Expand Up @@ -80,7 +80,7 @@
"build": "WASM_PACK_ARGS=--release ./scripts/build.sh",
"build:dev": "WASM_PACK_ARGS=--dev ./scripts/build.sh",
"test": "jest --verbose && yarn run wasm-pack test --node",
"doc": "typedoc --tsconfig .",
"doc": "typedoc --treatWarningsAsErrors --tsconfig .",
"prepack": "npm run build && npm run test"
}
}
11 changes: 6 additions & 5 deletions src/libolm_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct Migration {}

/// The base dataset that is important to migrate to the Rust SDK.
///
/// Can be imported into the rust store with {@link #migrateBaseData}.
/// Can be imported into the rust store with {@link Migration::migrateBaseData}.
#[wasm_bindgen(getter_with_clone)]
#[derive(Debug, Default)]
pub struct BaseMigrationData {
Expand Down Expand Up @@ -103,7 +103,8 @@ impl Migration {
/// Populates the user credentials, Olm account, backup data, etc. This is
/// the first step in the migration process. Once this base data is
/// imported, further data can be imported with {@link
/// #migrateOlmSessions}, {@link #migrateMegolmSessions}, and TODO room settings.
/// migrateOlmSessions}, {@link migrateMegolmSessions}, and TODO room
/// settings.
///
/// # Arguments
///
Expand Down Expand Up @@ -188,7 +189,7 @@ async fn migrate_base_data_to_store(
///
/// Holds all the information that needs to be stored in a database to restore
/// an Olm Session. Can be imported into the rust store with {@link
/// #migrateOlmSessions}.
/// Migration::migrateOlmSessions}.
#[wasm_bindgen(getter_with_clone)]
#[derive(Debug)]
pub struct PickledSession {
Expand Down Expand Up @@ -224,7 +225,7 @@ impl Migration {
/// Migrate Olm sessions of a libolm-based setup to a vodozemac-based setup
/// stored in an indexedDB crypto store.
///
/// Before this method can be used, {@link #migrateBaseData} must be used to
/// Before this method can be used, {@link migrateBaseData} must be used to
/// import the base data into the crypto store.
///
/// This method should be called a number of times, with separate batches of
Expand Down Expand Up @@ -378,7 +379,7 @@ impl Migration {
/// Migrate Megolm sessions of a libolm-based setup to a vodozemac-based
/// setup stored in an indexedDB crypto store.
///
/// Before this method can be used, {@link #migrateBaseData} must be used to
/// Before this method can be used, {@link migrateBaseData} must be used to
/// import the base data into the crypto store.
///
/// This method should be called a number of times, with separate batches of
Expand Down
14 changes: 7 additions & 7 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ impl OlmMachine {
/// keys will create a {@link OwnUserIdentity} and mark it as verified.
///
/// The backup key will be persisted in the store and can be enabled using
/// the {@link BackupMachine}.
/// the BackupMachine.
///
/// The provided `SecretsBundle` is freed by this method; be careful not to
/// use it once this method has been called.
Expand Down Expand Up @@ -662,8 +662,8 @@ impl OlmMachine {

/// Get the cross signing user identity of a user.
///
/// Returns a promise for an {@link identities.OwnUserIdentity}, a
/// {@link identities.OtherUserIdentity}, or `undefined`.
/// Returns a promise for an {@link OwnUserIdentity}, a
/// {@link OtherUserIdentity}, or `undefined`.
#[wasm_bindgen(js_name = "getIdentity")]
pub fn get_identity(&self, user_id: &identifiers::UserId) -> Promise {
let me = self.inner.clone();
Expand Down Expand Up @@ -1191,7 +1191,7 @@ impl OlmMachine {
/// trusted, otherwise we might be encrypting room keys that a malicious
/// party could decrypt.
///
/// The {@link #verifyBackup} method can be used to do so.
/// The {@link verifyBackup} method can be used to do so.
///
/// Returns `Promise<void>`.
#[wasm_bindgen(js_name = "enableBackupV1")]
Expand Down Expand Up @@ -1513,7 +1513,7 @@ impl OlmMachine {
/// This method will cause the sdk to generated outgoing secret requests
/// (`m.secret.request`) to get the missing secrets. These requests will
/// then be returned by a future call to {@link
/// OlmMachine#outgoing_requests}.
/// OlmMachine#outgoingRequests}.
///
/// # Returns
///
Expand All @@ -1531,7 +1531,7 @@ impl OlmMachine {
/// Get the stored room settings, such as the encryption algorithm or
/// whether to encrypt only for trusted devices.
///
/// These settings can be modified via {@link #setRoomSettings}.
/// These settings can be modified via {@link setRoomSettings}.
///
/// # Returns
///
Expand All @@ -1553,7 +1553,7 @@ impl OlmMachine {
///
/// If the settings are valid, they will be persisted to the crypto store.
/// These settings are not used directly by this library, but the saved
/// settings can be retrieved via {@link #getRoomSettings}.
/// settings can be retrieved via {@link getRoomSettings}.
#[wasm_bindgen(js_name = "setRoomSettings")]
pub async fn set_room_settings(
&self,
Expand Down

0 comments on commit 932861a

Please sign in to comment.