UNPKG

matterbridge-roborock-vacuum-plugin

Version:
57 lines 2.03 kB
import { AxiosStatic } from 'axios'; import { AnsiLogger } from 'matterbridge/logger'; import { HomeInfo, UserData } from '../models/index.js'; export declare class RoborockAuthenticateApi { private readonly logger; private readonly axiosFactory; private readonly baseUrl; private sessionId; private username?; private authToken?; private cachedBaseUrl?; private cachedCountry?; private cachedCountryCode?; constructor(logger: AnsiLogger, axiosFactory?: AxiosStatic, sessionId?: string, baseUrl?: string); loginWithUserData(username: string, userData: UserData): Promise<UserData>; loginWithPassword(username: string, password: string): Promise<UserData>; /** * Request a verification code to be sent to the user's email * @param email - The user's email address * @throws Error if the account is not found, rate limited, or other API error */ requestCodeV4(email: string): Promise<void>; /** * Login with a verification code received via email * @param email - The user's email address * @param code - The 6-digit verification code * @returns UserData on successful authentication * @throws Error if the code is invalid, rate limited, or other API error */ loginWithCodeV4(email: string, code: string): Promise<UserData>; getBasicHomeInfo(): Promise<HomeInfo | undefined>; /** * Get cached country info from the last base URL lookup */ getCachedCountryInfo(): { country?: string; countryCode?: string; }; private getAPIFor; private getBaseUrl; private apiForUser; private auth; /** * Handle v4 authentication response with specific error code handling */ private authV4; private loginWithAuthToken; /** * Generate a random alphanumeric string of specified length */ private generateRandomString; /** * Sign a key using the v3 API endpoint */ private signKeyV3; } //# sourceMappingURL=authClient.d.ts.map