@upstash/redis 0.0.0-ci.c37cc01e → 0.0.0-ci.c437cd1c22b89176b5ffe4b92611049333c93ef5-20250220102555

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