breathe-api
Version:
Model Context Protocol server for Breathe HR APIs with Swagger/OpenAPI support - also works with custom APIs
34 lines • 1.14 kB
TypeScript
import NodeCache from 'node-cache';
import PQueue from 'p-queue';
export declare const swaggerCache: NodeCache;
export declare const apiResponseCache: NodeCache;
export declare const requestQueue: PQueue;
export declare function generateCacheKey(params: {
url: string;
method?: string;
headers?: Record<string, string>;
params?: Record<string, any>;
data?: any;
}): string;
export declare function isCacheable(url: string, method?: string): boolean;
export declare function deduplicateRequest<T>(key: string, requestFn: () => Promise<T>): Promise<T>;
export declare function getCachedOrFetch<T>(cache: NodeCache, key: string, fetchFn: () => Promise<T>, ttl?: number): Promise<T>;
export declare function clearAllCaches(): void;
export declare function getCacheStats(): {
swagger: {
keys: number;
hits: number;
misses: number;
hitRate: number;
};
apiResponse: {
keys: number;
hits: number;
misses: number;
hitRate: number;
};
pendingRequests: number;
queueSize: number;
queuePending: number;
};
//# sourceMappingURL=cache.d.ts.map