@valkey/valkey-glide 1.3.4 → 1.3.5-rc10

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.
Files changed (30) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +53 -18
  3. package/build-ts/{src/BaseClient.d.ts → BaseClient.d.ts} +62 -118
  4. package/build-ts/BaseClient.js +6049 -0
  5. package/build-ts/{src/Transaction.d.ts → Batch.d.ts} +124 -67
  6. package/build-ts/Batch.js +3457 -0
  7. package/build-ts/{src/Commands.d.ts → Commands.d.ts} +171 -791
  8. package/build-ts/Commands.js +2708 -0
  9. package/build-ts/Errors.js +42 -0
  10. package/build-ts/{src/GlideClient.d.ts → GlideClient.d.ts} +55 -19
  11. package/build-ts/GlideClient.js +899 -0
  12. package/build-ts/{src/GlideClusterClient.d.ts → GlideClusterClient.d.ts} +78 -42
  13. package/build-ts/GlideClusterClient.js +1251 -0
  14. package/build-ts/Logger.d.ts +47 -0
  15. package/build-ts/Logger.js +78 -0
  16. package/build-ts/{src/ProtobufMessage.d.ts → ProtobufMessage.d.ts} +135 -634
  17. package/build-ts/ProtobufMessage.js +5159 -0
  18. package/build-ts/index.d.ts +16 -11
  19. package/build-ts/index.js +53 -216
  20. package/build-ts/native.d.ts +92 -0
  21. package/build-ts/native.js +365 -0
  22. package/build-ts/server-modules/GlideFt.js +628 -0
  23. package/build-ts/{src/server-modules → server-modules}/GlideFtOptions.d.ts +1 -1
  24. package/build-ts/server-modules/GlideFtOptions.js +5 -0
  25. package/build-ts/{src/server-modules → server-modules}/GlideJson.d.ts +65 -65
  26. package/build-ts/server-modules/GlideJson.js +1572 -0
  27. package/package.json +140 -64
  28. package/build-ts/src/Logger.d.ts +0 -32
  29. /package/build-ts/{src/Errors.d.ts → Errors.d.ts} +0 -0
  30. /package/build-ts/{src/server-modules → server-modules}/GlideFt.d.ts +0 -0
@@ -1,24 +1,12 @@
1
1
  /**
2
2
  * Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
3
3
  */
4
- import { GlideRecord, GlideString, HashDataType, Score, ObjectType, SortedSetDataType, ElementAndScore } from "./BaseClient";
5
- import { command_request } from "./ProtobufMessage";
4
+ import { GlideString, HashDataType, ObjectType } from "./BaseClient";
5
+ import { SingleNodeRoute } from "./GlideClusterClient";
6
6
  /**
7
- * @internal
7
+ * @test
8
8
  */
9
9
  export declare function parseInfoResponse(response: string): Record<string, string>;
