@upstash/redis 0.0.0-ci.ac6f459d7451c0be8ce0234d47abd3cc9da06b3c-20240722001629 → 0.0.0-ci.ad5be1ba2d5a9fb932176239f1a30ecd48450c0a-20250220103021

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.
@@ -26,6 +26,7 @@ type RedisOptions = {
26
26
  latencyLogging?: boolean;
27
27
  enableTelemetry?: boolean;
28
28
  enableAutoPipelining?: boolean;
29
+ readYourWrites?: boolean;
29
30
  };
30
31
 
31
32
  type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
@@ -35,12 +36,37 @@ type UpstashRequest = {
35
36
  * Request body will be serialized to json
36
37
  */
37
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;
38
56
  };
39
57
  type UpstashResponse<TResult> = {
40
58
  result?: TResult;
41
59
  error?: string;
42
60
  };
43
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;
44
70
  request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
45
71
  }
46
72
  type RetryConfig = false | {
@@ -109,6 +135,31 @@ type CommandOptions<TResult, TData> = {
109
135
  */
110
136
  automaticDeserialization?: boolean;
111
137
  latencyLogging?: boolean;
138
+ /**
139
+ * Additional headers to be sent with the request
140
+ */
141
+ headers?: Record<string, string>;
142
+ /**
143
+ * Path to append to the URL
144
+ */
145
+ path?: string[];
146
+ /**
147
+ * Options for streaming requests, mainly used for subscribe, monitor commands
148
+ **/
149
+ streamOptions?: {
150
+ /**
151
+ * Callback to be called when a message is received
152
+ */
153
+ onMessage?: (data: string) => void;
154
+ /**
155
+ * Whether the request is streaming
156
+ */
157
+ isStreaming?: boolean;
158
+ /**
159
+ * Signal to abort the request
160
+ */
161
+ signal?: AbortSignal;
162
+ };
112
163
  };
113
164
  /**
114
165
  * Command offers default (de)serialization and the exec method to all commands.
@@ -120,6 +171,11 @@ declare class Command<TResult, TData> {
120
171
  readonly command: (string | number | boolean)[];
121
172
  readonly serialize: Serialize;
122
173
  readonly deserialize: Deserialize<TResult, TData>;
174
+ protected readonly headers?: Record<string, string>;
175
+ protected readonly path?: string[];
176
+ protected readonly onMessage?: (data: string) => void;
177
+ protected readonly isStreaming: boolean;
178
+ protected readonly signal?: AbortSignal;
123
179
  /**
124
180
  * Create a new command instance.
125
181
  *
@@ -132,8 +188,7 @@ declare class Command<TResult, TData> {
132
188
  exec(client: Requester): Promise<TData>;
133
189
  }
134
190
 
135
- type ZUnionCommandOptions = {
136
- withScores?: boolean;
191
+ type ZUnionStoreCommandOptions = {
137
192
  aggregate?: "sum" | "min" | "max";
138
193
  } & ({
139
194
  weight: number;
@@ -146,14 +201,15 @@ type ZUnionCommandOptions = {
146
201
  weights?: never;
147
202
  });
148
203
  /**
149
- * @see https://redis.io/commands/zunion
204
+ * @see https://redis.io/commands/zunionstore
150
205
  */
151
- declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
152
- constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
153
- constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
206
+ declare class ZUnionStoreCommand extends Command<number, number> {
207
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
208
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
154
209
  }
155
210
 
156
- type ZUnionStoreCommandOptions = {
211
+ type ZUnionCommandOptions = {
212
+ withScores?: boolean;
157
213
  aggregate?: "sum" | "min" | "max";
158
214
  } & ({
159
215
  weight: number;
@@ -166,11 +222,11 @@ type ZUnionStoreCommandOptions = {
166
222
  weights?: never;
167
223
  });
168
224
  /**
169
- * @see https://redis.io/commands/zunionstore
225
+ * @see https://redis.io/commands/zunion
170
226
  */
171
- declare class ZUnionStoreCommand extends Command<number, number> {
172
- constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
173
- constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
227
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
228
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
229
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
174
230
  }
175
231
 
176
232
  type ZInterStoreCommandOptions = {
@@ -236,11 +292,11 @@ type GeoAddCommandOptions = {
236
292
  } & {
237
293
  ch?: boolean;
238
294
  });
239
- interface GeoMember<TMemberType> {
295
+ type GeoMember<TMemberType> = {
240
296
  latitude: number;
241
297
  longitude: number;
242
298
  member: TMemberType;
243
- }
299
+ };
244
300
  /**
245
301
  * @see https://redis.io/commands/geoadd
246
302
  */
@@ -270,7 +326,7 @@ declare class BitCountCommand extends Command<number, number> {
270
326
  type SubCommandArgs<TRest extends unknown[] = []> = [
271
327
  encoding: string,
272
328
  offset: number | string,
273
- ...TRest
329
+ ...rest: TRest
274
330
  ];
275
331
  /**
276
332
  * @see https://redis.io/commands/bitfield
@@ -415,7 +471,7 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
415
471
  * @see https://redis.io/commands/geohash
416
472
  */
417
473
  declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
418
- constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
474
+ constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
419
475
  }
420
476
 
421
477
  type Coordinates = {
@@ -553,6 +609,50 @@ declare class GetDelCommand<TData = string> extends Command<unknown | null, TDat
553
609
  constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
554
610
  }
555
611
 
612
+ type GetExCommandOptions = {
613
+ ex: number;
614
+ px?: never;
615
+ exat?: never;
616
+ pxat?: never;
617
+ persist?: never;
618
+ } | {
619
+ ex?: never;
620
+ px: number;
621
+ exat?: never;
622
+ pxat?: never;
623
+ persist?: never;
624
+ } | {
625
+ ex?: never;
626
+ px?: never;
627
+ exat: number;
628
+ pxat?: never;
629
+ persist?: never;
630
+ } | {
631
+ ex?: never;
632
+ px?: never;
633
+ exat?: never;
634
+ pxat: number;
635
+ persist?: never;
636
+ } | {
637
+ ex?: never;
638
+ px?: never;
639
+ exat?: never;
640
+ pxat?: never;
641
+ persist: true;
642
+ } | {
643
+ ex?: never;
644
+ px?: never;
645
+ exat?: never;
646
+ pxat?: never;
647
+ persist?: never;
648
+ };
649
+ /**
650
+ * @see https://redis.io/commands/getex
651
+ */
652
+ declare class GetExCommand<TData = string> extends Command<unknown | null, TData | null> {
653
+ constructor([key, opts]: [key: string, opts?: GetExCommandOptions], cmdOpts?: CommandOptions<unknown | null, TData | null>);
654
+ }
655
+
556
656
  /**
557
657
  * @see https://redis.io/commands/getrange
558
658
  */
@@ -642,9 +742,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
642
742
  * @see https://redis.io/commands/hmset
643
743
  */
644
744
  declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
645
- constructor([key, kv]: [key: string, kv: {
646
- [field: string]: TData;
647
- }], opts?: CommandOptions<"OK", "OK">);
745
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
648
746
  }
649
747
 
650
748
  /**
@@ -673,9 +771,7 @@ declare class HScanCommand extends Command<[
673
771
  * @see https://redis.io/commands/hset
674
772
  */
675
773
  declare class HSetCommand<TData> extends Command<number, number> {
676
- constructor([key, kv]: [key: string, kv: {
677
- [field: string]: TData;
678
- }], opts?: CommandOptions<number, number>);
774
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
679
775
  }
680
776
 
681
777
  /**
@@ -805,6 +901,17 @@ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
805
901
  constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
806
902
  }
807
903
 
904
+ /**
905
+ * @see https://redis.io/commands/json.mset
906
+ */
907
+ declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
908
+ constructor(cmd: {
909
+ key: string;
910
+ path: string;
911
+ value: TData;
912
+ }[], opts?: CommandOptions<"OK" | null, "OK" | null>);
913
+ }
914
+
808
915
  /**
809
916
  * @see https://redis.io/commands/json.numincrby
810
917
  */
@@ -961,25 +1068,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
961
1068
  * @see https://redis.io/commands/mget
962
1069
  */
963
1070
  declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
964
- constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
1071
+ constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
965
1072
  }
