UNPKG

bc-webclient-mcp

Version:

Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server

64 lines 2.06 kB
/** * Timeout Configuration * * Centralized timeout configuration for BC MCP Server operations. * Provides reasonable defaults matching current behavior while allowing * per-operation overrides. */ /** * Comprehensive timeout configuration for all BC operations. */ export interface TimeoutsConfig { /** WebSocket connection establishment timeout (ms) */ connectTimeoutMs: number; /** Generic RPC request timeout (ms) */ rpcTimeoutMs: number; /** Handler wait (event-driven) timeout (ms) */ handlerWaitTimeoutMs: number; /** Read operation timeout (ms) - for page reads, metadata fetch */ readOpTimeoutMs: number; /** Write operation timeout (ms) - typically longer than reads */ writeOpTimeoutMs: number; /** Tell Me search timeout (ms) - dialog + search + parse */ searchTimeoutMs: number; } /** * Default timeouts matching current hardcoded behavior. * These values preserve backward compatibility. */ export declare const defaultTimeouts: TimeoutsConfig; /** * Resolves final timeout configuration by merging overrides with defaults. * * Allows tools and services to override specific timeouts while * inheriting defaults for others. * * @param overrides - Partial timeout overrides * @returns Complete timeout configuration * * @example * ```ts * // Use defaults * const timeouts = resolveTimeouts(); * * // Override search timeout * const timeouts = resolveTimeouts({ searchTimeoutMs: 45_000 }); * ``` */ export declare function resolveTimeouts(overrides?: Partial<TimeoutsConfig>): TimeoutsConfig; /** * Reads timeout configuration from environment variables. * Environment variables take precedence over code defaults. * * Supported env vars: * - BC_CONNECT_TIMEOUT_MS * - BC_RPC_TIMEOUT_MS * - BC_HANDLER_WAIT_TIMEOUT_MS * - BC_READ_OP_TIMEOUT_MS * - BC_WRITE_OP_TIMEOUT_MS * - BC_SEARCH_TIMEOUT_MS * * @returns Timeout configuration from environment or defaults */ export declare function timeoutsFromEnv(): TimeoutsConfig; //# sourceMappingURL=timeouts.d.ts.map