10
- /**
11
- * @internal
12
- */
13
- export declare function createGet(key: GlideString): command_request.Command;
14
- /**
15
- * @internal
16
- */
17
- export declare function createGetDel(key: GlideString): command_request.Command;
18
- /**
19
- * @internal
20
- */
21
- export declare function createGetRange(key: GlideString, start: number, end: number): command_request.Command;
22
10
  export type SetOptions = ({
23
11
  /**
24
12
  * `onlyIfDoesNotExist` - Only set the key if it does not already exist.
@@ -56,10 +44,6 @@ export type SetOptions = ({
56
44
  count: number;
57
45
  };
58
46
  };
59
- /**
60
- * @internal
61
- */
62
- export declare function createSet(key: GlideString, value: GlideString, options?: SetOptions): command_request.Command;
63
47
  /**
64
48
  * INFO option: a specific section of information:
65
49
  * When no parameter is provided, the default option is assumed.
@@ -134,74 +118,6 @@ export declare enum InfoOptions {
134
118
  */
135
119
  Everything = "everything"
136
120
  }
137
- /**
138
- * @internal
139
- */
140
- export declare function createPing(str?: GlideString): command_request.Command;
141
- /**
142
- * @internal
143
- */
144
- export declare function createInfo(options?: InfoOptions[]): command_request.Command;
145
- /**
146
- * @internal
147
- */
148
- export declare function createDel(keys: GlideString[]): command_request.Command;
149
- /**
150
- * @internal
151
- */
152
- export declare function createSelect(index: number): command_request.Command;
153
- /**
154
- * @internal
155
- */
156
- export declare function createClientGetName(): command_request.Command;
157
- /**
158
- * @internal
159
- */
160
- export declare function createConfigRewrite(): command_request.Command;
161
- /**
162
- * @internal
163
- */
164
- export declare function createConfigResetStat(): command_request.Command;
165
- /**
166
- * @internal
167
- */
168
- export declare function createMGet(keys: GlideString[]): command_request.Command;
169
- /**
170
- * @internal
171
- */
172
- export declare function createMSet(keysAndValues: GlideRecord<GlideString>): command_request.Command;
173
- /**
174
- * @internal
175
- */
176
- export declare function createMSetNX(keysAndValues: GlideRecord<GlideString>): command_request.Command;
177
- /**
178
- * @internal
179
- */
180
- export declare function createIncr(key: GlideString): command_request.Command;
181
- /**
182
- * @internal
183
- */
184
- export declare function createIncrBy(key: GlideString, amount: number): command_request.Command;
185
- /**
186
- * @internal
187
- */
188
- export declare function createIncrByFloat(key: GlideString, amount: number): command_request.Command;
189
- /**
190
- * @internal
191
- */
192
- export declare function createClientId(): command_request.Command;
193
- /**
194
- * @internal
195
- */
196
- export declare function createConfigGet(parameters: string[]): command_request.Command;
197
- /**
198
- * @internal
199
- */
200
- export declare function createConfigSet(parameters: Record<string, GlideString>): command_request.Command;
201
- /**
202
- * @internal
203
- */
204
- export declare function createHGet(key: GlideString, field: GlideString): command_request.Command;
205
121
  /**
206
122
  * This function converts an input from {@link HashDataType} or `Record` types to `HashDataType`.
207
123
  *
@@ -209,26 +125,6 @@ export declare function createHGet(key: GlideString, field: GlideString): comman
209
125
  * @returns HashDataType array containing field names and their values.
210
126
  */
211
127
  export declare function convertFieldsAndValuesToHashDataType(fieldsAndValues: HashDataType | Record<string, GlideString>): HashDataType;
212
- /**
213
- * @internal
214
- */
215
- export declare function createHSet(key: GlideString, fieldValueList: HashDataType): command_request.Command;
216
- /**
217
- * @internal
218
- */
219
- export declare function createHKeys(key: GlideString): command_request.Command;
220
- /**
221
- * @internal
222
- */
223
- export declare function createHSetNX(key: GlideString, field: GlideString, value: GlideString): command_request.Command;
224
- /**
225
- * @internal
226
- */
227
- export declare function createDecr(key: GlideString): command_request.Command;
228
- /**
229
- * @internal
230
- */
231
- export declare function createDecrBy(key: GlideString, amount: number): command_request.Command;
232
128
  /**
233
129
  * Enumeration defining the bitwise operation to use in the {@link BaseClient.bitop|bitop} command. Specifies the
234
130
  * bitwise operation to perform between the passed in keys.
@@ -239,18 +135,6 @@ export declare enum BitwiseOperation {
239
135
  XOR = "XOR",
240
136
  NOT = "NOT"
241
137
  }
242
- /**
243
- * @internal
244
- */
245
- export declare function createBitOp(operation: BitwiseOperation, destination: GlideString, keys: GlideString[]): command_request.Command;
246
- /**
247
- * @internal
248
- */
249
- export declare function createGetBit(key: GlideString, offset: number): command_request.Command;
250
- /**
251
- * @internal
252
- */
253
- export declare function createSetBit(key: GlideString, offset: number, value: number): command_request.Command;
254
138
  /**
255
139
  * Represents a signed or unsigned argument encoding for the {@link BaseClient.bitfield|bitfield} or
256
140
  * {@link BaseClient.bitfieldReadOnly|bitfieldReadOnly} commands.
@@ -442,46 +326,6 @@ export declare class BitFieldOverflow implements BitFieldSubCommands {
442
326
  constructor(overflowControl: BitOverflowControl);
443
327
  toArgs(): string[];
444
328
  }
445
- /**
446
- * @internal
447
- */
448
- export declare function createBitField(key: GlideString, subcommands: BitFieldSubCommands[], readOnly?: boolean): command_request.Command;
449
- /**
450
- * @internal
451
- */
452
- export declare function createHDel(key: GlideString, fields: GlideString[]): command_request.Command;
453
- /**
454
- * @internal
455
- */
456
- export declare function createHMGet(key: GlideString, fields: GlideString[]): command_request.Command;
457
- /**
458
- * @internal
459
- */
460
- export declare function createHExists(key: GlideString, field: GlideString): command_request.Command;
461
- /**
462
- * @internal
463
- */
464
- export declare function createHGetAll(key: GlideString): command_request.Command;
465
- /**
466
- * @internal
467
- */
468
- export declare function createLPush(key: GlideString, elements: GlideString[]): command_request.Command;
469
- /**
470
- * @internal
471
- */
472
- export declare function createLPushX(key: GlideString, elements: GlideString[]): command_request.Command;
473
- /**
474
- * @internal
475
- */
476
- export declare function createLPop(key: GlideString, count?: number): command_request.Command;
477
- /**
478
- * @internal
479
- */
480
- export declare function createLRange(key: GlideString, start: number, end: number): command_request.Command;
481
- /**
482
- * @internal
483
- */
484
- export declare function createLLen(key: GlideString): command_request.Command;
485
329
  /**
486
330
  * Enumeration representing element popping or adding direction for the List Based Commands.
487
331
  */
@@ -495,135 +339,6 @@ export declare enum ListDirection {
495
339
  */
496
340
  RIGHT = "RIGHT"
497
341
  }
498
- /**
499
- * @internal
500
- */
501
- export declare function createLMove(source: GlideString, destination: GlideString, whereFrom: ListDirection, whereTo: ListDirection): command_request.Command;
502
- /**
503
- * @internal
504
- */
505
- export declare function createBLMove(source: GlideString, destination: GlideString, whereFrom: ListDirection, whereTo: ListDirection, timeout: number): command_request.Command;
506
- /**
507
- * @internal
508
- */
509
- export declare function createLSet(key: GlideString, index: number, element: GlideString): command_request.Command;
510
- /**
511
- * @internal
512
- */
513
- export declare function createLTrim(key: GlideString, start: number, end: number): command_request.Command;
514
- /**
515
- * @internal
516
- */
517
- export declare function createLRem(key: GlideString, count: number, element: GlideString): command_request.Command;
518
- /**
519
- * @internal
520
- */
521
- export declare function createRPush(key: GlideString, elements: GlideString[]): command_request.Command;
522
- /**
523
- * @internal
524
- */
525
- export declare function createRPushX(key: GlideString, elements: GlideString[]): command_request.Command;
526
- /**
527
- * @internal
528
- */
529
- export declare function createRPop(key: GlideString, count?: number): command_request.Command;
530
- /**
531
- * @internal
532
- */
533
- export declare function createSAdd(key: GlideString, members: GlideString[]): command_request.Command;
534
- /**
535
- * @internal
536
- */
537
- export declare function createSRem(key: GlideString, members: GlideString[]): command_request.Command;
538
- /**
539
- * @internal
540
- */
541
- export declare function createSScan(key: GlideString, cursor: GlideString, options?: BaseScanOptions): command_request.Command;
542
- /**
543
- * @internal
544
- */
545
- export declare function createSMembers(key: GlideString): command_request.Command;
546
- /**
547
- *
548
- * @internal
549
- */
550
- export declare function createSMove(source: GlideString, destination: GlideString, member: GlideString): command_request.Command;
551
- /**
552
- * @internal
553
- */
554
- export declare function createSCard(key: GlideString): command_request.Command;
555
- /**
556
- * @internal
557
- */
558
- export declare function createSInter(keys: GlideString[]): command_request.Command;
559
- /**
560
- * @internal
561
- */
562
- export declare function createSInterCard(keys: GlideString[], limit?: number): command_request.Command;
563
- /**
564
- * @internal
565
- */
566
- export declare function createSInterStore(destination: GlideString, keys: GlideString[]): command_request.Command;
567
- /**
568
- * @internal
569
- */
570
- export declare function createSDiff(keys: GlideString[]): command_request.Command;
571
- /**
572
- * @internal
573
- */
574
- export declare function createSDiffStore(destination: GlideString, keys: GlideString[]): command_request.Command;
575
- /**
576
- * @internal
577
- */
578
- export declare function createSUnion(keys: GlideString[]): command_request.Command;
579
- /**
580
- * @internal
581
- */
582
- export declare function createSUnionStore(destination: GlideString, keys: GlideString[]): command_request.Command;
583
- /**
584
- * @internal
585
- */
586
- export declare function createSIsMember(key: GlideString, member: GlideString): command_request.Command;
587
- /**
588
- * @internal
589
- */
590
- export declare function createSMIsMember(key: GlideString, members: GlideString[]): command_request.Command;
591
- /**
592
- * @internal
593
- */
594
- export declare function createSPop(key: GlideString, count?: number): command_request.Command;
595
- /**
596
- * @internal
597
- */
598
- export declare function createSRandMember(key: GlideString, count?: number): command_request.Command;
599
- /**
600
- * @internal
601
- */
602
- export declare function createCustomCommand(args: GlideString[]): command_request.Command;
603
- /**
604
- * @internal
605
- */
606
- export declare function createHIncrBy(key: GlideString, field: GlideString, amount: number): command_request.Command;
607
- /**
608
- * @internal
609
- */
610
- export declare function createHIncrByFloat(key: GlideString, field: GlideString, amount: number): command_request.Command;
611
- /**
612
- * @internal
613
- */
614
- export declare function createHLen(key: GlideString): command_request.Command;
615
- /**
616
- * @internal
617
- */
618
- export declare function createHVals(key: GlideString): command_request.Command;
619
- /**
620
- * @internal
621
- */
622
- export declare function createExists(keys: GlideString[]): command_request.Command;
623
- /**
624
- * @internal
625
- */
626
- export declare function createUnlink(keys: GlideString[]): command_request.Command;
627
342
  export declare enum ExpireOptions {
628
343
  /**
629
344
  * `HasNoExpiry` - Sets expiry only when the key has no expiry.
@@ -644,34 +359,6 @@ export declare enum ExpireOptions {
644
359
  */
645
360
  NewExpiryLessThanCurrent = "LT"
646
361
  }
647
- /**
648
- * @internal
649
- */
650
- export declare function createExpire(key: GlideString, seconds: number, option?: ExpireOptions): command_request.Command;
651
- /**
652
- * @internal
653
- */
654
- export declare function createExpireAt(key: GlideString, unixSeconds: number, option?: ExpireOptions): command_request.Command;
655
- /**
656
- * @internal
657
- */
658
- export declare function createExpireTime(key: GlideString): command_request.Command;
659
- /**
660
- * @internal
661
- */
662
- export declare function createPExpire(key: GlideString, milliseconds: number, option?: ExpireOptions): command_request.Command;
663
- /**
664
- * @internal
665
- */
666
- export declare function createPExpireAt(key: GlideString, unixMilliseconds: number, option?: ExpireOptions): command_request.Command;
667
- /**
668
- * @internal
669
- */
670
- export declare function createPExpireTime(key: GlideString): command_request.Command;
671
- /**
672
- * @internal
673
- */
674
- export declare function createTTL(key: GlideString): command_request.Command;
675
362
  /**
676
363
  * Options for updating elements of a sorted set key.
677
364
  */
@@ -695,15 +382,6 @@ export interface ZAddOptions {
695
382
  */
696
383
  changed?: boolean;
697
384
  }
698
- /**
699
- * @internal
700
- * Convert input from `Record` to `SortedSetDataType` to ensure the only one type.
701
- */
702
- export declare function convertElementsAndScores(membersAndScores: SortedSetDataType | Record<string, number>): SortedSetDataType;
703
- /**
704
- * @internal
705
- */
706
- export declare function createZAdd(key: GlideString, membersAndScores: ElementAndScore[] | Record<string, Score>, options?: ZAddOptions, incr?: boolean): command_request.Command;
707
385
  /**
708
386
  * `KeyWeight` - pair of variables represents a weighted key for the `ZINTERSTORE` and `ZUNIONSTORE` sorted sets commands.
709
387
  */
@@ -712,58 +390,6 @@ export type KeyWeight = [GlideString, number];
712
390
  * `AggregationType` - representing aggregation types for `ZINTERSTORE` and `ZUNIONSTORE` sorted set commands.
713
391
  */
714
392
  export type AggregationType = "SUM" | "MIN" | "MAX";
715
- /**
716
- * @internal
717
- */
718
- export declare function createZInterstore(destination: GlideString, keys: GlideString[] | KeyWeight[], aggregationType?: AggregationType): command_request.Command;
719
- /**
720
- * @internal
721
- */
722
- export declare function createZInter(keys: GlideString[] | KeyWeight[], aggregationType?: AggregationType, withScores?: boolean): command_request.Command;
723
- /**
724
- * @internal
725
- */
726
- export declare function createZUnion(keys: GlideString[] | KeyWeight[], aggregationType?: AggregationType, withScores?: boolean): command_request.Command;
727
- /**
728
- * @internal
729
- */
730
- export declare function createZRem(key: GlideString, members: GlideString[]): command_request.Command;
731
- /**
732
- * @internal
733
- */
734
- export declare function createZCard(key: GlideString): command_request.Command;
735
- /**
736
- * @internal
737
- */
738
- export declare function createZInterCard(keys: GlideString[], limit?: number): command_request.Command;
739
- /**
740
- * @internal
741
- */
742
- export declare function createZDiff(keys: GlideString[]): command_request.Command;
743
- /**
744
- * @internal
745
- */
746
- export declare function createZDiffWithScores(keys: GlideString[]): command_request.Command;
747
- /**
748
- * @internal
749
- */
750
- export declare function createZDiffStore(destination: GlideString, keys: GlideString[]): command_request.Command;
751
- /**
752
- * @internal
753
- */
754
- export declare function createZScore(key: GlideString, member: GlideString): command_request.Command;
755
- /**
756
- * @internal
757
- */
758
- export declare function createZUnionStore(destination: GlideString, keys: GlideString[] | KeyWeight[], aggregationType?: AggregationType): command_request.Command;
759
- /**
760
- * @internal
761
- */
762
- export declare function createZMScore(key: GlideString, members: GlideString[]): command_request.Command;
763
- /**
764
- * @internal
765
- */
766
- export declare function createScan(cursor: GlideString, options?: ScanOptions): command_request.Command;
767
393
  export declare enum InfBoundary {
768
394
  /**
769
395
  * Positive infinity bound.
@@ -848,34 +474,6 @@ export type RangeByScore = SortedSetRange<number> & {
848
474
  export type RangeByLex = SortedSetRange<GlideString> & {
849
475
  type: "byLex";
850
476
  };
851
- /**
852
- * @internal
853
- */
854
- export declare function createZCount(key: GlideString, minScore: Boundary<number>, maxScore: Boundary<number>): command_request.Command;
855
- /**
856
- * @internal
857
- */
858
- export declare function createZRange(key: GlideString, rangeQuery: RangeByIndex | RangeByScore | RangeByLex, reverse?: boolean): command_request.Command;
859
- /**
860
- * @internal
861
- */
862
- export declare function createZRangeWithScores(key: GlideString, rangeQuery: RangeByIndex | RangeByScore | RangeByLex, reverse?: boolean): command_request.Command;
863
- /**
864
- * @internal
865
- */
866
- export declare function createZRangeStore(destination: GlideString, source: GlideString, rangeQuery: RangeByIndex | RangeByScore | RangeByLex, reverse?: boolean): command_request.Command;
867
- /**
868
- * @internal
869
- */
870
- export declare function createType(key: GlideString): command_request.Command;
871
- /**
872
- * @internal
873
- */
874
- export declare function createStrlen(key: GlideString): command_request.Command;
875
- /**
876
- * @internal
877
- */
878
- export declare function createLIndex(key: GlideString, index: number): command_request.Command;
879
477
  /**
880
478
  * Defines where to insert new elements into a list.
881
479
  */
@@ -889,46 +487,6 @@ export declare enum InsertPosition {
889
487
  */
890
488
  After = "after"
891
489
  }
892
- /**
893
- * @internal
894
- */
895
- export declare function createLInsert(key: GlideString, position: InsertPosition, pivot: GlideString, element: GlideString): command_request.Command;
896
- /**
897
- * @internal
898
- */
899
- export declare function createZPopMin(key: GlideString, count?: number): command_request.Command;
900
- /**
901
- * @internal
902
- */
903
- export declare function createZPopMax(key: GlideString, count?: number): command_request.Command;
904
- /**
905
- * @internal
906
- */
907
- export declare function createEcho(message: GlideString): command_request.Command;
908
- /**
909
- * @internal
910
- */
911
- export declare function createPTTL(key: GlideString): command_request.Command;
912
- /**
913
- * @internal
914
- */
915
- export declare function createZRemRangeByRank(key: GlideString, start: number, end: number): command_request.Command;
916
- /**
917
- * @internal
918
- */
919
- export declare function createZRemRangeByLex(key: GlideString, minLex: Boundary<GlideString>, maxLex: Boundary<GlideString>): command_request.Command;
920
- /**
921
- * @internal
922
- */
923
- export declare function createZRemRangeByScore(key: GlideString, minScore: Boundary<number>, maxScore: Boundary<number>): command_request.Command;
924
- /** @internal */
925
- export declare function createPersist(key: GlideString): command_request.Command;
926
- /**
927
- * @internal
928
- */
929
- export declare function createZLexCount(key: GlideString, minLex: Boundary<GlideString>, maxLex: Boundary<GlideString>): command_request.Command;
930
- /** @internal */
931
- export declare function createZRank(key: GlideString, member: GlideString, withScores?: boolean): command_request.Command;
932
490
  export type StreamTrimOptions = ({
933
491
  /**
934
492
  * Trim the stream according to entry ID.
@@ -970,70 +528,6 @@ export interface StreamAddOptions {
970
528
  */
971
529
  trim?: StreamTrimOptions;
972
530
  }
973
- /**
974
- * @internal
975
- */
976
- export declare function createXAdd(key: GlideString, values: [GlideString, GlideString][], options?: StreamAddOptions): command_request.Command;
977
- /**
978
- * @internal
979
- */
980
- export declare function createXDel(key: GlideString, ids: string[]): command_request.Command;
981
- /**
982
- * @internal
983
- */
984
- export declare function createXTrim(key: GlideString, options: StreamTrimOptions): command_request.Command;
985
- /**
986
- * @internal
987
- */
988
- export declare function createXRange(key: GlideString, start: Boundary<string>, end: Boundary<string>, count?: number): command_request.Command;
989
- /**
990
- * @internal
991
- */
992
- export declare function createXRevRange(key: GlideString, start: Boundary<string>, end: Boundary<string>, count?: number): command_request.Command;
993
- /**
994
- * @internal
995
- */
996
- export declare function createXGroupCreateConsumer(key: GlideString, groupName: GlideString, consumerName: GlideString): command_request.Command;
997
- /**
998
- * @internal
999
- */
1000
- export declare function createXGroupDelConsumer(key: GlideString, groupName: GlideString, consumerName: GlideString): command_request.Command;
1001
- /**
1002
- * @internal
1003
- */
1004
- export declare function createTime(): command_request.Command;
1005
- /**
1006
- * @internal
1007
- */
1008
- export declare function createPublish(message: GlideString, channel: GlideString, sharded?: boolean): command_request.Command;
1009
- /**
1010
- * @internal
1011
- */
1012
- export declare function createBRPop(keys: GlideString[], timeout: number): command_request.Command;
1013
- /**
1014
- * @internal
1015
- */
1016
- export declare function createBLPop(keys: GlideString[], timeout: number): command_request.Command;
1017
- /**
1018
- * @internal
1019
- */
1020
- export declare function createFCall(func: GlideString, keys: GlideString[], args: GlideString[]): command_request.Command;
1021
- /**
1022
- * @internal
1023
- */
1024
- export declare function createFCallReadOnly(func: GlideString, keys: GlideString[], args: GlideString[]): command_request.Command;
1025
- /**
1026
- * @internal
1027
- */
1028
- export declare function createFunctionDelete(libraryCode: GlideString): command_request.Command;
1029
- /**
1030
- * @internal
1031
- */
1032
- export declare function createFunctionFlush(mode?: FlushMode): command_request.Command;
1033
- /**
1034
- * @internal
1035
- */
1036
- export declare function createFunctionLoad(libraryCode: GlideString, replace?: boolean): command_request.Command;
1037
531
  /** Optional arguments for `FUNCTION LIST` command. */
1038
532
  export interface FunctionListOptions {
1039
533
  /** A wildcard pattern for matching library names. */
@@ -1043,10 +537,6 @@ export interface FunctionListOptions {
1043
537
  }
1044
538
  /** Type of the response of `FUNCTION LIST` command. */
1045
539
  export type FunctionListResponse = Record<string, GlideString | Record<string, GlideString | null | GlideString[]>[]>[];
1046
- /**
1047
- * @internal
1048
- */
1049
- export declare function createFunctionList(options?: FunctionListOptions): command_request.Command;
1050
540
  /** Response for `FUNCTION STATS` command on a single node.
1051
541
  * The response is a map with 2 keys:
1052
542
  * 1. Information about the current running function/script (or null if none).
@@ -1058,12 +548,6 @@ export type FunctionStatsSingleResponse = Record<string, null | Record<string, G
1058
548
  */
1059
549
  export type FunctionStatsFullResponse = Record<string, // Node address
1060
550
  FunctionStatsSingleResponse>;
1061
- /** @internal */
1062
- export declare function createFunctionStats(): command_request.Command;
1063
- /** @internal */
1064
- export declare function createFunctionKill(): command_request.Command;
1065
- /** @internal */
1066
- export declare function createFunctionDump(): command_request.Command;
1067
551
  /**
1068
552
  * Option for `FUNCTION RESTORE` command: {@link GlideClient.functionRestore} and
1069
553
  * {@link GlideClusterClient.functionRestore}.
@@ -1085,8 +569,6 @@ export declare enum FunctionRestorePolicy {
1085
569
  */
1086
570
  REPLACE = "REPLACE"
1087
571
  }
1088
- /** @internal */
1089
- export declare function createFunctionRestore(data: Buffer, policy?: FunctionRestorePolicy): command_request.Command;
1090
572
  /**
1091
573
  * Represents offsets specifying a string interval to analyze in the {@link BaseClient.bitcount | bitcount} and {@link BaseClient.bitpos | bitpos} commands.
1092
574
  * The offsets are zero-based indexes, with `0` being the first index of the string, `1` being the next index and so on.
@@ -1116,10 +598,6 @@ export interface BitOffsetOptions {
1116
598
  */
1117
599
  indexType?: BitmapIndexType;
1118
600
  }
1119
- /**
1120
- * @internal
1121
- */
1122
- export declare function createBitCount(key: GlideString, options?: BitOffsetOptions): command_request.Command;
1123
601
  /**
1124
602
  * Enumeration specifying if index arguments are BYTE indexes or BIT indexes.
1125
603
  * Can be specified in {@link BitOffsetOptions}, which is an optional argument to the {@link BaseClient.bitcount|bitcount} command.
@@ -1133,10 +611,6 @@ export declare enum BitmapIndexType {
1133
611
  /** Specifies that provided indexes are bit indexes. */
1134
612
  BIT = "BIT"
1135
613
  }
1136
- /**
1137
- * @internal
1138
- */
1139
- export declare function createBitPos(key: GlideString, bit: number, options?: BitOffsetOptions): command_request.Command;
1140
614
  /**
1141
615
  * Defines flushing mode for {@link GlideClient.flushall}, {@link GlideClusterClient.flushall},
1142
616
  * {@link GlideClient.functionFlush}, {@link GlideClusterClient.functionFlush},
@@ -1154,14 +628,6 @@ export declare enum FlushMode {
1154
628
  /** Flushes asynchronously. */
1155
629
  ASYNC = "ASYNC"
1156
630
  }
