@pristine-ts/networking 0.0.162 → 0.0.166

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 (186) hide show
  1. package/dist/lib/cjs/decorators/body.decorator.js +20 -1
  2. package/dist/lib/cjs/decorators/body.decorator.js.map +1 -1
  3. package/dist/lib/cjs/decorators/controller.decorator.js +13 -1
  4. package/dist/lib/cjs/decorators/controller.decorator.js.map +1 -1
  5. package/dist/lib/cjs/decorators/decorators.js +1 -1
  6. package/dist/lib/cjs/decorators/decorators.js.map +1 -1
  7. package/dist/lib/cjs/decorators/headers.decorator.js +20 -1
  8. package/dist/lib/cjs/decorators/headers.decorator.js.map +1 -1
  9. package/dist/lib/cjs/decorators/identity.decorator.js +20 -1
  10. package/dist/lib/cjs/decorators/identity.decorator.js.map +1 -1
  11. package/dist/lib/cjs/decorators/query-parameter.decorator.js +22 -1
  12. package/dist/lib/cjs/decorators/query-parameter.decorator.js.map +1 -1
  13. package/dist/lib/cjs/decorators/query-parameters.decorator.js +20 -1
  14. package/dist/lib/cjs/decorators/query-parameters.decorator.js.map +1 -1
  15. package/dist/lib/cjs/decorators/request.decorator.js +20 -1
  16. package/dist/lib/cjs/decorators/request.decorator.js.map +1 -1
  17. package/dist/lib/cjs/decorators/response-header.decorator.js +24 -2
  18. package/dist/lib/cjs/decorators/response-header.decorator.js.map +1 -1
  19. package/dist/lib/cjs/decorators/route-parameter.decorator.js +21 -1
  20. package/dist/lib/cjs/decorators/route-parameter.decorator.js.map +1 -1
  21. package/dist/lib/cjs/decorators/route.decorator.js +21 -1
  22. package/dist/lib/cjs/decorators/route.decorator.js.map +1 -1
  23. package/dist/lib/cjs/enrichers/router-response.enricher.js +4 -0
  24. package/dist/lib/cjs/enrichers/router-response.enricher.js.map +1 -1
  25. package/dist/lib/cjs/errors/errors.js +3 -1
  26. package/dist/lib/cjs/errors/errors.js.map +1 -1
  27. package/dist/lib/cjs/errors/http.error.js +1 -1
  28. package/dist/lib/cjs/errors/http.error.js.map +1 -1
  29. package/dist/lib/cjs/errors/method-router-adding.error.js +25 -0
  30. package/dist/lib/cjs/errors/method-router-adding.error.js.map +1 -0
  31. package/dist/lib/cjs/errors/path-router-adding.error.js +3 -2
  32. package/dist/lib/cjs/errors/path-router-adding.error.js.map +1 -1
  33. package/dist/lib/cjs/errors/path-router-instantiation.error.js +3 -2
  34. package/dist/lib/cjs/errors/path-router-instantiation.error.js.map +1 -1
  35. package/dist/lib/cjs/interfaces/interfaces.js +2 -2
  36. package/dist/lib/cjs/interfaces/interfaces.js.map +1 -1
  37. package/dist/lib/cjs/models/models.js +0 -1
  38. package/dist/lib/cjs/models/models.js.map +1 -1
  39. package/dist/lib/cjs/models/request.js +10 -4
  40. package/dist/lib/cjs/models/request.js.map +1 -1
  41. package/dist/lib/cjs/models/response.js +6 -0
  42. package/dist/lib/cjs/models/response.js.map +1 -1
  43. package/dist/lib/cjs/models/route.js +4 -0
  44. package/dist/lib/cjs/models/route.js.map +1 -1
  45. package/dist/lib/cjs/networking.module.js +0 -6
  46. package/dist/lib/cjs/networking.module.js.map +1 -1
  47. package/dist/lib/cjs/nodes/method-router.node.js +19 -4
  48. package/dist/lib/cjs/nodes/method-router.node.js.map +1 -1
  49. package/dist/lib/cjs/nodes/path-router.node.js +22 -12
  50. package/dist/lib/cjs/nodes/path-router.node.js.map +1 -1
  51. package/dist/lib/cjs/resolvers/body-parameter-decorator.resolver.js +18 -0
  52. package/dist/lib/cjs/resolvers/body-parameter-decorator.resolver.js.map +1 -1
  53. package/dist/lib/cjs/resolvers/controller-method-parameter-decorator.resolver.js +14 -0
  54. package/dist/lib/cjs/resolvers/controller-method-parameter-decorator.resolver.js.map +1 -1
  55. package/dist/lib/cjs/resolvers/headers-parameter-decorator.resolver.js +18 -0
  56. package/dist/lib/cjs/resolvers/headers-parameter-decorator.resolver.js.map +1 -1
  57. package/dist/lib/cjs/resolvers/identity-parameter-decorator.resolver.js +18 -0
  58. package/dist/lib/cjs/resolvers/identity-parameter-decorator.resolver.js.map +1 -1
  59. package/dist/lib/cjs/resolvers/query-parameter-decorator.resolver.js +19 -0
  60. package/dist/lib/cjs/resolvers/query-parameter-decorator.resolver.js.map +1 -1
  61. package/dist/lib/cjs/resolvers/query-parameters-decorator.resolver.js +18 -0
  62. package/dist/lib/cjs/resolvers/query-parameters-decorator.resolver.js.map +1 -1
  63. package/dist/lib/cjs/resolvers/request-parameter-decorator.resolver.js +18 -0
  64. package/dist/lib/cjs/resolvers/request-parameter-decorator.resolver.js.map +1 -1
  65. package/dist/lib/cjs/resolvers/route-parameter-decorator.resolver.js +18 -0
  66. package/dist/lib/cjs/resolvers/route-parameter-decorator.resolver.js.map +1 -1
  67. package/dist/lib/cjs/router.js +25 -10
  68. package/dist/lib/cjs/router.js.map +1 -1
  69. package/dist/lib/esm/decorators/body.decorator.js +20 -1
  70. package/dist/lib/esm/decorators/body.decorator.js.map +1 -1
  71. package/dist/lib/esm/decorators/controller.decorator.js +13 -1
  72. package/dist/lib/esm/decorators/controller.decorator.js.map +1 -1
  73. package/dist/lib/esm/decorators/decorators.js +1 -1
  74. package/dist/lib/esm/decorators/decorators.js.map +1 -1
  75. package/dist/lib/esm/decorators/headers.decorator.js +20 -1
  76. package/dist/lib/esm/decorators/headers.decorator.js.map +1 -1
  77. package/dist/lib/esm/decorators/identity.decorator.js +20 -1
  78. package/dist/lib/esm/decorators/identity.decorator.js.map +1 -1
  79. package/dist/lib/esm/decorators/query-parameter.decorator.js +22 -1
  80. package/dist/lib/esm/decorators/query-parameter.decorator.js.map +1 -1
  81. package/dist/lib/esm/decorators/query-parameters.decorator.js +20 -1
  82. package/dist/lib/esm/decorators/query-parameters.decorator.js.map +1 -1
  83. package/dist/lib/esm/decorators/request.decorator.js +20 -1
  84. package/dist/lib/esm/decorators/request.decorator.js.map +1 -1
  85. package/dist/lib/esm/decorators/response-header.decorator.js +24 -2
  86. package/dist/lib/esm/decorators/response-header.decorator.js.map +1 -1
  87. package/dist/lib/esm/decorators/route-parameter.decorator.js +21 -1
  88. package/dist/lib/esm/decorators/route-parameter.decorator.js.map +1 -1
  89. package/dist/lib/esm/decorators/route.decorator.js +21 -1
  90. package/dist/lib/esm/decorators/route.decorator.js.map +1 -1
  91. package/dist/lib/esm/enrichers/router-response.enricher.js +4 -0
  92. package/dist/lib/esm/enrichers/router-response.enricher.js.map +1 -1
  93. package/dist/lib/esm/errors/errors.js +3 -1
  94. package/dist/lib/esm/errors/errors.js.map +1 -1
  95. package/dist/lib/esm/errors/http.error.js +1 -1
  96. package/dist/lib/esm/errors/http.error.js.map +1 -1
  97. package/dist/lib/esm/errors/method-router-adding.error.js +21 -0
  98. package/dist/lib/esm/errors/method-router-adding.error.js.map +1 -0
  99. package/dist/lib/esm/errors/path-router-adding.error.js +3 -2
  100. package/dist/lib/esm/errors/path-router-adding.error.js.map +1 -1
  101. package/dist/lib/esm/errors/path-router-instantiation.error.js +3 -2
  102. package/dist/lib/esm/errors/path-router-instantiation.error.js.map +1 -1
  103. package/dist/lib/esm/interfaces/interfaces.js +2 -2
  104. package/dist/lib/esm/interfaces/interfaces.js.map +1 -1
  105. package/dist/lib/esm/models/models.js +0 -1
  106. package/dist/lib/esm/models/models.js.map +1 -1
  107. package/dist/lib/esm/models/request.js +10 -4
  108. package/dist/lib/esm/models/request.js.map +1 -1
  109. package/dist/lib/esm/models/response.js +6 -0
  110. package/dist/lib/esm/models/response.js.map +1 -1
  111. package/dist/lib/esm/models/route.js +4 -0
  112. package/dist/lib/esm/models/route.js.map +1 -1
  113. package/dist/lib/esm/networking.module.js +0 -6
  114. package/dist/lib/esm/networking.module.js.map +1 -1
  115. package/dist/lib/esm/nodes/method-router.node.js +19 -4
  116. package/dist/lib/esm/nodes/method-router.node.js.map +1 -1
  117. package/dist/lib/esm/nodes/path-router.node.js +22 -12
  118. package/dist/lib/esm/nodes/path-router.node.js.map +1 -1
  119. package/dist/lib/esm/resolvers/body-parameter-decorator.resolver.js +18 -0
  120. package/dist/lib/esm/resolvers/body-parameter-decorator.resolver.js.map +1 -1
  121. package/dist/lib/esm/resolvers/controller-method-parameter-decorator.resolver.js +14 -0
  122. package/dist/lib/esm/resolvers/controller-method-parameter-decorator.resolver.js.map +1 -1
  123. package/dist/lib/esm/resolvers/headers-parameter-decorator.resolver.js +18 -0
  124. package/dist/lib/esm/resolvers/headers-parameter-decorator.resolver.js.map +1 -1
  125. package/dist/lib/esm/resolvers/identity-parameter-decorator.resolver.js +18 -0
  126. package/dist/lib/esm/resolvers/identity-parameter-decorator.resolver.js.map +1 -1
  127. package/dist/lib/esm/resolvers/query-parameter-decorator.resolver.js +19 -0
  128. package/dist/lib/esm/resolvers/query-parameter-decorator.resolver.js.map +1 -1
  129. package/dist/lib/esm/resolvers/query-parameters-decorator.resolver.js +18 -0
  130. package/dist/lib/esm/resolvers/query-parameters-decorator.resolver.js.map +1 -1
  131. package/dist/lib/esm/resolvers/request-parameter-decorator.resolver.js +18 -0
  132. package/dist/lib/esm/resolvers/request-parameter-decorator.resolver.js.map +1 -1
  133. package/dist/lib/esm/resolvers/route-parameter-decorator.resolver.js +18 -0
  134. package/dist/lib/esm/resolvers/route-parameter-decorator.resolver.js.map +1 -1
  135. package/dist/lib/esm/router.js +25 -10
  136. package/dist/lib/esm/router.js.map +1 -1
  137. package/dist/types/decorators/body.decorator.d.ts +3 -0
  138. package/dist/types/decorators/controller.decorator.d.ts +4 -0
  139. package/dist/types/decorators/decorators.d.ts +1 -1
  140. package/dist/types/decorators/headers.decorator.d.ts +3 -0
  141. package/dist/types/decorators/identity.decorator.d.ts +3 -0
  142. package/dist/types/decorators/query-parameter.decorator.d.ts +4 -0
  143. package/dist/types/decorators/query-parameters.decorator.d.ts +3 -0
  144. package/dist/types/decorators/request.decorator.d.ts +3 -0
  145. package/dist/types/decorators/response-header.decorator.d.ts +7 -0
  146. package/dist/types/decorators/route-parameter.decorator.d.ts +4 -0
  147. package/dist/types/decorators/route.decorator.d.ts +6 -1
  148. package/dist/types/enrichers/router-response.enricher.d.ts +4 -0
  149. package/dist/types/errors/errors.d.ts +3 -1
  150. package/dist/types/errors/http.error.d.ts +1 -1
  151. package/dist/types/errors/method-router-adding.error.d.ts +10 -0
  152. package/dist/types/errors/path-router-adding.error.d.ts +4 -3
  153. package/dist/types/errors/path-router-instantiation.error.d.ts +4 -3
  154. package/dist/types/interfaces/controller-method-parameter-decorator-resolver.interface.d.ts +19 -2
  155. package/dist/types/interfaces/interfaces.d.ts +2 -2
  156. package/dist/types/interfaces/parameter-decorator.interface.d.ts +4 -0
  157. package/dist/types/interfaces/query-parameters-decorator.interface.d.ts +4 -0
  158. package/dist/types/interfaces/route-parameter-decorator.interface.d.ts +1 -1
  159. package/dist/types/interfaces/router.interface.d.ts +2 -2
  160. package/dist/types/models/models.d.ts +0 -1
  161. package/dist/types/models/request.d.ts +16 -4
  162. package/dist/types/models/response.d.ts +15 -0
  163. package/dist/types/models/route.d.ts +4 -0
  164. package/dist/types/nodes/method-router.node.d.ts +17 -4
  165. package/dist/types/nodes/path-router.node.d.ts +11 -7
  166. package/dist/types/nodes/router.node.d.ts +3 -3
  167. package/dist/types/resolvers/body-parameter-decorator.resolver.d.ts +22 -2
  168. package/dist/types/resolvers/controller-method-parameter-decorator.resolver.d.ts +14 -0
  169. package/dist/types/resolvers/headers-parameter-decorator.resolver.d.ts +22 -2
  170. package/dist/types/resolvers/identity-parameter-decorator.resolver.d.ts +22 -2
  171. package/dist/types/resolvers/query-parameter-decorator.resolver.d.ts +23 -2
  172. package/dist/types/resolvers/query-parameters-decorator.resolver.d.ts +22 -2
  173. package/dist/types/resolvers/request-parameter-decorator.resolver.d.ts +22 -2
  174. package/dist/types/resolvers/route-parameter-decorator.resolver.d.ts +22 -2
  175. package/dist/types/router.d.ts +13 -3
  176. package/package.json +5 -5
  177. package/dist/lib/cjs/enums/enums.js +0 -1
  178. package/dist/lib/cjs/enums/enums.js.map +0 -1
  179. package/dist/lib/cjs/models/error-response-body.js +0 -7
  180. package/dist/lib/cjs/models/error-response-body.js.map +0 -1
  181. package/dist/lib/esm/enums/enums.js +0 -1
  182. package/dist/lib/esm/enums/enums.js.map +0 -1
  183. package/dist/lib/esm/models/error-response-body.js +0 -3
  184. package/dist/lib/esm/models/error-response-body.js.map +0 -1
  185. package/dist/types/enums/enums.d.ts +0 -0
  186. package/dist/types/models/error-response-body.d.ts +0 -4
