/** * Spok SmartSuite TCP API client. * Implements the proprietary binary+XML socket protocol. * * Protocol: 12-byte header (version(4) + refId(4) + bodySize(4), big-endian) * followed by a UTF-8 XML body padded to a minimum of 1000 bytes. */ import { AmcomHeader, SpokResponse } from "./types"; /** Amcom API protocol version. */ export declare const API_VERSION = 2; /** Reference ID sent with each request. */ export declare const REFERENCE_ID = 0; /** Minimum body size in bytes (Amcom requires at least 1000 bytes). */ export declare const MIN_BODY_SIZE = 1000; /** Binary header size in bytes. */ export declare const HEADER_SIZE = 12; /** Default request timeout in milliseconds. */ export declare const DEFAULT_TIMEOUT = 60000; /** * Build a 12-byte binary header: version(4) + refid(4) + size(4), big-endian. */ export declare function buildHeader(bodyLength: number): Buffer; /** * Parse a 12-byte binary header. */ export declare function parseHeader(buf: Buffer): AmcomHeader; /** * Send a request to a single Spok SmartSuite TCP API host and return the parsed response. */ export declare function amcomRequest(host: string, port: number, method: string, params?: Record, useSsl?: boolean, insecure?: boolean, debug?: boolean, timeout?: number): Promise; /** * Send a request trying failover hosts on connection failure. */ export declare function amcomRequestWithFailover(hosts: string[], port: number, method: string, params?: Record, useSsl?: boolean, insecure?: boolean, debug?: boolean, timeout?: number): Promise;