invoance 0.1.0

Official Rust SDK for the Invoance compliance API
Documentation
//! Official Rust SDK for the [Invoance](https://invoance.com) compliance API —
//! cryptographic proof, document anchoring, and AI attestation.
//!
//! The SDK is async (built on `tokio` + `reqwest`). Construct a client, then
//! reach each product surface through a resource accessor:
//!
//! ```no_run
//! # async fn run() -> Result<(), invoance::Error> {
//! use invoance::InvoanceClient;
//! use invoance::models::IngestEventParams;
//! use serde_json::json;
//!
//! let client = InvoanceClient::new()?; // reads INVOANCE_API_KEY from env
//!
//! let event = client
//!     .events()
//!     .ingest(IngestEventParams {
//!         event_type: "policy.approval".into(),
//!         payload: json!({ "policy_id": "pol_001", "decision": "approved" })
//!             .as_object()
//!             .unwrap()
//!             .clone(),
//!         ..Default::default()
//!     })
//!     .await?;
//! println!("{}", event.event_id);
//! # Ok(()) }
//! ```
//!
//! ## Error handling
//!
//! Every fallible call returns `Result<T, `[`Error`]`>`. Classify with the
//! boolean predicates (`is_authentication()`, `is_quota_exceeded()`, …) or by
//! matching the [`Error`] variants.
//!
//! ## Offline crypto helpers
//!
//! - [`audit_verify::verify_audit_event`] — verify an audit event's Ed25519
//!   signature without trusting the server.
//! - [`audit_canonical`] — the `invoance.audit/1` canonicalizer.
//! - [`resources::content_idempotency_key`] — derive a content-stable
//!   idempotency key from a request body.

#![forbid(unsafe_code)]

pub mod audit_canonical;
pub mod audit_verify;
mod client;
mod config;
mod error;
mod http;
pub mod models;
pub mod resources;
mod validate;
mod version;

pub use audit_canonical::{canonical_audit_bytes, normalize_ts, payload_hash_hex, AUDIT_SCHEMA_ID};
pub use audit_verify::{verify_audit_event, AuditVerifyResult, KeySource};
pub use client::{ClientBuilder, InvoanceClient, ValidationResult};
pub use config::ClientConfig;
pub use error::{ApiErrorKind, Error, RequestContext};
pub use resources::content_idempotency_key;
pub use version::SDK_VERSION;