/** * Browser-based authentication for Tinybird CLI * * Implements OAuth flow via local HTTP server callback */ /** * Port for the local OAuth callback server */ export declare const AUTH_SERVER_PORT = 49160; /** * Default auth host (Tinybird cloud) */ export declare const DEFAULT_AUTH_HOST = "https://cloud.tinybird.co"; /** * Default API host (EU region) */ export declare const DEFAULT_API_HOST = "https://api.tinybird.co"; /** * Maximum time to wait for authentication (in seconds) */ export declare const SERVER_MAX_WAIT_TIME = 180; /** * Get the auth host from environment or use default */ export declare function getAuthHost(): string; /** * Result of a login attempt */ export interface AuthResult { success: boolean; token?: string; baseUrl?: string; workspaceName?: string; userEmail?: string; error?: string; } /** * Options for the browser login flow */ export interface LoginOptions { /** Override the default auth host */ authHost?: string; /** Override the API host (region) */ apiHost?: string; } /** * Token response from Tinybird auth API */ interface TokenResponse { workspace_token: string; user_token: string; api_host: string; workspace_name?: string; user_email?: string; } /** * Open a URL in the user's default browser * * Cross-platform support for macOS, Linux, and Windows * * @param url - URL to open * @returns Promise that resolves to true if browser was opened successfully */ export declare function openBrowser(url: string): Promise; /** * Exchange an authorization code for tokens * * @param code - Authorization code from OAuth callback * @param authHost - Auth host URL * @returns Promise that resolves to token response */ export declare function exchangeCodeForTokens(code: string, authHost: string): Promise; /** * Perform browser-based login flow * * 1. Starts a local HTTP server for OAuth callback * 2. Opens the user's browser to the auth URL * 3. Waits for the callback with auth code * 4. Exchanges the code for tokens * * @param options - Login options * @returns Promise that resolves to auth result */ export declare function browserLogin(options?: LoginOptions): Promise; export {}; //# sourceMappingURL=auth.d.ts.map