@upstash/redis 0.0.0-ci.d7e9b41c567cee58f3e79a2198679be3662be6f8-20231109092942 → 0.0.0-ci.d7fcd3c36f1ee4f5033d8520dbf69ded03192429-20240626095216

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.
@@ -23,7 +23,9 @@ type RedisOptions = {
23
23
  * @default true
24
24
  */
25
25
  automaticDeserialization?: boolean;
26
+ latencyLogging?: boolean;
26
27
  enableTelemetry?: boolean;
28
+ enableAutoPipelining?: boolean;
27
29
  };
28
30
 
29
31
  type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
@@ -106,6 +108,7 @@ type CommandOptions<TResult, TData> = {
106
108
  * @default true
107
109
  */
108
110
  automaticDeserialization?: boolean;
111
+ latencyLogging?: boolean;
109
112
  };
110
113
  /**
111
114
  * Command offers default (de)serialization and the exec method to all commands.
@@ -129,7 +132,8 @@ declare class Command<TResult, TData> {
129
132
  exec(client: Requester): Promise<TData>;
130
133
  }
131
134
 
132
- type ZUnionStoreCommandOptions = {
135
+ type ZUnionCommandOptions = {
136
+ withScores?: boolean;
133
137
  aggregate?: "sum" | "min" | "max";
134
138
  } & ({
135
139
  weight: number;
@@ -142,15 +146,14 @@ type ZUnionStoreCommandOptions = {
142
146
  weights?: never;
143
147
  });
144
148
  /**
145
- * @see https://redis.io/commands/zunionstore
149
+ * @see https://redis.io/commands/zunion
146
150
  */
147
- declare class ZUnionStoreCommand extends Command<number, number> {
148
- constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
149
- constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
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>);
150
154
  }
151
155
 
152
- type ZUnionCommandOptions = {
153
- withScores?: boolean;
156
+ type ZUnionStoreCommandOptions = {
154
157
  aggregate?: "sum" | "min" | "max";
155
158
  } & ({
156
159
  weight: number;
@@ -163,11 +166,11 @@ type ZUnionCommandOptions = {
163
166
  weights?: never;
164
167
  });
165
168
  /**
166
- * @see https://redis.io/commands/zunion
169
+ * @see https://redis.io/commands/zunionstore
167
170
  */
168
- declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
169
- constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
170
- constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
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>);
171
174
  }
172
175
 
173
176
  type ZInterStoreCommandOptions = {
@@ -220,8 +223,8 @@ type ScanCommandOptions = {
220
223
  /**
221
224
  * @see https://redis.io/commands/scan
222
225
  */
223
- declare class ScanCommand extends Command<[number, string[]], [number, string[]]> {
224
- constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, string[]], [number, string[]]>);
226
+ declare class ScanCommand extends Command<[string, string[]], [string, string[]]> {
227
+ constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], [string, string[]]>);
225
228
  }
226
229
 
227
230
  type GeoAddCommandOptions = {
@@ -344,11 +347,9 @@ declare class ExistsCommand extends Command<number, number> {
344
347
  constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
345
348
  }
346
349
 
347
- /**
348
- * @see https://redis.io/commands/expire
349
- */
350
+ type ExpireOptions = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
350
351
  declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
351
- constructor(cmd: [key: string, seconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
352
+ constructor(cmd: [key: string, seconds: number, option?: ExpireOptions], opts?: CommandOptions<"0" | "1", 0 | 1>);
352
353
  }
353
354
 
354
355
  /**
@@ -388,6 +389,13 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
388
389
  ], opts?: CommandOptions<number | null, number | null>);
389
390
  }
390
391
 
392
+ /**
393
+ * @see https://redis.io/commands/geohash
394
+ */
395
+ declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
396
+ constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
397
+ }
398
+
391
399
  type Coordinates = {
392
400
  lng: number;
393
401
  lat: number;
@@ -399,13 +407,6 @@ declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][
399
407
  constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
400
408
  }
401
409
 
402
- /**
403
- * @see https://redis.io/commands/geohash
404
- */
405
- declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
406
- constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
407
- }
408
-
409
410
  type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
