/** * Token manager type definitions for OAuth2 PKCE flows and token lifecycle. */ /** * OAuth2 configuration for a provider's authorization flow. * GitLab uses public-client PKCE (no clientSecret). * Atlassian uses confidential client with clientSecret + PKCE. */ export interface OAuthConfig { clientId: string; clientSecret?: string; authUrl: string; tokenUrl: string; redirectUri: string; scopes: string[]; usePKCE: boolean; additionalAuthParams?: Record; } /** * Raw token response from an OAuth2 token endpoint. */ export interface TokenResult { accessToken: string; refreshToken: string; tokenType: string; expiresIn: number; scope: string; } /** * Port interface for token lifecycle management. * Implemented by the concrete TokenManager and NullTokenManager. */ export interface TokenManager { getAccessToken(): Promise; authenticate(): Promise; isAuthenticated(): boolean; getTokenStatus(): TokenStatus; shutdown(): void; } /** * Human-readable token status for diagnostics. */ export interface TokenStatus { authenticated: boolean; expiresAt?: number; expiresIn?: string; refreshable: boolean; } /** * Minimal logger interface accepted by the API client and token manager. * Matches the Logger shape from server/logging without importing it. */ export interface ApiLogger { debug(message: string, data?: Record): void; info(message: string, data?: Record): void; warn(message: string, data?: Record): void; error(message: string, data?: Record): void; } /** * Options for creating an API client. */ export interface ApiClientOptions { baseUrl: string; timeout?: number; logger?: ApiLogger; } /** * HTTP API client with automatic Bearer token injection. */ export interface ApiClient { get(path: string, params?: Record): Promise>; post(path: string, body?: unknown): Promise>; put(path: string, body?: unknown): Promise>; delete(path: string): Promise>; getAllPages(path: string, params?: Record): Promise; } /** * Wrapper around an HTTP response with typed body and headers. */ export interface ApiResponse { status: number; headers: Record; body: T; } /** * PKCE code pair for OAuth2 authorization code flow. */ export interface PKCEPair { codeVerifier: string; codeChallenge: string; } //# sourceMappingURL=types.d.ts.map