[package]
name = "pywatt_sdk"
version = "0.2.8"
edition = "2024"
authors = ["James Kueller <james@pma-electric.com>"]
description = "Standardized SDK for building PyWatt modules in Rust"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/frostdev-ops/pywatt_sdk"
homepage = "https://github.com/frostdev-ops/pywatt_sdk"
documentation = "https://docs.rs/pywatt_sdk"
keywords = ["ipc", "sdk", "pywatt"]
categories = ["development-tools", "network-programming"]
publish = true

[dependencies]
# Dependencies from pywatt_sdk itself
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "fmt"] }
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1", features = ["net"] }
axum = { version = "0.7.9", features = ["macros", "json"] }
hyper = { version = "0.14", features = ["full"] }
http = "1.1"
thiserror = "1" # Also used by secret_client, secret_provider
serde_json = "1" # Also used by secret_client
serde = { version = "1", features = ["derive"] } # Also used by ipc_types, secret_client, secret_provider
secrecy = "0.8" # Also used by secret_client, secret_provider
prometheus = { version = "0.13", optional = true } # Used by metrics feature
jsonwebtoken = { version = "8.1", optional = true } # Used by jwt_auth feature
tower = { version = "0.5.2", optional = true } # Used by jwt_auth feature
base64 = "0.13.0" # For encoding/decoding binary data in IPC
lazy_static = "1.4.0" # For static IPC channels

# Database dependencies (optional)
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "macros", "json", "chrono", "uuid"], optional = true }

# Cache dependencies (optional)
redis = { version = "0.23.0", features = ["tokio-comp", "connection-manager"], optional = true }
memcache = { version = "0.17.0", optional = true }
dashmap = "5.5" # Already used by secret_provider, also for in-memory cache
fs2 = { version = "0.4.3", optional = true } # For file-based cache locking
tempfile = { version = "3.8.0", optional = true } # For cache tests

# Dependencies moved from secret_client
once_cell = "1.18"
uuid = { version = "1.4", features = ["v4", "serde"] }
aho-corasick = "1.1.3" # Use version from secret_provider as it's newer
zeroize = "1.5"

# Dependencies moved from secret_provider
async-trait = "0.1"
anyhow = "1.0"
notify = { version = "6.0", default-features = false, features = ["serde"] }
toml = "0.8"
metrics = { version = "0.21", optional = true } # Optional, tied to 'metrics' feature
clap = { version = "4.4", features = ["derive"] }
serde_yaml = "0.9"

# Proc-macro dependencies moved from pywatt_macros (conditional)
proc-macro2 = { version = "1.0", optional = true }
quote = { version = "1.0", optional = true }
syn = { version = "2.0", features = ["full"], optional = true }
tower-service = "0.3.3"
futures = "0.3.31"
hyper-util = { version = "0.1.11", features = ["server", "tokio"] }
rand = "0.9.1"
bincode = "2.0.1"


[build-dependencies]
chrono = "0.4"

[features]
default = []
# Feature for enabling the proc-macro functionality (renamed from 'macros')
proc_macros = ["proc-macro2", "quote", "syn"]
# Existing features
router_ext = []
metrics = ["router_ext", "prometheus", "dep:metrics"] # Added dep:metrics
discover_endpoints = []
builder = []
jwt_auth = ["jsonwebtoken", "tower"]
# Database features
database = ["sqlx"]
postgres = ["database", "sqlx/postgres"]
mysql = ["database", "sqlx/mysql"]
sqlite = ["database", "sqlx/sqlite"]
# Cache features
cache = []
redis_cache = ["cache", "redis"]
memcached = ["cache", "memcache"]
file_cache = ["cache", "fs2", "tempfile"]
# IPC Service Proxy features
ipc = ["jwt_auth"]
# Integration tests - enable when you want to run tests that require actual databases or caches
integration_tests = []
# Add feature for new JWT auth. This enables the 
# additional type-parametrized JWT auth functionality.
jwt_auth_v2 = ["jwt_auth"]
# Add feature for tracing integration
tracing = []
# Add feature for CORS support
cors = []
# Add feature for secret providers if desired, e.g., to gate file/env providers
# file_provider = ["notify", "toml"]
# env_provider = []
# Secret client needs stdout logging feature? Let's assume yes for now.
secret_client_logging = []

# NOTE: pywatt_macros crate itself is no longer listed as optional dependency.
# Its functionality is enabled via the `proc_macros` feature flag.
# The `macros` feature name is kept for compatibility if needed, pointing to the new feature.
macros = ["proc_macros"] 
