import { OnModuleDestroy } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; import { Redis } from "ioredis"; import { BaseConfigInterface } from "../../../config/interfaces"; import { AppLoggingService } from "../../logging/services/logging.service"; export declare class CacheService implements OnModuleDestroy { private readonly logger; private readonly configService; private redis; /** * Both key spaces are namespaced with `redis.queue` (REDIS_QUEUE), the same * per-project namespace BullMQ already uses as its `prefix` * (core/queue/queue.module.ts). Without it these keys were bare * `api_cache:` / `element:` — global to the Redis INSTANCE — so two stacks * sharing one Redis (a dev and an e2e stack of the same app, or two * deployments) would read each other's cached responses whenever a user id * collided, which for a seeded e2e stack is by construction. Worse, the * pattern-based invalidators below call `redis.keys("element:*")` and * `keys("api_cache:*")`: unprefixed, one stack's invalidation would delete * another's entries. * * Falls back to the bare prefixes when no queue namespace is configured, so * an app that never set REDIS_QUEUE keeps its existing key layout. */ private readonly CACHE_KEY_PREFIX; private readonly ELEMENT_KEY_PREFIX; constructor(logger: AppLoggingService, configService: ConfigService); private get cacheConfig(); generateCacheKey(userId: string, method: string, url: string, query?: any, body?: any): string; get(cacheKey: string): Promise; set(cacheKey: string, data: any, ttl?: number): Promise; private trackJsonApiElements; private isJsonApiResponse; private extractJsonApiElements; delete(cacheKey: string): Promise; deleteUserCache(userId: string): Promise; deleteByPattern(pattern: string): Promise; invalidateByElement(type: string, id: string): Promise; invalidateByElements(elements: Array<{ type: string; id: string; }>): Promise; invalidateByType(type: string): Promise; private removeFromElementTracking; getCacheKeysForElement(type: string, id: string): Promise; getAllTrackedElements(): Promise; clearAll(): Promise; shouldCache(method: string, url: string): boolean; private hashObject; getRedisClient(): Redis; onModuleDestroy(): Promise; } //# sourceMappingURL=cache.service.d.ts.map