@ddd-ts-kit/http 0.12.0 → 0.14.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 (471) hide show
  1. package/README.md +373 -11
  2. package/dist/controller/controller-routes.d.ts.map +1 -1
  3. package/dist/controller/controller-routes.js +8 -0
  4. package/dist/controller/controller-routes.js.map +1 -1
  5. package/dist/controller/controller-spec.d.ts +7 -0
  6. package/dist/controller/controller-spec.d.ts.map +1 -1
  7. package/dist/error/default-error-mapping.d.ts.map +1 -1
  8. package/dist/error/default-error-mapping.js +1 -0
  9. package/dist/error/default-error-mapping.js.map +1 -1
  10. package/dist/express/mount-express.d.ts +4 -2
  11. package/dist/express/mount-express.d.ts.map +1 -1
  12. package/dist/express/mount-express.js +25 -11
  13. package/dist/express/mount-express.js.map +1 -1
  14. package/dist/fastify/mount-fastify.d.ts +2 -1
  15. package/dist/fastify/mount-fastify.d.ts.map +1 -1
  16. package/dist/fastify/mount-fastify.js +23 -4
  17. package/dist/fastify/mount-fastify.js.map +1 -1
  18. package/dist/field-access/assert-writable.d.ts +8 -0
  19. package/dist/field-access/assert-writable.d.ts.map +1 -0
  20. package/dist/field-access/assert-writable.js +29 -0
  21. package/dist/field-access/assert-writable.js.map +1 -0
  22. package/dist/field-access/field-access-entry.d.ts +7 -0
  23. package/dist/field-access/field-access-entry.d.ts.map +1 -0
  24. package/dist/field-access/field-access-entry.js +2 -0
  25. package/dist/field-access/field-access-entry.js.map +1 -0
  26. package/dist/field-access/field-access.d.ts +13 -0
  27. package/dist/field-access/field-access.d.ts.map +1 -0
  28. package/dist/field-access/field-access.js +41 -0
  29. package/dist/field-access/field-access.js.map +1 -0
  30. package/dist/field-access/field-decider-of.d.ts +37 -0
  31. package/dist/field-access/field-decider-of.d.ts.map +1 -0
  32. package/dist/field-access/field-decider-of.js +30 -0
  33. package/dist/field-access/field-decider-of.js.map +1 -0
  34. package/dist/field-access/field-decider.d.ts +4 -0
  35. package/dist/field-access/field-decider.d.ts.map +1 -0
  36. package/dist/field-access/field-decider.js +2 -0
  37. package/dist/field-access/field-decider.js.map +1 -0
  38. package/dist/field-access/field-judge.d.ts +33 -0
  39. package/dist/field-access/field-judge.d.ts.map +1 -0
  40. package/dist/field-access/field-judge.js +81 -0
  41. package/dist/field-access/field-judge.js.map +1 -0
  42. package/dist/field-access/field-policy.d.ts +15 -0
  43. package/dist/field-access/field-policy.d.ts.map +1 -0
  44. package/dist/field-access/field-policy.js +2 -0
  45. package/dist/field-access/field-policy.js.map +1 -0
  46. package/dist/field-access/field-question.d.ts +18 -0
  47. package/dist/field-access/field-question.d.ts.map +1 -0
  48. package/dist/field-access/field-question.js +2 -0
  49. package/dist/field-access/field-question.js.map +1 -0
  50. package/dist/field-access/field-requirement.d.ts +13 -0
  51. package/dist/field-access/field-requirement.d.ts.map +1 -0
  52. package/dist/field-access/field-requirement.js +2 -0
  53. package/dist/field-access/field-requirement.js.map +1 -0
  54. package/dist/field-access/field-rule.d.ts +11 -0
  55. package/dist/field-access/field-rule.d.ts.map +1 -0
  56. package/dist/field-access/field-rule.js +2 -0
  57. package/dist/field-access/field-rule.js.map +1 -0
  58. package/dist/field-access/field-rules.d.ts +6 -0
  59. package/dist/field-access/field-rules.d.ts.map +1 -0
  60. package/dist/field-access/field-rules.js +2 -0
  61. package/dist/field-access/field-rules.js.map +1 -0
  62. package/dist/field-access/field-tree.d.ts +16 -0
  63. package/dist/field-access/field-tree.d.ts.map +1 -0
  64. package/dist/field-access/field-tree.js +28 -0
  65. package/dist/field-access/field-tree.js.map +1 -0
  66. package/dist/field-access/visible-body.d.ts +9 -0
  67. package/dist/field-access/visible-body.d.ts.map +1 -0
  68. package/dist/field-access/visible-body.js +42 -0
  69. package/dist/field-access/visible-body.js.map +1 -0
  70. package/dist/field-access/with-field-access.d.ts +17 -0
  71. package/dist/field-access/with-field-access.d.ts.map +1 -0
  72. package/dist/field-access/with-field-access.js +63 -0
  73. package/dist/field-access/with-field-access.js.map +1 -0
  74. package/dist/forms/assert-hints.d.ts +12 -0
  75. package/dist/forms/assert-hints.d.ts.map +1 -0
  76. package/dist/forms/assert-hints.js +32 -0
  77. package/dist/forms/assert-hints.js.map +1 -0
  78. package/dist/forms/assert-opens.d.ts +16 -0
  79. package/dist/forms/assert-opens.d.ts.map +1 -0
  80. package/dist/forms/assert-opens.js +24 -0
  81. package/dist/forms/assert-opens.js.map +1 -0
  82. package/dist/forms/constraints-of.d.ts +4 -0
  83. package/dist/forms/constraints-of.d.ts.map +1 -0
  84. package/dist/forms/constraints-of.js +24 -0
  85. package/dist/forms/constraints-of.js.map +1 -0
  86. package/dist/forms/define-form.d.ts +20 -0
  87. package/dist/forms/define-form.d.ts.map +1 -0
  88. package/dist/forms/define-form.js +8 -0
  89. package/dist/forms/define-form.js.map +1 -0
  90. package/dist/forms/field-block.d.ts +33 -0
  91. package/dist/forms/field-block.d.ts.map +1 -0
  92. package/dist/forms/field-block.js +2 -0
  93. package/dist/forms/field-block.js.map +1 -0
  94. package/dist/forms/field-hint.d.ts +18 -0
  95. package/dist/forms/field-hint.d.ts.map +1 -0
  96. package/dist/forms/field-hint.js +2 -0
  97. package/dist/forms/field-hint.js.map +1 -0
  98. package/dist/forms/field-lookup.d.ts +7 -0
  99. package/dist/forms/field-lookup.d.ts.map +1 -0
  100. package/dist/forms/field-lookup.js +2 -0
  101. package/dist/forms/field-lookup.js.map +1 -0
  102. package/dist/forms/form-block.d.ts +5 -0
  103. package/dist/forms/form-block.d.ts.map +1 -0
  104. package/dist/forms/form-block.js +2 -0
  105. package/dist/forms/form-block.js.map +1 -0
  106. package/dist/forms/form-condition.d.ts +9 -0
  107. package/dist/forms/form-condition.d.ts.map +1 -0
  108. package/dist/forms/form-condition.js +2 -0
  109. package/dist/forms/form-condition.js.map +1 -0
  110. package/dist/forms/form-describer.d.ts +35 -0
  111. package/dist/forms/form-describer.d.ts.map +1 -0
  112. package/dist/forms/form-describer.js +132 -0
  113. package/dist/forms/form-describer.js.map +1 -0
  114. package/dist/forms/form-description.d.ts +17 -0
  115. package/dist/forms/form-description.d.ts.map +1 -0
  116. package/dist/forms/form-description.js +2 -0
  117. package/dist/forms/form-description.js.map +1 -0
  118. package/dist/forms/form-document.d.ts +9 -0
  119. package/dist/forms/form-document.d.ts.map +1 -0
  120. package/dist/forms/form-document.js +2 -0
  121. package/dist/forms/form-document.js.map +1 -0
  122. package/dist/forms/form-documents-of.d.ts +10 -0
  123. package/dist/forms/form-documents-of.d.ts.map +1 -0
  124. package/dist/forms/form-documents-of.js +22 -0
  125. package/dist/forms/form-documents-of.js.map +1 -0
  126. package/dist/forms/form-format.d.ts +7 -0
  127. package/dist/forms/form-format.d.ts.map +1 -0
  128. package/dist/forms/form-format.js +3 -0
  129. package/dist/forms/form-format.js.map +1 -0
  130. package/dist/forms/form-group-hint.d.ts +8 -0
  131. package/dist/forms/form-group-hint.d.ts.map +1 -0
  132. package/dist/forms/form-group-hint.js +2 -0
  133. package/dist/forms/form-group-hint.js.map +1 -0
  134. package/dist/forms/form-hints.d.ts +16 -0
  135. package/dist/forms/form-hints.d.ts.map +1 -0
  136. package/dist/forms/form-hints.js +2 -0
  137. package/dist/forms/form-hints.js.map +1 -0
  138. package/dist/forms/form-of-route.d.ts +17 -0
  139. package/dist/forms/form-of-route.d.ts.map +1 -0
  140. package/dist/forms/form-of-route.js +47 -0
  141. package/dist/forms/form-of-route.js.map +1 -0
  142. package/dist/forms/form-query-schema.d.ts +10 -0
  143. package/dist/forms/form-query-schema.d.ts.map +1 -0
  144. package/dist/forms/form-query-schema.js +58 -0
  145. package/dist/forms/form-query-schema.js.map +1 -0
  146. package/dist/forms/form-query.d.ts +7 -0
  147. package/dist/forms/form-query.d.ts.map +1 -0
  148. package/dist/forms/form-query.js +2 -0
  149. package/dist/forms/form-query.js.map +1 -0
  150. package/dist/forms/form-requirement.d.ts +18 -0
  151. package/dist/forms/form-requirement.d.ts.map +1 -0
  152. package/dist/forms/form-requirement.js +2 -0
  153. package/dist/forms/form-requirement.js.map +1 -0
  154. package/dist/forms/form-routes.d.ts +19 -0
  155. package/dist/forms/form-routes.d.ts.map +1 -0
  156. package/dist/forms/form-routes.js +67 -0
  157. package/dist/forms/form-routes.js.map +1 -0
  158. package/dist/forms/form-schema.d.ts +4 -0
  159. package/dist/forms/form-schema.d.ts.map +1 -0
  160. package/dist/forms/form-schema.js +52 -0
  161. package/dist/forms/form-schema.js.map +1 -0
  162. package/dist/forms/group-block.d.ts +9 -0
  163. package/dist/forms/group-block.d.ts.map +1 -0
  164. package/dist/forms/group-block.js +2 -0
  165. package/dist/forms/group-block.js.map +1 -0
  166. package/dist/forms/json-form.d.ts +8 -0
  167. package/dist/forms/json-form.d.ts.map +1 -0
  168. package/dist/forms/json-form.js +2 -0
  169. package/dist/forms/json-form.js.map +1 -0
  170. package/dist/forms/json-forms-of.d.ts +12 -0
  171. package/dist/forms/json-forms-of.d.ts.map +1 -0
  172. package/dist/forms/json-forms-of.js +129 -0
  173. package/dist/forms/json-forms-of.js.map +1 -0
  174. package/dist/forms/lookups-of.d.ts +5 -0
  175. package/dist/forms/lookups-of.d.ts.map +1 -0
  176. package/dist/forms/lookups-of.js +7 -0
  177. package/dist/forms/lookups-of.js.map +1 -0
  178. package/dist/forms/widget-of.d.ts +5 -0
  179. package/dist/forms/widget-of.d.ts.map +1 -0
  180. package/dist/forms/widget-of.js +25 -0
  181. package/dist/forms/widget-of.js.map +1 -0
  182. package/dist/forms/widget.d.ts +3 -0
  183. package/dist/forms/widget.d.ts.map +1 -0
  184. package/dist/forms/widget.js +2 -0
  185. package/dist/forms/widget.js.map +1 -0
  186. package/dist/hono/edge-problem.d.ts +11 -0
  187. package/dist/hono/edge-problem.d.ts.map +1 -0
  188. package/dist/hono/edge-problem.js +15 -0
  189. package/dist/hono/edge-problem.js.map +1 -0
  190. package/dist/hono/hono-mount-options.d.ts +10 -0
  191. package/dist/hono/hono-mount-options.d.ts.map +1 -0
  192. package/dist/hono/hono-mount-options.js +2 -0
  193. package/dist/hono/hono-mount-options.js.map +1 -0
  194. package/dist/hono/hono-raw.d.ts +11 -0
  195. package/dist/hono/hono-raw.d.ts.map +1 -0
  196. package/dist/hono/hono-raw.js +2 -0
  197. package/dist/hono/hono-raw.js.map +1 -0
  198. package/dist/hono/mount-hono.d.ts +13 -0
  199. package/dist/hono/mount-hono.d.ts.map +1 -0
  200. package/dist/hono/mount-hono.js +77 -0
  201. package/dist/hono/mount-hono.js.map +1 -0
  202. package/dist/hono/read-body.d.ts +16 -0
  203. package/dist/hono/read-body.d.ts.map +1 -0
  204. package/dist/hono/read-body.js +65 -0
  205. package/dist/hono/read-body.js.map +1 -0
  206. package/dist/hono.d.ts +4 -0
  207. package/dist/hono.d.ts.map +1 -0
  208. package/dist/hono.js +2 -0
  209. package/dist/hono.js.map +1 -0
  210. package/dist/index.d.ts +43 -0
  211. package/dist/index.d.ts.map +1 -1
  212. package/dist/index.js +20 -0
  213. package/dist/index.js.map +1 -1
  214. package/dist/openapi/cache-response-headers.d.ts +5 -2
  215. package/dist/openapi/cache-response-headers.d.ts.map +1 -1
  216. package/dist/openapi/cache-response-headers.js +10 -5
  217. package/dist/openapi/cache-response-headers.js.map +1 -1
  218. package/dist/openapi/definitions.d.ts +6 -1
  219. package/dist/openapi/definitions.d.ts.map +1 -1
  220. package/dist/openapi/definitions.js +12 -1
  221. package/dist/openapi/definitions.js.map +1 -1
  222. package/dist/openapi/documenting.d.ts +11 -0
  223. package/dist/openapi/documenting.d.ts.map +1 -0
  224. package/dist/openapi/documenting.js +2 -0
  225. package/dist/openapi/documenting.js.map +1 -0
  226. package/dist/openapi/generate-open-api.d.ts +7 -0
  227. package/dist/openapi/generate-open-api.d.ts.map +1 -1
  228. package/dist/openapi/generate-open-api.js +5 -1
  229. package/dist/openapi/generate-open-api.js.map +1 -1
  230. package/dist/openapi/path-items.d.ts +2 -3
  231. package/dist/openapi/path-items.d.ts.map +1 -1
  232. package/dist/openapi/path-items.js +8 -7
  233. package/dist/openapi/path-items.js.map +1 -1
  234. package/dist/openapi/request-body.d.ts +6 -3
  235. package/dist/openapi/request-body.d.ts.map +1 -1
  236. package/dist/openapi/request-body.js +13 -3
  237. package/dist/openapi/request-body.js.map +1 -1
  238. package/dist/openapi/responses.d.ts +2 -3
  239. package/dist/openapi/responses.d.ts.map +1 -1
  240. package/dist/openapi/responses.js +40 -12
  241. package/dist/openapi/responses.js.map +1 -1
  242. package/dist/openapi/schema-parameters.js +1 -1
  243. package/dist/openapi/schema-parameters.js.map +1 -1
  244. package/dist/pagination/every-page.d.ts +15 -0
  245. package/dist/pagination/every-page.d.ts.map +1 -0
  246. package/dist/pagination/every-page.js +21 -0
  247. package/dist/pagination/every-page.js.map +1 -0
  248. package/dist/pagination/page-schema-of.d.ts +3 -1
  249. package/dist/pagination/page-schema-of.d.ts.map +1 -1
  250. package/dist/pagination/page-schema-of.js +11 -3
  251. package/dist/pagination/page-schema-of.js.map +1 -1
  252. package/dist/pipeline/assert-cached-routes.d.ts +4 -2
  253. package/dist/pipeline/assert-cached-routes.d.ts.map +1 -1
  254. package/dist/pipeline/assert-cached-routes.js +46 -8
  255. package/dist/pipeline/assert-cached-routes.js.map +1 -1
  256. package/dist/pipeline/conditional-answer.d.ts +7 -2
  257. package/dist/pipeline/conditional-answer.d.ts.map +1 -1
  258. package/dist/pipeline/conditional-answer.js +10 -6
  259. package/dist/pipeline/conditional-answer.js.map +1 -1
  260. package/dist/pipeline/entity-tag-of.d.ts +3 -3
  261. package/dist/pipeline/entity-tag-of.d.ts.map +1 -1
  262. package/dist/pipeline/entity-tag-of.js +4 -4
  263. package/dist/pipeline/entity-tag-of.js.map +1 -1
  264. package/dist/pipeline/error-context.d.ts +6 -1
  265. package/dist/pipeline/error-context.d.ts.map +1 -1
  266. package/dist/pipeline/execute-options.d.ts +17 -0
  267. package/dist/pipeline/execute-options.d.ts.map +1 -1
  268. package/dist/pipeline/execute-route.d.ts.map +1 -1
  269. package/dist/pipeline/execute-route.js +121 -35
  270. package/dist/pipeline/execute-route.js.map +1 -1
  271. package/dist/pipeline/iterated-within.d.ts +9 -0
  272. package/dist/pipeline/iterated-within.d.ts.map +1 -0
  273. package/dist/pipeline/iterated-within.js +17 -0
  274. package/dist/pipeline/iterated-within.js.map +1 -0
  275. package/dist/pipeline/negotiated-vary.d.ts +6 -0
  276. package/dist/pipeline/negotiated-vary.d.ts.map +1 -0
  277. package/dist/pipeline/negotiated-vary.js +15 -0
  278. package/dist/pipeline/negotiated-vary.js.map +1 -0
  279. package/dist/pipeline/negotiation.d.ts +19 -0
  280. package/dist/pipeline/negotiation.d.ts.map +1 -0
  281. package/dist/pipeline/negotiation.js +19 -0
  282. package/dist/pipeline/negotiation.js.map +1 -0
  283. package/dist/pipeline/primed.d.ts +6 -0
  284. package/dist/pipeline/primed.d.ts.map +1 -0
  285. package/dist/pipeline/primed.js +20 -0
  286. package/dist/pipeline/primed.js.map +1 -0
  287. package/dist/pipeline/read-body.d.ts +10 -0
  288. package/dist/pipeline/read-body.d.ts.map +1 -0
  289. package/dist/pipeline/read-body.js +33 -0
  290. package/dist/pipeline/read-body.js.map +1 -0
  291. package/dist/pipeline/reported-stream.d.ts +6 -0
  292. package/dist/pipeline/reported-stream.d.ts.map +1 -0
  293. package/dist/pipeline/reported-stream.js +14 -0
  294. package/dist/pipeline/reported-stream.js.map +1 -0
  295. package/dist/pipeline/represented-answer.d.ts +7 -0
  296. package/dist/pipeline/represented-answer.d.ts.map +1 -0
  297. package/dist/pipeline/represented-answer.js +2 -0
  298. package/dist/pipeline/represented-answer.js.map +1 -0
  299. package/dist/pipeline/represented.d.ts +7 -0
  300. package/dist/pipeline/represented.d.ts.map +1 -0
  301. package/dist/pipeline/represented.js +19 -0
  302. package/dist/pipeline/represented.js.map +1 -0
  303. package/dist/pipeline/route-response.d.ts +2 -0
  304. package/dist/pipeline/route-response.d.ts.map +1 -1
  305. package/dist/pipeline/tagged-answer.d.ts +5 -2
  306. package/dist/pipeline/tagged-answer.d.ts.map +1 -1
  307. package/dist/pipeline/tagged-answer.js +1 -1
  308. package/dist/pipeline/tagged-answer.js.map +1 -1
  309. package/dist/pipeline/write-stream.d.ts +8 -0
  310. package/dist/pipeline/write-stream.d.ts.map +1 -0
  311. package/dist/pipeline/write-stream.js +23 -0
  312. package/dist/pipeline/write-stream.js.map +1 -0
  313. package/dist/pipeline/written-in.d.ts +10 -0
  314. package/dist/pipeline/written-in.d.ts.map +1 -0
  315. package/dist/pipeline/written-in.js +17 -0
  316. package/dist/pipeline/written-in.js.map +1 -0
  317. package/dist/representation/assert-served.d.ts +10 -0
  318. package/dist/representation/assert-served.d.ts.map +1 -0
  319. package/dist/representation/assert-served.js +18 -0
  320. package/dist/representation/assert-served.js.map +1 -0
  321. package/dist/representation/body-shape.d.ts +9 -0
  322. package/dist/representation/body-shape.d.ts.map +1 -0
  323. package/dist/representation/body-shape.js +2 -0
  324. package/dist/representation/body-shape.js.map +1 -0
  325. package/dist/representation/csv/csv-cell.d.ts +8 -0
  326. package/dist/representation/csv/csv-cell.d.ts.map +1 -0
  327. package/dist/representation/csv/csv-cell.js +19 -0
  328. package/dist/representation/csv/csv-cell.js.map +1 -0
  329. package/dist/representation/csv/csv-representation.d.ts +16 -0
  330. package/dist/representation/csv/csv-representation.d.ts.map +1 -0
  331. package/dist/representation/csv/csv-representation.js +54 -0
  332. package/dist/representation/csv/csv-representation.js.map +1 -0
  333. package/dist/representation/is-json-media-type.d.ts +3 -0
  334. package/dist/representation/is-json-media-type.d.ts.map +1 -0
  335. package/dist/representation/is-json-media-type.js +5 -0
  336. package/dist/representation/is-json-media-type.js.map +1 -0
  337. package/dist/representation/json-representation.d.ts +14 -0
  338. package/dist/representation/json-representation.d.ts.map +1 -0
  339. package/dist/representation/json-representation.js +40 -0
  340. package/dist/representation/json-representation.js.map +1 -0
  341. package/dist/representation/malformed-body.d.ts +4 -0
  342. package/dist/representation/malformed-body.d.ts.map +1 -0
  343. package/dist/representation/malformed-body.js +6 -0
  344. package/dist/representation/malformed-body.js.map +1 -0
  345. package/dist/representation/media-type-of.d.ts +3 -0
  346. package/dist/representation/media-type-of.d.ts.map +1 -0
  347. package/dist/representation/media-type-of.js +7 -0
  348. package/dist/representation/media-type-of.js.map +1 -0
  349. package/dist/representation/negotiate.d.ts +8 -0
  350. package/dist/representation/negotiate.d.ts.map +1 -0
  351. package/dist/representation/negotiate.js +55 -0
  352. package/dist/representation/negotiate.js.map +1 -0
  353. package/dist/representation/not-acceptable-error.d.ts +7 -0
  354. package/dist/representation/not-acceptable-error.d.ts.map +1 -0
  355. package/dist/representation/not-acceptable-error.js +7 -0
  356. package/dist/representation/not-acceptable-error.js.map +1 -0
  357. package/dist/representation/problem-shape.d.ts +4 -0
  358. package/dist/representation/problem-shape.d.ts.map +1 -0
  359. package/dist/representation/problem-shape.js +7 -0
  360. package/dist/representation/problem-shape.js.map +1 -0
  361. package/dist/representation/representation.d.ts +20 -0
  362. package/dist/representation/representation.d.ts.map +1 -0
  363. package/dist/representation/representation.js +9 -0
  364. package/dist/representation/representation.js.map +1 -0
  365. package/dist/representation/representations.d.ts +33 -0
  366. package/dist/representation/representations.d.ts.map +1 -0
  367. package/dist/representation/representations.js +85 -0
  368. package/dist/representation/representations.js.map +1 -0
  369. package/dist/representation/represented-body.d.ts +3 -0
  370. package/dist/representation/represented-body.d.ts.map +1 -0
  371. package/dist/representation/represented-body.js +2 -0
  372. package/dist/representation/represented-body.js.map +1 -0
  373. package/dist/representation/stream-schema-of.d.ts +10 -0
  374. package/dist/representation/stream-schema-of.d.ts.map +1 -0
  375. package/dist/representation/stream-schema-of.js +31 -0
  376. package/dist/representation/stream-schema-of.js.map +1 -0
  377. package/dist/representation/unsupported-media-type-error.d.ts +7 -0
  378. package/dist/representation/unsupported-media-type-error.d.ts.map +1 -0
  379. package/dist/representation/unsupported-media-type-error.js +7 -0
  380. package/dist/representation/unsupported-media-type-error.js.map +1 -0
  381. package/dist/representation/wire-text.d.ts +7 -0
  382. package/dist/representation/wire-text.d.ts.map +1 -0
  383. package/dist/representation/wire-text.js +21 -0
  384. package/dist/representation/wire-text.js.map +1 -0
  385. package/dist/representation/xml/decode-entities.d.ts +3 -0
  386. package/dist/representation/xml/decode-entities.d.ts.map +1 -0
  387. package/dist/representation/xml/decode-entities.js +38 -0
  388. package/dist/representation/xml/decode-entities.js.map +1 -0
  389. package/dist/representation/xml/is-xml-name.d.ts +3 -0
  390. package/dist/representation/xml/is-xml-name.d.ts.map +1 -0
  391. package/dist/representation/xml/is-xml-name.js +6 -0
  392. package/dist/representation/xml/is-xml-name.js.map +1 -0
  393. package/dist/representation/xml/xml-convention.d.ts +10 -0
  394. package/dist/representation/xml/xml-convention.d.ts.map +1 -0
  395. package/dist/representation/xml/xml-convention.js +10 -0
  396. package/dist/representation/xml/xml-convention.js.map +1 -0
  397. package/dist/representation/xml/xml-element-writer.d.ts +16 -0
  398. package/dist/representation/xml/xml-element-writer.d.ts.map +1 -0
  399. package/dist/representation/xml/xml-element-writer.js +71 -0
  400. package/dist/representation/xml/xml-element-writer.js.map +1 -0
  401. package/dist/representation/xml/xml-element.d.ts +9 -0
  402. package/dist/representation/xml/xml-element.d.ts.map +1 -0
  403. package/dist/representation/xml/xml-element.js +2 -0
  404. package/dist/representation/xml/xml-element.js.map +1 -0
  405. package/dist/representation/xml/xml-parser.d.ts +27 -0
  406. package/dist/representation/xml/xml-parser.d.ts.map +1 -0
  407. package/dist/representation/xml/xml-parser.js +154 -0
  408. package/dist/representation/xml/xml-parser.js.map +1 -0
  409. package/dist/representation/xml/xml-representation.d.ts +20 -0
  410. package/dist/representation/xml/xml-representation.d.ts.map +1 -0
  411. package/dist/representation/xml/xml-representation.js +52 -0
  412. package/dist/representation/xml/xml-representation.js.map +1 -0
  413. package/dist/representation/xml/xml-syntax-error.d.ts +5 -0
  414. package/dist/representation/xml/xml-syntax-error.d.ts.map +1 -0
  415. package/dist/representation/xml/xml-syntax-error.js +8 -0
  416. package/dist/representation/xml/xml-syntax-error.js.map +1 -0
  417. package/dist/representation/xml/xml-text.d.ts +7 -0
  418. package/dist/representation/xml/xml-text.d.ts.map +1 -0
  419. package/dist/representation/xml/xml-text.js +30 -0
  420. package/dist/representation/xml/xml-text.js.map +1 -0
  421. package/dist/representation/xml/xml-value-reader.d.ts +15 -0
  422. package/dist/representation/xml/xml-value-reader.d.ts.map +1 -0
  423. package/dist/representation/xml/xml-value-reader.js +101 -0
  424. package/dist/representation/xml/xml-value-reader.js.map +1 -0
  425. package/dist/route/answers-with-schema.d.ts +7 -0
  426. package/dist/route/answers-with-schema.d.ts.map +1 -0
  427. package/dist/route/answers-with-schema.js +10 -0
  428. package/dist/route/answers-with-schema.js.map +1 -0
  429. package/dist/route/route-spec.d.ts +11 -0
  430. package/dist/route/route-spec.d.ts.map +1 -1
  431. package/dist/schema/json-schema-of.d.ts +7 -0
  432. package/dist/schema/json-schema-of.d.ts.map +1 -0
  433. package/dist/schema/json-schema-of.js +15 -0
  434. package/dist/schema/json-schema-of.js.map +1 -0
  435. package/dist/schema/schema-node.d.ts +25 -0
  436. package/dist/schema/schema-node.d.ts.map +1 -0
  437. package/dist/schema/schema-node.js +92 -0
  438. package/dist/schema/schema-node.js.map +1 -0
  439. package/dist/schema/schema-type.d.ts +3 -0
  440. package/dist/schema/schema-type.d.ts.map +1 -0
  441. package/dist/schema/schema-type.js +2 -0
  442. package/dist/schema/schema-type.js.map +1 -0
  443. package/dist/schema/xml-hints.d.ts +9 -0
  444. package/dist/schema/xml-hints.d.ts.map +1 -0
  445. package/dist/schema/xml-hints.js +2 -0
  446. package/dist/schema/xml-hints.js.map +1 -0
  447. package/dist/schemas/accepted-schema.d.ts +8 -0
  448. package/dist/schemas/accepted-schema.d.ts.map +1 -0
  449. package/dist/schemas/accepted-schema.js +20 -0
  450. package/dist/schemas/accepted-schema.js.map +1 -0
  451. package/dist/schemas/accepted.d.ts +5 -0
  452. package/dist/schemas/accepted.d.ts.map +1 -0
  453. package/dist/schemas/accepted.js +2 -0
  454. package/dist/schemas/accepted.js.map +1 -0
  455. package/dist/serialization/decimal-text.d.ts +6 -0
  456. package/dist/serialization/decimal-text.d.ts.map +1 -0
  457. package/dist/serialization/decimal-text.js +13 -0
  458. package/dist/serialization/decimal-text.js.map +1 -0
  459. package/dist/serialization/money-body.d.ts +6 -0
  460. package/dist/serialization/money-body.d.ts.map +1 -0
  461. package/dist/serialization/money-body.js +2 -0
  462. package/dist/serialization/money-body.js.map +1 -0
  463. package/dist/serialization/money.d.ts +4 -0
  464. package/dist/serialization/money.d.ts.map +1 -0
  465. package/dist/serialization/money.js +10 -0
  466. package/dist/serialization/money.js.map +1 -0
  467. package/dist/support/is-async-iterable.d.ts +3 -0
  468. package/dist/support/is-async-iterable.d.ts.map +1 -0
  469. package/dist/support/is-async-iterable.js +5 -0
  470. package/dist/support/is-async-iterable.js.map +1 -0
  471. package/package.json +15 -5