1157
- /**
1158
- * @internal
1159
- * This function converts an input from Record or GlideRecord types to GlideRecord.
1160
- *
1161
- * @param record - input record in either Record or GlideRecord types.
1162
- * @returns same data in GlideRecord type.
1163
- */
1164
- export declare function convertKeysAndEntries(record: Record<string, string> | GlideRecord<string>): GlideRecord<string>;
1165
631
  /** Optional arguments for {@link BaseClient.xread|xread} command. */
1166
632
  export interface StreamReadOptions {
1167
633
  /**
@@ -1184,22 +650,6 @@ export type StreamReadGroupOptions = StreamReadOptions & {
1184
650
  */
1185
651
  noAck?: boolean;
1186
652
  };
1187
- /**
1188
- * @internal
1189
- */
1190
- export declare function createXRead(keys_and_ids: GlideRecord<string>, options?: StreamReadOptions): command_request.Command;
1191
- /** @internal */
1192
- export declare function createXReadGroup(group: GlideString, consumer: GlideString, keys_and_ids: GlideRecord<string>, options?: StreamReadGroupOptions): command_request.Command;
1193
- /**
1194
- * @internal
1195
- */
1196
- export declare function createXInfoStream(key: GlideString, options: boolean | number): command_request.Command;
1197
- /** @internal */
1198
- export declare function createXInfoGroups(key: GlideString): command_request.Command;
1199
- /**
1200
- * @internal
1201
- */
1202
- export declare function createXLen(key: GlideString): command_request.Command;
1203
653
  /** Optional arguments for {@link BaseClient.xpendingWithOptions|xpending}. */
