@upstash/redis 0.0.0-ci.e730ad54-20220901 → 0.0.0-ci.eb0d57e1-20231019
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 +20 -18
- package/esm/pkg/commands/command.js +12 -3
- package/esm/pkg/commands/geo_add.js +27 -0
- package/esm/pkg/commands/getdel.js +9 -0
- package/esm/pkg/commands/hgetall.js +9 -5
- package/esm/pkg/commands/hrandfield.js +39 -0
- package/esm/pkg/commands/json_arrappend.js +9 -0
- package/esm/pkg/commands/json_arrindex.js +9 -0
- package/esm/pkg/commands/json_arrinsert.js +9 -0
- package/esm/pkg/commands/json_arrlen.js +9 -0
- package/esm/pkg/commands/json_arrpop.js +9 -0
- package/esm/pkg/commands/json_arrtrim.js +12 -0
- package/esm/pkg/commands/json_clear.js +9 -0
- package/esm/pkg/commands/json_del.js +9 -0
- package/esm/pkg/commands/json_forget.js +9 -0
- package/esm/pkg/commands/json_get.js +30 -0
- package/esm/pkg/commands/json_mget.js +9 -0
- package/esm/pkg/commands/json_numincrby.js +9 -0
- package/esm/pkg/commands/json_nummultby.js +9 -0
- package/esm/pkg/commands/json_objkeys.js +9 -0
- package/esm/pkg/commands/json_objlen.js +9 -0
- package/esm/pkg/commands/json_resp.js +9 -0
- package/esm/pkg/commands/json_set.js +18 -0
- package/esm/pkg/commands/json_strappend.js +9 -0
- package/esm/pkg/commands/json_strlen.js +9 -0
- package/esm/pkg/commands/json_toggle.js +9 -0
- package/esm/pkg/commands/json_type.js +9 -0
- package/esm/pkg/commands/lmove.js +9 -0
- package/esm/pkg/commands/mget.js +4 -1
- package/esm/pkg/commands/mod.js +29 -0
- package/esm/pkg/commands/set.js +1 -1
- package/esm/pkg/commands/smismember.js +9 -0
- package/esm/pkg/commands/xadd.js +26 -0
- package/esm/pkg/commands/xrange.js +36 -0
- package/esm/pkg/commands/zdiffstore.js +9 -0
- package/esm/pkg/commands/zmscore.js +1 -2
- package/esm/pkg/commands/zunion.js +30 -0
- package/esm/pkg/http.js +100 -3
- package/esm/pkg/pipeline.js +175 -12
- package/esm/pkg/redis.js +219 -2
- package/esm/platforms/cloudflare.js +10 -2
- package/esm/platforms/fastly.js +6 -0
- package/esm/platforms/node_with_fetch.js +26 -1
- package/esm/platforms/nodejs.js +24 -1
- package/esm/version.js +1 -0
- package/package.json +53 -20
- package/script/pkg/commands/command.js +12 -3
- package/script/pkg/commands/geo_add.js +31 -0
- package/script/pkg/commands/getdel.js +13 -0
- package/script/pkg/commands/hgetall.js +9 -5
- package/script/pkg/commands/hrandfield.js +43 -0
- package/script/pkg/commands/json_arrappend.js +13 -0
- package/script/pkg/commands/json_arrindex.js +13 -0
- package/script/pkg/commands/json_arrinsert.js +13 -0
- package/script/pkg/commands/json_arrlen.js +13 -0
- package/script/pkg/commands/json_arrpop.js +13 -0
- package/script/pkg/commands/json_arrtrim.js +16 -0
- package/script/pkg/commands/json_clear.js +13 -0
- package/script/pkg/commands/json_del.js +13 -0
- package/script/pkg/commands/json_forget.js +13 -0
- package/script/pkg/commands/json_get.js +34 -0
- package/script/pkg/commands/json_mget.js +13 -0
- package/script/pkg/commands/json_numincrby.js +13 -0
- package/script/pkg/commands/json_nummultby.js +13 -0
- package/script/pkg/commands/json_objkeys.js +13 -0
- package/script/pkg/commands/json_objlen.js +13 -0
- package/script/pkg/commands/json_resp.js +13 -0
- package/script/pkg/commands/json_set.js +22 -0
- package/script/pkg/commands/json_strappend.js +13 -0
- package/script/pkg/commands/json_strlen.js +13 -0
- package/script/pkg/commands/json_toggle.js +13 -0
- package/script/pkg/commands/json_type.js +13 -0
- package/script/pkg/commands/lmove.js +13 -0
- package/script/pkg/commands/mget.js +4 -1
- package/script/pkg/commands/mod.js +29 -0
- package/script/pkg/commands/set.js +1 -1
- package/script/pkg/commands/smismember.js +13 -0
- package/script/pkg/commands/xadd.js +30 -0
- package/script/pkg/commands/xrange.js +40 -0
- package/script/pkg/commands/zdiffstore.js +13 -0
- package/script/pkg/commands/zmscore.js +1 -2
- package/script/pkg/commands/zunion.js +34 -0
- package/script/pkg/http.js +100 -3
- package/script/pkg/pipeline.js +174 -11
- package/script/pkg/redis.js +218 -1
- package/script/platforms/cloudflare.js +10 -2
- package/script/platforms/fastly.js +6 -0
- package/script/platforms/node_with_fetch.js +26 -1
- package/script/platforms/nodejs.js +24 -1
- package/script/version.js +4 -0
- package/types/pkg/commands/command.d.ts +5 -5
- package/types/pkg/commands/geo_add.d.ts +25 -0
- package/types/pkg/commands/getdel.d.ts +7 -0
- package/types/pkg/commands/hdel.d.ts +1 -1
- package/types/pkg/commands/hrandfield.d.ts +9 -0
- package/types/pkg/commands/json_arrappend.d.ts +7 -0
- package/types/pkg/commands/json_arrindex.d.ts +13 -0
- package/types/pkg/commands/json_arrinsert.d.ts +7 -0
- package/types/pkg/commands/json_arrlen.d.ts +7 -0
- package/types/pkg/commands/json_arrpop.d.ts +7 -0
- package/types/pkg/commands/json_arrtrim.d.ts +7 -0
- package/types/pkg/commands/json_clear.d.ts +7 -0
- package/types/pkg/commands/json_del.d.ts +7 -0
- package/types/pkg/commands/json_forget.d.ts +7 -0
- package/types/pkg/commands/json_get.d.ts +15 -0
- package/types/pkg/commands/json_mget.d.ts +7 -0
- package/types/pkg/commands/json_numincrby.d.ts +7 -0
- package/types/pkg/commands/json_nummultby.d.ts +7 -0
- package/types/pkg/commands/json_objkeys.d.ts +7 -0
- package/types/pkg/commands/json_objlen.d.ts +7 -0
- package/types/pkg/commands/json_resp.d.ts +7 -0
- package/types/pkg/commands/json_set.d.ts +18 -0
- package/types/pkg/commands/json_strappend.d.ts +7 -0
- package/types/pkg/commands/json_strlen.d.ts +7 -0
- package/types/pkg/commands/json_toggle.d.ts +7 -0
- package/types/pkg/commands/json_type.d.ts +7 -0
- package/types/pkg/commands/lmove.d.ts +12 -0
- package/types/pkg/commands/mget.d.ts +1 -1
- package/types/pkg/commands/mod.d.ts +29 -0
- package/types/pkg/commands/scan.d.ts +1 -1
- package/types/pkg/commands/script_flush.d.ts +1 -1
- package/types/pkg/commands/set.d.ts +3 -3
- package/types/pkg/commands/smembers.d.ts +2 -2
- package/types/pkg/commands/smismember.d.ts +7 -0
- package/types/pkg/commands/type.d.ts +1 -1
- package/types/pkg/commands/xadd.d.ts +31 -0
- package/types/pkg/commands/xrange.d.ts +9 -0
- package/types/pkg/commands/zadd.d.ts +3 -3
- package/types/pkg/commands/zdiffstore.d.ts +7 -0
- package/types/pkg/commands/zinterstore.d.ts +1 -1
- package/types/pkg/commands/zmscore.d.ts +1 -1
- package/types/pkg/commands/zrange.d.ts +1 -1
- package/types/pkg/commands/zunion.d.ts +29 -0
- package/types/pkg/commands/zunionstore.d.ts +1 -1
- package/types/pkg/http.d.ts +48 -7
- package/types/pkg/pipeline.d.ts +260 -126
- package/types/pkg/redis.d.ts +170 -12
- package/types/pkg/types.d.ts +27 -1
- package/types/platforms/cloudflare.d.ts +9 -8
- package/types/platforms/fastly.d.ts +3 -7
- package/types/platforms/node_with_fetch.d.ts +3 -22
- package/types/platforms/nodejs.d.ts +4 -7
- package/types/version.d.ts +1 -0
package/types/pkg/redis.d.ts
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { CommandOptions, DelCommand, ExistsCommand, FlushAllCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
1
|
+
import { CommandOptions, DelCommand, ExistsCommand, FlushAllCommand, JsonGetCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
2
2
|
import { Requester, UpstashRequest, UpstashResponse } from "./http.js";
|
|
3
3
|
import { Pipeline } from "./pipeline.js";
|
|
4
4
|
import type { CommandArgs } from "./types.js";
|
|
5
5
|
import { Script } from "./script.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
9
|
-
*
|
|
10
|
-
* @default true
|
|
11
|
-
*/
|
|
12
|
-
automaticDeserialization?: boolean;
|
|
13
|
-
};
|
|
6
|
+
import type { RedisOptions, Telemetry } from "./types.js";
|
|
7
|
+
export type { RedisOptions } from "./types.js";
|
|
14
8
|
/**
|
|
15
9
|
* Serverless redis client for upstash.
|
|
16
10
|
*/
|
|
17
11
|
export declare class Redis {
|
|
18
12
|
protected client: Requester;
|
|
19
13
|
protected opts?: CommandOptions<any, any>;
|
|
14
|
+
protected enableTelemetry: boolean;
|
|
20
15
|
/**
|
|
21
16
|
* Create a new redis client
|
|
22
17
|
*
|
|
@@ -29,17 +24,127 @@ export declare class Redis {
|
|
|
29
24
|
* ```
|
|
30
25
|
*/
|
|
31
26
|
constructor(client: Requester, opts?: RedisOptions);
|
|
27
|
+
get json(): {
|
|
28
|
+
/**
|
|
29
|
+
* @see https://redis.io/commands/json.arrappend
|
|
30
|
+
*/
|
|
31
|
+
arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
32
|
+
/**
|
|
33
|
+
* @see https://redis.io/commands/json.arrindex
|
|
34
|
+
*/
|
|
35
|
+
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
36
|
+
/**
|
|
37
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
38
|
+
*/
|
|
39
|
+
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
40
|
+
/**
|
|
41
|
+
* @see https://redis.io/commands/json.arrlen
|
|
42
|
+
*/
|
|
43
|
+
arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
44
|
+
/**
|
|
45
|
+
* @see https://redis.io/commands/json.arrpop
|
|
46
|
+
*/
|
|
47
|
+
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
|
|
48
|
+
/**
|
|
49
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
50
|
+
*/
|
|
51
|
+
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
52
|
+
/**
|
|
53
|
+
* @see https://redis.io/commands/json.clear
|
|
54
|
+
*/
|
|
55
|
+
clear: (key: string, path?: string | undefined) => Promise<number>;
|
|
56
|
+
/**
|
|
57
|
+
* @see https://redis.io/commands/json.del
|
|
58
|
+
*/
|
|
59
|
+
del: (key: string, path?: string | undefined) => Promise<number>;
|
|
60
|
+
/**
|
|
61
|
+
* @see https://redis.io/commands/json.forget
|
|
62
|
+
*/
|
|
63
|
+
forget: (key: string, path?: string | undefined) => Promise<number>;
|
|
64
|
+
/**
|
|
65
|
+
* @see https://redis.io/commands/geoadd
|
|
66
|
+
*/
|
|
67
|
+
geoadd: (args_0: string, args_1: import("./commands/geo_add.js").GeoAddCommandOptions | import("./commands/geo_add.js").GeoMember<unknown>, ...args_2: import("./commands/geo_add.js").GeoMember<unknown>[]) => Promise<number | null>;
|
|
68
|
+
/**
|
|
69
|
+
* @see https://redis.io/commands/json.get
|
|
70
|
+
*/
|
|
71
|
+
get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* @see https://redis.io/commands/json.mget
|
|
74
|
+
*/
|
|
75
|
+
mget: (keys: string[], path: string) => Promise<any>;
|
|
76
|
+
/**
|
|
77
|
+
* @see https://redis.io/commands/json.numincrby
|
|
78
|
+
*/
|
|
79
|
+
numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
80
|
+
/**
|
|
81
|
+
* @see https://redis.io/commands/json.nummultby
|
|
82
|
+
*/
|
|
83
|
+
nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
84
|
+
/**
|
|
85
|
+
* @see https://redis.io/commands/json.objkeys
|
|
86
|
+
*/
|
|
87
|
+
objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
|
|
88
|
+
/**
|
|
89
|
+
* @see https://redis.io/commands/json.objlen
|
|
90
|
+
*/
|
|
91
|
+
objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
92
|
+
/**
|
|
93
|
+
* @see https://redis.io/commands/json.resp
|
|
94
|
+
*/
|
|
95
|
+
resp: (key: string, path?: string | undefined) => Promise<any>;
|
|
96
|
+
/**
|
|
97
|
+
* @see https://redis.io/commands/json.set
|
|
98
|
+
*/
|
|
99
|
+
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
100
|
+
nx: true;
|
|
101
|
+
xx?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
nx?: undefined;
|
|
104
|
+
xx: true;
|
|
105
|
+
} | undefined) => Promise<"OK" | null>;
|
|
106
|
+
/**
|
|
107
|
+
* @see https://redis.io/commands/json.strappend
|
|
108
|
+
*/
|
|
109
|
+
strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
|
|
110
|
+
/**
|
|
111
|
+
* @see https://redis.io/commands/json.strlen
|
|
112
|
+
*/
|
|
113
|
+
strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
114
|
+
/**
|
|
115
|
+
* @see https://redis.io/commands/json.toggle
|
|
116
|
+
*/
|
|
117
|
+
toggle: (key: string, path: string) => Promise<number[]>;
|
|
118
|
+
/**
|
|
119
|
+
* @see https://redis.io/commands/json.type
|
|
120
|
+
*/
|
|
121
|
+
type: (key: string, path?: string | undefined) => Promise<string[]>;
|
|
122
|
+
};
|
|
32
123
|
/**
|
|
33
124
|
* Wrap a new middleware around the HTTP client.
|
|
34
125
|
*/
|
|
35
126
|
use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Technically this is not private, we can hide it from intellisense by doing this
|
|
129
|
+
*/
|
|
130
|
+
protected addTelemetry: (telemetry: Telemetry) => void;
|
|
36
131
|
createScript(script: string): Script;
|
|
37
132
|
/**
|
|
38
133
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
39
134
|
*
|
|
40
135
|
* @see {@link Pipeline}
|
|
41
136
|
*/
|
|
42
|
-
pipeline: () => Pipeline
|
|
137
|
+
pipeline: () => Pipeline<[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Create a new transaction to allow executing multiple steps atomically.
|
|
140
|
+
*
|
|
141
|
+
* All the commands in a transaction are serialized and executed sequentially. A request sent by
|
|
142
|
+
* another client will never be served in the middle of the execution of a Redis Transaction. This
|
|
143
|
+
* guarantees that the commands are executed as a single isolated operation.
|
|
144
|
+
*
|
|
145
|
+
* @see {@link Pipeline}
|
|
146
|
+
*/
|
|
147
|
+
multi: () => Pipeline<[]>;
|
|
43
148
|
/**
|
|
44
149
|
* @see https://redis.io/commands/append
|
|
45
150
|
*/
|
|
@@ -117,6 +222,10 @@ export declare class Redis {
|
|
|
117
222
|
* @see https://redis.io/commands/getbit
|
|
118
223
|
*/
|
|
119
224
|
getbit: (key: string, offset: number) => Promise<0 | 1>;
|
|
225
|
+
/**
|
|
226
|
+
* @see https://redis.io/commands/getdel
|
|
227
|
+
*/
|
|
228
|
+
getdel: <TData>(key: string) => Promise<TData | null>;
|
|
120
229
|
/**
|
|
121
230
|
* @see https://redis.io/commands/getrange
|
|
122
231
|
*/
|
|
@@ -128,7 +237,7 @@ export declare class Redis {
|
|
|
128
237
|
/**
|
|
129
238
|
* @see https://redis.io/commands/hdel
|
|
130
239
|
*/
|
|
131
|
-
hdel: (key: string,
|
|
240
|
+
hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
|
|
132
241
|
/**
|
|
133
242
|
* @see https://redis.io/commands/hexists
|
|
134
243
|
*/
|
|
@@ -167,6 +276,14 @@ export declare class Redis {
|
|
|
167
276
|
hmset: <TData>(key: string, kv: {
|
|
168
277
|
[field: string]: TData;
|
|
169
278
|
}) => Promise<"OK">;
|
|
279
|
+
/**
|
|
280
|
+
* @see https://redis.io/commands/hrandfield
|
|
281
|
+
*/
|
|
282
|
+
hrandfield: {
|
|
283
|
+
(key: string): Promise<string>;
|
|
284
|
+
(key: string, count: number): Promise<string[]>;
|
|
285
|
+
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
286
|
+
};
|
|
170
287
|
/**
|
|
171
288
|
* @see https://redis.io/commands/hscan
|
|
172
289
|
*/
|
|
@@ -217,6 +334,10 @@ export declare class Redis {
|
|
|
217
334
|
* @see https://redis.io/commands/llen
|
|
218
335
|
*/
|
|
219
336
|
llen: (key: string) => Promise<number>;
|
|
337
|
+
/**
|
|
338
|
+
* @see https://redis.io/commands/lmove
|
|
339
|
+
*/
|
|
340
|
+
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
|
|
220
341
|
/**
|
|
221
342
|
* @see https://redis.io/commands/lpop
|
|
222
343
|
*/
|
|
@@ -385,10 +506,14 @@ export declare class Redis {
|
|
|
385
506
|
* @see https://redis.io/commands/sismember
|
|
386
507
|
*/
|
|
387
508
|
sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
|
|
509
|
+
/**
|
|
510
|
+
* @see https://redis.io/commands/smismember
|
|
511
|
+
*/
|
|
512
|
+
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
|
|
388
513
|
/**
|
|
389
514
|
* @see https://redis.io/commands/smembers
|
|
390
515
|
*/
|
|
391
|
-
smembers: (key: string) => Promise<
|
|
516
|
+
smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
|
|
392
517
|
/**
|
|
393
518
|
* @see https://redis.io/commands/smove
|
|
394
519
|
*/
|
|
@@ -441,6 +566,31 @@ export declare class Redis {
|
|
|
441
566
|
* @see https://redis.io/commands/unlink
|
|
442
567
|
*/
|
|
443
568
|
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
|
|
569
|
+
/**
|
|
570
|
+
* @see https://redis.io/commands/xadd
|
|
571
|
+
*/
|
|
572
|
+
xadd: (key: string, id: string, entries: {
|
|
573
|
+
[field: string]: unknown;
|
|
574
|
+
}, opts?: {
|
|
575
|
+
nomkStream?: boolean | undefined;
|
|
576
|
+
trim?: (({
|
|
577
|
+
type: "MAXLEN" | "maxlen";
|
|
578
|
+
threshold: number;
|
|
579
|
+
} | {
|
|
580
|
+
type: "MINID" | "minid";
|
|
581
|
+
threshold: string;
|
|
582
|
+
}) & ({
|
|
583
|
+
comparison: "~";
|
|
584
|
+
limit?: number | undefined;
|
|
585
|
+
} | {
|
|
586
|
+
comparison: "=";
|
|
587
|
+
limit?: undefined;
|
|
588
|
+
})) | undefined;
|
|
589
|
+
} | undefined) => Promise<string>;
|
|
590
|
+
/**
|
|
591
|
+
* @see https://redis.io/commands/xrange
|
|
592
|
+
*/
|
|
593
|
+
xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
444
594
|
/**
|
|
445
595
|
* @see https://redis.io/commands/zadd
|
|
446
596
|
*/
|
|
@@ -453,6 +603,10 @@ export declare class Redis {
|
|
|
453
603
|
* @see https://redis.io/commands/zcount
|
|
454
604
|
*/
|
|
455
605
|
zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
|
|
606
|
+
/**
|
|
607
|
+
* @see https://redis.io/commands/zdiffstore
|
|
608
|
+
*/
|
|
609
|
+
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
|
|
456
610
|
/**
|
|
457
611
|
* @see https://redis.io/commands/zincrby
|
|
458
612
|
*/
|
|
@@ -527,6 +681,10 @@ export declare class Redis {
|
|
|
527
681
|
* @see https://redis.io/commands/zscore
|
|
528
682
|
*/
|
|
529
683
|
zscore: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
684
|
+
/**
|
|
685
|
+
* @see https://redis.io/commands/zunion
|
|
686
|
+
*/
|
|
687
|
+
zunion: (numKeys: number, keys: string[], opts?: import("./commands/zunion.js").ZUnionCommandOptions | undefined) => Promise<any>;
|
|
530
688
|
/**
|
|
531
689
|
* @see https://redis.io/commands/zunionstore
|
|
532
690
|
*/
|
package/types/pkg/types.d.ts
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type CommandArgs<TCommand extends new (...args: any) => any> = ConstructorParameters<TCommand>[0];
|
|
2
|
+
export type Telemetry = {
|
|
3
|
+
/**
|
|
4
|
+
* Upstash-Telemetry-Sdk
|
|
5
|
+
* @example @upstash/redis@v1.1.1
|
|
6
|
+
*/
|
|
7
|
+
sdk?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Upstash-Telemetry-Platform
|
|
10
|
+
* @example cloudflare
|
|
11
|
+
*/
|
|
12
|
+
platform?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Upstash-Telemetry-Runtime
|
|
15
|
+
* @example node@v18
|
|
16
|
+
*/
|
|
17
|
+
runtime?: string;
|
|
18
|
+
};
|
|
19
|
+
export type RedisOptions = {
|
|
20
|
+
/**
|
|
21
|
+
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
automaticDeserialization?: boolean;
|
|
26
|
+
enableTelemetry?: boolean;
|
|
27
|
+
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as core from "../pkg/redis.js";
|
|
2
|
-
import type { Requester,
|
|
2
|
+
import type { Requester, UpstashRequest, UpstashResponse } from "../pkg/http.js";
|
|
3
|
+
import { RequesterConfig } from "../pkg/http.js";
|
|
4
|
+
type Env = {
|
|
5
|
+
UPSTASH_DISABLE_TELEMETRY?: string;
|
|
6
|
+
};
|
|
3
7
|
export type { Requester, UpstashRequest, UpstashResponse };
|
|
4
8
|
/**
|
|
5
9
|
* Connection credentials for upstash redis.
|
|
6
10
|
* Get them from https://console.upstash.com/redis/<uuid>
|
|
7
11
|
*/
|
|
8
|
-
export
|
|
12
|
+
export type RedisConfigCloudflare = {
|
|
9
13
|
/**
|
|
10
14
|
* UPSTASH_REDIS_REST_URL
|
|
11
15
|
*/
|
|
@@ -14,11 +18,7 @@ export declare type RedisConfigCloudflare = {
|
|
|
14
18
|
* UPSTASH_REDIS_REST_TOKEN
|
|
15
19
|
*/
|
|
16
20
|
token: string;
|
|
17
|
-
|
|
18
|
-
* Configure the retry behaviour in case of network errors
|
|
19
|
-
*/
|
|
20
|
-
retry?: RetryConfig;
|
|
21
|
-
} & core.RedisOptions;
|
|
21
|
+
} & core.RedisOptions & RequesterConfig & Env;
|
|
22
22
|
/**
|
|
23
23
|
* Serverless redis client for upstash.
|
|
24
24
|
*/
|
|
@@ -34,9 +34,10 @@ export declare class Redis extends core.Redis {
|
|
|
34
34
|
* });
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
constructor(config: RedisConfigCloudflare);
|
|
37
|
+
constructor(config: RedisConfigCloudflare, env?: Env);
|
|
38
38
|
static fromEnv(env?: {
|
|
39
39
|
UPSTASH_REDIS_REST_URL: string;
|
|
40
40
|
UPSTASH_REDIS_REST_TOKEN: string;
|
|
41
|
+
UPSTASH_DISABLE_TELEMETRY?: string;
|
|
41
42
|
}, opts?: Omit<RedisConfigCloudflare, "url" | "token">): Redis;
|
|
42
43
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as core from "../pkg/redis.js";
|
|
2
|
-
import type { Requester,
|
|
2
|
+
import type { Requester, RequesterConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
|
|
3
3
|
export type { Requester, UpstashRequest, UpstashResponse };
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|
|
6
6
|
* Get them from https://console.upstash.com/redis/<uuid>
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type RedisConfigFastly = {
|
|
9
9
|
/**
|
|
10
10
|
* UPSTASH_REDIS_REST_URL
|
|
11
11
|
*/
|
|
@@ -20,11 +20,7 @@ export declare type RedisConfigFastly = {
|
|
|
20
20
|
* referenced by name.
|
|
21
21
|
*/
|
|
22
22
|
backend: string;
|
|
23
|
-
|
|
24
|
-
* Configure the retry behaviour in case of network errors
|
|
25
|
-
*/
|
|
26
|
-
retry?: RetryConfig;
|
|
27
|
-
} & core.RedisOptions;
|
|
23
|
+
} & core.RedisOptions & RequesterConfig;
|
|
28
24
|
/**
|
|
29
25
|
* Serverless redis client for upstash.
|
|
30
26
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as core from "../pkg/redis.js";
|
|
2
|
-
import { Requester,
|
|
2
|
+
import { Requester, RequesterConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
|
|
3
3
|
import "isomorphic-fetch";
|
|
4
4
|
export type { Requester, UpstashRequest, UpstashResponse };
|
|
5
5
|
/**
|
|
6
6
|
* Connection credentials for upstash redis.
|
|
7
7
|
* Get them from https://console.upstash.com/redis/<uuid>
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type RedisConfigNodejs = {
|
|
10
10
|
/**
|
|
11
11
|
* UPSTASH_REDIS_REST_URL
|
|
12
12
|
*/
|
|
@@ -15,26 +15,7 @@ export declare type RedisConfigNodejs = {
|
|
|
15
15
|
* UPSTASH_REDIS_REST_TOKEN
|
|
16
16
|
*/
|
|
17
17
|
token: string;
|
|
18
|
-
|
|
19
|
-
* An agent allows you to reuse connections to reduce latency for multiple sequential requests.
|
|
20
|
-
*
|
|
21
|
-
* This is a node specific implementation and is not supported in various runtimes like Vercel
|
|
22
|
-
* edge functions.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```ts
|
|
26
|
-
* import https from "https"
|
|
27
|
-
*
|
|
28
|
-
* const options: RedisConfigNodejs = {
|
|
29
|
-
* agent: new https.Agent({ keepAlive: true })
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Configure the retry behaviour in case of network errors
|
|
35
|
-
*/
|
|
36
|
-
retry?: RetryConfig;
|
|
37
|
-
} & core.RedisOptions;
|
|
18
|
+
} & core.RedisOptions & RequesterConfig;
|
|
38
19
|
/**
|
|
39
20
|
* Serverless redis client for upstash.
|
|
40
21
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as core from "../pkg/redis.js";
|
|
2
|
-
import { Requester,
|
|
2
|
+
import { Requester, RequesterConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
|
|
3
3
|
export type { Requester, UpstashRequest, UpstashResponse };
|
|
4
4
|
/**
|
|
5
5
|
* Connection credentials for upstash redis.
|
|
6
6
|
* Get them from https://console.upstash.com/redis/<uuid>
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type RedisConfigNodejs = {
|
|
9
9
|
/**
|
|
10
10
|
* UPSTASH_REDIS_REST_URL
|
|
11
11
|
*/
|
|
@@ -29,11 +29,8 @@ export declare type RedisConfigNodejs = {
|
|
|
29
29
|
* }
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
retry?: RetryConfig;
|
|
36
|
-
} & core.RedisOptions;
|
|
32
|
+
agent?: any;
|
|
33
|
+
} & core.RedisOptions & RequesterConfig;
|
|
37
34
|
/**
|
|
38
35
|
* Serverless redis client for upstash.
|
|
39
36
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "v0.0.0-ci.eb0d57e1-20231019";
|