@skillstew/common 1.0.7 → 1.0.8
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/build/constants/HttpStatus.d.ts +27 -0
- package/build/constants/HttpStatus.js +35 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
- package/src/constants/HttpStatus.ts +34 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum HttpStatus {
|
|
2
|
+
OK = 200,
|
|
3
|
+
CREATED = 201,
|
|
4
|
+
ACCEPTED = 202,
|
|
5
|
+
NO_CONTENT = 204,
|
|
6
|
+
MOVED_PERMANENTLY = 301,
|
|
7
|
+
FOUND = 302,
|
|
8
|
+
NOT_MODIFIED = 304,
|
|
9
|
+
BAD_REQUEST = 400,
|
|
10
|
+
UNAUTHORIZED = 401,
|
|
11
|
+
PAYMENT_REQUIRED = 402,
|
|
12
|
+
FORBIDDEN = 403,
|
|
13
|
+
NOT_FOUND = 404,
|
|
14
|
+
METHOD_NOT_ALLOWED = 405,
|
|
15
|
+
NOT_ACCEPTABLE = 406,
|
|
16
|
+
REQUEST_TIMEOUT = 408,
|
|
17
|
+
CONFLICT = 409,
|
|
18
|
+
GONE = 410,
|
|
19
|
+
PAYLOAD_TOO_LARGE = 413,
|
|
20
|
+
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
21
|
+
TOO_MANY_REQUESTS = 429,
|
|
22
|
+
INTERNAL_SERVER_ERROR = 500,
|
|
23
|
+
NOT_IMPLEMENTED = 501,
|
|
24
|
+
BAD_GATEWAY = 502,
|
|
25
|
+
SERVICE_UNAVAILABLE = 503,
|
|
26
|
+
GATEWAY_TIMEOUT = 504
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpStatus = void 0;
|
|
4
|
+
var HttpStatus;
|
|
5
|
+
(function (HttpStatus) {
|
|
6
|
+
// 2xx Success
|
|
7
|
+
HttpStatus[HttpStatus["OK"] = 200] = "OK";
|
|
8
|
+
HttpStatus[HttpStatus["CREATED"] = 201] = "CREATED";
|
|
9
|
+
HttpStatus[HttpStatus["ACCEPTED"] = 202] = "ACCEPTED";
|
|
10
|
+
HttpStatus[HttpStatus["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
11
|
+
// 3xx Redirection
|
|
12
|
+
HttpStatus[HttpStatus["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
13
|
+
HttpStatus[HttpStatus["FOUND"] = 302] = "FOUND";
|
|
14
|
+
HttpStatus[HttpStatus["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
15
|
+
// 4xx Client Errors
|
|
16
|
+
HttpStatus[HttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
17
|
+
HttpStatus[HttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
18
|
+
HttpStatus[HttpStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
19
|
+
HttpStatus[HttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
20
|
+
HttpStatus[HttpStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
21
|
+
HttpStatus[HttpStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
22
|
+
HttpStatus[HttpStatus["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
23
|
+
HttpStatus[HttpStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
24
|
+
HttpStatus[HttpStatus["CONFLICT"] = 409] = "CONFLICT";
|
|
25
|
+
HttpStatus[HttpStatus["GONE"] = 410] = "GONE";
|
|
26
|
+
HttpStatus[HttpStatus["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
27
|
+
HttpStatus[HttpStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
28
|
+
HttpStatus[HttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
29
|
+
// 5xx Server Errors
|
|
30
|
+
HttpStatus[HttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
31
|
+
HttpStatus[HttpStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
32
|
+
HttpStatus[HttpStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
33
|
+
HttpStatus[HttpStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
34
|
+
HttpStatus[HttpStatus["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
35
|
+
})(HttpStatus || (exports.HttpStatus = HttpStatus = {}));
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./jwt-utils/JwtHelper"), exports);
|
|
|
22
22
|
__exportStar(require("./middlewares/authMiddleware"), exports);
|
|
23
23
|
__exportStar(require("./types/UserRoles"), exports);
|
|
24
24
|
__exportStar(require("./middlewares/requireRole"), exports);
|
|
25
|
+
__exportStar(require("./constants/HttpStatus"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export enum HttpStatus {
|
|
2
|
+
// 2xx Success
|
|
3
|
+
OK = 200,
|
|
4
|
+
CREATED = 201,
|
|
5
|
+
ACCEPTED = 202,
|
|
6
|
+
NO_CONTENT = 204,
|
|
7
|
+
|
|
8
|
+
// 3xx Redirection
|
|
9
|
+
MOVED_PERMANENTLY = 301,
|
|
10
|
+
FOUND = 302,
|
|
11
|
+
NOT_MODIFIED = 304,
|
|
12
|
+
|
|
13
|
+
// 4xx Client Errors
|
|
14
|
+
BAD_REQUEST = 400,
|
|
15
|
+
UNAUTHORIZED = 401,
|
|
16
|
+
PAYMENT_REQUIRED = 402,
|
|
17
|
+
FORBIDDEN = 403,
|
|
18
|
+
NOT_FOUND = 404,
|
|
19
|
+
METHOD_NOT_ALLOWED = 405,
|
|
20
|
+
NOT_ACCEPTABLE = 406,
|
|
21
|
+
REQUEST_TIMEOUT = 408,
|
|
22
|
+
CONFLICT = 409,
|
|
23
|
+
GONE = 410,
|
|
24
|
+
PAYLOAD_TOO_LARGE = 413,
|
|
25
|
+
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
26
|
+
TOO_MANY_REQUESTS = 429,
|
|
27
|
+
|
|
28
|
+
// 5xx Server Errors
|
|
29
|
+
INTERNAL_SERVER_ERROR = 500,
|
|
30
|
+
NOT_IMPLEMENTED = 501,
|
|
31
|
+
BAD_GATEWAY = 502,
|
|
32
|
+
SERVICE_UNAVAILABLE = 503,
|
|
33
|
+
GATEWAY_TIMEOUT = 504,
|
|
34
|
+
}
|