import { ConsolaInstance } from 'consola'; import { z, ZodError } from 'zod'; /** * * `macos` - macOS * * `windows` - Windows * * `linux` - Linux * * `ios` - iOS * * `android` - Android */ declare enum MachineOs { MACOS = "macos", WINDOWS = "windows", LINUX = "linux", IOS = "ios", ANDROID = "android" } /** * * `online` - Online * * `offline` - Offline */ declare enum MachineStatus { ONLINE = "online", OFFLINE = "offline" } /** * * `info` - Info * * `warning` - Warning * * `error` - Error */ declare enum MachineLogLevel { INFO = "info", WARNING = "warning", ERROR = "error" } /** * * `read_only` - Read Only */ declare enum SharedMachinePermission { READ_ONLY = "read_only" } declare enum MachinesMachinesUpdateMetricsCreateRequestStatus { ONLINE = "online", OFFLINE = "offline" } type enums$2_MachineLogLevel = MachineLogLevel; declare const enums$2_MachineLogLevel: typeof MachineLogLevel; type enums$2_MachineOs = MachineOs; declare const enums$2_MachineOs: typeof MachineOs; type enums$2_MachineStatus = MachineStatus; declare const enums$2_MachineStatus: typeof MachineStatus; type enums$2_MachinesMachinesUpdateMetricsCreateRequestStatus = MachinesMachinesUpdateMetricsCreateRequestStatus; declare const enums$2_MachinesMachinesUpdateMetricsCreateRequestStatus: typeof MachinesMachinesUpdateMetricsCreateRequestStatus; type enums$2_SharedMachinePermission = SharedMachinePermission; declare const enums$2_SharedMachinePermission: typeof SharedMachinePermission; declare namespace enums$2 { export { enums$2_MachineLogLevel as MachineLogLevel, enums$2_MachineOs as MachineOs, enums$2_MachineStatus as MachineStatus, enums$2_MachinesMachinesUpdateMetricsCreateRequestStatus as MachinesMachinesUpdateMetricsCreateRequestStatus, enums$2_SharedMachinePermission as SharedMachinePermission }; } /** * Serializer for creating a new share. * * Request model (no read-only fields). */ interface SharedMachineCreateRequest$1 { /** Hours until share expires (null = never) */ expires_in_hours?: number | null; } /** * * Response model (includes read-only fields). */ interface PaginatedSharedMachineListList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * Full shared machine details (for owners). * * Response model (includes read-only fields). */ interface SharedMachine$1 { id: string; /** Unique token for public access */ share_token: string; /** Generate full share URL. */ share_url: string; /** * `read_only` - Read Only */ permission?: SharedMachinePermission; machine: string; machine_name: string; machine_hostname: string; machine_status: string; /** When this share expires (null = never) */ expires_at?: string | null; views_count: number; last_viewed_at?: string | null; /** Can be deactivated without deleting */ is_active?: boolean; is_expired: boolean; is_valid: boolean; /** Count active terminal sessions on this machine. */ active_sessions_count: number; created_by: number; created_at: string; } /** * Lightweight serializer for listing shares. * * Response model (includes read-only fields). */ interface SharedMachineList$1 { id: string; /** Unique token for public access */ share_token: string; /** * `read_only` - Read Only */ permission?: SharedMachinePermission; machine: string; machine_name: string; /** When this share expires (null = never) */ expires_at?: string | null; views_count?: number; /** Can be deactivated without deleting */ is_active?: boolean; is_expired: boolean; is_valid: boolean; created_at: string; } declare namespace models$4 { export type { PaginatedSharedMachineListList$1 as PaginatedSharedMachineListList, SharedMachine$1 as SharedMachine, SharedMachineCreateRequest$1 as SharedMachineCreateRequest, SharedMachineList$1 as SharedMachineList }; } /** * API endpoints for Machine Sharing. */ declare class MachinesMachineSharing { private client; constructor(client: any); /** * Create share link for machine * * Create a public share link for read-only terminal viewing. Only * workspace owner or admin can create shares. */ machinesMachinesShareCreate(id: string, data: SharedMachineCreateRequest$1): Promise; machinesMachinesSharesList(id: string, ordering?: string, page?: number, page_size?: number, search?: string): Promise; machinesMachinesSharesList(id: string, params?: { ordering?: string; page?: number; page_size?: number; search?: string; }): Promise; /** * Remove all shares for machine * * Deactivate all share links for this machine. Only workspace owner or * admin can remove shares. */ machinesMachinesUnshareDestroy(id: string): Promise; } /** * Serializer for Machine model. All fields are always present in responses. * Read-only fields are explicitly defined to ensure correct OpenAPI schema. * * Request model (no read-only fields). */ interface PatchedMachineRequest$1 { workspace?: string; name?: string; hostname?: string; /** * `macos` - macOS * `windows` - Windows * `linux` - Linux * `ios` - iOS * `android` - Android */ os?: MachineOs; os_version?: string; kernel_version?: string; /** * `online` - Online * `offline` - Offline */ status?: MachineStatus; /** Device type: desktop, ios, android */ device_type?: string; /** Unique device identifier (UDID for iOS, Android ID for Android) */ device_id?: string | null; /** CPU architecture (arm64, x86_64, etc.) */ architecture?: string; /** Whether device has shell access (false for mobile) */ has_shell?: boolean; public_ip?: string | null; /** Current username running the agent */ username?: string; /** Unix user ID */ uid?: number | null; /** Whether agent is running as root/admin */ is_root?: boolean; home_dir?: string; cpu_model?: string; cpu_count?: number; total_ram_bytes?: number; cpu_usage?: number; memory_usage?: number; memory_total_gb?: number; disk_usage?: number; disk_total_gb?: number; /** -1 means no battery */ battery_level?: number; is_charging?: boolean; is_on_ac_power?: boolean; uptime_seconds?: number; process_count?: number; agent_version?: string; agent_token?: string; } /** * Serializer for Machine model. All fields are always present in responses. * Read-only fields are explicitly defined to ensure correct OpenAPI schema. * * Response model (includes read-only fields). */ interface Machine$1 { id: string; workspace: string; workspace_name: string; name: string; hostname: string; /** * `macos` - macOS * `windows` - Windows * `linux` - Linux * `ios` - iOS * `android` - Android */ os: MachineOs; os_version?: string; kernel_version?: string; /** * `online` - Online * `offline` - Offline */ status?: MachineStatus; status_emoji: string; is_online: boolean; /** Seconds since last heartbeat */ heartbeat_age_seconds: number; /** Device type: desktop, ios, android */ device_type?: string; /** Unique device identifier (UDID for iOS, Android ID for Android) */ device_id?: string | null; /** CPU architecture (arm64, x86_64, etc.) */ architecture?: string; /** Whether device has shell access (false for mobile) */ has_shell?: boolean; public_ip?: string | null; /** List of local network IP addresses */ local_ips: Array; /** Current username running the agent */ username?: string; /** Unix user ID */ uid?: number | null; /** Whether agent is running as root/admin */ is_root?: boolean; home_dir?: string; cpu_model?: string; cpu_count?: number; total_ram_bytes?: number; cpu_usage?: number; memory_usage?: number; memory_total_gb?: number; disk_usage?: number; disk_total_gb?: number; /** -1 means no battery */ battery_level?: number; is_charging?: boolean; is_on_ac_power?: boolean; uptime_seconds?: number; process_count?: number; agent_version?: string; last_seen?: string | null; created_at: string; active_terminal_session: ActiveTerminalSession$1 | null; } /** * Serializer for MachineLog model. * * Request model (no read-only fields). */ interface MachineLogRequest$1 { machine: string; /** * `info` - Info * `warning` - Warning * `error` - Error */ level: MachineLogLevel; message: string; source?: string; } /** * Serializer for creating machines. * * Response model (includes read-only fields). */ interface MachineCreate$1 { workspace: string; name: string; hostname: string; /** * `macos` - macOS * `windows` - Windows * `linux` - Linux * `ios` - iOS * `android` - Android */ os: MachineOs; os_version?: string; } /** * * Response model (includes read-only fields). */ interface PaginatedMachineList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * * Request model (no read-only fields). */ interface MachinesMachinesUpdateMetricsCreateRequest$1 { cpu_usage?: number; memory_usage?: number; status?: MachinesMachinesUpdateMetricsCreateRequestStatus; } /** * Serializer for MachineLog model. * * Response model (includes read-only fields). */ interface MachineLog$1 { id: string; machine: string; machine_name: string; /** * `info` - Info * `warning` - Warning * `error` - Error */ level: MachineLogLevel; message: string; source?: string; created_at: string; } /** * * Response model (includes read-only fields). */ interface PaginatedMachineLogList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * Serializer for Machine model. All fields are always present in responses. * Read-only fields are explicitly defined to ensure correct OpenAPI schema. * * Request model (no read-only fields). */ interface MachineRequest$1 { workspace: string; name: string; hostname: string; /** * `macos` - macOS * `windows` - Windows * `linux` - Linux * `ios` - iOS * `android` - Android */ os: MachineOs; os_version?: string; kernel_version?: string; /** * `online` - Online * `offline` - Offline */ status?: MachineStatus; /** Device type: desktop, ios, android */ device_type?: string; /** Unique device identifier (UDID for iOS, Android ID for Android) */ device_id?: string | null; /** CPU architecture (arm64, x86_64, etc.) */ architecture?: string; /** Whether device has shell access (false for mobile) */ has_shell?: boolean; public_ip?: string | null; /** Current username running the agent */ username?: string; /** Unix user ID */ uid?: number | null; /** Whether agent is running as root/admin */ is_root?: boolean; home_dir?: string; cpu_model?: string; cpu_count?: number; total_ram_bytes?: number; cpu_usage?: number; memory_usage?: number; memory_total_gb?: number; disk_usage?: number; disk_total_gb?: number; /** -1 means no battery */ battery_level?: number; is_charging?: boolean; is_on_ac_power?: boolean; uptime_seconds?: number; process_count?: number; agent_version?: string; agent_token: string; } /** * Serializer for creating machines. * * Request model (no read-only fields). */ interface MachineCreateRequest$1 { workspace: string; name: string; hostname: string; /** * `macos` - macOS * `windows` - Windows * `linux` - Linux * `ios` - iOS * `android` - Android */ os: MachineOs; os_version?: string; } /** * Serializer for active terminal session info. * * Response model (includes read-only fields). */ interface ActiveTerminalSession$1 { session_id: string; created_at: string; agent_password_required: boolean; } declare namespace models$3 { export type { ActiveTerminalSession$1 as ActiveTerminalSession, Machine$1 as Machine, MachineCreate$1 as MachineCreate, MachineCreateRequest$1 as MachineCreateRequest, MachineLog$1 as MachineLog, MachineLogRequest$1 as MachineLogRequest, MachineRequest$1 as MachineRequest, MachinesMachinesUpdateMetricsCreateRequest$1 as MachinesMachinesUpdateMetricsCreateRequest, PaginatedMachineList$1 as PaginatedMachineList, PaginatedMachineLogList$1 as PaginatedMachineLogList, PatchedMachineRequest$1 as PatchedMachineRequest }; } /** * API endpoints for Machines. */ declare class MachinesMachines { private client; constructor(client: any); logsList(ordering?: string, page?: number, page_size?: number, search?: string): Promise; logsList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }): Promise; /** * ViewSet for MachineLog operations. Read-only except for creation. Logs * are created by agents. */ logsCreate(data: MachineLogRequest$1): Promise; /** * ViewSet for MachineLog operations. Read-only except for creation. Logs * are created by agents. */ logsRetrieve(id: string): Promise; machinesList(ordering?: string, page?: number, page_size?: number, search?: string): Promise; machinesList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }): Promise; /** * ViewSet for Machine operations. Provides CRUD operations for remote * machines with monitoring capabilities. */ machinesCreate(data: MachineCreateRequest$1): Promise; /** * ViewSet for Machine operations. Provides CRUD operations for remote * machines with monitoring capabilities. */ machinesRetrieve(id: string): Promise; /** * ViewSet for Machine operations. Provides CRUD operations for remote * machines with monitoring capabilities. */ machinesUpdate(id: string, data: MachineRequest$1): Promise; /** * ViewSet for Machine operations. Provides CRUD operations for remote * machines with monitoring capabilities. */ machinesPartialUpdate(id: string, data?: PatchedMachineRequest$1): Promise; /** * ViewSet for Machine operations. Provides CRUD operations for remote * machines with monitoring capabilities. */ machinesDestroy(id: string): Promise; machinesLogsList(id: string, level?: string, limit?: number, ordering?: string, page?: number, page_size?: number, search?: string): Promise; machinesLogsList(id: string, params?: { level?: string; limit?: number; ordering?: string; page?: number; page_size?: number; search?: string; }): Promise; /** * Regenerate agent token * * Regenerate machine agent token. */ machinesRegenerateTokenCreate(id: string, data: MachineRequest$1): Promise; /** * Get machine statistics * * Get machine statistics. */ machinesStatsRetrieve(id: string): Promise; /** * Update machine metrics * * Update machine metrics (called by agent). */ machinesUpdateMetricsCreate(id: string, data: MachinesMachinesUpdateMetricsCreateRequest$1): Promise; } /** * HTTP Client Adapter Pattern * * Allows switching between fetch/axios/httpx without changing generated code. * Provides unified interface for making HTTP requests. */ interface HttpRequest$2 { method: string; url: string; headers?: Record; body?: any; params?: Record; /** FormData for file uploads (multipart/form-data) */ formData?: FormData; /** Binary data for octet-stream uploads */ binaryBody?: Blob | ArrayBuffer; } interface HttpResponse$2 { data: T; status: number; statusText: string; headers: Record; } /** * HTTP Client Adapter Interface. * Implement this to use custom HTTP clients (axios, httpx, etc.) */ interface HttpClientAdapter$3 { request(request: HttpRequest$2): Promise>; } /** * Default Fetch API adapter. * Uses native browser fetch() with proper error handling. */ declare class FetchAdapter$2 implements HttpClientAdapter$3 { request(request: HttpRequest$2): Promise>; } /** * FetchAdapter with keepalive:true. * * Use this adapter when you need requests to survive page unload * (visibilitychange / beforeunload) — the browser will complete the request * even after the page is navigated away. Typical use: monitor / analytics flush. * * @example * ```typescript * import { APIClient, KeepAliveFetchAdapter } from './client'; * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() }); * ``` */ declare class KeepAliveFetchAdapter$2 extends FetchAdapter$2 { request(request: HttpRequest$2): Promise>; } /** * API Logger with Consola * Beautiful console logging for API requests and responses * * Installation: * npm install consola */ /** * Request log data */ interface RequestLog$2 { method: string; url: string; headers?: Record; body?: any; timestamp: number; } /** * Response log data */ interface ResponseLog$2 { status: number; statusText: string; data?: any; duration: number; timestamp: number; } /** * Error log data */ interface ErrorLog$2 { message: string; statusCode?: number; fieldErrors?: Record; duration: number; timestamp: number; } /** * Logger configuration */ interface LoggerConfig$2 { /** Enable logging */ enabled: boolean; /** Log requests */ logRequests: boolean; /** Log responses */ logResponses: boolean; /** Log errors */ logErrors: boolean; /** Log request/response bodies */ logBodies: boolean; /** Log headers (excluding sensitive ones) */ logHeaders: boolean; /** Custom consola instance */ consola?: ConsolaInstance; } /** * API Logger class */ declare class APILogger$2 { private config; private consola; constructor(config?: Partial); /** * Enable logging */ enable(): void; /** * Disable logging */ disable(): void; /** * Update configuration */ setConfig(config: Partial): void; /** * Filter sensitive headers */ private filterHeaders; /** * Log request */ logRequest(request: RequestLog$2): void; /** * Log response */ logResponse(request: RequestLog$2, response: ResponseLog$2): void; /** * Log error */ logError(request: RequestLog$2, error: ErrorLog$2): void; /** * Log general info */ info(message: string, ...args: any[]): void; /** * Log warning */ warn(message: string, ...args: any[]): void; /** * Log error */ error(message: string, ...args: any[]): void; /** * Log debug */ debug(message: string, ...args: any[]): void; /** * Log success */ success(message: string, ...args: any[]): void; /** * Create a sub-logger with prefix */ withTag(tag: string): ConsolaInstance; } /** * Retry Configuration and Utilities * * Provides automatic retry logic for failed HTTP requests using p-retry. * Retries only on network errors and server errors (5xx), not client errors (4xx). */ /** * Information about a failed retry attempt. */ interface FailedAttemptInfo$2 { /** The error that caused the failure */ error: Error; /** The attempt number (1-indexed) */ attemptNumber: number; /** Number of retries left */ retriesLeft: number; } /** * Retry configuration options. * * Uses exponential backoff with jitter by default to avoid thundering herd. */ interface RetryConfig$2 { /** * Maximum number of retry attempts. * @default 3 */ retries?: number; /** * Exponential backoff factor. * @default 2 */ factor?: number; /** * Minimum wait time between retries (ms). * @default 1000 */ minTimeout?: number; /** * Maximum wait time between retries (ms). * @default 60000 */ maxTimeout?: number; /** * Add randomness to wait times (jitter). * Helps avoid thundering herd problem. * @default true */ randomize?: boolean; /** * Callback called on each failed attempt. */ onFailedAttempt?: (info: FailedAttemptInfo$2) => void; } /** * Default retry configuration. */ declare const DEFAULT_RETRY_CONFIG$2: Required; /** * Determine if an error should trigger a retry. * * Retries on: * - Network errors (connection refused, timeout, etc.) * - Server errors (5xx status codes) * - Rate limiting (429 status code) * * Does NOT retry on: * - Client errors (4xx except 429) * - Authentication errors (401, 403) * - Not found (404) * * @param error - The error to check * @returns true if should retry, false otherwise */ declare function shouldRetry$2(error: any): boolean; /** * Wrap a function with retry logic. * * @param fn - Async function to retry * @param config - Retry configuration * @returns Result of the function * * @example * ```typescript * const result = await withRetry( * async () => fetch('https://api.example.com/users'), * { retries: 5, minTimeout: 2000 } * ); * ``` */ declare function withRetry$2(fn: () => Promise, config?: RetryConfig$2): Promise; /** * Async API client for Cmdop API. * * Usage: * ```typescript * const client = new APIClient('https://api.example.com'); * const users = await client.users.list(); * const post = await client.posts.create(newPost); * * // Custom HTTP adapter (e.g., Axios) * const client = new APIClient('https://api.example.com', { * httpClient: new AxiosAdapter() * }); * ``` */ declare class APIClient$2 { private baseUrl; private httpClient; private logger; private retryConfig; private tokenGetter; machines_machine_sharing: MachinesMachineSharing; machines_machines: MachinesMachines; constructor(baseUrl: string, options?: { httpClient?: HttpClientAdapter$3; loggerConfig?: Partial; retryConfig?: RetryConfig$2; tokenGetter?: () => string | null; }); /** * Get CSRF token from cookies (for SessionAuthentication). * * Returns null if cookie doesn't exist (JWT-only auth). */ getCsrfToken(): string | null; /** * Get the base URL for building streaming/download URLs. */ getBaseUrl(): string; /** * Get JWT token for URL authentication (used in streaming endpoints). * Returns null if no token getter is configured or no token is available. */ getToken(): string | null; /** * Make HTTP request with Django CSRF and session handling. * Automatically retries on network errors and 5xx server errors. */ request(method: string, path: string, options?: { params?: Record; body?: any; formData?: FormData; binaryBody?: Blob | ArrayBuffer; headers?: Record; }): Promise; /** * Internal request method (without retry wrapper). * Used by request() method with optional retry logic. */ private _makeRequest; } /** * Storage adapters for cross-platform token storage. * * Supports: * - LocalStorage (browser) * - Cookies (SSR/browser) * - Memory (Node.js/Electron/testing) */ /** * Storage adapter interface for cross-platform token storage. */ interface StorageAdapter$2 { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * LocalStorage adapter with safe try-catch for browser environments. * Works in modern browsers with localStorage support. * * Note: This adapter uses window.localStorage and should only be used in browser/client environments. * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead. */ declare class LocalStorageAdapter$2 implements StorageAdapter$2 { private logger?; constructor(logger?: APILogger$2); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * Cookie-based storage adapter for SSR and browser environments. * Useful for Next.js, Nuxt.js, and other SSR frameworks. */ declare class CookieStorageAdapter$2 implements StorageAdapter$2 { private logger?; constructor(logger?: APILogger$2); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * In-memory storage adapter for Node.js, Electron, and testing environments. * Data is stored in RAM and cleared when process exits. */ declare class MemoryStorageAdapter$2 implements StorageAdapter$2 { private storage; private logger?; constructor(logger?: APILogger$2); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * Zod schema for ActiveTerminalSession * * This schema provides runtime validation and type inference. * * Serializer for active terminal session info. * */ /** * Serializer for active terminal session info. */ declare const ActiveTerminalSessionSchema: z.ZodObject<{ session_id: z.ZodString; created_at: z.ZodString; agent_password_required: z.ZodBoolean; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type ActiveTerminalSession = z.infer; /** * Zod schema for Machine * * This schema provides runtime validation and type inference. * * Serializer for Machine model. All fields are always present in responses. Read-only fields are explicitly defined to ensure correct OpenAPI schema. * */ /** * Serializer for Machine model. All fields are always present in responses. Read-only fields are explicitly defined to ensure correct OpenAPI schema. */ declare const MachineSchema: z.ZodObject<{ id: z.ZodString; workspace: z.ZodString; workspace_name: z.ZodString; name: z.ZodString; hostname: z.ZodString; os: z.ZodEnum; os_version: z.ZodOptional; kernel_version: z.ZodOptional; status: z.ZodOptional>; status_emoji: z.ZodString; is_online: z.ZodBoolean; heartbeat_age_seconds: z.ZodNumber; device_type: z.ZodOptional; device_id: z.ZodOptional>; architecture: z.ZodOptional; has_shell: z.ZodOptional; public_ip: z.ZodOptional>; local_ips: z.ZodArray; username: z.ZodOptional; uid: z.ZodOptional>; is_root: z.ZodOptional; home_dir: z.ZodOptional; cpu_model: z.ZodOptional; cpu_count: z.ZodOptional; total_ram_bytes: z.ZodOptional; cpu_usage: z.ZodOptional; memory_usage: z.ZodOptional; memory_total_gb: z.ZodOptional; disk_usage: z.ZodOptional; disk_total_gb: z.ZodOptional; battery_level: z.ZodOptional; is_charging: z.ZodOptional; is_on_ac_power: z.ZodOptional; uptime_seconds: z.ZodOptional; process_count: z.ZodOptional; agent_version: z.ZodOptional; last_seen: z.ZodNullable; created_at: z.ZodString; active_terminal_session: z.ZodNullable>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type Machine = z.infer; /** * Zod schema for MachineCreate * * This schema provides runtime validation and type inference. * * Serializer for creating machines. * */ /** * Serializer for creating machines. */ declare const MachineCreateSchema: z.ZodObject<{ workspace: z.ZodString; name: z.ZodString; hostname: z.ZodString; os: z.ZodEnum; os_version: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type MachineCreate = z.infer; /** * Zod schema for MachineCreateRequest * * This schema provides runtime validation and type inference. * * Serializer for creating machines. * */ /** * Serializer for creating machines. */ declare const MachineCreateRequestSchema: z.ZodObject<{ workspace: z.ZodString; name: z.ZodString; hostname: z.ZodString; os: z.ZodEnum; os_version: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type MachineCreateRequest = z.infer; /** * Zod schema for MachineLog * * This schema provides runtime validation and type inference. * * Serializer for MachineLog model. * */ /** * Serializer for MachineLog model. */ declare const MachineLogSchema: z.ZodObject<{ id: z.ZodString; machine: z.ZodString; machine_name: z.ZodString; level: z.ZodEnum; message: z.ZodString; source: z.ZodOptional; created_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type MachineLog = z.infer; /** * Zod schema for MachineLogRequest * * This schema provides runtime validation and type inference. * * Serializer for MachineLog model. * */ /** * Serializer for MachineLog model. */ declare const MachineLogRequestSchema: z.ZodObject<{ machine: z.ZodString; level: z.ZodEnum; message: z.ZodString; source: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type MachineLogRequest = z.infer; /** * Zod schema for MachineRequest * * This schema provides runtime validation and type inference. * * Serializer for Machine model. All fields are always present in responses. Read-only fields are explicitly defined to ensure correct OpenAPI schema. * */ /** * Serializer for Machine model. All fields are always present in responses. Read-only fields are explicitly defined to ensure correct OpenAPI schema. */ declare const MachineRequestSchema: z.ZodObject<{ workspace: z.ZodString; name: z.ZodString; hostname: z.ZodString; os: z.ZodEnum; os_version: z.ZodOptional; kernel_version: z.ZodOptional; status: z.ZodOptional>; device_type: z.ZodOptional; device_id: z.ZodOptional>; architecture: z.ZodOptional; has_shell: z.ZodOptional; public_ip: z.ZodOptional>; username: z.ZodOptional; uid: z.ZodOptional>; is_root: z.ZodOptional; home_dir: z.ZodOptional; cpu_model: z.ZodOptional; cpu_count: z.ZodOptional; total_ram_bytes: z.ZodOptional; cpu_usage: z.ZodOptional; memory_usage: z.ZodOptional; memory_total_gb: z.ZodOptional; disk_usage: z.ZodOptional; disk_total_gb: z.ZodOptional; battery_level: z.ZodOptional; is_charging: z.ZodOptional; is_on_ac_power: z.ZodOptional; uptime_seconds: z.ZodOptional; process_count: z.ZodOptional; agent_version: z.ZodOptional; agent_token: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type MachineRequest = z.infer; /** * Zod schema for MachinesMachinesUpdateMetricsCreateRequest * * This schema provides runtime validation and type inference. * */ declare const MachinesMachinesUpdateMetricsCreateRequestSchema: z.ZodObject<{ cpu_usage: z.ZodOptional; memory_usage: z.ZodOptional; status: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type MachinesMachinesUpdateMetricsCreateRequest = z.infer; declare const PaginatedMachineListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray; os_version: z.ZodOptional; kernel_version: z.ZodOptional; status: z.ZodOptional>; status_emoji: z.ZodString; is_online: z.ZodBoolean; heartbeat_age_seconds: z.ZodNumber; device_type: z.ZodOptional; device_id: z.ZodOptional>; architecture: z.ZodOptional; has_shell: z.ZodOptional; public_ip: z.ZodOptional>; local_ips: z.ZodArray; username: z.ZodOptional; uid: z.ZodOptional>; is_root: z.ZodOptional; home_dir: z.ZodOptional; cpu_model: z.ZodOptional; cpu_count: z.ZodOptional; total_ram_bytes: z.ZodOptional; cpu_usage: z.ZodOptional; memory_usage: z.ZodOptional; memory_total_gb: z.ZodOptional; disk_usage: z.ZodOptional; disk_total_gb: z.ZodOptional; battery_level: z.ZodOptional; is_charging: z.ZodOptional; is_on_ac_power: z.ZodOptional; uptime_seconds: z.ZodOptional; process_count: z.ZodOptional; agent_version: z.ZodOptional; last_seen: z.ZodNullable; created_at: z.ZodString; active_terminal_session: z.ZodNullable>; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedMachineList = z.infer; declare const PaginatedMachineLogListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray; message: z.ZodString; source: z.ZodOptional; created_at: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedMachineLogList = z.infer; declare const PaginatedSharedMachineListListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray>; machine: z.ZodString; machine_name: z.ZodString; expires_at: z.ZodOptional>; views_count: z.ZodOptional; is_active: z.ZodOptional; is_expired: z.ZodBoolean; is_valid: z.ZodBoolean; created_at: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedSharedMachineListList = z.infer; /** * Zod schema for PatchedMachineRequest * * This schema provides runtime validation and type inference. * * Serializer for Machine model. All fields are always present in responses. Read-only fields are explicitly defined to ensure correct OpenAPI schema. * */ /** * Serializer for Machine model. All fields are always present in responses. Read-only fields are explicitly defined to ensure correct OpenAPI schema. */ declare const PatchedMachineRequestSchema: z.ZodObject<{ workspace: z.ZodOptional; name: z.ZodOptional; hostname: z.ZodOptional; os: z.ZodOptional>; os_version: z.ZodOptional; kernel_version: z.ZodOptional; status: z.ZodOptional>; device_type: z.ZodOptional; device_id: z.ZodOptional>; architecture: z.ZodOptional; has_shell: z.ZodOptional; public_ip: z.ZodOptional>; username: z.ZodOptional; uid: z.ZodOptional>; is_root: z.ZodOptional; home_dir: z.ZodOptional; cpu_model: z.ZodOptional; cpu_count: z.ZodOptional; total_ram_bytes: z.ZodOptional; cpu_usage: z.ZodOptional; memory_usage: z.ZodOptional; memory_total_gb: z.ZodOptional; disk_usage: z.ZodOptional; disk_total_gb: z.ZodOptional; battery_level: z.ZodOptional; is_charging: z.ZodOptional; is_on_ac_power: z.ZodOptional; uptime_seconds: z.ZodOptional; process_count: z.ZodOptional; agent_version: z.ZodOptional; agent_token: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PatchedMachineRequest = z.infer; /** * Zod schema for SharedMachine * * This schema provides runtime validation and type inference. * * Full shared machine details (for owners). * */ /** * Full shared machine details (for owners). */ declare const SharedMachineSchema: z.ZodObject<{ id: z.ZodString; share_token: z.ZodString; share_url: z.ZodString; permission: z.ZodOptional>; machine: z.ZodString; machine_name: z.ZodString; machine_hostname: z.ZodString; machine_status: z.ZodString; expires_at: z.ZodOptional>; views_count: z.ZodNumber; last_viewed_at: z.ZodNullable; is_active: z.ZodOptional; is_expired: z.ZodBoolean; is_valid: z.ZodBoolean; active_sessions_count: z.ZodNumber; created_by: z.ZodNumber; created_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type SharedMachine = z.infer; /** * Zod schema for SharedMachineCreateRequest * * This schema provides runtime validation and type inference. * * Serializer for creating a new share. * */ /** * Serializer for creating a new share. */ declare const SharedMachineCreateRequestSchema: z.ZodObject<{ expires_in_hours: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type SharedMachineCreateRequest = z.infer; /** * Zod schema for SharedMachineList * * This schema provides runtime validation and type inference. * * Lightweight serializer for listing shares. * */ /** * Lightweight serializer for listing shares. */ declare const SharedMachineListSchema: z.ZodObject<{ id: z.ZodString; share_token: z.ZodString; permission: z.ZodOptional>; machine: z.ZodString; machine_name: z.ZodString; expires_at: z.ZodOptional>; views_count: z.ZodOptional; is_active: z.ZodOptional; is_expired: z.ZodBoolean; is_valid: z.ZodBoolean; created_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type SharedMachineList = z.infer; /** * Zod Schemas - Runtime validation and type inference * * Auto-generated from OpenAPI specification. * Provides runtime validation for API requests and responses. * * Usage: * ```typescript * import { UserSchema } from './schemas' * * // Validate data * const user = UserSchema.parse(data) * * // Type inference * type User = z.infer * ``` */ type index$8_ActiveTerminalSession = ActiveTerminalSession; declare const index$8_ActiveTerminalSessionSchema: typeof ActiveTerminalSessionSchema; type index$8_Machine = Machine; type index$8_MachineCreate = MachineCreate; type index$8_MachineCreateRequest = MachineCreateRequest; declare const index$8_MachineCreateRequestSchema: typeof MachineCreateRequestSchema; declare const index$8_MachineCreateSchema: typeof MachineCreateSchema; type index$8_MachineLog = MachineLog; type index$8_MachineLogRequest = MachineLogRequest; declare const index$8_MachineLogRequestSchema: typeof MachineLogRequestSchema; declare const index$8_MachineLogSchema: typeof MachineLogSchema; type index$8_MachineRequest = MachineRequest; declare const index$8_MachineRequestSchema: typeof MachineRequestSchema; declare const index$8_MachineSchema: typeof MachineSchema; type index$8_MachinesMachinesUpdateMetricsCreateRequest = MachinesMachinesUpdateMetricsCreateRequest; declare const index$8_MachinesMachinesUpdateMetricsCreateRequestSchema: typeof MachinesMachinesUpdateMetricsCreateRequestSchema; type index$8_PaginatedMachineList = PaginatedMachineList; declare const index$8_PaginatedMachineListSchema: typeof PaginatedMachineListSchema; type index$8_PaginatedMachineLogList = PaginatedMachineLogList; declare const index$8_PaginatedMachineLogListSchema: typeof PaginatedMachineLogListSchema; type index$8_PaginatedSharedMachineListList = PaginatedSharedMachineListList; declare const index$8_PaginatedSharedMachineListListSchema: typeof PaginatedSharedMachineListListSchema; type index$8_PatchedMachineRequest = PatchedMachineRequest; declare const index$8_PatchedMachineRequestSchema: typeof PatchedMachineRequestSchema; type index$8_SharedMachine = SharedMachine; type index$8_SharedMachineCreateRequest = SharedMachineCreateRequest; declare const index$8_SharedMachineCreateRequestSchema: typeof SharedMachineCreateRequestSchema; type index$8_SharedMachineList = SharedMachineList; declare const index$8_SharedMachineListSchema: typeof SharedMachineListSchema; declare const index$8_SharedMachineSchema: typeof SharedMachineSchema; declare namespace index$8 { export { type index$8_ActiveTerminalSession as ActiveTerminalSession, index$8_ActiveTerminalSessionSchema as ActiveTerminalSessionSchema, type index$8_Machine as Machine, type index$8_MachineCreate as MachineCreate, type index$8_MachineCreateRequest as MachineCreateRequest, index$8_MachineCreateRequestSchema as MachineCreateRequestSchema, index$8_MachineCreateSchema as MachineCreateSchema, type index$8_MachineLog as MachineLog, type index$8_MachineLogRequest as MachineLogRequest, index$8_MachineLogRequestSchema as MachineLogRequestSchema, index$8_MachineLogSchema as MachineLogSchema, type index$8_MachineRequest as MachineRequest, index$8_MachineRequestSchema as MachineRequestSchema, index$8_MachineSchema as MachineSchema, type index$8_MachinesMachinesUpdateMetricsCreateRequest as MachinesMachinesUpdateMetricsCreateRequest, index$8_MachinesMachinesUpdateMetricsCreateRequestSchema as MachinesMachinesUpdateMetricsCreateRequestSchema, type index$8_PaginatedMachineList as PaginatedMachineList, index$8_PaginatedMachineListSchema as PaginatedMachineListSchema, type index$8_PaginatedMachineLogList as PaginatedMachineLogList, index$8_PaginatedMachineLogListSchema as PaginatedMachineLogListSchema, type index$8_PaginatedSharedMachineListList as PaginatedSharedMachineListList, index$8_PaginatedSharedMachineListListSchema as PaginatedSharedMachineListListSchema, type index$8_PatchedMachineRequest as PatchedMachineRequest, index$8_PatchedMachineRequestSchema as PatchedMachineRequestSchema, type index$8_SharedMachine as SharedMachine, type index$8_SharedMachineCreateRequest as SharedMachineCreateRequest, index$8_SharedMachineCreateRequestSchema as SharedMachineCreateRequestSchema, type index$8_SharedMachineList as SharedMachineList, index$8_SharedMachineListSchema as SharedMachineListSchema, index$8_SharedMachineSchema as SharedMachineSchema }; } /** * Zod Validation Events - Browser CustomEvent integration * * Dispatches browser CustomEvents when Zod validation fails, allowing * React/frontend apps to listen and handle validation errors globally. * * @example * ```typescript * // In your React app * window.addEventListener('zod-validation-error', (event) => { * const { operation, path, method, error, response } = event.detail; * console.error(`Validation failed for ${method} ${path}`, error); * // Show toast notification, log to Sentry, etc. * }); * ``` */ /** * Validation error event detail */ interface ValidationErrorDetail$2 { /** Operation/function name that failed validation */ operation: string; /** API endpoint path */ path: string; /** HTTP method */ method: string; /** Zod validation error */ error: ZodError; /** Raw response data that failed validation */ response: any; /** Timestamp of the error */ timestamp: Date; } /** * Custom event type for Zod validation errors */ type ValidationErrorEvent$2 = CustomEvent; /** * Dispatch a Zod validation error event. * * Only dispatches in browser environment (when window is defined). * Safe to call in Node.js/SSR - will be a no-op. * * @param detail - Validation error details */ declare function dispatchValidationError$2(detail: ValidationErrorDetail$2): void; /** * Add a global listener for Zod validation errors. * * @param callback - Function to call when validation error occurs * @returns Cleanup function to remove the listener * * @example * ```typescript * const cleanup = onValidationError(({ operation, error }) => { * toast.error(`Validation failed in ${operation}`); * logToSentry(error); * }); * * // Later, remove listener * cleanup(); * ``` */ declare function onValidationError$2(callback: (detail: ValidationErrorDetail$2) => void): () => void; /** * Format Zod error for logging/display. * * @param error - Zod validation error * @returns Formatted error message */ declare function formatZodError$2(error: ZodError): string; /** * Create share link for machine * * @method POST * @path /api/machines/machines/{id}/share/ */ declare function createMachinesMachinesShareCreate(id: string, data: SharedMachineCreateRequest, client?: any): Promise; /** * List active shares for machine * * @method GET * @path /api/machines/machines/{id}/shares/ */ declare function getMachinesMachinesSharesList(id: string, params?: { ordering?: string; page?: number; page_size?: number; search?: string; }, client?: any): Promise; /** * Remove all shares for machine * * @method DELETE * @path /api/machines/machines/{id}/unshare/ */ declare function deleteMachinesMachinesUnshareDestroy(id: string, client?: any): Promise; /** * API operation * * @method GET * @path /api/machines/logs/ */ declare function getMachinesLogsList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }, client?: any): Promise; /** * API operation * * @method POST * @path /api/machines/logs/ */ declare function createMachinesLogsCreate(data: MachineLogRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/machines/logs/{id}/ */ declare function getMachinesLogsRetrieve(id: string, client?: any): Promise; /** * API operation * * @method GET * @path /api/machines/machines/ */ declare function getMachinesMachinesList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }, client?: any): Promise; /** * API operation * * @method POST * @path /api/machines/machines/ */ declare function createMachinesMachinesCreate(data: MachineCreateRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/machines/machines/{id}/ */ declare function getMachinesMachinesRetrieve(id: string, client?: any): Promise; /** * API operation * * @method PUT * @path /api/machines/machines/{id}/ */ declare function updateMachinesMachinesUpdate(id: string, data: MachineRequest, client?: any): Promise; /** * API operation * * @method PATCH * @path /api/machines/machines/{id}/ */ declare function partialUpdateMachinesMachinesPartialUpdate(id: string, data?: PatchedMachineRequest, client?: any): Promise; /** * API operation * * @method DELETE * @path /api/machines/machines/{id}/ */ declare function deleteMachinesMachinesDestroy(id: string, client?: any): Promise; /** * Get machine logs * * @method GET * @path /api/machines/machines/{id}/logs/ */ declare function getMachinesMachinesLogsList(id: string, params?: { level?: string; limit?: number; ordering?: string; page?: number; page_size?: number; search?: string; }, client?: any): Promise; /** * Regenerate agent token * * @method POST * @path /api/machines/machines/{id}/regenerate-token/ */ declare function createMachinesMachinesRegenerateTokenCreate(id: string, data: MachineRequest, client?: any): Promise; /** * Get machine statistics * * @method GET * @path /api/machines/machines/{id}/stats/ */ declare function getMachinesMachinesStatsRetrieve(id: string, client?: any): Promise; /** * Update machine metrics * * @method POST * @path /api/machines/machines/{id}/update-metrics/ */ declare function createMachinesMachinesUpdateMetricsCreate(id: string, data: MachinesMachinesUpdateMetricsCreateRequest, client?: any): Promise; /** * Typed Fetchers - Universal API functions * * Auto-generated from OpenAPI specification. * These functions work in any JavaScript environment. * * Features: * - Runtime validation with Zod * - Type-safe parameters and responses * - Works with any data-fetching library (SWR, React Query, etc) * - Server Component compatible * * Usage: * ```typescript * import * as fetchers from './fetchers' * * // Direct usage * const user = await fetchers.getUser(1) * * // With SWR * const { data } = useSWR('user-1', () => fetchers.getUser(1)) * * // With React Query * const { data } = useQuery(['user', 1], () => fetchers.getUser(1)) * ``` */ declare const index$7_createMachinesLogsCreate: typeof createMachinesLogsCreate; declare const index$7_createMachinesMachinesCreate: typeof createMachinesMachinesCreate; declare const index$7_createMachinesMachinesRegenerateTokenCreate: typeof createMachinesMachinesRegenerateTokenCreate; declare const index$7_createMachinesMachinesShareCreate: typeof createMachinesMachinesShareCreate; declare const index$7_createMachinesMachinesUpdateMetricsCreate: typeof createMachinesMachinesUpdateMetricsCreate; declare const index$7_deleteMachinesMachinesDestroy: typeof deleteMachinesMachinesDestroy; declare const index$7_deleteMachinesMachinesUnshareDestroy: typeof deleteMachinesMachinesUnshareDestroy; declare const index$7_getMachinesLogsList: typeof getMachinesLogsList; declare const index$7_getMachinesLogsRetrieve: typeof getMachinesLogsRetrieve; declare const index$7_getMachinesMachinesList: typeof getMachinesMachinesList; declare const index$7_getMachinesMachinesLogsList: typeof getMachinesMachinesLogsList; declare const index$7_getMachinesMachinesRetrieve: typeof getMachinesMachinesRetrieve; declare const index$7_getMachinesMachinesSharesList: typeof getMachinesMachinesSharesList; declare const index$7_getMachinesMachinesStatsRetrieve: typeof getMachinesMachinesStatsRetrieve; declare const index$7_partialUpdateMachinesMachinesPartialUpdate: typeof partialUpdateMachinesMachinesPartialUpdate; declare const index$7_updateMachinesMachinesUpdate: typeof updateMachinesMachinesUpdate; declare namespace index$7 { export { index$7_createMachinesLogsCreate as createMachinesLogsCreate, index$7_createMachinesMachinesCreate as createMachinesMachinesCreate, index$7_createMachinesMachinesRegenerateTokenCreate as createMachinesMachinesRegenerateTokenCreate, index$7_createMachinesMachinesShareCreate as createMachinesMachinesShareCreate, index$7_createMachinesMachinesUpdateMetricsCreate as createMachinesMachinesUpdateMetricsCreate, index$7_deleteMachinesMachinesDestroy as deleteMachinesMachinesDestroy, index$7_deleteMachinesMachinesUnshareDestroy as deleteMachinesMachinesUnshareDestroy, index$7_getMachinesLogsList as getMachinesLogsList, index$7_getMachinesLogsRetrieve as getMachinesLogsRetrieve, index$7_getMachinesMachinesList as getMachinesMachinesList, index$7_getMachinesMachinesLogsList as getMachinesMachinesLogsList, index$7_getMachinesMachinesRetrieve as getMachinesMachinesRetrieve, index$7_getMachinesMachinesSharesList as getMachinesMachinesSharesList, index$7_getMachinesMachinesStatsRetrieve as getMachinesMachinesStatsRetrieve, index$7_partialUpdateMachinesMachinesPartialUpdate as partialUpdateMachinesMachinesPartialUpdate, index$7_updateMachinesMachinesUpdate as updateMachinesMachinesUpdate }; } /** * Global API Instance - Singleton configuration with auto-configuration support * * This module provides a global API instance that auto-configures from * environment variables or can be configured manually. * * AUTO-CONFIGURATION (recommended): * Set one of these environment variables and the API will auto-configure: * - NEXT_PUBLIC_API_URL (Next.js) * - VITE_API_URL (Vite) * - REACT_APP_API_URL (Create React App) * - API_URL (generic) * * Then just use fetchers and hooks directly: * ```typescript * import { getUsers } from './_utils/fetchers' * const users = await getUsers({ page: 1 }) * ``` * * MANUAL CONFIGURATION: * ```typescript * import { configureAPI } from './api-instance' * * configureAPI({ * baseUrl: 'https://api.example.com', * token: 'your-jwt-token' * }) * ``` * * For SSR or multiple instances: * ```typescript * import { API } from './index' * import { getUsers } from './_utils/fetchers' * * const api = new API('https://api.example.com') * const users = await getUsers({ page: 1 }, api) * ``` */ /** * Get the global API instance * Auto-configures from environment variables on first call if not manually configured. * @throws Error if API is not configured and no env variable is set */ declare function getAPIInstance$2(): API$2; /** * Check if API is configured (or can be auto-configured) */ declare function isAPIConfigured$2(): boolean; /** * Configure the global API instance * * @param baseUrl - Base URL for the API * @param options - Optional configuration (storage, retry, logger) * * @example * ```typescript * configureAPI({ * baseUrl: 'https://api.example.com', * token: 'jwt-token', * options: { * retryConfig: { maxRetries: 3 }, * loggerConfig: { enabled: true } * } * }) * ``` */ declare function configureAPI$2(config: { baseUrl: string; token?: string; refreshToken?: string; options?: APIOptions$2; }): API$2; /** * Reconfigure the global API instance with new settings * Useful for updating tokens or base URL */ declare function reconfigureAPI$2(updates: { baseUrl?: string; token?: string; refreshToken?: string; }): API$2; /** * Clear tokens from the global API instance */ declare function clearAPITokens$2(): void; /** * Reset the global API instance * Useful for testing or logout scenarios */ declare function resetAPI$2(): void; /** * API Error Classes * * Typed error classes with Django REST Framework support. */ /** * HTTP API Error with DRF field-specific validation errors. * * Usage: * ```typescript * try { * await api.users.create(userData); * } catch (error) { * if (error instanceof APIError) { * if (error.isValidationError) { * console.log('Field errors:', error.fieldErrors); * // { "email": ["Email already exists"], "username": ["Required"] } * } * } * } * ``` */ declare class APIError$2 extends Error { statusCode: number; statusText: string; response: any; url: string; constructor(statusCode: number, statusText: string, response: any, url: string, message?: string); /** * Get error details from response. * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] } */ get details(): Record | null; /** * Get field-specific validation errors from DRF. * Returns: { "field_name": ["error1", "error2"], ... } */ get fieldErrors(): Record | null; /** * Get single error message from DRF. * Checks for "detail", "message", or first field error. */ get errorMessage(): string; get isValidationError(): boolean; get isAuthError(): boolean; get isPermissionError(): boolean; get isNotFoundError(): boolean; get isServerError(): boolean; } /** * Network Error (connection failed, timeout, etc.) */ declare class NetworkError$2 extends Error { url: string; originalError?: Error | undefined; constructor(message: string, url: string, originalError?: Error | undefined); } /** * Cmdop API - API Client with JWT Management * * Usage: * ```typescript * import { API } from './api'; * * const api = new API('https://api.example.com'); * * // Set JWT token * api.setToken('your-jwt-token', 'refresh-token'); * * // Use API * const posts = await api.posts.list(); * const user = await api.users.retrieve(1); * * // Check authentication * if (api.isAuthenticated()) { * // ... * } * * // Custom storage with logging (for Electron/Node.js) * import { MemoryStorageAdapter, APILogger } from './storage'; * const logger = new APILogger({ enabled: true, logLevel: 'debug' }); * const api = new API('https://api.example.com', { * storage: new MemoryStorageAdapter(logger), * loggerConfig: { enabled: true, logLevel: 'debug' } * }); * * // Get OpenAPI schema * const schema = api.getSchema(); * ``` */ declare const TOKEN_KEY$2 = "auth_token"; declare const REFRESH_TOKEN_KEY$2 = "refresh_token"; interface APIOptions$2 { /** Custom storage adapter (defaults to LocalStorageAdapter) */ storage?: StorageAdapter$2; /** Custom HTTP client adapter (defaults to FetchAdapter) */ httpClient?: HttpClientAdapter; /** Retry configuration for failed requests */ retryConfig?: RetryConfig$2; /** Logger configuration */ loggerConfig?: Partial; /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */ locale?: string; } declare class API$2 { private baseUrl; private _client; private _token; private _refreshToken; private _locale; private storage; private options?; machines_machine_sharing: MachinesMachineSharing; machines_machines: MachinesMachines; constructor(baseUrl: string, options?: APIOptions$2); private _loadTokensFromStorage; private _reinitClients; private _injectAuthHeader; /** * Get current JWT token */ getToken(): string | null; /** * Get current refresh token */ getRefreshToken(): string | null; /** * Set JWT token and refresh token * @param token - JWT access token * @param refreshToken - JWT refresh token (optional) */ setToken(token: string, refreshToken?: string): void; /** * Clear all tokens */ clearTokens(): void; /** * Check if user is authenticated */ isAuthenticated(): boolean; /** * Update base URL and reinitialize clients * @param url - New base URL */ setBaseUrl(url: string): void; /** * Get current base URL */ getBaseUrl(): string; /** * Set locale for Accept-Language header * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear */ setLocale(locale: string | null): void; /** * Get current locale */ getLocale(): string | null; /** * Get OpenAPI schema path * @returns Path to the OpenAPI schema JSON file * * Note: The OpenAPI schema is available in the schema.json file. * You can load it dynamically using: * ```typescript * const schema = await fetch('./schema.json').then(r => r.json()); * // or using fs in Node.js: * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8')); * ``` */ getSchemaPath(): string; } type index$6_ActiveTerminalSession = ActiveTerminalSession; declare const index$6_ActiveTerminalSessionSchema: typeof ActiveTerminalSessionSchema; type index$6_Machine = Machine; type index$6_MachineCreate = MachineCreate; type index$6_MachineCreateRequest = MachineCreateRequest; declare const index$6_MachineCreateRequestSchema: typeof MachineCreateRequestSchema; declare const index$6_MachineCreateSchema: typeof MachineCreateSchema; type index$6_MachineLog = MachineLog; type index$6_MachineLogRequest = MachineLogRequest; declare const index$6_MachineLogRequestSchema: typeof MachineLogRequestSchema; declare const index$6_MachineLogSchema: typeof MachineLogSchema; type index$6_MachineRequest = MachineRequest; declare const index$6_MachineRequestSchema: typeof MachineRequestSchema; declare const index$6_MachineSchema: typeof MachineSchema; type index$6_MachinesMachinesUpdateMetricsCreateRequest = MachinesMachinesUpdateMetricsCreateRequest; declare const index$6_MachinesMachinesUpdateMetricsCreateRequestSchema: typeof MachinesMachinesUpdateMetricsCreateRequestSchema; type index$6_PaginatedMachineList = PaginatedMachineList; declare const index$6_PaginatedMachineListSchema: typeof PaginatedMachineListSchema; type index$6_PaginatedMachineLogList = PaginatedMachineLogList; declare const index$6_PaginatedMachineLogListSchema: typeof PaginatedMachineLogListSchema; type index$6_PaginatedSharedMachineListList = PaginatedSharedMachineListList; declare const index$6_PaginatedSharedMachineListListSchema: typeof PaginatedSharedMachineListListSchema; type index$6_PatchedMachineRequest = PatchedMachineRequest; declare const index$6_PatchedMachineRequestSchema: typeof PatchedMachineRequestSchema; type index$6_SharedMachine = SharedMachine; type index$6_SharedMachineCreateRequest = SharedMachineCreateRequest; declare const index$6_SharedMachineCreateRequestSchema: typeof SharedMachineCreateRequestSchema; type index$6_SharedMachineList = SharedMachineList; declare const index$6_SharedMachineListSchema: typeof SharedMachineListSchema; declare const index$6_SharedMachineSchema: typeof SharedMachineSchema; declare const index$6_createMachinesLogsCreate: typeof createMachinesLogsCreate; declare const index$6_createMachinesMachinesCreate: typeof createMachinesMachinesCreate; declare const index$6_createMachinesMachinesRegenerateTokenCreate: typeof createMachinesMachinesRegenerateTokenCreate; declare const index$6_createMachinesMachinesShareCreate: typeof createMachinesMachinesShareCreate; declare const index$6_createMachinesMachinesUpdateMetricsCreate: typeof createMachinesMachinesUpdateMetricsCreate; declare const index$6_deleteMachinesMachinesDestroy: typeof deleteMachinesMachinesDestroy; declare const index$6_deleteMachinesMachinesUnshareDestroy: typeof deleteMachinesMachinesUnshareDestroy; declare const index$6_getMachinesLogsList: typeof getMachinesLogsList; declare const index$6_getMachinesLogsRetrieve: typeof getMachinesLogsRetrieve; declare const index$6_getMachinesMachinesList: typeof getMachinesMachinesList; declare const index$6_getMachinesMachinesLogsList: typeof getMachinesMachinesLogsList; declare const index$6_getMachinesMachinesRetrieve: typeof getMachinesMachinesRetrieve; declare const index$6_getMachinesMachinesSharesList: typeof getMachinesMachinesSharesList; declare const index$6_getMachinesMachinesStatsRetrieve: typeof getMachinesMachinesStatsRetrieve; declare const index$6_partialUpdateMachinesMachinesPartialUpdate: typeof partialUpdateMachinesMachinesPartialUpdate; declare const index$6_updateMachinesMachinesUpdate: typeof updateMachinesMachinesUpdate; declare namespace index$6 { export { API$2 as API, APIClient$2 as APIClient, APIError$2 as APIError, APILogger$2 as APILogger, type APIOptions$2 as APIOptions, type index$6_ActiveTerminalSession as ActiveTerminalSession, index$6_ActiveTerminalSessionSchema as ActiveTerminalSessionSchema, CookieStorageAdapter$2 as CookieStorageAdapter, DEFAULT_RETRY_CONFIG$2 as DEFAULT_RETRY_CONFIG, enums$2 as Enums, type ErrorLog$2 as ErrorLog, type FailedAttemptInfo$2 as FailedAttemptInfo, FetchAdapter$2 as FetchAdapter, index$7 as Fetchers, type HttpClientAdapter$3 as HttpClientAdapter, type HttpRequest$2 as HttpRequest, type HttpResponse$2 as HttpResponse, KeepAliveFetchAdapter$2 as KeepAliveFetchAdapter, LocalStorageAdapter$2 as LocalStorageAdapter, type LoggerConfig$2 as LoggerConfig, type index$6_Machine as Machine, type index$6_MachineCreate as MachineCreate, type index$6_MachineCreateRequest as MachineCreateRequest, index$6_MachineCreateRequestSchema as MachineCreateRequestSchema, index$6_MachineCreateSchema as MachineCreateSchema, type index$6_MachineLog as MachineLog, type index$6_MachineLogRequest as MachineLogRequest, index$6_MachineLogRequestSchema as MachineLogRequestSchema, index$6_MachineLogSchema as MachineLogSchema, type index$6_MachineRequest as MachineRequest, index$6_MachineRequestSchema as MachineRequestSchema, index$6_MachineSchema as MachineSchema, models$4 as MachinesMachineSharingTypes, models$3 as MachinesMachinesTypes, type index$6_MachinesMachinesUpdateMetricsCreateRequest as MachinesMachinesUpdateMetricsCreateRequest, index$6_MachinesMachinesUpdateMetricsCreateRequestSchema as MachinesMachinesUpdateMetricsCreateRequestSchema, MemoryStorageAdapter$2 as MemoryStorageAdapter, NetworkError$2 as NetworkError, type index$6_PaginatedMachineList as PaginatedMachineList, index$6_PaginatedMachineListSchema as PaginatedMachineListSchema, type index$6_PaginatedMachineLogList as PaginatedMachineLogList, index$6_PaginatedMachineLogListSchema as PaginatedMachineLogListSchema, type index$6_PaginatedSharedMachineListList as PaginatedSharedMachineListList, index$6_PaginatedSharedMachineListListSchema as PaginatedSharedMachineListListSchema, type index$6_PatchedMachineRequest as PatchedMachineRequest, index$6_PatchedMachineRequestSchema as PatchedMachineRequestSchema, REFRESH_TOKEN_KEY$2 as REFRESH_TOKEN_KEY, type RequestLog$2 as RequestLog, type ResponseLog$2 as ResponseLog, type RetryConfig$2 as RetryConfig, index$8 as Schemas, type index$6_SharedMachine as SharedMachine, type index$6_SharedMachineCreateRequest as SharedMachineCreateRequest, index$6_SharedMachineCreateRequestSchema as SharedMachineCreateRequestSchema, type index$6_SharedMachineList as SharedMachineList, index$6_SharedMachineListSchema as SharedMachineListSchema, index$6_SharedMachineSchema as SharedMachineSchema, type StorageAdapter$2 as StorageAdapter, TOKEN_KEY$2 as TOKEN_KEY, type ValidationErrorDetail$2 as ValidationErrorDetail, type ValidationErrorEvent$2 as ValidationErrorEvent, clearAPITokens$2 as clearAPITokens, configureAPI$2 as configureAPI, index$6_createMachinesLogsCreate as createMachinesLogsCreate, index$6_createMachinesMachinesCreate as createMachinesMachinesCreate, index$6_createMachinesMachinesRegenerateTokenCreate as createMachinesMachinesRegenerateTokenCreate, index$6_createMachinesMachinesShareCreate as createMachinesMachinesShareCreate, index$6_createMachinesMachinesUpdateMetricsCreate as createMachinesMachinesUpdateMetricsCreate, API$2 as default, index$6_deleteMachinesMachinesDestroy as deleteMachinesMachinesDestroy, index$6_deleteMachinesMachinesUnshareDestroy as deleteMachinesMachinesUnshareDestroy, dispatchValidationError$2 as dispatchValidationError, formatZodError$2 as formatZodError, getAPIInstance$2 as getAPIInstance, index$6_getMachinesLogsList as getMachinesLogsList, index$6_getMachinesLogsRetrieve as getMachinesLogsRetrieve, index$6_getMachinesMachinesList as getMachinesMachinesList, index$6_getMachinesMachinesLogsList as getMachinesMachinesLogsList, index$6_getMachinesMachinesRetrieve as getMachinesMachinesRetrieve, index$6_getMachinesMachinesSharesList as getMachinesMachinesSharesList, index$6_getMachinesMachinesStatsRetrieve as getMachinesMachinesStatsRetrieve, isAPIConfigured$2 as isAPIConfigured, onValidationError$2 as onValidationError, index$6_partialUpdateMachinesMachinesPartialUpdate as partialUpdateMachinesMachinesPartialUpdate, reconfigureAPI$2 as reconfigureAPI, resetAPI$2 as resetAPI, shouldRetry$2 as shouldRetry, index$6_updateMachinesMachinesUpdate as updateMachinesMachinesUpdate, withRetry$2 as withRetry }; } /** * * `owner` - Owner * * `admin` - Admin * * `member` - Member */ declare enum PatchedWorkspaceMemberRequestRole { OWNER = "owner", ADMIN = "admin", MEMBER = "member" } /** * * `personal` - Personal * * `team` - Team */ declare enum PatchedWorkspaceRequestType { PERSONAL = "personal", TEAM = "team" } /** * * `free` - Free * * `pro` - Pro * * `enterprise` - Enterprise */ declare enum PatchedWorkspaceRequestPlan { FREE = "free", PRO = "pro", ENTERPRISE = "enterprise" } /** * * `admin` - Admin * * `member` - Member */ declare enum WorkspaceInvitationRole { ADMIN = "admin", MEMBER = "member" } /** * * `pending` - Pending * * `accepted` - Accepted * * `declined` - Declined * * `expired` - Expired * * `cancelled` - Cancelled */ declare enum WorkspaceInvitationStatus { PENDING = "pending", ACCEPTED = "accepted", DECLINED = "declined", EXPIRED = "expired", CANCELLED = "cancelled" } /** * * `admin` - admin * * `member` - member */ declare enum WorkspaceInvitationCreateRequestRole { ADMIN = "admin", MEMBER = "member" } type enums$1_PatchedWorkspaceMemberRequestRole = PatchedWorkspaceMemberRequestRole; declare const enums$1_PatchedWorkspaceMemberRequestRole: typeof PatchedWorkspaceMemberRequestRole; type enums$1_PatchedWorkspaceRequestPlan = PatchedWorkspaceRequestPlan; declare const enums$1_PatchedWorkspaceRequestPlan: typeof PatchedWorkspaceRequestPlan; type enums$1_PatchedWorkspaceRequestType = PatchedWorkspaceRequestType; declare const enums$1_PatchedWorkspaceRequestType: typeof PatchedWorkspaceRequestType; type enums$1_WorkspaceInvitationCreateRequestRole = WorkspaceInvitationCreateRequestRole; declare const enums$1_WorkspaceInvitationCreateRequestRole: typeof WorkspaceInvitationCreateRequestRole; type enums$1_WorkspaceInvitationRole = WorkspaceInvitationRole; declare const enums$1_WorkspaceInvitationRole: typeof WorkspaceInvitationRole; type enums$1_WorkspaceInvitationStatus = WorkspaceInvitationStatus; declare const enums$1_WorkspaceInvitationStatus: typeof WorkspaceInvitationStatus; declare namespace enums$1 { export { enums$1_PatchedWorkspaceMemberRequestRole as PatchedWorkspaceMemberRequestRole, enums$1_PatchedWorkspaceRequestPlan as PatchedWorkspaceRequestPlan, enums$1_PatchedWorkspaceRequestType as PatchedWorkspaceRequestType, enums$1_WorkspaceInvitationCreateRequestRole as WorkspaceInvitationCreateRequestRole, enums$1_WorkspaceInvitationRole as WorkspaceInvitationRole, enums$1_WorkspaceInvitationStatus as WorkspaceInvitationStatus }; } /** * Serializer for creating workspace invitation. * * Request model (no read-only fields). */ interface WorkspaceInvitationCreateRequest$1 { email: string; /** * `admin` - admin * `member` - member */ role?: WorkspaceInvitationCreateRequestRole; } /** * Serializer for WorkspaceInvitation model. * * Request model (no read-only fields). */ interface WorkspaceInvitationRequest$1 { workspace: string; email: string; /** * `admin` - Admin * `member` - Member */ role?: WorkspaceInvitationRole; } /** * Serializer for Workspace model. All fields are always present in responses * (even read_only ones). * * Request model (no read-only fields). */ interface PatchedWorkspaceRequest$1 { name?: string; slug?: string; /** * `personal` - Personal * `team` - Team */ type?: PatchedWorkspaceRequestType; /** * `free` - Free * `pro` - Pro * `enterprise` - Enterprise */ plan?: PatchedWorkspaceRequestPlan; } /** * Serializer for Workspace model. All fields are always present in responses * (even read_only ones). * * Request model (no read-only fields). */ interface WorkspaceRequest$1 { name: string; slug: string; /** * `personal` - Personal * `team` - Team */ type?: PatchedWorkspaceRequestType; /** * `free` - Free * `pro` - Pro * `enterprise` - Enterprise */ plan?: PatchedWorkspaceRequestPlan; } /** * Public serializer for invitation details (for accept page). * * Response model (includes read-only fields). */ interface WorkspaceInvitationPublic$1 { id: string; workspace_name: string; email: string; /** * `admin` - Admin * `member` - Member */ role?: WorkspaceInvitationRole; /** * `pending` - Pending * `accepted` - Accepted * `declined` - Declined * `expired` - Expired * `cancelled` - Cancelled */ status?: WorkspaceInvitationStatus; invited_by_name: string; created_at: string; expires_at?: string; is_expired: boolean; is_valid: boolean; } /** * * Response model (includes read-only fields). */ interface PaginatedWorkspaceInvitationList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * * Response model (includes read-only fields). */ interface PaginatedWorkspaceMemberList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * Serializer for WorkspaceMember model. * * Request model (no read-only fields). */ interface PatchedWorkspaceMemberRequest$1 { workspace?: string; user_id?: string; /** * `owner` - Owner * `admin` - Admin * `member` - Member */ role?: PatchedWorkspaceMemberRequestRole; } /** * Serializer for WorkspaceInvitation model. * * Response model (includes read-only fields). */ interface WorkspaceInvitation$1 { id: string; workspace: string; workspace_name: string; email: string; /** * `admin` - Admin * `member` - Member */ role?: WorkspaceInvitationRole; /** * `pending` - Pending * `accepted` - Accepted * `declined` - Declined * `expired` - Expired * `cancelled` - Cancelled */ status: WorkspaceInvitationStatus; invited_by: InvitedBy$1; created_at: string; expires_at: string; accepted_at?: string | null; is_expired: boolean; is_valid: boolean; } /** * Serializer for Workspace model. All fields are always present in responses * (even read_only ones). * * Response model (includes read-only fields). */ interface Workspace$1 { id: string; name: string; slug: string; /** * `personal` - Personal * `team` - Team */ type?: PatchedWorkspaceRequestType; /** * `free` - Free * `pro` - Pro * `enterprise` - Enterprise */ plan?: PatchedWorkspaceRequestPlan; created_at: string; member_count: number; machine_count: number; } /** * Serializer for creating workspaces. * * Request model (no read-only fields). */ interface WorkspaceCreateRequest$1 { name: string; /** * `personal` - Personal * `team` - Team */ type?: PatchedWorkspaceRequestType; /** * `free` - Free * `pro` - Pro * `enterprise` - Enterprise */ plan?: PatchedWorkspaceRequestPlan; } /** * Serializer for WorkspaceMember model. * * Response model (includes read-only fields). */ interface WorkspaceMember$1 { id: string; workspace: string; workspace_name: string; user: UserBasic$1; /** * `owner` - Owner * `admin` - Admin * `member` - Member */ role?: PatchedWorkspaceMemberRequestRole; joined_at: string; } /** * Serializer for WorkspaceMember model. * * Request model (no read-only fields). */ interface WorkspaceMemberRequest$1 { workspace: string; user_id?: string; /** * `owner` - Owner * `admin` - Admin * `member` - Member */ role?: PatchedWorkspaceMemberRequestRole; } /** * Serializer for accepting workspace invitation. * * Request model (no read-only fields). */ interface WorkspaceInvitationAcceptRequest$1 { token: string; } /** * Basic user info for invitation inviter. * * Response model (includes read-only fields). */ interface InvitedBy$1 { id: number; email: string; first_name: string; last_name: string; } /** * Basic user info for workspace members. * * Response model (includes read-only fields). */ interface UserBasic$1 { id: number; email: string; first_name: string; last_name: string; /** Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. */ username: string; } declare namespace models$2 { export type { InvitedBy$1 as InvitedBy, PaginatedWorkspaceInvitationList$1 as PaginatedWorkspaceInvitationList, PaginatedWorkspaceMemberList$1 as PaginatedWorkspaceMemberList, PatchedWorkspaceMemberRequest$1 as PatchedWorkspaceMemberRequest, PatchedWorkspaceRequest$1 as PatchedWorkspaceRequest, UserBasic$1 as UserBasic, Workspace$1 as Workspace, WorkspaceCreateRequest$1 as WorkspaceCreateRequest, WorkspaceInvitation$1 as WorkspaceInvitation, WorkspaceInvitationAcceptRequest$1 as WorkspaceInvitationAcceptRequest, WorkspaceInvitationCreateRequest$1 as WorkspaceInvitationCreateRequest, WorkspaceInvitationPublic$1 as WorkspaceInvitationPublic, WorkspaceInvitationRequest$1 as WorkspaceInvitationRequest, WorkspaceMember$1 as WorkspaceMember, WorkspaceMemberRequest$1 as WorkspaceMemberRequest, WorkspaceRequest$1 as WorkspaceRequest }; } /** * API endpoints for Workspaces. */ declare class WorkspacesWorkspaces { private client; constructor(client: any); invitationsList(ordering?: string, page?: number, page_size?: number, search?: string): Promise; invitationsList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }): Promise; /** * Create invitation * * Invite a user to a workspace by email */ invitationsCreate(data: WorkspaceInvitationCreateRequest$1): Promise; /** * Get invitation details * * Get details of a specific invitation */ invitationsRetrieve(id: string): Promise; /** * Cancel invitation * * Cancel a pending invitation */ invitationsDestroy(id: string): Promise; /** * Resend invitation * * Resend invitation email and regenerate token */ invitationsResendCreate(id: string, data: WorkspaceInvitationRequest$1): Promise; /** * Accept invitation * * Accept a workspace invitation */ invitationsAcceptCreate(data: WorkspaceInvitationAcceptRequest$1): Promise; /** * Decline invitation * * Decline a workspace invitation (no auth required) */ invitationsDeclineCreate(data: WorkspaceInvitationAcceptRequest$1): Promise; /** * Get invitation details by token * * Get public invitation details for accept page (no auth required) */ invitationsDetailsRetrieve(token: string): Promise; membersList(ordering?: string, page?: number, page_size?: number, role?: string, search?: string): Promise; membersList(params?: { ordering?: string; page?: number; page_size?: number; role?: string; search?: string; }): Promise; /** * ViewSet for WorkspaceMember operations. Manage workspace memberships and * roles. */ membersCreate(data: WorkspaceMemberRequest$1): Promise; /** * ViewSet for WorkspaceMember operations. Manage workspace memberships and * roles. */ membersRetrieve(id: string): Promise; /** * ViewSet for WorkspaceMember operations. Manage workspace memberships and * roles. */ membersUpdate(id: string, data: WorkspaceMemberRequest$1): Promise; /** * ViewSet for WorkspaceMember operations. Manage workspace memberships and * roles. */ membersPartialUpdate(id: string, data?: PatchedWorkspaceMemberRequest$1): Promise; /** * ViewSet for WorkspaceMember operations. Manage workspace memberships and * roles. */ membersDestroy(id: string): Promise; /** * Update member role * * Update workspace member role. */ membersUpdateRoleCreate(id: string, data: WorkspaceMemberRequest$1): Promise; workspacesList(ordering?: string, search?: string): Promise; workspacesList(params?: { ordering?: string; search?: string; }): Promise; /** * Create new workspace * * Create workspace and return full workspace data. */ workspacesCreate(data: WorkspaceCreateRequest$1): Promise; /** * ViewSet for Workspace operations. Provides CRUD operations for * workspaces with team/personal modes. */ workspacesRetrieve(id: string): Promise; /** * ViewSet for Workspace operations. Provides CRUD operations for * workspaces with team/personal modes. */ workspacesUpdate(id: string, data: WorkspaceRequest$1): Promise; /** * ViewSet for Workspace operations. Provides CRUD operations for * workspaces with team/personal modes. */ workspacesPartialUpdate(id: string, data?: PatchedWorkspaceRequest$1): Promise; /** * ViewSet for Workspace operations. Provides CRUD operations for * workspaces with team/personal modes. */ workspacesDestroy(id: string): Promise; /** * List workspace members * * Get all members of this workspace. */ workspacesMembersRetrieve(id: string): Promise; /** * Get workspace statistics * * Get workspace statistics. */ workspacesStatsRetrieve(id: string): Promise; } /** * HTTP Client Adapter Pattern * * Allows switching between fetch/axios/httpx without changing generated code. * Provides unified interface for making HTTP requests. */ interface HttpRequest$1 { method: string; url: string; headers?: Record; body?: any; params?: Record; /** FormData for file uploads (multipart/form-data) */ formData?: FormData; /** Binary data for octet-stream uploads */ binaryBody?: Blob | ArrayBuffer; } interface HttpResponse$1 { data: T; status: number; statusText: string; headers: Record; } /** * HTTP Client Adapter Interface. * Implement this to use custom HTTP clients (axios, httpx, etc.) */ interface HttpClientAdapter$2 { request(request: HttpRequest$1): Promise>; } /** * Default Fetch API adapter. * Uses native browser fetch() with proper error handling. */ declare class FetchAdapter$1 implements HttpClientAdapter$2 { request(request: HttpRequest$1): Promise>; } /** * FetchAdapter with keepalive:true. * * Use this adapter when you need requests to survive page unload * (visibilitychange / beforeunload) — the browser will complete the request * even after the page is navigated away. Typical use: monitor / analytics flush. * * @example * ```typescript * import { APIClient, KeepAliveFetchAdapter } from './client'; * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() }); * ``` */ declare class KeepAliveFetchAdapter$1 extends FetchAdapter$1 { request(request: HttpRequest$1): Promise>; } /** * API Logger with Consola * Beautiful console logging for API requests and responses * * Installation: * npm install consola */ /** * Request log data */ interface RequestLog$1 { method: string; url: string; headers?: Record; body?: any; timestamp: number; } /** * Response log data */ interface ResponseLog$1 { status: number; statusText: string; data?: any; duration: number; timestamp: number; } /** * Error log data */ interface ErrorLog$1 { message: string; statusCode?: number; fieldErrors?: Record; duration: number; timestamp: number; } /** * Logger configuration */ interface LoggerConfig$1 { /** Enable logging */ enabled: boolean; /** Log requests */ logRequests: boolean; /** Log responses */ logResponses: boolean; /** Log errors */ logErrors: boolean; /** Log request/response bodies */ logBodies: boolean; /** Log headers (excluding sensitive ones) */ logHeaders: boolean; /** Custom consola instance */ consola?: ConsolaInstance; } /** * API Logger class */ declare class APILogger$1 { private config; private consola; constructor(config?: Partial); /** * Enable logging */ enable(): void; /** * Disable logging */ disable(): void; /** * Update configuration */ setConfig(config: Partial): void; /** * Filter sensitive headers */ private filterHeaders; /** * Log request */ logRequest(request: RequestLog$1): void; /** * Log response */ logResponse(request: RequestLog$1, response: ResponseLog$1): void; /** * Log error */ logError(request: RequestLog$1, error: ErrorLog$1): void; /** * Log general info */ info(message: string, ...args: any[]): void; /** * Log warning */ warn(message: string, ...args: any[]): void; /** * Log error */ error(message: string, ...args: any[]): void; /** * Log debug */ debug(message: string, ...args: any[]): void; /** * Log success */ success(message: string, ...args: any[]): void; /** * Create a sub-logger with prefix */ withTag(tag: string): ConsolaInstance; } /** * Retry Configuration and Utilities * * Provides automatic retry logic for failed HTTP requests using p-retry. * Retries only on network errors and server errors (5xx), not client errors (4xx). */ /** * Information about a failed retry attempt. */ interface FailedAttemptInfo$1 { /** The error that caused the failure */ error: Error; /** The attempt number (1-indexed) */ attemptNumber: number; /** Number of retries left */ retriesLeft: number; } /** * Retry configuration options. * * Uses exponential backoff with jitter by default to avoid thundering herd. */ interface RetryConfig$1 { /** * Maximum number of retry attempts. * @default 3 */ retries?: number; /** * Exponential backoff factor. * @default 2 */ factor?: number; /** * Minimum wait time between retries (ms). * @default 1000 */ minTimeout?: number; /** * Maximum wait time between retries (ms). * @default 60000 */ maxTimeout?: number; /** * Add randomness to wait times (jitter). * Helps avoid thundering herd problem. * @default true */ randomize?: boolean; /** * Callback called on each failed attempt. */ onFailedAttempt?: (info: FailedAttemptInfo$1) => void; } /** * Default retry configuration. */ declare const DEFAULT_RETRY_CONFIG$1: Required; /** * Determine if an error should trigger a retry. * * Retries on: * - Network errors (connection refused, timeout, etc.) * - Server errors (5xx status codes) * - Rate limiting (429 status code) * * Does NOT retry on: * - Client errors (4xx except 429) * - Authentication errors (401, 403) * - Not found (404) * * @param error - The error to check * @returns true if should retry, false otherwise */ declare function shouldRetry$1(error: any): boolean; /** * Wrap a function with retry logic. * * @param fn - Async function to retry * @param config - Retry configuration * @returns Result of the function * * @example * ```typescript * const result = await withRetry( * async () => fetch('https://api.example.com/users'), * { retries: 5, minTimeout: 2000 } * ); * ``` */ declare function withRetry$1(fn: () => Promise, config?: RetryConfig$1): Promise; /** * Async API client for Cmdop API. * * Usage: * ```typescript * const client = new APIClient('https://api.example.com'); * const users = await client.users.list(); * const post = await client.posts.create(newPost); * * // Custom HTTP adapter (e.g., Axios) * const client = new APIClient('https://api.example.com', { * httpClient: new AxiosAdapter() * }); * ``` */ declare class APIClient$1 { private baseUrl; private httpClient; private logger; private retryConfig; private tokenGetter; workspaces_workspaces: WorkspacesWorkspaces; constructor(baseUrl: string, options?: { httpClient?: HttpClientAdapter$2; loggerConfig?: Partial; retryConfig?: RetryConfig$1; tokenGetter?: () => string | null; }); /** * Get CSRF token from cookies (for SessionAuthentication). * * Returns null if cookie doesn't exist (JWT-only auth). */ getCsrfToken(): string | null; /** * Get the base URL for building streaming/download URLs. */ getBaseUrl(): string; /** * Get JWT token for URL authentication (used in streaming endpoints). * Returns null if no token getter is configured or no token is available. */ getToken(): string | null; /** * Make HTTP request with Django CSRF and session handling. * Automatically retries on network errors and 5xx server errors. */ request(method: string, path: string, options?: { params?: Record; body?: any; formData?: FormData; binaryBody?: Blob | ArrayBuffer; headers?: Record; }): Promise; /** * Internal request method (without retry wrapper). * Used by request() method with optional retry logic. */ private _makeRequest; } /** * Storage adapters for cross-platform token storage. * * Supports: * - LocalStorage (browser) * - Cookies (SSR/browser) * - Memory (Node.js/Electron/testing) */ /** * Storage adapter interface for cross-platform token storage. */ interface StorageAdapter$1 { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * LocalStorage adapter with safe try-catch for browser environments. * Works in modern browsers with localStorage support. * * Note: This adapter uses window.localStorage and should only be used in browser/client environments. * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead. */ declare class LocalStorageAdapter$1 implements StorageAdapter$1 { private logger?; constructor(logger?: APILogger$1); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * Cookie-based storage adapter for SSR and browser environments. * Useful for Next.js, Nuxt.js, and other SSR frameworks. */ declare class CookieStorageAdapter$1 implements StorageAdapter$1 { private logger?; constructor(logger?: APILogger$1); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * In-memory storage adapter for Node.js, Electron, and testing environments. * Data is stored in RAM and cleared when process exits. */ declare class MemoryStorageAdapter$1 implements StorageAdapter$1 { private storage; private logger?; constructor(logger?: APILogger$1); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * Zod schema for InvitedBy * * This schema provides runtime validation and type inference. * * Basic user info for invitation inviter. * */ /** * Basic user info for invitation inviter. */ declare const InvitedBySchema: z.ZodObject<{ id: z.ZodNumber; email: z.ZodEmail; first_name: z.ZodString; last_name: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type InvitedBy = z.infer; declare const PaginatedWorkspaceInvitationListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray>; status: z.ZodEnum; invited_by: z.ZodObject<{ id: z.ZodNumber; email: z.ZodEmail; first_name: z.ZodString; last_name: z.ZodString; }, z.core.$strip>; created_at: z.ZodString; expires_at: z.ZodString; accepted_at: z.ZodNullable; is_expired: z.ZodBoolean; is_valid: z.ZodBoolean; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedWorkspaceInvitationList = z.infer; declare const PaginatedWorkspaceMemberListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray; role: z.ZodOptional>; joined_at: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedWorkspaceMemberList = z.infer; /** * Zod schema for PatchedWorkspaceMemberRequest * * This schema provides runtime validation and type inference. * * Serializer for WorkspaceMember model. * */ /** * Serializer for WorkspaceMember model. */ declare const PatchedWorkspaceMemberRequestSchema: z.ZodObject<{ workspace: z.ZodOptional; user_id: z.ZodOptional; role: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PatchedWorkspaceMemberRequest = z.infer; /** * Zod schema for PatchedWorkspaceRequest * * This schema provides runtime validation and type inference. * * Serializer for Workspace model. All fields are always present in responses (even read_only ones). * */ /** * Serializer for Workspace model. All fields are always present in responses (even read_only ones). */ declare const PatchedWorkspaceRequestSchema: z.ZodObject<{ name: z.ZodOptional; slug: z.ZodOptional; type: z.ZodOptional>; plan: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PatchedWorkspaceRequest = z.infer; /** * Zod schema for UserBasic * * This schema provides runtime validation and type inference. * * Basic user info for workspace members. * */ /** * Basic user info for workspace members. */ declare const UserBasicSchema: z.ZodObject<{ id: z.ZodNumber; email: z.ZodEmail; first_name: z.ZodString; last_name: z.ZodString; username: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type UserBasic = z.infer; /** * Zod schema for Workspace * * This schema provides runtime validation and type inference. * * Serializer for Workspace model. All fields are always present in responses (even read_only ones). * */ /** * Serializer for Workspace model. All fields are always present in responses (even read_only ones). */ declare const WorkspaceSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; slug: z.ZodString; type: z.ZodOptional>; plan: z.ZodOptional>; created_at: z.ZodString; member_count: z.ZodNumber; machine_count: z.ZodNumber; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type Workspace = z.infer; /** * Zod schema for WorkspaceCreateRequest * * This schema provides runtime validation and type inference. * * Serializer for creating workspaces. * */ /** * Serializer for creating workspaces. */ declare const WorkspaceCreateRequestSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodOptional>; plan: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceCreateRequest = z.infer; /** * Zod schema for WorkspaceInvitation * * This schema provides runtime validation and type inference. * * Serializer for WorkspaceInvitation model. * */ /** * Serializer for WorkspaceInvitation model. */ declare const WorkspaceInvitationSchema: z.ZodObject<{ id: z.ZodString; workspace: z.ZodString; workspace_name: z.ZodString; email: z.ZodEmail; role: z.ZodOptional>; status: z.ZodEnum; invited_by: z.ZodObject<{ id: z.ZodNumber; email: z.ZodEmail; first_name: z.ZodString; last_name: z.ZodString; }, z.core.$strip>; created_at: z.ZodString; expires_at: z.ZodString; accepted_at: z.ZodNullable; is_expired: z.ZodBoolean; is_valid: z.ZodBoolean; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceInvitation = z.infer; /** * Zod schema for WorkspaceInvitationAcceptRequest * * This schema provides runtime validation and type inference. * * Serializer for accepting workspace invitation. * */ /** * Serializer for accepting workspace invitation. */ declare const WorkspaceInvitationAcceptRequestSchema: z.ZodObject<{ token: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceInvitationAcceptRequest = z.infer; /** * Zod schema for WorkspaceInvitationCreateRequest * * This schema provides runtime validation and type inference. * * Serializer for creating workspace invitation. * */ /** * Serializer for creating workspace invitation. */ declare const WorkspaceInvitationCreateRequestSchema: z.ZodObject<{ email: z.ZodEmail; role: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceInvitationCreateRequest = z.infer; /** * Zod schema for WorkspaceInvitationPublic * * This schema provides runtime validation and type inference. * * Public serializer for invitation details (for accept page). * */ /** * Public serializer for invitation details (for accept page). */ declare const WorkspaceInvitationPublicSchema: z.ZodObject<{ id: z.ZodString; workspace_name: z.ZodString; email: z.ZodEmail; role: z.ZodOptional>; status: z.ZodOptional>; invited_by_name: z.ZodString; created_at: z.ZodString; expires_at: z.ZodOptional; is_expired: z.ZodBoolean; is_valid: z.ZodBoolean; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceInvitationPublic = z.infer; /** * Zod schema for WorkspaceInvitationRequest * * This schema provides runtime validation and type inference. * * Serializer for WorkspaceInvitation model. * */ /** * Serializer for WorkspaceInvitation model. */ declare const WorkspaceInvitationRequestSchema: z.ZodObject<{ workspace: z.ZodString; email: z.ZodEmail; role: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceInvitationRequest = z.infer; /** * Zod schema for WorkspaceMember * * This schema provides runtime validation and type inference. * * Serializer for WorkspaceMember model. * */ /** * Serializer for WorkspaceMember model. */ declare const WorkspaceMemberSchema: z.ZodObject<{ id: z.ZodString; workspace: z.ZodString; workspace_name: z.ZodString; user: z.ZodObject<{ id: z.ZodNumber; email: z.ZodEmail; first_name: z.ZodString; last_name: z.ZodString; username: z.ZodString; }, z.core.$strip>; role: z.ZodOptional>; joined_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceMember = z.infer; /** * Zod schema for WorkspaceMemberRequest * * This schema provides runtime validation and type inference. * * Serializer for WorkspaceMember model. * */ /** * Serializer for WorkspaceMember model. */ declare const WorkspaceMemberRequestSchema: z.ZodObject<{ workspace: z.ZodString; user_id: z.ZodOptional; role: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceMemberRequest = z.infer; /** * Zod schema for WorkspaceRequest * * This schema provides runtime validation and type inference. * * Serializer for Workspace model. All fields are always present in responses (even read_only ones). * */ /** * Serializer for Workspace model. All fields are always present in responses (even read_only ones). */ declare const WorkspaceRequestSchema: z.ZodObject<{ name: z.ZodString; slug: z.ZodString; type: z.ZodOptional>; plan: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type WorkspaceRequest = z.infer; /** * Zod Schemas - Runtime validation and type inference * * Auto-generated from OpenAPI specification. * Provides runtime validation for API requests and responses. * * Usage: * ```typescript * import { UserSchema } from './schemas' * * // Validate data * const user = UserSchema.parse(data) * * // Type inference * type User = z.infer * ``` */ type index$5_InvitedBy = InvitedBy; declare const index$5_InvitedBySchema: typeof InvitedBySchema; type index$5_PaginatedWorkspaceInvitationList = PaginatedWorkspaceInvitationList; declare const index$5_PaginatedWorkspaceInvitationListSchema: typeof PaginatedWorkspaceInvitationListSchema; type index$5_PaginatedWorkspaceMemberList = PaginatedWorkspaceMemberList; declare const index$5_PaginatedWorkspaceMemberListSchema: typeof PaginatedWorkspaceMemberListSchema; type index$5_PatchedWorkspaceMemberRequest = PatchedWorkspaceMemberRequest; declare const index$5_PatchedWorkspaceMemberRequestSchema: typeof PatchedWorkspaceMemberRequestSchema; type index$5_PatchedWorkspaceRequest = PatchedWorkspaceRequest; declare const index$5_PatchedWorkspaceRequestSchema: typeof PatchedWorkspaceRequestSchema; type index$5_UserBasic = UserBasic; declare const index$5_UserBasicSchema: typeof UserBasicSchema; type index$5_Workspace = Workspace; type index$5_WorkspaceCreateRequest = WorkspaceCreateRequest; declare const index$5_WorkspaceCreateRequestSchema: typeof WorkspaceCreateRequestSchema; type index$5_WorkspaceInvitation = WorkspaceInvitation; type index$5_WorkspaceInvitationAcceptRequest = WorkspaceInvitationAcceptRequest; declare const index$5_WorkspaceInvitationAcceptRequestSchema: typeof WorkspaceInvitationAcceptRequestSchema; type index$5_WorkspaceInvitationCreateRequest = WorkspaceInvitationCreateRequest; declare const index$5_WorkspaceInvitationCreateRequestSchema: typeof WorkspaceInvitationCreateRequestSchema; type index$5_WorkspaceInvitationPublic = WorkspaceInvitationPublic; declare const index$5_WorkspaceInvitationPublicSchema: typeof WorkspaceInvitationPublicSchema; type index$5_WorkspaceInvitationRequest = WorkspaceInvitationRequest; declare const index$5_WorkspaceInvitationRequestSchema: typeof WorkspaceInvitationRequestSchema; declare const index$5_WorkspaceInvitationSchema: typeof WorkspaceInvitationSchema; type index$5_WorkspaceMember = WorkspaceMember; type index$5_WorkspaceMemberRequest = WorkspaceMemberRequest; declare const index$5_WorkspaceMemberRequestSchema: typeof WorkspaceMemberRequestSchema; declare const index$5_WorkspaceMemberSchema: typeof WorkspaceMemberSchema; type index$5_WorkspaceRequest = WorkspaceRequest; declare const index$5_WorkspaceRequestSchema: typeof WorkspaceRequestSchema; declare const index$5_WorkspaceSchema: typeof WorkspaceSchema; declare namespace index$5 { export { type index$5_InvitedBy as InvitedBy, index$5_InvitedBySchema as InvitedBySchema, type index$5_PaginatedWorkspaceInvitationList as PaginatedWorkspaceInvitationList, index$5_PaginatedWorkspaceInvitationListSchema as PaginatedWorkspaceInvitationListSchema, type index$5_PaginatedWorkspaceMemberList as PaginatedWorkspaceMemberList, index$5_PaginatedWorkspaceMemberListSchema as PaginatedWorkspaceMemberListSchema, type index$5_PatchedWorkspaceMemberRequest as PatchedWorkspaceMemberRequest, index$5_PatchedWorkspaceMemberRequestSchema as PatchedWorkspaceMemberRequestSchema, type index$5_PatchedWorkspaceRequest as PatchedWorkspaceRequest, index$5_PatchedWorkspaceRequestSchema as PatchedWorkspaceRequestSchema, type index$5_UserBasic as UserBasic, index$5_UserBasicSchema as UserBasicSchema, type index$5_Workspace as Workspace, type index$5_WorkspaceCreateRequest as WorkspaceCreateRequest, index$5_WorkspaceCreateRequestSchema as WorkspaceCreateRequestSchema, type index$5_WorkspaceInvitation as WorkspaceInvitation, type index$5_WorkspaceInvitationAcceptRequest as WorkspaceInvitationAcceptRequest, index$5_WorkspaceInvitationAcceptRequestSchema as WorkspaceInvitationAcceptRequestSchema, type index$5_WorkspaceInvitationCreateRequest as WorkspaceInvitationCreateRequest, index$5_WorkspaceInvitationCreateRequestSchema as WorkspaceInvitationCreateRequestSchema, type index$5_WorkspaceInvitationPublic as WorkspaceInvitationPublic, index$5_WorkspaceInvitationPublicSchema as WorkspaceInvitationPublicSchema, type index$5_WorkspaceInvitationRequest as WorkspaceInvitationRequest, index$5_WorkspaceInvitationRequestSchema as WorkspaceInvitationRequestSchema, index$5_WorkspaceInvitationSchema as WorkspaceInvitationSchema, type index$5_WorkspaceMember as WorkspaceMember, type index$5_WorkspaceMemberRequest as WorkspaceMemberRequest, index$5_WorkspaceMemberRequestSchema as WorkspaceMemberRequestSchema, index$5_WorkspaceMemberSchema as WorkspaceMemberSchema, type index$5_WorkspaceRequest as WorkspaceRequest, index$5_WorkspaceRequestSchema as WorkspaceRequestSchema, index$5_WorkspaceSchema as WorkspaceSchema }; } /** * Zod Validation Events - Browser CustomEvent integration * * Dispatches browser CustomEvents when Zod validation fails, allowing * React/frontend apps to listen and handle validation errors globally. * * @example * ```typescript * // In your React app * window.addEventListener('zod-validation-error', (event) => { * const { operation, path, method, error, response } = event.detail; * console.error(`Validation failed for ${method} ${path}`, error); * // Show toast notification, log to Sentry, etc. * }); * ``` */ /** * Validation error event detail */ interface ValidationErrorDetail$1 { /** Operation/function name that failed validation */ operation: string; /** API endpoint path */ path: string; /** HTTP method */ method: string; /** Zod validation error */ error: ZodError; /** Raw response data that failed validation */ response: any; /** Timestamp of the error */ timestamp: Date; } /** * Custom event type for Zod validation errors */ type ValidationErrorEvent$1 = CustomEvent; /** * Dispatch a Zod validation error event. * * Only dispatches in browser environment (when window is defined). * Safe to call in Node.js/SSR - will be a no-op. * * @param detail - Validation error details */ declare function dispatchValidationError$1(detail: ValidationErrorDetail$1): void; /** * Add a global listener for Zod validation errors. * * @param callback - Function to call when validation error occurs * @returns Cleanup function to remove the listener * * @example * ```typescript * const cleanup = onValidationError(({ operation, error }) => { * toast.error(`Validation failed in ${operation}`); * logToSentry(error); * }); * * // Later, remove listener * cleanup(); * ``` */ declare function onValidationError$1(callback: (detail: ValidationErrorDetail$1) => void): () => void; /** * Format Zod error for logging/display. * * @param error - Zod validation error * @returns Formatted error message */ declare function formatZodError$1(error: ZodError): string; /** * List invitations * * @method GET * @path /api/workspaces/invitations/ */ declare function getWorkspacesInvitationsList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }, client?: any): Promise; /** * Create invitation * * @method POST * @path /api/workspaces/invitations/ */ declare function createWorkspacesInvitationsCreate(data: WorkspaceInvitationCreateRequest, client?: any): Promise; /** * Get invitation details * * @method GET * @path /api/workspaces/invitations/{id}/ */ declare function getWorkspacesInvitationsRetrieve(id: string, client?: any): Promise; /** * Cancel invitation * * @method DELETE * @path /api/workspaces/invitations/{id}/ */ declare function deleteWorkspacesInvitationsDestroy(id: string, client?: any): Promise; /** * Resend invitation * * @method POST * @path /api/workspaces/invitations/{id}/resend/ */ declare function createWorkspacesInvitationsResendCreate(id: string, data: WorkspaceInvitationRequest, client?: any): Promise; /** * Accept invitation * * @method POST * @path /api/workspaces/invitations/accept/ */ declare function createWorkspacesInvitationsAcceptCreate(data: WorkspaceInvitationAcceptRequest, client?: any): Promise; /** * Decline invitation * * @method POST * @path /api/workspaces/invitations/decline/ */ declare function createWorkspacesInvitationsDeclineCreate(data: WorkspaceInvitationAcceptRequest, client?: any): Promise; /** * Get invitation details by token * * @method GET * @path /api/workspaces/invitations/details/{token}/ */ declare function getWorkspacesInvitationsDetailsRetrieve(token: string, client?: any): Promise; /** * API operation * * @method GET * @path /api/workspaces/members/ */ declare function getWorkspacesMembersList(params?: { ordering?: string; page?: number; page_size?: number; role?: string; search?: string; }, client?: any): Promise; /** * API operation * * @method POST * @path /api/workspaces/members/ */ declare function createWorkspacesMembersCreate(data: WorkspaceMemberRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/workspaces/members/{id}/ */ declare function getWorkspacesMembersRetrieve(id: string, client?: any): Promise; /** * API operation * * @method PUT * @path /api/workspaces/members/{id}/ */ declare function updateWorkspacesMembersUpdate(id: string, data: WorkspaceMemberRequest, client?: any): Promise; /** * API operation * * @method PATCH * @path /api/workspaces/members/{id}/ */ declare function partialUpdateWorkspacesMembersPartialUpdate(id: string, data?: PatchedWorkspaceMemberRequest, client?: any): Promise; /** * API operation * * @method DELETE * @path /api/workspaces/members/{id}/ */ declare function deleteWorkspacesMembersDestroy(id: string, client?: any): Promise; /** * Update member role * * @method POST * @path /api/workspaces/members/{id}/update-role/ */ declare function createWorkspacesMembersUpdateRoleCreate(id: string, data: WorkspaceMemberRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/workspaces/workspaces/ */ declare function getWorkspacesWorkspacesList(params?: { ordering?: string; search?: string; }, client?: any): Promise; /** * Create new workspace * * @method POST * @path /api/workspaces/workspaces/ */ declare function createWorkspacesWorkspacesCreate(data: WorkspaceCreateRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/workspaces/workspaces/{id}/ */ declare function getWorkspacesWorkspacesRetrieve(id: string, client?: any): Promise; /** * API operation * * @method PUT * @path /api/workspaces/workspaces/{id}/ */ declare function updateWorkspacesWorkspacesUpdate(id: string, data: WorkspaceRequest, client?: any): Promise; /** * API operation * * @method PATCH * @path /api/workspaces/workspaces/{id}/ */ declare function partialUpdateWorkspacesWorkspacesPartialUpdate(id: string, data?: PatchedWorkspaceRequest, client?: any): Promise; /** * API operation * * @method DELETE * @path /api/workspaces/workspaces/{id}/ */ declare function deleteWorkspacesWorkspacesDestroy(id: string, client?: any): Promise; /** * List workspace members * * @method GET * @path /api/workspaces/workspaces/{id}/members/ */ declare function getWorkspacesWorkspacesMembersRetrieve(id: string, client?: any): Promise; /** * Get workspace statistics * * @method GET * @path /api/workspaces/workspaces/{id}/stats/ */ declare function getWorkspacesWorkspacesStatsRetrieve(id: string, client?: any): Promise; /** * Typed Fetchers - Universal API functions * * Auto-generated from OpenAPI specification. * These functions work in any JavaScript environment. * * Features: * - Runtime validation with Zod * - Type-safe parameters and responses * - Works with any data-fetching library (SWR, React Query, etc) * - Server Component compatible * * Usage: * ```typescript * import * as fetchers from './fetchers' * * // Direct usage * const user = await fetchers.getUser(1) * * // With SWR * const { data } = useSWR('user-1', () => fetchers.getUser(1)) * * // With React Query * const { data } = useQuery(['user', 1], () => fetchers.getUser(1)) * ``` */ declare const index$4_createWorkspacesInvitationsAcceptCreate: typeof createWorkspacesInvitationsAcceptCreate; declare const index$4_createWorkspacesInvitationsCreate: typeof createWorkspacesInvitationsCreate; declare const index$4_createWorkspacesInvitationsDeclineCreate: typeof createWorkspacesInvitationsDeclineCreate; declare const index$4_createWorkspacesInvitationsResendCreate: typeof createWorkspacesInvitationsResendCreate; declare const index$4_createWorkspacesMembersCreate: typeof createWorkspacesMembersCreate; declare const index$4_createWorkspacesMembersUpdateRoleCreate: typeof createWorkspacesMembersUpdateRoleCreate; declare const index$4_createWorkspacesWorkspacesCreate: typeof createWorkspacesWorkspacesCreate; declare const index$4_deleteWorkspacesInvitationsDestroy: typeof deleteWorkspacesInvitationsDestroy; declare const index$4_deleteWorkspacesMembersDestroy: typeof deleteWorkspacesMembersDestroy; declare const index$4_deleteWorkspacesWorkspacesDestroy: typeof deleteWorkspacesWorkspacesDestroy; declare const index$4_getWorkspacesInvitationsDetailsRetrieve: typeof getWorkspacesInvitationsDetailsRetrieve; declare const index$4_getWorkspacesInvitationsList: typeof getWorkspacesInvitationsList; declare const index$4_getWorkspacesInvitationsRetrieve: typeof getWorkspacesInvitationsRetrieve; declare const index$4_getWorkspacesMembersList: typeof getWorkspacesMembersList; declare const index$4_getWorkspacesMembersRetrieve: typeof getWorkspacesMembersRetrieve; declare const index$4_getWorkspacesWorkspacesList: typeof getWorkspacesWorkspacesList; declare const index$4_getWorkspacesWorkspacesMembersRetrieve: typeof getWorkspacesWorkspacesMembersRetrieve; declare const index$4_getWorkspacesWorkspacesRetrieve: typeof getWorkspacesWorkspacesRetrieve; declare const index$4_getWorkspacesWorkspacesStatsRetrieve: typeof getWorkspacesWorkspacesStatsRetrieve; declare const index$4_partialUpdateWorkspacesMembersPartialUpdate: typeof partialUpdateWorkspacesMembersPartialUpdate; declare const index$4_partialUpdateWorkspacesWorkspacesPartialUpdate: typeof partialUpdateWorkspacesWorkspacesPartialUpdate; declare const index$4_updateWorkspacesMembersUpdate: typeof updateWorkspacesMembersUpdate; declare const index$4_updateWorkspacesWorkspacesUpdate: typeof updateWorkspacesWorkspacesUpdate; declare namespace index$4 { export { index$4_createWorkspacesInvitationsAcceptCreate as createWorkspacesInvitationsAcceptCreate, index$4_createWorkspacesInvitationsCreate as createWorkspacesInvitationsCreate, index$4_createWorkspacesInvitationsDeclineCreate as createWorkspacesInvitationsDeclineCreate, index$4_createWorkspacesInvitationsResendCreate as createWorkspacesInvitationsResendCreate, index$4_createWorkspacesMembersCreate as createWorkspacesMembersCreate, index$4_createWorkspacesMembersUpdateRoleCreate as createWorkspacesMembersUpdateRoleCreate, index$4_createWorkspacesWorkspacesCreate as createWorkspacesWorkspacesCreate, index$4_deleteWorkspacesInvitationsDestroy as deleteWorkspacesInvitationsDestroy, index$4_deleteWorkspacesMembersDestroy as deleteWorkspacesMembersDestroy, index$4_deleteWorkspacesWorkspacesDestroy as deleteWorkspacesWorkspacesDestroy, index$4_getWorkspacesInvitationsDetailsRetrieve as getWorkspacesInvitationsDetailsRetrieve, index$4_getWorkspacesInvitationsList as getWorkspacesInvitationsList, index$4_getWorkspacesInvitationsRetrieve as getWorkspacesInvitationsRetrieve, index$4_getWorkspacesMembersList as getWorkspacesMembersList, index$4_getWorkspacesMembersRetrieve as getWorkspacesMembersRetrieve, index$4_getWorkspacesWorkspacesList as getWorkspacesWorkspacesList, index$4_getWorkspacesWorkspacesMembersRetrieve as getWorkspacesWorkspacesMembersRetrieve, index$4_getWorkspacesWorkspacesRetrieve as getWorkspacesWorkspacesRetrieve, index$4_getWorkspacesWorkspacesStatsRetrieve as getWorkspacesWorkspacesStatsRetrieve, index$4_partialUpdateWorkspacesMembersPartialUpdate as partialUpdateWorkspacesMembersPartialUpdate, index$4_partialUpdateWorkspacesWorkspacesPartialUpdate as partialUpdateWorkspacesWorkspacesPartialUpdate, index$4_updateWorkspacesMembersUpdate as updateWorkspacesMembersUpdate, index$4_updateWorkspacesWorkspacesUpdate as updateWorkspacesWorkspacesUpdate }; } /** * Global API Instance - Singleton configuration with auto-configuration support * * This module provides a global API instance that auto-configures from * environment variables or can be configured manually. * * AUTO-CONFIGURATION (recommended): * Set one of these environment variables and the API will auto-configure: * - NEXT_PUBLIC_API_URL (Next.js) * - VITE_API_URL (Vite) * - REACT_APP_API_URL (Create React App) * - API_URL (generic) * * Then just use fetchers and hooks directly: * ```typescript * import { getUsers } from './_utils/fetchers' * const users = await getUsers({ page: 1 }) * ``` * * MANUAL CONFIGURATION: * ```typescript * import { configureAPI } from './api-instance' * * configureAPI({ * baseUrl: 'https://api.example.com', * token: 'your-jwt-token' * }) * ``` * * For SSR or multiple instances: * ```typescript * import { API } from './index' * import { getUsers } from './_utils/fetchers' * * const api = new API('https://api.example.com') * const users = await getUsers({ page: 1 }, api) * ``` */ /** * Get the global API instance * Auto-configures from environment variables on first call if not manually configured. * @throws Error if API is not configured and no env variable is set */ declare function getAPIInstance$1(): API$1; /** * Check if API is configured (or can be auto-configured) */ declare function isAPIConfigured$1(): boolean; /** * Configure the global API instance * * @param baseUrl - Base URL for the API * @param options - Optional configuration (storage, retry, logger) * * @example * ```typescript * configureAPI({ * baseUrl: 'https://api.example.com', * token: 'jwt-token', * options: { * retryConfig: { maxRetries: 3 }, * loggerConfig: { enabled: true } * } * }) * ``` */ declare function configureAPI$1(config: { baseUrl: string; token?: string; refreshToken?: string; options?: APIOptions$1; }): API$1; /** * Reconfigure the global API instance with new settings * Useful for updating tokens or base URL */ declare function reconfigureAPI$1(updates: { baseUrl?: string; token?: string; refreshToken?: string; }): API$1; /** * Clear tokens from the global API instance */ declare function clearAPITokens$1(): void; /** * Reset the global API instance * Useful for testing or logout scenarios */ declare function resetAPI$1(): void; /** * API Error Classes * * Typed error classes with Django REST Framework support. */ /** * HTTP API Error with DRF field-specific validation errors. * * Usage: * ```typescript * try { * await api.users.create(userData); * } catch (error) { * if (error instanceof APIError) { * if (error.isValidationError) { * console.log('Field errors:', error.fieldErrors); * // { "email": ["Email already exists"], "username": ["Required"] } * } * } * } * ``` */ declare class APIError$1 extends Error { statusCode: number; statusText: string; response: any; url: string; constructor(statusCode: number, statusText: string, response: any, url: string, message?: string); /** * Get error details from response. * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] } */ get details(): Record | null; /** * Get field-specific validation errors from DRF. * Returns: { "field_name": ["error1", "error2"], ... } */ get fieldErrors(): Record | null; /** * Get single error message from DRF. * Checks for "detail", "message", or first field error. */ get errorMessage(): string; get isValidationError(): boolean; get isAuthError(): boolean; get isPermissionError(): boolean; get isNotFoundError(): boolean; get isServerError(): boolean; } /** * Network Error (connection failed, timeout, etc.) */ declare class NetworkError$1 extends Error { url: string; originalError?: Error | undefined; constructor(message: string, url: string, originalError?: Error | undefined); } /** * Cmdop API - API Client with JWT Management * * Usage: * ```typescript * import { API } from './api'; * * const api = new API('https://api.example.com'); * * // Set JWT token * api.setToken('your-jwt-token', 'refresh-token'); * * // Use API * const posts = await api.posts.list(); * const user = await api.users.retrieve(1); * * // Check authentication * if (api.isAuthenticated()) { * // ... * } * * // Custom storage with logging (for Electron/Node.js) * import { MemoryStorageAdapter, APILogger } from './storage'; * const logger = new APILogger({ enabled: true, logLevel: 'debug' }); * const api = new API('https://api.example.com', { * storage: new MemoryStorageAdapter(logger), * loggerConfig: { enabled: true, logLevel: 'debug' } * }); * * // Get OpenAPI schema * const schema = api.getSchema(); * ``` */ declare const TOKEN_KEY$1 = "auth_token"; declare const REFRESH_TOKEN_KEY$1 = "refresh_token"; interface APIOptions$1 { /** Custom storage adapter (defaults to LocalStorageAdapter) */ storage?: StorageAdapter$1; /** Custom HTTP client adapter (defaults to FetchAdapter) */ httpClient?: HttpClientAdapter; /** Retry configuration for failed requests */ retryConfig?: RetryConfig$1; /** Logger configuration */ loggerConfig?: Partial; /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */ locale?: string; } declare class API$1 { private baseUrl; private _client; private _token; private _refreshToken; private _locale; private storage; private options?; workspaces_workspaces: WorkspacesWorkspaces; constructor(baseUrl: string, options?: APIOptions$1); private _loadTokensFromStorage; private _reinitClients; private _injectAuthHeader; /** * Get current JWT token */ getToken(): string | null; /** * Get current refresh token */ getRefreshToken(): string | null; /** * Set JWT token and refresh token * @param token - JWT access token * @param refreshToken - JWT refresh token (optional) */ setToken(token: string, refreshToken?: string): void; /** * Clear all tokens */ clearTokens(): void; /** * Check if user is authenticated */ isAuthenticated(): boolean; /** * Update base URL and reinitialize clients * @param url - New base URL */ setBaseUrl(url: string): void; /** * Get current base URL */ getBaseUrl(): string; /** * Set locale for Accept-Language header * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear */ setLocale(locale: string | null): void; /** * Get current locale */ getLocale(): string | null; /** * Get OpenAPI schema path * @returns Path to the OpenAPI schema JSON file * * Note: The OpenAPI schema is available in the schema.json file. * You can load it dynamically using: * ```typescript * const schema = await fetch('./schema.json').then(r => r.json()); * // or using fs in Node.js: * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8')); * ``` */ getSchemaPath(): string; } type index$3_InvitedBy = InvitedBy; declare const index$3_InvitedBySchema: typeof InvitedBySchema; type index$3_PaginatedWorkspaceInvitationList = PaginatedWorkspaceInvitationList; declare const index$3_PaginatedWorkspaceInvitationListSchema: typeof PaginatedWorkspaceInvitationListSchema; type index$3_PaginatedWorkspaceMemberList = PaginatedWorkspaceMemberList; declare const index$3_PaginatedWorkspaceMemberListSchema: typeof PaginatedWorkspaceMemberListSchema; type index$3_PatchedWorkspaceMemberRequest = PatchedWorkspaceMemberRequest; declare const index$3_PatchedWorkspaceMemberRequestSchema: typeof PatchedWorkspaceMemberRequestSchema; type index$3_PatchedWorkspaceRequest = PatchedWorkspaceRequest; declare const index$3_PatchedWorkspaceRequestSchema: typeof PatchedWorkspaceRequestSchema; type index$3_UserBasic = UserBasic; declare const index$3_UserBasicSchema: typeof UserBasicSchema; type index$3_Workspace = Workspace; type index$3_WorkspaceCreateRequest = WorkspaceCreateRequest; declare const index$3_WorkspaceCreateRequestSchema: typeof WorkspaceCreateRequestSchema; type index$3_WorkspaceInvitation = WorkspaceInvitation; type index$3_WorkspaceInvitationAcceptRequest = WorkspaceInvitationAcceptRequest; declare const index$3_WorkspaceInvitationAcceptRequestSchema: typeof WorkspaceInvitationAcceptRequestSchema; type index$3_WorkspaceInvitationCreateRequest = WorkspaceInvitationCreateRequest; declare const index$3_WorkspaceInvitationCreateRequestSchema: typeof WorkspaceInvitationCreateRequestSchema; type index$3_WorkspaceInvitationPublic = WorkspaceInvitationPublic; declare const index$3_WorkspaceInvitationPublicSchema: typeof WorkspaceInvitationPublicSchema; type index$3_WorkspaceInvitationRequest = WorkspaceInvitationRequest; declare const index$3_WorkspaceInvitationRequestSchema: typeof WorkspaceInvitationRequestSchema; declare const index$3_WorkspaceInvitationSchema: typeof WorkspaceInvitationSchema; type index$3_WorkspaceMember = WorkspaceMember; type index$3_WorkspaceMemberRequest = WorkspaceMemberRequest; declare const index$3_WorkspaceMemberRequestSchema: typeof WorkspaceMemberRequestSchema; declare const index$3_WorkspaceMemberSchema: typeof WorkspaceMemberSchema; type index$3_WorkspaceRequest = WorkspaceRequest; declare const index$3_WorkspaceRequestSchema: typeof WorkspaceRequestSchema; declare const index$3_WorkspaceSchema: typeof WorkspaceSchema; declare const index$3_createWorkspacesInvitationsAcceptCreate: typeof createWorkspacesInvitationsAcceptCreate; declare const index$3_createWorkspacesInvitationsCreate: typeof createWorkspacesInvitationsCreate; declare const index$3_createWorkspacesInvitationsDeclineCreate: typeof createWorkspacesInvitationsDeclineCreate; declare const index$3_createWorkspacesInvitationsResendCreate: typeof createWorkspacesInvitationsResendCreate; declare const index$3_createWorkspacesMembersCreate: typeof createWorkspacesMembersCreate; declare const index$3_createWorkspacesMembersUpdateRoleCreate: typeof createWorkspacesMembersUpdateRoleCreate; declare const index$3_createWorkspacesWorkspacesCreate: typeof createWorkspacesWorkspacesCreate; declare const index$3_deleteWorkspacesInvitationsDestroy: typeof deleteWorkspacesInvitationsDestroy; declare const index$3_deleteWorkspacesMembersDestroy: typeof deleteWorkspacesMembersDestroy; declare const index$3_deleteWorkspacesWorkspacesDestroy: typeof deleteWorkspacesWorkspacesDestroy; declare const index$3_getWorkspacesInvitationsDetailsRetrieve: typeof getWorkspacesInvitationsDetailsRetrieve; declare const index$3_getWorkspacesInvitationsList: typeof getWorkspacesInvitationsList; declare const index$3_getWorkspacesInvitationsRetrieve: typeof getWorkspacesInvitationsRetrieve; declare const index$3_getWorkspacesMembersList: typeof getWorkspacesMembersList; declare const index$3_getWorkspacesMembersRetrieve: typeof getWorkspacesMembersRetrieve; declare const index$3_getWorkspacesWorkspacesList: typeof getWorkspacesWorkspacesList; declare const index$3_getWorkspacesWorkspacesMembersRetrieve: typeof getWorkspacesWorkspacesMembersRetrieve; declare const index$3_getWorkspacesWorkspacesRetrieve: typeof getWorkspacesWorkspacesRetrieve; declare const index$3_getWorkspacesWorkspacesStatsRetrieve: typeof getWorkspacesWorkspacesStatsRetrieve; declare const index$3_partialUpdateWorkspacesMembersPartialUpdate: typeof partialUpdateWorkspacesMembersPartialUpdate; declare const index$3_partialUpdateWorkspacesWorkspacesPartialUpdate: typeof partialUpdateWorkspacesWorkspacesPartialUpdate; declare const index$3_updateWorkspacesMembersUpdate: typeof updateWorkspacesMembersUpdate; declare const index$3_updateWorkspacesWorkspacesUpdate: typeof updateWorkspacesWorkspacesUpdate; declare namespace index$3 { export { API$1 as API, APIClient$1 as APIClient, APIError$1 as APIError, APILogger$1 as APILogger, type APIOptions$1 as APIOptions, CookieStorageAdapter$1 as CookieStorageAdapter, DEFAULT_RETRY_CONFIG$1 as DEFAULT_RETRY_CONFIG, enums$1 as Enums, type ErrorLog$1 as ErrorLog, type FailedAttemptInfo$1 as FailedAttemptInfo, FetchAdapter$1 as FetchAdapter, index$4 as Fetchers, type HttpClientAdapter$2 as HttpClientAdapter, type HttpRequest$1 as HttpRequest, type HttpResponse$1 as HttpResponse, type index$3_InvitedBy as InvitedBy, index$3_InvitedBySchema as InvitedBySchema, KeepAliveFetchAdapter$1 as KeepAliveFetchAdapter, LocalStorageAdapter$1 as LocalStorageAdapter, type LoggerConfig$1 as LoggerConfig, MemoryStorageAdapter$1 as MemoryStorageAdapter, NetworkError$1 as NetworkError, type index$3_PaginatedWorkspaceInvitationList as PaginatedWorkspaceInvitationList, index$3_PaginatedWorkspaceInvitationListSchema as PaginatedWorkspaceInvitationListSchema, type index$3_PaginatedWorkspaceMemberList as PaginatedWorkspaceMemberList, index$3_PaginatedWorkspaceMemberListSchema as PaginatedWorkspaceMemberListSchema, type index$3_PatchedWorkspaceMemberRequest as PatchedWorkspaceMemberRequest, index$3_PatchedWorkspaceMemberRequestSchema as PatchedWorkspaceMemberRequestSchema, type index$3_PatchedWorkspaceRequest as PatchedWorkspaceRequest, index$3_PatchedWorkspaceRequestSchema as PatchedWorkspaceRequestSchema, REFRESH_TOKEN_KEY$1 as REFRESH_TOKEN_KEY, type RequestLog$1 as RequestLog, type ResponseLog$1 as ResponseLog, type RetryConfig$1 as RetryConfig, index$5 as Schemas, type StorageAdapter$1 as StorageAdapter, TOKEN_KEY$1 as TOKEN_KEY, type index$3_UserBasic as UserBasic, index$3_UserBasicSchema as UserBasicSchema, type ValidationErrorDetail$1 as ValidationErrorDetail, type ValidationErrorEvent$1 as ValidationErrorEvent, type index$3_Workspace as Workspace, type index$3_WorkspaceCreateRequest as WorkspaceCreateRequest, index$3_WorkspaceCreateRequestSchema as WorkspaceCreateRequestSchema, type index$3_WorkspaceInvitation as WorkspaceInvitation, type index$3_WorkspaceInvitationAcceptRequest as WorkspaceInvitationAcceptRequest, index$3_WorkspaceInvitationAcceptRequestSchema as WorkspaceInvitationAcceptRequestSchema, type index$3_WorkspaceInvitationCreateRequest as WorkspaceInvitationCreateRequest, index$3_WorkspaceInvitationCreateRequestSchema as WorkspaceInvitationCreateRequestSchema, type index$3_WorkspaceInvitationPublic as WorkspaceInvitationPublic, index$3_WorkspaceInvitationPublicSchema as WorkspaceInvitationPublicSchema, type index$3_WorkspaceInvitationRequest as WorkspaceInvitationRequest, index$3_WorkspaceInvitationRequestSchema as WorkspaceInvitationRequestSchema, index$3_WorkspaceInvitationSchema as WorkspaceInvitationSchema, type index$3_WorkspaceMember as WorkspaceMember, type index$3_WorkspaceMemberRequest as WorkspaceMemberRequest, index$3_WorkspaceMemberRequestSchema as WorkspaceMemberRequestSchema, index$3_WorkspaceMemberSchema as WorkspaceMemberSchema, type index$3_WorkspaceRequest as WorkspaceRequest, index$3_WorkspaceRequestSchema as WorkspaceRequestSchema, index$3_WorkspaceSchema as WorkspaceSchema, models$2 as WorkspacesWorkspacesTypes, clearAPITokens$1 as clearAPITokens, configureAPI$1 as configureAPI, index$3_createWorkspacesInvitationsAcceptCreate as createWorkspacesInvitationsAcceptCreate, index$3_createWorkspacesInvitationsCreate as createWorkspacesInvitationsCreate, index$3_createWorkspacesInvitationsDeclineCreate as createWorkspacesInvitationsDeclineCreate, index$3_createWorkspacesInvitationsResendCreate as createWorkspacesInvitationsResendCreate, index$3_createWorkspacesMembersCreate as createWorkspacesMembersCreate, index$3_createWorkspacesMembersUpdateRoleCreate as createWorkspacesMembersUpdateRoleCreate, index$3_createWorkspacesWorkspacesCreate as createWorkspacesWorkspacesCreate, API$1 as default, index$3_deleteWorkspacesInvitationsDestroy as deleteWorkspacesInvitationsDestroy, index$3_deleteWorkspacesMembersDestroy as deleteWorkspacesMembersDestroy, index$3_deleteWorkspacesWorkspacesDestroy as deleteWorkspacesWorkspacesDestroy, dispatchValidationError$1 as dispatchValidationError, formatZodError$1 as formatZodError, getAPIInstance$1 as getAPIInstance, index$3_getWorkspacesInvitationsDetailsRetrieve as getWorkspacesInvitationsDetailsRetrieve, index$3_getWorkspacesInvitationsList as getWorkspacesInvitationsList, index$3_getWorkspacesInvitationsRetrieve as getWorkspacesInvitationsRetrieve, index$3_getWorkspacesMembersList as getWorkspacesMembersList, index$3_getWorkspacesMembersRetrieve as getWorkspacesMembersRetrieve, index$3_getWorkspacesWorkspacesList as getWorkspacesWorkspacesList, index$3_getWorkspacesWorkspacesMembersRetrieve as getWorkspacesWorkspacesMembersRetrieve, index$3_getWorkspacesWorkspacesRetrieve as getWorkspacesWorkspacesRetrieve, index$3_getWorkspacesWorkspacesStatsRetrieve as getWorkspacesWorkspacesStatsRetrieve, isAPIConfigured$1 as isAPIConfigured, onValidationError$1 as onValidationError, index$3_partialUpdateWorkspacesMembersPartialUpdate as partialUpdateWorkspacesMembersPartialUpdate, index$3_partialUpdateWorkspacesWorkspacesPartialUpdate as partialUpdateWorkspacesWorkspacesPartialUpdate, reconfigureAPI$1 as reconfigureAPI, resetAPI$1 as resetAPI, shouldRetry$1 as shouldRetry, index$3_updateWorkspacesMembersUpdate as updateWorkspacesMembersUpdate, index$3_updateWorkspacesWorkspacesUpdate as updateWorkspacesWorkspacesUpdate, withRetry$1 as withRetry }; } /** * * `machine_offline` - Machine Offline * * `task_failed` - Task Failed * * `schedule_error` - Schedule Error */ declare enum AlertType { MACHINE_OFFLINE = "machine_offline", TASK_FAILED = "task_failed", SCHEDULE_ERROR = "schedule_error" } /** * User decision: approve or deny * * `approve` - approve * * `deny` - deny */ declare enum DeviceAuthorizeRequestAction { APPROVE = "approve", DENY = "deny" } /** * OAuth error code * * `authorization_pending` - authorization_pending * * `slow_down` - slow_down * * `access_denied` - access_denied * * `expired_token` - expired_token * * `invalid_grant` - invalid_grant */ declare enum TokenErrorError { AUTHORIZATION_PENDING = "authorization_pending", SLOW_DOWN = "slow_down", ACCESS_DENIED = "access_denied", EXPIRED_TOKEN = "expired_token", INVALID_GRANT = "invalid_grant" } /** * OAuth grant type * * `urn:ietf:params:oauth:grant-type:device_code` - Device Code Flow * * `refresh_token` - Refresh Token */ declare enum TokenRequestRequestGrantType { URN_IETF_PARAMS_OAUTH_GRANT_TYPE_DEVICE_CODE = "urn:ietf:params:oauth:grant-type:device_code", REFRESH_TOKEN = "refresh_token" } /** * Hint about token type (optional) * * `access_token` - access_token * * `refresh_token` - refresh_token */ declare enum TokenRevokeRequestTokenTypeHint { ACCESS_TOKEN = "access_token", REFRESH_TOKEN = "refresh_token" } type enums_AlertType = AlertType; declare const enums_AlertType: typeof AlertType; type enums_DeviceAuthorizeRequestAction = DeviceAuthorizeRequestAction; declare const enums_DeviceAuthorizeRequestAction: typeof DeviceAuthorizeRequestAction; type enums_TokenErrorError = TokenErrorError; declare const enums_TokenErrorError: typeof TokenErrorError; type enums_TokenRequestRequestGrantType = TokenRequestRequestGrantType; declare const enums_TokenRequestRequestGrantType: typeof TokenRequestRequestGrantType; type enums_TokenRevokeRequestTokenTypeHint = TokenRevokeRequestTokenTypeHint; declare const enums_TokenRevokeRequestTokenTypeHint: typeof TokenRevokeRequestTokenTypeHint; declare namespace enums { export { enums_AlertType as AlertType, enums_DeviceAuthorizeRequestAction as DeviceAuthorizeRequestAction, enums_TokenErrorError as TokenErrorError, enums_TokenRequestRequestGrantType as TokenRequestRequestGrantType, enums_TokenRevokeRequestTokenTypeHint as TokenRevokeRequestTokenTypeHint }; } /** * Request body for POST /api/oauth/authorize User approves or denies device * code in browser. * * Request model (no read-only fields). */ interface DeviceAuthorizeRequest$1 { /** User code to authorize (e.g., ABC-XYZ) */ user_code: string; /** User decision: approve or deny * `approve` - approve * `deny` - deny */ action: DeviceAuthorizeRequestAction; /** Workspace ID to grant access to (required for approve) */ workspace_id?: string | null; } /** * Response body for POST /api/oauth/device Returns device code info for CLI to * display to user. * * Response model (includes read-only fields). */ interface DeviceCodeResponse$1 { /** Device code for polling (not shown to user) */ device_code: string; /** Human-readable code to show user (e.g., ABC-XYZ) */ user_code: string; /** URL where user authorizes (e.g., https://cmdop.com/device) */ verification_uri: string; /** Seconds until device code expires (typically 900) */ expires_in: number; /** Polling interval in seconds (typically 5) */ interval: number; } /** * Error response for POST /api/oauth/token OAuth 2.0 standard error format. * * Response model (includes read-only fields). */ interface TokenError$1 { /** OAuth error code * `authorization_pending` - authorization_pending * `slow_down` - slow_down * `access_denied` - access_denied * `expired_token` - expired_token * `invalid_grant` - invalid_grant */ error: TokenErrorError; /** Human-readable error description */ error_description?: string; } /** * Response for GET /api/oauth/token/info Returns information about current * token. * * Response model (includes read-only fields). */ interface TokenInfo$1 { id: string; /** First 12 characters for identification */ access_token_prefix: string; workspace_id: string; workspace_name: string; user_id: string; username: string; client_name?: string; client_version?: string; client_hostname?: string; /** OS platform: darwin, linux, windows */ client_platform?: string; created_at: string; access_token_expires_at: string; refresh_token_expires_at: string; /** Last time access token was used */ last_used_at?: string | null; is_expired: string; is_refresh_expired: string; } /** * Request body for POST /api/oauth/device Client sends metadata about itself. * * Request model (no read-only fields). */ interface DeviceCodeRequestRequest$1 { /** Client application name */ client_name?: string; /** Client version (e.g., 1.0.0) */ client_version?: string; /** Client machine hostname */ client_hostname?: string; /** OS platform: darwin, linux, windows */ client_platform?: string; } /** * Response body for POST /api/oauth/token Returns access token and refresh * token. * * Response model (includes read-only fields). */ interface TokenResponse$1 { /** Access token (cmdop_...) */ access_token: string; /** Refresh token (clitr_...) */ refresh_token: string; /** Token type (always Bearer) */ token_type?: string; /** Access token expiry in seconds */ expires_in: number; /** Token scope */ scope?: string; /** Workspace ID */ workspace_id: string; /** Workspace name */ workspace_name: string; /** User ID */ user_id: string; /** User email (optional) */ user_email?: string; } /** * Request body for POST /api/oauth/token CLI polls with device_code until * approved. * * Request model (no read-only fields). */ interface TokenRequestRequest$1 { /** OAuth grant type * `urn:ietf:params:oauth:grant-type:device_code` - Device Code Flow * `refresh_token` - Refresh Token */ grant_type: TokenRequestRequestGrantType; /** Device code from initial request (for device flow) */ device_code?: string; /** Refresh token (for token refresh) */ refresh_token?: string; } /** * * Response model (includes read-only fields). */ interface PaginatedTokenListList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * Response for device authorization. * * Response model (includes read-only fields). */ interface DeviceAuthorizeResponse$1 { success: boolean; message: string; user_code: string; status: string; } /** * Request body for POST /api/oauth/revoke Revoke access token or refresh * token. * * Request model (no read-only fields). */ interface TokenRevokeRequest$1 { /** Token to revoke (access or refresh) */ token: string; /** Hint about token type (optional) * `access_token` - access_token * `refresh_token` - refresh_token */ token_type_hint?: TokenRevokeRequestTokenTypeHint; } /** * Serializer for listing user's CLI tokens. * * Response model (includes read-only fields). */ interface TokenList$1 { id: string; /** First 12 characters for identification */ access_token_prefix: string; workspace_name: string; client_name?: string; client_hostname?: string; /** OS platform: darwin, linux, windows */ client_platform?: string; created_at: string; /** Last time access token was used */ last_used_at?: string | null; revoked_at?: string | null; is_active: string; } declare namespace models$1 { export type { DeviceAuthorizeRequest$1 as DeviceAuthorizeRequest, DeviceAuthorizeResponse$1 as DeviceAuthorizeResponse, DeviceCodeRequestRequest$1 as DeviceCodeRequestRequest, DeviceCodeResponse$1 as DeviceCodeResponse, PaginatedTokenListList$1 as PaginatedTokenListList, TokenError$1 as TokenError, TokenInfo$1 as TokenInfo, TokenList$1 as TokenList, TokenRequestRequest$1 as TokenRequestRequest, TokenResponse$1 as TokenResponse, TokenRevokeRequest$1 as TokenRevokeRequest }; } /** * API endpoints for Oauth. */ declare class SystemOauth { private client; constructor(client: any); /** * Authorize device * * User approves or denies device code in browser (requires * authentication). */ systemOauthAuthorizeCreate(data: DeviceAuthorizeRequest$1): Promise; /** * Request device code * * CLI initiates OAuth flow by requesting a device code and user code. */ systemOauthDeviceCreate(data: DeviceCodeRequestRequest$1): Promise; /** * Revoke token * * Revoke access token or refresh token. */ systemOauthRevokeCreate(data: TokenRevokeRequest$1): Promise; /** * Request access token * * CLI polls for token (device flow) or refreshes expired token. */ systemOauthTokenCreate(data: TokenRequestRequest$1): Promise; /** * Get token info * * Get information about current access token (requires authentication). */ systemOauthTokenInfoRetrieve(): Promise; systemOauthTokensList(ordering?: string, page?: number, page_size?: number, search?: string): Promise; systemOauthTokensList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }): Promise; } /** * Serializer for Alert model. * * Request model (no read-only fields). */ interface PatchedAlertRequest$1 { workspace?: string; /** * `machine_offline` - Machine Offline * `task_failed` - Task Failed * `schedule_error` - Schedule Error */ type?: AlertType; title?: string; message?: string; machine?: string | null; read?: boolean; } /** * * Response model (includes read-only fields). */ interface PaginatedApiKeyList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * Read-only serializer for ApiKey (hides actual key). * * Response model (includes read-only fields). */ interface ApiKey$1 { id: string; workspace: string; workspace_name: string; /** Descriptive name for this API key */ name: string; /** First 12 characters for display */ key_prefix: string; last_used?: string | null; created_by?: number | null; created_by_email: string; created_at: string; } /** * Serializer for creating alerts. * * Request model (no read-only fields). */ interface AlertCreateRequest$1 { workspace: string; /** * `machine_offline` - Machine Offline * `task_failed` - Task Failed * `schedule_error` - Schedule Error */ type: AlertType; title: string; message: string; machine?: string | null; } /** * Serializer for Alert model. * * Request model (no read-only fields). */ interface AlertRequest$1 { workspace: string; /** * `machine_offline` - Machine Offline * `task_failed` - Task Failed * `schedule_error` - Schedule Error */ type: AlertType; title: string; message: string; machine?: string | null; read?: boolean; } /** * Serializer for Alert model. * * Response model (includes read-only fields). */ interface Alert$1 { id: string; workspace: string; /** * `machine_offline` - Machine Offline * `task_failed` - Task Failed * `schedule_error` - Schedule Error */ type: AlertType; title: string; message: string; machine?: string | null; /** Get machine name. */ machine_name?: string | null; read?: boolean; is_unread: boolean; created_at: string; } /** * Serializer for creating alerts. * * Response model (includes read-only fields). */ interface AlertCreate$1 { workspace: string; /** * `machine_offline` - Machine Offline * `task_failed` - Task Failed * `schedule_error` - Schedule Error */ type: AlertType; title: string; message: string; machine?: string | null; } /** * Response serializer that includes raw key (shown only once). * * Response model (includes read-only fields). */ interface ApiKeyResponse$1 { id: string; workspace: string; /** Descriptive name for this API key */ name: string; /** First 12 characters for display */ key_prefix: string; raw_key: string; created_by?: number | null; created_by_email: string; created_at: string; } /** * * Response model (includes read-only fields). */ interface PaginatedAlertList$1 { /** Total number of items across all pages */ count: number; /** Current page number (1-based) */ page: number; /** Total number of pages */ pages: number; /** Number of items per page */ page_size: number; /** Whether there is a next page */ has_next: boolean; /** Whether there is a previous page */ has_previous: boolean; /** Next page number (null if no next page) */ next_page?: number | null; /** Previous page number (null if no previous page) */ previous_page?: number | null; /** Array of items for current page */ results: Array; } /** * Serializer for creating new API key. * * Request model (no read-only fields). */ interface ApiKeyCreateRequest$1 { /** Descriptive name for this API key */ name: string; /** Workspace ID */ workspace: string; } declare namespace models { export type { Alert$1 as Alert, AlertCreate$1 as AlertCreate, AlertCreateRequest$1 as AlertCreateRequest, AlertRequest$1 as AlertRequest, ApiKey$1 as ApiKey, ApiKeyCreateRequest$1 as ApiKeyCreateRequest, ApiKeyResponse$1 as ApiKeyResponse, PaginatedAlertList$1 as PaginatedAlertList, PaginatedApiKeyList$1 as PaginatedApiKeyList, PatchedAlertRequest$1 as PatchedAlertRequest }; } /** * API endpoints for System. */ declare class SystemSystem { private client; constructor(client: any); alertsList(ordering?: string, page?: number, page_size?: number, read?: boolean, search?: string, type?: string, workspace?: string): Promise; alertsList(params?: { ordering?: string; page?: number; page_size?: number; read?: boolean; search?: string; type?: string; workspace?: string; }): Promise; /** * ViewSet for Alert operations. System notifications for important events. */ alertsCreate(data: AlertCreateRequest$1): Promise; /** * ViewSet for Alert operations. System notifications for important events. */ alertsRetrieve(id: string): Promise; /** * ViewSet for Alert operations. System notifications for important events. */ alertsUpdate(id: string, data: AlertRequest$1): Promise; /** * ViewSet for Alert operations. System notifications for important events. */ alertsPartialUpdate(id: string, data?: PatchedAlertRequest$1): Promise; /** * ViewSet for Alert operations. System notifications for important events. */ alertsDestroy(id: string): Promise; /** * Mark alert as read */ alertsMarkAsReadCreate(id: string): Promise; /** * Mark all unread alerts as read for current workspace */ alertsMarkAllAsReadCreate(): Promise; apiKeysList(ordering?: string, page?: number, page_size?: number, search?: string, workspace?: string): Promise; apiKeysList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; workspace?: string; }): Promise; /** * Create new API key (raw key shown only once). */ apiKeysCreate(data: ApiKeyCreateRequest$1): Promise; /** * ViewSet for ApiKey operations. Manage API keys for workspace * integrations. Note: Raw key is only shown once during creation. */ apiKeysRetrieve(id: string): Promise; /** * ViewSet for ApiKey operations. Manage API keys for workspace * integrations. Note: Raw key is only shown once during creation. */ apiKeysUpdate(id: string): Promise; /** * ViewSet for ApiKey operations. Manage API keys for workspace * integrations. Note: Raw key is only shown once during creation. */ apiKeysPartialUpdate(id: string): Promise; /** * ViewSet for ApiKey operations. Manage API keys for workspace * integrations. Note: Raw key is only shown once during creation. */ apiKeysDestroy(id: string): Promise; /** * Regenerate API key (deletes old key and creates new one) */ apiKeysRegenerateCreate(id: string): Promise; } /** * HTTP Client Adapter Pattern * * Allows switching between fetch/axios/httpx without changing generated code. * Provides unified interface for making HTTP requests. */ interface HttpRequest { method: string; url: string; headers?: Record; body?: any; params?: Record; /** FormData for file uploads (multipart/form-data) */ formData?: FormData; /** Binary data for octet-stream uploads */ binaryBody?: Blob | ArrayBuffer; } interface HttpResponse { data: T; status: number; statusText: string; headers: Record; } /** * HTTP Client Adapter Interface. * Implement this to use custom HTTP clients (axios, httpx, etc.) */ interface HttpClientAdapter$1 { request(request: HttpRequest): Promise>; } /** * Default Fetch API adapter. * Uses native browser fetch() with proper error handling. */ declare class FetchAdapter implements HttpClientAdapter$1 { request(request: HttpRequest): Promise>; } /** * FetchAdapter with keepalive:true. * * Use this adapter when you need requests to survive page unload * (visibilitychange / beforeunload) — the browser will complete the request * even after the page is navigated away. Typical use: monitor / analytics flush. * * @example * ```typescript * import { APIClient, KeepAliveFetchAdapter } from './client'; * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() }); * ``` */ declare class KeepAliveFetchAdapter extends FetchAdapter { request(request: HttpRequest): Promise>; } /** * API Logger with Consola * Beautiful console logging for API requests and responses * * Installation: * npm install consola */ /** * Request log data */ interface RequestLog { method: string; url: string; headers?: Record; body?: any; timestamp: number; } /** * Response log data */ interface ResponseLog { status: number; statusText: string; data?: any; duration: number; timestamp: number; } /** * Error log data */ interface ErrorLog { message: string; statusCode?: number; fieldErrors?: Record; duration: number; timestamp: number; } /** * Logger configuration */ interface LoggerConfig { /** Enable logging */ enabled: boolean; /** Log requests */ logRequests: boolean; /** Log responses */ logResponses: boolean; /** Log errors */ logErrors: boolean; /** Log request/response bodies */ logBodies: boolean; /** Log headers (excluding sensitive ones) */ logHeaders: boolean; /** Custom consola instance */ consola?: ConsolaInstance; } /** * API Logger class */ declare class APILogger { private config; private consola; constructor(config?: Partial); /** * Enable logging */ enable(): void; /** * Disable logging */ disable(): void; /** * Update configuration */ setConfig(config: Partial): void; /** * Filter sensitive headers */ private filterHeaders; /** * Log request */ logRequest(request: RequestLog): void; /** * Log response */ logResponse(request: RequestLog, response: ResponseLog): void; /** * Log error */ logError(request: RequestLog, error: ErrorLog): void; /** * Log general info */ info(message: string, ...args: any[]): void; /** * Log warning */ warn(message: string, ...args: any[]): void; /** * Log error */ error(message: string, ...args: any[]): void; /** * Log debug */ debug(message: string, ...args: any[]): void; /** * Log success */ success(message: string, ...args: any[]): void; /** * Create a sub-logger with prefix */ withTag(tag: string): ConsolaInstance; } /** * Retry Configuration and Utilities * * Provides automatic retry logic for failed HTTP requests using p-retry. * Retries only on network errors and server errors (5xx), not client errors (4xx). */ /** * Information about a failed retry attempt. */ interface FailedAttemptInfo { /** The error that caused the failure */ error: Error; /** The attempt number (1-indexed) */ attemptNumber: number; /** Number of retries left */ retriesLeft: number; } /** * Retry configuration options. * * Uses exponential backoff with jitter by default to avoid thundering herd. */ interface RetryConfig { /** * Maximum number of retry attempts. * @default 3 */ retries?: number; /** * Exponential backoff factor. * @default 2 */ factor?: number; /** * Minimum wait time between retries (ms). * @default 1000 */ minTimeout?: number; /** * Maximum wait time between retries (ms). * @default 60000 */ maxTimeout?: number; /** * Add randomness to wait times (jitter). * Helps avoid thundering herd problem. * @default true */ randomize?: boolean; /** * Callback called on each failed attempt. */ onFailedAttempt?: (info: FailedAttemptInfo) => void; } /** * Default retry configuration. */ declare const DEFAULT_RETRY_CONFIG: Required; /** * Determine if an error should trigger a retry. * * Retries on: * - Network errors (connection refused, timeout, etc.) * - Server errors (5xx status codes) * - Rate limiting (429 status code) * * Does NOT retry on: * - Client errors (4xx except 429) * - Authentication errors (401, 403) * - Not found (404) * * @param error - The error to check * @returns true if should retry, false otherwise */ declare function shouldRetry(error: any): boolean; /** * Wrap a function with retry logic. * * @param fn - Async function to retry * @param config - Retry configuration * @returns Result of the function * * @example * ```typescript * const result = await withRetry( * async () => fetch('https://api.example.com/users'), * { retries: 5, minTimeout: 2000 } * ); * ``` */ declare function withRetry(fn: () => Promise, config?: RetryConfig): Promise; /** * Async API client for Cmdop API. * * Usage: * ```typescript * const client = new APIClient('https://api.example.com'); * const users = await client.users.list(); * const post = await client.posts.create(newPost); * * // Custom HTTP adapter (e.g., Axios) * const client = new APIClient('https://api.example.com', { * httpClient: new AxiosAdapter() * }); * ``` */ declare class APIClient { private baseUrl; private httpClient; private logger; private retryConfig; private tokenGetter; system_oauth: SystemOauth; system_system: SystemSystem; constructor(baseUrl: string, options?: { httpClient?: HttpClientAdapter$1; loggerConfig?: Partial; retryConfig?: RetryConfig; tokenGetter?: () => string | null; }); /** * Get CSRF token from cookies (for SessionAuthentication). * * Returns null if cookie doesn't exist (JWT-only auth). */ getCsrfToken(): string | null; /** * Get the base URL for building streaming/download URLs. */ getBaseUrl(): string; /** * Get JWT token for URL authentication (used in streaming endpoints). * Returns null if no token getter is configured or no token is available. */ getToken(): string | null; /** * Make HTTP request with Django CSRF and session handling. * Automatically retries on network errors and 5xx server errors. */ request(method: string, path: string, options?: { params?: Record; body?: any; formData?: FormData; binaryBody?: Blob | ArrayBuffer; headers?: Record; }): Promise; /** * Internal request method (without retry wrapper). * Used by request() method with optional retry logic. */ private _makeRequest; } /** * Storage adapters for cross-platform token storage. * * Supports: * - LocalStorage (browser) * - Cookies (SSR/browser) * - Memory (Node.js/Electron/testing) */ /** * Storage adapter interface for cross-platform token storage. */ interface StorageAdapter { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * LocalStorage adapter with safe try-catch for browser environments. * Works in modern browsers with localStorage support. * * Note: This adapter uses window.localStorage and should only be used in browser/client environments. * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead. */ declare class LocalStorageAdapter implements StorageAdapter { private logger?; constructor(logger?: APILogger); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * Cookie-based storage adapter for SSR and browser environments. * Useful for Next.js, Nuxt.js, and other SSR frameworks. */ declare class CookieStorageAdapter implements StorageAdapter { private logger?; constructor(logger?: APILogger); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * In-memory storage adapter for Node.js, Electron, and testing environments. * Data is stored in RAM and cleared when process exits. */ declare class MemoryStorageAdapter implements StorageAdapter { private storage; private logger?; constructor(logger?: APILogger); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * Zod schema for Alert * * This schema provides runtime validation and type inference. * * Serializer for Alert model. * */ /** * Serializer for Alert model. */ declare const AlertSchema: z.ZodObject<{ id: z.ZodString; workspace: z.ZodString; type: z.ZodEnum; title: z.ZodString; message: z.ZodString; machine: z.ZodOptional>; machine_name: z.ZodNullable; read: z.ZodOptional; is_unread: z.ZodBoolean; created_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type Alert = z.infer; /** * Zod schema for AlertCreate * * This schema provides runtime validation and type inference. * * Serializer for creating alerts. * */ /** * Serializer for creating alerts. */ declare const AlertCreateSchema: z.ZodObject<{ workspace: z.ZodString; type: z.ZodEnum; title: z.ZodString; message: z.ZodString; machine: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type AlertCreate = z.infer; /** * Zod schema for AlertCreateRequest * * This schema provides runtime validation and type inference. * * Serializer for creating alerts. * */ /** * Serializer for creating alerts. */ declare const AlertCreateRequestSchema: z.ZodObject<{ workspace: z.ZodString; type: z.ZodEnum; title: z.ZodString; message: z.ZodString; machine: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type AlertCreateRequest = z.infer; /** * Zod schema for AlertRequest * * This schema provides runtime validation and type inference. * * Serializer for Alert model. * */ /** * Serializer for Alert model. */ declare const AlertRequestSchema: z.ZodObject<{ workspace: z.ZodString; type: z.ZodEnum; title: z.ZodString; message: z.ZodString; machine: z.ZodOptional>; read: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type AlertRequest = z.infer; /** * Zod schema for ApiKey * * This schema provides runtime validation and type inference. * * Read-only serializer for ApiKey (hides actual key). * */ /** * Read-only serializer for ApiKey (hides actual key). */ declare const ApiKeySchema: z.ZodObject<{ id: z.ZodString; workspace: z.ZodString; workspace_name: z.ZodString; name: z.ZodString; key_prefix: z.ZodString; last_used: z.ZodNullable; created_by: z.ZodNullable; created_by_email: z.ZodString; created_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type ApiKey = z.infer; /** * Zod schema for ApiKeyCreateRequest * * This schema provides runtime validation and type inference. * * Serializer for creating new API key. * */ /** * Serializer for creating new API key. */ declare const ApiKeyCreateRequestSchema: z.ZodObject<{ name: z.ZodString; workspace: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type ApiKeyCreateRequest = z.infer; /** * Zod schema for ApiKeyResponse * * This schema provides runtime validation and type inference. * * Response serializer that includes raw key (shown only once). * */ /** * Response serializer that includes raw key (shown only once). */ declare const ApiKeyResponseSchema: z.ZodObject<{ id: z.ZodString; workspace: z.ZodString; name: z.ZodString; key_prefix: z.ZodString; raw_key: z.ZodString; created_by: z.ZodNullable; created_by_email: z.ZodString; created_at: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type ApiKeyResponse = z.infer; /** * Zod schema for DeviceAuthorizeRequest * * This schema provides runtime validation and type inference. * * Request body for POST /api/oauth/authorize User approves or denies device code in browser. * */ /** * Request body for POST /api/oauth/authorize User approves or denies device code in browser. */ declare const DeviceAuthorizeRequestSchema: z.ZodObject<{ user_code: z.ZodString; action: z.ZodEnum; workspace_id: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type DeviceAuthorizeRequest = z.infer; /** * Zod schema for DeviceAuthorizeResponse * * This schema provides runtime validation and type inference. * * Response for device authorization. * */ /** * Response for device authorization. */ declare const DeviceAuthorizeResponseSchema: z.ZodObject<{ success: z.ZodBoolean; message: z.ZodString; user_code: z.ZodString; status: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type DeviceAuthorizeResponse = z.infer; /** * Zod schema for DeviceCodeRequestRequest * * This schema provides runtime validation and type inference. * * Request body for POST /api/oauth/device Client sends metadata about itself. * */ /** * Request body for POST /api/oauth/device Client sends metadata about itself. */ declare const DeviceCodeRequestRequestSchema: z.ZodObject<{ client_name: z.ZodOptional; client_version: z.ZodOptional; client_hostname: z.ZodOptional; client_platform: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type DeviceCodeRequestRequest = z.infer; /** * Zod schema for DeviceCodeResponse * * This schema provides runtime validation and type inference. * * Response body for POST /api/oauth/device Returns device code info for CLI to display to user. * */ /** * Response body for POST /api/oauth/device Returns device code info for CLI to display to user. */ declare const DeviceCodeResponseSchema: z.ZodObject<{ device_code: z.ZodString; user_code: z.ZodString; verification_uri: z.ZodString; expires_in: z.ZodNumber; interval: z.ZodNumber; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type DeviceCodeResponse = z.infer; declare const PaginatedAlertListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray; title: z.ZodString; message: z.ZodString; machine: z.ZodOptional>; machine_name: z.ZodNullable; read: z.ZodOptional; is_unread: z.ZodBoolean; created_at: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedAlertList = z.infer; /** * Zod schema for PaginatedApiKeyList * * This schema provides runtime validation and type inference. * */ declare const PaginatedApiKeyListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray; created_by: z.ZodNullable; created_by_email: z.ZodString; created_at: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedApiKeyList = z.infer; /** * Zod schema for PaginatedTokenListList * * This schema provides runtime validation and type inference. * */ declare const PaginatedTokenListListSchema: z.ZodObject<{ count: z.ZodNumber; page: z.ZodNumber; pages: z.ZodNumber; page_size: z.ZodNumber; has_next: z.ZodBoolean; has_previous: z.ZodBoolean; next_page: z.ZodOptional>; previous_page: z.ZodOptional>; results: z.ZodArray; client_hostname: z.ZodOptional; client_platform: z.ZodOptional; created_at: z.ZodString; last_used_at: z.ZodOptional>; revoked_at: z.ZodOptional>; is_active: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PaginatedTokenListList = z.infer; /** * Zod schema for PatchedAlertRequest * * This schema provides runtime validation and type inference. * * Serializer for Alert model. * */ /** * Serializer for Alert model. */ declare const PatchedAlertRequestSchema: z.ZodObject<{ workspace: z.ZodOptional; type: z.ZodOptional>; title: z.ZodOptional; message: z.ZodOptional; machine: z.ZodOptional>; read: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type PatchedAlertRequest = z.infer; /** * Zod schema for TokenError * * This schema provides runtime validation and type inference. * * Error response for POST /api/oauth/token OAuth 2.0 standard error format. * */ /** * Error response for POST /api/oauth/token OAuth 2.0 standard error format. */ declare const TokenErrorSchema: z.ZodObject<{ error: z.ZodEnum; error_description: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type TokenError = z.infer; /** * Zod schema for TokenInfo * * This schema provides runtime validation and type inference. * * Response for GET /api/oauth/token/info Returns information about current token. * */ /** * Response for GET /api/oauth/token/info Returns information about current token. */ declare const TokenInfoSchema: z.ZodObject<{ id: z.ZodString; access_token_prefix: z.ZodString; workspace_id: z.ZodString; workspace_name: z.ZodString; user_id: z.ZodString; username: z.ZodString; client_name: z.ZodOptional; client_version: z.ZodOptional; client_hostname: z.ZodOptional; client_platform: z.ZodOptional; created_at: z.ZodString; access_token_expires_at: z.ZodString; refresh_token_expires_at: z.ZodString; last_used_at: z.ZodOptional>; is_expired: z.ZodString; is_refresh_expired: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type TokenInfo = z.infer; /** * Zod schema for TokenList * * This schema provides runtime validation and type inference. * * Serializer for listing user's CLI tokens. * */ /** * Serializer for listing user's CLI tokens. */ declare const TokenListSchema: z.ZodObject<{ id: z.ZodString; access_token_prefix: z.ZodString; workspace_name: z.ZodString; client_name: z.ZodOptional; client_hostname: z.ZodOptional; client_platform: z.ZodOptional; created_at: z.ZodString; last_used_at: z.ZodOptional>; revoked_at: z.ZodOptional>; is_active: z.ZodString; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type TokenList = z.infer; /** * Zod schema for TokenRequestRequest * * This schema provides runtime validation and type inference. * * Request body for POST /api/oauth/token CLI polls with device_code until approved. * */ /** * Request body for POST /api/oauth/token CLI polls with device_code until approved. */ declare const TokenRequestRequestSchema: z.ZodObject<{ grant_type: z.ZodEnum; device_code: z.ZodOptional; refresh_token: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type TokenRequestRequest = z.infer; /** * Zod schema for TokenResponse * * This schema provides runtime validation and type inference. * * Response body for POST /api/oauth/token Returns access token and refresh token. * */ /** * Response body for POST /api/oauth/token Returns access token and refresh token. */ declare const TokenResponseSchema: z.ZodObject<{ access_token: z.ZodString; refresh_token: z.ZodString; token_type: z.ZodOptional; expires_in: z.ZodNumber; scope: z.ZodOptional; workspace_id: z.ZodString; workspace_name: z.ZodString; user_id: z.ZodString; user_email: z.ZodOptional; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type TokenResponse = z.infer; /** * Zod schema for TokenRevokeRequest * * This schema provides runtime validation and type inference. * * Request body for POST /api/oauth/revoke Revoke access token or refresh token. * */ /** * Request body for POST /api/oauth/revoke Revoke access token or refresh token. */ declare const TokenRevokeRequestSchema: z.ZodObject<{ token: z.ZodString; token_type_hint: z.ZodOptional>; }, z.core.$strip>; /** * Infer TypeScript type from Zod schema */ type TokenRevokeRequest = z.infer; /** * Zod Schemas - Runtime validation and type inference * * Auto-generated from OpenAPI specification. * Provides runtime validation for API requests and responses. * * Usage: * ```typescript * import { UserSchema } from './schemas' * * // Validate data * const user = UserSchema.parse(data) * * // Type inference * type User = z.infer * ``` */ type index$2_Alert = Alert; type index$2_AlertCreate = AlertCreate; type index$2_AlertCreateRequest = AlertCreateRequest; declare const index$2_AlertCreateRequestSchema: typeof AlertCreateRequestSchema; declare const index$2_AlertCreateSchema: typeof AlertCreateSchema; type index$2_AlertRequest = AlertRequest; declare const index$2_AlertRequestSchema: typeof AlertRequestSchema; declare const index$2_AlertSchema: typeof AlertSchema; type index$2_ApiKey = ApiKey; type index$2_ApiKeyCreateRequest = ApiKeyCreateRequest; declare const index$2_ApiKeyCreateRequestSchema: typeof ApiKeyCreateRequestSchema; type index$2_ApiKeyResponse = ApiKeyResponse; declare const index$2_ApiKeyResponseSchema: typeof ApiKeyResponseSchema; declare const index$2_ApiKeySchema: typeof ApiKeySchema; type index$2_DeviceAuthorizeRequest = DeviceAuthorizeRequest; declare const index$2_DeviceAuthorizeRequestSchema: typeof DeviceAuthorizeRequestSchema; type index$2_DeviceAuthorizeResponse = DeviceAuthorizeResponse; declare const index$2_DeviceAuthorizeResponseSchema: typeof DeviceAuthorizeResponseSchema; type index$2_DeviceCodeRequestRequest = DeviceCodeRequestRequest; declare const index$2_DeviceCodeRequestRequestSchema: typeof DeviceCodeRequestRequestSchema; type index$2_DeviceCodeResponse = DeviceCodeResponse; declare const index$2_DeviceCodeResponseSchema: typeof DeviceCodeResponseSchema; type index$2_PaginatedAlertList = PaginatedAlertList; declare const index$2_PaginatedAlertListSchema: typeof PaginatedAlertListSchema; type index$2_PaginatedApiKeyList = PaginatedApiKeyList; declare const index$2_PaginatedApiKeyListSchema: typeof PaginatedApiKeyListSchema; type index$2_PaginatedTokenListList = PaginatedTokenListList; declare const index$2_PaginatedTokenListListSchema: typeof PaginatedTokenListListSchema; type index$2_PatchedAlertRequest = PatchedAlertRequest; declare const index$2_PatchedAlertRequestSchema: typeof PatchedAlertRequestSchema; type index$2_TokenError = TokenError; declare const index$2_TokenErrorSchema: typeof TokenErrorSchema; type index$2_TokenInfo = TokenInfo; declare const index$2_TokenInfoSchema: typeof TokenInfoSchema; type index$2_TokenList = TokenList; declare const index$2_TokenListSchema: typeof TokenListSchema; type index$2_TokenRequestRequest = TokenRequestRequest; declare const index$2_TokenRequestRequestSchema: typeof TokenRequestRequestSchema; type index$2_TokenResponse = TokenResponse; declare const index$2_TokenResponseSchema: typeof TokenResponseSchema; type index$2_TokenRevokeRequest = TokenRevokeRequest; declare const index$2_TokenRevokeRequestSchema: typeof TokenRevokeRequestSchema; declare namespace index$2 { export { type index$2_Alert as Alert, type index$2_AlertCreate as AlertCreate, type index$2_AlertCreateRequest as AlertCreateRequest, index$2_AlertCreateRequestSchema as AlertCreateRequestSchema, index$2_AlertCreateSchema as AlertCreateSchema, type index$2_AlertRequest as AlertRequest, index$2_AlertRequestSchema as AlertRequestSchema, index$2_AlertSchema as AlertSchema, type index$2_ApiKey as ApiKey, type index$2_ApiKeyCreateRequest as ApiKeyCreateRequest, index$2_ApiKeyCreateRequestSchema as ApiKeyCreateRequestSchema, type index$2_ApiKeyResponse as ApiKeyResponse, index$2_ApiKeyResponseSchema as ApiKeyResponseSchema, index$2_ApiKeySchema as ApiKeySchema, type index$2_DeviceAuthorizeRequest as DeviceAuthorizeRequest, index$2_DeviceAuthorizeRequestSchema as DeviceAuthorizeRequestSchema, type index$2_DeviceAuthorizeResponse as DeviceAuthorizeResponse, index$2_DeviceAuthorizeResponseSchema as DeviceAuthorizeResponseSchema, type index$2_DeviceCodeRequestRequest as DeviceCodeRequestRequest, index$2_DeviceCodeRequestRequestSchema as DeviceCodeRequestRequestSchema, type index$2_DeviceCodeResponse as DeviceCodeResponse, index$2_DeviceCodeResponseSchema as DeviceCodeResponseSchema, type index$2_PaginatedAlertList as PaginatedAlertList, index$2_PaginatedAlertListSchema as PaginatedAlertListSchema, type index$2_PaginatedApiKeyList as PaginatedApiKeyList, index$2_PaginatedApiKeyListSchema as PaginatedApiKeyListSchema, type index$2_PaginatedTokenListList as PaginatedTokenListList, index$2_PaginatedTokenListListSchema as PaginatedTokenListListSchema, type index$2_PatchedAlertRequest as PatchedAlertRequest, index$2_PatchedAlertRequestSchema as PatchedAlertRequestSchema, type index$2_TokenError as TokenError, index$2_TokenErrorSchema as TokenErrorSchema, type index$2_TokenInfo as TokenInfo, index$2_TokenInfoSchema as TokenInfoSchema, type index$2_TokenList as TokenList, index$2_TokenListSchema as TokenListSchema, type index$2_TokenRequestRequest as TokenRequestRequest, index$2_TokenRequestRequestSchema as TokenRequestRequestSchema, type index$2_TokenResponse as TokenResponse, index$2_TokenResponseSchema as TokenResponseSchema, type index$2_TokenRevokeRequest as TokenRevokeRequest, index$2_TokenRevokeRequestSchema as TokenRevokeRequestSchema }; } /** * Zod Validation Events - Browser CustomEvent integration * * Dispatches browser CustomEvents when Zod validation fails, allowing * React/frontend apps to listen and handle validation errors globally. * * @example * ```typescript * // In your React app * window.addEventListener('zod-validation-error', (event) => { * const { operation, path, method, error, response } = event.detail; * console.error(`Validation failed for ${method} ${path}`, error); * // Show toast notification, log to Sentry, etc. * }); * ``` */ /** * Validation error event detail */ interface ValidationErrorDetail { /** Operation/function name that failed validation */ operation: string; /** API endpoint path */ path: string; /** HTTP method */ method: string; /** Zod validation error */ error: ZodError; /** Raw response data that failed validation */ response: any; /** Timestamp of the error */ timestamp: Date; } /** * Custom event type for Zod validation errors */ type ValidationErrorEvent = CustomEvent; /** * Dispatch a Zod validation error event. * * Only dispatches in browser environment (when window is defined). * Safe to call in Node.js/SSR - will be a no-op. * * @param detail - Validation error details */ declare function dispatchValidationError(detail: ValidationErrorDetail): void; /** * Add a global listener for Zod validation errors. * * @param callback - Function to call when validation error occurs * @returns Cleanup function to remove the listener * * @example * ```typescript * const cleanup = onValidationError(({ operation, error }) => { * toast.error(`Validation failed in ${operation}`); * logToSentry(error); * }); * * // Later, remove listener * cleanup(); * ``` */ declare function onValidationError(callback: (detail: ValidationErrorDetail) => void): () => void; /** * Format Zod error for logging/display. * * @param error - Zod validation error * @returns Formatted error message */ declare function formatZodError(error: ZodError): string; /** * Authorize device * * @method POST * @path /api/system/oauth/authorize/ */ declare function createSystemOauthAuthorizeCreate(data: DeviceAuthorizeRequest, client?: any): Promise; /** * Request device code * * @method POST * @path /api/system/oauth/device/ */ declare function createSystemOauthDeviceCreate(data: DeviceCodeRequestRequest, client?: any): Promise; /** * Revoke token * * @method POST * @path /api/system/oauth/revoke/ */ declare function createSystemOauthRevokeCreate(data: TokenRevokeRequest, client?: any): Promise; /** * Request access token * * @method POST * @path /api/system/oauth/token/ */ declare function createSystemOauthTokenCreate(data: TokenRequestRequest, client?: any): Promise; /** * Get token info * * @method GET * @path /api/system/oauth/token/info/ */ declare function getSystemOauthTokenInfoRetrieve(client?: any): Promise; /** * List user tokens * * @method GET * @path /api/system/oauth/tokens/ */ declare function getSystemOauthTokensList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; }, client?: any): Promise; /** * API operation * * @method GET * @path /api/system/alerts/ */ declare function getSystemAlertsList(params?: { ordering?: string; page?: number; page_size?: number; read?: boolean; search?: string; type?: string; workspace?: string; }, client?: any): Promise; /** * API operation * * @method POST * @path /api/system/alerts/ */ declare function createSystemAlertsCreate(data: AlertCreateRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/system/alerts/{id}/ */ declare function getSystemAlertsRetrieve(id: string, client?: any): Promise; /** * API operation * * @method PUT * @path /api/system/alerts/{id}/ */ declare function updateSystemAlertsUpdate(id: string, data: AlertRequest, client?: any): Promise; /** * API operation * * @method PATCH * @path /api/system/alerts/{id}/ */ declare function partialUpdateSystemAlertsPartialUpdate(id: string, data?: PatchedAlertRequest, client?: any): Promise; /** * API operation * * @method DELETE * @path /api/system/alerts/{id}/ */ declare function deleteSystemAlertsDestroy(id: string, client?: any): Promise; /** * API operation * * @method POST * @path /api/system/alerts/{id}/mark-as-read/ */ declare function createSystemAlertsMarkAsReadCreate(id: string, client?: any): Promise; /** * API operation * * @method POST * @path /api/system/alerts/mark-all-as-read/ */ declare function createSystemAlertsMarkAllAsReadCreate(client?: any): Promise; /** * API operation * * @method GET * @path /api/system/api-keys/ */ declare function getSystemApiKeysList(params?: { ordering?: string; page?: number; page_size?: number; search?: string; workspace?: string; }, client?: any): Promise; /** * API operation * * @method POST * @path /api/system/api-keys/ */ declare function createSystemApiKeysCreate(data: ApiKeyCreateRequest, client?: any): Promise; /** * API operation * * @method GET * @path /api/system/api-keys/{id}/ */ declare function getSystemApiKeysRetrieve(id: string, client?: any): Promise; /** * API operation * * @method PUT * @path /api/system/api-keys/{id}/ */ declare function updateSystemApiKeysUpdate(id: string, client?: any): Promise; /** * API operation * * @method PATCH * @path /api/system/api-keys/{id}/ */ declare function partialUpdateSystemApiKeysPartialUpdate(id: string, client?: any): Promise; /** * API operation * * @method DELETE * @path /api/system/api-keys/{id}/ */ declare function deleteSystemApiKeysDestroy(id: string, client?: any): Promise; /** * API operation * * @method POST * @path /api/system/api-keys/{id}/regenerate/ */ declare function createSystemApiKeysRegenerateCreate(id: string, client?: any): Promise; /** * Typed Fetchers - Universal API functions * * Auto-generated from OpenAPI specification. * These functions work in any JavaScript environment. * * Features: * - Runtime validation with Zod * - Type-safe parameters and responses * - Works with any data-fetching library (SWR, React Query, etc) * - Server Component compatible * * Usage: * ```typescript * import * as fetchers from './fetchers' * * // Direct usage * const user = await fetchers.getUser(1) * * // With SWR * const { data } = useSWR('user-1', () => fetchers.getUser(1)) * * // With React Query * const { data } = useQuery(['user', 1], () => fetchers.getUser(1)) * ``` */ declare const index$1_createSystemAlertsCreate: typeof createSystemAlertsCreate; declare const index$1_createSystemAlertsMarkAllAsReadCreate: typeof createSystemAlertsMarkAllAsReadCreate; declare const index$1_createSystemAlertsMarkAsReadCreate: typeof createSystemAlertsMarkAsReadCreate; declare const index$1_createSystemApiKeysCreate: typeof createSystemApiKeysCreate; declare const index$1_createSystemApiKeysRegenerateCreate: typeof createSystemApiKeysRegenerateCreate; declare const index$1_createSystemOauthAuthorizeCreate: typeof createSystemOauthAuthorizeCreate; declare const index$1_createSystemOauthDeviceCreate: typeof createSystemOauthDeviceCreate; declare const index$1_createSystemOauthRevokeCreate: typeof createSystemOauthRevokeCreate; declare const index$1_createSystemOauthTokenCreate: typeof createSystemOauthTokenCreate; declare const index$1_deleteSystemAlertsDestroy: typeof deleteSystemAlertsDestroy; declare const index$1_deleteSystemApiKeysDestroy: typeof deleteSystemApiKeysDestroy; declare const index$1_getSystemAlertsList: typeof getSystemAlertsList; declare const index$1_getSystemAlertsRetrieve: typeof getSystemAlertsRetrieve; declare const index$1_getSystemApiKeysList: typeof getSystemApiKeysList; declare const index$1_getSystemApiKeysRetrieve: typeof getSystemApiKeysRetrieve; declare const index$1_getSystemOauthTokenInfoRetrieve: typeof getSystemOauthTokenInfoRetrieve; declare const index$1_getSystemOauthTokensList: typeof getSystemOauthTokensList; declare const index$1_partialUpdateSystemAlertsPartialUpdate: typeof partialUpdateSystemAlertsPartialUpdate; declare const index$1_partialUpdateSystemApiKeysPartialUpdate: typeof partialUpdateSystemApiKeysPartialUpdate; declare const index$1_updateSystemAlertsUpdate: typeof updateSystemAlertsUpdate; declare const index$1_updateSystemApiKeysUpdate: typeof updateSystemApiKeysUpdate; declare namespace index$1 { export { index$1_createSystemAlertsCreate as createSystemAlertsCreate, index$1_createSystemAlertsMarkAllAsReadCreate as createSystemAlertsMarkAllAsReadCreate, index$1_createSystemAlertsMarkAsReadCreate as createSystemAlertsMarkAsReadCreate, index$1_createSystemApiKeysCreate as createSystemApiKeysCreate, index$1_createSystemApiKeysRegenerateCreate as createSystemApiKeysRegenerateCreate, index$1_createSystemOauthAuthorizeCreate as createSystemOauthAuthorizeCreate, index$1_createSystemOauthDeviceCreate as createSystemOauthDeviceCreate, index$1_createSystemOauthRevokeCreate as createSystemOauthRevokeCreate, index$1_createSystemOauthTokenCreate as createSystemOauthTokenCreate, index$1_deleteSystemAlertsDestroy as deleteSystemAlertsDestroy, index$1_deleteSystemApiKeysDestroy as deleteSystemApiKeysDestroy, index$1_getSystemAlertsList as getSystemAlertsList, index$1_getSystemAlertsRetrieve as getSystemAlertsRetrieve, index$1_getSystemApiKeysList as getSystemApiKeysList, index$1_getSystemApiKeysRetrieve as getSystemApiKeysRetrieve, index$1_getSystemOauthTokenInfoRetrieve as getSystemOauthTokenInfoRetrieve, index$1_getSystemOauthTokensList as getSystemOauthTokensList, index$1_partialUpdateSystemAlertsPartialUpdate as partialUpdateSystemAlertsPartialUpdate, index$1_partialUpdateSystemApiKeysPartialUpdate as partialUpdateSystemApiKeysPartialUpdate, index$1_updateSystemAlertsUpdate as updateSystemAlertsUpdate, index$1_updateSystemApiKeysUpdate as updateSystemApiKeysUpdate }; } /** * Global API Instance - Singleton configuration with auto-configuration support * * This module provides a global API instance that auto-configures from * environment variables or can be configured manually. * * AUTO-CONFIGURATION (recommended): * Set one of these environment variables and the API will auto-configure: * - NEXT_PUBLIC_API_URL (Next.js) * - VITE_API_URL (Vite) * - REACT_APP_API_URL (Create React App) * - API_URL (generic) * * Then just use fetchers and hooks directly: * ```typescript * import { getUsers } from './_utils/fetchers' * const users = await getUsers({ page: 1 }) * ``` * * MANUAL CONFIGURATION: * ```typescript * import { configureAPI } from './api-instance' * * configureAPI({ * baseUrl: 'https://api.example.com', * token: 'your-jwt-token' * }) * ``` * * For SSR or multiple instances: * ```typescript * import { API } from './index' * import { getUsers } from './_utils/fetchers' * * const api = new API('https://api.example.com') * const users = await getUsers({ page: 1 }, api) * ``` */ /** * Get the global API instance * Auto-configures from environment variables on first call if not manually configured. * @throws Error if API is not configured and no env variable is set */ declare function getAPIInstance(): API; /** * Check if API is configured (or can be auto-configured) */ declare function isAPIConfigured(): boolean; /** * Configure the global API instance * * @param baseUrl - Base URL for the API * @param options - Optional configuration (storage, retry, logger) * * @example * ```typescript * configureAPI({ * baseUrl: 'https://api.example.com', * token: 'jwt-token', * options: { * retryConfig: { maxRetries: 3 }, * loggerConfig: { enabled: true } * } * }) * ``` */ declare function configureAPI(config: { baseUrl: string; token?: string; refreshToken?: string; options?: APIOptions; }): API; /** * Reconfigure the global API instance with new settings * Useful for updating tokens or base URL */ declare function reconfigureAPI(updates: { baseUrl?: string; token?: string; refreshToken?: string; }): API; /** * Clear tokens from the global API instance */ declare function clearAPITokens(): void; /** * Reset the global API instance * Useful for testing or logout scenarios */ declare function resetAPI(): void; /** * API Error Classes * * Typed error classes with Django REST Framework support. */ /** * HTTP API Error with DRF field-specific validation errors. * * Usage: * ```typescript * try { * await api.users.create(userData); * } catch (error) { * if (error instanceof APIError) { * if (error.isValidationError) { * console.log('Field errors:', error.fieldErrors); * // { "email": ["Email already exists"], "username": ["Required"] } * } * } * } * ``` */ declare class APIError extends Error { statusCode: number; statusText: string; response: any; url: string; constructor(statusCode: number, statusText: string, response: any, url: string, message?: string); /** * Get error details from response. * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] } */ get details(): Record | null; /** * Get field-specific validation errors from DRF. * Returns: { "field_name": ["error1", "error2"], ... } */ get fieldErrors(): Record | null; /** * Get single error message from DRF. * Checks for "detail", "message", or first field error. */ get errorMessage(): string; get isValidationError(): boolean; get isAuthError(): boolean; get isPermissionError(): boolean; get isNotFoundError(): boolean; get isServerError(): boolean; } /** * Network Error (connection failed, timeout, etc.) */ declare class NetworkError extends Error { url: string; originalError?: Error | undefined; constructor(message: string, url: string, originalError?: Error | undefined); } /** * Cmdop API - API Client with JWT Management * * Usage: * ```typescript * import { API } from './api'; * * const api = new API('https://api.example.com'); * * // Set JWT token * api.setToken('your-jwt-token', 'refresh-token'); * * // Use API * const posts = await api.posts.list(); * const user = await api.users.retrieve(1); * * // Check authentication * if (api.isAuthenticated()) { * // ... * } * * // Custom storage with logging (for Electron/Node.js) * import { MemoryStorageAdapter, APILogger } from './storage'; * const logger = new APILogger({ enabled: true, logLevel: 'debug' }); * const api = new API('https://api.example.com', { * storage: new MemoryStorageAdapter(logger), * loggerConfig: { enabled: true, logLevel: 'debug' } * }); * * // Get OpenAPI schema * const schema = api.getSchema(); * ``` */ declare const TOKEN_KEY = "auth_token"; declare const REFRESH_TOKEN_KEY = "refresh_token"; interface APIOptions { /** Custom storage adapter (defaults to LocalStorageAdapter) */ storage?: StorageAdapter; /** Custom HTTP client adapter (defaults to FetchAdapter) */ httpClient?: HttpClientAdapter; /** Retry configuration for failed requests */ retryConfig?: RetryConfig; /** Logger configuration */ loggerConfig?: Partial; /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */ locale?: string; } declare class API { private baseUrl; private _client; private _token; private _refreshToken; private _locale; private storage; private options?; system_oauth: SystemOauth; system_system: SystemSystem; constructor(baseUrl: string, options?: APIOptions); private _loadTokensFromStorage; private _reinitClients; private _injectAuthHeader; /** * Get current JWT token */ getToken(): string | null; /** * Get current refresh token */ getRefreshToken(): string | null; /** * Set JWT token and refresh token * @param token - JWT access token * @param refreshToken - JWT refresh token (optional) */ setToken(token: string, refreshToken?: string): void; /** * Clear all tokens */ clearTokens(): void; /** * Check if user is authenticated */ isAuthenticated(): boolean; /** * Update base URL and reinitialize clients * @param url - New base URL */ setBaseUrl(url: string): void; /** * Get current base URL */ getBaseUrl(): string; /** * Set locale for Accept-Language header * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear */ setLocale(locale: string | null): void; /** * Get current locale */ getLocale(): string | null; /** * Get OpenAPI schema path * @returns Path to the OpenAPI schema JSON file * * Note: The OpenAPI schema is available in the schema.json file. * You can load it dynamically using: * ```typescript * const schema = await fetch('./schema.json').then(r => r.json()); * // or using fs in Node.js: * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8')); * ``` */ getSchemaPath(): string; } type index_API = API; declare const index_API: typeof API; type index_APIClient = APIClient; declare const index_APIClient: typeof APIClient; type index_APIError = APIError; declare const index_APIError: typeof APIError; type index_APILogger = APILogger; declare const index_APILogger: typeof APILogger; type index_APIOptions = APIOptions; type index_Alert = Alert; type index_AlertCreate = AlertCreate; type index_AlertCreateRequest = AlertCreateRequest; declare const index_AlertCreateRequestSchema: typeof AlertCreateRequestSchema; declare const index_AlertCreateSchema: typeof AlertCreateSchema; type index_AlertRequest = AlertRequest; declare const index_AlertRequestSchema: typeof AlertRequestSchema; declare const index_AlertSchema: typeof AlertSchema; type index_ApiKey = ApiKey; type index_ApiKeyCreateRequest = ApiKeyCreateRequest; declare const index_ApiKeyCreateRequestSchema: typeof ApiKeyCreateRequestSchema; type index_ApiKeyResponse = ApiKeyResponse; declare const index_ApiKeyResponseSchema: typeof ApiKeyResponseSchema; declare const index_ApiKeySchema: typeof ApiKeySchema; type index_CookieStorageAdapter = CookieStorageAdapter; declare const index_CookieStorageAdapter: typeof CookieStorageAdapter; declare const index_DEFAULT_RETRY_CONFIG: typeof DEFAULT_RETRY_CONFIG; type index_DeviceAuthorizeRequest = DeviceAuthorizeRequest; declare const index_DeviceAuthorizeRequestSchema: typeof DeviceAuthorizeRequestSchema; type index_DeviceAuthorizeResponse = DeviceAuthorizeResponse; declare const index_DeviceAuthorizeResponseSchema: typeof DeviceAuthorizeResponseSchema; type index_DeviceCodeRequestRequest = DeviceCodeRequestRequest; declare const index_DeviceCodeRequestRequestSchema: typeof DeviceCodeRequestRequestSchema; type index_DeviceCodeResponse = DeviceCodeResponse; declare const index_DeviceCodeResponseSchema: typeof DeviceCodeResponseSchema; type index_ErrorLog = ErrorLog; type index_FailedAttemptInfo = FailedAttemptInfo; type index_FetchAdapter = FetchAdapter; declare const index_FetchAdapter: typeof FetchAdapter; type index_HttpRequest = HttpRequest; type index_HttpResponse = HttpResponse; type index_KeepAliveFetchAdapter = KeepAliveFetchAdapter; declare const index_KeepAliveFetchAdapter: typeof KeepAliveFetchAdapter; type index_LocalStorageAdapter = LocalStorageAdapter; declare const index_LocalStorageAdapter: typeof LocalStorageAdapter; type index_LoggerConfig = LoggerConfig; type index_MemoryStorageAdapter = MemoryStorageAdapter; declare const index_MemoryStorageAdapter: typeof MemoryStorageAdapter; type index_NetworkError = NetworkError; declare const index_NetworkError: typeof NetworkError; type index_PaginatedAlertList = PaginatedAlertList; declare const index_PaginatedAlertListSchema: typeof PaginatedAlertListSchema; type index_PaginatedApiKeyList = PaginatedApiKeyList; declare const index_PaginatedApiKeyListSchema: typeof PaginatedApiKeyListSchema; type index_PaginatedTokenListList = PaginatedTokenListList; declare const index_PaginatedTokenListListSchema: typeof PaginatedTokenListListSchema; type index_PatchedAlertRequest = PatchedAlertRequest; declare const index_PatchedAlertRequestSchema: typeof PatchedAlertRequestSchema; declare const index_REFRESH_TOKEN_KEY: typeof REFRESH_TOKEN_KEY; type index_RequestLog = RequestLog; type index_ResponseLog = ResponseLog; type index_RetryConfig = RetryConfig; type index_StorageAdapter = StorageAdapter; declare const index_TOKEN_KEY: typeof TOKEN_KEY; type index_TokenError = TokenError; declare const index_TokenErrorSchema: typeof TokenErrorSchema; type index_TokenInfo = TokenInfo; declare const index_TokenInfoSchema: typeof TokenInfoSchema; type index_TokenList = TokenList; declare const index_TokenListSchema: typeof TokenListSchema; type index_TokenRequestRequest = TokenRequestRequest; declare const index_TokenRequestRequestSchema: typeof TokenRequestRequestSchema; type index_TokenResponse = TokenResponse; declare const index_TokenResponseSchema: typeof TokenResponseSchema; type index_TokenRevokeRequest = TokenRevokeRequest; declare const index_TokenRevokeRequestSchema: typeof TokenRevokeRequestSchema; type index_ValidationErrorDetail = ValidationErrorDetail; type index_ValidationErrorEvent = ValidationErrorEvent; declare const index_clearAPITokens: typeof clearAPITokens; declare const index_configureAPI: typeof configureAPI; declare const index_createSystemAlertsCreate: typeof createSystemAlertsCreate; declare const index_createSystemAlertsMarkAllAsReadCreate: typeof createSystemAlertsMarkAllAsReadCreate; declare const index_createSystemAlertsMarkAsReadCreate: typeof createSystemAlertsMarkAsReadCreate; declare const index_createSystemApiKeysCreate: typeof createSystemApiKeysCreate; declare const index_createSystemApiKeysRegenerateCreate: typeof createSystemApiKeysRegenerateCreate; declare const index_createSystemOauthAuthorizeCreate: typeof createSystemOauthAuthorizeCreate; declare const index_createSystemOauthDeviceCreate: typeof createSystemOauthDeviceCreate; declare const index_createSystemOauthRevokeCreate: typeof createSystemOauthRevokeCreate; declare const index_createSystemOauthTokenCreate: typeof createSystemOauthTokenCreate; declare const index_deleteSystemAlertsDestroy: typeof deleteSystemAlertsDestroy; declare const index_deleteSystemApiKeysDestroy: typeof deleteSystemApiKeysDestroy; declare const index_dispatchValidationError: typeof dispatchValidationError; declare const index_formatZodError: typeof formatZodError; declare const index_getAPIInstance: typeof getAPIInstance; declare const index_getSystemAlertsList: typeof getSystemAlertsList; declare const index_getSystemAlertsRetrieve: typeof getSystemAlertsRetrieve; declare const index_getSystemApiKeysList: typeof getSystemApiKeysList; declare const index_getSystemApiKeysRetrieve: typeof getSystemApiKeysRetrieve; declare const index_getSystemOauthTokenInfoRetrieve: typeof getSystemOauthTokenInfoRetrieve; declare const index_getSystemOauthTokensList: typeof getSystemOauthTokensList; declare const index_isAPIConfigured: typeof isAPIConfigured; declare const index_onValidationError: typeof onValidationError; declare const index_partialUpdateSystemAlertsPartialUpdate: typeof partialUpdateSystemAlertsPartialUpdate; declare const index_partialUpdateSystemApiKeysPartialUpdate: typeof partialUpdateSystemApiKeysPartialUpdate; declare const index_reconfigureAPI: typeof reconfigureAPI; declare const index_resetAPI: typeof resetAPI; declare const index_shouldRetry: typeof shouldRetry; declare const index_updateSystemAlertsUpdate: typeof updateSystemAlertsUpdate; declare const index_updateSystemApiKeysUpdate: typeof updateSystemApiKeysUpdate; declare const index_withRetry: typeof withRetry; declare namespace index { export { index_API as API, index_APIClient as APIClient, index_APIError as APIError, index_APILogger as APILogger, type index_APIOptions as APIOptions, type index_Alert as Alert, type index_AlertCreate as AlertCreate, type index_AlertCreateRequest as AlertCreateRequest, index_AlertCreateRequestSchema as AlertCreateRequestSchema, index_AlertCreateSchema as AlertCreateSchema, type index_AlertRequest as AlertRequest, index_AlertRequestSchema as AlertRequestSchema, index_AlertSchema as AlertSchema, type index_ApiKey as ApiKey, type index_ApiKeyCreateRequest as ApiKeyCreateRequest, index_ApiKeyCreateRequestSchema as ApiKeyCreateRequestSchema, type index_ApiKeyResponse as ApiKeyResponse, index_ApiKeyResponseSchema as ApiKeyResponseSchema, index_ApiKeySchema as ApiKeySchema, index_CookieStorageAdapter as CookieStorageAdapter, index_DEFAULT_RETRY_CONFIG as DEFAULT_RETRY_CONFIG, type index_DeviceAuthorizeRequest as DeviceAuthorizeRequest, index_DeviceAuthorizeRequestSchema as DeviceAuthorizeRequestSchema, type index_DeviceAuthorizeResponse as DeviceAuthorizeResponse, index_DeviceAuthorizeResponseSchema as DeviceAuthorizeResponseSchema, type index_DeviceCodeRequestRequest as DeviceCodeRequestRequest, index_DeviceCodeRequestRequestSchema as DeviceCodeRequestRequestSchema, type index_DeviceCodeResponse as DeviceCodeResponse, index_DeviceCodeResponseSchema as DeviceCodeResponseSchema, enums as Enums, type index_ErrorLog as ErrorLog, type index_FailedAttemptInfo as FailedAttemptInfo, index_FetchAdapter as FetchAdapter, index$1 as Fetchers, type HttpClientAdapter$1 as HttpClientAdapter, type index_HttpRequest as HttpRequest, type index_HttpResponse as HttpResponse, index_KeepAliveFetchAdapter as KeepAliveFetchAdapter, index_LocalStorageAdapter as LocalStorageAdapter, type index_LoggerConfig as LoggerConfig, index_MemoryStorageAdapter as MemoryStorageAdapter, index_NetworkError as NetworkError, type index_PaginatedAlertList as PaginatedAlertList, index_PaginatedAlertListSchema as PaginatedAlertListSchema, type index_PaginatedApiKeyList as PaginatedApiKeyList, index_PaginatedApiKeyListSchema as PaginatedApiKeyListSchema, type index_PaginatedTokenListList as PaginatedTokenListList, index_PaginatedTokenListListSchema as PaginatedTokenListListSchema, type index_PatchedAlertRequest as PatchedAlertRequest, index_PatchedAlertRequestSchema as PatchedAlertRequestSchema, index_REFRESH_TOKEN_KEY as REFRESH_TOKEN_KEY, type index_RequestLog as RequestLog, type index_ResponseLog as ResponseLog, type index_RetryConfig as RetryConfig, index$2 as Schemas, type index_StorageAdapter as StorageAdapter, models$1 as SystemOauthTypes, models as SystemSystemTypes, index_TOKEN_KEY as TOKEN_KEY, type index_TokenError as TokenError, index_TokenErrorSchema as TokenErrorSchema, type index_TokenInfo as TokenInfo, index_TokenInfoSchema as TokenInfoSchema, type index_TokenList as TokenList, index_TokenListSchema as TokenListSchema, type index_TokenRequestRequest as TokenRequestRequest, index_TokenRequestRequestSchema as TokenRequestRequestSchema, type index_TokenResponse as TokenResponse, index_TokenResponseSchema as TokenResponseSchema, type index_TokenRevokeRequest as TokenRevokeRequest, index_TokenRevokeRequestSchema as TokenRevokeRequestSchema, type index_ValidationErrorDetail as ValidationErrorDetail, type index_ValidationErrorEvent as ValidationErrorEvent, index_clearAPITokens as clearAPITokens, index_configureAPI as configureAPI, index_createSystemAlertsCreate as createSystemAlertsCreate, index_createSystemAlertsMarkAllAsReadCreate as createSystemAlertsMarkAllAsReadCreate, index_createSystemAlertsMarkAsReadCreate as createSystemAlertsMarkAsReadCreate, index_createSystemApiKeysCreate as createSystemApiKeysCreate, index_createSystemApiKeysRegenerateCreate as createSystemApiKeysRegenerateCreate, index_createSystemOauthAuthorizeCreate as createSystemOauthAuthorizeCreate, index_createSystemOauthDeviceCreate as createSystemOauthDeviceCreate, index_createSystemOauthRevokeCreate as createSystemOauthRevokeCreate, index_createSystemOauthTokenCreate as createSystemOauthTokenCreate, API as default, index_deleteSystemAlertsDestroy as deleteSystemAlertsDestroy, index_deleteSystemApiKeysDestroy as deleteSystemApiKeysDestroy, index_dispatchValidationError as dispatchValidationError, index_formatZodError as formatZodError, index_getAPIInstance as getAPIInstance, index_getSystemAlertsList as getSystemAlertsList, index_getSystemAlertsRetrieve as getSystemAlertsRetrieve, index_getSystemApiKeysList as getSystemApiKeysList, index_getSystemApiKeysRetrieve as getSystemApiKeysRetrieve, index_getSystemOauthTokenInfoRetrieve as getSystemOauthTokenInfoRetrieve, index_getSystemOauthTokensList as getSystemOauthTokensList, index_isAPIConfigured as isAPIConfigured, index_onValidationError as onValidationError, index_partialUpdateSystemAlertsPartialUpdate as partialUpdateSystemAlertsPartialUpdate, index_partialUpdateSystemApiKeysPartialUpdate as partialUpdateSystemApiKeysPartialUpdate, index_reconfigureAPI as reconfigureAPI, index_resetAPI as resetAPI, index_shouldRetry as shouldRetry, index_updateSystemAlertsUpdate as updateSystemAlertsUpdate, index_updateSystemApiKeysUpdate as updateSystemApiKeysUpdate, index_withRetry as withRetry }; } /** * Pre-configured API clients for CMDOP SDK * * Usage: * ```typescript * import { api } from '@cmdop/core'; * * // Set auth token * api.machines.setToken('your-jwt-token'); * * // Use API * const machines = await api.machines.machines_machines.list(); * ``` */ /** * CMDOP API base URL */ declare const API_BASE_URL = "https://api.cmdop.com"; /** * Pre-configured API clients */ declare const machines: API$2; declare const workspaces: API$1; declare const system: API; /** * Combined API object for convenience */ declare const api: { readonly machines: API$2; readonly workspaces: API$1; readonly system: API; }; /** * @cmdop/core * Shared types, interfaces, and protocol definitions */ type TransportMode = 'local' | 'remote'; type SessionState = 'active' | 'closed' | 'error'; interface SessionInfo { sessionId: string; state: SessionState; shell: string; cols: number; rows: number; workingDir?: string; createdAt: Date; } interface FileInfo { name: string; path: string; isDirectory: boolean; size: number; modifiedAt: Date; permissions?: string; } interface AgentEvent { type: 'token' | 'tool_call' | 'tool_result' | 'error' | 'done'; payload: unknown; timestamp: Date; } interface CMDOPConfig { apiKey?: string; agentId?: string; server?: string; timeout?: number; } declare const DEFAULT_CONFIG: { readonly server: "grpc.cmdop.com:443"; readonly timeout: 30000; }; declare class CMDOPError extends Error { readonly code?: string | undefined; readonly cause?: Error | undefined; constructor(message: string, code?: string | undefined, cause?: Error | undefined); } declare class ConnectionError extends CMDOPError { constructor(message: string, cause?: Error); } declare class AuthenticationError extends CMDOPError { constructor(message?: string); } declare class SessionError extends CMDOPError { readonly sessionId?: string | undefined; constructor(message: string, sessionId?: string | undefined); } declare class TimeoutError extends CMDOPError { constructor(message?: string); } declare class NotFoundError extends CMDOPError { readonly resource?: string | undefined; constructor(message: string, resource?: string | undefined); } declare class PermissionError extends CMDOPError { constructor(message?: string); } declare class ResourceExhaustedError extends CMDOPError { constructor(message?: string); } declare class CancelledError extends CMDOPError { constructor(message?: string); } declare class UnavailableError extends CMDOPError { constructor(message?: string); } declare const VERSION = "0.1.0"; export { API_BASE_URL, type AgentEvent, AuthenticationError, type CMDOPConfig, CMDOPError, CancelledError, ConnectionError, DEFAULT_CONFIG, type FileInfo, index$6 as MachinesModule, NotFoundError, PermissionError, ResourceExhaustedError, SessionError, type SessionInfo, type SessionState, index as SystemModule, TimeoutError, type TransportMode, UnavailableError, VERSION, index$3 as WorkspacesModule, api, machines, system, workspaces };