@upstash/redis 0.0.0-ci.babdc47f97e036e2863dfed16300cda2b97bf6ad-20240322001434 → 0.0.0-ci.bb93ac2803c2e927dc8bf1a1b3c5aa2a14034eb6-20240930061920

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 (622) hide show
  1. package/.env.example +2 -0
  2. package/.github/workflows/release.yml +53 -0
  3. package/.github/workflows/tests.yaml +609 -0
  4. package/.gitignore +175 -0
  5. package/.husky/commit-msg +1 -0
  6. package/.husky/pre-commit +2 -0
  7. package/.husky/pre-push +1 -0
  8. package/.prettierignore +1 -0
  9. package/.vscode/extensions.json +3 -0
  10. package/.vscode/settings.json +20 -0
  11. package/README.md +1 -2
  12. package/bun.lockb +0 -0
  13. package/commitlint.config.js +46 -0
  14. package/dist/LICENSE +21 -0
  15. package/dist/README.md +136 -0
  16. package/dist/chunk-TEVCO3ZO.mjs +3797 -0
  17. package/dist/cloudflare.d.mts +55 -0
  18. package/dist/cloudflare.d.ts +55 -0
  19. package/dist/cloudflare.js +3907 -0
  20. package/dist/cloudflare.mjs +91 -0
  21. package/dist/fastly.d.mts +48 -0
  22. package/dist/fastly.d.ts +48 -0
  23. package/dist/fastly.js +3880 -0
  24. package/dist/fastly.mjs +64 -0
  25. package/dist/nodejs.d.mts +73 -0
  26. package/dist/nodejs.d.ts +73 -0
  27. package/dist/nodejs.js +3926 -0
  28. package/dist/nodejs.mjs +110 -0
  29. package/dist/package.json +1 -0
  30. package/{zmscore-5d82e632.d.ts → dist/zmscore-BhX8yEQc.d.mts} +249 -184
  31. package/dist/zmscore-BhX8yEQc.d.ts +3486 -0
  32. package/eslint.config.mjs +102 -0
  33. package/examples/auto-pipeline/.eslintrc.json +3 -0
  34. package/examples/auto-pipeline/README.md +77 -0
  35. package/examples/auto-pipeline/app/components/DataComponent.tsx +49 -0
  36. package/examples/auto-pipeline/app/data/getEvents.ts +18 -0
  37. package/examples/auto-pipeline/app/data/getUsers.ts +18 -0
  38. package/examples/auto-pipeline/app/data/redis.ts +12 -0
  39. package/examples/auto-pipeline/app/favicon.ico +0 -0
  40. package/examples/auto-pipeline/app/globals.css +0 -0
  41. package/examples/auto-pipeline/app/layout.tsx +22 -0
  42. package/examples/auto-pipeline/app/page.tsx +15 -0
  43. package/examples/auto-pipeline/next.config.mjs +4 -0
  44. package/examples/auto-pipeline/package.json +27 -0
  45. package/examples/auto-pipeline/postcss.config.mjs +8 -0
  46. package/examples/auto-pipeline/public/next.svg +1 -0
  47. package/examples/auto-pipeline/public/vercel.svg +1 -0
  48. package/examples/auto-pipeline/tailwind.config.ts +20 -0
  49. package/examples/auto-pipeline/tsconfig.json +26 -0
  50. package/examples/aws-cdk-python/README.md +36 -0
  51. package/examples/aws-cdk-python/cdk.json +72 -0
  52. package/examples/aws-cdk-python/jest.config.js +8 -0
  53. package/examples/aws-cdk-python/lib/api/index.py +10 -0
  54. package/examples/aws-cdk-python/lib/api/requirements.txt +1 -0
  55. package/examples/aws-cdk-python/package-lock.json +4470 -0
  56. package/examples/aws-cdk-python/package.json +27 -0
  57. package/examples/aws-cdk-python/tsconfig.json +31 -0
  58. package/examples/aws-cdk-typescript/README.md +36 -0
  59. package/examples/aws-cdk-typescript/cdk.json +72 -0
  60. package/examples/aws-cdk-typescript/jest.config.js +8 -0
  61. package/examples/aws-cdk-typescript/package-lock.json +4548 -0
  62. package/examples/aws-cdk-typescript/package.json +28 -0
  63. package/examples/aws-cdk-typescript/tsconfig.json +31 -0
  64. package/examples/aws-lambda/README.md +39 -0
  65. package/examples/aws-lambda/index.js +11 -0
  66. package/examples/aws-lambda/package-lock.json +27 -0
  67. package/examples/aws-lambda/package.json +6 -0
  68. package/examples/aws-sam/README.md +34 -0
  69. package/examples/aws-sam/__init__.py +0 -0
  70. package/examples/aws-sam/events/event.json +62 -0
  71. package/examples/aws-sam/hello_world/__init__.py +0 -0
  72. package/examples/aws-sam/hello_world/app.py +10 -0
  73. package/examples/aws-sam/hello_world/requirements.txt +2 -0
  74. package/examples/aws-sam/samconfig.toml +34 -0
  75. package/examples/aws-sam/template.yaml +52 -0
  76. package/examples/aws-sam/tests/__init__.py +0 -0
  77. package/examples/aws-sam/tests/integration/__init__.py +0 -0
  78. package/examples/aws-sam/tests/integration/test_api_gateway.py +45 -0
  79. package/examples/aws-sam/tests/requirements.txt +3 -0
  80. package/examples/aws-sam/tests/unit/__init__.py +0 -0
  81. package/examples/aws-sam/tests/unit/test_handler.py +72 -0
  82. package/examples/azure-functions/.funcignore +10 -0
  83. package/examples/azure-functions/.vscode/extensions.json +5 -0
  84. package/examples/azure-functions/README.md +67 -0
  85. package/examples/azure-functions/host.json +15 -0
  86. package/examples/azure-functions/package-lock.json +1019 -0
  87. package/examples/azure-functions/package.json +24 -0
  88. package/examples/azure-functions/src/functions/CounterFunction.ts +19 -0
  89. package/examples/azure-functions/tsconfig.json +10 -0
  90. package/examples/cloudflare-workers/README.md +26 -0
  91. package/examples/cloudflare-workers/bun.lockb +0 -0
  92. package/examples/cloudflare-workers/ci.test.ts +18 -0
  93. package/examples/cloudflare-workers/index.js +11 -0
  94. package/examples/cloudflare-workers/package.json +17 -0
  95. package/examples/cloudflare-workers/wrangler.toml +11 -0
  96. package/examples/cloudflare-workers-with-typescript/README.md +26 -0
  97. package/examples/cloudflare-workers-with-typescript/ci.test.ts +17 -0
  98. package/examples/cloudflare-workers-with-typescript/package.json +17 -0
  99. package/examples/cloudflare-workers-with-typescript/src/index.ts +16 -0
  100. package/examples/cloudflare-workers-with-typescript/tsconfig.json +105 -0
  101. package/examples/cloudflare-workers-with-typescript/wrangler.toml +9 -0
  102. package/examples/deno/main.test.ts +16 -0
  103. package/examples/deno/main.ts +9 -0
  104. package/examples/fastapi/README.md +23 -0
  105. package/examples/fastapi/main.py +12 -0
  106. package/examples/fastapi/requirements.txt +2 -0
  107. package/examples/fastly/README.md +7 -0
  108. package/examples/fastly/fastly.toml +12 -0
  109. package/examples/fastly/package.json +23 -0
  110. package/examples/fastly/src/index.js +19 -0
  111. package/examples/fastly/webpack.config.js +28 -0
  112. package/examples/google-cloud-functions/README.md +37 -0
  113. package/examples/google-cloud-functions/index.js +12 -0
  114. package/examples/google-cloud-functions/package.json +7 -0
  115. package/examples/ion/.env.example +2 -0
  116. package/examples/ion/.eslintrc.json +3 -0
  117. package/examples/ion/README.md +49 -0
  118. package/examples/ion/app/favicon.ico +0 -0
  119. package/examples/ion/app/globals.css +33 -0
  120. package/examples/ion/app/layout.tsx +22 -0
  121. package/examples/ion/app/page.tsx +12 -0
  122. package/examples/ion/next.config.mjs +4 -0
  123. package/examples/ion/package-lock.json +6709 -0
  124. package/examples/ion/package.json +28 -0
  125. package/examples/ion/postcss.config.mjs +8 -0
  126. package/examples/ion/public/next.svg +1 -0
  127. package/examples/ion/public/vercel.svg +1 -0
  128. package/examples/ion/sst-env.d.ts +12 -0
  129. package/examples/ion/sst.config.ts +19 -0
  130. package/examples/ion/tailwind.config.ts +20 -0
  131. package/examples/ion/tsconfig.json +26 -0
  132. package/examples/nextjs-app-router/.env.example +2 -0
  133. package/examples/nextjs-app-router/.eslintrc.json +3 -0
  134. package/examples/nextjs-app-router/README.md +26 -0
  135. package/examples/nextjs-app-router/app/globals.css +3 -0
  136. package/examples/nextjs-app-router/app/layout.tsx +22 -0
  137. package/examples/nextjs-app-router/app/page.tsx +12 -0
  138. package/examples/nextjs-app-router/next.config.mjs +4 -0
  139. package/examples/nextjs-app-router/package.json +27 -0
  140. package/examples/nextjs-app-router/postcss.config.mjs +8 -0
  141. package/examples/nextjs-app-router/tailwind.config.ts +20 -0
  142. package/examples/nextjs-app-router/tsconfig.json +26 -0
  143. package/examples/nextjs-pages-router/.env.example +2 -0
  144. package/examples/nextjs-pages-router/.eslintrc.json +3 -0
  145. package/examples/nextjs-pages-router/README.md +26 -0
  146. package/examples/nextjs-pages-router/next.config.mjs +6 -0
  147. package/examples/nextjs-pages-router/package.json +27 -0
  148. package/examples/nextjs-pages-router/pages/_app.tsx +6 -0
  149. package/examples/nextjs-pages-router/pages/_document.tsx +13 -0
  150. package/examples/nextjs-pages-router/pages/api/hello.ts +13 -0
  151. package/examples/nextjs-pages-router/pages/index.tsx +19 -0
  152. package/examples/nextjs-pages-router/postcss.config.mjs +8 -0
  153. package/examples/nextjs-pages-router/styles/globals.css +3 -0
  154. package/examples/nextjs-pages-router/tailwind.config.ts +20 -0
  155. package/examples/nextjs-pages-router/tsconfig.json +21 -0
  156. package/examples/nodejs/.env.example +2 -0
  157. package/examples/nodejs/README.md +24 -0
  158. package/examples/nodejs/index.js +10 -0
  159. package/examples/nodejs/package.json +10 -0
  160. package/examples/serverless-framework/counter/.env.example +2 -0
  161. package/examples/serverless-framework/counter/README.md +38 -0
  162. package/examples/serverless-framework/counter/handler.js +12 -0
  163. package/examples/serverless-framework/counter/package-lock.json +27 -0
  164. package/examples/serverless-framework/counter/package.json +6 -0
  165. package/examples/serverless-framework/counter/serverless.yml +16 -0
  166. package/examples/sst-v2/.vscode/launch.json +15 -0
  167. package/examples/sst-v2/.vscode/settings.json +5 -0
  168. package/examples/sst-v2/README.md +62 -0
  169. package/examples/sst-v2/package.json +27 -0
  170. package/examples/sst-v2/packages/core/package.json +14 -0
  171. package/examples/sst-v2/packages/core/sst-env.d.ts +1 -0
  172. package/examples/sst-v2/packages/core/tsconfig.json +7 -0
  173. package/examples/sst-v2/packages/functions/package.json +15 -0
  174. package/examples/sst-v2/packages/functions/sst-env.d.ts +1 -0
  175. package/examples/sst-v2/packages/functions/tsconfig.json +11 -0
  176. package/examples/sst-v2/packages/web/README.md +40 -0
  177. package/examples/sst-v2/packages/web/next.config.mjs +6 -0
  178. package/examples/sst-v2/packages/web/package.json +23 -0
  179. package/examples/sst-v2/packages/web/pages/_app.tsx +6 -0
  180. package/examples/sst-v2/packages/web/pages/_document.tsx +13 -0
  181. package/examples/sst-v2/packages/web/pages/api/hello.ts +16 -0
  182. package/examples/sst-v2/packages/web/pages/index.tsx +114 -0
  183. package/examples/sst-v2/packages/web/public/favicon.ico +0 -0
  184. package/examples/sst-v2/packages/web/public/next.svg +1 -0
  185. package/examples/sst-v2/packages/web/public/vercel.svg +1 -0
  186. package/examples/sst-v2/packages/web/sst-env.d.ts +1 -0
  187. package/examples/sst-v2/packages/web/styles/Home.module.css +229 -0
  188. package/examples/sst-v2/packages/web/styles/globals.css +107 -0
  189. package/examples/sst-v2/packages/web/tsconfig.json +36 -0
  190. package/examples/sst-v2/pnpm-workspace.yaml +2 -0
  191. package/examples/sst-v2/sst.config.ts +14 -0
  192. package/examples/sst-v2/stacks/Default.ts +13 -0
  193. package/examples/sst-v2/tsconfig.json +8 -0
  194. package/examples/terraform/README.md +38 -0
  195. package/examples/terraform/counter/counter.js +11 -0
  196. package/examples/terraform/counter/package.json +6 -0
  197. package/examples/terraform/main.tf +166 -0
  198. package/examples/terraform/outputs.tf +17 -0
  199. package/examples/terraform/terraform.tf +18 -0
  200. package/examples/terraform/variables.tf +6 -0
  201. package/examples/vercel-functions-app-router/.env.example +2 -0
  202. package/examples/vercel-functions-app-router/.eslintrc.json +3 -0
  203. package/examples/vercel-functions-app-router/README.md +26 -0
  204. package/examples/vercel-functions-app-router/app/api/hello/route.ts +11 -0
  205. package/examples/vercel-functions-app-router/app/globals.css +3 -0
  206. package/examples/vercel-functions-app-router/app/layout.tsx +22 -0
  207. package/examples/vercel-functions-app-router/ci.test.ts +14 -0
  208. package/examples/vercel-functions-app-router/next.config.mjs +4 -0
  209. package/examples/vercel-functions-app-router/package.json +27 -0
  210. package/examples/vercel-functions-app-router/postcss.config.mjs +8 -0
  211. package/examples/vercel-functions-app-router/tailwind.config.ts +20 -0
  212. package/examples/vercel-functions-app-router/tsconfig.json +26 -0
  213. package/examples/vercel-functions-pages-router/.env.example +2 -0
  214. package/examples/vercel-functions-pages-router/.eslintrc.json +3 -0
  215. package/examples/vercel-functions-pages-router/README.md +26 -0
  216. package/examples/vercel-functions-pages-router/ci.test.ts +14 -0
  217. package/examples/vercel-functions-pages-router/next.config.mjs +6 -0
  218. package/examples/vercel-functions-pages-router/package.json +27 -0
  219. package/examples/vercel-functions-pages-router/pages/_app.tsx +6 -0
  220. package/examples/vercel-functions-pages-router/pages/_document.tsx +13 -0
  221. package/examples/vercel-functions-pages-router/pages/api/hello.ts +12 -0
  222. package/examples/vercel-functions-pages-router/postcss.config.mjs +8 -0
  223. package/examples/vercel-functions-pages-router/styles/globals.css +3 -0
  224. package/examples/vercel-functions-pages-router/tailwind.config.ts +20 -0
  225. package/examples/vercel-functions-pages-router/tsconfig.json +21 -0
  226. package/examples/vercel-python-runtime-django/.env.example +2 -0
  227. package/examples/vercel-python-runtime-django/README.md +34 -0
  228. package/examples/vercel-python-runtime-django/api/__init__.py +0 -0
  229. package/examples/vercel-python-runtime-django/api/asgi.py +16 -0
  230. package/examples/vercel-python-runtime-django/api/settings.py +121 -0
  231. package/examples/vercel-python-runtime-django/api/urls.py +22 -0
  232. package/examples/vercel-python-runtime-django/api/wsgi.py +16 -0
  233. package/examples/vercel-python-runtime-django/example/__init__.py +0 -0
  234. package/examples/vercel-python-runtime-django/example/admin.py +3 -0
  235. package/examples/vercel-python-runtime-django/example/apps.py +6 -0
  236. package/examples/vercel-python-runtime-django/example/urls.py +9 -0
  237. package/examples/vercel-python-runtime-django/example/views.py +18 -0
  238. package/examples/vercel-python-runtime-django/manage.py +22 -0
  239. package/examples/vercel-python-runtime-django/package.json +5 -0
  240. package/examples/vercel-python-runtime-django/requirements.txt +2 -0
  241. package/examples/vercel-python-runtime-django/vercel.json +8 -0
  242. package/examples/with-sentry/index.ts +36 -0
  243. package/examples/with-sentry/package.json +17 -0
  244. package/package.json +1 -1
  245. package/pkg/auto-pipeline.test.ts +321 -0
  246. package/pkg/auto-pipeline.ts +107 -0
  247. package/pkg/commands/append.test.ts +28 -0
  248. package/pkg/commands/append.ts +11 -0
  249. package/pkg/commands/bitcount.test.ts +37 -0
  250. package/pkg/commands/bitcount.ts +29 -0
  251. package/pkg/commands/bitfield.test.ts +51 -0
  252. package/pkg/commands/bitfield.ts +50 -0
  253. package/pkg/commands/bitop.test.ts +45 -0
  254. package/pkg/commands/bitop.ts +22 -0
  255. package/pkg/commands/bitpos.test.ts +47 -0
  256. package/pkg/commands/bitpos.ts +14 -0
  257. package/pkg/commands/command.test.ts +22 -0
  258. package/pkg/commands/command.ts +98 -0
  259. package/pkg/commands/copy.test.ts +65 -0
  260. package/pkg/commands/copy.ts +22 -0
  261. package/pkg/commands/dbsize.test.ts +18 -0
  262. package/pkg/commands/dbsize.ts +11 -0
  263. package/pkg/commands/decr.test.ts +23 -0
  264. package/pkg/commands/decr.ts +11 -0
  265. package/pkg/commands/decrby.test.ts +24 -0
  266. package/pkg/commands/decrby.ts +11 -0
  267. package/pkg/commands/del.test.ts +38 -0
  268. package/pkg/commands/del.ts +11 -0
  269. package/pkg/commands/echo.test.ts +11 -0
  270. package/pkg/commands/echo.ts +11 -0
  271. package/pkg/commands/eval.test.ts +30 -0
  272. package/pkg/commands/eval.ts +14 -0
  273. package/pkg/commands/evalsha.test.ts +19 -0
  274. package/pkg/commands/evalsha.ts +14 -0
  275. package/pkg/commands/exists.test.ts +38 -0
  276. package/pkg/commands/exists.ts +11 -0
  277. package/pkg/commands/expire.test.ts +119 -0
  278. package/pkg/commands/expire.ts +12 -0
  279. package/pkg/commands/expireat.test.ts +25 -0
  280. package/pkg/commands/expireat.ts +11 -0
  281. package/pkg/commands/flushall.test.ts +18 -0
  282. package/pkg/commands/flushall.ts +14 -0
  283. package/pkg/commands/flushdb.test.ts +17 -0
  284. package/pkg/commands/flushdb.ts +14 -0
  285. package/pkg/commands/geo_add.test.ts +202 -0
  286. package/pkg/commands/geo_add.ts +54 -0
  287. package/pkg/commands/geo_dist.test.ts +79 -0
  288. package/pkg/commands/geo_dist.ts +19 -0
  289. package/pkg/commands/geo_hash.test.ts +49 -0
  290. package/pkg/commands/geo_hash.ts +23 -0
  291. package/pkg/commands/geo_pos.test.ts +60 -0
  292. package/pkg/commands/geo_pos.ts +39 -0
  293. package/pkg/commands/geo_search.test.ts +197 -0
  294. package/pkg/commands/geo_search.ts +139 -0
  295. package/pkg/commands/geo_search_store.test.ts +153 -0
  296. package/pkg/commands/geo_search_store.ts +69 -0
  297. package/pkg/commands/get.test.ts +35 -0
  298. package/pkg/commands/get.ts +11 -0
  299. package/pkg/commands/getbit.test.ts +17 -0
  300. package/pkg/commands/getbit.ts +11 -0
  301. package/pkg/commands/getdel.test.ts +39 -0
  302. package/pkg/commands/getdel.ts +11 -0
  303. package/pkg/commands/getrange.test.ts +25 -0
  304. package/pkg/commands/getrange.ts +14 -0
  305. package/pkg/commands/getset.test.ts +33 -0
  306. package/pkg/commands/getset.ts +14 -0
  307. package/pkg/commands/hdel.test.ts +45 -0
  308. package/pkg/commands/hdel.ts +11 -0
  309. package/pkg/commands/hexists.test.ts +36 -0
  310. package/pkg/commands/hexists.ts +11 -0
  311. package/pkg/commands/hget.test.ts +52 -0
  312. package/pkg/commands/hget.ts +14 -0
  313. package/pkg/commands/hgetall.test.ts +45 -0
  314. package/pkg/commands/hgetall.ts +37 -0
  315. package/pkg/commands/hincrby.test.ts +28 -0
  316. package/pkg/commands/hincrby.ts +14 -0
  317. package/pkg/commands/hincrbyfloat.test.ts +28 -0
  318. package/pkg/commands/hincrbyfloat.ts +14 -0
  319. package/pkg/commands/hkeys.test.ts +23 -0
  320. package/pkg/commands/hkeys.ts +11 -0
  321. package/pkg/commands/hlen.test.ts +25 -0
  322. package/pkg/commands/hlen.ts +11 -0
  323. package/pkg/commands/hmget.test.ts +44 -0
  324. package/pkg/commands/hmget.ts +46 -0
  325. package/pkg/commands/hmset.test.ts +23 -0
  326. package/pkg/commands/hmset.ts +14 -0
  327. package/pkg/commands/hrandfield.test.ts +59 -0
  328. package/pkg/commands/hrandfield.ts +50 -0
  329. package/pkg/commands/hscan.test.ts +44 -0
  330. package/pkg/commands/hscan.ts +30 -0
  331. package/pkg/commands/hset.test.ts +21 -0
  332. package/pkg/commands/hset.ts +14 -0
  333. package/pkg/commands/hsetnx.test.ts +37 -0
  334. package/pkg/commands/hsetnx.ts +14 -0
  335. package/pkg/commands/hstrlen.test.ts +24 -0
  336. package/pkg/commands/hstrlen.ts +11 -0
  337. package/pkg/commands/hvals.test.ts +24 -0
  338. package/pkg/commands/hvals.ts +11 -0
  339. package/pkg/commands/incr.test.ts +24 -0
  340. package/pkg/commands/incr.ts +11 -0
  341. package/pkg/commands/incrby.test.ts +24 -0
  342. package/pkg/commands/incrby.ts +11 -0
  343. package/pkg/commands/incrbyfloat.test.ts +25 -0
  344. package/pkg/commands/incrbyfloat.ts +11 -0
  345. package/pkg/commands/json_arrappend.test.ts +40 -0
  346. package/pkg/commands/json_arrappend.ts +17 -0
  347. package/pkg/commands/json_arrindex.test.ts +54 -0
  348. package/pkg/commands/json_arrindex.ts +14 -0
  349. package/pkg/commands/json_arrinsert.test.ts +49 -0
  350. package/pkg/commands/json_arrinsert.ts +17 -0
  351. package/pkg/commands/json_arrlen.test.ts +31 -0
  352. package/pkg/commands/json_arrlen.ts +14 -0
  353. package/pkg/commands/json_arrpop.test.ts +30 -0
  354. package/pkg/commands/json_arrpop.ts +14 -0
  355. package/pkg/commands/json_arrtrim.test.ts +31 -0
  356. package/pkg/commands/json_arrtrim.ts +18 -0
  357. package/pkg/commands/json_clear.test.ts +35 -0
  358. package/pkg/commands/json_clear.ts +11 -0
  359. package/pkg/commands/json_del.test.ts +29 -0
  360. package/pkg/commands/json_del.ts +11 -0
  361. package/pkg/commands/json_forget.test.ts +29 -0
  362. package/pkg/commands/json_forget.ts +11 -0
  363. package/pkg/commands/json_get.test.ts +28 -0
  364. package/pkg/commands/json_get.ts +44 -0
  365. package/pkg/commands/json_mget.test.ts +43 -0
  366. package/pkg/commands/json_mget.ts +11 -0
  367. package/pkg/commands/json_mset.test.ts +50 -0
  368. package/pkg/commands/json_mset.ts +26 -0
  369. package/pkg/commands/json_numincrby.test.ts +28 -0
  370. package/pkg/commands/json_numincrby.ts +14 -0
  371. package/pkg/commands/json_nummultby.test.ts +28 -0
  372. package/pkg/commands/json_nummultby.ts +14 -0
  373. package/pkg/commands/json_objkeys.test.ts +32 -0
  374. package/pkg/commands/json_objkeys.ts +14 -0
  375. package/pkg/commands/json_objlen.test.ts +26 -0
  376. package/pkg/commands/json_objlen.ts +14 -0
  377. package/pkg/commands/json_resp.test.ts +31 -0
  378. package/pkg/commands/json_resp.ts +11 -0
  379. package/pkg/commands/json_set.test.ts +48 -0
  380. package/pkg/commands/json_set.ts +34 -0
  381. package/pkg/commands/json_strappend.test.ts +34 -0
  382. package/pkg/commands/json_strappend.ts +14 -0
  383. package/pkg/commands/json_strlen.test.ts +27 -0
  384. package/pkg/commands/json_strlen.ts +14 -0
  385. package/pkg/commands/json_toggle.test.ts +26 -0
  386. package/pkg/commands/json_toggle.ts +11 -0
  387. package/pkg/commands/json_type.test.ts +29 -0
  388. package/pkg/commands/json_type.ts +11 -0
  389. package/pkg/commands/keys.test.ts +18 -0
  390. package/pkg/commands/keys.ts +11 -0
  391. package/pkg/commands/lindex.test.ts +33 -0
  392. package/pkg/commands/lindex.ts +11 -0
  393. package/pkg/commands/linsert.test.ts +24 -0
  394. package/pkg/commands/linsert.ts +10 -0
  395. package/pkg/commands/llen.test.ts +27 -0
  396. package/pkg/commands/llen.ts +11 -0
  397. package/pkg/commands/lmove.test.ts +48 -0
  398. package/pkg/commands/lmove.ts +19 -0
  399. package/pkg/commands/lmpop.test.ts +86 -0
  400. package/pkg/commands/lmpop.ts +19 -0
  401. package/pkg/commands/lpop.test.ts +40 -0
  402. package/pkg/commands/lpop.ts +14 -0
  403. package/pkg/commands/lpos.test.ts +56 -0
  404. package/pkg/commands/lpos.ts +25 -0
  405. package/pkg/commands/lpush.test.ts +18 -0
  406. package/pkg/commands/lpush.ts +11 -0
  407. package/pkg/commands/lpushx.test.ts +30 -0
  408. package/pkg/commands/lpushx.ts +11 -0
  409. package/pkg/commands/lrange.test.ts +21 -0
  410. package/pkg/commands/lrange.ts +11 -0
  411. package/pkg/commands/lrem.test.ts +19 -0
  412. package/pkg/commands/lrem.ts +10 -0
  413. package/pkg/commands/lset.test.ts +43 -0
  414. package/pkg/commands/lset.ts +8 -0
  415. package/pkg/commands/ltrim.test.ts +30 -0
  416. package/pkg/commands/ltrim.ts +8 -0
  417. package/pkg/commands/mget.test.ts +44 -0
  418. package/pkg/commands/mget.ts +11 -0
  419. package/pkg/commands/mod.ts +168 -0
  420. package/pkg/commands/mset.test.ts +24 -0
  421. package/pkg/commands/mset.ts +11 -0
  422. package/pkg/commands/msetnx.test.ts +46 -0
  423. package/pkg/commands/msetnx.ts +11 -0
  424. package/pkg/commands/persist.test.ts +22 -0
  425. package/pkg/commands/persist.ts +11 -0
  426. package/pkg/commands/pexpire.test.ts +24 -0
  427. package/pkg/commands/pexpire.ts +11 -0
  428. package/pkg/commands/pexpireat.test.ts +31 -0
  429. package/pkg/commands/pexpireat.ts +11 -0
  430. package/pkg/commands/pfadd.test.ts +80 -0
  431. package/pkg/commands/pfadd.ts +11 -0
  432. package/pkg/commands/pfcount.test.ts +55 -0
  433. package/pkg/commands/pfcount.ts +11 -0
  434. package/pkg/commands/pfmerge.test.ts +67 -0
  435. package/pkg/commands/pfmerge.ts +11 -0
  436. package/pkg/commands/ping.test.ts +19 -0
  437. package/pkg/commands/ping.ts +14 -0
  438. package/pkg/commands/psetex.test.ts +23 -0
  439. package/pkg/commands/psetex.ts +14 -0
  440. package/pkg/commands/pttl.test.ts +18 -0
  441. package/pkg/commands/pttl.ts +11 -0
  442. package/pkg/commands/publish.test.ts +12 -0
  443. package/pkg/commands/publish.ts +11 -0
  444. package/pkg/commands/randomkey.test.ts +16 -0
  445. package/pkg/commands/randomkey.ts +11 -0
  446. package/pkg/commands/rename.test.ts +19 -0
  447. package/pkg/commands/rename.ts +11 -0
  448. package/pkg/commands/renamenx.test.ts +33 -0
  449. package/pkg/commands/renamenx.ts +11 -0
  450. package/pkg/commands/rpop.test.ts +40 -0
  451. package/pkg/commands/rpop.ts +17 -0
  452. package/pkg/commands/rpush.test.ts +17 -0
  453. package/pkg/commands/rpush.ts +11 -0
  454. package/pkg/commands/rpushx.test.ts +30 -0
  455. package/pkg/commands/rpushx.ts +11 -0
  456. package/pkg/commands/sadd.test.ts +22 -0
  457. package/pkg/commands/sadd.ts +14 -0
  458. package/pkg/commands/scan.test.ts +91 -0
  459. package/pkg/commands/scan.ts +33 -0
  460. package/pkg/commands/scard.test.ts +16 -0
  461. package/pkg/commands/scard.ts +10 -0
  462. package/pkg/commands/script_exists.test.ts +34 -0
  463. package/pkg/commands/script_exists.ts +14 -0
  464. package/pkg/commands/script_flush.ts +21 -0
  465. package/pkg/commands/script_load.test.ts +11 -0
  466. package/pkg/commands/script_load.ts +11 -0
  467. package/pkg/commands/sdiff.test.ts +20 -0
  468. package/pkg/commands/sdiff.ts +10 -0
  469. package/pkg/commands/sdiffstore.test.ts +22 -0
  470. package/pkg/commands/sdiffstore.ts +13 -0
  471. package/pkg/commands/set.test.ts +168 -0
  472. package/pkg/commands/set.ts +51 -0
  473. package/pkg/commands/setbit.test.ts +17 -0
  474. package/pkg/commands/setbit.ts +14 -0
  475. package/pkg/commands/setex.test.ts +22 -0
  476. package/pkg/commands/setex.ts +11 -0
  477. package/pkg/commands/setnx.test.ts +27 -0
  478. package/pkg/commands/setnx.ts +11 -0
  479. package/pkg/commands/setrange.test.ts +25 -0
  480. package/pkg/commands/setrange.ts +14 -0
  481. package/pkg/commands/sinter.test.ts +37 -0
  482. package/pkg/commands/sinter.ts +10 -0
  483. package/pkg/commands/sinterstore.test.ts +22 -0
  484. package/pkg/commands/sinterstore.ts +13 -0
  485. package/pkg/commands/sismember.test.ts +31 -0
  486. package/pkg/commands/sismember.ts +10 -0
  487. package/pkg/commands/smembers.test.ts +22 -0
  488. package/pkg/commands/smembers.ts +11 -0
  489. package/pkg/commands/smismember.test.ts +22 -0
  490. package/pkg/commands/smismember.ts +16 -0
  491. package/pkg/commands/smove.test.ts +18 -0
  492. package/pkg/commands/smove.ts +13 -0
  493. package/pkg/commands/spop.test.ts +36 -0
  494. package/pkg/commands/spop.ts +17 -0
  495. package/pkg/commands/srandmember.test.ts +31 -0
  496. package/pkg/commands/srandmember.ts +17 -0
  497. package/pkg/commands/srem.test.ts +19 -0
  498. package/pkg/commands/srem.ts +10 -0
  499. package/pkg/commands/sscan.test.ts +48 -0
  500. package/pkg/commands/sscan.ts +30 -0
  501. package/pkg/commands/strlen.test.ts +17 -0
  502. package/pkg/commands/strlen.ts +11 -0
  503. package/pkg/commands/sunion.test.ts +22 -0
  504. package/pkg/commands/sunion.ts +11 -0
  505. package/pkg/commands/sunionstore.test.ts +30 -0
  506. package/pkg/commands/sunionstore.ts +14 -0
  507. package/pkg/commands/time.test.ts +12 -0
  508. package/pkg/commands/time.ts +10 -0
  509. package/pkg/commands/touch.test.ts +21 -0
  510. package/pkg/commands/touch.ts +11 -0
  511. package/pkg/commands/ttl.test.ts +17 -0
  512. package/pkg/commands/ttl.ts +11 -0
  513. package/pkg/commands/type.test.ts +72 -0
  514. package/pkg/commands/type.ts +12 -0
  515. package/pkg/commands/types.ts +150 -0
  516. package/pkg/commands/unlink.test.ts +22 -0
  517. package/pkg/commands/unlink.ts +11 -0
  518. package/pkg/commands/xack.test.ts +53 -0
  519. package/pkg/commands/xack.ts +15 -0
  520. package/pkg/commands/xadd.test.ts +128 -0
  521. package/pkg/commands/xadd.ts +64 -0
  522. package/pkg/commands/xautoclaim.test.ts +105 -0
  523. package/pkg/commands/xautoclaim.ts +30 -0
  524. package/pkg/commands/xclaim.test.ts +70 -0
  525. package/pkg/commands/xclaim.ts +55 -0
  526. package/pkg/commands/xdel.test.ts +50 -0
  527. package/pkg/commands/xdel.ts +15 -0
  528. package/pkg/commands/xgroup.test.ts +202 -0
  529. package/pkg/commands/xgroup.ts +100 -0
  530. package/pkg/commands/xinfo.test.ts +82 -0
  531. package/pkg/commands/xinfo.ts +27 -0
  532. package/pkg/commands/xlen.test.ts +29 -0
  533. package/pkg/commands/xlen.ts +11 -0
  534. package/pkg/commands/xpending.test.ts +94 -0
  535. package/pkg/commands/xpending.ts +43 -0
  536. package/pkg/commands/xrange.test.ts +69 -0
  537. package/pkg/commands/xrange.ts +48 -0
  538. package/pkg/commands/xread.test.ts +117 -0
  539. package/pkg/commands/xread.ts +51 -0
  540. package/pkg/commands/xreadgroup.test.ts +166 -0
  541. package/pkg/commands/xreadgroup.ts +66 -0
  542. package/pkg/commands/xrevrange.test.ts +48 -0
  543. package/pkg/commands/xrevrange.ts +47 -0
  544. package/pkg/commands/xtrim.test.ts +65 -0
  545. package/pkg/commands/xtrim.ts +24 -0
  546. package/pkg/commands/zadd.test.ts +242 -0
  547. package/pkg/commands/zadd.ts +53 -0
  548. package/pkg/commands/zcard.test.ts +16 -0
  549. package/pkg/commands/zcard.ts +11 -0
  550. package/pkg/commands/zcount.test.ts +16 -0
  551. package/pkg/commands/zcount.ts +13 -0
  552. package/pkg/commands/zdiffstore.test.ts +42 -0
  553. package/pkg/commands/zdiffstore.ts +14 -0
  554. package/pkg/commands/zincrby.test.ts +19 -0
  555. package/pkg/commands/zincrby.ts +13 -0
  556. package/pkg/commands/zinterstore.test.ts +297 -0
  557. package/pkg/commands/zinterstore.ts +51 -0
  558. package/pkg/commands/zlexcount.test.ts +23 -0
  559. package/pkg/commands/zlexcount.ts +10 -0
  560. package/pkg/commands/zmscore.test.ts +39 -0
  561. package/pkg/commands/zmscore.ts +15 -0
  562. package/pkg/commands/zpopmax.test.ts +46 -0
  563. package/pkg/commands/zpopmax.ts +17 -0
  564. package/pkg/commands/zpopmin.test.ts +50 -0
  565. package/pkg/commands/zpopmin.ts +17 -0
  566. package/pkg/commands/zrange.test.ts +188 -0
  567. package/pkg/commands/zrange.ts +68 -0
  568. package/pkg/commands/zrank.test.ts +23 -0
  569. package/pkg/commands/zrank.ts +14 -0
  570. package/pkg/commands/zrem.test.ts +21 -0
  571. package/pkg/commands/zrem.ts +10 -0
  572. package/pkg/commands/zremrangebylex.test.ts +24 -0
  573. package/pkg/commands/zremrangebylex.ts +10 -0
  574. package/pkg/commands/zremrangebyrank.test.ts +27 -0
  575. package/pkg/commands/zremrangebyrank.ts +13 -0
  576. package/pkg/commands/zremrangebyscore.test.ts +24 -0
  577. package/pkg/commands/zremrangebyscore.ts +10 -0
  578. package/pkg/commands/zrevrank.test.ts +23 -0
  579. package/pkg/commands/zrevrank.ts +14 -0
  580. package/pkg/commands/zscan.test.ts +48 -0
  581. package/pkg/commands/zscan.ts +30 -0
  582. package/pkg/commands/zscore.test.ts +18 -0
  583. package/pkg/commands/zscore.ts +14 -0
  584. package/pkg/commands/zunion.test.ts +251 -0
  585. package/pkg/commands/zunion.ts +54 -0
  586. package/pkg/commands/zunionstore.test.ts +274 -0
  587. package/pkg/commands/zunionstore.ts +51 -0
  588. package/pkg/error.ts +18 -0
  589. package/pkg/http.ts +349 -0
  590. package/pkg/index.ts +1 -0
  591. package/pkg/pipeline.test.ts +254 -0
  592. package/pkg/pipeline.ts +1401 -0
  593. package/pkg/read-your-writes.test.ts +115 -0
  594. package/pkg/redis.test.ts +250 -0
  595. package/pkg/redis.ts +1367 -0
  596. package/pkg/script.test.ts +58 -0
  597. package/pkg/script.ts +67 -0
  598. package/pkg/test-utils.test.ts +17 -0
  599. package/pkg/test-utils.ts +72 -0
  600. package/pkg/types.ts +35 -0
  601. package/pkg/util.ts +42 -0
  602. package/platforms/cloudflare.ts +144 -0
  603. package/platforms/fastly.ts +100 -0
  604. package/platforms/nodejs.ts +196 -0
  605. package/prettier.config.mjs +13 -0
  606. package/tsconfig.json +21 -0
  607. package/tsup.config.ts +8 -0
  608. package/version.ts +1 -0
  609. package/chunk-JD7AT2OK.js +0 -1
  610. package/chunk-XCPX3L6C.mjs +0 -1
  611. package/cloudflare.d.mts +0 -50
  612. package/cloudflare.d.ts +0 -50
  613. package/cloudflare.js +0 -1
  614. package/cloudflare.mjs +0 -1
  615. package/fastly.d.mts +0 -43
  616. package/fastly.d.ts +0 -43
  617. package/fastly.js +0 -1
  618. package/fastly.mjs +0 -1
  619. package/nodejs.d.mts +0 -85
  620. package/nodejs.d.ts +0 -85
  621. package/nodejs.js +0 -1
  622. package/nodejs.mjs +0 -1
