@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,35 @@
|
|
|
1
|
+
import type { FieldJudge } from '../field-access/field-judge.js';
|
|
2
|
+
import type { FieldTree } from '../field-access/field-tree.js';
|
|
3
|
+
import type { SchemaNode } from '../schema/schema-node.js';
|
|
4
|
+
import type { FormBlock } from './form-block.js';
|
|
5
|
+
import type { FormHints } from './form-hints.js';
|
|
6
|
+
import type { FieldLookup } from './field-lookup.js';
|
|
7
|
+
/** What a form is described from: the request schema, its hints, the caller and the values the request gave. */
|
|
8
|
+
export interface FormSource {
|
|
9
|
+
readonly operation: string;
|
|
10
|
+
readonly body: SchemaNode;
|
|
11
|
+
readonly fields: FieldTree;
|
|
12
|
+
readonly hints: FormHints;
|
|
13
|
+
readonly lookups: ReadonlyMap<string, FieldLookup>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The blocks of a form, for one caller: a field the caller may not see is absent, one they may
|
|
17
|
+
* not set is read-only, constraints and options come from the schema, layout and conditions
|
|
18
|
+
* from the hints. It describes; the route that receives the body still validates it, and its
|
|
19
|
+
* use case still enforces its rules.
|
|
20
|
+
*/
|
|
21
|
+
export declare class FormDescriber {
|
|
22
|
+
private readonly source;
|
|
23
|
+
private readonly judge;
|
|
24
|
+
constructor(source: FormSource, judge: FieldJudge);
|
|
25
|
+
blocks(values: Readonly<Record<string, unknown>>): Promise<FormBlock[]>;
|
|
26
|
+
private grouped;
|
|
27
|
+
/** Every field of one object the caller may see, by name, in the order of the schema. */
|
|
28
|
+
private fieldsOf;
|
|
29
|
+
private field;
|
|
30
|
+
/** What depends on the schema of the field and its hint: widget, constraints, options, conditions, nested fields. */
|
|
31
|
+
private shapeOf;
|
|
32
|
+
private choicesOf;
|
|
33
|
+
private hintOf;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=form-describer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-describer.d.ts","sourceRoot":"","sources":["../../src/forms/form-describer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD,gHAAgH;AAChH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACpD;AAYD;;;;;GAKG;AACH,qBAAa,aAAa;IAEtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFxB,YACmB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,UAAU,EAChC;IAEE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAM5E;IAED,OAAO,CAAC,OAAO;IAmBf,yFAAyF;YAC3E,QAAQ;YAeR,KAAK;IAqBnB,qHAAqH;YACvG,OAAO;IAmCrB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,MAAM;CAGf"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { isRecord } from '../support/is-record.js';
|
|
2
|
+
import { constraintsOf } from './constraints-of.js';
|
|
3
|
+
import { widgetOf } from './widget-of.js';
|
|
4
|
+
const MAX_DEPTH = 8;
|
|
5
|
+
/**
|
|
6
|
+
* The blocks of a form, for one caller: a field the caller may not see is absent, one they may
|
|
7
|
+
* not set is read-only, constraints and options come from the schema, layout and conditions
|
|
8
|
+
* from the hints. It describes; the route that receives the body still validates it, and its
|
|
9
|
+
* use case still enforces its rules.
|
|
10
|
+
*/
|
|
11
|
+
export class FormDescriber {
|
|
12
|
+
source;
|
|
13
|
+
judge;
|
|
14
|
+
constructor(source, judge) {
|
|
15
|
+
this.source = source;
|
|
16
|
+
this.judge = judge;
|
|
17
|
+
}
|
|
18
|
+
async blocks(values) {
|
|
19
|
+
const { body, fields, hints } = this.source;
|
|
20
|
+
const level = { node: body, fields, values, prefix: '', readOnly: false };
|
|
21
|
+
const described = await this.fieldsOf(level);
|
|
22
|
+
return [...this.grouped(hints.groups ?? [], described), ...ungrouped(hints.groups ?? [], described)];
|
|
23
|
+
}
|
|
24
|
+
grouped(groups, described) {
|
|
25
|
+
return groups.map((group) => ({
|
|
26
|
+
type: 'group',
|
|
27
|
+
name: group.name,
|
|
28
|
+
label: `${this.source.operation}.${group.name}`,
|
|
29
|
+
blocks: [
|
|
30
|
+
...group.fields.flatMap((name) => {
|
|
31
|
+
const block = described.get(name);
|
|
32
|
+
return block === undefined ? [] : [block];
|
|
33
|
+
}),
|
|
34
|
+
...this.grouped(group.groups ?? [], described),
|
|
35
|
+
],
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
/** Every field of one object the caller may see, by name, in the order of the schema. */
|
|
39
|
+
async fieldsOf(level) {
|
|
40
|
+
const required = new Set(level.node.required());
|
|
41
|
+
const blocks = new Map();
|
|
42
|
+
for (const [name, node] of level.node.properties()) {
|
|
43
|
+
const block = await this.field({ name, node, required: required.has(name) }, level);
|
|
44
|
+
if (block !== undefined) {
|
|
45
|
+
blocks.set(name, block);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return blocks;
|
|
49
|
+
}
|
|
50
|
+
async field(property, level) {
|
|
51
|
+
const rule = level.fields.own().find(([name]) => name === property.name)?.[1];
|
|
52
|
+
if (rule !== undefined && !(await this.judge.reads(rule, level.values))) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
const readOnly = level.readOnly || (rule !== undefined && !(await this.judge.writes(rule, level.values)));
|
|
56
|
+
const path = `${level.prefix}${property.name}`;
|
|
57
|
+
const value = level.values[property.name];
|
|
58
|
+
return {
|
|
59
|
+
...(await this.shapeOf(property, { ...level, prefix: `${path}.`, readOnly })),
|
|
60
|
+
name: path,
|
|
61
|
+
label: this.hintOf(path)?.label ?? `${this.source.operation}.${path}`,
|
|
62
|
+
required: property.required,
|
|
63
|
+
...(readOnly ? { readOnly: true } : {}),
|
|
64
|
+
...(value === undefined ? {} : { value }),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** What depends on the schema of the field and its hint: widget, constraints, options, conditions, nested fields. */
|
|
68
|
+
async shapeOf({ name, node }, below) {
|
|
69
|
+
const path = below.prefix.slice(0, -1);
|
|
70
|
+
const hint = this.hintOf(path) ?? {};
|
|
71
|
+
if (node.type() === 'object' && node.properties().length > 0) {
|
|
72
|
+
const values = below.values[name];
|
|
73
|
+
// A schema that holds itself (a tree) is described a few levels deep, not without end.
|
|
74
|
+
if (below.prefix.split('.').length > MAX_DEPTH) {
|
|
75
|
+
return { type: 'field', widget: 'group', blocks: [] };
|
|
76
|
+
}
|
|
77
|
+
const nested = {
|
|
78
|
+
node,
|
|
79
|
+
fields: below.fields.below(name),
|
|
80
|
+
values: isRecord(values) ? values : {},
|
|
81
|
+
prefix: below.prefix,
|
|
82
|
+
readOnly: below.readOnly,
|
|
83
|
+
};
|
|
84
|
+
return { type: 'field', widget: 'group', blocks: [...(await this.fieldsOf(nested)).values()] };
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
type: 'field',
|
|
88
|
+
widget: hint.widget ?? widgetOf(node),
|
|
89
|
+
...constraintsOf(node),
|
|
90
|
+
...this.choicesOf(path, node, hint),
|
|
91
|
+
...conditionsOf(hint),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
choicesOf(path, node, hint) {
|
|
95
|
+
const listed = node.type() === 'array' ? node.items() : node;
|
|
96
|
+
const values = enumerated(listed) ?? hint.options;
|
|
97
|
+
const lookup = hint.lookup === undefined ? undefined : this.source.lookups.get(hint.lookup);
|
|
98
|
+
return {
|
|
99
|
+
...(values === undefined
|
|
100
|
+
? {}
|
|
101
|
+
: { options: values.map((value) => ({ value, label: `${this.source.operation}.${path}.${String(value)}` })) }),
|
|
102
|
+
...(node.type() === 'array' && values !== undefined ? { multiple: true, widget: hint.widget ?? 'select' } : {}),
|
|
103
|
+
...(lookup === undefined ? {} : { lookup }),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
hintOf(path) {
|
|
107
|
+
return this.source.hints.fields?.[path];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function ungrouped(groups, described) {
|
|
111
|
+
const placed = new Set(groups.flatMap(function names(group) {
|
|
112
|
+
return [...group.fields, ...(group.groups ?? []).flatMap(names)];
|
|
113
|
+
}));
|
|
114
|
+
return [...described].filter(([name]) => !placed.has(name)).map(([, block]) => block);
|
|
115
|
+
}
|
|
116
|
+
function enumerated(node) {
|
|
117
|
+
const values = node.node['enum'];
|
|
118
|
+
if (!Array.isArray(values)) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
return values.filter(isOption);
|
|
122
|
+
}
|
|
123
|
+
function isOption(value) {
|
|
124
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
125
|
+
}
|
|
126
|
+
function conditionsOf({ visibleWhen, requiredWhen }) {
|
|
127
|
+
return {
|
|
128
|
+
...(visibleWhen === undefined ? {} : { visibleWhen }),
|
|
129
|
+
...(requiredWhen === undefined ? {} : { requiredWhen }),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=form-describer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-describer.js","sourceRoot":"","sources":["../../src/forms/form-describer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,SAAS,GAAG,CAAC,CAAC;AAqBpB;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAEL,MAAM;IACN,KAAK;IAFxB,YACmB,MAAkB,EAClB,KAAiB;sBADjB,MAAM;qBACN,KAAK;IACrB,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,MAAyC;QACpD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5C,MAAM,KAAK,GAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM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MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,CAAC;AAC9F,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY,EAAa;IAC5D,OAAO;QACL,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QACrD,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormBlock } from './form-block.js';
|
|
2
|
+
import type { HttpMethod } from '../route/http-method.js';
|
|
3
|
+
/**
|
|
4
|
+
* A form described by the server, as a neutral tree of blocks for a front end with its own
|
|
5
|
+
* rendering engine: what a route declares, for the caller who asked. JSON Forms is produced
|
|
6
|
+
* from the same tree.
|
|
7
|
+
*/
|
|
8
|
+
export interface FormDescription {
|
|
9
|
+
readonly type: 'form';
|
|
10
|
+
readonly operation: string;
|
|
11
|
+
readonly method: HttpMethod;
|
|
12
|
+
readonly path: string;
|
|
13
|
+
/** A translation key: the operation id. */
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly blocks: readonly FormBlock[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=form-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-description.d.ts","sourceRoot":"","sources":["../../src/forms/form-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-description.js","sourceRoot":"","sources":["../../src/forms/form-description.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FormDescription } from './form-description.js';
|
|
2
|
+
import type { JsonForm } from './json-form.js';
|
|
3
|
+
/** The whole form of a route, as a caller allowed every field gets it: what the documentation shows. */
|
|
4
|
+
export interface FormDocument {
|
|
5
|
+
readonly operation: string;
|
|
6
|
+
readonly jsonForms: JsonForm;
|
|
7
|
+
readonly blocks: FormDescription;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=form-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-document.d.ts","sourceRoot":"","sources":["../../src/forms/form-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,wGAAwG;AACxG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-document.js","sourceRoot":"","sources":["../../src/forms/form-document.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Route } from '../route/route.js';
|
|
2
|
+
import type { FormDocument } from './form-document.js';
|
|
3
|
+
/**
|
|
4
|
+
* Every form of the routes, whole, in both formats, sorted by operation: what a contract script
|
|
5
|
+
* writes next to the OpenAPI document (`openapi/forms/<operationId>.json`), so that a front end
|
|
6
|
+
* team reads the forms where it reads the API. What a caller may not see is said by
|
|
7
|
+
* `x-field-access` in the contract, not here.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formDocumentsOf(routes: readonly Route[]): Promise<FormDocument[]>;
|
|
10
|
+
//# sourceMappingURL=form-documents-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-documents-of.d.ts","sourceRoot":"","sources":["../../src/forms/form-documents-of.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAcvF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { systemActor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { FieldJudge } from '../field-access/field-judge.js';
|
|
3
|
+
import { FormOfRoute } from './form-of-route.js';
|
|
4
|
+
import { jsonFormsOf } from './json-forms-of.js';
|
|
5
|
+
import { lookupsOf } from './lookups-of.js';
|
|
6
|
+
/**
|
|
7
|
+
* Every form of the routes, whole, in both formats, sorted by operation: what a contract script
|
|
8
|
+
* writes next to the OpenAPI document (`openapi/forms/<operationId>.json`), so that a front end
|
|
9
|
+
* team reads the forms where it reads the API. What a caller may not see is said by
|
|
10
|
+
* `x-field-access` in the contract, not here.
|
|
11
|
+
*/
|
|
12
|
+
export async function formDocumentsOf(routes) {
|
|
13
|
+
const lookups = lookupsOf(routes);
|
|
14
|
+
const everything = new FieldJudge(systemActor('documentation'), () => Promise.resolve(true));
|
|
15
|
+
const forms = routes.filter((route) => route.form !== undefined).map((route) => FormOfRoute.of(route, lookups));
|
|
16
|
+
const documents = await Promise.all(forms.map(async (form) => {
|
|
17
|
+
const blocks = await form.describe(everything, {});
|
|
18
|
+
return { operation: form.operation, jsonForms: jsonFormsOf(blocks, form.body, {}), blocks };
|
|
19
|
+
}));
|
|
20
|
+
return documents.sort((a, b) => (a.operation < b.operation ? -1 : a.operation > b.operation ? 1 : 0));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=form-documents-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-documents-of.js","sourceRoot":"","sources":["../../src/forms/form-documents-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAwB;IAC5D,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7F,MAAM,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"form-format.js","sourceRoot":"","sources":["../../src/forms/form-format.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A group of fields of a form, in order, which may hold groups of its own. */
|
|
2
|
+
export interface FormGroupHint {
|
|
3
|
+
/** Gives the translation key of its label, `<operationId>.<name>`. */
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly fields: readonly string[];
|
|
6
|
+
readonly groups?: readonly FormGroupHint[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=form-group-hint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-group-hint.d.ts","sourceRoot":"","sources":["../../src/forms/form-group-hint.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-group-hint.js","sourceRoot":"","sources":["../../src/forms/form-group-hint.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FieldHint } from './field-hint.js';
|
|
2
|
+
import type { FormGroupHint } from './form-group-hint.js';
|
|
3
|
+
import type { FormRequirement } from './form-requirement.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a route adds to its request schema to be described as a form: `form` of `@Controller` or
|
|
6
|
+
* of `defineRoute`. Everything is optional: `form: {}` describes the body as it is, one field per
|
|
7
|
+
* property in the order of the schema.
|
|
8
|
+
*/
|
|
9
|
+
export interface FormHints {
|
|
10
|
+
/** The groups of the form in order; a field named in no group comes after them, in the order of the schema. */
|
|
11
|
+
readonly groups?: readonly FormGroupHint[];
|
|
12
|
+
readonly fields?: Readonly<Record<string, FieldHint | undefined>>;
|
|
13
|
+
/** What the caller needs to be given the form, the permission of the use case; absent, whoever may call the route. */
|
|
14
|
+
readonly requires?: FormRequirement;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=form-hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-hints.d.ts","sourceRoot":"","sources":["../../src/forms/form-hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,+GAA+G;IAC/G,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;IAClE,sHAAsH;IACtH,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-hints.js","sourceRoot":"","sources":["../../src/forms/form-hints.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FieldJudge } from '../field-access/field-judge.js';
|
|
2
|
+
import type { Route } from '../route/route.js';
|
|
3
|
+
import { SchemaNode } from '../schema/schema-node.js';
|
|
4
|
+
import type { FieldLookup } from './field-lookup.js';
|
|
5
|
+
import type { FormDescription } from './form-description.js';
|
|
6
|
+
/** The form a route declares, ready to be described for any caller. */
|
|
7
|
+
export declare class FormOfRoute {
|
|
8
|
+
private readonly route;
|
|
9
|
+
readonly body: SchemaNode;
|
|
10
|
+
private readonly describer;
|
|
11
|
+
private constructor();
|
|
12
|
+
/** Refuses, when the routes are built, a form without a body and hints naming what the body or the routes do not have. */
|
|
13
|
+
static of(route: Route, lookups: ReadonlyMap<string, FieldLookup>): FormOfRoute;
|
|
14
|
+
get operation(): string;
|
|
15
|
+
describe(judge: FieldJudge, values: Readonly<Record<string, unknown>>): Promise<FormDescription>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=form-of-route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-of-route.d.ts","sourceRoot":"","sources":["../../src/forms/form-of-route.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,uEAAuE;AACvE,qBAAa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,QAAQ,CAAC,IAAI,EAAE,UAAU;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAH5B,OAAO,eAIH;IAEJ,0HAA0H;IAC1H,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,WAAW,CAiB9E;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAWrG;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DeclarationError } from '@ddd-ts-kit/kernel/declarations';
|
|
2
|
+
import { fieldAccess } from '../field-access/field-access.js';
|
|
3
|
+
import { FieldTree } from '../field-access/field-tree.js';
|
|
4
|
+
import { jsonSchemaOf } from '../schema/json-schema-of.js';
|
|
5
|
+
import { SchemaNode } from '../schema/schema-node.js';
|
|
6
|
+
import { FormDescriber } from './form-describer.js';
|
|
7
|
+
import { assertHints } from './assert-hints.js';
|
|
8
|
+
/** The form a route declares, ready to be described for any caller. */
|
|
9
|
+
export class FormOfRoute {
|
|
10
|
+
route;
|
|
11
|
+
body;
|
|
12
|
+
describer;
|
|
13
|
+
constructor(route, body, describer) {
|
|
14
|
+
this.route = route;
|
|
15
|
+
this.body = body;
|
|
16
|
+
this.describer = describer;
|
|
17
|
+
}
|
|
18
|
+
/** Refuses, when the routes are built, a form without a body and hints naming what the body or the routes do not have. */
|
|
19
|
+
static of(route, lookups) {
|
|
20
|
+
const schema = route.request?.body;
|
|
21
|
+
if (schema === undefined || route.form === undefined) {
|
|
22
|
+
throw new DeclarationError(`Route "${route.operationId}" declares a form and no request body to describe.`);
|
|
23
|
+
}
|
|
24
|
+
const body = SchemaNode.of(jsonSchemaOf(schema));
|
|
25
|
+
const hints = route.form;
|
|
26
|
+
assertHints({ operation: route.operationId, body, hints }, lookups);
|
|
27
|
+
return new FormOfRoute(route, body, (judge) => new FormDescriber(sourceOf(route, { body, schema, hints, lookups }), judge));
|
|
28
|
+
}
|
|
29
|
+
get operation() {
|
|
30
|
+
return this.route.operationId;
|
|
31
|
+
}
|
|
32
|
+
async describe(judge, values) {
|
|
33
|
+
const { operationId, method, path } = this.route;
|
|
34
|
+
return {
|
|
35
|
+
type: 'form',
|
|
36
|
+
operation: operationId,
|
|
37
|
+
method,
|
|
38
|
+
path,
|
|
39
|
+
label: operationId,
|
|
40
|
+
blocks: await this.describer(judge).blocks(values),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function sourceOf(route, { body, schema, hints, lookups }) {
|
|
45
|
+
return { operation: route.operationId, body, fields: FieldTree.of(fieldAccess.of(schema)), hints, lookups };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=form-of-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-of-route.js","sourceRoot":"","sources":["../../src/forms/form-of-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,uEAAuE;AACvE,MAAM,OAAO,WAAW;IAEH,KAAK;IACb,IAAI;IACI,SAAS;IAH5B,YACmB,KAAY,EACpB,IAAgB,EACR,SAA+C;qBAF/C,KAAK;oBACb,IAAI;yBACI,SAAS;IACzB,CAAC;IAEJ,0HAA0H;IAC1H,MAAM,CAAC,EAAE,CAAC,KAAY,EAAE,OAAyC;QAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;QAEnC,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACrD,MAAM,IAAI,gBAAgB,CAAC,UAAU,KAAK,CAAC,WAAW,oDAAoD,CAAC,CAAC;QAC9G,CAAC;QAED,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QACjD,MAAM,KAAK,GAAc,KAAK,CAAC,IAAI,CAAC;QAEpC,WAAW,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAEpE,OAAO,IAAI,WAAW,CACpB,KAAK,EACL,IAAI,EACJ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CACvF,CAAC;IACJ,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAiB,EAAE,MAAyC;QACzE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEjD,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,WAAW;YACtB,MAAM;YACN,IAAI;YACJ,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AASD,SAAS,QAAQ,CACf,KAAY,EACZ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAS;IAEvC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC9G,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Schema } from '@ddd-ts-kit/validation';
|
|
2
|
+
import type { SchemaNode } from '../schema/schema-node.js';
|
|
3
|
+
import type { FormQuery } from './form-query.js';
|
|
4
|
+
/**
|
|
5
|
+
* `?format=blocks&calendarId=c-1`: the format (`json-forms` by default) and the value of any
|
|
6
|
+
* scalar field of the body known in advance. The values prefill the form and name the element a
|
|
7
|
+
* field rule is asked about; a number or a boolean is read as the schema types it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formQuerySchema(body: SchemaNode): Schema<FormQuery>;
|
|
10
|
+
//# sourceMappingURL=form-query-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-query-schema.d.ts","sourceRoot":"","sources":["../../src/forms/form-query-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAiC,KAAK,MAAM,EAAwB,MAAM,wBAAwB,CAAC;AAC1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CA6BnE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { err, ok } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { customSchema } from '@ddd-ts-kit/validation';
|
|
3
|
+
import { isRecord } from '../support/is-record.js';
|
|
4
|
+
import { FormFormat } from './form-format.js';
|
|
5
|
+
const FORMATS = Object.values(FormFormat);
|
|
6
|
+
/**
|
|
7
|
+
* `?format=blocks&calendarId=c-1`: the format (`json-forms` by default) and the value of any
|
|
8
|
+
* scalar field of the body known in advance. The values prefill the form and name the element a
|
|
9
|
+
* field rule is asked about; a number or a boolean is read as the schema types it.
|
|
10
|
+
*/
|
|
11
|
+
export function formQuerySchema(body) {
|
|
12
|
+
const scalars = new Map(body.properties().filter(([, node]) => node.isScalar()));
|
|
13
|
+
return customSchema((input) => {
|
|
14
|
+
const issues = [];
|
|
15
|
+
const { format = FormFormat.jsonForms, ...given } = isRecord(input) ? input : {};
|
|
16
|
+
if (typeof format !== 'string' || !FORMATS.includes(format)) {
|
|
17
|
+
issues.push({ path: 'format', code: 'invalid_format', message: `One of ${FORMATS.join(', ')}.` });
|
|
18
|
+
}
|
|
19
|
+
const values = Object.fromEntries(Object.entries(given).flatMap(([name, value]) => {
|
|
20
|
+
const node = scalars.get(name);
|
|
21
|
+
if (node === undefined || typeof value !== 'string') {
|
|
22
|
+
issues.push({ path: name, code: 'unknown_field', message: 'Not a field of the form known in advance.' });
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
return [[name, typed(value, node)]];
|
|
26
|
+
}));
|
|
27
|
+
return issues.length > 0
|
|
28
|
+
? err(issues)
|
|
29
|
+
: ok({ format: format === FormFormat.blocks ? FormFormat.blocks : FormFormat.jsonForms, values });
|
|
30
|
+
}, querySchema(scalars));
|
|
31
|
+
}
|
|
32
|
+
function typed(value, node) {
|
|
33
|
+
const type = node.type();
|
|
34
|
+
if ((type === 'number' || type === 'integer') && value.trim() !== '' && Number.isFinite(Number(value))) {
|
|
35
|
+
return Number(value);
|
|
36
|
+
}
|
|
37
|
+
return type === 'boolean' && (value === 'true' || value === 'false') ? value === 'true' : value;
|
|
38
|
+
}
|
|
39
|
+
function querySchema(scalars) {
|
|
40
|
+
return {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
format: {
|
|
44
|
+
enum: FORMATS,
|
|
45
|
+
default: FormFormat.jsonForms,
|
|
46
|
+
description: 'JSON Forms (schema, UI schema, data), or the neutral tree of blocks.',
|
|
47
|
+
},
|
|
48
|
+
...Object.fromEntries([...scalars.keys()].map((name) => [
|
|
49
|
+
name,
|
|
50
|
+
{
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: `A value of ${name} known in advance: it prefills the form and names the element its rules are asked about.`,
|
|
53
|
+
},
|
|
54
|
+
])),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=form-query-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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AAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;AAClG,CAAC;AAED,SAAS,WAAW,CAAC,OAAwC;IAC3D,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,UAAU,CAAC,SAAS;gBAC7B,WAAW,EAAE,sEAAsE;aACpF;YACD,GAAG,MAAM,CAAC,WAAW,CACnB,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBAChC,IAAI;gBACJ;oBACE,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,cAAc,IAAI,0FAA0F;iBAC1H;aACF,CAAC,CACH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormFormat } from './form-format.js';
|
|
2
|
+
/** What the request for a form says: the format it wants, and the values known in advance, by field. */
|
|
3
|
+
export interface FormQuery {
|
|
4
|
+
readonly format: FormFormat;
|
|
5
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=form-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-query.d.ts","sourceRoot":"","sources":["../../src/forms/form-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,wGAAwG;AACxG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-query.js","sourceRoot":"","sources":["../../src/forms/form-query.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Actor } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { FieldRequirement } from '../field-access/field-requirement.js';
|
|
3
|
+
/** How the form of a route asks its requirement about the values it is asked with. */
|
|
4
|
+
interface FormAsking<Values> {
|
|
5
|
+
/** The element the requirement is asked about, as `resource` of `@Requires`; absent, none. */
|
|
6
|
+
subject?(values: Values): unknown;
|
|
7
|
+
/** Facts beside the actor and the element, as `context` of `@Requires`: who books for whom. */
|
|
8
|
+
context?(values: Values, actor: Actor): Readonly<Record<string, unknown>>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a caller needs to be given the form of a route: the permission of the use case it
|
|
12
|
+
* describes, asked as its `@Requires` asks it, from the values the form is asked with, or a
|
|
13
|
+
* policy. Refused, the form is answered 403, so that only who may run the use case reads which
|
|
14
|
+
* fields it holds for them.
|
|
15
|
+
*/
|
|
16
|
+
export type FormRequirement<Values = unknown> = FieldRequirement & FormAsking<Values>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=form-requirement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-requirement.d.ts","sourceRoot":"","sources":["../../src/forms/form-requirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,sFAAsF;AACtF,UAAU,UAAU,CAAC,MAAM;IACzB,8FAA8F;IAC9F,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC,+FAA+F;IAC/F,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC3E;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,OAAO,IAAI,gBAAgB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-requirement.js","sourceRoot":"","sources":["../../src/forms/form-requirement.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FieldDecider } from '../field-access/field-decider.js';
|
|
2
|
+
import type { Route } from '../route/route.js';
|
|
3
|
+
export interface FormRoutesOptions {
|
|
4
|
+
/** Decides the fields the request schemas reserve: the same as `fieldAccess` of the mount options. Left out, every restricted field is absent. */
|
|
5
|
+
readonly fieldAccess?: FieldDecider;
|
|
6
|
+
/** Where the forms are served. Default: `/forms`. */
|
|
7
|
+
readonly prefix?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One route per route that declares a `form`: `GET /forms/<operationId>` answers its form for
|
|
11
|
+
* the caller, in JSON Forms or as a tree of blocks (`?format=blocks`). It is guarded as the
|
|
12
|
+
* route it describes is documented: a form of a route that is not public refuses the
|
|
13
|
+
* anonymous caller, and one that `requires` the permission of its use case refuses with 403 the
|
|
14
|
+
* caller who may not run it. Mounted and documented like any route:
|
|
15
|
+
*
|
|
16
|
+
* const routes = defineRoutes(appRoutes, formRoutes(appRoutes, { fieldAccess }));
|
|
17
|
+
*/
|
|
18
|
+
export declare function formRoutes(routes: readonly Route[], options?: FormRoutesOptions): readonly Route[];
|
|
19
|
+
//# sourceMappingURL=form-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-routes.d.ts","sourceRoot":"","sources":["../../src/forms/form-routes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAY/C,MAAM,WAAW,iBAAiB;IAChC,kJAAkJ;IAClJ,QAAQ,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;IACpC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAID;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,OAAO,GAAE,iBAAsB,GAAG,SAAS,KAAK,EAAE,CAOtG"}
|