@valkey/valkey-glide 1.3.5-rc9 → 2.0.0-rc7
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/README.md +18 -7
- package/build-ts/BaseClient.d.ts +125 -22
- package/build-ts/BaseClient.js +293 -250
- package/build-ts/Batch.d.ts +10 -10
- package/build-ts/Batch.js +234 -234
- package/build-ts/Commands.d.ts +14 -2
- package/build-ts/Commands.js +24 -12
- package/build-ts/Errors.js +1 -0
- package/build-ts/GlideClient.d.ts +7 -38
- package/build-ts/GlideClient.js +56 -55
- package/build-ts/GlideClusterClient.d.ts +12 -4
- package/build-ts/GlideClusterClient.js +60 -54
- package/build-ts/Logger.d.ts +30 -15
- package/build-ts/Logger.js +36 -24
- package/build-ts/OpenTelemetry.d.ts +101 -0
- package/build-ts/OpenTelemetry.js +134 -0
- package/build-ts/ProtobufMessage.d.ts +22 -82
- package/build-ts/ProtobufMessage.js +59 -176
- package/build-ts/index.d.ts +2 -2
- package/build-ts/index.js +2 -25
- package/build-ts/native.d.ts +158 -14
- package/build-ts/native.js +134 -105
- package/build-ts/server-modules/GlideFt.d.ts +1 -4
- package/build-ts/server-modules/GlideFt.js +10 -11
- package/build-ts/server-modules/GlideFtOptions.d.ts +1 -2
- package/build-ts/server-modules/GlideJson.d.ts +3 -5
- package/build-ts/server-modules/GlideJson.js +2 -2
- package/package.json +7 -7
package/build-ts/Batch.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Transaction = exports.ClusterTransaction = exports.ClusterBatch = exports.Batch = exports.BaseBatch = void 0;
|
|
7
|
-
const
|
|
8
|
-
const Commands_1 = require("./Commands");
|
|
7
|
+
const _1 = require(".");
|
|
9
8
|
/**
|
|
10
9
|
* Base class encompassing shared commands for both standalone and cluster mode implementations in a Batch.
|
|
11
10
|
* Batches allow the execution of a group of commands in a single step.
|
|
@@ -20,6 +19,16 @@ const Commands_1 = require("./Commands");
|
|
|
20
19
|
* If `false`, the batch will be executed as a non-atomic pipeline.
|
|
21
20
|
*/
|
|
22
21
|
class BaseBatch {
|
|
22
|
+
isAtomic;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
commands = [];
|
|
27
|
+
/**
|
|
28
|
+
* Array of command indexes indicating commands that need to be converted into a `Set` within the batch.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
setCommandsIndexes = [];
|
|
23
32
|
/**
|
|
24
33
|
* @param isAtomic - Determines whether the batch is atomic or non-atomic. If `true`, the
|
|
25
34
|
* batch will be executed as an atomic `transaction`. If `false`, the batch will be
|
|
@@ -27,15 +36,6 @@ class BaseBatch {
|
|
|
27
36
|
*/
|
|
28
37
|
constructor(isAtomic) {
|
|
29
38
|
this.isAtomic = isAtomic;
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
this.commands = [];
|
|
34
|
-
/**
|
|
35
|
-
* Array of command indexes indicating commands that need to be converted into a `Set` within the batch.
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
this.setCommandsIndexes = [];
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Adds a command to the batch and returns the batch instance.
|
|
@@ -59,7 +59,7 @@ class BaseBatch {
|
|
|
59
59
|
* Command Response - If `key` exists, returns the value of `key`. Otherwise, return `null`.
|
|
60
60
|
*/
|
|
61
61
|
get(key) {
|
|
62
|
-
return this.addAndReturn((0,
|
|
62
|
+
return this.addAndReturn((0, _1.createGet)(key));
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Get the value of `key` and optionally set its expiration. `GETEX` is similar to {@link get}.
|
|
@@ -75,7 +75,7 @@ class BaseBatch {
|
|
|
75
75
|
* Command Response - If `key` exists, returns the value of `key` as a `string`. Otherwise, return `null`.
|
|
76
76
|
*/
|
|
77
77
|
getex(key, options) {
|
|
78
|
-
return this.addAndReturn((0,
|
|
78
|
+
return this.addAndReturn((0, _1.createGetEx)(key, options));
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Gets a string value associated with the given `key`and deletes the key.
|
|
@@ -87,7 +87,7 @@ class BaseBatch {
|
|
|
87
87
|
* Command Response - If `key` exists, returns the `value` of `key`. Otherwise, return `null`.
|
|
88
88
|
*/
|
|
89
89
|
getdel(key) {
|
|
90
|
-
return this.addAndReturn((0,
|
|
90
|
+
return this.addAndReturn((0, _1.createGetDel)(key));
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Returns the substring of the string value stored at `key`, determined by the byte offsets
|
|
@@ -105,7 +105,7 @@ class BaseBatch {
|
|
|
105
105
|
* Command Response - substring extracted from the value stored at `key`.
|
|
106
106
|
*/
|
|
107
107
|
getrange(key, start, end) {
|
|
108
|
-
return this.addAndReturn((0,
|
|
108
|
+
return this.addAndReturn((0, _1.createGetRange)(key, start, end));
|
|
109
109
|
}
|
|
110
110
|
/** Set the given key with the given value. Return value is dependent on the passed options.
|
|
111
111
|
* @see {@link https://valkey.io/commands/set/|valkey.io} for details.
|
|
@@ -119,7 +119,7 @@ class BaseBatch {
|
|
|
119
119
|
* If `returnOldValue` is set, return the old value as a string.
|
|
120
120
|
*/
|
|
121
121
|
set(key, value, options) {
|
|
122
|
-
return this.addAndReturn((0,
|
|
122
|
+
return this.addAndReturn((0, _1.createSet)(key, value, options));
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Pings the server.
|
|
@@ -133,7 +133,7 @@ class BaseBatch {
|
|
|
133
133
|
* Command Response - `"PONG"` if `message` is not provided, otherwise return a copy of `message`.
|
|
134
134
|
*/
|
|
135
135
|
ping(message) {
|
|
136
|
-
return this.addAndReturn((0,
|
|
136
|
+
return this.addAndReturn((0, _1.createPing)(message));
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Gets information and statistics about the server.
|
|
@@ -148,7 +148,7 @@ class BaseBatch {
|
|
|
148
148
|
* Command Response - A string containing the information for the sections requested.
|
|
149
149
|
*/
|
|
150
150
|
info(sections) {
|
|
151
|
-
return this.addAndReturn((0,
|
|
151
|
+
return this.addAndReturn((0, _1.createInfo)(sections));
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Removes the specified keys. A key is ignored if it does not exist.
|
|
@@ -160,7 +160,7 @@ class BaseBatch {
|
|
|
160
160
|
* Command Response - The number of keys that were removed.
|
|
161
161
|
*/
|
|
162
162
|
del(keys) {
|
|
163
|
-
return this.addAndReturn((0,
|
|
163
|
+
return this.addAndReturn((0, _1.createDel)(keys));
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Serialize the value stored at `key` in a Valkey-specific format and return it to the user.
|
|
@@ -173,7 +173,7 @@ class BaseBatch {
|
|
|
173
173
|
* Command Response - The serialized value of the data stored at `key`. If `key` does not exist, `null` will be returned.
|
|
174
174
|
*/
|
|
175
175
|
dump(key) {
|
|
176
|
-
return this.addAndReturn((0,
|
|
176
|
+
return this.addAndReturn((0, _1.createDump)(key));
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
179
|
* Create a `key` associated with a `value` that is obtained by deserializing the provided
|
|
@@ -190,7 +190,7 @@ class BaseBatch {
|
|
|
190
190
|
* Command Response - Return "OK" if the `key` was successfully restored with a `value`.
|
|
191
191
|
*/
|
|
192
192
|
restore(key, ttl, value, options) {
|
|
193
|
-
return this.addAndReturn((0,
|
|
193
|
+
return this.addAndReturn((0, _1.createRestore)(key, ttl, value, options));
|
|
194
194
|
}
|
|
195
195
|
/**
|
|
196
196
|
* Gets the name of the connection on which the batch is being executed.
|
|
@@ -200,7 +200,7 @@ class BaseBatch {
|
|
|
200
200
|
* Command Response - The name of the client connection as a string if a name is set, or null if no name is assigned.
|
|
201
201
|
*/
|
|
202
202
|
clientGetName() {
|
|
203
|
-
return this.addAndReturn((0,
|
|
203
|
+
return this.addAndReturn((0, _1.createClientGetName)());
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
206
|
* Rewrites the configuration file with the current configuration.
|
|
@@ -210,7 +210,7 @@ class BaseBatch {
|
|
|
210
210
|
* Command Response - "OK" when the configuration was rewritten properly. Otherwise, the command fails with an error.
|
|
211
211
|
*/
|
|
212
212
|
configRewrite() {
|
|
213
|
-
return this.addAndReturn((0,
|
|
213
|
+
return this.addAndReturn((0, _1.createConfigRewrite)());
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* Resets the statistics reported by Valkey using the `INFO` and `LATENCY HISTOGRAM` commands.
|
|
@@ -220,7 +220,7 @@ class BaseBatch {
|
|
|
220
220
|
* Command Response - always "OK".
|
|
221
221
|
*/
|
|
222
222
|
configResetStat() {
|
|
223
|
-
return this.addAndReturn((0,
|
|
223
|
+
return this.addAndReturn((0, _1.createConfigResetStat)());
|
|
224
224
|
}
|
|
225
225
|
/** Retrieve the values of multiple keys.
|
|
226
226
|
* @see {@link https://valkey.io/commands/mget/|valkey.io} for details.
|
|
@@ -231,7 +231,7 @@ class BaseBatch {
|
|
|
231
231
|
* its corresponding value in the list will be null.
|
|
232
232
|
*/
|
|
233
233
|
mget(keys) {
|
|
234
|
-
return this.addAndReturn((0,
|
|
234
|
+
return this.addAndReturn((0, _1.createMGet)(keys));
|
|
235
235
|
}
|
|
236
236
|
/** Set multiple keys to multiple values in a single atomic operation.
|
|
237
237
|
* @see {@link https://valkey.io/commands/mset/|valkey.io} for details.
|
|
@@ -241,7 +241,7 @@ class BaseBatch {
|
|
|
241
241
|
* Command Response - always "OK".
|
|
242
242
|
*/
|
|
243
243
|
mset(keysAndValues) {
|
|
244
|
-
return this.addAndReturn((0,
|
|
244
|
+
return this.addAndReturn((0, _1.createMSet)((0, _1.convertGlideRecord)(keysAndValues)));
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* Sets multiple keys to values if the key does not exist. The operation is atomic, and if one or
|
|
@@ -253,7 +253,7 @@ class BaseBatch {
|
|
|
253
253
|
* Command Response - `true` if all keys were set. `false` if no key was set.
|
|
254
254
|
*/
|
|
255
255
|
msetnx(keysAndValues) {
|
|
256
|
-
return this.addAndReturn((0,
|
|
256
|
+
return this.addAndReturn((0, _1.createMSetNX)((0, _1.convertGlideRecord)(keysAndValues)));
|
|
257
257
|
}
|
|
258
258
|
/** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
259
259
|
* @see {@link https://valkey.io/commands/incr/|valkey.io} for details.
|
|
@@ -263,7 +263,7 @@ class BaseBatch {
|
|
|
263
263
|
* Command Response - the value of `key` after the increment.
|
|
264
264
|
*/
|
|
265
265
|
incr(key) {
|
|
266
|
-
return this.addAndReturn((0,
|
|
266
|
+
return this.addAndReturn((0, _1.createIncr)(key));
|
|
267
267
|
}
|
|
268
268
|
/** Increments the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
|
|
269
269
|
* @see {@link https://valkey.io/commands/incrby/|valkey.io} for details.
|
|
@@ -274,7 +274,7 @@ class BaseBatch {
|
|
|
274
274
|
* Command Response - the value of `key` after the increment.
|
|
275
275
|
*/
|
|
276
276
|
incrBy(key, amount) {
|
|
277
|
-
return this.addAndReturn((0,
|
|
277
|
+
return this.addAndReturn((0, _1.createIncrBy)(key, amount));
|
|
278
278
|
}
|
|
279
279
|
/** Increment the string representing a floating point number stored at `key` by `amount`.
|
|
280
280
|
* By using a negative amount value, the result is that the value stored at `key` is decremented.
|
|
@@ -288,7 +288,7 @@ class BaseBatch {
|
|
|
288
288
|
*
|
|
289
289
|
*/
|
|
290
290
|
incrByFloat(key, amount) {
|
|
291
|
-
return this.addAndReturn((0,
|
|
291
|
+
return this.addAndReturn((0, _1.createIncrByFloat)(key, amount));
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Returns the current connection ID.
|
|
@@ -298,7 +298,7 @@ class BaseBatch {
|
|
|
298
298
|
* Command Response - The ID of the connection.
|
|
299
299
|
*/
|
|
300
300
|
clientId() {
|
|
301
|
-
return this.addAndReturn((0,
|
|
301
|
+
return this.addAndReturn((0, _1.createClientId)());
|
|
302
302
|
}
|
|
303
303
|
/** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
304
304
|
* @see {@link https://valkey.io/commands/decr/|valkey.io} for details.
|
|
@@ -308,7 +308,7 @@ class BaseBatch {
|
|
|
308
308
|
* Command Response - the value of `key` after the decrement.
|
|
309
309
|
*/
|
|
310
310
|
decr(key) {
|
|
311
|
-
return this.addAndReturn((0,
|
|
311
|
+
return this.addAndReturn((0, _1.createDecr)(key));
|
|
312
312
|
}
|
|
313
313
|
/** Decrements the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
|
|
314
314
|
* @see {@link https://valkey.io/commands/decrby/|valkey.io} for details.
|
|
@@ -319,7 +319,7 @@ class BaseBatch {
|
|
|
319
319
|
* Command Response - the value of `key` after the decrement.
|
|
320
320
|
*/
|
|
321
321
|
decrBy(key, amount) {
|
|
322
|
-
return this.addAndReturn((0,
|
|
322
|
+
return this.addAndReturn((0, _1.createDecrBy)(key, amount));
|
|
323
323
|
}
|
|
324
324
|
/**
|
|
325
325
|
* Perform a bitwise operation between multiple keys (containing string values) and store the result in the
|
|
@@ -334,7 +334,7 @@ class BaseBatch {
|
|
|
334
334
|
* Command Response - The size of the string stored in `destination`.
|
|
335
335
|
*/
|
|
336
336
|
bitop(operation, destination, keys) {
|
|
337
|
-
return this.addAndReturn((0,
|
|
337
|
+
return this.addAndReturn((0, _1.createBitOp)(operation, destination, keys));
|
|
338
338
|
}
|
|
339
339
|
/**
|
|
340
340
|
* Returns the bit value at `offset` in the string value stored at `key`. `offset` must be greater than or equal
|
|
@@ -349,7 +349,7 @@ class BaseBatch {
|
|
|
349
349
|
* `offset` exceeds the length of the string.
|
|
350
350
|
*/
|
|
351
351
|
getbit(key, offset) {
|
|
352
|
-
return this.addAndReturn((0,
|
|
352
|
+
return this.addAndReturn((0, _1.createGetBit)(key, offset));
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
355
|
* Sets or clears the bit at `offset` in the string value stored at `key`. The `offset` is a zero-based index, with
|
|
@@ -366,7 +366,7 @@ class BaseBatch {
|
|
|
366
366
|
* Command Response - The bit value that was previously stored at `offset`.
|
|
367
367
|
*/
|
|
368
368
|
setbit(key, offset, value) {
|
|
369
|
-
return this.addAndReturn((0,
|
|
369
|
+
return this.addAndReturn((0, _1.createSetBit)(key, offset, value));
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
372
|
* Returns the position of the first bit matching the given `bit` value. The optional starting offset
|
|
@@ -384,7 +384,7 @@ class BaseBatch {
|
|
|
384
384
|
* If `start` was provided, the search begins at the offset indicated by `start`.
|
|
385
385
|
*/
|
|
386
386
|
bitpos(key, bit, options) {
|
|
387
|
-
return this.addAndReturn((0,
|
|
387
|
+
return this.addAndReturn((0, _1.createBitPos)(key, bit, options));
|
|
388
388
|
}
|
|
389
389
|
/**
|
|
390
390
|
* Reads or modifies the array of bits representing the string that is held at `key` based on the specified
|
|
@@ -411,7 +411,7 @@ class BaseBatch {
|
|
|
411
411
|
* does not contribute a value to the array response.
|
|
412
412
|
*/
|
|
413
413
|
bitfield(key, subcommands) {
|
|
414
|
-
return this.addAndReturn((0,
|
|
414
|
+
return this.addAndReturn((0, _1.createBitField)(key, subcommands));
|
|
415
415
|
}
|
|
416
416
|
/**
|
|
417
417
|
* Reads the array of bits representing the string that is held at `key` based on the specified `subcommands`.
|
|
@@ -426,7 +426,7 @@ class BaseBatch {
|
|
|
426
426
|
*
|
|
427
427
|
*/
|
|
428
428
|
bitfieldReadOnly(key, subcommands) {
|
|
429
|
-
return this.addAndReturn((0,
|
|
429
|
+
return this.addAndReturn((0, _1.createBitField)(key, subcommands, true));
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
432
432
|
* Reads the configuration parameters of the running server.
|
|
@@ -440,7 +440,7 @@ class BaseBatch {
|
|
|
440
440
|
*
|
|
441
441
|
*/
|
|
442
442
|
configGet(parameters) {
|
|
443
|
-
return this.addAndReturn((0,
|
|
443
|
+
return this.addAndReturn((0, _1.createConfigGet)(parameters));
|
|
444
444
|
}
|
|
445
445
|
/**
|
|
446
446
|
* Sets configuration parameters to the specified values.
|
|
@@ -453,7 +453,7 @@ class BaseBatch {
|
|
|
453
453
|
* Command Response - "OK" when the configuration was set properly. Otherwise, the command fails with an error.
|
|
454
454
|
*/
|
|
455
455
|
configSet(parameters) {
|
|
456
|
-
return this.addAndReturn((0,
|
|
456
|
+
return this.addAndReturn((0, _1.createConfigSet)(parameters));
|
|
457
457
|
}
|
|
458
458
|
/** Retrieve the value associated with `field` in the hash stored at `key`.
|
|
459
459
|
* @see {@link https://valkey.io/commands/hget/|valkey.io} for details.
|
|
@@ -464,7 +464,7 @@ class BaseBatch {
|
|
|
464
464
|
* Command Response - the value associated with `field`, or null when `field` is not present in the hash or `key` does not exist.
|
|
465
465
|
*/
|
|
466
466
|
hget(key, field) {
|
|
467
|
-
return this.addAndReturn((0,
|
|
467
|
+
return this.addAndReturn((0, _1.createHGet)(key, field));
|
|
468
468
|
}
|
|
469
469
|
/** Sets the specified fields to their respective values in the hash stored at `key`.
|
|
470
470
|
* @see {@link https://valkey.io/commands/hset/|valkey.io} for details.
|
|
@@ -476,7 +476,7 @@ class BaseBatch {
|
|
|
476
476
|
* Command Response - The number of fields that were added.
|
|
477
477
|
*/
|
|
478
478
|
hset(key, fieldsAndValues) {
|
|
479
|
-
return this.addAndReturn((0,
|
|
479
|
+
return this.addAndReturn((0, _1.createHSet)(key, (0, _1.convertFieldsAndValuesToHashDataType)(fieldsAndValues)));
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
* Returns all field names in the hash stored at `key`.
|
|
@@ -488,7 +488,7 @@ class BaseBatch {
|
|
|
488
488
|
* Command Response - A list of field names for the hash, or an empty list when the key does not exist.
|
|
489
489
|
*/
|
|
490
490
|
hkeys(key) {
|
|
491
|
-
return this.addAndReturn((0,
|
|
491
|
+
return this.addAndReturn((0, _1.createHKeys)(key));
|
|
492
492
|
}
|
|
493
493
|
/** Sets `field` in the hash stored at `key` to `value`, only if `field` does not yet exist.
|
|
494
494
|
* If `key` does not exist, a new key holding a hash is created.
|
|
@@ -502,7 +502,7 @@ class BaseBatch {
|
|
|
502
502
|
* Command Response - `true` if the field was set, `false` if the field already existed and was not set.
|
|
503
503
|
*/
|
|
504
504
|
hsetnx(key, field, value) {
|
|
505
|
-
return this.addAndReturn((0,
|
|
505
|
+
return this.addAndReturn((0, _1.createHSetNX)(key, field, value));
|
|
506
506
|
}
|
|
507
507
|
/** Removes the specified fields from the hash stored at `key`.
|
|
508
508
|
* Specified fields that do not exist within this hash are ignored.
|
|
@@ -515,7 +515,7 @@ class BaseBatch {
|
|
|
515
515
|
* If `key` does not exist, it is treated as an empty hash and it returns 0.
|
|
516
516
|
*/
|
|
517
517
|
hdel(key, fields) {
|
|
518
|
-
return this.addAndReturn((0,
|
|
518
|
+
return this.addAndReturn((0, _1.createHDel)(key, fields));
|
|
519
519
|
}
|
|
520
520
|
/** Returns the values associated with the specified fields in the hash stored at `key`.
|
|
521
521
|
* @see {@link https://valkey.io/commands/hmget/|valkey.io} for details.
|
|
@@ -528,7 +528,7 @@ class BaseBatch {
|
|
|
528
528
|
* If `key` does not exist, it is treated as an empty hash and it returns a list of null values.
|
|
529
529
|
*/
|
|
530
530
|
hmget(key, fields) {
|
|
531
|
-
return this.addAndReturn((0,
|
|
531
|
+
return this.addAndReturn((0, _1.createHMGet)(key, fields));
|
|
532
532
|
}
|
|
533
533
|
/** Returns if `field` is an existing field in the hash stored at `key`.
|
|
534
534
|
* @see {@link https://valkey.io/commands/hexists/|valkey.io} for details.
|
|
@@ -540,7 +540,7 @@ class BaseBatch {
|
|
|
540
540
|
* the command response will be `false`.
|
|
541
541
|
*/
|
|
542
542
|
hexists(key, field) {
|
|
543
|
-
return this.addAndReturn((0,
|
|
543
|
+
return this.addAndReturn((0, _1.createHExists)(key, field));
|
|
544
544
|
}
|
|
545
545
|
/**
|
|
546
546
|
* Returns all fields and values of the hash stored at `key`.
|
|
@@ -553,7 +553,7 @@ class BaseBatch {
|
|
|
553
553
|
* If `key` does not exist, it returns an empty list.
|
|
554
554
|
*/
|
|
555
555
|
hgetall(key) {
|
|
556
|
-
return this.addAndReturn((0,
|
|
556
|
+
return this.addAndReturn((0, _1.createHGetAll)(key));
|
|
557
557
|
}
|
|
558
558
|
/** Increments the number stored at `field` in the hash stored at `key` by `increment`.
|
|
559
559
|
* By using a negative increment value, the value stored at `field` in the hash stored at `key` is decremented.
|
|
@@ -567,7 +567,7 @@ class BaseBatch {
|
|
|
567
567
|
* Command Response - the value of `field` in the hash stored at `key` after the increment.
|
|
568
568
|
*/
|
|
569
569
|
hincrBy(key, field, amount) {
|
|
570
|
-
return this.addAndReturn((0,
|
|
570
|
+
return this.addAndReturn((0, _1.createHIncrBy)(key, field, amount));
|
|
571
571
|
}
|
|
572
572
|
/** Increment the string representing a floating point number stored at `field` in the hash stored at `key` by `increment`.
|
|
573
573
|
* By using a negative increment value, the value stored at `field` in the hash stored at `key` is decremented.
|
|
@@ -581,7 +581,7 @@ class BaseBatch {
|
|
|
581
581
|
* Command Response - the value of `field` in the hash stored at `key` after the increment.
|
|
582
582
|
*/
|
|
583
583
|
hincrByFloat(key, field, amount) {
|
|
584
|
-
return this.addAndReturn((0,
|
|
584
|
+
return this.addAndReturn((0, _1.createHIncrByFloat)(key, field, amount));
|
|
585
585
|
}
|
|
586
586
|
/** Returns the number of fields contained in the hash stored at `key`.
|
|
587
587
|
* @see {@link https://valkey.io/commands/hlen/|valkey.io} for details.
|
|
@@ -591,7 +591,7 @@ class BaseBatch {
|
|
|
591
591
|
* Command Response - The number of fields in the hash, or 0 when the key does not exist.
|
|
592
592
|
*/
|
|
593
593
|
hlen(key) {
|
|
594
|
-
return this.addAndReturn((0,
|
|
594
|
+
return this.addAndReturn((0, _1.createHLen)(key));
|
|
595
595
|
}
|
|
596
596
|
/** Returns all values in the hash stored at key.
|
|
597
597
|
* @see {@link https://valkey.io/commands/hvals/|valkey.io} for details.
|
|
@@ -601,7 +601,7 @@ class BaseBatch {
|
|
|
601
601
|
* Command Response - a list of values in the hash, or an empty list when the key does not exist.
|
|
602
602
|
*/
|
|
603
603
|
hvals(key) {
|
|
604
|
-
return this.addAndReturn((0,
|
|
604
|
+
return this.addAndReturn((0, _1.createHVals)(key));
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
607
607
|
* Returns the string length of the value associated with `field` in the hash stored at `key`.
|
|
@@ -614,7 +614,7 @@ class BaseBatch {
|
|
|
614
614
|
* Command Response - The string length or `0` if `field` or `key` does not exist.
|
|
615
615
|
*/
|
|
616
616
|
hstrlen(key, field) {
|
|
617
|
-
return this.addAndReturn((0,
|
|
617
|
+
return this.addAndReturn((0, _1.createHStrlen)(key, field));
|
|
618
618
|
}
|
|
619
619
|
/**
|
|
620
620
|
* Returns a random field name from the hash value stored at `key`.
|
|
@@ -628,7 +628,7 @@ class BaseBatch {
|
|
|
628
628
|
* the key does not exist.
|
|
629
629
|
*/
|
|
630
630
|
hrandfield(key) {
|
|
631
|
-
return this.addAndReturn((0,
|
|
631
|
+
return this.addAndReturn((0, _1.createHRandField)(key));
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Iterates incrementally over a hash.
|
|
@@ -647,7 +647,7 @@ class BaseBatch {
|
|
|
647
647
|
* If `options.noValues` is set to `true`, the second element will only contain the fields without the values.
|
|
648
648
|
*/
|
|
649
649
|
hscan(key, cursor, options) {
|
|
650
|
-
return this.addAndReturn((0,
|
|
650
|
+
return this.addAndReturn((0, _1.createHScan)(key, cursor, options));
|
|
651
651
|
}
|
|
652
652
|
/**
|
|
653
653
|
* Retrieves up to `count` random field names from the hash value stored at `key`.
|
|
@@ -664,7 +664,7 @@ class BaseBatch {
|
|
|
664
664
|
* or an `empty array` when the key does not exist.
|
|
665
665
|
*/
|
|
666
666
|
hrandfieldCount(key, count) {
|
|
667
|
-
return this.addAndReturn((0,
|
|
667
|
+
return this.addAndReturn((0, _1.createHRandField)(key, count));
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
670
670
|
* Retrieves up to `count` random field names along with their values from the hash
|
|
@@ -683,7 +683,7 @@ class BaseBatch {
|
|
|
683
683
|
* If the hash does not exist or is empty, the response will be an empty `array`.
|
|
684
684
|
*/
|
|
685
685
|
hrandfieldWithValues(key, count) {
|
|
686
|
-
return this.addAndReturn((0,
|
|
686
|
+
return this.addAndReturn((0, _1.createHRandField)(key, count, true));
|
|
687
687
|
}
|
|
688
688
|
/** Inserts all the specified values at the head of the list stored at `key`.
|
|
689
689
|
* `elements` are inserted one after the other to the head of the list, from the leftmost element to the rightmost element.
|
|
@@ -696,7 +696,7 @@ class BaseBatch {
|
|
|
696
696
|
* Command Response - the length of the list after the push operations.
|
|
697
697
|
*/
|
|
698
698
|
lpush(key, elements) {
|
|
699
|
-
return this.addAndReturn((0,
|
|
699
|
+
return this.addAndReturn((0, _1.createLPush)(key, elements));
|
|
700
700
|
}
|
|
701
701
|
/**
|
|
702
702
|
* Inserts specified values at the head of the `list`, only if `key` already
|
|
@@ -710,7 +710,7 @@ class BaseBatch {
|
|
|
710
710
|
* Command Response - The length of the list after the push operation.
|
|
711
711
|
*/
|
|
712
712
|
lpushx(key, elements) {
|
|
713
|
-
return this.addAndReturn((0,
|
|
713
|
+
return this.addAndReturn((0, _1.createLPushX)(key, elements));
|
|
714
714
|
}
|
|
715
715
|
/** Removes and returns the first elements of the list stored at `key`.
|
|
716
716
|
* The command pops a single element from the beginning of the list.
|
|
@@ -722,7 +722,7 @@ class BaseBatch {
|
|
|
722
722
|
* If `key` does not exist null will be returned.
|
|
723
723
|
*/
|
|
724
724
|
lpop(key) {
|
|
725
|
-
return this.addAndReturn((0,
|
|
725
|
+
return this.addAndReturn((0, _1.createLPop)(key));
|
|
726
726
|
}
|
|
727
727
|
/** Removes and returns up to `count` elements of the list stored at `key`, depending on the list's length.
|
|
728
728
|
* @see {@link https://valkey.io/commands/lpop/|valkey.io} for details.
|
|
@@ -734,7 +734,7 @@ class BaseBatch {
|
|
|
734
734
|
* If `key` does not exist null will be returned.
|
|
735
735
|
*/
|
|
736
736
|
lpopCount(key, count) {
|
|
737
|
-
return this.addAndReturn((0,
|
|
737
|
+
return this.addAndReturn((0, _1.createLPop)(key, count));
|
|
738
738
|
}
|
|
739
739
|
/** Returns the specified elements of the list stored at `key`.
|
|
740
740
|
* The offsets `start` and `end` are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on.
|
|
@@ -752,7 +752,7 @@ class BaseBatch {
|
|
|
752
752
|
* If `key` does not exist an empty list will be returned.
|
|
753
753
|
*/
|
|
754
754
|
lrange(key, start, end) {
|
|
755
|
-
return this.addAndReturn((0,
|
|
755
|
+
return this.addAndReturn((0, _1.createLRange)(key, start, end));
|
|
756
756
|
}
|
|
757
757
|
/** Returns the length of the list stored at `key`.
|
|
758
758
|
* @see {@link https://valkey.io/commands/llen/|valkey.io} for details.
|
|
@@ -763,7 +763,7 @@ class BaseBatch {
|
|
|
763
763
|
* If `key` does not exist, it is interpreted as an empty list and 0 is returned.
|
|
764
764
|
*/
|
|
765
765
|
llen(key) {
|
|
766
|
-
return this.addAndReturn((0,
|
|
766
|
+
return this.addAndReturn((0, _1.createLLen)(key));
|
|
767
767
|
}
|
|
768
768
|
/**
|
|
769
769
|
* Atomically pops and removes the left/right-most element to the list stored at `source`
|
|
@@ -781,7 +781,7 @@ class BaseBatch {
|
|
|
781
781
|
* Command Response - The popped element, or `null` if `source` does not exist.
|
|
782
782
|
*/
|
|
783
783
|
lmove(source, destination, whereFrom, whereTo) {
|
|
784
|
-
return this.addAndReturn((0,
|
|
784
|
+
return this.addAndReturn((0, _1.createLMove)(source, destination, whereFrom, whereTo));
|
|
785
785
|
}
|
|
786
786
|
/**
|
|
787
787
|
*
|
|
@@ -804,7 +804,7 @@ class BaseBatch {
|
|
|
804
804
|
* Command Response - The popped element, or `null` if `source` does not exist or if the operation timed-out.
|
|
805
805
|
*/
|
|
806
806
|
blmove(source, destination, whereFrom, whereTo, timeout) {
|
|
807
|
-
return this.addAndReturn((0,
|
|
807
|
+
return this.addAndReturn((0, _1.createBLMove)(source, destination, whereFrom, whereTo, timeout));
|
|
808
808
|
}
|
|
809
809
|
/**
|
|
810
810
|
* Sets the list element at `index` to `element`.
|
|
@@ -821,7 +821,7 @@ class BaseBatch {
|
|
|
821
821
|
* Command Response - Always "OK".
|
|
822
822
|
*/
|
|
823
823
|
lset(key, index, element) {
|
|
824
|
-
return this.addAndReturn((0,
|
|
824
|
+
return this.addAndReturn((0, _1.createLSet)(key, index, element));
|
|
825
825
|
}
|
|
826
826
|
/** Trim an existing list so that it will contain only the specified range of elements specified.
|
|
827
827
|
* The offsets `start` and `end` are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on.
|
|
@@ -834,27 +834,27 @@ class BaseBatch {
|
|
|
834
834
|
* @param end - The end of the range.
|
|
835
835
|
*
|
|
836
836
|
* Command Response - always "OK".
|
|
837
|
-
* If `start` exceeds the end of the list, or if `start` is greater than `end`, the
|
|
837
|
+
* If `start` exceeds the end of the list, or if `start` is greater than `end`, the list is emptied and the key is removed.
|
|
838
838
|
* If `end` exceeds the actual end of the list, it will be treated like the last element of the list.
|
|
839
839
|
* If `key` does not exist the command will be ignored.
|
|
840
840
|
*/
|
|
841
841
|
ltrim(key, start, end) {
|
|
842
|
-
return this.addAndReturn((0,
|
|
842
|
+
return this.addAndReturn((0, _1.createLTrim)(key, start, end));
|
|
843
843
|
}
|
|
844
844
|
/** Removes the first `count` occurrences of elements equal to `element` from the list stored at `key`.
|
|
845
|
-
* If `count` is positive : Removes elements equal to `element` moving from head to tail.
|
|
846
|
-
* If `count` is negative : Removes elements equal to `element` moving from tail to head.
|
|
847
|
-
* If `count` is 0 or `count` is greater than the occurrences of elements equal to `element`: Removes all elements equal to `element`.
|
|
848
845
|
*
|
|
849
846
|
* @param key - The key of the list.
|
|
850
847
|
* @param count - The count of the occurrences of elements equal to `element` to remove.
|
|
848
|
+
* If `count` is positive : Removes elements equal to `element` moving from head to tail.
|
|
849
|
+
* If `count` is negative : Removes elements equal to `element` moving from tail to head.
|
|
850
|
+
* If `count` is 0 or `count` is greater than the occurrences of elements equal to `element`: Removes all elements equal to `element`.
|
|
851
851
|
* @param element - The element to remove from the list.
|
|
852
852
|
*
|
|
853
853
|
* Command Response - the number of the removed elements.
|
|
854
854
|
* If `key` does not exist, 0 is returned.
|
|
855
855
|
*/
|
|
856
856
|
lrem(key, count, element) {
|
|
857
|
-
return this.addAndReturn((0,
|
|
857
|
+
return this.addAndReturn((0, _1.createLRem)(key, count, element));
|
|
858
858
|
}
|
|
859
859
|
/** Inserts all the specified values at the tail of the list stored at `key`.
|
|
860
860
|
* `elements` are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element.
|
|
@@ -867,7 +867,7 @@ class BaseBatch {
|
|
|
867
867
|
* Command Response - the length of the list after the push operations.
|
|
868
868
|
*/
|
|
869
869
|
rpush(key, elements) {
|
|
870
|
-
return this.addAndReturn((0,
|
|
870
|
+
return this.addAndReturn((0, _1.createRPush)(key, elements));
|
|
871
871
|
}
|
|
872
872
|
/**
|
|
873
873
|
* Inserts specified values at the tail of the `list`, only if `key` already
|
|
@@ -881,7 +881,7 @@ class BaseBatch {
|
|
|
881
881
|
* Command Response - The length of the list after the push operation.
|
|
882
882
|
*/
|
|
883
883
|
rpushx(key, elements) {
|
|
884
|
-
return this.addAndReturn((0,
|
|
884
|
+
return this.addAndReturn((0, _1.createRPushX)(key, elements));
|
|
885
885
|
}
|
|
886
886
|
/** Removes and returns the last elements of the list stored at `key`.
|
|
887
887
|
* The command pops a single element from the end of the list.
|
|
@@ -893,7 +893,7 @@ class BaseBatch {
|
|
|
893
893
|
* If `key` does not exist null will be returned.
|
|
894
894
|
*/
|
|
895
895
|
rpop(key) {
|
|
896
|
-
return this.addAndReturn((0,
|
|
896
|
+
return this.addAndReturn((0, _1.createRPop)(key));
|
|
897
897
|
}
|
|
898
898
|
/** Removes and returns up to `count` elements from the list stored at `key`, depending on the list's length.
|
|
899
899
|
* @see {@link https://valkey.io/commands/rpop/|valkey.io} for details.
|
|
@@ -905,7 +905,7 @@ class BaseBatch {
|
|
|
905
905
|
* If `key` does not exist null will be returned.
|
|
906
906
|
*/
|
|
907
907
|
rpopCount(key, count) {
|
|
908
|
-
return this.addAndReturn((0,
|
|
908
|
+
return this.addAndReturn((0, _1.createRPop)(key, count));
|
|
909
909
|
}
|
|
910
910
|
/** Adds the specified members to the set stored at `key`. Specified members that are already a member of this set are ignored.
|
|
911
911
|
* If `key` does not exist, a new set is created before adding `members`.
|
|
@@ -917,7 +917,7 @@ class BaseBatch {
|
|
|
917
917
|
* Command Response - the number of members that were added to the set, not including all the members already present in the set.
|
|
918
918
|
*/
|
|
919
919
|
sadd(key, members) {
|
|
920
|
-
return this.addAndReturn((0,
|
|
920
|
+
return this.addAndReturn((0, _1.createSAdd)(key, members));
|
|
921
921
|
}
|
|
922
922
|
/** Removes the specified members from the set stored at `key`. Specified members that are not a member of this set are ignored.
|
|
923
923
|
* @see {@link https://valkey.io/commands/srem/|valkey.io} for details.
|
|
@@ -929,7 +929,7 @@ class BaseBatch {
|
|
|
929
929
|
* If `key` does not exist, it is treated as an empty set and this command returns 0.
|
|
930
930
|
*/
|
|
931
931
|
srem(key, members) {
|
|
932
|
-
return this.addAndReturn((0,
|
|
932
|
+
return this.addAndReturn((0, _1.createSRem)(key, members));
|
|
933
933
|
}
|
|
934
934
|
/**
|
|
935
935
|
* Iterates incrementally over a set.
|
|
@@ -944,7 +944,7 @@ class BaseBatch {
|
|
|
944
944
|
* The `cursor` will be `"0"` on the last iteration of the set. The second element is always an array of the subset of the set held in `key`.
|
|
945
945
|
*/
|
|
946
946
|
sscan(key, cursor, options) {
|
|
947
|
-
return this.addAndReturn((0,
|
|
947
|
+
return this.addAndReturn((0, _1.createSScan)(key, cursor, options));
|
|
948
948
|
}
|
|
949
949
|
/** Returns all the members of the set value stored at `key`.
|
|
950
950
|
* @see {@link https://valkey.io/commands/smembers/|valkey.io} for details.
|
|
@@ -955,7 +955,7 @@ class BaseBatch {
|
|
|
955
955
|
* If `key` does not exist, it is treated as an empty set and this command returns empty list.
|
|
956
956
|
*/
|
|
957
957
|
smembers(key) {
|
|
958
|
-
return this.addAndReturn((0,
|
|
958
|
+
return this.addAndReturn((0, _1.createSMembers)(key), true);
|
|
959
959
|
}
|
|
960
960
|
/** Moves `member` from the set at `source` to the set at `destination`, removing it from the source set.
|
|
961
961
|
* Creates a new destination set if needed. The operation is atomic.
|
|
@@ -968,7 +968,7 @@ class BaseBatch {
|
|
|
968
968
|
* Command Response - `true` on success, or `false` if the `source` set does not exist or the element is not a member of the source set.
|
|
969
969
|
*/
|
|
970
970
|
smove(source, destination, member) {
|
|
971
|
-
return this.addAndReturn((0,
|
|
971
|
+
return this.addAndReturn((0, _1.createSMove)(source, destination, member));
|
|
972
972
|
}
|
|
973
973
|
/** Returns the set cardinality (number of elements) of the set stored at `key`.
|
|
974
974
|
* @see {@link https://valkey.io/commands/scard/|valkey.io} for details.
|
|
@@ -978,7 +978,7 @@ class BaseBatch {
|
|
|
978
978
|
* Command Response - the cardinality (number of elements) of the set, or 0 if key does not exist.
|
|
979
979
|
*/
|
|
980
980
|
scard(key) {
|
|
981
|
-
return this.addAndReturn((0,
|
|
981
|
+
return this.addAndReturn((0, _1.createSCard)(key));
|
|
982
982
|
}
|
|
983
983
|
/** Gets the intersection of all the given sets.
|
|
984
984
|
* When in cluster mode, all `keys` must map to the same hash slot.
|
|
@@ -990,7 +990,7 @@ class BaseBatch {
|
|
|
990
990
|
* If one or more sets do not exist, an empty set will be returned.
|
|
991
991
|
*/
|
|
992
992
|
sinter(keys) {
|
|
993
|
-
return this.addAndReturn((0,
|
|
993
|
+
return this.addAndReturn((0, _1.createSInter)(keys), true);
|
|
994
994
|
}
|
|
995
995
|
/**
|
|
996
996
|
* Gets the cardinality of the intersection of all the given sets.
|
|
@@ -1005,7 +1005,7 @@ class BaseBatch {
|
|
|
1005
1005
|
* Command Response - The cardinality of the intersection result. If one or more sets do not exist, `0` is returned.
|
|
1006
1006
|
*/
|
|
1007
1007
|
sintercard(keys, options) {
|
|
1008
|
-
return this.addAndReturn((0,
|
|
1008
|
+
return this.addAndReturn((0, _1.createSInterCard)(keys, options?.limit));
|
|
1009
1009
|
}
|
|
1010
1010
|
/**
|
|
1011
1011
|
* Stores the members of the intersection of all given sets specified by `keys` into a new set at `destination`.
|
|
@@ -1018,7 +1018,7 @@ class BaseBatch {
|
|
|
1018
1018
|
* Command Response - The number of elements in the resulting set.
|
|
1019
1019
|
*/
|
|
1020
1020
|
sinterstore(destination, keys) {
|
|
1021
|
-
return this.addAndReturn((0,
|
|
1021
|
+
return this.addAndReturn((0, _1.createSInterStore)(destination, keys));
|
|
1022
1022
|
}
|
|
1023
1023
|
/**
|
|
1024
1024
|
* Computes the difference between the first set and all the successive sets in `keys`.
|
|
@@ -1031,7 +1031,7 @@ class BaseBatch {
|
|
|
1031
1031
|
* If a key in `keys` does not exist, it is treated as an empty set.
|
|
1032
1032
|
*/
|
|
1033
1033
|
sdiff(keys) {
|
|
1034
|
-
return this.addAndReturn((0,
|
|
1034
|
+
return this.addAndReturn((0, _1.createSDiff)(keys), true);
|
|
1035
1035
|
}
|
|
1036
1036
|
/**
|
|
1037
1037
|
* Stores the difference between the first set and all the successive sets in `keys` into a new set at `destination`.
|
|
@@ -1044,7 +1044,7 @@ class BaseBatch {
|
|
|
1044
1044
|
* Command Response - The number of elements in the resulting set.
|
|
1045
1045
|
*/
|
|
1046
1046
|
sdiffstore(destination, keys) {
|
|
1047
|
-
return this.addAndReturn((0,
|
|
1047
|
+
return this.addAndReturn((0, _1.createSDiffStore)(destination, keys));
|
|
1048
1048
|
}
|
|
1049
1049
|
/**
|
|
1050
1050
|
* Gets the union of all the given sets.
|
|
@@ -1057,7 +1057,7 @@ class BaseBatch {
|
|
|
1057
1057
|
* If none of the sets exist, an empty `Set` will be returned.
|
|
1058
1058
|
*/
|
|
1059
1059
|
sunion(keys) {
|
|
1060
|
-
return this.addAndReturn((0,
|
|
1060
|
+
return this.addAndReturn((0, _1.createSUnion)(keys), true);
|
|
1061
1061
|
}
|
|
1062
1062
|
/**
|
|
1063
1063
|
* Stores the members of the union of all given sets specified by `keys` into a new set
|
|
@@ -1071,7 +1071,7 @@ class BaseBatch {
|
|
|
1071
1071
|
* Command Response - The number of elements in the resulting set.
|
|
1072
1072
|
*/
|
|
1073
1073
|
sunionstore(destination, keys) {
|
|
1074
|
-
return this.addAndReturn((0,
|
|
1074
|
+
return this.addAndReturn((0, _1.createSUnionStore)(destination, keys));
|
|
1075
1075
|
}
|
|
1076
1076
|
/** Returns if `member` is a member of the set stored at `key`.
|
|
1077
1077
|
* @see {@link https://valkey.io/commands/sismember/|valkey.io} for details.
|
|
@@ -1083,7 +1083,7 @@ class BaseBatch {
|
|
|
1083
1083
|
* If `key` doesn't exist, it is treated as an empty set and the command returns `false`.
|
|
1084
1084
|
*/
|
|
1085
1085
|
sismember(key, member) {
|
|
1086
|
-
return this.addAndReturn((0,
|
|
1086
|
+
return this.addAndReturn((0, _1.createSIsMember)(key, member));
|
|
1087
1087
|
}
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Checks whether each member is contained in the members of the set stored at `key`.
|
|
@@ -1097,7 +1097,7 @@ class BaseBatch {
|
|
|
1097
1097
|
* Command Response - An `array` of `boolean` values, each indicating if the respective member exists in the set.
|
|
1098
1098
|
*/
|
|
1099
1099
|
smismember(key, members) {
|
|
1100
|
-
return this.addAndReturn((0,
|
|
1100
|
+
return this.addAndReturn((0, _1.createSMIsMember)(key, members));
|
|
1101
1101
|
}
|
|
1102
1102
|
/** Removes and returns one random member from the set value store at `key`.
|
|
1103
1103
|
* @see {@link https://valkey.io/commands/spop/|valkey.io} for details.
|
|
@@ -1109,7 +1109,7 @@ class BaseBatch {
|
|
|
1109
1109
|
* If `key` does not exist, null will be returned.
|
|
1110
1110
|
*/
|
|
1111
1111
|
spop(key) {
|
|
1112
|
-
return this.addAndReturn((0,
|
|
1112
|
+
return this.addAndReturn((0, _1.createSPop)(key));
|
|
1113
1113
|
}
|
|
1114
1114
|
/** Removes and returns up to `count` random members from the set value store at `key`, depending on the set's length.
|
|
1115
1115
|
* @see {@link https://valkey.io/commands/spop/|valkey.io} for details.
|
|
@@ -1121,7 +1121,7 @@ class BaseBatch {
|
|
|
1121
1121
|
* If `key` does not exist, empty list will be returned.
|
|
1122
1122
|
*/
|
|
1123
1123
|
spopCount(key, count) {
|
|
1124
|
-
return this.addAndReturn((0,
|
|
1124
|
+
return this.addAndReturn((0, _1.createSPop)(key, count), true);
|
|
1125
1125
|
}
|
|
1126
1126
|
/** Returns a random element from the set value stored at `key`.
|
|
1127
1127
|
*
|
|
@@ -1131,7 +1131,7 @@ class BaseBatch {
|
|
|
1131
1131
|
* Command Response - A random element from the set, or null if `key` does not exist.
|
|
1132
1132
|
*/
|
|
1133
1133
|
srandmember(key) {
|
|
1134
|
-
return this.addAndReturn((0,
|
|
1134
|
+
return this.addAndReturn((0, _1.createSRandMember)(key));
|
|
1135
1135
|
}
|
|
1136
1136
|
/** Returns one or more random elements from the set value stored at `key`.
|
|
1137
1137
|
*
|
|
@@ -1144,7 +1144,7 @@ class BaseBatch {
|
|
|
1144
1144
|
* Command Response - A list of members from the set. If the set does not exist or is empty, an empty list will be returned.
|
|
1145
1145
|
*/
|
|
1146
1146
|
srandmemberCount(key, count) {
|
|
1147
|
-
return this.addAndReturn((0,
|
|
1147
|
+
return this.addAndReturn((0, _1.createSRandMember)(key, count));
|
|
1148
1148
|
}
|
|
1149
1149
|
/**
|
|
1150
1150
|
* Returns the number of keys in `keys` that exist in the database.
|
|
@@ -1157,7 +1157,7 @@ class BaseBatch {
|
|
|
1157
1157
|
* it will be counted multiple times.
|
|
1158
1158
|
*/
|
|
1159
1159
|
exists(keys) {
|
|
1160
|
-
return this.addAndReturn((0,
|
|
1160
|
+
return this.addAndReturn((0, _1.createExists)(keys));
|
|
1161
1161
|
}
|
|
1162
1162
|
/**
|
|
1163
1163
|
* Removes the specified keys. A key is ignored if it does not exist.
|
|
@@ -1171,7 +1171,7 @@ class BaseBatch {
|
|
|
1171
1171
|
* Command Response - The number of keys that were unlinked.
|
|
1172
1172
|
*/
|
|
1173
1173
|
unlink(keys) {
|
|
1174
|
-
return this.addAndReturn((0,
|
|
1174
|
+
return this.addAndReturn((0, _1.createUnlink)(keys));
|
|
1175
1175
|
}
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Sets a timeout on `key` in seconds. After the timeout has expired, the key will automatically be deleted.
|
|
@@ -1190,7 +1190,7 @@ class BaseBatch {
|
|
|
1190
1190
|
* or operation skipped due to the provided arguments.
|
|
1191
1191
|
*/
|
|
1192
1192
|
expire(key, seconds, options) {
|
|
1193
|
-
return this.addAndReturn((0,
|
|
1193
|
+
return this.addAndReturn((0, _1.createExpire)(key, seconds, options?.expireOption));
|
|
1194
1194
|
}
|
|
1195
1195
|
/**
|
|
1196
1196
|
* Sets a timeout on `key`. It takes an absolute Unix timestamp (seconds since January 1, 1970) instead of specifying the number of seconds.
|
|
@@ -1209,7 +1209,7 @@ class BaseBatch {
|
|
|
1209
1209
|
* or operation skipped due to the provided arguments.
|
|
1210
1210
|
*/
|
|
1211
1211
|
expireAt(key, unixSeconds, options) {
|
|
1212
|
-
return this.addAndReturn((0,
|
|
1212
|
+
return this.addAndReturn((0, _1.createExpireAt)(key, unixSeconds, options?.expireOption));
|
|
1213
1213
|
}
|
|
1214
1214
|
/**
|
|
1215
1215
|
* Returns the absolute Unix timestamp (since January 1, 1970) at which the given `key` will expire, in seconds.
|
|
@@ -1223,7 +1223,7 @@ class BaseBatch {
|
|
|
1223
1223
|
* Command Response - The expiration Unix timestamp in seconds, `-2` if `key` does not exist or `-1` if `key` exists but has no associated expire.
|
|
1224
1224
|
*/
|
|
1225
1225
|
expireTime(key) {
|
|
1226
|
-
return this.addAndReturn((0,
|
|
1226
|
+
return this.addAndReturn((0, _1.createExpireTime)(key));
|
|
1227
1227
|
}
|
|
1228
1228
|
/**
|
|
1229
1229
|
* Sets a timeout on `key` in milliseconds. After the timeout has expired, the key will automatically be deleted.
|
|
@@ -1242,7 +1242,7 @@ class BaseBatch {
|
|
|
1242
1242
|
* or operation skipped due to the provided arguments.
|
|
1243
1243
|
*/
|
|
1244
1244
|
pexpire(key, milliseconds, options) {
|
|
1245
|
-
return this.addAndReturn((0,
|
|
1245
|
+
return this.addAndReturn((0, _1.createPExpire)(key, milliseconds, options?.expireOption));
|
|
1246
1246
|
}
|
|
1247
1247
|
/**
|
|
1248
1248
|
* Sets a timeout on `key`. It takes an absolute Unix timestamp (milliseconds since January 1, 1970) instead of specifying the number of milliseconds.
|
|
@@ -1261,7 +1261,7 @@ class BaseBatch {
|
|
|
1261
1261
|
* or operation skipped due to the provided arguments.
|
|
1262
1262
|
*/
|
|
1263
1263
|
pexpireAt(key, unixMilliseconds, options) {
|
|
1264
|
-
return this.addAndReturn((0,
|
|
1264
|
+
return this.addAndReturn((0, _1.createPExpireAt)(key, unixMilliseconds, options?.expireOption));
|
|
1265
1265
|
}
|
|
1266
1266
|
/**
|
|
1267
1267
|
* Returns the absolute Unix timestamp (since January 1, 1970) at which the given `key` will expire, in milliseconds.
|
|
@@ -1274,7 +1274,7 @@ class BaseBatch {
|
|
|
1274
1274
|
* Command Response - The expiration Unix timestamp in seconds, `-2` if `key` does not exist or `-1` if `key` exists but has no associated expire.
|
|
1275
1275
|
*/
|
|
1276
1276
|
pexpireTime(key) {
|
|
1277
|
-
return this.addAndReturn((0,
|
|
1277
|
+
return this.addAndReturn((0, _1.createPExpireTime)(key));
|
|
1278
1278
|
}
|
|
1279
1279
|
/**
|
|
1280
1280
|
* Returns the remaining time to live of `key` that has a timeout.
|
|
@@ -1286,7 +1286,7 @@ class BaseBatch {
|
|
|
1286
1286
|
* Command Response - TTL in seconds, `-2` if `key` does not exist or `-1` if `key` exists but has no associated expire.
|
|
1287
1287
|
*/
|
|
1288
1288
|
ttl(key) {
|
|
1289
|
-
return this.addAndReturn((0,
|
|
1289
|
+
return this.addAndReturn((0, _1.createTTL)(key));
|
|
1290
1290
|
}
|
|
1291
1291
|
/**
|
|
1292
1292
|
* Adds members with their scores to the sorted set stored at `key`.
|
|
@@ -1302,7 +1302,7 @@ class BaseBatch {
|
|
|
1302
1302
|
* If {@link ZAddOptions.changed} is set to `true`, returns the number of elements updated in the sorted set.
|
|
1303
1303
|
*/
|
|
1304
1304
|
zadd(key, membersAndScores, options) {
|
|
1305
|
-
return this.addAndReturn((0,
|
|
1305
|
+
return this.addAndReturn((0, _1.createZAdd)(key, membersAndScores, options));
|
|
1306
1306
|
}
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Increments the score of member in the sorted set stored at `key` by `increment`.
|
|
@@ -1320,7 +1320,7 @@ class BaseBatch {
|
|
|
1320
1320
|
* If there was a conflict with the options, the operation aborts and `null` is returned.
|
|
1321
1321
|
*/
|
|
1322
1322
|
zaddIncr(key, member, increment, options) {
|
|
1323
|
-
return this.addAndReturn((0,
|
|
1323
|
+
return this.addAndReturn((0, _1.createZAdd)(key, [{ element: member, score: increment }], options, true));
|
|
1324
1324
|
}
|
|
1325
1325
|
/**
|
|
1326
1326
|
* Removes the specified members from the sorted set stored at `key`.
|
|
@@ -1335,7 +1335,7 @@ class BaseBatch {
|
|
|
1335
1335
|
* If `key` does not exist, it is treated as an empty sorted set, and this command returns 0.
|
|
1336
1336
|
*/
|
|
1337
1337
|
zrem(key, members) {
|
|
1338
|
-
return this.addAndReturn((0,
|
|
1338
|
+
return this.addAndReturn((0, _1.createZRem)(key, members));
|
|
1339
1339
|
}
|
|
1340
1340
|
/**
|
|
1341
1341
|
* Returns the cardinality (number of elements) of the sorted set stored at `key`.
|
|
@@ -1348,7 +1348,7 @@ class BaseBatch {
|
|
|
1348
1348
|
* If `key` does not exist, it is treated as an empty sorted set, and this command returns `0`.
|
|
1349
1349
|
*/
|
|
1350
1350
|
zcard(key) {
|
|
1351
|
-
return this.addAndReturn((0,
|
|
1351
|
+
return this.addAndReturn((0, _1.createZCard)(key));
|
|
1352
1352
|
}
|
|
1353
1353
|
/**
|
|
1354
1354
|
* Returns the cardinality of the intersection of the sorted sets specified by `keys`.
|
|
@@ -1363,7 +1363,7 @@ class BaseBatch {
|
|
|
1363
1363
|
* Command Response - The cardinality of the intersection of the given sorted sets.
|
|
1364
1364
|
*/
|
|
1365
1365
|
zintercard(keys, options) {
|
|
1366
|
-
return this.addAndReturn((0,
|
|
1366
|
+
return this.addAndReturn((0, _1.createZInterCard)(keys, options?.limit));
|
|
1367
1367
|
}
|
|
1368
1368
|
/**
|
|
1369
1369
|
* Returns the difference between the first sorted set and all the successive sorted sets.
|
|
@@ -1378,7 +1378,7 @@ class BaseBatch {
|
|
|
1378
1378
|
* If the first key does not exist, it is treated as an empty sorted set, and the command returns an empty `array`.
|
|
1379
1379
|
*/
|
|
1380
1380
|
zdiff(keys) {
|
|
1381
|
-
return this.addAndReturn((0,
|
|
1381
|
+
return this.addAndReturn((0, _1.createZDiff)(keys));
|
|
1382
1382
|
}
|
|
1383
1383
|
/**
|
|
1384
1384
|
* Returns the difference between the first sorted set and all the successive sorted sets, with the associated
|
|
@@ -1394,7 +1394,7 @@ class BaseBatch {
|
|
|
1394
1394
|
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1395
1395
|
*/
|
|
1396
1396
|
zdiffWithScores(keys) {
|
|
1397
|
-
return this.addAndReturn((0,
|
|
1397
|
+
return this.addAndReturn((0, _1.createZDiffWithScores)(keys));
|
|
1398
1398
|
}
|
|
1399
1399
|
/**
|
|
1400
1400
|
* Calculates the difference between the first sorted set and all the successive sorted sets in `keys` and stores
|
|
@@ -1410,7 +1410,7 @@ class BaseBatch {
|
|
|
1410
1410
|
* Command Response - The number of members in the resulting sorted set stored at `destination`.
|
|
1411
1411
|
*/
|
|
1412
1412
|
zdiffstore(destination, keys) {
|
|
1413
|
-
return this.addAndReturn((0,
|
|
1413
|
+
return this.addAndReturn((0, _1.createZDiffStore)(destination, keys));
|
|
1414
1414
|
}
|
|
1415
1415
|
/**
|
|
1416
1416
|
* Returns the score of `member` in the sorted set stored at `key`.
|
|
@@ -1425,7 +1425,7 @@ class BaseBatch {
|
|
|
1425
1425
|
* If `key` does not exist, null is returned.
|
|
1426
1426
|
*/
|
|
1427
1427
|
zscore(key, member) {
|
|
1428
|
-
return this.addAndReturn((0,
|
|
1428
|
+
return this.addAndReturn((0, _1.createZScore)(key, member));
|
|
1429
1429
|
}
|
|
1430
1430
|
/**
|
|
1431
1431
|
* Computes the union of sorted sets given by the specified `keys` and stores the result in `destination`.
|
|
@@ -1444,7 +1444,7 @@ class BaseBatch {
|
|
|
1444
1444
|
* Command Response - The number of elements in the resulting sorted set stored at `destination`.
|
|
1445
1445
|
*/
|
|
1446
1446
|
zunionstore(destination, keys, options) {
|
|
1447
|
-
return this.addAndReturn((0,
|
|
1447
|
+
return this.addAndReturn((0, _1.createZUnionStore)(destination, keys, options?.aggregationType));
|
|
1448
1448
|
}
|
|
1449
1449
|
/**
|
|
1450
1450
|
* Returns the scores associated with the specified `members` in the sorted set stored at `key`.
|
|
@@ -1459,7 +1459,7 @@ class BaseBatch {
|
|
|
1459
1459
|
* If a member does not exist in the sorted set, the corresponding value in the list will be `null`.
|
|
1460
1460
|
*/
|
|
1461
1461
|
zmscore(key, members) {
|
|
1462
|
-
return this.addAndReturn((0,
|
|
1462
|
+
return this.addAndReturn((0, _1.createZMScore)(key, members));
|
|
1463
1463
|
}
|
|
1464
1464
|
/**
|
|
1465
1465
|
* Returns the number of members in the sorted set stored at `key` with scores between `minScore` and `maxScore`.
|
|
@@ -1475,7 +1475,7 @@ class BaseBatch {
|
|
|
1475
1475
|
* If `minScore` is greater than `maxScore`, `0` is returned.
|
|
1476
1476
|
*/
|
|
1477
1477
|
zcount(key, minScore, maxScore) {
|
|
1478
|
-
return this.addAndReturn((0,
|
|
1478
|
+
return this.addAndReturn((0, _1.createZCount)(key, minScore, maxScore));
|
|
1479
1479
|
}
|
|
1480
1480
|
/**
|
|
1481
1481
|
* Returns the specified range of elements in the sorted set stored at `key`.
|
|
@@ -1496,7 +1496,7 @@ class BaseBatch {
|
|
|
1496
1496
|
* If `key` does not exist, it is treated as an empty sorted set, and the command returns an empty array.
|
|
1497
1497
|
*/
|
|
1498
1498
|
zrange(key, rangeQuery, reverse = false) {
|
|
1499
|
-
return this.addAndReturn((0,
|
|
1499
|
+
return this.addAndReturn((0, _1.createZRange)(key, rangeQuery, reverse));
|
|
1500
1500
|
}
|
|
1501
1501
|
/**
|
|
1502
1502
|
* Returns the specified range of elements with their scores in the sorted set stored at `key`.
|
|
@@ -1515,7 +1515,7 @@ class BaseBatch {
|
|
|
1515
1515
|
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1516
1516
|
*/
|
|
1517
1517
|
zrangeWithScores(key, rangeQuery, reverse = false) {
|
|
1518
|
-
return this.addAndReturn((0,
|
|
1518
|
+
return this.addAndReturn((0, _1.createZRangeWithScores)(key, rangeQuery, reverse));
|
|
1519
1519
|
}
|
|
1520
1520
|
/**
|
|
1521
1521
|
* Stores a specified range of elements from the sorted set at `source`, into a new
|
|
@@ -1536,7 +1536,7 @@ class BaseBatch {
|
|
|
1536
1536
|
* Command Response - The number of elements in the resulting sorted set.
|
|
1537
1537
|
*/
|
|
1538
1538
|
zrangeStore(destination, source, rangeQuery, reverse = false) {
|
|
1539
|
-
return this.addAndReturn((0,
|
|
1539
|
+
return this.addAndReturn((0, _1.createZRangeStore)(destination, source, rangeQuery, reverse));
|
|
1540
1540
|
}
|
|
1541
1541
|
/**
|
|
1542
1542
|
* Computes the intersection of sorted sets given by the specified `keys` and stores the result in `destination`.
|
|
@@ -1557,7 +1557,7 @@ class BaseBatch {
|
|
|
1557
1557
|
* Command Response - The number of elements in the resulting sorted set stored at `destination`.
|
|
1558
1558
|
*/
|
|
1559
1559
|
zinterstore(destination, keys, options) {
|
|
1560
|
-
return this.addAndReturn((0,
|
|
1560
|
+
return this.addAndReturn((0, _1.createZInterstore)(destination, keys, options?.aggregationType));
|
|
1561
1561
|
}
|
|
1562
1562
|
/**
|
|
1563
1563
|
* Computes the intersection of sorted sets given by the specified `keys` and returns a list of intersecting elements.
|
|
@@ -1573,7 +1573,7 @@ class BaseBatch {
|
|
|
1573
1573
|
* Command Response - The resulting array of intersecting elements.
|
|
1574
1574
|
*/
|
|
1575
1575
|
zinter(keys) {
|
|
1576
|
-
return this.addAndReturn((0,
|
|
1576
|
+
return this.addAndReturn((0, _1.createZInter)(keys));
|
|
1577
1577
|
}
|
|
1578
1578
|
/**
|
|
1579
1579
|
* Computes the intersection of sorted sets given by the specified `keys` and returns a list of intersecting elements with scores.
|
|
@@ -1596,7 +1596,7 @@ class BaseBatch {
|
|
|
1596
1596
|
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1597
1597
|
*/
|
|
1598
1598
|
zinterWithScores(keys, options) {
|
|
1599
|
-
return this.addAndReturn((0,
|
|
1599
|
+
return this.addAndReturn((0, _1.createZInter)(keys, options?.aggregationType, true));
|
|
1600
1600
|
}
|
|
1601
1601
|
/**
|
|
1602
1602
|
* Computes the union of sorted sets given by the specified `keys` and returns a list of union elements.
|
|
@@ -1612,7 +1612,7 @@ class BaseBatch {
|
|
|
1612
1612
|
* Command Response - The resulting array with a union of sorted set elements.
|
|
1613
1613
|
*/
|
|
1614
1614
|
zunion(keys) {
|
|
1615
|
-
return this.addAndReturn((0,
|
|
1615
|
+
return this.addAndReturn((0, _1.createZUnion)(keys));
|
|
1616
1616
|
}
|
|
1617
1617
|
/**
|
|
1618
1618
|
* Computes the intersection of sorted sets given by the specified `keys` and returns a list of union elements with scores.
|
|
@@ -1633,7 +1633,7 @@ class BaseBatch {
|
|
|
1633
1633
|
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1634
1634
|
*/
|
|
1635
1635
|
zunionWithScores(keys, options) {
|
|
1636
|
-
return this.addAndReturn((0,
|
|
1636
|
+
return this.addAndReturn((0, _1.createZUnion)(keys, options?.aggregationType, true));
|
|
1637
1637
|
}
|
|
1638
1638
|
/**
|
|
1639
1639
|
* Returns a random member from the sorted set stored at `key`.
|
|
@@ -1646,7 +1646,7 @@ class BaseBatch {
|
|
|
1646
1646
|
* If the sorted set does not exist or is empty, the response will be `null`.
|
|
1647
1647
|
*/
|
|
1648
1648
|
zrandmember(key) {
|
|
1649
|
-
return this.addAndReturn((0,
|
|
1649
|
+
return this.addAndReturn((0, _1.createZRandMember)(key));
|
|
1650
1650
|
}
|
|
1651
1651
|
/**
|
|
1652
1652
|
* Returns random members from the sorted set stored at `key`.
|
|
@@ -1662,7 +1662,7 @@ class BaseBatch {
|
|
|
1662
1662
|
* If the sorted set does not exist or is empty, the response will be an empty `array`.
|
|
1663
1663
|
*/
|
|
1664
1664
|
zrandmemberWithCount(key, count) {
|
|
1665
|
-
return this.addAndReturn((0,
|
|
1665
|
+
return this.addAndReturn((0, _1.createZRandMember)(key, count));
|
|
1666
1666
|
}
|
|
1667
1667
|
/**
|
|
1668
1668
|
* Returns random members with scores from the sorted set stored at `key`.
|
|
@@ -1678,7 +1678,7 @@ class BaseBatch {
|
|
|
1678
1678
|
* If the sorted set does not exist or is empty, the response will be an empty `array`.
|
|
1679
1679
|
*/
|
|
1680
1680
|
zrandmemberWithCountWithScores(key, count) {
|
|
1681
|
-
return this.addAndReturn((0,
|
|
1681
|
+
return this.addAndReturn((0, _1.createZRandMember)(key, count, true));
|
|
1682
1682
|
}
|
|
1683
1683
|
/**
|
|
1684
1684
|
* Returns the string representation of the type of the value stored at `key`.
|
|
@@ -1690,7 +1690,7 @@ class BaseBatch {
|
|
|
1690
1690
|
* Command Response - If the key exists, the type of the stored value is returned. Otherwise, a "none" string is returned.
|
|
1691
1691
|
*/
|
|
1692
1692
|
type(key) {
|
|
1693
|
-
return this.addAndReturn((0,
|
|
1693
|
+
return this.addAndReturn((0, _1.createType)(key));
|
|
1694
1694
|
}
|
|
1695
1695
|
/**
|
|
1696
1696
|
* Returns the length of the string value stored at `key`.
|
|
@@ -1703,7 +1703,7 @@ class BaseBatch {
|
|
|
1703
1703
|
* If `key` does not exist, it is treated as an empty string, and the command returns `0`.
|
|
1704
1704
|
*/
|
|
1705
1705
|
strlen(key) {
|
|
1706
|
-
return this.addAndReturn((0,
|
|
1706
|
+
return this.addAndReturn((0, _1.createStrlen)(key));
|
|
1707
1707
|
}
|
|
1708
1708
|
/**
|
|
1709
1709
|
* Removes and returns the members with the lowest scores from the sorted set stored at `key`.
|
|
@@ -1721,7 +1721,7 @@ class BaseBatch {
|
|
|
1721
1721
|
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1722
1722
|
*/
|
|
1723
1723
|
zpopmin(key, count) {
|
|
1724
|
-
return this.addAndReturn((0,
|
|
1724
|
+
return this.addAndReturn((0, _1.createZPopMin)(key, count));
|
|
1725
1725
|
}
|
|
1726
1726
|
/**
|
|
1727
1727
|
* Blocks the connection until it removes and returns a member with the lowest score from the
|
|
@@ -1739,7 +1739,7 @@ class BaseBatch {
|
|
|
1739
1739
|
* If no member could be popped and the `timeout` expired, returns `null`.
|
|
1740
1740
|
*/
|
|
1741
1741
|
bzpopmin(keys, timeout) {
|
|
1742
|
-
return this.addAndReturn((0,
|
|
1742
|
+
return this.addAndReturn((0, _1.createBZPopMin)(keys, timeout));
|
|
1743
1743
|
}
|
|
1744
1744
|
/**
|
|
1745
1745
|
* Removes and returns the members with the highest scores from the sorted set stored at `key`.
|
|
@@ -1757,7 +1757,7 @@ class BaseBatch {
|
|
|
1757
1757
|
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1758
1758
|
*/
|
|
1759
1759
|
zpopmax(key, count) {
|
|
1760
|
-
return this.addAndReturn((0,
|
|
1760
|
+
return this.addAndReturn((0, _1.createZPopMax)(key, count));
|
|
1761
1761
|
}
|
|
1762
1762
|
/**
|
|
1763
1763
|
* Blocks the connection until it removes and returns a member with the highest score from the
|
|
@@ -1775,7 +1775,7 @@ class BaseBatch {
|
|
|
1775
1775
|
* If no member could be popped and the `timeout` expired, returns `null`.
|
|
1776
1776
|
*/
|
|
1777
1777
|
bzpopmax(keys, timeout) {
|
|
1778
|
-
return this.addAndReturn((0,
|
|
1778
|
+
return this.addAndReturn((0, _1.createBZPopMax)(keys, timeout));
|
|
1779
1779
|
}
|
|
1780
1780
|
/**
|
|
1781
1781
|
* Echoes the provided `message` back
|
|
@@ -1787,7 +1787,7 @@ class BaseBatch {
|
|
|
1787
1787
|
* Command Response - The provided `message`.
|
|
1788
1788
|
*/
|
|
1789
1789
|
echo(message) {
|
|
1790
|
-
return this.addAndReturn((0,
|
|
1790
|
+
return this.addAndReturn((0, _1.createEcho)(message));
|
|
1791
1791
|
}
|
|
1792
1792
|
/**
|
|
1793
1793
|
* Returns the remaining time to live of `key` that has a timeout, in milliseconds.
|
|
@@ -1799,7 +1799,7 @@ class BaseBatch {
|
|
|
1799
1799
|
* Command Response - TTL in milliseconds, `-2` if `key` does not exist, `-1` if `key` exists but has no associated expire.
|
|
1800
1800
|
*/
|
|
1801
1801
|
pttl(key) {
|
|
1802
|
-
return this.addAndReturn((0,
|
|
1802
|
+
return this.addAndReturn((0, _1.createPTTL)(key));
|
|
1803
1803
|
}
|
|
1804
1804
|
/**
|
|
1805
1805
|
* Removes all elements in the sorted set stored at `key` with rank between `start` and `end`.
|
|
@@ -1818,7 +1818,7 @@ class BaseBatch {
|
|
|
1818
1818
|
* If `key` does not exist 0 will be returned.
|
|
1819
1819
|
*/
|
|
1820
1820
|
zremRangeByRank(key, start, end) {
|
|
1821
|
-
return this.addAndReturn((0,
|
|
1821
|
+
return this.addAndReturn((0, _1.createZRemRangeByRank)(key, start, end));
|
|
1822
1822
|
}
|
|
1823
1823
|
/**
|
|
1824
1824
|
* Removes all elements in the sorted set stored at `key` with lexicographical order between `minLex` and `maxLex`.
|
|
@@ -1834,7 +1834,7 @@ class BaseBatch {
|
|
|
1834
1834
|
* If `minLex` is greater than `maxLex`, 0 is returned.
|
|
1835
1835
|
*/
|
|
1836
1836
|
zremRangeByLex(key, minLex, maxLex) {
|
|
1837
|
-
return this.addAndReturn((0,
|
|
1837
|
+
return this.addAndReturn((0, _1.createZRemRangeByLex)(key, minLex, maxLex));
|
|
1838
1838
|
}
|
|
1839
1839
|
/**
|
|
1840
1840
|
* Removes all elements in the sorted set stored at `key` with a score between `minScore` and `maxScore`.
|
|
@@ -1850,7 +1850,7 @@ class BaseBatch {
|
|
|
1850
1850
|
* If `minScore` is greater than `maxScore`, 0 is returned.
|
|
1851
1851
|
*/
|
|
1852
1852
|
zremRangeByScore(key, minScore, maxScore) {
|
|
1853
|
-
return this.addAndReturn((0,
|
|
1853
|
+
return this.addAndReturn((0, _1.createZRemRangeByScore)(key, minScore, maxScore));
|
|
1854
1854
|
}
|
|
1855
1855
|
/**
|
|
1856
1856
|
* Returns the number of members in the sorted set stored at 'key' with scores between 'minLex' and 'maxLex'.
|
|
@@ -1866,7 +1866,7 @@ class BaseBatch {
|
|
|
1866
1866
|
* If maxLex is less than minLex, '0' is returned.
|
|
1867
1867
|
*/
|
|
1868
1868
|
zlexcount(key, minLex, maxLex) {
|
|
1869
|
-
return this.addAndReturn((0,
|
|
1869
|
+
return this.addAndReturn((0, _1.createZLexCount)(key, minLex, maxLex));
|
|
1870
1870
|
}
|
|
1871
1871
|
/**
|
|
1872
1872
|
* Returns the rank of `member` in the sorted set stored at `key`, with scores ordered from low to high.
|
|
@@ -1881,7 +1881,7 @@ class BaseBatch {
|
|
|
1881
1881
|
* If `key` doesn't exist, or if `member` is not present in the set, null will be returned.
|
|
1882
1882
|
*/
|
|
1883
1883
|
zrank(key, member) {
|
|
1884
|
-
return this.addAndReturn((0,
|
|
1884
|
+
return this.addAndReturn((0, _1.createZRank)(key, member));
|
|
1885
1885
|
}
|
|
1886
1886
|
/**
|
|
1887
1887
|
* Returns the rank of `member` in the sorted set stored at `key` with its score, where scores are ordered from the lowest to highest.
|
|
@@ -1896,7 +1896,7 @@ class BaseBatch {
|
|
|
1896
1896
|
* If `key` doesn't exist, or if `member` is not present in the set, null will be returned.
|
|
1897
1897
|
*/
|
|
1898
1898
|
zrankWithScore(key, member) {
|
|
1899
|
-
return this.addAndReturn((0,
|
|
1899
|
+
return this.addAndReturn((0, _1.createZRank)(key, member, true));
|
|
1900
1900
|
}
|
|
1901
1901
|
/**
|
|
1902
1902
|
* Returns the rank of `member` in the sorted set stored at `key`, where
|
|
@@ -1912,7 +1912,7 @@ class BaseBatch {
|
|
|
1912
1912
|
* If `key` doesn't exist, or if `member` is not present in the set, `null` will be returned.
|
|
1913
1913
|
*/
|
|
1914
1914
|
zrevrank(key, member) {
|
|
1915
|
-
return this.addAndReturn((0,
|
|
1915
|
+
return this.addAndReturn((0, _1.createZRevRank)(key, member));
|
|
1916
1916
|
}
|
|
1917
1917
|
/**
|
|
1918
1918
|
* Returns the rank of `member` in the sorted set stored at `key` with its
|
|
@@ -1929,7 +1929,7 @@ class BaseBatch {
|
|
|
1929
1929
|
* If `key` doesn't exist, or if `member` is not present in the set, `null` will be returned.
|
|
1930
1930
|
*/
|
|
1931
1931
|
zrevrankWithScore(key, member) {
|
|
1932
|
-
return this.addAndReturn((0,
|
|
1932
|
+
return this.addAndReturn((0, _1.createZRevRankWithScore)(key, member));
|
|
1933
1933
|
}
|
|
1934
1934
|
/**
|
|
1935
1935
|
* Removes the existing timeout on `key`, turning the key from volatile (a key with an expire set) to
|
|
@@ -1942,7 +1942,7 @@ class BaseBatch {
|
|
|
1942
1942
|
* Command Response - `false` if `key` does not exist or does not have an associated timeout, `true` if the timeout has been removed.
|
|
1943
1943
|
*/
|
|
1944
1944
|
persist(key) {
|
|
1945
|
-
return this.addAndReturn((0,
|
|
1945
|
+
return this.addAndReturn((0, _1.createPersist)(key));
|
|
1946
1946
|
}
|
|
1947
1947
|
/** Executes a single command, without checking inputs. Every part of the command, including subcommands,
|
|
1948
1948
|
* should be added as a separate value in args.
|
|
@@ -1952,7 +1952,7 @@ class BaseBatch {
|
|
|
1952
1952
|
* Command Response - A response from Valkey with an `Object`.
|
|
1953
1953
|
*/
|
|
1954
1954
|
customCommand(args) {
|
|
1955
|
-
return this.addAndReturn((0,
|
|
1955
|
+
return this.addAndReturn((0, _1.createCustomCommand)(args));
|
|
1956
1956
|
}
|
|
1957
1957
|
/** Returns the element at index `index` in the list stored at `key`.
|
|
1958
1958
|
* The index is zero-based, so 0 means the first element, 1 the second element and so on.
|
|
@@ -1966,7 +1966,7 @@ class BaseBatch {
|
|
|
1966
1966
|
* If `index` is out of range or if `key` does not exist, null is returned.
|
|
1967
1967
|
*/
|
|
1968
1968
|
lindex(key, index) {
|
|
1969
|
-
return this.addAndReturn((0,
|
|
1969
|
+
return this.addAndReturn((0, _1.createLIndex)(key, index));
|
|
1970
1970
|
}
|
|
1971
1971
|
/**
|
|
1972
1972
|
* Inserts `element` in the list at `key` either before or after the `pivot`.
|
|
@@ -1984,7 +1984,7 @@ class BaseBatch {
|
|
|
1984
1984
|
* If the `pivot` wasn't found, returns `0`.
|
|
1985
1985
|
*/
|
|
1986
1986
|
linsert(key, position, pivot, element) {
|
|
1987
|
-
return this.addAndReturn((0,
|
|
1987
|
+
return this.addAndReturn((0, _1.createLInsert)(key, position, pivot, element));
|
|
1988
1988
|
}
|
|
1989
1989
|
/**
|
|
1990
1990
|
* Adds an entry to the specified stream stored at `key`. If the `key` doesn't exist, the stream is created.
|
|
@@ -1998,7 +1998,7 @@ class BaseBatch {
|
|
|
1998
1998
|
* Command Response - The id of the added entry, or `null` if `options.makeStream` is set to `false` and no stream with the matching `key` exists.
|
|
1999
1999
|
*/
|
|
2000
2000
|
xadd(key, values, options) {
|
|
2001
|
-
return this.addAndReturn((0,
|
|
2001
|
+
return this.addAndReturn((0, _1.createXAdd)(key, values, options));
|
|
2002
2002
|
}
|
|
2003
2003
|
/**
|
|
2004
2004
|
* Removes the specified entries by id from a stream, and returns the number of entries deleted.
|
|
@@ -2012,7 +2012,7 @@ class BaseBatch {
|
|
|
2012
2012
|
* `ids`, if the specified `ids` don't exist in the stream.
|
|
2013
2013
|
*/
|
|
2014
2014
|
xdel(key, ids) {
|
|
2015
|
-
return this.addAndReturn((0,
|
|
2015
|
+
return this.addAndReturn((0, _1.createXDel)(key, ids));
|
|
2016
2016
|
}
|
|
2017
2017
|
/**
|
|
2018
2018
|
* Trims the stream stored at `key` by evicting older entries.
|
|
@@ -2024,7 +2024,7 @@ class BaseBatch {
|
|
|
2024
2024
|
* Command Response - The number of entries deleted from the stream. If `key` doesn't exist, 0 is returned.
|
|
2025
2025
|
*/
|
|
2026
2026
|
xtrim(key, options) {
|
|
2027
|
-
return this.addAndReturn((0,
|
|
2027
|
+
return this.addAndReturn((0, _1.createXTrim)(key, options));
|
|
2028
2028
|
}
|
|
2029
2029
|
/**
|
|
2030
2030
|
* Returns information about the stream stored at `key`.
|
|
@@ -2039,7 +2039,7 @@ class BaseBatch {
|
|
|
2039
2039
|
* The response comes in format `GlideRecord<StreamEntries | GlideRecord<StreamEntries | GlideRecord<StreamEntries>[]>[]>`, see {@link GlideRecord}.
|
|
2040
2040
|
*/
|
|
2041
2041
|
xinfoStream(key, fullOptions) {
|
|
2042
|
-
return this.addAndReturn((0,
|
|
2042
|
+
return this.addAndReturn((0, _1.createXInfoStream)(key, fullOptions ?? false));
|
|
2043
2043
|
}
|
|
2044
2044
|
/**
|
|
2045
2045
|
* Returns the list of all consumer groups and their attributes for the stream stored at `key`.
|
|
@@ -2053,7 +2053,7 @@ class BaseBatch {
|
|
|
2053
2053
|
* The response comes in format `GlideRecord<GlideString | number | null>[]`, see {@link GlideRecord}.
|
|
2054
2054
|
*/
|
|
2055
2055
|
xinfoGroups(key) {
|
|
2056
|
-
return this.addAndReturn((0,
|
|
2056
|
+
return this.addAndReturn((0, _1.createXInfoGroups)(key));
|
|
2057
2057
|
}
|
|
2058
2058
|
/**
|
|
2059
2059
|
* Returns the server time.
|
|
@@ -2065,7 +2065,7 @@ class BaseBatch {
|
|
|
2065
2065
|
* - The amount of microseconds already elapsed in the current second.
|
|
2066
2066
|
*/
|
|
2067
2067
|
time() {
|
|
2068
|
-
return this.addAndReturn((0,
|
|
2068
|
+
return this.addAndReturn((0, _1.createTime)());
|
|
2069
2069
|
}
|
|
2070
2070
|
/**
|
|
2071
2071
|
* Returns stream entries matching a given range of entry IDs.
|
|
@@ -2088,7 +2088,7 @@ class BaseBatch {
|
|
|
2088
2088
|
* The response comes in format `GlideRecord<[GlideString, GlideString][]> | null`, see {@link GlideRecord}.
|
|
2089
2089
|
*/
|
|
2090
2090
|
xrange(key, start, end, count) {
|
|
2091
|
-
return this.addAndReturn((0,
|
|
2091
|
+
return this.addAndReturn((0, _1.createXRange)(key, start, end, count));
|
|
2092
2092
|
}
|
|
2093
2093
|
/**
|
|
2094
2094
|
* Returns stream entries matching a given range of entry IDs in reverse order. Equivalent to {@link xrange} but returns the
|
|
@@ -2112,7 +2112,7 @@ class BaseBatch {
|
|
|
2112
2112
|
* The response comes in format `GlideRecord<[GlideString, GlideString][]> | null`, see {@link GlideRecord}.
|
|
2113
2113
|
*/
|
|
2114
2114
|
xrevrange(key, end, start, count) {
|
|
2115
|
-
return this.addAndReturn((0,
|
|
2115
|
+
return this.addAndReturn((0, _1.createXRevRange)(key, end, start, count));
|
|
2116
2116
|
}
|
|
2117
2117
|
/**
|
|
2118
2118
|
* Reads entries from the given streams.
|
|
@@ -2131,7 +2131,7 @@ class BaseBatch {
|
|
|
2131
2131
|
return { key: e[0], value: e[1] };
|
|
2132
2132
|
});
|
|
2133
2133
|
}
|
|
2134
|
-
return this.addAndReturn((0,
|
|
2134
|
+
return this.addAndReturn((0, _1.createXRead)(keys_and_ids, options));
|
|
2135
2135
|
}
|
|
2136
2136
|
/**
|
|
2137
2137
|
* Reads entries from the given streams owned by a consumer group.
|
|
@@ -2154,7 +2154,7 @@ class BaseBatch {
|
|
|
2154
2154
|
return { key: e[0], value: e[1] };
|
|
2155
2155
|
});
|
|
2156
2156
|
}
|
|
2157
|
-
return this.addAndReturn((0,
|
|
2157
|
+
return this.addAndReturn((0, _1.createXReadGroup)(group, consumer, keys_and_ids, options));
|
|
2158
2158
|
}
|
|
2159
2159
|
/**
|
|
2160
2160
|
* Returns the number of entries in the stream stored at `key`.
|
|
@@ -2166,7 +2166,7 @@ class BaseBatch {
|
|
|
2166
2166
|
* Command Response - The number of entries in the stream. If `key` does not exist, returns `0`.
|
|
2167
2167
|
*/
|
|
2168
2168
|
xlen(key) {
|
|
2169
|
-
return this.addAndReturn((0,
|
|
2169
|
+
return this.addAndReturn((0, _1.createXLen)(key));
|
|
2170
2170
|
}
|
|
2171
2171
|
/**
|
|
2172
2172
|
* Returns stream message summary information for pending messages matching a given range of IDs.
|
|
@@ -2180,7 +2180,7 @@ class BaseBatch {
|
|
|
2180
2180
|
* See example of {@link BaseClient.xpending|xpending} for more details.
|
|
2181
2181
|
*/
|
|
2182
2182
|
xpending(key, group) {
|
|
2183
|
-
return this.addAndReturn((0,
|
|
2183
|
+
return this.addAndReturn((0, _1.createXPending)(key, group));
|
|
2184
2184
|
}
|
|
2185
2185
|
/**
|
|
2186
2186
|
* Returns stream message summary information for pending messages matching a given range of IDs.
|
|
@@ -2195,7 +2195,7 @@ class BaseBatch {
|
|
|
2195
2195
|
* See example of {@link BaseClient.xpendingWithOptions|xpendingWithOptions} for more details.
|
|
2196
2196
|
*/
|
|
2197
2197
|
xpendingWithOptions(key, group, options) {
|
|
2198
|
-
return this.addAndReturn((0,
|
|
2198
|
+
return this.addAndReturn((0, _1.createXPending)(key, group, options));
|
|
2199
2199
|
}
|
|
2200
2200
|
/**
|
|
2201
2201
|
* Returns the list of all consumers and their attributes for the given consumer group of the
|
|
@@ -2208,7 +2208,7 @@ class BaseBatch {
|
|
|
2208
2208
|
* The response comes in format `GlideRecord<GlideString | number>[]`, see {@link GlideRecord}.
|
|
2209
2209
|
*/
|
|
2210
2210
|
xinfoConsumers(key, group) {
|
|
2211
|
-
return this.addAndReturn((0,
|
|
2211
|
+
return this.addAndReturn((0, _1.createXInfoConsumers)(key, group));
|
|
2212
2212
|
}
|
|
2213
2213
|
/**
|
|
2214
2214
|
* Changes the ownership of a pending message.
|
|
@@ -2226,7 +2226,7 @@ class BaseBatch {
|
|
|
2226
2226
|
* The response comes in format `GlideRecord<[GlideString, GlideString][]>`, see {@link GlideRecord}.
|
|
2227
2227
|
*/
|
|
2228
2228
|
xclaim(key, group, consumer, minIdleTime, ids, options) {
|
|
2229
|
-
return this.addAndReturn((0,
|
|
2229
|
+
return this.addAndReturn((0, _1.createXClaim)(key, group, consumer, minIdleTime, ids, options));
|
|
2230
2230
|
}
|
|
2231
2231
|
/**
|
|
2232
2232
|
* Changes the ownership of a pending message. This function returns an `array` with
|
|
@@ -2244,7 +2244,7 @@ class BaseBatch {
|
|
|
2244
2244
|
* Command Response - An `array` of message ids claimed by the consumer.
|
|
2245
2245
|
*/
|
|
2246
2246
|
xclaimJustId(key, group, consumer, minIdleTime, ids, options) {
|
|
2247
|
-
return this.addAndReturn((0,
|
|
2247
|
+
return this.addAndReturn((0, _1.createXClaim)(key, group, consumer, minIdleTime, ids, options, true));
|
|
2248
2248
|
}
|
|
2249
2249
|
/**
|
|
2250
2250
|
* Transfers ownership of pending stream entries that match the specified criteria.
|
|
@@ -2273,7 +2273,7 @@ class BaseBatch {
|
|
|
2273
2273
|
* The response comes in format `[GlideString, GlideRecord<[GlideString, GlideString][]>, GlideString[]?]`, see {@link GlideRecord}.
|
|
2274
2274
|
*/
|
|
2275
2275
|
xautoclaim(key, group, consumer, minIdleTime, start, options) {
|
|
2276
|
-
return this.addAndReturn((0,
|
|
2276
|
+
return this.addAndReturn((0, _1.createXAutoClaim)(key, group, consumer, minIdleTime, start, options?.count));
|
|
2277
2277
|
}
|
|
2278
2278
|
/**
|
|
2279
2279
|
* Transfers ownership of pending stream entries that match the specified criteria.
|
|
@@ -2300,7 +2300,7 @@ class BaseBatch {
|
|
|
2300
2300
|
* These IDs are deleted from the Pending Entries List.
|
|
2301
2301
|
*/
|
|
2302
2302
|
xautoclaimJustId(key, group, consumer, minIdleTime, start, options) {
|
|
2303
|
-
return this.addAndReturn((0,
|
|
2303
|
+
return this.addAndReturn((0, _1.createXAutoClaim)(key, group, consumer, minIdleTime, start, options?.count, true));
|
|
2304
2304
|
}
|
|
2305
2305
|
/**
|
|
2306
2306
|
* Creates a new consumer group uniquely identified by `groupname` for the stream
|
|
@@ -2317,7 +2317,7 @@ class BaseBatch {
|
|
|
2317
2317
|
* Command Response - `"OK"`.
|
|
2318
2318
|
*/
|
|
2319
2319
|
xgroupCreate(key, groupName, id, options) {
|
|
2320
|
-
return this.addAndReturn((0,
|
|
2320
|
+
return this.addAndReturn((0, _1.createXGroupCreate)(key, groupName, id, options));
|
|
2321
2321
|
}
|
|
2322
2322
|
/**
|
|
2323
2323
|
* Destroys the consumer group `groupname` for the stream stored at `key`.
|
|
@@ -2330,7 +2330,7 @@ class BaseBatch {
|
|
|
2330
2330
|
* Command Response - `true` if the consumer group is destroyed. Otherwise, `false`.
|
|
2331
2331
|
*/
|
|
2332
2332
|
xgroupDestroy(key, groupName) {
|
|
2333
|
-
return this.addAndReturn((0,
|
|
2333
|
+
return this.addAndReturn((0, _1.createXGroupDestroy)(key, groupName));
|
|
2334
2334
|
}
|
|
2335
2335
|
/**
|
|
2336
2336
|
* Creates a consumer named `consumerName` in the consumer group `groupName` for the stream stored at `key`.
|
|
@@ -2344,7 +2344,7 @@ class BaseBatch {
|
|
|
2344
2344
|
* Command Response - `true` if the consumer is created. Otherwise, returns `false`.
|
|
2345
2345
|
*/
|
|
2346
2346
|
xgroupCreateConsumer(key, groupName, consumerName) {
|
|
2347
|
-
return this.addAndReturn((0,
|
|
2347
|
+
return this.addAndReturn((0, _1.createXGroupCreateConsumer)(key, groupName, consumerName));
|
|
2348
2348
|
}
|
|
2349
2349
|
/**
|
|
2350
2350
|
* Deletes a consumer named `consumerName` in the consumer group `groupName` for the stream stored at `key`.
|
|
@@ -2358,7 +2358,7 @@ class BaseBatch {
|
|
|
2358
2358
|
* Command Response - The number of pending messages the `consumer` had before it was deleted.
|
|
2359
2359
|
*/
|
|
2360
2360
|
xgroupDelConsumer(key, groupName, consumerName) {
|
|
2361
|
-
return this.addAndReturn((0,
|
|
2361
|
+
return this.addAndReturn((0, _1.createXGroupDelConsumer)(key, groupName, consumerName));
|
|
2362
2362
|
}
|
|
2363
2363
|
/**
|
|
2364
2364
|
* Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.
|
|
@@ -2373,7 +2373,7 @@ class BaseBatch {
|
|
|
2373
2373
|
* Command Response - The number of messages that were successfully acknowledged.
|
|
2374
2374
|
*/
|
|
2375
2375
|
xack(key, group, ids) {
|
|
2376
|
-
return this.addAndReturn((0,
|
|
2376
|
+
return this.addAndReturn((0, _1.createXAck)(key, group, ids));
|
|
2377
2377
|
}
|
|
2378
2378
|
/**
|
|
2379
2379
|
* Sets the last delivered ID for a consumer group.
|
|
@@ -2390,7 +2390,7 @@ class BaseBatch {
|
|
|
2390
2390
|
* Command Response - `"OK"`.
|
|
2391
2391
|
*/
|
|
2392
2392
|
xgroupSetId(key, groupName, id, options) {
|
|
2393
|
-
return this.addAndReturn((0,
|
|
2393
|
+
return this.addAndReturn((0, _1.createXGroupSetid)(key, groupName, id, options?.entriesRead));
|
|
2394
2394
|
}
|
|
2395
2395
|
/**
|
|
2396
2396
|
* Renames `key` to `newkey`.
|
|
@@ -2404,7 +2404,7 @@ class BaseBatch {
|
|
|
2404
2404
|
* Command Response - If the `key` was successfully renamed, return "OK". If `key` does not exist, an error is thrown.
|
|
2405
2405
|
*/
|
|
2406
2406
|
rename(key, newKey) {
|
|
2407
|
-
return this.addAndReturn((0,
|
|
2407
|
+
return this.addAndReturn((0, _1.createRename)(key, newKey));
|
|
2408
2408
|
}
|
|
2409
2409
|
/**
|
|
2410
2410
|
* Renames `key` to `newkey` if `newkey` does not yet exist.
|
|
@@ -2418,7 +2418,7 @@ class BaseBatch {
|
|
|
2418
2418
|
* If `key` does not exist, an error is thrown.
|
|
2419
2419
|
*/
|
|
2420
2420
|
renamenx(key, newKey) {
|
|
2421
|
-
return this.addAndReturn((0,
|
|
2421
|
+
return this.addAndReturn((0, _1.createRenameNX)(key, newKey));
|
|
2422
2422
|
}
|
|
2423
2423
|
/** Blocking list pop primitive.
|
|
2424
2424
|
* Pop an element from the tail of the first list that is non-empty,
|
|
@@ -2435,7 +2435,7 @@ class BaseBatch {
|
|
|
2435
2435
|
* formatted as [key, value]. If no element could be popped and the timeout expired, returns `null`.
|
|
2436
2436
|
*/
|
|
2437
2437
|
brpop(keys, timeout) {
|
|
2438
|
-
return this.addAndReturn((0,
|
|
2438
|
+
return this.addAndReturn((0, _1.createBRPop)(keys, timeout));
|
|
2439
2439
|
}
|
|
2440
2440
|
/** Blocking list pop primitive.
|
|
2441
2441
|
* Pop an element from the head of the first list that is non-empty,
|
|
@@ -2452,7 +2452,7 @@ class BaseBatch {
|
|
|
2452
2452
|
* formatted as [key, value]. If no element could be popped and the timeout expired, returns `null`.
|
|
2453
2453
|
*/
|
|
2454
2454
|
blpop(keys, timeout) {
|
|
2455
|
-
return this.addAndReturn((0,
|
|
2455
|
+
return this.addAndReturn((0, _1.createBLPop)(keys, timeout));
|
|
2456
2456
|
}
|
|
2457
2457
|
/** Adds all elements to the HyperLogLog data structure stored at the specified `key`.
|
|
2458
2458
|
* Creates a new structure if the `key` does not exist.
|
|
@@ -2463,10 +2463,10 @@ class BaseBatch {
|
|
|
2463
2463
|
* @param key - The key of the HyperLogLog data structure to add elements into.
|
|
2464
2464
|
* @param elements - An array of members to add to the HyperLogLog stored at `key`.
|
|
2465
2465
|
* Command Response - If the HyperLogLog is newly created, or if the HyperLogLog approximated cardinality is
|
|
2466
|
-
* altered, then returns `
|
|
2466
|
+
* altered, then returns `true`. Otherwise, returns `false`.
|
|
2467
2467
|
*/
|
|
2468
2468
|
pfadd(key, elements) {
|
|
2469
|
-
return this.addAndReturn((0,
|
|
2469
|
+
return this.addAndReturn((0, _1.createPfAdd)(key, elements));
|
|
2470
2470
|
}
|
|
2471
2471
|
/** Estimates the cardinality of the data stored in a HyperLogLog structure for a single key or
|
|
2472
2472
|
* calculates the combined cardinality of multiple keys by merging their HyperLogLogs temporarily.
|
|
@@ -2478,7 +2478,7 @@ class BaseBatch {
|
|
|
2478
2478
|
* The cardinality of a key that does not exist is `0`.
|
|
2479
2479
|
*/
|
|
2480
2480
|
pfcount(keys) {
|
|
2481
|
-
return this.addAndReturn((0,
|
|
2481
|
+
return this.addAndReturn((0, _1.createPfCount)(keys));
|
|
2482
2482
|
}
|
|
2483
2483
|
/**
|
|
2484
2484
|
* Merges multiple HyperLogLog values into a unique value. If the destination variable exists, it is
|
|
@@ -2491,7 +2491,7 @@ class BaseBatch {
|
|
|
2491
2491
|
* Command Response - A simple "OK" response.
|
|
2492
2492
|
*/
|
|
2493
2493
|
pfmerge(destination, sourceKeys) {
|
|
2494
|
-
return this.addAndReturn((0,
|
|
2494
|
+
return this.addAndReturn((0, _1.createPfMerge)(destination, sourceKeys));
|
|
2495
2495
|
}
|
|
2496
2496
|
/**
|
|
2497
2497
|
* Returns the internal encoding for the Valkey object stored at `key`.
|
|
@@ -2504,7 +2504,7 @@ class BaseBatch {
|
|
|
2504
2504
|
* Otherwise, returns None.
|
|
2505
2505
|
*/
|
|
2506
2506
|
objectEncoding(key) {
|
|
2507
|
-
return this.addAndReturn((0,
|
|
2507
|
+
return this.addAndReturn((0, _1.createObjectEncoding)(key));
|
|
2508
2508
|
}
|
|
2509
2509
|
/**
|
|
2510
2510
|
* Returns the logarithmic access frequency counter of a Valkey object stored at `key`.
|
|
@@ -2517,7 +2517,7 @@ class BaseBatch {
|
|
|
2517
2517
|
* the object stored at `key` as a `number`. Otherwise, returns `null`.
|
|
2518
2518
|
*/
|
|
2519
2519
|
objectFreq(key) {
|
|
2520
|
-
return this.addAndReturn((0,
|
|
2520
|
+
return this.addAndReturn((0, _1.createObjectFreq)(key));
|
|
2521
2521
|
}
|
|
2522
2522
|
/**
|
|
2523
2523
|
* Returns the time in seconds since the last access to the value stored at `key`.
|
|
@@ -2529,7 +2529,7 @@ class BaseBatch {
|
|
|
2529
2529
|
* Command Response - If `key` exists, returns the idle time in seconds. Otherwise, returns `null`.
|
|
2530
2530
|
*/
|
|
2531
2531
|
objectIdletime(key) {
|
|
2532
|
-
return this.addAndReturn((0,
|
|
2532
|
+
return this.addAndReturn((0, _1.createObjectIdletime)(key));
|
|
2533
2533
|
}
|
|
2534
2534
|
/**
|
|
2535
2535
|
* Returns the reference count of the object stored at `key`.
|
|
@@ -2542,7 +2542,7 @@ class BaseBatch {
|
|
|
2542
2542
|
* Otherwise, returns `null`.
|
|
2543
2543
|
*/
|
|
2544
2544
|
objectRefcount(key) {
|
|
2545
|
-
return this.addAndReturn((0,
|
|
2545
|
+
return this.addAndReturn((0, _1.createObjectRefcount)(key));
|
|
2546
2546
|
}
|
|
2547
2547
|
/**
|
|
2548
2548
|
* Displays a piece of generative computer art and the server version.
|
|
@@ -2554,7 +2554,7 @@ class BaseBatch {
|
|
|
2554
2554
|
* Command Response - A piece of generative computer art along with the current server version.
|
|
2555
2555
|
*/
|
|
2556
2556
|
lolwut(options) {
|
|
2557
|
-
return this.addAndReturn((0,
|
|
2557
|
+
return this.addAndReturn((0, _1.createLolwut)(options));
|
|
2558
2558
|
}
|
|
2559
2559
|
/**
|
|
2560
2560
|
* Blocks the current client until all the previous write commands are successfully transferred and
|
|
@@ -2570,7 +2570,7 @@ class BaseBatch {
|
|
|
2570
2570
|
* current connection.
|
|
2571
2571
|
*/
|
|
2572
2572
|
wait(numreplicas, timeout) {
|
|
2573
|
-
return this.addAndReturn((0,
|
|
2573
|
+
return this.addAndReturn((0, _1.createWait)(numreplicas, timeout));
|
|
2574
2574
|
}
|
|
2575
2575
|
/**
|
|
2576
2576
|
* Invokes a previously loaded function.
|
|
@@ -2586,7 +2586,7 @@ class BaseBatch {
|
|
|
2586
2586
|
* Command Response - The invoked function's return value.
|
|
2587
2587
|
*/
|
|
2588
2588
|
fcall(func, keys, args) {
|
|
2589
|
-
return this.addAndReturn((0,
|
|
2589
|
+
return this.addAndReturn((0, _1.createFCall)(func, keys, args));
|
|
2590
2590
|
}
|
|
2591
2591
|
/**
|
|
2592
2592
|
* Invokes a previously loaded read-only function.
|
|
@@ -2602,7 +2602,7 @@ class BaseBatch {
|
|
|
2602
2602
|
* Command Response - The invoked function's return value.
|
|
2603
2603
|
*/
|
|
2604
2604
|
fcallReadonly(func, keys, args) {
|
|
2605
|
-
return this.addAndReturn((0,
|
|
2605
|
+
return this.addAndReturn((0, _1.createFCallReadOnly)(func, keys, args));
|
|
2606
2606
|
}
|
|
2607
2607
|
/**
|
|
2608
2608
|
* Deletes a library and all its functions.
|
|
@@ -2615,7 +2615,7 @@ class BaseBatch {
|
|
|
2615
2615
|
* Command Response - `"OK"`.
|
|
2616
2616
|
*/
|
|
2617
2617
|
functionDelete(libraryCode) {
|
|
2618
|
-
return this.addAndReturn((0,
|
|
2618
|
+
return this.addAndReturn((0, _1.createFunctionDelete)(libraryCode));
|
|
2619
2619
|
}
|
|
2620
2620
|
/**
|
|
2621
2621
|
* Loads a library to Valkey.
|
|
@@ -2630,7 +2630,7 @@ class BaseBatch {
|
|
|
2630
2630
|
* Command Response - The library name that was loaded.
|
|
2631
2631
|
*/
|
|
2632
2632
|
functionLoad(libraryCode, replace) {
|
|
2633
|
-
return this.addAndReturn((0,
|
|
2633
|
+
return this.addAndReturn((0, _1.createFunctionLoad)(libraryCode, replace));
|
|
2634
2634
|
}
|
|
2635
2635
|
/**
|
|
2636
2636
|
* Deletes all function libraries.
|
|
@@ -2642,7 +2642,7 @@ class BaseBatch {
|
|
|
2642
2642
|
* Command Response - `"OK"`.
|
|
2643
2643
|
*/
|
|
2644
2644
|
functionFlush(mode) {
|
|
2645
|
-
return this.addAndReturn((0,
|
|
2645
|
+
return this.addAndReturn((0, _1.createFunctionFlush)(mode));
|
|
2646
2646
|
}
|
|
2647
2647
|
/**
|
|
2648
2648
|
* Returns information about the functions and libraries.
|
|
@@ -2655,7 +2655,7 @@ class BaseBatch {
|
|
|
2655
2655
|
* Command Response - Info about all or selected libraries and their functions in {@link FunctionListResponse} format.
|
|
2656
2656
|
*/
|
|
2657
2657
|
functionList(options) {
|
|
2658
|
-
return this.addAndReturn((0,
|
|
2658
|
+
return this.addAndReturn((0, _1.createFunctionList)(options));
|
|
2659
2659
|
}
|
|
2660
2660
|
/**
|
|
2661
2661
|
* Returns information about the function that's currently running and information about the
|
|
@@ -2670,7 +2670,7 @@ class BaseBatch {
|
|
|
2670
2670
|
* - `"engines"` with information about available engines and their stats.
|
|
2671
2671
|
*/
|
|
2672
2672
|
functionStats() {
|
|
2673
|
-
return this.addAndReturn((0,
|
|
2673
|
+
return this.addAndReturn((0, _1.createFunctionStats)());
|
|
2674
2674
|
}
|
|
2675
2675
|
/**
|
|
2676
2676
|
* Returns the serialized payload of all loaded libraries.
|
|
@@ -2682,7 +2682,7 @@ class BaseBatch {
|
|
|
2682
2682
|
* Command Response - The serialized payload of all loaded libraries.
|
|
2683
2683
|
*/
|
|
2684
2684
|
functionDump() {
|
|
2685
|
-
return this.addAndReturn((0,
|
|
2685
|
+
return this.addAndReturn((0, _1.createFunctionDump)());
|
|
2686
2686
|
}
|
|
2687
2687
|
/**
|
|
2688
2688
|
* Restores libraries from the serialized payload returned by {@link functionDump}.
|
|
@@ -2696,7 +2696,7 @@ class BaseBatch {
|
|
|
2696
2696
|
* Command Response - `"OK"`.
|
|
2697
2697
|
*/
|
|
2698
2698
|
functionRestore(payload, policy) {
|
|
2699
|
-
return this.addAndReturn((0,
|
|
2699
|
+
return this.addAndReturn((0, _1.createFunctionRestore)(payload, policy));
|
|
2700
2700
|
}
|
|
2701
2701
|
/**
|
|
2702
2702
|
* Deletes all the keys of all the existing databases. This command never fails.
|
|
@@ -2708,7 +2708,7 @@ class BaseBatch {
|
|
|
2708
2708
|
* Command Response - `"OK"`.
|
|
2709
2709
|
*/
|
|
2710
2710
|
flushall(mode) {
|
|
2711
|
-
return this.addAndReturn((0,
|
|
2711
|
+
return this.addAndReturn((0, _1.createFlushAll)(mode));
|
|
2712
2712
|
}
|
|
2713
2713
|
/**
|
|
2714
2714
|
* Deletes all the keys of the currently selected database. This command never fails.
|
|
@@ -2720,7 +2720,7 @@ class BaseBatch {
|
|
|
2720
2720
|
* Command Response - `"OK"`.
|
|
2721
2721
|
*/
|
|
2722
2722
|
flushdb(mode) {
|
|
2723
|
-
return this.addAndReturn((0,
|
|
2723
|
+
return this.addAndReturn((0, _1.createFlushDB)(mode));
|
|
2724
2724
|
}
|
|
2725
2725
|
/**
|
|
2726
2726
|
* Returns the index of the first occurrence of `element` inside the list specified by `key`. If no
|
|
@@ -2738,7 +2738,7 @@ class BaseBatch {
|
|
|
2738
2738
|
* option is specified, then the function returns an `array` of indices of matching elements within the list.
|
|
2739
2739
|
*/
|
|
2740
2740
|
lpos(key, element, options) {
|
|
2741
|
-
return this.addAndReturn((0,
|
|
2741
|
+
return this.addAndReturn((0, _1.createLPos)(key, element, options));
|
|
2742
2742
|
}
|
|
2743
2743
|
/**
|
|
2744
2744
|
* Returns the number of keys in the currently selected database.
|
|
@@ -2748,7 +2748,7 @@ class BaseBatch {
|
|
|
2748
2748
|
* Command Response - The number of keys in the currently selected database.
|
|
2749
2749
|
*/
|
|
2750
2750
|
dbsize() {
|
|
2751
|
-
return this.addAndReturn((0,
|
|
2751
|
+
return this.addAndReturn((0, _1.createDBSize)());
|
|
2752
2752
|
}
|
|
2753
2753
|
/**
|
|
2754
2754
|
* Counts the number of set bits (population counting) in the string stored at `key`. The `options` argument can
|
|
@@ -2764,7 +2764,7 @@ class BaseBatch {
|
|
|
2764
2764
|
* Otherwise, if `key` is missing, returns `0` as it is treated as an empty string.
|
|
2765
2765
|
*/
|
|
2766
2766
|
bitcount(key, options) {
|
|
2767
|
-
return this.addAndReturn((0,
|
|
2767
|
+
return this.addAndReturn((0, _1.createBitCount)(key, options));
|
|
2768
2768
|
}
|
|
2769
2769
|
/**
|
|
2770
2770
|
* Adds geospatial members with their positions to the specified sorted set stored at `key`.
|
|
@@ -2782,7 +2782,7 @@ class BaseBatch {
|
|
|
2782
2782
|
* `true` in the options, returns the number of elements updated in the sorted set.
|
|
2783
2783
|
*/
|
|
2784
2784
|
geoadd(key, membersToGeospatialData, options) {
|
|
2785
|
-
return this.addAndReturn((0,
|
|
2785
|
+
return this.addAndReturn((0, _1.createGeoAdd)(key, membersToGeospatialData, options));
|
|
2786
2786
|
}
|
|
2787
2787
|
/**
|
|
2788
2788
|
* Returns the members of a sorted set populated with geospatial information using {@link geoadd},
|
|
@@ -2816,7 +2816,7 @@ class BaseBatch {
|
|
|
2816
2816
|
* - The coordinates as a two item `array` of floating point `number`s.
|
|
2817
2817
|
*/
|
|
2818
2818
|
geosearch(key, searchFrom, searchBy, resultOptions) {
|
|
2819
|
-
return this.addAndReturn((0,
|
|
2819
|
+
return this.addAndReturn((0, _1.createGeoSearch)(key, searchFrom, searchBy, resultOptions));
|
|
2820
2820
|
}
|
|
2821
2821
|
/**
|
|
2822
2822
|
* Searches for members in a sorted set stored at `source` representing geospatial data
|
|
@@ -2842,7 +2842,7 @@ class BaseBatch {
|
|
|
2842
2842
|
* Command Response - The number of elements in the resulting sorted set stored at `destination`.
|
|
2843
2843
|
*/
|
|
2844
2844
|
geosearchstore(destination, source, searchFrom, searchBy, resultOptions) {
|
|
2845
|
-
return this.addAndReturn((0,
|
|
2845
|
+
return this.addAndReturn((0, _1.createGeoSearchStore)(destination, source, searchFrom, searchBy, resultOptions));
|
|
2846
2846
|
}
|
|
2847
2847
|
/**
|
|
2848
2848
|
* Returns the positions (longitude, latitude) of all the specified `members` of the
|
|
@@ -2858,7 +2858,7 @@ class BaseBatch {
|
|
|
2858
2858
|
* If a member does not exist, its position will be `null`.
|
|
2859
2859
|
*/
|
|
2860
2860
|
geopos(key, members) {
|
|
2861
|
-
return this.addAndReturn((0,
|
|
2861
|
+
return this.addAndReturn((0, _1.createGeoPos)(key, members));
|
|
2862
2862
|
}
|
|
2863
2863
|
/**
|
|
2864
2864
|
* Pops member-score pairs from the first non-empty sorted set, with the given `keys`
|
|
@@ -2877,7 +2877,7 @@ class BaseBatch {
|
|
|
2877
2877
|
* If no member could be popped, returns `null`.
|
|
2878
2878
|
*/
|
|
2879
2879
|
zmpop(keys, modifier, count) {
|
|
2880
|
-
return this.addAndReturn((0,
|
|
2880
|
+
return this.addAndReturn((0, _1.createZMPop)(keys, modifier, count));
|
|
2881
2881
|
}
|
|
2882
2882
|
/**
|
|
2883
2883
|
* Pops a member-score pair from the first non-empty sorted set, with the given `keys` being
|
|
@@ -2899,7 +2899,7 @@ class BaseBatch {
|
|
|
2899
2899
|
* If no member could be popped, returns `null`.
|
|
2900
2900
|
*/
|
|
2901
2901
|
bzmpop(keys, modifier, timeout, count) {
|
|
2902
|
-
return this.addAndReturn((0,
|
|
2902
|
+
return this.addAndReturn((0, _1.createBZMPop)(keys, modifier, timeout, count));
|
|
2903
2903
|
}
|
|
2904
2904
|
/**
|
|
2905
2905
|
* Increments the score of `member` in the sorted set stored at `key` by `increment`.
|
|
@@ -2915,7 +2915,7 @@ class BaseBatch {
|
|
|
2915
2915
|
* Command Response - The new score of `member`.
|
|
2916
2916
|
*/
|
|
2917
2917
|
zincrby(key, increment, member) {
|
|
2918
|
-
return this.addAndReturn((0,
|
|
2918
|
+
return this.addAndReturn((0, _1.createZIncrBy)(key, increment, member));
|
|
2919
2919
|
}
|
|
2920
2920
|
/**
|
|
2921
2921
|
* Iterates incrementally over a sorted set.
|
|
@@ -2935,7 +2935,7 @@ class BaseBatch {
|
|
|
2935
2935
|
* If `options.noScores` is to `true`, the second element will only contain the members without scores.
|
|
2936
2936
|
*/
|
|
2937
2937
|
zscan(key, cursor, options) {
|
|
2938
|
-
return this.addAndReturn((0,
|
|
2938
|
+
return this.addAndReturn((0, _1.createZScan)(key, cursor, options));
|
|
2939
2939
|
}
|
|
2940
2940
|
/**
|
|
2941
2941
|
* Returns the distance between `member1` and `member2` saved in the geospatial index stored at `key`.
|
|
@@ -2953,7 +2953,7 @@ class BaseBatch {
|
|
|
2953
2953
|
* or if the key does not exist.
|
|
2954
2954
|
*/
|
|
2955
2955
|
geodist(key, member1, member2, options) {
|
|
2956
|
-
return this.addAndReturn((0,
|
|
2956
|
+
return this.addAndReturn((0, _1.createGeoDist)(key, member1, member2, options?.unit));
|
|
2957
2957
|
}
|
|
2958
2958
|
/**
|
|
2959
2959
|
* Returns the `GeoHash` strings representing the positions of all the specified `members` in the sorted set stored at `key`.
|
|
@@ -2967,7 +2967,7 @@ class BaseBatch {
|
|
|
2967
2967
|
* If a member does not exist in the sorted set, a `null` value is returned for that member.
|
|
2968
2968
|
*/
|
|
2969
2969
|
geohash(key, members) {
|
|
2970
|
-
return this.addAndReturn((0,
|
|
2970
|
+
return this.addAndReturn((0, _1.createGeoHash)(key, members));
|
|
2971
2971
|
}
|
|
2972
2972
|
/**
|
|
2973
2973
|
* Returns `UNIX TIME` of the last DB save timestamp or startup timestamp if no save
|
|
@@ -2978,7 +2978,7 @@ class BaseBatch {
|
|
|
2978
2978
|
* Command Response - `UNIX TIME` of the last DB save executed with success.
|
|
2979
2979
|
*/
|
|
2980
2980
|
lastsave() {
|
|
2981
|
-
return this.addAndReturn((0,
|
|
2981
|
+
return this.addAndReturn((0, _1.createLastSave)());
|
|
2982
2982
|
}
|
|
2983
2983
|
/**
|
|
2984
2984
|
* Returns all the longest common subsequences combined between strings stored at `key1` and `key2`.
|
|
@@ -2993,7 +2993,7 @@ class BaseBatch {
|
|
|
2993
2993
|
* An empty `String` is returned if the keys do not exist or have no common subsequences.
|
|
2994
2994
|
*/
|
|
2995
2995
|
lcs(key1, key2) {
|
|
2996
|
-
return this.addAndReturn((0,
|
|
2996
|
+
return this.addAndReturn((0, _1.createLCS)(key1, key2));
|
|
2997
2997
|
}
|
|
2998
2998
|
/**
|
|
2999
2999
|
* Returns the total length of all the longest common subsequences between strings stored at `key1` and `key2`.
|
|
@@ -3007,7 +3007,7 @@ class BaseBatch {
|
|
|
3007
3007
|
* Command Response - The total length of all the longest common subsequences between the 2 strings.
|
|
3008
3008
|
*/
|
|
3009
3009
|
lcsLen(key1, key2) {
|
|
3010
|
-
return this.addAndReturn((0,
|
|
3010
|
+
return this.addAndReturn((0, _1.createLCS)(key1, key2, { len: true }));
|
|
3011
3011
|
}
|
|
3012
3012
|
/**
|
|
3013
3013
|
* Returns the indices and lengths of the longest common subsequences between strings stored at
|
|
@@ -3034,7 +3034,7 @@ class BaseBatch {
|
|
|
3034
3034
|
* See example of {@link BaseClient.lcsIdx|lcsIdx} for more details.
|
|
3035
3035
|
*/
|
|
3036
3036
|
lcsIdx(key1, key2, options) {
|
|
3037
|
-
return this.addAndReturn((0,
|
|
3037
|
+
return this.addAndReturn((0, _1.createLCS)(key1, key2, { idx: options ?? {} }));
|
|
3038
3038
|
}
|
|
3039
3039
|
/**
|
|
3040
3040
|
* Updates the last access time of the specified keys.
|
|
@@ -3046,7 +3046,7 @@ class BaseBatch {
|
|
|
3046
3046
|
* Command Response - The number of keys that were updated. A key is ignored if it doesn't exist.
|
|
3047
3047
|
*/
|
|
3048
3048
|
touch(keys) {
|
|
3049
|
-
return this.addAndReturn((0,
|
|
3049
|
+
return this.addAndReturn((0, _1.createTouch)(keys));
|
|
3050
3050
|
}
|
|
3051
3051
|
/**
|
|
3052
3052
|
* Returns a random existing key name from the currently selected database.
|
|
@@ -3056,7 +3056,7 @@ class BaseBatch {
|
|
|
3056
3056
|
* Command Response - A random existing key name from the currently selected database.
|
|
3057
3057
|
*/
|
|
3058
3058
|
randomKey() {
|
|
3059
|
-
return this.addAndReturn((0,
|
|
3059
|
+
return this.addAndReturn((0, _1.createRandomKey)());
|
|
3060
3060
|
}
|
|
3061
3061
|
/**
|
|
3062
3062
|
* Overwrites part of the string stored at `key`, starting at the specified byte `offset`,
|
|
@@ -3072,7 +3072,7 @@ class BaseBatch {
|
|
|
3072
3072
|
* Command Response - The length of the string stored at `key` after it was modified.
|
|
3073
3073
|
*/
|
|
3074
3074
|
setrange(key, offset, value) {
|
|
3075
|
-
return this.addAndReturn((0,
|
|
3075
|
+
return this.addAndReturn((0, _1.createSetRange)(key, offset, value));
|
|
3076
3076
|
}
|
|
3077
3077
|
/**
|
|
3078
3078
|
* Appends a `value` to a `key`. If `key` does not exist it is created and set as an empty string,
|
|
@@ -3086,7 +3086,7 @@ class BaseBatch {
|
|
|
3086
3086
|
* Command Response - The length of the string after appending the value.
|
|
3087
3087
|
*/
|
|
3088
3088
|
append(key, value) {
|
|
3089
|
-
return this.addAndReturn((0,
|
|
3089
|
+
return this.addAndReturn((0, _1.createAppend)(key, value));
|
|
3090
3090
|
}
|
|
3091
3091
|
/**
|
|
3092
3092
|
* Pops one or more elements from the first non-empty list from the provided `keys`.
|
|
@@ -3102,7 +3102,7 @@ class BaseBatch {
|
|
|
3102
3102
|
* If no member could be popped, returns `null`.
|
|
3103
3103
|
*/
|
|
3104
3104
|
lmpop(keys, direction, count) {
|
|
3105
|
-
return this.addAndReturn((0,
|
|
3105
|
+
return this.addAndReturn((0, _1.createLMPop)(keys, direction, count));
|
|
3106
3106
|
}
|
|
3107
3107
|
/**
|
|
3108
3108
|
* Blocks the connection until it pops one or more elements from the first non-empty list from the
|
|
@@ -3121,7 +3121,7 @@ class BaseBatch {
|
|
|
3121
3121
|
* If no member could be popped and the timeout expired, returns `null`.
|
|
3122
3122
|
*/
|
|
3123
3123
|
blmpop(keys, direction, timeout, count) {
|
|
3124
|
-
return this.addAndReturn((0,
|
|
3124
|
+
return this.addAndReturn((0, _1.createBLMPop)(keys, direction, timeout, count));
|
|
3125
3125
|
}
|
|
3126
3126
|
/**
|
|
3127
3127
|
* Lists the currently active channels.
|
|
@@ -3135,7 +3135,7 @@ class BaseBatch {
|
|
|
3135
3135
|
* If no pattern is specified, all active channels are returned.
|
|
3136
3136
|
*/
|
|
3137
3137
|
pubsubChannels(pattern) {
|
|
3138
|
-
return this.addAndReturn((0,
|
|
3138
|
+
return this.addAndReturn((0, _1.createPubSubChannels)(pattern));
|
|
3139
3139
|
}
|
|
3140
3140
|
/**
|
|
3141
3141
|
* Returns the number of unique patterns that are subscribed to by clients.
|
|
@@ -3149,7 +3149,7 @@ class BaseBatch {
|
|
|
3149
3149
|
* Command Response - The number of unique patterns.
|
|
3150
3150
|
*/
|
|
3151
3151
|
pubsubNumPat() {
|
|
3152
|
-
return this.addAndReturn((0,
|
|
3152
|
+
return this.addAndReturn((0, _1.createPubSubNumPat)());
|
|
3153
3153
|
}
|
|
3154
3154
|
/**
|
|
3155
3155
|
* Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.
|
|
@@ -3161,7 +3161,7 @@ class BaseBatch {
|
|
|
3161
3161
|
* Command Response - A list of the channel names and their numbers of subscribers.
|
|
3162
3162
|
*/
|
|
3163
3163
|
pubsubNumSub(channels) {
|
|
3164
|
-
return this.addAndReturn((0,
|
|
3164
|
+
return this.addAndReturn((0, _1.createPubSubNumSub)(channels));
|
|
3165
3165
|
}
|
|
3166
3166
|
/**
|
|
3167
3167
|
* Sorts the elements in the list, set, or sorted set at `key` and returns the result.
|
|
@@ -3182,7 +3182,7 @@ class BaseBatch {
|
|
|
3182
3182
|
* Command Response - An `Array` of sorted elements.
|
|
3183
3183
|
*/
|
|
3184
3184
|
sort(key, options) {
|
|
3185
|
-
return this.addAndReturn((0,
|
|
3185
|
+
return this.addAndReturn((0, _1.createSort)(key, options));
|
|
3186
3186
|
}
|
|
3187
3187
|
/**
|
|
3188
3188
|
* Sorts the elements in the list, set, or sorted set at `key` and returns the result.
|
|
@@ -3203,7 +3203,7 @@ class BaseBatch {
|
|
|
3203
3203
|
* Command Response - An `Array` of sorted elements
|
|
3204
3204
|
*/
|
|
3205
3205
|
sortReadOnly(key, options) {
|
|
3206
|
-
return this.addAndReturn((0,
|
|
3206
|
+
return this.addAndReturn((0, _1.createSortReadOnly)(key, options));
|
|
3207
3207
|
}
|
|
3208
3208
|
/**
|
|
3209
3209
|
* Sorts the elements in the list, set, or sorted set at `key` and stores the result in
|
|
@@ -3226,7 +3226,7 @@ class BaseBatch {
|
|
|
3226
3226
|
* Command Response - The number of elements in the sorted key stored at `destination`.
|
|
3227
3227
|
*/
|
|
3228
3228
|
sortStore(key, destination, options) {
|
|
3229
|
-
return this.addAndReturn((0,
|
|
3229
|
+
return this.addAndReturn((0, _1.createSort)(key, options, destination));
|
|
3230
3230
|
}
|
|
3231
3231
|
}
|
|
3232
3232
|
exports.BaseBatch = BaseBatch;
|
|
@@ -3282,7 +3282,7 @@ class Batch extends BaseBatch {
|
|
|
3282
3282
|
* Command Response - A simple `"OK"` response.
|
|
3283
3283
|
*/
|
|
3284
3284
|
select(index) {
|
|
3285
|
-
return this.addAndReturn((0,
|
|
3285
|
+
return this.addAndReturn((0, _1.createSelect)(index));
|
|
3286
3286
|
}
|
|
3287
3287
|
/**
|
|
3288
3288
|
* Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
|
|
@@ -3303,7 +3303,7 @@ class Batch extends BaseBatch {
|
|
|
3303
3303
|
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
3304
3304
|
*/
|
|
3305
3305
|
copy(source, destination, options) {
|
|
3306
|
-
return this.addAndReturn((0,
|
|
3306
|
+
return this.addAndReturn((0, _1.createCopy)(source, destination, options));
|
|
3307
3307
|
}
|
|
3308
3308
|
/**
|
|
3309
3309
|
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
@@ -3317,7 +3317,7 @@ class Batch extends BaseBatch {
|
|
|
3317
3317
|
* database or does not exist in the source database.
|
|
3318
3318
|
*/
|
|
3319
3319
|
move(key, dbIndex) {
|
|
3320
|
-
return this.addAndReturn((0,
|
|
3320
|
+
return this.addAndReturn((0, _1.createMove)(key, dbIndex));
|
|
3321
3321
|
}
|
|
3322
3322
|
/** Publish a message on pubsub channel.
|
|
3323
3323
|
*
|
|
@@ -3330,7 +3330,7 @@ class Batch extends BaseBatch {
|
|
|
3330
3330
|
* Note that this value does not include subscriptions that configured on replicas.
|
|
3331
3331
|
*/
|
|
3332
3332
|
publish(message, channel) {
|
|
3333
|
-
return this.addAndReturn((0,
|
|
3333
|
+
return this.addAndReturn((0, _1.createPublish)(message, channel));
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
3336
|
exports.Batch = Batch;
|
|
@@ -3389,7 +3389,7 @@ class ClusterBatch extends BaseBatch {
|
|
|
3389
3389
|
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
3390
3390
|
*/
|
|
3391
3391
|
copy(source, destination, options) {
|
|
3392
|
-
return this.addAndReturn((0,
|
|
3392
|
+
return this.addAndReturn((0, _1.createCopy)(source, destination, options));
|
|
3393
3393
|
}
|
|
3394
3394
|
/** Publish a message on pubsub channel.
|
|
3395
3395
|
* This command aggregates PUBLISH and SPUBLISH commands functionalities.
|
|
@@ -3405,7 +3405,7 @@ class ClusterBatch extends BaseBatch {
|
|
|
3405
3405
|
* Command Response - Number of subscriptions in primary node that received the message.
|
|
3406
3406
|
*/
|
|
3407
3407
|
publish(message, channel, sharded = false) {
|
|
3408
|
-
return this.addAndReturn((0,
|
|
3408
|
+
return this.addAndReturn((0, _1.createPublish)(message, channel, sharded));
|
|
3409
3409
|
}
|
|
3410
3410
|
/**
|
|
3411
3411
|
* Lists the currently active shard channels.
|
|
@@ -3420,7 +3420,7 @@ class ClusterBatch extends BaseBatch {
|
|
|
3420
3420
|
* If no pattern is specified, all active shard channels are returned.
|
|
3421
3421
|
*/
|
|
3422
3422
|
pubsubShardChannels(pattern) {
|
|
3423
|
-
return this.addAndReturn((0,
|
|
3423
|
+
return this.addAndReturn((0, _1.createPubsubShardChannels)(pattern));
|
|
3424
3424
|
}
|
|
3425
3425
|
/**
|
|
3426
3426
|
* Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels.
|
|
@@ -3433,7 +3433,7 @@ class ClusterBatch extends BaseBatch {
|
|
|
3433
3433
|
* Command Response - A list of the shard channel names and their numbers of subscribers.
|
|
3434
3434
|
*/
|
|
3435
3435
|
pubsubShardNumSub(channels) {
|
|
3436
|
-
return this.addAndReturn((0,
|
|
3436
|
+
return this.addAndReturn((0, _1.createPubSubShardNumSub)(channels));
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
3439
|
exports.ClusterBatch = ClusterBatch;
|