@elastic/isomer-sdk 0.0.0 → 0.2.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/LICENSE.txt +93 -0
- package/NOTICE.txt +1861 -0
- package/README.md +69 -0
- package/THIRD_PARTY_LICENSES.md +957 -0
- package/dist/author/authored_fields.d.ts +153 -0
- package/dist/author/authored_fields.d.ts.map +1 -0
- package/dist/author/authored_fields.js +227 -0
- package/dist/author/authored_fields.js.map +1 -0
- package/dist/author/authoring_input.d.ts +7 -0
- package/dist/author/authoring_input.d.ts.map +1 -0
- package/dist/author/authoring_input.js +60 -0
- package/dist/author/authoring_input.js.map +1 -0
- package/dist/author/authoring_model.d.ts +27 -0
- package/dist/author/authoring_model.d.ts.map +1 -0
- package/dist/author/authoring_model.js +98 -0
- package/dist/author/authoring_model.js.map +1 -0
- package/dist/author/declarations.d.ts +13 -0
- package/dist/author/declarations.d.ts.map +1 -0
- package/dist/author/declarations.js +277 -0
- package/dist/author/declarations.js.map +1 -0
- package/dist/author/index.d.ts +7 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +12 -0
- package/dist/author/index.js.map +1 -0
- package/dist/author/jsx.d.ts +21 -0
- package/dist/author/jsx.d.ts.map +1 -0
- package/dist/author/jsx.js +20 -0
- package/dist/author/jsx.js.map +1 -0
- package/dist/author/jsx_shim.d.ts +117 -0
- package/dist/author/jsx_shim.d.ts.map +1 -0
- package/dist/author/jsx_shim.js +270 -0
- package/dist/author/jsx_shim.js.map +1 -0
- package/dist/author/prompt.d.ts +58 -0
- package/dist/author/prompt.d.ts.map +1 -0
- package/dist/author/prompt.js +148 -0
- package/dist/author/prompt.js.map +1 -0
- package/dist/author/schema_to_typescript.d.ts +37 -0
- package/dist/author/schema_to_typescript.d.ts.map +1 -0
- package/dist/author/schema_to_typescript.js +286 -0
- package/dist/author/schema_to_typescript.js.map +1 -0
- package/dist/cjs/author/authored_fields.js +233 -0
- package/dist/cjs/author/authored_fields.js.map +1 -0
- package/dist/cjs/author/authoring_input.js +64 -0
- package/dist/cjs/author/authoring_input.js.map +1 -0
- package/dist/cjs/author/authoring_model.js +104 -0
- package/dist/cjs/author/authoring_model.js.map +1 -0
- package/dist/cjs/author/declarations.js +281 -0
- package/dist/cjs/author/declarations.js.map +1 -0
- package/dist/cjs/author/index.js +25 -0
- package/dist/cjs/author/index.js.map +1 -0
- package/dist/cjs/author/jsx.js +24 -0
- package/dist/cjs/author/jsx.js.map +1 -0
- package/dist/cjs/author/jsx_shim.js +276 -0
- package/dist/cjs/author/jsx_shim.js.map +1 -0
- package/dist/cjs/author/prompt.js +153 -0
- package/dist/cjs/author/prompt.js.map +1 -0
- package/dist/cjs/author/schema_to_typescript.js +295 -0
- package/dist/cjs/author/schema_to_typescript.js.map +1 -0
- package/dist/cjs/composition/action_event.js +9 -0
- package/dist/cjs/composition/action_event.js.map +1 -0
- package/dist/cjs/composition/body_node_base.js +112 -0
- package/dist/cjs/composition/body_node_base.js.map +1 -0
- package/dist/cjs/composition/composition.js +9 -0
- package/dist/cjs/composition/composition.js.map +1 -0
- package/dist/cjs/composition/error.js +73 -0
- package/dist/cjs/composition/error.js.map +1 -0
- package/dist/cjs/composition/index.js +32 -0
- package/dist/cjs/composition/index.js.map +1 -0
- package/dist/cjs/composition/map_nodes.js +85 -0
- package/dist/cjs/composition/map_nodes.js.map +1 -0
- package/dist/cjs/composition/named_color.js +20 -0
- package/dist/cjs/composition/named_color.js.map +1 -0
- package/dist/cjs/composition/node.js +9 -0
- package/dist/cjs/composition/node.js.map +1 -0
- package/dist/cjs/composition/one_line.js +23 -0
- package/dist/cjs/composition/one_line.js.map +1 -0
- package/dist/cjs/composition/structured_value.js +21 -0
- package/dist/cjs/composition/structured_value.js.map +1 -0
- package/dist/cjs/composition/validation_error.js +40 -0
- package/dist/cjs/composition/validation_error.js.map +1 -0
- package/dist/cjs/define/frame.js +31 -0
- package/dist/cjs/define/frame.js.map +1 -0
- package/dist/cjs/define/index.js +31 -0
- package/dist/cjs/define/index.js.map +1 -0
- package/dist/cjs/define/markdown_content.js +12 -0
- package/dist/cjs/define/markdown_content.js.map +1 -0
- package/dist/cjs/define/primitive_example.js +26 -0
- package/dist/cjs/define/primitive_example.js.map +1 -0
- package/dist/cjs/define/primitive_icon.js +17 -0
- package/dist/cjs/define/primitive_icon.js.map +1 -0
- package/dist/cjs/define/primitive_module.js +118 -0
- package/dist/cjs/define/primitive_module.js.map +1 -0
- package/dist/cjs/define/slack_assets.js +9 -0
- package/dist/cjs/define/slack_assets.js.map +1 -0
- package/dist/cjs/define/slack_blocks.js +9 -0
- package/dist/cjs/define/slack_blocks.js.map +1 -0
- package/dist/cjs/define/zod_format.js +122 -0
- package/dist/cjs/define/zod_format.js.map +1 -0
- package/dist/cjs/define/zod_helpers.js +26 -0
- package/dist/cjs/define/zod_helpers.js.map +1 -0
- package/dist/cjs/entries/html.js +12 -0
- package/dist/cjs/entries/html.js.map +1 -0
- package/dist/cjs/entries/index.js +80 -0
- package/dist/cjs/entries/index.js.map +1 -0
- package/dist/cjs/entries/markdown.js +14 -0
- package/dist/cjs/entries/markdown.js.map +1 -0
- package/dist/cjs/entries/react.js +20 -0
- package/dist/cjs/entries/react.js.map +1 -0
- package/dist/cjs/entries/slack.js +25 -0
- package/dist/cjs/entries/slack.js.map +1 -0
- package/dist/cjs/entries/text.js +12 -0
- package/dist/cjs/entries/text.js.map +1 -0
- package/dist/cjs/pack/capabilities.js +40 -0
- package/dist/cjs/pack/capabilities.js.map +1 -0
- package/dist/cjs/pack/compose.js +59 -0
- package/dist/cjs/pack/compose.js.map +1 -0
- package/dist/cjs/pack/enhancements.js +65 -0
- package/dist/cjs/pack/enhancements.js.map +1 -0
- package/dist/cjs/pack/index.js +18 -0
- package/dist/cjs/pack/index.js.map +1 -0
- package/dist/cjs/pack/primitive_pack.js +97 -0
- package/dist/cjs/pack/primitive_pack.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/render/anchors.js +167 -0
- package/dist/cjs/render/anchors.js.map +1 -0
- package/dist/cjs/render/context_view.js +54 -0
- package/dist/cjs/render/context_view.js.map +1 -0
- package/dist/cjs/render/format_display_value.js +143 -0
- package/dist/cjs/render/format_display_value.js.map +1 -0
- package/dist/cjs/render/format_number.js +46 -0
- package/dist/cjs/render/format_number.js.map +1 -0
- package/dist/cjs/render/html/enhancements.js +30 -0
- package/dist/cjs/render/html/enhancements.js.map +1 -0
- package/dist/cjs/render/html/envelope.js +218 -0
- package/dist/cjs/render/html/envelope.js.map +1 -0
- package/dist/cjs/render/html/index.js +12 -0
- package/dist/cjs/render/html/index.js.map +1 -0
- package/dist/cjs/render/index.js +25 -0
- package/dist/cjs/render/index.js.map +1 -0
- package/dist/cjs/render/layout_check.js +133 -0
- package/dist/cjs/render/layout_check.js.map +1 -0
- package/dist/cjs/render/markdown/builder.js +195 -0
- package/dist/cjs/render/markdown/builder.js.map +1 -0
- package/dist/cjs/render/markdown/envelope.js +33 -0
- package/dist/cjs/render/markdown/envelope.js.map +1 -0
- package/dist/cjs/render/markdown/format.js +208 -0
- package/dist/cjs/render/markdown/format.js.map +1 -0
- package/dist/cjs/render/markdown/index.js +15 -0
- package/dist/cjs/render/markdown/index.js.map +1 -0
- package/dist/cjs/render/measure_dom.js +61 -0
- package/dist/cjs/render/measure_dom.js.map +1 -0
- package/dist/cjs/render/payload.js +13 -0
- package/dist/cjs/render/payload.js.map +1 -0
- package/dist/cjs/render/primitive_dispatch.js +173 -0
- package/dist/cjs/render/primitive_dispatch.js.map +1 -0
- package/dist/cjs/render/react/content.js +44 -0
- package/dist/cjs/render/react/content.js.map +1 -0
- package/dist/cjs/render/react/enhancements.js +32 -0
- package/dist/cjs/render/react/enhancements.js.map +1 -0
- package/dist/cjs/render/react/index.js +15 -0
- package/dist/cjs/render/react/index.js.map +1 -0
- package/dist/cjs/render/slack/assets.js +45 -0
- package/dist/cjs/render/slack/assets.js.map +1 -0
- package/dist/cjs/render/slack/blocks.js +80 -0
- package/dist/cjs/render/slack/blocks.js.map +1 -0
- package/dist/cjs/render/slack/envelope.js +551 -0
- package/dist/cjs/render/slack/envelope.js.map +1 -0
- package/dist/cjs/render/slack/format.js +225 -0
- package/dist/cjs/render/slack/format.js.map +1 -0
- package/dist/cjs/render/slack/index.js +30 -0
- package/dist/cjs/render/slack/index.js.map +1 -0
- package/dist/cjs/render/slack/markdown_content.js +409 -0
- package/dist/cjs/render/slack/markdown_content.js.map +1 -0
- package/dist/cjs/render/text/envelope.js +21 -0
- package/dist/cjs/render/text/envelope.js.map +1 -0
- package/dist/cjs/render/text/index.js +12 -0
- package/dist/cjs/render/text/index.js.map +1 -0
- package/dist/cjs/testing/conformance.js +312 -0
- package/dist/cjs/testing/conformance.js.map +1 -0
- package/dist/cjs/testing/icon.js +248 -0
- package/dist/cjs/testing/icon.js.map +1 -0
- package/dist/cjs/testing/index.js +18 -0
- package/dist/cjs/testing/index.js.map +1 -0
- package/dist/cjs/testing/registration.js +142 -0
- package/dist/cjs/testing/registration.js.map +1 -0
- package/dist/cjs/validate/authoring_schema.js +312 -0
- package/dist/cjs/validate/authoring_schema.js.map +1 -0
- package/dist/cjs/validate/composition_schema.js +135 -0
- package/dist/cjs/validate/composition_schema.js.map +1 -0
- package/dist/cjs/validate/index.js +53 -0
- package/dist/cjs/validate/index.js.map +1 -0
- package/dist/cjs/validate/input_budget.js +156 -0
- package/dist/cjs/validate/input_budget.js.map +1 -0
- package/dist/cjs/validate/json_schema.js +72 -0
- package/dist/cjs/validate/json_schema.js.map +1 -0
- package/dist/cjs/validate/node_issues.js +65 -0
- package/dist/cjs/validate/node_issues.js.map +1 -0
- package/dist/cjs/validate/url.js +116 -0
- package/dist/cjs/validate/url.js.map +1 -0
- package/dist/cjs/validate/validation.js +165 -0
- package/dist/cjs/validate/validation.js.map +1 -0
- package/dist/cjs/validate/value_schemas.js +53 -0
- package/dist/cjs/validate/value_schemas.js.map +1 -0
- package/dist/composition/action_event.d.ts +13 -0
- package/dist/composition/action_event.d.ts.map +1 -0
- package/dist/composition/action_event.js +8 -0
- package/dist/composition/action_event.js.map +1 -0
- package/dist/composition/body_node_base.d.ts +72 -0
- package/dist/composition/body_node_base.d.ts.map +1 -0
- package/dist/composition/body_node_base.js +104 -0
- package/dist/composition/body_node_base.js.map +1 -0
- package/dist/composition/composition.d.ts +71 -0
- package/dist/composition/composition.d.ts.map +1 -0
- package/dist/composition/composition.js +8 -0
- package/dist/composition/composition.js.map +1 -0
- package/dist/composition/error.d.ts +61 -0
- package/dist/composition/error.d.ts.map +1 -0
- package/dist/composition/error.js +69 -0
- package/dist/composition/error.js.map +1 -0
- package/dist/composition/index.d.ts +11 -0
- package/dist/composition/index.d.ts.map +1 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/composition/map_nodes.d.ts +16 -0
- package/dist/composition/map_nodes.d.ts.map +1 -0
- package/dist/composition/map_nodes.js +81 -0
- package/dist/composition/map_nodes.js.map +1 -0
- package/dist/composition/named_color.d.ts +9 -0
- package/dist/composition/named_color.d.ts.map +1 -0
- package/dist/composition/named_color.js +17 -0
- package/dist/composition/named_color.js.map +1 -0
- package/dist/composition/node.d.ts +11 -0
- package/dist/composition/node.d.ts.map +1 -0
- package/dist/composition/node.js +8 -0
- package/dist/composition/node.js.map +1 -0
- package/dist/composition/one_line.d.ts +7 -0
- package/dist/composition/one_line.d.ts.map +1 -0
- package/dist/composition/one_line.js +17 -0
- package/dist/composition/one_line.js.map +1 -0
- package/dist/composition/structured_value.d.ts +27 -0
- package/dist/composition/structured_value.d.ts.map +1 -0
- package/dist/composition/structured_value.js +18 -0
- package/dist/composition/structured_value.js.map +1 -0
- package/dist/composition/validation_error.d.ts +33 -0
- package/dist/composition/validation_error.d.ts.map +1 -0
- package/dist/composition/validation_error.js +35 -0
- package/dist/composition/validation_error.js.map +1 -0
- package/dist/define/frame.d.ts +155 -0
- package/dist/define/frame.d.ts.map +1 -0
- package/dist/define/frame.js +27 -0
- package/dist/define/frame.js.map +1 -0
- package/dist/define/index.d.ts +10 -0
- package/dist/define/index.d.ts.map +1 -0
- package/dist/define/index.js +13 -0
- package/dist/define/index.js.map +1 -0
- package/dist/define/markdown_content.d.ts +15 -0
- package/dist/define/markdown_content.d.ts.map +1 -0
- package/dist/define/markdown_content.js +9 -0
- package/dist/define/markdown_content.js.map +1 -0
- package/dist/define/primitive_example.d.ts +30 -0
- package/dist/define/primitive_example.d.ts.map +1 -0
- package/dist/define/primitive_example.js +21 -0
- package/dist/define/primitive_example.js.map +1 -0
- package/dist/define/primitive_icon.d.ts +11 -0
- package/dist/define/primitive_icon.d.ts.map +1 -0
- package/dist/define/primitive_icon.js +14 -0
- package/dist/define/primitive_icon.js.map +1 -0
- package/dist/define/primitive_module.d.ts +435 -0
- package/dist/define/primitive_module.d.ts.map +1 -0
- package/dist/define/primitive_module.js +112 -0
- package/dist/define/primitive_module.js.map +1 -0
- package/dist/define/slack_assets.d.ts +28 -0
- package/dist/define/slack_assets.d.ts.map +1 -0
- package/dist/define/slack_assets.js +8 -0
- package/dist/define/slack_assets.js.map +1 -0
- package/dist/define/slack_blocks.d.ts +234 -0
- package/dist/define/slack_blocks.d.ts.map +1 -0
- package/dist/define/slack_blocks.js +8 -0
- package/dist/define/slack_blocks.js.map +1 -0
- package/dist/define/zod_format.d.ts +33 -0
- package/dist/define/zod_format.d.ts.map +1 -0
- package/dist/define/zod_format.js +114 -0
- package/dist/define/zod_format.js.map +1 -0
- package/dist/define/zod_helpers.d.ts +10 -0
- package/dist/define/zod_helpers.d.ts.map +1 -0
- package/dist/define/zod_helpers.js +22 -0
- package/dist/define/zod_helpers.js.map +1 -0
- package/dist/entries/html.d.ts +3 -0
- package/dist/entries/html.d.ts.map +1 -0
- package/dist/entries/html.js +8 -0
- package/dist/entries/html.js.map +1 -0
- package/dist/entries/index.d.ts +6 -0
- package/dist/entries/index.d.ts.map +1 -0
- package/dist/entries/index.js +12 -0
- package/dist/entries/index.js.map +1 -0
- package/dist/entries/markdown.d.ts +3 -0
- package/dist/entries/markdown.d.ts.map +1 -0
- package/dist/entries/markdown.js +8 -0
- package/dist/entries/markdown.js.map +1 -0
- package/dist/entries/react.d.ts +5 -0
- package/dist/entries/react.d.ts.map +1 -0
- package/dist/entries/react.js +11 -0
- package/dist/entries/react.js.map +1 -0
- package/dist/entries/slack.d.ts +2 -0
- package/dist/entries/slack.d.ts.map +1 -0
- package/dist/entries/slack.js +8 -0
- package/dist/entries/slack.js.map +1 -0
- package/dist/entries/text.d.ts +2 -0
- package/dist/entries/text.d.ts.map +1 -0
- package/dist/entries/text.js +8 -0
- package/dist/entries/text.js.map +1 -0
- package/dist/pack/capabilities.d.ts +41 -0
- package/dist/pack/capabilities.d.ts.map +1 -0
- package/dist/pack/capabilities.js +36 -0
- package/dist/pack/capabilities.js.map +1 -0
- package/dist/pack/compose.d.ts +24 -0
- package/dist/pack/compose.d.ts.map +1 -0
- package/dist/pack/compose.js +55 -0
- package/dist/pack/compose.js.map +1 -0
- package/dist/pack/enhancements.d.ts +65 -0
- package/dist/pack/enhancements.d.ts.map +1 -0
- package/dist/pack/enhancements.js +59 -0
- package/dist/pack/enhancements.js.map +1 -0
- package/dist/pack/index.d.ts +5 -0
- package/dist/pack/index.d.ts.map +1 -0
- package/dist/pack/index.js +11 -0
- package/dist/pack/index.js.map +1 -0
- package/dist/pack/primitive_pack.d.ts +164 -0
- package/dist/pack/primitive_pack.d.ts.map +1 -0
- package/dist/pack/primitive_pack.js +92 -0
- package/dist/pack/primitive_pack.js.map +1 -0
- package/dist/render/anchors.d.ts +82 -0
- package/dist/render/anchors.d.ts.map +1 -0
- package/dist/render/anchors.js +153 -0
- package/dist/render/anchors.js.map +1 -0
- package/dist/render/context_view.d.ts +10 -0
- package/dist/render/context_view.d.ts.map +1 -0
- package/dist/render/context_view.js +49 -0
- package/dist/render/context_view.js.map +1 -0
- package/dist/render/format_display_value.d.ts +20 -0
- package/dist/render/format_display_value.d.ts.map +1 -0
- package/dist/render/format_display_value.js +137 -0
- package/dist/render/format_display_value.js.map +1 -0
- package/dist/render/format_number.d.ts +9 -0
- package/dist/render/format_number.d.ts.map +1 -0
- package/dist/render/format_number.js +42 -0
- package/dist/render/format_number.js.map +1 -0
- package/dist/render/html/enhancements.d.ts +10 -0
- package/dist/render/html/enhancements.d.ts.map +1 -0
- package/dist/render/html/enhancements.js +25 -0
- package/dist/render/html/enhancements.js.map +1 -0
- package/dist/render/html/envelope.d.ts +182 -0
- package/dist/render/html/envelope.d.ts.map +1 -0
- package/dist/render/html/envelope.js +214 -0
- package/dist/render/html/envelope.js.map +1 -0
- package/dist/render/html/index.d.ts +3 -0
- package/dist/render/html/index.d.ts.map +1 -0
- package/dist/render/html/index.js +8 -0
- package/dist/render/html/index.js.map +1 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +11 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/layout_check.d.ts +43 -0
- package/dist/render/layout_check.d.ts.map +1 -0
- package/dist/render/layout_check.js +129 -0
- package/dist/render/layout_check.js.map +1 -0
- package/dist/render/markdown/builder.d.ts +46 -0
- package/dist/render/markdown/builder.d.ts.map +1 -0
- package/dist/render/markdown/builder.js +190 -0
- package/dist/render/markdown/builder.js.map +1 -0
- package/dist/render/markdown/envelope.d.ts +20 -0
- package/dist/render/markdown/envelope.d.ts.map +1 -0
- package/dist/render/markdown/envelope.js +29 -0
- package/dist/render/markdown/envelope.js.map +1 -0
- package/dist/render/markdown/format.d.ts +10 -0
- package/dist/render/markdown/format.d.ts.map +1 -0
- package/dist/render/markdown/format.js +202 -0
- package/dist/render/markdown/format.js.map +1 -0
- package/dist/render/markdown/index.d.ts +3 -0
- package/dist/render/markdown/index.d.ts.map +1 -0
- package/dist/render/markdown/index.js +9 -0
- package/dist/render/markdown/index.js.map +1 -0
- package/dist/render/measure_dom.d.ts +10 -0
- package/dist/render/measure_dom.d.ts.map +1 -0
- package/dist/render/measure_dom.js +57 -0
- package/dist/render/measure_dom.js.map +1 -0
- package/dist/render/payload.d.ts +16 -0
- package/dist/render/payload.d.ts.map +1 -0
- package/dist/render/payload.js +9 -0
- package/dist/render/payload.js.map +1 -0
- package/dist/render/primitive_dispatch.d.ts +72 -0
- package/dist/render/primitive_dispatch.d.ts.map +1 -0
- package/dist/render/primitive_dispatch.js +169 -0
- package/dist/render/primitive_dispatch.js.map +1 -0
- package/dist/render/react/content.d.ts +40 -0
- package/dist/render/react/content.d.ts.map +1 -0
- package/dist/render/react/content.js +39 -0
- package/dist/render/react/content.js.map +1 -0
- package/dist/render/react/enhancements.d.ts +15 -0
- package/dist/render/react/enhancements.d.ts.map +1 -0
- package/dist/render/react/enhancements.js +28 -0
- package/dist/render/react/enhancements.js.map +1 -0
- package/dist/render/react/index.d.ts +3 -0
- package/dist/render/react/index.d.ts.map +1 -0
- package/dist/render/react/index.js +9 -0
- package/dist/render/react/index.js.map +1 -0
- package/dist/render/slack/assets.d.ts +16 -0
- package/dist/render/slack/assets.d.ts.map +1 -0
- package/dist/render/slack/assets.js +40 -0
- package/dist/render/slack/assets.js.map +1 -0
- package/dist/render/slack/blocks.d.ts +72 -0
- package/dist/render/slack/blocks.d.ts.map +1 -0
- package/dist/render/slack/blocks.js +77 -0
- package/dist/render/slack/blocks.js.map +1 -0
- package/dist/render/slack/envelope.d.ts +52 -0
- package/dist/render/slack/envelope.d.ts.map +1 -0
- package/dist/render/slack/envelope.js +547 -0
- package/dist/render/slack/envelope.js.map +1 -0
- package/dist/render/slack/format.d.ts +70 -0
- package/dist/render/slack/format.d.ts.map +1 -0
- package/dist/render/slack/format.js +209 -0
- package/dist/render/slack/format.js.map +1 -0
- package/dist/render/slack/index.d.ts +6 -0
- package/dist/render/slack/index.d.ts.map +1 -0
- package/dist/render/slack/index.js +12 -0
- package/dist/render/slack/index.js.map +1 -0
- package/dist/render/slack/markdown_content.d.ts +17 -0
- package/dist/render/slack/markdown_content.d.ts.map +1 -0
- package/dist/render/slack/markdown_content.js +404 -0
- package/dist/render/slack/markdown_content.js.map +1 -0
- package/dist/render/text/envelope.d.ts +15 -0
- package/dist/render/text/envelope.d.ts.map +1 -0
- package/dist/render/text/envelope.js +17 -0
- package/dist/render/text/envelope.js.map +1 -0
- package/dist/render/text/index.d.ts +2 -0
- package/dist/render/text/index.d.ts.map +1 -0
- package/dist/render/text/index.js +8 -0
- package/dist/render/text/index.js.map +1 -0
- package/dist/testing/conformance.d.ts +145 -0
- package/dist/testing/conformance.d.ts.map +1 -0
- package/dist/testing/conformance.js +303 -0
- package/dist/testing/conformance.js.map +1 -0
- package/dist/testing/icon.d.ts +11 -0
- package/dist/testing/icon.d.ts.map +1 -0
- package/dist/testing/icon.js +244 -0
- package/dist/testing/icon.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +10 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/registration.d.ts +32 -0
- package/dist/testing/registration.d.ts.map +1 -0
- package/dist/testing/registration.js +105 -0
- package/dist/testing/registration.js.map +1 -0
- package/dist/validate/authoring_schema.d.ts +33 -0
- package/dist/validate/authoring_schema.d.ts.map +1 -0
- package/dist/validate/authoring_schema.js +306 -0
- package/dist/validate/authoring_schema.js.map +1 -0
- package/dist/validate/composition_schema.d.ts +80 -0
- package/dist/validate/composition_schema.d.ts.map +1 -0
- package/dist/validate/composition_schema.js +127 -0
- package/dist/validate/composition_schema.js.map +1 -0
- package/dist/validate/index.d.ts +9 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +15 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/input_budget.d.ts +35 -0
- package/dist/validate/input_budget.d.ts.map +1 -0
- package/dist/validate/input_budget.js +151 -0
- package/dist/validate/input_budget.js.map +1 -0
- package/dist/validate/json_schema.d.ts +32 -0
- package/dist/validate/json_schema.d.ts.map +1 -0
- package/dist/validate/json_schema.js +68 -0
- package/dist/validate/json_schema.js.map +1 -0
- package/dist/validate/node_issues.d.ts +12 -0
- package/dist/validate/node_issues.d.ts.map +1 -0
- package/dist/validate/node_issues.js +61 -0
- package/dist/validate/node_issues.js.map +1 -0
- package/dist/validate/url.d.ts +50 -0
- package/dist/validate/url.d.ts.map +1 -0
- package/dist/validate/url.js +107 -0
- package/dist/validate/url.js.map +1 -0
- package/dist/validate/validation.d.ts +95 -0
- package/dist/validate/validation.d.ts.map +1 -0
- package/dist/validate/validation.js +157 -0
- package/dist/validate/validation.js.map +1 -0
- package/dist/validate/value_schemas.d.ts +53 -0
- package/dist/validate/value_schemas.d.ts.map +1 -0
- package/dist/validate/value_schemas.js +50 -0
- package/dist/validate/value_schemas.js.map +1 -0
- package/package.json +119 -5
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
+
* 2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { buildCompositionJsonSchema, } from './json_schema.js';
|
|
8
|
+
import { displayValueSchema, namedColorSchema, renderThemeSchema, structuredValueSchema, } from './value_schemas.js';
|
|
9
|
+
const DEF_PREFIX = '#/$defs/';
|
|
10
|
+
const BODY_NODE_ID = 'bodyNode';
|
|
11
|
+
const SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;
|
|
12
|
+
const SCALAR_TYPES = new Set(['string', 'number', 'integer', 'boolean']);
|
|
13
|
+
const DEFAULT_EXTRA_DEFS = [
|
|
14
|
+
{ schema: namedColorSchema, id: 'tone' },
|
|
15
|
+
{ schema: displayValueSchema, id: 'displayValue' },
|
|
16
|
+
{ schema: structuredValueSchema, id: 'structuredValue' },
|
|
17
|
+
{ schema: renderThemeSchema, id: 'renderTheme' },
|
|
18
|
+
];
|
|
19
|
+
const isJsonObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
20
|
+
const cloneJson = (value) => JSON.parse(JSON.stringify(value));
|
|
21
|
+
const ownDef = (defs, id) => Object.hasOwn(defs, id) ? defs[id] : undefined;
|
|
22
|
+
const parseDefRef = (ref) => {
|
|
23
|
+
if (typeof ref !== 'string' || !ref.startsWith(DEF_PREFIX)) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return ref.slice(DEF_PREFIX.length);
|
|
27
|
+
};
|
|
28
|
+
const walkJson = (node, visit) => {
|
|
29
|
+
if (Array.isArray(node)) {
|
|
30
|
+
for (const item of node) {
|
|
31
|
+
walkJson(item, visit);
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!isJsonObject(node)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
visit(node);
|
|
39
|
+
for (const value of Object.values(node)) {
|
|
40
|
+
walkJson(value, visit);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const mapJson = (node, visit) => {
|
|
44
|
+
if (Array.isArray(node)) {
|
|
45
|
+
return node.map((item) => mapJson(item, visit));
|
|
46
|
+
}
|
|
47
|
+
if (!isJsonObject(node)) {
|
|
48
|
+
return node;
|
|
49
|
+
}
|
|
50
|
+
return Object.fromEntries(Object.entries(visit(node)).map(([key, value]) => [
|
|
51
|
+
key,
|
|
52
|
+
mapJson(value, visit),
|
|
53
|
+
]));
|
|
54
|
+
};
|
|
55
|
+
const rewriteDefRefs = (schema, rewrite) => mapJson(schema, (node) => {
|
|
56
|
+
const id = parseDefRef(node.$ref);
|
|
57
|
+
if (id === undefined) {
|
|
58
|
+
return node;
|
|
59
|
+
}
|
|
60
|
+
const replacement = rewrite(id);
|
|
61
|
+
if (replacement === undefined) {
|
|
62
|
+
return node;
|
|
63
|
+
}
|
|
64
|
+
if (typeof replacement === 'string') {
|
|
65
|
+
return { ...node, $ref: `${DEF_PREFIX}${replacement}` };
|
|
66
|
+
}
|
|
67
|
+
const rest = { ...node };
|
|
68
|
+
delete rest.$ref;
|
|
69
|
+
return Object.keys(rest).length === 0
|
|
70
|
+
? cloneJson(replacement)
|
|
71
|
+
: { ...cloneJson(replacement), ...rest };
|
|
72
|
+
});
|
|
73
|
+
const isRefOnlyDef = (def) => isJsonObject(def) &&
|
|
74
|
+
Object.keys(def).length === 1 &&
|
|
75
|
+
typeof def.$ref === 'string';
|
|
76
|
+
const isBareScalarDef = (def) => {
|
|
77
|
+
if (!isJsonObject(def)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
const { type } = def;
|
|
81
|
+
if (typeof type !== 'string' || !SCALAR_TYPES.has(type)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return !['enum', 'const', '$ref', 'properties'].some((key) => Object.hasOwn(def, key));
|
|
85
|
+
};
|
|
86
|
+
const defsOf = (schema) => isJsonObject(schema.$defs) ? schema.$defs : {};
|
|
87
|
+
const withDefs = (schema, defs) => ({ ...schema, $defs: defs });
|
|
88
|
+
const dropSafeIntegerMaxima = (schema) => {
|
|
89
|
+
walkJson(schema, (node) => {
|
|
90
|
+
if (node.maximum === SAFE_INTEGER_MAX) {
|
|
91
|
+
delete node.maximum;
|
|
92
|
+
}
|
|
93
|
+
if (node.minimum === -SAFE_INTEGER_MAX) {
|
|
94
|
+
delete node.minimum;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const dropNodeIdAndSurfaces = (schema) => {
|
|
99
|
+
for (const def of Object.values(defsOf(schema))) {
|
|
100
|
+
if (!isJsonObject(def) || !isJsonObject(def.properties)) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const typeProp = def.properties.type;
|
|
104
|
+
if (!isJsonObject(typeProp) || typeof typeProp.const !== 'string') {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
delete def.properties.id;
|
|
108
|
+
delete def.properties.surfaces;
|
|
109
|
+
if (Array.isArray(def.required)) {
|
|
110
|
+
def.required = def.required.filter((key) => key !== 'id' && key !== 'surfaces');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const omitListedProperties = (schema, paths) => {
|
|
115
|
+
const defs = defsOf(schema);
|
|
116
|
+
for (const path of paths) {
|
|
117
|
+
const dot = path.indexOf('.');
|
|
118
|
+
if (dot <= 0) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const defId = path.slice(0, dot);
|
|
122
|
+
const property = path.slice(dot + 1);
|
|
123
|
+
const def = ownDef(defs, defId);
|
|
124
|
+
if (!isJsonObject(def) || !isJsonObject(def.properties)) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
delete def.properties[property];
|
|
128
|
+
if (Array.isArray(def.required)) {
|
|
129
|
+
def.required = def.required.filter((key) => key !== property);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const applyDescriptions = (schema, describe) => {
|
|
134
|
+
const defs = defsOf(schema);
|
|
135
|
+
for (const [id, description] of Object.entries(describe)) {
|
|
136
|
+
const def = ownDef(defs, id);
|
|
137
|
+
if (isJsonObject(def)) {
|
|
138
|
+
def.description = description;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const flattenRefOnlyDefs = (schema) => {
|
|
143
|
+
const defs = defsOf(schema);
|
|
144
|
+
const aliases = new Map();
|
|
145
|
+
for (const [id, def] of Object.entries(defs)) {
|
|
146
|
+
if (id === BODY_NODE_ID || !isRefOnlyDef(def)) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const target = parseDefRef(def.$ref);
|
|
150
|
+
if (target === undefined || target === id) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
aliases.set(id, target);
|
|
154
|
+
}
|
|
155
|
+
if (aliases.size === 0) {
|
|
156
|
+
return schema;
|
|
157
|
+
}
|
|
158
|
+
const resolve = (id) => {
|
|
159
|
+
const seen = new Set();
|
|
160
|
+
let current = id;
|
|
161
|
+
while (aliases.has(current) && !seen.has(current)) {
|
|
162
|
+
seen.add(current);
|
|
163
|
+
current = aliases.get(current) ?? current;
|
|
164
|
+
}
|
|
165
|
+
return current;
|
|
166
|
+
};
|
|
167
|
+
const rewritten = rewriteDefRefs(schema, (id) => aliases.has(id) ? resolve(id) : undefined);
|
|
168
|
+
const nextDefs = { ...defsOf(rewritten) };
|
|
169
|
+
for (const id of aliases.keys()) {
|
|
170
|
+
delete nextDefs[id];
|
|
171
|
+
}
|
|
172
|
+
return withDefs(rewritten, nextDefs);
|
|
173
|
+
};
|
|
174
|
+
const inlineScalarDefs = (schema) => {
|
|
175
|
+
const defs = defsOf(schema);
|
|
176
|
+
const scalars = new Map();
|
|
177
|
+
for (const [id, def] of Object.entries(defs)) {
|
|
178
|
+
if (id === BODY_NODE_ID || !isBareScalarDef(def)) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
scalars.set(id, def);
|
|
182
|
+
}
|
|
183
|
+
if (scalars.size === 0) {
|
|
184
|
+
return schema;
|
|
185
|
+
}
|
|
186
|
+
const rewritten = rewriteDefRefs(schema, (id) => scalars.get(id));
|
|
187
|
+
const nextDefs = { ...defsOf(rewritten) };
|
|
188
|
+
for (const id of scalars.keys()) {
|
|
189
|
+
delete nextDefs[id];
|
|
190
|
+
}
|
|
191
|
+
return withDefs(rewritten, nextDefs);
|
|
192
|
+
};
|
|
193
|
+
const pruneUnreferencedDefs = (schema) => {
|
|
194
|
+
const defs = defsOf(schema);
|
|
195
|
+
if (Object.keys(defs).length === 0) {
|
|
196
|
+
return schema;
|
|
197
|
+
}
|
|
198
|
+
const referenced = new Set();
|
|
199
|
+
const visit = (node) => {
|
|
200
|
+
walkJson(node, (value) => {
|
|
201
|
+
const id = parseDefRef(value.$ref);
|
|
202
|
+
if (id === undefined || referenced.has(id)) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
referenced.add(id);
|
|
206
|
+
visit(ownDef(defs, id));
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
const root = { ...schema };
|
|
210
|
+
delete root.$defs;
|
|
211
|
+
visit(root);
|
|
212
|
+
referenced.add(BODY_NODE_ID);
|
|
213
|
+
visit(defs[BODY_NODE_ID]);
|
|
214
|
+
return withDefs(schema, Object.fromEntries(Object.entries(defs).filter(([id]) => referenced.has(id))));
|
|
215
|
+
};
|
|
216
|
+
const mergeExtraDefs = (extras) => {
|
|
217
|
+
const bySchema = new Map();
|
|
218
|
+
for (const item of DEFAULT_EXTRA_DEFS) {
|
|
219
|
+
bySchema.set(item.schema, item);
|
|
220
|
+
}
|
|
221
|
+
for (const item of extras ?? []) {
|
|
222
|
+
bySchema.set(item.schema, item);
|
|
223
|
+
}
|
|
224
|
+
const byId = new Map();
|
|
225
|
+
for (const item of bySchema.values()) {
|
|
226
|
+
byId.set(item.id, item);
|
|
227
|
+
}
|
|
228
|
+
return [...byId.values()];
|
|
229
|
+
};
|
|
230
|
+
const slimAuthoringSchema = (schema, options) => {
|
|
231
|
+
const next = cloneJson(schema);
|
|
232
|
+
dropSafeIntegerMaxima(next);
|
|
233
|
+
dropNodeIdAndSurfaces(next);
|
|
234
|
+
omitListedProperties(next, options.omitProperties ?? []);
|
|
235
|
+
const flattened = flattenRefOnlyDefs(next);
|
|
236
|
+
const inlined = inlineScalarDefs(flattened);
|
|
237
|
+
const pruned = pruneUnreferencedDefs(inlined);
|
|
238
|
+
applyDescriptions(pruned, options.describe ?? {});
|
|
239
|
+
return pruned;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* Projects a composition to the JSON Schema an agent reads.
|
|
243
|
+
*
|
|
244
|
+
* {@link buildCompositionJsonSchema} stays the validator projection. This walk
|
|
245
|
+
* names shared SDK defs, inlines scalar leaves, and drops host-only fields.
|
|
246
|
+
*/
|
|
247
|
+
export const buildAuthoringJsonSchema = (definitions, options = {}) => {
|
|
248
|
+
const { describe, omitProperties, extraDefs, ...rest } = options;
|
|
249
|
+
const projected = buildCompositionJsonSchema(definitions, {
|
|
250
|
+
...rest,
|
|
251
|
+
extraDefs: mergeExtraDefs(extraDefs),
|
|
252
|
+
});
|
|
253
|
+
return slimAuthoringSchema(projected, {
|
|
254
|
+
...(describe === undefined ? {} : { describe }),
|
|
255
|
+
...(omitProperties === undefined ? {} : { omitProperties }),
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
const BODY_NODE_STUB = {
|
|
259
|
+
description: 'Any primitive in the catalog, as its own object with its `type`.',
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* The `$defs` that `types` reach in a schema from {@link buildAuthoringJsonSchema},
|
|
263
|
+
* keyed as `schema` keys them, with the body-node union stubbed so a container
|
|
264
|
+
* does not pull in every primitive.
|
|
265
|
+
*/
|
|
266
|
+
export const authoringSchemaSubset = (schema, types) => {
|
|
267
|
+
const defs = defsOf(schema);
|
|
268
|
+
// A `Map`, so an id such as `constructor` is never an inherited key.
|
|
269
|
+
const kept = new Map();
|
|
270
|
+
const visit = (id) => {
|
|
271
|
+
if (kept.has(id) || !Object.hasOwn(defs, id)) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (id === BODY_NODE_ID) {
|
|
275
|
+
kept.set(id, BODY_NODE_STUB);
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
kept.set(id, defs[id]);
|
|
279
|
+
walkJson(defs[id], (value) => {
|
|
280
|
+
const ref = parseDefRef(value.$ref);
|
|
281
|
+
if (ref !== undefined) {
|
|
282
|
+
visit(ref);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
for (const type of types) {
|
|
287
|
+
visit(type);
|
|
288
|
+
}
|
|
289
|
+
return { $defs: Object.fromEntries(kept) };
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* The `body` of a schema from {@link buildAuthoringJsonSchema} as a schema of
|
|
293
|
+
* its own, for an editor that validates body nodes rather than a whole
|
|
294
|
+
* composition. Carries the `$defs` the body reaches.
|
|
295
|
+
*/
|
|
296
|
+
export const authoringBodySchema = (schema) => {
|
|
297
|
+
const { properties, $schema } = schema;
|
|
298
|
+
const body = isJsonObject(properties) ? properties.body : undefined;
|
|
299
|
+
return pruneUnreferencedDefs({
|
|
300
|
+
...(typeof $schema === 'string' ? { $schema } : {}),
|
|
301
|
+
title: 'Body',
|
|
302
|
+
...(isJsonObject(body) ? body : { type: 'array' }),
|
|
303
|
+
$defs: defsOf(schema),
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
//# sourceMappingURL=authoring_schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring_schema.js","sourceRoot":"","sources":["../../src/validate/authoring_schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EACL,0BAA0B,GAE3B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACjD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzE,MAAM,kBAAkB,GAA+C;IACrE,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,EAAE;IACxC,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,cAAc,EAAE;IAClD,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,EAAE,iBAAiB,EAAE;IACxD,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,EAAE,aAAa,EAAE;CACjD,CAAC;AAUF,MAAM,YAAY,GAAG,CAAC,KAAc,EAAoC,EAAE,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,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;YAC3B,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,KAAK,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;AAC7C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAc,EAAE;IACpE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACvC,MAAM,IAAI,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,OAAO,qBAAqB,CAAC;QAC3B,GAAG,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,KAAK,EAAE,MAAM;QACb,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAClD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;KACtB,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { ZodType } from 'zod';\n\nimport type { AnyPrimitiveDefinition } from '../define/primitive_module';\n\nimport {\n buildCompositionJsonSchema,\n type CompositionJsonSchemaOptions,\n} from './json_schema';\nimport {\n displayValueSchema,\n namedColorSchema,\n renderThemeSchema,\n structuredValueSchema,\n} from './value_schemas';\n\ntype JsonSchema = Record<string, unknown>;\n\nconst DEF_PREFIX = '#/$defs/';\nconst BODY_NODE_ID = 'bodyNode';\nconst SAFE_INTEGER_MAX = Number.MAX_SAFE_INTEGER;\nconst SCALAR_TYPES = new Set(['string', 'number', 'integer', 'boolean']);\n\nconst DEFAULT_EXTRA_DEFS: readonly { schema: ZodType; id: string }[] = [\n { schema: namedColorSchema, id: 'tone' },\n { schema: displayValueSchema, id: 'displayValue' },\n { schema: structuredValueSchema, id: 'structuredValue' },\n { schema: renderThemeSchema, id: 'renderTheme' },\n];\n\n/** Options for {@link buildAuthoringJsonSchema}. */\nexport interface AuthoringJsonSchemaOptions extends CompositionJsonSchemaOptions {\n /** `$def` id to `description`. Survives `z.toJSONSchema` dropping `.refine` text. */\n describe?: Readonly<Record<string, string>>;\n /** `$defId.property` paths to drop, e.g. `'kpi.delta'`. */\n omitProperties?: readonly string[];\n}\n\nconst isJsonObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst cloneJson = <T>(value: T): T => JSON.parse(JSON.stringify(value)) as T;\n\nconst ownDef = (defs: Record<string, unknown>, id: string): unknown =>\n Object.hasOwn(defs, id) ? defs[id] : undefined;\n\nconst parseDefRef = (ref: unknown): string | undefined => {\n if (typeof ref !== 'string' || !ref.startsWith(DEF_PREFIX)) {\n return undefined;\n }\n return ref.slice(DEF_PREFIX.length);\n};\n\nconst walkJson = (\n node: unknown,\n visit: (value: Record<string, unknown>) => void\n): void => {\n if (Array.isArray(node)) {\n for (const item of node) {\n walkJson(item, visit);\n }\n return;\n }\n if (!isJsonObject(node)) {\n return;\n }\n visit(node);\n for (const value of Object.values(node)) {\n walkJson(value, visit);\n }\n};\n\nconst mapJson = (\n node: unknown,\n visit: (value: Record<string, unknown>) => Record<string, unknown>\n): unknown => {\n if (Array.isArray(node)) {\n return node.map((item) => mapJson(item, visit));\n }\n if (!isJsonObject(node)) {\n return node;\n }\n return Object.fromEntries(\n Object.entries(visit(node)).map(([key, value]) => [\n key,\n mapJson(value, visit),\n ])\n );\n};\n\nconst rewriteDefRefs = (\n schema: JsonSchema,\n rewrite: (id: string) => string | JsonSchema | undefined\n): JsonSchema =>\n mapJson(schema, (node) => {\n const id = parseDefRef(node.$ref);\n if (id === undefined) {\n return node;\n }\n const replacement = rewrite(id);\n if (replacement === undefined) {\n return node;\n }\n if (typeof replacement === 'string') {\n return { ...node, $ref: `${DEF_PREFIX}${replacement}` };\n }\n const rest = { ...node };\n delete rest.$ref;\n return Object.keys(rest).length === 0\n ? cloneJson(replacement)\n : { ...cloneJson(replacement), ...rest };\n }) as JsonSchema;\n\nconst isRefOnlyDef = (def: unknown): def is { $ref: string } =>\n isJsonObject(def) &&\n Object.keys(def).length === 1 &&\n typeof def.$ref === 'string';\n\nconst isBareScalarDef = (def: unknown): def is Record<string, unknown> => {\n if (!isJsonObject(def)) {\n return false;\n }\n const { type } = def;\n if (typeof type !== 'string' || !SCALAR_TYPES.has(type)) {\n return false;\n }\n return !['enum', 'const', '$ref', 'properties'].some((key) =>\n Object.hasOwn(def, key)\n );\n};\n\nconst defsOf = (schema: JsonSchema): Record<string, unknown> =>\n isJsonObject(schema.$defs) ? schema.$defs : {};\n\nconst withDefs = (\n schema: JsonSchema,\n defs: Record<string, unknown>\n): JsonSchema => ({ ...schema, $defs: defs });\n\nconst dropSafeIntegerMaxima = (schema: JsonSchema): void => {\n walkJson(schema, (node) => {\n if (node.maximum === SAFE_INTEGER_MAX) {\n delete node.maximum;\n }\n if (node.minimum === -SAFE_INTEGER_MAX) {\n delete node.minimum;\n }\n });\n};\n\nconst dropNodeIdAndSurfaces = (schema: JsonSchema): void => {\n for (const def of Object.values(defsOf(schema))) {\n if (!isJsonObject(def) || !isJsonObject(def.properties)) {\n continue;\n }\n const typeProp = def.properties.type;\n if (!isJsonObject(typeProp) || typeof typeProp.const !== 'string') {\n continue;\n }\n delete def.properties.id;\n delete def.properties.surfaces;\n if (Array.isArray(def.required)) {\n def.required = def.required.filter(\n (key) => key !== 'id' && key !== 'surfaces'\n );\n }\n }\n};\n\nconst omitListedProperties = (\n schema: JsonSchema,\n paths: readonly string[]\n): void => {\n const defs = defsOf(schema);\n for (const path of paths) {\n const dot = path.indexOf('.');\n if (dot <= 0) {\n continue;\n }\n const defId = path.slice(0, dot);\n const property = path.slice(dot + 1);\n const def = ownDef(defs, defId);\n if (!isJsonObject(def) || !isJsonObject(def.properties)) {\n continue;\n }\n delete def.properties[property];\n if (Array.isArray(def.required)) {\n def.required = def.required.filter((key) => key !== property);\n }\n }\n};\n\nconst applyDescriptions = (\n schema: JsonSchema,\n describe: Readonly<Record<string, string>>\n): void => {\n const defs = defsOf(schema);\n for (const [id, description] of Object.entries(describe)) {\n const def = ownDef(defs, id);\n if (isJsonObject(def)) {\n def.description = description;\n }\n }\n};\n\nconst flattenRefOnlyDefs = (schema: JsonSchema): JsonSchema => {\n const defs = defsOf(schema);\n const aliases = new Map<string, string>();\n for (const [id, def] of Object.entries(defs)) {\n if (id === BODY_NODE_ID || !isRefOnlyDef(def)) {\n continue;\n }\n const target = parseDefRef(def.$ref);\n if (target === undefined || target === id) {\n continue;\n }\n aliases.set(id, target);\n }\n if (aliases.size === 0) {\n return schema;\n }\n const resolve = (id: string): string => {\n const seen = new Set<string>();\n let current = id;\n while (aliases.has(current) && !seen.has(current)) {\n seen.add(current);\n current = aliases.get(current) ?? current;\n }\n return current;\n };\n const rewritten = rewriteDefRefs(schema, (id) =>\n aliases.has(id) ? resolve(id) : undefined\n );\n const nextDefs = { ...defsOf(rewritten) };\n for (const id of aliases.keys()) {\n delete nextDefs[id];\n }\n return withDefs(rewritten, nextDefs);\n};\n\nconst inlineScalarDefs = (schema: JsonSchema): JsonSchema => {\n const defs = defsOf(schema);\n const scalars = new Map<string, Record<string, unknown>>();\n for (const [id, def] of Object.entries(defs)) {\n if (id === BODY_NODE_ID || !isBareScalarDef(def)) {\n continue;\n }\n scalars.set(id, def);\n }\n if (scalars.size === 0) {\n return schema;\n }\n const rewritten = rewriteDefRefs(schema, (id) => scalars.get(id));\n const nextDefs = { ...defsOf(rewritten) };\n for (const id of scalars.keys()) {\n delete nextDefs[id];\n }\n return withDefs(rewritten, nextDefs);\n};\n\nconst pruneUnreferencedDefs = (schema: JsonSchema): JsonSchema => {\n const defs = defsOf(schema);\n if (Object.keys(defs).length === 0) {\n return schema;\n }\n const referenced = new Set<string>();\n const visit = (node: unknown): void => {\n walkJson(node, (value) => {\n const id = parseDefRef(value.$ref);\n if (id === undefined || referenced.has(id)) {\n return;\n }\n referenced.add(id);\n visit(ownDef(defs, id));\n });\n };\n const root: JsonSchema = { ...schema };\n delete root.$defs;\n visit(root);\n referenced.add(BODY_NODE_ID);\n visit(defs[BODY_NODE_ID]);\n return withDefs(\n schema,\n Object.fromEntries(\n Object.entries(defs).filter(([id]) => referenced.has(id))\n )\n );\n};\n\nconst mergeExtraDefs = (\n extras: CompositionJsonSchemaOptions['extraDefs']\n): { schema: ZodType; id: string }[] => {\n const bySchema = new Map<ZodType, { schema: ZodType; id: string }>();\n for (const item of DEFAULT_EXTRA_DEFS) {\n bySchema.set(item.schema, item);\n }\n for (const item of extras ?? []) {\n bySchema.set(item.schema, item);\n }\n const byId = new Map<string, { schema: ZodType; id: string }>();\n for (const item of bySchema.values()) {\n byId.set(item.id, item);\n }\n return [...byId.values()];\n};\n\nconst slimAuthoringSchema = (\n schema: JsonSchema,\n options: AuthoringJsonSchemaOptions\n): JsonSchema => {\n const next = cloneJson(schema);\n dropSafeIntegerMaxima(next);\n dropNodeIdAndSurfaces(next);\n omitListedProperties(next, options.omitProperties ?? []);\n const flattened = flattenRefOnlyDefs(next);\n const inlined = inlineScalarDefs(flattened);\n const pruned = pruneUnreferencedDefs(inlined);\n applyDescriptions(pruned, options.describe ?? {});\n return pruned;\n};\n\n/**\n * Projects a composition to the JSON Schema an agent reads.\n *\n * {@link buildCompositionJsonSchema} stays the validator projection. This walk\n * names shared SDK defs, inlines scalar leaves, and drops host-only fields.\n */\nexport const buildAuthoringJsonSchema = (\n definitions: readonly AnyPrimitiveDefinition[],\n options: AuthoringJsonSchemaOptions = {}\n): JsonSchema => {\n const { describe, omitProperties, extraDefs, ...rest } = options;\n const projected = buildCompositionJsonSchema(definitions, {\n ...rest,\n extraDefs: mergeExtraDefs(extraDefs),\n });\n return slimAuthoringSchema(projected, {\n ...(describe === undefined ? {} : { describe }),\n ...(omitProperties === undefined ? {} : { omitProperties }),\n });\n};\n\nconst BODY_NODE_STUB = {\n description:\n 'Any primitive in the catalog, as its own object with its `type`.',\n};\n\n/**\n * The `$defs` that `types` reach in a schema from {@link buildAuthoringJsonSchema},\n * keyed as `schema` keys them, with the body-node union stubbed so a container\n * does not pull in every primitive.\n */\nexport const authoringSchemaSubset = (\n schema: JsonSchema,\n types: readonly string[]\n): { $defs: Record<string, unknown> } => {\n const defs = defsOf(schema);\n // A `Map`, so an id such as `constructor` is never an inherited key.\n const kept = new Map<string, unknown>();\n const visit = (id: string): void => {\n if (kept.has(id) || !Object.hasOwn(defs, id)) {\n return;\n }\n if (id === BODY_NODE_ID) {\n kept.set(id, BODY_NODE_STUB);\n return;\n }\n kept.set(id, defs[id]);\n walkJson(defs[id], (value) => {\n const ref = parseDefRef(value.$ref);\n if (ref !== undefined) {\n visit(ref);\n }\n });\n };\n for (const type of types) {\n visit(type);\n }\n return { $defs: Object.fromEntries(kept) };\n};\n\n/**\n * The `body` of a schema from {@link buildAuthoringJsonSchema} as a schema of\n * its own, for an editor that validates body nodes rather than a whole\n * composition. Carries the `$defs` the body reaches.\n */\nexport const authoringBodySchema = (schema: JsonSchema): JsonSchema => {\n const { properties, $schema } = schema;\n const body = isJsonObject(properties) ? properties.body : undefined;\n return pruneUnreferencedDefs({\n ...(typeof $schema === 'string' ? { $schema } : {}),\n title: 'Body',\n ...(isJsonObject(body) ? body : { type: 'array' }),\n $defs: defsOf(schema),\n });\n};\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z, type ZodObject, type ZodType } from 'zod';
|
|
2
|
+
import type { AnyPrimitiveDefinition } from '../define/primitive_module.js';
|
|
3
|
+
/** `Composition.meta`: provenance and freshness, every field optional. */
|
|
4
|
+
export declare const metaSchema: z.ZodObject<{
|
|
5
|
+
source: z.ZodOptional<z.ZodString>;
|
|
6
|
+
generatedAt: z.ZodOptional<z.ZodString>;
|
|
7
|
+
ariaLabel: z.ZodOptional<z.ZodString>;
|
|
8
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
source: z.ZodOptional<z.ZodString>;
|
|
10
|
+
query: z.ZodOptional<z.ZodString>;
|
|
11
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
freshness: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
asOf: z.ZodOptional<z.ZodString>;
|
|
15
|
+
stale: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
ttlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
partialFailure: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
degraded: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
/** Options for the `Composition` envelope schema a body-node union is wrapped in. */
|
|
24
|
+
export interface CompositionSchemaOptions {
|
|
25
|
+
/** The union the envelope's `body` array holds, as {@link resolveVocabulary} builds it. */
|
|
26
|
+
bodyNodeSchema: ZodType<unknown>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Wraps a body-node union in the `Composition` envelope.
|
|
30
|
+
*
|
|
31
|
+
* `.strict()`, so an unknown root key is an error rather than silently carried:
|
|
32
|
+
* the format crosses vendor boundaries, and a typo'd field that validates is
|
|
33
|
+
* worse than one that fails. Most callers want
|
|
34
|
+
* {@link getCompositionSchemaForDefinitions} instead, which memoizes.
|
|
35
|
+
*/
|
|
36
|
+
export declare const buildCompositionSchema: ({ bodyNodeSchema, }: CompositionSchemaOptions) => ZodObject;
|
|
37
|
+
/**
|
|
38
|
+
* One set of definitions resolved into a body-node union, with the schema
|
|
39
|
+
* instance that actually landed in it per primitive type.
|
|
40
|
+
*
|
|
41
|
+
* The members matter to callers because a container's schema in the union is
|
|
42
|
+
* built by `schemaFor` and is therefore *not* `definition.schema`. Anything
|
|
43
|
+
* keyed on identity — the JSON Schema id registry, which names `$defs` — has to
|
|
44
|
+
* be given these, or a container's projection silently loses its name.
|
|
45
|
+
*/
|
|
46
|
+
export interface ResolvedVocabulary {
|
|
47
|
+
/** The discriminated union over every primitive type in this vocabulary. */
|
|
48
|
+
bodyNodeSchema: ZodType<unknown>;
|
|
49
|
+
/** Keyed by node type. A container's value comes from `schemaFor`, not `definition.schema`. */
|
|
50
|
+
members: ReadonlyMap<string, ZodObject>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Builds a body-node union whose containers reference *this* union.
|
|
54
|
+
*
|
|
55
|
+
* The `z.lazy` closing the recursion is created here and discarded with the
|
|
56
|
+
* vocabulary: it memoizes its getter after the first resolution, so one shared
|
|
57
|
+
* across vocabularies would freeze on whichever union parsed first.
|
|
58
|
+
*/
|
|
59
|
+
export declare const resolveVocabulary: (definitions: readonly AnyPrimitiveDefinition[]) => ResolvedVocabulary;
|
|
60
|
+
/**
|
|
61
|
+
* {@link resolveVocabulary}, discarding the member instances.
|
|
62
|
+
*
|
|
63
|
+
* Only for a caller with no id registry to name; anything projecting to JSON
|
|
64
|
+
* Schema needs the members and should use {@link resolveVocabulary}.
|
|
65
|
+
*/
|
|
66
|
+
export declare const buildBodyNodeSchemaFromDefinitions: (definitions: readonly AnyPrimitiveDefinition[]) => ZodType<unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* A fresh `Composition` schema over `definitions`.
|
|
69
|
+
*
|
|
70
|
+
* Builds a new union per call. Prefer
|
|
71
|
+
* {@link getCompositionSchemaForDefinitions} unless a fresh instance is
|
|
72
|
+
* required.
|
|
73
|
+
*/
|
|
74
|
+
export declare const buildCompositionSchemaFromDefinitions: (definitions: readonly AnyPrimitiveDefinition[]) => ZodObject;
|
|
75
|
+
/**
|
|
76
|
+
* {@link buildCompositionSchemaFromDefinitions}, memoized per definition array.
|
|
77
|
+
* Prefer this whenever the caller does not need a fresh schema instance.
|
|
78
|
+
*/
|
|
79
|
+
export declare const getCompositionSchemaForDefinitions: (definitions: readonly AnyPrimitiveDefinition[]) => ZodObject;
|
|
80
|
+
//# sourceMappingURL=composition_schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition_schema.d.ts","sourceRoot":"","sources":["../../src/validate/composition_schema.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAGtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAIzE,0EAA0E;AAC1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;iBAwBrB,CAAC;AAEH,qFAAqF;AACrF,MAAM,WAAW,wBAAwB;IACvC,2FAA2F;IAC3F,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,qBAEpC,wBAAwB,KAAG,SAajB,CAAC;AAEd;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,+FAA+F;IAC/F,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACzC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,aAAa,SAAS,sBAAsB,EAAE,KAC7C,kBAmCF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,GAC7C,aAAa,SAAS,sBAAsB,EAAE,KAC7C,OAAO,CAAC,OAAO,CAAkD,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,GAChD,aAAa,SAAS,sBAAsB,EAAE,KAC7C,SAGC,CAAC;AAgCL;;;GAGG;AACH,eAAO,MAAM,kCAAkC,GAC7C,aAAa,SAAS,sBAAsB,EAAE,KAC7C,SAA0C,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
+
* 2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { IsomerError } from '../composition/error.js';
|
|
9
|
+
import { renderThemeSchema } from './value_schemas.js';
|
|
10
|
+
/** `Composition.meta`: provenance and freshness, every field optional. */
|
|
11
|
+
export const metaSchema = z.object({
|
|
12
|
+
source: z.string().optional(),
|
|
13
|
+
generatedAt: z.string().optional(),
|
|
14
|
+
ariaLabel: z.string().optional(),
|
|
15
|
+
provenance: z
|
|
16
|
+
.object({
|
|
17
|
+
source: z.string().optional(),
|
|
18
|
+
query: z.string().optional(),
|
|
19
|
+
provider: z.string().optional(),
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
22
|
+
freshness: z
|
|
23
|
+
.object({
|
|
24
|
+
asOf: z.string().optional(),
|
|
25
|
+
stale: z.boolean().optional(),
|
|
26
|
+
ttlSeconds: z.number().optional(),
|
|
27
|
+
})
|
|
28
|
+
.optional(),
|
|
29
|
+
partialFailure: z
|
|
30
|
+
.object({
|
|
31
|
+
degraded: z.boolean().optional(),
|
|
32
|
+
reason: z.string().optional(),
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Wraps a body-node union in the `Composition` envelope.
|
|
38
|
+
*
|
|
39
|
+
* `.strict()`, so an unknown root key is an error rather than silently carried:
|
|
40
|
+
* the format crosses vendor boundaries, and a typo'd field that validates is
|
|
41
|
+
* worse than one that fails. Most callers want
|
|
42
|
+
* {@link getCompositionSchemaForDefinitions} instead, which memoizes.
|
|
43
|
+
*/
|
|
44
|
+
export const buildCompositionSchema = ({ bodyNodeSchema, }) => z
|
|
45
|
+
.object({
|
|
46
|
+
type: z.literal('view', { error: 'type must be "view"' }),
|
|
47
|
+
version: z.literal(1).optional(),
|
|
48
|
+
title: z.string().optional(),
|
|
49
|
+
subtitle: z.string().optional(),
|
|
50
|
+
theme: renderThemeSchema.optional(),
|
|
51
|
+
body: z
|
|
52
|
+
.array(bodyNodeSchema)
|
|
53
|
+
.min(1, { error: 'must contain at least one node' }),
|
|
54
|
+
meta: metaSchema.optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
/**
|
|
58
|
+
* Builds a body-node union whose containers reference *this* union.
|
|
59
|
+
*
|
|
60
|
+
* The `z.lazy` closing the recursion is created here and discarded with the
|
|
61
|
+
* vocabulary: it memoizes its getter after the first resolution, so one shared
|
|
62
|
+
* across vocabularies would freeze on whichever union parsed first.
|
|
63
|
+
*/
|
|
64
|
+
export const resolveVocabulary = (definitions) => {
|
|
65
|
+
if (definitions.length === 0) {
|
|
66
|
+
throw new IsomerError('EMPTY_VOCABULARY', 'resolveVocabulary: at least one primitive is required');
|
|
67
|
+
}
|
|
68
|
+
// Resolved once the union exists; nothing parses before this function returns.
|
|
69
|
+
const pending = {};
|
|
70
|
+
const resolveUnion = () => {
|
|
71
|
+
if (!pending.union) {
|
|
72
|
+
throw new IsomerError('VOCABULARY_UNRESOLVED', 'resolveVocabulary: body-node union read before its vocabulary resolved');
|
|
73
|
+
}
|
|
74
|
+
return pending.union;
|
|
75
|
+
};
|
|
76
|
+
const members = new Map();
|
|
77
|
+
const memberSchemas = definitions.map((definition) => {
|
|
78
|
+
const schema = definition.schemaFor
|
|
79
|
+
? // One `z.lazy` per container: the JSON Schema projection gives a shared
|
|
80
|
+
// wrapper its own anonymous `$def` instead of `$ref: #/$defs/bodyNode`.
|
|
81
|
+
definition.schemaFor(z.lazy(resolveUnion))
|
|
82
|
+
: definition.schema;
|
|
83
|
+
members.set(definition.type, schema);
|
|
84
|
+
return schema;
|
|
85
|
+
});
|
|
86
|
+
pending.union = z.discriminatedUnion('type', memberSchemas);
|
|
87
|
+
return { bodyNodeSchema: pending.union, members };
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* {@link resolveVocabulary}, discarding the member instances.
|
|
91
|
+
*
|
|
92
|
+
* Only for a caller with no id registry to name; anything projecting to JSON
|
|
93
|
+
* Schema needs the members and should use {@link resolveVocabulary}.
|
|
94
|
+
*/
|
|
95
|
+
export const buildBodyNodeSchemaFromDefinitions = (definitions) => resolveVocabulary(definitions).bodyNodeSchema;
|
|
96
|
+
/**
|
|
97
|
+
* A fresh `Composition` schema over `definitions`.
|
|
98
|
+
*
|
|
99
|
+
* Builds a new union per call. Prefer
|
|
100
|
+
* {@link getCompositionSchemaForDefinitions} unless a fresh instance is
|
|
101
|
+
* required.
|
|
102
|
+
*/
|
|
103
|
+
export const buildCompositionSchemaFromDefinitions = (definitions) => buildCompositionSchema({
|
|
104
|
+
bodyNodeSchema: buildBodyNodeSchemaFromDefinitions(definitions),
|
|
105
|
+
});
|
|
106
|
+
const compositionSchemaCache = new WeakMap();
|
|
107
|
+
const cachedFor = (definitions) => {
|
|
108
|
+
const cached = compositionSchemaCache.get(definitions);
|
|
109
|
+
if (cached) {
|
|
110
|
+
return cached;
|
|
111
|
+
}
|
|
112
|
+
const vocabulary = resolveVocabulary(definitions);
|
|
113
|
+
const entry = {
|
|
114
|
+
vocabulary,
|
|
115
|
+
schema: buildCompositionSchema({
|
|
116
|
+
bodyNodeSchema: vocabulary.bodyNodeSchema,
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
compositionSchemaCache.set(definitions, entry);
|
|
120
|
+
return entry;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* {@link buildCompositionSchemaFromDefinitions}, memoized per definition array.
|
|
124
|
+
* Prefer this whenever the caller does not need a fresh schema instance.
|
|
125
|
+
*/
|
|
126
|
+
export const getCompositionSchemaForDefinitions = (definitions) => cachedFor(definitions).schema;
|
|
127
|
+
//# sourceMappingURL=composition_schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition_schema.js","sourceRoot":"","sources":["../../src/validate/composition_schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAgC,MAAM,KAAK,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAA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ACnC,EAAE,CACb,sBAAsB,CAAC;IACrB,cAAc,EAAE,kCAAkC,CAAC,WAAW,CAAC;CAChE,CAAC,CAAC;AAYL,MAAM,sBAAsB,GAAG,IAAI,OAAO,EAAmC,CAAC;AAE9E,MAAM,SAAS,GAAG,CAChB,WAA8C,EACrB,EAAE;IAC3B,MAAM,MAAM,GAAG,sBAAsB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,KAAK,GAA4B;QACrC,UAAU;QACV,MAAM,EAAE,sBAAsB,CAAC;YAC7B,cAAc,EAAE,UAAU,CAAC,cAAc;SAC1C,CAAC;KACH,CAAC;IACF,sBAAsB,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,WAA8C,EACnC,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport { z, type ZodObject, type ZodType } from 'zod';\n\nimport { IsomerError } from '../composition/error';\nimport type { AnyPrimitiveDefinition } from '../define/primitive_module';\n\nimport { renderThemeSchema } from './value_schemas';\n\n/** `Composition.meta`: provenance and freshness, every field optional. */\nexport const metaSchema = z.object({\n source: z.string().optional(),\n generatedAt: z.string().optional(),\n ariaLabel: z.string().optional(),\n provenance: z\n .object({\n source: z.string().optional(),\n query: z.string().optional(),\n provider: z.string().optional(),\n })\n .optional(),\n freshness: z\n .object({\n asOf: z.string().optional(),\n stale: z.boolean().optional(),\n ttlSeconds: z.number().optional(),\n })\n .optional(),\n partialFailure: z\n .object({\n degraded: z.boolean().optional(),\n reason: z.string().optional(),\n })\n .optional(),\n});\n\n/** Options for the `Composition` envelope schema a body-node union is wrapped in. */\nexport interface CompositionSchemaOptions {\n /** The union the envelope's `body` array holds, as {@link resolveVocabulary} builds it. */\n bodyNodeSchema: ZodType<unknown>;\n}\n\n/**\n * Wraps a body-node union in the `Composition` envelope.\n *\n * `.strict()`, so an unknown root key is an error rather than silently carried:\n * the format crosses vendor boundaries, and a typo'd field that validates is\n * worse than one that fails. Most callers want\n * {@link getCompositionSchemaForDefinitions} instead, which memoizes.\n */\nexport const buildCompositionSchema = ({\n bodyNodeSchema,\n}: CompositionSchemaOptions): ZodObject =>\n z\n .object({\n type: z.literal('view', { error: 'type must be \"view\"' }),\n version: z.literal(1).optional(),\n title: z.string().optional(),\n subtitle: z.string().optional(),\n theme: renderThemeSchema.optional(),\n body: z\n .array(bodyNodeSchema)\n .min(1, { error: 'must contain at least one node' }),\n meta: metaSchema.optional(),\n })\n .strict();\n\n/**\n * One set of definitions resolved into a body-node union, with the schema\n * instance that actually landed in it per primitive type.\n *\n * The members matter to callers because a container's schema in the union is\n * built by `schemaFor` and is therefore *not* `definition.schema`. Anything\n * keyed on identity — the JSON Schema id registry, which names `$defs` — has to\n * be given these, or a container's projection silently loses its name.\n */\nexport interface ResolvedVocabulary {\n /** The discriminated union over every primitive type in this vocabulary. */\n bodyNodeSchema: ZodType<unknown>;\n /** Keyed by node type. A container's value comes from `schemaFor`, not `definition.schema`. */\n members: ReadonlyMap<string, ZodObject>;\n}\n\n/**\n * Builds a body-node union whose containers reference *this* union.\n *\n * The `z.lazy` closing the recursion is created here and discarded with the\n * vocabulary: it memoizes its getter after the first resolution, so one shared\n * across vocabularies would freeze on whichever union parsed first.\n */\nexport const resolveVocabulary = (\n definitions: readonly AnyPrimitiveDefinition[]\n): ResolvedVocabulary => {\n if (definitions.length === 0) {\n throw new IsomerError(\n 'EMPTY_VOCABULARY',\n 'resolveVocabulary: at least one primitive is required'\n );\n }\n // Resolved once the union exists; nothing parses before this function returns.\n const pending: { union?: ZodType<unknown> } = {};\n const resolveUnion = (): ZodType<unknown> => {\n if (!pending.union) {\n throw new IsomerError(\n 'VOCABULARY_UNRESOLVED',\n 'resolveVocabulary: body-node union read before its vocabulary resolved'\n );\n }\n return pending.union;\n };\n\n const members = new Map<string, ZodObject>();\n const memberSchemas = definitions.map((definition) => {\n const schema = definition.schemaFor\n ? // One `z.lazy` per container: the JSON Schema projection gives a shared\n // wrapper its own anonymous `$def` instead of `$ref: #/$defs/bodyNode`.\n definition.schemaFor(z.lazy(resolveUnion))\n : definition.schema;\n members.set(definition.type, schema);\n return schema;\n });\n\n pending.union = z.discriminatedUnion(\n 'type',\n memberSchemas as [ZodObject, ...ZodObject[]]\n );\n return { bodyNodeSchema: pending.union, members };\n};\n\n/**\n * {@link resolveVocabulary}, discarding the member instances.\n *\n * Only for a caller with no id registry to name; anything projecting to JSON\n * Schema needs the members and should use {@link resolveVocabulary}.\n */\nexport const buildBodyNodeSchemaFromDefinitions = (\n definitions: readonly AnyPrimitiveDefinition[]\n): ZodType<unknown> => resolveVocabulary(definitions).bodyNodeSchema;\n\n/**\n * A fresh `Composition` schema over `definitions`.\n *\n * Builds a new union per call. Prefer\n * {@link getCompositionSchemaForDefinitions} unless a fresh instance is\n * required.\n */\nexport const buildCompositionSchemaFromDefinitions = (\n definitions: readonly AnyPrimitiveDefinition[]\n): ZodObject =>\n buildCompositionSchema({\n bodyNodeSchema: buildBodyNodeSchemaFromDefinitions(definitions),\n });\n\n// Keyed on the definition array's identity: a runtime needs the same schema\n// for its validator, parser, and authoring context, so hold the array\n// `composePacks` returns rather than flattening per call. The vocabulary is\n// cached with the schema because the JSON Schema id registry names member\n// instances, and a second resolution would produce different ones.\ninterface CachedCompositionSchema {\n schema: ZodObject;\n vocabulary: ResolvedVocabulary;\n}\n\nconst compositionSchemaCache = new WeakMap<object, CachedCompositionSchema>();\n\nconst cachedFor = (\n definitions: readonly AnyPrimitiveDefinition[]\n): CachedCompositionSchema => {\n const cached = compositionSchemaCache.get(definitions);\n if (cached) {\n return cached;\n }\n const vocabulary = resolveVocabulary(definitions);\n const entry: CachedCompositionSchema = {\n vocabulary,\n schema: buildCompositionSchema({\n bodyNodeSchema: vocabulary.bodyNodeSchema,\n }),\n };\n compositionSchemaCache.set(definitions, entry);\n return entry;\n};\n\n/**\n * {@link buildCompositionSchemaFromDefinitions}, memoized per definition array.\n * Prefer this whenever the caller does not need a fresh schema instance.\n */\nexport const getCompositionSchemaForDefinitions = (\n definitions: readonly AnyPrimitiveDefinition[]\n): ZodObject => cachedFor(definitions).schema;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { type AuthoringJsonSchemaOptions, authoringBodySchema, authoringSchemaSubset, buildAuthoringJsonSchema, } from './authoring_schema.js';
|
|
2
|
+
export { type CompositionSchemaOptions, buildBodyNodeSchemaFromDefinitions, buildCompositionSchema, buildCompositionSchemaFromDefinitions, getCompositionSchemaForDefinitions, metaSchema, } from './composition_schema.js';
|
|
3
|
+
export { type InputBudget, type InputBudgetCheck, MAX_INPUT_CHARACTERS, MAX_INPUT_DEPTH, MAX_INPUT_VALUES, checkInputBudget, isInputRefusal, } from './input_budget.js';
|
|
4
|
+
export { type CompositionJsonSchemaOptions, buildCompositionJsonSchema, } from './json_schema.js';
|
|
5
|
+
export { type IssueRoot, createNodeIssueFormatter } from './node_issues.js';
|
|
6
|
+
export { type UrlSchemaOptions, ASSET_URL_MESSAGE, ASSET_URL_RULE, BLOCKED_HREF, NAVIGATION_HREF_MESSAGE, NAVIGATION_HREF_RULE, assetUrl, navigationHref, sanitizeAssetUrl, sanitizeNavigationHref, sanitizeParsedAssetUrl, sanitizeParsedNavigationHref, } from './url.js';
|
|
7
|
+
export { type CheckedComposition, type CheckedValidationResult, type CompositionValidatorOptions, type ParsedComposition, type ValidationErrorMode, type ValidationResult, type ValidationWarning, compositionToRender, CompositionValidationError, createCompositionParser, createCompositionValidator, warningsForSurface, } from './validation.js';
|
|
8
|
+
export { displayValueSchema, namedColorSchema, renderThemeSchema, structuredValueSchema, } from './value_schemas.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,wBAAwB,EAC7B,kCAAkC,EAClC,sBAAsB,EACtB,qCAAqC,EACrC,kCAAkC,EAClC,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,4BAA4B,EACjC,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,SAAS,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
+
* 2.0.
|
|
6
|
+
*/
|
|
7
|
+
export { authoringBodySchema, authoringSchemaSubset, buildAuthoringJsonSchema, } from './authoring_schema.js';
|
|
8
|
+
export { buildBodyNodeSchemaFromDefinitions, buildCompositionSchema, buildCompositionSchemaFromDefinitions, getCompositionSchemaForDefinitions, metaSchema, } from './composition_schema.js';
|
|
9
|
+
export { MAX_INPUT_CHARACTERS, MAX_INPUT_DEPTH, MAX_INPUT_VALUES, checkInputBudget, isInputRefusal, } from './input_budget.js';
|
|
10
|
+
export { buildCompositionJsonSchema, } from './json_schema.js';
|
|
11
|
+
export { createNodeIssueFormatter } from './node_issues.js';
|
|
12
|
+
export { ASSET_URL_MESSAGE, ASSET_URL_RULE, BLOCKED_HREF, NAVIGATION_HREF_MESSAGE, NAVIGATION_HREF_RULE, assetUrl, navigationHref, sanitizeAssetUrl, sanitizeNavigationHref, sanitizeParsedAssetUrl, sanitizeParsedNavigationHref, } from './url.js';
|
|
13
|
+
export { compositionToRender, CompositionValidationError, createCompositionParser, createCompositionValidator, warningsForSurface, } from './validation.js';
|
|
14
|
+
export { displayValueSchema, namedColorSchema, renderThemeSchema, structuredValueSchema, } from './value_schemas.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,kCAAkC,EAClC,sBAAsB,EACtB,qCAAqC,EACrC,kCAAkC,EAClC,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkB,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAEL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,OAAO,CAAC;AACf,OAAO,EAQL,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type AuthoringJsonSchemaOptions,\n authoringBodySchema,\n authoringSchemaSubset,\n buildAuthoringJsonSchema,\n} from './authoring_schema';\nexport {\n type CompositionSchemaOptions,\n buildBodyNodeSchemaFromDefinitions,\n buildCompositionSchema,\n buildCompositionSchemaFromDefinitions,\n getCompositionSchemaForDefinitions,\n metaSchema,\n} from './composition_schema';\nexport {\n type InputBudget,\n type InputBudgetCheck,\n MAX_INPUT_CHARACTERS,\n MAX_INPUT_DEPTH,\n MAX_INPUT_VALUES,\n checkInputBudget,\n isInputRefusal,\n} from './input_budget';\nexport {\n type CompositionJsonSchemaOptions,\n buildCompositionJsonSchema,\n} from './json_schema';\nexport { type IssueRoot, createNodeIssueFormatter } from './node_issues';\nexport {\n type UrlSchemaOptions,\n ASSET_URL_MESSAGE,\n ASSET_URL_RULE,\n BLOCKED_HREF,\n NAVIGATION_HREF_MESSAGE,\n NAVIGATION_HREF_RULE,\n assetUrl,\n navigationHref,\n sanitizeAssetUrl,\n sanitizeNavigationHref,\n sanitizeParsedAssetUrl,\n sanitizeParsedNavigationHref,\n} from './url';\nexport {\n type CheckedComposition,\n type CheckedValidationResult,\n type CompositionValidatorOptions,\n type ParsedComposition,\n type ValidationErrorMode,\n type ValidationResult,\n type ValidationWarning,\n compositionToRender,\n CompositionValidationError,\n createCompositionParser,\n createCompositionValidator,\n warningsForSurface,\n} from './validation';\nexport {\n displayValueSchema,\n namedColorSchema,\n renderThemeSchema,\n structuredValueSchema,\n} from './value_schemas';\n"]}
|