/** * Unified Jira Connection Interface * * Supports both PAT (Personal Access Token) and OAuth authentication modes. * Provides a unified interface for all Jira API calls. */ export type AuthMode = "PAT" | "OAUTH"; export interface PatCredentials { type: "PAT"; baseUrl: string; email: string; apiKey: string; cloudId?: string; } export interface OAuthConnection { type: "OAUTH"; cloudId: string; baseUrl: string; accessToken: string; refreshToken?: string; atlassianAccountId?: string; } export type JiraConnection = PatCredentials | OAuthConnection; /** * Get authentication mode from environment * * Defaults to PAT if not explicitly set. * Set ATLASSIAN_AUTH_MODE=OAUTH to enable OAuth mode. */ export declare function getAuthMode(): AuthMode; /** * Get PAT credentials from environment variables * * Reads env vars as plain strings. Throws clear error if required vars are missing. * * @throws Error if required credentials are missing or invalid */ export declare function getPatCredentialsFromEnv(): PatCredentials; /** * Get OAuth connection from database/storage * * This is a placeholder for future OAuth implementation. * For now, throws a clear error if OAuth mode is requested but not implemented. * * @param userId - User ID to fetch credentials for * @throws Error if OAuth is not yet fully implemented */ export declare function getOAuthConnectionFromStorage(userId?: string): Promise; /** * Get the current Jira connection based on auth mode * * @param userId - Optional user ID for OAuth mode * @returns JiraConnection (PAT or OAuth) * @throws Error if credentials cannot be resolved */ export declare function getJiraConnection(userId?: string): Promise; /** * Build HTTP headers for a Jira connection * * @param conn - Jira connection (PAT or OAuth) * @returns HTTP headers object */ export declare function buildJiraHeaders(conn: JiraConnection): Record; /** * Get the REST API base URL for a connection * * @param conn - Jira connection * @returns Base URL for REST API calls (without /rest/api/3) */ export declare function getConnectionBaseUrl(conn: JiraConnection): string; /** * Get cloud ID for current connection * * In PAT mode: optional env fallback * In OAuth mode: comes from stored connection (not env) * * @param conn - Jira connection * @returns Cloud ID if available */ export declare function getCloudIdForConnection(conn: JiraConnection): string | undefined; //# sourceMappingURL=jiraConnection.d.ts.map