1204
654
  export interface StreamPendingOptions {
1205
655
  /** Filter pending entries by their idle time - in milliseconds. Available since Valkey 6.2.0. */
@@ -1213,10 +663,6 @@ export interface StreamPendingOptions {
1213
663
  /** Filter pending entries by consumer. */
1214
664
  consumer?: GlideString;
1215
665
  }
1216
- /** @internal */
1217
- export declare function createXPending(key: GlideString, group: GlideString, options?: StreamPendingOptions): command_request.Command;
1218
- /** @internal */
1219
- export declare function createXInfoConsumers(key: GlideString, group: GlideString): command_request.Command;
1220
666
  /** Optional parameters for {@link BaseClient.xclaim|xclaim} command. */
1221
667
  export interface StreamClaimOptions {
1222
668
  /**
@@ -1246,10 +692,6 @@ export interface StreamClaimOptions {
1246
692
  */
1247
693
  isForce?: boolean;
1248
694
  }
1249
- /** @internal */
1250
- export declare function createXClaim(key: GlideString, group: GlideString, consumer: GlideString, minIdleTime: number, ids: string[], options?: StreamClaimOptions, justId?: boolean): command_request.Command;
1251
- /** @internal */
1252
- export declare function createXAutoClaim(key: GlideString, group: GlideString, consumer: GlideString, minIdleTime: number, start: GlideString, count?: number, justId?: boolean): command_request.Command;
1253
695
  /**
1254
696
  * Optional arguments for {@link BaseClient.xgroupCreate|xgroupCreate}.
1255
697
  *
@@ -1269,50 +711,6 @@ export interface StreamGroupOptions {
1269
711
  */
1270
712
  entriesRead?: string;
1271
713
  }
