[package]
name = "cnb"
version = "0.2.0"
edition = "2021"
rust-version = "1.75"
description = "CNB (cnb.cool) API client for Rust — typed, async, production-ready"
repository = "https://cnb.cool/aodoo/tools/rust-cnb.git"
homepage = "https://cnb.cool/aodoo/tools/rust-cnb"
documentation = "https://docs.rs/cnb"
keywords = ["cnb", "api", "client", "sdk", "openapi"]
categories = ["api-bindings", "web-programming::http-client"]
license = "MIT"
readme = "README.md"
include = [
    "src/**/*",
    "Cargo.toml",
    "README.md",
    "CHANGELOG.md",
    "LICENSE",
]
# Note: `exclude` is intentionally omitted — when both `include` and `exclude`
# are set Cargo silently ignores `exclude`. Keep the publishing surface
# explicitly minimal via `include`.

# -----------------------------------------------------------------------------
# Features
# -----------------------------------------------------------------------------
#
# Default surface keeps the SDK ergonomic out of the box: TLS via rustls, retries
# on transient failures, and all resource modules enabled. Power users can opt
# out of any of them.
#
# TLS backends are mutually exclusive — if both are enabled the user must
# explicitly set `default-features = false`. We surface them as separate flags
# rather than a `tls` enum so downstream feature unification stays simple.
[features]
default = ["rustls-tls", "retry", "all-resources"]

# Transport
rustls-tls = ["reqwest/rustls-tls"]
native-tls = ["reqwest/native-tls"]

# Optional capabilities
retry = []
tracing = ["dep:tracing"]
stream = ["dep:futures", "dep:async-stream"]

# Resource module bundle — re-exported for convenience.
all-resources = [
    "activities", "ai", "artifactory", "assets", "badge", "build", "charge",
    "event", "followers", "git", "git_settings", "issues", "knowledge_base",
    "members", "missions", "organizations", "pulls", "rank", "registries",
    "releases", "repo_code_issue", "repo_contributor", "repo_labels",
    "repositories", "search", "security", "starring", "users", "wiki",
    "workspace",
]

# Per-resource feature flags (no transitive deps; pure cfg gates over generated
# modules). Keeping them explicit lets binaries depend on a minimal slice of the
# SDK to cut compile time.
activities       = []
ai               = []
artifactory      = []
assets           = []
badge            = []
build            = []
charge           = []
event            = []
followers        = []
git              = []
git_settings     = []
issues           = []
knowledge_base   = []
members          = []
missions         = []
organizations    = []
pulls            = []
rank             = []
registries       = []
releases         = []
repo_code_issue  = []
repo_contributor = []
repo_labels      = []
repositories     = []
search           = []
security         = []
starring         = []
users            = []
wiki             = []
workspace        = []

# -----------------------------------------------------------------------------
# Runtime dependencies
# -----------------------------------------------------------------------------
[dependencies]
# HTTP. We disable `default-features` so the user picks rustls-tls or native-tls
# explicitly via our features above. `json` brings in `serde_json::Value` codec.
reqwest = { version = "0.12", default-features = false, features = ["json", "charset", "http2"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
url = "2"
thiserror = "1"
# Trim tokio: the SDK only needs the time submodule for retry backoff.
tokio = { version = "1", default-features = false, features = ["time"] }

# Optional dependencies — keep them out of the default closure.
tracing = { version = "0.1", optional = true }
futures = { version = "0.3", optional = true, default-features = false, features = ["std"] }
async-stream = { version = "0.3", optional = true }

# -----------------------------------------------------------------------------
# Dev dependencies (tests + examples)
# -----------------------------------------------------------------------------
[dev-dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
wiremock = "0.6"
serde_json = "1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
futures = "0.3"

# -----------------------------------------------------------------------------
# Documentation hints (docs.rs)
# -----------------------------------------------------------------------------
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
