@upstash/redis 0.0.0-ci.fb6b986f-20221006 → 0.0.0-ci.fc1b22d0-20231019

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 (421) hide show
  1. package/.npmrc +1 -0
  2. package/README.md +21 -19
  3. package/cloudflare.d.mts +45 -0
  4. package/{types/platforms/cloudflare.d.ts → cloudflare.d.ts} +14 -11
  5. package/cloudflare.js +3062 -0
  6. package/cloudflare.js.map +1 -0
  7. package/cloudflare.mjs +3025 -0
  8. package/cloudflare.mjs.map +1 -0
  9. package/fastly.d.mts +43 -0
  10. package/{types/platforms/fastly.d.ts → fastly.d.ts} +8 -10
  11. package/fastly.js +3037 -0
  12. package/fastly.js.map +1 -0
  13. package/fastly.mjs +3000 -0
  14. package/fastly.mjs.map +1 -0
  15. package/{types/platforms/node_with_fetch.d.ts → nodejs.d.mts} +9 -11
  16. package/{types/platforms/nodejs.d.ts → nodejs.d.ts} +9 -10
  17. package/nodejs.js +3063 -0
  18. package/nodejs.js.map +1 -0
  19. package/nodejs.mjs +3026 -0
  20. package/nodejs.mjs.map +1 -0
  21. package/package.json +29 -38
  22. package/redis-e3e8473f.d.ts +1795 -0
  23. package/.releaserc +0 -14
  24. package/LICENSE +0 -21
  25. package/esm/deps/deno.land/x/base64@v0.2.1/base.js +0 -100
  26. package/esm/deps/deno.land/x/base64@v0.2.1/base64url.js +0 -9
  27. package/esm/deps/deno.land/x/sha1@v1.0.3/deps.js +0 -1
  28. package/esm/deps/deno.land/x/sha1@v1.0.3/mod.js +0 -191
  29. package/esm/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +0 -50
  30. package/esm/package.json +0 -3
  31. package/esm/pkg/commands/append.js +0 -9
  32. package/esm/pkg/commands/bitcount.js +0 -16
  33. package/esm/pkg/commands/bitop.js +0 -9
  34. package/esm/pkg/commands/bitpos.js +0 -9
  35. package/esm/pkg/commands/command.js +0 -57
  36. package/esm/pkg/commands/dbsize.js +0 -9
  37. package/esm/pkg/commands/decr.js +0 -9
  38. package/esm/pkg/commands/decrby.js +0 -9
  39. package/esm/pkg/commands/del.js +0 -9
  40. package/esm/pkg/commands/echo.js +0 -9
  41. package/esm/pkg/commands/eval.js +0 -9
  42. package/esm/pkg/commands/evalsha.js +0 -9
  43. package/esm/pkg/commands/exists.js +0 -9
  44. package/esm/pkg/commands/expire.js +0 -9
  45. package/esm/pkg/commands/expireat.js +0 -9
  46. package/esm/pkg/commands/flushall.js +0 -13
  47. package/esm/pkg/commands/flushdb.js +0 -13
  48. package/esm/pkg/commands/get.js +0 -9
  49. package/esm/pkg/commands/getbit.js +0 -9
  50. package/esm/pkg/commands/getrange.js +0 -9
  51. package/esm/pkg/commands/getset.js +0 -9
  52. package/esm/pkg/commands/hdel.js +0 -9
  53. package/esm/pkg/commands/hexists.js +0 -9
  54. package/esm/pkg/commands/hget.js +0 -9
  55. package/esm/pkg/commands/hgetall.js +0 -33
  56. package/esm/pkg/commands/hincrby.js +0 -9
  57. package/esm/pkg/commands/hincrbyfloat.js +0 -9
  58. package/esm/pkg/commands/hkeys.js +0 -9
  59. package/esm/pkg/commands/hlen.js +0 -9
  60. package/esm/pkg/commands/hmget.js +0 -35
  61. package/esm/pkg/commands/hmset.js +0 -13
  62. package/esm/pkg/commands/hscan.js +0 -16
  63. package/esm/pkg/commands/hset.js +0 -13
  64. package/esm/pkg/commands/hsetnx.js +0 -9
  65. package/esm/pkg/commands/hstrlen.js +0 -9
  66. package/esm/pkg/commands/hvals.js +0 -9
  67. package/esm/pkg/commands/incr.js +0 -9
  68. package/esm/pkg/commands/incrby.js +0 -9
  69. package/esm/pkg/commands/incrbyfloat.js +0 -9
  70. package/esm/pkg/commands/keys.js +0 -9
  71. package/esm/pkg/commands/lindex.js +0 -6
  72. package/esm/pkg/commands/linsert.js +0 -6
  73. package/esm/pkg/commands/llen.js +0 -9
  74. package/esm/pkg/commands/lpop.js +0 -9
  75. package/esm/pkg/commands/lpos.js +0 -19
  76. package/esm/pkg/commands/lpush.js +0 -9
  77. package/esm/pkg/commands/lpushx.js +0 -9
  78. package/esm/pkg/commands/lrange.js +0 -6
  79. package/esm/pkg/commands/lrem.js +0 -6
  80. package/esm/pkg/commands/lset.js +0 -6
  81. package/esm/pkg/commands/ltrim.js +0 -6
  82. package/esm/pkg/commands/mget.js +0 -9
  83. package/esm/pkg/commands/mod.js +0 -115
  84. package/esm/pkg/commands/mset.js +0 -12
  85. package/esm/pkg/commands/msetnx.js +0 -9
  86. package/esm/pkg/commands/persist.js +0 -9
  87. package/esm/pkg/commands/pexpire.js +0 -9
  88. package/esm/pkg/commands/pexpireat.js +0 -9
  89. package/esm/pkg/commands/ping.js +0 -13
  90. package/esm/pkg/commands/psetex.js +0 -9
  91. package/esm/pkg/commands/pttl.js +0 -9
  92. package/esm/pkg/commands/publish.js +0 -9
  93. package/esm/pkg/commands/randomkey.js +0 -9
  94. package/esm/pkg/commands/rename.js +0 -9
  95. package/esm/pkg/commands/renamenx.js +0 -9
  96. package/esm/pkg/commands/rpop.js +0 -9
  97. package/esm/pkg/commands/rpush.js +0 -9
  98. package/esm/pkg/commands/rpushx.js +0 -9
  99. package/esm/pkg/commands/sadd.js +0 -9
  100. package/esm/pkg/commands/scan.js +0 -19
  101. package/esm/pkg/commands/scard.js +0 -9
  102. package/esm/pkg/commands/script_exists.js +0 -12
  103. package/esm/pkg/commands/script_flush.js +0 -16
  104. package/esm/pkg/commands/script_load.js +0 -9
  105. package/esm/pkg/commands/sdiff.js +0 -9
  106. package/esm/pkg/commands/sdiffstore.js +0 -9
  107. package/esm/pkg/commands/set.js +0 -36
  108. package/esm/pkg/commands/setbit.js +0 -9
  109. package/esm/pkg/commands/setex.js +0 -9
  110. package/esm/pkg/commands/setnx.js +0 -9
  111. package/esm/pkg/commands/setrange.js +0 -9
  112. package/esm/pkg/commands/sinter.js +0 -9
  113. package/esm/pkg/commands/sinterstore.js +0 -9
  114. package/esm/pkg/commands/sismember.js +0 -9
  115. package/esm/pkg/commands/smembers.js +0 -9
  116. package/esm/pkg/commands/smove.js +0 -9
  117. package/esm/pkg/commands/spop.js +0 -13
  118. package/esm/pkg/commands/srandmember.js +0 -13
  119. package/esm/pkg/commands/srem.js +0 -9
  120. package/esm/pkg/commands/sscan.js +0 -16
  121. package/esm/pkg/commands/strlen.js +0 -9
  122. package/esm/pkg/commands/sunion.js +0 -9
  123. package/esm/pkg/commands/sunionstore.js +0 -9
  124. package/esm/pkg/commands/time.js +0 -9
  125. package/esm/pkg/commands/touch.js +0 -9
  126. package/esm/pkg/commands/ttl.js +0 -9
  127. package/esm/pkg/commands/type.js +0 -9
  128. package/esm/pkg/commands/unlink.js +0 -9
  129. package/esm/pkg/commands/zadd.js +0 -26
  130. package/esm/pkg/commands/zcard.js +0 -9
  131. package/esm/pkg/commands/zcount.js +0 -9
  132. package/esm/pkg/commands/zincrby.js +0 -9
  133. package/esm/pkg/commands/zinterstore.js +0 -27
  134. package/esm/pkg/commands/zlexcount.js +0 -9
  135. package/esm/pkg/commands/zmscore.js +0 -10
  136. package/esm/pkg/commands/zpopmax.js +0 -13
  137. package/esm/pkg/commands/zpopmin.js +0 -13
  138. package/esm/pkg/commands/zrange.js +0 -26
  139. package/esm/pkg/commands/zrank.js +0 -9
  140. package/esm/pkg/commands/zrem.js +0 -9
  141. package/esm/pkg/commands/zremrangebylex.js +0 -9
  142. package/esm/pkg/commands/zremrangebyrank.js +0 -9
  143. package/esm/pkg/commands/zremrangebyscore.js +0 -9
  144. package/esm/pkg/commands/zrevrank.js +0 -9
  145. package/esm/pkg/commands/zscan.js +0 -16
  146. package/esm/pkg/commands/zscore.js +0 -9
  147. package/esm/pkg/commands/zunionstore.js +0 -27
  148. package/esm/pkg/error.js +0 -9
  149. package/esm/pkg/http.js +0 -128
  150. package/esm/pkg/pipeline.js +0 -1144
  151. package/esm/pkg/redis.js +0 -1102
  152. package/esm/pkg/script.js +0 -77
  153. package/esm/pkg/types.js +0 -1
  154. package/esm/pkg/util.js +0 -31
  155. package/esm/platforms/cloudflare.js +0 -62
  156. package/esm/platforms/fastly.js +0 -40
  157. package/esm/platforms/node_with_fetch.js +0 -60
  158. package/esm/platforms/nodejs.js +0 -59
  159. package/script/deps/deno.land/x/base64@v0.2.1/base.js +0 -104
  160. package/script/deps/deno.land/x/base64@v0.2.1/base64url.js +0 -13
  161. package/script/deps/deno.land/x/sha1@v1.0.3/deps.js +0 -6
  162. package/script/deps/deno.land/x/sha1@v1.0.3/mod.js +0 -196
  163. package/script/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.js +0 -55
  164. package/script/package.json +0 -3
  165. package/script/pkg/commands/append.js +0 -13
  166. package/script/pkg/commands/bitcount.js +0 -20
  167. package/script/pkg/commands/bitop.js +0 -13
  168. package/script/pkg/commands/bitpos.js +0 -13
  169. package/script/pkg/commands/command.js +0 -61
  170. package/script/pkg/commands/dbsize.js +0 -13
  171. package/script/pkg/commands/decr.js +0 -13
  172. package/script/pkg/commands/decrby.js +0 -13
  173. package/script/pkg/commands/del.js +0 -13
  174. package/script/pkg/commands/echo.js +0 -13
  175. package/script/pkg/commands/eval.js +0 -13
  176. package/script/pkg/commands/evalsha.js +0 -13
  177. package/script/pkg/commands/exists.js +0 -13
  178. package/script/pkg/commands/expire.js +0 -13
  179. package/script/pkg/commands/expireat.js +0 -13
  180. package/script/pkg/commands/flushall.js +0 -17
  181. package/script/pkg/commands/flushdb.js +0 -17
  182. package/script/pkg/commands/get.js +0 -13
  183. package/script/pkg/commands/getbit.js +0 -13
  184. package/script/pkg/commands/getrange.js +0 -13
  185. package/script/pkg/commands/getset.js +0 -13
  186. package/script/pkg/commands/hdel.js +0 -13
  187. package/script/pkg/commands/hexists.js +0 -13
  188. package/script/pkg/commands/hget.js +0 -13
  189. package/script/pkg/commands/hgetall.js +0 -37
  190. package/script/pkg/commands/hincrby.js +0 -13
  191. package/script/pkg/commands/hincrbyfloat.js +0 -13
  192. package/script/pkg/commands/hkeys.js +0 -13
  193. package/script/pkg/commands/hlen.js +0 -13
  194. package/script/pkg/commands/hmget.js +0 -39
  195. package/script/pkg/commands/hmset.js +0 -17
  196. package/script/pkg/commands/hscan.js +0 -20
  197. package/script/pkg/commands/hset.js +0 -17
  198. package/script/pkg/commands/hsetnx.js +0 -13
  199. package/script/pkg/commands/hstrlen.js +0 -13
  200. package/script/pkg/commands/hvals.js +0 -13
  201. package/script/pkg/commands/incr.js +0 -13
  202. package/script/pkg/commands/incrby.js +0 -13
  203. package/script/pkg/commands/incrbyfloat.js +0 -13
  204. package/script/pkg/commands/keys.js +0 -13
  205. package/script/pkg/commands/lindex.js +0 -10
  206. package/script/pkg/commands/linsert.js +0 -10
  207. package/script/pkg/commands/llen.js +0 -13
  208. package/script/pkg/commands/lpop.js +0 -13
  209. package/script/pkg/commands/lpos.js +0 -23
  210. package/script/pkg/commands/lpush.js +0 -13
  211. package/script/pkg/commands/lpushx.js +0 -13
  212. package/script/pkg/commands/lrange.js +0 -10
  213. package/script/pkg/commands/lrem.js +0 -10
  214. package/script/pkg/commands/lset.js +0 -10
  215. package/script/pkg/commands/ltrim.js +0 -10
  216. package/script/pkg/commands/mget.js +0 -13
  217. package/script/pkg/commands/mod.js +0 -131
  218. package/script/pkg/commands/mset.js +0 -16
  219. package/script/pkg/commands/msetnx.js +0 -13
  220. package/script/pkg/commands/persist.js +0 -13
  221. package/script/pkg/commands/pexpire.js +0 -13
  222. package/script/pkg/commands/pexpireat.js +0 -13
  223. package/script/pkg/commands/ping.js +0 -17
  224. package/script/pkg/commands/psetex.js +0 -13
  225. package/script/pkg/commands/pttl.js +0 -13
  226. package/script/pkg/commands/publish.js +0 -13
  227. package/script/pkg/commands/randomkey.js +0 -13
  228. package/script/pkg/commands/rename.js +0 -13
  229. package/script/pkg/commands/renamenx.js +0 -13
  230. package/script/pkg/commands/rpop.js +0 -13
  231. package/script/pkg/commands/rpush.js +0 -13
  232. package/script/pkg/commands/rpushx.js +0 -13
  233. package/script/pkg/commands/sadd.js +0 -13
  234. package/script/pkg/commands/scan.js +0 -23
  235. package/script/pkg/commands/scard.js +0 -13
  236. package/script/pkg/commands/script_exists.js +0 -16
  237. package/script/pkg/commands/script_flush.js +0 -20
  238. package/script/pkg/commands/script_load.js +0 -13
  239. package/script/pkg/commands/sdiff.js +0 -13
  240. package/script/pkg/commands/sdiffstore.js +0 -13
  241. package/script/pkg/commands/set.js +0 -40
  242. package/script/pkg/commands/setbit.js +0 -13
  243. package/script/pkg/commands/setex.js +0 -13
  244. package/script/pkg/commands/setnx.js +0 -13
  245. package/script/pkg/commands/setrange.js +0 -13
  246. package/script/pkg/commands/sinter.js +0 -13
  247. package/script/pkg/commands/sinterstore.js +0 -13
  248. package/script/pkg/commands/sismember.js +0 -13
  249. package/script/pkg/commands/smembers.js +0 -13
  250. package/script/pkg/commands/smove.js +0 -13
  251. package/script/pkg/commands/spop.js +0 -17
  252. package/script/pkg/commands/srandmember.js +0 -17
  253. package/script/pkg/commands/srem.js +0 -13
  254. package/script/pkg/commands/sscan.js +0 -20
  255. package/script/pkg/commands/strlen.js +0 -13
  256. package/script/pkg/commands/sunion.js +0 -13
  257. package/script/pkg/commands/sunionstore.js +0 -13
  258. package/script/pkg/commands/time.js +0 -13
  259. package/script/pkg/commands/touch.js +0 -13
  260. package/script/pkg/commands/ttl.js +0 -13
  261. package/script/pkg/commands/type.js +0 -13
  262. package/script/pkg/commands/unlink.js +0 -13
  263. package/script/pkg/commands/zadd.js +0 -30
  264. package/script/pkg/commands/zcard.js +0 -13
  265. package/script/pkg/commands/zcount.js +0 -13
  266. package/script/pkg/commands/zincrby.js +0 -13
  267. package/script/pkg/commands/zinterstore.js +0 -31
  268. package/script/pkg/commands/zlexcount.js +0 -13
  269. package/script/pkg/commands/zmscore.js +0 -14
  270. package/script/pkg/commands/zpopmax.js +0 -17
  271. package/script/pkg/commands/zpopmin.js +0 -17
  272. package/script/pkg/commands/zrange.js +0 -30
  273. package/script/pkg/commands/zrank.js +0 -13
  274. package/script/pkg/commands/zrem.js +0 -13
  275. package/script/pkg/commands/zremrangebylex.js +0 -13
  276. package/script/pkg/commands/zremrangebyrank.js +0 -13
  277. package/script/pkg/commands/zremrangebyscore.js +0 -13
  278. package/script/pkg/commands/zrevrank.js +0 -13
  279. package/script/pkg/commands/zscan.js +0 -20
  280. package/script/pkg/commands/zscore.js +0 -13
  281. package/script/pkg/commands/zunionstore.js +0 -31
  282. package/script/pkg/error.js +0 -13
  283. package/script/pkg/http.js +0 -132
  284. package/script/pkg/pipeline.js +0 -1148
  285. package/script/pkg/redis.js +0 -1106
  286. package/script/pkg/script.js +0 -81
  287. package/script/pkg/types.js +0 -2
  288. package/script/pkg/util.js +0 -35
  289. package/script/platforms/cloudflare.js +0 -89
  290. package/script/platforms/fastly.js +0 -67
  291. package/script/platforms/node_with_fetch.js +0 -87
  292. package/script/platforms/nodejs.js +0 -86
  293. package/types/deps/deno.land/x/base64@v0.2.1/base.d.ts +0 -5
  294. package/types/deps/deno.land/x/base64@v0.2.1/base64url.d.ts +0 -1
  295. package/types/deps/deno.land/x/sha1@v1.0.3/deps.d.ts +0 -1
  296. package/types/deps/deno.land/x/sha1@v1.0.3/mod.d.ts +0 -26
  297. package/types/deps/denopkg.com/chiefbiiko/std-encoding@v1.0.0/mod.d.ts +0 -3
  298. package/types/pkg/commands/append.d.ts +0 -7
  299. package/types/pkg/commands/bitcount.d.ts +0 -8
  300. package/types/pkg/commands/bitop.d.ts +0 -12
  301. package/types/pkg/commands/bitpos.d.ts +0 -7
  302. package/types/pkg/commands/command.d.ts +0 -37
  303. package/types/pkg/commands/dbsize.d.ts +0 -7
  304. package/types/pkg/commands/decr.d.ts +0 -7
  305. package/types/pkg/commands/decrby.d.ts +0 -7
  306. package/types/pkg/commands/del.d.ts +0 -7
  307. package/types/pkg/commands/echo.d.ts +0 -7
  308. package/types/pkg/commands/eval.d.ts +0 -7
  309. package/types/pkg/commands/evalsha.d.ts +0 -7
  310. package/types/pkg/commands/exists.d.ts +0 -7
  311. package/types/pkg/commands/expire.d.ts +0 -7
  312. package/types/pkg/commands/expireat.d.ts +0 -7
  313. package/types/pkg/commands/flushall.d.ts +0 -9
  314. package/types/pkg/commands/flushdb.d.ts +0 -9
  315. package/types/pkg/commands/get.d.ts +0 -7
  316. package/types/pkg/commands/getbit.d.ts +0 -7
  317. package/types/pkg/commands/getrange.d.ts +0 -7
  318. package/types/pkg/commands/getset.d.ts +0 -7
  319. package/types/pkg/commands/hdel.d.ts +0 -7
  320. package/types/pkg/commands/hexists.d.ts +0 -7
  321. package/types/pkg/commands/hget.d.ts +0 -7
  322. package/types/pkg/commands/hgetall.d.ts +0 -7
  323. package/types/pkg/commands/hincrby.d.ts +0 -7
  324. package/types/pkg/commands/hincrbyfloat.d.ts +0 -7
  325. package/types/pkg/commands/hkeys.d.ts +0 -7
  326. package/types/pkg/commands/hlen.d.ts +0 -7
  327. package/types/pkg/commands/hmget.d.ts +0 -15
  328. package/types/pkg/commands/hmset.d.ts +0 -9
  329. package/types/pkg/commands/hscan.d.ts +0 -24
  330. package/types/pkg/commands/hset.d.ts +0 -9
  331. package/types/pkg/commands/hsetnx.d.ts +0 -7
  332. package/types/pkg/commands/hstrlen.d.ts +0 -7
  333. package/types/pkg/commands/hvals.d.ts +0 -7
  334. package/types/pkg/commands/incr.d.ts +0 -7
  335. package/types/pkg/commands/incrby.d.ts +0 -7
  336. package/types/pkg/commands/incrbyfloat.d.ts +0 -7
  337. package/types/pkg/commands/keys.d.ts +0 -7
  338. package/types/pkg/commands/lindex.d.ts +0 -4
  339. package/types/pkg/commands/linsert.d.ts +0 -9
  340. package/types/pkg/commands/llen.d.ts +0 -7
  341. package/types/pkg/commands/lpop.d.ts +0 -7
  342. package/types/pkg/commands/lpos.d.ts +0 -15
  343. package/types/pkg/commands/lpush.d.ts +0 -7
  344. package/types/pkg/commands/lpushx.d.ts +0 -7
  345. package/types/pkg/commands/lrange.d.ts +0 -4
  346. package/types/pkg/commands/lrem.d.ts +0 -4
  347. package/types/pkg/commands/lset.d.ts +0 -4
  348. package/types/pkg/commands/ltrim.d.ts +0 -4
  349. package/types/pkg/commands/mget.d.ts +0 -7
  350. package/types/pkg/commands/mod.d.ts +0 -115
  351. package/types/pkg/commands/mset.d.ts +0 -9
  352. package/types/pkg/commands/msetnx.d.ts +0 -9
  353. package/types/pkg/commands/persist.d.ts +0 -7
  354. package/types/pkg/commands/pexpire.d.ts +0 -7
  355. package/types/pkg/commands/pexpireat.d.ts +0 -7
  356. package/types/pkg/commands/ping.d.ts +0 -7
  357. package/types/pkg/commands/psetex.d.ts +0 -7
  358. package/types/pkg/commands/pttl.d.ts +0 -7
  359. package/types/pkg/commands/publish.d.ts +0 -7
  360. package/types/pkg/commands/randomkey.d.ts +0 -7
  361. package/types/pkg/commands/rename.d.ts +0 -7
  362. package/types/pkg/commands/renamenx.d.ts +0 -7
  363. package/types/pkg/commands/rpop.d.ts +0 -7
  364. package/types/pkg/commands/rpush.d.ts +0 -7
  365. package/types/pkg/commands/rpushx.d.ts +0 -7
  366. package/types/pkg/commands/sadd.d.ts +0 -7
  367. package/types/pkg/commands/scan.d.ts +0 -18
  368. package/types/pkg/commands/scard.d.ts +0 -7
  369. package/types/pkg/commands/script_exists.d.ts +0 -7
  370. package/types/pkg/commands/script_flush.d.ts +0 -14
  371. package/types/pkg/commands/script_load.d.ts +0 -7
  372. package/types/pkg/commands/sdiff.d.ts +0 -7
  373. package/types/pkg/commands/sdiffstore.d.ts +0 -7
  374. package/types/pkg/commands/set.d.ts +0 -55
  375. package/types/pkg/commands/setbit.d.ts +0 -7
  376. package/types/pkg/commands/setex.d.ts +0 -7
  377. package/types/pkg/commands/setnx.d.ts +0 -7
  378. package/types/pkg/commands/setrange.d.ts +0 -7
  379. package/types/pkg/commands/sinter.d.ts +0 -7
  380. package/types/pkg/commands/sinterstore.d.ts +0 -7
  381. package/types/pkg/commands/sismember.d.ts +0 -7
  382. package/types/pkg/commands/smembers.d.ts +0 -7
  383. package/types/pkg/commands/smove.d.ts +0 -7
  384. package/types/pkg/commands/spop.d.ts +0 -7
  385. package/types/pkg/commands/srandmember.d.ts +0 -7
  386. package/types/pkg/commands/srem.d.ts +0 -7
  387. package/types/pkg/commands/sscan.d.ts +0 -24
  388. package/types/pkg/commands/strlen.d.ts +0 -7
  389. package/types/pkg/commands/sunion.d.ts +0 -7
  390. package/types/pkg/commands/sunionstore.d.ts +0 -7
  391. package/types/pkg/commands/time.d.ts +0 -7
  392. package/types/pkg/commands/touch.d.ts +0 -7
  393. package/types/pkg/commands/ttl.d.ts +0 -7
  394. package/types/pkg/commands/type.d.ts +0 -8
  395. package/types/pkg/commands/unlink.d.ts +0 -7
  396. package/types/pkg/commands/zadd.d.ts +0 -35
  397. package/types/pkg/commands/zcard.d.ts +0 -7
  398. package/types/pkg/commands/zcount.d.ts +0 -7
  399. package/types/pkg/commands/zincrby.d.ts +0 -7
  400. package/types/pkg/commands/zinterstore.d.ts +0 -30
  401. package/types/pkg/commands/zlexcount.d.ts +0 -7
  402. package/types/pkg/commands/zmscore.d.ts +0 -7
  403. package/types/pkg/commands/zpopmax.d.ts +0 -7
  404. package/types/pkg/commands/zpopmin.d.ts +0 -7
  405. package/types/pkg/commands/zrange.d.ts +0 -42
  406. package/types/pkg/commands/zrank.d.ts +0 -7
  407. package/types/pkg/commands/zrem.d.ts +0 -7
  408. package/types/pkg/commands/zremrangebylex.d.ts +0 -7
  409. package/types/pkg/commands/zremrangebyrank.d.ts +0 -7
  410. package/types/pkg/commands/zremrangebyscore.d.ts +0 -7
  411. package/types/pkg/commands/zrevrank.d.ts +0 -7
  412. package/types/pkg/commands/zscan.d.ts +0 -24
  413. package/types/pkg/commands/zscore.d.ts +0 -7
  414. package/types/pkg/commands/zunionstore.d.ts +0 -30
  415. package/types/pkg/error.d.ts +0 -6
  416. package/types/pkg/http.d.ts +0 -54
  417. package/types/pkg/pipeline.d.ts +0 -552
  418. package/types/pkg/redis.d.ts +0 -534
  419. package/types/pkg/script.d.ts +0 -42
  420. package/types/pkg/types.d.ts +0 -1
  421. package/types/pkg/util.d.ts +0 -1
