@spytecgps/lambda-utils 3.0.1 → 3.0.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/dist/errors/GoneError.d.ts +6 -0
- package/dist/errors/index.d.ts +2 -1
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/dist/errors/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import BadRequestError from './BadRequestError';
|
|
|
2
2
|
import BaseError from './BaseError';
|
|
3
3
|
import ConflictError from './ConflictError';
|
|
4
4
|
import ForbiddenError from './ForbiddenError';
|
|
5
|
+
import GoneError from './GoneError';
|
|
5
6
|
import HttpError from './HttpError';
|
|
6
7
|
import NotFoundError from './NotFoundError';
|
|
7
8
|
import UnauthorizedError from './UnauthorizedError';
|
|
8
|
-
export { BadRequestError,
|
|
9
|
+
export { BadRequestError, BaseError, ConflictError, ForbiddenError, GoneError, HttpError, NotFoundError, UnauthorizedError, };
|
package/dist/index.js
CHANGED
|
@@ -79,6 +79,12 @@ class ForbiddenError extends HttpError {
|
|
|
79
79
|
name = 'ForbiddenError';
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
class GoneError extends HttpError {
|
|
83
|
+
code = 410;
|
|
84
|
+
statusCode = 410;
|
|
85
|
+
name = 'GoneError';
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
class NotFoundError extends HttpError {
|
|
83
89
|
code = 404;
|
|
84
90
|
statusCode = 404;
|
|
@@ -305,7 +311,7 @@ const getBaseMiddlewares = ({ logger }) => [
|
|
|
305
311
|
ioLogger({ logger }),
|
|
306
312
|
];
|
|
307
313
|
// Function that returns API Gateway middlewares with required logger
|
|
308
|
-
const getApiGatewayMiddlewares = ({ logger, offlineAuthEnabled
|
|
314
|
+
const getApiGatewayMiddlewares = ({ logger, offlineAuthEnabled }) => [
|
|
309
315
|
httpResponseSerializer({
|
|
310
316
|
serializers: [
|
|
311
317
|
{
|
|
@@ -618,6 +624,7 @@ exports.BadRequestError = BadRequestError;
|
|
|
618
624
|
exports.BaseError = BaseError;
|
|
619
625
|
exports.ConflictError = ConflictError;
|
|
620
626
|
exports.ForbiddenError = ForbiddenError;
|
|
627
|
+
exports.GoneError = GoneError;
|
|
621
628
|
exports.HttpError = HttpError;
|
|
622
629
|
exports.LambdaCache = LambdaCache;
|
|
623
630
|
exports.NotFoundError = NotFoundError;
|