410
411
  type CenterPoint$1<TMemberType> = {
411
412
  type: "FROMMEMBER" | "frommember";
@@ -637,13 +638,13 @@ declare class HRandFieldCommand<TData extends string | string[] | Record<string,
637
638
  * @see https://redis.io/commands/hscan
638
639
  */
639
640
  declare class HScanCommand extends Command<[
640
- number,
641
+ string,
641
642
  (string | number)[]
642
643
  ], [
643
- number,
644
+ string,
644
645
  (string | number)[]
645
646
  ]> {
646
- constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
647
+ constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
647
648
  }
648
649
 
649
650
  /**
@@ -778,7 +779,7 @@ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) |
778
779
  /**
779
780
  * @see https://redis.io/commands/json.mget
780
781
  */
781
- declare class JsonMGetCommand<TData extends (unknown | Record<string, unknown>)[]> extends Command<TData, TData> {
782
+ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
782
783
  constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
783
784
  }
784
785
 
@@ -1242,13 +1243,13 @@ declare class SRemCommand<TData = string> extends Command<number, number> {
1242
1243
  * @see https://redis.io/commands/sscan
1243
1244
  */
1244
1245
  declare class SScanCommand extends Command<[
1245
- number,
1246
+ string,
1246
1247
  (string | number)[]
1247
1248
  ], [
1248
- number,
1249
+ string,
1249
1250
  (string | number)[]
1250
1251
  ]> {
1251
- constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1252
+ constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
1252
1253
  }
1253
1254
 
1254
1255
  /**
@@ -1334,7 +1335,55 @@ declare class XRangeCommand<TData extends Record<string, Record<string, unknown>
1334
1335
  constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
1335
1336
  }
1336
1337
 
1337
- type ZAddCommandOptions = ({
1338
+ type XReadCommandOptions = [
1339
+ key: string | string[],
1340
+ id: string | string[],
1341
+ options?: {
1342
+ count?: number;
1343
+ blockMS?: number;
1344
+ }
1345
+ ];
1346
+ type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [key: string, id: string, options?: {
1347
+ count?: number;
1348
+ blockMS?: number;
1349
+ }] : never : K extends string[] ? I extends string[] ? [key: string[], id: string[], options?: {
1350
+ count?: number;
1351
+ blockMS?: number;
1352
+ }] : never : never : never;
1353
+ /**
1354
+ * @see https://redis.io/commands/xread
1355
+ */
1356
+ declare class XReadCommand extends Command<number, unknown[]> {
1357
+ constructor([key, id, options]: XReadOptions, opts?: CommandOptions<number, unknown[]>);
1358
+ }
1359
+
1360
+ type Options = {
1361
+ count?: number;
1362
+ blockMS?: number;
1363
+ NOACK?: boolean;
1364
+ };
1365
+ type XReadGroupCommandOptions = [
1366
+ group: string,
1367
+ consumer: string,
1368
+ key: string | string[],
1369
+ id: string | string[],
1370
+ options?: Options
1371
+ ];
1372
+ type XReadGroupOptions = XReadGroupCommandOptions extends [
1373
+ string,
1374
+ string,
1375
+ infer TKey,
1376
+ infer TId,
1377
+ ...any[]
1378
+ ] ? TKey extends string ? TId extends string ? [group: string, consumer: string, key: string, id: string, options?: Options] : never : TKey extends string[] ? TId extends string[] ? [group: string, consumer: string, key: string[], id: string[], options?: Options] : never : never : never;
1379
+ /**
1380
+ * @see https://redis.io/commands/xreadgroup
1381
+ */
1382
+ declare class XReadGroupCommand extends Command<number, unknown[]> {
1383
+ constructor([group, consumer, key, id, options]: XReadGroupOptions, opts?: CommandOptions<number, unknown[]>);
1384
+ }
1385
+
1386
+ type NXAndXXOptions = {
1338
1387
  nx: true;
1339
1388
  xx?: never;
1340
1389
  } | {
@@ -1343,12 +1392,23 @@ type ZAddCommandOptions = ({
1343
1392
  } | {
1344
1393
  nx?: never;
1345
1394
  xx?: never;
1346
- }) & {
1347
- ch?: true;
1348
1395
  };
1349
- type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
1350
- incr: true;
1396
+ type LTAndGTOptions = {
1397
+ lt: true;
1398
+ gt?: never;
1399
+ } | {
1400
+ lt?: never;
1401
+ gt: true;
1402
+ } | {
1403
+ lt?: never;
1404
+ gt?: never;
1405
+ };
1406
+ type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
1407
+ ch?: true;
1408
+ } & {
1409
+ incr?: true;
1351
1410
  };
1411
+ type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
1352
1412
  type ScoreMember<TData> = {
1353
1413
  score: number;
1354
1414
  member: TData;
@@ -1357,12 +1417,7 @@ type ScoreMember<TData> = {
1357
1417
  * @see https://redis.io/commands/zadd
1358
1418
  */
1359
1419
  declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1360
- constructor(cmd: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1361
- constructor(cmd: [
1362
- key: string,
1363
- opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr,
1364
- ...scoreMemberPairs: ScoreMember<TData>[]
1365
- ], opts?: CommandOptions<number | null, number | null>);
1420
+ constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1366
1421
  }
1367
1422
 
1368
1423
  /**
@@ -1495,13 +1550,13 @@ declare class ZRevRankCommand<TData> extends Command<number | null, number | nul
1495
1550
  * @see https://redis.io/commands/zscan
1496
1551
  */
1497
1552
  declare class ZScanCommand extends Command<[
1498
- number,
1553
+ string,
1499
1554
  (string | number)[]
1500
1555
  ], [
1501
- number,
1556
+ string,
1502
1557
  (string | number)[]
1503
1558
  ]> {
1504
- constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, (string | number)[]], [number, (string | number)[]]>);
1559
+ constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
1505
1560
  }
1506
1561
 
1507
1562
  /**
@@ -1648,7 +1703,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1648
1703
  /**
1649
1704
  * @see https://redis.io/commands/expire
1650
1705
  */
1651
- expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1706
+ expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1652
1707
  /**
1653
1708
  * @see https://redis.io/commands/expireat
1654
1709
  */
@@ -1663,6 +1718,96 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1663
1718
  flushdb: (opts?: {
1664
1719
  async?: boolean | undefined;
1665
1720
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1721
+ /**
1722
+ * @see https://redis.io/commands/geoadd
1723
+ */
1724
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
1725
+ /**
1726
+ * @see https://redis.io/commands/geodist
1727
+ */
1728
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
1729
+ /**
1730
+ * @see https://redis.io/commands/geopos
1731
+ */
1732
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
1733
+ lng: number;
1734
+ lat: number;
1735
+ }[]>]>;
1736
+ /**
1737
+ * @see https://redis.io/commands/geohash
1738
+ */
1739
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
1740
+ /**
1741
+ * @see https://redis.io/commands/geosearch
1742
+ */
1743
+ geosearch: <TData>(key: string, centerPoint: {
1744
+ type: "FROMLONLAT" | "fromlonlat";
1745
+ coordinate: {
1746
+ lon: number;
1747
+ lat: number;
1748
+ };
1749
+ } | {
1750
+ type: "FROMMEMBER" | "frommember";
1751
+ member: TData;
1752
+ }, shape: {
1753
+ type: "BYRADIUS" | "byradius";
1754
+ radius: number;
1755
+ radiusType: "M" | "KM" | "FT" | "MI";
1756
+ } | {
1757
+ type: "BYBOX" | "bybox";
1758
+ rect: {
1759
+ width: number;
1760
+ height: number;
1761
+ };
1762
+ rectType: "M" | "KM" | "FT" | "MI";
1763
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1764
+ count?: {
1765
+ limit: number;
1766
+ any?: boolean | undefined;
1767
+ } | undefined;
1768
+ withCoord?: boolean | undefined;
1769
+ withDist?: boolean | undefined;
1770
+ withHash?: boolean | undefined;
1771
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
1772
+ member: TData;
1773
+ } & {
1774
+ coord?: {
1775
+ long: number;
1776
+ lat: number;
1777
+ } | undefined;
1778
+ dist?: number | undefined;
1779
+ hash?: string | undefined;
1780
+ })[]>]>;
1781
+ /**
1782
+ * @see https://redis.io/commands/geosearchstore
1783
+ */
1784
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
1785
+ type: "FROMLONLAT" | "fromlonlat";
1786
+ coordinate: {
1787
+ lon: number;
1788
+ lat: number;
1789
+ };
1790
+ } | {
1791
+ type: "FROMMEMBER" | "frommember";
1792
+ member: TData;
1793
+ }, shape: {
1794
+ type: "BYRADIUS" | "byradius";
1795
+ radius: number;
1796
+ radiusType: "M" | "KM" | "FT" | "MI";
1797
+ } | {
1798
+ type: "BYBOX" | "bybox";
1799
+ rect: {
1800
+ width: number;
1801
+ height: number;
1802
+ };
1803
+ rectType: "M" | "KM" | "FT" | "MI";
1804
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1805
+ count?: {
1806
+ limit: number;
1807
+ any?: boolean | undefined;
1808
+ } | undefined;
1809
+ storeDist?: boolean | undefined;
1810
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1666
1811
  /**
1667
1812
  * @see https://redis.io/commands/get
1668
1813
  */
@@ -1728,11 +1873,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1728
1873
  /**
1729
1874
  * @see https://redis.io/commands/hrandfield
1730
1875
  */
1731
- hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1876
+ hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1732
1877
  /**
1733
1878
  * @see https://redis.io/commands/hscan
1734
1879
  */
1735
- hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
1880
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
1736
1881
  /**
1737
1882
  * @see https://redis.io/commands/hset
1738
1883
  */
@@ -1787,6 +1932,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1787
1932
  * @see https://redis.io/commands/lpop
1788
1933
  */
1789
1934
  lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1935
+ /**
1936
+ * @see https://redis.io/commands/lmpop
1937
+ */
1938
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
1790
1939
  /**
1791
1940
  * @see https://redis.io/commands/lpos
1792
1941
  */
@@ -1847,6 +1996,18 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1847
1996
  * @see https://redis.io/commands/pexpireat
1848
1997
  */
1849
1998
  pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1999
+ /**
2000
+ * @see https://redis.io/commands/pfadd
2001
+ */
2002
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
2003
+ /**
2004
+ * @see https://redis.io/commands/pfcount
2005
+ */
2006
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2007
+ /**
2008
+ * @see https://redis.io/commands/pfmerge
2009
+ */
2010
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
1850
2011
  /**
1851
2012
  * @see https://redis.io/commands/ping
1852
2013
  */
@@ -1894,7 +2055,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1894
2055
  /**
1895
2056
  * @see https://redis.io/commands/scan
1896
2057
  */
1897
- scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
2058
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
1898
2059
  /**
1899
2060
  * @see https://redis.io/commands/scard
1900
2061
  */
@@ -1975,7 +2136,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1975
2136
  /**
1976
2137
  * @see https://redis.io/commands/sscan
1977
2138
  */
1978
- sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
2139
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
1979
2140
  /**
1980
2141
  * @see https://redis.io/commands/strlen
1981
2142
  */
@@ -2011,7 +2172,133 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2011
2172
  /**
2012
2173
  * @see https://redis.io/commands/zadd
2013
2174
  */
2014
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2175
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
2176
+ key: string,
2177
+ opts: ZAddCommandOptions,
2178
+ ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
2179
+ ]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2180
+ /**
2181
+ * @see https://redis.io/commands/xadd
2182
+ */
2183
+ xadd: (key: string, id: string, entries: {
2184
+ [field: string]: unknown;
2185
+ }, opts?: {
2186
+ nomkStream?: boolean | undefined;
2187
+ trim?: (({
2188
+ type: "MAXLEN" | "maxlen";
2189
+ threshold: number;
2190
+ } | {
2191
+ type: "MINID" | "minid";
2192
+ threshold: string;
2193
+ }) & ({
2194
+ comparison: "~";
2195
+ limit?: number | undefined;
2196
+ } | {
2197
+ comparison: "=";
2198
+ limit?: undefined;
2199
+ })) | undefined;
2200
+ } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2201
+ /**
2202
+ * @see https://redis.io/commands/xack
2203
+ */
2204
+ xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2205
+ /**
2206
+ * @see https://redis.io/commands/xdel
2207
+ */
2208
+ xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2209
+ /**
2210
+ * @see https://redis.io/commands/xgroup
2211
+ */
2212
+ xgroup: (key: string, opts: {
2213
+ type: "CREATE";
2214
+ group: string;
2215
+ id: string;
2216
+ options?: {
2217
+ MKSTREAM?: boolean | undefined;
2218
+ ENTRIESREAD?: number | undefined;
2219
+ } | undefined;
2220
+ } | {
2221
+ type: "CREATECONSUMER";
2222
+ group: string;
2223
+ consumer: string;
2224
+ } | {
2225
+ type: "DELCONSUMER";
2226
+ group: string;
2227
+ consumer: string;
2228
+ } | {
2229
+ type: "DESTROY";
2230
+ group: string;
2231
+ } | {
2232
+ type: "SETID";
2233
+ group: string;
2234
+ id: string;
2235
+ options?: {
2236
+ ENTRIESREAD?: number | undefined;
2237
+ } | undefined;
2238
+ }) => Pipeline<[...TCommands, Command<any, never>]>;
2239
+ /**
2240
+ * @see https://redis.io/commands/xread
2241
+ */
2242
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2243
+ /**
2244
+ * @see https://redis.io/commands/xreadgroup
2245
+ */
2246
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2247
+ /**
2248
+ * @see https://redis.io/commands/xinfo
2249
+ */
2250
+ xinfo: (key: string, options: {
2251
+ type: "CONSUMERS";
2252
+ group: string;
2253
+ } | {
2254
+ type: "GROUPS";
2255
+ }) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2256
+ /**
2257
+ * @see https://redis.io/commands/xlen
2258
+ */
2259
+ xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2260
+ /**
2261
+ * @see https://redis.io/commands/xpending
2262
+ */
2263
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2264
+ idleTime?: number | undefined;
2265
+ consumer?: string | string[] | undefined;
2266
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2267
+ /**
2268
+ * @see https://redis.io/commands/xclaim
2269
+ */
2270
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2271
+ idleMS?: number | undefined;
2272
+ timeMS?: number | undefined;
2273
+ retryCount?: number | undefined;
2274
+ force?: boolean | undefined;
2275
+ justId?: boolean | undefined;
2276
+ lastId?: number | undefined;
2277
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2278
+ /**
2279
+ * @see https://redis.io/commands/xautoclaim
2280
+ */
2281
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2282
+ count?: number | undefined;
2283
+ justId?: boolean | undefined;
2284
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2285
+ /**
2286
+ * @see https://redis.io/commands/xtrim
2287
+ */
2288
+ xtrim: (key: string, options: {
2289
+ strategy: "MAXLEN" | "MINID";
2290
+ exactness?: "~" | "=" | undefined;
2291
+ threshold: string | number;
2292
+ limit?: number | undefined;
2293
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
2294
+ /**
2295
+ * @see https://redis.io/commands/xrange
2296
+ */
2297
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2298
+ /**
2299
+ * @see https://redis.io/commands/xrevrange
2300
+ */
2301
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2015
2302
  /**
2016
2303
  * @see https://redis.io/commands/zcard
2017
2304
  */
@@ -2089,7 +2376,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2089
2376
  /**
2090
2377
  * @see https://redis.io/commands/zscan
2091
2378
  */
2092
- zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
2379
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2093
2380
  /**
2094
2381
  * @see https://redis.io/commands/zscore
2095
2382
  */
@@ -2142,96 +2429,6 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2142
2429
  * @see https://redis.io/commands/json.forget
2143
2430
  */
2144
2431
  forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2145
- /**
2146
- * @see https://redis.io/commands/geoadd
2147
- */
2148
- geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2149
- /**
2150
- * @see https://redis.io/commands/geodist
2151
- */
2152
- geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
2153
- /**
2154
- * @see https://redis.io/commands/geopos
2155
- */
2156
- geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
2157
- lng: number;
2158
- lat: number;
2159
- }[]>]>;
2160
- /**
2161
- * @see https://redis.io/commands/geohash
2162
- */
2163
- geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
2164
- /**
2165
- * @see https://redis.io/commands/geosearch
2166
- */
2167
- geosearch: (key: string, centerPoint: {
2168
- type: "FROMLONLAT" | "fromlonlat";
2169
- coordinate: {
2170
- lon: number;
2171
- lat: number;
2172
- };
2173
- } | {
2174
- type: "FROMMEMBER" | "frommember";
2175
- member: unknown;
2176
- }, shape: {
2177
- type: "BYRADIUS" | "byradius";
2178
- radius: number;
2179
- radiusType: "M" | "KM" | "FT" | "MI";
2180
- } | {
2181
- type: "BYBOX" | "bybox";
2182
- rect: {
2183
- width: number;
2184
- height: number;
2185
- };
2186
- rectType: "M" | "KM" | "FT" | "MI";
2187
- }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2188
- count?: {
2189
- limit: number;
2190
- any?: boolean | undefined;
2191
- } | undefined;
2192
- withCoord?: boolean | undefined;
2193
- withDist?: boolean | undefined;
2194
- withHash?: boolean | undefined;
2195
- } | undefined) => Pipeline<[...TCommands, Command<any, ({
2196
- member: unknown;
2197
- } & {
2198
- coord?: {
2199
- long: number;
2200
- lat: number;
2201
- } | undefined;
2202
- dist?: number | undefined;
2203
- hash?: string | undefined;
2204
- })[]>]>;
2205
- /**
2206
- * @see https://redis.io/commands/geosearchstore
2207
- */
2208
- geosearchstore: (destination: string, key: string, centerPoint: {
2209
- type: "FROMLONLAT" | "fromlonlat";
2210
- coordinate: {
2211
- lon: number;
2212
- lat: number;
2213
- };
2214
- } | {
2215
- type: "FROMMEMBER" | "frommember";
2216
- member: unknown;
2217
- }, shape: {
2218
- type: "BYRADIUS" | "byradius";
2219
- radius: number;
2220
- radiusType: "M" | "KM" | "FT" | "MI";
2221
- } | {
2222
- type: "BYBOX" | "bybox";
2223
- rect: {
2224
- width: number;
2225
- height: number;
2226
- };
2227
- rectType: "M" | "KM" | "FT" | "MI";
2228
- }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2229
- count?: {
2230
- limit: number;
2231
- any?: boolean | undefined;
2232
- } | undefined;
2233
- storeDist?: boolean | undefined;
2234
- } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2235
2432
  /**
2236
2433
  * @see https://redis.io/commands/json.get
2237
2434
  */