1272
- /**
1273
- * @internal
1274
- */
1275
- export declare function createXGroupCreate(key: GlideString, groupName: GlideString, id: string, options?: StreamGroupOptions): command_request.Command;
1276
- /**
1277
- * @internal
1278
- */
1279
- export declare function createXGroupDestroy(key: GlideString, groupName: GlideString): command_request.Command;
1280
- /**
1281
- * @internal
1282
- */
1283
- export declare function createRename(key: GlideString, newKey: GlideString): command_request.Command;
1284
- /**
1285
- * @internal
1286
- */
1287
- export declare function createRenameNX(key: GlideString, newKey: GlideString): command_request.Command;
1288
- /**
1289
- * @internal
1290
- */
1291
- export declare function createPfAdd(key: GlideString, elements: GlideString[]): command_request.Command;
1292
- /**
1293
- * @internal
1294
- */
1295
- export declare function createPfCount(keys: GlideString[]): command_request.Command;
1296
- /**
1297
- * @internal
1298
- */
1299
- export declare function createPfMerge(destination: GlideString, sourceKey: GlideString[]): command_request.Command;
1300
- /**
1301
- * @internal
1302
- */
1303
- export declare function createObjectEncoding(key: GlideString): command_request.Command;
1304
- /**
1305
- * @internal
1306
- */
1307
- export declare function createObjectFreq(key: GlideString): command_request.Command;
1308
- /**
1309
- * @internal
1310
- */
1311
- export declare function createObjectIdletime(key: GlideString): command_request.Command;
1312
- /**
1313
- * @internal
1314
- */
1315
- export declare function createObjectRefcount(key: GlideString): command_request.Command;
1316
714
  /** Additional parameters for `LOLWUT` command. */
