[package]
name = "matrix-sdk-indexeddb"
version = "0.7.0"
repository = "https://github.com/matrix-org/matrix-rust-sdk"
description = "Web's IndexedDB Storage backend for matrix-sdk"
license = "Apache-2.0"
edition = "2021"
rust-version = { workspace = true }
readme = "README.md"

[package.metadata.docs.rs]
all-features = true
default-target = "wasm32-unknown-unknown"
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["e2e-encryption"]
e2e-encryption = ["matrix-sdk-base/e2e-encryption", "dep:matrix-sdk-crypto"]
testing = ["matrix-sdk-crypto?/testing"]

[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
gloo-utils = { version = "0.2.0", features = ["serde"] }
indexed_db_futures = "0.4.1"
js-sys = { version = "0.3.58" }
matrix-sdk-base = { workspace = true, features = ["js"] }
matrix-sdk-crypto = { workspace = true, features = ["js"], optional = true }
matrix-sdk-store-encryption = { workspace = true }
ruma = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde-wasm-bindgen = "0.6.1"
thiserror = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
wasm-bindgen = "0.2.83"
web-sys = { version = "0.3.57", features = ["IdbKeyRange"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
# for wasm32 we need to activate this
getrandom = { version = "0.2.6", features = ["js"] }

[dev-dependencies]
assert_matches = { workspace = true }
assert_matches2 = { workspace = true }
matrix-sdk-base = { workspace = true, features = ["testing"] }
matrix-sdk-common = { workspace = true, features = ["js"] }
matrix-sdk-crypto = { workspace = true, features = ["js", "testing"] }
matrix-sdk-test = { workspace = true }
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["registry", "tracing-log"] }
uuid = "1.3.0"
wasm-bindgen-test = "0.3.33"