@@ -8,10 +8,28 @@ import "reflect-metadata";
8
8
  import { injectable } from "tsyringe";
9
9
  import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
10
10
  import { NetworkingModuleKeyname } from "../networking.module.keyname";
11
+ /**
12
+ * The IdentityParameterDecoratorResolver resolves the value of the identity (parsed by the authenticator) of the request
13
+ * so that it can be injected it into the parameter of the route of the controller that was annotated with the @identity decorator.
14
+ * It is tagged as an MethodParameterDecoratorResolver so it can be automatically injected with the all the other MethodParameterDecoratorResolvers.
15
+ */
11
16
  let IdentityParameterDecoratorResolver = class IdentityParameterDecoratorResolver {
17
+ /**
18
+ * Resolves the value of the identity of the request.
19
+ * The router than injects that value into the parameter of the controller method.
20
+ * @param methodArgument The method argument created by the decorator.
21
+ * @param request The request
22
+ * @param routeParameters The router parameters
23
+ * @param identity The identity making the request
24
+ */
12
25
  resolve(methodArgument, request, routeParameters, identity) {
13
26
  return Promise.resolve(identity !== null && identity !== void 0 ? identity : null);
14
27
  }
28
+ /**
29
+ * Returns whether or not the resolver support such a method argument.
30
+ * Usually we will check the methodArgument.type field to determine if it is a supported type.
31
+ * @param methodArgument
32
+ */
15
33
  supports(methodArgument) {
16
34
  return methodArgument && methodArgument.hasOwnProperty("type") && methodArgument.type === "identity";
17
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"identity-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/identity-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAKrE,IAAa,kCAAkC,GAA/C,MAAa,kCAAkC;IAC3C,OAAO,CAAC,cAAmB,EACnB,OAAgB,EAChB,eAAwC,EACxC,QAA4B;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,cAAmB;QACxB,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,UAAU,CAAC;IACzG,CAAC;CACJ,CAAA;AAXY,kCAAkC;IAH9C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,kCAAkC,CAW9C;SAXY,kCAAkC"}
1
+ {"version":3,"file":"identity-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/identity-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAIrE;;;;GAIG;AAIH,IAAa,kCAAkC,GAA/C,MAAa,kCAAkC;IAE3C;;;;;;;OAOG;IACH,OAAO,CAAC,cAAmD,EACnD,OAAgB,EAChB,eAAwC,EACxC,QAA4B;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAA2C;QAChD,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,UAAU,CAAC;IACzG,CAAC;CACJ,CAAA;AAzBY,kCAAkC;IAH9C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,kCAAkC,CAyB9C;SAzBY,kCAAkC"}
@@ -8,12 +8,31 @@ import { injectable } from "tsyringe";
8
8
  import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
9
9
  import { NetworkingModuleKeyname } from "../networking.module.keyname";
10
10
  import Url from 'url-parse';
11
+ /**
12
+ * The QueryParameterDecoratorResolver resolves the value of the query parameter with the name passed to the decorator
13
+ * of the request so that it can be injected it into the parameter of the route of the controller that was annotated
14
+ * with the @queryParameter decorator.
15
+ * It is tagged as an MethodParameterDecoratorResolver so it can be automatically injected with the all the other MethodParameterDecoratorResolvers.
16
+ */
11
17
  let QueryParameterDecoratorResolver = class QueryParameterDecoratorResolver {
18
+ /**
19
+ * Resolves the value of the query parameter with the specified name of the request.
20
+ * The router than injects that value into the parameter of the controller method.
21
+ * @param methodArgument The method argument created by the decorator including the query parameter name.
22
+ * @param request The request
23
+ * @param routeParameters The router parameters
24
+ * @param identity The identity making the request
25
+ */
12
26
  resolve(methodArgument, request, routeParameters, identity) {
13
27
  var _a;
14
28
  const url = new Url(request.url, true);
15
29
  return Promise.resolve((_a = url.query[methodArgument.queryParameterName]) !== null && _a !== void 0 ? _a : null);
16
30
  }
31
+ /**
32
+ * Returns whether or not the resolver support such a method argument.
33
+ * Usually we will check the methodArgument.type field to determine if it is a supported type.
34
+ * @param methodArgument
35
+ */
17
36
  supports(methodArgument) {
18
37
  return methodArgument && methodArgument.hasOwnProperty("type") && methodArgument.type === "queryParameter";
19
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"query-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/query-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAIpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,GAAG,MAAM,WAAW,CAAC;AAK5B,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IACxC,OAAO,CAAC,cAAmB,EACnB,OAAgB,EAChB,eAAwC,EACxC,QAA4B;;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEvC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAA,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,mCAAI,IAAI,CAAC,CAAC;IACjF,CAAC;IAED,QAAQ,CAAC,cAAmB;QACxB,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC;IAC/G,CAAC;CACJ,CAAA;AAbY,+BAA+B;IAH3C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,+BAA+B,CAa3C;SAbY,+BAA+B"}
1
+ {"version":3,"file":"query-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/query-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,GAAG,MAAM,WAAW,CAAC;AAI5B;;;;;GAKG;AAIH,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IAExC;;;;;;;OAOG;IACH,OAAO,CAAC,cAAgD,EAChD,OAAgB,EAChB,eAAwC,EACxC,QAA4B;;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEvC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAA,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,mCAAI,IAAI,CAAC,CAAC;IACjF,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAA2C;QAChD,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC;IAC/G,CAAC;CACJ,CAAA;AA3BY,+BAA+B;IAH3C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,+BAA+B,CA2B3C;SA3BY,+BAA+B"}
@@ -8,12 +8,30 @@ import { injectable } from "tsyringe";
8
8
  import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
9
9
  import { NetworkingModuleKeyname } from "../networking.module.keyname";
10
10
  import Url from 'url-parse';
11
+ /**
12
+ * The QueryParametersDecoratorResolver resolves the value (a map) of the query parameters of the request so that it can be injected it into the
13
+ * parameter of the route of the controller that was annotated with the @queryParameters decorator.
14
+ * It is tagged as an MethodParameterDecoratorResolver so it can be automatically injected with the all the other MethodParameterDecoratorResolvers.
15
+ */
11
16
  let QueryParametersDecoratorResolver = class QueryParametersDecoratorResolver {
17
+ /**
18
+ * Resolves the value of all the query parameters of the request.
19
+ * The router than injects that value into the parameter of the controller method.
20
+ * @param methodArgument The method argument created by the decorator.
21
+ * @param request The request
22
+ * @param routeParameters The router parameters
23
+ * @param identity The identity making the request
24
+ */
12
25
  resolve(methodArgument, request, routeParameters, identity) {
13
26
  var _a;
14
27
  const url = new Url(request.url, true);
15
28
  return Promise.resolve((_a = url.query) !== null && _a !== void 0 ? _a : null);
16
29
  }
30
+ /**
31
+ * Returns whether or not the resolver support such a method argument.
32
+ * Usually we will check the methodArgument.type field to determine if it is a supported type.
33
+ * @param methodArgument
34
+ */
17
35
  supports(methodArgument) {
18
36
  return methodArgument && methodArgument.hasOwnProperty("type") && methodArgument.type === "queryParameters";
19
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"query-parameters-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/query-parameters-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,GAAG,MAAM,WAAW,CAAC;AAK5B,IAAa,gCAAgC,GAA7C,MAAa,gCAAgC;IACzC,OAAO,CAAC,cAAmB,EACnB,OAAgB,EAChB,eAAwC,EACxC,QAA4B;;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEvC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAA,GAAG,CAAC,KAAK,mCAAI,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ,CAAC,cAAmB;QACxB,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,iBAAiB,CAAC;IAChH,CAAC;CACJ,CAAA;AAbY,gCAAgC;IAH5C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,gCAAgC,CAa5C;SAbY,gCAAgC"}
1
+ {"version":3,"file":"query-parameters-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/query-parameters-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,GAAG,MAAM,WAAW,CAAC;AAI5B;;;;GAIG;AAIH,IAAa,gCAAgC,GAA7C,MAAa,gCAAgC;IAEzC;;;;;;;OAOG;IACH,OAAO,CAAC,cAAiD,EACjD,OAAgB,EAChB,eAAwC,EACxC,QAA4B;;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEvC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAA,GAAG,CAAC,KAAK,mCAAI,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAA2C;QAChD,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,iBAAiB,CAAC;IAChH,CAAC;CACJ,CAAA;AA3BY,gCAAgC;IAH5C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,gCAAgC,CA2B5C;SA3BY,gCAAgC"}
@@ -8,10 +8,28 @@ import "reflect-metadata";
8
8
  import { injectable } from "tsyringe";
9
9
  import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
10
10
  import { NetworkingModuleKeyname } from "../networking.module.keyname";
11
+ /**
12
+ * The RequestParameterDecoratorResolver resolves the value of the whole request so that it can be injected it into the
13
+ * parameter of the route of the controller that was annotated with the @request decorator.
14
+ * It is tagged as an MethodParameterDecoratorResolver so it can be automatically injected with the all the other MethodParameterDecoratorResolvers.
15
+ */
11
16
  let RequestParameterDecoratorResolver = class RequestParameterDecoratorResolver {
17
+ /**
18
+ * Resolves the value of the whole request.
19
+ * The router than injects that value into the parameter of the controller method.
20
+ * @param methodArgument The method argument created by the decorator.
21
+ * @param request The request
22
+ * @param routeParameters The router parameters
23
+ * @param identity The identity making the request
24
+ */
12
25
  resolve(methodArgument, request, routeParameters, identity) {
13
26
  return Promise.resolve(request !== null && request !== void 0 ? request : null);
14
27
  }
28
+ /**
29
+ * Returns whether or not the resolver support such a method argument.
30
+ * Usually we will check the methodArgument.type field to determine if it is a supported type.
31
+ * @param methodArgument
32
+ */
15
33
  supports(methodArgument) {
16
34
  return methodArgument && methodArgument.hasOwnProperty("type") && methodArgument.type === "request";
17
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/request-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAKrE,IAAa,iCAAiC,GAA9C,MAAa,iCAAiC;IAC1C,OAAO,CAAC,cAAmB,EACnB,OAAgB,EAChB,eAAwC,EACxC,QAA4B;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ,CAAC,cAAmB;QACxB,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,SAAS,CAAC;IACxG,CAAC;CACJ,CAAA;AAXY,iCAAiC;IAH7C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,iCAAiC,CAW7C;SAXY,iCAAiC"}
1
+ {"version":3,"file":"request-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/request-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAIrE;;;;GAIG;AAIH,IAAa,iCAAiC,GAA9C,MAAa,iCAAiC;IAE1C;;;;;;;OAOG;IACH,OAAO,CAAC,cAAkD,EAClD,OAAgB,EAChB,eAAwC,EACxC,QAA4B;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAA2C;QAChD,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,SAAS,CAAC;IACxG,CAAC;CACJ,CAAA;AAzBY,iCAAiC;IAH7C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,iCAAiC,CAyB7C;SAzBY,iCAAiC"}
@@ -7,11 +7,29 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { injectable } from "tsyringe";
8
8
  import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
9
9
  import { NetworkingModuleKeyname } from "../networking.module.keyname";
10
+ /**
11
+ * The RouteParameterDecoratorResolver resolves the value of the route parameter specified of the request so that it can be injected it into the
12
+ * parameter of the route of the controller that was annotated with the @routeParameter decorator.
13
+ * It is tagged as an MethodParameterDecoratorResolver so it can be automatically injected with the all the other MethodParameterDecoratorResolvers.
14
+ */
10
15
  let RouteParameterDecoratorResolver = class RouteParameterDecoratorResolver {
16
+ /**
17
+ * Resolves the value of the the route parameter with the specified name of the request.
18
+ * The router than injects that value into the parameter of the controller method.
19
+ * @param methodArgument The method argument created by the decorator, including the name of the parameter to resolve.
20
+ * @param request The request
21
+ * @param routeParameters The router parameters
22
+ * @param identity The identity making the request
23
+ */
11
24
  resolve(methodArgument, request, routeParameters, identity) {
12
25
  var _a;
13
26
  return Promise.resolve((_a = routeParameters[methodArgument.routeParameterName]) !== null && _a !== void 0 ? _a : null);
14
27
  }
28
+ /**
29
+ * Returns whether or not the resolver support such a method argument.
30
+ * Usually we will check the methodArgument.type field to determine if it is a supported type.
31
+ * @param methodArgument
32
+ */
15
33
  supports(methodArgument) {
16
34
  return methodArgument && methodArgument.hasOwnProperty("type") && methodArgument.type === "routeParameter";
17
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"route-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/route-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAKrE,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IACxC,OAAO,CAAC,cAAmB,EACnB,OAAgB,EAChB,eAAwC,EACxC,QAA4B;;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAA,eAAe,CAAC,cAAc,CAAC,kBAAkB,CAAC,mCAAI,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,QAAQ,CAAC,cAAmB;QACxB,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC;IAC/G,CAAC;CACJ,CAAA;AAXY,+BAA+B;IAH3C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,+BAA+B,CAW3C;SAXY,+BAA+B"}
1
+ {"version":3,"file":"route-parameter-decorator.resolver.js","sourceRoot":"","sources":["../../../../src/resolvers/route-parameter-decorator.resolver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAoB,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAGrE;;;;GAIG;AAIH,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IAExC;;;;;;;OAOG;IACH,OAAO,CAAC,cAAgD,EAChD,OAAgB,EAChB,eAAwC,EACxC,QAA4B;;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAA,eAAe,CAAC,cAAc,CAAC,kBAAkB,CAAC,mCAAI,IAAI,CAAC,CAAC;IACvF,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAA2C;QAChD,OAAO,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,KAAK,gBAAgB,CAAC;IAC/G,CAAC;CACJ,CAAA;AAzBY,+BAA+B;IAH3C,YAAY,CAAC,uBAAuB,CAAC;IACrC,GAAG,CAAC,wBAAwB,CAAC,gCAAgC,CAAC;IAC9D,UAAU,EAAE;GACA,+BAA+B,CAyB3C;SAzBY,+BAA+B"}
@@ -30,13 +30,24 @@ import Url from 'url-parse';
30
30
  import { ServiceDefinitionTagEnum } from "@pristine-ts/common";
31
31
  import { NetworkingModuleKeyname } from "./networking.module.keyname";
32
32
  import { SpanKeynameEnum } from "@pristine-ts/telemetry";
33
+ /**
34
+ * The router service is the service that creates the routing tree from the controllers.
35
+ * It also executes a request properly by routing it to the intended controller and returns the response.
36
+ */
33
37
  let Router = class Router {
34
- constructor(loghandler, controllerMethodParameterDecoratorResolver, authorizerManager, authenticationManager, tracingManager) {
38
+ /**
39
+ * The router service is the service that creates the routing tree from the controllers.
40
+ * It also executes a request properly by routing it to the intended controller and returns the response.
41
+ * @param loghandler The log handler
42
+ * @param controllerMethodParameterDecoratorResolver The controller method parameter decorator resolver used to resolve the values.
43
+ * @param authorizerManager The authorizer manager to validate authorization.
44
+ * @param authenticationManager The authentication manager to validate authentication.
45
+ */
46
+ constructor(loghandler, controllerMethodParameterDecoratorResolver, authorizerManager, authenticationManager) {
35
47
  this.loghandler = loghandler;
36
48
  this.controllerMethodParameterDecoratorResolver = controllerMethodParameterDecoratorResolver;
37
49
  this.authorizerManager = authorizerManager;
38
50
  this.authenticationManager = authenticationManager;
39
- this.tracingManager = tracingManager;
40
51
  this.root = new PathRouterNode("/");
41
52
  }
42
53
  /**
@@ -59,13 +70,14 @@ let Router = class Router {
59
70
  * @param container
60
71
  */
61
72
  execute(request, container) {
62
- const routerRequestExecutionSpan = this.tracingManager.startSpan(SpanKeynameEnum.RouterRequestExecution, SpanKeynameEnum.RequestExecution);
73
+ const tracingManager = container.resolve("TracingManagerInterface");
74
+ const routerRequestExecutionSpan = tracingManager.startSpan(SpanKeynameEnum.RouterRequestExecution, SpanKeynameEnum.RequestExecution);
63
75
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
64
76
  // Start by decomposing the URL. Set second parameter to true since we want to parse the query strings
65
77
  const url = new Url(request.url, false);
66
78
  // Split the path name
67
79
  const splitPath = UrlUtil.splitPath(url.pathname);
68
- const methodNodeSpan = this.tracingManager.startSpan(SpanKeynameEnum.RouterFindMethodRouterNode, SpanKeynameEnum.RouterRequestExecution);
80
+ const methodNodeSpan = tracingManager.startSpan(SpanKeynameEnum.RouterFindMethodRouterNode, SpanKeynameEnum.RouterRequestExecution);
69
81
  // Retrieve the node to have information about the controller
70
82
  const methodNode = this.root.find(splitPath, request.httpMethod);
71
83
  methodNodeSpan.end();
@@ -88,7 +100,7 @@ let Router = class Router {
88
100
  // Get the route parameters
89
101
  const routeParameters = methodNode.parent.getRouteParameters(splitPath.reverse());
90
102
  // Instantiate the controller
91
- const routerControllerResolverSpan = this.tracingManager.startSpan(SpanKeynameEnum.RouterControllerResolver, SpanKeynameEnum.RouterRequestExecution);
103
+ const routerControllerResolverSpan = tracingManager.startSpan(SpanKeynameEnum.RouterControllerResolver, SpanKeynameEnum.RouterRequestExecution);
92
104
  const controller = container.resolve(methodNode.route.controllerInstantiationToken);
93
105
  routerControllerResolverSpan.end();
94
106
  this.loghandler.debug("Before calling the authenticationManager", {
@@ -96,8 +108,9 @@ let Router = class Router {
96
108
  routeParameters
97
109
  }, NetworkingModuleKeyname);
98
110
  let identity;
111
+ // Authenticate the request
99
112
  try {
100
- const routerRequestAuthenticationSpan = this.tracingManager.startSpan(SpanKeynameEnum.RouterRequestAuthentication, SpanKeynameEnum.RouterRequestExecution);
113
+ const routerRequestAuthenticationSpan = tracingManager.startSpan(SpanKeynameEnum.RouterRequestAuthentication, SpanKeynameEnum.RouterRequestExecution);
101
114
  identity = yield this.authenticationManager.authenticate(request, methodNode.route.context, container);
102
115
  routerRequestAuthenticationSpan.end();
103
116
  this.loghandler.debug("Found identity.", {
@@ -120,6 +133,7 @@ let Router = class Router {
120
133
  }
121
134
  // Call the controller with the resolved Method arguments
122
135
  try {
136
+ // Verify that the identity making the request is authorized to make such a request
123
137
  if ((yield this.authorizerManager.isAuthorized(request, methodNode.route.context, container, identity)) === false) {
124
138
  this.loghandler.error("User not authorized to access this url.", {
125
139
  request,
@@ -130,13 +144,15 @@ let Router = class Router {
130
144
  routerRequestExecutionSpan.end();
131
145
  return reject(new ForbiddenHttpError("You are not allowed to access this."));
132
146
  }
133
- const requestEnrichersSpan = this.tracingManager.startSpan(SpanKeynameEnum.RouterRequestEnrichers, SpanKeynameEnum.RouterRequestExecution);
147
+ // Execute all the enrichers to enrich the request.
148
+ const requestEnrichersSpan = tracingManager.startSpan(SpanKeynameEnum.RouterRequestEnrichers, SpanKeynameEnum.RouterRequestExecution);
134
149
  const enrichedRequest = yield this.executeRequestEnrichers(request, container, methodNode);
135
150
  requestEnrichersSpan.end();
136
151
  this.loghandler.debug("This request has been enriched", {
137
152
  request,
138
153
  enrichedRequest,
139
154
  }, NetworkingModuleKeyname);
155
+ // Resolve the value to inject in the method arguments that have a decorator resolver
140
156
  const resolvedMethodArguments = [];
141
157
  for (const methodArgument of methodNode.route.methodArguments) {
142
158
  resolvedMethodArguments.push(yield this.controllerMethodParameterDecoratorResolver.resolve(methodArgument, enrichedRequest, routeParameters, identity));
@@ -163,7 +179,7 @@ let Router = class Router {
163
179
  returnedResponse.status = 200;
164
180
  returnedResponse.body = response;
165
181
  }
166
- const responseEnrichersSpan = this.tracingManager.startSpan(SpanKeynameEnum.RouterResponseEnrichers, SpanKeynameEnum.RouterRequestExecution);
182
+ const responseEnrichersSpan = tracingManager.startSpan(SpanKeynameEnum.RouterResponseEnrichers, SpanKeynameEnum.RouterRequestExecution);
167
183
  const enrichedResponse = yield this.executeResponseEnrichers(returnedResponse, request, container, methodNode);
168
184
  responseEnrichersSpan.end();
169
185
  this.loghandler.debug("This response has been enriched", {
@@ -259,8 +275,7 @@ Router = __decorate([
259
275
  __param(0, inject("LogHandlerInterface")),
260
276
  __param(2, inject("AuthorizerManagerInterface")),
261
277
  __param(3, inject("AuthenticationManagerInterface")),
262
- __param(4, inject("TracingManagerInterface")),
263
- __metadata("design:paramtypes", [Object, ControllerMethodParameterDecoratorResolver, Object, Object, Object])
278
+ __metadata("design:paramtypes", [Object, ControllerMethodParameterDecoratorResolver, Object, Object])
264
279
  ], Router);
265
280
  export { Router };
266
281
  //# sourceMappingURL=router.js.map
@@ -1 +1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EAAE,EAAC,CAAC,EAAC,EAAE,uBAAuB,CAAC,CAAC;wBAC3M,MAAM,CAAC,CAAC;qBACX;iBACJ;aACJ;YAED,OAAO,eAAe,CAAC;QAC3B,CAAC;KAAA;CACJ,CAAA;AA/QY,MAAM;IADlB,SAAS,EAAE;IAYa,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,MAAM,CAAC,4BAA4B,CAAC,CAAA;IACpC,WAAA,MAAM,CAAC,gCAAgC,CAAC,CAAA;6CAFoB,0CAA0C;GAZlH,MAAM,CA+QlB;SA/QY,MAAM"}
@@ -1 +1,4 @@
1
+ /**
2
+ * The body decorator can be used to inject the body of a request in a parameter of a method in a controller.
3
+ */
1
4
  export declare const body: () => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1,2 +1,6 @@
1
1
  export declare const controllerRegistry: any[];
2
+ /**
3
+ * The controller decorator can be used on a class to register this class as a controller in the router.
4
+ * @param basePath The base path for all the routes in the controller.
5
+ */
2
6
  export declare const controller: (basePath: string) => (constructor: Function) => void;
@@ -1,7 +1,7 @@
1
1
  export * from "./body.decorator";
2
2
  export * from "./controller.decorator";
3
- export * from "./identity.decorator";
4
3
  export * from "./headers.decorator";
4
+ export * from "./identity.decorator";
5
5
  export * from "./query-parameter.decorator";
6
6
  export * from "./query-parameters.decorator";
7
7
  export * from "./request.decorator";
@@ -1 +1,4 @@
1
+ /**
2
+ * The headers decorator can be used to inject the headers of a request in a parameter of a method in a controller.
3
+ */
1
4
  export declare const headers: () => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1 +1,4 @@
1
+ /**
2
+ * The identity decorator can be used to inject the identity making the request in a parameter of a method in a controller.
3
+ */
1
4
  export declare const identity: () => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1 +1,5 @@
1
+ /**
2
+ * The queryParameter decorator can be used to inject a specific query parameter of a request in a parameter of a method in a controller.
3
+ * @param name The name of the query parameter to inject.
4
+ */
1
5
  export declare const queryParameter: (name: string) => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1 +1,4 @@
1
+ /**
2
+ * The queryParameters decorator can be used to inject all the query parameters of a request in a parameter of a method in a controller.
3
+ */
1
4
  export declare const queryParameters: () => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1 +1,4 @@
1
+ /**
2
+ * The request decorator can be used to inject the whole request in a parameter of a method in a controller.
3
+ */
1
4
  export declare const request: () => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1 +1,8 @@
1
+ /**
2
+ * The responseHeader decorator can be used to specify a header that needs to be added to the response before sending it back.
3
+ * This decorator can be used with either method (route) or a class (controller).
4
+ * If used on the class than it will be applied to every route of the controller.
5
+ * @param key The key of the header
6
+ * @param value The value to set the header to.
7
+ */
1
8
  export declare const responseHeader: (key: string, value: string) => (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void;
@@ -1 +1,5 @@
1
+ /**
2
+ * The routeParameter decorator can be used to inject a specific route parameter of a request in a parameter of a method in a controller.
3
+ * @param name The name of the route(path) parameter to inject.
4
+ */
1
5
  export declare const routeParameter: (name: string) => (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1,2 +1,7 @@
1
1
  import { HttpMethod } from "@pristine-ts/common";
2
- export declare const route: (httpMethod: HttpMethod | string, path: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
2
+ /**
3
+ * The route decorator can be used on a method to register this method as a route of the controller in the router.
4
+ * @param httpMethod The http method of the route
5
+ * @param path The part of the path following the base path of the controller. For path parameters use the colons. (ie: resources/:id)
6
+ */
7
+ export declare const route: (httpMethod: HttpMethod | string, path: string) => (target: Object, propertyKey: string, descriptor: PropertyDescriptor) => void;
@@ -2,6 +2,10 @@ import { Response } from "../models/response";
2
2
  import { Request } from "../models/request";
3
3
  import { RouterResponseEnricherInterface } from "../interfaces/router-response-enricher.interface";
4
4
  import { MethodRouterNode } from "../nodes/method-router.node";
5
+ /**
6
+ * The RouterResponseEnricher enriches the response of the router by adding the response headers specified by the response header decorator.
7
+ * It is tagged as an RouterResponseEnricher so it can be automatically injected with the all the other RouterResponseEnrichers.
8
+ */
5
9
  export declare class RouterResponseEnricher implements RouterResponseEnricherInterface {
6
10
  enrichResponse(response: Response, request: Request, methodNode: MethodRouterNode): Promise<Response>;
7
11
  }
@@ -2,5 +2,7 @@ export * from "./bad-request.http-error";
2
2
  export * from "./forbidden.http-error";
3
3
  export * from "./http.error";
4
4
  export * from "./invalid-body.http-error";
5
- export * from "./path-router-instantiation.error";
5
+ export * from "./method-router-adding.error";
6
6
  export * from "./not-found.http-error";
7
+ export * from "./path-router-adding.error";
8
+ export * from "./path-router-instantiation.error";
@@ -1,8 +1,8 @@
1
+ import { LoggableError } from "@pristine-ts/common";
1
2
  /**
2
3
  * This class defines a basic HttpError. In your code, feel free to throw an HttpError to have this error returned via HTTP.
3
4
  * If you throw this error when handling an Event, it won't be returned.
4
5
  */
5
- import { LoggableError } from "@pristine-ts/common";
6
6
  export declare class HttpError extends LoggableError {
7
7
  readonly httpStatus: number;
8
8
  readonly message: string;
@@ -0,0 +1,10 @@
1
+ import { HttpMethod, LoggableError } from "@pristine-ts/common";
2
+ import { Route } from "../models/route";
3
+ import { MethodRouterNode } from "../nodes/method-router.node";
4
+ /**
5
+ * This Error is thrown when there's an error that happens when the networking is being initialized.
6
+ * It is thrown when trying to add a child node to a MethodRouterNode, since a MethodRouterNode is a leaf it cannot have any children.
7
+ */
8
+ export declare class MethodRouterAddingError extends LoggableError {
9
+ constructor(message: string, splitPaths: string[], method: HttpMethod | string, route: Route, methodRouterNode: MethodRouterNode);
10
+ }
@@ -1,9 +1,10 @@
1
- /**
2
- * This Error is thrown when there's an error that happens when the networking is being initialized
3
- */
4
1
  import { HttpMethod, LoggableError } from "@pristine-ts/common";
5
2
  import { PathRouterNode } from "../nodes/path-router.node";
6
3
  import { Route } from "../models/route";
4
+ /**
5
+ * This Error is thrown when there's an error that happens when the networking is being initialized.
6
+ * It is thrown when an error occurs when trying to add a child node to a PathRouterNode.
7
+ */
7
8
  export declare class PathRouterAddingError extends LoggableError {
8
9
  constructor(message: string, splitPaths: string[], method: HttpMethod | string, route: Route, pathRouterNode: PathRouterNode);
9
10
  }
@@ -1,8 +1,9 @@
1
- /**
2
- * This Error is thrown when there's an error that happens when the networking is being initialized
3
- */
4
1
  import { LoggableError } from "@pristine-ts/common";
5
2
  import { PathRouterNode } from "../nodes/path-router.node";
3
+ /**
4
+ * This Error is thrown when there's an error that happens when the networking is being initialized.
5
+ * It is thrown when an error occurs when trying to instantiate a PathRouterNode.
6
+ */
6
7
  export declare class PathRouterInstantiationError extends LoggableError {
7
8
  constructor(message: string, path: string, parent?: PathRouterNode);
8
9
  }
@@ -1,8 +1,25 @@
1
1
  import { Request } from "../models/request";
2
2
  import { IdentityInterface } from "@pristine-ts/common";
3
+ import { ParameterDecoratorInterface } from "./parameter-decorator.interface";
4
+ /**
5
+ * This interface defines the methods that a decorator resolver for method parameter in a controller must implement.
6
+ */
3
7
  export interface ControllerMethodParameterDecoratorResolverInterface {
4
- supports(methodArgument: any): boolean;
5
- resolve(methodArgument: any, request: Request, routeParameters: {
8
+ /**
9
+ * Returns whether or not the resolver support such a method argument.
10
+ * Usually we will check the methodArgument.type field to determine if it is a supported type.
11
+ * @param methodArgument
12
+ */
13
+ supports(methodArgument: ParameterDecoratorInterface): boolean;
14
+ /**
15
+ * Resolves the value for the decorator.
16
+ * The router than injects that value into the parameter of the controller method.
17
+ * @param methodArgument The information on where to retrieve the value.
18
+ * @param request The request itself.
19
+ * @param routeParameters The parameters and their values in the route of the controller.
20
+ * @param identity The identity making the request
21
+ */
22
+ resolve(methodArgument: ParameterDecoratorInterface, request: Request, routeParameters: {
6
23
  [key: string]: string;
7
24
  }, identity?: IdentityInterface): Promise<any>;
8
25
  }
@@ -6,8 +6,8 @@ export * from "./parameter-decorator.interface";
6
6
  export * from "./query-parameter-decorator.interface";
7
7
  export * from "./query-parameters-decorator.interface";
8
8
  export * from "./request-parameter-decorator.interface";
9
- export * from "./router-request-enricher.interface";
10
- export * from "./router-response-enricher.interface";
11
9
  export * from "./route-method-decorator.interface";
12
10
  export * from "./route-parameter-decorator.interface";
13
11
  export * from "./router.interface";
12
+ export * from "./router-request-enricher.interface";
13
+ export * from "./router-response-enricher.interface";
@@ -1,3 +1,7 @@
1
+ /**
2
+ * This interface represents the object that will contain the information for all decorator types.
3
+ * It's the base interface that all other decorator interfaces will extend.
4
+ */
1
5
  export interface ParameterDecoratorInterface {
2
6
  type: string;
3
7
  }
@@ -1,4 +1,8 @@
1
1
  import { ParameterDecoratorInterface } from "./parameter-decorator.interface";
2
+ /**
3
+ * This interface represents the object that will contain the information required to know how to handle the
4
+ * @queryParameters decorator.
5
+ */
2
6
  export interface QueryParametersDecoratorInterface extends ParameterDecoratorInterface {
3
7
  type: "queryParameters";
4
8
  }
@@ -1,7 +1,7 @@
1
1
  import { ParameterDecoratorInterface } from "./parameter-decorator.interface";
2
2
  /**
3
3
  * This interface represents the object that will contain the information to know how to handle the
4
- * @body decorator.
4
+ * @routeParameter decorator.
5
5
  */
6
6
  export interface RouteParameterDecoratorInterface extends ParameterDecoratorInterface {
7
7
  type: "routeParameter";
@@ -4,7 +4,7 @@ import { Response } from "../models/response";
4
4
  import { Request } from "../models/request";
5
5
  import { Route } from "../models/route";
6
6
  /**
7
- * This method defines the interface that the router must implement.
7
+ * This interface defines the methods that the router must implement.
8
8
  */
9
9
  export interface RouterInterface {
10
10
  /**
@@ -18,7 +18,7 @@ export interface RouterInterface {
18
18
  register(path: string, method: HttpMethod | string, route: Route): any;
19
19
  /**
20
20
  * This method executes the request passed as a parameter. A container must also be passed since we want each
21
- * request to have its own container so that memory isn't accidently shared between requests.
21
+ * request to have its own container so that memory isn't accidentally shared between requests.
22
22
  *
23
23
  * @param request
24
24
  * @param container
@@ -1,4 +1,3 @@
1
- export * from "./error-response-body";
2
1
  export * from "./request";
3
2
  export * from "./response";
4
3
  export * from "./route";