1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Rust client for the WaveKat platform.
//!
//! Reusable across consumers (the [`wavekat-cli`] binary `wk`, the
//! WaveKat desktop daemon, future WaveKat tools) so platform auth and
//! HTTP plumbing have one implementation, not many.
//!
//! ## Quick start
//!
//! ```no_run
//! use wavekat_platform_client::{loopback_handshake, Client, HandshakeOptions};
//!
//! # async fn run() -> wavekat_platform_client::Result<()> {
//! let pending = loopback_handshake(
//! "https://platform.wavekat.com",
//! HandshakeOptions::default(),
//! )?;
//! println!("Open: {}", pending.url());
//! let outcome = pending.wait().await?;
//!
//! let client = Client::new("https://platform.wavekat.com", outcome.token)?;
//! let me = client.whoami().await?;
//! println!("signed in as {}", me.login);
//! # Ok(()) }
//! ```
//!
//! ## What this crate is (and isn't)
//!
//! - **Storage-agnostic.** `Client::new(base_url, token)` is the contract.
//! The crate never reads or writes disk; consumers pick where the token
//! lives (config file, OS keychain, env var, in-memory test fixture).
//! - **Browser-agnostic.** [`loopback_handshake`] returns the sign-in URL;
//! the caller decides how to open it (`webbrowser::open`,
//! `shell.openExternal`, `println!`, …).
//! - **Runtime-light.** Async surface uses `reqwest`; consumers bring
//! their own tokio runtime.
//!
//! [`wavekat-cli`]: https://github.com/wavekat/wavekat-cli
pub use Client;
pub use ;
pub use Me;
pub use ;
pub use ;
pub use Token;
pub use ;