@tsed/exceptions 6.102.4 → 6.102.8-rc.1

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.
Files changed (66) hide show
  1. package/lib/cjs/core/Exception.js +7 -2
  2. package/lib/cjs/core/Exception.js.map +1 -1
  3. package/lib/cjs/package.json +3 -0
  4. package/lib/cjs/redirections/index.js +0 -1
  5. package/lib/cjs/redirections/index.js.map +1 -1
  6. package/lib/esm/clientErrors/BadMapping.js +1 -1
  7. package/lib/esm/clientErrors/BadRequest.js +1 -1
  8. package/lib/esm/clientErrors/Conflict.js +1 -1
  9. package/lib/esm/clientErrors/ExpectationFailed.js +1 -1
  10. package/lib/esm/clientErrors/Forbidden.js +1 -1
  11. package/lib/esm/clientErrors/Gone.js +1 -1
  12. package/lib/esm/clientErrors/ImATeapot.js +1 -1
  13. package/lib/esm/clientErrors/LengthRequired.js +1 -1
  14. package/lib/esm/clientErrors/MethodNotAllowed.js +1 -1
  15. package/lib/esm/clientErrors/MisdirectedRequest.js +1 -1
  16. package/lib/esm/clientErrors/NotAcceptable.js +1 -1
  17. package/lib/esm/clientErrors/NotFound.js +1 -1
  18. package/lib/esm/clientErrors/PaymentRequired.js +1 -1
  19. package/lib/esm/clientErrors/PreconditionFailed.js +1 -1
  20. package/lib/esm/clientErrors/PreconditionRequired.js +1 -1
  21. package/lib/esm/clientErrors/ProxyAuthentificationRequired.js +1 -1
  22. package/lib/esm/clientErrors/RequestEntityTooLarge.js +1 -1
  23. package/lib/esm/clientErrors/RequestHeaderFieldsTooLarge.js +1 -1
  24. package/lib/esm/clientErrors/RequestRangeUnsatisfiable.js +1 -1
  25. package/lib/esm/clientErrors/RequestTimeout.js +1 -1
  26. package/lib/esm/clientErrors/RequestURITooLong.js +1 -1
  27. package/lib/esm/clientErrors/TooManyRequests.js +1 -1
  28. package/lib/esm/clientErrors/Unauthorized.js +1 -1
  29. package/lib/esm/clientErrors/UnavailableForLegalReasons.js +1 -1
  30. package/lib/esm/clientErrors/UnprocessableEntity.js +1 -1
  31. package/lib/esm/clientErrors/UnsupportedMediaType.js +1 -1
  32. package/lib/esm/clientErrors/UpgradeRequired.js +1 -1
  33. package/lib/esm/clientErrors/index.js +27 -27
  34. package/lib/esm/core/Exception.js +5 -1
  35. package/lib/esm/core/Exception.js.map +1 -1
  36. package/lib/esm/core/index.js +1 -1
  37. package/lib/esm/index.js +4 -4
  38. package/lib/esm/package.json +3 -0
  39. package/lib/esm/redirections/MovedPermanently.js +1 -1
  40. package/lib/esm/redirections/MovedTemporarily.js +1 -1
  41. package/lib/esm/redirections/MultipleChoices.js +1 -1
  42. package/lib/esm/redirections/NotModified.js +1 -1
  43. package/lib/esm/redirections/PermanentRedirect.js +1 -1
  44. package/lib/esm/redirections/SeeOther.js +1 -1
  45. package/lib/esm/redirections/TemporaryRedirect.js +1 -1
  46. package/lib/esm/redirections/UseProxy.js +1 -1
  47. package/lib/esm/redirections/index.js +8 -9
  48. package/lib/esm/redirections/index.js.map +1 -1
  49. package/lib/esm/serverErrors/BadGateway.js +1 -1
  50. package/lib/esm/serverErrors/BandwidthLimitExceeded.js +1 -1
  51. package/lib/esm/serverErrors/GatewayTimeout.js +1 -1
  52. package/lib/esm/serverErrors/InternalServerError.js +1 -1
  53. package/lib/esm/serverErrors/NetworkAuthenticationRequired.js +1 -1
  54. package/lib/esm/serverErrors/NotExtended.js +1 -1
  55. package/lib/esm/serverErrors/NotImplemented.js +1 -1
  56. package/lib/esm/serverErrors/ProxyError.js +1 -1
  57. package/lib/esm/serverErrors/ServiceUnvailable.js +1 -1
  58. package/lib/esm/serverErrors/VariantAlsoNegotiates.js +1 -1
  59. package/lib/esm/serverErrors/index.js +10 -10
  60. package/lib/types/redirections/index.d.ts +0 -1
  61. package/package.json +8 -4
  62. package/lib/cjs/redirections/TooManyRedirects.js +0 -12
  63. package/lib/cjs/redirections/TooManyRedirects.js.map +0 -1
  64. package/lib/esm/redirections/TooManyRedirects.js +0 -8
  65. package/lib/esm/redirections/TooManyRedirects.js.map +0 -1
  66. package/lib/types/redirections/TooManyRedirects.d.ts +0 -5
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HTTPException = exports.Exception = void 0;
4
- const schema_1 = require("@tsed/schema");
4
+ const tslib_1 = require("tslib");
5
+ const change_case_1 = require("change-case");
6
+ const statuses_1 = (0, 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
+ }
5
10
  class Exception extends Error {
6
11
  constructor(status = 500, message = "", origin) {
7
12
  super(message);
@@ -21,7 +26,7 @@ class Exception extends Error {
21
26
  this.headers = {};
22
27
  this.status = status;
23
28
  this.message = message;
24
- this.name = (0, schema_1.getStatusConstant)(status);
29
+ this.name = getStatusConstant(status);
25
30
  this.setOrigin(origin);
26
31
  }
27
32
  setHeaders(headers) {
@@ -1 +1 @@
1
- {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/core/Exception.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAE/C,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,IAAA,0BAAiB,EAAC,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 {getStatusConstant} from \"@tsed/schema\";\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"]}
1
+ {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/core/Exception.ts"],"names":[],"mappings":";;;;AAAA,6CAAyC;AACzC,qEAAgC;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"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -8,6 +8,5 @@ const tslib_1 = require("tslib");
8
8
  (0, tslib_1.__exportStar)(require("./PermanentRedirect"), exports);
9
9
  (0, tslib_1.__exportStar)(require("./SeeOther"), exports);
10
10
  (0, tslib_1.__exportStar)(require("./TemporaryRedirect"), exports);
11
- (0, tslib_1.__exportStar)(require("./TooManyRedirects"), exports);
12
11
  (0, tslib_1.__exportStar)(require("./UseProxy"), exports);
13
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/redirections/index.ts"],"names":[],"mappings":";;;AAAA,kEAAmC;AACnC,kEAAmC;AACnC,iEAAkC;AAClC,6DAA8B;AAC9B,mEAAoC;AACpC,0DAA2B;AAC3B,mEAAoC;AACpC,kEAAmC;AACnC,0DAA2B","sourcesContent":["export * from \"./MovedPermanently\";\nexport * from \"./MovedTemporarily\";\nexport * from \"./MultipleChoices\";\nexport * from \"./NotModified\";\nexport * from \"./PermanentRedirect\";\nexport * from \"./SeeOther\";\nexport * from \"./TemporaryRedirect\";\nexport * from \"./TooManyRedirects\";\nexport * from \"./UseProxy\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/redirections/index.ts"],"names":[],"mappings":";;;AAAA,kEAAmC;AACnC,kEAAmC;AACnC,iEAAkC;AAClC,6DAA8B;AAC9B,mEAAoC;AACpC,0DAA2B;AAC3B,mEAAoC;AACpC,0DAA2B","sourcesContent":["export * from \"./MovedPermanently\";\nexport * from \"./MovedTemporarily\";\nexport * from \"./MultipleChoices\";\nexport * from \"./NotModified\";\nexport * from \"./PermanentRedirect\";\nexport * from \"./SeeOther\";\nexport * from \"./TemporaryRedirect\";\nexport * from \"./UseProxy\";\n"]}
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class BadMapping extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(BadMapping.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class BadRequest extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(BadRequest.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class Conflict extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(Conflict.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class ExpectationFailed extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(ExpectationFailed.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class Forbidden extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(Forbidden.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class Gone extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(Gone.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class ImATeapot extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(ImATeapot.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class LengthRequired extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(LengthRequired.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class MethodNotAllowed extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(MethodNotAllowed.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class MisdirectedRequest extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(MisdirectedRequest.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class NotAcceptable extends Exception {
3
3
  constructor(message, origin = "You must accept content-type " + message) {
4
4
  super(NotAcceptable.STATUS, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class NotFound extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(NotFound.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class PaymentRequired extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(PaymentRequired.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class PreconditionFailed extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(PreconditionFailed.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class PreconditionRequired extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(PreconditionRequired.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class ProxyAuthentificationRequired extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(ProxyAuthentificationRequired.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class RequestEntityTooLarge extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(RequestEntityTooLarge.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class RequestHeaderFieldsTooLarge extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(RequestHeaderFieldsTooLarge.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class RequestRangeUnsatisfiable extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(RequestRangeUnsatisfiable.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class RequestTimeout extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(RequestTimeout.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class RequestURITooLong extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(RequestURITooLong.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class TooManyRequests extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(TooManyRequests.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class Unauthorized extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(Unauthorized.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class UnavailableForLegalReasons extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(UnavailableForLegalReasons.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class UnprocessableEntity extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(UnprocessableEntity.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class UnsupportedMediaType extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(UnsupportedMediaType.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class UpgradeRequired extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(UpgradeRequired.STATUS, message, origin);
@@ -1,28 +1,28 @@
1
- export * from "./BadMapping";
2
- export * from "./BadRequest";
3
- export * from "./Conflict";
4
- export * from "./ExpectationFailed";
5
- export * from "./Forbidden";
6
- export * from "./Gone";
7
- export * from "./ImATeapot";
8
- export * from "./LengthRequired";
9
- export * from "./MethodNotAllowed";
10
- export * from "./MisdirectedRequest";
11
- export * from "./NotAcceptable";
12
- export * from "./NotFound";
13
- export * from "./PaymentRequired";
14
- export * from "./PreconditionFailed";
15
- export * from "./PreconditionRequired";
16
- export * from "./ProxyAuthentificationRequired";
17
- export * from "./RequestRangeUnsatisfiable";
18
- export * from "./RequestEntityTooLarge";
19
- export * from "./RequestHeaderFieldsTooLarge";
20
- export * from "./RequestTimeout";
21
- export * from "./RequestURITooLong";
22
- export * from "./TooManyRequests";
23
- export * from "./Unauthorized";
24
- export * from "./UnsupportedMediaType";
25
- export * from "./UpgradeRequired";
26
- export * from "./UnavailableForLegalReasons";
27
- export * from "./UnprocessableEntity";
1
+ export * from "./BadMapping.js";
2
+ export * from "./BadRequest.js";
3
+ export * from "./Conflict.js";
4
+ export * from "./ExpectationFailed.js";
5
+ export * from "./Forbidden.js";
6
+ export * from "./Gone.js";
7
+ export * from "./ImATeapot.js";
8
+ export * from "./LengthRequired.js";
9
+ export * from "./MethodNotAllowed.js";
10
+ export * from "./MisdirectedRequest.js";
11
+ export * from "./NotAcceptable.js";
12
+ export * from "./NotFound.js";
13
+ export * from "./PaymentRequired.js";
14
+ export * from "./PreconditionFailed.js";
15
+ export * from "./PreconditionRequired.js";
16
+ export * from "./ProxyAuthentificationRequired.js";
17
+ export * from "./RequestRangeUnsatisfiable.js";
18
+ export * from "./RequestEntityTooLarge.js";
19
+ export * from "./RequestHeaderFieldsTooLarge.js";
20
+ export * from "./RequestTimeout.js";
21
+ export * from "./RequestURITooLong.js";
22
+ export * from "./TooManyRequests.js";
23
+ export * from "./Unauthorized.js";
24
+ export * from "./UnsupportedMediaType.js";
25
+ export * from "./UpgradeRequired.js";
26
+ export * from "./UnavailableForLegalReasons.js";
27
+ export * from "./UnprocessableEntity.js";
28
28
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,8 @@
1
- import { getStatusConstant } from "@tsed/schema";
1
+ import { constantCase } from "change-case";
2
+ import statuses from "statuses";
3
+ function getStatusConstant(status) {
4
+ return status === 200 ? "SUCCESS" : constantCase(String(statuses(status)));
5
+ }
2
6
  export class Exception extends Error {
3
7
  constructor(status = 500, message = "", origin) {
4
8
  super(message);
@@ -1 +1 @@
1
- {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/core/Exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAE/C,MAAM,OAAO,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;AAED,MAAM,OAAO,aAAc,SAAQ,SAAS;CAAG","sourcesContent":["import {getStatusConstant} from \"@tsed/schema\";\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"]}
1
+ {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/core/Exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,SAAS,iBAAiB,CAAC,MAAc;IACvC,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,OAAO,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;AAED,MAAM,OAAO,aAAc,SAAQ,SAAS;CAAG","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"]}
@@ -1,2 +1,2 @@
1
- export * from "./Exception";
1
+ export * from "./Exception.js";
2
2
  //# sourceMappingURL=index.js.map
package/lib/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./core";
2
- export * from "./clientErrors";
3
- export * from "./redirections";
4
- export * from "./serverErrors";
1
+ export * from "./core.js";
2
+ export * from "./clientErrors.js";
3
+ export * from "./redirections.js";
4
+ export * from "./serverErrors.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class MovedPermanently extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(MovedPermanently.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class MovedTemporarily extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(MovedTemporarily.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class MultipleChoices extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(MultipleChoices.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class NotModified extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(NotModified.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class PermanentRedirect extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(PermanentRedirect.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class SeeOther extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(SeeOther.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class TemporaryRedirect extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(TemporaryRedirect.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class UseProxy extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(UseProxy.STATUS, message, origin);
@@ -1,10 +1,9 @@
1
- export * from "./MovedPermanently";
2
- export * from "./MovedTemporarily";
3
- export * from "./MultipleChoices";
4
- export * from "./NotModified";
5
- export * from "./PermanentRedirect";
6
- export * from "./SeeOther";
7
- export * from "./TemporaryRedirect";
8
- export * from "./TooManyRedirects";
9
- export * from "./UseProxy";
1
+ export * from "./MovedPermanently.js";
2
+ export * from "./MovedTemporarily.js";
3
+ export * from "./MultipleChoices.js";
4
+ export * from "./NotModified.js";
5
+ export * from "./PermanentRedirect.js";
6
+ export * from "./SeeOther.js";
7
+ export * from "./TemporaryRedirect.js";
8
+ export * from "./UseProxy.js";
10
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/redirections/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC","sourcesContent":["export * from \"./MovedPermanently\";\nexport * from \"./MovedTemporarily\";\nexport * from \"./MultipleChoices\";\nexport * from \"./NotModified\";\nexport * from \"./PermanentRedirect\";\nexport * from \"./SeeOther\";\nexport * from \"./TemporaryRedirect\";\nexport * from \"./TooManyRedirects\";\nexport * from \"./UseProxy\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/redirections/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC","sourcesContent":["export * from \"./MovedPermanently\";\nexport * from \"./MovedTemporarily\";\nexport * from \"./MultipleChoices\";\nexport * from \"./NotModified\";\nexport * from \"./PermanentRedirect\";\nexport * from \"./SeeOther\";\nexport * from \"./TemporaryRedirect\";\nexport * from \"./UseProxy\";\n"]}
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class BadGateway extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(BadGateway.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class BandwidthLimitExceeded extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(BandwidthLimitExceeded.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class GatewayTimeout extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(GatewayTimeout.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class InternalServerError extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(InternalServerError.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class NetworkAuthenticationRequired extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(NetworkAuthenticationRequired.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class NotExtended extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(NotExtended.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class NotImplemented extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(NotImplemented.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class ProxyError extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(ProxyError.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class ServiceUnvailable extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(ServiceUnvailable.STATUS, message, origin);
@@ -1,4 +1,4 @@
1
- import { Exception } from "../core/Exception";
1
+ import { Exception } from "../core/Exception.js";
2
2
  export class VariantAlsoNegotiates extends Exception {
3
3
  constructor(message, origin) {
4
4
  super(VariantAlsoNegotiates.STATUS, message, origin);
@@ -1,11 +1,11 @@
1
- export * from "./BadGateway";
2
- export * from "./GatewayTimeout";
3
- export * from "./InternalServerError";
4
- export * from "./NotImplemented";
5
- export * from "./ProxyError";
6
- export * from "./ServiceUnvailable";
7
- export * from "./NetworkAuthenticationRequired";
8
- export * from "./NotExtended";
9
- export * from "./VariantAlsoNegotiates";
10
- export * from "./BandwidthLimitExceeded";
1
+ export * from "./BadGateway.js";
2
+ export * from "./GatewayTimeout.js";
3
+ export * from "./InternalServerError.js";
4
+ export * from "./NotImplemented.js";
5
+ export * from "./ProxyError.js";
6
+ export * from "./ServiceUnvailable.js";
7
+ export * from "./NetworkAuthenticationRequired.js";
8
+ export * from "./NotExtended.js";
9
+ export * from "./VariantAlsoNegotiates.js";
10
+ export * from "./BandwidthLimitExceeded.js";
11
11
  //# sourceMappingURL=index.js.map
@@ -5,5 +5,4 @@ export * from "./NotModified";
5
5
  export * from "./PermanentRedirect";
6
6
  export * from "./SeeOther";
7
7
  export * from "./TemporaryRedirect";
8
- export * from "./TooManyRedirects";
9
8
  export * from "./UseProxy";
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tsed/exceptions",
3
- "version": "6.102.4",
3
+ "version": "6.102.8-rc.1",
4
4
  "description": "HTTP exceptions module for Ts.ED Framework and other pure Express application",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
11
  "types": "./lib/types/index.d.ts",
@@ -18,16 +19,19 @@
18
19
  "build:esm": "tsc --build tsconfig.compile.esm.json"
19
20
  },
20
21
  "dependencies": {
21
- "@tsed/schema": "6.102.4",
22
+ "change-case": "4.1.2",
23
+ "statuses": ">=2.0.1",
22
24
  "tslib": "2.2.0"
23
25
  },
24
- "devDependencies": {},
26
+ "devDependencies": {
27
+ "@types/statuses": "2.0.0"
28
+ },
25
29
  "peerDependencies": {},
26
30
  "repository": "https://github.com/tsedio/tsed",
27
31
  "bugs": {
28
32
  "url": "https://github.com/tsedio/tsed/issues"
29
33
  },
30
- "homepage": "https://github.com/tsedio/tsed/tree/production/packages/specs/exceptions",
34
+ "homepage": "https://github.com/tsedio/tsed/tree/rc/packages/specs/exceptions",
31
35
  "author": "Romain Lenzotti",
32
36
  "license": "MIT"
33
37
  }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TooManyRedirects = void 0;
4
- const Exception_1 = require("../core/Exception");
5
- class TooManyRedirects extends Exception_1.Exception {
6
- constructor(message, origin) {
7
- super(TooManyRedirects.STATUS, message, origin);
8
- }
9
- }
10
- exports.TooManyRedirects = TooManyRedirects;
11
- TooManyRedirects.STATUS = 310;
12
- //# sourceMappingURL=TooManyRedirects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TooManyRedirects.js","sourceRoot":"","sources":["../../../src/redirections/TooManyRedirects.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 TooManyRedirects extends Exception {\n static readonly STATUS = 310;\n\n constructor(message: string, origin?: Error | string | any) {\n super(TooManyRedirects.STATUS, message, origin);\n }\n}\n"]}
@@ -1,8 +0,0 @@
1
- import { Exception } from "../core/Exception";
2
- export class TooManyRedirects extends Exception {
3
- constructor(message, origin) {
4
- super(TooManyRedirects.STATUS, message, origin);
5
- }
6
- }
7
- TooManyRedirects.STATUS = 310;
8
- //# sourceMappingURL=TooManyRedirects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TooManyRedirects.js","sourceRoot":"","sources":["../../../src/redirections/TooManyRedirects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAG7C,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;;AAJe,uBAAM,GAAG,GAAG,CAAC","sourcesContent":["import {Exception} from \"../core/Exception\";\n\nexport class TooManyRedirects extends Exception {\n static readonly STATUS = 310;\n\n constructor(message: string, origin?: Error | string | any) {\n super(TooManyRedirects.STATUS, message, origin);\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- import { Exception } from "../core/Exception";
2
- export declare class TooManyRedirects extends Exception {
3
- static readonly STATUS = 310;
4
- constructor(message: string, origin?: Error | string | any);
5
- }