@ddd-ts-kit/http 0.90.0 → 0.92.0

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 (237) hide show
  1. package/README.fr.md +231 -2
  2. package/README.md +225 -1
  3. package/dist/controller/controller-request.d.ts +10 -1
  4. package/dist/controller/controller-request.d.ts.map +1 -1
  5. package/dist/controller/controller-response.d.ts +6 -0
  6. package/dist/controller/controller-response.d.ts.map +1 -1
  7. package/dist/controller/controller-result.d.ts +22 -4
  8. package/dist/controller/controller-result.d.ts.map +1 -1
  9. package/dist/controller/controller-routes.d.ts.map +1 -1
  10. package/dist/controller/controller-routes.js +29 -4
  11. package/dist/controller/controller-routes.js.map +1 -1
  12. package/dist/controller/controller-spec.d.ts +7 -0
  13. package/dist/controller/controller-spec.d.ts.map +1 -1
  14. package/dist/controller/declared-route.d.ts.map +1 -1
  15. package/dist/controller/declared-route.js +10 -0
  16. package/dist/controller/declared-route.js.map +1 -1
  17. package/dist/controller/http-controller.d.ts +4 -5
  18. package/dist/controller/http-controller.d.ts.map +1 -1
  19. package/dist/controller/http-request.d.ts +10 -1
  20. package/dist/controller/http-request.d.ts.map +1 -1
  21. package/dist/error/refusal-codes-by-status.d.ts +11 -0
  22. package/dist/error/refusal-codes-by-status.d.ts.map +1 -0
  23. package/dist/error/refusal-codes-by-status.js +48 -0
  24. package/dist/error/refusal-codes-by-status.js.map +1 -0
  25. package/dist/express/mount-express.d.ts +2 -1
  26. package/dist/express/mount-express.d.ts.map +1 -1
  27. package/dist/express/mount-express.js +12 -2
  28. package/dist/express/mount-express.js.map +1 -1
  29. package/dist/nest/controllers/arguments-of.d.ts +7 -0
  30. package/dist/nest/controllers/arguments-of.d.ts.map +1 -0
  31. package/dist/nest/controllers/arguments-of.js +26 -0
  32. package/dist/nest/controllers/arguments-of.js.map +1 -0
  33. package/dist/nest/controllers/assert-not-routed-by-nest.d.ts +8 -0
  34. package/dist/nest/controllers/assert-not-routed-by-nest.d.ts.map +1 -0
  35. package/dist/nest/controllers/assert-not-routed-by-nest.js +19 -0
  36. package/dist/nest/controllers/assert-not-routed-by-nest.js.map +1 -0
  37. package/dist/nest/controllers/controllers-binder.d.ts +6 -0
  38. package/dist/nest/controllers/controllers-binder.d.ts.map +1 -0
  39. package/dist/nest/controllers/controllers-binder.js +5 -0
  40. package/dist/nest/controllers/controllers-binder.js.map +1 -0
  41. package/dist/nest/controllers/controllers-module-options.d.ts +8 -0
  42. package/dist/nest/controllers/controllers-module-options.d.ts.map +1 -0
  43. package/dist/nest/controllers/controllers-module-options.js +2 -0
  44. package/dist/nest/controllers/controllers-module-options.js.map +1 -0
  45. package/dist/nest/controllers/create-controllers-module.d.ts +10 -0
  46. package/dist/nest/controllers/create-controllers-module.d.ts.map +1 -0
  47. package/dist/nest/controllers/create-controllers-module.js +28 -0
  48. package/dist/nest/controllers/create-controllers-module.js.map +1 -0
  49. package/dist/nest/controllers/current-actor.d.ts +6 -0
  50. package/dist/nest/controllers/current-actor.d.ts.map +1 -0
  51. package/dist/nest/controllers/current-actor.js +9 -0
  52. package/dist/nest/controllers/current-actor.js.map +1 -0
  53. package/dist/nest/controllers/dto-type.d.ts +3 -0
  54. package/dist/nest/controllers/dto-type.d.ts.map +1 -0
  55. package/dist/nest/controllers/dto-type.js +2 -0
  56. package/dist/nest/controllers/dto-type.js.map +1 -0
  57. package/dist/nest/controllers/injected-parameter.d.ts +4 -0
  58. package/dist/nest/controllers/injected-parameter.d.ts.map +1 -0
  59. package/dist/nest/controllers/injected-parameter.js +17 -0
  60. package/dist/nest/controllers/injected-parameter.js.map +1 -0
  61. package/dist/nest/controllers/is-nest-controller.d.ts +4 -0
  62. package/dist/nest/controllers/is-nest-controller.d.ts.map +1 -0
  63. package/dist/nest/controllers/is-nest-controller.js +7 -0
  64. package/dist/nest/controllers/is-nest-controller.js.map +1 -0
  65. package/dist/nest/controllers/keyed-schema.d.ts +8 -0
  66. package/dist/nest/controllers/keyed-schema.d.ts.map +1 -0
  67. package/dist/nest/controllers/keyed-schema.js +33 -0
  68. package/dist/nest/controllers/keyed-schema.js.map +1 -0
  69. package/dist/nest/controllers/kit-route-spec.d.ts +71 -0
  70. package/dist/nest/controllers/kit-route-spec.d.ts.map +1 -0
  71. package/dist/nest/controllers/kit-route-spec.js +2 -0
  72. package/dist/nest/controllers/kit-route-spec.js.map +1 -0
  73. package/dist/nest/controllers/kit-route.d.ts +18 -0
  74. package/dist/nest/controllers/kit-route.d.ts.map +1 -0
  75. package/dist/nest/controllers/kit-route.js +29 -0
  76. package/dist/nest/controllers/kit-route.js.map +1 -0
  77. package/dist/nest/controllers/kit-routes-options.d.ts +15 -0
  78. package/dist/nest/controllers/kit-routes-options.d.ts.map +1 -0
  79. package/dist/nest/controllers/kit-routes-options.js +2 -0
  80. package/dist/nest/controllers/kit-routes-options.js.map +1 -0
  81. package/dist/nest/controllers/kit-routes.d.ts +5 -0
  82. package/dist/nest/controllers/kit-routes.d.ts.map +1 -0
  83. package/dist/nest/controllers/kit-routes.js +8 -0
  84. package/dist/nest/controllers/kit-routes.js.map +1 -0
  85. package/dist/nest/controllers/nest-controller-class.d.ts +3 -0
  86. package/dist/nest/controllers/nest-controller-class.d.ts.map +1 -0
  87. package/dist/nest/controllers/nest-controller-class.js +2 -0
  88. package/dist/nest/controllers/nest-controller-class.js.map +1 -0
  89. package/dist/nest/controllers/nest-controller-route.d.ts +6 -0
  90. package/dist/nest/controllers/nest-controller-route.d.ts.map +1 -0
  91. package/dist/nest/controllers/nest-controller-route.js +12 -0
  92. package/dist/nest/controllers/nest-controller-route.js.map +1 -0
  93. package/dist/nest/controllers/nest-controller-routes-options.d.ts +14 -0
  94. package/dist/nest/controllers/nest-controller-routes-options.d.ts.map +1 -0
  95. package/dist/nest/controllers/nest-controller-routes-options.js +2 -0
  96. package/dist/nest/controllers/nest-controller-routes-options.js.map +1 -0
  97. package/dist/nest/controllers/nest-controller-routes.d.ts +12 -0
  98. package/dist/nest/controllers/nest-controller-routes.d.ts.map +1 -0
  99. package/dist/nest/controllers/nest-controller-routes.js +159 -0
  100. package/dist/nest/controllers/nest-controller-routes.js.map +1 -0
  101. package/dist/nest/controllers/nest-controllers-options.d.ts +7 -0
  102. package/dist/nest/controllers/nest-controllers-options.d.ts.map +1 -0
  103. package/dist/nest/controllers/nest-controllers-options.js +2 -0
  104. package/dist/nest/controllers/nest-controllers-options.js.map +1 -0
  105. package/dist/nest/controllers/nest-controllers.d.ts +21 -0
  106. package/dist/nest/controllers/nest-controllers.d.ts.map +1 -0
  107. package/dist/nest/controllers/nest-controllers.js +31 -0
  108. package/dist/nest/controllers/nest-controllers.js.map +1 -0
  109. package/dist/nest/controllers/nest-method.d.ts +20 -0
  110. package/dist/nest/controllers/nest-method.d.ts.map +1 -0
  111. package/dist/nest/controllers/nest-method.js +2 -0
  112. package/dist/nest/controllers/nest-method.js.map +1 -0
  113. package/dist/nest/controllers/nest-parameter.d.ts +10 -0
  114. package/dist/nest/controllers/nest-parameter.d.ts.map +1 -0
  115. package/dist/nest/controllers/nest-parameter.js +2 -0
  116. package/dist/nest/controllers/nest-parameter.js.map +1 -0
  117. package/dist/nest/controllers/nest-route-metadata.d.ts +22 -0
  118. package/dist/nest/controllers/nest-route-metadata.d.ts.map +1 -0
  119. package/dist/nest/controllers/nest-route-metadata.js +121 -0
  120. package/dist/nest/controllers/nest-route-metadata.js.map +1 -0
  121. package/dist/nest/controllers/nest-route-methods.d.ts +4 -0
  122. package/dist/nest/controllers/nest-route-methods.d.ts.map +1 -0
  123. package/dist/nest/controllers/nest-route-methods.js +12 -0
  124. package/dist/nest/controllers/nest-route-methods.js.map +1 -0
  125. package/dist/nest/controllers/nest-routes-registry.d.ts +17 -0
  126. package/dist/nest/controllers/nest-routes-registry.d.ts.map +1 -0
  127. package/dist/nest/controllers/nest-routes-registry.js +23 -0
  128. package/dist/nest/controllers/nest-routes-registry.js.map +1 -0
  129. package/dist/nest/controllers/nest-signature.d.ts +15 -0
  130. package/dist/nest/controllers/nest-signature.d.ts.map +1 -0
  131. package/dist/nest/controllers/nest-signature.js +2 -0
  132. package/dist/nest/controllers/nest-signature.js.map +1 -0
  133. package/dist/nest/controllers/prototype-of.d.ts +4 -0
  134. package/dist/nest/controllers/prototype-of.d.ts.map +1 -0
  135. package/dist/nest/controllers/prototype-of.js +10 -0
  136. package/dist/nest/controllers/prototype-of.js.map +1 -0
  137. package/dist/nest/controllers/provide-controllers.d.ts +12 -0
  138. package/dist/nest/controllers/provide-controllers.d.ts.map +1 -0
  139. package/dist/nest/controllers/provide-controllers.js +33 -0
  140. package/dist/nest/controllers/provide-controllers.js.map +1 -0
  141. package/dist/nest/controllers/reflected-metadata.d.ts +3 -0
  142. package/dist/nest/controllers/reflected-metadata.d.ts.map +1 -0
  143. package/dist/nest/controllers/reflected-metadata.js +11 -0
  144. package/dist/nest/controllers/reflected-metadata.js.map +1 -0
  145. package/dist/nest/controllers/request-schemas-of.d.ts +14 -0
  146. package/dist/nest/controllers/request-schemas-of.d.ts.map +1 -0
  147. package/dist/nest/controllers/request-schemas-of.js +50 -0
  148. package/dist/nest/controllers/request-schemas-of.js.map +1 -0
  149. package/dist/nest/controllers/route-context.d.ts +3 -0
  150. package/dist/nest/controllers/route-context.d.ts.map +1 -0
  151. package/dist/nest/controllers/route-context.js +6 -0
  152. package/dist/nest/controllers/route-context.js.map +1 -0
  153. package/dist/nest/controllers/schema-of.d.ts +6 -0
  154. package/dist/nest/controllers/schema-of.d.ts.map +1 -0
  155. package/dist/nest/controllers/schema-of.js +12 -0
  156. package/dist/nest/controllers/schema-of.js.map +1 -0
  157. package/dist/nest/controllers/summary-of.d.ts +3 -0
  158. package/dist/nest/controllers/summary-of.d.ts.map +1 -0
  159. package/dist/nest/controllers/summary-of.js +6 -0
  160. package/dist/nest/controllers/summary-of.js.map +1 -0
  161. package/dist/nest/controllers/upload.d.ts +6 -0
  162. package/dist/nest/controllers/upload.d.ts.map +1 -0
  163. package/dist/nest/controllers/upload.js +9 -0
  164. package/dist/nest/controllers/upload.js.map +1 -0
  165. package/dist/nest/controllers/with-signatures.d.ts +10 -0
  166. package/dist/nest/controllers/with-signatures.d.ts.map +1 -0
  167. package/dist/nest/controllers/with-signatures.js +12 -0
  168. package/dist/nest/controllers/with-signatures.js.map +1 -0
  169. package/dist/nest.d.ts +20 -0
  170. package/dist/nest.d.ts.map +1 -1
  171. package/dist/nest.js +12 -0
  172. package/dist/nest.js.map +1 -1
  173. package/dist/openapi/request-body.d.ts.map +1 -1
  174. package/dist/openapi/request-body.js +11 -0
  175. package/dist/openapi/request-body.js.map +1 -1
  176. package/dist/openapi/responses.d.ts.map +1 -1
  177. package/dist/openapi/responses.js +12 -42
  178. package/dist/openapi/responses.js.map +1 -1
  179. package/dist/orpc/orpc-protocol.d.ts +7 -0
  180. package/dist/orpc/orpc-protocol.d.ts.map +1 -0
  181. package/dist/orpc/orpc-protocol.js +13 -0
  182. package/dist/orpc/orpc-protocol.js.map +1 -0
  183. package/dist/orpc/orpc-router.d.ts +22 -0
  184. package/dist/orpc/orpc-router.d.ts.map +1 -0
  185. package/dist/orpc/orpc-router.js +43 -0
  186. package/dist/orpc/orpc-router.js.map +1 -0
  187. package/dist/orpc.d.ts +4 -0
  188. package/dist/orpc.d.ts.map +1 -0
  189. package/dist/orpc.js +2 -0
  190. package/dist/orpc.js.map +1 -0
  191. package/dist/pipeline/primed.d.ts +2 -1
  192. package/dist/pipeline/primed.d.ts.map +1 -1
  193. package/dist/pipeline/primed.js +14 -11
  194. package/dist/pipeline/primed.js.map +1 -1
  195. package/dist/route/response-spec.d.ts +2 -0
  196. package/dist/route/response-spec.d.ts.map +1 -1
  197. package/dist/rpc/rpc-answer.d.ts +18 -0
  198. package/dist/rpc/rpc-answer.d.ts.map +1 -0
  199. package/dist/rpc/rpc-answer.js +61 -0
  200. package/dist/rpc/rpc-answer.js.map +1 -0
  201. package/dist/rpc/rpc-context.d.ts +15 -0
  202. package/dist/rpc/rpc-context.d.ts.map +1 -0
  203. package/dist/rpc/rpc-context.js +2 -0
  204. package/dist/rpc/rpc-context.js.map +1 -0
  205. package/dist/rpc/rpc-input.d.ts +11 -0
  206. package/dist/rpc/rpc-input.d.ts.map +1 -0
  207. package/dist/rpc/rpc-input.js +2 -0
  208. package/dist/rpc/rpc-input.js.map +1 -0
  209. package/dist/rpc/rpc-refusal.d.ts +14 -0
  210. package/dist/rpc/rpc-refusal.d.ts.map +1 -0
  211. package/dist/rpc/rpc-refusal.js +2 -0
  212. package/dist/rpc/rpc-refusal.js.map +1 -0
  213. package/dist/rpc/rpc-request.d.ts +9 -0
  214. package/dist/rpc/rpc-request.d.ts.map +1 -0
  215. package/dist/rpc/rpc-request.js +28 -0
  216. package/dist/rpc/rpc-request.js.map +1 -0
  217. package/dist/trpc/route-refusal.d.ts +8 -0
  218. package/dist/trpc/route-refusal.d.ts.map +1 -0
  219. package/dist/trpc/route-refusal.js +10 -0
  220. package/dist/trpc/route-refusal.js.map +1 -0
  221. package/dist/trpc/trpc-error-shape.d.ts +17 -0
  222. package/dist/trpc/trpc-error-shape.d.ts.map +1 -0
  223. package/dist/trpc/trpc-error-shape.js +2 -0
  224. package/dist/trpc/trpc-error-shape.js.map +1 -0
  225. package/dist/trpc/trpc-protocol.d.ts +8 -0
  226. package/dist/trpc/trpc-protocol.d.ts.map +1 -0
  227. package/dist/trpc/trpc-protocol.js +43 -0
  228. package/dist/trpc/trpc-protocol.js.map +1 -0
  229. package/dist/trpc/trpc-router.d.ts +38 -0
  230. package/dist/trpc/trpc-router.d.ts.map +1 -0
  231. package/dist/trpc/trpc-router.js +44 -0
  232. package/dist/trpc/trpc-router.js.map +1 -0
  233. package/dist/trpc.d.ts +5 -0
  234. package/dist/trpc.d.ts.map +1 -0
  235. package/dist/trpc.js +2 -0
  236. package/dist/trpc.js.map +1 -0
  237. package/package.json +30 -7
