@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
61 lines • 1.92 kB
TypeScript
/**
* Cache Invalidation Helper for Sync Process
*
* Provides a clean way to integrate cache invalidation with the
* existing IncrementalSyncManager without modifying its code.
*/
/**
* Helper class to track sync operations and trigger cache invalidation
*/
export declare class CacheInvalidationHelper {
private syncHandler?;
private pendingInvalidations;
private activeSyncs;
constructor(syncHandler?: any);
/**
* Call when starting a project sync
*/
onProjectSyncStart(projectId: string): Promise<void>;
/**
* Call when completing a project sync
*/
onProjectSyncComplete(projectId: string): Promise<void>;
/**
* Call after syncing an entity
*/
onEntitySynced(projectId: string, entityType: string, entityId?: string, entityKey?: string, operation?: 'create' | 'update' | 'delete'): Promise<void>;
/**
* Call when an entity is deleted
*/
onEntityDeleted(projectId: string, entityType: string, entityId: string): Promise<void>;
/**
* Manually trigger cache invalidation for specific entities
*/
invalidateEntities(projectId: string, entities: Array<{
type: string;
id?: string;
key?: string;
}>): Promise<void>;
/**
* Check if invalidation is enabled
*/
isEnabled(): boolean;
}
/**
* Example of how to use the helper in your sync code:
*
* ```typescript
* // In your sync manager or wherever you handle syncing
* const cacheHelper = new CacheInvalidationHelper(queryEngine?.getSyncCacheHandler());
*
* // When starting a sync
* await cacheHelper.onProjectSyncStart(projectId);
*
* // After syncing each entity
* await cacheHelper.onEntitySynced(projectId, 'flags', undefined, flagKey, 'update');
*
* // When sync is complete
* await cacheHelper.onProjectSyncComplete(projectId);
* ```
*/
//# sourceMappingURL=CacheInvalidationHelper.d.ts.map