@@ -0,0 +1,19 @@
1
+ import { Readable } from 'node:stream';
2
+ import { jsonSchemaOf } from '../schema/json-schema-of.js';
3
+ import { isAsyncIterable } from '../support/is-async-iterable.js';
4
+ import { primed } from './primed.js';
5
+ import { writtenIn } from './written-in.js';
6
+ /** The answer of a route in the media type the request negotiated. A binary body, a file stream, is the handler's own and is left as it is. */
7
+ export async function represented(route, result, chosen) {
8
+ const { body } = result;
9
+ if (body === undefined) {
10
+ return { headers: {} };
11
+ }
12
+ if (body instanceof Uint8Array || body instanceof Readable) {
13
+ return { headers: {}, body };
14
+ }
15
+ const schema = route.responses[result.status]?.body;
16
+ const shape = { schema: schema === undefined ? {} : jsonSchemaOf(schema), name: route.operationId };
17
+ return writtenIn(isAsyncIterable(body) ? await primed(body) : body, chosen, shape);
18
+ }
19
+ //# sourceMappingURL=represented.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"represented.js","sourceRoot":"","sources":["../../src/pipeline/represented.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,+IAA+I;AAC/I,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAY,EAAE,MAAmB,EAAE,MAAc;IACjF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAExB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,IAAI,YAAY,UAAU,IAAI,IAAI,YAAY,QAAQ,EAAE,CAAC;QAC3D,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IACpD,MAAM,KAAK,GAAc,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;IAE/G,OAAO,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACrF,CAAC"}
@@ -3,5 +3,7 @@ export interface RouteResponse {
3
3
  /** Lower-case names. `content-type` is set whenever there is a body. */
4
4
  readonly headers: Readonly<Record<string, string>>;
5
5
  readonly body?: unknown;
6
+ /** The chunks of a body written as it is read, a streamed list: an adapter writes them in order, and `body` is then absent. */
7
+ readonly stream?: AsyncIterable<string>;
6
8
  }