1317
715
  export interface LolwutOptions {
1318
716
  /**
@@ -1326,33 +724,6 @@ export interface LolwutOptions {
1326
724
  */
1327
725
  parameters?: number[];
1328
726
  }
1329
- /**
1330
- * @internal
1331
- */
1332
- export declare function createLolwut(options?: LolwutOptions): command_request.Command;
1333
- /**
1334
- * @internal
1335
- */
1336
- export declare function createFlushAll(mode?: FlushMode): command_request.Command;
1337
- /**
1338
- * @internal
1339
- */
1340
- export declare function createFlushDB(mode?: FlushMode): command_request.Command;
1341
- /**
1342
- * @internal
1343
- */
1344
- export declare function createCopy(source: GlideString, destination: GlideString, options?: {
1345
- destinationDB?: number;
1346
- replace?: boolean;
1347
- }): command_request.Command;
1348
- /**
1349
- * @internal
1350
- */
1351
- export declare function createMove(key: GlideString, dbIndex: number): command_request.Command;
1352
- /**
1353
- * @internal
1354
- */
1355
- export declare function createDump(key: GlideString): command_request.Command;
1356
727
  /**
1357
728
  * Optional arguments for `RESTORE` command.
1358
729
  *
@@ -1378,10 +749,6 @@ export interface RestoreOptions {
1378
749
  */
1379
750
  frequency?: number;
1380
751
  }
1381
- /**
1382
- * @internal
1383
- */
1384
- export declare function createRestore(key: GlideString, ttl: number, value: GlideString, options?: RestoreOptions): command_request.Command;
1385
752
  /**
1386
753
  * Optional arguments to LPOS command.
1387
754
  *
@@ -1395,14 +762,6 @@ export interface LPosOptions {
1395
762
  /** The maximum number of comparisons to make between the element and the items in the list. */
1396
763
  maxLength?: number;
1397
764
  }
1398
- /**
1399
- * @internal
1400
- */
1401
- export declare function createLPos(key: GlideString, element: GlideString, options?: LPosOptions): command_request.Command;
1402
- /**
1403
- * @internal
1404
- */
1405
- export declare function createDBSize(): command_request.Command;
1406
765
  /**
1407
766
  * An optional condition to the {@link BaseClient.geoadd | geoadd},
1408
767
  * {@link BaseClient.zadd | zadd} and {@link BaseClient.set | set} commands.
@@ -1442,10 +801,6 @@ export interface GeoAddOptions {
1442
801
  /** If `true`, returns the count of changed elements instead of new elements added. */
1443
802
  changed?: boolean;
1444
803
  }
1445
- /**
1446
- * @internal
1447
- */
1448
- export declare function createGeoAdd(key: GlideString, membersToGeospatialData: Map<GlideString, GeospatialData>, options?: GeoAddOptions): command_request.Command;
1449
804
  /** Enumeration representing distance units options. */
1450
805
  export declare enum GeoUnit {
1451
806
  /** Represents distance in meters. */
@@ -1457,18 +812,6 @@ export declare enum GeoUnit {
1457
812
  /** Represents distance in feet. */
1458
813
  FEET = "ft"
1459
814
  }
1460
- /**
1461
- * @internal
1462
- */
1463
- export declare function createGeoPos(key: GlideString, members: GlideString[]): command_request.Command;
1464
- /**
1465
- * @internal
1466
- */
1467
- export declare function createGeoDist(key: GlideString, member1: GlideString, member2: GlideString, geoUnit?: GeoUnit): command_request.Command;
1468
- /**
1469
- * @internal
1470
- */
1471
- export declare function createGeoHash(key: GlideString, members: GlideString[]): command_request.Command;
1472
815
  /**
1473
816
  * Optional parameters for {@link BaseClient.geosearch|geosearch} command which defines what should be included in the
1474
817
  * search results and how results should be ordered and limited.
@@ -1539,18 +882,6 @@ export interface MemberOrigin {
1539
882
  /** Member (location) name stored in the sorted set to use as a search pivot. */
1540
883
  member: GlideString;
1541
884
  }
1542
- /** @internal */
1543
- export declare function createGeoSearch(key: GlideString, searchFrom: SearchOrigin, searchBy: GeoSearchShape, resultOptions?: GeoSearchResultOptions): command_request.Command;
1544
- /** @internal */
1545
- export declare function createGeoSearchStore(destination: GlideString, source: GlideString, searchFrom: SearchOrigin, searchBy: GeoSearchShape, resultOptions?: GeoSearchStoreResultOptions): command_request.Command;
1546
- /**
1547
- * @internal
1548
- */
1549
- export declare function createZRevRank(key: GlideString, member: GlideString): command_request.Command;
1550
- /**
1551
- * @internal
1552
- */
1553
- export declare function createZRevRankWithScore(key: GlideString, member: GlideString): command_request.Command;
1554
885
  /**
1555
886
  * Mandatory option for zmpop.
1556
887
  * Defines which elements to pop from the sorted set.
@@ -1561,18 +892,6 @@ export declare enum ScoreFilter {
1561
892
  /** Pop elements with the lowest scores. */
1562
893
  MIN = "MIN"
1563
894
  }
1564
- /**
1565
- * @internal
1566
- */
1567
- export declare function createZMPop(keys: GlideString[], modifier: ScoreFilter, count?: number): command_request.Command;
1568
- /**
1569
- * @internal
1570
- */
1571
- export declare function createBZMPop(keys: GlideString[], modifier: ScoreFilter, timeout: number, count?: number): command_request.Command;
1572
- /**
1573
- * @internal
1574
- */
1575
- export declare function createZIncrBy(key: GlideString, increment: number, member: GlideString): command_request.Command;
1576
895
  /**
1577
896
  * Optional arguments to {@link BaseClient.sort|sort}, {@link BaseClient.sortStore|sortStore} and {@link BaseClient.sortReadOnly|sortReadOnly} commands.
1578
897
  *
@@ -1630,46 +949,6 @@ export interface Limit {
1630
949
  /** The maximum number of elements to include in the range. A negative count returns all elements from the offset. */
1631
950
  count: number;
1632
951
  }
