layercache 1.2.2 → 1.2.4

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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InvalidationBus, C as CacheLogger, a as InvalidationMessage, b as CacheTagIndex, c as CacheStack, d as CacheWrapOptions, e as CacheGetOptions, f as CacheLayer, g as CacheSerializer, h as CacheLayerSetManyEntry, i as CacheSingleFlightCoordinator, j as CacheSingleFlightExecutionOptions } from './edge-DLpdQN0W.cjs';
2
- export { k as CacheAdaptiveTtlOptions, l as CacheCircuitBreakerOptions, m as CacheDegradationOptions, n as CacheHealthCheckResult, o as CacheHitRateSnapshot, p as CacheInspectResult, q as CacheLayerLatency, r as CacheMGetEntry, s as CacheMSetEntry, t as CacheMetricsSnapshot, u as CacheMissError, v as CacheNamespace, w as CacheRateLimitOptions, x as CacheSnapshotEntry, y as CacheStackEvents, z as CacheStackOptions, A as CacheStatsSnapshot, B as CacheTtlPolicy, D as CacheTtlPolicyContext, E as CacheWarmEntry, F as CacheWarmOptions, G as CacheWarmProgress, H as CacheWriteBehindOptions, J as CacheWriteOptions, K as EvictionPolicy, L as LayerTtlMap, M as MemoryLayer, N as MemoryLayerOptions, O as MemoryLayerSnapshotEntry, P as PatternMatcher, T as TagIndex, Q as createHonoCacheMiddleware } from './edge-DLpdQN0W.cjs';
1
+ import { I as InvalidationBus, C as CacheLogger, a as InvalidationMessage, b as CacheTagIndex, c as CacheStack, d as CacheWrapOptions, e as CacheGetOptions, f as CacheLayer, g as CacheSerializer, h as CacheLayerSetManyEntry, i as CacheSingleFlightCoordinator, j as CacheSingleFlightExecutionOptions } from './edge-Dw97n89L.cjs';
2
+ export { k as CacheAdaptiveTtlOptions, l as CacheCircuitBreakerOptions, m as CacheDegradationOptions, n as CacheHealthCheckResult, o as CacheHitRateSnapshot, p as CacheInspectResult, q as CacheLayerLatency, r as CacheMGetEntry, s as CacheMSetEntry, t as CacheMetricsSnapshot, u as CacheMissError, v as CacheNamespace, w as CacheRateLimitOptions, x as CacheSnapshotEntry, y as CacheStackEvents, z as CacheStackOptions, A as CacheStatsSnapshot, B as CacheTtlPolicy, D as CacheTtlPolicyContext, E as CacheWarmEntry, F as CacheWarmOptions, G as CacheWarmProgress, H as CacheWriteBehindOptions, J as CacheWriteOptions, K as EvictionPolicy, L as LayerTtlMap, M as MemoryLayer, N as MemoryLayerOptions, O as MemoryLayerSnapshotEntry, P as PatternMatcher, T as TagIndex, Q as createHonoCacheMiddleware } from './edge-Dw97n89L.cjs';
3
3
  import Redis from 'ioredis';
4
4
  import 'node:events';
5
5
 
@@ -176,6 +176,11 @@ interface RedisLayerOptions {
176
176
  scanCount?: number;
177
177
  compression?: CompressionAlgorithm;
178
178
  compressionThreshold?: number;
179
+ /**
180
+ * Maximum number of bytes allowed after decompression.
181
+ * Prevents decompression bomb attacks. Defaults to 64 MiB.
182
+ */
183
+ decompressionMaxBytes?: number;
179
184
  disconnectOnDispose?: boolean;
180
185
  }
