@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,741 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENUMERATIONS_ROOT_AGGREGATE_HANDLE = exports.SITE_DATA_ROOT_AGGREGATE_HANDLE = exports.SHARED_DATA_FOLDERS_AGGREGATE_HANDLE = exports.AVAILABLE_RENDERINGS_AGGREGATE_HANDLE = exports.TEMPLATES_MAPPING_AGGREGATE_HANDLE = exports.compileEnumerationRecipe = exports.compileSiteRecipe = exports.compileSiteTemplateRecipe = exports.compileContentItemRecipe = exports.compilePageDesignRecipe = exports.compilePartialDesignRecipe = exports.compileSectionDefinitionRecipe = exports.compileParametersTemplateRecipe = exports.compileContentTemplateRecipe = exports.compileComponentTemplateRecipe = exports.compileComponentSectionRecipe = void 0;
|
|
4
|
+
exports.compileRecipeSet = compileRecipeSet;
|
|
5
|
+
exports.compileRecipe = compileRecipe;
|
|
6
|
+
const guids_1 = require("./guids");
|
|
7
|
+
const operations_1 = require("./ir/operations");
|
|
8
|
+
const policy_1 = require("./policy");
|
|
9
|
+
const sitecore_templates_1 = require("./ir/sitecore-templates");
|
|
10
|
+
const recipe_1 = require("./schema/recipe");
|
|
11
|
+
const templates_mapping_1 = require("./layout/templates-mapping");
|
|
12
|
+
const component_section_1 = require("./compile/component-section");
|
|
13
|
+
Object.defineProperty(exports, "compileComponentSectionRecipe", { enumerable: true, get: function () { return component_section_1.compileComponentSectionRecipe; } });
|
|
14
|
+
const component_template_1 = require("./compile/component-template");
|
|
15
|
+
Object.defineProperty(exports, "compileComponentTemplateRecipe", { enumerable: true, get: function () { return component_template_1.compileComponentTemplateRecipe; } });
|
|
16
|
+
const content_template_1 = require("./compile/content-template");
|
|
17
|
+
Object.defineProperty(exports, "compileContentTemplateRecipe", { enumerable: true, get: function () { return content_template_1.compileContentTemplateRecipe; } });
|
|
18
|
+
const parameters_template_1 = require("./compile/parameters-template");
|
|
19
|
+
Object.defineProperty(exports, "compileParametersTemplateRecipe", { enumerable: true, get: function () { return parameters_template_1.compileParametersTemplateRecipe; } });
|
|
20
|
+
const section_definition_1 = require("./compile/section-definition");
|
|
21
|
+
Object.defineProperty(exports, "compileSectionDefinitionRecipe", { enumerable: true, get: function () { return section_definition_1.compileSectionDefinitionRecipe; } });
|
|
22
|
+
const partial_design_1 = require("./compile/partial-design");
|
|
23
|
+
Object.defineProperty(exports, "compilePartialDesignRecipe", { enumerable: true, get: function () { return partial_design_1.compilePartialDesignRecipe; } });
|
|
24
|
+
const page_design_1 = require("./compile/page-design");
|
|
25
|
+
Object.defineProperty(exports, "compilePageDesignRecipe", { enumerable: true, get: function () { return page_design_1.compilePageDesignRecipe; } });
|
|
26
|
+
const content_item_1 = require("./compile/content-item");
|
|
27
|
+
Object.defineProperty(exports, "compileContentItemRecipe", { enumerable: true, get: function () { return content_item_1.compileContentItemRecipe; } });
|
|
28
|
+
const site_template_1 = require("./compile/site-template");
|
|
29
|
+
Object.defineProperty(exports, "compileSiteTemplateRecipe", { enumerable: true, get: function () { return site_template_1.compileSiteTemplateRecipe; } });
|
|
30
|
+
const site_1 = require("./compile/site");
|
|
31
|
+
Object.defineProperty(exports, "compileSiteRecipe", { enumerable: true, get: function () { return site_1.compileSiteRecipe; } });
|
|
32
|
+
const enumeration_1 = require("./compile/enumeration");
|
|
33
|
+
Object.defineProperty(exports, "compileEnumerationRecipe", { enumerable: true, get: function () { return enumeration_1.compileEnumerationRecipe; } });
|
|
34
|
+
const shared_1 = require("./compile/shared");
|
|
35
|
+
/**
|
|
36
|
+
* Stable handle for the synthetic IR `compileRecipeSet` emits to write
|
|
37
|
+
* the cross-recipe `TemplatesMapping` aggregate. Not a real recipe — the
|
|
38
|
+
* leading double-underscore signals "compiler-synthesized" and avoids
|
|
39
|
+
* collision with any author-defined handle (recipe handles match
|
|
40
|
+
* `[a-z][a-z0-9-]*@\d+`, so a leading underscore is unrepresentable).
|
|
41
|
+
*/
|
|
42
|
+
exports.TEMPLATES_MAPPING_AGGREGATE_HANDLE = "__templates-mapping__";
|
|
43
|
+
/**
|
|
44
|
+
* Stable handle for the synthetic IR `compileRecipeSet` emits to
|
|
45
|
+
* materialise the per-section `Available Renderings` items. Same
|
|
46
|
+
* compiler-synthesized convention as `TEMPLATES_MAPPING_AGGREGATE_HANDLE`.
|
|
47
|
+
*/
|
|
48
|
+
exports.AVAILABLE_RENDERINGS_AGGREGATE_HANDLE = "__available-renderings__";
|
|
49
|
+
/**
|
|
50
|
+
* Stable handle for the synthetic IR `compileRecipeSet` emits to
|
|
51
|
+
* materialise SHARED Data Folder templates — one per `(site, subfolder)`
|
|
52
|
+
* targeted by ≥2 component-template recipes in the set. Each shared
|
|
53
|
+
* template's `__Standard Values` Insert Options is the union of every
|
|
54
|
+
* contributing recipe's datasource template, so a CMS author
|
|
55
|
+
* right-clicking → Insert in (e.g.) `Site Shared UI/Badges` sees the
|
|
56
|
+
* full set of legitimately-allowed shapes (Badge + StatusPill + Tag).
|
|
57
|
+
*
|
|
58
|
+
* Same `__…__` compiler-synthesized convention as the other aggregate
|
|
59
|
+
* handles in this file.
|
|
60
|
+
*/
|
|
61
|
+
exports.SHARED_DATA_FOLDERS_AGGREGATE_HANDLE = "__shared-data-folders__";
|
|
62
|
+
/**
|
|
63
|
+
* Stable handle for the synthetic IR `compileRecipeSet` emits to
|
|
64
|
+
* materialise the site Data folder ROOT's `__Standard Values` item +
|
|
65
|
+
* Insert Options aggregate. The SV restricts right-click → Insert at
|
|
66
|
+
* `<contentItemsRoot>` to: the generic Folder template, every
|
|
67
|
+
* per-recipe `<Component> Data Folder` template (singletons), and
|
|
68
|
+
* every shared `<subfolder> Data Folder` template (coalesced shared
|
|
69
|
+
* subfolders).
|
|
70
|
+
*
|
|
71
|
+
* Same `__…__` compiler-synthesized convention as the other aggregate
|
|
72
|
+
* handles in this file.
|
|
73
|
+
*/
|
|
74
|
+
exports.SITE_DATA_ROOT_AGGREGATE_HANDLE = "__site-data-root__";
|
|
75
|
+
/**
|
|
76
|
+
* Stable handle for the synthetic IR `compileRecipeSet` emits to
|
|
77
|
+
* materialise the enumerations root's `__Standard Values` item +
|
|
78
|
+
* Insert Options aggregate. The SV restricts right-click → Insert at
|
|
79
|
+
* `<enumerationsRoot>` to: the generic Folder template, plus every
|
|
80
|
+
* per-recipe enumeration folder template (which is the per-site
|
|
81
|
+
* `Enumerations Folder` template — but the aggregate lists each
|
|
82
|
+
* `enumerationFolderId(site, handle)` so the shape mirrors the site
|
|
83
|
+
* data root aggregator and stays consistent if we ever introduce
|
|
84
|
+
* per-recipe enumeration folder templates).
|
|
85
|
+
*/
|
|
86
|
+
exports.ENUMERATIONS_ROOT_AGGREGATE_HANDLE = "__enumerations-root__";
|
|
87
|
+
/**
|
|
88
|
+
* Build the synthetic IR that materialises the SXA `Available Renderings`
|
|
89
|
+
* section items for the recipe set, one per `recipe.section` value
|
|
90
|
+
* across every component-template recipe.
|
|
91
|
+
*
|
|
92
|
+
* Each section emits two ops:
|
|
93
|
+
* 1. `CreateItem` for `<availableRenderingsRoot>/<section>` (template:
|
|
94
|
+
* `AVAILABLE_RENDERINGS`). `CreateOnly` policy — the SetField
|
|
95
|
+
* below carries the actual rendering list and runs every push.
|
|
96
|
+
* 2. `SetField(Renderings)` writing the pipe-separated rendering
|
|
97
|
+
* itemIds for that section. The value is a `ref-recipe-list`
|
|
98
|
+
* pointing at every `renderingId(handle)` in the section, which
|
|
99
|
+
* the executor resolves at apply-time against the captured-itemId
|
|
100
|
+
* map (seeded via `crossRecipeRefs` since the renderings live in
|
|
101
|
+
* sibling per-recipe IRs that ran earlier in the push).
|
|
102
|
+
*
|
|
103
|
+
* Returns null when no eligible recipes exist (no
|
|
104
|
+
* `availableRenderingsRoot` configured, or no component-template
|
|
105
|
+
* recipes carry a `section`).
|
|
106
|
+
*/
|
|
107
|
+
const buildAvailableRenderingsAggregate = (recipes, context) => {
|
|
108
|
+
if (!context.availableRenderingsRoot)
|
|
109
|
+
return null;
|
|
110
|
+
const root = context.availableRenderingsRoot;
|
|
111
|
+
const site = (0, shared_1.siteOf)(context);
|
|
112
|
+
// Build the section handle → recipe map so we can resolve component
|
|
113
|
+
// recipes' `section.handle` references to section names (and pick up
|
|
114
|
+
// each section's `displayName` for the toolbox label).
|
|
115
|
+
const sectionsByHandle = new Map();
|
|
116
|
+
for (const recipe of recipes) {
|
|
117
|
+
if (recipe.kind === "component-section") {
|
|
118
|
+
sectionsByHandle.set(recipe.handle, recipe);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Group component-template recipes by their section's NAME (resolved
|
|
122
|
+
// via the section recipe), preserving stable ordering. Components
|
|
123
|
+
// whose `section.handle` references a section not in the set are
|
|
124
|
+
// silently skipped here — the per-recipe compile pass already throws
|
|
125
|
+
// INPUT_INVALID for that case via `resolveSectionRecipe`.
|
|
126
|
+
const sectionToHandles = new Map();
|
|
127
|
+
for (const recipe of recipes) {
|
|
128
|
+
if (recipe.kind !== "component-template")
|
|
129
|
+
continue;
|
|
130
|
+
if (!recipe.section)
|
|
131
|
+
continue;
|
|
132
|
+
const section = sectionsByHandle.get(recipe.section.handle);
|
|
133
|
+
if (!section)
|
|
134
|
+
continue;
|
|
135
|
+
const list = sectionToHandles.get(section.name) ?? [];
|
|
136
|
+
list.push(recipe.handle);
|
|
137
|
+
sectionToHandles.set(section.name, list);
|
|
138
|
+
}
|
|
139
|
+
if (sectionToHandles.size === 0)
|
|
140
|
+
return null;
|
|
141
|
+
// Reverse-lookup name → section recipe so we can stamp the section's
|
|
142
|
+
// `displayName` (and icon, when present) on the Available Renderings
|
|
143
|
+
// section item — that's what shows in the SXA Pages toolbox.
|
|
144
|
+
const sectionByName = new Map();
|
|
145
|
+
for (const section of sectionsByHandle.values()) {
|
|
146
|
+
sectionByName.set(section.name, section);
|
|
147
|
+
}
|
|
148
|
+
const operations = [];
|
|
149
|
+
for (const [section, handles] of sectionToHandles) {
|
|
150
|
+
const sectionRecipe = sectionByName.get(section);
|
|
151
|
+
const displayName = sectionRecipe?.displayName ?? section;
|
|
152
|
+
const sectionRefKey = (0, guids_1.availableRenderingsSectionId)(site, section);
|
|
153
|
+
const sectionPath = (0, shared_1.joinPath)(root, section);
|
|
154
|
+
const sectionFields = [
|
|
155
|
+
{
|
|
156
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME,
|
|
157
|
+
language: "en",
|
|
158
|
+
version: 1,
|
|
159
|
+
value: { kind: "string", value: displayName },
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
if (sectionRecipe?.icon) {
|
|
163
|
+
sectionFields.push({
|
|
164
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.ICON,
|
|
165
|
+
value: { kind: "string", value: sectionRecipe.icon },
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (sectionRecipe?.sortOrder !== undefined) {
|
|
169
|
+
sectionFields.push({
|
|
170
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.SORT_ORDER,
|
|
171
|
+
value: { kind: "number", value: sectionRecipe.sortOrder },
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
operations.push({
|
|
175
|
+
op: "CreateItem",
|
|
176
|
+
policy: "CreateOnly",
|
|
177
|
+
label: `available-renderings-section:${site}:${section}`,
|
|
178
|
+
id: sectionRefKey,
|
|
179
|
+
path: sectionPath,
|
|
180
|
+
parent: { kind: "ref-path", value: root },
|
|
181
|
+
templateOf: sitecore_templates_1.SITECORE_TEMPLATES.AVAILABLE_RENDERINGS,
|
|
182
|
+
name: section,
|
|
183
|
+
fields: sectionFields,
|
|
184
|
+
});
|
|
185
|
+
const sortedHandles = [...handles].sort((a, b) => a.localeCompare(b));
|
|
186
|
+
operations.push({
|
|
187
|
+
op: "SetField",
|
|
188
|
+
policy: (0, policy_1.policyFor)("composition-structure"),
|
|
189
|
+
label: `available-renderings-list:${site}:${section}`,
|
|
190
|
+
itemRefKey: sectionRefKey,
|
|
191
|
+
fieldId: sitecore_templates_1.AVAILABLE_RENDERINGS_FIELDS.RENDERINGS,
|
|
192
|
+
value: {
|
|
193
|
+
kind: "ref-recipe-list",
|
|
194
|
+
refKeys: sortedHandles.map((handle) => (0, guids_1.renderingId)(site, handle)),
|
|
195
|
+
// Tolerant: if a sibling recipe IR aborted and its rendering
|
|
196
|
+
// wasn't created, write the rest rather than failing the whole
|
|
197
|
+
// aggregate. The per-recipe IR's failure is already surfaced
|
|
198
|
+
// via its own DEPLOY_FAILED — the aggregate shouldn't compound
|
|
199
|
+
// the noise.
|
|
200
|
+
tolerateMissing: true,
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return operations_1.OperationIrSchema.parse({
|
|
205
|
+
schemaVersion: "1",
|
|
206
|
+
recipeHandle: exports.AVAILABLE_RENDERINGS_AGGREGATE_HANDLE,
|
|
207
|
+
operations,
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Pre-pass over the input recipe set that maps each site-scoped
|
|
212
|
+
* subfolder to its contributing component-template recipes. The
|
|
213
|
+
* returned map only includes keys with ≥2 contributions — singletons
|
|
214
|
+
* stay on the per-recipe template path.
|
|
215
|
+
*
|
|
216
|
+
* Key shape: `${site}::${subfolder}` — site is uniform across the set
|
|
217
|
+
* today, but threading it into the key keeps the structure valid if
|
|
218
|
+
* cross-site recipe sets ever land.
|
|
219
|
+
*/
|
|
220
|
+
const detectSharedSubfolders = (recipes, site) => {
|
|
221
|
+
const all = new Map();
|
|
222
|
+
for (const recipe of recipes) {
|
|
223
|
+
if (recipe.kind !== "component-template")
|
|
224
|
+
continue;
|
|
225
|
+
const locations = recipe.datasource?.locations ?? [];
|
|
226
|
+
for (const location of locations) {
|
|
227
|
+
if (location.scope !== "site" || !location.subfolder)
|
|
228
|
+
continue;
|
|
229
|
+
const key = `${site}::${location.subfolder}`;
|
|
230
|
+
const list = all.get(key) ?? [];
|
|
231
|
+
list.push({ recipeHandle: recipe.handle });
|
|
232
|
+
all.set(key, list);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// Filter out singletons — only `(site, subfolder)` pairs with ≥2
|
|
236
|
+
// contributors flip to the shared coalescer; the singleton path
|
|
237
|
+
// already does the right thing via the per-recipe template.
|
|
238
|
+
const shared = new Map();
|
|
239
|
+
for (const [key, list] of all) {
|
|
240
|
+
if (list.length >= 2)
|
|
241
|
+
shared.set(key, list);
|
|
242
|
+
}
|
|
243
|
+
return shared;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Build the synthetic IR materialising the SHARED Data Folder template
|
|
247
|
+
* tree — one template + SV + base-templates link + Insert Options
|
|
248
|
+
* SetField per shared `(site, subfolder)` pair detected by
|
|
249
|
+
* `detectSharedSubfolders`.
|
|
250
|
+
*
|
|
251
|
+
* Path layout: `<componentsRoot>/Data Folders/<…intermediates>/<leaf> Data Folder`.
|
|
252
|
+
* Multi-segment subfolders (`ui/badges`) split on `/`; the leaf becomes
|
|
253
|
+
* `<leaf> Data Folder` and the intermediate segments are stitched into
|
|
254
|
+
* the parent ref-path so the executor's path-walker auto-creates them.
|
|
255
|
+
*
|
|
256
|
+
* Falls back to `templatesRoot` when `componentsRoot` is unset (matches
|
|
257
|
+
* the legacy fallback elsewhere in the compiler).
|
|
258
|
+
*
|
|
259
|
+
* Returns null when no shared subfolders exist.
|
|
260
|
+
*/
|
|
261
|
+
const buildSharedDataFoldersAggregate = (shared, context, site) => {
|
|
262
|
+
if (shared.size === 0)
|
|
263
|
+
return null;
|
|
264
|
+
const operations = [];
|
|
265
|
+
const policy = (0, policy_1.defaultPolicyForRecipe)("component-template");
|
|
266
|
+
const icon = sitecore_templates_1.DEFAULT_ICON;
|
|
267
|
+
const componentsRoot = context.componentsRoot ?? context.templatesRoot;
|
|
268
|
+
const dataFoldersBase = (0, shared_1.joinPath)(componentsRoot, "Data Folders");
|
|
269
|
+
// Stable iteration order — sort the keys lexicographically so the IR
|
|
270
|
+
// is deterministic across runs.
|
|
271
|
+
const sortedKeys = [...shared.keys()].sort((a, b) => a.localeCompare(b));
|
|
272
|
+
for (const key of sortedKeys) {
|
|
273
|
+
const contributions = shared.get(key);
|
|
274
|
+
// Key is `${site}::${subfolder}`; the subfolder may itself contain
|
|
275
|
+
// `::` if authored that way (unlikely but legal), so split on the
|
|
276
|
+
// FIRST `::` only.
|
|
277
|
+
const sepIdx = key.indexOf("::");
|
|
278
|
+
const subfolder = key.slice(sepIdx + 2);
|
|
279
|
+
const segments = subfolder.split("/").map((s) => s.trim()).filter(Boolean);
|
|
280
|
+
// Pre-pass already filters out empty subfolders (the `!!l.subfolder`
|
|
281
|
+
// check), but defend against authored multi-`/` strings collapsing
|
|
282
|
+
// to nothing after trim — skip rather than emitting a malformed op.
|
|
283
|
+
if (segments.length === 0)
|
|
284
|
+
continue;
|
|
285
|
+
const leafSegment = segments[segments.length - 1];
|
|
286
|
+
const intermediateSegments = segments.slice(0, -1);
|
|
287
|
+
const folderName = `${leafSegment} Data Folder`;
|
|
288
|
+
const parentPath = intermediateSegments.length > 0
|
|
289
|
+
? (0, shared_1.joinPath)(dataFoldersBase, intermediateSegments.join("/"))
|
|
290
|
+
: dataFoldersBase;
|
|
291
|
+
const folderPath = (0, shared_1.joinPath)(parentPath, folderName);
|
|
292
|
+
const tplRefKey = (0, guids_1.sharedDataFolderTemplateId)(site, subfolder);
|
|
293
|
+
const svRefKey = (0, guids_1.sharedDataFolderStandardValuesId)(site, subfolder);
|
|
294
|
+
operations.push({
|
|
295
|
+
op: "CreateItem",
|
|
296
|
+
policy,
|
|
297
|
+
label: `shared-data-folder-template:${subfolder}`,
|
|
298
|
+
id: tplRefKey,
|
|
299
|
+
path: folderPath,
|
|
300
|
+
parent: { kind: "ref-path", value: parentPath },
|
|
301
|
+
templateOf: sitecore_templates_1.SITECORE_TEMPLATES.TEMPLATE,
|
|
302
|
+
name: folderName,
|
|
303
|
+
fields: [
|
|
304
|
+
{ fieldId: sitecore_templates_1.SYSTEM_FIELDS.ICON, value: { kind: "string", value: icon } },
|
|
305
|
+
{
|
|
306
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME,
|
|
307
|
+
language: "en",
|
|
308
|
+
version: 1,
|
|
309
|
+
value: { kind: "string", value: folderName },
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
});
|
|
313
|
+
operations.push({
|
|
314
|
+
op: "SetBaseTemplates",
|
|
315
|
+
policy,
|
|
316
|
+
label: `shared-data-folder-base-templates:${subfolder}`,
|
|
317
|
+
itemRefKey: tplRefKey,
|
|
318
|
+
baseTemplates: [sitecore_templates_1.STANDARD_TEMPLATE_ID],
|
|
319
|
+
});
|
|
320
|
+
operations.push({
|
|
321
|
+
op: "CreateItem",
|
|
322
|
+
policy,
|
|
323
|
+
label: `shared-data-folder-standard-values:${subfolder}`,
|
|
324
|
+
id: svRefKey,
|
|
325
|
+
path: (0, shared_1.joinPath)(folderPath, "__Standard Values"),
|
|
326
|
+
parent: { kind: "ref-recipe", refKey: tplRefKey },
|
|
327
|
+
templateOf: tplRefKey,
|
|
328
|
+
name: "__Standard Values",
|
|
329
|
+
fields: [],
|
|
330
|
+
});
|
|
331
|
+
operations.push({
|
|
332
|
+
op: "SetStandardValues",
|
|
333
|
+
policy,
|
|
334
|
+
label: `link-shared-data-folder-standard-values:${subfolder}`,
|
|
335
|
+
templateRefKey: tplRefKey,
|
|
336
|
+
standardValuesRefKey: svRefKey,
|
|
337
|
+
});
|
|
338
|
+
// Insert Options aggregates every contributing recipe's datasource
|
|
339
|
+
// template, sorted by handle so re-pushes don't drift the field
|
|
340
|
+
// value across runs (the executor would otherwise diff-then-write
|
|
341
|
+
// identical content with a different ordering).
|
|
342
|
+
const sortedHandles = contributions
|
|
343
|
+
.map((c) => c.recipeHandle)
|
|
344
|
+
.sort((a, b) => a.localeCompare(b));
|
|
345
|
+
operations.push({
|
|
346
|
+
op: "SetField",
|
|
347
|
+
policy,
|
|
348
|
+
label: `shared-data-folder-insert-options:${subfolder}`,
|
|
349
|
+
itemRefKey: svRefKey,
|
|
350
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.INSERT_OPTIONS,
|
|
351
|
+
value: {
|
|
352
|
+
kind: "ref-recipe-list",
|
|
353
|
+
refKeys: sortedHandles.map((handle) => (0, guids_1.templateId)(site, handle)),
|
|
354
|
+
},
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return operations_1.OperationIrSchema.parse({
|
|
358
|
+
schemaVersion: "1",
|
|
359
|
+
recipeHandle: exports.SHARED_DATA_FOLDERS_AGGREGATE_HANDLE,
|
|
360
|
+
operations,
|
|
361
|
+
});
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Build the synthetic IR materialising the site Data folder ROOT's
|
|
365
|
+
* `__Standard Values` item, with `__Masters` (Insert Options)
|
|
366
|
+
* aggregating: the generic Sitecore Folder template; every per-recipe
|
|
367
|
+
* `<Component> Data Folder` template emitted by recipes that own at
|
|
368
|
+
* least one SINGLETON site-scoped subfolder; and every shared
|
|
369
|
+
* `<Subfolder> Data Folder` template emitted by the coalescer for
|
|
370
|
+
* `(site, subfolder)` pairs touched by ≥2 recipes.
|
|
371
|
+
*
|
|
372
|
+
* Output layout:
|
|
373
|
+
* - `CreateItem` (CreateOnly) for `__Standard Values` directly under
|
|
374
|
+
* `<contentItemsRoot>`. The data root ITEM itself is tenant-pre-
|
|
375
|
+
* existing (or lazy-created); we only own its SV.
|
|
376
|
+
* - `SetField` writing `SYSTEM_FIELDS.INSERT_OPTIONS` on the SV with
|
|
377
|
+
* a `ref-recipe-list` value of the union list.
|
|
378
|
+
*
|
|
379
|
+
* Sort: per-recipe singleton entries are sorted alphabetically by
|
|
380
|
+
* recipe handle; shared entries are sorted alphabetically by
|
|
381
|
+
* subfolder. Concatenated [Folder, ...singletons, ...shared] is the
|
|
382
|
+
* deterministic emission order.
|
|
383
|
+
*
|
|
384
|
+
* Returns null when there are zero contributing recipes (no
|
|
385
|
+
* site-scoped subfolders in the recipe set) or when
|
|
386
|
+
* `contentItemsRoot` is unset (recipes that need it already error
|
|
387
|
+
* individually inside `compileComponentTemplateRecipe`).
|
|
388
|
+
*/
|
|
389
|
+
const buildSiteDataRootAggregate = (recipes, sharedSubfolders, context, site) => {
|
|
390
|
+
if (!context.contentItemsRoot)
|
|
391
|
+
return null;
|
|
392
|
+
// Walk recipes once: collect singleton-contributing handles (each
|
|
393
|
+
// recipe with ≥1 NON-shared site-scoped subfolder contributes once)
|
|
394
|
+
// and shared-contributing subfolders (each shared subfolder
|
|
395
|
+
// contributes once, regardless of how many recipes target it).
|
|
396
|
+
const singletonHandles = new Set();
|
|
397
|
+
const sharedSubfolderRefs = new Set();
|
|
398
|
+
let hasAnySiteSubfolder = false;
|
|
399
|
+
for (const recipe of recipes) {
|
|
400
|
+
if (recipe.kind !== "component-template")
|
|
401
|
+
continue;
|
|
402
|
+
const locations = recipe.datasource?.locations ?? [];
|
|
403
|
+
let hasSingleton = false;
|
|
404
|
+
for (const location of locations) {
|
|
405
|
+
if (location.scope !== "site" || !location.subfolder)
|
|
406
|
+
continue;
|
|
407
|
+
hasAnySiteSubfolder = true;
|
|
408
|
+
if (sharedSubfolders.has(location.subfolder)) {
|
|
409
|
+
sharedSubfolderRefs.add(location.subfolder);
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
hasSingleton = true;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (hasSingleton) {
|
|
416
|
+
singletonHandles.add(recipe.handle);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (!hasAnySiteSubfolder)
|
|
420
|
+
return null;
|
|
421
|
+
const sortedSingletonHandles = [...singletonHandles].sort((a, b) => a.localeCompare(b));
|
|
422
|
+
const sortedSharedSubfolders = [...sharedSubfolderRefs].sort((a, b) => a.localeCompare(b));
|
|
423
|
+
const policy = (0, policy_1.defaultPolicyForRecipe)("component-template");
|
|
424
|
+
const svRefKey = (0, guids_1.siteDataRootStandardValuesId)(site);
|
|
425
|
+
const svPath = (0, shared_1.joinPath)(context.contentItemsRoot, "__Standard Values");
|
|
426
|
+
const operations = [];
|
|
427
|
+
operations.push({
|
|
428
|
+
op: "CreateItem",
|
|
429
|
+
policy: "CreateOnly",
|
|
430
|
+
label: `site-data-root-standard-values:${site}`,
|
|
431
|
+
id: svRefKey,
|
|
432
|
+
path: svPath,
|
|
433
|
+
parent: { kind: "ref-path", value: context.contentItemsRoot },
|
|
434
|
+
templateOf: sitecore_templates_1.SITECORE_TEMPLATES.FOLDER,
|
|
435
|
+
name: "__Standard Values",
|
|
436
|
+
fields: [],
|
|
437
|
+
});
|
|
438
|
+
const refKeys = [
|
|
439
|
+
sitecore_templates_1.SITECORE_TEMPLATES.FOLDER,
|
|
440
|
+
...sortedSingletonHandles.map((handle) => (0, guids_1.siteDataFolderTemplateId)(site, handle)),
|
|
441
|
+
...sortedSharedSubfolders.map((subfolder) => (0, guids_1.sharedDataFolderTemplateId)(site, subfolder)),
|
|
442
|
+
];
|
|
443
|
+
operations.push({
|
|
444
|
+
op: "SetField",
|
|
445
|
+
policy,
|
|
446
|
+
label: `site-data-root-insert-options:${site}`,
|
|
447
|
+
itemRefKey: svRefKey,
|
|
448
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.INSERT_OPTIONS,
|
|
449
|
+
value: {
|
|
450
|
+
kind: "ref-recipe-list",
|
|
451
|
+
refKeys,
|
|
452
|
+
},
|
|
453
|
+
});
|
|
454
|
+
return operations_1.OperationIrSchema.parse({
|
|
455
|
+
schemaVersion: "1",
|
|
456
|
+
recipeHandle: exports.SITE_DATA_ROOT_AGGREGATE_HANDLE,
|
|
457
|
+
operations,
|
|
458
|
+
});
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* Build the synthetic IR materialising the enumerations root's
|
|
462
|
+
* `__Standard Values` item + Insert Options aggregating the generic
|
|
463
|
+
* Folder template plus every per-recipe `enumerationFolderId(site,
|
|
464
|
+
* handle)` in the set.
|
|
465
|
+
*
|
|
466
|
+
* Per-recipe entries are sorted alphabetically by recipe handle so
|
|
467
|
+
* the IR is deterministic across recipe orderings.
|
|
468
|
+
*
|
|
469
|
+
* Returns null when there are zero `EnumerationRecipe`s in the set
|
|
470
|
+
* or when `enumerationsRoot` is unset (the per-recipe compiler
|
|
471
|
+
* already errors individually when the root is missing on a recipe
|
|
472
|
+
* that needs it).
|
|
473
|
+
*/
|
|
474
|
+
const buildEnumerationsRootAggregate = (recipes, context, site) => {
|
|
475
|
+
if (!context.enumerationsRoot)
|
|
476
|
+
return null;
|
|
477
|
+
const handles = [];
|
|
478
|
+
for (const recipe of recipes) {
|
|
479
|
+
if (recipe.kind !== "enumeration")
|
|
480
|
+
continue;
|
|
481
|
+
handles.push(recipe.handle);
|
|
482
|
+
}
|
|
483
|
+
if (handles.length === 0)
|
|
484
|
+
return null;
|
|
485
|
+
const sortedHandles = [...handles].sort((a, b) => a.localeCompare(b));
|
|
486
|
+
const policy = (0, policy_1.defaultPolicyForRecipe)("enumeration");
|
|
487
|
+
const rootRefKey = (0, guids_1.enumerationsRootId)(site);
|
|
488
|
+
const svRefKey = (0, guids_1.enumerationsRootStandardValuesId)(site);
|
|
489
|
+
const svPath = (0, shared_1.joinPath)(context.enumerationsRoot, "__Standard Values");
|
|
490
|
+
// Derive the root's parent path + leaf name from `enumerationsRoot`
|
|
491
|
+
// (e.g. `<site>/Presentation/Enumerations` → parent
|
|
492
|
+
// `<site>/Presentation`, name `Enumerations`).
|
|
493
|
+
const lastSlash = context.enumerationsRoot.lastIndexOf("/");
|
|
494
|
+
const rootParentPath = context.enumerationsRoot.slice(0, lastSlash);
|
|
495
|
+
const rootName = context.enumerationsRoot.slice(lastSlash + 1);
|
|
496
|
+
const operations = [];
|
|
497
|
+
// Explicit emit for the enumerations root item itself. Without this,
|
|
498
|
+
// the executor's path-walker auto-creates it as the generic `Folder`
|
|
499
|
+
// template the first time a child op lands, leaving the SXA editor
|
|
500
|
+
// showing the default folder icon. The explicit op stamps the
|
|
501
|
+
// enumeration glyph (matching `Enumeration` / `Enumerations Folder`
|
|
502
|
+
// templates) via `__Icon`, so the root visually reads as "the
|
|
503
|
+
// enumerations bucket" instead of a generic folder. Policy is
|
|
504
|
+
// CreateAndUpdate so the icon retroactively fixes tenants where the
|
|
505
|
+
// root already exists.
|
|
506
|
+
operations.push({
|
|
507
|
+
op: "CreateItem",
|
|
508
|
+
policy,
|
|
509
|
+
label: `enumerations-root:${site}`,
|
|
510
|
+
id: rootRefKey,
|
|
511
|
+
path: context.enumerationsRoot,
|
|
512
|
+
parent: { kind: "ref-path", value: rootParentPath },
|
|
513
|
+
templateOf: sitecore_templates_1.SITECORE_TEMPLATES.FOLDER,
|
|
514
|
+
name: rootName,
|
|
515
|
+
fields: [(0, shared_1.sharedField)(sitecore_templates_1.SYSTEM_FIELDS.ICON, { kind: "string", value: sitecore_templates_1.ENUMERATION_ICON })],
|
|
516
|
+
});
|
|
517
|
+
operations.push({
|
|
518
|
+
op: "CreateItem",
|
|
519
|
+
policy: "CreateOnly",
|
|
520
|
+
label: `enumerations-root-standard-values:${site}`,
|
|
521
|
+
id: svRefKey,
|
|
522
|
+
path: svPath,
|
|
523
|
+
parent: { kind: "ref-recipe", refKey: rootRefKey },
|
|
524
|
+
templateOf: sitecore_templates_1.SITECORE_TEMPLATES.FOLDER,
|
|
525
|
+
name: "__Standard Values",
|
|
526
|
+
fields: [],
|
|
527
|
+
});
|
|
528
|
+
operations.push({
|
|
529
|
+
op: "SetField",
|
|
530
|
+
policy,
|
|
531
|
+
label: `enumerations-root-insert-options:${site}`,
|
|
532
|
+
itemRefKey: svRefKey,
|
|
533
|
+
fieldId: sitecore_templates_1.SYSTEM_FIELDS.INSERT_OPTIONS,
|
|
534
|
+
value: {
|
|
535
|
+
kind: "ref-recipe-list",
|
|
536
|
+
refKeys: [
|
|
537
|
+
sitecore_templates_1.SITECORE_TEMPLATES.FOLDER,
|
|
538
|
+
...sortedHandles.map((handle) => (0, guids_1.enumerationFolderId)(site, handle)),
|
|
539
|
+
],
|
|
540
|
+
},
|
|
541
|
+
});
|
|
542
|
+
return operations_1.OperationIrSchema.parse({
|
|
543
|
+
schemaVersion: "1",
|
|
544
|
+
recipeHandle: exports.ENUMERATIONS_ROOT_AGGREGATE_HANDLE,
|
|
545
|
+
operations,
|
|
546
|
+
});
|
|
547
|
+
};
|
|
548
|
+
/**
|
|
549
|
+
* Compile a coherent set of recipes to a list of Operation IRs.
|
|
550
|
+
*
|
|
551
|
+
* Returns one IR per recipe (via `compileRecipe`), plus, when any
|
|
552
|
+
* `PageDesignRecipe` in the set declares `appliesTo`, a final synthetic
|
|
553
|
+
* IR whose only op is the combined `SetField(TemplatesMapping)` write
|
|
554
|
+
* on the Page Designs root.
|
|
555
|
+
*
|
|
556
|
+
* The TemplatesMapping field is cross-recipe by nature — every page
|
|
557
|
+
* design contributes one entry per applies-to template, and the field
|
|
558
|
+
* stores the union. Aggregating at compile time keeps the executor
|
|
559
|
+
* untouched (one full-replace write of the union) and gives reviewers
|
|
560
|
+
* a single combined op to inspect rather than N piecewise overwrites.
|
|
561
|
+
*
|
|
562
|
+
* Entries are sorted by `templateGuid` for deterministic output — the
|
|
563
|
+
* IR is the comparable artifact, so order must not depend on input
|
|
564
|
+
* recipe order. Within a single applies-to template, "last design
|
|
565
|
+
* wins" is enforced by sorting (later entries with the same key
|
|
566
|
+
* overwrite earlier ones), but that's a pathological config the
|
|
567
|
+
* cross-recipe validator should already flag.
|
|
568
|
+
*/
|
|
569
|
+
function compileRecipeSet(recipes, context) {
|
|
570
|
+
// Shared across the whole set: section / Component Folders /
|
|
571
|
+
// Presentation Parameters / Content Models group folders only get
|
|
572
|
+
// emitted once even when many recipes land in the same section.
|
|
573
|
+
const emittedFolders = new Set();
|
|
574
|
+
// Pre-pass: detect site-scoped subfolders shared by ≥2 recipes.
|
|
575
|
+
// Threaded into `compileComponentTemplateRecipe` via `CompileContext`
|
|
576
|
+
// so per-recipe emission can swap the folder ITEM's `templateOf` to
|
|
577
|
+
// the shared template and skip emitting its own template when ALL of
|
|
578
|
+
// its site-scoped subfolders are shared.
|
|
579
|
+
const setSiteForShared = (0, shared_1.siteOf)(context);
|
|
580
|
+
const sharedSubfolderContributions = detectSharedSubfolders(recipes, setSiteForShared);
|
|
581
|
+
const sharedSubfolders = new Set([...sharedSubfolderContributions.keys()].map((k) => k.slice(k.indexOf("::") + 2)));
|
|
582
|
+
// Build the cross-recipe section map so component recipes can resolve
|
|
583
|
+
// `section.handle` → ComponentSectionRecipe at compile time. Threaded
|
|
584
|
+
// into perRecipeContext below.
|
|
585
|
+
const sectionsByHandle = new Map();
|
|
586
|
+
for (const recipe of recipes) {
|
|
587
|
+
if (recipe.kind === "component-section") {
|
|
588
|
+
sectionsByHandle.set(recipe.handle, recipe);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
// Cross-recipe enum map — used by `resolveFieldSource` to translate
|
|
592
|
+
// `sitecore.enumHandle` references into the enum folder's tenant
|
|
593
|
+
// path (the form Sitecore's Droplink Source needs; bare `{GUID}`
|
|
594
|
+
// doesn't reliably surface picker options in SXA Headless's
|
|
595
|
+
// rendering parameter dialog).
|
|
596
|
+
const enumsByHandle = new Map();
|
|
597
|
+
for (const recipe of recipes) {
|
|
598
|
+
if (recipe.kind === "enumeration") {
|
|
599
|
+
enumsByHandle.set(recipe.handle, recipe);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
const perRecipeContext = {
|
|
603
|
+
...context,
|
|
604
|
+
...(sharedSubfolders.size > 0 ? { sharedSubfolders } : {}),
|
|
605
|
+
...(sectionsByHandle.size > 0 ? { sectionsByHandle } : {}),
|
|
606
|
+
...(enumsByHandle.size > 0 ? { enumsByHandle } : {}),
|
|
607
|
+
};
|
|
608
|
+
// Process section recipes FIRST so their rich-fields folder ops seed
|
|
609
|
+
// `emittedFolders` sentinels before any component recipe's `ensure*`
|
|
610
|
+
// helpers run. This way the section folder, renderings section folder,
|
|
611
|
+
// and headless variants section all carry the section's icon /
|
|
612
|
+
// displayName / sortOrder rather than the default-folder-icon a
|
|
613
|
+
// component-recipe-driven emission would write.
|
|
614
|
+
const sectionRecipes = recipes.filter((r) => r.kind === "component-section");
|
|
615
|
+
const otherRecipes = recipes.filter((r) => r.kind !== "component-section");
|
|
616
|
+
const orderedRecipes = [...sectionRecipes, ...otherRecipes];
|
|
617
|
+
const irByHandle = new Map();
|
|
618
|
+
for (const recipe of orderedRecipes) {
|
|
619
|
+
let ir;
|
|
620
|
+
switch (recipe.kind) {
|
|
621
|
+
case "component-section":
|
|
622
|
+
ir = (0, component_section_1.compileComponentSectionRecipe)(recipe, perRecipeContext, emittedFolders);
|
|
623
|
+
break;
|
|
624
|
+
case "component-template":
|
|
625
|
+
ir = (0, component_template_1.compileComponentTemplateRecipe)(recipe, perRecipeContext, emittedFolders);
|
|
626
|
+
break;
|
|
627
|
+
case "content-template":
|
|
628
|
+
ir = (0, content_template_1.compileContentTemplateRecipe)(recipe, perRecipeContext, emittedFolders);
|
|
629
|
+
break;
|
|
630
|
+
case "parameters-template":
|
|
631
|
+
ir = (0, parameters_template_1.compileParametersTemplateRecipe)(recipe, perRecipeContext, emittedFolders);
|
|
632
|
+
break;
|
|
633
|
+
case "enumeration":
|
|
634
|
+
ir = (0, enumeration_1.compileEnumerationRecipe)(recipe, perRecipeContext, emittedFolders);
|
|
635
|
+
break;
|
|
636
|
+
default:
|
|
637
|
+
ir = compileRecipe(recipe, perRecipeContext);
|
|
638
|
+
}
|
|
639
|
+
irByHandle.set(recipe.handle, ir);
|
|
640
|
+
}
|
|
641
|
+
// Preserve INPUT order for IR output — section-first ordering was a
|
|
642
|
+
// compile-time emission concern only, not a wire-order requirement.
|
|
643
|
+
const irs = recipes.map((r) => irByHandle.get(r.handle));
|
|
644
|
+
const setSite = (0, shared_1.siteOf)(context);
|
|
645
|
+
const entries = [];
|
|
646
|
+
for (const recipe of recipes) {
|
|
647
|
+
if (recipe.kind !== "page-design")
|
|
648
|
+
continue;
|
|
649
|
+
if (recipe.appliesTo.length === 0)
|
|
650
|
+
continue;
|
|
651
|
+
const designGuid = (0, guids_1.pageDesignId)(setSite, recipe.handle);
|
|
652
|
+
for (const tplHandle of recipe.appliesTo) {
|
|
653
|
+
entries.push({ templateGuid: (0, guids_1.templateId)(setSite, tplHandle), designGuid });
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
if (entries.length > 0) {
|
|
657
|
+
entries.sort((a, b) => a.templateGuid === b.templateGuid
|
|
658
|
+
? a.designGuid.localeCompare(b.designGuid)
|
|
659
|
+
: a.templateGuid.localeCompare(b.templateGuid));
|
|
660
|
+
const aggregateOp = {
|
|
661
|
+
op: "SetField",
|
|
662
|
+
policy: (0, policy_1.policyFor)("composition-structure"),
|
|
663
|
+
label: "templates-mapping:aggregate",
|
|
664
|
+
itemRefKey: guids_1.PAGE_DESIGNS_ROOT_REF_KEY,
|
|
665
|
+
fieldId: sitecore_templates_1.COMPOSITION_FIELDS.TEMPLATES_MAPPING,
|
|
666
|
+
value: { kind: "string", value: (0, templates_mapping_1.encodeTemplatesMapping)(entries) },
|
|
667
|
+
};
|
|
668
|
+
irs.push(operations_1.OperationIrSchema.parse({
|
|
669
|
+
schemaVersion: "1",
|
|
670
|
+
recipeHandle: exports.TEMPLATES_MAPPING_AGGREGATE_HANDLE,
|
|
671
|
+
operations: [aggregateOp],
|
|
672
|
+
}));
|
|
673
|
+
}
|
|
674
|
+
// Available Renderings cross-recipe aggregate. Emitted last in the
|
|
675
|
+
// IR list so per-recipe rendering CreateItem ops have already run
|
|
676
|
+
// by the time this IR's SetField resolves the ref-recipe-list.
|
|
677
|
+
const availableRenderings = buildAvailableRenderingsAggregate(recipes, context);
|
|
678
|
+
if (availableRenderings) {
|
|
679
|
+
irs.push(availableRenderings);
|
|
680
|
+
}
|
|
681
|
+
// Shared Data Folder coalescer aggregate — one shared template per
|
|
682
|
+
// `(site, subfolder)` pair targeted by ≥2 component-template recipes.
|
|
683
|
+
// Emitted as a sibling synthetic IR so per-recipe folder ITEMs (whose
|
|
684
|
+
// `templateOf` is `sharedDataFolderTemplateId(...)`) have a target to
|
|
685
|
+
// resolve against the captured-itemId map at apply time. Per-recipe
|
|
686
|
+
// datasource template `CreateItem` ops also need to land before the
|
|
687
|
+
// Insert Options SetField resolves; per-recipe IRs come earlier in
|
|
688
|
+
// the returned list so the executor processes them first.
|
|
689
|
+
const sharedDataFolders = buildSharedDataFoldersAggregate(sharedSubfolderContributions, context, setSiteForShared);
|
|
690
|
+
if (sharedDataFolders) {
|
|
691
|
+
irs.push(sharedDataFolders);
|
|
692
|
+
}
|
|
693
|
+
// Site Data folder ROOT Standard Values aggregator — emits the
|
|
694
|
+
// `__Standard Values` item under `<contentItemsRoot>` with Insert
|
|
695
|
+
// Options aggregating the generic Folder template, every per-recipe
|
|
696
|
+
// singleton Data Folder template, and every shared Data Folder
|
|
697
|
+
// template. Without this aggregate, authors right-clicking → Insert
|
|
698
|
+
// at the data root see every template in Sitecore (the Folder root
|
|
699
|
+
// has no Insert Options of its own).
|
|
700
|
+
const siteDataRoot = buildSiteDataRootAggregate(recipes, sharedSubfolders, context, setSiteForShared);
|
|
701
|
+
if (siteDataRoot) {
|
|
702
|
+
irs.push(siteDataRoot);
|
|
703
|
+
}
|
|
704
|
+
// Enumerations root Standard Values aggregator — Insert Options
|
|
705
|
+
// restrict authors' right-click → Insert at `<enumerationsRoot>` to
|
|
706
|
+
// the generic Folder template + each EnumerationRecipe's folder
|
|
707
|
+
// item. Without this, authors see every template in Sitecore.
|
|
708
|
+
const enumerationsRoot = buildEnumerationsRootAggregate(recipes, context, setSiteForShared);
|
|
709
|
+
if (enumerationsRoot) {
|
|
710
|
+
irs.push(enumerationsRoot);
|
|
711
|
+
}
|
|
712
|
+
return irs;
|
|
713
|
+
}
|
|
714
|
+
/** Front-door dispatcher — accepts any registered recipe kind. */
|
|
715
|
+
function compileRecipe(input, context) {
|
|
716
|
+
const recipe = recipe_1.RecipeSchema.parse(input);
|
|
717
|
+
switch (recipe.kind) {
|
|
718
|
+
case "component-section":
|
|
719
|
+
return (0, component_section_1.compileComponentSectionRecipe)(recipe, context);
|
|
720
|
+
case "component-template":
|
|
721
|
+
return (0, component_template_1.compileComponentTemplateRecipe)(recipe, context);
|
|
722
|
+
case "content-template":
|
|
723
|
+
return (0, content_template_1.compileContentTemplateRecipe)(recipe, context);
|
|
724
|
+
case "content-item":
|
|
725
|
+
return (0, content_item_1.compileContentItemRecipe)(recipe, context);
|
|
726
|
+
case "parameters-template":
|
|
727
|
+
return (0, parameters_template_1.compileParametersTemplateRecipe)(recipe, context);
|
|
728
|
+
case "section-definition":
|
|
729
|
+
return (0, section_definition_1.compileSectionDefinitionRecipe)(recipe, context);
|
|
730
|
+
case "partial-design":
|
|
731
|
+
return (0, partial_design_1.compilePartialDesignRecipe)(recipe, context);
|
|
732
|
+
case "page-design":
|
|
733
|
+
return (0, page_design_1.compilePageDesignRecipe)(recipe, context);
|
|
734
|
+
case "site-template":
|
|
735
|
+
return (0, site_template_1.compileSiteTemplateRecipe)(recipe, context);
|
|
736
|
+
case "site":
|
|
737
|
+
return (0, site_1.compileSiteRecipe)(recipe, context);
|
|
738
|
+
case "enumeration":
|
|
739
|
+
return (0, enumeration_1.compileEnumerationRecipe)(recipe, context);
|
|
740
|
+
}
|
|
741
|
+
}
|