@launchdarkly/node-server-sdk-redis 3.0.5 → 3.0.7
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/CHANGELOG.md
CHANGED
|
@@ -24,6 +24,26 @@
|
|
|
24
24
|
* devDependencies
|
|
25
25
|
* @launchdarkly/node-server-sdk bumped from 8.1.0 to 8.1.1
|
|
26
26
|
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* devDependencies
|
|
31
|
+
* @launchdarkly/node-server-sdk bumped from 8.1.2 to 8.2.0
|
|
32
|
+
|
|
33
|
+
## [3.0.6](https://github.com/launchdarkly/js-core/compare/node-server-sdk-redis-v3.0.5...node-server-sdk-redis-v3.0.6) (2023-08-10)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* Switch to es2017 target to ensure native async/await. ([a83e4e6](https://github.com/launchdarkly/js-core/commit/a83e4e62d04c66105a1b0e8893640a7ca2d641e4))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
* The following workspace dependencies were updated
|
|
44
|
+
* devDependencies
|
|
45
|
+
* @launchdarkly/node-server-sdk bumped from 8.1.1 to 8.1.2
|
|
46
|
+
|
|
27
47
|
## [3.0.2](https://github.com/launchdarkly/js-core/compare/node-server-sdk-redis-v3.0.1...node-server-sdk-redis-v3.0.2) (2023-06-27)
|
|
28
48
|
|
|
29
49
|
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.KEY_USER_EXCLUDE = exports.KEY_USER_INCLUDE = exports.KEY_LAST_SYNCHRONIZED = void 0;
|
|
13
4
|
const RedisClientState_1 = require("./RedisClientState");
|
|
@@ -31,38 +22,34 @@ class RedisBigSegmentStore {
|
|
|
31
22
|
this.logger = logger;
|
|
32
23
|
this.state = new RedisClientState_1.default(options);
|
|
33
24
|
}
|
|
34
|
-
getMetadata() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return {};
|
|
43
|
-
});
|
|
25
|
+
async getMetadata() {
|
|
26
|
+
const value = await this.state.getClient().get(this.state.prefixedKey(exports.KEY_LAST_SYNCHRONIZED));
|
|
27
|
+
// Value will be true if it is a string containing any characters, which is fine
|
|
28
|
+
// for this check.
|
|
29
|
+
if (value) {
|
|
30
|
+
return { lastUpToDate: parseInt(value, 10) };
|
|
31
|
+
}
|
|
32
|
+
return {};
|
|
44
33
|
}
|
|
45
|
-
getUserMembership(userHash) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
membership[ref] = true;
|
|
63
|
-
});
|
|
64
|
-
return membership;
|
|
34
|
+
async getUserMembership(userHash) {
|
|
35
|
+
const includedRefs = await this.state
|
|
36
|
+
.getClient()
|
|
37
|
+
.smembers(this.state.prefixedKey(`${exports.KEY_USER_INCLUDE}:${userHash}`));
|
|
38
|
+
const excludedRefs = await this.state
|
|
39
|
+
.getClient()
|
|
40
|
+
.smembers(this.state.prefixedKey(`${exports.KEY_USER_EXCLUDE}:${userHash}`));
|
|
41
|
+
// If there are no included/excluded refs, the don't return any membership.
|
|
42
|
+
if ((!includedRefs || !includedRefs.length) && (!excludedRefs || !excludedRefs.length)) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
const membership = {};
|
|
46
|
+
excludedRefs === null || excludedRefs === void 0 ? void 0 : excludedRefs.forEach((ref) => {
|
|
47
|
+
membership[ref] = false;
|
|
48
|
+
});
|
|
49
|
+
includedRefs === null || includedRefs === void 0 ? void 0 : includedRefs.forEach((ref) => {
|
|
50
|
+
membership[ref] = true;
|
|
65
51
|
});
|
|
52
|
+
return membership;
|
|
66
53
|
}
|
|
67
54
|
close() {
|
|
68
55
|
this.state.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisBigSegmentStore.js","sourceRoot":"","sources":["../../src/RedisBigSegmentStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedisBigSegmentStore.js","sourceRoot":"","sources":["../../src/RedisBigSegmentStore.ts"],"names":[],"mappings":";;;AAGA,yDAAkD;AAElD;;GAEG;AACU,QAAA,qBAAqB,GAAG,8BAA8B,CAAC;AAEpE;;GAEG;AACU,QAAA,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD;;GAEG;AACU,QAAA,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD,MAAqB,oBAAoB;IAGvC,0EAA0E;IAC1E,oCAAoC;IACpC,6DAA6D;IAC7D,YACE,OAAwB,EACP,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;QAElC,IAAI,CAAC,KAAK,GAAG,IAAI,0BAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,KAAK,GAAG,MA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pB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF;AArDD,uCAqDC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchdarkly/node-server-sdk-redis",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "Redis-backed feature store for the LaunchDarkly Server-Side SDK for Node.js",
|
|
5
5
|
"homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/store/node-server-sdk-redis",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@launchdarkly/node-server-sdk": "8.x"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@launchdarkly/node-server-sdk": "8.
|
|
37
|
+
"@launchdarkly/node-server-sdk": "8.2.0",
|
|
38
38
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
39
39
|
"@types/jest": "^29.4.0",
|
|
40
40
|
"@typescript-eslint/eslint-plugin": "^6.1.0",
|