@keyv/redis 4.3.0 → 4.3.2
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.cjs +6 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -177,8 +177,12 @@ var KeyvRedis = class extends import_node_events.default {
|
|
|
177
177
|
* Get the Redis URL used to connect to the server. This is used to get a connected client.
|
|
178
178
|
*/
|
|
179
179
|
async getClient() {
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
try {
|
|
181
|
+
if (!this._client.isOpen) {
|
|
182
|
+
await this._client.connect();
|
|
183
|
+
}
|
|
184
|
+
} catch (error) {
|
|
185
|
+
this.emit("error", error);
|
|
182
186
|
}
|
|
183
187
|
return this._client;
|
|
184
188
|
}
|
|
@@ -213,7 +217,6 @@ var KeyvRedis = class extends import_node_events.default {
|
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
await multi.exec();
|
|
216
|
-
return entries.map(() => true);
|
|
217
220
|
}
|
|
218
221
|
/**
|
|
219
222
|
* Check if a key exists in the store.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
|
-
import { RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts
|
|
2
|
+
import { RedisClientOptions, RedisClusterOptions, RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts } from 'redis';
|
|
3
3
|
export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, createClient, createCluster } from 'redis';
|
|
4
4
|
import { KeyvStoreAdapter, KeyvEntry, Keyv } from 'keyv';
|
|
5
5
|
export { Keyv } from 'keyv';
|
|
@@ -144,7 +144,7 @@ declare class KeyvRedis<T> extends EventEmitter implements KeyvStoreAdapter {
|
|
|
144
144
|
* Will set many key value pairs in the store. TTL is in milliseconds. This will be done as a single transaction.
|
|
145
145
|
* @param {KeyvEntry[]} entries - the key value pairs to set with optional ttl
|
|
146
146
|
*/
|
|
147
|
-
setMany(entries: KeyvEntry[]): Promise<
|
|
147
|
+
setMany(entries: KeyvEntry[]): Promise<void>;
|
|
148
148
|
/**
|
|
149
149
|
* Check if a key exists in the store.
|
|
150
150
|
* @param {string} key - the key to check
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
|
-
import { RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts
|
|
2
|
+
import { RedisClientOptions, RedisClusterOptions, RedisClientType, RedisClusterType, RedisModules, RedisFunctions, RedisScripts } from 'redis';
|
|
3
3
|
export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, createClient, createCluster } from 'redis';
|
|
4
4
|
import { KeyvStoreAdapter, KeyvEntry, Keyv } from 'keyv';
|
|
5
5
|
export { Keyv } from 'keyv';
|
|
@@ -144,7 +144,7 @@ declare class KeyvRedis<T> extends EventEmitter implements KeyvStoreAdapter {
|
|
|
144
144
|
* Will set many key value pairs in the store. TTL is in milliseconds. This will be done as a single transaction.
|
|
145
145
|
* @param {KeyvEntry[]} entries - the key value pairs to set with optional ttl
|
|
146
146
|
*/
|
|
147
|
-
setMany(entries: KeyvEntry[]): Promise<
|
|
147
|
+
setMany(entries: KeyvEntry[]): Promise<void>;
|
|
148
148
|
/**
|
|
149
149
|
* Check if a key exists in the store.
|
|
150
150
|
* @param {string} key - the key to check
|
package/dist/index.js
CHANGED
|
@@ -147,8 +147,12 @@ var KeyvRedis = class extends EventEmitter {
|
|
|
147
147
|
* Get the Redis URL used to connect to the server. This is used to get a connected client.
|
|
148
148
|
*/
|
|
149
149
|
async getClient() {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
try {
|
|
151
|
+
if (!this._client.isOpen) {
|
|
152
|
+
await this._client.connect();
|
|
153
|
+
}
|
|
154
|
+
} catch (error) {
|
|
155
|
+
this.emit("error", error);
|
|
152
156
|
}
|
|
153
157
|
return this._client;
|
|
154
158
|
}
|
|
@@ -183,7 +187,6 @@ var KeyvRedis = class extends EventEmitter {
|
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
await multi.exec();
|
|
186
|
-
return entries.map(() => true);
|
|
187
190
|
}
|
|
188
191
|
/**
|
|
189
192
|
* Check if a key exists in the store.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyv/redis",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"description": "Redis storage adapter for Keyv",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"cluster-key-slot": "^1.1.2",
|
|
38
38
|
"redis": "^4.7.0",
|
|
39
|
-
"keyv": "^5.3.
|
|
39
|
+
"keyv": "^5.3.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@vitest/coverage-v8": "^3.0.7",
|