@upstash/redis 0.0.0-ci.c95abaf3 → 0.0.0-ci.ca5982e89397ec0e15a62a419e36ec87ddf3439e-20250221122936

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