@upstash/redis 0.0.0-ci.8ae20814 → 0.0.0-ci.8bd938831856fbab2f4aadc67ecb9de61efb6123

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 (396) hide show
  1. package/.npmrc +1 -0
  2. package/README.md +43 -280
  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 -76
  22. package/redis-e3e8473f.d.ts +1795 -0
  23. package/.releaserc +0 -14
  24. package/esm/package.json +0 -3
  25. package/esm/pkg/commands/append.js +0 -9
  26. package/esm/pkg/commands/bitcount.js +0 -16
  27. package/esm/pkg/commands/bitop.js +0 -9
  28. package/esm/pkg/commands/bitpos.js +0 -9
  29. package/esm/pkg/commands/command.js +0 -57
  30. package/esm/pkg/commands/dbsize.js +0 -9
  31. package/esm/pkg/commands/decr.js +0 -9
  32. package/esm/pkg/commands/decrby.js +0 -9
  33. package/esm/pkg/commands/del.js +0 -9
  34. package/esm/pkg/commands/echo.js +0 -9
  35. package/esm/pkg/commands/eval.js +0 -9
  36. package/esm/pkg/commands/evalsha.js +0 -9
  37. package/esm/pkg/commands/exists.js +0 -9
  38. package/esm/pkg/commands/expire.js +0 -9
  39. package/esm/pkg/commands/expireat.js +0 -9
  40. package/esm/pkg/commands/flushall.js +0 -13
  41. package/esm/pkg/commands/flushdb.js +0 -13
  42. package/esm/pkg/commands/get.js +0 -9
  43. package/esm/pkg/commands/getbit.js +0 -9
  44. package/esm/pkg/commands/getrange.js +0 -9
  45. package/esm/pkg/commands/getset.js +0 -9
  46. package/esm/pkg/commands/hdel.js +0 -9
  47. package/esm/pkg/commands/hexists.js +0 -9
  48. package/esm/pkg/commands/hget.js +0 -9
  49. package/esm/pkg/commands/hgetall.js +0 -33
  50. package/esm/pkg/commands/hincrby.js +0 -9
  51. package/esm/pkg/commands/hincrbyfloat.js +0 -9
  52. package/esm/pkg/commands/hkeys.js +0 -9
  53. package/esm/pkg/commands/hlen.js +0 -9
  54. package/esm/pkg/commands/hmget.js +0 -35
  55. package/esm/pkg/commands/hmset.js +0 -13
  56. package/esm/pkg/commands/hscan.js +0 -16
  57. package/esm/pkg/commands/hset.js +0 -13
  58. package/esm/pkg/commands/hsetnx.js +0 -9
  59. package/esm/pkg/commands/hstrlen.js +0 -9
  60. package/esm/pkg/commands/hvals.js +0 -9
  61. package/esm/pkg/commands/incr.js +0 -9
  62. package/esm/pkg/commands/incrby.js +0 -9
  63. package/esm/pkg/commands/incrbyfloat.js +0 -9
  64. package/esm/pkg/commands/keys.js +0 -9
  65. package/esm/pkg/commands/lindex.js +0 -6
  66. package/esm/pkg/commands/linsert.js +0 -6
  67. package/esm/pkg/commands/llen.js +0 -9
  68. package/esm/pkg/commands/lpop.js +0 -9
  69. package/esm/pkg/commands/lpush.js +0 -9
  70. package/esm/pkg/commands/lpushx.js +0 -9
  71. package/esm/pkg/commands/lrange.js +0 -6
  72. package/esm/pkg/commands/lrem.js +0 -6
  73. package/esm/pkg/commands/lset.js +0 -6
  74. package/esm/pkg/commands/ltrim.js +0 -6
  75. package/esm/pkg/commands/mget.js +0 -9
  76. package/esm/pkg/commands/mod.js +0 -114
  77. package/esm/pkg/commands/mset.js +0 -12
  78. package/esm/pkg/commands/msetnx.js +0 -9
  79. package/esm/pkg/commands/persist.js +0 -9
  80. package/esm/pkg/commands/pexpire.js +0 -9
  81. package/esm/pkg/commands/pexpireat.js +0 -9
  82. package/esm/pkg/commands/ping.js +0 -13
  83. package/esm/pkg/commands/psetex.js +0 -9
  84. package/esm/pkg/commands/pttl.js +0 -9
  85. package/esm/pkg/commands/publish.js +0 -9
  86. package/esm/pkg/commands/randomkey.js +0 -9
  87. package/esm/pkg/commands/rename.js +0 -9
  88. package/esm/pkg/commands/renamenx.js +0 -9
  89. package/esm/pkg/commands/rpop.js +0 -9
  90. package/esm/pkg/commands/rpush.js +0 -9
  91. package/esm/pkg/commands/rpushx.js +0 -9
  92. package/esm/pkg/commands/sadd.js +0 -9
  93. package/esm/pkg/commands/scan.js +0 -16
  94. package/esm/pkg/commands/scard.js +0 -9
  95. package/esm/pkg/commands/script_exists.js +0 -12
  96. package/esm/pkg/commands/script_flush.js +0 -16
  97. package/esm/pkg/commands/script_load.js +0 -9
  98. package/esm/pkg/commands/sdiff.js +0 -9
  99. package/esm/pkg/commands/sdiffstore.js +0 -9
  100. package/esm/pkg/commands/set.js +0 -24
  101. package/esm/pkg/commands/setbit.js +0 -9
  102. package/esm/pkg/commands/setex.js +0 -9
  103. package/esm/pkg/commands/setnx.js +0 -9
  104. package/esm/pkg/commands/setrange.js +0 -9
  105. package/esm/pkg/commands/sinter.js +0 -9
  106. package/esm/pkg/commands/sinterstore.js +0 -9
  107. package/esm/pkg/commands/sismember.js +0 -9
  108. package/esm/pkg/commands/smembers.js +0 -9
  109. package/esm/pkg/commands/smove.js +0 -9
  110. package/esm/pkg/commands/spop.js +0 -13
  111. package/esm/pkg/commands/srandmember.js +0 -13
  112. package/esm/pkg/commands/srem.js +0 -9
  113. package/esm/pkg/commands/sscan.js +0 -16
  114. package/esm/pkg/commands/strlen.js +0 -9
  115. package/esm/pkg/commands/sunion.js +0 -9
  116. package/esm/pkg/commands/sunionstore.js +0 -9
  117. package/esm/pkg/commands/time.js +0 -9
  118. package/esm/pkg/commands/touch.js +0 -9
  119. package/esm/pkg/commands/ttl.js +0 -9
  120. package/esm/pkg/commands/type.js +0 -9
  121. package/esm/pkg/commands/unlink.js +0 -9
  122. package/esm/pkg/commands/zadd.js +0 -26
  123. package/esm/pkg/commands/zcard.js +0 -9
  124. package/esm/pkg/commands/zcount.js +0 -9
  125. package/esm/pkg/commands/zincrby.js +0 -9
  126. package/esm/pkg/commands/zinterstore.js +0 -27
  127. package/esm/pkg/commands/zlexcount.js +0 -9
  128. package/esm/pkg/commands/zpopmax.js +0 -13
  129. package/esm/pkg/commands/zpopmin.js +0 -13
  130. package/esm/pkg/commands/zrange.js +0 -20
  131. package/esm/pkg/commands/zrank.js +0 -9
  132. package/esm/pkg/commands/zrem.js +0 -9
  133. package/esm/pkg/commands/zremrangebylex.js +0 -9
  134. package/esm/pkg/commands/zremrangebyrank.js +0 -9
  135. package/esm/pkg/commands/zremrangebyscore.js +0 -9
  136. package/esm/pkg/commands/zrevrank.js +0 -9
  137. package/esm/pkg/commands/zscan.js +0 -16
  138. package/esm/pkg/commands/zscore.js +0 -9
  139. package/esm/pkg/commands/zunionstore.js +0 -27
  140. package/esm/pkg/error.js +0 -9
  141. package/esm/pkg/http.js +0 -77
  142. package/esm/pkg/pipeline.js +0 -1125
  143. package/esm/pkg/redis.js +0 -1067
  144. package/esm/pkg/types.js +0 -1
  145. package/esm/pkg/util.js +0 -31
  146. package/esm/platforms/cloudflare.js +0 -62
  147. package/esm/platforms/fastly.js +0 -40
  148. package/esm/platforms/node_with_fetch.js +0 -60
  149. package/esm/platforms/nodejs.js +0 -59
  150. package/script/package.json +0 -3
  151. package/script/pkg/commands/append.js +0 -13
  152. package/script/pkg/commands/bitcount.js +0 -20
  153. package/script/pkg/commands/bitop.js +0 -13
  154. package/script/pkg/commands/bitpos.js +0 -13
  155. package/script/pkg/commands/command.js +0 -61
  156. package/script/pkg/commands/dbsize.js +0 -13
  157. package/script/pkg/commands/decr.js +0 -13
  158. package/script/pkg/commands/decrby.js +0 -13
  159. package/script/pkg/commands/del.js +0 -13
  160. package/script/pkg/commands/echo.js +0 -13
  161. package/script/pkg/commands/eval.js +0 -13
  162. package/script/pkg/commands/evalsha.js +0 -13
  163. package/script/pkg/commands/exists.js +0 -13
  164. package/script/pkg/commands/expire.js +0 -13
  165. package/script/pkg/commands/expireat.js +0 -13
  166. package/script/pkg/commands/flushall.js +0 -17
  167. package/script/pkg/commands/flushdb.js +0 -17
  168. package/script/pkg/commands/get.js +0 -13
  169. package/script/pkg/commands/getbit.js +0 -13
  170. package/script/pkg/commands/getrange.js +0 -13
  171. package/script/pkg/commands/getset.js +0 -13
  172. package/script/pkg/commands/hdel.js +0 -13
  173. package/script/pkg/commands/hexists.js +0 -13
  174. package/script/pkg/commands/hget.js +0 -13
  175. package/script/pkg/commands/hgetall.js +0 -37
  176. package/script/pkg/commands/hincrby.js +0 -13
  177. package/script/pkg/commands/hincrbyfloat.js +0 -13
  178. package/script/pkg/commands/hkeys.js +0 -13
  179. package/script/pkg/commands/hlen.js +0 -13
  180. package/script/pkg/commands/hmget.js +0 -39
  181. package/script/pkg/commands/hmset.js +0 -17
  182. package/script/pkg/commands/hscan.js +0 -20
  183. package/script/pkg/commands/hset.js +0 -17
  184. package/script/pkg/commands/hsetnx.js +0 -13
  185. package/script/pkg/commands/hstrlen.js +0 -13
  186. package/script/pkg/commands/hvals.js +0 -13
  187. package/script/pkg/commands/incr.js +0 -13
  188. package/script/pkg/commands/incrby.js +0 -13
  189. package/script/pkg/commands/incrbyfloat.js +0 -13
  190. package/script/pkg/commands/keys.js +0 -13
  191. package/script/pkg/commands/lindex.js +0 -10
  192. package/script/pkg/commands/linsert.js +0 -10
  193. package/script/pkg/commands/llen.js +0 -13
  194. package/script/pkg/commands/lpop.js +0 -13
  195. package/script/pkg/commands/lpush.js +0 -13
  196. package/script/pkg/commands/lpushx.js +0 -13
  197. package/script/pkg/commands/lrange.js +0 -10
  198. package/script/pkg/commands/lrem.js +0 -10
  199. package/script/pkg/commands/lset.js +0 -10
  200. package/script/pkg/commands/ltrim.js +0 -10
  201. package/script/pkg/commands/mget.js +0 -13
  202. package/script/pkg/commands/mod.js +0 -130
  203. package/script/pkg/commands/mset.js +0 -16
  204. package/script/pkg/commands/msetnx.js +0 -13
  205. package/script/pkg/commands/persist.js +0 -13
  206. package/script/pkg/commands/pexpire.js +0 -13
  207. package/script/pkg/commands/pexpireat.js +0 -13
  208. package/script/pkg/commands/ping.js +0 -17
  209. package/script/pkg/commands/psetex.js +0 -13
  210. package/script/pkg/commands/pttl.js +0 -13
  211. package/script/pkg/commands/publish.js +0 -13
  212. package/script/pkg/commands/randomkey.js +0 -13
  213. package/script/pkg/commands/rename.js +0 -13
  214. package/script/pkg/commands/renamenx.js +0 -13
  215. package/script/pkg/commands/rpop.js +0 -13
  216. package/script/pkg/commands/rpush.js +0 -13
  217. package/script/pkg/commands/rpushx.js +0 -13
  218. package/script/pkg/commands/sadd.js +0 -13
  219. package/script/pkg/commands/scan.js +0 -20
  220. package/script/pkg/commands/scard.js +0 -13
  221. package/script/pkg/commands/script_exists.js +0 -16
  222. package/script/pkg/commands/script_flush.js +0 -20
  223. package/script/pkg/commands/script_load.js +0 -13
  224. package/script/pkg/commands/sdiff.js +0 -13
  225. package/script/pkg/commands/sdiffstore.js +0 -13
  226. package/script/pkg/commands/set.js +0 -28
  227. package/script/pkg/commands/setbit.js +0 -13
  228. package/script/pkg/commands/setex.js +0 -13
  229. package/script/pkg/commands/setnx.js +0 -13
  230. package/script/pkg/commands/setrange.js +0 -13
  231. package/script/pkg/commands/sinter.js +0 -13
  232. package/script/pkg/commands/sinterstore.js +0 -13
  233. package/script/pkg/commands/sismember.js +0 -13
  234. package/script/pkg/commands/smembers.js +0 -13
  235. package/script/pkg/commands/smove.js +0 -13
  236. package/script/pkg/commands/spop.js +0 -17
  237. package/script/pkg/commands/srandmember.js +0 -17
  238. package/script/pkg/commands/srem.js +0 -13
  239. package/script/pkg/commands/sscan.js +0 -20
  240. package/script/pkg/commands/strlen.js +0 -13
  241. package/script/pkg/commands/sunion.js +0 -13
  242. package/script/pkg/commands/sunionstore.js +0 -13
  243. package/script/pkg/commands/time.js +0 -13
  244. package/script/pkg/commands/touch.js +0 -13
  245. package/script/pkg/commands/ttl.js +0 -13
  246. package/script/pkg/commands/type.js +0 -13
  247. package/script/pkg/commands/unlink.js +0 -13
  248. package/script/pkg/commands/zadd.js +0 -30
  249. package/script/pkg/commands/zcard.js +0 -13
  250. package/script/pkg/commands/zcount.js +0 -13
  251. package/script/pkg/commands/zincrby.js +0 -13
  252. package/script/pkg/commands/zinterstore.js +0 -31
  253. package/script/pkg/commands/zlexcount.js +0 -13
  254. package/script/pkg/commands/zpopmax.js +0 -17
  255. package/script/pkg/commands/zpopmin.js +0 -17
  256. package/script/pkg/commands/zrange.js +0 -24
  257. package/script/pkg/commands/zrank.js +0 -13
  258. package/script/pkg/commands/zrem.js +0 -13
  259. package/script/pkg/commands/zremrangebylex.js +0 -13
  260. package/script/pkg/commands/zremrangebyrank.js +0 -13
  261. package/script/pkg/commands/zremrangebyscore.js +0 -13
  262. package/script/pkg/commands/zrevrank.js +0 -13
  263. package/script/pkg/commands/zscan.js +0 -20
  264. package/script/pkg/commands/zscore.js +0 -13
  265. package/script/pkg/commands/zunionstore.js +0 -31
  266. package/script/pkg/error.js +0 -13
  267. package/script/pkg/http.js +0 -81
  268. package/script/pkg/pipeline.js +0 -1129
  269. package/script/pkg/redis.js +0 -1071
  270. package/script/pkg/types.js +0 -2
  271. package/script/pkg/util.js +0 -35
  272. package/script/platforms/cloudflare.js +0 -89
  273. package/script/platforms/fastly.js +0 -67
  274. package/script/platforms/node_with_fetch.js +0 -87
  275. package/script/platforms/nodejs.js +0 -86
  276. package/types/pkg/commands/append.d.ts +0 -7
  277. package/types/pkg/commands/bitcount.d.ts +0 -8
  278. package/types/pkg/commands/bitop.d.ts +0 -13
  279. package/types/pkg/commands/bitpos.d.ts +0 -7
  280. package/types/pkg/commands/command.d.ts +0 -37
  281. package/types/pkg/commands/dbsize.d.ts +0 -7
  282. package/types/pkg/commands/decr.d.ts +0 -7
  283. package/types/pkg/commands/decrby.d.ts +0 -7
  284. package/types/pkg/commands/del.d.ts +0 -7
  285. package/types/pkg/commands/echo.d.ts +0 -7
  286. package/types/pkg/commands/eval.d.ts +0 -7
  287. package/types/pkg/commands/evalsha.d.ts +0 -7
  288. package/types/pkg/commands/exists.d.ts +0 -7
  289. package/types/pkg/commands/expire.d.ts +0 -7
  290. package/types/pkg/commands/expireat.d.ts +0 -7
  291. package/types/pkg/commands/flushall.d.ts +0 -9
  292. package/types/pkg/commands/flushdb.d.ts +0 -9
  293. package/types/pkg/commands/get.d.ts +0 -7
  294. package/types/pkg/commands/getbit.d.ts +0 -7
  295. package/types/pkg/commands/getrange.d.ts +0 -7
  296. package/types/pkg/commands/getset.d.ts +0 -7
  297. package/types/pkg/commands/hdel.d.ts +0 -7
  298. package/types/pkg/commands/hexists.d.ts +0 -7
  299. package/types/pkg/commands/hget.d.ts +0 -7
  300. package/types/pkg/commands/hgetall.d.ts +0 -7
  301. package/types/pkg/commands/hincrby.d.ts +0 -7
  302. package/types/pkg/commands/hincrbyfloat.d.ts +0 -7
  303. package/types/pkg/commands/hkeys.d.ts +0 -7
  304. package/types/pkg/commands/hlen.d.ts +0 -7
  305. package/types/pkg/commands/hmget.d.ts +0 -15
  306. package/types/pkg/commands/hmset.d.ts +0 -9
  307. package/types/pkg/commands/hscan.d.ts +0 -24
  308. package/types/pkg/commands/hset.d.ts +0 -9
  309. package/types/pkg/commands/hsetnx.d.ts +0 -7
  310. package/types/pkg/commands/hstrlen.d.ts +0 -7
  311. package/types/pkg/commands/hvals.d.ts +0 -7
  312. package/types/pkg/commands/incr.d.ts +0 -7
  313. package/types/pkg/commands/incrby.d.ts +0 -7
  314. package/types/pkg/commands/incrbyfloat.d.ts +0 -7
  315. package/types/pkg/commands/keys.d.ts +0 -7
  316. package/types/pkg/commands/lindex.d.ts +0 -4
  317. package/types/pkg/commands/linsert.d.ts +0 -9
  318. package/types/pkg/commands/llen.d.ts +0 -7
  319. package/types/pkg/commands/lpop.d.ts +0 -7
  320. package/types/pkg/commands/lpush.d.ts +0 -7
  321. package/types/pkg/commands/lpushx.d.ts +0 -7
  322. package/types/pkg/commands/lrange.d.ts +0 -4
  323. package/types/pkg/commands/lrem.d.ts +0 -4
  324. package/types/pkg/commands/lset.d.ts +0 -4
  325. package/types/pkg/commands/ltrim.d.ts +0 -4
  326. package/types/pkg/commands/mget.d.ts +0 -7
  327. package/types/pkg/commands/mod.d.ts +0 -114
  328. package/types/pkg/commands/mset.d.ts +0 -9
  329. package/types/pkg/commands/msetnx.d.ts +0 -9
  330. package/types/pkg/commands/persist.d.ts +0 -7
  331. package/types/pkg/commands/pexpire.d.ts +0 -7
  332. package/types/pkg/commands/pexpireat.d.ts +0 -7
  333. package/types/pkg/commands/ping.d.ts +0 -7
  334. package/types/pkg/commands/psetex.d.ts +0 -7
  335. package/types/pkg/commands/pttl.d.ts +0 -7
  336. package/types/pkg/commands/publish.d.ts +0 -7
  337. package/types/pkg/commands/randomkey.d.ts +0 -7
  338. package/types/pkg/commands/rename.d.ts +0 -7
  339. package/types/pkg/commands/renamenx.d.ts +0 -7
  340. package/types/pkg/commands/rpop.d.ts +0 -7
  341. package/types/pkg/commands/rpush.d.ts +0 -7
  342. package/types/pkg/commands/rpushx.d.ts +0 -7
  343. package/types/pkg/commands/sadd.d.ts +0 -7
  344. package/types/pkg/commands/scan.d.ts +0 -17
  345. package/types/pkg/commands/scard.d.ts +0 -7
  346. package/types/pkg/commands/script_exists.d.ts +0 -7
  347. package/types/pkg/commands/script_flush.d.ts +0 -14
  348. package/types/pkg/commands/script_load.d.ts +0 -7
  349. package/types/pkg/commands/sdiff.d.ts +0 -7
  350. package/types/pkg/commands/sdiffstore.d.ts +0 -7
  351. package/types/pkg/commands/set.d.ts +0 -26
  352. package/types/pkg/commands/setbit.d.ts +0 -7
  353. package/types/pkg/commands/setex.d.ts +0 -7
  354. package/types/pkg/commands/setnx.d.ts +0 -7
  355. package/types/pkg/commands/setrange.d.ts +0 -7
  356. package/types/pkg/commands/sinter.d.ts +0 -7
  357. package/types/pkg/commands/sinterstore.d.ts +0 -7
  358. package/types/pkg/commands/sismember.d.ts +0 -7
  359. package/types/pkg/commands/smembers.d.ts +0 -7
  360. package/types/pkg/commands/smove.d.ts +0 -7
  361. package/types/pkg/commands/spop.d.ts +0 -7
  362. package/types/pkg/commands/srandmember.d.ts +0 -7
  363. package/types/pkg/commands/srem.d.ts +0 -7
  364. package/types/pkg/commands/sscan.d.ts +0 -24
  365. package/types/pkg/commands/strlen.d.ts +0 -7
  366. package/types/pkg/commands/sunion.d.ts +0 -7
  367. package/types/pkg/commands/sunionstore.d.ts +0 -7
  368. package/types/pkg/commands/time.d.ts +0 -7
  369. package/types/pkg/commands/touch.d.ts +0 -7
  370. package/types/pkg/commands/ttl.d.ts +0 -7
  371. package/types/pkg/commands/type.d.ts +0 -8
  372. package/types/pkg/commands/unlink.d.ts +0 -7
  373. package/types/pkg/commands/zadd.d.ts +0 -35
  374. package/types/pkg/commands/zcard.d.ts +0 -7
  375. package/types/pkg/commands/zcount.d.ts +0 -7
  376. package/types/pkg/commands/zincrby.d.ts +0 -7
  377. package/types/pkg/commands/zinterstore.d.ts +0 -30
  378. package/types/pkg/commands/zlexcount.d.ts +0 -7
  379. package/types/pkg/commands/zpopmax.d.ts +0 -7
  380. package/types/pkg/commands/zpopmin.d.ts +0 -7
  381. package/types/pkg/commands/zrange.d.ts +0 -35
  382. package/types/pkg/commands/zrank.d.ts +0 -7
  383. package/types/pkg/commands/zrem.d.ts +0 -7
  384. package/types/pkg/commands/zremrangebylex.d.ts +0 -7
  385. package/types/pkg/commands/zremrangebyrank.d.ts +0 -7
  386. package/types/pkg/commands/zremrangebyscore.d.ts +0 -7
  387. package/types/pkg/commands/zrevrank.d.ts +0 -7
  388. package/types/pkg/commands/zscan.d.ts +0 -24
  389. package/types/pkg/commands/zscore.d.ts +0 -7
  390. package/types/pkg/commands/zunionstore.d.ts +0 -30
  391. package/types/pkg/error.d.ts +0 -6
  392. package/types/pkg/http.d.ts +0 -54
  393. package/types/pkg/pipeline.d.ts +0 -540
  394. package/types/pkg/redis.d.ts +0 -516
  395. package/types/pkg/types.d.ts +0 -1
  396. package/types/pkg/util.d.ts +0 -1
