@upstash/redis 0.0.0-ci.ab36634d-20230531 → 0.0.0-ci.ac6f459d7451c0be8ce0234d47abd3cc9da06b3c-20240716111358

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 (500) hide show
  1. package/README.md +17 -5
  2. package/chunk-2HQWX64O.js +1 -0
  3. package/chunk-2PHLPREF.mjs +1 -0
  4. package/cloudflare.d.mts +51 -0
  5. package/cloudflare.d.ts +51 -0
  6. package/cloudflare.js +1 -0
  7. package/cloudflare.mjs +1 -0
  8. package/fastly.d.mts +44 -0
  9. package/fastly.d.ts +44 -0
  10. package/fastly.js +1 -0
  11. package/fastly.mjs +1 -0
  12. package/nodejs.d.mts +87 -0
  13. package/nodejs.d.ts +87 -0
  14. package/nodejs.js +1 -0
  15. package/nodejs.mjs +1 -0
  16. package/package.json +1 -88
  17. package/zmscore-80635339.d.ts +3518 -0
  18. package/.releaserc +0 -14
  19. package/esm/deps/deno.land/x/base64@v0.2.1/base.js +0 -100
  20. package/esm/deps/deno.land/x/base64@v0.2.1/base64url.js +0 -9
  21. package/esm/deps/deno.land/x/sha1@v1.0.3/deps.js +0 -1
  22. package/esm/deps/deno.land/x/sha1@v1.0.3/mod.js +0 -191
  23. package/esm/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +0 -50
  24. package/esm/package.json +0 -3
  25. package/esm/pkg/commands/append.js +0 -9
  26. package/esm/pkg/commands/bitcount.js +0 -16
  27. package/esm/pkg/commands/bitop.js +0 -9
  28. package/esm/pkg/commands/bitpos.js +0 -9
  29. package/esm/pkg/commands/command.js +0 -66
  30. package/esm/pkg/commands/dbsize.js +0 -9
  31. package/esm/pkg/commands/decr.js +0 -9
  32. package/esm/pkg/commands/decrby.js +0 -9
  33. package/esm/pkg/commands/del.js +0 -9
  34. package/esm/pkg/commands/echo.js +0 -9
  35. package/esm/pkg/commands/eval.js +0 -9
  36. package/esm/pkg/commands/evalsha.js +0 -9
  37. package/esm/pkg/commands/exists.js +0 -9
  38. package/esm/pkg/commands/expire.js +0 -9
  39. package/esm/pkg/commands/expireat.js +0 -9
  40. package/esm/pkg/commands/flushall.js +0 -13
  41. package/esm/pkg/commands/flushdb.js +0 -13
  42. package/esm/pkg/commands/get.js +0 -9
  43. package/esm/pkg/commands/getbit.js +0 -9
  44. package/esm/pkg/commands/getdel.js +0 -9
  45. package/esm/pkg/commands/getrange.js +0 -9
  46. package/esm/pkg/commands/getset.js +0 -9
  47. package/esm/pkg/commands/hdel.js +0 -9
  48. package/esm/pkg/commands/hexists.js +0 -9
  49. package/esm/pkg/commands/hget.js +0 -9
  50. package/esm/pkg/commands/hgetall.js +0 -29
  51. package/esm/pkg/commands/hincrby.js +0 -9
  52. package/esm/pkg/commands/hincrbyfloat.js +0 -9
  53. package/esm/pkg/commands/hkeys.js +0 -9
  54. package/esm/pkg/commands/hlen.js +0 -9
  55. package/esm/pkg/commands/hmget.js +0 -35
  56. package/esm/pkg/commands/hmset.js +0 -13
  57. package/esm/pkg/commands/hrandfield.js +0 -39
  58. package/esm/pkg/commands/hscan.js +0 -16
  59. package/esm/pkg/commands/hset.js +0 -13
  60. package/esm/pkg/commands/hsetnx.js +0 -9
  61. package/esm/pkg/commands/hstrlen.js +0 -9
  62. package/esm/pkg/commands/hvals.js +0 -9
  63. package/esm/pkg/commands/incr.js +0 -9
  64. package/esm/pkg/commands/incrby.js +0 -9
  65. package/esm/pkg/commands/incrbyfloat.js +0 -9
  66. package/esm/pkg/commands/json_arrappend.js +0 -9
  67. package/esm/pkg/commands/json_arrindex.js +0 -9
  68. package/esm/pkg/commands/json_arrinsert.js +0 -9
  69. package/esm/pkg/commands/json_arrlen.js +0 -9
  70. package/esm/pkg/commands/json_arrpop.js +0 -9
  71. package/esm/pkg/commands/json_arrtrim.js +0 -12
  72. package/esm/pkg/commands/json_clear.js +0 -9
  73. package/esm/pkg/commands/json_del.js +0 -9
  74. package/esm/pkg/commands/json_forget.js +0 -9
  75. package/esm/pkg/commands/json_get.js +0 -30
  76. package/esm/pkg/commands/json_mget.js +0 -9
  77. package/esm/pkg/commands/json_numincrby.js +0 -9
  78. package/esm/pkg/commands/json_nummultby.js +0 -9
  79. package/esm/pkg/commands/json_objkeys.js +0 -9
  80. package/esm/pkg/commands/json_objlen.js +0 -9
  81. package/esm/pkg/commands/json_resp.js +0 -9
  82. package/esm/pkg/commands/json_set.js +0 -18
  83. package/esm/pkg/commands/json_strappend.js +0 -9
  84. package/esm/pkg/commands/json_strlen.js +0 -9
  85. package/esm/pkg/commands/json_toggle.js +0 -9
  86. package/esm/pkg/commands/json_type.js +0 -9
  87. package/esm/pkg/commands/keys.js +0 -9
  88. package/esm/pkg/commands/lindex.js +0 -6
  89. package/esm/pkg/commands/linsert.js +0 -6
  90. package/esm/pkg/commands/llen.js +0 -9
  91. package/esm/pkg/commands/lmove.js +0 -9
  92. package/esm/pkg/commands/lpop.js +0 -9
  93. package/esm/pkg/commands/lpos.js +0 -19
  94. package/esm/pkg/commands/lpush.js +0 -9
  95. package/esm/pkg/commands/lpushx.js +0 -9
  96. package/esm/pkg/commands/lrange.js +0 -6
  97. package/esm/pkg/commands/lrem.js +0 -6
  98. package/esm/pkg/commands/lset.js +0 -6
  99. package/esm/pkg/commands/ltrim.js +0 -6
  100. package/esm/pkg/commands/mget.js +0 -9
  101. package/esm/pkg/commands/mod.js +0 -140
  102. package/esm/pkg/commands/mset.js +0 -12
  103. package/esm/pkg/commands/msetnx.js +0 -9
  104. package/esm/pkg/commands/persist.js +0 -9
  105. package/esm/pkg/commands/pexpire.js +0 -9
  106. package/esm/pkg/commands/pexpireat.js +0 -9
  107. package/esm/pkg/commands/ping.js +0 -13
  108. package/esm/pkg/commands/psetex.js +0 -9
  109. package/esm/pkg/commands/pttl.js +0 -9
  110. package/esm/pkg/commands/publish.js +0 -9
  111. package/esm/pkg/commands/randomkey.js +0 -9
  112. package/esm/pkg/commands/rename.js +0 -9
  113. package/esm/pkg/commands/renamenx.js +0 -9
  114. package/esm/pkg/commands/rpop.js +0 -9
  115. package/esm/pkg/commands/rpush.js +0 -9
  116. package/esm/pkg/commands/rpushx.js +0 -9
  117. package/esm/pkg/commands/sadd.js +0 -9
  118. package/esm/pkg/commands/scan.js +0 -19
  119. package/esm/pkg/commands/scard.js +0 -9
  120. package/esm/pkg/commands/script_exists.js +0 -12
  121. package/esm/pkg/commands/script_flush.js +0 -16
  122. package/esm/pkg/commands/script_load.js +0 -9
  123. package/esm/pkg/commands/sdiff.js +0 -9
  124. package/esm/pkg/commands/sdiffstore.js +0 -9
  125. package/esm/pkg/commands/set.js +0 -36
  126. package/esm/pkg/commands/setbit.js +0 -9
  127. package/esm/pkg/commands/setex.js +0 -9
  128. package/esm/pkg/commands/setnx.js +0 -9
  129. package/esm/pkg/commands/setrange.js +0 -9
  130. package/esm/pkg/commands/sinter.js +0 -9
  131. package/esm/pkg/commands/sinterstore.js +0 -9
  132. package/esm/pkg/commands/sismember.js +0 -9
  133. package/esm/pkg/commands/smembers.js +0 -9
  134. package/esm/pkg/commands/smismember.js +0 -9
  135. package/esm/pkg/commands/smove.js +0 -9
  136. package/esm/pkg/commands/spop.js +0 -13
  137. package/esm/pkg/commands/srandmember.js +0 -13
  138. package/esm/pkg/commands/srem.js +0 -9
  139. package/esm/pkg/commands/sscan.js +0 -16
  140. package/esm/pkg/commands/strlen.js +0 -9
  141. package/esm/pkg/commands/sunion.js +0 -9
  142. package/esm/pkg/commands/sunionstore.js +0 -9
  143. package/esm/pkg/commands/time.js +0 -9
  144. package/esm/pkg/commands/touch.js +0 -9
  145. package/esm/pkg/commands/ttl.js +0 -9
  146. package/esm/pkg/commands/type.js +0 -9
  147. package/esm/pkg/commands/unlink.js +0 -9
  148. package/esm/pkg/commands/zadd.js +0 -26
  149. package/esm/pkg/commands/zcard.js +0 -9
  150. package/esm/pkg/commands/zcount.js +0 -9
  151. package/esm/pkg/commands/zdiffstore.js +0 -9
  152. package/esm/pkg/commands/zincrby.js +0 -9
  153. package/esm/pkg/commands/zinterstore.js +0 -27
  154. package/esm/pkg/commands/zlexcount.js +0 -9
  155. package/esm/pkg/commands/zmscore.js +0 -10
  156. package/esm/pkg/commands/zpopmax.js +0 -13
  157. package/esm/pkg/commands/zpopmin.js +0 -13
  158. package/esm/pkg/commands/zrange.js +0 -26
  159. package/esm/pkg/commands/zrank.js +0 -9
  160. package/esm/pkg/commands/zrem.js +0 -9
  161. package/esm/pkg/commands/zremrangebylex.js +0 -9
  162. package/esm/pkg/commands/zremrangebyrank.js +0 -9
  163. package/esm/pkg/commands/zremrangebyscore.js +0 -9
  164. package/esm/pkg/commands/zrevrank.js +0 -9
  165. package/esm/pkg/commands/zscan.js +0 -16
  166. package/esm/pkg/commands/zscore.js +0 -9
  167. package/esm/pkg/commands/zunionstore.js +0 -27
  168. package/esm/pkg/error.js +0 -9
  169. package/esm/pkg/http.js +0 -167
  170. package/esm/pkg/pipeline.js +0 -1292
  171. package/esm/pkg/redis.js +0 -1288
  172. package/esm/pkg/script.js +0 -77
  173. package/esm/pkg/types.js +0 -1
  174. package/esm/pkg/util.js +0 -31
  175. package/esm/platforms/cloudflare.js +0 -70
  176. package/esm/platforms/fastly.js +0 -46
  177. package/esm/platforms/node_with_fetch.js +0 -85
  178. package/esm/platforms/nodejs.js +0 -82
  179. package/esm/version.js +0 -1
  180. package/script/deps/deno.land/x/base64@v0.2.1/base.js +0 -104
  181. package/script/deps/deno.land/x/base64@v0.2.1/base64url.js +0 -13
  182. package/script/deps/deno.land/x/sha1@v1.0.3/deps.js +0 -6
  183. package/script/deps/deno.land/x/sha1@v1.0.3/mod.js +0 -196
  184. package/script/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +0 -55
  185. package/script/package.json +0 -3
  186. package/script/pkg/commands/append.js +0 -13
  187. package/script/pkg/commands/bitcount.js +0 -20
  188. package/script/pkg/commands/bitop.js +0 -13
  189. package/script/pkg/commands/bitpos.js +0 -13
  190. package/script/pkg/commands/command.js +0 -70
  191. package/script/pkg/commands/dbsize.js +0 -13
  192. package/script/pkg/commands/decr.js +0 -13
  193. package/script/pkg/commands/decrby.js +0 -13
  194. package/script/pkg/commands/del.js +0 -13
  195. package/script/pkg/commands/echo.js +0 -13
  196. package/script/pkg/commands/eval.js +0 -13
  197. package/script/pkg/commands/evalsha.js +0 -13
  198. package/script/pkg/commands/exists.js +0 -13
  199. package/script/pkg/commands/expire.js +0 -13
  200. package/script/pkg/commands/expireat.js +0 -13
  201. package/script/pkg/commands/flushall.js +0 -17
  202. package/script/pkg/commands/flushdb.js +0 -17
  203. package/script/pkg/commands/get.js +0 -13
  204. package/script/pkg/commands/getbit.js +0 -13
  205. package/script/pkg/commands/getdel.js +0 -13
  206. package/script/pkg/commands/getrange.js +0 -13
  207. package/script/pkg/commands/getset.js +0 -13
  208. package/script/pkg/commands/hdel.js +0 -13
  209. package/script/pkg/commands/hexists.js +0 -13
  210. package/script/pkg/commands/hget.js +0 -13
  211. package/script/pkg/commands/hgetall.js +0 -33
  212. package/script/pkg/commands/hincrby.js +0 -13
  213. package/script/pkg/commands/hincrbyfloat.js +0 -13
  214. package/script/pkg/commands/hkeys.js +0 -13
  215. package/script/pkg/commands/hlen.js +0 -13
  216. package/script/pkg/commands/hmget.js +0 -39
  217. package/script/pkg/commands/hmset.js +0 -17
  218. package/script/pkg/commands/hrandfield.js +0 -43
  219. package/script/pkg/commands/hscan.js +0 -20
  220. package/script/pkg/commands/hset.js +0 -17
  221. package/script/pkg/commands/hsetnx.js +0 -13
  222. package/script/pkg/commands/hstrlen.js +0 -13
  223. package/script/pkg/commands/hvals.js +0 -13
  224. package/script/pkg/commands/incr.js +0 -13
  225. package/script/pkg/commands/incrby.js +0 -13
  226. package/script/pkg/commands/incrbyfloat.js +0 -13
  227. package/script/pkg/commands/json_arrappend.js +0 -13
  228. package/script/pkg/commands/json_arrindex.js +0 -13
  229. package/script/pkg/commands/json_arrinsert.js +0 -13
  230. package/script/pkg/commands/json_arrlen.js +0 -13
  231. package/script/pkg/commands/json_arrpop.js +0 -13
  232. package/script/pkg/commands/json_arrtrim.js +0 -16
  233. package/script/pkg/commands/json_clear.js +0 -13
  234. package/script/pkg/commands/json_del.js +0 -13
  235. package/script/pkg/commands/json_forget.js +0 -13
  236. package/script/pkg/commands/json_get.js +0 -34
  237. package/script/pkg/commands/json_mget.js +0 -13
  238. package/script/pkg/commands/json_numincrby.js +0 -13
  239. package/script/pkg/commands/json_nummultby.js +0 -13
  240. package/script/pkg/commands/json_objkeys.js +0 -13
  241. package/script/pkg/commands/json_objlen.js +0 -13
  242. package/script/pkg/commands/json_resp.js +0 -13
  243. package/script/pkg/commands/json_set.js +0 -22
  244. package/script/pkg/commands/json_strappend.js +0 -13
  245. package/script/pkg/commands/json_strlen.js +0 -13
  246. package/script/pkg/commands/json_toggle.js +0 -13
  247. package/script/pkg/commands/json_type.js +0 -13
  248. package/script/pkg/commands/keys.js +0 -13
  249. package/script/pkg/commands/lindex.js +0 -10
  250. package/script/pkg/commands/linsert.js +0 -10
  251. package/script/pkg/commands/llen.js +0 -13
  252. package/script/pkg/commands/lmove.js +0 -13
  253. package/script/pkg/commands/lpop.js +0 -13
  254. package/script/pkg/commands/lpos.js +0 -23
  255. package/script/pkg/commands/lpush.js +0 -13
  256. package/script/pkg/commands/lpushx.js +0 -13
  257. package/script/pkg/commands/lrange.js +0 -10
  258. package/script/pkg/commands/lrem.js +0 -10
  259. package/script/pkg/commands/lset.js +0 -10
  260. package/script/pkg/commands/ltrim.js +0 -10
  261. package/script/pkg/commands/mget.js +0 -13
  262. package/script/pkg/commands/mod.js +0 -156
  263. package/script/pkg/commands/mset.js +0 -16
  264. package/script/pkg/commands/msetnx.js +0 -13
  265. package/script/pkg/commands/persist.js +0 -13
  266. package/script/pkg/commands/pexpire.js +0 -13
  267. package/script/pkg/commands/pexpireat.js +0 -13
  268. package/script/pkg/commands/ping.js +0 -17
  269. package/script/pkg/commands/psetex.js +0 -13
  270. package/script/pkg/commands/pttl.js +0 -13
  271. package/script/pkg/commands/publish.js +0 -13
  272. package/script/pkg/commands/randomkey.js +0 -13
  273. package/script/pkg/commands/rename.js +0 -13
  274. package/script/pkg/commands/renamenx.js +0 -13
  275. package/script/pkg/commands/rpop.js +0 -13
  276. package/script/pkg/commands/rpush.js +0 -13
  277. package/script/pkg/commands/rpushx.js +0 -13
  278. package/script/pkg/commands/sadd.js +0 -13
  279. package/script/pkg/commands/scan.js +0 -23
  280. package/script/pkg/commands/scard.js +0 -13
  281. package/script/pkg/commands/script_exists.js +0 -16
  282. package/script/pkg/commands/script_flush.js +0 -20
  283. package/script/pkg/commands/script_load.js +0 -13
  284. package/script/pkg/commands/sdiff.js +0 -13
  285. package/script/pkg/commands/sdiffstore.js +0 -13
  286. package/script/pkg/commands/set.js +0 -40
  287. package/script/pkg/commands/setbit.js +0 -13
  288. package/script/pkg/commands/setex.js +0 -13
  289. package/script/pkg/commands/setnx.js +0 -13
  290. package/script/pkg/commands/setrange.js +0 -13
  291. package/script/pkg/commands/sinter.js +0 -13
  292. package/script/pkg/commands/sinterstore.js +0 -13
  293. package/script/pkg/commands/sismember.js +0 -13
  294. package/script/pkg/commands/smembers.js +0 -13
  295. package/script/pkg/commands/smismember.js +0 -13
  296. package/script/pkg/commands/smove.js +0 -13
  297. package/script/pkg/commands/spop.js +0 -17
  298. package/script/pkg/commands/srandmember.js +0 -17
  299. package/script/pkg/commands/srem.js +0 -13
  300. package/script/pkg/commands/sscan.js +0 -20
  301. package/script/pkg/commands/strlen.js +0 -13
  302. package/script/pkg/commands/sunion.js +0 -13
  303. package/script/pkg/commands/sunionstore.js +0 -13
  304. package/script/pkg/commands/time.js +0 -13
  305. package/script/pkg/commands/touch.js +0 -13
  306. package/script/pkg/commands/ttl.js +0 -13
  307. package/script/pkg/commands/type.js +0 -13
  308. package/script/pkg/commands/unlink.js +0 -13
  309. package/script/pkg/commands/zadd.js +0 -30
  310. package/script/pkg/commands/zcard.js +0 -13
  311. package/script/pkg/commands/zcount.js +0 -13
  312. package/script/pkg/commands/zdiffstore.js +0 -13
  313. package/script/pkg/commands/zincrby.js +0 -13
  314. package/script/pkg/commands/zinterstore.js +0 -31
  315. package/script/pkg/commands/zlexcount.js +0 -13
  316. package/script/pkg/commands/zmscore.js +0 -14
  317. package/script/pkg/commands/zpopmax.js +0 -17
  318. package/script/pkg/commands/zpopmin.js +0 -17
  319. package/script/pkg/commands/zrange.js +0 -30
  320. package/script/pkg/commands/zrank.js +0 -13
  321. package/script/pkg/commands/zrem.js +0 -13
  322. package/script/pkg/commands/zremrangebylex.js +0 -13
  323. package/script/pkg/commands/zremrangebyrank.js +0 -13
  324. package/script/pkg/commands/zremrangebyscore.js +0 -13
  325. package/script/pkg/commands/zrevrank.js +0 -13
  326. package/script/pkg/commands/zscan.js +0 -20
  327. package/script/pkg/commands/zscore.js +0 -13
  328. package/script/pkg/commands/zunionstore.js +0 -31
  329. package/script/pkg/error.js +0 -13
  330. package/script/pkg/http.js +0 -171
  331. package/script/pkg/pipeline.js +0 -1296
  332. package/script/pkg/redis.js +0 -1292
  333. package/script/pkg/script.js +0 -81
  334. package/script/pkg/types.js +0 -2
  335. package/script/pkg/util.js +0 -35
  336. package/script/platforms/cloudflare.js +0 -97
  337. package/script/platforms/fastly.js +0 -73
  338. package/script/platforms/node_with_fetch.js +0 -112
  339. package/script/platforms/nodejs.js +0 -109
  340. package/script/version.js +0 -4
  341. package/types/deps/deno.land/x/base64@v0.2.1/base.d.ts +0 -5
  342. package/types/deps/deno.land/x/base64@v0.2.1/base64url.d.ts +0 -1
  343. package/types/deps/deno.land/x/sha1@v1.0.3/deps.d.ts +0 -1
  344. package/types/deps/deno.land/x/sha1@v1.0.3/mod.d.ts +0 -26
  345. package/types/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.d.ts +0 -3
  346. package/types/pkg/commands/append.d.ts +0 -7
  347. package/types/pkg/commands/bitcount.d.ts +0 -8
  348. package/types/pkg/commands/bitop.d.ts +0 -12
  349. package/types/pkg/commands/bitpos.d.ts +0 -7
  350. package/types/pkg/commands/command.d.ts +0 -37
  351. package/types/pkg/commands/dbsize.d.ts +0 -7
  352. package/types/pkg/commands/decr.d.ts +0 -7
  353. package/types/pkg/commands/decrby.d.ts +0 -7
  354. package/types/pkg/commands/del.d.ts +0 -7
  355. package/types/pkg/commands/echo.d.ts +0 -7
  356. package/types/pkg/commands/eval.d.ts +0 -7
  357. package/types/pkg/commands/evalsha.d.ts +0 -7
  358. package/types/pkg/commands/exists.d.ts +0 -7
  359. package/types/pkg/commands/expire.d.ts +0 -7
  360. package/types/pkg/commands/expireat.d.ts +0 -7
  361. package/types/pkg/commands/flushall.d.ts +0 -9
  362. package/types/pkg/commands/flushdb.d.ts +0 -9
  363. package/types/pkg/commands/get.d.ts +0 -7
  364. package/types/pkg/commands/getbit.d.ts +0 -7
  365. package/types/pkg/commands/getdel.d.ts +0 -7
  366. package/types/pkg/commands/getrange.d.ts +0 -7
  367. package/types/pkg/commands/getset.d.ts +0 -7
  368. package/types/pkg/commands/hdel.d.ts +0 -7
  369. package/types/pkg/commands/hexists.d.ts +0 -7
  370. package/types/pkg/commands/hget.d.ts +0 -7
  371. package/types/pkg/commands/hgetall.d.ts +0 -7
  372. package/types/pkg/commands/hincrby.d.ts +0 -7
  373. package/types/pkg/commands/hincrbyfloat.d.ts +0 -7
  374. package/types/pkg/commands/hkeys.d.ts +0 -7
  375. package/types/pkg/commands/hlen.d.ts +0 -7
  376. package/types/pkg/commands/hmget.d.ts +0 -15
  377. package/types/pkg/commands/hmset.d.ts +0 -9
  378. package/types/pkg/commands/hrandfield.d.ts +0 -9
  379. package/types/pkg/commands/hscan.d.ts +0 -24
  380. package/types/pkg/commands/hset.d.ts +0 -9
  381. package/types/pkg/commands/hsetnx.d.ts +0 -7
  382. package/types/pkg/commands/hstrlen.d.ts +0 -7
  383. package/types/pkg/commands/hvals.d.ts +0 -7
  384. package/types/pkg/commands/incr.d.ts +0 -7
  385. package/types/pkg/commands/incrby.d.ts +0 -7
  386. package/types/pkg/commands/incrbyfloat.d.ts +0 -7
  387. package/types/pkg/commands/json_arrappend.d.ts +0 -7
  388. package/types/pkg/commands/json_arrindex.d.ts +0 -13
  389. package/types/pkg/commands/json_arrinsert.d.ts +0 -7
  390. package/types/pkg/commands/json_arrlen.d.ts +0 -7
  391. package/types/pkg/commands/json_arrpop.d.ts +0 -7
  392. package/types/pkg/commands/json_arrtrim.d.ts +0 -7
  393. package/types/pkg/commands/json_clear.d.ts +0 -7
  394. package/types/pkg/commands/json_del.d.ts +0 -7
  395. package/types/pkg/commands/json_forget.d.ts +0 -7
  396. package/types/pkg/commands/json_get.d.ts +0 -15
  397. package/types/pkg/commands/json_mget.d.ts +0 -7
  398. package/types/pkg/commands/json_numincrby.d.ts +0 -7
  399. package/types/pkg/commands/json_nummultby.d.ts +0 -7
  400. package/types/pkg/commands/json_objkeys.d.ts +0 -7
  401. package/types/pkg/commands/json_objlen.d.ts +0 -7
  402. package/types/pkg/commands/json_resp.d.ts +0 -7
  403. package/types/pkg/commands/json_set.d.ts +0 -18
  404. package/types/pkg/commands/json_strappend.d.ts +0 -7
  405. package/types/pkg/commands/json_strlen.d.ts +0 -7
  406. package/types/pkg/commands/json_toggle.d.ts +0 -7
  407. package/types/pkg/commands/json_type.d.ts +0 -7
  408. package/types/pkg/commands/keys.d.ts +0 -7
  409. package/types/pkg/commands/lindex.d.ts +0 -4
  410. package/types/pkg/commands/linsert.d.ts +0 -9
  411. package/types/pkg/commands/llen.d.ts +0 -7
  412. package/types/pkg/commands/lmove.d.ts +0 -12
  413. package/types/pkg/commands/lpop.d.ts +0 -7
  414. package/types/pkg/commands/lpos.d.ts +0 -15
  415. package/types/pkg/commands/lpush.d.ts +0 -7
  416. package/types/pkg/commands/lpushx.d.ts +0 -7
  417. package/types/pkg/commands/lrange.d.ts +0 -4
  418. package/types/pkg/commands/lrem.d.ts +0 -4
  419. package/types/pkg/commands/lset.d.ts +0 -4
  420. package/types/pkg/commands/ltrim.d.ts +0 -4
  421. package/types/pkg/commands/mget.d.ts +0 -7
  422. package/types/pkg/commands/mod.d.ts +0 -140
  423. package/types/pkg/commands/mset.d.ts +0 -9
  424. package/types/pkg/commands/msetnx.d.ts +0 -9
  425. package/types/pkg/commands/persist.d.ts +0 -7
  426. package/types/pkg/commands/pexpire.d.ts +0 -7
  427. package/types/pkg/commands/pexpireat.d.ts +0 -7
  428. package/types/pkg/commands/ping.d.ts +0 -7
  429. package/types/pkg/commands/psetex.d.ts +0 -7
  430. package/types/pkg/commands/pttl.d.ts +0 -7
  431. package/types/pkg/commands/publish.d.ts +0 -7
  432. package/types/pkg/commands/randomkey.d.ts +0 -7
  433. package/types/pkg/commands/rename.d.ts +0 -7
  434. package/types/pkg/commands/renamenx.d.ts +0 -7
  435. package/types/pkg/commands/rpop.d.ts +0 -7
  436. package/types/pkg/commands/rpush.d.ts +0 -7
  437. package/types/pkg/commands/rpushx.d.ts +0 -7
  438. package/types/pkg/commands/sadd.d.ts +0 -7
  439. package/types/pkg/commands/scan.d.ts +0 -18
  440. package/types/pkg/commands/scard.d.ts +0 -7
  441. package/types/pkg/commands/script_exists.d.ts +0 -7
  442. package/types/pkg/commands/script_flush.d.ts +0 -14
  443. package/types/pkg/commands/script_load.d.ts +0 -7
  444. package/types/pkg/commands/sdiff.d.ts +0 -7
  445. package/types/pkg/commands/sdiffstore.d.ts +0 -7
  446. package/types/pkg/commands/set.d.ts +0 -55
  447. package/types/pkg/commands/setbit.d.ts +0 -7
  448. package/types/pkg/commands/setex.d.ts +0 -7
  449. package/types/pkg/commands/setnx.d.ts +0 -7
  450. package/types/pkg/commands/setrange.d.ts +0 -7
  451. package/types/pkg/commands/sinter.d.ts +0 -7
  452. package/types/pkg/commands/sinterstore.d.ts +0 -7
  453. package/types/pkg/commands/sismember.d.ts +0 -7
  454. package/types/pkg/commands/smembers.d.ts +0 -7
  455. package/types/pkg/commands/smismember.d.ts +0 -7
  456. package/types/pkg/commands/smove.d.ts +0 -7
  457. package/types/pkg/commands/spop.d.ts +0 -7
  458. package/types/pkg/commands/srandmember.d.ts +0 -7
  459. package/types/pkg/commands/srem.d.ts +0 -7
  460. package/types/pkg/commands/sscan.d.ts +0 -24
  461. package/types/pkg/commands/strlen.d.ts +0 -7
  462. package/types/pkg/commands/sunion.d.ts +0 -7
  463. package/types/pkg/commands/sunionstore.d.ts +0 -7
  464. package/types/pkg/commands/time.d.ts +0 -7
  465. package/types/pkg/commands/touch.d.ts +0 -7
  466. package/types/pkg/commands/ttl.d.ts +0 -7
  467. package/types/pkg/commands/type.d.ts +0 -8
  468. package/types/pkg/commands/unlink.d.ts +0 -7
  469. package/types/pkg/commands/zadd.d.ts +0 -35
  470. package/types/pkg/commands/zcard.d.ts +0 -7
  471. package/types/pkg/commands/zcount.d.ts +0 -7
  472. package/types/pkg/commands/zdiffstore.d.ts +0 -7
  473. package/types/pkg/commands/zincrby.d.ts +0 -7
  474. package/types/pkg/commands/zinterstore.d.ts +0 -30
  475. package/types/pkg/commands/zlexcount.d.ts +0 -7
  476. package/types/pkg/commands/zmscore.d.ts +0 -7
  477. package/types/pkg/commands/zpopmax.d.ts +0 -7
  478. package/types/pkg/commands/zpopmin.d.ts +0 -7
  479. package/types/pkg/commands/zrange.d.ts +0 -42
  480. package/types/pkg/commands/zrank.d.ts +0 -7
  481. package/types/pkg/commands/zrem.d.ts +0 -7
  482. package/types/pkg/commands/zremrangebylex.d.ts +0 -7
  483. package/types/pkg/commands/zremrangebyrank.d.ts +0 -7
  484. package/types/pkg/commands/zremrangebyscore.d.ts +0 -7
  485. package/types/pkg/commands/zrevrank.d.ts +0 -7
  486. package/types/pkg/commands/zscan.d.ts +0 -24
  487. package/types/pkg/commands/zscore.d.ts +0 -7
  488. package/types/pkg/commands/zunionstore.d.ts +0 -30
  489. package/types/pkg/error.d.ts +0 -6
  490. package/types/pkg/http.d.ts +0 -91
  491. package/types/pkg/pipeline.d.ts +0 -678
  492. package/types/pkg/redis.d.ts +0 -659
  493. package/types/pkg/script.d.ts +0 -42
  494. package/types/pkg/types.d.ts +0 -27
  495. package/types/pkg/util.d.ts +0 -1
  496. package/types/platforms/cloudflare.d.ts +0 -43
  497. package/types/platforms/fastly.d.ts +0 -41
  498. package/types/platforms/node_with_fetch.d.ts +0 -63
  499. package/types/platforms/nodejs.d.ts +0 -78
  500. package/types/version.d.ts +0 -1
