@spinajs/http 2.0.185 → 2.0.187

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 (179) hide show
  1. package/lib/cjs/interfaces.d.ts +19 -0
  2. package/lib/cjs/interfaces.d.ts.map +1 -1
  3. package/lib/cjs/interfaces.js +4 -0
  4. package/lib/cjs/interfaces.js.map +1 -1
  5. package/lib/cjs/middlewares/RequestId.d.ts +1 -1
  6. package/lib/cjs/middlewares/RequestId.d.ts.map +1 -1
  7. package/lib/cjs/middlewares/RequestId.js +4 -1
  8. package/lib/cjs/middlewares/RequestId.js.map +1 -1
  9. package/lib/cjs/response-methods/badRequest.d.ts +4 -8
  10. package/lib/cjs/response-methods/badRequest.d.ts.map +1 -1
  11. package/lib/cjs/response-methods/badRequest.js +18 -10
  12. package/lib/cjs/response-methods/badRequest.js.map +1 -1
  13. package/lib/cjs/response-methods/conflict.d.ts +5 -3
  14. package/lib/cjs/response-methods/conflict.d.ts.map +1 -1
  15. package/lib/cjs/response-methods/conflict.js +8 -4
  16. package/lib/cjs/response-methods/conflict.js.map +1 -1
  17. package/lib/cjs/response-methods/created.d.ts +3 -2
  18. package/lib/cjs/response-methods/created.d.ts.map +1 -1
  19. package/lib/cjs/response-methods/created.js +6 -2
  20. package/lib/cjs/response-methods/created.js.map +1 -1
  21. package/lib/cjs/response-methods/entityTooLarge.d.ts +3 -2
  22. package/lib/cjs/response-methods/entityTooLarge.d.ts.map +1 -1
  23. package/lib/cjs/response-methods/entityTooLarge.js +6 -2
  24. package/lib/cjs/response-methods/entityTooLarge.js.map +1 -1
  25. package/lib/cjs/response-methods/file.d.ts +7 -4
  26. package/lib/cjs/response-methods/file.d.ts.map +1 -1
  27. package/lib/cjs/response-methods/file.js +13 -3
  28. package/lib/cjs/response-methods/file.js.map +1 -1
  29. package/lib/cjs/response-methods/forbidden.d.ts +5 -3
  30. package/lib/cjs/response-methods/forbidden.d.ts.map +1 -1
  31. package/lib/cjs/response-methods/forbidden.js +8 -4
  32. package/lib/cjs/response-methods/forbidden.js.map +1 -1
  33. package/lib/cjs/response-methods/index.d.ts +0 -1
  34. package/lib/cjs/response-methods/index.d.ts.map +1 -1
  35. package/lib/cjs/response-methods/index.js +0 -1
  36. package/lib/cjs/response-methods/index.js.map +1 -1
  37. package/lib/cjs/response-methods/noContent.d.ts +5 -3
  38. package/lib/cjs/response-methods/noContent.d.ts.map +1 -1
  39. package/lib/cjs/response-methods/noContent.js +8 -4
  40. package/lib/cjs/response-methods/noContent.js.map +1 -1
  41. package/lib/cjs/response-methods/notAcceptable.d.ts +5 -3
  42. package/lib/cjs/response-methods/notAcceptable.d.ts.map +1 -1
  43. package/lib/cjs/response-methods/notAcceptable.js +8 -4
  44. package/lib/cjs/response-methods/notAcceptable.js.map +1 -1
  45. package/lib/cjs/response-methods/notAllowed.d.ts +5 -3
  46. package/lib/cjs/response-methods/notAllowed.d.ts.map +1 -1
  47. package/lib/cjs/response-methods/notAllowed.js +8 -4
  48. package/lib/cjs/response-methods/notAllowed.js.map +1 -1
  49. package/lib/cjs/response-methods/notFound.d.ts +5 -3
  50. package/lib/cjs/response-methods/notFound.d.ts.map +1 -1
  51. package/lib/cjs/response-methods/notFound.js +8 -4
  52. package/lib/cjs/response-methods/notFound.js.map +1 -1
  53. package/lib/cjs/response-methods/ok.d.ts +3 -2
  54. package/lib/cjs/response-methods/ok.d.ts.map +1 -1
  55. package/lib/cjs/response-methods/ok.js +6 -2
  56. package/lib/cjs/response-methods/ok.js.map +1 -1
  57. package/lib/cjs/response-methods/serverError.d.ts +5 -3
  58. package/lib/cjs/response-methods/serverError.d.ts.map +1 -1
  59. package/lib/cjs/response-methods/serverError.js +8 -4
  60. package/lib/cjs/response-methods/serverError.js.map +1 -1
  61. package/lib/cjs/response-methods/template.d.ts +3 -3
  62. package/lib/cjs/response-methods/template.d.ts.map +1 -1
  63. package/lib/cjs/response-methods/template.js +6 -4
  64. package/lib/cjs/response-methods/template.js.map +1 -1
  65. package/lib/cjs/response-methods/unauthorized.d.ts +5 -3
  66. package/lib/cjs/response-methods/unauthorized.d.ts.map +1 -1
  67. package/lib/cjs/response-methods/unauthorized.js +8 -4
  68. package/lib/cjs/response-methods/unauthorized.js.map +1 -1
  69. package/lib/cjs/response-methods/validationError.d.ts +5 -3
  70. package/lib/cjs/response-methods/validationError.d.ts.map +1 -1
  71. package/lib/cjs/response-methods/validationError.js +8 -4
  72. package/lib/cjs/response-methods/validationError.js.map +1 -1
  73. package/lib/cjs/responses.d.ts +7 -5
  74. package/lib/cjs/responses.d.ts.map +1 -1
  75. package/lib/cjs/responses.js +54 -15
  76. package/lib/cjs/responses.js.map +1 -1
  77. package/lib/cjs/route-args/FromSession.d.ts +1 -0
  78. package/lib/cjs/route-args/FromSession.d.ts.map +1 -0
  79. package/lib/cjs/route-args/FromSession.js +1 -0
  80. package/lib/cjs/route-args/FromSession.js.map +1 -0
  81. package/lib/mjs/interfaces.d.ts +19 -0
  82. package/lib/mjs/interfaces.d.ts.map +1 -1
  83. package/lib/mjs/interfaces.js +4 -0
  84. package/lib/mjs/interfaces.js.map +1 -1
  85. package/lib/mjs/middlewares/RequestId.d.ts +1 -1
  86. package/lib/mjs/middlewares/RequestId.d.ts.map +1 -1
  87. package/lib/mjs/middlewares/RequestId.js +4 -1
  88. package/lib/mjs/middlewares/RequestId.js.map +1 -1
  89. package/lib/mjs/response-methods/badRequest.d.ts +4 -8
  90. package/lib/mjs/response-methods/badRequest.d.ts.map +1 -1
  91. package/lib/mjs/response-methods/badRequest.js +16 -11
  92. package/lib/mjs/response-methods/badRequest.js.map +1 -1
  93. package/lib/mjs/response-methods/conflict.d.ts +5 -3
  94. package/lib/mjs/response-methods/conflict.d.ts.map +1 -1
  95. package/lib/mjs/response-methods/conflict.js +8 -4
  96. package/lib/mjs/response-methods/conflict.js.map +1 -1
  97. package/lib/mjs/response-methods/created.d.ts +3 -2
  98. package/lib/mjs/response-methods/created.d.ts.map +1 -1
  99. package/lib/mjs/response-methods/created.js +6 -2
  100. package/lib/mjs/response-methods/created.js.map +1 -1
  101. package/lib/mjs/response-methods/entityTooLarge.d.ts +3 -2
  102. package/lib/mjs/response-methods/entityTooLarge.d.ts.map +1 -1
  103. package/lib/mjs/response-methods/entityTooLarge.js +6 -2
  104. package/lib/mjs/response-methods/entityTooLarge.js.map +1 -1
  105. package/lib/mjs/response-methods/file.d.ts +7 -4
  106. package/lib/mjs/response-methods/file.d.ts.map +1 -1
  107. package/lib/mjs/response-methods/file.js +13 -3
  108. package/lib/mjs/response-methods/file.js.map +1 -1
  109. package/lib/mjs/response-methods/forbidden.d.ts +5 -3
  110. package/lib/mjs/response-methods/forbidden.d.ts.map +1 -1
  111. package/lib/mjs/response-methods/forbidden.js +8 -4
  112. package/lib/mjs/response-methods/forbidden.js.map +1 -1
  113. package/lib/mjs/response-methods/index.d.ts +0 -1
  114. package/lib/mjs/response-methods/index.d.ts.map +1 -1
  115. package/lib/mjs/response-methods/index.js +0 -1
  116. package/lib/mjs/response-methods/index.js.map +1 -1
  117. package/lib/mjs/response-methods/noContent.d.ts +5 -3
  118. package/lib/mjs/response-methods/noContent.d.ts.map +1 -1
  119. package/lib/mjs/response-methods/noContent.js +8 -4
  120. package/lib/mjs/response-methods/noContent.js.map +1 -1
  121. package/lib/mjs/response-methods/notAcceptable.d.ts +5 -3
  122. package/lib/mjs/response-methods/notAcceptable.d.ts.map +1 -1
  123. package/lib/mjs/response-methods/notAcceptable.js +8 -4
  124. package/lib/mjs/response-methods/notAcceptable.js.map +1 -1
  125. package/lib/mjs/response-methods/notAllowed.d.ts +5 -3
  126. package/lib/mjs/response-methods/notAllowed.d.ts.map +1 -1
  127. package/lib/mjs/response-methods/notAllowed.js +8 -4
  128. package/lib/mjs/response-methods/notAllowed.js.map +1 -1
  129. package/lib/mjs/response-methods/notFound.d.ts +5 -3
  130. package/lib/mjs/response-methods/notFound.d.ts.map +1 -1
  131. package/lib/mjs/response-methods/notFound.js +8 -4
  132. package/lib/mjs/response-methods/notFound.js.map +1 -1
  133. package/lib/mjs/response-methods/ok.d.ts +3 -2
  134. package/lib/mjs/response-methods/ok.d.ts.map +1 -1
  135. package/lib/mjs/response-methods/ok.js +6 -2
  136. package/lib/mjs/response-methods/ok.js.map +1 -1
  137. package/lib/mjs/response-methods/serverError.d.ts +5 -3
  138. package/lib/mjs/response-methods/serverError.d.ts.map +1 -1
  139. package/lib/mjs/response-methods/serverError.js +8 -4
  140. package/lib/mjs/response-methods/serverError.js.map +1 -1
  141. package/lib/mjs/response-methods/template.d.ts +3 -3
  142. package/lib/mjs/response-methods/template.d.ts.map +1 -1
  143. package/lib/mjs/response-methods/template.js +6 -4
  144. package/lib/mjs/response-methods/template.js.map +1 -1
  145. package/lib/mjs/response-methods/unauthorized.d.ts +5 -3
  146. package/lib/mjs/response-methods/unauthorized.d.ts.map +1 -1
  147. package/lib/mjs/response-methods/unauthorized.js +8 -4
  148. package/lib/mjs/response-methods/unauthorized.js.map +1 -1
  149. package/lib/mjs/response-methods/validationError.d.ts +5 -3
  150. package/lib/mjs/response-methods/validationError.d.ts.map +1 -1
  151. package/lib/mjs/response-methods/validationError.js +8 -4
  152. package/lib/mjs/response-methods/validationError.js.map +1 -1
  153. package/lib/mjs/responses.d.ts +7 -5
  154. package/lib/mjs/responses.d.ts.map +1 -1
  155. package/lib/mjs/responses.js +51 -14
  156. package/lib/mjs/responses.js.map +1 -1
  157. package/lib/mjs/route-args/FromSession.d.ts +2 -0
  158. package/lib/mjs/route-args/FromSession.d.ts.map +1 -0
  159. package/lib/mjs/route-args/FromSession.js +2 -0
  160. package/lib/mjs/route-args/FromSession.js.map +1 -0
  161. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  162. package/lib/tsconfig.mjs.tsbuildinfo +1 -1
  163. package/package.json +11 -11
  164. package/lib/cjs/response-methods/cookieResponse.d.ts +0 -20
  165. package/lib/cjs/response-methods/cookieResponse.d.ts.map +0 -1
  166. package/lib/cjs/response-methods/cookieResponse.js +0 -74
  167. package/lib/cjs/response-methods/cookieResponse.js.map +0 -1
  168. package/lib/cjs/response-methods/errorResponse.d.ts +0 -8
  169. package/lib/cjs/response-methods/errorResponse.d.ts.map +0 -1
  170. package/lib/cjs/response-methods/errorResponse.js +0 -25
  171. package/lib/cjs/response-methods/errorResponse.js.map +0 -1
  172. package/lib/mjs/response-methods/cookieResponse.d.ts +0 -20
  173. package/lib/mjs/response-methods/cookieResponse.d.ts.map +0 -1
  174. package/lib/mjs/response-methods/cookieResponse.js +0 -47
  175. package/lib/mjs/response-methods/cookieResponse.js.map +0 -1
  176. package/lib/mjs/response-methods/errorResponse.d.ts +0 -8
  177. package/lib/mjs/response-methods/errorResponse.d.ts.map +0 -1
  178. package/lib/mjs/response-methods/errorResponse.js +0 -18
  179. package/lib/mjs/response-methods/errorResponse.js.map +0 -1
