@windrun-huaiin/backend-core 12.0.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/_virtual/_commonjs-dynamic-modules.js +7 -0
  2. package/dist/_virtual/_commonjs-dynamic-modules.mjs +5 -0
  3. package/dist/_virtual/_commonjsHelpers.js +10 -0
  4. package/dist/_virtual/_commonjsHelpers.mjs +7 -0
  5. package/dist/_virtual/aes.js +5 -0
  6. package/dist/_virtual/aes.mjs +3 -0
  7. package/dist/_virtual/blowfish.js +5 -0
  8. package/dist/_virtual/blowfish.mjs +3 -0
  9. package/dist/_virtual/cipher-core.js +5 -0
  10. package/dist/_virtual/cipher-core.mjs +3 -0
  11. package/dist/_virtual/core.js +5 -0
  12. package/dist/_virtual/core.mjs +3 -0
  13. package/dist/_virtual/enc-base64.js +5 -0
  14. package/dist/_virtual/enc-base64.mjs +3 -0
  15. package/dist/_virtual/enc-base64url.js +5 -0
  16. package/dist/_virtual/enc-base64url.mjs +3 -0
  17. package/dist/_virtual/enc-utf16.js +5 -0
  18. package/dist/_virtual/enc-utf16.mjs +3 -0
  19. package/dist/_virtual/evpkdf.js +5 -0
  20. package/dist/_virtual/evpkdf.mjs +3 -0
  21. package/dist/_virtual/format-hex.js +5 -0
  22. package/dist/_virtual/format-hex.mjs +3 -0
  23. package/dist/_virtual/hmac.js +5 -0
  24. package/dist/_virtual/hmac.mjs +3 -0
  25. package/dist/_virtual/index.js +11 -0
  26. package/dist/_virtual/index.mjs +7 -0
  27. package/dist/_virtual/index2.js +5 -0
  28. package/dist/_virtual/index2.mjs +3 -0
  29. package/dist/_virtual/lib-typedarrays.js +5 -0
  30. package/dist/_virtual/lib-typedarrays.mjs +3 -0
  31. package/dist/_virtual/md5.js +5 -0
  32. package/dist/_virtual/md5.mjs +3 -0
  33. package/dist/_virtual/mode-cfb.js +5 -0
  34. package/dist/_virtual/mode-cfb.mjs +3 -0
  35. package/dist/_virtual/mode-ctr-gladman.js +5 -0
  36. package/dist/_virtual/mode-ctr-gladman.mjs +3 -0
  37. package/dist/_virtual/mode-ctr.js +5 -0
  38. package/dist/_virtual/mode-ctr.mjs +3 -0
  39. package/dist/_virtual/mode-ecb.js +5 -0
  40. package/dist/_virtual/mode-ecb.mjs +3 -0
  41. package/dist/_virtual/mode-ofb.js +5 -0
  42. package/dist/_virtual/mode-ofb.mjs +3 -0
  43. package/dist/_virtual/pad-ansix923.js +5 -0
  44. package/dist/_virtual/pad-ansix923.mjs +3 -0
  45. package/dist/_virtual/pad-iso10126.js +5 -0
  46. package/dist/_virtual/pad-iso10126.mjs +3 -0
  47. package/dist/_virtual/pad-iso97971.js +5 -0
  48. package/dist/_virtual/pad-iso97971.mjs +3 -0
  49. package/dist/_virtual/pad-nopadding.js +5 -0
  50. package/dist/_virtual/pad-nopadding.mjs +3 -0
  51. package/dist/_virtual/pad-zeropadding.js +5 -0
  52. package/dist/_virtual/pad-zeropadding.mjs +3 -0
  53. package/dist/_virtual/pbkdf2.js +5 -0
  54. package/dist/_virtual/pbkdf2.mjs +3 -0
  55. package/dist/_virtual/rabbit-legacy.js +5 -0
  56. package/dist/_virtual/rabbit-legacy.mjs +3 -0
  57. package/dist/_virtual/rabbit.js +5 -0
  58. package/dist/_virtual/rabbit.mjs +3 -0
  59. package/dist/_virtual/rc4.js +5 -0
  60. package/dist/_virtual/rc4.mjs +3 -0
  61. package/dist/_virtual/ripemd160.js +5 -0
  62. package/dist/_virtual/ripemd160.mjs +3 -0
  63. package/dist/_virtual/sha1.js +5 -0
  64. package/dist/_virtual/sha1.mjs +3 -0
  65. package/dist/_virtual/sha224.js +5 -0
  66. package/dist/_virtual/sha224.mjs +3 -0
  67. package/dist/_virtual/sha256.js +5 -0
  68. package/dist/_virtual/sha256.mjs +3 -0
  69. package/dist/_virtual/sha3.js +5 -0
  70. package/dist/_virtual/sha3.mjs +3 -0
  71. package/dist/_virtual/sha384.js +5 -0
  72. package/dist/_virtual/sha384.mjs +3 -0
  73. package/dist/_virtual/sha512.js +5 -0
  74. package/dist/_virtual/sha512.mjs +3 -0
  75. package/dist/_virtual/tripledes.js +5 -0
  76. package/dist/_virtual/tripledes.mjs +3 -0
  77. package/dist/_virtual/x64-core.js +5 -0
  78. package/dist/_virtual/x64-core.mjs +3 -0
  79. package/dist/index.js +48 -0
  80. package/dist/index.mjs +7 -0
  81. package/dist/lib/index.d.ts +2 -0
  82. package/dist/lib/index.d.ts.map +1 -1
  83. package/dist/lib/index.js +48 -0
  84. package/dist/lib/index.mjs +7 -0
  85. package/dist/lib/upstash/index.d.ts +7 -0
  86. package/dist/lib/upstash/index.d.ts.map +1 -0
  87. package/dist/lib/upstash/qstash.d.ts +36 -0
  88. package/dist/lib/upstash/qstash.d.ts.map +1 -0
  89. package/dist/lib/upstash/qstash.js +134 -0
  90. package/dist/lib/upstash/qstash.mjs +128 -0
  91. package/dist/lib/upstash/redis-counter.d.ts +17 -0
  92. package/dist/lib/upstash/redis-counter.d.ts.map +1 -0
  93. package/dist/lib/upstash/redis-counter.js +40 -0
  94. package/dist/lib/upstash/redis-counter.mjs +35 -0
  95. package/dist/lib/upstash/redis-favorite.d.ts +21 -0
  96. package/dist/lib/upstash/redis-favorite.d.ts.map +1 -0
  97. package/dist/lib/upstash/redis-favorite.js +60 -0
  98. package/dist/lib/upstash/redis-favorite.mjs +54 -0
  99. package/dist/lib/upstash/redis-like.d.ts +21 -0
  100. package/dist/lib/upstash/redis-like.d.ts.map +1 -0
  101. package/dist/lib/upstash/redis-like.js +60 -0
  102. package/dist/lib/upstash/redis-like.mjs +54 -0
  103. package/dist/lib/upstash/redis-lock.d.ts +13 -0
  104. package/dist/lib/upstash/redis-lock.d.ts.map +1 -0
  105. package/dist/lib/upstash/redis-lock.js +59 -0
  106. package/dist/lib/upstash/redis-lock.mjs +55 -0
  107. package/dist/lib/upstash/redis-structures.d.ts +63 -0
  108. package/dist/lib/upstash/redis-structures.d.ts.map +1 -0
  109. package/dist/lib/upstash/redis-structures.js +175 -0
  110. package/dist/lib/upstash/redis-structures.mjs +159 -0
  111. package/dist/lib/upstash-config.d.ts +19 -0
  112. package/dist/lib/upstash-config.d.ts.map +1 -0
  113. package/dist/lib/upstash-config.js +247 -0
  114. package/dist/lib/upstash-config.mjs +242 -0
  115. package/dist/node_modules/.pnpm/@upstash_qstash@2.10.1/node_modules/@upstash/qstash/chunk-35B33QW3.js +1848 -0
  116. package/dist/node_modules/.pnpm/@upstash_qstash@2.10.1/node_modules/@upstash/qstash/chunk-35B33QW3.mjs +1830 -0
  117. package/dist/node_modules/.pnpm/@upstash_redis@1.37.0/node_modules/@upstash/redis/chunk-IH7W44G6.js +5308 -0
  118. package/dist/node_modules/.pnpm/@upstash_redis@1.37.0/node_modules/@upstash/redis/chunk-IH7W44G6.mjs +5302 -0
  119. package/dist/node_modules/.pnpm/@upstash_redis@1.37.0/node_modules/@upstash/redis/nodejs.js +116 -0
  120. package/dist/node_modules/.pnpm/@upstash_redis@1.37.0/node_modules/@upstash/redis/nodejs.mjs +113 -0
  121. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js +248 -0
  122. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.mjs +246 -0
  123. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.js +485 -0
  124. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.mjs +483 -0
  125. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.js +906 -0
  126. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.mjs +904 -0
  127. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js +818 -0
  128. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.mjs +816 -0
  129. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.js +146 -0
  130. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.mjs +144 -0
  131. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.js +158 -0
  132. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.mjs +156 -0
  133. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.js +159 -0
  134. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.mjs +157 -0
  135. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.js +146 -0
  136. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.mjs +144 -0
  137. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.js +77 -0
  138. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.mjs +75 -0
  139. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.js +153 -0
  140. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.mjs +151 -0
  141. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.js +62 -0
  142. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.mjs +60 -0
  143. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.js +86 -0
  144. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.mjs +84 -0
  145. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.js +278 -0
  146. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.mjs +276 -0
  147. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.js +91 -0
  148. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.mjs +89 -0
  149. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.js +127 -0
  150. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.mjs +125 -0
  151. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.js +69 -0
  152. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.mjs +67 -0
  153. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js +51 -0
  154. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.mjs +49 -0
  155. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.js +65 -0
  156. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.mjs +63 -0
  157. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.js +60 -0
  158. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.mjs +58 -0
  159. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.js +55 -0
  160. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.mjs +53 -0
  161. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.js +51 -0
  162. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.mjs +49 -0
  163. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.js +41 -0
  164. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.mjs +39 -0
  165. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.js +58 -0
  166. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.mjs +56 -0
  167. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.js +157 -0
  168. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.mjs +155 -0
  169. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.js +204 -0
  170. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.mjs +202 -0
  171. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.js +206 -0
  172. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.mjs +204 -0
  173. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.js +153 -0
  174. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.mjs +151 -0
  175. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.js +277 -0
  176. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.mjs +275 -0
  177. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.js +160 -0
  178. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.mjs +158 -0
  179. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.js +91 -0
  180. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.mjs +89 -0
  181. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.js +209 -0
  182. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.mjs +207 -0
  183. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.js +337 -0
  184. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.mjs +335 -0
  185. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.js +95 -0
  186. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.mjs +93 -0
  187. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.js +337 -0
  188. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.mjs +335 -0
  189. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.js +793 -0
  190. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.mjs +791 -0
  191. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.js +314 -0
  192. package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.mjs +312 -0
  193. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.js +26 -0
  194. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.mjs +24 -0
  195. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.js +127 -0
  196. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.mjs +125 -0
  197. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.js +20 -0
  198. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.mjs +18 -0
  199. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.js +31 -0
  200. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.mjs +29 -0
  201. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.js +18 -0
  202. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.mjs +14 -0
  203. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.js +82 -0
  204. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.mjs +80 -0
  205. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.js +103 -0
  206. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.mjs +101 -0
  207. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.js +7 -0
  208. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.mjs +3 -0
  209. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.js +38 -0
  210. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.mjs +33 -0
  211. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.js +27 -0
  212. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.mjs +23 -0
  213. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js +21 -0
  214. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.mjs +16 -0
  215. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.js +22 -0
  216. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.mjs +18 -0
  217. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.js +111 -0
  218. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.mjs +107 -0
  219. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.js +61 -0
  220. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.mjs +57 -0
  221. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.js +16 -0
  222. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.mjs +12 -0
  223. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.js +40 -0
  224. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.mjs +36 -0
  225. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js +15 -0
  226. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.mjs +13 -0
  227. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.js +23 -0
  228. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.mjs +19 -0
  229. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.js +30 -0
  230. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.mjs +26 -0
  231. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.js +60 -0
  232. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.mjs +56 -0
  233. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.js +35 -0
  234. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.mjs +31 -0
  235. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.js +20 -0
  236. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.mjs +16 -0
  237. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.js +15 -0
  238. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.mjs +10 -0
  239. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.js +28 -0
  240. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.mjs +5 -0
  241. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.js +14 -0
  242. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.mjs +10 -0
  243. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.js +115 -0
  244. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.mjs +111 -0
  245. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.js +42 -0
  246. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.mjs +19 -0
  247. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.js +54 -0
  248. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.mjs +31 -0
  249. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.js +32 -0
  250. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.mjs +7 -0
  251. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.js +69 -0
  252. package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.mjs +60 -0
  253. package/dist/node_modules/.pnpm/neverthrow@7.2.0/node_modules/neverthrow/dist/index.es.js +422 -0
  254. package/dist/node_modules/.pnpm/neverthrow@7.2.0/node_modules/neverthrow/dist/index.es.mjs +415 -0
  255. package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.web.js +6 -0
  256. package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.web.mjs +4 -0
  257. package/dist/prisma/prisma.d.ts +1 -1
  258. package/dist/prisma/prisma.d.ts.map +1 -1
  259. package/package.json +14 -11
  260. package/src/lib/index.ts +2 -0
  261. package/src/lib/upstash/index.ts +6 -0
  262. package/src/lib/upstash/qstash.ts +159 -0
  263. package/src/lib/upstash/redis-counter.ts +35 -0
  264. package/src/lib/upstash/redis-favorite.ts +56 -0
  265. package/src/lib/upstash/redis-like.ts +56 -0
  266. package/src/lib/upstash/redis-lock.ts +59 -0
  267. package/src/lib/upstash/redis-structures.ts +200 -0
  268. package/src/lib/upstash-config.ts +261 -0
  269. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.js +0 -54
  270. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.mjs +0 -51
  271. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.js +0 -44
  272. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.mjs +0 -35
  273. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/parse.js +0 -31
  274. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/parse.mjs +0 -18
  275. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.js +0 -587
  276. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.mjs +0 -527
  277. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.js +0 -447
  278. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.mjs +0 -399
  279. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.js +0 -245
  280. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.mjs +0 -232
  281. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.js +0 -68
  282. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.mjs +0 -62
  283. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/doc.js +0 -39
  284. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/doc.mjs +0 -37
  285. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.js +0 -80
  286. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.mjs +0 -75
  287. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.js +0 -101
  288. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.mjs +0 -86
  289. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.js +0 -102
  290. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.mjs +0 -76
  291. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.js +0 -56
  292. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.mjs +0 -52
  293. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js +0 -1205
  294. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.mjs +0 -1157
  295. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.js +0 -407
  296. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.mjs +0 -374
  297. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/versions.js +0 -9
  298. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/versions.mjs +0 -7
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js');
4
+ var upstashConfig = require('../upstash-config.js');
5
+
6
+ const likeTargetKey = (targetId) => `like:target:${targetId}`;
7
+ const likeUserKey = (userId) => `like:user:${userId}`;
8
+ /**
9
+ * Like a target. Returns true if the like was added, false if it already existed, null if Redis is unavailable.
10
+ */
11
+ const likeTarget = (targetId, userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
12
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
13
+ const added = yield redis.sadd(likeTargetKey(targetId), userId);
14
+ if (added === 1) {
15
+ yield redis.sadd(likeUserKey(userId), targetId);
16
+ return true;
17
+ }
18
+ return false;
19
+ }));
20
+ });
21
+ /**
22
+ * Unlike a target. Returns true if removed, false if it didn't exist, null if Redis is unavailable.
23
+ */
24
+ const unlikeTarget = (targetId, userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
25
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
26
+ const removed = yield redis.srem(likeTargetKey(targetId), userId);
27
+ if (removed === 1) {
28
+ yield redis.srem(likeUserKey(userId), targetId);
29
+ return true;
30
+ }
31
+ return false;
32
+ }));
33
+ });
34
+ /**
35
+ * Check whether a user liked a target. Returns null if Redis is unavailable.
36
+ */
37
+ const isTargetLiked = (targetId, userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
38
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
39
+ const result = yield redis.sismember(likeTargetKey(targetId), userId);
40
+ return result === 1;
41
+ }));
42
+ });
43
+ /**
44
+ * Get like count for a target (unique by user). Returns null if Redis is unavailable.
45
+ */
46
+ const getTargetLikeCount = (targetId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
47
+ return upstashConfig.withRedis((redis) => redis.scard(likeTargetKey(targetId)));
48
+ });
49
+ /**
50
+ * Get target ids liked by a user. Returns null if Redis is unavailable.
51
+ */
52
+ const getUserLikedTargets = (userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
53
+ return upstashConfig.withRedis((redis) => redis.smembers(likeUserKey(userId)));
54
+ });
55
+
56
+ exports.getTargetLikeCount = getTargetLikeCount;
57
+ exports.getUserLikedTargets = getUserLikedTargets;
58
+ exports.isTargetLiked = isTargetLiked;
59
+ exports.likeTarget = likeTarget;
60
+ exports.unlikeTarget = unlikeTarget;
@@ -0,0 +1,54 @@
1
+ import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
2
+ import { withRedis } from '../upstash-config.mjs';
3
+
4
+ const likeTargetKey = (targetId) => `like:target:${targetId}`;
5
+ const likeUserKey = (userId) => `like:user:${userId}`;
6
+ /**
7
+ * Like a target. Returns true if the like was added, false if it already existed, null if Redis is unavailable.
8
+ */
9
+ const likeTarget = (targetId, userId) => __awaiter(void 0, void 0, void 0, function* () {
10
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
11
+ const added = yield redis.sadd(likeTargetKey(targetId), userId);
12
+ if (added === 1) {
13
+ yield redis.sadd(likeUserKey(userId), targetId);
14
+ return true;
15
+ }
16
+ return false;
17
+ }));
18
+ });
19
+ /**
20
+ * Unlike a target. Returns true if removed, false if it didn't exist, null if Redis is unavailable.
21
+ */
22
+ const unlikeTarget = (targetId, userId) => __awaiter(void 0, void 0, void 0, function* () {
23
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
24
+ const removed = yield redis.srem(likeTargetKey(targetId), userId);
25
+ if (removed === 1) {
26
+ yield redis.srem(likeUserKey(userId), targetId);
27
+ return true;
28
+ }
29
+ return false;
30
+ }));
31
+ });
32
+ /**
33
+ * Check whether a user liked a target. Returns null if Redis is unavailable.
34
+ */
35
+ const isTargetLiked = (targetId, userId) => __awaiter(void 0, void 0, void 0, function* () {
36
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
37
+ const result = yield redis.sismember(likeTargetKey(targetId), userId);
38
+ return result === 1;
39
+ }));
40
+ });
41
+ /**
42
+ * Get like count for a target (unique by user). Returns null if Redis is unavailable.
43
+ */
44
+ const getTargetLikeCount = (targetId) => __awaiter(void 0, void 0, void 0, function* () {
45
+ return withRedis((redis) => redis.scard(likeTargetKey(targetId)));
46
+ });
47
+ /**
48
+ * Get target ids liked by a user. Returns null if Redis is unavailable.
49
+ */
50
+ const getUserLikedTargets = (userId) => __awaiter(void 0, void 0, void 0, function* () {
51
+ return withRedis((redis) => redis.smembers(likeUserKey(userId)));
52
+ });
53
+
54
+ export { getTargetLikeCount, getUserLikedTargets, isTargetLiked, likeTarget, unlikeTarget };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Acquire a distributed lock. Returns the lock token or null when unavailable.
3
+ */
4
+ export declare const acquireLock: (key: string, ttlMs: number) => Promise<string | null>;
5
+ /**
6
+ * Release a distributed lock. Returns false when the lock client is unavailable.
7
+ */
8
+ export declare const releaseLock: (key: string, token: string) => Promise<boolean>;
9
+ /**
10
+ * Run a function under a distributed lock. Returns null when the lock is unavailable.
11
+ */
12
+ export declare const withLock: <T>(key: string, ttlMs: number, fn: () => Promise<T> | T) => Promise<T | null>;
13
+ //# sourceMappingURL=redis-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-lock.d.ts","sourceRoot":"","sources":["../../../src/lib/upstash/redis-lock.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAMnF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAM7E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAU,CAAC,EAC9B,KAAK,MAAM,EACX,OAAO,MAAM,EACb,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,KACvB,OAAO,CAAC,CAAC,GAAG,IAAI,CAWlB,CAAC"}
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js');
4
+ var upstashConfig = require('../upstash-config.js');
5
+
6
+ const unlockScript = `
7
+ if redis.call("get", KEYS[1]) == ARGV[1] then
8
+ return redis.call("del", KEYS[1])
9
+ else
10
+ return 0
11
+ end
12
+ `;
13
+ const generateToken = () => {
14
+ try {
15
+ return crypto.randomUUID();
16
+ }
17
+ catch (_a) {
18
+ return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
19
+ }
20
+ };
21
+ /**
22
+ * Acquire a distributed lock. Returns the lock token or null when unavailable.
23
+ */
24
+ const acquireLock = (key, ttlMs) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
25
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
26
+ const token = generateToken();
27
+ const result = yield redis.set(key, token, { nx: true, px: ttlMs });
28
+ return result === 'OK' ? token : null;
29
+ }));
30
+ });
31
+ /**
32
+ * Release a distributed lock. Returns false when the lock client is unavailable.
33
+ */
34
+ const releaseLock = (key, token) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
35
+ const result = yield upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
36
+ const released = yield redis.eval(unlockScript, [key], [token]);
37
+ return Number(released) === 1;
38
+ }));
39
+ return result !== null && result !== void 0 ? result : false;
40
+ });
41
+ /**
42
+ * Run a function under a distributed lock. Returns null when the lock is unavailable.
43
+ */
44
+ const withLock = (key, ttlMs, fn) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
45
+ const token = yield acquireLock(key, ttlMs);
46
+ if (!token) {
47
+ return null;
48
+ }
49
+ try {
50
+ return yield fn();
51
+ }
52
+ finally {
53
+ yield releaseLock(key, token);
54
+ }
55
+ });
56
+
57
+ exports.acquireLock = acquireLock;
58
+ exports.releaseLock = releaseLock;
59
+ exports.withLock = withLock;
@@ -0,0 +1,55 @@
1
+ import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
2
+ import { withRedis } from '../upstash-config.mjs';
3
+
4
+ const unlockScript = `
5
+ if redis.call("get", KEYS[1]) == ARGV[1] then
6
+ return redis.call("del", KEYS[1])
7
+ else
8
+ return 0
9
+ end
10
+ `;
11
+ const generateToken = () => {
12
+ try {
13
+ return crypto.randomUUID();
14
+ }
15
+ catch (_a) {
16
+ return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
17
+ }
18
+ };
19
+ /**
20
+ * Acquire a distributed lock. Returns the lock token or null when unavailable.
21
+ */
22
+ const acquireLock = (key, ttlMs) => __awaiter(void 0, void 0, void 0, function* () {
23
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
24
+ const token = generateToken();
25
+ const result = yield redis.set(key, token, { nx: true, px: ttlMs });
26
+ return result === 'OK' ? token : null;
27
+ }));
28
+ });
29
+ /**
30
+ * Release a distributed lock. Returns false when the lock client is unavailable.
31
+ */
32
+ const releaseLock = (key, token) => __awaiter(void 0, void 0, void 0, function* () {
33
+ const result = yield withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
34
+ const released = yield redis.eval(unlockScript, [key], [token]);
35
+ return Number(released) === 1;
36
+ }));
37
+ return result !== null && result !== void 0 ? result : false;
38
+ });
39
+ /**
40
+ * Run a function under a distributed lock. Returns null when the lock is unavailable.
41
+ */
42
+ const withLock = (key, ttlMs, fn) => __awaiter(void 0, void 0, void 0, function* () {
43
+ const token = yield acquireLock(key, ttlMs);
44
+ if (!token) {
45
+ return null;
46
+ }
47
+ try {
48
+ return yield fn();
49
+ }
50
+ finally {
51
+ yield releaseLock(key, token);
52
+ }
53
+ });
54
+
55
+ export { acquireLock, releaseLock, withLock };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Set a plain string value with optional TTL (seconds).
3
+ */
4
+ export declare const setString: (key: string, value: string, ttlSec?: number) => Promise<boolean>;
5
+ /**
6
+ * Get a plain string value. Returns null if Redis is unavailable or key missing.
7
+ */
8
+ export declare const getString: (key: string) => Promise<string | null>;
9
+ /**
10
+ * Store an object as JSON string with optional TTL (seconds).
11
+ */
12
+ export declare const setJson: <T>(key: string, value: T, ttlSec?: number) => Promise<boolean>;
13
+ /**
14
+ * Get an object stored as JSON string. Returns null if missing or invalid JSON.
15
+ */
16
+ export declare const getJson: <T>(key: string) => Promise<T | null>;
17
+ /**
18
+ * Delete a key. Returns false if Redis is unavailable.
19
+ */
20
+ export declare const deleteKey: (key: string) => Promise<boolean>;
21
+ /**
22
+ * Set a hash field value.
23
+ */
24
+ export declare const setHashField: (key: string, field: string, value: string) => Promise<boolean>;
25
+ /**
26
+ * Get a hash field value.
27
+ */
28
+ export declare const getHashField: (key: string, field: string) => Promise<string | null>;
29
+ /**
30
+ * Store a hash field as JSON string.
31
+ */
32
+ export declare const setHashJson: <T>(key: string, field: string, value: T) => Promise<boolean>;
33
+ /**
34
+ * Get a hash field stored as JSON string.
35
+ */
36
+ export declare const getHashJson: <T>(key: string, field: string) => Promise<T | null>;
37
+ /**
38
+ * Get all hash fields.
39
+ */
40
+ export declare const getHashAll: (key: string) => Promise<Record<string, string> | null>;
41
+ /**
42
+ * Remove a hash field.
43
+ */
44
+ export declare const deleteHashField: (key: string, field: string) => Promise<boolean>;
45
+ type ListDirection = 'left' | 'right';
46
+ /**
47
+ * Push values to a list. Returns list length or null if Redis is unavailable.
48
+ */
49
+ export declare const pushList: (key: string, values: string[], direction?: ListDirection) => Promise<number | null>;
50
+ /**
51
+ * Pop a value from a list.
52
+ */
53
+ export declare const popList: (key: string, direction?: ListDirection) => Promise<string | null>;
54
+ /**
55
+ * Get a range from a list.
56
+ */
57
+ export declare const rangeList: (key: string, start?: number, stop?: number) => Promise<string[] | null>;
58
+ /**
59
+ * Get list length.
60
+ */
61
+ export declare const listLength: (key: string) => Promise<number | null>;
62
+ export {};
63
+ //# sourceMappingURL=redis-structures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-structures.d.ts","sourceRoot":"","sources":["../../../src/lib/upstash/redis-structures.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,SAAS,GACpB,KAAK,MAAM,EACX,OAAO,MAAM,EACb,SAAS,MAAM,KACd,OAAO,CAAC,OAAO,CAUjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAElE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAAU,CAAC,EAC7B,KAAK,MAAM,EACX,OAAO,CAAC,EACR,SAAS,MAAM,KACd,OAAO,CAAC,OAAO,CAWjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAAU,CAAC,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAa9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,OAAO,CAM5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAM7F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAEpF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EACjC,KAAK,MAAM,EACX,OAAO,MAAM,EACb,OAAO,CAAC,KACP,OAAO,CAAC,OAAO,CAOjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAAE,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAajF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAKnF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAMjF,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,QAAQ,GACnB,KAAK,MAAM,EACX,QAAQ,MAAM,EAAE,EAChB,YAAW,aAAuB,KACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAUvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAClB,KAAK,MAAM,EACX,YAAW,aAAuB,KACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAIvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GACpB,KAAK,MAAM,EACX,cAAS,EACT,aAAS,KACR,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAEnE,CAAC"}
@@ -0,0 +1,175 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js');
4
+ var upstashConfig = require('../upstash-config.js');
5
+
6
+ /**
7
+ * Set a plain string value with optional TTL (seconds).
8
+ */
9
+ const setString = (key, value, ttlSec) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
10
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
11
+ if (ttlSec && ttlSec > 0) {
12
+ yield redis.set(key, value, { ex: ttlSec });
13
+ return true;
14
+ }
15
+ yield redis.set(key, value);
16
+ return true;
17
+ })).then((result) => result !== null && result !== void 0 ? result : false);
18
+ });
19
+ /**
20
+ * Get a plain string value. Returns null if Redis is unavailable or key missing.
21
+ */
22
+ const getString = (key) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
23
+ return upstashConfig.withRedis((redis) => redis.get(key));
24
+ });
25
+ /**
26
+ * Store an object as JSON string with optional TTL (seconds).
27
+ */
28
+ const setJson = (key, value, ttlSec) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
29
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
30
+ const payload = JSON.stringify(value);
31
+ if (ttlSec && ttlSec > 0) {
32
+ yield redis.set(key, payload, { ex: ttlSec });
33
+ return true;
34
+ }
35
+ yield redis.set(key, payload);
36
+ return true;
37
+ })).then((result) => result !== null && result !== void 0 ? result : false);
38
+ });
39
+ /**
40
+ * Get an object stored as JSON string. Returns null if missing or invalid JSON.
41
+ */
42
+ const getJson = (key) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
43
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
44
+ const payload = yield redis.get(key);
45
+ if (!payload) {
46
+ return null;
47
+ }
48
+ try {
49
+ return JSON.parse(payload);
50
+ }
51
+ catch (_a) {
52
+ return null;
53
+ }
54
+ }));
55
+ });
56
+ /**
57
+ * Delete a key. Returns false if Redis is unavailable.
58
+ */
59
+ const deleteKey = (key) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
60
+ const result = yield upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
61
+ const deleted = yield redis.del(key);
62
+ return deleted > 0;
63
+ }));
64
+ return result !== null && result !== void 0 ? result : false;
65
+ });
66
+ /**
67
+ * Set a hash field value.
68
+ */
69
+ const setHashField = (key, field, value) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
70
+ const result = yield upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
71
+ const changed = yield redis.hset(key, { [field]: value });
72
+ return changed > 0;
73
+ }));
74
+ return result !== null && result !== void 0 ? result : false;
75
+ });
76
+ /**
77
+ * Get a hash field value.
78
+ */
79
+ const getHashField = (key, field) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
80
+ return upstashConfig.withRedis((redis) => redis.hget(key, field));
81
+ });
82
+ /**
83
+ * Store a hash field as JSON string.
84
+ */
85
+ const setHashJson = (key, field, value) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
86
+ const result = yield upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
87
+ const payload = JSON.stringify(value);
88
+ const changed = yield redis.hset(key, { [field]: payload });
89
+ return changed > 0;
90
+ }));
91
+ return result !== null && result !== void 0 ? result : false;
92
+ });
93
+ /**
94
+ * Get a hash field stored as JSON string.
95
+ */
96
+ const getHashJson = (key, field) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
97
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
98
+ const payload = yield redis.hget(key, field);
99
+ if (!payload) {
100
+ return null;
101
+ }
102
+ try {
103
+ return JSON.parse(payload);
104
+ }
105
+ catch (_a) {
106
+ return null;
107
+ }
108
+ }));
109
+ });
110
+ /**
111
+ * Get all hash fields.
112
+ */
113
+ const getHashAll = (key) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
114
+ return upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
115
+ const result = yield redis.hgetall(key);
116
+ return result !== null && result !== void 0 ? result : {};
117
+ }));
118
+ });
119
+ /**
120
+ * Remove a hash field.
121
+ */
122
+ const deleteHashField = (key, field) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
123
+ const result = yield upstashConfig.withRedis((redis) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
124
+ const removed = yield redis.hdel(key, field);
125
+ return removed > 0;
126
+ }));
127
+ return result !== null && result !== void 0 ? result : false;
128
+ });
129
+ /**
130
+ * Push values to a list. Returns list length or null if Redis is unavailable.
131
+ */
132
+ const pushList = (key_1, values_1, ...args_1) => tslib_es6.__awaiter(void 0, [key_1, values_1, ...args_1], void 0, function* (key, values, direction = 'right') {
133
+ return upstashConfig.withRedis((redis) => {
134
+ if (values.length === 0) {
135
+ return redis.llen(key);
136
+ }
137
+ return direction === 'left'
138
+ ? redis.lpush(key, ...values)
139
+ : redis.rpush(key, ...values);
140
+ });
141
+ });
142
+ /**
143
+ * Pop a value from a list.
144
+ */
145
+ const popList = (key_1, ...args_1) => tslib_es6.__awaiter(void 0, [key_1, ...args_1], void 0, function* (key, direction = 'right') {
146
+ return upstashConfig.withRedis((redis) => direction === 'left' ? redis.lpop(key) : redis.rpop(key));
147
+ });
148
+ /**
149
+ * Get a range from a list.
150
+ */
151
+ const rangeList = (key_1, ...args_1) => tslib_es6.__awaiter(void 0, [key_1, ...args_1], void 0, function* (key, start = 0, stop = -1) {
152
+ return upstashConfig.withRedis((redis) => redis.lrange(key, start, stop));
153
+ });
154
+ /**
155
+ * Get list length.
156
+ */
157
+ const listLength = (key) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
158
+ return upstashConfig.withRedis((redis) => redis.llen(key));
159
+ });
160
+
161
+ exports.deleteHashField = deleteHashField;
162
+ exports.deleteKey = deleteKey;
163
+ exports.getHashAll = getHashAll;
164
+ exports.getHashField = getHashField;
165
+ exports.getHashJson = getHashJson;
166
+ exports.getJson = getJson;
167
+ exports.getString = getString;
168
+ exports.listLength = listLength;
169
+ exports.popList = popList;
170
+ exports.pushList = pushList;
171
+ exports.rangeList = rangeList;
172
+ exports.setHashField = setHashField;
173
+ exports.setHashJson = setHashJson;
174
+ exports.setJson = setJson;
175
+ exports.setString = setString;
@@ -0,0 +1,159 @@
1
+ import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
2
+ import { withRedis } from '../upstash-config.mjs';
3
+
4
+ /**
5
+ * Set a plain string value with optional TTL (seconds).
6
+ */
7
+ const setString = (key, value, ttlSec) => __awaiter(void 0, void 0, void 0, function* () {
8
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
9
+ if (ttlSec && ttlSec > 0) {
10
+ yield redis.set(key, value, { ex: ttlSec });
11
+ return true;
12
+ }
13
+ yield redis.set(key, value);
14
+ return true;
15
+ })).then((result) => result !== null && result !== void 0 ? result : false);
16
+ });
17
+ /**
18
+ * Get a plain string value. Returns null if Redis is unavailable or key missing.
19
+ */
20
+ const getString = (key) => __awaiter(void 0, void 0, void 0, function* () {
21
+ return withRedis((redis) => redis.get(key));
22
+ });
23
+ /**
24
+ * Store an object as JSON string with optional TTL (seconds).
25
+ */
26
+ const setJson = (key, value, ttlSec) => __awaiter(void 0, void 0, void 0, function* () {
27
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
28
+ const payload = JSON.stringify(value);
29
+ if (ttlSec && ttlSec > 0) {
30
+ yield redis.set(key, payload, { ex: ttlSec });
31
+ return true;
32
+ }
33
+ yield redis.set(key, payload);
34
+ return true;
35
+ })).then((result) => result !== null && result !== void 0 ? result : false);
36
+ });
37
+ /**
38
+ * Get an object stored as JSON string. Returns null if missing or invalid JSON.
39
+ */
40
+ const getJson = (key) => __awaiter(void 0, void 0, void 0, function* () {
41
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
42
+ const payload = yield redis.get(key);
43
+ if (!payload) {
44
+ return null;
45
+ }
46
+ try {
47
+ return JSON.parse(payload);
48
+ }
49
+ catch (_a) {
50
+ return null;
51
+ }
52
+ }));
53
+ });
54
+ /**
55
+ * Delete a key. Returns false if Redis is unavailable.
56
+ */
57
+ const deleteKey = (key) => __awaiter(void 0, void 0, void 0, function* () {
58
+ const result = yield withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
59
+ const deleted = yield redis.del(key);
60
+ return deleted > 0;
61
+ }));
62
+ return result !== null && result !== void 0 ? result : false;
63
+ });
64
+ /**
65
+ * Set a hash field value.
66
+ */
67
+ const setHashField = (key, field, value) => __awaiter(void 0, void 0, void 0, function* () {
68
+ const result = yield withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
69
+ const changed = yield redis.hset(key, { [field]: value });
70
+ return changed > 0;
71
+ }));
72
+ return result !== null && result !== void 0 ? result : false;
73
+ });
74
+ /**
75
+ * Get a hash field value.
76
+ */
77
+ const getHashField = (key, field) => __awaiter(void 0, void 0, void 0, function* () {
78
+ return withRedis((redis) => redis.hget(key, field));
79
+ });
80
+ /**
81
+ * Store a hash field as JSON string.
82
+ */
83
+ const setHashJson = (key, field, value) => __awaiter(void 0, void 0, void 0, function* () {
84
+ const result = yield withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
85
+ const payload = JSON.stringify(value);
86
+ const changed = yield redis.hset(key, { [field]: payload });
87
+ return changed > 0;
88
+ }));
89
+ return result !== null && result !== void 0 ? result : false;
90
+ });
91
+ /**
92
+ * Get a hash field stored as JSON string.
93
+ */
94
+ const getHashJson = (key, field) => __awaiter(void 0, void 0, void 0, function* () {
95
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
96
+ const payload = yield redis.hget(key, field);
97
+ if (!payload) {
98
+ return null;
99
+ }
100
+ try {
101
+ return JSON.parse(payload);
102
+ }
103
+ catch (_a) {
104
+ return null;
105
+ }
106
+ }));
107
+ });
108
+ /**
109
+ * Get all hash fields.
110
+ */
111
+ const getHashAll = (key) => __awaiter(void 0, void 0, void 0, function* () {
112
+ return withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
113
+ const result = yield redis.hgetall(key);
114
+ return result !== null && result !== void 0 ? result : {};
115
+ }));
116
+ });
117
+ /**
118
+ * Remove a hash field.
119
+ */
120
+ const deleteHashField = (key, field) => __awaiter(void 0, void 0, void 0, function* () {
121
+ const result = yield withRedis((redis) => __awaiter(void 0, void 0, void 0, function* () {
122
+ const removed = yield redis.hdel(key, field);
123
+ return removed > 0;
124
+ }));
125
+ return result !== null && result !== void 0 ? result : false;
126
+ });
127
+ /**
128
+ * Push values to a list. Returns list length or null if Redis is unavailable.
129
+ */
130
+ const pushList = (key_1, values_1, ...args_1) => __awaiter(void 0, [key_1, values_1, ...args_1], void 0, function* (key, values, direction = 'right') {
131
+ return withRedis((redis) => {
132
+ if (values.length === 0) {
133
+ return redis.llen(key);
134
+ }
135
+ return direction === 'left'
136
+ ? redis.lpush(key, ...values)
137
+ : redis.rpush(key, ...values);
138
+ });
139
+ });
140
+ /**
141
+ * Pop a value from a list.
142
+ */
143
+ const popList = (key_1, ...args_1) => __awaiter(void 0, [key_1, ...args_1], void 0, function* (key, direction = 'right') {
144
+ return withRedis((redis) => direction === 'left' ? redis.lpop(key) : redis.rpop(key));
145
+ });
146
+ /**
147
+ * Get a range from a list.
148
+ */
149
+ const rangeList = (key_1, ...args_1) => __awaiter(void 0, [key_1, ...args_1], void 0, function* (key, start = 0, stop = -1) {
150
+ return withRedis((redis) => redis.lrange(key, start, stop));
151
+ });
152
+ /**
153
+ * Get list length.
154
+ */
155
+ const listLength = (key) => __awaiter(void 0, void 0, void 0, function* () {
156
+ return withRedis((redis) => redis.llen(key));
157
+ });
158
+
159
+ export { deleteHashField, deleteKey, getHashAll, getHashField, getHashJson, getJson, getString, listLength, popList, pushList, rangeList, setHashField, setHashJson, setJson, setString };
@@ -0,0 +1,19 @@
1
+ import { Redis } from '@upstash/redis';
2
+ import { Client as QstashClient } from '@upstash/qstash';
3
+ /**
4
+ * Get the Upstash Redis client. Returns null when required env vars are missing/invalid.
5
+ *
6
+ * Singleton semantics:
7
+ * - read-through cached instance only
8
+ */
9
+ export declare const getRedis: () => Redis | null;
10
+ /**
11
+ * Get the Upstash QStash client. Returns null when required env vars are missing.
12
+ *
13
+ * Singleton semantics:
14
+ * - read-through cached instance only
15
+ */
16
+ export declare const getQstash: () => QstashClient | null;
17
+ export declare const withRedis: <T>(fn: (redis: Redis) => Promise<T> | T) => Promise<T | null>;
18
+ export declare const withQstash: <T>(fn: (qstash: QstashClient) => Promise<T> | T) => Promise<T | null>;
19
+ //# sourceMappingURL=upstash-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstash-config.d.ts","sourceRoot":"","sources":["../../src/lib/upstash-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAoIzD;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAO,KAAK,GAAG,IAEnC,CAAC;AAsDF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,QAAO,YAAY,GAAG,IAE3C,CAAC;AAyCF,eAAO,MAAM,SAAS,GAAU,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAMzF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,CAAC,EAChC,IAAI,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,KAC3C,OAAO,CAAC,CAAC,GAAG,IAAI,CAMlB,CAAC"}