okta-mcp-server
Version:
Model Context Protocol (MCP) server for Okta API operations with support for bulk operations and caching
76 lines • 1.76 kB
TypeScript
/**
* Cache interface for implementing different cache strategies
*/
export interface CacheOptions {
ttl?: number;
tags?: string[];
}
export interface CacheEntry<T> {
value: T;
expires: number;
tags?: string[];
}
export interface ICache {
/**
* Get a value from cache
*/
get<T>(key: string): Promise<T | undefined>;
/**
* Set a value in cache
*/
set<T>(key: string, value: T, options?: CacheOptions): Promise<void>;
/**
* Delete a value from cache
*/
delete(key: string): Promise<boolean>;
/**
* Check if a key exists in cache
*/
has(key: string): Promise<boolean>;
/**
* Clear all cache entries
*/
clear(): Promise<void>;
/**
* Clear cache entries by tag
*/
clearByTag(tag: string): Promise<void>;
/**
* Get cache size
*/
size(): Promise<number>;
}
/**
* Cache manager that can handle multiple cache layers
*/
export interface ICacheManager {
/**
* Get from cache with automatic layer management
*/
get<T>(key: string): Promise<T | undefined>;
/**
* Set in cache with automatic layer management
*/
set<T>(key: string, value: T, options?: CacheOptions): Promise<void>;
/**
* Wrap a function with caching
*/
wrap<T>(key: string, fn: () => Promise<T>, options?: CacheOptions): Promise<T>;
/**
* Invalidate cache by key pattern
*/
invalidate(pattern: string): Promise<void>;
/**
* Get cache statistics
*/
stats(): Promise<CacheStats>;
}
export interface CacheStats {
hits: number;
misses: number;
sets: number;
deletes: number;
size: number;
hitRate: number;
}
//# sourceMappingURL=interface.d.ts.map