@upstash/redis 1.0.0-alpha.2 → 1.0.0-alpha.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/{dist/chunk-7YUZYRJS.mjs → chunk-7YUZYRJS.mjs} +0 -0
- package/{dist/chunk-FJSI5EBJ.mjs → chunk-FJSI5EBJ.mjs} +0 -0
- package/{dist/chunk-U7OXAQMQ.mjs → chunk-U7OXAQMQ.mjs} +0 -0
- package/{dist/chunk-Y5TC4HX2.mjs → chunk-Y5TC4HX2.mjs} +0 -0
- package/{dist/chunk-ZIB6XPPC.mjs → chunk-ZIB6XPPC.mjs} +0 -0
- package/{dist/cloudflare.d.ts → cloudflare.d.ts} +0 -0
- package/{dist/cloudflare.js → cloudflare.js} +0 -0
- package/{dist/cloudflare.mjs → cloudflare.mjs} +0 -0
- package/{dist/commands.d.ts → commands.d.ts} +0 -0
- package/{dist/commands.js → commands.js} +0 -0
- package/{dist/commands.mjs → commands.mjs} +0 -0
- package/{dist/fastly.d.ts → fastly.d.ts} +0 -0
- package/{dist/fastly.js → fastly.js} +0 -0
- package/{dist/fastly.mjs → fastly.mjs} +0 -0
- package/{dist/http.d.ts → http.d.ts} +0 -0
- package/{dist/http.js → http.js} +0 -0
- package/{dist/http.mjs → http.mjs} +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/{dist/index.mjs → index.mjs} +0 -0
- package/{dist/nodejs.d.ts → nodejs.d.ts} +0 -0
- package/{dist/nodejs.js → nodejs.js} +0 -0
- package/{dist/nodejs.mjs → nodejs.mjs} +0 -0
- package/package.json +1 -1
- package/{dist/redis-dd052782.d.ts → redis-dd052782.d.ts} +0 -0
- package/{dist/zunionstore-dffa797d.d.ts → zunionstore-dffa797d.d.ts} +0 -0
- package/.eslintrc.js +0 -49
- package/.prettierrc.js +0 -7
- package/LICENSE +0 -21
- package/dist/package.json +0 -1
- package/jest.config.js +0 -195
- package/pkg/cloudflare.ts +0 -77
- package/pkg/command.ts +0 -40
- package/pkg/commands/append.test.ts +0 -28
- package/pkg/commands/append.ts +0 -10
- package/pkg/commands/bitcount.test.ts +0 -36
- package/pkg/commands/bitcount.ts +0 -19
- package/pkg/commands/bitop.test.ts +0 -44
- package/pkg/commands/bitop.ts +0 -22
- package/pkg/commands/bitpos.test.ts +0 -26
- package/pkg/commands/bitpos.ts +0 -10
- package/pkg/commands/dbsize.test.ts +0 -17
- package/pkg/commands/dbsize.ts +0 -10
- package/pkg/commands/decr.test.ts +0 -22
- package/pkg/commands/decr.ts +0 -10
- package/pkg/commands/decrby.test.ts +0 -23
- package/pkg/commands/decrby.ts +0 -10
- package/pkg/commands/del.test.ts +0 -38
- package/pkg/commands/del.ts +0 -11
- package/pkg/commands/echo.test.ts +0 -11
- package/pkg/commands/echo.ts +0 -10
- package/pkg/commands/exists.test.ts +0 -37
- package/pkg/commands/exists.ts +0 -11
- package/pkg/commands/expire.test.ts +0 -22
- package/pkg/commands/expire.ts +0 -10
- package/pkg/commands/expireat.test.ts +0 -24
- package/pkg/commands/expireat.ts +0 -10
- package/pkg/commands/flushall.test.ts +0 -17
- package/pkg/commands/flushall.ts +0 -13
- package/pkg/commands/flushdb.test.ts +0 -17
- package/pkg/commands/flushdb.ts +0 -13
- package/pkg/commands/get.test.ts +0 -34
- package/pkg/commands/get.ts +0 -10
- package/pkg/commands/getbit.test.ts +0 -16
- package/pkg/commands/getbit.ts +0 -10
- package/pkg/commands/getrange.test.ts +0 -25
- package/pkg/commands/getrange.ts +0 -10
- package/pkg/commands/getset.test.ts +0 -33
- package/pkg/commands/getset.ts +0 -10
- package/pkg/commands/hdel.test.ts +0 -30
- package/pkg/commands/hdel.ts +0 -10
- package/pkg/commands/hexists.test.ts +0 -31
- package/pkg/commands/hexists.ts +0 -10
- package/pkg/commands/hget.test.ts +0 -47
- package/pkg/commands/hget.ts +0 -10
- package/pkg/commands/hgetall.test.ts +0 -32
- package/pkg/commands/hgetall.ts +0 -35
- package/pkg/commands/hincrby.test.ts +0 -27
- package/pkg/commands/hincrby.ts +0 -10
- package/pkg/commands/hincrbyfloat.test.ts +0 -25
- package/pkg/commands/hincrbyfloat.ts +0 -10
- package/pkg/commands/hkeys.test.ts +0 -22
- package/pkg/commands/hkeys.ts +0 -10
- package/pkg/commands/hlen.test.ts +0 -24
- package/pkg/commands/hlen.ts +0 -10
- package/pkg/commands/hmget.test.ts +0 -48
- package/pkg/commands/hmget.ts +0 -41
- package/pkg/commands/hmset.test.ts +0 -24
- package/pkg/commands/hmset.ts +0 -10
- package/pkg/commands/hscan.test.ts +0 -46
- package/pkg/commands/hscan.ts +0 -22
- package/pkg/commands/hset.test.ts +0 -21
- package/pkg/commands/hset.ts +0 -10
- package/pkg/commands/hsetnx.test.ts +0 -37
- package/pkg/commands/hsetnx.ts +0 -10
- package/pkg/commands/hstrlen.test.ts +0 -24
- package/pkg/commands/hstrlen.ts +0 -10
- package/pkg/commands/hvals.test.ts +0 -23
- package/pkg/commands/hvals.ts +0 -10
- package/pkg/commands/incr.test.ts +0 -23
- package/pkg/commands/incr.ts +0 -10
- package/pkg/commands/incrby.test.ts +0 -23
- package/pkg/commands/incrby.ts +0 -10
- package/pkg/commands/incrbyfloat.test.ts +0 -24
- package/pkg/commands/incrbyfloat.ts +0 -10
- package/pkg/commands/index.ts +0 -107
- package/pkg/commands/keys.test.ts +0 -17
- package/pkg/commands/keys.ts +0 -10
- package/pkg/commands/lindex.test.ts +0 -33
- package/pkg/commands/lindex.ts +0 -7
- package/pkg/commands/linsert.test.ts +0 -19
- package/pkg/commands/linsert.ts +0 -6
- package/pkg/commands/llen.test.ts +0 -26
- package/pkg/commands/llen.ts +0 -10
- package/pkg/commands/lpop.test.ts +0 -27
- package/pkg/commands/lpop.ts +0 -10
- package/pkg/commands/lpush.test.ts +0 -17
- package/pkg/commands/lpush.ts +0 -11
- package/pkg/commands/lpushx.test.ts +0 -29
- package/pkg/commands/lpushx.ts +0 -11
- package/pkg/commands/lrange.test.ts +0 -22
- package/pkg/commands/lrange.ts +0 -7
- package/pkg/commands/lrem.test.ts +0 -19
- package/pkg/commands/lrem.ts +0 -6
- package/pkg/commands/lset.test.ts +0 -40
- package/pkg/commands/lset.ts +0 -7
- package/pkg/commands/ltrim.test.ts +0 -29
- package/pkg/commands/ltrim.ts +0 -7
- package/pkg/commands/mget.test.ts +0 -44
- package/pkg/commands/mget.ts +0 -9
- package/pkg/commands/mset.test.ts +0 -24
- package/pkg/commands/mset.ts +0 -10
- package/pkg/commands/msetnx.test.ts +0 -46
- package/pkg/commands/msetnx.ts +0 -10
- package/pkg/commands/persist.test.ts +0 -22
- package/pkg/commands/persist.ts +0 -10
- package/pkg/commands/pexpire.test.ts +0 -24
- package/pkg/commands/pexpire.ts +0 -10
- package/pkg/commands/pexpireat.test.ts +0 -24
- package/pkg/commands/pexpireat.ts +0 -10
- package/pkg/commands/ping.test.ts +0 -19
- package/pkg/commands/ping.ts +0 -13
- package/pkg/commands/psetex.test.ts +0 -23
- package/pkg/commands/psetex.ts +0 -10
- package/pkg/commands/pttl.test.ts +0 -17
- package/pkg/commands/pttl.ts +0 -10
- package/pkg/commands/randomkey.test.ts +0 -17
- package/pkg/commands/randomkey.ts +0 -10
- package/pkg/commands/rename.test.ts +0 -18
- package/pkg/commands/rename.ts +0 -10
- package/pkg/commands/renamenx.test.ts +0 -32
- package/pkg/commands/renamenx.ts +0 -10
- package/pkg/commands/rpop.test.ts +0 -27
- package/pkg/commands/rpop.ts +0 -10
- package/pkg/commands/rpush.test.ts +0 -17
- package/pkg/commands/rpush.ts +0 -11
- package/pkg/commands/rpushx.test.ts +0 -29
- package/pkg/commands/rpushx.ts +0 -11
- package/pkg/commands/sadd.test.ts +0 -16
- package/pkg/commands/sadd.ts +0 -11
- package/pkg/commands/scan.test.ts +0 -50
- package/pkg/commands/scan.ts +0 -21
- package/pkg/commands/scard.test.ts +0 -15
- package/pkg/commands/scard.ts +0 -9
- package/pkg/commands/sdiff.test.ts +0 -20
- package/pkg/commands/sdiff.ts +0 -9
- package/pkg/commands/sdiffstore.test.ts +0 -21
- package/pkg/commands/sdiffstore.ts +0 -10
- package/pkg/commands/set.test.ts +0 -112
- package/pkg/commands/set.ts +0 -53
- package/pkg/commands/setbit.test.ts +0 -16
- package/pkg/commands/setbit.ts +0 -10
- package/pkg/commands/setex.test.ts +0 -22
- package/pkg/commands/setex.ts +0 -10
- package/pkg/commands/setnx.test.ts +0 -27
- package/pkg/commands/setnx.ts +0 -10
- package/pkg/commands/setrange.test.ts +0 -25
- package/pkg/commands/setrange.ts +0 -10
- package/pkg/commands/sinter.test.ts +0 -36
- package/pkg/commands/sinter.ts +0 -9
- package/pkg/commands/sinterstore.test.ts +0 -21
- package/pkg/commands/sinterstore.ts +0 -9
- package/pkg/commands/sismember.test.ts +0 -30
- package/pkg/commands/sismember.ts +0 -9
- package/pkg/commands/smembers.test.ts +0 -22
- package/pkg/commands/smembers.ts +0 -10
- package/pkg/commands/smove.test.ts +0 -18
- package/pkg/commands/smove.ts +0 -9
- package/pkg/commands/spop.test.ts +0 -35
- package/pkg/commands/spop.ts +0 -13
- package/pkg/commands/srandmember.test.ts +0 -32
- package/pkg/commands/srandmember.ts +0 -13
- package/pkg/commands/srem.test.ts +0 -18
- package/pkg/commands/srem.ts +0 -10
- package/pkg/commands/sscan.test.ts +0 -50
- package/pkg/commands/sscan.ts +0 -22
- package/pkg/commands/strlen.test.ts +0 -16
- package/pkg/commands/strlen.ts +0 -10
- package/pkg/commands/sunion.test.ts +0 -22
- package/pkg/commands/sunion.ts +0 -10
- package/pkg/commands/sunionstore.test.ts +0 -29
- package/pkg/commands/sunionstore.ts +0 -10
- package/pkg/commands/time.test.ts +0 -11
- package/pkg/commands/time.ts +0 -9
- package/pkg/commands/touch.test.ts +0 -20
- package/pkg/commands/touch.ts +0 -10
- package/pkg/commands/ttl.test.ts +0 -17
- package/pkg/commands/ttl.ts +0 -10
- package/pkg/commands/type.test.ts +0 -72
- package/pkg/commands/type.ts +0 -11
- package/pkg/commands/unlink.test.ts +0 -21
- package/pkg/commands/unlink.ts +0 -10
- package/pkg/commands/zadd.test.ts +0 -177
- package/pkg/commands/zadd.ts +0 -64
- package/pkg/commands/zcard.test.ts +0 -15
- package/pkg/commands/zcard.ts +0 -10
- package/pkg/commands/zcount.test.ts +0 -15
- package/pkg/commands/zcount.ts +0 -9
- package/pkg/commands/zincrby.test.ts +0 -20
- package/pkg/commands/zincrby.ts +0 -9
- package/pkg/commands/zinterstore.test.ts +0 -239
- package/pkg/commands/zinterstore.ts +0 -55
- package/pkg/commands/zlexcount.test.ts +0 -22
- package/pkg/commands/zlexcount.ts +0 -9
- package/pkg/commands/zpopmax.test.ts +0 -45
- package/pkg/commands/zpopmax.ts +0 -13
- package/pkg/commands/zpopmin.test.ts +0 -49
- package/pkg/commands/zpopmin.ts +0 -13
- package/pkg/commands/zrange.test.ts +0 -52
- package/pkg/commands/zrange.ts +0 -22
- package/pkg/commands/zrank.test.ts +0 -22
- package/pkg/commands/zrank.ts +0 -10
- package/pkg/commands/zrem.test.ts +0 -20
- package/pkg/commands/zrem.ts +0 -10
- package/pkg/commands/zremrangebylex.test.ts +0 -26
- package/pkg/commands/zremrangebylex.ts +0 -9
- package/pkg/commands/zremrangebyrank.test.ts +0 -27
- package/pkg/commands/zremrangebyrank.ts +0 -9
- package/pkg/commands/zremrangebyscore.test.ts +0 -24
- package/pkg/commands/zremrangebyscore.ts +0 -9
- package/pkg/commands/zrevrank.test.ts +0 -22
- package/pkg/commands/zrevrank.ts +0 -10
- package/pkg/commands/zscan.test.ts +0 -50
- package/pkg/commands/zscan.ts +0 -22
- package/pkg/commands/zscore.test.ts +0 -18
- package/pkg/commands/zscore.ts +0 -10
- package/pkg/commands/zunionstore.test.ts +0 -215
- package/pkg/commands/zunionstore.ts +0 -55
- package/pkg/commands/zz.ts +0 -1
- package/pkg/error.ts +0 -9
- package/pkg/fastly.ts +0 -54
- package/pkg/http.test.ts +0 -34
- package/pkg/http.ts +0 -62
- package/pkg/index.ts +0 -2
- package/pkg/nodejs.ts +0 -83
- package/pkg/pipeline.test.ts +0 -177
- package/pkg/pipeline.ts +0 -999
- package/pkg/redis.ts +0 -930
- package/pkg/test-utils.ts +0 -41
- package/pkg/types.ts +0 -4
- package/pkg/util.ts +0 -22
- package/pnpm-lock.yaml +0 -3940
- package/tsconfig.json +0 -100
- package/tsconfig.module.json +0 -8
- package/tsup.config.ts +0 -16
package/pkg/redis.ts
DELETED
|
@@ -1,930 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from "./http"
|
|
2
|
-
import type { CommandArgs, NonEmptyArray } from "./types"
|
|
3
|
-
import {
|
|
4
|
-
AppendCommand,
|
|
5
|
-
BitCountCommand,
|
|
6
|
-
BitOpCommand,
|
|
7
|
-
BitPosCommand,
|
|
8
|
-
DBSizeCommand,
|
|
9
|
-
DecrByCommand,
|
|
10
|
-
DecrCommand,
|
|
11
|
-
DelCommand,
|
|
12
|
-
EchoCommand,
|
|
13
|
-
ExistsCommand,
|
|
14
|
-
ExpireAtCommand,
|
|
15
|
-
ExpireCommand,
|
|
16
|
-
FlushAllCommand,
|
|
17
|
-
FlushDBCommand,
|
|
18
|
-
GetBitCommand,
|
|
19
|
-
GetCommand,
|
|
20
|
-
GetRangeCommand,
|
|
21
|
-
GetSetCommand,
|
|
22
|
-
HDelCommand,
|
|
23
|
-
HExistsCommand,
|
|
24
|
-
HGetAllCommand,
|
|
25
|
-
HGetCommand,
|
|
26
|
-
HIncrByCommand,
|
|
27
|
-
HIncrByFloatCommand,
|
|
28
|
-
HKeysCommand,
|
|
29
|
-
HLenCommand,
|
|
30
|
-
HMGetCommand,
|
|
31
|
-
HMSetCommand,
|
|
32
|
-
HScanCommand,
|
|
33
|
-
HSetCommand,
|
|
34
|
-
HSetNXCommand,
|
|
35
|
-
HStrLenCommand,
|
|
36
|
-
HValsCommand,
|
|
37
|
-
IncrByCommand,
|
|
38
|
-
IncrCommand,
|
|
39
|
-
KeysCommand,
|
|
40
|
-
LIndexCommand,
|
|
41
|
-
LInsertCommand,
|
|
42
|
-
LLenCommand,
|
|
43
|
-
LPopCommand,
|
|
44
|
-
LPushCommand,
|
|
45
|
-
LPushXCommand,
|
|
46
|
-
LRangeCommand,
|
|
47
|
-
LRemCommand,
|
|
48
|
-
LSetCommand,
|
|
49
|
-
LTrimCommand,
|
|
50
|
-
MGetCommand,
|
|
51
|
-
MSetCommand,
|
|
52
|
-
MSetNXCommand,
|
|
53
|
-
PersistCommand,
|
|
54
|
-
PExpireAtCommand,
|
|
55
|
-
PExpireCommand,
|
|
56
|
-
PingCommand,
|
|
57
|
-
PSetEXCommand,
|
|
58
|
-
PTtlCommand,
|
|
59
|
-
RandomKeyCommand,
|
|
60
|
-
RenameCommand,
|
|
61
|
-
RenameNXCommand,
|
|
62
|
-
RPopCommand,
|
|
63
|
-
RPushCommand,
|
|
64
|
-
RPushXCommand,
|
|
65
|
-
SAddCommand,
|
|
66
|
-
ScanCommand,
|
|
67
|
-
SCardCommand,
|
|
68
|
-
SDiffCommand,
|
|
69
|
-
SDiffStoreCommand,
|
|
70
|
-
SetBitCommand,
|
|
71
|
-
SetCommand,
|
|
72
|
-
SetExCommand,
|
|
73
|
-
SetNxCommand,
|
|
74
|
-
SetRangeCommand,
|
|
75
|
-
SInterCommand,
|
|
76
|
-
SIsMemberCommand,
|
|
77
|
-
SMembersCommand,
|
|
78
|
-
SMoveCommand,
|
|
79
|
-
SPopCommand,
|
|
80
|
-
SRemCommand,
|
|
81
|
-
SScanCommand,
|
|
82
|
-
StrLenCommand,
|
|
83
|
-
SUnionCommand,
|
|
84
|
-
TimeCommand,
|
|
85
|
-
TouchCommand,
|
|
86
|
-
TtlCommand,
|
|
87
|
-
TypeCommand,
|
|
88
|
-
UnlinkCommand,
|
|
89
|
-
ZAddCommand,
|
|
90
|
-
ZCardCommand,
|
|
91
|
-
ZCountCommand,
|
|
92
|
-
ZIncrByComand,
|
|
93
|
-
ZLexCountCommand,
|
|
94
|
-
ZPopMaxCommand,
|
|
95
|
-
ZPopMinCommand,
|
|
96
|
-
ZRangeCommand,
|
|
97
|
-
ZRankCommand,
|
|
98
|
-
ZRemCommand,
|
|
99
|
-
ZRemRangeByLexCommand,
|
|
100
|
-
ZRemRangeByRankCommand,
|
|
101
|
-
ZRevRankCommand,
|
|
102
|
-
ZScanCommand,
|
|
103
|
-
ZScoreCommand,
|
|
104
|
-
SetCommandOptions,
|
|
105
|
-
ScoreMember,
|
|
106
|
-
ZAddCommandOptions,
|
|
107
|
-
ZAddCommandOptionsWithIncr,
|
|
108
|
-
IncrByFloatCommand,
|
|
109
|
-
SInterStoreCommand,
|
|
110
|
-
SRandMemberCommand,
|
|
111
|
-
SUnionStoreCommand,
|
|
112
|
-
ZInterStoreCommand,
|
|
113
|
-
ZRemRangeByScoreCommand,
|
|
114
|
-
ZUnionStoreCommand,
|
|
115
|
-
} from "./commands"
|
|
116
|
-
import { Pipeline } from "./pipeline"
|
|
117
|
-
/**
|
|
118
|
-
* Serverless redis client for upstash.
|
|
119
|
-
*/
|
|
120
|
-
export class Redis {
|
|
121
|
-
private readonly client: HttpClient
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Create a new redis client
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```typescript
|
|
128
|
-
* const redis = new Redis({
|
|
129
|
-
* url: "<UPSTASH_REDIS_REST_URL>",
|
|
130
|
-
* token: "<UPSTASH_REDIS_REST_TOKEN>",
|
|
131
|
-
* });
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
constructor(client: HttpClient) {
|
|
135
|
-
this.client = client
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Create a new pipeline that allows you to send requests in bulk.
|
|
140
|
-
*
|
|
141
|
-
* @see {@link Pipeline}
|
|
142
|
-
*/
|
|
143
|
-
public pipeline(): Pipeline {
|
|
144
|
-
return new Pipeline(this.client)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* @see https://redis.io/commands/append
|
|
149
|
-
*/
|
|
150
|
-
public append(...args: CommandArgs<typeof AppendCommand>) {
|
|
151
|
-
return new AppendCommand(...args).exec(this.client)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* @see https://redis.io/commands/bitcount
|
|
156
|
-
*/
|
|
157
|
-
public bitcount(...args: CommandArgs<typeof BitCountCommand>) {
|
|
158
|
-
return new BitCountCommand(...args).exec(this.client)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* @see https://redis.io/commands/bitop
|
|
163
|
-
*/
|
|
164
|
-
public bitop(
|
|
165
|
-
op: "and" | "or" | "xor",
|
|
166
|
-
destinationKey: string,
|
|
167
|
-
sourceKey: string,
|
|
168
|
-
...sourceKeys: string[]
|
|
169
|
-
): Promise<number>
|
|
170
|
-
// eslint-disable-next-line no-dupe-class-members,@typescript-eslint/no-unused-vars
|
|
171
|
-
public bitop(op: "not", destinationKey: string, sourceKey: string): Promise<number>
|
|
172
|
-
|
|
173
|
-
// eslint-disable-next-line no-dupe-class-members,@typescript-eslint/no-unused-vars
|
|
174
|
-
public bitop(
|
|
175
|
-
op: "and" | "or" | "xor" | "not",
|
|
176
|
-
destinationKey: string,
|
|
177
|
-
sourceKey: string,
|
|
178
|
-
...sourceKeys: string[]
|
|
179
|
-
) {
|
|
180
|
-
return new BitOpCommand(op as any, destinationKey, sourceKey, ...sourceKeys).exec(this.client)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* @see https://redis.io/commands/bitpos
|
|
185
|
-
*/
|
|
186
|
-
public bitpos(...args: CommandArgs<typeof BitPosCommand>) {
|
|
187
|
-
return new BitPosCommand(...args).exec(this.client)
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @see https://redis.io/commands/dbsize
|
|
192
|
-
*/
|
|
193
|
-
public dbsize() {
|
|
194
|
-
return new DBSizeCommand().exec(this.client)
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @see https://redis.io/commands/decr
|
|
199
|
-
*/
|
|
200
|
-
public decr(...args: CommandArgs<typeof DecrCommand>) {
|
|
201
|
-
return new DecrCommand(...args).exec(this.client)
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @see https://redis.io/commands/decrby
|
|
206
|
-
*/
|
|
207
|
-
public decrby(...args: CommandArgs<typeof DecrByCommand>) {
|
|
208
|
-
return new DecrByCommand(...args).exec(this.client)
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @see https://redis.io/commands/del
|
|
213
|
-
*/
|
|
214
|
-
public del(...args: CommandArgs<typeof DelCommand>) {
|
|
215
|
-
return new DelCommand(...args).exec(this.client)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @see https://redis.io/commands/echo
|
|
220
|
-
*/
|
|
221
|
-
public echo(...args: CommandArgs<typeof EchoCommand>) {
|
|
222
|
-
return new EchoCommand(...args).exec(this.client)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @see https://redis.io/commands/exists
|
|
227
|
-
*/
|
|
228
|
-
public exists(...args: CommandArgs<typeof ExistsCommand>) {
|
|
229
|
-
return new ExistsCommand(...args).exec(this.client)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @see https://redis.io/commands/expire
|
|
234
|
-
*/
|
|
235
|
-
public expire(...args: CommandArgs<typeof ExpireCommand>) {
|
|
236
|
-
return new ExpireCommand(...args).exec(this.client)
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* @see https://redis.io/commands/expireat
|
|
241
|
-
*/
|
|
242
|
-
public expireat(...args: CommandArgs<typeof ExpireAtCommand>) {
|
|
243
|
-
return new ExpireAtCommand(...args).exec(this.client)
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* @see https://redis.io/commands/flushall
|
|
248
|
-
*/
|
|
249
|
-
public flushall(...args: CommandArgs<typeof FlushAllCommand>) {
|
|
250
|
-
return new FlushAllCommand(...args).exec(this.client)
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* @see https://redis.io/commands/flushdb
|
|
255
|
-
*/
|
|
256
|
-
public flushdb(...args: CommandArgs<typeof FlushDBCommand>) {
|
|
257
|
-
return new FlushDBCommand(...args).exec(this.client)
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* @see https://redis.io/commands/get
|
|
262
|
-
*/
|
|
263
|
-
public get<TData>(...args: CommandArgs<typeof GetCommand>) {
|
|
264
|
-
return new GetCommand<TData>(...args).exec(this.client)
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* @see https://redis.io/commands/getbit
|
|
269
|
-
*/
|
|
270
|
-
public getbit(...args: CommandArgs<typeof GetBitCommand>) {
|
|
271
|
-
return new GetBitCommand(...args).exec(this.client)
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* @see https://redis.io/commands/getrange
|
|
276
|
-
*/
|
|
277
|
-
public getrange(...args: CommandArgs<typeof GetRangeCommand>) {
|
|
278
|
-
return new GetRangeCommand(...args).exec(this.client)
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* @see https://redis.io/commands/getset
|
|
283
|
-
*/
|
|
284
|
-
public getset<TData>(key: string, value: TData) {
|
|
285
|
-
return new GetSetCommand<TData>(key, value).exec(this.client)
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @see https://redis.io/commands/hdel
|
|
290
|
-
*/
|
|
291
|
-
public hdel(...args: CommandArgs<typeof HDelCommand>) {
|
|
292
|
-
return new HDelCommand(...args).exec(this.client)
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* @see https://redis.io/commands/hexists
|
|
297
|
-
*/
|
|
298
|
-
public hexists(...args: CommandArgs<typeof HExistsCommand>) {
|
|
299
|
-
return new HExistsCommand(...args).exec(this.client)
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* @see https://redis.io/commands/hget
|
|
304
|
-
*/
|
|
305
|
-
public hget<TData>(...args: CommandArgs<typeof HGetCommand>) {
|
|
306
|
-
return new HGetCommand<TData>(...args).exec(this.client)
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* @see https://redis.io/commands/hgetall
|
|
311
|
-
*/
|
|
312
|
-
public hgetall<TData extends Record<string, unknown>>(
|
|
313
|
-
...args: CommandArgs<typeof HGetAllCommand>
|
|
314
|
-
) {
|
|
315
|
-
return new HGetAllCommand<TData>(...args).exec(this.client)
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* @see https://redis.io/commands/hincrby
|
|
320
|
-
*/
|
|
321
|
-
public hincrby(...args: CommandArgs<typeof HIncrByCommand>) {
|
|
322
|
-
return new HIncrByCommand(...args).exec(this.client)
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* @see https://redis.io/commands/hincrbyfloat
|
|
327
|
-
*/
|
|
328
|
-
public hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>) {
|
|
329
|
-
return new HIncrByFloatCommand(...args).exec(this.client)
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @see https://redis.io/commands/hkeys
|
|
334
|
-
*/
|
|
335
|
-
public hkeys(...args: CommandArgs<typeof HKeysCommand>) {
|
|
336
|
-
return new HKeysCommand(...args).exec(this.client)
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* @see https://redis.io/commands/hlen
|
|
341
|
-
*/
|
|
342
|
-
public hlen(...args: CommandArgs<typeof HLenCommand>) {
|
|
343
|
-
return new HLenCommand(...args).exec(this.client)
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* @see https://redis.io/commands/hmget
|
|
348
|
-
*/
|
|
349
|
-
public hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>) {
|
|
350
|
-
return new HMGetCommand<TData>(...args).exec(this.client)
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* @see https://redis.io/commands/hmset
|
|
355
|
-
*/
|
|
356
|
-
public hmset<TData>(key: string, kv: { [field: string]: TData }) {
|
|
357
|
-
return new HMSetCommand(key, kv).exec(this.client)
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* @see https://redis.io/commands/hscan
|
|
362
|
-
*/
|
|
363
|
-
public hscan(...args: CommandArgs<typeof HScanCommand>) {
|
|
364
|
-
return new HScanCommand(...args).exec(this.client)
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* @see https://redis.io/commands/hset
|
|
369
|
-
*/
|
|
370
|
-
public hset<TData>(key: string, field: string, value: TData) {
|
|
371
|
-
return new HSetCommand<TData>(key, field, value).exec(this.client)
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @see https://redis.io/commands/hsetnx
|
|
376
|
-
*/
|
|
377
|
-
public hsetnx<TData>(key: string, field: string, value: TData) {
|
|
378
|
-
return new HSetNXCommand<TData>(key, field, value).exec(this.client)
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* @see https://redis.io/commands/hstrlen
|
|
383
|
-
*/
|
|
384
|
-
public hstrlen(...args: CommandArgs<typeof HStrLenCommand>) {
|
|
385
|
-
return new HStrLenCommand(...args).exec(this.client)
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* @see https://redis.io/commands/hvals
|
|
390
|
-
*/
|
|
391
|
-
public hvals(...args: CommandArgs<typeof HValsCommand>) {
|
|
392
|
-
return new HValsCommand(...args).exec(this.client)
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* @see https://redis.io/commands/incr
|
|
397
|
-
*/
|
|
398
|
-
public incr(...args: CommandArgs<typeof IncrCommand>) {
|
|
399
|
-
return new IncrCommand(...args).exec(this.client)
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* @see https://redis.io/commands/incrby
|
|
404
|
-
*/
|
|
405
|
-
public incrby(...args: CommandArgs<typeof IncrByCommand>) {
|
|
406
|
-
return new IncrByCommand(...args).exec(this.client)
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* @see https://redis.io/commands/incrbyfloat
|
|
411
|
-
*/
|
|
412
|
-
public incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>) {
|
|
413
|
-
return new IncrByFloatCommand(...args).exec(this.client)
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* @see https://redis.io/commands/keys
|
|
418
|
-
*/
|
|
419
|
-
public keys(...args: CommandArgs<typeof KeysCommand>) {
|
|
420
|
-
return new KeysCommand(...args).exec(this.client)
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* @see https://redis.io/commands/lindex
|
|
425
|
-
*/
|
|
426
|
-
public lindex(...args: CommandArgs<typeof LIndexCommand>) {
|
|
427
|
-
return new LIndexCommand(...args).exec(this.client)
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* @see https://redis.io/commands/linsert
|
|
432
|
-
*/
|
|
433
|
-
public linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) {
|
|
434
|
-
return new LInsertCommand<TData>(key, direction, pivot, value).exec(this.client)
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* @see https://redis.io/commands/llen
|
|
439
|
-
*/
|
|
440
|
-
public llen(...args: CommandArgs<typeof LLenCommand>) {
|
|
441
|
-
return new LLenCommand(...args).exec(this.client)
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* @see https://redis.io/commands/lpop
|
|
446
|
-
*/
|
|
447
|
-
public lpop<TData>(...args: CommandArgs<typeof LPopCommand>) {
|
|
448
|
-
return new LPopCommand<TData>(...args).exec(this.client)
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* @see https://redis.io/commands/lpush
|
|
453
|
-
*/
|
|
454
|
-
public lpush<TData>(key: string, ...elements: NonEmptyArray<TData>) {
|
|
455
|
-
return new LPushCommand<TData>(key, ...elements).exec(this.client)
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* @see https://redis.io/commands/lpushx
|
|
460
|
-
*/
|
|
461
|
-
public lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>) {
|
|
462
|
-
return new LPushXCommand<TData>(key, ...elements).exec(this.client)
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* @see https://redis.io/commands/lrange
|
|
467
|
-
*/
|
|
468
|
-
public lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>) {
|
|
469
|
-
return new LRangeCommand<TResult>(...args).exec(this.client)
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* @see https://redis.io/commands/lrem
|
|
474
|
-
*/
|
|
475
|
-
public lrem<TData>(key: string, count: number, value: TData) {
|
|
476
|
-
return new LRemCommand(key, count, value).exec(this.client)
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* @see https://redis.io/commands/lset
|
|
481
|
-
*/
|
|
482
|
-
public lset<TData>(key: string, value: TData, index: number) {
|
|
483
|
-
return new LSetCommand(key, value, index).exec(this.client)
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* @see https://redis.io/commands/ltrim
|
|
488
|
-
*/
|
|
489
|
-
public ltrim(...args: CommandArgs<typeof LTrimCommand>) {
|
|
490
|
-
return new LTrimCommand(...args).exec(this.client)
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* @see https://redis.io/commands/mget
|
|
495
|
-
*/
|
|
496
|
-
public mget<TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) {
|
|
497
|
-
return new MGetCommand<TData>(...args).exec(this.client)
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* @see https://redis.io/commands/mset
|
|
502
|
-
*/
|
|
503
|
-
public mset<TData>(kv: { [key: string]: TData }) {
|
|
504
|
-
return new MSetCommand<TData>(kv).exec(this.client)
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* @see https://redis.io/commands/msetnx
|
|
509
|
-
*/
|
|
510
|
-
public msetnx<TData>(kv: { [key: string]: TData }) {
|
|
511
|
-
return new MSetNXCommand<TData>(kv).exec(this.client)
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* @see https://redis.io/commands/persist
|
|
516
|
-
*/
|
|
517
|
-
public persist(...args: CommandArgs<typeof PersistCommand>) {
|
|
518
|
-
return new PersistCommand(...args).exec(this.client)
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* @see https://redis.io/commands/pexpire
|
|
523
|
-
*/
|
|
524
|
-
public pexpire(...args: CommandArgs<typeof PExpireCommand>) {
|
|
525
|
-
return new PExpireCommand(...args).exec(this.client)
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* @see https://redis.io/commands/pexpireat
|
|
530
|
-
*/
|
|
531
|
-
public pexpireat(...args: CommandArgs<typeof PExpireAtCommand>) {
|
|
532
|
-
return new PExpireAtCommand(...args).exec(this.client)
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* @see https://redis.io/commands/ping
|
|
537
|
-
*/
|
|
538
|
-
public ping(...args: CommandArgs<typeof PingCommand>) {
|
|
539
|
-
return new PingCommand(...args).exec(this.client)
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* @see https://redis.io/commands/psetex
|
|
544
|
-
*/
|
|
545
|
-
public psetex<TData>(key: string, ttl: number, value: TData) {
|
|
546
|
-
return new PSetEXCommand<TData>(key, ttl, value).exec(this.client)
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* @see https://redis.io/commands/pttl
|
|
551
|
-
*/
|
|
552
|
-
public pttl(...args: CommandArgs<typeof PTtlCommand>) {
|
|
553
|
-
return new PTtlCommand(...args).exec(this.client)
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* @see https://redis.io/commands/randomkey
|
|
558
|
-
*/
|
|
559
|
-
public randomkey() {
|
|
560
|
-
return new RandomKeyCommand().exec(this.client)
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* @see https://redis.io/commands/rename
|
|
565
|
-
*/
|
|
566
|
-
public rename(...args: CommandArgs<typeof RenameCommand>) {
|
|
567
|
-
return new RenameCommand(...args).exec(this.client)
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* @see https://redis.io/commands/renamenx
|
|
572
|
-
*/
|
|
573
|
-
public renamenx(...args: CommandArgs<typeof RenameNXCommand>) {
|
|
574
|
-
return new RenameNXCommand(...args).exec(this.client)
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* @see https://redis.io/commands/rpop
|
|
579
|
-
*/
|
|
580
|
-
public rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>) {
|
|
581
|
-
return new RPopCommand<TData>(...args).exec(this.client)
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* @see https://redis.io/commands/rpush
|
|
586
|
-
*/
|
|
587
|
-
public rpush<TData>(key: string, ...elements: NonEmptyArray<TData>) {
|
|
588
|
-
return new RPushCommand(key, ...elements).exec(this.client)
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* @see https://redis.io/commands/rpushx
|
|
593
|
-
*/
|
|
594
|
-
public rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>) {
|
|
595
|
-
return new RPushXCommand(key, ...elements).exec(this.client)
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* @see https://redis.io/commands/sadd
|
|
600
|
-
*/
|
|
601
|
-
public sadd<TData>(key: string, ...members: NonEmptyArray<TData>) {
|
|
602
|
-
return new SAddCommand<TData>(key, ...members).exec(this.client)
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* @see https://redis.io/commands/scan
|
|
607
|
-
*/
|
|
608
|
-
public scan(...args: CommandArgs<typeof ScanCommand>) {
|
|
609
|
-
return new ScanCommand(...args).exec(this.client)
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* @see https://redis.io/commands/scard
|
|
614
|
-
*/
|
|
615
|
-
public scard(...args: CommandArgs<typeof SCardCommand>) {
|
|
616
|
-
return new SCardCommand(...args).exec(this.client)
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* @see https://redis.io/commands/sdiff
|
|
621
|
-
*/
|
|
622
|
-
public sdiff(...args: CommandArgs<typeof SDiffCommand>) {
|
|
623
|
-
return new SDiffCommand(...args).exec(this.client)
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* @see https://redis.io/commands/sdiffstore
|
|
628
|
-
*/
|
|
629
|
-
public sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>) {
|
|
630
|
-
return new SDiffStoreCommand(...args).exec(this.client)
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* @see https://redis.io/commands/set
|
|
635
|
-
*/
|
|
636
|
-
public set<TData>(key: string, value: TData, opts?: SetCommandOptions) {
|
|
637
|
-
return new SetCommand<TData>(key, value, opts).exec(this.client)
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* @see https://redis.io/commands/setbit
|
|
642
|
-
*/
|
|
643
|
-
public setbit(...args: CommandArgs<typeof SetBitCommand>) {
|
|
644
|
-
return new SetBitCommand(...args).exec(this.client)
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* @see https://redis.io/commands/setex
|
|
649
|
-
*/
|
|
650
|
-
public setex<TData>(key: string, ttl: number, value: TData) {
|
|
651
|
-
return new SetExCommand<TData>(key, ttl, value).exec(this.client)
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* @see https://redis.io/commands/setnx
|
|
656
|
-
*/
|
|
657
|
-
public setnx<TData>(key: string, value: TData) {
|
|
658
|
-
return new SetNxCommand<TData>(key, value).exec(this.client)
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* @see https://redis.io/commands/setrange
|
|
663
|
-
*/
|
|
664
|
-
public setrange(...args: CommandArgs<typeof SetRangeCommand>) {
|
|
665
|
-
return new SetRangeCommand(...args).exec(this.client)
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* @see https://redis.io/commands/sinter
|
|
670
|
-
*/
|
|
671
|
-
public sinter(...args: CommandArgs<typeof SInterCommand>) {
|
|
672
|
-
return new SInterCommand(...args).exec(this.client)
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* @see https://redis.io/commands/sinterstore
|
|
677
|
-
*/
|
|
678
|
-
public sinterstore(...args: CommandArgs<typeof SInterStoreCommand>) {
|
|
679
|
-
return new SInterStoreCommand(...args).exec(this.client)
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* @see https://redis.io/commands/sismember
|
|
684
|
-
*/
|
|
685
|
-
public sismember<TData>(key: string, member: TData) {
|
|
686
|
-
return new SIsMemberCommand<TData>(key, member).exec(this.client)
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* @see https://redis.io/commands/smembers
|
|
691
|
-
*/
|
|
692
|
-
public smembers(...args: CommandArgs<typeof SMembersCommand>) {
|
|
693
|
-
return new SMembersCommand(...args).exec(this.client)
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* @see https://redis.io/commands/smove
|
|
698
|
-
*/
|
|
699
|
-
public smove<TData>(source: string, destination: string, member: TData) {
|
|
700
|
-
return new SMoveCommand<TData>(source, destination, member).exec(this.client)
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* @see https://redis.io/commands/spop
|
|
705
|
-
*/
|
|
706
|
-
public spop<TData>(...args: CommandArgs<typeof SPopCommand>) {
|
|
707
|
-
return new SPopCommand<TData>(...args).exec(this.client)
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* @see https://redis.io/commands/srandmember
|
|
712
|
-
*/
|
|
713
|
-
public srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>) {
|
|
714
|
-
return new SRandMemberCommand<TData>(...args).exec(this.client)
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* @see https://redis.io/commands/srem
|
|
719
|
-
*/
|
|
720
|
-
public srem<TData>(key: string, ...members: NonEmptyArray<TData>) {
|
|
721
|
-
return new SRemCommand<TData>(key, ...members).exec(this.client)
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* @see https://redis.io/commands/sscan
|
|
726
|
-
*/
|
|
727
|
-
public sscan(...args: CommandArgs<typeof SScanCommand>) {
|
|
728
|
-
return new SScanCommand(...args).exec(this.client)
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* @see https://redis.io/commands/strlen
|
|
733
|
-
*/
|
|
734
|
-
public strlen(...args: CommandArgs<typeof StrLenCommand>) {
|
|
735
|
-
return new StrLenCommand(...args).exec(this.client)
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* @see https://redis.io/commands/sunion
|
|
740
|
-
*/
|
|
741
|
-
public sunion(...args: CommandArgs<typeof SUnionCommand>) {
|
|
742
|
-
return new SUnionCommand(...args).exec(this.client)
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* @see https://redis.io/commands/sunionstore
|
|
746
|
-
*/
|
|
747
|
-
public sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>) {
|
|
748
|
-
return new SUnionStoreCommand(...args).exec(this.client)
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
/**
|
|
752
|
-
* @see https://redis.io/commands/time
|
|
753
|
-
*/
|
|
754
|
-
public time() {
|
|
755
|
-
return new TimeCommand().exec(this.client)
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* @see https://redis.io/commands/touch
|
|
760
|
-
*/
|
|
761
|
-
public touch(...args: CommandArgs<typeof TouchCommand>) {
|
|
762
|
-
return new TouchCommand(...args).exec(this.client)
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
/**
|
|
766
|
-
* @see https://redis.io/commands/ttl
|
|
767
|
-
*/
|
|
768
|
-
public ttl(...args: CommandArgs<typeof TtlCommand>) {
|
|
769
|
-
return new TtlCommand(...args).exec(this.client)
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* @see https://redis.io/commands/type
|
|
774
|
-
*/
|
|
775
|
-
public type(...args: CommandArgs<typeof TypeCommand>) {
|
|
776
|
-
return new TypeCommand(...args).exec(this.client)
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
/**
|
|
780
|
-
* @see https://redis.io/commands/unlink
|
|
781
|
-
*/
|
|
782
|
-
public unlink(...args: CommandArgs<typeof UnlinkCommand>) {
|
|
783
|
-
return new UnlinkCommand(...args).exec(this.client)
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
/**
|
|
787
|
-
* @see https://redis.io/commands/zadd
|
|
788
|
-
*/
|
|
789
|
-
// eslint-disable-next-line no-dupe-class-members,@typescript-eslint/no-unused-vars
|
|
790
|
-
public zadd<TData>(
|
|
791
|
-
key: string,
|
|
792
|
-
scoreMember: ScoreMember<TData>,
|
|
793
|
-
...scoreMemberPairs: ScoreMember<TData>[]
|
|
794
|
-
): Promise<number | null>
|
|
795
|
-
// eslint-disable-next-line no-dupe-class-members,@typescript-eslint/no-unused-vars
|
|
796
|
-
public zadd<TData>(
|
|
797
|
-
key: string,
|
|
798
|
-
opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr,
|
|
799
|
-
...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
|
|
800
|
-
): Promise<number | null>
|
|
801
|
-
// eslint-disable-next-line no-dupe-class-members
|
|
802
|
-
public zadd<TData>(
|
|
803
|
-
key: string,
|
|
804
|
-
arg1: ScoreMember<TData> | ZAddCommandOptions | ZAddCommandOptionsWithIncr,
|
|
805
|
-
...arg2: ScoreMember<TData>[]
|
|
806
|
-
) {
|
|
807
|
-
if ("score" in arg1) {
|
|
808
|
-
return new ZAddCommand<TData>(key, arg1 as ScoreMember<TData>, ...arg2).exec(this.client)
|
|
809
|
-
}
|
|
810
|
-
return new ZAddCommand<TData>(key, arg1 as any, ...arg2).exec(this.client)
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* @see https://redis.io/commands/zcard
|
|
815
|
-
*/
|
|
816
|
-
public zcard(...args: CommandArgs<typeof ZCardCommand>) {
|
|
817
|
-
return new ZCardCommand(...args).exec(this.client)
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* @see https://redis.io/commands/zcount
|
|
822
|
-
*/
|
|
823
|
-
public zcount(...args: CommandArgs<typeof ZCountCommand>) {
|
|
824
|
-
return new ZCountCommand(...args).exec(this.client)
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* @see https://redis.io/commands/zincrby
|
|
829
|
-
*/
|
|
830
|
-
public zincrby<TData>(key: string, increment: number, member: TData) {
|
|
831
|
-
return new ZIncrByComand<TData>(key, increment, member).exec(this.client)
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* @see https://redis.io/commands/zinterstore
|
|
836
|
-
*/
|
|
837
|
-
public zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>) {
|
|
838
|
-
return new ZInterStoreCommand(...args).exec(this.client)
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
/**
|
|
842
|
-
* @see https://redis.io/commands/zlexcount
|
|
843
|
-
*/
|
|
844
|
-
public zlexcount(...args: CommandArgs<typeof ZLexCountCommand>) {
|
|
845
|
-
return new ZLexCountCommand(...args).exec(this.client)
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* @see https://redis.io/commands/zpopmax
|
|
850
|
-
*/
|
|
851
|
-
public zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>) {
|
|
852
|
-
return new ZPopMaxCommand<TData>(...args).exec(this.client)
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* @see https://redis.io/commands/zpopmin
|
|
857
|
-
*/
|
|
858
|
-
public zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>) {
|
|
859
|
-
return new ZPopMinCommand<TData>(...args).exec(this.client)
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
/**
|
|
863
|
-
* @see https://redis.io/commands/zrange
|
|
864
|
-
*/
|
|
865
|
-
public zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>) {
|
|
866
|
-
return new ZRangeCommand<TData>(...args).exec(this.client)
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
* @see https://redis.io/commands/zrank
|
|
871
|
-
*/
|
|
872
|
-
public zrank<TData>(key: string, member: TData) {
|
|
873
|
-
return new ZRankCommand<TData>(key, member).exec(this.client)
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
/**
|
|
877
|
-
* @see https://redis.io/commands/zrem
|
|
878
|
-
*/
|
|
879
|
-
public zrem<TData>(key: string, ...members: NonEmptyArray<TData>) {
|
|
880
|
-
return new ZRemCommand<TData>(key, ...members).exec(this.client)
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* @see https://redis.io/commands/zremrangebylex
|
|
885
|
-
*/
|
|
886
|
-
public zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>) {
|
|
887
|
-
return new ZRemRangeByLexCommand(...args).exec(this.client)
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* @see https://redis.io/commands/zremrangebyrank
|
|
892
|
-
*/
|
|
893
|
-
public zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>) {
|
|
894
|
-
return new ZRemRangeByRankCommand(...args).exec(this.client)
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* @see https://redis.io/commands/zremrangebyscore
|
|
899
|
-
*/
|
|
900
|
-
public zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>) {
|
|
901
|
-
return new ZRemRangeByScoreCommand(...args).exec(this.client)
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
/**
|
|
905
|
-
* @see https://redis.io/commands/zrevrank
|
|
906
|
-
*/
|
|
907
|
-
public zrevrank<TData>(key: string, member: TData) {
|
|
908
|
-
return new ZRevRankCommand<TData>(key, member).exec(this.client)
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* @see https://redis.io/commands/zscan
|
|
913
|
-
*/
|
|
914
|
-
public zscan(...args: CommandArgs<typeof ZScanCommand>) {
|
|
915
|
-
return new ZScanCommand(...args).exec(this.client)
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* @see https://redis.io/commands/zscore
|
|
920
|
-
*/
|
|
921
|
-
public zscore<TData>(key: string, member: TData) {
|
|
922
|
-
return new ZScoreCommand<TData>(key, member).exec(this.client)
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* @see https://redis.io/commands/zunionstore
|
|
926
|
-
*/
|
|
927
|
-
public zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>) {
|
|
928
|
-
return new ZUnionStoreCommand(...args).exec(this.client)
|
|
929
|
-
}
|
|
930
|
-
}
|