[package]
name = "ttsync-http"
version.workspace = true
description = "HTTP server and client adapter for TT-Sync v2 protocol"
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
ttsync-contract = { workspace = true }
ttsync-core = { workspace = true }
base64 = { workspace = true }
rustls = { workspace = true }
sha2 = { workspace = true }

[dependencies.axum]
workspace = true
optional = true

[dependencies.axum-server]
workspace = true
optional = true

[dependencies.futures-util]
version = "0.3"
optional = true

[dependencies.rcgen]
workspace = true
optional = true

[dependencies.reqwest]
workspace = true
optional = true

[dependencies.rustls-pemfile]
version = "2"
optional = true

[dependencies.serde]
workspace = true
optional = true

[dependencies.serde_json]
workspace = true
optional = true

[dependencies.url]
workspace = true
optional = true

[dependencies.tokio]
workspace = true
optional = true

[dependencies.tokio-util]
version = "0.7"
features = ["io"]
optional = true

[dependencies.tracing]
workspace = true
optional = true

[dependencies.uuid]
workspace = true
optional = true

[dependencies.webpki-roots]
workspace = true
optional = true

[dependencies.async-compression]
version = "0.4"
features = ["tokio", "zstd"]
optional = true

[features]
default = ["client", "server"]
client = ["dep:reqwest", "dep:serde_json", "dep:url", "dep:webpki-roots"]
server = [
    "dep:axum",
    "dep:axum-server",
    "dep:async-compression",
    "dep:futures-util",
    "dep:rcgen",
    "dep:rustls-pemfile",
    "dep:serde",
    "dep:serde_json",
    "dep:tokio",
    "dep:tokio-util",
    "dep:tracing",
    "dep:uuid",
]

[dev-dependencies]
tower = { version = "0.5", features = ["util"] }
