diff --git a/dist/index.js b/dist/index.js index 197fae3..31716b2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27362,7 +27362,7 @@ function isCloudflareWorkers() { let USER_AGENT; if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) { const NAME = 'jose'; - const VERSION = 'v5.9.3'; + const VERSION = 'v5.9.4'; USER_AGENT = `${NAME}/${VERSION}`; } exports.jwksCache = Symbol(); @@ -30895,27 +30895,23 @@ exports.decodeProtectedHeader = decodeProtectedHeader; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JWSSignatureVerificationFailed = exports.JWKSTimeout = exports.JWKSMultipleMatchingKeys = exports.JWKSNoMatchingKey = exports.JWKSInvalid = exports.JWKInvalid = exports.JWTInvalid = exports.JWSInvalid = exports.JWEInvalid = exports.JWEDecryptionFailed = exports.JOSENotSupported = exports.JOSEAlgNotAllowed = exports.JWTExpired = exports.JWTClaimValidationFailed = exports.JOSEError = void 0; class JOSEError extends Error { - static get code() { - return 'ERR_JOSE_GENERIC'; - } + static code = 'ERR_JOSE_GENERIC'; code = 'ERR_JOSE_GENERIC'; - constructor(message) { - super(message); + constructor(message, options) { + super(message, options); this.name = this.constructor.name; Error.captureStackTrace?.(this, this.constructor); } } exports.JOSEError = JOSEError; class JWTClaimValidationFailed extends JOSEError { - static get code() { - return 'ERR_JWT_CLAIM_VALIDATION_FAILED'; - } + static code = 'ERR_JWT_CLAIM_VALIDATION_FAILED'; code = 'ERR_JWT_CLAIM_VALIDATION_FAILED'; claim; reason; payload; constructor(message, payload, claim = 'unspecified', reason = 'unspecified') { - super(message); + super(message, { cause: { claim, reason, payload } }); this.claim = claim; this.reason = reason; this.payload = payload; @@ -30923,15 +30919,13 @@ class JWTClaimValidationFailed extends JOSEError { } exports.JWTClaimValidationFailed = JWTClaimValidationFailed; class JWTExpired extends JOSEError { - static get code() { - return 'ERR_JWT_EXPIRED'; - } + static code = 'ERR_JWT_EXPIRED'; code = 'ERR_JWT_EXPIRED'; claim; reason; payload; constructor(message, payload, claim = 'unspecified', reason = 'unspecified') { - super(message); + super(message, { cause: { claim, reason, payload } }); this.claim = claim; this.reason = reason; this.payload = payload; @@ -30939,93 +30933,79 @@ class JWTExpired extends JOSEError { } exports.JWTExpired = JWTExpired; class JOSEAlgNotAllowed extends JOSEError { - static get code() { - return 'ERR_JOSE_ALG_NOT_ALLOWED'; - } + static code = 'ERR_JOSE_ALG_NOT_ALLOWED'; code = 'ERR_JOSE_ALG_NOT_ALLOWED'; } exports.JOSEAlgNotAllowed = JOSEAlgNotAllowed; class JOSENotSupported extends JOSEError { - static get code() { - return 'ERR_JOSE_NOT_SUPPORTED'; - } + static code = 'ERR_JOSE_NOT_SUPPORTED'; code = 'ERR_JOSE_NOT_SUPPORTED'; } exports.JOSENotSupported = JOSENotSupported; class JWEDecryptionFailed extends JOSEError { - static get code() { - return 'ERR_JWE_DECRYPTION_FAILED'; - } + static code = 'ERR_JWE_DECRYPTION_FAILED'; code = 'ERR_JWE_DECRYPTION_FAILED'; - message = 'decryption operation failed'; + constructor(message = 'decryption operation failed', options) { + super(message, options); + } } exports.JWEDecryptionFailed = JWEDecryptionFailed; class JWEInvalid extends JOSEError { - static get code() { - return 'ERR_JWE_INVALID'; - } + static code = 'ERR_JWE_INVALID'; code = 'ERR_JWE_INVALID'; } exports.JWEInvalid = JWEInvalid; class JWSInvalid extends JOSEError { - static get code() { - return 'ERR_JWS_INVALID'; - } + static code = 'ERR_JWS_INVALID'; code = 'ERR_JWS_INVALID'; } exports.JWSInvalid = JWSInvalid; class JWTInvalid extends JOSEError { - static get code() { - return 'ERR_JWT_INVALID'; - } + static code = 'ERR_JWT_INVALID'; code = 'ERR_JWT_INVALID'; } exports.JWTInvalid = JWTInvalid; class JWKInvalid extends JOSEError { - static get code() { - return 'ERR_JWK_INVALID'; - } + static code = 'ERR_JWK_INVALID'; code = 'ERR_JWK_INVALID'; } exports.JWKInvalid = JWKInvalid; class JWKSInvalid extends JOSEError { - static get code() { - return 'ERR_JWKS_INVALID'; - } + static code = 'ERR_JWKS_INVALID'; code = 'ERR_JWKS_INVALID'; } exports.JWKSInvalid = JWKSInvalid; class JWKSNoMatchingKey extends JOSEError { - static get code() { - return 'ERR_JWKS_NO_MATCHING_KEY'; - } + static code = 'ERR_JWKS_NO_MATCHING_KEY'; code = 'ERR_JWKS_NO_MATCHING_KEY'; - message = 'no applicable key found in the JSON Web Key Set'; + constructor(message = 'no applicable key found in the JSON Web Key Set', options) { + super(message, options); + } } exports.JWKSNoMatchingKey = JWKSNoMatchingKey; class JWKSMultipleMatchingKeys extends JOSEError { [Symbol.asyncIterator]; - static get code() { - return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; - } + static code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; - message = 'multiple matching keys found in the JSON Web Key Set'; + constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) { + super(message, options); + } } exports.JWKSMultipleMatchingKeys = JWKSMultipleMatchingKeys; class JWKSTimeout extends JOSEError { - static get code() { - return 'ERR_JWKS_TIMEOUT'; - } + static code = 'ERR_JWKS_TIMEOUT'; code = 'ERR_JWKS_TIMEOUT'; - message = 'request timed out'; + constructor(message = 'request timed out', options) { + super(message, options); + } } exports.JWKSTimeout = JWKSTimeout; class JWSSignatureVerificationFailed extends JOSEError { - static get code() { - return 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; - } + static code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; - message = 'signature verification failed'; + constructor(message = 'signature verification failed', options) { + super(message, options); + } } exports.JWSSignatureVerificationFailed = JWSSignatureVerificationFailed; diff --git a/package-lock.json b/package-lock.json index f9e51f5..9144382 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/jest": "^29.5.13", - "@types/node": "^22.7.4", + "@types/node": "^22.7.5", "@typescript-eslint/eslint-plugin": "^7.17.0", "@typescript-eslint/parser": "^7.18.0", "@vercel/ncc": "^0.38.2", @@ -24,13 +24,13 @@ "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", - "jose": "^5.9.3", + "jose": "^5.9.4", "markdownlint-cli": "^0.42.0", "nock": "^13.5.5", "prettier": "^3.3.3", "prettier-eslint": "^16.3.0", "ts-jest": "^29.2.5", - "typescript": "^5.6.2" + "typescript": "^5.6.3" }, "engines": { "node": ">=20" @@ -1691,9 +1691,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", - "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "dev": true, "dependencies": { "undici-types": "~6.19.2" @@ -5695,9 +5695,9 @@ } }, "node_modules/jose": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.3.tgz", - "integrity": "sha512-egLIoYSpcd+QUF+UHgobt5YzI2Pkw/H39ou9suW687MY6PmCwPmkNV/4TNjn1p2tX5xO3j0d0sq5hiYE24bSlg==", + "version": "5.9.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.4.tgz", + "integrity": "sha512-WBBl6au1qg6OHj67yCffCgFR3BADJBXN8MdRvCgJDuMv3driV2nHr7jdGvaKX9IolosAsn+M0XRArqLXUhyJHQ==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -8100,9 +8100,9 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index ef4e609..6076875 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ }, "devDependencies": { "@types/jest": "^29.5.13", - "@types/node": "^22.7.4", + "@types/node": "^22.7.5", "@typescript-eslint/eslint-plugin": "^7.17.0", "@typescript-eslint/parser": "^7.18.0", "@vercel/ncc": "^0.38.2", @@ -85,12 +85,12 @@ "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", - "jose": "^5.9.3", + "jose": "^5.9.4", "markdownlint-cli": "^0.42.0", "nock": "^13.5.5", "prettier": "^3.3.3", "prettier-eslint": "^16.3.0", "ts-jest": "^29.2.5", - "typescript": "^5.6.2" + "typescript": "^5.6.3" } }