@launchdarkly/node-server-sdk-redis 4.1.22 → 4.2.0
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 +27 -0
- package/dist/src/RedisBigSegmentStore.d.ts +2 -3
- package/dist/src/RedisBigSegmentStore.d.ts.map +1 -1
- package/dist/src/RedisBigSegmentStore.js +8 -9
- package/dist/src/RedisBigSegmentStore.js.map +1 -1
- package/dist/src/RedisClientState.js +31 -31
- package/dist/src/RedisClientState.js.map +1 -1
- package/dist/src/RedisCore.js +24 -24
- package/dist/src/RedisCore.js.map +1 -1
- package/dist/src/RedisFeatureStore.d.ts +2 -3
- package/dist/src/RedisFeatureStore.d.ts.map +1 -1
- package/dist/src/RedisFeatureStore.js +9 -10
- package/dist/src/RedisFeatureStore.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -90,6 +90,33 @@
|
|
|
90
90
|
* devDependencies
|
|
91
91
|
* @launchdarkly/node-server-sdk bumped from 9.2.1 to 9.2.2
|
|
92
92
|
|
|
93
|
+
## [4.2.0](https://github.com/launchdarkly/js-core/compare/node-server-sdk-redis-v4.1.23...node-server-sdk-redis-v4.2.0) (2024-10-17)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Features
|
|
97
|
+
|
|
98
|
+
* Apply private property naming standard. Mangle browser private properties. ([#620](https://github.com/launchdarkly/js-core/issues/620)) ([3e6d404](https://github.com/launchdarkly/js-core/commit/3e6d404ae665c5cc7e5a1394a59c8f2c9d5d682a))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Dependencies
|
|
102
|
+
|
|
103
|
+
* The following workspace dependencies were updated
|
|
104
|
+
* devDependencies
|
|
105
|
+
* @launchdarkly/node-server-sdk bumped from 9.6.1 to 9.7.0
|
|
106
|
+
* peerDependencies
|
|
107
|
+
* @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.7.0
|
|
108
|
+
|
|
109
|
+
## [4.1.23](https://github.com/launchdarkly/js-core/compare/node-server-sdk-redis-v4.1.22...node-server-sdk-redis-v4.1.23) (2024-10-09)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Dependencies
|
|
113
|
+
|
|
114
|
+
* The following workspace dependencies were updated
|
|
115
|
+
* devDependencies
|
|
116
|
+
* @launchdarkly/node-server-sdk bumped from 9.6.0 to 9.6.1
|
|
117
|
+
* peerDependencies
|
|
118
|
+
* @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.6.1
|
|
119
|
+
|
|
93
120
|
## [4.1.22](https://github.com/launchdarkly/js-core/compare/node-server-sdk-redis-v4.1.21...node-server-sdk-redis-v4.1.22) (2024-09-26)
|
|
94
121
|
|
|
95
122
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { interfaces, LDLogger } from '@launchdarkly/node-server-sdk';
|
|
2
2
|
import LDRedisOptions from './LDRedisOptions';
|
|
3
3
|
export default class RedisBigSegmentStore implements interfaces.BigSegmentStore {
|
|
4
|
-
private
|
|
5
|
-
|
|
6
|
-
constructor(options?: LDRedisOptions, logger?: LDLogger | undefined);
|
|
4
|
+
private _state;
|
|
5
|
+
constructor(options?: LDRedisOptions, _logger?: LDLogger);
|
|
7
6
|
getMetadata(): Promise<interfaces.BigSegmentStoreMetadata | undefined>;
|
|
8
7
|
getUserMembership(userHash: string): Promise<interfaces.BigSegmentStoreMembership | undefined>;
|
|
9
8
|
close(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisBigSegmentStore.d.ts","sourceRoot":"","sources":["../../src/RedisBigSegmentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAkB9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,YAAW,UAAU,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"RedisBigSegmentStore.d.ts","sourceRoot":"","sources":["../../src/RedisBigSegmentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAkB9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,YAAW,UAAU,CAAC,eAAe;IAC7E,OAAO,CAAC,MAAM,CAAmB;gBAIrB,OAAO,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,QAAQ;IAIlD,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC,uBAAuB,GAAG,SAAS,CAAC;IAUtE,iBAAiB,CACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAyB5D,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -17,12 +17,11 @@ exports.KEY_USER_EXCLUDE = 'big_segment_exclude';
|
|
|
17
17
|
class RedisBigSegmentStore {
|
|
18
18
|
// Logger is not currently used, but is included to reduce the chance of a
|
|
19
19
|
// compatibility break to add a log.
|
|
20
|
-
constructor(options,
|
|
21
|
-
this.
|
|
22
|
-
this.state = new RedisClientState_1.default(options);
|
|
20
|
+
constructor(options, _logger) {
|
|
21
|
+
this._state = new RedisClientState_1.default(options);
|
|
23
22
|
}
|
|
24
23
|
async getMetadata() {
|
|
25
|
-
const value = await this.
|
|
24
|
+
const value = await this._state.getClient().get(this._state.prefixedKey(exports.KEY_LAST_SYNCHRONIZED));
|
|
26
25
|
// Value will be true if it is a string containing any characters, which is fine
|
|
27
26
|
// for this check.
|
|
28
27
|
if (value) {
|
|
@@ -31,12 +30,12 @@ class RedisBigSegmentStore {
|
|
|
31
30
|
return {};
|
|
32
31
|
}
|
|
33
32
|
async getUserMembership(userHash) {
|
|
34
|
-
const includedRefs = await this.
|
|
33
|
+
const includedRefs = await this._state
|
|
35
34
|
.getClient()
|
|
36
|
-
.smembers(this.
|
|
37
|
-
const excludedRefs = await this.
|
|
35
|
+
.smembers(this._state.prefixedKey(`${exports.KEY_USER_INCLUDE}:${userHash}`));
|
|
36
|
+
const excludedRefs = await this._state
|
|
38
37
|
.getClient()
|
|
39
|
-
.smembers(this.
|
|
38
|
+
.smembers(this._state.prefixedKey(`${exports.KEY_USER_EXCLUDE}:${userHash}`));
|
|
40
39
|
// If there are no included/excluded refs, the don't return any membership.
|
|
41
40
|
if ((!includedRefs || !includedRefs.length) && (!excludedRefs || !excludedRefs.length)) {
|
|
42
41
|
return undefined;
|
|
@@ -51,7 +50,7 @@ class RedisBigSegmentStore {
|
|
|
51
50
|
return membership;
|
|
52
51
|
}
|
|
53
52
|
close() {
|
|
54
|
-
this.
|
|
53
|
+
this._state.close();
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
exports.default = RedisBigSegmentStore;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,YAAY,OAAwB,EAAE,OAAkB;QAC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,CAAC,GAAG,EAAE,EAAE;YAC5B,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF;AAjDD,uCAiDC"}
|
|
@@ -17,47 +17,47 @@ class RedisClientState {
|
|
|
17
17
|
* @param owned Is this client owned by the store integration, or was it
|
|
18
18
|
* provided externally.
|
|
19
19
|
*/
|
|
20
|
-
constructor(options,
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
20
|
+
constructor(options, _logger) {
|
|
21
|
+
this._logger = _logger;
|
|
22
|
+
this._connected = false;
|
|
23
|
+
this._attempt = 0;
|
|
24
|
+
this._initialConnection = true;
|
|
25
25
|
if (options === null || options === void 0 ? void 0 : options.client) {
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
26
|
+
this._client = options.client;
|
|
27
|
+
this._owned = false;
|
|
28
28
|
}
|
|
29
29
|
else if (options === null || options === void 0 ? void 0 : options.redisOpts) {
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
30
|
+
this._client = new ioredis_1.Redis(options.redisOpts);
|
|
31
|
+
this._owned = true;
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
34
|
+
this._client = new ioredis_1.Redis();
|
|
35
|
+
this._owned = true;
|
|
36
36
|
}
|
|
37
|
-
this.
|
|
37
|
+
this._basePrefix = (options === null || options === void 0 ? void 0 : options.prefix) || DEFAULT_PREFIX;
|
|
38
38
|
// If the client is not owned, then it should already be connected.
|
|
39
|
-
this.
|
|
39
|
+
this._connected = !this._owned;
|
|
40
40
|
// We don't want to log a message on the first connection, only when reconnecting.
|
|
41
|
-
this.
|
|
42
|
-
const { client } = this;
|
|
41
|
+
this._initialConnection = !this._connected;
|
|
42
|
+
const { _client: client } = this;
|
|
43
43
|
client.on('error', (err) => {
|
|
44
|
-
|
|
44
|
+
_logger === null || _logger === void 0 ? void 0 : _logger.error(`Redis error - ${err}`);
|
|
45
45
|
});
|
|
46
46
|
client.on('reconnecting', (delay) => {
|
|
47
|
-
this.
|
|
48
|
-
|
|
47
|
+
this._attempt += 1;
|
|
48
|
+
_logger === null || _logger === void 0 ? void 0 : _logger.info(`Attempting to reconnect to redis (attempt # ${this._attempt}, delay: ${delay}ms)`);
|
|
49
49
|
});
|
|
50
50
|
client.on('connect', () => {
|
|
51
51
|
var _a;
|
|
52
|
-
this.
|
|
53
|
-
if (!this.
|
|
54
|
-
(_a = this === null || this === void 0 ? void 0 : this.
|
|
52
|
+
this._attempt = 0;
|
|
53
|
+
if (!this._initialConnection) {
|
|
54
|
+
(_a = this === null || this === void 0 ? void 0 : this._logger) === null || _a === void 0 ? void 0 : _a.warn('Reconnecting to Redis');
|
|
55
55
|
}
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
56
|
+
this._initialConnection = false;
|
|
57
|
+
this._connected = true;
|
|
58
58
|
});
|
|
59
59
|
client.on('end', () => {
|
|
60
|
-
this.
|
|
60
|
+
this._connected = false;
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
@@ -66,7 +66,7 @@ class RedisClientState {
|
|
|
66
66
|
* @returns True if currently connected.
|
|
67
67
|
*/
|
|
68
68
|
isConnected() {
|
|
69
|
-
return this.
|
|
69
|
+
return this._connected;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Get is the client is using its initial connection.
|
|
@@ -74,7 +74,7 @@ class RedisClientState {
|
|
|
74
74
|
* @returns True if using the initial connection.
|
|
75
75
|
*/
|
|
76
76
|
isInitialConnection() {
|
|
77
|
-
return this.
|
|
77
|
+
return this._initialConnection;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Get the redis client.
|
|
@@ -82,17 +82,17 @@ class RedisClientState {
|
|
|
82
82
|
* @returns The redis client.
|
|
83
83
|
*/
|
|
84
84
|
getClient() {
|
|
85
|
-
return this.
|
|
85
|
+
return this._client;
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* If the client is owned, then this will 'quit' the client.
|
|
89
89
|
*/
|
|
90
90
|
close() {
|
|
91
|
-
if (this.
|
|
92
|
-
this.
|
|
91
|
+
if (this._owned) {
|
|
92
|
+
this._client.quit().catch((err) => {
|
|
93
93
|
var _a;
|
|
94
94
|
// Not any action that can be taken for an error on quit.
|
|
95
|
-
(_a = this.
|
|
95
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.debug('Error closing ioredis client:', err);
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -102,7 +102,7 @@ class RedisClientState {
|
|
|
102
102
|
* @returns The prefixed key.
|
|
103
103
|
*/
|
|
104
104
|
prefixedKey(key) {
|
|
105
|
-
return `${this.
|
|
105
|
+
return `${this._basePrefix}:${key}`;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
exports.default = RedisClientState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisClientState.js","sourceRoot":"","sources":["../../src/RedisClientState.ts"],"names":[],"mappings":";;AAAA,qCAAgC;AAMhC,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC;;;;;;GAMG;AACH,MAAqB,gBAAgB;IAanC;;;;;;OAMG;IACH,YACE,OAAwB,EACP,
|
|
1
|
+
{"version":3,"file":"RedisClientState.js","sourceRoot":"","sources":["../../src/RedisClientState.ts"],"names":[],"mappings":";;AAAA,qCAAgC;AAMhC,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC;;;;;;GAMG;AACH,MAAqB,gBAAgB;IAanC;;;;;;OAMG;IACH,YACE,OAAwB,EACP,OAAkB;QAAlB,YAAO,GAAP,OAAO,CAAW;QArB7B,eAAU,GAAY,KAAK,CAAC;QAE5B,aAAQ,GAAW,CAAC,CAAC;QAErB,uBAAkB,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|
|
24
24
|
class RedisCore {
|
|
25
|
-
constructor(
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
25
|
+
constructor(_state, _logger) {
|
|
26
|
+
this._state = _state;
|
|
27
|
+
this._logger = _logger;
|
|
28
|
+
this._initedKey = this._state.prefixedKey('$inited');
|
|
29
29
|
}
|
|
30
30
|
init(allData, callback) {
|
|
31
|
-
const multi = this.
|
|
31
|
+
const multi = this._state.getClient().multi();
|
|
32
32
|
allData.forEach((keyedItems) => {
|
|
33
33
|
const kind = keyedItems.key;
|
|
34
34
|
const items = keyedItems.item;
|
|
35
|
-
const namespaceKey = this.
|
|
35
|
+
const namespaceKey = this._state.prefixedKey(kind.namespace);
|
|
36
36
|
// Delete the namespace for the kind.
|
|
37
37
|
multi.del(namespaceKey);
|
|
38
38
|
const namespaceContent = {};
|
|
@@ -47,26 +47,26 @@ class RedisCore {
|
|
|
47
47
|
multi.hmset(namespaceKey, namespaceContent);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
multi.set(this.
|
|
50
|
+
multi.set(this._initedKey, '');
|
|
51
51
|
multi.exec((err) => {
|
|
52
52
|
var _a;
|
|
53
53
|
if (err) {
|
|
54
|
-
(_a = this.
|
|
54
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.error(`Error initializing Redis store ${err}`);
|
|
55
55
|
}
|
|
56
56
|
callback();
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
get(kind, key, callback) {
|
|
60
60
|
var _a;
|
|
61
|
-
if (!this.
|
|
62
|
-
(_a = this.
|
|
61
|
+
if (!this._state.isConnected() && !this._state.isInitialConnection()) {
|
|
62
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.warn(`Attempted to fetch key '${key}' while Redis connection is down`);
|
|
63
63
|
callback(undefined);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
this.
|
|
66
|
+
this._state.getClient().hget(this._state.prefixedKey(kind.namespace), key, (err, val) => {
|
|
67
67
|
var _a;
|
|
68
68
|
if (err) {
|
|
69
|
-
(_a = this.
|
|
69
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.error(`Error fetching key '${key}' from Redis in '${kind.namespace}' ${err}`);
|
|
70
70
|
callback(undefined);
|
|
71
71
|
}
|
|
72
72
|
else if (val) {
|
|
@@ -85,15 +85,15 @@ class RedisCore {
|
|
|
85
85
|
}
|
|
86
86
|
getAll(kind, callback) {
|
|
87
87
|
var _a;
|
|
88
|
-
if (!this.
|
|
89
|
-
(_a = this.
|
|
88
|
+
if (!this._state.isConnected() && !this._state.isInitialConnection()) {
|
|
89
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.warn('Attempted to fetch all keys while Redis connection is down');
|
|
90
90
|
callback(undefined);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
this.
|
|
93
|
+
this._state.getClient().hgetall(this._state.prefixedKey(kind.namespace), (err, values) => {
|
|
94
94
|
var _a;
|
|
95
95
|
if (err) {
|
|
96
|
-
(_a = this.
|
|
96
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.error(`Error fetching '${kind.namespace}' from Redis ${err}`);
|
|
97
97
|
}
|
|
98
98
|
else if (values) {
|
|
99
99
|
const results = [];
|
|
@@ -113,8 +113,8 @@ class RedisCore {
|
|
|
113
113
|
upsert(kind, key, descriptor, callback) {
|
|
114
114
|
// The persistent store wrapper manages interactions with a queue, so we can use watch like
|
|
115
115
|
// this without concerns for overlapping transactions.
|
|
116
|
-
this.
|
|
117
|
-
const multi = this.
|
|
116
|
+
this._state.getClient().watch(this._state.prefixedKey(kind.namespace));
|
|
117
|
+
const multi = this._state.getClient().multi();
|
|
118
118
|
this.get(kind, key, (old) => {
|
|
119
119
|
var _a;
|
|
120
120
|
if (old === null || old === void 0 ? void 0 : old.serializedItem) {
|
|
@@ -134,15 +134,15 @@ class RedisCore {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
if (descriptor.deleted) {
|
|
137
|
-
multi.hset(this.
|
|
137
|
+
multi.hset(this._state.prefixedKey(kind.namespace), key, JSON.stringify({ version: descriptor.version, deleted: true }));
|
|
138
138
|
}
|
|
139
139
|
else if (descriptor.serializedItem) {
|
|
140
|
-
multi.hset(this.
|
|
140
|
+
multi.hset(this._state.prefixedKey(kind.namespace), key, descriptor.serializedItem);
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
143
|
// This call violates the contract.
|
|
144
144
|
multi.discard();
|
|
145
|
-
(_a = this.
|
|
145
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.error('Attempt to write a non-deleted item without data to Redis.');
|
|
146
146
|
callback(undefined, undefined);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
@@ -150,7 +150,7 @@ class RedisCore {
|
|
|
150
150
|
var _a;
|
|
151
151
|
if (!err && (replies === null || replies === undefined)) {
|
|
152
152
|
// This means the EXEC failed because someone modified the watched key
|
|
153
|
-
(_a = this.
|
|
153
|
+
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.debug('Concurrent modification detected, retrying');
|
|
154
154
|
this.upsert(kind, key, descriptor, callback);
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
@@ -160,14 +160,14 @@ class RedisCore {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
initialized(callback) {
|
|
163
|
-
this.
|
|
163
|
+
this._state.getClient().exists(this._initedKey, (err, count) => {
|
|
164
164
|
// Initialized if there is not an error and the key does exists.
|
|
165
165
|
// (A count >= 1)
|
|
166
166
|
callback(!!(!err && count));
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
close() {
|
|
170
|
-
this.
|
|
170
|
+
this._state.close();
|
|
171
171
|
}
|
|
172
172
|
getDescription() {
|
|
173
173
|
return 'Redis';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisCore.js","sourceRoot":"","sources":["../../src/RedisCore.ts"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;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9 +4,8 @@ import LDRedisOptions from './LDRedisOptions';
|
|
|
4
4
|
* Integration between the LaunchDarkly SDK and Redis.
|
|
5
5
|
*/
|
|
6
6
|
export default class RedisFeatureStore implements LDFeatureStore {
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
constructor(options?: LDRedisOptions, logger?: LDLogger | undefined);
|
|
7
|
+
private _wrapper;
|
|
8
|
+
constructor(options?: LDRedisOptions, logger?: LDLogger);
|
|
10
9
|
get(kind: interfaces.DataKind, key: string, callback: (res: LDFeatureStoreItem | null) => void): void;
|
|
11
10
|
all(kind: interfaces.DataKind, callback: (res: LDFeatureStoreKindData) => void): void;
|
|
12
11
|
init(allData: LDFeatureStoreDataStorage, callback: () => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisFeatureStore.d.ts","sourceRoot":"","sources":["../../src/RedisFeatureStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,EAET,MAAM,+BAA+B,CAAC;AAEvC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAK9C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"RedisFeatureStore.d.ts","sourceRoot":"","sources":["../../src/RedisFeatureStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,EAET,MAAM,+BAA+B,CAAC;AAEvC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAK9C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,cAAc;IAC9D,OAAO,CAAC,QAAQ,CAA6B;gBAEjC,OAAO,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ;IAOvD,GAAG,CACD,IAAI,EAAE,UAAU,CAAC,QAAQ,EACzB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,GACjD,IAAI;IAIP,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,sBAAsB,KAAK,IAAI,GAAG,IAAI;IAIrF,IAAI,CAAC,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIpE,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAI3F,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAI5F,WAAW,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;IAI7D,KAAK,IAAI,IAAI;IAIb,cAAc,CAAC,IAAI,MAAM;CAG1B"}
|
|
@@ -9,32 +9,31 @@ const TtlFromOptions_1 = require("./TtlFromOptions");
|
|
|
9
9
|
*/
|
|
10
10
|
class RedisFeatureStore {
|
|
11
11
|
constructor(options, logger) {
|
|
12
|
-
this.
|
|
13
|
-
this.wrapper = new node_server_sdk_1.PersistentDataStoreWrapper(new RedisCore_1.default(new RedisClientState_1.default(options, logger), logger), (0, TtlFromOptions_1.default)(options));
|
|
12
|
+
this._wrapper = new node_server_sdk_1.PersistentDataStoreWrapper(new RedisCore_1.default(new RedisClientState_1.default(options, logger), logger), (0, TtlFromOptions_1.default)(options));
|
|
14
13
|
}
|
|
15
14
|
get(kind, key, callback) {
|
|
16
|
-
this.
|
|
15
|
+
this._wrapper.get(kind, key, callback);
|
|
17
16
|
}
|
|
18
17
|
all(kind, callback) {
|
|
19
|
-
this.
|
|
18
|
+
this._wrapper.all(kind, callback);
|
|
20
19
|
}
|
|
21
20
|
init(allData, callback) {
|
|
22
|
-
this.
|
|
21
|
+
this._wrapper.init(allData, callback);
|
|
23
22
|
}
|
|
24
23
|
delete(kind, key, version, callback) {
|
|
25
|
-
this.
|
|
24
|
+
this._wrapper.delete(kind, key, version, callback);
|
|
26
25
|
}
|
|
27
26
|
upsert(kind, data, callback) {
|
|
28
|
-
this.
|
|
27
|
+
this._wrapper.upsert(kind, data, callback);
|
|
29
28
|
}
|
|
30
29
|
initialized(callback) {
|
|
31
|
-
this.
|
|
30
|
+
this._wrapper.initialized(callback);
|
|
32
31
|
}
|
|
33
32
|
close() {
|
|
34
|
-
this.
|
|
33
|
+
this._wrapper.close();
|
|
35
34
|
}
|
|
36
35
|
getDescription() {
|
|
37
|
-
return this.
|
|
36
|
+
return this._wrapper.getDescription();
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
exports.default = RedisFeatureStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisFeatureStore.js","sourceRoot":"","sources":["../../src/RedisFeatureStore.ts"],"names":[],"mappings":";;AAAA,mEASuC;AAGvC,yDAAkD;AAClD,2CAAoC;AACpC,qDAA8C;AAE9C;;GAEG;AACH,MAAqB,iBAAiB;IAGpC,
|
|
1
|
+
{"version":3,"file":"RedisFeatureStore.js","sourceRoot":"","sources":["../../src/RedisFeatureStore.ts"],"names":[],"mappings":";;AAAA,mEASuC;AAGvC,yDAAkD;AAClD,2CAAoC;AACpC,qDAA8C;AAE9C;;GAEG;AACH,MAAqB,iBAAiB;IAGpC,YAAY,OAAwB,EAAE,MAAiB;QACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,4CAA0B,CAC5C,IAAI,mBAAS,CAAC,IAAI,0BAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAC5D,IAAA,wBAAc,EAAC,OAAO,CAAC,CACxB,CAAC;IACJ,CAAC;IAED,GAAG,CACD,IAAyB,EACzB,GAAW,EACX,QAAkD;QAElD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,GAAG,CAAC,IAAyB,EAAE,QAA+C;QAC5E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,OAAkC,EAAE,QAAoB;QAC3D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,IAAyB,EAAE,GAAW,EAAE,OAAe,EAAE,QAAoB;QAClF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,IAAyB,EAAE,IAA6B,EAAE,QAAoB;QACnF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,WAAW,CAAC,QAA0C;QACpD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;IACxC,CAAC;CACF;AA7CD,oCA6CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchdarkly/node-server-sdk-redis",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
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": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@launchdarkly/node-server-sdk": ">=9.4.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@launchdarkly/node-server-sdk": "9.
|
|
36
|
+
"@launchdarkly/node-server-sdk": "9.7.0",
|
|
37
37
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
38
38
|
"@types/jest": "^29.4.0",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^6.20.0",
|