[package]
name = "nestrs-microservices"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository.workspace = true
homepage.workspace = true
readme = "README.md"
description = "Microservice transport and client primitives for nestrs."
keywords = ["microservices", "events", "nest", "transport", "async"]
categories = ["network-programming", "asynchronous"]

[features]
default = []
# Optional transport adapters
nats = ["dep:async-nats", "dep:futures-util", "dep:time"]
redis = ["dep:redis", "dep:futures-util"]
grpc = ["dep:tonic", "dep:tonic-prost", "dep:prost", "dep:bytes"]
kafka = [
  "dep:rskafka",
  "dep:chrono",
  "dep:uuid",
  "dep:rustls",
  "dep:rustls-pemfile",
  "dep:webpki-roots",
  "rskafka/transport-tls",
]
mqtt = ["dep:rumqttc", "dep:uuid"]
rabbitmq = ["dep:lapin", "dep:uuid", "dep:futures-util"]
microservice-metrics = ["dep:metrics"]

[dependencies]
async-trait = "0.1"
tokio = { workspace = true, features = ["io-util"] }
nestrs-core = { version = "0.3.6", path = "../nestrs-core" }
nestrs-events = { version = "0.3.6", path = "../nestrs-events" }
axum.workspace = true
serde = { version = "1", features = ["derive"] }
serde_json = "1"
linkme = "0.3"

async-nats = { version = "0.47", optional = true }
redis = { version = "0.29", features = ["tokio-comp"], optional = true }
tonic = { version = "0.14.5", features = ["transport"], optional = true }
prost = { version = "0.14.3", optional = true }
bytes = { version = "1", optional = true }
futures-util = { version = "0.3", optional = true }
tonic-prost = { version = "0.14.5", optional = true }
time = { version = "0.3.47", optional = true }
rskafka = { version = "0.6.0", optional = true }
chrono = { version = "0.4.44", optional = true }
uuid = { version = "1.23.0", optional = true, features = ["v4"] }
rumqttc = { version = "0.25.1", default-features = false, features = ["use-native-tls"], optional = true }
lapin = { version = "2.5", optional = true }
rustls = { version = "0.23", default-features = false, features = ["std", "tls12", "ring"], optional = true }
rustls-pemfile = { version = "2", optional = true }
webpki-roots = { version = "0.26", optional = true }
metrics = { version = "0.24", default-features = false, optional = true }

[dev-dependencies]
tokio.workspace = true

[build-dependencies]
protoc-bin-vendored = "3.2.0"
tonic-prost-build = "0.14.5"
