@upstash/redis 0.0.0-ci.cb27f2dedaa904232a2ff3a631b20ff886188ff3-20240708092746 → 0.0.0-ci.cbfeff9b449dd01c99384632d59c371c0bee875a-20260123181940

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.
@@ -36,12 +36,37 @@ type UpstashRequest = {
36
36
  * Request body will be serialized to json
37
37
  */
38
38
  body?: unknown;
39
+ /**
40
+ * Additional headers for the request
41
+ */
42
+ headers?: Record<string, string>;
43
+ upstashSyncToken?: string;
44
+ /**
45
+ * Callback for handling streaming messages
46
+ */
47
+ onMessage?: (data: string) => void;
48
+ /**
49
+ * Whether this request expects a streaming response
50
+ */
51
+ isStreaming?: boolean;
52
+ /**
53
+ * Abort signal for the request
54
+ */
55
+ signal?: AbortSignal;
39
56
  };
40
57
  type UpstashResponse<TResult> = {
41
58
  result?: TResult;
42
59
  error?: string;
43
60
  };
44
61
  interface Requester {
62
+ /**
63
+ * When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
64
+ */
65
+ readYourWrites?: boolean;
66
+ /**
67
+ * This token is used to ensure that the client is in sync with the server. On each request, we send this token in the header, and the server will return a new token.
68
+ */
69
+ upstashSyncToken?: string;
45
70
  request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
46
71
  }
47
72
  type RetryConfig = false | {
@@ -52,7 +77,7 @@ type RetryConfig = false | {
52
77
  */
53
78
  retries?: number;
54
79
  /**
55
- * A backoff function receives the current retry cound and returns a number in milliseconds to wait before retrying.
80
+ * A backoff function receives the current retry count and returns a number in milliseconds to wait before retrying.
56
81
  *
57
82
  * @default
58
83
  * ```ts
@@ -61,6 +86,9 @@ type RetryConfig = false | {
61
86
  */
62
87
  backoff?: (retryCount: number) => number;
63
88
  };
89
+ type Options$1 = {
90
+ backend?: string;
91
+ };
64
92
  type RequesterConfig = {
65
93
  /**
66
94
  * Configure the retry behaviour in case of network errors
@@ -95,6 +123,19 @@ type RequesterConfig = {
95
123
  */
96
124
  cache?: CacheSetting;
97
125
  };
126
+ type HttpClientConfig = {
127
+ headers?: Record<string, string>;
128
+ baseUrl: string;
129
+ options?: Options$1;
130
+ retry?: RetryConfig;
131
+ agent?: any;
132
+ signal?: AbortSignal | (() => AbortSignal);
133
+ keepAlive?: boolean;
134
+ /**
135
+ * When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
136
+ */
137
+ readYourWrites?: boolean;
138
+ } & RequesterConfig;
98
139
 
99
140
  type Serialize = (data: unknown) => string | number | boolean;
100
141
  type Deserialize<TResult, TData> = (result: TResult) => TData;
@@ -110,6 +151,31 @@ type CommandOptions<TResult, TData> = {
110
151
  */
111
152
  automaticDeserialization?: boolean;
112
153
  latencyLogging?: boolean;
154
+ /**
155
+ * Additional headers to be sent with the request
156
+ */
157
+ headers?: Record<string, string>;
158
+ /**
159
+ * Path to append to the URL
160
+ */
161
+ path?: string[];
162
+ /**
163
+ * Options for streaming requests, mainly used for subscribe, monitor commands
164
+ **/
165
+ streamOptions?: {
166
+ /**
167
+ * Callback to be called when a message is received
168
+ */
169
+ onMessage?: (data: string) => void;
170
+ /**
171
+ * Whether the request is streaming
172
+ */
173
+ isStreaming?: boolean;
174
+ /**
175
+ * Signal to abort the request
176
+ */
177
+ signal?: AbortSignal;
178
+ };
113
179
  };
114
180
  /**
115
181
  * Command offers default (de)serialization and the exec method to all commands.
@@ -121,6 +187,11 @@ declare class Command<TResult, TData> {
121
187
  readonly command: (string | number | boolean)[];
122
188
  readonly serialize: Serialize;
123
189
  readonly deserialize: Deserialize<TResult, TData>;
190
+ protected readonly headers?: Record<string, string>;
191
+ protected readonly path?: string[];
192
+ protected readonly onMessage?: (data: string) => void;
193
+ protected readonly isStreaming: boolean;
194
+ protected readonly signal?: AbortSignal;
124
195
  /**
125
196
  * Create a new command instance.
126
197
  *
@@ -133,8 +204,7 @@ declare class Command<TResult, TData> {
133
204
  exec(client: Requester): Promise<TData>;
134
205
  }
135
206
 
136
- type ZUnionCommandOptions = {
137
- withScores?: boolean;
207
+ type ZUnionStoreCommandOptions = {
138
208
  aggregate?: "sum" | "min" | "max";
139
209
  } & ({
140
210
  weight: number;
@@ -147,14 +217,15 @@ type ZUnionCommandOptions = {
147
217
  weights?: never;
148
218
  });
149
219
  /**
150
- * @see https://redis.io/commands/zunion
220
+ * @see https://redis.io/commands/zunionstore
151
221
  */
152
- declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
153
- constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
154
- constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
222
+ declare class ZUnionStoreCommand extends Command<number, number> {
223
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
224
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
155
225
  }
156
226
 
157
- type ZUnionStoreCommandOptions = {
227
+ type ZUnionCommandOptions = {
228
+ withScores?: boolean;
158
229
  aggregate?: "sum" | "min" | "max";
159
230
  } & ({
160
231
  weight: number;
@@ -167,11 +238,11 @@ type ZUnionStoreCommandOptions = {
167
238
  weights?: never;
168
239
  });
169
240
  /**
170
- * @see https://redis.io/commands/zunionstore
241
+ * @see https://redis.io/commands/zunion
171
242
  */
172
- declare class ZUnionStoreCommand extends Command<number, number> {
173
- constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
174
- constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
243
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
244
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
245
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
175
246
  }
176
247
 
177
248
  type ZInterStoreCommandOptions = {
@@ -216,18 +287,6 @@ declare class ScriptFlushCommand extends Command<"OK", "OK"> {
216
287
  constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
217
288
  }
218
289
 
219
- type ScanCommandOptions = {
220
- match?: string;
221
- count?: number;
222
- type?: string;
223
- };
224
- /**
225
- * @see https://redis.io/commands/scan
226
- */
227
- declare class ScanCommand extends Command<[string, string[]], [string, string[]]> {
228
- constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], [string, string[]]>);
229
- }
230
-
231
290
  type GeoAddCommandOptions = {
232
291
  nx?: boolean;
233
292
  xx?: never;
@@ -237,11 +296,11 @@ type GeoAddCommandOptions = {
237
296
  } & {
238
297
  ch?: boolean;
239
298
  });
240
- interface GeoMember<TMemberType> {
299
+ type GeoMember<TMemberType> = {
241
300
  latitude: number;
242
301
  longitude: number;
243
302
  member: TMemberType;
244
- }
303
+ };
245
304
  /**
246
305
  * @see https://redis.io/commands/geoadd
247
306
  */
@@ -253,6 +312,45 @@ declare class GeoAddCommand<TMemberType = string> extends Command<number | null,
253
312
  ], opts?: CommandOptions<number | null, number | null>);
254
313
  }
255
314
 
315
+ type ExpireOption = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
316
+ declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
317
+ constructor(cmd: [key: string, seconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
318
+ }
319
+
320
+ type FunctionListArgs = {
321
+ /**
322
+ * Pattern for matching library names. Supports glob patterns.
323
+ *
324
+ * Example: "my_library_*"
325
+ */
326
+ libraryName?: string;
327
+ /**
328
+ * Includes the library source code in the response.
329
+ *
330
+ * @default false
331
+ */
332
+ withCode?: boolean;
333
+ };
334
+
335
+ type FunctionLoadArgs = {
336
+ /**
337
+ * The Lua code to load.
338
+ *
339
+ * Example:
340
+ * ```lua
341
+ * #!lua name=mylib
342
+ * redis.register_function('myfunc', function() return 'ok' end)
343
+ * ```
344
+ */
345
+ code: string;
346
+ /**
347
+ * If true, the library will replace the existing library with the same name.
348
+ *
349
+ * @default false
350
+ */
351
+ replace?: boolean;
352
+ };
353
+
256
354
  /**
257
355
  * @see https://redis.io/commands/append
258
356
  */
@@ -271,7 +369,7 @@ declare class BitCountCommand extends Command<number, number> {
271
369
  type SubCommandArgs<TRest extends unknown[] = []> = [
272
370
  encoding: string,
273
371
  offset: number | string,
274
- ...TRest
372
+ ...rest: TRest
275
373
  ];
276
374
  /**
277
375
  * @see https://redis.io/commands/bitfield
@@ -349,6 +447,13 @@ declare class EchoCommand extends Command<string, string> {
349
447
  constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
350
448
  }
351
449
 
450
+ /**
451
+ * @see https://redis.io/commands/eval_ro
452
+ */
453
+ declare class EvalROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
454
+ constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
455
+ }
456
+
352
457
  /**
353
458
  * @see https://redis.io/commands/eval
354
459
  */
@@ -356,6 +461,13 @@ declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknow
356
461
  constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
357
462
  }
358
463
 
464
+ /**
465
+ * @see https://redis.io/commands/evalsha_ro
466
+ */
467
+ declare class EvalshaROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
468
+ constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
469
+ }
470
+
359
471
  /**
360
472
  * @see https://redis.io/commands/evalsha
361
473
  */
@@ -370,16 +482,11 @@ declare class ExistsCommand extends Command<number, number> {
370
482
  constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
371
483
  }
372
484
 
