@sitecoreai-labs/sitecoreai-cli 0.0.4
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/AGENTS.md +67 -0
- package/LICENSE +21 -0
- package/README.md +357 -0
- package/bin/sitecoreai-cli +3 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +358 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +27 -0
- package/dist/commands/deploy/deployments.d.ts +3 -0
- package/dist/commands/deploy/deployments.d.ts.map +1 -0
- package/dist/commands/deploy/deployments.js +58 -0
- package/dist/commands/deploy/editing-host.d.ts +3 -0
- package/dist/commands/deploy/editing-host.d.ts.map +1 -0
- package/dist/commands/deploy/editing-host.js +49 -0
- package/dist/commands/deploy/environments/deployments.d.ts +3 -0
- package/dist/commands/deploy/environments/deployments.d.ts.map +1 -0
- package/dist/commands/deploy/environments/deployments.js +28 -0
- package/dist/commands/deploy/environments/index.d.ts +3 -0
- package/dist/commands/deploy/environments/index.d.ts.map +1 -0
- package/dist/commands/deploy/environments/index.js +29 -0
- package/dist/commands/deploy/environments/mutations.d.ts +9 -0
- package/dist/commands/deploy/environments/mutations.d.ts.map +1 -0
- package/dist/commands/deploy/environments/mutations.js +103 -0
- package/dist/commands/deploy/environments/queries.d.ts +7 -0
- package/dist/commands/deploy/environments/queries.d.ts.map +1 -0
- package/dist/commands/deploy/environments/queries.js +56 -0
- package/dist/commands/deploy/environments/variables.d.ts +3 -0
- package/dist/commands/deploy/environments/variables.d.ts.map +1 -0
- package/dist/commands/deploy/environments/variables.js +40 -0
- package/dist/commands/deploy/environments.d.ts +2 -0
- package/dist/commands/deploy/environments.d.ts.map +1 -0
- package/dist/commands/deploy/environments.js +17 -0
- package/dist/commands/deploy/index.d.ts +3 -0
- package/dist/commands/deploy/index.d.ts.map +1 -0
- package/dist/commands/deploy/index.js +26 -0
- package/dist/commands/deploy/logs.d.ts +3 -0
- package/dist/commands/deploy/logs.d.ts.map +1 -0
- package/dist/commands/deploy/logs.js +39 -0
- package/dist/commands/deploy/organizations.d.ts +3 -0
- package/dist/commands/deploy/organizations.d.ts.map +1 -0
- package/dist/commands/deploy/organizations.js +29 -0
- package/dist/commands/deploy/projects.d.ts +3 -0
- package/dist/commands/deploy/projects.d.ts.map +1 -0
- package/dist/commands/deploy/projects.js +74 -0
- package/dist/commands/deploy/shared.d.ts +3 -0
- package/dist/commands/deploy/shared.d.ts.map +1 -0
- package/dist/commands/deploy/shared.js +12 -0
- package/dist/commands/deploy/site.d.ts +10 -0
- package/dist/commands/deploy/site.d.ts.map +1 -0
- package/dist/commands/deploy/site.js +36 -0
- package/dist/commands/deploy/source-control.d.ts +3 -0
- package/dist/commands/deploy/source-control.d.ts.map +1 -0
- package/dist/commands/deploy/source-control.js +89 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +5 -0
- package/dist/commands/history.d.ts +3 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +88 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +32 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +21 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +18 -0
- package/dist/commands/recipe/index.d.ts +3 -0
- package/dist/commands/recipe/index.d.ts.map +1 -0
- package/dist/commands/recipe/index.js +158 -0
- package/dist/commands/serialization/index.d.ts +3 -0
- package/dist/commands/serialization/index.d.ts.map +1 -0
- package/dist/commands/serialization/index.js +89 -0
- package/dist/commands/serialization/package.d.ts +3 -0
- package/dist/commands/serialization/package.d.ts.map +1 -0
- package/dist/commands/serialization/package.js +36 -0
- package/dist/commands/shared.d.ts +21 -0
- package/dist/commands/shared.d.ts.map +1 -0
- package/dist/commands/shared.js +82 -0
- package/dist/commands/shell.d.ts +10 -0
- package/dist/commands/shell.d.ts.map +1 -0
- package/dist/commands/shell.js +155 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +15 -0
- package/dist/commands/telemetry.d.ts +3 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +28 -0
- package/dist/config/env-overrides.d.ts +4 -0
- package/dist/config/env-overrides.d.ts.map +1 -0
- package/dist/config/env-overrides.js +199 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +13 -0
- package/dist/config/modules.d.ts +4 -0
- package/dist/config/modules.d.ts.map +1 -0
- package/dist/config/modules.js +152 -0
- package/dist/config/paths.d.ts +2 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +39 -0
- package/dist/config/root-config.d.ts +10 -0
- package/dist/config/root-config.d.ts.map +1 -0
- package/dist/config/root-config.js +159 -0
- package/dist/config/schema.json +278 -0
- package/dist/config/serialization-module.schema.json +127 -0
- package/dist/config/telemetry.schema.json +21 -0
- package/dist/config/types.d.ts +245 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +19 -0
- package/dist/config/validation.d.ts +10 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/config/validation.js +43 -0
- package/dist/deploy/api/common/headers.d.ts +2 -0
- package/dist/deploy/api/common/headers.d.ts.map +1 -0
- package/dist/deploy/api/common/headers.js +10 -0
- package/dist/deploy/api/common/index.d.ts +4 -0
- package/dist/deploy/api/common/index.d.ts.map +1 -0
- package/dist/deploy/api/common/index.js +19 -0
- package/dist/deploy/api/common/request.d.ts +9 -0
- package/dist/deploy/api/common/request.d.ts.map +1 -0
- package/dist/deploy/api/common/request.js +253 -0
- package/dist/deploy/api/common/types.d.ts +44 -0
- package/dist/deploy/api/common/types.d.ts.map +1 -0
- package/dist/deploy/api/common/types.js +5 -0
- package/dist/deploy/api/common.d.ts +2 -0
- package/dist/deploy/api/common.d.ts.map +1 -0
- package/dist/deploy/api/common.js +17 -0
- package/dist/deploy/api/deployment-logs.d.ts +2 -0
- package/dist/deploy/api/deployment-logs.d.ts.map +1 -0
- package/dist/deploy/api/deployment-logs.js +23 -0
- package/dist/deploy/api/deployments.d.ts +9 -0
- package/dist/deploy/api/deployments.d.ts.map +1 -0
- package/dist/deploy/api/deployments.js +61 -0
- package/dist/deploy/api/environments.d.ts +21 -0
- package/dist/deploy/api/environments.d.ts.map +1 -0
- package/dist/deploy/api/environments.js +67 -0
- package/dist/deploy/api/index.d.ts +9 -0
- package/dist/deploy/api/index.d.ts.map +1 -0
- package/dist/deploy/api/index.js +24 -0
- package/dist/deploy/api/logs.d.ts +8 -0
- package/dist/deploy/api/logs.d.ts.map +1 -0
- package/dist/deploy/api/logs.js +29 -0
- package/dist/deploy/api/organizations.d.ts +6 -0
- package/dist/deploy/api/organizations.d.ts.map +1 -0
- package/dist/deploy/api/organizations.js +18 -0
- package/dist/deploy/api/projects.d.ts +13 -0
- package/dist/deploy/api/projects.d.ts.map +1 -0
- package/dist/deploy/api/projects.js +42 -0
- package/dist/deploy/api/source-control.d.ts +15 -0
- package/dist/deploy/api/source-control.d.ts.map +1 -0
- package/dist/deploy/api/source-control.js +71 -0
- package/dist/deploy/api.d.ts +2 -0
- package/dist/deploy/api.d.ts.map +1 -0
- package/dist/deploy/api.js +17 -0
- package/dist/deploy/tasks/deployment-result.d.ts +6 -0
- package/dist/deploy/tasks/deployment-result.d.ts.map +1 -0
- package/dist/deploy/tasks/deployment-result.js +36 -0
- package/dist/deploy/tasks/deployments.d.ts +10 -0
- package/dist/deploy/tasks/deployments.d.ts.map +1 -0
- package/dist/deploy/tasks/deployments.js +201 -0
- package/dist/deploy/tasks/editing-host.d.ts +28 -0
- package/dist/deploy/tasks/editing-host.d.ts.map +1 -0
- package/dist/deploy/tasks/editing-host.js +216 -0
- package/dist/deploy/tasks/environments.d.ts +20 -0
- package/dist/deploy/tasks/environments.d.ts.map +1 -0
- package/dist/deploy/tasks/environments.js +364 -0
- package/dist/deploy/tasks/index.d.ts +10 -0
- package/dist/deploy/tasks/index.d.ts.map +1 -0
- package/dist/deploy/tasks/index.js +25 -0
- package/dist/deploy/tasks/logs.d.ts +5 -0
- package/dist/deploy/tasks/logs.d.ts.map +1 -0
- package/dist/deploy/tasks/logs.js +56 -0
- package/dist/deploy/tasks/organizations.d.ts +6 -0
- package/dist/deploy/tasks/organizations.d.ts.map +1 -0
- package/dist/deploy/tasks/organizations.js +51 -0
- package/dist/deploy/tasks/projects.d.ts +11 -0
- package/dist/deploy/tasks/projects.d.ts.map +1 -0
- package/dist/deploy/tasks/projects.js +246 -0
- package/dist/deploy/tasks/shared.d.ts +63 -0
- package/dist/deploy/tasks/shared.d.ts.map +1 -0
- package/dist/deploy/tasks/shared.js +261 -0
- package/dist/deploy/tasks/site-bind.d.ts +21 -0
- package/dist/deploy/tasks/site-bind.d.ts.map +1 -0
- package/dist/deploy/tasks/site-bind.js +142 -0
- package/dist/deploy/tasks/site.d.ts +14 -0
- package/dist/deploy/tasks/site.d.ts.map +1 -0
- package/dist/deploy/tasks/site.js +29 -0
- package/dist/deploy/tasks/source-control.d.ts +14 -0
- package/dist/deploy/tasks/source-control.d.ts.map +1 -0
- package/dist/deploy/tasks/source-control.js +173 -0
- package/dist/deploy/tasks/types.d.ts +204 -0
- package/dist/deploy/tasks/types.d.ts.map +1 -0
- package/dist/deploy/tasks/types.js +7 -0
- package/dist/deploy/tasks.d.ts +3 -0
- package/dist/deploy/tasks.d.ts.map +1 -0
- package/dist/deploy/tasks.js +18 -0
- package/dist/recipe/api/auth.d.ts +9 -0
- package/dist/recipe/api/auth.d.ts.map +1 -0
- package/dist/recipe/api/auth.js +12 -0
- package/dist/recipe/api/authoring-client.d.ts +37 -0
- package/dist/recipe/api/authoring-client.d.ts.map +1 -0
- package/dist/recipe/api/authoring-client.js +495 -0
- package/dist/recipe/api/client.d.ts +99 -0
- package/dist/recipe/api/client.d.ts.map +1 -0
- package/dist/recipe/api/client.js +17 -0
- package/dist/recipe/api/graphql.d.ts +15 -0
- package/dist/recipe/api/graphql.d.ts.map +1 -0
- package/dist/recipe/api/graphql.js +38 -0
- package/dist/recipe/api/ref-encoding.d.ts +38 -0
- package/dist/recipe/api/ref-encoding.d.ts.map +1 -0
- package/dist/recipe/api/ref-encoding.js +160 -0
- package/dist/recipe/api/site-discovery.d.ts +49 -0
- package/dist/recipe/api/site-discovery.d.ts.map +1 -0
- package/dist/recipe/api/site-discovery.js +127 -0
- package/dist/recipe/api/sites-client.d.ts +48 -0
- package/dist/recipe/api/sites-client.d.ts.map +1 -0
- package/dist/recipe/api/sites-client.js +19 -0
- package/dist/recipe/cache.d.ts +36 -0
- package/dist/recipe/cache.d.ts.map +1 -0
- package/dist/recipe/cache.js +114 -0
- package/dist/recipe/compile/component-section.d.ts +46 -0
- package/dist/recipe/compile/component-section.d.ts.map +1 -0
- package/dist/recipe/compile/component-section.js +143 -0
- package/dist/recipe/compile/component-template.d.ts +34 -0
- package/dist/recipe/compile/component-template.d.ts.map +1 -0
- package/dist/recipe/compile/component-template.js +709 -0
- package/dist/recipe/compile/content-item.d.ts +31 -0
- package/dist/recipe/compile/content-item.d.ts.map +1 -0
- package/dist/recipe/compile/content-item.js +189 -0
- package/dist/recipe/compile/content-template.d.ts +18 -0
- package/dist/recipe/compile/content-template.d.ts.map +1 -0
- package/dist/recipe/compile/content-template.js +52 -0
- package/dist/recipe/compile/enumeration.d.ts +59 -0
- package/dist/recipe/compile/enumeration.d.ts.map +1 -0
- package/dist/recipe/compile/enumeration.js +236 -0
- package/dist/recipe/compile/page-design.d.ts +22 -0
- package/dist/recipe/compile/page-design.d.ts.map +1 -0
- package/dist/recipe/compile/page-design.js +93 -0
- package/dist/recipe/compile/parameters-template.d.ts +14 -0
- package/dist/recipe/compile/parameters-template.d.ts.map +1 -0
- package/dist/recipe/compile/parameters-template.js +92 -0
- package/dist/recipe/compile/partial-design.d.ts +18 -0
- package/dist/recipe/compile/partial-design.d.ts.map +1 -0
- package/dist/recipe/compile/partial-design.js +76 -0
- package/dist/recipe/compile/section-definition.d.ts +18 -0
- package/dist/recipe/compile/section-definition.d.ts.map +1 -0
- package/dist/recipe/compile/section-definition.js +26 -0
- package/dist/recipe/compile/shared.d.ts +442 -0
- package/dist/recipe/compile/shared.d.ts.map +1 -0
- package/dist/recipe/compile/shared.js +843 -0
- package/dist/recipe/compile/site-template.d.ts +52 -0
- package/dist/recipe/compile/site-template.d.ts.map +1 -0
- package/dist/recipe/compile/site-template.js +140 -0
- package/dist/recipe/compile/site.d.ts +44 -0
- package/dist/recipe/compile/site.d.ts.map +1 -0
- package/dist/recipe/compile/site.js +127 -0
- package/dist/recipe/compile.d.ts +93 -0
- package/dist/recipe/compile.d.ts.map +1 -0
- package/dist/recipe/compile.js +741 -0
- package/dist/recipe/execute.d.ts +119 -0
- package/dist/recipe/execute.d.ts.map +1 -0
- package/dist/recipe/execute.js +273 -0
- package/dist/recipe/guids.d.ts +400 -0
- package/dist/recipe/guids.d.ts.map +1 -0
- package/dist/recipe/guids.js +488 -0
- package/dist/recipe/index.d.ts +32 -0
- package/dist/recipe/index.d.ts.map +1 -0
- package/dist/recipe/index.js +156 -0
- package/dist/recipe/io.d.ts +21 -0
- package/dist/recipe/io.d.ts.map +1 -0
- package/dist/recipe/io.js +147 -0
- package/dist/recipe/ir/operations.d.ts +692 -0
- package/dist/recipe/ir/operations.d.ts.map +1 -0
- package/dist/recipe/ir/operations.js +347 -0
- package/dist/recipe/ir/sitecore-templates.d.ts +455 -0
- package/dist/recipe/ir/sitecore-templates.d.ts.map +1 -0
- package/dist/recipe/ir/sitecore-templates.js +465 -0
- package/dist/recipe/layout/emit.d.ts +101 -0
- package/dist/recipe/layout/emit.d.ts.map +1 -0
- package/dist/recipe/layout/emit.js +127 -0
- package/dist/recipe/layout/templates-mapping.d.ts +28 -0
- package/dist/recipe/layout/templates-mapping.d.ts.map +1 -0
- package/dist/recipe/layout/templates-mapping.js +29 -0
- package/dist/recipe/plan.d.ts +134 -0
- package/dist/recipe/plan.d.ts.map +1 -0
- package/dist/recipe/plan.js +565 -0
- package/dist/recipe/policy.d.ts +43 -0
- package/dist/recipe/policy.d.ts.map +1 -0
- package/dist/recipe/policy.js +75 -0
- package/dist/recipe/rollback.d.ts +72 -0
- package/dist/recipe/rollback.d.ts.map +1 -0
- package/dist/recipe/rollback.js +130 -0
- package/dist/recipe/schema/field-types.d.ts +72 -0
- package/dist/recipe/schema/field-types.d.ts.map +1 -0
- package/dist/recipe/schema/field-types.js +118 -0
- package/dist/recipe/schema/recipe.d.ts +1545 -0
- package/dist/recipe/schema/recipe.d.ts.map +1 -0
- package/dist/recipe/schema/recipe.js +1175 -0
- package/dist/recipe/schema/source-fields.d.ts +48 -0
- package/dist/recipe/schema/source-fields.d.ts.map +1 -0
- package/dist/recipe/schema/source-fields.js +79 -0
- package/dist/recipe/tasks/compile.d.ts +14 -0
- package/dist/recipe/tasks/compile.d.ts.map +1 -0
- package/dist/recipe/tasks/compile.js +89 -0
- package/dist/recipe/tasks/diff.d.ts +17 -0
- package/dist/recipe/tasks/diff.d.ts.map +1 -0
- package/dist/recipe/tasks/diff.js +6 -0
- package/dist/recipe/tasks/index.d.ts +9 -0
- package/dist/recipe/tasks/index.d.ts.map +1 -0
- package/dist/recipe/tasks/index.js +13 -0
- package/dist/recipe/tasks/placeholder-allow.d.ts +53 -0
- package/dist/recipe/tasks/placeholder-allow.d.ts.map +1 -0
- package/dist/recipe/tasks/placeholder-allow.js +218 -0
- package/dist/recipe/tasks/plan.d.ts +11 -0
- package/dist/recipe/tasks/plan.d.ts.map +1 -0
- package/dist/recipe/tasks/plan.js +72 -0
- package/dist/recipe/tasks/prune-defaults.d.ts +90 -0
- package/dist/recipe/tasks/prune-defaults.d.ts.map +1 -0
- package/dist/recipe/tasks/prune-defaults.js +184 -0
- package/dist/recipe/tasks/push.d.ts +18 -0
- package/dist/recipe/tasks/push.d.ts.map +1 -0
- package/dist/recipe/tasks/push.js +417 -0
- package/dist/recipe/tasks/shared.d.ts +152 -0
- package/dist/recipe/tasks/shared.d.ts.map +1 -0
- package/dist/recipe/tasks/shared.js +94 -0
- package/dist/recipe/validate.d.ts +103 -0
- package/dist/recipe/validate.d.ts.map +1 -0
- package/dist/recipe/validate.js +297 -0
- package/dist/serialization/commands.d.ts +48 -0
- package/dist/serialization/commands.d.ts.map +1 -0
- package/dist/serialization/commands.js +175 -0
- package/dist/serialization/compare.d.ts +29 -0
- package/dist/serialization/compare.d.ts.map +1 -0
- package/dist/serialization/compare.js +124 -0
- package/dist/serialization/field-filter.d.ts +7 -0
- package/dist/serialization/field-filter.d.ts.map +1 -0
- package/dist/serialization/field-filter.js +20 -0
- package/dist/serialization/filesystem-store/constants.d.ts +3 -0
- package/dist/serialization/filesystem-store/constants.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/constants.js +5 -0
- package/dist/serialization/filesystem-store/index.d.ts +4 -0
- package/dist/serialization/filesystem-store/index.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/index.js +15 -0
- package/dist/serialization/filesystem-store/items.d.ts +10 -0
- package/dist/serialization/filesystem-store/items.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/items.js +64 -0
- package/dist/serialization/filesystem-store/roles.d.ts +6 -0
- package/dist/serialization/filesystem-store/roles.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/roles.js +46 -0
- package/dist/serialization/filesystem-store/users.d.ts +6 -0
- package/dist/serialization/filesystem-store/users.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/users.js +46 -0
- package/dist/serialization/filesystem-store/utils.d.ts +2 -0
- package/dist/serialization/filesystem-store/utils.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/utils.js +17 -0
- package/dist/serialization/filesystem-store.d.ts +2 -0
- package/dist/serialization/filesystem-store.d.ts.map +1 -0
- package/dist/serialization/filesystem-store.js +17 -0
- package/dist/serialization/item-path.d.ts +32 -0
- package/dist/serialization/item-path.d.ts.map +1 -0
- package/dist/serialization/item-path.js +123 -0
- package/dist/serialization/path-provider.d.ts +12 -0
- package/dist/serialization/path-provider.d.ts.map +1 -0
- package/dist/serialization/path-provider.js +271 -0
- package/dist/serialization/signature.d.ts +4 -0
- package/dist/serialization/signature.d.ts.map +1 -0
- package/dist/serialization/signature.js +71 -0
- package/dist/serialization/sitecore-api/auth.d.ts +31 -0
- package/dist/serialization/sitecore-api/auth.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/auth.js +319 -0
- package/dist/serialization/sitecore-api/graphql.d.ts +12 -0
- package/dist/serialization/sitecore-api/graphql.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/graphql.js +20 -0
- package/dist/serialization/sitecore-api/history.d.ts +9 -0
- package/dist/serialization/sitecore-api/history.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/history.js +36 -0
- package/dist/serialization/sitecore-api/index.d.ts +7 -0
- package/dist/serialization/sitecore-api/index.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/index.js +22 -0
- package/dist/serialization/sitecore-api/items.d.ts +8 -0
- package/dist/serialization/sitecore-api/items.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/items.js +132 -0
- package/dist/serialization/sitecore-api/publish.d.ts +14 -0
- package/dist/serialization/sitecore-api/publish.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/publish.js +43 -0
- package/dist/serialization/sitecore-api/roles.d.ts +9 -0
- package/dist/serialization/sitecore-api/roles.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/roles.js +42 -0
- package/dist/serialization/sitecore-api/users.d.ts +9 -0
- package/dist/serialization/sitecore-api/users.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/users.js +62 -0
- package/dist/serialization/sitecore-api.d.ts +2 -0
- package/dist/serialization/sitecore-api.d.ts.map +1 -0
- package/dist/serialization/sitecore-api.js +17 -0
- package/dist/serialization/tasks/diff.d.ts +3 -0
- package/dist/serialization/tasks/diff.d.ts.map +1 -0
- package/dist/serialization/tasks/diff.js +109 -0
- package/dist/serialization/tasks/env/constants.d.ts +2 -0
- package/dist/serialization/tasks/env/constants.d.ts.map +1 -0
- package/dist/serialization/tasks/env/constants.js +4 -0
- package/dist/serialization/tasks/env/deploy-token.d.ts +3 -0
- package/dist/serialization/tasks/env/deploy-token.d.ts.map +1 -0
- package/dist/serialization/tasks/env/deploy-token.js +128 -0
- package/dist/serialization/tasks/env/index.d.ts +5 -0
- package/dist/serialization/tasks/env/index.d.ts.map +1 -0
- package/dist/serialization/tasks/env/index.js +11 -0
- package/dist/serialization/tasks/env/init/auth.d.ts +24 -0
- package/dist/serialization/tasks/env/init/auth.d.ts.map +1 -0
- package/dist/serialization/tasks/env/init/auth.js +122 -0
- package/dist/serialization/tasks/env/init/deploy-lookup.d.ts +22 -0
- package/dist/serialization/tasks/env/init/deploy-lookup.d.ts.map +1 -0
- package/dist/serialization/tasks/env/init/deploy-lookup.js +244 -0
- package/dist/serialization/tasks/env/init.d.ts +3 -0
- package/dist/serialization/tasks/env/init.d.ts.map +1 -0
- package/dist/serialization/tasks/env/init.js +253 -0
- package/dist/serialization/tasks/env/logout.d.ts +3 -0
- package/dist/serialization/tasks/env/logout.d.ts.map +1 -0
- package/dist/serialization/tasks/env/logout.js +61 -0
- package/dist/serialization/tasks/env/status.d.ts +3 -0
- package/dist/serialization/tasks/env/status.d.ts.map +1 -0
- package/dist/serialization/tasks/env/status.js +149 -0
- package/dist/serialization/tasks/env.d.ts +2 -0
- package/dist/serialization/tasks/env.d.ts.map +1 -0
- package/dist/serialization/tasks/env.js +17 -0
- package/dist/serialization/tasks/helpers/collect.d.ts +8 -0
- package/dist/serialization/tasks/helpers/collect.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/collect.js +29 -0
- package/dist/serialization/tasks/helpers/commands.d.ts +5 -0
- package/dist/serialization/tasks/helpers/commands.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/commands.js +14 -0
- package/dist/serialization/tasks/helpers/filesystem.d.ts +6 -0
- package/dist/serialization/tasks/helpers/filesystem.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/filesystem.js +27 -0
- package/dist/serialization/tasks/helpers/index.d.ts +6 -0
- package/dist/serialization/tasks/helpers/index.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/index.js +13 -0
- package/dist/serialization/tasks/helpers/items.d.ts +3 -0
- package/dist/serialization/tasks/helpers/items.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/items.js +5 -0
- package/dist/serialization/tasks/helpers/sitecore.d.ts +5 -0
- package/dist/serialization/tasks/helpers/sitecore.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/sitecore.js +109 -0
- package/dist/serialization/tasks/helpers.d.ts +2 -0
- package/dist/serialization/tasks/helpers.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers.js +17 -0
- package/dist/serialization/tasks/index.d.ts +8 -0
- package/dist/serialization/tasks/index.d.ts.map +1 -0
- package/dist/serialization/tasks/index.js +19 -0
- package/dist/serialization/tasks/info.d.ts +4 -0
- package/dist/serialization/tasks/info.d.ts.map +1 -0
- package/dist/serialization/tasks/info.js +82 -0
- package/dist/serialization/tasks/package.d.ts +4 -0
- package/dist/serialization/tasks/package.d.ts.map +1 -0
- package/dist/serialization/tasks/package.js +171 -0
- package/dist/serialization/tasks/pull.d.ts +3 -0
- package/dist/serialization/tasks/pull.d.ts.map +1 -0
- package/dist/serialization/tasks/pull.js +82 -0
- package/dist/serialization/tasks/push.d.ts +3 -0
- package/dist/serialization/tasks/push.d.ts.map +1 -0
- package/dist/serialization/tasks/push.js +101 -0
- package/dist/serialization/tasks/roles.d.ts +6 -0
- package/dist/serialization/tasks/roles.d.ts.map +1 -0
- package/dist/serialization/tasks/roles.js +103 -0
- package/dist/serialization/tasks/shared.d.ts +19 -0
- package/dist/serialization/tasks/shared.d.ts.map +1 -0
- package/dist/serialization/tasks/shared.js +59 -0
- package/dist/serialization/tasks/types.d.ts +73 -0
- package/dist/serialization/tasks/types.d.ts.map +1 -0
- package/dist/serialization/tasks/types.js +8 -0
- package/dist/serialization/tasks/users.d.ts +5 -0
- package/dist/serialization/tasks/users.d.ts.map +1 -0
- package/dist/serialization/tasks/users.js +90 -0
- package/dist/serialization/tasks/validate.d.ts +5 -0
- package/dist/serialization/tasks/validate.d.ts.map +1 -0
- package/dist/serialization/tasks/validate.js +50 -0
- package/dist/serialization/tasks/watch.d.ts +3 -0
- package/dist/serialization/tasks/watch.d.ts.map +1 -0
- package/dist/serialization/tasks/watch.js +75 -0
- package/dist/serialization/tasks.d.ts +4 -0
- package/dist/serialization/tasks.d.ts.map +1 -0
- package/dist/serialization/tasks.js +19 -0
- package/dist/serialization/tree-spec.d.ts +51 -0
- package/dist/serialization/tree-spec.d.ts.map +1 -0
- package/dist/serialization/tree-spec.js +241 -0
- package/dist/serialization/types.d.ts +75 -0
- package/dist/serialization/types.d.ts.map +1 -0
- package/dist/serialization/types.js +2 -0
- package/dist/serialization/wildcard.d.ts +3 -0
- package/dist/serialization/wildcard.d.ts.map +1 -0
- package/dist/serialization/wildcard.js +24 -0
- package/dist/serialization/yaml.d.ts +9 -0
- package/dist/serialization/yaml.d.ts.map +1 -0
- package/dist/serialization/yaml.js +307 -0
- package/dist/shared/browser.d.ts +2 -0
- package/dist/shared/browser.d.ts.map +1 -0
- package/dist/shared/browser.js +36 -0
- package/dist/shared/cli-options.d.ts +17 -0
- package/dist/shared/cli-options.d.ts.map +1 -0
- package/dist/shared/cli-options.js +8 -0
- package/dist/shared/cli-tasks.d.ts +38 -0
- package/dist/shared/cli-tasks.d.ts.map +1 -0
- package/dist/shared/cli-tasks.js +108 -0
- package/dist/shared/config-template.d.ts +23 -0
- package/dist/shared/config-template.d.ts.map +1 -0
- package/dist/shared/config-template.js +38 -0
- package/dist/shared/env.d.ts +28 -0
- package/dist/shared/env.d.ts.map +1 -0
- package/dist/shared/env.js +38 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +59 -0
- package/dist/shared/graphql.d.ts +76 -0
- package/dist/shared/graphql.d.ts.map +1 -0
- package/dist/shared/graphql.js +222 -0
- package/dist/shared/history.d.ts +12 -0
- package/dist/shared/history.d.ts.map +1 -0
- package/dist/shared/history.js +62 -0
- package/dist/shared/keychain.d.ts +15 -0
- package/dist/shared/keychain.d.ts.map +1 -0
- package/dist/shared/keychain.js +177 -0
- package/dist/shared/logger.d.ts +24 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +157 -0
- package/dist/shared/output.d.ts +7 -0
- package/dist/shared/output.d.ts.map +1 -0
- package/dist/shared/output.js +21 -0
- package/dist/shared/prompt.d.ts +5 -0
- package/dist/shared/prompt.d.ts.map +1 -0
- package/dist/shared/prompt.js +87 -0
- package/dist/shared/redact.d.ts +3 -0
- package/dist/shared/redact.d.ts.map +1 -0
- package/dist/shared/redact.js +47 -0
- package/dist/shared/spinner.d.ts +5 -0
- package/dist/shared/spinner.d.ts.map +1 -0
- package/dist/shared/spinner.js +89 -0
- package/dist/shared/style.d.ts +2 -0
- package/dist/shared/style.d.ts.map +1 -0
- package/dist/shared/style.js +61 -0
- package/dist/shared/telemetry.d.ts +21 -0
- package/dist/shared/telemetry.d.ts.map +1 -0
- package/dist/shared/telemetry.js +226 -0
- package/dist/shared/validate.d.ts +3 -0
- package/dist/shared/validate.d.ts.map +1 -0
- package/dist/shared/validate.js +32 -0
- package/dist/sites/api/collections.d.ts +25 -0
- package/dist/sites/api/collections.d.ts.map +1 -0
- package/dist/sites/api/collections.js +21 -0
- package/dist/sites/api/index.d.ts +26 -0
- package/dist/sites/api/index.d.ts.map +1 -0
- package/dist/sites/api/index.js +55 -0
- package/dist/sites/api/jobs.d.ts +31 -0
- package/dist/sites/api/jobs.d.ts.map +1 -0
- package/dist/sites/api/jobs.js +10 -0
- package/dist/sites/api/languages.d.ts +22 -0
- package/dist/sites/api/languages.d.ts.map +1 -0
- package/dist/sites/api/languages.js +18 -0
- package/dist/sites/api/request.d.ts +24 -0
- package/dist/sites/api/request.d.ts.map +1 -0
- package/dist/sites/api/request.js +99 -0
- package/dist/sites/api/sites.d.ts +53 -0
- package/dist/sites/api/sites.d.ts.map +1 -0
- package/dist/sites/api/sites.js +41 -0
- package/dist/sites/api/types.d.ts +29 -0
- package/dist/sites/api/types.d.ts.map +1 -0
- package/dist/sites/api/types.js +4 -0
- package/package.json +109 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emitLayoutXml = emitLayoutXml;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const errors_1 = require("../../shared/errors");
|
|
6
|
+
const formatGuidCurly = (guid) => `{${guid.toUpperCase()}}`;
|
|
7
|
+
const escapeXmlAttribute = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
8
|
+
const encodeParams = (params) => Object.entries(params)
|
|
9
|
+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
10
|
+
.join("&");
|
|
11
|
+
const placementUid = (parentItemId, placeholderKey, index, componentHandle) => (0, uuid_1.v5)(`placement:${placeholderKey}:${index}:${componentHandle}`, parentItemId);
|
|
12
|
+
const resolvePlacement = (placement, placeholderKey, index, ctx) => {
|
|
13
|
+
const renderingId = formatGuidCurly(ctx.renderingIdFor(placement.componentHandle));
|
|
14
|
+
const uid = formatGuidCurly(placementUid(ctx.parentItemId, placeholderKey, index, placement.componentHandle));
|
|
15
|
+
let dsAttr = "";
|
|
16
|
+
if (placement.datasourceRef !== undefined) {
|
|
17
|
+
switch (placement.datasourceRef.kind) {
|
|
18
|
+
case "shared":
|
|
19
|
+
dsAttr = ` ds="${formatGuidCurly(ctx.contentItemIdFor(placement.datasourceRef.handle))}"`;
|
|
20
|
+
break;
|
|
21
|
+
case "scoped":
|
|
22
|
+
if (!ctx.allowScoped) {
|
|
23
|
+
throw (0, errors_1.createCliError)(`scoped datasourceRef is invalid in this layout context (no host page to resolve against). Slot: '${placement.datasourceRef.slot}'. Use 'shared' for reusable content or 'none' for config-driven renderings.`, "INPUT_INVALID");
|
|
24
|
+
}
|
|
25
|
+
// Scoped resolution is a Phase 5 concern (PageRecipe). Emit
|
|
26
|
+
// an explicit local-* sentinel so any premature execution
|
|
27
|
+
// fails loudly with a recognizable marker.
|
|
28
|
+
dsAttr = ` ds="local:${escapeXmlAttribute(placement.datasourceRef.slot)}"`;
|
|
29
|
+
break;
|
|
30
|
+
case "none":
|
|
31
|
+
// No ds attribute — rendering is config-driven via params.
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const allParams = { ...(placement.params ?? {}) };
|
|
36
|
+
if (placement.variant !== undefined) {
|
|
37
|
+
// SXA Rendering Variant selection rides as the FieldNames
|
|
38
|
+
// rendering parameter — this is the SXA convention.
|
|
39
|
+
allParams.FieldNames = placement.variant;
|
|
40
|
+
}
|
|
41
|
+
const parValue = Object.keys(allParams).length > 0 ? encodeParams(allParams) : "";
|
|
42
|
+
return { renderingId, uid, placeholderKey, dsAttr, parValue };
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Emit the layout XML for a `Layout` block. Returns an empty string
|
|
46
|
+
* when the layout has no placements — caller decides whether to write
|
|
47
|
+
* an empty `__Renderings` field or skip it.
|
|
48
|
+
*
|
|
49
|
+
* Mode selection (see `LayoutEmitContext.mode` JSDoc):
|
|
50
|
+
* - `"canonical"` (default) — what page-design items round-trip cleanly.
|
|
51
|
+
* - `"delta"` — SXA partial-design wire form so first push converges.
|
|
52
|
+
*
|
|
53
|
+
* Throws when a `kind: "scoped"` datasourceRef appears and
|
|
54
|
+
* `ctx.allowScoped` is false — partial designs and page designs reject
|
|
55
|
+
* scoped refs because they lack a host page.
|
|
56
|
+
*/
|
|
57
|
+
function emitLayoutXml(layout, ctx) {
|
|
58
|
+
const placeholderEntries = Object.entries(layout.placeholders).filter(([, placements]) => placements.length > 0);
|
|
59
|
+
if (placeholderEntries.length === 0) {
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
if ((ctx.mode ?? "canonical") === "delta") {
|
|
63
|
+
return emitDelta(placeholderEntries, ctx);
|
|
64
|
+
}
|
|
65
|
+
return emitCanonical(placeholderEntries, ctx);
|
|
66
|
+
}
|
|
67
|
+
const emitCanonical = (placeholderEntries, ctx) => {
|
|
68
|
+
const elements = [];
|
|
69
|
+
for (const [placeholderKey, placements] of placeholderEntries) {
|
|
70
|
+
placements.forEach((placement, idx) => {
|
|
71
|
+
const r = resolvePlacement(placement, placeholderKey, idx, ctx);
|
|
72
|
+
const parAttr = r.parValue ? ` par="${escapeXmlAttribute(r.parValue)}"` : "";
|
|
73
|
+
elements.push(`<r id="${r.renderingId}" placeh="${escapeXmlAttribute(r.placeholderKey)}"${r.dsAttr}${parAttr} uid="${r.uid}" />`);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return `<r xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><d id="${formatGuidCurly(ctx.deviceId)}">${elements.join("")}</d></r>`;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Emit SXA Partial Design delta form. Per-placeholder anchor sequence:
|
|
80
|
+
* - First placement in a placeholder: `p:before="*"` (insert before all)
|
|
81
|
+
* - Last placement (when there are 2+ placements): `p:after="*[1=2]"`
|
|
82
|
+
* (sentinel: position after a non-matching XPath = "at the end")
|
|
83
|
+
* - Middle placements: `p:after="r[@uid='<previous-uid-in-placeholder>']"`
|
|
84
|
+
*
|
|
85
|
+
* Single-placement placeholders only emit `p:before="*"`. Across
|
|
86
|
+
* placeholders, anchor sequences are independent — each placeholder's
|
|
87
|
+
* placements form their own first/middle/last sequence in the order
|
|
88
|
+
* the recipe declares them. Attribute names get the `s:` prefix
|
|
89
|
+
* (`s:placeh`, `s:ds`, `s:id`, `s:par`); `uid` stays unprefixed; and
|
|
90
|
+
* `s:par=""` is always present (canonical form omits empty `par`).
|
|
91
|
+
*/
|
|
92
|
+
const emitDelta = (placeholderEntries, ctx) => {
|
|
93
|
+
const elements = [`<p:da name="l" />`];
|
|
94
|
+
for (const [placeholderKey, placements] of placeholderEntries) {
|
|
95
|
+
let prevUid = null;
|
|
96
|
+
placements.forEach((placement, idx) => {
|
|
97
|
+
const r = resolvePlacement(placement, placeholderKey, idx, ctx);
|
|
98
|
+
const isFirst = idx === 0;
|
|
99
|
+
const isLast = idx === placements.length - 1;
|
|
100
|
+
let anchorAttr;
|
|
101
|
+
if (isFirst) {
|
|
102
|
+
anchorAttr = ` p:before="*"`;
|
|
103
|
+
}
|
|
104
|
+
else if (isLast) {
|
|
105
|
+
anchorAttr = ` p:after="*[1=2]"`;
|
|
106
|
+
}
|
|
107
|
+
else if (prevUid) {
|
|
108
|
+
// Middle: reference the previous sibling's uid (without curlies in
|
|
109
|
+
// the XPath — Sitecore writes them bare in the `r[@uid='…']` form).
|
|
110
|
+
anchorAttr = ` p:after="r[@uid='${escapeXmlAttribute(prevUid)}']"`;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// Defensive — shouldn't be reachable since prevUid is set after idx 0.
|
|
114
|
+
anchorAttr = ` p:after="*[1=2]"`;
|
|
115
|
+
}
|
|
116
|
+
// Convert canonical `ds="…"` → namespaced `s:ds="…"`. The dsAttr
|
|
117
|
+
// string already includes a leading space + `ds=` prefix, so we
|
|
118
|
+
// splice the `s:` prefix in.
|
|
119
|
+
const sDsAttr = r.dsAttr ? r.dsAttr.replace(/^ ds=/, " s:ds=") : "";
|
|
120
|
+
// s:par is always emitted in delta form (canonical omits empty par).
|
|
121
|
+
const sParAttr = ` s:par="${escapeXmlAttribute(r.parValue)}"`;
|
|
122
|
+
elements.push(`<r uid="${r.uid}"${anchorAttr} s:placeh="${escapeXmlAttribute(r.placeholderKey)}"${sDsAttr} s:id="${r.renderingId}"${sParAttr} />`);
|
|
123
|
+
prevUid = r.uid;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return `<r xmlns:p="p" xmlns:s="s" p:p="1"><d id="${formatGuidCurly(ctx.deviceId)}">${elements.join("")}</d></r>`;
|
|
127
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL-string encoder for Sitecore SXA's `TemplatesMapping` field on
|
|
3
|
+
* the Page Designs root item. The field stores a property bag in
|
|
4
|
+
* URL-encoded form:
|
|
5
|
+
*
|
|
6
|
+
* {tplGuid1}={designGuid1}&{tplGuid2}={designGuid2}
|
|
7
|
+
*
|
|
8
|
+
* Each page design contributes one entry per applies-to template.
|
|
9
|
+
*
|
|
10
|
+
* Multi-recipe merging is the executor's job — when several
|
|
11
|
+
* `PageDesignRecipe`s in one push contribute their own slices of the
|
|
12
|
+
* mapping, the executor reads the existing field, merges contributions
|
|
13
|
+
* keyed by template GUID, and writes the combined result. This module
|
|
14
|
+
* is purely the wire-format encoder for one slice.
|
|
15
|
+
*/
|
|
16
|
+
export interface TemplatesMappingEntry {
|
|
17
|
+
/** Page-template item GUID (e.g. for `home-page@1`). */
|
|
18
|
+
templateGuid: string;
|
|
19
|
+
/** Page-design item GUID this template should use. */
|
|
20
|
+
designGuid: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Encode a list of template-to-design mappings into the URL-string
|
|
24
|
+
* form Sitecore stores in the `TemplatesMapping` field. GUIDs are
|
|
25
|
+
* normalized to upper-case curly form before URL-encoding.
|
|
26
|
+
*/
|
|
27
|
+
export declare function encodeTemplatesMapping(entries: readonly TemplatesMappingEntry[]): string;
|
|
28
|
+
//# sourceMappingURL=templates-mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates-mapping.d.ts","sourceRoot":"","sources":["../../../src/recipe/layout/templates-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,GAAG,MAAM,CAOxF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* URL-string encoder for Sitecore SXA's `TemplatesMapping` field on
|
|
4
|
+
* the Page Designs root item. The field stores a property bag in
|
|
5
|
+
* URL-encoded form:
|
|
6
|
+
*
|
|
7
|
+
* {tplGuid1}={designGuid1}&{tplGuid2}={designGuid2}
|
|
8
|
+
*
|
|
9
|
+
* Each page design contributes one entry per applies-to template.
|
|
10
|
+
*
|
|
11
|
+
* Multi-recipe merging is the executor's job — when several
|
|
12
|
+
* `PageDesignRecipe`s in one push contribute their own slices of the
|
|
13
|
+
* mapping, the executor reads the existing field, merges contributions
|
|
14
|
+
* keyed by template GUID, and writes the combined result. This module
|
|
15
|
+
* is purely the wire-format encoder for one slice.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.encodeTemplatesMapping = encodeTemplatesMapping;
|
|
19
|
+
const formatGuidCurly = (guid) => `{${guid.toUpperCase()}}`;
|
|
20
|
+
/**
|
|
21
|
+
* Encode a list of template-to-design mappings into the URL-string
|
|
22
|
+
* form Sitecore stores in the `TemplatesMapping` field. GUIDs are
|
|
23
|
+
* normalized to upper-case curly form before URL-encoding.
|
|
24
|
+
*/
|
|
25
|
+
function encodeTemplatesMapping(entries) {
|
|
26
|
+
return entries
|
|
27
|
+
.map(({ templateGuid, designGuid }) => `${encodeURIComponent(formatGuidCurly(templateGuid))}=${encodeURIComponent(formatGuidCurly(designGuid))}`)
|
|
28
|
+
.join("&");
|
|
29
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { Operation, OperationIr } from "./ir/operations";
|
|
2
|
+
import type { AuthoringApiClient, CreateItemInput, RemoteItem, UpdateItemInput } from "./api/client";
|
|
3
|
+
import type { NewSiteInput, SitesApiClient } from "./api/sites-client";
|
|
4
|
+
/**
|
|
5
|
+
* `scai recipe plan` and `scai recipe push` share this read-then-diff path:
|
|
6
|
+
*
|
|
7
|
+
* for each op:
|
|
8
|
+
* resolve the target item (path-based for CreateItem, captured-id
|
|
9
|
+
* based for update-style ops)
|
|
10
|
+
* read remote state; diff against IR
|
|
11
|
+
* emit mutation per policy (create / update / skip / error)
|
|
12
|
+
*
|
|
13
|
+
* Sitecore's Authoring API server-assigns itemIds on `createItem`. The
|
|
14
|
+
* IR carries deterministic uuidv5 refKeys (recipe-internal) plus
|
|
15
|
+
* Sitecore paths (deterministic from recipe + envProfile roots). On each
|
|
16
|
+
* push, the executor maintains a per-run `capturedItemIds: Map<refKey,
|
|
17
|
+
* sitecoreItemId>` populated from `getItem(by path)` and `createItem`
|
|
18
|
+
* responses. Subsequent ops resolve their target by refKey → captured
|
|
19
|
+
* itemId, and `ref-recipe` field values resolve through the same map.
|
|
20
|
+
*/
|
|
21
|
+
export interface FieldDiffEntry {
|
|
22
|
+
fieldId: string;
|
|
23
|
+
before: string | null;
|
|
24
|
+
after: string;
|
|
25
|
+
language?: string;
|
|
26
|
+
version?: number;
|
|
27
|
+
}
|
|
28
|
+
type ActionStatus = "create" | "update" | "skip" | "error";
|
|
29
|
+
export interface PlannedAction {
|
|
30
|
+
index: number;
|
|
31
|
+
operation: Operation;
|
|
32
|
+
status: ActionStatus;
|
|
33
|
+
reason?: string;
|
|
34
|
+
diff?: FieldDiffEntry[];
|
|
35
|
+
/** Snapshot of the mutation the executor will/would dispatch. */
|
|
36
|
+
mutation?: {
|
|
37
|
+
kind: "createItem";
|
|
38
|
+
input: CreateItemInput;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "updateItem";
|
|
41
|
+
input: UpdateItemInput;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "createSite";
|
|
44
|
+
input: NewSiteInput;
|
|
45
|
+
/**
|
|
46
|
+
* RefKey of the site item — the executor stores the
|
|
47
|
+
* server-assigned site itemId here in `capturedItemIds` so
|
|
48
|
+
* subsequent SetField ops scoped to the site (dictionary
|
|
49
|
+
* overrides etc.) can resolve.
|
|
50
|
+
*/
|
|
51
|
+
siteRefKey: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Pre-mutation remote state captured during plan-time read. `null` means
|
|
55
|
+
* the target item did not exist at plan time. Used by rollback to
|
|
56
|
+
* derive inverse mutations.
|
|
57
|
+
*/
|
|
58
|
+
snapshot?: RemoteItem | null;
|
|
59
|
+
}
|
|
60
|
+
export interface PlanSummary {
|
|
61
|
+
create: number;
|
|
62
|
+
update: number;
|
|
63
|
+
skip: number;
|
|
64
|
+
error: number;
|
|
65
|
+
}
|
|
66
|
+
export interface Plan {
|
|
67
|
+
schemaVersion: "1";
|
|
68
|
+
recipeHandle: string;
|
|
69
|
+
actions: PlannedAction[];
|
|
70
|
+
summary: PlanSummary;
|
|
71
|
+
}
|
|
72
|
+
export type PlanEvent = {
|
|
73
|
+
kind: "op-start";
|
|
74
|
+
index: number;
|
|
75
|
+
operation: Operation;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "op-result";
|
|
78
|
+
action: PlannedAction;
|
|
79
|
+
} | {
|
|
80
|
+
kind: "op-error";
|
|
81
|
+
index: number;
|
|
82
|
+
operation: Operation;
|
|
83
|
+
error: string;
|
|
84
|
+
};
|
|
85
|
+
export interface PlanOptions {
|
|
86
|
+
emit?: (event: PlanEvent) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Per-run map from recipe-internal refKey (uuidv5) to Sitecore-assigned
|
|
89
|
+
* itemId. The executor passes a shared map and updates it as creates
|
|
90
|
+
* resolve. Plan mode passes a fresh map; refs that don't resolve
|
|
91
|
+
* during plan-mode produce `skip` actions.
|
|
92
|
+
*/
|
|
93
|
+
capturedItemIds?: Map<string, string>;
|
|
94
|
+
/**
|
|
95
|
+
* Sites API client — only consulted when an IR contains
|
|
96
|
+
* `CreateSiteFromTemplate` ops. Recipe sets that don't include
|
|
97
|
+
* SiteRecipes don't need a sites client; passing undefined is fine
|
|
98
|
+
* and yields an `error` action only if a site op is encountered.
|
|
99
|
+
*/
|
|
100
|
+
sitesClient?: SitesApiClient;
|
|
101
|
+
/**
|
|
102
|
+
* Workspace-wide path → RemoteItem snapshot cache. When provided,
|
|
103
|
+
* `buildAction` consults it before issuing `client.getItem({ path })`
|
|
104
|
+
* for CreateItem ops. Cache hits skip the wire call entirely.
|
|
105
|
+
*/
|
|
106
|
+
pathSnapshotCache?: Map<string, RemoteItem | null>;
|
|
107
|
+
/**
|
|
108
|
+
* Workspace-wide path → itemId cache (shared with the AuthoringApiClient).
|
|
109
|
+
* Threaded so `buildAction` can populate it after a successful read,
|
|
110
|
+
* and so the planner sees same path resolutions a sibling recipe
|
|
111
|
+
* already made earlier in the push.
|
|
112
|
+
*/
|
|
113
|
+
pathItemIdCache?: Map<string, string>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Plan a single op against the current remote state. Exposed so the
|
|
117
|
+
* executor's apply mode can interleave plan-and-apply per-op (each op's
|
|
118
|
+
* plan sees the cascading effect of earlier ops' applies — required for
|
|
119
|
+
* idempotency: a second push must see no drift on update-style ops whose
|
|
120
|
+
* targets the first push created).
|
|
121
|
+
*
|
|
122
|
+
* Updates `capturedItemIds` when `getItem(by path)` finds an existing
|
|
123
|
+
* item (so subsequent ops can resolve refs without dispatching).
|
|
124
|
+
*
|
|
125
|
+
* When a `pathSnapshotCache` is provided (workspace prefetch), each
|
|
126
|
+
* `getItem({ path })` call short-circuits to the cached value when the
|
|
127
|
+
* path is already known — `null` means "checked and missing", a
|
|
128
|
+
* `RemoteItem` means "use this snapshot". Non-path lookups (by itemId)
|
|
129
|
+
* still hit the wire.
|
|
130
|
+
*/
|
|
131
|
+
export declare const buildAction: (index: number, op: Operation, client: AuthoringApiClient, capturedItemIds: Map<string, string>, sitesClient?: SitesApiClient, pathSnapshotCache?: Map<string, RemoteItem | null>) => Promise<PlannedAction>;
|
|
132
|
+
export declare const buildPlan: (ir: OperationIr, client: AuthoringApiClient, options?: PlanOptions) => Promise<Plan>;
|
|
133
|
+
export {};
|
|
134
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/recipe/plan.ts"],"names":[],"mappings":"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"}
|