layercache 1.2.7 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -343,6 +343,21 @@ interface CacheStackEvents {
343
343
  warm: {
344
344
  key: string;
345
345
  };
346
+ /** Fired immediately before a high-level cache operation begins. */
347
+ 'operation-start': {
348
+ id: number;
349
+ name: string;
350
+ attributes?: Record<string, unknown>;
351
+ };
352
+ /** Fired after a high-level cache operation finishes. */
353
+ 'operation-end': {
354
+ id: number;
355
+ name: string;
356
+ attributes?: Record<string, unknown>;
357
+ success: boolean;
358
+ result?: 'null';
359
+ error?: unknown;
360
+ };
346
361
  /** Fired when an error occurs (layer failure, circuit breaker, etc.). */
347
362
  error: {
348
363
  operation: string;
@@ -424,11 +439,16 @@ declare class CacheStack extends EventEmitter {
424
439
  private readonly keyDiscovery;
425
440
  private readonly fetchRateLimiter;
426
441
  private readonly snapshotSerializer;
442
+ private readonly invalidation;
443
+ private readonly layerWriter;
444
+ private readonly snapshots;
427
445
  private readonly backgroundRefreshes;
446
+ private readonly backgroundRefreshAbort;
428
447
  private readonly layerDegradedUntil;
429
448
  private readonly maintenance;
430
449
  private readonly ttlResolver;
431
450
  private readonly circuitBreakerManager;
451
+ private nextOperationId;
432
452
  private currentGeneration?;
433
453
  private isDisconnecting;
434
454
  private disconnectPromise?;
@@ -525,8 +545,6 @@ declare class CacheStack extends EventEmitter {
525
545
  private readFromLayers;
526
546
  private readLayerEntry;
527
547
  private backfill;
528
- private writeAcrossLayers;
529
- private executeLayerOperations;
530
548
  private resolveFreshTtl;
531
549
  private resolveLayerSeconds;
532
550
  private shouldNegativeCache;
@@ -541,6 +559,7 @@ declare class CacheStack extends EventEmitter {
541
559
  private sleep;
542
560
  private withTimeout;
543
561
  private shouldBroadcastL1Invalidation;
562
+ private observeOperation;
544
563
  private scheduleGenerationCleanup;
545
564
  private cleanupGeneration;
546
565
  private initializeWriteBehind;
@@ -548,12 +567,9 @@ declare class CacheStack extends EventEmitter {
548
567
  private enqueueWriteBehind;
549
568
  private flushWriteBehindQueue;
550
569
  private runWriteBehindBatch;
551
- private buildLayerSetEntry;
552
- private intersectKeys;
553
570
  private qualifyKey;
554
571
  private qualifyPattern;
555
572
  private stripQualifiedKey;
556
- private deleteKeysFromLayers;
557
573
  private validateConfiguration;
558
574
  private validateWriteOptions;
559
575
  private assertActive;
@@ -566,14 +582,9 @@ declare class CacheStack extends EventEmitter {
566
582
  private recordCircuitFailure;
567
583
  private isNegativeStoredValue;
568
584
  private emitError;
569
- private isCacheSnapshotEntries;
570
- private sanitizeSnapshotValue;
571
585
  private snapshotMaxBytes;
572
586
  private snapshotMaxEntries;
573
587
  private invalidationMaxKeys;
574
- private collectKeysForTag;
575
- private assertWithinInvalidationKeyLimit;
576
- private visitExportEntries;
577
588
  }
578
589
 
579
590
  interface CacheableOptions<TArgs extends unknown[]> extends CacheWrapOptions<TArgs> {
@@ -343,6 +343,21 @@ interface CacheStackEvents {
343
343
  warm: {
344
344
  key: string;
345
345
  };
346
+ /** Fired immediately before a high-level cache operation begins. */
347
+ 'operation-start': {
348
+ id: number;
349
+ name: string;
350
+ attributes?: Record<string, unknown>;
351
+ };
352
+ /** Fired after a high-level cache operation finishes. */
353
+ 'operation-end': {
354
+ id: number;
355
+ name: string;
356
+ attributes?: Record<string, unknown>;
357
+ success: boolean;
358
+ result?: 'null';
359
+ error?: unknown;
360
+ };
346
361
  /** Fired when an error occurs (layer failure, circuit breaker, etc.). */
347
362
  error: {
348
363
  operation: string;
@@ -424,11 +439,16 @@ declare class CacheStack extends EventEmitter {
424
439
  private readonly keyDiscovery;
425
440
  private readonly fetchRateLimiter;
426
441
  private readonly snapshotSerializer;
442
+ private readonly invalidation;
443
+ private readonly layerWriter;
444
+ private readonly snapshots;
427
445
  private readonly backgroundRefreshes;
446
+ private readonly backgroundRefreshAbort;
428
447
  private readonly layerDegradedUntil;
429
448
  private readonly maintenance;
430
449
  private readonly ttlResolver;
431
450
  private readonly circuitBreakerManager;
451
+ private nextOperationId;
432
452
  private currentGeneration?;
433
453
  private isDisconnecting;
434
454
  private disconnectPromise?;
@@ -525,8 +545,6 @@ declare class CacheStack extends EventEmitter {
525
545
  private readFromLayers;
526
546
  private readLayerEntry;
527
547
  private backfill;
528
- private writeAcrossLayers;
529
- private executeLayerOperations;
530
548
  private resolveFreshTtl;
531
549
  private resolveLayerSeconds;
532
550
  private shouldNegativeCache;
@@ -541,6 +559,7 @@ declare class CacheStack extends EventEmitter {
541
559
  private sleep;
542
560
  private withTimeout;
543
561
  private shouldBroadcastL1Invalidation;
562
+ private observeOperation;
544
563
  private scheduleGenerationCleanup;
545
564
  private cleanupGeneration;
546
565
  private initializeWriteBehind;
@@ -548,12 +567,9 @@ declare class CacheStack extends EventEmitter {
548
567
  private enqueueWriteBehind;
549
568
  private flushWriteBehindQueue;
550
569
  private runWriteBehindBatch;
551
- private buildLayerSetEntry;
552
- private intersectKeys;
553
570
  private qualifyKey;
554
571
  private qualifyPattern;
555
572
  private stripQualifiedKey;
556
- private deleteKeysFromLayers;
557
573
  private validateConfiguration;
558
574
  private validateWriteOptions;
559
575
  private assertActive;
@@ -566,14 +582,9 @@ declare class CacheStack extends EventEmitter {
566
582
  private recordCircuitFailure;
567
583
  private isNegativeStoredValue;
568
584
  private emitError;
569
- private isCacheSnapshotEntries;
570
- private sanitizeSnapshotValue;
571
585
  private snapshotMaxBytes;
572
586
  private snapshotMaxEntries;
573
587
  private invalidationMaxKeys;
574
- private collectKeysForTag;
575
- private assertWithinInvalidationKeyLimit;
576
- private visitExportEntries;
577
588
  }
578
589
 
579
590
  interface CacheableOptions<TArgs extends unknown[]> extends CacheWrapOptions<TArgs> {