Skip to main content

indodax_cli/
integration.rs

1//! Stable integration surface for consumers that embed this crate as a
2//! submodule, path dependency, git dependency, or SDK-style library.
3
4pub use crate::client::IndodaxClient;
5pub use crate::config::{IndodaxConfig, ResolvedCredentials, SecretValue};
6pub use crate::errors::IndodaxError;
7pub use crate::output::{CommandOutput, OutputFormat};
8
9/// SDK-focused imports for application integrations.
10///
11/// This module intentionally avoids CLI command dispatch types, so desktop
12/// apps and services can embed `indodax-cli` without coupling to the CLI API.
13pub mod sdk {
14    pub use crate::client::IndodaxClient;
15    pub use crate::config::{IndodaxConfig, ResolvedCredentials, SecretValue};
16    pub use crate::errors::IndodaxError;
17    pub use crate::output::{CommandOutput, OutputFormat};
18
19    /// Recommended imports for SDK consumers.
20    pub mod prelude {
21        pub use super::{
22            IndodaxClient, IndodaxConfig, IndodaxError, ResolvedCredentials, SecretValue,
23        };
24    }
25}
26
27/// Recommended imports for application integrations.
28pub mod prelude {
29    pub use super::{IndodaxClient, IndodaxConfig, IndodaxError, ResolvedCredentials, SecretValue};
30}
31
32/// CLI-specific integration API.
33///
34/// Use this only when the consumer needs to embed command dispatching.
35#[cfg(all(feature = "cli", not(target_arch = "wasm32")))]
36pub mod cli {
37    pub use crate::output::{CommandOutput, OutputFormat};
38    pub use crate::{dispatch, map_anyhow_error, Cli, Command};
39}