UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

68 lines 1.79 kB
/** * Cache Key Generator for Intelligent Query Caching * * Generates deterministic cache keys from normalized queries * ensuring consistent keys for semantically equivalent queries. */ import { NormalizedQuery } from './QueryNormalizer.js'; export interface QueryContext { projectId?: string; userId?: string; environment?: string; syncVersion?: number; } export declare class CacheKeyGenerator { private readonly logger; private readonly keyPrefix; private readonly separator; private readonly maxKeyLength; /** * Generate a deterministic cache key from normalized query and context */ generateKey(query: NormalizedQuery, context?: QueryContext): string; /** * Generate pattern for cache invalidation */ generateInvalidationPattern(entity?: string, operation?: string, context?: Partial<QueryContext>): string; /** * Hash filters object deterministically */ private hashFilters; /** * Hash array of values */ private hashArray; /** * Hash order by array */ private hashOrderBy; /** * Serialize value for consistent string representation */ private serializeValue; /** * Hash a string value using SHA256 */ private hashValue; /** * Get time component for cache key */ private getTimeComponent; /** * Format date as YYYY-MM-DD */ private formatDate; /** * Normalize date string or Date object */ private normalizeDate; /** * Get ISO week number */ private getWeekNumber; /** * Parse cache key to extract components (for debugging/monitoring) */ parseKey(key: string): Record<string, string>; } //# sourceMappingURL=CacheKeyGenerator.d.ts.map