@nr1e/commons 0.0.3-alpha.1 → 0.0.3-alpha.3
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/LICENSE +1 -1
- package/errors/errors.d.ts +22 -18
- package/errors/errors.js +27 -49
- package/errors/errors.js.map +1 -1
- package/package.json +5 -5
package/LICENSE
CHANGED
package/errors/errors.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { HttpStatusCode } from '../http';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the given parameter is an Error.
|
|
4
|
+
*
|
|
5
|
+
* @param item the parameter to check
|
|
6
|
+
*/
|
|
7
|
+
export declare function isError(item: unknown): item is Error;
|
|
9
8
|
/**
|
|
10
9
|
* An extended version of Error that includes an HttpStatusCode.
|
|
11
10
|
* This can be useful in middleware error handlers to determine http status codes to return to the client.
|
|
@@ -18,13 +17,13 @@ export interface HttpError extends Error {
|
|
|
18
17
|
*
|
|
19
18
|
* @param e the parameter to check
|
|
20
19
|
*/
|
|
21
|
-
export declare function isHttpError(e?:
|
|
20
|
+
export declare function isHttpError(e?: unknown): e is HttpError;
|
|
22
21
|
/**
|
|
23
22
|
* Checks if the given parameter is a NotFoundError.
|
|
24
23
|
*
|
|
25
24
|
* @param e the parameter to check
|
|
26
25
|
*/
|
|
27
|
-
export declare function isNotFoundError(e?:
|
|
26
|
+
export declare function isNotFoundError(e?: unknown): e is NotFoundError;
|
|
28
27
|
/**
|
|
29
28
|
* Thrown when a resource cannot be found.
|
|
30
29
|
*/
|
|
@@ -37,7 +36,7 @@ export declare class NotFoundError extends Error implements HttpError {
|
|
|
37
36
|
*
|
|
38
37
|
* @param e the parameter to check
|
|
39
38
|
*/
|
|
40
|
-
export declare function isForbiddenError(e?:
|
|
39
|
+
export declare function isForbiddenError(e?: unknown): e is ForbiddenError;
|
|
41
40
|
/**
|
|
42
41
|
* Thrown when a requested operations is not allowed.
|
|
43
42
|
*/
|
|
@@ -50,7 +49,7 @@ export declare class ForbiddenError extends Error implements HttpError {
|
|
|
50
49
|
*
|
|
51
50
|
* @param e the variable to check
|
|
52
51
|
*/
|
|
53
|
-
export declare function isValidationError(e?:
|
|
52
|
+
export declare function isValidationError(e?: unknown): e is ValidationError;
|
|
54
53
|
/**
|
|
55
54
|
* Thrown when a validation error occurs.
|
|
56
55
|
*/
|
|
@@ -63,7 +62,7 @@ export declare class ValidationError extends Error implements HttpError {
|
|
|
63
62
|
*
|
|
64
63
|
* @param e the parameter to check
|
|
65
64
|
*/
|
|
66
|
-
export declare function isBadRequestError(e?:
|
|
65
|
+
export declare function isBadRequestError(e?: unknown): e is BadRequestError;
|
|
67
66
|
/**
|
|
68
67
|
* Thrown when a bad request is made.
|
|
69
68
|
*/
|
|
@@ -76,7 +75,7 @@ export declare class BadRequestError extends Error implements HttpError {
|
|
|
76
75
|
*
|
|
77
76
|
* @param e the parameter to check
|
|
78
77
|
*/
|
|
79
|
-
export declare function isInternalServerError(e?:
|
|
78
|
+
export declare function isInternalServerError(e?: unknown): e is InternalServerError;
|
|
80
79
|
/**
|
|
81
80
|
* Throws when an internal server error occurs.
|
|
82
81
|
*/
|
|
@@ -89,7 +88,7 @@ export declare class InternalServerError extends Error implements HttpError {
|
|
|
89
88
|
*
|
|
90
89
|
* @param e the parameter to check
|
|
91
90
|
*/
|
|
92
|
-
export declare function isConflictError(e?:
|
|
91
|
+
export declare function isConflictError(e?: unknown): e is ConflictError;
|
|
93
92
|
/**
|
|
94
93
|
* Thrown when a conflict occurs.
|
|
95
94
|
*/
|
|
@@ -102,7 +101,7 @@ export declare class ConflictError extends Error implements HttpError {
|
|
|
102
101
|
*
|
|
103
102
|
* @param e the parameter to check
|
|
104
103
|
*/
|
|
105
|
-
export declare function isUnsupportedMediaTypeError(e?:
|
|
104
|
+
export declare function isUnsupportedMediaTypeError(e?: unknown): e is UnsupportedMediaTypeError;
|
|
106
105
|
/**
|
|
107
106
|
* Thrown when a unsupported media type is used.
|
|
108
107
|
*/
|
|
@@ -115,7 +114,7 @@ export declare class UnsupportedMediaTypeError extends Error implements HttpErro
|
|
|
115
114
|
*
|
|
116
115
|
* @param e the parameter to check
|
|
117
116
|
*/
|
|
118
|
-
export declare function isNotImplementedError(e?:
|
|
117
|
+
export declare function isNotImplementedError(e?: unknown): e is NotImplementedError;
|
|
119
118
|
/**
|
|
120
119
|
* Thrown when a requested operation is not implemented.
|
|
121
120
|
*/
|
|
@@ -129,7 +128,7 @@ export declare class NotImplementedError extends Error implements HttpError {
|
|
|
129
128
|
*
|
|
130
129
|
* @param e the parameter to check
|
|
131
130
|
*/
|
|
132
|
-
export declare function isIllegalArgumentError(e?:
|
|
131
|
+
export declare function isIllegalArgumentError(e?: unknown): e is IllegalArgumentError;
|
|
133
132
|
/**
|
|
134
133
|
* Thrown when an illegal argument is passed to a function.
|
|
135
134
|
*/
|
|
@@ -137,5 +136,10 @@ export declare class IllegalArgumentError extends Error {
|
|
|
137
136
|
readonly argName: string;
|
|
138
137
|
constructor(argName: string, message?: string);
|
|
139
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Converts the given parameter to an HttpError.
|
|
141
|
+
*
|
|
142
|
+
* @param code The HTTP status code
|
|
143
|
+
* @param message The error message
|
|
144
|
+
*/
|
|
140
145
|
export declare function toError(code: number | HttpStatusCode, message?: string): Error;
|
|
141
|
-
export {};
|
package/errors/errors.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toError = exports.IllegalArgumentError = exports.isIllegalArgumentError = exports.NotImplementedError = exports.isNotImplementedError = exports.UnsupportedMediaTypeError = exports.isUnsupportedMediaTypeError = exports.ConflictError = exports.isConflictError = exports.InternalServerError = exports.isInternalServerError = exports.BadRequestError = exports.isBadRequestError = exports.ValidationError = exports.isValidationError = exports.ForbiddenError = exports.isForbiddenError = exports.NotFoundError = exports.isNotFoundError = exports.isHttpError = void 0;
|
|
3
|
+
exports.toError = exports.IllegalArgumentError = exports.isIllegalArgumentError = exports.NotImplementedError = exports.isNotImplementedError = exports.UnsupportedMediaTypeError = exports.isUnsupportedMediaTypeError = exports.ConflictError = exports.isConflictError = exports.InternalServerError = exports.isInternalServerError = exports.BadRequestError = exports.isBadRequestError = exports.ValidationError = exports.isValidationError = exports.ForbiddenError = exports.isForbiddenError = exports.NotFoundError = exports.isNotFoundError = exports.isHttpError = exports.isError = void 0;
|
|
4
4
|
const http_1 = require("../http");
|
|
5
|
+
const lang_1 = require("../lang");
|
|
6
|
+
/**
|
|
7
|
+
* Checks if the given parameter is an Error.
|
|
8
|
+
*
|
|
9
|
+
* @param item the parameter to check
|
|
10
|
+
*/
|
|
11
|
+
function isError(item) {
|
|
12
|
+
return item instanceof Error;
|
|
13
|
+
}
|
|
14
|
+
exports.isError = isError;
|
|
5
15
|
/**
|
|
6
16
|
* Checks if the given parameter is an HttpError.
|
|
7
17
|
*
|
|
8
18
|
* @param e the parameter to check
|
|
9
19
|
*/
|
|
10
20
|
function isHttpError(e) {
|
|
11
|
-
return !!(e && e.stack && e.statusCode && e.message && e.name);
|
|
21
|
+
return (0, lang_1.isObject)(e) && !!(e && e.stack && e.statusCode && e.message && e.name);
|
|
12
22
|
}
|
|
13
23
|
exports.isHttpError = isHttpError;
|
|
14
24
|
/**
|
|
@@ -17,12 +27,7 @@ exports.isHttpError = isHttpError;
|
|
|
17
27
|
* @param e the parameter to check
|
|
18
28
|
*/
|
|
19
29
|
function isNotFoundError(e) {
|
|
20
|
-
return
|
|
21
|
-
e.stack &&
|
|
22
|
-
e.statusCode &&
|
|
23
|
-
e.message &&
|
|
24
|
-
e.name &&
|
|
25
|
-
e.name === 'NotFoundError');
|
|
30
|
+
return isHttpError(e) && e.name === 'NotFoundError';
|
|
26
31
|
}
|
|
27
32
|
exports.isNotFoundError = isNotFoundError;
|
|
28
33
|
/**
|
|
@@ -43,12 +48,7 @@ exports.NotFoundError = NotFoundError;
|
|
|
43
48
|
* @param e the parameter to check
|
|
44
49
|
*/
|
|
45
50
|
function isForbiddenError(e) {
|
|
46
|
-
return
|
|
47
|
-
e.stack &&
|
|
48
|
-
e.statusCode &&
|
|
49
|
-
e.message &&
|
|
50
|
-
e.name &&
|
|
51
|
-
e.name === 'ForbiddenError');
|
|
51
|
+
return isHttpError(e) && e.name === 'ForbiddenError';
|
|
52
52
|
}
|
|
53
53
|
exports.isForbiddenError = isForbiddenError;
|
|
54
54
|
/**
|
|
@@ -69,11 +69,7 @@ exports.ForbiddenError = ForbiddenError;
|
|
|
69
69
|
* @param e the variable to check
|
|
70
70
|
*/
|
|
71
71
|
function isValidationError(e) {
|
|
72
|
-
return
|
|
73
|
-
e.stack &&
|
|
74
|
-
e.statusCode &&
|
|
75
|
-
e.message &&
|
|
76
|
-
e.name === 'ValidationError');
|
|
72
|
+
return isHttpError(e) && e.name === 'ValidationError';
|
|
77
73
|
}
|
|
78
74
|
exports.isValidationError = isValidationError;
|
|
79
75
|
/**
|
|
@@ -94,11 +90,7 @@ exports.ValidationError = ValidationError;
|
|
|
94
90
|
* @param e the parameter to check
|
|
95
91
|
*/
|
|
96
92
|
function isBadRequestError(e) {
|
|
97
|
-
return
|
|
98
|
-
e.stack &&
|
|
99
|
-
e.statusCode &&
|
|
100
|
-
e.message &&
|
|
101
|
-
e.name === 'BadRequestError');
|
|
93
|
+
return isHttpError(e) && e.name === 'BadRequestError';
|
|
102
94
|
}
|
|
103
95
|
exports.isBadRequestError = isBadRequestError;
|
|
104
96
|
/**
|
|
@@ -119,11 +111,7 @@ exports.BadRequestError = BadRequestError;
|
|
|
119
111
|
* @param e the parameter to check
|
|
120
112
|
*/
|
|
121
113
|
function isInternalServerError(e) {
|
|
122
|
-
return
|
|
123
|
-
e.stack &&
|
|
124
|
-
e.statusCode &&
|
|
125
|
-
e.message &&
|
|
126
|
-
e.name === 'InternalServerError');
|
|
114
|
+
return isHttpError(e) && e.name === 'InternalServerError';
|
|
127
115
|
}
|
|
128
116
|
exports.isInternalServerError = isInternalServerError;
|
|
129
117
|
/**
|
|
@@ -144,11 +132,7 @@ exports.InternalServerError = InternalServerError;
|
|
|
144
132
|
* @param e the parameter to check
|
|
145
133
|
*/
|
|
146
134
|
function isConflictError(e) {
|
|
147
|
-
return
|
|
148
|
-
e.stack &&
|
|
149
|
-
e.statusCode &&
|
|
150
|
-
e.message &&
|
|
151
|
-
e.name === 'ConflictError');
|
|
135
|
+
return isHttpError(e) && e.name === 'ConflictError';
|
|
152
136
|
}
|
|
153
137
|
exports.isConflictError = isConflictError;
|
|
154
138
|
/**
|
|
@@ -169,11 +153,7 @@ exports.ConflictError = ConflictError;
|
|
|
169
153
|
* @param e the parameter to check
|
|
170
154
|
*/
|
|
171
155
|
function isUnsupportedMediaTypeError(e) {
|
|
172
|
-
return
|
|
173
|
-
e.stack &&
|
|
174
|
-
e.statusCode &&
|
|
175
|
-
e.message &&
|
|
176
|
-
e.name === 'UnsupportedMediaTypeError');
|
|
156
|
+
return isHttpError(e) && e.name === 'UnsupportedMediaTypeError';
|
|
177
157
|
}
|
|
178
158
|
exports.isUnsupportedMediaTypeError = isUnsupportedMediaTypeError;
|
|
179
159
|
/**
|
|
@@ -194,11 +174,7 @@ exports.UnsupportedMediaTypeError = UnsupportedMediaTypeError;
|
|
|
194
174
|
* @param e the parameter to check
|
|
195
175
|
*/
|
|
196
176
|
function isNotImplementedError(e) {
|
|
197
|
-
return
|
|
198
|
-
e.stack &&
|
|
199
|
-
e.statusCode &&
|
|
200
|
-
e.message &&
|
|
201
|
-
e.name === 'NotImplementedError');
|
|
177
|
+
return isHttpError(e) && e.name === 'NotImplementedError';
|
|
202
178
|
}
|
|
203
179
|
exports.isNotImplementedError = isNotImplementedError;
|
|
204
180
|
/**
|
|
@@ -220,11 +196,7 @@ exports.NotImplementedError = NotImplementedError;
|
|
|
220
196
|
* @param e the parameter to check
|
|
221
197
|
*/
|
|
222
198
|
function isIllegalArgumentError(e) {
|
|
223
|
-
return
|
|
224
|
-
e.stack &&
|
|
225
|
-
e.argName &&
|
|
226
|
-
e.message &&
|
|
227
|
-
e.name === 'IllegalArgumentError');
|
|
199
|
+
return isError(e) && e.name === 'IllegalArgumentError';
|
|
228
200
|
}
|
|
229
201
|
exports.isIllegalArgumentError = isIllegalArgumentError;
|
|
230
202
|
/**
|
|
@@ -239,6 +211,12 @@ class IllegalArgumentError extends Error {
|
|
|
239
211
|
}
|
|
240
212
|
}
|
|
241
213
|
exports.IllegalArgumentError = IllegalArgumentError;
|
|
214
|
+
/**
|
|
215
|
+
* Converts the given parameter to an HttpError.
|
|
216
|
+
*
|
|
217
|
+
* @param code The HTTP status code
|
|
218
|
+
* @param message The error message
|
|
219
|
+
*/
|
|
242
220
|
function toError(code, message) {
|
|
243
221
|
switch (code) {
|
|
244
222
|
case http_1.HttpStatusCode.NOT_FOUND:
|
package/errors/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["errors.ts"],"names":[],"mappings":";;;AAAA,kCAAuC;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["errors.ts"],"names":[],"mappings":";;;AAAA,kCAAuC;AACvC,kCAAiC;AAEjC;;;;GAIG;AACH,SAAgB,OAAO,CAAC,IAAa;IACnC,OAAO,IAAI,YAAY,KAAK,CAAC;AAC/B,CAAC;AAFD,0BAEC;AAUD;;;;GAIG;AACH,SAAgB,WAAW,CAAC,CAAW;IACrC,OAAO,IAAA,eAAQ,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAChF,CAAC;AAFD,kCAEC;AAED;;;;GAIG;AACH,SAAgB,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|
|
4
|
+
"version": "0.0.3-alpha.3",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"author": "NR1E, Inc.",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": "./index.js",
|
|
33
|
-
"./
|
|
34
|
-
"./http": "./http/index.js",
|
|
33
|
+
"./bitsnbytes": "./bitsnbytes/index.js",
|
|
35
34
|
"./errors": "./errors/index.js",
|
|
36
|
-
"./
|
|
35
|
+
"./http": "./http/index.js",
|
|
37
36
|
"./lang": "./lang/index.js",
|
|
38
|
-
"./
|
|
37
|
+
"./package.json": "./package.json",
|
|
38
|
+
"./validator": "./validator/index.js"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc",
|