import { PKCECodes } from './pkce'; import { OAuthTokenStorage } from './store'; /** * iFlow OAuth — port từ `internal/auth/iflow/iflow_auth.go`. * Có 2 path: OAuth PKCE thường + Cookie (BXAuth) flow. */ export declare const IFLOW_AUTH_URL = "https://iflow.cn/oauth"; export declare const IFLOW_TOKEN_URL = "https://iflow.cn/oauth/token"; export declare const IFLOW_API_KEY_URL = "https://platform.iflow.cn/api/openapi/apikey"; export declare const IFLOW_CLIENT_ID = "10009311001"; export declare const IFLOW_DEFAULT_CALLBACK_PORT = 11451; export declare const IFLOW_DEFAULT_API_BASE = "https://apis.iflow.cn/v1"; export interface IFlowAuthSession { authUrl: string; state: string; pkce: PKCECodes; redirectUri: string; } export declare function startIFlowAuth(callbackPort?: number): IFlowAuthSession; export declare function exchangeIFlowCodeForTokens(code: string, pkce: PKCECodes, redirectUri: string, account?: string): Promise; export declare function refreshIFlowToken(current: OAuthTokenStorage): Promise; /** * Cookie flow: user paste cookie BXAuth từ iflow.cn (đã đăng nhập browser). * Gọi platform.iflow.cn/api/openapi/apikey để đổi cookie lấy API key. */ export declare function exchangeIFlowCookieForApiKey(cookie: string, account?: string): Promise;