package/cloudflare.d.ts DELETED
@@ -1,50 +0,0 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-5d82e632.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, c as Requester, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bo as ZAddCommand, bn as ZAddCommandOptions, bp as ZCardCommand, bq as ZCountCommand, br as ZDiffStoreCommand, bs as ZIncrByCommand, bt as ZInterStoreCommand, bu as ZInterStoreCommandOptions, bv as ZLexCountCommand, bw as ZMScoreCommand, bx as ZPopMaxCommand, by as ZPopMinCommand, bz as ZRangeCommand, bA as ZRangeCommandOptions, bB as ZRankCommand, bC as ZRemCommand, bD as ZRemRangeByLexCommand, bE as ZRemRangeByRankCommand, bF as ZRemRangeByScoreCommand, bG as ZRevRankCommand, bH as ZScanCommand, bI as ZScoreCommand, bJ as ZUnionCommand, bK as ZUnionCommandOptions, bL as ZUnionStoreCommand, bM as ZUnionStoreCommandOptions } from './zmscore-5d82e632.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
- /**
22
- * The signal will allow aborting requests on the fly.
23
- * For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
24
- */
25
- signal?: AbortSignal;
26
- } & RedisOptions & RequesterConfig & Env;
27
- /**
28
- * Serverless redis client for upstash.
29
- */
30
- declare class Redis extends Redis$1 {
31
- /**
32
- * Create a new redis client
33
- *
34
- * @example
35
- * ```typescript
36
- * const redis = new Redis({
37
- * url: "<UPSTASH_REDIS_REST_URL>",
38
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
39
- * });
40
- * ```
41
- */
42
- constructor(config: RedisConfigCloudflare, env?: Env);
43
- static fromEnv(env?: {
44
- UPSTASH_REDIS_REST_URL: string;
45
- UPSTASH_REDIS_REST_TOKEN: string;
46
- UPSTASH_DISABLE_TELEMETRY?: string;
47
- }, opts?: Omit<RedisConfigCloudflare, "url" | "token">): Redis;
48
- }
49
-
50
- export { Redis, RedisConfigCloudflare };
package/cloudflare.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJD7AT2OKjs = require('./chunk-JD7AT2OK.js');var a=class S extends _chunkJD7AT2OKjs.b{constructor(e,r){(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new (0, _chunkJD7AT2OKjs.a)({retry:e.retry,baseUrl:e.url,headers:{authorization:`Bearer ${e.token}`},responseEncoding:e.responseEncoding,signal:e.signal});super(t,{enableTelemetry:!_optionalChain([r, 'optionalAccess', _ => _.UPSTASH_DISABLE_TELEMETRY]),automaticDeserialization:e.automaticDeserialization}),this.addTelemetry({platform:"cloudflare",sdk:`@upstash/redis@${_chunkJD7AT2OKjs.c}`})}static fromEnv(e,r){let t=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _2 => _2.UPSTASH_REDIS_REST_URL]), () => (UPSTASH_REDIS_REST_URL)),s=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _3 => _3.UPSTASH_REDIS_REST_TOKEN]), () => (UPSTASH_REDIS_REST_TOKEN));if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");if(!s)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_TOKEN`");return new S({...r,url:t,token:s},e)}};exports.Redis = a;
package/cloudflare.mjs DELETED
@@ -1 +0,0 @@
1
- import{a as n,b as o,c as i}from"./chunk-XCPX3L6C.mjs";var a=class S extends o{constructor(e,r){(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new n({retry:e.retry,baseUrl:e.url,headers:{authorization:`Bearer ${e.token}`},responseEncoding:e.responseEncoding,signal:e.signal});super(t,{enableTelemetry:!r?.UPSTASH_DISABLE_TELEMETRY,automaticDeserialization:e.automaticDeserialization}),this.addTelemetry({platform:"cloudflare",sdk:`@upstash/redis@${i}`})}static fromEnv(e,r){let t=e?.UPSTASH_REDIS_REST_URL??UPSTASH_REDIS_REST_URL,s=e?.UPSTASH_REDIS_REST_TOKEN??UPSTASH_REDIS_REST_TOKEN;if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_URL`");if(!s)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_REDIS_REST_TOKEN`");return new S({...r,url:t,token:s},e)}};export{a as Redis};
package/fastly.d.mts DELETED
@@ -1,43 +0,0 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-5d82e632.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, c as Requester, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bo as ZAddCommand, bn as ZAddCommandOptions, bp as ZCardCommand, bq as ZCountCommand, br as ZDiffStoreCommand, bs as ZIncrByCommand, bt as ZInterStoreCommand, bu as ZInterStoreCommandOptions, bv as ZLexCountCommand, bw as ZMScoreCommand, bx as ZPopMaxCommand, by as ZPopMinCommand, bz as ZRangeCommand, bA as ZRangeCommandOptions, bB as ZRankCommand, bC as ZRemCommand, bD as ZRemRangeByLexCommand, bE as ZRemRangeByRankCommand, bF as ZRemRangeByScoreCommand, bG as ZRevRankCommand, bH as ZScanCommand, bI as ZScoreCommand, bJ as ZUnionCommand, bK as ZUnionCommandOptions, bL as ZUnionStoreCommand, bM as ZUnionStoreCommandOptions } from './zmscore-5d82e632.js';
3
-
4
- /**
5
- * Connection credentials for upstash redis.
6
- * Get them from https://console.upstash.com/redis/<uuid>
7
- */
8
- type RedisConfigFastly = {
9
- /**
10
- * UPSTASH_REDIS_REST_URL
11
- */
12
- url: string;
13
- /**
14
- * UPSTASH_REDIS_REST_TOKEN
15
- */
16
- token: string;
17
- /**
18
- * A Request can be forwarded to any backend defined on your service. Backends
19
- * can be created via the Fastly CLI, API, or web interface, and are
20
- * referenced by name.
21
- */
22
- backend: string;
23
- } & RedisOptions & RequesterConfig;
24
- /**
25
- * Serverless redis client for upstash.
26
- */
27
- declare class Redis extends Redis$1 {
28
- /**
29
- * Create a new redis client
30
- *
31
- * @example
32
- * ```typescript
33
- * const redis = new Redis({
34
- * url: "<UPSTASH_REDIS_REST_URL>",
35
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
36
- * backend: "upstash-db",
37
- * });
38
- * ```
39
- */
40
- constructor(config: RedisConfigFastly);
41
- }
42
-
43
- export { Redis, RedisConfigFastly };
package/fastly.d.ts DELETED
@@ -1,43 +0,0 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1 } from './zmscore-5d82e632.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, c as Requester, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bo as ZAddCommand, bn as ZAddCommandOptions, bp as ZCardCommand, bq as ZCountCommand, br as ZDiffStoreCommand, bs as ZIncrByCommand, bt as ZInterStoreCommand, bu as ZInterStoreCommandOptions, bv as ZLexCountCommand, bw as ZMScoreCommand, bx as ZPopMaxCommand, by as ZPopMinCommand, bz as ZRangeCommand, bA as ZRangeCommandOptions, bB as ZRankCommand, bC as ZRemCommand, bD as ZRemRangeByLexCommand, bE as ZRemRangeByRankCommand, bF as ZRemRangeByScoreCommand, bG as ZRevRankCommand, bH as ZScanCommand, bI as ZScoreCommand, bJ as ZUnionCommand, bK as ZUnionCommandOptions, bL as ZUnionStoreCommand, bM as ZUnionStoreCommandOptions } from './zmscore-5d82e632.js';
3
-
4
- /**
5
- * Connection credentials for upstash redis.
6
- * Get them from https://console.upstash.com/redis/<uuid>
7
- */
8
- type RedisConfigFastly = {
9
- /**
10
- * UPSTASH_REDIS_REST_URL
11
- */
12
- url: string;
13
- /**
14
- * UPSTASH_REDIS_REST_TOKEN
15
- */
16
- token: string;
17
- /**
18
- * A Request can be forwarded to any backend defined on your service. Backends
19
- * can be created via the Fastly CLI, API, or web interface, and are
20
- * referenced by name.
21
- */
22
- backend: string;
23
- } & RedisOptions & RequesterConfig;
24
- /**
25
- * Serverless redis client for upstash.
26
- */
27
- declare class Redis extends Redis$1 {
28
- /**
29
- * Create a new redis client
30
- *
31
- * @example
32
- * ```typescript
33
- * const redis = new Redis({
34
- * url: "<UPSTASH_REDIS_REST_URL>",
35
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
36
- * backend: "upstash-db",
37
- * });
38
- * ```
39
- */
40
- constructor(config: RedisConfigFastly);
41
- }
42
-
43
- export { Redis, RedisConfigFastly };
package/fastly.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJD7AT2OKjs = require('./chunk-JD7AT2OK.js');var o=class extends _chunkJD7AT2OKjs.b{constructor(e){(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let n=new (0, _chunkJD7AT2OKjs.a)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},options:{backend:e.backend},responseEncoding:e.responseEncoding});super(n,{automaticDeserialization:e.automaticDeserialization}),this.addTelemetry({sdk:`@upstash/redis@${_chunkJD7AT2OKjs.c}`,platform:"fastly"})}};exports.Redis = o;
package/fastly.mjs DELETED
@@ -1 +0,0 @@
1
- import{a as t,b as s,c as r}from"./chunk-XCPX3L6C.mjs";var o=class extends s{constructor(e){(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let n=new t({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},options:{backend:e.backend},responseEncoding:e.responseEncoding});super(n,{automaticDeserialization:e.automaticDeserialization}),this.addTelemetry({sdk:`@upstash/redis@${r}`,platform:"fastly"})}};export{o as Redis};
package/nodejs.d.mts DELETED
@@ -1,85 +0,0 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1, c as Requester } from './zmscore-5d82e632.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bo as ZAddCommand, bn as ZAddCommandOptions, bp as ZCardCommand, bq as ZCountCommand, br as ZDiffStoreCommand, bs as ZIncrByCommand, bt as ZInterStoreCommand, bu as ZInterStoreCommandOptions, bv as ZLexCountCommand, bw as ZMScoreCommand, bx as ZPopMaxCommand, by as ZPopMinCommand, bz as ZRangeCommand, bA as ZRangeCommandOptions, bB as ZRankCommand, bC as ZRemCommand, bD as ZRemRangeByLexCommand, bE as ZRemRangeByRankCommand, bF as ZRemRangeByScoreCommand, bG as ZRevRankCommand, bH as ZScanCommand, bI as ZScoreCommand, bJ as ZUnionCommand, bK as ZUnionCommandOptions, bL as ZUnionStoreCommand, bM as ZUnionStoreCommandOptions } from './zmscore-5d82e632.js';
3
-
4
- /**
5
- * Connection credentials for upstash redis.
6
- * Get them from https://console.upstash.com/redis/<uuid>
7
- */
8
- type RedisConfigNodejs = {
9
- /**
10
- * UPSTASH_REDIS_REST_URL
11
- */
12
- url: string;
13
- /**
14
- * UPSTASH_REDIS_REST_TOKEN
15
- */
16
- token: string;
17
- /**
18
- * An agent allows you to reuse connections to reduce latency for multiple sequential requests.
19
- *
20
- * This is a node specific implementation and is not supported in various runtimes like Vercel
21
- * edge functions.
22
- *
23
- * @example
24
- * ```ts
25
- * import https from "https"
26
- *
27
- * const options: RedisConfigNodejs = {
28
- * agent: new https.Agent({ keepAlive: true })
29
- * }
30
- * ```
31
- */
32
- /**
33
- * The signal will allow aborting requests on the fly.
34
- * For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
35
- */
36
- signal?: AbortSignal;
37
- agent?: any;
38
- } & RedisOptions & RequesterConfig;
39
- /**
40
- * Serverless redis client for upstash.
41
- */
42
- declare class Redis extends Redis$1 {
43
- /**
44
- * Create a new redis client by providing the url and token
45
- *
46
- * @example
47
- * ```typescript
48
- * const redis = new Redis({
49
- * url: "<UPSTASH_REDIS_REST_URL>",
50
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
51
- * });
52
- * ```
53
- */
54
- constructor(config: RedisConfigNodejs);
55
- /**
56
- * Create a new redis client by providing a custom `Requester` implementation
57
- *
58
- * @example
59
- * ```ts
60
- *
61
- * import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis"
62
- *
63
- * const requester: Requester = {
64
- * request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
65
- * // ...
66
- * }
67
- * }
68
- *
69
- * const redis = new Redis(requester)
70
- * ```
71
- */
72
- constructor(requesters: Requester);
73
- /**
74
- * Create a new Upstash Redis instance from environment variables.
75
- *
76
- * Use this to automatically load connection secrets from your environment
77
- * variables. For instance when using the Vercel integration.
78
- *
79
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
80
- * your environment using `process.env`.
81
- */
82
- static fromEnv(config?: Omit<RedisConfigNodejs, "url" | "token">): Redis;
83
- }
84
-
85
- export { Redis, RedisConfigNodejs, Requester };
package/nodejs.d.ts DELETED
@@ -1,85 +0,0 @@
1
- import { R as RedisOptions, a as RequesterConfig, b as Redis$1, c as Requester } from './zmscore-5d82e632.js';
2
- export { A as AppendCommand, B as BitCountCommand, e as BitOpCommand, f as BitPosCommand, C as CopyCommand, D as DBSizeCommand, h as DecrByCommand, g as DecrCommand, i as DelCommand, E as EchoCommand, j as EvalCommand, k as EvalshaCommand, l as ExistsCommand, n as ExpireAtCommand, m as ExpireCommand, F as FlushAllCommand, o as FlushDBCommand, G as GeoAddCommand, p as GeoAddCommandOptions, r as GeoDistCommand, s as GeoHashCommand, q as GeoMember, t as GeoPosCommand, u as GeoSearchCommand, v as GeoSearchStoreCommand, x as GetBitCommand, w as GetCommand, y as GetDelCommand, z as GetRangeCommand, H as GetSetCommand, I as HDelCommand, J as HExistsCommand, L as HGetAllCommand, K as HGetCommand, M as HIncrByCommand, N as HIncrByFloatCommand, O as HKeysCommand, P as HLenCommand, Q as HMGetCommand, S as HMSetCommand, T as HRandFieldCommand, V as HScanCommand, W as HSetCommand, X as HSetNXCommand, Y as HStrLenCommand, Z as HValsCommand, $ as IncrByCommand, a0 as IncrByFloatCommand, _ as IncrCommand, a1 as JsonArrAppendCommand, a2 as JsonArrIndexCommand, a3 as JsonArrInsertCommand, a4 as JsonArrLenCommand, a5 as JsonArrPopCommand, a6 as JsonArrTrimCommand, a7 as JsonClearCommand, a8 as JsonDelCommand, a9 as JsonForgetCommand, aa as JsonGetCommand, ab as JsonMGetCommand, ac as JsonNumIncrByCommand, ad as JsonNumMultByCommand, ae as JsonObjKeysCommand, af as JsonObjLenCommand, ag as JsonRespCommand, ah as JsonSetCommand, ai as JsonStrAppendCommand, aj as JsonStrLenCommand, ak as JsonToggleCommand, al as JsonTypeCommand, am as KeysCommand, an as LIndexCommand, ao as LInsertCommand, ap as LLenCommand, aq as LMoveCommand, ar as LPopCommand, as as LPushCommand, at as LPushXCommand, au as LRangeCommand, av as LRemCommand, aw as LSetCommand, ax as LTrimCommand, ay as MGetCommand, az as MSetCommand, aA as MSetNXCommand, aD as PExpireAtCommand, aC as PExpireCommand, aF as PSetEXCommand, aG as PTtlCommand, aB as PersistCommand, aE as PingCommand, aH as PublishCommand, aL as RPopCommand, aM as RPushCommand, aN as RPushXCommand, aI as RandomKeyCommand, aJ as RenameCommand, aK as RenameNXCommand, aO as SAddCommand, aR as SCardCommand, aV as SDiffCommand, aW as SDiffStoreCommand, b1 as SInterCommand, b2 as SInterStoreCommand, b3 as SIsMemberCommand, b5 as SMIsMemberCommand, b4 as SMembersCommand, b6 as SMoveCommand, b7 as SPopCommand, b8 as SRandMemberCommand, b9 as SRemCommand, ba as SScanCommand, bc as SUnionCommand, bd as SUnionStoreCommand, aP as ScanCommand, aQ as ScanCommandOptions, bm as ScoreMember, aS as ScriptExistsCommand, aT as ScriptFlushCommand, aU as ScriptLoadCommand, aZ as SetBitCommand, aX as SetCommand, aY as SetCommandOptions, a_ as SetExCommand, a$ as SetNxCommand, b0 as SetRangeCommand, bb as StrLenCommand, be as TimeCommand, bf as TouchCommand, bg as TtlCommand, bh as Type, bi as TypeCommand, bj as UnlinkCommand, U as UpstashRequest, d as UpstashResponse, bk as XAddCommand, bl as XRangeCommand, bo as ZAddCommand, bn as ZAddCommandOptions, bp as ZCardCommand, bq as ZCountCommand, br as ZDiffStoreCommand, bs as ZIncrByCommand, bt as ZInterStoreCommand, bu as ZInterStoreCommandOptions, bv as ZLexCountCommand, bw as ZMScoreCommand, bx as ZPopMaxCommand, by as ZPopMinCommand, bz as ZRangeCommand, bA as ZRangeCommandOptions, bB as ZRankCommand, bC as ZRemCommand, bD as ZRemRangeByLexCommand, bE as ZRemRangeByRankCommand, bF as ZRemRangeByScoreCommand, bG as ZRevRankCommand, bH as ZScanCommand, bI as ZScoreCommand, bJ as ZUnionCommand, bK as ZUnionCommandOptions, bL as ZUnionStoreCommand, bM as ZUnionStoreCommandOptions } from './zmscore-5d82e632.js';
3
-
4
- /**
5
- * Connection credentials for upstash redis.
6
- * Get them from https://console.upstash.com/redis/<uuid>
7
- */
8
- type RedisConfigNodejs = {
9
- /**
10
- * UPSTASH_REDIS_REST_URL
11
- */
12
- url: string;
13
- /**
14
- * UPSTASH_REDIS_REST_TOKEN
15
- */
16
- token: string;
17
- /**
18
- * An agent allows you to reuse connections to reduce latency for multiple sequential requests.
19
- *
20
- * This is a node specific implementation and is not supported in various runtimes like Vercel
21
- * edge functions.
22
- *
23
- * @example
24
- * ```ts
25
- * import https from "https"
26
- *
27
- * const options: RedisConfigNodejs = {
28
- * agent: new https.Agent({ keepAlive: true })
29
- * }
30
- * ```
31
- */
32
- /**
33
- * The signal will allow aborting requests on the fly.
34
- * For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
35
- */
36
- signal?: AbortSignal;
37
- agent?: any;
38
- } & RedisOptions & RequesterConfig;
39
- /**
40
- * Serverless redis client for upstash.
41
- */
42
- declare class Redis extends Redis$1 {
43
- /**
44
- * Create a new redis client by providing the url and token
45
- *
46
- * @example
47
- * ```typescript
48
- * const redis = new Redis({
49
- * url: "<UPSTASH_REDIS_REST_URL>",
50
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
51
- * });
52
- * ```
53
- */
54
- constructor(config: RedisConfigNodejs);
55
- /**
56
- * Create a new redis client by providing a custom `Requester` implementation
57
- *
58
- * @example
59
- * ```ts
60
- *
61
- * import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis"
62
- *
63
- * const requester: Requester = {
64
- * request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
65
- * // ...
66
- * }
67
- * }
68
- *
69
- * const redis = new Redis(requester)
70
- * ```
71
- */
72
- constructor(requesters: Requester);
73
- /**
74
- * Create a new Upstash Redis instance from environment variables.
75
- *
76
- * Use this to automatically load connection secrets from your environment
77
- * variables. For instance when using the Vercel integration.
78
- *
79
- * This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
80
- * your environment using `process.env`.
81
- */
82
- static fromEnv(config?: Omit<RedisConfigNodejs, "url" | "token">): Redis;
83
- }
84
-
85
- export { Redis, RedisConfigNodejs, Requester };
package/nodejs.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJD7AT2OKjs = require('./chunk-JD7AT2OK.js');typeof atob>"u"&&(global.atob=function(n){return Buffer.from(n,"base64").toString("utf-8")});var a=class n extends _chunkJD7AT2OKjs.b{constructor(e){if("request"in e){super(e);return}(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new (0, _chunkJD7AT2OKjs.a)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache||"no-store",signal:e.signal});super(t,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime=="string"?"edge-light":`node@${process.version}`,platform:process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:`@upstash/redis@${_chunkJD7AT2OKjs.c}`})}static fromEnv(e){if(typeof _optionalChain([process, 'optionalAccess', _ => _.env])>"u")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let t=_optionalChain([process, 'optionalAccess', _2 => _2.env, 'access', _3 => _3.UPSTASH_REDIS_REST_URL]);if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let s=_optionalChain([process, 'optionalAccess', _4 => _4.env, 'access', _5 => _5.UPSTASH_REDIS_REST_TOKEN]);if(!s)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");return new n({...e,url:t,token:s})}};exports.Redis = a;
package/nodejs.mjs DELETED
@@ -1 +0,0 @@
1
- import{a as o,b as r,c as i}from"./chunk-XCPX3L6C.mjs";typeof atob>"u"&&(global.atob=function(n){return Buffer.from(n,"base64").toString("utf-8")});var a=class n extends r{constructor(e){if("request"in e){super(e);return}(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new o({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache||"no-store",signal:e.signal});super(t,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime=="string"?"edge-light":`node@${process.version}`,platform:process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:`@upstash/redis@${i}`})}static fromEnv(e){if(typeof process?.env>"u")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let t=process?.env.UPSTASH_REDIS_REST_URL;if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let s=process?.env.UPSTASH_REDIS_REST_TOKEN;if(!s)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");return new n({...e,url:t,token:s})}};export{a as Redis};