966
1073
 
967
1074
  /**
968
1075
  * @see https://redis.io/commands/mset
969
1076
  */
970
1077
  declare class MSetCommand<TData> extends Command<"OK", "OK"> {
971
- constructor([kv]: [kv: {
972
- [key: string]: TData;
973
- }], opts?: CommandOptions<"OK", "OK">);
1078
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
974
1079
  }
975
1080
 
976
1081
  /**
977
1082
  * @see https://redis.io/commands/msetnx
978
1083
  */
979
1084
  declare class MSetNXCommand<TData = string> extends Command<number, number> {
980
- constructor([kv]: [kv: {
981
- [key: string]: TData;
982
- }], opts?: CommandOptions<number, number>);
1085
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
983
1086
  }
984
1087
 
985
1088
  /**
@@ -1077,7 +1180,7 @@ declare class RPushXCommand<TData = string> extends Command<number, number> {
1077
1180
  * @see https://redis.io/commands/sadd
1078
1181
  */
1079
1182
  declare class SAddCommand<TData = string> extends Command<number, number> {
1080
- constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1183
+ constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
1081
1184
  }
1082
1185
 
1083
1186
  /**
@@ -1346,9 +1449,7 @@ declare class XAddCommand extends Command<string, string> {
1346
1449
  constructor([key, id, entries, opts]: [
1347
1450
  key: string,
1348
1451
  id: "*" | string,
1349
- entries: {
1350
- [field: string]: unknown;
1351
- },
1452
+ entries: Record<string, unknown>,
1352
1453
  opts?: XAddCommandOptions
1353
1454
  ], commandOptions?: CommandOptions<string, string>);
1354
1455
  }
@@ -1588,9 +1689,61 @@ declare class ZScoreCommand<TData> extends Command<string | null, number | null>
1588
1689
  constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1589
1690
  }
1590
1691
 
1692
+ type MessageEvent = {
1693
+ type: string;
1694
+ data: any;
1695
+ channel?: string;
1696
+ };
1697
+ type Listener = (event: MessageEvent["data"]) => void;
1698
+ declare class Subscriber extends EventTarget {
1699
+ private subscriptions;
1700
+ private client;
1701
+ private listeners;
1702
+ constructor(client: Requester, channels: string[]);
1703
+ private subscribeToChannel;
1704
+ private dispatchToListeners;
1705
+ on(type: string, listener: Listener): void;
1706
+ removeAllListeners(): void;
1707
+ unsubscribe(channels?: string[]): Promise<void>;
1708
+ getSubscribedChannels(): string[];
1709
+ }
1710
+
1591
1711
  type InferResponseData<T extends unknown[]> = {
1592
1712
  [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1593
1713
  };
1714
+ interface ExecMethod<TCommands extends Command<any, any>[]> {
1715
+ /**
1716
+ * Send the pipeline request to upstash.
1717
+ *
1718
+ * Returns an array with the results of all pipelined commands.
1719
+ *
1720
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1721
+ * ```ts
1722
+ * const p = redis.pipeline()
1723
+ * p.get("key")
1724
+ * const result = p.exec<[{ greeting: string }]>()
1725
+ * ```
1726
+ *
1727
+ * 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.
1728
+ *
1729
+ * 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 }`.
1730
+ *
1731
+ * ```ts
1732
+ * const p = redis.pipeline()
1733
+ * p.get("key")
1734
+ *
1735
+ * const result = await p.exec({ keepErrors: true });
1736
+ * const getResult = result[0].result
1737
+ * const getError = result[0].error
1738
+ * ```
1739
+ */
1740
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(): Promise<TCommandResults>;
1741
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(options: {
1742
+ keepErrors: true;
1743
+ }): Promise<{
1744
+ [K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]>;
1745
+ }>;
1746
+ }
1594
1747
  /**
1595
1748
  * Upstash REST API supports command pipelining to send multiple commands in
1596
1749
  * batch, instead of sending each command one by one and waiting for a response.
@@ -1639,19 +1792,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1639
1792
  commandOptions?: CommandOptions<any, any>;
1640
1793
  multiExec?: boolean;
1641
1794
  });
1642
- /**
1643
- * Send the pipeline request to upstash.
1644
- *
1645
- * Returns an array with the results of all pipelined commands.
1646
- *
1647
- * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1648
- * ```ts
1649
- * const p = redis.pipeline()
1650
- * p.get("key")
1651
- * const result = p.exec<[{ greeting: string }]>()
1652
- * ```
1653
- */
1654
- exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
1795
+ exec: ExecMethod<TCommands>;
1655
1796
  /**
1656
1797
  * Returns the length of pipeline before the execution
1657
1798
  */
