/** * Auth Helper Functions (TC-001 Refactoring) * Shared logic for deprecated handlers and unified api_auth tool */ import type { AuthWorkflow } from '../core/auth-workflow.js'; import type { ApiKeyCredentials, BearerCredentials, BasicCredentials, OAuth2Credentials, CookieCredentials } from '../core/auth-workflow.js'; import type { AuthInfo } from '../core/api-documentation-discovery.js'; /** Valid auth types */ export type AuthType = AuthInfo['type']; /** Union type for all credential types */ export type TypedCredentials = ApiKeyCredentials | BearerCredentials | BasicCredentials | OAuth2Credentials | CookieCredentials; /** * Build typed credentials from raw input based on auth type */ export declare function buildTypedCredentials(authType: string, rawCredentials: Record): TypedCredentials | { error: string; }; /** * Handle auth status check */ export declare function handleAuthStatus(authWorkflow: AuthWorkflow, domain: string, profile: string): Promise<{ domain: string; status: string; message: string; detectedAuth: AuthInfo[]; configuredCredentials: Array<{ type: AuthType; profile: string; validated: boolean; expiresAt?: number; isExpired: boolean; }>; missingAuth: Array<{ type: string; guidance: ReturnType; }>; }>; /** * Handle configure credentials */ export declare function handleAuthConfigure(authWorkflow: AuthWorkflow, domain: string, authType: string, rawCredentials: Record, profile: string, validate: boolean): Promise<{ success: boolean; domain: string; type: AuthType; profile: string; validated: boolean; error?: string; nextStep?: { action: 'visit_url' | 'enter_code' | 'complete'; url?: string; instructions?: string; }; } | { error: string; }>; /** * Handle OAuth flow completion */ export declare function handleOAuthComplete(authWorkflow: AuthWorkflow, code: string, state: string): Promise<{ success: boolean; domain?: string; profile?: string; validated: boolean; error?: string; message: string; }>; /** * Handle auth guidance request */ export declare function handleAuthGuidance(authWorkflow: AuthWorkflow, domain: string, authType?: string): Promise<{ domain: string; detectedAuthTypes: AuthType[]; guidance: Array<{ type: string; guidance: ReturnType; }>; }>; /** * Handle auth deletion */ export declare function handleAuthDelete(authWorkflow: AuthWorkflow, domain: string, authType: AuthType | undefined, profile: string): Promise<{ success: boolean; domain: string; authType: string; profile: string; message: string; }>; /** * Handle list configured auth */ export declare function handleAuthList(authWorkflow: AuthWorkflow): { totalDomains: number; domains: ReturnType; }; //# sourceMappingURL=auth-helpers.d.ts.map