@@ -0,0 +1,1795 @@
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
+ enableTelemetry?: boolean;
27
+ };
28
+
29
+ type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
30
+ type UpstashRequest = {
31
+ path?: string[];
32
+ /**
33
+ * Request body will be serialized to json
34
+ */
35
+ body?: unknown;
36
+ };
37
+ type UpstashResponse<TResult> = {
38
+ result?: TResult;
39
+ error?: string;
40
+ };
41
+ interface Requester {
42
+ request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
43
+ }
44
+ type RetryConfig = false | {
45
+ /**
46
+ * The number of retries to attempt before giving up.
47
+ *
48
+ * @default 5
49
+ */
50
+ retries?: number;
51
+ /**
52
+ * A backoff function receives the current retry cound and returns a number in milliseconds to wait before retrying.
53
+ *
54
+ * @default
55
+ * ```ts
56
+ * Math.exp(retryCount) * 50
57
+ * ```
58
+ */
59
+ backoff?: (retryCount: number) => number;
60
+ };
61
+ type RequesterConfig = {
62
+ /**
63
+ * Configure the retry behaviour in case of network errors
64
+ */
65
+ retry?: RetryConfig;
66
+ /**
67
+ * Due to the nature of dynamic and custom data, it is possible to write data to redis that is not
68
+ * valid json and will therefore cause errors when deserializing. This used to happen very
69
+ * frequently with non-utf8 data, such as emojis.
70
+ *
71
+ * By default we will therefore encode the data as base64 on the server, before sending it to the
72
+ * client. The client will then decode the base64 data and parse it as utf8.
73
+ *
74
+ * For very large entries, this can add a few milliseconds, so if you are sure that your data is
75
+ * valid utf8, you can disable this behaviour by setting this option to false.
76
+ *
77
+ * Here's what the response body looks like:
78
+ *
79
+ * ```json
80
+ * {
81
+ * result?: "base64-encoded",
82
+ * error?: string
83
+ * }
84
+ * ```
85
+ *
86
+ * @default "base64"
87
+ */
88
+ responseEncoding?: false | "base64";
89
+ /**
90
+ * Configure the cache behaviour
91
+ * @default "no-store"
92
+ */
93
+ cache?: CacheSetting;
94
+ };
95
+
96
+ type Serialize = (data: unknown) => string | number | boolean;
97
+ type Deserialize<TResult, TData> = (result: TResult) => TData;
98
+ type CommandOptions<TResult, TData> = {
99
+ /**
100
+ * Custom deserializer
101
+ */
102
+ deserialize?: (result: TResult) => TData;
103
+ /**
104
+ * Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
105
+ *
106
+ * @default true
107
+ */
108
+ automaticDeserialization?: boolean;
109
+ };
110
+ /**
111
+ * Command offers default (de)serialization and the exec method to all commands.
112
+ *
113
+ * TData represents what the user will enter or receive,
114
+ * TResult is the raw data returned from upstash, which may need to be transformed or parsed.
115
+ */
116
+ declare class Command<TResult, TData> {
117
+ readonly command: (string | number | boolean)[];
118
+ readonly serialize: Serialize;
119
+ readonly deserialize: Deserialize<TResult, TData>;
120
+ /**
121
+ * Create a new command instance.
122
+ *
123
+ * You can define a custom `deserialize` function. By default we try to deserialize as json.
124
+ */
125
+ constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
126
+ /**
127
+ * Execute the command using a client.
128
+ */
129
+ exec(client: Requester): Promise<TData>;
130
+ }
131
+
132
+ type ZUnionStoreCommandOptions = {
133
+ aggregate?: "sum" | "min" | "max";
134
+ } & ({
135
+ weight: number;
136
+ weights?: never;
137
+ } | {
138
+ weight?: never;
139
+ weights: number[];
140
+ } | {
141
+ weight?: never;
142
+ weights?: never;
143
+ });
144
+
145
+ type ZUnionCommandOptions = {
146
+ withScores?: boolean;
147
+ aggregate?: "sum" | "min" | "max";
148
+ } & ({
149
+ weight: number;
150
+ weights?: never;
151
+ } | {
152
+ weight?: never;
153
+ weights: number[];
154
+ } | {
155
+ weight?: never;
156
+ weights?: never;
157
+ });
158
+
159
+ type ZInterStoreCommandOptions = {
160
+ aggregate?: "sum" | "min" | "max";
161
+ } & ({
162
+ weight: number;
163
+ weights?: never;
164
+ } | {
165
+ weight?: never;
166
+ weights: number[];
167
+ } | {
168
+ weight?: never;
169
+ weights?: never;
170
+ });
171
+
172
+ type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
173
+
174
+ type ScriptFlushCommandOptions = {
175
+ sync: true;
176
+ async?: never;
177
+ } | {
178
+ sync?: never;
179
+ async: true;
180
+ };
181
+
182
+ type ScanCommandOptions = {
183
+ match?: string;
184
+ count?: number;
185
+ type?: string;
186
+ };
187
+
188
+ type GeoAddCommandOptions = {
189
+ nx?: boolean;
190
+ xx?: never;
191
+ } | ({
192
+ nx?: never;
193
+ xx?: boolean;
194
+ } & {
195
+ ch?: boolean;
196
+ });
197
+ interface GeoMember<TMemberType> {
198
+ latitude: number;
199
+ longitude: number;
200
+ member: TMemberType;
201
+ }
202
+
203
+ /**
204
+ * @see https://redis.io/commands/bitop
205
+ */
206
+ declare class BitOpCommand extends Command<number, number> {
207
+ constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
208
+ constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
209
+ }
210
+
211
+ /**
212
+ * @see https://redis.io/commands/del
213
+ */
214
+ declare class DelCommand extends Command<number, number> {
215
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
216
+ }
217
+
218
+ /**
219
+ * @see https://redis.io/commands/exists
220
+ */
221
+ declare class ExistsCommand extends Command<number, number> {
222
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
223
+ }
224
+
225
+ /**
226
+ * @see https://redis.io/commands/flushall
227
+ */
228
+ declare class FlushAllCommand extends Command<"OK", "OK"> {
229
+ constructor(args?: [{
230
+ async?: boolean;
231
+ }], opts?: CommandOptions<"OK", "OK">);
232
+ }
233
+
234
+ /**
235
+ * @see https://redis.io/commands/json.get
236
+ */
237
+ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
238
+ constructor(cmd: [
239
+ key: string,
240
+ opts?: {
241
+ indent?: string;
242
+ newline?: string;
243
+ space?: string;
244
+ },
245
+ ...path: string[]
246
+ ] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
247
+ }
248
+
249
+ /**
250
+ * @see https://redis.io/commands/mget
251
+ */
252
+ declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
253
+ constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
254
+ }
255
+
256
+ /**
257
+ * @see https://redis.io/commands/ping
258
+ */
259
+ declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
260
+ constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
261
+ }
262
+
263
+ /**
264
+ * @see https://redis.io/commands/script-exists
265
+ */
266
+ declare class ScriptExistsCommand<T extends string[]> extends Command<string[], number[]> {
267
+ constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
268
+ }
269
+
270
+ type SetCommandOptions = {
271
+ get?: boolean;
272
+ } & ({
273
+ ex: number;
274
+ px?: never;
275
+ exat?: never;
276
+ pxat?: never;
277
+ keepTtl?: never;
278
+ } | {
279
+ ex?: never;
280
+ px: number;
281
+ exat?: never;
282
+ pxat?: never;
283
+ keepTtl?: never;
284
+ } | {
285
+ ex?: never;
286
+ px?: never;
287
+ exat: number;
288
+ pxat?: never;
289
+ keepTtl?: never;
290
+ } | {
291
+ ex?: never;
292
+ px?: never;
293
+ exat?: never;
294
+ pxat: number;
295
+ keepTtl?: never;
296
+ } | {
297
+ ex?: never;
298
+ px?: never;
299
+ exat?: never;
300
+ pxat?: never;
301
+ keepTtl: true;
302
+ } | {
303
+ ex?: never;
304
+ px?: never;
305
+ exat?: never;
306
+ pxat?: never;
307
+ keepTtl?: never;
308
+ }) & ({
309
+ nx: true;
310
+ xx?: never;
311
+ } | {
312
+ xx: true;
313
+ nx?: never;
314
+ } | {
315
+ xx?: never;
316
+ nx?: never;
317
+ });
318
+
319
+ /**
320
+ * @see https://redis.io/commands/touch
321
+ */
322
+ declare class TouchCommand extends Command<number, number> {
323
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
324
+ }
325
+
326
+ /**
327
+ * @see https://redis.io/commands/unlink
328
+ */
329
+ declare class UnlinkCommand extends Command<number, number> {
330
+ constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
331
+ }
332
+
333
+ type ZAddCommandOptions = ({
334
+ nx: true;
335
+ xx?: never;
336
+ } | {
337
+ nx?: never;
338
+ xx: true;
339
+ } | {
340
+ nx?: never;
341
+ xx?: never;
342
+ }) & {
343
+ ch?: true;
344
+ };
345
+ type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
346
+ incr: true;
347
+ };
348
+ type ScoreMember<TData> = {
349
+ score: number;
350
+ member: TData;
351
+ };
352
+
353
+ type ZRangeCommandOptions = {
354
+ withScores?: boolean;
355
+ rev?: boolean;
356
+ } & ({
357
+ byScore: true;
358
+ byLex?: never;
359
+ } | {
360
+ byScore?: never;
361
+ byLex: true;
362
+ } | {
363
+ byScore?: never;
364
+ byLex?: never;
365
+ }) & ({
366
+ offset: number;
367
+ count: number;
368
+ } | {
369
+ offset?: never;
370
+ count?: never;
371
+ });
372
+
373
+ type InferResponseData<T extends unknown[]> = {
374
+ [K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
375
+ };
376
+ /**
377
+ * Upstash REST API supports command pipelining to send multiple commands in
378
+ * batch, instead of sending each command one by one and waiting for a response.
379
+ * When using pipelines, several commands are sent using a single HTTP request,
380
+ * and a single JSON array response is returned. Each item in the response array
381
+ * corresponds to the command in the same order within the pipeline.
382
+ *
383
+ * **NOTE:**
384
+ *
385
+ * Execution of the pipeline is not atomic. Even though each command in
386
+ * the pipeline will be executed in order, commands sent by other clients can
387
+ * interleave with the pipeline.
388
+ *
389
+ * **Examples:**
390
+ *
391
+ * ```ts
392
+ * const p = redis.pipeline() // or redis.multi()
393
+ * p.set("key","value")
394
+ * p.get("key")
395
+ * const res = await p.exec()
396
+ * ```
397
+ *
398
+ * You can also chain commands together
399
+ * ```ts
400
+ * const p = redis.pipeline()
401
+ * const res = await p.set("key","value").get("key").exec()
402
+ * ```
403
+ *
404
+ * Return types are inferred if all commands are chained, but you can still
405
+ * override the response type manually:
406
+ * ```ts
407
+ * redis.pipeline()
408
+ * .set("key", { greeting: "hello"})
409
+ * .get("key")
410
+ * .exec<["OK", { greeting: string } ]>()
411
+ *
412
+ * ```
413
+ */
414
+ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
415
+ private client;
416
+ private commands;
417
+ private commandOptions?;
418
+ private multiExec;
419
+ constructor(opts: {
420
+ client: Requester;
421
+ commandOptions?: CommandOptions<any, any>;
422
+ multiExec?: boolean;
423
+ });
424
+ /**
425
+ * Send the pipeline request to upstash.
426
+ *
427
+ * Returns an array with the results of all pipelined commands.
428
+ *
429
+ * If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
430
+ * ```ts
431
+ * const p = redis.pipeline()
432
+ * p.get("key")
433
+ * const result = p.exec<[{ greeting: string }]>()
434
+ * ```
435
+ */
436
+ exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
437
+ /**
438
+ * Returns the length of pipeline before the execution
439
+ */
440
+ length(): number;
441
+ /**
442
+ * Pushes a command into the pipeline and returns a chainable instance of the
443
+ * pipeline
444
+ */
445
+ private chain;
446
+ /**
447
+ * @see https://redis.io/commands/append
448
+ */
449
+ append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
450
+ /**
451
+ * @see https://redis.io/commands/bitcount
452
+ */
453
+ bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
454
+ /**
455
+ * @see https://redis.io/commands/bitop
456
+ */
457
+ bitop: {
458
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
459
+ (op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
460
+ };
461
+ /**
462
+ * @see https://redis.io/commands/bitpos
463
+ */
464
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
465
+ /**
466
+ * @see https://redis.io/commands/zdiffstore
467
+ */
468
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
469
+ /**
470
+ * @see https://redis.io/commands/dbsize
471
+ */
472
+ dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
473
+ /**
474
+ * @see https://redis.io/commands/decr
475
+ */
476
+ decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
477
+ /**
478
+ * @see https://redis.io/commands/decrby
479
+ */
480
+ decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
481
+ /**
482
+ * @see https://redis.io/commands/del
483
+ */
484
+ del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
485
+ /**
486
+ * @see https://redis.io/commands/echo
487
+ */
488
+ echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
489
+ /**
490
+ * @see https://redis.io/commands/eval
491
+ */
492
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
493
+ /**
494
+ * @see https://redis.io/commands/evalsha
495
+ */
496
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
497
+ /**
498
+ * @see https://redis.io/commands/exists
499
+ */
500
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
501
+ /**
502
+ * @see https://redis.io/commands/expire
503
+ */
504
+ expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
505
+ /**
506
+ * @see https://redis.io/commands/expireat
507
+ */
508
+ expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
509
+ /**
510
+ * @see https://redis.io/commands/flushall
511
+ */
512
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
513
+ /**
514
+ * @see https://redis.io/commands/flushdb
515
+ */
516
+ flushdb: (opts?: {
517
+ async?: boolean | undefined;
518
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
519
+ /**
520
+ * @see https://redis.io/commands/get
521
+ */
522
+ get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
523
+ /**
524
+ * @see https://redis.io/commands/getbit
525
+ */
526
+ getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
527
+ /**
528
+ * @see https://redis.io/commands/getdel
529
+ */
530
+ getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
531
+ /**
532
+ * @see https://redis.io/commands/getrange
533
+ */
534
+ getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
535
+ /**
536
+ * @see https://redis.io/commands/getset
537
+ */
538
+ getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
539
+ /**
540
+ * @see https://redis.io/commands/hdel
541
+ */
542
+ hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
543
+ /**
544
+ * @see https://redis.io/commands/hexists
545
+ */
546
+ hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
547
+ /**
548
+ * @see https://redis.io/commands/hget
549
+ */
550
+ hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
551
+ /**
552
+ * @see https://redis.io/commands/hgetall
553
+ */
554
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
555
+ /**
556
+ * @see https://redis.io/commands/hincrby
557
+ */
558
+ hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
559
+ /**
560
+ * @see https://redis.io/commands/hincrbyfloat
561
+ */
562
+ hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
563
+ /**
564
+ * @see https://redis.io/commands/hkeys
565
+ */
566
+ hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
567
+ /**
568
+ * @see https://redis.io/commands/hlen
569
+ */
570
+ hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
571
+ /**
572
+ * @see https://redis.io/commands/hmget
573
+ */
574
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
575
+ /**
576
+ * @see https://redis.io/commands/hmset
577
+ */
578
+ hmset: <TData>(key: string, kv: {
579
+ [field: string]: TData;
580
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
581
+ /**
582
+ * @see https://redis.io/commands/hrandfield
583
+ */
584
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
585
+ /**
586
+ * @see https://redis.io/commands/hscan
587
+ */
588
+ hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
589
+ /**
590
+ * @see https://redis.io/commands/hset
591
+ */
592
+ hset: <TData>(key: string, kv: {
593
+ [field: string]: TData;
594
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
595
+ /**
596
+ * @see https://redis.io/commands/hsetnx
597
+ */
598
+ hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
599
+ /**
600
+ * @see https://redis.io/commands/hstrlen
601
+ */
602
+ hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
603
+ /**
604
+ * @see https://redis.io/commands/hvals
605
+ */
606
+ hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
607
+ /**
608
+ * @see https://redis.io/commands/incr
609
+ */
610
+ incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
611
+ /**
612
+ * @see https://redis.io/commands/incrby
613
+ */
614
+ incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
615
+ /**
616
+ * @see https://redis.io/commands/incrbyfloat
617
+ */
618
+ incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
619
+ /**
620
+ * @see https://redis.io/commands/keys
621
+ */
622
+ keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
623
+ /**
624
+ * @see https://redis.io/commands/lindex
625
+ */
626
+ lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
627
+ /**
628
+ * @see https://redis.io/commands/linsert
629
+ */
630
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
631
+ /**
632
+ * @see https://redis.io/commands/llen
633
+ */
634
+ llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
635
+ /**
636
+ * @see https://redis.io/commands/lmove
637
+ */
638
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
639
+ /**
640
+ * @see https://redis.io/commands/lpop
641
+ */
642
+ lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
643
+ /**
644
+ * @see https://redis.io/commands/lpos
645
+ */
646
+ lpos: <TData>(key: string, element: unknown, opts?: {
647
+ rank?: number | undefined;
648
+ count?: number | undefined;
649
+ maxLen?: number | undefined;
650
+ } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
651
+ /**
652
+ * @see https://redis.io/commands/lpush
653
+ */
654
+ lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
655
+ /**
656
+ * @see https://redis.io/commands/lpushx
657
+ */
658
+ lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
659
+ /**
660
+ * @see https://redis.io/commands/lrange
661
+ */
662
+ lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
663
+ /**
664
+ * @see https://redis.io/commands/lrem
665
+ */
666
+ lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
667
+ /**
668
+ * @see https://redis.io/commands/lset
669
+ */
670
+ lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
671
+ /**
672
+ * @see https://redis.io/commands/ltrim
673
+ */
674
+ ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
675
+ /**
676
+ * @see https://redis.io/commands/mget
677
+ */
678
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
679
+ /**
680
+ * @see https://redis.io/commands/mset
681
+ */
682
+ mset: <TData>(kv: {
683
+ [key: string]: TData;
684
+ }) => Pipeline<[...TCommands, Command<any, "OK">]>;
685
+ /**
686
+ * @see https://redis.io/commands/msetnx
687
+ */
688
+ msetnx: <TData>(kv: {
689
+ [key: string]: TData;
690
+ }) => Pipeline<[...TCommands, Command<any, number>]>;
691
+ /**
692
+ * @see https://redis.io/commands/persist
693
+ */
694
+ persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
695
+ /**
696
+ * @see https://redis.io/commands/pexpire
697
+ */
698
+ pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
699
+ /**
700
+ * @see https://redis.io/commands/pexpireat
701
+ */
702
+ pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
703
+ /**
704
+ * @see https://redis.io/commands/ping
705
+ */
706
+ ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
707
+ /**
708
+ * @see https://redis.io/commands/psetex
709
+ */
710
+ psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
711
+ /**
712
+ * @see https://redis.io/commands/pttl
713
+ */
714
+ pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
715
+ /**
716
+ * @see https://redis.io/commands/publish
717
+ */
718
+ publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
719
+ /**
720
+ * @see https://redis.io/commands/randomkey
721
+ */
722
+ randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
723
+ /**
724
+ * @see https://redis.io/commands/rename
725
+ */
726
+ rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
727
+ /**
728
+ * @see https://redis.io/commands/renamenx
729
+ */
730
+ renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
731
+ /**
732
+ * @see https://redis.io/commands/rpop
733
+ */
734
+ rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
735
+ /**
736
+ * @see https://redis.io/commands/rpush
737
+ */
738
+ rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
739
+ /**
740
+ * @see https://redis.io/commands/rpushx
741
+ */
742
+ rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
743
+ /**
744
+ * @see https://redis.io/commands/sadd
745
+ */
746
+ sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
747
+ /**
748
+ * @see https://redis.io/commands/scan
749
+ */
750
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
751
+ /**
752
+ * @see https://redis.io/commands/scard
753
+ */
754
+ scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
755
+ /**
756
+ * @see https://redis.io/commands/script-exists
757
+ */
758
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
759
+ /**
760
+ * @see https://redis.io/commands/script-flush
761
+ */
762
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
763
+ /**
764
+ * @see https://redis.io/commands/script-load
765
+ */
766
+ scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
767
+ sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
768
+ /**
769
+ * @see https://redis.io/commands/sdiffstore
770
+ */
771
+ sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
772
+ /**
773
+ * @see https://redis.io/commands/set
774
+ */
775
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
776
+ /**
777
+ * @see https://redis.io/commands/setbit
778
+ */
779
+ setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
780
+ /**
781
+ * @see https://redis.io/commands/setex
782
+ */
783
+ setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
784
+ /**
785
+ * @see https://redis.io/commands/setnx
786
+ */
787
+ setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
788
+ /**
789
+ * @see https://redis.io/commands/setrange
790
+ */
791
+ setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
792
+ /**
793
+ * @see https://redis.io/commands/sinter
794
+ */
795
+ sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
796
+ /**
797
+ * @see https://redis.io/commands/sinterstore
798
+ */
799
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
800
+ /**
801
+ * @see https://redis.io/commands/sismember
802
+ */
803
+ sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
804
+ /**
805
+ * @see https://redis.io/commands/smembers
806
+ */
807
+ smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
808
+ /**
809
+ * @see https://redis.io/commands/smismember
810
+ */
811
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
812
+ /**
813
+ * @see https://redis.io/commands/smove
814
+ */
815
+ smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
816
+ /**
817
+ * @see https://redis.io/commands/spop
818
+ */
819
+ spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
820
+ /**
821
+ * @see https://redis.io/commands/srandmember
822
+ */
823
+ srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
824
+ /**
825
+ * @see https://redis.io/commands/srem
826
+ */
827
+ srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
828
+ /**
829
+ * @see https://redis.io/commands/sscan
830
+ */
831
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
832
+ /**
833
+ * @see https://redis.io/commands/strlen
834
+ */
835
+ strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
836
+ /**
837
+ * @see https://redis.io/commands/sunion
838
+ */
839
+ sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
840
+ /**
841
+ * @see https://redis.io/commands/sunionstore
842
+ */
843
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
844
+ /**
845
+ * @see https://redis.io/commands/time
846
+ */
847
+ time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
848
+ /**
849
+ * @see https://redis.io/commands/touch
850
+ */
851
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
852
+ /**
853
+ * @see https://redis.io/commands/ttl
854
+ */
855
+ ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
856
+ /**
857
+ * @see https://redis.io/commands/type
858
+ */
859
+ type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
860
+ /**
861
+ * @see https://redis.io/commands/unlink
862
+ */
863
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
864
+ /**
865
+ * @see https://redis.io/commands/zadd
866
+ */
867
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
868
+ /**
869
+ * @see https://redis.io/commands/zcard
870
+ */
871
+ zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
872
+ /**
873
+ * @see https://redis.io/commands/zcount
874
+ */
875
+ zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
876
+ /**
877
+ * @see https://redis.io/commands/zincrby
878
+ */
879
+ zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
880
+ /**
881
+ * @see https://redis.io/commands/zinterstore
882
+ */
883
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
884
+ /**
885
+ * @see https://redis.io/commands/zlexcount
886
+ */
887
+ zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
888
+ /**
889
+ * @see https://redis.io/commands/zmscore
890
+ */
891
+ zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
892
+ /**
893
+ * @see https://redis.io/commands/zpopmax
894
+ */
895
+ zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
896
+ /**
897
+ * @see https://redis.io/commands/zpopmin
898
+ */
899
+ zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
900
+ /**
901
+ * @see https://redis.io/commands/zrange
902
+ */
903
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
904
+ key: string,
905
+ min: `(${string}` | `[${string}` | "-" | "+",
906
+ max: `(${string}` | `[${string}` | "-" | "+",
907
+ opts: {
908
+ byLex: true;
909
+ } & ZRangeCommandOptions
910
+ ] | [
911
+ key: string,
912
+ min: number | `(${number}` | "-inf" | "+inf",
913
+ max: number | `(${number}` | "-inf" | "+inf",
914
+ opts: {
915
+ byScore: true;
916
+ } & ZRangeCommandOptions
917
+ ]) => Pipeline<[...TCommands, Command<any, TData>]>;
918
+ /**
919
+ * @see https://redis.io/commands/zrank
920
+ */
921
+ zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
922
+ /**
923
+ * @see https://redis.io/commands/zrem
924
+ */
925
+ zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
926
+ /**
927
+ * @see https://redis.io/commands/zremrangebylex
928
+ */
929
+ zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
930
+ /**
931
+ * @see https://redis.io/commands/zremrangebyrank
932
+ */
933
+ zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
934
+ /**
935
+ * @see https://redis.io/commands/zremrangebyscore
936
+ */
937
+ zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
938
+ /**
939
+ * @see https://redis.io/commands/zrevrank
940
+ */
941
+ zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
942
+ /**
943
+ * @see https://redis.io/commands/zscan
944
+ */
945
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
946
+ /**
947
+ * @see https://redis.io/commands/zscore
948
+ */
949
+ zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
950
+ /**
951
+ * @see https://redis.io/commands/zunionstore
952
+ */
953
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
954
+ /**
955
+ * @see https://redis.io/commands/zunion
956
+ */
957
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
958
+ /**
959
+ * @see https://redis.io/commands/?group=json
960
+ */
961
+ get json(): {
962
+ /**
963
+ * @see https://redis.io/commands/json.arrappend
964
+ */
965
+ arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
966
+ /**
967
+ * @see https://redis.io/commands/json.arrindex
968
+ */
969
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
970
+ /**
971
+ * @see https://redis.io/commands/json.arrinsert
972
+ */
973
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
974
+ /**
975
+ * @see https://redis.io/commands/json.arrlen
976
+ */
977
+ arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
978
+ /**
979
+ * @see https://redis.io/commands/json.arrpop
980
+ */
981
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
982
+ /**
983
+ * @see https://redis.io/commands/json.arrtrim
984
+ */
985
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
986
+ /**
987
+ * @see https://redis.io/commands/json.clear
988
+ */
989
+ clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
990
+ /**
991
+ * @see https://redis.io/commands/json.del
992
+ */
993
+ del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
994
+ /**
995
+ * @see https://redis.io/commands/json.forget
996
+ */
997
+ forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
998
+ /**
999
+ * @see https://redis.io/commands/geoadd
1000
+ */
1001
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
1002
+ /**
1003
+ * @see https://redis.io/commands/geodist
1004
+ */
1005
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
1006
+ /**
1007
+ * @see https://redis.io/commands/json.get
1008
+ */
1009
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
1010
+ /**
1011
+ * @see https://redis.io/commands/json.mget
1012
+ */
1013
+ mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
1014
+ /**
1015
+ * @see https://redis.io/commands/json.numincrby
1016
+ */
1017
+ numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
1018
+ /**
1019
+ * @see https://redis.io/commands/json.nummultby
1020
+ */
1021
+ nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
1022
+ /**
1023
+ * @see https://redis.io/commands/json.objkeys
1024
+ */
1025
+ objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
1026
+ /**
1027
+ * @see https://redis.io/commands/json.objlen
1028
+ */
1029
+ objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
1030
+ /**
1031
+ * @see https://redis.io/commands/json.resp
1032
+ */
1033
+ resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
1034
+ /**
1035
+ * @see https://redis.io/commands/json.set
1036
+ */
1037
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
1038
+ nx: true;
1039
+ xx?: undefined;
1040
+ } | {
1041
+ nx?: undefined;
1042
+ xx: true;
1043
+ } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
1044
+ /**
1045
+ * @see https://redis.io/commands/json.strappend
1046
+ */
1047
+ strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
1048
+ /**
1049
+ * @see https://redis.io/commands/json.strlen
1050
+ */
1051
+ strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
1052
+ /**
1053
+ * @see https://redis.io/commands/json.toggle
1054
+ */
1055
+ toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
1056
+ /**
1057
+ * @see https://redis.io/commands/json.type
1058
+ */
1059
+ type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
1060
+ };
1061
+ }
1062
+
1063
+ /**
1064
+ * Creates a new script.
1065
+ *
1066
+ * Scripts offer the ability to optimistically try to execute a script without having to send the
1067
+ * entire script to the server. If the script is loaded on the server, it tries again by sending
1068
+ * the entire script. Afterwards, the script is cached on the server.
1069
+ *
1070
+ * @example
1071
+ * ```ts
1072
+ * const redis = new Redis({...})
1073
+ *
1074
+ * const script = redis.createScript<string>("return ARGV[1];")
1075
+ * const arg1 = await script.eval([], ["Hello World"])
1076
+ * expect(arg1, "Hello World")
1077
+ * ```
1078
+ */
1079
+ declare class Script<TResult = unknown> {
1080
+ readonly script: string;
1081
+ readonly sha1: string;
1082
+ private readonly redis;
1083
+ constructor(redis: Redis, script: string);
1084
+ /**
1085
+ * Send an `EVAL` command to redis.
1086
+ */
1087
+ eval(keys: string[], args: string[]): Promise<TResult>;
1088
+ /**
1089
+ * Calculates the sha1 hash of the script and then calls `EVALSHA`.
1090
+ */
1091
+ evalsha(keys: string[], args: string[]): Promise<TResult>;
1092
+ /**
1093
+ * Optimistically try to run `EVALSHA` first.
1094
+ * If the script is not loaded in redis, it will fall back and try again with `EVAL`.
1095
+ *
1096
+ * Following calls will be able to use the cached script
1097
+ */
1098
+ exec(keys: string[], args: string[]): Promise<TResult>;
1099
+ /**
1100
+ * Compute the sha1 hash of the script and return its hex representation.
1101
+ */
1102
+ private digest;
1103
+ }
1104
+
1105
+ /**
1106
+ * Serverless redis client for upstash.
1107
+ */
1108
+ declare class Redis {
1109
+ protected client: Requester;
1110
+ protected opts?: CommandOptions<any, any>;
1111
+ protected enableTelemetry: boolean;
1112
+ /**
1113
+ * Create a new redis client
1114
+ *
1115
+ * @example
1116
+ * ```typescript
1117
+ * const redis = new Redis({
1118
+ * url: "<UPSTASH_REDIS_REST_URL>",
1119
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
1120
+ * });
1121
+ * ```
1122
+ */
1123
+ constructor(client: Requester, opts?: RedisOptions);
1124
+ get json(): {
1125
+ /**
1126
+ * @see https://redis.io/commands/json.arrappend
1127
+ */
1128
+ arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
1129
+ /**
1130
+ * @see https://redis.io/commands/json.arrindex
1131
+ */
1132
+ arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
1133
+ /**
1134
+ * @see https://redis.io/commands/json.arrinsert
1135
+ */
1136
+ arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
1137
+ /**
1138
+ * @see https://redis.io/commands/json.arrlen
1139
+ */
1140
+ arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
1141
+ /**
1142
+ * @see https://redis.io/commands/json.arrpop
1143
+ */
1144
+ arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
1145
+ /**
1146
+ * @see https://redis.io/commands/json.arrtrim
1147
+ */
1148
+ arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
1149
+ /**
1150
+ * @see https://redis.io/commands/json.clear
1151
+ */
1152
+ clear: (key: string, path?: string | undefined) => Promise<number>;
1153
+ /**
1154
+ * @see https://redis.io/commands/json.del
1155
+ */
1156
+ del: (key: string, path?: string | undefined) => Promise<number>;
1157
+ /**
1158
+ * @see https://redis.io/commands/json.forget
1159
+ */
1160
+ forget: (key: string, path?: string | undefined) => Promise<number>;
1161
+ /**
1162
+ * @see https://redis.io/commands/geoadd
1163
+ */
1164
+ geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
1165
+ /**
1166
+ * @see https://redis.io/commands/geodist
1167
+ */
1168
+ geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
1169
+ /**
1170
+ * @see https://redis.io/commands/json.get
1171
+ */
1172
+ get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
1173
+ /**
1174
+ * @see https://redis.io/commands/json.mget
1175
+ */
1176
+ mget: (keys: string[], path: string) => Promise<any>;
1177
+ /**
1178
+ * @see https://redis.io/commands/json.numincrby
1179
+ */
1180
+ numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
1181
+ /**
1182
+ * @see https://redis.io/commands/json.nummultby
1183
+ */
1184
+ nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
1185
+ /**
1186
+ * @see https://redis.io/commands/json.objkeys
1187
+ */
1188
+ objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
1189
+ /**
1190
+ * @see https://redis.io/commands/json.objlen
1191
+ */
1192
+ objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
1193
+ /**
1194
+ * @see https://redis.io/commands/json.resp
1195
+ */
1196
+ resp: (key: string, path?: string | undefined) => Promise<any>;
1197
+ /**
1198
+ * @see https://redis.io/commands/json.set
1199
+ */
1200
+ set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
1201
+ nx: true;
1202
+ xx?: undefined;
1203
+ } | {
1204
+ nx?: undefined;
1205
+ xx: true;
1206
+ } | undefined) => Promise<"OK" | null>;
1207
+ /**
1208
+ * @see https://redis.io/commands/json.strappend
1209
+ */
1210
+ strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
1211
+ /**
1212
+ * @see https://redis.io/commands/json.strlen
1213
+ */
1214
+ strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
1215
+ /**
1216
+ * @see https://redis.io/commands/json.toggle
1217
+ */
1218
+ toggle: (key: string, path: string) => Promise<number[]>;
1219
+ /**
1220
+ * @see https://redis.io/commands/json.type
1221
+ */
1222
+ type: (key: string, path?: string | undefined) => Promise<string[]>;
1223
+ };
1224
+ /**
1225
+ * Wrap a new middleware around the HTTP client.
1226
+ */
1227
+ use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
1228
+ /**
1229
+ * Technically this is not private, we can hide it from intellisense by doing this
1230
+ */
1231
+ protected addTelemetry: (telemetry: Telemetry) => void;
1232
+ createScript(script: string): Script;
1233
+ /**
1234
+ * Create a new pipeline that allows you to send requests in bulk.
1235
+ *
1236
+ * @see {@link Pipeline}
1237
+ */
1238
+ pipeline: () => Pipeline<[]>;
1239
+ /**
1240
+ * Create a new transaction to allow executing multiple steps atomically.
1241
+ *
1242
+ * All the commands in a transaction are serialized and executed sequentially. A request sent by
1243
+ * another client will never be served in the middle of the execution of a Redis Transaction. This
1244
+ * guarantees that the commands are executed as a single isolated operation.
1245
+ *
1246
+ * @see {@link Pipeline}
1247
+ */
1248
+ multi: () => Pipeline<[]>;
1249
+ /**
1250
+ * @see https://redis.io/commands/append
1251
+ */
1252
+ append: (key: string, value: string) => Promise<number>;
1253
+ /**
1254
+ * @see https://redis.io/commands/bitcount
1255
+ */
1256
+ bitcount: (key: string, start: number, end: number) => Promise<number>;
1257
+ /**
1258
+ * @see https://redis.io/commands/bitop
1259
+ */
1260
+ bitop: {
1261
+ (op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
1262
+ (op: "not", destinationKey: string, sourceKey: string): Promise<number>;
1263
+ };
1264
+ /**
1265
+ * @see https://redis.io/commands/bitpos
1266
+ */
1267
+ bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
1268
+ /**
1269
+ * @see https://redis.io/commands/dbsize
1270
+ */
1271
+ dbsize: () => Promise<number>;
1272
+ /**
1273
+ * @see https://redis.io/commands/decr
1274
+ */
1275
+ decr: (key: string) => Promise<number>;
1276
+ /**
1277
+ * @see https://redis.io/commands/decrby
1278
+ */
1279
+ decrby: (key: string, decrement: number) => Promise<number>;
1280
+ /**
1281
+ * @see https://redis.io/commands/del
1282
+ */
1283
+ del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
1284
+ /**
1285
+ * @see https://redis.io/commands/echo
1286
+ */
1287
+ echo: (message: string) => Promise<string>;
1288
+ /**
1289
+ * @see https://redis.io/commands/eval
1290
+ */
1291
+ eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
1292
+ /**
1293
+ * @see https://redis.io/commands/evalsha
1294
+ */
1295
+ evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
1296
+ /**
1297
+ * @see https://redis.io/commands/exists
1298
+ */
1299
+ exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
1300
+ /**
1301
+ * @see https://redis.io/commands/expire
1302
+ */
1303
+ expire: (key: string, seconds: number) => Promise<0 | 1>;
1304
+ /**
1305
+ * @see https://redis.io/commands/expireat
1306
+ */
1307
+ expireat: (key: string, unix: number) => Promise<0 | 1>;
1308
+ /**
1309
+ * @see https://redis.io/commands/flushall
1310
+ */
1311
+ flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
1312
+ /**
1313
+ * @see https://redis.io/commands/flushdb
1314
+ */
1315
+ flushdb: (opts?: {
1316
+ async?: boolean | undefined;
1317
+ } | undefined) => Promise<"OK">;
1318
+ /**
1319
+ * @see https://redis.io/commands/get
1320
+ */
1321
+ get: <TData>(key: string) => Promise<TData | null>;
1322
+ /**
1323
+ * @see https://redis.io/commands/getbit
1324
+ */
1325
+ getbit: (key: string, offset: number) => Promise<0 | 1>;
1326
+ /**
1327
+ * @see https://redis.io/commands/getdel
1328
+ */
1329
+ getdel: <TData>(key: string) => Promise<TData | null>;
1330
+ /**
1331
+ * @see https://redis.io/commands/getrange
1332
+ */
1333
+ getrange: (key: string, start: number, end: number) => Promise<string>;
1334
+ /**
1335
+ * @see https://redis.io/commands/getset
1336
+ */
1337
+ getset: <TData>(key: string, value: TData) => Promise<TData | null>;
1338
+ /**
1339
+ * @see https://redis.io/commands/hdel
1340
+ */
1341
+ hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
1342
+ /**
1343
+ * @see https://redis.io/commands/hexists
1344
+ */
1345
+ hexists: (key: string, field: string) => Promise<number>;
1346
+ /**
1347
+ * @see https://redis.io/commands/hget
1348
+ */
1349
+ hget: <TData>(key: string, field: string) => Promise<TData | null>;
1350
+ /**
1351
+ * @see https://redis.io/commands/hgetall
1352
+ */
1353
+ hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
1354
+ /**
1355
+ * @see https://redis.io/commands/hincrby
1356
+ */
1357
+ hincrby: (key: string, field: string, increment: number) => Promise<number>;
1358
+ /**
1359
+ * @see https://redis.io/commands/hincrbyfloat
1360
+ */
1361
+ hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
1362
+ /**
1363
+ * @see https://redis.io/commands/hkeys
1364
+ */
1365
+ hkeys: (key: string) => Promise<string[]>;
1366
+ /**
1367
+ * @see https://redis.io/commands/hlen
1368
+ */
1369
+ hlen: (key: string) => Promise<number>;
1370
+ /**
1371
+ * @see https://redis.io/commands/hmget
1372
+ */
1373
+ hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
1374
+ /**
1375
+ * @see https://redis.io/commands/hmset
1376
+ */
1377
+ hmset: <TData>(key: string, kv: {
1378
+ [field: string]: TData;
1379
+ }) => Promise<"OK">;
1380
+ /**
1381
+ * @see https://redis.io/commands/hrandfield
1382
+ */
1383
+ hrandfield: {
1384
+ (key: string): Promise<string>;
1385
+ (key: string, count: number): Promise<string[]>;
1386
+ <TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
1387
+ };
1388
+ /**
1389
+ * @see https://redis.io/commands/hscan
1390
+ */
1391
+ hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
1392
+ /**
1393
+ * @see https://redis.io/commands/hset
1394
+ */
1395
+ hset: <TData>(key: string, kv: {
1396
+ [field: string]: TData;
1397
+ }) => Promise<number>;
1398
+ /**
1399
+ * @see https://redis.io/commands/hsetnx
1400
+ */
1401
+ hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
1402
+ /**
1403
+ * @see https://redis.io/commands/hstrlen
1404
+ */
1405
+ hstrlen: (key: string, field: string) => Promise<number>;
1406
+ /**
1407
+ * @see https://redis.io/commands/hvals
1408
+ */
1409
+ hvals: (key: string) => Promise<any>;
1410
+ /**
1411
+ * @see https://redis.io/commands/incr
1412
+ */
1413
+ incr: (key: string) => Promise<number>;
1414
+ /**
1415
+ * @see https://redis.io/commands/incrby
1416
+ */
1417
+ incrby: (key: string, value: number) => Promise<number>;
1418
+ /**
1419
+ * @see https://redis.io/commands/incrbyfloat
1420
+ */
1421
+ incrbyfloat: (key: string, value: number) => Promise<number>;
1422
+ /**
1423
+ * @see https://redis.io/commands/keys
1424
+ */
1425
+ keys: (pattern: string) => Promise<string[]>;
1426
+ /**
1427
+ * @see https://redis.io/commands/lindex
1428
+ */
1429
+ lindex: (key: string, index: number) => Promise<any>;
1430
+ /**
1431
+ * @see https://redis.io/commands/linsert
1432
+ */
1433
+ linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
1434
+ /**
1435
+ * @see https://redis.io/commands/llen
1436
+ */
1437
+ llen: (key: string) => Promise<number>;
1438
+ /**
1439
+ * @see https://redis.io/commands/lmove
1440
+ */
1441
+ lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
1442
+ /**
1443
+ * @see https://redis.io/commands/lpop
1444
+ */
1445
+ lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
1446
+ /**
1447
+ * @see https://redis.io/commands/lpos
1448
+ */
1449
+ lpos: <TData = number>(key: string, element: unknown, opts?: {
1450
+ rank?: number | undefined;
1451
+ count?: number | undefined;
1452
+ maxLen?: number | undefined;
1453
+ } | undefined) => Promise<TData>;
1454
+ /**
1455
+ * @see https://redis.io/commands/lpush
1456
+ */
1457
+ lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
1458
+ /**
1459
+ * @see https://redis.io/commands/lpushx
1460
+ */
1461
+ lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
1462
+ /**
1463
+ * @see https://redis.io/commands/lrange
1464
+ */
1465
+ lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
1466
+ /**
1467
+ * @see https://redis.io/commands/lrem
1468
+ */
1469
+ lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
1470
+ /**
1471
+ * @see https://redis.io/commands/lset
1472
+ */
1473
+ lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
1474
+ /**
1475
+ * @see https://redis.io/commands/ltrim
1476
+ */
1477
+ ltrim: (key: string, start: number, end: number) => Promise<"OK">;
1478
+ /**
1479
+ * @see https://redis.io/commands/mget
1480
+ */
1481
+ mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
1482
+ /**
1483
+ * @see https://redis.io/commands/mset
1484
+ */
1485
+ mset: <TData>(kv: {
1486
+ [key: string]: TData;
1487
+ }) => Promise<"OK">;
1488
+ /**
1489
+ * @see https://redis.io/commands/msetnx
1490
+ */
1491
+ msetnx: <TData>(kv: {
1492
+ [key: string]: TData;
1493
+ }) => Promise<number>;
1494
+ /**
1495
+ * @see https://redis.io/commands/persist
1496
+ */
1497
+ persist: (key: string) => Promise<0 | 1>;
1498
+ /**
1499
+ * @see https://redis.io/commands/pexpire
1500
+ */
1501
+ pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
1502
+ /**
1503
+ * @see https://redis.io/commands/pexpireat
1504
+ */
1505
+ pexpireat: (key: string, unix: number) => Promise<0 | 1>;
1506
+ /**
1507
+ * @see https://redis.io/commands/ping
1508
+ */
1509
+ ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
1510
+ /**
1511
+ * @see https://redis.io/commands/psetex
1512
+ */
1513
+ psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
1514
+ /**
1515
+ * @see https://redis.io/commands/pttl
1516
+ */
1517
+ pttl: (key: string) => Promise<number>;
1518
+ /**
1519
+ * @see https://redis.io/commands/publish
1520
+ */
1521
+ publish: (channel: string, message: unknown) => Promise<number>;
1522
+ /**
1523
+ * @see https://redis.io/commands/randomkey
1524
+ */
1525
+ randomkey: () => Promise<string | null>;
1526
+ /**
1527
+ * @see https://redis.io/commands/rename
1528
+ */
1529
+ rename: (source: string, destination: string) => Promise<"OK">;
1530
+ /**
1531
+ * @see https://redis.io/commands/renamenx
1532
+ */
1533
+ renamenx: (source: string, destination: string) => Promise<0 | 1>;
1534
+ /**
1535
+ * @see https://redis.io/commands/rpop
1536
+ */
1537
+ rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
1538
+ /**
1539
+ * @see https://redis.io/commands/rpush
1540
+ */
1541
+ rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
1542
+ /**
1543
+ * @see https://redis.io/commands/rpushx
1544
+ */
1545
+ rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
1546
+ /**
1547
+ * @see https://redis.io/commands/sadd
1548
+ */
1549
+ sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
1550
+ /**
1551
+ * @see https://redis.io/commands/scan
1552
+ */
1553
+ scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
1554
+ /**
1555
+ * @see https://redis.io/commands/scard
1556
+ */
1557
+ scard: (key: string) => Promise<number>;
1558
+ /**
1559
+ * @see https://redis.io/commands/script-exists
1560
+ */
1561
+ scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
1562
+ /**
1563
+ * @see https://redis.io/commands/script-flush
1564
+ */
1565
+ scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
1566
+ /**
1567
+ * @see https://redis.io/commands/script-load
1568
+ */
1569
+ scriptLoad: (script: string) => Promise<string>;
1570
+ /**
1571
+ * @see https://redis.io/commands/sdiff
1572
+ */
1573
+ sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
1574
+ /**
1575
+ * @see https://redis.io/commands/sdiffstore
1576
+ */
1577
+ sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
1578
+ /**
1579
+ * @see https://redis.io/commands/set
1580
+ */
1581
+ set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
1582
+ /**
1583
+ * @see https://redis.io/commands/setbit
1584
+ */
1585
+ setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
1586
+ /**
1587
+ * @see https://redis.io/commands/setex
1588
+ */
1589
+ setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
1590
+ /**
1591
+ * @see https://redis.io/commands/setnx
1592
+ */
1593
+ setnx: <TData>(key: string, value: TData) => Promise<number>;
1594
+ /**
1595
+ * @see https://redis.io/commands/setrange
1596
+ */
1597
+ setrange: (key: string, offset: number, value: string) => Promise<number>;
1598
+ /**
1599
+ * @see https://redis.io/commands/sinter
1600
+ */
1601
+ sinter: (key: string, ...keys: string[]) => Promise<string[]>;
1602
+ /**
1603
+ * @see https://redis.io/commands/sinterstore
1604
+ */
1605
+ sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
1606
+ /**
1607
+ * @see https://redis.io/commands/sismember
1608
+ */
1609
+ sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
1610
+ /**
1611
+ * @see https://redis.io/commands/smismember
1612
+ */
1613
+ smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
1614
+ /**
1615
+ * @see https://redis.io/commands/smembers
1616
+ */
1617
+ smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
1618
+ /**
1619
+ * @see https://redis.io/commands/smove
1620
+ */
1621
+ smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
1622
+ /**
1623
+ * @see https://redis.io/commands/spop
1624
+ */
1625
+ spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
1626
+ /**
1627
+ * @see https://redis.io/commands/srandmember
1628
+ */
1629
+ srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
1630
+ /**
1631
+ * @see https://redis.io/commands/srem
1632
+ */
1633
+ srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
1634
+ /**
1635
+ * @see https://redis.io/commands/sscan
1636
+ */
1637
+ sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
1638
+ /**
1639
+ * @see https://redis.io/commands/strlen
1640
+ */
1641
+ strlen: (key: string) => Promise<number>;
1642
+ /**
1643
+ * @see https://redis.io/commands/sunion
1644
+ */
1645
+ sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
1646
+ /**
1647
+ * @see https://redis.io/commands/sunionstore
1648
+ */
1649
+ sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
1650
+ /**
1651
+ * @see https://redis.io/commands/time
1652
+ */
1653
+ time: () => Promise<[number, number]>;
1654
+ /**
1655
+ * @see https://redis.io/commands/touch
1656
+ */
1657
+ touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
1658
+ /**
1659
+ * @see https://redis.io/commands/ttl
1660
+ */
1661
+ ttl: (key: string) => Promise<number>;
1662
+ /**
1663
+ * @see https://redis.io/commands/type
1664
+ */
1665
+ type: (key: string) => Promise<Type>;
1666
+ /**
1667
+ * @see https://redis.io/commands/unlink
1668
+ */
1669
+ unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
1670
+ /**
1671
+ * @see https://redis.io/commands/xadd
1672
+ */
1673
+ xadd: (key: string, id: string, entries: {
1674
+ [field: string]: unknown;
1675
+ }, opts?: {
1676
+ nomkStream?: boolean | undefined;
1677
+ trim?: (({
1678
+ type: "MAXLEN" | "maxlen";
1679
+ threshold: number;
1680
+ } | {
1681
+ type: "MINID" | "minid";
1682
+ threshold: string;
1683
+ }) & ({
1684
+ comparison: "~";
1685
+ limit?: number | undefined;
1686
+ } | {
1687
+ comparison: "=";
1688
+ limit?: undefined;
1689
+ })) | undefined;
1690
+ } | undefined) => Promise<string>;
1691
+ /**
1692
+ * @see https://redis.io/commands/xrange
1693
+ */
1694
+ xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
1695
+ /**
1696
+ * @see https://redis.io/commands/zadd
1697
+ */
1698
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
1699
+ /**
1700
+ * @see https://redis.io/commands/zcard
1701
+ */
1702
+ zcard: (key: string) => Promise<number>;
1703
+ /**
1704
+ * @see https://redis.io/commands/zcount
1705
+ */
1706
+ zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
1707
+ /**
1708
+ * @see https://redis.io/commands/zdiffstore
1709
+ */
1710
+ zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
1711
+ /**
1712
+ * @see https://redis.io/commands/zincrby
1713
+ */
1714
+ zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
1715
+ /**
1716
+ * @see https://redis.io/commands/zinterstore
1717
+ */
1718
+ zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
1719
+ /**
1720
+ * @see https://redis.io/commands/zlexcount
1721
+ */
1722
+ zlexcount: (key: string, min: string, max: string) => Promise<number>;
1723
+ /**
1724
+ * @see https://redis.io/commands/zmscore
1725
+ */
1726
+ zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
1727
+ /**
1728
+ * @see https://redis.io/commands/zpopmax
1729
+ */
1730
+ zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
1731
+ /**
1732
+ * @see https://redis.io/commands/zpopmin
1733
+ */
1734
+ zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
1735
+ /**
1736
+ * @see https://redis.io/commands/zrange
1737
+ */
1738
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
1739
+ key: string,
1740
+ min: `(${string}` | `[${string}` | "-" | "+",
1741
+ max: `(${string}` | `[${string}` | "-" | "+",
1742
+ opts: {
1743
+ byLex: true;
1744
+ } & ZRangeCommandOptions
1745
+ ] | [
1746
+ key: string,
1747
+ min: number | `(${number}` | "-inf" | "+inf",
1748
+ max: number | `(${number}` | "-inf" | "+inf",
1749
+ opts: {
1750
+ byScore: true;
1751
+ } & ZRangeCommandOptions
1752
+ ]) => Promise<TData>;
1753
+ /**
1754
+ * @see https://redis.io/commands/zrank
1755
+ */
1756
+ zrank: <TData>(key: string, member: TData) => Promise<number | null>;
1757
+ /**
1758
+ * @see https://redis.io/commands/zrem
1759
+ */
1760
+ zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
1761
+ /**
1762
+ * @see https://redis.io/commands/zremrangebylex
1763
+ */
1764
+ zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
1765
+ /**
1766
+ * @see https://redis.io/commands/zremrangebyrank
1767
+ */
1768
+ zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
1769
+ /**
1770
+ * @see https://redis.io/commands/zremrangebyscore
1771
+ */
1772
+ zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
1773
+ /**
1774
+ * @see https://redis.io/commands/zrevrank
1775
+ */
1776
+ zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
1777
+ /**
1778
+ * @see https://redis.io/commands/zscan
1779
+ */
1780
+ zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
1781
+ /**
1782
+ * @see https://redis.io/commands/zscore
1783
+ */
1784
+ zscore: <TData>(key: string, member: TData) => Promise<number | null>;
1785
+ /**
1786
+ * @see https://redis.io/commands/zunion
1787
+ */
1788
+ zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
1789
+ /**
1790
+ * @see https://redis.io/commands/zunionstore
1791
+ */
1792
+ zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
1793
+ }
1794
+
1795
+ export { RedisOptions as R, UpstashRequest as U, RequesterConfig as a, Redis as b, Requester as c, UpstashResponse as d };