secure-store-redis
Advanced tools
Comparing version 3.0.0-rc.1 to 3.0.0-rc.2
@@ -1,2 +0,2 @@ | ||
import { RedisClientOptions } from "redis"; | ||
import { RedisClientOptions, RedisClientType, RedisFunctions, RedisModules, RedisScripts } from "redis"; | ||
interface SecureStoreConfig { | ||
@@ -8,5 +8,7 @@ redis: RedisClientOptions; | ||
secret: string; | ||
private client; | ||
client: RedisClientType<RedisModules, RedisFunctions, RedisScripts>; | ||
private config; | ||
constructor(uid: string, secret: string, cfg: SecureStoreConfig); | ||
quit(): Promise<string>; | ||
disconnect(): Promise<void>; | ||
init(): Promise<void>; | ||
@@ -13,0 +15,0 @@ save(key: string, data: any, postfix?: string): Promise<number>; |
@@ -35,2 +35,12 @@ "use strict"; | ||
} | ||
quit() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.client.quit(); | ||
}); | ||
} | ||
disconnect() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.client.disconnect(); | ||
}); | ||
} | ||
init() { | ||
@@ -72,3 +82,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
const hash = SecureStore.shasum(key); | ||
return yield this.client.hSet(this.uid + postfix, hash, data); | ||
return yield this.client.HSET(this.uid + postfix, hash, data); | ||
}); | ||
@@ -83,3 +93,3 @@ } | ||
const hash = SecureStore.shasum(key); | ||
const res = yield this.client.hGet(this.uid + postfix, hash); | ||
const res = yield this.client.HGET(this.uid + postfix, hash); | ||
let data; | ||
@@ -112,3 +122,3 @@ if (typeof res === "string") { | ||
const hash = SecureStore.shasum(key); | ||
return yield this.client.hDel(this.uid + postfix, hash); | ||
return yield this.client.HDEL(this.uid + postfix, hash); | ||
}); | ||
@@ -115,0 +125,0 @@ } |
{ | ||
"name": "secure-store-redis", | ||
"version": "3.0.0-rc.1", | ||
"version": "3.0.0-rc.2", | ||
"description": "A simple wrapper to encrypt and decrypt data stored in Redis", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29207
11
542
0