@upstash/redis 1.0.0-alpha.1 → 1.0.0-alpha.2

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 (264) hide show
  1. package/.eslintrc.js +49 -0
  2. package/.prettierrc.js +7 -0
  3. package/dist/chunk-7YUZYRJS.mjs +29 -0
  4. package/dist/chunk-FJSI5EBJ.mjs +38 -0
  5. package/dist/chunk-U7OXAQMQ.mjs +37 -0
  6. package/dist/chunk-Y5TC4HX2.mjs +798 -0
  7. package/dist/{chunk-RYSRH3HC.mjs → chunk-ZIB6XPPC.mjs} +4 -27
  8. package/dist/cloudflare.d.ts +38 -0
  9. package/dist/cloudflare.js +1738 -0
  10. package/dist/cloudflare.mjs +35 -0
  11. package/dist/commands.d.ts +3 -2
  12. package/dist/commands.js +1 -1
  13. package/dist/commands.mjs +2 -1
  14. package/dist/fastly.d.ts +44 -0
  15. package/dist/fastly.js +1728 -0
  16. package/dist/fastly.mjs +25 -0
  17. package/dist/http.d.ts +29 -0
  18. package/dist/http.js +84 -0
  19. package/dist/http.mjs +7 -0
  20. package/dist/index.d.ts +5 -1003
  21. package/dist/index.js +62 -72
  22. package/dist/index.mjs +8 -857
  23. package/dist/nodejs.d.ts +47 -0
  24. package/dist/nodejs.js +1742 -0
  25. package/dist/nodejs.mjs +10 -0
  26. package/dist/package.json +1 -0
  27. package/dist/redis-dd052782.d.ts +962 -0
  28. package/dist/{zunionstore-462de5d3.d.ts → zunionstore-dffa797d.d.ts} +2 -27
  29. package/jest.config.js +195 -0
  30. package/package.json +1 -1
  31. package/pkg/cloudflare.ts +77 -0
  32. package/pkg/command.ts +40 -0
  33. package/pkg/commands/append.test.ts +28 -0
  34. package/pkg/commands/append.ts +10 -0
  35. package/pkg/commands/bitcount.test.ts +36 -0
  36. package/pkg/commands/bitcount.ts +19 -0
  37. package/pkg/commands/bitop.test.ts +44 -0
  38. package/pkg/commands/bitop.ts +22 -0
  39. package/pkg/commands/bitpos.test.ts +26 -0
  40. package/pkg/commands/bitpos.ts +10 -0
  41. package/pkg/commands/dbsize.test.ts +17 -0
  42. package/pkg/commands/dbsize.ts +10 -0
  43. package/pkg/commands/decr.test.ts +22 -0
  44. package/pkg/commands/decr.ts +10 -0
  45. package/pkg/commands/decrby.test.ts +23 -0
  46. package/pkg/commands/decrby.ts +10 -0
  47. package/pkg/commands/del.test.ts +38 -0
  48. package/pkg/commands/del.ts +11 -0
  49. package/pkg/commands/echo.test.ts +11 -0
  50. package/pkg/commands/echo.ts +10 -0
  51. package/pkg/commands/exists.test.ts +37 -0
  52. package/pkg/commands/exists.ts +11 -0
  53. package/pkg/commands/expire.test.ts +22 -0
  54. package/pkg/commands/expire.ts +10 -0
  55. package/pkg/commands/expireat.test.ts +24 -0
  56. package/pkg/commands/expireat.ts +10 -0
  57. package/pkg/commands/flushall.test.ts +17 -0
  58. package/pkg/commands/flushall.ts +13 -0
  59. package/pkg/commands/flushdb.test.ts +17 -0
  60. package/pkg/commands/flushdb.ts +13 -0
  61. package/pkg/commands/get.test.ts +34 -0
  62. package/pkg/commands/get.ts +10 -0
  63. package/pkg/commands/getbit.test.ts +16 -0
  64. package/pkg/commands/getbit.ts +10 -0
  65. package/pkg/commands/getrange.test.ts +25 -0
  66. package/pkg/commands/getrange.ts +10 -0
  67. package/pkg/commands/getset.test.ts +33 -0
  68. package/pkg/commands/getset.ts +10 -0
  69. package/pkg/commands/hdel.test.ts +30 -0
  70. package/pkg/commands/hdel.ts +10 -0
  71. package/pkg/commands/hexists.test.ts +31 -0
  72. package/pkg/commands/hexists.ts +10 -0
  73. package/pkg/commands/hget.test.ts +47 -0
  74. package/pkg/commands/hget.ts +10 -0
  75. package/pkg/commands/hgetall.test.ts +32 -0
  76. package/pkg/commands/hgetall.ts +35 -0
  77. package/pkg/commands/hincrby.test.ts +27 -0
  78. package/pkg/commands/hincrby.ts +10 -0
  79. package/pkg/commands/hincrbyfloat.test.ts +25 -0
  80. package/pkg/commands/hincrbyfloat.ts +10 -0
  81. package/pkg/commands/hkeys.test.ts +22 -0
  82. package/pkg/commands/hkeys.ts +10 -0
  83. package/pkg/commands/hlen.test.ts +24 -0
  84. package/pkg/commands/hlen.ts +10 -0
  85. package/pkg/commands/hmget.test.ts +48 -0
  86. package/pkg/commands/hmget.ts +41 -0
  87. package/pkg/commands/hmset.test.ts +24 -0
  88. package/pkg/commands/hmset.ts +10 -0
  89. package/pkg/commands/hscan.test.ts +46 -0
  90. package/pkg/commands/hscan.ts +22 -0
  91. package/pkg/commands/hset.test.ts +21 -0
  92. package/pkg/commands/hset.ts +10 -0
  93. package/pkg/commands/hsetnx.test.ts +37 -0
  94. package/pkg/commands/hsetnx.ts +10 -0
  95. package/pkg/commands/hstrlen.test.ts +24 -0
  96. package/pkg/commands/hstrlen.ts +10 -0
  97. package/pkg/commands/hvals.test.ts +23 -0
  98. package/pkg/commands/hvals.ts +10 -0
  99. package/pkg/commands/incr.test.ts +23 -0
  100. package/pkg/commands/incr.ts +10 -0
  101. package/pkg/commands/incrby.test.ts +23 -0
  102. package/pkg/commands/incrby.ts +10 -0
  103. package/pkg/commands/incrbyfloat.test.ts +24 -0
  104. package/pkg/commands/incrbyfloat.ts +10 -0
  105. package/pkg/commands/index.ts +107 -0
  106. package/pkg/commands/keys.test.ts +17 -0
  107. package/pkg/commands/keys.ts +10 -0
  108. package/pkg/commands/lindex.test.ts +33 -0
  109. package/pkg/commands/lindex.ts +7 -0
  110. package/pkg/commands/linsert.test.ts +19 -0
  111. package/pkg/commands/linsert.ts +6 -0
  112. package/pkg/commands/llen.test.ts +26 -0
  113. package/pkg/commands/llen.ts +10 -0
  114. package/pkg/commands/lpop.test.ts +27 -0
  115. package/pkg/commands/lpop.ts +10 -0
  116. package/pkg/commands/lpush.test.ts +17 -0
  117. package/pkg/commands/lpush.ts +11 -0
  118. package/pkg/commands/lpushx.test.ts +29 -0
  119. package/pkg/commands/lpushx.ts +11 -0
  120. package/pkg/commands/lrange.test.ts +22 -0
  121. package/pkg/commands/lrange.ts +7 -0
  122. package/pkg/commands/lrem.test.ts +19 -0
  123. package/pkg/commands/lrem.ts +6 -0
  124. package/pkg/commands/lset.test.ts +40 -0
  125. package/pkg/commands/lset.ts +7 -0
  126. package/pkg/commands/ltrim.test.ts +29 -0
  127. package/pkg/commands/ltrim.ts +7 -0
  128. package/pkg/commands/mget.test.ts +44 -0
  129. package/pkg/commands/mget.ts +9 -0
  130. package/pkg/commands/mset.test.ts +24 -0
  131. package/pkg/commands/mset.ts +10 -0
  132. package/pkg/commands/msetnx.test.ts +46 -0
  133. package/pkg/commands/msetnx.ts +10 -0
  134. package/pkg/commands/persist.test.ts +22 -0
  135. package/pkg/commands/persist.ts +10 -0
  136. package/pkg/commands/pexpire.test.ts +24 -0
  137. package/pkg/commands/pexpire.ts +10 -0
  138. package/pkg/commands/pexpireat.test.ts +24 -0
  139. package/pkg/commands/pexpireat.ts +10 -0
  140. package/pkg/commands/ping.test.ts +19 -0
  141. package/pkg/commands/ping.ts +13 -0
  142. package/pkg/commands/psetex.test.ts +23 -0
  143. package/pkg/commands/psetex.ts +10 -0
  144. package/pkg/commands/pttl.test.ts +17 -0
  145. package/pkg/commands/pttl.ts +10 -0
  146. package/pkg/commands/randomkey.test.ts +17 -0
  147. package/pkg/commands/randomkey.ts +10 -0
  148. package/pkg/commands/rename.test.ts +18 -0
  149. package/pkg/commands/rename.ts +10 -0
  150. package/pkg/commands/renamenx.test.ts +32 -0
  151. package/pkg/commands/renamenx.ts +10 -0
  152. package/pkg/commands/rpop.test.ts +27 -0
  153. package/pkg/commands/rpop.ts +10 -0
  154. package/pkg/commands/rpush.test.ts +17 -0
  155. package/pkg/commands/rpush.ts +11 -0
  156. package/pkg/commands/rpushx.test.ts +29 -0
  157. package/pkg/commands/rpushx.ts +11 -0
  158. package/pkg/commands/sadd.test.ts +16 -0
  159. package/pkg/commands/sadd.ts +11 -0
  160. package/pkg/commands/scan.test.ts +50 -0
  161. package/pkg/commands/scan.ts +21 -0
  162. package/pkg/commands/scard.test.ts +15 -0
  163. package/pkg/commands/scard.ts +9 -0
  164. package/pkg/commands/sdiff.test.ts +20 -0
  165. package/pkg/commands/sdiff.ts +9 -0
  166. package/pkg/commands/sdiffstore.test.ts +21 -0
  167. package/pkg/commands/sdiffstore.ts +10 -0
  168. package/pkg/commands/set.test.ts +112 -0
  169. package/pkg/commands/set.ts +53 -0
  170. package/pkg/commands/setbit.test.ts +16 -0
  171. package/pkg/commands/setbit.ts +10 -0
  172. package/pkg/commands/setex.test.ts +22 -0
  173. package/pkg/commands/setex.ts +10 -0
  174. package/pkg/commands/setnx.test.ts +27 -0
  175. package/pkg/commands/setnx.ts +10 -0
  176. package/pkg/commands/setrange.test.ts +25 -0
  177. package/pkg/commands/setrange.ts +10 -0
  178. package/pkg/commands/sinter.test.ts +36 -0
  179. package/pkg/commands/sinter.ts +9 -0
  180. package/pkg/commands/sinterstore.test.ts +21 -0
  181. package/pkg/commands/sinterstore.ts +9 -0
  182. package/pkg/commands/sismember.test.ts +30 -0
  183. package/pkg/commands/sismember.ts +9 -0
  184. package/pkg/commands/smembers.test.ts +22 -0
  185. package/pkg/commands/smembers.ts +10 -0
  186. package/pkg/commands/smove.test.ts +18 -0
  187. package/pkg/commands/smove.ts +9 -0
  188. package/pkg/commands/spop.test.ts +35 -0
  189. package/pkg/commands/spop.ts +13 -0
  190. package/pkg/commands/srandmember.test.ts +32 -0
  191. package/pkg/commands/srandmember.ts +13 -0
  192. package/pkg/commands/srem.test.ts +18 -0
  193. package/pkg/commands/srem.ts +10 -0
  194. package/pkg/commands/sscan.test.ts +50 -0
  195. package/pkg/commands/sscan.ts +22 -0
  196. package/pkg/commands/strlen.test.ts +16 -0
  197. package/pkg/commands/strlen.ts +10 -0
  198. package/pkg/commands/sunion.test.ts +22 -0
  199. package/pkg/commands/sunion.ts +10 -0
  200. package/pkg/commands/sunionstore.test.ts +29 -0
  201. package/pkg/commands/sunionstore.ts +10 -0
  202. package/pkg/commands/time.test.ts +11 -0
  203. package/pkg/commands/time.ts +9 -0
  204. package/pkg/commands/touch.test.ts +20 -0
  205. package/pkg/commands/touch.ts +10 -0
  206. package/pkg/commands/ttl.test.ts +17 -0
  207. package/pkg/commands/ttl.ts +10 -0
  208. package/pkg/commands/type.test.ts +72 -0
  209. package/pkg/commands/type.ts +11 -0
  210. package/pkg/commands/unlink.test.ts +21 -0
  211. package/pkg/commands/unlink.ts +10 -0
  212. package/pkg/commands/zadd.test.ts +177 -0
  213. package/pkg/commands/zadd.ts +64 -0
  214. package/pkg/commands/zcard.test.ts +15 -0
  215. package/pkg/commands/zcard.ts +10 -0
  216. package/pkg/commands/zcount.test.ts +15 -0
  217. package/pkg/commands/zcount.ts +9 -0
  218. package/pkg/commands/zincrby.test.ts +20 -0
  219. package/pkg/commands/zincrby.ts +9 -0
  220. package/pkg/commands/zinterstore.test.ts +239 -0
  221. package/pkg/commands/zinterstore.ts +55 -0
  222. package/pkg/commands/zlexcount.test.ts +22 -0
  223. package/pkg/commands/zlexcount.ts +9 -0
  224. package/pkg/commands/zpopmax.test.ts +45 -0
  225. package/pkg/commands/zpopmax.ts +13 -0
  226. package/pkg/commands/zpopmin.test.ts +49 -0
  227. package/pkg/commands/zpopmin.ts +13 -0
  228. package/pkg/commands/zrange.test.ts +52 -0
  229. package/pkg/commands/zrange.ts +22 -0
  230. package/pkg/commands/zrank.test.ts +22 -0
  231. package/pkg/commands/zrank.ts +10 -0
  232. package/pkg/commands/zrem.test.ts +20 -0
  233. package/pkg/commands/zrem.ts +10 -0
  234. package/pkg/commands/zremrangebylex.test.ts +26 -0
  235. package/pkg/commands/zremrangebylex.ts +9 -0
  236. package/pkg/commands/zremrangebyrank.test.ts +27 -0
  237. package/pkg/commands/zremrangebyrank.ts +9 -0
  238. package/pkg/commands/zremrangebyscore.test.ts +24 -0
  239. package/pkg/commands/zremrangebyscore.ts +9 -0
  240. package/pkg/commands/zrevrank.test.ts +22 -0
  241. package/pkg/commands/zrevrank.ts +10 -0
  242. package/pkg/commands/zscan.test.ts +50 -0
  243. package/pkg/commands/zscan.ts +22 -0
  244. package/pkg/commands/zscore.test.ts +18 -0
  245. package/pkg/commands/zscore.ts +10 -0
  246. package/pkg/commands/zunionstore.test.ts +215 -0
  247. package/pkg/commands/zunionstore.ts +55 -0
  248. package/pkg/commands/zz.ts +1 -0
  249. package/pkg/error.ts +9 -0
  250. package/pkg/fastly.ts +54 -0
  251. package/pkg/http.test.ts +34 -0
  252. package/pkg/http.ts +62 -0
  253. package/pkg/index.ts +2 -0
  254. package/pkg/nodejs.ts +83 -0
  255. package/pkg/pipeline.test.ts +177 -0
  256. package/pkg/pipeline.ts +999 -0
  257. package/pkg/redis.ts +930 -0
  258. package/pkg/test-utils.ts +41 -0
  259. package/pkg/types.ts +4 -0
  260. package/pkg/util.ts +22 -0
  261. package/pnpm-lock.yaml +3940 -0
  262. package/tsconfig.json +100 -0
  263. package/tsconfig.module.json +8 -0
  264. package/tsup.config.ts +16 -0
