[package]
name = "helr"
version = "0.4.0"
edition = "2024"
description = "Generic HTTP API log collector: polls APIs and emits NDJSON to stdout"
license = "MIT OR Apache-2.0"
repository = "https://github.com/timescale/helr"
homepage = "https://github.com/timescale/helr"

[dependencies]
clap = { version = "4.5", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_yaml_ng = "0.10"
serde_json = "1.0"
reqwest = { version = "0.13", features = ["json", "form"] }
rusqlite = { version = "0.38", features = ["bundled"] }
anyhow = "1.0"
async-trait = "0.1"
shellexpand = "3.1"
base64 = "0.22"
chrono = "0.4"
rand = "0.10"
axum = { version = "0.8", features = ["macros", "json"] }
prometheus = "0.14"
nix = { version = "0.31", features = ["signal"] }
jsonwebtoken = "10"
rsa = { version = "0.9", features = ["sha2"] }
sha2 = "0.10"
sysinfo = "0.38"
governor = "0.10"
redis = { version = "1.0", features = ["tokio-comp", "connection-manager"] }
tokio-postgres = "0.7"

# Optional JS hooks (Boa engine). When disabled, sources with hooks config are ignored.
boa_engine = { version = "0.21", optional = true }
boa_gc = { version = "0.21", optional = true }
boa_runtime = { version = "0.21", optional = true, features = ["fetch", "reqwest-blocking"] }

[features]
default = []
# Enable optional JS hooks: buildRequest, parseResponse, getNextPage, commitState, getAuth. Includes console.log (via tracing) and fetch() when hooks.fetch is enabled.
hooks = ["dep:boa_engine", "dep:boa_gc", "dep:boa_runtime"]
# Run integration tests that spin up Redis/Postgres via testcontainers (requires Docker).
# Usage: cargo test --features testcontainers --test integration_testcontainers
testcontainers = []

[dev-dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net"] }
wiremock = "0.6"
insta = "1.46"
serde_json = "1.0"
base64 = "0.22"
nix = { version = "0.31", features = ["signal", "process"] }
reqwest = { version = "0.13", features = ["json"] }
testcontainers = "0.27"