@@ -1,13 +1,15 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { ErrorResponse } from './errorResponse.js';
3
+ import { IResponseOptions } from '../interfaces.js';
4
+ import { BadRequest } from './badRequest.js';
4
5
  /**
5
6
  * Internall response function.
6
7
  * Returns HTTP 401 UNAHTORIZED response with json content
7
8
  * @param data - data to send
8
9
  */
9
- export declare class Unauthorized extends ErrorResponse {
10
- constructor(data: any);
10
+ export declare class Unauthorized extends BadRequest {
11
+ protected options?: IResponseOptions;
12
+ constructor(data?: any, options?: IResponseOptions);
11
13
  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
14
  }
13
15
  //# sourceMappingURL=unauthorized.d.ts.map
@@ -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;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
+ {"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,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;GAIG;AAEH,qBAAa,YAAa,SAAQ,UAAU;IAClB,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB;gBAAhD,IAAI,CAAC,EAAE,GAAG,EAAY,OAAO,CAAC,EAAE,gBAAgB;IAI/C,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAMnE"}
@@ -1,17 +1,21 @@
1
1
  import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
- import { ErrorResponse } from './errorResponse.js';
3
+ import { BadRequest } from './badRequest.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 class Unauthorized extends ErrorResponse {
10
- constructor(data) {
9
+ export class Unauthorized extends BadRequest {
10
+ constructor(data, options) {
11
11
  super(data);
12
+ this.options = options;
12
13
  }
13
14
  async execute(_req, _res) {
14
- return await httpResponse(this.responseData, HTTP_STATUS_CODE.UNAUTHORIZED, 'responses/unauthorized');
15
+ return await httpResponse(this.responseData, 'responses/unauthorized', {
16
+ ...this.options,
17
+ StatusCode: HTTP_STATUS_CODE.UNAUTHORIZED,
18
+ });
15
19
  }
16
20
  }
17
21
  //# sourceMappingURL=unauthorized.js.map
@@ -1 +1 @@
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
+ {"version":3,"file":"unauthorized.js","sourceRoot":"","sources":["../../../src/response-methods/unauthorized.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;GAIG;AAEH,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C,YAAY,IAAU,EAAY,OAA0B;QAC1D,KAAK,CAAC,IAAI,CAAC,CAAC;QADoB,YAAO,GAAP,OAAO,CAAmB;IAE5D,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,wBAAwB,EAAE;YACrE,GAAG,IAAI,CAAC,OAAO;YACf,UAAU,EAAE,gBAAgB,CAAC,YAAY;SAC1C,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,13 +1,15 @@
1
1
  /// <reference types="qs" />
2
2
  import * as express from 'express';
3
- import { ErrorResponse } from './errorResponse.js';
3
+ import { IResponseOptions } from '../interfaces.js';
4
+ import { BadRequest } from './badRequest.js';
4
5
  /**
5
6
  * Internall response function.
6
7
  * Returns HTTP 400 BAD REQUEST ERROR
7
8
  * @param err - error to send
8
9
  */
9
- export declare class ValidationError extends ErrorResponse {
10
- constructor(data: any);
10
+ export declare class ValidationError extends BadRequest {
11
+ protected options?: IResponseOptions;
12
+ constructor(data?: any, options?: IResponseOptions);
11
13
  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
14
  }
13
15
  //# sourceMappingURL=validationError.d.ts.map
@@ -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;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
+ {"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,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;GAIG;AAEH,qBAAa,eAAgB,SAAQ,UAAU;IACrB,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB;gBAAhD,IAAI,CAAC,EAAE,GAAG,EAAY,OAAO,CAAC,EAAE,gBAAgB;IAI/C,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ;CAMnE"}
@@ -1,17 +1,21 @@
1
1
  import { HTTP_STATUS_CODE } from '../interfaces.js';
2
2
  import { httpResponse } from '../responses.js';
3
- import { ErrorResponse } from './errorResponse.js';
3
+ import { BadRequest } from './badRequest.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 class ValidationError extends ErrorResponse {
10
- constructor(data) {
9
+ export class ValidationError extends BadRequest {
10
+ constructor(data, options) {
11
11
  super(data);
12
+ this.options = options;
12
13
  }
13
14
  async execute(_req, _res) {
14
- return await httpResponse(this.responseData, HTTP_STATUS_CODE.BAD_REQUEST, 'validationError.pug');
15
+ return await httpResponse(this.responseData, 'validationError.pug', {
16
+ ...this.options,
17
+ StatusCode: HTTP_STATUS_CODE.BAD_REQUEST,
18
+ });
15
19
  }
16
20
  }
17
21
  //# sourceMappingURL=validationError.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"validationError.js","sourceRoot":"","sources":["../../../src/response-methods/validationError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;GAIG;AAEH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,IAAU,EAAY,OAA0B;QAC1D,KAAK,CAAC,IAAI,CAAC,CAAC;QADoB,YAAO,GAAP,OAAO,CAAmB;IAE5D,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,IAAsB;QAChE,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,qBAAqB,EAAE;YAClE,GAAG,IAAI,CAAC,OAAO;YACf,UAAU,EAAE,gBAAgB,CAAC,WAAW;SACzC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,19 +1,21 @@
1
1
  import * as express from 'express';
2
- import { HTTP_STATUS_CODE } from './interfaces.js';
2
+ import { IResponseOptions } from './interfaces.js';
3
+ export declare function _setCoockies(res: express.Response, options?: IResponseOptions): void;
4
+ export declare function _setHeaders(res: express.Response, options?: IResponseOptions): void;
3
5
  /**
4
6
  * Sends data & sets proper header as json
5
7
  *
6
8
  * @param model - data to send
7
9
  * @param status - status code
8
10
  */
9
- export declare function jsonResponse(model: any, status?: HTTP_STATUS_CODE): (_req: express.Request, res: express.Response) => void;
11
+ export declare function jsonResponse(model: any, options?: IResponseOptions): (_req: express.Request, res: express.Response) => void;
10
12
  /**
11
13
  * Sends data & sets proper header as json
12
14
  *
13
15
  * @param model - data to send
14
16
  * @param status - status code
15
17
  */
16
- export declare function textResponse(model: any, status?: HTTP_STATUS_CODE): (_req: express.Request, res: express.Response) => void;
18
+ export declare function textResponse(model: any, options?: IResponseOptions): (_req: express.Request, res: express.Response) => void;
17
19
  /**
18
20
  * Sends html response & sets proper header. If template is not avaible, handles proper error rendering.
19
21
  *
@@ -21,7 +23,7 @@ export declare function textResponse(model: any, status?: HTTP_STATUS_CODE): (_r
21
23
  * @param model - data passed to template
22
24
  * @param status - optional status code
23
25
  */
24
- export declare function htmlResponse(file: string, model: any, status?: HTTP_STATUS_CODE): (req: express.Request, res: express.Response) => void;
26
+ export declare function htmlResponse(file: string, model: any, options?: IResponseOptions): (req: express.Request, res: express.Response) => void;
25
27
  /**
26
28
  * Default response handling. Checks `Accept` header & matches proper response
27
29
  * For now its supports html & json responses
@@ -31,5 +33,5 @@ export declare function htmlResponse(file: string, model: any, status?: HTTP_STA
31
33
  * @param template - template to render without extension eg. `views/responses/ok`. It will try to match .pug, .xml or whatever to match response
32
34
  * to `Accept` header
33
35
  */
34
- export declare function httpResponse(model: any, code: HTTP_STATUS_CODE, template: string): (req: express.Request, res: express.Response) => void;
36
+ export declare function httpResponse(model: any, template: string, options?: IResponseOptions): (req: express.Request, res: express.Response) => void;
35
37
  //# sourceMappingURL=responses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAsC,MAAM,iBAAiB,CAAC;AAWvF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,gBAAgB,UAClD,eAAe,OAAO,gBAAgB,UASrD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,gBAAgB,UAClD,eAAe,OAAO,gBAAgB,UAQrD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,gBAAgB,SAGjE,eAAe,OAAO,gBAAgB,UAoDpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAKlE,eAAe,OAAO,gBAAgB,UA4CpD"}
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAwD,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYzG,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,QAmB7E;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,QAI5E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,gBAAgB,UACnD,eAAe,OAAO,gBAAgB,UAYrD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,gBAAgB,UACnD,eAAe,OAAO,gBAAgB,UAWrD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,gBAAgB,SAGlE,eAAe,OAAO,gBAAgB,UA0DpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,SAKtE,eAAe,OAAO,gBAAgB,UAsDpD"}
@@ -5,15 +5,39 @@ import { Log } from '@spinajs/log-common';
5
5
  import * as randomstring from 'randomstring';
6
6
  import { Templates } from '@spinajs/templates';
7
7
  import { ServerError } from './index.js';
8
+ import * as cs from 'cookie-signature';
9
+ export function _setCoockies(res, options) {
10
+ const cfg = DI.get(Configuration);
11
+ // default coockie optiosn set in config for all cockies
12
+ const opt = cfg.get('http.cookie.options', {});
13
+ options?.Coockies?.forEach((c) => {
14
+ let cookieValue = c.Value;
15
+ if (c.Options.signed) {
16
+ const secureKey = cfg.get('http.cookie.secret');
17
+ cookieValue = cs.sign(this.responseData, secureKey);
18
+ }
19
+ res.cookie(c.Name, cookieValue, {
20
+ ...opt,
21
+ ...c.Options,
22
+ });
23
+ });
24
+ }
25
+ export function _setHeaders(res, options) {
26
+ options?.Headers?.forEach((c) => {
27
+ res.setHeader(c.Name, c.Value);
28
+ });
29
+ }
8
30
  /**
9
31
  * Sends data & sets proper header as json
10
32
  *
11
33
  * @param model - data to send
12
34
  * @param status - status code
13
35
  */
14
- export function jsonResponse(model, status) {
36
+ export function jsonResponse(model, options) {
15
37
  return (_req, res) => {
16
- res.status(status ? status : HTTP_STATUS_CODE.OK);
38
+ res.status(options?.StatusCode ? options?.StatusCode : HTTP_STATUS_CODE.OK);
39
+ _setCoockies(res, options);
40
+ _setHeaders(res, options);
17
41
  if (model) {
18
42
  res.json(model);
19
43
  }
@@ -28,9 +52,11 @@ export function jsonResponse(model, status) {
28
52
  * @param model - data to send
29
53
  * @param status - status code
30
54
  */
31
- export function textResponse(model, status) {
55
+ export function textResponse(model, options) {
32
56
  return (_req, res) => {
33
- res.status(status ? status : HTTP_STATUS_CODE.OK);
57
+ res.status(options?.StatusCode ? options?.StatusCode : HTTP_STATUS_CODE.OK);
58
+ _setCoockies(res, options);
59
+ _setHeaders(res, options);
34
60
  if (model) {
35
61
  res.set('Content-Type', 'text/plain');
36
62
  res.send(JSON.stringify(model));
@@ -44,7 +70,7 @@ export function textResponse(model, status) {
44
70
  * @param model - data passed to template
45
71
  * @param status - optional status code
46
72
  */
47
- export function htmlResponse(file, model, status) {
73
+ export function htmlResponse(file, model, options) {
48
74
  const cfg = DI.get(Configuration);
49
75
  return (req, res) => {
50
76
  if (!req.accepts('html')) {
@@ -55,12 +81,17 @@ export function htmlResponse(file, model, status) {
55
81
  message: 'invalid request content type',
56
82
  code: 400,
57
83
  },
58
- }, HTTP_STATUS_CODE.BAD_REQUEST, file)(req, res);
84
+ }, file, {
85
+ ...options,
86
+ StatusCode: HTTP_STATUS_CODE.BAD_REQUEST,
87
+ })(req, res);
59
88
  });
60
89
  return;
61
90
  }
62
91
  res.set('Content-Type', 'text/html');
63
- _render(file, model, status).catch((err) => {
92
+ _setCoockies(res, options);
93
+ _setHeaders(res, options);
94
+ _render(file, model, options?.StatusCode).catch((err) => {
64
95
  const log = DI.resolve(Log, ['http']);
65
96
  log.warn(`Cannot render html file ${file}, error: ${err.message}:${err.stack}`, err);
66
97
  const fs = DI.resolve('__file_provider__', ['__fs_http_response_templates__']);
@@ -94,7 +125,7 @@ export function htmlResponse(file, model, status) {
94
125
  * @param template - template to render without extension eg. `views/responses/ok`. It will try to match .pug, .xml or whatever to match response
95
126
  * to `Accept` header
96
127
  */
97
- export function httpResponse(model, code, template) {
128
+ export function httpResponse(model, template, options) {
98
129
  const cfg = DI.get(Configuration);
99
130
  const acceptedHeaders = cfg.get('http.AcceptHeaders');
100
131
  const transformers = DI.resolve(Array.ofType(DataTransformer));
@@ -106,14 +137,17 @@ export function httpResponse(model, code, template) {
106
137
  }
107
138
  fs.download(template)
108
139
  .then((file) => {
109
- htmlResponse(file, model, code)(req, res);
140
+ htmlResponse(file, model, options)(req, res);
110
141
  })
111
142
  .catch((err) => {
112
143
  const log = DI.resolve(Log, ['http']);
113
144
  log.warn(`Cannot render html file ${template}, error: ${err.message}:${err.stack}`, err);
114
145
  fs.download('serverError.pug').then((file) => {
115
146
  // try to render server error response
116
- htmlResponse(file, { error: err }, HTTP_STATUS_CODE.INTERNAL_ERROR)(req, res);
147
+ htmlResponse(file, { error: err }, {
148
+ ...options,
149
+ StatusCode: HTTP_STATUS_CODE.INTERNAL_ERROR,
150
+ })(req, res);
117
151
  });
118
152
  });
119
153
  }
@@ -121,7 +155,7 @@ export function httpResponse(model, code, template) {
121
155
  if (req.headers['x-data-transform']) {
122
156
  const transformer = transformers.find((t) => t.Type === req.headers['x-data-transform']);
123
157
  if (transformer) {
124
- jsonResponse(transformer.transform(model, req), code)(req, res);
158
+ jsonResponse(transformer.transform(model, req), options)(req, res);
125
159
  }
126
160
  else {
127
161
  jsonResponse({
@@ -129,15 +163,18 @@ export function httpResponse(model, code, template) {
129
163
  message: "invalid data transformer, remove header 'x-data-transform' to return raw data or set proper data transformer",
130
164
  code: 400,
131
165
  },
132
- }, HTTP_STATUS_CODE.BAD_REQUEST)(req, res);
166
+ }, {
167
+ ...options,
168
+ StatusCode: HTTP_STATUS_CODE.BAD_REQUEST,
169
+ })(req, res);
133
170
  }
134
171
  }
135
172
  else {
136
- jsonResponse(model, code)(req, res);
173
+ jsonResponse(model, options)(req, res);
137
174
  }
138
175
  }
139
176
  else {
140
- textResponse(model, code)(req, res);
177
+ textResponse(model, options)(req, res);
141
178
  }
142
179
  };
143
180
  }
@@ -1 +1 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAU,EAAE,MAAyB;IAChE,OAAO,CAAC,IAAqB,EAAE,GAAqB,EAAE,EAAE;QACtD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAElD,IAAI,KAAK,EAAE;YAC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AU,EAAE,gBAAgB,CAAC,WAAW;qBACzC,CACF,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;iBACb;aACF;iBAAM;gBACL,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;aACxC;SACF;aAAM;YACL,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;SACxC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FromSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FromSession.d.ts","sourceRoot":"","sources":["../../../src/route-args/FromSession.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FromSession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FromSession.js","sourceRoot":"","sources":["../../../src/route-args/FromSession.ts"],"names":[],"mappings":""}