@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,92 @@
1
+ import { isRecord } from '../support/is-record.js';
2
+ const SCALAR_TYPES = ['string', 'number', 'integer', 'boolean'];
3
+ const SCHEMA_TYPES = new Set([...SCALAR_TYPES, 'object', 'array', 'null']);
4
+ const LOCAL_REFERENCE = /^#\/(?:\$defs|definitions|components\/schemas)\/(.+)$/;
5
+ const MAX_REFERENCES = 32;
6
+ /**
7
+ * One node of a JSON Schema, read with the definitions of the document it belongs to: what the
8
+ * representations and the forms ask of a response or a request schema, whatever library wrote it.
9
+ */
10
+ export class SchemaNode {
11
+ node;
12
+ root;
13
+ constructor(node, root) {
14
+ this.node = node;
15
+ this.root = root;
16
+ }
17
+ static of(root) {
18
+ return new SchemaNode(root, root).resolved();
19
+ }
20
+ /** The node a `$ref` points to, and the first alternative of `anyOf` or `oneOf` that is not `null`. */
21
+ resolved(hops = 0) {
22
+ const next = hops < MAX_REFERENCES ? this.step() : undefined;
23
+ return next === undefined ? this : next.resolved(hops + 1);
24
+ }
25
+ type() {
26
+ const { type } = this.node;
27
+ const declared = Array.isArray(type) ? type.find((candidate) => candidate !== 'null') : type;
28
+ if (typeof declared === 'string') {
29
+ return isSchemaType(declared) ? declared : undefined;
30
+ }
31
+ if (isRecord(this.node['properties'])) {
32
+ return 'object';
33
+ }
34
+ return this.node['items'] === undefined ? undefined : 'array';
35
+ }
36
+ isScalar() {
37
+ const type = this.type();
38
+ return type === undefined || SCALAR_TYPES.includes(type) || this.node['enum'] !== undefined;
39
+ }
40
+ properties() {
41
+ const { properties } = this.node;
42
+ if (!isRecord(properties)) {
43
+ return [];
44
+ }
45
+ return Object.entries(properties).map(([name, node]) => [name, this.child(node)]);
46
+ }
47
+ required() {
48
+ const { required } = this.node;
49
+ return Array.isArray(required) ? required.filter((name) => typeof name === 'string') : [];
50
+ }
51
+ items() {
52
+ return this.child(this.node['items']);
53
+ }
54
+ xml() {
55
+ const { xml } = this.node;
56
+ if (!isRecord(xml)) {
57
+ return {};
58
+ }
59
+ return {
60
+ ...(typeof xml['name'] === 'string' ? { name: xml['name'] } : {}),
61
+ ...(xml['attribute'] === true ? { attribute: true } : {}),
62
+ ...(xml['wrapped'] === true ? { wrapped: true } : {}),
63
+ ...(typeof xml['namespace'] === 'string' ? { namespace: xml['namespace'] } : {}),
64
+ };
65
+ }
66
+ child(node) {
67
+ return new SchemaNode(isRecord(node) ? node : {}, this.root).resolved();
68
+ }
69
+ step() {
70
+ const reference = this.node['$ref'];
71
+ if (typeof reference === 'string') {
72
+ return new SchemaNode(this.definition(reference), this.root);
73
+ }
74
+ const alternatives = this.node['anyOf'] ?? this.node['oneOf'];
75
+ if (!Array.isArray(alternatives)) {
76
+ return undefined;
77
+ }
78
+ const chosen = alternatives.find((alternative) => isRecord(alternative) && alternative['type'] !== 'null');
79
+ return isRecord(chosen) ? new SchemaNode(chosen, this.root) : undefined;
80
+ }
81
+ definition(reference) {
82
+ const name = LOCAL_REFERENCE.exec(reference)?.[1] ?? '';
83
+ const found = [this.root['$defs'], this.root['definitions']]
84
+ .map((definitions) => (isRecord(definitions) ? definitions[name] : undefined))
85
+ .find(isRecord);
86
+ return found ?? {};
87
+ }
88
+ }
89
+ function isSchemaType(value) {
90
+ return SCHEMA_TYPES.has(value);
91
+ }
92
+ //# sourceMappingURL=schema-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-node.js","sourceRoot":"","sources":["../../src/schema/schema-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,MAAM,YAAY,GAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACvF,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,MAAM,eAAe,GAAG,uDAAuD,CAAC;AAChF,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,UAAU;IAEV,IAAI;IACI,IAAI;IAFvB,YACW,IAAgB,EACR,IAAgB;oBADxB,IAAI;oBACI,IAAI;IACpB,CAAC;IAEJ,MAAM,CAAC,EAAE,CAAC,IAAgB;QACxB,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC/C,CAAC;IAED,uGAAuG;IACvG,QAAQ,CAAC,IAAI,GAAG,CAAC;QACf,MAAM,IAAI,GAAG,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAE7D,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,MAAM,QAAQ,GAAY,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IA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C,KAAa;IACjC,OAAO,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The types of JSON Schema, as a node declares them. */
2
+ export type SchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
3
+ //# sourceMappingURL=schema-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-type.d.ts","sourceRoot":"","sources":["../../src/schema/schema-type.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-type.js","sourceRoot":"","sources":["../../src/schema/schema-type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ /** The XML object of OpenAPI on a schema node: what renames an element, makes a scalar an attribute or wraps a list. */
2
+ export interface XmlHints {
3
+ readonly name?: string;
4
+ readonly attribute?: boolean;
5
+ readonly wrapped?: boolean;
6
+ /** The default namespace declared on the element, read on the root only. */
7
+ readonly namespace?: string;
8
+ }
9
+ //# sourceMappingURL=xml-hints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml-hints.d.ts","sourceRoot":"","sources":["../../src/schema/xml-hints.ts"],"names":[],"mappings":"AAAA,wHAAwH;AACxH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=xml-hints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml-hints.js","sourceRoot":"","sources":["../../src/schema/xml-hints.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { type Schema } from '@ddd-ts-kit/validation';
2
+ import type { Accepted } from './accepted.js';
3
+ /**
4
+ * The body every command route answers with, shared by the platform: one `Accepted` component in
5
+ * the contract, referenced by each route instead of a copy of `{ id }` per route.
6
+ */
7
+ export declare const acceptedSchema: Schema<Accepted>;
8
+ //# sourceMappingURL=accepted-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accepted-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/accepted-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,MAAM,EAAwB,MAAM,wBAAwB,CAAC;AAEvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,QAAQ,CAQ3C,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { err, ok } from '@ddd-ts-kit/kernel';
2
+ import { customSchema, sharedSchema } from '@ddd-ts-kit/validation';
3
+ import { isRecord } from '../support/is-record.js';
4
+ /**
5
+ * The body every command route answers with, shared by the platform: one `Accepted` component in
6
+ * the contract, referenced by each route instead of a copy of `{ id }` per route.
7
+ */
8
+ export const acceptedSchema = sharedSchema('Accepted', customSchema(parseAccepted, {
9
+ type: 'object',
10
+ required: ['id'],
11
+ properties: { id: { type: 'string', description: 'The identifier of what the command created or changed.' } },
12
+ additionalProperties: false,
13
+ }));
14
+ function parseAccepted(input) {
15
+ if (isRecord(input) && typeof input['id'] === 'string') {
16
+ return ok({ id: input['id'] });
17
+ }
18
+ return err([{ path: 'id', code: 'invalid_type', message: 'An identifier is expected.' }]);
19
+ }
20
+ //# sourceMappingURL=accepted-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accepted-schema.js","sourceRoot":"","sources":["../../src/schemas/accepted-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAqC,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqB,YAAY,CAC1D,UAAU,EACV,YAAY,CAAC,aAAa,EAAE;IAC1B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,IAAI,CAAC;IAChB,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wDAAwD,EAAE,EAAE;IAC7G,oBAAoB,EAAE,KAAK;CAC5B,CAAC,CACH,CAAC;AAEF,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;QACvD,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC,CAAC,CAAC;AAC5F,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** The answer of a command route: the identifier of what it created or changed. */
2
+ export interface Accepted {
3
+ id: string;
4
+ }
5
+ //# sourceMappingURL=accepted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accepted.d.ts","sourceRoot":"","sources":["../../src/schemas/accepted.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;CACZ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=accepted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accepted.js","sourceRoot":"","sources":["../../src/schemas/accepted.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A decimal as the text every representation carries, never a binary number a client would
3
+ * round: `'12.30'`. A number is accepted when JavaScript writes it without an exponent.
4
+ */
5
+ export declare function decimalText(value: string | number | bigint): string;
6
+ //# sourceMappingURL=decimal-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimal-text.d.ts","sourceRoot":"","sources":["../../src/serialization/decimal-text.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAQnE"}
@@ -0,0 +1,13 @@
1
+ const DECIMAL = /^-?(?:0|[1-9]\d*)(?:\.\d+)?$/;
2
+ /**
3
+ * A decimal as the text every representation carries, never a binary number a client would
4
+ * round: `'12.30'`. A number is accepted when JavaScript writes it without an exponent.
5
+ */
6
+ export function decimalText(value) {
7
+ const text = typeof value === 'string' ? value : String(value);
8
+ if (!DECIMAL.test(text)) {
9
+ throw new RangeError(`"${text}" is not a decimal written in full.`);
10
+ }
11
+ return text;
12
+ }
13
+ //# sourceMappingURL=decimal-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimal-text.js","sourceRoot":"","sources":["../../src/serialization/decimal-text.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAA+B;IACzD,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE/D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,UAAU,CAAC,IAAI,IAAI,qCAAqC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** An amount of money in a body: the decimal as text, with the ISO 4217 code of its currency. */
2
+ export interface MoneyBody {
3
+ readonly amount: string;
4
+ readonly currency: string;
5
+ }
6
+ //# sourceMappingURL=money-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money-body.d.ts","sourceRoot":"","sources":["../../src/serialization/money-body.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=money-body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money-body.js","sourceRoot":"","sources":["../../src/serialization/money-body.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { MoneyBody } from './money-body.js';
2
+ /** `money('12.30', 'EUR')` is `{ amount: '12.30', currency: 'EUR' }`: never an amount without its currency, never a float. */
3
+ export declare function money(amount: string | number | bigint, currency: string): MoneyBody;
4
+ //# sourceMappingURL=money.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../src/serialization/money.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,8HAA8H;AAC9H,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAMnF"}
@@ -0,0 +1,10 @@
1
+ import { decimalText } from './decimal-text.js';
2
+ const CURRENCY = /^[A-Z]{3}$/;
3
+ /** `money('12.30', 'EUR')` is `{ amount: '12.30', currency: 'EUR' }`: never an amount without its currency, never a float. */
4
+ export function money(amount, currency) {
5
+ if (!CURRENCY.test(currency)) {
6
+ throw new RangeError(`"${currency}" is not an ISO 4217 currency code.`);
7
+ }
8
+ return { amount: decimalText(amount), currency };
9
+ }
10
+ //# sourceMappingURL=money.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money.js","sourceRoot":"","sources":["../../src/serialization/money.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,QAAQ,GAAG,YAAY,CAAC;AAE9B,8HAA8H;AAC9H,MAAM,UAAU,KAAK,CAAC,MAAgC,EAAE,QAAgB;IACtE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,IAAI,QAAQ,qCAAqC,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;AACnD,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** A list read as it comes (a cursor, a stream of rows), which a representation writes chunk by chunk. */
2
+ export declare function isAsyncIterable(value: unknown): value is AsyncIterable<unknown>;
3
+ //# sourceMappingURL=is-async-iterable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-async-iterable.d.ts","sourceRoot":"","sources":["../../src/support/is-async-iterable.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAE/E"}
@@ -0,0 +1,5 @@
1
+ /** A list read as it comes (a cursor, a stream of rows), which a representation writes chunk by chunk. */
2
+ export function isAsyncIterable(value) {
3
+ return typeof value === 'object' && value !== null && Symbol.asyncIterator in value;
4
+ }
5
+ //# sourceMappingURL=is-async-iterable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-async-iterable.js","sourceRoot":"","sources":["../../src/support/is-async-iterable.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,aAAa,IAAI,KAAK,CAAC;AACtF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ddd-ts-kit/http",
3
- "version": "0.12.0",
4
- "description": "Framework-agnostic route definitions with Express, Fastify and NestJS adapters and OpenAPI 3.1 generation.",
3
+ "version": "0.14.0",
4
+ "description": "Framework-agnostic route definitions with Express, Fastify, Hono and NestJS adapters and OpenAPI 3.1 generation.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,6 +29,10 @@
29
29
  "types": "./dist/fastify.d.ts",
