/** * Configuration Types * * Core configuration types for the RDI SDK client. * * @packageDocumentation */ import type { SDKOptions } from '@rdi-ui/sdk'; /** * Retry configuration options from Speakeasy SDK. * * @example * // Disable retries * { strategy: 'none' } * * @example * // Enable retries with custom backoff * { * strategy: 'backoff', * backoff: { * initialInterval: 1000, * maxInterval: 30000, * exponent: 1.5, * maxElapsedTime: 300000 * }, * retryConnectionErrors: true * } */ export type RetryConfig = SDKOptions['retryConfig']; /** * Configuration options for creating an RDI client. */ export interface RdiClientConfig { /** Base URL of the RDI API server */ baseUrl: string; /** Optional JWT bearer token for authenticated requests */ jwtToken?: string; /** Optional flag to include cookies in SDK requests by setting fetch credentials to `'include'`; false or omitted leaves default behavior */ withCredentials?: boolean; /** Request timeout in milliseconds (default: 30000) */ timeout?: number; /** Additional headers to include in requests */ headers?: Record; /** * Retry configuration. * * Default: backoff strategy with: * - initialInterval: 500ms * - maxInterval: 60000ms * - exponent: 1.5 * - maxElapsedTime: 3600000ms (1 hour) * * Set to `{ strategy: 'none' }` to disable retries. */ retryConfig?: RetryConfig; } /** * Reported RDI server version, for example `1.16.0` or `0.0.202603241332`. */ export type ApiVersion = string; /** * Internal client generation selected by the SDK factory. */ export type ResolvedClientVersion = 'v1' | 'v2';