@@ -1755,7 +1896,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1755
1896
  * @see https://redis.io/commands/flushdb
1756
1897
  */
1757
1898
  flushdb: (opts?: {
1758
- async?: boolean | undefined;
1899
+ async?: boolean;
1759
1900
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1760
1901
  /**
1761
1902
  * @see https://redis.io/commands/geoadd
@@ -1802,11 +1943,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1802
1943
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1803
1944
  count?: {
1804
1945
  limit: number;
1805
- any?: boolean | undefined;
1806
- } | undefined;
1807
- withCoord?: boolean | undefined;
1808
- withDist?: boolean | undefined;
1809
- withHash?: boolean | undefined;
1946
+ any?: boolean;
1947
+ };
1948
+ withCoord?: boolean;
1949
+ withDist?: boolean;
1950
+ withHash?: boolean;
1810
1951
  } | undefined) => Pipeline<[...TCommands, Command<any, ({
1811
1952
  member: TData;
1812
1953
  } & {
@@ -1843,9 +1984,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1843
1984
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1844
1985
  count?: {
1845
1986
  limit: number;
1846
- any?: boolean | undefined;
1847
- } | undefined;
1848
- storeDist?: boolean | undefined;
1987
+ any?: boolean;
1988
+ };
1989
+ storeDist?: boolean;
1849
1990
  } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1850
1991
  /**
1851
1992
  * @see https://redis.io/commands/get
@@ -1859,6 +2000,46 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1859
2000
  * @see https://redis.io/commands/getdel
1860
2001
  */
1861
2002
  getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2003
+ /**
2004
+ * @see https://redis.io/commands/getex
2005
+ */
2006
+ getex: <TData>(key: string, opts?: ({
2007
+ ex: number;
2008
+ px?: never;
2009
+ exat?: never;
2010
+ pxat?: never;
2011
+ persist?: never;
2012
+ } | {
2013
+ ex?: never;
2014
+ px: number;
2015
+ exat?: never;
2016
+ pxat?: never;
2017
+ persist?: never;
2018
+ } | {
2019
+ ex?: never;
2020
+ px?: never;
2021
+ exat: number;
2022
+ pxat?: never;
2023
+ persist?: never;
2024
+ } | {
2025
+ ex?: never;
2026
+ px?: never;
2027
+ exat?: never;
2028
+ pxat: number;
2029
+ persist?: never;
2030
+ } | {
2031
+ ex?: never;
2032
+ px?: never;
2033
+ exat?: never;
2034
+ pxat?: never;
2035
+ persist: true;
2036
+ } | {
2037
+ ex?: never;
2038
+ px?: never;
2039
+ exat?: never;
2040
+ pxat?: never;
2041
+ persist?: never;
2042
+ }) | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1862
2043
  /**
1863
2044
  * @see https://redis.io/commands/getrange
1864
2045
  */
@@ -1906,13 +2087,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1906
2087
  /**
1907
2088
  * @see https://redis.io/commands/hmset
1908
2089
  */
1909
- hmset: <TData>(key: string, kv: {
1910
- [field: string]: TData;
1911
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2090
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1912
2091
  /**
1913
2092
  * @see https://redis.io/commands/hrandfield
1914
2093
  */
1915
- hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
2094
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1916
2095
  /**
1917
2096
  * @see https://redis.io/commands/hscan
1918
2097
  */
@@ -1920,9 +2099,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1920
2099
  /**
1921
2100
  * @see https://redis.io/commands/hset
1922
2101
  */
1923
- hset: <TData>(key: string, kv: {
1924
- [field: string]: TData;
1925
- }) => Pipeline<[...TCommands, Command<any, number>]>;
2102
+ hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
1926
2103
  /**
1927
2104
  * @see https://redis.io/commands/hsetnx
1928
2105
  */
@@ -1979,9 +2156,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1979
2156
  * @see https://redis.io/commands/lpos
1980
2157
  */
1981
2158
  lpos: <TData>(key: string, element: unknown, opts?: {
1982
- rank?: number | undefined;
1983
- count?: number | undefined;
1984
- maxLen?: number | undefined;
2159
+ rank?: number;
2160
+ count?: number;
2161
+ maxLen?: number;
1985
2162
  } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1986
2163
  /**
1987
2164
  * @see https://redis.io/commands/lpush
@@ -2014,15 +2191,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2014
2191
  /**
2015
2192
  * @see https://redis.io/commands/mset
2016
2193
  */
2017
- mset: <TData>(kv: {
2018
- [key: string]: TData;
2019
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2194
+ mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2020
2195
  /**
2021
2196
  * @see https://redis.io/commands/msetnx
2022
2197
  */
2023
- msetnx: <TData>(kv: {
2024
- [key: string]: TData;
2025
- }) => Pipeline<[...TCommands, Command<any, number>]>;
2198
+ msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2026
2199
  /**
2027
2200
  * @see https://redis.io/commands/persist
2028
2201
  */
@@ -2090,7 +2263,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2090
2263
  /**
2091
2264
  * @see https://redis.io/commands/sadd
2092
2265
  */
2093
- sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2266
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2094
2267
  /**
2095
2268
  * @see https://redis.io/commands/scan
2096
2269
  */
@@ -2211,19 +2384,13 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2211
2384
  /**
2212
2385
  * @see https://redis.io/commands/zadd
2213
2386
  */
2214
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
2215
- key: string,
2216
- opts: ZAddCommandOptions,
2217
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
2218
- ]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2387
+ 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>]>;
2219
2388
  /**
2220
2389
  * @see https://redis.io/commands/xadd
2221
2390
  */
2222
- xadd: (key: string, id: string, entries: {
2223
- [field: string]: unknown;
2224
- }, opts?: {
2225
- nomkStream?: boolean | undefined;
2226
- trim?: (({
2391
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
2392
+ nomkStream?: boolean;
2393
+ trim?: ({
2227
2394
  type: "MAXLEN" | "maxlen";
2228
2395
  threshold: number;
2229
2396
  } | {
@@ -2231,11 +2398,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2231
2398
  threshold: string;
2232
2399
  }) & ({
2233
2400
  comparison: "~";
2234
- limit?: number | undefined;
2401
+ limit?: number;
2235
2402
  } | {
2236
2403
  comparison: "=";
2237
- limit?: undefined;
2238
- })) | undefined;
2404
+ limit?: never;
2405
+ });
2239
2406
  } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2240
2407
  /**
2241
2408
  * @see https://redis.io/commands/xack
@@ -2251,11 +2418,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2251
2418
  xgroup: (key: string, opts: {
2252
2419
  type: "CREATE";
2253
2420
  group: string;
2254
- id: string;
2421
+ id: `$` | string;
2255
2422
  options?: {
2256
- MKSTREAM?: boolean | undefined;
2257
- ENTRIESREAD?: number | undefined;
2258
- } | undefined;
2423
+ MKSTREAM?: boolean;
2424
+ ENTRIESREAD?: number;
2425
+ };
2259
2426
  } | {
2260
2427
  type: "CREATECONSUMER";
2261
2428
  group: string;
@@ -2270,10 +2437,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2270
2437
  } | {
2271
2438
  type: "SETID";
2272
2439
  group: string;
2273
- id: string;
2440
+ id: `$` | string;
2274
2441
  options?: {
2275
- ENTRIESREAD?: number | undefined;
2276
- } | undefined;
2442
+ ENTRIESREAD?: number;
2443
+ };
2277
2444
  }) => Pipeline<[...TCommands, Command<any, never>]>;
2278
2445
  /**
2279
2446
  * @see https://redis.io/commands/xread
@@ -2300,35 +2467,35 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2300
2467
  * @see https://redis.io/commands/xpending
2301
2468
  */
2302
2469
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2303
- idleTime?: number | undefined;
2304
- consumer?: string | string[] | undefined;
2470
+ idleTime?: number;
2471
+ consumer?: string | string[];
2305
2472
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2306
2473
  /**
2307
2474
  * @see https://redis.io/commands/xclaim
2308
2475
  */
2309
2476
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2310
- idleMS?: number | undefined;
2311
- timeMS?: number | undefined;
2312
- retryCount?: number | undefined;
2313
- force?: boolean | undefined;
2314
- justId?: boolean | undefined;
2315
- lastId?: number | undefined;
2477
+ idleMS?: number;
2478
+ timeMS?: number;
2479
+ retryCount?: number;
2480
+ force?: boolean;
2481
+ justId?: boolean;
2482
+ lastId?: number;
2316
2483
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2317
2484
  /**
2318
2485
  * @see https://redis.io/commands/xautoclaim
2319
2486
  */
2320
2487
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2321
- count?: number | undefined;
2322
- justId?: boolean | undefined;
2488
+ count?: number;
2489
+ justId?: boolean;
2323
2490
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2324
2491
  /**
2325
2492
  * @see https://redis.io/commands/xtrim
2326
2493
  */
2327
2494
  xtrim: (key: string, options: {
2328
2495
  strategy: "MAXLEN" | "MINID";
2329
- exactness?: "~" | "=" | undefined;
2330
- threshold: string | number;
2331
- limit?: number | undefined;
2496
+ exactness?: "~" | "=";
2497
+ threshold: number | string;
2498
+ limit?: number;
2332
2499
  }) => Pipeline<[...TCommands, Command<any, number>]>;
2333
2500
  /**
2334
2501
  * @see https://redis.io/commands/xrange
@@ -2373,21 +2540,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2373
2540
  /**
2374
2541
  * @see https://redis.io/commands/zrange
2375
2542
  */
2376
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2377
- key: string,
2378
- min: `(${string}` | `[${string}` | "-" | "+",
2379
- max: `(${string}` | `[${string}` | "-" | "+",
2380
- opts: {
2381
- byLex: true;
2382
- } & ZRangeCommandOptions
2383
- ] | [
2384
- key: string,
2385
- min: number | `(${number}` | "-inf" | "+inf",
2386
- max: number | `(${number}` | "-inf" | "+inf",
2387
- opts: {
2388
- byScore: true;
2389
- } & ZRangeCommandOptions
2390
- ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2543
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
2544
+ byLex: true;
2545
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
2546
+ byScore: true;
2547
+ } & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
2391
2548
  /**
2392
2549
  * @see https://redis.io/commands/zrank
2393
2550
  */
@@ -2476,6 +2633,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2476
2633
  * @see https://redis.io/commands/json.mget
2477
2634
  */
2478
2635
  mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2636
+ /**
2637
+ * @see https://redis.io/commands/json.mset
2638
+ */
2639
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2479
2640
  /**
2480
2641
  * @see https://redis.io/commands/json.numincrby
2481
2642
  */
@@ -2501,9 +2662,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2501
2662
  */
2502
2663
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2503
2664
  nx: true;
2504
- xx?: undefined;
2665
+ xx?: never;
2505
2666
  } | {
2506
- nx?: undefined;
2667
+ nx?: never;
2507
2668
  xx: true;
2508
2669
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2509
2670
  /**
@@ -2587,6 +2748,8 @@ declare class Redis {
2587
2748
  * ```
2588
2749
  */
2589
2750
  constructor(client: Requester, opts?: RedisOptions);
2751
+ get readYourWritesSyncToken(): string | undefined;
2752
+ set readYourWritesSyncToken(session: string | undefined);
2590
2753
  get json(): {
2591
2754
  /**
2592
2755
  * @see https://redis.io/commands/json.arrappend
@@ -2631,7 +2794,11 @@ declare class Redis {
2631
2794
  /**
2632
2795
  * @see https://redis.io/commands/json.mget
2633
2796
  */
2634
- mget: <TData_1>(keys: string[], path: string) => Promise<TData_1>;
2797
+ mget: <TData>(keys: string[], path: string) => Promise<TData>;
2798
+ /**
2799
+ * @see https://redis.io/commands/json.mset
2800
+ */
2801
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
2635
2802
  /**
2636
2803
  * @see https://redis.io/commands/json.numincrby
2637
2804
  */
@@ -2657,9 +2824,9 @@ declare class Redis {
2657
2824
  */
2658
2825
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2659
2826
  nx: true;
2660
- xx?: undefined;
2827
+ xx?: never;
2661
2828
  } | {
2662
- nx?: undefined;
2829
+ nx?: never;
2663
2830
  xx: true;
2664
2831
  } | undefined) => Promise<"OK" | null>;
2665
2832
  /**
@@ -2774,6 +2941,10 @@ declare class Redis {
2774
2941
  * @see https://redis.io/commands/evalsha
2775
2942
  */
2776
2943
  evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
2944
+ /**
2945
+ * Generic method to execute any Redis command.
2946
+ */
2947
+ exec: <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) => Promise<TResult>;
2777
2948
  /**
2778
2949
  * @see https://redis.io/commands/exists
2779
2950
  */
@@ -2794,7 +2965,7 @@ declare class Redis {
2794
2965
  * @see https://redis.io/commands/flushdb
2795
2966
  */
2796
2967
  flushdb: (opts?: {
2797
- async?: boolean | undefined;
2968
+ async?: boolean;
2798
2969
  } | undefined) => Promise<"OK">;
2799
2970
  /**
2800
2971
  * @see https://redis.io/commands/geoadd
@@ -2841,11 +3012,11 @@ declare class Redis {
2841
3012
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2842
3013
  count?: {
2843
3014
  limit: number;
2844
- any?: boolean | undefined;
2845
- } | undefined;
2846
- withCoord?: boolean | undefined;
2847
- withDist?: boolean | undefined;
2848
- withHash?: boolean | undefined;
3015
+ any?: boolean;
3016
+ };
3017
+ withCoord?: boolean;
3018
+ withDist?: boolean;
3019
+ withHash?: boolean;
2849
3020
  } | undefined) => Promise<({
2850
3021
  member: TData;
2851
3022
  } & {
@@ -2882,9 +3053,9 @@ declare class Redis {
2882
3053
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2883
3054
  count?: {
2884
3055
  limit: number;
2885
- any?: boolean | undefined;
2886
- } | undefined;
2887
- storeDist?: boolean | undefined;
3056
+ any?: boolean;
3057
+ };
3058
+ storeDist?: boolean;
2888
3059
  } | undefined) => Promise<number>;
2889
3060
  /**
2890
3061
  * @see https://redis.io/commands/get
@@ -2898,6 +3069,46 @@ declare class Redis {
2898
3069
  * @see https://redis.io/commands/getdel
2899
3070
  */
2900
3071
  getdel: <TData>(key: string) => Promise<TData | null>;
3072
+ /**
3073
+ * @see https://redis.io/commands/getex
3074
+ */
3075
+ getex: <TData>(key: string, opts?: ({
3076
+ ex: number;
3077
+ px?: never;
3078
+ exat?: never;
3079
+ pxat?: never;
3080
+ persist?: never;
3081
+ } | {
3082
+ ex?: never;
3083
+ px: number;
3084
+ exat?: never;
3085
+ pxat?: never;
3086
+ persist?: never;
3087
+ } | {
3088
+ ex?: never;
3089
+ px?: never;
3090
+ exat: number;
3091
+ pxat?: never;
3092
+ persist?: never;
3093
+ } | {
3094
+ ex?: never;
3095
+ px?: never;
3096
+ exat?: never;
3097
+ pxat: number;
3098
+ persist?: never;
3099
+ } | {
3100
+ ex?: never;
3101
+ px?: never;
3102
+ exat?: never;
3103
+ pxat?: never;
3104
+ persist: true;
3105
+ } | {
3106
+ ex?: never;
3107
+ px?: never;
3108
+ exat?: never;
3109
+ pxat?: never;
3110
+ persist?: never;
3111
+ }) | undefined) => Promise<TData | null>;
2901
3112
  /**
2902
3113
  * @see https://redis.io/commands/getrange
2903
3114
  */
@@ -2945,9 +3156,7 @@ declare class Redis {
2945
3156
  /**
2946
3157
  * @see https://redis.io/commands/hmset
2947
3158
  */
2948
- hmset: <TData>(key: string, kv: {
2949
- [field: string]: TData;
2950
- }) => Promise<"OK">;
3159
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
2951
3160
  /**
2952
3161
  * @see https://redis.io/commands/hrandfield
2953
3162
  */
@@ -2963,9 +3172,7 @@ declare class Redis {
2963
3172
  /**
2964
3173
  * @see https://redis.io/commands/hset
2965
3174
  */
2966
- hset: <TData>(key: string, kv: {
2967
- [field: string]: TData;
2968
- }) => Promise<number>;
3175
+ hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
2969
3176
  /**
2970
3177
  * @see https://redis.io/commands/hsetnx
2971
3178
  */
@@ -3022,9 +3229,9 @@ declare class Redis {
3022
3229
  * @see https://redis.io/commands/lpos
3023
3230
  */
3024
3231
  lpos: <TData = number>(key: string, element: unknown, opts?: {
3025
- rank?: number | undefined;
3026
- count?: number | undefined;
3027
- maxLen?: number | undefined;
3232
+ rank?: number;
3233
+ count?: number;
3234
+ maxLen?: number;
3028
3235
  } | undefined) => Promise<TData>;
3029
3236
  /**
3030
3237
  * @see https://redis.io/commands/lpush
@@ -3057,15 +3264,11 @@ declare class Redis {
3057
3264
  /**
3058
3265
  * @see https://redis.io/commands/mset
3059
3266
  */
3060
- mset: <TData>(kv: {
3061
- [key: string]: TData;
3062
- }) => Promise<"OK">;
3267
+ mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
3063
3268
  /**
3064
3269
  * @see https://redis.io/commands/msetnx
3065
3270
  */
3066
- msetnx: <TData>(kv: {
3067
- [key: string]: TData;
3068
- }) => Promise<number>;
3271
+ msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
3069
3272
  /**
3070
3273
  * @see https://redis.io/commands/persist
3071
3274
  */
@@ -3133,7 +3336,7 @@ declare class Redis {
3133
3336
  /**
3134
3337
  * @see https://redis.io/commands/sadd
3135
3338
  */
3136
- sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
3339
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
3137
3340
  /**
3138
3341
  * @see https://redis.io/commands/scan
3139
3342
  */
@@ -3226,6 +3429,7 @@ declare class Redis {
3226
3429
  * @see https://redis.io/commands/strlen
3227
3430
  */
3228
3431
  strlen: (key: string) => Promise<number>;
3432
+ subscribe: (channels: string | string[]) => Subscriber;
3229
3433
  /**
3230
3434
  * @see https://redis.io/commands/sunion
3231
3435
  */
@@ -3257,11 +3461,9 @@ declare class Redis {
3257
3461
  /**
3258
3462
  * @see https://redis.io/commands/xadd
3259
3463
  */
3260
- xadd: (key: string, id: string, entries: {
3261
- [field: string]: unknown;
3262
- }, opts?: {
3263
- nomkStream?: boolean | undefined;
3264
- trim?: (({
3464
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
3465
+ nomkStream?: boolean;
3466
+ trim?: ({
3265
3467
  type: "MAXLEN" | "maxlen";
3266
3468
  threshold: number;
3267
3469
  } | {
@@ -3269,11 +3471,11 @@ declare class Redis {
3269
3471
  threshold: string;
3270
3472
  }) & ({
3271
3473
  comparison: "~";
3272
- limit?: number | undefined;
3474
+ limit?: number;
3273
3475
  } | {
3274
3476
  comparison: "=";
3275
- limit?: undefined;
3276
- })) | undefined;
3477
+ limit?: never;
3478
+ });
3277
3479
  } | undefined) => Promise<string>;
3278
3480
  /**
3279
3481
  * @see https://redis.io/commands/xack
@@ -3289,11 +3491,11 @@ declare class Redis {
3289
3491
  xgroup: (key: string, opts: {
3290
3492
  type: "CREATE";
3291
3493
  group: string;
3292
- id: string;
3494
+ id: `$` | string;
3293
3495
  options?: {
3294
- MKSTREAM?: boolean | undefined;
3295
- ENTRIESREAD?: number | undefined;
3296
- } | undefined;
3496
+ MKSTREAM?: boolean;
3497
+ ENTRIESREAD?: number;
3498
+ };
3297
3499
  } | {
3298
3500
  type: "CREATECONSUMER";
3299
3501
  group: string;
@@ -3308,10 +3510,10 @@ declare class Redis {
3308
3510
  } | {
3309
3511
  type: "SETID";
3310
3512
  group: string;
3311
- id: string;
3513
+ id: `$` | string;
3312
3514
  options?: {
3313
- ENTRIESREAD?: number | undefined;
3314
- } | undefined;
3515
+ ENTRIESREAD?: number;
3516
+ };
3315
3517
  }) => Promise<never>;
3316
3518
  /**
3317
3519
  * @see https://redis.io/commands/xread
@@ -3338,35 +3540,35 @@ declare class Redis {
3338
3540
  * @see https://redis.io/commands/xpending
3339
3541
  */
3340
3542
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3341
- idleTime?: number | undefined;
3342
- consumer?: string | string[] | undefined;
3543
+ idleTime?: number;
3544
+ consumer?: string | string[];
3343
3545
  } | undefined) => Promise<unknown[]>;
3344
3546
  /**
3345
3547
  * @see https://redis.io/commands/xclaim
3346
3548
  */
3347
3549
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3348
- idleMS?: number | undefined;
3349
- timeMS?: number | undefined;
3350
- retryCount?: number | undefined;
3351
- force?: boolean | undefined;
3352
- justId?: boolean | undefined;
3353
- lastId?: number | undefined;
3550
+ idleMS?: number;
3551
+ timeMS?: number;
3552
+ retryCount?: number;
3553
+ force?: boolean;
3554
+ justId?: boolean;
3555
+ lastId?: number;
3354
3556
  } | undefined) => Promise<unknown[]>;
3355
3557
  /**
3356
3558
  * @see https://redis.io/commands/xautoclaim
3357
3559
  */
3358
3560
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3359
- count?: number | undefined;
3360
- justId?: boolean | undefined;
3561
+ count?: number;
3562
+ justId?: boolean;
3361
3563
  } | undefined) => Promise<unknown[]>;
3362
3564
  /**
3363
3565
  * @see https://redis.io/commands/xtrim
3364
3566
  */
3365
3567
  xtrim: (key: string, options: {
3366
3568
  strategy: "MAXLEN" | "MINID";
3367
- exactness?: "~" | "=" | undefined;
3368
- threshold: string | number;
3369
- limit?: number | undefined;
3569
+ exactness?: "~" | "=";
3570
+ threshold: number | string;
3571
+ limit?: number;
3370
3572
  }) => Promise<number>;
3371
3573
  /**
3372
3574
  * @see https://redis.io/commands/xrange
@@ -3379,11 +3581,7 @@ declare class Redis {
3379
3581
  /**
3380
3582
  * @see https://redis.io/commands/zadd
3381
3583
  */
3382
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
3383
- key: string,
3384
- opts: ZAddCommandOptions,
3385
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
3386
- ]) => Promise<number | null>;
3584
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
3387
3585
  /**
3388
3586
  * @see https://redis.io/commands/zcard
3389
3587
  */
@@ -3423,21 +3621,11 @@ declare class Redis {
3423
3621
  /**
3424
3622
  * @see https://redis.io/commands/zrange
3425
3623
  */
3426
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3427
- key: string,
3428
- min: `(${string}` | `[${string}` | "-" | "+",
3429
- max: `(${string}` | `[${string}` | "-" | "+",
3430
- opts: {
3431
- byLex: true;
3432
- } & ZRangeCommandOptions
3433
- ] | [
3434
- key: string,
3435
- min: number | `(${number}` | "-inf" | "+inf",
3436
- max: number | `(${number}` | "-inf" | "+inf",
3437
- opts: {
3438
- byScore: true;
3439
- } & ZRangeCommandOptions
3440
- ]) => Promise<TData>;
3624
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
3625
+ byLex: true;
3626
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
3627
+ byScore: true;
3628
+ } & ZRangeCommandOptions]) => Promise<TData>;
3441
3629
  /**
3442
3630
  * @see https://redis.io/commands/zrank
3443
3631
  */
@@ -3495,10 +3683,7 @@ declare const error_UpstashError: typeof UpstashError;
3495
3683
  type error_UrlError = UrlError;
3496
3684
  declare const error_UrlError: typeof UrlError;
3497
3685
  declare namespace error {
3498
- export {
3499
- error_UpstashError as UpstashError,
3500
- error_UrlError as UrlError,
3501
- };
3686
+ export { error_UpstashError as UpstashError, error_UrlError as UrlError };
3502
3687
  }
3503
3688
 
3504
3689
  /**
@@ -3515,4 +3700,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
3515
3700
  constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3516
3701
  }
3517
3702
 
3518
- 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 };
3703
+ export { HStrLenCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetExCommand as H, GetRangeCommand as I, GetSetCommand as J, HDelCommand as K, HExistsCommand as L, HGetCommand as M, HGetAllCommand as N, HIncrByCommand as O, Pipeline as P, HIncrByFloatCommand as Q, type RedisOptions as R, HKeysCommand as S, HLenCommand as T, type UpstashRequest as U, HMGetCommand as V, HMSetCommand as W, HRandFieldCommand as X, HScanCommand as Y, HSetCommand as Z, HSetNXCommand as _, type RequesterConfig as a, type SetCommandOptions as a$, HValsCommand as a0, IncrCommand as a1, IncrByCommand as a2, IncrByFloatCommand as a3, JsonArrAppendCommand as a4, JsonArrIndexCommand as a5, JsonArrInsertCommand as a6, JsonArrLenCommand as a7, JsonArrPopCommand as a8, JsonArrTrimCommand as a9, LTrimCommand as aA, MGetCommand as aB, MSetCommand as aC, MSetNXCommand as aD, PersistCommand as aE, PExpireCommand as aF, PExpireAtCommand as aG, PingCommand as aH, PSetEXCommand as aI, PTtlCommand as aJ, PublishCommand as aK, RandomKeyCommand as aL, RenameCommand as aM, RenameNXCommand as aN, RPopCommand as aO, RPushCommand as aP, RPushXCommand as aQ, SAddCommand as aR, ScanCommand as aS, type ScanCommandOptions as aT, SCardCommand as aU, ScriptExistsCommand as aV, ScriptFlushCommand as aW, ScriptLoadCommand as aX, SDiffCommand as aY, SDiffStoreCommand as aZ, SetCommand as a_, JsonClearCommand as aa, JsonDelCommand as ab, JsonForgetCommand as ac, JsonGetCommand as ad, JsonMGetCommand as ae, JsonNumIncrByCommand as af, JsonNumMultByCommand as ag, JsonObjKeysCommand as ah, JsonObjLenCommand as ai, JsonRespCommand as aj, JsonSetCommand as ak, JsonStrAppendCommand as al, JsonStrLenCommand as am, JsonToggleCommand as an, JsonTypeCommand as ao, KeysCommand as ap, LIndexCommand as aq, LInsertCommand as ar, LLenCommand as as, LMoveCommand as at, LPopCommand as au, LPushCommand as av, LPushXCommand as aw, LRangeCommand as ax, LRemCommand as ay, LSetCommand as az, Redis as b, SetBitCommand as b0, SetExCommand as b1, SetNxCommand as b2, SetRangeCommand as b3, SInterCommand as b4, SInterStoreCommand as b5, SIsMemberCommand as b6, SMembersCommand as b7, SMIsMemberCommand as b8, SMoveCommand as b9, ZPopMaxCommand as bA, ZPopMinCommand as bB, ZRangeCommand as bC, type ZRangeCommandOptions as bD, ZRankCommand as bE, ZRemCommand as bF, ZRemRangeByLexCommand as bG, ZRemRangeByRankCommand as bH, ZRemRangeByScoreCommand as bI, ZRevRankCommand as bJ, ZScanCommand as bK, ZScoreCommand as bL, ZUnionCommand as bM, type ZUnionCommandOptions as bN, ZUnionStoreCommand as bO, type ZUnionStoreCommandOptions as bP, SPopCommand as ba, SRandMemberCommand as bb, SRemCommand as bc, SScanCommand as bd, StrLenCommand as be, SUnionCommand as bf, SUnionStoreCommand as bg, TimeCommand as bh, TouchCommand as bi, TtlCommand as bj, type Type as bk, TypeCommand as bl, UnlinkCommand as bm, XAddCommand as bn, XRangeCommand as bo, type ScoreMember as bp, type ZAddCommandOptions as bq, ZAddCommand as br, ZCardCommand as bs, ZCountCommand as bt, ZDiffStoreCommand as bu, ZIncrByCommand as bv, ZInterStoreCommand as bw, type ZInterStoreCommandOptions as bx, ZLexCountCommand as by, ZMScoreCommand as bz, type UpstashResponse as c, type Requester 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, type GeoAddCommandOptions as q, type 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 };