@upstash/redis 0.0.0-ci.cadfe394ccdd0faf3ed5d166df7396372f47147e-20240215094904 → 0.0.0-ci.cb27f2dedaa904232a2ff3a631b20ff886188ff3-20240708092746
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 +5 -0
- package/chunk-ICY7VPJS.mjs +1 -0
- package/chunk-INLNQPTV.js +1 -0
- package/cloudflare.d.mts +5 -4
- package/cloudflare.d.ts +5 -4
- package/cloudflare.js +1 -1
- package/cloudflare.mjs +1 -1
- package/fastly.d.mts +5 -4
- package/fastly.d.ts +5 -4
- package/fastly.js +1 -1
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +6 -4
- package/nodejs.d.ts +6 -4
- package/nodejs.js +1 -1
- package/nodejs.mjs +1 -1
- package/package.json +1 -1
- package/{zmscore-0b710ce5.d.ts → zmscore-c8e05e79.d.ts} +152 -53
- package/chunk-3HKUW56P.js +0 -1
- package/chunk-GW4BEX5X.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";
|
|
@@ -106,6 +109,7 @@ type CommandOptions<TResult, TData> = {
|
|
|
106
109
|
* @default true
|
|
107
110
|
*/
|
|
108
111
|
automaticDeserialization?: boolean;
|
|
112
|
+
latencyLogging?: boolean;
|
|
109
113
|
};
|
|
110
114
|
/**
|
|
111
115
|
* Command offers default (de)serialization and the exec method to all commands.
|
|
@@ -129,7 +133,8 @@ declare class Command<TResult, TData> {
|
|
|
129
133
|
exec(client: Requester): Promise<TData>;
|
|
130
134
|
}
|
|
131
135
|
|
|
132
|
-
type
|
|
136
|
+
type ZUnionCommandOptions = {
|
|
137
|
+
withScores?: boolean;
|
|
133
138
|
aggregate?: "sum" | "min" | "max";
|
|
134
139
|
} & ({
|
|
135
140
|
weight: number;
|
|
@@ -142,15 +147,14 @@ type ZUnionStoreCommandOptions = {
|
|
|
142
147
|
weights?: never;
|
|
143
148
|
});
|
|
144
149
|
/**
|
|
145
|
-
* @see https://redis.io/commands/
|
|
150
|
+
* @see https://redis.io/commands/zunion
|
|
146
151
|
*/
|
|
147
|
-
declare class
|
|
148
|
-
constructor(cmd: [
|
|
149
|
-
constructor(cmd: [
|
|
152
|
+
declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
|
|
153
|
+
constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
154
|
+
constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
150
155
|
}
|
|
151
156
|
|
|
152
|
-
type
|
|
153
|
-
withScores?: boolean;
|
|
157
|
+
type ZUnionStoreCommandOptions = {
|
|
154
158
|
aggregate?: "sum" | "min" | "max";
|
|
155
159
|
} & ({
|
|
156
160
|
weight: number;
|
|
@@ -163,11 +167,11 @@ type ZUnionCommandOptions = {
|
|
|
163
167
|
weights?: never;
|
|
164
168
|
});
|
|
165
169
|
/**
|
|
166
|
-
* @see https://redis.io/commands/
|
|
170
|
+
* @see https://redis.io/commands/zunionstore
|
|
167
171
|
*/
|
|
168
|
-
declare class
|
|
169
|
-
constructor(cmd: [numKeys: 1, key: string, opts?:
|
|
170
|
-
constructor(cmd: [numKeys: number, keys: string[], opts?:
|
|
172
|
+
declare class ZUnionStoreCommand extends Command<number, number> {
|
|
173
|
+
constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
174
|
+
constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
171
175
|
}
|
|
172
176
|
|
|
173
177
|
type ZInterStoreCommandOptions = {
|
|
@@ -220,8 +224,8 @@ type ScanCommandOptions = {
|
|
|
220
224
|
/**
|
|
221
225
|
* @see https://redis.io/commands/scan
|
|
222
226
|
*/
|
|
223
|
-
declare class ScanCommand extends Command<[
|
|
224
|
-
constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
227
|
+
declare class ScanCommand extends Command<[string, string[]], [string, string[]]> {
|
|
228
|
+
constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], [string, string[]]>);
|
|
225
229
|
}
|
|
226
230
|
|
|
227
231
|
type GeoAddCommandOptions = {
|
|
@@ -264,6 +268,28 @@ declare class BitCountCommand extends Command<number, number> {
|
|
|
264
268
|
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
265
269
|
}
|
|
266
270
|
|
|
271
|
+
type SubCommandArgs<TRest extends unknown[] = []> = [
|
|
272
|
+
encoding: string,
|
|
273
|
+
offset: number | string,
|
|
274
|
+
...TRest
|
|
275
|
+
];
|
|
276
|
+
/**
|
|
277
|
+
* @see https://redis.io/commands/bitfield
|
|
278
|
+
*/
|
|
279
|
+
declare class BitFieldCommand<T = Promise<number[]>> {
|
|
280
|
+
private client;
|
|
281
|
+
private opts?;
|
|
282
|
+
private execOperation;
|
|
283
|
+
private command;
|
|
284
|
+
constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
|
|
285
|
+
private chain;
|
|
286
|
+
get(...args: SubCommandArgs): this;
|
|
287
|
+
set(...args: SubCommandArgs<[value: number]>): this;
|
|
288
|
+
incrby(...args: SubCommandArgs<[increment: number]>): this;
|
|
289
|
+
overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
|
|
290
|
+
exec(): T;
|
|
291
|
+
}
|
|
292
|
+
|
|
267
293
|
/**
|
|
268
294
|
* @see https://redis.io/commands/bitop
|
|
269
295
|
*/
|
|
@@ -635,13 +661,13 @@ declare class HRandFieldCommand<TData extends string | string[] | Record<string,
|
|
|
635
661
|
* @see https://redis.io/commands/hscan
|
|
636
662
|
*/
|
|
637
663
|
declare class HScanCommand extends Command<[
|
|
638
|
-
|
|
664
|
+
string,
|
|
639
665
|
(string | number)[]
|
|
640
666
|
], [
|
|
641
|
-
|
|
667
|
+
string,
|
|
642
668
|
(string | number)[]
|
|
643
669
|
]> {
|
|
644
|
-
constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[
|
|
670
|
+
constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
645
671
|
}
|
|
646
672
|
|
|
647
673
|
/**
|
|
@@ -1240,13 +1266,13 @@ declare class SRemCommand<TData = string> extends Command<number, number> {
|
|
|
1240
1266
|
* @see https://redis.io/commands/sscan
|
|
1241
1267
|
*/
|
|
1242
1268
|
declare class SScanCommand extends Command<[
|
|
1243
|
-
|
|
1269
|
+
string,
|
|
1244
1270
|
(string | number)[]
|
|
1245
1271
|
], [
|
|
1246
|
-
|
|
1272
|
+
string,
|
|
1247
1273
|
(string | number)[]
|
|
1248
1274
|
]> {
|
|
1249
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1275
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1250
1276
|
}
|
|
1251
1277
|
|
|
1252
1278
|
/**
|
|
@@ -1547,13 +1573,13 @@ declare class ZRevRankCommand<TData> extends Command<number | null, number | nul
|
|
|
1547
1573
|
* @see https://redis.io/commands/zscan
|
|
1548
1574
|
*/
|
|
1549
1575
|
declare class ZScanCommand extends Command<[
|
|
1550
|
-
|
|
1576
|
+
string,
|
|
1551
1577
|
(string | number)[]
|
|
1552
1578
|
], [
|
|
1553
|
-
|
|
1579
|
+
string,
|
|
1554
1580
|
(string | number)[]
|
|
1555
1581
|
]> {
|
|
1556
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1582
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1557
1583
|
}
|
|
1558
1584
|
|
|
1559
1585
|
/**
|
|
@@ -1644,6 +1670,23 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1644
1670
|
* @see https://redis.io/commands/bitcount
|
|
1645
1671
|
*/
|
|
1646
1672
|
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1673
|
+
/**
|
|
1674
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
1675
|
+
*
|
|
1676
|
+
* @example
|
|
1677
|
+
* ```typescript
|
|
1678
|
+
* redis.set("mykey", 0);
|
|
1679
|
+
* const result = await redis.pipeline()
|
|
1680
|
+
* .bitfield("mykey")
|
|
1681
|
+
* .set("u4", 0, 16)
|
|
1682
|
+
* .incr("u4", "#1", 1)
|
|
1683
|
+
* .exec();
|
|
1684
|
+
* console.log(result); // [[0, 1]]
|
|
1685
|
+
* ```
|
|
1686
|
+
*
|
|
1687
|
+
* @see https://redis.io/commands/bitfield
|
|
1688
|
+
*/
|
|
1689
|
+
bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
|
|
1647
1690
|
/**
|
|
1648
1691
|
* @see https://redis.io/commands/bitop
|
|
1649
1692
|
*/
|
|
@@ -1718,26 +1761,26 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1718
1761
|
/**
|
|
1719
1762
|
* @see https://redis.io/commands/geoadd
|
|
1720
1763
|
*/
|
|
1721
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<
|
|
1764
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
1722
1765
|
/**
|
|
1723
1766
|
* @see https://redis.io/commands/geodist
|
|
1724
1767
|
*/
|
|
1725
|
-
geodist: (key: string, member1:
|
|
1768
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
1726
1769
|
/**
|
|
1727
1770
|
* @see https://redis.io/commands/geopos
|
|
1728
1771
|
*/
|
|
1729
|
-
geopos: (args_0: string, ...args_1:
|
|
1772
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
|
|
1730
1773
|
lng: number;
|
|
1731
1774
|
lat: number;
|
|
1732
1775
|
}[]>]>;
|
|
1733
1776
|
/**
|
|
1734
1777
|
* @see https://redis.io/commands/geohash
|
|
1735
1778
|
*/
|
|
1736
|
-
geohash: (args_0: string, ...args_1:
|
|
1779
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
1737
1780
|
/**
|
|
1738
1781
|
* @see https://redis.io/commands/geosearch
|
|
1739
1782
|
*/
|
|
1740
|
-
geosearch: (key: string, centerPoint: {
|
|
1783
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
1741
1784
|
type: "FROMLONLAT" | "fromlonlat";
|
|
1742
1785
|
coordinate: {
|
|
1743
1786
|
lon: number;
|
|
@@ -1745,7 +1788,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1745
1788
|
};
|
|
1746
1789
|
} | {
|
|
1747
1790
|
type: "FROMMEMBER" | "frommember";
|
|
1748
|
-
member:
|
|
1791
|
+
member: TData;
|
|
1749
1792
|
}, shape: {
|
|
1750
1793
|
type: "BYRADIUS" | "byradius";
|
|
1751
1794
|
radius: number;
|
|
@@ -1766,7 +1809,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1766
1809
|
withDist?: boolean | undefined;
|
|
1767
1810
|
withHash?: boolean | undefined;
|
|
1768
1811
|
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
1769
|
-
member:
|
|
1812
|
+
member: TData;
|
|
1770
1813
|
} & {
|
|
1771
1814
|
coord?: {
|
|
1772
1815
|
long: number;
|
|
@@ -1778,7 +1821,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1778
1821
|
/**
|
|
1779
1822
|
* @see https://redis.io/commands/geosearchstore
|
|
1780
1823
|
*/
|
|
1781
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
1824
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
1782
1825
|
type: "FROMLONLAT" | "fromlonlat";
|
|
1783
1826
|
coordinate: {
|
|
1784
1827
|
lon: number;
|
|
@@ -1786,7 +1829,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1786
1829
|
};
|
|
1787
1830
|
} | {
|
|
1788
1831
|
type: "FROMMEMBER" | "frommember";
|
|
1789
|
-
member:
|
|
1832
|
+
member: TData;
|
|
1790
1833
|
}, shape: {
|
|
1791
1834
|
type: "BYRADIUS" | "byradius";
|
|
1792
1835
|
radius: number;
|
|
@@ -1870,11 +1913,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1870
1913
|
/**
|
|
1871
1914
|
* @see https://redis.io/commands/hrandfield
|
|
1872
1915
|
*/
|
|
1873
|
-
hrandfield: <TData extends string |
|
|
1916
|
+
hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1874
1917
|
/**
|
|
1875
1918
|
* @see https://redis.io/commands/hscan
|
|
1876
1919
|
*/
|
|
1877
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
1920
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
1878
1921
|
/**
|
|
1879
1922
|
* @see https://redis.io/commands/hset
|
|
1880
1923
|
*/
|
|
@@ -1929,6 +1972,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1929
1972
|
* @see https://redis.io/commands/lpop
|
|
1930
1973
|
*/
|
|
1931
1974
|
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1975
|
+
/**
|
|
1976
|
+
* @see https://redis.io/commands/lmpop
|
|
1977
|
+
*/
|
|
1978
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
|
|
1932
1979
|
/**
|
|
1933
1980
|
* @see https://redis.io/commands/lpos
|
|
1934
1981
|
*/
|
|
@@ -2048,7 +2095,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2048
2095
|
/**
|
|
2049
2096
|
* @see https://redis.io/commands/scan
|
|
2050
2097
|
*/
|
|
2051
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2098
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
|
|
2052
2099
|
/**
|
|
2053
2100
|
* @see https://redis.io/commands/scard
|
|
2054
2101
|
*/
|
|
@@ -2129,7 +2176,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2129
2176
|
/**
|
|
2130
2177
|
* @see https://redis.io/commands/sscan
|
|
2131
2178
|
*/
|
|
2132
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2179
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2133
2180
|
/**
|
|
2134
2181
|
* @see https://redis.io/commands/strlen
|
|
2135
2182
|
*/
|
|
@@ -2165,7 +2212,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2165
2212
|
/**
|
|
2166
2213
|
* @see https://redis.io/commands/zadd
|
|
2167
2214
|
*/
|
|
2168
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
|
|
2215
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
|
|
2216
|
+
key: string,
|
|
2217
|
+
opts: ZAddCommandOptions,
|
|
2218
|
+
...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
|
|
2219
|
+
]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2169
2220
|
/**
|
|
2170
2221
|
* @see https://redis.io/commands/xadd
|
|
2171
2222
|
*/
|
|
@@ -2365,7 +2416,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2365
2416
|
/**
|
|
2366
2417
|
* @see https://redis.io/commands/zscan
|
|
2367
2418
|
*/
|
|
2368
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2419
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2369
2420
|
/**
|
|
2370
2421
|
* @see https://redis.io/commands/zscore
|
|
2371
2422
|
*/
|
|
@@ -2524,6 +2575,8 @@ declare class Redis {
|
|
|
2524
2575
|
protected client: Requester;
|
|
2525
2576
|
protected opts?: CommandOptions<any, any>;
|
|
2526
2577
|
protected enableTelemetry: boolean;
|
|
2578
|
+
protected enableAutoPipelining: boolean;
|
|
2579
|
+
protected readYourWrites: boolean;
|
|
2527
2580
|
/**
|
|
2528
2581
|
* Create a new redis client
|
|
2529
2582
|
*
|
|
@@ -2643,6 +2696,7 @@ declare class Redis {
|
|
|
2643
2696
|
* @see {@link Pipeline}
|
|
2644
2697
|
*/
|
|
2645
2698
|
pipeline: () => Pipeline<[]>;
|
|
2699
|
+
protected autoPipeline: () => Redis;
|
|
2646
2700
|
/**
|
|
2647
2701
|
* Create a new transaction to allow executing multiple steps atomically.
|
|
2648
2702
|
*
|
|
@@ -2653,6 +2707,22 @@ declare class Redis {
|
|
|
2653
2707
|
* @see {@link Pipeline}
|
|
2654
2708
|
*/
|
|
2655
2709
|
multi: () => Pipeline<[]>;
|
|
2710
|
+
/**
|
|
2711
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
2712
|
+
*
|
|
2713
|
+
* @example
|
|
2714
|
+
* ```typescript
|
|
2715
|
+
* redis.set("mykey", 0);
|
|
2716
|
+
* const result = await redis.bitfield("mykey")
|
|
2717
|
+
* .set("u4", 0, 16)
|
|
2718
|
+
* .incr("u4", "#1", 1)
|
|
2719
|
+
* .exec();
|
|
2720
|
+
* console.log(result); // [0, 1]
|
|
2721
|
+
* ```
|
|
2722
|
+
*
|
|
2723
|
+
* @see https://redis.io/commands/bitfield
|
|
2724
|
+
*/
|
|
2725
|
+
bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
|
|
2656
2726
|
/**
|
|
2657
2727
|
* @see https://redis.io/commands/append
|
|
2658
2728
|
*/
|
|
@@ -2731,26 +2801,26 @@ declare class Redis {
|
|
|
2731
2801
|
/**
|
|
2732
2802
|
* @see https://redis.io/commands/geoadd
|
|
2733
2803
|
*/
|
|
2734
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<
|
|
2804
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
|
|
2735
2805
|
/**
|
|
2736
2806
|
* @see https://redis.io/commands/geopos
|
|
2737
2807
|
*/
|
|
2738
|
-
geopos: (args_0: string, ...args_1:
|
|
2808
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
|
|
2739
2809
|
lng: number;
|
|
2740
2810
|
lat: number;
|
|
2741
2811
|
}[]>;
|
|
2742
2812
|
/**
|
|
2743
2813
|
* @see https://redis.io/commands/geodist
|
|
2744
2814
|
*/
|
|
2745
|
-
geodist: (key: string, member1:
|
|
2815
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
2746
2816
|
/**
|
|
2747
2817
|
* @see https://redis.io/commands/geohash
|
|
2748
2818
|
*/
|
|
2749
|
-
geohash: (args_0: string, ...args_1:
|
|
2819
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
|
|
2750
2820
|
/**
|
|
2751
2821
|
* @see https://redis.io/commands/geosearch
|
|
2752
2822
|
*/
|
|
2753
|
-
geosearch: (key: string, centerPoint: {
|
|
2823
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
2754
2824
|
type: "FROMLONLAT" | "fromlonlat";
|
|
2755
2825
|
coordinate: {
|
|
2756
2826
|
lon: number;
|
|
@@ -2758,7 +2828,7 @@ declare class Redis {
|
|
|
2758
2828
|
};
|
|
2759
2829
|
} | {
|
|
2760
2830
|
type: "FROMMEMBER" | "frommember";
|
|
2761
|
-
member:
|
|
2831
|
+
member: TData;
|
|
2762
2832
|
}, shape: {
|
|
2763
2833
|
type: "BYRADIUS" | "byradius";
|
|
2764
2834
|
radius: number;
|
|
@@ -2779,7 +2849,7 @@ declare class Redis {
|
|
|
2779
2849
|
withDist?: boolean | undefined;
|
|
2780
2850
|
withHash?: boolean | undefined;
|
|
2781
2851
|
} | undefined) => Promise<({
|
|
2782
|
-
member:
|
|
2852
|
+
member: TData;
|
|
2783
2853
|
} & {
|
|
2784
2854
|
coord?: {
|
|
2785
2855
|
long: number;
|
|
@@ -2791,7 +2861,7 @@ declare class Redis {
|
|
|
2791
2861
|
/**
|
|
2792
2862
|
* @see https://redis.io/commands/geosearchstore
|
|
2793
2863
|
*/
|
|
2794
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2864
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
2795
2865
|
type: "FROMLONLAT" | "fromlonlat";
|
|
2796
2866
|
coordinate: {
|
|
2797
2867
|
lon: number;
|
|
@@ -2799,7 +2869,7 @@ declare class Redis {
|
|
|
2799
2869
|
};
|
|
2800
2870
|
} | {
|
|
2801
2871
|
type: "FROMMEMBER" | "frommember";
|
|
2802
|
-
member:
|
|
2872
|
+
member: TData;
|
|
2803
2873
|
}, shape: {
|
|
2804
2874
|
type: "BYRADIUS" | "byradius";
|
|
2805
2875
|
radius: number;
|
|
@@ -2884,14 +2954,14 @@ declare class Redis {
|
|
|
2884
2954
|
* @see https://redis.io/commands/hrandfield
|
|
2885
2955
|
*/
|
|
2886
2956
|
hrandfield: {
|
|
2887
|
-
(key: string): Promise<string>;
|
|
2957
|
+
(key: string): Promise<string | null>;
|
|
2888
2958
|
(key: string, count: number): Promise<string[]>;
|
|
2889
2959
|
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
2890
2960
|
};
|
|
2891
2961
|
/**
|
|
2892
2962
|
* @see https://redis.io/commands/hscan
|
|
2893
2963
|
*/
|
|
2894
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[
|
|
2964
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
2895
2965
|
/**
|
|
2896
2966
|
* @see https://redis.io/commands/hset
|
|
2897
2967
|
*/
|
|
@@ -2946,6 +3016,10 @@ declare class Redis {
|
|
|
2946
3016
|
* @see https://redis.io/commands/lpop
|
|
2947
3017
|
*/
|
|
2948
3018
|
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
3019
|
+
/**
|
|
3020
|
+
* @see https://redis.io/commands/lmpop
|
|
3021
|
+
*/
|
|
3022
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
|
|
2949
3023
|
/**
|
|
2950
3024
|
* @see https://redis.io/commands/lpos
|
|
2951
3025
|
*/
|
|
@@ -3065,7 +3139,7 @@ declare class Redis {
|
|
|
3065
3139
|
/**
|
|
3066
3140
|
* @see https://redis.io/commands/scan
|
|
3067
3141
|
*/
|
|
3068
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3142
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
|
|
3069
3143
|
/**
|
|
3070
3144
|
* @see https://redis.io/commands/scard
|
|
3071
3145
|
*/
|
|
@@ -3149,7 +3223,7 @@ declare class Redis {
|
|
|
3149
3223
|
/**
|
|
3150
3224
|
* @see https://redis.io/commands/sscan
|
|
3151
3225
|
*/
|
|
3152
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3226
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3153
3227
|
/**
|
|
3154
3228
|
* @see https://redis.io/commands/strlen
|
|
3155
3229
|
*/
|
|
@@ -3307,7 +3381,11 @@ declare class Redis {
|
|
|
3307
3381
|
/**
|
|
3308
3382
|
* @see https://redis.io/commands/zadd
|
|
3309
3383
|
*/
|
|
3310
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
|
|
3384
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
|
|
3385
|
+
key: string,
|
|
3386
|
+
opts: ZAddCommandOptions,
|
|
3387
|
+
...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
|
|
3388
|
+
]) => Promise<number | null>;
|
|
3311
3389
|
/**
|
|
3312
3390
|
* @see https://redis.io/commands/zcard
|
|
3313
3391
|
*/
|
|
@@ -3389,7 +3467,7 @@ declare class Redis {
|
|
|
3389
3467
|
/**
|
|
3390
3468
|
* @see https://redis.io/commands/zscan
|
|
3391
3469
|
*/
|
|
3392
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3470
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3393
3471
|
/**
|
|
3394
3472
|
* @see https://redis.io/commands/zscore
|
|
3395
3473
|
*/
|
|
@@ -3404,6 +3482,27 @@ declare class Redis {
|
|
|
3404
3482
|
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
3405
3483
|
}
|
|
3406
3484
|
|
|
3485
|
+
/**
|
|
3486
|
+
* Result of a bad request to upstash
|
|
3487
|
+
*/
|
|
3488
|
+
declare class UpstashError extends Error {
|
|
3489
|
+
constructor(message: string);
|
|
3490
|
+
}
|
|
3491
|
+
declare class UrlError extends Error {
|
|
3492
|
+
constructor(url: string);
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
type error_UpstashError = UpstashError;
|
|
3496
|
+
declare const error_UpstashError: typeof UpstashError;
|
|
3497
|
+
type error_UrlError = UrlError;
|
|
3498
|
+
declare const error_UrlError: typeof UrlError;
|
|
3499
|
+
declare namespace error {
|
|
3500
|
+
export {
|
|
3501
|
+
error_UpstashError as UpstashError,
|
|
3502
|
+
error_UrlError as UrlError,
|
|
3503
|
+
};
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3407
3506
|
/**
|
|
3408
3507
|
* @see https://redis.io/commands/zdiffstore
|
|
3409
3508
|
*/
|
|
@@ -3418,4 +3517,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
3418
3517
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
3419
3518
|
}
|
|
3420
3519
|
|
|
3421
|
-
export {
|
|
3520
|
+
export { HValsCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetRangeCommand as H, GetSetCommand as I, HDelCommand as J, HExistsCommand as K, HGetCommand as L, HGetAllCommand as M, HIncrByCommand as N, HIncrByFloatCommand as O, Pipeline as P, HKeysCommand as Q, RedisOptions as R, HLenCommand as S, HMGetCommand as T, UpstashRequest as U, HMSetCommand as V, HRandFieldCommand as W, HScanCommand as X, HSetCommand as Y, HSetNXCommand as Z, HStrLenCommand as _, RequesterConfig as a, SetBitCommand as a$, IncrCommand as a0, IncrByCommand as a1, IncrByFloatCommand as a2, JsonArrAppendCommand as a3, JsonArrIndexCommand as a4, JsonArrInsertCommand as a5, JsonArrLenCommand as a6, JsonArrPopCommand as a7, JsonArrTrimCommand as a8, JsonClearCommand as a9, MGetCommand as aA, MSetCommand as aB, MSetNXCommand as aC, PersistCommand as aD, PExpireCommand as aE, PExpireAtCommand as aF, PingCommand as aG, PSetEXCommand as aH, PTtlCommand as aI, PublishCommand as aJ, RandomKeyCommand as aK, RenameCommand as aL, RenameNXCommand as aM, RPopCommand as aN, RPushCommand as aO, RPushXCommand as aP, SAddCommand as aQ, ScanCommand as aR, ScanCommandOptions as aS, SCardCommand as aT, ScriptExistsCommand as aU, ScriptFlushCommand as aV, ScriptLoadCommand as aW, SDiffCommand as aX, SDiffStoreCommand as aY, SetCommand as aZ, SetCommandOptions as a_, JsonDelCommand as aa, JsonForgetCommand as ab, JsonGetCommand as ac, JsonMGetCommand as ad, JsonNumIncrByCommand as ae, JsonNumMultByCommand as af, JsonObjKeysCommand as ag, JsonObjLenCommand as ah, JsonRespCommand as ai, JsonSetCommand as aj, JsonStrAppendCommand as ak, JsonStrLenCommand as al, JsonToggleCommand as am, JsonTypeCommand as an, KeysCommand as ao, LIndexCommand as ap, LInsertCommand as aq, LLenCommand as ar, LMoveCommand as as, LPopCommand as at, LPushCommand as au, LPushXCommand as av, LRangeCommand as aw, LRemCommand as ax, LSetCommand as ay, LTrimCommand as az, Redis as b, SetExCommand as b0, SetNxCommand as b1, SetRangeCommand as b2, SInterCommand as b3, SInterStoreCommand as b4, SIsMemberCommand as b5, SMembersCommand as b6, SMIsMemberCommand as b7, SMoveCommand as b8, SPopCommand as b9, ZPopMinCommand as bA, ZRangeCommand as bB, ZRangeCommandOptions as bC, ZRankCommand as bD, ZRemCommand as bE, ZRemRangeByLexCommand as bF, ZRemRangeByRankCommand as bG, ZRemRangeByScoreCommand as bH, ZRevRankCommand as bI, ZScanCommand as bJ, ZScoreCommand as bK, ZUnionCommand as bL, ZUnionCommandOptions as bM, ZUnionStoreCommand as bN, ZUnionStoreCommandOptions as bO, SRandMemberCommand as ba, SRemCommand as bb, SScanCommand as bc, StrLenCommand as bd, SUnionCommand as be, SUnionStoreCommand as bf, TimeCommand as bg, TouchCommand as bh, TtlCommand as bi, Type as bj, TypeCommand as bk, UnlinkCommand as bl, XAddCommand as bm, XRangeCommand as bn, ScoreMember as bo, ZAddCommandOptions as bp, ZAddCommand as bq, ZCardCommand as br, ZCountCommand as bs, ZDiffStoreCommand as bt, ZIncrByCommand as bu, ZInterStoreCommand as bv, ZInterStoreCommandOptions as bw, ZLexCountCommand as bx, ZMScoreCommand as by, ZPopMaxCommand as bz, Requester as c, UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalCommand as k, EvalshaCommand as l, ExistsCommand as m, ExpireCommand as n, ExpireAtCommand as o, FlushDBCommand as p, GeoAddCommandOptions as q, GeoMember as r, GeoDistCommand as s, GeoHashCommand as t, GeoPosCommand as u, GeoSearchCommand as v, GeoSearchStoreCommand as w, GetCommand as x, GetBitCommand as y, GetDelCommand as z };
|