tricache 0.9.0 → 1.0.1
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 +7 -3
- package/dist/{cache-service-DVvroyqA.d.ts → cache-service-CREOp7MM.d.ts} +57 -12
- package/dist/{cache-service-KI5ACF3F.js → cache-service-MG7PN6MX.js} +3 -3
- package/dist/{chunk-XZL45ABR.js → chunk-2AJKEQMZ.js} +54 -1
- package/dist/{chunk-QNU7B43J.js → chunk-3I5L7K6I.js} +17 -0
- package/dist/{chunk-PL5J3ZNT.js → chunk-JYQFQJNJ.js} +682 -277
- package/dist/{chunk-LJ5QJB5O.js → chunk-UBWLPKTI.js} +127 -11
- package/dist/cli.cjs +857 -293
- package/dist/cli.js +4 -4
- package/dist/dashboard/index.d.ts +2 -2
- package/dist/drizzle/index.cjs +865 -294
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +1 -1
- package/dist/edge/index.cjs +115 -36
- package/dist/edge/index.d.ts +3 -3
- package/dist/edge/index.js +88 -37
- package/dist/hono/index.cjs +865 -294
- package/dist/hono/index.d.ts +2 -2
- package/dist/hono/index.js +1 -1
- package/dist/{hono-VA9A1m0I.d.ts → hono-DSV2ve66.d.ts} +11 -4
- package/dist/http/index.cjs +917 -315
- package/dist/http/index.d.ts +3 -3
- package/dist/http/index.js +60 -29
- package/dist/index.cjs +885 -294
- package/dist/index.d.ts +37 -7
- package/dist/index.js +16 -6
- package/dist/nestjs/index.cjs +856 -292
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +4 -4
- package/dist/next/index.cjs +858 -300
- package/dist/next/index.d.ts +2 -2
- package/dist/next/index.js +5 -11
- package/dist/prisma/index.d.ts +2 -2
- package/dist/serialize-worker.cjs +127 -9
- package/dist/serialize-worker.js +8 -4
- package/dist/{types-B_QkVwJ7.d.ts → types-Dyip5wAl.d.ts} +53 -7
- package/package.json +7 -4
- package/src/adapters/node-redis.ts +19 -0
- package/src/cache-service.ts +781 -297
- package/src/cli.ts +1 -1
- package/src/compression.ts +193 -15
- package/src/cross-region.ts +1 -1
- package/src/edge/cache.ts +94 -42
- package/src/env.d.ts +13 -0
- package/src/http/express.ts +55 -16
- package/src/http/fastify.ts +3 -7
- package/src/index.ts +9 -1
- package/src/next/cache-handler.ts +1 -4
- package/src/next/isr-handler.ts +1 -4
- package/src/serialize-worker.ts +6 -2
- package/src/smart-memory-cache.ts +3 -2
- package/src/types.ts +45 -5
- package/src/utils/tag-matcher.ts +90 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CacheService, I as IIpcCacheProvider, a as IpcMetricsPayload, b as IpcTelemetryClient, c as IpcTelemetryServer, L as LatencyWatchdogOptions, d as LatencyWatchdogTelemetry, P as ProcessTerminationBus, T as TierLatencyWatchdog, e as deepMergeOptions, f as findActiveSockets, g as formatBytes, h as formatDuration, i as formatNumber, r as renderProgressBar, j as renderTopDashboard, k as resolveIpcSocketPath } from './cache-service-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
export { C as CacheService, I as IIpcCacheProvider, a as IpcMetricsPayload, b as IpcTelemetryClient, c as IpcTelemetryServer, L as LatencyWatchdogOptions, d as LatencyWatchdogTelemetry, P as ProcessTerminationBus, T as TierLatencyWatchdog, e as deepMergeOptions, f as findActiveSockets, g as formatBytes, h as formatDuration, i as formatNumber, r as renderProgressBar, j as renderTopDashboard, k as resolveIpcSocketPath } from './cache-service-CREOp7MM.js';
|
|
2
|
+
import { j as IRemoteSnapshotAdapter, k as CategoryLimit, S as SmartCacheEntry, l as EvictionReason, i as ILogger, m as CacheHit, f as CachePriority, h as WTinyLfuStats$1, n as CacheEncryption, o as CompressionAlgorithm, p as DiskCacheEntry, D as DiskBackpressureStats, q as IRedisDriver, r as IRedisPipeline } from './types-Dyip5wAl.js';
|
|
3
|
+
export { c as CacheHealthStatus, b as CacheMetrics, C as CacheOptions, g as CachePingResult, d as CachePresetType, e as CrossRegionInvalidationEvent, s as CrossRegionRelayOptions, t as CustomCompressor, E as EncryptionMode, u as EnvelopeEncryption, v as EnvelopeEncryptionOptions, H as HttpMeshRelayOptions, w as HttpSnapshotAdapterOptions, x as ICacheBatchObservableCallback, y as ICacheCounter, z as ICacheMeter, A as ICacheObservableGauge, B as ICacheSpan, F as ICacheSpanLink, I as ICacheTracer, G as ICrossRegionRelay, a as InvalidateTagOptions, L as LockOptions, R as RemoteSnapshotOptions, J as WebhookRequestLike, K as WebhookResponseLike, W as WrapOptions, M as consoleLogger, N as createCrossRegionWebhookHandler, O as createCustomCrossRegionRelay, P as createCustomSnapshotAdapter, Q as createHttpMeshRelay, T as createHttpSnapshotAdapter, U as createMemoryCrossRegionRelay, V as createMemorySnapshotAdapter, X as initZstd } from './types-Dyip5wAl.js';
|
|
4
4
|
export { B as BloomFilterStats, M as Murmur3BloomFilter, W as WasmBloomFilter, m as murmur3_32 } from './murmur3-CMGw9PbV.js';
|
|
5
5
|
import { EventEmitter } from 'node:events';
|
|
6
6
|
export { DashboardActionEvent, DashboardOptions, DashboardPeerInstance, StandaloneDashboardOptions, createNextDashboardHandlers, handleDashboardRequest, startDashboardServer, tricacheDashboard } from './dashboard/index.js';
|
|
@@ -203,7 +203,7 @@ declare class SmartMemoryCache {
|
|
|
203
203
|
private maybeRebuildBloom;
|
|
204
204
|
private smartEvict;
|
|
205
205
|
get(key: string): CacheHit | null;
|
|
206
|
-
set(key: string, data: unknown, ttlMs: number, priority?: CachePriority, staleAt?: number, delta?: number, tagVersions?: Record<string, number
|
|
206
|
+
set(key: string, data: unknown, ttlMs: number, priority?: CachePriority, staleAt?: number, delta?: number, tagVersions?: Record<string, number>, setAt?: number): void;
|
|
207
207
|
delete(key: string): boolean;
|
|
208
208
|
private keysMatchingPattern;
|
|
209
209
|
deletePattern(pattern: string): number;
|
|
@@ -556,8 +556,6 @@ declare class WTinyLfuPolicy {
|
|
|
556
556
|
getSegment(key: string): 'window' | 'probation' | 'protected' | null;
|
|
557
557
|
}
|
|
558
558
|
|
|
559
|
-
type CompressionAlgorithm = 'brotli' | 'gzip' | 'none';
|
|
560
|
-
|
|
561
559
|
/**
|
|
562
560
|
* DiskTier — L1.5 NVMe-fast overflow cache between L1 RAM and L2 Redis/DB.
|
|
563
561
|
*
|
|
@@ -826,6 +824,7 @@ declare class NodeRedisAdapter implements IRedisDriver {
|
|
|
826
824
|
sadd(key: string, ...members: string[]): Promise<number>;
|
|
827
825
|
mget(keys: string[]): Promise<(string | null)[]>;
|
|
828
826
|
hset(key: string, value: Record<string, string>): Promise<unknown>;
|
|
827
|
+
hgetall(key: string): Promise<Record<string, string>>;
|
|
829
828
|
publish(channel: string, message: string): Promise<number>;
|
|
830
829
|
subscribe(...channels: string[]): Promise<unknown>;
|
|
831
830
|
scanStream(options?: {
|
|
@@ -942,4 +941,35 @@ declare function parseTraceParent(header: string | undefined | null): ParsedTrac
|
|
|
942
941
|
*/
|
|
943
942
|
declare function formatTraceParent(traceId: string, spanId: string, traceFlags?: number): string;
|
|
944
943
|
|
|
945
|
-
|
|
944
|
+
/**
|
|
945
|
+
* Utilities for wildcard matching and hierarchical cascading of cache tags.
|
|
946
|
+
*/
|
|
947
|
+
/**
|
|
948
|
+
* Returns true if the given tag contains glob wildcard characters ('*' or '?').
|
|
949
|
+
*/
|
|
950
|
+
declare function isWildcardTag(tag: string): boolean;
|
|
951
|
+
/**
|
|
952
|
+
* Matches a tag name against a pattern supporting '*' (0 or more chars) and '?' (single char).
|
|
953
|
+
* Optimized with fast-paths for exact match, universal wildcard, and single prefix/suffix wildcards.
|
|
954
|
+
*/
|
|
955
|
+
declare function matchesTagPattern(pattern: string, tag: string): boolean;
|
|
956
|
+
/**
|
|
957
|
+
* Determines whether `candidateTag` is either identical to `parentTag`
|
|
958
|
+
* or a child descendant in the hierarchy separated by `delimiter`.
|
|
959
|
+
*
|
|
960
|
+
* Example:
|
|
961
|
+
* isChildTag('org:123', 'org:123', ':') -> true
|
|
962
|
+
* isChildTag('org:123', 'org:123:dept', ':') -> true
|
|
963
|
+
* isChildTag('org:123', 'org:1234', ':') -> false (must match delimiter boundary)
|
|
964
|
+
*/
|
|
965
|
+
declare function isChildTag(parentTag: string, candidateTag: string, delimiter?: string): boolean;
|
|
966
|
+
/**
|
|
967
|
+
* Expands hierarchical tags into all ancestor namespace levels.
|
|
968
|
+
*
|
|
969
|
+
* Example:
|
|
970
|
+
* expandHierarchicalTags(['org:123:dept:456', 'role:admin'], ':')
|
|
971
|
+
* => ['org', 'org:123', 'org:123:dept', 'org:123:dept:456', 'role', 'role:admin']
|
|
972
|
+
*/
|
|
973
|
+
declare function expandHierarchicalTags(tags: string[], delimiter?: string): string[];
|
|
974
|
+
|
|
975
|
+
export { AutoPipeliner, type AutoPipelinerOptions, type AutonomousL1Options, CacheCodec, type CacheCodecOptions, CacheEncryption, CacheHit, CachePriority, CategoryLimit, CompressionAlgorithm, DEFAULT_AUTONOMOUS_L1_CEILING_BYTES, DiskCacheEntry, DiskTier, EvictionReason, type EvictionResult, ILogger, IRedisDriver, IRedisPipeline, IRemoteSnapshotAdapter, MIN_AUTONOMOUS_L1_FLOOR_BYTES, NodeRedisAdapter, type ParsedTraceParent, SigV4SnapshotAdapter, type SigV4SnapshotAdapterOptions, SmartCacheEntry, SmartMemoryCache, TinyLfuSketch, WTinyLfuCache, type WTinyLfuOptions, WTinyLfuPolicy, type WTinyLfuStats, createNodeRedisAdapter, createR2SnapshotAdapter, createS3SnapshotAdapter, createSigV4SnapshotAdapter, defaultCodec, expandHierarchicalTags, formatTraceParent, getV8HeapLimit, isChildTag, isWildcardTag, matchesTagPattern, parseTraceParent, readCgroupMemoryLimit, resolveAutonomousL1MaxBytes, resolveDefaultDiskDir };
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
createSigV4SnapshotAdapter,
|
|
15
15
|
formatTraceParent,
|
|
16
16
|
parseTraceParent
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3I5L7K6I.js";
|
|
18
18
|
import {
|
|
19
19
|
AutoPipeliner,
|
|
20
20
|
CacheCodec,
|
|
@@ -43,13 +43,14 @@ import {
|
|
|
43
43
|
resolveAutonomousL1MaxBytes,
|
|
44
44
|
resolveDefaultDiskDir,
|
|
45
45
|
resolveIpcSocketPath
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-JYQFQJNJ.js";
|
|
47
47
|
import {
|
|
48
48
|
CacheEncryption,
|
|
49
49
|
CachePriority,
|
|
50
50
|
EnvelopeEncryption,
|
|
51
|
-
consoleLogger
|
|
52
|
-
|
|
51
|
+
consoleLogger,
|
|
52
|
+
initZstd
|
|
53
|
+
} from "./chunk-UBWLPKTI.js";
|
|
53
54
|
import {
|
|
54
55
|
createNextDashboardHandlers,
|
|
55
56
|
handleDashboardRequest,
|
|
@@ -61,8 +62,12 @@ import {
|
|
|
61
62
|
murmur3_32
|
|
62
63
|
} from "./chunk-UGD4VEPD.js";
|
|
63
64
|
import {
|
|
64
|
-
WasmBloomFilter
|
|
65
|
-
|
|
65
|
+
WasmBloomFilter,
|
|
66
|
+
expandHierarchicalTags,
|
|
67
|
+
isChildTag,
|
|
68
|
+
isWildcardTag,
|
|
69
|
+
matchesTagPattern
|
|
70
|
+
} from "./chunk-2AJKEQMZ.js";
|
|
66
71
|
export {
|
|
67
72
|
AutoPipeliner,
|
|
68
73
|
CacheCodec,
|
|
@@ -100,6 +105,7 @@ export {
|
|
|
100
105
|
createSigV4SnapshotAdapter,
|
|
101
106
|
deepMergeOptions,
|
|
102
107
|
defaultCodec,
|
|
108
|
+
expandHierarchicalTags,
|
|
103
109
|
findActiveSockets,
|
|
104
110
|
formatBytes,
|
|
105
111
|
formatDuration,
|
|
@@ -107,6 +113,10 @@ export {
|
|
|
107
113
|
formatTraceParent,
|
|
108
114
|
getV8HeapLimit,
|
|
109
115
|
handleDashboardRequest,
|
|
116
|
+
initZstd,
|
|
117
|
+
isChildTag,
|
|
118
|
+
isWildcardTag,
|
|
119
|
+
matchesTagPattern,
|
|
110
120
|
murmur3_32,
|
|
111
121
|
parseTraceParent,
|
|
112
122
|
readCgroupMemoryLimit,
|