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