@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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer for the structured source fields on `SitecoreFieldAugment`.
|
|
3
|
+
*
|
|
4
|
+
* The recipe author surface decomposes Sitecore's `Source` field into
|
|
5
|
+
* orthogonal pieces:
|
|
6
|
+
*
|
|
7
|
+
* sourceTypes string[] — picker filter (template handles)
|
|
8
|
+
* sourceQuery string — where to look (Sitecore Query)
|
|
9
|
+
* sourceScope string — where to look (fixed content path)
|
|
10
|
+
* sourceRaw string — escape hatch (verbatim Source string)
|
|
11
|
+
*
|
|
12
|
+
* `renderSourceFields` composes them into the URL-encoded Source value
|
|
13
|
+
* Sitecore expects. The combinations preserve longstanding Sitecore
|
|
14
|
+
* semantics:
|
|
15
|
+
*
|
|
16
|
+
* sourceQuery alone → `query:<query>` (Droplist shorthand)
|
|
17
|
+
* sourceTypes alone → `IncludeTemplatesForSelection={GUID},...`
|
|
18
|
+
* sourceScope alone → `DataSource=<path>`
|
|
19
|
+
* sourceQuery + types → `DataSource=query:<query>&IncludeTemplatesForSelection=...`
|
|
20
|
+
* sourceScope + types → `DataSource=<path>&IncludeTemplatesForSelection=...`
|
|
21
|
+
* sourceRaw → verbatim, ignores everything else
|
|
22
|
+
*
|
|
23
|
+
* Authors who need a Source form outside this surface (e.g. a bare
|
|
24
|
+
* `/sitecore/content/Tags` Treelist source) use `sourceRaw`.
|
|
25
|
+
*/
|
|
26
|
+
export interface SourceFields {
|
|
27
|
+
sourceTypes?: readonly string[];
|
|
28
|
+
sourceQuery?: string;
|
|
29
|
+
sourceScope?: string;
|
|
30
|
+
sourceRaw?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compose structured source fields into the Sitecore-encoded Source string.
|
|
34
|
+
* `resolveHandle` maps a recipe handle to its deterministic template GUID
|
|
35
|
+
* (typically `templateId(handle)` from `guids.ts`).
|
|
36
|
+
*
|
|
37
|
+
* Returns `undefined` when no source fields are set — callers can use this
|
|
38
|
+
* to decide whether to emit the Source field at all.
|
|
39
|
+
*/
|
|
40
|
+
export declare const renderSourceFields: (fields: SourceFields, resolveHandle: (handle: string) => string) => string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* True when the structured source fields require recipe-handle resolution
|
|
43
|
+
* to render. The compiler uses this to decide between emitting a plain
|
|
44
|
+
* `string` RefValue at compile time vs deferring to the executor via
|
|
45
|
+
* `ref-source-fields`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const sourceFieldsNeedHandleResolution: (fields: SourceFields) => boolean;
|
|
48
|
+
//# sourceMappingURL=source-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-fields.d.ts","sourceRoot":"","sources":["../../../src/recipe/schema/source-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,YAAY,EACpB,eAAe,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,KACxC,MAAM,GAAG,SAmCX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAAI,QAAQ,YAAY,KAAG,OACJ,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Renderer for the structured source fields on `SitecoreFieldAugment`.
|
|
4
|
+
*
|
|
5
|
+
* The recipe author surface decomposes Sitecore's `Source` field into
|
|
6
|
+
* orthogonal pieces:
|
|
7
|
+
*
|
|
8
|
+
* sourceTypes string[] — picker filter (template handles)
|
|
9
|
+
* sourceQuery string — where to look (Sitecore Query)
|
|
10
|
+
* sourceScope string — where to look (fixed content path)
|
|
11
|
+
* sourceRaw string — escape hatch (verbatim Source string)
|
|
12
|
+
*
|
|
13
|
+
* `renderSourceFields` composes them into the URL-encoded Source value
|
|
14
|
+
* Sitecore expects. The combinations preserve longstanding Sitecore
|
|
15
|
+
* semantics:
|
|
16
|
+
*
|
|
17
|
+
* sourceQuery alone → `query:<query>` (Droplist shorthand)
|
|
18
|
+
* sourceTypes alone → `IncludeTemplatesForSelection={GUID},...`
|
|
19
|
+
* sourceScope alone → `DataSource=<path>`
|
|
20
|
+
* sourceQuery + types → `DataSource=query:<query>&IncludeTemplatesForSelection=...`
|
|
21
|
+
* sourceScope + types → `DataSource=<path>&IncludeTemplatesForSelection=...`
|
|
22
|
+
* sourceRaw → verbatim, ignores everything else
|
|
23
|
+
*
|
|
24
|
+
* Authors who need a Source form outside this surface (e.g. a bare
|
|
25
|
+
* `/sitecore/content/Tags` Treelist source) use `sourceRaw`.
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.sourceFieldsNeedHandleResolution = exports.renderSourceFields = void 0;
|
|
29
|
+
const formatGuidCurly = (guid) => `{${guid.toUpperCase()}}`;
|
|
30
|
+
/**
|
|
31
|
+
* Compose structured source fields into the Sitecore-encoded Source string.
|
|
32
|
+
* `resolveHandle` maps a recipe handle to its deterministic template GUID
|
|
33
|
+
* (typically `templateId(handle)` from `guids.ts`).
|
|
34
|
+
*
|
|
35
|
+
* Returns `undefined` when no source fields are set — callers can use this
|
|
36
|
+
* to decide whether to emit the Source field at all.
|
|
37
|
+
*/
|
|
38
|
+
const renderSourceFields = (fields, resolveHandle) => {
|
|
39
|
+
if (fields.sourceRaw !== undefined) {
|
|
40
|
+
return fields.sourceRaw;
|
|
41
|
+
}
|
|
42
|
+
const types = fields.sourceTypes && fields.sourceTypes.length > 0 ? fields.sourceTypes : undefined;
|
|
43
|
+
const query = fields.sourceQuery;
|
|
44
|
+
const scope = fields.sourceScope;
|
|
45
|
+
if (!types && !query && !scope) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const includeTemplates = types
|
|
49
|
+
? `IncludeTemplatesForSelection=${types.map((h) => formatGuidCurly(resolveHandle(h))).join(",")}`
|
|
50
|
+
: undefined;
|
|
51
|
+
// Standalone forms preserve Sitecore's per-field-type shorthand.
|
|
52
|
+
if (!types && query && !scope) {
|
|
53
|
+
return `query:${query}`;
|
|
54
|
+
}
|
|
55
|
+
if (types && !query && !scope) {
|
|
56
|
+
return includeTemplates;
|
|
57
|
+
}
|
|
58
|
+
if (!types && !query && scope) {
|
|
59
|
+
return `DataSource=${scope}`;
|
|
60
|
+
}
|
|
61
|
+
// Combined form — URL-encoded property bag.
|
|
62
|
+
const parts = [];
|
|
63
|
+
if (query)
|
|
64
|
+
parts.push(`DataSource=query:${query}`);
|
|
65
|
+
else if (scope)
|
|
66
|
+
parts.push(`DataSource=${scope}`);
|
|
67
|
+
if (includeTemplates)
|
|
68
|
+
parts.push(includeTemplates);
|
|
69
|
+
return parts.join("&");
|
|
70
|
+
};
|
|
71
|
+
exports.renderSourceFields = renderSourceFields;
|
|
72
|
+
/**
|
|
73
|
+
* True when the structured source fields require recipe-handle resolution
|
|
74
|
+
* to render. The compiler uses this to decide between emitting a plain
|
|
75
|
+
* `string` RefValue at compile time vs deferring to the executor via
|
|
76
|
+
* `ref-source-fields`.
|
|
77
|
+
*/
|
|
78
|
+
const sourceFieldsNeedHandleResolution = (fields) => Array.isArray(fields.sourceTypes) && fields.sourceTypes.length > 0;
|
|
79
|
+
exports.sourceFieldsNeedHandleResolution = sourceFieldsNeedHandleResolution;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RecipeCompileOptions } from "./shared";
|
|
2
|
+
/**
|
|
3
|
+
* `scai recipe compile` — pure-logic: recipe (.ts or .json) → Operation IR JSON.
|
|
4
|
+
*
|
|
5
|
+
* Resolves inputs from `--input` (single file) or the config `recipes`
|
|
6
|
+
* glob (zero-to-many files). Writes one IR per recipe at
|
|
7
|
+
* `--output` (single mode) or `<dir>/<handle>.ir.json` (multi mode).
|
|
8
|
+
*
|
|
9
|
+
* No tenant access — the IR is tenant-shaped (`templatesRoot`,
|
|
10
|
+
* `renderingsRoot` are CLI inputs), so re-compile if the same recipe
|
|
11
|
+
* lands in a different tenant tree.
|
|
12
|
+
*/
|
|
13
|
+
export declare const runRecipeCompile: (options: RecipeCompileOptions) => Promise<void>;
|
|
14
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/recipe/tasks/compile.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS,oBAAoB,KAAG,OAAO,CAAC,IAAI,CAsFlF,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runRecipeCompile = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const config_1 = require("../../config");
|
|
9
|
+
const errors_1 = require("../../shared/errors");
|
|
10
|
+
const compile_1 = require("../compile");
|
|
11
|
+
const io_1 = require("../io");
|
|
12
|
+
const shared_1 = require("./shared");
|
|
13
|
+
/**
|
|
14
|
+
* `scai recipe compile` — pure-logic: recipe (.ts or .json) → Operation IR JSON.
|
|
15
|
+
*
|
|
16
|
+
* Resolves inputs from `--input` (single file) or the config `recipes`
|
|
17
|
+
* glob (zero-to-many files). Writes one IR per recipe at
|
|
18
|
+
* `--output` (single mode) or `<dir>/<handle>.ir.json` (multi mode).
|
|
19
|
+
*
|
|
20
|
+
* No tenant access — the IR is tenant-shaped (`templatesRoot`,
|
|
21
|
+
* `renderingsRoot` are CLI inputs), so re-compile if the same recipe
|
|
22
|
+
* lands in a different tenant tree.
|
|
23
|
+
*/
|
|
24
|
+
const runRecipeCompile = async (options) => {
|
|
25
|
+
const logger = (0, shared_1.toLogger)(options);
|
|
26
|
+
const root = (0, config_1.readRootConfiguration)(options.config ?? process.cwd(), options.environmentName);
|
|
27
|
+
// Resolve parent paths from CLI flags or active env profile (when given).
|
|
28
|
+
const envName = options.environmentName ?? root.defaultEnvironment;
|
|
29
|
+
const environment = envName ? root.environments[envName] : undefined;
|
|
30
|
+
const { templatesRoot, renderingsRoot } = (0, shared_1.resolveRecipeRoots)(options, environment, envName ?? "(no environment)");
|
|
31
|
+
// Phase 2 per-site folder layout roots — optional. When unset the
|
|
32
|
+
// compiler falls back to `templatesRoot` for both, which means
|
|
33
|
+
// section-aware components nest under templatesRoot (mid-migration
|
|
34
|
+
// fallback) and content templates land mixed in with components.
|
|
35
|
+
const componentsRoot = options.componentsRoot ?? environment?.componentsRoot;
|
|
36
|
+
const contentModelsRoot = options.contentModelsRoot ?? environment?.contentModelsRoot;
|
|
37
|
+
// Phase 4 composition roots — optional. The per-recipe compile fns
|
|
38
|
+
// throw with their own clear messages when a partial-design /
|
|
39
|
+
// page-design / content-item recipe is in play but the corresponding
|
|
40
|
+
// root is missing.
|
|
41
|
+
const partialDesignsRoot = options.partialDesignsRoot ?? environment?.partialDesignsRoot;
|
|
42
|
+
const pageDesignsRoot = options.pageDesignsRoot ?? environment?.pageDesignsRoot;
|
|
43
|
+
const contentItemsRoot = options.contentItemsRoot ?? environment?.contentItemsRoot;
|
|
44
|
+
const headlessVariantsRoot = options.headlessVariantsRoot ?? environment?.headlessVariantsRoot;
|
|
45
|
+
const availableRenderingsRoot = options.availableRenderingsRoot ?? environment?.availableRenderingsRoot;
|
|
46
|
+
const enumerationsRoot = options.enumerationsRoot ?? environment?.enumerationsRoot;
|
|
47
|
+
const { files, source } = await (0, shared_1.resolveRecipeInputs)(options, root);
|
|
48
|
+
if (options.output && files.length > 1) {
|
|
49
|
+
throw (0, errors_1.createCliError)("--output cannot be combined with multi-file compile.", "INPUT_INVALID", {
|
|
50
|
+
hint: "Compile a single recipe with --input <file> --output <ir>, or omit --output to write per-recipe IRs to <dir>/<handle>.ir.json.",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const results = [];
|
|
54
|
+
for (const file of files) {
|
|
55
|
+
const recipe = await (0, io_1.loadRecipe)(file);
|
|
56
|
+
const ir = (0, compile_1.compileRecipe)(recipe, {
|
|
57
|
+
templatesRoot,
|
|
58
|
+
renderingsRoot,
|
|
59
|
+
componentsRoot,
|
|
60
|
+
contentModelsRoot,
|
|
61
|
+
partialDesignsRoot,
|
|
62
|
+
pageDesignsRoot,
|
|
63
|
+
contentItemsRoot,
|
|
64
|
+
headlessVariantsRoot,
|
|
65
|
+
availableRenderingsRoot,
|
|
66
|
+
enumerationsRoot,
|
|
67
|
+
});
|
|
68
|
+
const outputPath = options.output ?? (0, io_1.defaultIrPath)(recipe.handle, node_path_1.default.dirname(node_path_1.default.resolve(file)));
|
|
69
|
+
await (0, io_1.writeIr)(outputPath, ir);
|
|
70
|
+
results.push({
|
|
71
|
+
recipeHandle: recipe.handle,
|
|
72
|
+
input: file,
|
|
73
|
+
output: outputPath,
|
|
74
|
+
operationCount: ir.operations.length,
|
|
75
|
+
});
|
|
76
|
+
if (!logger.isJson()) {
|
|
77
|
+
logger.info(`Compiled ${recipe.handle} → ${outputPath}`, "green");
|
|
78
|
+
logger.info(` ${ir.operations.length} operation${ir.operations.length === 1 ? "" : "s"}.`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (logger.isJson()) {
|
|
82
|
+
logger.json({
|
|
83
|
+
command: "recipe.compile",
|
|
84
|
+
source,
|
|
85
|
+
results,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.runRecipeCompile = runRecipeCompile;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExecutionResult } from "../execute";
|
|
2
|
+
import type { RecipePushOptions } from "./shared";
|
|
3
|
+
/**
|
|
4
|
+
* `scai recipe diff` — read-only "what would change" against a tenant.
|
|
5
|
+
*
|
|
6
|
+
* Drives the same input resolution, in-memory compile, and planner
|
|
7
|
+
* as `recipe push`, but read-only by construction: `whatIf` is forced
|
|
8
|
+
* on, `allowWrite` is ignored (no `ensureAllowWrite` gate fires
|
|
9
|
+
* because dry-run mode skips it), and no Sites API job ever dispatches.
|
|
10
|
+
*
|
|
11
|
+
* Operators reach for `diff` when reviewing a change set; reach for
|
|
12
|
+
* `recipe push --what-if` when they're about to apply and want a
|
|
13
|
+
* last-look. Same output, different framing.
|
|
14
|
+
*/
|
|
15
|
+
export type RecipeDiffOptions = Omit<RecipePushOptions, "whatIf" | "allowWrite">;
|
|
16
|
+
export declare const runRecipeDiff: (options: RecipeDiffOptions) => Promise<ExecutionResult[]>;
|
|
17
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/recipe/tasks/diff.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;AAEjF,eAAO,MAAM,aAAa,GAAU,SAAS,iBAAiB,KAAG,OAAO,CAAC,eAAe,EAAE,CAC7C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runRecipeDiff = void 0;
|
|
4
|
+
const push_1 = require("./push");
|
|
5
|
+
const runRecipeDiff = async (options) => (0, push_1.runRecipePush)({ ...options, whatIf: true });
|
|
6
|
+
exports.runRecipeDiff = runRecipeDiff;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { runRecipeCompile } from "./compile";
|
|
2
|
+
export { runRecipeDiff } from "./diff";
|
|
3
|
+
export type { RecipeDiffOptions } from "./diff";
|
|
4
|
+
export { runRecipePlan } from "./plan";
|
|
5
|
+
export { runRecipePush } from "./push";
|
|
6
|
+
export { runRecipePruneDefaults } from "./prune-defaults";
|
|
7
|
+
export type { RecipePruneDefaultsOptions, RecipePruneDefaultsResult } from "./prune-defaults";
|
|
8
|
+
export type { RecipeCompileOptions, RecipePlanOptions, RecipePushOptions } from "./shared";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/recipe/tasks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,YAAY,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC9F,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runRecipePruneDefaults = exports.runRecipePush = exports.runRecipePlan = exports.runRecipeDiff = exports.runRecipeCompile = void 0;
|
|
4
|
+
var compile_1 = require("./compile");
|
|
5
|
+
Object.defineProperty(exports, "runRecipeCompile", { enumerable: true, get: function () { return compile_1.runRecipeCompile; } });
|
|
6
|
+
var diff_1 = require("./diff");
|
|
7
|
+
Object.defineProperty(exports, "runRecipeDiff", { enumerable: true, get: function () { return diff_1.runRecipeDiff; } });
|
|
8
|
+
var plan_1 = require("./plan");
|
|
9
|
+
Object.defineProperty(exports, "runRecipePlan", { enumerable: true, get: function () { return plan_1.runRecipePlan; } });
|
|
10
|
+
var push_1 = require("./push");
|
|
11
|
+
Object.defineProperty(exports, "runRecipePush", { enumerable: true, get: function () { return push_1.runRecipePush; } });
|
|
12
|
+
var prune_defaults_1 = require("./prune-defaults");
|
|
13
|
+
Object.defineProperty(exports, "runRecipePruneDefaults", { enumerable: true, get: function () { return prune_defaults_1.runRecipePruneDefaults; } });
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placeholder allow-controls resolver — runs after `runRecipePush`'s
|
|
3
|
+
* IR loop to register each recipe's rendering with the SXA placeholder
|
|
4
|
+
* slots it declares compatibility with.
|
|
5
|
+
*
|
|
6
|
+
* Why this lives outside the IR pipeline: scai's IR ops target items
|
|
7
|
+
* by recipe-internal refKey or known content-tree path. Placeholder
|
|
8
|
+
* Settings items are looked up by their `Placeholder Key` *field
|
|
9
|
+
* value*, which the compiler can't know in advance — different
|
|
10
|
+
* tenants name their placeholder items differently while sharing the
|
|
11
|
+
* same key. So this step does a runtime walk of the configured roots
|
|
12
|
+
* and matches by field, then updates `Allowed Controls` directly via
|
|
13
|
+
* the Authoring API.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent: existing entries on `Allowed Controls` are preserved;
|
|
16
|
+
* we only append IDs that aren't already there. Safe to re-run.
|
|
17
|
+
*/
|
|
18
|
+
import type { AuthoringApiClient } from "../api/client";
|
|
19
|
+
import type { Recipe } from "../schema/recipe";
|
|
20
|
+
export interface PlaceholderAllowResult {
|
|
21
|
+
/** Number of placeholder items whose Allowed Controls field was updated. */
|
|
22
|
+
patched: number;
|
|
23
|
+
/** Number of `(placeholder, rendering)` pairs added across all updates. */
|
|
24
|
+
totalAdded: number;
|
|
25
|
+
/** Recipe handles whose rendering item couldn't be resolved on the tenant. */
|
|
26
|
+
unresolvedRecipeHandles: string[];
|
|
27
|
+
/** Recipe placeholder keys with no matching Placeholder item under any root. */
|
|
28
|
+
unmatchedPlaceholderKeys: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface PlaceholderAllowOptions {
|
|
31
|
+
client: AuthoringApiClient;
|
|
32
|
+
recipes: readonly Recipe[];
|
|
33
|
+
renderingsRoot: string;
|
|
34
|
+
placeholderSettingsRoots: readonly string[];
|
|
35
|
+
/** When false, plan but do not write. */
|
|
36
|
+
apply: boolean;
|
|
37
|
+
/** Per-update progress hook. Called with placeholder path + how many entries were added. */
|
|
38
|
+
onUpdate?: (placeholderPath: string, added: number) => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve every component-template recipe's `placeholders` declarations
|
|
42
|
+
* against the tenant and append the recipe's rendering itemId to each
|
|
43
|
+
* matching `Allowed Controls` field. Returns a summary so callers can
|
|
44
|
+
* surface the resolver's reach in their command output.
|
|
45
|
+
*
|
|
46
|
+
* Failure modes (each surfaced in the result, none fatal):
|
|
47
|
+
* - Rendering item missing on tenant → recipe handle in
|
|
48
|
+
* `unresolvedRecipeHandles`; that recipe's placeholders are skipped.
|
|
49
|
+
* - Placeholder key never matched → key in `unmatchedPlaceholderKeys`;
|
|
50
|
+
* other matches still apply.
|
|
51
|
+
*/
|
|
52
|
+
export declare const applyPlaceholderAllowControls: (options: PlaceholderAllowOptions) => Promise<PlaceholderAllowResult>;
|
|
53
|
+
//# sourceMappingURL=placeholder-allow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-allow.d.ts","sourceRoot":"","sources":["../../../src/recipe/tasks/placeholder-allow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,eAAe,CAAC;AAMpE,OAAO,KAAK,EAA2B,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAsHxE,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,gFAAgF;IAChF,wBAAwB,EAAE,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,yCAAyC;IACzC,KAAK,EAAE,OAAO,CAAC;IACf,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,uBAAuB,KAC/B,OAAO,CAAC,sBAAsB,CAqGhC,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Placeholder allow-controls resolver — runs after `runRecipePush`'s
|
|
4
|
+
* IR loop to register each recipe's rendering with the SXA placeholder
|
|
5
|
+
* slots it declares compatibility with.
|
|
6
|
+
*
|
|
7
|
+
* Why this lives outside the IR pipeline: scai's IR ops target items
|
|
8
|
+
* by recipe-internal refKey or known content-tree path. Placeholder
|
|
9
|
+
* Settings items are looked up by their `Placeholder Key` *field
|
|
10
|
+
* value*, which the compiler can't know in advance — different
|
|
11
|
+
* tenants name their placeholder items differently while sharing the
|
|
12
|
+
* same key. So this step does a runtime walk of the configured roots
|
|
13
|
+
* and matches by field, then updates `Allowed Controls` directly via
|
|
14
|
+
* the Authoring API.
|
|
15
|
+
*
|
|
16
|
+
* Idempotent: existing entries on `Allowed Controls` are preserved;
|
|
17
|
+
* we only append IDs that aren't already there. Safe to re-run.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.applyPlaceholderAllowControls = void 0;
|
|
21
|
+
const ref_encoding_1 = require("../api/ref-encoding");
|
|
22
|
+
const sitecore_templates_1 = require("../ir/sitecore-templates");
|
|
23
|
+
const joinPath = (parent, name) => parent.endsWith("/") ? `${parent}${name}` : `${parent}/${name}`;
|
|
24
|
+
const isPlaceholder = (item) => normaliseGuid(item.templateId) === normaliseGuid(sitecore_templates_1.PLACEHOLDER_TEMPLATE_ID);
|
|
25
|
+
const normaliseGuid = (guid) => guid.replace(/[{}-]/g, "").toLowerCase();
|
|
26
|
+
const toCurly = (guid) => `{${(0, ref_encoding_1.dashifyGuid)(guid).toUpperCase()}}`;
|
|
27
|
+
/**
|
|
28
|
+
* Look up the rendering's itemId for a component-template recipe.
|
|
29
|
+
* Mirrors the path the recipe push compiler emits at:
|
|
30
|
+
* `<renderingsRoot>/<section>/<recipe.name>` (when section is set)
|
|
31
|
+
* `<renderingsRoot>/<recipe.name>` (legacy flat layout)
|
|
32
|
+
*
|
|
33
|
+
* Returns null when the rendering item isn't on the tenant — usually
|
|
34
|
+
* because the recipe's IR aborted before creating it. The caller skips
|
|
35
|
+
* that recipe instead of failing the whole resolver.
|
|
36
|
+
*/
|
|
37
|
+
const resolveRenderingItemId = async (client, renderingsRoot, recipe, sectionName) => {
|
|
38
|
+
const path = sectionName
|
|
39
|
+
? joinPath(joinPath(renderingsRoot, sectionName), recipe.name)
|
|
40
|
+
: joinPath(renderingsRoot, recipe.name);
|
|
41
|
+
const item = await client.getItem({ path });
|
|
42
|
+
return item ? item.itemId : null;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Walk the configured Placeholder Settings roots once and collect
|
|
46
|
+
* every Placeholder item with its `Placeholder Key` value. Doesn't
|
|
47
|
+
* filter — callers match keys against this collected list. Recursive
|
|
48
|
+
* so nested folders (Partial Design / Page Designs / Container 70 /
|
|
49
|
+
* etc.) are all visited.
|
|
50
|
+
*/
|
|
51
|
+
const collectPlaceholders = async (client, roots) => {
|
|
52
|
+
const found = [];
|
|
53
|
+
const visit = async (path) => {
|
|
54
|
+
const item = await client.getItem({ path });
|
|
55
|
+
if (!item)
|
|
56
|
+
return;
|
|
57
|
+
if (isPlaceholder(item)) {
|
|
58
|
+
const keyField = item.fields.find((f) => normaliseGuid(f.fieldId) ===
|
|
59
|
+
normaliseGuid(sitecore_templates_1.PLACEHOLDER_FIELDS.PLACEHOLDER_KEY));
|
|
60
|
+
const placeholderKey = keyField?.value?.trim();
|
|
61
|
+
if (placeholderKey) {
|
|
62
|
+
found.push({ item, placeholderKey });
|
|
63
|
+
}
|
|
64
|
+
// A Placeholder item may itself contain children (e.g. a default
|
|
65
|
+
// Allowed Controls subtree). Recurse anyway — cheap, and safer
|
|
66
|
+
// than assuming leaf-only.
|
|
67
|
+
}
|
|
68
|
+
const children = await client.getChildren({ path });
|
|
69
|
+
for (const child of children) {
|
|
70
|
+
await visit(child.path);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
for (const root of roots) {
|
|
74
|
+
await visit(root);
|
|
75
|
+
}
|
|
76
|
+
return found;
|
|
77
|
+
};
|
|
78
|
+
const findAllowedControlsValue = (item) => {
|
|
79
|
+
const field = item.fields.find((f) => normaliseGuid(f.fieldId) ===
|
|
80
|
+
normaliseGuid(sitecore_templates_1.PLACEHOLDER_FIELDS.ALLOWED_CONTROLS));
|
|
81
|
+
return field?.value ?? "";
|
|
82
|
+
};
|
|
83
|
+
const splitMultilist = (value) => value
|
|
84
|
+
.split("|")
|
|
85
|
+
.map((entry) => entry.trim())
|
|
86
|
+
.filter((entry) => entry.length > 0);
|
|
87
|
+
const mergeAllowedControls = (existing, toAdd) => {
|
|
88
|
+
// Normalise existing entries to dashed-curly form so de-dup works
|
|
89
|
+
// regardless of what shape was previously stored (some tools write
|
|
90
|
+
// `{NODASH}`, others `{DASHED}`). Final value uses dashed-curly
|
|
91
|
+
// only — that's what Sitecore's Treelist resolver expects.
|
|
92
|
+
const seen = new Set();
|
|
93
|
+
const result = [];
|
|
94
|
+
for (const entry of splitMultilist(existing)) {
|
|
95
|
+
const canonical = toCurly(entry);
|
|
96
|
+
if (seen.has(canonical))
|
|
97
|
+
continue;
|
|
98
|
+
seen.add(canonical);
|
|
99
|
+
result.push(canonical);
|
|
100
|
+
}
|
|
101
|
+
let added = 0;
|
|
102
|
+
for (const itemId of toAdd) {
|
|
103
|
+
const canonical = toCurly(itemId);
|
|
104
|
+
if (seen.has(canonical))
|
|
105
|
+
continue;
|
|
106
|
+
seen.add(canonical);
|
|
107
|
+
result.push(canonical);
|
|
108
|
+
added += 1;
|
|
109
|
+
}
|
|
110
|
+
return { value: result.join("|"), added };
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Resolve every component-template recipe's `placeholders` declarations
|
|
114
|
+
* against the tenant and append the recipe's rendering itemId to each
|
|
115
|
+
* matching `Allowed Controls` field. Returns a summary so callers can
|
|
116
|
+
* surface the resolver's reach in their command output.
|
|
117
|
+
*
|
|
118
|
+
* Failure modes (each surfaced in the result, none fatal):
|
|
119
|
+
* - Rendering item missing on tenant → recipe handle in
|
|
120
|
+
* `unresolvedRecipeHandles`; that recipe's placeholders are skipped.
|
|
121
|
+
* - Placeholder key never matched → key in `unmatchedPlaceholderKeys`;
|
|
122
|
+
* other matches still apply.
|
|
123
|
+
*/
|
|
124
|
+
const applyPlaceholderAllowControls = async (options) => {
|
|
125
|
+
const { client, recipes, renderingsRoot, placeholderSettingsRoots, apply, onUpdate } = options;
|
|
126
|
+
// Build the section handle → name map so we can resolve each
|
|
127
|
+
// component's `section.handle` to a name for the rendering path.
|
|
128
|
+
const sectionsByHandle = new Map();
|
|
129
|
+
for (const recipe of recipes) {
|
|
130
|
+
if (recipe.kind === "component-section") {
|
|
131
|
+
sectionsByHandle.set(recipe.handle, recipe.name);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Collect: placeholderKey → Set<renderingItemId>
|
|
135
|
+
const keyToRenderings = new Map();
|
|
136
|
+
const unresolvedRecipeHandles = [];
|
|
137
|
+
for (const recipe of recipes) {
|
|
138
|
+
if (recipe.kind !== "component-template")
|
|
139
|
+
continue;
|
|
140
|
+
// `placedIn` is the placement allow-list — placeholder keys this
|
|
141
|
+
// rendering can be placed into. Distinct from `placeholders`, which
|
|
142
|
+
// is for slots this component DEFINES (handled elsewhere).
|
|
143
|
+
const keys = recipe.placedIn ?? [];
|
|
144
|
+
if (keys.length === 0)
|
|
145
|
+
continue;
|
|
146
|
+
const sectionName = recipe.section
|
|
147
|
+
? sectionsByHandle.get(recipe.section.handle)
|
|
148
|
+
: undefined;
|
|
149
|
+
const renderingItemId = await resolveRenderingItemId(client, renderingsRoot, recipe, sectionName);
|
|
150
|
+
if (!renderingItemId) {
|
|
151
|
+
unresolvedRecipeHandles.push(recipe.handle);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
for (const key of keys) {
|
|
155
|
+
let bucket = keyToRenderings.get(key);
|
|
156
|
+
if (!bucket) {
|
|
157
|
+
bucket = new Set();
|
|
158
|
+
keyToRenderings.set(key, bucket);
|
|
159
|
+
}
|
|
160
|
+
bucket.add(renderingItemId);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (keyToRenderings.size === 0) {
|
|
164
|
+
return {
|
|
165
|
+
patched: 0,
|
|
166
|
+
totalAdded: 0,
|
|
167
|
+
unresolvedRecipeHandles,
|
|
168
|
+
unmatchedPlaceholderKeys: [],
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (placeholderSettingsRoots.length === 0) {
|
|
172
|
+
// Recipes asked for placeholder registration but no roots are
|
|
173
|
+
// configured — surface that as "every requested key unmatched"
|
|
174
|
+
// so the caller's summary makes the gap visible.
|
|
175
|
+
return {
|
|
176
|
+
patched: 0,
|
|
177
|
+
totalAdded: 0,
|
|
178
|
+
unresolvedRecipeHandles,
|
|
179
|
+
unmatchedPlaceholderKeys: Array.from(keyToRenderings.keys()),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const placeholders = await collectPlaceholders(client, placeholderSettingsRoots);
|
|
183
|
+
const matchedKeys = new Set();
|
|
184
|
+
let patched = 0;
|
|
185
|
+
let totalAdded = 0;
|
|
186
|
+
for (const { item, placeholderKey } of placeholders) {
|
|
187
|
+
const renderings = keyToRenderings.get(placeholderKey);
|
|
188
|
+
if (!renderings)
|
|
189
|
+
continue;
|
|
190
|
+
matchedKeys.add(placeholderKey);
|
|
191
|
+
const existing = findAllowedControlsValue(item);
|
|
192
|
+
const merged = mergeAllowedControls(existing, Array.from(renderings));
|
|
193
|
+
if (merged.added === 0 && merged.value === existing)
|
|
194
|
+
continue;
|
|
195
|
+
if (apply) {
|
|
196
|
+
await client.updateItem({
|
|
197
|
+
itemId: item.itemId,
|
|
198
|
+
fields: [
|
|
199
|
+
{
|
|
200
|
+
fieldId: sitecore_templates_1.PLACEHOLDER_FIELDS.ALLOWED_CONTROLS,
|
|
201
|
+
fieldName: "Allowed Controls",
|
|
202
|
+
value: { kind: "string", value: merged.value },
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
onUpdate?.(item.path, merged.added);
|
|
208
|
+
patched += 1;
|
|
209
|
+
totalAdded += merged.added;
|
|
210
|
+
}
|
|
211
|
+
const unmatchedPlaceholderKeys = [];
|
|
212
|
+
for (const key of keyToRenderings.keys()) {
|
|
213
|
+
if (!matchedKeys.has(key))
|
|
214
|
+
unmatchedPlaceholderKeys.push(key);
|
|
215
|
+
}
|
|
216
|
+
return { patched, totalAdded, unresolvedRecipeHandles, unmatchedPlaceholderKeys };
|
|
217
|
+
};
|
|
218
|
+
exports.applyPlaceholderAllowControls = applyPlaceholderAllowControls;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Plan } from "../plan";
|
|
2
|
+
import { type RecipePlanOptions } from "./shared";
|
|
3
|
+
/**
|
|
4
|
+
* `scai recipe plan` — read-then-diff against a tenant, no mutations.
|
|
5
|
+
*
|
|
6
|
+
* Operates on a pre-compiled IR file (the artifact from `scai recipe
|
|
7
|
+
* compile`). For the recipe-source workflow, use `scai recipe push
|
|
8
|
+
* --what-if` instead — it compiles in-memory and runs the planner.
|
|
9
|
+
*/
|
|
10
|
+
export declare const runRecipePlan: (options: RecipePlanOptions) => Promise<Plan>;
|
|
11
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/recipe/tasks/plan.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAU,SAAS,iBAAiB,KAAG,OAAO,CAAC,IAAI,CAkD5E,CAAC"}
|