@upstash/redis 1.0.0 → 1.0.3
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/chunk-2EIGUPGW.mjs +375 -0
- package/{chunk-AHCVU33N.mjs → chunk-WPH7MAB2.mjs} +1 -1
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +240 -663
- package/cloudflare.mjs +1 -1
- package/commands.d.ts +515 -3
- package/fastly.d.ts +2 -2
- package/fastly.js +240 -663
- package/fastly.mjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +240 -663
- package/index.mjs +2 -2
- package/nodejs.d.ts +2 -2
- package/nodejs.js +240 -663
- package/nodejs.mjs +2 -2
- package/package.json +1 -1
- package/redis-8b6ea223.d.ts +976 -0
- package/zunionstore-e1cc0e90.d.ts +158 -0
- package/chunk-T66TTHSV.mjs +0 -798
- package/redis-71fa1ee6.d.ts +0 -966
- package/zunionstore-b38007ba.d.ts +0 -670
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppendCommand,
|
|
3
|
+
BitCountCommand,
|
|
4
|
+
BitOpCommand,
|
|
5
|
+
BitPosCommand,
|
|
6
|
+
DBSizeCommand,
|
|
7
|
+
DecrByCommand,
|
|
8
|
+
DecrCommand,
|
|
9
|
+
DelCommand,
|
|
10
|
+
EchoCommand,
|
|
11
|
+
ExistsCommand,
|
|
12
|
+
ExpireAtCommand,
|
|
13
|
+
ExpireCommand,
|
|
14
|
+
FlushAllCommand,
|
|
15
|
+
FlushDBCommand,
|
|
16
|
+
GetBitCommand,
|
|
17
|
+
GetCommand,
|
|
18
|
+
GetRangeCommand,
|
|
19
|
+
GetSetCommand,
|
|
20
|
+
HDelCommand,
|
|
21
|
+
HExistsCommand,
|
|
22
|
+
HGetAllCommand,
|
|
23
|
+
HGetCommand,
|
|
24
|
+
HIncrByCommand,
|
|
25
|
+
HIncrByFloatCommand,
|
|
26
|
+
HKeysCommand,
|
|
27
|
+
HLenCommand,
|
|
28
|
+
HMGetCommand,
|
|
29
|
+
HMSetCommand,
|
|
30
|
+
HScanCommand,
|
|
31
|
+
HSetCommand,
|
|
32
|
+
HSetNXCommand,
|
|
33
|
+
HStrLenCommand,
|
|
34
|
+
HValsCommand,
|
|
35
|
+
IncrByCommand,
|
|
36
|
+
IncrByFloatCommand,
|
|
37
|
+
IncrCommand,
|
|
38
|
+
KeysCommand,
|
|
39
|
+
LIndexCommand,
|
|
40
|
+
LInsertCommand,
|
|
41
|
+
LLenCommand,
|
|
42
|
+
LPopCommand,
|
|
43
|
+
LPushCommand,
|
|
44
|
+
LPushXCommand,
|
|
45
|
+
LRangeCommand,
|
|
46
|
+
LRemCommand,
|
|
47
|
+
LSetCommand,
|
|
48
|
+
LTrimCommand,
|
|
49
|
+
MGetCommand,
|
|
50
|
+
MSetCommand,
|
|
51
|
+
MSetNXCommand,
|
|
52
|
+
PExpireAtCommand,
|
|
53
|
+
PExpireCommand,
|
|
54
|
+
PSetEXCommand,
|
|
55
|
+
PTtlCommand,
|
|
56
|
+
PersistCommand,
|
|
57
|
+
PingCommand,
|
|
58
|
+
RPopCommand,
|
|
59
|
+
RPushCommand,
|
|
60
|
+
RPushXCommand,
|
|
61
|
+
RandomKeyCommand,
|
|
62
|
+
RenameCommand,
|
|
63
|
+
RenameNXCommand,
|
|
64
|
+
SAddCommand,
|
|
65
|
+
SCardCommand,
|
|
66
|
+
SDiffCommand,
|
|
67
|
+
SDiffStoreCommand,
|
|
68
|
+
SInterCommand,
|
|
69
|
+
SInterStoreCommand,
|
|
70
|
+
SIsMemberCommand,
|
|
71
|
+
SMembersCommand,
|
|
72
|
+
SMoveCommand,
|
|
73
|
+
SPopCommand,
|
|
74
|
+
SRandMemberCommand,
|
|
75
|
+
SRemCommand,
|
|
76
|
+
SScanCommand,
|
|
77
|
+
SUnionCommand,
|
|
78
|
+
SUnionStoreCommand,
|
|
79
|
+
ScanCommand,
|
|
80
|
+
SetBitCommand,
|
|
81
|
+
SetCommand,
|
|
82
|
+
SetExCommand,
|
|
83
|
+
SetNxCommand,
|
|
84
|
+
SetRangeCommand,
|
|
85
|
+
StrLenCommand,
|
|
86
|
+
TimeCommand,
|
|
87
|
+
TouchCommand,
|
|
88
|
+
TtlCommand,
|
|
89
|
+
TypeCommand,
|
|
90
|
+
UnlinkCommand,
|
|
91
|
+
ZAddCommand,
|
|
92
|
+
ZCardCommand,
|
|
93
|
+
ZCountCommand,
|
|
94
|
+
ZIncrByComand,
|
|
95
|
+
ZInterStoreCommand,
|
|
96
|
+
ZLexCountCommand,
|
|
97
|
+
ZPopMaxCommand,
|
|
98
|
+
ZPopMinCommand,
|
|
99
|
+
ZRangeCommand,
|
|
100
|
+
ZRankCommand,
|
|
101
|
+
ZRemCommand,
|
|
102
|
+
ZRemRangeByLexCommand,
|
|
103
|
+
ZRemRangeByRankCommand,
|
|
104
|
+
ZRemRangeByScoreCommand,
|
|
105
|
+
ZRevRankCommand,
|
|
106
|
+
ZScanCommand,
|
|
107
|
+
ZScoreCommand,
|
|
108
|
+
ZUnionStoreCommand
|
|
109
|
+
} from "./chunk-HGM7M7CJ.mjs";
|
|
110
|
+
import {
|
|
111
|
+
UpstashError
|
|
112
|
+
} from "./chunk-7YUZYRJS.mjs";
|
|
113
|
+
|
|
114
|
+
// pkg/pipeline.ts
|
|
115
|
+
var Pipeline = class {
|
|
116
|
+
constructor(client) {
|
|
117
|
+
this.exec = async () => {
|
|
118
|
+
if (this.commands.length === 0) {
|
|
119
|
+
throw new Error("Pipeline is empty");
|
|
120
|
+
}
|
|
121
|
+
const res = await this.client.request({
|
|
122
|
+
path: ["pipeline"],
|
|
123
|
+
body: Object.values(this.commands).map((c) => c.command)
|
|
124
|
+
});
|
|
125
|
+
return res.map(({ error, result }, i) => {
|
|
126
|
+
if (error) {
|
|
127
|
+
throw new UpstashError(`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`);
|
|
128
|
+
}
|
|
129
|
+
return this.commands[i].deserialize(result);
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
this.append = (...args) => this.chain(new AppendCommand(...args));
|
|
133
|
+
this.bitcount = (...args) => this.chain(new BitCountCommand(...args));
|
|
134
|
+
this.bitop = (op, destinationKey, sourceKey, ...sourceKeys) => this.chain(new BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys));
|
|
135
|
+
this.bitpos = (...args) => this.chain(new BitPosCommand(...args));
|
|
136
|
+
this.dbsize = () => this.chain(new DBSizeCommand());
|
|
137
|
+
this.decr = (...args) => this.chain(new DecrCommand(...args));
|
|
138
|
+
this.decrby = (...args) => this.chain(new DecrByCommand(...args));
|
|
139
|
+
this.del = (...args) => this.chain(new DelCommand(...args));
|
|
140
|
+
this.echo = (...args) => this.chain(new EchoCommand(...args));
|
|
141
|
+
this.exists = (...args) => this.chain(new ExistsCommand(...args));
|
|
142
|
+
this.expire = (...args) => this.chain(new ExpireCommand(...args));
|
|
143
|
+
this.expireat = (...args) => this.chain(new ExpireAtCommand(...args));
|
|
144
|
+
this.flushall = (...args) => this.chain(new FlushAllCommand(...args));
|
|
145
|
+
this.flushdb = (...args) => this.chain(new FlushDBCommand(...args));
|
|
146
|
+
this.get = (...args) => this.chain(new GetCommand(...args));
|
|
147
|
+
this.getbit = (...args) => this.chain(new GetBitCommand(...args));
|
|
148
|
+
this.getrange = (...args) => this.chain(new GetRangeCommand(...args));
|
|
149
|
+
this.getset = (key, value) => this.chain(new GetSetCommand(key, value));
|
|
150
|
+
this.hdel = (...args) => this.chain(new HDelCommand(...args));
|
|
151
|
+
this.hexists = (...args) => this.chain(new HExistsCommand(...args));
|
|
152
|
+
this.hget = (...args) => this.chain(new HGetCommand(...args));
|
|
153
|
+
this.hgetall = (...args) => this.chain(new HGetAllCommand(...args));
|
|
154
|
+
this.hincrby = (...args) => this.chain(new HIncrByCommand(...args));
|
|
155
|
+
this.hincrbyfloat = (...args) => this.chain(new HIncrByFloatCommand(...args));
|
|
156
|
+
this.hkeys = (...args) => this.chain(new HKeysCommand(...args));
|
|
157
|
+
this.hlen = (...args) => this.chain(new HLenCommand(...args));
|
|
158
|
+
this.hmget = (...args) => this.chain(new HMGetCommand(...args));
|
|
159
|
+
this.hmset = (key, kv) => this.chain(new HMSetCommand(key, kv));
|
|
160
|
+
this.hscan = (...args) => this.chain(new HScanCommand(...args));
|
|
161
|
+
this.hset = (key, kv) => this.chain(new HSetCommand(key, kv));
|
|
162
|
+
this.hsetnx = (key, field, value) => this.chain(new HSetNXCommand(key, field, value));
|
|
163
|
+
this.hstrlen = (...args) => this.chain(new HStrLenCommand(...args));
|
|
164
|
+
this.hvals = (...args) => this.chain(new HValsCommand(...args));
|
|
165
|
+
this.incr = (...args) => this.chain(new IncrCommand(...args));
|
|
166
|
+
this.incrby = (...args) => this.chain(new IncrByCommand(...args));
|
|
167
|
+
this.incrbyfloat = (...args) => this.chain(new IncrByFloatCommand(...args));
|
|
168
|
+
this.keys = (...args) => this.chain(new KeysCommand(...args));
|
|
169
|
+
this.lindex = (...args) => this.chain(new LIndexCommand(...args));
|
|
170
|
+
this.linsert = (key, direction, pivot, value) => this.chain(new LInsertCommand(key, direction, pivot, value));
|
|
171
|
+
this.llen = (...args) => this.chain(new LLenCommand(...args));
|
|
172
|
+
this.lpop = (...args) => this.chain(new LPopCommand(...args));
|
|
173
|
+
this.lpush = (key, ...elements) => this.chain(new LPushCommand(key, ...elements));
|
|
174
|
+
this.lpushx = (key, ...elements) => this.chain(new LPushXCommand(key, ...elements));
|
|
175
|
+
this.lrange = (...args) => this.chain(new LRangeCommand(...args));
|
|
176
|
+
this.lrem = (key, count, value) => this.chain(new LRemCommand(key, count, value));
|
|
177
|
+
this.lset = (key, value, index) => this.chain(new LSetCommand(key, value, index));
|
|
178
|
+
this.ltrim = (...args) => this.chain(new LTrimCommand(...args));
|
|
179
|
+
this.mget = (...args) => this.chain(new MGetCommand(...args));
|
|
180
|
+
this.mset = (kv) => this.chain(new MSetCommand(kv));
|
|
181
|
+
this.msetnx = (kv) => this.chain(new MSetNXCommand(kv));
|
|
182
|
+
this.persist = (...args) => this.chain(new PersistCommand(...args));
|
|
183
|
+
this.pexpire = (...args) => this.chain(new PExpireCommand(...args));
|
|
184
|
+
this.pexpireat = (...args) => this.chain(new PExpireAtCommand(...args));
|
|
185
|
+
this.ping = (...args) => this.chain(new PingCommand(...args));
|
|
186
|
+
this.psetex = (key, ttl, value) => this.chain(new PSetEXCommand(key, ttl, value));
|
|
187
|
+
this.pttl = (...args) => this.chain(new PTtlCommand(...args));
|
|
188
|
+
this.randomkey = () => this.chain(new RandomKeyCommand());
|
|
189
|
+
this.rename = (...args) => this.chain(new RenameCommand(...args));
|
|
190
|
+
this.renamenx = (...args) => this.chain(new RenameNXCommand(...args));
|
|
191
|
+
this.rpop = (...args) => this.chain(new RPopCommand(...args));
|
|
192
|
+
this.rpush = (key, ...elements) => this.chain(new RPushCommand(key, ...elements));
|
|
193
|
+
this.rpushx = (key, ...elements) => this.chain(new RPushXCommand(key, ...elements));
|
|
194
|
+
this.sadd = (key, ...members) => this.chain(new SAddCommand(key, ...members));
|
|
195
|
+
this.scan = (...args) => this.chain(new ScanCommand(...args));
|
|
196
|
+
this.scard = (...args) => this.chain(new SCardCommand(...args));
|
|
197
|
+
this.sdiff = (...args) => this.chain(new SDiffCommand(...args));
|
|
198
|
+
this.sdiffstore = (...args) => this.chain(new SDiffStoreCommand(...args));
|
|
199
|
+
this.set = (key, value, opts) => this.chain(new SetCommand(key, value, opts));
|
|
200
|
+
this.setbit = (...args) => this.chain(new SetBitCommand(...args));
|
|
201
|
+
this.setex = (key, ttl, value) => this.chain(new SetExCommand(key, ttl, value));
|
|
202
|
+
this.setnx = (key, value) => this.chain(new SetNxCommand(key, value));
|
|
203
|
+
this.setrange = (...args) => this.chain(new SetRangeCommand(...args));
|
|
204
|
+
this.sinter = (...args) => this.chain(new SInterCommand(...args));
|
|
205
|
+
this.sinterstore = (...args) => this.chain(new SInterStoreCommand(...args));
|
|
206
|
+
this.sismember = (key, member) => this.chain(new SIsMemberCommand(key, member));
|
|
207
|
+
this.smembers = (...args) => this.chain(new SMembersCommand(...args));
|
|
208
|
+
this.smove = (source, destination, member) => this.chain(new SMoveCommand(source, destination, member));
|
|
209
|
+
this.spop = (...args) => this.chain(new SPopCommand(...args));
|
|
210
|
+
this.srandmember = (...args) => this.chain(new SRandMemberCommand(...args));
|
|
211
|
+
this.srem = (key, ...members) => this.chain(new SRemCommand(key, ...members));
|
|
212
|
+
this.sscan = (...args) => this.chain(new SScanCommand(...args));
|
|
213
|
+
this.strlen = (...args) => this.chain(new StrLenCommand(...args));
|
|
214
|
+
this.sunion = (...args) => this.chain(new SUnionCommand(...args));
|
|
215
|
+
this.sunionstore = (...args) => this.chain(new SUnionStoreCommand(...args));
|
|
216
|
+
this.time = () => this.chain(new TimeCommand());
|
|
217
|
+
this.touch = (...args) => this.chain(new TouchCommand(...args));
|
|
218
|
+
this.ttl = (...args) => this.chain(new TtlCommand(...args));
|
|
219
|
+
this.type = (...args) => this.chain(new TypeCommand(...args));
|
|
220
|
+
this.unlink = (...args) => this.chain(new UnlinkCommand(...args));
|
|
221
|
+
this.zadd = (...args) => {
|
|
222
|
+
if ("score" in args[1]) {
|
|
223
|
+
return this.chain(new ZAddCommand(args[0], args[1], ...args.slice(2)));
|
|
224
|
+
}
|
|
225
|
+
return this.chain(new ZAddCommand(args[0], args[1], ...args.slice(2)));
|
|
226
|
+
};
|
|
227
|
+
this.zcard = (...args) => this.chain(new ZCardCommand(...args));
|
|
228
|
+
this.zcount = (...args) => this.chain(new ZCountCommand(...args));
|
|
229
|
+
this.zincrby = (key, increment, member) => this.chain(new ZIncrByComand(key, increment, member));
|
|
230
|
+
this.zinterstore = (...args) => this.chain(new ZInterStoreCommand(...args));
|
|
231
|
+
this.zlexcount = (...args) => this.chain(new ZLexCountCommand(...args));
|
|
232
|
+
this.zpopmax = (...args) => this.chain(new ZPopMaxCommand(...args));
|
|
233
|
+
this.zpopmin = (...args) => this.chain(new ZPopMinCommand(...args));
|
|
234
|
+
this.zrange = (...args) => this.chain(new ZRangeCommand(...args));
|
|
235
|
+
this.zrank = (key, member) => this.chain(new ZRankCommand(key, member));
|
|
236
|
+
this.zrem = (key, ...members) => this.chain(new ZRemCommand(key, ...members));
|
|
237
|
+
this.zremrangebylex = (...args) => this.chain(new ZRemRangeByLexCommand(...args));
|
|
238
|
+
this.zremrangebyrank = (...args) => this.chain(new ZRemRangeByRankCommand(...args));
|
|
239
|
+
this.zremrangebyscore = (...args) => this.chain(new ZRemRangeByScoreCommand(...args));
|
|
240
|
+
this.zrevrank = (key, member) => this.chain(new ZRevRankCommand(key, member));
|
|
241
|
+
this.zscan = (...args) => this.chain(new ZScanCommand(...args));
|
|
242
|
+
this.zscore = (key, member) => this.chain(new ZScoreCommand(key, member));
|
|
243
|
+
this.zunionstore = (...args) => this.chain(new ZUnionStoreCommand(...args));
|
|
244
|
+
this.client = client;
|
|
245
|
+
this.commands = [];
|
|
246
|
+
}
|
|
247
|
+
chain(command) {
|
|
248
|
+
this.commands.push(command);
|
|
249
|
+
return this;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
// pkg/redis.ts
|
|
254
|
+
var Redis = class {
|
|
255
|
+
constructor(client) {
|
|
256
|
+
this.pipeline = () => new Pipeline(this.client);
|
|
257
|
+
this.append = (...args) => new AppendCommand(...args).exec(this.client);
|
|
258
|
+
this.bitcount = (...args) => new BitCountCommand(...args).exec(this.client);
|
|
259
|
+
this.bitop = (op, destinationKey, sourceKey, ...sourceKeys) => new BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys).exec(this.client);
|
|
260
|
+
this.bitpos = (...args) => new BitPosCommand(...args).exec(this.client);
|
|
261
|
+
this.dbsize = () => new DBSizeCommand().exec(this.client);
|
|
262
|
+
this.decr = (...args) => new DecrCommand(...args).exec(this.client);
|
|
263
|
+
this.decrby = (...args) => new DecrByCommand(...args).exec(this.client);
|
|
264
|
+
this.del = (...args) => new DelCommand(...args).exec(this.client);
|
|
265
|
+
this.echo = (...args) => new EchoCommand(...args).exec(this.client);
|
|
266
|
+
this.exists = (...args) => new ExistsCommand(...args).exec(this.client);
|
|
267
|
+
this.expire = (...args) => new ExpireCommand(...args).exec(this.client);
|
|
268
|
+
this.expireat = (...args) => new ExpireAtCommand(...args).exec(this.client);
|
|
269
|
+
this.flushall = (...args) => new FlushAllCommand(...args).exec(this.client);
|
|
270
|
+
this.flushdb = (...args) => new FlushDBCommand(...args).exec(this.client);
|
|
271
|
+
this.get = (...args) => new GetCommand(...args).exec(this.client);
|
|
272
|
+
this.getbit = (...args) => new GetBitCommand(...args).exec(this.client);
|
|
273
|
+
this.getrange = (...args) => new GetRangeCommand(...args).exec(this.client);
|
|
274
|
+
this.getset = (key, value) => new GetSetCommand(key, value).exec(this.client);
|
|
275
|
+
this.hdel = (...args) => new HDelCommand(...args).exec(this.client);
|
|
276
|
+
this.hexists = (...args) => new HExistsCommand(...args).exec(this.client);
|
|
277
|
+
this.hget = (...args) => new HGetCommand(...args).exec(this.client);
|
|
278
|
+
this.hgetall = (...args) => new HGetAllCommand(...args).exec(this.client);
|
|
279
|
+
this.hincrby = (...args) => new HIncrByCommand(...args).exec(this.client);
|
|
280
|
+
this.hincrbyfloat = (...args) => new HIncrByFloatCommand(...args).exec(this.client);
|
|
281
|
+
this.hkeys = (...args) => new HKeysCommand(...args).exec(this.client);
|
|
282
|
+
this.hlen = (...args) => new HLenCommand(...args).exec(this.client);
|
|
283
|
+
this.hmget = (...args) => new HMGetCommand(...args).exec(this.client);
|
|
284
|
+
this.hmset = (key, kv) => new HMSetCommand(key, kv).exec(this.client);
|
|
285
|
+
this.hscan = (...args) => new HScanCommand(...args).exec(this.client);
|
|
286
|
+
this.hset = (key, kv) => new HSetCommand(key, kv).exec(this.client);
|
|
287
|
+
this.hsetnx = (key, field, value) => new HSetNXCommand(key, field, value).exec(this.client);
|
|
288
|
+
this.hstrlen = (...args) => new HStrLenCommand(...args).exec(this.client);
|
|
289
|
+
this.hvals = (...args) => new HValsCommand(...args).exec(this.client);
|
|
290
|
+
this.incr = (...args) => new IncrCommand(...args).exec(this.client);
|
|
291
|
+
this.incrby = (...args) => new IncrByCommand(...args).exec(this.client);
|
|
292
|
+
this.incrbyfloat = (...args) => new IncrByFloatCommand(...args).exec(this.client);
|
|
293
|
+
this.keys = (...args) => new KeysCommand(...args).exec(this.client);
|
|
294
|
+
this.lindex = (...args) => new LIndexCommand(...args).exec(this.client);
|
|
295
|
+
this.linsert = (key, direction, pivot, value) => new LInsertCommand(key, direction, pivot, value).exec(this.client);
|
|
296
|
+
this.llen = (...args) => new LLenCommand(...args).exec(this.client);
|
|
297
|
+
this.lpop = (...args) => new LPopCommand(...args).exec(this.client);
|
|
298
|
+
this.lpush = (key, ...elements) => new LPushCommand(key, ...elements).exec(this.client);
|
|
299
|
+
this.lpushx = (key, ...elements) => new LPushXCommand(key, ...elements).exec(this.client);
|
|
300
|
+
this.lrange = (...args) => new LRangeCommand(...args).exec(this.client);
|
|
301
|
+
this.lrem = (key, count, value) => new LRemCommand(key, count, value).exec(this.client);
|
|
302
|
+
this.lset = (key, value, index) => new LSetCommand(key, value, index).exec(this.client);
|
|
303
|
+
this.ltrim = (...args) => new LTrimCommand(...args).exec(this.client);
|
|
304
|
+
this.mget = (...args) => new MGetCommand(...args).exec(this.client);
|
|
305
|
+
this.mset = (kv) => new MSetCommand(kv).exec(this.client);
|
|
306
|
+
this.msetnx = (kv) => new MSetNXCommand(kv).exec(this.client);
|
|
307
|
+
this.persist = (...args) => new PersistCommand(...args).exec(this.client);
|
|
308
|
+
this.pexpire = (...args) => new PExpireCommand(...args).exec(this.client);
|
|
309
|
+
this.pexpireat = (...args) => new PExpireAtCommand(...args).exec(this.client);
|
|
310
|
+
this.ping = (...args) => new PingCommand(...args).exec(this.client);
|
|
311
|
+
this.psetex = (key, ttl, value) => new PSetEXCommand(key, ttl, value).exec(this.client);
|
|
312
|
+
this.pttl = (...args) => new PTtlCommand(...args).exec(this.client);
|
|
313
|
+
this.randomkey = () => new RandomKeyCommand().exec(this.client);
|
|
314
|
+
this.rename = (...args) => new RenameCommand(...args).exec(this.client);
|
|
315
|
+
this.renamenx = (...args) => new RenameNXCommand(...args).exec(this.client);
|
|
316
|
+
this.rpop = (...args) => new RPopCommand(...args).exec(this.client);
|
|
317
|
+
this.rpush = (key, ...elements) => new RPushCommand(key, ...elements).exec(this.client);
|
|
318
|
+
this.rpushx = (key, ...elements) => new RPushXCommand(key, ...elements).exec(this.client);
|
|
319
|
+
this.sadd = (key, ...members) => new SAddCommand(key, ...members).exec(this.client);
|
|
320
|
+
this.scan = (...args) => new ScanCommand(...args).exec(this.client);
|
|
321
|
+
this.scard = (...args) => new SCardCommand(...args).exec(this.client);
|
|
322
|
+
this.sdiff = (...args) => new SDiffCommand(...args).exec(this.client);
|
|
323
|
+
this.sdiffstore = (...args) => new SDiffStoreCommand(...args).exec(this.client);
|
|
324
|
+
this.set = (key, value, opts) => new SetCommand(key, value, opts).exec(this.client);
|
|
325
|
+
this.setbit = (...args) => new SetBitCommand(...args).exec(this.client);
|
|
326
|
+
this.setex = (key, ttl, value) => new SetExCommand(key, ttl, value).exec(this.client);
|
|
327
|
+
this.setnx = (key, value) => new SetNxCommand(key, value).exec(this.client);
|
|
328
|
+
this.setrange = (...args) => new SetRangeCommand(...args).exec(this.client);
|
|
329
|
+
this.sinter = (...args) => new SInterCommand(...args).exec(this.client);
|
|
330
|
+
this.sinterstore = (...args) => new SInterStoreCommand(...args).exec(this.client);
|
|
331
|
+
this.sismember = (key, member) => new SIsMemberCommand(key, member).exec(this.client);
|
|
332
|
+
this.smembers = (...args) => new SMembersCommand(...args).exec(this.client);
|
|
333
|
+
this.smove = (source, destination, member) => new SMoveCommand(source, destination, member).exec(this.client);
|
|
334
|
+
this.spop = (...args) => new SPopCommand(...args).exec(this.client);
|
|
335
|
+
this.srandmember = (...args) => new SRandMemberCommand(...args).exec(this.client);
|
|
336
|
+
this.srem = (key, ...members) => new SRemCommand(key, ...members).exec(this.client);
|
|
337
|
+
this.sscan = (...args) => new SScanCommand(...args).exec(this.client);
|
|
338
|
+
this.strlen = (...args) => new StrLenCommand(...args).exec(this.client);
|
|
339
|
+
this.sunion = (...args) => new SUnionCommand(...args).exec(this.client);
|
|
340
|
+
this.sunionstore = (...args) => new SUnionStoreCommand(...args).exec(this.client);
|
|
341
|
+
this.time = () => new TimeCommand().exec(this.client);
|
|
342
|
+
this.touch = (...args) => new TouchCommand(...args).exec(this.client);
|
|
343
|
+
this.ttl = (...args) => new TtlCommand(...args).exec(this.client);
|
|
344
|
+
this.type = (...args) => new TypeCommand(...args).exec(this.client);
|
|
345
|
+
this.unlink = (...args) => new UnlinkCommand(...args).exec(this.client);
|
|
346
|
+
this.zadd = (...args) => {
|
|
347
|
+
if ("score" in args[1]) {
|
|
348
|
+
return new ZAddCommand(args[0], args[1], ...args.slice(2)).exec(this.client);
|
|
349
|
+
}
|
|
350
|
+
return new ZAddCommand(args[0], args[1], ...args.slice(2)).exec(this.client);
|
|
351
|
+
};
|
|
352
|
+
this.zcard = (...args) => new ZCardCommand(...args).exec(this.client);
|
|
353
|
+
this.zcount = (...args) => new ZCountCommand(...args).exec(this.client);
|
|
354
|
+
this.zincrby = (key, increment, member) => new ZIncrByComand(key, increment, member).exec(this.client);
|
|
355
|
+
this.zinterstore = (...args) => new ZInterStoreCommand(...args).exec(this.client);
|
|
356
|
+
this.zlexcount = (...args) => new ZLexCountCommand(...args).exec(this.client);
|
|
357
|
+
this.zpopmax = (...args) => new ZPopMaxCommand(...args).exec(this.client);
|
|
358
|
+
this.zpopmin = (...args) => new ZPopMinCommand(...args).exec(this.client);
|
|
359
|
+
this.zrange = (...args) => new ZRangeCommand(...args).exec(this.client);
|
|
360
|
+
this.zrank = (key, member) => new ZRankCommand(key, member).exec(this.client);
|
|
361
|
+
this.zrem = (key, ...members) => new ZRemCommand(key, ...members).exec(this.client);
|
|
362
|
+
this.zremrangebylex = (...args) => new ZRemRangeByLexCommand(...args).exec(this.client);
|
|
363
|
+
this.zremrangebyrank = (...args) => new ZRemRangeByRankCommand(...args).exec(this.client);
|
|
364
|
+
this.zremrangebyscore = (...args) => new ZRemRangeByScoreCommand(...args).exec(this.client);
|
|
365
|
+
this.zrevrank = (key, member) => new ZRevRankCommand(key, member).exec(this.client);
|
|
366
|
+
this.zscan = (...args) => new ZScanCommand(...args).exec(this.client);
|
|
367
|
+
this.zscore = (key, member) => new ZScoreCommand(key, member).exec(this.client);
|
|
368
|
+
this.zunionstore = (...args) => new ZUnionStoreCommand(...args).exec(this.client);
|
|
369
|
+
this.client = client;
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
export {
|
|
374
|
+
Redis
|
|
375
|
+
};
|
package/cloudflare.d.ts
CHANGED