@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,49 @@
|
|
|
1
|
+
import type { MembersRepository } from '@elytracms/core/persistence';
|
|
2
|
+
import type { AuthorizationHook } from './core';
|
|
3
|
+
/**
|
|
4
|
+
* Role-based authorization for the operations chokepoint (EC-150, vision AD-7).
|
|
5
|
+
*
|
|
6
|
+
* One hook, no UI-scattered checks: every command and query passes through
|
|
7
|
+
* `createRoleAuthorization` before it may touch the persistence adapter.
|
|
8
|
+
* Project scope is derived from the operation input — every project-scoped
|
|
9
|
+
* input schema in this layer carries a `projectId` field — and checked against
|
|
10
|
+
* the actor's membership for *that* project.
|
|
11
|
+
*
|
|
12
|
+
* Role rules (per project):
|
|
13
|
+
*
|
|
14
|
+
* | Operation | viewer | editor | admin |
|
|
15
|
+
* | ------------------------------------------------ | ------ | ------ | ----- |
|
|
16
|
+
* | queries (`*.get`, `*.list`, …) | ✓ | ✓ | ✓ |
|
|
17
|
+
* | content commands (documents/graph/assets/schema/ | | | |
|
|
18
|
+
* | publishing/registry/references) | ✗ | ✓ | ✓ |
|
|
19
|
+
* | members.set / members.remove | ✗ | ✗ | ✓ |
|
|
20
|
+
* | tokens.issue / tokens.revoke / tokens.list | ✗ | ✗ | ✓ |
|
|
21
|
+
*
|
|
22
|
+
* Operations *without* a `projectId` get these documented rules:
|
|
23
|
+
* - Deployment-admin operations (CLI tokens — EC-182) carry no per-project scope
|
|
24
|
+
* in single-tenant deployments; they are checked against the actor's
|
|
25
|
+
* deployment membership (their role on this one-project deployment).
|
|
26
|
+
* - Other queries without a project scope are allowed for any authenticated
|
|
27
|
+
* principal.
|
|
28
|
+
* - Any other command without a `projectId` is denied (defensive default).
|
|
29
|
+
*
|
|
30
|
+
* Global flags on `Principal.roles`:
|
|
31
|
+
* - `system` bypasses all checks (seeding, internal tooling — never a browser
|
|
32
|
+
* session).
|
|
33
|
+
*
|
|
34
|
+
* No actor at all means every operation is denied — unauthenticated sessions
|
|
35
|
+
* never reach an operation surface (the studio's route guard redirects them),
|
|
36
|
+
* and non-studio consumers (CLI, AI changesets) must supply a principal.
|
|
37
|
+
*/
|
|
38
|
+
/** Principal flag that bypasses all role checks (internal tooling only). */
|
|
39
|
+
export declare const GLOBAL_SYSTEM_FLAG = "system";
|
|
40
|
+
/** Project lifecycle + administration commands an `editor` may NOT run. */
|
|
41
|
+
export declare const ADMIN_ONLY_OPERATIONS: ReadonlySet<string>;
|
|
42
|
+
/** Extract the project scope from a validated operation input, if present. */
|
|
43
|
+
export declare function projectIdFromInput(input: unknown): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Build the role-checking {@link AuthorizationHook} over a members repository.
|
|
46
|
+
* Decisions are structured denials — the pipeline maps them onto the
|
|
47
|
+
* `unauthorized` {@link OperationError}, which surfaces (EC-141) render verbatim.
|
|
48
|
+
*/
|
|
49
|
+
export declare function createRoleAuthorization(members: MembersRepository): AuthorizationHook;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { roleAtLeast } from '@elytracms/core/persistence';
|
|
2
|
+
/**
|
|
3
|
+
* Role-based authorization for the operations chokepoint (EC-150, vision AD-7).
|
|
4
|
+
*
|
|
5
|
+
* One hook, no UI-scattered checks: every command and query passes through
|
|
6
|
+
* `createRoleAuthorization` before it may touch the persistence adapter.
|
|
7
|
+
* Project scope is derived from the operation input — every project-scoped
|
|
8
|
+
* input schema in this layer carries a `projectId` field — and checked against
|
|
9
|
+
* the actor's membership for *that* project.
|
|
10
|
+
*
|
|
11
|
+
* Role rules (per project):
|
|
12
|
+
*
|
|
13
|
+
* | Operation | viewer | editor | admin |
|
|
14
|
+
* | ------------------------------------------------ | ------ | ------ | ----- |
|
|
15
|
+
* | queries (`*.get`, `*.list`, …) | ✓ | ✓ | ✓ |
|
|
16
|
+
* | content commands (documents/graph/assets/schema/ | | | |
|
|
17
|
+
* | publishing/registry/references) | ✗ | ✓ | ✓ |
|
|
18
|
+
* | members.set / members.remove | ✗ | ✗ | ✓ |
|
|
19
|
+
* | tokens.issue / tokens.revoke / tokens.list | ✗ | ✗ | ✓ |
|
|
20
|
+
*
|
|
21
|
+
* Operations *without* a `projectId` get these documented rules:
|
|
22
|
+
* - Deployment-admin operations (CLI tokens — EC-182) carry no per-project scope
|
|
23
|
+
* in single-tenant deployments; they are checked against the actor's
|
|
24
|
+
* deployment membership (their role on this one-project deployment).
|
|
25
|
+
* - Other queries without a project scope are allowed for any authenticated
|
|
26
|
+
* principal.
|
|
27
|
+
* - Any other command without a `projectId` is denied (defensive default).
|
|
28
|
+
*
|
|
29
|
+
* Global flags on `Principal.roles`:
|
|
30
|
+
* - `system` bypasses all checks (seeding, internal tooling — never a browser
|
|
31
|
+
* session).
|
|
32
|
+
*
|
|
33
|
+
* No actor at all means every operation is denied — unauthenticated sessions
|
|
34
|
+
* never reach an operation surface (the studio's route guard redirects them),
|
|
35
|
+
* and non-studio consumers (CLI, AI changesets) must supply a principal.
|
|
36
|
+
*/
|
|
37
|
+
/** Principal flag that bypasses all role checks (internal tooling only). */
|
|
38
|
+
export const GLOBAL_SYSTEM_FLAG = 'system';
|
|
39
|
+
/** Project lifecycle + administration commands an `editor` may NOT run. */
|
|
40
|
+
export const ADMIN_ONLY_OPERATIONS = new Set([
|
|
41
|
+
'members.set',
|
|
42
|
+
'members.remove',
|
|
43
|
+
'tokens.issue',
|
|
44
|
+
'tokens.revoke',
|
|
45
|
+
// Token *listing* is admin-only too: hashes are never returned, but token
|
|
46
|
+
// metadata is an administration concern, not a content concern.
|
|
47
|
+
'tokens.list',
|
|
48
|
+
]);
|
|
49
|
+
/**
|
|
50
|
+
* Deployment-scoped administration ops (EC-182): single-tenant means a CLI token
|
|
51
|
+
* needs no per-project scope, so these operations carry no `projectId`. They are
|
|
52
|
+
* authorized against the actor's membership on this one-project deployment.
|
|
53
|
+
*/
|
|
54
|
+
const DEPLOYMENT_ADMIN_OPERATIONS = new Set([
|
|
55
|
+
'tokens.issue',
|
|
56
|
+
'tokens.revoke',
|
|
57
|
+
'tokens.list',
|
|
58
|
+
]);
|
|
59
|
+
/** Extract the project scope from a validated operation input, if present. */
|
|
60
|
+
export function projectIdFromInput(input) {
|
|
61
|
+
if (typeof input !== 'object' || input === null)
|
|
62
|
+
return undefined;
|
|
63
|
+
const value = input.projectId;
|
|
64
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
65
|
+
}
|
|
66
|
+
function deny(reason) {
|
|
67
|
+
return { allow: false, reason };
|
|
68
|
+
}
|
|
69
|
+
/** The strongest of the actor's roles (single-tenant: typically just one). */
|
|
70
|
+
function highestRole(roles) {
|
|
71
|
+
let best;
|
|
72
|
+
for (const role of roles) {
|
|
73
|
+
if (!best || roleAtLeast(role, best))
|
|
74
|
+
best = role;
|
|
75
|
+
}
|
|
76
|
+
return best;
|
|
77
|
+
}
|
|
78
|
+
const ALLOW = { allow: true };
|
|
79
|
+
/**
|
|
80
|
+
* Build the role-checking {@link AuthorizationHook} over a members repository.
|
|
81
|
+
* Decisions are structured denials — the pipeline maps them onto the
|
|
82
|
+
* `unauthorized` {@link OperationError}, which surfaces (EC-141) render verbatim.
|
|
83
|
+
*/
|
|
84
|
+
export function createRoleAuthorization(members) {
|
|
85
|
+
return async (context) => {
|
|
86
|
+
const actor = context.actor;
|
|
87
|
+
if (!actor) {
|
|
88
|
+
return deny(`Operation “${context.operation}” requires an authenticated user.`);
|
|
89
|
+
}
|
|
90
|
+
const flags = actor.roles ?? [];
|
|
91
|
+
if (flags.includes(GLOBAL_SYSTEM_FLAG))
|
|
92
|
+
return ALLOW;
|
|
93
|
+
const projectId = projectIdFromInput(context.input);
|
|
94
|
+
if (!projectId) {
|
|
95
|
+
// Deployment-admin ops (CLI tokens) are scopeless in single-tenant; check
|
|
96
|
+
// the actor's deployment membership rather than a per-project one.
|
|
97
|
+
if (DEPLOYMENT_ADMIN_OPERATIONS.has(context.operation)) {
|
|
98
|
+
const memberships = await members.listMembershipsForUser(actor.id);
|
|
99
|
+
const role = highestRole(memberships.map((m) => m.role));
|
|
100
|
+
if (!role) {
|
|
101
|
+
return deny(`You are not a member of this deployment.`);
|
|
102
|
+
}
|
|
103
|
+
return decideForRole(role, context);
|
|
104
|
+
}
|
|
105
|
+
if (context.kind === 'query')
|
|
106
|
+
return ALLOW;
|
|
107
|
+
return deny(`Command “${context.operation}” carries no project scope and was denied.`);
|
|
108
|
+
}
|
|
109
|
+
const membership = await members.findMember(projectId, actor.id);
|
|
110
|
+
if (!membership) {
|
|
111
|
+
return deny(`You are not a member of project “${projectId}”.`);
|
|
112
|
+
}
|
|
113
|
+
return decideForRole(membership.role, context);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function decideForRole(role, context) {
|
|
117
|
+
if (ADMIN_ONLY_OPERATIONS.has(context.operation)) {
|
|
118
|
+
return roleAtLeast(role, 'admin')
|
|
119
|
+
? ALLOW
|
|
120
|
+
: deny(`Operation “${context.operation}” requires the “admin” role (you are “${role}”).`);
|
|
121
|
+
}
|
|
122
|
+
if (context.kind === 'query')
|
|
123
|
+
return ALLOW;
|
|
124
|
+
return roleAtLeast(role, 'editor')
|
|
125
|
+
? ALLOW
|
|
126
|
+
: deny(`Viewers cannot run commands — “${context.operation}” requires the “editor” role.`);
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src/operations/authorization.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { PersistenceAdapter } from '@elytracms/core/persistence';
|
|
2
|
+
import { OperationEventBus } from './core';
|
|
3
|
+
import type { AnyOperationDefinition, AuthorizationHook, OperationResult, Principal } from './core';
|
|
4
|
+
/**
|
|
5
|
+
* Changesets (EC-140, vision AD-7): a batch of operation invocations that can be
|
|
6
|
+
* **previewed** (structured diff + validation issues, zero side effects),
|
|
7
|
+
* **applied atomically** (all-or-nothing via compensation), and **reverted**
|
|
8
|
+
* (inverse operations recorded at apply time). "Review before apply" and undo
|
|
9
|
+
* are the same primitive, shared by the UI, AI proposals, and automation.
|
|
10
|
+
*
|
|
11
|
+
* ## Preview design (dry run with zero mutation)
|
|
12
|
+
*
|
|
13
|
+
* Preview executes the changeset's steps — through the real operation pipeline —
|
|
14
|
+
* against a **scratch `InMemoryPersistenceAdapter` seeded from read-only reads**
|
|
15
|
+
* of the live adapter (only the entities the steps touch: graph, CMS schema +
|
|
16
|
+
* documents, manifest records). This was chosen over
|
|
17
|
+
* re-implementing per-operation domain checks because:
|
|
18
|
+
*
|
|
19
|
+
* - the diff you preview is computed by the exact code that will apply,
|
|
20
|
+
* - later steps see earlier steps' effects (a step may create the collection a
|
|
21
|
+
* following step inserts a document into), and
|
|
22
|
+
* - the live adapter is never handed a single write.
|
|
23
|
+
*
|
|
24
|
+
* ## Atomic apply (compensation)
|
|
25
|
+
*
|
|
26
|
+
* The persistence boundary has no transactions, so apply records **inverse
|
|
27
|
+
* invocations** as it goes: before each step it snapshots the touched entity,
|
|
28
|
+
* executes the step through the real pipeline (validate → authorize → mutate →
|
|
29
|
+
* event), and derives the operations that would undo it. If a step fails, the
|
|
30
|
+
* already-applied steps are rolled back in reverse order and a structured error
|
|
31
|
+
* is returned — state after a failed apply equals state before. On success the
|
|
32
|
+
* accumulated inverse list (already in reverse order) is kept on the changeset;
|
|
33
|
+
* `revert` executes it. Rollback and revert run with a pass-through
|
|
34
|
+
* authorization hook: compensation restores state the actor was already
|
|
35
|
+
* authorized to change.
|
|
36
|
+
*
|
|
37
|
+
* Known inverse approximations (surfaced as warnings at preview time):
|
|
38
|
+
* - graph revisions are append-only — reverting a graph step saves the prior
|
|
39
|
+
* graph as a *new* revision; a changeset that created the very first revision
|
|
40
|
+
* cannot be reverted (its inverse is empty).
|
|
41
|
+
* - reverting a schema step for a project that had no schema record restores an
|
|
42
|
+
* *empty* schema record rather than "no record".
|
|
43
|
+
*/
|
|
44
|
+
export type ChangesetState = 'draft' | 'previewed' | 'applied' | 'reverted';
|
|
45
|
+
export type ChangesetSeverity = 'error' | 'warning';
|
|
46
|
+
/**
|
|
47
|
+
* A validation issue attached to a changeset. The shared issue model: AI
|
|
48
|
+
* proposal issues (EC-095) are these. Any `error`-severity issue blocks apply.
|
|
49
|
+
*/
|
|
50
|
+
export interface ChangesetIssue {
|
|
51
|
+
readonly severity: ChangesetSeverity;
|
|
52
|
+
readonly message: string;
|
|
53
|
+
readonly code?: string;
|
|
54
|
+
/** 0-based index of the step the issue belongs to; absent for changeset-level issues. */
|
|
55
|
+
readonly step?: number;
|
|
56
|
+
}
|
|
57
|
+
/** A single operation invocation inside a changeset (EC-139 dotted name + raw input). */
|
|
58
|
+
export interface ChangesetInvocation {
|
|
59
|
+
readonly operation: string;
|
|
60
|
+
readonly input: unknown;
|
|
61
|
+
}
|
|
62
|
+
export type ChangeKind = 'create' | 'update' | 'delete';
|
|
63
|
+
/** One entity touched by one step: identity plus before/after snapshots. */
|
|
64
|
+
export interface ChangesetDiffEntry {
|
|
65
|
+
/** 0-based index of the step that produces this change. */
|
|
66
|
+
readonly step: number;
|
|
67
|
+
readonly operation: string;
|
|
68
|
+
/** Entity kind, e.g. 'graph' | 'cms-schema' | 'cms-document'. */
|
|
69
|
+
readonly entity: string;
|
|
70
|
+
/** Entity identity, e.g. 'prj-1/post/p1'. */
|
|
71
|
+
readonly key: string;
|
|
72
|
+
readonly change: ChangeKind;
|
|
73
|
+
/** Snapshot before the step (absent on create). JSON-shaped data. */
|
|
74
|
+
readonly before?: unknown;
|
|
75
|
+
/** Snapshot after the step (absent on delete). JSON-shaped data. */
|
|
76
|
+
readonly after?: unknown;
|
|
77
|
+
}
|
|
78
|
+
export interface ChangesetPreview {
|
|
79
|
+
readonly diff: readonly ChangesetDiffEntry[];
|
|
80
|
+
readonly issues: readonly ChangesetIssue[];
|
|
81
|
+
/** True when no `error`-severity issue exists — apply is blocked otherwise. */
|
|
82
|
+
readonly applicable: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** What a caller (AI proposal, studio flow, automation) provides to create a changeset. */
|
|
85
|
+
export interface ChangesetInput {
|
|
86
|
+
readonly title: string;
|
|
87
|
+
readonly summary?: string;
|
|
88
|
+
readonly steps: readonly ChangesetInvocation[];
|
|
89
|
+
/**
|
|
90
|
+
* Authoring-time issues (e.g. AI generation validation), merged into every
|
|
91
|
+
* preview. Error severity blocks apply — preserves the EC-095 contract.
|
|
92
|
+
*/
|
|
93
|
+
readonly issues?: readonly ChangesetIssue[];
|
|
94
|
+
}
|
|
95
|
+
export interface Changeset {
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly title: string;
|
|
98
|
+
readonly summary?: string;
|
|
99
|
+
readonly steps: readonly ChangesetInvocation[];
|
|
100
|
+
/** Authoring-time issues carried from {@link ChangesetInput.issues}. */
|
|
101
|
+
readonly issues: readonly ChangesetIssue[];
|
|
102
|
+
readonly state: ChangesetState;
|
|
103
|
+
/** Result of the most recent preview (also computed internally by apply). */
|
|
104
|
+
readonly preview?: ChangesetPreview;
|
|
105
|
+
/** Inverse invocations recorded at apply time, already in execution (reverse) order. */
|
|
106
|
+
readonly inverse?: readonly ChangesetInvocation[];
|
|
107
|
+
}
|
|
108
|
+
/** Which state the scratch preview adapter must be seeded with. */
|
|
109
|
+
type ScratchSeed = 'graph' | 'cms';
|
|
110
|
+
/**
|
|
111
|
+
* Existential support entry (mirrors `AnyOperationDefinition`): `never`-typed
|
|
112
|
+
* parameters make every concretely-typed entry assignable.
|
|
113
|
+
*/
|
|
114
|
+
export interface ChangesetStepSupport {
|
|
115
|
+
readonly seeds: readonly ScratchSeed[];
|
|
116
|
+
readonly describe: (input: never) => {
|
|
117
|
+
entity: string;
|
|
118
|
+
key: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Read-only snapshot of the touched entity (`undefined` = absent). For steps
|
|
122
|
+
* that create records with generated ids, the post-step snapshot receives the
|
|
123
|
+
* step result.
|
|
124
|
+
*/
|
|
125
|
+
readonly snapshot: (adapter: PersistenceAdapter, input: never, result?: unknown) => Promise<unknown>;
|
|
126
|
+
/** Inverse invocations that undo the step, given the pre-step snapshot + result. */
|
|
127
|
+
readonly invert: (input: never, before: never, result: unknown) => readonly ChangesetInvocation[];
|
|
128
|
+
}
|
|
129
|
+
/** Whether an operation can be carried by a changeset (previewable + invertible). */
|
|
130
|
+
export declare function isChangesetCapable(operation: string): boolean;
|
|
131
|
+
/** Dotted names of every changeset-capable operation (sorted, deterministic). */
|
|
132
|
+
export declare function changesetCapableOperations(): readonly string[];
|
|
133
|
+
export interface CreateChangesetsOptions {
|
|
134
|
+
/** The only mutation path — the same adapter the operations client uses. */
|
|
135
|
+
adapter: PersistenceAdapter;
|
|
136
|
+
/** Share the operations client's bus so changeset + per-operation events interleave. */
|
|
137
|
+
events?: OperationEventBus;
|
|
138
|
+
/** Permission chokepoint for applied steps (pass-through by default, EC-150). */
|
|
139
|
+
authorize?: AuthorizationHook;
|
|
140
|
+
actor?: Principal;
|
|
141
|
+
/** Operation registry; defaults to every built-in definition. */
|
|
142
|
+
definitions?: ReadonlyMap<string, AnyOperationDefinition>;
|
|
143
|
+
}
|
|
144
|
+
export interface ChangesetOperations {
|
|
145
|
+
readonly events: OperationEventBus;
|
|
146
|
+
/** Build a draft changeset from ordered operation invocations. */
|
|
147
|
+
create(input: ChangesetInput): Changeset;
|
|
148
|
+
/** Dry-run: compute diff + issues against current state. Never mutates. */
|
|
149
|
+
preview(changeset: Changeset): Promise<OperationResult<Changeset>>;
|
|
150
|
+
/**
|
|
151
|
+
* Apply all steps atomically. Re-validates against current state first and is
|
|
152
|
+
* rejected while error-severity issues exist; a mid-apply failure rolls every
|
|
153
|
+
* applied step back.
|
|
154
|
+
*/
|
|
155
|
+
apply(changeset: Changeset): Promise<OperationResult<Changeset>>;
|
|
156
|
+
/** Execute the inverse operations recorded at apply time, restoring prior state. */
|
|
157
|
+
revert(changeset: Changeset): Promise<OperationResult<Changeset>>;
|
|
158
|
+
}
|
|
159
|
+
export declare function createChangesets(options: CreateChangesetsOptions): ChangesetOperations;
|
|
160
|
+
export {};
|