@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,261 @@
|
|
|
1
|
+
import { cmsIssue, readAssetId, validateLocale } from '@elytracms/core/cms-core';
|
|
2
|
+
import { resolveAssetValue } from './assets';
|
|
3
|
+
import { resolveLocaleValues } from './locale';
|
|
4
|
+
import { selectPerspective } from './perspective';
|
|
5
|
+
import { isPopulatedRelation, parseRelationRef, relationStub } from './populate';
|
|
6
|
+
function invalidValueIssue(field, collection, documentId, path, expected) {
|
|
7
|
+
return cmsIssue({
|
|
8
|
+
code: 'invalid-field-value',
|
|
9
|
+
message: `Field "${field.name}" on "${collection.id}" holds a value that is not ${expected}.`,
|
|
10
|
+
path,
|
|
11
|
+
collectionId: collection.id,
|
|
12
|
+
documentId,
|
|
13
|
+
meta: { field: field.name, expected },
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a single relation target. At depth 0 with population enabled this
|
|
18
|
+
* returns the depth-1 populated reference (`{ id, collection, ...fields }`);
|
|
19
|
+
* otherwise the `{ id, collection }` stub. A missing or perspective-invisible
|
|
20
|
+
* target degrades to the stub plus an `unknown-relation-target` issue — the
|
|
21
|
+
* value is never a bare id string and resolution never throws.
|
|
22
|
+
*/
|
|
23
|
+
function resolveRelationTarget(context, lookup, ref, populate, path, ownerCollectionId, ownerDocumentId, acc) {
|
|
24
|
+
if (!populate)
|
|
25
|
+
return { ...relationStub(ref) };
|
|
26
|
+
const missing = (reason) => {
|
|
27
|
+
acc.issues.push(cmsIssue({
|
|
28
|
+
code: 'unknown-relation-target',
|
|
29
|
+
message: `Relation target "${ref.collection}:${ref.id}" could not be populated (${reason}).`,
|
|
30
|
+
path,
|
|
31
|
+
collectionId: ownerCollectionId,
|
|
32
|
+
documentId: ownerDocumentId,
|
|
33
|
+
meta: { targetCollection: ref.collection, targetId: ref.id, reason },
|
|
34
|
+
}));
|
|
35
|
+
return { ...relationStub(ref) };
|
|
36
|
+
};
|
|
37
|
+
const targetCollection = lookup.collection(ref.collection);
|
|
38
|
+
if (!targetCollection)
|
|
39
|
+
return missing('unknown collection');
|
|
40
|
+
const source = lookup.document(ref);
|
|
41
|
+
if (!source)
|
|
42
|
+
return missing('document not found');
|
|
43
|
+
const visible = selectPerspective(context, source);
|
|
44
|
+
if (!visible)
|
|
45
|
+
return missing(`not visible in ${context.perspective} perspective`);
|
|
46
|
+
// Depth-1 populated reference: id + resolved fields. Relations inside it
|
|
47
|
+
// stay stubs (depth > 0); assets inside it still resolve to objects.
|
|
48
|
+
const fields = resolveFields(context, lookup, targetCollection, visible, 1, path, acc);
|
|
49
|
+
return { id: ref.id, collection: ref.collection, ...fields };
|
|
50
|
+
}
|
|
51
|
+
function resolveRelationField(context, lookup, collection, doc, field, value, depth, path, acc) {
|
|
52
|
+
const populate = depth === 0 && isPopulatedRelation(field);
|
|
53
|
+
if (field.cardinality === 'many') {
|
|
54
|
+
if (!Array.isArray(value)) {
|
|
55
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, path, 'an array of references'));
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const out = [];
|
|
59
|
+
value.forEach((entry, index) => {
|
|
60
|
+
const ref = parseRelationRef(entry);
|
|
61
|
+
if (!ref) {
|
|
62
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, [...path, index], 'a { collection, id } reference'));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
out.push(resolveRelationTarget(context, lookup, ref, populate, [...path, index], collection.id, doc.id, acc));
|
|
66
|
+
});
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
const ref = parseRelationRef(value);
|
|
70
|
+
if (!ref) {
|
|
71
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, path, 'a { collection, id } reference'));
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
return resolveRelationTarget(context, lookup, ref, populate, path, collection.id, doc.id, acc);
|
|
75
|
+
}
|
|
76
|
+
function resolveAssetField(lookup, collection, doc, field, value, path, acc) {
|
|
77
|
+
const resolveOne = (rawAsset, entryPath) => {
|
|
78
|
+
// EC-277: asset values are self-typed (`{ type:'asset', id }`); `readAssetId`
|
|
79
|
+
// unwraps that and legacy bare id strings (lazy-on-read).
|
|
80
|
+
const assetId = readAssetId(rawAsset);
|
|
81
|
+
if (assetId === undefined) {
|
|
82
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, entryPath, 'an asset id'));
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
const resolution = resolveAssetValue(lookup, assetId, {
|
|
86
|
+
path: entryPath,
|
|
87
|
+
collectionId: collection.id,
|
|
88
|
+
documentId: doc.id,
|
|
89
|
+
});
|
|
90
|
+
acc.issues.push(...resolution.issues);
|
|
91
|
+
return resolution.asset;
|
|
92
|
+
};
|
|
93
|
+
if (field.cardinality === 'many') {
|
|
94
|
+
if (!Array.isArray(value)) {
|
|
95
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, path, 'an array of asset ids'));
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
// Unresolvable entries are dropped from the array (each already reported
|
|
99
|
+
// as an issue) so consumers never iterate over null holes.
|
|
100
|
+
return value
|
|
101
|
+
.map((entry, index) => resolveOne(entry, [...path, index]))
|
|
102
|
+
.filter((asset) => asset !== null);
|
|
103
|
+
}
|
|
104
|
+
return resolveOne(value, path);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Resolve an `object` / repeater field value (EC-253) by resolving each item's
|
|
108
|
+
* subfields at the same population depth, so a nested relation/asset subfield is
|
|
109
|
+
* populated exactly as a top-level field would be (depth-1 populated at the top,
|
|
110
|
+
* stubs inside a populated ref). `many` is an array of objects; `one` a single
|
|
111
|
+
* object. Malformed items are reported and dropped — resolution never throws.
|
|
112
|
+
*/
|
|
113
|
+
function resolveObjectField(context, lookup, collection, doc, field, value, depth, path, acc) {
|
|
114
|
+
const resolveItem = (item, itemPath) => {
|
|
115
|
+
if (typeof item !== 'object' || item === null || Array.isArray(item)) {
|
|
116
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, itemPath, 'an object'));
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const record = item;
|
|
120
|
+
const out = {};
|
|
121
|
+
for (const sub of field.fields) {
|
|
122
|
+
const subValue = record[sub.name];
|
|
123
|
+
if (subValue === undefined)
|
|
124
|
+
continue;
|
|
125
|
+
const resolved = resolveFieldValue(context, lookup, collection, doc, sub, subValue, depth, [...itemPath, sub.name], acc);
|
|
126
|
+
if (resolved !== undefined)
|
|
127
|
+
out[sub.name] = resolved;
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
};
|
|
131
|
+
if (field.cardinality === 'many') {
|
|
132
|
+
if (!Array.isArray(value)) {
|
|
133
|
+
acc.issues.push(invalidValueIssue(field, collection, doc.id, path, 'an array of objects'));
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
return value
|
|
137
|
+
.map((item, index) => resolveItem(item, [...path, index]))
|
|
138
|
+
.filter((item) => item !== null);
|
|
139
|
+
}
|
|
140
|
+
return resolveItem(value, path) ?? undefined;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Resolve one field value at a population depth — the switch shared by the
|
|
144
|
+
* document loop and the {@link resolveObjectField} recursion (EC-253). Relation
|
|
145
|
+
* population (depth-1 only) and asset resolution stay identical at every level.
|
|
146
|
+
*/
|
|
147
|
+
function resolveFieldValue(context, lookup, collection, doc, field, value, depth, path, acc) {
|
|
148
|
+
switch (field.type) {
|
|
149
|
+
case 'relation':
|
|
150
|
+
return resolveRelationField(context, lookup, collection, doc, field, value, depth, path, acc);
|
|
151
|
+
case 'asset':
|
|
152
|
+
return resolveAssetField(lookup, collection, doc, field, value, path, acc);
|
|
153
|
+
case 'object':
|
|
154
|
+
return resolveObjectField(context, lookup, collection, doc, field, value, depth, path, acc);
|
|
155
|
+
default:
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Resolve all field values of one stored row at a given population depth:
|
|
161
|
+
* locale fallback first (EC-018), then relation population (depth-1 only),
|
|
162
|
+
* then asset resolution. Shared by the top-level document (depth 0) and by
|
|
163
|
+
* populated relation targets (depth 1, where relations stay stubs).
|
|
164
|
+
*/
|
|
165
|
+
function resolveFields(context, lookup, collection, doc, depth, basePath, acc) {
|
|
166
|
+
const localeResolution = resolveLocaleValues(context, collection, doc, basePath);
|
|
167
|
+
acc.fallbacks.push(...localeResolution.fallbacks);
|
|
168
|
+
const out = {};
|
|
169
|
+
for (const field of collection.fields) {
|
|
170
|
+
const value = localeResolution.values[field.name];
|
|
171
|
+
if (value === undefined)
|
|
172
|
+
continue;
|
|
173
|
+
const resolved = resolveFieldValue(context, lookup, collection, doc, field, value, depth, [...basePath, field.name], acc);
|
|
174
|
+
if (resolved !== undefined)
|
|
175
|
+
out[field.name] = resolved;
|
|
176
|
+
}
|
|
177
|
+
return out;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Resolve one document source into delivery shape (vision AD-4): locale
|
|
181
|
+
* fallback applied (EC-018), draft/published perspective applied (EC-021),
|
|
182
|
+
* relations populated to depth-1 as declared in schema, and assets resolved to
|
|
183
|
+
* `{ url, width, height, alt, mimeType }` objects. Pure and total: invalid
|
|
184
|
+
* states surface as structured issues alongside the result — never thrown.
|
|
185
|
+
*/
|
|
186
|
+
export function resolveDocument(context, lookup, source) {
|
|
187
|
+
const acc = {
|
|
188
|
+
fallbacks: [],
|
|
189
|
+
issues: [...validateLocale(context.locales, context.locale)],
|
|
190
|
+
};
|
|
191
|
+
const info = () => ({
|
|
192
|
+
locale: context.locale,
|
|
193
|
+
perspective: context.perspective,
|
|
194
|
+
localeFallbacks: acc.fallbacks,
|
|
195
|
+
});
|
|
196
|
+
const doc = selectPerspective(context, source);
|
|
197
|
+
if (!doc)
|
|
198
|
+
return { document: null, info: info(), issues: acc.issues };
|
|
199
|
+
const collection = lookup.collection(doc.collection);
|
|
200
|
+
if (!collection) {
|
|
201
|
+
acc.issues.push(cmsIssue({
|
|
202
|
+
code: 'unknown-collection',
|
|
203
|
+
message: `Document "${doc.id}" belongs to unknown collection "${doc.collection}".`,
|
|
204
|
+
path: ['collection'],
|
|
205
|
+
collectionId: doc.collection,
|
|
206
|
+
documentId: doc.id,
|
|
207
|
+
}));
|
|
208
|
+
return { document: null, info: info(), issues: acc.issues };
|
|
209
|
+
}
|
|
210
|
+
const fields = resolveFields(context, lookup, collection, doc, 0, [], acc);
|
|
211
|
+
return {
|
|
212
|
+
document: { id: doc.id, collection: doc.collection, ...fields },
|
|
213
|
+
info: info(),
|
|
214
|
+
issues: acc.issues,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Populate a single relation reference to depth-1 delivery shape — the public
|
|
219
|
+
* entry a renderer host wires as `RenderContext.resolveRelation` to populate a
|
|
220
|
+
* COMPOSITION-NODE relation PROP (EC-254). This is distinct from a document
|
|
221
|
+
* FIELD relation, which {@link resolveDocument} already populates inline via the
|
|
222
|
+
* internal `resolveRelationTarget`: a page's `blocks` field passes through as raw
|
|
223
|
+
* composition, so the relation props of the nodes inside it (e.g. a ProductGrid's
|
|
224
|
+
* picked `product`s) are never touched by document resolution and need this.
|
|
225
|
+
*
|
|
226
|
+
* Mirrors `resolveRelationTarget`'s populated branch exactly — perspective gated
|
|
227
|
+
* (EC-021), relations inside the target stay stubs (depth-1), assets inside it
|
|
228
|
+
* resolve to objects — but returns `null` (not the `{ id, collection }` stub) on
|
|
229
|
+
* a miss, the cleaner "populated or nothing" contract a prop wants. Pure and
|
|
230
|
+
* total: never throws; the reason for a miss is collected as a structured issue.
|
|
231
|
+
*/
|
|
232
|
+
export function populateRelationRef(context, lookup, ref) {
|
|
233
|
+
const acc = { fallbacks: [], issues: [] };
|
|
234
|
+
const miss = (reason) => {
|
|
235
|
+
acc.issues.push(cmsIssue({
|
|
236
|
+
code: 'unknown-relation-target',
|
|
237
|
+
message: `Relation target "${ref.collection}:${ref.id}" could not be populated (${reason}).`,
|
|
238
|
+
path: [ref.collection, ref.id],
|
|
239
|
+
collectionId: ref.collection,
|
|
240
|
+
documentId: ref.id,
|
|
241
|
+
meta: { targetCollection: ref.collection, targetId: ref.id, reason },
|
|
242
|
+
}));
|
|
243
|
+
return { document: null, issues: acc.issues };
|
|
244
|
+
};
|
|
245
|
+
const targetCollection = lookup.collection(ref.collection);
|
|
246
|
+
if (!targetCollection)
|
|
247
|
+
return miss('unknown collection');
|
|
248
|
+
const source = lookup.document(ref);
|
|
249
|
+
if (!source)
|
|
250
|
+
return miss('document not found');
|
|
251
|
+
const visible = selectPerspective(context, source);
|
|
252
|
+
if (!visible)
|
|
253
|
+
return miss(`not visible in ${context.perspective} perspective`);
|
|
254
|
+
// Depth-1: the target's own relations stay stubs, its assets resolve to objects.
|
|
255
|
+
const fields = resolveFields(context, lookup, targetCollection, visible, 1, [], acc);
|
|
256
|
+
return {
|
|
257
|
+
document: { id: ref.id, collection: ref.collection, ...fields },
|
|
258
|
+
issues: acc.issues,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/content/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAWhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAmEhF,SAAS,iBAAiB,CACxB,KAAe,EACf,UAAyB,EACzB,UAAkB,EAClB,IAAa,EACb,QAAgB;IAEhB,OAAO,QAAQ,CAAC;QACd,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,UAAU,KAAK,CAAC,IAAI,SAAS,UAAU,CAAC,EAAE,+BAA+B,QAAQ,GAAG;QAC7F,IAAI;QACJ,YAAY,EAAE,UAAU,CAAC,EAAE;QAC3B,UAAU;QACV,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE;KACtC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH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E,MAAM,EAAE;SACrE,CAAC,CACH,CAAA;QACD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAA;IAC/C,CAAC,CAAA;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC1D,IAAI,CAAC,gBAAgB;QAAE,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAA;IAExD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAA;IAE9C,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAClD,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC,kBAAkB,OAAO,CAAC,WAAW,cAAc,CAAC,CAAA;IAE9E,iFAAiF;IACjF,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IACpF,OAAO;QACL,QAAQ,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,MAAM,EAAE;QAC/D,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ListDocumentsQuery } from './query';
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic query serialization (EC-143): a byte-stable string for
|
|
4
|
+
* `{ where, sort, limit, cursor }`, exported for cache-key use (EC-146 keys
|
|
5
|
+
* cached list fetches on it). Two semantically identical queries — regardless
|
|
6
|
+
* of object-key insertion order or the `eq` shorthand — serialize to the
|
|
7
|
+
* exact same bytes.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* JSON.stringify with object keys sorted recursively at every level. Arrays
|
|
11
|
+
* keep their order (order is meaningful for `in` lists). `undefined` entries
|
|
12
|
+
* are omitted, like JSON.stringify.
|
|
13
|
+
*/
|
|
14
|
+
export declare function stableStringify(value: unknown): string;
|
|
15
|
+
/**
|
|
16
|
+
* The canonical serialization of a `listDocuments` query. Normal form:
|
|
17
|
+
*
|
|
18
|
+
* `{"cursor":<string|null>,"limit":<number|null>,"sort":{"direction":...,"field":...}|null,"where":{<field>:{<op>:<value>}}}`
|
|
19
|
+
*
|
|
20
|
+
* - `where` fields sorted by name; bare-scalar shorthand expanded to `eq`;
|
|
21
|
+
* operators in alphabetical order (`eq,gt,gte,in,lt,lte`).
|
|
22
|
+
* - `sort.direction` defaults to `"asc"` explicitly so its presence never
|
|
23
|
+
* changes the key.
|
|
24
|
+
* - Absent `cursor`/`limit`/`sort` serialize as `null` (fixed shape, fixed
|
|
25
|
+
* key order — byte-stable).
|
|
26
|
+
*
|
|
27
|
+
* Compose with collection / locale / perspective externally when building a
|
|
28
|
+
* full cache key (EC-146).
|
|
29
|
+
*/
|
|
30
|
+
export declare function serializeListQuery(query: ListDocumentsQuery): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { normalizeWhere } from './query';
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic query serialization (EC-143): a byte-stable string for
|
|
4
|
+
* `{ where, sort, limit, cursor }`, exported for cache-key use (EC-146 keys
|
|
5
|
+
* cached list fetches on it). Two semantically identical queries — regardless
|
|
6
|
+
* of object-key insertion order or the `eq` shorthand — serialize to the
|
|
7
|
+
* exact same bytes.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* JSON.stringify with object keys sorted recursively at every level. Arrays
|
|
11
|
+
* keep their order (order is meaningful for `in` lists). `undefined` entries
|
|
12
|
+
* are omitted, like JSON.stringify.
|
|
13
|
+
*/
|
|
14
|
+
export function stableStringify(value) {
|
|
15
|
+
if (value === null || typeof value !== 'object')
|
|
16
|
+
return JSON.stringify(value) ?? 'null';
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
return `[${value.map((entry) => stableStringify(entry === undefined ? null : entry)).join(',')}]`;
|
|
19
|
+
}
|
|
20
|
+
const record = value;
|
|
21
|
+
const parts = [];
|
|
22
|
+
for (const key of Object.keys(record).sort()) {
|
|
23
|
+
const entry = record[key];
|
|
24
|
+
if (entry === undefined)
|
|
25
|
+
continue;
|
|
26
|
+
parts.push(`${JSON.stringify(key)}:${stableStringify(entry)}`);
|
|
27
|
+
}
|
|
28
|
+
return `{${parts.join(',')}}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The canonical serialization of a `listDocuments` query. Normal form:
|
|
32
|
+
*
|
|
33
|
+
* `{"cursor":<string|null>,"limit":<number|null>,"sort":{"direction":...,"field":...}|null,"where":{<field>:{<op>:<value>}}}`
|
|
34
|
+
*
|
|
35
|
+
* - `where` fields sorted by name; bare-scalar shorthand expanded to `eq`;
|
|
36
|
+
* operators in alphabetical order (`eq,gt,gte,in,lt,lte`).
|
|
37
|
+
* - `sort.direction` defaults to `"asc"` explicitly so its presence never
|
|
38
|
+
* changes the key.
|
|
39
|
+
* - Absent `cursor`/`limit`/`sort` serialize as `null` (fixed shape, fixed
|
|
40
|
+
* key order — byte-stable).
|
|
41
|
+
*
|
|
42
|
+
* Compose with collection / locale / perspective externally when building a
|
|
43
|
+
* full cache key (EC-146).
|
|
44
|
+
*/
|
|
45
|
+
export function serializeListQuery(query) {
|
|
46
|
+
const where = {};
|
|
47
|
+
for (const entry of normalizeWhere(query.where ?? {})) {
|
|
48
|
+
where[entry.field] = entry.condition;
|
|
49
|
+
}
|
|
50
|
+
return stableStringify({
|
|
51
|
+
cursor: query.cursor ?? null,
|
|
52
|
+
limit: query.limit ?? null,
|
|
53
|
+
sort: query.sort ? { direction: query.sort.direction ?? 'asc', field: query.sort.field } : null,
|
|
54
|
+
where,
|
|
55
|
+
});
|
|
56
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AAwC,EAAE,CAAA;IACrD,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;QACtD,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;IACtC,CAAC;IACD,OAAO,eAAe,CAAC;QACrB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;QAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI;QAC/F,KAAK;KACN,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CollectionDef, Locale } from '@elytracms/core/cms-core';
|
|
2
|
+
import type { ResolvedDocument } from './resolve';
|
|
3
|
+
/**
|
|
4
|
+
* Cache-tag metadata carried by every accessor result (EC-143, vision AD-5):
|
|
5
|
+
* fetch-time tagging of what was *actually returned*, so EC-146 can map each
|
|
6
|
+
* entry to a `revalidateTag` call. Deterministic by construction — every list
|
|
7
|
+
* is sorted and deduplicated.
|
|
8
|
+
*/
|
|
9
|
+
export interface CacheTags {
|
|
10
|
+
/**
|
|
11
|
+
* Identities of every document whose content is present in the result —
|
|
12
|
+
* the returned documents themselves plus their depth-1 populated relation
|
|
13
|
+
* targets. Entries are `documentKey` strings (`collection:id`), sorted.
|
|
14
|
+
*/
|
|
15
|
+
docs: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Collections the accessor read from (the coarse membership tags of AD-5:
|
|
18
|
+
* create/delete/publish in a collection sweeps them). Sorted.
|
|
19
|
+
*/
|
|
20
|
+
collections: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Normalized URL paths the accessor touched (`resolvePage` only): the
|
|
23
|
+
* requested path, plus every hop of a redirect chain — editing any hop
|
|
24
|
+
* changes the result. Sorted.
|
|
25
|
+
*/
|
|
26
|
+
routes: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Asset ids the result *baked* its delivery shape from (EC-227): the page's
|
|
29
|
+
* page-scoped `ResolvedAsset` set (url/dimensions/alt) + its `seoOgImage`.
|
|
30
|
+
* Editing the asset record (alt/dimensions/re-upload) must drop the page that
|
|
31
|
+
* baked it — without this dimension the only invalidation triggers are
|
|
32
|
+
* unrelated (doc/collection/project), so an asset-only edit serves stale
|
|
33
|
+
* until one of those fires. Sorted.
|
|
34
|
+
*/
|
|
35
|
+
assets: string[];
|
|
36
|
+
/** The locale the result was resolved for. */
|
|
37
|
+
locale: Locale;
|
|
38
|
+
}
|
|
39
|
+
export interface CacheTagsInit {
|
|
40
|
+
docs?: readonly string[];
|
|
41
|
+
collections?: readonly string[];
|
|
42
|
+
routes?: readonly string[];
|
|
43
|
+
assets?: readonly string[];
|
|
44
|
+
locale: Locale;
|
|
45
|
+
}
|
|
46
|
+
/** Build a `CacheTags` with deterministic (sorted, deduplicated) entries. */
|
|
47
|
+
export declare function cacheTags(init: CacheTagsInit): CacheTags;
|
|
48
|
+
/**
|
|
49
|
+
* The document tags one resolved document contributes: its own identity plus
|
|
50
|
+
* every relation target referenced in its top-level relation fields. Populated
|
|
51
|
+
* targets had their content returned (so a change to them must invalidate);
|
|
52
|
+
* stubs are included too — slightly coarse, always correct (AD-5 stance).
|
|
53
|
+
*/
|
|
54
|
+
export declare function documentCacheKeys(collection: CollectionDef, document: ResolvedDocument): string[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { documentKey } from '@elytracms/core/cms-core';
|
|
2
|
+
function sortedUnique(values) {
|
|
3
|
+
return [...new Set(values)].sort();
|
|
4
|
+
}
|
|
5
|
+
/** Build a `CacheTags` with deterministic (sorted, deduplicated) entries. */
|
|
6
|
+
export function cacheTags(init) {
|
|
7
|
+
return {
|
|
8
|
+
docs: sortedUnique(init.docs ?? []),
|
|
9
|
+
collections: sortedUnique(init.collections ?? []),
|
|
10
|
+
routes: sortedUnique(init.routes ?? []),
|
|
11
|
+
assets: sortedUnique(init.assets ?? []),
|
|
12
|
+
locale: init.locale,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The document tags one resolved document contributes: its own identity plus
|
|
17
|
+
* every relation target referenced in its top-level relation fields. Populated
|
|
18
|
+
* targets had their content returned (so a change to them must invalidate);
|
|
19
|
+
* stubs are included too — slightly coarse, always correct (AD-5 stance).
|
|
20
|
+
*/
|
|
21
|
+
export function documentCacheKeys(collection, document) {
|
|
22
|
+
const keys = [documentKey({ collection: document.collection, id: document.id })];
|
|
23
|
+
for (const field of collection.fields) {
|
|
24
|
+
if (field.type !== 'relation')
|
|
25
|
+
continue;
|
|
26
|
+
const value = document[field.name];
|
|
27
|
+
const entries = Array.isArray(value) ? value : [value];
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
if (entry !== null &&
|
|
30
|
+
typeof entry === 'object' &&
|
|
31
|
+
typeof entry.id === 'string' &&
|
|
32
|
+
typeof entry.collection === 'string') {
|
|
33
|
+
const ref = entry;
|
|
34
|
+
keys.push(documentKey({ collection: ref.collection, id: ref.id }));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return keys;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/content/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAiDtD,SAAS,YAAY,CAAC,MAAyB;IAC7C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;AACpC,CAAC;AAED,6EAA6E;AAC7E,MAAM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AG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;YACpE,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { JsonValue } from '@elytracms/core/project-graph';
|
|
2
|
+
import type { CmsSource, ConvexSource, DataSource, RestSource } from './sources';
|
|
3
|
+
import { SourceRegistry } from './sources';
|
|
4
|
+
/**
|
|
5
|
+
* Shared fixtures for the data-binding tests. One representative source per kind (EC-022) plus
|
|
6
|
+
* a captured sample (EC-023) so resolution (EC-024) is exercised end-to-end and deterministically.
|
|
7
|
+
*/
|
|
8
|
+
/** A representative list payload: an array of post objects, mirroring the project-graph fixtures. */
|
|
9
|
+
export declare const samplePostsPayload: JsonValue;
|
|
10
|
+
/** A representative single-document payload. */
|
|
11
|
+
export declare const sampleHeroPayload: JsonValue;
|
|
12
|
+
export declare const restSource: RestSource;
|
|
13
|
+
export declare const cmsSource: CmsSource;
|
|
14
|
+
export declare const convexSource: ConvexSource;
|
|
15
|
+
/** All three sample sources as one uniform list. */
|
|
16
|
+
export declare const sampleSources: DataSource[];
|
|
17
|
+
/** A registry over all three sample sources. */
|
|
18
|
+
export declare const sampleRegistry: SourceRegistry;
|
|
19
|
+
/** A payload store keyed by source id, as the renderer would build it. */
|
|
20
|
+
export declare const samplePayloadStore: Record<string, JsonValue>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { captureSample } from './sample';
|
|
2
|
+
import { SourceRegistry } from './sources';
|
|
3
|
+
/**
|
|
4
|
+
* Shared fixtures for the data-binding tests. One representative source per kind (EC-022) plus
|
|
5
|
+
* a captured sample (EC-023) so resolution (EC-024) is exercised end-to-end and deterministically.
|
|
6
|
+
*/
|
|
7
|
+
/** A representative list payload: an array of post objects, mirroring the project-graph fixtures. */
|
|
8
|
+
export const samplePostsPayload = [
|
|
9
|
+
{ id: 'p1', title: 'First Post', author: { name: 'Ada' }, tags: ['a', 'b'], featured: true, views: 10 },
|
|
10
|
+
{ id: 'p2', title: 'Second Post', author: { name: 'Lin' }, tags: [], featured: false, views: 3 },
|
|
11
|
+
];
|
|
12
|
+
/** A representative single-document payload. */
|
|
13
|
+
export const sampleHeroPayload = {
|
|
14
|
+
heading: 'Welcome',
|
|
15
|
+
subheading: 'A code-first website builder.',
|
|
16
|
+
cta: { label: 'Get started', href: '/start' },
|
|
17
|
+
published: true,
|
|
18
|
+
};
|
|
19
|
+
export const restSource = captureSample({
|
|
20
|
+
kind: 'rest',
|
|
21
|
+
id: 'rest.products',
|
|
22
|
+
label: 'Products API',
|
|
23
|
+
config: { url: 'https://api.example.com/products', method: 'GET', headers: {}, query: {} },
|
|
24
|
+
}, samplePostsPayload);
|
|
25
|
+
export const cmsSource = captureSample({
|
|
26
|
+
kind: 'cms',
|
|
27
|
+
id: 'cms.posts',
|
|
28
|
+
label: 'Blog Posts',
|
|
29
|
+
config: { collectionId: 'collection.posts', filter: {} },
|
|
30
|
+
}, samplePostsPayload);
|
|
31
|
+
export const convexSource = captureSample({
|
|
32
|
+
kind: 'convex',
|
|
33
|
+
id: 'convex.hero',
|
|
34
|
+
label: 'Hero document',
|
|
35
|
+
config: { operation: 'query', functionRef: 'hero:get', args: {} },
|
|
36
|
+
}, sampleHeroPayload);
|
|
37
|
+
/** All three sample sources as one uniform list. */
|
|
38
|
+
export const sampleSources = [restSource, cmsSource, convexSource];
|
|
39
|
+
/** A registry over all three sample sources. */
|
|
40
|
+
export const sampleRegistry = SourceRegistry.from(sampleSources);
|
|
41
|
+
/** A payload store keyed by source id, as the renderer would build it. */
|
|
42
|
+
export const samplePayloadStore = {
|
|
43
|
+
'rest.products': samplePostsPayload,
|
|
44
|
+
'cms.posts': samplePostsPayload,
|
|
45
|
+
'convex.hero': sampleHeroPayload,
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","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,YAAY,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,EAAE;CACzD,EACD,kBAAkB,CACnB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAiB,aAAa,CACrD;IACE,IAAI,EAAE,QAAQ;IACd,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE;CAClE,EACD,iBAAiB,CAClB,CAAA;AAED,oDAAoD;AACpD,MAAM,CAAC,MAAM,aAAa,GAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAA;AAEhF,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAmB,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AAEhF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,kBAAkB,GAA8B;IAC3D,eAAe,EAAE,kBAAkB;IACnC,WAAW,EAAE,kBAAkB;IAC/B,aAAa,EAAE,iBAAiB;CACjC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elytracms/data-binding — the uniform binding model shared by REST, CMS, and Convex sources
|
|
3
|
+
* (brief §4.6, §7.5). Reuses `@elytracms/core/project-graph`'s BindingReference / BindingMode /
|
|
4
|
+
* Condition; adds source definitions + registry (EC-022), sample capture, schema inference and
|
|
5
|
+
* stable path tokens (EC-023), and binding-mode resolution with structured broken-binding
|
|
6
|
+
* issues (EC-024).
|
|
7
|
+
*/
|
|
8
|
+
export declare const PACKAGE = "@elytracms/core/data-binding";
|
|
9
|
+
export * from './issues';
|
|
10
|
+
export * from './tokens';
|
|
11
|
+
export * from './sources';
|
|
12
|
+
export * from './sample';
|
|
13
|
+
export * from './resolve';
|
|
14
|
+
export * from './fixtures';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elytracms/data-binding — the uniform binding model shared by REST, CMS, and Convex sources
|
|
3
|
+
* (brief §4.6, §7.5). Reuses `@elytracms/core/project-graph`'s BindingReference / BindingMode /
|
|
4
|
+
* Condition; adds source definitions + registry (EC-022), sample capture, schema inference and
|
|
5
|
+
* stable path tokens (EC-023), and binding-mode resolution with structured broken-binding
|
|
6
|
+
* issues (EC-024).
|
|
7
|
+
*/
|
|
8
|
+
export const PACKAGE = '@elytracms/core/data-binding';
|
|
9
|
+
export * from './issues';
|
|
10
|
+
export * from './tokens';
|
|
11
|
+
export * from './sources';
|
|
12
|
+
export * from './sample';
|
|
13
|
+
export * from './resolve';
|
|
14
|
+
export * from './fixtures';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAA;AAErD,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Stable codes for structured binding issues. Broken bindings are represented as data —
|
|
4
|
+
* never thrown — so the renderer can show a fallback and the inspector can surface the
|
|
5
|
+
* problem (brief §4.6, §7.5; AGENTS.md "validation is first-class").
|
|
6
|
+
*
|
|
7
|
+
* - `unknown-source` the binding's `sourceId` is not in the source registry
|
|
8
|
+
* - `unresolved-token` the token does not resolve to a value in the payload
|
|
9
|
+
* - `missing-item` a `repeaterItem` binding was resolved with no item context
|
|
10
|
+
* - `invalid-spread` a `spread` binding resolved to a non-object (cannot spread)
|
|
11
|
+
* - `no-sample` an operation needed a captured sample but none was present
|
|
12
|
+
*/
|
|
13
|
+
export declare const bindingIssueCodeSchema: z.ZodEnum<{
|
|
14
|
+
"unknown-source": "unknown-source";
|
|
15
|
+
"unresolved-token": "unresolved-token";
|
|
16
|
+
"missing-item": "missing-item";
|
|
17
|
+
"invalid-spread": "invalid-spread";
|
|
18
|
+
"no-sample": "no-sample";
|
|
19
|
+
}>;
|
|
20
|
+
export type BindingIssueCode = z.infer<typeof bindingIssueCodeSchema>;
|
|
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 declare const bindingIssueSchema: z.ZodObject<{
|
|
27
|
+
code: z.ZodEnum<{
|
|
28
|
+
"unknown-source": "unknown-source";
|
|
29
|
+
"unresolved-token": "unresolved-token";
|
|
30
|
+
"missing-item": "missing-item";
|
|
31
|
+
"invalid-spread": "invalid-spread";
|
|
32
|
+
"no-sample": "no-sample";
|
|
33
|
+
}>;
|
|
34
|
+
message: z.ZodString;
|
|
35
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
token: z.ZodOptional<z.ZodString>;
|
|
37
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("@elytracms/core/project-graph").JsonValue, unknown, z.core.$ZodTypeInternals<import("@elytracms/core/project-graph").JsonValue, unknown>>>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type BindingIssue = z.infer<typeof bindingIssueSchema>;
|
|
40
|
+
/** Construct a {@link BindingIssue} with optional locator/meta fields omitted when absent. */
|
|
41
|
+
export declare function bindingIssue(code: BindingIssueCode, message: string, fields?: {
|
|
42
|
+
sourceId?: string;
|
|
43
|
+
token?: string;
|
|
44
|
+
meta?: BindingIssue['meta'];
|
|
45
|
+
}): BindingIssue;
|