/** * RDI Client Factory * * Responsible for API version detection and client instantiation. * Supports both RDI API v1 and v2 with automatic version detection. * * @packageDocumentation */ import type { CredentialsInfo } from '@rdi-ui/sdk/models'; import type { RdiClientConfig, ApiVersion } from '../config/types'; import type { RdiClient } from './RdiClient'; interface VersionDetectionOptions { jwtToken?: string; withCredentials?: boolean; headers?: Record; timeout?: number; } /** * Factory for creating RDI client instances with automatic version detection. * * @example * ```typescript * // Auto-detect version * const client = await RdiClientFactory.create({ * baseUrl: 'https://rdi-server.example.com', * jwtToken: 'your-jwt-token' * }); * ``` */ export declare class RdiClientFactory { private static detectVersionInfo; /** * Creates an RDI client with automatic version detection. * * @param config - Client configuration * @returns Promise resolving to configured RdiClient */ static create(config: RdiClientConfig): Promise; /** * Creates an RDI client and optionally authenticates it before returning. * Convenience method that combines `create` and `client.login`. * * @param config - Client configuration * @param credentials - Optional login credentials * @returns Promise resolving to configured RdiClient */ static createAndLogin(config: RdiClientConfig, credentials?: CredentialsInfo): Promise; private static createSdkContext; private static instantiateClient; private static getActiveCachedVersion; private static cacheVersionInfo; private static fetchVersionDetectionResponse; private static parseVersionDetectionResponse; private static parseVersionDetectionBody; /** * Clears the version detection cache. * Useful for testing or when server configuration changes. */ static clearCache(): void; /** * Gets the cached API version string for a URL, if available. * Returns `1.0.0` when the cached detection result came from a `/api/v2/info` `404` fallback. * Returns `undefined` if not cached or cache expired. * * @param baseUrl - Base URL to check * @returns Cached API version string or undefined */ static getCachedVersion(baseUrl: string, options?: VersionDetectionOptions): ApiVersion | undefined; } export {};