@spytecgps/lambda-utils 0.9.2 → 0.9.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/BadRequestError.js +25 -0
- package/dist/errors/NotFoundError.js +26 -0
- package/dist/errors/UnauthorizedError.js +26 -0
- package/dist/errors/index.js +9 -0
- package/dist/index.js +16 -2
- package/dist/types.js +2 -0
- package/dist/validation/custom.js +37 -0
- package/dist/validation/index.js +17 -0
- package/dist/validation/requestContext.js +35 -0
- package/dist/validation/validateEvent.js +24 -0
- package/dist/wrappers/apiGatewayEventWrapper.js +70 -0
- package/dist/wrappers/index.js +16 -0
- package/dist/wrappers/response.js +33 -0
- package/package.json +2 -4
- package/dist/apiGwWrapper.d.ts +0 -4
- package/dist/index.js.map +0 -1
- package/dist/response.d.ts +0 -8
- package/dist/wrapper.d.ts +0 -4
- package/dist/wrappers/apiGwWrapper.d.ts +0 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
var BadRequestError = /** @class */ (function (_super) {
|
|
17
|
+
__extends(BadRequestError, _super);
|
|
18
|
+
function BadRequestError() {
|
|
19
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
20
|
+
_this.code = 400;
|
|
21
|
+
return _this;
|
|
22
|
+
}
|
|
23
|
+
return BadRequestError;
|
|
24
|
+
}(Error));
|
|
25
|
+
exports.default = BadRequestError;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
var NotFoundError = /** @class */ (function (_super) {
|
|
17
|
+
__extends(NotFoundError, _super);
|
|
18
|
+
function NotFoundError() {
|
|
19
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
20
|
+
_this.code = 404;
|
|
21
|
+
_this.message = 'Not found';
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
return NotFoundError;
|
|
25
|
+
}(Error));
|
|
26
|
+
exports.default = NotFoundError;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
var UnauthorizedError = /** @class */ (function (_super) {
|
|
17
|
+
__extends(UnauthorizedError, _super);
|
|
18
|
+
function UnauthorizedError() {
|
|
19
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
20
|
+
_this.code = 401;
|
|
21
|
+
_this.message = 'Unauthorized';
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
return UnauthorizedError;
|
|
25
|
+
}(Error));
|
|
26
|
+
exports.default = UnauthorizedError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnauthorizedError = exports.NotFoundError = exports.BadRequestError = void 0;
|
|
4
|
+
var BadRequestError_1 = require("./BadRequestError");
|
|
5
|
+
exports.BadRequestError = BadRequestError_1.default;
|
|
6
|
+
var NotFoundError_1 = require("./NotFoundError");
|
|
7
|
+
exports.NotFoundError = NotFoundError_1.default;
|
|
8
|
+
var UnauthorizedError_1 = require("./UnauthorizedError");
|
|
9
|
+
exports.UnauthorizedError = UnauthorizedError_1.default;
|