@spinajs/http 2.0.149 → 2.0.150

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 (96) hide show
  1. package/lib/cjs/response-methods/badRequest.d.ts +2 -2
  2. package/lib/cjs/response-methods/badRequest.d.ts.map +1 -1
  3. package/lib/cjs/response-methods/badRequest.js +2 -1
  4. package/lib/cjs/response-methods/badRequest.js.map +1 -1
  5. package/lib/cjs/response-methods/conflict.d.ts +2 -2
  6. package/lib/cjs/response-methods/conflict.d.ts.map +1 -1
  7. package/lib/cjs/response-methods/conflict.js +2 -1
  8. package/lib/cjs/response-methods/conflict.js.map +1 -1
  9. package/lib/cjs/response-methods/errorResponse.d.ts +8 -0
  10. package/lib/cjs/response-methods/errorResponse.d.ts.map +1 -0
  11. package/lib/cjs/response-methods/errorResponse.js +25 -0
  12. package/lib/cjs/response-methods/errorResponse.js.map +1 -0
  13. package/lib/cjs/response-methods/forbidden.d.ts +2 -2
  14. package/lib/cjs/response-methods/forbidden.d.ts.map +1 -1
  15. package/lib/cjs/response-methods/forbidden.js +2 -1
  16. package/lib/cjs/response-methods/forbidden.js.map +1 -1
  17. package/lib/cjs/response-methods/noContent.d.ts +2 -2
  18. package/lib/cjs/response-methods/noContent.d.ts.map +1 -1
  19. package/lib/cjs/response-methods/noContent.js +2 -1
  20. package/lib/cjs/response-methods/noContent.js.map +1 -1
  21. package/lib/cjs/response-methods/notAcceptable.d.ts +2 -2
  22. package/lib/cjs/response-methods/notAcceptable.d.ts.map +1 -1
  23. package/lib/cjs/response-methods/notAcceptable.js +2 -1
  24. package/lib/cjs/response-methods/notAcceptable.js.map +1 -1
  25. package/lib/cjs/response-methods/notAllowed.d.ts +2 -2
  26. package/lib/cjs/response-methods/notAllowed.d.ts.map +1 -1
  27. package/lib/cjs/response-methods/notAllowed.js +2 -1
  28. package/lib/cjs/response-methods/notAllowed.js.map +1 -1
  29. package/lib/cjs/response-methods/notFound.d.ts +2 -2
  30. package/lib/cjs/response-methods/notFound.d.ts.map +1 -1
  31. package/lib/cjs/response-methods/notFound.js +2 -1
  32. package/lib/cjs/response-methods/notFound.js.map +1 -1
  33. package/lib/cjs/response-methods/serverError.d.ts +2 -2
  34. package/lib/cjs/response-methods/serverError.d.ts.map +1 -1
  35. package/lib/cjs/response-methods/serverError.js +2 -1
  36. package/lib/cjs/response-methods/serverError.js.map +1 -1
  37. package/lib/cjs/response-methods/unauthorized.d.ts +2 -2
  38. package/lib/cjs/response-methods/unauthorized.d.ts.map +1 -1
  39. package/lib/cjs/response-methods/unauthorized.js +2 -1
  40. package/lib/cjs/response-methods/unauthorized.js.map +1 -1
  41. package/lib/cjs/response-methods/validationError.d.ts +2 -2
  42. package/lib/cjs/response-methods/validationError.d.ts.map +1 -1
  43. package/lib/cjs/response-methods/validationError.js +2 -1
  44. package/lib/cjs/response-methods/validationError.js.map +1 -1
  45. package/lib/cjs/route-args/RouteArgs.js +1 -1
  46. package/lib/cjs/route-args/RouteArgs.js.map +1 -1
  47. package/lib/mjs/response-methods/badRequest.d.ts +2 -2
  48. package/lib/mjs/response-methods/badRequest.d.ts.map +1 -1
  49. package/lib/mjs/response-methods/badRequest.js +3 -2
  50. package/lib/mjs/response-methods/badRequest.js.map +1 -1
  51. package/lib/mjs/response-methods/conflict.d.ts +2 -2
  52. package/lib/mjs/response-methods/conflict.d.ts.map +1 -1
  53. package/lib/mjs/response-methods/conflict.js +3 -2
  54. package/lib/mjs/response-methods/conflict.js.map +1 -1
  55. package/lib/mjs/response-methods/errorResponse.d.ts +8 -0
  56. package/lib/mjs/response-methods/errorResponse.d.ts.map +1 -0
  57. package/lib/mjs/response-methods/errorResponse.js +18 -0
  58. package/lib/mjs/response-methods/errorResponse.js.map +1 -0
  59. package/lib/mjs/response-methods/forbidden.d.ts +2 -2
  60. package/lib/mjs/response-methods/forbidden.d.ts.map +1 -1
  61. package/lib/mjs/response-methods/forbidden.js +3 -2
  62. package/lib/mjs/response-methods/forbidden.js.map +1 -1
  63. package/lib/mjs/response-methods/noContent.d.ts +2 -2
  64. package/lib/mjs/response-methods/noContent.d.ts.map +1 -1
  65. package/lib/mjs/response-methods/noContent.js +3 -2
  66. package/lib/mjs/response-methods/noContent.js.map +1 -1
  67. package/lib/mjs/response-methods/notAcceptable.d.ts +2 -2
  68. package/lib/mjs/response-methods/notAcceptable.d.ts.map +1 -1
  69. package/lib/mjs/response-methods/notAcceptable.js +3 -2
  70. package/lib/mjs/response-methods/notAcceptable.js.map +1 -1
  71. package/lib/mjs/response-methods/notAllowed.d.ts +2 -2
  72. package/lib/mjs/response-methods/notAllowed.d.ts.map +1 -1
  73. package/lib/mjs/response-methods/notAllowed.js +3 -2
  74. package/lib/mjs/response-methods/notAllowed.js.map +1 -1
  75. package/lib/mjs/response-methods/notFound.d.ts +2 -2
  76. package/lib/mjs/response-methods/notFound.d.ts.map +1 -1
  77. package/lib/mjs/response-methods/notFound.js +3 -2
  78. package/lib/mjs/response-methods/notFound.js.map +1 -1
  79. package/lib/mjs/response-methods/serverError.d.ts +2 -2
  80. package/lib/mjs/response-methods/serverError.d.ts.map +1 -1
  81. package/lib/mjs/response-methods/serverError.js +3 -2
  82. package/lib/mjs/response-methods/serverError.js.map +1 -1
  83. package/lib/mjs/response-methods/unauthorized.d.ts +2 -2
  84. package/lib/mjs/response-methods/unauthorized.d.ts.map +1 -1
  85. package/lib/mjs/response-methods/unauthorized.js +3 -2
  86. package/lib/mjs/response-methods/unauthorized.js.map +1 -1
  87. package/lib/mjs/response-methods/validationError.d.ts +2 -2
  88. package/lib/mjs/response-methods/validationError.d.ts.map +1 -1
  89. package/lib/mjs/response-methods/validationError.js +3 -2
  90. package/lib/mjs/response-methods/validationError.js.map +1 -1
  91. package/lib/mjs/route-args/RouteArgs.js +1 -1
  92. package/lib/mjs/route-args/RouteArgs.js.map +1 -1
  93. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  94. package/lib/tsconfig.mjs.tsbuildinfo +1 -1
  95. package/lib/views/responses/validationError.pug +1 -1
  96. package/package.json +10 -10
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 409 Conflict
6
7
  * @param err - error to send
