@upstash/redis 1.3.1 → 1.3.2-alpha.0

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 (400) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -48
  3. package/esm/package.json +3 -0
  4. package/esm/pkg/commands/append.js +9 -0
  5. package/esm/pkg/commands/bitcount.js +16 -0
  6. package/esm/pkg/commands/bitop.js +9 -0
  7. package/esm/pkg/commands/bitpos.js +9 -0
  8. package/esm/pkg/commands/command.js +46 -0
  9. package/esm/pkg/commands/dbsize.js +9 -0
  10. package/esm/pkg/commands/decr.js +9 -0
  11. package/esm/pkg/commands/decrby.js +9 -0
  12. package/esm/pkg/commands/del.js +9 -0
  13. package/esm/pkg/commands/echo.js +9 -0
  14. package/esm/pkg/commands/eval.js +9 -0
  15. package/esm/pkg/commands/evalsha.js +9 -0
  16. package/esm/pkg/commands/exists.js +9 -0
  17. package/esm/pkg/commands/expire.js +9 -0
  18. package/esm/pkg/commands/expireat.js +9 -0
  19. package/esm/pkg/commands/flushall.js +13 -0
  20. package/esm/pkg/commands/flushdb.js +13 -0
  21. package/esm/pkg/commands/get.js +9 -0
  22. package/esm/pkg/commands/getbit.js +9 -0
  23. package/esm/pkg/commands/getrange.js +9 -0
  24. package/esm/pkg/commands/getset.js +9 -0
  25. package/esm/pkg/commands/hdel.js +9 -0
  26. package/esm/pkg/commands/hexists.js +9 -0
  27. package/esm/pkg/commands/hget.js +9 -0
  28. package/esm/pkg/commands/hgetall.js +30 -0
  29. package/esm/pkg/commands/hincrby.js +9 -0
  30. package/esm/pkg/commands/hincrbyfloat.js +9 -0
  31. package/esm/pkg/commands/hkeys.js +9 -0
  32. package/esm/pkg/commands/hlen.js +9 -0
  33. package/esm/pkg/commands/hmget.js +32 -0
  34. package/esm/pkg/commands/hmset.js +13 -0
  35. package/esm/pkg/commands/hscan.js +16 -0
  36. package/esm/pkg/commands/hset.js +13 -0
  37. package/esm/pkg/commands/hsetnx.js +9 -0
  38. package/esm/pkg/commands/hstrlen.js +9 -0
  39. package/esm/pkg/commands/hvals.js +9 -0
  40. package/esm/pkg/commands/incr.js +9 -0
  41. package/esm/pkg/commands/incrby.js +9 -0
  42. package/esm/pkg/commands/incrbyfloat.js +9 -0
  43. package/esm/pkg/commands/keys.js +9 -0
  44. package/esm/pkg/commands/lindex.js +6 -0
  45. package/esm/pkg/commands/linsert.js +6 -0
  46. package/esm/pkg/commands/llen.js +9 -0
  47. package/esm/pkg/commands/lpop.js +9 -0
  48. package/esm/pkg/commands/lpush.js +9 -0
  49. package/esm/pkg/commands/lpushx.js +9 -0
  50. package/esm/pkg/commands/lrange.js +6 -0
  51. package/esm/pkg/commands/lrem.js +6 -0
  52. package/esm/pkg/commands/lset.js +6 -0
  53. package/esm/pkg/commands/ltrim.js +6 -0
  54. package/esm/pkg/commands/mget.js +9 -0
  55. package/esm/pkg/commands/mod.js +114 -0
  56. package/esm/pkg/commands/mset.js +12 -0
  57. package/esm/pkg/commands/msetnx.js +9 -0
  58. package/esm/pkg/commands/persist.js +9 -0
  59. package/esm/pkg/commands/pexpire.js +9 -0
  60. package/esm/pkg/commands/pexpireat.js +9 -0
  61. package/esm/pkg/commands/ping.js +13 -0
  62. package/esm/pkg/commands/psetex.js +9 -0
  63. package/esm/pkg/commands/pttl.js +9 -0
  64. package/esm/pkg/commands/publish.js +9 -0
  65. package/esm/pkg/commands/randomkey.js +9 -0
  66. package/esm/pkg/commands/rename.js +9 -0
  67. package/esm/pkg/commands/renamenx.js +9 -0
  68. package/esm/pkg/commands/rpop.js +9 -0
  69. package/esm/pkg/commands/rpush.js +9 -0
  70. package/esm/pkg/commands/rpushx.js +9 -0
  71. package/esm/pkg/commands/sadd.js +9 -0
  72. package/esm/pkg/commands/scan.js +16 -0
  73. package/esm/pkg/commands/scard.js +9 -0
  74. package/esm/pkg/commands/script_exists.js +20 -0
  75. package/esm/pkg/commands/script_flush.js +16 -0
  76. package/esm/pkg/commands/script_load.js +9 -0
  77. package/esm/pkg/commands/sdiff.js +9 -0
  78. package/esm/pkg/commands/sdiffstore.js +9 -0
  79. package/esm/pkg/commands/set.js +24 -0
  80. package/esm/pkg/commands/setbit.js +9 -0
  81. package/esm/pkg/commands/setex.js +9 -0
  82. package/esm/pkg/commands/setnx.js +9 -0
  83. package/esm/pkg/commands/setrange.js +9 -0
  84. package/esm/pkg/commands/sinter.js +9 -0
  85. package/esm/pkg/commands/sinterstore.js +9 -0
  86. package/esm/pkg/commands/sismember.js +9 -0
  87. package/esm/pkg/commands/smembers.js +9 -0
  88. package/esm/pkg/commands/smove.js +9 -0
  89. package/esm/pkg/commands/spop.js +13 -0
  90. package/esm/pkg/commands/srandmember.js +13 -0
  91. package/esm/pkg/commands/srem.js +9 -0
  92. package/esm/pkg/commands/sscan.js +16 -0
  93. package/esm/pkg/commands/strlen.js +9 -0
  94. package/esm/pkg/commands/sunion.js +9 -0
  95. package/esm/pkg/commands/sunionstore.js +9 -0
  96. package/esm/pkg/commands/time.js +9 -0
  97. package/esm/pkg/commands/touch.js +9 -0
  98. package/esm/pkg/commands/ttl.js +9 -0
  99. package/esm/pkg/commands/type.js +9 -0
  100. package/esm/pkg/commands/unlink.js +9 -0
  101. package/esm/pkg/commands/zadd.js +26 -0
  102. package/esm/pkg/commands/zcard.js +9 -0
  103. package/esm/pkg/commands/zcount.js +9 -0
  104. package/esm/pkg/commands/zincrby.js +9 -0
  105. package/esm/pkg/commands/zinterstore.js +27 -0
  106. package/esm/pkg/commands/zlexcount.js +9 -0
  107. package/esm/pkg/commands/zpopmax.js +13 -0
  108. package/esm/pkg/commands/zpopmin.js +13 -0
  109. package/esm/pkg/commands/zrange.js +20 -0
  110. package/esm/pkg/commands/zrank.js +9 -0
  111. package/esm/pkg/commands/zrem.js +9 -0
  112. package/esm/pkg/commands/zremrangebylex.js +9 -0
  113. package/esm/pkg/commands/zremrangebyrank.js +9 -0
  114. package/esm/pkg/commands/zremrangebyscore.js +9 -0
  115. package/esm/pkg/commands/zrevrank.js +9 -0
  116. package/esm/pkg/commands/zscan.js +16 -0
  117. package/esm/pkg/commands/zscore.js +9 -0
  118. package/esm/pkg/commands/zunionstore.js +27 -0
  119. package/esm/pkg/error.js +9 -0
  120. package/esm/pkg/http.js +49 -0
  121. package/esm/pkg/pipeline.js +1118 -0
  122. package/esm/pkg/redis.js +1061 -0
  123. package/esm/pkg/types.js +1 -0
  124. package/esm/pkg/util.js +31 -0
  125. package/esm/platforms/cloudflare.js +70 -0
  126. package/esm/platforms/fastly.js +49 -0
  127. package/esm/platforms/nodejs.js +71 -0
  128. package/package.json +85 -1
  129. package/script/package.json +3 -0
  130. package/script/pkg/commands/append.js +13 -0
  131. package/script/pkg/commands/bitcount.js +20 -0
  132. package/script/pkg/commands/bitop.js +13 -0
  133. package/script/pkg/commands/bitpos.js +13 -0
  134. package/script/pkg/commands/command.js +50 -0
  135. package/script/pkg/commands/dbsize.js +13 -0
  136. package/script/pkg/commands/decr.js +13 -0
  137. package/script/pkg/commands/decrby.js +13 -0
  138. package/script/pkg/commands/del.js +13 -0
  139. package/script/pkg/commands/echo.js +13 -0
  140. package/script/pkg/commands/eval.js +13 -0
  141. package/script/pkg/commands/evalsha.js +13 -0
  142. package/script/pkg/commands/exists.js +13 -0
  143. package/script/pkg/commands/expire.js +13 -0
  144. package/script/pkg/commands/expireat.js +13 -0
  145. package/script/pkg/commands/flushall.js +17 -0
  146. package/script/pkg/commands/flushdb.js +17 -0
  147. package/script/pkg/commands/get.js +13 -0
  148. package/script/pkg/commands/getbit.js +13 -0
  149. package/script/pkg/commands/getrange.js +13 -0
  150. package/script/pkg/commands/getset.js +13 -0
  151. package/script/pkg/commands/hdel.js +13 -0
  152. package/script/pkg/commands/hexists.js +13 -0
  153. package/script/pkg/commands/hget.js +13 -0
  154. package/script/pkg/commands/hgetall.js +34 -0
  155. package/script/pkg/commands/hincrby.js +13 -0
  156. package/script/pkg/commands/hincrbyfloat.js +13 -0
  157. package/script/pkg/commands/hkeys.js +13 -0
  158. package/script/pkg/commands/hlen.js +13 -0
  159. package/script/pkg/commands/hmget.js +36 -0
  160. package/script/pkg/commands/hmset.js +17 -0
  161. package/script/pkg/commands/hscan.js +20 -0
  162. package/script/pkg/commands/hset.js +17 -0
  163. package/script/pkg/commands/hsetnx.js +13 -0
  164. package/script/pkg/commands/hstrlen.js +13 -0
  165. package/script/pkg/commands/hvals.js +13 -0
  166. package/script/pkg/commands/incr.js +13 -0
  167. package/script/pkg/commands/incrby.js +13 -0
  168. package/script/pkg/commands/incrbyfloat.js +13 -0
  169. package/script/pkg/commands/keys.js +13 -0
  170. package/script/pkg/commands/lindex.js +10 -0
  171. package/script/pkg/commands/linsert.js +10 -0
  172. package/script/pkg/commands/llen.js +13 -0
  173. package/script/pkg/commands/lpop.js +13 -0
  174. package/script/pkg/commands/lpush.js +13 -0
  175. package/script/pkg/commands/lpushx.js +13 -0
  176. package/script/pkg/commands/lrange.js +10 -0
  177. package/script/pkg/commands/lrem.js +10 -0
  178. package/script/pkg/commands/lset.js +10 -0
  179. package/script/pkg/commands/ltrim.js +10 -0
  180. package/script/pkg/commands/mget.js +13 -0
  181. package/script/pkg/commands/mod.js +130 -0
  182. package/script/pkg/commands/mset.js +16 -0
  183. package/script/pkg/commands/msetnx.js +13 -0
  184. package/script/pkg/commands/persist.js +13 -0
  185. package/script/pkg/commands/pexpire.js +13 -0
  186. package/script/pkg/commands/pexpireat.js +13 -0
  187. package/script/pkg/commands/ping.js +17 -0
  188. package/script/pkg/commands/psetex.js +13 -0
  189. package/script/pkg/commands/pttl.js +13 -0
  190. package/script/pkg/commands/publish.js +13 -0
  191. package/script/pkg/commands/randomkey.js +13 -0
  192. package/script/pkg/commands/rename.js +13 -0
  193. package/script/pkg/commands/renamenx.js +13 -0
  194. package/script/pkg/commands/rpop.js +13 -0
  195. package/script/pkg/commands/rpush.js +13 -0
  196. package/script/pkg/commands/rpushx.js +13 -0
  197. package/script/pkg/commands/sadd.js +13 -0
  198. package/script/pkg/commands/scan.js +20 -0
  199. package/script/pkg/commands/scard.js +13 -0
  200. package/script/pkg/commands/script_exists.js +24 -0
  201. package/script/pkg/commands/script_flush.js +20 -0
  202. package/script/pkg/commands/script_load.js +13 -0
  203. package/script/pkg/commands/sdiff.js +13 -0
  204. package/script/pkg/commands/sdiffstore.js +13 -0
  205. package/script/pkg/commands/set.js +28 -0
  206. package/script/pkg/commands/setbit.js +13 -0
  207. package/script/pkg/commands/setex.js +13 -0
  208. package/script/pkg/commands/setnx.js +13 -0
  209. package/script/pkg/commands/setrange.js +13 -0
  210. package/script/pkg/commands/sinter.js +13 -0
  211. package/script/pkg/commands/sinterstore.js +13 -0
  212. package/script/pkg/commands/sismember.js +13 -0
  213. package/script/pkg/commands/smembers.js +13 -0
  214. package/script/pkg/commands/smove.js +13 -0
  215. package/script/pkg/commands/spop.js +17 -0
  216. package/script/pkg/commands/srandmember.js +17 -0
  217. package/script/pkg/commands/srem.js +13 -0
  218. package/script/pkg/commands/sscan.js +20 -0
  219. package/script/pkg/commands/strlen.js +13 -0
  220. package/script/pkg/commands/sunion.js +13 -0
  221. package/script/pkg/commands/sunionstore.js +13 -0
  222. package/script/pkg/commands/time.js +13 -0
  223. package/script/pkg/commands/touch.js +13 -0
  224. package/script/pkg/commands/ttl.js +13 -0
  225. package/script/pkg/commands/type.js +13 -0
  226. package/script/pkg/commands/unlink.js +13 -0
  227. package/script/pkg/commands/zadd.js +30 -0
  228. package/script/pkg/commands/zcard.js +13 -0
  229. package/script/pkg/commands/zcount.js +13 -0
  230. package/script/pkg/commands/zincrby.js +13 -0
  231. package/script/pkg/commands/zinterstore.js +31 -0
  232. package/script/pkg/commands/zlexcount.js +13 -0
  233. package/script/pkg/commands/zpopmax.js +17 -0
  234. package/script/pkg/commands/zpopmin.js +17 -0
  235. package/script/pkg/commands/zrange.js +24 -0
  236. package/script/pkg/commands/zrank.js +13 -0
  237. package/script/pkg/commands/zrem.js +13 -0
  238. package/script/pkg/commands/zremrangebylex.js +13 -0
  239. package/script/pkg/commands/zremrangebyrank.js +13 -0
  240. package/script/pkg/commands/zremrangebyscore.js +13 -0
  241. package/script/pkg/commands/zrevrank.js +13 -0
  242. package/script/pkg/commands/zscan.js +20 -0
  243. package/script/pkg/commands/zscore.js +13 -0
  244. package/script/pkg/commands/zunionstore.js +31 -0
  245. package/script/pkg/error.js +13 -0
  246. package/script/pkg/http.js +53 -0
  247. package/script/pkg/pipeline.js +1122 -0
  248. package/script/pkg/redis.js +1065 -0
  249. package/script/pkg/types.js +2 -0
  250. package/script/pkg/util.js +35 -0
  251. package/script/platforms/cloudflare.js +97 -0
  252. package/script/platforms/fastly.js +76 -0
  253. package/script/platforms/nodejs.js +98 -0
  254. package/types/pkg/commands/append.d.ts +7 -0
  255. package/types/pkg/commands/bitcount.d.ts +8 -0
  256. package/types/pkg/commands/bitop.d.ts +8 -0
  257. package/types/pkg/commands/bitpos.d.ts +7 -0
  258. package/types/pkg/commands/command.d.ts +23 -0
  259. package/types/pkg/commands/dbsize.d.ts +7 -0
  260. package/types/pkg/commands/decr.d.ts +7 -0
  261. package/types/pkg/commands/decrby.d.ts +7 -0
  262. package/types/pkg/commands/del.d.ts +8 -0
  263. package/types/pkg/commands/echo.d.ts +7 -0
  264. package/types/pkg/commands/eval.d.ts +7 -0
  265. package/types/pkg/commands/evalsha.d.ts +7 -0
  266. package/types/pkg/commands/exists.d.ts +8 -0
  267. package/types/pkg/commands/expire.d.ts +7 -0
  268. package/types/pkg/commands/expireat.d.ts +7 -0
  269. package/types/pkg/commands/flushall.d.ts +9 -0
  270. package/types/pkg/commands/flushdb.d.ts +9 -0
  271. package/types/pkg/commands/get.d.ts +7 -0
  272. package/types/pkg/commands/getbit.d.ts +7 -0
  273. package/types/pkg/commands/getrange.d.ts +7 -0
  274. package/types/pkg/commands/getset.d.ts +7 -0
  275. package/types/pkg/commands/hdel.d.ts +7 -0
  276. package/types/pkg/commands/hexists.d.ts +7 -0
  277. package/types/pkg/commands/hget.d.ts +7 -0
  278. package/types/pkg/commands/hgetall.d.ts +7 -0
  279. package/types/pkg/commands/hincrby.d.ts +7 -0
  280. package/types/pkg/commands/hincrbyfloat.d.ts +7 -0
  281. package/types/pkg/commands/hkeys.d.ts +7 -0
  282. package/types/pkg/commands/hlen.d.ts +7 -0
  283. package/types/pkg/commands/hmget.d.ts +15 -0
  284. package/types/pkg/commands/hmset.d.ts +9 -0
  285. package/types/pkg/commands/hscan.d.ts +14 -0
  286. package/types/pkg/commands/hset.d.ts +9 -0
  287. package/types/pkg/commands/hsetnx.d.ts +7 -0
  288. package/types/pkg/commands/hstrlen.d.ts +7 -0
  289. package/types/pkg/commands/hvals.d.ts +7 -0
  290. package/types/pkg/commands/incr.d.ts +7 -0
  291. package/types/pkg/commands/incrby.d.ts +7 -0
  292. package/types/pkg/commands/incrbyfloat.d.ts +7 -0
  293. package/types/pkg/commands/keys.d.ts +7 -0
  294. package/types/pkg/commands/lindex.d.ts +4 -0
  295. package/types/pkg/commands/linsert.d.ts +4 -0
  296. package/types/pkg/commands/llen.d.ts +7 -0
  297. package/types/pkg/commands/lpop.d.ts +7 -0
  298. package/types/pkg/commands/lpush.d.ts +8 -0
  299. package/types/pkg/commands/lpushx.d.ts +8 -0
  300. package/types/pkg/commands/lrange.d.ts +4 -0
  301. package/types/pkg/commands/lrem.d.ts +4 -0
  302. package/types/pkg/commands/lset.d.ts +4 -0
  303. package/types/pkg/commands/ltrim.d.ts +4 -0
  304. package/types/pkg/commands/mget.d.ts +7 -0
  305. package/types/pkg/commands/mod.d.ts +114 -0
  306. package/types/pkg/commands/mset.d.ts +9 -0
  307. package/types/pkg/commands/msetnx.d.ts +9 -0
  308. package/types/pkg/commands/persist.d.ts +7 -0
  309. package/types/pkg/commands/pexpire.d.ts +7 -0
  310. package/types/pkg/commands/pexpireat.d.ts +7 -0
  311. package/types/pkg/commands/ping.d.ts +7 -0
  312. package/types/pkg/commands/psetex.d.ts +7 -0
  313. package/types/pkg/commands/pttl.d.ts +7 -0
  314. package/types/pkg/commands/publish.d.ts +7 -0
  315. package/types/pkg/commands/randomkey.d.ts +7 -0
  316. package/types/pkg/commands/rename.d.ts +7 -0
  317. package/types/pkg/commands/renamenx.d.ts +7 -0
  318. package/types/pkg/commands/rpop.d.ts +7 -0
  319. package/types/pkg/commands/rpush.d.ts +8 -0
  320. package/types/pkg/commands/rpushx.d.ts +8 -0
  321. package/types/pkg/commands/sadd.d.ts +8 -0
  322. package/types/pkg/commands/scan.d.ts +11 -0
  323. package/types/pkg/commands/scard.d.ts +7 -0
  324. package/types/pkg/commands/script_exists.d.ts +12 -0
  325. package/types/pkg/commands/script_flush.d.ts +14 -0
  326. package/types/pkg/commands/script_load.d.ts +7 -0
  327. package/types/pkg/commands/sdiff.d.ts +7 -0
  328. package/types/pkg/commands/sdiffstore.d.ts +8 -0
  329. package/types/pkg/commands/set.d.ts +26 -0
  330. package/types/pkg/commands/setbit.d.ts +7 -0
  331. package/types/pkg/commands/setex.d.ts +7 -0
  332. package/types/pkg/commands/setnx.d.ts +7 -0
  333. package/types/pkg/commands/setrange.d.ts +7 -0
  334. package/types/pkg/commands/sinter.d.ts +7 -0
  335. package/types/pkg/commands/sinterstore.d.ts +7 -0
  336. package/types/pkg/commands/sismember.d.ts +7 -0
  337. package/types/pkg/commands/smembers.d.ts +7 -0
  338. package/types/pkg/commands/smove.d.ts +7 -0
  339. package/types/pkg/commands/spop.d.ts +7 -0
  340. package/types/pkg/commands/srandmember.d.ts +7 -0
  341. package/types/pkg/commands/srem.d.ts +8 -0
  342. package/types/pkg/commands/sscan.d.ts +14 -0
  343. package/types/pkg/commands/strlen.d.ts +7 -0
  344. package/types/pkg/commands/sunion.d.ts +7 -0
  345. package/types/pkg/commands/sunionstore.d.ts +7 -0
  346. package/types/pkg/commands/time.d.ts +7 -0
  347. package/types/pkg/commands/touch.d.ts +8 -0
  348. package/types/pkg/commands/ttl.d.ts +7 -0
  349. package/types/pkg/commands/type.d.ts +8 -0
  350. package/types/pkg/commands/unlink.d.ts +7 -0
  351. package/types/pkg/commands/zadd.d.ts +27 -0
  352. package/types/pkg/commands/zcard.d.ts +7 -0
  353. package/types/pkg/commands/zcount.d.ts +7 -0
  354. package/types/pkg/commands/zincrby.d.ts +7 -0
  355. package/types/pkg/commands/zinterstore.d.ts +20 -0
  356. package/types/pkg/commands/zlexcount.d.ts +7 -0
  357. package/types/pkg/commands/zpopmax.d.ts +7 -0
  358. package/types/pkg/commands/zpopmin.d.ts +7 -0
  359. package/types/pkg/commands/zrange.d.ts +25 -0
  360. package/types/pkg/commands/zrank.d.ts +7 -0
  361. package/types/pkg/commands/zrem.d.ts +8 -0
  362. package/types/pkg/commands/zremrangebylex.d.ts +7 -0
  363. package/types/pkg/commands/zremrangebyrank.d.ts +7 -0
  364. package/types/pkg/commands/zremrangebyscore.d.ts +7 -0
  365. package/types/pkg/commands/zrevrank.d.ts +7 -0
  366. package/types/pkg/commands/zscan.d.ts +14 -0
  367. package/types/pkg/commands/zscore.d.ts +7 -0
  368. package/types/pkg/commands/zunionstore.d.ts +20 -0
  369. package/types/pkg/error.d.ts +6 -0
  370. package/{http.d.ts → types/pkg/http.d.ts} +7 -13
  371. package/types/pkg/pipeline.d.ts +543 -0
  372. package/types/pkg/redis.d.ts +509 -0
  373. package/types/pkg/types.d.ts +2 -0
  374. package/types/pkg/util.d.ts +1 -0
  375. package/types/platforms/cloudflare.d.ts +38 -0
  376. package/types/platforms/fastly.d.ts +41 -0
  377. package/{nodejs.d.ts → types/platforms/nodejs.d.ts} +25 -12
  378. package/chunk-5LZNFEHI.mjs +0 -34
  379. package/chunk-7YUZYRJS.mjs +0 -29
  380. package/chunk-CTSQDNTV.mjs +0 -393
  381. package/chunk-K2UC7PHG.mjs +0 -1140
  382. package/chunk-WRHUFPCZ.mjs +0 -55
  383. package/cloudflare.d.ts +0 -43
  384. package/cloudflare.js +0 -1395
  385. package/cloudflare.mjs +0 -34
  386. package/commands.d.ts +0 -761
  387. package/commands.js +0 -1287
  388. package/commands.mjs +0 -233
  389. package/fastly.d.ts +0 -46
  390. package/fastly.js +0 -1384
  391. package/fastly.mjs +0 -23
  392. package/http.js +0 -81
  393. package/http.mjs +0 -7
  394. package/index.d.ts +0 -15
  395. package/index.js +0 -1424
  396. package/index.mjs +0 -13
  397. package/nodejs.js +0 -1422
  398. package/nodejs.mjs +0 -10
  399. package/redis-338577a3.d.ts +0 -1056
  400. package/zunionstore-633a2e7a.d.ts +0 -187