373
- type ExpireOptions = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
374
- declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
375
- constructor(cmd: [key: string, seconds: number, option?: ExpireOptions], opts?: CommandOptions<"0" | "1", 0 | 1>);
376
- }
377
-
378
485
  /**
379
486
  * @see https://redis.io/commands/expireat
380
487
  */
381
488
  declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
382
- constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
489
+ constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
383
490
  }
384
491
 
385
492
  /**
@@ -416,7 +523,7 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
416
523
  * @see https://redis.io/commands/geohash
417
524
  */
418
525
  declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
419
- constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
526
+ constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
420
527
  }
421
528
 
422
529
  type Coordinates = {
@@ -554,6 +661,50 @@ declare class GetDelCommand<TData = string> extends Command<unknown | null, TDat
554
661
  constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
555
662
  }
556
663
 
664
+ type GetExCommandOptions = {
665
+ ex: number;
666
+ px?: never;
667
+ exat?: never;
668
+ pxat?: never;
669
+ persist?: never;
670
+ } | {
671
+ ex?: never;
672
+ px: number;
673
+ exat?: never;
674
+ pxat?: never;
675
+ persist?: never;
676
+ } | {
677
+ ex?: never;
678
+ px?: never;
679
+ exat: number;
680
+ pxat?: never;
681
+ persist?: never;
682
+ } | {
683
+ ex?: never;
684
+ px?: never;
685
+ exat?: never;
686
+ pxat: number;
687
+ persist?: never;
688
+ } | {
689
+ ex?: never;
690
+ px?: never;
691
+ exat?: never;
692
+ pxat?: never;
693
+ persist: true;
694
+ } | {
695
+ ex?: never;
696
+ px?: never;
697
+ exat?: never;
698
+ pxat?: never;
699
+ persist?: never;
700
+ };
701
+ /**
702
+ * @see https://redis.io/commands/getex
703
+ */
704
+ declare class GetExCommand<TData = string> extends Command<unknown | null, TData | null> {
705
+ constructor([key, opts]: [key: string, opts?: GetExCommandOptions], cmdOpts?: CommandOptions<unknown | null, TData | null>);
706
+ }
707
+
557
708
  /**
558
709
  * @see https://redis.io/commands/getrange
559
710
  */
@@ -582,6 +733,58 @@ declare class HExistsCommand extends Command<number, number> {
582
733
  constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
583
734
  }
584
735
 
736
+ declare class HExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
737
+ constructor(cmd: [
738
+ key: string,
739
+ fields: (string | number) | (string | number)[],
740
+ seconds: number,
741
+ option?: ExpireOption
742
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
743
+ }
744
+
745
+ declare class HExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
746
+ constructor(cmd: [
747
+ key: string,
748
+ fields: (string | number) | (string | number)[],
749
+ timestamp: number,
750
+ option?: ExpireOption
751
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
752
+ }
753
+
754
+ declare class HExpireTimeCommand extends Command<number[], number[]> {
755
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
756
+ }
757
+
758
+ declare class HPersistCommand extends Command<(-2 | -1 | 1)[], (-2 | -1 | 1)[]> {
759
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<(-2 | -1 | 1)[], (-2 | -1 | 1)[]>);
760
+ }
761
+
762
+ declare class HPExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
763
+ constructor(cmd: [
764
+ key: string,
765
+ fields: (string | number) | (string | number)[],
766
+ milliseconds: number,
767
+ option?: ExpireOption
768
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
769
+ }
770
+
771
+ declare class HPExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
772
+ constructor(cmd: [
773
+ key: string,
774
+ fields: (string | number) | (string | number)[],
775
+ timestamp: number,
776
+ option?: ExpireOption
777
+ ], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
778
+ }
779
+
780
+ declare class HPExpireTimeCommand extends Command<number[], number[]> {
781
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
782
+ }
783
+
784
+ declare class HPTtlCommand extends Command<number[], number[]> {
785
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
786
+ }
787
+
585
788
  /**
586
789
  * @see https://redis.io/commands/hget
587
790
  */
@@ -643,9 +846,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
643
846
  * @see https://redis.io/commands/hmset
644
847
  */
645
848
  declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
646
- constructor([key, kv]: [key: string, kv: {
647
- [field: string]: TData;
648
- }], opts?: CommandOptions<"OK", "OK">);
849
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
649
850
  }
650
851
 
651
852
  /**
@@ -657,6 +858,39 @@ declare class HRandFieldCommand<TData extends string | string[] | Record<string,
657
858
  constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
658
859
  }
659
860
 
861
+ type ScanCommandOptionsStandard = {
862
+ match?: string;
863
+ count?: number;
864
+ type?: string;
865
+ withType?: false;
866
+ };
867
+ type ScanCommandOptionsWithType = {
868
+ match?: string;
869
+ count?: number;
870
+ /**
871
+ * Includes types of each key in the result
872
+ *
873
+ * @example
874
+ * ```typescript
875
+ * await redis.scan("0", { withType: true })
876
+ * // ["0", [{ key: "key1", type: "string" }, { key: "key2", type: "list" }]]
877
+ * ```
878
+ */
879
+ withType: true;
880
+ };
881
+ type ScanCommandOptions = ScanCommandOptionsStandard | ScanCommandOptionsWithType;
882
+ type ScanResultStandard = [string, string[]];
883
+ type ScanResultWithType = [string, {
884
+ key: string;
885
+ type: string;
886
+ }[]];
887
+ /**
888
+ * @see https://redis.io/commands/scan
889
+ */
890
+ declare class ScanCommand<TData = ScanResultStandard> extends Command<[string, string[]], TData> {
891
+ constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], TData>);
892
+ }
893
+
660
894
  /**
661
895
  * @see https://redis.io/commands/hscan
662
896
  */
@@ -674,9 +908,7 @@ declare class HScanCommand extends Command<[
674
908
  * @see https://redis.io/commands/hset
675
909
  */
676
910
  declare class HSetCommand<TData> extends Command<number, number> {
677
- constructor([key, kv]: [key: string, kv: {
678
- [field: string]: TData;
679
- }], opts?: CommandOptions<number, number>);
911
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
680
912
  }
681
913
 
682
914
  /**
@@ -693,6 +925,10 @@ declare class HStrLenCommand extends Command<number, number> {
693
925
  constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
694
926
  }
695
927
 
928
+ declare class HTtlCommand extends Command<number[], number[]> {
929
+ constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
930
+ }
931
+
696
932
  /**
697
933
  * @see https://redis.io/commands/hvals
698
934
  */
@@ -799,6 +1035,13 @@ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) |
799
1035
  ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
800
1036
  }
801
1037
 
1038
+ /**
1039
+ * @see https://redis.io/commands/json.merge
1040
+ */
1041
+ declare class JsonMergeCommand<TData extends string | number | Record<string, unknown> | Array<unknown>> extends Command<"OK" | null, "OK" | null> {
1042
+ constructor(cmd: [key: string, path: string, value: TData], opts?: CommandOptions<"OK" | null, "OK" | null>);
1043
+ }
1044
+
802
1045
  /**
803
1046
  * @see https://redis.io/commands/json.mget
804
1047
  */
@@ -806,6 +1049,17 @@ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
806
1049
  constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
807
1050
  }
808
1051
 
1052
+ /**
1053
+ * @see https://redis.io/commands/json.mset
1054
+ */
1055
+ declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
1056
+ constructor(cmd: {
1057
+ key: string;
1058
+ path: string;
1059
+ value: TData;
1060
+ }[], opts?: CommandOptions<"OK" | null, "OK" | null>);
1061
+ }
1062
+
809
1063
  /**
810
1064
  * @see https://redis.io/commands/json.numincrby
811
1065
  */
@@ -962,25 +1216,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
962
1216
  * @see https://redis.io/commands/mget
963
1217
  */
964
1218
  declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
965
- constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
1219
+ constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
966
1220
  }
967
1221
 
968
1222
  /**
969
1223
  * @see https://redis.io/commands/mset
970
1224
  */
971
1225
  declare class MSetCommand<TData> extends Command<"OK", "OK"> {
972
- constructor([kv]: [kv: {
973
- [key: string]: TData;
974
- }], opts?: CommandOptions<"OK", "OK">);
1226
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
975
1227
  }
976
1228
 
977
1229
  /**
978
1230
  * @see https://redis.io/commands/msetnx
979
1231
  */
980
1232
  declare class MSetNXCommand<TData = string> extends Command<number, number> {
981
- constructor([kv]: [kv: {
982
- [key: string]: TData;
983
- }], opts?: CommandOptions<number, number>);
1233
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
984
1234
  }
985
1235
 
986
1236
  /**
@@ -994,14 +1244,14 @@ declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
994
1244
  * @see https://redis.io/commands/pexpire
995
1245
  */
996
1246
  declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
997
- constructor(cmd: [key: string, milliseconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
1247
+ constructor(cmd: [key: string, milliseconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
998
1248
  }
999
1249
 
1000
1250
  /**
1001
1251
  * @see https://redis.io/commands/pexpireat
1002
1252
  */
1003
1253
  declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
1004
- constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
1254
+ constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
1005
1255
  }
1006
1256
 
1007
1257
  /**
@@ -1078,7 +1328,7 @@ declare class RPushXCommand<TData = string> extends Command<number, number> {
1078
1328
  * @see https://redis.io/commands/sadd
1079
1329
  */
1080
1330
  declare class SAddCommand<TData = string> extends Command<number, number> {
1081
- constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1331
+ constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
1082
1332
  }
1083
1333
 
1084
1334
  /**
@@ -1347,9 +1597,7 @@ declare class XAddCommand extends Command<string, string> {
1347
1597
  constructor([key, id, entries, opts]: [
1348
1598
  key: string,
1349
1599
  id: "*" | string,
1350
- entries: {
1351
- [field: string]: unknown;
1352
- },
1600
+ entries: Record<string, unknown>,
1353
1601
  opts?: XAddCommandOptions
1354
1602
  ], commandOptions?: CommandOptions<string, string>);
1355
1603
  }
@@ -1363,16 +1611,33 @@ type XReadCommandOptions = [
1363
1611
  id: string | string[],
1364
1612
  options?: {
1365
1613
  count?: number;
1614
+ /**
1615
+ * @deprecated block is not yet supported in Upstash Redis
1616
+ */
1366
1617
  blockMS?: number;
1367
1618
  }
1368
1619
  ];
