@upstash/redis 0.0.0-ci.d2ee3690 → 0.0.0-ci.d3170677a5859e31d40407781286bdf17d64ca72-20250220114636

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 (395) hide show
  1. package/README.md +36 -23
  2. package/chunk-AQ2U77ZI.mjs +4097 -0
  3. package/cloudflare.d.mts +55 -0
  4. package/cloudflare.d.ts +55 -0
  5. package/cloudflare.js +4209 -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 +4182 -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 +4229 -0
  14. package/nodejs.mjs +113 -0
  15. package/package.json +1 -101
  16. package/zmscore-BnJuTB6j.d.mts +3710 -0
  17. package/zmscore-BnJuTB6j.d.ts +3710 -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/lpush.js +0 -9
  65. package/esm/pkg/commands/lpushx.js +0 -9
  66. package/esm/pkg/commands/lrange.js +0 -6
  67. package/esm/pkg/commands/lrem.js +0 -6
  68. package/esm/pkg/commands/lset.js +0 -6
  69. package/esm/pkg/commands/ltrim.js +0 -6
  70. package/esm/pkg/commands/mget.js +0 -9
  71. package/esm/pkg/commands/mod.js +0 -114
  72. package/esm/pkg/commands/mset.js +0 -12
  73. package/esm/pkg/commands/msetnx.js +0 -9
  74. package/esm/pkg/commands/persist.js +0 -9
  75. package/esm/pkg/commands/pexpire.js +0 -9
  76. package/esm/pkg/commands/pexpireat.js +0 -9
  77. package/esm/pkg/commands/ping.js +0 -13
  78. package/esm/pkg/commands/psetex.js +0 -9
  79. package/esm/pkg/commands/pttl.js +0 -9
  80. package/esm/pkg/commands/publish.js +0 -9
  81. package/esm/pkg/commands/randomkey.js +0 -9
  82. package/esm/pkg/commands/rename.js +0 -9
  83. package/esm/pkg/commands/renamenx.js +0 -9
  84. package/esm/pkg/commands/rpop.js +0 -9
  85. package/esm/pkg/commands/rpush.js +0 -9
  86. package/esm/pkg/commands/rpushx.js +0 -9
  87. package/esm/pkg/commands/sadd.js +0 -9
  88. package/esm/pkg/commands/scan.js +0 -16
  89. package/esm/pkg/commands/scard.js +0 -9
  90. package/esm/pkg/commands/script_exists.js +0 -12
  91. package/esm/pkg/commands/script_flush.js +0 -16
  92. package/esm/pkg/commands/script_load.js +0 -9
  93. package/esm/pkg/commands/sdiff.js +0 -9
  94. package/esm/pkg/commands/sdiffstore.js +0 -9
  95. package/esm/pkg/commands/set.js +0 -24
  96. package/esm/pkg/commands/setbit.js +0 -9
  97. package/esm/pkg/commands/setex.js +0 -9
  98. package/esm/pkg/commands/setnx.js +0 -9
  99. package/esm/pkg/commands/setrange.js +0 -9
  100. package/esm/pkg/commands/sinter.js +0 -9
  101. package/esm/pkg/commands/sinterstore.js +0 -9
  102. package/esm/pkg/commands/sismember.js +0 -9
  103. package/esm/pkg/commands/smembers.js +0 -9
  104. package/esm/pkg/commands/smove.js +0 -9
  105. package/esm/pkg/commands/spop.js +0 -13
  106. package/esm/pkg/commands/srandmember.js +0 -13
  107. package/esm/pkg/commands/srem.js +0 -9
  108. package/esm/pkg/commands/sscan.js +0 -16
  109. package/esm/pkg/commands/strlen.js +0 -9
  110. package/esm/pkg/commands/sunion.js +0 -9
  111. package/esm/pkg/commands/sunionstore.js +0 -9
  112. package/esm/pkg/commands/time.js +0 -9
  113. package/esm/pkg/commands/touch.js +0 -9
  114. package/esm/pkg/commands/ttl.js +0 -9
  115. package/esm/pkg/commands/type.js +0 -9
  116. package/esm/pkg/commands/unlink.js +0 -9
  117. package/esm/pkg/commands/zadd.js +0 -26
  118. package/esm/pkg/commands/zcard.js +0 -9
  119. package/esm/pkg/commands/zcount.js +0 -9
  120. package/esm/pkg/commands/zincrby.js +0 -9
  121. package/esm/pkg/commands/zinterstore.js +0 -27
  122. package/esm/pkg/commands/zlexcount.js +0 -9
  123. package/esm/pkg/commands/zpopmax.js +0 -13
  124. package/esm/pkg/commands/zpopmin.js +0 -13
  125. package/esm/pkg/commands/zrange.js +0 -20
  126. package/esm/pkg/commands/zrank.js +0 -9
  127. package/esm/pkg/commands/zrem.js +0 -9
  128. package/esm/pkg/commands/zremrangebylex.js +0 -9
  129. package/esm/pkg/commands/zremrangebyrank.js +0 -9
  130. package/esm/pkg/commands/zremrangebyscore.js +0 -9
  131. package/esm/pkg/commands/zrevrank.js +0 -9
  132. package/esm/pkg/commands/zscan.js +0 -16
  133. package/esm/pkg/commands/zscore.js +0 -9
  134. package/esm/pkg/commands/zunionstore.js +0 -27
  135. package/esm/pkg/error.js +0 -9
  136. package/esm/pkg/http.js +0 -77
  137. package/esm/pkg/pipeline.js +0 -1125
  138. package/esm/pkg/redis.js +0 -1067
  139. package/esm/pkg/types.js +0 -1
  140. package/esm/pkg/util.js +0 -31
  141. package/esm/platforms/cloudflare.js +0 -62
  142. package/esm/platforms/fastly.js +0 -40
  143. package/esm/platforms/node_with_fetch.js +0 -60
  144. package/esm/platforms/nodejs.js +0 -59
  145. package/script/package.json +0 -3
  146. package/script/pkg/commands/append.js +0 -13
  147. package/script/pkg/commands/bitcount.js +0 -20
  148. package/script/pkg/commands/bitop.js +0 -13
  149. package/script/pkg/commands/bitpos.js +0 -13
  150. package/script/pkg/commands/command.js +0 -61
  151. package/script/pkg/commands/dbsize.js +0 -13
  152. package/script/pkg/commands/decr.js +0 -13
  153. package/script/pkg/commands/decrby.js +0 -13
  154. package/script/pkg/commands/del.js +0 -13
  155. package/script/pkg/commands/echo.js +0 -13
  156. package/script/pkg/commands/eval.js +0 -13
  157. package/script/pkg/commands/evalsha.js +0 -13
  158. package/script/pkg/commands/exists.js +0 -13
  159. package/script/pkg/commands/expire.js +0 -13
  160. package/script/pkg/commands/expireat.js +0 -13
  161. package/script/pkg/commands/flushall.js +0 -17
  162. package/script/pkg/commands/flushdb.js +0 -17
  163. package/script/pkg/commands/get.js +0 -13
  164. package/script/pkg/commands/getbit.js +0 -13
  165. package/script/pkg/commands/getrange.js +0 -13
  166. package/script/pkg/commands/getset.js +0 -13
  167. package/script/pkg/commands/hdel.js +0 -13
  168. package/script/pkg/commands/hexists.js +0 -13
  169. package/script/pkg/commands/hget.js +0 -13
  170. package/script/pkg/commands/hgetall.js +0 -37
  171. package/script/pkg/commands/hincrby.js +0 -13
  172. package/script/pkg/commands/hincrbyfloat.js +0 -13
  173. package/script/pkg/commands/hkeys.js +0 -13
  174. package/script/pkg/commands/hlen.js +0 -13
  175. package/script/pkg/commands/hmget.js +0 -39
  176. package/script/pkg/commands/hmset.js +0 -17
  177. package/script/pkg/commands/hscan.js +0 -20
  178. package/script/pkg/commands/hset.js +0 -17
  179. package/script/pkg/commands/hsetnx.js +0 -13
  180. package/script/pkg/commands/hstrlen.js +0 -13
  181. package/script/pkg/commands/hvals.js +0 -13
  182. package/script/pkg/commands/incr.js +0 -13
  183. package/script/pkg/commands/incrby.js +0 -13
  184. package/script/pkg/commands/incrbyfloat.js +0 -13
  185. package/script/pkg/commands/keys.js +0 -13
  186. package/script/pkg/commands/lindex.js +0 -10
  187. package/script/pkg/commands/linsert.js +0 -10
  188. package/script/pkg/commands/llen.js +0 -13
  189. package/script/pkg/commands/lpop.js +0 -13
  190. package/script/pkg/commands/lpush.js +0 -13
  191. package/script/pkg/commands/lpushx.js +0 -13
  192. package/script/pkg/commands/lrange.js +0 -10
  193. package/script/pkg/commands/lrem.js +0 -10
  194. package/script/pkg/commands/lset.js +0 -10
  195. package/script/pkg/commands/ltrim.js +0 -10
  196. package/script/pkg/commands/mget.js +0 -13
  197. package/script/pkg/commands/mod.js +0 -130
  198. package/script/pkg/commands/mset.js +0 -16
  199. package/script/pkg/commands/msetnx.js +0 -13
  200. package/script/pkg/commands/persist.js +0 -13
  201. package/script/pkg/commands/pexpire.js +0 -13
  202. package/script/pkg/commands/pexpireat.js +0 -13
  203. package/script/pkg/commands/ping.js +0 -17
  204. package/script/pkg/commands/psetex.js +0 -13
  205. package/script/pkg/commands/pttl.js +0 -13
  206. package/script/pkg/commands/publish.js +0 -13
  207. package/script/pkg/commands/randomkey.js +0 -13
  208. package/script/pkg/commands/rename.js +0 -13
  209. package/script/pkg/commands/renamenx.js +0 -13
  210. package/script/pkg/commands/rpop.js +0 -13
  211. package/script/pkg/commands/rpush.js +0 -13
  212. package/script/pkg/commands/rpushx.js +0 -13
  213. package/script/pkg/commands/sadd.js +0 -13
  214. package/script/pkg/commands/scan.js +0 -20
  215. package/script/pkg/commands/scard.js +0 -13
  216. package/script/pkg/commands/script_exists.js +0 -16
  217. package/script/pkg/commands/script_flush.js +0 -20
  218. package/script/pkg/commands/script_load.js +0 -13
  219. package/script/pkg/commands/sdiff.js +0 -13
  220. package/script/pkg/commands/sdiffstore.js +0 -13
  221. package/script/pkg/commands/set.js +0 -28
  222. package/script/pkg/commands/setbit.js +0 -13
  223. package/script/pkg/commands/setex.js +0 -13
  224. package/script/pkg/commands/setnx.js +0 -13
  225. package/script/pkg/commands/setrange.js +0 -13
  226. package/script/pkg/commands/sinter.js +0 -13
  227. package/script/pkg/commands/sinterstore.js +0 -13
  228. package/script/pkg/commands/sismember.js +0 -13
  229. package/script/pkg/commands/smembers.js +0 -13
  230. package/script/pkg/commands/smove.js +0 -13
  231. package/script/pkg/commands/spop.js +0 -17
  232. package/script/pkg/commands/srandmember.js +0 -17
  233. package/script/pkg/commands/srem.js +0 -13
  234. package/script/pkg/commands/sscan.js +0 -20
  235. package/script/pkg/commands/strlen.js +0 -13
  236. package/script/pkg/commands/sunion.js +0 -13
  237. package/script/pkg/commands/sunionstore.js +0 -13
  238. package/script/pkg/commands/time.js +0 -13
  239. package/script/pkg/commands/touch.js +0 -13
  240. package/script/pkg/commands/ttl.js +0 -13
  241. package/script/pkg/commands/type.js +0 -13
  242. package/script/pkg/commands/unlink.js +0 -13
  243. package/script/pkg/commands/zadd.js +0 -30
  244. package/script/pkg/commands/zcard.js +0 -13
  245. package/script/pkg/commands/zcount.js +0 -13
  246. package/script/pkg/commands/zincrby.js +0 -13
  247. package/script/pkg/commands/zinterstore.js +0 -31
  248. package/script/pkg/commands/zlexcount.js +0 -13
  249. package/script/pkg/commands/zpopmax.js +0 -17
  250. package/script/pkg/commands/zpopmin.js +0 -17
  251. package/script/pkg/commands/zrange.js +0 -24
  252. package/script/pkg/commands/zrank.js +0 -13
  253. package/script/pkg/commands/zrem.js +0 -13
  254. package/script/pkg/commands/zremrangebylex.js +0 -13
  255. package/script/pkg/commands/zremrangebyrank.js +0 -13
  256. package/script/pkg/commands/zremrangebyscore.js +0 -13
  257. package/script/pkg/commands/zrevrank.js +0 -13
  258. package/script/pkg/commands/zscan.js +0 -20
  259. package/script/pkg/commands/zscore.js +0 -13
  260. package/script/pkg/commands/zunionstore.js +0 -31
  261. package/script/pkg/error.js +0 -13
  262. package/script/pkg/http.js +0 -81
  263. package/script/pkg/pipeline.js +0 -1129
  264. package/script/pkg/redis.js +0 -1071
  265. package/script/pkg/types.js +0 -2
  266. package/script/pkg/util.js +0 -35
  267. package/script/platforms/cloudflare.js +0 -89
  268. package/script/platforms/fastly.js +0 -67
  269. package/script/platforms/node_with_fetch.js +0 -87
  270. package/script/platforms/nodejs.js +0 -86
  271. package/types/pkg/commands/append.d.ts +0 -7
  272. package/types/pkg/commands/bitcount.d.ts +0 -8
  273. package/types/pkg/commands/bitop.d.ts +0 -13
  274. package/types/pkg/commands/bitpos.d.ts +0 -7
  275. package/types/pkg/commands/command.d.ts +0 -37
  276. package/types/pkg/commands/dbsize.d.ts +0 -7
  277. package/types/pkg/commands/decr.d.ts +0 -7
  278. package/types/pkg/commands/decrby.d.ts +0 -7
  279. package/types/pkg/commands/del.d.ts +0 -7
  280. package/types/pkg/commands/echo.d.ts +0 -7
  281. package/types/pkg/commands/eval.d.ts +0 -7
  282. package/types/pkg/commands/evalsha.d.ts +0 -7
  283. package/types/pkg/commands/exists.d.ts +0 -7
  284. package/types/pkg/commands/expire.d.ts +0 -7
  285. package/types/pkg/commands/expireat.d.ts +0 -7
  286. package/types/pkg/commands/flushall.d.ts +0 -9
  287. package/types/pkg/commands/flushdb.d.ts +0 -9
  288. package/types/pkg/commands/get.d.ts +0 -7
  289. package/types/pkg/commands/getbit.d.ts +0 -7
  290. package/types/pkg/commands/getrange.d.ts +0 -7
  291. package/types/pkg/commands/getset.d.ts +0 -7
  292. package/types/pkg/commands/hdel.d.ts +0 -7
  293. package/types/pkg/commands/hexists.d.ts +0 -7
  294. package/types/pkg/commands/hget.d.ts +0 -7
  295. package/types/pkg/commands/hgetall.d.ts +0 -7
  296. package/types/pkg/commands/hincrby.d.ts +0 -7
  297. package/types/pkg/commands/hincrbyfloat.d.ts +0 -7
  298. package/types/pkg/commands/hkeys.d.ts +0 -7
  299. package/types/pkg/commands/hlen.d.ts +0 -7
  300. package/types/pkg/commands/hmget.d.ts +0 -15
  301. package/types/pkg/commands/hmset.d.ts +0 -9
  302. package/types/pkg/commands/hscan.d.ts +0 -24
  303. package/types/pkg/commands/hset.d.ts +0 -9
  304. package/types/pkg/commands/hsetnx.d.ts +0 -7
  305. package/types/pkg/commands/hstrlen.d.ts +0 -7
  306. package/types/pkg/commands/hvals.d.ts +0 -7
  307. package/types/pkg/commands/incr.d.ts +0 -7
  308. package/types/pkg/commands/incrby.d.ts +0 -7
  309. package/types/pkg/commands/incrbyfloat.d.ts +0 -7
  310. package/types/pkg/commands/keys.d.ts +0 -7
  311. package/types/pkg/commands/lindex.d.ts +0 -4
  312. package/types/pkg/commands/linsert.d.ts +0 -9
  313. package/types/pkg/commands/llen.d.ts +0 -7
  314. package/types/pkg/commands/lpop.d.ts +0 -7
  315. package/types/pkg/commands/lpush.d.ts +0 -7
  316. package/types/pkg/commands/lpushx.d.ts +0 -7
  317. package/types/pkg/commands/lrange.d.ts +0 -4
  318. package/types/pkg/commands/lrem.d.ts +0 -4
  319. package/types/pkg/commands/lset.d.ts +0 -4
  320. package/types/pkg/commands/ltrim.d.ts +0 -4
  321. package/types/pkg/commands/mget.d.ts +0 -7
  322. package/types/pkg/commands/mod.d.ts +0 -114
  323. package/types/pkg/commands/mset.d.ts +0 -9
  324. package/types/pkg/commands/msetnx.d.ts +0 -9
  325. package/types/pkg/commands/persist.d.ts +0 -7
  326. package/types/pkg/commands/pexpire.d.ts +0 -7
  327. package/types/pkg/commands/pexpireat.d.ts +0 -7
  328. package/types/pkg/commands/ping.d.ts +0 -7
  329. package/types/pkg/commands/psetex.d.ts +0 -7
  330. package/types/pkg/commands/pttl.d.ts +0 -7
  331. package/types/pkg/commands/publish.d.ts +0 -7
  332. package/types/pkg/commands/randomkey.d.ts +0 -7
  333. package/types/pkg/commands/rename.d.ts +0 -7
  334. package/types/pkg/commands/renamenx.d.ts +0 -7
  335. package/types/pkg/commands/rpop.d.ts +0 -7
  336. package/types/pkg/commands/rpush.d.ts +0 -7
  337. package/types/pkg/commands/rpushx.d.ts +0 -7
  338. package/types/pkg/commands/sadd.d.ts +0 -7
  339. package/types/pkg/commands/scan.d.ts +0 -17
  340. package/types/pkg/commands/scard.d.ts +0 -7
  341. package/types/pkg/commands/script_exists.d.ts +0 -7
  342. package/types/pkg/commands/script_flush.d.ts +0 -14
  343. package/types/pkg/commands/script_load.d.ts +0 -7
  344. package/types/pkg/commands/sdiff.d.ts +0 -7
  345. package/types/pkg/commands/sdiffstore.d.ts +0 -7
  346. package/types/pkg/commands/set.d.ts +0 -26
  347. package/types/pkg/commands/setbit.d.ts +0 -7
  348. package/types/pkg/commands/setex.d.ts +0 -7
  349. package/types/pkg/commands/setnx.d.ts +0 -7
  350. package/types/pkg/commands/setrange.d.ts +0 -7
  351. package/types/pkg/commands/sinter.d.ts +0 -7
  352. package/types/pkg/commands/sinterstore.d.ts +0 -7
  353. package/types/pkg/commands/sismember.d.ts +0 -7
  354. package/types/pkg/commands/smembers.d.ts +0 -7
  355. package/types/pkg/commands/smove.d.ts +0 -7
  356. package/types/pkg/commands/spop.d.ts +0 -7
  357. package/types/pkg/commands/srandmember.d.ts +0 -7
  358. package/types/pkg/commands/srem.d.ts +0 -7
  359. package/types/pkg/commands/sscan.d.ts +0 -24
  360. package/types/pkg/commands/strlen.d.ts +0 -7
  361. package/types/pkg/commands/sunion.d.ts +0 -7
  362. package/types/pkg/commands/sunionstore.d.ts +0 -7
  363. package/types/pkg/commands/time.d.ts +0 -7
  364. package/types/pkg/commands/touch.d.ts +0 -7
  365. package/types/pkg/commands/ttl.d.ts +0 -7
  366. package/types/pkg/commands/type.d.ts +0 -8
  367. package/types/pkg/commands/unlink.d.ts +0 -7
  368. package/types/pkg/commands/zadd.d.ts +0 -35
  369. package/types/pkg/commands/zcard.d.ts +0 -7
  370. package/types/pkg/commands/zcount.d.ts +0 -7
  371. package/types/pkg/commands/zincrby.d.ts +0 -7
  372. package/types/pkg/commands/zinterstore.d.ts +0 -30
  373. package/types/pkg/commands/zlexcount.d.ts +0 -7
  374. package/types/pkg/commands/zpopmax.d.ts +0 -7
  375. package/types/pkg/commands/zpopmin.d.ts +0 -7
  376. package/types/pkg/commands/zrange.d.ts +0 -35
  377. package/types/pkg/commands/zrank.d.ts +0 -7
  378. package/types/pkg/commands/zrem.d.ts +0 -7
  379. package/types/pkg/commands/zremrangebylex.d.ts +0 -7
  380. package/types/pkg/commands/zremrangebyrank.d.ts +0 -7
  381. package/types/pkg/commands/zremrangebyscore.d.ts +0 -7
  382. package/types/pkg/commands/zrevrank.d.ts +0 -7
  383. package/types/pkg/commands/zscan.d.ts +0 -24
  384. package/types/pkg/commands/zscore.d.ts +0 -7
  385. package/types/pkg/commands/zunionstore.d.ts +0 -30
  386. package/types/pkg/error.d.ts +0 -6
  387. package/types/pkg/http.d.ts +0 -54
  388. package/types/pkg/pipeline.d.ts +0 -540
  389. package/types/pkg/redis.d.ts +0 -516
  390. package/types/pkg/types.d.ts +0 -1
  391. package/types/pkg/util.d.ts +0 -1
  392. package/types/platforms/cloudflare.d.ts +0 -42
  393. package/types/platforms/fastly.d.ts +0 -45
  394. package/types/platforms/node_with_fetch.d.ts +0 -82
  395. package/types/platforms/nodejs.d.ts +0 -81