1633
- /** @internal */
1634
- export declare function createSort(key: GlideString, options?: SortOptions, destination?: GlideString): command_request.Command;
1635
- /** @internal */
1636
- export declare function createSortReadOnly(key: GlideString, options?: SortOptions): command_request.Command;
1637
- /**
1638
- * @internal
1639
- */
1640
- export declare function createHStrlen(key: GlideString, field: GlideString): command_request.Command;
1641
- /** @internal */
1642
- export declare function createHRandField(key: GlideString, count?: number, withValues?: boolean): command_request.Command;
1643
- /**
1644
- * @internal
1645
- */
1646
- export declare function createHScan(key: GlideString, cursor: string, options?: HScanOptions): command_request.Command;
1647
- /**
1648
- * @internal
1649
- */
1650
- export declare function createZRandMember(key: GlideString, count?: number, withscores?: boolean): command_request.Command;
1651
- /** @internal */
1652
- export declare function createLastSave(): command_request.Command;
1653
- /** @internal */
1654
- export declare function createLCS(key1: GlideString, key2: GlideString, options?: {
1655
- len?: boolean;
1656
- idx?: {
1657
- withMatchLen?: boolean;
1658
- minMatchLen?: number;
1659
- };
1660
- }): command_request.Command;
1661
- /**
1662
- * @internal
1663
- */
1664
- export declare function createTouch(keys: GlideString[]): command_request.Command;
1665
- /** @internal */
1666
- export declare function createRandomKey(): command_request.Command;
1667
- /** @internal */
1668
- export declare function createWatch(keys: GlideString[]): command_request.Command;
1669
- /** @internal */
1670
- export declare function createUnWatch(): command_request.Command;
1671
- /** @internal */
1672
- export declare function createWait(numreplicas: number, timeout: number): command_request.Command;
1673
952
  /**
1674
953
  * This base class represents the common set of optional arguments for the SCAN family of commands.
1675
954
  * Concrete implementations of this class are tied to specific SCAN commands (`SCAN`, `SSCAN`).
@@ -1732,54 +1011,6 @@ export type HScanOptions = BaseScanOptions & {
1732
1011
  */
1733
1012
  readonly noValues?: boolean;
1734
1013
  };
1735
- /**
1736
- * @internal
1737
- */
1738
- export declare function createZScan(key: GlideString, cursor: string, options?: ZScanOptions): command_request.Command;
1739
- /** @internal */
1740
- export declare function createSetRange(key: GlideString, offset: number, value: GlideString): command_request.Command;
1741
- /** @internal */
1742
- export declare function createAppend(key: GlideString, value: GlideString): command_request.Command;
1743
- /**
1744
- * @internal
1745
- */
1746
- export declare function createLMPop(keys: GlideString[], direction: ListDirection, count?: number): command_request.Command;
1747
- /**
1748
- * @internal
1749
- */
1750
- export declare function createBLMPop(keys: GlideString[], direction: ListDirection, timeout: number, count?: number): command_request.Command;
1751
- /**
1752
- * @internal
1753
- */
1754
- export declare function createPubSubChannels(pattern?: GlideString): command_request.Command;
1755
- /**
1756
- * @internal
1757
- */
1758
- export declare function createPubSubNumPat(): command_request.Command;
1759
- /**
1760
- * @internal
1761
- */
1762
- export declare function createPubSubNumSub(channels?: GlideString[]): command_request.Command;
1763
- /**
1764
- * @internal
1765
- */
1766
- export declare function createPubsubShardChannels(pattern?: GlideString): command_request.Command;
1767
- /**
1768
- * @internal
1769
- */
1770
- export declare function createPubSubShardNumSub(channels?: GlideString[]): command_request.Command;
1771
- /**
1772
- * @internal
1773
- */
1774
- export declare function createBZPopMax(keys: GlideString[], timeout: number): command_request.Command;
1775
- /**
1776
- * @internal
1777
- */
1778
- export declare function createBZPopMin(keys: GlideString[], timeout: number): command_request.Command;
1779
- /**
1780
- * @internal
1781
- */
1782
- export declare function createScriptShow(sha1: GlideString): command_request.Command;
1783
1014
  /**
1784
1015
  * Time unit representation which is used in optional arguments for {@link BaseClient.getex|getex} and {@link BaseClient.set|set} command.
1785
1016
  */
@@ -1806,28 +1037,177 @@ export declare enum TimeUnit {
1806
1037
  UnixMilliseconds = "PXAT"
1807
1038
  }
1808
1039
  /**
1809
- * @internal
1810
- */
1811
- export declare function createGetEx(key: GlideString, options?: "persist" | {
1812
- type: TimeUnit;
1813
- duration: number;
1814
- }): command_request.Command;
1815
- /**
1816
- * @internal
1040
+ * Base options settings class for sending a batch request. Shared settings for standalone and
1041
+ * cluster batch requests.
1042
+ *
1043
+ * ### Timeout
1044
+ * The duration in milliseconds that the client should wait for the batch request to complete.
1045
+ * This duration encompasses sending the request, awaiting a response from the server, and any
1046
+ * required reconnections or retries. If the specified timeout is exceeded for a pending request,
1047
+ * it will result in a timeout error. If not explicitly set, the client's {@link BaseClientConfiguration.requestTimeout | requestTimeout} will be used.
1048
+ *
1049
+ * @example
1050
+ * ```javascript
1051
+ * const options: BaseBatchOptions = {
1052
+ * timeout: 5000, // 5 seconds
1053
+ * };
1054
+ * ```
1817
1055
  */
1818
- export declare function createXAck(key: GlideString, group: GlideString, ids: string[]): command_request.Command;
1819
- /**
1820
- * @internal
1056
+ export interface BaseBatchOptions {
1057
+ /**
1058
+ * The duration in milliseconds that the client should wait for the batch request to complete.
1059
+ * This duration encompasses sending the request, awaiting a response from the server, and any
1060
+ * required reconnections or retries. If the specified timeout is exceeded for a pending request,
1061
+ * it will result in a timeout error. If not explicitly set, the client's {@link BaseClientConfiguration.requestTimeout | requestTimeout} will be used.
1062
+ */
1063
+ timeout?: number;
1064
+ }
1065
+ /** Options for a batch request for a standalone client.
1066
+ *
1067
+ * @example
1068
+ * ```javascript
1069
+ * const options: BatchOptions = {
1070
+ * timeout: 5000, // 5 seconds
1071
+ * };
1072
+ * ```
1821
1073
  */