7
8
  */
8
- export class Conflict extends Response {
9
+ export class Conflict extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"conflict.js","sourceRoot":"","sources":["../../../src/response-methods/conflict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AAEH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IACpC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC1F,CAAC;CACF"}
1
+ {"version":3,"file":"conflict.js","sourceRoot":"","sources":["../../../src/response-methods/conflict.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,QAAS,SAAQ,aAAa;IACzC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC1F,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="qs" />
2
+ import * as express from 'express';
3
+ import { Response } from '../interfaces.js';
4
+ export declare class ErrorResponse extends Response {
5
+ constructor(error: any);
6
+ execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
7
+ }
8
+ //# sourceMappingURL=errorResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorResponse.d.ts","sourceRoot":"","sources":["../../../src/response-methods/errorResponse.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAM9D,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,KAAK,EAAE,GAAG;IAST,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -0,0 +1,18 @@
1
+ import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
2
+ import { httpResponse } from '../responses.js';
3
+ import _ from 'lodash';
4
+ import { DI } from '@spinajs/di';
5
+ import { Configuration } from '@spinajs/configuration';
6
+ export class ErrorResponse extends Response {
7
+ constructor(error) {
8
+ super(error);
9
+ const isDev = DI.get(Configuration).get('configuration.isDevelopment');
10
+ if (isDev) {
11
+ this.responseData = _.omit(this.responseData, ['stack']);
12
+ }
13
+ }
14
+ async execute(_req, _res) {
15
+ return await httpResponse(this.responseData, HTTP_STATUS_CODE.BAD_REQUEST, 'badRequest.pug');
16
+ }
17
+ }
18
+ //# sourceMappingURL=errorResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorResponse.js","sourceRoot":"","sources":["../../../src/response-methods/errorResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,OAAO,aAAc,SAAQ,QAAQ;IACzC,YAAY,KAAU;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QACvE,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;SAC1D;IACH,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAC/F,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 403 FORBIDDEN ERROR
7
7
  * @param err - error to send
8
8
  */
9
- export declare class Forbidden extends Response {
9
+ export declare class Forbidden extends ErrorResponse {
10
10
  constructor(data: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden.d.ts","sourceRoot":"","sources":["../../../src/response-methods/forbidden.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AAEH,qBAAa,SAAU,SAAQ,QAAQ;gBACzB,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"forbidden.d.ts","sourceRoot":"","sources":["../../../src/response-methods/forbidden.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,qBAAa,SAAU,SAAQ,aAAa;gBAC9B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 403 FORBIDDEN ERROR
6
7
  * @param err - error to send
7
8
  */
8
- export class Forbidden extends Response {
9
+ export class Forbidden extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden.js","sourceRoot":"","sources":["../../../src/response-methods/forbidden.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AAEH,MAAM,OAAO,SAAU,SAAQ,QAAQ;IACrC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAC5F,CAAC;CACF"}
1
+ {"version":3,"file":"forbidden.js","sourceRoot":"","sources":["../../../src/response-methods/forbidden.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,SAAU,SAAQ,aAAa;IAC1C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAC5F,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 204 NO CONTENT
7
7
  * @param err - error to send
8
8
  */
9
- export declare class NoContent extends Response {
9
+ export declare class NoContent extends ErrorResponse {
10
10
  constructor(data: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../../src/response-methods/noContent.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,QAAQ;gBACzB,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../../src/response-methods/noContent.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,aAAa;gBAC9B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 204 NO CONTENT
6
7
  * @param err - error to send
7
8
  */
8
- export class NoContent extends Response {
9
+ export class NoContent extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"noContent.js","sourceRoot":"","sources":["../../../src/response-methods/noContent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,QAAQ;IACrC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC7F,CAAC;CACF"}
1
+ {"version":3,"file":"noContent.js","sourceRoot":"","sources":["../../../src/response-methods/noContent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,aAAa;IAC1C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC7F,CAAC;CACF"}
@@ -1,13 +1,13 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 406 NOT ACCEPTABLE
7
7
  * When content requested in accept header format cannot be returned.
8
8
  * @param err - error to send
9
9
  */
10
- export declare class NotAcceptable extends Response {
10
+ export declare class NotAcceptable extends ErrorResponse {
11
11
  constructor(data: any);
12
12
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notAcceptable.d.ts","sourceRoot":"","sources":["../../../src/response-methods/notAcceptable.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"notAcceptable.d.ts","sourceRoot":"","sources":["../../../src/response-methods/notAcceptable.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,aAAa;gBAClC,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,12 +1,13 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 406 NOT ACCEPTABLE
6
7
  * When content requested in accept header format cannot be returned.
7
8
  * @param err - error to send
8
9
  */
9
- export class NotAcceptable extends Response {
10
+ export class NotAcceptable extends ErrorResponse {
10
11
  constructor(data) {
11
12
  super(data);
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notAcceptable.js","sourceRoot":"","sources":["../../../src/response-methods/notAcceptable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,QAAQ;IACzC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACrG,CAAC;CACF"}
1
+ {"version":3,"file":"notAcceptable.js","sourceRoot":"","sources":["../../../src/response-methods/notAcceptable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC9C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACrG,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 403 FORBIDDEN ERROR
7
7
  * @param err - error to send
8
8
  */
9
- export declare class NotAllowed extends Response {
9
+ export declare class NotAllowed extends ErrorResponse {
10
10
  constructor(data: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notAllowed.d.ts","sourceRoot":"","sources":["../../../src/response-methods/notAllowed.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AAEH,qBAAa,UAAW,SAAQ,QAAQ;gBAC1B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"notAllowed.d.ts","sourceRoot":"","sources":["../../../src/response-methods/notAllowed.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,qBAAa,UAAW,SAAQ,aAAa;gBAC/B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 403 FORBIDDEN ERROR
6
7
  * @param err - error to send
7
8
  */
8
- export class NotAllowed extends Response {
9
+ export class NotAllowed extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notAllowed.js","sourceRoot":"","sources":["../../../src/response-methods/notAllowed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AAEH,MAAM,OAAO,UAAW,SAAQ,QAAQ;IACtC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAChG,CAAC;CACF"}
1
+ {"version":3,"file":"notAllowed.js","sourceRoot":"","sources":["../../../src/response-methods/notAllowed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,UAAW,SAAQ,aAAa;IAC3C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAChG,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 404 NOT FOUND ERROR
7
7
  * @param err - error to send
8
8
  */
9
- export declare class NotFound extends Response {
9
+ export declare class NotFound extends ErrorResponse {
10
10
  constructor(data?: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notFound.d.ts","sourceRoot":"","sources":["../../../src/response-methods/notFound.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,QAAQ;gBACxB,IAAI,CAAC,EAAE,GAAG;IAIT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"notFound.d.ts","sourceRoot":"","sources":["../../../src/response-methods/notFound.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,aAAa;gBAC7B,IAAI,CAAC,EAAE,GAAG;IAIT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 404 NOT FOUND ERROR
6
7
  * @param err - error to send
7
8
  */
8
- export class NotFound extends Response {
9
+ export class NotFound extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notFound.js","sourceRoot":"","sources":["../../../src/response-methods/notFound.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IACpC,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAC3F,CAAC;CACF"}
1
+ {"version":3,"file":"notFound.js","sourceRoot":"","sources":["../../../src/response-methods/notFound.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,aAAa;IACzC,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAC3F,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 500 INTERNAL SERVER ERROR
7
7
  * @param err - error to send
8
8
  */
9
- export declare class ServerError extends Response {
9
+ export declare class ServerError extends ErrorResponse {
10
10
  constructor(data: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../../src/response-methods/serverError.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AAEH,qBAAa,WAAY,SAAQ,QAAQ;gBAC3B,IAAI,EAAE,GAAG;IAKR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../../src/response-methods/serverError.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,qBAAa,WAAY,SAAQ,aAAa;gBAChC,IAAI,EAAE,GAAG;IAKR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 500 INTERNAL SERVER ERROR
6
7
  * @param err - error to send
7
8
  */
8
- export class ServerError extends Response {
9
+ export class ServerError extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serverError.js","sourceRoot":"","sources":["../../../src/response-methods/serverError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AAEH,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACvC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IAEd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,gBAAgB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAC9G,CAAC;CACF"}
1
+ {"version":3,"file":"serverError.js","sourceRoot":"","sources":["../../../src/response-methods/serverError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,WAAY,SAAQ,aAAa;IAC5C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IAEd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,gBAAgB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAC9G,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 401 UNAHTORIZED response with json content
7
7
  * @param data - data to send
8
8
  */
9
- export declare class Unauthorized extends Response {
9
+ export declare class Unauthorized extends ErrorResponse {
10
10
  constructor(data: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"unauthorized.d.ts","sourceRoot":"","sources":["../../../src/response-methods/unauthorized.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AAEH,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"unauthorized.d.ts","sourceRoot":"","sources":["../../../src/response-methods/unauthorized.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,qBAAa,YAAa,SAAQ,aAAa;gBACjC,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 401 UNAHTORIZED response with json content
6
7
  * @param data - data to send
7
8
  */
8
- export class Unauthorized extends Response {
9
+ export class Unauthorized extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"unauthorized.js","sourceRoot":"","sources":["../../../src/response-methods/unauthorized.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AAEH,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;IACxG,CAAC;CACF"}
1
+ {"version":3,"file":"unauthorized.js","sourceRoot":"","sources":["../../../src/response-methods/unauthorized.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,YAAa,SAAQ,aAAa;IAC7C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;IACxG,CAAC;CACF"}
@@ -1,12 +1,12 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { Response } from '../interfaces.js';
3
+ import { ErrorResponse } from './errorResponse.js';
4
4
  /**
5
5
  * Internall response function.
6
6
  * Returns HTTP 400 BAD REQUEST ERROR
7
7
  * @param err - error to send
8
8
  */
9
- export declare class ValidationError extends Response {
9
+ export declare class ValidationError extends ErrorResponse {
10
10
  constructor(data: any);
11
11
  execute(_req: express.Request, _res: express.Response): Promise<(req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: express.Response<any, Record<string, any>>) => void>;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validationError.d.ts","sourceRoot":"","sources":["../../../src/response-methods/validationError.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG9D;;;;GAIG;AAEH,qBAAa,eAAgB,SAAQ,QAAQ;gBAC/B,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
1
+ {"version":3,"file":"validationError.d.ts","sourceRoot":"","sources":["../../../src/response-methods/validationError.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,qBAAa,eAAgB,SAAQ,aAAa;gBACpC,IAAI,EAAE,GAAG;IAIR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAGnE"}
@@ -1,11 +1,12 @@
1
- import { HTTP_STATUS_CODE, Response } from '../interfaces.js';
1
+ import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
+ import { ErrorResponse } from './errorResponse.js';
3
4
  /**
4
5
  * Internall response function.
5
6
  * Returns HTTP 400 BAD REQUEST ERROR
6
7
  * @param err - error to send
7
8
  */
8
- export class ValidationError extends Response {
9
+ export class ValidationError extends ErrorResponse {
9
10
  constructor(data) {
10
11
  super(data);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validationError.js","sourceRoot":"","sources":["../../../src/response-methods/validationError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AAEH,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAC3C,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;IACpG,CAAC;CACF"}
1
+ {"version":3,"file":"validationError.js","sourceRoot":"","sources":["../../../src/response-methods/validationError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,OAAO,eAAgB,SAAQ,aAAa;IAChD,YAAY,IAAS;QACnB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;IACpG,CAAC;CACF"}
@@ -41,7 +41,7 @@ export class RouteArgs {
41
41
  hydrator = this.getHydrator(routeParameter);
42
42
  result = hydrator ? arg : this.tryExtractObject(arg, routeParameter);
43
43
  if (schema) {
44
- this.Validator.validate(schema, result);
44
+ this.Validator.validate(schema, arg);
45
45
  }
46
46
  if (hydrator) {
47
47
  result = await this.tryHydrateObject(result, routeParameter, hydrator);
@@ -1 +1 @@
1
- {"version":3,"file":"RouteArgs.js","sourceRoot":"","sources":["../../../src/route-args/RouteArgs.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIlE,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAA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