systemprompt_cloud/
lib.rs1pub mod api_client;
38pub mod auth;
39pub mod checkout;
40pub mod cli_session;
41pub mod constants;
42pub mod context;
43pub mod credentials;
44pub mod credentials_bootstrap;
45pub mod error;
46pub mod oauth;
47pub mod paths;
48pub mod tenants;
49
50pub use api_client::{
51 CheckoutEvent, CheckoutResponse, CloudApiClient, DeployResponse, ListSecretsResponse, Plan,
52 ProvisioningEvent, ProvisioningEventType, RegistryToken, StatusResponse, SubscriptionStatus,
53 Tenant, TenantInfo, TenantSecrets, TenantStatus, UserInfo, UserMeResponse,
54};
55pub use checkout::{
56 CheckoutCallbackResult, CheckoutTemplates, run_checkout_callback_flow, wait_for_provisioning,
57};
58pub use cli_session::{CliSession, LOCAL_SESSION_KEY, SessionKey, SessionStore};
59pub use constants::api::{PRODUCTION_URL, SANDBOX_URL};
60pub use context::{CloudContext, ResolvedTenant};
61pub use credentials::CloudCredentials;
62pub use credentials_bootstrap::{CredentialsBootstrap, CredentialsBootstrapError};
63pub use error::{CloudError, CloudResult};
64pub use oauth::{OAuthTemplates, run_oauth_flow};
65pub use paths::{
66 CloudPath, CloudPaths, DiscoveredProject, ProfilePath, ProjectContext, ProjectPath,
67 UnifiedContext, expand_home, get_cloud_paths, resolve_path,
68};
69pub use tenants::{StoredTenant, TenantStore, TenantType};
70
71use clap::ValueEnum;
72
73#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, ValueEnum)]
74pub enum Environment {
75 #[default]
76 Production,
77 Sandbox,
78}
79
80impl Environment {
81 #[must_use]
82 pub const fn api_url(&self) -> &'static str {
83 match self {
84 Self::Production => PRODUCTION_URL,
85 Self::Sandbox => SANDBOX_URL,
86 }
87 }
88}
89
90#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
91pub enum OAuthProvider {
92 Github,
93 Google,
94}
95
96impl OAuthProvider {
97 #[must_use]
98 pub const fn as_str(&self) -> &'static str {
99 match self {
100 Self::Github => "github",
101 Self::Google => "google",
102 }
103 }
104
105 #[must_use]
106 pub const fn display_name(&self) -> &'static str {
107 match self {
108 Self::Github => "GitHub",
109 Self::Google => "Google",
110 }
111 }
112}