@nr1e/commons 0.0.3-alpha.1 → 0.0.3-alpha.2
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 +16 -18
- package/errors/errors.js +17 -48
- package/errors/errors.js.map +1 -1
- package/package.json +5 -5
package/LICENSE
CHANGED
package/errors/errors.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { HttpStatusCode } from '../http';
|
|
2
|
-
interface IError {
|
|
3
|
-
stack?: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
argName?: string;
|
|
6
|
-
message?: string;
|
|
7
|
-
statusCode?: HttpStatusCode | number;
|
|
8
|
-
}
|
|
9
2
|
/**
|
|
10
3
|
* An extended version of Error that includes an HttpStatusCode.
|
|
11
4
|
* This can be useful in middleware error handlers to determine http status codes to return to the client.
|
|
@@ -18,13 +11,13 @@ export interface HttpError extends Error {
|
|
|
18
11
|
*
|
|
19
12
|
* @param e the parameter to check
|
|
20
13
|
*/
|
|
21
|
-
export declare function isHttpError(e?:
|
|
14
|
+
export declare function isHttpError(e?: unknown): e is HttpError;
|
|
22
15
|
/**
|
|
23
16
|
* Checks if the given parameter is a NotFoundError.
|
|
24
17
|
*
|
|
25
18
|
* @param e the parameter to check
|
|
26
19
|
*/
|
|
27
|
-
export declare function isNotFoundError(e?:
|
|
20
|
+
export declare function isNotFoundError(e?: unknown): e is NotFoundError;
|
|
28
21
|
/**
|
|
29
22
|
* Thrown when a resource cannot be found.
|
|
30
23
|
*/
|
|
@@ -37,7 +30,7 @@ export declare class NotFoundError extends Error implements HttpError {
|
|
|
37
30
|
*
|
|
38
31
|
* @param e the parameter to check
|
|
39
32
|
*/
|
|
40
|
-
export declare function isForbiddenError(e?:
|
|
33
|
+
export declare function isForbiddenError(e?: unknown): e is ForbiddenError;
|
|
41
34
|
/**
|
|
42
35
|
* Thrown when a requested operations is not allowed.
|
|
43
36
|
*/
|
|
@@ -50,7 +43,7 @@ export declare class ForbiddenError extends Error implements HttpError {
|
|
|
50
43
|
*
|
|
51
44
|
* @param e the variable to check
|
|
52
45
|
*/
|
|
53
|
-
export declare function isValidationError(e?:
|
|
46
|
+
export declare function isValidationError(e?: unknown): e is ValidationError;
|
|
54
47
|
/**
|
|
55
48
|
* Thrown when a validation error occurs.
|
|
56
49
|
*/
|
|
@@ -63,7 +56,7 @@ export declare class ValidationError extends Error implements HttpError {
|
|
|
63
56
|
*
|
|
64
57
|
* @param e the parameter to check
|
|
65
58
|
*/
|
|
66
|
-
export declare function isBadRequestError(e?:
|
|
59
|
+
export declare function isBadRequestError(e?: unknown): e is BadRequestError;
|
|
67
60
|
/**
|
|
68
61
|
* Thrown when a bad request is made.
|
|
69
62
|
*/
|
|
@@ -76,7 +69,7 @@ export declare class BadRequestError extends Error implements HttpError {
|
|
|
76
69
|
*
|
|
77
70
|
* @param e the parameter to check
|
|
78
71
|
*/
|
|
79
|
-
export declare function isInternalServerError(e?:
|
|
72
|
+
export declare function isInternalServerError(e?: unknown): e is InternalServerError;
|
|
80
73
|
/**
|
|
81
74
|
* Throws when an internal server error occurs.
|
|
82
75
|
*/
|
|
@@ -89,7 +82,7 @@ export declare class InternalServerError extends Error implements HttpError {
|
|
|
89
82
|
*
|
|
90
83
|
* @param e the parameter to check
|
|
91
84
|
*/
|
|
92
|
-
export declare function isConflictError(e?:
|
|
85
|
+
export declare function isConflictError(e?: unknown): e is ConflictError;
|
|
93
86
|
/**
|
|
94
87
|
* Thrown when a conflict occurs.
|
|
95
88
|
*/
|
|
@@ -102,7 +95,7 @@ export declare class ConflictError extends Error implements HttpError {
|
|
|
102
95
|
*
|
|
103
96
|
* @param e the parameter to check
|
|
104
97
|
*/
|
|
105
|
-
export declare function isUnsupportedMediaTypeError(e?:
|
|
98
|
+
export declare function isUnsupportedMediaTypeError(e?: unknown): e is UnsupportedMediaTypeError;
|
|
106
99
|
/**
|
|
107
100
|
* Thrown when a unsupported media type is used.
|
|
108
101
|
*/
|
|
@@ -115,7 +108,7 @@ export declare class UnsupportedMediaTypeError extends Error implements HttpErro
|
|
|
115
108
|
*
|
|
116
109
|
* @param e the parameter to check
|
|
117
110
|
*/
|
|
118
|
-
export declare function isNotImplementedError(e?:
|
|
111
|
+
export declare function isNotImplementedError(e?: unknown): e is NotImplementedError;
|
|
119
112
|
/**
|
|
120
113
|
* Thrown when a requested operation is not implemented.
|
|
121
114
|
*/
|
|
@@ -129,7 +122,7 @@ export declare class NotImplementedError extends Error implements HttpError {
|
|
|
129
122
|
*
|
|
130
123
|
* @param e the parameter to check
|
|
131
124
|
*/
|
|
132
|
-
export declare function isIllegalArgumentError(e?:
|
|
125
|
+
export declare function isIllegalArgumentError(e?: unknown): e is IllegalArgumentError;
|
|
133
126
|
/**
|
|
134
127
|
* Thrown when an illegal argument is passed to a function.
|
|
135
128
|
*/
|
|
@@ -137,5 +130,10 @@ export declare class IllegalArgumentError extends Error {
|
|
|
137
130
|
readonly argName: string;
|
|
138
131
|
constructor(argName: string, message?: string);
|
|
139
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Converts the given parameter to an HttpError.
|
|
135
|
+
*
|
|
136
|
+
* @param code The HTTP status code
|
|
137
|
+
* @param message The error message
|
|
138
|
+
*/
|
|
140
139
|
export declare function toError(code: number | HttpStatusCode, message?: string): Error;
|
|
141
|
-
export {};
|
package/errors/errors.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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;
|
|
4
4
|
const http_1 = require("../http");
|
|
5
|
+
const lang_1 = require("../lang");
|
|
5
6
|
/**
|
|
6
7
|
* Checks if the given parameter is an HttpError.
|
|
7
8
|
*
|
|
8
9
|
* @param e the parameter to check
|
|
9
10
|
*/
|
|
10
11
|
function isHttpError(e) {
|
|
11
|
-
return !!(e && e.stack && e.statusCode && e.message && e.name);
|
|
12
|
+
return (0, lang_1.isObject)(e) && !!(e && e.stack && e.statusCode && e.message && e.name);
|
|
12
13
|
}
|
|
13
14
|
exports.isHttpError = isHttpError;
|
|
14
15
|
/**
|
|
@@ -17,12 +18,7 @@ exports.isHttpError = isHttpError;
|
|
|
17
18
|
* @param e the parameter to check
|
|
18
19
|
*/
|
|
19
20
|
function isNotFoundError(e) {
|
|
20
|
-
return
|
|
21
|
-
e.stack &&
|
|
22
|
-
e.statusCode &&
|
|
23
|
-
e.message &&
|
|
24
|
-
e.name &&
|
|
25
|
-
e.name === 'NotFoundError');
|
|
21
|
+
return isHttpError(e) && e.name === 'NotFoundError';
|
|
26
22
|
}
|
|
27
23
|
exports.isNotFoundError = isNotFoundError;
|
|
28
24
|
/**
|
|
@@ -43,12 +39,7 @@ exports.NotFoundError = NotFoundError;
|
|
|
43
39
|
* @param e the parameter to check
|
|
44
40
|
*/
|
|
45
41
|
function isForbiddenError(e) {
|
|
46
|
-
return
|
|
47
|
-
e.stack &&
|
|
48
|
-
e.statusCode &&
|
|
49
|
-
e.message &&
|
|
50
|
-
e.name &&
|
|
51
|
-
e.name === 'ForbiddenError');
|
|
42
|
+
return isHttpError(e) && e.name === 'ForbiddenError';
|
|
52
43
|
}
|
|
53
44
|
exports.isForbiddenError = isForbiddenError;
|
|
54
45
|
/**
|
|
@@ -69,11 +60,7 @@ exports.ForbiddenError = ForbiddenError;
|
|
|
69
60
|
* @param e the variable to check
|
|
70
61
|
*/
|
|
71
62
|
function isValidationError(e) {
|
|
72
|
-
return
|
|
73
|
-
e.stack &&
|
|
74
|
-
e.statusCode &&
|
|
75
|
-
e.message &&
|
|
76
|
-
e.name === 'ValidationError');
|
|
63
|
+
return isHttpError(e) && e.name === 'ValidationError';
|
|
77
64
|
}
|
|
78
65
|
exports.isValidationError = isValidationError;
|
|
79
66
|
/**
|
|
@@ -94,11 +81,7 @@ exports.ValidationError = ValidationError;
|
|
|
94
81
|
* @param e the parameter to check
|
|
95
82
|
*/
|
|
96
83
|
function isBadRequestError(e) {
|
|
97
|
-
return
|
|
98
|
-
e.stack &&
|
|
99
|
-
e.statusCode &&
|
|
100
|
-
e.message &&
|
|
101
|
-
e.name === 'BadRequestError');
|
|
84
|
+
return isHttpError(e) && e.name === 'BadRequestError';
|
|
102
85
|
}
|
|
103
86
|
exports.isBadRequestError = isBadRequestError;
|
|
104
87
|
/**
|
|
@@ -119,11 +102,7 @@ exports.BadRequestError = BadRequestError;
|
|
|
119
102
|
* @param e the parameter to check
|
|
120
103
|
*/
|
|
121
104
|
function isInternalServerError(e) {
|
|
122
|
-
return
|
|
123
|
-
e.stack &&
|
|
124
|
-
e.statusCode &&
|
|
125
|
-
e.message &&
|
|
126
|
-
e.name === 'InternalServerError');
|
|
105
|
+
return isHttpError(e) && e.name === 'InternalServerError';
|
|
127
106
|
}
|
|
128
107
|
exports.isInternalServerError = isInternalServerError;
|
|
129
108
|
/**
|
|
@@ -144,11 +123,7 @@ exports.InternalServerError = InternalServerError;
|
|
|
144
123
|
* @param e the parameter to check
|
|
145
124
|
*/
|
|
146
125
|
function isConflictError(e) {
|
|
147
|
-
return
|
|
148
|
-
e.stack &&
|
|
149
|
-
e.statusCode &&
|
|
150
|
-
e.message &&
|
|
151
|
-
e.name === 'ConflictError');
|
|
126
|
+
return isHttpError(e) && e.name === 'ConflictError';
|
|
152
127
|
}
|
|
153
128
|
exports.isConflictError = isConflictError;
|
|
154
129
|
/**
|
|
@@ -169,11 +144,7 @@ exports.ConflictError = ConflictError;
|
|
|
169
144
|
* @param e the parameter to check
|
|
170
145
|
*/
|
|
171
146
|
function isUnsupportedMediaTypeError(e) {
|
|
172
|
-
return
|
|
173
|
-
e.stack &&
|
|
174
|
-
e.statusCode &&
|
|
175
|
-
e.message &&
|
|
176
|
-
e.name === 'UnsupportedMediaTypeError');
|
|
147
|
+
return isHttpError(e) && e.name === 'UnsupportedMediaTypeError';
|
|
177
148
|
}
|
|
178
149
|
exports.isUnsupportedMediaTypeError = isUnsupportedMediaTypeError;
|
|
179
150
|
/**
|
|
@@ -194,11 +165,7 @@ exports.UnsupportedMediaTypeError = UnsupportedMediaTypeError;
|
|
|
194
165
|
* @param e the parameter to check
|
|
195
166
|
*/
|
|
196
167
|
function isNotImplementedError(e) {
|
|
197
|
-
return
|
|
198
|
-
e.stack &&
|
|
199
|
-
e.statusCode &&
|
|
200
|
-
e.message &&
|
|
201
|
-
e.name === 'NotImplementedError');
|
|
168
|
+
return isHttpError(e) && e.name === 'NotImplementedError';
|
|
202
169
|
}
|
|
203
170
|
exports.isNotImplementedError = isNotImplementedError;
|
|
204
171
|
/**
|
|
@@ -220,11 +187,7 @@ exports.NotImplementedError = NotImplementedError;
|
|
|
220
187
|
* @param e the parameter to check
|
|
221
188
|
*/
|
|
222
189
|
function isIllegalArgumentError(e) {
|
|
223
|
-
return
|
|
224
|
-
e.stack &&
|
|
225
|
-
e.argName &&
|
|
226
|
-
e.message &&
|
|
227
|
-
e.name === 'IllegalArgumentError');
|
|
190
|
+
return (0, lang_1.isError)(e) && e.name === 'IllegalArgumentError';
|
|
228
191
|
}
|
|
229
192
|
exports.isIllegalArgumentError = isIllegalArgumentError;
|
|
230
193
|
/**
|
|
@@ -239,6 +202,12 @@ class IllegalArgumentError extends Error {
|
|
|
239
202
|
}
|
|
240
203
|
}
|
|
241
204
|
exports.IllegalArgumentError = IllegalArgumentError;
|
|
205
|
+
/**
|
|
206
|
+
* Converts the given parameter to an HttpError.
|
|
207
|
+
*
|
|
208
|
+
* @param code The HTTP status code
|
|
209
|
+
* @param message The error message
|
|
210
|
+
*/
|
|
242
211
|
function toError(code, message) {
|
|
243
212
|
switch (code) {
|
|
244
213
|
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,kCAA0C;AAU1C;;;;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,eAAe,CAAC,CAAW;IACzC,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC;AACtD,CAAC;AAFD,0CAEC;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IAEtC,YAAY,OAAgB;QAC1B,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,WAAW,CAAC;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAG,qBAAc,CAAC,SAAS,CAAC;QAI7C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAPD,sCAOC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,CAAW;IAC1C,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC;AACvD,CAAC;AAFD,4CAEC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;IAEvC,YAAY,OAAgB;QAC1B,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,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tC,KAAK,qBAAc,CAAC,qBAAqB;YACvC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C,KAAK,qBAAc,CAAC,QAAQ;YAC1B,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,KAAK,qBAAc,CAAC,sBAAsB;YACxC,OAAO,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAChD,KAAK,qBAAc,CAAC,eAAe;YACjC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C;YACE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC;AAtBD,0BAsBC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nr1e/commons",
|
|
3
3
|
"description": "Provides common patterns for validation",
|
|
4
|
-
"version": "0.0.3-alpha.
|
|
4
|
+
"version": "0.0.3-alpha.2",
|
|
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",
|