@@ -0,0 +1,3 @@
1
+ /** A class whose decorators describe a shape, as class-validator reads it: built without arguments. */
2
+ export type DtoType = new () => object;
3
+ //# sourceMappingURL=dto-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto-type.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/dto-type.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,MAAM,OAAO,GAAG,UAAU,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dto-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto-type.js","sourceRoot":"","sources":["../../../src/nest/controllers/dto-type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { type Injected } from './nest-routes-registry.js';
2
+ /** A parameter decorator of the kit: what it hands the parameter at that index of the method. */
3
+ export declare function injectedParameter(what: Injected): (target: object, method: string | symbol | undefined, index: number) => void;
4
+ //# sourceMappingURL=injected-parameter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injected-parameter.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/injected-parameter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAsB,MAAM,wBAAwB,CAAC;AAE3E,iGAAiG;AACjG,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,GACb,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAc9E"}
@@ -0,0 +1,17 @@
1
+ import { DeclarationError } from '@ddd-ts-kit/kernel/declarations';
2
+ import { nestRoutesRegistry } from './nest-routes-registry.js';
3
+ /** A parameter decorator of the kit: what it hands the parameter at that index of the method. */
4
+ export function injectedParameter(what) {
5
+ return (target, method, index) => {
6
+ if (typeof method !== 'string') {
7
+ throw new DeclarationError('A parameter decorator of the kit goes on a parameter of a method of a controller.');
8
+ }
9
+ const { injected } = nestRoutesRegistry();
10
+ const methods = injected.get(target) ?? new Map();
11
+ const parameters = methods.get(method) ?? new Map();
12
+ parameters.set(index, what);
13
+ methods.set(method, parameters);
14
+ injected.set(target, methods);
15
+ };
16
+ }
17
+ //# sourceMappingURL=injected-parameter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injected-parameter.js","sourceRoot":"","sources":["../../../src/nest/controllers/injected-parameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,iGAAiG;AACjG,MAAM,UAAU,iBAAiB,CAC/B,IAAc;IAEd,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;QAC/B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,gBAAgB,CAAC,mFAAmF,CAAC,CAAC;QAClH,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAiC,CAAC;QACjF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAoB,CAAC;QAEtE,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAChC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { NestControllerClass } from './nest-controller-class.js';
2
+ /** Whether Nest's `@Controller` was written on the class. */
3
+ export declare function isNestController(controller: NestControllerClass): boolean;
4
+ //# sourceMappingURL=is-nest-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-nest-controller.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/is-nest-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAEzE"}
@@ -0,0 +1,7 @@
1
+ import { PATH_METADATA } from '@nestjs/common/constants';
2
+ import { reflectedMetadata } from './reflected-metadata.js';
3
+ /** Whether Nest's `@Controller` was written on the class. */
4
+ export function isNestController(controller) {
5
+ return reflectedMetadata(PATH_METADATA, controller) !== undefined;
6
+ }
7
+ //# sourceMappingURL=is-nest-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-nest-controller.js","sourceRoot":"","sources":["../../../src/nest/controllers/is-nest-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,6DAA6D;AAC7D,MAAM,UAAU,gBAAgB,CAAC,UAA+B;IAC9D,OAAO,iBAAiB,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,SAAS,CAAC;AACpE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Schema } from '@ddd-ts-kit/validation';
2
+ /**
3
+ * The schema of the parts a method names one by one (`@Param('invoiceId')`): each is a text, the
4
+ * parameters of the path required, the query and the headers optional. Headers are read in lower
5
+ * case, as Node gives them.
6
+ */
7
+ export declare function keyedSchema(keys: readonly string[], required: boolean): Schema<Record<string, string>>;
8
+ //# sourceMappingURL=keyed-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyed-schema.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/keyed-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAmB,MAAM,wBAAwB,CAAC;AAGtE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA2BtG"}
@@ -0,0 +1,33 @@
1
+ import { err, ok } from '@ddd-ts-kit/kernel';
2
+ import { isRecord } from '../../support/is-record.js';
3
+ /**
4
+ * The schema of the parts a method names one by one (`@Param('invoiceId')`): each is a text, the
5
+ * parameters of the path required, the query and the headers optional. Headers are read in lower
6
+ * case, as Node gives them.
7
+ */
8
+ export function keyedSchema(keys, required) {
9
+ const names = [...new Set(keys)];
10
+ return {
11
+ parse(input) {
12
+ const parts = isRecord(input) ? input : {};
13
+ const issues = [];
14
+ const read = {};
15
+ for (const name of names) {
16
+ const value = parts[name];
17
+ if (typeof value === 'string' && value !== '') {
18
+ read[name] = value;
19
+ }
20
+ else if (value !== undefined || required) {
21
+ issues.push({ path: name, code: 'isString', message: `${name} is a required text.` });
22
+ }
23
+ }
24
+ return issues.length === 0 ? ok(read) : err(issues);
25
+ },
26
+ toJsonSchema: () => ({
27
+ type: 'object',
28
+ properties: Object.fromEntries(names.map((name) => [name, { type: 'string' }])),
29
+ ...(required ? { required: names } : {}),
30
+ }),
31
+ };
32
+ }
33
+ //# sourceMappingURL=keyed-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyed-schema.js","sourceRoot":"","sources":["../../../src/nest/controllers/keyed-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAuB,EAAE,QAAiB;IACpE,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjC,OAAO;QACL,KAAK,CAAC,KAAK;YACT,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,MAAM,MAAM,GAAsB,EAAE,CAAC;YACrC,MAAM,IAAI,GAA2B,EAAE,CAAC;YAExC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;gBAE1B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBAC9C,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;gBACrB,CAAC;qBAAM,IAAI,KAAK,KAAK,SAAS,IAAI,QAAQ,EAAE,CAAC;oBAC3C,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,sBAAsB,EAAE,CAAC,CAAC;gBACxF,CAAC;YACH,CAAC;YAED,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC;QACD,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC/E,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { Schema } from '@ddd-ts-kit/validation';
2
+ import type { CachePolicy } from '../../cache/cache-policy.js';
3
+ import type { IfMatch } from '../../cache/if-match.js';
4
+ import type { GuardReference } from '../../controller/guard-reference.js';
5
+ import type { FormHints } from '../../forms/form-hints.js';
6
+ import type { UploadSpec } from '../../route/upload-spec.js';
7
+ import type { DtoType } from './dto-type.js';
8
+ /**
9
+ * What a route says besides what Nest's decorators say (its method, its path, its parameters, its
10
+ * status): who may call it, the refusals it answers, its answer, its name in the contract. Every
11
+ * member is optional, and so is `@KitRoute` itself: a method that carries a route decorator of Nest
12
+ * is a route of the kit, named after the method.
13
+ */
14
+ export interface KitRouteSpec {
15
+ /**
16
+ * Names the route in the contract, the function of the generated client and the procedure over
17
+ * /rpc and /trpc. Left out, the name of the method: `issueInvoice`.
18
+ */
19
+ readonly operationId?: string;
20
+ /** Left out, the name of the method as a sentence: `Issue invoice`. */
21
+ readonly summary?: string;
22
+ readonly description?: string;
23
+ /** Added to those of @KitRoutes. */
24
+ readonly tags?: readonly string[];
25
+ /** Run after those of @KitRoutes. With none on either, the route is refused: `[Public]` says it is open. */
26
+ readonly guards?: readonly GuardReference[];
27
+ /** Domain error codes the route may answer, added to those of @KitRoutes and of its guards. */
28
+ readonly errors?: readonly string[];
29
+ /** Left out: the status of @HttpCode, else Nest's (201 for POST, 200 otherwise), and no body. */
30
+ readonly response?: {
31
+ readonly status?: number;
32
+ readonly description?: string;
33
+ /** A schema, or a DTO class read through the `schemaOfClass` of the module. */
34
+ readonly body?: Schema<unknown> | DtoType;
35
+ /**
36
+ * The headers the answer carries, each with what it holds. The method then returns
37
+ * `{ body, headers }` (`{ headers }` with no body), and `body` is declared here: its return type
38
+ * is not read for the body.
39
+ */
40
+ readonly headers?: Readonly<Record<string, string>>;
41
+ };
42
+ /** Schemas that replace what the types of the parameters give: for a project that does not write DTO classes. */
43
+ readonly request?: {
44
+ readonly params?: Schema<unknown>;
45
+ readonly query?: Schema<unknown>;
46
+ readonly headers?: Schema<unknown>;
47
+ readonly body?: Schema<unknown>;
48
+ };
49
+ /**
50
+ * A file received as `multipart/form-data`, its field, size and media types stated here and in
51
+ * the contract; `@Upload()` hands it to the method, and `@Body()` takes the text fields.
52
+ */
53
+ readonly upload?: UploadSpec;
54
+ /**
55
+ * The body is left as it arrives, unparsed and not validated: `@RouteContext()` gives the method
56
+ * `context.stream` (the bytes) and `context.rawHeaders`, to verify a signature made over them. The
57
+ * contract describes it as `application/octet-stream`. A Nest application must be created with
58
+ * `rawBody: true` to serve it a JSON body.
59
+ */
60
+ readonly rawBody?: boolean;
61
+ readonly deprecated?: boolean;
62
+ /** Media types answered besides `application/json`, chosen by `Accept`: `['application/xml', 'text/csv']`. */
63
+ readonly produces?: readonly string[];
64
+ /** Media types a body is read in besides `application/json`: `['application/xml']`. */
65
+ readonly consumes?: readonly string[];
66
+ /** Describes the body as a form at `GET /forms/<operationId>` (`formRoutes`): `defineForm(...)` beside the controller. */
67
+ readonly form?: FormHints;
68
+ readonly cache?: CachePolicy;
69
+ readonly ifMatch?: IfMatch;
70
+ }
71
+ //# sourceMappingURL=kit-route-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-route-spec.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/kit-route-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CA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MAAM,EAAE,CAAC;IACtC,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,0HAA0H;IAC1H,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=kit-route-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-route-spec.js","sourceRoot":"","sources":["../../../src/nest/controllers/kit-route-spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { KitRouteSpec } from './kit-route-spec.js';
2
+ /**
3
+ * Makes a method of a Nest controller a route of the kit, next to Nest's own decorators:
4
+ *
5
+ * @Controller('invoices')
6
+ * export class InvoicesController {
7
+ * constructor(private readonly commands: CommandBus) {}
8
+ *
9
+ * @Post(':invoiceId/issue')
10
+ * @KitRoute({ operationId: 'issueInvoice', summary: 'Issue an invoice', guards: [Authenticated], errors: ['INVOICE_ALREADY_ISSUED'] })
11
+ * issue(@Param('invoiceId') invoiceId: string, @Body() body: IssueInvoiceBody, @CurrentActor() actor: Actor) { ... }
12
+ * }
13
+ *
14
+ * The kit serves the route, not Nest's router: its guards, validation, error mapping, tracing and
15
+ * contract are those of every route of the kit (`createControllersModule`, `nestControllerRoutes`).
16
+ */
17
+ export declare function KitRoute(spec: KitRouteSpec): (target: object, method: string | symbol) => void;
18
+ //# sourceMappingURL=kit-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-route.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/kit-route.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAY9F"}
@@ -0,0 +1,29 @@
1
+ import { DeclarationError } from '@ddd-ts-kit/kernel/declarations';
2
+ import { nestRoutesRegistry } from './nest-routes-registry.js';
3
+ /**
4
+ * Makes a method of a Nest controller a route of the kit, next to Nest's own decorators:
5
+ *
6
+ * @Controller('invoices')
7
+ * export class InvoicesController {
8
+ * constructor(private readonly commands: CommandBus) {}
9
+ *
10
+ * @Post(':invoiceId/issue')
11
+ * @KitRoute({ operationId: 'issueInvoice', summary: 'Issue an invoice', guards: [Authenticated], errors: ['INVOICE_ALREADY_ISSUED'] })
12
+ * issue(@Param('invoiceId') invoiceId: string, @Body() body: IssueInvoiceBody, @CurrentActor() actor: Actor) { ... }
13
+ * }
14
+ *
15
+ * The kit serves the route, not Nest's router: its guards, validation, error mapping, tracing and
16
+ * contract are those of every route of the kit (`createControllersModule`, `nestControllerRoutes`).
17
+ */
18
+ export function KitRoute(spec) {
19
+ return (target, method) => {
20
+ if (typeof method !== 'string') {
21
+ throw new DeclarationError('@KitRoute goes on a method named by a string.');
22
+ }
23
+ const { routes } = nestRoutesRegistry();
24
+ const declared = routes.get(target) ?? new Map();
25
+ declared.set(method, spec);
26
+ routes.set(target, declared);
27
+ };
28
+ }
29
+ //# sourceMappingURL=kit-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-route.js","sourceRoot":"","sources":["../../../src/nest/controllers/kit-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAkB;IACzC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,gBAAgB,CAAC,+CAA+C,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAwB,CAAC;QAEvE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { GuardReference } from '../../controller/guard-reference.js';
2
+ import type { RouteGroupClass } from '../../controller/route-group-class.js';
3
+ /** What every route of a Nest controller shares, as a route group of the kit gives it. */
4
+ export interface KitRoutesOptions {
5
+ /**
6
+ * A route group of the kit (`@RouteGroup`): its prefix comes before the paths Nest declares, and
7
+ * its tags, guards and error codes before those written here.
8
+ */
9
+ readonly group?: RouteGroupClass;
10
+ /** Run before the guards of each route. */
11
+ readonly guards?: readonly GuardReference[];
12
+ readonly tags?: readonly string[];
13
+ readonly errors?: readonly string[];
14
+ }
15
+ //# sourceMappingURL=kit-routes-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-routes-options.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/kit-routes-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;IACjC,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=kit-routes-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-routes-options.js","sourceRoot":"","sources":["../../../src/nest/controllers/kit-routes-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { KitRoutesOptions } from './kit-routes-options.js';
2
+ import type { NestControllerClass } from './nest-controller-class.js';
3
+ /** What every route of a Nest controller shares: its guards first, its tags and its error codes. */
4
+ export declare function KitRoutes(options: KitRoutesOptions): (target: NestControllerClass) => void;
5
+ //# sourceMappingURL=kit-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-routes.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/kit-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,oGAAoG;AACpG,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAI1F"}
@@ -0,0 +1,8 @@
1
+ import { nestRoutesRegistry } from './nest-routes-registry.js';
2
+ /** What every route of a Nest controller shares: its guards first, its tags and its error codes. */
3
+ export function KitRoutes(options) {
4
+ return (target) => {
5
+ nestRoutesRegistry().controllers.set(target, options);
6
+ };
7
+ }
8
+ //# sourceMappingURL=kit-routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kit-routes.js","sourceRoot":"","sources":["../../../src/nest/controllers/kit-routes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,oGAAoG;AACpG,MAAM,UAAU,SAAS,CAAC,OAAyB;IACjD,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,kBAAkB,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** A class carrying Nest's `@Controller`, whose methods the kit serves as routes. */
2
+ export type NestControllerClass = abstract new (...args: never) => unknown;
3
+ //# sourceMappingURL=nest-controller-class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-class.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-class.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nest-controller-class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-class.js","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-class.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Route } from '../../route/route.js';
2
+ import type { NestControllerClass } from './nest-controller-class.js';
3
+ import type { NestControllerRoutesOptions } from './nest-controller-routes-options.js';
4
+ /** The one route of a Nest controller with a single method carrying `@KitRoute`: what its spec calls. */
5
+ export declare function nestControllerRoute(controller: NestControllerClass, options?: NestControllerRoutesOptions): Route;
6
+ //# sourceMappingURL=nest-controller-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-route.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-route.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAEpF,yGAAyG;AACzG,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,mBAAmB,EAAE,OAAO,GAAE,2BAAgC,GAAG,KAAK,CAWrH"}
@@ -0,0 +1,12 @@
1
+ import { DeclarationError } from '@ddd-ts-kit/kernel/declarations';
2
+ import { nestControllerRoutes } from './nest-controller-routes.js';
3
+ /** The one route of a Nest controller with a single method carrying `@KitRoute`: what its spec calls. */
4
+ export function nestControllerRoute(controller, options = {}) {
5
+ const routes = nestControllerRoutes([controller], options);
6
+ const [route] = routes;
7
+ if (route === undefined || routes.length > 1) {
8
+ throw new DeclarationError(`${controller.name} serves ${String(routes.length)} routes: nestControllerRoute takes a controller with one, nestControllerRoutes any number.`);
9
+ }
10
+ return route;
11
+ }
12
+ //# sourceMappingURL=nest-controller-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-route.js","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,yGAAyG;AACzG,MAAM,UAAU,mBAAmB,CAAC,UAA+B,EAAE,OAAO,GAAgC,EAAE;IAC5G,MAAM,MAAM,GAAG,oBAAoB,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;IAEvB,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,gBAAgB,CACxB,GAAG,UAAU,CAAC,IAAI,WAAW,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,4FAA4F,CAC/I,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Schema } from '@ddd-ts-kit/validation';
2
+ import type { ControllerRoutesOptions } from '../../controller/controller-routes-options.js';
3
+ import type { DtoType } from './dto-type.js';
4
+ import type { NestControllerClass } from './nest-controller-class.js';
5
+ export interface NestControllerRoutesOptions extends Pick<ControllerRoutesOptions, 'resolve' | 'security'> {
6
+ /**
7
+ * The instance that answers the routes of a controller, built by Nest's container: asked at the
8
+ * first call, so that the contract is generated without one.
9
+ */
10
+ readonly instanceOf?: (controller: NestControllerClass) => unknown;
11
+ /** The schema of a DTO class, a parameter typed by one or a response body: `classSchema` of `@ddd-ts-kit/validation/class-validator`. */
12
+ readonly schemaOfClass?: (dto: DtoType) => Schema<unknown>;
13
+ }
14
+ //# sourceMappingURL=nest-controller-routes-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-routes-options.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-routes-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,uBAAuB,EAAE,SAAS,GAAG,UAAU,CAAC;IACxG;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,OAAO,CAAC;IACnE,yIAAyI;IACzI,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC;CAC5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nest-controller-routes-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-routes-options.js","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-routes-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { Route } from '../../route/route.js';
2
+ import type { NestControllerClass } from './nest-controller-class.js';
3
+ import type { NestControllerRoutesOptions } from './nest-controller-routes-options.js';
4
+ /**
5
+ * The routes of Nest controllers whose methods carry `@KitRoute`, for any adapter of the kit and
6
+ * for the contract generator: each method becomes one route of the kit, its method, path,
7
+ * parameters and status read from Nest's decorators, the rest from `@KitRoute` and `@KitRoutes`.
8
+ * It is served as every controller of the kit is, guards, validation and problem documents
9
+ * included; the instance that answers is the one Nest's container builds (`instanceOf`).
10
+ */
11
+ export declare function nestControllerRoutes(controllers: readonly NestControllerClass[], options?: NestControllerRoutesOptions): readonly Route[];
12
+ //# sourceMappingURL=nest-controller-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controller-routes.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controller-routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAUpF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,SAAS,mBAAmB,EAAE,EAC3C,OAAO,GAAE,2BAAgC,GACxC,SAAS,KAAK,EAAE,CAOlB"}
@@ -0,0 +1,159 @@
1
+ import { DeclarationError } from '@ddd-ts-kit/kernel/declarations';
2
+ import { controllerRoutes } from '../../controller/controller-routes.js';
3
+ import { presentationRegistry } from '../../controller/presentation-registry.js';
4
+ import { argumentsOf } from './arguments-of.js';
5
+ import { isNestController } from './is-nest-controller.js';
6
+ import { nestRouteMetadata } from './nest-route-metadata.js';
7
+ import { nestRouteMethods } from './nest-route-methods.js';
8
+ import { nestRoutesRegistry } from './nest-routes-registry.js';
9
+ import { prototypeOf } from './prototype-of.js';
10
+ import { requestSchemasOf } from './request-schemas-of.js';
11
+ import { schemaOf } from './schema-of.js';
12
+ import { summaryOf } from './summary-of.js';
13
+ /**
14
+ * The routes of Nest controllers whose methods carry `@KitRoute`, for any adapter of the kit and
15
+ * for the contract generator: each method becomes one route of the kit, its method, path,
16
+ * parameters and status read from Nest's decorators, the rest from `@KitRoute` and `@KitRoutes`.
17
+ * It is served as every controller of the kit is, guards, validation and problem documents
18
+ * included; the instance that answers is the one Nest's container builds (`instanceOf`).
19
+ */
20
+ export function nestControllerRoutes(controllers, options = {}) {
21
+ const entries = controllers.flatMap((controller) => routesOf(controller, options));
22
+ return controllerRoutes(entries, {
23
+ ...(options.resolve === undefined ? {} : { resolve: options.resolve }),
24
+ ...(options.security === undefined ? {} : { security: options.security }),
25
+ });
26
+ }
27
+ function routesOf(controller, options) {
28
+ if (!isNestController(controller)) {
29
+ throw new DeclarationError(`${controller.name} is served as a Nest controller and carries no @Controller of Nest.`);
30
+ }
31
+ const prototype = prototypeOf(controller);
32
+ const declared = nestRoutesRegistry().routes.get(prototype) ?? new Map();
33
+ const names = [...new Set([...nestRouteMethods(controller), ...declared.keys()])];
34
+ if (names.length === 0) {
35
+ throw new DeclarationError(`${controller.name} is served by the kit and no method carries a route decorator of Nest.`);
36
+ }
37
+ const answering = lazyInstance(controller, options);
38
+ const injected = nestRoutesRegistry().injected.get(prototype);
39
+ const signatures = nestRoutesRegistry().signatures.get(controller);
40
+ return names.map((name) => {
41
+ const written = declared.get(name) ?? {};
42
+ const method = {
43
+ controller,
44
+ name,
45
+ where: `${controller.name}.${name}`,
46
+ spec: { ...written, operationId: written.operationId ?? name, summary: written.summary ?? summaryOf(name) },
47
+ read: nestRouteMetadata(controller, name),
48
+ injected: injected?.get(name) ?? new Map(),
49
+ signature: signatures?.get(name) ?? {},
50
+ };
51
+ return synthetic(method, specOf(method, options), answering);
52
+ });
53
+ }
54
+ /**
55
+ * One controller of the kit per method: a class of its own, registered with its declaration, whose
56
+ * `handle` calls the method with what its parameters ask for.
57
+ */
58
+ function synthetic(method, spec, answering) {
59
+ const { where, name } = method;
60
+ class Answer {
61
+ async handle(request) {
62
+ const instance = answering();
63
+ const handler = Reflect.get(instance, name);
64
+ if (typeof handler !== 'function') {
65
+ throw new DeclarationError(`What Nest built for ${method.controller.name} has no method ${name}.`);
66
+ }
67
+ const answer = await Reflect.apply(handler, instance, argumentsOf(method, request));
68
+ if (spec.response.headers !== undefined) {
69
+ return answer;
70
+ }
71
+ if (answer !== undefined && spec.response.body === undefined) {
72
+ throw new DeclarationError(`${where} returned a value and @KitRoute declares no response.body: the kit would answer it empty. Declare the body the route answers, or return nothing.`);
73
+ }
74
+ return answer;
75
+ }
76
+ }
77
+ // The messages of the kit name the controller of a route by its class.
78
+ Object.defineProperty(Answer, 'name', { value: where });
79
+ presentationRegistry().controllers.set(Answer, spec);
80
+ return new Answer();
81
+ }
82
+ /** The declaration of the controller of the kit: Nest's method, path and status, the rest of @KitRoute over @KitRoutes. */
83
+ function specOf(method, options) {
84
+ const { read, spec } = method;
85
+ assertUploadDeclared(method);
86
+ const shared = nestRoutesRegistry().controllers.get(method.controller) ?? {};
87
+ const { response = {}, request, guards = [], tags = [], errors = [], ...declared } = spec;
88
+ return {
89
+ ...declared,
90
+ ...requestSchemasOf(method, options),
91
+ ...(shared.group === undefined ? {} : { group: shared.group }),
92
+ method: read.method,
93
+ path: `/${read.path}`,
94
+ tags: [...(shared.tags ?? []), ...tags],
95
+ guards: [...(shared.guards ?? []), ...guards],
96
+ errors: [...(shared.errors ?? []), ...errors],
97
+ response: responseOf(method, response, options),
98
+ };
99
+ }
100
+ /** A method that takes `@Upload()` reads the file `upload` of `@KitRoute` declares: without it, the kit would stream none. */
101
+ function assertUploadDeclared({ where, spec, injected }) {
102
+ if (spec.upload === undefined && [...injected.values()].includes('upload')) {
103
+ throw new DeclarationError(`${where} takes @Upload() and its @KitRoute declares no upload: say the field, the largest size and the media types of the file in \`upload\`.`);
104
+ }
105
+ }
106
+ function responseOf(method, response, options) {
107
+ const { where, read } = method;
108
+ const status = response.status ?? read.httpCode ?? (read.method === 'POST' ? 201 : 200);
109
+ const body = bodyOf(method, response);
110
+ return {
111
+ status,
112
+ ...(response.description === undefined ? {} : { description: response.description }),
113
+ ...(response.headers === undefined ? {} : { headers: response.headers }),
114
+ ...(body === undefined ? {} : { body: schemaOf(where, body, options) }),
115
+ };
116
+ }
117
+ /**
118
+ * The body the route answers: the one `@KitRoute` declares, else the one its signature names as
119
+ * `ddd-ts-kit` read it (`withSignatures`). A method TypeScript recorded as answering a value with
120
+ * neither is refused, never answered empty.
121
+ */
122
+ function bodyOf(method, response) {
123
+ // The method returns `{ body, headers }` then: its type says nothing of the body.
124
+ if (response.headers !== undefined) {
125
+ return response.body;
126
+ }
127
+ const signed = method.signature.answer;
128
+ const body = response.body ?? signed ?? undefined;
129
+ if (body === undefined && signed !== null && answersAValue(method.read.returnType)) {
130
+ throw new DeclarationError(`${method.where} returns ${describedType(method.read.returnType)} and @KitRoute declares no response.body: the kit would answer it empty. Declare the body the route answers, or return nothing.`);
131
+ }
132
+ return body;
133
+ }
134
+ /**
135
+ * Whether the type TypeScript recorded says the method answers something: `void` is recorded as
136
+ * nothing, and a `Promise` says nothing of what it holds, which the call then checks.
137
+ */
138
+ function answersAValue(returnType) {
139
+ return returnType !== undefined && returnType !== Promise;
140
+ }
141
+ function describedType(returnType) {
142
+ return typeof returnType === 'function' && returnType.name !== '' ? returnType.name : 'a value';
143
+ }
144
+ /** The instance Nest's container built, asked once at the first call. */
145
+ function lazyInstance(controller, options) {
146
+ let instance;
147
+ return () => {
148
+ instance ??= built(controller, options);
149
+ return instance;
150
+ };
151
+ }
152
+ function built(controller, options) {
153
+ const instance = options.instanceOf?.(controller);
154
+ if (typeof instance !== 'object' || instance === null) {
155
+ throw new DeclarationError(`${controller.name} is called and nothing builds it: serve it through createControllersModule, or give instanceOf.`);
156
+ }
157
+ return instance;
158
+ }
159
+ //# sourceMappingURL=nest-controller-routes.js.map
@@ -0,0 +1 @@
1
+ {"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,KAAK,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAExC,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,UAA+B,EAAE,OAAoC;IAClF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC;IAElD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtD,MAAM,IAAI,gBAAgB,CACxB,GAAG,UAAU,CAAC,IAAI,iGAAiG,CACpH,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Provider } from '@nestjs/common';
2
+ import type { NestControllerRoutesOptions } from './nest-controller-routes-options.js';
3
+ export interface NestControllersOptions extends Pick<NestControllerRoutesOptions, 'schemaOfClass' | 'security'> {
4
+ /** What the controllers inject, as Nest providers: the buses of the application, `{ provide: CommandBus, useValue: commands }`. */
5
+ readonly providers?: readonly Provider[];
6
+ }
7
+ //# sourceMappingURL=nest-controllers-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controllers-options.d.ts","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controllers-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAEpF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,2BAA2B,EAAE,eAAe,GAAG,UAAU,CAAC;IAC7G,mIAAmI;IACnI,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nest-controllers-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest-controllers-options.js","sourceRoot":"","sources":["../../../src/nest/controllers/nest-controllers-options.ts"],"names":[],"mappings":""}