import { Metadata, ChannelOptions, ClientDuplexStream, ClientReadableStream } from '@grpc/grpc-js'; import { GetVersionResponse, CheckHealthResponse, AllocTimestampResponse, DummyReq, DummyResponse, GetComponentStatesResponse, GrpcTimeOut, RegisterLinkResponse, CreateReplicateStreamReq, DumpMessagesReq, DumpMessagesResponse, GetReplicateInfoReq, GetReplicateInfoResponse, GetClientTelemetryReq, GetClientTelemetryResponse, PushClientCommandReq, PushClientCommandResponse, DeleteClientCommandReq, DeleteClientCommandResponse, ReplicateStreamRequest, ReplicateStreamResponse, CONNECT_STATUS, ClientConfig, RunAnalyzerRequest, RunAnalyzerResponse, ComputePhraseMatchSlopReq, ComputePhraseMatchSlopResponse, ResStatus, AddFileResourceReq, RemoveFileResourceReq, ListFileResourcesReq, ListFileResourcesResponse, ClientTelemetryManager } from '../'; import { User } from './User'; type ReplicateStream = ClientDuplexStream; type DumpStream = ClientReadableStream; export declare const LOADER_OPTIONS: { keepCase: boolean; longs: StringConstructor; enums: StringConstructor; defaults: boolean; oneofs: boolean; }; /** * A client for interacting with the Milvus server via gRPC. */ export declare class GRPCClient extends User { private _MilvusService; private _ClientTelemetryService; private telemetryClient?; private nonRetryChannelOptions; private readonly replicationStreams; private telemetryEndpointEpoch; private readonly telemetry; private telemetryDatabaseExplicit; private lifecycleGeneration; private closed; private closePromise?; private _sdkVersion; /** * Creates a new instance of MilvusClient. * @param configOrAddress The Milvus server's address or client configuration object. * @param ssl Whether to use SSL or not. * @param username The username for authentication. * @param password The password for authentication. * @param channelOptions Additional channel options for gRPC. */ constructor(configOrAddress: ClientConfig | string, ssl?: boolean, username?: string, password?: string, channelOptions?: ChannelOptions); connect(sdkVersion: string): void; /** * Initializes a global cluster connection. * Fetches topology, resolves primary endpoint, creates pool, starts refresher. */ private _initGlobalConnection; /** * Reconnects to a new primary cluster after failover. * Creates a new pool for the new primary, then drains the old pool. * @returns true if primary changed and reconnection happened, false if primary unchanged */ reconnectToPrimary(): Promise; /** * Attaches a failover handler to the channel pool for global cluster support. * When promisify encounters a gRPC UNAVAILABLE error after all retries, * this handler triggers topology refresh and pool rebuild. */ private _attachFailoverHandler; /** * Creates a pool of gRPC service clients. * @returns {Pool} - A pool of gRPC service clients. */ private createChannelPool; private createTelemetryClient; private replaceTelemetryClient; private disposeChannelPool; private sendTelemetryHeartbeat; private callTelemetry; /** Lists connected clients and optionally their aggregated telemetry metrics. */ getClientTelemetry(data?: GetClientTelemetryReq): Promise; /** Queues a telemetry command for the selected clients or database. */ pushClientCommand(data: PushClientCommandReq): Promise; /** Removes a previously queued or persistent telemetry command. */ deleteClientCommand(data: DeleteClientCommandReq): Promise; /** Returns the telemetry manager for inspection and custom command handlers. */ getTelemetry(): ClientTelemetryManager; /** * Injects client metadata into the metadata of the gRPC client. * @param metadata The metadata object of the gRPC client. * @returns The updated metadata object. */ protected metadataListener(metadata: Metadata): Metadata; /** * Sets the active database for the gRPC client. * @param data An optional object containing the name of the database to use. * @returns A Promise that resolves with a `ResStatus` object. */ use(data?: { db_name: string; }): Promise; useDatabase: (data?: { db_name: string; }) => Promise; /** * Retrieves server information from the Milvus server. * @param {string} sdkVersion - The version of the SDK being used. * @returns {Promise} - A Promise that resolves when the server information has been retrieved. */ private _getServerInfo; private applyServerInfo; /** * Closes the connection to the Milvus server. * This method drains and clears the connection pool, and updates the connection status to SHUTDOWN. * @returns {Promise} The updated connection status. */ closeConnection(): Promise; private isLifecycleCurrent; /** * Returns version information for the Milvus server. * This method returns a Promise that resolves with a `GetVersionResponse` object. */ getVersion(): Promise; /** * Checks the health of the Milvus server. * This method returns a Promise that resolves with a `CheckHealthResponse` object. */ checkHealth(): Promise; /** Allocates a Milvus hybrid logical timestamp. */ allocTimestamp(data?: GrpcTimeOut): Promise; /** Gets the proxy's component state. */ getComponentStates(data?: GrpcTimeOut): Promise; /** Calls the legacy proxy link registration RPC. */ registerLink(data?: GrpcTimeOut): Promise; /** Runs the legacy JSON diagnostic on servers that expose the Dummy RPC. */ dummy(data: DummyReq): Promise; /** Gets a secondary's live or post-failover salvage checkpoint for a physical channel. */ getReplicateInfo(data: GetReplicateInfoReq): Promise; /** Opens a duplex stream to send replication messages and receive acknowledgements. */ createReplicateStream(options: CreateReplicateStreamReq): Promise; /** Streams immutable WAL messages in the specified physical channel and time range. */ dumpMessages(request: DumpMessagesReq): Promise; private openReplicationStream; /** * Runs an analyzer on the provided text. * @param {RunAnalyzerRequest} data - The request object containing analyzer parameters and text. * @returns {Promise} - A Promise that resolves with the analyzer response. */ runAnalyzer(data: RunAnalyzerRequest): Promise; /** Compute the minimum phrase-match slop for each text. Verified on Milvus 3.0.6. */ computePhraseMatchSlop({ analyzer_params, query_text, data_texts, timeout, }: ComputePhraseMatchSlopReq): Promise; /** * Adds a file resource to Milvus metadata. * @param {AddFileResourceReq} data - The file resource name and server-visible path. * @returns {Promise} - A Promise that resolves with the operation status. */ addFileResource(data: AddFileResourceReq): Promise; /** * Removes a file resource from Milvus metadata. * @param {RemoveFileResourceReq} data - The file resource name. * @returns {Promise} - A Promise that resolves with the operation status. */ removeFileResource(data: RemoveFileResourceReq): Promise; /** * Lists file resources registered in Milvus metadata. * @param {ListFileResourcesReq} [data] - Optional request parameters. * @returns {Promise} - A Promise that resolves with file resources. */ listFileResources(data?: ListFileResourcesReq): Promise; } export {};