1369
- type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [key: string, id: string, options?: {
1370
- count?: number;
1371
- blockMS?: number;
1372
- }] : never : K extends string[] ? I extends string[] ? [key: string[], id: string[], options?: {
1373
- count?: number;
1374
- blockMS?: number;
1375
- }] : never : never : never;
1620
+ type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [
1621
+ key: string,
1622
+ id: string,
1623
+ options?: {
1624
+ count?: number;
1625
+ /**
1626
+ * @deprecated block is not yet supported in Upstash Redis
1627
+ */
1628
+ blockMS?: number;
1629
+ }
1630
+ ] : never : K extends string[] ? I extends string[] ? [
1631
+ key: string[],
1632
+ id: string[],
1633
+ options?: {
1634
+ count?: number;
1635
+ /**
1636
+ * @deprecated block is not yet supported in Upstash Redis
1637
+ */
1638
+ blockMS?: number;
1639
+ }
1640
+ ] : never : never : never;
1376
1641
  /**
1377
1642
  * @see https://redis.io/commands/xread
1378
1643
  */
@@ -1382,6 +1647,9 @@ declare class XReadCommand extends Command<number, unknown[]> {
1382
1647
 
1383
1648
  type Options = {
1384
1649
  count?: number;
1650
+ /**
1651
+ * @deprecated block is not yet supported in Upstash Redis
1652
+ */
1385
1653
  blockMS?: number;
1386
1654
  NOACK?: boolean;
1387
1655
  };
@@ -1559,7 +1827,11 @@ declare class ZRemRangeByRankCommand extends Command<number, number> {
1559
1827
  * @see https://redis.io/commands/zremrangebyscore
1560
1828
  */
1561
1829
  declare class ZRemRangeByScoreCommand extends Command<number, number> {
1562
- constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1830
+ constructor(cmd: [
1831
+ key: string,
1832
+ min: number | `(${number}` | "-inf" | "+inf",
1833
+ max: number | `(${number}` | "-inf" | "+inf"
1834
+ ], opts?: CommandOptions<number, number>);
1563
1835
  }
1564
1836
 
1565
1837
  /**
@@ -1589,9 +1861,79 @@ declare class ZScoreCommand<TData> extends Command<string | null, number | null>
1589
1861
  constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1590
1862
  }
1591
1863
 
1864
+ type BaseMessageData<TMessage> = {
1865
+ channel: string;
1866
+ message: TMessage;
1867
+ };
1868
+ type PatternMessageData<TMessage> = BaseMessageData<TMessage> & {
1869
+ pattern: string;
1870
+ };
1871
+ type SubscriptionCountEvent = number;
1872
+ type MessageEventMap<TMessage> = {
1873
+ message: BaseMessageData<TMessage>;
1874
+ subscribe: SubscriptionCountEvent;
1875
+ unsubscribe: SubscriptionCountEvent;
1876
+ pmessage: PatternMessageData<TMessage>;
1877
+ psubscribe: SubscriptionCountEvent;
1878
+ punsubscribe: SubscriptionCountEvent;
1879
+ error: Error;
1880
+ [key: `message:${string}`]: BaseMessageData<TMessage>;
1881
+ [key: `pmessage:${string}`]: PatternMessageData<TMessage>;
1882
+ };
1883
+ type EventType = keyof MessageEventMap<any>;
1884
+ type Listener<TMessage, T extends EventType> = (event: MessageEventMap<TMessage>[T]) => void;
1885
+ declare class Subscriber<TMessage = any> extends EventTarget {
1886
+ private subscriptions;
1887
+ private client;
1888
+ private listeners;
1889
+ private opts?;
1890
+ constructor(client: Requester, channels: string[], isPattern?: boolean, opts?: Pick<RedisOptions, "automaticDeserialization">);
1891
+ private subscribeToChannel;
1892
+ private subscribeToPattern;
1893
+ private handleMessage;
1894
+ private dispatchToListeners;
1895
+ on<T extends keyof MessageEventMap<TMessage>>(type: T, listener: Listener<TMessage, T>): void;
1896
+ removeAllListeners(): void;
1897
+ unsubscribe(channels?: string[]): Promise<void>;
1898
+ getSubscribedChannels(): string[];
1899
+ }
1900
+
1592
1901
  type InferResponseData<T extends unknown[]> = {
1593
1902
  [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1594
1903
  };
1904
+ interface ExecMethod<TCommands extends Command<any, any>[]> {
1905
+ /**
1906
+ * Send the pipeline request to upstash.
1907
+ *
1908
+ * Returns an array with the results of all pipelined commands.
1909
+ *
1910
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1911
+ * ```ts
1912
+ * const p = redis.pipeline()
1913
+ * p.get("key")
1914
+ * const result = p.exec<[{ greeting: string }]>()
1915
+ * ```
1916
+ *
1917
+ * If one of the commands get an error, the whole pipeline fails. Alternatively, you can set the keepErrors option to true in order to get the errors individually.
1918
+ *
1919
+ * If keepErrors is set to true, a list of objects is returned where each object corresponds to a command and is of type: `{ result: unknown, error?: string }`.
1920
+ *
1921
+ * ```ts
1922
+ * const p = redis.pipeline()
1923
+ * p.get("key")
1924
+ *
1925
+ * const result = await p.exec({ keepErrors: true });
1926
+ * const getResult = result[0].result
1927
+ * const getError = result[0].error
1928
+ * ```
1929
+ */
1930
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(): Promise<TCommandResults>;
1931
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(options: {
1932
+ keepErrors: true;
1933
+ }): Promise<{
1934
+ [K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]>;
1935
+ }>;
1936
+ }
1595
1937
  /**
1596
1938
  * Upstash REST API supports command pipelining to send multiple commands in
1597
1939
  * batch, instead of sending each command one by one and waiting for a response.
@@ -1640,19 +1982,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1640
1982
  commandOptions?: CommandOptions<any, any>;
1641
1983
  multiExec?: boolean;
1642
1984
  });
1643
- /**
1644
- * Send the pipeline request to upstash.
1645
- *
1646
- * Returns an array with the results of all pipelined commands.
1647
- *
1648
- * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1649
- * ```ts
1650
- * const p = redis.pipeline()
1651
- * p.get("key")
1652
- * const result = p.exec<[{ greeting: string }]>()
1653
- * ```
1654
- */
1655
- exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
1985
+ exec: ExecMethod<TCommands>;
1656
1986
  /**
1657
1987
  * Returns the length of pipeline before the execution
1658
1988
  */
@@ -1728,10 +2058,18 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1728
2058
  * @see https://redis.io/commands/echo
1729
2059
  */
1730
2060
  echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
2061
+ /**
2062
+ * @see https://redis.io/commands/eval_ro
2063
+ */
2064
+ evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1731
2065
  /**
1732
2066
  * @see https://redis.io/commands/eval
1733
2067
  */
1734
2068
  eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
2069
+ /**
2070
+ * @see https://redis.io/commands/evalsha_ro
2071
+ */
2072
+ evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1735
2073
  /**
1736
2074
  * @see https://redis.io/commands/evalsha
1737
2075
  */
@@ -1743,11 +2081,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1743
2081
  /**
1744
2082
  * @see https://redis.io/commands/expire
1745
2083
  */
1746
- expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2084
+ expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1747
2085
  /**
1748
2086
  * @see https://redis.io/commands/expireat
1749
2087
  */
1750
- expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2088
+ expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1751
2089
  /**
1752
2090
  * @see https://redis.io/commands/flushall
1753
2091
  */
@@ -1756,7 +2094,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1756
2094
  * @see https://redis.io/commands/flushdb
1757
2095
  */
1758
2096
  flushdb: (opts?: {
1759
- async?: boolean | undefined;
2097
+ async?: boolean;
1760
2098
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1761
2099
  /**
1762
2100
  * @see https://redis.io/commands/geoadd
@@ -1803,11 +2141,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1803
2141
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1804
2142
  count?: {
1805
2143
  limit: number;
1806
- any?: boolean | undefined;
1807
- } | undefined;
1808
- withCoord?: boolean | undefined;
1809
- withDist?: boolean | undefined;
1810
- withHash?: boolean | undefined;
2144
+ any?: boolean;
2145
+ };
2146
+ withCoord?: boolean;
2147
+ withDist?: boolean;
2148
+ withHash?: boolean;
1811
2149
  } | undefined) => Pipeline<[...TCommands, Command<any, ({
1812
2150
  member: TData;
1813
2151
  } & {
@@ -1844,9 +2182,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1844
2182
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1845
2183
  count?: {
1846
2184
  limit: number;
1847
- any?: boolean | undefined;
1848
- } | undefined;
1849
- storeDist?: boolean | undefined;
2185
+ any?: boolean;
2186
+ };
2187
+ storeDist?: boolean;
1850
2188
  } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1851
2189
  /**
1852
2190
  * @see https://redis.io/commands/get
@@ -1860,6 +2198,46 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1860
2198
  * @see https://redis.io/commands/getdel
1861
2199
  */
1862
2200
  getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2201
+ /**
2202
+ * @see https://redis.io/commands/getex
2203
+ */
2204
+ getex: <TData>(key: string, opts?: ({
2205
+ ex: number;
2206
+ px?: never;
2207
+ exat?: never;
2208
+ pxat?: never;
2209
+ persist?: never;
2210
+ } | {
2211
+ ex?: never;
2212
+ px: number;
2213
+ exat?: never;
2214
+ pxat?: never;
2215
+ persist?: never;
2216
+ } | {
2217
+ ex?: never;
2218
+ px?: never;
2219
+ exat: number;
2220
+ pxat?: never;
2221
+ persist?: never;
2222
+ } | {
2223
+ ex?: never;
2224
+ px?: never;
2225
+ exat?: never;
2226
+ pxat: number;
2227
+ persist?: never;
2228
+ } | {
2229
+ ex?: never;
2230
+ px?: never;
2231
+ exat?: never;
2232
+ pxat?: never;
2233
+ persist: true;
2234
+ } | {
2235
+ ex?: never;
2236
+ px?: never;
2237
+ exat?: never;
2238
+ pxat?: never;
2239
+ persist?: never;
2240
+ }) | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1863
2241
  /**
1864
2242
  * @see https://redis.io/commands/getrange
1865
2243
  */
@@ -1876,6 +2254,42 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1876
2254
  * @see https://redis.io/commands/hexists
1877
2255
  */
1878
2256
  hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
2257
+ /**
2258
+ * @see https://redis.io/commands/hexpire
2259
+ */
2260
+ hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2261
+ /**
2262
+ * @see https://redis.io/commands/hexpireat
2263
+ */
2264
+ hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2265
+ /**
2266
+ * @see https://redis.io/commands/hexpiretime
2267
+ */
2268
+ hexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2269
+ /**
2270
+ * @see https://redis.io/commands/httl
2271
+ */
2272
+ httl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2273
+ /**
2274
+ * @see https://redis.io/commands/hpexpire
2275
+ */
2276
+ hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2277
+ /**
2278
+ * @see https://redis.io/commands/hpexpireat
2279
+ */
2280
+ hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
2281
+ /**
2282
+ * @see https://redis.io/commands/hpexpiretime
2283
+ */
2284
+ hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2285
+ /**
2286
+ * @see https://redis.io/commands/hpttl
2287
+ */
2288
+ hpttl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
2289
+ /**
2290
+ * @see https://redis.io/commands/hpersist
2291
+ */
2292
+ hpersist: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, (1 | -2 | -1)[]>]>;
1879
2293
  /**
1880
2294
  * @see https://redis.io/commands/hget
1881
2295
  */
@@ -1907,13 +2321,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1907
2321
  /**
1908
2322
  * @see https://redis.io/commands/hmset
1909
2323
  */
1910
- hmset: <TData>(key: string, kv: {
1911
- [field: string]: TData;
1912
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2324
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1913
2325
  /**
1914
2326
  * @see https://redis.io/commands/hrandfield
1915
2327
  */
1916
- hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
2328
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1917
2329
  /**
1918
2330
  * @see https://redis.io/commands/hscan
1919
2331
  */
@@ -1921,9 +2333,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1921
2333
  /**
1922
2334
  * @see https://redis.io/commands/hset
1923
2335
  */
1924
- hset: <TData>(key: string, kv: {
1925
- [field: string]: TData;
1926
- }) => Pipeline<[...TCommands, Command<any, number>]>;
2336
+ hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
1927
2337
  /**
1928
2338
  * @see https://redis.io/commands/hsetnx
1929
2339
  */
@@ -1980,9 +2390,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1980
2390
  * @see https://redis.io/commands/lpos
1981
2391
  */
1982
2392
  lpos: <TData>(key: string, element: unknown, opts?: {
1983
- rank?: number | undefined;
1984
- count?: number | undefined;
1985
- maxLen?: number | undefined;
2393
+ rank?: number;
2394
+ count?: number;
2395
+ maxLen?: number;
1986
2396
  } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1987
2397
  /**
1988
2398
  * @see https://redis.io/commands/lpush
@@ -2015,15 +2425,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2015
2425
  /**
2016
2426
  * @see https://redis.io/commands/mset
2017
2427
  */
2018
- mset: <TData>(kv: {
2019
- [key: string]: TData;
2020
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2428
+ mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2021
2429
  /**
2022
2430
  * @see https://redis.io/commands/msetnx
2023
2431
  */
2024
- msetnx: <TData>(kv: {
2025
- [key: string]: TData;
2026
- }) => Pipeline<[...TCommands, Command<any, number>]>;
2432
+ msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2027
2433
  /**
2028
2434
  * @see https://redis.io/commands/persist
2029
2435
  */
@@ -2031,11 +2437,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2031
2437
  /**
2032
2438
  * @see https://redis.io/commands/pexpire
2033
2439
  */
2034
- pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2440
+ pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2035
2441
  /**
2036
2442
  * @see https://redis.io/commands/pexpireat
2037
2443
  */
2038
- pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2444
+ pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2039
2445
  /**
2040
2446
  * @see https://redis.io/commands/pfadd
2041
2447
  */
@@ -2091,11 +2497,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2091
2497
  /**
2092
2498
  * @see https://redis.io/commands/sadd
2093
2499
  */
2094
- sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2500
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2095
2501
  /**
2096
2502
  * @see https://redis.io/commands/scan
2097
2503
  */
2098
- scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
2504
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2099
2505
  /**
2100
2506
  * @see https://redis.io/commands/scard
2101
2507
  */
@@ -2212,19 +2618,13 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2212
2618
  /**
2213
2619
  * @see https://redis.io/commands/zadd
2214
2620
  */
2215
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
2216
- key: string,
2217
- opts: ZAddCommandOptions,
2218
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
2219
- ]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2621
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2220
2622
  /**
2221
2623
  * @see https://redis.io/commands/xadd
2222
2624
  */
2223
- xadd: (key: string, id: string, entries: {
2224
- [field: string]: unknown;
2225
- }, opts?: {
2226
- nomkStream?: boolean | undefined;
2227
- trim?: (({
2625
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
2626
+ nomkStream?: boolean;
2627
+ trim?: ({
2228
2628
  type: "MAXLEN" | "maxlen";
2229
2629
  threshold: number;
2230
2630
  } | {
@@ -2232,11 +2632,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2232
2632
  threshold: string;
2233
2633
  }) & ({
2234
2634
  comparison: "~";
2235
- limit?: number | undefined;
2635
+ limit?: number;
2236
2636
  } | {
2237
2637
  comparison: "=";
2238
- limit?: undefined;
2239
- })) | undefined;
2638
+ limit?: never;
2639
+ });
2240
2640
  } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2241
2641
  /**
2242
2642
  * @see https://redis.io/commands/xack
@@ -2252,11 +2652,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2252
2652
  xgroup: (key: string, opts: {
2253
2653
  type: "CREATE";
2254
2654
  group: string;
2255
- id: string;
2655
+ id: `$` | string;
2256
2656
  options?: {
2257
- MKSTREAM?: boolean | undefined;
2258
- ENTRIESREAD?: number | undefined;
2259
- } | undefined;
2657
+ MKSTREAM?: boolean;
2658
+ ENTRIESREAD?: number;
2659
+ };
2260
2660
  } | {
2261
2661
  type: "CREATECONSUMER";
2262
2662
  group: string;
@@ -2271,10 +2671,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2271
2671
  } | {
2272
2672
  type: "SETID";
2273
2673
  group: string;
2274
- id: string;
2674
+ id: `$` | string;
2275
2675
  options?: {
2276
- ENTRIESREAD?: number | undefined;
2277
- } | undefined;
2676
+ ENTRIESREAD?: number;
2677
+ };
2278
2678
  }) => Pipeline<[...TCommands, Command<any, never>]>;
2279
2679
  /**
2280
2680
  * @see https://redis.io/commands/xread
@@ -2301,35 +2701,35 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2301
2701
  * @see https://redis.io/commands/xpending
2302
2702
  */
2303
2703
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2304
- idleTime?: number | undefined;
2305
- consumer?: string | string[] | undefined;
2704
+ idleTime?: number;
2705
+ consumer?: string | string[];
2306
2706
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2307
2707
  /**
2308
2708
  * @see https://redis.io/commands/xclaim
2309
2709
  */
2310
2710
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2311
- idleMS?: number | undefined;
2312
- timeMS?: number | undefined;
2313
- retryCount?: number | undefined;
2314
- force?: boolean | undefined;
2315
- justId?: boolean | undefined;
2316
- lastId?: number | undefined;
2711
+ idleMS?: number;
2712
+ timeMS?: number;
2713
+ retryCount?: number;
2714
+ force?: boolean;
2715
+ justId?: boolean;
2716
+ lastId?: number;
2317
2717
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2318
2718
  /**
2319
2719
  * @see https://redis.io/commands/xautoclaim
2320
2720
  */
2321
2721
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2322
- count?: number | undefined;
2323
- justId?: boolean | undefined;
2722
+ count?: number;
2723
+ justId?: boolean;
2324
2724
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2325
2725
  /**
2326
2726
  * @see https://redis.io/commands/xtrim
2327
2727
  */
2328
2728
  xtrim: (key: string, options: {
2329
2729
  strategy: "MAXLEN" | "MINID";
2330
- exactness?: "~" | "=" | undefined;
2331
- threshold: string | number;
2332
- limit?: number | undefined;
2730
+ exactness?: "~" | "=";
2731
+ threshold: number | string;
2732
+ limit?: number;
2333
2733
  }) => Pipeline<[...TCommands, Command<any, number>]>;
2334
2734
  /**
2335
2735
  * @see https://redis.io/commands/xrange
@@ -2374,21 +2774,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2374
2774
  /**
2375
2775
  * @see https://redis.io/commands/zrange
2376
2776
  */
2377
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2378
- key: string,
2379
- min: `(${string}` | `[${string}` | "-" | "+",
2380
- max: `(${string}` | `[${string}` | "-" | "+",
2381
- opts: {
2382
- byLex: true;
2383
- } & ZRangeCommandOptions
2384
- ] | [
2385
- key: string,
2386
- min: number | `(${number}` | "-inf" | "+inf",
2387
- max: number | `(${number}` | "-inf" | "+inf",
2388
- opts: {
2389
- byScore: true;
2390
- } & ZRangeCommandOptions
2391
- ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2777
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
2778
+ byLex: true;
2779
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
2780
+ byScore: true;
2781
+ } & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
2392
2782
  /**
2393
2783
  * @see https://redis.io/commands/zrank
2394
2784
  */
@@ -2408,7 +2798,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2408
2798
  /**
2409
2799
  * @see https://redis.io/commands/zremrangebyscore
2410
2800
  */
2411
- zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
2801
+ zremrangebyscore: (key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf") => Pipeline<[...TCommands, Command<any, number>]>;
2412
2802
  /**
2413
2803
  * @see https://redis.io/commands/zrevrank
2414
2804
  */
@@ -2473,10 +2863,18 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2473
2863
  * @see https://redis.io/commands/json.get
2474
2864
  */
2475
2865
  get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
2866
+ /**
2867
+ * @see https://redis.io/commands/json.merge
2868
+ */
2869
+ merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2476
2870
  /**
2477
2871
  * @see https://redis.io/commands/json.mget
2478
2872
  */
2479
2873
  mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2874
+ /**
2875
+ * @see https://redis.io/commands/json.mset
2876
+ */
2877
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2480
2878
  /**
2481
2879
  * @see https://redis.io/commands/json.numincrby
2482
2880
  */
@@ -2502,9 +2900,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2502
2900
  */
2503
2901
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2504
2902
  nx: true;
2505
- xx?: undefined;
2903
+ xx?: never;
2506
2904
  } | {
2507
- nx?: undefined;
2905
+ nx?: never;
2508
2906
  xx: true;
2509
2907
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2510
2908
  /**
@@ -2524,6 +2922,52 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2524
2922
  */
2525
2923
  type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
2526
2924
  };
2925
+ get functions(): {
2926
+ /**
2927
+ * @see https://redis.io/docs/latest/commands/function-load/
2928
+ */
2929
+ load: (args: FunctionLoadArgs) => Pipeline<[...TCommands, Command<any, string>]>;
2930
+ /**
2931
+ * @see https://redis.io/docs/latest/commands/function-list/
2932
+ */
2933
+ list: (args?: FunctionListArgs | undefined) => Pipeline<[...TCommands, Command<any, {
2934
+ libraryName: string;
2935
+ engine: string;
2936
+ functions: {
2937
+ name: string;
2938
+ description?: string;
2939
+ flags: string[];
2940
+ }[];
2941
+ libraryCode?: string;
2942
+ }[]>]>;
2943
+ /**
2944
+ * @see https://redis.io/docs/latest/commands/function-delete/
2945
+ */
2946
+ delete: (libraryName: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
2947
+ /**
2948
+ * @see https://redis.io/docs/latest/commands/function-flush/
2949
+ */
2950
+ flush: () => Pipeline<[...TCommands, Command<any, "OK">]>;
2951
+ /**
2952
+ * @see https://redis.io/docs/latest/commands/function-stats/
2953
+ */
2954
+ stats: () => Pipeline<[...TCommands, Command<any, {
2955
+ engines: {
2956
+ [k: string]: {
2957
+ librariesCount: unknown;
2958
+ functionsCount: unknown;
2959
+ };
2960
+ };
2961
+ }>]>;
2962
+ /**
2963
+ * @see https://redis.io/docs/latest/commands/fcall/
2964
+ */
2965
+ call: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
2966
+ /**
2967
+ * @see https://redis.io/docs/latest/commands/fcall_ro/
2968
+ */
2969
+ callRo: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
2970
+ };
2527
2971
  }
2528
2972
 
2529
2973
  /**
@@ -2544,9 +2988,20 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2544
2988
  */
2545
2989
  declare class Script<TResult = unknown> {
2546
2990
  readonly script: string;
2547
- readonly sha1: string;
2991
+ /**
2992
+ * @deprecated This property is initialized to an empty string and will be set in the init method
2993
+ * asynchronously. Do not use this property immidiately after the constructor.
2994
+ *
2995
+ * This property is only exposed for backwards compatibility and will be removed in the
2996
+ * future major release.
2997
+ */
2998
+ sha1: string;
2548
2999
  private readonly redis;
2549
3000
  constructor(redis: Redis, script: string);
3001
+ /**
3002
+ * Initialize the script by computing its SHA-1 hash.
3003
+ */
3004
+ private init;
2550
3005
  /**
2551
3006
  * Send an `EVAL` command to redis.
2552
3007
  */
@@ -2568,6 +3023,56 @@ declare class Script<TResult = unknown> {
2568
3023
  private digest;
2569
3024
  }
2570
3025
 
3026
+ /**
3027
+ * Creates a new script.
3028
+ *
3029
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
3030
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
3031
+ * the entire script. Afterwards, the script is cached on the server.
3032
+ *
3033
+ * @example
3034
+ * ```ts
3035
+ * const redis = new Redis({...})
3036
+ *
3037
+ * const script = redis.createScript<string>("return ARGV[1];", { readOnly: true })
3038
+ * const arg1 = await script.evalRo([], ["Hello World"])
3039
+ * expect(arg1, "Hello World")
3040
+ * ```
3041
+ */
3042
+ declare class ScriptRO<TResult = unknown> {
3043
+ readonly script: string;
3044
+ /**
3045
+ * @deprecated This property is initialized to an empty string and will be set in the init method
3046
+ * asynchronously. Do not use this property immidiately after the constructor.
3047
+ *
3048
+ * This property is only exposed for backwards compatibility and will be removed in the
3049
+ * future major release.
3050
+ */
3051
+ sha1: string;
3052
+ private readonly redis;
3053
+ constructor(redis: Redis, script: string);
3054
+ private init;
3055
+ /**
3056
+ * Send an `EVAL_RO` command to redis.
3057
+ */
3058
+ evalRo(keys: string[], args: string[]): Promise<TResult>;
3059
+ /**
3060
+ * Calculates the sha1 hash of the script and then calls `EVALSHA_RO`.
3061
+ */
3062
+ evalshaRo(keys: string[], args: string[]): Promise<TResult>;
3063
+ /**
3064
+ * Optimistically try to run `EVALSHA_RO` first.
3065
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL_RO`.
3066
+ *
3067
+ * Following calls will be able to use the cached script
3068
+ */
3069
+ exec(keys: string[], args: string[]): Promise<TResult>;
3070
+ /**
3071
+ * Compute the sha1 hash of the script and return its hex representation.
3072
+ */
3073
+ private digest;
3074
+ }
3075
+
2571
3076
  /**
2572
3077
  * Serverless redis client for upstash.
2573
3078
  */
@@ -2576,7 +3081,6 @@ declare class Redis {
2576
3081
  protected opts?: CommandOptions<any, any>;
2577
3082
  protected enableTelemetry: boolean;
2578
3083
  protected enableAutoPipelining: boolean;
2579
- protected readYourWrites: boolean;
2580
3084
  /**
2581
3085
  * Create a new redis client
2582
3086
  *
@@ -2589,6 +3093,8 @@ declare class Redis {
2589
3093
  * ```
2590
3094
  */
2591
3095
  constructor(client: Requester, opts?: RedisOptions);
3096
+ get readYourWritesSyncToken(): string | undefined;
3097
+ set readYourWritesSyncToken(session: string | undefined);
2592
3098
  get json(): {
2593
3099
  /**
2594
3100
  * @see https://redis.io/commands/json.arrappend
@@ -2630,10 +3136,18 @@ declare class Redis {
2630
3136
  * @see https://redis.io/commands/json.get
2631
3137
  */
2632
3138
  get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
3139
+ /**
3140
+ * @see https://redis.io/commands/json.merge
3141
+ */
3142
+ merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Promise<"OK" | null>;
2633
3143
  /**
2634
3144
  * @see https://redis.io/commands/json.mget
2635
3145
  */
2636
- mget: <TData_1>(keys: string[], path: string) => Promise<TData_1>;
3146
+ mget: <TData>(keys: string[], path: string) => Promise<TData>;
3147
+ /**
3148
+ * @see https://redis.io/commands/json.mset
3149
+ */
3150
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
2637
3151
  /**
2638
3152
  * @see https://redis.io/commands/json.numincrby
2639
3153
  */
@@ -2659,9 +3173,9 @@ declare class Redis {
2659
3173
  */
2660
3174
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2661
3175
  nx: true;
2662
- xx?: undefined;
3176
+ xx?: never;
2663
3177
  } | {
2664
- nx?: undefined;
3178
+ nx?: never;
2665
3179
  xx: true;
2666
3180
  } | undefined) => Promise<"OK" | null>;
2667
3181
  /**
@@ -2681,6 +3195,54 @@ declare class Redis {
2681
3195
  */
2682
3196
  type: (key: string, path?: string | undefined) => Promise<string[]>;
2683
3197
  };
3198
+ get functions(): {
3199
+ /**
3200
+ * @see https://redis.io/docs/latest/commands/function-load/
3201
+ */
3202
+ load: (args: FunctionLoadArgs) => Promise<string>;
3203
+ /**
3204
+ * @see https://redis.io/docs/latest/commands/function-list/
3205
+ */
3206
+ list: (args?: FunctionListArgs | undefined) => Promise<{
3207
+ libraryName: string;
3208
+ engine: string;
3209
+ functions: {
3210
+ name: string;
3211
+ description?: string;
3212
+ flags: string[];
3213
+ }[];
3214
+ libraryCode?: string;
3215
+ }[]>;
3216
+ /**
3217
+ * @see https://redis.io/docs/latest/commands/function-delete/
3218
+ */
3219
+ delete: (libraryName: string) => Promise<"OK">;
3220
+ /**
3221
+ * @see https://redis.io/docs/latest/commands/function-flush/
3222
+ */
3223
+ flush: () => Promise<"OK">;
3224
+ /**
3225
+ * @see https://redis.io/docs/latest/commands/function-stats/
3226
+ *
3227
+ * Note: `running_script` field is not supported and therefore not included in the type.
3228
+ */
3229
+ stats: () => Promise<{
3230
+ engines: {
3231
+ [k: string]: {
3232
+ librariesCount: unknown;
3233
+ functionsCount: unknown;
3234
+ };
3235
+ };
3236
+ }>;
3237
+ /**
3238
+ * @see https://redis.io/docs/latest/commands/fcall/
3239
+ */
3240
+ call: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Promise<TData>;
3241
+ /**
3242
+ * @see https://redis.io/docs/latest/commands/fcall_ro/
3243
+ */
3244
+ callRo: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Promise<TData>;
3245
+ };
2684
3246
  /**
2685
3247
  * Wrap a new middleware around the HTTP client.
2686
3248
  */
@@ -2689,7 +3251,37 @@ declare class Redis {
2689
3251
  * Technically this is not private, we can hide it from intellisense by doing this
2690
3252
  */
2691
3253
  protected addTelemetry: (telemetry: Telemetry) => void;
2692
- createScript(script: string): Script;
3254
+ /**
3255
+ * Creates a new script.
3256
+ *
3257
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
3258
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
3259
+ * the entire script. Afterwards, the script is cached on the server.
3260
+ *
3261
+ * @param script - The script to create
3262
+ * @param opts - Optional options to pass to the script `{ readonly?: boolean }`
3263
+ * @returns A new script
3264
+ *
3265
+ * @example
3266
+ * ```ts
3267
+ * const redis = new Redis({...})
3268
+ *
3269
+ * const script = redis.createScript<string>("return ARGV[1];")
3270
+ * const arg1 = await script.eval([], ["Hello World"])
3271
+ * expect(arg1, "Hello World")
3272
+ * ```
3273
+ * @example
3274
+ * ```ts
3275
+ * const redis = new Redis({...})
3276
+ *
3277
+ * const script = redis.createScript<string>("return ARGV[1];", { readonly: true })
3278
+ * const arg1 = await script.evalRo([], ["Hello World"])
3279
+ * expect(arg1, "Hello World")
3280
+ * ```
3281
+ */
3282
+ createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
3283
+ readonly?: TReadonly;
3284
+ }): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
2693
3285
  /**
2694
3286
  * Create a new pipeline that allows you to send requests in bulk.
2695
3287
  *
@@ -2768,14 +3360,26 @@ declare class Redis {
2768
3360
  * @see https://redis.io/commands/echo
2769
3361
  */
2770
3362
  echo: (message: string) => Promise<string>;
3363
+ /**
3364
+ * @see https://redis.io/commands/eval_ro
3365
+ */
3366
+ evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
2771
3367
  /**
2772
3368
  * @see https://redis.io/commands/eval
2773
3369
  */
2774
3370
  eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
3371
+ /**
3372
+ * @see https://redis.io/commands/evalsha_ro
3373
+ */
3374
+ evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
2775
3375
  /**
2776
3376
  * @see https://redis.io/commands/evalsha
2777
3377
  */
2778
3378
  evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
3379
+ /**
3380
+ * Generic method to execute any Redis command.
3381
+ */
3382
+ exec: <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) => Promise<TResult>;
2779
3383
  /**
2780
3384
  * @see https://redis.io/commands/exists
2781
3385
  */
@@ -2783,11 +3387,11 @@ declare class Redis {
2783
3387
  /**
2784
3388
  * @see https://redis.io/commands/expire
2785
3389
  */
2786
- expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Promise<0 | 1>;
3390
+ expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
2787
3391
  /**
2788
3392
  * @see https://redis.io/commands/expireat
2789
3393
  */
2790
- expireat: (key: string, unix: number) => Promise<0 | 1>;
3394
+ expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
2791
3395
  /**
2792
3396
  * @see https://redis.io/commands/flushall
2793
3397
  */
@@ -2796,7 +3400,7 @@ declare class Redis {
2796
3400
  * @see https://redis.io/commands/flushdb
2797
3401
  */
2798
3402
  flushdb: (opts?: {
2799
- async?: boolean | undefined;
3403
+ async?: boolean;
2800
3404
  } | undefined) => Promise<"OK">;
2801
3405
  /**
2802
3406
  * @see https://redis.io/commands/geoadd
@@ -2843,11 +3447,11 @@ declare class Redis {
2843
3447
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2844
3448
  count?: {
2845
3449
  limit: number;
2846
- any?: boolean | undefined;
2847
- } | undefined;
2848
- withCoord?: boolean | undefined;
2849
- withDist?: boolean | undefined;
2850
- withHash?: boolean | undefined;
3450
+ any?: boolean;
3451
+ };
3452
+ withCoord?: boolean;
3453
+ withDist?: boolean;
3454
+ withHash?: boolean;
2851
3455
  } | undefined) => Promise<({
2852
3456
  member: TData;
2853
3457
  } & {
@@ -2884,9 +3488,9 @@ declare class Redis {
2884
3488
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2885
3489
  count?: {
2886
3490
  limit: number;
2887
- any?: boolean | undefined;
2888
- } | undefined;
2889
- storeDist?: boolean | undefined;
3491
+ any?: boolean;
3492
+ };
3493
+ storeDist?: boolean;
2890
3494
  } | undefined) => Promise<number>;
2891
3495
  /**
2892
3496
  * @see https://redis.io/commands/get
@@ -2900,6 +3504,46 @@ declare class Redis {
2900
3504
  * @see https://redis.io/commands/getdel
2901
3505
  */
2902
3506
  getdel: <TData>(key: string) => Promise<TData | null>;
3507
+ /**
3508
+ * @see https://redis.io/commands/getex
3509
+ */
3510
+ getex: <TData>(key: string, opts?: ({
3511
+ ex: number;
3512
+ px?: never;
3513
+ exat?: never;
3514
+ pxat?: never;
3515
+ persist?: never;
3516
+ } | {
3517
+ ex?: never;
3518
+ px: number;
3519
+ exat?: never;
3520
+ pxat?: never;
3521
+ persist?: never;
3522
+ } | {
3523
+ ex?: never;
3524
+ px?: never;
3525
+ exat: number;
3526
+ pxat?: never;
3527
+ persist?: never;
3528
+ } | {
3529
+ ex?: never;
3530
+ px?: never;
3531
+ exat?: never;
3532
+ pxat: number;
3533
+ persist?: never;
3534
+ } | {
3535
+ ex?: never;
3536
+ px?: never;
3537
+ exat?: never;
3538
+ pxat?: never;
3539
+ persist: true;
3540
+ } | {
3541
+ ex?: never;
3542
+ px?: never;
3543
+ exat?: never;
3544
+ pxat?: never;
3545
+ persist?: never;
3546
+ }) | undefined) => Promise<TData | null>;
2903
3547
  /**
2904
3548
  * @see https://redis.io/commands/getrange
2905
3549
  */
@@ -2916,6 +3560,42 @@ declare class Redis {
2916
3560
  * @see https://redis.io/commands/hexists
2917
3561
  */
2918
3562
  hexists: (key: string, field: string) => Promise<number>;
3563
+ /**
3564
+ * @see https://redis.io/commands/hexpire
3565
+ */
3566
+ hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3567
+ /**
3568
+ * @see https://redis.io/commands/hexpireat
3569
+ */
3570
+ hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3571
+ /**
3572
+ * @see https://redis.io/commands/hexpiretime
3573
+ */
3574
+ hexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3575
+ /**
3576
+ * @see https://redis.io/commands/httl
3577
+ */
3578
+ httl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3579
+ /**
3580
+ * @see https://redis.io/commands/hpexpire
3581
+ */
3582
+ hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3583
+ /**
3584
+ * @see https://redis.io/commands/hpexpireat
3585
+ */
3586
+ hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
3587
+ /**
3588
+ * @see https://redis.io/commands/hpexpiretime
3589
+ */
3590
+ hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3591
+ /**
3592
+ * @see https://redis.io/commands/hpttl
3593
+ */
3594
+ hpttl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
3595
+ /**
3596
+ * @see https://redis.io/commands/hpersist
3597
+ */
3598
+ hpersist: (key: string, fields: string | number | (string | number)[]) => Promise<(1 | -2 | -1)[]>;
2919
3599
  /**
2920
3600
  * @see https://redis.io/commands/hget
2921
3601
  */
@@ -2947,9 +3627,7 @@ declare class Redis {
2947
3627
  /**
2948
3628
  * @see https://redis.io/commands/hmset
2949
3629
  */
2950
- hmset: <TData>(key: string, kv: {
2951
- [field: string]: TData;
2952
- }) => Promise<"OK">;
3630
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
2953
3631
  /**
2954
3632
  * @see https://redis.io/commands/hrandfield
2955
3633
  */
@@ -2965,9 +3643,7 @@ declare class Redis {
2965
3643
  /**
2966
3644
  * @see https://redis.io/commands/hset
2967
3645
  */
2968
- hset: <TData>(key: string, kv: {
2969
- [field: string]: TData;
2970
- }) => Promise<number>;
3646
+ hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
2971
3647
  /**
2972
3648
  * @see https://redis.io/commands/hsetnx
2973
3649
  */
@@ -3024,9 +3700,9 @@ declare class Redis {
3024
3700
  * @see https://redis.io/commands/lpos
3025
3701
  */
3026
3702
  lpos: <TData = number>(key: string, element: unknown, opts?: {
3027
- rank?: number | undefined;
3028
- count?: number | undefined;
3029
- maxLen?: number | undefined;
3703
+ rank?: number;
3704
+ count?: number;
3705
+ maxLen?: number;
3030
3706
  } | undefined) => Promise<TData>;
3031
3707
  /**
3032
3708
  * @see https://redis.io/commands/lpush
@@ -3059,15 +3735,11 @@ declare class Redis {
3059
3735
  /**
3060
3736
  * @see https://redis.io/commands/mset
3061
3737
  */
3062
- mset: <TData>(kv: {
3063
- [key: string]: TData;
3064
- }) => Promise<"OK">;
3738
+ mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
3065
3739
  /**
3066
3740
  * @see https://redis.io/commands/msetnx
3067
3741
  */
3068
- msetnx: <TData>(kv: {
3069
- [key: string]: TData;
3070
- }) => Promise<number>;
3742
+ msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
3071
3743
  /**
3072
3744
  * @see https://redis.io/commands/persist
3073
3745
  */
@@ -3075,11 +3747,11 @@ declare class Redis {
3075
3747
  /**
3076
3748
  * @see https://redis.io/commands/pexpire
3077
3749
  */
3078
- pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
3750
+ pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
3079
3751
  /**
3080
3752
  * @see https://redis.io/commands/pexpireat
3081
3753
  */
3082
- pexpireat: (key: string, unix: number) => Promise<0 | 1>;
3754
+ pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
3083
3755
  /**
3084
3756
  * @see https://redis.io/commands/pfadd
3085
3757
  */
@@ -3100,6 +3772,10 @@ declare class Redis {
3100
3772
  * @see https://redis.io/commands/psetex
3101
3773
  */
3102
3774
  psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
3775
+ /**
3776
+ * @see https://redis.io/commands/psubscribe
3777
+ */
3778
+ psubscribe: <TMessage>(patterns: string | string[]) => Subscriber<TMessage>;
3103
3779
  /**
3104
3780
  * @see https://redis.io/commands/pttl
3105
3781
  */
@@ -3135,11 +3811,14 @@ declare class Redis {
3135
3811
  /**
3136
3812
  * @see https://redis.io/commands/sadd
3137
3813
  */
3138
- sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
3814
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
3139
3815
  /**
3140
3816
  * @see https://redis.io/commands/scan
3141
3817
  */
3142
- scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
3818
+ scan(cursor: string | number): Promise<ScanResultStandard>;
3819
+ scan<TOptions extends ScanCommandOptions>(cursor: string | number, opts: TOptions): Promise<TOptions extends {
3820
+ withType: true;
3821
+ } ? ScanResultWithType : ScanResultStandard>;
3143
3822
  /**
3144
3823
  * @see https://redis.io/commands/scard
3145
3824
  */
@@ -3228,6 +3907,10 @@ declare class Redis {
3228
3907
  * @see https://redis.io/commands/strlen
3229
3908
  */
3230
3909
  strlen: (key: string) => Promise<number>;
3910
+ /**
3911
+ * @see https://redis.io/commands/subscribe
3912
+ */
3913
+ subscribe: <TMessage>(channels: string | string[]) => Subscriber<TMessage>;
3231
3914
  /**
3232
3915
  * @see https://redis.io/commands/sunion
3233
3916
  */
@@ -3259,11 +3942,9 @@ declare class Redis {
3259
3942
  /**
3260
3943
  * @see https://redis.io/commands/xadd
3261
3944
  */
3262
- xadd: (key: string, id: string, entries: {
3263
- [field: string]: unknown;
3264
- }, opts?: {
3265
- nomkStream?: boolean | undefined;
3266
- trim?: (({
3945
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
3946
+ nomkStream?: boolean;
3947
+ trim?: ({
3267
3948
  type: "MAXLEN" | "maxlen";
3268
3949
  threshold: number;
3269
3950
  } | {
@@ -3271,11 +3952,11 @@ declare class Redis {
3271
3952
  threshold: string;
3272
3953
  }) & ({
3273
3954
  comparison: "~";
3274
- limit?: number | undefined;
3955
+ limit?: number;
3275
3956
  } | {
3276
3957
  comparison: "=";
3277
- limit?: undefined;
3278
- })) | undefined;
3958
+ limit?: never;
3959
+ });
3279
3960
  } | undefined) => Promise<string>;
3280
3961
  /**
3281
3962
  * @see https://redis.io/commands/xack
@@ -3291,11 +3972,11 @@ declare class Redis {
3291
3972
  xgroup: (key: string, opts: {
3292
3973
  type: "CREATE";
3293
3974
  group: string;
3294
- id: string;
3975
+ id: `$` | string;
3295
3976
  options?: {
3296
- MKSTREAM?: boolean | undefined;
3297
- ENTRIESREAD?: number | undefined;
3298
- } | undefined;
3977
+ MKSTREAM?: boolean;
3978
+ ENTRIESREAD?: number;
3979
+ };
3299
3980
  } | {
3300
3981
  type: "CREATECONSUMER";
3301
3982
  group: string;
@@ -3310,10 +3991,10 @@ declare class Redis {
3310
3991
  } | {
3311
3992
  type: "SETID";
3312
3993
  group: string;
3313
- id: string;
3994
+ id: `$` | string;
3314
3995
  options?: {
3315
- ENTRIESREAD?: number | undefined;
3316
- } | undefined;
3996
+ ENTRIESREAD?: number;
3997
+ };
3317
3998
  }) => Promise<never>;
3318
3999
  /**
3319
4000
  * @see https://redis.io/commands/xread
@@ -3340,35 +4021,35 @@ declare class Redis {
3340
4021
  * @see https://redis.io/commands/xpending
3341
4022
  */
3342
4023
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3343
- idleTime?: number | undefined;
3344
- consumer?: string | string[] | undefined;
4024
+ idleTime?: number;
4025
+ consumer?: string | string[];
3345
4026
  } | undefined) => Promise<unknown[]>;
3346
4027
  /**
3347
4028
  * @see https://redis.io/commands/xclaim
3348
4029
  */
3349
4030
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3350
- idleMS?: number | undefined;
3351
- timeMS?: number | undefined;
3352
- retryCount?: number | undefined;
3353
- force?: boolean | undefined;
3354
- justId?: boolean | undefined;
3355
- lastId?: number | undefined;
4031
+ idleMS?: number;
4032
+ timeMS?: number;
4033
+ retryCount?: number;
4034
+ force?: boolean;
4035
+ justId?: boolean;
4036
+ lastId?: number;
3356
4037
  } | undefined) => Promise<unknown[]>;
3357
4038
  /**
3358
4039
  * @see https://redis.io/commands/xautoclaim
3359
4040
  */
3360
4041
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3361
- count?: number | undefined;
3362
- justId?: boolean | undefined;
4042
+ count?: number;
4043
+ justId?: boolean;
3363
4044
  } | undefined) => Promise<unknown[]>;
3364
4045
  /**
3365
4046
  * @see https://redis.io/commands/xtrim
3366
4047
  */
3367
4048
  xtrim: (key: string, options: {
3368
4049
  strategy: "MAXLEN" | "MINID";
3369
- exactness?: "~" | "=" | undefined;
3370
- threshold: string | number;
3371
- limit?: number | undefined;
4050
+ exactness?: "~" | "=";
4051
+ threshold: number | string;
4052
+ limit?: number;
3372
4053
  }) => Promise<number>;
3373
4054
  /**
3374
4055
  * @see https://redis.io/commands/xrange
@@ -3381,11 +4062,7 @@ declare class Redis {
3381
4062
  /**
3382
4063
  * @see https://redis.io/commands/zadd
3383
4064
  */
3384
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
3385
- key: string,
3386
- opts: ZAddCommandOptions,
3387
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
3388
- ]) => Promise<number | null>;
4065
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
3389
4066
  /**
3390
4067
  * @see https://redis.io/commands/zcard
3391
4068
  */
@@ -3425,21 +4102,11 @@ declare class Redis {
3425
4102
  /**
3426
4103
  * @see https://redis.io/commands/zrange
3427
4104
  */
3428
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3429
- key: string,
3430
- min: `(${string}` | `[${string}` | "-" | "+",
3431
- max: `(${string}` | `[${string}` | "-" | "+",
3432
- opts: {
3433
- byLex: true;
3434
- } & ZRangeCommandOptions
3435
- ] | [
3436
- key: string,
3437
- min: number | `(${number}` | "-inf" | "+inf",
3438
- max: number | `(${number}` | "-inf" | "+inf",
3439
- opts: {
3440
- byScore: true;
3441
- } & ZRangeCommandOptions
3442
- ]) => Promise<TData>;
4105
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
4106
+ byLex: true;
4107
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
4108
+ byScore: true;
4109
+ } & ZRangeCommandOptions]) => Promise<TData>;
3443
4110
  /**
3444
4111
  * @see https://redis.io/commands/zrank
3445
4112
  */
@@ -3459,7 +4126,7 @@ declare class Redis {
3459
4126
  /**
3460
4127
  * @see https://redis.io/commands/zremrangebyscore
3461
4128
  */
3462
- zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
4129
+ zremrangebyscore: (key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf") => Promise<number>;
3463
4130
  /**
3464
4131
  * @see https://redis.io/commands/zrevrank
3465
4132
  */
@@ -3482,25 +4149,28 @@ declare class Redis {
3482
4149
  zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3483
4150
  }
3484
4151
 
4152
+ type UpstashErrorOptions = Pick<NonNullable<ConstructorParameters<typeof Error>[1]>, "cause">;
3485
4153
  /**
3486
4154
  * Result of a bad request to upstash
3487
4155
  */
3488
4156
  declare class UpstashError extends Error {
3489
- constructor(message: string);
4157
+ constructor(message: string, options?: ErrorOptions);
3490
4158
  }
3491
4159
  declare class UrlError extends Error {
3492
4160
  constructor(url: string);
3493
4161
  }
4162
+ declare class UpstashJSONParseError extends UpstashError {
4163
+ constructor(body: string, options?: UpstashErrorOptions);
4164
+ }
3494
4165
 
3495
4166
  type error_UpstashError = UpstashError;
3496
4167
  declare const error_UpstashError: typeof UpstashError;
4168
+ type error_UpstashJSONParseError = UpstashJSONParseError;
4169
+ declare const error_UpstashJSONParseError: typeof UpstashJSONParseError;
3497
4170
  type error_UrlError = UrlError;
3498
4171
  declare const error_UrlError: typeof UrlError;
3499
4172
  declare namespace error {
3500
- export {
3501
- error_UpstashError as UpstashError,
3502
- error_UrlError as UrlError,
3503
- };
4173
+ export { error_UpstashError as UpstashError, error_UpstashJSONParseError as UpstashJSONParseError, error_UrlError as UrlError };
3504
4174
  }
3505
4175
 
3506
4176
  /**
@@ -3517,4 +4187,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
3517
4187
  constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3518
4188
  }
3519
4189
 
3520
- export { HValsCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetRangeCommand as H, GetSetCommand as I, HDelCommand as J, HExistsCommand as K, HGetCommand as L, HGetAllCommand as M, HIncrByCommand as N, HIncrByFloatCommand as O, Pipeline as P, HKeysCommand as Q, RedisOptions as R, HLenCommand as S, HMGetCommand as T, UpstashRequest as U, HMSetCommand as V, HRandFieldCommand as W, HScanCommand as X, HSetCommand as Y, HSetNXCommand as Z, HStrLenCommand as _, RequesterConfig as a, SetBitCommand as a$, IncrCommand as a0, IncrByCommand as a1, IncrByFloatCommand as a2, JsonArrAppendCommand as a3, JsonArrIndexCommand as a4, JsonArrInsertCommand as a5, JsonArrLenCommand as a6, JsonArrPopCommand as a7, JsonArrTrimCommand as a8, JsonClearCommand as a9, MGetCommand as aA, MSetCommand as aB, MSetNXCommand as aC, PersistCommand as aD, PExpireCommand as aE, PExpireAtCommand as aF, PingCommand as aG, PSetEXCommand as aH, PTtlCommand as aI, PublishCommand as aJ, RandomKeyCommand as aK, RenameCommand as aL, RenameNXCommand as aM, RPopCommand as aN, RPushCommand as aO, RPushXCommand as aP, SAddCommand as aQ, ScanCommand as aR, ScanCommandOptions as aS, SCardCommand as aT, ScriptExistsCommand as aU, ScriptFlushCommand as aV, ScriptLoadCommand as aW, SDiffCommand as aX, SDiffStoreCommand as aY, SetCommand as aZ, SetCommandOptions as a_, JsonDelCommand as aa, JsonForgetCommand as ab, JsonGetCommand as ac, JsonMGetCommand as ad, JsonNumIncrByCommand as ae, JsonNumMultByCommand as af, JsonObjKeysCommand as ag, JsonObjLenCommand as ah, JsonRespCommand as ai, JsonSetCommand as aj, JsonStrAppendCommand as ak, JsonStrLenCommand as al, JsonToggleCommand as am, JsonTypeCommand as an, KeysCommand as ao, LIndexCommand as ap, LInsertCommand as aq, LLenCommand as ar, LMoveCommand as as, LPopCommand as at, LPushCommand as au, LPushXCommand as av, LRangeCommand as aw, LRemCommand as ax, LSetCommand as ay, LTrimCommand as az, Redis as b, SetExCommand as b0, SetNxCommand as b1, SetRangeCommand as b2, SInterCommand as b3, SInterStoreCommand as b4, SIsMemberCommand as b5, SMembersCommand as b6, SMIsMemberCommand as b7, SMoveCommand as b8, SPopCommand as b9, ZPopMinCommand as bA, ZRangeCommand as bB, ZRangeCommandOptions as bC, ZRankCommand as bD, ZRemCommand as bE, ZRemRangeByLexCommand as bF, ZRemRangeByRankCommand as bG, ZRemRangeByScoreCommand as bH, ZRevRankCommand as bI, ZScanCommand as bJ, ZScoreCommand as bK, ZUnionCommand as bL, ZUnionCommandOptions as bM, ZUnionStoreCommand as bN, ZUnionStoreCommandOptions as bO, SRandMemberCommand as ba, SRemCommand as bb, SScanCommand as bc, StrLenCommand as bd, SUnionCommand as be, SUnionStoreCommand as bf, TimeCommand as bg, TouchCommand as bh, TtlCommand as bi, Type as bj, TypeCommand as bk, UnlinkCommand as bl, XAddCommand as bm, XRangeCommand as bn, ScoreMember as bo, ZAddCommandOptions as bp, ZAddCommand as bq, ZCardCommand as br, ZCountCommand as bs, ZDiffStoreCommand as bt, ZIncrByCommand as bu, ZInterStoreCommand as bv, ZInterStoreCommandOptions as bw, ZLexCountCommand as bx, ZMScoreCommand as by, ZPopMaxCommand as bz, Requester as c, UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalCommand as k, EvalshaCommand as l, ExistsCommand as m, ExpireCommand as n, ExpireAtCommand as o, FlushDBCommand as p, GeoAddCommandOptions as q, GeoMember as r, GeoDistCommand as s, GeoHashCommand as t, GeoPosCommand as u, GeoSearchCommand as v, GeoSearchStoreCommand as w, GetCommand as x, GetBitCommand as y, GetDelCommand as z };
4190
+ export { HPersistCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, type HttpClientConfig as H, GetCommand as I, GetBitCommand as J, GetDelCommand as K, GetExCommand as L, GetRangeCommand as M, GetSetCommand as N, HDelCommand as O, Pipeline as P, HExistsCommand as Q, type RedisOptions as R, HExpireCommand as S, HExpireAtCommand as T, type UpstashRequest as U, HExpireTimeCommand as V, HTtlCommand as W, HPExpireCommand as X, HPExpireAtCommand as Y, HPExpireTimeCommand as Z, HPTtlCommand as _, type RequesterConfig as a, RenameNXCommand as a$, HGetCommand as a0, HGetAllCommand as a1, HIncrByCommand as a2, HIncrByFloatCommand as a3, HKeysCommand as a4, HLenCommand as a5, HMGetCommand as a6, HMSetCommand as a7, HRandFieldCommand as a8, HScanCommand as a9, JsonStrLenCommand as aA, JsonToggleCommand as aB, JsonTypeCommand as aC, KeysCommand as aD, LIndexCommand as aE, LInsertCommand as aF, LLenCommand as aG, LMoveCommand as aH, LPopCommand as aI, LPushCommand as aJ, LPushXCommand as aK, LRangeCommand as aL, LRemCommand as aM, LSetCommand as aN, LTrimCommand as aO, MGetCommand as aP, MSetCommand as aQ, MSetNXCommand as aR, PersistCommand as aS, PExpireCommand as aT, PExpireAtCommand as aU, PingCommand as aV, PSetEXCommand as aW, PTtlCommand as aX, PublishCommand as aY, RandomKeyCommand as aZ, RenameCommand as a_, HSetCommand as aa, HSetNXCommand as ab, HStrLenCommand as ac, HValsCommand as ad, IncrCommand as ae, IncrByCommand as af, IncrByFloatCommand as ag, JsonArrAppendCommand as ah, JsonArrIndexCommand as ai, JsonArrInsertCommand as aj, JsonArrLenCommand as ak, JsonArrPopCommand as al, JsonArrTrimCommand as am, JsonClearCommand as an, JsonDelCommand as ao, JsonForgetCommand as ap, JsonGetCommand as aq, JsonMergeCommand as ar, JsonMGetCommand as as, JsonNumIncrByCommand as at, JsonNumMultByCommand as au, JsonObjKeysCommand as av, JsonObjLenCommand as aw, JsonRespCommand as ax, JsonSetCommand as ay, JsonStrAppendCommand as az, Redis as b, type ZUnionCommandOptions as b$, RPopCommand as b0, RPushCommand as b1, RPushXCommand as b2, SAddCommand as b3, ScanCommand as b4, type ScanCommandOptions as b5, SCardCommand as b6, ScriptExistsCommand as b7, ScriptFlushCommand as b8, ScriptLoadCommand as b9, UnlinkCommand as bA, XAddCommand as bB, XRangeCommand as bC, type ScoreMember as bD, type ZAddCommandOptions as bE, ZAddCommand as bF, ZCardCommand as bG, ZCountCommand as bH, ZDiffStoreCommand as bI, ZIncrByCommand as bJ, ZInterStoreCommand as bK, type ZInterStoreCommandOptions as bL, ZLexCountCommand as bM, ZMScoreCommand as bN, ZPopMaxCommand as bO, ZPopMinCommand as bP, ZRangeCommand as bQ, type ZRangeCommandOptions as bR, ZRankCommand as bS, ZRemCommand as bT, ZRemRangeByLexCommand as bU, ZRemRangeByRankCommand as bV, ZRemRangeByScoreCommand as bW, ZRevRankCommand as bX, ZScanCommand as bY, ZScoreCommand as bZ, ZUnionCommand as b_, SDiffCommand as ba, SDiffStoreCommand as bb, SetCommand as bc, type SetCommandOptions as bd, SetBitCommand as be, SetExCommand as bf, SetNxCommand as bg, SetRangeCommand as bh, SInterCommand as bi, SInterStoreCommand as bj, SIsMemberCommand as bk, SMembersCommand as bl, SMIsMemberCommand as bm, SMoveCommand as bn, SPopCommand as bo, SRandMemberCommand as bp, SRemCommand as bq, SScanCommand as br, StrLenCommand as bs, SUnionCommand as bt, SUnionStoreCommand as bu, TimeCommand as bv, TouchCommand as bw, TtlCommand as bx, type Type as by, TypeCommand as bz, type Requester as c, ZUnionStoreCommand as c0, type ZUnionStoreCommandOptions as c1, type UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalROCommand as k, EvalCommand as l, EvalshaROCommand as m, EvalshaCommand as n, ExistsCommand as o, ExpireCommand as p, type ExpireOption as q, ExpireAtCommand as r, FlushDBCommand as s, type GeoAddCommandOptions as t, type GeoMember as u, GeoDistCommand as v, GeoHashCommand as w, GeoPosCommand as x, GeoSearchCommand as y, GeoSearchStoreCommand as z };