@windrun-huaiin/backend-core 11.0.3 → 13.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.
- package/dist/_virtual/_commonjs-dynamic-modules.js +7 -0
- package/dist/_virtual/_commonjs-dynamic-modules.mjs +5 -0
- package/dist/_virtual/_commonjsHelpers.js +10 -0
- package/dist/_virtual/_commonjsHelpers.mjs +7 -0
- package/dist/_virtual/aes.js +5 -0
- package/dist/_virtual/aes.mjs +3 -0
- package/dist/_virtual/blowfish.js +5 -0
- package/dist/_virtual/blowfish.mjs +3 -0
- package/dist/_virtual/cipher-core.js +5 -0
- package/dist/_virtual/cipher-core.mjs +3 -0
- package/dist/_virtual/core.js +5 -0
- package/dist/_virtual/core.mjs +3 -0
- package/dist/_virtual/enc-base64.js +5 -0
- package/dist/_virtual/enc-base64.mjs +3 -0
- package/dist/_virtual/enc-base64url.js +5 -0
- package/dist/_virtual/enc-base64url.mjs +3 -0
- package/dist/_virtual/enc-utf16.js +5 -0
- package/dist/_virtual/enc-utf16.mjs +3 -0
- package/dist/_virtual/evpkdf.js +5 -0
- package/dist/_virtual/evpkdf.mjs +3 -0
- package/dist/_virtual/format-hex.js +5 -0
- package/dist/_virtual/format-hex.mjs +3 -0
- package/dist/_virtual/hmac.js +5 -0
- package/dist/_virtual/hmac.mjs +3 -0
- package/dist/_virtual/index.js +7 -0
- package/dist/_virtual/index.mjs +5 -0
- package/dist/_virtual/index2.js +9 -0
- package/dist/_virtual/index2.mjs +7 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/index3.mjs +3 -0
- package/dist/_virtual/lib-typedarrays.js +5 -0
- package/dist/_virtual/lib-typedarrays.mjs +3 -0
- package/dist/_virtual/md5.js +5 -0
- package/dist/_virtual/md5.mjs +3 -0
- package/dist/_virtual/mode-cfb.js +5 -0
- package/dist/_virtual/mode-cfb.mjs +3 -0
- package/dist/_virtual/mode-ctr-gladman.js +5 -0
- package/dist/_virtual/mode-ctr-gladman.mjs +3 -0
- package/dist/_virtual/mode-ctr.js +5 -0
- package/dist/_virtual/mode-ctr.mjs +3 -0
- package/dist/_virtual/mode-ecb.js +5 -0
- package/dist/_virtual/mode-ecb.mjs +3 -0
- package/dist/_virtual/mode-ofb.js +5 -0
- package/dist/_virtual/mode-ofb.mjs +3 -0
- package/dist/_virtual/pad-ansix923.js +5 -0
- package/dist/_virtual/pad-ansix923.mjs +3 -0
- package/dist/_virtual/pad-iso10126.js +5 -0
- package/dist/_virtual/pad-iso10126.mjs +3 -0
- package/dist/_virtual/pad-iso97971.js +5 -0
- package/dist/_virtual/pad-iso97971.mjs +3 -0
- package/dist/_virtual/pad-nopadding.js +5 -0
- package/dist/_virtual/pad-nopadding.mjs +3 -0
- package/dist/_virtual/pad-zeropadding.js +5 -0
- package/dist/_virtual/pad-zeropadding.mjs +3 -0
- package/dist/_virtual/pbkdf2.js +5 -0
- package/dist/_virtual/pbkdf2.mjs +3 -0
- package/dist/_virtual/rabbit-legacy.js +5 -0
- package/dist/_virtual/rabbit-legacy.mjs +3 -0
- package/dist/_virtual/rabbit.js +5 -0
- package/dist/_virtual/rabbit.mjs +3 -0
- package/dist/_virtual/rc4.js +5 -0
- package/dist/_virtual/rc4.mjs +3 -0
- package/dist/_virtual/ripemd160.js +5 -0
- package/dist/_virtual/ripemd160.mjs +3 -0
- package/dist/_virtual/sha1.js +5 -0
- package/dist/_virtual/sha1.mjs +3 -0
- package/dist/_virtual/sha224.js +5 -0
- package/dist/_virtual/sha224.mjs +3 -0
- package/dist/_virtual/sha256.js +5 -0
- package/dist/_virtual/sha256.mjs +3 -0
- package/dist/_virtual/sha3.js +5 -0
- package/dist/_virtual/sha3.mjs +3 -0
- package/dist/_virtual/sha384.js +5 -0
- package/dist/_virtual/sha384.mjs +3 -0
- package/dist/_virtual/sha512.js +5 -0
- package/dist/_virtual/sha512.mjs +3 -0
- package/dist/_virtual/tripledes.js +5 -0
- package/dist/_virtual/tripledes.mjs +3 -0
- package/dist/_virtual/x64-core.js +5 -0
- package/dist/_virtual/x64-core.mjs +3 -0
- package/dist/index.js +46 -0
- package/dist/index.mjs +7 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +46 -0
- package/dist/lib/index.mjs +7 -0
- package/dist/lib/upstash/index.d.ts +7 -0
- package/dist/lib/upstash/index.d.ts.map +1 -0
- package/dist/lib/upstash/qstash.d.ts +36 -0
- package/dist/lib/upstash/qstash.d.ts.map +1 -0
- package/dist/lib/upstash/qstash.js +130 -0
- package/dist/lib/upstash/qstash.mjs +124 -0
- package/dist/lib/upstash/redis-counter.d.ts +17 -0
- package/dist/lib/upstash/redis-counter.d.ts.map +1 -0
- package/dist/lib/upstash/redis-counter.js +55 -0
- package/dist/lib/upstash/redis-counter.mjs +50 -0
- package/dist/lib/upstash/redis-favorite.d.ts +21 -0
- package/dist/lib/upstash/redis-favorite.d.ts.map +1 -0
- package/dist/lib/upstash/redis-favorite.js +74 -0
- package/dist/lib/upstash/redis-favorite.mjs +68 -0
- package/dist/lib/upstash/redis-like.d.ts +21 -0
- package/dist/lib/upstash/redis-like.d.ts.map +1 -0
- package/dist/lib/upstash/redis-like.js +74 -0
- package/dist/lib/upstash/redis-like.mjs +68 -0
- package/dist/lib/upstash/redis-lock.d.ts +13 -0
- package/dist/lib/upstash/redis-lock.d.ts.map +1 -0
- package/dist/lib/upstash/redis-lock.js +75 -0
- package/dist/lib/upstash/redis-lock.mjs +71 -0
- package/dist/lib/upstash/redis-structures.d.ts +63 -0
- package/dist/lib/upstash/redis-structures.d.ts.map +1 -0
- package/dist/lib/upstash/redis-structures.js +211 -0
- package/dist/lib/upstash/redis-structures.mjs +195 -0
- package/dist/lib/upstash-config.d.ts +11 -0
- package/dist/lib/upstash-config.d.ts.map +1 -0
- package/dist/lib/upstash-config.js +53 -0
- package/dist/lib/upstash-config.mjs +50 -0
- package/dist/node_modules/.pnpm/@upstash_lock@0.2.1_typescript@5.9.3/node_modules/@upstash/lock/dist/index.js +191 -0
- package/dist/node_modules/.pnpm/@upstash_lock@0.2.1_typescript@5.9.3/node_modules/@upstash/lock/dist/index.mjs +189 -0
- package/dist/node_modules/.pnpm/@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.js +1419 -0
- package/dist/node_modules/.pnpm/@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.mjs +1403 -0
- package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/chunk-LLI2WIYN.js +4691 -0
- package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/chunk-LLI2WIYN.mjs +4686 -0
- package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/nodejs.js +115 -0
- package/dist/node_modules/.pnpm/@upstash_redis@1.36.1/node_modules/@upstash/redis/nodejs.mjs +113 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js +248 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.mjs +246 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.js +485 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.mjs +483 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.js +906 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.mjs +904 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js +818 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.mjs +816 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.js +146 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.mjs +144 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.js +158 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.mjs +156 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.js +159 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.mjs +157 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.js +146 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.mjs +144 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.js +77 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.mjs +75 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.js +153 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.mjs +151 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.js +62 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.mjs +60 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.js +86 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.mjs +84 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.js +278 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.mjs +276 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.js +91 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.mjs +89 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.js +127 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.mjs +125 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.js +69 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.mjs +67 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js +51 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.mjs +49 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.js +65 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.mjs +63 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.js +60 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.mjs +58 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.js +55 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.mjs +53 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.js +51 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.mjs +49 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.js +41 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.mjs +39 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.js +58 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.mjs +56 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.js +157 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.mjs +155 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.js +204 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.mjs +202 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.js +206 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.mjs +204 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.js +153 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.mjs +151 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.js +277 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.mjs +275 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.js +160 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.mjs +158 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.js +91 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.mjs +89 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.js +209 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.mjs +207 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.js +337 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.mjs +335 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.js +95 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.mjs +93 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.js +337 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.mjs +335 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.js +793 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.mjs +791 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.js +314 -0
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.mjs +312 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.js +26 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.mjs +24 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.js +127 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.mjs +125 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.js +20 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.mjs +18 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.js +31 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.mjs +29 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.js +18 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.mjs +14 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.js +82 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.mjs +80 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.js +103 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.mjs +101 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.js +5 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.mjs +3 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.js +38 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.mjs +33 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.js +25 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.mjs +23 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js +21 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.mjs +16 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.js +20 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.mjs +18 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.js +109 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.mjs +107 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.js +59 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.mjs +57 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.js +14 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.mjs +12 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.js +38 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.mjs +36 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js +15 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.mjs +13 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.js +21 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.mjs +19 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.js +28 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.mjs +26 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.js +58 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.mjs +56 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.js +33 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.mjs +31 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.js +18 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.mjs +16 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.js +15 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.mjs +10 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.js +26 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.mjs +5 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.js +12 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.mjs +10 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.js +113 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.mjs +111 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.js +40 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.mjs +19 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.js +52 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.mjs +31 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.js +32 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.mjs +7 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.js +69 -0
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.mjs +60 -0
- package/dist/node_modules/.pnpm/neverthrow@7.2.0/node_modules/neverthrow/dist/index.es.js +422 -0
- package/dist/node_modules/.pnpm/neverthrow@7.2.0/node_modules/neverthrow/dist/index.es.mjs +415 -0
- package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.web.js +6 -0
- package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.web.mjs +4 -0
- package/package.json +14 -11
- package/src/lib/index.ts +2 -0
- package/src/lib/upstash/index.ts +6 -0
- package/src/lib/upstash/qstash.ts +157 -0
- package/src/lib/upstash/redis-counter.ts +51 -0
- package/src/lib/upstash/redis-favorite.ts +75 -0
- package/src/lib/upstash/redis-like.ts +75 -0
- package/src/lib/upstash/redis-lock.ts +85 -0
- package/src/lib/upstash/redis-structures.ts +249 -0
- package/src/lib/upstash-config.ts +54 -0
package/dist/lib/index.js
CHANGED
|
@@ -6,6 +6,13 @@ var fingerprintConfig = require('./fingerprint-config.js');
|
|
|
6
6
|
var creditInit = require('./credit-init.js');
|
|
7
7
|
var stripeConfig = require('./stripe-config.js');
|
|
8
8
|
var authUtils = require('./auth-utils.js');
|
|
9
|
+
var upstashConfig = require('./upstash-config.js');
|
|
10
|
+
var redisLock = require('./upstash/redis-lock.js');
|
|
11
|
+
var redisLike = require('./upstash/redis-like.js');
|
|
12
|
+
var redisFavorite = require('./upstash/redis-favorite.js');
|
|
13
|
+
var redisCounter = require('./upstash/redis-counter.js');
|
|
14
|
+
var redisStructures = require('./upstash/redis-structures.js');
|
|
15
|
+
var qstash = require('./upstash/qstash.js');
|
|
9
16
|
|
|
10
17
|
|
|
11
18
|
|
|
@@ -33,3 +40,42 @@ exports.ApiAuthUtils = authUtils.ApiAuthUtils;
|
|
|
33
40
|
exports.getAuthenticatedUser = authUtils.getAuthenticatedUser;
|
|
34
41
|
exports.requireAuth = authUtils.requireAuth;
|
|
35
42
|
exports.requireAuthWithUser = authUtils.requireAuthWithUser;
|
|
43
|
+
exports.getQstash = upstashConfig.getQstash;
|
|
44
|
+
exports.getRedis = upstashConfig.getRedis;
|
|
45
|
+
exports.acquireLock = redisLock.acquireLock;
|
|
46
|
+
exports.releaseLock = redisLock.releaseLock;
|
|
47
|
+
exports.withLock = redisLock.withLock;
|
|
48
|
+
exports.getTargetLikeCount = redisLike.getTargetLikeCount;
|
|
49
|
+
exports.getUserLikedTargets = redisLike.getUserLikedTargets;
|
|
50
|
+
exports.isTargetLiked = redisLike.isTargetLiked;
|
|
51
|
+
exports.likeTarget = redisLike.likeTarget;
|
|
52
|
+
exports.unlikeTarget = redisLike.unlikeTarget;
|
|
53
|
+
exports.addFavorite = redisFavorite.addFavorite;
|
|
54
|
+
exports.getFavoriteCount = redisFavorite.getFavoriteCount;
|
|
55
|
+
exports.getUserFavorites = redisFavorite.getUserFavorites;
|
|
56
|
+
exports.isFavorited = redisFavorite.isFavorited;
|
|
57
|
+
exports.removeFavorite = redisFavorite.removeFavorite;
|
|
58
|
+
exports.getCounter = redisCounter.getCounter;
|
|
59
|
+
exports.getUniqueCounter = redisCounter.getUniqueCounter;
|
|
60
|
+
exports.incrCounter = redisCounter.incrCounter;
|
|
61
|
+
exports.incrUniqueCounter = redisCounter.incrUniqueCounter;
|
|
62
|
+
exports.deleteHashField = redisStructures.deleteHashField;
|
|
63
|
+
exports.deleteKey = redisStructures.deleteKey;
|
|
64
|
+
exports.getHashAll = redisStructures.getHashAll;
|
|
65
|
+
exports.getHashField = redisStructures.getHashField;
|
|
66
|
+
exports.getHashJson = redisStructures.getHashJson;
|
|
67
|
+
exports.getJson = redisStructures.getJson;
|
|
68
|
+
exports.getString = redisStructures.getString;
|
|
69
|
+
exports.listLength = redisStructures.listLength;
|
|
70
|
+
exports.popList = redisStructures.popList;
|
|
71
|
+
exports.pushList = redisStructures.pushList;
|
|
72
|
+
exports.rangeList = redisStructures.rangeList;
|
|
73
|
+
exports.setHashField = redisStructures.setHashField;
|
|
74
|
+
exports.setHashJson = redisStructures.setHashJson;
|
|
75
|
+
exports.setJson = redisStructures.setJson;
|
|
76
|
+
exports.setString = redisStructures.setString;
|
|
77
|
+
exports.cancelSchedule = qstash.cancelSchedule;
|
|
78
|
+
exports.publishDelayedMessage = qstash.publishDelayedMessage;
|
|
79
|
+
exports.publishMessage = qstash.publishMessage;
|
|
80
|
+
exports.scheduleMessage = qstash.scheduleMessage;
|
|
81
|
+
exports.verifyQstashSignature = qstash.verifyQstashSignature;
|
package/dist/lib/index.mjs
CHANGED
|
@@ -4,3 +4,10 @@ export { fingerprintConfig } from './fingerprint-config.mjs';
|
|
|
4
4
|
export { creditsConfig, freeAmount, freeExpiredDays, freeRegisterAmount, oneTimeExpiredDays } from './credit-init.mjs';
|
|
5
5
|
export { ActiveSubscriptionExistsError, cancelSubscription, createCheckoutSession, createCustomerPortalSession, createOrGetCustomer, fetchPaymentId, stripe, updateSubscription, validateStripeWebhook } from './stripe-config.mjs';
|
|
6
6
|
export { ApiAuthUtils, getAuthenticatedUser, requireAuth, requireAuthWithUser } from './auth-utils.mjs';
|
|
7
|
+
export { getQstash, getRedis } from './upstash-config.mjs';
|
|
8
|
+
export { acquireLock, releaseLock, withLock } from './upstash/redis-lock.mjs';
|
|
9
|
+
export { getTargetLikeCount, getUserLikedTargets, isTargetLiked, likeTarget, unlikeTarget } from './upstash/redis-like.mjs';
|
|
10
|
+
export { addFavorite, getFavoriteCount, getUserFavorites, isFavorited, removeFavorite } from './upstash/redis-favorite.mjs';
|
|
11
|
+
export { getCounter, getUniqueCounter, incrCounter, incrUniqueCounter } from './upstash/redis-counter.mjs';
|
|
12
|
+
export { deleteHashField, deleteKey, getHashAll, getHashField, getHashJson, getJson, getString, listLength, popList, pushList, rangeList, setHashField, setHashJson, setJson, setString } from './upstash/redis-structures.mjs';
|
|
13
|
+
export { cancelSchedule, publishDelayedMessage, publishMessage, scheduleMessage, verifyQstashSignature } from './upstash/qstash.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/upstash/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type PublishBody = Record<string, unknown> | string | number | boolean | null;
|
|
2
|
+
export interface PublishMessageOptions {
|
|
3
|
+
url: string;
|
|
4
|
+
body: PublishBody;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Publish a message. Returns message id or null if QStash is unavailable.
|
|
8
|
+
*/
|
|
9
|
+
export declare const publishMessage: (options: PublishMessageOptions) => Promise<string | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Publish a delayed message. Returns message id or null if QStash is unavailable.
|
|
12
|
+
*/
|
|
13
|
+
export declare const publishDelayedMessage: (options: PublishMessageOptions & {
|
|
14
|
+
delaySec: number;
|
|
15
|
+
}) => Promise<string | null>;
|
|
16
|
+
export interface ScheduleMessageOptions extends PublishMessageOptions {
|
|
17
|
+
cron: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Schedule a recurring message. Returns schedule id or null if QStash is unavailable.
|
|
21
|
+
*/
|
|
22
|
+
export declare const scheduleMessage: (options: ScheduleMessageOptions) => Promise<string | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Cancel a scheduled message. Returns false if QStash is unavailable.
|
|
25
|
+
*/
|
|
26
|
+
export declare const cancelSchedule: (scheduleId: string) => Promise<boolean>;
|
|
27
|
+
export interface VerifyQstashOptions {
|
|
28
|
+
signature: string;
|
|
29
|
+
body: string;
|
|
30
|
+
url: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Verify QStash signature. Throws on failure in non-dev environments.
|
|
34
|
+
*/
|
|
35
|
+
export declare const verifyQstashSignature: (options: VerifyQstashOptions) => Promise<boolean>;
|
|
36
|
+
//# sourceMappingURL=qstash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qstash.d.ts","sourceRoot":"","sources":["../../../src/lib/upstash/qstash.ts"],"names":[],"mappings":"AAkCA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAErF,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,GAAU,SAAS,qBAAqB,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAW1F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,qBAAqB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,KACpD,OAAO,CAAC,MAAM,GAAG,IAAI,CAYvB,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,sBAAsB,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAoB5F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAU,YAAY,MAAM,KAAG,OAAO,CAAC,OAAO,CAgBxE,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAU,SAAS,mBAAmB,KAAG,OAAO,CAAC,OAAO,CAqBzF,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
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 chunkRQPZUJXG = require('../../node_modules/.pnpm/@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.js');
|
|
5
|
+
var upstashConfig = require('../upstash-config.js');
|
|
6
|
+
|
|
7
|
+
let cachedReceiver = null;
|
|
8
|
+
let receiverInitAttempted = false;
|
|
9
|
+
const isTruthy = (value) => value === '1' || value === 'true' || value === 'TRUE';
|
|
10
|
+
const shouldSkipVerify = () => process.env.NODE_ENV === 'development' && isTruthy(process.env.SKIP_UPSTASH_QSTASH_VERIFY);
|
|
11
|
+
const getReceiver = () => {
|
|
12
|
+
if (cachedReceiver) {
|
|
13
|
+
return cachedReceiver;
|
|
14
|
+
}
|
|
15
|
+
if (receiverInitAttempted) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
receiverInitAttempted = true;
|
|
19
|
+
const currentSigningKey = process.env.QSTASH_CURRENT_SIGNING_KEY;
|
|
20
|
+
const nextSigningKey = process.env.QSTASH_NEXT_SIGNING_KEY;
|
|
21
|
+
if (!currentSigningKey || !nextSigningKey) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
cachedReceiver = new chunkRQPZUJXG.Receiver({
|
|
25
|
+
currentSigningKey,
|
|
26
|
+
nextSigningKey,
|
|
27
|
+
});
|
|
28
|
+
return cachedReceiver;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Publish a message. Returns message id or null if QStash is unavailable.
|
|
32
|
+
*/
|
|
33
|
+
const publishMessage = (options) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
var _a;
|
|
35
|
+
const client = upstashConfig.getQstash();
|
|
36
|
+
if (!client) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const result = yield client.publishJSON({
|
|
40
|
+
url: options.url,
|
|
41
|
+
body: options.body,
|
|
42
|
+
});
|
|
43
|
+
return typeof result === 'string' ? result : (_a = result === null || result === void 0 ? void 0 : result.messageId) !== null && _a !== void 0 ? _a : null;
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Publish a delayed message. Returns message id or null if QStash is unavailable.
|
|
47
|
+
*/
|
|
48
|
+
const publishDelayedMessage = (options) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const client = upstashConfig.getQstash();
|
|
51
|
+
if (!client) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const result = yield client.publishJSON({
|
|
55
|
+
url: options.url,
|
|
56
|
+
body: options.body,
|
|
57
|
+
delay: options.delaySec,
|
|
58
|
+
});
|
|
59
|
+
return typeof result === 'string' ? result : (_a = result === null || result === void 0 ? void 0 : result.messageId) !== null && _a !== void 0 ? _a : null;
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Schedule a recurring message. Returns schedule id or null if QStash is unavailable.
|
|
63
|
+
*/
|
|
64
|
+
const scheduleMessage = (options) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
var _a, _b, _c, _d, _e, _f;
|
|
66
|
+
const client = upstashConfig.getQstash();
|
|
67
|
+
if (!client) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const anyClient = client;
|
|
71
|
+
const result = (_c = (yield ((_b = (_a = anyClient.schedules) === null || _a === void 0 ? void 0 : _a.create) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
72
|
+
url: options.url,
|
|
73
|
+
body: options.body,
|
|
74
|
+
cron: options.cron,
|
|
75
|
+
})))) !== null && _c !== void 0 ? _c : (yield ((_d = anyClient.publishJSON) === null || _d === void 0 ? void 0 : _d.call(anyClient, {
|
|
76
|
+
url: options.url,
|
|
77
|
+
body: options.body,
|
|
78
|
+
cron: options.cron,
|
|
79
|
+
})));
|
|
80
|
+
return typeof result === 'string' ? result : (_f = (_e = result === null || result === void 0 ? void 0 : result.scheduleId) !== null && _e !== void 0 ? _e : result === null || result === void 0 ? void 0 : result.id) !== null && _f !== void 0 ? _f : null;
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* Cancel a scheduled message. Returns false if QStash is unavailable.
|
|
84
|
+
*/
|
|
85
|
+
const cancelSchedule = (scheduleId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const client = upstashConfig.getQstash();
|
|
88
|
+
if (!client) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const anyClient = client;
|
|
92
|
+
if ((_a = anyClient.schedules) === null || _a === void 0 ? void 0 : _a.delete) {
|
|
93
|
+
yield anyClient.schedules.delete(scheduleId);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
if ((_b = anyClient.schedules) === null || _b === void 0 ? void 0 : _b.remove) {
|
|
97
|
+
yield anyClient.schedules.remove(scheduleId);
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* Verify QStash signature. Throws on failure in non-dev environments.
|
|
104
|
+
*/
|
|
105
|
+
const verifyQstashSignature = (options) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
+
var _a;
|
|
107
|
+
if (shouldSkipVerify()) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
const receiver = getReceiver();
|
|
111
|
+
if (!receiver) {
|
|
112
|
+
throw new Error('QStash signing keys are missing');
|
|
113
|
+
}
|
|
114
|
+
const verifier = (_a = receiver.verify) !== null && _a !== void 0 ? _a : receiver.verifySignature;
|
|
115
|
+
if (!verifier) {
|
|
116
|
+
throw new Error('QStash receiver verify method is unavailable');
|
|
117
|
+
}
|
|
118
|
+
yield verifier.call(receiver, {
|
|
119
|
+
signature: options.signature,
|
|
120
|
+
body: options.body,
|
|
121
|
+
url: options.url,
|
|
122
|
+
});
|
|
123
|
+
return true;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
exports.cancelSchedule = cancelSchedule;
|
|
127
|
+
exports.publishDelayedMessage = publishDelayedMessage;
|
|
128
|
+
exports.publishMessage = publishMessage;
|
|
129
|
+
exports.scheduleMessage = scheduleMessage;
|
|
130
|
+
exports.verifyQstashSignature = verifyQstashSignature;
|
|
@@ -0,0 +1,124 @@
|
|
|
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 { Receiver } from '../../node_modules/.pnpm/@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.mjs';
|
|
3
|
+
import { getQstash } from '../upstash-config.mjs';
|
|
4
|
+
|
|
5
|
+
let cachedReceiver = null;
|
|
6
|
+
let receiverInitAttempted = false;
|
|
7
|
+
const isTruthy = (value) => value === '1' || value === 'true' || value === 'TRUE';
|
|
8
|
+
const shouldSkipVerify = () => process.env.NODE_ENV === 'development' && isTruthy(process.env.SKIP_UPSTASH_QSTASH_VERIFY);
|
|
9
|
+
const getReceiver = () => {
|
|
10
|
+
if (cachedReceiver) {
|
|
11
|
+
return cachedReceiver;
|
|
12
|
+
}
|
|
13
|
+
if (receiverInitAttempted) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
receiverInitAttempted = true;
|
|
17
|
+
const currentSigningKey = process.env.QSTASH_CURRENT_SIGNING_KEY;
|
|
18
|
+
const nextSigningKey = process.env.QSTASH_NEXT_SIGNING_KEY;
|
|
19
|
+
if (!currentSigningKey || !nextSigningKey) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
cachedReceiver = new Receiver({
|
|
23
|
+
currentSigningKey,
|
|
24
|
+
nextSigningKey,
|
|
25
|
+
});
|
|
26
|
+
return cachedReceiver;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Publish a message. Returns message id or null if QStash is unavailable.
|
|
30
|
+
*/
|
|
31
|
+
const publishMessage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
var _a;
|
|
33
|
+
const client = getQstash();
|
|
34
|
+
if (!client) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const result = yield client.publishJSON({
|
|
38
|
+
url: options.url,
|
|
39
|
+
body: options.body,
|
|
40
|
+
});
|
|
41
|
+
return typeof result === 'string' ? result : (_a = result === null || result === void 0 ? void 0 : result.messageId) !== null && _a !== void 0 ? _a : null;
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Publish a delayed message. Returns message id or null if QStash is unavailable.
|
|
45
|
+
*/
|
|
46
|
+
const publishDelayedMessage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
var _a;
|
|
48
|
+
const client = getQstash();
|
|
49
|
+
if (!client) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const result = yield client.publishJSON({
|
|
53
|
+
url: options.url,
|
|
54
|
+
body: options.body,
|
|
55
|
+
delay: options.delaySec,
|
|
56
|
+
});
|
|
57
|
+
return typeof result === 'string' ? result : (_a = result === null || result === void 0 ? void 0 : result.messageId) !== null && _a !== void 0 ? _a : null;
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Schedule a recurring message. Returns schedule id or null if QStash is unavailable.
|
|
61
|
+
*/
|
|
62
|
+
const scheduleMessage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
|
+
const client = getQstash();
|
|
65
|
+
if (!client) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const anyClient = client;
|
|
69
|
+
const result = (_c = (yield ((_b = (_a = anyClient.schedules) === null || _a === void 0 ? void 0 : _a.create) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
70
|
+
url: options.url,
|
|
71
|
+
body: options.body,
|
|
72
|
+
cron: options.cron,
|
|
73
|
+
})))) !== null && _c !== void 0 ? _c : (yield ((_d = anyClient.publishJSON) === null || _d === void 0 ? void 0 : _d.call(anyClient, {
|
|
74
|
+
url: options.url,
|
|
75
|
+
body: options.body,
|
|
76
|
+
cron: options.cron,
|
|
77
|
+
})));
|
|
78
|
+
return typeof result === 'string' ? result : (_f = (_e = result === null || result === void 0 ? void 0 : result.scheduleId) !== null && _e !== void 0 ? _e : result === null || result === void 0 ? void 0 : result.id) !== null && _f !== void 0 ? _f : null;
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Cancel a scheduled message. Returns false if QStash is unavailable.
|
|
82
|
+
*/
|
|
83
|
+
const cancelSchedule = (scheduleId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
const client = getQstash();
|
|
86
|
+
if (!client) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const anyClient = client;
|
|
90
|
+
if ((_a = anyClient.schedules) === null || _a === void 0 ? void 0 : _a.delete) {
|
|
91
|
+
yield anyClient.schedules.delete(scheduleId);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if ((_b = anyClient.schedules) === null || _b === void 0 ? void 0 : _b.remove) {
|
|
95
|
+
yield anyClient.schedules.remove(scheduleId);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Verify QStash signature. Throws on failure in non-dev environments.
|
|
102
|
+
*/
|
|
103
|
+
const verifyQstashSignature = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
104
|
+
var _a;
|
|
105
|
+
if (shouldSkipVerify()) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
const receiver = getReceiver();
|
|
109
|
+
if (!receiver) {
|
|
110
|
+
throw new Error('QStash signing keys are missing');
|
|
111
|
+
}
|
|
112
|
+
const verifier = (_a = receiver.verify) !== null && _a !== void 0 ? _a : receiver.verifySignature;
|
|
113
|
+
if (!verifier) {
|
|
114
|
+
throw new Error('QStash receiver verify method is unavailable');
|
|
115
|
+
}
|
|
116
|
+
yield verifier.call(receiver, {
|
|
117
|
+
signature: options.signature,
|
|
118
|
+
body: options.body,
|
|
119
|
+
url: options.url,
|
|
120
|
+
});
|
|
121
|
+
return true;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export { cancelSchedule, publishDelayedMessage, publishMessage, scheduleMessage, verifyQstashSignature };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Increment a counter (e.g. views, forwards). Returns null if Redis is unavailable.
|
|
3
|
+
*/
|
|
4
|
+
export declare const incrCounter: (key: string, delta?: number) => Promise<number | null>;
|
|
5
|
+
/**
|
|
6
|
+
* Get a counter value. Returns null if Redis is unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getCounter: (key: string) => Promise<number | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Increment a unique counter via SET (e.g. unique views). Returns null if Redis is unavailable.
|
|
11
|
+
*/
|
|
12
|
+
export declare const incrUniqueCounter: (setKey: string, memberId: string) => Promise<number | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Get unique counter value (SET cardinality). Returns null if Redis is unavailable.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getUniqueCounter: (setKey: string) => Promise<number | null>;
|
|
17
|
+
//# sourceMappingURL=redis-counter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-counter.d.ts","sourceRoot":"","sources":["../../../src/lib/upstash/redis-counter.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,KAAK,MAAM,EAAE,cAAS,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAM/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAOnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAU,QAAQ,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAW/F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAM5E,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
* Increment a counter (e.g. views, forwards). Returns null if Redis is unavailable.
|
|
8
|
+
*/
|
|
9
|
+
const incrCounter = (key_1, ...args_1) => tslib_es6.__awaiter(void 0, [key_1, ...args_1], void 0, function* (key, delta = 1) {
|
|
10
|
+
const redis = upstashConfig.getRedis();
|
|
11
|
+
if (!redis) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return redis.incrby(key, delta);
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Get a counter value. Returns null if Redis is unavailable.
|
|
18
|
+
*/
|
|
19
|
+
const getCounter = (key) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const redis = upstashConfig.getRedis();
|
|
21
|
+
if (!redis) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const value = yield redis.get(key);
|
|
25
|
+
return value !== null && value !== void 0 ? value : 0;
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Increment a unique counter via SET (e.g. unique views). Returns null if Redis is unavailable.
|
|
29
|
+
*/
|
|
30
|
+
const incrUniqueCounter = (setKey, memberId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const redis = upstashConfig.getRedis();
|
|
32
|
+
if (!redis) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const added = yield redis.sadd(setKey, memberId);
|
|
36
|
+
if (added === 1) {
|
|
37
|
+
return redis.scard(setKey);
|
|
38
|
+
}
|
|
39
|
+
return redis.scard(setKey);
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Get unique counter value (SET cardinality). Returns null if Redis is unavailable.
|
|
43
|
+
*/
|
|
44
|
+
const getUniqueCounter = (setKey) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
const redis = upstashConfig.getRedis();
|
|
46
|
+
if (!redis) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return redis.scard(setKey);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
exports.getCounter = getCounter;
|
|
53
|
+
exports.getUniqueCounter = getUniqueCounter;
|
|
54
|
+
exports.incrCounter = incrCounter;
|
|
55
|
+
exports.incrUniqueCounter = incrUniqueCounter;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { getRedis } from '../upstash-config.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Increment a counter (e.g. views, forwards). Returns null if Redis is unavailable.
|
|
6
|
+
*/
|
|
7
|
+
const incrCounter = (key_1, ...args_1) => __awaiter(void 0, [key_1, ...args_1], void 0, function* (key, delta = 1) {
|
|
8
|
+
const redis = getRedis();
|
|
9
|
+
if (!redis) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return redis.incrby(key, delta);
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Get a counter value. Returns null if Redis is unavailable.
|
|
16
|
+
*/
|
|
17
|
+
const getCounter = (key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const redis = getRedis();
|
|
19
|
+
if (!redis) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const value = yield redis.get(key);
|
|
23
|
+
return value !== null && value !== void 0 ? value : 0;
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Increment a unique counter via SET (e.g. unique views). Returns null if Redis is unavailable.
|
|
27
|
+
*/
|
|
28
|
+
const incrUniqueCounter = (setKey, memberId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const redis = getRedis();
|
|
30
|
+
if (!redis) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const added = yield redis.sadd(setKey, memberId);
|
|
34
|
+
if (added === 1) {
|
|
35
|
+
return redis.scard(setKey);
|
|
36
|
+
}
|
|
37
|
+
return redis.scard(setKey);
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Get unique counter value (SET cardinality). Returns null if Redis is unavailable.
|
|
41
|
+
*/
|
|
42
|
+
const getUniqueCounter = (setKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
const redis = getRedis();
|
|
44
|
+
if (!redis) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return redis.scard(setKey);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { getCounter, getUniqueCounter, incrCounter, incrUniqueCounter };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Favorite a target. Returns true if added, false if already favorited, null if Redis is unavailable.
|
|
3
|
+
*/
|
|
4
|
+
export declare const addFavorite: (targetId: string, userId: string) => Promise<boolean | null>;
|
|
5
|
+
/**
|
|
6
|
+
* Remove a favorite. Returns true if removed, false if not found, null if Redis is unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare const removeFavorite: (targetId: string, userId: string) => Promise<boolean | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Check whether a user has favorited a target. Returns null if Redis is unavailable.
|
|
11
|
+
*/
|
|
12
|
+
export declare const isFavorited: (targetId: string, userId: string) => Promise<boolean | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Get favorite count for a target. Returns null if Redis is unavailable.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getFavoriteCount: (targetId: string) => Promise<number | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Get target ids favorited by a user. Returns null if Redis is unavailable.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getUserFavorites: (userId: string) => Promise<string[] | null>;
|
|
21
|
+
//# sourceMappingURL=redis-favorite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-favorite.d.ts","sourceRoot":"","sources":["../../../src/lib/upstash/redis-favorite.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,UAAU,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAY1F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAU,UAAU,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAY7F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,UAAU,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAQ1F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAO9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAO9E,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 favoriteTargetKey = (targetId) => `favorite:target:${targetId}`;
|
|
7
|
+
const favoriteUserKey = (userId) => `favorite:user:${userId}`;
|
|
8
|
+
/**
|
|
9
|
+
* Favorite a target. Returns true if added, false if already favorited, null if Redis is unavailable.
|
|
10
|
+
*/
|
|
11
|
+
const addFavorite = (targetId, userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
const redis = upstashConfig.getRedis();
|
|
13
|
+
if (!redis) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const added = yield redis.sadd(favoriteTargetKey(targetId), userId);
|
|
17
|
+
if (added === 1) {
|
|
18
|
+
yield redis.sadd(favoriteUserKey(userId), targetId);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Remove a favorite. Returns true if removed, false if not found, null if Redis is unavailable.
|
|
25
|
+
*/
|
|
26
|
+
const removeFavorite = (targetId, userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
const redis = upstashConfig.getRedis();
|
|
28
|
+
if (!redis) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const removed = yield redis.srem(favoriteTargetKey(targetId), userId);
|
|
32
|
+
if (removed === 1) {
|
|
33
|
+
yield redis.srem(favoriteUserKey(userId), targetId);
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Check whether a user has favorited a target. Returns null if Redis is unavailable.
|
|
40
|
+
*/
|
|
41
|
+
const isFavorited = (targetId, userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
const redis = upstashConfig.getRedis();
|
|
43
|
+
if (!redis) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const result = yield redis.sismember(favoriteTargetKey(targetId), userId);
|
|
47
|
+
return result === 1;
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Get favorite count for a target. Returns null if Redis is unavailable.
|
|
51
|
+
*/
|
|
52
|
+
const getFavoriteCount = (targetId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
const redis = upstashConfig.getRedis();
|
|
54
|
+
if (!redis) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return redis.scard(favoriteTargetKey(targetId));
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Get target ids favorited by a user. Returns null if Redis is unavailable.
|
|
61
|
+
*/
|
|
62
|
+
const getUserFavorites = (userId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
+
const redis = upstashConfig.getRedis();
|
|
64
|
+
if (!redis) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return redis.smembers(favoriteUserKey(userId));
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
exports.addFavorite = addFavorite;
|
|
71
|
+
exports.getFavoriteCount = getFavoriteCount;
|
|
72
|
+
exports.getUserFavorites = getUserFavorites;
|
|
73
|
+
exports.isFavorited = isFavorited;
|
|
74
|
+
exports.removeFavorite = removeFavorite;
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { getRedis } from '../upstash-config.mjs';
|
|
3
|
+
|
|
4
|
+
const favoriteTargetKey = (targetId) => `favorite:target:${targetId}`;
|
|
5
|
+
const favoriteUserKey = (userId) => `favorite:user:${userId}`;
|
|
6
|
+
/**
|
|
7
|
+
* Favorite a target. Returns true if added, false if already favorited, null if Redis is unavailable.
|
|
8
|
+
*/
|
|
9
|
+
const addFavorite = (targetId, userId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
10
|
+
const redis = getRedis();
|
|
11
|
+
if (!redis) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const added = yield redis.sadd(favoriteTargetKey(targetId), userId);
|
|
15
|
+
if (added === 1) {
|
|
16
|
+
yield redis.sadd(favoriteUserKey(userId), targetId);
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Remove a favorite. Returns true if removed, false if not found, null if Redis is unavailable.
|
|
23
|
+
*/
|
|
24
|
+
const removeFavorite = (targetId, userId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
const redis = getRedis();
|
|
26
|
+
if (!redis) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const removed = yield redis.srem(favoriteTargetKey(targetId), userId);
|
|
30
|
+
if (removed === 1) {
|
|
31
|
+
yield redis.srem(favoriteUserKey(userId), targetId);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Check whether a user has favorited a target. Returns null if Redis is unavailable.
|
|
38
|
+
*/
|
|
39
|
+
const isFavorited = (targetId, userId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const redis = getRedis();
|
|
41
|
+
if (!redis) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const result = yield redis.sismember(favoriteTargetKey(targetId), userId);
|
|
45
|
+
return result === 1;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Get favorite count for a target. Returns null if Redis is unavailable.
|
|
49
|
+
*/
|
|
50
|
+
const getFavoriteCount = (targetId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
const redis = getRedis();
|
|
52
|
+
if (!redis) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return redis.scard(favoriteTargetKey(targetId));
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Get target ids favorited by a user. Returns null if Redis is unavailable.
|
|
59
|
+
*/
|
|
60
|
+
const getUserFavorites = (userId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
+
const redis = getRedis();
|
|
62
|
+
if (!redis) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return redis.smembers(favoriteUserKey(userId));
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export { addFavorite, getFavoriteCount, getUserFavorites, isFavorited, removeFavorite };
|