@curveball/http-errors
Advanced tools
Comparing version 0.5.0 to 1.0.0
{ | ||
"name": "@curveball/http-errors", | ||
"version": "0.5.0", | ||
"version": "1.0.0", | ||
"description": "A standard package for HTTP exceptions", | ||
"type": "module", | ||
"exports": { | ||
"require": "./cjs/index.js", | ||
"import": "./esm/index.js" | ||
}, | ||
"main": "cjs/index.js", | ||
"exports": "./dist/index.js", | ||
"homepage": "https://github.com/curveball/http-errors#readme", | ||
@@ -30,3 +26,4 @@ "bugs": { | ||
"tsc": "tsc", | ||
"start": "make start" | ||
"start": "make start", | ||
"build": "make build" | ||
}, | ||
@@ -37,19 +34,23 @@ "repository": { | ||
}, | ||
"peerDependencies": { | ||
"@curveball/kernel": "^1" | ||
}, | ||
"devDependencies": { | ||
"@curveball/kernel": "^1.0.0", | ||
"@types/chai": "^4.2.12", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^12.20.41", | ||
"@types/sinon": "^10.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.9.1", | ||
"@typescript-eslint/parser": "^5.9.1", | ||
"chai": "^4.2.0", | ||
"@types/node": "^18.19.7", | ||
"@types/sinon": "^17.0.3", | ||
"@typescript-eslint/eslint-plugin": "^6.19.0", | ||
"@typescript-eslint/parser": "^6.19.0", | ||
"chai": "^5.0.0", | ||
"eslint": "^8.6.0", | ||
"mocha": "^10.2.0", | ||
"nyc": "^15.1.0", | ||
"sinon": "^15.0.1", | ||
"sinon": "^17.0.1", | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.5.4" | ||
"typescript": "^5.3.3" | ||
}, | ||
"engines": { | ||
"node": ">= 14.4" | ||
"node": ">= 18" | ||
}, | ||
@@ -59,4 +60,3 @@ "files": [ | ||
"README.md", | ||
"esm", | ||
"cjs", | ||
"dist", | ||
"LICENSE", | ||
@@ -63,0 +63,0 @@ "src" |
@@ -114,3 +114,3 @@ HTTP Errors | ||
Lastly, it the package has an interface that makes it easier to work with the | ||
`application/problem+json` format, as defined in [RFC7807][3]. The interface | ||
`application/problem+json` format, as defined in [RFC9457][3]. The interface | ||
has `type`, `title`, `detail` and `instance` properties, which makes it easier | ||
@@ -184,3 +184,3 @@ to write a generic interface that emits this JSON error format. | ||
export class PayloadTooLarge extends HttpErrorBase { | ||
export class ContentTooLarge extends HttpErrorBase { | ||
retryAfter: number | null; | ||
@@ -195,3 +195,3 @@ constructor(detail: string|null = null, retryAfter: number|null = null) {} | ||
export class MisdirectedRequest extends HttpErrorBase {} | ||
export class UnprocessableEntity extends HttpErrorBase {} | ||
export class UnprocessableContent extends HttpErrorBase {} | ||
export class Locked extends HttpErrorBase {} | ||
@@ -224,3 +224,2 @@ export class FailedDependency extends HttpErrorBase {} | ||
export class LoopDetected extends HttpErrorBase {} | ||
export class NotExtended extends HttpErrorBase {} | ||
export class NetworkAuthenticationRequired extends HttpErrorBase {} | ||
@@ -233,2 +232,2 @@ ``` | ||
[2]: http://koajs.com/ | ||
[3]: https://tools.ietf.org/html/rfc7807 | ||
[3]: https://tools.ietf.org/html/rfc9457 |
@@ -213,3 +213,3 @@ export interface HttpError extends Error { | ||
/** | ||
* Emits 413 Payload Too Large. | ||
* Emits 413 Content Too Large | ||
* | ||
@@ -224,5 +224,5 @@ * If the status is temporary, it's possible for a server to send a | ||
*/ | ||
export class PayloadTooLarge extends HttpErrorBase { | ||
export class ContentTooLarge extends HttpErrorBase { | ||
httpStatus = 413; | ||
title = 'Payload Too Large'; | ||
title = 'Content Too Large'; | ||
@@ -240,2 +240,10 @@ retryAfter: number | null; | ||
/** | ||
* Payload Too Large was the old name of this error, but all instances of | ||
* Payload have been renamed to Content in RFC9110. | ||
* | ||
* @deprecated | ||
*/ | ||
export class PayloadTooLarge extends ContentTooLarge {} | ||
/** | ||
* Emits 414 URI Too Long | ||
@@ -281,5 +289,5 @@ */ | ||
/** | ||
* Emits 422 Unprocessable Entity | ||
* Emits 422 Unprocessable Content | ||
*/ | ||
export class UnprocessableEntity extends HttpErrorBase { | ||
export class UnprocessableContent extends HttpErrorBase { | ||
httpStatus = 422; | ||
@@ -290,2 +298,10 @@ title = 'Unprocessable Entity'; | ||
/** | ||
* RFC9110 renamed this to Unprocessable Content. | ||
* | ||
* @deprecated | ||
*/ | ||
export class UnprocessableEntity extends UnprocessableContent { | ||
} | ||
/** | ||
* Emits 423 Locked | ||
@@ -463,3 +479,7 @@ */ | ||
/** | ||
* Emits 510 Not Extended | ||
* Emits 510 Not Extended. | ||
* | ||
* This status code has been marked as obsolute. | ||
* | ||
* @deprecated | ||
*/ | ||
@@ -466,0 +486,0 @@ export class NotExtended extends HttpErrorBase { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
44568
1
14
8
1167
229