@holo-js/cache-redis 0.2.6 → 0.3.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/dist/index.d.ts +6 -1
- package/dist/index.mjs +9 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,11 @@ declare function toLockTtlMilliseconds(seconds: number): number;
|
|
|
93
93
|
declare function isRedisNumericMutationError(error: unknown): error is Error;
|
|
94
94
|
declare function createRedisLock(client: RedisClientLike, name: string, seconds: number, ownerFactory: () => string, sleep: (milliseconds: number) => Promise<void>, now: () => number): CacheLockContract;
|
|
95
95
|
declare function createRedisCacheDriver(options: RedisCacheDriverOptions): CacheDriverContract;
|
|
96
|
+
declare const redisCacheDriverFactory: Readonly<{
|
|
97
|
+
driver: "redis";
|
|
98
|
+
registrationKey: "@holo-js/cache-redis";
|
|
99
|
+
create: typeof createRedisCacheDriver;
|
|
100
|
+
}>;
|
|
96
101
|
declare const redisCacheDriverInternals: {
|
|
97
102
|
createRedisClient: typeof createRedisClient;
|
|
98
103
|
createRedisClientOptions: typeof createRedisClientOptions;
|
|
@@ -107,4 +112,4 @@ declare const redisCacheDriverInternals: {
|
|
|
107
112
|
toRedisSocketPath: typeof toRedisSocketPath;
|
|
108
113
|
};
|
|
109
114
|
|
|
110
|
-
export { type RedisCacheDriverOptions, createRedisCacheDriver, redisCacheDriverInternals };
|
|
115
|
+
export { type RedisCacheDriverOptions, createRedisCacheDriver, redisCacheDriverFactory, redisCacheDriverInternals };
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { randomUUID } from "crypto";
|
|
3
3
|
import Redis from "ioredis";
|
|
4
4
|
import {
|
|
5
|
-
CacheInvalidNumericMutationError
|
|
5
|
+
CacheInvalidNumericMutationError,
|
|
6
|
+
registerCacheDriverFactory
|
|
6
7
|
} from "@holo-js/cache";
|
|
7
8
|
var REDIS_SCAN_COUNT = 100;
|
|
8
9
|
var CACHE_DRIVER_DISPOSE_SYMBOL = /* @__PURE__ */ Symbol.for("holo.cache.driver.dispose");
|
|
@@ -256,6 +257,12 @@ function createRedisCacheDriver(options) {
|
|
|
256
257
|
});
|
|
257
258
|
return driver;
|
|
258
259
|
}
|
|
260
|
+
var redisCacheDriverFactory = Object.freeze({
|
|
261
|
+
driver: "redis",
|
|
262
|
+
registrationKey: "@holo-js/cache-redis",
|
|
263
|
+
create: createRedisCacheDriver
|
|
264
|
+
});
|
|
265
|
+
registerCacheDriverFactory(redisCacheDriverFactory);
|
|
259
266
|
var redisCacheDriverInternals = {
|
|
260
267
|
createRedisClient,
|
|
261
268
|
createRedisClientOptions,
|
|
@@ -271,5 +278,6 @@ var redisCacheDriverInternals = {
|
|
|
271
278
|
};
|
|
272
279
|
export {
|
|
273
280
|
createRedisCacheDriver,
|
|
281
|
+
redisCacheDriverFactory,
|
|
274
282
|
redisCacheDriverInternals
|
|
275
283
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/cache-redis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Holo-JS Framework - Redis cache driver",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"test:integration": "HOLO_REDIS_INTEGRATION=1 vitest --run"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@holo-js/cache": "^0.
|
|
27
|
+
"@holo-js/cache": "^0.3.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"ioredis": "^5.4.2",
|
|
31
31
|
"tslib": "^2.8.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@holo-js/cache": "^0.
|
|
34
|
+
"@holo-js/cache": "^0.3.1",
|
|
35
35
|
"@types/node": "^22.10.2",
|
|
36
36
|
"tsup": "^8.3.5",
|
|
37
37
|
"typescript": "^5.7.2",
|