package/.npmrc ADDED
@@ -0,0 +1 @@
1
+ //registry.npmjs.org/:_authToken=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
package/README.md CHANGED
@@ -23,29 +23,11 @@ See
23
23
  [the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility)
24
24
  supported.
25
25
 
26
- ## Upgrading to v1.4.0 **(ReferenceError: fetch is not defined)**
27
-
28
- If you are running on nodejs v17 and earlier, `fetch` will not be natively
29
- supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill
30
- for you. But if you are running on bare node, you need to either specify a
31
- polyfill yourself or change the import path to:
32
-
33
- ```typescript
34
- import { Redis } from "@upstash/redis/with-fetch";
35
- ```
36
-
37
- ## Upgrading from v0.2.0?
38
-
39
- Please read the
40
- [migration guide](https://github.com/upstash/upstash-redis#migrating-to-v1). For
41
- further explanation we wrote a
42
- [blog post](https://blog.upstash.com/upstash-redis-sdk-v1).
43
-
44
26
  ## Quick Start
45
27
 
46
28
  ### Install
47
29
 
48
- #### npm
30
+ #### Node.js
49
31
 
50
32
  ```bash
51
33
  npm install @upstash/redis
@@ -54,141 +36,14 @@ npm install @upstash/redis
54
36
  #### Deno
55
37
 
56
38
  ```ts
57
- import { Redis } from "https://deno.land/x/upstash_redis/mod.ts";
39
+ import { Redis } from "https://deno.land/x/upstash_redis/mod";
58
40
  ```
59
41
 
60
42
  ### Create database
61
43
 
62
44
  Create a new redis database on [upstash](https://console.upstash.com/)
63
45
 
64
- ### Environments
65
-
66
- We support various platforms, such as nodejs, cloudflare and fastly. Platforms
67
- differ slightly when it comes to environment variables and their `fetch` api.
68
- Please use the correct import when deploying to special platforms.
69
-
70
- #### Node.js
71
-
72
- Examples: Vercel, Netlify, AWS Lambda
73
-
74
- If you are running on nodejs you can set `UPSTASH_REDIS_REST_URL` and
75
- `UPSTASH_REDIS_REST_TOKEN` as environment variable and create a redis instance
76
- like this:
77
-
78
- ```ts
79
- import { Redis } from "@upstash/redis"
80
-
81
- const redis = new Redis({
82
- url: <UPSTASH_REDIS_REST_URL>,
83
- token: <UPSTASH_REDIS_REST_TOKEN>,
84
- })
85
-
86
- // or load directly from env
87
- const redis = Redis.fromEnv()
88
- ```
89
-
90
- If you are running on nodejs v17 and earlier, `fetch` will not be natively
91
- supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill
92
- for you. But if you are running on bare node, you need to either specify a
93
- polyfill yourself or change the import path to:
94
-
95
- ```typescript
96
- import { Redis } from "@upstash/redis/with-fetch";
97
- ```
98
-
99
- - [Code example](https://github.com/upstash/upstash-redis/blob/main/examples/nodejs)
100
-
101
- #### Cloudflare Workers
102
-
103
- Cloudflare handles environment variables differently than nodejs. Please add
104
- `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` using
105
- `wrangler secret put ...` or in the cloudflare dashboard.
106
-
107
- Afterwards you can create a redis instance:
108
-
109
- ```ts
110
- import { Redis } from "@upstash/redis/cloudflare"
111
-
112
- const redis = new Redis({
113
- url: <UPSTASH_REDIS_REST_URL>,
114
- token: <UPSTASH_REDIS_REST_TOKEN>,
115
- })
116
-
117
-
118
- // or load directly from global env
119
-
120
- // service worker
121
- const redis = Redis.fromEnv()
122
-
123
-
124
- // module worker
125
- export default {
126
- async fetch(request: Request, env: Bindings) {
127
- const redis = Redis.fromEnv(env)
128
- // ...
129
- }
130
- }
131
- ```
132
-
133
- - [Code example](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers)
134
- - [Code example typescript](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers-with-typescript)
135
- - [Code example Wrangler 1](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers-with-wrangler-1)
136
- - [Documentation](https://docs.upstash.com/redis/tutorials/cloudflare_workers_with_redis)
137
-
138
- #### Fastly
139
-
140
- Fastly introduces a concept called
141
- [backend](https://developer.fastly.com/reference/api/services/backend/). You
142
- need to configure a backend in your `fastly.toml`. An example can be found
143
- [here](https://github.com/upstash/upstash-redis/blob/main/examples/fastly/fastly.toml).
144
- Until the fastly api stabilizes we recommend creating an instance manually:
145
-
146
- ```ts
147
- import { Redis } from "@upstash/redis/fastly"
148
-
149
- const redis = new Redis({
150
- url: <UPSTASH_REDIS_REST_URL>,
151
- token: <UPSTASH_REDIS_REST_TOKEN>,
152
- backend: <BACKEND_NAME>,
153
- })
154
- ```
155
-
156
- - [Code example](https://github.com/upstash/upstash-redis/tree/main/examples/fastly)
157
- - [Documentation](https://blog.upstash.com/fastly-compute-edge-with-redi)
158
-
159
- #### Deno
160
-
161
- Examples: [Deno Deploy](https://deno.com/deploy),
162
- [Netlify Edge](https://www.netlify.com/products/edge/)
163
-
164
- ```ts
165
- import { Redis } from "https://deno.land/x/upstash_redis/mod.ts"
166
-
167
- const redis = new Redis({
168
- url: <UPSTASH_REDIS_REST_URL>,
169
- token: <UPSTASH_REDIS_REST_TOKEN>,
170
- })
171
-
172
- // or
173
- const redis = Redis.fromEnv();
174
- ```
175
-
176
- ### Working with types
177
-
178
- Most commands allow you to provide a type to make working with typescript
179
- easier.
180
-
181
- ```ts
182
- const data = await redis.get<MyCustomType>("key");
183
- // data is typed as `MyCustomType`
184
- ```
185
-
186
- ## Migrating to v1
187
-
188
- ### Explicit authentication
189
-
190
- The library is no longer automatically trying to load connection secrets from
191
- environment variables. You must either supply them yourself:
46
+ ## Basic Usage:
192
47
 
193
48
  ```ts
194
49
  import { Redis } from "@upstash/redis"
@@ -197,146 +52,41 @@ const redis = new Redis({
197
52
  url: <UPSTASH_REDIS_REST_URL>,
198
53
  token: <UPSTASH_REDIS_REST_TOKEN>,
199
54
  })
200
- ```
201
-
202
- Or use one of the static constructors to load from environment variables:
203
-
204
- ```ts
205
- // Nodejs
206
- import { Redis } from "@upstash/redis";
207
- const redis = Redis.fromEnv();
208
- ```
209
-
210
- ```ts
211
- // or when deploying to cloudflare workers
212
- import { Redis } from "@upstash/redis/cloudflare";
213
- const redis = Redis.fromEnv();
214
- ```
215
-
216
- ### Error handling
217
-
218
- Errors are now thrown automatically instead of being returned to you.
219
-
220
- ```ts
221
- // old
222
- const { data, error } = await set("key", "value");
223
- if (error) {
224
- throw new Error(error);
225
- }
226
-
227
- // new
228
- const data = await redis.set("key", "value"); // error is thrown automatically
229
- ```
230
-
231
- ## Pipeline
232
-
233
- `v1.0.0` introduces redis pipelines. Pipelining commands allows you to send a
234
- single http request with multiple commands.
235
-
236
- ```ts
237
- import { Redis } from "@upstash/redis";
238
-
239
- const redis = new Redis({
240
- /* auth */
241
- });
242
-
243
- const p = redis.pipeline();
244
-
245
- // Now you can chain multiple commands to create your pipeline:
246
-
247
- p.set("key", 2);
248
- p.incr("key");
249
-
250
- // or inline:
251
- p.hset("key2", "field", { hello: "world" }).hvals("key2");
252
-
253
- // Execute the pipeline once you are done building it:
254
- // `exec` returns an array where each element represents the response of a command in the pipeline.
255
- // You can optionally provide a type like this to get a typed response.
256
- const res = await p.exec<[Type1, Type2, Type3]>();
257
- ```
258
-
259
- For more information about pipelines using REST see
260
- [here](https://blog.upstash.com/pipeline).
261
-
262
- ### Advanced
263
-
264
- A low level `Command` class can be imported from `@upstash/redis` in case you
265
- need more control about types and or (de)serialization.
266
-
267
- By default all objects you are storing in redis are serialized using
268
- `JSON.stringify` and recursively deserialized as well. Here's an example how you
269
- could customize that behaviour. Keep in mind that you need to provide a `fetch`
270
- polyfill if you are running on nodejs. We recommend
271
- [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch).
272
-
273
- ```ts
274
- import { Command } from "@upstash/redis/commands"
275
- import { HttpClient } from "@upstash/redis/http"
276
-
277
- /**
278
- * TData represents what the user will enter or receive,
279
- * TResult is the raw data returned from upstash, which may need to be
280
- * transformed or parsed.
281
- */
282
- const deserialize: (raw: TResult) => TData = ...
283
-
284
- class CustomGetCommand<TData, TResult> extends Command<TData | null, TResult | null> {
285
- constructor(key: string, ) {
286
- super(["get", key], { deserialize })
287
- }
288
- }
289
-
290
- const client = new HttpClient({
291
- baseUrl: <UPSTASH_REDIS_REST_URL>,
292
- headers: {
293
- authorization: `Bearer ${<UPSTASH_REDIS_REST_TOKEN>}`,
294
- },
295
- })
296
-
297
- const res = new CustomGetCommand("key").exec(client)
298
- ```
299
55
 
300
- ### Additional information
56
+ // string
57
+ await redis.set('key', 'value');
58
+ let data = await redis.get('key');
59
+ console.log(data)
301
60
 
302
- #### `keepalive`
61
+ await redis.set('key2', 'value2', {ex: 1});
303
62
 
304
- `@upstash/redis` is capable of reusing connections where possible to minimize
305
- latency. Connections can be reused if the client is stored in memory and not
306
- initialized with every new function invocation. The easiest way to achieve this
307
- is by creating the client outside of your handler and adding an https agent:
63
+ // sorted set
64
+ await redis.zadd('scores', { score: 1, member: 'team1' })
65
+ data = await redis.zrange('scores', 0, 100 )
66
+ console.log(data)
308
67
 
309
- ```ts
310
- // Nextjs api route
311
- import { Redis } from "@upstash/redis";
312
- import https from "https";
68
+ // list
69
+ await redis.lpush('elements', 'magnesium')
70
+ data = await redis.lrange('elements', 0, 100 )
71
+ console.log(data)
313
72
 
314
- const redis = Redis.fromEnv({
315
- agent: new https.Agent({ keepAlive: true }),
316
- });
73
+ // hash
74
+ await redis.hset('people', {name: 'joe'})
75
+ data = await redis.hget('people', 'name' )
76
+ console.log(data)
317
77
 
318
- export default async function (req, res) {
319
- // use redis here
320
- }
78
+ // sets
79
+ await redis.sadd('animals', 'cat')
80
+ data = await redis.spop('animals', 1)
81
+ console.log(data)
321
82
  ```
322
83
 
323
- Whenever your hot lambda receives a new request the client is already
324
- initialized and the previously established connection to upstash is reused.
84
+ ## Troubleshooting
325
85
 
326
- #### Javascript MAX_SAFE_INTEGER
327
-
328
- Javascript can not handle numbers larger than `2^53 -1` safely and would return
329
- wrong results when trying to deserialize them. In these cases the default
330
- deserializer will return them as string instead. This might cause a mismatch
331
- with your custom types.
332
-
333
- ```ts
334
- await redis.set("key", "101600000000150081467");
335
- const res = await redis<number>("get");
336
- ```
337
-
338
- In this example `res` will still be a string despite the type annotation. Please
339
- keep that in mind and adjust accordingly.
86
+ We have a
87
+ [dedicated page](https://docs.upstash.com/redis/sdks/javascriptsdk/troubleshooting)
88
+ for common problems. If you can't find a solution, please
89
+ [open an issue](https://github.com/upstash/upstash-redis/issues/new).
340
90
 
341
91
  ## Docs
342
92
 
@@ -358,5 +108,18 @@ the url and token
358
108
  UPSTASH_REDIS_REST_URL=".." UPSTASH_REDIS_REST_TOKEN=".." deno test -A
359
109
  ```
360
110
 
361
- ```
111
+ ### Telemetry
112
+
113
+ This library sends anonymous telemetry data to help us improve your experience.
114
+ We collect the following:
115
+
116
+ - SDK version
117
+ - Platform (Deno, Cloudflare, Vercel)
118
+ - Runtime version (node@18.x)
119
+
120
+ You can opt out by setting the `UPSTASH_DISABLE_TELEMETRY` environment variable
121
+ to any truthy value.
122
+
123
+ ```sh
124
+ UPSTASH_DISABLE_TELEMETRY=1
362
125
  ```
@@ -0,0 +1,45 @@
1
+ import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './redis-e3e8473f.js';
2
+ export { c as Requester, U as UpstashRequest, d as UpstashResponse } from './redis-e3e8473f.js';
3
+
4
+ type Env = {
5
+ UPSTASH_DISABLE_TELEMETRY?: string;
6
+ };
7
+
8
+ /**
9
+ * Connection credentials for upstash redis.
10
+ * Get them from https://console.upstash.com/redis/<uuid>
11
+ */
12
+ type RedisConfigCloudflare = {
13
+ /**
14
+ * UPSTASH_REDIS_REST_URL
15
+ */
16
+ url: string;
17
+ /**
18
+ * UPSTASH_REDIS_REST_TOKEN
19
+ */
20
+ token: string;
21
+ } & RedisOptions & RequesterConfig & Env;
22
+ /**
23
+ * Serverless redis client for upstash.
24
+ */
25
+ declare class Redis extends Redis$1 {
26
+ /**
27
+ * Create a new redis client
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * const redis = new Redis({
32
+ * url: "<UPSTASH_REDIS_REST_URL>",
33
+ * token: "<UPSTASH_REDIS_REST_TOKEN>",
34
+ * });
35
+ * ```
36
+ */
37
+ constructor(config: RedisConfigCloudflare, env?: Env);
38
+ static fromEnv(env?: {
39
+ UPSTASH_REDIS_REST_URL: string;
40
+ UPSTASH_REDIS_REST_TOKEN: string;
41
+ UPSTASH_DISABLE_TELEMETRY?: string;
42
+ }, opts?: Omit<RedisConfigCloudflare, "url" | "token">): Redis;
43
+ }
44
+
45
+ export { Redis, RedisConfigCloudflare };
@@ -1,11 +1,15 @@
1
- import * as core from "../pkg/redis.js";
2
- import type { Requester, RetryConfig, UpstashRequest, UpstashResponse } from "../pkg/http.js";
3
- export type { Requester, UpstashRequest, UpstashResponse };
1
+ import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './redis-e3e8473f.js';
2
+ export { c as Requester, U as UpstashRequest, d as UpstashResponse } from './redis-e3e8473f.js';
3
+
4
+ type Env = {
5
+ UPSTASH_DISABLE_TELEMETRY?: string;
6
+ };
7
+
4
8
  /**
5
9
  * Connection credentials for upstash redis.
6
10
  * Get them from https://console.upstash.com/redis/<uuid>
7
11
  */
8
- export declare type RedisConfigCloudflare = {
12
+ type RedisConfigCloudflare = {
9
13
  /**
10
14
  * UPSTASH_REDIS_REST_URL
11
15
  */
@@ -14,15 +18,11 @@ export declare type RedisConfigCloudflare = {
14
18
  * UPSTASH_REDIS_REST_TOKEN
15
19
  */
16
20
  token: string;
17
- /**
18
- * Configure the retry behaviour in case of network errors
19
- */
20
- retry?: RetryConfig;
21
- } & core.RedisOptions;
21
+ } & RedisOptions & RequesterConfig & Env;
22
22
  /**
23
23
  * Serverless redis client for upstash.
24
24
  */
25
- export declare class Redis extends core.Redis {
25
+ declare class Redis extends Redis$1 {
26
26
  /**
27
27
  * Create a new redis client
28
28
  *
@@ -34,9 +34,12 @@ export declare class Redis extends core.Redis {
34
34
  * });
35
35
  * ```
36
36
  */
37
- constructor(config: RedisConfigCloudflare);
37
+ constructor(config: RedisConfigCloudflare, env?: Env);
38
38
  static fromEnv(env?: {
39
39
  UPSTASH_REDIS_REST_URL: string;
40
40
  UPSTASH_REDIS_REST_TOKEN: string;
41
+ UPSTASH_DISABLE_TELEMETRY?: string;
41
42
  }, opts?: Omit<RedisConfigCloudflare, "url" | "token">): Redis;
42
43
  }
44
+
45
+ export { Redis, RedisConfigCloudflare };