@tsed/exceptions 7.79.4 → 7.80.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/lib/types-esm/clientErrors/BadMapping.d.ts +6 -0
- package/lib/types-esm/clientErrors/BadRequest.d.ts +5 -0
- package/lib/types-esm/clientErrors/Conflict.d.ts +5 -0
- package/lib/types-esm/clientErrors/ExpectationFailed.d.ts +5 -0
- package/lib/types-esm/clientErrors/Forbidden.d.ts +5 -0
- package/lib/types-esm/clientErrors/Gone.d.ts +5 -0
- package/lib/types-esm/clientErrors/ImATeapot.d.ts +6 -0
- package/lib/types-esm/clientErrors/LengthRequired.d.ts +5 -0
- package/lib/types-esm/clientErrors/MethodNotAllowed.d.ts +5 -0
- package/lib/types-esm/clientErrors/MisdirectedRequest.d.ts +5 -0
- package/lib/types-esm/clientErrors/NotAcceptable.d.ts +5 -0
- package/lib/types-esm/clientErrors/NotFound.d.ts +5 -0
- package/lib/types-esm/clientErrors/PaymentRequired.d.ts +5 -0
- package/lib/types-esm/clientErrors/PreconditionFailed.d.ts +5 -0
- package/lib/types-esm/clientErrors/PreconditionRequired.d.ts +5 -0
- package/lib/types-esm/clientErrors/ProxyAuthentificationRequired.d.ts +5 -0
- package/lib/types-esm/clientErrors/RequestEntityTooLarge.d.ts +5 -0
- package/lib/types-esm/clientErrors/RequestHeaderFieldsTooLarge.d.ts +5 -0
- package/lib/types-esm/clientErrors/RequestRangeUnsatisfiable.d.ts +5 -0
- package/lib/types-esm/clientErrors/RequestTimeout.d.ts +5 -0
- package/lib/types-esm/clientErrors/RequestURITooLong.d.ts +5 -0
- package/lib/types-esm/clientErrors/TooManyRequests.d.ts +5 -0
- package/lib/types-esm/clientErrors/Unauthorized.d.ts +5 -0
- package/lib/types-esm/clientErrors/UnavailableForLegalReasons.d.ts +5 -0
- package/lib/types-esm/clientErrors/UnprocessableEntity.d.ts +5 -0
- package/lib/types-esm/clientErrors/UnsupportedMediaType.d.ts +5 -0
- package/lib/types-esm/clientErrors/UpgradeRequired.d.ts +5 -0
- package/lib/types-esm/core/ClientException.d.ts +4 -0
- package/lib/types-esm/core/Exception.d.ts +48 -0
- package/lib/types-esm/core/RedirectException.d.ts +4 -0
- package/lib/types-esm/core/ServerException.d.ts +4 -0
- package/lib/types-esm/core/StatusFamily.d.ts +5 -0
- package/lib/types-esm/index.d.ts +53 -0
- package/lib/types-esm/redirections/MovedPermanently.d.ts +5 -0
- package/lib/types-esm/redirections/MovedTemporarily.d.ts +6 -0
- package/lib/types-esm/redirections/MultipleChoices.d.ts +5 -0
- package/lib/types-esm/redirections/NotModified.d.ts +5 -0
- package/lib/types-esm/redirections/PermanentRedirect.d.ts +5 -0
- package/lib/types-esm/redirections/SeeOther.d.ts +5 -0
- package/lib/types-esm/redirections/TemporaryRedirect.d.ts +5 -0
- package/lib/types-esm/redirections/UseProxy.d.ts +5 -0
- package/lib/types-esm/serverErrors/BadGateway.d.ts +5 -0
- package/lib/types-esm/serverErrors/BandwidthLimitExceeded.d.ts +5 -0
- package/lib/types-esm/serverErrors/GatewayTimeout.d.ts +5 -0
- package/lib/types-esm/serverErrors/InternalServerError.d.ts +5 -0
- package/lib/types-esm/serverErrors/NetworkAuthenticationRequired.d.ts +5 -0
- package/lib/types-esm/serverErrors/NotExtended.d.ts +5 -0
- package/lib/types-esm/serverErrors/NotImplemented.d.ts +5 -0
- package/lib/types-esm/serverErrors/ProxyError.d.ts +6 -0
- package/lib/types-esm/serverErrors/ServiceUnavailable.d.ts +5 -0
- package/lib/types-esm/serverErrors/VariantAlsoNegotiates.d.ts +5 -0
- package/package.json +15 -11
- package/vitest.config.mts +21 -0
- package/jest.config.js +0 -14
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/tsconfig.esm.json +0 -33
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { StatusFamily } from "./StatusFamily.js";
|
|
2
|
+
export declare class Exception extends Error {
|
|
3
|
+
#private;
|
|
4
|
+
/**
|
|
5
|
+
* Exception base name
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Message of the exception
|
|
11
|
+
*/
|
|
12
|
+
message: string;
|
|
13
|
+
/**
|
|
14
|
+
* Exception type
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
type: string;
|
|
18
|
+
/**
|
|
19
|
+
* Stack calling
|
|
20
|
+
*/
|
|
21
|
+
stack: string;
|
|
22
|
+
origin: Error & any;
|
|
23
|
+
/**
|
|
24
|
+
* HTTP Code Status
|
|
25
|
+
*/
|
|
26
|
+
status: number;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
body: any;
|
|
31
|
+
/**
|
|
32
|
+
* Headers must be sent to the response
|
|
33
|
+
*/
|
|
34
|
+
headers: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
static validate(status: number, family: StatusFamily): number;
|
|
39
|
+
constructor(status?: number, message?: string, origin?: Error | string | any);
|
|
40
|
+
setHeaders(headers: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}): this;
|
|
43
|
+
setHeader(key: string, value: any): this;
|
|
44
|
+
setOrigin(origin: Error | string | any): void;
|
|
45
|
+
toString(): string;
|
|
46
|
+
}
|
|
47
|
+
export declare class HTTPException extends Exception {
|
|
48
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by @tsed/barrels.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./clientErrors/BadMapping.js";
|
|
5
|
+
export * from "./clientErrors/BadRequest.js";
|
|
6
|
+
export * from "./clientErrors/Conflict.js";
|
|
7
|
+
export * from "./clientErrors/ExpectationFailed.js";
|
|
8
|
+
export * from "./clientErrors/Forbidden.js";
|
|
9
|
+
export * from "./clientErrors/Gone.js";
|
|
10
|
+
export * from "./clientErrors/ImATeapot.js";
|
|
11
|
+
export * from "./clientErrors/LengthRequired.js";
|
|
12
|
+
export * from "./clientErrors/MethodNotAllowed.js";
|
|
13
|
+
export * from "./clientErrors/MisdirectedRequest.js";
|
|
14
|
+
export * from "./clientErrors/NotAcceptable.js";
|
|
15
|
+
export * from "./clientErrors/NotFound.js";
|
|
16
|
+
export * from "./clientErrors/PaymentRequired.js";
|
|
17
|
+
export * from "./clientErrors/PreconditionFailed.js";
|
|
18
|
+
export * from "./clientErrors/PreconditionRequired.js";
|
|
19
|
+
export * from "./clientErrors/ProxyAuthentificationRequired.js";
|
|
20
|
+
export * from "./clientErrors/RequestEntityTooLarge.js";
|
|
21
|
+
export * from "./clientErrors/RequestHeaderFieldsTooLarge.js";
|
|
22
|
+
export * from "./clientErrors/RequestRangeUnsatisfiable.js";
|
|
23
|
+
export * from "./clientErrors/RequestTimeout.js";
|
|
24
|
+
export * from "./clientErrors/RequestURITooLong.js";
|
|
25
|
+
export * from "./clientErrors/TooManyRequests.js";
|
|
26
|
+
export * from "./clientErrors/Unauthorized.js";
|
|
27
|
+
export * from "./clientErrors/UnavailableForLegalReasons.js";
|
|
28
|
+
export * from "./clientErrors/UnprocessableEntity.js";
|
|
29
|
+
export * from "./clientErrors/UnsupportedMediaType.js";
|
|
30
|
+
export * from "./clientErrors/UpgradeRequired.js";
|
|
31
|
+
export * from "./core/ClientException.js";
|
|
32
|
+
export * from "./core/Exception.js";
|
|
33
|
+
export * from "./core/RedirectException.js";
|
|
34
|
+
export * from "./core/ServerException.js";
|
|
35
|
+
export * from "./core/StatusFamily.js";
|
|
36
|
+
export * from "./redirections/MovedPermanently.js";
|
|
37
|
+
export * from "./redirections/MovedTemporarily.js";
|
|
38
|
+
export * from "./redirections/MultipleChoices.js";
|
|
39
|
+
export * from "./redirections/NotModified.js";
|
|
40
|
+
export * from "./redirections/PermanentRedirect.js";
|
|
41
|
+
export * from "./redirections/SeeOther.js";
|
|
42
|
+
export * from "./redirections/TemporaryRedirect.js";
|
|
43
|
+
export * from "./redirections/UseProxy.js";
|
|
44
|
+
export * from "./serverErrors/BadGateway.js";
|
|
45
|
+
export * from "./serverErrors/BandwidthLimitExceeded.js";
|
|
46
|
+
export * from "./serverErrors/GatewayTimeout.js";
|
|
47
|
+
export * from "./serverErrors/InternalServerError.js";
|
|
48
|
+
export * from "./serverErrors/NetworkAuthenticationRequired.js";
|
|
49
|
+
export * from "./serverErrors/NotExtended.js";
|
|
50
|
+
export * from "./serverErrors/NotImplemented.js";
|
|
51
|
+
export * from "./serverErrors/ProxyError.js";
|
|
52
|
+
export * from "./serverErrors/ServiceUnavailable.js";
|
|
53
|
+
export * from "./serverErrors/VariantAlsoNegotiates.js";
|
package/package.json
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/exceptions",
|
|
3
|
-
"version": "7.79.4",
|
|
4
3
|
"description": "HTTP exceptions module for Ts.ED Framework and other pure Express application",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"version": "7.80.0",
|
|
5
6
|
"source": "./src/index.ts",
|
|
6
7
|
"main": "./lib/cjs/index.js",
|
|
7
8
|
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/types/index.d.ts",
|
|
13
|
+
"import": "./lib/esm/index.js",
|
|
14
|
+
"default": "./lib/cjs/index.js"
|
|
15
|
+
}
|
|
14
16
|
},
|
|
15
17
|
"scripts": {
|
|
16
18
|
"build": "yarn barrels && yarn build:ts",
|
|
17
19
|
"barrels": "barrels",
|
|
18
|
-
"test": "
|
|
19
|
-
"build:ts": "tsc --build tsconfig.json
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"build:ts": "tsc --build tsconfig.json",
|
|
22
|
+
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
20
23
|
},
|
|
21
24
|
"dependencies": {
|
|
22
25
|
"change-case": "4.1.2",
|
|
@@ -24,14 +27,15 @@
|
|
|
24
27
|
"tslib": "2.6.1"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"@tsed/barrels": "7.
|
|
28
|
-
"@tsed/typescript": "7.
|
|
30
|
+
"@tsed/barrels": "7.80.0",
|
|
31
|
+
"@tsed/typescript": "7.80.0",
|
|
29
32
|
"@types/statuses": "2.0.5",
|
|
30
33
|
"eslint": "^8.57.0",
|
|
31
|
-
"
|
|
34
|
+
"typescript": "4.9.5",
|
|
35
|
+
"vitest": "2.0.4"
|
|
32
36
|
},
|
|
33
37
|
"peerDependencies": {
|
|
34
|
-
"@tsed/core": "7.
|
|
38
|
+
"@tsed/core": "7.80.0"
|
|
35
39
|
},
|
|
36
40
|
"repository": "https://github.com/tsedio/tsed",
|
|
37
41
|
"bugs": {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {presets} from "@tsed/vitest/presets";
|
|
3
|
+
import {defineConfig} from "vitest/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
{
|
|
7
|
+
...presets,
|
|
8
|
+
test: {
|
|
9
|
+
...presets.test,
|
|
10
|
+
coverage: {
|
|
11
|
+
...presets.test.coverage,
|
|
12
|
+
thresholds: {
|
|
13
|
+
statements: 0,
|
|
14
|
+
branches: 0,
|
|
15
|
+
functions: 0,
|
|
16
|
+
lines: 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
package/jest.config.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// For a detailed explanation regarding each configuration property, visit:
|
|
2
|
-
// https://jestjs.io/docs/en/configuration.html
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
...require("@tsed/jest-config"),
|
|
6
|
-
coverageThreshold: {
|
|
7
|
-
global: {
|
|
8
|
-
branches: 93.75,
|
|
9
|
-
functions: 100,
|
|
10
|
-
lines: 100,
|
|
11
|
-
statements: 100
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
package/lib/cjs/package.json
DELETED
package/lib/esm/package.json
DELETED
package/tsconfig.esm.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsed/typescript/tsconfig.node.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"module": "ES2020",
|
|
6
|
-
"rootDir": "src",
|
|
7
|
-
"outDir": "./lib/esm",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "./lib/types",
|
|
10
|
-
"composite": true,
|
|
11
|
-
"noEmit": false
|
|
12
|
-
},
|
|
13
|
-
"include": ["src", "src/**/*.json"],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"test",
|
|
17
|
-
"lib",
|
|
18
|
-
"benchmark",
|
|
19
|
-
"coverage",
|
|
20
|
-
"spec",
|
|
21
|
-
"**/*.benchmark.ts",
|
|
22
|
-
"**/*.spec.ts",
|
|
23
|
-
"keys",
|
|
24
|
-
"jest.config.js",
|
|
25
|
-
"**/__mock__/**",
|
|
26
|
-
"webpack.config.js"
|
|
27
|
-
],
|
|
28
|
-
"references": [
|
|
29
|
-
{
|
|
30
|
-
"path": "../../core"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|