@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.
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
3
3
  */
4
- import { GlideString, HashDataType, ObjectType } from "./BaseClient";
5
- import { SingleNodeRoute } from "./GlideClusterClient";
4
+ import { GlideString, HashDataType, ObjectType, SingleNodeRoute } from ".";
6
5
  /**
7
6
  * @test
8
7
  */
@@ -34,6 +33,19 @@ export type SetOptions = ({
34
33
  */
35
34
  returnOldValue?: boolean;
36
35
  /**
36
+ * @example
37
+ * ```javascript
38
+ *
39
+ * import {TimeUnit} from "@valkey/valkey-glide";
40
+ *
41
+ * await client.set(key, JSON.stringify(key), {
42
+ * expiry: {
43
+ * type: TimeUnit.Seconds,
44
+ * count: 60,
45
+ * },
46
+ * });
47
+ * ```
48
+ *
37
49
  * If not set, no expiry time will be set for the value.
38
50
  *
39
51
  * `keepExisting` - Retain the time to live associated with the key.
@@ -216,16 +216,15 @@ exports.createXGroupSetid = createXGroupSetid;
216
216
  exports.createScriptExists = createScriptExists;
217
217
  exports.createScriptFlush = createScriptFlush;
218
218
  exports.createScriptKill = createScriptKill;
219
- const native_1 = require("./native");
220
219
  const long_1 = __importDefault(require("long"));
221
- const BaseClient_1 = require("./BaseClient");
220
+ const _1 = require(".");
222
221
  const ProtobufMessage_1 = require("../build-ts/ProtobufMessage");
223
222
  var RequestType = ProtobufMessage_1.command_request.RequestType;
224
223
  function isLargeCommand(args) {
225
224
  let lenSum = 0;
226
225
  for (const arg of args) {
227
226
  lenSum += arg.length;
228
- if (lenSum >= native_1.MAX_REQUEST_ARGS_LEN) {
227
+ if (lenSum >= _1.MAX_REQUEST_ARGS_LEN) {
229
228
  return true;
230
229
  }
231
230
  }
@@ -268,7 +267,7 @@ function createCommand(requestType, args) {
268
267
  const argsBytes = toBuffersArray(args);
269
268
  if (isLargeCommand(args)) {
270
269
  // pass as a pointer
271
- const pointerArr = (0, native_1.createLeakedStringVec)(argsBytes);
270
+ const pointerArr = (0, _1.createLeakedStringVec)(argsBytes);
272
271
  const pointer = new long_1.default(pointerArr[0], pointerArr[1]);
273
272
  singleCommand.argsVecPointer = pointer;
274
273
  }
@@ -599,6 +598,8 @@ function createSetBit(key, offset, value) {
599
598
  * Represents a signed argument encoding.
600
599
  */
601
600
  class SignedEncoding {
601
+ static SIGNED_ENCODING_PREFIX = "i";
602
+ encoding;
602
603
  /**
603
604
  * Creates an instance of SignedEncoding.
604
605
  *
@@ -612,11 +613,12 @@ class SignedEncoding {
612
613
  }
613
614
  }
614
615
  exports.SignedEncoding = SignedEncoding;
615
- SignedEncoding.SIGNED_ENCODING_PREFIX = "i";
616
616
  /**
617
617
  * Represents an unsigned argument encoding.
618
618
  */
619
619
  class UnsignedEncoding {
620
+ static UNSIGNED_ENCODING_PREFIX = "u";
621
+ encoding;
620
622
  /**
621
623
  * Creates an instance of UnsignedEncoding.
622
624
  *
@@ -630,7 +632,6 @@ class UnsignedEncoding {
630
632
  }
631
633
  }
632
634
  exports.UnsignedEncoding = UnsignedEncoding;
633
- UnsignedEncoding.UNSIGNED_ENCODING_PREFIX = "u";
634
635
  /**
635
636
  * Represents an offset in an array of bits for the {@link BaseClient.bitfield|bitfield} or
636
637
  * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
@@ -639,6 +640,7 @@ UnsignedEncoding.UNSIGNED_ENCODING_PREFIX = "u";
639
640
  * is 13 from `0(1101)001`.
640
641
  */
641
642
  class BitOffset {
643
+ offset;
642
644
  /**
643
645
  * Creates an instance of BitOffset.
644
646
  *
@@ -661,6 +663,8 @@ exports.BitOffset = BitOffset;
661
663
  * value is 9 from `0110(1001)`.
662
664
  */
663
665
  class BitOffsetMultiplier {
666
+ static OFFSET_MULTIPLIER_PREFIX = "#";
667
+ offset;
664
668
  /**
665
669
  * Creates an instance of BitOffsetMultiplier.
666
670
  *
@@ -675,11 +679,13 @@ class BitOffsetMultiplier {
675
679
  }
676
680
  }
677
681
  exports.BitOffsetMultiplier = BitOffsetMultiplier;
678
- BitOffsetMultiplier.OFFSET_MULTIPLIER_PREFIX = "#";
679
682
  /**
680
683
  * Represents the "GET" subcommand for getting a value in the binary representation of the string stored in `key`.
681
684
  */
682
685
  class BitFieldGet {
686
+ static GET_COMMAND_STRING = "GET";
687
+ encoding;
688
+ offset;
683
689
  /**
684
690
  * Creates an instance of BitFieldGet.
685
691
  *
@@ -699,11 +705,14 @@ class BitFieldGet {
699
705
  }
700
706
  }
701
707
  exports.BitFieldGet = BitFieldGet;
702
- BitFieldGet.GET_COMMAND_STRING = "GET";
703
708
  /**
704
709
  * Represents the "SET" subcommand for setting bits in the binary representation of the string stored in `key`.
705
710
  */
706
711
  class BitFieldSet {
712
+ static SET_COMMAND_STRING = "SET";
713
+ encoding;
714
+ offset;
715
+ value;
707
716
  /**
708
717
  * Creates an instance of BitFieldSet
709
718
  *
@@ -726,12 +735,15 @@ class BitFieldSet {
726
735
  }
727
736
  }
728
737
  exports.BitFieldSet = BitFieldSet;
729
- BitFieldSet.SET_COMMAND_STRING = "SET";
730
738
  /**
731
739
  * Represents the "INCRBY" subcommand for increasing or decreasing bits in the binary representation of the string
732
740
  * stored in `key`.
733
741
  */
734
742
  class BitFieldIncrBy {
743
+ static INCRBY_COMMAND_STRING = "INCRBY";
744
+ encoding;
745
+ offset;
746
+ increment;
735
747
  /**
736
748
  * Creates an instance of BitFieldIncrBy
737
749
  *
@@ -754,7 +766,6 @@ class BitFieldIncrBy {
754
766
  }
755
767
  }
756
768
  exports.BitFieldIncrBy = BitFieldIncrBy;
757
- BitFieldIncrBy.INCRBY_COMMAND_STRING = "INCRBY";
758
769
  /**
759
770
  * Enumeration specifying bit overflow controls for the {@link BaseClient.bitfield|bitfield} command.
760
771
  */
@@ -780,6 +791,8 @@ var BitOverflowControl;
780
791
  * {@link BaseClient.bitfield|bitfield} subcommands when an underflow or overflow occurs.
781
792
  */
782
793
  class BitFieldOverflow {
794
+ static OVERFLOW_COMMAND_STRING = "OVERFLOW";
795
+ overflowControl;
783
796
  /**
784
797
  * Creates an instance of BitFieldOverflow.
785
798
  *
@@ -793,7 +806,6 @@ class BitFieldOverflow {
793
806
  }
794
807
  }
795
808
  exports.BitFieldOverflow = BitFieldOverflow;
796
- BitFieldOverflow.OVERFLOW_COMMAND_STRING = "OVERFLOW";
797
809
  /**
798
810
  * @internal
799
811
  */
@@ -1904,7 +1916,7 @@ var FlushMode;
1904
1916
  */
1905
1917
  function convertKeysAndEntries(record) {
1906
1918
  if (!Array.isArray(record)) {
1907
- return (0, BaseClient_1.convertRecordToGlideRecord)(record);
1919
+ return (0, _1.convertRecordToGlideRecord)(record);
1908
1920
  }
1909
1921
  return record;
1910
1922
  }
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfigurationError = exports.ConnectionError = exports.ExecAbortError = exports.TIMEOUT_ERROR = exports.TimeoutError = exports.RequestError = exports.ClosingError = exports.ValkeyError = void 0;
7
7
  /// Base class for errors.
8
8
  class ValkeyError extends Error {
9
+ message;
9
10
  constructor(message) {
10
11
  super();
11
12
  this.message = message ?? "No error message provided";
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
3
3
  */
4
- import { AdvancedBaseClientConfiguration, BaseClient, BaseClientConfiguration, DecoderOption, GlideReturnType, GlideString, PubSubMsg } from "./BaseClient";
5
- import { Batch } from "./Batch";
6
- import { BatchOptions, FlushMode, FunctionListOptions, FunctionListResponse, FunctionRestorePolicy, FunctionStatsFullResponse, InfoOptions, LolwutOptions, ScanOptions } from "./Commands";
4
+ import { AdvancedBaseClientConfiguration, BaseClient, BaseClientConfiguration, Batch, BatchOptions, DecoderOption, FlushMode, FunctionListOptions, FunctionListResponse, FunctionRestorePolicy, FunctionStatsFullResponse, GlideReturnType, GlideString, InfoOptions, LolwutOptions, PubSubMsg, ScanOptions } from ".";
7
5
  export declare namespace GlideClientConfiguration {
8
6
  /**
9
7
  * Enum representing pubsub subscription modes.
@@ -44,22 +42,12 @@ export declare namespace GlideClientConfiguration {
44
42
  * This configuration allows you to tailor the client's behavior when connecting to a standalone Valkey Glide server.
45
43
  *
46
44
  * - **Database Selection**: Use `databaseId` to specify which logical database to connect to.
47
- * - **Reconnection Strategy**: Customize how the client should attempt reconnections using `connectionBackoff`.
48
- * - `numberOfRetries`: The maximum number of retry attempts with increasing delays.
49
- * - After this limit is reached, the retry interval becomes constant.
50
- * - `factor`: A multiplier applied to the base delay between retries (e.g., `500` means a 500ms base delay).
51
- * - `exponentBase`: The exponential growth factor for delays (e.g., `2` means the delay doubles with each retry).
52
45
  * - **Pub/Sub Subscriptions**: Predefine Pub/Sub channels and patterns to subscribe to upon connection establishment.
53
46
  *
54
47
  * @example
55
48
  * ```typescript
56
49
  * const config: GlideClientConfiguration = {
57
50
  * databaseId: 1,
58
- * connectionBackoff: {
59
- * numberOfRetries: 10, // Maximum retries before delay becomes constant
60
- * factor: 500, // Base delay in milliseconds
61
- * exponentBase: 2, // Delay doubles with each retry (2^N)
62
- * },
63
51
  * pubsubSubscriptions: {
64
52
  * channelsAndPatterns: {
65
53
  * [GlideClientConfiguration.PubSubChannelModes.Pattern]: new Set(['news.*']),
@@ -76,31 +64,6 @@ export type GlideClientConfiguration = BaseClientConfiguration & {
76
64
  * index of the logical database to connect to.
77
65
  */
78
66
  databaseId?: number;
79
- /**
80
- * Strategy used to determine how and when to reconnect, in case of connection failures.
81
- * The time between attempts grows exponentially, to the formula rand(0 .. factor * (exponentBase ^ N)), where N is the number of failed attempts.
82
- * The client will attempt to reconnect indefinitely. Once the maximum value is reached, that will remain the time between retry attempts until a
83
- * reconnect attempt is succesful.
84
- * If not set, a default backoff strategy will be used.
85
- */
86
- connectionBackoff?: {
87
- /**
88
- * Number of retry attempts that the client should perform when disconnected from the server, where the time between retries increases.
89
- * Once the retries have reached the maximum value, the time between retries will remain constant until a reconnect attempt is succesful.
90
- * Value must be an integer.
91
- */
92
- numberOfRetries: number;
93
- /**
94
- * The multiplier that will be applied to the waiting time between each retry.
95
- * Value must be an integer.
96
- */
97
- factor: number;
98
- /**
99
- * The exponent base configured for the strategy.
100
- * Value must be an integer.
101
- */
102
- exponentBase: number;
103
- };
104
67
  /**
105
68
  * PubSub subscriptions to be used for the client.
106
69
  * Will be applied via SUBSCRIBE/PSUBSCRIBE commands during connection establishment.
@@ -119,6 +82,9 @@ export type GlideClientConfiguration = BaseClientConfiguration & {
119
82
  * ```typescript
120
83
  * const config: AdvancedGlideClientConfiguration = {
121
84
  * connectionTimeout: 500, // Set the connection timeout to 500ms
85
+ * tlsAdvancedConfiguration: {
86
+ * insecure: true, // Skip TLS certificate verification (use only in development)
87
+ * },
122
88
  * };
123
89
  * ```
124
90
  */
@@ -160,6 +126,7 @@ export declare class GlideClient extends BaseClient {
160
126
  * numberOfRetries: 5,
161
127
  * factor: 1000,
162
128
  * exponentBase: 2,
129
+ * jitter: 20,
163
130
  * },
164
131
  * pubsubSubscriptions: {
165
132
  * channelsAndPatterns: {
@@ -175,6 +142,8 @@ export declare class GlideClient extends BaseClient {
175
142
  * @remarks
176
143
  * - **Authentication**: If `credentials` are provided, the client will attempt to authenticate using the specified username and password.
177
144
  * - **TLS**: If `useTLS` is set to `true`, the client will establish a secure connection using TLS.
145
+ * Should match the TLS configuration of the server/cluster, otherwise the connection attempt will fail.
146
+ * For advanced tls configuration, please use the {@link AdvancedGlideClientConfiguration} option.
178
147
  * - **Reconnection Strategy**: The `connectionBackoff` settings define how the client will attempt to reconnect in case of disconnections.
179
148
  * - **Pub/Sub Subscriptions**: Any channels or patterns specified in `pubsubSubscriptions` will be subscribed to upon connection.
180
149
  */
@@ -4,8 +4,7 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.GlideClient = exports.GlideClientConfiguration = void 0;
7
- const BaseClient_1 = require("./BaseClient");
8
- const Commands_1 = require("./Commands");
7
+ const _1 = require(".");
9
8
  /* eslint-disable-next-line @typescript-eslint/no-namespace */
10
9
  var GlideClientConfiguration;
11
10
  (function (GlideClientConfiguration) {
@@ -31,14 +30,13 @@ var GlideClientConfiguration;
31
30
  *
32
31
  * @see For full documentation refer to {@link https://github.com/valkey-io/valkey-glide/wiki/NodeJS-wrapper#standalone | Valkey Glide Wiki}.
33
32
  */
34
- class GlideClient extends BaseClient_1.BaseClient {
33
+ class GlideClient extends _1.BaseClient {
35
34
  /**
36
35
  * @internal
37
36
  */
38
37
  createClientRequest(options) {
39
38
  const configuration = super.createClientRequest(options);
40
39
  configuration.databaseId = options.databaseId;
41
- configuration.connectionRetryStrategy = options.connectionBackoff;
42
40
  this.configurePubsub(options, configuration);
43
41
  if (options.advancedConfiguration) {
44
42
  this.configureAdvancedConfigurationBase(options.advancedConfiguration, configuration);
@@ -75,6 +73,7 @@ class GlideClient extends BaseClient_1.BaseClient {
75
73
  * numberOfRetries: 5,
76
74
  * factor: 1000,
77
75
  * exponentBase: 2,
76
+ * jitter: 20,
78
77
  * },
79
78
  * pubsubSubscriptions: {
80
79
  * channelsAndPatterns: {
@@ -90,6 +89,8 @@ class GlideClient extends BaseClient_1.BaseClient {
90
89
  * @remarks
91
90
  * - **Authentication**: If `credentials` are provided, the client will attempt to authenticate using the specified username and password.
92
91
  * - **TLS**: If `useTLS` is set to `true`, the client will establish a secure connection using TLS.
92
+ * Should match the TLS configuration of the server/cluster, otherwise the connection attempt will fail.
93
+ * For advanced tls configuration, please use the {@link AdvancedGlideClientConfiguration} option.
93
94
  * - **Reconnection Strategy**: The `connectionBackoff` settings define how the client will attempt to reconnect in case of disconnections.
94
95
  * - **Pub/Sub Subscriptions**: Any channels or patterns specified in `pubsubSubscriptions` will be subscribed to upon connection.
95
96
  */
@@ -171,7 +172,7 @@ class GlideClient extends BaseClient_1.BaseClient {
171
172
  * ```
172
173
  */
173
174
  async customCommand(args, options) {
174
- return this.createWritePromise((0, Commands_1.createCustomCommand)(args), options);
175
+ return this.createWritePromise((0, _1.createCustomCommand)(args), options);
175
176
  }
176
177
  /**
177
178
  * Pings the server.
@@ -200,7 +201,7 @@ class GlideClient extends BaseClient_1.BaseClient {
200
201
  * ```
201
202
  */
202
203
  async ping(options) {
203
- return this.createWritePromise((0, Commands_1.createPing)(options?.message), options);
204
+ return this.createWritePromise((0, _1.createPing)(options?.message), options);
204
205
  }
205
206
  /**
206
207
  * Gets information and statistics about the server.
@@ -221,8 +222,8 @@ class GlideClient extends BaseClient_1.BaseClient {
221
222
  * ```
222
223
  */
223
224
  async info(sections) {
224
- return this.createWritePromise((0, Commands_1.createInfo)(sections), {
225
- decoder: BaseClient_1.Decoder.String,
225
+ return this.createWritePromise((0, _1.createInfo)(sections), {
226
+ decoder: _1.Decoder.String,
226
227
  });
227
228
  }
228
229
  /**
@@ -241,8 +242,8 @@ class GlideClient extends BaseClient_1.BaseClient {
241
242
  * ```
242
243
  */
243
244
  async select(index) {
244
- return this.createWritePromise((0, Commands_1.createSelect)(index), {
245
- decoder: BaseClient_1.Decoder.String,
245
+ return this.createWritePromise((0, _1.createSelect)(index), {
246
+ decoder: _1.Decoder.String,
246
247
  });
247
248
  }
248
249
  /**
@@ -261,7 +262,7 @@ class GlideClient extends BaseClient_1.BaseClient {
261
262
  * ```
262
263
  */
263
264
  async clientGetName(options) {
264
- return this.createWritePromise((0, Commands_1.createClientGetName)(), options);
265
+ return this.createWritePromise((0, _1.createClientGetName)(), options);
265
266
  }
266
267
  /**
267
268
  * Rewrites the configuration file with the current configuration.
@@ -278,8 +279,8 @@ class GlideClient extends BaseClient_1.BaseClient {
278
279
  * ```
279
280
  */
280
281
  async configRewrite() {
281
- return this.createWritePromise((0, Commands_1.createConfigRewrite)(), {
282
- decoder: BaseClient_1.Decoder.String,
282
+ return this.createWritePromise((0, _1.createConfigRewrite)(), {
283
+ decoder: _1.Decoder.String,
283
284
  });
284
285
  }
285
286
  /**
@@ -297,8 +298,8 @@ class GlideClient extends BaseClient_1.BaseClient {
297
298
  * ```
298
299
  */
299
300
  async configResetStat() {
300
- return this.createWritePromise((0, Commands_1.createConfigResetStat)(), {
301
- decoder: BaseClient_1.Decoder.String,
301
+ return this.createWritePromise((0, _1.createConfigResetStat)(), {
302
+ decoder: _1.Decoder.String,
302
303
  });
303
304
  }
304
305
  /**
@@ -315,7 +316,7 @@ class GlideClient extends BaseClient_1.BaseClient {
315
316
  * ```
316
317
  */
317
318
  async clientId() {
318
- return this.createWritePromise((0, Commands_1.createClientId)());
319
+ return this.createWritePromise((0, _1.createClientId)());
319
320
  }
320
321
  /**
321
322
  * Reads the configuration parameters of the running server.
@@ -336,7 +337,7 @@ class GlideClient extends BaseClient_1.BaseClient {
336
337
  * ```
337
338
  */
338
339
  async configGet(parameters, options) {
339
- return this.createWritePromise((0, Commands_1.createConfigGet)(parameters), options).then(BaseClient_1.convertGlideRecordToRecord);
340
+ return this.createWritePromise((0, _1.createConfigGet)(parameters), options).then(_1.convertGlideRecordToRecord);
340
341
  }
341
342
  /**
342
343
  * Sets configuration parameters to the specified values.
@@ -354,8 +355,8 @@ class GlideClient extends BaseClient_1.BaseClient {
354
355
  * ```
355
356
  */
356
357
  async configSet(parameters) {
357
- return this.createWritePromise((0, Commands_1.createConfigSet)(parameters), {
358
- decoder: BaseClient_1.Decoder.String,
358
+ return this.createWritePromise((0, _1.createConfigSet)(parameters), {
359
+ decoder: _1.Decoder.String,
359
360
  });
360
361
  }
361
362
  /**
@@ -375,7 +376,7 @@ class GlideClient extends BaseClient_1.BaseClient {
375
376
  * ```
376
377
  */
377
378
  async echo(message, options) {
378
- return this.createWritePromise((0, Commands_1.createEcho)(message), options);
379
+ return this.createWritePromise((0, _1.createEcho)(message), options);
379
380
  }
380
381
  /**
381
382
  * Returns the server time.
@@ -392,8 +393,8 @@ class GlideClient extends BaseClient_1.BaseClient {
392
393
  * ```
393
394
  */
394
395
  async time() {
395
- return this.createWritePromise((0, Commands_1.createTime)(), {
396
- decoder: BaseClient_1.Decoder.String,
396
+ return this.createWritePromise((0, _1.createTime)(), {
397
+ decoder: _1.Decoder.String,
397
398
  });
398
399
  }
399
400
  /**
@@ -429,7 +430,7 @@ class GlideClient extends BaseClient_1.BaseClient {
429
430
  * ```
430
431
  */
431
432
  async copy(source, destination, options) {
432
- return this.createWritePromise((0, Commands_1.createCopy)(source, destination, options));
433
+ return this.createWritePromise((0, _1.createCopy)(source, destination, options));
433
434
  }
434
435
  /**
435
436
  * Move `key` from the currently selected database to the database specified by `dbIndex`.
@@ -448,7 +449,7 @@ class GlideClient extends BaseClient_1.BaseClient {
448
449
  * ```
449
450
  */
450
451
  async move(key, dbIndex) {
451
- return this.createWritePromise((0, Commands_1.createMove)(key, dbIndex));
452
+ return this.createWritePromise((0, _1.createMove)(key, dbIndex));
452
453
  }
453
454
  /**
454
455
  * Displays a piece of generative computer art and the server version.
@@ -465,8 +466,8 @@ class GlideClient extends BaseClient_1.BaseClient {
465
466
  * ```
466
467
  */
467
468
  async lolwut(options) {
468
- return this.createWritePromise((0, Commands_1.createLolwut)(options), {
469
- decoder: BaseClient_1.Decoder.String,
469
+ return this.createWritePromise((0, _1.createLolwut)(options), {
470
+ decoder: _1.Decoder.String,
470
471
  });
471
472
  }
472
473
  /**
@@ -485,8 +486,8 @@ class GlideClient extends BaseClient_1.BaseClient {
485
486
  * ```
486
487
  */
487
488
  async functionDelete(libraryCode) {
488
- return this.createWritePromise((0, Commands_1.createFunctionDelete)(libraryCode), {
489
- decoder: BaseClient_1.Decoder.String,
489
+ return this.createWritePromise((0, _1.createFunctionDelete)(libraryCode), {
490
+ decoder: _1.Decoder.String,
490
491
  });
491
492
  }
492
493
  /**
@@ -510,7 +511,7 @@ class GlideClient extends BaseClient_1.BaseClient {
510
511
  * ```
511
512
  */
512
513
  async functionLoad(libraryCode, options) {
513
- return this.createWritePromise((0, Commands_1.createFunctionLoad)(libraryCode, options?.replace), options);
514
+ return this.createWritePromise((0, _1.createFunctionLoad)(libraryCode, options?.replace), options);
514
515
  }
515
516
  /**
516
517
  * Deletes all function libraries.
@@ -528,8 +529,8 @@ class GlideClient extends BaseClient_1.BaseClient {
528
529
  * ```
529
530
  */
530
531
  async functionFlush(mode) {
531
- return this.createWritePromise((0, Commands_1.createFunctionFlush)(mode), {
532
- decoder: BaseClient_1.Decoder.String,
532
+ return this.createWritePromise((0, _1.createFunctionFlush)(mode), {
533
+ decoder: _1.Decoder.String,
533
534
  });
534
535
  }
535
536
  /**
@@ -561,7 +562,7 @@ class GlideClient extends BaseClient_1.BaseClient {
561
562
  * ```
562
563
  */
563
564
  async functionList(options) {
564
- return this.createWritePromise((0, Commands_1.createFunctionList)(options), options).then((res) => res.map(BaseClient_1.convertGlideRecordToRecord));
565
+ return this.createWritePromise((0, _1.createFunctionList)(options), options).then((res) => res.map(_1.convertGlideRecordToRecord));
565
566
  }
566
567
  /**
567
568
  * Returns information about the function that's currently running and information about the
@@ -609,7 +610,7 @@ class GlideClient extends BaseClient_1.BaseClient {
609
610
  * ```
610
611
  */
611
612
  async functionStats(options) {
612
- return this.createWritePromise((0, Commands_1.createFunctionStats)(), options).then((res) => (0, BaseClient_1.convertGlideRecordToRecord)(res));
613
+ return this.createWritePromise((0, _1.createFunctionStats)(), options).then((res) => (0, _1.convertGlideRecordToRecord)(res));
613
614
  }
614
615
  /**
615
616
  * Kills a function that is currently executing.
@@ -626,8 +627,8 @@ class GlideClient extends BaseClient_1.BaseClient {
626
627
  * ```
627
628
  */
628
629
  async functionKill() {
629
- return this.createWritePromise((0, Commands_1.createFunctionKill)(), {
630
- decoder: BaseClient_1.Decoder.String,
630
+ return this.createWritePromise((0, _1.createFunctionKill)(), {
631
+ decoder: _1.Decoder.String,
631
632
  });
632
633
  }
633
634
  /**
@@ -645,8 +646,8 @@ class GlideClient extends BaseClient_1.BaseClient {
645
646
  * ```
646
647
  */
647
648
  async functionDump() {
648
- return this.createWritePromise((0, Commands_1.createFunctionDump)(), {
649
- decoder: BaseClient_1.Decoder.Bytes,
649
+ return this.createWritePromise((0, _1.createFunctionDump)(), {
650
+ decoder: _1.Decoder.Bytes,
650
651
  });
651
652
  }
652
653
  /**
@@ -666,8 +667,8 @@ class GlideClient extends BaseClient_1.BaseClient {
666
667
  * ```
667
668
  */
668
669
  async functionRestore(payload, policy) {
669
- return this.createWritePromise((0, Commands_1.createFunctionRestore)(payload, policy), {
670
- decoder: BaseClient_1.Decoder.String,
670
+ return this.createWritePromise((0, _1.createFunctionRestore)(payload, policy), {
671
+ decoder: _1.Decoder.String,
671
672
  });
672
673
  }
673
674
  /**
@@ -685,8 +686,8 @@ class GlideClient extends BaseClient_1.BaseClient {
685
686
  * ```
686
687
  */
687
688
  async flushall(mode) {
688
- return this.createWritePromise((0, Commands_1.createFlushAll)(mode), {
689
- decoder: BaseClient_1.Decoder.String,
689
+ return this.createWritePromise((0, _1.createFlushAll)(mode), {
690
+ decoder: _1.Decoder.String,
690
691
  });
691
692
  }
692
693
  /**
@@ -704,8 +705,8 @@ class GlideClient extends BaseClient_1.BaseClient {
704
705
  * ```
705
706
  */
706
707
  async flushdb(mode) {
707
- return this.createWritePromise((0, Commands_1.createFlushDB)(mode), {
708
- decoder: BaseClient_1.Decoder.String,
708
+ return this.createWritePromise((0, _1.createFlushDB)(mode), {
709
+ decoder: _1.Decoder.String,
709
710
  });
710
711
  }
711
712
  /**
@@ -722,7 +723,7 @@ class GlideClient extends BaseClient_1.BaseClient {
722
723
  * ```
723
724
  */
724
725
  async dbsize() {
725
- return this.createWritePromise((0, Commands_1.createDBSize)());
726
+ return this.createWritePromise((0, _1.createDBSize)());
726
727
  }
727
728
  /** Publish a message on pubsub channel.
728
729
  *
@@ -741,7 +742,7 @@ class GlideClient extends BaseClient_1.BaseClient {
741
742
  * ```
742
743
  */
743
744
  async publish(message, channel) {
744
- return this.createWritePromise((0, Commands_1.createPublish)(message, channel));
745
+ return this.createWritePromise((0, _1.createPublish)(message, channel));
745
746
  }
746
747
  /**
747
748
  * Returns `UNIX TIME` of the last DB save timestamp or startup timestamp if no save
@@ -758,7 +759,7 @@ class GlideClient extends BaseClient_1.BaseClient {
758
759
  * ```
759
760
  */
760
761
  async lastsave() {
761
- return this.createWritePromise((0, Commands_1.createLastSave)());
762
+ return this.createWritePromise((0, _1.createLastSave)());
762
763
  }
763
764
  /**
764
765
  * Returns a random existing key name from the currently selected database.
@@ -774,7 +775,7 @@ class GlideClient extends BaseClient_1.BaseClient {
774
775
  * ```
775
776
  */
776
777
  async randomKey(options) {
777
- return this.createWritePromise((0, Commands_1.createRandomKey)(), options);
778
+ return this.createWritePromise((0, _1.createRandomKey)(), options);
778
779
  }
779
780
  /**
780
781
  * Flushes all the previously watched keys for a transaction. Executing a transaction will
@@ -793,8 +794,8 @@ class GlideClient extends BaseClient_1.BaseClient {
793
794
  * ```
794
795
  */
795
796
  async unwatch() {
796
- return this.createWritePromise((0, Commands_1.createUnWatch)(), {
797
- decoder: BaseClient_1.Decoder.String,
797
+ return this.createWritePromise((0, _1.createUnWatch)(), {
798
+ decoder: _1.Decoder.String,
798
799
  });
799
800
  }
800
801
  /**
@@ -812,7 +813,7 @@ class GlideClient extends BaseClient_1.BaseClient {
812
813
  * ```
813
814
  */
814
815
  async scriptExists(sha1s) {
815
- return this.createWritePromise((0, Commands_1.createScriptExists)(sha1s));
816
+ return this.createWritePromise((0, _1.createScriptExists)(sha1s));
816
817
  }
817
818
  /**
818
819
  * Flushes the Lua scripts cache.
@@ -829,8 +830,8 @@ class GlideClient extends BaseClient_1.BaseClient {
829
830
  * ```
830
831
  */
831
832
  async scriptFlush(mode) {
832
- return this.createWritePromise((0, Commands_1.createScriptFlush)(mode), {
833
- decoder: BaseClient_1.Decoder.String,
833
+ return this.createWritePromise((0, _1.createScriptFlush)(mode), {
834
+ decoder: _1.Decoder.String,
834
835
  });
835
836
  }
836
837
  /**
@@ -847,8 +848,8 @@ class GlideClient extends BaseClient_1.BaseClient {
847
848
  * ```
848
849
  */
849
850
  async scriptKill() {
850
- return this.createWritePromise((0, Commands_1.createScriptKill)(), {
851
- decoder: BaseClient_1.Decoder.String,
851
+ return this.createWritePromise((0, _1.createScriptKill)(), {
852
+ decoder: _1.Decoder.String,
852
853
  });
853
854
  }
854
855
  /**
@@ -893,7 +894,7 @@ class GlideClient extends BaseClient_1.BaseClient {
893
894
  * ```
894
895
  */
895
896
  async scan(cursor, options) {
896
- return this.createWritePromise((0, Commands_1.createScan)(cursor, options), options);
897
+ return this.createWritePromise((0, _1.createScan)(cursor, options), options);
897
898
  }
898
899
  }
899
900
  exports.GlideClient = GlideClient;