@@ -0,0 +1,1122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pipeline = void 0;
4
+ const mod_js_1 = require("./commands/mod.js");
5
+ const error_js_1 = require("./error.js");
6
+ /**
7
+ * Upstash REST API supports command pipelining to send multiple commands in
8
+ * batch, instead of sending each command one by one and waiting for a response.
9
+ * When using pipelines, several commands are sent using a single HTTP request,
10
+ * and a single JSON array response is returned. Each item in the response array
11
+ * corresponds to the command in the same order within the pipeline.
12
+ *
13
+ * **NOTE:**
14
+ *
15
+ * Execution of the pipeline is not atomic. Even though each command in
16
+ * the pipeline will be executed in order, commands sent by other clients can
17
+ * interleave with the pipeline.
18
+ *
19
+ * **Examples:**
20
+ *
21
+ * ```ts
22
+ * const p = redis.pipeline()
23
+ * p.set("key","value")
24
+ * p.get("key")
25
+ * const res = await p.exec()
26
+ * ```
27
+ *
28
+ * You can also chain commands together
29
+ * ```ts
30
+ * const p = redis.pipeline()
31
+ * const res = await p.set("key","value").get("key").exec()
32
+ * ```
33
+ *
34
+ * It's not possible to infer correct types with a dynamic pipeline, so you can
35
+ * override the response type manually:
36
+ * ```ts
37
+ * redis.pipeline()
38
+ * .set("key", { greeting: "hello"})
39
+ * .get("key")
40
+ * .exec<["OK", { greeting: string } ]>()
41
+ *
42
+ * ```
43
+ */
44
+ class Pipeline {
45
+ constructor(client) {
46
+ Object.defineProperty(this, "client", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+ Object.defineProperty(this, "commands", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: void 0
57
+ });
58
+ /**
59
+ * Send the pipeline request to upstash.
60
+ *
61
+ * Returns an array with the results of all pipelined commands.
62
+ *
63
+ * You can define a return type manually to make working in typescript easier
64
+ * ```ts
65
+ * redis.pipeline().get("key").exec<[{ greeting: string }]>()
66
+ * ```
67
+ */
68
+ Object.defineProperty(this, "exec", {
69
+ enumerable: true,
70
+ configurable: true,
71
+ writable: true,
72
+ value: async () => {
73
+ if (this.commands.length === 0) {
74
+ throw new Error("Pipeline is empty");
75
+ }
76
+ const res = (await this.client.request({
77
+ path: ["pipeline"],
78
+ body: Object.values(this.commands).map((c) => c.command),
79
+ }));
80
+ return res.map(({ error, result }, i) => {
81
+ if (error) {
82
+ throw new error_js_1.UpstashError(`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`);
83
+ }
84
+ return this.commands[i].deserialize(result);
85
+ });
86
+ }
87
+ });
88
+ /**
89
+ * @see https://redis.io/commands/append
90
+ */
91
+ Object.defineProperty(this, "append", {
92
+ enumerable: true,
93
+ configurable: true,
94
+ writable: true,
95
+ value: (...args) => this.chain(new mod_js_1.AppendCommand(...args))
96
+ });
97
+ /**
98
+ * @see https://redis.io/commands/bitcount
99
+ */
100
+ Object.defineProperty(this, "bitcount", {
101
+ enumerable: true,
102
+ configurable: true,
103
+ writable: true,
104
+ value: (...args) => this.chain(new mod_js_1.BitCountCommand(...args))
105
+ });
106
+ /**
107
+ * @see https://redis.io/commands/bitop
108
+ */
109
+ Object.defineProperty(this, "bitop", {
110
+ enumerable: true,
111
+ configurable: true,
112
+ writable: true,
113
+ value: (op, destinationKey, sourceKey, ...sourceKeys) => this.chain(new mod_js_1.BitOpCommand(op, destinationKey, sourceKey, ...sourceKeys))
114
+ });
115
+ /**
116
+ * @see https://redis.io/commands/bitpos
117
+ */
118
+ Object.defineProperty(this, "bitpos", {
119
+ enumerable: true,
120
+ configurable: true,
121
+ writable: true,
122
+ value: (...args) => this.chain(new mod_js_1.BitPosCommand(...args))
123
+ });
124
+ /**
125
+ * @see https://redis.io/commands/dbsize
126
+ */
127
+ Object.defineProperty(this, "dbsize", {
128
+ enumerable: true,
129
+ configurable: true,
130
+ writable: true,
131
+ value: () => this.chain(new mod_js_1.DBSizeCommand())
132
+ });
133
+ /**
134
+ * @see https://redis.io/commands/decr
135
+ */
136
+ Object.defineProperty(this, "decr", {
137
+ enumerable: true,
138
+ configurable: true,
139
+ writable: true,
140
+ value: (...args) => this.chain(new mod_js_1.DecrCommand(...args))
141
+ });
142
+ /**
143
+ * @see https://redis.io/commands/decrby
144
+ */
145
+ Object.defineProperty(this, "decrby", {
146
+ enumerable: true,
147
+ configurable: true,
148
+ writable: true,
149
+ value: (...args) => this.chain(new mod_js_1.DecrByCommand(...args))
150
+ });
151
+ /**
152
+ * @see https://redis.io/commands/del
153
+ */
154
+ Object.defineProperty(this, "del", {
155
+ enumerable: true,
156
+ configurable: true,
157
+ writable: true,
158
+ value: (...args) => this.chain(new mod_js_1.DelCommand(...args))
159
+ });
160
+ /**
161
+ * @see https://redis.io/commands/echo
162
+ */
163
+ Object.defineProperty(this, "echo", {
164
+ enumerable: true,
165
+ configurable: true,
166
+ writable: true,
167
+ value: (...args) => this.chain(new mod_js_1.EchoCommand(...args))
168
+ });
169
+ /**
170
+ * @see https://redis.io/commands/eval
171
+ */
172
+ Object.defineProperty(this, "eval", {
173
+ enumerable: true,
174
+ configurable: true,
175
+ writable: true,
176
+ value: (...args) => this.chain(new mod_js_1.EvalCommand(...args))
177
+ });
178
+ /**
179
+ * @see https://redis.io/commands/evalsha
180
+ */
181
+ Object.defineProperty(this, "evalsha", {
182
+ enumerable: true,
183
+ configurable: true,
184
+ writable: true,
185
+ value: (...args) => this.chain(new mod_js_1.EvalshaCommand(...args))
186
+ });
187
+ /**
188
+ * @see https://redis.io/commands/exists
189
+ */
190
+ Object.defineProperty(this, "exists", {
191
+ enumerable: true,
192
+ configurable: true,
193
+ writable: true,
194
+ value: (...args) => this.chain(new mod_js_1.ExistsCommand(...args))
195
+ });
196
+ /**
197
+ * @see https://redis.io/commands/expire
198
+ */
199
+ Object.defineProperty(this, "expire", {
200
+ enumerable: true,
201
+ configurable: true,
202
+ writable: true,
203
+ value: (...args) => this.chain(new mod_js_1.ExpireCommand(...args))
204
+ });
205
+ /**
206
+ * @see https://redis.io/commands/expireat
207
+ */
208
+ Object.defineProperty(this, "expireat", {
209
+ enumerable: true,
210
+ configurable: true,
211
+ writable: true,
212
+ value: (...args) => this.chain(new mod_js_1.ExpireAtCommand(...args))
213
+ });
214
+ /**
215
+ * @see https://redis.io/commands/flushall
216
+ */
217
+ Object.defineProperty(this, "flushall", {
218
+ enumerable: true,
219
+ configurable: true,
220
+ writable: true,
221
+ value: (...args) => this.chain(new mod_js_1.FlushAllCommand(...args))
222
+ });
223
+ /**
224
+ * @see https://redis.io/commands/flushdb
225
+ */
226
+ Object.defineProperty(this, "flushdb", {
227
+ enumerable: true,
228
+ configurable: true,
229
+ writable: true,
230
+ value: (...args) => this.chain(new mod_js_1.FlushDBCommand(...args))
231
+ });
232
+ /**
233
+ * @see https://redis.io/commands/get
234
+ */
235
+ Object.defineProperty(this, "get", {
236
+ enumerable: true,
237
+ configurable: true,
238
+ writable: true,
239
+ value: (...args) => this.chain(new mod_js_1.GetCommand(...args))
240
+ });
241
+ /**
242
+ * @see https://redis.io/commands/getbit
243
+ */
244
+ Object.defineProperty(this, "getbit", {
245
+ enumerable: true,
246
+ configurable: true,
247
+ writable: true,
248
+ value: (...args) => this.chain(new mod_js_1.GetBitCommand(...args))
249
+ });
250
+ /**
251
+ * @see https://redis.io/commands/getrange
252
+ */
253
+ Object.defineProperty(this, "getrange", {
254
+ enumerable: true,
255
+ configurable: true,
256
+ writable: true,
257
+ value: (...args) => this.chain(new mod_js_1.GetRangeCommand(...args))
258
+ });
259
+ /**
260
+ * @see https://redis.io/commands/getset
261
+ */
262
+ Object.defineProperty(this, "getset", {
263
+ enumerable: true,
264
+ configurable: true,
265
+ writable: true,
266
+ value: (key, value) => this.chain(new mod_js_1.GetSetCommand(key, value))
267
+ });
268
+ /**
269
+ * @see https://redis.io/commands/hdel
270
+ */
271
+ Object.defineProperty(this, "hdel", {
272
+ enumerable: true,
273
+ configurable: true,
274
+ writable: true,
275
+ value: (...args) => this.chain(new mod_js_1.HDelCommand(...args))
276
+ });
277
+ /**
278
+ * @see https://redis.io/commands/hexists
279
+ */
280
+ Object.defineProperty(this, "hexists", {
281
+ enumerable: true,
282
+ configurable: true,
283
+ writable: true,
284
+ value: (...args) => this.chain(new mod_js_1.HExistsCommand(...args))
285
+ });
286
+ /**
287
+ * @see https://redis.io/commands/hget
288
+ */
289
+ Object.defineProperty(this, "hget", {
290
+ enumerable: true,
291
+ configurable: true,
292
+ writable: true,
293
+ value: (...args) => this.chain(new mod_js_1.HGetCommand(...args))
294
+ });
295
+ /**
296
+ * @see https://redis.io/commands/hgetall
297
+ */
298
+ Object.defineProperty(this, "hgetall", {
299
+ enumerable: true,
300
+ configurable: true,
301
+ writable: true,
302
+ value: (...args) => this.chain(new mod_js_1.HGetAllCommand(...args))
303
+ });
304
+ /**
305
+ * @see https://redis.io/commands/hincrby
306
+ */
307
+ Object.defineProperty(this, "hincrby", {
308
+ enumerable: true,
309
+ configurable: true,
310
+ writable: true,
311
+ value: (...args) => this.chain(new mod_js_1.HIncrByCommand(...args))
312
+ });
313
+ /**
314
+ * @see https://redis.io/commands/hincrbyfloat
315
+ */
316
+ Object.defineProperty(this, "hincrbyfloat", {
317
+ enumerable: true,
318
+ configurable: true,
319
+ writable: true,
320
+ value: (...args) => this.chain(new mod_js_1.HIncrByFloatCommand(...args))
321
+ });
322
+ /**
323
+ * @see https://redis.io/commands/hkeys
324
+ */
325
+ Object.defineProperty(this, "hkeys", {
326
+ enumerable: true,
327
+ configurable: true,
328
+ writable: true,
329
+ value: (...args) => this.chain(new mod_js_1.HKeysCommand(...args))
330
+ });
331
+ /**
332
+ * @see https://redis.io/commands/hlen
333
+ */
334
+ Object.defineProperty(this, "hlen", {
335
+ enumerable: true,
336
+ configurable: true,
337
+ writable: true,
338
+ value: (...args) => this.chain(new mod_js_1.HLenCommand(...args))
339
+ });
340
+ /**
341
+ * @see https://redis.io/commands/hmget
342
+ */
343
+ Object.defineProperty(this, "hmget", {
344
+ enumerable: true,
345
+ configurable: true,
346
+ writable: true,
347
+ value: (...args) => this.chain(new mod_js_1.HMGetCommand(...args))
348
+ });
349
+ /**
350
+ * @see https://redis.io/commands/hmset
351
+ */
352
+ Object.defineProperty(this, "hmset", {
353
+ enumerable: true,
354
+ configurable: true,
355
+ writable: true,
356
+ value: (key, kv) => this.chain(new mod_js_1.HMSetCommand(key, kv))
357
+ });
358
+ /**
359
+ * @see https://redis.io/commands/hscan
360
+ */
361
+ Object.defineProperty(this, "hscan", {
362
+ enumerable: true,
363
+ configurable: true,
364
+ writable: true,
365
+ value: (...args) => this.chain(new mod_js_1.HScanCommand(...args))
366
+ });
367
+ /**
368
+ * @see https://redis.io/commands/hset
369
+ */
370
+ Object.defineProperty(this, "hset", {
371
+ enumerable: true,
372
+ configurable: true,
373
+ writable: true,
374
+ value: (key, kv) => this.chain(new mod_js_1.HSetCommand(key, kv))
375
+ });
376
+ /**
377
+ * @see https://redis.io/commands/hsetnx
378
+ */
379
+ Object.defineProperty(this, "hsetnx", {
380
+ enumerable: true,
381
+ configurable: true,
382
+ writable: true,
383
+ value: (key, field, value) => this.chain(new mod_js_1.HSetNXCommand(key, field, value))
384
+ });
385
+ /**
386
+ * @see https://redis.io/commands/hstrlen
387
+ */
388
+ Object.defineProperty(this, "hstrlen", {
389
+ enumerable: true,
390
+ configurable: true,
391
+ writable: true,
392
+ value: (...args) => this.chain(new mod_js_1.HStrLenCommand(...args))
393
+ });
394
+ /**
395
+ * @see https://redis.io/commands/hvals
396
+ */
397
+ Object.defineProperty(this, "hvals", {
398
+ enumerable: true,
399
+ configurable: true,
400
+ writable: true,
401
+ value: (...args) => this.chain(new mod_js_1.HValsCommand(...args))
402
+ });
403
+ /**
404
+ * @see https://redis.io/commands/incr
405
+ */
406
+ Object.defineProperty(this, "incr", {
407
+ enumerable: true,
408
+ configurable: true,
409
+ writable: true,
410
+ value: (...args) => this.chain(new mod_js_1.IncrCommand(...args))
411
+ });
412
+ /**
413
+ * @see https://redis.io/commands/incrby
414
+ */
415
+ Object.defineProperty(this, "incrby", {
416
+ enumerable: true,
417
+ configurable: true,
418
+ writable: true,
419
+ value: (...args) => this.chain(new mod_js_1.IncrByCommand(...args))
420
+ });
421
+ /**
422
+ * @see https://redis.io/commands/incrbyfloat
423
+ */
424
+ Object.defineProperty(this, "incrbyfloat", {
425
+ enumerable: true,
426
+ configurable: true,
427
+ writable: true,
428
+ value: (...args) => this.chain(new mod_js_1.IncrByFloatCommand(...args))
429
+ });
430
+ /**
431
+ * @see https://redis.io/commands/keys
432
+ */
433
+ Object.defineProperty(this, "keys", {
434
+ enumerable: true,
435
+ configurable: true,
436
+ writable: true,
437
+ value: (...args) => this.chain(new mod_js_1.KeysCommand(...args))
438
+ });
439
+ /**
440
+ * @see https://redis.io/commands/lindex
441
+ */
442
+ Object.defineProperty(this, "lindex", {
443
+ enumerable: true,
444
+ configurable: true,
445
+ writable: true,
446
+ value: (...args) => this.chain(new mod_js_1.LIndexCommand(...args))
447
+ });
448
+ /**
449
+ * @see https://redis.io/commands/linsert
450
+ */
451
+ Object.defineProperty(this, "linsert", {
452
+ enumerable: true,
453
+ configurable: true,
454
+ writable: true,
455
+ value: (key, direction, pivot, value) => this.chain(new mod_js_1.LInsertCommand(key, direction, pivot, value))
456
+ });
457
+ /**
458
+ * @see https://redis.io/commands/llen
459
+ */
460
+ Object.defineProperty(this, "llen", {
461
+ enumerable: true,
462
+ configurable: true,
463
+ writable: true,
464
+ value: (...args) => this.chain(new mod_js_1.LLenCommand(...args))
465
+ });
466
+ /**
467
+ * @see https://redis.io/commands/lpop
468
+ */
469
+ Object.defineProperty(this, "lpop", {
470
+ enumerable: true,
471
+ configurable: true,
472
+ writable: true,
473
+ value: (...args) => this.chain(new mod_js_1.LPopCommand(...args))
474
+ });
475
+ /**
476
+ * @see https://redis.io/commands/lpush
477
+ */
478
+ Object.defineProperty(this, "lpush", {
479
+ enumerable: true,
480
+ configurable: true,
481
+ writable: true,
482
+ value: (key, ...elements) => this.chain(new mod_js_1.LPushCommand(key, ...elements))
483
+ });
484
+ /**
485
+ * @see https://redis.io/commands/lpushx
486
+ */
487
+ Object.defineProperty(this, "lpushx", {
488
+ enumerable: true,
489
+ configurable: true,
490
+ writable: true,
491
+ value: (key, ...elements) => this.chain(new mod_js_1.LPushXCommand(key, ...elements))
492
+ });
493
+ /**
494
+ * @see https://redis.io/commands/lrange
495
+ */
496
+ Object.defineProperty(this, "lrange", {
497
+ enumerable: true,
498
+ configurable: true,
499
+ writable: true,
500
+ value: (...args) => this.chain(new mod_js_1.LRangeCommand(...args))
501
+ });
502
+ /**
503
+ * @see https://redis.io/commands/lrem
504
+ */
505
+ Object.defineProperty(this, "lrem", {
506
+ enumerable: true,
507
+ configurable: true,
508
+ writable: true,
509
+ value: (key, count, value) => this.chain(new mod_js_1.LRemCommand(key, count, value))
510
+ });
511
+ /**
512
+ * @see https://redis.io/commands/lset
513
+ */
514
+ Object.defineProperty(this, "lset", {
515
+ enumerable: true,
516
+ configurable: true,
517
+ writable: true,
518
+ value: (key, value, index) => this.chain(new mod_js_1.LSetCommand(key, value, index))
519
+ });
520
+ /**
521
+ * @see https://redis.io/commands/ltrim
522
+ */
523
+ Object.defineProperty(this, "ltrim", {
524
+ enumerable: true,
525
+ configurable: true,
526
+ writable: true,
527
+ value: (...args) => this.chain(new mod_js_1.LTrimCommand(...args))
528
+ });
529
+ /**
530
+ * @see https://redis.io/commands/mget
531
+ */
532
+ Object.defineProperty(this, "mget", {
533
+ enumerable: true,
534
+ configurable: true,
535
+ writable: true,
536
+ value: (...args) => this.chain(new mod_js_1.MGetCommand(...args))
537
+ });
538
+ /**
539
+ * @see https://redis.io/commands/mset
540
+ */
541
+ Object.defineProperty(this, "mset", {
542
+ enumerable: true,
543
+ configurable: true,
544
+ writable: true,
545
+ value: (kv) => this.chain(new mod_js_1.MSetCommand(kv))
546
+ });
547
+ /**
548
+ * @see https://redis.io/commands/msetnx
549
+ */
550
+ Object.defineProperty(this, "msetnx", {
551
+ enumerable: true,
552
+ configurable: true,
553
+ writable: true,
554
+ value: (kv) => this.chain(new mod_js_1.MSetNXCommand(kv))
555
+ });
556
+ /**
557
+ * @see https://redis.io/commands/persist
558
+ */
559
+ Object.defineProperty(this, "persist", {
560
+ enumerable: true,
561
+ configurable: true,
562
+ writable: true,
563
+ value: (...args) => this.chain(new mod_js_1.PersistCommand(...args))
564
+ });
565
+ /**
566
+ * @see https://redis.io/commands/pexpire
567
+ */
568
+ Object.defineProperty(this, "pexpire", {
569
+ enumerable: true,
570
+ configurable: true,
571
+ writable: true,
572
+ value: (...args) => this.chain(new mod_js_1.PExpireCommand(...args))
573
+ });
574
+ /**
575
+ * @see https://redis.io/commands/pexpireat
576
+ */
577
+ Object.defineProperty(this, "pexpireat", {
578
+ enumerable: true,
579
+ configurable: true,
580
+ writable: true,
581
+ value: (...args) => this.chain(new mod_js_1.PExpireAtCommand(...args))
582
+ });
583
+ /**
584
+ * @see https://redis.io/commands/ping
585
+ */
586
+ Object.defineProperty(this, "ping", {
587
+ enumerable: true,
588
+ configurable: true,
589
+ writable: true,
590
+ value: (...args) => this.chain(new mod_js_1.PingCommand(...args))
591
+ });
592
+ /**
593
+ * @see https://redis.io/commands/psetex
594
+ */
595
+ Object.defineProperty(this, "psetex", {
596
+ enumerable: true,
597
+ configurable: true,
598
+ writable: true,
599
+ value: (key, ttl, value) => this.chain(new mod_js_1.PSetEXCommand(key, ttl, value))
600
+ });
601
+ /**
602
+ * @see https://redis.io/commands/pttl
603
+ */
604
+ Object.defineProperty(this, "pttl", {
605
+ enumerable: true,
606
+ configurable: true,
607
+ writable: true,
608
+ value: (...args) => this.chain(new mod_js_1.PTtlCommand(...args))
609
+ });
610
+ /**
611
+ * @see https://redis.io/commands/publish
612
+ */
613
+ Object.defineProperty(this, "publish", {
614
+ enumerable: true,
615
+ configurable: true,
616
+ writable: true,
617
+ value: (...args) => this.chain(new mod_js_1.PublishCommand(...args))
618
+ });
619
+ /**
620
+ * @see https://redis.io/commands/randomkey
621
+ */
622
+ Object.defineProperty(this, "randomkey", {
623
+ enumerable: true,
624
+ configurable: true,
625
+ writable: true,
626
+ value: () => this.chain(new mod_js_1.RandomKeyCommand())
627
+ });
628
+ /**
629
+ * @see https://redis.io/commands/rename
630
+ */
631
+ Object.defineProperty(this, "rename", {
632
+ enumerable: true,
633
+ configurable: true,
634
+ writable: true,
635
+ value: (...args) => this.chain(new mod_js_1.RenameCommand(...args))
636
+ });
637
+ /**
638
+ * @see https://redis.io/commands/renamenx
639
+ */
640
+ Object.defineProperty(this, "renamenx", {
641
+ enumerable: true,
642
+ configurable: true,
643
+ writable: true,
644
+ value: (...args) => this.chain(new mod_js_1.RenameNXCommand(...args))
645
+ });
646
+ /**
647
+ * @see https://redis.io/commands/rpop
648
+ */
649
+ Object.defineProperty(this, "rpop", {
650
+ enumerable: true,
651
+ configurable: true,
652
+ writable: true,
653
+ value: (...args) => this.chain(new mod_js_1.RPopCommand(...args))
654
+ });
655
+ /**
656
+ * @see https://redis.io/commands/rpush
657
+ */
658
+ Object.defineProperty(this, "rpush", {
659
+ enumerable: true,
660
+ configurable: true,
661
+ writable: true,
662
+ value: (key, ...elements) => this.chain(new mod_js_1.RPushCommand(key, ...elements))
663
+ });
664
+ /**
665
+ * @see https://redis.io/commands/rpushx
666
+ */
667
+ Object.defineProperty(this, "rpushx", {
668
+ enumerable: true,
669
+ configurable: true,
670
+ writable: true,
671
+ value: (key, ...elements) => this.chain(new mod_js_1.RPushXCommand(key, ...elements))
672
+ });
673
+ /**
674
+ * @see https://redis.io/commands/sadd
675
+ */
676
+ Object.defineProperty(this, "sadd", {
677
+ enumerable: true,
678
+ configurable: true,
679
+ writable: true,
680
+ value: (key, ...members) => this.chain(new mod_js_1.SAddCommand(key, ...members))
681
+ });
682
+ /**
683
+ * @see https://redis.io/commands/scan
684
+ */
685
+ Object.defineProperty(this, "scan", {
686
+ enumerable: true,
687
+ configurable: true,
688
+ writable: true,
689
+ value: (...args) => this.chain(new mod_js_1.ScanCommand(...args))
690
+ });
691
+ /**
692
+ * @see https://redis.io/commands/scard
693
+ */
694
+ Object.defineProperty(this, "scard", {
695
+ enumerable: true,
696
+ configurable: true,
697
+ writable: true,
698
+ value: (...args) => this.chain(new mod_js_1.SCardCommand(...args))
699
+ });
700
+ /**
701
+ * @see https://redis.io/commands/script-exists
702
+ */
703
+ Object.defineProperty(this, "scriptExists", {
704
+ enumerable: true,
705
+ configurable: true,
706
+ writable: true,
707
+ value: (...args) => this.chain(new mod_js_1.ScriptExistsCommand(...args))
708
+ });
709
+ /**
710
+ * @see https://redis.io/commands/script-flush
711
+ */
712
+ Object.defineProperty(this, "scriptFlush", {
713
+ enumerable: true,
714
+ configurable: true,
715
+ writable: true,
716
+ value: (...args) => this.chain(new mod_js_1.ScriptFlushCommand(...args))
717
+ });
718
+ /**
719
+ * @see https://redis.io/commands/script-load
720
+ */
721
+ Object.defineProperty(this, "scriptLoad", {
722
+ enumerable: true,
723
+ configurable: true,
724
+ writable: true,
725
+ value: (...args) => this.chain(new mod_js_1.ScriptLoadCommand(...args))
726
+ });
727
+ /**
728
+ * @see https://redis.io/commands/sdiff
729
+ */
730
+ Object.defineProperty(this, "sdiff", {
731
+ enumerable: true,
732
+ configurable: true,
733
+ writable: true,
734
+ value: (...args) => this.chain(new mod_js_1.SDiffCommand(...args))
735
+ });
736
+ /**
737
+ * @see https://redis.io/commands/sdiffstore
738
+ */
739
+ Object.defineProperty(this, "sdiffstore", {
740
+ enumerable: true,
741
+ configurable: true,
742
+ writable: true,
743
+ value: (...args) => this.chain(new mod_js_1.SDiffStoreCommand(...args))
744
+ });
745
+ /**
746
+ * @see https://redis.io/commands/set
747
+ */
748
+ Object.defineProperty(this, "set", {
749
+ enumerable: true,
750
+ configurable: true,
751
+ writable: true,
752
+ value: (key, value, opts) => this.chain(new mod_js_1.SetCommand(key, value, opts))
753
+ });
754
+ /**
755
+ * @see https://redis.io/commands/setbit
756
+ */
757
+ Object.defineProperty(this, "setbit", {
758
+ enumerable: true,
759
+ configurable: true,
760
+ writable: true,
761
+ value: (...args) => this.chain(new mod_js_1.SetBitCommand(...args))
762
+ });
763
+ /**
764
+ * @see https://redis.io/commands/setex
765
+ */
766
+ Object.defineProperty(this, "setex", {
767
+ enumerable: true,
768
+ configurable: true,
769
+ writable: true,
770
+ value: (key, ttl, value) => this.chain(new mod_js_1.SetExCommand(key, ttl, value))
771
+ });
772
+ /**
773
+ * @see https://redis.io/commands/setnx
774
+ */
775
+ Object.defineProperty(this, "setnx", {
776
+ enumerable: true,
777
+ configurable: true,
778
+ writable: true,
779
+ value: (key, value) => this.chain(new mod_js_1.SetNxCommand(key, value))
780
+ });
781
+ /**
782
+ * @see https://redis.io/commands/setrange
783
+ */
784
+ Object.defineProperty(this, "setrange", {
785
+ enumerable: true,
786
+ configurable: true,
787
+ writable: true,
788
+ value: (...args) => this.chain(new mod_js_1.SetRangeCommand(...args))
789
+ });
790
+ /**
791
+ * @see https://redis.io/commands/sinter
792
+ */
793
+ Object.defineProperty(this, "sinter", {
794
+ enumerable: true,
795
+ configurable: true,
796
+ writable: true,
797
+ value: (...args) => this.chain(new mod_js_1.SInterCommand(...args))
798
+ });
799
+ /**
800
+ * @see https://redis.io/commands/sinterstore
801
+ */
802
+ Object.defineProperty(this, "sinterstore", {
803
+ enumerable: true,
804
+ configurable: true,
805
+ writable: true,
806
+ value: (...args) => this.chain(new mod_js_1.SInterStoreCommand(...args))
807
+ });
808
+ /**
809
+ * @see https://redis.io/commands/sismember
810
+ */
811
+ Object.defineProperty(this, "sismember", {
812
+ enumerable: true,
813
+ configurable: true,
814
+ writable: true,
815
+ value: (key, member) => this.chain(new mod_js_1.SIsMemberCommand(key, member))
816
+ });
817
+ /**
818
+ * @see https://redis.io/commands/smembers
819
+ */
820
+ Object.defineProperty(this, "smembers", {
821
+ enumerable: true,
822
+ configurable: true,
823
+ writable: true,
824
+ value: (...args) => this.chain(new mod_js_1.SMembersCommand(...args))
825
+ });
826
+ /**
827
+ * @see https://redis.io/commands/smove
828
+ */
829
+ Object.defineProperty(this, "smove", {
830
+ enumerable: true,
831
+ configurable: true,
832
+ writable: true,
833
+ value: (source, destination, member) => this.chain(new mod_js_1.SMoveCommand(source, destination, member))
834
+ });
835
+ /**
836
+ * @see https://redis.io/commands/spop
837
+ */
838
+ Object.defineProperty(this, "spop", {
839
+ enumerable: true,
840
+ configurable: true,
841
+ writable: true,
842
+ value: (...args) => this.chain(new mod_js_1.SPopCommand(...args))
843
+ });
844
+ /**
845
+ * @see https://redis.io/commands/srandmember
846
+ */
847
+ Object.defineProperty(this, "srandmember", {
848
+ enumerable: true,
849
+ configurable: true,
850
+ writable: true,
851
+ value: (...args) => this.chain(new mod_js_1.SRandMemberCommand(...args))
852
+ });
853
+ /**
854
+ * @see https://redis.io/commands/srem
855
+ */
856
+ Object.defineProperty(this, "srem", {
857
+ enumerable: true,
858
+ configurable: true,
859
+ writable: true,
860
+ value: (key, ...members) => this.chain(new mod_js_1.SRemCommand(key, ...members))
861
+ });
862
+ /**
863
+ * @see https://redis.io/commands/sscan
864
+ */
865
+ Object.defineProperty(this, "sscan", {
866
+ enumerable: true,
867
+ configurable: true,
868
+ writable: true,
869
+ value: (...args) => this.chain(new mod_js_1.SScanCommand(...args))
870
+ });
871
+ /**
872
+ * @see https://redis.io/commands/strlen
873
+ */
874
+ Object.defineProperty(this, "strlen", {
875
+ enumerable: true,
876
+ configurable: true,
877
+ writable: true,
878
+ value: (...args) => this.chain(new mod_js_1.StrLenCommand(...args))
879
+ });
880
+ /**
881
+ * @see https://redis.io/commands/sunion
882
+ */
883
+ Object.defineProperty(this, "sunion", {
884
+ enumerable: true,
885
+ configurable: true,
886
+ writable: true,
887
+ value: (...args) => this.chain(new mod_js_1.SUnionCommand(...args))
888
+ });
889
+ /**
890
+ * @see https://redis.io/commands/sunionstore
891
+ */
892
+ Object.defineProperty(this, "sunionstore", {
893
+ enumerable: true,
894
+ configurable: true,
895
+ writable: true,
896
+ value: (...args) => this.chain(new mod_js_1.SUnionStoreCommand(...args))
897
+ });
898
+ /**
899
+ * @see https://redis.io/commands/time
900
+ */
901
+ Object.defineProperty(this, "time", {
902
+ enumerable: true,
903
+ configurable: true,
904
+ writable: true,
905
+ value: () => this.chain(new mod_js_1.TimeCommand())
906
+ });
907
+ /**
908
+ * @see https://redis.io/commands/touch
909
+ */
910
+ Object.defineProperty(this, "touch", {
911
+ enumerable: true,
912
+ configurable: true,
913
+ writable: true,
914
+ value: (...args) => this.chain(new mod_js_1.TouchCommand(...args))
915
+ });
916
+ /**
917
+ * @see https://redis.io/commands/ttl
918
+ */
919
+ Object.defineProperty(this, "ttl", {
920
+ enumerable: true,
921
+ configurable: true,
922
+ writable: true,
923
+ value: (...args) => this.chain(new mod_js_1.TtlCommand(...args))
924
+ });
925
+ /**
926
+ * @see https://redis.io/commands/type
927
+ */
928
+ Object.defineProperty(this, "type", {
929
+ enumerable: true,
930
+ configurable: true,
931
+ writable: true,
932
+ value: (...args) => this.chain(new mod_js_1.TypeCommand(...args))
933
+ });
934
+ /**
935
+ * @see https://redis.io/commands/unlink
936
+ */
937
+ Object.defineProperty(this, "unlink", {
938
+ enumerable: true,
939
+ configurable: true,
940
+ writable: true,
941
+ value: (...args) => this.chain(new mod_js_1.UnlinkCommand(...args))
942
+ });
943
+ /**
944
+ * @see https://redis.io/commands/zadd
945
+ */
946
+ Object.defineProperty(this, "zadd", {
947
+ enumerable: true,
948
+ configurable: true,
949
+ writable: true,
950
+ value: (...args) => {
951
+ if ("score" in args[1]) {
952
+ return this.chain(new mod_js_1.ZAddCommand(args[0], args[1], ...args.slice(2)));
953
+ }
954
+ return this.chain(new mod_js_1.ZAddCommand(args[0], args[1], ...args.slice(2)));
955
+ }
956
+ });
957
+ /**
958
+ * @see https://redis.io/commands/zcard
959
+ */
960
+ Object.defineProperty(this, "zcard", {
961
+ enumerable: true,
962
+ configurable: true,
963
+ writable: true,
964
+ value: (...args) => this.chain(new mod_js_1.ZCardCommand(...args))
965
+ });
966
+ /**
967
+ * @see https://redis.io/commands/zcount
968
+ */
969
+ Object.defineProperty(this, "zcount", {
970
+ enumerable: true,
971
+ configurable: true,
972
+ writable: true,
973
+ value: (...args) => this.chain(new mod_js_1.ZCountCommand(...args))
974
+ });
975
+ /**
976
+ * @see https://redis.io/commands/zincrby
977
+ */
978
+ Object.defineProperty(this, "zincrby", {
979
+ enumerable: true,
980
+ configurable: true,
981
+ writable: true,
982
+ value: (key, increment, member) => this.chain(new mod_js_1.ZIncrByComand(key, increment, member))
983
+ });
984
+ /**
985
+ * @see https://redis.io/commands/zinterstore
986
+ */
987
+ Object.defineProperty(this, "zinterstore", {
988
+ enumerable: true,
989
+ configurable: true,
990
+ writable: true,
991
+ value: (...args) => this.chain(new mod_js_1.ZInterStoreCommand(...args))
992
+ });
993
+ /**
994
+ * @see https://redis.io/commands/zlexcount
995
+ */
996
+ Object.defineProperty(this, "zlexcount", {
997
+ enumerable: true,
998
+ configurable: true,
999
+ writable: true,
1000
+ value: (...args) => this.chain(new mod_js_1.ZLexCountCommand(...args))
1001
+ });
1002
+ /**
1003
+ * @see https://redis.io/commands/zpopmax
1004
+ */
1005
+ Object.defineProperty(this, "zpopmax", {
1006
+ enumerable: true,
1007
+ configurable: true,
1008
+ writable: true,
1009
+ value: (...args) => this.chain(new mod_js_1.ZPopMaxCommand(...args))
1010
+ });
1011
+ /**
1012
+ * @see https://redis.io/commands/zpopmin
1013
+ */
1014
+ Object.defineProperty(this, "zpopmin", {
1015
+ enumerable: true,
1016
+ configurable: true,
1017
+ writable: true,
1018
+ value: (...args) => this.chain(new mod_js_1.ZPopMinCommand(...args))
1019
+ });
1020
+ /**
1021
+ * @see https://redis.io/commands/zrange
1022
+ */
1023
+ Object.defineProperty(this, "zrange", {
1024
+ enumerable: true,
1025
+ configurable: true,
1026
+ writable: true,
1027
+ value: (...args) => this.chain(new mod_js_1.ZRangeCommand(args[0], args[1], args[2], args[3]))
1028
+ });
1029
+ /**
1030
+ * @see https://redis.io/commands/zrank
1031
+ */
1032
+ Object.defineProperty(this, "zrank", {
1033
+ enumerable: true,
1034
+ configurable: true,
1035
+ writable: true,
1036
+ value: (key, member) => this.chain(new mod_js_1.ZRankCommand(key, member))
1037
+ });
1038
+ /**
1039
+ * @see https://redis.io/commands/zrem
1040
+ */
1041
+ Object.defineProperty(this, "zrem", {
1042
+ enumerable: true,
1043
+ configurable: true,
1044
+ writable: true,
1045
+ value: (key, ...members) => this.chain(new mod_js_1.ZRemCommand(key, ...members))
1046
+ });
1047
+ /**
1048
+ * @see https://redis.io/commands/zremrangebylex
1049
+ */
1050
+ Object.defineProperty(this, "zremrangebylex", {
1051
+ enumerable: true,
1052
+ configurable: true,
1053
+ writable: true,
1054
+ value: (...args) => this.chain(new mod_js_1.ZRemRangeByLexCommand(...args))
1055
+ });
1056
+ /**
1057
+ * @see https://redis.io/commands/zremrangebyrank
1058
+ */
1059
+ Object.defineProperty(this, "zremrangebyrank", {
1060
+ enumerable: true,
1061
+ configurable: true,
1062
+ writable: true,
1063
+ value: (...args) => this.chain(new mod_js_1.ZRemRangeByRankCommand(...args))
1064
+ });
1065
+ /**
1066
+ * @see https://redis.io/commands/zremrangebyscore
1067
+ */
1068
+ Object.defineProperty(this, "zremrangebyscore", {
1069
+ enumerable: true,
1070
+ configurable: true,
1071
+ writable: true,
1072
+ value: (...args) => this.chain(new mod_js_1.ZRemRangeByScoreCommand(...args))
1073
+ });
1074
+ /**
1075
+ * @see https://redis.io/commands/zrevrank
1076
+ */
1077
+ Object.defineProperty(this, "zrevrank", {
1078
+ enumerable: true,
1079
+ configurable: true,
1080
+ writable: true,
1081
+ value: (key, member) => this.chain(new mod_js_1.ZRevRankCommand(key, member))
1082
+ });
1083
+ /**
1084
+ * @see https://redis.io/commands/zscan
1085
+ */
1086
+ Object.defineProperty(this, "zscan", {
1087
+ enumerable: true,
1088
+ configurable: true,
1089
+ writable: true,
1090
+ value: (...args) => this.chain(new mod_js_1.ZScanCommand(...args))
1091
+ });
1092
+ /**
1093
+ * @see https://redis.io/commands/zscore
1094
+ */
1095
+ Object.defineProperty(this, "zscore", {
1096
+ enumerable: true,
1097
+ configurable: true,
1098
+ writable: true,
1099
+ value: (key, member) => this.chain(new mod_js_1.ZScoreCommand(key, member))
1100
+ });
1101
+ /**
1102
+ * @see https://redis.io/commands/zunionstore
1103
+ */
1104
+ Object.defineProperty(this, "zunionstore", {
1105
+ enumerable: true,
1106
+ configurable: true,
1107
+ writable: true,
1108
+ value: (...args) => this.chain(new mod_js_1.ZUnionStoreCommand(...args))
1109
+ });
1110
+ this.client = client;
1111
+ this.commands = [];
1112
+ }
1113
+ /**
1114
+ * Pushes a command into the pipelien and returns a chainable instance of the
1115
+ * pipeline
1116
+ */
1117
+ chain(command) {
1118
+ this.commands.push(command);
1119
+ return this;
1120
+ }
1121
+ }
1122
+ exports.Pipeline = Pipeline;