@@ -2338,6 +2535,7 @@ declare class Redis {
2338
2535
  protected client: Requester;
2339
2536
  protected opts?: CommandOptions<any, any>;
2340
2537
  protected enableTelemetry: boolean;
2538
+ protected enableAutoPipelining: boolean;
2341
2539
  /**
2342
2540
  * Create a new redis client
2343
2541
  *
@@ -2387,104 +2585,14 @@ declare class Redis {
2387
2585
  * @see https://redis.io/commands/json.forget
2388
2586
  */
2389
2587
  forget: (key: string, path?: string | undefined) => Promise<number>;
2390
- /**
2391
- * @see https://redis.io/commands/geoadd
2392
- */
2393
- geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
2394
- /**
2395
- * @see https://redis.io/commands/geopos
2396
- */
2397
- geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
2398
- lng: number;
2399
- lat: number;
2400
- }[]>;
2401
- /**
2402
- * @see https://redis.io/commands/geodist
2403
- */
2404
- geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2405
- /**
2406
- * @see https://redis.io/commands/geohash
2407
- */
2408
- geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
2409
- /**
2410
- * @see https://redis.io/commands/geosearch
2411
- */
2412
- geosearch: (key: string, centerPoint: {
2413
- type: "FROMLONLAT" | "fromlonlat";
2414
- coordinate: {
2415
- lon: number;
2416
- lat: number;
2417
- };
2418
- } | {
2419
- type: "FROMMEMBER" | "frommember";
2420
- member: unknown;
2421
- }, shape: {
2422
- type: "BYRADIUS" | "byradius";
2423
- radius: number;
2424
- radiusType: "M" | "KM" | "FT" | "MI";
2425
- } | {
2426
- type: "BYBOX" | "bybox";
2427
- rect: {
2428
- width: number;
2429
- height: number;
2430
- };
2431
- rectType: "M" | "KM" | "FT" | "MI";
2432
- }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2433
- count?: {
2434
- limit: number;
2435
- any?: boolean | undefined;
2436
- } | undefined;
2437
- withCoord?: boolean | undefined;
2438
- withDist?: boolean | undefined;
2439
- withHash?: boolean | undefined;
2440
- } | undefined) => Promise<({
2441
- member: unknown;
2442
- } & {
2443
- coord?: {
2444
- long: number;
2445
- lat: number;
2446
- } | undefined;
2447
- dist?: number | undefined;
2448
- hash?: string | undefined;
2449
- })[]>;
2450
- /**
2451
- * @see https://redis.io/commands/geosearchstore
2452
- */
2453
- geosearchstore: (destination: string, key: string, centerPoint: {
2454
- type: "FROMLONLAT" | "fromlonlat";
2455
- coordinate: {
2456
- lon: number;
2457
- lat: number;
2458
- };
2459
- } | {
2460
- type: "FROMMEMBER" | "frommember";
2461
- member: unknown;
2462
- }, shape: {
2463
- type: "BYRADIUS" | "byradius";
2464
- radius: number;
2465
- radiusType: "M" | "KM" | "FT" | "MI";
2466
- } | {
2467
- type: "BYBOX" | "bybox";
2468
- rect: {
2469
- width: number;
2470
- height: number;
2471
- };
2472
- rectType: "M" | "KM" | "FT" | "MI";
2473
- }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2474
- count?: {
2475
- limit: number;
2476
- any?: boolean | undefined;
2477
- } | undefined;
2478
- storeDist?: boolean | undefined;
2479
- } | undefined) => Promise<number>;
2480
2588
  /**
2481
2589
  * @see https://redis.io/commands/json.get
2482
2590
  */
