@valkey/valkey-glide 1.3.5-rc8 → 2.0.0-rc5

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.
@@ -32,6 +32,9 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.BaseClient = exports.ObjectType = exports.Decoder = exports.ProtocolVersion = void 0;
37
40
  exports.convertGlideRecord = convertGlideRecord;
@@ -41,13 +44,11 @@ exports.convertRecordToGlideRecord = convertRecordToGlideRecord;
41
44
  /**
42
45
  * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
43
46
  */
47
+ const long_1 = __importDefault(require("long"));
44
48
  const net = __importStar(require("net"));
45
49
  const minimal_1 = require("protobufjs/minimal");
50
+ const _1 = require(".");
46
51
  const ProtobufMessage_1 = require("../build-ts/ProtobufMessage");
47
- const Commands_1 = require("./Commands");
48
- const Errors_1 = require("./Errors");
49
- const Logger_1 = require("./Logger");
50
- const native_1 = require("./native");
51
52
  var ProtocolVersion;
52
53
  (function (ProtocolVersion) {
53
54
  /** Use RESP2 to communicate with the server nodes. */
@@ -143,6 +144,11 @@ function convertRecordToGlideRecord(data) {
143
144
  * Consequently, when the response is returned, we can check whether it is instanceof the PointerResponse type and pass it to the Rust core function with the proper parameters.
144
145
  */
145
146
  class PointerResponse {
147
+ pointer;
148
+ // As Javascript does not support 64-bit integers,
149
+ // we split the Rust u64 pointer into two u32 integers (high and low) and build it again when we call value_from_split_pointer, the Rust function.
150
+ high;
151
+ low;
146
152
  constructor(pointer, high, low) {
147
153
  this.pointer = pointer;
148
154
  this.high = high;
@@ -169,31 +175,44 @@ var ObjectType;
169
175
  })(ObjectType || (exports.ObjectType = ObjectType = {}));
170
176
  function getRequestErrorClass(type) {
171
177
  if (type === ProtobufMessage_1.response.RequestErrorType.Disconnect) {
172
- return Errors_1.ConnectionError;
178
+ return _1.ConnectionError;
173
179
  }
174
180
  if (type === ProtobufMessage_1.response.RequestErrorType.ExecAbort) {
175
- return Errors_1.ExecAbortError;
181
+ return _1.ExecAbortError;
176
182
  }
177
183
  if (type === ProtobufMessage_1.response.RequestErrorType.Timeout) {
178
- return Errors_1.TimeoutError;
184
+ return _1.TimeoutError;
179
185
  }
180
186
  if (type === ProtobufMessage_1.response.RequestErrorType.Unspecified) {
181
- return Errors_1.RequestError;
187
+ return _1.RequestError;
182
188
  }
183
- return Errors_1.RequestError;
189
+ return _1.RequestError;
184
190
  }
185
191
  /**
186
192
  * Base client interface for GLIDE
187
193
  */
188
194
  class BaseClient {
195
+ socket;
196
+ promiseCallbackFunctions = [];
197
+ availableCallbackSlots = [];
198
+ requestWriter = new minimal_1.BufferWriter();
199
+ writeInProgress = false;
200
+ remainingReadData;
201
+ requestTimeout; // Timeout in milliseconds
202
+ isClosed = false;
203
+ defaultDecoder = Decoder.String;
204
+ pubsubFutures = [];
205
+ pendingPushNotification = [];
206
+ inflightRequestsLimit;
207
+ config;
189
208
  configurePubsub(options, configuration) {
190
209
  if (options.pubsubSubscriptions) {
191
210
  if (options.protocol == ProtocolVersion.RESP2) {
192
- throw new Errors_1.ConfigurationError("PubSub subscriptions require RESP3 protocol, but RESP2 was configured.");
211
+ throw new _1.ConfigurationError("PubSub subscriptions require RESP3 protocol, but RESP2 was configured.");
193
212
  }
194
213
  const { context, callback } = options.pubsubSubscriptions;
195
214
  if (context && !callback) {
196
- throw new Errors_1.ConfigurationError("PubSub subscriptions with a context require a callback function to be configured.");
215
+ throw new _1.ConfigurationError("PubSub subscriptions with a context require a callback function to be configured.");
197
216
  }
198
217
  configuration.pubsubSubscriptions =
199
218
  ProtobufMessage_1.connection_request.PubSubSubscriptions.create({});
@@ -233,7 +252,7 @@ class BaseClient {
233
252
  else {
234
253
  // Unhandled error
235
254
  const err_message = `Failed to decode the response: ${err}`;
236
- Logger_1.Logger.log("error", "connection", err_message);
255
+ _1.Logger.log("error", "connection", err_message);
237
256
  this.close(err_message);
238
257
  return;
239
258
  }
@@ -304,7 +323,7 @@ class BaseClient {
304
323
  if (port === undefined) {
305
324
  const split = host.split(":");
306
325
  if (split.length !== 2) {
307
- throw new Errors_1.RequestError("No port provided, expected host to be formatted as `{hostname}:{port}`. Received " +
326
+ throw new _1.RequestError("No port provided, expected host to be formatted as `{hostname}:{port}`. Received " +
308
327
  host);
309
328
  }
310
329
  host = split[0];
@@ -315,6 +334,16 @@ class BaseClient {
315
334
  });
316
335
  }
317
336
  }
337
+ dropCommandSpan(spanPtr) {
338
+ if (spanPtr === null || spanPtr === undefined)
339
+ return;
340
+ if (typeof spanPtr === "number") {
341
+ return (0, _1.dropOtelSpan)(BigInt(spanPtr)); // Convert number to BigInt
342
+ }
343
+ else if (spanPtr instanceof long_1.default) {
344
+ return (0, _1.dropOtelSpan)(BigInt(spanPtr.toString())); // Convert Long to BigInt via string
345
+ }
346
+ }
318
347
  processResponse(message) {
319
348
  if (message.closingError != null) {
320
349
  this.close(message.closingError);
@@ -337,11 +366,11 @@ class BaseClient {
337
366
  pointer = new PointerResponse(message.respPointer, message.respPointer.high, message.respPointer.low);
338
367
  }
339
368
  try {
340
- resolve((0, native_1.valueFromSplitPointer)(pointer.high, pointer.low, decoder === Decoder.String));
369
+ resolve((0, _1.valueFromSplitPointer)(pointer.high, pointer.low, decoder === Decoder.String));
341
370
  }
342
371
  catch (err) {
343
- Logger_1.Logger.log("error", "Decoder", `Decoding error: '${err}'`);
344
- reject(err instanceof Errors_1.ValkeyError
372
+ _1.Logger.log("error", "Decoder", `Decoding error: '${err}'`);
373
+ reject(err instanceof _1.ValkeyError
345
374
  ? err
346
375
  : new Error(`Decoding error: '${err}'. \n NOTE: If this was thrown during a command with write operations, the data could be UNRECOVERABLY LOST.`));
347
376
  }
@@ -352,6 +381,7 @@ class BaseClient {
352
381
  else {
353
382
  resolve(null);
354
383
  }
384
+ this.dropCommandSpan(message.rootSpanPtr);
355
385
  }
356
386
  processPush(response) {
357
387
  if (response.closingError != null || !response.respPointer) {
@@ -377,25 +407,11 @@ class BaseClient {
377
407
  * @internal
378
408
  */
379
409
  constructor(socket, options) {
380
- this.promiseCallbackFunctions = [];
381
- this.availableCallbackSlots = [];
382
- this.requestWriter = new minimal_1.BufferWriter();
383
- this.writeInProgress = false;
384
- this.isClosed = false;
385
- this.defaultDecoder = Decoder.String;
386
- this.pubsubFutures = [];
387
- this.pendingPushNotification = [];
388
- this.MAP_READ_FROM_STRATEGY = {
389
- primary: ProtobufMessage_1.connection_request.ReadFrom.Primary,
390
- preferReplica: ProtobufMessage_1.connection_request.ReadFrom.PreferReplica,
391
- AZAffinity: ProtobufMessage_1.connection_request.ReadFrom.AZAffinity,
392
- AZAffinityReplicasAndPrimary: ProtobufMessage_1.connection_request.ReadFrom.AZAffinityReplicasAndPrimary,
393
- };
394
410
  // if logger has been initialized by the external-user on info level this log will be shown
395
- Logger_1.Logger.log("info", "Client lifetime", `construct client`);
411
+ _1.Logger.log("info", "Client lifetime", `construct client`);
396
412
  this.config = options;
397
413
  this.requestTimeout =
398
- options?.requestTimeout ?? native_1.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS;
414
+ options?.requestTimeout ?? _1.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS;
399
415
  this.socket = socket;
400
416
  this.socket
401
417
  .on("data", (data) => this.handleReadData(data))
@@ -405,7 +421,7 @@ class BaseClient {
405
421
  });
406
422
  this.defaultDecoder = options?.defaultDecoder ?? Decoder.String;
407
423
  this.inflightRequestsLimit =
408
- options?.inflightRequestsLimit ?? native_1.DEFAULT_INFLIGHT_REQUESTS_LIMIT;
424
+ options?.inflightRequestsLimit ?? _1.DEFAULT_INFLIGHT_REQUESTS_LIMIT;
409
425
  }
410
426
  getCallbackIndex() {
411
427
  return (this.availableCallbackSlots.pop() ??
@@ -426,7 +442,7 @@ class BaseClient {
426
442
  }
427
443
  ensureClientIsOpen() {
428
444
  if (this.isClosed) {
429
- throw new Errors_1.ClosingError("Unable to execute requests; the client is closed. Please create a new client.");
445
+ throw new _1.ClosingError("Unable to execute requests; the client is closed. Please create a new client.");
430
446
  }
431
447
  }
432
448
  /**
@@ -446,12 +462,21 @@ class BaseClient {
446
462
  const route = this.toProtobufRoute(options?.route);
447
463
  const callbackIndex = this.getCallbackIndex();
448
464
  const basePromise = new Promise((resolve, reject) => {
465
+ // Create a span only if the OpenTelemetry is enabled and measure statistics only according to the requests percentage configuration
466
+ let spanPtr = null;
467
+ if (_1.OpenTelemetry.shouldSample()) {
468
+ const commandName = command instanceof ProtobufMessage_1.command_request.Command
469
+ ? ProtobufMessage_1.command_request.RequestType[command.requestType]
470
+ : "Batch";
471
+ const pair = (0, _1.createLeakedOtelSpan)(commandName);
472
+ spanPtr = new long_1.default(pair[0], pair[1]);
473
+ }
449
474
  this.promiseCallbackFunctions[callbackIndex] = [
450
475
  resolve,
451
476
  reject,
452
477
  options?.decoder,
453
478
  ];
454
- this.writeOrBufferCommandRequest(callbackIndex, command, route, isAtomic, raiseOnError, options);
479
+ this.writeOrBufferCommandRequest(callbackIndex, command, route, spanPtr, isAtomic, raiseOnError, options);
455
480
  });
456
481
  if (!Array.isArray(command)) {
457
482
  return basePromise;
@@ -467,7 +492,7 @@ class BaseClient {
467
492
  if (item?.constructor?.name === "Error" &&
468
493
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
469
494
  item.name === "RequestError") {
470
- Object.setPrototypeOf(item, Errors_1.RequestError.prototype);
495
+ Object.setPrototypeOf(item, _1.RequestError.prototype);
471
496
  }
472
497
  }
473
498
  }
@@ -514,9 +539,9 @@ class BaseClient {
514
539
  * @param raiseOnError - Determines whether to raise an error if any of the commands fails, in the case of a Batch and not a single command. Defaults to `false`.
515
540
  * @param options - Optional settings for batch requests.
516
541
  */
517
- writeOrBufferCommandRequest(callbackIdx, command, route, isAtomic = false, raiseOnError = false, options = {}) {
542
+ writeOrBufferCommandRequest(callbackIdx, command, route, commandSpanPtr, isAtomic = false, raiseOnError = false, options = {}) {
518
543
  if (isAtomic && "retryStrategy" in options) {
519
- throw new Errors_1.RequestError("Retry strategy is not supported for atomic batches.");
544
+ throw new _1.RequestError("Retry strategy is not supported for atomic batches.");
520
545
  }
521
546
  const isBatch = Array.isArray(command);
522
547
  let batch;
@@ -542,6 +567,7 @@ class BaseClient {
542
567
  singleCommand: isBatch ? undefined : command,
543
568
  batch,
544
569
  route,
570
+ rootSpanPtr: commandSpanPtr,
545
571
  });
546
572
  this.writeOrBufferRequest(message, (msg, writer) => {
547
573
  ProtobufMessage_1.command_request.CommandRequest.encodeDelimited(msg, writer);
@@ -592,13 +618,13 @@ class BaseClient {
592
618
  }
593
619
  async getPubSubMessage() {
594
620
  if (this.isClosed) {
595
- throw new Errors_1.ClosingError("Unable to execute requests; the client is closed. Please create a new client.");
621
+ throw new _1.ClosingError("Unable to execute requests; the client is closed. Please create a new client.");
596
622
  }
597
623
  if (!this.isPubsubConfigured(this.config)) {
598
- throw new Errors_1.ConfigurationError("The operation will never complete since there was no pubsbub subscriptions applied to the client.");
624
+ throw new _1.ConfigurationError("The operation will never complete since there was no pubsbub subscriptions applied to the client.");
599
625
  }
600
626
  if (this.getPubsubCallbackAndContext(this.config)[0]) {
601
- throw new Errors_1.ConfigurationError("The operation will never complete since messages will be passed to the configured callback.");
627
+ throw new _1.ConfigurationError("The operation will never complete since messages will be passed to the configured callback.");
602
628
  }
603
629
  return new Promise((resolve, reject) => {
604
630
  this.pubsubFutures.push([resolve, reject]);
@@ -607,13 +633,13 @@ class BaseClient {
607
633
  }
608
634
  tryGetPubSubMessage(decoder) {
609
635
  if (this.isClosed) {
610
- throw new Errors_1.ClosingError("Unable to execute requests; the client is closed. Please create a new client.");
636
+ throw new _1.ClosingError("Unable to execute requests; the client is closed. Please create a new client.");
611
637
  }
612
638
  if (!this.isPubsubConfigured(this.config)) {
613
- throw new Errors_1.ConfigurationError("The operation will never complete since there was no pubsbub subscriptions applied to the client.");
639
+ throw new _1.ConfigurationError("The operation will never complete since there was no pubsbub subscriptions applied to the client.");
614
640
  }
615
641
  if (this.getPubsubCallbackAndContext(this.config)[0]) {
616
- throw new Errors_1.ConfigurationError("The operation will never complete since messages will be passed to the configured callback.");
642
+ throw new _1.ConfigurationError("The operation will never complete since messages will be passed to the configured callback.");
617
643
  }
618
644
  let msg = null;
619
645
  this.completePubSubFuturesSafe();
@@ -630,14 +656,14 @@ class BaseClient {
630
656
  const isStringDecoder = (decoder ?? this.defaultDecoder) === Decoder.String;
631
657
  if (responsePointer) {
632
658
  if (typeof responsePointer !== "number") {
633
- nextPushNotificationValue = (0, native_1.valueFromSplitPointer)(responsePointer.high, responsePointer.low, isStringDecoder);
659
+ nextPushNotificationValue = (0, _1.valueFromSplitPointer)(responsePointer.high, responsePointer.low, isStringDecoder);
634
660
  }
635
661
  else {
636
- nextPushNotificationValue = (0, native_1.valueFromSplitPointer)(0, responsePointer, isStringDecoder);
662
+ nextPushNotificationValue = (0, _1.valueFromSplitPointer)(0, responsePointer, isStringDecoder);
637
663
  }
638
664
  const messageKind = nextPushNotificationValue["kind"];
639
665
  if (messageKind === "Disconnect") {
640
- Logger_1.Logger.log("warn", "disconnect notification", "Transport disconnected, messages might be lost");
666
+ _1.Logger.log("warn", "disconnect notification", "Transport disconnected, messages might be lost");
641
667
  }
642
668
  else if (messageKind === "Message" ||
643
669
  messageKind === "PMessage" ||
@@ -667,7 +693,7 @@ class BaseClient {
667
693
  // pass
668
694
  }
669
695
  else {
670
- Logger_1.Logger.log("error", "unknown notification", `Unknown notification: '${messageKind}'`);
696
+ _1.Logger.log("error", "unknown notification", `Unknown notification: '${messageKind}'`);
671
697
  }
672
698
  }
673
699
  return msg;
@@ -702,7 +728,7 @@ class BaseClient {
702
728
  * ```
703
729
  */
704
730
  async get(key, options) {
705
- return this.createWritePromise((0, Commands_1.createGet)(key), options);
731
+ return this.createWritePromise((0, _1.createGet)(key), options);
706
732
  }
707
733
  /**
708
734
  * Get the value of `key` and optionally set its expiration. `GETEX` is similar to {@link get}.
@@ -725,7 +751,7 @@ class BaseClient {
725
751
  * ```
726
752
  */
727
753
  async getex(key, options) {
728
- return this.createWritePromise((0, Commands_1.createGetEx)(key, options?.expiry), options);
754
+ return this.createWritePromise((0, _1.createGetEx)(key, options?.expiry), options);
729
755
  }
730
756
  /**
731
757
  * Gets a string value associated with the given `key`and deletes the key.
@@ -745,7 +771,7 @@ class BaseClient {
745
771
  * ```
746
772
  */
747
773
  async getdel(key, options) {
748
- return this.createWritePromise((0, Commands_1.createGetDel)(key), options);
774
+ return this.createWritePromise((0, _1.createGetDel)(key), options);
749
775
  }
750
776
  /**
751
777
  * Returns the substring of the string value stored at `key`, determined by the byte offsets
@@ -776,7 +802,7 @@ class BaseClient {
776
802
  * ```
777
803
  */
778
804
  async getrange(key, start, end, options) {
779
- return this.createWritePromise((0, Commands_1.createGetRange)(key, start, end), options);
805
+ return this.createWritePromise((0, _1.createGetRange)(key, start, end), options);
780
806
  }
781
807
  /** Set the given key with the given value. Return value is dependent on the passed options.
782
808
  *
@@ -817,7 +843,7 @@ class BaseClient {
817
843
  * ```
818
844
  */
819
845
  async set(key, value, options) {
820
- return this.createWritePromise((0, Commands_1.createSet)(key, value, options), options);
846
+ return this.createWritePromise((0, _1.createSet)(key, value, options), options);
821
847
  }
822
848
  /**
823
849
  * Removes the specified keys. A key is ignored if it does not exist.
@@ -851,7 +877,7 @@ class BaseClient {
851
877
  * ```
852
878
  */
853
879
  async del(keys) {
854
- return this.createWritePromise((0, Commands_1.createDel)(keys));
880
+ return this.createWritePromise((0, _1.createDel)(keys));
855
881
  }
856
882
  /**
857
883
  * Serialize the value stored at `key` in a Valkey-specific format and return it to the user.
@@ -874,7 +900,7 @@ class BaseClient {
874
900
  * ```
875
901
  */
876
902
  async dump(key) {
877
- return this.createWritePromise((0, Commands_1.createDump)(key), {
903
+ return this.createWritePromise((0, _1.createDump)(key), {
878
904
  decoder: Decoder.Bytes,
879
905
  });
880
906
  }
@@ -916,7 +942,7 @@ class BaseClient {
916
942
  * ```
917
943
  */
918
944
  async restore(key, ttl, value, options) {
919
- return this.createWritePromise((0, Commands_1.createRestore)(key, ttl, value, options), { decoder: Decoder.String });
945
+ return this.createWritePromise((0, _1.createRestore)(key, ttl, value, options), { decoder: Decoder.String });
920
946
  }
921
947
  /** Retrieve the values of multiple keys.
922
948
  *
@@ -945,7 +971,7 @@ class BaseClient {
945
971
  * ```
946
972
  */
947
973
  async mget(keys, options) {
948
- return this.createWritePromise((0, Commands_1.createMGet)(keys), options);
974
+ return this.createWritePromise((0, _1.createMGet)(keys), options);
949
975
  }
950
976
  /** Set multiple keys to multiple values in a single operation.
951
977
  *
@@ -978,7 +1004,7 @@ class BaseClient {
978
1004
  * ```
979
1005
  */
980
1006
  async mset(keysAndValues) {
981
- return this.createWritePromise((0, Commands_1.createMSet)(convertGlideRecord(keysAndValues)));
1007
+ return this.createWritePromise((0, _1.createMSet)(convertGlideRecord(keysAndValues)));
982
1008
  }
983
1009
  /**
984
1010
  * Sets multiple keys to values if the key does not exist. The operation is atomic, and if one or
@@ -1000,7 +1026,7 @@ class BaseClient {
1000
1026
  * ```
1001
1027
  */
1002
1028
  async msetnx(keysAndValues) {
1003
- return this.createWritePromise((0, Commands_1.createMSetNX)(convertGlideRecord(keysAndValues)));
1029
+ return this.createWritePromise((0, _1.createMSetNX)(convertGlideRecord(keysAndValues)));
1004
1030
  }
1005
1031
  /** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
1006
1032
  *
@@ -1018,7 +1044,7 @@ class BaseClient {
1018
1044
  * ```
1019
1045
  */
1020
1046
  async incr(key) {
1021
- return this.createWritePromise((0, Commands_1.createIncr)(key));
1047
+ return this.createWritePromise((0, _1.createIncr)(key));
1022
1048
  }
1023
1049
  /** Increments the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
1024
1050
  *
@@ -1037,7 +1063,7 @@ class BaseClient {
1037
1063
  * ```
1038
1064
  */
1039
1065
  async incrBy(key, amount) {
1040
- return this.createWritePromise((0, Commands_1.createIncrBy)(key, amount));
1066
+ return this.createWritePromise((0, _1.createIncrBy)(key, amount));
1041
1067
  }
1042
1068
  /** Increment the string representing a floating point number stored at `key` by `amount`.
1043
1069
  * By using a negative increment value, the result is that the value stored at `key` is decremented.
@@ -1058,7 +1084,7 @@ class BaseClient {
1058
1084
  * ```
1059
1085
  */
1060
1086
  async incrByFloat(key, amount) {
1061
- return this.createWritePromise((0, Commands_1.createIncrByFloat)(key, amount));
1087
+ return this.createWritePromise((0, _1.createIncrByFloat)(key, amount));
1062
1088
  }
1063
1089
  /** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
1064
1090
  *
@@ -1076,7 +1102,7 @@ class BaseClient {
1076
1102
  * ```
1077
1103
  */
1078
1104
  async decr(key) {
1079
- return this.createWritePromise((0, Commands_1.createDecr)(key));
1105
+ return this.createWritePromise((0, _1.createDecr)(key));
1080
1106
  }
1081
1107
  /** Decrements the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
1082
1108
  *
@@ -1095,7 +1121,7 @@ class BaseClient {
1095
1121
  * ```
1096
1122
  */
1097
1123
  async decrBy(key, amount) {
1098
- return this.createWritePromise((0, Commands_1.createDecrBy)(key, amount));
1124
+ return this.createWritePromise((0, _1.createDecrBy)(key, amount));
1099
1125
  }
1100
1126
  /**
1101
1127
  * Perform a bitwise operation between multiple keys (containing string values) and store the result in the
@@ -1121,7 +1147,7 @@ class BaseClient {
1121
1147
  * ```
1122
1148
  */
1123
1149
  async bitop(operation, destination, keys) {
1124
- return this.createWritePromise((0, Commands_1.createBitOp)(operation, destination, keys));
1150
+ return this.createWritePromise((0, _1.createBitOp)(operation, destination, keys));
1125
1151
  }
1126
1152
  /**
1127
1153
  * Returns the bit value at `offset` in the string value stored at `key`. `offset` must be greater than or equal
@@ -1141,7 +1167,7 @@ class BaseClient {
1141
1167
  * ```
1142
1168
  */
1143
1169
  async getbit(key, offset) {
1144
- return this.createWritePromise((0, Commands_1.createGetBit)(key, offset));
1170
+ return this.createWritePromise((0, _1.createGetBit)(key, offset));
1145
1171
  }
1146
1172
  /**
1147
1173
  * Sets or clears the bit at `offset` in the string value stored at `key`. The `offset` is a zero-based index, with
@@ -1163,7 +1189,7 @@ class BaseClient {
1163
1189
  * ```
1164
1190
  */
1165
1191
  async setbit(key, offset, value) {
1166
- return this.createWritePromise((0, Commands_1.createSetBit)(key, offset, value));
1192
+ return this.createWritePromise((0, _1.createSetBit)(key, offset, value));
1167
1193
  }
1168
1194
  /**
1169
1195
  * Returns the position of the first bit matching the given `bit` value. The optional starting offset
@@ -1198,7 +1224,7 @@ class BaseClient {
1198
1224
  * ```
1199
1225
  */
1200
1226
  async bitpos(key, bit, options) {
1201
- return this.createWritePromise((0, Commands_1.createBitPos)(key, bit, options));
1227
+ return this.createWritePromise((0, _1.createBitPos)(key, bit, options));
1202
1228
  }
1203
1229
  /**
1204
1230
  * Reads or modifies the array of bits representing the string that is held at `key` based on the specified
@@ -1232,7 +1258,7 @@ class BaseClient {
1232
1258
  * ```
1233
1259
  */
1234
1260
  async bitfield(key, subcommands) {
1235
- return this.createWritePromise((0, Commands_1.createBitField)(key, subcommands));
1261
+ return this.createWritePromise((0, _1.createBitField)(key, subcommands));
1236
1262
  }
1237
1263
  /**
1238
1264
  * Reads the array of bits representing the string that is held at `key` based on the specified `subcommands`.
@@ -1252,7 +1278,7 @@ class BaseClient {
1252
1278
  * ```
1253
1279
  */
1254
1280
  async bitfieldReadOnly(key, subcommands) {
1255
- return this.createWritePromise((0, Commands_1.createBitField)(key, subcommands, true));
1281
+ return this.createWritePromise((0, _1.createBitField)(key, subcommands, true));
1256
1282
  }
1257
1283
  /** Retrieve the value associated with `field` in the hash stored at `key`.
1258
1284
  *
@@ -1279,7 +1305,7 @@ class BaseClient {
1279
1305
  * ```
1280
1306
  */
1281
1307
  async hget(key, field, options) {
1282
- return this.createWritePromise((0, Commands_1.createHGet)(key, field), options);
1308
+ return this.createWritePromise((0, _1.createHGet)(key, field), options);
1283
1309
  }
1284
1310
  /** Sets the specified fields to their respective values in the hash stored at `key`.
1285
1311
  *
@@ -1301,7 +1327,7 @@ class BaseClient {
1301
1327
  * ```
1302
1328
  */
1303
1329
  async hset(key, fieldsAndValues) {
1304
- return this.createWritePromise((0, Commands_1.createHSet)(key, (0, Commands_1.convertFieldsAndValuesToHashDataType)(fieldsAndValues)));
1330
+ return this.createWritePromise((0, _1.createHSet)(key, (0, _1.convertFieldsAndValuesToHashDataType)(fieldsAndValues)));
1305
1331
  }
1306
1332
  /**
1307
1333
  * Returns all field names in the hash stored at `key`.
@@ -1321,7 +1347,7 @@ class BaseClient {
1321
1347
  * ```
1322
1348
  */
1323
1349
  async hkeys(key, options) {
1324
- return this.createWritePromise((0, Commands_1.createHKeys)(key), options);
1350
+ return this.createWritePromise((0, _1.createHKeys)(key), options);
1325
1351
  }
1326
1352
  /** Sets `field` in the hash stored at `key` to `value`, only if `field` does not yet exist.
1327
1353
  * If `key` does not exist, a new key holding a hash is created.
@@ -1349,7 +1375,7 @@ class BaseClient {
1349
1375
  * ```
1350
1376
  */
1351
1377
  async hsetnx(key, field, value) {
1352
- return this.createWritePromise((0, Commands_1.createHSetNX)(key, field, value));
1378
+ return this.createWritePromise((0, _1.createHSetNX)(key, field, value));
1353
1379
  }
1354
1380
  /** Removes the specified fields from the hash stored at `key`.
1355
1381
  * Specified fields that do not exist within this hash are ignored.
@@ -1369,7 +1395,7 @@ class BaseClient {
1369
1395
  * ```
1370
1396
  */
1371
1397
  async hdel(key, fields) {
1372
- return this.createWritePromise((0, Commands_1.createHDel)(key, fields));
1398
+ return this.createWritePromise((0, _1.createHDel)(key, fields));
1373
1399
  }
1374
1400
  /** Returns the values associated with the specified fields in the hash stored at `key`.
1375
1401
  *
@@ -1390,7 +1416,7 @@ class BaseClient {
1390
1416
  * ```
1391
1417
  */
1392
1418
  async hmget(key, fields, options) {
1393
- return this.createWritePromise((0, Commands_1.createHMGet)(key, fields), options);
1419
+ return this.createWritePromise((0, _1.createHMGet)(key, fields), options);
1394
1420
  }
1395
1421
  /** Returns if `field` is an existing field in the hash stored at `key`.
1396
1422
  *
@@ -1415,7 +1441,7 @@ class BaseClient {
1415
1441
  * ```
1416
1442
  */
1417
1443
  async hexists(key, field) {
1418
- return this.createWritePromise((0, Commands_1.createHExists)(key, field));
1444
+ return this.createWritePromise((0, _1.createHExists)(key, field));
1419
1445
  }
1420
1446
  /**
1421
1447
  * Returns all fields and values of the hash stored at `key`.
@@ -1439,7 +1465,7 @@ class BaseClient {
1439
1465
  * ```
1440
1466
  */
1441
1467
  async hgetall(key, options) {
1442
- return this.createWritePromise((0, Commands_1.createHGetAll)(key), options).then((res) => res.map((r) => {
1468
+ return this.createWritePromise((0, _1.createHGetAll)(key), options).then((res) => res.map((r) => {
1443
1469
  return { field: r.key, value: r.value };
1444
1470
  }));
1445
1471
  }
@@ -1462,7 +1488,7 @@ class BaseClient {
1462
1488
  * ```
1463
1489
  */
1464
1490
  async hincrBy(key, field, amount) {
1465
- return this.createWritePromise((0, Commands_1.createHIncrBy)(key, field, amount));
1491
+ return this.createWritePromise((0, _1.createHIncrBy)(key, field, amount));
1466
1492
  }
1467
1493
  /** Increment the string representing a floating point number stored at `field` in the hash stored at `key` by increment.
1468
1494
  * By using a negative increment value, the value stored at `field` in the hash stored at `key` is decremented.
@@ -1483,7 +1509,7 @@ class BaseClient {
1483
1509
  * ```
1484
1510
  */
1485
1511
  async hincrByFloat(key, field, amount) {
1486
- return this.createWritePromise((0, Commands_1.createHIncrByFloat)(key, field, amount));
1512
+ return this.createWritePromise((0, _1.createHIncrByFloat)(key, field, amount));
1487
1513
  }
1488
1514
  /** Returns the number of fields contained in the hash stored at `key`.
1489
1515
  *
@@ -1507,7 +1533,7 @@ class BaseClient {
1507
1533
  * ```
1508
1534
  */
1509
1535
  async hlen(key) {
1510
- return this.createWritePromise((0, Commands_1.createHLen)(key));
1536
+ return this.createWritePromise((0, _1.createHLen)(key));
1511
1537
  }
1512
1538
  /** Returns all values in the hash stored at key.
1513
1539
  *
@@ -1525,7 +1551,7 @@ class BaseClient {
1525
1551
  * ```
1526
1552
  */
1527
1553
  async hvals(key, options) {
1528
- return this.createWritePromise((0, Commands_1.createHVals)(key), options);
1554
+ return this.createWritePromise((0, _1.createHVals)(key), options);
1529
1555
  }
1530
1556
  /**
1531
1557
  * Returns the string length of the value associated with `field` in the hash stored at `key`.
@@ -1544,7 +1570,7 @@ class BaseClient {
1544
1570
  * ```
1545
1571
  */
1546
1572
  async hstrlen(key, field) {
1547
- return this.createWritePromise((0, Commands_1.createHStrlen)(key, field));
1573
+ return this.createWritePromise((0, _1.createHStrlen)(key, field));
1548
1574
  }
1549
1575
  /**
1550
1576
  * Returns a random field name from the hash value stored at `key`.
@@ -1563,7 +1589,7 @@ class BaseClient {
1563
1589
  * ```
1564
1590
  */
1565
1591
  async hrandfield(key, options) {
1566
- return this.createWritePromise((0, Commands_1.createHRandField)(key), options);
1592
+ return this.createWritePromise((0, _1.createHRandField)(key), options);
1567
1593
  }
1568
1594
  /**
1569
1595
  * Iterates incrementally over a hash.
@@ -1627,7 +1653,7 @@ class BaseClient {
1627
1653
  * ```
1628
1654
  */
1629
1655
  async hscan(key, cursor, options) {
1630
- return this.createWritePromise((0, Commands_1.createHScan)(key, cursor, options), options).then((res) => [res[0].toString(), res[1]]); // convert cursor back to string
1656
+ return this.createWritePromise((0, _1.createHScan)(key, cursor, options), options).then((res) => [res[0].toString(), res[1]]); // convert cursor back to string
1631
1657
  }
1632
1658
  /**
1633
1659
  * Retrieves up to `count` random field names from the hash value stored at `key`.
@@ -1649,7 +1675,7 @@ class BaseClient {
1649
1675
  * ```
1650
1676
  */
1651
1677
  async hrandfieldCount(key, count, options) {
1652
- return this.createWritePromise((0, Commands_1.createHRandField)(key, count), options);
1678
+ return this.createWritePromise((0, _1.createHRandField)(key, count), options);
1653
1679
  }
1654
1680
  /**
1655
1681
  * Retrieves up to `count` random field names along with their values from the hash
@@ -1674,7 +1700,7 @@ class BaseClient {
1674
1700
  * ```
1675
1701
  */
1676
1702
  async hrandfieldWithValues(key, count, options) {
1677
- return this.createWritePromise((0, Commands_1.createHRandField)(key, count, true), options);
1703
+ return this.createWritePromise((0, _1.createHRandField)(key, count, true), options);
1678
1704
  }
1679
1705
  /** Inserts all the specified values at the head of the list stored at `key`.
1680
1706
  * `elements` are inserted one after the other to the head of the list, from the leftmost element to the rightmost element.
@@ -1701,7 +1727,7 @@ class BaseClient {
1701
1727
  * ```
1702
1728
  */
1703
1729
  async lpush(key, elements) {
1704
- return this.createWritePromise((0, Commands_1.createLPush)(key, elements));
1730
+ return this.createWritePromise((0, _1.createLPush)(key, elements));
1705
1731
  }
1706
1732
  /**
1707
1733
  * Inserts specified values at the head of the `list`, only if `key` already
@@ -1719,7 +1745,7 @@ class BaseClient {
1719
1745
  * ```
1720
1746
  */
1721
1747
  async lpushx(key, elements) {
1722
- return this.createWritePromise((0, Commands_1.createLPushX)(key, elements));
1748
+ return this.createWritePromise((0, _1.createLPushX)(key, elements));
1723
1749
  }
1724
1750
  /** Removes and returns the first elements of the list stored at `key`.
1725
1751
  * The command pops a single element from the beginning of the list.
@@ -1746,7 +1772,7 @@ class BaseClient {
1746
1772
  * ```
1747
1773
  */
1748
1774
  async lpop(key, options) {
1749
- return this.createWritePromise((0, Commands_1.createLPop)(key), options);
1775
+ return this.createWritePromise((0, _1.createLPop)(key), options);
1750
1776
  }
1751
1777
  /** Removes and returns up to `count` elements of the list stored at `key`, depending on the list's length.
1752
1778
  *
@@ -1773,7 +1799,7 @@ class BaseClient {
1773
1799
  * ```
1774
1800
  */
1775
1801
  async lpopCount(key, count, options) {
1776
- return this.createWritePromise((0, Commands_1.createLPop)(key, count), options);
1802
+ return this.createWritePromise((0, _1.createLPop)(key, count), options);
1777
1803
  }
1778
1804
  /** Returns the specified elements of the list stored at `key`.
1779
1805
  * 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.
@@ -1813,7 +1839,7 @@ class BaseClient {
1813
1839
  * ```
1814
1840
  */
1815
1841
  async lrange(key, start, end, options) {
1816
- return this.createWritePromise((0, Commands_1.createLRange)(key, start, end), options);
1842
+ return this.createWritePromise((0, _1.createLRange)(key, start, end), options);
1817
1843
  }
1818
1844
  /** Returns the length of the list stored at `key`.
1819
1845
  *
@@ -1831,7 +1857,7 @@ class BaseClient {
1831
1857
  * ```
1832
1858
  */
1833
1859
  async llen(key) {
1834
- return this.createWritePromise((0, Commands_1.createLLen)(key));
1860
+ return this.createWritePromise((0, _1.createLLen)(key));
1835
1861
  }
1836
1862
  /**
1837
1863
  * Atomically pops and removes the left/right-most element to the list stored at `source`
@@ -1864,7 +1890,7 @@ class BaseClient {
1864
1890
  * ```
1865
1891
  */
1866
1892
  async lmove(source, destination, whereFrom, whereTo, options) {
1867
- return this.createWritePromise((0, Commands_1.createLMove)(source, destination, whereFrom, whereTo), options);
1893
+ return this.createWritePromise((0, _1.createLMove)(source, destination, whereFrom, whereTo), options);
1868
1894
  }
1869
1895
  /**
1870
1896
  * Blocks the connection until it pops atomically and removes the left/right-most element to the
@@ -1900,7 +1926,7 @@ class BaseClient {
1900
1926
  * ```
1901
1927
  */
1902
1928
  async blmove(source, destination, whereFrom, whereTo, timeout, options) {
1903
- return this.createWritePromise((0, Commands_1.createBLMove)(source, destination, whereFrom, whereTo, timeout), options);
1929
+ return this.createWritePromise((0, _1.createBLMove)(source, destination, whereFrom, whereTo, timeout), options);
1904
1930
  }
1905
1931
  /**
1906
1932
  * Sets the list element at `index` to `element`.
@@ -1923,7 +1949,7 @@ class BaseClient {
1923
1949
  * ```
1924
1950
  */
1925
1951
  async lset(key, index, element) {
1926
- return this.createWritePromise((0, Commands_1.createLSet)(key, index, element), {
1952
+ return this.createWritePromise((0, _1.createLSet)(key, index, element), {
1927
1953
  decoder: Decoder.String,
1928
1954
  });
1929
1955
  }
@@ -1950,7 +1976,7 @@ class BaseClient {
1950
1976
  * ```
1951
1977
  */
1952
1978
  async ltrim(key, start, end) {
1953
- return this.createWritePromise((0, Commands_1.createLTrim)(key, start, end), {
1979
+ return this.createWritePromise((0, _1.createLTrim)(key, start, end), {
1954
1980
  decoder: Decoder.String,
1955
1981
  });
1956
1982
  }
@@ -1973,7 +1999,7 @@ class BaseClient {
1973
1999
  * ```
1974
2000
  */
1975
2001
  async lrem(key, count, element) {
1976
- return this.createWritePromise((0, Commands_1.createLRem)(key, count, element));
2002
+ return this.createWritePromise((0, _1.createLRem)(key, count, element));
1977
2003
  }
1978
2004
  /** Inserts all the specified values at the tail of the list stored at `key`.
1979
2005
  * `elements` are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element.
@@ -2000,7 +2026,7 @@ class BaseClient {
2000
2026
  * ```
2001
2027
  */
2002
2028
  async rpush(key, elements) {
2003
- return this.createWritePromise((0, Commands_1.createRPush)(key, elements));
2029
+ return this.createWritePromise((0, _1.createRPush)(key, elements));
2004
2030
  }
2005
2031
  /**
2006
2032
  * Inserts specified values at the tail of the `list`, only if `key` already
@@ -2018,7 +2044,7 @@ class BaseClient {
2018
2044
  * ```
2019
2045
  * */
2020
2046
  async rpushx(key, elements) {
2021
- return this.createWritePromise((0, Commands_1.createRPushX)(key, elements));
2047
+ return this.createWritePromise((0, _1.createRPushX)(key, elements));
2022
2048
  }
2023
2049
  /** Removes and returns the last elements of the list stored at `key`.
2024
2050
  * The command pops a single element from the end of the list.
@@ -2045,7 +2071,7 @@ class BaseClient {
2045
2071
  * ```
2046
2072
  */
2047
2073
  async rpop(key, options) {
2048
- return this.createWritePromise((0, Commands_1.createRPop)(key), options);
2074
+ return this.createWritePromise((0, _1.createRPop)(key), options);
2049
2075
  }
2050
2076
  /** Removes and returns up to `count` elements from the list stored at `key`, depending on the list's length.
2051
2077
  *
@@ -2072,7 +2098,7 @@ class BaseClient {
2072
2098
  * ```
2073
2099
  */
2074
2100
  async rpopCount(key, count, options) {
2075
- return this.createWritePromise((0, Commands_1.createRPop)(key, count), options);
2101
+ return this.createWritePromise((0, _1.createRPop)(key, count), options);
2076
2102
  }
2077
2103
  /** Adds the specified members to the set stored at `key`. Specified members that are already a member of this set are ignored.
2078
2104
  * If `key` does not exist, a new set is created before adding `members`.
@@ -2091,7 +2117,7 @@ class BaseClient {
2091
2117
  * ```
2092
2118
  */
2093
2119
  async sadd(key, members) {
2094
- return this.createWritePromise((0, Commands_1.createSAdd)(key, members));
2120
+ return this.createWritePromise((0, _1.createSAdd)(key, members));
2095
2121
  }
2096
2122
  /** Removes the specified members from the set stored at `key`. Specified members that are not a member of this set are ignored.
2097
2123
  *
@@ -2110,7 +2136,7 @@ class BaseClient {
2110
2136
  * ```
2111
2137
  */
2112
2138
  async srem(key, members) {
2113
- return this.createWritePromise((0, Commands_1.createSRem)(key, members));
2139
+ return this.createWritePromise((0, _1.createSRem)(key, members));
2114
2140
  }
2115
2141
  /**
2116
2142
  * Iterates incrementally over a set.
@@ -2149,7 +2175,7 @@ class BaseClient {
2149
2175
  * ```
2150
2176
  */
2151
2177
  async sscan(key, cursor, options) {
2152
- return this.createWritePromise((0, Commands_1.createSScan)(key, cursor, options), options);
2178
+ return this.createWritePromise((0, _1.createSScan)(key, cursor, options), options);
2153
2179
  }
2154
2180
  /** Returns all the members of the set value stored at `key`.
2155
2181
  *
@@ -2168,7 +2194,7 @@ class BaseClient {
2168
2194
  * ```
2169
2195
  */
2170
2196
  async smembers(key, options) {
2171
- return this.createWritePromise((0, Commands_1.createSMembers)(key), options).then((smembers) => new Set(smembers));
2197
+ return this.createWritePromise((0, _1.createSMembers)(key), options).then((smembers) => new Set(smembers));
2172
2198
  }
2173
2199
  /** Moves `member` from the set at `source` to the set at `destination`, removing it from the source set.
2174
2200
  * Creates a new destination set if needed. The operation is atomic.
@@ -2188,7 +2214,7 @@ class BaseClient {
2188
2214
  * ```
2189
2215
  */
2190
2216
  async smove(source, destination, member) {
2191
- return this.createWritePromise((0, Commands_1.createSMove)(source, destination, member));
2217
+ return this.createWritePromise((0, _1.createSMove)(source, destination, member));
2192
2218
  }
2193
2219
  /** Returns the set cardinality (number of elements) of the set stored at `key`.
2194
2220
  *
@@ -2205,7 +2231,7 @@ class BaseClient {
2205
2231
  * ```
2206
2232
  */
2207
2233
  async scard(key) {
2208
- return this.createWritePromise((0, Commands_1.createSCard)(key));
2234
+ return this.createWritePromise((0, _1.createSCard)(key));
2209
2235
  }
2210
2236
  /** Gets the intersection of all the given sets.
2211
2237
  *
@@ -2232,7 +2258,7 @@ class BaseClient {
2232
2258
  * ```
2233
2259
  */
2234
2260
  async sinter(keys, options) {
2235
- return this.createWritePromise((0, Commands_1.createSInter)(keys), options).then((sinter) => new Set(sinter));
2261
+ return this.createWritePromise((0, _1.createSInter)(keys), options).then((sinter) => new Set(sinter));
2236
2262
  }
2237
2263
  /**
2238
2264
  * Gets the cardinality of the intersection of all the given sets.
@@ -2258,7 +2284,7 @@ class BaseClient {
2258
2284
  * ```
2259
2285
  */
2260
2286
  async sintercard(keys, options) {
2261
- return this.createWritePromise((0, Commands_1.createSInterCard)(keys, options?.limit));
2287
+ return this.createWritePromise((0, _1.createSInterCard)(keys, options?.limit));
2262
2288
  }
2263
2289
  /**
2264
2290
  * Stores the members of the intersection of all given sets specified by `keys` into a new set at `destination`.
@@ -2277,7 +2303,7 @@ class BaseClient {
2277
2303
  * ```
2278
2304
  */
2279
2305
  async sinterstore(destination, keys) {
2280
- return this.createWritePromise((0, Commands_1.createSInterStore)(destination, keys));
2306
+ return this.createWritePromise((0, _1.createSInterStore)(destination, keys));
2281
2307
  }
2282
2308
  /**
2283
2309
  * Computes the difference between the first set and all the successive sets in `keys`.
@@ -2299,7 +2325,7 @@ class BaseClient {
2299
2325
  * ```
2300
2326
  */
2301
2327
  async sdiff(keys, options) {
2302
- return this.createWritePromise((0, Commands_1.createSDiff)(keys), options).then((sdiff) => new Set(sdiff));
2328
+ return this.createWritePromise((0, _1.createSDiff)(keys), options).then((sdiff) => new Set(sdiff));
2303
2329
  }
2304
2330
  /**
2305
2331
  * Stores the difference between the first set and all the successive sets in `keys` into a new set at `destination`.
@@ -2320,7 +2346,7 @@ class BaseClient {
2320
2346
  * ```
2321
2347
  */
2322
2348
  async sdiffstore(destination, keys) {
2323
- return this.createWritePromise((0, Commands_1.createSDiffStore)(destination, keys));
2349
+ return this.createWritePromise((0, _1.createSDiffStore)(destination, keys));
2324
2350
  }
2325
2351
  /**
2326
2352
  * Gets the union of all the given sets.
@@ -2345,7 +2371,7 @@ class BaseClient {
2345
2371
  * ```
2346
2372
  */
2347
2373
  async sunion(keys, options) {
2348
- return this.createWritePromise((0, Commands_1.createSUnion)(keys), options).then((sunion) => new Set(sunion));
2374
+ return this.createWritePromise((0, _1.createSUnion)(keys), options).then((sunion) => new Set(sunion));
2349
2375
  }
2350
2376
  /**
2351
2377
  * Stores the members of the union of all given sets specified by `keys` into a new set
@@ -2365,7 +2391,7 @@ class BaseClient {
2365
2391
  * ```
2366
2392
  */
2367
2393
  async sunionstore(destination, keys) {
2368
- return this.createWritePromise((0, Commands_1.createSUnionStore)(destination, keys));
2394
+ return this.createWritePromise((0, _1.createSUnionStore)(destination, keys));
2369
2395
  }
2370
2396
  /** Returns if `member` is a member of the set stored at `key`.
2371
2397
  *
@@ -2391,7 +2417,7 @@ class BaseClient {
2391
2417
  * ```
2392
2418
  */
2393
2419
  async sismember(key, member) {
2394
- return this.createWritePromise((0, Commands_1.createSIsMember)(key, member));
2420
+ return this.createWritePromise((0, _1.createSIsMember)(key, member));
2395
2421
  }
2396
2422
  /**
2397
2423
  * Checks whether each member is contained in the members of the set stored at `key`.
@@ -2411,7 +2437,7 @@ class BaseClient {
2411
2437
  * ```
2412
2438
  */
2413
2439
  async smismember(key, members) {
2414
- return this.createWritePromise((0, Commands_1.createSMIsMember)(key, members));
2440
+ return this.createWritePromise((0, _1.createSMIsMember)(key, members));
2415
2441
  }
2416
2442
  /** Removes and returns one random member from the set value store at `key`.
2417
2443
  * To pop multiple members, see {@link spopCount}.
@@ -2438,7 +2464,7 @@ class BaseClient {
2438
2464
  * ```
2439
2465
  */
2440
2466
  async spop(key, options) {
2441
- return this.createWritePromise((0, Commands_1.createSPop)(key), options);
2467
+ return this.createWritePromise((0, _1.createSPop)(key), options);
2442
2468
  }
2443
2469
  /** Removes and returns up to `count` random members from the set value store at `key`, depending on the set's length.
2444
2470
  *
@@ -2465,7 +2491,7 @@ class BaseClient {
2465
2491
  * ```
2466
2492
  */
2467
2493
  async spopCount(key, count, options) {
2468
- return this.createWritePromise((0, Commands_1.createSPop)(key, count), options).then((spop) => new Set(spop));
2494
+ return this.createWritePromise((0, _1.createSPop)(key, count), options).then((spop) => new Set(spop));
2469
2495
  }
2470
2496
  /**
2471
2497
  * Returns a random element from the set value stored at `key`.
@@ -2491,7 +2517,7 @@ class BaseClient {
2491
2517
  * ```
2492
2518
  */
2493
2519
  async srandmember(key, options) {
2494
- return this.createWritePromise((0, Commands_1.createSRandMember)(key), options);
2520
+ return this.createWritePromise((0, _1.createSRandMember)(key), options);
2495
2521
  }
2496
2522
  /**
2497
2523
  * Returns one or more random elements from the set value stored at `key`.
@@ -2520,7 +2546,7 @@ class BaseClient {
2520
2546
  * ```
2521
2547
  */
2522
2548
  async srandmemberCount(key, count, options) {
2523
- return this.createWritePromise((0, Commands_1.createSRandMember)(key, count), options);
2549
+ return this.createWritePromise((0, _1.createSRandMember)(key, count), options);
2524
2550
  }
2525
2551
  /**
2526
2552
  * Returns the number of keys in `keys` that exist in the database.
@@ -2547,7 +2573,7 @@ class BaseClient {
2547
2573
  * ```
2548
2574
  */
2549
2575
  async exists(keys) {
2550
- return this.createWritePromise((0, Commands_1.createExists)(keys));
2576
+ return this.createWritePromise((0, _1.createExists)(keys));
2551
2577
  }
2552
2578
  /**
2553
2579
  * Removes the specified keys. A key is ignored if it does not exist.
@@ -2575,7 +2601,7 @@ class BaseClient {
2575
2601
  * ```
2576
2602
  */
2577
2603
  async unlink(keys) {
2578
- return this.createWritePromise((0, Commands_1.createUnlink)(keys));
2604
+ return this.createWritePromise((0, _1.createUnlink)(keys));
2579
2605
  }
2580
2606
  /**
2581
2607
  * Sets a timeout on `key` in seconds. After the timeout has expired, the key will automatically be deleted.
@@ -2607,7 +2633,7 @@ class BaseClient {
2607
2633
  * ```
2608
2634
  */
2609
2635
  async expire(key, seconds, options) {
2610
- return this.createWritePromise((0, Commands_1.createExpire)(key, seconds, options?.expireOption));
2636
+ return this.createWritePromise((0, _1.createExpire)(key, seconds, options?.expireOption));
2611
2637
  }
2612
2638
  /**
2613
2639
  * Sets a timeout on `key`. It takes an absolute Unix timestamp (seconds since January 1, 1970) instead of specifying the number of seconds.
@@ -2632,7 +2658,7 @@ class BaseClient {
2632
2658
  * ```
2633
2659
  */
2634
2660
  async expireAt(key, unixSeconds, options) {
2635
- return this.createWritePromise((0, Commands_1.createExpireAt)(key, unixSeconds, options?.expireOption));
2661
+ return this.createWritePromise((0, _1.createExpireAt)(key, unixSeconds, options?.expireOption));
2636
2662
  }
2637
2663
  /**
2638
2664
  * Returns the absolute Unix timestamp (since January 1, 1970) at which the given `key` will expire, in seconds.
@@ -2659,7 +2685,7 @@ class BaseClient {
2659
2685
  * ```
2660
2686
  */
2661
2687
  async expiretime(key) {
2662
- return this.createWritePromise((0, Commands_1.createExpireTime)(key));
2688
+ return this.createWritePromise((0, _1.createExpireTime)(key));
2663
2689
  }
2664
2690
  /**
2665
2691
  * Sets a timeout on `key` in milliseconds. After the timeout has expired, the key will automatically be deleted.
@@ -2684,7 +2710,7 @@ class BaseClient {
2684
2710
  * ```
2685
2711
  */
2686
2712
  async pexpire(key, milliseconds, options) {
2687
- return this.createWritePromise((0, Commands_1.createPExpire)(key, milliseconds, options?.expireOption));
2713
+ return this.createWritePromise((0, _1.createPExpire)(key, milliseconds, options?.expireOption));
2688
2714
  }
2689
2715
  /**
2690
2716
  * Sets a timeout on `key`. It takes an absolute Unix timestamp (milliseconds since January 1, 1970) instead of specifying the number of milliseconds.
@@ -2709,7 +2735,7 @@ class BaseClient {
2709
2735
  * ```
2710
2736
  */
2711
2737
  async pexpireAt(key, unixMilliseconds, options) {
2712
- return this.createWritePromise((0, Commands_1.createPExpireAt)(key, unixMilliseconds, options?.expireOption));
2738
+ return this.createWritePromise((0, _1.createPExpireAt)(key, unixMilliseconds, options?.expireOption));
2713
2739
  }
2714
2740
  /**
2715
2741
  * Returns the absolute Unix timestamp (since January 1, 1970) at which the given `key` will expire, in milliseconds.
@@ -2735,7 +2761,7 @@ class BaseClient {
2735
2761
  * ```
2736
2762
  */
2737
2763
  async pexpiretime(key) {
2738
- return this.createWritePromise((0, Commands_1.createPExpireTime)(key));
2764
+ return this.createWritePromise((0, _1.createPExpireTime)(key));
2739
2765
  }
2740
2766
  /**
2741
2767
  * Returns the remaining time to live of `key` that has a timeout.
@@ -2767,7 +2793,7 @@ class BaseClient {
2767
2793
  * ```
2768
2794
  */
2769
2795
  async ttl(key) {
2770
- return this.createWritePromise((0, Commands_1.createTTL)(key));
2796
+ return this.createWritePromise((0, _1.createTTL)(key));
2771
2797
  }
2772
2798
  /**
2773
2799
  * Invokes a Lua script with its keys and arguments.
@@ -2823,7 +2849,7 @@ class BaseClient {
2823
2849
  * ```
2824
2850
  */
2825
2851
  async scriptShow(sha1, options) {
2826
- return this.createWritePromise((0, Commands_1.createScriptShow)(sha1), options);
2852
+ return this.createWritePromise((0, _1.createScriptShow)(sha1), options);
2827
2853
  }
2828
2854
  /**
2829
2855
  * Returns stream entries matching a given range of entry IDs.
@@ -2858,7 +2884,7 @@ class BaseClient {
2858
2884
  * ```
2859
2885
  */
2860
2886
  async xrange(key, start, end, options) {
2861
- return this.createWritePromise((0, Commands_1.createXRange)(key, start, end, options?.count), options).then((res) => (res === null ? null : convertGlideRecordToRecord(res)));
2887
+ return this.createWritePromise((0, _1.createXRange)(key, start, end, options?.count), options).then((res) => (res === null ? null : convertGlideRecordToRecord(res)));
2862
2888
  }
2863
2889
  /**
2864
2890
  * Returns stream entries matching a given range of entry IDs in reverse order. Equivalent to {@link xrange} but returns the
@@ -2894,7 +2920,7 @@ class BaseClient {
2894
2920
  * ```
2895
2921
  */
2896
2922
  async xrevrange(key, end, start, options) {
2897
- return this.createWritePromise((0, Commands_1.createXRevRange)(key, end, start, options?.count), options).then((res) => res === null ? null : convertGlideRecordToRecord(res));
2923
+ return this.createWritePromise((0, _1.createXRevRange)(key, end, start, options?.count), options).then((res) => res === null ? null : convertGlideRecordToRecord(res));
2898
2924
  }
2899
2925
  /**
2900
2926
  * Adds members with their scores to the sorted set stored at `key`.
@@ -2925,7 +2951,7 @@ class BaseClient {
2925
2951
  * ```
2926
2952
  */
2927
2953
  async zadd(key, membersAndScores, options) {
2928
- return this.createWritePromise((0, Commands_1.createZAdd)(key, membersAndScores, options));
2954
+ return this.createWritePromise((0, _1.createZAdd)(key, membersAndScores, options));
2929
2955
  }
2930
2956
  /**
2931
2957
  * Increments the score of member in the sorted set stored at `key` by `increment`.
@@ -2956,7 +2982,7 @@ class BaseClient {
2956
2982
  * ```
2957
2983
  */
2958
2984
  async zaddIncr(key, member, increment, options) {
2959
- return this.createWritePromise((0, Commands_1.createZAdd)(key, [{ element: member, score: increment }], options, true));
2985
+ return this.createWritePromise((0, _1.createZAdd)(key, [{ element: member, score: increment }], options, true));
2960
2986
  }
2961
2987
  /**
2962
2988
  * Removes the specified members from the sorted set stored at `key`.
@@ -2984,7 +3010,7 @@ class BaseClient {
2984
3010
  * ```
2985
3011
  */
2986
3012
  async zrem(key, members) {
2987
- return this.createWritePromise((0, Commands_1.createZRem)(key, members));
3013
+ return this.createWritePromise((0, _1.createZRem)(key, members));
2988
3014
  }
2989
3015
  /**
2990
3016
  * Returns the cardinality (number of elements) of the sorted set stored at `key`.
@@ -3010,7 +3036,7 @@ class BaseClient {
3010
3036
  * ```
3011
3037
  */
3012
3038
  async zcard(key) {
3013
- return this.createWritePromise((0, Commands_1.createZCard)(key));
3039
+ return this.createWritePromise((0, _1.createZCard)(key));
3014
3040
  }
3015
3041
  /**
3016
3042
  * Returns the cardinality of the intersection of the sorted sets specified by `keys`.
@@ -3031,7 +3057,7 @@ class BaseClient {
3031
3057
  * ```
3032
3058
  */
3033
3059
  async zintercard(keys, options) {
3034
- return this.createWritePromise((0, Commands_1.createZInterCard)(keys, options?.limit));
3060
+ return this.createWritePromise((0, _1.createZInterCard)(keys, options?.limit));
3035
3061
  }
3036
3062
  /**
3037
3063
  * Returns the difference between the first sorted set and all the successive sorted sets.
@@ -3056,7 +3082,7 @@ class BaseClient {
3056
3082
  * ```
3057
3083
  */
3058
3084
  async zdiff(keys, options) {
3059
- return this.createWritePromise((0, Commands_1.createZDiff)(keys), options);
3085
+ return this.createWritePromise((0, _1.createZDiff)(keys), options);
3060
3086
  }
3061
3087
  /**
3062
3088
  * Returns the difference between the first sorted set and all the successive sorted sets, with the associated
@@ -3082,7 +3108,7 @@ class BaseClient {
3082
3108
  * ```
3083
3109
  */
3084
3110
  async zdiffWithScores(keys, options) {
3085
- return this.createWritePromise((0, Commands_1.createZDiffWithScores)(keys), options).then(convertGlideRecordForSortedSet);
3111
+ return this.createWritePromise((0, _1.createZDiffWithScores)(keys), options).then(convertGlideRecordForSortedSet);
3086
3112
  }
3087
3113
  /**
3088
3114
  * Calculates the difference between the first sorted set and all the successive sorted sets in `keys` and stores
@@ -3109,7 +3135,7 @@ class BaseClient {
3109
3135
  * ```
3110
3136
  */
3111
3137
  async zdiffstore(destination, keys) {
3112
- return this.createWritePromise((0, Commands_1.createZDiffStore)(destination, keys));
3138
+ return this.createWritePromise((0, _1.createZDiffStore)(destination, keys));
3113
3139
  }
3114
3140
  /**
3115
3141
  * Returns the score of `member` in the sorted set stored at `key`.
@@ -3144,7 +3170,7 @@ class BaseClient {
3144
3170
  * ```
3145
3171
  */
3146
3172
  async zscore(key, member) {
3147
- return this.createWritePromise((0, Commands_1.createZScore)(key, member));
3173
+ return this.createWritePromise((0, _1.createZScore)(key, member));
3148
3174
  }
3149
3175
  /**
3150
3176
  * Computes the union of sorted sets given by the specified `keys` and stores the result in `destination`.
@@ -3192,7 +3218,7 @@ class BaseClient {
3192
3218
  * ```
3193
3219
  */
3194
3220
  async zunionstore(destination, keys, options) {
3195
- return this.createWritePromise((0, Commands_1.createZUnionStore)(destination, keys, options?.aggregationType));
3221
+ return this.createWritePromise((0, _1.createZUnionStore)(destination, keys, options?.aggregationType));
3196
3222
  }
3197
3223
  /**
3198
3224
  * Returns the scores associated with the specified `members` in the sorted set stored at `key`.
@@ -3212,7 +3238,7 @@ class BaseClient {
3212
3238
  * ```
3213
3239
  */
3214
3240
  async zmscore(key, members) {
3215
- return this.createWritePromise((0, Commands_1.createZMScore)(key, members));
3241
+ return this.createWritePromise((0, _1.createZMScore)(key, members));
3216
3242
  }
3217
3243
  /**
3218
3244
  * Returns the number of members in the sorted set stored at `key` with scores between `minScore` and `maxScore`.
@@ -3241,7 +3267,7 @@ class BaseClient {
3241
3267
  * ```
3242
3268
  */
3243
3269
  async zcount(key, minScore, maxScore) {
3244
- return this.createWritePromise((0, Commands_1.createZCount)(key, minScore, maxScore));
3270
+ return this.createWritePromise((0, _1.createZCount)(key, minScore, maxScore));
3245
3271
  }
3246
3272
  /**
3247
3273
  * Returns the specified range of elements in the sorted set stored at `key`.
@@ -3282,7 +3308,7 @@ class BaseClient {
3282
3308
  * ```
3283
3309
  */
3284
3310
  async zrange(key, rangeQuery, options) {
3285
- return this.createWritePromise((0, Commands_1.createZRange)(key, rangeQuery, options?.reverse), options);
3311
+ return this.createWritePromise((0, _1.createZRange)(key, rangeQuery, options?.reverse), options);
3286
3312
  }
3287
3313
  /**
3288
3314
  * Returns the specified range of elements with their scores in the sorted set stored at `key`.
@@ -3324,7 +3350,7 @@ class BaseClient {
3324
3350
  * ```
3325
3351
  */
3326
3352
  async zrangeWithScores(key, rangeQuery, options) {
3327
- return this.createWritePromise((0, Commands_1.createZRangeWithScores)(key, rangeQuery, options?.reverse), options).then(convertGlideRecordForSortedSet);
3353
+ return this.createWritePromise((0, _1.createZRangeWithScores)(key, rangeQuery, options?.reverse), options).then(convertGlideRecordForSortedSet);
3328
3354
  }
3329
3355
  /**
3330
3356
  * Stores a specified range of elements from the sorted set at `source`, into a new
@@ -3362,7 +3388,7 @@ class BaseClient {
3362
3388
  * ```
3363
3389
  */
3364
3390
  async zrangeStore(destination, source, rangeQuery, reverse = false) {
3365
- return this.createWritePromise((0, Commands_1.createZRangeStore)(destination, source, rangeQuery, reverse));
3391
+ return this.createWritePromise((0, _1.createZRangeStore)(destination, source, rangeQuery, reverse));
3366
3392
  }
3367
3393
  /**
3368
3394
  * Computes the intersection of sorted sets given by the specified `keys` and stores the result in `destination`.
@@ -3400,7 +3426,7 @@ class BaseClient {
3400
3426
  * ```
3401
3427
  */
3402
3428
  async zinterstore(destination, keys, options) {
3403
- return this.createWritePromise((0, Commands_1.createZInterstore)(destination, keys, options?.aggregationType));
3429
+ return this.createWritePromise((0, _1.createZInterstore)(destination, keys, options?.aggregationType));
3404
3430
  }
3405
3431
  /**
3406
3432
  * Computes the intersection of sorted sets given by the specified `keys` and returns a list of intersecting elements.
@@ -3426,7 +3452,7 @@ class BaseClient {
3426
3452
  * ```
3427
3453
  */
3428
3454
  async zinter(keys, options) {
3429
- return this.createWritePromise((0, Commands_1.createZInter)(keys), options);
3455
+ return this.createWritePromise((0, _1.createZInter)(keys), options);
3430
3456
  }
3431
3457
  /**
3432
3458
  * Computes the intersection of sorted sets given by the specified `keys` and returns a list of intersecting elements with scores.
@@ -3462,7 +3488,7 @@ class BaseClient {
3462
3488
  * ```
3463
3489
  */
3464
3490
  async zinterWithScores(keys, options) {
3465
- return this.createWritePromise((0, Commands_1.createZInter)(keys, options?.aggregationType, true), options).then(convertGlideRecordForSortedSet);
3491
+ return this.createWritePromise((0, _1.createZInter)(keys, options?.aggregationType, true), options).then(convertGlideRecordForSortedSet);
3466
3492
  }
3467
3493
  /**
3468
3494
  * Computes the union of sorted sets given by the specified `keys` and returns a list of union elements.
@@ -3487,7 +3513,7 @@ class BaseClient {
3487
3513
  * ```
3488
3514
  */
3489
3515
  async zunion(keys, options) {
3490
- return this.createWritePromise((0, Commands_1.createZUnion)(keys), options);
3516
+ return this.createWritePromise((0, _1.createZUnion)(keys), options);
3491
3517
  }
3492
3518
  /**
3493
3519
  * Computes the intersection of sorted sets given by the specified `keys` and returns a list of union elements with scores.
@@ -3521,7 +3547,7 @@ class BaseClient {
3521
3547
  * ```
3522
3548
  */
3523
3549
  async zunionWithScores(keys, options) {
3524
- return this.createWritePromise((0, Commands_1.createZUnion)(keys, options?.aggregationType, true), options).then(convertGlideRecordForSortedSet);
3550
+ return this.createWritePromise((0, _1.createZUnion)(keys, options?.aggregationType, true), options).then(convertGlideRecordForSortedSet);
3525
3551
  }
3526
3552
  /**
3527
3553
  * Returns a random member from the sorted set stored at `key`.
@@ -3546,7 +3572,7 @@ class BaseClient {
3546
3572
  * ```
3547
3573
  */
3548
3574
  async zrandmember(key, options) {
3549
- return this.createWritePromise((0, Commands_1.createZRandMember)(key), options);
3575
+ return this.createWritePromise((0, _1.createZRandMember)(key), options);
3550
3576
  }
3551
3577
  /**
3552
3578
  * Returns random members from the sorted set stored at `key`.
@@ -3574,7 +3600,7 @@ class BaseClient {
3574
3600
  * ```
3575
3601
  */
3576
3602
  async zrandmemberWithCount(key, count, options) {
3577
- return this.createWritePromise((0, Commands_1.createZRandMember)(key, count), options);
3603
+ return this.createWritePromise((0, _1.createZRandMember)(key, count), options);
3578
3604
  }
3579
3605
  /**
3580
3606
  * Returns random members with scores from the sorted set stored at `key`.
@@ -3602,7 +3628,7 @@ class BaseClient {
3602
3628
  * ```
3603
3629
  */
3604
3630
  async zrandmemberWithCountWithScores(key, count, options) {
3605
- return this.createWritePromise((0, Commands_1.createZRandMember)(key, count, true), options);
3631
+ return this.createWritePromise((0, _1.createZRandMember)(key, count, true), options);
3606
3632
  }
3607
3633
  /**
3608
3634
  * Returns the length of the string value stored at `key`.
@@ -3629,7 +3655,7 @@ class BaseClient {
3629
3655
  * ```
3630
3656
  */
3631
3657
  async strlen(key) {
3632
- return this.createWritePromise((0, Commands_1.createStrlen)(key));
3658
+ return this.createWritePromise((0, _1.createStrlen)(key));
3633
3659
  }
3634
3660
  /**
3635
3661
  * Returns the string representation of the type of the value stored at `key`.
@@ -3656,7 +3682,7 @@ class BaseClient {
3656
3682
  * ```
3657
3683
  */
3658
3684
  async type(key) {
3659
- return this.createWritePromise((0, Commands_1.createType)(key), {
3685
+ return this.createWritePromise((0, _1.createType)(key), {
3660
3686
  decoder: Decoder.String,
3661
3687
  });
3662
3688
  }
@@ -3697,7 +3723,7 @@ class BaseClient {
3697
3723
  * ```
3698
3724
  */
3699
3725
  async zpopmin(key, options) {
3700
- return this.createWritePromise((0, Commands_1.createZPopMin)(key, options?.count), options).then(convertGlideRecordForSortedSet);
3726
+ return this.createWritePromise((0, _1.createZPopMin)(key, options?.count), options).then(convertGlideRecordForSortedSet);
3701
3727
  }
3702
3728
  /**
3703
3729
  * Blocks the connection until it removes and returns a member with the lowest score from the
@@ -3722,7 +3748,7 @@ class BaseClient {
3722
3748
  * ```
3723
3749
  */
3724
3750
  async bzpopmin(keys, timeout, options) {
3725
- return this.createWritePromise((0, Commands_1.createBZPopMin)(keys, timeout), options);
3751
+ return this.createWritePromise((0, _1.createBZPopMin)(keys, timeout), options);
3726
3752
  }
3727
3753
  /**
3728
3754
  * Removes and returns the members with the highest scores from the sorted set stored at `key`.
@@ -3761,7 +3787,7 @@ class BaseClient {
3761
3787
  * ```
3762
3788
  */
3763
3789
  async zpopmax(key, options) {
3764
- return this.createWritePromise((0, Commands_1.createZPopMax)(key, options?.count), options).then(convertGlideRecordForSortedSet);
3790
+ return this.createWritePromise((0, _1.createZPopMax)(key, options?.count), options).then(convertGlideRecordForSortedSet);
3765
3791
  }
3766
3792
  /**
3767
3793
  * Blocks the connection until it removes and returns a member with the highest score from the
@@ -3786,7 +3812,7 @@ class BaseClient {
3786
3812
  * ```
3787
3813
  */
3788
3814
  async bzpopmax(keys, timeout, options) {
3789
- return this.createWritePromise((0, Commands_1.createBZPopMax)(keys, timeout), options);
3815
+ return this.createWritePromise((0, _1.createBZPopMax)(keys, timeout), options);
3790
3816
  }
3791
3817
  /**
3792
3818
  * Returns the remaining time to live of `key` that has a timeout, in milliseconds.
@@ -3818,7 +3844,7 @@ class BaseClient {
3818
3844
  * ```
3819
3845
  */
3820
3846
  async pttl(key) {
3821
- return this.createWritePromise((0, Commands_1.createPTTL)(key));
3847
+ return this.createWritePromise((0, _1.createPTTL)(key));
3822
3848
  }
3823
3849
  /**
3824
3850
  * Removes all elements in the sorted set stored at `key` with rank between `start` and `end`.
@@ -3843,7 +3869,7 @@ class BaseClient {
3843
3869
  * ```
3844
3870
  */
3845
3871
  async zremRangeByRank(key, start, end) {
3846
- return this.createWritePromise((0, Commands_1.createZRemRangeByRank)(key, start, end));
3872
+ return this.createWritePromise((0, _1.createZRemRangeByRank)(key, start, end));
3847
3873
  }
3848
3874
  /**
3849
3875
  * Removes all elements in the sorted set stored at `key` with lexicographical order between `minLex` and `maxLex`.
@@ -3872,7 +3898,7 @@ class BaseClient {
3872
3898
  * ```
3873
3899
  */
3874
3900
  async zremRangeByLex(key, minLex, maxLex) {
3875
- return this.createWritePromise((0, Commands_1.createZRemRangeByLex)(key, minLex, maxLex));
3901
+ return this.createWritePromise((0, _1.createZRemRangeByLex)(key, minLex, maxLex));
3876
3902
  }
3877
3903
  /**
3878
3904
  * Removes all elements in the sorted set stored at `key` with a score between `minScore` and `maxScore`.
@@ -3901,7 +3927,7 @@ class BaseClient {
3901
3927
  * ```
3902
3928
  */
3903
3929
  async zremRangeByScore(key, minScore, maxScore) {
3904
- return this.createWritePromise((0, Commands_1.createZRemRangeByScore)(key, minScore, maxScore));
3930
+ return this.createWritePromise((0, _1.createZRemRangeByScore)(key, minScore, maxScore));
3905
3931
  }
3906
3932
  /**
3907
3933
  * Returns the number of members in the sorted set stored at 'key' with scores between 'minLex' and 'maxLex'.
@@ -3928,7 +3954,7 @@ class BaseClient {
3928
3954
  * ```
3929
3955
  */
3930
3956
  async zlexcount(key, minLex, maxLex) {
3931
- return this.createWritePromise((0, Commands_1.createZLexCount)(key, minLex, maxLex));
3957
+ return this.createWritePromise((0, _1.createZLexCount)(key, minLex, maxLex));
3932
3958
  }
3933
3959
  /**
3934
3960
  * Returns the rank of `member` in the sorted set stored at `key`, with scores ordered from low to high.
@@ -3956,7 +3982,7 @@ class BaseClient {
3956
3982
  * ```
3957
3983
  */
3958
3984
  async zrank(key, member) {
3959
- return this.createWritePromise((0, Commands_1.createZRank)(key, member));
3985
+ return this.createWritePromise((0, _1.createZRank)(key, member));
3960
3986
  }
3961
3987
  /**
3962
3988
  * Returns the rank of `member` in the sorted set stored at `key` with its score, where scores are ordered from the lowest to highest.
@@ -3984,7 +4010,7 @@ class BaseClient {
3984
4010
  * ```
3985
4011
  */
3986
4012
  async zrankWithScore(key, member) {
3987
- return this.createWritePromise((0, Commands_1.createZRank)(key, member, true));
4013
+ return this.createWritePromise((0, _1.createZRank)(key, member, true));
3988
4014
  }
3989
4015
  /**
3990
4016
  * Returns the rank of `member` in the sorted set stored at `key`, where
@@ -4005,7 +4031,7 @@ class BaseClient {
4005
4031
  * ```
4006
4032
  */
4007
4033
  async zrevrank(key, member) {
4008
- return this.createWritePromise((0, Commands_1.createZRevRank)(key, member));
4034
+ return this.createWritePromise((0, _1.createZRevRank)(key, member));
4009
4035
  }
4010
4036
  /**
4011
4037
  * Returns the rank of `member` in the sorted set stored at `key` with its
@@ -4027,7 +4053,7 @@ class BaseClient {
4027
4053
  * ```
4028
4054
  */
4029
4055
  async zrevrankWithScore(key, member) {
4030
- return this.createWritePromise((0, Commands_1.createZRevRankWithScore)(key, member));
4056
+ return this.createWritePromise((0, _1.createZRevRankWithScore)(key, member));
4031
4057
  }
4032
4058
  /**
4033
4059
  * Adds an entry to the specified stream stored at `key`. If the `key` doesn't exist, the stream is created.
@@ -4041,7 +4067,7 @@ class BaseClient {
4041
4067
  * @returns The id of the added entry, or `null` if `options.makeStream` is set to `false` and no stream with the matching `key` exists.
4042
4068
  */
4043
4069
  async xadd(key, values, options) {
4044
- return this.createWritePromise((0, Commands_1.createXAdd)(key, values, options), options);
4070
+ return this.createWritePromise((0, _1.createXAdd)(key, values, options), options);
4045
4071
  }
4046
4072
  /**
4047
4073
  * Removes the specified entries by id from a stream, and returns the number of entries deleted.
@@ -4060,7 +4086,7 @@ class BaseClient {
4060
4086
  * ```
4061
4087
  */
4062
4088
  async xdel(key, ids) {
4063
- return this.createWritePromise((0, Commands_1.createXDel)(key, ids));
4089
+ return this.createWritePromise((0, _1.createXDel)(key, ids));
4064
4090
  }
4065
4091
  /**
4066
4092
  * Trims the stream stored at `key` by evicting older entries.
@@ -4072,7 +4098,7 @@ class BaseClient {
4072
4098
  * @returns The number of entries deleted from the stream. If `key` doesn't exist, 0 is returned.
4073
4099
  */
4074
4100
  async xtrim(key, options) {
4075
- return this.createWritePromise((0, Commands_1.createXTrim)(key, options));
4101
+ return this.createWritePromise((0, _1.createXTrim)(key, options));
4076
4102
  }
4077
4103
  /**
4078
4104
  * Reads entries from the given streams.
@@ -4106,7 +4132,7 @@ class BaseClient {
4106
4132
  * ```
4107
4133
  */
4108
4134
  async xread(keys_and_ids, options) {
4109
- return this.createWritePromise((0, Commands_1.createXRead)((0, Commands_1.convertKeysAndEntries)(keys_and_ids), options), options).then((res) => res?.map((k) => {
4135
+ return this.createWritePromise((0, _1.createXRead)((0, _1.convertKeysAndEntries)(keys_and_ids), options), options).then((res) => res?.map((k) => {
4110
4136
  return {
4111
4137
  key: k.key,
4112
4138
  value: convertGlideRecordToRecord(k.value),
@@ -4153,7 +4179,7 @@ class BaseClient {
4153
4179
  * ```
4154
4180
  */
4155
4181
  async xreadgroup(group, consumer, keys_and_ids, options) {
4156
- return this.createWritePromise((0, Commands_1.createXReadGroup)(group, consumer, (0, Commands_1.convertKeysAndEntries)(keys_and_ids), options), options).then((res) => res?.map((k) => {
4182
+ return this.createWritePromise((0, _1.createXReadGroup)(group, consumer, (0, _1.convertKeysAndEntries)(keys_and_ids), options), options).then((res) => res?.map((k) => {
4157
4183
  return {
4158
4184
  key: k.key,
4159
4185
  value: convertGlideRecordToRecord(k.value),
@@ -4175,7 +4201,7 @@ class BaseClient {
4175
4201
  * ```
4176
4202
  */
4177
4203
  async xlen(key) {
4178
- return this.createWritePromise((0, Commands_1.createXLen)(key));
4204
+ return this.createWritePromise((0, _1.createXLen)(key));
4179
4205
  }
4180
4206
  /**
4181
4207
  * Returns stream message summary information for pending messages matching a given range of IDs.
@@ -4200,7 +4226,7 @@ class BaseClient {
4200
4226
  * ```
4201
4227
  */
4202
4228
  async xpending(key, group) {
4203
- return this.createWritePromise((0, Commands_1.createXPending)(key, group));
4229
+ return this.createWritePromise((0, _1.createXPending)(key, group));
4204
4230
  }
4205
4231
  /**
4206
4232
  * Returns an extended form of stream message information for pending messages matching a given range of IDs.
@@ -4237,7 +4263,7 @@ class BaseClient {
4237
4263
  * ```
4238
4264
  */
4239
4265
  async xpendingWithOptions(key, group, options) {
4240
- return this.createWritePromise((0, Commands_1.createXPending)(key, group, options));
4266
+ return this.createWritePromise((0, _1.createXPending)(key, group, options));
4241
4267
  }
4242
4268
  /**
4243
4269
  * Returns the list of all consumers and their attributes for the given consumer group of the
@@ -4267,7 +4293,7 @@ class BaseClient {
4267
4293
  * ```
4268
4294
  */
4269
4295
  async xinfoConsumers(key, group, options) {
4270
- return this.createWritePromise((0, Commands_1.createXInfoConsumers)(key, group), options).then((res) => res.map(convertGlideRecordToRecord));
4296
+ return this.createWritePromise((0, _1.createXInfoConsumers)(key, group), options).then((res) => res.map(convertGlideRecordToRecord));
4271
4297
  }
4272
4298
  /**
4273
4299
  * Returns the list of all consumer groups and their attributes for the stream stored at `key`.
@@ -4303,7 +4329,7 @@ class BaseClient {
4303
4329
  * ```
4304
4330
  */
4305
4331
  async xinfoGroups(key, options) {
4306
- return this.createWritePromise((0, Commands_1.createXInfoGroups)(key), options).then((res) => res.map(convertGlideRecordToRecord));
4332
+ return this.createWritePromise((0, _1.createXInfoGroups)(key), options).then((res) => res.map(convertGlideRecordToRecord));
4307
4333
  }
4308
4334
  /**
4309
4335
  * Changes the ownership of a pending message.
@@ -4329,7 +4355,7 @@ class BaseClient {
4329
4355
  * ```
4330
4356
  */
4331
4357
  async xclaim(key, group, consumer, minIdleTime, ids, options) {
4332
- return this.createWritePromise((0, Commands_1.createXClaim)(key, group, consumer, minIdleTime, ids, options), options).then(convertGlideRecordToRecord);
4358
+ return this.createWritePromise((0, _1.createXClaim)(key, group, consumer, minIdleTime, ids, options), options).then(convertGlideRecordToRecord);
4333
4359
  }
4334
4360
  /**
4335
4361
  * Transfers ownership of pending stream entries that match the specified criteria.
@@ -4376,7 +4402,7 @@ class BaseClient {
4376
4402
  * ```
4377
4403
  */
4378
4404
  async xautoclaim(key, group, consumer, minIdleTime, start, options) {
4379
- return this.createWritePromise((0, Commands_1.createXAutoClaim)(key, group, consumer, minIdleTime, start, options?.count), options).then((res) => res.length === 3
4405
+ return this.createWritePromise((0, _1.createXAutoClaim)(key, group, consumer, minIdleTime, start, options?.count), options).then((res) => res.length === 3
4380
4406
  ? [res[0], convertGlideRecordToRecord(res[1]), res[2]]
4381
4407
  : [res[0], convertGlideRecordToRecord(res[1])]);
4382
4408
  }
@@ -4422,7 +4448,7 @@ class BaseClient {
4422
4448
  * ```
4423
4449
  */
4424
4450
  async xautoclaimJustId(key, group, consumer, minIdleTime, start, options) {
4425
- return this.createWritePromise((0, Commands_1.createXAutoClaim)(key, group, consumer, minIdleTime, start, options?.count, true), { decoder: Decoder.String });
4451
+ return this.createWritePromise((0, _1.createXAutoClaim)(key, group, consumer, minIdleTime, start, options?.count, true), { decoder: Decoder.String });
4426
4452
  }
4427
4453
  /**
4428
4454
  * Changes the ownership of a pending message. This function returns an `array` with
@@ -4446,7 +4472,7 @@ class BaseClient {
4446
4472
  * ```
4447
4473
  */
4448
4474
  async xclaimJustId(key, group, consumer, minIdleTime, ids, options) {
4449
- return this.createWritePromise((0, Commands_1.createXClaim)(key, group, consumer, minIdleTime, ids, options, true), { decoder: Decoder.String });
4475
+ return this.createWritePromise((0, _1.createXClaim)(key, group, consumer, minIdleTime, ids, options, true), { decoder: Decoder.String });
4450
4476
  }
4451
4477
  /**
4452
4478
  * Creates a new consumer group uniquely identified by `groupname` for the stream stored at `key`.
@@ -4466,7 +4492,7 @@ class BaseClient {
4466
4492
  * ```
4467
4493
  */
4468
4494
  async xgroupCreate(key, groupName, id, options) {
4469
- return this.createWritePromise((0, Commands_1.createXGroupCreate)(key, groupName, id, options), { decoder: Decoder.String });
4495
+ return this.createWritePromise((0, _1.createXGroupCreate)(key, groupName, id, options), { decoder: Decoder.String });
4470
4496
  }
4471
4497
  /**
4472
4498
  * Destroys the consumer group `groupname` for the stream stored at `key`.
@@ -4484,7 +4510,7 @@ class BaseClient {
4484
4510
  * ```
4485
4511
  */
4486
4512
  async xgroupDestroy(key, groupName) {
4487
- return this.createWritePromise((0, Commands_1.createXGroupDestroy)(key, groupName));
4513
+ return this.createWritePromise((0, _1.createXGroupDestroy)(key, groupName));
4488
4514
  }
4489
4515
  /**
4490
4516
  * Returns information about the stream stored at `key`.
@@ -4553,7 +4579,7 @@ class BaseClient {
4553
4579
  * ```
4554
4580
  */
4555
4581
  async xinfoStream(key, options) {
4556
- return this.createWritePromise((0, Commands_1.createXInfoStream)(key, options?.fullOptions ?? false), options).then((xinfoStream) => convertGlideRecordToRecord(xinfoStream));
4582
+ return this.createWritePromise((0, _1.createXInfoStream)(key, options?.fullOptions ?? false), options).then((xinfoStream) => convertGlideRecordToRecord(xinfoStream));
4557
4583
  }
4558
4584
  /**
4559
4585
  * Creates a consumer named `consumerName` in the consumer group `groupName` for the stream stored at `key`.
@@ -4572,7 +4598,7 @@ class BaseClient {
4572
4598
  * ```
4573
4599
  */
4574
4600
  async xgroupCreateConsumer(key, groupName, consumerName) {
4575
- return this.createWritePromise((0, Commands_1.createXGroupCreateConsumer)(key, groupName, consumerName));
4601
+ return this.createWritePromise((0, _1.createXGroupCreateConsumer)(key, groupName, consumerName));
4576
4602
  }
4577
4603
  /**
4578
4604
  * Deletes a consumer named `consumerName` in the consumer group `groupName` for the stream stored at `key`.
@@ -4591,8 +4617,14 @@ class BaseClient {
4591
4617
  * ```
4592
4618
  */
4593
4619
  async xgroupDelConsumer(key, groupName, consumerName) {
4594
- return this.createWritePromise((0, Commands_1.createXGroupDelConsumer)(key, groupName, consumerName));
4620
+ return this.createWritePromise((0, _1.createXGroupDelConsumer)(key, groupName, consumerName));
4595
4621
  }
4622
+ MAP_READ_FROM_STRATEGY = {
4623
+ primary: ProtobufMessage_1.connection_request.ReadFrom.Primary,
4624
+ preferReplica: ProtobufMessage_1.connection_request.ReadFrom.PreferReplica,
4625
+ AZAffinity: ProtobufMessage_1.connection_request.ReadFrom.AZAffinity,
4626
+ AZAffinityReplicasAndPrimary: ProtobufMessage_1.connection_request.ReadFrom.AZAffinityReplicasAndPrimary,
4627
+ };
4596
4628
  /**
4597
4629
  * Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.
4598
4630
  * This command should be called on a pending message so that such message does not get processed again.
@@ -4614,7 +4646,7 @@ class BaseClient {
4614
4646
  * ```
4615
4647
  */
4616
4648
  async xack(key, group, ids) {
4617
- return this.createWritePromise((0, Commands_1.createXAck)(key, group, ids));
4649
+ return this.createWritePromise((0, _1.createXAck)(key, group, ids));
4618
4650
  }
4619
4651
  /**
4620
4652
  * Sets the last delivered ID for a consumer group.
@@ -4635,7 +4667,7 @@ class BaseClient {
4635
4667
  * ```
4636
4668
  */
4637
4669
  async xgroupSetId(key, groupName, id, options) {
4638
- return this.createWritePromise((0, Commands_1.createXGroupSetid)(key, groupName, id, options?.entriesRead), { decoder: Decoder.String });
4670
+ return this.createWritePromise((0, _1.createXGroupSetid)(key, groupName, id, options?.entriesRead), { decoder: Decoder.String });
4639
4671
  }
4640
4672
  /** Returns the element at index `index` in the list stored at `key`.
4641
4673
  * The index is zero-based, so 0 means the first element, 1 the second element and so on.
@@ -4665,7 +4697,7 @@ class BaseClient {
4665
4697
  * ```
4666
4698
  */
4667
4699
  async lindex(key, index, options) {
4668
- return this.createWritePromise((0, Commands_1.createLIndex)(key, index), options);
4700
+ return this.createWritePromise((0, _1.createLIndex)(key, index), options);
4669
4701
  }
4670
4702
  /**
4671
4703
  * Inserts `element` in the list at `key` either before or after the `pivot`.
@@ -4688,7 +4720,7 @@ class BaseClient {
4688
4720
  * ```
4689
4721
  */
4690
4722
  async linsert(key, position, pivot, element) {
4691
- return this.createWritePromise((0, Commands_1.createLInsert)(key, position, pivot, element));
4723
+ return this.createWritePromise((0, _1.createLInsert)(key, position, pivot, element));
4692
4724
  }
4693
4725
  /**
4694
4726
  * Removes the existing timeout on `key`, turning the key from volatile (a key with an expire set) to
@@ -4707,7 +4739,7 @@ class BaseClient {
4707
4739
  * ```
4708
4740
  */
4709
4741
  async persist(key) {
4710
- return this.createWritePromise((0, Commands_1.createPersist)(key));
4742
+ return this.createWritePromise((0, _1.createPersist)(key));
4711
4743
  }
4712
4744
  /**
4713
4745
  * Renames `key` to `newkey`.
@@ -4729,7 +4761,7 @@ class BaseClient {
4729
4761
  * ```
4730
4762
  */
4731
4763
  async rename(key, newKey) {
4732
- return this.createWritePromise((0, Commands_1.createRename)(key, newKey), {
4764
+ return this.createWritePromise((0, _1.createRename)(key, newKey), {
4733
4765
  decoder: Decoder.String,
4734
4766
  });
4735
4767
  }
@@ -4753,7 +4785,7 @@ class BaseClient {
4753
4785
  * ```
4754
4786
  */
4755
4787
  async renamenx(key, newKey) {
4756
- return this.createWritePromise((0, Commands_1.createRenameNX)(key, newKey));
4788
+ return this.createWritePromise((0, _1.createRenameNX)(key, newKey));
4757
4789
  }
4758
4790
  /** Blocking list pop primitive.
4759
4791
  * Pop an element from the tail of the first list that is non-empty,
@@ -4778,7 +4810,7 @@ class BaseClient {
4778
4810
  * ```
4779
4811
  */
4780
4812
  async brpop(keys, timeout, options) {
4781
- return this.createWritePromise((0, Commands_1.createBRPop)(keys, timeout), options);
4813
+ return this.createWritePromise((0, _1.createBRPop)(keys, timeout), options);
4782
4814
  }
4783
4815
  /** Blocking list pop primitive.
4784
4816
  * Pop an element from the head of the first list that is non-empty,
@@ -4802,7 +4834,7 @@ class BaseClient {
4802
4834
  * ```
4803
4835
  */
4804
4836
  async blpop(keys, timeout, options) {
4805
- return this.createWritePromise((0, Commands_1.createBLPop)(keys, timeout), options);
4837
+ return this.createWritePromise((0, _1.createBLPop)(keys, timeout), options);
4806
4838
  }
4807
4839
  /** Adds all elements to the HyperLogLog data structure stored at the specified `key`.
4808
4840
  * Creates a new structure if the `key` does not exist.
@@ -4813,17 +4845,17 @@ class BaseClient {
4813
4845
  * @param key - The key of the HyperLogLog data structure to add elements into.
4814
4846
  * @param elements - An array of members to add to the HyperLogLog stored at `key`.
4815
4847
  * @returns - If the HyperLogLog is newly created, or if the HyperLogLog approximated cardinality is
4816
- * altered, then returns `1`. Otherwise, returns `0`.
4848
+ * altered, then returns `true`. Otherwise, returns `false`.
4817
4849
  * @example
4818
4850
  * ```typescript
4819
4851
  * const result = await client.pfadd("hll_1", ["a", "b", "c"]);
4820
- * console.log(result); // Output: 1 - Indicates that a data structure was created or modified
4852
+ * console.log(result); // Output: true - Indicates that a data structure was created or modified
4821
4853
  * const result = await client.pfadd("hll_2", []);
4822
- * console.log(result); // Output: 1 - Indicates that a new empty data structure was created
4854
+ * console.log(result); // Output: true - Indicates that a new empty data structure was created
4823
4855
  * ```
4824
4856
  */
4825
4857
  async pfadd(key, elements) {
4826
- return this.createWritePromise((0, Commands_1.createPfAdd)(key, elements));
4858
+ return this.createWritePromise((0, _1.createPfAdd)(key, elements));
4827
4859
  }
4828
4860
  /** Estimates the cardinality of the data stored in a HyperLogLog structure for a single key or
4829
4861
  * calculates the combined cardinality of multiple keys by merging their HyperLogLogs temporarily.
@@ -4841,7 +4873,7 @@ class BaseClient {
4841
4873
  * ```
4842
4874
  */
4843
4875
  async pfcount(keys) {
4844
- return this.createWritePromise((0, Commands_1.createPfCount)(keys));
4876
+ return this.createWritePromise((0, _1.createPfCount)(keys));
4845
4877
  }
4846
4878
  /**
4847
4879
  * Merges multiple HyperLogLog values into a unique value. If the destination variable exists, it is
@@ -4865,7 +4897,7 @@ class BaseClient {
4865
4897
  * ```
4866
4898
  */
4867
4899
  async pfmerge(destination, sourceKeys) {
4868
- return this.createWritePromise((0, Commands_1.createPfMerge)(destination, sourceKeys), {
4900
+ return this.createWritePromise((0, _1.createPfMerge)(destination, sourceKeys), {
4869
4901
  decoder: Decoder.String,
4870
4902
  });
4871
4903
  }
@@ -4885,7 +4917,7 @@ class BaseClient {
4885
4917
  * ```
4886
4918
  */
4887
4919
  async objectEncoding(key) {
4888
- return this.createWritePromise((0, Commands_1.createObjectEncoding)(key), {
4920
+ return this.createWritePromise((0, _1.createObjectEncoding)(key), {
4889
4921
  decoder: Decoder.String,
4890
4922
  });
4891
4923
  }
@@ -4905,7 +4937,7 @@ class BaseClient {
4905
4937
  * ```
4906
4938
  */
4907
4939
  async objectFreq(key) {
4908
- return this.createWritePromise((0, Commands_1.createObjectFreq)(key));
4940
+ return this.createWritePromise((0, _1.createObjectFreq)(key));
4909
4941
  }
4910
4942
  /**
4911
4943
  * Returns the time in seconds since the last access to the value stored at `key`.
@@ -4922,7 +4954,7 @@ class BaseClient {
4922
4954
  * ```
4923
4955
  */
4924
4956
  async objectIdletime(key) {
4925
- return this.createWritePromise((0, Commands_1.createObjectIdletime)(key));
4957
+ return this.createWritePromise((0, _1.createObjectIdletime)(key));
4926
4958
  }
4927
4959
  /**
4928
4960
  * Returns the reference count of the object stored at `key`.
@@ -4940,7 +4972,7 @@ class BaseClient {
4940
4972
  * ```
4941
4973
  */
4942
4974
  async objectRefcount(key) {
4943
- return this.createWritePromise((0, Commands_1.createObjectRefcount)(key));
4975
+ return this.createWritePromise((0, _1.createObjectRefcount)(key));
4944
4976
  }
4945
4977
  /**
4946
4978
  * Invokes a previously loaded function.
@@ -4963,7 +4995,7 @@ class BaseClient {
4963
4995
  * ```
4964
4996
  */
4965
4997
  async fcall(func, keys, args, options) {
4966
- return this.createWritePromise((0, Commands_1.createFCall)(func, keys, args), options);
4998
+ return this.createWritePromise((0, _1.createFCall)(func, keys, args), options);
4967
4999
  }
4968
5000
  /**
4969
5001
  * Invokes a previously loaded read-only function.
@@ -4987,7 +5019,7 @@ class BaseClient {
4987
5019
  * ```
4988
5020
  */
4989
5021
  async fcallReadonly(func, keys, args, options) {
4990
- return this.createWritePromise((0, Commands_1.createFCallReadOnly)(func, keys, args), options);
5022
+ return this.createWritePromise((0, _1.createFCallReadOnly)(func, keys, args), options);
4991
5023
  }
4992
5024
  /**
4993
5025
  * Returns the index of the first occurrence of `element` inside the list specified by `key`. If no
@@ -5011,7 +5043,7 @@ class BaseClient {
5011
5043
  * ```
5012
5044
  */
5013
5045
  async lpos(key, element, options) {
5014
- return this.createWritePromise((0, Commands_1.createLPos)(key, element, options));
5046
+ return this.createWritePromise((0, _1.createLPos)(key, element, options));
5015
5047
  }
5016
5048
  /**
5017
5049
  * Counts the number of set bits (population counting) in the string stored at `key`. The `options` argument can
@@ -5035,7 +5067,7 @@ class BaseClient {
5035
5067
  * ```
5036
5068
  */
5037
5069
  async bitcount(key, options) {
5038
- return this.createWritePromise((0, Commands_1.createBitCount)(key, options));
5070
+ return this.createWritePromise((0, _1.createBitCount)(key, options));
5039
5071
  }
5040
5072
  /**
5041
5073
  * Adds geospatial members with their positions to the specified sorted set stored at `key`.
@@ -5062,7 +5094,7 @@ class BaseClient {
5062
5094
  * ```
5063
5095
  */
5064
5096
  async geoadd(key, membersToGeospatialData, options) {
5065
- return this.createWritePromise((0, Commands_1.createGeoAdd)(key, membersToGeospatialData, options));
5097
+ return this.createWritePromise((0, _1.createGeoAdd)(key, membersToGeospatialData, options));
5066
5098
  }
5067
5099
  /**
5068
5100
  * Returns the members of a sorted set populated with geospatial information using {@link geoadd},
@@ -5132,7 +5164,7 @@ class BaseClient {
5132
5164
  * ```
5133
5165
  */
5134
5166
  async geosearch(key, searchFrom, searchBy, options) {
5135
- return this.createWritePromise((0, Commands_1.createGeoSearch)(key, searchFrom, searchBy, options), options);
5167
+ return this.createWritePromise((0, _1.createGeoSearch)(key, searchFrom, searchBy, options), options);
5136
5168
  }
5137
5169
  /**
5138
5170
  * Searches for members in a sorted set stored at `source` representing geospatial data
@@ -5195,7 +5227,7 @@ class BaseClient {
5195
5227
  * ```
5196
5228
  */
5197
5229
  async geosearchstore(destination, source, searchFrom, searchBy, options) {
5198
- return this.createWritePromise((0, Commands_1.createGeoSearchStore)(destination, source, searchFrom, searchBy, options));
5230
+ return this.createWritePromise((0, _1.createGeoSearchStore)(destination, source, searchFrom, searchBy, options));
5199
5231
  }
5200
5232
  /**
5201
5233
  * Returns the positions (longitude, latitude) of all the specified `members` of the
@@ -5225,7 +5257,7 @@ class BaseClient {
5225
5257
  * ```
5226
5258
  */
5227
5259
  async geopos(key, members) {
5228
- return this.createWritePromise((0, Commands_1.createGeoPos)(key, members));
5260
+ return this.createWritePromise((0, _1.createGeoPos)(key, members));
5229
5261
  }
5230
5262
  /**
5231
5263
  * Pops member-score pairs from the first non-empty sorted set, with the given `keys`
@@ -5259,7 +5291,7 @@ class BaseClient {
5259
5291
  * ```
5260
5292
  */
5261
5293
  async zmpop(keys, modifier, options) {
5262
- return this.createWritePromise((0, Commands_1.createZMPop)(keys, modifier, options?.count), options).then((res) => res === null
5294
+ return this.createWritePromise((0, _1.createZMPop)(keys, modifier, options?.count), options).then((res) => res === null
5263
5295
  ? null
5264
5296
  : [res[0], convertGlideRecordForSortedSet(res[1])]);
5265
5297
  }
@@ -5299,7 +5331,7 @@ class BaseClient {
5299
5331
  * ```
5300
5332
  */
5301
5333
  async bzmpop(keys, modifier, timeout, options) {
5302
- return this.createWritePromise((0, Commands_1.createBZMPop)(keys, modifier, timeout, options?.count), options).then((res) => res === null
5334
+ return this.createWritePromise((0, _1.createBZMPop)(keys, modifier, timeout, options?.count), options).then((res) => res === null
5303
5335
  ? null
5304
5336
  : [res[0], convertGlideRecordForSortedSet(res[1])]);
5305
5337
  }
@@ -5329,7 +5361,7 @@ class BaseClient {
5329
5361
  * ```
5330
5362
  */
5331
5363
  async zincrby(key, increment, member) {
5332
- return this.createWritePromise((0, Commands_1.createZIncrBy)(key, increment, member));
5364
+ return this.createWritePromise((0, _1.createZIncrBy)(key, increment, member));
5333
5365
  }
5334
5366
  /**
5335
5367
  * Iterates incrementally over a sorted set.
@@ -5395,7 +5427,7 @@ class BaseClient {
5395
5427
  * ```
5396
5428
  */
5397
5429
  async zscan(key, cursor, options) {
5398
- return this.createWritePromise((0, Commands_1.createZScan)(key, cursor, options), options).then((res) => [res[0].toString(), res[1]]); // convert cursor back to string
5430
+ return this.createWritePromise((0, _1.createZScan)(key, cursor, options), options).then((res) => [res[0].toString(), res[1]]); // convert cursor back to string
5399
5431
  }
5400
5432
  /**
5401
5433
  * Returns the distance between `member1` and `member2` saved in the geospatial index stored at `key`.
@@ -5418,7 +5450,7 @@ class BaseClient {
5418
5450
  * ```
5419
5451
  */
5420
5452
  async geodist(key, member1, member2, options) {
5421
- return this.createWritePromise((0, Commands_1.createGeoDist)(key, member1, member2, options?.unit));
5453
+ return this.createWritePromise((0, _1.createGeoDist)(key, member1, member2, options?.unit));
5422
5454
  }
5423
5455
  /**
5424
5456
  * Returns the `GeoHash` strings representing the positions of all the specified `members` in the sorted set stored at `key`.
@@ -5437,7 +5469,7 @@ class BaseClient {
5437
5469
  * ```
5438
5470
  */
5439
5471
  async geohash(key, members) {
5440
- return this.createWritePromise((0, Commands_1.createGeoHash)(key, members), {
5472
+ return this.createWritePromise((0, _1.createGeoHash)(key, members), {
5441
5473
  decoder: Decoder.String,
5442
5474
  });
5443
5475
  }
@@ -5462,7 +5494,7 @@ class BaseClient {
5462
5494
  * ```
5463
5495
  */
5464
5496
  async lcs(key1, key2, options) {
5465
- return this.createWritePromise((0, Commands_1.createLCS)(key1, key2), options);
5497
+ return this.createWritePromise((0, _1.createLCS)(key1, key2), options);
5466
5498
  }
5467
5499
  /**
5468
5500
  * Returns the total length of all the longest common subsequences between strings stored at `key1` and `key2`.
@@ -5484,7 +5516,7 @@ class BaseClient {
5484
5516
  * ```
5485
5517
  */
5486
5518
  async lcsLen(key1, key2, options) {
5487
- return this.createWritePromise((0, Commands_1.createLCS)(key1, key2, { len: true }), options);
5519
+ return this.createWritePromise((0, _1.createLCS)(key1, key2, { len: true }), options);
5488
5520
  }
5489
5521
  /**
5490
5522
  * Returns the indices and lengths of the longest common subsequences between strings stored at
@@ -5534,7 +5566,7 @@ class BaseClient {
5534
5566
  * ```
5535
5567
  */
5536
5568
  async lcsIdx(key1, key2, options) {
5537
- return this.createWritePromise((0, Commands_1.createLCS)(key1, key2, { idx: options ?? {} })).then(convertGlideRecordToRecord);
5569
+ return this.createWritePromise((0, _1.createLCS)(key1, key2, { idx: options ?? {} })).then(convertGlideRecordToRecord);
5538
5570
  }
5539
5571
  /**
5540
5572
  * Updates the last access time of the specified keys.
@@ -5561,7 +5593,7 @@ class BaseClient {
5561
5593
  * ```
5562
5594
  */
5563
5595
  async touch(keys) {
5564
- return this.createWritePromise((0, Commands_1.createTouch)(keys));
5596
+ return this.createWritePromise((0, _1.createTouch)(keys));
5565
5597
  }
5566
5598
  /**
5567
5599
  * Marks the given keys to be watched for conditional execution of a transaction. Transactions
@@ -5599,7 +5631,7 @@ class BaseClient {
5599
5631
  * ```
5600
5632
  */
5601
5633
  async watch(keys) {
5602
- return this.createWritePromise((0, Commands_1.createWatch)(keys), {
5634
+ return this.createWritePromise((0, _1.createWatch)(keys), {
5603
5635
  decoder: Decoder.String,
5604
5636
  });
5605
5637
  }
@@ -5622,7 +5654,7 @@ class BaseClient {
5622
5654
  * ```
5623
5655
  */
5624
5656
  async wait(numreplicas, timeout) {
5625
- return this.createWritePromise((0, Commands_1.createWait)(numreplicas, timeout));
5657
+ return this.createWritePromise((0, _1.createWait)(numreplicas, timeout));
5626
5658
  }
5627
5659
  /**
5628
5660
  * Overwrites part of the string stored at `key`, starting at the specified byte `offset`,
@@ -5645,7 +5677,7 @@ class BaseClient {
5645
5677
  * ```
5646
5678
  */
5647
5679
  async setrange(key, offset, value) {
5648
- return this.createWritePromise((0, Commands_1.createSetRange)(key, offset, value));
5680
+ return this.createWritePromise((0, _1.createSetRange)(key, offset, value));
5649
5681
  }
5650
5682
  /**
5651
5683
  * Appends a `value` to a `key`. If `key` does not exist it is created and set as an empty string,
@@ -5670,7 +5702,7 @@ class BaseClient {
5670
5702
  * ```
5671
5703
  */
5672
5704
  async append(key, value) {
5673
- return this.createWritePromise((0, Commands_1.createAppend)(key, value));
5705
+ return this.createWritePromise((0, _1.createAppend)(key, value));
5674
5706
  }
5675
5707
  /**
5676
5708
  * Pops one or more elements from the first non-empty list from the provided `keys`.
@@ -5696,7 +5728,7 @@ class BaseClient {
5696
5728
  * ```
5697
5729
  */
5698
5730
  async lmpop(keys, direction, options) {
5699
- return this.createWritePromise((0, Commands_1.createLMPop)(keys, direction, options?.count), options).then((res) => res === null
5731
+ return this.createWritePromise((0, _1.createLMPop)(keys, direction, options?.count), options).then((res) => res === null
5700
5732
  ? null
5701
5733
  : res.map((r) => {
5702
5734
  return { key: r.key, elements: r.value };
@@ -5728,7 +5760,7 @@ class BaseClient {
5728
5760
  * ```
5729
5761
  */
5730
5762
  async blmpop(keys, direction, timeout, options) {
5731
- return this.createWritePromise((0, Commands_1.createBLMPop)(keys, direction, timeout, options?.count), options).then((res) => res === null
5763
+ return this.createWritePromise((0, _1.createBLMPop)(keys, direction, timeout, options?.count), options).then((res) => res === null
5732
5764
  ? null
5733
5765
  : res.map((r) => {
5734
5766
  return { key: r.key, elements: r.value };
@@ -5757,7 +5789,7 @@ class BaseClient {
5757
5789
  * ```
5758
5790
  */
5759
5791
  async pubsubChannels(options) {
5760
- return this.createWritePromise((0, Commands_1.createPubSubChannels)(options?.pattern), options);
5792
+ return this.createWritePromise((0, _1.createPubSubChannels)(options?.pattern), options);
5761
5793
  }
5762
5794
  /**
5763
5795
  * Returns the number of unique patterns that are subscribed to by clients.
@@ -5777,7 +5809,7 @@ class BaseClient {
5777
5809
  * ```
5778
5810
  */
5779
5811
  async pubsubNumPat() {
5780
- return this.createWritePromise((0, Commands_1.createPubSubNumPat)());
5812
+ return this.createWritePromise((0, _1.createPubSubNumPat)());
5781
5813
  }
5782
5814
  /**
5783
5815
  * Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.
@@ -5800,7 +5832,7 @@ class BaseClient {
5800
5832
  * ```
5801
5833
  */
5802
5834
  async pubsubNumSub(channels, options) {
5803
- return this.createWritePromise((0, Commands_1.createPubSubNumSub)(channels), options).then((res) => res.map((r) => {
5835
+ return this.createWritePromise((0, _1.createPubSubNumSub)(channels), options).then((res) => res.map((r) => {
5804
5836
  return { channel: r.key, numSub: r.value };
5805
5837
  }));
5806
5838
  }
@@ -5831,7 +5863,7 @@ class BaseClient {
5831
5863
  * ```
5832
5864
  */
5833
5865
  async sort(key, options) {
5834
- return this.createWritePromise((0, Commands_1.createSort)(key, options), options);
5866
+ return this.createWritePromise((0, _1.createSort)(key, options), options);
5835
5867
  }
5836
5868
  /**
5837
5869
  * Sorts the elements in the list, set, or sorted set at `key` and returns the result.
@@ -5860,7 +5892,7 @@ class BaseClient {
5860
5892
  * ```
5861
5893
  */
5862
5894
  async sortReadOnly(key, options) {
5863
- return this.createWritePromise((0, Commands_1.createSortReadOnly)(key, options), options);
5895
+ return this.createWritePromise((0, _1.createSortReadOnly)(key, options), options);
5864
5896
  }
5865
5897
  /**
5866
5898
  * Sorts the elements in the list, set, or sorted set at `key` and stores the result in
@@ -5892,7 +5924,7 @@ class BaseClient {
5892
5924
  * ```
5893
5925
  */
5894
5926
  async sortStore(key, destination, options) {
5895
- return this.createWritePromise((0, Commands_1.createSort)(key, options, destination));
5927
+ return this.createWritePromise((0, _1.createSort)(key, options, destination));
5896
5928
  }
5897
5929
  /**
5898
5930
  * @internal
@@ -5922,6 +5954,7 @@ class BaseClient {
5922
5954
  authenticationInfo,
5923
5955
  inflightRequestsLimit: options.inflightRequestsLimit,
5924
5956
  clientAz: options.clientAz ?? null,
5957
+ connectionRetryStrategy: options.connectionBackoff,
5925
5958
  };
5926
5959
  }
5927
5960
  /**
@@ -5930,7 +5963,16 @@ class BaseClient {
5930
5963
  configureAdvancedConfigurationBase(options, request) {
5931
5964
  request.connectionTimeout =
5932
5965
  options.connectionTimeout ??
5933
- native_1.DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS;
5966
+ _1.DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS;
5967
+ // Apply TLS configuration if present
5968
+ if (options.tlsAdvancedConfiguration?.insecure) {
5969
+ if (request.tlsMode === ProtobufMessage_1.connection_request.TlsMode.SecureTls) {
5970
+ request.tlsMode = ProtobufMessage_1.connection_request.TlsMode.InsecureTls;
5971
+ }
5972
+ else if (request.tlsMode === ProtobufMessage_1.connection_request.TlsMode.NoTls) {
5973
+ throw new _1.ConfigurationError("InsecureTls cannot be enabled when useTLS is disabled.");
5974
+ }
5975
+ }
5934
5976
  }
5935
5977
  /**
5936
5978
  * @internal
@@ -5956,13 +5998,13 @@ class BaseClient {
5956
5998
  close(errorMessage) {
5957
5999
  this.isClosed = true;
5958
6000
  this.promiseCallbackFunctions.forEach(([, reject]) => {
5959
- reject(new Errors_1.ClosingError(errorMessage || ""));
6001
+ reject(new _1.ClosingError(errorMessage || ""));
5960
6002
  });
5961
6003
  // Handle pubsub futures
5962
6004
  this.pubsubFutures.forEach(([, reject]) => {
5963
- reject(new Errors_1.ClosingError(errorMessage || ""));
6005
+ reject(new _1.ClosingError(errorMessage || ""));
5964
6006
  });
5965
- Logger_1.Logger.log("info", "Client lifetime", "disposing of client");
6007
+ _1.Logger.log("info", "Client lifetime", "disposing of client");
5966
6008
  this.socket.end();
5967
6009
  }
5968
6010
  /**
@@ -5971,7 +6013,7 @@ class BaseClient {
5971
6013
  static async __createClientInternal(options, connectedSocket, constructor) {
5972
6014
  const connection = constructor(connectedSocket, options);
5973
6015
  await connection.connectToServer(options);
5974
- Logger_1.Logger.log("info", "Client lifetime", "connected to server");
6016
+ _1.Logger.log("info", "Client lifetime", "connected to server");
5975
6017
  return connection;
5976
6018
  }
5977
6019
  /**
@@ -5990,7 +6032,7 @@ class BaseClient {
5990
6032
  * @internal
5991
6033
  */
5992
6034
  static async createClientInternal(options, constructor) {
5993
- const path = await (0, native_1.StartSocketConnection)();
6035
+ const path = await (0, _1.StartSocketConnection)();
5994
6036
  const socket = await this.GetSocket(path);
5995
6037
  try {
5996
6038
  return await this.__createClientInternal(options, socket, constructor);
@@ -6043,7 +6085,7 @@ class BaseClient {
6043
6085
  * @return Return an object that contains the statistics collected internally by GLIDE core
6044
6086
  */
6045
6087
  getStatistics() {
6046
- return (0, native_1.getStatistics)();
6088
+ return (0, _1.getStatistics)();
6047
6089
  }
6048
6090
  }
6049
6091
  exports.BaseClient = BaseClient;