@ddd-ts-kit/http 0.13.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 +319 -9
- 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/mount-hono.d.ts +4 -2
- package/dist/hono/mount-hono.d.ts.map +1 -1
- package/dist/hono/mount-hono.js +19 -7
- package/dist/hono/mount-hono.js.map +1 -1
- package/dist/hono/read-body.d.ts +4 -3
- package/dist/hono/read-body.d.ts.map +1 -1
- package/dist/hono/read-body.js +12 -5
- package/dist/hono/read-body.js.map +1 -1
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -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/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/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 +2 -1
- package/dist/pagination/page-schema-of.d.ts.map +1 -1
- package/dist/pagination/page-schema-of.js +6 -2
- 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/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 +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text of a scalar in every representation that is not JSON, by the rules JSON follows:
|
|
3
|
+
* an instant in ISO 8601 UTC, a boolean as `true` or `false`, a number as JavaScript writes it,
|
|
4
|
+
* a big integer in full. `undefined` for nothing (`null`, `undefined`) and for what is no scalar.
|
|
5
|
+
*/
|
|
6
|
+
export declare function wireText(value: unknown): string | undefined;
|
|
7
|
+
//# sourceMappingURL=wire-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-text.d.ts","sourceRoot":"","sources":["../../src/representation/wire-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAkB3D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text of a scalar in every representation that is not JSON, by the rules JSON follows:
|
|
3
|
+
* an instant in ISO 8601 UTC, a boolean as `true` or `false`, a number as JavaScript writes it,
|
|
4
|
+
* a big integer in full. `undefined` for nothing (`null`, `undefined`) and for what is no scalar.
|
|
5
|
+
*/
|
|
6
|
+
export function wireText(value) {
|
|
7
|
+
if (value instanceof Date) {
|
|
8
|
+
return value.toISOString();
|
|
9
|
+
}
|
|
10
|
+
if (typeof value === 'string') {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
if (typeof value === 'number') {
|
|
14
|
+
return Number.isFinite(value) ? String(value) : undefined;
|
|
15
|
+
}
|
|
16
|
+
if (typeof value === 'boolean' || typeof value === 'bigint') {
|
|
17
|
+
return String(value);
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=wire-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-text.js","sourceRoot":"","sources":["../../src/representation/wire-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5D,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-entities.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/decode-entities.ts"],"names":[],"mappings":"AAgBA,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQlD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { XmlSyntaxError } from './xml-syntax-error.js';
|
|
2
|
+
// A map, not an object: `&constructor;` names no entity, whatever an object inherits.
|
|
3
|
+
const PREDEFINED = new Map([
|
|
4
|
+
['lt', '<'],
|
|
5
|
+
['gt', '>'],
|
|
6
|
+
['amp', '&'],
|
|
7
|
+
['quot', '"'],
|
|
8
|
+
['apos', "'"],
|
|
9
|
+
]);
|
|
10
|
+
const REFERENCE = /&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z]+);|&/g;
|
|
11
|
+
const HEXADECIMAL = 16;
|
|
12
|
+
const DECIMAL = 10;
|
|
13
|
+
const LAST_CODE_POINT = 0x10ffff;
|
|
14
|
+
/** Character data with its references replaced: the five predefined entities and numeric references, nothing else. */
|
|
15
|
+
export function decodeEntities(raw) {
|
|
16
|
+
return raw.replace(REFERENCE, (whole, reference) => {
|
|
17
|
+
if (reference === undefined) {
|
|
18
|
+
throw new XmlSyntaxError('a lone "&" in character data');
|
|
19
|
+
}
|
|
20
|
+
return characterOf(reference, whole);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function characterOf(reference, whole) {
|
|
24
|
+
const predefined = PREDEFINED.get(reference);
|
|
25
|
+
if (predefined !== undefined) {
|
|
26
|
+
return predefined;
|
|
27
|
+
}
|
|
28
|
+
if (!reference.startsWith('#')) {
|
|
29
|
+
throw new XmlSyntaxError(`the entity ${whole} is not declared`);
|
|
30
|
+
}
|
|
31
|
+
const hexadecimal = reference.startsWith('#x');
|
|
32
|
+
const code = Number.parseInt(reference.slice(hexadecimal ? 2 : 1), hexadecimal ? HEXADECIMAL : DECIMAL);
|
|
33
|
+
if (code === 0 || code > LAST_CODE_POINT) {
|
|
34
|
+
throw new XmlSyntaxError(`the character reference ${whole} is out of range`);
|
|
35
|
+
}
|
|
36
|
+
return String.fromCodePoint(code);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=decode-entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-entities.js","sourceRoot":"","sources":["../../../src/representation/xml/decode-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,sFAAsF;AACtF,MAAM,UAAU,GAAgC,IAAI,GAAG,CAAC;IACtD,CAAC,IAAI,EAAE,GAAG,CAAC;IACX,CAAC,IAAI,EAAE,GAAG,CAAC;IACX,CAAC,KAAK,EAAE,GAAG,CAAC;IACZ,CAAC,MAAM,EAAE,GAAG,CAAC;IACb,CAAC,MAAM,EAAE,GAAG,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAC5D,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEjC,sHAAsH;AACtH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,SAA6B,EAAE,EAAE;QACrE,IAAI,SAAS,KAAK,SAAS,EAAE,C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\p{N}._-]*$/u;
|
|
2
|
+
/** Whether a property name can be written as the name of an element as it is: no colon, no space, no leading digit. */
|
|
3
|
+
export function isXmlName(name) {
|
|
4
|
+
return NAME.test(name);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=is-xml-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-xml-name.js","sourceRoot":"","sources":["../../../src/representation/xml/is-xml-name.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,6BAA6B,CAAC;AAE3C,uHAAuH;AACvH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The names the XML convention of the kit uses, in the writer and the reader alike. */
|
|
2
|
+
export declare const XML_DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
3
|
+
export declare const XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance";
|
|
4
|
+
export declare const NIL_ATTRIBUTE = "xsi:nil=\"true\"";
|
|
5
|
+
/** The element of one item of a list at the root or wrapped, unless the schema of the items names it. */
|
|
6
|
+
export declare const ITEM_ELEMENT = "item";
|
|
7
|
+
/** The element of a property whose name cannot be an element name, which `key` then carries. */
|
|
8
|
+
export declare const ENTRY_ELEMENT = "entry";
|
|
9
|
+
export declare const KEY_ATTRIBUTE = "key";
|
|
10
|
+
//# sourceMappingURL=xml-convention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-convention.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-convention.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,eAAe,+CAA2C,CAAC;AACxE,eAAO,MAAM,aAAa,8CAA8C,CAAC;AACzE,eAAO,MAAM,aAAa,qBAAmB,CAAC;AAC9C,yGAAyG;AACzG,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC,gGAAgG;AAChG,eAAO,MAAM,aAAa,UAAU,CAAC;AACrC,eAAO,MAAM,aAAa,QAAQ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The names the XML convention of the kit uses, in the writer and the reader alike. */
|
|
2
|
+
export const XML_DECLARATION = '<?xml version="1.0" encoding="UTF-8"?>';
|
|
3
|
+
export const XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance';
|
|
4
|
+
export const NIL_ATTRIBUTE = 'xsi:nil="true"';
|
|
5
|
+
/** The element of one item of a list at the root or wrapped, unless the schema of the items names it. */
|
|
6
|
+
export const ITEM_ELEMENT = 'item';
|
|
7
|
+
/** The element of a property whose name cannot be an element name, which `key` then carries. */
|
|
8
|
+
export const ENTRY_ELEMENT = 'entry';
|
|
9
|
+
export const KEY_ATTRIBUTE = 'key';
|
|
10
|
+
//# sourceMappingURL=xml-convention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-convention.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-convention.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,wCAAwC,CAAC;AACxE,MAAM,CAAC,MAAM,aAAa,GAAG,2CAA2C,CAAC;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAC9C,yGAAyG;AACzG,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AACnC,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AACrC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SchemaNode } from '../../schema/schema-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Writes one value as XML by the convention of the kit, which is the default of the XML object
|
|
4
|
+
* of OpenAPI: a property is an element of its name, a scalar marked `xml.attribute` an attribute,
|
|
5
|
+
* a list one element per item named after the property unless `xml.wrapped`, `null` an empty
|
|
6
|
+
* element with `xsi:nil="true"` and a missing value nothing at all.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XmlElementWriter {
|
|
9
|
+
element(name: string, value: unknown, node: SchemaNode): string;
|
|
10
|
+
items(values: readonly unknown[], node: SchemaNode): string;
|
|
11
|
+
private tagged;
|
|
12
|
+
private attributesOf;
|
|
13
|
+
private members;
|
|
14
|
+
private member;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=xml-element-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-element-writer.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-element-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAezD;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAE9D;IAED,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAK1D;IAED,OAAO,CAAC,MAAM;IAgBd,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,MAAM;CAmBf"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SchemaNode } from '../../schema/schema-node.js';
|
|
2
|
+
import { isRecord } from '../../support/is-record.js';
|
|
3
|
+
import { wireText } from '../wire-text.js';
|
|
4
|
+
import { ENTRY_ELEMENT, ITEM_ELEMENT, KEY_ATTRIBUTE, NIL_ATTRIBUTE } from './xml-convention.js';
|
|
5
|
+
import { isXmlName } from './is-xml-name.js';
|
|
6
|
+
import { xmlText } from './xml-text.js';
|
|
7
|
+
const ANY = SchemaNode.of({});
|
|
8
|
+
/**
|
|
9
|
+
* Writes one value as XML by the convention of the kit, which is the default of the XML object
|
|
10
|
+
* of OpenAPI: a property is an element of its name, a scalar marked `xml.attribute` an attribute,
|
|
11
|
+
* a list one element per item named after the property unless `xml.wrapped`, `null` an empty
|
|
12
|
+
* element with `xsi:nil="true"` and a missing value nothing at all.
|
|
13
|
+
*/
|
|
14
|
+
export class XmlElementWriter {
|
|
15
|
+
element(name, value, node) {
|
|
16
|
+
return this.tagged({ name, attributes: '' }, value, node);
|
|
17
|
+
}
|
|
18
|
+
items(values, node) {
|
|
19
|
+
const items = node.items();
|
|
20
|
+
const name = items.xml().name ?? ITEM_ELEMENT;
|
|
21
|
+
return values.map((value) => this.element(name, value, items)).join('');
|
|
22
|
+
}
|
|
23
|
+
tagged({ name, attributes }, value, node) {
|
|
24
|
+
if (value === null) {
|
|
25
|
+
return `<${name}${attributes} ${NIL_ATTRIBUTE}/>`;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
return `<${name}${attributes}>${this.items(value, node)}</${name}>`;
|
|
29
|
+
}
|
|
30
|
+
if (isRecord(value) && !(value instanceof Date)) {
|
|
31
|
+
return `<${name}${attributes}${this.attributesOf(value, node)}>${this.members(value, node)}</${name}>`;
|
|
32
|
+
}
|
|
33
|
+
return `<${name}${attributes}>${xmlText(wireText(value) ?? '')}</${name}>`;
|
|
34
|
+
}
|
|
35
|
+
attributesOf(record, node) {
|
|
36
|
+
return node
|
|
37
|
+
.properties()
|
|
38
|
+
.filter(([, child]) => child.xml().attribute === true)
|
|
39
|
+
.map(([key, child]) => ({ name: child.xml().name ?? key, text: wireText(record[key]) }))
|
|
40
|
+
.map(({ name, text }) => (text === undefined ? '' : ` ${name}="${xmlText(text)}"`))
|
|
41
|
+
.join('');
|
|
42
|
+
}
|
|
43
|
+
members(record, node) {
|
|
44
|
+
const declared = new Map(node.properties());
|
|
45
|
+
return Object.entries(record)
|
|
46
|
+
.filter(([key]) => declared.get(key)?.xml().attribute !== true)
|
|
47
|
+
.sort(([a], [b]) => orderOf(declared, a) - orderOf(declared, b))
|
|
48
|
+
.map(([key, value]) => this.member(key, value, declared.get(key) ?? ANY))
|
|
49
|
+
.join('');
|
|
50
|
+
}
|
|
51
|
+
member(key, value, node) {
|
|
52
|
+
if (value === undefined) {
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
const name = node.xml().name ?? key;
|
|
56
|
+
if (!isXmlName(name)) {
|
|
57
|
+
return this.tagged({ name: ENTRY_ELEMENT, attributes: ` ${KEY_ATTRIBUTE}="${xmlText(name)}"` }, value, node);
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(value) && node.xml().wrapped !== true) {
|
|
60
|
+
const items = node.items();
|
|
61
|
+
return value.map((item) => this.element(items.xml().name ?? name, item, items)).join('');
|
|
62
|
+
}
|
|
63
|
+
return this.element(name, value, node);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Declared properties first, in the order of the schema; the others after, in the order of the value. */
|
|
67
|
+
function orderOf(declared, key) {
|
|
68
|
+
const index = [...declared.keys()].indexOf(key);
|
|
69
|
+
return index === -1 ? declared.size : index;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=xml-element-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-element-writer.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-element-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,GAAG,GAAG,UAAU,CAAC,EAAE,CAA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AAC1G,SAAS,OAAO,CAAC,QAAyC,EAAE,GAAW;IACrE,MAAM,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhD,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** One element of a parsed XML document: its qualified name, its attributes, its child elements and its text. */
|
|
2
|
+
export interface XmlElement {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly attributes: Readonly<Record<string, string>>;
|
|
5
|
+
readonly children: readonly XmlElement[];
|
|
6
|
+
/** The text directly inside the element, character data and CDATA sections joined, entities decoded. */
|
|
7
|
+
readonly text: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=xml-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-element.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-element.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,wGAAwG;IACxG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-element.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-element.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { XmlElement } from './xml-element.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parses the subset of XML 1.0 a request body needs: elements, attributes, character data,
|
|
4
|
+
* CDATA sections, comments, processing instructions, the five predefined entities and character
|
|
5
|
+
* references. A document type declaration is refused, and with it every external or recursive
|
|
6
|
+
* entity: nothing in a body can make the parser read a file or expand without end.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XmlParser {
|
|
9
|
+
private readonly source;
|
|
10
|
+
private position;
|
|
11
|
+
constructor(source: string);
|
|
12
|
+
static parse(source: string): XmlElement;
|
|
13
|
+
private document;
|
|
14
|
+
/** Spaces, comments and processing instructions, where the document allows them. */
|
|
15
|
+
private miscellany;
|
|
16
|
+
private element;
|
|
17
|
+
private attributes;
|
|
18
|
+
private content;
|
|
19
|
+
private contentPart;
|
|
20
|
+
private characterData;
|
|
21
|
+
private name;
|
|
22
|
+
private expect;
|
|
23
|
+
/** Moves past the next `end`, and answers where `end` starts. */
|
|
24
|
+
private skipPast;
|
|
25
|
+
private match;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=xml-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-parser.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAanD;;;;;GAKG;AACH,qBAAa,SAAS;IAGR,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAK;IAErB,YAA6B,MAAM,EAAE,MAAM,EAAI;IAE/C,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEvC;IAED,OAAO,CAAC,QAAQ;IAkBhB,oFAAoF;IACpF,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,OAAO;IA2Bf,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,MAAM;IAQd,iEAAiE;IACjE,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,KAAK;CAad"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { decodeEntities } from './decode-entities.js';
|
|
2
|
+
import { XmlSyntaxError } from './xml-syntax-error.js';
|
|
3
|
+
const NAME = /[\p{L}_:][\p{L}\p{N}._:-]*/uy;
|
|
4
|
+
const SPACE = /\s*/y;
|
|
5
|
+
const ATTRIBUTE_VALUE = /"([^"<]*)"|'([^'<]*)'/y;
|
|
6
|
+
const MAX_DEPTH = 64;
|
|
7
|
+
/**
|
|
8
|
+
* Parses the subset of XML 1.0 a request body needs: elements, attributes, character data,
|
|
9
|
+
* CDATA sections, comments, processing instructions, the five predefined entities and character
|
|
10
|
+
* references. A document type declaration is refused, and with it every external or recursive
|
|
11
|
+
* entity: nothing in a body can make the parser read a file or expand without end.
|
|
12
|
+
*/
|
|
13
|
+
export class XmlParser {
|
|
14
|
+
source;
|
|
15
|
+
position = 0;
|
|
16
|
+
constructor(source) {
|
|
17
|
+
this.source = source;
|
|
18
|
+
}
|
|
19
|
+
static parse(source) {
|
|
20
|
+
return new XmlParser(source).document();
|
|
21
|
+
}
|
|
22
|
+
document() {
|
|
23
|
+
this.miscellany();
|
|
24
|
+
if (this.source.startsWith('<!DOCTYPE', this.position)) {
|
|
25
|
+
throw new XmlSyntaxError('a document type declaration is not accepted');
|
|
26
|
+
}
|
|
27
|
+
const root = this.element(1);
|
|
28
|
+
this.miscellany();
|
|
29
|
+
if (this.position < this.source.length) {
|
|
30
|
+
throw new XmlSyntaxError('content after the root element');
|
|
31
|
+
}
|
|
32
|
+
return root;
|
|
33
|
+
}
|
|
34
|
+
/** Spaces, comments and processing instructions, where the document allows them. */
|
|
35
|
+
miscellany() {
|
|
36
|
+
for (;;) {
|
|
37
|
+
this.match(SPACE);
|
|
38
|
+
if (this.source.startsWith('<?', this.position)) {
|
|
39
|
+
this.skipPast('?>');
|
|
40
|
+
}
|
|
41
|
+
else if (this.source.startsWith('<!--', this.position)) {
|
|
42
|
+
this.skipPast('-->');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
element(depth) {
|
|
50
|
+
if (depth > MAX_DEPTH) {
|
|
51
|
+
throw new XmlSyntaxError(`elements nested deeper than ${String(MAX_DEPTH)}`);
|
|
52
|
+
}
|
|
53
|
+
this.expect('<');
|
|
54
|
+
const name = this.name();
|
|
55
|
+
const attributes = this.attributes();
|
|
56
|
+
if (this.source.startsWith('/>', this.position)) {
|
|
57
|
+
this.position += 2;
|
|
58
|
+
return { name, attributes, children: [], text: '' };
|
|
59
|
+
}
|
|
60
|
+
this.expect('>');
|
|
61
|
+
const content = this.content(depth);
|
|
62
|
+
this.expect(`</${name}`);
|
|
63
|
+
this.match(SPACE);
|
|
64
|
+
this.expect('>');
|
|
65
|
+
return { name, attributes, ...content };
|
|
66
|
+
}
|
|
67
|
+
attributes() {
|
|
68
|
+
const attributes = {};
|
|
69
|
+
for (;;) {
|
|
70
|
+
this.match(SPACE);
|
|
71
|
+
if (!/[\p{L}_:]/u.test(this.source.charAt(this.position))) {
|
|
72
|
+
return attributes;
|
|
73
|
+
}
|
|
74
|
+
const name = this.name();
|
|
75
|
+
this.match(SPACE);
|
|
76
|
+
this.expect('=');
|
|
77
|
+
this.match(SPACE);
|
|
78
|
+
const value = this.match(ATTRIBUTE_VALUE);
|
|
79
|
+
if (value === undefined || Object.hasOwn(attributes, name)) {
|
|
80
|
+
throw new XmlSyntaxError(`the attribute ${name} is malformed or repeated`);
|
|
81
|
+
}
|
|
82
|
+
// Defined, not assigned: an attribute named __proto__ is an attribute like any other.
|
|
83
|
+
Object.defineProperty(attributes, name, {
|
|
84
|
+
value: decodeEntities(value[1] ?? value[2] ?? ''),
|
|
85
|
+
enumerable: true,
|
|
86
|
+
writable: true,
|
|
87
|
+
configurable: true,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
content(depth) {
|
|
92
|
+
const content = { children: [], text: '' };
|
|
93
|
+
while (!this.source.startsWith('</', this.position)) {
|
|
94
|
+
this.contentPart(content, depth);
|
|
95
|
+
}
|
|
96
|
+
return content;
|
|
97
|
+
}
|
|
98
|
+
contentPart(content, depth) {
|
|
99
|
+
if (this.position >= this.source.length) {
|
|
100
|
+
throw new XmlSyntaxError('an element is not closed');
|
|
101
|
+
}
|
|
102
|
+
if (this.source.startsWith('<![CDATA[', this.position)) {
|
|
103
|
+
const start = this.position + '<![CDATA['.length;
|
|
104
|
+
content.text += this.source.slice(start, this.skipPast(']]>'));
|
|
105
|
+
}
|
|
106
|
+
else if (this.source.startsWith('<!--', this.position) || this.source.startsWith('<?', this.position)) {
|
|
107
|
+
this.miscellany();
|
|
108
|
+
}
|
|
109
|
+
else if (this.source.startsWith('<', this.position)) {
|
|
110
|
+
content.children.push(this.element(depth + 1));
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
content.text += this.characterData();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
characterData() {
|
|
117
|
+
const end = this.source.indexOf('<', this.position);
|
|
118
|
+
const raw = this.source.slice(this.position, end === -1 ? this.source.length : end);
|
|
119
|
+
this.position += raw.length;
|
|
120
|
+
return decodeEntities(raw);
|
|
121
|
+
}
|
|
122
|
+
name() {
|
|
123
|
+
const name = this.match(NAME)?.[0];
|
|
124
|
+
if (name === undefined) {
|
|
125
|
+
throw new XmlSyntaxError('a name was expected');
|
|
126
|
+
}
|
|
127
|
+
return name;
|
|
128
|
+
}
|
|
129
|
+
expect(text) {
|
|
130
|
+
if (!this.source.startsWith(text, this.position)) {
|
|
131
|
+
throw new XmlSyntaxError(`"${text}" was expected`);
|
|
132
|
+
}
|
|
133
|
+
this.position += text.length;
|
|
134
|
+
}
|
|
135
|
+
/** Moves past the next `end`, and answers where `end` starts. */
|
|
136
|
+
skipPast(end) {
|
|
137
|
+
const at = this.source.indexOf(end, this.position);
|
|
138
|
+
if (at === -1) {
|
|
139
|
+
throw new XmlSyntaxError(`"${end}" was expected`);
|
|
140
|
+
}
|
|
141
|
+
this.position = at + end.length;
|
|
142
|
+
return at;
|
|
143
|
+
}
|
|
144
|
+
match(pattern) {
|
|
145
|
+
pattern.lastIndex = this.position;
|
|
146
|
+
const found = pattern.exec(this.source);
|
|
147
|
+
if (found === null) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
this.position += found[0].length;
|
|
151
|
+
return found;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=xml-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-parser.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,KAAK,GAAG,MAAM,CAAC;AACrB,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,MAAM,SAAS,GAAG,EAAE,CAAC;AAOrB;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IAGS,MAAM;IAF3B,QAAQ,GAAG,CAAC,CAAC;IAErB,YAA6B,MAAc;sBAAd,MAAM;IAAW,CAAC;IAE/C,MAAM,CAAC,KAAK,CAAC,MAAc;QACzB,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1C,CAAC;IAEO,QAAQ;QACd,IAAI,CAAC,UAAU,EAAE,CAAC;QAElB,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,cAAc,CAAC,6CAA6C,CAAC,CAAC;QAC1E,CAAC;QAED,MAAM,IAAI,GA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AAC;IAED,iEAAiE;IACzD,QAAQ,CAAC,GAAW;QAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEnD,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,cAAc,CAAC,IAAI,GAAG,gBAAgB,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;QAEhC,OAAO,EAAE,CAAC;IACZ,CAAC;IAEO,KAAK,CAAC,OAAe;QAC3B,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;QAElC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAEjC,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BodyShape } from '../body-shape.js';
|
|
2
|
+
import type { RepresentedBody } from '../represented-body.js';
|
|
3
|
+
import type { Representation } from '../representation.js';
|
|
4
|
+
/**
|
|
5
|
+
* `application/xml`, and `application/problem+xml` for a refusal: the JSON model written as XML,
|
|
6
|
+
* element names and attributes taken from the response schema and its XML object, never a
|
|
7
|
+
* vocabulary of its own. A body sent as XML is read back by the same convention into the value
|
|
8
|
+
* the JSON path produces, then validated by the same schema. No library: the parser reads only
|
|
9
|
+
* what a body needs and refuses any document type declaration.
|
|
10
|
+
*/
|
|
11
|
+
export declare class XmlRepresentation implements Representation {
|
|
12
|
+
readonly mediaType = "application/xml";
|
|
13
|
+
readonly problemMediaType = "application/problem+xml";
|
|
14
|
+
private readonly writer;
|
|
15
|
+
private readonly reader;
|
|
16
|
+
write(body: unknown, shape: BodyShape): RepresentedBody;
|
|
17
|
+
read(text: string, shape: BodyShape): unknown;
|
|
18
|
+
private streamed;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=xml-representation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-representation.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-representation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQ3D;;;;;;GAMG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACtD,QAAQ,CAAC,SAAS,qBAAc;IAEhC,QAAQ,CAAC,gBAAgB,6BAA6B;IAEtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAEjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAE/C,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GAAG,eAAe,CAStD;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAM5C;YAEc,QAAQ;CAYxB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { SchemaNode } from '../../schema/schema-node.js';
|
|
2
|
+
import { isAsyncIterable } from '../../support/is-async-iterable.js';
|
|
3
|
+
import { malformedBody } from '../malformed-body.js';
|
|
4
|
+
import { ITEM_ELEMENT, XML_DECLARATION, XSI_NAMESPACE } from './xml-convention.js';
|
|
5
|
+
import { XmlElementWriter } from './xml-element-writer.js';
|
|
6
|
+
import { XmlParser } from './xml-parser.js';
|
|
7
|
+
import { XmlValueReader } from './xml-value-reader.js';
|
|
8
|
+
const MEDIA_TYPE = 'application/xml';
|
|
9
|
+
/**
|
|
10
|
+
* `application/xml`, and `application/problem+xml` for a refusal: the JSON model written as XML,
|
|
11
|
+
* element names and attributes taken from the response schema and its XML object, never a
|
|
12
|
+
* vocabulary of its own. A body sent as XML is read back by the same convention into the value
|
|
13
|
+
* the JSON path produces, then validated by the same schema. No library: the parser reads only
|
|
14
|
+
* what a body needs and refuses any document type declaration.
|
|
15
|
+
*/
|
|
16
|
+
export class XmlRepresentation {
|
|
17
|
+
mediaType = MEDIA_TYPE;
|
|
18
|
+
problemMediaType = 'application/problem+xml';
|
|
19
|
+
writer = new XmlElementWriter();
|
|
20
|
+
reader = new XmlValueReader();
|
|
21
|
+
write(body, shape) {
|
|
22
|
+
const node = SchemaNode.of(shape.schema);
|
|
23
|
+
const root = rootOf(node, shape);
|
|
24
|
+
if (isAsyncIterable(body)) {
|
|
25
|
+
return this.streamed(body, { node, root });
|
|
26
|
+
}
|
|
27
|
+
return `${XML_DECLARATION}${this.writer.element(root.name, body, node).replace(`<${root.name}`, root.open)}`;
|
|
28
|
+
}
|
|
29
|
+
read(text, shape) {
|
|
30
|
+
try {
|
|
31
|
+
return this.reader.value(XmlParser.parse(text), SchemaNode.of(shape.schema));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
throw malformedBody(MEDIA_TYPE);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async *streamed(items, { node, root }) {
|
|
38
|
+
const itemNode = node.items();
|
|
39
|
+
const itemName = itemNode.xml().name ?? ITEM_ELEMENT;
|
|
40
|
+
yield `${XML_DECLARATION}${root.open}>`;
|
|
41
|
+
for await (const item of items) {
|
|
42
|
+
yield this.writer.element(itemName, item, itemNode);
|
|
43
|
+
}
|
|
44
|
+
yield `</${root.name}>`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function rootOf(node, shape) {
|
|
48
|
+
const { name = shape.name, namespace } = node.xml();
|
|
49
|
+
const declared = namespace === undefined ? '' : ` xmlns="${namespace}"`;
|
|
50
|
+
return { name, open: `<${name}${declared} xmlns:xsi="${XSI_NAMESPACE}"` };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=xml-representation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-representation.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACnB,SAAS,GAAG,UAAU,CAAC;IAEvB,gBAAgB,GAAG,yBAAyB,CAAC;IAErC,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAEhC,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;IAE/C,KAAK,CAAC,IAAa,EAAE,KAAgB;QACnC,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEjC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,OAA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AAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,GAAG,QAAQ,eAAe,aAAa,GAAG,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-syntax-error.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-syntax-error.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,qBAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,MAAM,EAAE,MAAM,EAGzB;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A body that is not the XML the parser reads: answered as a malformed body, never quoted. */
|
|
2
|
+
export class XmlSyntaxError extends Error {
|
|
3
|
+
constructor(reason) {
|
|
4
|
+
super(`The XML is not well formed: ${reason}.`);
|
|
5
|
+
this.name = 'XmlSyntaxError';
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=xml-syntax-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-syntax-error.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-syntax-error.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,MAAc;QACxB,KAAK,CAAC,+BAA+B,MAAM,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text that is safe as the content of an element or the value of an attribute between quotes.
|
|
3
|
+
* A character XML 1.0 cannot carry at all (most control characters, a lone surrogate) becomes
|
|
4
|
+
* U+FFFD: the document stays well formed, and the loss is visible.
|
|
5
|
+
*/
|
|
6
|
+
export declare function xmlText(value: string): string;
|
|
7
|
+
//# sourceMappingURL=xml-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-text.d.ts","sourceRoot":"","sources":["../../../src/representation/xml/xml-text.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ7C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const REPLACEMENT = '�';
|
|
2
|
+
const ESCAPES = {
|
|
3
|
+
'&': '&',
|
|
4
|
+
'<': '<',
|
|
5
|
+
'>': '>',
|
|
6
|
+
'"': '"',
|
|
7
|
+
"'": ''',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Text that is safe as the content of an element or the value of an attribute between quotes.
|
|
11
|
+
* A character XML 1.0 cannot carry at all (most control characters, a lone surrogate) becomes
|
|
12
|
+
* U+FFFD: the document stays well formed, and the loss is visible.
|
|
13
|
+
*/
|
|
14
|
+
export function xmlText(value) {
|
|
15
|
+
let text = '';
|
|
16
|
+
for (const character of value) {
|
|
17
|
+
text += isXmlCharacter(character.codePointAt(0) ?? 0) ? (ESCAPES[character] ?? character) : REPLACEMENT;
|
|
18
|
+
}
|
|
19
|
+
return text;
|
|
20
|
+
}
|
|
21
|
+
/** The `Char` production of XML 1.0. */
|
|
22
|
+
function isXmlCharacter(code) {
|
|
23
|
+
return (code === 0x9 ||
|
|
24
|
+
code === 0xa ||
|
|
25
|
+
code === 0xd ||
|
|
26
|
+
(code >= 0x20 && code <= 0xd7ff) ||
|
|
27
|
+
(code >= 0xe000 && code <= 0xfffd) ||
|
|
28
|
+
code >= 0x10000);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=xml-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-text.js","sourceRoot":"","sources":["../../../src/representation/xml/xml-text.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,OAAO,GAAqC;IAChD,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC9B,IAAI,IAAI,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;IAC1G,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,wCAAwC;AACxC,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,CACL,IAAI,KAAK,GAAG;QACZ,IAAI,KAAK,GAAG;QACZ,IAAI,KAAK,GAAG;QACZ,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,CAAC;QAChC,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC;QAClC,IAAI,IAAI,OAAO,CAChB,CAAC;AACJ,CAAC"}
|