@@ -0,0 +1,3710 @@
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 MessageEvent = {
1693
+ type: string;
1694
+ data: any;
1695
+ channel?: string;
1696
+ pattern?: string;
1697
+ };
1698
+ type Listener = (event: MessageEvent["data"]) => void;
1699
+ declare class Subscriber extends EventTarget {
1700
+ private subscriptions;
1701
+ private client;
1702
+ private listeners;
1703
+ constructor(client: Requester, channels: string[], isPattern?: boolean);
1704
+ private subscribeToChannel;
1705
+ private subscribeToPattern;
1706
+ private handleMessage;
1707
+ private dispatchToListeners;
1708
+ on(type: string, listener: Listener): void;
1709
+ removeAllListeners(): void;
1710
+ unsubscribe(channels?: string[]): Promise<void>;
1711
+ getSubscribedChannels(): string[];
1712
+ }
1713
+
1714
+ type InferResponseData<T extends unknown[]> = {
1715
+ [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
1716
+ };
1717
+ interface ExecMethod<TCommands extends Command<any, any>[]> {
1718
+ /**
1719
+ * Send the pipeline request to upstash.
1720
+ *
1721
+ * Returns an array with the results of all pipelined commands.
1722
+ *
1723
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
1724
+ * ```ts
1725
+ * const p = redis.pipeline()
1726
+ * p.get("key")
1727
+ * const result = p.exec<[{ greeting: string }]>()
1728
+ * ```
1729
+ *
1730
+ * 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.
1731
+ *
1732
+ * 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 }`.
1733
+ *
1734
+ * ```ts
1735
+ * const p = redis.pipeline()
1736
+ * p.get("key")
1737
+ *
1738
+ * const result = await p.exec({ keepErrors: true });
1739
+ * const getResult = result[0].result
1740
+ * const getError = result[0].error
1741
+ * ```
1742
+ */
1743
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(): Promise<TCommandResults>;
1744
+ <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(options: {
1745
+ keepErrors: true;
1746
+ }): Promise<{
1747
+ [K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]>;
1748
+ }>;
1749
+ }
1750
+ /**
1751
+ * Upstash REST API supports command pipelining to send multiple commands in
1752
+ * batch, instead of sending each command one by one and waiting for a response.
1753
+ * When using pipelines, several commands are sent using a single HTTP request,
1754
+ * and a single JSON array response is returned. Each item in the response array
1755
+ * corresponds to the command in the same order within the pipeline.
1756
+ *
1757
+ * **NOTE:**
1758
+ *
1759
+ * Execution of the pipeline is not atomic. Even though each command in
1760
+ * the pipeline will be executed in order, commands sent by other clients can
1761
+ * interleave with the pipeline.
1762
+ *
1763
+ * **Examples:**
1764
+ *
1765
+ * ```ts
1766
+ * const p = redis.pipeline() // or redis.multi()
1767
+ * p.set("key","value")
1768
+ * p.get("key")
1769
+ * const res = await p.exec()
1770
+ * ```
1771
+ *
1772
+ * You can also chain commands together
1773
+ * ```ts
1774
+ * const p = redis.pipeline()
1775
+ * const res = await p.set("key","value").get("key").exec()
1776
+ * ```
1777
+ *
1778
+ * Return types are inferred if all commands are chained, but you can still
1779
+ * override the response type manually:
1780
+ * ```ts
1781
+ * redis.pipeline()
1782
+ * .set("key", { greeting: "hello"})
1783
+ * .get("key")
1784
+ * .exec<["OK", { greeting: string } ]>()
1785
+ *
1786
+ * ```
1787
+ */
1788
+ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1789
+ private client;
1790
+ private commands;
1791
+ private commandOptions?;
1792
+ private multiExec;
1793
+ constructor(opts: {
1794
+ client: Requester;
1795
+ commandOptions?: CommandOptions<any, any>;
1796
+ multiExec?: boolean;
1797
+ });
1798
+ exec: ExecMethod<TCommands>;
1799
+ /**
1800
+ * Returns the length of pipeline before the execution
1801
+ */
1802
+ length(): number;
1803
+ /**
1804
+ * Pushes a command into the pipeline and returns a chainable instance of the
1805
+ * pipeline
1806
+ */
1807
+ private chain;
1808
+ /**
1809
+ * @see https://redis.io/commands/append
1810
+ */
1811
+ append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
1812
+ /**
1813
+ * @see https://redis.io/commands/bitcount
1814
+ */
1815
+ bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
1816
+ /**
1817
+ * Returns an instance that can be used to execute `BITFIELD` commands on one key.
1818
+ *
1819
+ * @example
1820
+ * ```typescript
1821
+ * redis.set("mykey", 0);
1822
+ * const result = await redis.pipeline()
1823
+ * .bitfield("mykey")
1824
+ * .set("u4", 0, 16)
1825
+ * .incr("u4", "#1", 1)
1826
+ * .exec();
1827
+ * console.log(result); // [[0, 1]]
1828
+ * ```
1829
+ *
1830
+ * @see https://redis.io/commands/bitfield
1831
+ */
1832
+ bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
1833
+ /**
1834
+ * @see https://redis.io/commands/bitop
1835
+ */
1836
+ bitop: {
1837
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
1838
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
1839
+ };
1840
+ /**
1841
+ * @see https://redis.io/commands/bitpos
1842
+ */
1843
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1844
+ /**
1845
+ * @see https://redis.io/commands/copy
1846
+ */
1847
+ copy: (key: string, destinationKey: string, opts?: {
1848
+ replace: boolean;
1849
+ } | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
1850
+ /**
1851
+ * @see https://redis.io/commands/zdiffstore
1852
+ */
1853
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
1854
+ /**
1855
+ * @see https://redis.io/commands/dbsize
1856
+ */
1857
+ dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
1858
+ /**
1859
+ * @see https://redis.io/commands/decr
1860
+ */
1861
+ decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
1862
+ /**
1863
+ * @see https://redis.io/commands/decrby
1864
+ */
1865
+ decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
1866
+ /**
1867
+ * @see https://redis.io/commands/del
1868
+ */
1869
+ del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1870
+ /**
1871
+ * @see https://redis.io/commands/echo
1872
+ */
1873
+ echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
1874
+ /**
1875
+ * @see https://redis.io/commands/eval
1876
+ */
1877
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1878
+ /**
1879
+ * @see https://redis.io/commands/evalsha
1880
+ */
1881
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
1882
+ /**
1883
+ * @see https://redis.io/commands/exists
1884
+ */
1885
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
1886
+ /**
1887
+ * @see https://redis.io/commands/expire
1888
+ */
1889
+ expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1890
+ /**
1891
+ * @see https://redis.io/commands/expireat
1892
+ */
1893
+ expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
1894
+ /**
1895
+ * @see https://redis.io/commands/flushall
1896
+ */
1897
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1898
+ /**
1899
+ * @see https://redis.io/commands/flushdb
1900
+ */
1901
+ flushdb: (opts?: {
1902
+ async?: boolean;
1903
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1904
+ /**
1905
+ * @see https://redis.io/commands/geoadd
1906
+ */
1907
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
1908
+ /**
1909
+ * @see https://redis.io/commands/geodist
1910
+ */
1911
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
1912
+ /**
1913
+ * @see https://redis.io/commands/geopos
1914
+ */
1915
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
1916
+ lng: number;
1917
+ lat: number;
1918
+ }[]>]>;
1919
+ /**
1920
+ * @see https://redis.io/commands/geohash
1921
+ */
1922
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
1923
+ /**
1924
+ * @see https://redis.io/commands/geosearch
1925
+ */
1926
+ geosearch: <TData>(key: string, centerPoint: {
1927
+ type: "FROMLONLAT" | "fromlonlat";
1928
+ coordinate: {
1929
+ lon: number;
1930
+ lat: number;
1931
+ };
1932
+ } | {
1933
+ type: "FROMMEMBER" | "frommember";
1934
+ member: TData;
1935
+ }, shape: {
1936
+ type: "BYRADIUS" | "byradius";
1937
+ radius: number;
1938
+ radiusType: "M" | "KM" | "FT" | "MI";
1939
+ } | {
1940
+ type: "BYBOX" | "bybox";
1941
+ rect: {
1942
+ width: number;
1943
+ height: number;
1944
+ };
1945
+ rectType: "M" | "KM" | "FT" | "MI";
1946
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1947
+ count?: {
1948
+ limit: number;
1949
+ any?: boolean;
1950
+ };
1951
+ withCoord?: boolean;
1952
+ withDist?: boolean;
1953
+ withHash?: boolean;
1954
+ } | undefined) => Pipeline<[...TCommands, Command<any, ({
1955
+ member: TData;
1956
+ } & {
1957
+ coord?: {
1958
+ long: number;
1959
+ lat: number;
1960
+ } | undefined;
1961
+ dist?: number | undefined;
1962
+ hash?: string | undefined;
1963
+ })[]>]>;
1964
+ /**
1965
+ * @see https://redis.io/commands/geosearchstore
1966
+ */
1967
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
1968
+ type: "FROMLONLAT" | "fromlonlat";
1969
+ coordinate: {
1970
+ lon: number;
1971
+ lat: number;
1972
+ };
1973
+ } | {
1974
+ type: "FROMMEMBER" | "frommember";
1975
+ member: TData;
1976
+ }, shape: {
1977
+ type: "BYRADIUS" | "byradius";
1978
+ radius: number;
1979
+ radiusType: "M" | "KM" | "FT" | "MI";
1980
+ } | {
1981
+ type: "BYBOX" | "bybox";
1982
+ rect: {
1983
+ width: number;
1984
+ height: number;
1985
+ };
1986
+ rectType: "M" | "KM" | "FT" | "MI";
1987
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1988
+ count?: {
1989
+ limit: number;
1990
+ any?: boolean;
1991
+ };
1992
+ storeDist?: boolean;
1993
+ } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1994
+ /**
1995
+ * @see https://redis.io/commands/get
1996
+ */
1997
+ get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
1998
+ /**
1999
+ * @see https://redis.io/commands/getbit
2000
+ */
2001
+ getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2002
+ /**
2003
+ * @see https://redis.io/commands/getdel
2004
+ */
2005
+ getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2006
+ /**
2007
+ * @see https://redis.io/commands/getex
2008
+ */
2009
+ getex: <TData>(key: string, opts?: ({
2010
+ ex: number;
2011
+ px?: never;
2012
+ exat?: never;
2013
+ pxat?: never;
2014
+ persist?: never;
2015
+ } | {
2016
+ ex?: never;
2017
+ px: number;
2018
+ exat?: never;
2019
+ pxat?: never;
2020
+ persist?: never;
2021
+ } | {
2022
+ ex?: never;
2023
+ px?: never;
2024
+ exat: number;
2025
+ pxat?: never;
2026
+ persist?: never;
2027
+ } | {
2028
+ ex?: never;
2029
+ px?: never;
2030
+ exat?: never;
2031
+ pxat: number;
2032
+ persist?: never;
2033
+ } | {
2034
+ ex?: never;
2035
+ px?: never;
2036
+ exat?: never;
2037
+ pxat?: never;
2038
+ persist: true;
2039
+ } | {
2040
+ ex?: never;
2041
+ px?: never;
2042
+ exat?: never;
2043
+ pxat?: never;
2044
+ persist?: never;
2045
+ }) | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2046
+ /**
2047
+ * @see https://redis.io/commands/getrange
2048
+ */
2049
+ getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
2050
+ /**
2051
+ * @see https://redis.io/commands/getset
2052
+ */
2053
+ getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2054
+ /**
2055
+ * @see https://redis.io/commands/hdel
2056
+ */
2057
+ hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2058
+ /**
2059
+ * @see https://redis.io/commands/hexists
2060
+ */
2061
+ hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
2062
+ /**
2063
+ * @see https://redis.io/commands/hget
2064
+ */
2065
+ hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2066
+ /**
2067
+ * @see https://redis.io/commands/hgetall
2068
+ */
2069
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2070
+ /**
2071
+ * @see https://redis.io/commands/hincrby
2072
+ */
2073
+ hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
2074
+ /**
2075
+ * @see https://redis.io/commands/hincrbyfloat
2076
+ */
2077
+ hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
2078
+ /**
2079
+ * @see https://redis.io/commands/hkeys
2080
+ */
2081
+ hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
2082
+ /**
2083
+ * @see https://redis.io/commands/hlen
2084
+ */
2085
+ hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2086
+ /**
2087
+ * @see https://redis.io/commands/hmget
2088
+ */
2089
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2090
+ /**
2091
+ * @see https://redis.io/commands/hmset
2092
+ */
2093
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2094
+ /**
2095
+ * @see https://redis.io/commands/hrandfield
2096
+ */
2097
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
2098
+ /**
2099
+ * @see https://redis.io/commands/hscan
2100
+ */
2101
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2102
+ /**
2103
+ * @see https://redis.io/commands/hset
2104
+ */
2105
+ hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2106
+ /**
2107
+ * @see https://redis.io/commands/hsetnx
2108
+ */
2109
+ hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2110
+ /**
2111
+ * @see https://redis.io/commands/hstrlen
2112
+ */
2113
+ hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
2114
+ /**
2115
+ * @see https://redis.io/commands/hvals
2116
+ */
2117
+ hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
2118
+ /**
2119
+ * @see https://redis.io/commands/incr
2120
+ */
2121
+ incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2122
+ /**
2123
+ * @see https://redis.io/commands/incrby
2124
+ */
2125
+ incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
2126
+ /**
2127
+ * @see https://redis.io/commands/incrbyfloat
2128
+ */
2129
+ incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
2130
+ /**
2131
+ * @see https://redis.io/commands/keys
2132
+ */
2133
+ keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
2134
+ /**
2135
+ * @see https://redis.io/commands/lindex
2136
+ */
2137
+ lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
2138
+ /**
2139
+ * @see https://redis.io/commands/linsert
2140
+ */
2141
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2142
+ /**
2143
+ * @see https://redis.io/commands/llen
2144
+ */
2145
+ llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2146
+ /**
2147
+ * @see https://redis.io/commands/lmove
2148
+ */
2149
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
2150
+ /**
2151
+ * @see https://redis.io/commands/lpop
2152
+ */
2153
+ lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2154
+ /**
2155
+ * @see https://redis.io/commands/lmpop
2156
+ */
2157
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
2158
+ /**
2159
+ * @see https://redis.io/commands/lpos
2160
+ */
2161
+ lpos: <TData>(key: string, element: unknown, opts?: {
2162
+ rank?: number;
2163
+ count?: number;
2164
+ maxLen?: number;
2165
+ } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
2166
+ /**
2167
+ * @see https://redis.io/commands/lpush
2168
+ */
2169
+ lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2170
+ /**
2171
+ * @see https://redis.io/commands/lpushx
2172
+ */
2173
+ lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2174
+ /**
2175
+ * @see https://redis.io/commands/lrange
2176
+ */
2177
+ lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
2178
+ /**
2179
+ * @see https://redis.io/commands/lrem
2180
+ */
2181
+ lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2182
+ /**
2183
+ * @see https://redis.io/commands/lset
2184
+ */
2185
+ lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
2186
+ /**
2187
+ * @see https://redis.io/commands/ltrim
2188
+ */
2189
+ ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
2190
+ /**
2191
+ * @see https://redis.io/commands/mget
2192
+ */
2193
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
2194
+ /**
2195
+ * @see https://redis.io/commands/mset
2196
+ */
2197
+ mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2198
+ /**
2199
+ * @see https://redis.io/commands/msetnx
2200
+ */
2201
+ msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2202
+ /**
2203
+ * @see https://redis.io/commands/persist
2204
+ */
2205
+ persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2206
+ /**
2207
+ * @see https://redis.io/commands/pexpire
2208
+ */
2209
+ pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2210
+ /**
2211
+ * @see https://redis.io/commands/pexpireat
2212
+ */
2213
+ pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2214
+ /**
2215
+ * @see https://redis.io/commands/pfadd
2216
+ */
2217
+ pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
2218
+ /**
2219
+ * @see https://redis.io/commands/pfcount
2220
+ */
2221
+ pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2222
+ /**
2223
+ * @see https://redis.io/commands/pfmerge
2224
+ */
2225
+ pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
2226
+ /**
2227
+ * @see https://redis.io/commands/ping
2228
+ */
2229
+ ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
2230
+ /**
2231
+ * @see https://redis.io/commands/psetex
2232
+ */
2233
+ psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
2234
+ /**
2235
+ * @see https://redis.io/commands/pttl
2236
+ */
2237
+ pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2238
+ /**
2239
+ * @see https://redis.io/commands/publish
2240
+ */
2241
+ publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
2242
+ /**
2243
+ * @see https://redis.io/commands/randomkey
2244
+ */
2245
+ randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
2246
+ /**
2247
+ * @see https://redis.io/commands/rename
2248
+ */
2249
+ rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
2250
+ /**
2251
+ * @see https://redis.io/commands/renamenx
2252
+ */
2253
+ renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2254
+ /**
2255
+ * @see https://redis.io/commands/rpop
2256
+ */
2257
+ rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2258
+ /**
2259
+ * @see https://redis.io/commands/rpush
2260
+ */
2261
+ rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2262
+ /**
2263
+ * @see https://redis.io/commands/rpushx
2264
+ */
2265
+ rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2266
+ /**
2267
+ * @see https://redis.io/commands/sadd
2268
+ */
2269
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2270
+ /**
2271
+ * @see https://redis.io/commands/scan
2272
+ */
2273
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
2274
+ /**
2275
+ * @see https://redis.io/commands/scard
2276
+ */
2277
+ scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2278
+ /**
2279
+ * @see https://redis.io/commands/script-exists
2280
+ */
2281
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
2282
+ /**
2283
+ * @see https://redis.io/commands/script-flush
2284
+ */
2285
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
2286
+ /**
2287
+ * @see https://redis.io/commands/script-load
2288
+ */
2289
+ scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
2290
+ sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2291
+ /**
2292
+ * @see https://redis.io/commands/sdiffstore
2293
+ */
2294
+ sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2295
+ /**
2296
+ * @see https://redis.io/commands/set
2297
+ */
2298
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
2299
+ /**
2300
+ * @see https://redis.io/commands/setbit
2301
+ */
2302
+ setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2303
+ /**
2304
+ * @see https://redis.io/commands/setex
2305
+ */
2306
+ setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
2307
+ /**
2308
+ * @see https://redis.io/commands/setnx
2309
+ */
2310
+ setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2311
+ /**
2312
+ * @see https://redis.io/commands/setrange
2313
+ */
2314
+ setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
2315
+ /**
2316
+ * @see https://redis.io/commands/sinter
2317
+ */
2318
+ sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
2319
+ /**
2320
+ * @see https://redis.io/commands/sinterstore
2321
+ */
2322
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2323
+ /**
2324
+ * @see https://redis.io/commands/sismember
2325
+ */
2326
+ sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2327
+ /**
2328
+ * @see https://redis.io/commands/smembers
2329
+ */
2330
+ smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
2331
+ /**
2332
+ * @see https://redis.io/commands/smismember
2333
+ */
2334
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
2335
+ /**
2336
+ * @see https://redis.io/commands/smove
2337
+ */
2338
+ smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
2339
+ /**
2340
+ * @see https://redis.io/commands/spop
2341
+ */
2342
+ spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2343
+ /**
2344
+ * @see https://redis.io/commands/srandmember
2345
+ */
2346
+ srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
2347
+ /**
2348
+ * @see https://redis.io/commands/srem
2349
+ */
2350
+ srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2351
+ /**
2352
+ * @see https://redis.io/commands/sscan
2353
+ */
2354
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2355
+ /**
2356
+ * @see https://redis.io/commands/strlen
2357
+ */
2358
+ strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2359
+ /**
2360
+ * @see https://redis.io/commands/sunion
2361
+ */
2362
+ sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2363
+ /**
2364
+ * @see https://redis.io/commands/sunionstore
2365
+ */
2366
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2367
+ /**
2368
+ * @see https://redis.io/commands/time
2369
+ */
2370
+ time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
2371
+ /**
2372
+ * @see https://redis.io/commands/touch
2373
+ */
2374
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2375
+ /**
2376
+ * @see https://redis.io/commands/ttl
2377
+ */
2378
+ ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2379
+ /**
2380
+ * @see https://redis.io/commands/type
2381
+ */
2382
+ type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
2383
+ /**
2384
+ * @see https://redis.io/commands/unlink
2385
+ */
2386
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
2387
+ /**
2388
+ * @see https://redis.io/commands/zadd
2389
+ */
2390
+ 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>]>;
2391
+ /**
2392
+ * @see https://redis.io/commands/xadd
2393
+ */
2394
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
2395
+ nomkStream?: boolean;
2396
+ trim?: ({
2397
+ type: "MAXLEN" | "maxlen";
2398
+ threshold: number;
2399
+ } | {
2400
+ type: "MINID" | "minid";
2401
+ threshold: string;
2402
+ }) & ({
2403
+ comparison: "~";
2404
+ limit?: number;
2405
+ } | {
2406
+ comparison: "=";
2407
+ limit?: never;
2408
+ });
2409
+ } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2410
+ /**
2411
+ * @see https://redis.io/commands/xack
2412
+ */
2413
+ xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2414
+ /**
2415
+ * @see https://redis.io/commands/xdel
2416
+ */
2417
+ xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
2418
+ /**
2419
+ * @see https://redis.io/commands/xgroup
2420
+ */
2421
+ xgroup: (key: string, opts: {
2422
+ type: "CREATE";
2423
+ group: string;
2424
+ id: `$` | string;
2425
+ options?: {
2426
+ MKSTREAM?: boolean;
2427
+ ENTRIESREAD?: number;
2428
+ };
2429
+ } | {
2430
+ type: "CREATECONSUMER";
2431
+ group: string;
2432
+ consumer: string;
2433
+ } | {
2434
+ type: "DELCONSUMER";
2435
+ group: string;
2436
+ consumer: string;
2437
+ } | {
2438
+ type: "DESTROY";
2439
+ group: string;
2440
+ } | {
2441
+ type: "SETID";
2442
+ group: string;
2443
+ id: `$` | string;
2444
+ options?: {
2445
+ ENTRIESREAD?: number;
2446
+ };
2447
+ }) => Pipeline<[...TCommands, Command<any, never>]>;
2448
+ /**
2449
+ * @see https://redis.io/commands/xread
2450
+ */
2451
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2452
+ /**
2453
+ * @see https://redis.io/commands/xreadgroup
2454
+ */
2455
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2456
+ /**
2457
+ * @see https://redis.io/commands/xinfo
2458
+ */
2459
+ xinfo: (key: string, options: {
2460
+ type: "CONSUMERS";
2461
+ group: string;
2462
+ } | {
2463
+ type: "GROUPS";
2464
+ }) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2465
+ /**
2466
+ * @see https://redis.io/commands/xlen
2467
+ */
2468
+ xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2469
+ /**
2470
+ * @see https://redis.io/commands/xpending
2471
+ */
2472
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2473
+ idleTime?: number;
2474
+ consumer?: string | string[];
2475
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2476
+ /**
2477
+ * @see https://redis.io/commands/xclaim
2478
+ */
2479
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2480
+ idleMS?: number;
2481
+ timeMS?: number;
2482
+ retryCount?: number;
2483
+ force?: boolean;
2484
+ justId?: boolean;
2485
+ lastId?: number;
2486
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2487
+ /**
2488
+ * @see https://redis.io/commands/xautoclaim
2489
+ */
2490
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2491
+ count?: number;
2492
+ justId?: boolean;
2493
+ } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2494
+ /**
2495
+ * @see https://redis.io/commands/xtrim
2496
+ */
2497
+ xtrim: (key: string, options: {
2498
+ strategy: "MAXLEN" | "MINID";
2499
+ exactness?: "~" | "=";
2500
+ threshold: number | string;
2501
+ limit?: number;
2502
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
2503
+ /**
2504
+ * @see https://redis.io/commands/xrange
2505
+ */
2506
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2507
+ /**
2508
+ * @see https://redis.io/commands/xrevrange
2509
+ */
2510
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
2511
+ /**
2512
+ * @see https://redis.io/commands/zcard
2513
+ */
2514
+ zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
2515
+ /**
2516
+ * @see https://redis.io/commands/zcount
2517
+ */
2518
+ zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
2519
+ /**
2520
+ * @see https://redis.io/commands/zincrby
2521
+ */
2522
+ zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
2523
+ /**
2524
+ * @see https://redis.io/commands/zinterstore
2525
+ */
2526
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2527
+ /**
2528
+ * @see https://redis.io/commands/zlexcount
2529
+ */
2530
+ zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2531
+ /**
2532
+ * @see https://redis.io/commands/zmscore
2533
+ */
2534
+ zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
2535
+ /**
2536
+ * @see https://redis.io/commands/zpopmax
2537
+ */
2538
+ zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2539
+ /**
2540
+ * @see https://redis.io/commands/zpopmin
2541
+ */
2542
+ zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
2543
+ /**
2544
+ * @see https://redis.io/commands/zrange
2545
+ */
2546
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
2547
+ byLex: true;
2548
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
2549
+ byScore: true;
2550
+ } & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
2551
+ /**
2552
+ * @see https://redis.io/commands/zrank
2553
+ */
2554
+ zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2555
+ /**
2556
+ * @see https://redis.io/commands/zrem
2557
+ */
2558
+ zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2559
+ /**
2560
+ * @see https://redis.io/commands/zremrangebylex
2561
+ */
2562
+ zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
2563
+ /**
2564
+ * @see https://redis.io/commands/zremrangebyrank
2565
+ */
2566
+ zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
2567
+ /**
2568
+ * @see https://redis.io/commands/zremrangebyscore
2569
+ */
2570
+ zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
2571
+ /**
2572
+ * @see https://redis.io/commands/zrevrank
2573
+ */
2574
+ zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2575
+ /**
2576
+ * @see https://redis.io/commands/zscan
2577
+ */
2578
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
2579
+ /**
2580
+ * @see https://redis.io/commands/zscore
2581
+ */
2582
+ zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
2583
+ /**
2584
+ * @see https://redis.io/commands/zunionstore
2585
+ */
2586
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2587
+ /**
2588
+ * @see https://redis.io/commands/zunion
2589
+ */
2590
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2591
+ /**
2592
+ * @see https://redis.io/commands/?group=json
2593
+ */
2594
+ get json(): {
2595
+ /**
2596
+ * @see https://redis.io/commands/json.arrappend
2597
+ */
2598
+ arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2599
+ /**
2600
+ * @see https://redis.io/commands/json.arrindex
2601
+ */
2602
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2603
+ /**
2604
+ * @see https://redis.io/commands/json.arrinsert
2605
+ */
2606
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2607
+ /**
2608
+ * @see https://redis.io/commands/json.arrlen
2609
+ */
2610
+ arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2611
+ /**
2612
+ * @see https://redis.io/commands/json.arrpop
2613
+ */
2614
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2615
+ /**
2616
+ * @see https://redis.io/commands/json.arrtrim
2617
+ */
2618
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2619
+ /**
2620
+ * @see https://redis.io/commands/json.clear
2621
+ */
2622
+ clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2623
+ /**
2624
+ * @see https://redis.io/commands/json.del
2625
+ */
2626
+ del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2627
+ /**
2628
+ * @see https://redis.io/commands/json.forget
2629
+ */
2630
+ forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
2631
+ /**
2632
+ * @see https://redis.io/commands/json.get
2633
+ */
2634
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
2635
+ /**
2636
+ * @see https://redis.io/commands/json.mget
2637
+ */
2638
+ mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2639
+ /**
2640
+ * @see https://redis.io/commands/json.mset
2641
+ */
2642
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2643
+ /**
2644
+ * @see https://redis.io/commands/json.numincrby
2645
+ */
2646
+ numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2647
+ /**
2648
+ * @see https://redis.io/commands/json.nummultby
2649
+ */
2650
+ nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2651
+ /**
2652
+ * @see https://redis.io/commands/json.objkeys
2653
+ */
2654
+ objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
2655
+ /**
2656
+ * @see https://redis.io/commands/json.objlen
2657
+ */
2658
+ objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2659
+ /**
2660
+ * @see https://redis.io/commands/json.resp
2661
+ */
2662
+ resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
2663
+ /**
2664
+ * @see https://redis.io/commands/json.set
2665
+ */
2666
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2667
+ nx: true;
2668
+ xx?: never;
2669
+ } | {
2670
+ nx?: never;
2671
+ xx: true;
2672
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2673
+ /**
2674
+ * @see https://redis.io/commands/json.strappend
2675
+ */
2676
+ strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2677
+ /**
2678
+ * @see https://redis.io/commands/json.strlen
2679
+ */
2680
+ strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
2681
+ /**
2682
+ * @see https://redis.io/commands/json.toggle
2683
+ */
2684
+ toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
2685
+ /**
2686
+ * @see https://redis.io/commands/json.type
2687
+ */
2688
+ type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
2689
+ };
2690
+ }
2691
+
2692
+ /**
2693
+ * Creates a new script.
2694
+ *
2695
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
2696
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
2697
+ * the entire script. Afterwards, the script is cached on the server.
2698
+ *
2699
+ * @example
2700
+ * ```ts
2701
+ * const redis = new Redis({...})
2702
+ *
2703
+ * const script = redis.createScript<string>("return ARGV[1];")
2704
+ * const arg1 = await script.eval([], ["Hello World"])
2705
+ * expect(arg1, "Hello World")
2706
+ * ```
2707
+ */
2708
+ declare class Script<TResult = unknown> {
2709
+ readonly script: string;
2710
+ readonly sha1: string;
2711
+ private readonly redis;
2712
+ constructor(redis: Redis, script: string);
2713
+ /**
2714
+ * Send an `EVAL` command to redis.
2715
+ */
2716
+ eval(keys: string[], args: string[]): Promise<TResult>;
2717
+ /**
2718
+ * Calculates the sha1 hash of the script and then calls `EVALSHA`.
2719
+ */
2720
+ evalsha(keys: string[], args: string[]): Promise<TResult>;
2721
+ /**
2722
+ * Optimistically try to run `EVALSHA` first.
2723
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL`.
2724
+ *
2725
+ * Following calls will be able to use the cached script
2726
+ */
2727
+ exec(keys: string[], args: string[]): Promise<TResult>;
2728
+ /**
2729
+ * Compute the sha1 hash of the script and return its hex representation.
2730
+ */
2731
+ private digest;
2732
+ }
2733
+
2734
+ /**
2735
+ * Serverless redis client for upstash.
2736
+ */
2737
+ declare class Redis {
2738
+ protected client: Requester;
2739
+ protected opts?: CommandOptions<any, any>;
2740
+ protected enableTelemetry: boolean;
2741
+ protected enableAutoPipelining: boolean;
2742
+ /**
2743
+ * Create a new redis client
2744
+ *
2745
+ * @example
2746
+ * ```typescript
2747
+ * const redis = new Redis({
2748
+ * url: "<UPSTASH_REDIS_REST_URL>",
2749
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
2750
+ * });
2751
+ * ```
2752
+ */
2753
+ constructor(client: Requester, opts?: RedisOptions);
2754
+ get readYourWritesSyncToken(): string | undefined;
2755
+ set readYourWritesSyncToken(session: string | undefined);
2756
+ get json(): {
2757
+ /**
2758
+ * @see https://redis.io/commands/json.arrappend
2759
+ */
2760
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
2761
+ /**
2762
+ * @see https://redis.io/commands/json.arrindex
2763
+ */
2764
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2765
+ /**
2766
+ * @see https://redis.io/commands/json.arrinsert
2767
+ */
2768
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
2769
+ /**
2770
+ * @see https://redis.io/commands/json.arrlen
2771
+ */
2772
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2773
+ /**
2774
+ * @see https://redis.io/commands/json.arrpop
2775
+ */
2776
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
2777
+ /**
2778
+ * @see https://redis.io/commands/json.arrtrim
2779
+ */
2780
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
2781
+ /**
2782
+ * @see https://redis.io/commands/json.clear
2783
+ */
2784
+ clear: (key: string, path?: string | undefined) => Promise<number>;
2785
+ /**
2786
+ * @see https://redis.io/commands/json.del
2787
+ */
2788
+ del: (key: string, path?: string | undefined) => Promise<number>;
2789
+ /**
2790
+ * @see https://redis.io/commands/json.forget
2791
+ */
2792
+ forget: (key: string, path?: string | undefined) => Promise<number>;
2793
+ /**
2794
+ * @see https://redis.io/commands/json.get
2795
+ */
2796
+ get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
2797
+ /**
2798
+ * @see https://redis.io/commands/json.mget
2799
+ */
2800
+ mget: <TData>(keys: string[], path: string) => Promise<TData>;
2801
+ /**
2802
+ * @see https://redis.io/commands/json.mset
2803
+ */
2804
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
2805
+ /**
2806
+ * @see https://redis.io/commands/json.numincrby
2807
+ */
2808
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2809
+ /**
2810
+ * @see https://redis.io/commands/json.nummultby
2811
+ */
2812
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
2813
+ /**
2814
+ * @see https://redis.io/commands/json.objkeys
2815
+ */
2816
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
2817
+ /**
2818
+ * @see https://redis.io/commands/json.objlen
2819
+ */
2820
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2821
+ /**
2822
+ * @see https://redis.io/commands/json.resp
2823
+ */
2824
+ resp: (key: string, path?: string | undefined) => Promise<any>;
2825
+ /**
2826
+ * @see https://redis.io/commands/json.set
2827
+ */
2828
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2829
+ nx: true;
2830
+ xx?: never;
2831
+ } | {
2832
+ nx?: never;
2833
+ xx: true;
2834
+ } | undefined) => Promise<"OK" | null>;
2835
+ /**
2836
+ * @see https://redis.io/commands/json.strappend
2837
+ */
2838
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
2839
+ /**
2840
+ * @see https://redis.io/commands/json.strlen
2841
+ */
2842
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
2843
+ /**
2844
+ * @see https://redis.io/commands/json.toggle
2845
+ */
2846
+ toggle: (key: string, path: string) => Promise<number[]>;
2847
+ /**
2848
+ * @see https://redis.io/commands/json.type
2849
+ */
2850
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
2851
+ };
2852
+ /**
2853
+ * Wrap a new middleware around the HTTP client.
2854
+ */
2855
+ use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
2856
+ /**
2857
+ * Technically this is not private, we can hide it from intellisense by doing this
2858
+ */
2859
+ protected addTelemetry: (telemetry: Telemetry) => void;
2860
+ createScript(script: string): Script;
2861
+ /**
2862
+ * Create a new pipeline that allows you to send requests in bulk.
2863
+ *
2864
+ * @see {@link Pipeline}
2865
+ */
2866
+ pipeline: () => Pipeline<[]>;
2867
+ protected autoPipeline: () => Redis;
2868
+ /**
2869
+ * Create a new transaction to allow executing multiple steps atomically.
2870
+ *
2871
+ * All the commands in a transaction are serialized and executed sequentially. A request sent by
2872
+ * another client will never be served in the middle of the execution of a Redis Transaction. This
2873
+ * guarantees that the commands are executed as a single isolated operation.
2874
+ *
2875
+ * @see {@link Pipeline}
2876
+ */
2877
+ multi: () => Pipeline<[]>;
2878
+ /**
2879
+ * Returns an instance that can be used to execute `BITFIELD` commands on one key.
2880
+ *
2881
+ * @example
2882
+ * ```typescript
2883
+ * redis.set("mykey", 0);
2884
+ * const result = await redis.bitfield("mykey")
2885
+ * .set("u4", 0, 16)
2886
+ * .incr("u4", "#1", 1)
2887
+ * .exec();
2888
+ * console.log(result); // [0, 1]
2889
+ * ```
2890
+ *
2891
+ * @see https://redis.io/commands/bitfield
2892
+ */
2893
+ bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
2894
+ /**
2895
+ * @see https://redis.io/commands/append
2896
+ */
2897
+ append: (key: string, value: string) => Promise<number>;
2898
+ /**
2899
+ * @see https://redis.io/commands/bitcount
2900
+ */
2901
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
2902
+ /**
2903
+ * @see https://redis.io/commands/bitop
2904
+ */
2905
+ bitop: {
2906
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
2907
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
2908
+ };
2909
+ /**
2910
+ * @see https://redis.io/commands/bitpos
2911
+ */
2912
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
2913
+ /**
2914
+ * @see https://redis.io/commands/copy
2915
+ */
2916
+ copy: (key: string, destinationKey: string, opts?: {
2917
+ replace: boolean;
2918
+ } | undefined) => Promise<"COPIED" | "NOT_COPIED">;
2919
+ /**
2920
+ * @see https://redis.io/commands/dbsize
2921
+ */
2922
+ dbsize: () => Promise<number>;
2923
+ /**
2924
+ * @see https://redis.io/commands/decr
2925
+ */
2926
+ decr: (key: string) => Promise<number>;
2927
+ /**
2928
+ * @see https://redis.io/commands/decrby
2929
+ */
2930
+ decrby: (key: string, decrement: number) => Promise<number>;
2931
+ /**
2932
+ * @see https://redis.io/commands/del
2933
+ */
2934
+ del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
2935
+ /**
2936
+ * @see https://redis.io/commands/echo
2937
+ */
2938
+ echo: (message: string) => Promise<string>;
2939
+ /**
2940
+ * @see https://redis.io/commands/eval
2941
+ */
2942
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
2943
+ /**
2944
+ * @see https://redis.io/commands/evalsha
2945
+ */
2946
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
2947
+ /**
2948
+ * Generic method to execute any Redis command.
2949
+ */
2950
+ exec: <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) => Promise<TResult>;
2951
+ /**
2952
+ * @see https://redis.io/commands/exists
2953
+ */
2954
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
2955
+ /**
2956
+ * @see https://redis.io/commands/expire
2957
+ */
2958
+ expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Promise<0 | 1>;
2959
+ /**
2960
+ * @see https://redis.io/commands/expireat
2961
+ */
2962
+ expireat: (key: string, unix: number) => Promise<0 | 1>;
2963
+ /**
2964
+ * @see https://redis.io/commands/flushall
2965
+ */
2966
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
2967
+ /**
2968
+ * @see https://redis.io/commands/flushdb
2969
+ */
2970
+ flushdb: (opts?: {
2971
+ async?: boolean;
2972
+ } | undefined) => Promise<"OK">;
2973
+ /**
2974
+ * @see https://redis.io/commands/geoadd
2975
+ */
2976
+ geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
2977
+ /**
2978
+ * @see https://redis.io/commands/geopos
2979
+ */
2980
+ geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
2981
+ lng: number;
2982
+ lat: number;
2983
+ }[]>;
2984
+ /**
2985
+ * @see https://redis.io/commands/geodist
2986
+ */
2987
+ geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
2988
+ /**
2989
+ * @see https://redis.io/commands/geohash
2990
+ */
2991
+ geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
2992
+ /**
2993
+ * @see https://redis.io/commands/geosearch
2994
+ */
2995
+ geosearch: <TData>(key: string, centerPoint: {
2996
+ type: "FROMLONLAT" | "fromlonlat";
2997
+ coordinate: {
2998
+ lon: number;
2999
+ lat: number;
3000
+ };
3001
+ } | {
3002
+ type: "FROMMEMBER" | "frommember";
3003
+ member: TData;
3004
+ }, shape: {
3005
+ type: "BYRADIUS" | "byradius";
3006
+ radius: number;
3007
+ radiusType: "M" | "KM" | "FT" | "MI";
3008
+ } | {
3009
+ type: "BYBOX" | "bybox";
3010
+ rect: {
3011
+ width: number;
3012
+ height: number;
3013
+ };
3014
+ rectType: "M" | "KM" | "FT" | "MI";
3015
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
3016
+ count?: {
3017
+ limit: number;
3018
+ any?: boolean;
3019
+ };
3020
+ withCoord?: boolean;
3021
+ withDist?: boolean;
3022
+ withHash?: boolean;
3023
+ } | undefined) => Promise<({
3024
+ member: TData;
3025
+ } & {
3026
+ coord?: {
3027
+ long: number;
3028
+ lat: number;
3029
+ } | undefined;
3030
+ dist?: number | undefined;
3031
+ hash?: string | undefined;
3032
+ })[]>;
3033
+ /**
3034
+ * @see https://redis.io/commands/geosearchstore
3035
+ */
3036
+ geosearchstore: <TData>(destination: string, key: string, centerPoint: {
3037
+ type: "FROMLONLAT" | "fromlonlat";
3038
+ coordinate: {
3039
+ lon: number;
3040
+ lat: number;
3041
+ };
3042
+ } | {
3043
+ type: "FROMMEMBER" | "frommember";
3044
+ member: TData;
3045
+ }, shape: {
3046
+ type: "BYRADIUS" | "byradius";
3047
+ radius: number;
3048
+ radiusType: "M" | "KM" | "FT" | "MI";
3049
+ } | {
3050
+ type: "BYBOX" | "bybox";
3051
+ rect: {
3052
+ width: number;
3053
+ height: number;
3054
+ };
3055
+ rectType: "M" | "KM" | "FT" | "MI";
3056
+ }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
3057
+ count?: {
3058
+ limit: number;
3059
+ any?: boolean;
3060
+ };
3061
+ storeDist?: boolean;
3062
+ } | undefined) => Promise<number>;
3063
+ /**
3064
+ * @see https://redis.io/commands/get
3065
+ */
3066
+ get: <TData>(key: string) => Promise<TData | null>;
3067
+ /**
3068
+ * @see https://redis.io/commands/getbit
3069
+ */
3070
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
3071
+ /**
3072
+ * @see https://redis.io/commands/getdel
3073
+ */
3074
+ getdel: <TData>(key: string) => Promise<TData | null>;
3075
+ /**
3076
+ * @see https://redis.io/commands/getex
3077
+ */
3078
+ getex: <TData>(key: string, opts?: ({
3079
+ ex: number;
3080
+ px?: never;
3081
+ exat?: never;
3082
+ pxat?: never;
3083
+ persist?: never;
3084
+ } | {
3085
+ ex?: never;
3086
+ px: number;
3087
+ exat?: never;
3088
+ pxat?: never;
3089
+ persist?: never;
3090
+ } | {
3091
+ ex?: never;
3092
+ px?: never;
3093
+ exat: number;
3094
+ pxat?: never;
3095
+ persist?: never;
3096
+ } | {
3097
+ ex?: never;
3098
+ px?: never;
3099
+ exat?: never;
3100
+ pxat: number;
3101
+ persist?: never;
3102
+ } | {
3103
+ ex?: never;
3104
+ px?: never;
3105
+ exat?: never;
3106
+ pxat?: never;
3107
+ persist: true;
3108
+ } | {
3109
+ ex?: never;
3110
+ px?: never;
3111
+ exat?: never;
3112
+ pxat?: never;
3113
+ persist?: never;
3114
+ }) | undefined) => Promise<TData | null>;
3115
+ /**
3116
+ * @see https://redis.io/commands/getrange
3117
+ */
3118
+ getrange: (key: string, start: number, end: number) => Promise<string>;
3119
+ /**
3120
+ * @see https://redis.io/commands/getset
3121
+ */
3122
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
3123
+ /**
3124
+ * @see https://redis.io/commands/hdel
3125
+ */
3126
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
3127
+ /**
3128
+ * @see https://redis.io/commands/hexists
3129
+ */
3130
+ hexists: (key: string, field: string) => Promise<number>;
3131
+ /**
3132
+ * @see https://redis.io/commands/hget
3133
+ */
3134
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
3135
+ /**
3136
+ * @see https://redis.io/commands/hgetall
3137
+ */
3138
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
3139
+ /**
3140
+ * @see https://redis.io/commands/hincrby
3141
+ */
3142
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
3143
+ /**
3144
+ * @see https://redis.io/commands/hincrbyfloat
3145
+ */
3146
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
3147
+ /**
3148
+ * @see https://redis.io/commands/hkeys
3149
+ */
3150
+ hkeys: (key: string) => Promise<string[]>;
3151
+ /**
3152
+ * @see https://redis.io/commands/hlen
3153
+ */
3154
+ hlen: (key: string) => Promise<number>;
3155
+ /**
3156
+ * @see https://redis.io/commands/hmget
3157
+ */
3158
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
3159
+ /**
3160
+ * @see https://redis.io/commands/hmset
3161
+ */
3162
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
3163
+ /**
3164
+ * @see https://redis.io/commands/hrandfield
3165
+ */
3166
+ hrandfield: {
3167
+ (key: string): Promise<string | null>;
3168
+ (key: string, count: number): Promise<string[]>;
3169
+ <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
3170
+ };
3171
+ /**
3172
+ * @see https://redis.io/commands/hscan
3173
+ */
3174
+ hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3175
+ /**
3176
+ * @see https://redis.io/commands/hset
3177
+ */
3178
+ hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
3179
+ /**
3180
+ * @see https://redis.io/commands/hsetnx
3181
+ */
3182
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
3183
+ /**
3184
+ * @see https://redis.io/commands/hstrlen
3185
+ */
3186
+ hstrlen: (key: string, field: string) => Promise<number>;
3187
+ /**
3188
+ * @see https://redis.io/commands/hvals
3189
+ */
3190
+ hvals: (key: string) => Promise<any>;
3191
+ /**
3192
+ * @see https://redis.io/commands/incr
3193
+ */
3194
+ incr: (key: string) => Promise<number>;
3195
+ /**
3196
+ * @see https://redis.io/commands/incrby
3197
+ */
3198
+ incrby: (key: string, value: number) => Promise<number>;
3199
+ /**
3200
+ * @see https://redis.io/commands/incrbyfloat
3201
+ */
3202
+ incrbyfloat: (key: string, value: number) => Promise<number>;
3203
+ /**
3204
+ * @see https://redis.io/commands/keys
3205
+ */
3206
+ keys: (pattern: string) => Promise<string[]>;
3207
+ /**
3208
+ * @see https://redis.io/commands/lindex
3209
+ */
3210
+ lindex: (key: string, index: number) => Promise<any>;
3211
+ /**
3212
+ * @see https://redis.io/commands/linsert
3213
+ */
3214
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
3215
+ /**
3216
+ * @see https://redis.io/commands/llen
3217
+ */
3218
+ llen: (key: string) => Promise<number>;
3219
+ /**
3220
+ * @see https://redis.io/commands/lmove
3221
+ */
3222
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
3223
+ /**
3224
+ * @see https://redis.io/commands/lpop
3225
+ */
3226
+ lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3227
+ /**
3228
+ * @see https://redis.io/commands/lmpop
3229
+ */
3230
+ lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
3231
+ /**
3232
+ * @see https://redis.io/commands/lpos
3233
+ */
3234
+ lpos: <TData = number>(key: string, element: unknown, opts?: {
3235
+ rank?: number;
3236
+ count?: number;
3237
+ maxLen?: number;
3238
+ } | undefined) => Promise<TData>;
3239
+ /**
3240
+ * @see https://redis.io/commands/lpush
3241
+ */
3242
+ lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3243
+ /**
3244
+ * @see https://redis.io/commands/lpushx
3245
+ */
3246
+ lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3247
+ /**
3248
+ * @see https://redis.io/commands/lrange
3249
+ */
3250
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
3251
+ /**
3252
+ * @see https://redis.io/commands/lrem
3253
+ */
3254
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
3255
+ /**
3256
+ * @see https://redis.io/commands/lset
3257
+ */
3258
+ lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
3259
+ /**
3260
+ * @see https://redis.io/commands/ltrim
3261
+ */
3262
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
3263
+ /**
3264
+ * @see https://redis.io/commands/mget
3265
+ */
3266
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
3267
+ /**
3268
+ * @see https://redis.io/commands/mset
3269
+ */
3270
+ mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
3271
+ /**
3272
+ * @see https://redis.io/commands/msetnx
3273
+ */
3274
+ msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
3275
+ /**
3276
+ * @see https://redis.io/commands/persist
3277
+ */
3278
+ persist: (key: string) => Promise<0 | 1>;
3279
+ /**
3280
+ * @see https://redis.io/commands/pexpire
3281
+ */
3282
+ pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
3283
+ /**
3284
+ * @see https://redis.io/commands/pexpireat
3285
+ */
3286
+ pexpireat: (key: string, unix: number) => Promise<0 | 1>;
3287
+ /**
3288
+ * @see https://redis.io/commands/pfadd
3289
+ */
3290
+ pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
3291
+ /**
3292
+ * @see https://redis.io/commands/pfcount
3293
+ */
3294
+ pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
3295
+ /**
3296
+ * @see https://redis.io/commands/pfmerge
3297
+ */
3298
+ pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
3299
+ /**
3300
+ * @see https://redis.io/commands/ping
3301
+ */
3302
+ ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
3303
+ /**
3304
+ * @see https://redis.io/commands/psetex
3305
+ */
3306
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
3307
+ psubscribe: (patterns: string | string[]) => Subscriber;
3308
+ /**
3309
+ * @see https://redis.io/commands/pttl
3310
+ */
3311
+ pttl: (key: string) => Promise<number>;
3312
+ /**
3313
+ * @see https://redis.io/commands/publish
3314
+ */
3315
+ publish: (channel: string, message: unknown) => Promise<number>;
3316
+ /**
3317
+ * @see https://redis.io/commands/randomkey
3318
+ */
3319
+ randomkey: () => Promise<string | null>;
3320
+ /**
3321
+ * @see https://redis.io/commands/rename
3322
+ */
3323
+ rename: (source: string, destination: string) => Promise<"OK">;
3324
+ /**
3325
+ * @see https://redis.io/commands/renamenx
3326
+ */
3327
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
3328
+ /**
3329
+ * @see https://redis.io/commands/rpop
3330
+ */
3331
+ rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
3332
+ /**
3333
+ * @see https://redis.io/commands/rpush
3334
+ */
3335
+ rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3336
+ /**
3337
+ * @see https://redis.io/commands/rpushx
3338
+ */
3339
+ rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
3340
+ /**
3341
+ * @see https://redis.io/commands/sadd
3342
+ */
3343
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
3344
+ /**
3345
+ * @see https://redis.io/commands/scan
3346
+ */
3347
+ scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
3348
+ /**
3349
+ * @see https://redis.io/commands/scard
3350
+ */
3351
+ scard: (key: string) => Promise<number>;
3352
+ /**
3353
+ * @see https://redis.io/commands/script-exists
3354
+ */
3355
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
3356
+ /**
3357
+ * @see https://redis.io/commands/script-flush
3358
+ */
3359
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
3360
+ /**
3361
+ * @see https://redis.io/commands/script-load
3362
+ */
3363
+ scriptLoad: (script: string) => Promise<string>;
3364
+ /**
3365
+ * @see https://redis.io/commands/sdiff
3366
+ */
3367
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
3368
+ /**
3369
+ * @see https://redis.io/commands/sdiffstore
3370
+ */
3371
+ sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
3372
+ /**
3373
+ * @see https://redis.io/commands/set
3374
+ */
3375
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
3376
+ /**
3377
+ * @see https://redis.io/commands/setbit
3378
+ */
3379
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
3380
+ /**
3381
+ * @see https://redis.io/commands/setex
3382
+ */
3383
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
3384
+ /**
3385
+ * @see https://redis.io/commands/setnx
3386
+ */
3387
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
3388
+ /**
3389
+ * @see https://redis.io/commands/setrange
3390
+ */
3391
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
3392
+ /**
3393
+ * @see https://redis.io/commands/sinter
3394
+ */
3395
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
3396
+ /**
3397
+ * @see https://redis.io/commands/sinterstore
3398
+ */
3399
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3400
+ /**
3401
+ * @see https://redis.io/commands/sismember
3402
+ */
3403
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
3404
+ /**
3405
+ * @see https://redis.io/commands/smismember
3406
+ */
3407
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
3408
+ /**
3409
+ * @see https://redis.io/commands/smembers
3410
+ */
3411
+ smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
3412
+ /**
3413
+ * @see https://redis.io/commands/smove
3414
+ */
3415
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
3416
+ /**
3417
+ * @see https://redis.io/commands/spop
3418
+ */
3419
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3420
+ /**
3421
+ * @see https://redis.io/commands/srandmember
3422
+ */
3423
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
3424
+ /**
3425
+ * @see https://redis.io/commands/srem
3426
+ */
3427
+ srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3428
+ /**
3429
+ * @see https://redis.io/commands/sscan
3430
+ */
3431
+ sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3432
+ /**
3433
+ * @see https://redis.io/commands/strlen
3434
+ */
3435
+ strlen: (key: string) => Promise<number>;
3436
+ /**
3437
+ * @see https://redis.io/commands/subscribe
3438
+ */
3439
+ subscribe: (channels: string | string[]) => Subscriber;
3440
+ /**
3441
+ * @see https://redis.io/commands/sunion
3442
+ */
3443
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
3444
+ /**
3445
+ * @see https://redis.io/commands/sunionstore
3446
+ */
3447
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
3448
+ /**
3449
+ * @see https://redis.io/commands/time
3450
+ */
3451
+ time: () => Promise<[number, number]>;
3452
+ /**
3453
+ * @see https://redis.io/commands/touch
3454
+ */
3455
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
3456
+ /**
3457
+ * @see https://redis.io/commands/ttl
3458
+ */
3459
+ ttl: (key: string) => Promise<number>;
3460
+ /**
3461
+ * @see https://redis.io/commands/type
3462
+ */
3463
+ type: (key: string) => Promise<Type>;
3464
+ /**
3465
+ * @see https://redis.io/commands/unlink
3466
+ */
3467
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
3468
+ /**
3469
+ * @see https://redis.io/commands/xadd
3470
+ */
3471
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
3472
+ nomkStream?: boolean;
3473
+ trim?: ({
3474
+ type: "MAXLEN" | "maxlen";
3475
+ threshold: number;
3476
+ } | {
3477
+ type: "MINID" | "minid";
3478
+ threshold: string;
3479
+ }) & ({
3480
+ comparison: "~";
3481
+ limit?: number;
3482
+ } | {
3483
+ comparison: "=";
3484
+ limit?: never;
3485
+ });
3486
+ } | undefined) => Promise<string>;
3487
+ /**
3488
+ * @see https://redis.io/commands/xack
3489
+ */
3490
+ xack: (key: string, group: string, id: string | string[]) => Promise<number>;
3491
+ /**
3492
+ * @see https://redis.io/commands/xdel
3493
+ */
3494
+ xdel: (key: string, ids: string | string[]) => Promise<number>;
3495
+ /**
3496
+ * @see https://redis.io/commands/xgroup
3497
+ */
3498
+ xgroup: (key: string, opts: {
3499
+ type: "CREATE";
3500
+ group: string;
3501
+ id: `$` | string;
3502
+ options?: {
3503
+ MKSTREAM?: boolean;
3504
+ ENTRIESREAD?: number;
3505
+ };
3506
+ } | {
3507
+ type: "CREATECONSUMER";
3508
+ group: string;
3509
+ consumer: string;
3510
+ } | {
3511
+ type: "DELCONSUMER";
3512
+ group: string;
3513
+ consumer: string;
3514
+ } | {
3515
+ type: "DESTROY";
3516
+ group: string;
3517
+ } | {
3518
+ type: "SETID";
3519
+ group: string;
3520
+ id: `$` | string;
3521
+ options?: {
3522
+ ENTRIESREAD?: number;
3523
+ };
3524
+ }) => Promise<never>;
3525
+ /**
3526
+ * @see https://redis.io/commands/xread
3527
+ */
3528
+ xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
3529
+ /**
3530
+ * @see https://redis.io/commands/xreadgroup
3531
+ */
3532
+ xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
3533
+ /**
3534
+ * @see https://redis.io/commands/xinfo
3535
+ */
3536
+ xinfo: (key: string, options: {
3537
+ type: "CONSUMERS";
3538
+ group: string;
3539
+ } | {
3540
+ type: "GROUPS";
3541
+ }) => Promise<unknown[]>;
3542
+ /**
3543
+ * @see https://redis.io/commands/xlen
3544
+ */
3545
+ xlen: (key: string) => Promise<number>;
3546
+ /**
3547
+ * @see https://redis.io/commands/xpending
3548
+ */
3549
+ xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3550
+ idleTime?: number;
3551
+ consumer?: string | string[];
3552
+ } | undefined) => Promise<unknown[]>;
3553
+ /**
3554
+ * @see https://redis.io/commands/xclaim
3555
+ */
3556
+ xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3557
+ idleMS?: number;
3558
+ timeMS?: number;
3559
+ retryCount?: number;
3560
+ force?: boolean;
3561
+ justId?: boolean;
3562
+ lastId?: number;
3563
+ } | undefined) => Promise<unknown[]>;
3564
+ /**
3565
+ * @see https://redis.io/commands/xautoclaim
3566
+ */
3567
+ xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3568
+ count?: number;
3569
+ justId?: boolean;
3570
+ } | undefined) => Promise<unknown[]>;
3571
+ /**
3572
+ * @see https://redis.io/commands/xtrim
3573
+ */
3574
+ xtrim: (key: string, options: {
3575
+ strategy: "MAXLEN" | "MINID";
3576
+ exactness?: "~" | "=";
3577
+ threshold: number | string;
3578
+ limit?: number;
3579
+ }) => Promise<number>;
3580
+ /**
3581
+ * @see https://redis.io/commands/xrange
3582
+ */
3583
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3584
+ /**
3585
+ * @see https://redis.io/commands/xrevrange
3586
+ */
3587
+ xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
3588
+ /**
3589
+ * @see https://redis.io/commands/zadd
3590
+ */
3591
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
3592
+ /**
3593
+ * @see https://redis.io/commands/zcard
3594
+ */
3595
+ zcard: (key: string) => Promise<number>;
3596
+ /**
3597
+ * @see https://redis.io/commands/zcount
3598
+ */
3599
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
3600
+ /**
3601
+ * @see https://redis.io/commands/zdiffstore
3602
+ */
3603
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
3604
+ /**
3605
+ * @see https://redis.io/commands/zincrby
3606
+ */
3607
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
3608
+ /**
3609
+ * @see https://redis.io/commands/zinterstore
3610
+ */
3611
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
3612
+ /**
3613
+ * @see https://redis.io/commands/zlexcount
3614
+ */
3615
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
3616
+ /**
3617
+ * @see https://redis.io/commands/zmscore
3618
+ */
3619
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
3620
+ /**
3621
+ * @see https://redis.io/commands/zpopmax
3622
+ */
3623
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3624
+ /**
3625
+ * @see https://redis.io/commands/zpopmin
3626
+ */
3627
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
3628
+ /**
3629
+ * @see https://redis.io/commands/zrange
3630
+ */
3631
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
3632
+ byLex: true;
3633
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
3634
+ byScore: true;
3635
+ } & ZRangeCommandOptions]) => Promise<TData>;
3636
+ /**
3637
+ * @see https://redis.io/commands/zrank
3638
+ */
3639
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
3640
+ /**
3641
+ * @see https://redis.io/commands/zrem
3642
+ */
3643
+ zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
3644
+ /**
3645
+ * @see https://redis.io/commands/zremrangebylex
3646
+ */
3647
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
3648
+ /**
3649
+ * @see https://redis.io/commands/zremrangebyrank
3650
+ */
3651
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
3652
+ /**
3653
+ * @see https://redis.io/commands/zremrangebyscore
3654
+ */
3655
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
3656
+ /**
3657
+ * @see https://redis.io/commands/zrevrank
3658
+ */
3659
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
3660
+ /**
3661
+ * @see https://redis.io/commands/zscan
3662
+ */
3663
+ zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
3664
+ /**
3665
+ * @see https://redis.io/commands/zscore
3666
+ */
3667
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
3668
+ /**
3669
+ * @see https://redis.io/commands/zunion
3670
+ */
3671
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
3672
+ /**
3673
+ * @see https://redis.io/commands/zunionstore
3674
+ */
3675
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
3676
+ }
3677
+
3678
+ /**
3679
+ * Result of a bad request to upstash
3680
+ */
3681
+ declare class UpstashError extends Error {
3682
+ constructor(message: string);
3683
+ }
3684
+ declare class UrlError extends Error {
3685
+ constructor(url: string);
3686
+ }
3687
+
3688
+ type error_UpstashError = UpstashError;
3689
+ declare const error_UpstashError: typeof UpstashError;
3690
+ type error_UrlError = UrlError;
3691
+ declare const error_UrlError: typeof UrlError;
3692
+ declare namespace error {
3693
+ export { error_UpstashError as UpstashError, error_UrlError as UrlError };
3694
+ }
3695
+
3696
+ /**
3697
+ * @see https://redis.io/commands/zdiffstore
3698
+ */
3699
+ declare class ZDiffStoreCommand extends Command<number, number> {
3700
+ constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
3701
+ }
3702
+
3703
+ /**
3704
+ * @see https://redis.io/commands/zmscore
3705
+ */
3706
+ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
3707
+ constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3708
+ }
3709
+
3710
+ 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 };