layercache 1.2.2 → 1.2.3
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/README.md +27 -8
- package/dist/{chunk-ZMDB5KOK.js → chunk-7V7XAB74.js} +24 -1
- package/dist/{chunk-46UH7LNM.js → chunk-KOYGHLVP.js} +142 -18
- package/dist/{chunk-IXCMHVHP.js → chunk-QHWG7QS5.js} +1 -1
- package/dist/cli.cjs +37 -3
- package/dist/cli.js +15 -4
- package/dist/{edge-DLpdQN0W.d.ts → edge-B_rUqDy6.d.cts} +34 -1
- package/dist/{edge-DLpdQN0W.d.cts → edge-B_rUqDy6.d.ts} +34 -1
- package/dist/edge.cjs +165 -17
- package/dist/edge.d.cts +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +2 -2
- package/dist/index.cjs +591 -98
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +429 -84
- package/package.json +4 -4
- package/packages/nestjs/dist/index.cjs +492 -43
- package/packages/nestjs/dist/index.d.cts +25 -0
- package/packages/nestjs/dist/index.d.ts +25 -0
- package/packages/nestjs/dist/index.js +492 -43
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-
|
|
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-
|
|
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-B_rUqDy6.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-B_rUqDy6.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-
|
|
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-
|
|
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-B_rUqDy6.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-B_rUqDy6.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 {
|