/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import { type DeviceCodeResponse, type OAuthToken } from './types.js'; /** * Configuration for Qwen device flow authentication */ export interface DeviceFlowConfig { clientId: string; authorizationEndpoint: string; tokenEndpoint: string; scopes: string[]; } /** * Qwen OAuth device flow implementation */ export declare class QwenDeviceFlow { private config; private pkceVerifier; constructor(config: DeviceFlowConfig); /** * Initiates the device authorization flow * @returns Promise resolving to device code response */ initiateDeviceFlow(): Promise; /** * Polls the authorization server for an access token * @param deviceCode Device code from initiation response * @returns Promise resolving to OAuth token */ pollForToken(deviceCode: string): Promise; /** * Refreshes an expired access token * @param refreshToken Valid refresh token * @returns Promise resolving to new OAuth token */ refreshToken(refreshToken: string): Promise; /** * Generates PKCE code verifier and challenge * @returns Object containing verifier and challenge strings */ private generatePKCE; }