2483
- get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
2591
+ get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
2484
2592
  /**
2485
2593
  * @see https://redis.io/commands/json.mget
2486
2594
  */
2487
- mget: (keys: string[], path: string) => Promise<any>;
2595
+ mget: <TData_1>(keys: string[], path: string) => Promise<TData_1>;
2488
2596
  /**
2489
2597
  * @see https://redis.io/commands/json.numincrby
2490
2598
  */
@@ -2547,6 +2655,7 @@ declare class Redis {
2547
2655
  * @see {@link Pipeline}
2548
2656
  */
2549
2657
  pipeline: () => Pipeline<[]>;
2658
+ protected autoPipeline: () => Redis;
2550
2659
  /**
2551
2660
  * Create a new transaction to allow executing multiple steps atomically.
2552
2661
  *
@@ -2617,7 +2726,7 @@ declare class Redis {
2617
2726
  /**
2618
2727
  * @see https://redis.io/commands/expire
2619
2728
  */
2620
- expire: (key: string, seconds: number) => Promise<0 | 1>;
2729
+ expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Promise<0 | 1>;
2621
2730
  /**
2622
2731
  * @see https://redis.io/commands/expireat
2623
2732
  */
@@ -2632,6 +2741,96 @@ declare class Redis {
2632
2741
  flushdb: (opts?: {
2633
2742
  async?: boolean | undefined;
2634
2743
  } | undefined) => Promise<"OK">;
2744
+ /**
2745
+ * @see https://redis.io/commands/geoadd
2746
+ */
2747
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
2748
+ /**
2749
+ * @see https://redis.io/commands/geopos
2750
+ */
2751
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
2752
+ lng: number;
2753
+ lat: number;
2754
+ }[]>;
2755
+ /**
2756
+ * @see https://redis.io/commands/geodist
2757
+ */
2758
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2759
+ /**
2760
+ * @see https://redis.io/commands/geohash
2761
+ */
2762
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
2763
+ /**
2764
+ * @see https://redis.io/commands/geosearch
2765
+ */
2766
+ geosearch: <TData>(key: string, centerPoint: {
2767
+ type: "FROMLONLAT" | "fromlonlat";
2768
+ coordinate: {
2769
+ lon: number;
2770
+ lat: number;
2771
+ };
2772
+ } | {
2773
+ type: "FROMMEMBER" | "frommember";
2774
+ member: TData;
2775
+ }, shape: {
2776
+ type: "BYRADIUS" | "byradius";
2777
+ radius: number;
2778
+ radiusType: "M" | "KM" | "FT" | "MI";
2779
+ } | {
2780
+ type: "BYBOX" | "bybox";
2781
+ rect: {
2782
+ width: number;
2783
+ height: number;
2784
+ };
2785
+ rectType: "M" | "KM" | "FT" | "MI";
2786
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2787
+ count?: {
2788
+ limit: number;
2789
+ any?: boolean | undefined;
2790
+ } | undefined;
2791
+ withCoord?: boolean | undefined;
2792
+ withDist?: boolean | undefined;
2793
+ withHash?: boolean | undefined;
2794
+ } | undefined) => Promise<({
2795
+ member: TData;
2796
+ } & {
2797
+ coord?: {
2798
+ long: number;
2799
+ lat: number;
2800
+ } | undefined;
2801
+ dist?: number | undefined;
2802
+ hash?: string | undefined;
2803
+ })[]>;
2804
+ /**
2805
+ * @see https://redis.io/commands/geosearchstore
2806
+ */
2807
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
2808
+ type: "FROMLONLAT" | "fromlonlat";
2809
+ coordinate: {
2810
+ lon: number;
2811
+ lat: number;
2812
+ };
2813
+ } | {
2814
+ type: "FROMMEMBER" | "frommember";
2815
+ member: TData;
2816
+ }, shape: {
2817
+ type: "BYRADIUS" | "byradius";
2818
+ radius: number;
2819
+ radiusType: "M" | "KM" | "FT" | "MI";
2820
+ } | {
2821
+ type: "BYBOX" | "bybox";
2822
+ rect: {
2823
+ width: number;
2824
+ height: number;
2825
+ };
2826
+ rectType: "M" | "KM" | "FT" | "MI";
2827
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2828
+ count?: {
2829
+ limit: number;
2830
+ any?: boolean | undefined;
2831
+ } | undefined;
2832
+ storeDist?: boolean | undefined;
2833
+ } | undefined) => Promise<number>;
2635
2834
  /**
2636
2835
  * @see https://redis.io/commands/get
2637
2836
  */
