d-vecdb
Version:
TypeScript/JavaScript client for d-vecDB - High-performance vector database with persistent metadata, WAL corruption protection and GPU acceleration
87 lines • 2.6 kB
TypeScript
import { ClientConfig, CollectionConfig, CollectionResponse, ListCollectionsResponse, CollectionStats, Vector, InsertResponse, SearchRequest, SearchResponse, ServerStats, HealthResponse } from './types';
/**
* REST client for d-vecDB
*/
export declare class RestClient {
private client;
private baseUrl;
constructor(config?: ClientConfig);
/**
* Unwrap the server's standard response format
* Server returns: {"success": true, "data": <actual_data>, "error": null}
*/
private unwrapResponse;
/**
* Handle axios errors and convert to custom exceptions
*/
private handleError;
/**
* Create a new collection
*/
createCollection(config: CollectionConfig): Promise<CollectionResponse>;
/**
* List all collection names (fast - no details)
*/
listCollectionNames(): Promise<string[]>;
/**
* List all collections with full details (slower - fetches each collection)
*/
listCollections(): Promise<ListCollectionsResponse>;
/**
* Get collection information
*/
getCollection(name: string): Promise<CollectionResponse>;
/**
* Get collection statistics
*/
getCollectionStats(name: string): Promise<CollectionStats>;
/**
* Delete a collection
*/
deleteCollection(name: string): Promise<CollectionResponse>;
/**
* Insert a single vector
*/
insertVector(collectionName: string, vector: Vector): Promise<InsertResponse>;
/**
* Batch insert vectors
*/
batchInsert(collectionName: string, vectors: Vector[]): Promise<InsertResponse>;
/**
* Get a vector by ID
*/
getVector(collectionName: string, vectorId: string): Promise<Vector>;
/**
* Update a vector
*/
updateVector(collectionName: string, vector: Vector): Promise<InsertResponse>;
/**
* Delete a vector
*/
deleteVector(collectionName: string, vectorId: string): Promise<InsertResponse>;
/**
* Search for similar vectors
*/
search(request: SearchRequest): Promise<SearchResponse>;
/**
* Get server statistics
*/
getStats(): Promise<ServerStats>;
/**
* Health check
*/
health(): Promise<HealthResponse>;
/**
* Ping the server
*/
ping(): Promise<boolean>;
/**
* Transform collection response from API format to client format
*/
private transformCollectionResponse;
/**
* Transform collection info from API format to client format
*/
private transformCollectionInfo;
}
//# sourceMappingURL=rest-client.d.ts.map