7
9
  //# sourceMappingURL=route-response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-response.d.ts","sourceRoot":"","sources":["../../src/pipeline/route-response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB"}
1
+ {"version":3,"file":"route-response.d.ts","sourceRoot":"","sources":["../../src/pipeline/route-response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,+HAA+H;IAC/H,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACzC"}
@@ -2,8 +2,11 @@ import { CacheTagHeader } from '../cache/cache-tag-header.js';
2
2
  import type { Route } from '../route/route.js';
3
3
  import { type TaggedParts } from './cache-tags-of.js';
4
4
  import type { RouteResponse } from './route-response.js';
5
- /** What tags an answer: the route, the header of the shared cache, and what the tags are read from. */
6
- export interface Tagging extends Omit<TaggedParts, 'body'> {
5
+ /**
6
+ * What tags an answer: the route, the header of the shared cache, and what the tags are read
7
+ * from, the value the handler answered among them, before any representation wrote it.
8
+ */
9
+ export interface Tagging extends TaggedParts {
7
10
  readonly route: Pick<Route, 'cache'>;
8
11
  readonly header: CacheTagHeader | undefined;
9
12
  /** Whether the tags are filed under the tenant of the request (`cacheTags.perTenant`). */
@@ -1 +1 @@
1
- {"version":3,"file":"tagged-answer.d.ts","sourceRoot":"","sources":["../../src/pipeline/tagged-answer.ts"],"names":[],"mappings":"AAC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AAO,EAAE,OAAO,GAAG,aAAa,CAqBrF"}
@@ -19,7 +19,7 @@ export function taggedAnswer(response, tagging) {
19
19
  if (perTenant && parts.tenantId === undefined) {
20
20
  return { ...response, headers: { ...response.headers, 'cache-control': CacheScope.noStore } };
21
21
  }
22
- const tags = cacheTagsOf(cache.tags, { ...parts, body: response.body });
22
+ const tags = cacheTagsOf(cache.tags, parts);
23
23
  if (tags.length === 0) {
24
24
  return response;
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tagged-answer.js","sourceRoot":"","sources":["../../src/pipeline/tagged-answer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AAWnE,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,eAAe,GAA8B,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;AAEpG;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,QAAuB,EAAE,OAAgB;IACpE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IACvD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAExB,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE,KAAK,KAAK,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,QAAQ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GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IACvD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAExB,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE,KAAK,KAAK,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;IAChG,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE5C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAE/D,OAAO,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;AAC3F,CAAC;AAED,SAAS,SAAS,CAAC,EAAE,MAAM,EAAiB;IAC1C,OAAO,MAAM,IAAI,YAAY,IAAI,MAAM,IAAI,UAAU,CAAC;AACxD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Writable } from 'node:stream';
2
+ /**
3
+ * Writes the chunks of a streamed list to a response, waiting for the client when it reads slower
4
+ * than the list is produced, and stops reading the list when the client leaves. A failure once
5
+ * the status is sent can only cut the response short: the connection is closed.
6
+ */
7
+ export declare function writeStream(target: Writable, chunks: AsyncIterable<string>): Promise<void>;
8
+ //# sourceMappingURL=write-stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-stream.d.ts","sourceRoot":"","sources":["../../src/pipeline/write-stream.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhG"}
@@ -0,0 +1,23 @@
1
+ import { once } from 'node:events';
2
+ /**
3
+ * Writes the chunks of a streamed list to a response, waiting for the client when it reads slower
4
+ * than the list is produced, and stops reading the list when the client leaves. A failure once
5
+ * the status is sent can only cut the response short: the connection is closed.
6
+ */
7
+ export async function writeStream(target, chunks) {
8
+ try {
9
+ for await (const chunk of chunks) {
10
+ if (target.destroyed) {
11
+ return;
12
+ }
13
+ if (!target.write(chunk)) {
14
+ await Promise.race([once(target, 'drain'), once(target, 'close')]);
15
+ }
16
+ }
17
+ target.end();
18
+ }
19
+ catch (error) {
20
+ target.destroy(error instanceof Error ? error : undefined);
21
+ }
22
+ }
23
+ //# sourceMappingURL=write-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-stream.js","sourceRoot":"","sources":["../../src/pipeline/write-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAgB,EAAE,MAA6B;IAC/E,IAAI,CAAC;QACH,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACjC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,OAAO;YACT,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,MAAM,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { BodyShape } from '../representation/body-shape.js';
2
+ import type { Chosen } from '../representation/representations.js';
3
+ import type { RepresentedAnswer } from './represented-answer.js';
4
+ /**
5
+ * A value in the representation chosen for it: bytes at once, or chunks for a streamed list. A
6
+ * value answered in the JSON of the kit stays the value, which the adapter writes as JSON as it
7
+ * always did, and which a spec calling `executeRoute` reads as it is.
8
+ */
9
+ export declare function writtenIn(value: unknown, chosen: Chosen, shape: BodyShape): RepresentedAnswer;
10
+ //# sourceMappingURL=written-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"written-in.d.ts","sourceRoot":"","sources":["../../src/pipeline/written-in.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAU7F"}
@@ -0,0 +1,17 @@
1
+ import { JsonRepresentation } from '../representation/json-representation.js';
2
+ import { isAsyncIterable } from '../support/is-async-iterable.js';
3
+ const encoder = new TextEncoder();
4
+ /**
5
+ * A value in the representation chosen for it: bytes at once, or chunks for a streamed list. A
6
+ * value answered in the JSON of the kit stays the value, which the adapter writes as JSON as it
7
+ * always did, and which a spec calling `executeRoute` reads as it is.
8
+ */
9
+ export function writtenIn(value, chosen, shape) {
10
+ const headers = { 'content-type': `${chosen.mediaType}; charset=utf-8` };
11
+ if (chosen.representation instanceof JsonRepresentation && !isAsyncIterable(value)) {
12
+ return { headers, body: value };
13
+ }
14
+ const written = chosen.representation.write(value, shape);
15
+ return typeof written === 'string' ? { headers, body: encoder.encode(written) } : { headers, stream: written };
16
+ }
17
+ //# sourceMappingURL=written-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"written-in.js","sourceRoot":"","sources":["../../src/pipeline/written-in.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,MAAc,EAAE,KAAgB;IACxE,MAAM,OAAO,GAAG,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,iBAAiB,EAAE,CAAC;IAEzE,IAAI,MAAM,CAAC,cAAc,YAAY,kBAAkB,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QACnF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAE1D,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACjH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Route } from '../route/route.js';
2
+ import type { Representations } from './representations.js';
3
+ /**
4
+ * Refuses, when the routes are mounted, what the platform cannot serve: a media type no
5
+ * representation provides, a body one cannot write or read, and any `produces` or `consumes`
6
+ * when no representations are mounted, since the server would then answer JSON only while the
7
+ * route and its contract promise more.
8
+ */
9
+ export declare function assertServed(routes: readonly Route[], representations: Representations | undefined): void;
10
+ //# sourceMappingURL=assert-served.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-served.d.ts","sourceRoot":"","sources":["../../src/representation/assert-served.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,eAAe,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAczG"}
@@ -0,0 +1,18 @@
1
+ import { DeclarationError } from '@ddd-ts-kit/kernel/declarations';
2
+ /**
3
+ * Refuses, when the routes are mounted, what the platform cannot serve: a media type no
4
+ * representation provides, a body one cannot write or read, and any `produces` or `consumes`
5
+ * when no representations are mounted, since the server would then answer JSON only while the
6
+ * route and its contract promise more.
7
+ */
8
+ export function assertServed(routes, representations) {
9
+ if (representations !== undefined) {
10
+ representations.assertServes(routes);
11
+ return;
12
+ }
13
+ const declaring = routes.find(({ produces, consumes }) => [...(produces ?? []), ...(consumes ?? [])].length > 0);
14
+ if (declaring !== undefined) {
15
+ throw new DeclarationError(`Route "${declaring.operationId}" declares produces or consumes, and no representations are mounted: pass \`representations\` (Representations.standard()) in the mount options.`);
16
+ }
17
+ }
18
+ //# sourceMappingURL=assert-served.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-served.js","sourceRoot":"","sources":["../../src/representation/assert-served.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAwB,EAAE,eAA4C;IACjG,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAErC,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEjH,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,gBAAgB,CACxB,UAAU,SAAS,CAAC,WAAW,kJAAkJ,CAClL,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { JsonSchema } from '@ddd-ts-kit/validation';
2
+ /** What a representation knows of the body it writes or reads: the schema the route declares, and the name of its root. */
3
+ export interface BodyShape {
4
+ /** The JSON Schema of the body, with its own `$defs`, as the schema of the route gives it. */
5
+ readonly schema: JsonSchema;
6
+ /** The operation id of the route, or `problem`: the root element of XML, unless the schema names it. */
7
+ readonly name: string;
8
+ }
9
+ //# sourceMappingURL=body-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-shape.d.ts","sourceRoot":"","sources":["../../src/representation/body-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,2HAA2H;AAC3H,MAAM,WAAW,SAAS;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,wGAAwG;IACxG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=body-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-shape.js","sourceRoot":"","sources":["../../src/representation/body-shape.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * One cell of RFC 4180: the text of the scalar by the rules of every representation, quoted when
3
+ * it holds a quote, a comma, a line break or surrounding spaces. A text that a spreadsheet would
4
+ * run as a formula is prefixed with an apostrophe; a number never is, nor a decimal written as
5
+ * text (`-12.50`).
6
+ */
7
+ export declare function csvCell(value: unknown): string;
8
+ //# sourceMappingURL=csv-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv-cell.d.ts","sourceRoot":"","sources":["../../../src/representation/csv/csv-cell.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM9C"}
@@ -0,0 +1,19 @@
1
+ import { wireText } from '../wire-text.js';
2
+ const NEEDS_QUOTES = /[",\r\n]|^\s|\s$/;
3
+ /** What a spreadsheet would run as a formula when the cell starts with it (CSV injection). */
4
+ const FORMULA_START = /^[=+\-@\t\r]/;
5
+ /** A decimal written as text, a negative amount of money among them: a number, which no spreadsheet runs. */
6
+ const PLAIN_DECIMAL = /^[+-]?\d+(?:\.\d+)?$/;
7
+ /**
8
+ * One cell of RFC 4180: the text of the scalar by the rules of every representation, quoted when
9
+ * it holds a quote, a comma, a line break or surrounding spaces. A text that a spreadsheet would
10
+ * run as a formula is prefixed with an apostrophe; a number never is, nor a decimal written as
11
+ * text (`-12.50`).
12
+ */
13
+ export function csvCell(value) {
14
+ const text = wireText(value) ?? '';
15
+ const formula = typeof value === 'string' && FORMULA_START.test(text) && !PLAIN_DECIMAL.test(text);
16
+ const safe = formula ? `'${text}` : text;
17
+ return NEEDS_QUOTES.test(safe) ? `"${safe.replaceAll('"', '""')}"` : safe;
18
+ }
19
+ //# sourceMappingURL=csv-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv-cell.js","sourceRoot":"","sources":["../../../src/representation/csv/csv-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC,8FAA8F;AAC9F,MAAM,aAAa,GAAG,cAAc,CAAC;AACrC,6GAA6G;AAC7G,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnG,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { BodyShape } from '../body-shape.js';
2
+ import type { RepresentedBody } from '../represented-body.js';
3
+ import type { Representation } from '../representation.js';
4
+ /**
5
+ * `text/csv` for a list of flat rows: a page (its `items`), a list, or a list streamed as it is
6
+ * read. One header line with the names of the properties of a row, in the order of the schema,
7
+ * then one line per row, written one at a time. A body whose rows hold a list or an object is
8
+ * refused when the routes are mounted: CSV has no way to say it. Never read.
9
+ */
10
+ export declare class CsvRepresentation implements Representation {
11
+ readonly mediaType = "text/csv";
12
+ readonly problemMediaType: undefined;
13
+ write(body: unknown, shape: BodyShape): RepresentedBody;
14
+ refuses(shape: BodyShape): string | undefined;
15
+ }
16
+ //# sourceMappingURL=csv-representation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv-representation.d.ts","sourceRoot":"","sources":["../../../src/representation/csv/csv-representation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACtD,QAAQ,CAAC,SAAS,cAAc;IAEhC,QAAQ,CAAC,gBAAgB,YAAa;IAEtC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GAAG,eAAe,CAEtD;IAED,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAU5C;CACF"}
@@ -0,0 +1,54 @@
1
+ import { SchemaNode } from '../../schema/schema-node.js';
2
+ import { isAsyncIterable } from '../../support/is-async-iterable.js';
3
+ import { isRecord } from '../../support/is-record.js';
4
+ import { csvCell } from './csv-cell.js';
5
+ const LINE_END = '\r\n';
6
+ /**
7
+ * `text/csv` for a list of flat rows: a page (its `items`), a list, or a list streamed as it is
8
+ * read. One header line with the names of the properties of a row, in the order of the schema,
9
+ * then one line per row, written one at a time. A body whose rows hold a list or an object is
10
+ * refused when the routes are mounted: CSV has no way to say it. Never read.
11
+ */
12
+ export class CsvRepresentation {
13
+ mediaType = 'text/csv';
14
+ problemMediaType = undefined;
15
+ write(body, shape) {
16
+ return lines(rowsOf(body), columnsOf(rowNode(shape)));
17
+ }
18
+ refuses(shape) {
19
+ const row = rowNode(shape);
20
+ if (row === undefined) {
21
+ return 'the body is no list and no page of items';
22
+ }
23
+ const nested = row.properties().find(([, node]) => !node.isScalar());
24
+ return nested === undefined ? undefined : `the column "${nested[0]}" holds a list or an object`;
25
+ }
26
+ }
27
+ /** The schema of one row: the items of a list, or of the `items` of a page. */
28
+ function rowNode(shape) {
29
+ const node = SchemaNode.of(shape.schema);
30
+ if (node.type() === 'array') {
31
+ return node.items();
32
+ }
33
+ const items = node.properties().find(([name]) => name === 'items')?.[1];
34
+ return items?.type() === 'array' ? items.items() : undefined;
35
+ }
36
+ function columnsOf(row) {
37
+ return (row?.properties() ?? []).map(([name]) => name);
38
+ }
39
+ async function* rowsOf(body) {
40
+ if (isAsyncIterable(body)) {
41
+ yield* body;
42
+ return;
43
+ }
44
+ const rows = isRecord(body) ? body['items'] : body;
45
+ yield* Array.isArray(rows) ? rows : [];
46
+ }
47
+ async function* lines(rows, columns) {
48
+ yield `${columns.map((column) => csvCell(column)).join(',')}${LINE_END}`;
49
+ for await (const row of rows) {
50
+ const record = isRecord(row) ? row : {};
51
+ yield `${columns.map((column) => csvCell(record[column])).join(',')}${LINE_END}`;
52
+ }
53
+ }
54
+ //# sourceMappingURL=csv-representation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv-representation.js","sourceRoot":"","sources":["../../../src/representation/csv/csv-representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAItD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACnB,SAAS,GAAG,UAAU,CAAC;IAEvB,gBAAgB,GAAG,SAAS,CAAC;IAEtC,KAAK,CAAC,IAAa,EAAE,KAAgB;QACnC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,C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IAAa;IAClC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,CAAC,IAAI,CAAC;QAEZ,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAY,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE5D,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAED,KAAK,SAAS,CAAC,CAAC,KAAK,CAAC,IAA4B,EAAE,OAA0B;IAC5E,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC;IAEzE,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAExC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC;IACnF,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** `application/json` and every `+json` suffix, which the JSON body parser of a framework already read. */
2
+ export declare function isJsonMediaType(mediaType: string): boolean;
3
+ //# sourceMappingURL=is-json-media-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-json-media-type.d.ts","sourceRoot":"","sources":["../../src/representation/is-json-media-type.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE1D"}
@@ -0,0 +1,5 @@
1
+ /** `application/json` and every `+json` suffix, which the JSON body parser of a framework already read. */
2
+ export function isJsonMediaType(mediaType) {
3
+ return mediaType === 'application/json' || mediaType.endsWith('+json');
4
+ }
5
+ //# sourceMappingURL=is-json-media-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-json-media-type.js","sourceRoot":"","sources":["../../src/representation/is-json-media-type.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,SAAS,KAAK,kBAAkB,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { RepresentedBody } from './represented-body.js';
2
+ import type { Representation } from './representation.js';
3
+ /**
4
+ * `application/json`, the default of every route: the value as `JSON.stringify` writes it, an
5
+ * instant in ISO 8601 UTC, a big integer as a string. A streamed list is written as one array,
6
+ * an item at a time.
7
+ */
8
+ export declare class JsonRepresentation implements Representation {
9
+ readonly mediaType = "application/json";
10
+ readonly problemMediaType = "application/problem+json";
11
+ write(body: unknown): RepresentedBody;
12
+ read(text: string): unknown;
13
+ }
14
+ //# sourceMappingURL=json-representation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-representation.d.ts","sourceRoot":"","sources":["../../src/representation/json-representation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,QAAQ,CAAC,SAAS,sBAAc;IAEhC,QAAQ,CAAC,gBAAgB,8BAA8B;IAEvD,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAEpC;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM1B;CACF"}
@@ -0,0 +1,40 @@
1
+ import { isAsyncIterable } from '../support/is-async-iterable.js';
2
+ import { malformedBody } from './malformed-body.js';
3
+ const MEDIA_TYPE = 'application/json';
4
+ /**
5
+ * `application/json`, the default of every route: the value as `JSON.stringify` writes it, an
6
+ * instant in ISO 8601 UTC, a big integer as a string. A streamed list is written as one array,
7
+ * an item at a time.
8
+ */
9
+ export class JsonRepresentation {
10
+ mediaType = MEDIA_TYPE;
11
+ problemMediaType = 'application/problem+json';
12
+ write(body) {
13
+ return isAsyncIterable(body) ? jsonArray(body) : stringified(body);
14
+ }
15
+ read(text) {
16
+ try {
17
+ return JSON.parse(text);
18
+ }
19
+ catch {
20
+ throw malformedBody(MEDIA_TYPE);
21
+ }
22
+ }
23
+ }
24
+ async function* jsonArray(items) {
25
+ let separator = '';
26
+ yield '[';
27
+ for await (const item of items) {
28
+ yield `${separator}${stringified(item)}`;
29
+ separator = ',';
30
+ }
31
+ yield ']';
32
+ }
33
+ function stringified(value) {
34
+ // An item of an array that is undefined is written null, as `JSON.stringify` writes it inside an array.
35
+ if (value === undefined) {
36
+ return 'null';
37
+ }
38
+ return JSON.stringify(value, (_key, part) => (typeof part === 'bigint' ? part.toString() : part));
39
+ }
40
+ //# sourceMappingURL=json-representation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-representation.js","sourceRoot":"","sources":["../../src/representation/json-representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACpB,SAAS,GAAG,UAAU,CAAC;IAEvB,gBAAgB,GAAG,0BAA0B,CAAC;IAEvD,KAAK,CAAC,IAAa;QACjB,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAC,IAAY;QACf,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,aAAa,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF;AAED,KAAK,SAAS,CAAC,CAAC,SAAS,CAAC,KAA6B;IACrD,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,MAAM,GAAG,CAAC;IAEV,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC/B,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,SAAS,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,MAAM,GAAG,CAAC;AACZ,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,wGAAwG;IACxG,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAa,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7G,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ValidationError } from '@ddd-ts-kit/validation';
2
+ /** A request body that cannot be read in its media type: answered as an invalid request, without quoting it. */
3
+ export declare function malformedBody(mediaType: string): ValidationError;
4
+ //# sourceMappingURL=malformed-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"malformed-body.d.ts","sourceRoot":"","sources":["../../src/representation/malformed-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,gHAAgH;AAChH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAKhE"}
@@ -0,0 +1,6 @@
1
+ import { ValidationError } from '@ddd-ts-kit/validation';
2
+ /** A request body that cannot be read in its media type: answered as an invalid request, without quoting it. */
3
+ export function malformedBody(mediaType) {
4
+ return new ValidationError([{ path: 'body', code: 'malformed', message: `The body is not well-formed ${mediaType}.` }], 'The request is not valid.');
5
+ }
6
+ //# sourceMappingURL=malformed-body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"malformed-body.js","sourceRoot":"","sources":["../../src/representation/malformed-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,gHAAgH;AAChH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,OAAO,IAAI,eAAe,CACxB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,+BAA+B,SAAS,GAAG,EAAE,CAAC,EAC3F,2BAA2B,CAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The media type of a `Content-Type` header, in lower case and without its parameters. */
2
+ export declare function mediaTypeOf(header: string | string[] | undefined): string | undefined;
3
+ //# sourceMappingURL=media-type-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-type-of.d.ts","sourceRoot":"","sources":["../../src/representation/media-type-of.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKrF"}
@@ -0,0 +1,7 @@
1
+ /** The media type of a `Content-Type` header, in lower case and without its parameters. */
2
+ export function mediaTypeOf(header) {
3
+ const value = Array.isArray(header) ? header[0] : header;
4
+ const mediaType = value?.split(';')[0]?.trim().toLowerCase();
5
+ return mediaType === undefined || mediaType === '' ? undefined : mediaType;
6
+ }
7
+ //# sourceMappingURL=media-type-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-type-of.js","sourceRoot":"","sources":["../../src/representation/media-type-of.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,UAAU,WAAW,CAAC,MAAqC;IAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACzD,MAAM,SAAS,GAAG,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE7D,OAAO,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The media type to answer in, among those the route offers in its order of preference, for an
3
+ * `Accept` header (RFC 9110, 12.5.1): the offer of highest quality, the most specific range of the
4
+ * header deciding the quality of each offer, the order of the offers breaking ties. Without the
5
+ * header, the first offer; `undefined` when the header accepts none of them.
6
+ */
7
+ export declare function negotiate(accept: string | undefined, offered: readonly string[]): string | undefined;
8
+ //# sourceMappingURL=negotiate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"negotiate.d.ts","sourceRoot":"","sources":["../../src/representation/negotiate.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAiBpG"}
@@ -0,0 +1,55 @@
1
+ const NOT_ACCEPTABLE = 0;
2
+ const EXACT = 2;
3
+ const SAME_TYPE = 1;
4
+ /**
5
+ * The media type to answer in, among those the route offers in its order of preference, for an
6
+ * `Accept` header (RFC 9110, 12.5.1): the offer of highest quality, the most specific range of the
7
+ * header deciding the quality of each offer, the order of the offers breaking ties. Without the
8
+ * header, the first offer; `undefined` when the header accepts none of them.
9
+ */
10
+ export function negotiate(accept, offered) {
11
+ if (accept === undefined || accept.trim() === '') {
12
+ return offered[0];
13
+ }
14
+ const ranges = accept.split(',').flatMap(mediaRangeOf);
15
+ let chosen;
16
+ for (const offer of offered) {
17
+ const quality = qualityOf(offer, ranges);
18
+ if (quality > NOT_ACCEPTABLE && quality > (chosen?.quality ?? NOT_ACCEPTABLE)) {
19
+ chosen = { offer, quality };
20
+ }
21
+ }
22
+ return chosen?.offer;
23
+ }
24
+ function mediaRangeOf(text) {
25
+ const [range = '', ...parameters] = text.split(';').map((part) => part.trim().toLowerCase());
26
+ const [type, subtype] = range.split('/');
27
+ if (type === undefined || type === '' || subtype === undefined || subtype === '') {
28
+ return [];
29
+ }
30
+ const weight = parameters.find((parameter) => parameter.startsWith('q='));
31
+ const quality = weight === undefined ? 1 : Number(weight.slice(2));
32
+ return [{ type, subtype, quality: Number.isFinite(quality) ? quality : NOT_ACCEPTABLE }];
33
+ }
34
+ /** The quality the most specific matching range gives the offer; 0 when none matches. */
35
+ function qualityOf(offer, ranges) {
36
+ const [type = '', subtype = ''] = offer.toLowerCase().split('/');
37
+ let best;
38
+ for (const range of ranges) {
39
+ const specificity = specificityOf(range, { type, subtype });
40
+ if (specificity !== undefined && specificity > (best?.specificity ?? -1)) {
41
+ best = { specificity, quality: range.quality };
42
+ }
43
+ }
44
+ return best?.quality ?? NOT_ACCEPTABLE;
45
+ }
46
+ function specificityOf(range, offer) {
47
+ if (range.type === offer.type && range.subtype === offer.subtype) {
48
+ return EXACT;
49
+ }
50
+ if (range.type === offer.type && range.subtype === '*') {
51
+ return SAME_TYPE;
52
+ }
53
+ return range.type === '*' && range.subtype === '*' ? 0 : undefined;
54
+ }
55
+ //# sourceMappingURL=negotiate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"negotiate.js","sourceR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AC,IAAI,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;QACjE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,KAAK,GAAG,EAAE,CAAC;QACvD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { DomainError } from '@ddd-ts-kit/kernel';
2
+ export declare const NOT_ACCEPTABLE = "NOT_ACCEPTABLE";
3
+ /** The `Accept` header of the request names no media type the route answers in: 406. */
4
+ export declare class NotAcceptableError extends DomainError {
5
+ readonly code = "NOT_ACCEPTABLE";
6
+ }
7
+ //# sourceMappingURL=not-acceptable-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-acceptable-error.d.ts","sourceRoot":"","sources":["../../src/representation/not-acceptable-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,wFAAwF;AACxF,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,oBAAkB;CAChC"}
@@ -0,0 +1,7 @@
1
+ import { DomainError } from '@ddd-ts-kit/kernel';
2
+ export const NOT_ACCEPTABLE = 'NOT_ACCEPTABLE';
3
+ /** The `Accept` header of the request names no media type the route answers in: 406. */
4
+ export class NotAcceptableError extends DomainError {
5
+ code = NOT_ACCEPTABLE;
6
+ }
7
+ //# sourceMappingURL=not-acceptable-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-acceptable-error.js","sourceRoot":"","sources":["../../src/representation/not-acceptable-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,wFAAwF;AACxF,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACxC,IAAI,GAAG,cAAc,CAAC;CAChC"}
@@ -0,0 +1,4 @@
1
+ import type { BodyShape } from './body-shape.js';
2
+ /** A refusal in any representation: the problem of RFC 9457, whose XML form is `<problem xmlns="urn:ietf:rfc:7807">`. */
3
+ export declare const PROBLEM_SHAPE: BodyShape;
4
+ //# sourceMappingURL=problem-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"problem-shape.d.ts","sourceRoot":"","sources":["../../src/representation/problem-shape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,yHAAyH;AACzH,eAAO,MAAM,aAAa,EAAE,SAG3B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { PROBLEM_SCHEMA } from '../openapi/problem-schema.js';
2
+ /** A refusal in any representation: the problem of RFC 9457, whose XML form is `<problem xmlns="urn:ietf:rfc:7807">`. */
3
+ export const PROBLEM_SHAPE = {
4
+ schema: { ...PROBLEM_SCHEMA, xml: { name: 'problem', namespace: 'urn:ietf:rfc:7807' } },
5
+ name: 'problem',
6
+ };
7
+ //# sourceMappingURL=problem-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"problem-shape.js","sourceRoot":"","sources":["../../src/representation/problem-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,yHAAyH;AACzH,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,EAAE;IACvF,IAAI,EAAE,SAAS;CAChB,CAAC"}