Skip to main content

openapp_sdk_core/
lib.rs

1//! # openapp-sdk-core
2//!
3//! Language-agnostic core of the `OpenApp` SDK. All language SDKs (Python today; .NET,
4//! Ruby, Go, TypeScript in the future) sit on top of this crate — either directly via
5//! a native binding (`PyO3` for Python) or through [`openapp-sdk-core-c-bridge`].
6//!
7//! What lives here:
8//!
9//! * [`Client`] / [`ClientBuilder`] — the main entry point. `Client` owns an async
10//!   [`reqwest::Client`] configured with retries, telemetry, and a pluggable
11//!   [`auth::TokenProvider`].
12//! * Per-tag sub-clients (e.g. [`resources::OrgsClient`], [`resources::DevicesClient`])
13//!   mirror the `OpenAPI` groups defined in `packages/api-spec/openapi.json`.
14//! * [`error::SdkError`] — exhaustive error enum. All fallible SDK calls return
15//!   `Result<_, SdkError>`.
16//! * [`interceptor::Interceptor`] — hook for request/response observability (logging,
17//!   tracing, custom headers, tenant pinning).
18//!
19//! What **does not** live here:
20//!
21//! * Workflow / determinism layers. `OpenApp` is REST; there is no workflow sandbox.
22//! * Language-specific ergonomics. Those live in `packages/sdk/python/python/openapp_sdk/`.
23
24#![deny(rust_2018_idioms, missing_debug_implementations)]
25#![warn(clippy::pedantic)]
26#![allow(clippy::module_name_repetitions, clippy::missing_errors_doc)]
27
28pub mod auth;
29pub mod client;
30pub mod error;
31pub mod interceptor;
32pub mod resources;
33pub mod retry;
34pub mod telemetry;
35pub mod transport;
36
37pub use client::{Client, ClientBuilder, ClientConfig};
38pub use error::{ApiErrorResponse, SdkError};
39pub use interceptor::Interceptor;
40pub use openapp_sdk_common::{ApiKey, SDK_NAME, SDK_VERSION, TokenFormatError};