@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.
- package/README.md +373 -11
- package/dist/controller/controller-routes.d.ts.map +1 -1
- package/dist/controller/controller-routes.js +8 -0
- package/dist/controller/controller-routes.js.map +1 -1
- package/dist/controller/controller-spec.d.ts +7 -0
- package/dist/controller/controller-spec.d.ts.map +1 -1
- package/dist/error/default-error-mapping.d.ts.map +1 -1
- package/dist/error/default-error-mapping.js +1 -0
- package/dist/error/default-error-mapping.js.map +1 -1
- package/dist/express/mount-express.d.ts +4 -2
- package/dist/express/mount-express.d.ts.map +1 -1
- package/dist/express/mount-express.js +25 -11
- package/dist/express/mount-express.js.map +1 -1
- package/dist/fastify/mount-fastify.d.ts +2 -1
- package/dist/fastify/mount-fastify.d.ts.map +1 -1
- package/dist/fastify/mount-fastify.js +23 -4
- package/dist/fastify/mount-fastify.js.map +1 -1
- package/dist/field-access/assert-writable.d.ts +8 -0
- package/dist/field-access/assert-writable.d.ts.map +1 -0
- package/dist/field-access/assert-writable.js +29 -0
- package/dist/field-access/assert-writable.js.map +1 -0
- package/dist/field-access/field-access-entry.d.ts +7 -0
- package/dist/field-access/field-access-entry.d.ts.map +1 -0
- package/dist/field-access/field-access-entry.js +2 -0
- package/dist/field-access/field-access-entry.js.map +1 -0
- package/dist/field-access/field-access.d.ts +13 -0
- package/dist/field-access/field-access.d.ts.map +1 -0
- package/dist/field-access/field-access.js +41 -0
- package/dist/field-access/field-access.js.map +1 -0
- package/dist/field-access/field-decider-of.d.ts +37 -0
- package/dist/field-access/field-decider-of.d.ts.map +1 -0
- package/dist/field-access/field-decider-of.js +30 -0
- package/dist/field-access/field-decider-of.js.map +1 -0
- package/dist/field-access/field-decider.d.ts +4 -0
- package/dist/field-access/field-decider.d.ts.map +1 -0
- package/dist/field-access/field-decider.js +2 -0
- package/dist/field-access/field-decider.js.map +1 -0
- package/dist/field-access/field-judge.d.ts +33 -0
- package/dist/field-access/field-judge.d.ts.map +1 -0
- package/dist/field-access/field-judge.js +81 -0
- package/dist/field-access/field-judge.js.map +1 -0
- package/dist/field-access/field-policy.d.ts +15 -0
- package/dist/field-access/field-policy.d.ts.map +1 -0
- package/dist/field-access/field-policy.js +2 -0
- package/dist/field-access/field-policy.js.map +1 -0
- package/dist/field-access/field-question.d.ts +18 -0
- package/dist/field-access/field-question.d.ts.map +1 -0
- package/dist/field-access/field-question.js +2 -0
- package/dist/field-access/field-question.js.map +1 -0
- package/dist/field-access/field-requirement.d.ts +13 -0
- package/dist/field-access/field-requirement.d.ts.map +1 -0
- package/dist/field-access/field-requirement.js +2 -0
- package/dist/field-access/field-requirement.js.map +1 -0
- package/dist/field-access/field-rule.d.ts +11 -0
- package/dist/field-access/field-rule.d.ts.map +1 -0
- package/dist/field-access/field-rule.js +2 -0
- package/dist/field-access/field-rule.js.map +1 -0
- package/dist/field-access/field-rules.d.ts +6 -0
- package/dist/field-access/field-rules.d.ts.map +1 -0
- package/dist/field-access/field-rules.js +2 -0
- package/dist/field-access/field-rules.js.map +1 -0
- package/dist/field-access/field-tree.d.ts +16 -0
- package/dist/field-access/field-tree.d.ts.map +1 -0
- package/dist/field-access/field-tree.js +28 -0
- package/dist/field-access/field-tree.js.map +1 -0
- package/dist/field-access/visible-body.d.ts +9 -0
- package/dist/field-access/visible-body.d.ts.map +1 -0
- package/dist/field-access/visible-body.js +42 -0
- package/dist/field-access/visible-body.js.map +1 -0
- package/dist/field-access/with-field-access.d.ts +17 -0
- package/dist/field-access/with-field-access.d.ts.map +1 -0
- package/dist/field-access/with-field-access.js +63 -0
- package/dist/field-access/with-field-access.js.map +1 -0
- package/dist/forms/assert-hints.d.ts +12 -0
- package/dist/forms/assert-hints.d.ts.map +1 -0
- package/dist/forms/assert-hints.js +32 -0
- package/dist/forms/assert-hints.js.map +1 -0
- package/dist/forms/assert-opens.d.ts +16 -0
- package/dist/forms/assert-opens.d.ts.map +1 -0
- package/dist/forms/assert-opens.js +24 -0
- package/dist/forms/assert-opens.js.map +1 -0
- package/dist/forms/constraints-of.d.ts +4 -0
- package/dist/forms/constraints-of.d.ts.map +1 -0
- package/dist/forms/constraints-of.js +24 -0
- package/dist/forms/constraints-of.js.map +1 -0
- package/dist/forms/define-form.d.ts +20 -0
- package/dist/forms/define-form.d.ts.map +1 -0
- package/dist/forms/define-form.js +8 -0
- package/dist/forms/define-form.js.map +1 -0
- package/dist/forms/field-block.d.ts +33 -0
- package/dist/forms/field-block.d.ts.map +1 -0
- package/dist/forms/field-block.js +2 -0
- package/dist/forms/field-block.js.map +1 -0
- package/dist/forms/field-hint.d.ts +18 -0
- package/dist/forms/field-hint.d.ts.map +1 -0
- package/dist/forms/field-hint.js +2 -0
- package/dist/forms/field-hint.js.map +1 -0
- package/dist/forms/field-lookup.d.ts +7 -0
- package/dist/forms/field-lookup.d.ts.map +1 -0
- package/dist/forms/field-lookup.js +2 -0
- package/dist/forms/field-lookup.js.map +1 -0
- package/dist/forms/form-block.d.ts +5 -0
- package/dist/forms/form-block.d.ts.map +1 -0
- package/dist/forms/form-block.js +2 -0
- package/dist/forms/form-block.js.map +1 -0
- package/dist/forms/form-condition.d.ts +9 -0
- package/dist/forms/form-condition.d.ts.map +1 -0
- package/dist/forms/form-condition.js +2 -0
- package/dist/forms/form-condition.js.map +1 -0
- package/dist/forms/form-describer.d.ts +35 -0
- package/dist/forms/form-describer.d.ts.map +1 -0
- package/dist/forms/form-describer.js +132 -0
- package/dist/forms/form-describer.js.map +1 -0
- package/dist/forms/form-description.d.ts +17 -0
- package/dist/forms/form-description.d.ts.map +1 -0
- package/dist/forms/form-description.js +2 -0
- package/dist/forms/form-description.js.map +1 -0
- package/dist/forms/form-document.d.ts +9 -0
- package/dist/forms/form-document.d.ts.map +1 -0
- package/dist/forms/form-document.js +2 -0
- package/dist/forms/form-document.js.map +1 -0
- package/dist/forms/form-documents-of.d.ts +10 -0
- package/dist/forms/form-documents-of.d.ts.map +1 -0
- package/dist/forms/form-documents-of.js +22 -0
- package/dist/forms/form-documents-of.js.map +1 -0
- package/dist/forms/form-format.d.ts +7 -0
- package/dist/forms/form-format.d.ts.map +1 -0
- package/dist/forms/form-format.js +3 -0
- package/dist/forms/form-format.js.map +1 -0
- package/dist/forms/form-group-hint.d.ts +8 -0
- package/dist/forms/form-group-hint.d.ts.map +1 -0
- package/dist/forms/form-group-hint.js +2 -0
- package/dist/forms/form-group-hint.js.map +1 -0
- package/dist/forms/form-hints.d.ts +16 -0
- package/dist/forms/form-hints.d.ts.map +1 -0
- package/dist/forms/form-hints.js +2 -0
- package/dist/forms/form-hints.js.map +1 -0
- package/dist/forms/form-of-route.d.ts +17 -0
- package/dist/forms/form-of-route.d.ts.map +1 -0
- package/dist/forms/form-of-route.js +47 -0
- package/dist/forms/form-of-route.js.map +1 -0
- package/dist/forms/form-query-schema.d.ts +10 -0
- package/dist/forms/form-query-schema.d.ts.map +1 -0
- package/dist/forms/form-query-schema.js +58 -0
- package/dist/forms/form-query-schema.js.map +1 -0
- package/dist/forms/form-query.d.ts +7 -0
- package/dist/forms/form-query.d.ts.map +1 -0
- package/dist/forms/form-query.js +2 -0
- package/dist/forms/form-query.js.map +1 -0
- package/dist/forms/form-requirement.d.ts +18 -0
- package/dist/forms/form-requirement.d.ts.map +1 -0
- package/dist/forms/form-requirement.js +2 -0
- package/dist/forms/form-requirement.js.map +1 -0
- package/dist/forms/form-routes.d.ts +19 -0
- package/dist/forms/form-routes.d.ts.map +1 -0
- package/dist/forms/form-routes.js +67 -0
- package/dist/forms/form-routes.js.map +1 -0
- package/dist/forms/form-schema.d.ts +4 -0
- package/dist/forms/form-schema.d.ts.map +1 -0
- package/dist/forms/form-schema.js +52 -0
- package/dist/forms/form-schema.js.map +1 -0
- package/dist/forms/group-block.d.ts +9 -0
- package/dist/forms/group-block.d.ts.map +1 -0
- package/dist/forms/group-block.js +2 -0
- package/dist/forms/group-block.js.map +1 -0
- package/dist/forms/json-form.d.ts +8 -0
- package/dist/forms/json-form.d.ts.map +1 -0
- package/dist/forms/json-form.js +2 -0
- package/dist/forms/json-form.js.map +1 -0
- package/dist/forms/json-forms-of.d.ts +12 -0
- package/dist/forms/json-forms-of.d.ts.map +1 -0
- package/dist/forms/json-forms-of.js +129 -0
- package/dist/forms/json-forms-of.js.map +1 -0
- package/dist/forms/lookups-of.d.ts +5 -0
- package/dist/forms/lookups-of.d.ts.map +1 -0
- package/dist/forms/lookups-of.js +7 -0
- package/dist/forms/lookups-of.js.map +1 -0
- package/dist/forms/widget-of.d.ts +5 -0
- package/dist/forms/widget-of.d.ts.map +1 -0
- package/dist/forms/widget-of.js +25 -0
- package/dist/forms/widget-of.js.map +1 -0
- package/dist/forms/widget.d.ts +3 -0
- package/dist/forms/widget.d.ts.map +1 -0
- package/dist/forms/widget.js +2 -0
- package/dist/forms/widget.js.map +1 -0
- package/dist/hono/edge-problem.d.ts +11 -0
- package/dist/hono/edge-problem.d.ts.map +1 -0
- package/dist/hono/edge-problem.js +15 -0
- package/dist/hono/edge-problem.js.map +1 -0
- package/dist/hono/hono-mount-options.d.ts +10 -0
- package/dist/hono/hono-mount-options.d.ts.map +1 -0
- package/dist/hono/hono-mount-options.js +2 -0
- package/dist/hono/hono-mount-options.js.map +1 -0
- package/dist/hono/hono-raw.d.ts +11 -0
- package/dist/hono/hono-raw.d.ts.map +1 -0
- package/dist/hono/hono-raw.js +2 -0
- package/dist/hono/hono-raw.js.map +1 -0
- package/dist/hono/mount-hono.d.ts +13 -0
- package/dist/hono/mount-hono.d.ts.map +1 -0
- package/dist/hono/mount-hono.js +77 -0
- package/dist/hono/mount-hono.js.map +1 -0
- package/dist/hono/read-body.d.ts +16 -0
- package/dist/hono/read-body.d.ts.map +1 -0
- package/dist/hono/read-body.js +65 -0
- package/dist/hono/read-body.js.map +1 -0
- package/dist/hono.d.ts +4 -0
- package/dist/hono.d.ts.map +1 -0
- package/dist/hono.js +2 -0
- package/dist/hono.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/openapi/cache-response-headers.d.ts +5 -2
- package/dist/openapi/cache-response-headers.d.ts.map +1 -1
- package/dist/openapi/cache-response-headers.js +10 -5
- package/dist/openapi/cache-response-headers.js.map +1 -1
- package/dist/openapi/definitions.d.ts +6 -1
- package/dist/openapi/definitions.d.ts.map +1 -1
- package/dist/openapi/definitions.js +12 -1
- package/dist/openapi/definitions.js.map +1 -1
- package/dist/openapi/documenting.d.ts +11 -0
- package/dist/openapi/documenting.d.ts.map +1 -0
- package/dist/openapi/documenting.js +2 -0
- package/dist/openapi/documenting.js.map +1 -0
- package/dist/openapi/generate-open-api.d.ts +7 -0
- package/dist/openapi/generate-open-api.d.ts.map +1 -1
- package/dist/openapi/generate-open-api.js +5 -1
- package/dist/openapi/generate-open-api.js.map +1 -1
- package/dist/openapi/path-items.d.ts +2 -3
- package/dist/openapi/path-items.d.ts.map +1 -1
- package/dist/openapi/path-items.js +8 -7
- package/dist/openapi/path-items.js.map +1 -1
- package/dist/openapi/request-body.d.ts +6 -3
- package/dist/openapi/request-body.d.ts.map +1 -1
- package/dist/openapi/request-body.js +13 -3
- package/dist/openapi/request-body.js.map +1 -1
- package/dist/openapi/responses.d.ts +2 -3
- package/dist/openapi/responses.d.ts.map +1 -1
- package/dist/openapi/responses.js +40 -12
- package/dist/openapi/responses.js.map +1 -1
- package/dist/openapi/schema-parameters.js +1 -1
- package/dist/openapi/schema-parameters.js.map +1 -1
- package/dist/pagination/every-page.d.ts +15 -0
- package/dist/pagination/every-page.d.ts.map +1 -0
- package/dist/pagination/every-page.js +21 -0
- package/dist/pagination/every-page.js.map +1 -0
- package/dist/pagination/page-schema-of.d.ts +3 -1
- package/dist/pagination/page-schema-of.d.ts.map +1 -1
- package/dist/pagination/page-schema-of.js +11 -3
- package/dist/pagination/page-schema-of.js.map +1 -1
- package/dist/pipeline/assert-cached-routes.d.ts +4 -2
- package/dist/pipeline/assert-cached-routes.d.ts.map +1 -1
- package/dist/pipeline/assert-cached-routes.js +46 -8
- package/dist/pipeline/assert-cached-routes.js.map +1 -1
- package/dist/pipeline/conditional-answer.d.ts +7 -2
- package/dist/pipeline/conditional-answer.d.ts.map +1 -1
- package/dist/pipeline/conditional-answer.js +10 -6
- package/dist/pipeline/conditional-answer.js.map +1 -1
- package/dist/pipeline/entity-tag-of.d.ts +3 -3
- package/dist/pipeline/entity-tag-of.d.ts.map +1 -1
- package/dist/pipeline/entity-tag-of.js +4 -4
- package/dist/pipeline/entity-tag-of.js.map +1 -1
- package/dist/pipeline/error-context.d.ts +6 -1
- package/dist/pipeline/error-context.d.ts.map +1 -1
- package/dist/pipeline/execute-options.d.ts +17 -0
- package/dist/pipeline/execute-options.d.ts.map +1 -1
- package/dist/pipeline/execute-route.d.ts.map +1 -1
- package/dist/pipeline/execute-route.js +121 -35
- package/dist/pipeline/execute-route.js.map +1 -1
- package/dist/pipeline/iterated-within.d.ts +9 -0
- package/dist/pipeline/iterated-within.d.ts.map +1 -0
- package/dist/pipeline/iterated-within.js +17 -0
- package/dist/pipeline/iterated-within.js.map +1 -0
- package/dist/pipeline/negotiated-vary.d.ts +6 -0
- package/dist/pipeline/negotiated-vary.d.ts.map +1 -0
- package/dist/pipeline/negotiated-vary.js +15 -0
- package/dist/pipeline/negotiated-vary.js.map +1 -0
- package/dist/pipeline/negotiation.d.ts +19 -0
- package/dist/pipeline/negotiation.d.ts.map +1 -0
- package/dist/pipeline/negotiation.js +19 -0
- package/dist/pipeline/negotiation.js.map +1 -0
- package/dist/pipeline/primed.d.ts +6 -0
- package/dist/pipeline/primed.d.ts.map +1 -0
- package/dist/pipeline/primed.js +20 -0
- package/dist/pipeline/primed.js.map +1 -0
- package/dist/pipeline/read-body.d.ts +10 -0
- package/dist/pipeline/read-body.d.ts.map +1 -0
- package/dist/pipeline/read-body.js +33 -0
- package/dist/pipeline/read-body.js.map +1 -0
- package/dist/pipeline/reported-stream.d.ts +6 -0
- package/dist/pipeline/reported-stream.d.ts.map +1 -0
- package/dist/pipeline/reported-stream.js +14 -0
- package/dist/pipeline/reported-stream.js.map +1 -0
- package/dist/pipeline/represented-answer.d.ts +7 -0
- package/dist/pipeline/represented-answer.d.ts.map +1 -0
- package/dist/pipeline/represented-answer.js +2 -0
- package/dist/pipeline/represented-answer.js.map +1 -0
- package/dist/pipeline/represented.d.ts +7 -0
- package/dist/pipeline/represented.d.ts.map +1 -0
- package/dist/pipeline/represented.js +19 -0
- package/dist/pipeline/represented.js.map +1 -0
- package/dist/pipeline/route-response.d.ts +2 -0
- package/dist/pipeline/route-response.d.ts.map +1 -1
- package/dist/pipeline/tagged-answer.d.ts +5 -2
- package/dist/pipeline/tagged-answer.d.ts.map +1 -1
- package/dist/pipeline/tagged-answer.js +1 -1
- package/dist/pipeline/tagged-answer.js.map +1 -1
- package/dist/pipeline/write-stream.d.ts +8 -0
- package/dist/pipeline/write-stream.d.ts.map +1 -0
- package/dist/pipeline/write-stream.js +23 -0
- package/dist/pipeline/write-stream.js.map +1 -0
- package/dist/pipeline/written-in.d.ts +10 -0
- package/dist/pipeline/written-in.d.ts.map +1 -0
- package/dist/pipeline/written-in.js +17 -0
- package/dist/pipeline/written-in.js.map +1 -0
- package/dist/representation/assert-served.d.ts +10 -0
- package/dist/representation/assert-served.d.ts.map +1 -0
- package/dist/representation/assert-served.js +18 -0
- package/dist/representation/assert-served.js.map +1 -0
- package/dist/representation/body-shape.d.ts +9 -0
- package/dist/representation/body-shape.d.ts.map +1 -0
- package/dist/representation/body-shape.js +2 -0
- package/dist/representation/body-shape.js.map +1 -0
- package/dist/representation/csv/csv-cell.d.ts +8 -0
- package/dist/representation/csv/csv-cell.d.ts.map +1 -0
- package/dist/representation/csv/csv-cell.js +19 -0
- package/dist/representation/csv/csv-cell.js.map +1 -0
- package/dist/representation/csv/csv-representation.d.ts +16 -0
- package/dist/representation/csv/csv-representation.d.ts.map +1 -0
- package/dist/representation/csv/csv-representation.js +54 -0
- package/dist/representation/csv/csv-representation.js.map +1 -0
- package/dist/representation/is-json-media-type.d.ts +3 -0
- package/dist/representation/is-json-media-type.d.ts.map +1 -0
- package/dist/representation/is-json-media-type.js +5 -0
- package/dist/representation/is-json-media-type.js.map +1 -0
- package/dist/representation/json-representation.d.ts +14 -0
- package/dist/representation/json-representation.d.ts.map +1 -0
- package/dist/representation/json-representation.js +40 -0
- package/dist/representation/json-representation.js.map +1 -0
- package/dist/representation/malformed-body.d.ts +4 -0
- package/dist/representation/malformed-body.d.ts.map +1 -0
- package/dist/representation/malformed-body.js +6 -0
- package/dist/representation/malformed-body.js.map +1 -0
- package/dist/representation/media-type-of.d.ts +3 -0
- package/dist/representation/media-type-of.d.ts.map +1 -0
- package/dist/representation/media-type-of.js +7 -0
- package/dist/representation/media-type-of.js.map +1 -0
- package/dist/representation/negotiate.d.ts +8 -0
- package/dist/representation/negotiate.d.ts.map +1 -0
- package/dist/representation/negotiate.js +55 -0
- package/dist/representation/negotiate.js.map +1 -0
- package/dist/representation/not-acceptable-error.d.ts +7 -0
- package/dist/representation/not-acceptable-error.d.ts.map +1 -0
- package/dist/representation/not-acceptable-error.js +7 -0
- package/dist/representation/not-acceptable-error.js.map +1 -0
- package/dist/representation/problem-shape.d.ts +4 -0
- package/dist/representation/problem-shape.d.ts.map +1 -0
- package/dist/representation/problem-shape.js +7 -0
- package/dist/representation/problem-shape.js.map +1 -0
- package/dist/representation/representation.d.ts +20 -0
- package/dist/representation/representation.d.ts.map +1 -0
- package/dist/representation/representation.js +9 -0
- package/dist/representation/representation.js.map +1 -0
- package/dist/representation/representations.d.ts +33 -0
- package/dist/representation/representations.d.ts.map +1 -0
- package/dist/representation/representations.js +85 -0
- package/dist/representation/representations.js.map +1 -0
- package/dist/representation/represented-body.d.ts +3 -0
- package/dist/representation/represented-body.d.ts.map +1 -0
- package/dist/representation/represented-body.js +2 -0
- package/dist/representation/represented-body.js.map +1 -0
- package/dist/representation/stream-schema-of.d.ts +10 -0
- package/dist/representation/stream-schema-of.d.ts.map +1 -0
- package/dist/representation/stream-schema-of.js +31 -0
- package/dist/representation/stream-schema-of.js.map +1 -0
- package/dist/representation/unsupported-media-type-error.d.ts +7 -0
- package/dist/representation/unsupported-media-type-error.d.ts.map +1 -0
- package/dist/representation/unsupported-media-type-error.js +7 -0
- package/dist/representation/unsupported-media-type-error.js.map +1 -0
- package/dist/representation/wire-text.d.ts +7 -0
- package/dist/representation/wire-text.d.ts.map +1 -0
- package/dist/representation/wire-text.js +21 -0
- package/dist/representation/wire-text.js.map +1 -0
- package/dist/representation/xml/decode-entities.d.ts +3 -0
- package/dist/representation/xml/decode-entities.d.ts.map +1 -0
- package/dist/representation/xml/decode-entities.js +38 -0
- package/dist/representation/xml/decode-entities.js.map +1 -0
- package/dist/representation/xml/is-xml-name.d.ts +3 -0
- package/dist/representation/xml/is-xml-name.d.ts.map +1 -0
- package/dist/representation/xml/is-xml-name.js +6 -0
- package/dist/representation/xml/is-xml-name.js.map +1 -0
- package/dist/representation/xml/xml-convention.d.ts +10 -0
- package/dist/representation/xml/xml-convention.d.ts.map +1 -0
- package/dist/representation/xml/xml-convention.js +10 -0
- package/dist/representation/xml/xml-convention.js.map +1 -0
- package/dist/representation/xml/xml-element-writer.d.ts +16 -0
- package/dist/representation/xml/xml-element-writer.d.ts.map +1 -0
- package/dist/representation/xml/xml-element-writer.js +71 -0
- package/dist/representation/xml/xml-element-writer.js.map +1 -0
- package/dist/representation/xml/xml-element.d.ts +9 -0
- package/dist/representation/xml/xml-element.d.ts.map +1 -0
- package/dist/representation/xml/xml-element.js +2 -0
- package/dist/representation/xml/xml-element.js.map +1 -0
- package/dist/representation/xml/xml-parser.d.ts +27 -0
- package/dist/representation/xml/xml-parser.d.ts.map +1 -0
- package/dist/representation/xml/xml-parser.js +154 -0
- package/dist/representation/xml/xml-parser.js.map +1 -0
- package/dist/representation/xml/xml-representation.d.ts +20 -0
- package/dist/representation/xml/xml-representation.d.ts.map +1 -0
- package/dist/representation/xml/xml-representation.js +52 -0
- package/dist/representation/xml/xml-representation.js.map +1 -0
- package/dist/representation/xml/xml-syntax-error.d.ts +5 -0
- package/dist/representation/xml/xml-syntax-error.d.ts.map +1 -0
- package/dist/representation/xml/xml-syntax-error.js +8 -0
- package/dist/representation/xml/xml-syntax-error.js.map +1 -0
- package/dist/representation/xml/xml-text.d.ts +7 -0
- package/dist/representation/xml/xml-text.d.ts.map +1 -0
- package/dist/representation/xml/xml-text.js +30 -0
- package/dist/representation/xml/xml-text.js.map +1 -0
- package/dist/representation/xml/xml-value-reader.d.ts +15 -0
- package/dist/representation/xml/xml-value-reader.d.ts.map +1 -0
- package/dist/representation/xml/xml-value-reader.js +101 -0
- package/dist/representation/xml/xml-value-reader.js.map +1 -0
- package/dist/route/answers-with-schema.d.ts +7 -0
- package/dist/route/answers-with-schema.d.ts.map +1 -0
- package/dist/route/answers-with-schema.js +10 -0
- package/dist/route/answers-with-schema.js.map +1 -0
- package/dist/route/route-spec.d.ts +11 -0
- package/dist/route/route-spec.d.ts.map +1 -1
- package/dist/schema/json-schema-of.d.ts +7 -0
- package/dist/schema/json-schema-of.d.ts.map +1 -0
- package/dist/schema/json-schema-of.js +15 -0
- package/dist/schema/json-schema-of.js.map +1 -0
- package/dist/schema/schema-node.d.ts +25 -0
- package/dist/schema/schema-node.d.ts.map +1 -0
- package/dist/schema/schema-node.js +92 -0
- package/dist/schema/schema-node.js.map +1 -0
- package/dist/schema/schema-type.d.ts +3 -0
- package/dist/schema/schema-type.d.ts.map +1 -0
- package/dist/schema/schema-type.js +2 -0
- package/dist/schema/schema-type.js.map +1 -0
- package/dist/schema/xml-hints.d.ts +9 -0
- package/dist/schema/xml-hints.d.ts.map +1 -0
- package/dist/schema/xml-hints.js +2 -0
- package/dist/schema/xml-hints.js.map +1 -0
- package/dist/schemas/accepted-schema.d.ts +8 -0
- package/dist/schemas/accepted-schema.d.ts.map +1 -0
- package/dist/schemas/accepted-schema.js +20 -0
- package/dist/schemas/accepted-schema.js.map +1 -0
- package/dist/schemas/accepted.d.ts +5 -0
- package/dist/schemas/accepted.d.ts.map +1 -0
- package/dist/schemas/accepted.js +2 -0
- package/dist/schemas/accepted.js.map +1 -0
- package/dist/serialization/decimal-text.d.ts +6 -0
- package/dist/serialization/decimal-text.d.ts.map +1 -0
- package/dist/serialization/decimal-text.js +13 -0
- package/dist/serialization/decimal-text.js.map +1 -0
- package/dist/serialization/money-body.d.ts +6 -0
- package/dist/serialization/money-body.d.ts.map +1 -0
- package/dist/serialization/money-body.js +2 -0
- package/dist/serialization/money-body.js.map +1 -0
- package/dist/serialization/money.d.ts +4 -0
- package/dist/serialization/money.d.ts.map +1 -0
- package/dist/serialization/money.js +10 -0
- package/dist/serialization/money.js.map +1 -0
- package/dist/support/is-async-iterable.d.ts +3 -0
- package/dist/support/is-async-iterable.d.ts.map +1 -0
- package/dist/support/is-async-iterable.js +5 -0
- package/dist/support/is-async-iterable.js.map +1 -0
- 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;AA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oB,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,MAAM,CAClF,CAAC;QAEF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,CAAC;IAEO,UAAU,CAAC,SAAiB;QAClC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAExD,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aACzD,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;aAC7E,IAAI,CAAC,QAAQ,CAAC,CAAC;QAElB,OAAO,KAAK,IAAI,EAAE,CAAC;IACrB,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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.
|
|
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.
|
|
58
|
-
"@ddd-ts-kit/validation": "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.
|
|
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"
|