@upstash/redis 1.3.0-alpha.1 → 1.3.0
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 +21 -0
- package/{chunk-HIDCSH5S.mjs → chunk-5LZNFEHI.mjs} +1 -3
- package/{chunk-T3BIHZ2F.mjs → chunk-C2RGMNOQ.mjs} +23 -7
- package/{chunk-KI7YOGWS.mjs → chunk-CTSQDNTV.mjs} +5 -41
- package/{chunk-5567SQFQ.mjs → chunk-K2UC7PHG.mjs} +58 -6
- package/cloudflare.d.ts +18 -16
- package/cloudflare.js +56 -51
- package/cloudflare.mjs +4 -6
- package/commands.d.ts +30 -3
- package/commands.js +62 -6
- package/commands.mjs +9 -1
- package/fastly.d.ts +23 -21
- package/fastly.js +56 -51
- package/fastly.mjs +4 -6
- package/http.d.ts +13 -6
- package/http.js +1 -3
- package/http.mjs +1 -1
- package/index.d.ts +5 -3
- package/index.js +81 -53
- package/index.mjs +4 -4
- package/nodejs.d.ts +46 -25
- package/nodejs.js +81 -53
- package/nodejs.mjs +4 -4
- package/package.json +1 -1
- package/{redis-364a4445.d.ts → redis-338577a3.d.ts} +488 -496
- package/{zunionstore-342168a6.d.ts → zunionstore-633a2e7a.d.ts} +17 -3
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as ScanCommandOptions, a as SetCommandOptions, C as CommandArgs, U as UnlinkCommand,
|
|
3
|
-
|
|
4
|
-
declare type ScriptFlushCommandOptions = {
|
|
5
|
-
sync: true;
|
|
6
|
-
async?: never;
|
|
7
|
-
} | {
|
|
8
|
-
sync?: never;
|
|
9
|
-
async: true;
|
|
10
|
-
};
|
|
1
|
+
import { Requester } from './http';
|
|
2
|
+
import { S as ScanCommandOptions, a as ScriptFlushCommandOptions, b as SetCommandOptions, C as CommandArgs, U as UnlinkCommand, c as ScoreMember, Z as ZAddCommandOptions, d as ZAddCommandOptionsWithIncr, e as ZInterStoreCommandOptions, f as ZRangeCommandOptions, g as ZUnionStoreCommandOptions, T as Type } from './zunionstore-633a2e7a';
|
|
11
3
|
|
|
12
4
|
/**
|
|
13
5
|
* Upstash REST API supports command pipelining to send multiple commands in
|
|
@@ -51,455 +43,455 @@ declare type ScriptFlushCommandOptions = {
|
|
|
51
43
|
declare class Pipeline {
|
|
52
44
|
private client;
|
|
53
45
|
private commands;
|
|
54
|
-
constructor(client:
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
constructor(client: Requester);
|
|
47
|
+
/**
|
|
48
|
+
* Send the pipeline request to upstash.
|
|
49
|
+
*
|
|
50
|
+
* Returns an array with the results of all pipelined commands.
|
|
51
|
+
*
|
|
52
|
+
* You can define a return type manually to make working in typescript easier
|
|
53
|
+
* ```ts
|
|
54
|
+
* redis.pipeline().get("key").exec<[{ greeting: string }]>()
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
65
57
|
exec: <TCommandResults extends unknown[] = unknown[]>() => Promise<TCommandResults>;
|
|
66
58
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
* Pushes a command into the pipelien and returns a chainable instance of the
|
|
60
|
+
* pipeline
|
|
61
|
+
*/
|
|
70
62
|
private chain;
|
|
71
63
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
* @see https://redis.io/commands/append
|
|
65
|
+
*/
|
|
74
66
|
append: (key: string, value: string) => this;
|
|
75
67
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
* @see https://redis.io/commands/bitcount
|
|
69
|
+
*/
|
|
78
70
|
bitcount: (key: string, start: number, end: number) => this;
|
|
79
71
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
* @see https://redis.io/commands/bitop
|
|
73
|
+
*/
|
|
82
74
|
bitop: {
|
|
83
75
|
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline;
|
|
84
76
|
(op: "not", destinationKey: string, sourceKey: string): Pipeline;
|
|
85
77
|
};
|
|
86
78
|
/**
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
* @see https://redis.io/commands/bitpos
|
|
80
|
+
*/
|
|
89
81
|
bitpos: (key: string, start: number, end: number) => this;
|
|
90
82
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
* @see https://redis.io/commands/dbsize
|
|
84
|
+
*/
|
|
93
85
|
dbsize: () => this;
|
|
94
86
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
* @see https://redis.io/commands/decr
|
|
88
|
+
*/
|
|
97
89
|
decr: (key: string) => this;
|
|
98
90
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
* @see https://redis.io/commands/decrby
|
|
92
|
+
*/
|
|
101
93
|
decrby: (key: string, decrement: number) => this;
|
|
102
94
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
* @see https://redis.io/commands/del
|
|
96
|
+
*/
|
|
105
97
|
del: (args_0: string, ...args_1: string[]) => this;
|
|
106
98
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
* @see https://redis.io/commands/echo
|
|
100
|
+
*/
|
|
109
101
|
echo: (message: string) => this;
|
|
110
102
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
*
|
|
104
|
+
* @see https://redis.io/commands/eval
|
|
105
|
+
*/
|
|
114
106
|
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => this;
|
|
115
107
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
*
|
|
109
|
+
* @see https://redis.io/commands/evalsha
|
|
110
|
+
*/
|
|
119
111
|
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => this;
|
|
120
112
|
/**
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
* @see https://redis.io/commands/exists
|
|
114
|
+
*/
|
|
123
115
|
exists: (args_0: string, ...args_1: string[]) => this;
|
|
124
116
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
* @see https://redis.io/commands/expire
|
|
118
|
+
*/
|
|
127
119
|
expire: (key: string, seconds: number) => this;
|
|
128
120
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
* @see https://redis.io/commands/expireat
|
|
122
|
+
*/
|
|
131
123
|
expireat: (key: string, unix: number) => this;
|
|
132
124
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
* @see https://redis.io/commands/flushall
|
|
126
|
+
*/
|
|
135
127
|
flushall: (opts?: {
|
|
136
128
|
async?: boolean | undefined;
|
|
137
129
|
} | undefined) => this;
|
|
138
130
|
/**
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
* @see https://redis.io/commands/flushdb
|
|
132
|
+
*/
|
|
141
133
|
flushdb: (opts?: {
|
|
142
134
|
async?: boolean | undefined;
|
|
143
135
|
} | undefined) => this;
|
|
144
136
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
137
|
+
* @see https://redis.io/commands/get
|
|
138
|
+
*/
|
|
147
139
|
get: <TData>(key: string) => this;
|
|
148
140
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
* @see https://redis.io/commands/getbit
|
|
142
|
+
*/
|
|
151
143
|
getbit: (key: string, offset: number) => this;
|
|
152
144
|
/**
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
* @see https://redis.io/commands/getrange
|
|
146
|
+
*/
|
|
155
147
|
getrange: (key: string, start: number, end: number) => this;
|
|
156
148
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
149
|
+
* @see https://redis.io/commands/getset
|
|
150
|
+
*/
|
|
159
151
|
getset: <TData>(key: string, value: TData) => this;
|
|
160
152
|
/**
|
|
161
|
-
|
|
162
|
-
|
|
153
|
+
* @see https://redis.io/commands/hdel
|
|
154
|
+
*/
|
|
163
155
|
hdel: (key: string, field: string) => this;
|
|
164
156
|
/**
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
* @see https://redis.io/commands/hexists
|
|
158
|
+
*/
|
|
167
159
|
hexists: (key: string, field: string) => this;
|
|
168
160
|
/**
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
* @see https://redis.io/commands/hget
|
|
162
|
+
*/
|
|
171
163
|
hget: <TData>(key: string, field: string) => this;
|
|
172
164
|
/**
|
|
173
|
-
|
|
174
|
-
|
|
165
|
+
* @see https://redis.io/commands/hgetall
|
|
166
|
+
*/
|
|
175
167
|
hgetall: <TData extends Record<string, unknown>>(key: string) => this;
|
|
176
168
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
* @see https://redis.io/commands/hincrby
|
|
170
|
+
*/
|
|
179
171
|
hincrby: (key: string, field: string, increment: number) => this;
|
|
180
172
|
/**
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
174
|
+
*/
|
|
183
175
|
hincrbyfloat: (key: string, field: string, increment: number) => this;
|
|
184
176
|
/**
|
|
185
|
-
|
|
186
|
-
|
|
177
|
+
* @see https://redis.io/commands/hkeys
|
|
178
|
+
*/
|
|
187
179
|
hkeys: (key: string) => this;
|
|
188
180
|
/**
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
* @see https://redis.io/commands/hlen
|
|
182
|
+
*/
|
|
191
183
|
hlen: (key: string) => this;
|
|
192
184
|
/**
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
* @see https://redis.io/commands/hmget
|
|
186
|
+
*/
|
|
195
187
|
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => this;
|
|
196
188
|
/**
|
|
197
|
-
|
|
198
|
-
|
|
189
|
+
* @see https://redis.io/commands/hmset
|
|
190
|
+
*/
|
|
199
191
|
hmset: <TData>(key: string, kv: {
|
|
200
192
|
[field: string]: TData;
|
|
201
193
|
}) => this;
|
|
202
194
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
195
|
+
* @see https://redis.io/commands/hscan
|
|
196
|
+
*/
|
|
205
197
|
hscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => this;
|
|
206
198
|
/**
|
|
207
|
-
|
|
208
|
-
|
|
199
|
+
* @see https://redis.io/commands/hset
|
|
200
|
+
*/
|
|
209
201
|
hset: <TData>(key: string, kv: {
|
|
210
202
|
[field: string]: TData;
|
|
211
203
|
}) => this;
|
|
212
204
|
/**
|
|
213
|
-
|
|
214
|
-
|
|
205
|
+
* @see https://redis.io/commands/hsetnx
|
|
206
|
+
*/
|
|
215
207
|
hsetnx: <TData>(key: string, field: string, value: TData) => this;
|
|
216
208
|
/**
|
|
217
|
-
|
|
218
|
-
|
|
209
|
+
* @see https://redis.io/commands/hstrlen
|
|
210
|
+
*/
|
|
219
211
|
hstrlen: (key: string, field: string) => this;
|
|
220
212
|
/**
|
|
221
|
-
|
|
222
|
-
|
|
213
|
+
* @see https://redis.io/commands/hvals
|
|
214
|
+
*/
|
|
223
215
|
hvals: (key: string) => this;
|
|
224
216
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
217
|
+
* @see https://redis.io/commands/incr
|
|
218
|
+
*/
|
|
227
219
|
incr: (key: string) => this;
|
|
228
220
|
/**
|
|
229
|
-
|
|
230
|
-
|
|
221
|
+
* @see https://redis.io/commands/incrby
|
|
222
|
+
*/
|
|
231
223
|
incrby: (key: string, value: number) => this;
|
|
232
224
|
/**
|
|
233
|
-
|
|
234
|
-
|
|
225
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
226
|
+
*/
|
|
235
227
|
incrbyfloat: (key: string, value: number) => this;
|
|
236
228
|
/**
|
|
237
|
-
|
|
238
|
-
|
|
229
|
+
* @see https://redis.io/commands/keys
|
|
230
|
+
*/
|
|
239
231
|
keys: (pattern: string) => this;
|
|
240
232
|
/**
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
* @see https://redis.io/commands/lindex
|
|
234
|
+
*/
|
|
243
235
|
lindex: (key: string, index: number) => this;
|
|
244
236
|
/**
|
|
245
|
-
|
|
246
|
-
|
|
237
|
+
* @see https://redis.io/commands/linsert
|
|
238
|
+
*/
|
|
247
239
|
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => this;
|
|
248
240
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
241
|
+
* @see https://redis.io/commands/llen
|
|
242
|
+
*/
|
|
251
243
|
llen: (key: string) => this;
|
|
252
244
|
/**
|
|
253
|
-
|
|
254
|
-
|
|
245
|
+
* @see https://redis.io/commands/lpop
|
|
246
|
+
*/
|
|
255
247
|
lpop: <TData>(key: string) => this;
|
|
256
248
|
/**
|
|
257
|
-
|
|
258
|
-
|
|
249
|
+
* @see https://redis.io/commands/lpush
|
|
250
|
+
*/
|
|
259
251
|
lpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
|
|
260
252
|
/**
|
|
261
|
-
|
|
262
|
-
|
|
253
|
+
* @see https://redis.io/commands/lpushx
|
|
254
|
+
*/
|
|
263
255
|
lpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
|
|
264
256
|
/**
|
|
265
|
-
|
|
266
|
-
|
|
257
|
+
* @see https://redis.io/commands/lrange
|
|
258
|
+
*/
|
|
267
259
|
lrange: <TResult = string>(key: string, start: number, end: number) => this;
|
|
268
260
|
/**
|
|
269
|
-
|
|
270
|
-
|
|
261
|
+
* @see https://redis.io/commands/lrem
|
|
262
|
+
*/
|
|
271
263
|
lrem: <TData>(key: string, count: number, value: TData) => this;
|
|
272
264
|
/**
|
|
273
|
-
|
|
274
|
-
|
|
265
|
+
* @see https://redis.io/commands/lset
|
|
266
|
+
*/
|
|
275
267
|
lset: <TData>(key: string, value: TData, index: number) => this;
|
|
276
268
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
269
|
+
* @see https://redis.io/commands/ltrim
|
|
270
|
+
*/
|
|
279
271
|
ltrim: (key: string, start: number, end: number) => this;
|
|
280
272
|
/**
|
|
281
|
-
|
|
282
|
-
|
|
273
|
+
* @see https://redis.io/commands/mget
|
|
274
|
+
*/
|
|
283
275
|
mget: <TData extends unknown[]>(args_0: string, ...args_1: string[]) => this;
|
|
284
276
|
/**
|
|
285
|
-
|
|
286
|
-
|
|
277
|
+
* @see https://redis.io/commands/mset
|
|
278
|
+
*/
|
|
287
279
|
mset: <TData>(kv: {
|
|
288
280
|
[key: string]: TData;
|
|
289
281
|
}) => this;
|
|
290
282
|
/**
|
|
291
|
-
|
|
292
|
-
|
|
283
|
+
* @see https://redis.io/commands/msetnx
|
|
284
|
+
*/
|
|
293
285
|
msetnx: <TData>(kv: {
|
|
294
286
|
[key: string]: TData;
|
|
295
287
|
}) => this;
|
|
296
288
|
/**
|
|
297
|
-
|
|
298
|
-
|
|
289
|
+
* @see https://redis.io/commands/persist
|
|
290
|
+
*/
|
|
299
291
|
persist: (key: string) => this;
|
|
300
292
|
/**
|
|
301
|
-
|
|
302
|
-
|
|
293
|
+
* @see https://redis.io/commands/pexpire
|
|
294
|
+
*/
|
|
303
295
|
pexpire: (key: string, milliseconds: number) => this;
|
|
304
296
|
/**
|
|
305
|
-
|
|
306
|
-
|
|
297
|
+
* @see https://redis.io/commands/pexpireat
|
|
298
|
+
*/
|
|
307
299
|
pexpireat: (key: string, unix: number) => this;
|
|
308
300
|
/**
|
|
309
|
-
|
|
310
|
-
|
|
301
|
+
* @see https://redis.io/commands/ping
|
|
302
|
+
*/
|
|
311
303
|
ping: (message?: string | undefined) => this;
|
|
312
304
|
/**
|
|
313
|
-
|
|
314
|
-
|
|
305
|
+
* @see https://redis.io/commands/psetex
|
|
306
|
+
*/
|
|
315
307
|
psetex: <TData>(key: string, ttl: number, value: TData) => this;
|
|
316
308
|
/**
|
|
317
|
-
|
|
318
|
-
|
|
309
|
+
* @see https://redis.io/commands/pttl
|
|
310
|
+
*/
|
|
319
311
|
pttl: (key: string) => this;
|
|
320
312
|
/**
|
|
321
|
-
|
|
322
|
-
|
|
313
|
+
* @see https://redis.io/commands/publish
|
|
314
|
+
*/
|
|
323
315
|
publish: (channel: string, message: unknown) => this;
|
|
324
316
|
/**
|
|
325
|
-
|
|
326
|
-
|
|
317
|
+
* @see https://redis.io/commands/randomkey
|
|
318
|
+
*/
|
|
327
319
|
randomkey: () => this;
|
|
328
320
|
/**
|
|
329
|
-
|
|
330
|
-
|
|
321
|
+
* @see https://redis.io/commands/rename
|
|
322
|
+
*/
|
|
331
323
|
rename: (source: string, destination: string) => this;
|
|
332
324
|
/**
|
|
333
|
-
|
|
334
|
-
|
|
325
|
+
* @see https://redis.io/commands/renamenx
|
|
326
|
+
*/
|
|
335
327
|
renamenx: (source: string, destination: string) => this;
|
|
336
328
|
/**
|
|
337
|
-
|
|
338
|
-
|
|
329
|
+
* @see https://redis.io/commands/rpop
|
|
330
|
+
*/
|
|
339
331
|
rpop: <TData = string>(key: string) => this;
|
|
340
332
|
/**
|
|
341
|
-
|
|
342
|
-
|
|
333
|
+
* @see https://redis.io/commands/rpush
|
|
334
|
+
*/
|
|
343
335
|
rpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
|
|
344
336
|
/**
|
|
345
|
-
|
|
346
|
-
|
|
337
|
+
* @see https://redis.io/commands/rpushx
|
|
338
|
+
*/
|
|
347
339
|
rpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => this;
|
|
348
340
|
/**
|
|
349
|
-
|
|
350
|
-
|
|
341
|
+
* @see https://redis.io/commands/sadd
|
|
342
|
+
*/
|
|
351
343
|
sadd: <TData>(key: string, members_0: TData, ...members_1: TData[]) => this;
|
|
352
344
|
/**
|
|
353
|
-
|
|
354
|
-
|
|
345
|
+
* @see https://redis.io/commands/scan
|
|
346
|
+
*/
|
|
355
347
|
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => this;
|
|
356
348
|
/**
|
|
357
|
-
|
|
358
|
-
|
|
349
|
+
* @see https://redis.io/commands/scard
|
|
350
|
+
*/
|
|
359
351
|
scard: (key: string) => this;
|
|
360
352
|
/**
|
|
361
|
-
|
|
362
|
-
|
|
353
|
+
* @see https://redis.io/commands/script-exists
|
|
354
|
+
*/
|
|
363
355
|
scriptExists: (args_0: string, ...args_1: string[]) => this;
|
|
364
356
|
/**
|
|
365
|
-
|
|
366
|
-
|
|
357
|
+
* @see https://redis.io/commands/script-flush
|
|
358
|
+
*/
|
|
367
359
|
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => this;
|
|
368
360
|
/**
|
|
369
|
-
|
|
370
|
-
|
|
361
|
+
* @see https://redis.io/commands/script-load
|
|
362
|
+
*/
|
|
371
363
|
scriptLoad: (script: string) => this;
|
|
372
364
|
/**
|
|
373
|
-
|
|
374
|
-
|
|
365
|
+
* @see https://redis.io/commands/sdiff
|
|
366
|
+
*/
|
|
375
367
|
sdiff: (key: string, ...keys: string[]) => this;
|
|
376
368
|
/**
|
|
377
|
-
|
|
378
|
-
|
|
369
|
+
* @see https://redis.io/commands/sdiffstore
|
|
370
|
+
*/
|
|
379
371
|
sdiffstore: (args_0: string, args_1: string, ...args_2: string[]) => this;
|
|
380
372
|
/**
|
|
381
|
-
|
|
382
|
-
|
|
373
|
+
* @see https://redis.io/commands/set
|
|
374
|
+
*/
|
|
383
375
|
set: <TData>(key: string, value: TData, opts?: SetCommandOptions | undefined) => this;
|
|
384
376
|
/**
|
|
385
|
-
|
|
386
|
-
|
|
377
|
+
* @see https://redis.io/commands/setbit
|
|
378
|
+
*/
|
|
387
379
|
setbit: (key: string, offset: number, value: 0 | 1) => this;
|
|
388
380
|
/**
|
|
389
|
-
|
|
390
|
-
|
|
381
|
+
* @see https://redis.io/commands/setex
|
|
382
|
+
*/
|
|
391
383
|
setex: <TData>(key: string, ttl: number, value: TData) => this;
|
|
392
384
|
/**
|
|
393
|
-
|
|
394
|
-
|
|
385
|
+
* @see https://redis.io/commands/setnx
|
|
386
|
+
*/
|
|
395
387
|
setnx: <TData>(key: string, value: TData) => this;
|
|
396
388
|
/**
|
|
397
|
-
|
|
398
|
-
|
|
389
|
+
* @see https://redis.io/commands/setrange
|
|
390
|
+
*/
|
|
399
391
|
setrange: (key: string, offset: number, value: string) => this;
|
|
400
392
|
/**
|
|
401
|
-
|
|
402
|
-
|
|
393
|
+
* @see https://redis.io/commands/sinter
|
|
394
|
+
*/
|
|
403
395
|
sinter: (key: string, ...keys: string[]) => this;
|
|
404
396
|
/**
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
* @see https://redis.io/commands/sinterstore
|
|
398
|
+
*/
|
|
407
399
|
sinterstore: (destination: string, key: string, ...keys: string[]) => this;
|
|
408
400
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
401
|
+
* @see https://redis.io/commands/sismember
|
|
402
|
+
*/
|
|
411
403
|
sismember: <TData>(key: string, member: TData) => this;
|
|
412
404
|
/**
|
|
413
|
-
|
|
414
|
-
|
|
405
|
+
* @see https://redis.io/commands/smembers
|
|
406
|
+
*/
|
|
415
407
|
smembers: (key: string) => this;
|
|
416
408
|
/**
|
|
417
|
-
|
|
418
|
-
|
|
409
|
+
* @see https://redis.io/commands/smove
|
|
410
|
+
*/
|
|
419
411
|
smove: <TData>(source: string, destination: string, member: TData) => this;
|
|
420
412
|
/**
|
|
421
|
-
|
|
422
|
-
|
|
413
|
+
* @see https://redis.io/commands/spop
|
|
414
|
+
*/
|
|
423
415
|
spop: <TData>(key: string, count?: number | undefined) => this;
|
|
424
416
|
/**
|
|
425
|
-
|
|
426
|
-
|
|
417
|
+
* @see https://redis.io/commands/srandmember
|
|
418
|
+
*/
|
|
427
419
|
srandmember: <TData>(key: string, count?: number | undefined) => this;
|
|
428
420
|
/**
|
|
429
|
-
|
|
430
|
-
|
|
421
|
+
* @see https://redis.io/commands/srem
|
|
422
|
+
*/
|
|
431
423
|
srem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => this;
|
|
432
424
|
/**
|
|
433
|
-
|
|
434
|
-
|
|
425
|
+
* @see https://redis.io/commands/sscan
|
|
426
|
+
*/
|
|
435
427
|
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => this;
|
|
436
428
|
/**
|
|
437
|
-
|
|
438
|
-
|
|
429
|
+
* @see https://redis.io/commands/strlen
|
|
430
|
+
*/
|
|
439
431
|
strlen: (key: string) => this;
|
|
440
432
|
/**
|
|
441
|
-
|
|
442
|
-
|
|
433
|
+
* @see https://redis.io/commands/sunion
|
|
434
|
+
*/
|
|
443
435
|
sunion: (key: string, ...keys: string[]) => this;
|
|
444
436
|
/**
|
|
445
|
-
|
|
446
|
-
|
|
437
|
+
* @see https://redis.io/commands/sunionstore
|
|
438
|
+
*/
|
|
447
439
|
sunionstore: (destination: string, key: string, ...keys: string[]) => this;
|
|
448
440
|
/**
|
|
449
|
-
|
|
450
|
-
|
|
441
|
+
* @see https://redis.io/commands/time
|
|
442
|
+
*/
|
|
451
443
|
time: () => this;
|
|
452
444
|
/**
|
|
453
|
-
|
|
454
|
-
|
|
445
|
+
* @see https://redis.io/commands/touch
|
|
446
|
+
*/
|
|
455
447
|
touch: (args_0: string, ...args_1: string[]) => this;
|
|
456
448
|
/**
|
|
457
|
-
|
|
458
|
-
|
|
449
|
+
* @see https://redis.io/commands/ttl
|
|
450
|
+
*/
|
|
459
451
|
ttl: (key: string) => this;
|
|
460
452
|
/**
|
|
461
|
-
|
|
462
|
-
|
|
453
|
+
* @see https://redis.io/commands/type
|
|
454
|
+
*/
|
|
463
455
|
type: (key: string) => this;
|
|
464
456
|
/**
|
|
465
|
-
|
|
466
|
-
|
|
457
|
+
* @see https://redis.io/commands/unlink
|
|
458
|
+
*/
|
|
467
459
|
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => this;
|
|
468
460
|
/**
|
|
469
|
-
|
|
470
|
-
|
|
461
|
+
* @see https://redis.io/commands/zadd
|
|
462
|
+
*/
|
|
471
463
|
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [string, ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => this;
|
|
472
464
|
/**
|
|
473
|
-
|
|
474
|
-
|
|
465
|
+
* @see https://redis.io/commands/zcard
|
|
466
|
+
*/
|
|
475
467
|
zcard: (key: string) => this;
|
|
476
468
|
/**
|
|
477
|
-
|
|
478
|
-
|
|
469
|
+
* @see https://redis.io/commands/zcount
|
|
470
|
+
*/
|
|
479
471
|
zcount: (key: string, min: string | number, max: string | number) => this;
|
|
480
472
|
/**
|
|
481
|
-
|
|
482
|
-
|
|
473
|
+
* @see https://redis.io/commands/zincrby
|
|
474
|
+
*/
|
|
483
475
|
zincrby: <TData>(key: string, increment: number, member: TData) => this;
|
|
484
476
|
/**
|
|
485
|
-
|
|
486
|
-
|
|
477
|
+
* @see https://redis.io/commands/zinterstore
|
|
478
|
+
*/
|
|
487
479
|
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => this;
|
|
488
480
|
/**
|
|
489
|
-
|
|
490
|
-
|
|
481
|
+
* @see https://redis.io/commands/zlexcount
|
|
482
|
+
*/
|
|
491
483
|
zlexcount: (key: string, min: string, max: string) => this;
|
|
492
484
|
/**
|
|
493
|
-
|
|
494
|
-
|
|
485
|
+
* @see https://redis.io/commands/zpopmax
|
|
486
|
+
*/
|
|
495
487
|
zpopmax: <TData>(key: string, count?: number | undefined) => this;
|
|
496
488
|
/**
|
|
497
|
-
|
|
498
|
-
|
|
489
|
+
* @see https://redis.io/commands/zpopmin
|
|
490
|
+
*/
|
|
499
491
|
zpopmin: <TData>(key: string, count?: number | undefined) => this;
|
|
500
492
|
/**
|
|
501
|
-
|
|
502
|
-
|
|
493
|
+
* @see https://redis.io/commands/zrange
|
|
494
|
+
*/
|
|
503
495
|
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
504
496
|
key: string,
|
|
505
497
|
min: `(${string}` | `[${string}` | "-" | "+",
|
|
@@ -516,40 +508,40 @@ declare class Pipeline {
|
|
|
516
508
|
} & ZRangeCommandOptions
|
|
517
509
|
]) => this;
|
|
518
510
|
/**
|
|
519
|
-
|
|
520
|
-
|
|
511
|
+
* @see https://redis.io/commands/zrank
|
|
512
|
+
*/
|
|
521
513
|
zrank: <TData>(key: string, member: TData) => this;
|
|
522
514
|
/**
|
|
523
|
-
|
|
524
|
-
|
|
515
|
+
* @see https://redis.io/commands/zrem
|
|
516
|
+
*/
|
|
525
517
|
zrem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => this;
|
|
526
518
|
/**
|
|
527
|
-
|
|
528
|
-
|
|
519
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
520
|
+
*/
|
|
529
521
|
zremrangebylex: (key: string, min: string, max: string) => this;
|
|
530
522
|
/**
|
|
531
|
-
|
|
532
|
-
|
|
523
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
524
|
+
*/
|
|
533
525
|
zremrangebyrank: (key: string, start: number, stop: number) => this;
|
|
534
526
|
/**
|
|
535
|
-
|
|
536
|
-
|
|
527
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
528
|
+
*/
|
|
537
529
|
zremrangebyscore: (key: string, min: number, max: number) => this;
|
|
538
530
|
/**
|
|
539
|
-
|
|
540
|
-
|
|
531
|
+
* @see https://redis.io/commands/zrevrank
|
|
532
|
+
*/
|
|
541
533
|
zrevrank: <TData>(key: string, member: TData) => this;
|
|
542
534
|
/**
|
|
543
|
-
|
|
544
|
-
|
|
535
|
+
* @see https://redis.io/commands/zscan
|
|
536
|
+
*/
|
|
545
537
|
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => this;
|
|
546
538
|
/**
|
|
547
|
-
|
|
548
|
-
|
|
539
|
+
* @see https://redis.io/commands/zscore
|
|
540
|
+
*/
|
|
549
541
|
zscore: <TData>(key: string, member: TData) => this;
|
|
550
542
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
543
|
+
* @see https://redis.io/commands/zunionstore
|
|
544
|
+
*/
|
|
553
545
|
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => this;
|
|
554
546
|
}
|
|
555
547
|
|
|
@@ -559,455 +551,455 @@ declare class Pipeline {
|
|
|
559
551
|
declare class Redis {
|
|
560
552
|
private readonly client;
|
|
561
553
|
/**
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
constructor(client:
|
|
573
|
-
/**
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
554
|
+
* Create a new redis client
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* ```typescript
|
|
558
|
+
* const redis = new Redis({
|
|
559
|
+
* url: "<UPSTASH_REDIS_REST_URL>",
|
|
560
|
+
* token: "<UPSTASH_REDIS_REST_TOKEN>",
|
|
561
|
+
* });
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
constructor(client: Requester);
|
|
565
|
+
/**
|
|
566
|
+
* Create a new pipeline that allows you to send requests in bulk.
|
|
567
|
+
*
|
|
568
|
+
* @see {@link Pipeline}
|
|
569
|
+
*/
|
|
578
570
|
pipeline: () => Pipeline;
|
|
579
571
|
/**
|
|
580
|
-
|
|
581
|
-
|
|
572
|
+
* @see https://redis.io/commands/append
|
|
573
|
+
*/
|
|
582
574
|
append: (key: string, value: string) => Promise<number>;
|
|
583
575
|
/**
|
|
584
|
-
|
|
585
|
-
|
|
576
|
+
* @see https://redis.io/commands/bitcount
|
|
577
|
+
*/
|
|
586
578
|
bitcount: (key: string, start: number, end: number) => Promise<number>;
|
|
587
579
|
/**
|
|
588
|
-
|
|
589
|
-
|
|
580
|
+
* @see https://redis.io/commands/bitop
|
|
581
|
+
*/
|
|
590
582
|
bitop: {
|
|
591
583
|
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
|
|
592
584
|
(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
|
|
593
585
|
};
|
|
594
586
|
/**
|
|
595
|
-
|
|
596
|
-
|
|
587
|
+
* @see https://redis.io/commands/bitpos
|
|
588
|
+
*/
|
|
597
589
|
bitpos: (key: string, start: number, end: number) => Promise<number>;
|
|
598
590
|
/**
|
|
599
|
-
|
|
600
|
-
|
|
591
|
+
* @see https://redis.io/commands/dbsize
|
|
592
|
+
*/
|
|
601
593
|
dbsize: () => Promise<number>;
|
|
602
594
|
/**
|
|
603
|
-
|
|
604
|
-
|
|
595
|
+
* @see https://redis.io/commands/decr
|
|
596
|
+
*/
|
|
605
597
|
decr: (key: string) => Promise<number>;
|
|
606
598
|
/**
|
|
607
|
-
|
|
608
|
-
|
|
599
|
+
* @see https://redis.io/commands/decrby
|
|
600
|
+
*/
|
|
609
601
|
decrby: (key: string, decrement: number) => Promise<number>;
|
|
610
602
|
/**
|
|
611
|
-
|
|
612
|
-
|
|
603
|
+
* @see https://redis.io/commands/del
|
|
604
|
+
*/
|
|
613
605
|
del: (args_0: string, ...args_1: string[]) => Promise<number>;
|
|
614
606
|
/**
|
|
615
|
-
|
|
616
|
-
|
|
607
|
+
* @see https://redis.io/commands/echo
|
|
608
|
+
*/
|
|
617
609
|
echo: (message: string) => Promise<string>;
|
|
618
610
|
/**
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
611
|
+
*
|
|
612
|
+
* @see https://redis.io/commands/eval
|
|
613
|
+
*/
|
|
622
614
|
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<unknown>;
|
|
623
615
|
/**
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
616
|
+
*
|
|
617
|
+
* @see https://redis.io/commands/evalsha
|
|
618
|
+
*/
|
|
627
619
|
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<unknown>;
|
|
628
620
|
/**
|
|
629
|
-
|
|
630
|
-
|
|
621
|
+
* @see https://redis.io/commands/exists
|
|
622
|
+
*/
|
|
631
623
|
exists: (args_0: string, ...args_1: string[]) => Promise<number>;
|
|
632
624
|
/**
|
|
633
|
-
|
|
634
|
-
|
|
625
|
+
* @see https://redis.io/commands/expire
|
|
626
|
+
*/
|
|
635
627
|
expire: (key: string, seconds: number) => Promise<0 | 1>;
|
|
636
628
|
/**
|
|
637
|
-
|
|
638
|
-
|
|
629
|
+
* @see https://redis.io/commands/expireat
|
|
630
|
+
*/
|
|
639
631
|
expireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
640
632
|
/**
|
|
641
|
-
|
|
642
|
-
|
|
633
|
+
* @see https://redis.io/commands/flushall
|
|
634
|
+
*/
|
|
643
635
|
flushall: (opts?: {
|
|
644
636
|
async?: boolean | undefined;
|
|
645
637
|
} | undefined) => Promise<"OK">;
|
|
646
638
|
/**
|
|
647
|
-
|
|
648
|
-
|
|
639
|
+
* @see https://redis.io/commands/flushdb
|
|
640
|
+
*/
|
|
649
641
|
flushdb: (opts?: {
|
|
650
642
|
async?: boolean | undefined;
|
|
651
643
|
} | undefined) => Promise<"OK">;
|
|
652
644
|
/**
|
|
653
|
-
|
|
654
|
-
|
|
645
|
+
* @see https://redis.io/commands/get
|
|
646
|
+
*/
|
|
655
647
|
get: <TData>(key: string) => Promise<TData | null>;
|
|
656
648
|
/**
|
|
657
|
-
|
|
658
|
-
|
|
649
|
+
* @see https://redis.io/commands/getbit
|
|
650
|
+
*/
|
|
659
651
|
getbit: (key: string, offset: number) => Promise<0 | 1>;
|
|
660
652
|
/**
|
|
661
|
-
|
|
662
|
-
|
|
653
|
+
* @see https://redis.io/commands/getrange
|
|
654
|
+
*/
|
|
663
655
|
getrange: (key: string, start: number, end: number) => Promise<string>;
|
|
664
656
|
/**
|
|
665
|
-
|
|
666
|
-
|
|
657
|
+
* @see https://redis.io/commands/getset
|
|
658
|
+
*/
|
|
667
659
|
getset: <TData>(key: string, value: TData) => Promise<TData | null>;
|
|
668
660
|
/**
|
|
669
|
-
|
|
670
|
-
|
|
661
|
+
* @see https://redis.io/commands/hdel
|
|
662
|
+
*/
|
|
671
663
|
hdel: (key: string, field: string) => Promise<0 | 1>;
|
|
672
664
|
/**
|
|
673
|
-
|
|
674
|
-
|
|
665
|
+
* @see https://redis.io/commands/hexists
|
|
666
|
+
*/
|
|
675
667
|
hexists: (key: string, field: string) => Promise<number>;
|
|
676
668
|
/**
|
|
677
|
-
|
|
678
|
-
|
|
669
|
+
* @see https://redis.io/commands/hget
|
|
670
|
+
*/
|
|
679
671
|
hget: <TData>(key: string, field: string) => Promise<TData | null>;
|
|
680
672
|
/**
|
|
681
|
-
|
|
682
|
-
|
|
673
|
+
* @see https://redis.io/commands/hgetall
|
|
674
|
+
*/
|
|
683
675
|
hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
|
|
684
676
|
/**
|
|
685
|
-
|
|
686
|
-
|
|
677
|
+
* @see https://redis.io/commands/hincrby
|
|
678
|
+
*/
|
|
687
679
|
hincrby: (key: string, field: string, increment: number) => Promise<number>;
|
|
688
680
|
/**
|
|
689
|
-
|
|
690
|
-
|
|
681
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
682
|
+
*/
|
|
691
683
|
hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
|
|
692
684
|
/**
|
|
693
|
-
|
|
694
|
-
|
|
685
|
+
* @see https://redis.io/commands/hkeys
|
|
686
|
+
*/
|
|
695
687
|
hkeys: (key: string) => Promise<string[]>;
|
|
696
688
|
/**
|
|
697
|
-
|
|
698
|
-
|
|
689
|
+
* @see https://redis.io/commands/hlen
|
|
690
|
+
*/
|
|
699
691
|
hlen: (key: string) => Promise<number>;
|
|
700
692
|
/**
|
|
701
|
-
|
|
702
|
-
|
|
693
|
+
* @see https://redis.io/commands/hmget
|
|
694
|
+
*/
|
|
703
695
|
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
|
|
704
696
|
/**
|
|
705
|
-
|
|
706
|
-
|
|
697
|
+
* @see https://redis.io/commands/hmset
|
|
698
|
+
*/
|
|
707
699
|
hmset: <TData>(key: string, kv: {
|
|
708
700
|
[field: string]: TData;
|
|
709
701
|
}) => Promise<number>;
|
|
710
702
|
/**
|
|
711
|
-
|
|
712
|
-
|
|
703
|
+
* @see https://redis.io/commands/hscan
|
|
704
|
+
*/
|
|
713
705
|
hscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
714
706
|
/**
|
|
715
|
-
|
|
716
|
-
|
|
707
|
+
* @see https://redis.io/commands/hset
|
|
708
|
+
*/
|
|
717
709
|
hset: <TData>(key: string, kv: {
|
|
718
710
|
[field: string]: TData;
|
|
719
711
|
}) => Promise<number>;
|
|
720
712
|
/**
|
|
721
|
-
|
|
722
|
-
|
|
713
|
+
* @see https://redis.io/commands/hsetnx
|
|
714
|
+
*/
|
|
723
715
|
hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
|
|
724
716
|
/**
|
|
725
|
-
|
|
726
|
-
|
|
717
|
+
* @see https://redis.io/commands/hstrlen
|
|
718
|
+
*/
|
|
727
719
|
hstrlen: (key: string, field: string) => Promise<number>;
|
|
728
720
|
/**
|
|
729
|
-
|
|
730
|
-
|
|
721
|
+
* @see https://redis.io/commands/hvals
|
|
722
|
+
*/
|
|
731
723
|
hvals: (key: string) => Promise<unknown[]>;
|
|
732
724
|
/**
|
|
733
|
-
|
|
734
|
-
|
|
725
|
+
* @see https://redis.io/commands/incr
|
|
726
|
+
*/
|
|
735
727
|
incr: (key: string) => Promise<number>;
|
|
736
728
|
/**
|
|
737
|
-
|
|
738
|
-
|
|
729
|
+
* @see https://redis.io/commands/incrby
|
|
730
|
+
*/
|
|
739
731
|
incrby: (key: string, value: number) => Promise<number>;
|
|
740
732
|
/**
|
|
741
|
-
|
|
742
|
-
|
|
733
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
734
|
+
*/
|
|
743
735
|
incrbyfloat: (key: string, value: number) => Promise<number>;
|
|
744
736
|
/**
|
|
745
|
-
|
|
746
|
-
|
|
737
|
+
* @see https://redis.io/commands/keys
|
|
738
|
+
*/
|
|
747
739
|
keys: (pattern: string) => Promise<string[]>;
|
|
748
740
|
/**
|
|
749
|
-
|
|
750
|
-
|
|
741
|
+
* @see https://redis.io/commands/lindex
|
|
742
|
+
*/
|
|
751
743
|
lindex: (key: string, index: number) => Promise<string | null>;
|
|
752
744
|
/**
|
|
753
|
-
|
|
754
|
-
|
|
745
|
+
* @see https://redis.io/commands/linsert
|
|
746
|
+
*/
|
|
755
747
|
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
|
|
756
748
|
/**
|
|
757
|
-
|
|
758
|
-
|
|
749
|
+
* @see https://redis.io/commands/llen
|
|
750
|
+
*/
|
|
759
751
|
llen: (key: string) => Promise<number>;
|
|
760
752
|
/**
|
|
761
|
-
|
|
762
|
-
|
|
753
|
+
* @see https://redis.io/commands/lpop
|
|
754
|
+
*/
|
|
763
755
|
lpop: <TData>(key: string) => Promise<TData | null>;
|
|
764
756
|
/**
|
|
765
|
-
|
|
766
|
-
|
|
757
|
+
* @see https://redis.io/commands/lpush
|
|
758
|
+
*/
|
|
767
759
|
lpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
|
|
768
760
|
/**
|
|
769
|
-
|
|
770
|
-
|
|
761
|
+
* @see https://redis.io/commands/lpushx
|
|
762
|
+
*/
|
|
771
763
|
lpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
|
|
772
764
|
/**
|
|
773
|
-
|
|
774
|
-
|
|
765
|
+
* @see https://redis.io/commands/lrange
|
|
766
|
+
*/
|
|
775
767
|
lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
|
|
776
768
|
/**
|
|
777
|
-
|
|
778
|
-
|
|
769
|
+
* @see https://redis.io/commands/lrem
|
|
770
|
+
*/
|
|
779
771
|
lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
|
|
780
772
|
/**
|
|
781
|
-
|
|
782
|
-
|
|
773
|
+
* @see https://redis.io/commands/lset
|
|
774
|
+
*/
|
|
783
775
|
lset: <TData>(key: string, value: TData, index: number) => Promise<"OK">;
|
|
784
776
|
/**
|
|
785
|
-
|
|
786
|
-
|
|
777
|
+
* @see https://redis.io/commands/ltrim
|
|
778
|
+
*/
|
|
787
779
|
ltrim: (key: string, start: number, end: number) => Promise<"OK">;
|
|
788
780
|
/**
|
|
789
|
-
|
|
790
|
-
|
|
781
|
+
* @see https://redis.io/commands/mget
|
|
782
|
+
*/
|
|
791
783
|
mget: <TData extends unknown[]>(args_0: string, ...args_1: string[]) => Promise<TData>;
|
|
792
784
|
/**
|
|
793
|
-
|
|
794
|
-
|
|
785
|
+
* @see https://redis.io/commands/mset
|
|
786
|
+
*/
|
|
795
787
|
mset: <TData>(kv: {
|
|
796
788
|
[key: string]: TData;
|
|
797
789
|
}) => Promise<"OK">;
|
|
798
790
|
/**
|
|
799
|
-
|
|
800
|
-
|
|
791
|
+
* @see https://redis.io/commands/msetnx
|
|
792
|
+
*/
|
|
801
793
|
msetnx: <TData>(kv: {
|
|
802
794
|
[key: string]: TData;
|
|
803
795
|
}) => Promise<number>;
|
|
804
796
|
/**
|
|
805
|
-
|
|
806
|
-
|
|
797
|
+
* @see https://redis.io/commands/persist
|
|
798
|
+
*/
|
|
807
799
|
persist: (key: string) => Promise<0 | 1>;
|
|
808
800
|
/**
|
|
809
|
-
|
|
810
|
-
|
|
801
|
+
* @see https://redis.io/commands/pexpire
|
|
802
|
+
*/
|
|
811
803
|
pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
|
|
812
804
|
/**
|
|
813
|
-
|
|
814
|
-
|
|
805
|
+
* @see https://redis.io/commands/pexpireat
|
|
806
|
+
*/
|
|
815
807
|
pexpireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
816
808
|
/**
|
|
817
|
-
|
|
818
|
-
|
|
809
|
+
* @see https://redis.io/commands/ping
|
|
810
|
+
*/
|
|
819
811
|
ping: (message?: string | undefined) => Promise<string>;
|
|
820
812
|
/**
|
|
821
|
-
|
|
822
|
-
|
|
813
|
+
* @see https://redis.io/commands/psetex
|
|
814
|
+
*/
|
|
823
815
|
psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
|
|
824
816
|
/**
|
|
825
|
-
|
|
826
|
-
|
|
817
|
+
* @see https://redis.io/commands/pttl
|
|
818
|
+
*/
|
|
827
819
|
pttl: (key: string) => Promise<number>;
|
|
828
820
|
/**
|
|
829
|
-
|
|
830
|
-
|
|
821
|
+
* @see https://redis.io/commands/publish
|
|
822
|
+
*/
|
|
831
823
|
publish: (channel: string, message: unknown) => Promise<number>;
|
|
832
824
|
/**
|
|
833
|
-
|
|
834
|
-
|
|
825
|
+
* @see https://redis.io/commands/randomkey
|
|
826
|
+
*/
|
|
835
827
|
randomkey: () => Promise<string | null>;
|
|
836
828
|
/**
|
|
837
|
-
|
|
838
|
-
|
|
829
|
+
* @see https://redis.io/commands/rename
|
|
830
|
+
*/
|
|
839
831
|
rename: (source: string, destination: string) => Promise<"OK">;
|
|
840
832
|
/**
|
|
841
|
-
|
|
842
|
-
|
|
833
|
+
* @see https://redis.io/commands/renamenx
|
|
834
|
+
*/
|
|
843
835
|
renamenx: (source: string, destination: string) => Promise<0 | 1>;
|
|
844
836
|
/**
|
|
845
|
-
|
|
846
|
-
|
|
837
|
+
* @see https://redis.io/commands/rpop
|
|
838
|
+
*/
|
|
847
839
|
rpop: <TData = string>(key: string) => Promise<TData | null>;
|
|
848
840
|
/**
|
|
849
|
-
|
|
850
|
-
|
|
841
|
+
* @see https://redis.io/commands/rpush
|
|
842
|
+
*/
|
|
851
843
|
rpush: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
|
|
852
844
|
/**
|
|
853
|
-
|
|
854
|
-
|
|
845
|
+
* @see https://redis.io/commands/rpushx
|
|
846
|
+
*/
|
|
855
847
|
rpushx: <TData>(key: string, elements_0: TData, ...elements_1: TData[]) => Promise<number>;
|
|
856
848
|
/**
|
|
857
|
-
|
|
858
|
-
|
|
849
|
+
* @see https://redis.io/commands/sadd
|
|
850
|
+
*/
|
|
859
851
|
sadd: <TData>(key: string, members_0: TData, ...members_1: TData[]) => Promise<number>;
|
|
860
852
|
/**
|
|
861
|
-
|
|
862
|
-
|
|
853
|
+
* @see https://redis.io/commands/scan
|
|
854
|
+
*/
|
|
863
855
|
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
|
|
864
856
|
/**
|
|
865
|
-
|
|
866
|
-
|
|
857
|
+
* @see https://redis.io/commands/scard
|
|
858
|
+
*/
|
|
867
859
|
scard: (key: string) => Promise<number>;
|
|
868
860
|
/**
|
|
869
|
-
|
|
870
|
-
|
|
861
|
+
* @see https://redis.io/commands/script-exists
|
|
862
|
+
*/
|
|
871
863
|
scriptExists: (args_0: string, ...args_1: string[]) => Promise<[]>;
|
|
872
864
|
/**
|
|
873
|
-
|
|
874
|
-
|
|
865
|
+
* @see https://redis.io/commands/script-flush
|
|
866
|
+
*/
|
|
875
867
|
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
|
|
876
868
|
/**
|
|
877
|
-
|
|
878
|
-
|
|
869
|
+
* @see https://redis.io/commands/script-load
|
|
870
|
+
*/
|
|
879
871
|
scriptLoad: (script: string) => Promise<string>;
|
|
880
872
|
/**
|
|
881
|
-
|
|
882
|
-
|
|
873
|
+
* @see https://redis.io/commands/sdiff
|
|
874
|
+
*/
|
|
883
875
|
sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
884
876
|
/**
|
|
885
|
-
|
|
886
|
-
|
|
877
|
+
* @see https://redis.io/commands/sdiffstore
|
|
878
|
+
*/
|
|
887
879
|
sdiffstore: (args_0: string, args_1: string, ...args_2: string[]) => Promise<number>;
|
|
888
880
|
/**
|
|
889
|
-
|
|
890
|
-
|
|
881
|
+
* @see https://redis.io/commands/set
|
|
882
|
+
*/
|
|
891
883
|
set: <TData>(key: string, value: TData, opts?: SetCommandOptions | undefined) => Promise<TData>;
|
|
892
884
|
/**
|
|
893
|
-
|
|
894
|
-
|
|
885
|
+
* @see https://redis.io/commands/setbit
|
|
886
|
+
*/
|
|
895
887
|
setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
|
|
896
888
|
/**
|
|
897
|
-
|
|
898
|
-
|
|
889
|
+
* @see https://redis.io/commands/setex
|
|
890
|
+
*/
|
|
899
891
|
setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
|
|
900
892
|
/**
|
|
901
|
-
|
|
902
|
-
|
|
893
|
+
* @see https://redis.io/commands/setnx
|
|
894
|
+
*/
|
|
903
895
|
setnx: <TData>(key: string, value: TData) => Promise<number>;
|
|
904
896
|
/**
|
|
905
|
-
|
|
906
|
-
|
|
897
|
+
* @see https://redis.io/commands/setrange
|
|
898
|
+
*/
|
|
907
899
|
setrange: (key: string, offset: number, value: string) => Promise<number>;
|
|
908
900
|
/**
|
|
909
|
-
|
|
910
|
-
|
|
901
|
+
* @see https://redis.io/commands/sinter
|
|
902
|
+
*/
|
|
911
903
|
sinter: (key: string, ...keys: string[]) => Promise<string[]>;
|
|
912
904
|
/**
|
|
913
|
-
|
|
914
|
-
|
|
905
|
+
* @see https://redis.io/commands/sinterstore
|
|
906
|
+
*/
|
|
915
907
|
sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<string[]>;
|
|
916
908
|
/**
|
|
917
|
-
|
|
918
|
-
|
|
909
|
+
* @see https://redis.io/commands/sismember
|
|
910
|
+
*/
|
|
919
911
|
sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
|
|
920
912
|
/**
|
|
921
|
-
|
|
922
|
-
|
|
913
|
+
* @see https://redis.io/commands/smembers
|
|
914
|
+
*/
|
|
923
915
|
smembers: (key: string) => Promise<string[]>;
|
|
924
916
|
/**
|
|
925
|
-
|
|
926
|
-
|
|
917
|
+
* @see https://redis.io/commands/smove
|
|
918
|
+
*/
|
|
927
919
|
smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
|
|
928
920
|
/**
|
|
929
|
-
|
|
930
|
-
|
|
921
|
+
* @see https://redis.io/commands/spop
|
|
922
|
+
*/
|
|
931
923
|
spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
932
924
|
/**
|
|
933
|
-
|
|
934
|
-
|
|
925
|
+
* @see https://redis.io/commands/srandmember
|
|
926
|
+
*/
|
|
935
927
|
srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
936
928
|
/**
|
|
937
|
-
|
|
938
|
-
|
|
929
|
+
* @see https://redis.io/commands/srem
|
|
930
|
+
*/
|
|
939
931
|
srem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => Promise<number>;
|
|
940
932
|
/**
|
|
941
|
-
|
|
942
|
-
|
|
933
|
+
* @see https://redis.io/commands/sscan
|
|
934
|
+
*/
|
|
943
935
|
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
944
936
|
/**
|
|
945
|
-
|
|
946
|
-
|
|
937
|
+
* @see https://redis.io/commands/strlen
|
|
938
|
+
*/
|
|
947
939
|
strlen: (key: string) => Promise<number>;
|
|
948
940
|
/**
|
|
949
|
-
|
|
950
|
-
|
|
941
|
+
* @see https://redis.io/commands/sunion
|
|
942
|
+
*/
|
|
951
943
|
sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
952
944
|
/**
|
|
953
|
-
|
|
954
|
-
|
|
945
|
+
* @see https://redis.io/commands/sunionstore
|
|
946
|
+
*/
|
|
955
947
|
sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
956
948
|
/**
|
|
957
|
-
|
|
958
|
-
|
|
949
|
+
* @see https://redis.io/commands/time
|
|
950
|
+
*/
|
|
959
951
|
time: () => Promise<[number, number]>;
|
|
960
952
|
/**
|
|
961
|
-
|
|
962
|
-
|
|
953
|
+
* @see https://redis.io/commands/touch
|
|
954
|
+
*/
|
|
963
955
|
touch: (args_0: string, ...args_1: string[]) => Promise<number>;
|
|
964
956
|
/**
|
|
965
|
-
|
|
966
|
-
|
|
957
|
+
* @see https://redis.io/commands/ttl
|
|
958
|
+
*/
|
|
967
959
|
ttl: (key: string) => Promise<number>;
|
|
968
960
|
/**
|
|
969
|
-
|
|
970
|
-
|
|
961
|
+
* @see https://redis.io/commands/type
|
|
962
|
+
*/
|
|
971
963
|
type: (key: string) => Promise<Type>;
|
|
972
964
|
/**
|
|
973
|
-
|
|
974
|
-
|
|
965
|
+
* @see https://redis.io/commands/unlink
|
|
966
|
+
*/
|
|
975
967
|
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
|
|
976
968
|
/**
|
|
977
|
-
|
|
978
|
-
|
|
969
|
+
* @see https://redis.io/commands/zadd
|
|
970
|
+
*/
|
|
979
971
|
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [string, ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
|
|
980
972
|
/**
|
|
981
|
-
|
|
982
|
-
|
|
973
|
+
* @see https://redis.io/commands/zcard
|
|
974
|
+
*/
|
|
983
975
|
zcard: (key: string) => Promise<number>;
|
|
984
976
|
/**
|
|
985
|
-
|
|
986
|
-
|
|
977
|
+
* @see https://redis.io/commands/zcount
|
|
978
|
+
*/
|
|
987
979
|
zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
|
|
988
980
|
/**
|
|
989
|
-
|
|
990
|
-
|
|
981
|
+
* @see https://redis.io/commands/zincrby
|
|
982
|
+
*/
|
|
991
983
|
zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
|
|
992
984
|
/**
|
|
993
|
-
|
|
994
|
-
|
|
985
|
+
* @see https://redis.io/commands/zinterstore
|
|
986
|
+
*/
|
|
995
987
|
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
|
|
996
988
|
/**
|
|
997
|
-
|
|
998
|
-
|
|
989
|
+
* @see https://redis.io/commands/zlexcount
|
|
990
|
+
*/
|
|
999
991
|
zlexcount: (key: string, min: string, max: string) => Promise<number>;
|
|
1000
992
|
/**
|
|
1001
|
-
|
|
1002
|
-
|
|
993
|
+
* @see https://redis.io/commands/zpopmax
|
|
994
|
+
*/
|
|
1003
995
|
zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
1004
996
|
/**
|
|
1005
|
-
|
|
1006
|
-
|
|
997
|
+
* @see https://redis.io/commands/zpopmin
|
|
998
|
+
*/
|
|
1007
999
|
zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
1008
1000
|
/**
|
|
1009
|
-
|
|
1010
|
-
|
|
1001
|
+
* @see https://redis.io/commands/zrange
|
|
1002
|
+
*/
|
|
1011
1003
|
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
1012
1004
|
key: string,
|
|
1013
1005
|
min: `(${string}` | `[${string}` | "-" | "+",
|
|
@@ -1024,40 +1016,40 @@ declare class Redis {
|
|
|
1024
1016
|
} & ZRangeCommandOptions
|
|
1025
1017
|
]) => Promise<TData>;
|
|
1026
1018
|
/**
|
|
1027
|
-
|
|
1028
|
-
|
|
1019
|
+
* @see https://redis.io/commands/zrank
|
|
1020
|
+
*/
|
|
1029
1021
|
zrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
1030
1022
|
/**
|
|
1031
|
-
|
|
1032
|
-
|
|
1023
|
+
* @see https://redis.io/commands/zrem
|
|
1024
|
+
*/
|
|
1033
1025
|
zrem: <TData>(key: string, members_0: TData, ...members_1: TData[]) => Promise<number>;
|
|
1034
1026
|
/**
|
|
1035
|
-
|
|
1036
|
-
|
|
1027
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
1028
|
+
*/
|
|
1037
1029
|
zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
|
|
1038
1030
|
/**
|
|
1039
|
-
|
|
1040
|
-
|
|
1031
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
1032
|
+
*/
|
|
1041
1033
|
zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
|
|
1042
1034
|
/**
|
|
1043
|
-
|
|
1044
|
-
|
|
1035
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
1036
|
+
*/
|
|
1045
1037
|
zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
|
|
1046
1038
|
/**
|
|
1047
|
-
|
|
1048
|
-
|
|
1039
|
+
* @see https://redis.io/commands/zrevrank
|
|
1040
|
+
*/
|
|
1049
1041
|
zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
1050
1042
|
/**
|
|
1051
|
-
|
|
1052
|
-
|
|
1043
|
+
* @see https://redis.io/commands/zscan
|
|
1044
|
+
*/
|
|
1053
1045
|
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
1054
1046
|
/**
|
|
1055
|
-
|
|
1056
|
-
|
|
1047
|
+
* @see https://redis.io/commands/zscore
|
|
1048
|
+
*/
|
|
1057
1049
|
zscore: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
1058
1050
|
/**
|
|
1059
|
-
|
|
1060
|
-
|
|
1051
|
+
* @see https://redis.io/commands/zunionstore
|
|
1052
|
+
*/
|
|
1061
1053
|
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
1062
1054
|
}
|
|
1063
1055
|
|