[package]
name = "saleor-app-sdk"
authors = ["Djkáťo <djkatovfx@gmail.com>"]
version = "0.2.3"
edition = "2021"
description = "Unofficial Saleor App SDK like library, made to for Rust."
keywords = ["saleor", "sdk", "plugin"]
categories = ["api-bindings", "web-programming::http-server"]
homepage = "https://github.com/djkato/saleor-apps-rs"
repository = "https://github.com/djkato/saleor-apps-rs"
documentation = "https://github.com/djkato/saleor-apps-rs"
license = "MIT OR Apache-2.0"

[dependencies]
anyhow = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
serde_json = { workspace = true }
envy = { workspace = true }
dotenvy = { workspace = true }
rust_decimal = { workspace = true, features = ["serde-float"] }
iso_currency = { workspace = true, features = ["with-serde", "iterator"] }
strum = { version = "0.26.2" }
strum_macros = { version = "0.26.2" }
async-trait = { version = "0.1.80" }

## Needed for middleware
axum = { workspace = true, optional = true }
jsonwebtoken = { version = "9.3.0", optional = true }
url = { version = "2.5.0", optional = true }
reqwest = { version = "0.12.3", features = ["json"], optional = true }
http = { version = "1.1.0", optional = true }
# tower = { workspace = true, optional = true }

## Needed for APLs
redis = { workspace = true, features = [
  "aio",
  "tokio-comp",
  "connection-manager",
], optional = true }

## Tracing
tracing = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }

## Needed for webhooks

## Needed for bridge
wasm-bindgen = { workspace = true, optional = true }
serde-wasm-bindgen = { version = "0.6.5", optional = true }
bus = { version = "2.4.1", optional = true }

[dependencies.web-sys]
optional = true
workspace = true
features = [
  "Window",
  "Document",
  "Url",
  "UrlSearchParams",
  "EventListener",
  "EventTarget",
  "console",
]

[features]
default = ["middleware", "redis_apl", "webhook_utils", "tracing"]
middleware = [
  "dep:axum",
  "dep:jsonwebtoken",
  "dep:url",
  "dep:reqwest",
  "dep:http",
]
redis_apl = ["dep:redis"]
webhook_utils = ["dep:http"]
tracing = ["dep:tracing", "dep:tracing-subscriber"]
bridge = [
  "dep:wasm-bindgen",
  "dep:bus",
  "dep:serde-wasm-bindgen",
  "dep:web-sys",
]
