@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/jws/flattened/verify.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var base64url = require('../../runtime/base64url.js');
|
|
4
|
+
var verify = require('../../runtime/verify.js');
|
|
5
|
+
var errors = require('../../util/errors.js');
|
|
6
|
+
var buffer_utils = require('../../lib/buffer_utils.js');
|
|
7
|
+
var is_disjoint = require('../../lib/is_disjoint.js');
|
|
8
|
+
var is_object = require('../../lib/is_object.js');
|
|
9
|
+
var check_key_type = require('../../lib/check_key_type.js');
|
|
10
|
+
var validate_crit = require('../../lib/validate_crit.js');
|
|
11
|
+
var validate_algorithms = require('../../lib/validate_algorithms.js');
|
|
12
|
+
var is_jwk = require('../../lib/is_jwk.js');
|
|
13
|
+
var _import = require('../../key/import.js');
|
|
14
|
+
|
|
15
|
+
async function flattenedVerify(jws, key, options) {
|
|
16
|
+
if (!is_object(jws)) {
|
|
17
|
+
throw new errors.JWSInvalid('Flattened JWS must be an object');
|
|
18
|
+
}
|
|
19
|
+
if (jws.protected === undefined && jws.header === undefined) {
|
|
20
|
+
throw new errors.JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');
|
|
21
|
+
}
|
|
22
|
+
if (jws.protected !== undefined && typeof jws.protected !== 'string') {
|
|
23
|
+
throw new errors.JWSInvalid('JWS Protected Header incorrect type');
|
|
24
|
+
}
|
|
25
|
+
if (jws.payload === undefined) {
|
|
26
|
+
throw new errors.JWSInvalid('JWS Payload missing');
|
|
27
|
+
}
|
|
28
|
+
if (typeof jws.signature !== 'string') {
|
|
29
|
+
throw new errors.JWSInvalid('JWS Signature missing or incorrect type');
|
|
30
|
+
}
|
|
31
|
+
if (jws.header !== undefined && !is_object(jws.header)) {
|
|
32
|
+
throw new errors.JWSInvalid('JWS Unprotected Header incorrect type');
|
|
33
|
+
}
|
|
34
|
+
let parsedProt = {};
|
|
35
|
+
if (jws.protected) {
|
|
36
|
+
try {
|
|
37
|
+
const protectedHeader = base64url.decode(jws.protected);
|
|
38
|
+
parsedProt = JSON.parse(buffer_utils.decoder.decode(protectedHeader));
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
throw new errors.JWSInvalid('JWS Protected Header is invalid');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!is_disjoint(parsedProt, jws.header)) {
|
|
45
|
+
throw new errors.JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint');
|
|
46
|
+
}
|
|
47
|
+
const joseHeader = {
|
|
48
|
+
...parsedProt,
|
|
49
|
+
...jws.header,
|
|
50
|
+
};
|
|
51
|
+
const extensions = validate_crit(errors.JWSInvalid, new Map([['b64', true]]), options?.crit, parsedProt, joseHeader);
|
|
52
|
+
let b64 = true;
|
|
53
|
+
if (extensions.has('b64')) {
|
|
54
|
+
b64 = parsedProt.b64;
|
|
55
|
+
if (typeof b64 !== 'boolean') {
|
|
56
|
+
throw new errors.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const { alg } = joseHeader;
|
|
60
|
+
if (typeof alg !== 'string' || !alg) {
|
|
61
|
+
throw new errors.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
62
|
+
}
|
|
63
|
+
const algorithms = options && validate_algorithms('algorithms', options.algorithms);
|
|
64
|
+
if (algorithms && !algorithms.has(alg)) {
|
|
65
|
+
throw new errors.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
|
|
66
|
+
}
|
|
67
|
+
if (b64) {
|
|
68
|
+
if (typeof jws.payload !== 'string') {
|
|
69
|
+
throw new errors.JWSInvalid('JWS Payload must be a string');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (typeof jws.payload !== 'string' && !(jws.payload instanceof Uint8Array)) {
|
|
73
|
+
throw new errors.JWSInvalid('JWS Payload must be a string or an Uint8Array instance');
|
|
74
|
+
}
|
|
75
|
+
let resolvedKey = false;
|
|
76
|
+
if (typeof key === 'function') {
|
|
77
|
+
key = await key(parsedProt, jws);
|
|
78
|
+
resolvedKey = true;
|
|
79
|
+
check_key_type.checkKeyTypeWithJwk(alg, key, 'verify');
|
|
80
|
+
if (is_jwk.isJWK(key)) {
|
|
81
|
+
key = await _import.importJWK(key, alg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
check_key_type.checkKeyTypeWithJwk(alg, key, 'verify');
|
|
86
|
+
}
|
|
87
|
+
const data = buffer_utils.concat(buffer_utils.encoder.encode(jws.protected ?? ''), buffer_utils.encoder.encode('.'), typeof jws.payload === 'string' ? buffer_utils.encoder.encode(jws.payload) : jws.payload);
|
|
88
|
+
let signature;
|
|
89
|
+
try {
|
|
90
|
+
signature = base64url.decode(jws.signature);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
throw new errors.JWSInvalid('Failed to base64url decode the signature');
|
|
94
|
+
}
|
|
95
|
+
const verified = await verify(alg, key, signature, data);
|
|
96
|
+
if (!verified) {
|
|
97
|
+
throw new errors.JWSSignatureVerificationFailed();
|
|
98
|
+
}
|
|
99
|
+
let payload;
|
|
100
|
+
if (b64) {
|
|
101
|
+
try {
|
|
102
|
+
payload = base64url.decode(jws.payload);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
throw new errors.JWSInvalid('Failed to base64url decode the payload');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else if (typeof jws.payload === 'string') {
|
|
109
|
+
payload = buffer_utils.encoder.encode(jws.payload);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
payload = jws.payload;
|
|
113
|
+
}
|
|
114
|
+
const result = { payload };
|
|
115
|
+
if (jws.protected !== undefined) {
|
|
116
|
+
result.protectedHeader = parsedProt;
|
|
117
|
+
}
|
|
118
|
+
if (jws.header !== undefined) {
|
|
119
|
+
result.unprotectedHeader = jws.header;
|
|
120
|
+
}
|
|
121
|
+
if (resolvedKey) {
|
|
122
|
+
return { ...result, key };
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
exports.flattenedVerify = flattenedVerify;
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.mjs
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { decode } from '../../runtime/base64url.mjs';
|
|
2
|
+
import verify from '../../runtime/verify.mjs';
|
|
3
|
+
import { JWSInvalid, JOSEAlgNotAllowed, JWSSignatureVerificationFailed } from '../../util/errors.mjs';
|
|
4
|
+
import { decoder, concat, encoder } from '../../lib/buffer_utils.mjs';
|
|
5
|
+
import isDisjoint from '../../lib/is_disjoint.mjs';
|
|
6
|
+
import isObject from '../../lib/is_object.mjs';
|
|
7
|
+
import { checkKeyTypeWithJwk } from '../../lib/check_key_type.mjs';
|
|
8
|
+
import validateCrit from '../../lib/validate_crit.mjs';
|
|
9
|
+
import validateAlgorithms from '../../lib/validate_algorithms.mjs';
|
|
10
|
+
import { isJWK } from '../../lib/is_jwk.mjs';
|
|
11
|
+
import { importJWK } from '../../key/import.mjs';
|
|
12
|
+
|
|
13
|
+
async function flattenedVerify(jws, key, options) {
|
|
14
|
+
if (!isObject(jws)) {
|
|
15
|
+
throw new JWSInvalid('Flattened JWS must be an object');
|
|
16
|
+
}
|
|
17
|
+
if (jws.protected === undefined && jws.header === undefined) {
|
|
18
|
+
throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');
|
|
19
|
+
}
|
|
20
|
+
if (jws.protected !== undefined && typeof jws.protected !== 'string') {
|
|
21
|
+
throw new JWSInvalid('JWS Protected Header incorrect type');
|
|
22
|
+
}
|
|
23
|
+
if (jws.payload === undefined) {
|
|
24
|
+
throw new JWSInvalid('JWS Payload missing');
|
|
25
|
+
}
|
|
26
|
+
if (typeof jws.signature !== 'string') {
|
|
27
|
+
throw new JWSInvalid('JWS Signature missing or incorrect type');
|
|
28
|
+
}
|
|
29
|
+
if (jws.header !== undefined && !isObject(jws.header)) {
|
|
30
|
+
throw new JWSInvalid('JWS Unprotected Header incorrect type');
|
|
31
|
+
}
|
|
32
|
+
let parsedProt = {};
|
|
33
|
+
if (jws.protected) {
|
|
34
|
+
try {
|
|
35
|
+
const protectedHeader = decode(jws.protected);
|
|
36
|
+
parsedProt = JSON.parse(decoder.decode(protectedHeader));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
throw new JWSInvalid('JWS Protected Header is invalid');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (!isDisjoint(parsedProt, jws.header)) {
|
|
43
|
+
throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint');
|
|
44
|
+
}
|
|
45
|
+
const joseHeader = {
|
|
46
|
+
...parsedProt,
|
|
47
|
+
...jws.header,
|
|
48
|
+
};
|
|
49
|
+
const extensions = validateCrit(JWSInvalid, new Map([['b64', true]]), options?.crit, parsedProt, joseHeader);
|
|
50
|
+
let b64 = true;
|
|
51
|
+
if (extensions.has('b64')) {
|
|
52
|
+
b64 = parsedProt.b64;
|
|
53
|
+
if (typeof b64 !== 'boolean') {
|
|
54
|
+
throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const { alg } = joseHeader;
|
|
58
|
+
if (typeof alg !== 'string' || !alg) {
|
|
59
|
+
throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
60
|
+
}
|
|
61
|
+
const algorithms = options && validateAlgorithms('algorithms', options.algorithms);
|
|
62
|
+
if (algorithms && !algorithms.has(alg)) {
|
|
63
|
+
throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
|
|
64
|
+
}
|
|
65
|
+
if (b64) {
|
|
66
|
+
if (typeof jws.payload !== 'string') {
|
|
67
|
+
throw new JWSInvalid('JWS Payload must be a string');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else if (typeof jws.payload !== 'string' && !(jws.payload instanceof Uint8Array)) {
|
|
71
|
+
throw new JWSInvalid('JWS Payload must be a string or an Uint8Array instance');
|
|
72
|
+
}
|
|
73
|
+
let resolvedKey = false;
|
|
74
|
+
if (typeof key === 'function') {
|
|
75
|
+
key = await key(parsedProt, jws);
|
|
76
|
+
resolvedKey = true;
|
|
77
|
+
checkKeyTypeWithJwk(alg, key, 'verify');
|
|
78
|
+
if (isJWK(key)) {
|
|
79
|
+
key = await importJWK(key, alg);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
checkKeyTypeWithJwk(alg, key, 'verify');
|
|
84
|
+
}
|
|
85
|
+
const data = concat(encoder.encode(jws.protected ?? ''), encoder.encode('.'), typeof jws.payload === 'string' ? encoder.encode(jws.payload) : jws.payload);
|
|
86
|
+
let signature;
|
|
87
|
+
try {
|
|
88
|
+
signature = decode(jws.signature);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
throw new JWSInvalid('Failed to base64url decode the signature');
|
|
92
|
+
}
|
|
93
|
+
const verified = await verify(alg, key, signature, data);
|
|
94
|
+
if (!verified) {
|
|
95
|
+
throw new JWSSignatureVerificationFailed();
|
|
96
|
+
}
|
|
97
|
+
let payload;
|
|
98
|
+
if (b64) {
|
|
99
|
+
try {
|
|
100
|
+
payload = decode(jws.payload);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
throw new JWSInvalid('Failed to base64url decode the payload');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (typeof jws.payload === 'string') {
|
|
107
|
+
payload = encoder.encode(jws.payload);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
payload = jws.payload;
|
|
111
|
+
}
|
|
112
|
+
const result = { payload };
|
|
113
|
+
if (jws.protected !== undefined) {
|
|
114
|
+
result.protectedHeader = parsedProt;
|
|
115
|
+
}
|
|
116
|
+
if (jws.header !== undefined) {
|
|
117
|
+
result.unprotectedHeader = jws.header;
|
|
118
|
+
}
|
|
119
|
+
if (resolvedKey) {
|
|
120
|
+
return { ...result, key };
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { flattenedVerify };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var verify = require('../jws/compact/verify.js');
|
|
4
|
+
var jwt_claims_set = require('../lib/jwt_claims_set.js');
|
|
5
|
+
var errors = require('../util/errors.js');
|
|
6
|
+
|
|
7
|
+
async function jwtVerify(jwt, key, options) {
|
|
8
|
+
const verified = await verify.compactVerify(jwt, key, options);
|
|
9
|
+
if (verified.protectedHeader.crit?.includes('b64') && verified.protectedHeader.b64 === false) {
|
|
10
|
+
throw new errors.JWTInvalid('JWTs MUST NOT use unencoded payload');
|
|
11
|
+
}
|
|
12
|
+
const payload = jwt_claims_set(verified.protectedHeader, verified.payload, options);
|
|
13
|
+
const result = { payload, protectedHeader: verified.protectedHeader };
|
|
14
|
+
if (typeof key === 'function') {
|
|
15
|
+
return { ...result, key: verified.key };
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.jwtVerify = jwtVerify;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { compactVerify } from '../jws/compact/verify.mjs';
|
|
2
|
+
import jwtPayload from '../lib/jwt_claims_set.mjs';
|
|
3
|
+
import { JWTInvalid } from '../util/errors.mjs';
|
|
4
|
+
|
|
5
|
+
async function jwtVerify(jwt, key, options) {
|
|
6
|
+
const verified = await compactVerify(jwt, key, options);
|
|
7
|
+
if (verified.protectedHeader.crit?.includes('b64') && verified.protectedHeader.b64 === false) {
|
|
8
|
+
throw new JWTInvalid('JWTs MUST NOT use unencoded payload');
|
|
9
|
+
}
|
|
10
|
+
const payload = jwtPayload(verified.protectedHeader, verified.payload, options);
|
|
11
|
+
const result = { payload, protectedHeader: verified.protectedHeader };
|
|
12
|
+
if (typeof key === 'function') {
|
|
13
|
+
return { ...result, key: verified.key };
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { jwtVerify };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var base64url = require('../runtime/base64url.js');
|
|
4
|
+
var jwk_to_key = require('../runtime/jwk_to_key.js');
|
|
5
|
+
var errors = require('../util/errors.js');
|
|
6
|
+
var is_object = require('../lib/is_object.js');
|
|
7
|
+
|
|
8
|
+
async function importJWK(jwk, alg) {
|
|
9
|
+
if (!is_object(jwk)) {
|
|
10
|
+
throw new TypeError('JWK must be an object');
|
|
11
|
+
}
|
|
12
|
+
alg ||= jwk.alg;
|
|
13
|
+
switch (jwk.kty) {
|
|
14
|
+
case 'oct':
|
|
15
|
+
if (typeof jwk.k !== 'string' || !jwk.k) {
|
|
16
|
+
throw new TypeError('missing "k" (Key Value) Parameter value');
|
|
17
|
+
}
|
|
18
|
+
return base64url.decode(jwk.k);
|
|
19
|
+
case 'RSA':
|
|
20
|
+
if ('oth' in jwk && jwk.oth !== undefined) {
|
|
21
|
+
throw new errors.JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
|
|
22
|
+
}
|
|
23
|
+
case 'EC':
|
|
24
|
+
case 'OKP':
|
|
25
|
+
return jwk_to_key({ ...jwk, alg });
|
|
26
|
+
default:
|
|
27
|
+
throw new errors.JOSENotSupported('Unsupported "kty" (Key Type) Parameter value');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports.importJWK = importJWK;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { decode } from '../runtime/base64url.mjs';
|
|
2
|
+
import parse from '../runtime/jwk_to_key.mjs';
|
|
3
|
+
import { JOSENotSupported } from '../util/errors.mjs';
|
|
4
|
+
import isObject from '../lib/is_object.mjs';
|
|
5
|
+
|
|
6
|
+
async function importJWK(jwk, alg) {
|
|
7
|
+
if (!isObject(jwk)) {
|
|
8
|
+
throw new TypeError('JWK must be an object');
|
|
9
|
+
}
|
|
10
|
+
alg ||= jwk.alg;
|
|
11
|
+
switch (jwk.kty) {
|
|
12
|
+
case 'oct':
|
|
13
|
+
if (typeof jwk.k !== 'string' || !jwk.k) {
|
|
14
|
+
throw new TypeError('missing "k" (Key Value) Parameter value');
|
|
15
|
+
}
|
|
16
|
+
return decode(jwk.k);
|
|
17
|
+
case 'RSA':
|
|
18
|
+
if ('oth' in jwk && jwk.oth !== undefined) {
|
|
19
|
+
throw new JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
|
|
20
|
+
}
|
|
21
|
+
case 'EC':
|
|
22
|
+
case 'OKP':
|
|
23
|
+
return parse({ ...jwk, alg });
|
|
24
|
+
default:
|
|
25
|
+
throw new JOSENotSupported('Unsupported "kty" (Key Type) Parameter value');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { importJWK };
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const encoder = new TextEncoder();
|
|
4
|
+
const decoder = new TextDecoder();
|
|
5
|
+
function concat(...buffers) {
|
|
6
|
+
const size = buffers.reduce((acc, { length }) => acc + length, 0);
|
|
7
|
+
const buf = new Uint8Array(size);
|
|
8
|
+
let i = 0;
|
|
9
|
+
for (const buffer of buffers) {
|
|
10
|
+
buf.set(buffer, i);
|
|
11
|
+
i += buffer.length;
|
|
12
|
+
}
|
|
13
|
+
return buf;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.concat = concat;
|
|
17
|
+
exports.decoder = decoder;
|
|
18
|
+
exports.encoder = encoder;
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const encoder = new TextEncoder();
|
|
2
|
+
const decoder = new TextDecoder();
|
|
3
|
+
function concat(...buffers) {
|
|
4
|
+
const size = buffers.reduce((acc, { length }) => acc + length, 0);
|
|
5
|
+
const buf = new Uint8Array(size);
|
|
6
|
+
let i = 0;
|
|
7
|
+
for (const buffer of buffers) {
|
|
8
|
+
buf.set(buffer, i);
|
|
9
|
+
i += buffer.length;
|
|
10
|
+
}
|
|
11
|
+
return buf;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { concat, decoder, encoder };
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var invalid_key_input = require('./invalid_key_input.js');
|
|
4
|
+
var is_key_like = require('../runtime/is_key_like.js');
|
|
5
|
+
var is_jwk = require('./is_jwk.js');
|
|
6
|
+
|
|
7
|
+
const tag = (key) => key?.[Symbol.toStringTag];
|
|
8
|
+
const jwkMatchesOp = (alg, key, usage) => {
|
|
9
|
+
if (key.use !== undefined && key.use !== 'sig') {
|
|
10
|
+
throw new TypeError('Invalid key for this operation, when present its use must be sig');
|
|
11
|
+
}
|
|
12
|
+
if (key.key_ops !== undefined && key.key_ops.includes?.(usage) !== true) {
|
|
13
|
+
throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage}`);
|
|
14
|
+
}
|
|
15
|
+
if (key.alg !== undefined && key.alg !== alg) {
|
|
16
|
+
throw new TypeError(`Invalid key for this operation, when present its alg must be ${alg}`);
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
const symmetricTypeCheck = (alg, key, usage, allowJwk) => {
|
|
21
|
+
if (key instanceof Uint8Array)
|
|
22
|
+
return;
|
|
23
|
+
if (allowJwk && is_jwk.isJWK(key)) {
|
|
24
|
+
if (is_jwk.isSecretJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
25
|
+
return;
|
|
26
|
+
throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
|
|
27
|
+
}
|
|
28
|
+
if (!is_key_like.default(key)) {
|
|
29
|
+
throw new TypeError(invalid_key_input.withAlg(alg, key, ...is_key_like.types, 'Uint8Array', allowJwk ? 'JSON Web Key' : null));
|
|
30
|
+
}
|
|
31
|
+
if (key.type !== 'secret') {
|
|
32
|
+
throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const asymmetricTypeCheck = (alg, key, usage, allowJwk) => {
|
|
36
|
+
if (allowJwk && is_jwk.isJWK(key)) {
|
|
37
|
+
switch (usage) {
|
|
38
|
+
case 'sign':
|
|
39
|
+
if (is_jwk.isPrivateJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
40
|
+
return;
|
|
41
|
+
throw new TypeError(`JSON Web Key for this operation be a private JWK`);
|
|
42
|
+
case 'verify':
|
|
43
|
+
if (is_jwk.isPublicJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
44
|
+
return;
|
|
45
|
+
throw new TypeError(`JSON Web Key for this operation be a public JWK`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (!is_key_like.default(key)) {
|
|
49
|
+
throw new TypeError(invalid_key_input.withAlg(alg, key, ...is_key_like.types, allowJwk ? 'JSON Web Key' : null));
|
|
50
|
+
}
|
|
51
|
+
if (key.type === 'secret') {
|
|
52
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
53
|
+
}
|
|
54
|
+
if (usage === 'sign' && key.type === 'public') {
|
|
55
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
56
|
+
}
|
|
57
|
+
if (usage === 'decrypt' && key.type === 'public') {
|
|
58
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
59
|
+
}
|
|
60
|
+
if (key.algorithm && usage === 'verify' && key.type === 'private') {
|
|
61
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
62
|
+
}
|
|
63
|
+
if (key.algorithm && usage === 'encrypt' && key.type === 'private') {
|
|
64
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function checkKeyType(allowJwk, alg, key, usage) {
|
|
68
|
+
const symmetric = alg.startsWith('HS') ||
|
|
69
|
+
alg === 'dir' ||
|
|
70
|
+
alg.startsWith('PBES2') ||
|
|
71
|
+
/^A\d{3}(?:GCM)?KW$/.test(alg);
|
|
72
|
+
if (symmetric) {
|
|
73
|
+
symmetricTypeCheck(alg, key, usage, allowJwk);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
asymmetricTypeCheck(alg, key, usage, allowJwk);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
checkKeyType.bind(undefined, false);
|
|
80
|
+
const checkKeyTypeWithJwk = checkKeyType.bind(undefined, true);
|
|
81
|
+
|
|
82
|
+
exports.checkKeyTypeWithJwk = checkKeyTypeWithJwk;
|
package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.mjs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { withAlg } from './invalid_key_input.mjs';
|
|
2
|
+
import isKeyLike, { types } from '../runtime/is_key_like.mjs';
|
|
3
|
+
import { isJWK, isSecretJWK, isPublicJWK, isPrivateJWK } from './is_jwk.mjs';
|
|
4
|
+
|
|
5
|
+
const tag = (key) => key?.[Symbol.toStringTag];
|
|
6
|
+
const jwkMatchesOp = (alg, key, usage) => {
|
|
7
|
+
if (key.use !== undefined && key.use !== 'sig') {
|
|
8
|
+
throw new TypeError('Invalid key for this operation, when present its use must be sig');
|
|
9
|
+
}
|
|
10
|
+
if (key.key_ops !== undefined && key.key_ops.includes?.(usage) !== true) {
|
|
11
|
+
throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage}`);
|
|
12
|
+
}
|
|
13
|
+
if (key.alg !== undefined && key.alg !== alg) {
|
|
14
|
+
throw new TypeError(`Invalid key for this operation, when present its alg must be ${alg}`);
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
};
|
|
18
|
+
const symmetricTypeCheck = (alg, key, usage, allowJwk) => {
|
|
19
|
+
if (key instanceof Uint8Array)
|
|
20
|
+
return;
|
|
21
|
+
if (allowJwk && isJWK(key)) {
|
|
22
|
+
if (isSecretJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
23
|
+
return;
|
|
24
|
+
throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
|
|
25
|
+
}
|
|
26
|
+
if (!isKeyLike(key)) {
|
|
27
|
+
throw new TypeError(withAlg(alg, key, ...types, 'Uint8Array', allowJwk ? 'JSON Web Key' : null));
|
|
28
|
+
}
|
|
29
|
+
if (key.type !== 'secret') {
|
|
30
|
+
throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const asymmetricTypeCheck = (alg, key, usage, allowJwk) => {
|
|
34
|
+
if (allowJwk && isJWK(key)) {
|
|
35
|
+
switch (usage) {
|
|
36
|
+
case 'sign':
|
|
37
|
+
if (isPrivateJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
38
|
+
return;
|
|
39
|
+
throw new TypeError(`JSON Web Key for this operation be a private JWK`);
|
|
40
|
+
case 'verify':
|
|
41
|
+
if (isPublicJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
42
|
+
return;
|
|
43
|
+
throw new TypeError(`JSON Web Key for this operation be a public JWK`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!isKeyLike(key)) {
|
|
47
|
+
throw new TypeError(withAlg(alg, key, ...types, allowJwk ? 'JSON Web Key' : null));
|
|
48
|
+
}
|
|
49
|
+
if (key.type === 'secret') {
|
|
50
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
51
|
+
}
|
|
52
|
+
if (usage === 'sign' && key.type === 'public') {
|
|
53
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
54
|
+
}
|
|
55
|
+
if (usage === 'decrypt' && key.type === 'public') {
|
|
56
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
57
|
+
}
|
|
58
|
+
if (key.algorithm && usage === 'verify' && key.type === 'private') {
|
|
59
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
60
|
+
}
|
|
61
|
+
if (key.algorithm && usage === 'encrypt' && key.type === 'private') {
|
|
62
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
function checkKeyType(allowJwk, alg, key, usage) {
|
|
66
|
+
const symmetric = alg.startsWith('HS') ||
|
|
67
|
+
alg === 'dir' ||
|
|
68
|
+
alg.startsWith('PBES2') ||
|
|
69
|
+
/^A\d{3}(?:GCM)?KW$/.test(alg);
|
|
70
|
+
if (symmetric) {
|
|
71
|
+
symmetricTypeCheck(alg, key, usage, allowJwk);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
asymmetricTypeCheck(alg, key, usage, allowJwk);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
checkKeyType.bind(undefined, false);
|
|
78
|
+
const checkKeyTypeWithJwk = checkKeyType.bind(undefined, true);
|
|
79
|
+
|
|
80
|
+
export { checkKeyTypeWithJwk };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function unusable(name, prop = 'algorithm.name') {
|
|
4
|
+
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
5
|
+
}
|
|
6
|
+
function isAlgorithm(algorithm, name) {
|
|
7
|
+
return algorithm.name === name;
|
|
8
|
+
}
|
|
9
|
+
function getHashLength(hash) {
|
|
10
|
+
return parseInt(hash.name.slice(4), 10);
|
|
11
|
+
}
|
|
12
|
+
function getNamedCurve(alg) {
|
|
13
|
+
switch (alg) {
|
|
14
|
+
case 'ES256':
|
|
15
|
+
return 'P-256';
|
|
16
|
+
case 'ES384':
|
|
17
|
+
return 'P-384';
|
|
18
|
+
case 'ES512':
|
|
19
|
+
return 'P-521';
|
|
20
|
+
default:
|
|
21
|
+
throw new Error('unreachable');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function checkUsage(key, usages) {
|
|
25
|
+
if (usages.length && !usages.some((expected) => key.usages.includes(expected))) {
|
|
26
|
+
let msg = 'CryptoKey does not support this operation, its usages must include ';
|
|
27
|
+
if (usages.length > 2) {
|
|
28
|
+
const last = usages.pop();
|
|
29
|
+
msg += `one of ${usages.join(', ')}, or ${last}.`;
|
|
30
|
+
}
|
|
31
|
+
else if (usages.length === 2) {
|
|
32
|
+
msg += `one of ${usages[0]} or ${usages[1]}.`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
msg += `${usages[0]}.`;
|
|
36
|
+
}
|
|
37
|
+
throw new TypeError(msg);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function checkSigCryptoKey(key, alg, ...usages) {
|
|
41
|
+
switch (alg) {
|
|
42
|
+
case 'HS256':
|
|
43
|
+
case 'HS384':
|
|
44
|
+
case 'HS512': {
|
|
45
|
+
if (!isAlgorithm(key.algorithm, 'HMAC'))
|
|
46
|
+
throw unusable('HMAC');
|
|
47
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
48
|
+
const actual = getHashLength(key.algorithm.hash);
|
|
49
|
+
if (actual !== expected)
|
|
50
|
+
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case 'RS256':
|
|
54
|
+
case 'RS384':
|
|
55
|
+
case 'RS512': {
|
|
56
|
+
if (!isAlgorithm(key.algorithm, 'RSASSA-PKCS1-v1_5'))
|
|
57
|
+
throw unusable('RSASSA-PKCS1-v1_5');
|
|
58
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
59
|
+
const actual = getHashLength(key.algorithm.hash);
|
|
60
|
+
if (actual !== expected)
|
|
61
|
+
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case 'PS256':
|
|
65
|
+
case 'PS384':
|
|
66
|
+
case 'PS512': {
|
|
67
|
+
if (!isAlgorithm(key.algorithm, 'RSA-PSS'))
|
|
68
|
+
throw unusable('RSA-PSS');
|
|
69
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
70
|
+
const actual = getHashLength(key.algorithm.hash);
|
|
71
|
+
if (actual !== expected)
|
|
72
|
+
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
case 'EdDSA': {
|
|
76
|
+
if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') {
|
|
77
|
+
throw unusable('Ed25519 or Ed448');
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case 'Ed25519': {
|
|
82
|
+
if (!isAlgorithm(key.algorithm, 'Ed25519'))
|
|
83
|
+
throw unusable('Ed25519');
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 'ES256':
|
|
87
|
+
case 'ES384':
|
|
88
|
+
case 'ES512': {
|
|
89
|
+
if (!isAlgorithm(key.algorithm, 'ECDSA'))
|
|
90
|
+
throw unusable('ECDSA');
|
|
91
|
+
const expected = getNamedCurve(alg);
|
|
92
|
+
const actual = key.algorithm.namedCurve;
|
|
93
|
+
if (actual !== expected)
|
|
94
|
+
throw unusable(expected, 'algorithm.namedCurve');
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
default:
|
|
98
|
+
throw new TypeError('CryptoKey does not support this operation');
|
|
99
|
+
}
|
|
100
|
+
checkUsage(key, usages);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
exports.checkSigCryptoKey = checkSigCryptoKey;
|