@upstash/redis 1.0.0-alpha.1 → 1.0.0-alpha.2

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