181
186
  declare class RedisLayer implements CacheLayer {
@@ -189,6 +194,7 @@ declare class RedisLayer implements CacheLayer {
189
194
  private readonly scanCount;
190
195
  private readonly compression?;
191
196
  private readonly compressionThreshold;
197
+ private readonly decompressionMaxBytes;
192
198
  private readonly disconnectOnDispose;
193
199
  constructor(options: RedisLayerOptions);
194
200
  get<T>(key: string): Promise<T | null>;
@@ -222,6 +228,7 @@ declare class RedisLayer implements CacheLayer {
222
228
  private encodePayload;
223
229
  /**
224
230
  * Decompresses the payload asynchronously if a compression header is present.
231
+ * Enforces a maximum decompressed size to prevent decompression bomb attacks.
225
232
  */
226
233
  private decodePayload;
227
234
  }
@@ -347,6 +354,7 @@ declare class MemcachedLayer implements CacheLayer {
347
354
  deleteMany(keys: string[]): Promise<void>;
348
355
  clear(): Promise<void>;
349
356
  private withPrefix;
357
+ private validateKey;
350
358
  }
351
359
 
352
360
  declare class JsonSerializer implements CacheSerializer {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InvalidationBus, C as CacheLogger, a as InvalidationMessage, b as CacheTagIndex, c as CacheStack, d as CacheWrapOptions, e as CacheGetOptions, f as CacheLayer, g as CacheSerializer, h as CacheLayerSetManyEntry, i as CacheSingleFlightCoordinator, j as CacheSingleFlightExecutionOptions } from './edge-DLpdQN0W.js';
2
- export { k as CacheAdaptiveTtlOptions, l as CacheCircuitBreakerOptions, m as CacheDegradationOptions, n as CacheHealthCheckResult, o as CacheHitRateSnapshot, p as CacheInspectResult, q as CacheLayerLatency, r as CacheMGetEntry, s as CacheMSetEntry, t as CacheMetricsSnapshot, u as CacheMissError, v as CacheNamespace, w as CacheRateLimitOptions, x as CacheSnapshotEntry, y as CacheStackEvents, z as CacheStackOptions, A as CacheStatsSnapshot, B as CacheTtlPolicy, D as CacheTtlPolicyContext, E as CacheWarmEntry, F as CacheWarmOptions, G as CacheWarmProgress, H as CacheWriteBehindOptions, J as CacheWriteOptions, K as EvictionPolicy, L as LayerTtlMap, M as MemoryLayer, N as MemoryLayerOptions, O as MemoryLayerSnapshotEntry, P as PatternMatcher, T as TagIndex, Q as createHonoCacheMiddleware } from './edge-DLpdQN0W.js';
1
+ import { I as InvalidationBus, C as CacheLogger, a as InvalidationMessage, b as CacheTagIndex, c as CacheStack, d as CacheWrapOptions, e as CacheGetOptions, f as CacheLayer, g as CacheSerializer, h as CacheLayerSetManyEntry, i as CacheSingleFlightCoordinator, j as CacheSingleFlightExecutionOptions } from './edge-Dw97n89L.js';
2
+ export { k as CacheAdaptiveTtlOptions, l as CacheCircuitBreakerOptions, m as CacheDegradationOptions, n as CacheHealthCheckResult, o as CacheHitRateSnapshot, p as CacheInspectResult, q as CacheLayerLatency, r as CacheMGetEntry, s as CacheMSetEntry, t as CacheMetricsSnapshot, u as CacheMissError, v as CacheNamespace, w as CacheRateLimitOptions, x as CacheSnapshotEntry, y as CacheStackEvents, z as CacheStackOptions, A as CacheStatsSnapshot, B as CacheTtlPolicy, D as CacheTtlPolicyContext, E as CacheWarmEntry, F as CacheWarmOptions, G as CacheWarmProgress, H as CacheWriteBehindOptions, J as CacheWriteOptions, K as EvictionPolicy, L as LayerTtlMap, M as MemoryLayer, N as MemoryLayerOptions, O as MemoryLayerSnapshotEntry, P as PatternMatcher, T as TagIndex, Q as createHonoCacheMiddleware } from './edge-Dw97n89L.js';
3
3
  import Redis from 'ioredis';
4
4
  import 'node:events';
5
5
 
@@ -176,6 +176,11 @@ interface RedisLayerOptions {
176
176
  scanCount?: number;
177
177
  compression?: CompressionAlgorithm;
178
178
  compressionThreshold?: number;
179
+ /**
180
+ * Maximum number of bytes allowed after decompression.
181
+ * Prevents decompression bomb attacks. Defaults to 64 MiB.
182
+ */
183
+ decompressionMaxBytes?: number;
179
184
  disconnectOnDispose?: boolean;
180
185
  }
181
186
  declare class RedisLayer implements CacheLayer {
@@ -189,6 +194,7 @@ declare class RedisLayer implements CacheLayer {
189
194
  private readonly scanCount;
190
195
  private readonly compression?;
191
196
  private readonly compressionThreshold;
197
+ private readonly decompressionMaxBytes;
192
198
  private readonly disconnectOnDispose;
193
199
  constructor(options: RedisLayerOptions);
194
200
  get<T>(key: string): Promise<T | null>;
@@ -222,6 +228,7 @@ declare class RedisLayer implements CacheLayer {
222
228
  private encodePayload;
223
229
  /**
224
230
  * Decompresses the payload asynchronously if a compression header is present.
231
+ * Enforces a maximum decompressed size to prevent decompression bomb attacks.
225
232
  */
226
233
  private decodePayload;
227
234
  }
@@ -347,6 +354,7 @@ declare class MemcachedLayer implements CacheLayer {
347
354
  deleteMany(keys: string[]): Promise<void>;
348
355
  clear(): Promise<void>;
349
356
  private withPrefix;
357
+ private validateKey;
350
358
  }
351
359
 
352
360
  declare class JsonSerializer implements CacheSerializer {