import { PKCECodes } from './pkce'; import { OAuthTokenStorage } from './store'; /** * Qwen Device Flow OAuth — port từ `internal/auth/qwen/qwen_auth.go`. * * RFC 8628 Device Authorization Grant: app yêu cầu device_code + user_code, * hiển thị user_code để user nhập trên browser, poll token định kỳ. */ export declare const QWEN_DEVICE_CODE_URL = "https://chat.qwen.ai/api/v1/oauth2/device/code"; export declare const QWEN_TOKEN_URL = "https://chat.qwen.ai/api/v1/oauth2/token"; export declare const QWEN_CLIENT_ID = "f0304373b74a44d2b584a3fb70ca9e56"; export interface QwenDeviceAuth { deviceCode: string; userCode: string; verificationUri: string; verificationUriComplete?: string; expiresIn: number; intervalSec: number; pkce: PKCECodes; } export declare function requestQwenDeviceCode(): Promise; /** * Poll token endpoint cho đến khi user đã authorize hoặc hết hạn / lỗi. * Throw Error nếu user huỷ / expired. */ export declare function pollQwenToken(device: QwenDeviceAuth, account?: string): Promise; export declare function refreshQwenToken(current: OAuthTokenStorage): Promise;