Add Outline API client library foundation
Implements a first vertical slice of the Outline RPC API (auth, documents, collections, users) covering the structural patterns used across the whole API: single object, paginated list, tree, create/update, delete, search. Chosen as the basis for future CLI and GUI clients built on top of this crate. - Handwritten client (not codegen) against the vendored OpenAPI spec, since Outline's API is uniformly POST /api/<resource>.<action> with JSON bodies and inline/anonymous schemas that generators handle poorly - Async (reqwest + tokio) Client, cheaply cloneable, no &mut self methods - thiserror-based Error with ErrorKind classification and boxed API error context; forward-compatible models (unknown fields ignored, unknown string-enum values preserved via a catch-all variant) since the API is unversioned and self-hosted instances vary in age - Pagination via Page<T>/Paginator with next_page/collect_all/into_stream - wiremock-based test suite plus a spec-coverage test guarding against typos in RPC method names
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
[package]
|
||||
name = "outline-sdk"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.85"
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Async Rust client for the Outline (getoutline.com) knowledge base API"
|
||||
keywords = ["outline", "wiki", "api", "client", "knowledge-base"]
|
||||
categories = ["api-bindings", "asynchronous"]
|
||||
readme = "README.md"
|
||||
|
||||
[lib]
|
||||
name = "outline"
|
||||
|
||||
[features]
|
||||
default = ["rustls-tls", "stream"]
|
||||
rustls-tls = ["reqwest/rustls"]
|
||||
native-tls = ["reqwest/native-tls"]
|
||||
stream = ["dep:futures-core", "dep:futures-util", "reqwest/stream"]
|
||||
multipart = ["reqwest/multipart"]
|
||||
tracing = ["dep:tracing"]
|
||||
uuid = ["dep:uuid"]
|
||||
|
||||
[dependencies]
|
||||
reqwest = { version = "0.13", default-features = false, features = ["json", "http2", "charset"] }
|
||||
serde = { version = "1.0.181", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
thiserror = "2"
|
||||
url = "2"
|
||||
http = "1"
|
||||
chrono = { version = "0.4", default-features = false, features = ["serde", "std", "clock"] }
|
||||
secrecy = "0.10"
|
||||
futures-core = { version = "0.3", optional = true }
|
||||
futures-util = { version = "0.3", optional = true, default-features = false }
|
||||
bytes = "1"
|
||||
tracing = { version = "0.1", optional = true }
|
||||
uuid = { version = "1", optional = true, features = ["serde"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||
wiremock = "0.6"
|
||||
serde_json = "1"
|
||||
futures-util = "0.3"
|
||||
http = "1"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
Reference in New Issue
Block a user