[package]
name = "assay-workflow"
version = "0.2.1"
categories = ["asynchronous", "database"]
edition = "2024"
keywords = ["workflow", "durable-execution", "orchestration", "task-queue"]
license = "Apache-2.0"
repository = "https://github.com/developerinlondon/assay"
description = "Durable workflow engine with REST+SSE API on PostgreSQL 18 and SQLite backends. Embeddable library or standalone server (via assay-engine)."

[dependencies]
# Shared types + traits
assay-domain = { path = "../assay-domain", version = "0.1" }

# Async runtime
tokio = { version = "1", features = ["rt", "time", "macros"] }

# Database
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "sqlite", "any"] }

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# Cron expression parsing
chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }
chrono-tz = { version = "0.10", default-features = false }
cron = "0.16"

# HTTP server + REST API
axum = "0.8"
tokio-stream = { version = "0.1", features = ["sync"] }

# OpenAPI spec generation (compile-time only, zero runtime cost)
utoipa = { version = "5", features = ["axum_extras"] }

# Auth — JWT validation + API key hashing
data-encoding = "2"
jsonwebtoken = { version = "10", features = ["rust_crypto"] }
rand = "0.9"
sha2 = "0.10"

# HTTP client (JWKS fetching)
reqwest = { version = "0.13", features = ["json", "rustls"], default-features = false }

# Error handling
anyhow = "1"

# Logging
tracing = "0.1"

# Push-subscription stream types (Stream trait + empty-stream constructor)
futures-core = "0.3"
futures-util = "0.3"

# Async generator streams (used by push-stream impls)
async-stream = "0.3"

[features]
default = ["backend-postgres", "backend-sqlite"]
# Enable the S3 archival background task for completed workflows.
# Adds the AWS SDK dependency (~5MB of binary size); leave off when
# archival isn't needed.
s3-archival = ["dep:aws-config", "dep:aws-sdk-s3"]

# Backend features. Postgres + SQLite are unconditionally compiled for now
# (the source hasn't been feature-gated off sqlx yet — tracked in plan 12a).
# Both are additive; runtime backend selection happens via EngineConfig.backend.
# The feature flags also gate the matching backend impls in `assay-domain`,
# so enabling `backend-postgres` here pulls in `PgEngineEventBus`.
backend-postgres = ["assay-domain/backend-postgres"]
backend-sqlite = ["assay-domain/backend-sqlite"]

[dependencies.aws-config]
version = "1.8"
optional = true
features = ["behavior-version-latest"]

[dependencies.aws-sdk-s3]
version = "1.125"
optional = true
features = ["behavior-version-latest"]

[dev-dependencies]
reqwest = { version = "0.13", features = ["json", "stream"], default-features = false }
rsa = "0.9"
rstest = "0.26"
serial_test = "3"
tempfile = "3.27.0"
testcontainers = "0.27"
testcontainers-modules = { version = "0.15", features = ["postgres"] }
tokio = { version = "1", features = ["full"] }