30
30
  "default": "./dist/fastify.js"
31
31
  },
32
+ "./hono": {
33
+ "types": "./dist/hono.d.ts",
34
+ "default": "./dist/hono.js"
35
+ },
32
36
  "./nest": {
33
37
  "types": "./dist/nest.d.ts",
34
38
  "default": "./dist/nest.js"
@@ -54,14 +58,15 @@
54
58
  "dist"
55
59
  ],
56
60
  "dependencies": {
57
- "@ddd-ts-kit/kernel": "0.12.0",
58
- "@ddd-ts-kit/validation": "0.12.0"
61
+ "@ddd-ts-kit/kernel": "0.14.0",
62
+ "@ddd-ts-kit/validation": "0.14.0"
59
63
  },
60
64
  "peerDependencies": {
61
65
  "@nestjs/common": ">=11.0.0",
62
66
  "@nestjs/core": ">=11.0.0",
63
67
  "express": "^5.0.0",
64
68
  "fastify": "^5.0.0",
69
+ "hono": "^4.0.0",
65
70
  "busboy": "^1.6.0"
66
71
  },
67
72
  "peerDependenciesMeta": {
@@ -77,12 +82,16 @@
77
82
  "@nestjs/core": {
78
83
  "optional": true
79
84
  },
85
+ "hono": {
86
+ "optional": true
87
+ },
80
88
  "busboy": {
81
89
  "optional": true
82
90
  }
83
91
  },
84
92
  "devDependencies": {
85
- "@ddd-ts-kit/testing": "0.12.0",
93
+ "@ddd-ts-kit/testing": "0.14.0",
94
+ "@hono/node-server": "^2.1.4",
86
95
  "@nestjs/common": "^12.1.2",
87
96
  "@nestjs/core": "^12.1.2",
88
97
  "@nestjs/platform-express": "^12.1.2",
@@ -92,6 +101,7 @@
92
101
  "busboy": "^1.6.0",
93
102
  "express": "^5.3.0",
94
103
  "fastify": "^5.12.5",
104
+ "hono": "^4.13.13",
95
105
  "reflect-metadata": "^0.2.2",
96
106
  "rxjs": "^7.8.0",
97
107
  "zod": "^4.6.5"