@node-c/persistance-redis 1.0.0-alpha15 → 1.0.0-alpha16
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.
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import { RedisClientType } from 'redis';
|
|
2
1
|
export interface GetOptions {
|
|
3
2
|
parseToJSON?: boolean;
|
|
4
3
|
}
|
|
5
|
-
export type RedisClientScanMethod = (_key: string, _cursor: number, _options?: {
|
|
6
|
-
count?: number;
|
|
7
|
-
match: string;
|
|
8
|
-
}) => Promise<{
|
|
9
|
-
cursor: number;
|
|
10
|
-
keys?: string[];
|
|
11
|
-
tuples?: {
|
|
12
|
-
field: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
}>;
|
|
16
4
|
export interface RedisStoreModuleOptions {
|
|
17
5
|
persistanceModuleName: string;
|
|
18
6
|
}
|
|
19
|
-
export type RedisTransaction = ReturnType<RedisClientType['multi']>;
|
|
20
7
|
export interface ScanOptions {
|
|
21
8
|
count?: number;
|
|
22
9
|
cursor?: number;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { AppConfig, ConfigProviderService, GenericObject } from '@node-c/core';
|
|
2
|
-
import {
|
|
3
|
-
import { GetOptions,
|
|
2
|
+
import Redis, { ChainableCommander, Cluster } from 'ioredis';
|
|
3
|
+
import { GetOptions, ScanOptions, SetOptions, StoreDeleteOptions } from './redis.store.definitions';
|
|
4
4
|
export declare class RedisStoreService {
|
|
5
5
|
protected configProvider: ConfigProviderService;
|
|
6
|
-
protected client:
|
|
6
|
+
protected client: Redis | Cluster;
|
|
7
7
|
protected persistanceModuleName: string;
|
|
8
8
|
protected defaultTTL?: number;
|
|
9
9
|
protected storeDelimiter: string;
|
|
10
10
|
protected storeKey: string;
|
|
11
|
-
protected transactions: GenericObject<
|
|
11
|
+
protected transactions: GenericObject<ChainableCommander>;
|
|
12
12
|
protected useHashmap: boolean;
|
|
13
|
-
constructor(configProvider: ConfigProviderService, client:
|
|
13
|
+
constructor(configProvider: ConfigProviderService, client: Redis | Cluster, persistanceModuleName: string);
|
|
14
14
|
static createClient(config: AppConfig, options: {
|
|
15
15
|
persistanceModuleName: string;
|
|
16
|
-
}): Promise<
|
|
16
|
+
}): Promise<Redis | Cluster>;
|
|
17
17
|
createTransaction(): string;
|
|
18
18
|
delete(handle: string | string[], options?: StoreDeleteOptions): Promise<number>;
|
|
19
19
|
endTransaction(transactionId: string): Promise<void>;
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
8
41
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
42
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
43
|
};
|
|
@@ -24,7 +57,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
57
|
exports.RedisStoreService = void 0;
|
|
25
58
|
const common_1 = require("@nestjs/common");
|
|
26
59
|
const core_1 = require("@node-c/core");
|
|
27
|
-
const
|
|
60
|
+
const ioredis_1 = __importStar(require("ioredis"));
|
|
28
61
|
const uuid_1 = require("uuid");
|
|
29
62
|
const definitions_1 = require("../common/definitions");
|
|
30
63
|
let RedisStoreService = class RedisStoreService {
|
|
@@ -48,23 +81,23 @@ let RedisStoreService = class RedisStoreService {
|
|
|
48
81
|
const actualPort = port || 6379;
|
|
49
82
|
const actualUser = user || 'default';
|
|
50
83
|
if (clusterMode) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
]
|
|
84
|
+
const hostList = actualHost.split(',');
|
|
85
|
+
const portList = `${actualPort}`.split(',');
|
|
86
|
+
const nodeList = hostList.map((hostAddress, hostIndex) => {
|
|
87
|
+
return { host: hostAddress, port: parseInt(portList[hostIndex] || portList[0], 10) };
|
|
88
|
+
});
|
|
89
|
+
const client = new ioredis_1.Cluster(nodeList, {
|
|
90
|
+
lazyConnect: true,
|
|
91
|
+
redisOptions: { password: actualPassword, username: actualUser }
|
|
61
92
|
});
|
|
62
93
|
yield client.connect();
|
|
63
94
|
return client;
|
|
64
95
|
}
|
|
65
|
-
const client =
|
|
96
|
+
const client = new ioredis_1.default({
|
|
97
|
+
host: actualHost,
|
|
98
|
+
lazyConnect: true,
|
|
66
99
|
password: actualPassword,
|
|
67
|
-
|
|
100
|
+
port: actualPort,
|
|
68
101
|
username: actualUser
|
|
69
102
|
});
|
|
70
103
|
yield client.connect();
|
|
@@ -87,12 +120,12 @@ let RedisStoreService = class RedisStoreService {
|
|
|
87
120
|
throw new core_1.ApplicationError(`[RedisStoreService][Error]: Transaction with id "${transactionId}" not found.`);
|
|
88
121
|
}
|
|
89
122
|
transactions[transactionId] = useHashmap
|
|
90
|
-
? transaction.
|
|
123
|
+
? transaction.hdel(storeKey, ...handles)
|
|
91
124
|
: transaction.del(handles.map(handleItem => `${storeKey}${storeDelimiter}${handleItem}`));
|
|
92
125
|
return 0;
|
|
93
126
|
}
|
|
94
127
|
return useHashmap
|
|
95
|
-
? yield client.
|
|
128
|
+
? yield client.hdel(storeKey, ...handles)
|
|
96
129
|
: yield client.del(handles.map(handleItem => `${storeKey}${storeDelimiter}${handleItem}`));
|
|
97
130
|
});
|
|
98
131
|
}
|
|
@@ -112,7 +145,7 @@ let RedisStoreService = class RedisStoreService {
|
|
|
112
145
|
const { client, storeDelimiter, storeKey, useHashmap } = this;
|
|
113
146
|
const { parseToJSON } = options || {};
|
|
114
147
|
const value = useHashmap
|
|
115
|
-
? yield client.
|
|
148
|
+
? yield client.hget(storeKey, handle)
|
|
116
149
|
: yield client.get(`${storeKey}${storeDelimiter}${handle}`);
|
|
117
150
|
return parseToJSON && typeof value === 'string' ? JSON.parse(value) : value;
|
|
118
151
|
});
|
|
@@ -122,20 +155,24 @@ let RedisStoreService = class RedisStoreService {
|
|
|
122
155
|
const { client, storeDelimiter, storeKey, useHashmap } = this;
|
|
123
156
|
const { count, cursor: optCursor, parseToJSON, scanAll, withValues } = options;
|
|
124
157
|
const getValues = typeof withValues === 'undefined' || withValues === true;
|
|
125
|
-
const
|
|
126
|
-
? client.hScan.bind(client)
|
|
127
|
-
: client.hScanNoValues.bind(client));
|
|
158
|
+
const values = [];
|
|
128
159
|
let cursor = 0;
|
|
129
160
|
let keys = [];
|
|
130
161
|
let parsedValues = [];
|
|
131
|
-
let values = [];
|
|
132
162
|
if (scanAll) {
|
|
133
163
|
if (useHashmap) {
|
|
134
164
|
while (true) {
|
|
135
|
-
const
|
|
136
|
-
cursor = newCursor;
|
|
137
|
-
if (
|
|
138
|
-
|
|
165
|
+
const [newCursor, newKeys] = yield client.hscan(storeKey, cursor, 'MATCH', handle, ...(typeof count !== 'undefined' ? ['COUNT', count] : []));
|
|
166
|
+
cursor = parseInt(newCursor, 10);
|
|
167
|
+
if (getValues) {
|
|
168
|
+
for (const i in newKeys) {
|
|
169
|
+
const key = newKeys[i];
|
|
170
|
+
const value = yield client.hget(storeKey, key);
|
|
171
|
+
if (value === null) {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
values.push({ field: key, value });
|
|
175
|
+
}
|
|
139
176
|
}
|
|
140
177
|
else {
|
|
141
178
|
keys = keys.concat(newKeys);
|
|
@@ -147,10 +184,8 @@ let RedisStoreService = class RedisStoreService {
|
|
|
147
184
|
}
|
|
148
185
|
else {
|
|
149
186
|
while (true) {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
cursor = newCursor;
|
|
187
|
+
const [newCursor, newKeys] = yield client.scan(cursor, 'MATCH', `${storeKey}${storeDelimiter}${handle}`);
|
|
188
|
+
cursor = parseInt(newCursor, 10);
|
|
154
189
|
if (getValues) {
|
|
155
190
|
for (const i in newKeys) {
|
|
156
191
|
const key = newKeys[i];
|
|
@@ -175,23 +210,25 @@ let RedisStoreService = class RedisStoreService {
|
|
|
175
210
|
throw new core_1.ApplicationError('The "count" options is required when the "findAll" options is not positive.');
|
|
176
211
|
}
|
|
177
212
|
if (useHashmap) {
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
213
|
+
const [newCursor, newKeys] = yield client.hscan(storeKey, optCursor || 0, 'MATCH', handle, 'COUNT', count);
|
|
214
|
+
cursor = parseInt(newCursor, 10);
|
|
215
|
+
if (getValues) {
|
|
216
|
+
for (const i in newKeys) {
|
|
217
|
+
const key = newKeys[i];
|
|
218
|
+
const value = yield client.get(key);
|
|
219
|
+
if (value === null) {
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
values.push({ field: key, value });
|
|
223
|
+
}
|
|
184
224
|
}
|
|
185
225
|
else {
|
|
186
226
|
keys = keys.concat(newKeys);
|
|
187
227
|
}
|
|
188
228
|
}
|
|
189
229
|
else {
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
MATCH: `${storeKey}${storeDelimiter}${handle}`
|
|
193
|
-
});
|
|
194
|
-
cursor = newCursor;
|
|
230
|
+
const [newCursor, newKeys] = yield client.scan(optCursor || 0, 'MATCH', `${storeKey}${storeDelimiter}${handle}`, 'COUNT', count);
|
|
231
|
+
cursor = parseInt(newCursor, 10);
|
|
195
232
|
if (getValues) {
|
|
196
233
|
for (const i in newKeys) {
|
|
197
234
|
const key = newKeys[i];
|
|
@@ -235,7 +272,7 @@ let RedisStoreService = class RedisStoreService {
|
|
|
235
272
|
throw new core_1.ApplicationError(`[RedisStoreService][Error]: Transaction with id "${transactionId}" not found.`);
|
|
236
273
|
}
|
|
237
274
|
if (useHashmap) {
|
|
238
|
-
transactions[transactionId] = transaction.
|
|
275
|
+
transactions[transactionId] = transaction.hset(this.storeKey, handle, valueToSet);
|
|
239
276
|
}
|
|
240
277
|
else {
|
|
241
278
|
const fullKey = `${storeKey}${storeDelimiter}${handle}`;
|
|
@@ -248,7 +285,7 @@ let RedisStoreService = class RedisStoreService {
|
|
|
248
285
|
}
|
|
249
286
|
let result;
|
|
250
287
|
if (useHashmap) {
|
|
251
|
-
result = yield client.
|
|
288
|
+
result = yield client.hset(storeKey, handle, valueToSet);
|
|
252
289
|
}
|
|
253
290
|
else {
|
|
254
291
|
const fullKey = `${storeKey}${storeDelimiter}${handle}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.store.service.js","sourceRoot":"","sources":["../../src/store/redis.store.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redis.store.service.js","sourceRoot":"","sources":["../../src/store/redis.store.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,uCAMsB;AAEtB,mDAA6D;AAC7D,+BAAkC;AAIlC,uDAAkD;AAM3C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAO5B,YAEY,cAAqC,EAGrC,MAAuB,EAEvB,qBAA6B;QAL7B,mBAAc,GAAd,cAAc,CAAuB;QAGrC,WAAM,GAAN,MAAM,CAAiB;QAEvB,0BAAqB,GAArB,qBAAqB,CAAQ;QAEvC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,WAAW,CAC5F,qBAAqB,CACO,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,uBAAS,CAAC,uBAAuB,CAAC;QAC1E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAA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D,CAAC;YACH,CAAC;YACD,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;gBACpC,MAAM,IAAI,uBAAgB,CAAC,yDAAyD,MAAM,cAAc,MAAM,EAAE,CAAC,CAAC;YACpH,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AAlRY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAWR,WAAA,IAAA,eAAM,EAAC,uBAAS,CAAC,YAAY,CAAC,CAAA;IAG9B,WAAA,IAAA,eAAM,EAAC,uBAAS,CAAC,oCAAoC,CAAC,CAAA;qCAJ7B,4BAAqB;GATtC,iBAAiB,CAkR7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-c/persistance-redis",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-alpha16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@nestjs/common": "^10.4.9",
|
|
16
|
-
"@node-c/core": "^1.0.0-
|
|
16
|
+
"@node-c/core": "^1.0.0-alpha16",
|
|
17
17
|
"class-validator": "^0.14.1",
|
|
18
18
|
"immutable": "^5.1.3",
|
|
19
|
+
"ioredis": "^5.6.1",
|
|
19
20
|
"ramda": "^0.30.1",
|
|
20
|
-
"redis": "^4.7.0",
|
|
21
21
|
"uuid": "^11.0.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|