package/dist/index.d.ts CHANGED
@@ -1,1005 +1,7 @@
1
- import { H as HttpClient, C as CommandArgs, A as AppendCommand, B as BitCountCommand, a as BitPosCommand, D as DecrCommand, b as DecrByCommand, c as DelCommand, E as EchoCommand, d as ExistsCommand, e as ExpireCommand, f as ExpireAtCommand, F as FlushAllCommand, g as FlushDBCommand, G as GetCommand, h as GetBitCommand, i as GetRangeCommand, j as HDelCommand, k as HExistsCommand, l as HGetCommand, m as HGetAllCommand, n as HIncrByCommand, o as HIncrByFloatCommand, p as HKeysCommand, q as HLenCommand, r as HMGetCommand, s as HScanCommand, t as HStrLenCommand, u as HValsCommand, I as IncrCommand, v as IncrByCommand, w as IncrByFloatCommand, K as KeysCommand, L as LIndexCommand, x as LLenCommand, y as LPopCommand, N as NonEmptyArray, z as LRangeCommand, J as LTrimCommand, M as MGetCommand, P as PersistCommand, O as PExpireCommand, Q as PExpireAtCommand, R as PingCommand, S as PTtlCommand, T as RenameCommand, U as RenameNXCommand, V as RPopCommand, W as ScanCommand, X as SCardCommand, Y as SDiffCommand, Z as SDiffStoreCommand, _ as SetCommandOptions, $ as SetBitCommand, a0 as SetRangeCommand, a1 as SInterCommand, a2 as SInterStoreCommand, a3 as SMembersCommand, a4 as SPopCommand, a5 as SRandMemberCommand, a6 as SScanCommand, a7 as StrLenCommand, a8 as SUnionCommand, a9 as SUnionStoreCommand, aa as TouchCommand, ab as TtlCommand, ac as TypeCommand, ad as UnlinkCommand, ae as ScoreMember, af as ZAddCommandOptions, ag as ZAddCommandOptionsWithIncr, ah as ZCardCommand, ai as ZCountCommand, aj as ZInterStoreCommand, ak as ZLexCountCommand, al as ZPopMaxCommand, am as ZPopMinCommand, an as ZRangeCommand, ao as ZRemRangeByLexCommand, ap as ZRemRangeByRankCommand, aq as ZRemRangeByScoreCommand, ar as ZScanCommand, as as ZUnionStoreCommand, at as Type } from './zunionstore-462de5d3';
2
-
3
- /**
4
- * Upstash REST API supports command pipelining to send multiple commands in
5
- * batch, instead of sending each command one by one and waiting for a response.
6
- * When using pipelines, several commands are sent using a single HTTP request,
7
- * and a single JSON array response is returned. Each item in the response array
8
- * corresponds to the command in the same order within the pipeline.
9
- *
10
- * **NOTE:**
11
- *
12
- * Execution of the pipeline is not atomic. Even though each command in
13
- * the pipeline will be executed in order, commands sent by other clients can
14
- * interleave with the pipeline.
15
- *
16
- *
17
- * **Examples:**
18
- *
19
- * ```ts
20
- * const p = redis.pipeline()
21
- * p.set("key","value")
22
- * p.get("key")
23
- * const res = await p.exec()
24
- * ```
25
- *
26
- * You can also chain commands together
27
- * ```ts
28
- * const p = redis.pipeline()
29
- * const res = await p.set("key","value").get("key").exec()
30
- * ```
31
- *
32
- * It's not possible to infer correct types with a dynamic pipeline, so you can
33
- * override the response type manually:
34
- * ```ts
35
- * redis.pipeline()
36
- * .set("key", { greeting: "hello"})
37
- * .get("key")
38
- * .exec<["OK", { greeting: string } ]>()
39
- *
40
- * ```
41
- */
42
- declare class Pipeline {
43
- private client;
44
- private commands;
45
- constructor(client: HttpClient);
46
- /**
47
- * Send the pipeline request to upstash.
48
- *
49
- * Returns an array with the results of all pipelined commands.
50
- *
51
- * You can define a return type manually to make working in typescript easier
52
- * ```ts
53
- * redis.pipeline().get("key").exec<[{ greeting: string }]>()
54
- * ```
55
- */
56
- exec<TCommandResults extends unknown[] = unknown[]>(): Promise<TCommandResults>;
57
- /**
58
- * Pushes a command into the pipelien and returns a chainable instance of the
59
- * pipeline
60
- */
61
- private chain;
62
- /**
63
- * @see https://redis.io/commands/append
64
- */
65
- append(...args: CommandArgs<typeof AppendCommand>): this;
66
- /**
67
- * @see https://redis.io/commands/bitcount
68
- */
69
- bitcount(...args: CommandArgs<typeof BitCountCommand>): this;
70
- /**
71
- * @see https://redis.io/commands/bitop
72
- */
73
- bitop(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): this;
74
- bitop(op: "not", destinationKey: string, sourceKey: string): this;
75
- /**
76
- * @see https://redis.io/commands/bitpos
77
- */
78
- bitpos(...args: CommandArgs<typeof BitPosCommand>): this;
79
- /**
80
- * @see https://redis.io/commands/dbsize
81
- */
82
- dbsize(): this;
83
- /**
84
- * @see https://redis.io/commands/decr
85
- */
86
- decr(...args: CommandArgs<typeof DecrCommand>): this;
87
- /**
88
- * @see https://redis.io/commands/decrby
89
- */
90
- decrby(...args: CommandArgs<typeof DecrByCommand>): this;
91
- /**
92
- * @see https://redis.io/commands/del
93
- */
94
- del(...args: CommandArgs<typeof DelCommand>): this;
95
- /**
96
- * @see https://redis.io/commands/echo
97
- */
98
- echo(...args: CommandArgs<typeof EchoCommand>): this;
99
- /**
100
- * @see https://redis.io/commands/exists
101
- */
102
- exists(...args: CommandArgs<typeof ExistsCommand>): this;
103
- /**
104
- * @see https://redis.io/commands/expire
105
- */
106
- expire(...args: CommandArgs<typeof ExpireCommand>): this;
107
- /**
108
- * @see https://redis.io/commands/expireat
109
- */
110
- expireat(...args: CommandArgs<typeof ExpireAtCommand>): this;
111
- /**
112
- * @see https://redis.io/commands/flushall
113
- */
114
- flushall(...args: CommandArgs<typeof FlushAllCommand>): this;
115
- /**
116
- * @see https://redis.io/commands/flushdb
117
- */
118
- flushdb(...args: CommandArgs<typeof FlushDBCommand>): this;
119
- /**
120
- * @see https://redis.io/commands/get
121
- */
122
- get<TData>(...args: CommandArgs<typeof GetCommand>): this;
123
- /**
124
- * @see https://redis.io/commands/getbit
125
- */
126
- getbit(...args: CommandArgs<typeof GetBitCommand>): this;
127
- /**
128
- * @see https://redis.io/commands/getrange
129
- */
130
- getrange(...args: CommandArgs<typeof GetRangeCommand>): this;
131
- /**
132
- * @see https://redis.io/commands/getset
133
- */
134
- getset<TData>(key: string, value: TData): this;
135
- /**
136
- * @see https://redis.io/commands/hdel
137
- */
138
- hdel(...args: CommandArgs<typeof HDelCommand>): this;
139
- /**
140
- * @see https://redis.io/commands/hexists
141
- */
142
- hexists(...args: CommandArgs<typeof HExistsCommand>): this;
143
- /**
144
- * @see https://redis.io/commands/hget
145
- */
146
- hget<TData>(...args: CommandArgs<typeof HGetCommand>): this;
147
- /**
148
- * @see https://redis.io/commands/hgetall
149
- */
150
- hgetall<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>): this;
151
- /**
152
- * @see https://redis.io/commands/hincrby
153
- */
154
- hincrby(...args: CommandArgs<typeof HIncrByCommand>): this;
155
- /**
156
- * @see https://redis.io/commands/hincrbyfloat
157
- */
158
- hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>): this;
159
- /**
160
- * @see https://redis.io/commands/hkeys
161
- */
162
- hkeys(...args: CommandArgs<typeof HKeysCommand>): this;
163
- /**
164
- * @see https://redis.io/commands/hlen
165
- */
166
- hlen(...args: CommandArgs<typeof HLenCommand>): this;
167
- /**
168
- * @see https://redis.io/commands/hmget
169
- */
170
- hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>): this;
171
- /**
172
- * @see https://redis.io/commands/hmset
173
- */
174
- hmset<TData>(key: string, kv: {
175
- [field: string]: TData;
176
- }): this;
177
- /**
178
- * @see https://redis.io/commands/hscan
179
- */
180
- hscan(...args: CommandArgs<typeof HScanCommand>): this;
181
- /**
182
- * @see https://redis.io/commands/hset
183
- */
184
- hset<TData>(key: string, field: string, value: TData): this;
185
- /**
186
- * @see https://redis.io/commands/hsetnx
187
- */
188
- hsetnx<TData>(key: string, field: string, value: TData): this;
189
- /**
190
- * @see https://redis.io/commands/hstrlen
191
- */
192
- hstrlen(...args: CommandArgs<typeof HStrLenCommand>): this;
193
- /**
194
- * @see https://redis.io/commands/hvals
195
- */
196
- hvals(...args: CommandArgs<typeof HValsCommand>): this;
197
- /**
198
- * @see https://redis.io/commands/incr
199
- */
200
- incr(...args: CommandArgs<typeof IncrCommand>): this;
201
- /**
202
- * @see https://redis.io/commands/incrby
203
- */
204
- incrby(...args: CommandArgs<typeof IncrByCommand>): this;
205
- /**
206
- * @see https://redis.io/commands/incrbyfloat
207
- */
208
- incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>): this;
209
- /**
210
- * @see https://redis.io/commands/keys
211
- */
212
- keys(...args: CommandArgs<typeof KeysCommand>): this;
213
- /**
214
- * @see https://redis.io/commands/lindex
215
- */
216
- lindex(...args: CommandArgs<typeof LIndexCommand>): this;
217
- /**
218
- * @see https://redis.io/commands/linsert
219
- */
220
- linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData): this;
221
- /**
222
- * @see https://redis.io/commands/llen
223
- */
224
- llen(...args: CommandArgs<typeof LLenCommand>): this;
225
- /**
226
- * @see https://redis.io/commands/lpop
227
- */
228
- lpop<TData>(...args: CommandArgs<typeof LPopCommand>): this;
229
- /**
230
- * @see https://redis.io/commands/lpush
231
- */
232
- lpush<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
233
- /**
234
- * @see https://redis.io/commands/lpushx
235
- */
236
- lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
237
- /**
238
- * @see https://redis.io/commands/lrange
239
- */
240
- lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>): this;
241
- /**
242
- * @see https://redis.io/commands/lrem
243
- */
244
- lrem<TData>(key: string, count: number, value: TData): this;
245
- /**
246
- * @see https://redis.io/commands/lset
247
- */
248
- lset<TData>(key: string, value: TData, index: number): this;
249
- /**
250
- * @see https://redis.io/commands/ltrim
251
- */
252
- ltrim(...args: CommandArgs<typeof LTrimCommand>): this;
253
- /**
254
- * @see https://redis.io/commands/mget
255
- */
256
- mget<TData extends [unknown, ...unknown[]]>(...args: CommandArgs<typeof MGetCommand>): this;
257
- /**
258
- * @see https://redis.io/commands/mset
259
- */
260
- mset<TData>(kv: {
261
- [key: string]: TData;
262
- }): this;
263
- /**
264
- * @see https://redis.io/commands/msetnx
265
- */
266
- msetnx<TData>(kv: {
267
- [key: string]: TData;
268
- }): this;
269
- /**
270
- * @see https://redis.io/commands/persist
271
- */
272
- persist(...args: CommandArgs<typeof PersistCommand>): this;
273
- /**
274
- * @see https://redis.io/commands/pexpire
275
- */
276
- pexpire(...args: CommandArgs<typeof PExpireCommand>): this;
277
- /**
278
- * @see https://redis.io/commands/pexpireat
279
- */
280
- pexpireat(...args: CommandArgs<typeof PExpireAtCommand>): this;
281
- /**
282
- * @see https://redis.io/commands/ping
283
- */
284
- ping(...args: CommandArgs<typeof PingCommand>): this;
285
- /**
286
- * @see https://redis.io/commands/psetex
287
- */
288
- psetex<TData>(key: string, ttl: number, value: TData): this;
289
- /**
290
- * @see https://redis.io/commands/pttl
291
- */
292
- pttl(...args: CommandArgs<typeof PTtlCommand>): this;
293
- /**
294
- * @see https://redis.io/commands/randomkey
295
- */
296
- randomkey(): this;
297
- /**
298
- * @see https://redis.io/commands/rename
299
- */
300
- rename(...args: CommandArgs<typeof RenameCommand>): this;
301
- /**
302
- * @see https://redis.io/commands/renamenx
303
- */
304
- renamenx(...args: CommandArgs<typeof RenameNXCommand>): this;
305
- /**
306
- * @see https://redis.io/commands/rpop
307
- */
308
- rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>): this;
309
- /**
310
- * @see https://redis.io/commands/rpush
311
- */
312
- rpush<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
313
- /**
314
- * @see https://redis.io/commands/rpushx
315
- */
316
- rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
317
- /**
318
- * @see https://redis.io/commands/sadd
319
- */
320
- sadd<TData>(key: string, ...members: NonEmptyArray<TData>): this;
321
- /**
322
- * @see https://redis.io/commands/scan
323
- */
324
- scan(...args: CommandArgs<typeof ScanCommand>): this;
325
- /**
326
- * @see https://redis.io/commands/scard
327
- */
328
- scard(...args: CommandArgs<typeof SCardCommand>): this;
329
- /**
330
- * @see https://redis.io/commands/sdiff
331
- */
332
- sdiff(...args: CommandArgs<typeof SDiffCommand>): this;
333
- /**
334
- * @see https://redis.io/commands/sdiffstore
335
- */
336
- sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>): this;
337
- /**
338
- * @see https://redis.io/commands/set
339
- */
340
- set<TData>(key: string, value: TData, opts?: SetCommandOptions): this;
341
- /**
342
- * @see https://redis.io/commands/setbit
343
- */
344
- setbit(...args: CommandArgs<typeof SetBitCommand>): this;
345
- /**
346
- * @see https://redis.io/commands/setex
347
- */
348
- setex<TData>(key: string, ttl: number, value: TData): this;
349
- /**
350
- * @see https://redis.io/commands/setnx
351
- */
352
- setnx<TData>(key: string, value: TData): this;
353
- /**
354
- * @see https://redis.io/commands/setrange
355
- */
356
- setrange(...args: CommandArgs<typeof SetRangeCommand>): this;
357
- /**
358
- * @see https://redis.io/commands/sinter
359
- */
360
- sinter(...args: CommandArgs<typeof SInterCommand>): this;
361
- /**
362
- * @see https://redis.io/commands/sinterstore
363
- */
364
- sinterstore(...args: CommandArgs<typeof SInterStoreCommand>): this;
365
- /**
366
- * @see https://redis.io/commands/sismember
367
- */
368
- sismember<TData>(key: string, member: TData): this;
369
- /**
370
- * @see https://redis.io/commands/smembers
371
- */
372
- smembers(...args: CommandArgs<typeof SMembersCommand>): this;
373
- /**
374
- * @see https://redis.io/commands/smove
375
- */
376
- smove<TData>(source: string, destination: string, member: TData): this;
377
- /**
378
- * @see https://redis.io/commands/spop
379
- */
380
- spop<TData>(...args: CommandArgs<typeof SPopCommand>): this;
381
- /**
382
- * @see https://redis.io/commands/srandmember
383
- */
384
- srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>): this;
385
- /**
386
- * @see https://redis.io/commands/srem
387
- */
388
- srem<TData>(key: string, ...members: NonEmptyArray<TData>): this;
389
- /**
390
- * @see https://redis.io/commands/sscan
391
- */
392
- sscan(...args: CommandArgs<typeof SScanCommand>): this;
393
- /**
394
- * @see https://redis.io/commands/strlen
395
- */
396
- strlen(...args: CommandArgs<typeof StrLenCommand>): this;
397
- /**
398
- * @see https://redis.io/commands/sunion
399
- */
400
- sunion(...args: CommandArgs<typeof SUnionCommand>): this;
401
- /**
402
- * @see https://redis.io/commands/sunionstore
403
- */
404
- sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>): this;
405
- /**
406
- * @see https://redis.io/commands/time
407
- */
408
- time(): this;
409
- /**
410
- * @see https://redis.io/commands/touch
411
- */
412
- touch(...args: CommandArgs<typeof TouchCommand>): this;
413
- /**
414
- * @see https://redis.io/commands/ttl
415
- */
416
- ttl(...args: CommandArgs<typeof TtlCommand>): this;
417
- /**
418
- * @see https://redis.io/commands/type
419
- */
420
- type(...args: CommandArgs<typeof TypeCommand>): this;
421
- /**
422
- * @see https://redis.io/commands/unlink
423
- */
424
- unlink(...args: CommandArgs<typeof UnlinkCommand>): this;
425
- /**
426
- * @see https://redis.io/commands/zadd
427
- */
428
- zadd<TData>(key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]): this;
429
- zadd<TData>(key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]): this;
430
- /**
431
- * @see https://redis.io/commands/zcard
432
- */
433
- zcard(...args: CommandArgs<typeof ZCardCommand>): this;
434
- /**
435
- * @see https://redis.io/commands/zcount
436
- */
437
- zcount(...args: CommandArgs<typeof ZCountCommand>): this;
438
- /**
439
- * @see https://redis.io/commands/zincrby
440
- */
441
- zincrby<TData>(key: string, increment: number, member: TData): this;
442
- /**
443
- * @see https://redis.io/commands/zinterstore
444
- */
445
- zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>): this;
446
- /**
447
- * @see https://redis.io/commands/zlexcount
448
- */
449
- zlexcount(...args: CommandArgs<typeof ZLexCountCommand>): this;
450
- /**
451
- * @see https://redis.io/commands/zpopmax
452
- */
453
- zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>): this;
454
- /**
455
- * @see https://redis.io/commands/zpopmin
456
- */
457
- zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>): this;
458
- /**
459
- * @see https://redis.io/commands/zrange
460
- */
461
- zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>): this;
462
- /**
463
- * @see https://redis.io/commands/zrank
464
- */
465
- zrank<TData>(key: string, member: TData): this;
466
- /**
467
- * @see https://redis.io/commands/zrem
468
- */
469
- zrem<TData>(key: string, ...members: NonEmptyArray<TData>): this;
470
- /**
471
- * @see https://redis.io/commands/zremrangebylex
472
- */
473
- zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>): this;
474
- /**
475
- * @see https://redis.io/commands/zremrangebyrank
476
- */
477
- zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>): this;
478
- /**
479
- * @see https://redis.io/commands/zremrangebyscore
480
- */
481
- zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>): this;
482
- /**
483
- * @see https://redis.io/commands/zrevrank
484
- */
485
- zrevrank<TData>(key: string, member: TData): this;
486
- /**
487
- * @see https://redis.io/commands/zscan
488
- */
489
- zscan(...args: CommandArgs<typeof ZScanCommand>): this;
490
- /**
491
- * @see https://redis.io/commands/zscore
492
- */
493
- zscore<TData>(key: string, member: TData): this;
494
- /**
495
- * @see https://redis.io/commands/zunionstore
496
- */
497
- zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): this;
498
- }
499
-
500
- /**
501
- * Connection credentials for upstash redis.
502
- * Get them from https://console.upstash.com/redis/<uuid>
503
- */
504
- declare type RedisConfig = {
505
- /**
506
- * UPSTASH_REDIS_REST_URL
507
- */
508
- url: string;
509
- /**
510
- * UPSTASH_REDIS_REST_TOKEN
511
- */
512
- token: string;
513
- requestOptions?: {
514
- /**
515
- * **fastly only**
516
- *
517
- * A Request can be forwarded to any backend defined on your service. Backends
518
- * can be created via the Fastly CLI, API, or web interface, and are
519
- * referenced by name.
520
- */
521
- backend?: string;
522
- };
523
- };
524
- /**
525
- * Serverless redis client for upstash.
526
- */
527
- declare class Redis {
528
- private readonly client;
529
- /**
530
- * Create a new redis client
531
- *
532
- * @example
533
- * ```typescript
534
- * const redis = new Redis({
535
- * url: "<UPSTASH_REDIS_REST_URL>",
536
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
537
- * });
538
- * ```
539
- */
540
- constructor(config: RedisConfig);
541
- /**
542
- * Create a new Upstash Redis instance from environment variables.
543
- *
544
- * Use this to automatically load connection secrets from your environment
545
- * variables. For instance when using the Vercel integration.
546
- *
547
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
548
- * your environment.
549
- *
550
- * If you are using Cloudflare, please use `fromCloudflareEnv()` instead.
551
- */
552
- static fromEnv(): Redis;
553
- /**
554
- * Create a new Upstash Redis instance from environment variables on cloudflare.
555
- *
556
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
557
- * the global namespace
558
- */
559
- static fromCloudflareEnv(): Redis;
560
- /**
561
- * Create a new pipeline that allows you to send requests in bulk.
562
- *
563
- * @see {@link Pipeline}
564
- */
565
- pipeline(): Pipeline;
566
- /**
567
- * @see https://redis.io/commands/append
568
- */
569
- append(...args: CommandArgs<typeof AppendCommand>): Promise<number>;
570
- /**
571
- * @see https://redis.io/commands/bitcount
572
- */
573
- bitcount(...args: CommandArgs<typeof BitCountCommand>): Promise<number>;
574
- /**
575
- * @see https://redis.io/commands/bitop
576
- */
577
- bitop(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
578
- bitop(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
579
- /**
580
- * @see https://redis.io/commands/bitpos
581
- */
582
- bitpos(...args: CommandArgs<typeof BitPosCommand>): Promise<number>;
583
- /**
584
- * @see https://redis.io/commands/dbsize
585
- */
586
- dbsize(): Promise<number>;
587
- /**
588
- * @see https://redis.io/commands/decr
589
- */
590
- decr(...args: CommandArgs<typeof DecrCommand>): Promise<number>;
591
- /**
592
- * @see https://redis.io/commands/decrby
593
- */
594
- decrby(...args: CommandArgs<typeof DecrByCommand>): Promise<number>;
595
- /**
596
- * @see https://redis.io/commands/del
597
- */
598
- del(...args: CommandArgs<typeof DelCommand>): Promise<number>;
599
- /**
600
- * @see https://redis.io/commands/echo
601
- */
602
- echo(...args: CommandArgs<typeof EchoCommand>): Promise<string>;
603
- /**
604
- * @see https://redis.io/commands/exists
605
- */
606
- exists(...args: CommandArgs<typeof ExistsCommand>): Promise<0 | 1>;
607
- /**
608
- * @see https://redis.io/commands/expire
609
- */
610
- expire(...args: CommandArgs<typeof ExpireCommand>): Promise<0 | 1>;
611
- /**
612
- * @see https://redis.io/commands/expireat
613
- */
614
- expireat(...args: CommandArgs<typeof ExpireAtCommand>): Promise<0 | 1>;
615
- /**
616
- * @see https://redis.io/commands/flushall
617
- */
618
- flushall(...args: CommandArgs<typeof FlushAllCommand>): Promise<"OK">;
619
- /**
620
- * @see https://redis.io/commands/flushdb
621
- */
622
- flushdb(...args: CommandArgs<typeof FlushDBCommand>): Promise<"OK">;
623
- /**
624
- * @see https://redis.io/commands/get
625
- */
626
- get<TData>(...args: CommandArgs<typeof GetCommand>): Promise<TData | null>;
627
- /**
628
- * @see https://redis.io/commands/getbit
629
- */
630
- getbit(...args: CommandArgs<typeof GetBitCommand>): Promise<0 | 1>;
631
- /**
632
- * @see https://redis.io/commands/getrange
633
- */
634
- getrange(...args: CommandArgs<typeof GetRangeCommand>): Promise<string>;
635
- /**
636
- * @see https://redis.io/commands/getset
637
- */
638
- getset<TData>(key: string, value: TData): Promise<TData | null>;
639
- /**
640
- * @see https://redis.io/commands/hdel
641
- */
642
- hdel(...args: CommandArgs<typeof HDelCommand>): Promise<0 | 1>;
643
- /**
644
- * @see https://redis.io/commands/hexists
645
- */
646
- hexists(...args: CommandArgs<typeof HExistsCommand>): Promise<number>;
647
- /**
648
- * @see https://redis.io/commands/hget
649
- */
650
- hget<TData>(...args: CommandArgs<typeof HGetCommand>): Promise<TData | null>;
651
- /**
652
- * @see https://redis.io/commands/hgetall
653
- */
654
- hgetall<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>): Promise<TData | null>;
655
- /**
656
- * @see https://redis.io/commands/hincrby
657
- */
658
- hincrby(...args: CommandArgs<typeof HIncrByCommand>): Promise<number>;
659
- /**
660
- * @see https://redis.io/commands/hincrbyfloat
661
- */
662
- hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>): Promise<number>;
663
- /**
664
- * @see https://redis.io/commands/hkeys
665
- */
666
- hkeys(...args: CommandArgs<typeof HKeysCommand>): Promise<string[]>;
667
- /**
668
- * @see https://redis.io/commands/hlen
669
- */
670
- hlen(...args: CommandArgs<typeof HLenCommand>): Promise<number>;
671
- /**
672
- * @see https://redis.io/commands/hmget
673
- */
674
- hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>): Promise<TData | null>;
675
- /**
676
- * @see https://redis.io/commands/hmset
677
- */
678
- hmset<TData>(key: string, kv: {
679
- [field: string]: TData;
680
- }): Promise<number>;
681
- /**
682
- * @see https://redis.io/commands/hscan
683
- */
684
- hscan(...args: CommandArgs<typeof HScanCommand>): Promise<[number, (string | number)[]]>;
685
- /**
686
- * @see https://redis.io/commands/hset
687
- */
688
- hset<TData>(key: string, field: string, value: TData): Promise<number>;
689
- /**
690
- * @see https://redis.io/commands/hsetnx
691
- */
692
- hsetnx<TData>(key: string, field: string, value: TData): Promise<0 | 1>;
693
- /**
694
- * @see https://redis.io/commands/hstrlen
695
- */
696
- hstrlen(...args: CommandArgs<typeof HStrLenCommand>): Promise<number>;
697
- /**
698
- * @see https://redis.io/commands/hvals
699
- */
700
- hvals(...args: CommandArgs<typeof HValsCommand>): Promise<unknown[]>;
701
- /**
702
- * @see https://redis.io/commands/incr
703
- */
704
- incr(...args: CommandArgs<typeof IncrCommand>): Promise<number>;
705
- /**
706
- * @see https://redis.io/commands/incrby
707
- */
708
- incrby(...args: CommandArgs<typeof IncrByCommand>): Promise<number>;
709
- /**
710
- * @see https://redis.io/commands/incrbyfloat
711
- */
712
- incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>): Promise<number>;
713
- /**
714
- * @see https://redis.io/commands/keys
715
- */
716
- keys(...args: CommandArgs<typeof KeysCommand>): Promise<string[]>;
717
- /**
718
- * @see https://redis.io/commands/lindex
719
- */
720
- lindex(...args: CommandArgs<typeof LIndexCommand>): Promise<string | null>;
721
- /**
722
- * @see https://redis.io/commands/linsert
723
- */
724
- linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData): Promise<number>;
725
- /**
726
- * @see https://redis.io/commands/llen
727
- */
728
- llen(...args: CommandArgs<typeof LLenCommand>): Promise<number>;
729
- /**
730
- * @see https://redis.io/commands/lpop
731
- */
732
- lpop<TData>(...args: CommandArgs<typeof LPopCommand>): Promise<TData | null>;
733
- /**
734
- * @see https://redis.io/commands/lpush
735
- */
736
- lpush<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
737
- /**
738
- * @see https://redis.io/commands/lpushx
739
- */
740
- lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
741
- /**
742
- * @see https://redis.io/commands/lrange
743
- */
744
- lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>): Promise<TResult[]>;
745
- /**
746
- * @see https://redis.io/commands/lrem
747
- */
748
- lrem<TData>(key: string, count: number, value: TData): Promise<number>;
749
- /**
750
- * @see https://redis.io/commands/lset
751
- */
752
- lset<TData>(key: string, value: TData, index: number): Promise<"OK">;
753
- /**
754
- * @see https://redis.io/commands/ltrim
755
- */
756
- ltrim(...args: CommandArgs<typeof LTrimCommand>): Promise<"OK">;
757
- /**
758
- * @see https://redis.io/commands/mget
759
- */
760
- mget<TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>): Promise<TData>;
761
- /**
762
- * @see https://redis.io/commands/mset
763
- */
764
- mset<TData>(kv: {
765
- [key: string]: TData;
766
- }): Promise<"OK">;
767
- /**
768
- * @see https://redis.io/commands/msetnx
769
- */
770
- msetnx<TData>(kv: {
771
- [key: string]: TData;
772
- }): Promise<number>;
773
- /**
774
- * @see https://redis.io/commands/persist
775
- */
776
- persist(...args: CommandArgs<typeof PersistCommand>): Promise<0 | 1>;
777
- /**
778
- * @see https://redis.io/commands/pexpire
779
- */
780
- pexpire(...args: CommandArgs<typeof PExpireCommand>): Promise<0 | 1>;
781
- /**
782
- * @see https://redis.io/commands/pexpireat
783
- */
784
- pexpireat(...args: CommandArgs<typeof PExpireAtCommand>): Promise<0 | 1>;
785
- /**
786
- * @see https://redis.io/commands/ping
787
- */
788
- ping(...args: CommandArgs<typeof PingCommand>): Promise<string>;
789
- /**
790
- * @see https://redis.io/commands/psetex
791
- */
792
- psetex<TData>(key: string, ttl: number, value: TData): Promise<string>;
793
- /**
794
- * @see https://redis.io/commands/pttl
795
- */
796
- pttl(...args: CommandArgs<typeof PTtlCommand>): Promise<number>;
797
- /**
798
- * @see https://redis.io/commands/randomkey
799
- */
800
- randomkey(): Promise<string | null>;
801
- /**
802
- * @see https://redis.io/commands/rename
803
- */
804
- rename(...args: CommandArgs<typeof RenameCommand>): Promise<"OK">;
805
- /**
806
- * @see https://redis.io/commands/renamenx
807
- */
808
- renamenx(...args: CommandArgs<typeof RenameNXCommand>): Promise<0 | 1>;
809
- /**
810
- * @see https://redis.io/commands/rpop
811
- */
812
- rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>): Promise<TData | null>;
813
- /**
814
- * @see https://redis.io/commands/rpush
815
- */
816
- rpush<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
817
- /**
818
- * @see https://redis.io/commands/rpushx
819
- */
820
- rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
821
- /**
822
- * @see https://redis.io/commands/sadd
823
- */
824
- sadd<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
825
- /**
826
- * @see https://redis.io/commands/scan
827
- */
828
- scan(...args: CommandArgs<typeof ScanCommand>): Promise<[number, string[]]>;
829
- /**
830
- * @see https://redis.io/commands/scard
831
- */
832
- scard(...args: CommandArgs<typeof SCardCommand>): Promise<number>;
833
- /**
834
- * @see https://redis.io/commands/sdiff
835
- */
836
- sdiff(...args: CommandArgs<typeof SDiffCommand>): Promise<unknown[]>;
837
- /**
838
- * @see https://redis.io/commands/sdiffstore
839
- */
840
- sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>): Promise<number>;
841
- /**
842
- * @see https://redis.io/commands/set
843
- */
844
- set<TData>(key: string, value: TData, opts?: SetCommandOptions): Promise<TData>;
845
- /**
846
- * @see https://redis.io/commands/setbit
847
- */
848
- setbit(...args: CommandArgs<typeof SetBitCommand>): Promise<0 | 1>;
849
- /**
850
- * @see https://redis.io/commands/setex
851
- */
852
- setex<TData>(key: string, ttl: number, value: TData): Promise<"OK">;
853
- /**
854
- * @see https://redis.io/commands/setnx
855
- */
856
- setnx<TData>(key: string, value: TData): Promise<number>;
857
- /**
858
- * @see https://redis.io/commands/setrange
859
- */
860
- setrange(...args: CommandArgs<typeof SetRangeCommand>): Promise<number>;
861
- /**
862
- * @see https://redis.io/commands/sinter
863
- */
864
- sinter(...args: CommandArgs<typeof SInterCommand>): Promise<string[]>;
865
- /**
866
- * @see https://redis.io/commands/sinterstore
867
- */
868
- sinterstore(...args: CommandArgs<typeof SInterStoreCommand>): Promise<string[]>;
869
- /**
870
- * @see https://redis.io/commands/sismember
871
- */
872
- sismember<TData>(key: string, member: TData): Promise<0 | 1>;
873
- /**
874
- * @see https://redis.io/commands/smembers
875
- */
876
- smembers(...args: CommandArgs<typeof SMembersCommand>): Promise<string[]>;
877
- /**
878
- * @see https://redis.io/commands/smove
879
- */
880
- smove<TData>(source: string, destination: string, member: TData): Promise<0 | 1>;
881
- /**
882
- * @see https://redis.io/commands/spop
883
- */
884
- spop<TData>(...args: CommandArgs<typeof SPopCommand>): Promise<TData | null>;
885
- /**
886
- * @see https://redis.io/commands/srandmember
887
- */
888
- srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>): Promise<TData | null>;
889
- /**
890
- * @see https://redis.io/commands/srem
891
- */
892
- srem<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
893
- /**
894
- * @see https://redis.io/commands/sscan
895
- */
896
- sscan(...args: CommandArgs<typeof SScanCommand>): Promise<[number, (string | number)[]]>;
897
- /**
898
- * @see https://redis.io/commands/strlen
899
- */
900
- strlen(...args: CommandArgs<typeof StrLenCommand>): Promise<number>;
901
- /**
902
- * @see https://redis.io/commands/sunion
903
- */
904
- sunion(...args: CommandArgs<typeof SUnionCommand>): Promise<unknown[]>;
905
- /**
906
- * @see https://redis.io/commands/sunionstore
907
- */
908
- sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>): Promise<number>;
909
- /**
910
- * @see https://redis.io/commands/time
911
- */
912
- time(): Promise<[number, number]>;
913
- /**
914
- * @see https://redis.io/commands/touch
915
- */
916
- touch(...args: CommandArgs<typeof TouchCommand>): Promise<number>;
917
- /**
918
- * @see https://redis.io/commands/ttl
919
- */
920
- ttl(...args: CommandArgs<typeof TtlCommand>): Promise<number>;
921
- /**
922
- * @see https://redis.io/commands/type
923
- */
924
- type(...args: CommandArgs<typeof TypeCommand>): Promise<Type>;
925
- /**
926
- * @see https://redis.io/commands/unlink
927
- */
928
- unlink(...args: CommandArgs<typeof UnlinkCommand>): Promise<number>;
929
- /**
930
- * @see https://redis.io/commands/zadd
931
- */
932
- zadd<TData>(key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]): Promise<number | null>;
933
- zadd<TData>(key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]): Promise<number | null>;
934
- /**
935
- * @see https://redis.io/commands/zcard
936
- */
937
- zcard(...args: CommandArgs<typeof ZCardCommand>): Promise<number>;
938
- /**
939
- * @see https://redis.io/commands/zcount
940
- */
941
- zcount(...args: CommandArgs<typeof ZCountCommand>): Promise<number>;
942
- /**
943
- * @see https://redis.io/commands/zincrby
944
- */
945
- zincrby<TData>(key: string, increment: number, member: TData): Promise<number>;
946
- /**
947
- * @see https://redis.io/commands/zinterstore
948
- */
949
- zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>): Promise<number>;
950
- /**
951
- * @see https://redis.io/commands/zlexcount
952
- */
953
- zlexcount(...args: CommandArgs<typeof ZLexCountCommand>): Promise<number>;
954
- /**
955
- * @see https://redis.io/commands/zpopmax
956
- */
957
- zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>): Promise<TData[]>;
958
- /**
959
- * @see https://redis.io/commands/zpopmin
960
- */
961
- zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>): Promise<TData[]>;
962
- /**
963
- * @see https://redis.io/commands/zrange
964
- */
965
- zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>): Promise<TData>;
966
- /**
967
- * @see https://redis.io/commands/zrank
968
- */
969
- zrank<TData>(key: string, member: TData): Promise<number | null>;
970
- /**
971
- * @see https://redis.io/commands/zrem
972
- */
973
- zrem<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
974
- /**
975
- * @see https://redis.io/commands/zremrangebylex
976
- */
977
- zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>): Promise<number>;
978
- /**
979
- * @see https://redis.io/commands/zremrangebyrank
980
- */
981
- zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>): Promise<number>;
982
- /**
983
- * @see https://redis.io/commands/zremrangebyscore
984
- */
985
- zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>): Promise<number>;
986
- /**
987
- * @see https://redis.io/commands/zrevrank
988
- */
989
- zrevrank<TData>(key: string, member: TData): Promise<number | null>;
990
- /**
991
- * @see https://redis.io/commands/zscan
992
- */
993
- zscan(...args: CommandArgs<typeof ZScanCommand>): Promise<[number, (string | number)[]]>;
994
- /**
995
- * @see https://redis.io/commands/zscore
996
- */
997
- zscore<TData>(key: string, member: TData): Promise<number | null>;
998
- /**
999
- * @see https://redis.io/commands/zunionstore
1000
- */
1001
- zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): Promise<number>;
1002
- }
1
+ export { Redis, RedisConfigNodejs } from './nodejs';
2
+ import './redis-dd052782';
3
+ import './zunionstore-dffa797d';
4
+ import './http';
1003
5
 
1004
6
  /**
1005
7
  * Result of a bad request to upstash
@@ -1008,4 +10,4 @@ declare class UpstashError extends Error {
1008
10
  constructor(message: string);
1009
11
  }
1010
12
 
1011
- export { Redis, RedisConfig, UpstashError };
13
+ export { UpstashError };