@windrun-huaiin/backend-core 12.0.0 → 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/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.mjs
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
function unusable(name, prop = 'algorithm.name') {
|
|
2
|
+
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
3
|
+
}
|
|
4
|
+
function isAlgorithm(algorithm, name) {
|
|
5
|
+
return algorithm.name === name;
|
|
6
|
+
}
|
|
7
|
+
function getHashLength(hash) {
|
|
8
|
+
return parseInt(hash.name.slice(4), 10);
|
|
9
|
+
}
|
|
10
|
+
function getNamedCurve(alg) {
|
|
11
|
+
switch (alg) {
|
|
12
|
+
case 'ES256':
|
|
13
|
+
return 'P-256';
|
|
14
|
+
case 'ES384':
|
|
15
|
+
return 'P-384';
|
|
16
|
+
case 'ES512':
|
|
17
|
+
return 'P-521';
|
|
18
|
+
default:
|
|
19
|
+
throw new Error('unreachable');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function checkUsage(key, usages) {
|
|
23
|
+
if (usages.length && !usages.some((expected) => key.usages.includes(expected))) {
|
|
24
|
+
let msg = 'CryptoKey does not support this operation, its usages must include ';
|
|
25
|
+
if (usages.length > 2) {
|
|
26
|
+
const last = usages.pop();
|
|
27
|
+
msg += `one of ${usages.join(', ')}, or ${last}.`;
|
|
28
|
+
}
|
|
29
|
+
else if (usages.length === 2) {
|
|
30
|
+
msg += `one of ${usages[0]} or ${usages[1]}.`;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
msg += `${usages[0]}.`;
|
|
34
|
+
}
|
|
35
|
+
throw new TypeError(msg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function checkSigCryptoKey(key, alg, ...usages) {
|
|
39
|
+
switch (alg) {
|
|
40
|
+
case 'HS256':
|
|
41
|
+
case 'HS384':
|
|
42
|
+
case 'HS512': {
|
|
43
|
+
if (!isAlgorithm(key.algorithm, 'HMAC'))
|
|
44
|
+
throw unusable('HMAC');
|
|
45
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
46
|
+
const actual = getHashLength(key.algorithm.hash);
|
|
47
|
+
if (actual !== expected)
|
|
48
|
+
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case 'RS256':
|
|
52
|
+
case 'RS384':
|
|
53
|
+
case 'RS512': {
|
|
54
|
+
if (!isAlgorithm(key.algorithm, 'RSASSA-PKCS1-v1_5'))
|
|
55
|
+
throw unusable('RSASSA-PKCS1-v1_5');
|
|
56
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
57
|
+
const actual = getHashLength(key.algorithm.hash);
|
|
58
|
+
if (actual !== expected)
|
|
59
|
+
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
case 'PS256':
|
|
63
|
+
case 'PS384':
|
|
64
|
+
case 'PS512': {
|
|
65
|
+
if (!isAlgorithm(key.algorithm, 'RSA-PSS'))
|
|
66
|
+
throw unusable('RSA-PSS');
|
|
67
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
68
|
+
const actual = getHashLength(key.algorithm.hash);
|
|
69
|
+
if (actual !== expected)
|
|
70
|
+
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'EdDSA': {
|
|
74
|
+
if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') {
|
|
75
|
+
throw unusable('Ed25519 or Ed448');
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
case 'Ed25519': {
|
|
80
|
+
if (!isAlgorithm(key.algorithm, 'Ed25519'))
|
|
81
|
+
throw unusable('Ed25519');
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'ES256':
|
|
85
|
+
case 'ES384':
|
|
86
|
+
case 'ES512': {
|
|
87
|
+
if (!isAlgorithm(key.algorithm, 'ECDSA'))
|
|
88
|
+
throw unusable('ECDSA');
|
|
89
|
+
const expected = getNamedCurve(alg);
|
|
90
|
+
const actual = key.algorithm.namedCurve;
|
|
91
|
+
if (actual !== expected)
|
|
92
|
+
throw unusable(expected, 'algorithm.namedCurve');
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
throw new TypeError('CryptoKey does not support this operation');
|
|
97
|
+
}
|
|
98
|
+
checkUsage(key, usages);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { checkSigCryptoKey };
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function message(msg, actual, ...types) {
|
|
6
|
+
types = types.filter(Boolean);
|
|
7
|
+
if (types.length > 2) {
|
|
8
|
+
const last = types.pop();
|
|
9
|
+
msg += `one of type ${types.join(', ')}, or ${last}.`;
|
|
10
|
+
}
|
|
11
|
+
else if (types.length === 2) {
|
|
12
|
+
msg += `one of type ${types[0]} or ${types[1]}.`;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
msg += `of type ${types[0]}.`;
|
|
16
|
+
}
|
|
17
|
+
if (actual == null) {
|
|
18
|
+
msg += ` Received ${actual}`;
|
|
19
|
+
}
|
|
20
|
+
else if (typeof actual === 'function' && actual.name) {
|
|
21
|
+
msg += ` Received function ${actual.name}`;
|
|
22
|
+
}
|
|
23
|
+
else if (typeof actual === 'object' && actual != null) {
|
|
24
|
+
if (actual.constructor?.name) {
|
|
25
|
+
msg += ` Received an instance of ${actual.constructor.name}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return msg;
|
|
29
|
+
}
|
|
30
|
+
var invalidKeyInput = (actual, ...types) => {
|
|
31
|
+
return message('Key must be ', actual, ...types);
|
|
32
|
+
};
|
|
33
|
+
function withAlg(alg, actual, ...types) {
|
|
34
|
+
return message(`Key for the ${alg} algorithm must be `, actual, ...types);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
exports.default = invalidKeyInput;
|
|
38
|
+
exports.withAlg = withAlg;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function message(msg, actual, ...types) {
|
|
2
|
+
types = types.filter(Boolean);
|
|
3
|
+
if (types.length > 2) {
|
|
4
|
+
const last = types.pop();
|
|
5
|
+
msg += `one of type ${types.join(', ')}, or ${last}.`;
|
|
6
|
+
}
|
|
7
|
+
else if (types.length === 2) {
|
|
8
|
+
msg += `one of type ${types[0]} or ${types[1]}.`;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
msg += `of type ${types[0]}.`;
|
|
12
|
+
}
|
|
13
|
+
if (actual == null) {
|
|
14
|
+
msg += ` Received ${actual}`;
|
|
15
|
+
}
|
|
16
|
+
else if (typeof actual === 'function' && actual.name) {
|
|
17
|
+
msg += ` Received function ${actual.name}`;
|
|
18
|
+
}
|
|
19
|
+
else if (typeof actual === 'object' && actual != null) {
|
|
20
|
+
if (actual.constructor?.name) {
|
|
21
|
+
msg += ` Received an instance of ${actual.constructor.name}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return msg;
|
|
25
|
+
}
|
|
26
|
+
var invalidKeyInput = (actual, ...types) => {
|
|
27
|
+
return message('Key must be ', actual, ...types);
|
|
28
|
+
};
|
|
29
|
+
function withAlg(alg, actual, ...types) {
|
|
30
|
+
return message(`Key for the ${alg} algorithm must be `, actual, ...types);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { invalidKeyInput as default, withAlg };
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const isDisjoint = (...headers) => {
|
|
4
|
+
const sources = headers.filter(Boolean);
|
|
5
|
+
if (sources.length === 0 || sources.length === 1) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
let acc;
|
|
9
|
+
for (const header of sources) {
|
|
10
|
+
const parameters = Object.keys(header);
|
|
11
|
+
if (!acc || acc.size === 0) {
|
|
12
|
+
acc = new Set(parameters);
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
for (const parameter of parameters) {
|
|
16
|
+
if (acc.has(parameter)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
acc.add(parameter);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
module.exports = isDisjoint;
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const isDisjoint = (...headers) => {
|
|
2
|
+
const sources = headers.filter(Boolean);
|
|
3
|
+
if (sources.length === 0 || sources.length === 1) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
let acc;
|
|
7
|
+
for (const header of sources) {
|
|
8
|
+
const parameters = Object.keys(header);
|
|
9
|
+
if (!acc || acc.size === 0) {
|
|
10
|
+
acc = new Set(parameters);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
for (const parameter of parameters) {
|
|
14
|
+
if (acc.has(parameter)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
acc.add(parameter);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { isDisjoint as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var is_object = require('./is_object.js');
|
|
4
|
+
|
|
5
|
+
function isJWK(key) {
|
|
6
|
+
return is_object(key) && typeof key.kty === 'string';
|
|
7
|
+
}
|
|
8
|
+
function isPrivateJWK(key) {
|
|
9
|
+
return key.kty !== 'oct' && typeof key.d === 'string';
|
|
10
|
+
}
|
|
11
|
+
function isPublicJWK(key) {
|
|
12
|
+
return key.kty !== 'oct' && typeof key.d === 'undefined';
|
|
13
|
+
}
|
|
14
|
+
function isSecretJWK(key) {
|
|
15
|
+
return isJWK(key) && key.kty === 'oct' && typeof key.k === 'string';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.isJWK = isJWK;
|
|
19
|
+
exports.isPrivateJWK = isPrivateJWK;
|
|
20
|
+
exports.isPublicJWK = isPublicJWK;
|
|
21
|
+
exports.isSecretJWK = isSecretJWK;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import isObject from './is_object.mjs';
|
|
2
|
+
|
|
3
|
+
function isJWK(key) {
|
|
4
|
+
return isObject(key) && typeof key.kty === 'string';
|
|
5
|
+
}
|
|
6
|
+
function isPrivateJWK(key) {
|
|
7
|
+
return key.kty !== 'oct' && typeof key.d === 'string';
|
|
8
|
+
}
|
|
9
|
+
function isPublicJWK(key) {
|
|
10
|
+
return key.kty !== 'oct' && typeof key.d === 'undefined';
|
|
11
|
+
}
|
|
12
|
+
function isSecretJWK(key) {
|
|
13
|
+
return isJWK(key) && key.kty === 'oct' && typeof key.k === 'string';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { isJWK, isPrivateJWK, isPublicJWK, isSecretJWK };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function isObjectLike(value) {
|
|
4
|
+
return typeof value === 'object' && value !== null;
|
|
5
|
+
}
|
|
6
|
+
function isObject(input) {
|
|
7
|
+
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (Object.getPrototypeOf(input) === null) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
let proto = input;
|
|
14
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
15
|
+
proto = Object.getPrototypeOf(proto);
|
|
16
|
+
}
|
|
17
|
+
return Object.getPrototypeOf(input) === proto;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = isObject;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function isObjectLike(value) {
|
|
2
|
+
return typeof value === 'object' && value !== null;
|
|
3
|
+
}
|
|
4
|
+
function isObject(input) {
|
|
5
|
+
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (Object.getPrototypeOf(input) === null) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
let proto = input;
|
|
12
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
13
|
+
proto = Object.getPrototypeOf(proto);
|
|
14
|
+
}
|
|
15
|
+
return Object.getPrototypeOf(input) === proto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { isObject as default };
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var errors = require('../util/errors.js');
|
|
4
|
+
var buffer_utils = require('./buffer_utils.js');
|
|
5
|
+
var epoch = require('./epoch.js');
|
|
6
|
+
var secs = require('./secs.js');
|
|
7
|
+
var is_object = require('./is_object.js');
|
|
8
|
+
|
|
9
|
+
const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '');
|
|
10
|
+
const checkAudiencePresence = (audPayload, audOption) => {
|
|
11
|
+
if (typeof audPayload === 'string') {
|
|
12
|
+
return audOption.includes(audPayload);
|
|
13
|
+
}
|
|
14
|
+
if (Array.isArray(audPayload)) {
|
|
15
|
+
return audOption.some(Set.prototype.has.bind(new Set(audPayload)));
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
var jwtPayload = (protectedHeader, encodedPayload, options = {}) => {
|
|
20
|
+
let payload;
|
|
21
|
+
try {
|
|
22
|
+
payload = JSON.parse(buffer_utils.decoder.decode(encodedPayload));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
}
|
|
26
|
+
if (!is_object(payload)) {
|
|
27
|
+
throw new errors.JWTInvalid('JWT Claims Set must be a top-level JSON object');
|
|
28
|
+
}
|
|
29
|
+
const { typ } = options;
|
|
30
|
+
if (typ &&
|
|
31
|
+
(typeof protectedHeader.typ !== 'string' ||
|
|
32
|
+
normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) {
|
|
33
|
+
throw new errors.JWTClaimValidationFailed('unexpected "typ" JWT header value', payload, 'typ', 'check_failed');
|
|
34
|
+
}
|
|
35
|
+
const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options;
|
|
36
|
+
const presenceCheck = [...requiredClaims];
|
|
37
|
+
if (maxTokenAge !== undefined)
|
|
38
|
+
presenceCheck.push('iat');
|
|
39
|
+
if (audience !== undefined)
|
|
40
|
+
presenceCheck.push('aud');
|
|
41
|
+
if (subject !== undefined)
|
|
42
|
+
presenceCheck.push('sub');
|
|
43
|
+
if (issuer !== undefined)
|
|
44
|
+
presenceCheck.push('iss');
|
|
45
|
+
for (const claim of new Set(presenceCheck.reverse())) {
|
|
46
|
+
if (!(claim in payload)) {
|
|
47
|
+
throw new errors.JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, 'missing');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (issuer &&
|
|
51
|
+
!(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
|
|
52
|
+
throw new errors.JWTClaimValidationFailed('unexpected "iss" claim value', payload, 'iss', 'check_failed');
|
|
53
|
+
}
|
|
54
|
+
if (subject && payload.sub !== subject) {
|
|
55
|
+
throw new errors.JWTClaimValidationFailed('unexpected "sub" claim value', payload, 'sub', 'check_failed');
|
|
56
|
+
}
|
|
57
|
+
if (audience &&
|
|
58
|
+
!checkAudiencePresence(payload.aud, typeof audience === 'string' ? [audience] : audience)) {
|
|
59
|
+
throw new errors.JWTClaimValidationFailed('unexpected "aud" claim value', payload, 'aud', 'check_failed');
|
|
60
|
+
}
|
|
61
|
+
let tolerance;
|
|
62
|
+
switch (typeof options.clockTolerance) {
|
|
63
|
+
case 'string':
|
|
64
|
+
tolerance = secs(options.clockTolerance);
|
|
65
|
+
break;
|
|
66
|
+
case 'number':
|
|
67
|
+
tolerance = options.clockTolerance;
|
|
68
|
+
break;
|
|
69
|
+
case 'undefined':
|
|
70
|
+
tolerance = 0;
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
throw new TypeError('Invalid clockTolerance option type');
|
|
74
|
+
}
|
|
75
|
+
const { currentDate } = options;
|
|
76
|
+
const now = epoch(currentDate || new Date());
|
|
77
|
+
if ((payload.iat !== undefined || maxTokenAge) && typeof payload.iat !== 'number') {
|
|
78
|
+
throw new errors.JWTClaimValidationFailed('"iat" claim must be a number', payload, 'iat', 'invalid');
|
|
79
|
+
}
|
|
80
|
+
if (payload.nbf !== undefined) {
|
|
81
|
+
if (typeof payload.nbf !== 'number') {
|
|
82
|
+
throw new errors.JWTClaimValidationFailed('"nbf" claim must be a number', payload, 'nbf', 'invalid');
|
|
83
|
+
}
|
|
84
|
+
if (payload.nbf > now + tolerance) {
|
|
85
|
+
throw new errors.JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload, 'nbf', 'check_failed');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (payload.exp !== undefined) {
|
|
89
|
+
if (typeof payload.exp !== 'number') {
|
|
90
|
+
throw new errors.JWTClaimValidationFailed('"exp" claim must be a number', payload, 'exp', 'invalid');
|
|
91
|
+
}
|
|
92
|
+
if (payload.exp <= now - tolerance) {
|
|
93
|
+
throw new errors.JWTExpired('"exp" claim timestamp check failed', payload, 'exp', 'check_failed');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (maxTokenAge) {
|
|
97
|
+
const age = now - payload.iat;
|
|
98
|
+
const max = typeof maxTokenAge === 'number' ? maxTokenAge : secs(maxTokenAge);
|
|
99
|
+
if (age - tolerance > max) {
|
|
100
|
+
throw new errors.JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload, 'iat', 'check_failed');
|
|
101
|
+
}
|
|
102
|
+
if (age < 0 - tolerance) {
|
|
103
|
+
throw new errors.JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload, 'iat', 'check_failed');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return payload;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
module.exports = jwtPayload;
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.mjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { JWTInvalid, JWTClaimValidationFailed, JWTExpired } from '../util/errors.mjs';
|
|
2
|
+
import { decoder } from './buffer_utils.mjs';
|
|
3
|
+
import epoch from './epoch.mjs';
|
|
4
|
+
import secs from './secs.mjs';
|
|
5
|
+
import isObject from './is_object.mjs';
|
|
6
|
+
|
|
7
|
+
const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '');
|
|
8
|
+
const checkAudiencePresence = (audPayload, audOption) => {
|
|
9
|
+
if (typeof audPayload === 'string') {
|
|
10
|
+
return audOption.includes(audPayload);
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(audPayload)) {
|
|
13
|
+
return audOption.some(Set.prototype.has.bind(new Set(audPayload)));
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
17
|
+
var jwtPayload = (protectedHeader, encodedPayload, options = {}) => {
|
|
18
|
+
let payload;
|
|
19
|
+
try {
|
|
20
|
+
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
}
|
|
24
|
+
if (!isObject(payload)) {
|
|
25
|
+
throw new JWTInvalid('JWT Claims Set must be a top-level JSON object');
|
|
26
|
+
}
|
|
27
|
+
const { typ } = options;
|
|
28
|
+
if (typ &&
|
|
29
|
+
(typeof protectedHeader.typ !== 'string' ||
|
|
30
|
+
normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) {
|
|
31
|
+
throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload, 'typ', 'check_failed');
|
|
32
|
+
}
|
|
33
|
+
const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options;
|
|
34
|
+
const presenceCheck = [...requiredClaims];
|
|
35
|
+
if (maxTokenAge !== undefined)
|
|
36
|
+
presenceCheck.push('iat');
|
|
37
|
+
if (audience !== undefined)
|
|
38
|
+
presenceCheck.push('aud');
|
|
39
|
+
if (subject !== undefined)
|
|
40
|
+
presenceCheck.push('sub');
|
|
41
|
+
if (issuer !== undefined)
|
|
42
|
+
presenceCheck.push('iss');
|
|
43
|
+
for (const claim of new Set(presenceCheck.reverse())) {
|
|
44
|
+
if (!(claim in payload)) {
|
|
45
|
+
throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, 'missing');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (issuer &&
|
|
49
|
+
!(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
|
|
50
|
+
throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, 'iss', 'check_failed');
|
|
51
|
+
}
|
|
52
|
+
if (subject && payload.sub !== subject) {
|
|
53
|
+
throw new JWTClaimValidationFailed('unexpected "sub" claim value', payload, 'sub', 'check_failed');
|
|
54
|
+
}
|
|
55
|
+
if (audience &&
|
|
56
|
+
!checkAudiencePresence(payload.aud, typeof audience === 'string' ? [audience] : audience)) {
|
|
57
|
+
throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload, 'aud', 'check_failed');
|
|
58
|
+
}
|
|
59
|
+
let tolerance;
|
|
60
|
+
switch (typeof options.clockTolerance) {
|
|
61
|
+
case 'string':
|
|
62
|
+
tolerance = secs(options.clockTolerance);
|
|
63
|
+
break;
|
|
64
|
+
case 'number':
|
|
65
|
+
tolerance = options.clockTolerance;
|
|
66
|
+
break;
|
|
67
|
+
case 'undefined':
|
|
68
|
+
tolerance = 0;
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
throw new TypeError('Invalid clockTolerance option type');
|
|
72
|
+
}
|
|
73
|
+
const { currentDate } = options;
|
|
74
|
+
const now = epoch(currentDate || new Date());
|
|
75
|
+
if ((payload.iat !== undefined || maxTokenAge) && typeof payload.iat !== 'number') {
|
|
76
|
+
throw new JWTClaimValidationFailed('"iat" claim must be a number', payload, 'iat', 'invalid');
|
|
77
|
+
}
|
|
78
|
+
if (payload.nbf !== undefined) {
|
|
79
|
+
if (typeof payload.nbf !== 'number') {
|
|
80
|
+
throw new JWTClaimValidationFailed('"nbf" claim must be a number', payload, 'nbf', 'invalid');
|
|
81
|
+
}
|
|
82
|
+
if (payload.nbf > now + tolerance) {
|
|
83
|
+
throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload, 'nbf', 'check_failed');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (payload.exp !== undefined) {
|
|
87
|
+
if (typeof payload.exp !== 'number') {
|
|
88
|
+
throw new JWTClaimValidationFailed('"exp" claim must be a number', payload, 'exp', 'invalid');
|
|
89
|
+
}
|
|
90
|
+
if (payload.exp <= now - tolerance) {
|
|
91
|
+
throw new JWTExpired('"exp" claim timestamp check failed', payload, 'exp', 'check_failed');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (maxTokenAge) {
|
|
95
|
+
const age = now - payload.iat;
|
|
96
|
+
const max = typeof maxTokenAge === 'number' ? maxTokenAge : secs(maxTokenAge);
|
|
97
|
+
if (age - tolerance > max) {
|
|
98
|
+
throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload, 'iat', 'check_failed');
|
|
99
|
+
}
|
|
100
|
+
if (age < 0 - tolerance) {
|
|
101
|
+
throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload, 'iat', 'check_failed');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return payload;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { jwtPayload as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const minute = 60;
|
|
4
|
+
const hour = minute * 60;
|
|
5
|
+
const day = hour * 24;
|
|
6
|
+
const week = day * 7;
|
|
7
|
+
const year = day * 365.25;
|
|
8
|
+
const REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
|
|
9
|
+
var secs = (str) => {
|
|
10
|
+
const matched = REGEX.exec(str);
|
|
11
|
+
if (!matched || (matched[4] && matched[1])) {
|
|
12
|
+
throw new TypeError('Invalid time period format');
|
|
13
|
+
}
|
|
14
|
+
const value = parseFloat(matched[2]);
|
|
15
|
+
const unit = matched[3].toLowerCase();
|
|
16
|
+
let numericDate;
|
|
17
|
+
switch (unit) {
|
|
18
|
+
case 'sec':
|
|
19
|
+
case 'secs':
|
|
20
|
+
case 'second':
|
|
21
|
+
case 'seconds':
|
|
22
|
+
case 's':
|
|
23
|
+
numericDate = Math.round(value);
|
|
24
|
+
break;
|
|
25
|
+
case 'minute':
|
|
26
|
+
case 'minutes':
|
|
27
|
+
case 'min':
|
|
28
|
+
case 'mins':
|
|
29
|
+
case 'm':
|
|
30
|
+
numericDate = Math.round(value * minute);
|
|
31
|
+
break;
|
|
32
|
+
case 'hour':
|
|
33
|
+
case 'hours':
|
|
34
|
+
case 'hr':
|
|
35
|
+
case 'hrs':
|
|
36
|
+
case 'h':
|
|
37
|
+
numericDate = Math.round(value * hour);
|
|
38
|
+
break;
|
|
39
|
+
case 'day':
|
|
40
|
+
case 'days':
|
|
41
|
+
case 'd':
|
|
42
|
+
numericDate = Math.round(value * day);
|
|
43
|
+
break;
|
|
44
|
+
case 'week':
|
|
45
|
+
case 'weeks':
|
|
46
|
+
case 'w':
|
|
47
|
+
numericDate = Math.round(value * week);
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
numericDate = Math.round(value * year);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
if (matched[1] === '-' || matched[4] === 'ago') {
|
|
54
|
+
return -numericDate;
|
|
55
|
+
}
|
|
56
|
+
return numericDate;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
module.exports = secs;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const minute = 60;
|
|
2
|
+
const hour = minute * 60;
|
|
3
|
+
const day = hour * 24;
|
|
4
|
+
const week = day * 7;
|
|
5
|
+
const year = day * 365.25;
|
|
6
|
+
const REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
|
|
7
|
+
var secs = (str) => {
|
|
8
|
+
const matched = REGEX.exec(str);
|
|
9
|
+
if (!matched || (matched[4] && matched[1])) {
|
|
10
|
+
throw new TypeError('Invalid time period format');
|
|
11
|
+
}
|
|
12
|
+
const value = parseFloat(matched[2]);
|
|
13
|
+
const unit = matched[3].toLowerCase();
|
|
14
|
+
let numericDate;
|
|
15
|
+
switch (unit) {
|
|
16
|
+
case 'sec':
|
|
17
|
+
case 'secs':
|
|
18
|
+
case 'second':
|
|
19
|
+
case 'seconds':
|
|
20
|
+
case 's':
|
|
21
|
+
numericDate = Math.round(value);
|
|
22
|
+
break;
|
|
23
|
+
case 'minute':
|
|
24
|
+
case 'minutes':
|
|
25
|
+
case 'min':
|
|
26
|
+
case 'mins':
|
|
27
|
+
case 'm':
|
|
28
|
+
numericDate = Math.round(value * minute);
|
|
29
|
+
break;
|
|
30
|
+
case 'hour':
|
|
31
|
+
case 'hours':
|
|
32
|
+
case 'hr':
|
|
33
|
+
case 'hrs':
|
|
34
|
+
case 'h':
|
|
35
|
+
numericDate = Math.round(value * hour);
|
|
36
|
+
break;
|
|
37
|
+
case 'day':
|
|
38
|
+
case 'days':
|
|
39
|
+
case 'd':
|
|
40
|
+
numericDate = Math.round(value * day);
|
|
41
|
+
break;
|
|
42
|
+
case 'week':
|
|
43
|
+
case 'weeks':
|
|
44
|
+
case 'w':
|
|
45
|
+
numericDate = Math.round(value * week);
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
numericDate = Math.round(value * year);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
if (matched[1] === '-' || matched[4] === 'ago') {
|
|
52
|
+
return -numericDate;
|
|
53
|
+
}
|
|
54
|
+
return numericDate;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { secs as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const validateAlgorithms = (option, algorithms) => {
|
|
4
|
+
if (algorithms !== undefined &&
|
|
5
|
+
(!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== 'string'))) {
|
|
6
|
+
throw new TypeError(`"${option}" option must be an array of strings`);
|
|
7
|
+
}
|
|
8
|
+
if (!algorithms) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return new Set(algorithms);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = validateAlgorithms;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const validateAlgorithms = (option, algorithms) => {
|
|
2
|
+
if (algorithms !== undefined &&
|
|
3
|
+
(!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== 'string'))) {
|
|
4
|
+
throw new TypeError(`"${option}" option must be an array of strings`);
|
|
5
|
+
}
|
|
6
|
+
if (!algorithms) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return new Set(algorithms);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { validateAlgorithms as default };
|