@@ -2698,14 +2897,14 @@ declare class Redis {
2698
2897
  * @see https://redis.io/commands/hrandfield
2699
2898
  */
2700
2899
  hrandfield: {
2701
- (key: string): Promise<string>;
2900
+ (key: string): Promise<string | null>;
2702
2901
  (key: string, count: number): Promise<string[]>;
2703
2902
  <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
2704
2903
  };
2705
2904
  /**
2706
2905
  * @see https://redis.io/commands/hscan
2707
2906
  */
2708
- hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
2907
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
2709
2908
  /**
2710
2909
  * @see https://redis.io/commands/hset
2711
2910
  */
@@ -2760,6 +2959,10 @@ declare class Redis {
2760
2959
  * @see https://redis.io/commands/lpop
2761
2960
  */
2762
2961
  lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
2962
+ /**
2963
+ * @see https://redis.io/commands/lmpop
2964
+ */
2965
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
2763
2966
  /**
2764
2967
  * @see https://redis.io/commands/lpos
2765
2968
  */
@@ -2820,6 +3023,18 @@ declare class Redis {
2820
3023
  * @see https://redis.io/commands/pexpireat
2821
3024
  */
2822
3025
  pexpireat: (key: string, unix: number) => Promise<0 | 1>;
3026
+ /**
3027
+ * @see https://redis.io/commands/pfadd
3028
+ */
3029
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
3030
+ /**
3031
+ * @see https://redis.io/commands/pfcount
3032
+ */
3033
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
3034
+ /**
3035
+ * @see https://redis.io/commands/pfmerge
3036
+ */
3037
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
2823
3038
  /**
2824
3039
  * @see https://redis.io/commands/ping
2825
3040
  */
@@ -2867,7 +3082,7 @@ declare class Redis {
2867
3082
  /**
2868
3083
  * @see https://redis.io/commands/scan
2869
3084
  */
2870
- scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
3085
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
2871
3086
  /**
2872
3087
  * @see https://redis.io/commands/scard
2873
3088
  */
@@ -2951,7 +3166,7 @@ declare class Redis {
2951
3166
  /**
2952
3167
  * @see https://redis.io/commands/sscan
2953
3168
  */
2954
- sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
3169
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
2955
3170
  /**
2956
3171
  * @see https://redis.io/commands/strlen
2957
3172
  */
@@ -3005,14 +3220,115 @@ declare class Redis {
3005
3220
  limit?: undefined;
3006
3221
  })) | undefined;
3007
3222
  } | undefined) => Promise<string>;
3223
+ /**
3224
+ * @see https://redis.io/commands/xack
3225
+ */
3226
+ xack: (key: string, group: string, id: string | string[]) => Promise<number>;
3227
+ /**
3228
+ * @see https://redis.io/commands/xdel
3229
+ */
3230
+ xdel: (key: string, ids: string | string[]) => Promise<number>;
3231
+ /**
3232
+ * @see https://redis.io/commands/xgroup
3233
+ */
3234
+ xgroup: (key: string, opts: {
3235
+ type: "CREATE";
3236
+ group: string;
3237
+ id: string;
3238
+ options?: {
3239
+ MKSTREAM?: boolean | undefined;
3240
+ ENTRIESREAD?: number | undefined;
3241
+ } | undefined;
3242
+ } | {
3243
+ type: "CREATECONSUMER";
3244
+ group: string;
3245
+ consumer: string;
3246
+ } | {
3247
+ type: "DELCONSUMER";
3248
+ group: string;
3249
+ consumer: string;
3250
+ } | {
3251
+ type: "DESTROY";
3252
+ group: string;
3253
+ } | {
3254
+ type: "SETID";
3255
+ group: string;
3256
+ id: string;
3257
+ options?: {
3258
+ ENTRIESREAD?: number | undefined;
3259
+ } | undefined;
3260
+ }) => Promise<never>;
3261
+ /**
3262
+ * @see https://redis.io/commands/xread
3263
+ */
3264
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
3265
+ /**
3266
+ * @see https://redis.io/commands/xreadgroup
3267
+ */
3268
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
3269
+ /**
3270
+ * @see https://redis.io/commands/xinfo
3271
+ */
3272
+ xinfo: (key: string, options: {
3273
+ type: "CONSUMERS";
3274
+ group: string;
3275
+ } | {
3276
+ type: "GROUPS";
3277
+ }) => Promise<unknown[]>;
3278
+ /**
3279
+ * @see https://redis.io/commands/xlen
3280
+ */
3281
+ xlen: (key: string) => Promise<number>;
3282
+ /**
3283
+ * @see https://redis.io/commands/xpending
3284
+ */
3285
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3286
+ idleTime?: number | undefined;
3287
+ consumer?: string | string[] | undefined;
3288
+ } | undefined) => Promise<unknown[]>;
3289
+ /**
3290
+ * @see https://redis.io/commands/xclaim
3291
+ */
3292
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3293
+ idleMS?: number | undefined;
3294
+ timeMS?: number | undefined;
3295
+ retryCount?: number | undefined;
3296
+ force?: boolean | undefined;
3297
+ justId?: boolean | undefined;
3298
+ lastId?: number | undefined;
3299
+ } | undefined) => Promise<unknown[]>;
3300
+ /**
3301
+ * @see https://redis.io/commands/xautoclaim
3302
+ */
3303
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3304
+ count?: number | undefined;
3305
+ justId?: boolean | undefined;
3306
+ } | undefined) => Promise<unknown[]>;
3307
+ /**
3308
+ * @see https://redis.io/commands/xtrim
3309
+ */
3310
+ xtrim: (key: string, options: {
3311
+ strategy: "MAXLEN" | "MINID";
3312
+ exactness?: "~" | "=" | undefined;
3313
+ threshold: string | number;
3314
+ limit?: number | undefined;
3315
+ }) => Promise<number>;
3008
3316
  /**
3009
3317
  * @see https://redis.io/commands/xrange
3010
3318
  */
