/** * Dyson Cloud API Client * Handles authentication and device list retrieval from Dyson cloud services * * Authentication flow (from iOS app analysis 2026-01-15): * 1. POST /v3/userregistration/email/auth - Request OTP (sends email), returns challengeId * 2. POST /v3/userregistration/email/verify - Verify OTP with password and get token * * Device retrieval: * - GET /v2/provisioningservice/manifest - Get devices with localBrokerCredentials */ import type { CloudApiConfig, DeviceInfo } from './types.js'; /** * Dyson Cloud API Client * Retrieves device list and credentials from Dyson cloud services * * @example * ```typescript * const api = new DysonCloudApi({ email: 'user@example.com', password: 'pass' }); * await api.authenticate(); * const devices = await api.getDevices(); * ``` */ export declare class DysonCloudApi { private readonly email; private readonly password; private readonly countryCode; private readonly timeout; private authToken; private challengeId; private lastRequestTime; constructor(config: CloudApiConfig); /** * Authenticate with Dyson Cloud API * Flow: Request OTP (sends email) -> Wait for verifyOtp() * * @throws {CloudApiError} If authentication fails or 2FA is required */ authenticate(): Promise; /** * Verify OTP code for two-factor authentication * Password is sent in plaintext per Dyson API requirements * * @param otpCode - One-time password from email * @throws {CloudApiError} If OTP verification fails */ verifyOtp(otpCode: string): Promise; /** * Get list of devices from Dyson Cloud * Uses /v2/provisioningservice/manifest which returns v3-style format * with localBrokerCredentials in connectedConfiguration.mqtt * * @returns Array of device info with credentials * @throws {CloudApiError} If not authenticated or request fails */ getDevices(): Promise; /** * Get list of devices from Dyson Cloud using v3 API * This endpoint provides newer device format with localBrokerCredentials * * @param market - Market code (e.g., 'US', 'GB') * @param locale - Locale code (e.g., 'en-US', 'en-GB') * @returns Array of device info from v3 manifest * @throws {CloudApiError} If not authenticated or request fails */ getDevicesV3(market?: string, locale?: string): Promise; /** * Check if client is authenticated */ isAuthenticated(): boolean; /** * Get the current auth token (for external use) */ getAuthToken(): string | null; /** * Clear authentication state */ logout(): void; /** * Make authenticated request to Dyson API * Uses iOS app headers (from traffic analysis 2026-01-15) */ private request; /** * Handle error responses from Dyson API */ private handleErrorResponse; /** * Ensure client is authenticated before making requests */ private ensureAuthenticated; /** * Decrypt LocalCredentials from device manifest * Uses AES-256-CBC with known key/IV */ private decryptCredentials; /** * Parse raw device manifest v3 into DeviceInfo */ private parseDeviceManifestV3; /** * Enforce rate limiting between requests */ private rateLimitDelay; } //# sourceMappingURL=cloudApi.d.ts.map