@upstash/redis 0.0.0-ci.ca4b4d16-20230531 → 0.0.0-ci.cb27f2dedaa904232a2ff3a631b20ff886188ff3-20240708092746

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