3011
3319
  xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3320
+ /**
3321
+ * @see https://redis.io/commands/xrevrange
3322
+ */
3323
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3012
3324
  /**
3013
3325
  * @see https://redis.io/commands/zadd
3014
3326
  */
3015
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
3327
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
3328
+ key: string,
3329
+ opts: ZAddCommandOptions,
3330
+ ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
3331
+ ]) => Promise<number | null>;
3016
3332
  /**
3017
3333
  * @see https://redis.io/commands/zcard
3018
3334
  */
@@ -3094,7 +3410,7 @@ declare class Redis {
3094
3410
  /**
3095
3411
  * @see https://redis.io/commands/zscan
3096
3412
  */
3097
- zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
3413
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3098
3414
  /**
3099
3415
  * @see https://redis.io/commands/zscore
3100
3416
  */
@@ -3109,6 +3425,27 @@ declare class Redis {
3109
3425
  zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3110
3426
  }
3111
3427
 
3428
+ /**
3429
+ * Result of a bad request to upstash
3430
+ */
3431
+ declare class UpstashError extends Error {
3432
+ constructor(message: string);
3433
+ }
3434
+ declare class UrlError extends Error {
3435
+ constructor(url: string);
3436
+ }
3437
+
3438
+ type error_UpstashError = UpstashError;
3439
+ declare const error_UpstashError: typeof UpstashError;
3440
+ type error_UrlError = UrlError;
3441
+ declare const error_UrlError: typeof UrlError;
3442
+ declare namespace error {
3443
+ export {
3444
+ error_UpstashError as UpstashError,
3445
+ error_UrlError as UrlError,
3446
+ };
3447
+ }
3448
+
3112
3449
  /**
3113
3450
  * @see https://redis.io/commands/zdiffstore
3114
3451
  */
@@ -3123,4 +3460,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
3123
3460
  constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3124
3461
  }
