@tsed/exceptions 7.0.0-alpha.1 → 7.0.0-beta.10
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/lib/cjs/clientErrors/BadMapping.js +13 -0
- package/lib/cjs/clientErrors/BadMapping.js.map +1 -0
- package/lib/cjs/clientErrors/BadRequest.js +12 -0
- package/lib/cjs/clientErrors/BadRequest.js.map +1 -0
- package/lib/cjs/clientErrors/Conflict.js +12 -0
- package/lib/cjs/clientErrors/Conflict.js.map +1 -0
- package/lib/cjs/clientErrors/ExpectationFailed.js +12 -0
- package/lib/cjs/clientErrors/ExpectationFailed.js.map +1 -0
- package/lib/cjs/clientErrors/Forbidden.js +12 -0
- package/lib/cjs/clientErrors/Forbidden.js.map +1 -0
- package/lib/cjs/clientErrors/Gone.js +12 -0
- package/lib/cjs/clientErrors/Gone.js.map +1 -0
- package/lib/cjs/clientErrors/ImATeapot.js +13 -0
- package/lib/cjs/clientErrors/ImATeapot.js.map +1 -0
- package/lib/cjs/clientErrors/LengthRequired.js +12 -0
- package/lib/cjs/clientErrors/LengthRequired.js.map +1 -0
- package/lib/cjs/clientErrors/MethodNotAllowed.js +12 -0
- package/lib/cjs/clientErrors/MethodNotAllowed.js.map +1 -0
- package/lib/cjs/clientErrors/MisdirectedRequest.js +12 -0
- package/lib/cjs/clientErrors/MisdirectedRequest.js.map +1 -0
- package/lib/cjs/clientErrors/NotAcceptable.js +12 -0
- package/lib/cjs/clientErrors/NotAcceptable.js.map +1 -0
- package/lib/cjs/clientErrors/NotFound.js +12 -0
- package/lib/cjs/clientErrors/NotFound.js.map +1 -0
- package/lib/cjs/clientErrors/PaymentRequired.js +12 -0
- package/lib/cjs/clientErrors/PaymentRequired.js.map +1 -0
- package/lib/cjs/clientErrors/PreconditionFailed.js +12 -0
- package/lib/cjs/clientErrors/PreconditionFailed.js.map +1 -0
- package/lib/cjs/clientErrors/PreconditionRequired.js +12 -0
- package/lib/cjs/clientErrors/PreconditionRequired.js.map +1 -0
- package/lib/cjs/clientErrors/ProxyAuthentificationRequired.js +12 -0
- package/lib/cjs/clientErrors/ProxyAuthentificationRequired.js.map +1 -0
- package/lib/cjs/clientErrors/RequestEntityTooLarge.js +12 -0
- package/lib/cjs/clientErrors/RequestEntityTooLarge.js.map +1 -0
- package/lib/cjs/clientErrors/RequestHeaderFieldsTooLarge.js +12 -0
- package/lib/cjs/clientErrors/RequestHeaderFieldsTooLarge.js.map +1 -0
- package/lib/cjs/clientErrors/RequestRangeUnsatisfiable.js +12 -0
- package/lib/cjs/clientErrors/RequestRangeUnsatisfiable.js.map +1 -0
- package/lib/cjs/clientErrors/RequestTimeout.js +12 -0
- package/lib/cjs/clientErrors/RequestTimeout.js.map +1 -0
- package/lib/cjs/clientErrors/RequestURITooLong.js +12 -0
- package/lib/cjs/clientErrors/RequestURITooLong.js.map +1 -0
- package/lib/cjs/clientErrors/TooManyRequests.js +12 -0
- package/lib/cjs/clientErrors/TooManyRequests.js.map +1 -0
- package/lib/cjs/clientErrors/Unauthorized.js +12 -0
- package/lib/cjs/clientErrors/Unauthorized.js.map +1 -0
- package/lib/cjs/clientErrors/UnavailableForLegalReasons.js +12 -0
- package/lib/cjs/clientErrors/UnavailableForLegalReasons.js.map +1 -0
- package/lib/cjs/clientErrors/UnprocessableEntity.js +12 -0
- package/lib/cjs/clientErrors/UnprocessableEntity.js.map +1 -0
- package/lib/cjs/clientErrors/UnsupportedMediaType.js +12 -0
- package/lib/cjs/clientErrors/UnsupportedMediaType.js.map +1 -0
- package/lib/cjs/clientErrors/UpgradeRequired.js +12 -0
- package/lib/cjs/clientErrors/UpgradeRequired.js.map +1 -0
- package/lib/cjs/core/Exception.js +66 -0
- package/lib/cjs/core/Exception.js.map +1 -0
- package/lib/cjs/index.js +53 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/redirections/MovedPermanently.js +12 -0
- package/lib/cjs/redirections/MovedPermanently.js.map +1 -0
- package/lib/cjs/redirections/MovedTemporarily.js +13 -0
- package/lib/cjs/redirections/MovedTemporarily.js.map +1 -0
- package/lib/cjs/redirections/MultipleChoices.js +12 -0
- package/lib/cjs/redirections/MultipleChoices.js.map +1 -0
- package/lib/cjs/redirections/NotModified.js +12 -0
- package/lib/cjs/redirections/NotModified.js.map +1 -0
- package/lib/cjs/redirections/PermanentRedirect.js +12 -0
- package/lib/cjs/redirections/PermanentRedirect.js.map +1 -0
- package/lib/cjs/redirections/SeeOther.js +12 -0
- package/lib/cjs/redirections/SeeOther.js.map +1 -0
- package/lib/cjs/redirections/TemporaryRedirect.js +12 -0
- package/lib/cjs/redirections/TemporaryRedirect.js.map +1 -0
- package/lib/cjs/redirections/UseProxy.js +12 -0
- package/lib/cjs/redirections/UseProxy.js.map +1 -0
- package/lib/cjs/serverErrors/BadGateway.js +12 -0
- package/lib/cjs/serverErrors/BadGateway.js.map +1 -0
- package/lib/cjs/serverErrors/BandwidthLimitExceeded.js +12 -0
- package/lib/cjs/serverErrors/BandwidthLimitExceeded.js.map +1 -0
- package/lib/cjs/serverErrors/GatewayTimeout.js +12 -0
- package/lib/cjs/serverErrors/GatewayTimeout.js.map +1 -0
- package/lib/cjs/serverErrors/InternalServerError.js +12 -0
- package/lib/cjs/serverErrors/InternalServerError.js.map +1 -0
- package/lib/cjs/serverErrors/NetworkAuthenticationRequired.js +12 -0
- package/lib/cjs/serverErrors/NetworkAuthenticationRequired.js.map +1 -0
- package/lib/cjs/serverErrors/NotExtended.js +12 -0
- package/lib/cjs/serverErrors/NotExtended.js.map +1 -0
- package/lib/cjs/serverErrors/NotImplemented.js +12 -0
- package/lib/cjs/serverErrors/NotImplemented.js.map +1 -0
- package/lib/cjs/serverErrors/ProxyError.js +13 -0
- package/lib/cjs/serverErrors/ProxyError.js.map +1 -0
- package/lib/cjs/serverErrors/ServiceUnvailable.js +12 -0
- package/lib/cjs/serverErrors/ServiceUnvailable.js.map +1 -0
- package/lib/cjs/serverErrors/VariantAlsoNegotiates.js +12 -0
- package/lib/cjs/serverErrors/VariantAlsoNegotiates.js.map +1 -0
- package/lib/esm/clientErrors/BadMapping.js +9 -0
- package/lib/esm/clientErrors/BadMapping.js.map +1 -0
- package/lib/esm/clientErrors/BadRequest.js +8 -0
- package/lib/esm/clientErrors/BadRequest.js.map +1 -0
- package/lib/esm/clientErrors/Conflict.js +8 -0
- package/lib/esm/clientErrors/Conflict.js.map +1 -0
- package/lib/esm/clientErrors/ExpectationFailed.js +8 -0
- package/lib/esm/clientErrors/ExpectationFailed.js.map +1 -0
- package/lib/esm/clientErrors/Forbidden.js +8 -0
- package/lib/esm/clientErrors/Forbidden.js.map +1 -0
- package/lib/esm/clientErrors/Gone.js +8 -0
- package/lib/esm/clientErrors/Gone.js.map +1 -0
- package/lib/esm/clientErrors/ImATeapot.js +9 -0
- package/lib/esm/clientErrors/ImATeapot.js.map +1 -0
- package/lib/esm/clientErrors/LengthRequired.js +8 -0
- package/lib/esm/clientErrors/LengthRequired.js.map +1 -0
- package/lib/esm/clientErrors/MethodNotAllowed.js +8 -0
- package/lib/esm/clientErrors/MethodNotAllowed.js.map +1 -0
- package/lib/esm/clientErrors/MisdirectedRequest.js +8 -0
- package/lib/esm/clientErrors/MisdirectedRequest.js.map +1 -0
- package/lib/esm/clientErrors/NotAcceptable.js +8 -0
- package/lib/esm/clientErrors/NotAcceptable.js.map +1 -0
- package/lib/esm/clientErrors/NotFound.js +8 -0
- package/lib/esm/clientErrors/NotFound.js.map +1 -0
- package/lib/esm/clientErrors/PaymentRequired.js +8 -0
- package/lib/esm/clientErrors/PaymentRequired.js.map +1 -0
- package/lib/esm/clientErrors/PreconditionFailed.js +8 -0
- package/lib/esm/clientErrors/PreconditionFailed.js.map +1 -0
- package/lib/esm/clientErrors/PreconditionRequired.js +8 -0
- package/lib/esm/clientErrors/PreconditionRequired.js.map +1 -0
- package/lib/esm/clientErrors/ProxyAuthentificationRequired.js +8 -0
- package/lib/esm/clientErrors/ProxyAuthentificationRequired.js.map +1 -0
- package/lib/esm/clientErrors/RequestEntityTooLarge.js +8 -0
- package/lib/esm/clientErrors/RequestEntityTooLarge.js.map +1 -0
- package/lib/esm/clientErrors/RequestHeaderFieldsTooLarge.js +8 -0
- package/lib/esm/clientErrors/RequestHeaderFieldsTooLarge.js.map +1 -0
- package/lib/esm/clientErrors/RequestRangeUnsatisfiable.js +8 -0
- package/lib/esm/clientErrors/RequestRangeUnsatisfiable.js.map +1 -0
- package/lib/esm/clientErrors/RequestTimeout.js +8 -0
- package/lib/esm/clientErrors/RequestTimeout.js.map +1 -0
- package/lib/esm/clientErrors/RequestURITooLong.js +8 -0
- package/lib/esm/clientErrors/RequestURITooLong.js.map +1 -0
- package/lib/esm/clientErrors/TooManyRequests.js +8 -0
- package/lib/esm/clientErrors/TooManyRequests.js.map +1 -0
- package/lib/esm/clientErrors/Unauthorized.js +8 -0
- package/lib/esm/clientErrors/Unauthorized.js.map +1 -0
- package/lib/esm/clientErrors/UnavailableForLegalReasons.js +8 -0
- package/lib/esm/clientErrors/UnavailableForLegalReasons.js.map +1 -0
- package/lib/esm/clientErrors/UnprocessableEntity.js +8 -0
- package/lib/esm/clientErrors/UnprocessableEntity.js.map +1 -0
- package/lib/esm/clientErrors/UnsupportedMediaType.js +8 -0
- package/lib/esm/clientErrors/UnsupportedMediaType.js.map +1 -0
- package/lib/esm/clientErrors/UpgradeRequired.js +8 -0
- package/lib/esm/clientErrors/UpgradeRequired.js.map +1 -0
- package/lib/esm/core/Exception.js +60 -0
- package/lib/esm/core/Exception.js.map +1 -0
- package/lib/esm/index.js +50 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/redirections/MovedPermanently.js +8 -0
- package/lib/esm/redirections/MovedPermanently.js.map +1 -0
- package/lib/esm/redirections/MovedTemporarily.js +9 -0
- package/lib/esm/redirections/MovedTemporarily.js.map +1 -0
- package/lib/esm/redirections/MultipleChoices.js +8 -0
- package/lib/esm/redirections/MultipleChoices.js.map +1 -0
- package/lib/esm/redirections/NotModified.js +8 -0
- package/lib/esm/redirections/NotModified.js.map +1 -0
- package/lib/esm/redirections/PermanentRedirect.js +8 -0
- package/lib/esm/redirections/PermanentRedirect.js.map +1 -0
- package/lib/esm/redirections/SeeOther.js +8 -0
- package/lib/esm/redirections/SeeOther.js.map +1 -0
- package/lib/esm/redirections/TemporaryRedirect.js +8 -0
- package/lib/esm/redirections/TemporaryRedirect.js.map +1 -0
- package/lib/esm/redirections/UseProxy.js +8 -0
- package/lib/esm/redirections/UseProxy.js.map +1 -0
- package/lib/esm/serverErrors/BadGateway.js +8 -0
- package/lib/esm/serverErrors/BadGateway.js.map +1 -0
- package/lib/esm/serverErrors/BandwidthLimitExceeded.js +8 -0
- package/lib/esm/serverErrors/BandwidthLimitExceeded.js.map +1 -0
- package/lib/esm/serverErrors/GatewayTimeout.js +8 -0
- package/lib/esm/serverErrors/GatewayTimeout.js.map +1 -0
- package/lib/esm/serverErrors/InternalServerError.js +8 -0
- package/lib/esm/serverErrors/InternalServerError.js.map +1 -0
- package/lib/esm/serverErrors/NetworkAuthenticationRequired.js +8 -0
- package/lib/esm/serverErrors/NetworkAuthenticationRequired.js.map +1 -0
- package/lib/esm/serverErrors/NotExtended.js +8 -0
- package/lib/esm/serverErrors/NotExtended.js.map +1 -0
- package/lib/esm/serverErrors/NotImplemented.js +8 -0
- package/lib/esm/serverErrors/NotImplemented.js.map +1 -0
- package/lib/esm/serverErrors/ProxyError.js +9 -0
- package/lib/esm/serverErrors/ProxyError.js.map +1 -0
- package/lib/esm/serverErrors/ServiceUnvailable.js +8 -0
- package/lib/esm/serverErrors/ServiceUnvailable.js.map +1 -0
- package/lib/esm/serverErrors/VariantAlsoNegotiates.js +8 -0
- package/lib/esm/serverErrors/VariantAlsoNegotiates.js.map +1 -0
- package/lib/{clientErrors → types/clientErrors}/BadMapping.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/BadRequest.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/Conflict.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/ExpectationFailed.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/Forbidden.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/Gone.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/ImATeapot.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/LengthRequired.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/MethodNotAllowed.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/MisdirectedRequest.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/NotAcceptable.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/NotFound.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/PaymentRequired.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/PreconditionFailed.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/PreconditionRequired.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/ProxyAuthentificationRequired.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/RequestEntityTooLarge.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/RequestHeaderFieldsTooLarge.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/RequestRangeUnsatisfiable.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/RequestTimeout.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/RequestURITooLong.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/TooManyRequests.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/Unauthorized.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/UnavailableForLegalReasons.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/UnprocessableEntity.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/UnsupportedMediaType.d.ts +0 -0
- package/lib/{clientErrors → types/clientErrors}/UpgradeRequired.d.ts +0 -0
- package/lib/{core → types/core}/Exception.d.ts +0 -0
- package/lib/types/index.d.ts +49 -0
- package/lib/{redirections → types/redirections}/MovedPermanently.d.ts +0 -0
- package/lib/{redirections → types/redirections}/MovedTemporarily.d.ts +0 -0
- package/lib/{redirections → types/redirections}/MultipleChoices.d.ts +0 -0
- package/lib/{redirections → types/redirections}/NotModified.d.ts +0 -0
- package/lib/{redirections → types/redirections}/PermanentRedirect.d.ts +0 -0
- package/lib/{redirections → types/redirections}/SeeOther.d.ts +0 -0
- package/lib/{redirections → types/redirections}/TemporaryRedirect.d.ts +0 -0
- package/lib/{redirections → types/redirections}/UseProxy.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/BadGateway.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/BandwidthLimitExceeded.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/GatewayTimeout.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/InternalServerError.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/NetworkAuthenticationRequired.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/NotExtended.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/NotImplemented.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/ProxyError.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/ServiceUnvailable.d.ts +0 -0
- package/lib/{serverErrors → types/serverErrors}/VariantAlsoNegotiates.d.ts +0 -0
- package/package.json +19 -10
- package/readme.md +1 -2
- package/tsconfig.compile.esm.json +12 -0
- package/lib/clientErrors/index.d.ts +0 -27
- package/lib/constants/statuses.d.ts +0 -4
- package/lib/core/index.d.ts +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -505
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -457
- package/lib/index.modern.js.map +0 -1
- package/lib/redirections/TooManyRedirects.d.ts +0 -5
- package/lib/redirections/index.d.ts +0 -9
- package/lib/serverErrors/index.d.ts +0 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadMapping = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class BadMapping extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(BadMapping.STATUS, message, origin);
|
|
8
|
+
this.name = "BAD_MAPPING";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.BadMapping = BadMapping;
|
|
12
|
+
BadMapping.STATUS = 421;
|
|
13
|
+
//# sourceMappingURL=BadMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadMapping.js","sourceRoot":"","sources":["../../../src/clientErrors/BadMapping.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,UAAW,SAAQ,qBAAS;IAIvC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAH5C,SAAI,GAAW,aAAa,CAAC;IAI7B,CAAC;;AANH,gCAOC;AANiB,iBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class BadMapping extends Exception {\n static readonly STATUS = 421;\n name: string = \"BAD_MAPPING\";\n\n constructor(message: string, origin?: Error | string | any) {\n super(BadMapping.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadRequest = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class BadRequest extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(BadRequest.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.BadRequest = BadRequest;
|
|
11
|
+
BadRequest.STATUS = 400;
|
|
12
|
+
//# sourceMappingURL=BadRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadRequest.js","sourceRoot":"","sources":["../../../src/clientErrors/BadRequest.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,UAAW,SAAQ,qBAAS;IAGvC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;;AALH,gCAMC;AALiB,iBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class BadRequest extends Exception {\n static readonly STATUS = 400;\n\n constructor(message: string, origin?: Error | string | any) {\n super(BadRequest.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Conflict = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class Conflict extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(Conflict.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Conflict = Conflict;
|
|
11
|
+
Conflict.STATUS = 409;
|
|
12
|
+
//# sourceMappingURL=Conflict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Conflict.js","sourceRoot":"","sources":["../../../src/clientErrors/Conflict.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,QAAS,SAAQ,qBAAS;IAGrC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;;AALH,4BAMC;AALiB,eAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class Conflict extends Exception {\n static readonly STATUS = 409;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Conflict.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpectationFailed = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class ExpectationFailed extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(ExpectationFailed.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ExpectationFailed = ExpectationFailed;
|
|
11
|
+
ExpectationFailed.STATUS = 417;
|
|
12
|
+
//# sourceMappingURL=ExpectationFailed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpectationFailed.js","sourceRoot":"","sources":["../../../src/clientErrors/ExpectationFailed.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,iBAAkB,SAAQ,qBAAS;IAG9C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;;AALH,8CAMC;AALiB,wBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class ExpectationFailed extends Exception {\n static readonly STATUS = 417;\n\n constructor(message: string, origin?: Error | string | any) {\n super(ExpectationFailed.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Forbidden = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class Forbidden extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(Forbidden.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Forbidden = Forbidden;
|
|
11
|
+
Forbidden.STATUS = 403;
|
|
12
|
+
//# sourceMappingURL=Forbidden.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Forbidden.js","sourceRoot":"","sources":["../../../src/clientErrors/Forbidden.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,SAAU,SAAQ,qBAAS;IAGtC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;;AALH,8BAMC;AALiB,gBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class Forbidden extends Exception {\n static readonly STATUS = 403;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Forbidden.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Gone = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class Gone extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(Gone.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Gone = Gone;
|
|
11
|
+
Gone.STATUS = 410;
|
|
12
|
+
//# sourceMappingURL=Gone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gone.js","sourceRoot":"","sources":["../../../src/clientErrors/Gone.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,IAAK,SAAQ,qBAAS;IAGjC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;;AALH,oBAMC;AALiB,WAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class Gone extends Exception {\n static readonly STATUS = 410;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Gone.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImATeapot = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class ImATeapot extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(ImATeapot.STATUS, message, origin);
|
|
8
|
+
this.name = "IM_A_TEAPOT";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.ImATeapot = ImATeapot;
|
|
12
|
+
ImATeapot.STATUS = 418;
|
|
13
|
+
//# sourceMappingURL=ImATeapot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImATeapot.js","sourceRoot":"","sources":["../../../src/clientErrors/ImATeapot.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,SAAU,SAAQ,qBAAS;IAItC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAH3C,SAAI,GAAW,aAAa,CAAC;IAI7B,CAAC;;AANH,8BAOC;AANiB,gBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class ImATeapot extends Exception {\n static readonly STATUS = 418;\n name: string = \"IM_A_TEAPOT\";\n\n constructor(message: string, origin?: Error | string | any) {\n super(ImATeapot.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LengthRequired = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class LengthRequired extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(LengthRequired.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.LengthRequired = LengthRequired;
|
|
11
|
+
LengthRequired.STATUS = 411;
|
|
12
|
+
//# sourceMappingURL=LengthRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LengthRequired.js","sourceRoot":"","sources":["../../../src/clientErrors/LengthRequired.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,cAAe,SAAQ,qBAAS;IAG3C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;;AALH,wCAMC;AALiB,qBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class LengthRequired extends Exception {\n static readonly STATUS = 411;\n\n constructor(message: string, origin?: Error | string | any) {\n super(LengthRequired.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodNotAllowed = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class MethodNotAllowed extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(MethodNotAllowed.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MethodNotAllowed = MethodNotAllowed;
|
|
11
|
+
MethodNotAllowed.STATUS = 405;
|
|
12
|
+
//# sourceMappingURL=MethodNotAllowed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodNotAllowed.js","sourceRoot":"","sources":["../../../src/clientErrors/MethodNotAllowed.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,gBAAiB,SAAQ,qBAAS;IAG7C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;;AALH,4CAMC;AALiB,uBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class MethodNotAllowed extends Exception {\n static readonly STATUS = 405;\n\n constructor(message: string, origin?: Error | string | any) {\n super(MethodNotAllowed.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MisdirectedRequest = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class MisdirectedRequest extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(MisdirectedRequest.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MisdirectedRequest = MisdirectedRequest;
|
|
11
|
+
MisdirectedRequest.STATUS = 421;
|
|
12
|
+
//# sourceMappingURL=MisdirectedRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MisdirectedRequest.js","sourceRoot":"","sources":["../../../src/clientErrors/MisdirectedRequest.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,kBAAmB,SAAQ,qBAAS;IAG/C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;;AALH,gDAMC;AALiB,yBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class MisdirectedRequest extends Exception {\n static readonly STATUS = 421;\n\n constructor(message: string, origin?: Error | string | any) {\n super(MisdirectedRequest.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotAcceptable = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class NotAcceptable extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin = "You must accept content-type " + message) {
|
|
7
|
+
super(NotAcceptable.STATUS, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.NotAcceptable = NotAcceptable;
|
|
11
|
+
NotAcceptable.STATUS = 406;
|
|
12
|
+
//# sourceMappingURL=NotAcceptable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotAcceptable.js","sourceRoot":"","sources":["../../../src/clientErrors/NotAcceptable.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,aAAc,SAAQ,qBAAS;IAG1C,YAAY,OAAe,EAAE,SAA+B,+BAA+B,GAAG,OAAO;QACnG,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;;AALH,sCAMC;AALiB,oBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class NotAcceptable extends Exception {\n static readonly STATUS = 406;\n\n constructor(message: string, origin: Error | string | any = \"You must accept content-type \" + message) {\n super(NotAcceptable.STATUS, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotFound = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class NotFound extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(NotFound.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.NotFound = NotFound;
|
|
11
|
+
NotFound.STATUS = 404;
|
|
12
|
+
//# sourceMappingURL=NotFound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotFound.js","sourceRoot":"","sources":["../../../src/clientErrors/NotFound.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,QAAS,SAAQ,qBAAS;IAGrC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;;AALH,4BAMC;AALiB,eAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class NotFound extends Exception {\n static readonly STATUS = 404;\n\n constructor(message: string, origin?: Error | string | any) {\n super(NotFound.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentRequired = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class PaymentRequired extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(PaymentRequired.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PaymentRequired = PaymentRequired;
|
|
11
|
+
PaymentRequired.STATUS = 402;
|
|
12
|
+
//# sourceMappingURL=PaymentRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentRequired.js","sourceRoot":"","sources":["../../../src/clientErrors/PaymentRequired.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,eAAgB,SAAQ,qBAAS;IAG5C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;;AALH,0CAMC;AALiB,sBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class PaymentRequired extends Exception {\n static readonly STATUS = 402;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PaymentRequired.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreconditionFailed = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class PreconditionFailed extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(PreconditionFailed.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PreconditionFailed = PreconditionFailed;
|
|
11
|
+
PreconditionFailed.STATUS = 412;
|
|
12
|
+
//# sourceMappingURL=PreconditionFailed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreconditionFailed.js","sourceRoot":"","sources":["../../../src/clientErrors/PreconditionFailed.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,kBAAmB,SAAQ,qBAAS;IAG/C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;;AALH,gDAMC;AALiB,yBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class PreconditionFailed extends Exception {\n static readonly STATUS = 412;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PreconditionFailed.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreconditionRequired = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class PreconditionRequired extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(PreconditionRequired.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PreconditionRequired = PreconditionRequired;
|
|
11
|
+
PreconditionRequired.STATUS = 428;
|
|
12
|
+
//# sourceMappingURL=PreconditionRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreconditionRequired.js","sourceRoot":"","sources":["../../../src/clientErrors/PreconditionRequired.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,oBAAqB,SAAQ,qBAAS;IAGjD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;;AALH,oDAMC;AALiB,2BAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class PreconditionRequired extends Exception {\n static readonly STATUS = 428;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PreconditionRequired.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProxyAuthentificationRequired = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class ProxyAuthentificationRequired extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(ProxyAuthentificationRequired.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ProxyAuthentificationRequired = ProxyAuthentificationRequired;
|
|
11
|
+
ProxyAuthentificationRequired.STATUS = 407;
|
|
12
|
+
//# sourceMappingURL=ProxyAuthentificationRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProxyAuthentificationRequired.js","sourceRoot":"","sources":["../../../src/clientErrors/ProxyAuthentificationRequired.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,6BAA8B,SAAQ,qBAAS;IAG1D,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,6BAA6B,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;;AALH,sEAMC;AALiB,oCAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class ProxyAuthentificationRequired extends Exception {\n static readonly STATUS = 407;\n\n constructor(message: string, origin?: Error | string | any) {\n super(ProxyAuthentificationRequired.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestEntityTooLarge = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class RequestEntityTooLarge extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(RequestEntityTooLarge.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.RequestEntityTooLarge = RequestEntityTooLarge;
|
|
11
|
+
RequestEntityTooLarge.STATUS = 413;
|
|
12
|
+
//# sourceMappingURL=RequestEntityTooLarge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestEntityTooLarge.js","sourceRoot":"","sources":["../../../src/clientErrors/RequestEntityTooLarge.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,qBAAsB,SAAQ,qBAAS;IAGlD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;;AALH,sDAMC;AALiB,4BAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class RequestEntityTooLarge extends Exception {\n static readonly STATUS = 413;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestEntityTooLarge.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestHeaderFieldsTooLarge = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class RequestHeaderFieldsTooLarge extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(RequestHeaderFieldsTooLarge.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.RequestHeaderFieldsTooLarge = RequestHeaderFieldsTooLarge;
|
|
11
|
+
RequestHeaderFieldsTooLarge.STATUS = 431;
|
|
12
|
+
//# sourceMappingURL=RequestHeaderFieldsTooLarge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestHeaderFieldsTooLarge.js","sourceRoot":"","sources":["../../../src/clientErrors/RequestHeaderFieldsTooLarge.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,2BAA4B,SAAQ,qBAAS;IAGxD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;;AALH,kEAMC;AALiB,kCAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class RequestHeaderFieldsTooLarge extends Exception {\n static readonly STATUS = 431;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestHeaderFieldsTooLarge.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestRangeUnsatisfiable = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class RequestRangeUnsatisfiable extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(RequestRangeUnsatisfiable.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.RequestRangeUnsatisfiable = RequestRangeUnsatisfiable;
|
|
11
|
+
RequestRangeUnsatisfiable.STATUS = 416;
|
|
12
|
+
//# sourceMappingURL=RequestRangeUnsatisfiable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestRangeUnsatisfiable.js","sourceRoot":"","sources":["../../../src/clientErrors/RequestRangeUnsatisfiable.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,yBAA0B,SAAQ,qBAAS;IAGtD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,yBAAyB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;;AALH,8DAMC;AALiB,gCAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class RequestRangeUnsatisfiable extends Exception {\n static readonly STATUS = 416;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestRangeUnsatisfiable.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestTimeout = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class RequestTimeout extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(RequestTimeout.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.RequestTimeout = RequestTimeout;
|
|
11
|
+
RequestTimeout.STATUS = 408;
|
|
12
|
+
//# sourceMappingURL=RequestTimeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestTimeout.js","sourceRoot":"","sources":["../../../src/clientErrors/RequestTimeout.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,cAAe,SAAQ,qBAAS;IAG3C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;;AALH,wCAMC;AALiB,qBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class RequestTimeout extends Exception {\n static readonly STATUS = 408;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestTimeout.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestURITooLong = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class RequestURITooLong extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(RequestURITooLong.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.RequestURITooLong = RequestURITooLong;
|
|
11
|
+
RequestURITooLong.STATUS = 414;
|
|
12
|
+
//# sourceMappingURL=RequestURITooLong.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestURITooLong.js","sourceRoot":"","sources":["../../../src/clientErrors/RequestURITooLong.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,iBAAkB,SAAQ,qBAAS;IAG9C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;;AALH,8CAMC;AALiB,wBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class RequestURITooLong extends Exception {\n static readonly STATUS = 414;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestURITooLong.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TooManyRequests = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class TooManyRequests extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(TooManyRequests.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.TooManyRequests = TooManyRequests;
|
|
11
|
+
TooManyRequests.STATUS = 429;
|
|
12
|
+
//# sourceMappingURL=TooManyRequests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooManyRequests.js","sourceRoot":"","sources":["../../../src/clientErrors/TooManyRequests.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,eAAgB,SAAQ,qBAAS;IAG5C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;;AALH,0CAMC;AALiB,sBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class TooManyRequests extends Exception {\n static readonly STATUS = 429;\n\n constructor(message: string, origin?: Error | string | any) {\n super(TooManyRequests.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Unauthorized = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class Unauthorized extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(Unauthorized.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Unauthorized = Unauthorized;
|
|
11
|
+
Unauthorized.STATUS = 401;
|
|
12
|
+
//# sourceMappingURL=Unauthorized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unauthorized.js","sourceRoot":"","sources":["../../../src/clientErrors/Unauthorized.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,YAAa,SAAQ,qBAAS;IAGzC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;;AALH,oCAMC;AALiB,mBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class Unauthorized extends Exception {\n static readonly STATUS = 401;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Unauthorized.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnavailableForLegalReasons = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class UnavailableForLegalReasons extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(UnavailableForLegalReasons.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UnavailableForLegalReasons = UnavailableForLegalReasons;
|
|
11
|
+
UnavailableForLegalReasons.STATUS = 451;
|
|
12
|
+
//# sourceMappingURL=UnavailableForLegalReasons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnavailableForLegalReasons.js","sourceRoot":"","sources":["../../../src/clientErrors/UnavailableForLegalReasons.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,0BAA2B,SAAQ,qBAAS;IAGvD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;;AALH,gEAMC;AALiB,iCAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class UnavailableForLegalReasons extends Exception {\n static readonly STATUS = 451;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UnavailableForLegalReasons.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnprocessableEntity = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class UnprocessableEntity extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(UnprocessableEntity.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UnprocessableEntity = UnprocessableEntity;
|
|
11
|
+
UnprocessableEntity.STATUS = 422;
|
|
12
|
+
//# sourceMappingURL=UnprocessableEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnprocessableEntity.js","sourceRoot":"","sources":["../../../src/clientErrors/UnprocessableEntity.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,mBAAoB,SAAQ,qBAAS;IAGhD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;;AALH,kDAMC;AALiB,0BAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class UnprocessableEntity extends Exception {\n static readonly STATUS = 422;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UnprocessableEntity.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnsupportedMediaType = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class UnsupportedMediaType extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(UnsupportedMediaType.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UnsupportedMediaType = UnsupportedMediaType;
|
|
11
|
+
UnsupportedMediaType.STATUS = 415;
|
|
12
|
+
//# sourceMappingURL=UnsupportedMediaType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedMediaType.js","sourceRoot":"","sources":["../../../src/clientErrors/UnsupportedMediaType.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,oBAAqB,SAAQ,qBAAS;IAGjD,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;;AALH,oDAMC;AALiB,2BAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class UnsupportedMediaType extends Exception {\n static readonly STATUS = 415;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UnsupportedMediaType.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpgradeRequired = void 0;
|
|
4
|
+
const Exception_1 = require("../core/Exception");
|
|
5
|
+
class UpgradeRequired extends Exception_1.Exception {
|
|
6
|
+
constructor(message, origin) {
|
|
7
|
+
super(UpgradeRequired.STATUS, message, origin);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UpgradeRequired = UpgradeRequired;
|
|
11
|
+
UpgradeRequired.STATUS = 426;
|
|
12
|
+
//# sourceMappingURL=UpgradeRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpgradeRequired.js","sourceRoot":"","sources":["../../../src/clientErrors/UpgradeRequired.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,eAAgB,SAAQ,qBAAS;IAG5C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;;AALH,0CAMC;AALiB,sBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class UpgradeRequired extends Exception {\n static readonly STATUS = 426;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UpgradeRequired.STATUS, message, origin);\n }\n}\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HTTPException = exports.Exception = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const change_case_1 = require("change-case");
|
|
6
|
+
const statuses_1 = tslib_1.__importDefault(require("statuses"));
|
|
7
|
+
function getStatusConstant(status) {
|
|
8
|
+
return status === 200 ? "SUCCESS" : (0, change_case_1.constantCase)(String((0, statuses_1.default)(status)));
|
|
9
|
+
}
|
|
10
|
+
class Exception extends Error {
|
|
11
|
+
constructor(status = 500, message = "", origin) {
|
|
12
|
+
super(message);
|
|
13
|
+
/**
|
|
14
|
+
* Exception base name
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
this.name = "HTTP_EXCEPTION";
|
|
18
|
+
/**
|
|
19
|
+
* Exception type
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
this.type = "HTTP_EXCEPTION";
|
|
23
|
+
/**
|
|
24
|
+
* Headers must be sent to the response
|
|
25
|
+
*/
|
|
26
|
+
this.headers = {};
|
|
27
|
+
this.status = status;
|
|
28
|
+
this.message = message;
|
|
29
|
+
this.name = getStatusConstant(status);
|
|
30
|
+
this.setOrigin(origin);
|
|
31
|
+
}
|
|
32
|
+
setHeaders(headers) {
|
|
33
|
+
this.headers = {
|
|
34
|
+
...this.headers,
|
|
35
|
+
...headers
|
|
36
|
+
};
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
setHeader(key, value) {
|
|
40
|
+
this.headers[key] = value;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
setOrigin(origin) {
|
|
44
|
+
if (origin) {
|
|
45
|
+
if (origin instanceof Error) {
|
|
46
|
+
this.origin = origin;
|
|
47
|
+
this.message = `${this.message}, innerException: ${this.origin.message}`.trim();
|
|
48
|
+
}
|
|
49
|
+
else if (typeof origin === "string") {
|
|
50
|
+
this.origin = new Error(origin);
|
|
51
|
+
this.message = `${this.message}, innerException: ${this.origin.message}`.trim();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.body = origin;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
toString() {
|
|
59
|
+
return `${this.name}(${this.status}): ${this.message} `.trim();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.Exception = Exception;
|
|
63
|
+
class HTTPException extends Exception {
|
|
64
|
+
}
|
|
65
|
+
exports.HTTPException = HTTPException;
|
|
66
|
+
//# sourceMappingURL=Exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/core/Exception.ts"],"names":[],"mappings":";;;;AAAA,6CAAyC;AACzC,gEAAgC;AAEhC,SAAS,iBAAiB,CAAC,MAAc;IACvC,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,0BAAY,EAAC,MAAM,CAAC,IAAA,kBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAa,SAAU,SAAQ,KAAK;IAmClC,YAAY,SAAiB,GAAG,EAAE,UAAkB,EAAE,EAAE,MAA6B;QACnF,KAAK,CAAC,OAAO,CAAC,CAAC;QAnCjB;;;WAGG;QACI,SAAI,GAAW,gBAAgB,CAAC;QAKvC;;;WAGG;QACI,SAAI,GAAW,gBAAgB,CAAC;QAcvC;;WAEG;QACI,YAAO,GAAyB,EAAE,CAAC;QAOxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAEtC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,UAAU,CAAC,OAA6B;QACtC,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,IAAI,CAAC,OAAO;YACf,GAAG,OAAO;SACX,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,GAAW,EAAE,KAAU;QAC/B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAE1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,MAA4B;QACpC,IAAI,MAAM,EAAE;YACV,IAAI,MAAM,YAAY,KAAK,EAAE;gBAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;gBACrB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,qBAAqB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;aACjF;iBAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;gBACrC,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;gBAChC,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,qBAAqB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;aACjF;iBAAM;gBACL,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;aACpB;SACF;IACH,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;IACjE,CAAC;CACF;AA7ED,8BA6EC;AAED,MAAa,aAAc,SAAQ,SAAS;CAAG;AAA/C,sCAA+C","sourcesContent":["import {constantCase} from \"change-case\";\nimport statuses from \"statuses\";\n\nfunction getStatusConstant(status: number) {\n return status === 200 ? \"SUCCESS\" : constantCase(String(statuses(status)));\n}\n\nexport class Exception extends Error {\n /**\n * Exception base name\n * @type {string}\n */\n public name: string = \"HTTP_EXCEPTION\";\n /**\n * Message of the exception\n */\n public message: string;\n /**\n * Exception type\n * @type {string}\n */\n public type: string = \"HTTP_EXCEPTION\";\n /**\n * Stack calling\n */\n public stack: string;\n public origin: Error & any;\n /**\n * HTTP Code Status\n */\n public status: number;\n /**\n *\n */\n public body: any;\n /**\n * Headers must be sent to the response\n */\n public headers: {[key: string]: any} = {};\n\n [key: string]: any;\n\n constructor(status: number = 500, message: string = \"\", origin?: Error | string | any) {\n super(message);\n\n this.status = status;\n this.message = message;\n this.name = getStatusConstant(status);\n\n this.setOrigin(origin);\n }\n\n setHeaders(headers: {[key: string]: any}) {\n this.headers = {\n ...this.headers,\n ...headers\n };\n\n return this;\n }\n\n setHeader(key: string, value: any) {\n this.headers[key] = value;\n\n return this;\n }\n\n setOrigin(origin: Error | string | any) {\n if (origin) {\n if (origin instanceof Error) {\n this.origin = origin;\n this.message = `${this.message}, innerException: ${this.origin.message}`.trim();\n } else if (typeof origin === \"string\") {\n this.origin = new Error(origin);\n this.message = `${this.message}, innerException: ${this.origin.message}`.trim();\n } else {\n this.body = origin;\n }\n }\n }\n\n toString() {\n return `${this.name}(${this.status}): ${this.message} `.trim();\n }\n}\n\nexport class HTTPException extends Exception {}\n"]}
|