Skip to main content

tuitbot_core/startup/
mod.rs

1//! Startup types and helpers for Tuitbot CLI commands.
2//!
3//! Provides API tier detection types, OAuth token management,
4//! PKCE authentication helpers, startup banner formatting, and
5//! diagnostic check types used by the `run`, `auth`, and `test`
6//! CLI commands.
7//!
8//! ## Module layout
9//! - `config`   — ApiTier, TierCapabilities, StoredTokens, StartupError
10//! - `db`       — token file I/O, path helpers (data_dir, expand_tilde, validate_db_path)
11//! - `services` — PKCE, OAuth URL building, token exchange, credential verification, banner
12
13pub mod config;
14pub mod db;
15pub mod services;
16
17#[cfg(test)]
18mod tests;
19
20// Re-export the entire public API so callers use `startup::*` unchanged.
21pub use config::{ApiTier, StartupError, StoredTokens, TierCapabilities};
22pub use db::{
23    data_dir, expand_tilde, load_tokens_from_file, resolve_db_path, save_tokens_to_file,
24    token_file_path, validate_db_path,
25};
26pub use services::{
27    build_auth_url, build_redirect_uri, exchange_auth_code, extract_auth_code,
28    extract_callback_state, format_startup_banner, generate_pkce, verify_credentials,
29    PkceChallenge, X_AUTH_URL, X_TOKEN_URL, X_USERS_ME_URL,
30};