3125
3462
 
3126
- export { IncrByCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetSetCommand as H, HDelCommand as I, HExistsCommand as J, HGetCommand as K, HGetAllCommand as L, HIncrByCommand as M, HIncrByFloatCommand as N, HKeysCommand as O, HLenCommand as P, HMGetCommand as Q, RedisOptions as R, HMSetCommand as S, HRandFieldCommand as T, UpstashRequest as U, HScanCommand as V, HSetCommand as W, HSetNXCommand as X, HStrLenCommand as Y, HValsCommand as Z, IncrCommand as _, RequesterConfig as a, SetNxCommand as a$, IncrByFloatCommand as a0, JsonArrAppendCommand as a1, JsonArrIndexCommand as a2, JsonArrInsertCommand as a3, JsonArrLenCommand as a4, JsonArrPopCommand as a5, JsonArrTrimCommand as a6, JsonClearCommand as a7, JsonDelCommand as a8, JsonForgetCommand as a9, MSetNXCommand as aA, PersistCommand as aB, PExpireCommand as aC, PExpireAtCommand as aD, PingCommand as aE, PSetEXCommand as aF, PTtlCommand as aG, PublishCommand as aH, RandomKeyCommand as aI, RenameCommand as aJ, RenameNXCommand as aK, RPopCommand as aL, RPushCommand as aM, RPushXCommand as aN, SAddCommand as aO, ScanCommand as aP, ScanCommandOptions as aQ, SCardCommand as aR, ScriptExistsCommand as aS, ScriptFlushCommand as aT, ScriptLoadCommand as aU, SDiffCommand as aV, SDiffStoreCommand as aW, SetCommand as aX, SetCommandOptions as aY, SetBitCommand as aZ, SetExCommand as a_, JsonGetCommand as aa, JsonMGetCommand as ab, JsonNumIncrByCommand as ac, JsonNumMultByCommand as ad, JsonObjKeysCommand as ae, JsonObjLenCommand as af, JsonRespCommand as ag, JsonSetCommand as ah, JsonStrAppendCommand as ai, JsonStrLenCommand as aj, JsonToggleCommand as ak, JsonTypeCommand as al, KeysCommand as am, LIndexCommand as an, LInsertCommand as ao, LLenCommand as ap, LMoveCommand as aq, LPopCommand as ar, LPushCommand as as, LPushXCommand as at, LRangeCommand as au, LRemCommand as av, LSetCommand as aw, LTrimCommand as ax, MGetCommand as ay, MSetCommand as az, Redis as b, SetRangeCommand as b0, SInterCommand as b1, SInterStoreCommand as b2, SIsMemberCommand as b3, SMembersCommand as b4, SMIsMemberCommand as b5, SMoveCommand as b6, SPopCommand as b7, SRandMemberCommand as b8, SRemCommand as b9, ZRangeCommand as bA, ZRangeCommandOptions as bB, ZRankCommand as bC, ZRemCommand as bD, ZRemRangeByLexCommand as bE, ZRemRangeByRankCommand as bF, ZRemRangeByScoreCommand as bG, ZRevRankCommand as bH, ZScanCommand as bI, ZScoreCommand as bJ, ZUnionCommand as bK, ZUnionCommandOptions as bL, ZUnionStoreCommand as bM, ZUnionStoreCommandOptions as bN, SScanCommand as ba, StrLenCommand as bb, SUnionCommand as bc, SUnionStoreCommand as bd, TimeCommand as be, TouchCommand as bf, TtlCommand as bg, Type as bh, TypeCommand as bi, UnlinkCommand as bj, XAddCommand as bk, XRangeCommand as bl, ScoreMember as bm, ZAddCommandOptions as bn, ZAddCommandOptionsWithIncr as bo, ZAddCommand as bp, ZCardCommand as bq, ZCountCommand as br, ZDiffStoreCommand as bs, ZIncrByCommand as bt, ZInterStoreCommand as bu, ZInterStoreCommandOptions as bv, ZLexCountCommand as bw, ZMScoreCommand as bx, ZPopMaxCommand as by, ZPopMinCommand as bz, Requester as c, UpstashResponse as d, BitOpCommand as e, BitPosCommand as f, DecrCommand as g, DecrByCommand as h, DelCommand as i, EvalCommand as j, EvalshaCommand as k, ExistsCommand as l, ExpireCommand as m, ExpireAtCommand as n, FlushDBCommand as o, GeoAddCommandOptions as p, GeoMember as q, GeoDistCommand as r, GeoHashCommand as s, GeoPosCommand as t, GeoSearchCommand as u, GeoSearchStoreCommand as v, GetCommand as w, GetBitCommand as x, GetDelCommand as y, GetRangeCommand as z };
3463
+ 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 };