@upstash/redis 0.0.0-ci.d8fb1ea41777a410b4cc4d3c1600060c679011e5-20240302001408 → 0.0.0-ci.d9493973d6f2f874c87119d354757b779db8d919-20240930220425
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.
- package/README.md +1 -2
- package/chunk-IDFQHBDV.mjs +1 -0
- package/chunk-VSVJRJ5B.js +1 -0
- package/cloudflare.d.mts +10 -5
- package/cloudflare.d.ts +10 -5
- package/cloudflare.js +1 -1
- package/cloudflare.mjs +1 -1
- package/fastly.d.mts +10 -5
- package/fastly.d.ts +10 -5
- package/fastly.js +1 -1
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +12 -24
- package/nodejs.d.ts +12 -24
- package/nodejs.js +1 -1
- package/nodejs.mjs +1 -1
- package/package.json +1 -1
- package/{zmscore-5d82e632.d.ts → zmscore-BLgYk16R.d.mts} +251 -184
- package/zmscore-BLgYk16R.d.ts +3488 -0
- package/chunk-JD7AT2OK.js +0 -1
- package/chunk-XCPX3L6C.mjs +0 -1
|
@@ -23,7 +23,10 @@ type RedisOptions = {
|
|
|
23
23
|
* @default true
|
|
24
24
|
*/
|
|
25
25
|
automaticDeserialization?: boolean;
|
|
26
|
+
latencyLogging?: boolean;
|
|
26
27
|
enableTelemetry?: boolean;
|
|
28
|
+
enableAutoPipelining?: boolean;
|
|
29
|
+
readYourWrites?: boolean;
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
|
|
@@ -33,12 +36,21 @@ type UpstashRequest = {
|
|
|
33
36
|
* Request body will be serialized to json
|
|
34
37
|
*/
|
|
35
38
|
body?: unknown;
|
|
39
|
+
upstashSyncToken?: string;
|
|
36
40
|
};
|
|
37
41
|
type UpstashResponse<TResult> = {
|
|
38
42
|
result?: TResult;
|
|
39
43
|
error?: string;
|
|
40
44
|
};
|
|
41
45
|
interface Requester {
|
|
46
|
+
/**
|
|
47
|
+
* 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.
|
|
48
|
+
*/
|
|
49
|
+
readYourWrites?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* 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.
|
|
52
|
+
*/
|
|
53
|
+
upstashSyncToken?: string;
|
|
42
54
|
request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
|
|
43
55
|
}
|
|
44
56
|
type RetryConfig = false | {
|
|
@@ -106,6 +118,7 @@ type CommandOptions<TResult, TData> = {
|
|
|
106
118
|
* @default true
|
|
107
119
|
*/
|
|
108
120
|
automaticDeserialization?: boolean;
|
|
121
|
+
latencyLogging?: boolean;
|
|
109
122
|
};
|
|
110
123
|
/**
|
|
111
124
|
* Command offers default (de)serialization and the exec method to all commands.
|
|
@@ -220,8 +233,8 @@ type ScanCommandOptions = {
|
|
|
220
233
|
/**
|
|
221
234
|
* @see https://redis.io/commands/scan
|
|
222
235
|
*/
|
|
223
|
-
declare class ScanCommand extends Command<[
|
|
224
|
-
constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
236
|
+
declare class ScanCommand extends Command<[string, string[]], [string, string[]]> {
|
|
237
|
+
constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], [string, string[]]>);
|
|
225
238
|
}
|
|
226
239
|
|
|
227
240
|
type GeoAddCommandOptions = {
|
|
@@ -233,11 +246,11 @@ type GeoAddCommandOptions = {
|
|
|
233
246
|
} & {
|
|
234
247
|
ch?: boolean;
|
|
235
248
|
});
|
|
236
|
-
|
|
249
|
+
type GeoMember<TMemberType> = {
|
|
237
250
|
latitude: number;
|
|
238
251
|
longitude: number;
|
|
239
252
|
member: TMemberType;
|
|
240
|
-
}
|
|
253
|
+
};
|
|
241
254
|
/**
|
|
242
255
|
* @see https://redis.io/commands/geoadd
|
|
243
256
|
*/
|
|
@@ -264,6 +277,28 @@ declare class BitCountCommand extends Command<number, number> {
|
|
|
264
277
|
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
265
278
|
}
|
|
266
279
|
|
|
280
|
+
type SubCommandArgs<TRest extends unknown[] = []> = [
|
|
281
|
+
encoding: string,
|
|
282
|
+
offset: number | string,
|
|
283
|
+
...rest: TRest
|
|
284
|
+
];
|
|
285
|
+
/**
|
|
286
|
+
* @see https://redis.io/commands/bitfield
|
|
287
|
+
*/
|
|
288
|
+
declare class BitFieldCommand<T = Promise<number[]>> {
|
|
289
|
+
private client;
|
|
290
|
+
private opts?;
|
|
291
|
+
private execOperation;
|
|
292
|
+
private command;
|
|
293
|
+
constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
|
|
294
|
+
private chain;
|
|
295
|
+
get(...args: SubCommandArgs): this;
|
|
296
|
+
set(...args: SubCommandArgs<[value: number]>): this;
|
|
297
|
+
incrby(...args: SubCommandArgs<[increment: number]>): this;
|
|
298
|
+
overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
|
|
299
|
+
exec(): T;
|
|
300
|
+
}
|
|
301
|
+
|
|
267
302
|
/**
|
|
268
303
|
* @see https://redis.io/commands/bitop
|
|
269
304
|
*/
|
|
@@ -390,7 +425,7 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
|
|
|
390
425
|
* @see https://redis.io/commands/geohash
|
|
391
426
|
*/
|
|
392
427
|
declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
|
|
393
|
-
constructor(cmd: [string, ...
|
|
428
|
+
constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
|
|
394
429
|
}
|
|
395
430
|
|
|
396
431
|
type Coordinates = {
|
|
@@ -617,9 +652,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
|
|
|
617
652
|
* @see https://redis.io/commands/hmset
|
|
618
653
|
*/
|
|
619
654
|
declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
|
|
620
|
-
constructor([key, kv]: [key: string, kv:
|
|
621
|
-
[field: string]: TData;
|
|
622
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
655
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
623
656
|
}
|
|
624
657
|
|
|
625
658
|
/**
|
|
@@ -635,22 +668,20 @@ declare class HRandFieldCommand<TData extends string | string[] | Record<string,
|
|
|
635
668
|
* @see https://redis.io/commands/hscan
|
|
636
669
|
*/
|
|
637
670
|
declare class HScanCommand extends Command<[
|
|
638
|
-
|
|
671
|
+
string,
|
|
639
672
|
(string | number)[]
|
|
640
673
|
], [
|
|
641
|
-
|
|
674
|
+
string,
|
|
642
675
|
(string | number)[]
|
|
643
676
|
]> {
|
|
644
|
-
constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[
|
|
677
|
+
constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
645
678
|
}
|
|
646
679
|
|
|
647
680
|
/**
|
|
648
681
|
* @see https://redis.io/commands/hset
|
|
649
682
|
*/
|
|
650
683
|
declare class HSetCommand<TData> extends Command<number, number> {
|
|
651
|
-
constructor([key, kv]: [key: string, kv:
|
|
652
|
-
[field: string]: TData;
|
|
653
|
-
}], opts?: CommandOptions<number, number>);
|
|
684
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
654
685
|
}
|
|
655
686
|
|
|
656
687
|
/**
|
|
@@ -780,6 +811,17 @@ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
|
|
|
780
811
|
constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
|
|
781
812
|
}
|
|
782
813
|
|
|
814
|
+
/**
|
|
815
|
+
* @see https://redis.io/commands/json.mset
|
|
816
|
+
*/
|
|
817
|
+
declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
|
|
818
|
+
constructor(cmd: {
|
|
819
|
+
key: string;
|
|
820
|
+
path: string;
|
|
821
|
+
value: TData;
|
|
822
|
+
}[], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
823
|
+
}
|
|
824
|
+
|
|
783
825
|
/**
|
|
784
826
|
* @see https://redis.io/commands/json.numincrby
|
|
785
827
|
*/
|
|
@@ -936,25 +978,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
|
|
|
936
978
|
* @see https://redis.io/commands/mget
|
|
937
979
|
*/
|
|
938
980
|
declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
939
|
-
constructor(cmd: [string[]] | [...
|
|
981
|
+
constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
|
|
940
982
|
}
|
|
941
983
|
|
|
942
984
|
/**
|
|
943
985
|
* @see https://redis.io/commands/mset
|
|
944
986
|
*/
|
|
945
987
|
declare class MSetCommand<TData> extends Command<"OK", "OK"> {
|
|
946
|
-
constructor([kv]: [kv:
|
|
947
|
-
[key: string]: TData;
|
|
948
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
988
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
949
989
|
}
|
|
950
990
|
|
|
951
991
|
/**
|
|
952
992
|
* @see https://redis.io/commands/msetnx
|
|
953
993
|
*/
|
|
954
994
|
declare class MSetNXCommand<TData = string> extends Command<number, number> {
|
|
955
|
-
constructor([kv]: [kv:
|
|
956
|
-
[key: string]: TData;
|
|
957
|
-
}], opts?: CommandOptions<number, number>);
|
|
995
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
958
996
|
}
|
|
959
997
|
|
|
960
998
|
/**
|
|
@@ -1052,7 +1090,7 @@ declare class RPushXCommand<TData = string> extends Command<number, number> {
|
|
|
1052
1090
|
* @see https://redis.io/commands/sadd
|
|
1053
1091
|
*/
|
|
1054
1092
|
declare class SAddCommand<TData = string> extends Command<number, number> {
|
|
1055
|
-
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1093
|
+
constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1056
1094
|
}
|
|
1057
1095
|
|
|
1058
1096
|
/**
|
|
@@ -1240,13 +1278,13 @@ declare class SRemCommand<TData = string> extends Command<number, number> {
|
|
|
1240
1278
|
* @see https://redis.io/commands/sscan
|
|
1241
1279
|
*/
|
|
1242
1280
|
declare class SScanCommand extends Command<[
|
|
1243
|
-
|
|
1281
|
+
string,
|
|
1244
1282
|
(string | number)[]
|
|
1245
1283
|
], [
|
|
1246
|
-
|
|
1284
|
+
string,
|
|
1247
1285
|
(string | number)[]
|
|
1248
1286
|
]> {
|
|
1249
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1287
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1250
1288
|
}
|
|
1251
1289
|
|
|
1252
1290
|
/**
|
|
@@ -1321,9 +1359,7 @@ declare class XAddCommand extends Command<string, string> {
|
|
|
1321
1359
|
constructor([key, id, entries, opts]: [
|
|
1322
1360
|
key: string,
|
|
1323
1361
|
id: "*" | string,
|
|
1324
|
-
entries:
|
|
1325
|
-
[field: string]: unknown;
|
|
1326
|
-
},
|
|
1362
|
+
entries: Record<string, unknown>,
|
|
1327
1363
|
opts?: XAddCommandOptions
|
|
1328
1364
|
], commandOptions?: CommandOptions<string, string>);
|
|
1329
1365
|
}
|
|
@@ -1547,13 +1583,13 @@ declare class ZRevRankCommand<TData> extends Command<number | null, number | nul
|
|
|
1547
1583
|
* @see https://redis.io/commands/zscan
|
|
1548
1584
|
*/
|
|
1549
1585
|
declare class ZScanCommand extends Command<[
|
|
1550
|
-
|
|
1586
|
+
string,
|
|
1551
1587
|
(string | number)[]
|
|
1552
1588
|
], [
|
|
1553
|
-
|
|
1589
|
+
string,
|
|
1554
1590
|
(string | number)[]
|
|
1555
1591
|
]> {
|
|
1556
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1592
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1557
1593
|
}
|
|
1558
1594
|
|
|
1559
1595
|
/**
|
|
@@ -1644,6 +1680,23 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1644
1680
|
* @see https://redis.io/commands/bitcount
|
|
1645
1681
|
*/
|
|
1646
1682
|
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
1685
|
+
*
|
|
1686
|
+
* @example
|
|
1687
|
+
* ```typescript
|
|
1688
|
+
* redis.set("mykey", 0);
|
|
1689
|
+
* const result = await redis.pipeline()
|
|
1690
|
+
* .bitfield("mykey")
|
|
1691
|
+
* .set("u4", 0, 16)
|
|
1692
|
+
* .incr("u4", "#1", 1)
|
|
1693
|
+
* .exec();
|
|
1694
|
+
* console.log(result); // [[0, 1]]
|
|
1695
|
+
* ```
|
|
1696
|
+
*
|
|
1697
|
+
* @see https://redis.io/commands/bitfield
|
|
1698
|
+
*/
|
|
1699
|
+
bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
|
|
1647
1700
|
/**
|
|
1648
1701
|
* @see https://redis.io/commands/bitop
|
|
1649
1702
|
*/
|
|
@@ -1713,7 +1766,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1713
1766
|
* @see https://redis.io/commands/flushdb
|
|
1714
1767
|
*/
|
|
1715
1768
|
flushdb: (opts?: {
|
|
1716
|
-
async?: boolean
|
|
1769
|
+
async?: boolean;
|
|
1717
1770
|
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1718
1771
|
/**
|
|
1719
1772
|
* @see https://redis.io/commands/geoadd
|
|
@@ -1760,11 +1813,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1760
1813
|
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1761
1814
|
count?: {
|
|
1762
1815
|
limit: number;
|
|
1763
|
-
any?: boolean
|
|
1764
|
-
}
|
|
1765
|
-
withCoord?: boolean
|
|
1766
|
-
withDist?: boolean
|
|
1767
|
-
withHash?: boolean
|
|
1816
|
+
any?: boolean;
|
|
1817
|
+
};
|
|
1818
|
+
withCoord?: boolean;
|
|
1819
|
+
withDist?: boolean;
|
|
1820
|
+
withHash?: boolean;
|
|
1768
1821
|
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
1769
1822
|
member: TData;
|
|
1770
1823
|
} & {
|
|
@@ -1801,9 +1854,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1801
1854
|
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1802
1855
|
count?: {
|
|
1803
1856
|
limit: number;
|
|
1804
|
-
any?: boolean
|
|
1805
|
-
}
|
|
1806
|
-
storeDist?: boolean
|
|
1857
|
+
any?: boolean;
|
|
1858
|
+
};
|
|
1859
|
+
storeDist?: boolean;
|
|
1807
1860
|
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1808
1861
|
/**
|
|
1809
1862
|
* @see https://redis.io/commands/get
|
|
@@ -1864,9 +1917,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1864
1917
|
/**
|
|
1865
1918
|
* @see https://redis.io/commands/hmset
|
|
1866
1919
|
*/
|
|
1867
|
-
hmset: <TData>(key: string, kv:
|
|
1868
|
-
[field: string]: TData;
|
|
1869
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1920
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1870
1921
|
/**
|
|
1871
1922
|
* @see https://redis.io/commands/hrandfield
|
|
1872
1923
|
*/
|
|
@@ -1874,13 +1925,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1874
1925
|
/**
|
|
1875
1926
|
* @see https://redis.io/commands/hscan
|
|
1876
1927
|
*/
|
|
1877
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
1928
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
1878
1929
|
/**
|
|
1879
1930
|
* @see https://redis.io/commands/hset
|
|
1880
1931
|
*/
|
|
1881
|
-
hset: <TData>(key: string, kv:
|
|
1882
|
-
[field: string]: TData;
|
|
1883
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1932
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1884
1933
|
/**
|
|
1885
1934
|
* @see https://redis.io/commands/hsetnx
|
|
1886
1935
|
*/
|
|
@@ -1929,13 +1978,17 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1929
1978
|
* @see https://redis.io/commands/lpop
|
|
1930
1979
|
*/
|
|
1931
1980
|
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1981
|
+
/**
|
|
1982
|
+
* @see https://redis.io/commands/lmpop
|
|
1983
|
+
*/
|
|
1984
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
|
|
1932
1985
|
/**
|
|
1933
1986
|
* @see https://redis.io/commands/lpos
|
|
1934
1987
|
*/
|
|
1935
1988
|
lpos: <TData>(key: string, element: unknown, opts?: {
|
|
1936
|
-
rank?: number
|
|
1937
|
-
count?: number
|
|
1938
|
-
maxLen?: number
|
|
1989
|
+
rank?: number;
|
|
1990
|
+
count?: number;
|
|
1991
|
+
maxLen?: number;
|
|
1939
1992
|
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1940
1993
|
/**
|
|
1941
1994
|
* @see https://redis.io/commands/lpush
|
|
@@ -1968,15 +2021,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1968
2021
|
/**
|
|
1969
2022
|
* @see https://redis.io/commands/mset
|
|
1970
2023
|
*/
|
|
1971
|
-
mset: <TData>(kv:
|
|
1972
|
-
[key: string]: TData;
|
|
1973
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2024
|
+
mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1974
2025
|
/**
|
|
1975
2026
|
* @see https://redis.io/commands/msetnx
|
|
1976
2027
|
*/
|
|
1977
|
-
msetnx: <TData>(kv:
|
|
1978
|
-
[key: string]: TData;
|
|
1979
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2028
|
+
msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1980
2029
|
/**
|
|
1981
2030
|
* @see https://redis.io/commands/persist
|
|
1982
2031
|
*/
|
|
@@ -2044,11 +2093,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2044
2093
|
/**
|
|
2045
2094
|
* @see https://redis.io/commands/sadd
|
|
2046
2095
|
*/
|
|
2047
|
-
sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2096
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2048
2097
|
/**
|
|
2049
2098
|
* @see https://redis.io/commands/scan
|
|
2050
2099
|
*/
|
|
2051
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2100
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
|
|
2052
2101
|
/**
|
|
2053
2102
|
* @see https://redis.io/commands/scard
|
|
2054
2103
|
*/
|
|
@@ -2129,7 +2178,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2129
2178
|
/**
|
|
2130
2179
|
* @see https://redis.io/commands/sscan
|
|
2131
2180
|
*/
|
|
2132
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2181
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2133
2182
|
/**
|
|
2134
2183
|
* @see https://redis.io/commands/strlen
|
|
2135
2184
|
*/
|
|
@@ -2165,15 +2214,13 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2165
2214
|
/**
|
|
2166
2215
|
* @see https://redis.io/commands/zadd
|
|
2167
2216
|
*/
|
|
2168
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2217
|
+
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>]>;
|
|
2169
2218
|
/**
|
|
2170
2219
|
* @see https://redis.io/commands/xadd
|
|
2171
2220
|
*/
|
|
2172
|
-
xadd: (key: string, id: string, entries: {
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
nomkStream?: boolean | undefined;
|
|
2176
|
-
trim?: (({
|
|
2221
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
2222
|
+
nomkStream?: boolean;
|
|
2223
|
+
trim?: ({
|
|
2177
2224
|
type: "MAXLEN" | "maxlen";
|
|
2178
2225
|
threshold: number;
|
|
2179
2226
|
} | {
|
|
@@ -2181,11 +2228,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2181
2228
|
threshold: string;
|
|
2182
2229
|
}) & ({
|
|
2183
2230
|
comparison: "~";
|
|
2184
|
-
limit?: number
|
|
2231
|
+
limit?: number;
|
|
2185
2232
|
} | {
|
|
2186
2233
|
comparison: "=";
|
|
2187
|
-
limit?:
|
|
2188
|
-
})
|
|
2234
|
+
limit?: never;
|
|
2235
|
+
});
|
|
2189
2236
|
} | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2190
2237
|
/**
|
|
2191
2238
|
* @see https://redis.io/commands/xack
|
|
@@ -2201,11 +2248,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2201
2248
|
xgroup: (key: string, opts: {
|
|
2202
2249
|
type: "CREATE";
|
|
2203
2250
|
group: string;
|
|
2204
|
-
id: string;
|
|
2251
|
+
id: `$` | string;
|
|
2205
2252
|
options?: {
|
|
2206
|
-
MKSTREAM?: boolean
|
|
2207
|
-
ENTRIESREAD?: number
|
|
2208
|
-
}
|
|
2253
|
+
MKSTREAM?: boolean;
|
|
2254
|
+
ENTRIESREAD?: number;
|
|
2255
|
+
};
|
|
2209
2256
|
} | {
|
|
2210
2257
|
type: "CREATECONSUMER";
|
|
2211
2258
|
group: string;
|
|
@@ -2220,10 +2267,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2220
2267
|
} | {
|
|
2221
2268
|
type: "SETID";
|
|
2222
2269
|
group: string;
|
|
2223
|
-
id: string;
|
|
2270
|
+
id: `$` | string;
|
|
2224
2271
|
options?: {
|
|
2225
|
-
ENTRIESREAD?: number
|
|
2226
|
-
}
|
|
2272
|
+
ENTRIESREAD?: number;
|
|
2273
|
+
};
|
|
2227
2274
|
}) => Pipeline<[...TCommands, Command<any, never>]>;
|
|
2228
2275
|
/**
|
|
2229
2276
|
* @see https://redis.io/commands/xread
|
|
@@ -2250,35 +2297,35 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2250
2297
|
* @see https://redis.io/commands/xpending
|
|
2251
2298
|
*/
|
|
2252
2299
|
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
2253
|
-
idleTime?: number
|
|
2254
|
-
consumer?: string | string[]
|
|
2300
|
+
idleTime?: number;
|
|
2301
|
+
consumer?: string | string[];
|
|
2255
2302
|
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2256
2303
|
/**
|
|
2257
2304
|
* @see https://redis.io/commands/xclaim
|
|
2258
2305
|
*/
|
|
2259
2306
|
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
2260
|
-
idleMS?: number
|
|
2261
|
-
timeMS?: number
|
|
2262
|
-
retryCount?: number
|
|
2263
|
-
force?: boolean
|
|
2264
|
-
justId?: boolean
|
|
2265
|
-
lastId?: number
|
|
2307
|
+
idleMS?: number;
|
|
2308
|
+
timeMS?: number;
|
|
2309
|
+
retryCount?: number;
|
|
2310
|
+
force?: boolean;
|
|
2311
|
+
justId?: boolean;
|
|
2312
|
+
lastId?: number;
|
|
2266
2313
|
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2267
2314
|
/**
|
|
2268
2315
|
* @see https://redis.io/commands/xautoclaim
|
|
2269
2316
|
*/
|
|
2270
2317
|
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
2271
|
-
count?: number
|
|
2272
|
-
justId?: boolean
|
|
2318
|
+
count?: number;
|
|
2319
|
+
justId?: boolean;
|
|
2273
2320
|
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2274
2321
|
/**
|
|
2275
2322
|
* @see https://redis.io/commands/xtrim
|
|
2276
2323
|
*/
|
|
2277
2324
|
xtrim: (key: string, options: {
|
|
2278
2325
|
strategy: "MAXLEN" | "MINID";
|
|
2279
|
-
exactness?: "~" | "="
|
|
2280
|
-
threshold:
|
|
2281
|
-
limit?: number
|
|
2326
|
+
exactness?: "~" | "=";
|
|
2327
|
+
threshold: number | string;
|
|
2328
|
+
limit?: number;
|
|
2282
2329
|
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2283
2330
|
/**
|
|
2284
2331
|
* @see https://redis.io/commands/xrange
|
|
@@ -2323,21 +2370,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2323
2370
|
/**
|
|
2324
2371
|
* @see https://redis.io/commands/zrange
|
|
2325
2372
|
*/
|
|
2326
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
byLex: true;
|
|
2332
|
-
} & ZRangeCommandOptions
|
|
2333
|
-
] | [
|
|
2334
|
-
key: string,
|
|
2335
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
2336
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
2337
|
-
opts: {
|
|
2338
|
-
byScore: true;
|
|
2339
|
-
} & ZRangeCommandOptions
|
|
2340
|
-
]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2373
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
2374
|
+
byLex: true;
|
|
2375
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
2376
|
+
byScore: true;
|
|
2377
|
+
} & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2341
2378
|
/**
|
|
2342
2379
|
* @see https://redis.io/commands/zrank
|
|
2343
2380
|
*/
|
|
@@ -2365,7 +2402,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2365
2402
|
/**
|
|
2366
2403
|
* @see https://redis.io/commands/zscan
|
|
2367
2404
|
*/
|
|
2368
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2405
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2369
2406
|
/**
|
|
2370
2407
|
* @see https://redis.io/commands/zscore
|
|
2371
2408
|
*/
|
|
@@ -2426,6 +2463,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2426
2463
|
* @see https://redis.io/commands/json.mget
|
|
2427
2464
|
*/
|
|
2428
2465
|
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2466
|
+
/**
|
|
2467
|
+
* @see https://redis.io/commands/json.mset
|
|
2468
|
+
*/
|
|
2469
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2429
2470
|
/**
|
|
2430
2471
|
* @see https://redis.io/commands/json.numincrby
|
|
2431
2472
|
*/
|
|
@@ -2451,9 +2492,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2451
2492
|
*/
|
|
2452
2493
|
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2453
2494
|
nx: true;
|
|
2454
|
-
xx?:
|
|
2495
|
+
xx?: never;
|
|
2455
2496
|
} | {
|
|
2456
|
-
nx?:
|
|
2497
|
+
nx?: never;
|
|
2457
2498
|
xx: true;
|
|
2458
2499
|
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2459
2500
|
/**
|
|
@@ -2524,6 +2565,7 @@ declare class Redis {
|
|
|
2524
2565
|
protected client: Requester;
|
|
2525
2566
|
protected opts?: CommandOptions<any, any>;
|
|
2526
2567
|
protected enableTelemetry: boolean;
|
|
2568
|
+
protected enableAutoPipelining: boolean;
|
|
2527
2569
|
/**
|
|
2528
2570
|
* Create a new redis client
|
|
2529
2571
|
*
|
|
@@ -2536,6 +2578,8 @@ declare class Redis {
|
|
|
2536
2578
|
* ```
|
|
2537
2579
|
*/
|
|
2538
2580
|
constructor(client: Requester, opts?: RedisOptions);
|
|
2581
|
+
get readYourWritesSyncToken(): string | undefined;
|
|
2582
|
+
set readYourWritesSyncToken(session: string | undefined);
|
|
2539
2583
|
get json(): {
|
|
2540
2584
|
/**
|
|
2541
2585
|
* @see https://redis.io/commands/json.arrappend
|
|
@@ -2580,7 +2624,11 @@ declare class Redis {
|
|
|
2580
2624
|
/**
|
|
2581
2625
|
* @see https://redis.io/commands/json.mget
|
|
2582
2626
|
*/
|
|
2583
|
-
mget: <
|
|
2627
|
+
mget: <TData>(keys: string[], path: string) => Promise<TData>;
|
|
2628
|
+
/**
|
|
2629
|
+
* @see https://redis.io/commands/json.mset
|
|
2630
|
+
*/
|
|
2631
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
|
|
2584
2632
|
/**
|
|
2585
2633
|
* @see https://redis.io/commands/json.numincrby
|
|
2586
2634
|
*/
|
|
@@ -2606,9 +2654,9 @@ declare class Redis {
|
|
|
2606
2654
|
*/
|
|
2607
2655
|
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2608
2656
|
nx: true;
|
|
2609
|
-
xx?:
|
|
2657
|
+
xx?: never;
|
|
2610
2658
|
} | {
|
|
2611
|
-
nx?:
|
|
2659
|
+
nx?: never;
|
|
2612
2660
|
xx: true;
|
|
2613
2661
|
} | undefined) => Promise<"OK" | null>;
|
|
2614
2662
|
/**
|
|
@@ -2643,6 +2691,7 @@ declare class Redis {
|
|
|
2643
2691
|
* @see {@link Pipeline}
|
|
2644
2692
|
*/
|
|
2645
2693
|
pipeline: () => Pipeline<[]>;
|
|
2694
|
+
protected autoPipeline: () => Redis;
|
|
2646
2695
|
/**
|
|
2647
2696
|
* Create a new transaction to allow executing multiple steps atomically.
|
|
2648
2697
|
*
|
|
@@ -2653,6 +2702,22 @@ declare class Redis {
|
|
|
2653
2702
|
* @see {@link Pipeline}
|
|
2654
2703
|
*/
|
|
2655
2704
|
multi: () => Pipeline<[]>;
|
|
2705
|
+
/**
|
|
2706
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
2707
|
+
*
|
|
2708
|
+
* @example
|
|
2709
|
+
* ```typescript
|
|
2710
|
+
* redis.set("mykey", 0);
|
|
2711
|
+
* const result = await redis.bitfield("mykey")
|
|
2712
|
+
* .set("u4", 0, 16)
|
|
2713
|
+
* .incr("u4", "#1", 1)
|
|
2714
|
+
* .exec();
|
|
2715
|
+
* console.log(result); // [0, 1]
|
|
2716
|
+
* ```
|
|
2717
|
+
*
|
|
2718
|
+
* @see https://redis.io/commands/bitfield
|
|
2719
|
+
*/
|
|
2720
|
+
bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
|
|
2656
2721
|
/**
|
|
2657
2722
|
* @see https://redis.io/commands/append
|
|
2658
2723
|
*/
|
|
@@ -2726,7 +2791,7 @@ declare class Redis {
|
|
|
2726
2791
|
* @see https://redis.io/commands/flushdb
|
|
2727
2792
|
*/
|
|
2728
2793
|
flushdb: (opts?: {
|
|
2729
|
-
async?: boolean
|
|
2794
|
+
async?: boolean;
|
|
2730
2795
|
} | undefined) => Promise<"OK">;
|
|
2731
2796
|
/**
|
|
2732
2797
|
* @see https://redis.io/commands/geoadd
|
|
@@ -2773,11 +2838,11 @@ declare class Redis {
|
|
|
2773
2838
|
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2774
2839
|
count?: {
|
|
2775
2840
|
limit: number;
|
|
2776
|
-
any?: boolean
|
|
2777
|
-
}
|
|
2778
|
-
withCoord?: boolean
|
|
2779
|
-
withDist?: boolean
|
|
2780
|
-
withHash?: boolean
|
|
2841
|
+
any?: boolean;
|
|
2842
|
+
};
|
|
2843
|
+
withCoord?: boolean;
|
|
2844
|
+
withDist?: boolean;
|
|
2845
|
+
withHash?: boolean;
|
|
2781
2846
|
} | undefined) => Promise<({
|
|
2782
2847
|
member: TData;
|
|
2783
2848
|
} & {
|
|
@@ -2814,9 +2879,9 @@ declare class Redis {
|
|
|
2814
2879
|
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2815
2880
|
count?: {
|
|
2816
2881
|
limit: number;
|
|
2817
|
-
any?: boolean
|
|
2818
|
-
}
|
|
2819
|
-
storeDist?: boolean
|
|
2882
|
+
any?: boolean;
|
|
2883
|
+
};
|
|
2884
|
+
storeDist?: boolean;
|
|
2820
2885
|
} | undefined) => Promise<number>;
|
|
2821
2886
|
/**
|
|
2822
2887
|
* @see https://redis.io/commands/get
|
|
@@ -2877,27 +2942,23 @@ declare class Redis {
|
|
|
2877
2942
|
/**
|
|
2878
2943
|
* @see https://redis.io/commands/hmset
|
|
2879
2944
|
*/
|
|
2880
|
-
hmset: <TData>(key: string, kv:
|
|
2881
|
-
[field: string]: TData;
|
|
2882
|
-
}) => Promise<"OK">;
|
|
2945
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
|
|
2883
2946
|
/**
|
|
2884
2947
|
* @see https://redis.io/commands/hrandfield
|
|
2885
2948
|
*/
|
|
2886
2949
|
hrandfield: {
|
|
2887
|
-
(key: string): Promise<string>;
|
|
2950
|
+
(key: string): Promise<string | null>;
|
|
2888
2951
|
(key: string, count: number): Promise<string[]>;
|
|
2889
2952
|
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
2890
2953
|
};
|
|
2891
2954
|
/**
|
|
2892
2955
|
* @see https://redis.io/commands/hscan
|
|
2893
2956
|
*/
|
|
2894
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[
|
|
2957
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
2895
2958
|
/**
|
|
2896
2959
|
* @see https://redis.io/commands/hset
|
|
2897
2960
|
*/
|
|
2898
|
-
hset: <TData>(key: string, kv:
|
|
2899
|
-
[field: string]: TData;
|
|
2900
|
-
}) => Promise<number>;
|
|
2961
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
|
|
2901
2962
|
/**
|
|
2902
2963
|
* @see https://redis.io/commands/hsetnx
|
|
2903
2964
|
*/
|
|
@@ -2946,13 +3007,17 @@ declare class Redis {
|
|
|
2946
3007
|
* @see https://redis.io/commands/lpop
|
|
2947
3008
|
*/
|
|
2948
3009
|
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
3010
|
+
/**
|
|
3011
|
+
* @see https://redis.io/commands/lmpop
|
|
3012
|
+
*/
|
|
3013
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
|
|
2949
3014
|
/**
|
|
2950
3015
|
* @see https://redis.io/commands/lpos
|
|
2951
3016
|
*/
|
|
2952
3017
|
lpos: <TData = number>(key: string, element: unknown, opts?: {
|
|
2953
|
-
rank?: number
|
|
2954
|
-
count?: number
|
|
2955
|
-
maxLen?: number
|
|
3018
|
+
rank?: number;
|
|
3019
|
+
count?: number;
|
|
3020
|
+
maxLen?: number;
|
|
2956
3021
|
} | undefined) => Promise<TData>;
|
|
2957
3022
|
/**
|
|
2958
3023
|
* @see https://redis.io/commands/lpush
|
|
@@ -2985,15 +3050,11 @@ declare class Redis {
|
|
|
2985
3050
|
/**
|
|
2986
3051
|
* @see https://redis.io/commands/mset
|
|
2987
3052
|
*/
|
|
2988
|
-
mset: <TData>(kv:
|
|
2989
|
-
[key: string]: TData;
|
|
2990
|
-
}) => Promise<"OK">;
|
|
3053
|
+
mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
|
|
2991
3054
|
/**
|
|
2992
3055
|
* @see https://redis.io/commands/msetnx
|
|
2993
3056
|
*/
|
|
2994
|
-
msetnx: <TData>(kv:
|
|
2995
|
-
[key: string]: TData;
|
|
2996
|
-
}) => Promise<number>;
|
|
3057
|
+
msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
|
|
2997
3058
|
/**
|
|
2998
3059
|
* @see https://redis.io/commands/persist
|
|
2999
3060
|
*/
|
|
@@ -3061,11 +3122,11 @@ declare class Redis {
|
|
|
3061
3122
|
/**
|
|
3062
3123
|
* @see https://redis.io/commands/sadd
|
|
3063
3124
|
*/
|
|
3064
|
-
sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
3125
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
|
|
3065
3126
|
/**
|
|
3066
3127
|
* @see https://redis.io/commands/scan
|
|
3067
3128
|
*/
|
|
3068
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3129
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
|
|
3069
3130
|
/**
|
|
3070
3131
|
* @see https://redis.io/commands/scard
|
|
3071
3132
|
*/
|
|
@@ -3149,7 +3210,7 @@ declare class Redis {
|
|
|
3149
3210
|
/**
|
|
3150
3211
|
* @see https://redis.io/commands/sscan
|
|
3151
3212
|
*/
|
|
3152
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3213
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3153
3214
|
/**
|
|
3154
3215
|
* @see https://redis.io/commands/strlen
|
|
3155
3216
|
*/
|
|
@@ -3185,11 +3246,9 @@ declare class Redis {
|
|
|
3185
3246
|
/**
|
|
3186
3247
|
* @see https://redis.io/commands/xadd
|
|
3187
3248
|
*/
|
|
3188
|
-
xadd: (key: string, id: string, entries: {
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
nomkStream?: boolean | undefined;
|
|
3192
|
-
trim?: (({
|
|
3249
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
3250
|
+
nomkStream?: boolean;
|
|
3251
|
+
trim?: ({
|
|
3193
3252
|
type: "MAXLEN" | "maxlen";
|
|
3194
3253
|
threshold: number;
|
|
3195
3254
|
} | {
|
|
@@ -3197,11 +3256,11 @@ declare class Redis {
|
|
|
3197
3256
|
threshold: string;
|
|
3198
3257
|
}) & ({
|
|
3199
3258
|
comparison: "~";
|
|
3200
|
-
limit?: number
|
|
3259
|
+
limit?: number;
|
|
3201
3260
|
} | {
|
|
3202
3261
|
comparison: "=";
|
|
3203
|
-
limit?:
|
|
3204
|
-
})
|
|
3262
|
+
limit?: never;
|
|
3263
|
+
});
|
|
3205
3264
|
} | undefined) => Promise<string>;
|
|
3206
3265
|
/**
|
|
3207
3266
|
* @see https://redis.io/commands/xack
|
|
@@ -3217,11 +3276,11 @@ declare class Redis {
|
|
|
3217
3276
|
xgroup: (key: string, opts: {
|
|
3218
3277
|
type: "CREATE";
|
|
3219
3278
|
group: string;
|
|
3220
|
-
id: string;
|
|
3279
|
+
id: `$` | string;
|
|
3221
3280
|
options?: {
|
|
3222
|
-
MKSTREAM?: boolean
|
|
3223
|
-
ENTRIESREAD?: number
|
|
3224
|
-
}
|
|
3281
|
+
MKSTREAM?: boolean;
|
|
3282
|
+
ENTRIESREAD?: number;
|
|
3283
|
+
};
|
|
3225
3284
|
} | {
|
|
3226
3285
|
type: "CREATECONSUMER";
|
|
3227
3286
|
group: string;
|
|
@@ -3236,10 +3295,10 @@ declare class Redis {
|
|
|
3236
3295
|
} | {
|
|
3237
3296
|
type: "SETID";
|
|
3238
3297
|
group: string;
|
|
3239
|
-
id: string;
|
|
3298
|
+
id: `$` | string;
|
|
3240
3299
|
options?: {
|
|
3241
|
-
ENTRIESREAD?: number
|
|
3242
|
-
}
|
|
3300
|
+
ENTRIESREAD?: number;
|
|
3301
|
+
};
|
|
3243
3302
|
}) => Promise<never>;
|
|
3244
3303
|
/**
|
|
3245
3304
|
* @see https://redis.io/commands/xread
|
|
@@ -3266,35 +3325,35 @@ declare class Redis {
|
|
|
3266
3325
|
* @see https://redis.io/commands/xpending
|
|
3267
3326
|
*/
|
|
3268
3327
|
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
3269
|
-
idleTime?: number
|
|
3270
|
-
consumer?: string | string[]
|
|
3328
|
+
idleTime?: number;
|
|
3329
|
+
consumer?: string | string[];
|
|
3271
3330
|
} | undefined) => Promise<unknown[]>;
|
|
3272
3331
|
/**
|
|
3273
3332
|
* @see https://redis.io/commands/xclaim
|
|
3274
3333
|
*/
|
|
3275
3334
|
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
3276
|
-
idleMS?: number
|
|
3277
|
-
timeMS?: number
|
|
3278
|
-
retryCount?: number
|
|
3279
|
-
force?: boolean
|
|
3280
|
-
justId?: boolean
|
|
3281
|
-
lastId?: number
|
|
3335
|
+
idleMS?: number;
|
|
3336
|
+
timeMS?: number;
|
|
3337
|
+
retryCount?: number;
|
|
3338
|
+
force?: boolean;
|
|
3339
|
+
justId?: boolean;
|
|
3340
|
+
lastId?: number;
|
|
3282
3341
|
} | undefined) => Promise<unknown[]>;
|
|
3283
3342
|
/**
|
|
3284
3343
|
* @see https://redis.io/commands/xautoclaim
|
|
3285
3344
|
*/
|
|
3286
3345
|
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
3287
|
-
count?: number
|
|
3288
|
-
justId?: boolean
|
|
3346
|
+
count?: number;
|
|
3347
|
+
justId?: boolean;
|
|
3289
3348
|
} | undefined) => Promise<unknown[]>;
|
|
3290
3349
|
/**
|
|
3291
3350
|
* @see https://redis.io/commands/xtrim
|
|
3292
3351
|
*/
|
|
3293
3352
|
xtrim: (key: string, options: {
|
|
3294
3353
|
strategy: "MAXLEN" | "MINID";
|
|
3295
|
-
exactness?: "~" | "="
|
|
3296
|
-
threshold:
|
|
3297
|
-
limit?: number
|
|
3354
|
+
exactness?: "~" | "=";
|
|
3355
|
+
threshold: number | string;
|
|
3356
|
+
limit?: number;
|
|
3298
3357
|
}) => Promise<number>;
|
|
3299
3358
|
/**
|
|
3300
3359
|
* @see https://redis.io/commands/xrange
|
|
@@ -3307,7 +3366,7 @@ declare class Redis {
|
|
|
3307
3366
|
/**
|
|
3308
3367
|
* @see https://redis.io/commands/zadd
|
|
3309
3368
|
*/
|
|
3310
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
|
|
3369
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
|
|
3311
3370
|
/**
|
|
3312
3371
|
* @see https://redis.io/commands/zcard
|
|
3313
3372
|
*/
|
|
@@ -3347,21 +3406,11 @@ declare class Redis {
|
|
|
3347
3406
|
/**
|
|
3348
3407
|
* @see https://redis.io/commands/zrange
|
|
3349
3408
|
*/
|
|
3350
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
byLex: true;
|
|
3356
|
-
} & ZRangeCommandOptions
|
|
3357
|
-
] | [
|
|
3358
|
-
key: string,
|
|
3359
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
3360
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
3361
|
-
opts: {
|
|
3362
|
-
byScore: true;
|
|
3363
|
-
} & ZRangeCommandOptions
|
|
3364
|
-
]) => Promise<TData>;
|
|
3409
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
3410
|
+
byLex: true;
|
|
3411
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
3412
|
+
byScore: true;
|
|
3413
|
+
} & ZRangeCommandOptions]) => Promise<TData>;
|
|
3365
3414
|
/**
|
|
3366
3415
|
* @see https://redis.io/commands/zrank
|
|
3367
3416
|
*/
|
|
@@ -3389,7 +3438,7 @@ declare class Redis {
|
|
|
3389
3438
|
/**
|
|
3390
3439
|
* @see https://redis.io/commands/zscan
|
|
3391
3440
|
*/
|
|
3392
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3441
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3393
3442
|
/**
|
|
3394
3443
|
* @see https://redis.io/commands/zscore
|
|
3395
3444
|
*/
|
|
@@ -3404,6 +3453,24 @@ declare class Redis {
|
|
|
3404
3453
|
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
3405
3454
|
}
|
|
3406
3455
|
|
|
3456
|
+
/**
|
|
3457
|
+
* Result of a bad request to upstash
|
|
3458
|
+
*/
|
|
3459
|
+
declare class UpstashError extends Error {
|
|
3460
|
+
constructor(message: string);
|
|
3461
|
+
}
|
|
3462
|
+
declare class UrlError extends Error {
|
|
3463
|
+
constructor(url: string);
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
type error_UpstashError = UpstashError;
|
|
3467
|
+
declare const error_UpstashError: typeof UpstashError;
|
|
3468
|
+
type error_UrlError = UrlError;
|
|
3469
|
+
declare const error_UrlError: typeof UrlError;
|
|
3470
|
+
declare namespace error {
|
|
3471
|
+
export { error_UpstashError as UpstashError, error_UrlError as UrlError };
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3407
3474
|
/**
|
|
3408
3475
|
* @see https://redis.io/commands/zdiffstore
|
|
3409
3476
|
*/
|
|
@@ -3418,4 +3485,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
3418
3485
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
3419
3486
|
}
|
|
3420
3487
|
|
|
3421
|
-
export {
|
|
3488
|
+
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, type RedisOptions as R, HLenCommand as S, HMGetCommand as T, type UpstashRequest as U, HMSetCommand as V, HRandFieldCommand as W, HScanCommand as X, HSetCommand as Y, HSetNXCommand as Z, HStrLenCommand as _, type 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, type ScanCommandOptions as aS, SCardCommand as aT, ScriptExistsCommand as aU, ScriptFlushCommand as aV, ScriptLoadCommand as aW, SDiffCommand as aX, SDiffStoreCommand as aY, SetCommand as aZ, type 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, type 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, type ZUnionCommandOptions as bM, ZUnionStoreCommand as bN, type 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 Type as bj, TypeCommand as bk, UnlinkCommand as bl, XAddCommand as bm, XRangeCommand as bn, type ScoreMember as bo, type ZAddCommandOptions as bp, ZAddCommand as bq, ZCardCommand as br, ZCountCommand as bs, ZDiffStoreCommand as bt, ZIncrByCommand as bu, ZInterStoreCommand as bv, type ZInterStoreCommandOptions as bw, ZLexCountCommand as bx, ZMScoreCommand as by, ZPopMaxCommand 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 };
|