@@ -0,0 +1,3518 @@
1
+ type CommandArgs<TCommand extends new (..._args: any) => any> = ConstructorParameters<TCommand>[0];
2
+ type Telemetry = {
3
+ /**
4
+ * Upstash-Telemetry-Sdk
5
+ * @example @upstash/redis@v1.1.1
6
+ */
7
+ sdk?: string;
8
+ /**
9
+ * Upstash-Telemetry-Platform
10
+ * @example cloudflare
11
+ */
12
+ platform?: string;
13
+ /**
14
+ * Upstash-Telemetry-Runtime
15
+ * @example node@v18
16
+ */
17
+ runtime?: string;
18
+ };
19
+ type RedisOptions = {
20
+ /**
21
+ * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
22
+ *
23
+ * @default true
24
+ */
25
+ automaticDeserialization?: boolean;
26
+ latencyLogging?: boolean;
27
+ enableTelemetry?: boolean;
28
+ enableAutoPipelining?: boolean;
29
+ };
30
+
31
+ type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
32
+ type UpstashRequest = {
33
+ path?: string[];
34
+ /**
35
+ * Request body will be serialized to json
36
+ */
37
+ body?: unknown;
38
+ };
39
+ type UpstashResponse<TResult> = {
40
+ result?: TResult;
41
+ error?: string;
42
+ };
43
+ interface Requester {
44
+ request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
45
+ }
46
+ type RetryConfig = false | {
47
+ /**
48
+ * The number of retries to attempt before giving up.
49
+ *
50
+ * @default 5
51
+ */
52
+ retries?: number;
53
+ /**
54
+ * A backoff function receives the current retry cound and returns a number in milliseconds to wait before retrying.
55
+ *
56
+ * @default
57
+ * ```ts
58
+ * Math.exp(retryCount) * 50
59
+ * ```
60
+ */
61
+ backoff?: (retryCount: number) => number;
62
+ };
63
+ type RequesterConfig = {
64
+ /**
65
+ * Configure the retry behaviour in case of network errors
66
+ */
67
+ retry?: RetryConfig;
68
+ /**
69
+ * Due to the nature of dynamic and custom data, it is possible to write data to redis that is not
70
+ * valid json and will therefore cause errors when deserializing. This used to happen very
71
+ * frequently with non-utf8 data, such as emojis.
72
+ *
73
+ * By default we will therefore encode the data as base64 on the server, before sending it to the
74
+ * client. The client will then decode the base64 data and parse it as utf8.
75
+ *
76
+ * For very large entries, this can add a few milliseconds, so if you are sure that your data is
77
+ * valid utf8, you can disable this behaviour by setting this option to false.
78
+ *
79
+ * Here's what the response body looks like:
80
+ *
81
+ * ```json
82
+ * {
83
+ * result?: "base64-encoded",
84
+ * error?: string
85
+ * }
86
+ * ```
87
+ *
88
+ * @default "base64"
89
+ */
90
+ responseEncoding?: false | "base64";
91
+ /**
92
+ * Configure the cache behaviour
93
+ * @default "no-store"
94
+ */
95
+ cache?: CacheSetting;
96
+ };
97
+
98
+ type Serialize = (data: unknown) => string | number | boolean;
99
+ type Deserialize<TResult, TData> = (result: TResult) => TData;
100
+ type CommandOptions<TResult, TData> = {
101
+ /**
102
+ * Custom deserializer
103
+ */
104
+ deserialize?: (result: TResult) => TData;
105
+ /**
106
+ * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
107
+ *
108
+ * @default true
109
+ */
110
+ automaticDeserialization?: boolean;
111
+ latencyLogging?: boolean;
112
+ };
113
+ /**
114
+ * Command offers default (de)serialization and the exec method to all commands.
115
+ *
116
+ * TData represents what the user will enter or receive,
117
+ * TResult is the raw data returned from upstash, which may need to be transformed or parsed.
118
+ */
119
+ declare class Command<TResult, TData> {
120
+ readonly command: (string | number | boolean)[];
121
+ readonly serialize: Serialize;
122
+ readonly deserialize: Deserialize<TResult, TData>;
123
+ /**
124
+ * Create a new command instance.
125
+ *
126
+ * You can define a custom `deserialize` function. By default we try to deserialize as json.
127
+ */
128
+ constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
129
+ /**
130
+ * Execute the command using a client.
131
+ */
132
+ exec(client: Requester): Promise<TData>;
133
+ }
134
+
135
+ type ZUnionCommandOptions = {
136
+ withScores?: boolean;
137
+ aggregate?: "sum" | "min" | "max";
138
+ } & ({
139
+ weight: number;
140
+ weights?: never;
141
+ } | {
142
+ weight?: never;
143
+ weights: number[];
144
+ } | {
145
+ weight?: never;
146
+ weights?: never;
147
+ });
148
+ /**
149
+ * @see https://redis.io/commands/zunion
150
+ */
151
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
152
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
153
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
154
+ }
155
+
156
+ type ZUnionStoreCommandOptions = {
157
+ aggregate?: "sum" | "min" | "max";
158
+ } & ({
159
+ weight: number;
160
+ weights?: never;
161
+ } | {
162
+ weight?: never;
163
+ weights: number[];
164
+ } | {
165
+ weight?: never;
166
+ weights?: never;
167
+ });
168
+ /**
169
+ * @see https://redis.io/commands/zunionstore
170
+ */
171
+ declare class ZUnionStoreCommand extends Command<number, number> {
172
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
173
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
174
+ }
175
+
176
+ type ZInterStoreCommandOptions = {
177
+ aggregate?: "sum" | "min" | "max";
178
+ } & ({
179
+ weight: number;
180
+ weights?: never;
181
+ } | {
182
+ weight?: never;
183
+ weights: number[];
184
+ } | {
185
+ weight?: never;
186
+ weights?: never;
187
+ });
188
+ /**
189
+ * @see https://redis.io/commands/zInterstore
190
+ */
191
+ declare class ZInterStoreCommand extends Command<number, number> {
192
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
193
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
194
+ }
195
+
196
+ type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
197
+ /**
198
+ * @see https://redis.io/commands/type
199
+ */
200
+ declare class TypeCommand extends Command<Type, Type> {
201
+ constructor(cmd: [key: string], opts?: CommandOptions<Type, Type>);
202
+ }
203
+
204
+ type ScriptFlushCommandOptions = {
205
+ sync: true;
206
+ async?: never;
207
+ } | {
208
+ sync?: never;
209
+ async: true;
210
+ };
211
+ /**
212
+ * @see https://redis.io/commands/script-flush
213
+ */
214
+ declare class ScriptFlushCommand extends Command<"OK", "OK"> {
215
+ constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
216
+ }
217
+
218
+ type ScanCommandOptions = {
219
+ match?: string;
220
+ count?: number;
221
+ type?: string;
222
+ };
223
+ /**
224
+ * @see https://redis.io/commands/scan
225
+ */
226
+ declare class ScanCommand extends Command<[string, string[]], [string, string[]]> {
227
+ constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], [string, string[]]>);
228
+ }
229
+
230
+ type GeoAddCommandOptions = {
231
+ nx?: boolean;
232
+ xx?: never;
233
+ } | ({
234
+ nx?: never;
235
+ xx?: boolean;
236
+ } & {
237
+ ch?: boolean;
238
+ });
239
+ interface GeoMember<TMemberType> {
240
+ latitude: number;
241
+ longitude: number;
242
+ member: TMemberType;
243
+ }
244
+ /**
245
+ * @see https://redis.io/commands/geoadd
246
+ */
247
+ declare class GeoAddCommand<TMemberType = string> extends Command<number | null, number | null> {
248
+ constructor([key, arg1, ...arg2]: [
249
+ string,
250
+ GeoMember<TMemberType> | GeoAddCommandOptions,
251
+ ...GeoMember<TMemberType>[]
252
+ ], opts?: CommandOptions<number | null, number | null>);
253
+ }
254
+
255
+ /**
256
+ * @see https://redis.io/commands/append
257
+ */
258
+ declare class AppendCommand extends Command<number, number> {
259
+ constructor(cmd: [key: string, value: string], opts?: CommandOptions<number, number>);
260
+ }
261
+
262
+ /**
263
+ * @see https://redis.io/commands/bitcount
264
+ */
265
+ declare class BitCountCommand extends Command<number, number> {
266
+ constructor(cmd: [key: string, start?: never, end?: never], opts?: CommandOptions<number, number>);
267
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
268
+ }
269
+
270
+ type SubCommandArgs<TRest extends unknown[] = []> = [
271
+ encoding: string,
272
+ offset: number | string,
273
+ ...TRest
274
+ ];
275
+ /**
276
+ * @see https://redis.io/commands/bitfield
277
+ */
278
+ declare class BitFieldCommand<T = Promise<number[]>> {
279
+ private client;
280
+ private opts?;
281
+ private execOperation;
282
+ private command;
283
+ constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
284
+ private chain;
285
+ get(...args: SubCommandArgs): this;
286
+ set(...args: SubCommandArgs<[value: number]>): this;
287
+ incrby(...args: SubCommandArgs<[increment: number]>): this;
288
+ overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
289
+ exec(): T;
290
+ }
291
+
292
+ /**
293
+ * @see https://redis.io/commands/bitop
294
+ */
295
+ declare class BitOpCommand extends Command<number, number> {
296
+ constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
297
+ constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
298
+ }
299
+
300
+ /**
301
+ * @see https://redis.io/commands/bitpos
302
+ */
303
+ declare class BitPosCommand extends Command<number, number> {
304
+ constructor(cmd: [key: string, bit: 0 | 1, start?: number, end?: number], opts?: CommandOptions<number, number>);
305
+ }
306
+
307
+ /**
308
+ * @see https://redis.io/commands/copy
309
+ */
310
+ declare class CopyCommand extends Command<number, "COPIED" | "NOT_COPIED"> {
311
+ constructor([key, destinationKey, opts]: [key: string, destinationKey: string, opts?: {
312
+ replace: boolean;
313
+ }], commandOptions?: CommandOptions<number, "COPIED" | "NOT_COPIED">);
314
+ }
315
+
316
+ /**
317
+ * @see https://redis.io/commands/dbsize
318
+ */
319
+ declare class DBSizeCommand extends Command<number, number> {
320
+ constructor(opts?: CommandOptions<number, number>);
321
+ }
322
+
323
+ /**
324
+ * @see https://redis.io/commands/decr
325
+ */
326
+ declare class DecrCommand extends Command<number, number> {
327
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
328
+ }
329
+
330
+ /**
331
+ * @see https://redis.io/commands/decrby
332
+ */
333
+ declare class DecrByCommand extends Command<number, number> {
334
+ constructor(cmd: [key: string, decrement: number], opts?: CommandOptions<number, number>);
335
+ }
336
+
337
+ /**
338
+ * @see https://redis.io/commands/del
339
+ */
340
+ declare class DelCommand extends Command<number, number> {
341
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
342
+ }
343
+
344
+ /**
345
+ * @see https://redis.io/commands/echo
346
+ */
347
+ declare class EchoCommand extends Command<string, string> {
348
+ constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
349
+ }
350
+
351
+ /**
352
+ * @see https://redis.io/commands/eval
353
+ */
354
+ declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
355
+ constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
356
+ }
357
+
358
+ /**
359
+ * @see https://redis.io/commands/evalsha
360
+ */
361
+ declare class EvalshaCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
362
+ constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
363
+ }
364
+
365
+ /**
366
+ * @see https://redis.io/commands/exists
367
+ */
368
+ declare class ExistsCommand extends Command<number, number> {
369
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
370
+ }
371
+
372
+ type ExpireOptions = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
373
+ declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
374
+ constructor(cmd: [key: string, seconds: number, option?: ExpireOptions], opts?: CommandOptions<"0" | "1", 0 | 1>);
375
+ }
376
+
377
+ /**
378
+ * @see https://redis.io/commands/expireat
379
+ */
380
+ declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
381
+ constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
382
+ }
383
+
384
+ /**
385
+ * @see https://redis.io/commands/flushall
386
+ */
387
+ declare class FlushAllCommand extends Command<"OK", "OK"> {
388
+ constructor(args?: [{
389
+ async?: boolean;
390
+ }], opts?: CommandOptions<"OK", "OK">);
391
+ }
392
+
393
+ /**
394
+ * @see https://redis.io/commands/flushdb
395
+ */
396
+ declare class FlushDBCommand extends Command<"OK", "OK"> {
397
+ constructor([opts]: [opts?: {
398
+ async?: boolean;
399
+ }], cmdOpts?: CommandOptions<"OK", "OK">);
400
+ }
401
+
402
+ /**
403
+ * @see https://redis.io/commands/geodist
404
+ */
405
+ declare class GeoDistCommand<TMemberType = string> extends Command<number | null, number | null> {
406
+ constructor([key, member1, member2, unit]: [
407
+ key: string,
408
+ member1: TMemberType,
409
+ member2: TMemberType,
410
+ unit?: "M" | "KM" | "FT" | "MI"
411
+ ], opts?: CommandOptions<number | null, number | null>);
412
+ }
413
+
414
+ /**
415
+ * @see https://redis.io/commands/geohash
416
+ */
417
+ declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
418
+ constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
419
+ }
420
+
421
+ type Coordinates = {
422
+ lng: number;
423
+ lat: number;
424
+ };
425
+ /**
426
+ * @see https://redis.io/commands/geopos
427
+ */
428
+ declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][], Coordinates[]> {
429
+ constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
430
+ }
431
+
432
+ type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
433
+ type CenterPoint$1<TMemberType> = {
434
+ type: "FROMMEMBER" | "frommember";
435
+ member: TMemberType;
436
+ } | {
437
+ type: "FROMLONLAT" | "fromlonlat";
438
+ coordinate: {
439
+ lon: number;
440
+ lat: number;
441
+ };
442
+ };
443
+ type Shape$1 = {
444
+ type: "BYRADIUS" | "byradius";
445
+ radius: number;
446
+ radiusType: RadiusOptions$1;
447
+ } | {
448
+ type: "BYBOX" | "bybox";
449
+ rect: {
450
+ width: number;
451
+ height: number;
452
+ };
453
+ rectType: RadiusOptions$1;
454
+ };
455
+ type GeoSearchCommandOptions$1 = {
456
+ count?: {
457
+ limit: number;
458
+ any?: boolean;
459
+ };
460
+ withCoord?: boolean;
461
+ withDist?: boolean;
462
+ withHash?: boolean;
463
+ };
464
+ type OptionMappings = {
465
+ withHash: "hash";
466
+ withCoord: "coord";
467
+ withDist: "dist";
468
+ };
469
+ type GeoSearchOptions<TOptions> = {
470
+ [K in keyof TOptions as K extends keyof OptionMappings ? OptionMappings[K] : never]: K extends "withHash" ? string : K extends "withCoord" ? {
471
+ long: number;
472
+ lat: number;
473
+ } : K extends "withDist" ? number : never;
474
+ };
475
+ type GeoSearchResponse<TOptions, TMemberType> = ({
476
+ member: TMemberType;
477
+ } & GeoSearchOptions<TOptions>)[];
478
+ /**
479
+ * @see https://redis.io/commands/geosearch
480
+ */
481
+ declare class GeoSearchCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions$1 = GeoSearchCommandOptions$1> extends Command<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>> {
482
+ constructor([key, centerPoint, shape, order, opts]: [
483
+ key: string,
484
+ centerPoint: CenterPoint$1<TMemberType>,
485
+ shape: Shape$1,
486
+ order: "ASC" | "DESC" | "asc" | "desc",
487
+ opts?: TOptions
488
+ ], commandOptions?: CommandOptions<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>>);
489
+ }
490
+
491
+ type RadiusOptions = "M" | "KM" | "FT" | "MI";
492
+ type CenterPoint<TMemberType> = {
493
+ type: "FROMMEMBER" | "frommember";
494
+ member: TMemberType;
495
+ } | {
496
+ type: "FROMLONLAT" | "fromlonlat";
497
+ coordinate: {
498
+ lon: number;
499
+ lat: number;
500
+ };
501
+ };
502
+ type Shape = {
503
+ type: "BYRADIUS" | "byradius";
504
+ radius: number;
505
+ radiusType: RadiusOptions;
506
+ } | {
507
+ type: "BYBOX" | "bybox";
508
+ rect: {
509
+ width: number;
510
+ height: number;
511
+ };
512
+ rectType: RadiusOptions;
513
+ };
514
+ type GeoSearchCommandOptions = {
515
+ count?: {
516
+ limit: number;
517
+ any?: boolean;
518
+ };
519
+ storeDist?: boolean;
520
+ };
521
+ /**
522
+ * @see https://redis.io/commands/geosearchstore
523
+ */
524
+ declare class GeoSearchStoreCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions = GeoSearchCommandOptions> extends Command<any[] | any[][], number> {
525
+ constructor([destination, key, centerPoint, shape, order, opts]: [
526
+ destination: string,
527
+ key: string,
528
+ centerPoint: CenterPoint<TMemberType>,
529
+ shape: Shape,
530
+ order: "ASC" | "DESC" | "asc" | "desc",
531
+ opts?: TOptions
532
+ ], commandOptions?: CommandOptions<any[] | any[][], number>);
533
+ }
534
+
535
+ /**
536
+ * @see https://redis.io/commands/get
537
+ */
538
+ declare class GetCommand<TData = string> extends Command<unknown | null, TData | null> {
539
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
540
+ }
541
+
542
+ /**
543
+ * @see https://redis.io/commands/getbit
544
+ */
545
+ declare class GetBitCommand extends Command<"0" | "1", 0 | 1> {
546
+ constructor(cmd: [key: string, offset: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
547
+ }
548
+
549
+ /**
550
+ * @see https://redis.io/commands/getdel
551
+ */
552
+ declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
553
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
554
+ }
555
+
556
+ /**
557
+ * @see https://redis.io/commands/getrange
558
+ */
559
+ declare class GetRangeCommand extends Command<string, string> {
560
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<string, string>);
561
+ }
562
+
563
+ /**
564
+ * @see https://redis.io/commands/getset
565
+ */
566
+ declare class GetSetCommand<TData = string> extends Command<unknown | null, TData | null> {
567
+ constructor(cmd: [key: string, value: TData], opts?: CommandOptions<unknown | null, TData | null>);
568
+ }
569
+
570
+ /**
571
+ * @see https://redis.io/commands/hdel
572
+ */
573
+ declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
574
+ constructor(cmd: [key: string, ...fields: string[]], opts?: CommandOptions<"0" | "1", 0 | 1>);
575
+ }
576
+
577
+ /**
578
+ * @see https://redis.io/commands/hexists
579
+ */
580
+ declare class HExistsCommand extends Command<number, number> {
581
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
582
+ }
583
+
584
+ /**
585
+ * @see https://redis.io/commands/hget
586
+ */
587
+ declare class HGetCommand<TData> extends Command<unknown | null, TData | null> {
588
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<unknown | null, TData | null>);
589
+ }
590
+
591
+ /**
592
+ * @see https://redis.io/commands/hgetall
593
+ */
594
+ declare class HGetAllCommand<TData extends Record<string, unknown>> extends Command<unknown | null, TData | null> {
595
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
596
+ }
597
+
598
+ /**
599
+ * @see https://redis.io/commands/hincrby
600
+ */
601
+ declare class HIncrByCommand extends Command<number, number> {
602
+ constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
603
+ }
604
+
605
+ /**
606
+ * @see https://redis.io/commands/hincrbyfloat
607
+ */
608
+ declare class HIncrByFloatCommand extends Command<number, number> {
609
+ constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
610
+ }
611
+
612
+ /**
613
+ * @see https://redis.io/commands/hkeys
614
+ */
615
+ declare class HKeysCommand extends Command<string[], string[]> {
616
+ constructor([key]: [key: string], opts?: CommandOptions<string[], string[]>);
617
+ }
618
+
619
+ /**
620
+ * @see https://redis.io/commands/hlen
621
+ */
622
+ declare class HLenCommand extends Command<number, number> {
623
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
624
+ }
625
+
626
+ /**
627
+ * hmget returns an object of all requested fields from a hash
628
+ * The field values are returned as an object like this:
629
+ * ```ts
630
+ * {[fieldName: string]: T | null}
631
+ * ```
632
+ *
633
+ * In case the hash does not exist or all fields are empty `null` is returned
634
+ *
635
+ * @see https://redis.io/commands/hmget
636
+ */
637
+ declare class HMGetCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
638
+ constructor([key, ...fields]: [key: string, ...fields: string[]], opts?: CommandOptions<(string | null)[], TData | null>);
639
+ }
640
+
641
+ /**
642
+ * @see https://redis.io/commands/hmset
643
+ */
644
+ declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
645
+ constructor([key, kv]: [key: string, kv: {
646
+ [field: string]: TData;
647
+ }], opts?: CommandOptions<"OK", "OK">);
648
+ }
649
+
650
+ /**
651
+ * @see https://redis.io/commands/hrandfield
652
+ */
653
+ declare class HRandFieldCommand<TData extends string | string[] | Record<string, unknown>> extends Command<string | string[], TData> {
654
+ constructor(cmd: [key: string], opts?: CommandOptions<string, string>);
655
+ constructor(cmd: [key: string, count: number], opts?: CommandOptions<string[], string[]>);
656
+ constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
657
+ }
658
+
659
+ /**
660
+ * @see https://redis.io/commands/hscan
661
+ */
662
+ declare class HScanCommand extends Command<[
663
+ string,
664
+ (string | number)[]
665
+ ], [
666
+ string,
667
+ (string | number)[]
668
+ ]> {
669
+ constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
670
+ }
671
+
672
+ /**
673
+ * @see https://redis.io/commands/hset
674
+ */
675
+ declare class HSetCommand<TData> extends Command<number, number> {
676
+ constructor([key, kv]: [key: string, kv: {
677
+ [field: string]: TData;
678
+ }], opts?: CommandOptions<number, number>);
679
+ }
680
+
681
+ /**
682
+ * @see https://redis.io/commands/hsetnx
683
+ */
684
+ declare class HSetNXCommand<TData> extends Command<"0" | "1", 0 | 1> {
685
+ constructor(cmd: [key: string, field: string, value: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
686
+ }
687
+
688
+ /**
689
+ * @see https://redis.io/commands/hstrlen
690
+ */
691
+ declare class HStrLenCommand extends Command<number, number> {
692
+ constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
693
+ }
694
+
695
+ /**
696
+ * @see https://redis.io/commands/hvals
697
+ */
698
+ declare class HValsCommand<TData extends unknown[]> extends Command<unknown[], TData> {
699
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
700
+ }
701
+
702
+ /**
703
+ * @see https://redis.io/commands/incr
704
+ */
705
+ declare class IncrCommand extends Command<number, number> {
706
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
707
+ }
708
+
709
+ /**
710
+ * @see https://redis.io/commands/incrby
711
+ */
712
+ declare class IncrByCommand extends Command<number, number> {
713
+ constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
714
+ }
715
+
716
+ /**
717
+ * @see https://redis.io/commands/incrbyfloat
718
+ */
719
+ declare class IncrByFloatCommand extends Command<number, number> {
720
+ constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
721
+ }
722
+
723
+ /**
724
+ * @see https://redis.io/commands/json.arrappend
725
+ */
726
+ declare class JsonArrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
727
+ constructor(cmd: [key: string, path: string, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
728
+ }
729
+
730
+ /**
731
+ * @see https://redis.io/commands/json.arrindex
732
+ */
733
+ declare class JsonArrIndexCommand<TValue> extends Command<(null | string)[], (null | number)[]> {
734
+ constructor(cmd: [key: string, path: string, value: TValue, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
735
+ }
736
+
737
+ /**
738
+ * @see https://redis.io/commands/json.arrinsert
739
+ */
740
+ declare class JsonArrInsertCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
741
+ constructor(cmd: [key: string, path: string, index: number, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
742
+ }
743
+
744
+ /**
745
+ * @see https://redis.io/commands/json.arrlen
746
+ */
747
+ declare class JsonArrLenCommand extends Command<(null | string)[], (null | number)[]> {
748
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
749
+ }
750
+
751
+ /**
752
+ * @see https://redis.io/commands/json.arrpop
753
+ */
754
+ declare class JsonArrPopCommand<TData> extends Command<(null | string)[], (TData | null)[]> {
755
+ constructor(cmd: [key: string, path?: string, index?: number], opts?: CommandOptions<(null | string)[], (TData | null)[]>);
756
+ }
757
+
758
+ /**
759
+ * @see https://redis.io/commands/json.arrtrim
760
+ */
761
+ declare class JsonArrTrimCommand extends Command<(null | string)[], (null | number)[]> {
762
+ constructor(cmd: [key: string, path?: string, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
763
+ }
764
+
765
+ /**
766
+ * @see https://redis.io/commands/json.clear
767
+ */
768
+ declare class JsonClearCommand extends Command<number, number> {
769
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
770
+ }
771
+
772
+ /**
773
+ * @see https://redis.io/commands/json.del
774
+ */
775
+ declare class JsonDelCommand extends Command<number, number> {
776
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
777
+ }
778
+
779
+ /**
780
+ * @see https://redis.io/commands/json.forget
781
+ */
782
+ declare class JsonForgetCommand extends Command<number, number> {
783
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
784
+ }
785
+
786
+ /**
787
+ * @see https://redis.io/commands/json.get
788
+ */
789
+ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
790
+ constructor(cmd: [
791
+ key: string,
792
+ opts?: {
793
+ indent?: string;
794
+ newline?: string;
795
+ space?: string;
796
+ },
797
+ ...path: string[]
798
+ ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
799
+ }
800
+
801
+ /**
802
+ * @see https://redis.io/commands/json.mget
803
+ */
804
+ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
805
+ constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
806
+ }
807
+
808
+ /**
809
+ * @see https://redis.io/commands/json.numincrby
810
+ */
811
+ declare class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
812
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
813
+ }
814
+
815
+ /**
816
+ * @see https://redis.io/commands/json.nummultby
817
+ */
818
+ declare class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
819
+ constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
820
+ }
821
+
822
+ /**
823
+ * @see https://redis.io/commands/json.objkeys
824
+ */
825
+ declare class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
826
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>);
827
+ }
828
+
829
+ /**
830
+ * @see https://redis.io/commands/json.objlen
831
+ */
832
+ declare class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
833
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
834
+ }
835
+
836
+ /**
837
+ * @see https://redis.io/commands/json.resp
838
+ */
839
+ declare class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
840
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>);
841
+ }
842
+
843
+ /**
844
+ * @see https://redis.io/commands/json.set
845
+ */
846
+ declare class JsonSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
847
+ constructor(cmd: [
848
+ key: string,
849
+ path: string,
850
+ value: TData,
851
+ opts?: {
852
+ nx: true;
853
+ xx?: never;
854
+ } | {
855
+ nx?: never;
856
+ xx: true;
857
+ }
858
+ ], opts?: CommandOptions<"OK" | null, "OK" | null>);
859
+ }
860
+
861
+ /**
862
+ * @see https://redis.io/commands/json.strappend
863
+ */
864
+ declare class JsonStrAppendCommand extends Command<(null | string)[], (null | number)[]> {
865
+ constructor(cmd: [key: string, path: string, value: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
866
+ }
867
+
868
+ /**
869
+ * @see https://redis.io/commands/json.strlen
870
+ */
871
+ declare class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
872
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
873
+ }
874
+
875
+ /**
876
+ * @see https://redis.io/commands/json.toggle
877
+ */
878
+ declare class JsonToggleCommand extends Command<number[], number[]> {
879
+ constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>);
880
+ }
881
+
882
+ /**
883
+ * @see https://redis.io/commands/json.type
884
+ */
885
+ declare class JsonTypeCommand extends Command<string[], string[]> {
886
+ constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>);
887
+ }
888
+
889
+ /**
890
+ * @see https://redis.io/commands/keys
891
+ */
892
+ declare class KeysCommand extends Command<string[], string[]> {
893
+ constructor(cmd: [pattern: string], opts?: CommandOptions<string[], string[]>);
894
+ }
895
+
896
+ declare class LIndexCommand<TData = string> extends Command<unknown | null, TData | null> {
897
+ constructor(cmd: [key: string, index: number], opts?: CommandOptions<unknown | null, TData | null>);
898
+ }
899
+
900
+ declare class LInsertCommand<TData = string> extends Command<number, number> {
901
+ constructor(cmd: [key: string, direction: "before" | "after", pivot: TData, value: TData], opts?: CommandOptions<number, number>);
902
+ }
903
+
904
+ /**
905
+ * @see https://redis.io/commands/llen
906
+ */
907
+ declare class LLenCommand extends Command<number, number> {
908
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
909
+ }
910
+
911
+ /**
912
+ * @see https://redis.io/commands/lmove
913
+ */
914
+ declare class LMoveCommand<TData = string> extends Command<TData, TData> {
915
+ constructor(cmd: [
916
+ source: string,
917
+ destination: string,
918
+ whereFrom: "left" | "right",
919
+ whereTo: "left" | "right"
920
+ ], opts?: CommandOptions<TData, TData>);
921
+ }
922
+
923
+ /**
924
+ * @see https://redis.io/commands/lpop
925
+ */
926
+ declare class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
927
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
928
+ }
929
+
930
+ /**
931
+ * @see https://redis.io/commands/lpush
932
+ */
933
+ declare class LPushCommand<TData = string> extends Command<number, number> {
934
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
935
+ }
936
+
937
+ /**
938
+ * @see https://redis.io/commands/lpushx
939
+ */
940
+ declare class LPushXCommand<TData> extends Command<number, number> {
941
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
942
+ }
943
+
944
+ declare class LRangeCommand<TData = string> extends Command<unknown[], TData[]> {
945
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<unknown[], TData[]>);
946
+ }
947
+
948
+ declare class LRemCommand<TData> extends Command<number, number> {
949
+ constructor(cmd: [key: string, count: number, value: TData], opts?: CommandOptions<number, number>);
950
+ }
951
+
952
+ declare class LSetCommand<TData = string> extends Command<"OK", "OK"> {
953
+ constructor(cmd: [key: string, index: number, data: TData], opts?: CommandOptions<"OK", "OK">);
954
+ }
955
+
956
+ declare class LTrimCommand extends Command<"OK", "OK"> {
957
+ constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<"OK", "OK">);
958
+ }
959
+
960
+ /**
961
+ * @see https://redis.io/commands/mget
962
+ */
963
+ declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
964
+ constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
965
+ }
966
+
967
+ /**
968
+ * @see https://redis.io/commands/mset
969
+ */
970
+ declare class MSetCommand<TData> extends Command<"OK", "OK"> {
971
+ constructor([kv]: [kv: {
972
+ [key: string]: TData;
973
+ }], opts?: CommandOptions<"OK", "OK">);
974
+ }
975
+
976
+ /**
977
+ * @see https://redis.io/commands/msetnx
978
+ */
979
+ declare class MSetNXCommand<TData = string> extends Command<number, number> {
980
+ constructor([kv]: [kv: {
981
+ [key: string]: TData;
982
+ }], opts?: CommandOptions<number, number>);
983
+ }
984
+
985
+ /**
986
+ * @see https://redis.io/commands/persist
987
+ */
988
+ declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
989
+ constructor(cmd: [key: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
990
+ }
991
+
992
+ /**
993
+ * @see https://redis.io/commands/pexpire
994
+ */
995
+ declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
996
+ constructor(cmd: [key: string, milliseconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
997
+ }
998
+
999
+ /**
1000
+ * @see https://redis.io/commands/pexpireat
1001
+ */
1002
+ declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
1003
+ constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
1004
+ }
1005
+
1006
+ /**
1007
+ * @see https://redis.io/commands/ping
1008
+ */
1009
+ declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
1010
+ constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
1011
+ }
1012
+
1013
+ /**
1014
+ * @see https://redis.io/commands/psetex
1015
+ */
1016
+ declare class PSetEXCommand<TData = string> extends Command<string, string> {
1017
+ constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<string, string>);
1018
+ }
1019
+
1020
+ /**
1021
+ * @see https://redis.io/commands/pttl
1022
+ */
1023
+ declare class PTtlCommand extends Command<number, number> {
1024
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1025
+ }
1026
+
1027
+ /**
1028
+ * @see https://redis.io/commands/publish
1029
+ */
1030
+ declare class PublishCommand<TMessage = unknown> extends Command<number, number> {
1031
+ constructor(cmd: [channel: string, message: TMessage], opts?: CommandOptions<number, number>);
1032
+ }
1033
+
1034
+ /**
1035
+ * @see https://redis.io/commands/randomkey
1036
+ */
1037
+ declare class RandomKeyCommand extends Command<string | null, string | null> {
1038
+ constructor(opts?: CommandOptions<string | null, string | null>);
1039
+ }
1040
+
1041
+ /**
1042
+ * @see https://redis.io/commands/rename
1043
+ */
1044
+ declare class RenameCommand extends Command<"OK", "OK"> {
1045
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"OK", "OK">);
1046
+ }
1047
+
1048
+ /**
1049
+ * @see https://redis.io/commands/renamenx
1050
+ */
1051
+ declare class RenameNXCommand extends Command<"0" | "1", 0 | 1> {
1052
+ constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
1053
+ }
1054
+
1055
+ /**
1056
+ * @see https://redis.io/commands/rpop
1057
+ */
1058
+ declare class RPopCommand<TData extends unknown | unknown[] = string> extends Command<unknown | null, TData | null> {
1059
+ constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
1060
+ }
1061
+
1062
+ /**
1063
+ * @see https://redis.io/commands/rpush
1064
+ */
1065
+ declare class RPushCommand<TData = string> extends Command<number, number> {
1066
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
1067
+ }
1068
+
1069
+ /**
1070
+ * @see https://redis.io/commands/rpushx
1071
+ */
1072
+ declare class RPushXCommand<TData = string> extends Command<number, number> {
1073
+ constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
1074
+ }
1075
+
1076
+ /**
1077
+ * @see https://redis.io/commands/sadd
1078
+ */
1079
+ declare class SAddCommand<TData = string> extends Command<number, number> {
1080
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1081
+ }
1082
+
1083
+ /**
1084
+ * @see https://redis.io/commands/scard
1085
+ */
1086
+ declare class SCardCommand extends Command<number, number> {
1087
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1088
+ }
1089
+
1090
+ /**
1091
+ * @see https://redis.io/commands/script-exists
1092
+ */
1093
+ declare class ScriptExistsCommand<T extends string[]> extends Command<string[], number[]> {
1094
+ constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
1095
+ }
1096
+
1097
+ /**
1098
+ * @see https://redis.io/commands/script-load
1099
+ */
1100
+ declare class ScriptLoadCommand extends Command<string, string> {
1101
+ constructor(args: [script: string], opts?: CommandOptions<string, string>);
1102
+ }
1103
+
1104
+ /**
1105
+ * @see https://redis.io/commands/sdiff
1106
+ */
1107
+ declare class SDiffCommand<TData> extends Command<unknown[], TData[]> {
1108
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
1109
+ }
1110
+
1111
+ /**
1112
+ * @see https://redis.io/commands/sdiffstore
1113
+ */
1114
+ declare class SDiffStoreCommand extends Command<number, number> {
1115
+ constructor(cmd: [destination: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1116
+ }
1117
+
1118
+ type SetCommandOptions = {
1119
+ get?: boolean;
1120
+ } & ({
1121
+ ex: number;
1122
+ px?: never;
1123
+ exat?: never;
1124
+ pxat?: never;
1125
+ keepTtl?: never;
1126
+ } | {
1127
+ ex?: never;
1128
+ px: number;
1129
+ exat?: never;
1130
+ pxat?: never;
1131
+ keepTtl?: never;
1132
+ } | {
1133
+ ex?: never;
1134
+ px?: never;
1135
+ exat: number;
1136
+ pxat?: never;
1137
+ keepTtl?: never;
1138
+ } | {
1139
+ ex?: never;
1140
+ px?: never;
1141
+ exat?: never;
1142
+ pxat: number;
1143
+ keepTtl?: never;
1144
+ } | {
1145
+ ex?: never;
1146
+ px?: never;
1147
+ exat?: never;
1148
+ pxat?: never;
1149
+ keepTtl: true;
1150
+ } | {
1151
+ ex?: never;
1152
+ px?: never;
1153
+ exat?: never;
1154
+ pxat?: never;
1155
+ keepTtl?: never;
1156
+ }) & ({
1157
+ nx: true;
1158
+ xx?: never;
1159
+ } | {
1160
+ xx: true;
1161
+ nx?: never;
1162
+ } | {
1163
+ xx?: never;
1164
+ nx?: never;
1165
+ });
1166
+ /**
1167
+ * @see https://redis.io/commands/set
1168
+ */
1169
+ declare class SetCommand<TData, TResult = TData | "OK" | null> extends Command<TResult, TData | "OK" | null> {
1170
+ constructor([key, value, opts]: [key: string, value: TData, opts?: SetCommandOptions], cmdOpts?: CommandOptions<TResult, TData>);
1171
+ }
1172
+
1173
+ /**
1174
+ * @see https://redis.io/commands/setbit
1175
+ */
1176
+ declare class SetBitCommand extends Command<"0" | "1", 0 | 1> {
1177
+ constructor(cmd: [key: string, offset: number, value: 0 | 1], opts?: CommandOptions<"0" | "1", 0 | 1>);
1178
+ }
1179
+
1180
+ /**
1181
+ * @see https://redis.io/commands/setex
1182
+ */
1183
+ declare class SetExCommand<TData = string> extends Command<"OK", "OK"> {
1184
+ constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<"OK", "OK">);
1185
+ }
1186
+
1187
+ /**
1188
+ * @see https://redis.io/commands/setnx
1189
+ */
1190
+ declare class SetNxCommand<TData = string> extends Command<number, number> {
1191
+ constructor(cmd: [key: string, value: TData], opts?: CommandOptions<number, number>);
1192
+ }
1193
+
1194
+ /**
1195
+ * @see https://redis.io/commands/setrange
1196
+ */
1197
+ declare class SetRangeCommand extends Command<number, number> {
1198
+ constructor(cmd: [key: string, offset: number, value: string], opts?: CommandOptions<number, number>);
1199
+ }
1200
+
1201
+ /**
1202
+ * @see https://redis.io/commands/sinter
1203
+ */
1204
+ declare class SInterCommand<TData = string> extends Command<unknown[], TData[]> {
1205
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
1206
+ }
1207
+
1208
+ /**
1209
+ * @see https://redis.io/commands/sinterstore
1210
+ */
1211
+ declare class SInterStoreCommand extends Command<number, number> {
1212
+ constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1213
+ }
1214
+
1215
+ /**
1216
+ * @see https://redis.io/commands/sismember
1217
+ */
1218
+ declare class SIsMemberCommand<TData = string> extends Command<"0" | "1", 0 | 1> {
1219
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
1220
+ }
1221
+
1222
+ /**
1223
+ * @see https://redis.io/commands/smembers
1224
+ */
1225
+ declare class SMembersCommand<TData extends unknown[] = string[]> extends Command<unknown[], TData> {
1226
+ constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
1227
+ }
1228
+
1229
+ /**
1230
+ * @see https://redis.io/commands/smismember
1231
+ */
1232
+ declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
1233
+ constructor(cmd: [key: string, members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
1234
+ }
1235
+
1236
+ /**
1237
+ * @see https://redis.io/commands/smove
1238
+ */
1239
+ declare class SMoveCommand<TData> extends Command<"0" | "1", 0 | 1> {
1240
+ constructor(cmd: [source: string, destination: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
1241
+ }
1242
+
1243
+ /**
1244
+ * @see https://redis.io/commands/spop
1245
+ */
1246
+ declare class SPopCommand<TData> extends Command<string | string[] | null, TData | null> {
1247
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | string[] | null, TData | null>);
1248
+ }
1249
+
1250
+ /**
1251
+ * @see https://redis.io/commands/srandmember
1252
+ */
1253
+ declare class SRandMemberCommand<TData> extends Command<string | null, TData | null> {
1254
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | null, TData | null>);
1255
+ }
1256
+
1257
+ /**
1258
+ * @see https://redis.io/commands/srem
1259
+ */
1260
+ declare class SRemCommand<TData = string> extends Command<number, number> {
1261
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1262
+ }
1263
+
1264
+ /**
1265
+ * @see https://redis.io/commands/sscan
1266
+ */
1267
+ declare class SScanCommand extends Command<[
1268
+ string,
1269
+ (string | number)[]
1270
+ ], [
1271
+ string,
1272
+ (string | number)[]
1273
+ ]> {
1274
+ constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
1275
+ }
1276
+
1277
+ /**
1278
+ * @see https://redis.io/commands/strlen
1279
+ */
1280
+ declare class StrLenCommand extends Command<number, number> {
1281
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1282
+ }
1283
+
1284
+ /**
1285
+ * @see https://redis.io/commands/sunion
1286
+ */
1287
+ declare class SUnionCommand<TData> extends Command<string[], TData[]> {
1288
+ constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<string[], TData[]>);
1289
+ }
1290
+
1291
+ /**
1292
+ * @see https://redis.io/commands/sunionstore
1293
+ */
1294
+ declare class SUnionStoreCommand extends Command<number, number> {
1295
+ constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
1296
+ }
1297
+
1298
+ /**
1299
+ * @see https://redis.io/commands/time
1300
+ */
1301
+ declare class TimeCommand extends Command<[number, number], [number, number]> {
1302
+ constructor(opts?: CommandOptions<[number, number], [number, number]>);
1303
+ }
1304
+
1305
+ /**
1306
+ * @see https://redis.io/commands/touch
1307
+ */
1308
+ declare class TouchCommand extends Command<number, number> {
1309
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
1310
+ }
1311
+
1312
+ /**
1313
+ * @see https://redis.io/commands/ttl
1314
+ */
1315
+ declare class TtlCommand extends Command<number, number> {
1316
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1317
+ }
1318
+
1319
+ /**
1320
+ * @see https://redis.io/commands/unlink
1321
+ */
1322
+ declare class UnlinkCommand extends Command<number, number> {
1323
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
1324
+ }
1325
+
1326
+ type XAddCommandOptions = {
1327
+ nomkStream?: boolean;
1328
+ trim?: ({
1329
+ type: "MAXLEN" | "maxlen";
1330
+ threshold: number;
1331
+ } | {
1332
+ type: "MINID" | "minid";
1333
+ threshold: string;
1334
+ }) & ({
1335
+ comparison: "~";
1336
+ limit?: number;
1337
+ } | {
1338
+ comparison: "=";
1339
+ limit?: never;
1340
+ });
1341
+ };
1342
+ /**
1343
+ * @see https://redis.io/commands/xadd
1344
+ */
1345
+ declare class XAddCommand extends Command<string, string> {
1346
+ constructor([key, id, entries, opts]: [
1347
+ key: string,
1348
+ id: "*" | string,
1349
+ entries: {
1350
+ [field: string]: unknown;
1351
+ },
1352
+ opts?: XAddCommandOptions
1353
+ ], commandOptions?: CommandOptions<string, string>);
1354
+ }
1355
+
1356
+ declare class XRangeCommand<TData extends Record<string, Record<string, unknown>>> extends Command<string[][], TData> {
1357
+ constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
1358
+ }
1359
+
1360
+ type XReadCommandOptions = [
1361
+ key: string | string[],
1362
+ id: string | string[],
1363
+ options?: {
1364
+ count?: number;
1365
+ blockMS?: number;
1366
+ }
1367
+ ];
1368
+ type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [key: string, id: string, options?: {
1369
+ count?: number;
1370
+ blockMS?: number;
1371
+ }] : never : K extends string[] ? I extends string[] ? [key: string[], id: string[], options?: {
1372
+ count?: number;
1373
+ blockMS?: number;
1374
+ }] : never : never : never;
1375
+ /**
1376
+ * @see https://redis.io/commands/xread
1377
+ */
1378
+ declare class XReadCommand extends Command<number, unknown[]> {
1379
+ constructor([key, id, options]: XReadOptions, opts?: CommandOptions<number, unknown[]>);
1380
+ }
1381
+
1382
+ type Options = {
1383
+ count?: number;
1384
+ blockMS?: number;
1385
+ NOACK?: boolean;
1386
+ };
1387
+ type XReadGroupCommandOptions = [
1388
+ group: string,
1389
+ consumer: string,
1390
+ key: string | string[],
1391
+ id: string | string[],
1392
+ options?: Options
1393
+ ];
1394
+ type XReadGroupOptions = XReadGroupCommandOptions extends [
1395
+ string,
1396
+ string,
1397
+ infer TKey,
1398
+ infer TId,
1399
+ ...any[]
1400
+ ] ? TKey extends string ? TId extends string ? [group: string, consumer: string, key: string, id: string, options?: Options] : never : TKey extends string[] ? TId extends string[] ? [group: string, consumer: string, key: string[], id: string[], options?: Options] : never : never : never;
1401
+ /**
1402
+ * @see https://redis.io/commands/xreadgroup
1403
+ */
1404
+ declare class XReadGroupCommand extends Command<number, unknown[]> {
1405
+ constructor([group, consumer, key, id, options]: XReadGroupOptions, opts?: CommandOptions<number, unknown[]>);
1406
+ }
1407
+
1408
+ type NXAndXXOptions = {
1409
+ nx: true;
1410
+ xx?: never;
1411
+ } | {
1412
+ nx?: never;
1413
+ xx: true;
1414
+ } | {
1415
+ nx?: never;
1416
+ xx?: never;
1417
+ };
1418
+ type LTAndGTOptions = {
1419
+ lt: true;
1420
+ gt?: never;
1421
+ } | {
1422
+ lt?: never;
1423
+ gt: true;
1424
+ } | {
1425
+ lt?: never;
1426
+ gt?: never;
1427
+ };
1428
+ type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
1429
+ ch?: true;
1430
+ } & {
1431
+ incr?: true;
1432
+ };
1433
+ type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
1434
+ type ScoreMember<TData> = {
1435
+ score: number;
1436
+ member: TData;
1437
+ };
1438
+ /**
1439
+ * @see https://redis.io/commands/zadd
1440
+ */
1441
+ declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
1442
+ constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
1443
+ }
1444
+
1445
+ /**
1446
+ * @see https://redis.io/commands/zcard
1447
+ */
1448
+ declare class ZCardCommand extends Command<number, number> {
1449
+ constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
1450
+ }
1451
+
1452
+ /**
1453
+ * @see https://redis.io/commands/zcount
1454
+ */
1455
+ declare class ZCountCommand extends Command<number, number> {
1456
+ constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
1457
+ }
1458
+
1459
+ /**
1460
+ * @see https://redis.io/commands/zincrby
1461
+ */
1462
+ declare class ZIncrByCommand<TData> extends Command<number, number> {
1463
+ constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
1464
+ }
1465
+
1466
+ /**
1467
+ * @see https://redis.io/commands/zlexcount
1468
+ */
1469
+ declare class ZLexCountCommand extends Command<number, number> {
1470
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1471
+ }
1472
+
1473
+ /**
1474
+ * @see https://redis.io/commands/zpopmax
1475
+ */
1476
+ declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
1477
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1478
+ }
1479
+
1480
+ /**
1481
+ * @see https://redis.io/commands/zpopmin
1482
+ */
1483
+ declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
1484
+ constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
1485
+ }
1486
+
1487
+ type ZRangeCommandOptions = {
1488
+ withScores?: boolean;
1489
+ rev?: boolean;
1490
+ } & ({
1491
+ byScore: true;
1492
+ byLex?: never;
1493
+ } | {
1494
+ byScore?: never;
1495
+ byLex: true;
1496
+ } | {
1497
+ byScore?: never;
1498
+ byLex?: never;
1499
+ }) & ({
1500
+ offset: number;
1501
+ count: number;
1502
+ } | {
1503
+ offset?: never;
1504
+ count?: never;
1505
+ });
1506
+ /**
1507
+ * @see https://redis.io/commands/zrange
1508
+ */
1509
+ declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
1510
+ constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
1511
+ constructor(cmd: [
1512
+ key: string,
1513
+ min: `(${string}` | `[${string}` | "-" | "+",
1514
+ max: `(${string}` | `[${string}` | "-" | "+",
1515
+ opts: {
1516
+ byLex: true;
1517
+ } & ZRangeCommandOptions
1518
+ ], cmdOpts?: CommandOptions<string[], TData>);
1519
+ constructor(cmd: [
1520
+ key: string,
1521
+ min: number | `(${number}` | "-inf" | "+inf",
1522
+ max: number | `(${number}` | "-inf" | "+inf",
1523
+ opts: {
1524
+ byScore: true;
1525
+ } & ZRangeCommandOptions
1526
+ ], cmdOpts?: CommandOptions<string[], TData>);
1527
+ }
1528
+
1529
+ /**
1530
+ * @see https://redis.io/commands/zrank
1531
+ */
1532
+ declare class ZRankCommand<TData> extends Command<number | null, number | null> {
1533
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1534
+ }
1535
+
1536
+ /**
1537
+ * @see https://redis.io/commands/zrem
1538
+ */
1539
+ declare class ZRemCommand<TData = string> extends Command<number, number> {
1540
+ constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1541
+ }
1542
+
1543
+ /**
1544
+ * @see https://redis.io/commands/zremrangebylex
1545
+ */
1546
+ declare class ZRemRangeByLexCommand extends Command<number, number> {
1547
+ constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
1548
+ }
1549
+
1550
+ /**
1551
+ * @see https://redis.io/commands/zremrangebyrank
1552
+ */
1553
+ declare class ZRemRangeByRankCommand extends Command<number, number> {
1554
+ constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
1555
+ }
1556
+
1557
+ /**
1558
+ * @see https://redis.io/commands/zremrangebyscore
1559
+ */
1560
+ declare class ZRemRangeByScoreCommand extends Command<number, number> {
1561
+ constructor(cmd: [key: string, min: number, max: number], opts?: CommandOptions<number, number>);
1562
+ }
1563
+
1564
+ /**
1565
+ * @see https://redis.io/commands/zrevrank
1566
+ */
1567
+ declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
1568
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
1569
+ }
1570
+
1571
+ /**
1572
+ * @see https://redis.io/commands/zscan
1573
+ */
1574
+ declare class ZScanCommand extends Command<[
1575
+ string,
1576
+ (string | number)[]
1577
+ ], [
1578
+ string,
1579
+ (string | number)[]
1580
+ ]> {
1581
+ constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
1582
+ }
1583
+
1584
+ /**
1585
+ * @see https://redis.io/commands/zscore
1586
+ */
1587
+ declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
1588
+ constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
1589
+ }
1590
+
1591
+ type InferResponseData<T extends unknown[]> = {
1592
+ [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1593
+ };
1594
+ /**
1595
+ * Upstash REST API supports command pipelining to send multiple commands in
1596
+ * batch, instead of sending each command one by one and waiting for a response.
1597
+ * When using pipelines, several commands are sent using a single HTTP request,
1598
+ * and a single JSON array response is returned. Each item in the response array
1599
+ * corresponds to the command in the same order within the pipeline.
1600
+ *
1601
+ * **NOTE:**
1602
+ *
1603
+ * Execution of the pipeline is not atomic. Even though each command in
1604
+ * the pipeline will be executed in order, commands sent by other clients can
1605
+ * interleave with the pipeline.
1606
+ *
1607
+ * **Examples:**
1608
+ *
1609
+ * ```ts
1610
+ * const p = redis.pipeline() // or redis.multi()
1611
+ * p.set("key","value")
1612
+ * p.get("key")
1613
+ * const res = await p.exec()
1614
+ * ```
1615
+ *
1616
+ * You can also chain commands together
1617
+ * ```ts
1618
+ * const p = redis.pipeline()
1619
+ * const res = await p.set("key","value").get("key").exec()
1620
+ * ```
1621
+ *
1622
+ * Return types are inferred if all commands are chained, but you can still
1623
+ * override the response type manually:
1624
+ * ```ts
1625
+ * redis.pipeline()
1626
+ * .set("key", { greeting: "hello"})
1627
+ * .get("key")
1628
+ * .exec<["OK", { greeting: string } ]>()
1629
+ *
1630
+ * ```
1631
+ */
1632
+ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1633
+ private client;
1634
+ private commands;
1635
+ private commandOptions?;
1636
+ private multiExec;
1637
+ constructor(opts: {
1638
+ client: Requester;
1639
+ commandOptions?: CommandOptions<any, any>;
1640
+ multiExec?: boolean;
1641
+ });
1642
+ /**
1643
+ * Send the pipeline request to upstash.
1644
+ *
1645
+ * Returns an array with the results of all pipelined commands.
1646
+ *
1647
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1648
+ * ```ts
1649
+ * const p = redis.pipeline()
1650
+ * p.get("key")
1651
+ * const result = p.exec<[{ greeting: string }]>()
1652
+ * ```
1653
+ */
1654
+ exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
1655
+ /**
1656
+ * Returns the length of pipeline before the execution
1657
+ */
1658
+ length(): number;
1659
+ /**
1660
+ * Pushes a command into the pipeline and returns a chainable instance of the
1661
+ * pipeline
1662
+ */
1663
+ private chain;
1664
+ /**
1665
+ * @see https://redis.io/commands/append
1666
+ */
1667
+ append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1668
+ /**
1669
+ * @see https://redis.io/commands/bitcount
1670
+ */
1671
+ bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
1672
+ /**
1673
+ * Returns an instance that can be used to execute `BITFIELD` commands on one key.
1674
+ *
1675
+ * @example
1676
+ * ```typescript
1677
+ * redis.set("mykey", 0);
1678
+ * const result = await redis.pipeline()
1679
+ * .bitfield("mykey")
1680
+ * .set("u4", 0, 16)
1681
+ * .incr("u4", "#1", 1)
1682
+ * .exec();
1683
+ * console.log(result); // [[0, 1]]
1684
+ * ```
1685
+ *
1686
+ * @see https://redis.io/commands/bitfield
1687
+ */
1688
+ bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
1689
+ /**
1690
+ * @see https://redis.io/commands/bitop
1691
+ */
1692
+ bitop: {
1693
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
1694
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
1695
+ };
1696
+ /**
1697
+ * @see https://redis.io/commands/bitpos
1698
+ */
1699
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1700
+ /**
1701
+ * @see https://redis.io/commands/copy
1702
+ */
1703
+ copy: (key: string, destinationKey: string, opts?: {
1704
+ replace: boolean;
1705
+ } | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
1706
+ /**
1707
+ * @see https://redis.io/commands/zdiffstore
1708
+ */
1709
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1710
+ /**
1711
+ * @see https://redis.io/commands/dbsize
1712
+ */
1713
+ dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
1714
+ /**
1715
+ * @see https://redis.io/commands/decr
1716
+ */
1717
+ decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1718
+ /**
1719
+ * @see https://redis.io/commands/decrby
1720
+ */
1721
+ decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
1722
+ /**
1723
+ * @see https://redis.io/commands/del
1724
+ */
1725
+ del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1726
+ /**
1727
+ * @see https://redis.io/commands/echo
1728
+ */
1729
+ echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
1730
+ /**
1731
+ * @see https://redis.io/commands/eval
1732
+ */
1733
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1734
+ /**
1735
+ * @see https://redis.io/commands/evalsha
1736
+ */
1737
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1738
+ /**
1739
+ * @see https://redis.io/commands/exists
1740
+ */
1741
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1742
+ /**
1743
+ * @see https://redis.io/commands/expire
1744
+ */
1745
+ expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1746
+ /**
1747
+ * @see https://redis.io/commands/expireat
1748
+ */
1749
+ expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1750
+ /**
1751
+ * @see https://redis.io/commands/flushall
1752
+ */
1753
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1754
+ /**
1755
+ * @see https://redis.io/commands/flushdb
1756
+ */
1757
+ flushdb: (opts?: {
1758
+ async?: boolean | undefined;
1759
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1760
+ /**
1761
+ * @see https://redis.io/commands/geoadd
1762
+ */
1763
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
1764
+ /**
1765
+ * @see https://redis.io/commands/geodist
1766
+ */
1767
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
1768
+ /**
1769
+ * @see https://redis.io/commands/geopos
1770
+ */
1771
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
1772
+ lng: number;
1773
+ lat: number;
1774
+ }[]>]>;
1775
+ /**
1776
+ * @see https://redis.io/commands/geohash
1777
+ */
1778
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
1779
+ /**
1780
+ * @see https://redis.io/commands/geosearch
1781
+ */
1782
+ geosearch: <TData>(key: string, centerPoint: {
1783
+ type: "FROMLONLAT" | "fromlonlat";
1784
+ coordinate: {
1785
+ lon: number;
1786
+ lat: number;
1787
+ };
1788
+ } | {
1789
+ type: "FROMMEMBER" | "frommember";
1790
+ member: TData;
1791
+ }, shape: {
1792
+ type: "BYRADIUS" | "byradius";
1793
+ radius: number;
1794
+ radiusType: "M" | "KM" | "FT" | "MI";
1795
+ } | {
1796
+ type: "BYBOX" | "bybox";
1797
+ rect: {
1798
+ width: number;
1799
+ height: number;
1800
+ };
1801
+ rectType: "M" | "KM" | "FT" | "MI";
1802
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1803
+ count?: {
1804
+ limit: number;
1805
+ any?: boolean | undefined;
1806
+ } | undefined;
1807
+ withCoord?: boolean | undefined;
1808
+ withDist?: boolean | undefined;
1809
+ withHash?: boolean | undefined;
1810
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
1811
+ member: TData;
1812
+ } & {
1813
+ coord?: {
1814
+ long: number;
1815
+ lat: number;
1816
+ } | undefined;
1817
+ dist?: number | undefined;
1818
+ hash?: string | undefined;
1819
+ })[]>]>;
1820
+ /**
1821
+ * @see https://redis.io/commands/geosearchstore
1822
+ */
1823
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
1824
+ type: "FROMLONLAT" | "fromlonlat";
1825
+ coordinate: {
1826
+ lon: number;
1827
+ lat: number;
1828
+ };
1829
+ } | {
1830
+ type: "FROMMEMBER" | "frommember";
1831
+ member: TData;
1832
+ }, shape: {
1833
+ type: "BYRADIUS" | "byradius";
1834
+ radius: number;
1835
+ radiusType: "M" | "KM" | "FT" | "MI";
1836
+ } | {
1837
+ type: "BYBOX" | "bybox";
1838
+ rect: {
1839
+ width: number;
1840
+ height: number;
1841
+ };
1842
+ rectType: "M" | "KM" | "FT" | "MI";
1843
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1844
+ count?: {
1845
+ limit: number;
1846
+ any?: boolean | undefined;
1847
+ } | undefined;
1848
+ storeDist?: boolean | undefined;
1849
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1850
+ /**
1851
+ * @see https://redis.io/commands/get
1852
+ */
1853
+ get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1854
+ /**
1855
+ * @see https://redis.io/commands/getbit
1856
+ */
1857
+ getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1858
+ /**
1859
+ * @see https://redis.io/commands/getdel
1860
+ */
1861
+ getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1862
+ /**
1863
+ * @see https://redis.io/commands/getrange
1864
+ */
1865
+ getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
1866
+ /**
1867
+ * @see https://redis.io/commands/getset
1868
+ */
1869
+ getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1870
+ /**
1871
+ * @see https://redis.io/commands/hdel
1872
+ */
1873
+ hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1874
+ /**
1875
+ * @see https://redis.io/commands/hexists
1876
+ */
1877
+ hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
1878
+ /**
1879
+ * @see https://redis.io/commands/hget
1880
+ */
1881
+ hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1882
+ /**
1883
+ * @see https://redis.io/commands/hgetall
1884
+ */
1885
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1886
+ /**
1887
+ * @see https://redis.io/commands/hincrby
1888
+ */
1889
+ hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
1890
+ /**
1891
+ * @see https://redis.io/commands/hincrbyfloat
1892
+ */
1893
+ hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
1894
+ /**
1895
+ * @see https://redis.io/commands/hkeys
1896
+ */
1897
+ hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
1898
+ /**
1899
+ * @see https://redis.io/commands/hlen
1900
+ */
1901
+ hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1902
+ /**
1903
+ * @see https://redis.io/commands/hmget
1904
+ */
1905
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1906
+ /**
1907
+ * @see https://redis.io/commands/hmset
1908
+ */
1909
+ hmset: <TData>(key: string, kv: {
1910
+ [field: string]: TData;
1911
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1912
+ /**
1913
+ * @see https://redis.io/commands/hrandfield
1914
+ */
1915
+ hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1916
+ /**
1917
+ * @see https://redis.io/commands/hscan
1918
+ */
1919
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
1920
+ /**
1921
+ * @see https://redis.io/commands/hset
1922
+ */
1923
+ hset: <TData>(key: string, kv: {
1924
+ [field: string]: TData;
1925
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
1926
+ /**
1927
+ * @see https://redis.io/commands/hsetnx
1928
+ */
1929
+ hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1930
+ /**
1931
+ * @see https://redis.io/commands/hstrlen
1932
+ */
1933
+ hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
1934
+ /**
1935
+ * @see https://redis.io/commands/hvals
1936
+ */
1937
+ hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
1938
+ /**
1939
+ * @see https://redis.io/commands/incr
1940
+ */
1941
+ incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1942
+ /**
1943
+ * @see https://redis.io/commands/incrby
1944
+ */
1945
+ incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
1946
+ /**
1947
+ * @see https://redis.io/commands/incrbyfloat
1948
+ */
1949
+ incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
1950
+ /**
1951
+ * @see https://redis.io/commands/keys
1952
+ */
1953
+ keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
1954
+ /**
1955
+ * @see https://redis.io/commands/lindex
1956
+ */
1957
+ lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
1958
+ /**
1959
+ * @see https://redis.io/commands/linsert
1960
+ */
1961
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
1962
+ /**
1963
+ * @see https://redis.io/commands/llen
1964
+ */
1965
+ llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1966
+ /**
1967
+ * @see https://redis.io/commands/lmove
1968
+ */
1969
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
1970
+ /**
1971
+ * @see https://redis.io/commands/lpop
1972
+ */
1973
+ lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1974
+ /**
1975
+ * @see https://redis.io/commands/lmpop
1976
+ */
1977
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
1978
+ /**
1979
+ * @see https://redis.io/commands/lpos
1980
+ */
1981
+ lpos: <TData>(key: string, element: unknown, opts?: {
1982
+ rank?: number | undefined;
1983
+ count?: number | undefined;
1984
+ maxLen?: number | undefined;
1985
+ } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1986
+ /**
1987
+ * @see https://redis.io/commands/lpush
1988
+ */
1989
+ lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1990
+ /**
1991
+ * @see https://redis.io/commands/lpushx
1992
+ */
1993
+ lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
1994
+ /**
1995
+ * @see https://redis.io/commands/lrange
1996
+ */
1997
+ lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
1998
+ /**
1999
+ * @see https://redis.io/commands/lrem
2000
+ */
2001
+ lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2002
+ /**
2003
+ * @see https://redis.io/commands/lset
2004
+ */
2005
+ lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
2006
+ /**
2007
+ * @see https://redis.io/commands/ltrim
2008
+ */
2009
+ ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
2010
+ /**
2011
+ * @see https://redis.io/commands/mget
2012
+ */
2013
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
2014
+ /**
2015
+ * @see https://redis.io/commands/mset
2016
+ */
2017
+ mset: <TData>(kv: {
2018
+ [key: string]: TData;
2019
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2020
+ /**
2021
+ * @see https://redis.io/commands/msetnx
2022
+ */
2023
+ msetnx: <TData>(kv: {
2024
+ [key: string]: TData;
2025
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
2026
+ /**
2027
+ * @see https://redis.io/commands/persist
2028
+ */
2029
+ persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2030
+ /**
2031
+ * @see https://redis.io/commands/pexpire
2032
+ */
2033
+ pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2034
+ /**
2035
+ * @see https://redis.io/commands/pexpireat
2036
+ */
2037
+ pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2038
+ /**
2039
+ * @see https://redis.io/commands/pfadd
2040
+ */
2041
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
2042
+ /**
2043
+ * @see https://redis.io/commands/pfcount
2044
+ */
2045
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2046
+ /**
2047
+ * @see https://redis.io/commands/pfmerge
2048
+ */
2049
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
2050
+ /**
2051
+ * @see https://redis.io/commands/ping
2052
+ */
2053
+ ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
2054
+ /**
2055
+ * @see https://redis.io/commands/psetex
2056
+ */
2057
+ psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
2058
+ /**
2059
+ * @see https://redis.io/commands/pttl
2060
+ */
2061
+ pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2062
+ /**
2063
+ * @see https://redis.io/commands/publish
2064
+ */
2065
+ publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
2066
+ /**
2067
+ * @see https://redis.io/commands/randomkey
2068
+ */
2069
+ randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
2070
+ /**
2071
+ * @see https://redis.io/commands/rename
2072
+ */
2073
+ rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
2074
+ /**
2075
+ * @see https://redis.io/commands/renamenx
2076
+ */
2077
+ renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2078
+ /**
2079
+ * @see https://redis.io/commands/rpop
2080
+ */
2081
+ rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2082
+ /**
2083
+ * @see https://redis.io/commands/rpush
2084
+ */
2085
+ rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2086
+ /**
2087
+ * @see https://redis.io/commands/rpushx
2088
+ */
2089
+ rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2090
+ /**
2091
+ * @see https://redis.io/commands/sadd
2092
+ */
2093
+ sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2094
+ /**
2095
+ * @see https://redis.io/commands/scan
2096
+ */
2097
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
2098
+ /**
2099
+ * @see https://redis.io/commands/scard
2100
+ */
2101
+ scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2102
+ /**
2103
+ * @see https://redis.io/commands/script-exists
2104
+ */
2105
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
2106
+ /**
2107
+ * @see https://redis.io/commands/script-flush
2108
+ */
2109
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
2110
+ /**
2111
+ * @see https://redis.io/commands/script-load
2112
+ */
2113
+ scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
2114
+ sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2115
+ /**
2116
+ * @see https://redis.io/commands/sdiffstore
2117
+ */
2118
+ sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2119
+ /**
2120
+ * @see https://redis.io/commands/set
2121
+ */
2122
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
2123
+ /**
2124
+ * @see https://redis.io/commands/setbit
2125
+ */
2126
+ setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2127
+ /**
2128
+ * @see https://redis.io/commands/setex
2129
+ */
2130
+ setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
2131
+ /**
2132
+ * @see https://redis.io/commands/setnx
2133
+ */
2134
+ setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2135
+ /**
2136
+ * @see https://redis.io/commands/setrange
2137
+ */
2138
+ setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
2139
+ /**
2140
+ * @see https://redis.io/commands/sinter
2141
+ */
2142
+ sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
2143
+ /**
2144
+ * @see https://redis.io/commands/sinterstore
2145
+ */
2146
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2147
+ /**
2148
+ * @see https://redis.io/commands/sismember
2149
+ */
2150
+ sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2151
+ /**
2152
+ * @see https://redis.io/commands/smembers
2153
+ */
2154
+ smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
2155
+ /**
2156
+ * @see https://redis.io/commands/smismember
2157
+ */
2158
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
2159
+ /**
2160
+ * @see https://redis.io/commands/smove
2161
+ */
2162
+ smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2163
+ /**
2164
+ * @see https://redis.io/commands/spop
2165
+ */
2166
+ spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2167
+ /**
2168
+ * @see https://redis.io/commands/srandmember
2169
+ */
2170
+ srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2171
+ /**
2172
+ * @see https://redis.io/commands/srem
2173
+ */
2174
+ srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2175
+ /**
2176
+ * @see https://redis.io/commands/sscan
2177
+ */
2178
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2179
+ /**
2180
+ * @see https://redis.io/commands/strlen
2181
+ */
2182
+ strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2183
+ /**
2184
+ * @see https://redis.io/commands/sunion
2185
+ */
2186
+ sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2187
+ /**
2188
+ * @see https://redis.io/commands/sunionstore
2189
+ */
2190
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2191
+ /**
2192
+ * @see https://redis.io/commands/time
2193
+ */
2194
+ time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
2195
+ /**
2196
+ * @see https://redis.io/commands/touch
2197
+ */
2198
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2199
+ /**
2200
+ * @see https://redis.io/commands/ttl
2201
+ */
2202
+ ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2203
+ /**
2204
+ * @see https://redis.io/commands/type
2205
+ */
2206
+ type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
2207
+ /**
2208
+ * @see https://redis.io/commands/unlink
2209
+ */
2210
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2211
+ /**
2212
+ * @see https://redis.io/commands/zadd
2213
+ */
2214
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
2215
+ key: string,
2216
+ opts: ZAddCommandOptions,
2217
+ ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
2218
+ ]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2219
+ /**
2220
+ * @see https://redis.io/commands/xadd
2221
+ */
2222
+ xadd: (key: string, id: string, entries: {
2223
+ [field: string]: unknown;
2224
+ }, opts?: {
2225
+ nomkStream?: boolean | undefined;
2226
+ trim?: (({
2227
+ type: "MAXLEN" | "maxlen";
2228
+ threshold: number;
2229
+ } | {
2230
+ type: "MINID" | "minid";
2231
+ threshold: string;
2232
+ }) & ({
2233
+ comparison: "~";
2234
+ limit?: number | undefined;
2235
+ } | {
2236
+ comparison: "=";
2237
+ limit?: undefined;
2238
+ })) | undefined;
2239
+ } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2240
+ /**
2241
+ * @see https://redis.io/commands/xack
2242
+ */
2243
+ xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2244
+ /**
2245
+ * @see https://redis.io/commands/xdel
2246
+ */
2247
+ xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2248
+ /**
2249
+ * @see https://redis.io/commands/xgroup
2250
+ */
2251
+ xgroup: (key: string, opts: {
2252
+ type: "CREATE";
2253
+ group: string;
2254
+ id: string;
2255
+ options?: {
2256
+ MKSTREAM?: boolean | undefined;
2257
+ ENTRIESREAD?: number | undefined;
2258
+ } | undefined;
2259
+ } | {
2260
+ type: "CREATECONSUMER";
2261
+ group: string;
2262
+ consumer: string;
2263
+ } | {
2264
+ type: "DELCONSUMER";
2265
+ group: string;
2266
+ consumer: string;
2267
+ } | {
2268
+ type: "DESTROY";
2269
+ group: string;
2270
+ } | {
2271
+ type: "SETID";
2272
+ group: string;
2273
+ id: string;
2274
+ options?: {
2275
+ ENTRIESREAD?: number | undefined;
2276
+ } | undefined;
2277
+ }) => Pipeline<[...TCommands, Command<any, never>]>;
2278
+ /**
2279
+ * @see https://redis.io/commands/xread
2280
+ */
2281
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2282
+ /**
2283
+ * @see https://redis.io/commands/xreadgroup
2284
+ */
2285
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2286
+ /**
2287
+ * @see https://redis.io/commands/xinfo
2288
+ */
2289
+ xinfo: (key: string, options: {
2290
+ type: "CONSUMERS";
2291
+ group: string;
2292
+ } | {
2293
+ type: "GROUPS";
2294
+ }) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2295
+ /**
2296
+ * @see https://redis.io/commands/xlen
2297
+ */
2298
+ xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2299
+ /**
2300
+ * @see https://redis.io/commands/xpending
2301
+ */
2302
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2303
+ idleTime?: number | undefined;
2304
+ consumer?: string | string[] | undefined;
2305
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2306
+ /**
2307
+ * @see https://redis.io/commands/xclaim
2308
+ */
2309
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2310
+ idleMS?: number | undefined;
2311
+ timeMS?: number | undefined;
2312
+ retryCount?: number | undefined;
2313
+ force?: boolean | undefined;
2314
+ justId?: boolean | undefined;
2315
+ lastId?: number | undefined;
2316
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2317
+ /**
2318
+ * @see https://redis.io/commands/xautoclaim
2319
+ */
2320
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2321
+ count?: number | undefined;
2322
+ justId?: boolean | undefined;
2323
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2324
+ /**
2325
+ * @see https://redis.io/commands/xtrim
2326
+ */
2327
+ xtrim: (key: string, options: {
2328
+ strategy: "MAXLEN" | "MINID";
2329
+ exactness?: "~" | "=" | undefined;
2330
+ threshold: string | number;
2331
+ limit?: number | undefined;
2332
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
2333
+ /**
2334
+ * @see https://redis.io/commands/xrange
2335
+ */
2336
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2337
+ /**
2338
+ * @see https://redis.io/commands/xrevrange
2339
+ */
2340
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2341
+ /**
2342
+ * @see https://redis.io/commands/zcard
2343
+ */
2344
+ zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2345
+ /**
2346
+ * @see https://redis.io/commands/zcount
2347
+ */
2348
+ zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
2349
+ /**
2350
+ * @see https://redis.io/commands/zincrby
2351
+ */
2352
+ zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2353
+ /**
2354
+ * @see https://redis.io/commands/zinterstore
2355
+ */
2356
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2357
+ /**
2358
+ * @see https://redis.io/commands/zlexcount
2359
+ */
2360
+ zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2361
+ /**
2362
+ * @see https://redis.io/commands/zmscore
2363
+ */
2364
+ zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
2365
+ /**
2366
+ * @see https://redis.io/commands/zpopmax
2367
+ */
2368
+ zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2369
+ /**
2370
+ * @see https://redis.io/commands/zpopmin
2371
+ */
2372
+ zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2373
+ /**
2374
+ * @see https://redis.io/commands/zrange
2375
+ */
2376
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2377
+ key: string,
2378
+ min: `(${string}` | `[${string}` | "-" | "+",
2379
+ max: `(${string}` | `[${string}` | "-" | "+",
2380
+ opts: {
2381
+ byLex: true;
2382
+ } & ZRangeCommandOptions
2383
+ ] | [
2384
+ key: string,
2385
+ min: number | `(${number}` | "-inf" | "+inf",
2386
+ max: number | `(${number}` | "-inf" | "+inf",
2387
+ opts: {
2388
+ byScore: true;
2389
+ } & ZRangeCommandOptions
2390
+ ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2391
+ /**
2392
+ * @see https://redis.io/commands/zrank
2393
+ */
2394
+ zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2395
+ /**
2396
+ * @see https://redis.io/commands/zrem
2397
+ */
2398
+ zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2399
+ /**
2400
+ * @see https://redis.io/commands/zremrangebylex
2401
+ */
2402
+ zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2403
+ /**
2404
+ * @see https://redis.io/commands/zremrangebyrank
2405
+ */
2406
+ zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
2407
+ /**
2408
+ * @see https://redis.io/commands/zremrangebyscore
2409
+ */
2410
+ zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
2411
+ /**
2412
+ * @see https://redis.io/commands/zrevrank
2413
+ */
2414
+ zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2415
+ /**
2416
+ * @see https://redis.io/commands/zscan
2417
+ */
2418
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2419
+ /**
2420
+ * @see https://redis.io/commands/zscore
2421
+ */
2422
+ zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2423
+ /**
2424
+ * @see https://redis.io/commands/zunionstore
2425
+ */
2426
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2427
+ /**
2428
+ * @see https://redis.io/commands/zunion
2429
+ */
2430
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2431
+ /**
2432
+ * @see https://redis.io/commands/?group=json
2433
+ */
2434
+ get json(): {
2435
+ /**
2436
+ * @see https://redis.io/commands/json.arrappend
2437
+ */
2438
+ arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2439
+ /**
2440
+ * @see https://redis.io/commands/json.arrindex
2441
+ */
2442
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2443
+ /**
2444
+ * @see https://redis.io/commands/json.arrinsert
2445
+ */
2446
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2447
+ /**
2448
+ * @see https://redis.io/commands/json.arrlen
2449
+ */
2450
+ arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2451
+ /**
2452
+ * @see https://redis.io/commands/json.arrpop
2453
+ */
2454
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2455
+ /**
2456
+ * @see https://redis.io/commands/json.arrtrim
2457
+ */
2458
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2459
+ /**
2460
+ * @see https://redis.io/commands/json.clear
2461
+ */
2462
+ clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2463
+ /**
2464
+ * @see https://redis.io/commands/json.del
2465
+ */
2466
+ del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2467
+ /**
2468
+ * @see https://redis.io/commands/json.forget
2469
+ */
2470
+ forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2471
+ /**
2472
+ * @see https://redis.io/commands/json.get
2473
+ */
2474
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
2475
+ /**
2476
+ * @see https://redis.io/commands/json.mget
2477
+ */
2478
+ mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2479
+ /**
2480
+ * @see https://redis.io/commands/json.numincrby
2481
+ */
2482
+ numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2483
+ /**
2484
+ * @see https://redis.io/commands/json.nummultby
2485
+ */
2486
+ nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2487
+ /**
2488
+ * @see https://redis.io/commands/json.objkeys
2489
+ */
2490
+ objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
2491
+ /**
2492
+ * @see https://redis.io/commands/json.objlen
2493
+ */
2494
+ objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2495
+ /**
2496
+ * @see https://redis.io/commands/json.resp
2497
+ */
2498
+ resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2499
+ /**
2500
+ * @see https://redis.io/commands/json.set
2501
+ */
2502
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2503
+ nx: true;
2504
+ xx?: undefined;
2505
+ } | {
2506
+ nx?: undefined;
2507
+ xx: true;
2508
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2509
+ /**
2510
+ * @see https://redis.io/commands/json.strappend
2511
+ */
2512
+ strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2513
+ /**
2514
+ * @see https://redis.io/commands/json.strlen
2515
+ */
2516
+ strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2517
+ /**
2518
+ * @see https://redis.io/commands/json.toggle
2519
+ */
2520
+ toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
2521
+ /**
2522
+ * @see https://redis.io/commands/json.type
2523
+ */
2524
+ type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
2525
+ };
2526
+ }
2527
+
2528
+ /**
2529
+ * Creates a new script.
2530
+ *
2531
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
2532
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
2533
+ * the entire script. Afterwards, the script is cached on the server.
2534
+ *
2535
+ * @example
2536
+ * ```ts
2537
+ * const redis = new Redis({...})
2538
+ *
2539
+ * const script = redis.createScript<string>("return ARGV[1];")
2540
+ * const arg1 = await script.eval([], ["Hello World"])
2541
+ * expect(arg1, "Hello World")
2542
+ * ```
2543
+ */
2544
+ declare class Script<TResult = unknown> {
2545
+ readonly script: string;
2546
+ readonly sha1: string;
2547
+ private readonly redis;
2548
+ constructor(redis: Redis, script: string);
2549
+ /**
2550
+ * Send an `EVAL` command to redis.
2551
+ */
2552
+ eval(keys: string[], args: string[]): Promise<TResult>;
2553
+ /**
2554
+ * Calculates the sha1 hash of the script and then calls `EVALSHA`.
2555
+ */
2556
+ evalsha(keys: string[], args: string[]): Promise<TResult>;
2557
+ /**
2558
+ * Optimistically try to run `EVALSHA` first.
2559
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL`.
2560
+ *
2561
+ * Following calls will be able to use the cached script
2562
+ */
2563
+ exec(keys: string[], args: string[]): Promise<TResult>;
2564
+ /**
2565
+ * Compute the sha1 hash of the script and return its hex representation.
2566
+ */
2567
+ private digest;
2568
+ }
2569
+
2570
+ /**
2571
+ * Serverless redis client for upstash.
2572
+ */
2573
+ declare class Redis {
2574
+ protected client: Requester;
2575
+ protected opts?: CommandOptions<any, any>;
2576
+ protected enableTelemetry: boolean;
2577
+ protected enableAutoPipelining: boolean;
2578
+ /**
2579
+ * Create a new redis client
2580
+ *
2581
+ * @example
2582
+ * ```typescript
2583
+ * const redis = new Redis({
2584
+ * url: "<UPSTASH_REDIS_REST_URL>",
2585
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
2586
+ * });
2587
+ * ```
2588
+ */
2589
+ constructor(client: Requester, opts?: RedisOptions);
2590
+ get json(): {
2591
+ /**
2592
+ * @see https://redis.io/commands/json.arrappend
2593
+ */
2594
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
2595
+ /**
2596
+ * @see https://redis.io/commands/json.arrindex
2597
+ */
2598
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2599
+ /**
2600
+ * @see https://redis.io/commands/json.arrinsert
2601
+ */
2602
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
2603
+ /**
2604
+ * @see https://redis.io/commands/json.arrlen
2605
+ */
2606
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2607
+ /**
2608
+ * @see https://redis.io/commands/json.arrpop
2609
+ */
2610
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
2611
+ /**
2612
+ * @see https://redis.io/commands/json.arrtrim
2613
+ */
2614
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2615
+ /**
2616
+ * @see https://redis.io/commands/json.clear
2617
+ */
2618
+ clear: (key: string, path?: string | undefined) => Promise<number>;
2619
+ /**
2620
+ * @see https://redis.io/commands/json.del
2621
+ */
2622
+ del: (key: string, path?: string | undefined) => Promise<number>;
2623
+ /**
2624
+ * @see https://redis.io/commands/json.forget
2625
+ */
2626
+ forget: (key: string, path?: string | undefined) => Promise<number>;
2627
+ /**
2628
+ * @see https://redis.io/commands/json.get
2629
+ */
2630
+ get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
2631
+ /**
2632
+ * @see https://redis.io/commands/json.mget
2633
+ */
2634
+ mget: <TData_1>(keys: string[], path: string) => Promise<TData_1>;
2635
+ /**
2636
+ * @see https://redis.io/commands/json.numincrby
2637
+ */
2638
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2639
+ /**
2640
+ * @see https://redis.io/commands/json.nummultby
2641
+ */
2642
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2643
+ /**
2644
+ * @see https://redis.io/commands/json.objkeys
2645
+ */
2646
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
2647
+ /**
2648
+ * @see https://redis.io/commands/json.objlen
2649
+ */
2650
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2651
+ /**
2652
+ * @see https://redis.io/commands/json.resp
2653
+ */
2654
+ resp: (key: string, path?: string | undefined) => Promise<any>;
2655
+ /**
2656
+ * @see https://redis.io/commands/json.set
2657
+ */
2658
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2659
+ nx: true;
2660
+ xx?: undefined;
2661
+ } | {
2662
+ nx?: undefined;
2663
+ xx: true;
2664
+ } | undefined) => Promise<"OK" | null>;
2665
+ /**
2666
+ * @see https://redis.io/commands/json.strappend
2667
+ */
2668
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
2669
+ /**
2670
+ * @see https://redis.io/commands/json.strlen
2671
+ */
2672
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2673
+ /**
2674
+ * @see https://redis.io/commands/json.toggle
2675
+ */
2676
+ toggle: (key: string, path: string) => Promise<number[]>;
2677
+ /**
2678
+ * @see https://redis.io/commands/json.type
2679
+ */
2680
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
2681
+ };
2682
+ /**
2683
+ * Wrap a new middleware around the HTTP client.
2684
+ */
2685
+ use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
2686
+ /**
2687
+ * Technically this is not private, we can hide it from intellisense by doing this
2688
+ */
2689
+ protected addTelemetry: (telemetry: Telemetry) => void;
2690
+ createScript(script: string): Script;
2691
+ /**
2692
+ * Create a new pipeline that allows you to send requests in bulk.
2693
+ *
2694
+ * @see {@link Pipeline}
2695
+ */
2696
+ pipeline: () => Pipeline<[]>;
2697
+ protected autoPipeline: () => Redis;
2698
+ /**
2699
+ * Create a new transaction to allow executing multiple steps atomically.
2700
+ *
2701
+ * All the commands in a transaction are serialized and executed sequentially. A request sent by
2702
+ * another client will never be served in the middle of the execution of a Redis Transaction. This
2703
+ * guarantees that the commands are executed as a single isolated operation.
2704
+ *
2705
+ * @see {@link Pipeline}
2706
+ */
2707
+ multi: () => Pipeline<[]>;
2708
+ /**
2709
+ * Returns an instance that can be used to execute `BITFIELD` commands on one key.
2710
+ *
2711
+ * @example
2712
+ * ```typescript
2713
+ * redis.set("mykey", 0);
2714
+ * const result = await redis.bitfield("mykey")
2715
+ * .set("u4", 0, 16)
2716
+ * .incr("u4", "#1", 1)
2717
+ * .exec();
2718
+ * console.log(result); // [0, 1]
2719
+ * ```
2720
+ *
2721
+ * @see https://redis.io/commands/bitfield
2722
+ */
2723
+ bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
2724
+ /**
2725
+ * @see https://redis.io/commands/append
2726
+ */
2727
+ append: (key: string, value: string) => Promise<number>;
2728
+ /**
2729
+ * @see https://redis.io/commands/bitcount
2730
+ */
2731
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
2732
+ /**
2733
+ * @see https://redis.io/commands/bitop
2734
+ */
2735
+ bitop: {
2736
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
2737
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
2738
+ };
2739
+ /**
2740
+ * @see https://redis.io/commands/bitpos
2741
+ */
2742
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
2743
+ /**
2744
+ * @see https://redis.io/commands/copy
2745
+ */
2746
+ copy: (key: string, destinationKey: string, opts?: {
2747
+ replace: boolean;
2748
+ } | undefined) => Promise<"COPIED" | "NOT_COPIED">;
2749
+ /**
2750
+ * @see https://redis.io/commands/dbsize
2751
+ */
2752
+ dbsize: () => Promise<number>;
2753
+ /**
2754
+ * @see https://redis.io/commands/decr
2755
+ */
2756
+ decr: (key: string) => Promise<number>;
2757
+ /**
2758
+ * @see https://redis.io/commands/decrby
2759
+ */
2760
+ decrby: (key: string, decrement: number) => Promise<number>;
2761
+ /**
2762
+ * @see https://redis.io/commands/del
2763
+ */
2764
+ del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
2765
+ /**
2766
+ * @see https://redis.io/commands/echo
2767
+ */
2768
+ echo: (message: string) => Promise<string>;
2769
+ /**
2770
+ * @see https://redis.io/commands/eval
2771
+ */
2772
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
2773
+ /**
2774
+ * @see https://redis.io/commands/evalsha
2775
+ */
2776
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
2777
+ /**
2778
+ * @see https://redis.io/commands/exists
2779
+ */
2780
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
2781
+ /**
2782
+ * @see https://redis.io/commands/expire
2783
+ */
2784
+ expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Promise<0 | 1>;
2785
+ /**
2786
+ * @see https://redis.io/commands/expireat
2787
+ */
2788
+ expireat: (key: string, unix: number) => Promise<0 | 1>;
2789
+ /**
2790
+ * @see https://redis.io/commands/flushall
2791
+ */
2792
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
2793
+ /**
2794
+ * @see https://redis.io/commands/flushdb
2795
+ */
2796
+ flushdb: (opts?: {
2797
+ async?: boolean | undefined;
2798
+ } | undefined) => Promise<"OK">;
2799
+ /**
2800
+ * @see https://redis.io/commands/geoadd
2801
+ */
2802
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
2803
+ /**
2804
+ * @see https://redis.io/commands/geopos
2805
+ */
2806
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
2807
+ lng: number;
2808
+ lat: number;
2809
+ }[]>;
2810
+ /**
2811
+ * @see https://redis.io/commands/geodist
2812
+ */
2813
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2814
+ /**
2815
+ * @see https://redis.io/commands/geohash
2816
+ */
2817
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
2818
+ /**
2819
+ * @see https://redis.io/commands/geosearch
2820
+ */
2821
+ geosearch: <TData>(key: string, centerPoint: {
2822
+ type: "FROMLONLAT" | "fromlonlat";
2823
+ coordinate: {
2824
+ lon: number;
2825
+ lat: number;
2826
+ };
2827
+ } | {
2828
+ type: "FROMMEMBER" | "frommember";
2829
+ member: TData;
2830
+ }, shape: {
2831
+ type: "BYRADIUS" | "byradius";
2832
+ radius: number;
2833
+ radiusType: "M" | "KM" | "FT" | "MI";
2834
+ } | {
2835
+ type: "BYBOX" | "bybox";
2836
+ rect: {
2837
+ width: number;
2838
+ height: number;
2839
+ };
2840
+ rectType: "M" | "KM" | "FT" | "MI";
2841
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2842
+ count?: {
2843
+ limit: number;
2844
+ any?: boolean | undefined;
2845
+ } | undefined;
2846
+ withCoord?: boolean | undefined;
2847
+ withDist?: boolean | undefined;
2848
+ withHash?: boolean | undefined;
2849
+ } | undefined) => Promise<({
2850
+ member: TData;
2851
+ } & {
2852
+ coord?: {
2853
+ long: number;
2854
+ lat: number;
2855
+ } | undefined;
2856
+ dist?: number | undefined;
2857
+ hash?: string | undefined;
2858
+ })[]>;
2859
+ /**
2860
+ * @see https://redis.io/commands/geosearchstore
2861
+ */
2862
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
2863
+ type: "FROMLONLAT" | "fromlonlat";
2864
+ coordinate: {
2865
+ lon: number;
2866
+ lat: number;
2867
+ };
2868
+ } | {
2869
+ type: "FROMMEMBER" | "frommember";
2870
+ member: TData;
2871
+ }, shape: {
2872
+ type: "BYRADIUS" | "byradius";
2873
+ radius: number;
2874
+ radiusType: "M" | "KM" | "FT" | "MI";
2875
+ } | {
2876
+ type: "BYBOX" | "bybox";
2877
+ rect: {
2878
+ width: number;
2879
+ height: number;
2880
+ };
2881
+ rectType: "M" | "KM" | "FT" | "MI";
2882
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2883
+ count?: {
2884
+ limit: number;
2885
+ any?: boolean | undefined;
2886
+ } | undefined;
2887
+ storeDist?: boolean | undefined;
2888
+ } | undefined) => Promise<number>;
2889
+ /**
2890
+ * @see https://redis.io/commands/get
2891
+ */
2892
+ get: <TData>(key: string) => Promise<TData | null>;
2893
+ /**
2894
+ * @see https://redis.io/commands/getbit
2895
+ */
2896
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
2897
+ /**
2898
+ * @see https://redis.io/commands/getdel
2899
+ */
2900
+ getdel: <TData>(key: string) => Promise<TData | null>;
2901
+ /**
2902
+ * @see https://redis.io/commands/getrange
2903
+ */
2904
+ getrange: (key: string, start: number, end: number) => Promise<string>;
2905
+ /**
2906
+ * @see https://redis.io/commands/getset
2907
+ */
2908
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
2909
+ /**
2910
+ * @see https://redis.io/commands/hdel
2911
+ */
2912
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
2913
+ /**
2914
+ * @see https://redis.io/commands/hexists
2915
+ */
2916
+ hexists: (key: string, field: string) => Promise<number>;
2917
+ /**
2918
+ * @see https://redis.io/commands/hget
2919
+ */
2920
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
2921
+ /**
2922
+ * @see https://redis.io/commands/hgetall
2923
+ */
2924
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
2925
+ /**
2926
+ * @see https://redis.io/commands/hincrby
2927
+ */
2928
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
2929
+ /**
2930
+ * @see https://redis.io/commands/hincrbyfloat
2931
+ */
2932
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
2933
+ /**
2934
+ * @see https://redis.io/commands/hkeys
2935
+ */
2936
+ hkeys: (key: string) => Promise<string[]>;
2937
+ /**
2938
+ * @see https://redis.io/commands/hlen
2939
+ */
2940
+ hlen: (key: string) => Promise<number>;
2941
+ /**
2942
+ * @see https://redis.io/commands/hmget
2943
+ */
2944
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
2945
+ /**
2946
+ * @see https://redis.io/commands/hmset
2947
+ */
2948
+ hmset: <TData>(key: string, kv: {
2949
+ [field: string]: TData;
2950
+ }) => Promise<"OK">;
2951
+ /**
2952
+ * @see https://redis.io/commands/hrandfield
2953
+ */
2954
+ hrandfield: {
2955
+ (key: string): Promise<string | null>;
2956
+ (key: string, count: number): Promise<string[]>;
2957
+ <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
2958
+ };
2959
+ /**
2960
+ * @see https://redis.io/commands/hscan
2961
+ */
2962
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
2963
+ /**
2964
+ * @see https://redis.io/commands/hset
2965
+ */
2966
+ hset: <TData>(key: string, kv: {
2967
+ [field: string]: TData;
2968
+ }) => Promise<number>;
2969
+ /**
2970
+ * @see https://redis.io/commands/hsetnx
2971
+ */
2972
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
2973
+ /**
2974
+ * @see https://redis.io/commands/hstrlen
2975
+ */
2976
+ hstrlen: (key: string, field: string) => Promise<number>;
2977
+ /**
2978
+ * @see https://redis.io/commands/hvals
2979
+ */
2980
+ hvals: (key: string) => Promise<any>;
2981
+ /**
2982
+ * @see https://redis.io/commands/incr
2983
+ */
2984
+ incr: (key: string) => Promise<number>;
2985
+ /**
2986
+ * @see https://redis.io/commands/incrby
2987
+ */
2988
+ incrby: (key: string, value: number) => Promise<number>;
2989
+ /**
2990
+ * @see https://redis.io/commands/incrbyfloat
2991
+ */
2992
+ incrbyfloat: (key: string, value: number) => Promise<number>;
2993
+ /**
2994
+ * @see https://redis.io/commands/keys
2995
+ */
2996
+ keys: (pattern: string) => Promise<string[]>;
2997
+ /**
2998
+ * @see https://redis.io/commands/lindex
2999
+ */
3000
+ lindex: (key: string, index: number) => Promise<any>;
3001
+ /**
3002
+ * @see https://redis.io/commands/linsert
3003
+ */
3004
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
3005
+ /**
3006
+ * @see https://redis.io/commands/llen
3007
+ */
3008
+ llen: (key: string) => Promise<number>;
3009
+ /**
3010
+ * @see https://redis.io/commands/lmove
3011
+ */
3012
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
3013
+ /**
3014
+ * @see https://redis.io/commands/lpop
3015
+ */
3016
+ lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3017
+ /**
3018
+ * @see https://redis.io/commands/lmpop
3019
+ */
3020
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
3021
+ /**
3022
+ * @see https://redis.io/commands/lpos
3023
+ */
3024
+ lpos: <TData = number>(key: string, element: unknown, opts?: {
3025
+ rank?: number | undefined;
3026
+ count?: number | undefined;
3027
+ maxLen?: number | undefined;
3028
+ } | undefined) => Promise<TData>;
3029
+ /**
3030
+ * @see https://redis.io/commands/lpush
3031
+ */
3032
+ lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3033
+ /**
3034
+ * @see https://redis.io/commands/lpushx
3035
+ */
3036
+ lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3037
+ /**
3038
+ * @see https://redis.io/commands/lrange
3039
+ */
3040
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
3041
+ /**
3042
+ * @see https://redis.io/commands/lrem
3043
+ */
3044
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
3045
+ /**
3046
+ * @see https://redis.io/commands/lset
3047
+ */
3048
+ lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
3049
+ /**
3050
+ * @see https://redis.io/commands/ltrim
3051
+ */
3052
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
3053
+ /**
3054
+ * @see https://redis.io/commands/mget
3055
+ */
3056
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
3057
+ /**
3058
+ * @see https://redis.io/commands/mset
3059
+ */
3060
+ mset: <TData>(kv: {
3061
+ [key: string]: TData;
3062
+ }) => Promise<"OK">;
3063
+ /**
3064
+ * @see https://redis.io/commands/msetnx
3065
+ */
3066
+ msetnx: <TData>(kv: {
3067
+ [key: string]: TData;
3068
+ }) => Promise<number>;
3069
+ /**
3070
+ * @see https://redis.io/commands/persist
3071
+ */
3072
+ persist: (key: string) => Promise<0 | 1>;
3073
+ /**
3074
+ * @see https://redis.io/commands/pexpire
3075
+ */
3076
+ pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
3077
+ /**
3078
+ * @see https://redis.io/commands/pexpireat
3079
+ */
3080
+ pexpireat: (key: string, unix: number) => Promise<0 | 1>;
3081
+ /**
3082
+ * @see https://redis.io/commands/pfadd
3083
+ */
3084
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
3085
+ /**
3086
+ * @see https://redis.io/commands/pfcount
3087
+ */
3088
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
3089
+ /**
3090
+ * @see https://redis.io/commands/pfmerge
3091
+ */
3092
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
3093
+ /**
3094
+ * @see https://redis.io/commands/ping
3095
+ */
3096
+ ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
3097
+ /**
3098
+ * @see https://redis.io/commands/psetex
3099
+ */
3100
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
3101
+ /**
3102
+ * @see https://redis.io/commands/pttl
3103
+ */
3104
+ pttl: (key: string) => Promise<number>;
3105
+ /**
3106
+ * @see https://redis.io/commands/publish
3107
+ */
3108
+ publish: (channel: string, message: unknown) => Promise<number>;
3109
+ /**
3110
+ * @see https://redis.io/commands/randomkey
3111
+ */
3112
+ randomkey: () => Promise<string | null>;
3113
+ /**
3114
+ * @see https://redis.io/commands/rename
3115
+ */
3116
+ rename: (source: string, destination: string) => Promise<"OK">;
3117
+ /**
3118
+ * @see https://redis.io/commands/renamenx
3119
+ */
3120
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
3121
+ /**
3122
+ * @see https://redis.io/commands/rpop
3123
+ */
3124
+ rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
3125
+ /**
3126
+ * @see https://redis.io/commands/rpush
3127
+ */
3128
+ rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3129
+ /**
3130
+ * @see https://redis.io/commands/rpushx
3131
+ */
3132
+ rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3133
+ /**
3134
+ * @see https://redis.io/commands/sadd
3135
+ */
3136
+ sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
3137
+ /**
3138
+ * @see https://redis.io/commands/scan
3139
+ */
3140
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
3141
+ /**
3142
+ * @see https://redis.io/commands/scard
3143
+ */
3144
+ scard: (key: string) => Promise<number>;
3145
+ /**
3146
+ * @see https://redis.io/commands/script-exists
3147
+ */
3148
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
3149
+ /**
3150
+ * @see https://redis.io/commands/script-flush
3151
+ */
3152
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
3153
+ /**
3154
+ * @see https://redis.io/commands/script-load
3155
+ */
3156
+ scriptLoad: (script: string) => Promise<string>;
3157
+ /**
3158
+ * @see https://redis.io/commands/sdiff
3159
+ */
3160
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
3161
+ /**
3162
+ * @see https://redis.io/commands/sdiffstore
3163
+ */
3164
+ sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
3165
+ /**
3166
+ * @see https://redis.io/commands/set
3167
+ */
3168
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
3169
+ /**
3170
+ * @see https://redis.io/commands/setbit
3171
+ */
3172
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
3173
+ /**
3174
+ * @see https://redis.io/commands/setex
3175
+ */
3176
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
3177
+ /**
3178
+ * @see https://redis.io/commands/setnx
3179
+ */
3180
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
3181
+ /**
3182
+ * @see https://redis.io/commands/setrange
3183
+ */
3184
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
3185
+ /**
3186
+ * @see https://redis.io/commands/sinter
3187
+ */
3188
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
3189
+ /**
3190
+ * @see https://redis.io/commands/sinterstore
3191
+ */
3192
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3193
+ /**
3194
+ * @see https://redis.io/commands/sismember
3195
+ */
3196
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
3197
+ /**
3198
+ * @see https://redis.io/commands/smismember
3199
+ */
3200
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
3201
+ /**
3202
+ * @see https://redis.io/commands/smembers
3203
+ */
3204
+ smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
3205
+ /**
3206
+ * @see https://redis.io/commands/smove
3207
+ */
3208
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
3209
+ /**
3210
+ * @see https://redis.io/commands/spop
3211
+ */
3212
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3213
+ /**
3214
+ * @see https://redis.io/commands/srandmember
3215
+ */
3216
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3217
+ /**
3218
+ * @see https://redis.io/commands/srem
3219
+ */
3220
+ srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3221
+ /**
3222
+ * @see https://redis.io/commands/sscan
3223
+ */
3224
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3225
+ /**
3226
+ * @see https://redis.io/commands/strlen
3227
+ */
3228
+ strlen: (key: string) => Promise<number>;
3229
+ /**
3230
+ * @see https://redis.io/commands/sunion
3231
+ */
3232
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
3233
+ /**
3234
+ * @see https://redis.io/commands/sunionstore
3235
+ */
3236
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3237
+ /**
3238
+ * @see https://redis.io/commands/time
3239
+ */
3240
+ time: () => Promise<[number, number]>;
3241
+ /**
3242
+ * @see https://redis.io/commands/touch
3243
+ */
3244
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
3245
+ /**
3246
+ * @see https://redis.io/commands/ttl
3247
+ */
3248
+ ttl: (key: string) => Promise<number>;
3249
+ /**
3250
+ * @see https://redis.io/commands/type
3251
+ */
3252
+ type: (key: string) => Promise<Type>;
3253
+ /**
3254
+ * @see https://redis.io/commands/unlink
3255
+ */
3256
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
3257
+ /**
3258
+ * @see https://redis.io/commands/xadd
3259
+ */
3260
+ xadd: (key: string, id: string, entries: {
3261
+ [field: string]: unknown;
3262
+ }, opts?: {
3263
+ nomkStream?: boolean | undefined;
3264
+ trim?: (({
3265
+ type: "MAXLEN" | "maxlen";
3266
+ threshold: number;
3267
+ } | {
3268
+ type: "MINID" | "minid";
3269
+ threshold: string;
3270
+ }) & ({
3271
+ comparison: "~";
3272
+ limit?: number | undefined;
3273
+ } | {
3274
+ comparison: "=";
3275
+ limit?: undefined;
3276
+ })) | undefined;
3277
+ } | undefined) => Promise<string>;
3278
+ /**
3279
+ * @see https://redis.io/commands/xack
3280
+ */
3281
+ xack: (key: string, group: string, id: string | string[]) => Promise<number>;
3282
+ /**
3283
+ * @see https://redis.io/commands/xdel
3284
+ */
3285
+ xdel: (key: string, ids: string | string[]) => Promise<number>;
3286
+ /**
3287
+ * @see https://redis.io/commands/xgroup
3288
+ */
3289
+ xgroup: (key: string, opts: {
3290
+ type: "CREATE";
3291
+ group: string;
3292
+ id: string;
3293
+ options?: {
3294
+ MKSTREAM?: boolean | undefined;
3295
+ ENTRIESREAD?: number | undefined;
3296
+ } | undefined;
3297
+ } | {
3298
+ type: "CREATECONSUMER";
3299
+ group: string;
3300
+ consumer: string;
3301
+ } | {
3302
+ type: "DELCONSUMER";
3303
+ group: string;
3304
+ consumer: string;
3305
+ } | {
3306
+ type: "DESTROY";
3307
+ group: string;
3308
+ } | {
3309
+ type: "SETID";
3310
+ group: string;
3311
+ id: string;
3312
+ options?: {
3313
+ ENTRIESREAD?: number | undefined;
3314
+ } | undefined;
3315
+ }) => Promise<never>;
3316
+ /**
3317
+ * @see https://redis.io/commands/xread
3318
+ */
3319
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
3320
+ /**
3321
+ * @see https://redis.io/commands/xreadgroup
3322
+ */
3323
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
3324
+ /**
3325
+ * @see https://redis.io/commands/xinfo
3326
+ */
3327
+ xinfo: (key: string, options: {
3328
+ type: "CONSUMERS";
3329
+ group: string;
3330
+ } | {
3331
+ type: "GROUPS";
3332
+ }) => Promise<unknown[]>;
3333
+ /**
3334
+ * @see https://redis.io/commands/xlen
3335
+ */
3336
+ xlen: (key: string) => Promise<number>;
3337
+ /**
3338
+ * @see https://redis.io/commands/xpending
3339
+ */
3340
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3341
+ idleTime?: number | undefined;
3342
+ consumer?: string | string[] | undefined;
3343
+ } | undefined) => Promise<unknown[]>;
3344
+ /**
3345
+ * @see https://redis.io/commands/xclaim
3346
+ */
3347
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3348
+ idleMS?: number | undefined;
3349
+ timeMS?: number | undefined;
3350
+ retryCount?: number | undefined;
3351
+ force?: boolean | undefined;
3352
+ justId?: boolean | undefined;
3353
+ lastId?: number | undefined;
3354
+ } | undefined) => Promise<unknown[]>;
3355
+ /**
3356
+ * @see https://redis.io/commands/xautoclaim
3357
+ */
3358
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3359
+ count?: number | undefined;
3360
+ justId?: boolean | undefined;
3361
+ } | undefined) => Promise<unknown[]>;
3362
+ /**
3363
+ * @see https://redis.io/commands/xtrim
3364
+ */
3365
+ xtrim: (key: string, options: {
3366
+ strategy: "MAXLEN" | "MINID";
3367
+ exactness?: "~" | "=" | undefined;
3368
+ threshold: string | number;
3369
+ limit?: number | undefined;
3370
+ }) => Promise<number>;
3371
+ /**
3372
+ * @see https://redis.io/commands/xrange
3373
+ */
3374
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3375
+ /**
3376
+ * @see https://redis.io/commands/xrevrange
3377
+ */
3378
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3379
+ /**
3380
+ * @see https://redis.io/commands/zadd
3381
+ */
3382
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
3383
+ key: string,
3384
+ opts: ZAddCommandOptions,
3385
+ ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
3386
+ ]) => Promise<number | null>;
3387
+ /**
3388
+ * @see https://redis.io/commands/zcard
3389
+ */
3390
+ zcard: (key: string) => Promise<number>;
3391
+ /**
3392
+ * @see https://redis.io/commands/zcount
3393
+ */
3394
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
3395
+ /**
3396
+ * @see https://redis.io/commands/zdiffstore
3397
+ */
3398
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
3399
+ /**
3400
+ * @see https://redis.io/commands/zincrby
3401
+ */
3402
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
3403
+ /**
3404
+ * @see https://redis.io/commands/zinterstore
3405
+ */
3406
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
3407
+ /**
3408
+ * @see https://redis.io/commands/zlexcount
3409
+ */
3410
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
3411
+ /**
3412
+ * @see https://redis.io/commands/zmscore
3413
+ */
3414
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
3415
+ /**
3416
+ * @see https://redis.io/commands/zpopmax
3417
+ */
3418
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3419
+ /**
3420
+ * @see https://redis.io/commands/zpopmin
3421
+ */
3422
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3423
+ /**
3424
+ * @see https://redis.io/commands/zrange
3425
+ */
3426
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3427
+ key: string,
3428
+ min: `(${string}` | `[${string}` | "-" | "+",
3429
+ max: `(${string}` | `[${string}` | "-" | "+",
3430
+ opts: {
3431
+ byLex: true;
3432
+ } & ZRangeCommandOptions
3433
+ ] | [
3434
+ key: string,
3435
+ min: number | `(${number}` | "-inf" | "+inf",
3436
+ max: number | `(${number}` | "-inf" | "+inf",
3437
+ opts: {
3438
+ byScore: true;
3439
+ } & ZRangeCommandOptions
3440
+ ]) => Promise<TData>;
3441
+ /**
3442
+ * @see https://redis.io/commands/zrank
3443
+ */
3444
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
3445
+ /**
3446
+ * @see https://redis.io/commands/zrem
3447
+ */
3448
+ zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3449
+ /**
3450
+ * @see https://redis.io/commands/zremrangebylex
3451
+ */
3452
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
3453
+ /**
3454
+ * @see https://redis.io/commands/zremrangebyrank
3455
+ */
3456
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
3457
+ /**
3458
+ * @see https://redis.io/commands/zremrangebyscore
3459
+ */
3460
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
3461
+ /**
3462
+ * @see https://redis.io/commands/zrevrank
3463
+ */
3464
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
3465
+ /**
3466
+ * @see https://redis.io/commands/zscan
3467
+ */
3468
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3469
+ /**
3470
+ * @see https://redis.io/commands/zscore
3471
+ */
3472
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
3473
+ /**
3474
+ * @see https://redis.io/commands/zunion
3475
+ */
3476
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
3477
+ /**
3478
+ * @see https://redis.io/commands/zunionstore
3479
+ */
3480
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3481
+ }
3482
+
3483
+ /**
3484
+ * Result of a bad request to upstash
3485
+ */
3486
+ declare class UpstashError extends Error {
3487
+ constructor(message: string);
3488
+ }
3489
+ declare class UrlError extends Error {
3490
+ constructor(url: string);
3491
+ }
3492
+
3493
+ type error_UpstashError = UpstashError;
3494
+ declare const error_UpstashError: typeof UpstashError;
3495
+ type error_UrlError = UrlError;
3496
+ declare const error_UrlError: typeof UrlError;
3497
+ declare namespace error {
3498
+ export {
3499
+ error_UpstashError as UpstashError,
3500
+ error_UrlError as UrlError,
3501
+ };
3502
+ }
3503
+
3504
+ /**
3505
+ * @see https://redis.io/commands/zdiffstore
3506
+ */
3507
+ declare class ZDiffStoreCommand extends Command<number, number> {
3508
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
3509
+ }
3510
+
3511
+ /**
3512
+ * @see https://redis.io/commands/zmscore
3513
+ */
3514
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
3515
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3516
+ }
3517
+
3518
+ export { HValsCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetRangeCommand as H, GetSetCommand as I, HDelCommand as J, HExistsCommand as K, HGetCommand as L, HGetAllCommand as M, HIncrByCommand as N, HIncrByFloatCommand as O, Pipeline as P, HKeysCommand as Q, RedisOptions as R, HLenCommand as S, HMGetCommand as T, UpstashRequest as U, HMSetCommand as V, HRandFieldCommand as W, HScanCommand as X, HSetCommand as Y, HSetNXCommand as Z, HStrLenCommand as _, RequesterConfig as a, SetBitCommand as a$, IncrCommand as a0, IncrByCommand as a1, IncrByFloatCommand as a2, JsonArrAppendCommand as a3, JsonArrIndexCommand as a4, JsonArrInsertCommand as a5, JsonArrLenCommand as a6, JsonArrPopCommand as a7, JsonArrTrimCommand as a8, JsonClearCommand as a9, MGetCommand as aA, MSetCommand as aB, MSetNXCommand as aC, PersistCommand as aD, PExpireCommand as aE, PExpireAtCommand as aF, PingCommand as aG, PSetEXCommand as aH, PTtlCommand as aI, PublishCommand as aJ, RandomKeyCommand as aK, RenameCommand as aL, RenameNXCommand as aM, RPopCommand as aN, RPushCommand as aO, RPushXCommand as aP, SAddCommand as aQ, ScanCommand as aR, ScanCommandOptions as aS, SCardCommand as aT, ScriptExistsCommand as aU, ScriptFlushCommand as aV, ScriptLoadCommand as aW, SDiffCommand as aX, SDiffStoreCommand as aY, SetCommand as aZ, SetCommandOptions as a_, JsonDelCommand as aa, JsonForgetCommand as ab, JsonGetCommand as ac, JsonMGetCommand as ad, JsonNumIncrByCommand as ae, JsonNumMultByCommand as af, JsonObjKeysCommand as ag, JsonObjLenCommand as ah, JsonRespCommand as ai, JsonSetCommand as aj, JsonStrAppendCommand as ak, JsonStrLenCommand as al, JsonToggleCommand as am, JsonTypeCommand as an, KeysCommand as ao, LIndexCommand as ap, LInsertCommand as aq, LLenCommand as ar, LMoveCommand as as, LPopCommand as at, LPushCommand as au, LPushXCommand as av, LRangeCommand as aw, LRemCommand as ax, LSetCommand as ay, LTrimCommand as az, Redis as b, SetExCommand as b0, SetNxCommand as b1, SetRangeCommand as b2, SInterCommand as b3, SInterStoreCommand as b4, SIsMemberCommand as b5, SMembersCommand as b6, SMIsMemberCommand as b7, SMoveCommand as b8, SPopCommand as b9, ZPopMinCommand as bA, ZRangeCommand as bB, ZRangeCommandOptions as bC, ZRankCommand as bD, ZRemCommand as bE, ZRemRangeByLexCommand as bF, ZRemRangeByRankCommand as bG, ZRemRangeByScoreCommand as bH, ZRevRankCommand as bI, ZScanCommand as bJ, ZScoreCommand as bK, ZUnionCommand as bL, ZUnionCommandOptions as bM, ZUnionStoreCommand as bN, ZUnionStoreCommandOptions as bO, SRandMemberCommand as ba, SRemCommand as bb, SScanCommand as bc, StrLenCommand as bd, SUnionCommand as be, SUnionStoreCommand as bf, TimeCommand as bg, TouchCommand as bh, TtlCommand as bi, Type as bj, TypeCommand as bk, UnlinkCommand as bl, XAddCommand as bm, XRangeCommand as bn, ScoreMember as bo, ZAddCommandOptions as bp, ZAddCommand as bq, ZCardCommand as br, ZCountCommand as bs, ZDiffStoreCommand as bt, ZIncrByCommand as bu, ZInterStoreCommand as bv, ZInterStoreCommandOptions as bw, ZLexCountCommand as bx, ZMScoreCommand as by, ZPopMaxCommand as bz, Requester as c, UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalCommand as k, EvalshaCommand as l, ExistsCommand as m, ExpireCommand as n, ExpireAtCommand as o, FlushDBCommand as p, GeoAddCommandOptions as q, GeoMember as r, GeoDistCommand as s, GeoHashCommand as t, GeoPosCommand as u, GeoSearchCommand as v, GeoSearchStoreCommand as w, GetCommand as x, GetBitCommand as y, GetDelCommand as z };