@elytracms/core 0.0.6
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 +21 -0
- package/dist/clipboard/build.d.ts +77 -0
- package/dist/clipboard/build.js +128 -0
- package/dist/clipboard/build.js.map +1 -0
- package/dist/clipboard/clipboard.d.ts +33 -0
- package/dist/clipboard/clipboard.js +45 -0
- package/dist/clipboard/clipboard.js.map +1 -0
- package/dist/clipboard/fragment.d.ts +112 -0
- package/dist/clipboard/fragment.js +79 -0
- package/dist/clipboard/fragment.js.map +1 -0
- package/dist/clipboard/html.d.ts +26 -0
- package/dist/clipboard/html.js +82 -0
- package/dist/clipboard/html.js.map +1 -0
- package/dist/clipboard/index.d.ts +15 -0
- package/dist/clipboard/index.js +16 -0
- package/dist/clipboard/index.js.map +1 -0
- package/dist/clipboard/references.d.ts +50 -0
- package/dist/clipboard/references.js +0 -0
- package/dist/clipboard/references.js.map +1 -0
- package/dist/clipboard/serialize.d.ts +69 -0
- package/dist/clipboard/serialize.js +130 -0
- package/dist/clipboard/serialize.js.map +1 -0
- package/dist/cms-core/collections.d.ts +82 -0
- package/dist/cms-core/collections.js +187 -0
- package/dist/cms-core/collections.js.map +1 -0
- package/dist/cms-core/documents.d.ts +71 -0
- package/dist/cms-core/documents.js +67 -0
- package/dist/cms-core/documents.js.map +1 -0
- package/dist/cms-core/envelopes.d.ts +80 -0
- package/dist/cms-core/envelopes.js +124 -0
- package/dist/cms-core/envelopes.js.map +1 -0
- package/dist/cms-core/fields.d.ts +220 -0
- package/dist/cms-core/fields.js +250 -0
- package/dist/cms-core/fields.js.map +1 -0
- package/dist/cms-core/fixtures.d.ts +92 -0
- package/dist/cms-core/fixtures.js +357 -0
- package/dist/cms-core/fixtures.js.map +1 -0
- package/dist/cms-core/hierarchy.d.ts +113 -0
- package/dist/cms-core/hierarchy.js +223 -0
- package/dist/cms-core/hierarchy.js.map +1 -0
- package/dist/cms-core/index.d.ts +25 -0
- package/dist/cms-core/index.js +26 -0
- package/dist/cms-core/index.js.map +1 -0
- package/dist/cms-core/infer.d.ts +103 -0
- package/dist/cms-core/infer.js +57 -0
- package/dist/cms-core/infer.js.map +1 -0
- package/dist/cms-core/issues.d.ts +92 -0
- package/dist/cms-core/issues.js +74 -0
- package/dist/cms-core/issues.js.map +1 -0
- package/dist/cms-core/json-schema.d.ts +25 -0
- package/dist/cms-core/json-schema.js +110 -0
- package/dist/cms-core/json-schema.js.map +1 -0
- package/dist/cms-core/localization.d.ts +51 -0
- package/dist/cms-core/localization.js +89 -0
- package/dist/cms-core/localization.js.map +1 -0
- package/dist/cms-core/routes.d.ts +76 -0
- package/dist/cms-core/routes.js +220 -0
- package/dist/cms-core/routes.js.map +1 -0
- package/dist/cms-core/self-type.d.ts +41 -0
- package/dist/cms-core/self-type.js +191 -0
- package/dist/cms-core/self-type.js.map +1 -0
- package/dist/cms-core/url-for-document.d.ts +39 -0
- package/dist/cms-core/url-for-document.js +138 -0
- package/dist/cms-core/url-for-document.js.map +1 -0
- package/dist/cms-core/validate-document.d.ts +121 -0
- package/dist/cms-core/validate-document.js +871 -0
- package/dist/cms-core/validate-document.js.map +1 -0
- package/dist/cms-core/versions.d.ts +75 -0
- package/dist/cms-core/versions.js +97 -0
- package/dist/cms-core/versions.js.map +1 -0
- package/dist/collaboration/approval.d.ts +68 -0
- package/dist/collaboration/approval.js +104 -0
- package/dist/collaboration/approval.js.map +1 -0
- package/dist/collaboration/collaboration.d.ts +49 -0
- package/dist/collaboration/collaboration.js +56 -0
- package/dist/collaboration/collaboration.js.map +1 -0
- package/dist/collaboration/comments.d.ts +72 -0
- package/dist/collaboration/comments.js +118 -0
- package/dist/collaboration/comments.js.map +1 -0
- package/dist/collaboration/core.d.ts +25 -0
- package/dist/collaboration/core.js +26 -0
- package/dist/collaboration/core.js.map +1 -0
- package/dist/collaboration/index.d.ts +14 -0
- package/dist/collaboration/index.js +15 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/presence.d.ts +62 -0
- package/dist/collaboration/presence.js +85 -0
- package/dist/collaboration/presence.js.map +1 -0
- package/dist/collaboration/publishing.d.ts +60 -0
- package/dist/collaboration/publishing.js +93 -0
- package/dist/collaboration/publishing.js.map +1 -0
- package/dist/collaboration/versions.d.ts +52 -0
- package/dist/collaboration/versions.js +81 -0
- package/dist/collaboration/versions.js.map +1 -0
- package/dist/component-registry/index.d.ts +3 -0
- package/dist/component-registry/index.js +4 -0
- package/dist/component-registry/index.js.map +1 -0
- package/dist/component-registry/issues.d.ts +6 -0
- package/dist/component-registry/issues.js +2 -0
- package/dist/component-registry/issues.js.map +1 -0
- package/dist/component-registry/manifest.d.ts +164 -0
- package/dist/component-registry/manifest.js +129 -0
- package/dist/component-registry/manifest.js.map +1 -0
- package/dist/component-registry/registry.d.ts +33 -0
- package/dist/component-registry/registry.js +90 -0
- package/dist/component-registry/registry.js.map +1 -0
- package/dist/content/__fixtures__/filterable-collections.d.ts +14 -0
- package/dist/content/__fixtures__/filterable-collections.js +15 -0
- package/dist/content/__fixtures__/filterable-collections.js.map +1 -0
- package/dist/content/__fixtures__/sample-accessor-types.d.ts +56 -0
- package/dist/content/__fixtures__/sample-accessor-types.js +5 -0
- package/dist/content/__fixtures__/sample-accessor-types.js.map +1 -0
- package/dist/content/__fixtures__/sample-delivery-types.d.ts +122 -0
- package/dist/content/__fixtures__/sample-delivery-types.js +5 -0
- package/dist/content/__fixtures__/sample-delivery-types.js.map +1 -0
- package/dist/content/assets.d.ts +53 -0
- package/dist/content/assets.js +38 -0
- package/dist/content/assets.js.map +1 -0
- package/dist/content/binding-sources.d.ts +53 -0
- package/dist/content/binding-sources.js +73 -0
- package/dist/content/binding-sources.js.map +1 -0
- package/dist/content/client.d.ts +90 -0
- package/dist/content/client.js +383 -0
- package/dist/content/client.js.map +1 -0
- package/dist/content/codegen.d.ts +54 -0
- package/dist/content/codegen.js +305 -0
- package/dist/content/codegen.js.map +1 -0
- package/dist/content/context.d.ts +38 -0
- package/dist/content/context.js +21 -0
- package/dist/content/context.js.map +1 -0
- package/dist/content/cursor.d.ts +33 -0
- package/dist/content/cursor.js +104 -0
- package/dist/content/cursor.js.map +1 -0
- package/dist/content/index.d.ts +28 -0
- package/dist/content/index.js +29 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/locale.d.ts +30 -0
- package/dist/content/locale.js +26 -0
- package/dist/content/locale.js.map +1 -0
- package/dist/content/perspective.d.ts +29 -0
- package/dist/content/perspective.js +31 -0
- package/dist/content/perspective.js.map +1 -0
- package/dist/content/populate.d.ts +25 -0
- package/dist/content/populate.js +22 -0
- package/dist/content/populate.js.map +1 -0
- package/dist/content/query.d.ts +122 -0
- package/dist/content/query.js +257 -0
- package/dist/content/query.js.map +1 -0
- package/dist/content/raw.d.ts +13 -0
- package/dist/content/raw.js +14 -0
- package/dist/content/raw.js.map +1 -0
- package/dist/content/resolve.d.ts +97 -0
- package/dist/content/resolve.js +261 -0
- package/dist/content/resolve.js.map +1 -0
- package/dist/content/serialize.d.ts +30 -0
- package/dist/content/serialize.js +57 -0
- package/dist/content/serialize.js.map +1 -0
- package/dist/content/tags.d.ts +54 -0
- package/dist/content/tags.js +40 -0
- package/dist/content/tags.js.map +1 -0
- package/dist/data-binding/fixtures.d.ts +20 -0
- package/dist/data-binding/fixtures.js +47 -0
- package/dist/data-binding/fixtures.js.map +1 -0
- package/dist/data-binding/index.d.ts +14 -0
- package/dist/data-binding/index.js +15 -0
- package/dist/data-binding/index.js.map +1 -0
- package/dist/data-binding/issues.d.ts +45 -0
- package/dist/data-binding/issues.js +46 -0
- package/dist/data-binding/issues.js.map +1 -0
- package/dist/data-binding/resolve.d.ts +87 -0
- package/dist/data-binding/resolve.js +204 -0
- package/dist/data-binding/resolve.js.map +1 -0
- package/dist/data-binding/sample.d.ts +21 -0
- package/dist/data-binding/sample.js +23 -0
- package/dist/data-binding/sample.js.map +1 -0
- package/dist/data-binding/sources.d.ts +225 -0
- package/dist/data-binding/sources.js +154 -0
- package/dist/data-binding/sources.js.map +1 -0
- package/dist/data-binding/tokens.d.ts +62 -0
- package/dist/data-binding/tokens.js +150 -0
- package/dist/data-binding/tokens.js.map +1 -0
- package/dist/design-tokens/css.d.ts +34 -0
- package/dist/design-tokens/css.js +51 -0
- package/dist/design-tokens/css.js.map +1 -0
- package/dist/design-tokens/index.d.ts +10 -0
- package/dist/design-tokens/index.js +11 -0
- package/dist/design-tokens/index.js.map +1 -0
- package/dist/design-tokens/style-guide.d.ts +30 -0
- package/dist/design-tokens/style-guide.js +31 -0
- package/dist/design-tokens/style-guide.js.map +1 -0
- package/dist/design-tokens/tokens.d.ts +89 -0
- package/dist/design-tokens/tokens.js +112 -0
- package/dist/design-tokens/tokens.js.map +1 -0
- package/dist/export-sync/builder-source.d.ts +85 -0
- package/dist/export-sync/builder-source.js +124 -0
- package/dist/export-sync/builder-source.js.map +1 -0
- package/dist/export-sync/check.d.ts +61 -0
- package/dist/export-sync/check.js +126 -0
- package/dist/export-sync/check.js.map +1 -0
- package/dist/export-sync/cli.d.ts +89 -0
- package/dist/export-sync/cli.js +323 -0
- package/dist/export-sync/cli.js.map +1 -0
- package/dist/export-sync/core.d.ts +58 -0
- package/dist/export-sync/core.js +41 -0
- package/dist/export-sync/core.js.map +1 -0
- package/dist/export-sync/eject.d.ts +28 -0
- package/dist/export-sync/eject.js +21 -0
- package/dist/export-sync/eject.js.map +1 -0
- package/dist/export-sync/fixtures.d.ts +25 -0
- package/dist/export-sync/fixtures.js +87 -0
- package/dist/export-sync/fixtures.js.map +1 -0
- package/dist/export-sync/generate.d.ts +7 -0
- package/dist/export-sync/generate.js +505 -0
- package/dist/export-sync/generate.js.map +1 -0
- package/dist/export-sync/index.d.ts +37 -0
- package/dist/export-sync/index.js +39 -0
- package/dist/export-sync/index.js.map +1 -0
- package/dist/export-sync/init.d.ts +123 -0
- package/dist/export-sync/init.js +234 -0
- package/dist/export-sync/init.js.map +1 -0
- package/dist/export-sync/manifest-host.d.ts +48 -0
- package/dist/export-sync/manifest-host.js +73 -0
- package/dist/export-sync/manifest-host.js.map +1 -0
- package/dist/export-sync/node.d.ts +20 -0
- package/dist/export-sync/node.js +101 -0
- package/dist/export-sync/node.js.map +1 -0
- package/dist/export-sync/push.d.ts +76 -0
- package/dist/export-sync/push.js +197 -0
- package/dist/export-sync/push.js.map +1 -0
- package/dist/export-sync/registry-sync-client.d.ts +59 -0
- package/dist/export-sync/registry-sync-client.js +97 -0
- package/dist/export-sync/registry-sync-client.js.map +1 -0
- package/dist/export-sync/sync.d.ts +47 -0
- package/dist/export-sync/sync.js +47 -0
- package/dist/export-sync/sync.js.map +1 -0
- package/dist/export-sync/typegen.d.ts +40 -0
- package/dist/export-sync/typegen.js +45 -0
- package/dist/export-sync/typegen.js.map +1 -0
- package/dist/export-sync/validate.d.ts +19 -0
- package/dist/export-sync/validate.js +102 -0
- package/dist/export-sync/validate.js.map +1 -0
- package/dist/export-sync/watch.d.ts +66 -0
- package/dist/export-sync/watch.js +70 -0
- package/dist/export-sync/watch.js.map +1 -0
- package/dist/operations/assets.d.ts +198 -0
- package/dist/operations/assets.js +75 -0
- package/dist/operations/assets.js.map +1 -0
- package/dist/operations/authorization.d.ts +49 -0
- package/dist/operations/authorization.js +128 -0
- package/dist/operations/authorization.js.map +1 -0
- package/dist/operations/changesets.d.ts +160 -0
- package/dist/operations/changesets.js +442 -0
- package/dist/operations/changesets.js.map +1 -0
- package/dist/operations/client.d.ts +49 -0
- package/dist/operations/client.js +57 -0
- package/dist/operations/client.js.map +1 -0
- package/dist/operations/core.d.ts +238 -0
- package/dist/operations/core.js +269 -0
- package/dist/operations/core.js.map +1 -0
- package/dist/operations/documents.d.ts +432 -0
- package/dist/operations/documents.js +344 -0
- package/dist/operations/documents.js.map +1 -0
- package/dist/operations/graph.d.ts +138 -0
- package/dist/operations/graph.js +78 -0
- package/dist/operations/graph.js.map +1 -0
- package/dist/operations/index.d.ts +19 -0
- package/dist/operations/index.js +20 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/operations/members.d.ts +87 -0
- package/dist/operations/members.js +56 -0
- package/dist/operations/members.js.map +1 -0
- package/dist/operations/publishing.d.ts +89 -0
- package/dist/operations/publishing.js +57 -0
- package/dist/operations/publishing.js.map +1 -0
- package/dist/operations/references.d.ts +222 -0
- package/dist/operations/references.js +177 -0
- package/dist/operations/references.js.map +1 -0
- package/dist/operations/schema.d.ts +413 -0
- package/dist/operations/schema.js +138 -0
- package/dist/operations/schema.js.map +1 -0
- package/dist/operations/tokens.d.ts +79 -0
- package/dist/operations/tokens.js +102 -0
- package/dist/operations/tokens.js.map +1 -0
- package/dist/persistence/adapter.d.ts +79 -0
- package/dist/persistence/adapter.js +55 -0
- package/dist/persistence/adapter.js.map +1 -0
- package/dist/persistence/assets.d.ts +120 -0
- package/dist/persistence/assets.js +141 -0
- package/dist/persistence/assets.js.map +1 -0
- package/dist/persistence/backend-validation.d.ts +43 -0
- package/dist/persistence/backend-validation.js +57 -0
- package/dist/persistence/backend-validation.js.map +1 -0
- package/dist/persistence/cli-tokens.d.ts +50 -0
- package/dist/persistence/cli-tokens.js +66 -0
- package/dist/persistence/cli-tokens.js.map +1 -0
- package/dist/persistence/cms.d.ts +148 -0
- package/dist/persistence/cms.js +232 -0
- package/dist/persistence/cms.js.map +1 -0
- package/dist/persistence/contract-scenarios.d.ts +73 -0
- package/dist/persistence/contract-scenarios.js +496 -0
- package/dist/persistence/contract-scenarios.js.map +1 -0
- package/dist/persistence/core.d.ts +96 -0
- package/dist/persistence/core.js +110 -0
- package/dist/persistence/core.js.map +1 -0
- package/dist/persistence/graph.d.ts +61 -0
- package/dist/persistence/graph.js +98 -0
- package/dist/persistence/graph.js.map +1 -0
- package/dist/persistence/index.d.ts +22 -0
- package/dist/persistence/index.js +23 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/members.d.ts +70 -0
- package/dist/persistence/members.js +0 -0
- package/dist/persistence/members.js.map +1 -0
- package/dist/persistence/publishing.d.ts +59 -0
- package/dist/persistence/publishing.js +95 -0
- package/dist/persistence/publishing.js.map +1 -0
- package/dist/persistence/reference-extraction.d.ts +44 -0
- package/dist/persistence/reference-extraction.js +204 -0
- package/dist/persistence/reference-extraction.js.map +1 -0
- package/dist/persistence/reference-indexing.d.ts +68 -0
- package/dist/persistence/reference-indexing.js +112 -0
- package/dist/persistence/reference-indexing.js.map +1 -0
- package/dist/persistence/references.d.ts +257 -0
- package/dist/persistence/references.js +0 -0
- package/dist/persistence/references.js.map +1 -0
- package/dist/persistence/seed.d.ts +55 -0
- package/dist/persistence/seed.js +102 -0
- package/dist/persistence/seed.js.map +1 -0
- package/dist/persistence/self-maintaining-adapter.d.ts +41 -0
- package/dist/persistence/self-maintaining-adapter.js +79 -0
- package/dist/persistence/self-maintaining-adapter.js.map +1 -0
- package/dist/plugins/asset-storage.d.ts +76 -0
- package/dist/plugins/asset-storage.js +104 -0
- package/dist/plugins/asset-storage.js.map +1 -0
- package/dist/plugins/component-package.d.ts +54 -0
- package/dist/plugins/component-package.js +92 -0
- package/dist/plugins/component-package.js.map +1 -0
- package/dist/plugins/data-sources.d.ts +78 -0
- package/dist/plugins/data-sources.js +99 -0
- package/dist/plugins/data-sources.js.map +1 -0
- package/dist/plugins/examples.d.ts +47 -0
- package/dist/plugins/examples.js +205 -0
- package/dist/plugins/examples.js.map +1 -0
- package/dist/plugins/export-targets.d.ts +47 -0
- package/dist/plugins/export-targets.js +78 -0
- package/dist/plugins/export-targets.js.map +1 -0
- package/dist/plugins/field-types.d.ts +86 -0
- package/dist/plugins/field-types.js +93 -0
- package/dist/plugins/field-types.js.map +1 -0
- package/dist/plugins/hooks.d.ts +60 -0
- package/dist/plugins/hooks.js +94 -0
- package/dist/plugins/hooks.js.map +1 -0
- package/dist/plugins/index.d.ts +27 -0
- package/dist/plugins/index.js +28 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/marketplace.d.ts +90 -0
- package/dist/plugins/marketplace.js +110 -0
- package/dist/plugins/marketplace.js.map +1 -0
- package/dist/plugins/plugin.d.ts +107 -0
- package/dist/plugins/plugin.js +122 -0
- package/dist/plugins/plugin.js.map +1 -0
- package/dist/plugins/templates.d.ts +66 -0
- package/dist/plugins/templates.js +74 -0
- package/dist/plugins/templates.js.map +1 -0
- package/dist/project-graph/binding.d.ts +68 -0
- package/dist/project-graph/binding.js +39 -0
- package/dist/project-graph/binding.js.map +1 -0
- package/dist/project-graph/container.d.ts +126 -0
- package/dist/project-graph/container.js +221 -0
- package/dist/project-graph/container.js.map +1 -0
- package/dist/project-graph/edit.d.ts +66 -0
- package/dist/project-graph/edit.js +201 -0
- package/dist/project-graph/edit.js.map +1 -0
- package/dist/project-graph/fixtures.d.ts +51 -0
- package/dist/project-graph/fixtures.js +224 -0
- package/dist/project-graph/fixtures.js.map +1 -0
- package/dist/project-graph/ids.d.ts +17 -0
- package/dist/project-graph/ids.js +19 -0
- package/dist/project-graph/ids.js.map +1 -0
- package/dist/project-graph/index.d.ts +12 -0
- package/dist/project-graph/index.js +13 -0
- package/dist/project-graph/index.js.map +1 -0
- package/dist/project-graph/issues.d.ts +61 -0
- package/dist/project-graph/issues.js +44 -0
- package/dist/project-graph/issues.js.map +1 -0
- package/dist/project-graph/json.d.ts +6 -0
- package/dist/project-graph/json.js +10 -0
- package/dist/project-graph/json.js.map +1 -0
- package/dist/project-graph/node.d.ts +48 -0
- package/dist/project-graph/node.js +42 -0
- package/dist/project-graph/node.js.map +1 -0
- package/dist/project-graph/normalize.d.ts +17 -0
- package/dist/project-graph/normalize.js +110 -0
- package/dist/project-graph/normalize.js.map +1 -0
- package/dist/project-graph/serialize.d.ts +36 -0
- package/dist/project-graph/serialize.js +51 -0
- package/dist/project-graph/serialize.js.map +1 -0
- package/dist/project-graph/structure.d.ts +40 -0
- package/dist/project-graph/structure.js +36 -0
- package/dist/project-graph/structure.js.map +1 -0
- package/dist/project-graph/validate.d.ts +84 -0
- package/dist/project-graph/validate.js +158 -0
- package/dist/project-graph/validate.js.map +1 -0
- package/dist/rich-text/adapter.d.ts +43 -0
- package/dist/rich-text/adapter.js +24 -0
- package/dist/rich-text/adapter.js.map +1 -0
- package/dist/rich-text/dom-editor.d.ts +101 -0
- package/dist/rich-text/dom-editor.js +482 -0
- package/dist/rich-text/dom-editor.js.map +1 -0
- package/dist/rich-text/embed.d.ts +70 -0
- package/dist/rich-text/embed.js +70 -0
- package/dist/rich-text/embed.js.map +1 -0
- package/dist/rich-text/fixtures.d.ts +25 -0
- package/dist/rich-text/fixtures.js +115 -0
- package/dist/rich-text/fixtures.js.map +1 -0
- package/dist/rich-text/html.d.ts +5 -0
- package/dist/rich-text/html.js +309 -0
- package/dist/rich-text/html.js.map +1 -0
- package/dist/rich-text/index.d.ts +19 -0
- package/dist/rich-text/index.js +20 -0
- package/dist/rich-text/index.js.map +1 -0
- package/dist/rich-text/markdown.d.ts +7 -0
- package/dist/rich-text/markdown.js +235 -0
- package/dist/rich-text/markdown.js.map +1 -0
- package/dist/rich-text/portable-text.d.ts +50 -0
- package/dist/rich-text/portable-text.js +223 -0
- package/dist/rich-text/portable-text.js.map +1 -0
- package/dist/rich-text/registry.d.ts +48 -0
- package/dist/rich-text/registry.js +16 -0
- package/dist/rich-text/registry.js.map +1 -0
- package/dist/rich-text/render.d.ts +69 -0
- package/dist/rich-text/render.js +205 -0
- package/dist/rich-text/render.js.map +1 -0
- package/dist/rich-text/schema.d.ts +86 -0
- package/dist/rich-text/schema.js +80 -0
- package/dist/rich-text/schema.js.map +1 -0
- package/dist/rich-text/test-support.d.ts +7 -0
- package/dist/rich-text/test-support.js +8 -0
- package/dist/rich-text/test-support.js.map +1 -0
- package/dist/runtime-renderer/client.d.ts +14 -0
- package/dist/runtime-renderer/client.js +15 -0
- package/dist/runtime-renderer/client.js.map +1 -0
- package/dist/runtime-renderer/condition.d.ts +8 -0
- package/dist/runtime-renderer/condition.js +48 -0
- package/dist/runtime-renderer/condition.js.map +1 -0
- package/dist/runtime-renderer/content-client.d.ts +62 -0
- package/dist/runtime-renderer/content-client.js +37 -0
- package/dist/runtime-renderer/content-client.js.map +1 -0
- package/dist/runtime-renderer/context.d.ts +185 -0
- package/dist/runtime-renderer/context.js +7 -0
- package/dist/runtime-renderer/context.js.map +1 -0
- package/dist/runtime-renderer/fallback.d.ts +39 -0
- package/dist/runtime-renderer/fallback.js +45 -0
- package/dist/runtime-renderer/fallback.js.map +1 -0
- package/dist/runtime-renderer/index.d.ts +13 -0
- package/dist/runtime-renderer/index.js +13 -0
- package/dist/runtime-renderer/index.js.map +1 -0
- package/dist/runtime-renderer/primitives.d.ts +85 -0
- package/dist/runtime-renderer/primitives.js +442 -0
- package/dist/runtime-renderer/primitives.js.map +1 -0
- package/dist/runtime-renderer/render.d.ts +138 -0
- package/dist/runtime-renderer/render.js +825 -0
- package/dist/runtime-renderer/render.js.map +1 -0
- package/dist/runtime-renderer/rich-text.d.ts +26 -0
- package/dist/runtime-renderer/rich-text.js +113 -0
- package/dist/runtime-renderer/rich-text.js.map +1 -0
- package/dist/starter-kits/index.d.ts +13 -0
- package/dist/starter-kits/index.js +14 -0
- package/dist/starter-kits/index.js.map +1 -0
- package/dist/starter-kits/instantiate.d.ts +29 -0
- package/dist/starter-kits/instantiate.js +24 -0
- package/dist/starter-kits/instantiate.js.map +1 -0
- package/dist/starter-kits/kit.d.ts +61 -0
- package/dist/starter-kits/kit.js +37 -0
- package/dist/starter-kits/kit.js.map +1 -0
- package/dist/starter-kits/kits.d.ts +7 -0
- package/dist/starter-kits/kits.js +201 -0
- package/dist/starter-kits/kits.js.map +1 -0
- package/dist/starter-kits/manifests.d.ts +7 -0
- package/dist/starter-kits/manifests.js +111 -0
- package/dist/starter-kits/manifests.js.map +1 -0
- package/dist/starter-kits/upgrade.d.ts +39 -0
- package/dist/starter-kits/upgrade.js +54 -0
- package/dist/starter-kits/upgrade.js.map +1 -0
- package/dist/starter-kits/validate.d.ts +16 -0
- package/dist/starter-kits/validate.js +77 -0
- package/dist/starter-kits/validate.js.map +1 -0
- package/dist/studio-core/context.d.ts +27 -0
- package/dist/studio-core/context.js +44 -0
- package/dist/studio-core/context.js.map +1 -0
- package/dist/studio-core/errors.d.ts +58 -0
- package/dist/studio-core/errors.js +74 -0
- package/dist/studio-core/errors.js.map +1 -0
- package/dist/studio-core/fixtures.d.ts +18 -0
- package/dist/studio-core/fixtures.js +83 -0
- package/dist/studio-core/fixtures.js.map +1 -0
- package/dist/studio-core/ids.d.ts +22 -0
- package/dist/studio-core/ids.js +33 -0
- package/dist/studio-core/ids.js.map +1 -0
- package/dist/studio-core/index.d.ts +11 -0
- package/dist/studio-core/index.js +12 -0
- package/dist/studio-core/index.js.map +1 -0
- package/dist/studio-core/issues.d.ts +50 -0
- package/dist/studio-core/issues.js +33 -0
- package/dist/studio-core/issues.js.map +1 -0
- package/dist/studio-core/metadata.d.ts +109 -0
- package/dist/studio-core/metadata.js +74 -0
- package/dist/studio-core/metadata.js.map +1 -0
- package/dist/studio-core/repository.d.ts +73 -0
- package/dist/studio-core/repository.js +202 -0
- package/dist/studio-core/repository.js.map +1 -0
- package/dist/studio-core/sections.d.ts +73 -0
- package/dist/studio-core/sections.js +68 -0
- package/dist/studio-core/sections.js.map +1 -0
- package/dist/studio-core/validate.d.ts +15 -0
- package/dist/studio-core/validate.js +119 -0
- package/dist/studio-core/validate.js.map +1 -0
- package/dist/studio-core/workspace-config.d.ts +587 -0
- package/dist/studio-core/workspace-config.js +434 -0
- package/dist/studio-core/workspace-config.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonValueSchema } from '@elytracms/core/project-graph';
|
|
3
|
+
/**
|
|
4
|
+
* Stable codes for structured binding issues. Broken bindings are represented as data —
|
|
5
|
+
* never thrown — so the renderer can show a fallback and the inspector can surface the
|
|
6
|
+
* problem (brief §4.6, §7.5; AGENTS.md "validation is first-class").
|
|
7
|
+
*
|
|
8
|
+
* - `unknown-source` the binding's `sourceId` is not in the source registry
|
|
9
|
+
* - `unresolved-token` the token does not resolve to a value in the payload
|
|
10
|
+
* - `missing-item` a `repeaterItem` binding was resolved with no item context
|
|
11
|
+
* - `invalid-spread` a `spread` binding resolved to a non-object (cannot spread)
|
|
12
|
+
* - `no-sample` an operation needed a captured sample but none was present
|
|
13
|
+
*/
|
|
14
|
+
export const bindingIssueCodeSchema = z.enum([
|
|
15
|
+
'unknown-source',
|
|
16
|
+
'unresolved-token',
|
|
17
|
+
'missing-item',
|
|
18
|
+
'invalid-spread',
|
|
19
|
+
'no-sample',
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* A structured binding issue. Mirrors `@elytracms/core/project-graph`'s ValidationIssue shape
|
|
23
|
+
* (code/message/meta) but scoped to binding resolution, where the relevant locator is the
|
|
24
|
+
* source id and token rather than a graph path.
|
|
25
|
+
*/
|
|
26
|
+
export const bindingIssueSchema = z.object({
|
|
27
|
+
code: bindingIssueCodeSchema,
|
|
28
|
+
message: z.string(),
|
|
29
|
+
/** The data source the binding targeted, when known. */
|
|
30
|
+
sourceId: z.string().optional(),
|
|
31
|
+
/** The path token that failed to resolve, when applicable. */
|
|
32
|
+
token: z.string().optional(),
|
|
33
|
+
meta: z.record(z.string(), jsonValueSchema).optional(),
|
|
34
|
+
});
|
|
35
|
+
/** Construct a {@link BindingIssue} with optional locator/meta fields omitted when absent. */
|
|
36
|
+
export function bindingIssue(code, message, fields = {}) {
|
|
37
|
+
const { sourceId, token, meta } = fields;
|
|
38
|
+
return {
|
|
39
|
+
code,
|
|
40
|
+
message,
|
|
41
|
+
...(sourceId !== undefined ? { sourceId } : {}),
|
|
42
|
+
...(token !== undefined ? { token } : {}),
|
|
43
|
+
...(meta !== undefined ? { meta } : {}),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=issues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/data-binding/issues.ts"],"names":[],"mappings":"AA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0 +1,87 @@
|
|
|
1
|
+
import type { BindingReference, Condition, JsonValue } from '@elytracms/core/project-graph';
|
|
2
|
+
import type { BindingIssue } from './issues';
|
|
3
|
+
import type { SourceRegistry } from './sources';
|
|
4
|
+
/**
|
|
5
|
+
* Binding resolution (EC-024). Resolves the five binding modes against captured payloads, in a
|
|
6
|
+
* form the renderer can inject directly. A binding that cannot be resolved (unknown source,
|
|
7
|
+
* unresolvable token, missing repeater context, non-object spread) yields a structured
|
|
8
|
+
* {@link BindingIssue} — never a throw or crash (AGENTS.md "validation is first-class").
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The repeater item context (EC-024). When the renderer is inside a repeater, each iteration
|
|
12
|
+
* supplies the current `item` and its zero-based `index`. `repeaterItem` bindings resolve their
|
|
13
|
+
* token relative to `item` rather than the source payload.
|
|
14
|
+
*/
|
|
15
|
+
export interface RepeaterItemContext {
|
|
16
|
+
item: JsonValue;
|
|
17
|
+
index: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What the renderer needs to apply a binding. Discriminated by `kind`:
|
|
21
|
+
* - `value` a single resolved value to set on a prop
|
|
22
|
+
* - `props` a record of props to spread onto the component (`spread` mode)
|
|
23
|
+
* - `condition` a boolean gate (`condition` mode)
|
|
24
|
+
* - `issue` the binding is broken; carries the structured {@link BindingIssue}
|
|
25
|
+
*/
|
|
26
|
+
export type BindingResolution = {
|
|
27
|
+
kind: 'value';
|
|
28
|
+
value: JsonValue;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'props';
|
|
31
|
+
props: Record<string, JsonValue>;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'condition';
|
|
34
|
+
pass: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'issue';
|
|
37
|
+
issue: BindingIssue;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A payload store: the resolved payload for each source id, keyed by id. The renderer builds
|
|
41
|
+
* this by running each source's fetch/query (via the project adapters). Passing the registry
|
|
42
|
+
* instead — or in addition — lets resolution detect *unknown* sources distinctly from sources
|
|
43
|
+
* that simply have not loaded yet.
|
|
44
|
+
*/
|
|
45
|
+
export type PayloadStore = Readonly<Record<string, JsonValue>>;
|
|
46
|
+
export interface ResolveContext {
|
|
47
|
+
/** Resolved payloads keyed by source id. */
|
|
48
|
+
payloads: PayloadStore;
|
|
49
|
+
/** Optional registry, used to distinguish an unknown source from one that has not loaded. */
|
|
50
|
+
registry?: Pick<SourceRegistry, 'has'>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolve a binding reference against a payload store, suitable for the renderer to inject
|
|
54
|
+
* (EC-024). The optional `itemContext` supplies the current `{ item, index }` for bindings used
|
|
55
|
+
* inside a repeater.
|
|
56
|
+
*
|
|
57
|
+
* Mode behaviour:
|
|
58
|
+
* - `value` resolve the token to a single value
|
|
59
|
+
* - `object` resolve the token to an object value (same resolution as `value`; the mode
|
|
60
|
+
* records authoring intent that the result is an object)
|
|
61
|
+
* - `spread` resolve the token to an object and expose it as props to spread; a non-object
|
|
62
|
+
* result is an `invalid-spread` issue
|
|
63
|
+
* - `repeaterItem` resolve the token relative to `itemContext.item`; missing context is a
|
|
64
|
+
* `missing-item` issue
|
|
65
|
+
* - `condition` resolve the token to a value and coerce to a boolean gate (truthiness). Use
|
|
66
|
+
* {@link resolveCondition} for full operator support.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveBinding(ref: BindingReference, ctx: ResolveContext, itemContext?: RepeaterItemContext): BindingResolution;
|
|
69
|
+
/**
|
|
70
|
+
* Evaluate a project-graph {@link Condition} against a payload store (EC-024). The left operand
|
|
71
|
+
* is resolved from the condition's binding; the operator compares it to the condition's `value`.
|
|
72
|
+
* A broken left operand yields a structured issue instead of a pass/fail so the renderer can
|
|
73
|
+
* surface it. `exists` checks the token resolved at all (using a sentinel-free probe).
|
|
74
|
+
*/
|
|
75
|
+
export type ConditionResolution = {
|
|
76
|
+
kind: 'condition';
|
|
77
|
+
pass: boolean;
|
|
78
|
+
} | {
|
|
79
|
+
kind: 'issue';
|
|
80
|
+
issue: BindingIssue;
|
|
81
|
+
};
|
|
82
|
+
export declare function resolveCondition(condition: Condition, ctx: ResolveContext, itemContext?: RepeaterItemContext): ConditionResolution;
|
|
83
|
+
/** True if a resolution is a broken binding (a structured issue). Convenience for the renderer. */
|
|
84
|
+
export declare function isBindingIssue(resolution: BindingResolution | ConditionResolution): resolution is {
|
|
85
|
+
kind: 'issue';
|
|
86
|
+
issue: BindingIssue;
|
|
87
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { bindingIssue } from './issues';
|
|
2
|
+
import { resolveToken } from './tokens';
|
|
3
|
+
const isPlainObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
4
|
+
/** Look up a source's payload, returning a structured issue when the source is unknown/unloaded. */
|
|
5
|
+
function lookupPayload(ref, ctx) {
|
|
6
|
+
const known = ctx.registry ? ctx.registry.has(ref.sourceId) : ref.sourceId in ctx.payloads;
|
|
7
|
+
if (!known) {
|
|
8
|
+
return {
|
|
9
|
+
ok: false,
|
|
10
|
+
issue: bindingIssue('unknown-source', `Binding references unknown data source "${ref.sourceId}".`, {
|
|
11
|
+
sourceId: ref.sourceId,
|
|
12
|
+
token: ref.token,
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
if (!(ref.sourceId in ctx.payloads)) {
|
|
17
|
+
// Known source, but no payload captured/loaded — treat as an unresolved token at the root.
|
|
18
|
+
return {
|
|
19
|
+
ok: false,
|
|
20
|
+
issue: bindingIssue('unresolved-token', `No payload loaded for source "${ref.sourceId}".`, {
|
|
21
|
+
sourceId: ref.sourceId,
|
|
22
|
+
token: ref.token,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return { ok: true, payload: ctx.payloads[ref.sourceId] };
|
|
27
|
+
}
|
|
28
|
+
/** Resolve a token against a base value, producing the value or an `unresolved-token` issue. */
|
|
29
|
+
function resolveAgainst(base, ref) {
|
|
30
|
+
const result = resolveToken(base, ref.token);
|
|
31
|
+
if (!result.found) {
|
|
32
|
+
return {
|
|
33
|
+
ok: false,
|
|
34
|
+
issue: bindingIssue('unresolved-token', `Token "${ref.token}" did not resolve in source "${ref.sourceId}".`, {
|
|
35
|
+
sourceId: ref.sourceId,
|
|
36
|
+
token: ref.token,
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return { ok: true, value: result.value };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve a binding reference against a payload store, suitable for the renderer to inject
|
|
44
|
+
* (EC-024). The optional `itemContext` supplies the current `{ item, index }` for bindings used
|
|
45
|
+
* inside a repeater.
|
|
46
|
+
*
|
|
47
|
+
* Mode behaviour:
|
|
48
|
+
* - `value` resolve the token to a single value
|
|
49
|
+
* - `object` resolve the token to an object value (same resolution as `value`; the mode
|
|
50
|
+
* records authoring intent that the result is an object)
|
|
51
|
+
* - `spread` resolve the token to an object and expose it as props to spread; a non-object
|
|
52
|
+
* result is an `invalid-spread` issue
|
|
53
|
+
* - `repeaterItem` resolve the token relative to `itemContext.item`; missing context is a
|
|
54
|
+
* `missing-item` issue
|
|
55
|
+
* - `condition` resolve the token to a value and coerce to a boolean gate (truthiness). Use
|
|
56
|
+
* {@link resolveCondition} for full operator support.
|
|
57
|
+
*/
|
|
58
|
+
export function resolveBinding(ref, ctx, itemContext) {
|
|
59
|
+
if (ref.mode === 'repeaterItem') {
|
|
60
|
+
if (!itemContext) {
|
|
61
|
+
return {
|
|
62
|
+
kind: 'issue',
|
|
63
|
+
issue: bindingIssue('missing-item', `Binding "${ref.token}" requires a repeater item context.`, {
|
|
64
|
+
sourceId: ref.sourceId,
|
|
65
|
+
token: ref.token,
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const resolved = resolveAgainst(itemContext.item, ref);
|
|
70
|
+
return resolved.ok ? { kind: 'value', value: resolved.value } : { kind: 'issue', issue: resolved.issue };
|
|
71
|
+
}
|
|
72
|
+
const found = lookupPayload(ref, ctx);
|
|
73
|
+
if (!found.ok)
|
|
74
|
+
return { kind: 'issue', issue: found.issue };
|
|
75
|
+
const resolved = resolveAgainst(found.payload, ref);
|
|
76
|
+
if (!resolved.ok)
|
|
77
|
+
return { kind: 'issue', issue: resolved.issue };
|
|
78
|
+
switch (ref.mode) {
|
|
79
|
+
case 'value':
|
|
80
|
+
case 'object':
|
|
81
|
+
return { kind: 'value', value: resolved.value };
|
|
82
|
+
case 'spread': {
|
|
83
|
+
if (!isPlainObject(resolved.value)) {
|
|
84
|
+
return {
|
|
85
|
+
kind: 'issue',
|
|
86
|
+
issue: bindingIssue('invalid-spread', `Spread binding "${ref.token}" did not resolve to an object.`, {
|
|
87
|
+
sourceId: ref.sourceId,
|
|
88
|
+
token: ref.token,
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return { kind: 'props', props: { ...resolved.value } };
|
|
93
|
+
}
|
|
94
|
+
case 'condition':
|
|
95
|
+
return { kind: 'condition', pass: isTruthy(resolved.value) };
|
|
96
|
+
default: {
|
|
97
|
+
// Exhaustiveness guard: every BindingMode is handled above.
|
|
98
|
+
const never = ref.mode;
|
|
99
|
+
return never;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** JS-style truthiness for a JSON value (empty string, 0, false, null are falsy). */
|
|
104
|
+
function isTruthy(value) {
|
|
105
|
+
return Boolean(value);
|
|
106
|
+
}
|
|
107
|
+
export function resolveCondition(condition, ctx, itemContext) {
|
|
108
|
+
const ref = condition.source;
|
|
109
|
+
// Resolve the base value the token is read from (repeater item or source payload).
|
|
110
|
+
let base;
|
|
111
|
+
if (ref.mode === 'repeaterItem') {
|
|
112
|
+
if (!itemContext) {
|
|
113
|
+
return {
|
|
114
|
+
kind: 'issue',
|
|
115
|
+
issue: bindingIssue('missing-item', `Condition "${ref.token}" requires a repeater item context.`, {
|
|
116
|
+
sourceId: ref.sourceId,
|
|
117
|
+
token: ref.token,
|
|
118
|
+
}),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
base = itemContext.item;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const found = lookupPayload(ref, ctx);
|
|
125
|
+
if (!found.ok) {
|
|
126
|
+
// Unknown/unloaded source. For `exists`, that is a legitimate `false`, not an issue.
|
|
127
|
+
if (condition.operator === 'exists')
|
|
128
|
+
return { kind: 'condition', pass: false };
|
|
129
|
+
return { kind: 'issue', issue: found.issue };
|
|
130
|
+
}
|
|
131
|
+
base = found.payload;
|
|
132
|
+
}
|
|
133
|
+
const probe = resolveToken(base, ref.token);
|
|
134
|
+
if (condition.operator === 'exists') {
|
|
135
|
+
return { kind: 'condition', pass: probe.found };
|
|
136
|
+
}
|
|
137
|
+
if (!probe.found) {
|
|
138
|
+
return {
|
|
139
|
+
kind: 'issue',
|
|
140
|
+
issue: bindingIssue('unresolved-token', `Condition token "${ref.token}" did not resolve in source "${ref.sourceId}".`, {
|
|
141
|
+
sourceId: ref.sourceId,
|
|
142
|
+
token: ref.token,
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return { kind: 'condition', pass: compare(probe.value, condition.operator, condition.value) };
|
|
147
|
+
}
|
|
148
|
+
function compare(left, operator, right) {
|
|
149
|
+
switch (operator) {
|
|
150
|
+
case 'truthy':
|
|
151
|
+
return isTruthy(left);
|
|
152
|
+
case 'exists':
|
|
153
|
+
// Handled by resolveCondition (token presence); reaching here means the token resolved.
|
|
154
|
+
return true;
|
|
155
|
+
case 'eq':
|
|
156
|
+
return deepEqual(left, right ?? null);
|
|
157
|
+
case 'neq':
|
|
158
|
+
return !deepEqual(left, right ?? null);
|
|
159
|
+
case 'gt':
|
|
160
|
+
case 'gte':
|
|
161
|
+
case 'lt':
|
|
162
|
+
case 'lte': {
|
|
163
|
+
if (typeof left !== 'number' || typeof right !== 'number')
|
|
164
|
+
return false;
|
|
165
|
+
if (operator === 'gt')
|
|
166
|
+
return left > right;
|
|
167
|
+
if (operator === 'gte')
|
|
168
|
+
return left >= right;
|
|
169
|
+
if (operator === 'lt')
|
|
170
|
+
return left < right;
|
|
171
|
+
return left <= right;
|
|
172
|
+
}
|
|
173
|
+
default: {
|
|
174
|
+
const never = operator;
|
|
175
|
+
return never;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function deepEqual(a, b) {
|
|
180
|
+
if (a === b)
|
|
181
|
+
return true;
|
|
182
|
+
if (typeof a !== typeof b)
|
|
183
|
+
return false;
|
|
184
|
+
if (a === null || b === null)
|
|
185
|
+
return a === b;
|
|
186
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
187
|
+
if (a.length !== b.length)
|
|
188
|
+
return false;
|
|
189
|
+
return a.every((item, i) => deepEqual(item, b[i]));
|
|
190
|
+
}
|
|
191
|
+
if (typeof a === 'object' && typeof b === 'object' && !Array.isArray(a) && !Array.isArray(b)) {
|
|
192
|
+
const ak = Object.keys(a);
|
|
193
|
+
const bk = Object.keys(b);
|
|
194
|
+
if (ak.length !== bk.length)
|
|
195
|
+
return false;
|
|
196
|
+
return ak.every((k) => Object.prototype.hasOwnProperty.call(b, k) && deepEqual(a[k], b[k]));
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
/** True if a resolution is a broken binding (a structured issue). Convenience for the renderer. */
|
|
201
|
+
export function isBindingIssue(resolution) {
|
|
202
|
+
return resolution.kind === 'issue';
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/data-binding/resolve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MA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AAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAc,EAAE,CAAC,CAAC,CAAC,CAAc,CAAC,CAAC,CAAA;IACvH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,cAAc,CAC5B,UAAmD;IAEnD,OAAO,UAAU,CAAC,IAAI,KAAK,OAAO,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { JsonValue } from '@elytracms/core/project-graph';
|
|
2
|
+
import type { DataSource } from './sources';
|
|
3
|
+
import type { InferredSchema } from './tokens';
|
|
4
|
+
/** A source guaranteed to carry a captured sample + inferred schema. */
|
|
5
|
+
export type SampledSource<S extends DataSource = DataSource> = S & {
|
|
6
|
+
sample: JsonValue;
|
|
7
|
+
schema: InferredSchema;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sample capture (EC-023). Attach a representative payload to a source and infer its schema in
|
|
11
|
+
* one step. This is deliberately pure: actually performing the REST fetch / CMS query / Convex
|
|
12
|
+
* call lives behind the project-owned adapters; this package only models the captured result so
|
|
13
|
+
* inference, tokens, and resolution are deterministic and testable from fixtures.
|
|
14
|
+
*/
|
|
15
|
+
export declare function captureSample<S extends DataSource>(source: S, sample: JsonValue): SampledSource<S>;
|
|
16
|
+
/**
|
|
17
|
+
* The stable path tokens a source exposes, derived from its captured sample (EC-023). Returns
|
|
18
|
+
* an empty list when no sample has been captured yet. Tokens are JSON Pointers that survive UI
|
|
19
|
+
* label changes — see {@link tokensForSchema}.
|
|
20
|
+
*/
|
|
21
|
+
export declare function sourceTokens(source: DataSource): string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { inferSchema, tokensForSchema } from './tokens';
|
|
2
|
+
/**
|
|
3
|
+
* Sample capture (EC-023). Attach a representative payload to a source and infer its schema in
|
|
4
|
+
* one step. This is deliberately pure: actually performing the REST fetch / CMS query / Convex
|
|
5
|
+
* call lives behind the project-owned adapters; this package only models the captured result so
|
|
6
|
+
* inference, tokens, and resolution are deterministic and testable from fixtures.
|
|
7
|
+
*/
|
|
8
|
+
export function captureSample(source, sample) {
|
|
9
|
+
return { ...source, sample, schema: inferSchema(sample) };
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The stable path tokens a source exposes, derived from its captured sample (EC-023). Returns
|
|
13
|
+
* an empty list when no sample has been captured yet. Tokens are JSON Pointers that survive UI
|
|
14
|
+
* label changes — see {@link tokensForSchema}.
|
|
15
|
+
*/
|
|
16
|
+
export function sourceTokens(source) {
|
|
17
|
+
if (source.schema)
|
|
18
|
+
return tokensForSchema(source.schema);
|
|
19
|
+
if (source.sample !== undefined)
|
|
20
|
+
return tokensForSchema(inferSchema(source.sample));
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../src/data-binding/sample.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAQvD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAuB,MAAS,EAAE,MAAiB;IAC9E,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAA;AAC3D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC7C,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACxD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IACnF,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Data sources (EC-022). One uniform shape across the three kinds the product supports
|
|
4
|
+
* (brief §4.6, §7.5):
|
|
5
|
+
*
|
|
6
|
+
* - `rest` an HTTP fetch source (external API)
|
|
7
|
+
* - `cms` an internal CMS collection query (resolved by `@elytracms/core/cms-core`)
|
|
8
|
+
* - `convex` a Convex query or mutation, behind the project-owned repository adapter
|
|
9
|
+
*
|
|
10
|
+
* Every source shares the same envelope: a stable `id` (the binding `sourceId` addresses it),
|
|
11
|
+
* a human label, the kind-specific `config`, and an optional captured `sample` + inferred
|
|
12
|
+
* `schema` (EC-023). The kind-specific config differs, but resolution, sampling, inference and
|
|
13
|
+
* tokenization treat all three identically.
|
|
14
|
+
*/
|
|
15
|
+
/** HTTP methods permitted for a REST fetch source. */
|
|
16
|
+
export declare const httpMethodSchema: z.ZodEnum<{
|
|
17
|
+
GET: "GET";
|
|
18
|
+
POST: "POST";
|
|
19
|
+
PUT: "PUT";
|
|
20
|
+
PATCH: "PATCH";
|
|
21
|
+
DELETE: "DELETE";
|
|
22
|
+
}>;
|
|
23
|
+
export type HttpMethod = z.infer<typeof httpMethodSchema>;
|
|
24
|
+
/** Per-source fetch configuration for a REST source. */
|
|
25
|
+
export declare const restConfigSchema: z.ZodObject<{
|
|
26
|
+
url: z.ZodString;
|
|
27
|
+
method: z.ZodDefault<z.ZodEnum<{
|
|
28
|
+
GET: "GET";
|
|
29
|
+
POST: "POST";
|
|
30
|
+
PUT: "PUT";
|
|
31
|
+
PATCH: "PATCH";
|
|
32
|
+
DELETE: "DELETE";
|
|
33
|
+
}>>;
|
|
34
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
|
+
body: z.ZodOptional<z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type RestConfig = z.infer<typeof restConfigSchema>;
|
|
39
|
+
export declare const restSourceSchema: z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"rest">;
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
label: z.ZodString;
|
|
43
|
+
config: z.ZodObject<{
|
|
44
|
+
url: z.ZodString;
|
|
45
|
+
method: z.ZodDefault<z.ZodEnum<{
|
|
46
|
+
GET: "GET";
|
|
47
|
+
POST: "POST";
|
|
48
|
+
PUT: "PUT";
|
|
49
|
+
PATCH: "PATCH";
|
|
50
|
+
DELETE: "DELETE";
|
|
51
|
+
}>>;
|
|
52
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
53
|
+
query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
54
|
+
body: z.ZodOptional<z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/**
|
|
58
|
+
* Single-field sort of a CMS list query (EC-166 repeating sections). Matches
|
|
59
|
+
* the canonical AD-3 sort shape (`@elytracms/core/content`'s `SortInput` with the
|
|
60
|
+
* direction explicit); ties always break by document id ascending downstream.
|
|
61
|
+
*/
|
|
62
|
+
export declare const cmsSortSchema: z.ZodObject<{
|
|
63
|
+
field: z.ZodString;
|
|
64
|
+
direction: z.ZodEnum<{
|
|
65
|
+
asc: "asc";
|
|
66
|
+
desc: "desc";
|
|
67
|
+
}>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type CmsSort = z.infer<typeof cmsSortSchema>;
|
|
70
|
+
/** Per-source query configuration for an internal CMS collection query. */
|
|
71
|
+
export declare const cmsConfigSchema: z.ZodObject<{
|
|
72
|
+
collectionId: z.ZodString;
|
|
73
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
74
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
75
|
+
filter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
76
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
field: z.ZodString;
|
|
78
|
+
direction: z.ZodEnum<{
|
|
79
|
+
asc: "asc";
|
|
80
|
+
desc: "desc";
|
|
81
|
+
}>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export type CmsConfig = z.infer<typeof cmsConfigSchema>;
|
|
86
|
+
export declare const cmsSourceSchema: z.ZodObject<{
|
|
87
|
+
kind: z.ZodLiteral<"cms">;
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
label: z.ZodString;
|
|
90
|
+
config: z.ZodObject<{
|
|
91
|
+
collectionId: z.ZodString;
|
|
92
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
94
|
+
filter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
95
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
field: z.ZodString;
|
|
97
|
+
direction: z.ZodEnum<{
|
|
98
|
+
asc: "asc";
|
|
99
|
+
desc: "desc";
|
|
100
|
+
}>;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/** Whether a Convex source reads (query) or writes (mutation). */
|
|
106
|
+
export declare const convexOperationSchema: z.ZodEnum<{
|
|
107
|
+
query: "query";
|
|
108
|
+
mutation: "mutation";
|
|
109
|
+
}>;
|
|
110
|
+
export type ConvexOperation = z.infer<typeof convexOperationSchema>;
|
|
111
|
+
/** Per-source query/mutation configuration for a Convex function reference. */
|
|
112
|
+
export declare const convexConfigSchema: z.ZodObject<{
|
|
113
|
+
operation: z.ZodDefault<z.ZodEnum<{
|
|
114
|
+
query: "query";
|
|
115
|
+
mutation: "mutation";
|
|
116
|
+
}>>;
|
|
117
|
+
functionRef: z.ZodString;
|
|
118
|
+
args: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type ConvexConfig = z.infer<typeof convexConfigSchema>;
|
|
121
|
+
export declare const convexSourceSchema: z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"convex">;
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
label: z.ZodString;
|
|
125
|
+
config: z.ZodObject<{
|
|
126
|
+
operation: z.ZodDefault<z.ZodEnum<{
|
|
127
|
+
query: "query";
|
|
128
|
+
mutation: "mutation";
|
|
129
|
+
}>>;
|
|
130
|
+
functionRef: z.ZodString;
|
|
131
|
+
args: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
/**
|
|
135
|
+
* The captured sample (EC-023) and inferred schema are attached uniformly to any source kind.
|
|
136
|
+
* Kept separate from the kind-specific union so the discriminated union stays clean and the
|
|
137
|
+
* sample fields can be merged on after parse.
|
|
138
|
+
*/
|
|
139
|
+
export declare const sampleEnvelopeSchema: z.ZodObject<{
|
|
140
|
+
sample: z.ZodOptional<z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>;
|
|
141
|
+
schema: z.ZodOptional<z.ZodType<import("./tokens").InferredSchema, unknown, z.core.$ZodTypeInternals<import("./tokens").InferredSchema, unknown>>>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
/** The uniform source shape: kind-specific envelope plus the shared sample/schema fields. */
|
|
144
|
+
export declare const dataSourceSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
145
|
+
kind: z.ZodLiteral<"rest">;
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
label: z.ZodString;
|
|
148
|
+
config: z.ZodObject<{
|
|
149
|
+
url: z.ZodString;
|
|
150
|
+
method: z.ZodDefault<z.ZodEnum<{
|
|
151
|
+
GET: "GET";
|
|
152
|
+
POST: "POST";
|
|
153
|
+
PUT: "PUT";
|
|
154
|
+
PATCH: "PATCH";
|
|
155
|
+
DELETE: "DELETE";
|
|
156
|
+
}>>;
|
|
157
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
158
|
+
query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
159
|
+
body: z.ZodOptional<z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
162
|
+
kind: z.ZodLiteral<"cms">;
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
label: z.ZodString;
|
|
165
|
+
config: z.ZodObject<{
|
|
166
|
+
collectionId: z.ZodString;
|
|
167
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
169
|
+
filter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
170
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
field: z.ZodString;
|
|
172
|
+
direction: z.ZodEnum<{
|
|
173
|
+
asc: "asc";
|
|
174
|
+
desc: "desc";
|
|
175
|
+
}>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
kind: z.ZodLiteral<"convex">;
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
label: z.ZodString;
|
|
183
|
+
config: z.ZodObject<{
|
|
184
|
+
operation: z.ZodDefault<z.ZodEnum<{
|
|
185
|
+
query: "query";
|
|
186
|
+
mutation: "mutation";
|
|
187
|
+
}>>;
|
|
188
|
+
functionRef: z.ZodString;
|
|
189
|
+
args: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
}, z.core.$strip>], "kind">, z.ZodObject<{
|
|
192
|
+
sample: z.ZodOptional<z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>;
|
|
193
|
+
schema: z.ZodOptional<z.ZodType<import("./tokens").InferredSchema, unknown, z.core.$ZodTypeInternals<import("./tokens").InferredSchema, unknown>>>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
export type DataSource = z.infer<typeof dataSourceSchema>;
|
|
196
|
+
export type DataSourceKind = DataSource['kind'];
|
|
197
|
+
export type RestSource = z.infer<typeof restSourceSchema> & z.infer<typeof sampleEnvelopeSchema>;
|
|
198
|
+
export type CmsSource = z.infer<typeof cmsSourceSchema> & z.infer<typeof sampleEnvelopeSchema>;
|
|
199
|
+
export type ConvexSource = z.infer<typeof convexSourceSchema> & z.infer<typeof sampleEnvelopeSchema>;
|
|
200
|
+
/** Parse an unknown value into a {@link DataSource}, applying per-config defaults. Never throws. */
|
|
201
|
+
export declare function parseDataSource(input: unknown): ReturnType<typeof dataSourceSchema.safeParse>;
|
|
202
|
+
/**
|
|
203
|
+
* A registry of data sources addressable by stable id (EC-022). Construction de-duplicates by
|
|
204
|
+
* id (last write wins) and validates each entry; lookups are O(1). The registry is immutable —
|
|
205
|
+
* `with`/`without` return new registries — so it can be stored in the graph/editor state safely.
|
|
206
|
+
*/
|
|
207
|
+
export declare class SourceRegistry {
|
|
208
|
+
private readonly byId;
|
|
209
|
+
private constructor();
|
|
210
|
+
/** Build a registry from a list of sources. Each is validated via {@link dataSourceSchema}. */
|
|
211
|
+
static from(sources: Iterable<DataSource>): SourceRegistry;
|
|
212
|
+
/** An empty registry. */
|
|
213
|
+
static empty(): SourceRegistry;
|
|
214
|
+
has(id: string): boolean;
|
|
215
|
+
get(id: string): DataSource | undefined;
|
|
216
|
+
list(): DataSource[];
|
|
217
|
+
ids(): string[];
|
|
218
|
+
/** The set of known ids, suitable for `validateProjectGraph`'s `knownSourceIds` option. */
|
|
219
|
+
knownSourceIds(): ReadonlySet<string>;
|
|
220
|
+
/** Return a new registry with `source` added or replacing any existing entry with the same id. */
|
|
221
|
+
with(source: DataSource): SourceRegistry;
|
|
222
|
+
/** Return a new registry without the source `id` (no-op if absent). */
|
|
223
|
+
without(id: string): SourceRegistry;
|
|
224
|
+
get size(): number;
|
|
225
|
+
}
|