1822
- export declare function createXGroupSetid(key: GlideString, groupName: GlideString, id: string, entriesRead?: number): command_request.Command;
1074
+ export type BatchOptions = {} & BaseBatchOptions;
1823
1075
  /**
1824
- * @internal
1825
- */
1826
- export declare function createScriptExists(sha1s: GlideString[]): command_request.Command;
1076
+ * Options for a batch request for a cluster client.
1077
+ *
1078
+ * ### Route
1079
+ * Configures single-node routing for the batch request. The client will send the batch to the
1080
+ * specified node defined by <code>route</code>.
1081
+ *
1082
+ * ### Retry Strategy
1083
+ * ⚠️ **Please read {@link ClusterBatchRetryStrategy} carefully before enabling these configurations.**
1084
+ * Defines the retry strategy for handling batch request failures.
1085
+ *
1086
+ * This strategy determines whether failed commands should be retried, potentially impacting
1087
+ * execution order.
1088
+ *
1089
+ * - If `retryServerError` is `true`, retriable errors (e.g., `TRYAGAIN`) will trigger a retry.
1090
+ * - If `retryConnectionError` is `true`, connection failures will trigger a retry.
1091
+ *
1092
+ * **⚠️ Warnings:**
1093
+ *
1094
+ * - Retrying server errors may cause commands targeting the same slot to execute out of order.
1095
+ * - Retrying connection errors may lead to duplicate executions, as it is unclear which
1096
+ * commands have already been processed.
1097
+ *
1098
+ * **Note:** Currently, retry strategies are supported only for non-atomic batches.
1099
+ *
1100
+ * **Recommendation:** It is recommended to increase the timeout in {@link BaseBatchOptions.timeout | BaseBatchOptions}
1101
+ * when enabling these strategies.
1102
+ *
1103
+ * **Default:** Both `retryServerError` and `retryConnectionError` are set to `false`.
1104
+ *
1105
+ * @example
1106
+ * ```javascript
1107
+ * const options: ClusterBatchOptions = {
1108
+ * timeout: 5000, // 5 seconds
1109
+ * route: "randomNode",
1110
+ * retryStrategy: {
1111
+ * retryServerError: false,
1112
+ * retryConnectionError: false,
1113
+ * },
1114
+ * };
1115
+ * ```
1116
+ */
1117
+ export type ClusterBatchOptions = {
1118
+ /**
1119
+ * Configures single-node routing for the batch request. The client will send the batch to the
1120
+ * specified node defined by `route`.
1121
+ *
1122
+ * If a redirection error occurs:
1123
+ *
1124
+ * - For Atomic Batches (Transactions), the entire transaction will be redirected.
1125
+ * - For Non-Atomic Batches (Pipelines), only the commands that encountered redirection errors
1126
+ * will be redirected.
1127
+ */
1128
+ route?: SingleNodeRoute;
1129
+ /**
1130
+ * ⚠️ **Please see {@link ClusterBatchRetryStrategy} and read carefully before enabling these configurations.**
1131
+ *
1132
+ * Defines the retry strategy for handling batch request failures.
1133
+ *
1134
+ * This strategy determines whether failed commands should be retried, potentially impacting
1135
+ * execution order.
1136
+ *
1137
+ * - If `retryServerError` is `true`, retriable errors (e.g., `TRYAGAIN`) will trigger a retry.
1138
+ * - If `retryConnectionError` is `true`, connection failures will trigger a retry.
1139
+ *
1140
+ * **⚠️ Warnings:**
1141
+ *
1142
+ * - Retrying server errors may cause commands targeting the same slot to execute out of order.
1143
+ * - Retrying connection errors may lead to duplicate executions, as it is unclear which
1144
+ * commands have already been processed.
1145
+ *
1146
+ * **Note:** Currently, retry strategies are supported only for non-atomic batches.
1147
+ *
1148
+ * **Recommendation:** It is recommended to increase the timeout in {@link BaseBatchOptions.timeout | BaseBatchOptions}
1149
+ * when enabling these strategies.
1150
+ *
1151
+ * **Default:** Both `retryServerError` and `retryConnectionError` are set to `false`.
1152
+ */
1153
+ retryStrategy?: ClusterBatchRetryStrategy;
1154
+ } & BaseBatchOptions;
1827
1155
  /**
1828
- * @internal
1156
+ * Defines a retry strategy for batch requests, allowing control over retries in case of server or
1157
+ * connection errors.
1158
+ *
1159
+ * This strategy determines whether failed commands should be retried, impacting execution order
1160
+ * and potential side effects.
1161
+ *
1162
+ * ### Behavior
1163
+ *
1164
+ * - If `retryServerError` is `true`, failed commands with a retriable error (e.g., `TRYAGAIN`) will be retried.
1165
+ * - If `retryConnectionError` is `true`, batch requests will be retried on connection failures.
1166
+ *
1167
+ * ### Cautions
1168
+ *
1169
+ * - **Server Errors:** Retrying may cause commands targeting the same slot to be executed out of order.
1170
+ * - **Connection Errors:** Retrying may lead to duplicate executions, since the server might have already received and processed the request before the error occurred.
1171
+ *
1172
+ * ### Example Scenario
1173
+ *
1174
+ * ```
1175
+ * MGET key {key}:1
1176
+ * SET key "value"
1177
+ * ```
1178
+ *
1179
+ * Expected response when keys are empty:
1180
+ *
1181
+ * ```
1182
+ * [null, null]
1183
+ * OK
1184
+ * ```
1185
+ *
1186
+ * However, if the slot is migrating, both commands may return an `ASK` error and be redirected.
1187
+ * Upon `ASK` redirection, a multi-key command may return a `TRYAGAIN` error (triggering a retry), while
1188
+ * the `SET` command succeeds immediately. This can result in an unintended reordering of commands if
1189
+ * the first command is retried after the slot stabilizes:
1190
+ *
1191
+ * ```
1192
+ * ["value", null]
1193
+ * OK
1194
+ * ```
1195
+ *
1196
+ * **Note:** Currently, retry strategies are supported only for non-atomic batches.
1829
1197
  */
1830
- export declare function createScriptFlush(mode?: FlushMode): command_request.Command;
1831
- /** @internal */
1832
- export declare function createScriptKill(): command_request.Command;
1198
+ export interface ClusterBatchRetryStrategy {
1199
+ /**
1200
+ * If `true`, failed commands with a retriable error (e.g., `TRYAGAIN`) will be automatically retried.
1201
+ *
1202
+ * ⚠️ **Warning:** Enabling this flag may cause commands targeting the same slot to execute out of order.
1203
+ */
1204
+ retryServerError: boolean;
1205
+ /**
1206
+ * If `true`, batch requests will be retried in case of connection errors.
1207
+ *
1208
+ * ⚠️ **Warning:** Retrying after a connection error may lead to duplicate executions, since
1209
+ * the server might have already received and processed the request before the error occurred.
1210
+ */
1211
+ retryConnectionError: boolean;
1212
+ }
1833
1213
  export {};